aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2009-08-10 00:29:47 -0400
committerDavid S. Miller <davem@davemloft.net>2009-08-10 00:29:47 -0400
commitf222e8b40f2177b1c4cac015b117744c1d3fa3e9 (patch)
tree7c5fc22c08da900e21b0e7ab2376e8e8e44a63c0
parent819ae6a389d4acfab9a7bb874fa1977aa464d14b (diff)
parentf4b9a988685da6386d7f9a72df3098bcc3270526 (diff)
Merge branch 'master' of /home/davem/src/GIT/linux-2.6/
-rw-r--r--.gitignore1
-rw-r--r--CREDITS6
-rw-r--r--Documentation/ABI/testing/sysfs-block37
-rw-r--r--Documentation/arm/memory.txt2
-rw-r--r--Documentation/block/data-integrity.txt4
-rw-r--r--Documentation/cgroups/cpusets.txt12
-rw-r--r--Documentation/driver-model/driver.txt4
-rw-r--r--Documentation/dvb/get_dvb_firmware53
-rw-r--r--Documentation/feature-removal-schedule.txt10
-rw-r--r--Documentation/filesystems/sysfs.txt3
-rw-r--r--Documentation/gcov.txt25
-rw-r--r--Documentation/kernel-parameters.txt13
-rw-r--r--Documentation/kmemleak.txt23
-rw-r--r--Documentation/laptops/thinkpad-acpi.txt127
-rw-r--r--Documentation/leds-lp3944.txt50
-rw-r--r--Documentation/lguest/lguest.c721
-rw-r--r--Documentation/lockdep-design.txt6
-rw-r--r--Documentation/powerpc/booting-without-of.txt1168
-rw-r--r--Documentation/powerpc/dts-bindings/4xx/emac.txt148
-rw-r--r--Documentation/powerpc/dts-bindings/gpio/gpio.txt50
-rw-r--r--Documentation/powerpc/dts-bindings/gpio/led.txt17
-rw-r--r--Documentation/powerpc/dts-bindings/gpio/mdio.txt19
-rw-r--r--Documentation/powerpc/dts-bindings/marvell.txt521
-rw-r--r--Documentation/powerpc/dts-bindings/phy.txt25
-rw-r--r--Documentation/powerpc/dts-bindings/spi-bus.txt57
-rw-r--r--Documentation/powerpc/dts-bindings/usb-ehci.txt25
-rw-r--r--Documentation/powerpc/dts-bindings/xilinx.txt295
-rw-r--r--Documentation/scheduler/sched-rt-group.txt13
-rw-r--r--Documentation/sound/alsa/HD-Audio-Models.txt1
-rw-r--r--Documentation/sound/alsa/Procfile.txt5
-rw-r--r--Documentation/spi/spidev_test.c10
-rw-r--r--Documentation/sysrq.txt7
-rw-r--r--Documentation/video4linux/CARDLIST.em28xx3
-rw-r--r--Documentation/video4linux/gspca.txt32
-rw-r--r--Documentation/x86/00-INDEX2
-rw-r--r--Documentation/x86/exception-tables.txt (renamed from Documentation/exception.txt)202
-rw-r--r--MAINTAINERS2812
-rw-r--r--Makefile12
-rw-r--r--arch/alpha/include/asm/percpu.h6
-rw-r--r--arch/alpha/include/asm/thread_info.h1
-rw-r--r--arch/alpha/include/asm/tlb.h4
-rw-r--r--arch/alpha/kernel/ptrace.c1
-rw-r--r--arch/arm/Kconfig.debug8
-rw-r--r--arch/arm/boot/compressed/misc.c1
-rw-r--r--arch/arm/common/clkdev.c1
-rw-r--r--arch/arm/configs/kb9202_defconfig1158
-rw-r--r--arch/arm/configs/mx27_defconfig270
-rw-r--r--arch/arm/configs/mx3_defconfig151
-rw-r--r--arch/arm/configs/omap3_evm_defconfig2
-rw-r--r--arch/arm/configs/s3c2410_defconfig2
-rw-r--r--arch/arm/configs/s3c6400_defconfig1
-rw-r--r--arch/arm/configs/tct_hammer_defconfig1
-rw-r--r--arch/arm/configs/u300_defconfig96
-rw-r--r--arch/arm/include/asm/atomic.h2
-rw-r--r--arch/arm/include/asm/page.h2
-rw-r--r--arch/arm/include/asm/pgtable.h53
-rw-r--r--arch/arm/include/asm/thread_info.h2
-rw-r--r--arch/arm/include/asm/tlb.h4
-rw-r--r--arch/arm/kernel/entry-common.S2
-rw-r--r--arch/arm/kernel/irq.c24
-rw-r--r--arch/arm/kernel/signal.c4
-rw-r--r--arch/arm/kernel/vmlinux.lds.S15
-rw-r--r--arch/arm/mach-at91/board-sam9g20ek.c54
-rw-r--r--arch/arm/mach-at91/board-sam9rlek.c6
-rw-r--r--arch/arm/mach-at91/include/mach/at_hdmac.h102
-rw-r--r--arch/arm/mach-davinci/board-dm355-evm.c1
-rw-r--r--arch/arm/mach-davinci/board-dm355-leopard.c1
-rw-r--r--arch/arm/mach-davinci/board-dm644x-evm.c1
-rw-r--r--arch/arm/mach-davinci/board-dm646x-evm.c1
-rw-r--r--arch/arm/mach-davinci/board-sffsdr.c1
-rw-r--r--arch/arm/mach-ep93xx/dma-m2p.c1
-rw-r--r--arch/arm/mach-ep93xx/include/mach/ts72xx.h3
-rw-r--r--arch/arm/mach-ep93xx/ts72xx.c18
-rw-r--r--arch/arm/mach-kirkwood/mpp.h2
-rw-r--r--arch/arm/mach-ks8695/include/mach/hardware.h5
-rw-r--r--arch/arm/mach-ks8695/include/mach/timex.h5
-rw-r--r--arch/arm/mach-ks8695/pci.c3
-rw-r--r--arch/arm/mach-mx3/Kconfig8
-rw-r--r--arch/arm/mach-mx3/Makefile1
-rw-r--r--arch/arm/mach-mx3/armadillo5x0.c63
-rw-r--r--arch/arm/mach-mx3/devices.c1
-rw-r--r--arch/arm/mach-mx3/pcm037.c183
-rw-r--r--arch/arm/mach-mx3/pcm037.h11
-rw-r--r--arch/arm/mach-mx3/pcm037_eet.c204
-rw-r--r--arch/arm/mach-omap1/board-nokia770.c3
-rw-r--r--arch/arm/mach-omap1/mailbox.c2
-rw-r--r--arch/arm/mach-omap1/mcbsp.c1
-rw-r--r--arch/arm/mach-omap2/board-omap3evm.c5
-rw-r--r--arch/arm/mach-omap2/board-rx51-peripherals.c1
-rw-r--r--arch/arm/mach-omap2/gpmc-onenand.c21
-rw-r--r--arch/arm/mach-omap2/id.c22
-rw-r--r--arch/arm/mach-omap2/mailbox.c6
-rw-r--r--arch/arm/mach-omap2/mcbsp.c1
-rw-r--r--arch/arm/mach-omap2/mmc-twl4030.c13
-rw-r--r--arch/arm/mach-omap2/usb-musb.c21
-rw-r--r--arch/arm/mach-pxa/em-x270.c4
-rw-r--r--arch/arm/mach-pxa/include/mach/mfp-pxa300.h6
-rw-r--r--arch/arm/mach-pxa/palmld.c4
-rw-r--r--arch/arm/mach-pxa/palmt5.c4
-rw-r--r--arch/arm/mach-pxa/palmtx.c4
-rw-r--r--arch/arm/mach-pxa/pxa3xx.c2
-rw-r--r--arch/arm/mach-pxa/treo680.c2
-rw-r--r--arch/arm/mach-pxa/zylonite_pxa300.c2
-rw-r--r--arch/arm/mach-pxa/zylonite_pxa320.c2
-rw-r--r--arch/arm/mach-realview/core.c3
-rw-r--r--arch/arm/mach-s3c2410/include/mach/gpio-core.h2
-rw-r--r--arch/arm/mach-s3c2440/mach-mini2440.c3
-rw-r--r--arch/arm/mach-s3c2442/mach-gta02.c3
-rw-r--r--arch/arm/mach-u300/clock.c121
-rw-r--r--arch/arm/mach-u300/core.c4
-rw-r--r--arch/arm/mach-versatile/core.c3
-rw-r--r--arch/arm/mm/proc-syms.c1
-rw-r--r--arch/arm/plat-mxc/include/mach/iomux-mx3.h2
-rw-r--r--arch/arm/plat-omap/dma.c13
-rw-r--r--arch/arm/plat-omap/gpio.c1
-rw-r--r--arch/arm/plat-omap/include/mach/cpu.h22
-rw-r--r--arch/arm/plat-omap/include/mach/dma.h15
-rw-r--r--arch/arm/plat-omap/include/mach/io.h2
-rw-r--r--arch/arm/plat-omap/iommu.c2
-rw-r--r--arch/arm/plat-omap/sram.c7
-rw-r--r--arch/arm/plat-pxa/gpio.c9
-rw-r--r--arch/arm/plat-s3c/Makefile2
-rw-r--r--arch/arm/plat-s3c/include/plat/devs.h1
-rw-r--r--arch/arm/plat-s3c24xx/Makefile2
-rw-r--r--arch/arm/plat-s3c24xx/pwm.c4
-rw-r--r--arch/arm/plat-s3c24xx/spi-bus0-gpe11_12_13.c3
-rw-r--r--arch/arm/plat-s3c24xx/spi-bus1-gpg5_6_7.c3
-rw-r--r--arch/arm/plat-s3c64xx/pm.c2
-rw-r--r--arch/arm/plat-s3c64xx/s3c6400-clock.c4
-rw-r--r--arch/arm/plat-stmp3xxx/pinmux.c1
-rw-r--r--arch/avr32/include/asm/pgalloc.h2
-rw-r--r--arch/avr32/include/asm/thread_info.h2
-rw-r--r--arch/avr32/kernel/traps.c13
-rw-r--r--arch/blackfin/include/asm/context.S7
-rw-r--r--arch/blackfin/include/asm/cpu.h1
-rw-r--r--arch/blackfin/include/asm/hardirq.h3
-rw-r--r--arch/blackfin/include/asm/processor.h21
-rw-r--r--arch/blackfin/include/asm/thread_info.h2
-rw-r--r--arch/blackfin/kernel/bfin_dma_5xx.c29
-rw-r--r--arch/blackfin/kernel/bfin_gpio.c6
-rw-r--r--arch/blackfin/kernel/cplb-nompu/cplbinit.c23
-rw-r--r--arch/blackfin/kernel/process.c14
-rw-r--r--arch/blackfin/kernel/ptrace.c1
-rw-r--r--arch/blackfin/kernel/setup.c85
-rw-r--r--arch/blackfin/kernel/sys_bfin.c1
-rw-r--r--arch/blackfin/kernel/traps.c43
-rw-r--r--arch/blackfin/lib/lshrdi3.c16
-rw-r--r--arch/blackfin/mach-bf518/boards/ezbrd.c2
-rw-r--r--arch/blackfin/mach-bf518/include/mach/anomaly.h2
-rw-r--r--arch/blackfin/mach-bf518/include/mach/bfin_serial_5xx.h2
-rw-r--r--arch/blackfin/mach-bf527/boards/cm_bf527.c2
-rw-r--r--arch/blackfin/mach-bf527/boards/ezbrd.c2
-rw-r--r--arch/blackfin/mach-bf527/boards/ezkit.c2
-rw-r--r--arch/blackfin/mach-bf527/include/mach/anomaly.h4
-rw-r--r--arch/blackfin/mach-bf527/include/mach/bfin_serial_5xx.h2
-rw-r--r--arch/blackfin/mach-bf533/boards/stamp.c2
-rw-r--r--arch/blackfin/mach-bf533/include/mach/anomaly.h1
-rw-r--r--arch/blackfin/mach-bf533/include/mach/bfin_serial_5xx.h2
-rw-r--r--arch/blackfin/mach-bf537/boards/stamp.c4
-rw-r--r--arch/blackfin/mach-bf537/include/mach/anomaly.h2
-rw-r--r--arch/blackfin/mach-bf537/include/mach/bfin_serial_5xx.h2
-rw-r--r--arch/blackfin/mach-bf538/include/mach/anomaly.h2
-rw-r--r--arch/blackfin/mach-bf538/include/mach/bfin_serial_5xx.h2
-rw-r--r--arch/blackfin/mach-bf548/boards/ezkit.c2
-rw-r--r--arch/blackfin/mach-bf548/include/mach/anomaly.h2
-rw-r--r--arch/blackfin/mach-bf561/include/mach/anomaly.h1
-rw-r--r--arch/blackfin/mach-bf561/include/mach/bfin_serial_5xx.h2
-rw-r--r--arch/blackfin/mach-bf561/include/mach/mem_map.h23
-rw-r--r--arch/blackfin/mach-common/entry.S12
-rw-r--r--arch/blackfin/mach-common/smp.c10
-rw-r--r--arch/cris/include/asm/pgalloc.h2
-rw-r--r--arch/cris/include/asm/thread_info.h4
-rw-r--r--arch/cris/kernel/sys_cris.c1
-rw-r--r--arch/frv/Kconfig1
-rw-r--r--arch/frv/include/asm/atomic.h68
-rw-r--r--arch/frv/include/asm/perf_counter.h17
-rw-r--r--arch/frv/include/asm/pgalloc.h4
-rw-r--r--arch/frv/include/asm/pgtable.h2
-rw-r--r--arch/frv/include/asm/system.h2
-rw-r--r--arch/frv/include/asm/thread_info.h4
-rw-r--r--arch/frv/include/asm/unistd.h4
-rw-r--r--arch/frv/kernel/entry.S2
-rw-r--r--arch/frv/kernel/frv_ksyms.c4
-rw-r--r--arch/frv/lib/Makefile4
-rw-r--r--arch/frv/lib/atomic-ops.S3
-rw-r--r--arch/frv/lib/atomic64-ops.S162
-rw-r--r--arch/frv/lib/perf_counter.c19
-rw-r--r--arch/h8300/include/asm/thread_info.h2
-rw-r--r--arch/ia64/include/asm/fpu.h2
-rw-r--r--arch/ia64/include/asm/pgalloc.h6
-rw-r--r--arch/ia64/include/asm/thread_info.h2
-rw-r--r--arch/ia64/include/asm/tlb.h12
-rw-r--r--arch/ia64/include/asm/xen/hypervisor.h1
-rw-r--r--arch/ia64/kernel/dma-mapping.c8
-rw-r--r--arch/ia64/kernel/esi.c2
-rw-r--r--arch/ia64/kernel/perfmon.c2
-rw-r--r--arch/ia64/kernel/ptrace.c1
-rw-r--r--arch/ia64/kernel/salinfo.c2
-rw-r--r--arch/ia64/kvm/kvm_lib.c6
-rw-r--r--arch/ia64/kvm/mmio.c6
-rw-r--r--arch/ia64/kvm/process.c6
-rw-r--r--arch/ia64/kvm/vcpu.c8
-rw-r--r--arch/ia64/kvm/vcpu.h13
-rw-r--r--arch/ia64/kvm/vtlb.c4
-rw-r--r--arch/ia64/pci/pci.c2
-rw-r--r--arch/ia64/sn/kernel/io_common.c3
-rw-r--r--arch/m32r/include/asm/pgalloc.h4
-rw-r--r--arch/m32r/include/asm/thread_info.h4
-rw-r--r--arch/m32r/kernel/ptrace.c1
-rw-r--r--arch/m68k/include/asm/motorola_pgalloc.h6
-rw-r--r--arch/m68k/include/asm/sun3_pgalloc.h4
-rw-r--r--arch/m68k/include/asm/thread_info_mm.h1
-rw-r--r--arch/m68k/include/asm/thread_info_no.h1
-rw-r--r--arch/m68knommu/kernel/process.c21
-rw-r--r--arch/m68knommu/kernel/traps.c6
-rw-r--r--arch/microblaze/Kconfig3
-rw-r--r--arch/microblaze/Makefile35
-rw-r--r--arch/microblaze/include/asm/atomic.h101
-rw-r--r--arch/microblaze/include/asm/bitops.h26
-rw-r--r--arch/microblaze/include/asm/bug.h14
-rw-r--r--arch/microblaze/include/asm/bugs.h18
-rw-r--r--arch/microblaze/include/asm/checksum.h70
-rw-r--r--arch/microblaze/include/asm/fb.h1
-rw-r--r--arch/microblaze/include/asm/hardirq.h14
-rw-r--r--arch/microblaze/include/asm/io.h1
-rw-r--r--arch/microblaze/include/asm/ioctls.h92
-rw-r--r--arch/microblaze/include/asm/ipcbuf.h37
-rw-r--r--arch/microblaze/include/asm/irq.h6
-rw-r--r--arch/microblaze/include/asm/mman.h24
-rw-r--r--arch/microblaze/include/asm/mmu.h7
-rw-r--r--arch/microblaze/include/asm/mmu_context.h2
-rw-r--r--arch/microblaze/include/asm/mmu_context_no.h23
-rw-r--r--arch/microblaze/include/asm/module.h10
-rw-r--r--arch/microblaze/include/asm/msgbuf.h32
-rw-r--r--arch/microblaze/include/asm/param.h31
-rw-r--r--arch/microblaze/include/asm/parport.h1
-rw-r--r--arch/microblaze/include/asm/pci.h2
-rw-r--r--arch/microblaze/include/asm/pgalloc.h4
-rw-r--r--arch/microblaze/include/asm/pgtable.h6
-rw-r--r--arch/microblaze/include/asm/posix_types.h68
-rw-r--r--arch/microblaze/include/asm/prom.h23
-rw-r--r--arch/microblaze/include/asm/scatterlist.h29
-rw-r--r--arch/microblaze/include/asm/sembuf.h35
-rw-r--r--arch/microblaze/include/asm/serial.h15
-rw-r--r--arch/microblaze/include/asm/shmbuf.h43
-rw-r--r--arch/microblaze/include/asm/shmparam.h7
-rw-r--r--arch/microblaze/include/asm/siginfo.h14
-rw-r--r--arch/microblaze/include/asm/signal.h166
-rw-r--r--arch/microblaze/include/asm/socket.h70
-rw-r--r--arch/microblaze/include/asm/sockios.h24
-rw-r--r--arch/microblaze/include/asm/stat.h69
-rw-r--r--arch/microblaze/include/asm/swab.h9
-rw-r--r--arch/microblaze/include/asm/syscalls.h46
-rw-r--r--arch/microblaze/include/asm/system.h3
-rw-r--r--arch/microblaze/include/asm/termbits.h204
-rw-r--r--arch/microblaze/include/asm/termios.h89
-rw-r--r--arch/microblaze/include/asm/thread_info.h4
-rw-r--r--arch/microblaze/include/asm/timex.h6
-rw-r--r--arch/microblaze/include/asm/tlb.h2
-rw-r--r--arch/microblaze/include/asm/types.h39
-rw-r--r--arch/microblaze/include/asm/uaccess.h2
-rw-r--r--arch/microblaze/include/asm/ucontext.h23
-rw-r--r--arch/microblaze/include/asm/unistd.h6
-rw-r--r--arch/microblaze/include/asm/vga.h2
-rw-r--r--arch/microblaze/kernel/Makefile2
-rw-r--r--arch/microblaze/kernel/cpu/cpuinfo-pvr-full.c2
-rw-r--r--arch/microblaze/kernel/cpu/cpuinfo-static.c2
-rw-r--r--arch/microblaze/kernel/cpu/cpuinfo.c2
-rw-r--r--arch/microblaze/kernel/entry-nommu.S20
-rw-r--r--arch/microblaze/kernel/entry.S34
-rw-r--r--arch/microblaze/kernel/head.S17
-rw-r--r--arch/microblaze/kernel/hw_exception_handler.S109
-rw-r--r--arch/microblaze/kernel/module.c19
-rw-r--r--arch/microblaze/kernel/ptrace.c1
-rw-r--r--arch/microblaze/kernel/setup.c8
-rw-r--r--arch/microblaze/kernel/signal.c175
-rw-r--r--arch/microblaze/kernel/sys_microblaze.c118
-rw-r--r--arch/microblaze/kernel/syscall_table.S16
-rw-r--r--arch/microblaze/lib/Makefile2
-rw-r--r--arch/microblaze/lib/checksum.c172
-rw-r--r--arch/microblaze/mm/fault.c15
-rw-r--r--arch/microblaze/mm/init.c6
-rw-r--r--arch/mips/Kconfig29
-rw-r--r--arch/mips/Makefile7
-rw-r--r--arch/mips/alchemy/mtx-1/platform.c14
-rw-r--r--arch/mips/ar7/Makefile11
-rw-r--r--arch/mips/ar7/clock.c427
-rw-r--r--arch/mips/ar7/gpio.c48
-rw-r--r--arch/mips/ar7/irq.c176
-rw-r--r--arch/mips/ar7/memory.c72
-rw-r--r--arch/mips/ar7/platform.c555
-rw-r--r--arch/mips/ar7/prom.c297
-rw-r--r--arch/mips/ar7/setup.c93
-rw-r--r--arch/mips/ar7/time.c30
-rw-r--r--arch/mips/cavium-octeon/Makefile4
-rw-r--r--arch/mips/cavium-octeon/dma-octeon.c2
-rw-r--r--arch/mips/cavium-octeon/pci-common.c137
-rw-r--r--arch/mips/cavium-octeon/smp.c4
-rw-r--r--arch/mips/cobalt/buttons.c2
-rw-r--r--arch/mips/cobalt/lcd.c2
-rw-r--r--arch/mips/cobalt/led.c2
-rw-r--r--arch/mips/cobalt/mtd.c2
-rw-r--r--arch/mips/cobalt/rtc.c2
-rw-r--r--arch/mips/cobalt/serial.c2
-rw-r--r--arch/mips/cobalt/time.c2
-rw-r--r--arch/mips/configs/ar7_defconfig1182
-rw-r--r--arch/mips/dec/ecc-berr.c2
-rw-r--r--arch/mips/dec/int-handler.S2
-rw-r--r--arch/mips/dec/ioasic-irq.c2
-rw-r--r--arch/mips/dec/kn01-berr.c2
-rw-r--r--arch/mips/dec/kn02-irq.c2
-rw-r--r--arch/mips/dec/kn02xa-berr.c2
-rw-r--r--arch/mips/dec/prom/call_o32.S2
-rw-r--r--arch/mips/dec/prom/console.c2
-rw-r--r--arch/mips/dec/time.c2
-rw-r--r--arch/mips/emma/common/Makefile3
-rw-r--r--arch/mips/emma/common/prom.c3
-rw-r--r--arch/mips/emma/markeins/Makefile3
-rw-r--r--arch/mips/emma/markeins/irq.c3
-rw-r--r--arch/mips/emma/markeins/led.c3
-rw-r--r--arch/mips/emma/markeins/platform.c3
-rw-r--r--arch/mips/emma/markeins/setup.c3
-rw-r--r--arch/mips/fw/lib/call_o32.S2
-rw-r--r--arch/mips/gt64120/wrppmc/serial.c2
-rw-r--r--arch/mips/include/asm/amon.h7
-rw-r--r--arch/mips/include/asm/ds1287.h2
-rw-r--r--arch/mips/include/asm/elf.h4
-rw-r--r--arch/mips/include/asm/emma/emma2rh.h3
-rw-r--r--arch/mips/include/asm/emma/markeins.h3
-rw-r--r--arch/mips/include/asm/gcmpregs.h2
-rw-r--r--arch/mips/include/asm/gic.h6
-rw-r--r--arch/mips/include/asm/irq_gt641xx.h2
-rw-r--r--arch/mips/include/asm/mach-ar7/ar7.h178
-rw-r--r--arch/mips/include/asm/mach-ar7/gpio.h110
-rw-r--r--arch/mips/include/asm/mach-ar7/irq.h16
-rw-r--r--arch/mips/include/asm/mach-ar7/prom.h25
-rw-r--r--arch/mips/include/asm/mach-ar7/spaces.h22
-rw-r--r--arch/mips/include/asm/mach-ar7/war.h25
-rw-r--r--arch/mips/include/asm/mach-cobalt/irq.h2
-rw-r--r--arch/mips/include/asm/mach-cobalt/mach-gt64120.h2
-rw-r--r--arch/mips/include/asm/octeon/pci-octeon.h (renamed from arch/mips/cavium-octeon/pci-common.h)30
-rw-r--r--arch/mips/include/asm/page.h9
-rw-r--r--arch/mips/include/asm/pgalloc.h15
-rw-r--r--arch/mips/include/asm/pmc-sierra/msp71xx/war.h2
-rw-r--r--arch/mips/include/asm/processor.h5
-rw-r--r--arch/mips/include/asm/reg.h2
-rw-r--r--arch/mips/include/asm/swab.h8
-rw-r--r--arch/mips/include/asm/thread_info.h4
-rw-r--r--arch/mips/include/asm/unistd.h21
-rw-r--r--arch/mips/include/asm/vr41xx/capcella.h2
-rw-r--r--arch/mips/include/asm/vr41xx/giu.h22
-rw-r--r--arch/mips/include/asm/vr41xx/irq.h2
-rw-r--r--arch/mips/include/asm/vr41xx/mpc30x.h2
-rw-r--r--arch/mips/include/asm/vr41xx/pci.h2
-rw-r--r--arch/mips/include/asm/vr41xx/siu.h2
-rw-r--r--arch/mips/include/asm/vr41xx/tb0219.h2
-rw-r--r--arch/mips/include/asm/vr41xx/tb0226.h2
-rw-r--r--arch/mips/include/asm/vr41xx/vr41xx.h2
-rw-r--r--arch/mips/jazz/jazzdma.c2
-rw-r--r--arch/mips/kernel/binfmt_elfo32.c20
-rw-r--r--arch/mips/kernel/cevt-ds1287.c2
-rw-r--r--arch/mips/kernel/cevt-gt641xx.c2
-rw-r--r--arch/mips/kernel/csrc-ioasic.c2
-rw-r--r--arch/mips/kernel/head.S3
-rw-r--r--arch/mips/kernel/irq-gic.c19
-rw-r--r--arch/mips/kernel/irq-gt641xx.c2
-rw-r--r--arch/mips/kernel/irq_txx9.c2
-rw-r--r--arch/mips/kernel/module.c12
-rw-r--r--arch/mips/kernel/proc.c2
-rw-r--r--arch/mips/kernel/process.c4
-rw-r--r--arch/mips/kernel/ptrace32.c1
-rw-r--r--arch/mips/kernel/scall32-o32.S3
-rw-r--r--arch/mips/kernel/scall64-64.S3
-rw-r--r--arch/mips/kernel/scall64-n32.S3
-rw-r--r--arch/mips/kernel/scall64-o32.S3
-rw-r--r--arch/mips/kernel/smp-cmp.c66
-rw-r--r--arch/mips/kernel/smtc.c13
-rw-r--r--arch/mips/kernel/stacktrace.c2
-rw-r--r--arch/mips/kernel/sync-r4k.c31
-rw-r--r--arch/mips/kernel/vpe.c51
-rw-r--r--arch/mips/mipssim/sim_time.c12
-rw-r--r--arch/mips/mm/c-octeon.c4
-rw-r--r--arch/mips/mm/extable.c6
-rw-r--r--arch/mips/mm/fault.c1
-rw-r--r--arch/mips/mm/hugetlbpage.c1
-rw-r--r--arch/mips/mti-malta/malta-init.c14
-rw-r--r--arch/mips/mti-malta/malta-int.c89
-rw-r--r--arch/mips/mti-malta/malta-reset.c3
-rw-r--r--arch/mips/nxp/pnx8550/common/time.c2
-rw-r--r--arch/mips/pci/Makefile5
-rw-r--r--arch/mips/pci/fixup-capcella.c2
-rw-r--r--arch/mips/pci/fixup-emma2rh.c3
-rw-r--r--arch/mips/pci/fixup-mpc30x.c2
-rw-r--r--arch/mips/pci/fixup-sb1250.c2
-rw-r--r--arch/mips/pci/fixup-tb0219.c2
-rw-r--r--arch/mips/pci/fixup-tb0226.c2
-rw-r--r--arch/mips/pci/fixup-tb0287.c2
-rw-r--r--arch/mips/pci/msi-octeon.c (renamed from arch/mips/cavium-octeon/msi.c)56
-rw-r--r--arch/mips/pci/ops-emma2rh.c3
-rw-r--r--arch/mips/pci/ops-vr41xx.c6
-rw-r--r--arch/mips/pci/pci-emma2rh.c3
-rw-r--r--arch/mips/pci/pci-octeon.c (renamed from arch/mips/cavium-octeon/pci.c)147
-rw-r--r--arch/mips/pci/pci-tx4927.c2
-rw-r--r--arch/mips/pci/pci-tx4938.c2
-rw-r--r--arch/mips/pci/pci-tx4939.c2
-rw-r--r--arch/mips/pci/pci-vr41xx.c6
-rw-r--r--arch/mips/pci/pci-vr41xx.h4
-rw-r--r--arch/mips/pci/pcie-octeon.c (renamed from arch/mips/cavium-octeon/pcie.c)68
-rw-r--r--arch/mips/pmc-sierra/msp71xx/gpio.c2
-rw-r--r--arch/mips/pmc-sierra/msp71xx/gpio_extended.c2
-rw-r--r--arch/mips/pmc-sierra/msp71xx/msp_irq_slp.c12
-rw-r--r--arch/mips/pmc-sierra/yosemite/atmel_read_eeprom.c2
-rw-r--r--arch/mips/sibyte/swarm/swarm-i2c.c2
-rw-r--r--arch/mips/txx9/generic/mem_tx4927.c2
-rw-r--r--arch/mips/txx9/generic/setup.c2
-rw-r--r--arch/mips/txx9/rbtx4939/setup.c2
-rw-r--r--arch/mips/vr41xx/casio-e55/setup.c2
-rw-r--r--arch/mips/vr41xx/common/bcu.c8
-rw-r--r--arch/mips/vr41xx/common/cmu.c8
-rw-r--r--arch/mips/vr41xx/common/giu.c2
-rw-r--r--arch/mips/vr41xx/common/icu.c8
-rw-r--r--arch/mips/vr41xx/common/init.c2
-rw-r--r--arch/mips/vr41xx/common/irq.c2
-rw-r--r--arch/mips/vr41xx/common/pmu.c2
-rw-r--r--arch/mips/vr41xx/common/rtc.c2
-rw-r--r--arch/mips/vr41xx/common/siu.c2
-rw-r--r--arch/mips/vr41xx/common/type.c2
-rw-r--r--arch/mips/vr41xx/ibm-workpad/setup.c2
-rw-r--r--arch/mn10300/include/asm/pci.h4
-rw-r--r--arch/mn10300/include/asm/pgalloc.h2
-rw-r--r--arch/mn10300/include/asm/thread_info.h4
-rw-r--r--arch/mn10300/include/asm/unistd.h4
-rw-r--r--arch/mn10300/kernel/entry.S2
-rw-r--r--arch/mn10300/kernel/ptrace.c1
-rw-r--r--arch/mn10300/kernel/signal.c1
-rw-r--r--arch/mn10300/kernel/sys_mn10300.c2
-rw-r--r--arch/mn10300/kernel/traps.c22
-rw-r--r--arch/mn10300/kernel/vmlinux.lds.S4
-rw-r--r--arch/mn10300/mm/fault.c1
-rw-r--r--arch/mn10300/mm/misalignment.c1
-rw-r--r--arch/parisc/Kconfig2
-rw-r--r--arch/parisc/include/asm/atomic.h14
-rw-r--r--arch/parisc/include/asm/dma.h3
-rw-r--r--arch/parisc/include/asm/perf_counter.h7
-rw-r--r--arch/parisc/include/asm/processor.h3
-rw-r--r--arch/parisc/include/asm/system.h4
-rw-r--r--arch/parisc/include/asm/thread_info.h2
-rw-r--r--arch/parisc/include/asm/tlb.h4
-rw-r--r--arch/parisc/include/asm/tlbflush.h14
-rw-r--r--arch/parisc/include/asm/unistd.h6
-rw-r--r--arch/parisc/kernel/cache.c26
-rw-r--r--arch/parisc/kernel/entry.S2
-rw-r--r--arch/parisc/kernel/inventory.c41
-rw-r--r--arch/parisc/kernel/irq.c10
-rw-r--r--arch/parisc/kernel/module.c50
-rw-r--r--arch/parisc/kernel/pci-dma.c12
-rw-r--r--arch/parisc/kernel/pci.c3
-rw-r--r--arch/parisc/kernel/process.c2
-rw-r--r--arch/parisc/kernel/processor.c19
-rw-r--r--arch/parisc/kernel/setup.c3
-rw-r--r--arch/parisc/kernel/sys_parisc32.c62
-rw-r--r--arch/parisc/kernel/syscall_table.S4
-rw-r--r--arch/parisc/kernel/time.c90
-rw-r--r--arch/parisc/kernel/traps.c20
-rw-r--r--arch/parisc/lib/checksum.c2
-rw-r--r--arch/parisc/lib/memcpy.c2
-rw-r--r--arch/parisc/math-emu/decode_exc.c2
-rw-r--r--arch/parisc/mm/fault.c3
-rw-r--r--arch/parisc/mm/init.c29
-rw-r--r--arch/powerpc/Kconfig1
-rw-r--r--arch/powerpc/boot/.gitignore10
-rw-r--r--arch/powerpc/boot/dts/amigaone.dts4
-rw-r--r--arch/powerpc/boot/dts/mpc8377_rdb.dts2
-rw-r--r--arch/powerpc/boot/dts/mpc8378_rdb.dts2
-rw-r--r--arch/powerpc/boot/dts/mpc8379_rdb.dts2
-rw-r--r--arch/powerpc/boot/dts/mpc8569mds.dts5
-rw-r--r--arch/powerpc/boot/dts/warp.dts3
-rw-r--r--arch/powerpc/configs/44x/warp_defconfig200
-rw-r--r--arch/powerpc/configs/83xx/asp8347_defconfig106
-rw-r--r--arch/powerpc/configs/83xx/kmeter1_defconfig176
-rw-r--r--arch/powerpc/configs/83xx/mpc8313_rdb_defconfig168
-rw-r--r--arch/powerpc/configs/83xx/mpc8315_rdb_defconfig168
-rw-r--r--arch/powerpc/configs/83xx/mpc832x_mds_defconfig111
-rw-r--r--arch/powerpc/configs/83xx/mpc832x_rdb_defconfig120
-rw-r--r--arch/powerpc/configs/83xx/mpc834x_itx_defconfig114
-rw-r--r--arch/powerpc/configs/83xx/mpc834x_itxgp_defconfig114
-rw-r--r--arch/powerpc/configs/83xx/mpc834x_mds_defconfig104
-rw-r--r--arch/powerpc/configs/83xx/mpc836x_mds_defconfig111
-rw-r--r--arch/powerpc/configs/83xx/mpc836x_rdk_defconfig104
-rw-r--r--arch/powerpc/configs/83xx/mpc837x_mds_defconfig110
-rw-r--r--arch/powerpc/configs/83xx/mpc837x_rdb_defconfig162
-rw-r--r--arch/powerpc/configs/83xx/sbc834x_defconfig103
-rw-r--r--arch/powerpc/configs/85xx/ksi8560_defconfig93
-rw-r--r--arch/powerpc/configs/85xx/mpc8540_ads_defconfig91
-rw-r--r--arch/powerpc/configs/85xx/mpc8560_ads_defconfig99
-rw-r--r--arch/powerpc/configs/85xx/mpc85xx_cds_defconfig99
-rw-r--r--arch/powerpc/configs/85xx/sbc8548_defconfig96
-rw-r--r--arch/powerpc/configs/85xx/sbc8560_defconfig91
-rw-r--r--arch/powerpc/configs/85xx/socrates_defconfig165
-rw-r--r--arch/powerpc/configs/85xx/stx_gp3_defconfig119
-rw-r--r--arch/powerpc/configs/85xx/tqm8540_defconfig100
-rw-r--r--arch/powerpc/configs/85xx/tqm8541_defconfig101
-rw-r--r--arch/powerpc/configs/85xx/tqm8548_defconfig100
-rw-r--r--arch/powerpc/configs/85xx/tqm8555_defconfig101
-rw-r--r--arch/powerpc/configs/85xx/tqm8560_defconfig101
-rw-r--r--arch/powerpc/configs/85xx/xes_mpc85xx_defconfig118
-rw-r--r--arch/powerpc/configs/86xx/gef_ppc9a_defconfig521
-rw-r--r--arch/powerpc/configs/86xx/gef_sbc310_defconfig216
-rw-r--r--arch/powerpc/configs/86xx/gef_sbc610_defconfig130
-rw-r--r--arch/powerpc/configs/86xx/mpc8610_hpcd_defconfig118
-rw-r--r--arch/powerpc/configs/86xx/mpc8641_hpcn_defconfig186
-rw-r--r--arch/powerpc/configs/86xx/sbc8641d_defconfig112
-rw-r--r--arch/powerpc/configs/adder875_defconfig97
-rw-r--r--arch/powerpc/configs/c2k_defconfig121
-rw-r--r--arch/powerpc/configs/ep8248e_defconfig97
-rw-r--r--arch/powerpc/configs/ep88xc_defconfig91
-rw-r--r--arch/powerpc/configs/linkstation_defconfig116
-rw-r--r--arch/powerpc/configs/mgcoge_defconfig97
-rw-r--r--arch/powerpc/configs/mgsuvd_defconfig89
-rw-r--r--arch/powerpc/configs/mpc7448_hpc2_defconfig103
-rw-r--r--arch/powerpc/configs/mpc8272_ads_defconfig104
-rw-r--r--arch/powerpc/configs/mpc83xx_defconfig162
-rw-r--r--arch/powerpc/configs/mpc85xx_defconfig193
-rw-r--r--arch/powerpc/configs/mpc85xx_smp_defconfig193
-rw-r--r--arch/powerpc/configs/mpc866_ads_defconfig92
-rw-r--r--arch/powerpc/configs/mpc86xx_defconfig186
-rw-r--r--arch/powerpc/configs/mpc885_ads_defconfig91
-rw-r--r--arch/powerpc/configs/pq2fads_defconfig110
-rw-r--r--arch/powerpc/configs/prpmc2800_defconfig158
-rw-r--r--arch/powerpc/configs/storcenter_defconfig108
-rw-r--r--arch/powerpc/include/asm/cpm1.h2
-rw-r--r--arch/powerpc/include/asm/delay.h2
-rw-r--r--arch/powerpc/include/asm/dma-mapping.h24
-rw-r--r--arch/powerpc/include/asm/highmem.h57
-rw-r--r--arch/powerpc/include/asm/hw_irq.h20
-rw-r--r--arch/powerpc/include/asm/kvm_host.h2
-rw-r--r--arch/powerpc/include/asm/perf_counter.h2
-rw-r--r--arch/powerpc/include/asm/pgalloc-32.h2
-rw-r--r--arch/powerpc/include/asm/pgalloc-64.h4
-rw-r--r--arch/powerpc/include/asm/pgalloc.h6
-rw-r--r--arch/powerpc/include/asm/pte-hash64-64k.h3
-rw-r--r--arch/powerpc/include/asm/rtas.h5
-rw-r--r--arch/powerpc/include/asm/thread_info.h4
-rw-r--r--arch/powerpc/kernel/entry_32.S127
-rw-r--r--arch/powerpc/kernel/head_32.S17
-rw-r--r--arch/powerpc/kernel/mpc7450-pmu.c4
-rw-r--r--arch/powerpc/kernel/of_device.c2
-rw-r--r--arch/powerpc/kernel/power4-pmu.c3
-rw-r--r--arch/powerpc/kernel/power5+-pmu.c5
-rw-r--r--arch/powerpc/kernel/power5-pmu.c3
-rw-r--r--arch/powerpc/kernel/power6-pmu.c3
-rw-r--r--arch/powerpc/kernel/power7-pmu.c4
-rw-r--r--arch/powerpc/kernel/ppc970-pmu.c6
-rw-r--r--arch/powerpc/kernel/process.c2
-rw-r--r--arch/powerpc/kernel/ptrace.c17
-rw-r--r--arch/powerpc/kernel/ptrace32.c1
-rw-r--r--arch/powerpc/kernel/rtas.c69
-rw-r--r--arch/powerpc/kernel/setup_32.c2
-rw-r--r--arch/powerpc/kernel/smp.c3
-rw-r--r--arch/powerpc/kernel/udbg_16550.c2
-rw-r--r--arch/powerpc/kernel/vector.S6
-rw-r--r--arch/powerpc/mm/Makefile1
-rw-r--r--arch/powerpc/mm/gup.c10
-rw-r--r--arch/powerpc/mm/highmem.c77
-rw-r--r--arch/powerpc/mm/hugetlbpage.c4
-rw-r--r--arch/powerpc/mm/mmu_context_nohash.c17
-rw-r--r--arch/powerpc/mm/pgtable.c4
-rw-r--r--arch/powerpc/mm/slb.c13
-rw-r--r--arch/powerpc/mm/tlb_hash64.c2
-rw-r--r--arch/powerpc/oprofile/cell/vma_map.c2
-rw-r--r--arch/powerpc/platforms/44x/warp.c63
-rw-r--r--arch/powerpc/platforms/82xx/pq2ads-pci-pic.c2
-rw-r--r--arch/powerpc/platforms/85xx/mpc85xx_mds.c14
-rw-r--r--arch/powerpc/platforms/85xx/smp.c9
-rw-r--r--arch/powerpc/platforms/85xx/socrates.c6
-rw-r--r--arch/powerpc/platforms/85xx/xes_mpc85xx.c1
-rw-r--r--arch/powerpc/platforms/cell/axon_msi.c22
-rw-r--r--arch/powerpc/platforms/cell/smp.c30
-rw-r--r--arch/powerpc/platforms/chrp/smp.c33
-rw-r--r--arch/powerpc/platforms/pasemi/setup.c15
-rw-r--r--arch/powerpc/platforms/powermac/cpufreq_64.c2
-rw-r--r--arch/powerpc/platforms/powermac/pic.c2
-rw-r--r--arch/powerpc/platforms/powermac/setup.c41
-rw-r--r--arch/powerpc/platforms/powermac/smp.c166
-rw-r--r--arch/powerpc/platforms/ps3/system-bus.c1
-rw-r--r--arch/powerpc/platforms/pseries/lpar.c18
-rw-r--r--arch/powerpc/platforms/pseries/smp.c30
-rw-r--r--arch/powerpc/platforms/pseries/xics.c8
-rw-r--r--arch/powerpc/sysdev/fsl_rio.c2
-rw-r--r--arch/powerpc/sysdev/ipic.c4
-rw-r--r--arch/powerpc/sysdev/mpic.c43
-rw-r--r--arch/powerpc/sysdev/ppc4xx_pci.c4
-rw-r--r--arch/powerpc/sysdev/qe_lib/qe.c9
-rw-r--r--arch/powerpc/sysdev/qe_lib/qe_ic.c4
-rw-r--r--arch/powerpc/sysdev/uic.c3
-rw-r--r--arch/s390/Kconfig8
-rw-r--r--arch/s390/include/asm/atomic.h7
-rw-r--r--arch/s390/include/asm/kvm_host.h4
-rw-r--r--arch/s390/include/asm/perf_counter.h2
-rw-r--r--arch/s390/include/asm/thread_info.h2
-rw-r--r--arch/s390/include/asm/tlb.h9
-rw-r--r--arch/s390/kernel/dis.c1
-rw-r--r--arch/s390/kernel/early.c7
-rw-r--r--arch/s390/kernel/ipl.c15
-rw-r--r--arch/s390/kernel/ptrace.c1
-rw-r--r--arch/s390/kernel/smp.c7
-rw-r--r--arch/s390/kernel/vdso64/clock_gettime.S11
-rw-r--r--arch/s390/kvm/interrupt.c2
-rw-r--r--arch/s390/kvm/kvm-s390.c23
-rw-r--r--arch/s390/kvm/priv.c2
-rw-r--r--arch/s390/kvm/sigp.c7
-rw-r--r--arch/s390/lib/Makefile2
-rw-r--r--arch/s390/lib/delay.c2
-rw-r--r--arch/s390/lib/ucmpdi2.c26
-rw-r--r--arch/s390/mm/fault.c1
-rw-r--r--arch/s390/power/swsusp.c36
-rw-r--r--arch/s390/power/swsusp_asm64.S35
-rw-r--r--arch/sh/Kconfig.debug4
-rw-r--r--arch/sh/boards/mach-se/7206/io.c2
-rw-r--r--arch/sh/boards/mach-se/7724/setup.c148
-rw-r--r--arch/sh/configs/migor_defconfig53
-rw-r--r--arch/sh/configs/se7724_defconfig25
-rw-r--r--arch/sh/include/asm/perf_counter.h4
-rw-r--r--arch/sh/include/asm/pgalloc.h10
-rw-r--r--arch/sh/include/asm/syscall_32.h1
-rw-r--r--arch/sh/include/asm/thread_info.h2
-rw-r--r--arch/sh/include/asm/tlb.h6
-rw-r--r--arch/sh/include/mach-se/mach/se7724.h5
-rw-r--r--arch/sh/mm/fault_32.c61
-rw-r--r--arch/sh/mm/tlb-sh3.c1
-rw-r--r--arch/sh/mm/tlbflush_64.c15
-rw-r--r--arch/sparc/boot/Makefile6
-rw-r--r--arch/sparc/boot/piggyback_32.c4
-rw-r--r--arch/sparc/boot/piggyback_64.c1
-rw-r--r--arch/sparc/include/asm/pgalloc_32.h8
-rw-r--r--arch/sparc/include/asm/thread_info_32.h4
-rw-r--r--arch/sparc/include/asm/thread_info_64.h4
-rw-r--r--arch/sparc/include/asm/tlb_64.h6
-rw-r--r--arch/sparc/kernel/irq_64.c45
-rw-r--r--arch/sparc/kernel/ptrace_32.c1
-rw-r--r--arch/sparc/kernel/ptrace_64.c1
-rw-r--r--arch/sparc/kernel/time_64.c1
-rw-r--r--arch/sparc/kernel/traps_32.c1
-rw-r--r--arch/sparc/kernel/vio.c7
-rw-r--r--arch/um/drivers/slip_kern.c1
-rw-r--r--arch/um/drivers/slirp_kern.c1
-rw-r--r--arch/um/include/asm/dma-mapping.h4
-rw-r--r--arch/um/include/asm/pgalloc.h4
-rw-r--r--arch/um/include/asm/thread_info.h2
-rw-r--r--arch/um/include/asm/tlb.h6
-rw-r--r--arch/um/kernel/sysrq.c4
-rw-r--r--arch/x86/Kconfig13
-rw-r--r--arch/x86/boot/video-bios.c3
-rw-r--r--arch/x86/boot/video-vesa.c4
-rw-r--r--arch/x86/include/asm/atomic_32.h185
-rw-r--r--arch/x86/include/asm/atomic_64.h42
-rw-r--r--arch/x86/include/asm/boot.h6
-rw-r--r--arch/x86/include/asm/efi.h5
-rw-r--r--arch/x86/include/asm/fixmap.h10
-rw-r--r--arch/x86/include/asm/io_apic.h2
-rw-r--r--arch/x86/include/asm/irqflags.h8
-rw-r--r--arch/x86/include/asm/lguest.h3
-rw-r--r--arch/x86/include/asm/lguest_hcall.h18
-rw-r--r--arch/x86/include/asm/msr-index.h4
-rw-r--r--arch/x86/include/asm/nmi.h1
-rw-r--r--arch/x86/include/asm/pci.h2
-rw-r--r--arch/x86/include/asm/percpu.h10
-rw-r--r--arch/x86/include/asm/perf_counter.h3
-rw-r--r--arch/x86/include/asm/pgalloc.h25
-rw-r--r--arch/x86/include/asm/proto.h11
-rw-r--r--arch/x86/include/asm/stacktrace.h2
-rw-r--r--arch/x86/include/asm/thread_info.h2
-rw-r--r--arch/x86/include/asm/uaccess.h4
-rw-r--r--arch/x86/include/asm/uaccess_64.h10
-rw-r--r--arch/x86/include/asm/uv/uv_hub.h9
-rw-r--r--arch/x86/kernel/Makefile2
-rw-r--r--arch/x86/kernel/amd_iommu.c4
-rw-r--r--arch/x86/kernel/amd_iommu_init.c13
-rw-r--r--arch/x86/kernel/apic/apic.c2
-rw-r--r--arch/x86/kernel/apic/es7000_32.c3
-rw-r--r--arch/x86/kernel/apic/io_apic.c47
-rw-r--r--arch/x86/kernel/apic/numaq_32.c3
-rw-r--r--arch/x86/kernel/apic/x2apic_cluster.c10
-rw-r--r--arch/x86/kernel/apic/x2apic_phys.c10
-rw-r--r--arch/x86/kernel/apic/x2apic_uv_x.c38
-rw-r--r--arch/x86/kernel/apm_32.c2
-rw-r--r--arch/x86/kernel/cpu/amd.c6
-rw-r--r--arch/x86/kernel/cpu/common.c3
-rw-r--r--arch/x86/kernel/cpu/cpufreq/powernow-k8.c32
-rw-r--r--arch/x86/kernel/cpu/cpufreq/powernow-k8.h3
-rw-r--r--arch/x86/kernel/cpu/mcheck/mce.c22
-rw-r--r--arch/x86/kernel/cpu/perf_counter.c283
-rw-r--r--arch/x86/kernel/cpu/perfctr-watchdog.c5
-rw-r--r--arch/x86/kernel/dumpstack.c1
-rw-r--r--arch/x86/kernel/dumpstack_32.c6
-rw-r--r--arch/x86/kernel/dumpstack_64.c22
-rw-r--r--arch/x86/kernel/e820.c23
-rw-r--r--arch/x86/kernel/efi.c4
-rw-r--r--arch/x86/kernel/efi_64.c6
-rw-r--r--arch/x86/kernel/head_32.S6
-rw-r--r--arch/x86/kernel/irqinit.c2
-rw-r--r--arch/x86/kernel/kvm.c2
-rw-r--r--arch/x86/kernel/mfgpt_32.c2
-rw-r--r--arch/x86/kernel/pci-dma.c2
-rw-r--r--arch/x86/kernel/pci-gart_64.c2
-rw-r--r--arch/x86/kernel/pvclock.c2
-rw-r--r--arch/x86/kernel/reboot.c50
-rw-r--r--arch/x86/kernel/setup.c29
-rw-r--r--arch/x86/kernel/setup_percpu.c219
-rw-r--r--arch/x86/kernel/tlb_uv.c9
-rw-r--r--arch/x86/kernel/traps.c3
-rw-r--r--arch/x86/kernel/vmi_32.c2
-rw-r--r--arch/x86/kernel/vmlinux.lds.S23
-rw-r--r--arch/x86/kvm/i8254.c3
-rw-r--r--arch/x86/kvm/mmu.c54
-rw-r--r--arch/x86/kvm/paging_tmpl.h2
-rw-r--r--arch/x86/kvm/svm.c6
-rw-r--r--arch/x86/kvm/vmx.c21
-rw-r--r--arch/x86/kvm/x86.c45
-rw-r--r--arch/x86/kvm/x86_emulate.c2
-rw-r--r--arch/x86/lguest/boot.c510
-rw-r--r--arch/x86/lguest/i386_head.S112
-rw-r--r--arch/x86/lib/Makefile1
-rw-r--r--arch/x86/lib/atomic64_32.c230
-rw-r--r--arch/x86/lib/clear_page_64.S5
-rw-r--r--arch/x86/lib/copy_user_64.S1
-rw-r--r--arch/x86/lib/delay.c3
-rw-r--r--arch/x86/lib/msr.c26
-rw-r--r--arch/x86/lib/usercopy_32.c2
-rw-r--r--arch/x86/mm/fault.c11
-rw-r--r--arch/x86/mm/highmem_32.c1
-rw-r--r--arch/x86/mm/init.c18
-rw-r--r--arch/x86/mm/init_64.c9
-rw-r--r--arch/x86/mm/pageattr.c104
-rw-r--r--arch/x86/mm/pgtable.c7
-rw-r--r--arch/x86/mm/srat_64.c6
-rw-r--r--arch/x86/oprofile/nmi_int.c2
-rw-r--r--arch/x86/pci/acpi.c59
-rw-r--r--arch/x86/pci/amd_bus.c8
-rw-r--r--arch/x86/pci/i386.c7
-rw-r--r--arch/x86/power/Makefile2
-rw-r--r--arch/x86/power/cpu.c2
-rw-r--r--arch/xtensa/include/asm/thread_info.h4
-rw-r--r--arch/xtensa/include/asm/tlb.h2
-rw-r--r--arch/xtensa/kernel/traps.c6
-rw-r--r--block/Kconfig11
-rw-r--r--block/Makefile2
-rw-r--r--block/blk-core.c33
-rw-r--r--block/blk-integrity.c1
-rw-r--r--block/blk-merge.c6
-rw-r--r--block/blk-settings.c84
-rw-r--r--block/blk-sysfs.c11
-rw-r--r--block/bsg.c2
-rw-r--r--block/cfq-iosched.c178
-rw-r--r--block/cmd-filter.c233
-rw-r--r--block/elevator.c13
-rw-r--r--block/scsi_ioctl.c44
-rw-r--r--crypto/async_tx/async_xor.c2
-rw-r--r--drivers/acpi/acpi_memhotplug.c34
-rw-r--r--drivers/acpi/acpica/acobject.h1
-rw-r--r--drivers/acpi/acpica/dsopcode.c24
-rw-r--r--drivers/acpi/acpica/exfldio.c6
-rw-r--r--drivers/acpi/osl.c25
-rw-r--r--drivers/acpi/pci_root.c2
-rw-r--r--drivers/acpi/sleep.c8
-rw-r--r--drivers/acpi/system.c2
-rw-r--r--drivers/amba/bus.c12
-rw-r--r--drivers/ata/ahci.c5
-rw-r--r--drivers/ata/ata_piix.c3
-rw-r--r--drivers/ata/libata-core.c50
-rw-r--r--drivers/ata/libata-eh.c6
-rw-r--r--drivers/ata/pata_at91.c70
-rw-r--r--drivers/ata/pata_octeon_cf.c3
-rw-r--r--drivers/ata/pata_pcmcia.c1
-rw-r--r--drivers/ata/sata_mv.c2
-rw-r--r--drivers/ata/sata_sil.c2
-rw-r--r--drivers/base/devres.c3
-rw-r--r--drivers/base/firmware_class.c13
-rw-r--r--drivers/base/power/main.c1
-rw-r--r--drivers/base/sys.c2
-rw-r--r--drivers/block/DAC960.c1
-rw-r--r--drivers/block/Kconfig16
-rw-r--r--drivers/block/Makefile1
-rw-r--r--drivers/block/amiflop.c2
-rw-r--r--drivers/block/ataflop.c2
-rw-r--r--drivers/block/cciss.c16
-rw-r--r--drivers/block/cciss_cmd.h1
-rw-r--r--drivers/block/floppy.c5
-rw-r--r--drivers/block/loop.c1
-rw-r--r--drivers/block/mg_disk.c101
-rw-r--r--drivers/block/osdblk.c701
-rw-r--r--drivers/block/pktcdvd.c10
-rw-r--r--drivers/block/virtio_blk.c12
-rw-r--r--drivers/block/xsysace.c7
-rw-r--r--drivers/block/z2ram.c2
-rw-r--r--drivers/bluetooth/hci_vhci.c1
-rw-r--r--drivers/char/Kconfig4
-rw-r--r--drivers/char/Makefile1
-rw-r--r--drivers/char/agp/parisc-agp.c2
-rw-r--r--drivers/char/amiserial.c1
-rw-r--r--drivers/char/bsr.c42
-rw-r--r--drivers/char/cyclades.c1
-rw-r--r--drivers/char/epca.c1
-rw-r--r--drivers/char/hvc_console.c2
-rw-r--r--drivers/char/hw_random/intel-rng.c9
-rw-r--r--drivers/char/isicom.c17
-rw-r--r--drivers/char/istallion.c1
-rw-r--r--drivers/char/moxa.c1
-rw-r--r--drivers/char/mxser.c1
-rw-r--r--drivers/char/n_hdlc.c1
-rw-r--r--drivers/char/n_r3964.c1
-rw-r--r--drivers/char/n_tty.c4
-rw-r--r--drivers/char/nozomi.c16
-rw-r--r--drivers/char/pcmcia/ipwireless/tty.c4
-rw-r--r--drivers/char/pty.c155
-rw-r--r--drivers/char/rio/rio_linux.c1
-rw-r--r--drivers/char/riscom8.c1
-rw-r--r--drivers/char/rocket.c1
-rw-r--r--drivers/char/serial167.c1
-rw-r--r--drivers/char/specialix.c25
-rw-r--r--drivers/char/sx.c1
-rw-r--r--drivers/char/synclink.c1
-rw-r--r--drivers/char/synclink_gt.c1
-rw-r--r--drivers/char/synclinkmp.c1
-rw-r--r--drivers/char/sysrq.c8
-rw-r--r--drivers/char/tb0219.c4
-rw-r--r--drivers/char/tpm/tpm.c1
-rw-r--r--drivers/char/tty_buffer.c13
-rw-r--r--drivers/char/tty_ioctl.c1
-rw-r--r--drivers/char/tty_ldisc.c189
-rw-r--r--drivers/char/tty_port.c2
-rw-r--r--drivers/char/vc_screen.c4
-rw-r--r--drivers/char/vt.c13
-rw-r--r--drivers/char/vt_ioctl.c1
-rw-r--r--drivers/clocksource/sh_tmu.c2
-rw-r--r--drivers/cpufreq/cpufreq.c99
-rw-r--r--drivers/cpufreq/cpufreq_conservative.c43
-rw-r--r--drivers/cpufreq/cpufreq_ondemand.c77
-rw-r--r--drivers/dma/Kconfig12
-rw-r--r--drivers/dma/Makefile1
-rw-r--r--drivers/dma/at_hdmac.c1213
-rw-r--r--drivers/dma/at_hdmac_regs.h353
-rw-r--r--drivers/dma/dmatest.c21
-rw-r--r--drivers/dma/fsldma.c17
-rw-r--r--drivers/dma/fsldma.h1
-rw-r--r--drivers/dma/mv_xor.c2
-rw-r--r--drivers/edac/amd64_edac.c34
-rw-r--r--drivers/edac/amd64_edac.h2
-rw-r--r--drivers/edac/edac_core.h4
-rw-r--r--drivers/edac/edac_mc_sysfs.c4
-rw-r--r--drivers/edac/mpc85xx_edac.c6
-rw-r--r--drivers/edac/mpc85xx_edac.h1
-rw-r--r--drivers/edac/x38_edac.c2
-rw-r--r--drivers/firewire/core-card.c14
-rw-r--r--drivers/firewire/core-cdev.c4
-rw-r--r--drivers/firewire/core-iso.c24
-rw-r--r--drivers/firewire/core.h3
-rw-r--r--drivers/firewire/sbp2.c10
-rw-r--r--drivers/gpio/Kconfig6
-rw-r--r--drivers/gpio/Makefile1
-rw-r--r--drivers/gpio/pl061.c20
-rw-r--r--drivers/gpio/vr41xx_giu.c (renamed from drivers/char/vr41xx_giu.c)335
-rw-r--r--drivers/gpu/drm/Kconfig1
-rw-r--r--drivers/gpu/drm/Makefile2
-rw-r--r--drivers/gpu/drm/drm_crtc.c2
-rw-r--r--drivers/gpu/drm/drm_crtc_helper.c8
-rw-r--r--drivers/gpu/drm/drm_debugfs.c4
-rw-r--r--drivers/gpu/drm/drm_edid.c12
-rw-r--r--drivers/gpu/drm/drm_gem.c17
-rw-r--r--drivers/gpu/drm/drm_irq.c2
-rw-r--r--drivers/gpu/drm/drm_modes.c2
-rw-r--r--drivers/gpu/drm/drm_stub.c3
-rw-r--r--drivers/gpu/drm/i915/Makefile2
-rw-r--r--drivers/gpu/drm/i915/dvo.h4
-rw-r--r--drivers/gpu/drm/i915/dvo_ch7017.c20
-rw-r--r--drivers/gpu/drm/i915/dvo_ch7xxx.c25
-rw-r--r--drivers/gpu/drm/i915/dvo_ivch.c21
-rw-r--r--drivers/gpu/drm/i915/dvo_sil164.c25
-rw-r--r--drivers/gpu/drm/i915/dvo_tfp410.c25
-rw-r--r--drivers/gpu/drm/i915/i915_dma.c87
-rw-r--r--drivers/gpu/drm/i915/i915_drv.c13
-rw-r--r--drivers/gpu/drm/i915/i915_drv.h43
-rw-r--r--drivers/gpu/drm/i915/i915_gem.c59
-rw-r--r--drivers/gpu/drm/i915/i915_gem_debug.c6
-rw-r--r--drivers/gpu/drm/i915/i915_gem_debugfs.c46
-rw-r--r--drivers/gpu/drm/i915/i915_gem_tiling.c8
-rw-r--r--drivers/gpu/drm/i915/i915_irq.c246
-rw-r--r--drivers/gpu/drm/i915/i915_reg.h124
-rw-r--r--drivers/gpu/drm/i915/i915_suspend.c253
-rw-r--r--drivers/gpu/drm/i915/intel_bios.c54
-rw-r--r--drivers/gpu/drm/i915/intel_bios.h45
-rw-r--r--drivers/gpu/drm/i915/intel_crt.c42
-rw-r--r--drivers/gpu/drm/i915/intel_display.c1226
-rw-r--r--drivers/gpu/drm/i915/intel_dp.c1318
-rw-r--r--drivers/gpu/drm/i915/intel_dp.h144
-rw-r--r--drivers/gpu/drm/i915/intel_dp_i2c.c273
-rw-r--r--drivers/gpu/drm/i915/intel_drv.h20
-rw-r--r--drivers/gpu/drm/i915/intel_dvo.c16
-rw-r--r--drivers/gpu/drm/i915/intel_fb.c18
-rw-r--r--drivers/gpu/drm/i915/intel_hdmi.c85
-rw-r--r--drivers/gpu/drm/i915/intel_i2c.c16
-rw-r--r--drivers/gpu/drm/i915/intel_lvds.c430
-rw-r--r--drivers/gpu/drm/i915/intel_modes.c14
-rw-r--r--drivers/gpu/drm/i915/intel_sdvo.c438
-rw-r--r--drivers/gpu/drm/i915/intel_sdvo_regs.h1
-rw-r--r--drivers/gpu/drm/i915/intel_tv.c75
-rw-r--r--drivers/gpu/drm/radeon/Makefile3
-rw-r--r--drivers/gpu/drm/radeon/atombios_crtc.c293
-rw-r--r--drivers/gpu/drm/radeon/r100.c773
-rw-r--r--drivers/gpu/drm/radeon/r300.c78
-rw-r--r--drivers/gpu/drm/radeon/r300_reg.h4
-rw-r--r--drivers/gpu/drm/radeon/r500_reg.h2
-rw-r--r--drivers/gpu/drm/radeon/r520.c22
-rw-r--r--drivers/gpu/drm/radeon/r600.c5
-rw-r--r--drivers/gpu/drm/radeon/r600_cp.c22
-rw-r--r--drivers/gpu/drm/radeon/radeon.h87
-rw-r--r--drivers/gpu/drm/radeon/radeon_asic.h32
-rw-r--r--drivers/gpu/drm/radeon/radeon_atombios.c9
-rw-r--r--drivers/gpu/drm/radeon/radeon_benchmark.c4
-rw-r--r--drivers/gpu/drm/radeon/radeon_cs.c8
-rw-r--r--drivers/gpu/drm/radeon/radeon_cursor.c9
-rw-r--r--drivers/gpu/drm/radeon/radeon_device.c83
-rw-r--r--drivers/gpu/drm/radeon/radeon_display.c74
-rw-r--r--drivers/gpu/drm/radeon/radeon_drv.c23
-rw-r--r--drivers/gpu/drm/radeon/radeon_drv.h1
-rw-r--r--drivers/gpu/drm/radeon/radeon_encoders.c359
-rw-r--r--drivers/gpu/drm/radeon/radeon_fb.c103
-rw-r--r--drivers/gpu/drm/radeon/radeon_fence.c2
-rw-r--r--drivers/gpu/drm/radeon/radeon_gart.c2
-rw-r--r--drivers/gpu/drm/radeon/radeon_gem.c45
-rw-r--r--drivers/gpu/drm/radeon/radeon_kms.c4
-rw-r--r--drivers/gpu/drm/radeon/radeon_legacy_crtc.c687
-rw-r--r--drivers/gpu/drm/radeon/radeon_legacy_encoders.c188
-rw-r--r--drivers/gpu/drm/radeon/radeon_mode.h51
-rw-r--r--drivers/gpu/drm/radeon/radeon_object.c188
-rw-r--r--drivers/gpu/drm/radeon/radeon_ring.c15
-rw-r--r--drivers/gpu/drm/radeon/radeon_share.h39
-rw-r--r--drivers/gpu/drm/radeon/radeon_test.c209
-rw-r--r--drivers/gpu/drm/radeon/radeon_ttm.c24
-rw-r--r--drivers/gpu/drm/radeon/rs400.c30
-rw-r--r--drivers/gpu/drm/radeon/rs600.c7
-rw-r--r--drivers/gpu/drm/radeon/rs690.c479
-rw-r--r--drivers/gpu/drm/radeon/rs690r.h99
-rw-r--r--drivers/gpu/drm/radeon/rv515.c799
-rw-r--r--drivers/gpu/drm/radeon/rv515r.h170
-rw-r--r--drivers/gpu/drm/radeon/rv770.c2
-rw-r--r--drivers/gpu/drm/ttm/ttm_bo.c70
-rw-r--r--drivers/gpu/drm/ttm/ttm_bo_util.c70
-rw-r--r--drivers/gpu/drm/ttm/ttm_bo_vm.c8
-rw-r--r--drivers/gpu/drm/ttm/ttm_tt.c26
-rw-r--r--drivers/gpu/drm/via/via_irq.c6
-rw-r--r--drivers/hid/hid-core.c6
-rw-r--r--drivers/hid/usbhid/hid-core.c1
-rw-r--r--drivers/hid/usbhid/hiddev.c4
-rw-r--r--drivers/hwmon/abituguru3.c6
-rw-r--r--drivers/hwmon/asus_atk0110.c6
-rw-r--r--drivers/hwmon/max6650.c1
-rw-r--r--drivers/hwmon/sht15.c2
-rw-r--r--drivers/hwmon/smsc47m1.c11
-rw-r--r--drivers/i2c/busses/Kconfig1
-rw-r--r--drivers/i2c/busses/i2c-davinci.c26
-rw-r--r--drivers/i2c/busses/i2c-ibm_iic.c9
-rw-r--r--drivers/i2c/busses/i2c-omap.c48
-rw-r--r--drivers/i2c/busses/i2c-s3c2410.c5
-rw-r--r--drivers/i2c/busses/i2c-sh_mobile.c4
-rw-r--r--drivers/i2c/busses/i2c-simtec.c2
-rw-r--r--drivers/i2c/chips/tsl2550.c17
-rw-r--r--drivers/ide/cs5520.c1
-rw-r--r--drivers/ide/ide-acpi.c37
-rw-r--r--drivers/ide/ide-cd.c24
-rw-r--r--drivers/ide/ide-devsets.c2
-rw-r--r--drivers/ide/ide-disk.c1
-rw-r--r--drivers/ide/ide-dma.c21
-rw-r--r--drivers/ide/ide-eh.c2
-rw-r--r--drivers/ide/ide-floppy.c2
-rw-r--r--drivers/ide/ide-io.c14
-rw-r--r--drivers/ide/ide-ioctls.c3
-rw-r--r--drivers/ide/ide-iops.c4
-rw-r--r--drivers/ide/ide-pm.c30
-rw-r--r--drivers/ide/ide-probe.c23
-rw-r--r--drivers/ide/ide-tape.c1
-rw-r--r--drivers/ieee1394/sbp2.c1
-rw-r--r--drivers/ieee1394/sbp2.h8
-rw-r--r--drivers/input/evdev.c3
-rw-r--r--drivers/input/joydev.c2
-rw-r--r--drivers/input/joystick/xpad.c26
-rw-r--r--drivers/input/keyboard/Kconfig294
-rw-r--r--drivers/input/keyboard/Makefile33
-rw-r--r--drivers/input/keyboard/atkbd.c32
-rw-r--r--drivers/input/keyboard/gpio_keys.c33
-rw-r--r--drivers/input/keyboard/matrix_keypad.c453
-rw-r--r--drivers/input/misc/cobalt_btns.c4
-rw-r--r--drivers/input/misc/pcspkr.c8
-rw-r--r--drivers/input/misc/wistron_btns.c25
-rw-r--r--drivers/input/mouse/gpio_mouse.c11
-rw-r--r--drivers/input/serio/hp_sdc_mlc.c2
-rw-r--r--drivers/input/serio/i8042-x86ia64io.h36
-rw-r--r--drivers/input/serio/i8042.c7
-rw-r--r--drivers/input/serio/serio.c7
-rw-r--r--drivers/input/tablet/wacom_wac.c6
-rw-r--r--drivers/isdn/gigaset/interface.c2
-rw-r--r--drivers/isdn/hisax/hfc_usb.c1
-rw-r--r--drivers/isdn/i4l/isdn_tty.c1
-rw-r--r--drivers/isdn/mISDN/stack.c1
-rw-r--r--drivers/leds/Kconfig14
-rw-r--r--drivers/leds/Makefile1
-rw-r--r--drivers/leds/leds-alix2.c7
-rw-r--r--drivers/leds/leds-bd2802.c96
-rw-r--r--drivers/leds/leds-cobalt-raq.c2
-rw-r--r--drivers/leds/leds-gpio.c22
-rw-r--r--drivers/leds/leds-lp3944.c466
-rw-r--r--drivers/leds/leds-pca9532.c58
-rw-r--r--drivers/lguest/core.c119
-rw-r--r--drivers/lguest/hypercalls.c145
-rw-r--r--drivers/lguest/interrupts_and_traps.c288
-rw-r--r--drivers/lguest/lg.h36
-rw-r--r--drivers/lguest/lguest_device.c160
-rw-r--r--drivers/lguest/lguest_user.c236
-rw-r--r--drivers/lguest/page_tables.c489
-rw-r--r--drivers/lguest/segments.c106
-rw-r--r--drivers/lguest/x86/core.c374
-rw-r--r--drivers/lguest/x86/switcher_32.S22
-rw-r--r--drivers/macintosh/macio_asic.c11
-rw-r--r--drivers/md/dm-crypt.c4
-rw-r--r--drivers/md/dm-delay.c4
-rw-r--r--drivers/md/dm-exception-store.c9
-rw-r--r--drivers/md/dm-linear.c2
-rw-r--r--drivers/md/dm-mpath.c2
-rw-r--r--drivers/md/dm-raid1.c3
-rw-r--r--drivers/md/dm-stripe.c7
-rw-r--r--drivers/md/dm-table.c17
-rw-r--r--drivers/md/dm.c14
-rw-r--r--drivers/md/dm.h1
-rw-r--r--drivers/md/linear.c6
-rw-r--r--drivers/md/md.c218
-rw-r--r--drivers/md/md.h2
-rw-r--r--drivers/md/multipath.c12
-rw-r--r--drivers/md/raid0.c10
-rw-r--r--drivers/md/raid1.c16
-rw-r--r--drivers/md/raid10.c23
-rw-r--r--drivers/md/raid5.c79
-rw-r--r--drivers/media/common/tuners/tuner-xc2028.c13
-rw-r--r--drivers/media/dvb/b2c2/flexcop-fe-tuner.c67
-rw-r--r--drivers/media/dvb/bt8xx/dst_ca.c1
-rw-r--r--drivers/media/dvb/dvb-core/dvbdev.h1
-rw-r--r--drivers/media/dvb/frontends/af9013.c25
-rw-r--r--drivers/media/dvb/ttpci/Kconfig1
-rw-r--r--drivers/media/dvb/ttpci/av7110.c1
-rw-r--r--drivers/media/radio/radio-mr800.c1
-rw-r--r--drivers/media/radio/radio-si470x.c6
-rw-r--r--drivers/media/video/Kconfig8
-rw-r--r--drivers/media/video/Makefile1
-rw-r--r--drivers/media/video/bt8xx/bttv-cards.c92
-rw-r--r--drivers/media/video/bt8xx/bttv-driver.c2
-rw-r--r--drivers/media/video/bt8xx/bttv.h1
-rw-r--r--drivers/media/video/cx18/cx18-cards.c34
-rw-r--r--drivers/media/video/cx18/cx18-dvb.c160
-rw-r--r--drivers/media/video/cx23885/cx23885-417.c5
-rw-r--r--drivers/media/video/cx23885/cx23885-dvb.c30
-rw-r--r--drivers/media/video/cx23885/cx23885-video.c1
-rw-r--r--drivers/media/video/cx23885/cx23885.h4
-rw-r--r--drivers/media/video/cx88/cx88-blackbird.c1
-rw-r--r--drivers/media/video/cx88/cx88-video.c1
-rw-r--r--drivers/media/video/dabusb.c1
-rw-r--r--drivers/media/video/em28xx/Kconfig2
-rw-r--r--drivers/media/video/em28xx/em28xx-cards.c182
-rw-r--r--drivers/media/video/em28xx/em28xx-core.c18
-rw-r--r--drivers/media/video/em28xx/em28xx-dvb.c74
-rw-r--r--drivers/media/video/em28xx/em28xx-i2c.c2
-rw-r--r--drivers/media/video/em28xx/em28xx-video.c84
-rw-r--r--drivers/media/video/em28xx/em28xx.h32
-rw-r--r--drivers/media/video/gspca/Kconfig16
-rw-r--r--drivers/media/video/gspca/Makefile2
-rw-r--r--drivers/media/video/gspca/conex.c2
-rw-r--r--drivers/media/video/gspca/gspca.c73
-rw-r--r--drivers/media/video/gspca/gspca.h9
-rw-r--r--drivers/media/video/gspca/m5602/m5602_s5k4aa.c6
-rw-r--r--drivers/media/video/gspca/mars.c2
-rw-r--r--drivers/media/video/gspca/sn9c20x.c2434
-rw-r--r--drivers/media/video/gspca/sonixj.c4
-rw-r--r--drivers/media/video/gspca/spca500.c2
-rw-r--r--drivers/media/video/gspca/stk014.c2
-rw-r--r--drivers/media/video/gspca/stv06xx/stv06xx.h4
-rw-r--r--drivers/media/video/gspca/stv06xx/stv06xx_hdcs.c16
-rw-r--r--drivers/media/video/gspca/sunplus.c2
-rw-r--r--drivers/media/video/gspca/zc3xx.c2
-rw-r--r--drivers/media/video/mt9v011.c496
-rw-r--r--drivers/media/video/mt9v011.h35
-rw-r--r--drivers/media/video/pwc/pwc-if.c1
-rw-r--r--drivers/media/video/pwc/pwc.h1
-rw-r--r--drivers/media/video/s2255drv.c1
-rw-r--r--drivers/media/video/saa5246a.c1
-rw-r--r--drivers/media/video/saa5249.c1
-rw-r--r--drivers/media/video/saa7134/saa7134-empress.c1
-rw-r--r--drivers/media/video/se401.c1
-rw-r--r--drivers/media/video/soc_camera.c12
-rw-r--r--drivers/media/video/stk-webcam.c1
-rw-r--r--drivers/media/video/stradis.c1
-rw-r--r--drivers/media/video/stv680.c1
-rw-r--r--drivers/media/video/usbvideo/vicam.c1
-rw-r--r--drivers/media/video/usbvision/usbvision-video.c1
-rw-r--r--drivers/media/video/v4l2-dev.c1
-rw-r--r--drivers/media/video/vivi.c99
-rw-r--r--drivers/media/video/zoran/zoran_driver.c1
-rw-r--r--drivers/mfd/dm355evm_msp.c3
-rw-r--r--drivers/mfd/ezx-pcap.c4
-rw-r--r--drivers/mfd/sm501.c3
-rw-r--r--drivers/mfd/twl4030-irq.c55
-rw-r--r--drivers/misc/cb710/sgbuf2.c4
-rw-r--r--drivers/misc/eeprom/at25.c4
-rw-r--r--drivers/misc/sgi-gru/grufile.c1
-rw-r--r--drivers/misc/sgi-gru/grukservices.c1
-rw-r--r--drivers/misc/sgi-xp/xpnet.c4
-rw-r--r--drivers/mmc/host/cb710-mmc.c6
-rw-r--r--drivers/mmc/host/imxmmc.c2
-rw-r--r--drivers/mmc/host/mmc_spi.c6
-rw-r--r--drivers/mmc/host/mvsdio.c4
-rw-r--r--drivers/mmc/host/pxamci.c4
-rw-r--r--drivers/mmc/host/sdhci-of.c10
-rw-r--r--drivers/mmc/host/sdhci.c15
-rw-r--r--drivers/mmc/host/sdhci.h1
-rw-r--r--drivers/mtd/cmdlinepart.c2
-rw-r--r--drivers/mtd/devices/m25p80.c2
-rw-r--r--drivers/mtd/inftlcore.c11
-rw-r--r--drivers/mtd/maps/Kconfig7
-rw-r--r--drivers/mtd/maps/Makefile1
-rw-r--r--drivers/mtd/maps/integrator-flash.c22
-rw-r--r--drivers/mtd/maps/sbc8240.c250
-rw-r--r--drivers/mtd/mtd_blkdevs.c6
-rw-r--r--drivers/mtd/mtdblock.c16
-rw-r--r--drivers/mtd/mtdcore.c7
-rw-r--r--drivers/mtd/nand/atmel_nand.c2
-rw-r--r--drivers/mtd/nand/omap2.c7
-rw-r--r--drivers/mtd/nftlcore.c16
-rw-r--r--drivers/mtd/onenand/omap2.c3
-rw-r--r--drivers/mtd/ubi/build.c6
-rw-r--r--drivers/mtd/ubi/debug.c2
-rw-r--r--drivers/mtd/ubi/debug.h7
-rw-r--r--drivers/mtd/ubi/eba.c1
-rw-r--r--drivers/mtd/ubi/gluebi.c1
-rw-r--r--drivers/mtd/ubi/io.c157
-rw-r--r--drivers/mtd/ubi/scan.c25
-rw-r--r--drivers/mtd/ubi/scan.h2
-rw-r--r--drivers/mtd/ubi/ubi-media.h12
-rw-r--r--drivers/mtd/ubi/ubi.h6
-rw-r--r--drivers/mtd/ubi/wl.c8
-rw-r--r--drivers/net/a2065.c12
-rw-r--r--drivers/net/arcnet/arcnet.c26
-rw-r--r--drivers/net/bmac.c7
-rw-r--r--drivers/net/bnx2x_main.c7
-rw-r--r--drivers/net/dl2k.c17
-rw-r--r--drivers/net/epic100.c5
-rw-r--r--drivers/net/fealnx.c15
-rw-r--r--drivers/net/hamachi.c23
-rw-r--r--drivers/net/hamradio/baycom_epp.c2
-rw-r--r--drivers/net/hamradio/baycom_par.c2
-rw-r--r--drivers/net/hamradio/baycom_ser_fdx.c2
-rw-r--r--drivers/net/hamradio/baycom_ser_hdx.c2
-rw-r--r--drivers/net/irda/irtty-sir.c1
-rw-r--r--drivers/net/mlx4/cmd.c5
-rw-r--r--drivers/net/mlx4/main.c6
-rw-r--r--drivers/net/natsemi.c4
-rw-r--r--drivers/net/ne.c2
-rw-r--r--drivers/net/pci-skeleton.c2
-rw-r--r--drivers/net/pcmcia/ibmtr_cs.c13
-rw-r--r--drivers/net/pcmcia/nmclan_cs.c15
-rw-r--r--drivers/net/pcnet32.c50
-rw-r--r--drivers/net/ppp_async.c1
-rw-r--r--drivers/net/ppp_synctty.c1
-rw-r--r--drivers/net/starfire.c2
-rw-r--r--drivers/net/sundance.c6
-rw-r--r--drivers/net/tsi108_eth.c8
-rw-r--r--drivers/net/tulip/de2104x.c7
-rw-r--r--drivers/net/tulip/tulip_core.c14
-rw-r--r--drivers/net/tulip/winbond-840.c6
-rw-r--r--drivers/net/wan/hd64570.c3
-rw-r--r--drivers/net/wan/hd64572.c3
-rw-r--r--drivers/net/wan/sbni.c8
-rw-r--r--drivers/net/wireless/ray_cs.c9
-rw-r--r--drivers/net/wireless/wavelan_cs.c13
-rw-r--r--drivers/net/yellowfin.c23
-rw-r--r--drivers/oprofile/oprofile_stats.c1
-rw-r--r--drivers/parisc/ccio-dma.c8
-rw-r--r--drivers/parisc/dino.c14
-rw-r--r--drivers/parisc/eisa.c2
-rw-r--r--drivers/parisc/eisa_eeprom.c2
-rw-r--r--drivers/parisc/eisa_enumerator.c14
-rw-r--r--drivers/parisc/gsc.c4
-rw-r--r--drivers/parisc/gsc.h2
-rw-r--r--drivers/parisc/hppb.c9
-rw-r--r--drivers/parisc/iosapic.c2
-rw-r--r--drivers/parisc/lba_pci.c41
-rw-r--r--drivers/parisc/pdc_stable.c2
-rw-r--r--drivers/parisc/sba_iommu.c2
-rw-r--r--drivers/parisc/superio.c6
-rw-r--r--drivers/parport/parport_pc.c5
-rw-r--r--drivers/pci/hotplug/cpci_hotplug_core.c1
-rw-r--r--drivers/pci/hotplug/cpqphp_ctrl.c1
-rw-r--r--drivers/pci/hotplug/cpqphp_sysfs.c1
-rw-r--r--drivers/pci/hotplug/pci_hotplug_core.c2
-rw-r--r--drivers/pci/hotplug/pciehp_ctrl.c1
-rw-r--r--drivers/pci/intel-iommu.c800
-rw-r--r--drivers/pci/iova.c26
-rw-r--r--drivers/pci/msi.c64
-rw-r--r--drivers/pci/msi.h10
-rw-r--r--drivers/pci/pci.c15
-rw-r--r--drivers/pci/pcie/aer/ecrc.c2
-rw-r--r--drivers/pci/quirks.c5
-rw-r--r--drivers/pci/setup-res.c4
-rw-r--r--drivers/pci/slot.c4
-rw-r--r--drivers/pci/syscall.c1
-rw-r--r--drivers/pcmcia/tcic.c3
-rw-r--r--drivers/pcmcia/vrc4171_card.c4
-rw-r--r--drivers/pcmcia/vrc4173_cardu.c4
-rw-r--r--drivers/pcmcia/vrc4173_cardu.h2
-rw-r--r--drivers/platform/x86/Kconfig26
-rw-r--r--drivers/platform/x86/eeepc-laptop.c355
-rw-r--r--drivers/platform/x86/hp-wmi.c12
-rw-r--r--drivers/platform/x86/thinkpad_acpi.c390
-rw-r--r--drivers/power/Kconfig7
-rw-r--r--drivers/power/Makefile1
-rw-r--r--drivers/power/ds2782_battery.c330
-rw-r--r--drivers/power/olpc_battery.c26
-rw-r--r--drivers/power/wm97xx_battery.c4
-rw-r--r--drivers/rtc/rtc-bfin.c30
-rw-r--r--drivers/rtc/rtc-cmos.c23
-rw-r--r--drivers/rtc/rtc-ds1374.c4
-rw-r--r--drivers/rtc/rtc-vr41xx.c4
-rw-r--r--drivers/s390/block/dasd_eckd.c45
-rw-r--r--drivers/s390/block/dasd_erp.c2
-rw-r--r--drivers/s390/block/dasd_fba.c25
-rw-r--r--drivers/s390/block/dasd_int.h3
-rw-r--r--drivers/s390/block/dasd_ioctl.c1
-rw-r--r--drivers/s390/block/dcssblk.c7
-rw-r--r--drivers/s390/block/xpram.c2
-rw-r--r--drivers/s390/char/monreader.c4
-rw-r--r--drivers/s390/char/sclp_rw.h5
-rw-r--r--drivers/s390/char/vmwatchdog.c8
-rw-r--r--drivers/s390/crypto/ap_bus.c9
-rw-r--r--drivers/s390/scsi/zfcp_erp.c68
-rw-r--r--drivers/s390/scsi/zfcp_fc.c8
-rw-r--r--drivers/s390/scsi/zfcp_fsf.c56
-rw-r--r--drivers/s390/scsi/zfcp_scsi.c25
-rw-r--r--drivers/s390/scsi/zfcp_sysfs.c7
-rw-r--r--drivers/scsi/atari_NCR5380.c3
-rw-r--r--drivers/scsi/cxgb3i/Kbuild2
-rw-r--r--drivers/scsi/cxgb3i/cxgb3i_iscsi.c4
-rw-r--r--drivers/scsi/fnic/fnic_main.c8
-rw-r--r--drivers/scsi/fnic/fnic_scsi.c7
-rw-r--r--drivers/scsi/ibmvscsi/ibmvscsi.c7
-rw-r--r--drivers/scsi/libfc/fc_exch.c23
-rw-r--r--drivers/scsi/libiscsi.c4
-rw-r--r--drivers/scsi/libsas/sas_expander.c147
-rw-r--r--drivers/scsi/libsas/sas_port.c19
-rw-r--r--drivers/scsi/mac53c94.c5
-rw-r--r--drivers/scsi/qla2xxx/qla_mid.c1
-rw-r--r--drivers/scsi/qla4xxx/ql4_dbg.c15
-rw-r--r--drivers/scsi/qla4xxx/ql4_def.h9
-rw-r--r--drivers/scsi/qla4xxx/ql4_fw.h7
-rw-r--r--drivers/scsi/qla4xxx/ql4_iocb.c133
-rw-r--r--drivers/scsi/qla4xxx/ql4_isr.c145
-rw-r--r--drivers/scsi/qla4xxx/ql4_mbx.c10
-rw-r--r--drivers/scsi/qla4xxx/ql4_os.c40
-rw-r--r--drivers/scsi/qla4xxx/ql4_version.h2
-rw-r--r--drivers/scsi/scsi_transport_fc.c5
-rw-r--r--drivers/scsi/sd.c20
-rw-r--r--drivers/scsi/sg.c10
-rw-r--r--drivers/scsi/sun3_NCR5380.c3
-rw-r--r--drivers/scsi/zalon.c2
-rw-r--r--drivers/serial/8250_pci.c17
-rw-r--r--drivers/serial/atmel_serial.c2
-rw-r--r--drivers/serial/bfin_sport_uart.c1
-rw-r--r--drivers/serial/cpm_uart/cpm_uart_cpm2.c2
-rw-r--r--drivers/serial/msm_serial.c1
-rw-r--r--drivers/serial/s3c2400.c8
-rw-r--r--drivers/serial/s3c2410.c8
-rw-r--r--drivers/serial/s3c2412.c8
-rw-r--r--drivers/serial/s3c2440.c8
-rw-r--r--drivers/serial/s3c24a0.c8
-rw-r--r--drivers/serial/s3c6400.c8
-rw-r--r--drivers/serial/serial_ks8695.c2
-rw-r--r--drivers/serial/sh-sci.c11
-rw-r--r--drivers/serial/vr41xx_siu.c2
-rw-r--r--drivers/spi/omap2_mcspi.c32
-rw-r--r--drivers/spi/omap_uwire.c2
-rw-r--r--drivers/spi/spi_bitbang.c24
-rw-r--r--drivers/spi/spidev.c17
-rw-r--r--drivers/ssb/driver_mipscore.c85
-rw-r--r--drivers/ssb/pcmcia.c4
-rw-r--r--drivers/staging/Kconfig2
-rw-r--r--drivers/staging/Makefile1
-rw-r--r--drivers/staging/android/lowmemorykiller.c8
-rw-r--r--drivers/staging/b3dfg/Kconfig1
-rw-r--r--drivers/staging/comedi/drivers/jr3_pci.c2
-rw-r--r--drivers/staging/comedi/drivers/s626.c35
-rw-r--r--drivers/staging/go7007/s2250-loader.c1
-rw-r--r--drivers/staging/heci/Kconfig1
-rw-r--r--drivers/staging/meilhaus/TODO2
-rw-r--r--drivers/staging/rspiusb/rspiusb.c16
-rw-r--r--drivers/staging/rt2860/rt_linux.h13
-rw-r--r--drivers/staging/rt2870/2870_main_dev.c67
-rw-r--r--drivers/staging/rt2870/common/2870_rtmp_init.c33
-rw-r--r--drivers/staging/rt2870/common/rtusb_io.c3
-rw-r--r--drivers/staging/rt2870/rt2870.h10
-rw-r--r--drivers/staging/rtl8187se/ieee80211/ieee80211_softmac_wx.c12
-rw-r--r--drivers/staging/rtl8192su/Kconfig2
-rw-r--r--drivers/staging/rtl8192su/ieee80211.h2
-rw-r--r--drivers/staging/rtl8192su/ieee80211/ieee80211.h2
-rw-r--r--drivers/staging/rtl8192su/ieee80211/ieee80211_module.c1
-rw-r--r--drivers/staging/rtl8192su/ieee80211/ieee80211_softmac_wx.c14
-rw-r--r--drivers/staging/rtl8192su/ieee80211/ieee80211_tx.c3
-rw-r--r--drivers/staging/rtl8192su/r8192U_core.c23
-rw-r--r--drivers/staging/rtl8192su/r8192U_pm.c8
-rw-r--r--drivers/staging/serqt_usb2/serqt_usb2.c26
-rw-r--r--drivers/staging/stlc45xx/stlc45xx.c27
-rw-r--r--drivers/staging/uc2322/Kconfig10
-rw-r--r--drivers/staging/uc2322/Makefile1
-rw-r--r--drivers/staging/uc2322/TODO7
-rw-r--r--drivers/staging/uc2322/aten2011.c2430
-rw-r--r--drivers/staging/udlfb/udlfb.c1
-rw-r--r--drivers/staging/usbip/usbip_common.c1
-rw-r--r--drivers/staging/vt6655/device_main.c10
-rw-r--r--drivers/telephony/ixj.c1
-rw-r--r--drivers/telephony/phonedev.c1
-rw-r--r--drivers/usb/class/cdc-acm.c37
-rw-r--r--drivers/usb/class/cdc-acm.h2
-rw-r--r--drivers/usb/class/cdc-wdm.c1
-rw-r--r--drivers/usb/class/usbtmc.c10
-rw-r--r--drivers/usb/core/Kconfig2
-rw-r--r--drivers/usb/core/config.c48
-rw-r--r--drivers/usb/core/devices.c10
-rw-r--r--drivers/usb/core/devio.c88
-rw-r--r--drivers/usb/core/hcd.c2
-rw-r--r--drivers/usb/core/hcd.h4
-rw-r--r--drivers/usb/core/hub.c40
-rw-r--r--drivers/usb/core/hub.h6
-rw-r--r--drivers/usb/core/message.c63
-rw-r--r--drivers/usb/gadget/Kconfig43
-rw-r--r--drivers/usb/gadget/amd5536udc.c1
-rw-r--r--drivers/usb/gadget/audio.c6
-rw-r--r--drivers/usb/gadget/ether.c11
-rw-r--r--drivers/usb/gadget/langwell_udc.c1
-rw-r--r--drivers/usb/gadget/pxa25x_udc.c24
-rw-r--r--drivers/usb/gadget/rndis.c2
-rw-r--r--drivers/usb/gadget/s3c2410_udc.c1
-rw-r--r--drivers/usb/host/Kconfig33
-rw-r--r--drivers/usb/host/ehci-au1xxx.c2
-rw-r--r--drivers/usb/host/ehci-fsl.c2
-rw-r--r--drivers/usb/host/ehci-hcd.c40
-rw-r--r--drivers/usb/host/ehci-ixp4xx.c2
-rw-r--r--drivers/usb/host/ehci-orion.c4
-rw-r--r--drivers/usb/host/ehci-pci.c2
-rw-r--r--drivers/usb/host/ehci-ppc-of.c2
-rw-r--r--drivers/usb/host/ehci-ps3.c2
-rw-r--r--drivers/usb/host/ehci-q.c155
-rw-r--r--drivers/usb/host/ehci-sched.c13
-rw-r--r--drivers/usb/host/ehci.h2
-rw-r--r--drivers/usb/host/fhci-sched.c8
-rw-r--r--drivers/usb/host/isp1760-if.c2
-rw-r--r--drivers/usb/host/ohci-omap.c1
-rw-r--r--drivers/usb/host/r8a66597-hcd.c1
-rw-r--r--drivers/usb/host/xhci-dbg.c199
-rw-r--r--drivers/usb/host/xhci-hcd.c290
-rw-r--r--drivers/usb/host/xhci-mem.c300
-rw-r--r--drivers/usb/host/xhci-pci.c1
-rw-r--r--drivers/usb/host/xhci-ring.c305
-rw-r--r--drivers/usb/host/xhci.h148
-rw-r--r--drivers/usb/misc/Kconfig2
-rw-r--r--drivers/usb/misc/iowarrior.c1
-rw-r--r--drivers/usb/misc/rio500.c1
-rw-r--r--drivers/usb/misc/usblcd.c1
-rw-r--r--drivers/usb/mon/mon_bin.c2
-rw-r--r--drivers/usb/musb/Kconfig1
-rw-r--r--drivers/usb/musb/cppi_dma.h1
-rw-r--r--drivers/usb/musb/davinci.c32
-rw-r--r--drivers/usb/musb/musb_core.c3
-rw-r--r--drivers/usb/musb/musb_core.h1
-rw-r--r--drivers/usb/musb/musb_gadget_ep0.c2
-rw-r--r--drivers/usb/musb/musb_host.c27
-rw-r--r--drivers/usb/musb/musb_regs.h1
-rw-r--r--drivers/usb/otg/Kconfig14
-rw-r--r--drivers/usb/otg/Makefile1
-rw-r--r--drivers/usb/otg/langwell_otg.c1915
-rw-r--r--drivers/usb/otg/nop-usb-xceiv.c1
-rw-r--r--drivers/usb/serial/console.c13
-rw-r--r--drivers/usb/serial/cp210x.c5
-rw-r--r--drivers/usb/serial/cypress_m8.c4
-rw-r--r--drivers/usb/serial/ftdi_sio.c74
-rw-r--r--drivers/usb/serial/ftdi_sio.h39
-rw-r--r--drivers/usb/serial/generic.c20
-rw-r--r--drivers/usb/serial/mos7720.c2
-rw-r--r--drivers/usb/serial/mos7840.c10
-rw-r--r--drivers/usb/serial/option.c178
-rw-r--r--drivers/usb/serial/pl2303.c60
-rw-r--r--drivers/usb/serial/pl2303.h8
-rw-r--r--drivers/usb/serial/sierra.c51
-rw-r--r--drivers/usb/serial/ti_usb_3410_5052.c7
-rw-r--r--drivers/usb/serial/usb-serial.c43
-rw-r--r--drivers/usb/storage/option_ms.c3
-rw-r--r--drivers/usb/storage/transport.c2
-rw-r--r--drivers/usb/storage/unusual_devs.h7
-rw-r--r--drivers/video/Kconfig5
-rw-r--r--drivers/video/amba-clcd.c7
-rw-r--r--drivers/video/atafb.c8
-rw-r--r--drivers/video/atmel_lcdfb.c3
-rw-r--r--drivers/video/aty/atyfb.h3
-rw-r--r--drivers/video/aty/atyfb_base.c141
-rw-r--r--drivers/video/aty/mach64_accel.c7
-rw-r--r--drivers/video/backlight/jornada720_bl.c2
-rw-r--r--drivers/video/backlight/pwm_bl.c2
-rw-r--r--drivers/video/backlight/tdo24m.c2
-rw-r--r--drivers/video/cobalt_lcdfb.c2
-rw-r--r--drivers/video/console/fbcon.c6
-rw-r--r--drivers/video/console/fbcon_rotate.h2
-rw-r--r--drivers/video/console/sticore.c9
-rw-r--r--drivers/video/fbmem.c14
-rw-r--r--drivers/video/fbmon.c4
-rw-r--r--drivers/video/fsl-diu-fb.c20
-rw-r--r--drivers/video/hitfb.c66
-rw-r--r--drivers/video/i810/i810_main.c5
-rw-r--r--drivers/video/matrox/matroxfb_DAC1064.c4
-rw-r--r--drivers/video/matrox/matroxfb_Ti3026.c4
-rw-r--r--drivers/video/matrox/matroxfb_base.c4
-rw-r--r--drivers/video/matrox/matroxfb_crtc2.c7
-rw-r--r--drivers/video/mx3fb.c92
-rw-r--r--drivers/video/omap/omapfb_main.c18
-rw-r--r--drivers/video/platinumfb.c2
-rw-r--r--drivers/video/pxafb.c2
-rw-r--r--drivers/video/s3c-fb.c21
-rw-r--r--drivers/video/sh7760fb.c19
-rw-r--r--drivers/video/sh_mobile_lcdcfb.c91
-rw-r--r--drivers/video/sis/sis_main.c3
-rw-r--r--drivers/video/sm501fb.c26
-rw-r--r--drivers/video/stifb.c7
-rw-r--r--drivers/video/via/hw.c4
-rw-r--r--drivers/video/via/lcd.c15
-rw-r--r--drivers/video/via/viafbdev.c101
-rw-r--r--drivers/video/via/viafbdev.h3
-rw-r--r--drivers/video/w100fb.c4
-rw-r--r--drivers/virtio/virtio_pci.c242
-rw-r--r--drivers/vlynq/Kconfig2
-rw-r--r--drivers/vlynq/vlynq.c2
-rw-r--r--drivers/w1/masters/omap_hdq.c1
-rw-r--r--drivers/watchdog/bcm47xx_wdt.c2
-rw-r--r--drivers/watchdog/coh901327_wdt.c11
-rw-r--r--drivers/watchdog/ep93xx_wdt.c1
-rw-r--r--drivers/watchdog/ks8695_wdt.c4
-rw-r--r--drivers/watchdog/sa1100_wdt.c5
-rw-r--r--drivers/watchdog/w83627hf_wdt.c5
-rw-r--r--drivers/watchdog/w83697ug_wdt.c4
-rw-r--r--drivers/watchdog/wdrtas.c8
-rw-r--r--drivers/xen/events.c4
-rw-r--r--fs/9p/vfs_addr.c2
-rw-r--r--fs/Kconfig27
-rw-r--r--fs/adfs/super.c1
-rw-r--r--fs/afs/dir.c2
-rw-r--r--fs/afs/flock.c1
-rw-r--r--fs/afs/mntpt.c1
-rw-r--r--fs/afs/super.c1
-rw-r--r--fs/aio.c24
-rw-r--r--fs/autofs4/dev-ioctl.c1
-rw-r--r--fs/bfs/dir.c1
-rw-r--r--fs/bfs/file.c1
-rw-r--r--fs/binfmt_elf.c9
-rw-r--r--fs/binfmt_flat.c17
-rw-r--r--fs/bio-integrity.c170
-rw-r--r--fs/bio.c33
-rw-r--r--fs/block_dev.c10
-rw-r--r--fs/btrfs/async-thread.c6
-rw-r--r--fs/btrfs/compression.c1
-rw-r--r--fs/btrfs/ctree.c121
-rw-r--r--fs/btrfs/ctree.h30
-rw-r--r--fs/btrfs/disk-io.c15
-rw-r--r--fs/btrfs/extent-tree.c1096
-rw-r--r--fs/btrfs/file.c6
-rw-r--r--fs/btrfs/free-space-cache.c1058
-rw-r--r--fs/btrfs/free-space-cache.h8
-rw-r--r--fs/btrfs/inode.c31
-rw-r--r--fs/btrfs/ioctl.c7
-rw-r--r--fs/btrfs/print-tree.c6
-rw-r--r--fs/btrfs/relocation.c17
-rw-r--r--fs/btrfs/super.c1
-rw-r--r--fs/btrfs/transaction.c60
-rw-r--r--fs/btrfs/transaction.h1
-rw-r--r--fs/btrfs/tree-log.c2
-rw-r--r--fs/btrfs/volumes.c46
-rw-r--r--fs/btrfs/zlib.c6
-rw-r--r--fs/char_dev.c1
-rw-r--r--fs/cifs/CHANGES13
-rw-r--r--fs/cifs/README25
-rw-r--r--fs/cifs/asn1.c55
-rw-r--r--fs/cifs/cifs_debug.c8
-rw-r--r--fs/cifs/cifs_dfs_ref.c12
-rw-r--r--fs/cifs/cifs_spnego.c9
-rw-r--r--fs/cifs/cifs_unicode.c2
-rw-r--r--fs/cifs/cifsacl.c26
-rw-r--r--fs/cifs/cifsfs.c162
-rw-r--r--fs/cifs/cifsfs.h15
-rw-r--r--fs/cifs/cifsglob.h32
-rw-r--r--fs/cifs/cifspdu.h14
-rw-r--r--fs/cifs/cifsproto.h23
-rw-r--r--fs/cifs/cifssmb.c152
-rw-r--r--fs/cifs/connect.c103
-rw-r--r--fs/cifs/dir.c52
-rw-r--r--fs/cifs/dns_resolve.c25
-rw-r--r--fs/cifs/file.c40
-rw-r--r--fs/cifs/inode.c780
-rw-r--r--fs/cifs/link.c3
-rw-r--r--fs/cifs/netmisc.c56
-rw-r--r--fs/cifs/readdir.c505
-rw-r--r--fs/cifs/sess.c2
-rw-r--r--fs/cifs/xattr.c12
-rw-r--r--fs/compat.c5
-rw-r--r--fs/compat_ioctl.c2
-rw-r--r--fs/dlm/lock.c2
-rw-r--r--fs/dlm/lowcomms.c4
-rw-r--r--fs/dlm/plock.c17
-rw-r--r--fs/ecryptfs/keystore.c13
-rw-r--r--fs/eventfd.c122
-rw-r--r--fs/exec.c4
-rw-r--r--fs/exofs/common.h4
-rw-r--r--fs/exofs/dir.c4
-rw-r--r--fs/exofs/exofs.h7
-rw-r--r--fs/exofs/file.c21
-rw-r--r--fs/exofs/inode.c7
-rw-r--r--fs/exofs/namei.c4
-rw-r--r--fs/exofs/osd.c4
-rw-r--r--fs/exofs/super.c7
-rw-r--r--fs/exofs/symlink.c4
-rw-r--r--fs/ext2/ioctl.c1
-rw-r--r--fs/ext2/namei.c12
-rw-r--r--fs/ext3/dir.c3
-rw-r--r--fs/ext3/inode.c32
-rw-r--r--fs/ext4/ext4.h14
-rw-r--r--fs/ext4/ext4_jbd2.c4
-rw-r--r--fs/ext4/ext4_jbd2.h6
-rw-r--r--fs/ext4/extents.c1
-rw-r--r--fs/ext4/ialloc.c2
-rw-r--r--fs/ext4/inode.c384
-rw-r--r--fs/ext4/ioctl.c21
-rw-r--r--fs/ext4/mballoc.c50
-rw-r--r--fs/fat/dir.c1
-rw-r--r--fs/fat/file.c2
-rw-r--r--fs/fat/namei_msdos.c1
-rw-r--r--fs/fat/namei_vfat.c1
-rw-r--r--fs/fcntl.c1
-rw-r--r--fs/freevxfs/vxfs_super.c1
-rw-r--r--fs/fuse/dev.c91
-rw-r--r--fs/fuse/dir.c57
-rw-r--r--fs/fuse/file.c2
-rw-r--r--fs/fuse/fuse_i.h27
-rw-r--r--fs/fuse/inode.c68
-rw-r--r--fs/gfs2/aops.c39
-rw-r--r--fs/gfs2/glock.c138
-rw-r--r--fs/gfs2/glock.h3
-rw-r--r--fs/gfs2/glops.c21
-rw-r--r--fs/gfs2/incore.h2
-rw-r--r--fs/gfs2/rgrp.c23
-rw-r--r--fs/gfs2/super.c40
-rw-r--r--fs/gfs2/super.h4
-rw-r--r--fs/gfs2/trace_gfs2.h8
-rw-r--r--fs/hfs/super.c1
-rw-r--r--fs/hfsplus/super.c1
-rw-r--r--fs/hostfs/hostfs_kern.c1
-rw-r--r--fs/hpfs/dir.c1
-rw-r--r--fs/hpfs/file.c1
-rw-r--r--fs/hpfs/hpfs_fn.h1
-rw-r--r--fs/hpfs/inode.c1
-rw-r--r--fs/hpfs/namei.c1
-rw-r--r--fs/inode.c40
-rw-r--r--fs/isofs/inode.c4
-rw-r--r--fs/jbd/journal.c26
-rw-r--r--fs/jbd/transaction.c68
-rw-r--r--fs/jbd2/journal.c31
-rw-r--r--fs/jbd2/transaction.c68
-rw-r--r--fs/jffs2/erase.c10
-rw-r--r--fs/jffs2/file.c2
-rw-r--r--fs/jffs2/scan.c4
-rw-r--r--fs/jffs2/super.c1
-rw-r--r--fs/jfs/acl.c4
-rw-r--r--fs/lockd/clntproc.c1
-rw-r--r--fs/lockd/svc4proc.c1
-rw-r--r--fs/lockd/svcproc.c1
-rw-r--r--fs/namei.c7
-rw-r--r--fs/namespace.c4
-rw-r--r--fs/nfs/client.c18
-rw-r--r--fs/nfs/delegation.c1
-rw-r--r--fs/nfs/dir.c3
-rw-r--r--fs/nfs/file.c1
-rw-r--r--fs/nfs/getroot.c1
-rw-r--r--fs/nfs/inode.c1
-rw-r--r--fs/nfs/nfs4_fs.h6
-rw-r--r--fs/nfs/nfs4proc.c41
-rw-r--r--fs/nfs/nfs4state.c2
-rw-r--r--fs/nfs/read.c1
-rw-r--r--fs/nfs/write.c8
-rw-r--r--fs/nfsd/nfsctl.c1
-rw-r--r--fs/nfsd/nfssvc.c1
-rw-r--r--fs/nfsd/vfs.c3
-rw-r--r--fs/nilfs2/Kconfig25
-rw-r--r--fs/nilfs2/bmap.c5
-rw-r--r--fs/nilfs2/cpfile.c5
-rw-r--r--fs/nilfs2/dat.c9
-rw-r--r--fs/nilfs2/dir.c1
-rw-r--r--fs/nilfs2/mdt.c4
-rw-r--r--fs/nilfs2/segment.c44
-rw-r--r--fs/notify/Kconfig12
-rw-r--r--fs/notify/dnotify/Kconfig2
-rw-r--r--fs/notify/fsnotify.c4
-rw-r--r--fs/notify/inotify/Kconfig2
-rw-r--r--fs/notify/inotify/inotify_user.c112
-rw-r--r--fs/notify/notification.c19
-rw-r--r--fs/ocfs2/ioctl.c1
-rw-r--r--fs/partitions/check.c2
-rw-r--r--fs/pipe.c4
-rw-r--r--fs/quota/dquot.c9
-rw-r--r--fs/ramfs/file-nommu.c1
-rw-r--r--fs/reiserfs/journal.c2
-rw-r--r--fs/reiserfs/super.c1
-rw-r--r--fs/reiserfs/xattr.c1
-rw-r--r--fs/squashfs/super.c1
-rw-r--r--fs/sync.c5
-rw-r--r--fs/sysfs/bin.c1
-rw-r--r--fs/sysfs/dir.c2
-rw-r--r--fs/ubifs/io.c57
-rw-r--r--fs/ubifs/ioctl.c1
-rw-r--r--fs/ubifs/recovery.c57
-rw-r--r--fs/ubifs/replay.c9
-rw-r--r--fs/ubifs/scan.c20
-rw-r--r--fs/ubifs/super.c14
-rw-r--r--fs/ubifs/ubifs.h11
-rw-r--r--fs/udf/super.c12
-rw-r--r--fs/xfs/linux-2.6/kmem.c4
-rw-r--r--fs/xfs/linux-2.6/xfs_aops.c8
-rw-r--r--fs/xfs/linux-2.6/xfs_buf.c2
-rw-r--r--fs/xfs/linux-2.6/xfs_file.c1
-rw-r--r--fs/xfs/linux-2.6/xfs_iops.c4
-rw-r--r--fs/xfs/xfs_iget.c142
-rw-r--r--fs/xfs/xfs_inode.h17
-rw-r--r--include/acpi/acpiosxf.h4
-rw-r--r--include/asm-generic/4level-fixup.h4
-rw-r--r--include/asm-generic/percpu.h4
-rw-r--r--include/asm-generic/pgtable-nopmd.h2
-rw-r--r--include/asm-generic/pgtable-nopud.h2
-rw-r--r--include/asm-generic/tlb.h12
-rw-r--r--include/asm-generic/vmlinux.lds.h34
-rw-r--r--include/drm/drm_edid.h38
-rw-r--r--include/drm/drm_pciids.h16
-rw-r--r--include/drm/radeon_drm.h23
-rw-r--r--include/drm/ttm/ttm_bo_driver.h20
-rw-r--r--include/drm/ttm/ttm_module.h2
-rw-r--r--include/linux/aio.h4
-rw-r--r--include/linux/backing-dev.h11
-rw-r--r--include/linux/bio.h22
-rw-r--r--include/linux/blkdev.h30
-rw-r--r--include/linux/cb710.h29
-rw-r--r--include/linux/cgroup.h28
-rw-r--r--include/linux/clockchips.h9
-rw-r--r--include/linux/clocksource.h14
-rw-r--r--include/linux/console_struct.h1
-rw-r--r--include/linux/crash_dump.h1
-rw-r--r--include/linux/decompress/generic.h32
-rw-r--r--include/linux/device-mapper.h4
-rw-r--r--include/linux/device.h2
-rw-r--r--include/linux/elfcore.h5
-rw-r--r--include/linux/eventfd.h35
-rw-r--r--include/linux/ext3_fs.h2
-rw-r--r--include/linux/fb.h1
-rw-r--r--include/linux/firewire.h1
-rw-r--r--include/linux/flex_array.h47
-rw-r--r--include/linux/fs.h4
-rw-r--r--include/linux/fsnotify_backend.h4
-rw-r--r--include/linux/ftrace_event.h12
-rw-r--r--include/linux/fuse.h36
-rw-r--r--include/linux/hardirq.h2
-rw-r--r--include/linux/hrtimer.h5
-rw-r--r--include/linux/ide.h5
-rw-r--r--include/linux/ima.h6
-rw-r--r--include/linux/init_task.h3
-rw-r--r--include/linux/input/matrix_keypad.h66
-rw-r--r--include/linux/interrupt.h28
-rw-r--r--include/linux/iocontext.h2
-rw-r--r--include/linux/kernel.h1
-rw-r--r--include/linux/kmemleak.h4
-rw-r--r--include/linux/kvm_host.h2
-rw-r--r--include/linux/leds-lp3944.h53
-rw-r--r--include/linux/leds.h14
-rw-r--r--include/linux/lguest.h39
-rw-r--r--include/linux/lguest_launcher.h18
-rw-r--r--include/linux/libata.h2
-rw-r--r--include/linux/linkage.h9
-rw-r--r--include/linux/mm.h2
-rw-r--r--include/linux/mnt_namespace.h13
-rw-r--r--include/linux/mtd/mtd.h2
-rw-r--r--include/linux/mtd/partitions.h2
-rw-r--r--include/linux/nodemask.h28
-rw-r--r--include/linux/pci.h2
-rw-r--r--include/linux/pci_ids.h1
-rw-r--r--include/linux/percpu-defs.h3
-rw-r--r--include/linux/perf_counter.h67
-rw-r--r--include/linux/personality.h5
-rw-r--r--include/linux/pps.h2
-rw-r--r--include/linux/quotaops.h1
-rw-r--r--include/linux/scatterlist.h2
-rw-r--r--include/linux/sched.h28
-rw-r--r--include/linux/slub_def.h2
-rw-r--r--include/linux/spi/spi.h6
-rw-r--r--include/linux/spi/spidev.h2
-rw-r--r--include/linux/sunrpc/xdr.h1
-rw-r--r--include/linux/syscalls.h2
-rw-r--r--include/linux/sysrq.h2
-rw-r--r--include/linux/timer.h4
-rw-r--r--include/linux/tty.h1
-rw-r--r--include/linux/tty_ldisc.h2
-rw-r--r--include/linux/uio.h17
-rw-r--r--include/linux/usb.h6
-rw-r--r--include/linux/usb/langwell_otg.h177
-rw-r--r--include/linux/usb/serial.h3
-rw-r--r--include/linux/videodev2.h3
-rw-r--r--include/linux/virtio_blk.h6
-rw-r--r--include/linux/virtio_config.h3
-rw-r--r--include/linux/virtio_net.h20
-rw-r--r--include/linux/virtio_ring.h12
-rw-r--r--include/media/v4l2-chip-ident.h15
-rw-r--r--include/trace/events/block.h6
-rw-r--r--include/trace/events/ext4.h54
-rw-r--r--include/trace/events/irq.h6
-rw-r--r--include/trace/events/jbd2.h6
-rw-r--r--include/trace/events/kmem.h6
-rw-r--r--include/trace/events/lockdep.h6
-rw-r--r--include/trace/events/sched.h6
-rw-r--r--include/trace/events/skb.h6
-rw-r--r--include/trace/events/workqueue.h6
-rw-r--r--include/trace/ftrace.h172
-rw-r--r--init/Kconfig13
-rw-r--r--ipc/mqueue.c2
-rw-r--r--kernel/Makefile1
-rw-r--r--kernel/acct.c6
-rw-r--r--kernel/cgroup.c151
-rw-r--r--kernel/exit.c1
-rw-r--r--kernel/fork.c31
-rw-r--r--kernel/freezer.c7
-rw-r--r--kernel/futex.c3
-rw-r--r--kernel/hrtimer.c110
-rw-r--r--kernel/irq/internals.h3
-rw-r--r--kernel/irq/manage.c55
-rw-r--r--kernel/irq/migration.c2
-rw-r--r--kernel/kexec.c2
-rw-r--r--kernel/kmod.c1
-rw-r--r--kernel/kprobes.c8
-rw-r--r--kernel/kthread.c10
-rw-r--r--kernel/lockdep_proc.c3
-rw-r--r--kernel/module.c9
-rw-r--r--kernel/panic.c1
-rw-r--r--kernel/perf_counter.c605
-rw-r--r--kernel/posix-cpu-timers.c7
-rw-r--r--kernel/posix-timers.c7
-rw-r--r--kernel/power/user.c1
-rw-r--r--kernel/profile.c5
-rw-r--r--kernel/ptrace.c4
-rw-r--r--kernel/rcutree.c3
-rw-r--r--kernel/resource.c2
-rw-r--r--kernel/rtmutex.c4
-rw-r--r--kernel/sched.c61
-rw-r--r--kernel/sched_cpupri.c15
-rw-r--r--kernel/sched_fair.c45
-rw-r--r--kernel/sched_rt.c18
-rw-r--r--kernel/signal.c25
-rw-r--r--kernel/smp.c2
-rw-r--r--kernel/softirq.c64
-rw-r--r--kernel/sysctl.c13
-rw-r--r--kernel/time/clockevents.c11
-rw-r--r--kernel/time/clocksource.c2
-rw-r--r--kernel/time/timer_stats.c16
-rw-r--r--kernel/timer.c4
-rw-r--r--kernel/trace/Kconfig6
-rw-r--r--kernel/trace/blktrace.c1
-rw-r--r--kernel/trace/ftrace.c84
-rw-r--r--kernel/trace/ring_buffer.c26
-rw-r--r--kernel/trace/trace.c37
-rw-r--r--kernel/trace/trace.h11
-rw-r--r--kernel/trace/trace_event_profile.c2
-rw-r--r--kernel/trace/trace_event_types.h3
-rw-r--r--kernel/trace/trace_events.c32
-rw-r--r--kernel/trace/trace_events_filter.c20
-rw-r--r--kernel/trace/trace_functions.c5
-rw-r--r--kernel/trace/trace_functions_graph.c11
-rw-r--r--kernel/trace/trace_output.c3
-rw-r--r--kernel/trace/trace_printk.c28
-rw-r--r--kernel/trace/trace_stack.c11
-rw-r--r--kernel/trace/trace_stat.c40
-rw-r--r--lib/Kconfig.debug12
-rw-r--r--lib/Makefile2
-rw-r--r--lib/atomic64.c11
-rw-r--r--lib/decompress_bunzip2.c24
-rw-r--r--lib/decompress_inflate.c10
-rw-r--r--lib/decompress_unlzma.c23
-rw-r--r--lib/dma-debug.c26
-rw-r--r--lib/dynamic_debug.c2
-rw-r--r--lib/flex_array.c267
-rw-r--r--lib/scatterlist.c16
-rw-r--r--mm/backing-dev.c7
-rw-r--r--mm/bootmem.c6
-rw-r--r--mm/dmapool.c2
-rw-r--r--mm/filemap.c1
-rw-r--r--mm/hugetlb.c2
-rw-r--r--mm/kmemleak.c409
-rw-r--r--mm/memcontrol.c25
-rw-r--r--mm/memory.c37
-rw-r--r--mm/mempolicy.c84
-rw-r--r--mm/nommu.c33
-rw-r--r--mm/page-writeback.c13
-rw-r--r--mm/page_alloc.c54
-rw-r--r--mm/percpu.c24
-rw-r--r--mm/slab.c8
-rw-r--r--mm/slob.c2
-rw-r--r--mm/slub.c12
-rw-r--r--mm/swapfile.c4
-rw-r--r--mm/vmscan.c8
-rw-r--r--net/9p/client.c13
-rw-r--r--net/appletalk/ddp.c1
-rw-r--r--net/dccp/proto.c4
-rw-r--r--net/ipx/af_ipx.c1
-rw-r--r--net/irda/af_irda.c1
-rw-r--r--net/irda/irnet/irnet.h1
-rw-r--r--net/irda/irnet/irnet_ppp.c1
-rw-r--r--net/sunrpc/clnt.c1
-rw-r--r--net/sunrpc/sched.c1
-rw-r--r--net/sunrpc/svc_xprt.c1
-rw-r--r--net/wanrouter/wanmain.c1
-rw-r--r--net/x25/af_x25.c1
-rw-r--r--samples/trace_events/trace-events-sample.h37
-rw-r--r--scripts/.gitignore1
-rw-r--r--scripts/dtc/.gitignore5
-rwxr-xr-xscripts/get_maintainer.pl42
-rw-r--r--scripts/kconfig/lxdialog/util.c2
-rw-r--r--scripts/kconfig/mconf.c2
-rwxr-xr-xscripts/kernel-doc4
-rw-r--r--scripts/markup_oops.pl5
-rw-r--r--scripts/package/builddeb4
-rw-r--r--scripts/pnmtologo.c4
-rwxr-xr-xscripts/recordmcount.pl12
-rw-r--r--security/integrity/ima/ima_main.c29
-rw-r--r--security/integrity/ima/ima_queue.c3
-rw-r--r--sound/aoa/core/gpio-pmf.c4
-rw-r--r--sound/arm/pxa2xx-pcm-lib.c2
-rw-r--r--sound/core/pcm_lib.c36
-rw-r--r--sound/core/seq/Makefile7
-rw-r--r--sound/isa/cmi8330.c2
-rw-r--r--sound/isa/gus/gus_pcm.c4
-rw-r--r--sound/oss/aedsp16.c9
-rw-r--r--sound/oss/kahlua.c2
-rw-r--r--sound/oss/mpu401.c18
-rw-r--r--sound/pci/atiixp.c8
-rw-r--r--sound/pci/atiixp_modem.c4
-rw-r--r--sound/pci/au88x0/au8810.c3
-rw-r--r--sound/pci/au88x0/au8820.c3
-rw-r--r--sound/pci/au88x0/au8830.c3
-rw-r--r--sound/pci/ca0106/ca0106_main.c6
-rw-r--r--sound/pci/cmipci.c10
-rw-r--r--sound/pci/cs4281.c2
-rw-r--r--sound/pci/cs46xx/cs46xx.c6
-rw-r--r--sound/pci/ctxfi/ctamixer.c14
-rw-r--r--sound/pci/ctxfi/ctdaio.c4
-rw-r--r--sound/pci/ctxfi/ctsrc.c7
-rw-r--r--sound/pci/emu10k1/emu10k1.c6
-rw-r--r--sound/pci/emu10k1/emu10k1x.c2
-rw-r--r--sound/pci/emu10k1/p16v.c2
-rw-r--r--sound/pci/ens1370.c8
-rw-r--r--sound/pci/es1938.c2
-rw-r--r--sound/pci/hda/hda_beep.c11
-rw-r--r--sound/pci/hda/hda_codec.c22
-rw-r--r--sound/pci/hda/hda_codec.h2
-rw-r--r--sound/pci/hda/hda_eld.c4
-rw-r--r--sound/pci/hda/hda_intel.c132
-rw-r--r--sound/pci/hda/patch_analog.c156
-rw-r--r--sound/pci/hda/patch_ca0110.c2
-rw-r--r--sound/pci/hda/patch_realtek.c129
-rw-r--r--sound/pci/hda/patch_sigmatel.c24
-rw-r--r--sound/pci/hda/patch_via.c89
-rw-r--r--sound/pci/ice1712/ice1712.c2
-rw-r--r--sound/pci/ice1712/ice1724.c2
-rw-r--r--sound/pci/intel8x0.c46
-rw-r--r--sound/pci/intel8x0m.c34
-rw-r--r--sound/pci/lx6464es/lx6464es.c7
-rw-r--r--sound/pci/mixart/mixart.c2
-rw-r--r--sound/pci/nm256/nm256.c6
-rw-r--r--sound/pci/oxygen/oxygen_mixer.c28
-rw-r--r--sound/pci/oxygen/virtuoso.c2
-rw-r--r--sound/pci/riptide/riptide.c7
-rw-r--r--sound/pci/rme32.c9
-rw-r--r--sound/pci/rme96.c12
-rw-r--r--sound/pci/sonicvibes.c2
-rw-r--r--sound/pci/via82xx.c4
-rw-r--r--sound/pci/via82xx_modem.c2
-rw-r--r--sound/pci/ymfpci/ymfpci.c12
-rw-r--r--sound/soc/codecs/tlv320aic3x.c11
-rw-r--r--sound/soc/codecs/wm8753.c6
-rw-r--r--sound/soc/codecs/wm8988.c4
-rw-r--r--sound/soc/fsl/Kconfig6
-rw-r--r--sound/soc/fsl/mpc5200_dma.c1
-rw-r--r--sound/soc/fsl/mpc5200_dma.h1
-rw-r--r--sound/soc/fsl/mpc5200_psc_ac97.c17
-rw-r--r--sound/soc/omap/omap-pcm.c11
-rw-r--r--sound/soc/pxa/pxa2xx-i2s.c7
-rw-r--r--sound/sound_core.c5
-rw-r--r--sound/usb/Kconfig1
-rw-r--r--sound/usb/caiaq/audio.c1
-rw-r--r--sound/usb/caiaq/device.c16
-rw-r--r--sound/usb/caiaq/device.h1
-rw-r--r--sound/usb/usbaudio.c14
-rw-r--r--sound/usb/usbmixer.c25
-rw-r--r--sound/usb/usx2y/us122l.c2
-rw-r--r--sound/usb/usx2y/usbusx2y.c2
-rw-r--r--sound/usb/usx2y/usbusx2yaudio.c7
-rw-r--r--tools/perf/CREDITS30
-rw-r--r--tools/perf/Documentation/perf-record.txt60
-rw-r--r--tools/perf/Documentation/perf-report.txt29
-rw-r--r--tools/perf/Documentation/perf-stat.txt6
-rw-r--r--tools/perf/Makefile55
-rw-r--r--tools/perf/builtin-annotate.c101
-rw-r--r--tools/perf/builtin-help.c6
-rw-r--r--tools/perf/builtin-list.c2
-rw-r--r--tools/perf/builtin-record.c143
-rw-r--r--tools/perf/builtin-report.c850
-rw-r--r--tools/perf/builtin-stat.c219
-rw-r--r--tools/perf/builtin-top.c88
-rw-r--r--tools/perf/perf.c82
-rw-r--r--tools/perf/perf.h35
-rw-r--r--tools/perf/util/alias.c2
-rw-r--r--tools/perf/util/cache.h2
-rw-r--r--tools/perf/util/callchain.c335
-rw-r--r--tools/perf/util/callchain.h54
-rw-r--r--tools/perf/util/color.c37
-rw-r--r--tools/perf/util/color.h5
-rw-r--r--tools/perf/util/config.c18
-rw-r--r--tools/perf/util/exec_cmd.c5
-rw-r--r--tools/perf/util/header.c242
-rw-r--r--tools/perf/util/header.h37
-rw-r--r--tools/perf/util/help.c41
-rw-r--r--tools/perf/util/help.h6
-rw-r--r--tools/perf/util/include/asm/system.h1
-rw-r--r--tools/perf/util/include/linux/kernel.h29
-rw-r--r--tools/perf/util/include/linux/list.h18
-rw-r--r--tools/perf/util/include/linux/module.h6
-rw-r--r--tools/perf/util/include/linux/poison.h1
-rw-r--r--tools/perf/util/include/linux/prefetch.h6
-rw-r--r--tools/perf/util/include/linux/rbtree.h1
-rw-r--r--tools/perf/util/list.h603
-rw-r--r--tools/perf/util/module.c509
-rw-r--r--tools/perf/util/module.h53
-rw-r--r--tools/perf/util/pager.c5
-rw-r--r--tools/perf/util/parse-events.c552
-rw-r--r--tools/perf/util/parse-events.h5
-rw-r--r--tools/perf/util/parse-options.c5
-rw-r--r--tools/perf/util/parse-options.h27
-rw-r--r--tools/perf/util/quote.c48
-rw-r--r--tools/perf/util/quote.h2
-rw-r--r--tools/perf/util/rbtree.c383
-rw-r--r--tools/perf/util/rbtree.h171
-rw-r--r--tools/perf/util/run-command.c95
-rw-r--r--tools/perf/util/run-command.h5
-rw-r--r--tools/perf/util/strbuf.c15
-rw-r--r--tools/perf/util/strbuf.h10
-rw-r--r--tools/perf/util/string.h5
-rw-r--r--tools/perf/util/strlist.c200
-rw-r--r--tools/perf/util/strlist.h39
-rw-r--r--tools/perf/util/symbol.c407
-rw-r--r--tools/perf/util/symbol.h15
-rw-r--r--tools/perf/util/types.h (renamed from tools/perf/types.h)0
-rw-r--r--tools/perf/util/util.h17
-rw-r--r--tools/perf/util/wrapper.c5
-rw-r--r--virt/kvm/ioapic.c10
-rw-r--r--virt/kvm/irq_comm.c4
-rw-r--r--virt/kvm/kvm_main.c5
1975 files changed, 52429 insertions, 30967 deletions
diff --git a/.gitignore b/.gitignore
index cecb3b040cc1..b93fb7eff942 100644
--- a/.gitignore
+++ b/.gitignore
@@ -27,6 +27,7 @@
27*.gz 27*.gz
28*.lzma 28*.lzma
29*.patch 29*.patch
30*.gcno
30 31
31# 32#
32# Top-level generic files 33# Top-level generic files
diff --git a/CREDITS b/CREDITS
index e76d300e9fe4..1a41bf4addd0 100644
--- a/CREDITS
+++ b/CREDITS
@@ -2006,6 +2006,9 @@ E: paul@laufernet.com
2006D: Soundblaster driver fixes, ISAPnP quirk 2006D: Soundblaster driver fixes, ISAPnP quirk
2007S: California, USA 2007S: California, USA
2008 2008
2009N: Jonathan Layes
2010D: ARPD support
2011
2009N: Tom Lees 2012N: Tom Lees
2010E: tom@lpsg.demon.co.uk 2013E: tom@lpsg.demon.co.uk
2011W: http://www.lpsg.demon.co.uk/ 2014W: http://www.lpsg.demon.co.uk/
@@ -3802,6 +3805,9 @@ S: van Bronckhorststraat 12
3802S: 2612 XV Delft 3805S: 2612 XV Delft
3803S: The Netherlands 3806S: The Netherlands
3804 3807
3808N: Thomas Woller
3809D: CS461x Cirrus Logic sound driver
3810
3805N: David Woodhouse 3811N: David Woodhouse
3806E: dwmw2@infradead.org 3812E: dwmw2@infradead.org
3807D: JFFS2 file system, Memory Technology Device subsystem, 3813D: JFFS2 file system, Memory Technology Device subsystem,
diff --git a/Documentation/ABI/testing/sysfs-block b/Documentation/ABI/testing/sysfs-block
index cbbd3e069945..5f3bedaf8e35 100644
--- a/Documentation/ABI/testing/sysfs-block
+++ b/Documentation/ABI/testing/sysfs-block
@@ -94,28 +94,37 @@ What: /sys/block/<disk>/queue/physical_block_size
94Date: May 2009 94Date: May 2009
95Contact: Martin K. Petersen <martin.petersen@oracle.com> 95Contact: Martin K. Petersen <martin.petersen@oracle.com>
96Description: 96Description:
97 This is the smallest unit the storage device can write 97 This is the smallest unit a physical storage device can
98 without resorting to read-modify-write operation. It is 98 write atomically. It is usually the same as the logical
99 usually the same as the logical block size but may be 99 block size but may be bigger. One example is SATA
100 bigger. One example is SATA drives with 4KB sectors 100 drives with 4KB sectors that expose a 512-byte logical
101 that expose a 512-byte logical block size to the 101 block size to the operating system. For stacked block
102 operating system. 102 devices the physical_block_size variable contains the
103 maximum physical_block_size of the component devices.
103 104
104What: /sys/block/<disk>/queue/minimum_io_size 105What: /sys/block/<disk>/queue/minimum_io_size
105Date: April 2009 106Date: April 2009
106Contact: Martin K. Petersen <martin.petersen@oracle.com> 107Contact: Martin K. Petersen <martin.petersen@oracle.com>
107Description: 108Description:
108 Storage devices may report a preferred minimum I/O size, 109 Storage devices may report a granularity or preferred
109 which is the smallest request the device can perform 110 minimum I/O size which is the smallest request the
110 without incurring a read-modify-write penalty. For disk 111 device can perform without incurring a performance
111 drives this is often the physical block size. For RAID 112 penalty. For disk drives this is often the physical
112 arrays it is often the stripe chunk size. 113 block size. For RAID arrays it is often the stripe
114 chunk size. A properly aligned multiple of
115 minimum_io_size is the preferred request size for
116 workloads where a high number of I/O operations is
117 desired.
113 118
114What: /sys/block/<disk>/queue/optimal_io_size 119What: /sys/block/<disk>/queue/optimal_io_size
115Date: April 2009 120Date: April 2009
116Contact: Martin K. Petersen <martin.petersen@oracle.com> 121Contact: Martin K. Petersen <martin.petersen@oracle.com>
117Description: 122Description:
118 Storage devices may report an optimal I/O size, which is 123 Storage devices may report an optimal I/O size, which is
119 the device's preferred unit of receiving I/O. This is 124 the device's preferred unit for sustained I/O. This is
120 rarely reported for disk drives. For RAID devices it is 125 rarely reported for disk drives. For RAID arrays it is
121 usually the stripe width or the internal block size. 126 usually the stripe width or the internal track size. A
127 properly aligned multiple of optimal_io_size is the
128 preferred request size for workloads where sustained
129 throughput is desired. If no optimal I/O size is
130 reported this file contains 0.
diff --git a/Documentation/arm/memory.txt b/Documentation/arm/memory.txt
index 43cb1004d35f..9d58c7c5eddd 100644
--- a/Documentation/arm/memory.txt
+++ b/Documentation/arm/memory.txt
@@ -21,6 +21,8 @@ ffff8000 ffffffff copy_user_page / clear_user_page use.
21 For SA11xx and Xscale, this is used to 21 For SA11xx and Xscale, this is used to
22 setup a minicache mapping. 22 setup a minicache mapping.
23 23
24ffff4000 ffffffff cache aliasing on ARMv6 and later CPUs.
25
24ffff1000 ffff7fff Reserved. 26ffff1000 ffff7fff Reserved.
25 Platforms must not use this address range. 27 Platforms must not use this address range.
26 28
diff --git a/Documentation/block/data-integrity.txt b/Documentation/block/data-integrity.txt
index e8ca040ba2cf..2d735b0ae383 100644
--- a/Documentation/block/data-integrity.txt
+++ b/Documentation/block/data-integrity.txt
@@ -50,7 +50,7 @@ encouraged them to allow separation of the data and integrity metadata
50scatter-gather lists. 50scatter-gather lists.
51 51
52The controller will interleave the buffers on write and split them on 52The controller will interleave the buffers on write and split them on
53read. This means that the Linux can DMA the data buffers to and from 53read. This means that Linux can DMA the data buffers to and from
54host memory without changes to the page cache. 54host memory without changes to the page cache.
55 55
56Also, the 16-bit CRC checksum mandated by both the SCSI and SATA specs 56Also, the 16-bit CRC checksum mandated by both the SCSI and SATA specs
@@ -66,7 +66,7 @@ software RAID5).
66 66
67The IP checksum is weaker than the CRC in terms of detecting bit 67The IP checksum is weaker than the CRC in terms of detecting bit
68errors. However, the strength is really in the separation of the data 68errors. However, the strength is really in the separation of the data
69buffers and the integrity metadata. These two distinct buffers much 69buffers and the integrity metadata. These two distinct buffers must
70match up for an I/O to complete. 70match up for an I/O to complete.
71 71
72The separation of the data and integrity metadata buffers as well as 72The separation of the data and integrity metadata buffers as well as
diff --git a/Documentation/cgroups/cpusets.txt b/Documentation/cgroups/cpusets.txt
index f9ca389dddf4..1d7e9784439a 100644
--- a/Documentation/cgroups/cpusets.txt
+++ b/Documentation/cgroups/cpusets.txt
@@ -777,6 +777,18 @@ in cpuset directories:
777# /bin/echo 1-4 > cpus -> set cpus list to cpus 1,2,3,4 777# /bin/echo 1-4 > cpus -> set cpus list to cpus 1,2,3,4
778# /bin/echo 1,2,3,4 > cpus -> set cpus list to cpus 1,2,3,4 778# /bin/echo 1,2,3,4 > cpus -> set cpus list to cpus 1,2,3,4
779 779
780To add a CPU to a cpuset, write the new list of CPUs including the
781CPU to be added. To add 6 to the above cpuset:
782
783# /bin/echo 1-4,6 > cpus -> set cpus list to cpus 1,2,3,4,6
784
785Similarly to remove a CPU from a cpuset, write the new list of CPUs
786without the CPU to be removed.
787
788To remove all the CPUs:
789
790# /bin/echo "" > cpus -> clear cpus list
791
7802.3 Setting flags 7922.3 Setting flags
781----------------- 793-----------------
782 794
diff --git a/Documentation/driver-model/driver.txt b/Documentation/driver-model/driver.txt
index 82132169d47a..60120fb3b961 100644
--- a/Documentation/driver-model/driver.txt
+++ b/Documentation/driver-model/driver.txt
@@ -207,8 +207,8 @@ Attributes
207~~~~~~~~~~ 207~~~~~~~~~~
208struct driver_attribute { 208struct driver_attribute {
209 struct attribute attr; 209 struct attribute attr;
210 ssize_t (*show)(struct device_driver *, char * buf, size_t count, loff_t off); 210 ssize_t (*show)(struct device_driver *driver, char *buf);
211 ssize_t (*store)(struct device_driver *, const char * buf, size_t count, loff_t off); 211 ssize_t (*store)(struct device_driver *, const char * buf, size_t count);
212}; 212};
213 213
214Device drivers can export attributes via their sysfs directories. 214Device drivers can export attributes via their sysfs directories.
diff --git a/Documentation/dvb/get_dvb_firmware b/Documentation/dvb/get_dvb_firmware
index a52adfc9a57f..3d1b0ab70c8e 100644
--- a/Documentation/dvb/get_dvb_firmware
+++ b/Documentation/dvb/get_dvb_firmware
@@ -25,7 +25,7 @@ use IO::Handle;
25 "tda10046lifeview", "av7110", "dec2000t", "dec2540t", 25 "tda10046lifeview", "av7110", "dec2000t", "dec2540t",
26 "dec3000s", "vp7041", "dibusb", "nxt2002", "nxt2004", 26 "dec3000s", "vp7041", "dibusb", "nxt2002", "nxt2004",
27 "or51211", "or51132_qam", "or51132_vsb", "bluebird", 27 "or51211", "or51132_qam", "or51132_vsb", "bluebird",
28 "opera1", "cx231xx", "cx18", "cx23885", "pvrusb2" ); 28 "opera1", "cx231xx", "cx18", "cx23885", "pvrusb2", "mpc718" );
29 29
30# Check args 30# Check args
31syntax() if (scalar(@ARGV) != 1); 31syntax() if (scalar(@ARGV) != 1);
@@ -381,6 +381,57 @@ sub cx18 {
381 $allfiles; 381 $allfiles;
382} 382}
383 383
384sub mpc718 {
385 my $archive = 'Yuan MPC718 TV Tuner Card 2.13.10.1016.zip';
386 my $url = "ftp://ftp.work.acer-euro.com/desktop/aspire_idea510/vista/Drivers/$archive";
387 my $fwfile = "dvb-cx18-mpc718-mt352.fw";
388 my $tmpdir = tempdir(DIR => "/tmp", CLEANUP => 1);
389
390 checkstandard();
391 wgetfile($archive, $url);
392 unzip($archive, $tmpdir);
393
394 my $sourcefile = "$tmpdir/Yuan MPC718 TV Tuner Card 2.13.10.1016/mpc718_32bit/yuanrap.sys";
395 my $found = 0;
396
397 open IN, '<', $sourcefile or die "Couldn't open $sourcefile to extract $fwfile data\n";
398 binmode IN;
399 open OUT, '>', $fwfile;
400 binmode OUT;
401 {
402 # Block scope because we change the line terminator variable $/
403 my $prevlen = 0;
404 my $currlen;
405
406 # Buried in the data segment are 3 runs of almost identical
407 # register-value pairs that end in 0x5d 0x01 which is a "TUNER GO"
408 # command for the MT352.
409 # Pull out the middle run (because it's easy) of register-value
410 # pairs to make the "firmware" file.
411
412 local $/ = "\x5d\x01"; # MT352 "TUNER GO"
413
414 while (<IN>) {
415 $currlen = length($_);
416 if ($prevlen == $currlen && $currlen <= 64) {
417 chop; chop; # Get rid of "TUNER GO"
418 s/^\0\0//; # get rid of leading 00 00 if it's there
419 printf OUT "$_";
420 $found = 1;
421 last;
422 }
423 $prevlen = $currlen;
424 }
425 }
426 close OUT;
427 close IN;
428 if (!$found) {
429 unlink $fwfile;
430 die "Couldn't find valid register-value sequence in $sourcefile for $fwfile\n";
431 }
432 $fwfile;
433}
434
384sub cx23885 { 435sub cx23885 {
385 my $url = "http://linuxtv.org/downloads/firmware/"; 436 my $url = "http://linuxtv.org/downloads/firmware/";
386 437
diff --git a/Documentation/feature-removal-schedule.txt b/Documentation/feature-removal-schedule.txt
index f8cd450be9aa..09e031c55887 100644
--- a/Documentation/feature-removal-schedule.txt
+++ b/Documentation/feature-removal-schedule.txt
@@ -458,3 +458,13 @@ Why: Remove the old legacy 32bit machine check code. This has been
458 but the old version has been kept around for easier testing. Note this 458 but the old version has been kept around for easier testing. Note this
459 doesn't impact the old P5 and WinChip machine check handlers. 459 doesn't impact the old P5 and WinChip machine check handlers.
460Who: Andi Kleen <andi@firstfloor.org> 460Who: Andi Kleen <andi@firstfloor.org>
461
462----------------------------
463
464What: lock_policy_rwsem_* and unlock_policy_rwsem_* will not be
465 exported interface anymore.
466When: 2.6.33
467Why: cpu_policy_rwsem has a new cleaner definition making it local to
468 cpufreq core and contained inside cpufreq.c. Other dependent
469 drivers should not use it in order to safely avoid lockdep issues.
470Who: Venkatesh Pallipadi <venkatesh.pallipadi@intel.com>
diff --git a/Documentation/filesystems/sysfs.txt b/Documentation/filesystems/sysfs.txt
index 7e81e37c0b1e..b245d524d568 100644
--- a/Documentation/filesystems/sysfs.txt
+++ b/Documentation/filesystems/sysfs.txt
@@ -23,7 +23,8 @@ interface.
23Using sysfs 23Using sysfs
24~~~~~~~~~~~ 24~~~~~~~~~~~
25 25
26sysfs is always compiled in. You can access it by doing: 26sysfs is always compiled in if CONFIG_SYSFS is defined. You can access
27it by doing:
27 28
28 mount -t sysfs sysfs /sys 29 mount -t sysfs sysfs /sys
29 30
diff --git a/Documentation/gcov.txt b/Documentation/gcov.txt
index e716aadb3a33..40ec63352760 100644
--- a/Documentation/gcov.txt
+++ b/Documentation/gcov.txt
@@ -188,13 +188,18 @@ Solution: Exclude affected source files from profiling by specifying
188 GCOV_PROFILE := n or GCOV_PROFILE_basename.o := n in the 188 GCOV_PROFILE := n or GCOV_PROFILE_basename.o := n in the
189 corresponding Makefile. 189 corresponding Makefile.
190 190
191Problem: Files copied from sysfs appear empty or incomplete.
192Cause: Due to the way seq_file works, some tools such as cp or tar
193 may not correctly copy files from sysfs.
194Solution: Use 'cat' to read .gcda files and 'cp -d' to copy links.
195 Alternatively use the mechanism shown in Appendix B.
196
191 197
192Appendix A: gather_on_build.sh 198Appendix A: gather_on_build.sh
193============================== 199==============================
194 200
195Sample script to gather coverage meta files on the build machine 201Sample script to gather coverage meta files on the build machine
196(see 6a): 202(see 6a):
197
198#!/bin/bash 203#!/bin/bash
199 204
200KSRC=$1 205KSRC=$1
@@ -226,7 +231,7 @@ Appendix B: gather_on_test.sh
226Sample script to gather coverage data files on the test machine 231Sample script to gather coverage data files on the test machine
227(see 6b): 232(see 6b):
228 233
229#!/bin/bash 234#!/bin/bash -e
230 235
231DEST=$1 236DEST=$1
232GCDA=/sys/kernel/debug/gcov 237GCDA=/sys/kernel/debug/gcov
@@ -236,11 +241,13 @@ if [ -z "$DEST" ] ; then
236 exit 1 241 exit 1
237fi 242fi
238 243
239find $GCDA -name '*.gcno' -o -name '*.gcda' | tar cfz $DEST -T - 244TEMPDIR=$(mktemp -d)
245echo Collecting data..
246find $GCDA -type d -exec mkdir -p $TEMPDIR/\{\} \;
247find $GCDA -name '*.gcda' -exec sh -c 'cat < $0 > '$TEMPDIR'/$0' {} \;
248find $GCDA -name '*.gcno' -exec sh -c 'cp -d $0 '$TEMPDIR'/$0' {} \;
249tar czf $DEST -C $TEMPDIR sys
250rm -rf $TEMPDIR
240 251
241if [ $? -eq 0 ] ; then 252echo "$DEST successfully created, copy to build system and unpack with:"
242 echo "$DEST successfully created, copy to build system and unpack with:" 253echo " tar xfz $DEST"
243 echo " tar xfz $DEST"
244else
245 echo "Could not create file $DEST"
246fi
diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt
index d08759aa0903..dd1a6d4bb747 100644
--- a/Documentation/kernel-parameters.txt
+++ b/Documentation/kernel-parameters.txt
@@ -1720,8 +1720,8 @@ and is between 256 and 4096 characters. It is defined in the file
1720 oprofile.cpu_type= Force an oprofile cpu type 1720 oprofile.cpu_type= Force an oprofile cpu type
1721 This might be useful if you have an older oprofile 1721 This might be useful if you have an older oprofile
1722 userland or if you want common events. 1722 userland or if you want common events.
1723 Format: { archperfmon } 1723 Format: { arch_perfmon }
1724 archperfmon: [X86] Force use of architectural 1724 arch_perfmon: [X86] Force use of architectural
1725 perfmon on Intel CPUs instead of the 1725 perfmon on Intel CPUs instead of the
1726 CPU specific event set. 1726 CPU specific event set.
1727 1727
@@ -1915,6 +1915,12 @@ and is between 256 and 4096 characters. It is defined in the file
1915 Format: { 0 | 1 } 1915 Format: { 0 | 1 }
1916 See arch/parisc/kernel/pdc_chassis.c 1916 See arch/parisc/kernel/pdc_chassis.c
1917 1917
1918 percpu_alloc= [X86] Select which percpu first chunk allocator to use.
1919 Allowed values are one of "lpage", "embed" and "4k".
1920 See comments in arch/x86/kernel/setup_percpu.c for
1921 details on each allocator. This parameter is primarily
1922 for debugging and performance comparison.
1923
1918 pf. [PARIDE] 1924 pf. [PARIDE]
1919 See Documentation/blockdev/paride.txt. 1925 See Documentation/blockdev/paride.txt.
1920 1926
@@ -2467,7 +2473,8 @@ and is between 256 and 4096 characters. It is defined in the file
2467 2473
2468 tp720= [HW,PS2] 2474 tp720= [HW,PS2]
2469 2475
2470 trace_buf_size=nn[KMG] [ftrace] will set tracing buffer size. 2476 trace_buf_size=nn[KMG]
2477 [FTRACE] will set tracing buffer size.
2471 2478
2472 trix= [HW,OSS] MediaTrix AudioTrix Pro 2479 trix= [HW,OSS] MediaTrix AudioTrix Pro
2473 Format: 2480 Format:
diff --git a/Documentation/kmemleak.txt b/Documentation/kmemleak.txt
index 0112da3b9ab8..89068030b01b 100644
--- a/Documentation/kmemleak.txt
+++ b/Documentation/kmemleak.txt
@@ -16,13 +16,17 @@ Usage
16----- 16-----
17 17
18CONFIG_DEBUG_KMEMLEAK in "Kernel hacking" has to be enabled. A kernel 18CONFIG_DEBUG_KMEMLEAK in "Kernel hacking" has to be enabled. A kernel
19thread scans the memory every 10 minutes (by default) and prints any new 19thread scans the memory every 10 minutes (by default) and prints the
20unreferenced objects found. To trigger an intermediate scan and display 20number of new unreferenced objects found. To display the details of all
21all the possible memory leaks: 21the possible memory leaks:
22 22
23 # mount -t debugfs nodev /sys/kernel/debug/ 23 # mount -t debugfs nodev /sys/kernel/debug/
24 # cat /sys/kernel/debug/kmemleak 24 # cat /sys/kernel/debug/kmemleak
25 25
26To trigger an intermediate memory scan:
27
28 # echo scan > /sys/kernel/debug/kmemleak
29
26Note that the orphan objects are listed in the order they were allocated 30Note that the orphan objects are listed in the order they were allocated
27and one object at the beginning of the list may cause other subsequent 31and one object at the beginning of the list may cause other subsequent
28objects to be reported as orphan. 32objects to be reported as orphan.
@@ -31,16 +35,21 @@ Memory scanning parameters can be modified at run-time by writing to the
31/sys/kernel/debug/kmemleak file. The following parameters are supported: 35/sys/kernel/debug/kmemleak file. The following parameters are supported:
32 36
33 off - disable kmemleak (irreversible) 37 off - disable kmemleak (irreversible)
34 stack=on - enable the task stacks scanning 38 stack=on - enable the task stacks scanning (default)
35 stack=off - disable the tasks stacks scanning 39 stack=off - disable the tasks stacks scanning
36 scan=on - start the automatic memory scanning thread 40 scan=on - start the automatic memory scanning thread (default)
37 scan=off - stop the automatic memory scanning thread 41 scan=off - stop the automatic memory scanning thread
38 scan=<secs> - set the automatic memory scanning period in seconds (0 42 scan=<secs> - set the automatic memory scanning period in seconds
39 to disable it) 43 (default 600, 0 to stop the automatic scanning)
44 scan - trigger a memory scan
40 45
41Kmemleak can also be disabled at boot-time by passing "kmemleak=off" on 46Kmemleak can also be disabled at boot-time by passing "kmemleak=off" on
42the kernel command line. 47the kernel command line.
43 48
49Memory may be allocated or freed before kmemleak is initialised and
50these actions are stored in an early log buffer. The size of this buffer
51is configured via the CONFIG_DEBUG_KMEMLEAK_EARLY_LOG_SIZE option.
52
44Basic Algorithm 53Basic Algorithm
45--------------- 54---------------
46 55
diff --git a/Documentation/laptops/thinkpad-acpi.txt b/Documentation/laptops/thinkpad-acpi.txt
index f2296ecedb89..e2ddcdeb61b6 100644
--- a/Documentation/laptops/thinkpad-acpi.txt
+++ b/Documentation/laptops/thinkpad-acpi.txt
@@ -36,8 +36,6 @@ detailed description):
36 - Bluetooth enable and disable 36 - Bluetooth enable and disable
37 - video output switching, expansion control 37 - video output switching, expansion control
38 - ThinkLight on and off 38 - ThinkLight on and off
39 - limited docking and undocking
40 - UltraBay eject
41 - CMOS/UCMS control 39 - CMOS/UCMS control
42 - LED control 40 - LED control
43 - ACPI sounds 41 - ACPI sounds
@@ -729,131 +727,6 @@ cannot be read or if it is unknown, thinkpad-acpi will report it as "off".
729It is impossible to know if the status returned through sysfs is valid. 727It is impossible to know if the status returned through sysfs is valid.
730 728
731 729
732Docking / undocking -- /proc/acpi/ibm/dock
733------------------------------------------
734
735Docking and undocking (e.g. with the X4 UltraBase) requires some
736actions to be taken by the operating system to safely make or break
737the electrical connections with the dock.
738
739The docking feature of this driver generates the following ACPI events:
740
741 ibm/dock GDCK 00000003 00000001 -- eject request
742 ibm/dock GDCK 00000003 00000002 -- undocked
743 ibm/dock GDCK 00000000 00000003 -- docked
744
745NOTE: These events will only be generated if the laptop was docked
746when originally booted. This is due to the current lack of support for
747hot plugging of devices in the Linux ACPI framework. If the laptop was
748booted while not in the dock, the following message is shown in the
749logs:
750
751 Mar 17 01:42:34 aero kernel: thinkpad_acpi: dock device not present
752
753In this case, no dock-related events are generated but the dock and
754undock commands described below still work. They can be executed
755manually or triggered by Fn key combinations (see the example acpid
756configuration files included in the driver tarball package available
757on the web site).
758
759When the eject request button on the dock is pressed, the first event
760above is generated. The handler for this event should issue the
761following command:
762
763 echo undock > /proc/acpi/ibm/dock
764
765After the LED on the dock goes off, it is safe to eject the laptop.
766Note: if you pressed this key by mistake, go ahead and eject the
767laptop, then dock it back in. Otherwise, the dock may not function as
768expected.
769
770When the laptop is docked, the third event above is generated. The
771handler for this event should issue the following command to fully
772enable the dock:
773
774 echo dock > /proc/acpi/ibm/dock
775
776The contents of the /proc/acpi/ibm/dock file shows the current status
777of the dock, as provided by the ACPI framework.
778
779The docking support in this driver does not take care of enabling or
780disabling any other devices you may have attached to the dock. For
781example, a CD drive plugged into the UltraBase needs to be disabled or
782enabled separately. See the provided example acpid configuration files
783for how this can be accomplished.
784
785There is no support yet for PCI devices that may be attached to a
786docking station, e.g. in the ThinkPad Dock II. The driver currently
787does not recognize, enable or disable such devices. This means that
788the only docking stations currently supported are the X-series
789UltraBase docks and "dumb" port replicators like the Mini Dock (the
790latter don't need any ACPI support, actually).
791
792
793UltraBay eject -- /proc/acpi/ibm/bay
794------------------------------------
795
796Inserting or ejecting an UltraBay device requires some actions to be
797taken by the operating system to safely make or break the electrical
798connections with the device.
799
800This feature generates the following ACPI events:
801
802 ibm/bay MSTR 00000003 00000000 -- eject request
803 ibm/bay MSTR 00000001 00000000 -- eject lever inserted
804
805NOTE: These events will only be generated if the UltraBay was present
806when the laptop was originally booted (on the X series, the UltraBay
807is in the dock, so it may not be present if the laptop was undocked).
808This is due to the current lack of support for hot plugging of devices
809in the Linux ACPI framework. If the laptop was booted without the
810UltraBay, the following message is shown in the logs:
811
812 Mar 17 01:42:34 aero kernel: thinkpad_acpi: bay device not present
813
814In this case, no bay-related events are generated but the eject
815command described below still works. It can be executed manually or
816triggered by a hot key combination.
817
818Sliding the eject lever generates the first event shown above. The
819handler for this event should take whatever actions are necessary to
820shut down the device in the UltraBay (e.g. call idectl), then issue
821the following command:
822
823 echo eject > /proc/acpi/ibm/bay
824
825After the LED on the UltraBay goes off, it is safe to pull out the
826device.
827
828When the eject lever is inserted, the second event above is
829generated. The handler for this event should take whatever actions are
830necessary to enable the UltraBay device (e.g. call idectl).
831
832The contents of the /proc/acpi/ibm/bay file shows the current status
833of the UltraBay, as provided by the ACPI framework.
834
835EXPERIMENTAL warm eject support on the 600e/x, A22p and A3x (To use
836this feature, you need to supply the experimental=1 parameter when
837loading the module):
838
839These models do not have a button near the UltraBay device to request
840a hot eject but rather require the laptop to be put to sleep
841(suspend-to-ram) before the bay device is ejected or inserted).
842The sequence of steps to eject the device is as follows:
843
844 echo eject > /proc/acpi/ibm/bay
845 put the ThinkPad to sleep
846 remove the drive
847 resume from sleep
848 cat /proc/acpi/ibm/bay should show that the drive was removed
849
850On the A3x, both the UltraBay 2000 and UltraBay Plus devices are
851supported. Use "eject2" instead of "eject" for the second bay.
852
853Note: the UltraBay eject support on the 600e/x, A22p and A3x is
854EXPERIMENTAL and may not work as expected. USE WITH CAUTION!
855
856
857CMOS/UCMS control 730CMOS/UCMS control
858----------------- 731-----------------
859 732
diff --git a/Documentation/leds-lp3944.txt b/Documentation/leds-lp3944.txt
new file mode 100644
index 000000000000..c6eda18b15ef
--- /dev/null
+++ b/Documentation/leds-lp3944.txt
@@ -0,0 +1,50 @@
1Kernel driver lp3944
2====================
3
4 * National Semiconductor LP3944 Fun-light Chip
5 Prefix: 'lp3944'
6 Addresses scanned: None (see the Notes section below)
7 Datasheet: Publicly available at the National Semiconductor website
8 http://www.national.com/pf/LP/LP3944.html
9
10Authors:
11 Antonio Ospite <ospite@studenti.unina.it>
12
13
14Description
15-----------
16The LP3944 is a helper chip that can drive up to 8 leds, with two programmable
17DIM modes; it could even be used as a gpio expander but this driver assumes it
18is used as a led controller.
19
20The DIM modes are used to set _blink_ patterns for leds, the pattern is
21specified supplying two parameters:
22 - period: from 0s to 1.6s
23 - duty cycle: percentage of the period the led is on, from 0 to 100
24
25Setting a led in DIM0 or DIM1 mode makes it blink according to the pattern.
26See the datasheet for details.
27
28LP3944 can be found on Motorola A910 smartphone, where it drives the rgb
29leds, the camera flash light and the lcds power.
30
31
32Notes
33-----
34The chip is used mainly in embedded contexts, so this driver expects it is
35registered using the i2c_board_info mechanism.
36
37To register the chip at address 0x60 on adapter 0, set the platform data
38according to include/linux/leds-lp3944.h, set the i2c board info:
39
40 static struct i2c_board_info __initdata a910_i2c_board_info[] = {
41 {
42 I2C_BOARD_INFO("lp3944", 0x60),
43 .platform_data = &a910_lp3944_leds,
44 },
45 };
46
47and register it in the platform init function
48
49 i2c_register_board_info(0, a910_i2c_board_info,
50 ARRAY_SIZE(a910_i2c_board_info));
diff --git a/Documentation/lguest/lguest.c b/Documentation/lguest/lguest.c
index 9ebcd6ef361b..950cde6d6e58 100644
--- a/Documentation/lguest/lguest.c
+++ b/Documentation/lguest/lguest.c
@@ -1,7 +1,9 @@
1/*P:100 This is the Launcher code, a simple program which lays out the 1/*P:100
2 * "physical" memory for the new Guest by mapping the kernel image and 2 * This is the Launcher code, a simple program which lays out the "physical"
3 * the virtual devices, then opens /dev/lguest to tell the kernel 3 * memory for the new Guest by mapping the kernel image and the virtual
4 * about the Guest and control it. :*/ 4 * devices, then opens /dev/lguest to tell the kernel about the Guest and
5 * control it.
6:*/
5#define _LARGEFILE64_SOURCE 7#define _LARGEFILE64_SOURCE
6#define _GNU_SOURCE 8#define _GNU_SOURCE
7#include <stdio.h> 9#include <stdio.h>
@@ -46,13 +48,15 @@
46#include "linux/virtio_rng.h" 48#include "linux/virtio_rng.h"
47#include "linux/virtio_ring.h" 49#include "linux/virtio_ring.h"
48#include "asm/bootparam.h" 50#include "asm/bootparam.h"
49/*L:110 We can ignore the 39 include files we need for this program, but I do 51/*L:110
50 * want to draw attention to the use of kernel-style types. 52 * We can ignore the 42 include files we need for this program, but I do want
53 * to draw attention to the use of kernel-style types.
51 * 54 *
52 * As Linus said, "C is a Spartan language, and so should your naming be." I 55 * As Linus said, "C is a Spartan language, and so should your naming be." I
53 * like these abbreviations, so we define them here. Note that u64 is always 56 * like these abbreviations, so we define them here. Note that u64 is always
54 * unsigned long long, which works on all Linux systems: this means that we can 57 * unsigned long long, which works on all Linux systems: this means that we can
55 * use %llu in printf for any u64. */ 58 * use %llu in printf for any u64.
59 */
56typedef unsigned long long u64; 60typedef unsigned long long u64;
57typedef uint32_t u32; 61typedef uint32_t u32;
58typedef uint16_t u16; 62typedef uint16_t u16;
@@ -69,8 +73,10 @@ typedef uint8_t u8;
69/* This will occupy 3 pages: it must be a power of 2. */ 73/* This will occupy 3 pages: it must be a power of 2. */
70#define VIRTQUEUE_NUM 256 74#define VIRTQUEUE_NUM 256
71 75
72/*L:120 verbose is both a global flag and a macro. The C preprocessor allows 76/*L:120
73 * this, and although I wouldn't recommend it, it works quite nicely here. */ 77 * verbose is both a global flag and a macro. The C preprocessor allows
78 * this, and although I wouldn't recommend it, it works quite nicely here.
79 */
74static bool verbose; 80static bool verbose;
75#define verbose(args...) \ 81#define verbose(args...) \
76 do { if (verbose) printf(args); } while(0) 82 do { if (verbose) printf(args); } while(0)
@@ -87,8 +93,7 @@ static int lguest_fd;
87static unsigned int __thread cpu_id; 93static unsigned int __thread cpu_id;
88 94
89/* This is our list of devices. */ 95/* This is our list of devices. */
90struct device_list 96struct device_list {
91{
92 /* Counter to assign interrupt numbers. */ 97 /* Counter to assign interrupt numbers. */
93 unsigned int next_irq; 98 unsigned int next_irq;
94 99
@@ -100,8 +105,7 @@ struct device_list
100 105
101 /* A single linked list of devices. */ 106 /* A single linked list of devices. */
102 struct device *dev; 107 struct device *dev;
103 /* And a pointer to the last device for easy append and also for 108 /* And a pointer to the last device for easy append. */
104 * configuration appending. */
105 struct device *lastdev; 109 struct device *lastdev;
106}; 110};
107 111
@@ -109,8 +113,7 @@ struct device_list
109static struct device_list devices; 113static struct device_list devices;
110 114
111/* The device structure describes a single device. */ 115/* The device structure describes a single device. */
112struct device 116struct device {
113{
114 /* The linked-list pointer. */ 117 /* The linked-list pointer. */
115 struct device *next; 118 struct device *next;
116 119
@@ -135,8 +138,7 @@ struct device
135}; 138};
136 139
137/* The virtqueue structure describes a queue attached to a device. */ 140/* The virtqueue structure describes a queue attached to a device. */
138struct virtqueue 141struct virtqueue {
139{
140 struct virtqueue *next; 142 struct virtqueue *next;
141 143
142 /* Which device owns me. */ 144 /* Which device owns me. */
@@ -168,20 +170,24 @@ static char **main_args;
168/* The original tty settings to restore on exit. */ 170/* The original tty settings to restore on exit. */
169static struct termios orig_term; 171static struct termios orig_term;
170 172
171/* We have to be careful with barriers: our devices are all run in separate 173/*
174 * We have to be careful with barriers: our devices are all run in separate
172 * threads and so we need to make sure that changes visible to the Guest happen 175 * threads and so we need to make sure that changes visible to the Guest happen
173 * in precise order. */ 176 * in precise order.
177 */
174#define wmb() __asm__ __volatile__("" : : : "memory") 178#define wmb() __asm__ __volatile__("" : : : "memory")
175#define mb() __asm__ __volatile__("" : : : "memory") 179#define mb() __asm__ __volatile__("" : : : "memory")
176 180
177/* Convert an iovec element to the given type. 181/*
182 * Convert an iovec element to the given type.
178 * 183 *
179 * This is a fairly ugly trick: we need to know the size of the type and 184 * This is a fairly ugly trick: we need to know the size of the type and
180 * alignment requirement to check the pointer is kosher. It's also nice to 185 * alignment requirement to check the pointer is kosher. It's also nice to
181 * have the name of the type in case we report failure. 186 * have the name of the type in case we report failure.
182 * 187 *
183 * Typing those three things all the time is cumbersome and error prone, so we 188 * Typing those three things all the time is cumbersome and error prone, so we
184 * have a macro which sets them all up and passes to the real function. */ 189 * have a macro which sets them all up and passes to the real function.
190 */
185#define convert(iov, type) \ 191#define convert(iov, type) \
186 ((type *)_convert((iov), sizeof(type), __alignof__(type), #type)) 192 ((type *)_convert((iov), sizeof(type), __alignof__(type), #type))
187 193
@@ -198,8 +204,10 @@ static void *_convert(struct iovec *iov, size_t size, size_t align,
198/* Wrapper for the last available index. Makes it easier to change. */ 204/* Wrapper for the last available index. Makes it easier to change. */
199#define lg_last_avail(vq) ((vq)->last_avail_idx) 205#define lg_last_avail(vq) ((vq)->last_avail_idx)
200 206
201/* The virtio configuration space is defined to be little-endian. x86 is 207/*
202 * little-endian too, but it's nice to be explicit so we have these helpers. */ 208 * The virtio configuration space is defined to be little-endian. x86 is
209 * little-endian too, but it's nice to be explicit so we have these helpers.
210 */
203#define cpu_to_le16(v16) (v16) 211#define cpu_to_le16(v16) (v16)
204#define cpu_to_le32(v32) (v32) 212#define cpu_to_le32(v32) (v32)
205#define cpu_to_le64(v64) (v64) 213#define cpu_to_le64(v64) (v64)
@@ -241,11 +249,12 @@ static u8 *get_feature_bits(struct device *dev)
241 + dev->num_vq * sizeof(struct lguest_vqconfig); 249 + dev->num_vq * sizeof(struct lguest_vqconfig);
242} 250}
243 251
244/*L:100 The Launcher code itself takes us out into userspace, that scary place 252/*L:100
245 * where pointers run wild and free! Unfortunately, like most userspace 253 * The Launcher code itself takes us out into userspace, that scary place where
246 * programs, it's quite boring (which is why everyone likes to hack on the 254 * pointers run wild and free! Unfortunately, like most userspace programs,
247 * kernel!). Perhaps if you make up an Lguest Drinking Game at this point, it 255 * it's quite boring (which is why everyone likes to hack on the kernel!).
248 * will get you through this section. Or, maybe not. 256 * Perhaps if you make up an Lguest Drinking Game at this point, it will get
257 * you through this section. Or, maybe not.
249 * 258 *
250 * The Launcher sets up a big chunk of memory to be the Guest's "physical" 259 * The Launcher sets up a big chunk of memory to be the Guest's "physical"
251 * memory and stores it in "guest_base". In other words, Guest physical == 260 * memory and stores it in "guest_base". In other words, Guest physical ==
@@ -253,7 +262,8 @@ static u8 *get_feature_bits(struct device *dev)
253 * 262 *
254 * This can be tough to get your head around, but usually it just means that we 263 * This can be tough to get your head around, but usually it just means that we
255 * use these trivial conversion functions when the Guest gives us it's 264 * use these trivial conversion functions when the Guest gives us it's
256 * "physical" addresses: */ 265 * "physical" addresses:
266 */
257static void *from_guest_phys(unsigned long addr) 267static void *from_guest_phys(unsigned long addr)
258{ 268{
259 return guest_base + addr; 269 return guest_base + addr;
@@ -268,7 +278,8 @@ static unsigned long to_guest_phys(const void *addr)
268 * Loading the Kernel. 278 * Loading the Kernel.
269 * 279 *
270 * We start with couple of simple helper routines. open_or_die() avoids 280 * We start with couple of simple helper routines. open_or_die() avoids
271 * error-checking code cluttering the callers: */ 281 * error-checking code cluttering the callers:
282 */
272static int open_or_die(const char *name, int flags) 283static int open_or_die(const char *name, int flags)
273{ 284{
274 int fd = open(name, flags); 285 int fd = open(name, flags);
@@ -283,12 +294,19 @@ static void *map_zeroed_pages(unsigned int num)
283 int fd = open_or_die("/dev/zero", O_RDONLY); 294 int fd = open_or_die("/dev/zero", O_RDONLY);
284 void *addr; 295 void *addr;
285 296
286 /* We use a private mapping (ie. if we write to the page, it will be 297 /*
287 * copied). */ 298 * We use a private mapping (ie. if we write to the page, it will be
299 * copied).
300 */
288 addr = mmap(NULL, getpagesize() * num, 301 addr = mmap(NULL, getpagesize() * num,
289 PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE, fd, 0); 302 PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE, fd, 0);
290 if (addr == MAP_FAILED) 303 if (addr == MAP_FAILED)
291 err(1, "Mmaping %u pages of /dev/zero", num); 304 err(1, "Mmaping %u pages of /dev/zero", num);
305
306 /*
307 * One neat mmap feature is that you can close the fd, and it
308 * stays mapped.
309 */
292 close(fd); 310 close(fd);
293 311
294 return addr; 312 return addr;
@@ -305,20 +323,24 @@ static void *get_pages(unsigned int num)
305 return addr; 323 return addr;
306} 324}
307 325
308/* This routine is used to load the kernel or initrd. It tries mmap, but if 326/*
327 * This routine is used to load the kernel or initrd. It tries mmap, but if
309 * that fails (Plan 9's kernel file isn't nicely aligned on page boundaries), 328 * that fails (Plan 9's kernel file isn't nicely aligned on page boundaries),
310 * it falls back to reading the memory in. */ 329 * it falls back to reading the memory in.
330 */
311static void map_at(int fd, void *addr, unsigned long offset, unsigned long len) 331static void map_at(int fd, void *addr, unsigned long offset, unsigned long len)
312{ 332{
313 ssize_t r; 333 ssize_t r;
314 334
315 /* We map writable even though for some segments are marked read-only. 335 /*
336 * We map writable even though for some segments are marked read-only.
316 * The kernel really wants to be writable: it patches its own 337 * The kernel really wants to be writable: it patches its own
317 * instructions. 338 * instructions.
318 * 339 *
319 * MAP_PRIVATE means that the page won't be copied until a write is 340 * MAP_PRIVATE means that the page won't be copied until a write is
320 * done to it. This allows us to share untouched memory between 341 * done to it. This allows us to share untouched memory between
321 * Guests. */ 342 * Guests.
343 */
322 if (mmap(addr, len, PROT_READ|PROT_WRITE|PROT_EXEC, 344 if (mmap(addr, len, PROT_READ|PROT_WRITE|PROT_EXEC,
323 MAP_FIXED|MAP_PRIVATE, fd, offset) != MAP_FAILED) 345 MAP_FIXED|MAP_PRIVATE, fd, offset) != MAP_FAILED)
324 return; 346 return;
@@ -329,7 +351,8 @@ static void map_at(int fd, void *addr, unsigned long offset, unsigned long len)
329 err(1, "Reading offset %lu len %lu gave %zi", offset, len, r); 351 err(1, "Reading offset %lu len %lu gave %zi", offset, len, r);
330} 352}
331 353
332/* This routine takes an open vmlinux image, which is in ELF, and maps it into 354/*
355 * This routine takes an open vmlinux image, which is in ELF, and maps it into
333 * the Guest memory. ELF = Embedded Linking Format, which is the format used 356 * the Guest memory. ELF = Embedded Linking Format, which is the format used
334 * by all modern binaries on Linux including the kernel. 357 * by all modern binaries on Linux including the kernel.
335 * 358 *
@@ -337,23 +360,28 @@ static void map_at(int fd, void *addr, unsigned long offset, unsigned long len)
337 * address. We use the physical address; the Guest will map itself to the 360 * address. We use the physical address; the Guest will map itself to the
338 * virtual address. 361 * virtual address.
339 * 362 *
340 * We return the starting address. */ 363 * We return the starting address.
364 */
341static unsigned long map_elf(int elf_fd, const Elf32_Ehdr *ehdr) 365static unsigned long map_elf(int elf_fd, const Elf32_Ehdr *ehdr)
342{ 366{
343 Elf32_Phdr phdr[ehdr->e_phnum]; 367 Elf32_Phdr phdr[ehdr->e_phnum];
344 unsigned int i; 368 unsigned int i;
345 369
346 /* Sanity checks on the main ELF header: an x86 executable with a 370 /*
347 * reasonable number of correctly-sized program headers. */ 371 * Sanity checks on the main ELF header: an x86 executable with a
372 * reasonable number of correctly-sized program headers.
373 */
348 if (ehdr->e_type != ET_EXEC 374 if (ehdr->e_type != ET_EXEC
349 || ehdr->e_machine != EM_386 375 || ehdr->e_machine != EM_386
350 || ehdr->e_phentsize != sizeof(Elf32_Phdr) 376 || ehdr->e_phentsize != sizeof(Elf32_Phdr)
351 || ehdr->e_phnum < 1 || ehdr->e_phnum > 65536U/sizeof(Elf32_Phdr)) 377 || ehdr->e_phnum < 1 || ehdr->e_phnum > 65536U/sizeof(Elf32_Phdr))
352 errx(1, "Malformed elf header"); 378 errx(1, "Malformed elf header");
353 379
354 /* An ELF executable contains an ELF header and a number of "program" 380 /*
381 * An ELF executable contains an ELF header and a number of "program"
355 * headers which indicate which parts ("segments") of the program to 382 * headers which indicate which parts ("segments") of the program to
356 * load where. */ 383 * load where.
384 */
357 385
358 /* We read in all the program headers at once: */ 386 /* We read in all the program headers at once: */
359 if (lseek(elf_fd, ehdr->e_phoff, SEEK_SET) < 0) 387 if (lseek(elf_fd, ehdr->e_phoff, SEEK_SET) < 0)
@@ -361,8 +389,10 @@ static unsigned long map_elf(int elf_fd, const Elf32_Ehdr *ehdr)
361 if (read(elf_fd, phdr, sizeof(phdr)) != sizeof(phdr)) 389 if (read(elf_fd, phdr, sizeof(phdr)) != sizeof(phdr))
362 err(1, "Reading program headers"); 390 err(1, "Reading program headers");
363 391
364 /* Try all the headers: there are usually only three. A read-only one, 392 /*
365 * a read-write one, and a "note" section which we don't load. */ 393 * Try all the headers: there are usually only three. A read-only one,
394 * a read-write one, and a "note" section which we don't load.
395 */
366 for (i = 0; i < ehdr->e_phnum; i++) { 396 for (i = 0; i < ehdr->e_phnum; i++) {
367 /* If this isn't a loadable segment, we ignore it */ 397 /* If this isn't a loadable segment, we ignore it */
368 if (phdr[i].p_type != PT_LOAD) 398 if (phdr[i].p_type != PT_LOAD)
@@ -380,13 +410,15 @@ static unsigned long map_elf(int elf_fd, const Elf32_Ehdr *ehdr)
380 return ehdr->e_entry; 410 return ehdr->e_entry;
381} 411}
382 412
383/*L:150 A bzImage, unlike an ELF file, is not meant to be loaded. You're 413/*L:150
384 * supposed to jump into it and it will unpack itself. We used to have to 414 * A bzImage, unlike an ELF file, is not meant to be loaded. You're supposed
385 * perform some hairy magic because the unpacking code scared me. 415 * to jump into it and it will unpack itself. We used to have to perform some
416 * hairy magic because the unpacking code scared me.
386 * 417 *
387 * Fortunately, Jeremy Fitzhardinge convinced me it wasn't that hard and wrote 418 * Fortunately, Jeremy Fitzhardinge convinced me it wasn't that hard and wrote
388 * a small patch to jump over the tricky bits in the Guest, so now we just read 419 * a small patch to jump over the tricky bits in the Guest, so now we just read
389 * the funky header so we know where in the file to load, and away we go! */ 420 * the funky header so we know where in the file to load, and away we go!
421 */
390static unsigned long load_bzimage(int fd) 422static unsigned long load_bzimage(int fd)
391{ 423{
392 struct boot_params boot; 424 struct boot_params boot;
@@ -394,8 +426,10 @@ static unsigned long load_bzimage(int fd)
394 /* Modern bzImages get loaded at 1M. */ 426 /* Modern bzImages get loaded at 1M. */
395 void *p = from_guest_phys(0x100000); 427 void *p = from_guest_phys(0x100000);
396 428
397 /* Go back to the start of the file and read the header. It should be 429 /*
398 * a Linux boot header (see Documentation/x86/i386/boot.txt) */ 430 * Go back to the start of the file and read the header. It should be
431 * a Linux boot header (see Documentation/x86/i386/boot.txt)
432 */
399 lseek(fd, 0, SEEK_SET); 433 lseek(fd, 0, SEEK_SET);
400 read(fd, &boot, sizeof(boot)); 434 read(fd, &boot, sizeof(boot));
401 435
@@ -414,9 +448,11 @@ static unsigned long load_bzimage(int fd)
414 return boot.hdr.code32_start; 448 return boot.hdr.code32_start;
415} 449}
416 450
417/*L:140 Loading the kernel is easy when it's a "vmlinux", but most kernels 451/*L:140
452 * Loading the kernel is easy when it's a "vmlinux", but most kernels
418 * come wrapped up in the self-decompressing "bzImage" format. With a little 453 * come wrapped up in the self-decompressing "bzImage" format. With a little
419 * work, we can load those, too. */ 454 * work, we can load those, too.
455 */
420static unsigned long load_kernel(int fd) 456static unsigned long load_kernel(int fd)
421{ 457{
422 Elf32_Ehdr hdr; 458 Elf32_Ehdr hdr;
@@ -433,24 +469,28 @@ static unsigned long load_kernel(int fd)
433 return load_bzimage(fd); 469 return load_bzimage(fd);
434} 470}
435 471
436/* This is a trivial little helper to align pages. Andi Kleen hated it because 472/*
473 * This is a trivial little helper to align pages. Andi Kleen hated it because
437 * it calls getpagesize() twice: "it's dumb code." 474 * it calls getpagesize() twice: "it's dumb code."
438 * 475 *
439 * Kernel guys get really het up about optimization, even when it's not 476 * Kernel guys get really het up about optimization, even when it's not
440 * necessary. I leave this code as a reaction against that. */ 477 * necessary. I leave this code as a reaction against that.
478 */
441static inline unsigned long page_align(unsigned long addr) 479static inline unsigned long page_align(unsigned long addr)
442{ 480{
443 /* Add upwards and truncate downwards. */ 481 /* Add upwards and truncate downwards. */
444 return ((addr + getpagesize()-1) & ~(getpagesize()-1)); 482 return ((addr + getpagesize()-1) & ~(getpagesize()-1));
445} 483}
446 484
447/*L:180 An "initial ram disk" is a disk image loaded into memory along with 485/*L:180
448 * the kernel which the kernel can use to boot from without needing any 486 * An "initial ram disk" is a disk image loaded into memory along with the
449 * drivers. Most distributions now use this as standard: the initrd contains 487 * kernel which the kernel can use to boot from without needing any drivers.
450 * the code to load the appropriate driver modules for the current machine. 488 * Most distributions now use this as standard: the initrd contains the code to
489 * load the appropriate driver modules for the current machine.
451 * 490 *
452 * Importantly, James Morris works for RedHat, and Fedora uses initrds for its 491 * Importantly, James Morris works for RedHat, and Fedora uses initrds for its
453 * kernels. He sent me this (and tells me when I break it). */ 492 * kernels. He sent me this (and tells me when I break it).
493 */
454static unsigned long load_initrd(const char *name, unsigned long mem) 494static unsigned long load_initrd(const char *name, unsigned long mem)
455{ 495{
456 int ifd; 496 int ifd;
@@ -462,12 +502,16 @@ static unsigned long load_initrd(const char *name, unsigned long mem)
462 if (fstat(ifd, &st) < 0) 502 if (fstat(ifd, &st) < 0)
463 err(1, "fstat() on initrd '%s'", name); 503 err(1, "fstat() on initrd '%s'", name);
464 504
465 /* We map the initrd at the top of memory, but mmap wants it to be 505 /*
466 * page-aligned, so we round the size up for that. */ 506 * We map the initrd at the top of memory, but mmap wants it to be
507 * page-aligned, so we round the size up for that.
508 */
467 len = page_align(st.st_size); 509 len = page_align(st.st_size);
468 map_at(ifd, from_guest_phys(mem - len), 0, st.st_size); 510 map_at(ifd, from_guest_phys(mem - len), 0, st.st_size);
469 /* Once a file is mapped, you can close the file descriptor. It's a 511 /*
470 * little odd, but quite useful. */ 512 * Once a file is mapped, you can close the file descriptor. It's a
513 * little odd, but quite useful.
514 */
471 close(ifd); 515 close(ifd);
472 verbose("mapped initrd %s size=%lu @ %p\n", name, len, (void*)mem-len); 516 verbose("mapped initrd %s size=%lu @ %p\n", name, len, (void*)mem-len);
473 517
@@ -476,8 +520,10 @@ static unsigned long load_initrd(const char *name, unsigned long mem)
476} 520}
477/*:*/ 521/*:*/
478 522
479/* Simple routine to roll all the commandline arguments together with spaces 523/*
480 * between them. */ 524 * Simple routine to roll all the commandline arguments together with spaces
525 * between them.
526 */
481static void concat(char *dst, char *args[]) 527static void concat(char *dst, char *args[])
482{ 528{
483 unsigned int i, len = 0; 529 unsigned int i, len = 0;
@@ -494,10 +540,12 @@ static void concat(char *dst, char *args[])
494 dst[len] = '\0'; 540 dst[len] = '\0';
495} 541}
496 542
497/*L:185 This is where we actually tell the kernel to initialize the Guest. We 543/*L:185
544 * This is where we actually tell the kernel to initialize the Guest. We
498 * saw the arguments it expects when we looked at initialize() in lguest_user.c: 545 * saw the arguments it expects when we looked at initialize() in lguest_user.c:
499 * the base of Guest "physical" memory, the top physical page to allow and the 546 * the base of Guest "physical" memory, the top physical page to allow and the
500 * entry point for the Guest. */ 547 * entry point for the Guest.
548 */
501static void tell_kernel(unsigned long start) 549static void tell_kernel(unsigned long start)
502{ 550{
503 unsigned long args[] = { LHREQ_INITIALIZE, 551 unsigned long args[] = { LHREQ_INITIALIZE,
@@ -511,7 +559,7 @@ static void tell_kernel(unsigned long start)
511} 559}
512/*:*/ 560/*:*/
513 561
514/* 562/*L:200
515 * Device Handling. 563 * Device Handling.
516 * 564 *
517 * When the Guest gives us a buffer, it sends an array of addresses and sizes. 565 * When the Guest gives us a buffer, it sends an array of addresses and sizes.
@@ -522,20 +570,26 @@ static void tell_kernel(unsigned long start)
522static void *_check_pointer(unsigned long addr, unsigned int size, 570static void *_check_pointer(unsigned long addr, unsigned int size,
523 unsigned int line) 571 unsigned int line)
524{ 572{
525 /* We have to separately check addr and addr+size, because size could 573 /*
526 * be huge and addr + size might wrap around. */ 574 * We have to separately check addr and addr+size, because size could
575 * be huge and addr + size might wrap around.
576 */
527 if (addr >= guest_limit || addr + size >= guest_limit) 577 if (addr >= guest_limit || addr + size >= guest_limit)
528 errx(1, "%s:%i: Invalid address %#lx", __FILE__, line, addr); 578 errx(1, "%s:%i: Invalid address %#lx", __FILE__, line, addr);
529 /* We return a pointer for the caller's convenience, now we know it's 579 /*
530 * safe to use. */ 580 * We return a pointer for the caller's convenience, now we know it's
581 * safe to use.
582 */
531 return from_guest_phys(addr); 583 return from_guest_phys(addr);
532} 584}
533/* A macro which transparently hands the line number to the real function. */ 585/* A macro which transparently hands the line number to the real function. */
534#define check_pointer(addr,size) _check_pointer(addr, size, __LINE__) 586#define check_pointer(addr,size) _check_pointer(addr, size, __LINE__)
535 587
536/* Each buffer in the virtqueues is actually a chain of descriptors. This 588/*
589 * Each buffer in the virtqueues is actually a chain of descriptors. This
537 * function returns the next descriptor in the chain, or vq->vring.num if we're 590 * function returns the next descriptor in the chain, or vq->vring.num if we're
538 * at the end. */ 591 * at the end.
592 */
539static unsigned next_desc(struct vring_desc *desc, 593static unsigned next_desc(struct vring_desc *desc,
540 unsigned int i, unsigned int max) 594 unsigned int i, unsigned int max)
541{ 595{
@@ -556,7 +610,10 @@ static unsigned next_desc(struct vring_desc *desc,
556 return next; 610 return next;
557} 611}
558 612
559/* This actually sends the interrupt for this virtqueue */ 613/*
614 * This actually sends the interrupt for this virtqueue, if we've used a
615 * buffer.
616 */
560static void trigger_irq(struct virtqueue *vq) 617static void trigger_irq(struct virtqueue *vq)
561{ 618{
562 unsigned long buf[] = { LHREQ_IRQ, vq->config.irq }; 619 unsigned long buf[] = { LHREQ_IRQ, vq->config.irq };
@@ -576,12 +633,14 @@ static void trigger_irq(struct virtqueue *vq)
576 err(1, "Triggering irq %i", vq->config.irq); 633 err(1, "Triggering irq %i", vq->config.irq);
577} 634}
578 635
579/* This looks in the virtqueue and for the first available buffer, and converts 636/*
637 * This looks in the virtqueue for the first available buffer, and converts
580 * it to an iovec for convenient access. Since descriptors consist of some 638 * it to an iovec for convenient access. Since descriptors consist of some
581 * number of output then some number of input descriptors, it's actually two 639 * number of output then some number of input descriptors, it's actually two
582 * iovecs, but we pack them into one and note how many of each there were. 640 * iovecs, but we pack them into one and note how many of each there were.
583 * 641 *
584 * This function returns the descriptor number found. */ 642 * This function waits if necessary, and returns the descriptor number found.
643 */
585static unsigned wait_for_vq_desc(struct virtqueue *vq, 644static unsigned wait_for_vq_desc(struct virtqueue *vq,
586 struct iovec iov[], 645 struct iovec iov[],
587 unsigned int *out_num, unsigned int *in_num) 646 unsigned int *out_num, unsigned int *in_num)
@@ -590,17 +649,23 @@ static unsigned wait_for_vq_desc(struct virtqueue *vq,
590 struct vring_desc *desc; 649 struct vring_desc *desc;
591 u16 last_avail = lg_last_avail(vq); 650 u16 last_avail = lg_last_avail(vq);
592 651
652 /* There's nothing available? */
593 while (last_avail == vq->vring.avail->idx) { 653 while (last_avail == vq->vring.avail->idx) {
594 u64 event; 654 u64 event;
595 655
596 /* OK, tell Guest about progress up to now. */ 656 /*
657 * Since we're about to sleep, now is a good time to tell the
658 * Guest about what we've used up to now.
659 */
597 trigger_irq(vq); 660 trigger_irq(vq);
598 661
599 /* OK, now we need to know about added descriptors. */ 662 /* OK, now we need to know about added descriptors. */
600 vq->vring.used->flags &= ~VRING_USED_F_NO_NOTIFY; 663 vq->vring.used->flags &= ~VRING_USED_F_NO_NOTIFY;
601 664
602 /* They could have slipped one in as we were doing that: make 665 /*
603 * sure it's written, then check again. */ 666 * They could have slipped one in as we were doing that: make
667 * sure it's written, then check again.
668 */
604 mb(); 669 mb();
605 if (last_avail != vq->vring.avail->idx) { 670 if (last_avail != vq->vring.avail->idx) {
606 vq->vring.used->flags |= VRING_USED_F_NO_NOTIFY; 671 vq->vring.used->flags |= VRING_USED_F_NO_NOTIFY;
@@ -620,8 +685,10 @@ static unsigned wait_for_vq_desc(struct virtqueue *vq,
620 errx(1, "Guest moved used index from %u to %u", 685 errx(1, "Guest moved used index from %u to %u",
621 last_avail, vq->vring.avail->idx); 686 last_avail, vq->vring.avail->idx);
622 687
623 /* Grab the next descriptor number they're advertising, and increment 688 /*
624 * the index we've seen. */ 689 * Grab the next descriptor number they're advertising, and increment
690 * the index we've seen.
691 */
625 head = vq->vring.avail->ring[last_avail % vq->vring.num]; 692 head = vq->vring.avail->ring[last_avail % vq->vring.num];
626 lg_last_avail(vq)++; 693 lg_last_avail(vq)++;
627 694
@@ -636,8 +703,10 @@ static unsigned wait_for_vq_desc(struct virtqueue *vq,
636 desc = vq->vring.desc; 703 desc = vq->vring.desc;
637 i = head; 704 i = head;
638 705
639 /* If this is an indirect entry, then this buffer contains a descriptor 706 /*
640 * table which we handle as if it's any normal descriptor chain. */ 707 * If this is an indirect entry, then this buffer contains a descriptor
708 * table which we handle as if it's any normal descriptor chain.
709 */
641 if (desc[i].flags & VRING_DESC_F_INDIRECT) { 710 if (desc[i].flags & VRING_DESC_F_INDIRECT) {
642 if (desc[i].len % sizeof(struct vring_desc)) 711 if (desc[i].len % sizeof(struct vring_desc))
643 errx(1, "Invalid size for indirect buffer table"); 712 errx(1, "Invalid size for indirect buffer table");
@@ -656,8 +725,10 @@ static unsigned wait_for_vq_desc(struct virtqueue *vq,
656 if (desc[i].flags & VRING_DESC_F_WRITE) 725 if (desc[i].flags & VRING_DESC_F_WRITE)
657 (*in_num)++; 726 (*in_num)++;
658 else { 727 else {
659 /* If it's an output descriptor, they're all supposed 728 /*
660 * to come before any input descriptors. */ 729 * If it's an output descriptor, they're all supposed
730 * to come before any input descriptors.
731 */
661 if (*in_num) 732 if (*in_num)
662 errx(1, "Descriptor has out after in"); 733 errx(1, "Descriptor has out after in");
663 (*out_num)++; 734 (*out_num)++;
@@ -671,14 +742,19 @@ static unsigned wait_for_vq_desc(struct virtqueue *vq,
671 return head; 742 return head;
672} 743}
673 744
674/* After we've used one of their buffers, we tell them about it. We'll then 745/*
675 * want to send them an interrupt, using trigger_irq(). */ 746 * After we've used one of their buffers, we tell the Guest about it. Sometime
747 * later we'll want to send them an interrupt using trigger_irq(); note that
748 * wait_for_vq_desc() does that for us if it has to wait.
749 */
676static void add_used(struct virtqueue *vq, unsigned int head, int len) 750static void add_used(struct virtqueue *vq, unsigned int head, int len)
677{ 751{
678 struct vring_used_elem *used; 752 struct vring_used_elem *used;
679 753
680 /* The virtqueue contains a ring of used buffers. Get a pointer to the 754 /*
681 * next entry in that used ring. */ 755 * The virtqueue contains a ring of used buffers. Get a pointer to the
756 * next entry in that used ring.
757 */
682 used = &vq->vring.used->ring[vq->vring.used->idx % vq->vring.num]; 758 used = &vq->vring.used->ring[vq->vring.used->idx % vq->vring.num];
683 used->id = head; 759 used->id = head;
684 used->len = len; 760 used->len = len;
@@ -698,9 +774,9 @@ static void add_used_and_trigger(struct virtqueue *vq, unsigned head, int len)
698/* 774/*
699 * The Console 775 * The Console
700 * 776 *
701 * We associate some data with the console for our exit hack. */ 777 * We associate some data with the console for our exit hack.
702struct console_abort 778 */
703{ 779struct console_abort {
704 /* How many times have they hit ^C? */ 780 /* How many times have they hit ^C? */
705 int count; 781 int count;
706 /* When did they start? */ 782 /* When did they start? */
@@ -715,30 +791,35 @@ static void console_input(struct virtqueue *vq)
715 struct console_abort *abort = vq->dev->priv; 791 struct console_abort *abort = vq->dev->priv;
716 struct iovec iov[vq->vring.num]; 792 struct iovec iov[vq->vring.num];
717 793
718 /* Make sure there's a descriptor waiting. */ 794 /* Make sure there's a descriptor available. */
719 head = wait_for_vq_desc(vq, iov, &out_num, &in_num); 795 head = wait_for_vq_desc(vq, iov, &out_num, &in_num);
720 if (out_num) 796 if (out_num)
721 errx(1, "Output buffers in console in queue?"); 797 errx(1, "Output buffers in console in queue?");
722 798
723 /* Read it in. */ 799 /* Read into it. This is where we usually wait. */
724 len = readv(STDIN_FILENO, iov, in_num); 800 len = readv(STDIN_FILENO, iov, in_num);
725 if (len <= 0) { 801 if (len <= 0) {
726 /* Ran out of input? */ 802 /* Ran out of input? */
727 warnx("Failed to get console input, ignoring console."); 803 warnx("Failed to get console input, ignoring console.");
728 /* For simplicity, dying threads kill the whole Launcher. So 804 /*
729 * just nap here. */ 805 * For simplicity, dying threads kill the whole Launcher. So
806 * just nap here.
807 */
730 for (;;) 808 for (;;)
731 pause(); 809 pause();
732 } 810 }
733 811
812 /* Tell the Guest we used a buffer. */
734 add_used_and_trigger(vq, head, len); 813 add_used_and_trigger(vq, head, len);
735 814
736 /* Three ^C within one second? Exit. 815 /*
816 * Three ^C within one second? Exit.
737 * 817 *
738 * This is such a hack, but works surprisingly well. Each ^C has to 818 * This is such a hack, but works surprisingly well. Each ^C has to
739 * be in a buffer by itself, so they can't be too fast. But we check 819 * be in a buffer by itself, so they can't be too fast. But we check
740 * that we get three within about a second, so they can't be too 820 * that we get three within about a second, so they can't be too
741 * slow. */ 821 * slow.
822 */
742 if (len != 1 || ((char *)iov[0].iov_base)[0] != 3) { 823 if (len != 1 || ((char *)iov[0].iov_base)[0] != 3) {
743 abort->count = 0; 824 abort->count = 0;
744 return; 825 return;
@@ -763,15 +844,23 @@ static void console_output(struct virtqueue *vq)
763 unsigned int head, out, in; 844 unsigned int head, out, in;
764 struct iovec iov[vq->vring.num]; 845 struct iovec iov[vq->vring.num];
765 846
847 /* We usually wait in here, for the Guest to give us something. */
766 head = wait_for_vq_desc(vq, iov, &out, &in); 848 head = wait_for_vq_desc(vq, iov, &out, &in);
767 if (in) 849 if (in)
768 errx(1, "Input buffers in console output queue?"); 850 errx(1, "Input buffers in console output queue?");
851
852 /* writev can return a partial write, so we loop here. */
769 while (!iov_empty(iov, out)) { 853 while (!iov_empty(iov, out)) {
770 int len = writev(STDOUT_FILENO, iov, out); 854 int len = writev(STDOUT_FILENO, iov, out);
771 if (len <= 0) 855 if (len <= 0)
772 err(1, "Write to stdout gave %i", len); 856 err(1, "Write to stdout gave %i", len);
773 iov_consume(iov, out, len); 857 iov_consume(iov, out, len);
774 } 858 }
859
860 /*
861 * We're finished with that buffer: if we're going to sleep,
862 * wait_for_vq_desc() will prod the Guest with an interrupt.
863 */
775 add_used(vq, head, 0); 864 add_used(vq, head, 0);
776} 865}
777 866
@@ -791,15 +880,30 @@ static void net_output(struct virtqueue *vq)
791 unsigned int head, out, in; 880 unsigned int head, out, in;
792 struct iovec iov[vq->vring.num]; 881 struct iovec iov[vq->vring.num];
793 882
883 /* We usually wait in here for the Guest to give us a packet. */
794 head = wait_for_vq_desc(vq, iov, &out, &in); 884 head = wait_for_vq_desc(vq, iov, &out, &in);
795 if (in) 885 if (in)
796 errx(1, "Input buffers in net output queue?"); 886 errx(1, "Input buffers in net output queue?");
887 /*
888 * Send the whole thing through to /dev/net/tun. It expects the exact
889 * same format: what a coincidence!
890 */
797 if (writev(net_info->tunfd, iov, out) < 0) 891 if (writev(net_info->tunfd, iov, out) < 0)
798 errx(1, "Write to tun failed?"); 892 errx(1, "Write to tun failed?");
893
894 /*
895 * Done with that one; wait_for_vq_desc() will send the interrupt if
896 * all packets are processed.
897 */
799 add_used(vq, head, 0); 898 add_used(vq, head, 0);
800} 899}
801 900
802/* Will reading from this file descriptor block? */ 901/*
902 * Handling network input is a bit trickier, because I've tried to optimize it.
903 *
904 * First we have a helper routine which tells is if from this file descriptor
905 * (ie. the /dev/net/tun device) will block:
906 */
803static bool will_block(int fd) 907static bool will_block(int fd)
804{ 908{
805 fd_set fdset; 909 fd_set fdset;
@@ -809,8 +913,11 @@ static bool will_block(int fd)
809 return select(fd+1, &fdset, NULL, NULL, &zero) != 1; 913 return select(fd+1, &fdset, NULL, NULL, &zero) != 1;
810} 914}
811 915
812/* This is where we handle packets coming in from the tun device to our 916/*
813 * Guest. */ 917 * This handles packets coming in from the tun device to our Guest. Like all
918 * service routines, it gets called again as soon as it returns, so you don't
919 * see a while(1) loop here.
920 */
814static void net_input(struct virtqueue *vq) 921static void net_input(struct virtqueue *vq)
815{ 922{
816 int len; 923 int len;
@@ -818,21 +925,38 @@ static void net_input(struct virtqueue *vq)
818 struct iovec iov[vq->vring.num]; 925 struct iovec iov[vq->vring.num];
819 struct net_info *net_info = vq->dev->priv; 926 struct net_info *net_info = vq->dev->priv;
820 927
928 /*
929 * Get a descriptor to write an incoming packet into. This will also
930 * send an interrupt if they're out of descriptors.
931 */
821 head = wait_for_vq_desc(vq, iov, &out, &in); 932 head = wait_for_vq_desc(vq, iov, &out, &in);
822 if (out) 933 if (out)
823 errx(1, "Output buffers in net input queue?"); 934 errx(1, "Output buffers in net input queue?");
824 935
825 /* Deliver interrupt now, since we're about to sleep. */ 936 /*
937 * If it looks like we'll block reading from the tun device, send them
938 * an interrupt.
939 */
826 if (vq->pending_used && will_block(net_info->tunfd)) 940 if (vq->pending_used && will_block(net_info->tunfd))
827 trigger_irq(vq); 941 trigger_irq(vq);
828 942
943 /*
944 * Read in the packet. This is where we normally wait (when there's no
945 * incoming network traffic).
946 */
829 len = readv(net_info->tunfd, iov, in); 947 len = readv(net_info->tunfd, iov, in);
830 if (len <= 0) 948 if (len <= 0)
831 err(1, "Failed to read from tun."); 949 err(1, "Failed to read from tun.");
950
951 /*
952 * Mark that packet buffer as used, but don't interrupt here. We want
953 * to wait until we've done as much work as we can.
954 */
832 add_used(vq, head, len); 955 add_used(vq, head, len);
833} 956}
957/*:*/
834 958
835/* This is the helper to create threads. */ 959/* This is the helper to create threads: run the service routine in a loop. */
836static int do_thread(void *_vq) 960static int do_thread(void *_vq)
837{ 961{
838 struct virtqueue *vq = _vq; 962 struct virtqueue *vq = _vq;
@@ -842,8 +966,10 @@ static int do_thread(void *_vq)
842 return 0; 966 return 0;
843} 967}
844 968
845/* When a child dies, we kill our entire process group with SIGTERM. This 969/*
846 * also has the side effect that the shell restores the console for us! */ 970 * When a child dies, we kill our entire process group with SIGTERM. This
971 * also has the side effect that the shell restores the console for us!
972 */
847static void kill_launcher(int signal) 973static void kill_launcher(int signal)
848{ 974{
849 kill(0, SIGTERM); 975 kill(0, SIGTERM);
@@ -878,11 +1004,15 @@ static void reset_device(struct device *dev)
878 signal(SIGCHLD, (void *)kill_launcher); 1004 signal(SIGCHLD, (void *)kill_launcher);
879} 1005}
880 1006
1007/*L:216
1008 * This actually creates the thread which services the virtqueue for a device.
1009 */
881static void create_thread(struct virtqueue *vq) 1010static void create_thread(struct virtqueue *vq)
882{ 1011{
883 /* Create stack for thread and run it. Since stack grows 1012 /*
884 * upwards, we point the stack pointer to the end of this 1013 * Create stack for thread. Since the stack grows upwards, we point
885 * region. */ 1014 * the stack pointer to the end of this region.
1015 */
886 char *stack = malloc(32768); 1016 char *stack = malloc(32768);
887 unsigned long args[] = { LHREQ_EVENTFD, 1017 unsigned long args[] = { LHREQ_EVENTFD,
888 vq->config.pfn*getpagesize(), 0 }; 1018 vq->config.pfn*getpagesize(), 0 };
@@ -893,17 +1023,22 @@ static void create_thread(struct virtqueue *vq)
893 err(1, "Creating eventfd"); 1023 err(1, "Creating eventfd");
894 args[2] = vq->eventfd; 1024 args[2] = vq->eventfd;
895 1025
896 /* Attach an eventfd to this virtqueue: it will go off 1026 /*
897 * when the Guest does an LHCALL_NOTIFY for this vq. */ 1027 * Attach an eventfd to this virtqueue: it will go off when the Guest
1028 * does an LHCALL_NOTIFY for this vq.
1029 */
898 if (write(lguest_fd, &args, sizeof(args)) != 0) 1030 if (write(lguest_fd, &args, sizeof(args)) != 0)
899 err(1, "Attaching eventfd"); 1031 err(1, "Attaching eventfd");
900 1032
901 /* CLONE_VM: because it has to access the Guest memory, and 1033 /*
902 * SIGCHLD so we get a signal if it dies. */ 1034 * CLONE_VM: because it has to access the Guest memory, and SIGCHLD so
1035 * we get a signal if it dies.
1036 */
903 vq->thread = clone(do_thread, stack + 32768, CLONE_VM | SIGCHLD, vq); 1037 vq->thread = clone(do_thread, stack + 32768, CLONE_VM | SIGCHLD, vq);
904 if (vq->thread == (pid_t)-1) 1038 if (vq->thread == (pid_t)-1)
905 err(1, "Creating clone"); 1039 err(1, "Creating clone");
906 /* We close our local copy, now the child has it. */ 1040
1041 /* We close our local copy now the child has it. */
907 close(vq->eventfd); 1042 close(vq->eventfd);
908} 1043}
909 1044
@@ -955,7 +1090,10 @@ static void update_device_status(struct device *dev)
955 } 1090 }
956} 1091}
957 1092
958/* This is the generic routine we call when the Guest uses LHCALL_NOTIFY. */ 1093/*L:215
1094 * This is the generic routine we call when the Guest uses LHCALL_NOTIFY. In
1095 * particular, it's used to notify us of device status changes during boot.
1096 */
959static void handle_output(unsigned long addr) 1097static void handle_output(unsigned long addr)
960{ 1098{
961 struct device *i; 1099 struct device *i;
@@ -964,25 +1102,42 @@ static void handle_output(unsigned long addr)
964 for (i = devices.dev; i; i = i->next) { 1102 for (i = devices.dev; i; i = i->next) {
965 struct virtqueue *vq; 1103 struct virtqueue *vq;
966 1104
967 /* Notifications to device descriptors update device status. */ 1105 /*
1106 * Notifications to device descriptors mean they updated the
1107 * device status.
1108 */
968 if (from_guest_phys(addr) == i->desc) { 1109 if (from_guest_phys(addr) == i->desc) {
969 update_device_status(i); 1110 update_device_status(i);
970 return; 1111 return;
971 } 1112 }
972 1113
973 /* Devices *can* be used before status is set to DRIVER_OK. */ 1114 /*
1115 * Devices *can* be used before status is set to DRIVER_OK.
1116 * The original plan was that they would never do this: they
1117 * would always finish setting up their status bits before
1118 * actually touching the virtqueues. In practice, we allowed
1119 * them to, and they do (eg. the disk probes for partition
1120 * tables as part of initialization).
1121 *
1122 * If we see this, we start the device: once it's running, we
1123 * expect the device to catch all the notifications.
1124 */
974 for (vq = i->vq; vq; vq = vq->next) { 1125 for (vq = i->vq; vq; vq = vq->next) {
975 if (addr != vq->config.pfn*getpagesize()) 1126 if (addr != vq->config.pfn*getpagesize())
976 continue; 1127 continue;
977 if (i->running) 1128 if (i->running)
978 errx(1, "Notification on running %s", i->name); 1129 errx(1, "Notification on running %s", i->name);
1130 /* This just calls create_thread() for each virtqueue */
979 start_device(i); 1131 start_device(i);
980 return; 1132 return;
981 } 1133 }
982 } 1134 }
983 1135
984 /* Early console write is done using notify on a nul-terminated string 1136 /*
985 * in Guest memory. */ 1137 * Early console write is done using notify on a nul-terminated string
1138 * in Guest memory. It's also great for hacking debugging messages
1139 * into a Guest.
1140 */
986 if (addr >= guest_limit) 1141 if (addr >= guest_limit)
987 errx(1, "Bad NOTIFY %#lx", addr); 1142 errx(1, "Bad NOTIFY %#lx", addr);
988 1143
@@ -998,10 +1153,12 @@ static void handle_output(unsigned long addr)
998 * routines to allocate and manage them. 1153 * routines to allocate and manage them.
999 */ 1154 */
1000 1155
1001/* The layout of the device page is a "struct lguest_device_desc" followed by a 1156/*
1157 * The layout of the device page is a "struct lguest_device_desc" followed by a
1002 * number of virtqueue descriptors, then two sets of feature bits, then an 1158 * number of virtqueue descriptors, then two sets of feature bits, then an
1003 * array of configuration bytes. This routine returns the configuration 1159 * array of configuration bytes. This routine returns the configuration
1004 * pointer. */ 1160 * pointer.
1161 */
1005static u8 *device_config(const struct device *dev) 1162static u8 *device_config(const struct device *dev)
1006{ 1163{
1007 return (void *)(dev->desc + 1) 1164 return (void *)(dev->desc + 1)
@@ -1009,9 +1166,11 @@ static u8 *device_config(const struct device *dev)
1009 + dev->feature_len * 2; 1166 + dev->feature_len * 2;
1010} 1167}
1011 1168
1012/* This routine allocates a new "struct lguest_device_desc" from descriptor 1169/*
1170 * This routine allocates a new "struct lguest_device_desc" from descriptor
1013 * table page just above the Guest's normal memory. It returns a pointer to 1171 * table page just above the Guest's normal memory. It returns a pointer to
1014 * that descriptor. */ 1172 * that descriptor.
1173 */
1015static struct lguest_device_desc *new_dev_desc(u16 type) 1174static struct lguest_device_desc *new_dev_desc(u16 type)
1016{ 1175{
1017 struct lguest_device_desc d = { .type = type }; 1176 struct lguest_device_desc d = { .type = type };
@@ -1032,8 +1191,10 @@ static struct lguest_device_desc *new_dev_desc(u16 type)
1032 return memcpy(p, &d, sizeof(d)); 1191 return memcpy(p, &d, sizeof(d));
1033} 1192}
1034 1193
1035/* Each device descriptor is followed by the description of its virtqueues. We 1194/*
1036 * specify how many descriptors the virtqueue is to have. */ 1195 * Each device descriptor is followed by the description of its virtqueues. We
1196 * specify how many descriptors the virtqueue is to have.
1197 */
1037static void add_virtqueue(struct device *dev, unsigned int num_descs, 1198static void add_virtqueue(struct device *dev, unsigned int num_descs,
1038 void (*service)(struct virtqueue *)) 1199 void (*service)(struct virtqueue *))
1039{ 1200{
@@ -1050,6 +1211,11 @@ static void add_virtqueue(struct device *dev, unsigned int num_descs,
1050 vq->next = NULL; 1211 vq->next = NULL;
1051 vq->last_avail_idx = 0; 1212 vq->last_avail_idx = 0;
1052 vq->dev = dev; 1213 vq->dev = dev;
1214
1215 /*
1216 * This is the routine the service thread will run, and its Process ID
1217 * once it's running.
1218 */
1053 vq->service = service; 1219 vq->service = service;
1054 vq->thread = (pid_t)-1; 1220 vq->thread = (pid_t)-1;
1055 1221
@@ -1061,10 +1227,12 @@ static void add_virtqueue(struct device *dev, unsigned int num_descs,
1061 /* Initialize the vring. */ 1227 /* Initialize the vring. */
1062 vring_init(&vq->vring, num_descs, p, LGUEST_VRING_ALIGN); 1228 vring_init(&vq->vring, num_descs, p, LGUEST_VRING_ALIGN);
1063 1229
1064 /* Append virtqueue to this device's descriptor. We use 1230 /*
1231 * Append virtqueue to this device's descriptor. We use
1065 * device_config() to get the end of the device's current virtqueues; 1232 * device_config() to get the end of the device's current virtqueues;
1066 * we check that we haven't added any config or feature information 1233 * we check that we haven't added any config or feature information
1067 * yet, otherwise we'd be overwriting them. */ 1234 * yet, otherwise we'd be overwriting them.
1235 */
1068 assert(dev->desc->config_len == 0 && dev->desc->feature_len == 0); 1236 assert(dev->desc->config_len == 0 && dev->desc->feature_len == 0);
1069 memcpy(device_config(dev), &vq->config, sizeof(vq->config)); 1237 memcpy(device_config(dev), &vq->config, sizeof(vq->config));
1070 dev->num_vq++; 1238 dev->num_vq++;
@@ -1072,14 +1240,18 @@ static void add_virtqueue(struct device *dev, unsigned int num_descs,
1072 1240
1073 verbose("Virtqueue page %#lx\n", to_guest_phys(p)); 1241 verbose("Virtqueue page %#lx\n", to_guest_phys(p));
1074 1242
1075 /* Add to tail of list, so dev->vq is first vq, dev->vq->next is 1243 /*
1076 * second. */ 1244 * Add to tail of list, so dev->vq is first vq, dev->vq->next is
1245 * second.
1246 */
1077 for (i = &dev->vq; *i; i = &(*i)->next); 1247 for (i = &dev->vq; *i; i = &(*i)->next);
1078 *i = vq; 1248 *i = vq;
1079} 1249}
1080 1250
1081/* The first half of the feature bitmask is for us to advertise features. The 1251/*
1082 * second half is for the Guest to accept features. */ 1252 * The first half of the feature bitmask is for us to advertise features. The
1253 * second half is for the Guest to accept features.
1254 */
1083static void add_feature(struct device *dev, unsigned bit) 1255static void add_feature(struct device *dev, unsigned bit)
1084{ 1256{
1085 u8 *features = get_feature_bits(dev); 1257 u8 *features = get_feature_bits(dev);
@@ -1093,9 +1265,11 @@ static void add_feature(struct device *dev, unsigned bit)
1093 features[bit / CHAR_BIT] |= (1 << (bit % CHAR_BIT)); 1265 features[bit / CHAR_BIT] |= (1 << (bit % CHAR_BIT));
1094} 1266}
1095 1267
1096/* This routine sets the configuration fields for an existing device's 1268/*
1269 * This routine sets the configuration fields for an existing device's
1097 * descriptor. It only works for the last device, but that's OK because that's 1270 * descriptor. It only works for the last device, but that's OK because that's
1098 * how we use it. */ 1271 * how we use it.
1272 */
1099static void set_config(struct device *dev, unsigned len, const void *conf) 1273static void set_config(struct device *dev, unsigned len, const void *conf)
1100{ 1274{
1101 /* Check we haven't overflowed our single page. */ 1275 /* Check we haven't overflowed our single page. */
@@ -1105,12 +1279,18 @@ static void set_config(struct device *dev, unsigned len, const void *conf)
1105 /* Copy in the config information, and store the length. */ 1279 /* Copy in the config information, and store the length. */
1106 memcpy(device_config(dev), conf, len); 1280 memcpy(device_config(dev), conf, len);
1107 dev->desc->config_len = len; 1281 dev->desc->config_len = len;
1282
1283 /* Size must fit in config_len field (8 bits)! */
1284 assert(dev->desc->config_len == len);
1108} 1285}
1109 1286
1110/* This routine does all the creation and setup of a new device, including 1287/*
1111 * calling new_dev_desc() to allocate the descriptor and device memory. 1288 * This routine does all the creation and setup of a new device, including
1289 * calling new_dev_desc() to allocate the descriptor and device memory. We
1290 * don't actually start the service threads until later.
1112 * 1291 *
1113 * See what I mean about userspace being boring? */ 1292 * See what I mean about userspace being boring?
1293 */
1114static struct device *new_device(const char *name, u16 type) 1294static struct device *new_device(const char *name, u16 type)
1115{ 1295{
1116 struct device *dev = malloc(sizeof(*dev)); 1296 struct device *dev = malloc(sizeof(*dev));
@@ -1123,10 +1303,12 @@ static struct device *new_device(const char *name, u16 type)
1123 dev->num_vq = 0; 1303 dev->num_vq = 0;
1124 dev->running = false; 1304 dev->running = false;
1125 1305
1126 /* Append to device list. Prepending to a single-linked list is 1306 /*
1307 * Append to device list. Prepending to a single-linked list is
1127 * easier, but the user expects the devices to be arranged on the bus 1308 * easier, but the user expects the devices to be arranged on the bus
1128 * in command-line order. The first network device on the command line 1309 * in command-line order. The first network device on the command line
1129 * is eth0, the first block device /dev/vda, etc. */ 1310 * is eth0, the first block device /dev/vda, etc.
1311 */
1130 if (devices.lastdev) 1312 if (devices.lastdev)
1131 devices.lastdev->next = dev; 1313 devices.lastdev->next = dev;
1132 else 1314 else
@@ -1136,8 +1318,10 @@ static struct device *new_device(const char *name, u16 type)
1136 return dev; 1318 return dev;
1137} 1319}
1138 1320
1139/* Our first setup routine is the console. It's a fairly simple device, but 1321/*
1140 * UNIX tty handling makes it uglier than it could be. */ 1322 * Our first setup routine is the console. It's a fairly simple device, but
1323 * UNIX tty handling makes it uglier than it could be.
1324 */
1141static void setup_console(void) 1325static void setup_console(void)
1142{ 1326{
1143 struct device *dev; 1327 struct device *dev;
@@ -1145,8 +1329,10 @@ static void setup_console(void)
1145 /* If we can save the initial standard input settings... */ 1329 /* If we can save the initial standard input settings... */
1146 if (tcgetattr(STDIN_FILENO, &orig_term) == 0) { 1330 if (tcgetattr(STDIN_FILENO, &orig_term) == 0) {
1147 struct termios term = orig_term; 1331 struct termios term = orig_term;
1148 /* Then we turn off echo, line buffering and ^C etc. We want a 1332 /*
1149 * raw input stream to the Guest. */ 1333 * Then we turn off echo, line buffering and ^C etc: We want a
1334 * raw input stream to the Guest.
1335 */
1150 term.c_lflag &= ~(ISIG|ICANON|ECHO); 1336 term.c_lflag &= ~(ISIG|ICANON|ECHO);
1151 tcsetattr(STDIN_FILENO, TCSANOW, &term); 1337 tcsetattr(STDIN_FILENO, TCSANOW, &term);
1152 } 1338 }
@@ -1157,10 +1343,12 @@ static void setup_console(void)
1157 dev->priv = malloc(sizeof(struct console_abort)); 1343 dev->priv = malloc(sizeof(struct console_abort));
1158 ((struct console_abort *)dev->priv)->count = 0; 1344 ((struct console_abort *)dev->priv)->count = 0;
1159 1345
1160 /* The console needs two virtqueues: the input then the output. When 1346 /*
1347 * The console needs two virtqueues: the input then the output. When
1161 * they put something the input queue, we make sure we're listening to 1348 * they put something the input queue, we make sure we're listening to
1162 * stdin. When they put something in the output queue, we write it to 1349 * stdin. When they put something in the output queue, we write it to
1163 * stdout. */ 1350 * stdout.
1351 */
1164 add_virtqueue(dev, VIRTQUEUE_NUM, console_input); 1352 add_virtqueue(dev, VIRTQUEUE_NUM, console_input);
1165 add_virtqueue(dev, VIRTQUEUE_NUM, console_output); 1353 add_virtqueue(dev, VIRTQUEUE_NUM, console_output);
1166 1354
@@ -1168,7 +1356,8 @@ static void setup_console(void)
1168} 1356}
1169/*:*/ 1357/*:*/
1170 1358
1171/*M:010 Inter-guest networking is an interesting area. Simplest is to have a 1359/*M:010
1360 * Inter-guest networking is an interesting area. Simplest is to have a
1172 * --sharenet=<name> option which opens or creates a named pipe. This can be 1361 * --sharenet=<name> option which opens or creates a named pipe. This can be
1173 * used to send packets to another guest in a 1:1 manner. 1362 * used to send packets to another guest in a 1:1 manner.
1174 * 1363 *
@@ -1182,7 +1371,8 @@ static void setup_console(void)
1182 * multiple inter-guest channels behind one interface, although it would 1371 * multiple inter-guest channels behind one interface, although it would
1183 * require some manner of hotplugging new virtio channels. 1372 * require some manner of hotplugging new virtio channels.
1184 * 1373 *
1185 * Finally, we could implement a virtio network switch in the kernel. :*/ 1374 * Finally, we could implement a virtio network switch in the kernel.
1375:*/
1186 1376
1187static u32 str2ip(const char *ipaddr) 1377static u32 str2ip(const char *ipaddr)
1188{ 1378{
@@ -1207,11 +1397,13 @@ static void str2mac(const char *macaddr, unsigned char mac[6])
1207 mac[5] = m[5]; 1397 mac[5] = m[5];
1208} 1398}
1209 1399
1210/* This code is "adapted" from libbridge: it attaches the Host end of the 1400/*
1401 * This code is "adapted" from libbridge: it attaches the Host end of the
1211 * network device to the bridge device specified by the command line. 1402 * network device to the bridge device specified by the command line.
1212 * 1403 *
1213 * This is yet another James Morris contribution (I'm an IP-level guy, so I 1404 * This is yet another James Morris contribution (I'm an IP-level guy, so I
1214 * dislike bridging), and I just try not to break it. */ 1405 * dislike bridging), and I just try not to break it.
1406 */
1215static void add_to_bridge(int fd, const char *if_name, const char *br_name) 1407static void add_to_bridge(int fd, const char *if_name, const char *br_name)
1216{ 1408{
1217 int ifidx; 1409 int ifidx;
@@ -1231,9 +1423,11 @@ static void add_to_bridge(int fd, const char *if_name, const char *br_name)
1231 err(1, "can't add %s to bridge %s", if_name, br_name); 1423 err(1, "can't add %s to bridge %s", if_name, br_name);
1232} 1424}
1233 1425
1234/* This sets up the Host end of the network device with an IP address, brings 1426/*
1427 * This sets up the Host end of the network device with an IP address, brings
1235 * it up so packets will flow, the copies the MAC address into the hwaddr 1428 * it up so packets will flow, the copies the MAC address into the hwaddr
1236 * pointer. */ 1429 * pointer.
1430 */
1237static void configure_device(int fd, const char *tapif, u32 ipaddr) 1431static void configure_device(int fd, const char *tapif, u32 ipaddr)
1238{ 1432{
1239 struct ifreq ifr; 1433 struct ifreq ifr;
@@ -1260,10 +1454,12 @@ static int get_tun_device(char tapif[IFNAMSIZ])
1260 /* Start with this zeroed. Messy but sure. */ 1454 /* Start with this zeroed. Messy but sure. */
1261 memset(&ifr, 0, sizeof(ifr)); 1455 memset(&ifr, 0, sizeof(ifr));
1262 1456
1263 /* We open the /dev/net/tun device and tell it we want a tap device. A 1457 /*
1458 * We open the /dev/net/tun device and tell it we want a tap device. A
1264 * tap device is like a tun device, only somehow different. To tell 1459 * tap device is like a tun device, only somehow different. To tell
1265 * the truth, I completely blundered my way through this code, but it 1460 * the truth, I completely blundered my way through this code, but it
1266 * works now! */ 1461 * works now!
1462 */
1267 netfd = open_or_die("/dev/net/tun", O_RDWR); 1463 netfd = open_or_die("/dev/net/tun", O_RDWR);
1268 ifr.ifr_flags = IFF_TAP | IFF_NO_PI | IFF_VNET_HDR; 1464 ifr.ifr_flags = IFF_TAP | IFF_NO_PI | IFF_VNET_HDR;
1269 strcpy(ifr.ifr_name, "tap%d"); 1465 strcpy(ifr.ifr_name, "tap%d");
@@ -1274,18 +1470,22 @@ static int get_tun_device(char tapif[IFNAMSIZ])
1274 TUN_F_CSUM|TUN_F_TSO4|TUN_F_TSO6|TUN_F_TSO_ECN) != 0) 1470 TUN_F_CSUM|TUN_F_TSO4|TUN_F_TSO6|TUN_F_TSO_ECN) != 0)
1275 err(1, "Could not set features for tun device"); 1471 err(1, "Could not set features for tun device");
1276 1472
1277 /* We don't need checksums calculated for packets coming in this 1473 /*
1278 * device: trust us! */ 1474 * We don't need checksums calculated for packets coming in this
1475 * device: trust us!
1476 */
1279 ioctl(netfd, TUNSETNOCSUM, 1); 1477 ioctl(netfd, TUNSETNOCSUM, 1);
1280 1478
1281 memcpy(tapif, ifr.ifr_name, IFNAMSIZ); 1479 memcpy(tapif, ifr.ifr_name, IFNAMSIZ);
1282 return netfd; 1480 return netfd;
1283} 1481}
1284 1482
1285/*L:195 Our network is a Host<->Guest network. This can either use bridging or 1483/*L:195
1484 * Our network is a Host<->Guest network. This can either use bridging or
1286 * routing, but the principle is the same: it uses the "tun" device to inject 1485 * routing, but the principle is the same: it uses the "tun" device to inject
1287 * packets into the Host as if they came in from a normal network card. We 1486 * packets into the Host as if they came in from a normal network card. We
1288 * just shunt packets between the Guest and the tun device. */ 1487 * just shunt packets between the Guest and the tun device.
1488 */
1289static void setup_tun_net(char *arg) 1489static void setup_tun_net(char *arg)
1290{ 1490{
1291 struct device *dev; 1491 struct device *dev;
@@ -1302,13 +1502,14 @@ static void setup_tun_net(char *arg)
1302 dev = new_device("net", VIRTIO_ID_NET); 1502 dev = new_device("net", VIRTIO_ID_NET);
1303 dev->priv = net_info; 1503 dev->priv = net_info;
1304 1504
1305 /* Network devices need a receive and a send queue, just like 1505 /* Network devices need a recv and a send queue, just like console. */
1306 * console. */
1307 add_virtqueue(dev, VIRTQUEUE_NUM, net_input); 1506 add_virtqueue(dev, VIRTQUEUE_NUM, net_input);
1308 add_virtqueue(dev, VIRTQUEUE_NUM, net_output); 1507 add_virtqueue(dev, VIRTQUEUE_NUM, net_output);
1309 1508
1310 /* We need a socket to perform the magic network ioctls to bring up the 1509 /*
1311 * tap interface, connect to the bridge etc. Any socket will do! */ 1510 * We need a socket to perform the magic network ioctls to bring up the
1511 * tap interface, connect to the bridge etc. Any socket will do!
1512 */
1312 ipfd = socket(PF_INET, SOCK_DGRAM, IPPROTO_IP); 1513 ipfd = socket(PF_INET, SOCK_DGRAM, IPPROTO_IP);
1313 if (ipfd < 0) 1514 if (ipfd < 0)
1314 err(1, "opening IP socket"); 1515 err(1, "opening IP socket");
@@ -1362,39 +1563,31 @@ static void setup_tun_net(char *arg)
1362 verbose("device %u: tun %s: %s\n", 1563 verbose("device %u: tun %s: %s\n",
1363 devices.device_num, tapif, arg); 1564 devices.device_num, tapif, arg);
1364} 1565}
1365 1566/*:*/
1366/* Our block (disk) device should be really simple: the Guest asks for a block
1367 * number and we read or write that position in the file. Unfortunately, that
1368 * was amazingly slow: the Guest waits until the read is finished before
1369 * running anything else, even if it could have been doing useful work.
1370 *
1371 * We could use async I/O, except it's reputed to suck so hard that characters
1372 * actually go missing from your code when you try to use it.
1373 *
1374 * So we farm the I/O out to thread, and communicate with it via a pipe. */
1375 1567
1376/* This hangs off device->priv. */ 1568/* This hangs off device->priv. */
1377struct vblk_info 1569struct vblk_info {
1378{
1379 /* The size of the file. */ 1570 /* The size of the file. */
1380 off64_t len; 1571 off64_t len;
1381 1572
1382 /* The file descriptor for the file. */ 1573 /* The file descriptor for the file. */
1383 int fd; 1574 int fd;
1384 1575
1385 /* IO thread listens on this file descriptor [0]. */
1386 int workpipe[2];
1387
1388 /* IO thread writes to this file descriptor to mark it done, then
1389 * Launcher triggers interrupt to Guest. */
1390 int done_fd;
1391}; 1576};
1392 1577
1393/*L:210 1578/*L:210
1394 * The Disk 1579 * The Disk
1395 * 1580 *
1396 * Remember that the block device is handled by a separate I/O thread. We head 1581 * The disk only has one virtqueue, so it only has one thread. It is really
1397 * straight into the core of that thread here: 1582 * simple: the Guest asks for a block number and we read or write that position
1583 * in the file.
1584 *
1585 * Before we serviced each virtqueue in a separate thread, that was unacceptably
1586 * slow: the Guest waits until the read is finished before running anything
1587 * else, even if it could have been doing useful work.
1588 *
1589 * We could have used async I/O, except it's reputed to suck so hard that
1590 * characters actually go missing from your code when you try to use it.
1398 */ 1591 */
1399static void blk_request(struct virtqueue *vq) 1592static void blk_request(struct virtqueue *vq)
1400{ 1593{
@@ -1406,47 +1599,64 @@ static void blk_request(struct virtqueue *vq)
1406 struct iovec iov[vq->vring.num]; 1599 struct iovec iov[vq->vring.num];
1407 off64_t off; 1600 off64_t off;
1408 1601
1409 /* Get the next request. */ 1602 /*
1603 * Get the next request, where we normally wait. It triggers the
1604 * interrupt to acknowledge previously serviced requests (if any).
1605 */
1410 head = wait_for_vq_desc(vq, iov, &out_num, &in_num); 1606 head = wait_for_vq_desc(vq, iov, &out_num, &in_num);
1411 1607
1412 /* Every block request should contain at least one output buffer 1608 /*
1609 * Every block request should contain at least one output buffer
1413 * (detailing the location on disk and the type of request) and one 1610 * (detailing the location on disk and the type of request) and one
1414 * input buffer (to hold the result). */ 1611 * input buffer (to hold the result).
1612 */
1415 if (out_num == 0 || in_num == 0) 1613 if (out_num == 0 || in_num == 0)
1416 errx(1, "Bad virtblk cmd %u out=%u in=%u", 1614 errx(1, "Bad virtblk cmd %u out=%u in=%u",
1417 head, out_num, in_num); 1615 head, out_num, in_num);
1418 1616
1419 out = convert(&iov[0], struct virtio_blk_outhdr); 1617 out = convert(&iov[0], struct virtio_blk_outhdr);
1420 in = convert(&iov[out_num+in_num-1], u8); 1618 in = convert(&iov[out_num+in_num-1], u8);
1619 /*
1620 * For historical reasons, block operations are expressed in 512 byte
1621 * "sectors".
1622 */
1421 off = out->sector * 512; 1623 off = out->sector * 512;
1422 1624
1423 /* The block device implements "barriers", where the Guest indicates 1625 /*
1626 * The block device implements "barriers", where the Guest indicates
1424 * that it wants all previous writes to occur before this write. We 1627 * that it wants all previous writes to occur before this write. We
1425 * don't have a way of asking our kernel to do a barrier, so we just 1628 * don't have a way of asking our kernel to do a barrier, so we just
1426 * synchronize all the data in the file. Pretty poor, no? */ 1629 * synchronize all the data in the file. Pretty poor, no?
1630 */
1427 if (out->type & VIRTIO_BLK_T_BARRIER) 1631 if (out->type & VIRTIO_BLK_T_BARRIER)
1428 fdatasync(vblk->fd); 1632 fdatasync(vblk->fd);
1429 1633
1430 /* In general the virtio block driver is allowed to try SCSI commands. 1634 /*
1431 * It'd be nice if we supported eject, for example, but we don't. */ 1635 * In general the virtio block driver is allowed to try SCSI commands.
1636 * It'd be nice if we supported eject, for example, but we don't.
1637 */
1432 if (out->type & VIRTIO_BLK_T_SCSI_CMD) { 1638 if (out->type & VIRTIO_BLK_T_SCSI_CMD) {
1433 fprintf(stderr, "Scsi commands unsupported\n"); 1639 fprintf(stderr, "Scsi commands unsupported\n");
1434 *in = VIRTIO_BLK_S_UNSUPP; 1640 *in = VIRTIO_BLK_S_UNSUPP;
1435 wlen = sizeof(*in); 1641 wlen = sizeof(*in);
1436 } else if (out->type & VIRTIO_BLK_T_OUT) { 1642 } else if (out->type & VIRTIO_BLK_T_OUT) {
1437 /* Write */ 1643 /*
1438 1644 * Write
1439 /* Move to the right location in the block file. This can fail 1645 *
1440 * if they try to write past end. */ 1646 * Move to the right location in the block file. This can fail
1647 * if they try to write past end.
1648 */
1441 if (lseek64(vblk->fd, off, SEEK_SET) != off) 1649 if (lseek64(vblk->fd, off, SEEK_SET) != off)
1442 err(1, "Bad seek to sector %llu", out->sector); 1650 err(1, "Bad seek to sector %llu", out->sector);
1443 1651
1444 ret = writev(vblk->fd, iov+1, out_num-1); 1652 ret = writev(vblk->fd, iov+1, out_num-1);
1445 verbose("WRITE to sector %llu: %i\n", out->sector, ret); 1653 verbose("WRITE to sector %llu: %i\n", out->sector, ret);
1446 1654
1447 /* Grr... Now we know how long the descriptor they sent was, we 1655 /*
1656 * Grr... Now we know how long the descriptor they sent was, we
1448 * make sure they didn't try to write over the end of the block 1657 * make sure they didn't try to write over the end of the block
1449 * file (possibly extending it). */ 1658 * file (possibly extending it).
1659 */
1450 if (ret > 0 && off + ret > vblk->len) { 1660 if (ret > 0 && off + ret > vblk->len) {
1451 /* Trim it back to the correct length */ 1661 /* Trim it back to the correct length */
1452 ftruncate64(vblk->fd, vblk->len); 1662 ftruncate64(vblk->fd, vblk->len);
@@ -1456,10 +1666,12 @@ static void blk_request(struct virtqueue *vq)
1456 wlen = sizeof(*in); 1666 wlen = sizeof(*in);
1457 *in = (ret >= 0 ? VIRTIO_BLK_S_OK : VIRTIO_BLK_S_IOERR); 1667 *in = (ret >= 0 ? VIRTIO_BLK_S_OK : VIRTIO_BLK_S_IOERR);
1458 } else { 1668 } else {
1459 /* Read */ 1669 /*
1460 1670 * Read
1461 /* Move to the right location in the block file. This can fail 1671 *
1462 * if they try to read past end. */ 1672 * Move to the right location in the block file. This can fail
1673 * if they try to read past end.
1674 */
1463 if (lseek64(vblk->fd, off, SEEK_SET) != off) 1675 if (lseek64(vblk->fd, off, SEEK_SET) != off)
1464 err(1, "Bad seek to sector %llu", out->sector); 1676 err(1, "Bad seek to sector %llu", out->sector);
1465 1677
@@ -1474,13 +1686,16 @@ static void blk_request(struct virtqueue *vq)
1474 } 1686 }
1475 } 1687 }
1476 1688
1477 /* OK, so we noted that it was pretty poor to use an fdatasync as a 1689 /*
1690 * OK, so we noted that it was pretty poor to use an fdatasync as a
1478 * barrier. But Christoph Hellwig points out that we need a sync 1691 * barrier. But Christoph Hellwig points out that we need a sync
1479 * *afterwards* as well: "Barriers specify no reordering to the front 1692 * *afterwards* as well: "Barriers specify no reordering to the front
1480 * or the back." And Jens Axboe confirmed it, so here we are: */ 1693 * or the back." And Jens Axboe confirmed it, so here we are:
1694 */
1481 if (out->type & VIRTIO_BLK_T_BARRIER) 1695 if (out->type & VIRTIO_BLK_T_BARRIER)
1482 fdatasync(vblk->fd); 1696 fdatasync(vblk->fd);
1483 1697
1698 /* Finished that request. */
1484 add_used(vq, head, wlen); 1699 add_used(vq, head, wlen);
1485} 1700}
1486 1701
@@ -1491,7 +1706,7 @@ static void setup_block_file(const char *filename)
1491 struct vblk_info *vblk; 1706 struct vblk_info *vblk;
1492 struct virtio_blk_config conf; 1707 struct virtio_blk_config conf;
1493 1708
1494 /* The device responds to return from I/O thread. */ 1709 /* Creat the device. */
1495 dev = new_device("block", VIRTIO_ID_BLOCK); 1710 dev = new_device("block", VIRTIO_ID_BLOCK);
1496 1711
1497 /* The device has one virtqueue, where the Guest places requests. */ 1712 /* The device has one virtqueue, where the Guest places requests. */
@@ -1510,27 +1725,32 @@ static void setup_block_file(const char *filename)
1510 /* Tell Guest how many sectors this device has. */ 1725 /* Tell Guest how many sectors this device has. */
1511 conf.capacity = cpu_to_le64(vblk->len / 512); 1726 conf.capacity = cpu_to_le64(vblk->len / 512);
1512 1727
1513 /* Tell Guest not to put in too many descriptors at once: two are used 1728 /*
1514 * for the in and out elements. */ 1729 * Tell Guest not to put in too many descriptors at once: two are used
1730 * for the in and out elements.
1731 */
1515 add_feature(dev, VIRTIO_BLK_F_SEG_MAX); 1732 add_feature(dev, VIRTIO_BLK_F_SEG_MAX);
1516 conf.seg_max = cpu_to_le32(VIRTQUEUE_NUM - 2); 1733 conf.seg_max = cpu_to_le32(VIRTQUEUE_NUM - 2);
1517 1734
1518 set_config(dev, sizeof(conf), &conf); 1735 /* Don't try to put whole struct: we have 8 bit limit. */
1736 set_config(dev, offsetof(struct virtio_blk_config, geometry), &conf);
1519 1737
1520 verbose("device %u: virtblock %llu sectors\n", 1738 verbose("device %u: virtblock %llu sectors\n",
1521 ++devices.device_num, le64_to_cpu(conf.capacity)); 1739 ++devices.device_num, le64_to_cpu(conf.capacity));
1522} 1740}
1523 1741
1524struct rng_info { 1742/*L:211
1525 int rfd; 1743 * Our random number generator device reads from /dev/random into the Guest's
1526};
1527
1528/* Our random number generator device reads from /dev/random into the Guest's
1529 * input buffers. The usual case is that the Guest doesn't want random numbers 1744 * input buffers. The usual case is that the Guest doesn't want random numbers
1530 * and so has no buffers although /dev/random is still readable, whereas 1745 * and so has no buffers although /dev/random is still readable, whereas
1531 * console is the reverse. 1746 * console is the reverse.
1532 * 1747 *
1533 * The same logic applies, however. */ 1748 * The same logic applies, however.
1749 */
1750struct rng_info {
1751 int rfd;
1752};
1753
1534static void rng_input(struct virtqueue *vq) 1754static void rng_input(struct virtqueue *vq)
1535{ 1755{
1536 int len; 1756 int len;
@@ -1543,9 +1763,10 @@ static void rng_input(struct virtqueue *vq)
1543 if (out_num) 1763 if (out_num)
1544 errx(1, "Output buffers in rng?"); 1764 errx(1, "Output buffers in rng?");
1545 1765
1546 /* This is why we convert to iovecs: the readv() call uses them, and so 1766 /*
1547 * it reads straight into the Guest's buffer. We loop to make sure we 1767 * Just like the console write, we loop to cover the whole iovec.
1548 * fill it. */ 1768 * In this case, short reads actually happen quite a bit.
1769 */
1549 while (!iov_empty(iov, in_num)) { 1770 while (!iov_empty(iov, in_num)) {
1550 len = readv(rng_info->rfd, iov, in_num); 1771 len = readv(rng_info->rfd, iov, in_num);
1551 if (len <= 0) 1772 if (len <= 0)
@@ -1558,15 +1779,18 @@ static void rng_input(struct virtqueue *vq)
1558 add_used(vq, head, totlen); 1779 add_used(vq, head, totlen);
1559} 1780}
1560 1781
1561/* And this creates a "hardware" random number device for the Guest. */ 1782/*L:199
1783 * This creates a "hardware" random number device for the Guest.
1784 */
1562static void setup_rng(void) 1785static void setup_rng(void)
1563{ 1786{
1564 struct device *dev; 1787 struct device *dev;
1565 struct rng_info *rng_info = malloc(sizeof(*rng_info)); 1788 struct rng_info *rng_info = malloc(sizeof(*rng_info));
1566 1789
1790 /* Our device's privat info simply contains the /dev/random fd. */
1567 rng_info->rfd = open_or_die("/dev/random", O_RDONLY); 1791 rng_info->rfd = open_or_die("/dev/random", O_RDONLY);
1568 1792
1569 /* The device responds to return from I/O thread. */ 1793 /* Create the new device. */
1570 dev = new_device("rng", VIRTIO_ID_RNG); 1794 dev = new_device("rng", VIRTIO_ID_RNG);
1571 dev->priv = rng_info; 1795 dev->priv = rng_info;
1572 1796
@@ -1582,8 +1806,10 @@ static void __attribute__((noreturn)) restart_guest(void)
1582{ 1806{
1583 unsigned int i; 1807 unsigned int i;
1584 1808
1585 /* Since we don't track all open fds, we simply close everything beyond 1809 /*
1586 * stderr. */ 1810 * Since we don't track all open fds, we simply close everything beyond
1811 * stderr.
1812 */
1587 for (i = 3; i < FD_SETSIZE; i++) 1813 for (i = 3; i < FD_SETSIZE; i++)
1588 close(i); 1814 close(i);
1589 1815
@@ -1594,8 +1820,10 @@ static void __attribute__((noreturn)) restart_guest(void)
1594 err(1, "Could not exec %s", main_args[0]); 1820 err(1, "Could not exec %s", main_args[0]);
1595} 1821}
1596 1822
1597/*L:220 Finally we reach the core of the Launcher which runs the Guest, serves 1823/*L:220
1598 * its input and output, and finally, lays it to rest. */ 1824 * Finally we reach the core of the Launcher which runs the Guest, serves
1825 * its input and output, and finally, lays it to rest.
1826 */
1599static void __attribute__((noreturn)) run_guest(void) 1827static void __attribute__((noreturn)) run_guest(void)
1600{ 1828{
1601 for (;;) { 1829 for (;;) {
@@ -1630,7 +1858,7 @@ static void __attribute__((noreturn)) run_guest(void)
1630 * 1858 *
1631 * Are you ready? Take a deep breath and join me in the core of the Host, in 1859 * Are you ready? Take a deep breath and join me in the core of the Host, in
1632 * "make Host". 1860 * "make Host".
1633 :*/ 1861:*/
1634 1862
1635static struct option opts[] = { 1863static struct option opts[] = {
1636 { "verbose", 0, NULL, 'v' }, 1864 { "verbose", 0, NULL, 'v' },
@@ -1651,8 +1879,7 @@ static void usage(void)
1651/*L:105 The main routine is where the real work begins: */ 1879/*L:105 The main routine is where the real work begins: */
1652int main(int argc, char *argv[]) 1880int main(int argc, char *argv[])
1653{ 1881{
1654 /* Memory, top-level pagetable, code startpoint and size of the 1882 /* Memory, code startpoint and size of the (optional) initrd. */
1655 * (optional) initrd. */
1656 unsigned long mem = 0, start, initrd_size = 0; 1883 unsigned long mem = 0, start, initrd_size = 0;
1657 /* Two temporaries. */ 1884 /* Two temporaries. */
1658 int i, c; 1885 int i, c;
@@ -1664,24 +1891,32 @@ int main(int argc, char *argv[])
1664 /* Save the args: we "reboot" by execing ourselves again. */ 1891 /* Save the args: we "reboot" by execing ourselves again. */
1665 main_args = argv; 1892 main_args = argv;
1666 1893
1667 /* First we initialize the device list. We keep a pointer to the last 1894 /*
1895 * First we initialize the device list. We keep a pointer to the last
1668 * device, and the next interrupt number to use for devices (1: 1896 * device, and the next interrupt number to use for devices (1:
1669 * remember that 0 is used by the timer). */ 1897 * remember that 0 is used by the timer).
1898 */
1670 devices.lastdev = NULL; 1899 devices.lastdev = NULL;
1671 devices.next_irq = 1; 1900 devices.next_irq = 1;
1672 1901
1902 /* We're CPU 0. In fact, that's the only CPU possible right now. */
1673 cpu_id = 0; 1903 cpu_id = 0;
1674 /* We need to know how much memory so we can set up the device 1904
1905 /*
1906 * We need to know how much memory so we can set up the device
1675 * descriptor and memory pages for the devices as we parse the command 1907 * descriptor and memory pages for the devices as we parse the command
1676 * line. So we quickly look through the arguments to find the amount 1908 * line. So we quickly look through the arguments to find the amount
1677 * of memory now. */ 1909 * of memory now.
1910 */
1678 for (i = 1; i < argc; i++) { 1911 for (i = 1; i < argc; i++) {
1679 if (argv[i][0] != '-') { 1912 if (argv[i][0] != '-') {
1680 mem = atoi(argv[i]) * 1024 * 1024; 1913 mem = atoi(argv[i]) * 1024 * 1024;
1681 /* We start by mapping anonymous pages over all of 1914 /*
1915 * We start by mapping anonymous pages over all of
1682 * guest-physical memory range. This fills it with 0, 1916 * guest-physical memory range. This fills it with 0,
1683 * and ensures that the Guest won't be killed when it 1917 * and ensures that the Guest won't be killed when it
1684 * tries to access it. */ 1918 * tries to access it.
1919 */
1685 guest_base = map_zeroed_pages(mem / getpagesize() 1920 guest_base = map_zeroed_pages(mem / getpagesize()
1686 + DEVICE_PAGES); 1921 + DEVICE_PAGES);
1687 guest_limit = mem; 1922 guest_limit = mem;
@@ -1714,8 +1949,10 @@ int main(int argc, char *argv[])
1714 usage(); 1949 usage();
1715 } 1950 }
1716 } 1951 }
1717 /* After the other arguments we expect memory and kernel image name, 1952 /*
1718 * followed by command line arguments for the kernel. */ 1953 * After the other arguments we expect memory and kernel image name,
1954 * followed by command line arguments for the kernel.
1955 */
1719 if (optind + 2 > argc) 1956 if (optind + 2 > argc)
1720 usage(); 1957 usage();
1721 1958
@@ -1733,20 +1970,26 @@ int main(int argc, char *argv[])
1733 /* Map the initrd image if requested (at top of physical memory) */ 1970 /* Map the initrd image if requested (at top of physical memory) */
1734 if (initrd_name) { 1971 if (initrd_name) {
1735 initrd_size = load_initrd(initrd_name, mem); 1972 initrd_size = load_initrd(initrd_name, mem);
1736 /* These are the location in the Linux boot header where the 1973 /*
1737 * start and size of the initrd are expected to be found. */ 1974 * These are the location in the Linux boot header where the
1975 * start and size of the initrd are expected to be found.
1976 */
1738 boot->hdr.ramdisk_image = mem - initrd_size; 1977 boot->hdr.ramdisk_image = mem - initrd_size;
1739 boot->hdr.ramdisk_size = initrd_size; 1978 boot->hdr.ramdisk_size = initrd_size;
1740 /* The bootloader type 0xFF means "unknown"; that's OK. */ 1979 /* The bootloader type 0xFF means "unknown"; that's OK. */
1741 boot->hdr.type_of_loader = 0xFF; 1980 boot->hdr.type_of_loader = 0xFF;
1742 } 1981 }
1743 1982
1744 /* The Linux boot header contains an "E820" memory map: ours is a 1983 /*
1745 * simple, single region. */ 1984 * The Linux boot header contains an "E820" memory map: ours is a
1985 * simple, single region.
1986 */
1746 boot->e820_entries = 1; 1987 boot->e820_entries = 1;
1747 boot->e820_map[0] = ((struct e820entry) { 0, mem, E820_RAM }); 1988 boot->e820_map[0] = ((struct e820entry) { 0, mem, E820_RAM });
1748 /* The boot header contains a command line pointer: we put the command 1989 /*
1749 * line after the boot header. */ 1990 * The boot header contains a command line pointer: we put the command
1991 * line after the boot header.
1992 */
1750 boot->hdr.cmd_line_ptr = to_guest_phys(boot + 1); 1993 boot->hdr.cmd_line_ptr = to_guest_phys(boot + 1);
1751 /* We use a simple helper to copy the arguments separated by spaces. */ 1994 /* We use a simple helper to copy the arguments separated by spaces. */
1752 concat((char *)(boot + 1), argv+optind+2); 1995 concat((char *)(boot + 1), argv+optind+2);
@@ -1760,11 +2003,13 @@ int main(int argc, char *argv[])
1760 /* Tell the entry path not to try to reload segment registers. */ 2003 /* Tell the entry path not to try to reload segment registers. */
1761 boot->hdr.loadflags |= KEEP_SEGMENTS; 2004 boot->hdr.loadflags |= KEEP_SEGMENTS;
1762 2005
1763 /* We tell the kernel to initialize the Guest: this returns the open 2006 /*
1764 * /dev/lguest file descriptor. */ 2007 * We tell the kernel to initialize the Guest: this returns the open
2008 * /dev/lguest file descriptor.
2009 */
1765 tell_kernel(start); 2010 tell_kernel(start);
1766 2011
1767 /* Ensure that we terminate if a child dies. */ 2012 /* Ensure that we terminate if a device-servicing child dies. */
1768 signal(SIGCHLD, kill_launcher); 2013 signal(SIGCHLD, kill_launcher);
1769 2014
1770 /* If we exit via err(), this kills all the threads, restores tty. */ 2015 /* If we exit via err(), this kills all the threads, restores tty. */
diff --git a/Documentation/lockdep-design.txt b/Documentation/lockdep-design.txt
index e20d913d5914..abf768c681e2 100644
--- a/Documentation/lockdep-design.txt
+++ b/Documentation/lockdep-design.txt
@@ -30,9 +30,9 @@ State
30The validator tracks lock-class usage history into 4n + 1 separate state bits: 30The validator tracks lock-class usage history into 4n + 1 separate state bits:
31 31
32- 'ever held in STATE context' 32- 'ever held in STATE context'
33- 'ever head as readlock in STATE context' 33- 'ever held as readlock in STATE context'
34- 'ever head with STATE enabled' 34- 'ever held with STATE enabled'
35- 'ever head as readlock with STATE enabled' 35- 'ever held as readlock with STATE enabled'
36 36
37Where STATE can be either one of (kernel/lockdep_states.h) 37Where STATE can be either one of (kernel/lockdep_states.h)
38 - hardirq 38 - hardirq
diff --git a/Documentation/powerpc/booting-without-of.txt b/Documentation/powerpc/booting-without-of.txt
index 8d999d862d0e..79f533f38c61 100644
--- a/Documentation/powerpc/booting-without-of.txt
+++ b/Documentation/powerpc/booting-without-of.txt
@@ -1238,1122 +1238,7 @@ descriptions for the SOC devices for which new nodes have been
1238defined; this list will expand as more and more SOC-containing 1238defined; this list will expand as more and more SOC-containing
1239platforms are moved over to use the flattened-device-tree model. 1239platforms are moved over to use the flattened-device-tree model.
1240 1240
1241 a) PHY nodes 1241VII - Specifying interrupt information for devices
1242
1243 Required properties:
1244
1245 - device_type : Should be "ethernet-phy"
1246 - interrupts : <a b> where a is the interrupt number and b is a
1247 field that represents an encoding of the sense and level
1248 information for the interrupt. This should be encoded based on
1249 the information in section 2) depending on the type of interrupt
1250 controller you have.
1251 - interrupt-parent : the phandle for the interrupt controller that
1252 services interrupts for this device.
1253 - reg : The ID number for the phy, usually a small integer
1254 - linux,phandle : phandle for this node; likely referenced by an
1255 ethernet controller node.
1256
1257
1258 Example:
1259
1260 ethernet-phy@0 {
1261 linux,phandle = <2452000>
1262 interrupt-parent = <40000>;
1263 interrupts = <35 1>;
1264 reg = <0>;
1265 device_type = "ethernet-phy";
1266 };
1267
1268
1269 b) Interrupt controllers
1270
1271 Some SOC devices contain interrupt controllers that are different
1272 from the standard Open PIC specification. The SOC device nodes for
1273 these types of controllers should be specified just like a standard
1274 OpenPIC controller. Sense and level information should be encoded
1275 as specified in section 2) of this chapter for each device that
1276 specifies an interrupt.
1277
1278 Example :
1279
1280 pic@40000 {
1281 linux,phandle = <40000>;
1282 interrupt-controller;
1283 #address-cells = <0>;
1284 reg = <40000 40000>;
1285 compatible = "chrp,open-pic";
1286 device_type = "open-pic";
1287 };
1288
1289 c) 4xx/Axon EMAC ethernet nodes
1290
1291 The EMAC ethernet controller in IBM and AMCC 4xx chips, and also
1292 the Axon bridge. To operate this needs to interact with a ths
1293 special McMAL DMA controller, and sometimes an RGMII or ZMII
1294 interface. In addition to the nodes and properties described
1295 below, the node for the OPB bus on which the EMAC sits must have a
1296 correct clock-frequency property.
1297
1298 i) The EMAC node itself
1299
1300 Required properties:
1301 - device_type : "network"
1302
1303 - compatible : compatible list, contains 2 entries, first is
1304 "ibm,emac-CHIP" where CHIP is the host ASIC (440gx,
1305 405gp, Axon) and second is either "ibm,emac" or
1306 "ibm,emac4". For Axon, thus, we have: "ibm,emac-axon",
1307 "ibm,emac4"
1308 - interrupts : <interrupt mapping for EMAC IRQ and WOL IRQ>
1309 - interrupt-parent : optional, if needed for interrupt mapping
1310 - reg : <registers mapping>
1311 - local-mac-address : 6 bytes, MAC address
1312 - mal-device : phandle of the associated McMAL node
1313 - mal-tx-channel : 1 cell, index of the tx channel on McMAL associated
1314 with this EMAC
1315 - mal-rx-channel : 1 cell, index of the rx channel on McMAL associated
1316 with this EMAC
1317 - cell-index : 1 cell, hardware index of the EMAC cell on a given
1318 ASIC (typically 0x0 and 0x1 for EMAC0 and EMAC1 on
1319 each Axon chip)
1320 - max-frame-size : 1 cell, maximum frame size supported in bytes
1321 - rx-fifo-size : 1 cell, Rx fifo size in bytes for 10 and 100 Mb/sec
1322 operations.
1323 For Axon, 2048
1324 - tx-fifo-size : 1 cell, Tx fifo size in bytes for 10 and 100 Mb/sec
1325 operations.
1326 For Axon, 2048.
1327 - fifo-entry-size : 1 cell, size of a fifo entry (used to calculate
1328 thresholds).
1329 For Axon, 0x00000010
1330 - mal-burst-size : 1 cell, MAL burst size (used to calculate thresholds)
1331 in bytes.
1332 For Axon, 0x00000100 (I think ...)
1333 - phy-mode : string, mode of operations of the PHY interface.
1334 Supported values are: "mii", "rmii", "smii", "rgmii",
1335 "tbi", "gmii", rtbi", "sgmii".
1336 For Axon on CAB, it is "rgmii"
1337 - mdio-device : 1 cell, required iff using shared MDIO registers
1338 (440EP). phandle of the EMAC to use to drive the
1339 MDIO lines for the PHY used by this EMAC.
1340 - zmii-device : 1 cell, required iff connected to a ZMII. phandle of
1341 the ZMII device node
1342 - zmii-channel : 1 cell, required iff connected to a ZMII. Which ZMII
1343 channel or 0xffffffff if ZMII is only used for MDIO.
1344 - rgmii-device : 1 cell, required iff connected to an RGMII. phandle
1345 of the RGMII device node.
1346 For Axon: phandle of plb5/plb4/opb/rgmii
1347 - rgmii-channel : 1 cell, required iff connected to an RGMII. Which
1348 RGMII channel is used by this EMAC.
1349 Fox Axon: present, whatever value is appropriate for each
1350 EMAC, that is the content of the current (bogus) "phy-port"
1351 property.
1352
1353 Optional properties:
1354 - phy-address : 1 cell, optional, MDIO address of the PHY. If absent,
1355 a search is performed.
1356 - phy-map : 1 cell, optional, bitmap of addresses to probe the PHY
1357 for, used if phy-address is absent. bit 0x00000001 is
1358 MDIO address 0.
1359 For Axon it can be absent, though my current driver
1360 doesn't handle phy-address yet so for now, keep
1361 0x00ffffff in it.
1362 - rx-fifo-size-gige : 1 cell, Rx fifo size in bytes for 1000 Mb/sec
1363 operations (if absent the value is the same as
1364 rx-fifo-size). For Axon, either absent or 2048.
1365 - tx-fifo-size-gige : 1 cell, Tx fifo size in bytes for 1000 Mb/sec
1366 operations (if absent the value is the same as
1367 tx-fifo-size). For Axon, either absent or 2048.
1368 - tah-device : 1 cell, optional. If connected to a TAH engine for
1369 offload, phandle of the TAH device node.
1370 - tah-channel : 1 cell, optional. If appropriate, channel used on the
1371 TAH engine.
1372
1373 Example:
1374
1375 EMAC0: ethernet@40000800 {
1376 device_type = "network";
1377 compatible = "ibm,emac-440gp", "ibm,emac";
1378 interrupt-parent = <&UIC1>;
1379 interrupts = <1c 4 1d 4>;
1380 reg = <40000800 70>;
1381 local-mac-address = [00 04 AC E3 1B 1E];
1382 mal-device = <&MAL0>;
1383 mal-tx-channel = <0 1>;
1384 mal-rx-channel = <0>;
1385 cell-index = <0>;
1386 max-frame-size = <5dc>;
1387 rx-fifo-size = <1000>;
1388 tx-fifo-size = <800>;
1389 phy-mode = "rmii";
1390 phy-map = <00000001>;
1391 zmii-device = <&ZMII0>;
1392 zmii-channel = <0>;
1393 };
1394
1395 ii) McMAL node
1396
1397 Required properties:
1398 - device_type : "dma-controller"
1399 - compatible : compatible list, containing 2 entries, first is
1400 "ibm,mcmal-CHIP" where CHIP is the host ASIC (like
1401 emac) and the second is either "ibm,mcmal" or
1402 "ibm,mcmal2".
1403 For Axon, "ibm,mcmal-axon","ibm,mcmal2"
1404 - interrupts : <interrupt mapping for the MAL interrupts sources:
1405 5 sources: tx_eob, rx_eob, serr, txde, rxde>.
1406 For Axon: This is _different_ from the current
1407 firmware. We use the "delayed" interrupts for txeob
1408 and rxeob. Thus we end up with mapping those 5 MPIC
1409 interrupts, all level positive sensitive: 10, 11, 32,
1410 33, 34 (in decimal)
1411 - dcr-reg : < DCR registers range >
1412 - dcr-parent : if needed for dcr-reg
1413 - num-tx-chans : 1 cell, number of Tx channels
1414 - num-rx-chans : 1 cell, number of Rx channels
1415
1416 iii) ZMII node
1417
1418 Required properties:
1419 - compatible : compatible list, containing 2 entries, first is
1420 "ibm,zmii-CHIP" where CHIP is the host ASIC (like
1421 EMAC) and the second is "ibm,zmii".
1422 For Axon, there is no ZMII node.
1423 - reg : <registers mapping>
1424
1425 iv) RGMII node
1426
1427 Required properties:
1428 - compatible : compatible list, containing 2 entries, first is
1429 "ibm,rgmii-CHIP" where CHIP is the host ASIC (like
1430 EMAC) and the second is "ibm,rgmii".
1431 For Axon, "ibm,rgmii-axon","ibm,rgmii"
1432 - reg : <registers mapping>
1433 - revision : as provided by the RGMII new version register if
1434 available.
1435 For Axon: 0x0000012a
1436
1437 d) Xilinx IP cores
1438
1439 The Xilinx EDK toolchain ships with a set of IP cores (devices) for use
1440 in Xilinx Spartan and Virtex FPGAs. The devices cover the whole range
1441 of standard device types (network, serial, etc.) and miscellaneous
1442 devices (gpio, LCD, spi, etc). Also, since these devices are
1443 implemented within the fpga fabric every instance of the device can be
1444 synthesised with different options that change the behaviour.
1445
1446 Each IP-core has a set of parameters which the FPGA designer can use to
1447 control how the core is synthesized. Historically, the EDK tool would
1448 extract the device parameters relevant to device drivers and copy them
1449 into an 'xparameters.h' in the form of #define symbols. This tells the
1450 device drivers how the IP cores are configured, but it requres the kernel
1451 to be recompiled every time the FPGA bitstream is resynthesized.
1452
1453 The new approach is to export the parameters into the device tree and
1454 generate a new device tree each time the FPGA bitstream changes. The
1455 parameters which used to be exported as #defines will now become
1456 properties of the device node. In general, device nodes for IP-cores
1457 will take the following form:
1458
1459 (name): (generic-name)@(base-address) {
1460 compatible = "xlnx,(ip-core-name)-(HW_VER)"
1461 [, (list of compatible devices), ...];
1462 reg = <(baseaddr) (size)>;
1463 interrupt-parent = <&interrupt-controller-phandle>;
1464 interrupts = < ... >;
1465 xlnx,(parameter1) = "(string-value)";
1466 xlnx,(parameter2) = <(int-value)>;
1467 };
1468
1469 (generic-name): an open firmware-style name that describes the
1470 generic class of device. Preferably, this is one word, such
1471 as 'serial' or 'ethernet'.
1472 (ip-core-name): the name of the ip block (given after the BEGIN
1473 directive in system.mhs). Should be in lowercase
1474 and all underscores '_' converted to dashes '-'.
1475 (name): is derived from the "PARAMETER INSTANCE" value.
1476 (parameter#): C_* parameters from system.mhs. The C_ prefix is
1477 dropped from the parameter name, the name is converted
1478 to lowercase and all underscore '_' characters are
1479 converted to dashes '-'.
1480 (baseaddr): the baseaddr parameter value (often named C_BASEADDR).
1481 (HW_VER): from the HW_VER parameter.
1482 (size): the address range size (often C_HIGHADDR - C_BASEADDR + 1).
1483
1484 Typically, the compatible list will include the exact IP core version
1485 followed by an older IP core version which implements the same
1486 interface or any other device with the same interface.
1487
1488 'reg', 'interrupt-parent' and 'interrupts' are all optional properties.
1489
1490 For example, the following block from system.mhs:
1491
1492 BEGIN opb_uartlite
1493 PARAMETER INSTANCE = opb_uartlite_0
1494 PARAMETER HW_VER = 1.00.b
1495 PARAMETER C_BAUDRATE = 115200
1496 PARAMETER C_DATA_BITS = 8
1497 PARAMETER C_ODD_PARITY = 0
1498 PARAMETER C_USE_PARITY = 0
1499 PARAMETER C_CLK_FREQ = 50000000
1500 PARAMETER C_BASEADDR = 0xEC100000
1501 PARAMETER C_HIGHADDR = 0xEC10FFFF
1502 BUS_INTERFACE SOPB = opb_7
1503 PORT OPB_Clk = CLK_50MHz
1504 PORT Interrupt = opb_uartlite_0_Interrupt
1505 PORT RX = opb_uartlite_0_RX
1506 PORT TX = opb_uartlite_0_TX
1507 PORT OPB_Rst = sys_bus_reset_0
1508 END
1509
1510 becomes the following device tree node:
1511
1512 opb_uartlite_0: serial@ec100000 {
1513 device_type = "serial";
1514 compatible = "xlnx,opb-uartlite-1.00.b";
1515 reg = <ec100000 10000>;
1516 interrupt-parent = <&opb_intc_0>;
1517 interrupts = <1 0>; // got this from the opb_intc parameters
1518 current-speed = <d#115200>; // standard serial device prop
1519 clock-frequency = <d#50000000>; // standard serial device prop
1520 xlnx,data-bits = <8>;
1521 xlnx,odd-parity = <0>;
1522 xlnx,use-parity = <0>;
1523 };
1524
1525 Some IP cores actually implement 2 or more logical devices. In
1526 this case, the device should still describe the whole IP core with
1527 a single node and add a child node for each logical device. The
1528 ranges property can be used to translate from parent IP-core to the
1529 registers of each device. In addition, the parent node should be
1530 compatible with the bus type 'xlnx,compound', and should contain
1531 #address-cells and #size-cells, as with any other bus. (Note: this
1532 makes the assumption that both logical devices have the same bus
1533 binding. If this is not true, then separate nodes should be used
1534 for each logical device). The 'cell-index' property can be used to
1535 enumerate logical devices within an IP core. For example, the
1536 following is the system.mhs entry for the dual ps2 controller found
1537 on the ml403 reference design.
1538
1539 BEGIN opb_ps2_dual_ref
1540 PARAMETER INSTANCE = opb_ps2_dual_ref_0
1541 PARAMETER HW_VER = 1.00.a
1542 PARAMETER C_BASEADDR = 0xA9000000
1543 PARAMETER C_HIGHADDR = 0xA9001FFF
1544 BUS_INTERFACE SOPB = opb_v20_0
1545 PORT Sys_Intr1 = ps2_1_intr
1546 PORT Sys_Intr2 = ps2_2_intr
1547 PORT Clkin1 = ps2_clk_rx_1
1548 PORT Clkin2 = ps2_clk_rx_2
1549 PORT Clkpd1 = ps2_clk_tx_1
1550 PORT Clkpd2 = ps2_clk_tx_2
1551 PORT Rx1 = ps2_d_rx_1
1552 PORT Rx2 = ps2_d_rx_2
1553 PORT Txpd1 = ps2_d_tx_1
1554 PORT Txpd2 = ps2_d_tx_2
1555 END
1556
1557 It would result in the following device tree nodes:
1558
1559 opb_ps2_dual_ref_0: opb-ps2-dual-ref@a9000000 {
1560 #address-cells = <1>;
1561 #size-cells = <1>;
1562 compatible = "xlnx,compound";
1563 ranges = <0 a9000000 2000>;
1564 // If this device had extra parameters, then they would
1565 // go here.
1566 ps2@0 {
1567 compatible = "xlnx,opb-ps2-dual-ref-1.00.a";
1568 reg = <0 40>;
1569 interrupt-parent = <&opb_intc_0>;
1570 interrupts = <3 0>;
1571 cell-index = <0>;
1572 };
1573 ps2@1000 {
1574 compatible = "xlnx,opb-ps2-dual-ref-1.00.a";
1575 reg = <1000 40>;
1576 interrupt-parent = <&opb_intc_0>;
1577 interrupts = <3 0>;
1578 cell-index = <0>;
1579 };
1580 };
1581
1582 Also, the system.mhs file defines bus attachments from the processor
1583 to the devices. The device tree structure should reflect the bus
1584 attachments. Again an example; this system.mhs fragment:
1585
1586 BEGIN ppc405_virtex4
1587 PARAMETER INSTANCE = ppc405_0
1588 PARAMETER HW_VER = 1.01.a
1589 BUS_INTERFACE DPLB = plb_v34_0
1590 BUS_INTERFACE IPLB = plb_v34_0
1591 END
1592
1593 BEGIN opb_intc
1594 PARAMETER INSTANCE = opb_intc_0
1595 PARAMETER HW_VER = 1.00.c
1596 PARAMETER C_BASEADDR = 0xD1000FC0
1597 PARAMETER C_HIGHADDR = 0xD1000FDF
1598 BUS_INTERFACE SOPB = opb_v20_0
1599 END
1600
1601 BEGIN opb_uart16550
1602 PARAMETER INSTANCE = opb_uart16550_0
1603 PARAMETER HW_VER = 1.00.d
1604 PARAMETER C_BASEADDR = 0xa0000000
1605 PARAMETER C_HIGHADDR = 0xa0001FFF
1606 BUS_INTERFACE SOPB = opb_v20_0
1607 END
1608
1609 BEGIN plb_v34
1610 PARAMETER INSTANCE = plb_v34_0
1611 PARAMETER HW_VER = 1.02.a
1612 END
1613
1614 BEGIN plb_bram_if_cntlr
1615 PARAMETER INSTANCE = plb_bram_if_cntlr_0
1616 PARAMETER HW_VER = 1.00.b
1617 PARAMETER C_BASEADDR = 0xFFFF0000
1618 PARAMETER C_HIGHADDR = 0xFFFFFFFF
1619 BUS_INTERFACE SPLB = plb_v34_0
1620 END
1621
1622 BEGIN plb2opb_bridge
1623 PARAMETER INSTANCE = plb2opb_bridge_0
1624 PARAMETER HW_VER = 1.01.a
1625 PARAMETER C_RNG0_BASEADDR = 0x20000000
1626 PARAMETER C_RNG0_HIGHADDR = 0x3FFFFFFF
1627 PARAMETER C_RNG1_BASEADDR = 0x60000000
1628 PARAMETER C_RNG1_HIGHADDR = 0x7FFFFFFF
1629 PARAMETER C_RNG2_BASEADDR = 0x80000000
1630 PARAMETER C_RNG2_HIGHADDR = 0xBFFFFFFF
1631 PARAMETER C_RNG3_BASEADDR = 0xC0000000
1632 PARAMETER C_RNG3_HIGHADDR = 0xDFFFFFFF
1633 BUS_INTERFACE SPLB = plb_v34_0
1634 BUS_INTERFACE MOPB = opb_v20_0
1635 END
1636
1637 Gives this device tree (some properties removed for clarity):
1638
1639 plb@0 {
1640 #address-cells = <1>;
1641 #size-cells = <1>;
1642 compatible = "xlnx,plb-v34-1.02.a";
1643 device_type = "ibm,plb";
1644 ranges; // 1:1 translation
1645
1646 plb_bram_if_cntrl_0: bram@ffff0000 {
1647 reg = <ffff0000 10000>;
1648 }
1649
1650 opb@20000000 {
1651 #address-cells = <1>;
1652 #size-cells = <1>;
1653 ranges = <20000000 20000000 20000000
1654 60000000 60000000 20000000
1655 80000000 80000000 40000000
1656 c0000000 c0000000 20000000>;
1657
1658 opb_uart16550_0: serial@a0000000 {
1659 reg = <a00000000 2000>;
1660 };
1661
1662 opb_intc_0: interrupt-controller@d1000fc0 {
1663 reg = <d1000fc0 20>;
1664 };
1665 };
1666 };
1667
1668 That covers the general approach to binding xilinx IP cores into the
1669 device tree. The following are bindings for specific devices:
1670
1671 i) Xilinx ML300 Framebuffer
1672
1673 Simple framebuffer device from the ML300 reference design (also on the
1674 ML403 reference design as well as others).
1675
1676 Optional properties:
1677 - resolution = <xres yres> : pixel resolution of framebuffer. Some
1678 implementations use a different resolution.
1679 Default is <d#640 d#480>
1680 - virt-resolution = <xvirt yvirt> : Size of framebuffer in memory.
1681 Default is <d#1024 d#480>.
1682 - rotate-display (empty) : rotate display 180 degrees.
1683
1684 ii) Xilinx SystemACE
1685
1686 The Xilinx SystemACE device is used to program FPGAs from an FPGA
1687 bitstream stored on a CF card. It can also be used as a generic CF
1688 interface device.
1689
1690 Optional properties:
1691 - 8-bit (empty) : Set this property for SystemACE in 8 bit mode
1692
1693 iii) Xilinx EMAC and Xilinx TEMAC
1694
1695 Xilinx Ethernet devices. In addition to general xilinx properties
1696 listed above, nodes for these devices should include a phy-handle
1697 property, and may include other common network device properties
1698 like local-mac-address.
1699
1700 iv) Xilinx Uartlite
1701
1702 Xilinx uartlite devices are simple fixed speed serial ports.
1703
1704 Required properties:
1705 - current-speed : Baud rate of uartlite
1706
1707 v) Xilinx hwicap
1708
1709 Xilinx hwicap devices provide access to the configuration logic
1710 of the FPGA through the Internal Configuration Access Port
1711 (ICAP). The ICAP enables partial reconfiguration of the FPGA,
1712 readback of the configuration information, and some control over
1713 'warm boots' of the FPGA fabric.
1714
1715 Required properties:
1716 - xlnx,family : The family of the FPGA, necessary since the
1717 capabilities of the underlying ICAP hardware
1718 differ between different families. May be
1719 'virtex2p', 'virtex4', or 'virtex5'.
1720
1721 vi) Xilinx Uart 16550
1722
1723 Xilinx UART 16550 devices are very similar to the NS16550 but with
1724 different register spacing and an offset from the base address.
1725
1726 Required properties:
1727 - clock-frequency : Frequency of the clock input
1728 - reg-offset : A value of 3 is required
1729 - reg-shift : A value of 2 is required
1730
1731 e) USB EHCI controllers
1732
1733 Required properties:
1734 - compatible : should be "usb-ehci".
1735 - reg : should contain at least address and length of the standard EHCI
1736 register set for the device. Optional platform-dependent registers
1737 (debug-port or other) can be also specified here, but only after
1738 definition of standard EHCI registers.
1739 - interrupts : one EHCI interrupt should be described here.
1740 If device registers are implemented in big endian mode, the device
1741 node should have "big-endian-regs" property.
1742 If controller implementation operates with big endian descriptors,
1743 "big-endian-desc" property should be specified.
1744 If both big endian registers and descriptors are used by the controller
1745 implementation, "big-endian" property can be specified instead of having
1746 both "big-endian-regs" and "big-endian-desc".
1747
1748 Example (Sequoia 440EPx):
1749 ehci@e0000300 {
1750 compatible = "ibm,usb-ehci-440epx", "usb-ehci";
1751 interrupt-parent = <&UIC0>;
1752 interrupts = <1a 4>;
1753 reg = <0 e0000300 90 0 e0000390 70>;
1754 big-endian;
1755 };
1756
1757 f) MDIO on GPIOs
1758
1759 Currently defined compatibles:
1760 - virtual,gpio-mdio
1761
1762 MDC and MDIO lines connected to GPIO controllers are listed in the
1763 gpios property as described in section VIII.1 in the following order:
1764
1765 MDC, MDIO.
1766
1767 Example:
1768
1769 mdio {
1770 compatible = "virtual,mdio-gpio";
1771 #address-cells = <1>;
1772 #size-cells = <0>;
1773 gpios = <&qe_pio_a 11
1774 &qe_pio_c 6>;
1775 };
1776
1777 g) SPI (Serial Peripheral Interface) busses
1778
1779 SPI busses can be described with a node for the SPI master device
1780 and a set of child nodes for each SPI slave on the bus. For this
1781 discussion, it is assumed that the system's SPI controller is in
1782 SPI master mode. This binding does not describe SPI controllers
1783 in slave mode.
1784
1785 The SPI master node requires the following properties:
1786 - #address-cells - number of cells required to define a chip select
1787 address on the SPI bus.
1788 - #size-cells - should be zero.
1789 - compatible - name of SPI bus controller following generic names
1790 recommended practice.
1791 No other properties are required in the SPI bus node. It is assumed
1792 that a driver for an SPI bus device will understand that it is an SPI bus.
1793 However, the binding does not attempt to define the specific method for
1794 assigning chip select numbers. Since SPI chip select configuration is
1795 flexible and non-standardized, it is left out of this binding with the
1796 assumption that board specific platform code will be used to manage
1797 chip selects. Individual drivers can define additional properties to
1798 support describing the chip select layout.
1799
1800 SPI slave nodes must be children of the SPI master node and can
1801 contain the following properties.
1802 - reg - (required) chip select address of device.
1803 - compatible - (required) name of SPI device following generic names
1804 recommended practice
1805 - spi-max-frequency - (required) Maximum SPI clocking speed of device in Hz
1806 - spi-cpol - (optional) Empty property indicating device requires
1807 inverse clock polarity (CPOL) mode
1808 - spi-cpha - (optional) Empty property indicating device requires
1809 shifted clock phase (CPHA) mode
1810 - spi-cs-high - (optional) Empty property indicating device requires
1811 chip select active high
1812
1813 SPI example for an MPC5200 SPI bus:
1814 spi@f00 {
1815 #address-cells = <1>;
1816 #size-cells = <0>;
1817 compatible = "fsl,mpc5200b-spi","fsl,mpc5200-spi";
1818 reg = <0xf00 0x20>;
1819 interrupts = <2 13 0 2 14 0>;
1820 interrupt-parent = <&mpc5200_pic>;
1821
1822 ethernet-switch@0 {
1823 compatible = "micrel,ks8995m";
1824 spi-max-frequency = <1000000>;
1825 reg = <0>;
1826 };
1827
1828 codec@1 {
1829 compatible = "ti,tlv320aic26";
1830 spi-max-frequency = <100000>;
1831 reg = <1>;
1832 };
1833 };
1834
1835VII - Marvell Discovery mv64[345]6x System Controller chips
1836===========================================================
1837
1838The Marvell mv64[345]60 series of system controller chips contain
1839many of the peripherals needed to implement a complete computer
1840system. In this section, we define device tree nodes to describe
1841the system controller chip itself and each of the peripherals
1842which it contains. Compatible string values for each node are
1843prefixed with the string "marvell,", for Marvell Technology Group Ltd.
1844
18451) The /system-controller node
1846
1847 This node is used to represent the system-controller and must be
1848 present when the system uses a system controller chip. The top-level
1849 system-controller node contains information that is global to all
1850 devices within the system controller chip. The node name begins
1851 with "system-controller" followed by the unit address, which is
1852 the base address of the memory-mapped register set for the system
1853 controller chip.
1854
1855 Required properties:
1856
1857 - ranges : Describes the translation of system controller addresses
1858 for memory mapped registers.
1859 - clock-frequency: Contains the main clock frequency for the system
1860 controller chip.
1861 - reg : This property defines the address and size of the
1862 memory-mapped registers contained within the system controller
1863 chip. The address specified in the "reg" property should match
1864 the unit address of the system-controller node.
1865 - #address-cells : Address representation for system controller
1866 devices. This field represents the number of cells needed to
1867 represent the address of the memory-mapped registers of devices
1868 within the system controller chip.
1869 - #size-cells : Size representation for for the memory-mapped
1870 registers within the system controller chip.
1871 - #interrupt-cells : Defines the width of cells used to represent
1872 interrupts.
1873
1874 Optional properties:
1875
1876 - model : The specific model of the system controller chip. Such
1877 as, "mv64360", "mv64460", or "mv64560".
1878 - compatible : A string identifying the compatibility identifiers
1879 of the system controller chip.
1880
1881 The system-controller node contains child nodes for each system
1882 controller device that the platform uses. Nodes should not be created
1883 for devices which exist on the system controller chip but are not used
1884
1885 Example Marvell Discovery mv64360 system-controller node:
1886
1887 system-controller@f1000000 { /* Marvell Discovery mv64360 */
1888 #address-cells = <1>;
1889 #size-cells = <1>;
1890 model = "mv64360"; /* Default */
1891 compatible = "marvell,mv64360";
1892 clock-frequency = <133333333>;
1893 reg = <0xf1000000 0x10000>;
1894 virtual-reg = <0xf1000000>;
1895 ranges = <0x88000000 0x88000000 0x1000000 /* PCI 0 I/O Space */
1896 0x80000000 0x80000000 0x8000000 /* PCI 0 MEM Space */
1897 0xa0000000 0xa0000000 0x4000000 /* User FLASH */
1898 0x00000000 0xf1000000 0x0010000 /* Bridge's regs */
1899 0xf2000000 0xf2000000 0x0040000>;/* Integrated SRAM */
1900
1901 [ child node definitions... ]
1902 }
1903
19042) Child nodes of /system-controller
1905
1906 a) Marvell Discovery MDIO bus
1907
1908 The MDIO is a bus to which the PHY devices are connected. For each
1909 device that exists on this bus, a child node should be created. See
1910 the definition of the PHY node below for an example of how to define
1911 a PHY.
1912
1913 Required properties:
1914 - #address-cells : Should be <1>
1915 - #size-cells : Should be <0>
1916 - device_type : Should be "mdio"
1917 - compatible : Should be "marvell,mv64360-mdio"
1918
1919 Example:
1920
1921 mdio {
1922 #address-cells = <1>;
1923 #size-cells = <0>;
1924 device_type = "mdio";
1925 compatible = "marvell,mv64360-mdio";
1926
1927 ethernet-phy@0 {
1928 ......
1929 };
1930 };
1931
1932
1933 b) Marvell Discovery ethernet controller
1934
1935 The Discover ethernet controller is described with two levels
1936 of nodes. The first level describes an ethernet silicon block
1937 and the second level describes up to 3 ethernet nodes within
1938 that block. The reason for the multiple levels is that the
1939 registers for the node are interleaved within a single set
1940 of registers. The "ethernet-block" level describes the
1941 shared register set, and the "ethernet" nodes describe ethernet
1942 port-specific properties.
1943
1944 Ethernet block node
1945
1946 Required properties:
1947 - #address-cells : <1>
1948 - #size-cells : <0>
1949 - compatible : "marvell,mv64360-eth-block"
1950 - reg : Offset and length of the register set for this block
1951
1952 Example Discovery Ethernet block node:
1953 ethernet-block@2000 {
1954 #address-cells = <1>;
1955 #size-cells = <0>;
1956 compatible = "marvell,mv64360-eth-block";
1957 reg = <0x2000 0x2000>;
1958 ethernet@0 {
1959 .......
1960 };
1961 };
1962
1963 Ethernet port node
1964
1965 Required properties:
1966 - device_type : Should be "network".
1967 - compatible : Should be "marvell,mv64360-eth".
1968 - reg : Should be <0>, <1>, or <2>, according to which registers
1969 within the silicon block the device uses.
1970 - interrupts : <a> where a is the interrupt number for the port.
1971 - interrupt-parent : the phandle for the interrupt controller
1972 that services interrupts for this device.
1973 - phy : the phandle for the PHY connected to this ethernet
1974 controller.
1975 - local-mac-address : 6 bytes, MAC address
1976
1977 Example Discovery Ethernet port node:
1978 ethernet@0 {
1979 device_type = "network";
1980 compatible = "marvell,mv64360-eth";
1981 reg = <0>;
1982 interrupts = <32>;
1983 interrupt-parent = <&PIC>;
1984 phy = <&PHY0>;
1985 local-mac-address = [ 00 00 00 00 00 00 ];
1986 };
1987
1988
1989
1990 c) Marvell Discovery PHY nodes
1991
1992 Required properties:
1993 - device_type : Should be "ethernet-phy"
1994 - interrupts : <a> where a is the interrupt number for this phy.
1995 - interrupt-parent : the phandle for the interrupt controller that
1996 services interrupts for this device.
1997 - reg : The ID number for the phy, usually a small integer
1998
1999 Example Discovery PHY node:
2000 ethernet-phy@1 {
2001 device_type = "ethernet-phy";
2002 compatible = "broadcom,bcm5421";
2003 interrupts = <76>; /* GPP 12 */
2004 interrupt-parent = <&PIC>;
2005 reg = <1>;
2006 };
2007
2008
2009 d) Marvell Discovery SDMA nodes
2010
2011 Represent DMA hardware associated with the MPSC (multiprotocol
2012 serial controllers).
2013
2014 Required properties:
2015 - compatible : "marvell,mv64360-sdma"
2016 - reg : Offset and length of the register set for this device
2017 - interrupts : <a> where a is the interrupt number for the DMA
2018 device.
2019 - interrupt-parent : the phandle for the interrupt controller
2020 that services interrupts for this device.
2021
2022 Example Discovery SDMA node:
2023 sdma@4000 {
2024 compatible = "marvell,mv64360-sdma";
2025 reg = <0x4000 0xc18>;
2026 virtual-reg = <0xf1004000>;
2027 interrupts = <36>;
2028 interrupt-parent = <&PIC>;
2029 };
2030
2031
2032 e) Marvell Discovery BRG nodes
2033
2034 Represent baud rate generator hardware associated with the MPSC
2035 (multiprotocol serial controllers).
2036
2037 Required properties:
2038 - compatible : "marvell,mv64360-brg"
2039 - reg : Offset and length of the register set for this device
2040 - clock-src : A value from 0 to 15 which selects the clock
2041 source for the baud rate generator. This value corresponds
2042 to the CLKS value in the BRGx configuration register. See
2043 the mv64x60 User's Manual.
2044 - clock-frequence : The frequency (in Hz) of the baud rate
2045 generator's input clock.
2046 - current-speed : The current speed setting (presumably by
2047 firmware) of the baud rate generator.
2048
2049 Example Discovery BRG node:
2050 brg@b200 {
2051 compatible = "marvell,mv64360-brg";
2052 reg = <0xb200 0x8>;
2053 clock-src = <8>;
2054 clock-frequency = <133333333>;
2055 current-speed = <9600>;
2056 };
2057
2058
2059 f) Marvell Discovery CUNIT nodes
2060
2061 Represent the Serial Communications Unit device hardware.
2062
2063 Required properties:
2064 - reg : Offset and length of the register set for this device
2065
2066 Example Discovery CUNIT node:
2067 cunit@f200 {
2068 reg = <0xf200 0x200>;
2069 };
2070
2071
2072 g) Marvell Discovery MPSCROUTING nodes
2073
2074 Represent the Discovery's MPSC routing hardware
2075
2076 Required properties:
2077 - reg : Offset and length of the register set for this device
2078
2079 Example Discovery CUNIT node:
2080 mpscrouting@b500 {
2081 reg = <0xb400 0xc>;
2082 };
2083
2084
2085 h) Marvell Discovery MPSCINTR nodes
2086
2087 Represent the Discovery's MPSC DMA interrupt hardware registers
2088 (SDMA cause and mask registers).
2089
2090 Required properties:
2091 - reg : Offset and length of the register set for this device
2092
2093 Example Discovery MPSCINTR node:
2094 mpsintr@b800 {
2095 reg = <0xb800 0x100>;
2096 };
2097
2098
2099 i) Marvell Discovery MPSC nodes
2100
2101 Represent the Discovery's MPSC (Multiprotocol Serial Controller)
2102 serial port.
2103
2104 Required properties:
2105 - device_type : "serial"
2106 - compatible : "marvell,mv64360-mpsc"
2107 - reg : Offset and length of the register set for this device
2108 - sdma : the phandle for the SDMA node used by this port
2109 - brg : the phandle for the BRG node used by this port
2110 - cunit : the phandle for the CUNIT node used by this port
2111 - mpscrouting : the phandle for the MPSCROUTING node used by this port
2112 - mpscintr : the phandle for the MPSCINTR node used by this port
2113 - cell-index : the hardware index of this cell in the MPSC core
2114 - max_idle : value needed for MPSC CHR3 (Maximum Frame Length)
2115 register
2116 - interrupts : <a> where a is the interrupt number for the MPSC.
2117 - interrupt-parent : the phandle for the interrupt controller
2118 that services interrupts for this device.
2119
2120 Example Discovery MPSCINTR node:
2121 mpsc@8000 {
2122 device_type = "serial";
2123 compatible = "marvell,mv64360-mpsc";
2124 reg = <0x8000 0x38>;
2125 virtual-reg = <0xf1008000>;
2126 sdma = <&SDMA0>;
2127 brg = <&BRG0>;
2128 cunit = <&CUNIT>;
2129 mpscrouting = <&MPSCROUTING>;
2130 mpscintr = <&MPSCINTR>;
2131 cell-index = <0>;
2132 max_idle = <40>;
2133 interrupts = <40>;
2134 interrupt-parent = <&PIC>;
2135 };
2136
2137
2138 j) Marvell Discovery Watch Dog Timer nodes
2139
2140 Represent the Discovery's watchdog timer hardware
2141
2142 Required properties:
2143 - compatible : "marvell,mv64360-wdt"
2144 - reg : Offset and length of the register set for this device
2145
2146 Example Discovery Watch Dog Timer node:
2147 wdt@b410 {
2148 compatible = "marvell,mv64360-wdt";
2149 reg = <0xb410 0x8>;
2150 };
2151
2152
2153 k) Marvell Discovery I2C nodes
2154
2155 Represent the Discovery's I2C hardware
2156
2157 Required properties:
2158 - device_type : "i2c"
2159 - compatible : "marvell,mv64360-i2c"
2160 - reg : Offset and length of the register set for this device
2161 - interrupts : <a> where a is the interrupt number for the I2C.
2162 - interrupt-parent : the phandle for the interrupt controller
2163 that services interrupts for this device.
2164
2165 Example Discovery I2C node:
2166 compatible = "marvell,mv64360-i2c";
2167 reg = <0xc000 0x20>;
2168 virtual-reg = <0xf100c000>;
2169 interrupts = <37>;
2170 interrupt-parent = <&PIC>;
2171 };
2172
2173
2174 l) Marvell Discovery PIC (Programmable Interrupt Controller) nodes
2175
2176 Represent the Discovery's PIC hardware
2177
2178 Required properties:
2179 - #interrupt-cells : <1>
2180 - #address-cells : <0>
2181 - compatible : "marvell,mv64360-pic"
2182 - reg : Offset and length of the register set for this device
2183 - interrupt-controller
2184
2185 Example Discovery PIC node:
2186 pic {
2187 #interrupt-cells = <1>;
2188 #address-cells = <0>;
2189 compatible = "marvell,mv64360-pic";
2190 reg = <0x0 0x88>;
2191 interrupt-controller;
2192 };
2193
2194
2195 m) Marvell Discovery MPP (Multipurpose Pins) multiplexing nodes
2196
2197 Represent the Discovery's MPP hardware
2198
2199 Required properties:
2200 - compatible : "marvell,mv64360-mpp"
2201 - reg : Offset and length of the register set for this device
2202
2203 Example Discovery MPP node:
2204 mpp@f000 {
2205 compatible = "marvell,mv64360-mpp";
2206 reg = <0xf000 0x10>;
2207 };
2208
2209
2210 n) Marvell Discovery GPP (General Purpose Pins) nodes
2211
2212 Represent the Discovery's GPP hardware
2213
2214 Required properties:
2215 - compatible : "marvell,mv64360-gpp"
2216 - reg : Offset and length of the register set for this device
2217
2218 Example Discovery GPP node:
2219 gpp@f000 {
2220 compatible = "marvell,mv64360-gpp";
2221 reg = <0xf100 0x20>;
2222 };
2223
2224
2225 o) Marvell Discovery PCI host bridge node
2226
2227 Represents the Discovery's PCI host bridge device. The properties
2228 for this node conform to Rev 2.1 of the PCI Bus Binding to IEEE
2229 1275-1994. A typical value for the compatible property is
2230 "marvell,mv64360-pci".
2231
2232 Example Discovery PCI host bridge node
2233 pci@80000000 {
2234 #address-cells = <3>;
2235 #size-cells = <2>;
2236 #interrupt-cells = <1>;
2237 device_type = "pci";
2238 compatible = "marvell,mv64360-pci";
2239 reg = <0xcf8 0x8>;
2240 ranges = <0x01000000 0x0 0x0
2241 0x88000000 0x0 0x01000000
2242 0x02000000 0x0 0x80000000
2243 0x80000000 0x0 0x08000000>;
2244 bus-range = <0 255>;
2245 clock-frequency = <66000000>;
2246 interrupt-parent = <&PIC>;
2247 interrupt-map-mask = <0xf800 0x0 0x0 0x7>;
2248 interrupt-map = <
2249 /* IDSEL 0x0a */
2250 0x5000 0 0 1 &PIC 80
2251 0x5000 0 0 2 &PIC 81
2252 0x5000 0 0 3 &PIC 91
2253 0x5000 0 0 4 &PIC 93
2254
2255 /* IDSEL 0x0b */
2256 0x5800 0 0 1 &PIC 91
2257 0x5800 0 0 2 &PIC 93
2258 0x5800 0 0 3 &PIC 80
2259 0x5800 0 0 4 &PIC 81
2260
2261 /* IDSEL 0x0c */
2262 0x6000 0 0 1 &PIC 91
2263 0x6000 0 0 2 &PIC 93
2264 0x6000 0 0 3 &PIC 80
2265 0x6000 0 0 4 &PIC 81
2266
2267 /* IDSEL 0x0d */
2268 0x6800 0 0 1 &PIC 93
2269 0x6800 0 0 2 &PIC 80
2270 0x6800 0 0 3 &PIC 81
2271 0x6800 0 0 4 &PIC 91
2272 >;
2273 };
2274
2275
2276 p) Marvell Discovery CPU Error nodes
2277
2278 Represent the Discovery's CPU error handler device.
2279
2280 Required properties:
2281 - compatible : "marvell,mv64360-cpu-error"
2282 - reg : Offset and length of the register set for this device
2283 - interrupts : the interrupt number for this device
2284 - interrupt-parent : the phandle for the interrupt controller
2285 that services interrupts for this device.
2286
2287 Example Discovery CPU Error node:
2288 cpu-error@0070 {
2289 compatible = "marvell,mv64360-cpu-error";
2290 reg = <0x70 0x10 0x128 0x28>;
2291 interrupts = <3>;
2292 interrupt-parent = <&PIC>;
2293 };
2294
2295
2296 q) Marvell Discovery SRAM Controller nodes
2297
2298 Represent the Discovery's SRAM controller device.
2299
2300 Required properties:
2301 - compatible : "marvell,mv64360-sram-ctrl"
2302 - reg : Offset and length of the register set for this device
2303 - interrupts : the interrupt number for this device
2304 - interrupt-parent : the phandle for the interrupt controller
2305 that services interrupts for this device.
2306
2307 Example Discovery SRAM Controller node:
2308 sram-ctrl@0380 {
2309 compatible = "marvell,mv64360-sram-ctrl";
2310 reg = <0x380 0x80>;
2311 interrupts = <13>;
2312 interrupt-parent = <&PIC>;
2313 };
2314
2315
2316 r) Marvell Discovery PCI Error Handler nodes
2317
2318 Represent the Discovery's PCI error handler device.
2319
2320 Required properties:
2321 - compatible : "marvell,mv64360-pci-error"
2322 - reg : Offset and length of the register set for this device
2323 - interrupts : the interrupt number for this device
2324 - interrupt-parent : the phandle for the interrupt controller
2325 that services interrupts for this device.
2326
2327 Example Discovery PCI Error Handler node:
2328 pci-error@1d40 {
2329 compatible = "marvell,mv64360-pci-error";
2330 reg = <0x1d40 0x40 0xc28 0x4>;
2331 interrupts = <12>;
2332 interrupt-parent = <&PIC>;
2333 };
2334
2335
2336 s) Marvell Discovery Memory Controller nodes
2337
2338 Represent the Discovery's memory controller device.
2339
2340 Required properties:
2341 - compatible : "marvell,mv64360-mem-ctrl"
2342 - reg : Offset and length of the register set for this device
2343 - interrupts : the interrupt number for this device
2344 - interrupt-parent : the phandle for the interrupt controller
2345 that services interrupts for this device.
2346
2347 Example Discovery Memory Controller node:
2348 mem-ctrl@1400 {
2349 compatible = "marvell,mv64360-mem-ctrl";
2350 reg = <0x1400 0x60>;
2351 interrupts = <17>;
2352 interrupt-parent = <&PIC>;
2353 };
2354
2355
2356VIII - Specifying interrupt information for devices
2357=================================================== 1242===================================================
2358 1243
2359The device tree represents the busses and devices of a hardware 1244The device tree represents the busses and devices of a hardware
@@ -2439,56 +1324,7 @@ encodings listed below:
2439 2 = high to low edge sensitive type enabled 1324 2 = high to low edge sensitive type enabled
2440 3 = low to high edge sensitive type enabled 1325 3 = low to high edge sensitive type enabled
2441 1326
2442IX - Specifying GPIO information for devices 1327VIII - Specifying Device Power Management Information (sleep property)
2443============================================
2444
24451) gpios property
2446-----------------
2447
2448Nodes that makes use of GPIOs should define them using `gpios' property,
2449format of which is: <&gpio-controller1-phandle gpio1-specifier
2450 &gpio-controller2-phandle gpio2-specifier
2451 0 /* holes are permitted, means no GPIO 3 */
2452 &gpio-controller4-phandle gpio4-specifier
2453 ...>;
2454
2455Note that gpio-specifier length is controller dependent.
2456
2457gpio-specifier may encode: bank, pin position inside the bank,
2458whether pin is open-drain and whether pin is logically inverted.
2459
2460Example of the node using GPIOs:
2461
2462 node {
2463 gpios = <&qe_pio_e 18 0>;
2464 };
2465
2466In this example gpio-specifier is "18 0" and encodes GPIO pin number,
2467and empty GPIO flags as accepted by the "qe_pio_e" gpio-controller.
2468
24692) gpio-controller nodes
2470------------------------
2471
2472Every GPIO controller node must have #gpio-cells property defined,
2473this information will be used to translate gpio-specifiers.
2474
2475Example of two SOC GPIO banks defined as gpio-controller nodes:
2476
2477 qe_pio_a: gpio-controller@1400 {
2478 #gpio-cells = <2>;
2479 compatible = "fsl,qe-pario-bank-a", "fsl,qe-pario-bank";
2480 reg = <0x1400 0x18>;
2481 gpio-controller;
2482 };
2483
2484 qe_pio_e: gpio-controller@1460 {
2485 #gpio-cells = <2>;
2486 compatible = "fsl,qe-pario-bank-e", "fsl,qe-pario-bank";
2487 reg = <0x1460 0x18>;
2488 gpio-controller;
2489 };
2490
2491X - Specifying Device Power Management Information (sleep property)
2492=================================================================== 1328===================================================================
2493 1329
2494Devices on SOCs often have mechanisms for placing devices into low-power 1330Devices on SOCs often have mechanisms for placing devices into low-power
diff --git a/Documentation/powerpc/dts-bindings/4xx/emac.txt b/Documentation/powerpc/dts-bindings/4xx/emac.txt
new file mode 100644
index 000000000000..2161334a7ca5
--- /dev/null
+++ b/Documentation/powerpc/dts-bindings/4xx/emac.txt
@@ -0,0 +1,148 @@
1 4xx/Axon EMAC ethernet nodes
2
3 The EMAC ethernet controller in IBM and AMCC 4xx chips, and also
4 the Axon bridge. To operate this needs to interact with a ths
5 special McMAL DMA controller, and sometimes an RGMII or ZMII
6 interface. In addition to the nodes and properties described
7 below, the node for the OPB bus on which the EMAC sits must have a
8 correct clock-frequency property.
9
10 i) The EMAC node itself
11
12 Required properties:
13 - device_type : "network"
14
15 - compatible : compatible list, contains 2 entries, first is
16 "ibm,emac-CHIP" where CHIP is the host ASIC (440gx,
17 405gp, Axon) and second is either "ibm,emac" or
18 "ibm,emac4". For Axon, thus, we have: "ibm,emac-axon",
19 "ibm,emac4"
20 - interrupts : <interrupt mapping for EMAC IRQ and WOL IRQ>
21 - interrupt-parent : optional, if needed for interrupt mapping
22 - reg : <registers mapping>
23 - local-mac-address : 6 bytes, MAC address
24 - mal-device : phandle of the associated McMAL node
25 - mal-tx-channel : 1 cell, index of the tx channel on McMAL associated
26 with this EMAC
27 - mal-rx-channel : 1 cell, index of the rx channel on McMAL associated
28 with this EMAC
29 - cell-index : 1 cell, hardware index of the EMAC cell on a given
30 ASIC (typically 0x0 and 0x1 for EMAC0 and EMAC1 on
31 each Axon chip)
32 - max-frame-size : 1 cell, maximum frame size supported in bytes
33 - rx-fifo-size : 1 cell, Rx fifo size in bytes for 10 and 100 Mb/sec
34 operations.
35 For Axon, 2048
36 - tx-fifo-size : 1 cell, Tx fifo size in bytes for 10 and 100 Mb/sec
37 operations.
38 For Axon, 2048.
39 - fifo-entry-size : 1 cell, size of a fifo entry (used to calculate
40 thresholds).
41 For Axon, 0x00000010
42 - mal-burst-size : 1 cell, MAL burst size (used to calculate thresholds)
43 in bytes.
44 For Axon, 0x00000100 (I think ...)
45 - phy-mode : string, mode of operations of the PHY interface.
46 Supported values are: "mii", "rmii", "smii", "rgmii",
47 "tbi", "gmii", rtbi", "sgmii".
48 For Axon on CAB, it is "rgmii"
49 - mdio-device : 1 cell, required iff using shared MDIO registers
50 (440EP). phandle of the EMAC to use to drive the
51 MDIO lines for the PHY used by this EMAC.
52 - zmii-device : 1 cell, required iff connected to a ZMII. phandle of
53 the ZMII device node
54 - zmii-channel : 1 cell, required iff connected to a ZMII. Which ZMII
55 channel or 0xffffffff if ZMII is only used for MDIO.
56 - rgmii-device : 1 cell, required iff connected to an RGMII. phandle
57 of the RGMII device node.
58 For Axon: phandle of plb5/plb4/opb/rgmii
59 - rgmii-channel : 1 cell, required iff connected to an RGMII. Which
60 RGMII channel is used by this EMAC.
61 Fox Axon: present, whatever value is appropriate for each
62 EMAC, that is the content of the current (bogus) "phy-port"
63 property.
64
65 Optional properties:
66 - phy-address : 1 cell, optional, MDIO address of the PHY. If absent,
67 a search is performed.
68 - phy-map : 1 cell, optional, bitmap of addresses to probe the PHY
69 for, used if phy-address is absent. bit 0x00000001 is
70 MDIO address 0.
71 For Axon it can be absent, though my current driver
72 doesn't handle phy-address yet so for now, keep
73 0x00ffffff in it.
74 - rx-fifo-size-gige : 1 cell, Rx fifo size in bytes for 1000 Mb/sec
75 operations (if absent the value is the same as
76 rx-fifo-size). For Axon, either absent or 2048.
77 - tx-fifo-size-gige : 1 cell, Tx fifo size in bytes for 1000 Mb/sec
78 operations (if absent the value is the same as
79 tx-fifo-size). For Axon, either absent or 2048.
80 - tah-device : 1 cell, optional. If connected to a TAH engine for
81 offload, phandle of the TAH device node.
82 - tah-channel : 1 cell, optional. If appropriate, channel used on the
83 TAH engine.
84
85 Example:
86
87 EMAC0: ethernet@40000800 {
88 device_type = "network";
89 compatible = "ibm,emac-440gp", "ibm,emac";
90 interrupt-parent = <&UIC1>;
91 interrupts = <1c 4 1d 4>;
92 reg = <40000800 70>;
93 local-mac-address = [00 04 AC E3 1B 1E];
94 mal-device = <&MAL0>;
95 mal-tx-channel = <0 1>;
96 mal-rx-channel = <0>;
97 cell-index = <0>;
98 max-frame-size = <5dc>;
99 rx-fifo-size = <1000>;
100 tx-fifo-size = <800>;
101 phy-mode = "rmii";
102 phy-map = <00000001>;
103 zmii-device = <&ZMII0>;
104 zmii-channel = <0>;
105 };
106
107 ii) McMAL node
108
109 Required properties:
110 - device_type : "dma-controller"
111 - compatible : compatible list, containing 2 entries, first is
112 "ibm,mcmal-CHIP" where CHIP is the host ASIC (like
113 emac) and the second is either "ibm,mcmal" or
114 "ibm,mcmal2".
115 For Axon, "ibm,mcmal-axon","ibm,mcmal2"
116 - interrupts : <interrupt mapping for the MAL interrupts sources:
117 5 sources: tx_eob, rx_eob, serr, txde, rxde>.
118 For Axon: This is _different_ from the current
119 firmware. We use the "delayed" interrupts for txeob
120 and rxeob. Thus we end up with mapping those 5 MPIC
121 interrupts, all level positive sensitive: 10, 11, 32,
122 33, 34 (in decimal)
123 - dcr-reg : < DCR registers range >
124 - dcr-parent : if needed for dcr-reg
125 - num-tx-chans : 1 cell, number of Tx channels
126 - num-rx-chans : 1 cell, number of Rx channels
127
128 iii) ZMII node
129
130 Required properties:
131 - compatible : compatible list, containing 2 entries, first is
132 "ibm,zmii-CHIP" where CHIP is the host ASIC (like
133 EMAC) and the second is "ibm,zmii".
134 For Axon, there is no ZMII node.
135 - reg : <registers mapping>
136
137 iv) RGMII node
138
139 Required properties:
140 - compatible : compatible list, containing 2 entries, first is
141 "ibm,rgmii-CHIP" where CHIP is the host ASIC (like
142 EMAC) and the second is "ibm,rgmii".
143 For Axon, "ibm,rgmii-axon","ibm,rgmii"
144 - reg : <registers mapping>
145 - revision : as provided by the RGMII new version register if
146 available.
147 For Axon: 0x0000012a
148
diff --git a/Documentation/powerpc/dts-bindings/gpio/gpio.txt b/Documentation/powerpc/dts-bindings/gpio/gpio.txt
new file mode 100644
index 000000000000..edaa84d288a1
--- /dev/null
+++ b/Documentation/powerpc/dts-bindings/gpio/gpio.txt
@@ -0,0 +1,50 @@
1Specifying GPIO information for devices
2============================================
3
41) gpios property
5-----------------
6
7Nodes that makes use of GPIOs should define them using `gpios' property,
8format of which is: <&gpio-controller1-phandle gpio1-specifier
9 &gpio-controller2-phandle gpio2-specifier
10 0 /* holes are permitted, means no GPIO 3 */
11 &gpio-controller4-phandle gpio4-specifier
12 ...>;
13
14Note that gpio-specifier length is controller dependent.
15
16gpio-specifier may encode: bank, pin position inside the bank,
17whether pin is open-drain and whether pin is logically inverted.
18
19Example of the node using GPIOs:
20
21 node {
22 gpios = <&qe_pio_e 18 0>;
23 };
24
25In this example gpio-specifier is "18 0" and encodes GPIO pin number,
26and empty GPIO flags as accepted by the "qe_pio_e" gpio-controller.
27
282) gpio-controller nodes
29------------------------
30
31Every GPIO controller node must have #gpio-cells property defined,
32this information will be used to translate gpio-specifiers.
33
34Example of two SOC GPIO banks defined as gpio-controller nodes:
35
36 qe_pio_a: gpio-controller@1400 {
37 #gpio-cells = <2>;
38 compatible = "fsl,qe-pario-bank-a", "fsl,qe-pario-bank";
39 reg = <0x1400 0x18>;
40 gpio-controller;
41 };
42
43 qe_pio_e: gpio-controller@1460 {
44 #gpio-cells = <2>;
45 compatible = "fsl,qe-pario-bank-e", "fsl,qe-pario-bank";
46 reg = <0x1460 0x18>;
47 gpio-controller;
48 };
49
50
diff --git a/Documentation/powerpc/dts-bindings/gpio/led.txt b/Documentation/powerpc/dts-bindings/gpio/led.txt
index 4fe14deedc0a..064db928c3c1 100644
--- a/Documentation/powerpc/dts-bindings/gpio/led.txt
+++ b/Documentation/powerpc/dts-bindings/gpio/led.txt
@@ -16,10 +16,17 @@ LED sub-node properties:
16 string defining the trigger assigned to the LED. Current triggers are: 16 string defining the trigger assigned to the LED. Current triggers are:
17 "backlight" - LED will act as a back-light, controlled by the framebuffer 17 "backlight" - LED will act as a back-light, controlled by the framebuffer
18 system 18 system
19 "default-on" - LED will turn on 19 "default-on" - LED will turn on, but see "default-state" below
20 "heartbeat" - LED "double" flashes at a load average based rate 20 "heartbeat" - LED "double" flashes at a load average based rate
21 "ide-disk" - LED indicates disk activity 21 "ide-disk" - LED indicates disk activity
22 "timer" - LED flashes at a fixed, configurable rate 22 "timer" - LED flashes at a fixed, configurable rate
23- default-state: (optional) The initial state of the LED. Valid
24 values are "on", "off", and "keep". If the LED is already on or off
25 and the default-state property is set the to same value, then no
26 glitch should be produced where the LED momentarily turns off (or
27 on). The "keep" setting will keep the LED at whatever its current
28 state is, without producing a glitch. The default is off if this
29 property is not present.
23 30
24Examples: 31Examples:
25 32
@@ -30,14 +37,22 @@ leds {
30 gpios = <&mcu_pio 0 1>; /* Active low */ 37 gpios = <&mcu_pio 0 1>; /* Active low */
31 linux,default-trigger = "ide-disk"; 38 linux,default-trigger = "ide-disk";
32 }; 39 };
40
41 fault {
42 gpios = <&mcu_pio 1 0>;
43 /* Keep LED on if BIOS detected hardware fault */
44 default-state = "keep";
45 };
33}; 46};
34 47
35run-control { 48run-control {
36 compatible = "gpio-leds"; 49 compatible = "gpio-leds";
37 red { 50 red {
38 gpios = <&mpc8572 6 0>; 51 gpios = <&mpc8572 6 0>;
52 default-state = "off";
39 }; 53 };
40 green { 54 green {
41 gpios = <&mpc8572 7 0>; 55 gpios = <&mpc8572 7 0>;
56 default-state = "on";
42 }; 57 };
43} 58}
diff --git a/Documentation/powerpc/dts-bindings/gpio/mdio.txt b/Documentation/powerpc/dts-bindings/gpio/mdio.txt
new file mode 100644
index 000000000000..bc9549529014
--- /dev/null
+++ b/Documentation/powerpc/dts-bindings/gpio/mdio.txt
@@ -0,0 +1,19 @@
1MDIO on GPIOs
2
3Currently defined compatibles:
4- virtual,gpio-mdio
5
6MDC and MDIO lines connected to GPIO controllers are listed in the
7gpios property as described in section VIII.1 in the following order:
8
9MDC, MDIO.
10
11Example:
12
13mdio {
14 compatible = "virtual,mdio-gpio";
15 #address-cells = <1>;
16 #size-cells = <0>;
17 gpios = <&qe_pio_a 11
18 &qe_pio_c 6>;
19};
diff --git a/Documentation/powerpc/dts-bindings/marvell.txt b/Documentation/powerpc/dts-bindings/marvell.txt
new file mode 100644
index 000000000000..3708a2fd4747
--- /dev/null
+++ b/Documentation/powerpc/dts-bindings/marvell.txt
@@ -0,0 +1,521 @@
1Marvell Discovery mv64[345]6x System Controller chips
2===========================================================
3
4The Marvell mv64[345]60 series of system controller chips contain
5many of the peripherals needed to implement a complete computer
6system. In this section, we define device tree nodes to describe
7the system controller chip itself and each of the peripherals
8which it contains. Compatible string values for each node are
9prefixed with the string "marvell,", for Marvell Technology Group Ltd.
10
111) The /system-controller node
12
13 This node is used to represent the system-controller and must be
14 present when the system uses a system controller chip. The top-level
15 system-controller node contains information that is global to all
16 devices within the system controller chip. The node name begins
17 with "system-controller" followed by the unit address, which is
18 the base address of the memory-mapped register set for the system
19 controller chip.
20
21 Required properties:
22
23 - ranges : Describes the translation of system controller addresses
24 for memory mapped registers.
25 - clock-frequency: Contains the main clock frequency for the system
26 controller chip.
27 - reg : This property defines the address and size of the
28 memory-mapped registers contained within the system controller
29 chip. The address specified in the "reg" property should match
30 the unit address of the system-controller node.
31 - #address-cells : Address representation for system controller
32 devices. This field represents the number of cells needed to
33 represent the address of the memory-mapped registers of devices
34 within the system controller chip.
35 - #size-cells : Size representation for for the memory-mapped
36 registers within the system controller chip.
37 - #interrupt-cells : Defines the width of cells used to represent
38 interrupts.
39
40 Optional properties:
41
42 - model : The specific model of the system controller chip. Such
43 as, "mv64360", "mv64460", or "mv64560".
44 - compatible : A string identifying the compatibility identifiers
45 of the system controller chip.
46
47 The system-controller node contains child nodes for each system
48 controller device that the platform uses. Nodes should not be created
49 for devices which exist on the system controller chip but are not used
50
51 Example Marvell Discovery mv64360 system-controller node:
52
53 system-controller@f1000000 { /* Marvell Discovery mv64360 */
54 #address-cells = <1>;
55 #size-cells = <1>;
56 model = "mv64360"; /* Default */
57 compatible = "marvell,mv64360";
58 clock-frequency = <133333333>;
59 reg = <0xf1000000 0x10000>;
60 virtual-reg = <0xf1000000>;
61 ranges = <0x88000000 0x88000000 0x1000000 /* PCI 0 I/O Space */
62 0x80000000 0x80000000 0x8000000 /* PCI 0 MEM Space */
63 0xa0000000 0xa0000000 0x4000000 /* User FLASH */
64 0x00000000 0xf1000000 0x0010000 /* Bridge's regs */
65 0xf2000000 0xf2000000 0x0040000>;/* Integrated SRAM */
66
67 [ child node definitions... ]
68 }
69
702) Child nodes of /system-controller
71
72 a) Marvell Discovery MDIO bus
73
74 The MDIO is a bus to which the PHY devices are connected. For each
75 device that exists on this bus, a child node should be created. See
76 the definition of the PHY node below for an example of how to define
77 a PHY.
78
79 Required properties:
80 - #address-cells : Should be <1>
81 - #size-cells : Should be <0>
82 - device_type : Should be "mdio"
83 - compatible : Should be "marvell,mv64360-mdio"
84
85 Example:
86
87 mdio {
88 #address-cells = <1>;
89 #size-cells = <0>;
90 device_type = "mdio";
91 compatible = "marvell,mv64360-mdio";
92
93 ethernet-phy@0 {
94 ......
95 };
96 };
97
98
99 b) Marvell Discovery ethernet controller
100
101 The Discover ethernet controller is described with two levels
102 of nodes. The first level describes an ethernet silicon block
103 and the second level describes up to 3 ethernet nodes within
104 that block. The reason for the multiple levels is that the
105 registers for the node are interleaved within a single set
106 of registers. The "ethernet-block" level describes the
107 shared register set, and the "ethernet" nodes describe ethernet
108 port-specific properties.
109
110 Ethernet block node
111
112 Required properties:
113 - #address-cells : <1>
114 - #size-cells : <0>
115 - compatible : "marvell,mv64360-eth-block"
116 - reg : Offset and length of the register set for this block
117
118 Example Discovery Ethernet block node:
119 ethernet-block@2000 {
120 #address-cells = <1>;
121 #size-cells = <0>;
122 compatible = "marvell,mv64360-eth-block";
123 reg = <0x2000 0x2000>;
124 ethernet@0 {
125 .......
126 };
127 };
128
129 Ethernet port node
130
131 Required properties:
132 - device_type : Should be "network".
133 - compatible : Should be "marvell,mv64360-eth".
134 - reg : Should be <0>, <1>, or <2>, according to which registers
135 within the silicon block the device uses.
136 - interrupts : <a> where a is the interrupt number for the port.
137 - interrupt-parent : the phandle for the interrupt controller
138 that services interrupts for this device.
139 - phy : the phandle for the PHY connected to this ethernet
140 controller.
141 - local-mac-address : 6 bytes, MAC address
142
143 Example Discovery Ethernet port node:
144 ethernet@0 {
145 device_type = "network";
146 compatible = "marvell,mv64360-eth";
147 reg = <0>;
148 interrupts = <32>;
149 interrupt-parent = <&PIC>;
150 phy = <&PHY0>;
151 local-mac-address = [ 00 00 00 00 00 00 ];
152 };
153
154
155
156 c) Marvell Discovery PHY nodes
157
158 Required properties:
159 - device_type : Should be "ethernet-phy"
160 - interrupts : <a> where a is the interrupt number for this phy.
161 - interrupt-parent : the phandle for the interrupt controller that
162 services interrupts for this device.
163 - reg : The ID number for the phy, usually a small integer
164
165 Example Discovery PHY node:
166 ethernet-phy@1 {
167 device_type = "ethernet-phy";
168 compatible = "broadcom,bcm5421";
169 interrupts = <76>; /* GPP 12 */
170 interrupt-parent = <&PIC>;
171 reg = <1>;
172 };
173
174
175 d) Marvell Discovery SDMA nodes
176
177 Represent DMA hardware associated with the MPSC (multiprotocol
178 serial controllers).
179
180 Required properties:
181 - compatible : "marvell,mv64360-sdma"
182 - reg : Offset and length of the register set for this device
183 - interrupts : <a> where a is the interrupt number for the DMA
184 device.
185 - interrupt-parent : the phandle for the interrupt controller
186 that services interrupts for this device.
187
188 Example Discovery SDMA node:
189 sdma@4000 {
190 compatible = "marvell,mv64360-sdma";
191 reg = <0x4000 0xc18>;
192 virtual-reg = <0xf1004000>;
193 interrupts = <36>;
194 interrupt-parent = <&PIC>;
195 };
196
197
198 e) Marvell Discovery BRG nodes
199
200 Represent baud rate generator hardware associated with the MPSC
201 (multiprotocol serial controllers).
202
203 Required properties:
204 - compatible : "marvell,mv64360-brg"
205 - reg : Offset and length of the register set for this device
206 - clock-src : A value from 0 to 15 which selects the clock
207 source for the baud rate generator. This value corresponds
208 to the CLKS value in the BRGx configuration register. See
209 the mv64x60 User's Manual.
210 - clock-frequence : The frequency (in Hz) of the baud rate
211 generator's input clock.
212 - current-speed : The current speed setting (presumably by
213 firmware) of the baud rate generator.
214
215 Example Discovery BRG node:
216 brg@b200 {
217 compatible = "marvell,mv64360-brg";
218 reg = <0xb200 0x8>;
219 clock-src = <8>;
220 clock-frequency = <133333333>;
221 current-speed = <9600>;
222 };
223
224
225 f) Marvell Discovery CUNIT nodes
226
227 Represent the Serial Communications Unit device hardware.
228
229 Required properties:
230 - reg : Offset and length of the register set for this device
231
232 Example Discovery CUNIT node:
233 cunit@f200 {
234 reg = <0xf200 0x200>;
235 };
236
237
238 g) Marvell Discovery MPSCROUTING nodes
239
240 Represent the Discovery's MPSC routing hardware
241
242 Required properties:
243 - reg : Offset and length of the register set for this device
244
245 Example Discovery CUNIT node:
246 mpscrouting@b500 {
247 reg = <0xb400 0xc>;
248 };
249
250
251 h) Marvell Discovery MPSCINTR nodes
252
253 Represent the Discovery's MPSC DMA interrupt hardware registers
254 (SDMA cause and mask registers).
255
256 Required properties:
257 - reg : Offset and length of the register set for this device
258
259 Example Discovery MPSCINTR node:
260 mpsintr@b800 {
261 reg = <0xb800 0x100>;
262 };
263
264
265 i) Marvell Discovery MPSC nodes
266
267 Represent the Discovery's MPSC (Multiprotocol Serial Controller)
268 serial port.
269
270 Required properties:
271 - device_type : "serial"
272 - compatible : "marvell,mv64360-mpsc"
273 - reg : Offset and length of the register set for this device
274 - sdma : the phandle for the SDMA node used by this port
275 - brg : the phandle for the BRG node used by this port
276 - cunit : the phandle for the CUNIT node used by this port
277 - mpscrouting : the phandle for the MPSCROUTING node used by this port
278 - mpscintr : the phandle for the MPSCINTR node used by this port
279 - cell-index : the hardware index of this cell in the MPSC core
280 - max_idle : value needed for MPSC CHR3 (Maximum Frame Length)
281 register
282 - interrupts : <a> where a is the interrupt number for the MPSC.
283 - interrupt-parent : the phandle for the interrupt controller
284 that services interrupts for this device.
285
286 Example Discovery MPSCINTR node:
287 mpsc@8000 {
288 device_type = "serial";
289 compatible = "marvell,mv64360-mpsc";
290 reg = <0x8000 0x38>;
291 virtual-reg = <0xf1008000>;
292 sdma = <&SDMA0>;
293 brg = <&BRG0>;
294 cunit = <&CUNIT>;
295 mpscrouting = <&MPSCROUTING>;
296 mpscintr = <&MPSCINTR>;
297 cell-index = <0>;
298 max_idle = <40>;
299 interrupts = <40>;
300 interrupt-parent = <&PIC>;
301 };
302
303
304 j) Marvell Discovery Watch Dog Timer nodes
305
306 Represent the Discovery's watchdog timer hardware
307
308 Required properties:
309 - compatible : "marvell,mv64360-wdt"
310 - reg : Offset and length of the register set for this device
311
312 Example Discovery Watch Dog Timer node:
313 wdt@b410 {
314 compatible = "marvell,mv64360-wdt";
315 reg = <0xb410 0x8>;
316 };
317
318
319 k) Marvell Discovery I2C nodes
320
321 Represent the Discovery's I2C hardware
322
323 Required properties:
324 - device_type : "i2c"
325 - compatible : "marvell,mv64360-i2c"
326 - reg : Offset and length of the register set for this device
327 - interrupts : <a> where a is the interrupt number for the I2C.
328 - interrupt-parent : the phandle for the interrupt controller
329 that services interrupts for this device.
330
331 Example Discovery I2C node:
332 compatible = "marvell,mv64360-i2c";
333 reg = <0xc000 0x20>;
334 virtual-reg = <0xf100c000>;
335 interrupts = <37>;
336 interrupt-parent = <&PIC>;
337 };
338
339
340 l) Marvell Discovery PIC (Programmable Interrupt Controller) nodes
341
342 Represent the Discovery's PIC hardware
343
344 Required properties:
345 - #interrupt-cells : <1>
346 - #address-cells : <0>
347 - compatible : "marvell,mv64360-pic"
348 - reg : Offset and length of the register set for this device
349 - interrupt-controller
350
351 Example Discovery PIC node:
352 pic {
353 #interrupt-cells = <1>;
354 #address-cells = <0>;
355 compatible = "marvell,mv64360-pic";
356 reg = <0x0 0x88>;
357 interrupt-controller;
358 };
359
360
361 m) Marvell Discovery MPP (Multipurpose Pins) multiplexing nodes
362
363 Represent the Discovery's MPP hardware
364
365 Required properties:
366 - compatible : "marvell,mv64360-mpp"
367 - reg : Offset and length of the register set for this device
368
369 Example Discovery MPP node:
370 mpp@f000 {
371 compatible = "marvell,mv64360-mpp";
372 reg = <0xf000 0x10>;
373 };
374
375
376 n) Marvell Discovery GPP (General Purpose Pins) nodes
377
378 Represent the Discovery's GPP hardware
379
380 Required properties:
381 - compatible : "marvell,mv64360-gpp"
382 - reg : Offset and length of the register set for this device
383
384 Example Discovery GPP node:
385 gpp@f000 {
386 compatible = "marvell,mv64360-gpp";
387 reg = <0xf100 0x20>;
388 };
389
390
391 o) Marvell Discovery PCI host bridge node
392
393 Represents the Discovery's PCI host bridge device. The properties
394 for this node conform to Rev 2.1 of the PCI Bus Binding to IEEE
395 1275-1994. A typical value for the compatible property is
396 "marvell,mv64360-pci".
397
398 Example Discovery PCI host bridge node
399 pci@80000000 {
400 #address-cells = <3>;
401 #size-cells = <2>;
402 #interrupt-cells = <1>;
403 device_type = "pci";
404 compatible = "marvell,mv64360-pci";
405 reg = <0xcf8 0x8>;
406 ranges = <0x01000000 0x0 0x0
407 0x88000000 0x0 0x01000000
408 0x02000000 0x0 0x80000000
409 0x80000000 0x0 0x08000000>;
410 bus-range = <0 255>;
411 clock-frequency = <66000000>;
412 interrupt-parent = <&PIC>;
413 interrupt-map-mask = <0xf800 0x0 0x0 0x7>;
414 interrupt-map = <
415 /* IDSEL 0x0a */
416 0x5000 0 0 1 &PIC 80
417 0x5000 0 0 2 &PIC 81
418 0x5000 0 0 3 &PIC 91
419 0x5000 0 0 4 &PIC 93
420
421 /* IDSEL 0x0b */
422 0x5800 0 0 1 &PIC 91
423 0x5800 0 0 2 &PIC 93
424 0x5800 0 0 3 &PIC 80
425 0x5800 0 0 4 &PIC 81
426
427 /* IDSEL 0x0c */
428 0x6000 0 0 1 &PIC 91
429 0x6000 0 0 2 &PIC 93
430 0x6000 0 0 3 &PIC 80
431 0x6000 0 0 4 &PIC 81
432
433 /* IDSEL 0x0d */
434 0x6800 0 0 1 &PIC 93
435 0x6800 0 0 2 &PIC 80
436 0x6800 0 0 3 &PIC 81
437 0x6800 0 0 4 &PIC 91
438 >;
439 };
440
441
442 p) Marvell Discovery CPU Error nodes
443
444 Represent the Discovery's CPU error handler device.
445
446 Required properties:
447 - compatible : "marvell,mv64360-cpu-error"
448 - reg : Offset and length of the register set for this device
449 - interrupts : the interrupt number for this device
450 - interrupt-parent : the phandle for the interrupt controller
451 that services interrupts for this device.
452
453 Example Discovery CPU Error node:
454 cpu-error@0070 {
455 compatible = "marvell,mv64360-cpu-error";
456 reg = <0x70 0x10 0x128 0x28>;
457 interrupts = <3>;
458 interrupt-parent = <&PIC>;
459 };
460
461
462 q) Marvell Discovery SRAM Controller nodes
463
464 Represent the Discovery's SRAM controller device.
465
466 Required properties:
467 - compatible : "marvell,mv64360-sram-ctrl"
468 - reg : Offset and length of the register set for this device
469 - interrupts : the interrupt number for this device
470 - interrupt-parent : the phandle for the interrupt controller
471 that services interrupts for this device.
472
473 Example Discovery SRAM Controller node:
474 sram-ctrl@0380 {
475 compatible = "marvell,mv64360-sram-ctrl";
476 reg = <0x380 0x80>;
477 interrupts = <13>;
478 interrupt-parent = <&PIC>;
479 };
480
481
482 r) Marvell Discovery PCI Error Handler nodes
483
484 Represent the Discovery's PCI error handler device.
485
486 Required properties:
487 - compatible : "marvell,mv64360-pci-error"
488 - reg : Offset and length of the register set for this device
489 - interrupts : the interrupt number for this device
490 - interrupt-parent : the phandle for the interrupt controller
491 that services interrupts for this device.
492
493 Example Discovery PCI Error Handler node:
494 pci-error@1d40 {
495 compatible = "marvell,mv64360-pci-error";
496 reg = <0x1d40 0x40 0xc28 0x4>;
497 interrupts = <12>;
498 interrupt-parent = <&PIC>;
499 };
500
501
502 s) Marvell Discovery Memory Controller nodes
503
504 Represent the Discovery's memory controller device.
505
506 Required properties:
507 - compatible : "marvell,mv64360-mem-ctrl"
508 - reg : Offset and length of the register set for this device
509 - interrupts : the interrupt number for this device
510 - interrupt-parent : the phandle for the interrupt controller
511 that services interrupts for this device.
512
513 Example Discovery Memory Controller node:
514 mem-ctrl@1400 {
515 compatible = "marvell,mv64360-mem-ctrl";
516 reg = <0x1400 0x60>;
517 interrupts = <17>;
518 interrupt-parent = <&PIC>;
519 };
520
521
diff --git a/Documentation/powerpc/dts-bindings/phy.txt b/Documentation/powerpc/dts-bindings/phy.txt
new file mode 100644
index 000000000000..bb8c742eb8c5
--- /dev/null
+++ b/Documentation/powerpc/dts-bindings/phy.txt
@@ -0,0 +1,25 @@
1PHY nodes
2
3Required properties:
4
5 - device_type : Should be "ethernet-phy"
6 - interrupts : <a b> where a is the interrupt number and b is a
7 field that represents an encoding of the sense and level
8 information for the interrupt. This should be encoded based on
9 the information in section 2) depending on the type of interrupt
10 controller you have.
11 - interrupt-parent : the phandle for the interrupt controller that
12 services interrupts for this device.
13 - reg : The ID number for the phy, usually a small integer
14 - linux,phandle : phandle for this node; likely referenced by an
15 ethernet controller node.
16
17Example:
18
19ethernet-phy@0 {
20 linux,phandle = <2452000>
21 interrupt-parent = <40000>;
22 interrupts = <35 1>;
23 reg = <0>;
24 device_type = "ethernet-phy";
25};
diff --git a/Documentation/powerpc/dts-bindings/spi-bus.txt b/Documentation/powerpc/dts-bindings/spi-bus.txt
new file mode 100644
index 000000000000..e782add2e457
--- /dev/null
+++ b/Documentation/powerpc/dts-bindings/spi-bus.txt
@@ -0,0 +1,57 @@
1SPI (Serial Peripheral Interface) busses
2
3SPI busses can be described with a node for the SPI master device
4and a set of child nodes for each SPI slave on the bus. For this
5discussion, it is assumed that the system's SPI controller is in
6SPI master mode. This binding does not describe SPI controllers
7in slave mode.
8
9The SPI master node requires the following properties:
10- #address-cells - number of cells required to define a chip select
11 address on the SPI bus.
12- #size-cells - should be zero.
13- compatible - name of SPI bus controller following generic names
14 recommended practice.
15No other properties are required in the SPI bus node. It is assumed
16that a driver for an SPI bus device will understand that it is an SPI bus.
17However, the binding does not attempt to define the specific method for
18assigning chip select numbers. Since SPI chip select configuration is
19flexible and non-standardized, it is left out of this binding with the
20assumption that board specific platform code will be used to manage
21chip selects. Individual drivers can define additional properties to
22support describing the chip select layout.
23
24SPI slave nodes must be children of the SPI master node and can
25contain the following properties.
26- reg - (required) chip select address of device.
27- compatible - (required) name of SPI device following generic names
28 recommended practice
29- spi-max-frequency - (required) Maximum SPI clocking speed of device in Hz
30- spi-cpol - (optional) Empty property indicating device requires
31 inverse clock polarity (CPOL) mode
32- spi-cpha - (optional) Empty property indicating device requires
33 shifted clock phase (CPHA) mode
34- spi-cs-high - (optional) Empty property indicating device requires
35 chip select active high
36
37SPI example for an MPC5200 SPI bus:
38 spi@f00 {
39 #address-cells = <1>;
40 #size-cells = <0>;
41 compatible = "fsl,mpc5200b-spi","fsl,mpc5200-spi";
42 reg = <0xf00 0x20>;
43 interrupts = <2 13 0 2 14 0>;
44 interrupt-parent = <&mpc5200_pic>;
45
46 ethernet-switch@0 {
47 compatible = "micrel,ks8995m";
48 spi-max-frequency = <1000000>;
49 reg = <0>;
50 };
51
52 codec@1 {
53 compatible = "ti,tlv320aic26";
54 spi-max-frequency = <100000>;
55 reg = <1>;
56 };
57 };
diff --git a/Documentation/powerpc/dts-bindings/usb-ehci.txt b/Documentation/powerpc/dts-bindings/usb-ehci.txt
new file mode 100644
index 000000000000..fa18612f757b
--- /dev/null
+++ b/Documentation/powerpc/dts-bindings/usb-ehci.txt
@@ -0,0 +1,25 @@
1USB EHCI controllers
2
3Required properties:
4 - compatible : should be "usb-ehci".
5 - reg : should contain at least address and length of the standard EHCI
6 register set for the device. Optional platform-dependent registers
7 (debug-port or other) can be also specified here, but only after
8 definition of standard EHCI registers.
9 - interrupts : one EHCI interrupt should be described here.
10If device registers are implemented in big endian mode, the device
11node should have "big-endian-regs" property.
12If controller implementation operates with big endian descriptors,
13"big-endian-desc" property should be specified.
14If both big endian registers and descriptors are used by the controller
15implementation, "big-endian" property can be specified instead of having
16both "big-endian-regs" and "big-endian-desc".
17
18Example (Sequoia 440EPx):
19 ehci@e0000300 {
20 compatible = "ibm,usb-ehci-440epx", "usb-ehci";
21 interrupt-parent = <&UIC0>;
22 interrupts = <1a 4>;
23 reg = <0 e0000300 90 0 e0000390 70>;
24 big-endian;
25 };
diff --git a/Documentation/powerpc/dts-bindings/xilinx.txt b/Documentation/powerpc/dts-bindings/xilinx.txt
new file mode 100644
index 000000000000..80339fe4300b
--- /dev/null
+++ b/Documentation/powerpc/dts-bindings/xilinx.txt
@@ -0,0 +1,295 @@
1 d) Xilinx IP cores
2
3 The Xilinx EDK toolchain ships with a set of IP cores (devices) for use
4 in Xilinx Spartan and Virtex FPGAs. The devices cover the whole range
5 of standard device types (network, serial, etc.) and miscellaneous
6 devices (gpio, LCD, spi, etc). Also, since these devices are
7 implemented within the fpga fabric every instance of the device can be
8 synthesised with different options that change the behaviour.
9
10 Each IP-core has a set of parameters which the FPGA designer can use to
11 control how the core is synthesized. Historically, the EDK tool would
12 extract the device parameters relevant to device drivers and copy them
13 into an 'xparameters.h' in the form of #define symbols. This tells the
14 device drivers how the IP cores are configured, but it requres the kernel
15 to be recompiled every time the FPGA bitstream is resynthesized.
16
17 The new approach is to export the parameters into the device tree and
18 generate a new device tree each time the FPGA bitstream changes. The
19 parameters which used to be exported as #defines will now become
20 properties of the device node. In general, device nodes for IP-cores
21 will take the following form:
22
23 (name): (generic-name)@(base-address) {
24 compatible = "xlnx,(ip-core-name)-(HW_VER)"
25 [, (list of compatible devices), ...];
26 reg = <(baseaddr) (size)>;
27 interrupt-parent = <&interrupt-controller-phandle>;
28 interrupts = < ... >;
29 xlnx,(parameter1) = "(string-value)";
30 xlnx,(parameter2) = <(int-value)>;
31 };
32
33 (generic-name): an open firmware-style name that describes the
34 generic class of device. Preferably, this is one word, such
35 as 'serial' or 'ethernet'.
36 (ip-core-name): the name of the ip block (given after the BEGIN
37 directive in system.mhs). Should be in lowercase
38 and all underscores '_' converted to dashes '-'.
39 (name): is derived from the "PARAMETER INSTANCE" value.
40 (parameter#): C_* parameters from system.mhs. The C_ prefix is
41 dropped from the parameter name, the name is converted
42 to lowercase and all underscore '_' characters are
43 converted to dashes '-'.
44 (baseaddr): the baseaddr parameter value (often named C_BASEADDR).
45 (HW_VER): from the HW_VER parameter.
46 (size): the address range size (often C_HIGHADDR - C_BASEADDR + 1).
47
48 Typically, the compatible list will include the exact IP core version
49 followed by an older IP core version which implements the same
50 interface or any other device with the same interface.
51
52 'reg', 'interrupt-parent' and 'interrupts' are all optional properties.
53
54 For example, the following block from system.mhs:
55
56 BEGIN opb_uartlite
57 PARAMETER INSTANCE = opb_uartlite_0
58 PARAMETER HW_VER = 1.00.b
59 PARAMETER C_BAUDRATE = 115200
60 PARAMETER C_DATA_BITS = 8
61 PARAMETER C_ODD_PARITY = 0
62 PARAMETER C_USE_PARITY = 0
63 PARAMETER C_CLK_FREQ = 50000000
64 PARAMETER C_BASEADDR = 0xEC100000
65 PARAMETER C_HIGHADDR = 0xEC10FFFF
66 BUS_INTERFACE SOPB = opb_7
67 PORT OPB_Clk = CLK_50MHz
68 PORT Interrupt = opb_uartlite_0_Interrupt
69 PORT RX = opb_uartlite_0_RX
70 PORT TX = opb_uartlite_0_TX
71 PORT OPB_Rst = sys_bus_reset_0
72 END
73
74 becomes the following device tree node:
75
76 opb_uartlite_0: serial@ec100000 {
77 device_type = "serial";
78 compatible = "xlnx,opb-uartlite-1.00.b";
79 reg = <ec100000 10000>;
80 interrupt-parent = <&opb_intc_0>;
81 interrupts = <1 0>; // got this from the opb_intc parameters
82 current-speed = <d#115200>; // standard serial device prop
83 clock-frequency = <d#50000000>; // standard serial device prop
84 xlnx,data-bits = <8>;
85 xlnx,odd-parity = <0>;
86 xlnx,use-parity = <0>;
87 };
88
89 Some IP cores actually implement 2 or more logical devices. In
90 this case, the device should still describe the whole IP core with
91 a single node and add a child node for each logical device. The
92 ranges property can be used to translate from parent IP-core to the
93 registers of each device. In addition, the parent node should be
94 compatible with the bus type 'xlnx,compound', and should contain
95 #address-cells and #size-cells, as with any other bus. (Note: this
96 makes the assumption that both logical devices have the same bus
97 binding. If this is not true, then separate nodes should be used
98 for each logical device). The 'cell-index' property can be used to
99 enumerate logical devices within an IP core. For example, the
100 following is the system.mhs entry for the dual ps2 controller found
101 on the ml403 reference design.
102
103 BEGIN opb_ps2_dual_ref
104 PARAMETER INSTANCE = opb_ps2_dual_ref_0
105 PARAMETER HW_VER = 1.00.a
106 PARAMETER C_BASEADDR = 0xA9000000
107 PARAMETER C_HIGHADDR = 0xA9001FFF
108 BUS_INTERFACE SOPB = opb_v20_0
109 PORT Sys_Intr1 = ps2_1_intr
110 PORT Sys_Intr2 = ps2_2_intr
111 PORT Clkin1 = ps2_clk_rx_1
112 PORT Clkin2 = ps2_clk_rx_2
113 PORT Clkpd1 = ps2_clk_tx_1
114 PORT Clkpd2 = ps2_clk_tx_2
115 PORT Rx1 = ps2_d_rx_1
116 PORT Rx2 = ps2_d_rx_2
117 PORT Txpd1 = ps2_d_tx_1
118 PORT Txpd2 = ps2_d_tx_2
119 END
120
121 It would result in the following device tree nodes:
122
123 opb_ps2_dual_ref_0: opb-ps2-dual-ref@a9000000 {
124 #address-cells = <1>;
125 #size-cells = <1>;
126 compatible = "xlnx,compound";
127 ranges = <0 a9000000 2000>;
128 // If this device had extra parameters, then they would
129 // go here.
130 ps2@0 {
131 compatible = "xlnx,opb-ps2-dual-ref-1.00.a";
132 reg = <0 40>;
133 interrupt-parent = <&opb_intc_0>;
134 interrupts = <3 0>;
135 cell-index = <0>;
136 };
137 ps2@1000 {
138 compatible = "xlnx,opb-ps2-dual-ref-1.00.a";
139 reg = <1000 40>;
140 interrupt-parent = <&opb_intc_0>;
141 interrupts = <3 0>;
142 cell-index = <0>;
143 };
144 };
145
146 Also, the system.mhs file defines bus attachments from the processor
147 to the devices. The device tree structure should reflect the bus
148 attachments. Again an example; this system.mhs fragment:
149
150 BEGIN ppc405_virtex4
151 PARAMETER INSTANCE = ppc405_0
152 PARAMETER HW_VER = 1.01.a
153 BUS_INTERFACE DPLB = plb_v34_0
154 BUS_INTERFACE IPLB = plb_v34_0
155 END
156
157 BEGIN opb_intc
158 PARAMETER INSTANCE = opb_intc_0
159 PARAMETER HW_VER = 1.00.c
160 PARAMETER C_BASEADDR = 0xD1000FC0
161 PARAMETER C_HIGHADDR = 0xD1000FDF
162 BUS_INTERFACE SOPB = opb_v20_0
163 END
164
165 BEGIN opb_uart16550
166 PARAMETER INSTANCE = opb_uart16550_0
167 PARAMETER HW_VER = 1.00.d
168 PARAMETER C_BASEADDR = 0xa0000000
169 PARAMETER C_HIGHADDR = 0xa0001FFF
170 BUS_INTERFACE SOPB = opb_v20_0
171 END
172
173 BEGIN plb_v34
174 PARAMETER INSTANCE = plb_v34_0
175 PARAMETER HW_VER = 1.02.a
176 END
177
178 BEGIN plb_bram_if_cntlr
179 PARAMETER INSTANCE = plb_bram_if_cntlr_0
180 PARAMETER HW_VER = 1.00.b
181 PARAMETER C_BASEADDR = 0xFFFF0000
182 PARAMETER C_HIGHADDR = 0xFFFFFFFF
183 BUS_INTERFACE SPLB = plb_v34_0
184 END
185
186 BEGIN plb2opb_bridge
187 PARAMETER INSTANCE = plb2opb_bridge_0
188 PARAMETER HW_VER = 1.01.a
189 PARAMETER C_RNG0_BASEADDR = 0x20000000
190 PARAMETER C_RNG0_HIGHADDR = 0x3FFFFFFF
191 PARAMETER C_RNG1_BASEADDR = 0x60000000
192 PARAMETER C_RNG1_HIGHADDR = 0x7FFFFFFF
193 PARAMETER C_RNG2_BASEADDR = 0x80000000
194 PARAMETER C_RNG2_HIGHADDR = 0xBFFFFFFF
195 PARAMETER C_RNG3_BASEADDR = 0xC0000000
196 PARAMETER C_RNG3_HIGHADDR = 0xDFFFFFFF
197 BUS_INTERFACE SPLB = plb_v34_0
198 BUS_INTERFACE MOPB = opb_v20_0
199 END
200
201 Gives this device tree (some properties removed for clarity):
202
203 plb@0 {
204 #address-cells = <1>;
205 #size-cells = <1>;
206 compatible = "xlnx,plb-v34-1.02.a";
207 device_type = "ibm,plb";
208 ranges; // 1:1 translation
209
210 plb_bram_if_cntrl_0: bram@ffff0000 {
211 reg = <ffff0000 10000>;
212 }
213
214 opb@20000000 {
215 #address-cells = <1>;
216 #size-cells = <1>;
217 ranges = <20000000 20000000 20000000
218 60000000 60000000 20000000
219 80000000 80000000 40000000
220 c0000000 c0000000 20000000>;
221
222 opb_uart16550_0: serial@a0000000 {
223 reg = <a00000000 2000>;
224 };
225
226 opb_intc_0: interrupt-controller@d1000fc0 {
227 reg = <d1000fc0 20>;
228 };
229 };
230 };
231
232 That covers the general approach to binding xilinx IP cores into the
233 device tree. The following are bindings for specific devices:
234
235 i) Xilinx ML300 Framebuffer
236
237 Simple framebuffer device from the ML300 reference design (also on the
238 ML403 reference design as well as others).
239
240 Optional properties:
241 - resolution = <xres yres> : pixel resolution of framebuffer. Some
242 implementations use a different resolution.
243 Default is <d#640 d#480>
244 - virt-resolution = <xvirt yvirt> : Size of framebuffer in memory.
245 Default is <d#1024 d#480>.
246 - rotate-display (empty) : rotate display 180 degrees.
247
248 ii) Xilinx SystemACE
249
250 The Xilinx SystemACE device is used to program FPGAs from an FPGA
251 bitstream stored on a CF card. It can also be used as a generic CF
252 interface device.
253
254 Optional properties:
255 - 8-bit (empty) : Set this property for SystemACE in 8 bit mode
256
257 iii) Xilinx EMAC and Xilinx TEMAC
258
259 Xilinx Ethernet devices. In addition to general xilinx properties
260 listed above, nodes for these devices should include a phy-handle
261 property, and may include other common network device properties
262 like local-mac-address.
263
264 iv) Xilinx Uartlite
265
266 Xilinx uartlite devices are simple fixed speed serial ports.
267
268 Required properties:
269 - current-speed : Baud rate of uartlite
270
271 v) Xilinx hwicap
272
273 Xilinx hwicap devices provide access to the configuration logic
274 of the FPGA through the Internal Configuration Access Port
275 (ICAP). The ICAP enables partial reconfiguration of the FPGA,
276 readback of the configuration information, and some control over
277 'warm boots' of the FPGA fabric.
278
279 Required properties:
280 - xlnx,family : The family of the FPGA, necessary since the
281 capabilities of the underlying ICAP hardware
282 differ between different families. May be
283 'virtex2p', 'virtex4', or 'virtex5'.
284
285 vi) Xilinx Uart 16550
286
287 Xilinx UART 16550 devices are very similar to the NS16550 but with
288 different register spacing and an offset from the base address.
289
290 Required properties:
291 - clock-frequency : Frequency of the clock input
292 - reg-offset : A value of 3 is required
293 - reg-shift : A value of 2 is required
294
295
diff --git a/Documentation/scheduler/sched-rt-group.txt b/Documentation/scheduler/sched-rt-group.txt
index 1df7f9cdab05..86eabe6c3419 100644
--- a/Documentation/scheduler/sched-rt-group.txt
+++ b/Documentation/scheduler/sched-rt-group.txt
@@ -73,7 +73,7 @@ The remaining CPU time will be used for user input and other tasks. Because
73realtime tasks have explicitly allocated the CPU time they need to perform 73realtime tasks have explicitly allocated the CPU time they need to perform
74their tasks, buffer underruns in the graphics or audio can be eliminated. 74their tasks, buffer underruns in the graphics or audio can be eliminated.
75 75
76NOTE: the above example is not fully implemented as of yet (2.6.25). We still 76NOTE: the above example is not fully implemented yet. We still
77lack an EDF scheduler to make non-uniform periods usable. 77lack an EDF scheduler to make non-uniform periods usable.
78 78
79 79
@@ -140,14 +140,15 @@ The other option is:
140 140
141.o CONFIG_CGROUP_SCHED (aka "Basis for grouping tasks" = "Control groups") 141.o CONFIG_CGROUP_SCHED (aka "Basis for grouping tasks" = "Control groups")
142 142
143This uses the /cgroup virtual file system and "/cgroup/<cgroup>/cpu.rt_runtime_us" 143This uses the /cgroup virtual file system and
144to control the CPU time reserved for each control group instead. 144"/cgroup/<cgroup>/cpu.rt_runtime_us" to control the CPU time reserved for each
145control group instead.
145 146
146For more information on working with control groups, you should read 147For more information on working with control groups, you should read
147Documentation/cgroups/cgroups.txt as well. 148Documentation/cgroups/cgroups.txt as well.
148 149
149Group settings are checked against the following limits in order to keep the configuration 150Group settings are checked against the following limits in order to keep the
150schedulable: 151configuration schedulable:
151 152
152 \Sum_{i} runtime_{i} / global_period <= global_runtime / global_period 153 \Sum_{i} runtime_{i} / global_period <= global_runtime / global_period
153 154
@@ -189,7 +190,7 @@ Implementing SCHED_EDF might take a while to complete. Priority Inheritance is
189the biggest challenge as the current linux PI infrastructure is geared towards 190the biggest challenge as the current linux PI infrastructure is geared towards
190the limited static priority levels 0-99. With deadline scheduling you need to 191the limited static priority levels 0-99. With deadline scheduling you need to
191do deadline inheritance (since priority is inversely proportional to the 192do deadline inheritance (since priority is inversely proportional to the
192deadline delta (deadline - now). 193deadline delta (deadline - now)).
193 194
194This means the whole PI machinery will have to be reworked - and that is one of 195This means the whole PI machinery will have to be reworked - and that is one of
195the most complex pieces of code we have. 196the most complex pieces of code we have.
diff --git a/Documentation/sound/alsa/HD-Audio-Models.txt b/Documentation/sound/alsa/HD-Audio-Models.txt
index 0d8d23581c44..939a3dd58148 100644
--- a/Documentation/sound/alsa/HD-Audio-Models.txt
+++ b/Documentation/sound/alsa/HD-Audio-Models.txt
@@ -240,6 +240,7 @@ AD1986A
240 laptop-automute 2-channel with EAPD and HP-automute (Lenovo N100) 240 laptop-automute 2-channel with EAPD and HP-automute (Lenovo N100)
241 ultra 2-channel with EAPD (Samsung Ultra tablet PC) 241 ultra 2-channel with EAPD (Samsung Ultra tablet PC)
242 samsung 2-channel with EAPD (Samsung R65) 242 samsung 2-channel with EAPD (Samsung R65)
243 samsung-p50 2-channel with HP-automute (Samsung P50)
243 244
244AD1988/AD1988B/AD1989A/AD1989B 245AD1988/AD1988B/AD1989A/AD1989B
245============================== 246==============================
diff --git a/Documentation/sound/alsa/Procfile.txt b/Documentation/sound/alsa/Procfile.txt
index 381908d8ca42..719a819f8cc2 100644
--- a/Documentation/sound/alsa/Procfile.txt
+++ b/Documentation/sound/alsa/Procfile.txt
@@ -101,6 +101,8 @@ card*/pcm*/xrun_debug
101 bit 0 = Enable XRUN/jiffies debug messages 101 bit 0 = Enable XRUN/jiffies debug messages
102 bit 1 = Show stack trace at XRUN / jiffies check 102 bit 1 = Show stack trace at XRUN / jiffies check
103 bit 2 = Enable additional jiffies check 103 bit 2 = Enable additional jiffies check
104 bit 3 = Log hwptr update at each period interrupt
105 bit 4 = Log hwptr update at each snd_pcm_update_hw_ptr()
104 106
105 When the bit 0 is set, the driver will show the messages to 107 When the bit 0 is set, the driver will show the messages to
106 kernel log when an xrun is detected. The debug message is 108 kernel log when an xrun is detected. The debug message is
@@ -117,6 +119,9 @@ card*/pcm*/xrun_debug
117 buggy) hardware that doesn't give smooth pointer updates. 119 buggy) hardware that doesn't give smooth pointer updates.
118 This feature is enabled via the bit 2. 120 This feature is enabled via the bit 2.
119 121
122 Bits 3 and 4 are for logging the hwptr records. Note that
123 these will give flood of kernel messages.
124
120card*/pcm*/sub*/info 125card*/pcm*/sub*/info
121 The general information of this PCM sub-stream. 126 The general information of this PCM sub-stream.
122 127
diff --git a/Documentation/spi/spidev_test.c b/Documentation/spi/spidev_test.c
index cf0e3ce0d526..c1a5aad3c75a 100644
--- a/Documentation/spi/spidev_test.c
+++ b/Documentation/spi/spidev_test.c
@@ -99,11 +99,13 @@ void parse_opts(int argc, char *argv[])
99 { "lsb", 0, 0, 'L' }, 99 { "lsb", 0, 0, 'L' },
100 { "cs-high", 0, 0, 'C' }, 100 { "cs-high", 0, 0, 'C' },
101 { "3wire", 0, 0, '3' }, 101 { "3wire", 0, 0, '3' },
102 { "no-cs", 0, 0, 'N' },
103 { "ready", 0, 0, 'R' },
102 { NULL, 0, 0, 0 }, 104 { NULL, 0, 0, 0 },
103 }; 105 };
104 int c; 106 int c;
105 107
106 c = getopt_long(argc, argv, "D:s:d:b:lHOLC3", lopts, NULL); 108 c = getopt_long(argc, argv, "D:s:d:b:lHOLC3NR", lopts, NULL);
107 109
108 if (c == -1) 110 if (c == -1)
109 break; 111 break;
@@ -139,6 +141,12 @@ void parse_opts(int argc, char *argv[])
139 case '3': 141 case '3':
140 mode |= SPI_3WIRE; 142 mode |= SPI_3WIRE;
141 break; 143 break;
144 case 'N':
145 mode |= SPI_NO_CS;
146 break;
147 case 'R':
148 mode |= SPI_READY;
149 break;
142 default: 150 default:
143 print_usage(argv[0]); 151 print_usage(argv[0]);
144 break; 152 break;
diff --git a/Documentation/sysrq.txt b/Documentation/sysrq.txt
index cf42b820ff9d..d56a01775423 100644
--- a/Documentation/sysrq.txt
+++ b/Documentation/sysrq.txt
@@ -66,7 +66,8 @@ On all - write a character to /proc/sysrq-trigger. e.g.:
66'b' - Will immediately reboot the system without syncing or unmounting 66'b' - Will immediately reboot the system without syncing or unmounting
67 your disks. 67 your disks.
68 68
69'c' - Will perform a kexec reboot in order to take a crashdump. 69'c' - Will perform a system crash by a NULL pointer dereference.
70 A crashdump will be taken if configured.
70 71
71'd' - Shows all locks that are held. 72'd' - Shows all locks that are held.
72 73
@@ -141,8 +142,8 @@ useful when you want to exit a program that will not let you switch consoles.
141re'B'oot is good when you're unable to shut down. But you should also 'S'ync 142re'B'oot is good when you're unable to shut down. But you should also 'S'ync
142and 'U'mount first. 143and 'U'mount first.
143 144
144'C'rashdump can be used to manually trigger a crashdump when the system is hung. 145'C'rash can be used to manually trigger a crashdump when the system is hung.
145The kernel needs to have been built with CONFIG_KEXEC enabled. 146Note that this just triggers a crash if there is no dump mechanism available.
146 147
147'S'ync is great when your system is locked up, it allows you to sync your 148'S'ync is great when your system is locked up, it allows you to sync your
148disks and will certainly lessen the chance of data loss and fscking. Note 149disks and will certainly lessen the chance of data loss and fscking. Note
diff --git a/Documentation/video4linux/CARDLIST.em28xx b/Documentation/video4linux/CARDLIST.em28xx
index 873630e7e53e..68c236c01846 100644
--- a/Documentation/video4linux/CARDLIST.em28xx
+++ b/Documentation/video4linux/CARDLIST.em28xx
@@ -20,7 +20,7 @@
20 19 -> EM2860/SAA711X Reference Design (em2860) 20 19 -> EM2860/SAA711X Reference Design (em2860)
21 20 -> AMD ATI TV Wonder HD 600 (em2880) [0438:b002] 21 20 -> AMD ATI TV Wonder HD 600 (em2880) [0438:b002]
22 21 -> eMPIA Technology, Inc. GrabBeeX+ Video Encoder (em2800) [eb1a:2801] 22 21 -> eMPIA Technology, Inc. GrabBeeX+ Video Encoder (em2800) [eb1a:2801]
23 22 -> Unknown EM2750/EM2751 webcam grabber (em2750) [eb1a:2750,eb1a:2751] 23 22 -> EM2710/EM2750/EM2751 webcam grabber (em2750) [eb1a:2750,eb1a:2751]
24 23 -> Huaqi DLCW-130 (em2750) 24 23 -> Huaqi DLCW-130 (em2750)
25 24 -> D-Link DUB-T210 TV Tuner (em2820/em2840) [2001:f112] 25 24 -> D-Link DUB-T210 TV Tuner (em2820/em2840) [2001:f112]
26 25 -> Gadmei UTV310 (em2820/em2840) 26 25 -> Gadmei UTV310 (em2820/em2840)
@@ -66,3 +66,4 @@
66 68 -> Terratec AV350 (em2860) [0ccd:0084] 66 68 -> Terratec AV350 (em2860) [0ccd:0084]
67 69 -> KWorld ATSC 315U HDTV TV Box (em2882) [eb1a:a313] 67 69 -> KWorld ATSC 315U HDTV TV Box (em2882) [eb1a:a313]
68 70 -> Evga inDtube (em2882) 68 70 -> Evga inDtube (em2882)
69 71 -> Silvercrest Webcam 1.3mpix (em2820/em2840)
diff --git a/Documentation/video4linux/gspca.txt b/Documentation/video4linux/gspca.txt
index 2bcf78896e22..573f95b58807 100644
--- a/Documentation/video4linux/gspca.txt
+++ b/Documentation/video4linux/gspca.txt
@@ -44,7 +44,9 @@ zc3xx 0458:7007 Genius VideoCam V2
44zc3xx 0458:700c Genius VideoCam V3 44zc3xx 0458:700c Genius VideoCam V3
45zc3xx 0458:700f Genius VideoCam Web V2 45zc3xx 0458:700f Genius VideoCam Web V2
46sonixj 0458:7025 Genius Eye 311Q 46sonixj 0458:7025 Genius Eye 311Q
47sn9c20x 0458:7029 Genius Look 320s
47sonixj 0458:702e Genius Slim 310 NB 48sonixj 0458:702e Genius Slim 310 NB
49sn9c20x 045e:00f4 LifeCam VX-6000 (SN9C20x + OV9650)
48sonixj 045e:00f5 MicroSoft VX3000 50sonixj 045e:00f5 MicroSoft VX3000
49sonixj 045e:00f7 MicroSoft VX1000 51sonixj 045e:00f7 MicroSoft VX1000
50ov519 045e:028c Micro$oft xbox cam 52ov519 045e:028c Micro$oft xbox cam
@@ -282,6 +284,28 @@ sonixj 0c45:613a Microdia Sonix PC Camera
282sonixj 0c45:613b Surfer SN-206 284sonixj 0c45:613b Surfer SN-206
283sonixj 0c45:613c Sonix Pccam168 285sonixj 0c45:613c Sonix Pccam168
284sonixj 0c45:6143 Sonix Pccam168 286sonixj 0c45:6143 Sonix Pccam168
287sn9c20x 0c45:6240 PC Camera (SN9C201 + MT9M001)
288sn9c20x 0c45:6242 PC Camera (SN9C201 + MT9M111)
289sn9c20x 0c45:6248 PC Camera (SN9C201 + OV9655)
290sn9c20x 0c45:624e PC Camera (SN9C201 + SOI968)
291sn9c20x 0c45:624f PC Camera (SN9C201 + OV9650)
292sn9c20x 0c45:6251 PC Camera (SN9C201 + OV9650)
293sn9c20x 0c45:6253 PC Camera (SN9C201 + OV9650)
294sn9c20x 0c45:6260 PC Camera (SN9C201 + OV7670)
295sn9c20x 0c45:6270 PC Camera (SN9C201 + MT9V011/MT9V111/MT9V112)
296sn9c20x 0c45:627b PC Camera (SN9C201 + OV7660)
297sn9c20x 0c45:627c PC Camera (SN9C201 + HV7131R)
298sn9c20x 0c45:627f PC Camera (SN9C201 + OV9650)
299sn9c20x 0c45:6280 PC Camera (SN9C202 + MT9M001)
300sn9c20x 0c45:6282 PC Camera (SN9C202 + MT9M111)
301sn9c20x 0c45:6288 PC Camera (SN9C202 + OV9655)
302sn9c20x 0c45:628e PC Camera (SN9C202 + SOI968)
303sn9c20x 0c45:628f PC Camera (SN9C202 + OV9650)
304sn9c20x 0c45:62a0 PC Camera (SN9C202 + OV7670)
305sn9c20x 0c45:62b0 PC Camera (SN9C202 + MT9V011/MT9V111/MT9V112)
306sn9c20x 0c45:62b3 PC Camera (SN9C202 + OV9655)
307sn9c20x 0c45:62bb PC Camera (SN9C202 + OV7660)
308sn9c20x 0c45:62bc PC Camera (SN9C202 + HV7131R)
285sunplus 0d64:0303 Sunplus FashionCam DXG 309sunplus 0d64:0303 Sunplus FashionCam DXG
286etoms 102c:6151 Qcam Sangha CIF 310etoms 102c:6151 Qcam Sangha CIF
287etoms 102c:6251 Qcam xxxxxx VGA 311etoms 102c:6251 Qcam xxxxxx VGA
@@ -290,6 +314,7 @@ spca561 10fd:7e50 FlyCam Usb 100
290zc3xx 10fd:8050 Typhoon Webshot II USB 300k 314zc3xx 10fd:8050 Typhoon Webshot II USB 300k
291ov534 1415:2000 Sony HD Eye for PS3 (SLEH 00201) 315ov534 1415:2000 Sony HD Eye for PS3 (SLEH 00201)
292pac207 145f:013a Trust WB-1300N 316pac207 145f:013a Trust WB-1300N
317sn9c20x 145f:013d Trust WB-3600R
293vc032x 15b8:6001 HP 2.0 Megapixel 318vc032x 15b8:6001 HP 2.0 Megapixel
294vc032x 15b8:6002 HP 2.0 Megapixel rz406aa 319vc032x 15b8:6002 HP 2.0 Megapixel rz406aa
295spca501 1776:501c Arowana 300K CMOS Camera 320spca501 1776:501c Arowana 300K CMOS Camera
@@ -300,4 +325,11 @@ spca500 2899:012c Toptro Industrial
300spca508 8086:0110 Intel Easy PC Camera 325spca508 8086:0110 Intel Easy PC Camera
301spca500 8086:0630 Intel Pocket PC Camera 326spca500 8086:0630 Intel Pocket PC Camera
302spca506 99fa:8988 Grandtec V.cap 327spca506 99fa:8988 Grandtec V.cap
328sn9c20x a168:0610 Dino-Lite Digital Microscope (SN9C201 + HV7131R)
329sn9c20x a168:0611 Dino-Lite Digital Microscope (SN9C201 + HV7131R)
330sn9c20x a168:0613 Dino-Lite Digital Microscope (SN9C201 + HV7131R)
331sn9c20x a168:0618 Dino-Lite Digital Microscope (SN9C201 + HV7131R)
332sn9c20x a168:0614 Dino-Lite Digital Microscope (SN9C201 + MT9M111)
333sn9c20x a168:0615 Dino-Lite Digital Microscope (SN9C201 + MT9M111)
334sn9c20x a168:0617 Dino-Lite Digital Microscope (SN9C201 + MT9M111)
303spca561 abcd:cdee Petcam 335spca561 abcd:cdee Petcam
diff --git a/Documentation/x86/00-INDEX b/Documentation/x86/00-INDEX
index dbe3377754af..f37b46d34861 100644
--- a/Documentation/x86/00-INDEX
+++ b/Documentation/x86/00-INDEX
@@ -2,3 +2,5 @@
2 - this file 2 - this file
3mtrr.txt 3mtrr.txt
4 - how to use x86 Memory Type Range Registers to increase performance 4 - how to use x86 Memory Type Range Registers to increase performance
5exception-tables.txt
6 - why and how Linux kernel uses exception tables on x86
diff --git a/Documentation/exception.txt b/Documentation/x86/exception-tables.txt
index 2d5aded64247..32901aa36f0a 100644
--- a/Documentation/exception.txt
+++ b/Documentation/x86/exception-tables.txt
@@ -1,123 +1,123 @@
1 Kernel level exception handling in Linux 2.1.8 1 Kernel level exception handling in Linux
2 Commentary by Joerg Pommnitz <joerg@raleigh.ibm.com> 2 Commentary by Joerg Pommnitz <joerg@raleigh.ibm.com>
3 3
4When a process runs in kernel mode, it often has to access user 4When a process runs in kernel mode, it often has to access user
5mode memory whose address has been passed by an untrusted program. 5mode memory whose address has been passed by an untrusted program.
6To protect itself the kernel has to verify this address. 6To protect itself the kernel has to verify this address.
7 7
8In older versions of Linux this was done with the 8In older versions of Linux this was done with the
9int verify_area(int type, const void * addr, unsigned long size) 9int verify_area(int type, const void * addr, unsigned long size)
10function (which has since been replaced by access_ok()). 10function (which has since been replaced by access_ok()).
11 11
12This function verified that the memory area starting at address 12This function verified that the memory area starting at address
13'addr' and of size 'size' was accessible for the operation specified 13'addr' and of size 'size' was accessible for the operation specified
14in type (read or write). To do this, verify_read had to look up the 14in type (read or write). To do this, verify_read had to look up the
15virtual memory area (vma) that contained the address addr. In the 15virtual memory area (vma) that contained the address addr. In the
16normal case (correctly working program), this test was successful. 16normal case (correctly working program), this test was successful.
17It only failed for a few buggy programs. In some kernel profiling 17It only failed for a few buggy programs. In some kernel profiling
18tests, this normally unneeded verification used up a considerable 18tests, this normally unneeded verification used up a considerable
19amount of time. 19amount of time.
20 20
21To overcome this situation, Linus decided to let the virtual memory 21To overcome this situation, Linus decided to let the virtual memory
22hardware present in every Linux-capable CPU handle this test. 22hardware present in every Linux-capable CPU handle this test.
23 23
24How does this work? 24How does this work?
25 25
26Whenever the kernel tries to access an address that is currently not 26Whenever the kernel tries to access an address that is currently not
27accessible, the CPU generates a page fault exception and calls the 27accessible, the CPU generates a page fault exception and calls the
28page fault handler 28page fault handler
29 29
30void do_page_fault(struct pt_regs *regs, unsigned long error_code) 30void do_page_fault(struct pt_regs *regs, unsigned long error_code)
31 31
32in arch/i386/mm/fault.c. The parameters on the stack are set up by 32in arch/x86/mm/fault.c. The parameters on the stack are set up by
33the low level assembly glue in arch/i386/kernel/entry.S. The parameter 33the low level assembly glue in arch/x86/kernel/entry_32.S. The parameter
34regs is a pointer to the saved registers on the stack, error_code 34regs is a pointer to the saved registers on the stack, error_code
35contains a reason code for the exception. 35contains a reason code for the exception.
36 36
37do_page_fault first obtains the unaccessible address from the CPU 37do_page_fault first obtains the unaccessible address from the CPU
38control register CR2. If the address is within the virtual address 38control register CR2. If the address is within the virtual address
39space of the process, the fault probably occurred, because the page 39space of the process, the fault probably occurred, because the page
40was not swapped in, write protected or something similar. However, 40was not swapped in, write protected or something similar. However,
41we are interested in the other case: the address is not valid, there 41we are interested in the other case: the address is not valid, there
42is no vma that contains this address. In this case, the kernel jumps 42is no vma that contains this address. In this case, the kernel jumps
43to the bad_area label. 43to the bad_area label.
44 44
45There it uses the address of the instruction that caused the exception 45There it uses the address of the instruction that caused the exception
46(i.e. regs->eip) to find an address where the execution can continue 46(i.e. regs->eip) to find an address where the execution can continue
47(fixup). If this search is successful, the fault handler modifies the 47(fixup). If this search is successful, the fault handler modifies the
48return address (again regs->eip) and returns. The execution will 48return address (again regs->eip) and returns. The execution will
49continue at the address in fixup. 49continue at the address in fixup.
50 50
51Where does fixup point to? 51Where does fixup point to?
52 52
53Since we jump to the contents of fixup, fixup obviously points 53Since we jump to the contents of fixup, fixup obviously points
54to executable code. This code is hidden inside the user access macros. 54to executable code. This code is hidden inside the user access macros.
55I have picked the get_user macro defined in include/asm/uaccess.h as an 55I have picked the get_user macro defined in arch/x86/include/asm/uaccess.h
56example. The definition is somewhat hard to follow, so let's peek at 56as an example. The definition is somewhat hard to follow, so let's peek at
57the code generated by the preprocessor and the compiler. I selected 57the code generated by the preprocessor and the compiler. I selected
58the get_user call in drivers/char/console.c for a detailed examination. 58the get_user call in drivers/char/sysrq.c for a detailed examination.
59 59
60The original code in console.c line 1405: 60The original code in sysrq.c line 587:
61 get_user(c, buf); 61 get_user(c, buf);
62 62
63The preprocessor output (edited to become somewhat readable): 63The preprocessor output (edited to become somewhat readable):
64 64
65( 65(
66 { 66 {
67 long __gu_err = - 14 , __gu_val = 0; 67 long __gu_err = - 14 , __gu_val = 0;
68 const __typeof__(*( ( buf ) )) *__gu_addr = ((buf)); 68 const __typeof__(*( ( buf ) )) *__gu_addr = ((buf));
69 if (((((0 + current_set[0])->tss.segment) == 0x18 ) || 69 if (((((0 + current_set[0])->tss.segment) == 0x18 ) ||
70 (((sizeof(*(buf))) <= 0xC0000000UL) && 70 (((sizeof(*(buf))) <= 0xC0000000UL) &&
71 ((unsigned long)(__gu_addr ) <= 0xC0000000UL - (sizeof(*(buf))))))) 71 ((unsigned long)(__gu_addr ) <= 0xC0000000UL - (sizeof(*(buf)))))))
72 do { 72 do {
73 __gu_err = 0; 73 __gu_err = 0;
74 switch ((sizeof(*(buf)))) { 74 switch ((sizeof(*(buf)))) {
75 case 1: 75 case 1:
76 __asm__ __volatile__( 76 __asm__ __volatile__(
77 "1: mov" "b" " %2,%" "b" "1\n" 77 "1: mov" "b" " %2,%" "b" "1\n"
78 "2:\n" 78 "2:\n"
79 ".section .fixup,\"ax\"\n" 79 ".section .fixup,\"ax\"\n"
80 "3: movl %3,%0\n" 80 "3: movl %3,%0\n"
81 " xor" "b" " %" "b" "1,%" "b" "1\n" 81 " xor" "b" " %" "b" "1,%" "b" "1\n"
82 " jmp 2b\n" 82 " jmp 2b\n"
83 ".section __ex_table,\"a\"\n" 83 ".section __ex_table,\"a\"\n"
84 " .align 4\n" 84 " .align 4\n"
85 " .long 1b,3b\n" 85 " .long 1b,3b\n"
86 ".text" : "=r"(__gu_err), "=q" (__gu_val): "m"((*(struct __large_struct *) 86 ".text" : "=r"(__gu_err), "=q" (__gu_val): "m"((*(struct __large_struct *)
87 ( __gu_addr )) ), "i"(- 14 ), "0"( __gu_err )) ; 87 ( __gu_addr )) ), "i"(- 14 ), "0"( __gu_err )) ;
88 break; 88 break;
89 case 2: 89 case 2:
90 __asm__ __volatile__( 90 __asm__ __volatile__(
91 "1: mov" "w" " %2,%" "w" "1\n" 91 "1: mov" "w" " %2,%" "w" "1\n"
92 "2:\n" 92 "2:\n"
93 ".section .fixup,\"ax\"\n" 93 ".section .fixup,\"ax\"\n"
94 "3: movl %3,%0\n" 94 "3: movl %3,%0\n"
95 " xor" "w" " %" "w" "1,%" "w" "1\n" 95 " xor" "w" " %" "w" "1,%" "w" "1\n"
96 " jmp 2b\n" 96 " jmp 2b\n"
97 ".section __ex_table,\"a\"\n" 97 ".section __ex_table,\"a\"\n"
98 " .align 4\n" 98 " .align 4\n"
99 " .long 1b,3b\n" 99 " .long 1b,3b\n"
100 ".text" : "=r"(__gu_err), "=r" (__gu_val) : "m"((*(struct __large_struct *) 100 ".text" : "=r"(__gu_err), "=r" (__gu_val) : "m"((*(struct __large_struct *)
101 ( __gu_addr )) ), "i"(- 14 ), "0"( __gu_err )); 101 ( __gu_addr )) ), "i"(- 14 ), "0"( __gu_err ));
102 break; 102 break;
103 case 4: 103 case 4:
104 __asm__ __volatile__( 104 __asm__ __volatile__(
105 "1: mov" "l" " %2,%" "" "1\n" 105 "1: mov" "l" " %2,%" "" "1\n"
106 "2:\n" 106 "2:\n"
107 ".section .fixup,\"ax\"\n" 107 ".section .fixup,\"ax\"\n"
108 "3: movl %3,%0\n" 108 "3: movl %3,%0\n"
109 " xor" "l" " %" "" "1,%" "" "1\n" 109 " xor" "l" " %" "" "1,%" "" "1\n"
110 " jmp 2b\n" 110 " jmp 2b\n"
111 ".section __ex_table,\"a\"\n" 111 ".section __ex_table,\"a\"\n"
112 " .align 4\n" " .long 1b,3b\n" 112 " .align 4\n" " .long 1b,3b\n"
113 ".text" : "=r"(__gu_err), "=r" (__gu_val) : "m"((*(struct __large_struct *) 113 ".text" : "=r"(__gu_err), "=r" (__gu_val) : "m"((*(struct __large_struct *)
114 ( __gu_addr )) ), "i"(- 14 ), "0"(__gu_err)); 114 ( __gu_addr )) ), "i"(- 14 ), "0"(__gu_err));
115 break; 115 break;
116 default: 116 default:
117 (__gu_val) = __get_user_bad(); 117 (__gu_val) = __get_user_bad();
118 } 118 }
119 } while (0) ; 119 } while (0) ;
120 ((c)) = (__typeof__(*((buf))))__gu_val; 120 ((c)) = (__typeof__(*((buf))))__gu_val;
121 __gu_err; 121 __gu_err;
122 } 122 }
123); 123);
@@ -127,12 +127,12 @@ see what code gcc generates:
127 127
128 > xorl %edx,%edx 128 > xorl %edx,%edx
129 > movl current_set,%eax 129 > movl current_set,%eax
130 > cmpl $24,788(%eax) 130 > cmpl $24,788(%eax)
131 > je .L1424 131 > je .L1424
132 > cmpl $-1073741825,64(%esp) 132 > cmpl $-1073741825,64(%esp)
133 > ja .L1423 133 > ja .L1423
134 > .L1424: 134 > .L1424:
135 > movl %edx,%eax 135 > movl %edx,%eax
136 > movl 64(%esp),%ebx 136 > movl 64(%esp),%ebx
137 > #APP 137 > #APP
138 > 1: movb (%ebx),%dl /* this is the actual user access */ 138 > 1: movb (%ebx),%dl /* this is the actual user access */
@@ -149,17 +149,17 @@ see what code gcc generates:
149 > .L1423: 149 > .L1423:
150 > movzbl %dl,%esi 150 > movzbl %dl,%esi
151 151
152The optimizer does a good job and gives us something we can actually 152The optimizer does a good job and gives us something we can actually
153understand. Can we? The actual user access is quite obvious. Thanks 153understand. Can we? The actual user access is quite obvious. Thanks
154to the unified address space we can just access the address in user 154to the unified address space we can just access the address in user
155memory. But what does the .section stuff do????? 155memory. But what does the .section stuff do?????
156 156
157To understand this we have to look at the final kernel: 157To understand this we have to look at the final kernel:
158 158
159 > objdump --section-headers vmlinux 159 > objdump --section-headers vmlinux
160 > 160 >
161 > vmlinux: file format elf32-i386 161 > vmlinux: file format elf32-i386
162 > 162 >
163 > Sections: 163 > Sections:
164 > Idx Name Size VMA LMA File off Algn 164 > Idx Name Size VMA LMA File off Algn
165 > 0 .text 00098f40 c0100000 c0100000 00001000 2**4 165 > 0 .text 00098f40 c0100000 c0100000 00001000 2**4
@@ -198,18 +198,18 @@ final kernel executable:
198 198
199The whole user memory access is reduced to 10 x86 machine instructions. 199The whole user memory access is reduced to 10 x86 machine instructions.
200The instructions bracketed in the .section directives are no longer 200The instructions bracketed in the .section directives are no longer
201in the normal execution path. They are located in a different section 201in the normal execution path. They are located in a different section
202of the executable file: 202of the executable file:
203 203
204 > objdump --disassemble --section=.fixup vmlinux 204 > objdump --disassemble --section=.fixup vmlinux
205 > 205 >
206 > c0199ff5 <.fixup+10b5> movl $0xfffffff2,%eax 206 > c0199ff5 <.fixup+10b5> movl $0xfffffff2,%eax
207 > c0199ffa <.fixup+10ba> xorb %dl,%dl 207 > c0199ffa <.fixup+10ba> xorb %dl,%dl
208 > c0199ffc <.fixup+10bc> jmp c017e7a7 <do_con_write+e3> 208 > c0199ffc <.fixup+10bc> jmp c017e7a7 <do_con_write+e3>
209 209
210And finally: 210And finally:
211 > objdump --full-contents --section=__ex_table vmlinux 211 > objdump --full-contents --section=__ex_table vmlinux
212 > 212 >
213 > c01aa7c4 93c017c0 e09f19c0 97c017c0 99c017c0 ................ 213 > c01aa7c4 93c017c0 e09f19c0 97c017c0 99c017c0 ................
214 > c01aa7d4 f6c217c0 e99f19c0 a5e717c0 f59f19c0 ................ 214 > c01aa7d4 f6c217c0 e99f19c0 a5e717c0 f59f19c0 ................
215 > c01aa7e4 080a18c0 01a019c0 0a0a18c0 04a019c0 ................ 215 > c01aa7e4 080a18c0 01a019c0 0a0a18c0 04a019c0 ................
@@ -235,8 +235,8 @@ sections in the ELF object file. So the instructions
235ended up in the .fixup section of the object file and the addresses 235ended up in the .fixup section of the object file and the addresses
236 .long 1b,3b 236 .long 1b,3b
237ended up in the __ex_table section of the object file. 1b and 3b 237ended up in the __ex_table section of the object file. 1b and 3b
238are local labels. The local label 1b (1b stands for next label 1 238are local labels. The local label 1b (1b stands for next label 1
239backward) is the address of the instruction that might fault, i.e. 239backward) is the address of the instruction that might fault, i.e.
240in our case the address of the label 1 is c017e7a5: 240in our case the address of the label 1 is c017e7a5:
241the original assembly code: > 1: movb (%ebx),%dl 241the original assembly code: > 1: movb (%ebx),%dl
242and linked in vmlinux : > c017e7a5 <do_con_write+e1> movb (%ebx),%dl 242and linked in vmlinux : > c017e7a5 <do_con_write+e1> movb (%ebx),%dl
@@ -254,7 +254,7 @@ The assembly code
254becomes the value pair 254becomes the value pair
255 > c01aa7d4 c017c2f6 c0199fe9 c017e7a5 c0199ff5 ................ 255 > c01aa7d4 c017c2f6 c0199fe9 c017e7a5 c0199ff5 ................
256 ^this is ^this is 256 ^this is ^this is
257 1b 3b 257 1b 3b
258c017e7a5,c0199ff5 in the exception table of the kernel. 258c017e7a5,c0199ff5 in the exception table of the kernel.
259 259
260So, what actually happens if a fault from kernel mode with no suitable 260So, what actually happens if a fault from kernel mode with no suitable
@@ -266,9 +266,9 @@ vma occurs?
2663.) CPU calls do_page_fault 2663.) CPU calls do_page_fault
2674.) do page fault calls search_exception_table (regs->eip == c017e7a5); 2674.) do page fault calls search_exception_table (regs->eip == c017e7a5);
2685.) search_exception_table looks up the address c017e7a5 in the 2685.) search_exception_table looks up the address c017e7a5 in the
269 exception table (i.e. the contents of the ELF section __ex_table) 269 exception table (i.e. the contents of the ELF section __ex_table)
270 and returns the address of the associated fault handle code c0199ff5. 270 and returns the address of the associated fault handle code c0199ff5.
2716.) do_page_fault modifies its own return address to point to the fault 2716.) do_page_fault modifies its own return address to point to the fault
272 handle code and returns. 272 handle code and returns.
2737.) execution continues in the fault handling code. 2737.) execution continues in the fault handling code.
2748.) 8a) EAX becomes -EFAULT (== -14) 2748.) 8a) EAX becomes -EFAULT (== -14)
diff --git a/MAINTAINERS b/MAINTAINERS
index 88e8c00ede7f..b1114cfac6bf 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -73,8 +73,8 @@ Note: For the hard of thinking, this list is meant to remain in alphabetical
73order. If you could add yourselves to it in alphabetical order that would be 73order. If you could add yourselves to it in alphabetical order that would be
74so much easier [Ed] 74so much easier [Ed]
75 75
76P: Person 76P: Person (obsolete)
77M: Mail patches to 77M: Mail patches to: FullName <address@domain>
78L: Mailing list that is relevant to this area 78L: Mailing list that is relevant to this area
79W: Web-page with status/info 79W: Web-page with status/info
80T: SCM tree type and location. Type is one of: git, hg, quilt, stgit. 80T: SCM tree type and location. Type is one of: git, hg, quilt, stgit.
@@ -104,88 +104,74 @@ X: Files and directories that are NOT maintained, same rules as F:
104 matches all files in and below net excluding net/ipv6/ 104 matches all files in and below net excluding net/ipv6/
105 105
1063C505 NETWORK DRIVER 1063C505 NETWORK DRIVER
107P: Philip Blundell 107M: Philip Blundell <philb@gnu.org>
108M: philb@gnu.org
109L: netdev@vger.kernel.org 108L: netdev@vger.kernel.org
110S: Maintained 109S: Maintained
111F: drivers/net/3c505* 110F: drivers/net/3c505*
112 111
1133C59X NETWORK DRIVER 1123C59X NETWORK DRIVER
114P: Steffen Klassert 113M: Steffen Klassert <klassert@mathematik.tu-chemnitz.de>
115M: klassert@mathematik.tu-chemnitz.de
116L: netdev@vger.kernel.org 114L: netdev@vger.kernel.org
117S: Maintained 115S: Maintained
118F: Documentation/networking/vortex.txt 116F: Documentation/networking/vortex.txt
119F: drivers/net/3c59x.c 117F: drivers/net/3c59x.c
120 118
1213CR990 NETWORK DRIVER 1193CR990 NETWORK DRIVER
122P: David Dillow 120M: David Dillow <dave@thedillows.org>
123M: dave@thedillows.org
124L: netdev@vger.kernel.org 121L: netdev@vger.kernel.org
125S: Maintained 122S: Maintained
126F: drivers/net/typhoon* 123F: drivers/net/typhoon*
127 124
1283W-9XXX SATA-RAID CONTROLLER DRIVER 1253W-9XXX SATA-RAID CONTROLLER DRIVER
129P: Adam Radford 126M: Adam Radford <linuxraid@amcc.com>
130M: linuxraid@amcc.com
131L: linux-scsi@vger.kernel.org 127L: linux-scsi@vger.kernel.org
132W: http://www.amcc.com 128W: http://www.amcc.com
133S: Supported 129S: Supported
134F: drivers/scsi/3w-9xxx* 130F: drivers/scsi/3w-9xxx*
135 131
1363W-XXXX ATA-RAID CONTROLLER DRIVER 1323W-XXXX ATA-RAID CONTROLLER DRIVER
137P: Adam Radford 133M: Adam Radford <linuxraid@amcc.com>
138M: linuxraid@amcc.com
139L: linux-scsi@vger.kernel.org 134L: linux-scsi@vger.kernel.org
140W: http://www.amcc.com 135W: http://www.amcc.com
141S: Supported 136S: Supported
142F: drivers/scsi/3w-xxxx* 137F: drivers/scsi/3w-xxxx*
143 138
14453C700 AND 53C700-66 SCSI DRIVER 13953C700 AND 53C700-66 SCSI DRIVER
145P: James E.J. Bottomley 140M: "James E.J. Bottomley" <James.Bottomley@HansenPartnership.com>
146M: James.Bottomley@HansenPartnership.com
147L: linux-scsi@vger.kernel.org 141L: linux-scsi@vger.kernel.org
148S: Maintained 142S: Maintained
149F: drivers/scsi/53c700* 143F: drivers/scsi/53c700*
150 144
1516PACK NETWORK DRIVER FOR AX.25 1456PACK NETWORK DRIVER FOR AX.25
152P: Andreas Koensgen 146M: Andreas Koensgen <ajk@comnets.uni-bremen.de>
153M: ajk@comnets.uni-bremen.de
154L: linux-hams@vger.kernel.org 147L: linux-hams@vger.kernel.org
155S: Maintained 148S: Maintained
156F: drivers/net/hamradio/6pack.c 149F: drivers/net/hamradio/6pack.c
157 150
1588169 10/100/1000 GIGABIT ETHERNET DRIVER 1518169 10/100/1000 GIGABIT ETHERNET DRIVER
159P: Francois Romieu 152M: Francois Romieu <romieu@fr.zoreil.com>
160M: romieu@fr.zoreil.com
161L: netdev@vger.kernel.org 153L: netdev@vger.kernel.org
162S: Maintained 154S: Maintained
163F: drivers/net/r8169.c 155F: drivers/net/r8169.c
164 156
1658250/16?50 (AND CLONE UARTS) SERIAL DRIVER 1578250/16?50 (AND CLONE UARTS) SERIAL DRIVER
166P: Alan Cox
167M: alan@lxorguk.ukuu.org.uk
168L: linux-serial@vger.kernel.org 158L: linux-serial@vger.kernel.org
169W: http://serial.sourceforge.net 159W: http://serial.sourceforge.net
170S: Odd Fixes 160S: Orphan
171F: drivers/serial/8250* 161F: drivers/serial/8250*
172F: include/linux/serial_8250.h 162F: include/linux/serial_8250.h
173 163
1748390 NETWORK DRIVERS [WD80x3/SMC-ELITE, SMC-ULTRA, NE2000, 3C503, etc.] 1648390 NETWORK DRIVERS [WD80x3/SMC-ELITE, SMC-ULTRA, NE2000, 3C503, etc.]
175P: Paul Gortmaker 165M: Paul Gortmaker <p_gortmaker@yahoo.com>
176M: p_gortmaker@yahoo.com
177L: netdev@vger.kernel.org 166L: netdev@vger.kernel.org
178S: Maintained 167S: Maintained
179F: drivers/net/*8390* 168F: drivers/net/*8390*
180F: drivers/net/ax88796.c 169F: drivers/net/ax88796.c
181 170
1829P FILE SYSTEM 1719P FILE SYSTEM
183P: Eric Van Hensbergen 172M: Eric Van Hensbergen <ericvh@gmail.com>
184M: ericvh@gmail.com 173M: Ron Minnich <rminnich@sandia.gov>
185P: Ron Minnich 174M: Latchesar Ionkov <lucho@ionkov.net>
186M: rminnich@sandia.gov
187P: Latchesar Ionkov
188M: lucho@ionkov.net
189L: v9fs-developer@lists.sourceforge.net 175L: v9fs-developer@lists.sourceforge.net
190W: http://swik.net/v9fs 176W: http://swik.net/v9fs
191T: git git://git.kernel.org/pub/scm/linux/kernel/ericvh/v9fs.git 177T: git git://git.kernel.org/pub/scm/linux/kernel/ericvh/v9fs.git
@@ -194,15 +180,13 @@ F: Documentation/filesystems/9p.txt
194F: fs/9p/ 180F: fs/9p/
195 181
196A2232 SERIAL BOARD DRIVER 182A2232 SERIAL BOARD DRIVER
197P: Enver Haase 183M: Enver Haase <A2232@gmx.net>
198M: A2232@gmx.net
199L: linux-m68k@lists.linux-m68k.org 184L: linux-m68k@lists.linux-m68k.org
200S: Maintained 185S: Maintained
201F: drivers/char/ser_a2232* 186F: drivers/char/ser_a2232*
202 187
203AACRAID SCSI RAID DRIVER 188AACRAID SCSI RAID DRIVER
204P: Adaptec OEM Raid Solutions 189M: Adaptec OEM Raid Solutions <aacraid@adaptec.com>
205M: aacraid@adaptec.com
206L: linux-scsi@vger.kernel.org 190L: linux-scsi@vger.kernel.org
207W: http://www.adaptec.com/ 191W: http://www.adaptec.com/
208S: Supported 192S: Supported
@@ -210,44 +194,38 @@ F: Documentation/scsi/aacraid.txt
210F: drivers/scsi/aacraid/ 194F: drivers/scsi/aacraid/
211 195
212ABIT UGURU 1,2 HARDWARE MONITOR DRIVER 196ABIT UGURU 1,2 HARDWARE MONITOR DRIVER
213P: Hans de Goede 197M: Hans de Goede <j.w.r.degoede@hhs.nl>
214M: j.w.r.degoede@hhs.nl
215L: lm-sensors@lm-sensors.org 198L: lm-sensors@lm-sensors.org
216S: Maintained 199S: Maintained
217F: drivers/hwmon/abituguru.c 200F: drivers/hwmon/abituguru.c
218 201
219ABIT UGURU 3 HARDWARE MONITOR DRIVER 202ABIT UGURU 3 HARDWARE MONITOR DRIVER
220P: Alistair John Strachan 203M: Alistair John Strachan <alistair@devzero.co.uk>
221M: alistair@devzero.co.uk
222L: lm-sensors@lm-sensors.org 204L: lm-sensors@lm-sensors.org
223S: Maintained 205S: Maintained
224F: drivers/hwmon/abituguru3.c 206F: drivers/hwmon/abituguru3.c
225 207
226ACENIC DRIVER 208ACENIC DRIVER
227P: Jes Sorensen 209M: Jes Sorensen <jes@trained-monkey.org>
228M: jes@trained-monkey.org
229L: linux-acenic@sunsite.dk 210L: linux-acenic@sunsite.dk
230S: Maintained 211S: Maintained
231F: drivers/net/acenic* 212F: drivers/net/acenic*
232 213
233ACER ASPIRE ONE TEMPERATURE AND FAN DRIVER 214ACER ASPIRE ONE TEMPERATURE AND FAN DRIVER
234P: Peter Feuerer 215M: Peter Feuerer <peter@piie.net>
235M: peter@piie.net 216W: http://piie.net/?section=acerhdf
236W: http://piie.net/?section=acerhdf 217S: Maintained
237S: Maintained 218F: drivers/platform/x86/acerhdf.c
238F: drivers/platform/x86/acerhdf.c
239 219
240ACER WMI LAPTOP EXTRAS 220ACER WMI LAPTOP EXTRAS
241P: Carlos Corbacho 221M: Carlos Corbacho <carlos@strangeworlds.co.uk>
242M: carlos@strangeworlds.co.uk
243L: aceracpi@googlegroups.com (subscribers-only) 222L: aceracpi@googlegroups.com (subscribers-only)
244W: http://code.google.com/p/aceracpi 223W: http://code.google.com/p/aceracpi
245S: Maintained 224S: Maintained
246F: drivers/platform/x86/acer-wmi.c 225F: drivers/platform/x86/acer-wmi.c
247 226
248ACPI 227ACPI
249P: Len Brown 228M: Len Brown <lenb@kernel.org>
250M: lenb@kernel.org
251L: linux-acpi@vger.kernel.org 229L: linux-acpi@vger.kernel.org
252W: http://www.lesswatts.org/projects/acpi/ 230W: http://www.lesswatts.org/projects/acpi/
253T: git git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6.git 231T: git git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6.git
@@ -257,8 +235,7 @@ F: drivers/pnp/pnpacpi/
257F: include/linux/acpi.h 235F: include/linux/acpi.h
258 236
259ACPI BATTERY DRIVERS 237ACPI BATTERY DRIVERS
260P: Alexey Starikovskiy 238M: Alexey Starikovskiy <astarikovskiy@suse.de>
261M: astarikovskiy@suse.de
262L: linux-acpi@vger.kernel.org 239L: linux-acpi@vger.kernel.org
263W: http://www.lesswatts.org/projects/acpi/ 240W: http://www.lesswatts.org/projects/acpi/
264S: Supported 241S: Supported
@@ -266,80 +243,69 @@ F: drivers/acpi/battery.c
266F: drivers/acpi/*sbs* 243F: drivers/acpi/*sbs*
267 244
268ACPI EC DRIVER 245ACPI EC DRIVER
269P: Alexey Starikovskiy 246M: Alexey Starikovskiy <astarikovskiy@suse.de>
270M: astarikovskiy@suse.de
271L: linux-acpi@vger.kernel.org 247L: linux-acpi@vger.kernel.org
272W: http://www.lesswatts.org/projects/acpi/ 248W: http://www.lesswatts.org/projects/acpi/
273S: Supported 249S: Supported
274F: drivers/acpi/ec.c 250F: drivers/acpi/ec.c
275 251
276ACPI FAN DRIVER 252ACPI FAN DRIVER
277P: Zhang Rui 253M: Zhang Rui <rui.zhang@intel.com>
278M: rui.zhang@intel.com
279L: linux-acpi@vger.kernel.org 254L: linux-acpi@vger.kernel.org
280W: http://www.lesswatts.org/projects/acpi/ 255W: http://www.lesswatts.org/projects/acpi/
281S: Supported 256S: Supported
282F: drivers/acpi/fan.c 257F: drivers/acpi/fan.c
283 258
284ACPI PCI HOTPLUG DRIVER 259ACPI PCI HOTPLUG DRIVER
285P: Kristen Carlson Accardi 260M: Kristen Carlson Accardi <kristen.c.accardi@intel.com>
286M: kristen.c.accardi@intel.com
287L: linux-pci@vger.kernel.org 261L: linux-pci@vger.kernel.org
288S: Supported 262S: Supported
289F: drivers/pci/hotplug/acpi* 263F: drivers/pci/hotplug/acpi*
290 264
291ACPI THERMAL DRIVER 265ACPI THERMAL DRIVER
292P: Zhang Rui 266M: Zhang Rui <rui.zhang@intel.com>
293M: rui.zhang@intel.com
294L: linux-acpi@vger.kernel.org 267L: linux-acpi@vger.kernel.org
295W: http://www.lesswatts.org/projects/acpi/ 268W: http://www.lesswatts.org/projects/acpi/
296S: Supported 269S: Supported
297F: drivers/acpi/*thermal* 270F: drivers/acpi/*thermal*
298 271
299ACPI VIDEO DRIVER 272ACPI VIDEO DRIVER
300P: Zhang Rui 273M: Zhang Rui <rui.zhang@intel.com>
301M: rui.zhang@intel.com
302L: linux-acpi@vger.kernel.org 274L: linux-acpi@vger.kernel.org
303W: http://www.lesswatts.org/projects/acpi/ 275W: http://www.lesswatts.org/projects/acpi/
304S: Supported 276S: Supported
305F: drivers/acpi/video.c 277F: drivers/acpi/video.c
306 278
307ACPI WMI DRIVER 279ACPI WMI DRIVER
308P: Carlos Corbacho 280M: Carlos Corbacho <carlos@strangeworlds.co.uk>
309M: carlos@strangeworlds.co.uk
310L: linux-acpi@vger.kernel.org 281L: linux-acpi@vger.kernel.org
311W: http://www.lesswatts.org/projects/acpi/ 282W: http://www.lesswatts.org/projects/acpi/
312S: Maintained 283S: Maintained
313F: drivers/platform/x86/wmi.c 284F: drivers/platform/x86/wmi.c
314 285
315AD1889 ALSA SOUND DRIVER 286AD1889 ALSA SOUND DRIVER
316P: Kyle McMartin 287M: Kyle McMartin <kyle@mcmartin.ca>
317M: kyle@mcmartin.ca 288M: Thibaut Varene <T-Bone@parisc-linux.org>
318P: Thibaut Varene
319M: T-Bone@parisc-linux.org
320W: http://wiki.parisc-linux.org/AD1889 289W: http://wiki.parisc-linux.org/AD1889
321L: linux-parisc@vger.kernel.org 290L: linux-parisc@vger.kernel.org
322S: Maintained 291S: Maintained
323F: sound/pci/ad1889.* 292F: sound/pci/ad1889.*
324 293
325ADM1025 HARDWARE MONITOR DRIVER 294ADM1025 HARDWARE MONITOR DRIVER
326P: Jean Delvare 295M: Jean Delvare <khali@linux-fr.org>
327M: khali@linux-fr.org
328L: lm-sensors@lm-sensors.org 296L: lm-sensors@lm-sensors.org
329S: Maintained 297S: Maintained
330F: Documentation/hwmon/adm1025 298F: Documentation/hwmon/adm1025
331F: drivers/hwmon/adm1025.c 299F: drivers/hwmon/adm1025.c
332 300
333ADM1029 HARDWARE MONITOR DRIVER 301ADM1029 HARDWARE MONITOR DRIVER
334P: Corentin Labbe 302M: Corentin Labbe <corentin.labbe@geomatys.fr>
335M: corentin.labbe@geomatys.fr
336L: lm-sensors@lm-sensors.org 303L: lm-sensors@lm-sensors.org
337S: Maintained 304S: Maintained
338F: drivers/hwmon/adm1029.c 305F: drivers/hwmon/adm1029.c
339 306
340ADM8211 WIRELESS DRIVER 307ADM8211 WIRELESS DRIVER
341P: Michael Wu 308M: Michael Wu <flamingice@sourmilk.net>
342M: flamingice@sourmilk.net
343L: linux-wireless@vger.kernel.org 309L: linux-wireless@vger.kernel.org
344W: http://linuxwireless.org/ 310W: http://linuxwireless.org/
345T: git git://git.kernel.org/pub/scm/linux/kernel/git/mwu/mac80211-drivers.git 311T: git git://git.kernel.org/pub/scm/linux/kernel/git/mwu/mac80211-drivers.git
@@ -347,35 +313,30 @@ S: Maintained
347F: drivers/net/wireless/adm8211.* 313F: drivers/net/wireless/adm8211.*
348 314
349ADT746X FAN DRIVER 315ADT746X FAN DRIVER
350P: Colin Leroy 316M: Colin Leroy <colin@colino.net>
351M: colin@colino.net
352S: Maintained 317S: Maintained
353F: drivers/macintosh/therm_adt746x.c 318F: drivers/macintosh/therm_adt746x.c
354 319
355ADVANSYS SCSI DRIVER 320ADVANSYS SCSI DRIVER
356P: Matthew Wilcox 321M: Matthew Wilcox <matthew@wil.cx>
357M: matthew@wil.cx
358L: linux-scsi@vger.kernel.org 322L: linux-scsi@vger.kernel.org
359S: Maintained 323S: Maintained
360F: Documentation/scsi/advansys.txt 324F: Documentation/scsi/advansys.txt
361F: drivers/scsi/advansys.c 325F: drivers/scsi/advansys.c
362 326
363AEDSP16 DRIVER 327AEDSP16 DRIVER
364P: Riccardo Facchetti 328M: Riccardo Facchetti <fizban@tin.it>
365M: fizban@tin.it
366S: Maintained 329S: Maintained
367F: sound/oss/aedsp16.c 330F: sound/oss/aedsp16.c
368 331
369AFFS FILE SYSTEM 332AFFS FILE SYSTEM
370P: Roman Zippel 333M: Roman Zippel <zippel@linux-m68k.org>
371M: zippel@linux-m68k.org
372S: Maintained 334S: Maintained
373F: Documentation/filesystems/affs.txt 335F: Documentation/filesystems/affs.txt
374F: fs/affs/ 336F: fs/affs/
375 337
376AFS FILESYSTEM & AF_RXRPC SOCKET DOMAIN 338AFS FILESYSTEM & AF_RXRPC SOCKET DOMAIN
377P: David Howells 339M: David Howells <dhowells@redhat.com>
378M: dhowells@redhat.com
379L: linux-afs@lists.infradead.org 340L: linux-afs@lists.infradead.org
380S: Supported 341S: Supported
381F: fs/afs/ 342F: fs/afs/
@@ -383,40 +344,35 @@ F: include/net/af_rxrpc.h
383F: net/rxrpc/af_rxrpc.c 344F: net/rxrpc/af_rxrpc.c
384 345
385AGPGART DRIVER 346AGPGART DRIVER
386P: David Airlie 347M: David Airlie <airlied@linux.ie>
387M: airlied@linux.ie
388T: git git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6.git 348T: git git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6.git
389S: Maintained 349S: Maintained
390F: drivers/char/agp/ 350F: drivers/char/agp/
391F: include/linux/agp* 351F: include/linux/agp*
392 352
393AHA152X SCSI DRIVER 353AHA152X SCSI DRIVER
394P: Juergen E. Fischer 354M: "Juergen E. Fischer" <fischer@norbit.de>
395M: fischer@norbit.de
396L: linux-scsi@vger.kernel.org 355L: linux-scsi@vger.kernel.org
397S: Maintained 356S: Maintained
398F: drivers/scsi/aha152x* 357F: drivers/scsi/aha152x*
399F: drivers/scsi/pcmcia/aha152x* 358F: drivers/scsi/pcmcia/aha152x*
400 359
401AIC7XXX / AIC79XX SCSI DRIVER 360AIC7XXX / AIC79XX SCSI DRIVER
402P: Hannes Reinecke 361M: Hannes Reinecke <hare@suse.de>
403M: hare@suse.de
404L: linux-scsi@vger.kernel.org 362L: linux-scsi@vger.kernel.org
405S: Maintained 363S: Maintained
406F: drivers/scsi/aic7xxx/ 364F: drivers/scsi/aic7xxx/
407F: drivers/scsi/aic7xxx_old/ 365F: drivers/scsi/aic7xxx_old/
408 366
409AIO 367AIO
410P: Benjamin LaHaise 368M: Benjamin LaHaise <bcrl@kvack.org>
411M: bcrl@kvack.org
412L: linux-aio@kvack.org 369L: linux-aio@kvack.org
413S: Supported 370S: Supported
414F: fs/aio.c 371F: fs/aio.c
415F: include/linux/*aio*.h 372F: include/linux/*aio*.h
416 373
417ALCATEL SPEEDTOUCH USB DRIVER 374ALCATEL SPEEDTOUCH USB DRIVER
418P: Duncan Sands 375M: Duncan Sands <duncan.sands@free.fr>
419M: duncan.sands@free.fr
420L: linux-usb@vger.kernel.org 376L: linux-usb@vger.kernel.org
421W: http://www.linux-usb.org/SpeedTouch/ 377W: http://www.linux-usb.org/SpeedTouch/
422S: Maintained 378S: Maintained
@@ -424,32 +380,27 @@ F: drivers/usb/atm/speedtch.c
424F: drivers/usb/atm/usbatm.c 380F: drivers/usb/atm/usbatm.c
425 381
426ALCHEMY AU1XX0 MMC DRIVER 382ALCHEMY AU1XX0 MMC DRIVER
427P: Manuel Lauss 383M: Manuel Lauss <manuel.lauss@gmail.com>
428M: manuel.lauss@gmail.com
429S: Maintained 384S: Maintained
430F: drivers/mmc/host/au1xmmc.c 385F: drivers/mmc/host/au1xmmc.c
431 386
432ALI1563 I2C DRIVER 387ALI1563 I2C DRIVER
433P: Rudolf Marek 388M: Rudolf Marek <r.marek@assembler.cz>
434M: r.marek@assembler.cz
435L: linux-i2c@vger.kernel.org 389L: linux-i2c@vger.kernel.org
436S: Maintained 390S: Maintained
437F: Documentation/i2c/busses/i2c-ali1563 391F: Documentation/i2c/busses/i2c-ali1563
438F: drivers/i2c/busses/i2c-ali1563.c 392F: drivers/i2c/busses/i2c-ali1563.c
439 393
440ALPHA PORT 394ALPHA PORT
441P: Richard Henderson 395M: Richard Henderson <rth@twiddle.net>
442M: rth@twiddle.net
443S: Odd Fixes for 2.4; Maintained for 2.6. 396S: Odd Fixes for 2.4; Maintained for 2.6.
444P: Ivan Kokshaysky 397M: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
445M: ink@jurassic.park.msu.ru
446S: Maintained for 2.4; PCI support for 2.6. 398S: Maintained for 2.4; PCI support for 2.6.
447L: linux-alpha@vger.kernel.org 399L: linux-alpha@vger.kernel.org
448F: arch/alpha/ 400F: arch/alpha/
449 401
450AMD GEODE CS5536 USB DEVICE CONTROLLER DRIVER 402AMD GEODE CS5536 USB DEVICE CONTROLLER DRIVER
451P: Thomas Dahlmann 403M: Thomas Dahlmann <dahlmann.thomas@arcor.de>
452M: dahlmann.thomas@arcor.de
453L: linux-geode@lists.infradead.org (moderated for non-subscribers) 404L: linux-geode@lists.infradead.org (moderated for non-subscribers)
454S: Supported 405S: Supported
455F: drivers/usb/gadget/amd5536udc.* 406F: drivers/usb/gadget/amd5536udc.*
@@ -466,8 +417,7 @@ F: drivers/video/geode/
466F: arch/x86/include/asm/geode.h 417F: arch/x86/include/asm/geode.h
467 418
468AMD IOMMU (AMD-VI) 419AMD IOMMU (AMD-VI)
469P: Joerg Roedel 420M: Joerg Roedel <joerg.roedel@amd.com>
470M: joerg.roedel@amd.com
471L: iommu@lists.linux-foundation.org 421L: iommu@lists.linux-foundation.org
472T: git git://git.kernel.org/pub/scm/linux/kernel/git/joro/linux-2.6-iommu.git 422T: git git://git.kernel.org/pub/scm/linux/kernel/git/joro/linux-2.6-iommu.git
473S: Supported 423S: Supported
@@ -475,40 +425,33 @@ F: arch/x86/kernel/amd_iommu*.c
475F: arch/x86/include/asm/amd_iommu*.h 425F: arch/x86/include/asm/amd_iommu*.h
476 426
477AMD MICROCODE UPDATE SUPPORT 427AMD MICROCODE UPDATE SUPPORT
478P: Andreas Herrmann 428M: Andreas Herrmann <andreas.herrmann3@amd.com>
479M: andreas.herrmann3@amd.com
480L: amd64-microcode@amd64.org 429L: amd64-microcode@amd64.org
481S: Supported 430S: Supported
482F: arch/x86/kernel/microcode_amd.c 431F: arch/x86/kernel/microcode_amd.c
483 432
484AMS (Apple Motion Sensor) DRIVER 433AMS (Apple Motion Sensor) DRIVER
485P: Stelian Pop 434M: Stelian Pop <stelian@popies.net>
486M: stelian@popies.net 435M: Michael Hanselmann <linux-kernel@hansmi.ch>
487P: Michael Hanselmann
488M: linux-kernel@hansmi.ch
489S: Supported 436S: Supported
490F: drivers/hwmon/ams/ 437F: drivers/hwmon/ams/
491 438
492AMSO1100 RNIC DRIVER 439AMSO1100 RNIC DRIVER
493P: Tom Tucker 440M: Tom Tucker <tom@opengridcomputing.com>
494M: tom@opengridcomputing.com 441M: Steve Wise <swise@opengridcomputing.com>
495P: Steve Wise
496M: swise@opengridcomputing.com
497L: general@lists.openfabrics.org 442L: general@lists.openfabrics.org
498S: Maintained 443S: Maintained
499F: drivers/infiniband/hw/amso1100/ 444F: drivers/infiniband/hw/amso1100/
500 445
501AOA (Apple Onboard Audio) ALSA DRIVER 446AOA (Apple Onboard Audio) ALSA DRIVER
502P: Johannes Berg 447M: Johannes Berg <johannes@sipsolutions.net>
503M: johannes@sipsolutions.net
504L: linuxppc-dev@ozlabs.org 448L: linuxppc-dev@ozlabs.org
505L: alsa-devel@alsa-project.org (moderated for non-subscribers) 449L: alsa-devel@alsa-project.org (moderated for non-subscribers)
506S: Maintained 450S: Maintained
507F: sound/aoa/ 451F: sound/aoa/
508 452
509APM DRIVER 453APM DRIVER
510P: Stephen Rothwell 454M: Stephen Rothwell <sfr@canb.auug.org.au>
511M: sfr@canb.auug.org.au
512L: linux-laptop@vger.kernel.org 455L: linux-laptop@vger.kernel.org
513W: http://www.canb.auug.org.au/~sfr/ 456W: http://www.canb.auug.org.au/~sfr/
514S: Supported 457S: Supported
@@ -516,51 +459,44 @@ F: arch/x86/kernel/apm_32.c
516F: include/linux/apm_bios.h 459F: include/linux/apm_bios.h
517 460
518APPLE BCM5974 MULTITOUCH DRIVER 461APPLE BCM5974 MULTITOUCH DRIVER
519P: Henrik Rydberg 462M: Henrik Rydberg <rydberg@euromail.se>
520M: rydberg@euromail.se
521L: linux-input@vger.kernel.org 463L: linux-input@vger.kernel.org
522S: Maintained 464S: Maintained
523F: drivers/input/mouse/bcm5974.c 465F: drivers/input/mouse/bcm5974.c
524 466
525APPLE SMC DRIVER 467APPLE SMC DRIVER
526P: Nicolas Boichat 468M: Nicolas Boichat <nicolas@boichat.ch>
527M: nicolas@boichat.ch
528L: mactel-linux-devel@lists.sourceforge.net 469L: mactel-linux-devel@lists.sourceforge.net
529S: Maintained 470S: Maintained
530F: drivers/hwmon/applesmc.c 471F: drivers/hwmon/applesmc.c
531 472
532APPLETALK NETWORK LAYER 473APPLETALK NETWORK LAYER
533P: Arnaldo Carvalho de Melo 474M: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
534M: acme@ghostprotocols.net
535S: Maintained 475S: Maintained
536F: drivers/net/appletalk/ 476F: drivers/net/appletalk/
537F: net/appletalk/ 477F: net/appletalk/
538 478
539APPLETOUCH TOUCHPAD DRIVER 479APPLETOUCH TOUCHPAD DRIVER
540P: Johannes Berg 480M: Johannes Berg <johannes@sipsolutions.net>
541M: johannes@sipsolutions.net
542L: linux-input@vger.kernel.org 481L: linux-input@vger.kernel.org
543S: Maintained 482S: Maintained
544F: Documentation/input/appletouch.txt 483F: Documentation/input/appletouch.txt
545F: drivers/input/mouse/appletouch.c 484F: drivers/input/mouse/appletouch.c
546 485
547ARC FRAMEBUFFER DRIVER 486ARC FRAMEBUFFER DRIVER
548P: Jaya Kumar 487M: Jaya Kumar <jayalk@intworks.biz>
549M: jayalk@intworks.biz
550S: Maintained 488S: Maintained
551F: drivers/video/arcfb.c 489F: drivers/video/arcfb.c
552F: drivers/video/fb_defio.c 490F: drivers/video/fb_defio.c
553 491
554ARM MFM AND FLOPPY DRIVERS 492ARM MFM AND FLOPPY DRIVERS
555P: Ian Molton 493M: Ian Molton <spyro@f2s.com>
556M: spyro@f2s.com
557S: Maintained 494S: Maintained
558F: arch/arm/lib/floppydma.S 495F: arch/arm/lib/floppydma.S
559F: arch/arm/include/asm/floppy.h 496F: arch/arm/include/asm/floppy.h
560 497
561ARM PORT 498ARM PORT
562P: Russell King 499M: Russell King <linux@arm.linux.org.uk>
563M: linux@arm.linux.org.uk
564L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only) 500L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only)
565W: http://www.arm.linux.org.uk/ 501W: http://www.arm.linux.org.uk/
566S: Maintained 502S: Maintained
@@ -571,79 +507,67 @@ S: Orphan
571F: drivers/mmc/host/mmci.* 507F: drivers/mmc/host/mmci.*
572 508
573ARM/ADI ROADRUNNER MACHINE SUPPORT 509ARM/ADI ROADRUNNER MACHINE SUPPORT
574P: Lennert Buytenhek 510M: Lennert Buytenhek <kernel@wantstofly.org>
575M: kernel@wantstofly.org
576L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only) 511L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only)
577S: Maintained 512S: Maintained
578F: arch/arm/mach-ixp23xx/ 513F: arch/arm/mach-ixp23xx/
579F: arch/arm/mach-ixp23xx/include/mach/ 514F: arch/arm/mach-ixp23xx/include/mach/
580 515
581ARM/ADS SPHERE MACHINE SUPPORT 516ARM/ADS SPHERE MACHINE SUPPORT
582P: Lennert Buytenhek 517M: Lennert Buytenhek <kernel@wantstofly.org>
583M: kernel@wantstofly.org
584L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only) 518L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only)
585S: Maintained 519S: Maintained
586 520
587ARM/AFEB9260 MACHINE SUPPORT 521ARM/AFEB9260 MACHINE SUPPORT
588P: Sergey Lapin 522M: Sergey Lapin <slapin@ossfans.org>
589M: slapin@ossfans.org
590L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only) 523L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only)
591S: Maintained 524S: Maintained
592 525
593ARM/AJECO 1ARM MACHINE SUPPORT 526ARM/AJECO 1ARM MACHINE SUPPORT
594P: Lennert Buytenhek 527M: Lennert Buytenhek <kernel@wantstofly.org>
595M: kernel@wantstofly.org
596L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only) 528L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only)
597S: Maintained 529S: Maintained
598 530
599ARM/ATMEL AT91RM9200 ARM ARCHITECTURE 531ARM/ATMEL AT91RM9200 ARM ARCHITECTURE
600P: Andrew Victor 532M: Andrew Victor <linux@maxim.org.za>
601M: linux@maxim.org.za
602L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only) 533L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only)
603W: http://maxim.org.za/at91_26.html 534W: http://maxim.org.za/at91_26.html
604S: Maintained 535S: Maintained
605 536
606ARM/CIRRUS LOGIC EP93XX ARM ARCHITECTURE 537ARM/CIRRUS LOGIC EP93XX ARM ARCHITECTURE
607P: Lennert Buytenhek 538M: Lennert Buytenhek <kernel@wantstofly.org>
608M: kernel@wantstofly.org
609L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only) 539L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only)
610S: Maintained 540S: Maintained
611 541
612ARM/CIRRUS LOGIC EDB9315A MACHINE SUPPORT 542ARM/CIRRUS LOGIC EDB9315A MACHINE SUPPORT
613P: Lennert Buytenhek 543M: Lennert Buytenhek <kernel@wantstofly.org>
614M: kernel@wantstofly.org
615L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only) 544L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only)
616S: Maintained 545S: Maintained
617 546
618ARM/CLKDEV SUPPORT 547ARM/CLKDEV SUPPORT
619P: Russell King 548M: Russell King <linux@arm.linux.org.uk>
620M: linux@arm.linux.org.uk
621L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only) 549L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only)
622F: arch/arm/common/clkdev.c 550F: arch/arm/common/clkdev.c
623F: arch/arm/include/asm/clkdev.h 551F: arch/arm/include/asm/clkdev.h
624 552
625ARM/COMPULAB CM-X270/EM-X270 and CM-X300 MACHINE SUPPORT 553ARM/COMPULAB CM-X270/EM-X270 and CM-X300 MACHINE SUPPORT
626P: Mike Rapoport 554M: Mike Rapoport <mike@compulab.co.il>
627M: mike@compulab.co.il
628L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only) 555L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only)
629S: Maintained 556S: Maintained
630 557
631ARM/CORGI MACHINE SUPPORT 558ARM/CORGI MACHINE SUPPORT
632P: Richard Purdie 559M: Richard Purdie <rpurdie@rpsys.net>
633M: rpurdie@rpsys.net
634S: Maintained 560S: Maintained
635 561
636ARM/CORTINA SYSTEMS GEMINI ARM ARCHITECTURE 562ARM/CORTINA SYSTEMS GEMINI ARM ARCHITECTURE
637P: Paulius Zaleckas 563M: Paulius Zaleckas <paulius.zaleckas@teltonika.lt>
638M: paulius.zaleckas@teltonika.lt
639L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only) 564L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only)
640T: git git://gitorious.org/linux-gemini/mainline.git 565T: git git://gitorious.org/linux-gemini/mainline.git
641S: Maintained 566S: Maintained
642F: arch/arm/mach-gemini/ 567F: arch/arm/mach-gemini/
643 568
644ARM/EBSA110 MACHINE SUPPORT 569ARM/EBSA110 MACHINE SUPPORT
645P: Russell King 570M: Russell King <linux@arm.linux.org.uk>
646M: linux@arm.linux.org.uk
647L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only) 571L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only)
648W: http://www.arm.linux.org.uk/ 572W: http://www.arm.linux.org.uk/
649S: Maintained 573S: Maintained
@@ -651,12 +575,9 @@ F: arch/arm/mach-ebsa110/
651F: drivers/net/arm/am79c961a.* 575F: drivers/net/arm/am79c961a.*
652 576
653ARM/EZX SMARTPHONES (A780, A910, A1200, E680, ROKR E2 and ROKR E6) 577ARM/EZX SMARTPHONES (A780, A910, A1200, E680, ROKR E2 and ROKR E6)
654P: Daniel Ribeiro 578M: Daniel Ribeiro <drwyrm@gmail.com>
655M: drwyrm@gmail.com 579M: Stefan Schmidt <stefan@openezx.org>
656P: Stefan Schmidt 580M: Harald Welte <laforge@openezx.org>
657M: stefan@openezx.org
658P: Harald Welte
659M: laforge@openezx.org
660L: openezx-devel@lists.openezx.org (subscribers-only) 581L: openezx-devel@lists.openezx.org (subscribers-only)
661W: http://www.openezx.org/ 582W: http://www.openezx.org/
662S: Maintained 583S: Maintained
@@ -664,15 +585,13 @@ T: topgit git://git.openezx.org/openezx.git
664F: arch/arm/mach-pxa/ezx.c 585F: arch/arm/mach-pxa/ezx.c
665 586
666ARM/FARADAY FA526 PORT 587ARM/FARADAY FA526 PORT
667P: Paulius Zaleckas 588M: Paulius Zaleckas <paulius.zaleckas@teltonika.lt>
668M: paulius.zaleckas@teltonika.lt
669L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only) 589L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only)
670S: Maintained 590S: Maintained
671F: arch/arm/mm/*-fa* 591F: arch/arm/mm/*-fa*
672 592
673ARM/FOOTBRIDGE ARCHITECTURE 593ARM/FOOTBRIDGE ARCHITECTURE
674P: Russell King 594M: Russell King <linux@arm.linux.org.uk>
675M: linux@arm.linux.org.uk
676L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only) 595L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only)
677W: http://www.arm.linux.org.uk/ 596W: http://www.arm.linux.org.uk/
678S: Maintained 597S: Maintained
@@ -680,175 +599,146 @@ F: arch/arm/include/asm/hardware/dec21285.h
680F: arch/arm/mach-footbridge/ 599F: arch/arm/mach-footbridge/
681 600
682ARM/FREESCALE IMX / MXC ARM ARCHITECTURE 601ARM/FREESCALE IMX / MXC ARM ARCHITECTURE
683P: Sascha Hauer 602M: Sascha Hauer <kernel@pengutronix.de>
684M: kernel@pengutronix.de
685L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only) 603L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only)
686S: Maintained 604S: Maintained
687 605
688ARM/GLOMATION GESBC9312SX MACHINE SUPPORT 606ARM/GLOMATION GESBC9312SX MACHINE SUPPORT
689P: Lennert Buytenhek 607M: Lennert Buytenhek <kernel@wantstofly.org>
690M: kernel@wantstofly.org
691L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only) 608L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only)
692S: Maintained 609S: Maintained
693 610
694ARM/GUMSTIX MACHINE SUPPORT 611ARM/GUMSTIX MACHINE SUPPORT
695P: Steve Sakoman 612M: Steve Sakoman <sakoman@gmail.com>
696M: sakoman@gmail.com
697L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only) 613L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only)
698S: Maintained 614S: Maintained
699 615
700ARM/H4700 (HP IPAQ HX4700) MACHINE SUPPORT 616ARM/H4700 (HP IPAQ HX4700) MACHINE SUPPORT
701P: Philipp Zabel 617M: Philipp Zabel <philipp.zabel@gmail.com>
702M: philipp.zabel@gmail.com
703S: Maintained 618S: Maintained
704F: arch/arm/mach-pxa/hx4700.c 619F: arch/arm/mach-pxa/hx4700.c
705F: arch/arm/mach-pxa/include/mach/hx4700.h 620F: arch/arm/mach-pxa/include/mach/hx4700.h
706 621
707ARM/HP JORNADA 7XX MACHINE SUPPORT 622ARM/HP JORNADA 7XX MACHINE SUPPORT
708P: Kristoffer Ericson 623M: Kristoffer Ericson <kristoffer.ericson@gmail.com>
709M: kristoffer.ericson@gmail.com
710W: www.jlime.com 624W: www.jlime.com
711S: Maintained 625S: Maintained
626T: git git://git.kernel.org/pub/scm/linux/kernel/git/kristoffer/linux-hpc.git
627F: arch/arm/mach-sa1100/jornada720.c
628F: arch/arm/mach-sa1100/include/mach/jornada720.h
712 629
713ARM/INTEL IOP32X ARM ARCHITECTURE 630ARM/INTEL IOP32X ARM ARCHITECTURE
714P: Lennert Buytenhek 631M: Lennert Buytenhek <kernel@wantstofly.org>
715M: kernel@wantstofly.org 632M: Dan Williams <dan.j.williams@intel.com>
716P: Dan Williams
717M: dan.j.williams@intel.com
718L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only) 633L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only)
719S: Supported 634S: Supported
720 635
721ARM/INTEL IOP33X ARM ARCHITECTURE 636ARM/INTEL IOP33X ARM ARCHITECTURE
722P: Dan Williams 637M: Dan Williams <dan.j.williams@intel.com>
723M: dan.j.williams@intel.com
724L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only) 638L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only)
725S: Supported 639S: Supported
726 640
727ARM/INTEL IOP13XX ARM ARCHITECTURE 641ARM/INTEL IOP13XX ARM ARCHITECTURE
728P: Lennert Buytenhek 642M: Lennert Buytenhek <kernel@wantstofly.org>
729M: kernel@wantstofly.org 643M: Dan Williams <dan.j.williams@intel.com>
730P: Dan Williams
731M: dan.j.williams@intel.com
732L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only) 644L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only)
733S: Supported 645S: Supported
734 646
735ARM/INTEL IQ81342EX MACHINE SUPPORT 647ARM/INTEL IQ81342EX MACHINE SUPPORT
736P: Lennert Buytenhek 648M: Lennert Buytenhek <kernel@wantstofly.org>
737M: kernel@wantstofly.org 649M: Dan Williams <dan.j.williams@intel.com>
738P: Dan Williams
739M: dan.j.williams@intel.com
740L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only) 650L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only)
741S: Supported 651S: Supported
742 652
743ARM/INTEL IXP2000 ARM ARCHITECTURE 653ARM/INTEL IXP2000 ARM ARCHITECTURE
744P: Lennert Buytenhek 654M: Lennert Buytenhek <kernel@wantstofly.org>
745M: kernel@wantstofly.org
746L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only) 655L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only)
747S: Maintained 656S: Maintained
748 657
749ARM/INTEL IXDP2850 MACHINE SUPPORT 658ARM/INTEL IXDP2850 MACHINE SUPPORT
750P: Lennert Buytenhek 659M: Lennert Buytenhek <kernel@wantstofly.org>
751M: kernel@wantstofly.org
752L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only) 660L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only)
753S: Maintained 661S: Maintained
754 662
755ARM/INTEL IXP23XX ARM ARCHITECTURE 663ARM/INTEL IXP23XX ARM ARCHITECTURE
756P: Lennert Buytenhek 664M: Lennert Buytenhek <kernel@wantstofly.org>
757M: kernel@wantstofly.org
758L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only) 665L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only)
759S: Maintained 666S: Maintained
760 667
761ARM/INTEL XSC3 (MANZANO) ARM CORE 668ARM/INTEL XSC3 (MANZANO) ARM CORE
762P: Lennert Buytenhek 669M: Lennert Buytenhek <kernel@wantstofly.org>
763M: kernel@wantstofly.org 670M: Dan Williams <dan.j.williams@intel.com>
764P: Dan Williams
765M: dan.j.williams@intel.com
766L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only) 671L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only)
767S: Supported 672S: Supported
768 673
769ARM/IP FABRICS DOUBLE ESPRESSO MACHINE SUPPORT 674ARM/IP FABRICS DOUBLE ESPRESSO MACHINE SUPPORT
770P: Lennert Buytenhek 675M: Lennert Buytenhek <kernel@wantstofly.org>
771M: kernel@wantstofly.org
772L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only) 676L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only)
773S: Maintained 677S: Maintained
774 678
775ARM/LOGICPD PXA270 MACHINE SUPPORT 679ARM/LOGICPD PXA270 MACHINE SUPPORT
776P: Lennert Buytenhek 680M: Lennert Buytenhek <kernel@wantstofly.org>
777M: kernel@wantstofly.org
778L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only) 681L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only)
779S: Maintained 682S: Maintained
780 683
781ARM/MAGICIAN MACHINE SUPPORT 684ARM/MAGICIAN MACHINE SUPPORT
782P: Philipp Zabel 685M: Philipp Zabel <philipp.zabel@gmail.com>
783M: philipp.zabel@gmail.com
784S: Maintained 686S: Maintained
785 687
786ARM/MIOA701 MACHINE SUPPORT 688ARM/MIOA701 MACHINE SUPPORT
787P: Robert Jarzmik 689M: Robert Jarzmik <robert.jarzmik@free.fr>
788M: robert.jarzmik@free.fr
789L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only) 690L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only)
790F: arch/arm/mach-pxa/mioa701.c 691F: arch/arm/mach-pxa/mioa701.c
791S: Maintained 692S: Maintained
792 693
793ARM/NEC MOBILEPRO 900/c MACHINE SUPPORT 694ARM/NEC MOBILEPRO 900/c MACHINE SUPPORT
794P: Michael Petchkovsky 695M: Michael Petchkovsky <mkpetch@internode.on.net>
795M: mkpetch@internode.on.net
796S: Maintained 696S: Maintained
797 697
798ARM/OPENMOKO NEO FREERUNNER (GTA02) MACHINE SUPPORT 698ARM/OPENMOKO NEO FREERUNNER (GTA02) MACHINE SUPPORT
799P: Nelson Castillo 699M: Nelson Castillo <arhuaco@freaks-unidos.net>
800M: arhuaco@freaks-unidos.net
801L: openmoko-kernel@lists.openmoko.org (subscribers-only) 700L: openmoko-kernel@lists.openmoko.org (subscribers-only)
802W: http://wiki.openmoko.org/wiki/Neo_FreeRunner 701W: http://wiki.openmoko.org/wiki/Neo_FreeRunner
803S: Supported 702S: Supported
804 703
805ARM/TOSA MACHINE SUPPORT 704ARM/TOSA MACHINE SUPPORT
806P: Dmitry Eremin-Solenikov 705M: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
807M: dbaryshkov@gmail.com 706M: Dirk Opfer <dirk@opfer-online.de>
808P: Dirk Opfer
809M: dirk@opfer-online.de
810S: Maintained 707S: Maintained
811 708
812ARM/PALMTX,PALMT5,PALMLD,PALMTE2 SUPPORT 709ARM/PALMTX,PALMT5,PALMLD,PALMTE2 SUPPORT
813P: Marek Vasut 710M: Marek Vasut <marek.vasut@gmail.com>
814M: marek.vasut@gmail.com
815W: http://hackndev.com 711W: http://hackndev.com
816S: Maintained 712S: Maintained
817 713
818ARM/PALM TREO 680 SUPPORT 714ARM/PALM TREO 680 SUPPORT
819P: Tomas Cech 715M: Tomas Cech <sleep_walker@suse.cz>
820M: sleep_walker@suse.cz
821W: http://hackndev.com 716W: http://hackndev.com
822S: Maintained 717S: Maintained
823 718
824ARM/PALMZ72 SUPPORT 719ARM/PALMZ72 SUPPORT
825P: Sergey Lapin 720M: Sergey Lapin <slapin@ossfans.org>
826M: slapin@ossfans.org
827W: http://hackndev.com 721W: http://hackndev.com
828S: Maintained 722S: Maintained
829 723
830ARM/PLEB SUPPORT 724ARM/PLEB SUPPORT
831P: Peter Chubb 725M: Peter Chubb <pleb@gelato.unsw.edu.au>
832M: pleb@gelato.unsw.edu.au
833W: http://www.disy.cse.unsw.edu.au/Hardware/PLEB 726W: http://www.disy.cse.unsw.edu.au/Hardware/PLEB
834S: Maintained 727S: Maintained
835 728
836ARM/PT DIGITAL BOARD PORT 729ARM/PT DIGITAL BOARD PORT
837P: Stefan Eletzhofer 730M: Stefan Eletzhofer <stefan.eletzhofer@eletztrick.de>
838M: stefan.eletzhofer@eletztrick.de
839L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only) 731L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only)
840W: http://www.arm.linux.org.uk/ 732W: http://www.arm.linux.org.uk/
841S: Maintained 733S: Maintained
842 734
843ARM/RADISYS ENP2611 MACHINE SUPPORT 735ARM/RADISYS ENP2611 MACHINE SUPPORT
844P: Lennert Buytenhek 736M: Lennert Buytenhek <kernel@wantstofly.org>
845M: kernel@wantstofly.org
846L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only) 737L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only)
847S: Maintained 738S: Maintained
848 739
849ARM/RISCPC ARCHITECTURE 740ARM/RISCPC ARCHITECTURE
850P: Russell King 741M: Russell King <linux@arm.linux.org.uk>
851M: linux@arm.linux.org.uk
852L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only) 742L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only)
853W: http://www.arm.linux.org.uk/ 743W: http://www.arm.linux.org.uk/
854S: Maintained 744S: Maintained
@@ -862,63 +752,86 @@ F: drivers/net/arm/ether*
862F: drivers/scsi/arm/ 752F: drivers/scsi/arm/
863 753
864ARM/SHARK MACHINE SUPPORT 754ARM/SHARK MACHINE SUPPORT
865P: Alexander Schulz 755M: Alexander Schulz <alex@shark-linux.de>
866M: alex@shark-linux.de
867W: http://www.shark-linux.de/shark.html 756W: http://www.shark-linux.de/shark.html
868S: Maintained 757S: Maintained
869 758
759ARM/SAMSUNG ARM ARCHITECTURES
760M: Ben Dooks <ben-linux@fluff.org>
761L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only)
762W: http://www.fluff.org/ben/linux/
763S: Maintained
764F: arch/arm/plat-s3c/
765F: arch/arm/plat-s3c24xx/
766
870ARM/S3C2410 ARM ARCHITECTURE 767ARM/S3C2410 ARM ARCHITECTURE
871P: Ben Dooks 768M: Ben Dooks <ben-linux@fluff.org>
872M: ben-linux@fluff.org
873L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only) 769L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only)
874W: http://www.fluff.org/ben/linux/ 770W: http://www.fluff.org/ben/linux/
875S: Maintained 771S: Maintained
772F: arch/arm/mach-s3c2410/
876 773
877ARM/S3C2440 ARM ARCHITECTURE 774ARM/S3C2440 ARM ARCHITECTURE
878P: Ben Dooks 775M: Ben Dooks <ben-linux@fluff.org>
879M: ben-linux@fluff.org 776L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only)
777W: http://www.fluff.org/ben/linux/
778S: Maintained
779F: arch/arm/mach-s3c2440/
780
781ARM/S3C2442 ARM ARCHITECTURE
782M: Ben Dooks <ben-linux@fluff.org>
783L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only)
784W: http://www.fluff.org/ben/linux/
785S: Maintained
786F: arch/arm/mach-s3c2442/
787
788ARM/S3C2443 ARM ARCHITECTURE
789M: Ben Dooks <ben-linux@fluff.org>
880L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only) 790L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only)
881W: http://www.fluff.org/ben/linux/ 791W: http://www.fluff.org/ben/linux/
882S: Maintained 792S: Maintained
793F: arch/arm/mach-s3c2443/
794
795ARM/S3C6400 ARM ARCHITECTURE
796M: Ben Dooks <ben-linux@fluff.org>
797L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only)
798W: http://www.fluff.org/ben/linux/
799S: Maintained
800F: arch/arm/mach-s3c6400/
801
802ARM/S3C6410 ARM ARCHITECTURE
803M: Ben Dooks <ben-linux@fluff.org>
804L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only)
805W: http://www.fluff.org/ben/linux/
806S: Maintained
807F: arch/arm/mach-s3c6410/
883 808
884ARM/TECHNOLOGIC SYSTEMS TS7250 MACHINE SUPPORT 809ARM/TECHNOLOGIC SYSTEMS TS7250 MACHINE SUPPORT
885P: Lennert Buytenhek 810M: Lennert Buytenhek <kernel@wantstofly.org>
886M: kernel@wantstofly.org
887L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only) 811L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only)
888S: Maintained 812S: Maintained
889 813
890ARM/THECUS N2100 MACHINE SUPPORT 814ARM/THECUS N2100 MACHINE SUPPORT
891P: Lennert Buytenhek 815M: Lennert Buytenhek <kernel@wantstofly.org>
892M: kernel@wantstofly.org
893L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only) 816L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only)
894S: Maintained 817S: Maintained
895 818
896ARM/NUVOTON W90X900 ARM ARCHITECTURE 819ARM/NUVOTON W90X900 ARM ARCHITECTURE
897P: Wan ZongShun 820M: Wan ZongShun <mcuos.com@gmail.com>
898M: mcuos.com@gmail.com
899L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only) 821L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only)
900W: http://www.mcuos.com 822W: http://www.mcuos.com
901S: Maintained 823S: Maintained
902 824
903ARM/VFP SUPPORT 825ARM/VFP SUPPORT
904P: Russell King 826M: Russell King <linux@arm.linux.org.uk>
905M: linux@arm.linux.org.uk
906L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only) 827L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only)
907W: http://www.arm.linux.org.uk/ 828W: http://www.arm.linux.org.uk/
908S: Maintained 829S: Maintained
909F: arch/arm/vfp/ 830F: arch/arm/vfp/
910 831
911ARPD SUPPORT
912P: Jonathan Layes
913L: netdev@vger.kernel.org
914S: Maintained
915F: net/ipv4/arp.c
916
917ASUS ACPI EXTRAS DRIVER 832ASUS ACPI EXTRAS DRIVER
918P: Corentin Chary 833M: Corentin Chary <corentincj@iksaif.net>
919M: corentincj@iksaif.net 834M: Karol Kozimor <sziwan@users.sourceforge.net>
920P: Karol Kozimor
921M: sziwan@users.sourceforge.net
922L: acpi4asus-user@lists.sourceforge.net 835L: acpi4asus-user@lists.sourceforge.net
923W: http://acpi4asus.sf.net 836W: http://acpi4asus.sf.net
924S: Maintained 837S: Maintained
@@ -926,25 +839,21 @@ F: arch/x86/kernel/acpi/boot.c
926F: drivers/platform/x86/asus_acpi.c 839F: drivers/platform/x86/asus_acpi.c
927 840
928ASUS ASB100 HARDWARE MONITOR DRIVER 841ASUS ASB100 HARDWARE MONITOR DRIVER
929P: Mark M. Hoffman 842M: "Mark M. Hoffman" <mhoffman@lightlink.com>
930M: mhoffman@lightlink.com
931L: lm-sensors@lm-sensors.org 843L: lm-sensors@lm-sensors.org
932S: Maintained 844S: Maintained
933F: drivers/hwmon/asb100.c 845F: drivers/hwmon/asb100.c
934 846
935ASUS LAPTOP EXTRAS DRIVER 847ASUS LAPTOP EXTRAS DRIVER
936P: Corentin Chary 848M: Corentin Chary <corentincj@iksaif.net>
937M: corentincj@iksaif.net
938L: acpi4asus-user@lists.sourceforge.net 849L: acpi4asus-user@lists.sourceforge.net
939W: http://acpi4asus.sf.net 850W: http://acpi4asus.sf.net
940S: Maintained 851S: Maintained
941F: drivers/platform/x86/asus-laptop.c 852F: drivers/platform/x86/asus-laptop.c
942 853
943ASYNCHRONOUS TRANSFERS/TRANSFORMS (IOAT) API 854ASYNCHRONOUS TRANSFERS/TRANSFORMS (IOAT) API
944P: Dan Williams 855M: Dan Williams <dan.j.williams@intel.com>
945M: dan.j.williams@intel.com 856M: Maciej Sosnowski <maciej.sosnowski@intel.com>
946P: Maciej Sosnowski
947M: maciej.sosnowski@intel.com
948W: http://sourceforge.net/projects/xscaleiop 857W: http://sourceforge.net/projects/xscaleiop
949S: Supported 858S: Supported
950F: Documentation/crypto/async-tx-api.txt 859F: Documentation/crypto/async-tx-api.txt
@@ -954,64 +863,49 @@ F: include/linux/dmaengine.h
954F: include/linux/async_tx.h 863F: include/linux/async_tx.h
955 864
956ATA OVER ETHERNET (AOE) DRIVER 865ATA OVER ETHERNET (AOE) DRIVER
957P: Ed L. Cashin 866M: "Ed L. Cashin" <ecashin@coraid.com>
958M: ecashin@coraid.com
959W: http://www.coraid.com/support/linux 867W: http://www.coraid.com/support/linux
960S: Supported 868S: Supported
961F: Documentation/aoe/ 869F: Documentation/aoe/
962F: drivers/block/aoe/ 870F: drivers/block/aoe/
963 871
964ATHEROS ATH5K WIRELESS DRIVER 872ATHEROS ATH5K WIRELESS DRIVER
965P: Jiri Slaby 873M: Jiri Slaby <jirislaby@gmail.com>
966M: jirislaby@gmail.com 874M: Nick Kossifidis <mickflemm@gmail.com>
967P: Nick Kossifidis 875M: "Luis R. Rodriguez" <lrodriguez@atheros.com>
968M: mickflemm@gmail.com 876M: Bob Copeland <me@bobcopeland.com>
969P: Luis R. Rodriguez
970M: lrodriguez@atheros.com
971P: Bob Copeland
972M: me@bobcopeland.com
973L: linux-wireless@vger.kernel.org 877L: linux-wireless@vger.kernel.org
974L: ath5k-devel@lists.ath5k.org 878L: ath5k-devel@lists.ath5k.org
975S: Maintained 879S: Maintained
976F: drivers/net/wireless/ath/ath5k/ 880F: drivers/net/wireless/ath/ath5k/
977 881
978ATHEROS ATH9K WIRELESS DRIVER 882ATHEROS ATH9K WIRELESS DRIVER
979P: Luis R. Rodriguez 883M: "Luis R. Rodriguez" <lrodriguez@atheros.com>
980M: lrodriguez@atheros.com 884M: Jouni Malinen <jmalinen@atheros.com>
981P: Jouni Malinen 885M: Sujith Manoharan <Sujith.Manoharan@atheros.com>
982M: jmalinen@atheros.com 886M: Vasanthakumar Thiagarajan <vasanth@atheros.com>
983P: Sujith Manoharan 887M: Senthil Balasubramanian <senthilkumar@atheros.com>
984M: Sujith.Manoharan@atheros.com
985P: Vasanthakumar Thiagarajan
986M: vasanth@atheros.com
987P: Senthil Balasubramanian
988M: senthilkumar@atheros.com
989L: linux-wireless@vger.kernel.org 888L: linux-wireless@vger.kernel.org
990L: ath9k-devel@lists.ath9k.org 889L: ath9k-devel@lists.ath9k.org
991S: Supported 890S: Supported
992F: drivers/net/wireless/ath/ath9k/ 891F: drivers/net/wireless/ath/ath9k/
993 892
994ATHEROS AR9170 WIRELESS DRIVER 893ATHEROS AR9170 WIRELESS DRIVER
995P: Christian Lamparter 894M: Christian Lamparter <chunkeey@web.de>
996M: chunkeey@web.de
997L: linux-wireless@vger.kernel.org 895L: linux-wireless@vger.kernel.org
998W: http://wireless.kernel.org/en/users/Drivers/ar9170 896W: http://wireless.kernel.org/en/users/Drivers/ar9170
999S: Maintained 897S: Maintained
1000F: drivers/net/wireless/ath/ar9170/ 898F: drivers/net/wireless/ath/ar9170/
1001 899
1002ATI_REMOTE2 DRIVER 900ATI_REMOTE2 DRIVER
1003P: Ville Syrjala 901M: Ville Syrjala <syrjala@sci.fi>
1004M: syrjala@sci.fi
1005S: Maintained 902S: Maintained
1006F: drivers/input/misc/ati_remote2.c 903F: drivers/input/misc/ati_remote2.c
1007 904
1008ATLX ETHERNET DRIVERS 905ATLX ETHERNET DRIVERS
1009P: Jay Cliburn 906M: Jay Cliburn <jcliburn@gmail.com>
1010M: jcliburn@gmail.com 907M: Chris Snook <csnook@redhat.com>
1011P: Chris Snook 908M: Jie Yang <jie.yang@atheros.com>
1012M: csnook@redhat.com
1013P: Jie Yang
1014M: jie.yang@atheros.com
1015L: atl1-devel@lists.sourceforge.net 909L: atl1-devel@lists.sourceforge.net
1016W: http://sourceforge.net/projects/atl1 910W: http://sourceforge.net/projects/atl1
1017W: http://atl1.sourceforge.net 911W: http://atl1.sourceforge.net
@@ -1019,8 +913,7 @@ S: Maintained
1019F: drivers/net/atlx/ 913F: drivers/net/atlx/
1020 914
1021ATM 915ATM
1022P: Chas Williams 916M: Chas Williams <chas@cmf.nrl.navy.mil>
1023M: chas@cmf.nrl.navy.mil
1024L: linux-atm-general@lists.sourceforge.net (subscribers-only) 917L: linux-atm-general@lists.sourceforge.net (subscribers-only)
1025L: netdev@vger.kernel.org 918L: netdev@vger.kernel.org
1026W: http://linux-atm.sourceforge.net 919W: http://linux-atm.sourceforge.net
@@ -1029,8 +922,7 @@ F: drivers/atm/
1029F: include/linux/atm* 922F: include/linux/atm*
1030 923
1031ATMEL AT91 MCI DRIVER 924ATMEL AT91 MCI DRIVER
1032P: Nicolas Ferre 925M: Nicolas Ferre <nicolas.ferre@atmel.com>
1033M: nicolas.ferre@atmel.com
1034L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only) 926L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only)
1035W: http://www.atmel.com/products/AT91/ 927W: http://www.atmel.com/products/AT91/
1036W: http://www.at91.com/ 928W: http://www.at91.com/
@@ -1038,49 +930,42 @@ S: Maintained
1038F: drivers/mmc/host/at91_mci.c 930F: drivers/mmc/host/at91_mci.c
1039 931
1040ATMEL AT91 / AT32 MCI DRIVER 932ATMEL AT91 / AT32 MCI DRIVER
1041P: Nicolas Ferre 933M: Nicolas Ferre <nicolas.ferre@atmel.com>
1042M: nicolas.ferre@atmel.com
1043S: Maintained 934S: Maintained
1044F: drivers/mmc/host/atmel-mci.c 935F: drivers/mmc/host/atmel-mci.c
1045F: drivers/mmc/host/atmel-mci-regs.h 936F: drivers/mmc/host/atmel-mci-regs.h
1046 937
1047ATMEL AT91 / AT32 SERIAL DRIVER 938ATMEL AT91 / AT32 SERIAL DRIVER
1048P: Haavard Skinnemoen 939M: Haavard Skinnemoen <hskinnemoen@atmel.com>
1049M: hskinnemoen@atmel.com
1050S: Supported 940S: Supported
1051F: drivers/serial/atmel_serial.c 941F: drivers/serial/atmel_serial.c
1052 942
1053ATMEL LCDFB DRIVER 943ATMEL LCDFB DRIVER
1054P: Nicolas Ferre 944M: Nicolas Ferre <nicolas.ferre@atmel.com>
1055M: nicolas.ferre@atmel.com
1056L: linux-fbdev-devel@lists.sourceforge.net (moderated for non-subscribers) 945L: linux-fbdev-devel@lists.sourceforge.net (moderated for non-subscribers)
1057S: Maintained 946S: Maintained
1058F: drivers/video/atmel_lcdfb.c 947F: drivers/video/atmel_lcdfb.c
1059F: include/video/atmel_lcdc.h 948F: include/video/atmel_lcdc.h
1060 949
1061ATMEL MACB ETHERNET DRIVER 950ATMEL MACB ETHERNET DRIVER
1062P: Haavard Skinnemoen 951M: Haavard Skinnemoen <hskinnemoen@atmel.com>
1063M: hskinnemoen@atmel.com
1064S: Supported 952S: Supported
1065F: drivers/net/macb.* 953F: drivers/net/macb.*
1066 954
1067ATMEL SPI DRIVER 955ATMEL SPI DRIVER
1068P: Haavard Skinnemoen 956M: Haavard Skinnemoen <hskinnemoen@atmel.com>
1069M: hskinnemoen@atmel.com
1070S: Supported 957S: Supported
1071F: drivers/spi/atmel_spi.* 958F: drivers/spi/atmel_spi.*
1072 959
1073ATMEL USBA UDC DRIVER 960ATMEL USBA UDC DRIVER
1074P: Haavard Skinnemoen 961M: Haavard Skinnemoen <hskinnemoen@atmel.com>
1075M: hskinnemoen@atmel.com
1076L: kernel@avr32linux.org 962L: kernel@avr32linux.org
1077W: http://avr32linux.org/twiki/bin/view/Main/AtmelUsbDeviceDriver 963W: http://avr32linux.org/twiki/bin/view/Main/AtmelUsbDeviceDriver
1078S: Supported 964S: Supported
1079F: drivers/usb/gadget/atmel_usba_udc.* 965F: drivers/usb/gadget/atmel_usba_udc.*
1080 966
1081ATMEL WIRELESS DRIVER 967ATMEL WIRELESS DRIVER
1082P: Simon Kelley 968M: Simon Kelley <simon@thekelleys.org.uk>
1083M: simon@thekelleys.org.uk
1084L: linux-wireless@vger.kernel.org 969L: linux-wireless@vger.kernel.org
1085W: http://www.thekelleys.org.uk/atmel 970W: http://www.thekelleys.org.uk/atmel
1086W: http://atmelwlandriver.sourceforge.net/ 971W: http://atmelwlandriver.sourceforge.net/
@@ -1088,10 +973,8 @@ S: Maintained
1088F: drivers/net/wireless/atmel* 973F: drivers/net/wireless/atmel*
1089 974
1090AUDIT SUBSYSTEM 975AUDIT SUBSYSTEM
1091P: Al Viro 976M: Al Viro <viro@zeniv.linux.org.uk>
1092M: viro@zeniv.linux.org.uk 977M: Eric Paris <eparis@redhat.com>
1093P: Eric Paris
1094M: eparis@redhat.com
1095L: linux-audit@redhat.com (subscribers-only) 978L: linux-audit@redhat.com (subscribers-only)
1096W: http://people.redhat.com/sgrubb/audit/ 979W: http://people.redhat.com/sgrubb/audit/
1097T: git git://git.kernel.org/pub/scm/linux/kernel/git/viro/audit-current.git 980T: git git://git.kernel.org/pub/scm/linux/kernel/git/viro/audit-current.git
@@ -1100,8 +983,7 @@ F: include/linux/audit.h
1100F: kernel/audit* 983F: kernel/audit*
1101 984
1102AUXILIARY DISPLAY DRIVERS 985AUXILIARY DISPLAY DRIVERS
1103P: Miguel Ojeda Sandonis 986M: Miguel Ojeda Sandonis <miguel.ojeda.sandonis@gmail.com>
1104M: miguel.ojeda.sandonis@gmail.com
1105W: http://miguelojeda.es/auxdisplay.htm 987W: http://miguelojeda.es/auxdisplay.htm
1106W: http://jair.lab.fi.uva.es/~migojed/auxdisplay.htm 988W: http://jair.lab.fi.uva.es/~migojed/auxdisplay.htm
1107S: Maintained 989S: Maintained
@@ -1109,8 +991,7 @@ F: drivers/auxdisplay/
1109F: include/linux/cfag12864b.h 991F: include/linux/cfag12864b.h
1110 992
1111AVR32 ARCHITECTURE 993AVR32 ARCHITECTURE
1112P: Haavard Skinnemoen 994M: Haavard Skinnemoen <hskinnemoen@atmel.com>
1113M: hskinnemoen@atmel.com
1114W: http://www.atmel.com/products/AVR32/ 995W: http://www.atmel.com/products/AVR32/
1115W: http://avr32linux.org/ 996W: http://avr32linux.org/
1116W: http://avrfreaks.net/ 997W: http://avrfreaks.net/
@@ -1118,14 +999,12 @@ S: Supported
1118F: arch/avr32/ 999F: arch/avr32/
1119 1000
1120AVR32/AT32AP MACHINE SUPPORT 1001AVR32/AT32AP MACHINE SUPPORT
1121P: Haavard Skinnemoen 1002M: Haavard Skinnemoen <hskinnemoen@atmel.com>
1122M: hskinnemoen@atmel.com
1123S: Supported 1003S: Supported
1124F: arch/avr32/mach-at32ap/ 1004F: arch/avr32/mach-at32ap/
1125 1005
1126AX.25 NETWORK LAYER 1006AX.25 NETWORK LAYER
1127P: Ralf Baechle 1007M: Ralf Baechle <ralf@linux-mips.org>
1128M: ralf@linux-mips.org
1129L: linux-hams@vger.kernel.org 1008L: linux-hams@vger.kernel.org
1130W: http://www.linux-ax25.org/ 1009W: http://www.linux-ax25.org/
1131S: Maintained 1010S: Maintained
@@ -1134,128 +1013,110 @@ F: include/net/ax25.h
1134F: net/ax25/ 1013F: net/ax25/
1135 1014
1136B43 WIRELESS DRIVER 1015B43 WIRELESS DRIVER
1137P: Michael Buesch 1016M: Michael Buesch <mb@bu3sch.de>
1138M: mb@bu3sch.de 1017M: Stefano Brivio <stefano.brivio@polimi.it>
1139P: Stefano Brivio
1140M: stefano.brivio@polimi.it
1141L: linux-wireless@vger.kernel.org 1018L: linux-wireless@vger.kernel.org
1142W: http://linuxwireless.org/en/users/Drivers/b43 1019W: http://linuxwireless.org/en/users/Drivers/b43
1143S: Maintained 1020S: Maintained
1144F: drivers/net/wireless/b43/ 1021F: drivers/net/wireless/b43/
1145 1022
1146B43LEGACY WIRELESS DRIVER 1023B43LEGACY WIRELESS DRIVER
1147P: Larry Finger 1024M: Larry Finger <Larry.Finger@lwfinger.net>
1148M: Larry.Finger@lwfinger.net 1025M: Stefano Brivio <stefano.brivio@polimi.it>
1149P: Stefano Brivio
1150M: stefano.brivio@polimi.it
1151L: linux-wireless@vger.kernel.org 1026L: linux-wireless@vger.kernel.org
1152W: http://linuxwireless.org/en/users/Drivers/b43 1027W: http://linuxwireless.org/en/users/Drivers/b43
1153S: Maintained 1028S: Maintained
1154F: drivers/net/wireless/b43legacy/ 1029F: drivers/net/wireless/b43legacy/
1155 1030
1156BACKLIGHT CLASS/SUBSYSTEM 1031BACKLIGHT CLASS/SUBSYSTEM
1157P: Richard Purdie 1032M: Richard Purdie <rpurdie@rpsys.net>
1158M: rpurdie@rpsys.net
1159S: Maintained 1033S: Maintained
1160F: drivers/video/backlight/ 1034F: drivers/video/backlight/
1161F: include/linux/backlight.h 1035F: include/linux/backlight.h
1162 1036
1163BAYCOM/HDLCDRV DRIVERS FOR AX.25 1037BAYCOM/HDLCDRV DRIVERS FOR AX.25
1164P: Thomas Sailer 1038M: Thomas Sailer <t.sailer@alumni.ethz.ch>
1165M: t.sailer@alumni.ethz.ch
1166L: linux-hams@vger.kernel.org 1039L: linux-hams@vger.kernel.org
1167W: http://www.baycom.org/~tom/ham/ham.html 1040W: http://www.baycom.org/~tom/ham/ham.html
1168S: Maintained 1041S: Maintained
1169F: drivers/net/hamradio/baycom* 1042F: drivers/net/hamradio/baycom*
1170 1043
1171BEFS FILE SYSTEM 1044BEFS FILE SYSTEM
1172P: Sergey S. Kostyliov 1045M: "Sergey S. Kostyliov" <rathamahata@php4.ru>
1173M: rathamahata@php4.ru
1174S: Maintained 1046S: Maintained
1175F: Documentation/filesystems/befs.txt 1047F: Documentation/filesystems/befs.txt
1176F: fs/befs/ 1048F: fs/befs/
1177 1049
1178BFS FILE SYSTEM 1050BFS FILE SYSTEM
1179P: Tigran A. Aivazian 1051M: "Tigran A. Aivazian" <tigran@aivazian.fsnet.co.uk>
1180M: tigran@aivazian.fsnet.co.uk
1181S: Maintained 1052S: Maintained
1182F: Documentation/filesystems/bfs.txt 1053F: Documentation/filesystems/bfs.txt
1183F: fs/bfs/ 1054F: fs/bfs/
1184F: include/linux/bfs_fs.h 1055F: include/linux/bfs_fs.h
1185 1056
1186BLACKFIN ARCHITECTURE 1057BLACKFIN ARCHITECTURE
1187P: Mike Frysinger 1058M: Mike Frysinger <vapier@gentoo.org>
1188M: vapier@gentoo.org
1189L: uclinux-dist-devel@blackfin.uclinux.org 1059L: uclinux-dist-devel@blackfin.uclinux.org
1190W: http://blackfin.uclinux.org 1060W: http://blackfin.uclinux.org
1191S: Supported 1061S: Supported
1192F: arch/blackfin/ 1062F: arch/blackfin/
1193 1063
1194BLACKFIN EMAC DRIVER 1064BLACKFIN EMAC DRIVER
1195P: Michael Hennerich 1065M: Michael Hennerich <michael.hennerich@analog.com>
1196M: michael.hennerich@analog.com
1197L: uclinux-dist-devel@blackfin.uclinux.org 1066L: uclinux-dist-devel@blackfin.uclinux.org
1198W: http://blackfin.uclinux.org 1067W: http://blackfin.uclinux.org
1199S: Supported 1068S: Supported
1200F: drivers/net/bfin_mac.* 1069F: drivers/net/bfin_mac.*
1201 1070
1202BLACKFIN RTC DRIVER 1071BLACKFIN RTC DRIVER
1203P: Mike Frysinger 1072M: Mike Frysinger <vapier.adi@gmail.com>
1204M: vapier.adi@gmail.com
1205L: uclinux-dist-devel@blackfin.uclinux.org 1073L: uclinux-dist-devel@blackfin.uclinux.org
1206W: http://blackfin.uclinux.org 1074W: http://blackfin.uclinux.org
1207S: Supported 1075S: Supported
1208F: drivers/rtc/rtc-bfin.c 1076F: drivers/rtc/rtc-bfin.c
1209 1077
1210BLACKFIN SERIAL DRIVER 1078BLACKFIN SERIAL DRIVER
1211P: Sonic Zhang 1079M: Sonic Zhang <sonic.zhang@analog.com>
1212M: sonic.zhang@analog.com
1213L: uclinux-dist-devel@blackfin.uclinux.org 1080L: uclinux-dist-devel@blackfin.uclinux.org
1214W: http://blackfin.uclinux.org 1081W: http://blackfin.uclinux.org
1215S: Supported 1082S: Supported
1216F: drivers/serial/bfin_5xx.c 1083F: drivers/serial/bfin_5xx.c
1217 1084
1218BLACKFIN WATCHDOG DRIVER 1085BLACKFIN WATCHDOG DRIVER
1219P: Mike Frysinger 1086M: Mike Frysinger <vapier.adi@gmail.com>
1220M: vapier.adi@gmail.com
1221L: uclinux-dist-devel@blackfin.uclinux.org 1087L: uclinux-dist-devel@blackfin.uclinux.org
1222W: http://blackfin.uclinux.org 1088W: http://blackfin.uclinux.org
1223S: Supported 1089S: Supported
1224F: drivers/watchdog/bfin_wdt.c 1090F: drivers/watchdog/bfin_wdt.c
1225 1091
1226BLACKFIN I2C TWI DRIVER 1092BLACKFIN I2C TWI DRIVER
1227P: Sonic Zhang 1093M: Sonic Zhang <sonic.zhang@analog.com>
1228M: sonic.zhang@analog.com
1229L: uclinux-dist-devel@blackfin.uclinux.org 1094L: uclinux-dist-devel@blackfin.uclinux.org
1230W: http://blackfin.uclinux.org/ 1095W: http://blackfin.uclinux.org/
1231S: Supported 1096S: Supported
1232F: drivers/i2c/busses/i2c-bfin-twi.c 1097F: drivers/i2c/busses/i2c-bfin-twi.c
1233 1098
1234BLOCK LAYER 1099BLOCK LAYER
1235P: Jens Axboe 1100M: Jens Axboe <axboe@kernel.dk>
1236M: axboe@kernel.dk
1237T: git git://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux-2.6-block.git 1101T: git git://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux-2.6-block.git
1238S: Maintained 1102S: Maintained
1239F: block/ 1103F: block/
1240 1104
1241BLOCK2MTD DRIVER 1105BLOCK2MTD DRIVER
1242P: Joern Engel 1106M: Joern Engel <joern@lazybastard.org>
1243M: joern@lazybastard.org
1244L: linux-mtd@lists.infradead.org 1107L: linux-mtd@lists.infradead.org
1245S: Maintained 1108S: Maintained
1246F: drivers/mtd/devices/block2mtd.c 1109F: drivers/mtd/devices/block2mtd.c
1247 1110
1248BLUETOOTH DRIVERS 1111BLUETOOTH DRIVERS
1249P: Marcel Holtmann 1112M: Marcel Holtmann <marcel@holtmann.org>
1250M: marcel@holtmann.org
1251L: linux-bluetooth@vger.kernel.org 1113L: linux-bluetooth@vger.kernel.org
1252W: http://www.bluez.org/ 1114W: http://www.bluez.org/
1253S: Maintained 1115S: Maintained
1254F: drivers/bluetooth/ 1116F: drivers/bluetooth/
1255 1117
1256BLUETOOTH SUBSYSTEM 1118BLUETOOTH SUBSYSTEM
1257P: Marcel Holtmann 1119M: Marcel Holtmann <marcel@holtmann.org>
1258M: marcel@holtmann.org
1259L: linux-bluetooth@vger.kernel.org 1120L: linux-bluetooth@vger.kernel.org
1260W: http://www.bluez.org/ 1121W: http://www.bluez.org/
1261T: git git://git.kernel.org/pub/scm/linux/kernel/git/holtmann/bluetooth-2.6.git 1122T: git git://git.kernel.org/pub/scm/linux/kernel/git/holtmann/bluetooth-2.6.git
@@ -1264,8 +1125,7 @@ F: net/bluetooth/
1264F: include/net/bluetooth/ 1125F: include/net/bluetooth/
1265 1126
1266BONDING DRIVER 1127BONDING DRIVER
1267P: Jay Vosburgh 1128M: Jay Vosburgh <fubar@us.ibm.com>
1268M: fubar@us.ibm.com
1269L: bonding-devel@lists.sourceforge.net 1129L: bonding-devel@lists.sourceforge.net
1270W: http://sourceforge.net/projects/bonding/ 1130W: http://sourceforge.net/projects/bonding/
1271S: Supported 1131S: Supported
@@ -1273,54 +1133,46 @@ F: drivers/net/bonding/
1273F: include/linux/if_bonding.h 1133F: include/linux/if_bonding.h
1274 1134
1275BROADCOM B44 10/100 ETHERNET DRIVER 1135BROADCOM B44 10/100 ETHERNET DRIVER
1276P: Gary Zambrano 1136M: Gary Zambrano <zambrano@broadcom.com>
1277M: zambrano@broadcom.com
1278L: netdev@vger.kernel.org 1137L: netdev@vger.kernel.org
1279S: Supported 1138S: Supported
1280F: drivers/net/b44.* 1139F: drivers/net/b44.*
1281 1140
1282BROADCOM BNX2 GIGABIT ETHERNET DRIVER 1141BROADCOM BNX2 GIGABIT ETHERNET DRIVER
1283P: Michael Chan 1142M: Michael Chan <mchan@broadcom.com>
1284M: mchan@broadcom.com
1285L: netdev@vger.kernel.org 1143L: netdev@vger.kernel.org
1286S: Supported 1144S: Supported
1287F: drivers/net/bnx2.* 1145F: drivers/net/bnx2.*
1288F: drivers/net/bnx2_* 1146F: drivers/net/bnx2_*
1289 1147
1290BROADCOM BNX2X 10 GIGABIT ETHERNET DRIVER 1148BROADCOM BNX2X 10 GIGABIT ETHERNET DRIVER
1291P: Eilon Greenstein 1149M: Eilon Greenstein <eilong@broadcom.com>
1292M: eilong@broadcom.com
1293L: netdev@vger.kernel.org 1150L: netdev@vger.kernel.org
1294S: Supported 1151S: Supported
1295F: drivers/net/bnx2x* 1152F: drivers/net/bnx2x*
1296 1153
1297BROADCOM TG3 GIGABIT ETHERNET DRIVER 1154BROADCOM TG3 GIGABIT ETHERNET DRIVER
1298P: Matt Carlson 1155M: Matt Carlson <mcarlson@broadcom.com>
1299M: mcarlson@broadcom.com 1156M: Michael Chan <mchan@broadcom.com>
1300P: Michael Chan
1301M: mchan@broadcom.com
1302L: netdev@vger.kernel.org 1157L: netdev@vger.kernel.org
1303S: Supported 1158S: Supported
1304F: drivers/net/tg3.* 1159F: drivers/net/tg3.*
1305 1160
1306BSG (block layer generic sg v4 driver) 1161BSG (block layer generic sg v4 driver)
1307P: FUJITA Tomonori 1162M: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
1308M: fujita.tomonori@lab.ntt.co.jp
1309L: linux-scsi@vger.kernel.org 1163L: linux-scsi@vger.kernel.org
1310S: Supported 1164S: Supported
1311F: block/bsg.c 1165F: block/bsg.c
1312F: include/linux/bsg.h 1166F: include/linux/bsg.h
1313 1167
1314BT8XXGPIO DRIVER 1168BT8XXGPIO DRIVER
1315P: Michael Buesch 1169M: Michael Buesch <mb@bu3sch.de>
1316M: mb@bu3sch.de
1317W: http://bu3sch.de/btgpio.php 1170W: http://bu3sch.de/btgpio.php
1318S: Maintained 1171S: Maintained
1319F: drivers/gpio/bt8xxgpio.c 1172F: drivers/gpio/bt8xxgpio.c
1320 1173
1321BTRFS FILE SYSTEM 1174BTRFS FILE SYSTEM
1322P: Chris Mason 1175M: Chris Mason <chris.mason@oracle.com>
1323M: chris.mason@oracle.com
1324L: linux-btrfs@vger.kernel.org 1176L: linux-btrfs@vger.kernel.org
1325W: http://btrfs.wiki.kernel.org/ 1177W: http://btrfs.wiki.kernel.org/
1326T: git git://git.kernel.org/pub/scm/linux/kernel/git/mason/btrfs-unstable.git 1178T: git git://git.kernel.org/pub/scm/linux/kernel/git/mason/btrfs-unstable.git
@@ -1329,8 +1181,7 @@ F: Documentation/filesystems/btrfs.txt
1329F: fs/btrfs/ 1181F: fs/btrfs/
1330 1182
1331BTTV VIDEO4LINUX DRIVER 1183BTTV VIDEO4LINUX DRIVER
1332P: Mauro Carvalho Chehab 1184M: Mauro Carvalho Chehab <mchehab@infradead.org>
1333M: mchehab@infradead.org
1334L: linux-media@vger.kernel.org 1185L: linux-media@vger.kernel.org
1335W: http://linuxtv.org 1186W: http://linuxtv.org
1336T: git git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6.git 1187T: git git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6.git
@@ -1339,16 +1190,14 @@ F: Documentation/video4linux/bttv/
1339F: drivers/media/video/bt8xx/bttv* 1190F: drivers/media/video/bt8xx/bttv*
1340 1191
1341CACHEFILES: FS-CACHE BACKEND FOR CACHING ON MOUNTED FILESYSTEMS 1192CACHEFILES: FS-CACHE BACKEND FOR CACHING ON MOUNTED FILESYSTEMS
1342P: David Howells 1193M: David Howells <dhowells@redhat.com>
1343M: dhowells@redhat.com
1344L: linux-cachefs@redhat.com 1194L: linux-cachefs@redhat.com
1345S: Supported 1195S: Supported
1346F: Documentation/filesystems/caching/cachefiles.txt 1196F: Documentation/filesystems/caching/cachefiles.txt
1347F: fs/cachefiles/ 1197F: fs/cachefiles/
1348 1198
1349CAFE CMOS INTEGRATED CAMERA CONTROLLER DRIVER 1199CAFE CMOS INTEGRATED CAMERA CONTROLLER DRIVER
1350P: Jonathan Corbet 1200M: Jonathan Corbet <corbet@lwn.net>
1351M: corbet@lwn.net
1352L: linux-media@vger.kernel.org 1201L: linux-media@vger.kernel.org
1353T: git git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6.git 1202T: git git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6.git
1354S: Maintained 1203S: Maintained
@@ -1356,10 +1205,8 @@ F: Documentation/video4linux/cafe_ccic
1356F: drivers/media/video/cafe_ccic* 1205F: drivers/media/video/cafe_ccic*
1357 1206
1358CALGARY x86-64 IOMMU 1207CALGARY x86-64 IOMMU
1359P: Muli Ben-Yehuda 1208M: Muli Ben-Yehuda <muli@il.ibm.com>
1360M: muli@il.ibm.com 1209M: "Jon D. Mason" <jdmason@kudzu.us>
1361P: Jon D. Mason
1362M: jdmason@kudzu.us
1363L: discuss@x86-64.org 1210L: discuss@x86-64.org
1364S: Maintained 1211S: Maintained
1365F: arch/x86/kernel/pci-calgary_64.c 1212F: arch/x86/kernel/pci-calgary_64.c
@@ -1368,10 +1215,8 @@ F: arch/x86/include/asm/calgary.h
1368F: arch/x86/include/asm/tce.h 1215F: arch/x86/include/asm/tce.h
1369 1216
1370CAN NETWORK LAYER 1217CAN NETWORK LAYER
1371P: Urs Thuermann 1218M: Urs Thuermann <urs.thuermann@volkswagen.de>
1372M: urs.thuermann@volkswagen.de 1219M: Oliver Hartkopp <oliver.hartkopp@volkswagen.de>
1373P: Oliver Hartkopp
1374M: oliver.hartkopp@volkswagen.de
1375L: socketcan-core@lists.berlios.de (subscribers-only) 1220L: socketcan-core@lists.berlios.de (subscribers-only)
1376W: http://developer.berlios.de/projects/socketcan/ 1221W: http://developer.berlios.de/projects/socketcan/
1377S: Maintained 1222S: Maintained
@@ -1380,15 +1225,13 @@ F: include/linux/can/
1380F: include/linux/can.h 1225F: include/linux/can.h
1381 1226
1382CAN NETWORK DRIVERS 1227CAN NETWORK DRIVERS
1383P: Wolfgang Grandegger 1228M: Wolfgang Grandegger <wg@grandegger.com>
1384M: wg@grandegger.com
1385L: socketcan-core@lists.berlios.de (subscribers-only) 1229L: socketcan-core@lists.berlios.de (subscribers-only)
1386W: http://developer.berlios.de/projects/socketcan/ 1230W: http://developer.berlios.de/projects/socketcan/
1387S: Maintained 1231S: Maintained
1388 1232
1389CELL BROADBAND ENGINE ARCHITECTURE 1233CELL BROADBAND ENGINE ARCHITECTURE
1390P: Arnd Bergmann 1234M: Arnd Bergmann <arnd@arndb.de>
1391M: arnd@arndb.de
1392L: linuxppc-dev@ozlabs.org 1235L: linuxppc-dev@ozlabs.org
1393L: cbe-oss-dev@ozlabs.org 1236L: cbe-oss-dev@ozlabs.org
1394W: http://www.ibm.com/developerworks/power/cell/ 1237W: http://www.ibm.com/developerworks/power/cell/
@@ -1399,8 +1242,7 @@ F: arch/powerpc/oprofile/*cell*
1399F: arch/powerpc/platforms/cell/ 1242F: arch/powerpc/platforms/cell/
1400 1243
1401CERTIFIED WIRELESS USB (WUSB) SUBSYSTEM: 1244CERTIFIED WIRELESS USB (WUSB) SUBSYSTEM:
1402P: David Vrabel 1245M: David Vrabel <david.vrabel@csr.com>
1403M: david.vrabel@csr.com
1404L: linux-usb@vger.kernel.org 1246L: linux-usb@vger.kernel.org
1405S: Supported 1247S: Supported
1406F: Documentation/usb/WUSB-Design-overview.txt 1248F: Documentation/usb/WUSB-Design-overview.txt
@@ -1409,8 +1251,7 @@ F: drivers/usb/wusbcore/
1409F: include/linux/usb/wusb* 1251F: include/linux/usb/wusb*
1410 1252
1411CFAG12864B LCD DRIVER 1253CFAG12864B LCD DRIVER
1412P: Miguel Ojeda Sandonis 1254M: Miguel Ojeda Sandonis <miguel.ojeda.sandonis@gmail.com>
1413M: miguel.ojeda.sandonis@gmail.com
1414W: http://miguelojeda.es/auxdisplay.htm 1255W: http://miguelojeda.es/auxdisplay.htm
1415W: http://jair.lab.fi.uva.es/~migojed/auxdisplay.htm 1256W: http://jair.lab.fi.uva.es/~migojed/auxdisplay.htm
1416S: Maintained 1257S: Maintained
@@ -1418,8 +1259,7 @@ F: drivers/auxdisplay/cfag12864b.c
1418F: include/linux/cfag12864b.h 1259F: include/linux/cfag12864b.h
1419 1260
1420CFAG12864BFB LCD FRAMEBUFFER DRIVER 1261CFAG12864BFB LCD FRAMEBUFFER DRIVER
1421P: Miguel Ojeda Sandonis 1262M: Miguel Ojeda Sandonis <miguel.ojeda.sandonis@gmail.com>
1422M: miguel.ojeda.sandonis@gmail.com
1423W: http://miguelojeda.es/auxdisplay.htm 1263W: http://miguelojeda.es/auxdisplay.htm
1424W: http://jair.lab.fi.uva.es/~migojed/auxdisplay.htm 1264W: http://jair.lab.fi.uva.es/~migojed/auxdisplay.htm
1425S: Maintained 1265S: Maintained
@@ -1427,8 +1267,7 @@ F: drivers/auxdisplay/cfag12864bfb.c
1427F: include/linux/cfag12864b.h 1267F: include/linux/cfag12864b.h
1428 1268
1429CFG80211 and NL80211 1269CFG80211 and NL80211
1430P: Johannes Berg 1270M: Johannes Berg <johannes@sipsolutions.net>
1431M: johannes@sipsolutions.net
1432L: linux-wireless@vger.kernel.org 1271L: linux-wireless@vger.kernel.org
1433S: Maintained 1272S: Maintained
1434F: include/linux/nl80211.h 1273F: include/linux/nl80211.h
@@ -1437,66 +1276,47 @@ F: net/wireless/*
1437X: net/wireless/wext* 1276X: net/wireless/wext*
1438 1277
1439CHECKPATCH 1278CHECKPATCH
1440P: Andy Whitcroft 1279M: Andy Whitcroft <apw@canonical.com>
1441M: apw@canonical.com
1442S: Supported 1280S: Supported
1443F: scripts/checkpatch.pl 1281F: scripts/checkpatch.pl
1444 1282
1445CISCO 10G ETHERNET DRIVER 1283CISCO 10G ETHERNET DRIVER
1446P: Scott Feldman 1284M: Scott Feldman <scofeldm@cisco.com>
1447M: scofeldm@cisco.com 1285M: Joe Eykholt <jeykholt@cisco.com>
1448P: Joe Eykholt
1449M: jeykholt@cisco.com
1450S: Supported 1286S: Supported
1451F: drivers/net/enic/ 1287F: drivers/net/enic/
1452 1288
1453CIRRUS LOGIC EP93XX ETHERNET DRIVER 1289CIRRUS LOGIC EP93XX ETHERNET DRIVER
1454P: Lennert Buytenhek 1290M: Lennert Buytenhek <kernel@wantstofly.org>
1455M: kernel@wantstofly.org
1456L: netdev@vger.kernel.org 1291L: netdev@vger.kernel.org
1457S: Maintained 1292S: Maintained
1458F: drivers/net/arm/ep93xx_eth.c 1293F: drivers/net/arm/ep93xx_eth.c
1459 1294
1460CIRRUS LOGIC EP93XX OHCI USB HOST DRIVER 1295CIRRUS LOGIC EP93XX OHCI USB HOST DRIVER
1461P: Lennert Buytenhek 1296M: Lennert Buytenhek <kernel@wantstofly.org>
1462M: kernel@wantstofly.org
1463L: linux-usb@vger.kernel.org 1297L: linux-usb@vger.kernel.org
1464S: Maintained 1298S: Maintained
1465F: drivers/usb/host/ohci-ep93xx.c 1299F: drivers/usb/host/ohci-ep93xx.c
1466 1300
1467CIRRUS LOGIC CS4270 SOUND DRIVER 1301CIRRUS LOGIC CS4270 SOUND DRIVER
1468P: Timur Tabi 1302M: Timur Tabi <timur@freescale.com>
1469M: timur@freescale.com
1470L: alsa-devel@alsa-project.org (moderated for non-subscribers) 1303L: alsa-devel@alsa-project.org (moderated for non-subscribers)
1471S: Supported 1304S: Supported
1472F: sound/soc/codecs/cs4270* 1305F: sound/soc/codecs/cs4270*
1473 1306
1474CIRRUS LOGIC CS4280/CS461x SOUNDDRIVER
1475P: Cirrus Logic Corporation (kernel 2.2 driver)
1476M: Cirrus Logic Corporation, Thomas Woller <twoller@crystal.cirrus.com>
1477P: Nils Faerber (port to kernel 2.4)
1478M: Nils Faerber <nils@kernelconcepts.de>
1479S: Maintained
1480F: Documentation/input/cs461x.txt
1481F: sound/pci/cs46xx/
1482
1483CLK API 1307CLK API
1484P: Russell King 1308M: Russell King <linux@arm.linux.org.uk>
1485M: linux@arm.linux.org.uk
1486F: include/linux/clk.h 1309F: include/linux/clk.h
1487 1310
1488CISCO FCOE HBA DRIVER 1311CISCO FCOE HBA DRIVER
1489P: Abhijeet Joglekar 1312M: Abhijeet Joglekar <abjoglek@cisco.com>
1490M: abjoglek@cisco.com 1313M: Joe Eykholt <jeykholt@cisco.com>
1491P: Joe Eykholt
1492M: jeykholt@cisco.com
1493L: linux-scsi@vger.kernel.org 1314L: linux-scsi@vger.kernel.org
1494S: Supported 1315S: Supported
1495F: drivers/scsi/fnic/ 1316F: drivers/scsi/fnic/
1496 1317
1497CODA FILE SYSTEM 1318CODA FILE SYSTEM
1498P: Jan Harkes 1319M: Jan Harkes <jaharkes@cs.cmu.edu>
1499M: jaharkes@cs.cmu.edu
1500M: coda@cs.cmu.edu 1320M: coda@cs.cmu.edu
1501L: codalist@coda.cs.cmu.edu 1321L: codalist@coda.cs.cmu.edu
1502W: http://www.coda.cs.cmu.edu/ 1322W: http://www.coda.cs.cmu.edu/
@@ -1506,8 +1326,7 @@ F: fs/coda/
1506F: include/linux/coda*.h 1326F: include/linux/coda*.h
1507 1327
1508COMMON INTERNET FILE SYSTEM (CIFS) 1328COMMON INTERNET FILE SYSTEM (CIFS)
1509P: Steve French 1329M: Steve French <sfrench@samba.org>
1510M: sfrench@samba.org
1511L: linux-cifs-client@lists.samba.org 1330L: linux-cifs-client@lists.samba.org
1512L: samba-technical@lists.samba.org 1331L: samba-technical@lists.samba.org
1513W: http://linux-cifs.samba.org/ 1332W: http://linux-cifs.samba.org/
@@ -1517,70 +1336,57 @@ F: Documentation/filesystems/cifs.txt
1517F: fs/cifs/ 1336F: fs/cifs/
1518 1337
1519COMPACTPCI HOTPLUG CORE 1338COMPACTPCI HOTPLUG CORE
1520P: Scott Murray 1339M: Scott Murray <scott@spiteful.org>
1521M: scottm@somanetworks.com
1522M: scott@spiteful.org
1523L: linux-pci@vger.kernel.org 1340L: linux-pci@vger.kernel.org
1524S: Supported 1341S: Maintained
1525F: drivers/pci/hotplug/cpci_hotplug* 1342F: drivers/pci/hotplug/cpci_hotplug*
1526 1343
1527COMPACTPCI HOTPLUG ZIATECH ZT5550 DRIVER 1344COMPACTPCI HOTPLUG ZIATECH ZT5550 DRIVER
1528P: Scott Murray 1345M: Scott Murray <scott@spiteful.org>
1529M: scottm@somanetworks.com
1530M: scott@spiteful.org
1531L: linux-pci@vger.kernel.org 1346L: linux-pci@vger.kernel.org
1532S: Supported 1347S: Maintained
1533F: drivers/pci/hotplug/cpcihp_zt5550.* 1348F: drivers/pci/hotplug/cpcihp_zt5550.*
1534 1349
1535COMPACTPCI HOTPLUG GENERIC DRIVER 1350COMPACTPCI HOTPLUG GENERIC DRIVER
1536P: Scott Murray 1351M: Scott Murray <scott@spiteful.org>
1537M: scottm@somanetworks.com
1538M: scott@spiteful.org
1539L: linux-pci@vger.kernel.org 1352L: linux-pci@vger.kernel.org
1540S: Supported 1353S: Maintained
1541F: drivers/pci/hotplug/cpcihp_generic.c 1354F: drivers/pci/hotplug/cpcihp_generic.c
1542 1355
1543COMPAL LAPTOP SUPPORT 1356COMPAL LAPTOP SUPPORT
1544P: Cezary Jackiewicz 1357M: Cezary Jackiewicz <cezary.jackiewicz@gmail.com>
1545M: cezary.jackiewicz@gmail.com
1546S: Maintained 1358S: Maintained
1547F: drivers/platform/x86/compal-laptop.c 1359F: drivers/platform/x86/compal-laptop.c
1548 1360
1549COMPUTONE INTELLIPORT MULTIPORT CARD 1361COMPUTONE INTELLIPORT MULTIPORT CARD
1550P: Michael H. Warfield 1362M: "Michael H. Warfield" <mhw@wittsend.com>
1551M: mhw@wittsend.com
1552W: http://www.wittsend.com/computone.html 1363W: http://www.wittsend.com/computone.html
1553S: Maintained 1364S: Maintained
1554F: Documentation/serial/computone.txt 1365F: Documentation/serial/computone.txt
1555F: drivers/char/ip2/ 1366F: drivers/char/ip2/
1556 1367
1557CONEXANT ACCESSRUNNER USB DRIVER 1368CONEXANT ACCESSRUNNER USB DRIVER
1558P: Simon Arlott 1369M: Simon Arlott <cxacru@fire.lp0.eu>
1559M: cxacru@fire.lp0.eu
1560L: accessrunner-general@lists.sourceforge.net 1370L: accessrunner-general@lists.sourceforge.net
1561W: http://accessrunner.sourceforge.net/ 1371W: http://accessrunner.sourceforge.net/
1562S: Maintained 1372S: Maintained
1563F: drivers/usb/atm/cxacru.c 1373F: drivers/usb/atm/cxacru.c
1564 1374
1565CONFIGFS 1375CONFIGFS
1566P: Joel Becker 1376M: Joel Becker <joel.becker@oracle.com>
1567M: joel.becker@oracle.com
1568S: Supported 1377S: Supported
1569F: fs/configfs/ 1378F: fs/configfs/
1570F: include/linux/configfs.h 1379F: include/linux/configfs.h
1571 1380
1572CONNECTOR 1381CONNECTOR
1573P: Evgeniy Polyakov 1382M: Evgeniy Polyakov <zbr@ioremap.net>
1574M: zbr@ioremap.net
1575L: netdev@vger.kernel.org 1383L: netdev@vger.kernel.org
1576S: Maintained 1384S: Maintained
1577F: drivers/connector/ 1385F: drivers/connector/
1578 1386
1579CONTROL GROUPS (CGROUPS) 1387CONTROL GROUPS (CGROUPS)
1580P: Paul Menage 1388M: Paul Menage <menage@google.com>
1581M: menage@google.com 1389M: Li Zefan <lizf@cn.fujitsu.com>
1582P: Li Zefan
1583M: lizf@cn.fujitsu.com
1584L: containers@lists.linux-foundation.org 1390L: containers@lists.linux-foundation.org
1585S: Maintained 1391S: Maintained
1586F: include/linux/cgroup* 1392F: include/linux/cgroup*
@@ -1588,30 +1394,26 @@ F: kernel/cgroup*
1588F: mm/*cgroup* 1394F: mm/*cgroup*
1589 1395
1590CORETEMP HARDWARE MONITORING DRIVER 1396CORETEMP HARDWARE MONITORING DRIVER
1591P: Rudolf Marek 1397M: Rudolf Marek <r.marek@assembler.cz>
1592M: r.marek@assembler.cz
1593L: lm-sensors@lm-sensors.org 1398L: lm-sensors@lm-sensors.org
1594S: Maintained 1399S: Maintained
1595F: Documentation/hwmon/coretemp 1400F: Documentation/hwmon/coretemp
1596F: drivers/hwmon/coretemp.c 1401F: drivers/hwmon/coretemp.c
1597 1402
1598COSA/SRP SYNC SERIAL DRIVER 1403COSA/SRP SYNC SERIAL DRIVER
1599P: Jan "Yenya" Kasprzak 1404M: Jan "Yenya" Kasprzak <kas@fi.muni.cz>
1600M: kas@fi.muni.cz
1601W: http://www.fi.muni.cz/~kas/cosa/ 1405W: http://www.fi.muni.cz/~kas/cosa/
1602S: Maintained 1406S: Maintained
1603F: drivers/net/wan/cosa* 1407F: drivers/net/wan/cosa*
1604 1408
1605CPMAC ETHERNET DRIVER 1409CPMAC ETHERNET DRIVER
1606P: Florian Fainelli 1410M: Florian Fainelli <florian@openwrt.org>
1607M: florian@openwrt.org
1608L: netdev@vger.kernel.org 1411L: netdev@vger.kernel.org
1609S: Maintained 1412S: Maintained
1610F: drivers/net/cpmac.c 1413F: drivers/net/cpmac.c
1611 1414
1612CPU FREQUENCY DRIVERS 1415CPU FREQUENCY DRIVERS
1613P: Dave Jones 1416M: Dave Jones <davej@redhat.com>
1614M: davej@redhat.com
1615L: cpufreq@vger.kernel.org 1417L: cpufreq@vger.kernel.org
1616W: http://www.codemonkey.org.uk/projects/cpufreq/ 1418W: http://www.codemonkey.org.uk/projects/cpufreq/
1617T: git git://git.kernel.org/pub/scm/linux/kernel/git/davej/cpufreq.git 1419T: git git://git.kernel.org/pub/scm/linux/kernel/git/davej/cpufreq.git
@@ -1621,15 +1423,13 @@ F: drivers/cpufreq/
1621F: include/linux/cpufreq.h 1423F: include/linux/cpufreq.h
1622 1424
1623CPUID/MSR DRIVER 1425CPUID/MSR DRIVER
1624P: H. Peter Anvin 1426M: "H. Peter Anvin" <hpa@zytor.com>
1625M: hpa@zytor.com
1626S: Maintained 1427S: Maintained
1627F: arch/x86/kernel/cpuid.c 1428F: arch/x86/kernel/cpuid.c
1628F: arch/x86/kernel/msr.c 1429F: arch/x86/kernel/msr.c
1629 1430
1630CPUSETS 1431CPUSETS
1631P: Paul Menage 1432M: Paul Menage <menage@google.com>
1632M: menage@google.com
1633W: http://www.bullopensource.org/cpuset/ 1433W: http://www.bullopensource.org/cpuset/
1634W: http://oss.sgi.com/projects/cpusets/ 1434W: http://oss.sgi.com/projects/cpusets/
1635S: Supported 1435S: Supported
@@ -1644,20 +1444,16 @@ F: Documentation/filesystems/cramfs.txt
1644F: fs/cramfs/ 1444F: fs/cramfs/
1645 1445
1646CRIS PORT 1446CRIS PORT
1647P: Mikael Starvik 1447M: Mikael Starvik <starvik@axis.com>
1648M: starvik@axis.com 1448M: Jesper Nilsson <jesper.nilsson@axis.com>
1649P: Jesper Nilsson
1650M: jesper.nilsson@axis.com
1651L: linux-cris-kernel@axis.com 1449L: linux-cris-kernel@axis.com
1652W: http://developer.axis.com 1450W: http://developer.axis.com
1653S: Maintained 1451S: Maintained
1654F: arch/cris/ 1452F: arch/cris/
1655 1453
1656CRYPTO API 1454CRYPTO API
1657P: Herbert Xu 1455M: Herbert Xu <herbert@gondor.apana.org.au>
1658M: herbert@gondor.apana.org.au 1456M: "David S. Miller" <davem@davemloft.net>
1659P: David S. Miller
1660M: davem@davemloft.net
1661L: linux-crypto@vger.kernel.org 1457L: linux-crypto@vger.kernel.org
1662T: git git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6.git 1458T: git git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6.git
1663S: Maintained 1459S: Maintained
@@ -1668,58 +1464,50 @@ F: drivers/crypto/
1668F: include/crypto/ 1464F: include/crypto/
1669 1465
1670CRYPTOGRAPHIC RANDOM NUMBER GENERATOR 1466CRYPTOGRAPHIC RANDOM NUMBER GENERATOR
1671P: Neil Horman 1467M: Neil Horman <nhorman@tuxdriver.com>
1672M: nhorman@tuxdriver.com
1673L: linux-crypto@vger.kernel.org 1468L: linux-crypto@vger.kernel.org
1674S: Maintained 1469S: Maintained
1675 1470
1676CS5535 Audio ALSA driver 1471CS5535 Audio ALSA driver
1677P: Jaya Kumar 1472M: Jaya Kumar <jayakumar.alsa@gmail.com>
1678M: jayakumar.alsa@gmail.com
1679S: Maintained 1473S: Maintained
1680F: sound/pci/cs5535audio/ 1474F: sound/pci/cs5535audio/
1681 1475
1682CX18 VIDEO4LINUX DRIVER 1476CX18 VIDEO4LINUX DRIVER
1683P: Hans Verkuil 1477M: Hans Verkuil <hverkuil@xs4all.nl>
1684M: hverkuil@xs4all.nl 1478M: Andy Walls <awalls@radix.net>
1685P: Andy Walls
1686M: awalls@radix.net
1687L: ivtv-devel@ivtvdriver.org 1479L: ivtv-devel@ivtvdriver.org
1688L: ivtv-users@ivtvdriver.org
1689L: linux-media@vger.kernel.org 1480L: linux-media@vger.kernel.org
1690T: git git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6.git 1481T: git git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6.git
1691W: http://linuxtv.org 1482W: http://linuxtv.org
1483W: http://www.ivtvdriver.org/index.php/Cx18
1692S: Maintained 1484S: Maintained
1693F: Documentation/video4linux/cx18.txt 1485F: Documentation/video4linux/cx18.txt
1694F: drivers/media/video/cx18/ 1486F: drivers/media/video/cx18/
1695 1487
1696CXGB3 ETHERNET DRIVER (CXGB3) 1488CXGB3 ETHERNET DRIVER (CXGB3)
1697P: Divy Le Ray 1489M: Divy Le Ray <divy@chelsio.com>
1698M: divy@chelsio.com
1699L: netdev@vger.kernel.org 1490L: netdev@vger.kernel.org
1700W: http://www.chelsio.com 1491W: http://www.chelsio.com
1701S: Supported 1492S: Supported
1702F: drivers/net/cxgb3/ 1493F: drivers/net/cxgb3/
1703 1494
1704CXGB3 IWARP RNIC DRIVER (IW_CXGB3) 1495CXGB3 IWARP RNIC DRIVER (IW_CXGB3)
1705P: Steve Wise 1496M: Steve Wise <swise@chelsio.com>
1706M: swise@chelsio.com
1707L: general@lists.openfabrics.org 1497L: general@lists.openfabrics.org
1708W: http://www.openfabrics.org 1498W: http://www.openfabrics.org
1709S: Supported 1499S: Supported
1710F: drivers/infiniband/hw/cxgb3/ 1500F: drivers/infiniband/hw/cxgb3/
1711 1501
1712CYBERPRO FB DRIVER 1502CYBERPRO FB DRIVER
1713P: Russell King 1503M: Russell King <linux@arm.linux.org.uk>
1714M: linux@arm.linux.org.uk
1715L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only) 1504L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only)
1716W: http://www.arm.linux.org.uk/ 1505W: http://www.arm.linux.org.uk/
1717S: Maintained 1506S: Maintained
1718F: drivers/video/cyber2000fb.* 1507F: drivers/video/cyber2000fb.*
1719 1508
1720CYCLADES 2X SYNC CARD DRIVER 1509CYCLADES 2X SYNC CARD DRIVER
1721P: Arnaldo Carvalho de Melo 1510M: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
1722M: acme@ghostprotocols.net
1723W: http://oops.ghostprotocols.net:81/blog 1511W: http://oops.ghostprotocols.net:81/blog
1724S: Maintained 1512S: Maintained
1725F: drivers/net/wan/cycx* 1513F: drivers/net/wan/cycx*
@@ -1736,8 +1524,7 @@ S: Orphan
1736F: drivers/net/wan/pc300* 1524F: drivers/net/wan/pc300*
1737 1525
1738DAMA SLAVE for AX.25 1526DAMA SLAVE for AX.25
1739P: Joerg Reuter 1527M: Joerg Reuter <jreuter@yaina.de>
1740M: jreuter@yaina.de
1741W: http://yaina.de/jreuter/ 1528W: http://yaina.de/jreuter/
1742W: http://www.qsl.net/dl1bke/ 1529W: http://www.qsl.net/dl1bke/
1743L: linux-hams@vger.kernel.org 1530L: linux-hams@vger.kernel.org
@@ -1751,29 +1538,23 @@ F: net/ax25/ax25_timer.c
1751F: net/ax25/sysctl_net_ax25.c 1538F: net/ax25/sysctl_net_ax25.c
1752 1539
1753DAVICOM FAST ETHERNET (DMFE) NETWORK DRIVER 1540DAVICOM FAST ETHERNET (DMFE) NETWORK DRIVER
1754P: Tobias Ringstrom 1541M: Tobias Ringstrom <tori@unhappy.mine.nu>
1755M: tori@unhappy.mine.nu
1756L: netdev@vger.kernel.org 1542L: netdev@vger.kernel.org
1757S: Maintained 1543S: Maintained
1758F: Documentation/networking/dmfe.txt 1544F: Documentation/networking/dmfe.txt
1759F: drivers/net/tulip/dmfe.c 1545F: drivers/net/tulip/dmfe.c
1760 1546
1761DC390/AM53C974 SCSI driver 1547DC390/AM53C974 SCSI driver
1762P: Kurt Garloff 1548M: Kurt Garloff <garloff@suse.de>
1763M: garloff@suse.de
1764W: http://www.garloff.de/kurt/linux/dc390/ 1549W: http://www.garloff.de/kurt/linux/dc390/
1765P: Guennadi Liakhovetski 1550M: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
1766M: g.liakhovetski@gmx.de
1767S: Maintained 1551S: Maintained
1768F: drivers/scsi/tmscsim.* 1552F: drivers/scsi/tmscsim.*
1769 1553
1770DC395x SCSI driver 1554DC395x SCSI driver
1771P: Oliver Neukum 1555M: Oliver Neukum <oliver@neukum.name>
1772M: oliver@neukum.name 1556M: Ali Akcaagac <aliakc@web.de>
1773P: Ali Akcaagac 1557M: Jamie Lenehan <lenehan@twibble.org>
1774M: aliakc@web.de
1775P: Jamie Lenehan
1776M: lenehan@twibble.org
1777W: http://twibble.org/dist/dc395x/ 1558W: http://twibble.org/dist/dc395x/
1778L: dc395x@twibble.org 1559L: dc395x@twibble.org
1779L: http://lists.twibble.org/mailman/listinfo/dc395x/ 1560L: http://lists.twibble.org/mailman/listinfo/dc395x/
@@ -1782,8 +1563,7 @@ F: Documentation/scsi/dc395x.txt
1782F: drivers/scsi/dc395x.* 1563F: drivers/scsi/dc395x.*
1783 1564
1784DCCP PROTOCOL 1565DCCP PROTOCOL
1785P: Arnaldo Carvalho de Melo 1566M: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
1786M: acme@ghostprotocols.net
1787L: dccp@vger.kernel.org 1567L: dccp@vger.kernel.org
1788W: http://linux-net.osdl.org/index.php/DCCP 1568W: http://linux-net.osdl.org/index.php/DCCP
1789S: Maintained 1569S: Maintained
@@ -1792,8 +1572,7 @@ F: include/linux/tfrc.h
1792F: net/dccp/ 1572F: net/dccp/
1793 1573
1794DECnet NETWORK LAYER 1574DECnet NETWORK LAYER
1795P: Christine Caulfield 1575M: Christine Caulfield <christine.caulfield@googlemail.com>
1796M: christine.caulfield@googlemail.com
1797W: http://linux-decnet.sourceforge.net 1576W: http://linux-decnet.sourceforge.net
1798L: linux-decnet-user@lists.sourceforge.net 1577L: linux-decnet-user@lists.sourceforge.net
1799S: Maintained 1578S: Maintained
@@ -1801,40 +1580,34 @@ F: Documentation/networking/decnet.txt
1801F: net/decnet/ 1580F: net/decnet/
1802 1581
1803DEFXX FDDI NETWORK DRIVER 1582DEFXX FDDI NETWORK DRIVER
1804P: Maciej W. Rozycki 1583M: "Maciej W. Rozycki" <macro@linux-mips.org>
1805M: macro@linux-mips.org
1806S: Maintained 1584S: Maintained
1807F: drivers/net/defxx.* 1585F: drivers/net/defxx.*
1808 1586
1809DELL LAPTOP DRIVER 1587DELL LAPTOP DRIVER
1810P: Matthew Garrett 1588M: Matthew Garrett <mjg59@srcf.ucam.org>
1811M: mjg59@srcf.ucam.org
1812S: Maintained 1589S: Maintained
1813F: drivers/platform/x86/dell-laptop.c 1590F: drivers/platform/x86/dell-laptop.c
1814 1591
1815DELL LAPTOP SMM DRIVER 1592DELL LAPTOP SMM DRIVER
1816P: Massimo Dal Zotto 1593M: Massimo Dal Zotto <dz@debian.org>
1817M: dz@debian.org
1818W: http://www.debian.org/~dz/i8k/ 1594W: http://www.debian.org/~dz/i8k/
1819S: Maintained 1595S: Maintained
1820F: drivers/char/i8k.c 1596F: drivers/char/i8k.c
1821F: include/linux/i8k.h 1597F: include/linux/i8k.h
1822 1598
1823DELL SYSTEMS MANAGEMENT BASE DRIVER (dcdbas) 1599DELL SYSTEMS MANAGEMENT BASE DRIVER (dcdbas)
1824P: Doug Warzecha 1600M: Doug Warzecha <Douglas_Warzecha@dell.com>
1825M: Douglas_Warzecha@dell.com
1826S: Maintained 1601S: Maintained
1827F: Documentation/dcdbas.txt 1602F: Documentation/dcdbas.txt
1828F: drivers/firmware/dcdbas.* 1603F: drivers/firmware/dcdbas.*
1829 1604
1830DELL WMI EXTRAS DRIVER 1605DELL WMI EXTRAS DRIVER
1831P: Matthew Garrett 1606M: Matthew Garrett <mjg59@srcf.ucam.org>
1832M: mjg59@srcf.ucam.org
1833S: Maintained 1607S: Maintained
1834 1608
1835DEVICE NUMBER REGISTRY 1609DEVICE NUMBER REGISTRY
1836P: Torben Mathiasen 1610M: Torben Mathiasen <device@lanana.org>
1837M: device@lanana.org
1838W: http://lanana.org/docs/device-list/index.html 1611W: http://lanana.org/docs/device-list/index.html
1839S: Maintained 1612S: Maintained
1840 1613
@@ -1849,8 +1622,7 @@ F: include/linux/device-mapper.h
1849F: include/linux/dm-*.h 1622F: include/linux/dm-*.h
1850 1623
1851DIGI INTL. EPCA DRIVER 1624DIGI INTL. EPCA DRIVER
1852P: Digi International, Inc 1625M: "Digi International, Inc" <Eng.Linux@digi.com>
1853M: Eng.Linux@digi.com
1854L: Eng.Linux@digi.com 1626L: Eng.Linux@digi.com
1855W: http://www.digi.com 1627W: http://www.digi.com
1856S: Orphan 1628S: Orphan
@@ -1859,34 +1631,29 @@ F: drivers/char/epca*
1859F: drivers/char/digi* 1631F: drivers/char/digi*
1860 1632
1861DIRECTORY NOTIFICATION (DNOTIFY) 1633DIRECTORY NOTIFICATION (DNOTIFY)
1862P: Eric Paris 1634M: Eric Paris <eparis@parisplace.org>
1863M: eparis@parisplace.org
1864S: Maintained 1635S: Maintained
1865F: Documentation/filesystems/dnotify.txt 1636F: Documentation/filesystems/dnotify.txt
1866F: fs/notify/dnotify/ 1637F: fs/notify/dnotify/
1867F: include/linux/dnotify.h 1638F: include/linux/dnotify.h
1868 1639
1869DISK GEOMETRY AND PARTITION HANDLING 1640DISK GEOMETRY AND PARTITION HANDLING
1870P: Andries Brouwer 1641M: Andries Brouwer <aeb@cwi.nl>
1871M: aeb@cwi.nl
1872W: http://www.win.tue.nl/~aeb/linux/Large-Disk.html 1642W: http://www.win.tue.nl/~aeb/linux/Large-Disk.html
1873W: http://www.win.tue.nl/~aeb/linux/zip/zip-1.html 1643W: http://www.win.tue.nl/~aeb/linux/zip/zip-1.html
1874W: http://www.win.tue.nl/~aeb/partitions/partition_types-1.html 1644W: http://www.win.tue.nl/~aeb/partitions/partition_types-1.html
1875S: Maintained 1645S: Maintained
1876 1646
1877DISKQUOTA 1647DISKQUOTA
1878P: Jan Kara 1648M: Jan Kara <jack@suse.cz>
1879M: jack@suse.cz
1880S: Maintained 1649S: Maintained
1881F: Documentation/filesystems/quota.txt 1650F: Documentation/filesystems/quota.txt
1882F: fs/quota/ 1651F: fs/quota/
1883F: include/linux/quota*.h 1652F: include/linux/quota*.h
1884 1653
1885DISTRIBUTED LOCK MANAGER (DLM) 1654DISTRIBUTED LOCK MANAGER (DLM)
1886P: Christine Caulfield 1655M: Christine Caulfield <ccaulfie@redhat.com>
1887M: ccaulfie@redhat.com 1656M: David Teigland <teigland@redhat.com>
1888P: David Teigland
1889M: teigland@redhat.com
1890L: cluster-devel@redhat.com 1657L: cluster-devel@redhat.com
1891W: http://sources.redhat.com/cluster/ 1658W: http://sources.redhat.com/cluster/
1892T: git git://git.kernel.org/pub/scm/linux/kernel/git/teigland/dlm.git 1659T: git git://git.kernel.org/pub/scm/linux/kernel/git/teigland/dlm.git
@@ -1894,52 +1661,44 @@ S: Supported
1894F: fs/dlm/ 1661F: fs/dlm/
1895 1662
1896DMA GENERIC OFFLOAD ENGINE SUBSYSTEM 1663DMA GENERIC OFFLOAD ENGINE SUBSYSTEM
1897P: Maciej Sosnowski 1664M: Maciej Sosnowski <maciej.sosnowski@intel.com>
1898M: maciej.sosnowski@intel.com 1665M: Dan Williams <dan.j.williams@intel.com>
1899P: Dan Williams
1900M: dan.j.williams@intel.com
1901S: Supported 1666S: Supported
1902F: drivers/dma/ 1667F: drivers/dma/
1903F: include/linux/dma* 1668F: include/linux/dma*
1904 1669
1905DME1737 HARDWARE MONITOR DRIVER 1670DME1737 HARDWARE MONITOR DRIVER
1906P: Juerg Haefliger 1671M: Juerg Haefliger <juergh@gmail.com>
1907M: juergh@gmail.com
1908L: lm-sensors@lm-sensors.org 1672L: lm-sensors@lm-sensors.org
1909S: Maintained 1673S: Maintained
1910F: Documentation/hwmon/dme1737 1674F: Documentation/hwmon/dme1737
1911F: drivers/hwmon/dme1737.c 1675F: drivers/hwmon/dme1737.c
1912 1676
1913DOCBOOK FOR DOCUMENTATION 1677DOCBOOK FOR DOCUMENTATION
1914P: Randy Dunlap 1678M: Randy Dunlap <rdunlap@xenotime.net>
1915M: rdunlap@xenotime.net
1916S: Maintained 1679S: Maintained
1917 1680
1918DOCKING STATION DRIVER 1681DOCKING STATION DRIVER
1919P: Shaohua Li 1682M: Shaohua Li <shaohua.li@intel.com>
1920M: shaohua.li@intel.com
1921L: linux-acpi@vger.kernel.org 1683L: linux-acpi@vger.kernel.org
1922S: Supported 1684S: Supported
1923F: drivers/acpi/dock.c 1685F: drivers/acpi/dock.c
1924 1686
1925DOCUMENTATION 1687DOCUMENTATION
1926P: Randy Dunlap 1688M: Randy Dunlap <rdunlap@xenotime.net>
1927M: rdunlap@xenotime.net
1928L: linux-doc@vger.kernel.org 1689L: linux-doc@vger.kernel.org
1929S: Maintained 1690S: Maintained
1930F: Documentation/ 1691F: Documentation/
1931 1692
1932DOUBLETALK DRIVER 1693DOUBLETALK DRIVER
1933P: James R. Van Zandt 1694M: "James R. Van Zandt" <jrv@vanzandt.mv.com>
1934M: jrv@vanzandt.mv.com
1935L: blinux-list@redhat.com 1695L: blinux-list@redhat.com
1936S: Maintained 1696S: Maintained
1937F: drivers/char/dtlk.c 1697F: drivers/char/dtlk.c
1938F: include/linux/dtlk.h 1698F: include/linux/dtlk.h
1939 1699
1940DPT_I2O SCSI RAID DRIVER 1700DPT_I2O SCSI RAID DRIVER
1941P: Adaptec OEM Raid Solutions 1701M: Adaptec OEM Raid Solutions <aacraid@adaptec.com>
1942M: aacraid@adaptec.com
1943L: linux-scsi@vger.kernel.org 1702L: linux-scsi@vger.kernel.org
1944W: http://www.adaptec.com/ 1703W: http://www.adaptec.com/
1945S: Maintained 1704S: Maintained
@@ -1947,8 +1706,7 @@ F: drivers/scsi/dpt*
1947F: drivers/scsi/dpt/ 1706F: drivers/scsi/dpt/
1948 1707
1949DRIVER CORE, KOBJECTS, AND SYSFS 1708DRIVER CORE, KOBJECTS, AND SYSFS
1950P: Greg Kroah-Hartman 1709M: Greg Kroah-Hartman <gregkh@suse.de>
1951M: gregkh@suse.de
1952T: quilt kernel.org/pub/linux/kernel/people/gregkh/gregkh-2.6/ 1710T: quilt kernel.org/pub/linux/kernel/people/gregkh/gregkh-2.6/
1953S: Supported 1711S: Supported
1954F: Documentation/kobject.txt 1712F: Documentation/kobject.txt
@@ -1958,52 +1716,45 @@ F: include/linux/kobj*
1958F: lib/kobj* 1716F: lib/kobj*
1959 1717
1960DRM DRIVERS 1718DRM DRIVERS
1961P: David Airlie 1719M: David Airlie <airlied@linux.ie>
1962M: airlied@linux.ie
1963L: dri-devel@lists.sourceforge.net 1720L: dri-devel@lists.sourceforge.net
1964T: git git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6.git 1721T: git git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6.git
1965S: Maintained 1722S: Maintained
1966F: drivers/gpu/drm/ 1723F: drivers/gpu/drm/
1967 1724
1968DSCC4 DRIVER 1725DSCC4 DRIVER
1969P: Francois Romieu 1726M: Francois Romieu <romieu@fr.zoreil.com>
1970M: romieu@fr.zoreil.com
1971L: netdev@vger.kernel.org 1727L: netdev@vger.kernel.org
1972S: Maintained 1728S: Maintained
1973F: drivers/net/wan/dscc4.c 1729F: drivers/net/wan/dscc4.c
1974 1730
1975DZ DECSTATION DZ11 SERIAL DRIVER 1731DZ DECSTATION DZ11 SERIAL DRIVER
1976P: Maciej W. Rozycki 1732M: "Maciej W. Rozycki" <macro@linux-mips.org>
1977M: macro@linux-mips.org
1978S: Maintained 1733S: Maintained
1979F: drivers/serial/dz.* 1734F: drivers/serial/dz.*
1980 1735
1981EATA-DMA SCSI DRIVER 1736EATA-DMA SCSI DRIVER
1982P: Michael Neuffer 1737M: Michael Neuffer <mike@i-Connect.Net>
1983M: mike@i-Connect.Net
1984L: linux-eata@i-connect.net 1738L: linux-eata@i-connect.net
1985L: linux-scsi@vger.kernel.org 1739L: linux-scsi@vger.kernel.org
1986S: Maintained 1740S: Maintained
1987F: drivers/scsi/eata* 1741F: drivers/scsi/eata*
1988 1742
1989EATA ISA/EISA/PCI SCSI DRIVER 1743EATA ISA/EISA/PCI SCSI DRIVER
1990P: Dario Ballabio 1744M: Dario Ballabio <ballabio_dario@emc.com>
1991M: ballabio_dario@emc.com
1992L: linux-scsi@vger.kernel.org 1745L: linux-scsi@vger.kernel.org
1993S: Maintained 1746S: Maintained
1994F: drivers/scsi/eata.c 1747F: drivers/scsi/eata.c
1995 1748
1996EATA-PIO SCSI DRIVER 1749EATA-PIO SCSI DRIVER
1997P: Michael Neuffer 1750M: Michael Neuffer <mike@i-Connect.Net>
1998M: mike@i-Connect.Net
1999L: linux-eata@i-connect.net 1751L: linux-eata@i-connect.net
2000L: linux-scsi@vger.kernel.org 1752L: linux-scsi@vger.kernel.org
2001S: Maintained 1753S: Maintained
2002F: drivers/scsi/eata_pio.* 1754F: drivers/scsi/eata_pio.*
2003 1755
2004EBTABLES 1756EBTABLES
2005P: Bart De Schuymer 1757M: Bart De Schuymer <bart.de.schuymer@pandora.be>
2006M: bart.de.schuymer@pandora.be
2007L: ebtables-user@lists.sourceforge.net 1758L: ebtables-user@lists.sourceforge.net
2008L: ebtables-devel@lists.sourceforge.net 1759L: ebtables-devel@lists.sourceforge.net
2009W: http://ebtables.sourceforge.net/ 1760W: http://ebtables.sourceforge.net/
@@ -2012,10 +1763,8 @@ F: include/linux/netfilter_bridge/ebt_*.h
2012F: net/bridge/netfilter/ebt*.c 1763F: net/bridge/netfilter/ebt*.c
2013 1764
2014ECRYPT FILE SYSTEM 1765ECRYPT FILE SYSTEM
2015P: Tyler Hicks 1766M: Tyler Hicks <tyhicks@linux.vnet.ibm.com>
2016M: tyhicks@linux.vnet.ibm.com 1767M: Dustin Kirkland <kirkland@canonical.com>
2017P: Dustin Kirkland
2018M: kirkland@canonical.com
2019L: ecryptfs-devel@lists.launchpad.net 1768L: ecryptfs-devel@lists.launchpad.net
2020W: https://launchpad.net/ecryptfs 1769W: https://launchpad.net/ecryptfs
2021S: Supported 1770S: Supported
@@ -2023,8 +1772,7 @@ F: Documentation/filesystems/ecryptfs.txt
2023F: fs/ecryptfs/ 1772F: fs/ecryptfs/
2024 1773
2025EDAC-CORE 1774EDAC-CORE
2026P: Doug Thompson 1775M: Doug Thompson <dougthompson@xmission.com>
2027M: dougthompson@xmission.com
2028L: bluesmoke-devel@lists.sourceforge.net (moderated for non-subscribers) 1776L: bluesmoke-devel@lists.sourceforge.net (moderated for non-subscribers)
2029W: bluesmoke.sourceforge.net 1777W: bluesmoke.sourceforge.net
2030S: Supported 1778S: Supported
@@ -2033,94 +1781,80 @@ F: drivers/edac/edac_*
2033F: include/linux/edac.h 1781F: include/linux/edac.h
2034 1782
2035EDAC-AMD64 1783EDAC-AMD64
2036P: Doug Thompson 1784M: Doug Thompson <dougthompson@xmission.com>
2037M: dougthompson@xmission.com 1785M: Borislav Petkov <borislav.petkov@amd.com>
2038P: Borislav Petkov
2039M: borislav.petkov@amd.com
2040L: bluesmoke-devel@lists.sourceforge.net (moderated for non-subscribers) 1786L: bluesmoke-devel@lists.sourceforge.net (moderated for non-subscribers)
2041W: bluesmoke.sourceforge.net 1787W: bluesmoke.sourceforge.net
2042S: Supported 1788S: Supported
2043F: drivers/edac/amd64_edac* 1789F: drivers/edac/amd64_edac*
2044 1790
2045EDAC-E752X 1791EDAC-E752X
2046P: Mark Gross 1792M: Mark Gross <mark.gross@intel.com>
2047M: mark.gross@intel.com 1793M: Doug Thompson <dougthompson@xmission.com>
2048P: Doug Thompson
2049M: dougthompson@xmission.com
2050L: bluesmoke-devel@lists.sourceforge.net (moderated for non-subscribers) 1794L: bluesmoke-devel@lists.sourceforge.net (moderated for non-subscribers)
2051W: bluesmoke.sourceforge.net 1795W: bluesmoke.sourceforge.net
2052S: Maintained 1796S: Maintained
2053F: drivers/edac/e752x_edac.c 1797F: drivers/edac/e752x_edac.c
2054 1798
2055EDAC-E7XXX 1799EDAC-E7XXX
2056P: Doug Thompson 1800M: Doug Thompson <dougthompson@xmission.com>
2057M: dougthompson@xmission.com
2058L: bluesmoke-devel@lists.sourceforge.net (moderated for non-subscribers) 1801L: bluesmoke-devel@lists.sourceforge.net (moderated for non-subscribers)
2059W: bluesmoke.sourceforge.net 1802W: bluesmoke.sourceforge.net
2060S: Maintained 1803S: Maintained
2061F: drivers/edac/e7xxx_edac.c 1804F: drivers/edac/e7xxx_edac.c
2062 1805
2063EDAC-I82443BXGX 1806EDAC-I82443BXGX
2064P: Tim Small 1807M: Tim Small <tim@buttersideup.com>
2065M: tim@buttersideup.com
2066L: bluesmoke-devel@lists.sourceforge.net (moderated for non-subscribers) 1808L: bluesmoke-devel@lists.sourceforge.net (moderated for non-subscribers)
2067W: bluesmoke.sourceforge.net 1809W: bluesmoke.sourceforge.net
2068S: Maintained 1810S: Maintained
2069F: drivers/edac/i82443bxgx_edac.c 1811F: drivers/edac/i82443bxgx_edac.c
2070 1812
2071EDAC-I3000 1813EDAC-I3000
2072P: Jason Uhlenkott 1814M: Jason Uhlenkott <juhlenko@akamai.com>
2073M: juhlenko@akamai.com
2074L: bluesmoke-devel@lists.sourceforge.net (moderated for non-subscribers) 1815L: bluesmoke-devel@lists.sourceforge.net (moderated for non-subscribers)
2075W: bluesmoke.sourceforge.net 1816W: bluesmoke.sourceforge.net
2076S: Maintained 1817S: Maintained
2077F: drivers/edac/i3000_edac.c 1818F: drivers/edac/i3000_edac.c
2078 1819
2079EDAC-I5000 1820EDAC-I5000
2080P: Doug Thompson 1821M: Doug Thompson <dougthompson@xmission.com>
2081M: dougthompson@xmission.com
2082L: bluesmoke-devel@lists.sourceforge.net (moderated for non-subscribers) 1822L: bluesmoke-devel@lists.sourceforge.net (moderated for non-subscribers)
2083W: bluesmoke.sourceforge.net 1823W: bluesmoke.sourceforge.net
2084S: Maintained 1824S: Maintained
2085F: drivers/edac/i5000_edac.c 1825F: drivers/edac/i5000_edac.c
2086 1826
2087EDAC-I5400 1827EDAC-I5400
2088P: Mauro Carvalho Chehab 1828M: Mauro Carvalho Chehab <mchehab@redhat.com>
2089M: mchehab@redhat.com
2090L: bluesmoke-devel@lists.sourceforge.net (moderated for non-subscribers) 1829L: bluesmoke-devel@lists.sourceforge.net (moderated for non-subscribers)
2091W: bluesmoke.sourceforge.net 1830W: bluesmoke.sourceforge.net
2092S: Maintained 1831S: Maintained
2093F: drivers/edac/i5400_edac.c 1832F: drivers/edac/i5400_edac.c
2094 1833
2095EDAC-I82975X 1834EDAC-I82975X
2096P: Ranganathan Desikan 1835M: Ranganathan Desikan <ravi@jetztechnologies.com>
2097M: rdesikan@jetzbroadband.com 1836M: "Arvind R." <arvind@jetztechnologies.com>
2098P: Arvind R.
2099M: arvind@acarlab.com
2100L: bluesmoke-devel@lists.sourceforge.net (moderated for non-subscribers) 1837L: bluesmoke-devel@lists.sourceforge.net (moderated for non-subscribers)
2101W: bluesmoke.sourceforge.net 1838W: bluesmoke.sourceforge.net
2102S: Maintained 1839S: Maintained
2103F: drivers/edac/i82975x_edac.c 1840F: drivers/edac/i82975x_edac.c
2104 1841
2105EDAC-PASEMI 1842EDAC-PASEMI
2106P: Egor Martovetsky 1843M: Egor Martovetsky <egor@pasemi.com>
2107M: egor@pasemi.com
2108L: bluesmoke-devel@lists.sourceforge.net (moderated for non-subscribers) 1844L: bluesmoke-devel@lists.sourceforge.net (moderated for non-subscribers)
2109W: bluesmoke.sourceforge.net 1845W: bluesmoke.sourceforge.net
2110S: Maintained 1846S: Maintained
2111F: drivers/edac/pasemi_edac.c 1847F: drivers/edac/pasemi_edac.c
2112 1848
2113EDAC-R82600 1849EDAC-R82600
2114P: Tim Small 1850M: Tim Small <tim@buttersideup.com>
2115M: tim@buttersideup.com
2116L: bluesmoke-devel@lists.sourceforge.net (moderated for non-subscribers) 1851L: bluesmoke-devel@lists.sourceforge.net (moderated for non-subscribers)
2117W: bluesmoke.sourceforge.net 1852W: bluesmoke.sourceforge.net
2118S: Maintained 1853S: Maintained
2119F: drivers/edac/r82600_edac.c 1854F: drivers/edac/r82600_edac.c
2120 1855
2121EEEPC LAPTOP EXTRAS DRIVER 1856EEEPC LAPTOP EXTRAS DRIVER
2122P: Corentin Chary 1857M: Corentin Chary <corentincj@iksaif.net>
2123M: corentincj@iksaif.net
2124L: acpi4asus-user@lists.sourceforge.net 1858L: acpi4asus-user@lists.sourceforge.net
2125W: http://acpi4asus.sf.net 1859W: http://acpi4asus.sf.net
2126S: Maintained 1860S: Maintained
@@ -2132,66 +1866,54 @@ S: Orphan
2132F: fs/efs/ 1866F: fs/efs/
2133 1867
2134EHCA (IBM GX bus InfiniBand adapter) DRIVER 1868EHCA (IBM GX bus InfiniBand adapter) DRIVER
2135P: Hoang-Nam Nguyen 1869M: Hoang-Nam Nguyen <hnguyen@de.ibm.com>
2136M: hnguyen@de.ibm.com 1870M: Christoph Raisch <raisch@de.ibm.com>
2137P: Christoph Raisch
2138M: raisch@de.ibm.com
2139L: general@lists.openfabrics.org 1871L: general@lists.openfabrics.org
2140S: Supported 1872S: Supported
2141F: drivers/infiniband/hw/ehca/ 1873F: drivers/infiniband/hw/ehca/
2142 1874
2143EMBEDDED LINUX 1875EMBEDDED LINUX
2144P: Paul Gortmaker 1876M: Paul Gortmaker <paul.gortmaker@windriver.com>
2145M: paul.gortmaker@windriver.com 1877M: Matt Mackall <mpm@selenic.com>
2146P: Matt Mackall 1878M: David Woodhouse <dwmw2@infradead.org>
2147M: mpm@selenic.com
2148P: David Woodhouse
2149M: dwmw2@infradead.org
2150L: linux-embedded@vger.kernel.org 1879L: linux-embedded@vger.kernel.org
2151S: Maintained 1880S: Maintained
2152 1881
2153EMULEX LPFC FC SCSI DRIVER 1882EMULEX LPFC FC SCSI DRIVER
2154P: James Smart 1883M: James Smart <james.smart@emulex.com>
2155M: james.smart@emulex.com
2156L: linux-scsi@vger.kernel.org 1884L: linux-scsi@vger.kernel.org
2157W: http://sourceforge.net/projects/lpfcxxxx 1885W: http://sourceforge.net/projects/lpfcxxxx
2158S: Supported 1886S: Supported
2159F: drivers/scsi/lpfc/ 1887F: drivers/scsi/lpfc/
2160 1888
2161ENE CB710 FLASH CARD READER DRIVER 1889ENE CB710 FLASH CARD READER DRIVER
2162P: Michał Mirosław 1890M: Michał Mirosław <mirq-linux@rere.qmqm.pl>
2163M: mirq-linux@rere.qmqm.pl
2164L: linux-kernel@vger.kernel.org
2165S: Maintained 1891S: Maintained
2166F: drivers/misc/cb710/ 1892F: drivers/misc/cb710/
2167F: drivers/mmc/host/cb710-mmc.* 1893F: drivers/mmc/host/cb710-mmc.*
2168F: include/linux/cb710.h 1894F: include/linux/cb710.h
2169 1895
2170EPSON 1355 FRAMEBUFFER DRIVER 1896EPSON 1355 FRAMEBUFFER DRIVER
2171P: Christopher Hoover 1897M: Christopher Hoover <ch@murgatroid.com>
2172M: ch@murgatroid.com 1898M: Christopher Hoover <ch@hpl.hp.com>
2173P: Christopher Hoover
2174M: ch@hpl.hp.com
2175S: Maintained 1899S: Maintained
2176F: drivers/video/epson1355fb.c 1900F: drivers/video/epson1355fb.c
2177 1901
2178EPSON S1D13XXX FRAMEBUFFER DRIVER 1902EPSON S1D13XXX FRAMEBUFFER DRIVER
2179P: Kristoffer Ericson 1903M: Kristoffer Ericson <kristoffer.ericson@gmail.com>
2180M: kristoffer.ericson@gmail.com
2181S: Maintained 1904S: Maintained
1905T: git git://git.kernel.org/pub/scm/linux/kernel/git/kristoffer/linux-hpc.git
2182F: drivers/video/s1d13xxxfb.c 1906F: drivers/video/s1d13xxxfb.c
2183F: include/video/s1d13xxxfb.h 1907F: include/video/s1d13xxxfb.h
2184 1908
2185ETHEREXPRESS-16 NETWORK DRIVER 1909ETHEREXPRESS-16 NETWORK DRIVER
2186P: Philip Blundell 1910M: Philip Blundell <philb@gnu.org>
2187M: philb@gnu.org
2188L: netdev@vger.kernel.org 1911L: netdev@vger.kernel.org
2189S: Maintained 1912S: Maintained
2190F: drivers/net/eexpress.* 1913F: drivers/net/eexpress.*
2191 1914
2192ETHERNET BRIDGE 1915ETHERNET BRIDGE
2193P: Stephen Hemminger 1916M: Stephen Hemminger <shemminger@linux-foundation.org>
2194M: shemminger@linux-foundation.org
2195L: bridge@lists.linux-foundation.org 1917L: bridge@lists.linux-foundation.org
2196W: http://www.linux-foundation.org/en/Net:Bridge 1918W: http://www.linux-foundation.org/en/Net:Bridge
2197S: Maintained 1919S: Maintained
@@ -2199,8 +1921,7 @@ F: include/linux/netfilter_bridge/
2199F: net/bridge/ 1921F: net/bridge/
2200 1922
2201ETHERTEAM 16I DRIVER 1923ETHERTEAM 16I DRIVER
2202P: Mika Kuoppala 1924M: Mika Kuoppala <miku@iki.fi>
2203M: miku@iki.fi
2204S: Maintained 1925S: Maintained
2205F: drivers/net/eth16i.c 1926F: drivers/net/eth16i.c
2206 1927
@@ -2212,12 +1933,9 @@ F: fs/ext2/
2212F: include/linux/ext2* 1933F: include/linux/ext2*
2213 1934
2214EXT3 FILE SYSTEM 1935EXT3 FILE SYSTEM
2215P: Stephen Tweedie 1936M: Stephen Tweedie <sct@redhat.com>
2216M: sct@redhat.com 1937M: Andrew Morton <akpm@linux-foundation.org>
2217P: Andrew Morton 1938M: Andreas Dilger <adilger@sun.com>
2218M: akpm@linux-foundation.org
2219P: Andreas Dilger
2220M: adilger@sun.com
2221L: linux-ext4@vger.kernel.org 1939L: linux-ext4@vger.kernel.org
2222S: Maintained 1940S: Maintained
2223F: Documentation/filesystems/ext3.txt 1941F: Documentation/filesystems/ext3.txt
@@ -2225,10 +1943,8 @@ F: fs/ext3/
2225F: include/linux/ext3* 1943F: include/linux/ext3*
2226 1944
2227EXT4 FILE SYSTEM 1945EXT4 FILE SYSTEM
2228P: Theodore Ts'o 1946M: "Theodore Ts'o" <tytso@mit.edu>
2229M: tytso@mit.edu 1947M: Andreas Dilger <adilger@sun.com>
2230P: Andreas Dilger
2231M: adilger@sun.com
2232L: linux-ext4@vger.kernel.org 1948L: linux-ext4@vger.kernel.org
2233W: http://ext4.wiki.kernel.org 1949W: http://ext4.wiki.kernel.org
2234S: Maintained 1950S: Maintained
@@ -2236,30 +1952,26 @@ F: Documentation/filesystems/ext4.txt
2236F: fs/ext4/ 1952F: fs/ext4/
2237 1953
2238F71805F HARDWARE MONITORING DRIVER 1954F71805F HARDWARE MONITORING DRIVER
2239P: Jean Delvare 1955M: Jean Delvare <khali@linux-fr.org>
2240M: khali@linux-fr.org
2241L: lm-sensors@lm-sensors.org 1956L: lm-sensors@lm-sensors.org
2242S: Maintained 1957S: Maintained
2243F: Documentation/hwmon/f71805f 1958F: Documentation/hwmon/f71805f
2244F: drivers/hwmon/f71805f.c 1959F: drivers/hwmon/f71805f.c
2245 1960
2246FARSYNC SYNCHRONOUS DRIVER 1961FARSYNC SYNCHRONOUS DRIVER
2247P: Kevin Curtis 1962M: Kevin Curtis <kevin.curtis@farsite.co.uk>
2248M: kevin.curtis@farsite.co.uk
2249W: http://www.farsite.co.uk/ 1963W: http://www.farsite.co.uk/
2250S: Supported 1964S: Supported
2251F: drivers/net/wan/farsync.* 1965F: drivers/net/wan/farsync.*
2252 1966
2253FAULT INJECTION SUPPORT 1967FAULT INJECTION SUPPORT
2254P: Akinobu Mita 1968M: Akinobu Mita <akinobu.mita@gmail.com>
2255M: akinobu.mita@gmail.com
2256S: Supported 1969S: Supported
2257F: Documentation/fault-injection/ 1970F: Documentation/fault-injection/
2258F: lib/fault-inject.c 1971F: lib/fault-inject.c
2259 1972
2260FILE LOCKING (flock() and fcntl()/lockf()) 1973FILE LOCKING (flock() and fcntl()/lockf())
2261P: Matthew Wilcox 1974M: Matthew Wilcox <matthew@wil.cx>
2262M: matthew@wil.cx
2263L: linux-fsdevel@vger.kernel.org 1975L: linux-fsdevel@vger.kernel.org
2264S: Maintained 1976S: Maintained
2265F: include/linux/fcntl.h 1977F: include/linux/fcntl.h
@@ -2268,25 +1980,21 @@ F: fs/fcntl.c
2268F: fs/locks.c 1980F: fs/locks.c
2269 1981
2270FILESYSTEMS (VFS and infrastructure) 1982FILESYSTEMS (VFS and infrastructure)
2271P: Alexander Viro 1983M: Alexander Viro <viro@zeniv.linux.org.uk>
2272M: viro@zeniv.linux.org.uk
2273L: linux-fsdevel@vger.kernel.org 1984L: linux-fsdevel@vger.kernel.org
2274S: Maintained 1985S: Maintained
2275F: fs/* 1986F: fs/*
2276 1987
2277FINTEK F75375S HARDWARE MONITOR AND FAN CONTROLLER DRIVER 1988FINTEK F75375S HARDWARE MONITOR AND FAN CONTROLLER DRIVER
2278P: Riku Voipio 1989M: Riku Voipio <riku.vipio@iki.fi>
2279M: riku.vipio@iki.fi
2280L: lm-sensors@lm-sensors.org 1990L: lm-sensors@lm-sensors.org
2281S: Maintained 1991S: Maintained
2282F: drivers/hwmon/f75375s.c 1992F: drivers/hwmon/f75375s.c
2283F: include/linux/f75375s.h 1993F: include/linux/f75375s.h
2284 1994
2285FIREWIRE SUBSYSTEM 1995FIREWIRE SUBSYSTEM
2286P: Kristian Hoegsberg 1996M: Kristian Hoegsberg <krh@redhat.com>
2287M: krh@redhat.com 1997M: Stefan Richter <stefanr@s5r6.in-berlin.de>
2288P: Stefan Richter
2289M: stefanr@s5r6.in-berlin.de
2290L: linux1394-devel@lists.sourceforge.net 1998L: linux1394-devel@lists.sourceforge.net
2291W: http://www.linux1394.org/ 1999W: http://www.linux1394.org/
2292T: git git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394-2.6.git 2000T: git git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394-2.6.git
@@ -2301,15 +2009,13 @@ F: drivers/base/firmware*.c
2301F: include/linux/firmware.h 2009F: include/linux/firmware.h
2302 2010
2303FPU EMULATOR 2011FPU EMULATOR
2304P: Bill Metzenthen 2012M: Bill Metzenthen <billm@melbpc.org.au>
2305M: billm@melbpc.org.au
2306W: http://floatingpoint.sourceforge.net/emulator/index.html 2013W: http://floatingpoint.sourceforge.net/emulator/index.html
2307S: Maintained 2014S: Maintained
2308F: arch/x86/math-emu/ 2015F: arch/x86/math-emu/
2309 2016
2310FRAME RELAY DLCI/FRAD (Sangoma drivers too) 2017FRAME RELAY DLCI/FRAD (Sangoma drivers too)
2311P: Mike McLagan 2018M: Mike McLagan <mike.mclagan@linux.org>
2312M: mike.mclagan@linux.org
2313L: netdev@vger.kernel.org 2019L: netdev@vger.kernel.org
2314S: Maintained 2020S: Maintained
2315F: drivers/net/wan/dlci.c 2021F: drivers/net/wan/dlci.c
@@ -2324,25 +2030,21 @@ F: drivers/video/fb*
2324F: include/linux/fb.h 2030F: include/linux/fb.h
2325 2031
2326FREESCALE DMA DRIVER 2032FREESCALE DMA DRIVER
2327P: Li Yang 2033M: Li Yang <leoli@freescale.com>
2328M: leoli@freescale.com 2034M: Zhang Wei <zw@zh-kernel.org>
2329P: Zhang Wei
2330M: zw@zh-kernel.org
2331L: linuxppc-dev@ozlabs.org 2035L: linuxppc-dev@ozlabs.org
2332S: Maintained 2036S: Maintained
2333F: drivers/dma/fsldma.* 2037F: drivers/dma/fsldma.*
2334 2038
2335FREESCALE I2C CPM DRIVER 2039FREESCALE I2C CPM DRIVER
2336P: Jochen Friedrich 2040M: Jochen Friedrich <jochen@scram.de>
2337M: jochen@scram.de
2338L: linuxppc-dev@ozlabs.org 2041L: linuxppc-dev@ozlabs.org
2339L: linux-i2c@vger.kernel.org 2042L: linux-i2c@vger.kernel.org
2340S: Maintained 2043S: Maintained
2341F: drivers/i2c/busses/i2c-cpm.c 2044F: drivers/i2c/busses/i2c-cpm.c
2342 2045
2343FREESCALE IMX / MXC FRAMEBUFFER DRIVER 2046FREESCALE IMX / MXC FRAMEBUFFER DRIVER
2344P: Sascha Hauer 2047M: Sascha Hauer <kernel@pengutronix.de>
2345M: kernel@pengutronix.de
2346L: linux-fbdev-devel@lists.sourceforge.net (moderated for non-subscribers) 2048L: linux-fbdev-devel@lists.sourceforge.net (moderated for non-subscribers)
2347L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only) 2049L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only)
2348S: Maintained 2050S: Maintained
@@ -2350,10 +2052,8 @@ F: arch/arm/plat-mxc/include/mach/imxfb.h
2350F: drivers/video/imxfb.c 2052F: drivers/video/imxfb.c
2351 2053
2352FREESCALE SOC FS_ENET DRIVER 2054FREESCALE SOC FS_ENET DRIVER
2353P: Pantelis Antoniou 2055M: Pantelis Antoniou <pantelis.antoniou@gmail.com>
2354M: pantelis.antoniou@gmail.com 2056M: Vitaly Bordug <vbordug@ru.mvista.com>
2355P: Vitaly Bordug
2356M: vbordug@ru.mvista.com
2357L: linuxppc-dev@ozlabs.org 2057L: linuxppc-dev@ozlabs.org
2358L: netdev@vger.kernel.org 2058L: netdev@vger.kernel.org
2359S: Maintained 2059S: Maintained
@@ -2361,39 +2061,34 @@ F: drivers/net/fs_enet/
2361F: include/linux/fs_enet_pd.h 2061F: include/linux/fs_enet_pd.h
2362 2062
2363FREESCALE QUICC ENGINE LIBRARY 2063FREESCALE QUICC ENGINE LIBRARY
2364P: Timur Tabi 2064M: Timur Tabi <timur@freescale.com>
2365M: timur@freescale.com
2366L: linuxppc-dev@ozlabs.org 2065L: linuxppc-dev@ozlabs.org
2367S: Supported 2066S: Supported
2368F: arch/powerpc/sysdev/qe_lib/ 2067F: arch/powerpc/sysdev/qe_lib/
2369F: arch/powerpc/include/asm/*qe.h 2068F: arch/powerpc/include/asm/*qe.h
2370 2069
2371FREESCALE HIGHSPEED USB DEVICE DRIVER 2070FREESCALE HIGHSPEED USB DEVICE DRIVER
2372P: Li Yang 2071M: Li Yang <leoli@freescale.com>
2373M: leoli@freescale.com
2374L: linux-usb@vger.kernel.org 2072L: linux-usb@vger.kernel.org
2375L: linuxppc-dev@ozlabs.org 2073L: linuxppc-dev@ozlabs.org
2376S: Maintained 2074S: Maintained
2377F: drivers/usb/gadget/fsl_usb2_udc.c 2075F: drivers/usb/gadget/fsl_usb2_udc.c
2378 2076
2379FREESCALE QUICC ENGINE UCC ETHERNET DRIVER 2077FREESCALE QUICC ENGINE UCC ETHERNET DRIVER
2380P: Li Yang 2078M: Li Yang <leoli@freescale.com>
2381M: leoli@freescale.com
2382L: netdev@vger.kernel.org 2079L: netdev@vger.kernel.org
2383L: linuxppc-dev@ozlabs.org 2080L: linuxppc-dev@ozlabs.org
2384S: Maintained 2081S: Maintained
2385F: drivers/net/ucc_geth* 2082F: drivers/net/ucc_geth*
2386 2083
2387FREESCALE QUICC ENGINE UCC UART DRIVER 2084FREESCALE QUICC ENGINE UCC UART DRIVER
2388P: Timur Tabi 2085M: Timur Tabi <timur@freescale.com>
2389M: timur@freescale.com
2390L: linuxppc-dev@ozlabs.org 2086L: linuxppc-dev@ozlabs.org
2391S: Supported 2087S: Supported
2392F: drivers/serial/ucc_uart.c 2088F: drivers/serial/ucc_uart.c
2393 2089
2394FREESCALE SOC SOUND DRIVERS 2090FREESCALE SOC SOUND DRIVERS
2395P: Timur Tabi 2091M: Timur Tabi <timur@freescale.com>
2396M: timur@freescale.com
2397L: alsa-devel@alsa-project.org (moderated for non-subscribers) 2092L: alsa-devel@alsa-project.org (moderated for non-subscribers)
2398L: linuxppc-dev@ozlabs.org 2093L: linuxppc-dev@ozlabs.org
2399S: Supported 2094S: Supported
@@ -2401,17 +2096,14 @@ F: sound/soc/fsl/fsl*
2401F: sound/soc/fsl/mpc8610_hpcd.c 2096F: sound/soc/fsl/mpc8610_hpcd.c
2402 2097
2403FREEVXFS FILESYSTEM 2098FREEVXFS FILESYSTEM
2404P: Christoph Hellwig 2099M: Christoph Hellwig <hch@infradead.org>
2405M: hch@infradead.org
2406W: ftp://ftp.openlinux.org/pub/people/hch/vxfs 2100W: ftp://ftp.openlinux.org/pub/people/hch/vxfs
2407S: Maintained 2101S: Maintained
2408F: fs/freevxfs/ 2102F: fs/freevxfs/
2409 2103
2410FREEZER 2104FREEZER
2411P: Pavel Machek 2105M: Pavel Machek <pavel@ucw.cz>
2412M: pavel@ucw.cz 2106M: "Rafael J. Wysocki" <rjw@sisk.pl>
2413P: Rafael J. Wysocki
2414M: rjw@sisk.pl
2415L: linux-pm@lists.linux-foundation.org 2107L: linux-pm@lists.linux-foundation.org
2416S: Supported 2108S: Supported
2417F: Documentation/power/freezing-of-tasks.txt 2109F: Documentation/power/freezing-of-tasks.txt
@@ -2419,8 +2111,7 @@ F: include/linux/freezer.h
2419F: kernel/freezer.c 2111F: kernel/freezer.c
2420 2112
2421FS-CACHE: LOCAL CACHING FOR NETWORK FILESYSTEMS 2113FS-CACHE: LOCAL CACHING FOR NETWORK FILESYSTEMS
2422P: David Howells 2114M: David Howells <dhowells@redhat.com>
2423M: dhowells@redhat.com
2424L: linux-cachefs@redhat.com 2115L: linux-cachefs@redhat.com
2425S: Supported 2116S: Supported
2426F: Documentation/filesystems/caching/ 2117F: Documentation/filesystems/caching/
@@ -2428,8 +2119,7 @@ F: fs/fscache/
2428F: include/linux/fscache*.h 2119F: include/linux/fscache*.h
2429 2120
2430FTRACE 2121FTRACE
2431P: Steven Rostedt 2122M: Steven Rostedt <rostedt@goodmis.org>
2432M: rostedt@goodmis.org
2433S: Maintained 2123S: Maintained
2434F: Documentation/trace/ftrace.txt 2124F: Documentation/trace/ftrace.txt
2435F: arch/*/*/*/ftrace.h 2125F: arch/*/*/*/ftrace.h
@@ -2438,21 +2128,18 @@ F: include/*/ftrace.h
2438F: kernel/trace/ 2128F: kernel/trace/
2439 2129
2440FUJITSU FR-V (FRV) PORT 2130FUJITSU FR-V (FRV) PORT
2441P: David Howells 2131M: David Howells <dhowells@redhat.com>
2442M: dhowells@redhat.com
2443S: Maintained 2132S: Maintained
2444F: arch/frv/ 2133F: arch/frv/
2445 2134
2446FUJITSU LAPTOP EXTRAS 2135FUJITSU LAPTOP EXTRAS
2447P: Jonathan Woithe 2136M: Jonathan Woithe <jwoithe@physics.adelaide.edu.au>
2448M: jwoithe@physics.adelaide.edu.au
2449L: linux-acpi@vger.kernel.org 2137L: linux-acpi@vger.kernel.org
2450S: Maintained 2138S: Maintained
2451F: drivers/platform/x86/fujitsu-laptop.c 2139F: drivers/platform/x86/fujitsu-laptop.c
2452 2140
2453FUSE: FILESYSTEM IN USERSPACE 2141FUSE: FILESYSTEM IN USERSPACE
2454P: Miklos Szeredi 2142M: Miklos Szeredi <miklos@szeredi.hu>
2455M: miklos@szeredi.hu
2456L: fuse-devel@lists.sourceforge.net 2143L: fuse-devel@lists.sourceforge.net
2457W: http://fuse.sourceforge.net/ 2144W: http://fuse.sourceforge.net/
2458S: Maintained 2145S: Maintained
@@ -2460,30 +2147,26 @@ F: fs/fuse/
2460F: include/linux/fuse.h 2147F: include/linux/fuse.h
2461 2148
2462FUTURE DOMAIN TMC-16x0 SCSI DRIVER (16-bit) 2149FUTURE DOMAIN TMC-16x0 SCSI DRIVER (16-bit)
2463P: Rik Faith 2150M: Rik Faith <faith@cs.unc.edu>
2464M: faith@cs.unc.edu
2465L: linux-scsi@vger.kernel.org 2151L: linux-scsi@vger.kernel.org
2466S: Odd Fixes (e.g., new signatures) 2152S: Odd Fixes (e.g., new signatures)
2467F: drivers/scsi/fdomain.* 2153F: drivers/scsi/fdomain.*
2468 2154
2469GDT SCSI DISK ARRAY CONTROLLER DRIVER 2155GDT SCSI DISK ARRAY CONTROLLER DRIVER
2470P: Achim Leubner 2156M: Achim Leubner <achim_leubner@adaptec.com>
2471M: achim_leubner@adaptec.com
2472L: linux-scsi@vger.kernel.org 2157L: linux-scsi@vger.kernel.org
2473W: http://www.icp-vortex.com/ 2158W: http://www.icp-vortex.com/
2474S: Supported 2159S: Supported
2475F: drivers/scsi/gdt* 2160F: drivers/scsi/gdt*
2476 2161
2477GENERIC GPIO I2C DRIVER 2162GENERIC GPIO I2C DRIVER
2478P: Haavard Skinnemoen 2163M: Haavard Skinnemoen <hskinnemoen@atmel.com>
2479M: hskinnemoen@atmel.com
2480S: Supported 2164S: Supported
2481F: drivers/i2c/busses/i2c-gpio.c 2165F: drivers/i2c/busses/i2c-gpio.c
2482F: include/linux/i2c-gpio.h 2166F: include/linux/i2c-gpio.h
2483 2167
2484GENERIC HDLC (WAN) DRIVERS 2168GENERIC HDLC (WAN) DRIVERS
2485P: Krzysztof Halasa 2169M: Krzysztof Halasa <khc@pm.waw.pl>
2486M: khc@pm.waw.pl
2487W: http://www.kernel.org/pub/linux/utils/net/hdlc/ 2170W: http://www.kernel.org/pub/linux/utils/net/hdlc/
2488S: Maintained 2171S: Maintained
2489F: drivers/net/wan/c101.c 2172F: drivers/net/wan/c101.c
@@ -2495,16 +2178,14 @@ F: drivers/net/wan/pci200syn.c
2495F: drivers/net/wan/wanxl* 2178F: drivers/net/wan/wanxl*
2496 2179
2497GENERIC INCLUDE/ASM HEADER FILES 2180GENERIC INCLUDE/ASM HEADER FILES
2498P: Arnd Bergmann 2181M: Arnd Bergmann <arnd@arndb.de>
2499M: arnd@arndb.de
2500L: linux-arch@vger.kernel.org 2182L: linux-arch@vger.kernel.org
2501T: git git://git.kernel.org/pub/scm/linux/kernel/git/arnd/asm-generic.git 2183T: git git://git.kernel.org/pub/scm/linux/kernel/git/arnd/asm-generic.git
2502S: Maintained 2184S: Maintained
2503F: include/asm-generic 2185F: include/asm-generic
2504 2186
2505GFS2 FILE SYSTEM 2187GFS2 FILE SYSTEM
2506P: Steven Whitehouse 2188M: Steven Whitehouse <swhiteho@redhat.com>
2507M: swhiteho@redhat.com
2508L: cluster-devel@redhat.com 2189L: cluster-devel@redhat.com
2509W: http://sources.redhat.com/cluster/ 2190W: http://sources.redhat.com/cluster/
2510T: git git://git.kernel.org/pub/scm/linux/kernel/git/steve/gfs2-2.6-fixes.git 2191T: git git://git.kernel.org/pub/scm/linux/kernel/git/steve/gfs2-2.6-fixes.git
@@ -2515,10 +2196,8 @@ F: fs/gfs2/
2515F: include/linux/gfs2_ondisk.h 2196F: include/linux/gfs2_ondisk.h
2516 2197
2517GIGASET ISDN DRIVERS 2198GIGASET ISDN DRIVERS
2518P: Hansjoerg Lipp 2199M: Hansjoerg Lipp <hjlipp@web.de>
2519M: hjlipp@web.de 2200M: Tilman Schmidt <tilman@imap.cc>
2520P: Tilman Schmidt
2521M: tilman@imap.cc
2522L: gigaset307x-common@lists.sourceforge.net 2201L: gigaset307x-common@lists.sourceforge.net
2523W: http://gigaset307x.sourceforge.net/ 2202W: http://gigaset307x.sourceforge.net/
2524S: Maintained 2203S: Maintained
@@ -2527,8 +2206,7 @@ F: drivers/isdn/gigaset/
2527F: include/linux/gigaset_dev.h 2206F: include/linux/gigaset_dev.h
2528 2207
2529HARD DRIVE ACTIVE PROTECTION SYSTEM (HDAPS) DRIVER 2208HARD DRIVE ACTIVE PROTECTION SYSTEM (HDAPS) DRIVER
2530P: Frank Seidel 2209M: Frank Seidel <frank@f-seidel.de>
2531M: frank@f-seidel.de
2532L: lm-sensors@lm-sensors.org 2210L: lm-sensors@lm-sensors.org
2533W: http://www.kernel.org/pub/linux/kernel/people/fseidel/hdaps/ 2211W: http://www.kernel.org/pub/linux/kernel/people/fseidel/hdaps/
2534S: Maintained 2212S: Maintained
@@ -2540,40 +2218,35 @@ S: Odd Fixes
2540F: drivers/char/hvc_* 2218F: drivers/char/hvc_*
2541 2219
2542GSPCA FINEPIX SUBDRIVER 2220GSPCA FINEPIX SUBDRIVER
2543P: Frank Zago 2221M: Frank Zago <frank@zago.net>
2544M: frank@zago.net
2545L: linux-media@vger.kernel.org 2222L: linux-media@vger.kernel.org
2546T: git git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6.git 2223T: git git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6.git
2547S: Maintained 2224S: Maintained
2548F: drivers/media/video/gspca/finepix.c 2225F: drivers/media/video/gspca/finepix.c
2549 2226
2550GSPCA M5602 SUBDRIVER 2227GSPCA M5602 SUBDRIVER
2551P: Erik Andren 2228M: Erik Andren <erik.andren@gmail.com>
2552M: erik.andren@gmail.com
2553L: linux-media@vger.kernel.org 2229L: linux-media@vger.kernel.org
2554T: git git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6.git 2230T: git git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6.git
2555S: Maintained 2231S: Maintained
2556F: drivers/media/video/gspca/m5602/ 2232F: drivers/media/video/gspca/m5602/
2557 2233
2558GSPCA PAC207 SONIXB SUBDRIVER 2234GSPCA PAC207 SONIXB SUBDRIVER
2559P: Hans de Goede 2235M: Hans de Goede <hdegoede@redhat.com>
2560M: hdegoede@redhat.com
2561L: linux-media@vger.kernel.org 2236L: linux-media@vger.kernel.org
2562T: git git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6.git 2237T: git git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6.git
2563S: Maintained 2238S: Maintained
2564F: drivers/media/video/gspca/pac207.c 2239F: drivers/media/video/gspca/pac207.c
2565 2240
2566GSPCA T613 SUBDRIVER 2241GSPCA T613 SUBDRIVER
2567P: Leandro Costantino 2242M: Leandro Costantino <lcostantino@gmail.com>
2568M: lcostantino@gmail.com
2569L: linux-media@vger.kernel.org 2243L: linux-media@vger.kernel.org
2570T: git git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6.git 2244T: git git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6.git
2571S: Maintained 2245S: Maintained
2572F: drivers/media/video/gspca/t613.c 2246F: drivers/media/video/gspca/t613.c
2573 2247
2574GSPCA USB WEBCAM DRIVER 2248GSPCA USB WEBCAM DRIVER
2575P: Jean-Francois Moine 2249M: Jean-Francois Moine <moinejf@free.fr>
2576M: moinejf@free.fr
2577W: http://moinejf.free.fr 2250W: http://moinejf.free.fr
2578L: linux-media@vger.kernel.org 2251L: linux-media@vger.kernel.org
2579T: git git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6.git 2252T: git git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6.git
@@ -2593,31 +2266,27 @@ F: drivers/char/hw_random/
2593F: include/linux/hw_random.h 2266F: include/linux/hw_random.h
2594 2267
2595HARMONY SOUND DRIVER 2268HARMONY SOUND DRIVER
2596P: Kyle McMartin 2269M: Kyle McMartin <kyle@mcmartin.ca>
2597M: kyle@mcmartin.ca
2598L: linux-parisc@vger.kernel.org 2270L: linux-parisc@vger.kernel.org
2599S: Maintained 2271S: Maintained
2600F: sound/parisc/harmony.* 2272F: sound/parisc/harmony.*
2601 2273
2602HAYES ESP SERIAL DRIVER 2274HAYES ESP SERIAL DRIVER
2603P: Andrew J. Robinson 2275M: "Andrew J. Robinson" <arobinso@nyx.net>
2604M: arobinso@nyx.net
2605W: http://www.nyx.net/~arobinso 2276W: http://www.nyx.net/~arobinso
2606S: Maintained 2277S: Maintained
2607F: Documentation/serial/hayes-esp.txt 2278F: Documentation/serial/hayes-esp.txt
2608F: drivers/char/esp.c 2279F: drivers/char/esp.c
2609 2280
2610HEWLETT-PACKARD SMART2 RAID DRIVER 2281HEWLETT-PACKARD SMART2 RAID DRIVER
2611P: Chirag Kantharia 2282M: Chirag Kantharia <chirag.kantharia@hp.com>
2612M: chirag.kantharia@hp.com
2613L: iss_storagedev@hp.com 2283L: iss_storagedev@hp.com
2614S: Maintained 2284S: Maintained
2615F: Documentation/blockdev/cpqarray.txt 2285F: Documentation/blockdev/cpqarray.txt
2616F: drivers/block/cpqarray.* 2286F: drivers/block/cpqarray.*
2617 2287
2618HEWLETT-PACKARD SMART CISS RAID DRIVER (cciss) 2288HEWLETT-PACKARD SMART CISS RAID DRIVER (cciss)
2619P: Mike Miller 2289M: Mike Miller <mike.miller@hp.com>
2620M: mike.miller@hp.com
2621L: iss_storagedev@hp.com 2290L: iss_storagedev@hp.com
2622S: Supported 2291S: Supported
2623F: Documentation/blockdev/cciss.txt 2292F: Documentation/blockdev/cciss.txt
@@ -2625,25 +2294,21 @@ F: drivers/block/cciss*
2625F: include/linux/cciss_ioctl.h 2294F: include/linux/cciss_ioctl.h
2626 2295
2627HFS FILESYSTEM 2296HFS FILESYSTEM
2628P: Roman Zippel 2297M: Roman Zippel <zippel@linux-m68k.org>
2629M: zippel@linux-m68k.org
2630S: Maintained 2298S: Maintained
2631F: Documentation/filesystems/hfs.txt 2299F: Documentation/filesystems/hfs.txt
2632F: fs/hfs/ 2300F: fs/hfs/
2633 2301
2634HGA FRAMEBUFFER DRIVER 2302HGA FRAMEBUFFER DRIVER
2635P: Ferenc Bakonyi 2303M: Ferenc Bakonyi <fero@drama.obuda.kando.hu>
2636M: fero@drama.obuda.kando.hu
2637L: linux-nvidia@lists.surfsouth.com 2304L: linux-nvidia@lists.surfsouth.com
2638W: http://drama.obuda.kando.hu/~fero/cgi-bin/hgafb.shtml 2305W: http://drama.obuda.kando.hu/~fero/cgi-bin/hgafb.shtml
2639S: Maintained 2306S: Maintained
2640F: drivers/video/hgafb.c 2307F: drivers/video/hgafb.c
2641 2308
2642HIBERNATION (aka Software Suspend, aka swsusp) 2309HIBERNATION (aka Software Suspend, aka swsusp)
2643P: Pavel Machek 2310M: Pavel Machek <pavel@ucw.cz>
2644M: pavel@ucw.cz 2311M: "Rafael J. Wysocki" <rjw@sisk.pl>
2645P: Rafael J. Wysocki
2646M: rjw@sisk.pl
2647L: linux-pm@lists.linux-foundation.org 2312L: linux-pm@lists.linux-foundation.org
2648S: Supported 2313S: Supported
2649F: arch/x86/power/ 2314F: arch/x86/power/
@@ -2655,8 +2320,7 @@ F: include/linux/pm.h
2655F: arch/*/include/asm/suspend*.h 2320F: arch/*/include/asm/suspend*.h
2656 2321
2657HID CORE LAYER 2322HID CORE LAYER
2658P: Jiri Kosina 2323M: Jiri Kosina <jkosina@suse.cz>
2659M: jkosina@suse.cz
2660L: linux-input@vger.kernel.org 2324L: linux-input@vger.kernel.org
2661T: git git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid.git 2325T: git git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid.git
2662S: Maintained 2326S: Maintained
@@ -2664,16 +2328,14 @@ F: drivers/hid/
2664F: include/linux/hid* 2328F: include/linux/hid*
2665 2329
2666HIGH-RESOLUTION TIMERS, CLOCKEVENTS, DYNTICKS 2330HIGH-RESOLUTION TIMERS, CLOCKEVENTS, DYNTICKS
2667P: Thomas Gleixner 2331M: Thomas Gleixner <tglx@linutronix.de>
2668M: tglx@linutronix.de
2669S: Maintained 2332S: Maintained
2670F: Documentation/timers/ 2333F: Documentation/timers/
2671F: kernel/hrtimer.c 2334F: kernel/hrtimer.c
2672F: include/linux/hrtimer.h 2335F: include/linux/hrtimer.h
2673 2336
2674HIGH-SPEED SCC DRIVER FOR AX.25 2337HIGH-SPEED SCC DRIVER FOR AX.25
2675P: Klaus Kudielka 2338M: Klaus Kudielka <klaus.kudielka@ieee.org>
2676M: klaus.kudielka@ieee.org
2677L: linux-hams@vger.kernel.org 2339L: linux-hams@vger.kernel.org
2678W: http://www.nt.tuwien.ac.at/~kkudielk/Linux/ 2340W: http://www.nt.tuwien.ac.at/~kkudielk/Linux/
2679S: Maintained 2341S: Maintained
@@ -2681,16 +2343,14 @@ F: drivers/net/hamradio/dmascc.c
2681F: drivers/net/hamradio/scc.c 2343F: drivers/net/hamradio/scc.c
2682 2344
2683HIGHPOINT ROCKETRAID 3xxx RAID DRIVER 2345HIGHPOINT ROCKETRAID 3xxx RAID DRIVER
2684P: HighPoint Linux Team 2346M: HighPoint Linux Team <linux@highpoint-tech.com>
2685M: linux@highpoint-tech.com
2686W: http://www.highpoint-tech.com 2347W: http://www.highpoint-tech.com
2687S: Supported 2348S: Supported
2688F: Documentation/scsi/hptiop.txt 2349F: Documentation/scsi/hptiop.txt
2689F: drivers/scsi/hptiop.c 2350F: drivers/scsi/hptiop.c
2690 2351
2691HIPPI 2352HIPPI
2692P: Jes Sorensen 2353M: Jes Sorensen <jes@trained-monkey.org>
2693M: jes@trained-monkey.org
2694L: linux-hippi@sunsite.dk 2354L: linux-hippi@sunsite.dk
2695S: Maintained 2355S: Maintained
2696F: include/linux/hippidevice.h 2356F: include/linux/hippidevice.h
@@ -2698,8 +2358,7 @@ F: include/linux/if_hippi.h
2698F: net/802/hippi.c 2358F: net/802/hippi.c
2699 2359
2700HOST AP DRIVER 2360HOST AP DRIVER
2701P: Jouni Malinen 2361M: Jouni Malinen <j@w1.fi>
2702M: j@w1.fi
2703L: hostap@shmoo.com (subscribers-only) 2362L: hostap@shmoo.com (subscribers-only)
2704L: linux-wireless@vger.kernel.org 2363L: linux-wireless@vger.kernel.org
2705W: http://hostap.epitest.fi/ 2364W: http://hostap.epitest.fi/
@@ -2707,82 +2366,69 @@ S: Maintained
2707F: drivers/net/wireless/hostap/ 2366F: drivers/net/wireless/hostap/
2708 2367
2709HP COMPAQ TC1100 TABLET WMI EXTRAS DRIVER 2368HP COMPAQ TC1100 TABLET WMI EXTRAS DRIVER
2710P: Carlos Corbacho 2369M: Carlos Corbacho <carlos@strangeworlds.co.uk>
2711M: carlos@strangeworlds.co.uk
2712S: Odd Fixes 2370S: Odd Fixes
2713F: drivers/platform/x86/tc1100-wmi.c 2371F: drivers/platform/x86/tc1100-wmi.c
2714 2372
2715HP100: Driver for HP 10/100 Mbit/s Voice Grade Network Adapter Series 2373HP100: Driver for HP 10/100 Mbit/s Voice Grade Network Adapter Series
2716P: Jaroslav Kysela 2374M: Jaroslav Kysela <perex@perex.cz>
2717M: perex@perex.cz
2718S: Maintained 2375S: Maintained
2719F: drivers/net/hp100.* 2376F: drivers/net/hp100.*
2720 2377
2721HPET: High Precision Event Timers driver 2378HPET: High Precision Event Timers driver
2722P: Clemens Ladisch 2379M: Clemens Ladisch <clemens@ladisch.de>
2723M: clemens@ladisch.de
2724S: Maintained 2380S: Maintained
2725F: Documentation/timers/hpet.txt 2381F: Documentation/timers/hpet.txt
2726F: drivers/char/hpet.c 2382F: drivers/char/hpet.c
2727F: include/linux/hpet.h 2383F: include/linux/hpet.h
2728 2384
2729HPET: i386 2385HPET: i386
2730P: Venkatesh Pallipadi (Venki) 2386M: "Venkatesh Pallipadi (Venki)" <venkatesh.pallipadi@intel.com>
2731M: venkatesh.pallipadi@intel.com
2732S: Maintained 2387S: Maintained
2733F: arch/x86/kernel/hpet.c 2388F: arch/x86/kernel/hpet.c
2734F: arch/x86/include/asm/hpet.h 2389F: arch/x86/include/asm/hpet.h
2735 2390
2736HPET: x86_64 2391HPET: x86_64
2737P: Vojtech Pavlik 2392M: Vojtech Pavlik <vojtech@suse.cz>
2738M: vojtech@suse.cz
2739S: Maintained 2393S: Maintained
2740 2394
2741HPET: ACPI 2395HPET: ACPI
2742P: Bob Picco 2396M: Bob Picco <bob.picco@hp.com>
2743M: bob.picco@hp.com
2744S: Maintained 2397S: Maintained
2745F: drivers/char/hpet.c 2398F: drivers/char/hpet.c
2746 2399
2747HPFS FILESYSTEM 2400HPFS FILESYSTEM
2748P: Mikulas Patocka 2401M: Mikulas Patocka <mikulas@artax.karlin.mff.cuni.cz>
2749M: mikulas@artax.karlin.mff.cuni.cz
2750W: http://artax.karlin.mff.cuni.cz/~mikulas/vyplody/hpfs/index-e.cgi 2402W: http://artax.karlin.mff.cuni.cz/~mikulas/vyplody/hpfs/index-e.cgi
2751S: Maintained 2403S: Maintained
2752F: fs/hpfs/ 2404F: fs/hpfs/
2753 2405
2754HSO 3G MODEM DRIVER 2406HSO 3G MODEM DRIVER
2755P: Jan Dumon 2407M: Jan Dumon <j.dumon@option.com>
2756M: j.dumon@option.com
2757W: http://www.pharscape.org 2408W: http://www.pharscape.org
2758S: Maintained 2409S: Maintained
2759F: drivers/net/usb/hso.c 2410F: drivers/net/usb/hso.c
2760 2411
2761HTCPEN TOUCHSCREEN DRIVER 2412HTCPEN TOUCHSCREEN DRIVER
2762P: Pau Oliva Fora 2413M: Pau Oliva Fora <pof@eslack.org>
2763M: pof@eslack.org
2764L: linux-input@vger.kernel.org 2414L: linux-input@vger.kernel.org
2765S: Maintained 2415S: Maintained
2766F: drivers/input/touchscreen/htcpen.c 2416F: drivers/input/touchscreen/htcpen.c
2767 2417
2768HUGETLB FILESYSTEM 2418HUGETLB FILESYSTEM
2769P: William Irwin 2419M: William Irwin <wli@holomorphy.com>
2770M: wli@holomorphy.com
2771S: Maintained 2420S: Maintained
2772F: fs/hugetlbfs/ 2421F: fs/hugetlbfs/
2773 2422
2774I2C/SMBUS STUB DRIVER 2423I2C/SMBUS STUB DRIVER
2775P: Mark M. Hoffman 2424M: "Mark M. Hoffman" <mhoffman@lightlink.com>
2776M: mhoffman@lightlink.com
2777L: linux-i2c@vger.kernel.org 2425L: linux-i2c@vger.kernel.org
2778S: Maintained 2426S: Maintained
2779F: drivers/i2c/busses/i2c-stub.c 2427F: drivers/i2c/busses/i2c-stub.c
2780 2428
2781I2C SUBSYSTEM 2429I2C SUBSYSTEM
2782P: Jean Delvare (PC drivers, core) 2430M: "Jean Delvare (PC drivers, core)" <khali@linux-fr.org>
2783M: khali@linux-fr.org 2431M: "Ben Dooks (embedded platforms)" <ben-linux@fluff.org>
2784P: Ben Dooks (embedded platforms)
2785M: ben-linux@fluff.org
2786L: linux-i2c@vger.kernel.org 2432L: linux-i2c@vger.kernel.org
2787W: http://i2c.wiki.kernel.org/ 2433W: http://i2c.wiki.kernel.org/
2788T: quilt kernel.org/pub/linux/kernel/people/jdelvare/linux-2.6/jdelvare-i2c/ 2434T: quilt kernel.org/pub/linux/kernel/people/jdelvare/linux-2.6/jdelvare-i2c/
@@ -2794,28 +2440,25 @@ F: include/linux/i2c-dev.h
2794F: include/linux/i2c-id.h 2440F: include/linux/i2c-id.h
2795 2441
2796I2C-TINY-USB DRIVER 2442I2C-TINY-USB DRIVER
2797P: Till Harbaum 2443M: Till Harbaum <till@harbaum.org>
2798M: till@harbaum.org
2799L: linux-i2c@vger.kernel.org 2444L: linux-i2c@vger.kernel.org
2800W: http://www.harbaum.org/till/i2c_tiny_usb 2445W: http://www.harbaum.org/till/i2c_tiny_usb
2801S: Maintained 2446S: Maintained
2802F: drivers/i2c/busses/i2c-tiny-usb.c 2447F: drivers/i2c/busses/i2c-tiny-usb.c
2803 2448
2804i386 BOOT CODE 2449i386 BOOT CODE
2805P: H. Peter Anvin 2450M: "H. Peter Anvin" <hpa@zytor.com>
2806M: hpa@zytor.com
2807S: Maintained 2451S: Maintained
2808F: arch/x86/boot/ 2452F: arch/x86/boot/
2809 2453
2810i386 SETUP CODE / CPU ERRATA WORKAROUNDS 2454i386 SETUP CODE / CPU ERRATA WORKAROUNDS
2811P: H. Peter Anvin 2455M: "H. Peter Anvin" <hpa@zytor.com>
2812M: hpa@zytor.com
2813T: git git://git.kernel.org/pub/scm/linux/kernel/git/hpa/linux-2.6-x86setup.git 2456T: git git://git.kernel.org/pub/scm/linux/kernel/git/hpa/linux-2.6-x86setup.git
2814S: Maintained 2457S: Maintained
2815 2458
2816IA64 (Itanium) PLATFORM 2459IA64 (Itanium) PLATFORM
2817P: Tony Luck 2460M: Tony Luck <tony.luck@intel.com>
2818M: tony.luck@intel.com 2461M: Fenghua Yu <fenghua.yu@intel.com>
2819L: linux-ia64@vger.kernel.org 2462L: linux-ia64@vger.kernel.org
2820W: http://www.ia64-linux.org/ 2463W: http://www.ia64-linux.org/
2821T: git git://git.kernel.org/pub/scm/linux/kernel/git/aegl/linux-2.6.git 2464T: git git://git.kernel.org/pub/scm/linux/kernel/git/aegl/linux-2.6.git
@@ -2823,29 +2466,25 @@ S: Maintained
2823F: arch/ia64/ 2466F: arch/ia64/
2824 2467
2825IBM MCA SCSI SUBSYSTEM DRIVER 2468IBM MCA SCSI SUBSYSTEM DRIVER
2826P: Michael Lang 2469M: Michael Lang <langa2@kph.uni-mainz.de>
2827M: langa2@kph.uni-mainz.de
2828W: http://www.uni-mainz.de/~langm000/linux.html 2470W: http://www.uni-mainz.de/~langm000/linux.html
2829S: Maintained 2471S: Maintained
2830F: drivers/scsi/ibmmca.c 2472F: drivers/scsi/ibmmca.c
2831 2473
2832IBM Power Linux RAID adapter 2474IBM Power Linux RAID adapter
2833P: Brian King 2475M: Brian King <brking@us.ibm.com>
2834M: brking@us.ibm.com
2835S: Supported 2476S: Supported
2836F: drivers/scsi/ipr.* 2477F: drivers/scsi/ipr.*
2837 2478
2838IBM ServeRAID RAID DRIVER 2479IBM ServeRAID RAID DRIVER
2839P: Jack Hammer 2480P: Jack Hammer
2840P: Dave Jeffery 2481M: Dave Jeffery <ipslinux@adaptec.com>
2841M: ipslinux@adaptec.com
2842W: http://www.developer.ibm.com/welcome/netfinity/serveraid.html 2482W: http://www.developer.ibm.com/welcome/netfinity/serveraid.html
2843S: Supported 2483S: Supported
2844F: drivers/scsi/ips.* 2484F: drivers/scsi/ips.*
2845 2485
2846IDE SUBSYSTEM 2486IDE SUBSYSTEM
2847P: David S. Miller 2487M: "David S. Miller" <davem@davemloft.net>
2848M: davem@davemloft.net
2849L: linux-ide@vger.kernel.org 2488L: linux-ide@vger.kernel.org
2850T: git git://git.kernel.org/pub/scm/linux/kernel/git/davem/ide-2.6.git 2489T: git git://git.kernel.org/pub/scm/linux/kernel/git/davem/ide-2.6.git
2851S: Maintained 2490S: Maintained
@@ -2854,25 +2493,21 @@ F: drivers/ide/
2854F: include/linux/ide.h 2493F: include/linux/ide.h
2855 2494
2856IDE/ATAPI DRIVERS 2495IDE/ATAPI DRIVERS
2857P: Borislav Petkov 2496M: Borislav Petkov <petkovbb@gmail.com>
2858M: petkovbb@gmail.com
2859L: linux-ide@vger.kernel.org 2497L: linux-ide@vger.kernel.org
2860S: Maintained 2498S: Maintained
2861F: Documentation/cdrom/ide-cd 2499F: Documentation/cdrom/ide-cd
2862F: drivers/ide/ide-cd* 2500F: drivers/ide/ide-cd*
2863 2501
2864IDLE-I7300 2502IDLE-I7300
2865P: Andy Henroid 2503M: Andy Henroid <andrew.d.henroid@intel.com>
2866M: andrew.d.henroid@intel.com
2867L: linux-pm@lists.linux-foundation.org 2504L: linux-pm@lists.linux-foundation.org
2868S: Supported 2505S: Supported
2869F: drivers/idle/i7300_idle.c 2506F: drivers/idle/i7300_idle.c
2870 2507
2871IEEE 1394 SUBSYSTEM 2508IEEE 1394 SUBSYSTEM
2872P: Ben Collins 2509M: Ben Collins <ben.collins@ubuntu.com>
2873M: ben.collins@ubuntu.com 2510M: Stefan Richter <stefanr@s5r6.in-berlin.de>
2874P: Stefan Richter
2875M: stefanr@s5r6.in-berlin.de
2876L: linux1394-devel@lists.sourceforge.net 2511L: linux1394-devel@lists.sourceforge.net
2877W: http://www.linux1394.org/ 2512W: http://www.linux1394.org/
2878T: git git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394-2.6.git 2513T: git git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394-2.6.git
@@ -2880,19 +2515,15 @@ S: Maintained
2880F: drivers/ieee1394/ 2515F: drivers/ieee1394/
2881 2516
2882IEEE 1394 RAW I/O DRIVER 2517IEEE 1394 RAW I/O DRIVER
2883P: Dan Dennedy 2518M: Dan Dennedy <dan@dennedy.org>
2884M: dan@dennedy.org 2519M: Stefan Richter <stefanr@s5r6.in-berlin.de>
2885P: Stefan Richter
2886M: stefanr@s5r6.in-berlin.de
2887L: linux1394-devel@lists.sourceforge.net 2520L: linux1394-devel@lists.sourceforge.net
2888S: Maintained 2521S: Maintained
2889F: drivers/ieee1394/raw1394* 2522F: drivers/ieee1394/raw1394*
2890 2523
2891IEEE 802.15.4 SUBSYSTEM 2524IEEE 802.15.4 SUBSYSTEM
2892P: Dmitry Eremin-Solenikov 2525M: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
2893M: dbaryshkov@gmail.com 2526M: Sergey Lapin <slapin@ossfans.org>
2894P: Sergey Lapin
2895M: slapin@ossfans.org
2896L: linux-zigbee-devel@lists.sourceforge.net (moderated for non-subscribers) 2527L: linux-zigbee-devel@lists.sourceforge.net (moderated for non-subscribers)
2897W: http://apps.sourceforge.net/trac/linux-zigbee 2528W: http://apps.sourceforge.net/trac/linux-zigbee
2898T: git git://git.kernel.org/pub/scm/linux/kernel/git/lowpan/lowpan.git 2529T: git git://git.kernel.org/pub/scm/linux/kernel/git/lowpan/lowpan.git
@@ -2901,8 +2532,7 @@ F: net/ieee802154/
2901F: drivers/ieee802154/ 2532F: drivers/ieee802154/
2902 2533
2903INTEGRITY MEASUREMENT ARCHITECTURE (IMA) 2534INTEGRITY MEASUREMENT ARCHITECTURE (IMA)
2904P: Mimi Zohar 2535M: Mimi Zohar <zohar@us.ibm.com>
2905M: zohar@us.ibm.com
2906S: Supported 2536S: Supported
2907F: security/integrity/ima/ 2537F: security/integrity/ima/
2908 2538
@@ -2912,12 +2542,9 @@ S: Orphan
2912F: drivers/video/imsttfb.c 2542F: drivers/video/imsttfb.c
2913 2543
2914INFINIBAND SUBSYSTEM 2544INFINIBAND SUBSYSTEM
2915P: Roland Dreier 2545M: Roland Dreier <rolandd@cisco.com>
2916M: rolandd@cisco.com 2546M: Sean Hefty <sean.hefty@intel.com>
2917P: Sean Hefty 2547M: Hal Rosenstock <hal.rosenstock@gmail.com>
2918M: sean.hefty@intel.com
2919P: Hal Rosenstock
2920M: hal.rosenstock@gmail.com
2921L: general@lists.openfabrics.org (moderated for non-subscribers) 2548L: general@lists.openfabrics.org (moderated for non-subscribers)
2922W: http://www.openib.org/ 2549W: http://www.openib.org/
2923T: git git://git.kernel.org/pub/scm/linux/kernel/git/roland/infiniband.git 2550T: git git://git.kernel.org/pub/scm/linux/kernel/git/roland/infiniband.git
@@ -2927,65 +2554,55 @@ F: drivers/infiniband/
2927F: include/linux/if_infiniband.h 2554F: include/linux/if_infiniband.h
2928 2555
2929INOTIFY 2556INOTIFY
2930P: John McCutchan 2557M: John McCutchan <john@johnmccutchan.com>
2931M: john@johnmccutchan.com 2558M: Robert Love <rlove@rlove.org>
2932P: Robert Love 2559M: Eric Paris <eparis@parisplace.org>
2933M: rlove@rlove.org
2934P: Eric Paris
2935M: eparis@parisplace.org
2936S: Maintained 2560S: Maintained
2937F: Documentation/filesystems/inotify.txt 2561F: Documentation/filesystems/inotify.txt
2938F: fs/notify/inotify/ 2562F: fs/notify/inotify/
2939F: include/linux/inotify.h 2563F: include/linux/inotify.h
2940 2564
2941INPUT (KEYBOARD, MOUSE, JOYSTICK, TOUCHSCREEN) DRIVERS 2565INPUT (KEYBOARD, MOUSE, JOYSTICK, TOUCHSCREEN) DRIVERS
2942P: Dmitry Torokhov 2566M: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2943M: dmitry.torokhov@gmail.com 2567M: Dmitry Torokhov <dtor@mail.ru>
2944M: dtor@mail.ru
2945L: linux-input@vger.kernel.org 2568L: linux-input@vger.kernel.org
2946T: git git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input.git 2569T: git git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input.git
2947S: Maintained 2570S: Maintained
2948F: drivers/input/ 2571F: drivers/input/
2949 2572
2950INTEL FRAMEBUFFER DRIVER (excluding 810 and 815) 2573INTEL FRAMEBUFFER DRIVER (excluding 810 and 815)
2951P: Sylvain Meyer 2574M: Sylvain Meyer <sylvain.meyer@worldonline.fr>
2952M: sylvain.meyer@worldonline.fr
2953L: linux-fbdev-devel@lists.sourceforge.net (moderated for non-subscribers) 2575L: linux-fbdev-devel@lists.sourceforge.net (moderated for non-subscribers)
2954S: Maintained 2576S: Maintained
2955F: Documentation/fb/intelfb.txt 2577F: Documentation/fb/intelfb.txt
2956F: drivers/video/intelfb/ 2578F: drivers/video/intelfb/
2957 2579
2958INTEL 810/815 FRAMEBUFFER DRIVER 2580INTEL 810/815 FRAMEBUFFER DRIVER
2959P: Antonino Daplas 2581M: Antonino Daplas <adaplas@gmail.com>
2960M: adaplas@gmail.com
2961L: linux-fbdev-devel@lists.sourceforge.net (moderated for non-subscribers) 2582L: linux-fbdev-devel@lists.sourceforge.net (moderated for non-subscribers)
2962S: Maintained 2583S: Maintained
2963F: drivers/video/i810/ 2584F: drivers/video/i810/
2964 2585
2965INTEL MENLOW THERMAL DRIVER 2586INTEL MENLOW THERMAL DRIVER
2966P: Sujith Thomas 2587M: Sujith Thomas <sujith.thomas@intel.com>
2967M: sujith.thomas@intel.com
2968L: linux-acpi@vger.kernel.org 2588L: linux-acpi@vger.kernel.org
2969W: http://www.lesswatts.org/projects/acpi/ 2589W: http://www.lesswatts.org/projects/acpi/
2970S: Supported 2590S: Supported
2971F: drivers/platform/x86/intel_menlow.c 2591F: drivers/platform/x86/intel_menlow.c
2972 2592
2973INTEL IA32 MICROCODE UPDATE SUPPORT 2593INTEL IA32 MICROCODE UPDATE SUPPORT
2974P: Tigran Aivazian 2594M: Tigran Aivazian <tigran@aivazian.fsnet.co.uk>
2975M: tigran@aivazian.fsnet.co.uk
2976S: Maintained 2595S: Maintained
2977F: arch/x86/kernel/microcode_core.c 2596F: arch/x86/kernel/microcode_core.c
2978F: arch/x86/kernel/microcode_intel.c 2597F: arch/x86/kernel/microcode_intel.c
2979 2598
2980INTEL I/OAT DMA DRIVER 2599INTEL I/OAT DMA DRIVER
2981P: Maciej Sosnowski 2600M: Maciej Sosnowski <maciej.sosnowski@intel.com>
2982M: maciej.sosnowski@intel.com
2983S: Supported 2601S: Supported
2984F: drivers/dma/ioat* 2602F: drivers/dma/ioat*
2985 2603
2986INTEL IOMMU (VT-d) 2604INTEL IOMMU (VT-d)
2987P: David Woodhouse 2605M: David Woodhouse <dwmw2@infradead.org>
2988M: dwmw2@infradead.org
2989L: iommu@lists.linux-foundation.org 2606L: iommu@lists.linux-foundation.org
2990T: git git://git.infradead.org/iommu-2.6.git 2607T: git git://git.infradead.org/iommu-2.6.git
2991S: Supported 2608S: Supported
@@ -2993,14 +2610,12 @@ F: drivers/pci/intel-iommu.c
2993F: include/linux/intel-iommu.h 2610F: include/linux/intel-iommu.h
2994 2611
2995INTEL IOP-ADMA DMA DRIVER 2612INTEL IOP-ADMA DMA DRIVER
2996P: Dan Williams 2613M: Dan Williams <dan.j.williams@intel.com>
2997M: dan.j.williams@intel.com
2998S: Supported 2614S: Supported
2999F: drivers/dma/iop-adma.c 2615F: drivers/dma/iop-adma.c
3000 2616
3001INTEL IXP4XX QMGR, NPE, ETHERNET and HSS SUPPORT 2617INTEL IXP4XX QMGR, NPE, ETHERNET and HSS SUPPORT
3002P: Krzysztof Halasa 2618M: Krzysztof Halasa <khc@pm.waw.pl>
3003M: khc@pm.waw.pl
3004S: Maintained 2619S: Maintained
3005F: arch/arm/mach-ixp4xx/include/mach/qmgr.h 2620F: arch/arm/mach-ixp4xx/include/mach/qmgr.h
3006F: arch/arm/mach-ixp4xx/include/mach/npe.h 2621F: arch/arm/mach-ixp4xx/include/mach/npe.h
@@ -3010,29 +2625,22 @@ F: drivers/net/arm/ixp4xx_eth.c
3010F: drivers/net/wan/ixp4xx_hss.c 2625F: drivers/net/wan/ixp4xx_hss.c
3011 2626
3012INTEL IXP4XX RANDOM NUMBER GENERATOR SUPPORT 2627INTEL IXP4XX RANDOM NUMBER GENERATOR SUPPORT
3013P: Deepak Saxena 2628M: Deepak Saxena <dsaxena@plexity.net>
3014M: dsaxena@plexity.net
3015S: Maintained 2629S: Maintained
3016F: drivers/char/hw_random/ixp4xx-rng.c 2630F: drivers/char/hw_random/ixp4xx-rng.c
3017 2631
3018INTEL IXP2000 ETHERNET DRIVER 2632INTEL IXP2000 ETHERNET DRIVER
3019P: Lennert Buytenhek 2633M: Lennert Buytenhek <kernel@wantstofly.org>
3020M: kernel@wantstofly.org
3021L: netdev@vger.kernel.org 2634L: netdev@vger.kernel.org
3022S: Maintained 2635S: Maintained
3023F: drivers/net/ixp2000/ 2636F: drivers/net/ixp2000/
3024 2637
3025INTEL ETHERNET DRIVERS (e100/e1000/e1000e/igb/ixgb/ixgbe) 2638INTEL ETHERNET DRIVERS (e100/e1000/e1000e/igb/ixgb/ixgbe)
3026P: Jeff Kirsher 2639M: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
3027M: jeffrey.t.kirsher@intel.com 2640M: Jesse Brandeburg <jesse.brandeburg@intel.com>
3028P: Jesse Brandeburg 2641M: Bruce Allan <bruce.w.allan@intel.com>
3029M: jesse.brandeburg@intel.com 2642M: PJ Waskiewicz <peter.p.waskiewicz.jr@intel.com>
3030P: Bruce Allan 2643M: John Ronciak <john.ronciak@intel.com>
3031M: bruce.w.allan@intel.com
3032P: PJ Waskiewicz
3033M: peter.p.waskiewicz.jr@intel.com
3034P: John Ronciak
3035M: john.ronciak@intel.com
3036L: e1000-devel@lists.sourceforge.net 2644L: e1000-devel@lists.sourceforge.net
3037W: http://e1000.sourceforge.net/ 2645W: http://e1000.sourceforge.net/
3038S: Supported 2646S: Supported
@@ -3044,12 +2652,9 @@ F: drivers/net/ixgb/
3044F: drivers/net/ixgbe/ 2652F: drivers/net/ixgbe/
3045 2653
3046INTEL PRO/WIRELESS 2100 NETWORK CONNECTION SUPPORT 2654INTEL PRO/WIRELESS 2100 NETWORK CONNECTION SUPPORT
3047P: Zhu Yi 2655M: Zhu Yi <yi.zhu@intel.com>
3048M: yi.zhu@intel.com 2656M: James Ketrenos <jketreno@linux.intel.com>
3049P: James Ketrenos 2657M: Reinette Chatre <reinette.chatre@intel.com>
3050M: jketreno@linux.intel.com
3051P: Reinette Chatre
3052M: reinette.chatre@intel.com
3053L: linux-wireless@vger.kernel.org 2658L: linux-wireless@vger.kernel.org
3054L: ipw2100-devel@lists.sourceforge.net 2659L: ipw2100-devel@lists.sourceforge.net
3055W: http://lists.sourceforge.net/mailman/listinfo/ipw2100-devel 2660W: http://lists.sourceforge.net/mailman/listinfo/ipw2100-devel
@@ -3059,12 +2664,9 @@ F: Documentation/networking/README.ipw2100
3059F: drivers/net/wireless/ipw2x00/ipw2100.* 2664F: drivers/net/wireless/ipw2x00/ipw2100.*
3060 2665
3061INTEL PRO/WIRELESS 2915ABG NETWORK CONNECTION SUPPORT 2666INTEL PRO/WIRELESS 2915ABG NETWORK CONNECTION SUPPORT
3062P: Zhu Yi 2667M: Zhu Yi <yi.zhu@intel.com>
3063M: yi.zhu@intel.com 2668M: James Ketrenos <jketreno@linux.intel.com>
3064P: James Ketrenos 2669M: Reinette Chatre <reinette.chatre@intel.com>
3065M: jketreno@linux.intel.com
3066P: Reinette Chatre
3067M: reinette.chatre@intel.com
3068L: linux-wireless@vger.kernel.org 2670L: linux-wireless@vger.kernel.org
3069L: ipw2100-devel@lists.sourceforge.net 2671L: ipw2100-devel@lists.sourceforge.net
3070W: http://lists.sourceforge.net/mailman/listinfo/ipw2100-devel 2672W: http://lists.sourceforge.net/mailman/listinfo/ipw2100-devel
@@ -3074,8 +2676,7 @@ F: Documentation/networking/README.ipw2200
3074F: drivers/net/wireless/ipw2x00/ipw2200.* 2676F: drivers/net/wireless/ipw2x00/ipw2200.*
3075 2677
3076INTEL WIRELESS WIMAX CONNECTION 2400 2678INTEL WIRELESS WIMAX CONNECTION 2400
3077P: Inaky Perez-Gonzalez 2679M: Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>
3078M: inaky.perez-gonzalez@intel.com
3079M: linux-wimax@intel.com 2680M: linux-wimax@intel.com
3080L: wimax@linuxwimax.org 2681L: wimax@linuxwimax.org
3081S: Supported 2682S: Supported
@@ -3085,10 +2686,8 @@ F: drivers/net/wimax/i2400m/
3085F: include/linux/wimax/i2400m.h 2686F: include/linux/wimax/i2400m.h
3086 2687
3087INTEL WIRELESS WIFI LINK (iwlwifi) 2688INTEL WIRELESS WIFI LINK (iwlwifi)
3088P: Zhu Yi 2689M: Zhu Yi <yi.zhu@intel.com>
3089M: yi.zhu@intel.com 2690M: Reinette Chatre <reinette.chatre@intel.com>
3090P: Reinette Chatre
3091M: reinette.chatre@intel.com
3092L: linux-wireless@vger.kernel.org 2691L: linux-wireless@vger.kernel.org
3093L: ipw3945-devel@lists.sourceforge.net 2692L: ipw3945-devel@lists.sourceforge.net
3094W: http://intellinuxwireless.org 2693W: http://intellinuxwireless.org
@@ -3097,47 +2696,39 @@ S: Supported
3097F: drivers/net/wireless/iwlwifi/ 2696F: drivers/net/wireless/iwlwifi/
3098 2697
3099IOC3 ETHERNET DRIVER 2698IOC3 ETHERNET DRIVER
3100P: Ralf Baechle 2699M: Ralf Baechle <ralf@linux-mips.org>
3101M: ralf@linux-mips.org
3102L: linux-mips@linux-mips.org 2700L: linux-mips@linux-mips.org
3103S: Maintained 2701S: Maintained
3104F: drivers/net/ioc3-eth.c 2702F: drivers/net/ioc3-eth.c
3105 2703
3106IOC3 SERIAL DRIVER 2704IOC3 SERIAL DRIVER
3107P: Pat Gefre 2705M: Pat Gefre <pfg@sgi.com>
3108M: pfg@sgi.com
3109L: linux-mips@linux-mips.org 2706L: linux-mips@linux-mips.org
3110S: Maintained 2707S: Maintained
3111F: drivers/serial/ioc3_serial.c 2708F: drivers/serial/ioc3_serial.c
3112 2709
3113IP MASQUERADING 2710IP MASQUERADING
3114P: Juanjo Ciarlante 2711M: Juanjo Ciarlante <jjciarla@raiz.uncu.edu.ar>
3115M: jjciarla@raiz.uncu.edu.ar
3116S: Maintained 2712S: Maintained
3117F: net/ipv4/netfilter/ipt_MASQUERADE.c 2713F: net/ipv4/netfilter/ipt_MASQUERADE.c
3118 2714
3119IP1000A 10/100/1000 GIGABIT ETHERNET DRIVER 2715IP1000A 10/100/1000 GIGABIT ETHERNET DRIVER
3120P: Francois Romieu 2716M: Francois Romieu <romieu@fr.zoreil.com>
3121M: romieu@fr.zoreil.com 2717M: Sorbica Shieh <sorbica@icplus.com.tw>
3122P: Sorbica Shieh 2718M: Jesse Huang <jesse@icplus.com.tw>
3123M: sorbica@icplus.com.tw
3124P: Jesse Huang
3125M: jesse@icplus.com.tw
3126L: netdev@vger.kernel.org 2719L: netdev@vger.kernel.org
3127S: Maintained 2720S: Maintained
3128F: drivers/net/ipg.c 2721F: drivers/net/ipg.c
3129 2722
3130IPATH DRIVER 2723IPATH DRIVER
3131P: Ralph Campbell 2724M: Ralph Campbell <infinipath@qlogic.com>
3132M: infinipath@qlogic.com
3133L: general@lists.openfabrics.org 2725L: general@lists.openfabrics.org
3134T: git git://git.qlogic.com/ipath-linux-2.6 2726T: git git://git.qlogic.com/ipath-linux-2.6
3135S: Supported 2727S: Supported
3136F: drivers/infiniband/hw/ipath/ 2728F: drivers/infiniband/hw/ipath/
3137 2729
3138IPMI SUBSYSTEM 2730IPMI SUBSYSTEM
3139P: Corey Minyard 2731M: Corey Minyard <minyard@acm.org>
3140M: minyard@acm.org
3141L: openipmi-developer@lists.sourceforge.net 2732L: openipmi-developer@lists.sourceforge.net
3142W: http://openipmi.sourceforge.net/ 2733W: http://openipmi.sourceforge.net/
3143S: Supported 2734S: Supported
@@ -3146,20 +2737,16 @@ F: drivers/char/ipmi/
3146F: include/linux/ipmi* 2737F: include/linux/ipmi*
3147 2738
3148IPS SCSI RAID DRIVER 2739IPS SCSI RAID DRIVER
3149P: Adaptec OEM Raid Solutions 2740M: Adaptec OEM Raid Solutions <aacraid@adaptec.com>
3150M: aacraid@adaptec.com
3151L: linux-scsi@vger.kernel.org 2741L: linux-scsi@vger.kernel.org
3152W: http://www.adaptec.com/ 2742W: http://www.adaptec.com/
3153S: Maintained 2743S: Maintained
3154F: drivers/scsi/ips* 2744F: drivers/scsi/ips*
3155 2745
3156IPVS 2746IPVS
3157P: Wensong Zhang 2747M: Wensong Zhang <wensong@linux-vs.org>
3158M: wensong@linux-vs.org 2748M: Simon Horman <horms@verge.net.au>
3159P: Simon Horman 2749M: Julian Anastasov <ja@ssi.bg>
3160M: horms@verge.net.au
3161P: Julian Anastasov
3162M: ja@ssi.bg
3163L: netdev@vger.kernel.org 2750L: netdev@vger.kernel.org
3164L: lvs-devel@vger.kernel.org 2751L: lvs-devel@vger.kernel.org
3165S: Maintained 2752S: Maintained
@@ -3167,17 +2754,14 @@ F: Documentation/networking/ipvs-sysctl.txt
3167F: net/netfilter/ipvs/ 2754F: net/netfilter/ipvs/
3168 2755
3169IPWIRELESS DRIVER 2756IPWIRELESS DRIVER
3170P: Jiri Kosina 2757M: Jiri Kosina <jkosina@suse.cz>
3171M: jkosina@suse.cz 2758M: David Sterba <dsterba@suse.cz>
3172P: David Sterba
3173M: dsterba@suse.cz
3174S: Maintained 2759S: Maintained
3175T: git git://git.kernel.org/pub/scm/linux/kernel/git/jikos/ipwireless_cs.git 2760T: git git://git.kernel.org/pub/scm/linux/kernel/git/jikos/ipwireless_cs.git
3176F: drivers/char/pcmcia/ipwireless/ 2761F: drivers/char/pcmcia/ipwireless/
3177 2762
3178IPX NETWORK LAYER 2763IPX NETWORK LAYER
3179P: Arnaldo Carvalho de Melo 2764M: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
3180M: acme@ghostprotocols.net
3181L: netdev@vger.kernel.org 2765L: netdev@vger.kernel.org
3182S: Maintained 2766S: Maintained
3183F: include/linux/ipx.h 2767F: include/linux/ipx.h
@@ -3185,8 +2769,7 @@ F: include/net/ipx.h
3185F: net/ipx/ 2769F: net/ipx/
3186 2770
3187IRDA SUBSYSTEM 2771IRDA SUBSYSTEM
3188P: Samuel Ortiz 2772M: Samuel Ortiz <samuel@sortiz.org>
3189M: samuel@sortiz.org
3190L: irda-users@lists.sourceforge.net (subscribers-only) 2773L: irda-users@lists.sourceforge.net (subscribers-only)
3191W: http://irda.sourceforge.net/ 2774W: http://irda.sourceforge.net/
3192S: Maintained 2775S: Maintained
@@ -3197,16 +2780,14 @@ F: include/net/irda/
3197F: net/irda/ 2780F: net/irda/
3198 2781
3199ISAPNP 2782ISAPNP
3200P: Jaroslav Kysela 2783M: Jaroslav Kysela <perex@perex.cz>
3201M: perex@perex.cz
3202S: Maintained 2784S: Maintained
3203F: Documentation/isapnp.txt 2785F: Documentation/isapnp.txt
3204F: drivers/pnp/isapnp/ 2786F: drivers/pnp/isapnp/
3205F: include/linux/isapnp.h 2787F: include/linux/isapnp.h
3206 2788
3207ISCSI 2789ISCSI
3208P: Mike Christie 2790M: Mike Christie <michaelc@cs.wisc.edu>
3209M: michaelc@cs.wisc.edu
3210L: open-iscsi@googlegroups.com 2791L: open-iscsi@googlegroups.com
3211W: www.open-iscsi.org 2792W: www.open-iscsi.org
3212T: git git://git.kernel.org/pub/scm/linux/kernel/git/mnc/linux-2.6-iscsi.git 2793T: git git://git.kernel.org/pub/scm/linux/kernel/git/mnc/linux-2.6-iscsi.git
@@ -3215,8 +2796,7 @@ F: drivers/scsi/*iscsi*
3215F: include/scsi/*iscsi* 2796F: include/scsi/*iscsi*
3216 2797
3217ISDN SUBSYSTEM 2798ISDN SUBSYSTEM
3218P: Karsten Keil 2799M: Karsten Keil <isdn@linux-pingi.de>
3219M: isdn@linux-pingi.de
3220L: isdn4linux@listserv.isdn4linux.de (subscribers-only) 2800L: isdn4linux@listserv.isdn4linux.de (subscribers-only)
3221W: http://www.isdn4linux.de 2801W: http://www.isdn4linux.de
3222T: git git://git.kernel.org/pub/scm/linux/kernel/git/kkeil/isdn-2.6.git 2802T: git git://git.kernel.org/pub/scm/linux/kernel/git/kkeil/isdn-2.6.git
@@ -3227,18 +2807,15 @@ F: include/linux/isdn.h
3227F: include/linux/isdn/ 2807F: include/linux/isdn/
3228 2808
3229ISDN SUBSYSTEM (Eicon active card driver) 2809ISDN SUBSYSTEM (Eicon active card driver)
3230P: Armin Schindler 2810M: Armin Schindler <mac@melware.de>
3231M: mac@melware.de
3232L: isdn4linux@listserv.isdn4linux.de (subscribers-only) 2811L: isdn4linux@listserv.isdn4linux.de (subscribers-only)
3233W: http://www.melware.de 2812W: http://www.melware.de
3234S: Maintained 2813S: Maintained
3235F: drivers/isdn/hardware/eicon/ 2814F: drivers/isdn/hardware/eicon/
3236 2815
3237IVTV VIDEO4LINUX DRIVER 2816IVTV VIDEO4LINUX DRIVER
3238P: Hans Verkuil 2817M: Hans Verkuil <hverkuil@xs4all.nl>
3239M: hverkuil@xs4all.nl
3240L: ivtv-devel@ivtvdriver.org 2818L: ivtv-devel@ivtvdriver.org
3241L: ivtv-users@ivtvdriver.org
3242L: linux-media@vger.kernel.org 2819L: linux-media@vger.kernel.org
3243T: git git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6.git 2820T: git git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6.git
3244W: http://www.ivtvdriver.org 2821W: http://www.ivtvdriver.org
@@ -3248,25 +2825,22 @@ F: drivers/media/video/ivtv/
3248F: include/linux/ivtv* 2825F: include/linux/ivtv*
3249 2826
3250JFS FILESYSTEM 2827JFS FILESYSTEM
3251P: Dave Kleikamp 2828M: Dave Kleikamp <shaggy@linux.vnet.ibm.com>
3252M: shaggy@austin.ibm.com
3253L: jfs-discussion@lists.sourceforge.net 2829L: jfs-discussion@lists.sourceforge.net
3254W: http://jfs.sourceforge.net/ 2830W: http://jfs.sourceforge.net/
3255T: git git://git.kernel.org/pub/scm/linux/kernel/git/shaggy/jfs-2.6.git 2831T: git git://git.kernel.org/pub/scm/linux/kernel/git/shaggy/jfs-2.6.git
3256S: Supported 2832S: Maintained
3257F: Documentation/filesystems/jfs.txt 2833F: Documentation/filesystems/jfs.txt
3258F: fs/jfs/ 2834F: fs/jfs/
3259 2835
3260JME NETWORK DRIVER 2836JME NETWORK DRIVER
3261P: Guo-Fu Tseng 2837M: Guo-Fu Tseng <cooldavid@cooldavid.org>
3262M: cooldavid@cooldavid.org
3263L: netdev@vger.kernel.org 2838L: netdev@vger.kernel.org
3264S: Maintained 2839S: Maintained
3265F: drivers/net/jme.* 2840F: drivers/net/jme.*
3266 2841
3267JOURNALLING FLASH FILE SYSTEM V2 (JFFS2) 2842JOURNALLING FLASH FILE SYSTEM V2 (JFFS2)
3268P: David Woodhouse 2843M: David Woodhouse <dwmw2@infradead.org>
3269M: dwmw2@infradead.org
3270L: linux-mtd@lists.infradead.org 2844L: linux-mtd@lists.infradead.org
3271W: http://www.linux-mtd.infradead.org/doc/jffs2.html 2845W: http://www.linux-mtd.infradead.org/doc/jffs2.html
3272S: Maintained 2846S: Maintained
@@ -3274,10 +2848,8 @@ F: fs/jffs2/
3274F: include/linux/jffs2.h 2848F: include/linux/jffs2.h
3275 2849
3276JOURNALLING LAYER FOR BLOCK DEVICES (JBD) 2850JOURNALLING LAYER FOR BLOCK DEVICES (JBD)
3277P: Stephen Tweedie 2851M: Stephen Tweedie <sct@redhat.com>
3278M: sct@redhat.com 2852M: Andrew Morton <akpm@linux-foundation.org>
3279P: Andrew Morton
3280M: akpm@linux-foundation.org
3281L: linux-ext4@vger.kernel.org 2853L: linux-ext4@vger.kernel.org
3282S: Maintained 2854S: Maintained
3283F: fs/jbd*/ 2855F: fs/jbd*/
@@ -3285,48 +2857,41 @@ F: include/linux/ext*jbd*.h
3285F: include/linux/jbd*.h 2857F: include/linux/jbd*.h
3286 2858
3287K8TEMP HARDWARE MONITORING DRIVER 2859K8TEMP HARDWARE MONITORING DRIVER
3288P: Rudolf Marek 2860M: Rudolf Marek <r.marek@assembler.cz>
3289M: r.marek@assembler.cz
3290L: lm-sensors@lm-sensors.org 2861L: lm-sensors@lm-sensors.org
3291S: Maintained 2862S: Maintained
3292F: Documentation/hwmon/k8temp 2863F: Documentation/hwmon/k8temp
3293F: drivers/hwmon/k8temp.c 2864F: drivers/hwmon/k8temp.c
3294 2865
3295KCONFIG 2866KCONFIG
3296P: Roman Zippel 2867M: Roman Zippel <zippel@linux-m68k.org>
3297M: zippel@linux-m68k.org
3298L: linux-kbuild@vger.kernel.org 2868L: linux-kbuild@vger.kernel.org
3299S: Maintained 2869S: Maintained
3300F: Documentation/kbuild/kconfig-language.txt 2870F: Documentation/kbuild/kconfig-language.txt
3301F: scripts/kconfig/ 2871F: scripts/kconfig/
3302 2872
3303KDUMP 2873KDUMP
3304P: Vivek Goyal 2874M: Vivek Goyal <vgoyal@redhat.com>
3305M: vgoyal@redhat.com 2875M: Haren Myneni <hbabu@us.ibm.com>
3306P: Haren Myneni
3307M: hbabu@us.ibm.com
3308L: kexec@lists.infradead.org 2876L: kexec@lists.infradead.org
3309W: http://lse.sourceforge.net/kdump/ 2877W: http://lse.sourceforge.net/kdump/
3310S: Maintained 2878S: Maintained
3311F: Documentation/kdump/ 2879F: Documentation/kdump/
3312 2880
3313KERNEL AUTOMOUNTER (AUTOFS) 2881KERNEL AUTOMOUNTER (AUTOFS)
3314P: H. Peter Anvin 2882M: "H. Peter Anvin" <hpa@zytor.com>
3315M: hpa@zytor.com
3316L: autofs@linux.kernel.org 2883L: autofs@linux.kernel.org
3317S: Odd Fixes 2884S: Odd Fixes
3318F: fs/autofs/ 2885F: fs/autofs/
3319 2886
3320KERNEL AUTOMOUNTER v4 (AUTOFS4) 2887KERNEL AUTOMOUNTER v4 (AUTOFS4)
3321P: Ian Kent 2888M: Ian Kent <raven@themaw.net>
3322M: raven@themaw.net
3323L: autofs@linux.kernel.org 2889L: autofs@linux.kernel.org
3324S: Maintained 2890S: Maintained
3325F: fs/autofs4/ 2891F: fs/autofs4/
3326 2892
3327KERNEL BUILD 2893KERNEL BUILD
3328P: Sam Ravnborg 2894M: Sam Ravnborg <sam@ravnborg.org>
3329M: sam@ravnborg.org
3330T: git git://git.kernel.org/pub/scm/linux/kernel/git/sam/kbuild-next.git 2895T: git git://git.kernel.org/pub/scm/linux/kernel/git/sam/kbuild-next.git
3331T: git git://git.kernel.org/pub/scm/linux/kernel/git/sam/kbuild-fixes.git 2896T: git git://git.kernel.org/pub/scm/linux/kernel/git/sam/kbuild-fixes.git
3332L: linux-kbuild@vger.kernel.org 2897L: linux-kbuild@vger.kernel.org
@@ -3336,16 +2901,13 @@ F: Makefile
3336F: scripts/Makefile.* 2901F: scripts/Makefile.*
3337 2902
3338KERNEL JANITORS 2903KERNEL JANITORS
3339P: Several
3340L: kernel-janitors@vger.kernel.org 2904L: kernel-janitors@vger.kernel.org
3341W: http://www.kerneljanitors.org/ 2905W: http://www.kerneljanitors.org/
3342S: Maintained 2906S: Odd fixes
3343 2907
3344KERNEL NFSD, SUNRPC, AND LOCKD SERVERS 2908KERNEL NFSD, SUNRPC, AND LOCKD SERVERS
3345P: J. Bruce Fields 2909M: "J. Bruce Fields" <bfields@fieldses.org>
3346M: bfields@fieldses.org 2910M: Neil Brown <neilb@suse.de>
3347P: Neil Brown
3348M: neilb@suse.de
3349L: linux-nfs@vger.kernel.org 2911L: linux-nfs@vger.kernel.org
3350W: http://nfs.sourceforge.net/ 2912W: http://nfs.sourceforge.net/
3351S: Supported 2913S: Supported
@@ -3358,8 +2920,7 @@ F: include/linux/lockd/
3358F: include/linux/sunrpc/ 2920F: include/linux/sunrpc/
3359 2921
3360KERNEL VIRTUAL MACHINE (KVM) 2922KERNEL VIRTUAL MACHINE (KVM)
3361P: Avi Kivity 2923M: Avi Kivity <avi@redhat.com>
3362M: avi@redhat.com
3363L: kvm@vger.kernel.org 2924L: kvm@vger.kernel.org
3364W: http://kvm.qumranet.com 2925W: http://kvm.qumranet.com
3365S: Supported 2926S: Supported
@@ -3370,8 +2931,7 @@ F: include/linux/kvm*
3370F: virt/kvm/ 2931F: virt/kvm/
3371 2932
3372KERNEL VIRTUAL MACHINE (KVM) FOR AMD-V 2933KERNEL VIRTUAL MACHINE (KVM) FOR AMD-V
3373P: Joerg Roedel 2934M: Joerg Roedel <joerg.roedel@amd.com>
3374M: joerg.roedel@amd.com
3375L: kvm@vger.kernel.org 2935L: kvm@vger.kernel.org
3376W: http://kvm.qumranet.com 2936W: http://kvm.qumranet.com
3377S: Supported 2937S: Supported
@@ -3380,8 +2940,7 @@ F: arch/x86/kvm/kvm_svm.h
3380F: arch/x86/kvm/svm.c 2940F: arch/x86/kvm/svm.c
3381 2941
3382KERNEL VIRTUAL MACHINE (KVM) FOR POWERPC 2942KERNEL VIRTUAL MACHINE (KVM) FOR POWERPC
3383P: Hollis Blanchard 2943M: Hollis Blanchard <hollisb@us.ibm.com>
3384M: hollisb@us.ibm.com
3385L: kvm-ppc@vger.kernel.org 2944L: kvm-ppc@vger.kernel.org
3386W: http://kvm.qumranet.com 2945W: http://kvm.qumranet.com
3387S: Supported 2946S: Supported
@@ -3389,8 +2948,7 @@ F: arch/powerpc/include/asm/kvm*
3389F: arch/powerpc/kvm/ 2948F: arch/powerpc/kvm/
3390 2949
3391KERNEL VIRTUAL MACHINE For Itanium (KVM/IA64) 2950KERNEL VIRTUAL MACHINE For Itanium (KVM/IA64)
3392P: Xiantao Zhang 2951M: Xiantao Zhang <xiantao.zhang@intel.com>
3393M: xiantao.zhang@intel.com
3394L: kvm-ia64@vger.kernel.org 2952L: kvm-ia64@vger.kernel.org
3395W: http://kvm.qumranet.com 2953W: http://kvm.qumranet.com
3396S: Supported 2954S: Supported
@@ -3399,10 +2957,8 @@ F: arch/ia64/include/asm/kvm*
3399F: arch/ia64/kvm/ 2957F: arch/ia64/kvm/
3400 2958
3401KERNEL VIRTUAL MACHINE for s390 (KVM/s390) 2959KERNEL VIRTUAL MACHINE for s390 (KVM/s390)
3402P: Carsten Otte 2960M: Carsten Otte <cotte@de.ibm.com>
3403M: cotte@de.ibm.com 2961M: Christian Borntraeger <borntraeger@de.ibm.com>
3404P: Christian Borntraeger
3405M: borntraeger@de.ibm.com
3406M: linux390@de.ibm.com 2962M: linux390@de.ibm.com
3407L: linux-s390@vger.kernel.org 2963L: linux-s390@vger.kernel.org
3408W: http://www.ibm.com/developerworks/linux/linux390/ 2964W: http://www.ibm.com/developerworks/linux/linux390/
@@ -3412,8 +2968,7 @@ F: arch/s390/include/asm/kvm*
3412F: arch/s390/kvm/ 2968F: arch/s390/kvm/
3413 2969
3414KEXEC 2970KEXEC
3415P: Eric Biederman 2971M: Eric Biederman <ebiederm@xmission.com>
3416M: ebiederm@xmission.com
3417W: http://ftp.kernel.org/pub/linux/kernel/people/horms/kexec-tools/ 2972W: http://ftp.kernel.org/pub/linux/kernel/people/horms/kexec-tools/
3418L: kexec@lists.infradead.org 2973L: kexec@lists.infradead.org
3419S: Maintained 2974S: Maintained
@@ -3421,8 +2976,7 @@ F: include/linux/kexec.h
3421F: kernel/kexec.c 2976F: kernel/kexec.c
3422 2977
3423KGDB 2978KGDB
3424P: Jason Wessel 2979M: Jason Wessel <jason.wessel@windriver.com>
3425M: jason.wessel@windriver.com
3426L: kgdb-bugreport@lists.sourceforge.net 2980L: kgdb-bugreport@lists.sourceforge.net
3427S: Maintained 2981S: Maintained
3428F: Documentation/DocBook/kgdb.tmpl 2982F: Documentation/DocBook/kgdb.tmpl
@@ -3432,17 +2986,13 @@ F: include/linux/kgdb.h
3432F: kernel/kgdb.c 2986F: kernel/kgdb.c
3433 2987
3434KMEMCHECK 2988KMEMCHECK
3435P: Vegard Nossum 2989M: Vegard Nossum <vegardno@ifi.uio.no>
3436M: vegardno@ifi.uio.no
3437P Pekka Enberg 2990P Pekka Enberg
3438M: penberg@cs.helsinki.fi 2991M: penberg@cs.helsinki.fi
3439L: linux-kernel@vger.kernel.org
3440S: Maintained 2992S: Maintained
3441 2993
3442KMEMLEAK 2994KMEMLEAK
3443P: Catalin Marinas 2995M: Catalin Marinas <catalin.marinas@arm.com>
3444M: catalin.marinas@arm.com
3445L: linux-kernel@vger.kernel.org
3446S: Maintained 2996S: Maintained
3447F: Documentation/kmemleak.txt 2997F: Documentation/kmemleak.txt
3448F: include/linux/kmemleak.h 2998F: include/linux/kmemleak.h
@@ -3450,30 +3000,24 @@ F: mm/kmemleak.c
3450F: mm/kmemleak-test.c 3000F: mm/kmemleak-test.c
3451 3001
3452KMEMTRACE 3002KMEMTRACE
3453P: Eduard - Gabriel Munteanu 3003M: Eduard - Gabriel Munteanu <eduard.munteanu@linux360.ro>
3454M: eduard.munteanu@linux360.ro
3455S: Maintained 3004S: Maintained
3456F: Documentation/trace/kmemtrace.txt 3005F: Documentation/trace/kmemtrace.txt
3457F: include/linux/kmemtrace.h 3006F: include/linux/kmemtrace.h
3458F: kernel/trace/kmemtrace.c 3007F: kernel/trace/kmemtrace.c
3459 3008
3460KPROBES 3009KPROBES
3461P: Ananth N Mavinakayanahalli 3010M: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
3462M: ananth@in.ibm.com 3011M: Anil S Keshavamurthy <anil.s.keshavamurthy@intel.com>
3463P: Anil S Keshavamurthy 3012M: "David S. Miller" <davem@davemloft.net>
3464M: anil.s.keshavamurthy@intel.com 3013M: Masami Hiramatsu <mhiramat@redhat.com>
3465P: David S. Miller
3466M: davem@davemloft.net
3467P: Masami Hiramatsu
3468M: mhiramat@redhat.com
3469S: Maintained 3014S: Maintained
3470F: Documentation/kprobes.txt 3015F: Documentation/kprobes.txt
3471F: include/linux/kprobes.h 3016F: include/linux/kprobes.h
3472F: kernel/kprobes.c 3017F: kernel/kprobes.c
3473 3018
3474KS0108 LCD CONTROLLER DRIVER 3019KS0108 LCD CONTROLLER DRIVER
3475P: Miguel Ojeda Sandonis 3020M: Miguel Ojeda Sandonis <miguel.ojeda.sandonis@gmail.com>
3476M: miguel.ojeda.sandonis@gmail.com
3477W: http://miguelojeda.es/auxdisplay.htm 3021W: http://miguelojeda.es/auxdisplay.htm
3478W: http://jair.lab.fi.uva.es/~migojed/auxdisplay.htm 3022W: http://jair.lab.fi.uva.es/~migojed/auxdisplay.htm
3479S: Maintained 3023S: Maintained
@@ -3489,31 +3033,27 @@ F: include/*/lapb.h
3489F: net/lapb/ 3033F: net/lapb/
3490 3034
3491LASI 53c700 driver for PARISC 3035LASI 53c700 driver for PARISC
3492P: James E.J. Bottomley 3036M: "James E.J. Bottomley" <James.Bottomley@HansenPartnership.com>
3493M: James.Bottomley@HansenPartnership.com
3494L: linux-scsi@vger.kernel.org 3037L: linux-scsi@vger.kernel.org
3495S: Maintained 3038S: Maintained
3496F: Documentation/scsi/53c700.txt 3039F: Documentation/scsi/53c700.txt
3497F: drivers/scsi/53c700* 3040F: drivers/scsi/53c700*
3498 3041
3499LED SUBSYSTEM 3042LED SUBSYSTEM
3500P: Richard Purdie 3043M: Richard Purdie <rpurdie@rpsys.net>
3501M: rpurdie@rpsys.net
3502S: Maintained 3044S: Maintained
3503F: drivers/leds/ 3045F: drivers/leds/
3504F: include/linux/leds.h 3046F: include/linux/leds.h
3505 3047
3506LEGO USB Tower driver 3048LEGO USB Tower driver
3507P: Juergen Stuber 3049M: Juergen Stuber <starblue@users.sourceforge.net>
3508M: starblue@users.sourceforge.net
3509L: legousb-devel@lists.sourceforge.net 3050L: legousb-devel@lists.sourceforge.net
3510W: http://legousb.sourceforge.net/ 3051W: http://legousb.sourceforge.net/
3511S: Maintained 3052S: Maintained
3512F: drivers/usb/misc/legousbtower.c 3053F: drivers/usb/misc/legousbtower.c
3513 3054
3514LGUEST 3055LGUEST
3515P: Rusty Russell 3056M: Rusty Russell <rusty@rustcorp.com.au>
3516M: rusty@rustcorp.com.au
3517L: lguest@ozlabs.org 3057L: lguest@ozlabs.org
3518W: http://lguest.ozlabs.org/ 3058W: http://lguest.ozlabs.org/
3519S: Maintained 3059S: Maintained
@@ -3524,119 +3064,100 @@ F: include/linux/lguest*.h
3524F: arch/x86/include/asm/lguest*.h 3064F: arch/x86/include/asm/lguest*.h
3525 3065
3526LINUX FOR IBM pSERIES (RS/6000) 3066LINUX FOR IBM pSERIES (RS/6000)
3527P: Paul Mackerras 3067M: Paul Mackerras <paulus@au.ibm.com>
3528M: paulus@au.ibm.com
3529W: http://www.ibm.com/linux/ltc/projects/ppc 3068W: http://www.ibm.com/linux/ltc/projects/ppc
3530S: Supported 3069S: Supported
3531 3070
3532LINUX FOR POWERPC (32-BIT AND 64-BIT) 3071LINUX FOR POWERPC (32-BIT AND 64-BIT)
3533P: Benjamin Herrenschmidt 3072M: Benjamin Herrenschmidt <benh@kernel.crashing.org>
3534M: benh@kernel.crashing.org 3073M: Paul Mackerras <paulus@samba.org>
3535P: Paul Mackerras
3536M: paulus@samba.org
3537W: http://www.penguinppc.org/ 3074W: http://www.penguinppc.org/
3538L: linuxppc-dev@ozlabs.org 3075L: linuxppc-dev@ozlabs.org
3539T: git git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc.git 3076T: git git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc.git
3540S: Supported 3077S: Supported
3541 3078
3542LINUX FOR POWER MACINTOSH 3079LINUX FOR POWER MACINTOSH
3543P: Benjamin Herrenschmidt 3080M: Benjamin Herrenschmidt <benh@kernel.crashing.org>
3544M: benh@kernel.crashing.org
3545W: http://www.penguinppc.org/ 3081W: http://www.penguinppc.org/
3546L: linuxppc-dev@ozlabs.org 3082L: linuxppc-dev@ozlabs.org
3547S: Maintained 3083S: Maintained
3548 3084
3549LINUX FOR POWERPC EMBEDDED MPC5XXX 3085LINUX FOR POWERPC EMBEDDED MPC5XXX
3550P: Grant Likely 3086M: Grant Likely <grant.likely@secretlab.ca>
3551M: grant.likely@secretlab.ca
3552L: linuxppc-dev@ozlabs.org 3087L: linuxppc-dev@ozlabs.org
3553T: git git://git.secretlab.ca/git/linux-2.6.git 3088T: git git://git.secretlab.ca/git/linux-2.6.git
3554S: Maintained 3089S: Maintained
3555 3090
3556LINUX FOR POWERPC EMBEDDED PPC4XX 3091LINUX FOR POWERPC EMBEDDED PPC4XX
3557P: Josh Boyer 3092M: Josh Boyer <jwboyer@linux.vnet.ibm.com>
3558M: jwboyer@linux.vnet.ibm.com 3093M: Matt Porter <mporter@kernel.crashing.org>
3559P: Matt Porter
3560M: mporter@kernel.crashing.org
3561W: http://www.penguinppc.org/ 3094W: http://www.penguinppc.org/
3562L: linuxppc-dev@ozlabs.org 3095L: linuxppc-dev@ozlabs.org
3563T: git git://git.kernel.org/pub/scm/linux/kernel/git/jwboyer/powerpc-4xx.git 3096T: git git://git.kernel.org/pub/scm/linux/kernel/git/jwboyer/powerpc-4xx.git
3564S: Maintained 3097S: Maintained
3565 3098
3566LINUX FOR POWERPC EMBEDDED XILINX VIRTEX 3099LINUX FOR POWERPC EMBEDDED XILINX VIRTEX
3567P: Grant Likely 3100M: Grant Likely <grant.likely@secretlab.ca>
3568M: grant.likely@secretlab.ca
3569W: http://wiki.secretlab.ca/index.php/Linux_on_Xilinx_Virtex 3101W: http://wiki.secretlab.ca/index.php/Linux_on_Xilinx_Virtex
3570L: linuxppc-dev@ozlabs.org 3102L: linuxppc-dev@ozlabs.org
3571T: git git://git.secretlab.ca/git/linux-2.6.git 3103T: git git://git.secretlab.ca/git/linux-2.6.git
3572S: Maintained 3104S: Maintained
3573 3105
3574LINUX FOR POWERPC EMBEDDED PPC8XX 3106LINUX FOR POWERPC EMBEDDED PPC8XX
3575P: Vitaly Bordug 3107M: Vitaly Bordug <vitb@kernel.crashing.org>
3576M: vitb@kernel.crashing.org 3108M: Marcelo Tosatti <marcelo@kvack.org>
3577P: Marcelo Tosatti
3578M: marcelo@kvack.org
3579W: http://www.penguinppc.org/ 3109W: http://www.penguinppc.org/
3580L: linuxppc-dev@ozlabs.org 3110L: linuxppc-dev@ozlabs.org
3581S: Maintained 3111S: Maintained
3582 3112
3583LINUX FOR POWERPC EMBEDDED PPC83XX AND PPC85XX 3113LINUX FOR POWERPC EMBEDDED PPC83XX AND PPC85XX
3584P: Kumar Gala 3114M: Kumar Gala <galak@kernel.crashing.org>
3585M: galak@kernel.crashing.org
3586W: http://www.penguinppc.org/ 3115W: http://www.penguinppc.org/
3587L: linuxppc-dev@ozlabs.org 3116L: linuxppc-dev@ozlabs.org
3588S: Maintained 3117S: Maintained
3589 3118
3590LINUX FOR POWERPC PA SEMI PWRFICIENT 3119LINUX FOR POWERPC PA SEMI PWRFICIENT
3591P: Olof Johansson 3120M: Olof Johansson <olof@lixom.net>
3592M: olof@lixom.net
3593W: http://www.pasemi.com/ 3121W: http://www.pasemi.com/
3594L: linuxppc-dev@ozlabs.org 3122L: linuxppc-dev@ozlabs.org
3595S: Supported 3123S: Supported
3596 3124
3597LINUX SECURITY MODULE (LSM) FRAMEWORK 3125LINUX SECURITY MODULE (LSM) FRAMEWORK
3598P: Chris Wright 3126M: Chris Wright <chrisw@sous-sol.org>
3599M: chrisw@sous-sol.org
3600L: linux-security-module@vger.kernel.org 3127L: linux-security-module@vger.kernel.org
3601T: git git://git.kernel.org/pub/scm/linux/kernel/git/chrisw/lsm-2.6.git 3128T: git git://git.kernel.org/pub/scm/linux/kernel/git/chrisw/lsm-2.6.git
3602S: Supported 3129S: Supported
3603 3130
3604LLC (802.2) 3131LLC (802.2)
3605P: Arnaldo Carvalho de Melo 3132M: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
3606M: acme@ghostprotocols.net
3607S: Maintained 3133S: Maintained
3608F: include/linux/llc.h 3134F: include/linux/llc.h
3609F: include/net/llc* 3135F: include/net/llc*
3610F: net/llc/ 3136F: net/llc/
3611 3137
3612LIS3LV02D ACCELEROMETER DRIVER 3138LIS3LV02D ACCELEROMETER DRIVER
3613P: Eric Piel 3139M: Eric Piel <eric.piel@tremplin-utc.net>
3614M: eric.piel@tremplin-utc.net
3615S: Maintained 3140S: Maintained
3616F: Documentation/hwmon/lis3lv02d 3141F: Documentation/hwmon/lis3lv02d
3617F: drivers/hwmon/lis3lv02d.* 3142F: drivers/hwmon/lis3lv02d.*
3618 3143
3619LM83 HARDWARE MONITOR DRIVER 3144LM83 HARDWARE MONITOR DRIVER
3620P: Jean Delvare 3145M: Jean Delvare <khali@linux-fr.org>
3621M: khali@linux-fr.org
3622L: lm-sensors@lm-sensors.org 3146L: lm-sensors@lm-sensors.org
3623S: Maintained 3147S: Maintained
3624F: Documentation/hwmon/lm83 3148F: Documentation/hwmon/lm83
3625F: drivers/hwmon/lm83.c 3149F: drivers/hwmon/lm83.c
3626 3150
3627LM90 HARDWARE MONITOR DRIVER 3151LM90 HARDWARE MONITOR DRIVER
3628P: Jean Delvare 3152M: Jean Delvare <khali@linux-fr.org>
3629M: khali@linux-fr.org
3630L: lm-sensors@lm-sensors.org 3153L: lm-sensors@lm-sensors.org
3631S: Maintained 3154S: Maintained
3632F: Documentation/hwmon/lm90 3155F: Documentation/hwmon/lm90
3633F: drivers/hwmon/lm90.c 3156F: drivers/hwmon/lm90.c
3634 3157
3635LOCKDEP AND LOCKSTAT 3158LOCKDEP AND LOCKSTAT
3636P: Peter Zijlstra 3159M: Peter Zijlstra <peterz@infradead.org>
3637M: peterz@infradead.org 3160M: Ingo Molnar <mingo@redhat.com>
3638P: Ingo Molnar
3639M: mingo@redhat.com
3640T: git git://git.kernel.org/pub/scm/linux/kernel/git/peterz/linux-2.6-lockdep.git 3161T: git git://git.kernel.org/pub/scm/linux/kernel/git/peterz/linux-2.6-lockdep.git
3641S: Maintained 3162S: Maintained
3642F: Documentation/lockdep*.txt 3163F: Documentation/lockdep*.txt
@@ -3645,8 +3166,7 @@ F: include/linux/lockdep.h
3645F: kernel/lockdep* 3166F: kernel/lockdep*
3646 3167
3647LOGICAL DISK MANAGER SUPPORT (LDM, Windows 2000/XP/Vista Dynamic Disks) 3168LOGICAL DISK MANAGER SUPPORT (LDM, Windows 2000/XP/Vista Dynamic Disks)
3648P: Richard Russon (FlatCap) 3169M: "Richard Russon (FlatCap)" <ldm@flatcap.org>
3649M: ldm@flatcap.org
3650L: linux-ntfs-dev@lists.sourceforge.net 3170L: linux-ntfs-dev@lists.sourceforge.net
3651W: http://www.linux-ntfs.org/content/view/19/37/ 3171W: http://www.linux-ntfs.org/content/view/19/37/
3652S: Maintained 3172S: Maintained
@@ -3654,8 +3174,7 @@ F: Documentation/ldm.txt
3654F: fs/partitions/ldm.* 3174F: fs/partitions/ldm.*
3655 3175
3656LSILOGIC MPT FUSION DRIVERS (FC/SAS/SPI) 3176LSILOGIC MPT FUSION DRIVERS (FC/SAS/SPI)
3657P: Eric Moore 3177M: Eric Moore <Eric.Moore@lsi.com>
3658M: Eric.Moore@lsi.com
3659M: support@lsi.com 3178M: support@lsi.com
3660L: DL-MPTFusionLinux@lsi.com 3179L: DL-MPTFusionLinux@lsi.com
3661L: linux-scsi@vger.kernel.org 3180L: linux-scsi@vger.kernel.org
@@ -3664,25 +3183,21 @@ S: Supported
3664F: drivers/message/fusion/ 3183F: drivers/message/fusion/
3665 3184
3666LSILOGIC/SYMBIOS/NCR 53C8XX and 53C1010 PCI-SCSI drivers 3185LSILOGIC/SYMBIOS/NCR 53C8XX and 53C1010 PCI-SCSI drivers
3667P: Matthew Wilcox 3186M: Matthew Wilcox <matthew@wil.cx>
3668M: matthew@wil.cx
3669L: linux-scsi@vger.kernel.org 3187L: linux-scsi@vger.kernel.org
3670S: Maintained 3188S: Maintained
3671F: drivers/scsi/sym53c8xx_2/ 3189F: drivers/scsi/sym53c8xx_2/
3672 3190
3673LTP (Linux Test Project) 3191LTP (Linux Test Project)
3674P: Subrata Modak 3192M: Subrata Modak <subrata@linux.vnet.ibm.com>
3675M: subrata@linux.vnet.ibm.com 3193M: Mike Frysinger <vapier@gentoo.org>
3676P: Mike Frysinger
3677M: vapier@gentoo.org
3678L: ltp-list@lists.sourceforge.net (subscribers-only) 3194L: ltp-list@lists.sourceforge.net (subscribers-only)
3679W: http://ltp.sourceforge.net/ 3195W: http://ltp.sourceforge.net/
3680T: git git://git.kernel.org/pub/scm/linux/kernel/git/galak/ltp.git 3196T: git git://git.kernel.org/pub/scm/linux/kernel/git/galak/ltp.git
3681S: Maintained 3197S: Maintained
3682 3198
3683M32R ARCHITECTURE 3199M32R ARCHITECTURE
3684P: Hirokazu Takata 3200M: Hirokazu Takata <takata@linux-m32r.org>
3685M: takata@linux-m32r.org
3686L: linux-m32r@ml.linux-m32r.org 3201L: linux-m32r@ml.linux-m32r.org
3687L: linux-m32r-ja@ml.linux-m32r.org (in Japanese) 3202L: linux-m32r-ja@ml.linux-m32r.org (in Japanese)
3688W: http://www.linux-m32r.org/ 3203W: http://www.linux-m32r.org/
@@ -3690,10 +3205,8 @@ S: Maintained
3690F: arch/m32r/ 3205F: arch/m32r/
3691 3206
3692M68K ARCHITECTURE 3207M68K ARCHITECTURE
3693P: Geert Uytterhoeven 3208M: Geert Uytterhoeven <geert@linux-m68k.org>
3694M: geert@linux-m68k.org 3209M: Roman Zippel <zippel@linux-m68k.org>
3695P: Roman Zippel
3696M: zippel@linux-m68k.org
3697L: linux-m68k@lists.linux-m68k.org 3210L: linux-m68k@lists.linux-m68k.org
3698W: http://www.linux-m68k.org/ 3211W: http://www.linux-m68k.org/
3699T: git git://git.kernel.org/pub/scm/linux/kernel/git/geert/linux-m68k.git 3212T: git git://git.kernel.org/pub/scm/linux/kernel/git/geert/linux-m68k.git
@@ -3702,23 +3215,20 @@ F: arch/m68k/
3702F: drivers/zorro/ 3215F: drivers/zorro/
3703 3216
3704M68K ON APPLE MACINTOSH 3217M68K ON APPLE MACINTOSH
3705P: Joshua Thompson 3218M: Joshua Thompson <funaho@jurai.org>
3706M: funaho@jurai.org
3707W: http://www.mac.linux-m68k.org/ 3219W: http://www.mac.linux-m68k.org/
3708L: linux-m68k@lists.linux-m68k.org 3220L: linux-m68k@lists.linux-m68k.org
3709S: Maintained 3221S: Maintained
3710F: arch/m68k/mac/ 3222F: arch/m68k/mac/
3711 3223
3712M68K ON HP9000/300 3224M68K ON HP9000/300
3713P: Philip Blundell 3225M: Philip Blundell <philb@gnu.org>
3714M: philb@gnu.org
3715W: http://www.tazenda.demon.co.uk/phil/linux-hp 3226W: http://www.tazenda.demon.co.uk/phil/linux-hp
3716S: Maintained 3227S: Maintained
3717F: arch/m68k/hp300/ 3228F: arch/m68k/hp300/
3718 3229
3719MAC80211 3230MAC80211
3720P: Johannes Berg 3231M: Johannes Berg <johannes@sipsolutions.net>
3721M: johannes@sipsolutions.net
3722L: linux-wireless@vger.kernel.org 3232L: linux-wireless@vger.kernel.org
3723W: http://linuxwireless.org/ 3233W: http://linuxwireless.org/
3724T: git git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-2.6.git 3234T: git git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-2.6.git
@@ -3728,10 +3238,8 @@ F: include/net/mac80211.h
3728F: net/mac80211/ 3238F: net/mac80211/
3729 3239
3730MAC80211 PID RATE CONTROL 3240MAC80211 PID RATE CONTROL
3731P: Stefano Brivio 3241M: Stefano Brivio <stefano.brivio@polimi.it>
3732M: stefano.brivio@polimi.it 3242M: Mattias Nissler <mattias.nissler@gmx.de>
3733P: Mattias Nissler
3734M: mattias.nissler@gmx.de
3735L: linux-wireless@vger.kernel.org 3243L: linux-wireless@vger.kernel.org
3736W: http://linuxwireless.org/en/developers/Documentation/mac80211/RateControl/PID 3244W: http://linuxwireless.org/en/developers/Documentation/mac80211/RateControl/PID
3737T: git git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-2.6.git 3245T: git git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-2.6.git
@@ -3739,67 +3247,57 @@ S: Maintained
3739F: net/mac80211/rc80211_pid* 3247F: net/mac80211/rc80211_pid*
3740 3248
3741MACVLAN DRIVER 3249MACVLAN DRIVER
3742P: Patrick McHardy 3250M: Patrick McHardy <kaber@trash.net>
3743M: kaber@trash.net
3744L: netdev@vger.kernel.org 3251L: netdev@vger.kernel.org
3745S: Maintained 3252S: Maintained
3746F: drivers/net/macvlan.c 3253F: drivers/net/macvlan.c
3747F: include/linux/if_macvlan.h 3254F: include/linux/if_macvlan.h
3748 3255
3749MAN-PAGES: MANUAL PAGES FOR LINUX -- Sections 2, 3, 4, 5, and 7 3256MAN-PAGES: MANUAL PAGES FOR LINUX -- Sections 2, 3, 4, 5, and 7
3750P: Michael Kerrisk 3257M: Michael Kerrisk <mtk.manpages@gmail.com>
3751M: mtk.manpages@gmail.com
3752W: http://www.kernel.org/doc/man-pages 3258W: http://www.kernel.org/doc/man-pages
3753L: linux-man@vger.kernel.org 3259L: linux-man@vger.kernel.org
3754S: Maintained 3260S: Maintained
3755 3261
3756MARVELL LIBERTAS WIRELESS DRIVER 3262MARVELL LIBERTAS WIRELESS DRIVER
3757P: Dan Williams 3263M: Dan Williams <dcbw@redhat.com>
3758M: dcbw@redhat.com
3759L: libertas-dev@lists.infradead.org 3264L: libertas-dev@lists.infradead.org
3760S: Maintained 3265S: Maintained
3761F: drivers/net/wireless/libertas/ 3266F: drivers/net/wireless/libertas/
3762 3267
3763MARVELL MV643XX ETHERNET DRIVER 3268MARVELL MV643XX ETHERNET DRIVER
3764P: Lennert Buytenhek 3269M: Lennert Buytenhek <buytenh@marvell.com>
3765M: buytenh@marvell.com
3766L: netdev@vger.kernel.org 3270L: netdev@vger.kernel.org
3767S: Supported 3271S: Supported
3768F: drivers/net/mv643xx_eth.* 3272F: drivers/net/mv643xx_eth.*
3769F: include/linux/mv643xx.h 3273F: include/linux/mv643xx.h
3770 3274
3771MARVELL SOC MMC/SD/SDIO CONTROLLER DRIVER 3275MARVELL SOC MMC/SD/SDIO CONTROLLER DRIVER
3772P: Nicolas Pitre 3276M: Nicolas Pitre <nico@cam.org>
3773M: nico@cam.org
3774S: Maintained 3277S: Maintained
3775 3278
3776MARVELL YUKON / SYSKONNECT DRIVER 3279MARVELL YUKON / SYSKONNECT DRIVER
3777P: Mirko Lindner 3280M: Mirko Lindner <mlindner@syskonnect.de>
3778M: mlindner@syskonnect.de 3281M: Ralph Roesler <rroesler@syskonnect.de>
3779P: Ralph Roesler
3780M: rroesler@syskonnect.de
3781W: http://www.syskonnect.com 3282W: http://www.syskonnect.com
3782S: Supported 3283S: Supported
3783 3284
3784MATROX FRAMEBUFFER DRIVER 3285MATROX FRAMEBUFFER DRIVER
3785P: Petr Vandrovec 3286M: Petr Vandrovec <vandrove@vc.cvut.cz>
3786M: vandrove@vc.cvut.cz
3787L: linux-fbdev-devel@lists.sourceforge.net (moderated for non-subscribers) 3287L: linux-fbdev-devel@lists.sourceforge.net (moderated for non-subscribers)
3788S: Maintained 3288S: Maintained
3789F: drivers/video/matrox/matroxfb_* 3289F: drivers/video/matrox/matroxfb_*
3790F: include/linux/matroxfb.h 3290F: include/linux/matroxfb.h
3791 3291
3792MAX6650 HARDWARE MONITOR AND FAN CONTROLLER DRIVER 3292MAX6650 HARDWARE MONITOR AND FAN CONTROLLER DRIVER
3793P: Hans J. Koch 3293M: "Hans J. Koch" <hjk@linutronix.de>
3794M: hjk@linutronix.de
3795L: lm-sensors@lm-sensors.org 3294L: lm-sensors@lm-sensors.org
3796S: Maintained 3295S: Maintained
3797F: Documentation/hwmon/max6650 3296F: Documentation/hwmon/max6650
3798F: drivers/hwmon/max6650.c 3297F: drivers/hwmon/max6650.c
3799 3298
3800MEDIA INPUT INFRASTRUCTURE (V4L/DVB) 3299MEDIA INPUT INFRASTRUCTURE (V4L/DVB)
3801P: Mauro Carvalho Chehab 3300M: Mauro Carvalho Chehab <mchehab@infradead.org>
3802M: mchehab@infradead.org
3803P: LinuxTV.org Project 3301P: LinuxTV.org Project
3804L: linux-media@vger.kernel.org 3302L: linux-media@vger.kernel.org
3805W: http://linuxtv.org 3303W: http://linuxtv.org
@@ -3813,8 +3311,7 @@ F: include/linux/dvb/
3813F: include/linux/videodev*.h 3311F: include/linux/videodev*.h
3814 3312
3815MEGARAID SCSI DRIVERS 3313MEGARAID SCSI DRIVERS
3816P: Neela Syam Kolli 3314M: Neela Syam Kolli <megaraidlinux@lsi.com>
3817M: megaraidlinux@lsi.com
3818L: linux-scsi@vger.kernel.org 3315L: linux-scsi@vger.kernel.org
3819W: http://megaraid.lsilogic.com 3316W: http://megaraid.lsilogic.com
3820S: Maintained 3317S: Maintained
@@ -3830,19 +3327,15 @@ F: include/linux/mm.h
3830F: mm/ 3327F: mm/
3831 3328
3832MEMORY RESOURCE CONTROLLER 3329MEMORY RESOURCE CONTROLLER
3833P: Balbir Singh 3330M: Balbir Singh <balbir@linux.vnet.ibm.com>
3834M: balbir@linux.vnet.ibm.com 3331M: Pavel Emelyanov <xemul@openvz.org>
3835P: Pavel Emelyanov 3332M: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
3836M: xemul@openvz.org
3837P: KAMEZAWA Hiroyuki
3838M: kamezawa.hiroyu@jp.fujitsu.com
3839L: linux-mm@kvack.org 3333L: linux-mm@kvack.org
3840S: Maintained 3334S: Maintained
3841F: mm/memcontrol.c 3335F: mm/memcontrol.c
3842 3336
3843MEMORY TECHNOLOGY DEVICES (MTD) 3337MEMORY TECHNOLOGY DEVICES (MTD)
3844P: David Woodhouse 3338M: David Woodhouse <dwmw2@infradead.org>
3845M: dwmw2@infradead.org
3846W: http://www.linux-mtd.infradead.org/ 3339W: http://www.linux-mtd.infradead.org/
3847L: linux-mtd@lists.infradead.org 3340L: linux-mtd@lists.infradead.org
3848T: git git://git.infradead.org/mtd-2.6.git 3341T: git git://git.infradead.org/mtd-2.6.git
@@ -3852,8 +3345,7 @@ F: include/linux/mtd/
3852F: include/mtd/ 3345F: include/mtd/
3853 3346
3854MICROBLAZE ARCHITECTURE 3347MICROBLAZE ARCHITECTURE
3855P: Michal Simek 3348M: Michal Simek <monstr@monstr.eu>
3856M: monstr@monstr.eu
3857L: microblaze-uclinux@itee.uq.edu.au 3349L: microblaze-uclinux@itee.uq.edu.au
3858W: http://www.monstr.eu/fdt/ 3350W: http://www.monstr.eu/fdt/
3859T: git git://git.monstr.eu/linux-2.6-microblaze.git 3351T: git git://git.monstr.eu/linux-2.6-microblaze.git
@@ -3861,14 +3353,12 @@ S: Supported
3861F: arch/microblaze/ 3353F: arch/microblaze/
3862 3354
3863MICROTEK X6 SCANNER 3355MICROTEK X6 SCANNER
3864P: Oliver Neukum 3356M: Oliver Neukum <oliver@neukum.name>
3865M: oliver@neukum.name
3866S: Maintained 3357S: Maintained
3867F: drivers/usb/image/microtek.* 3358F: drivers/usb/image/microtek.*
3868 3359
3869MIPS 3360MIPS
3870P: Ralf Baechle 3361M: Ralf Baechle <ralf@linux-mips.org>
3871M: ralf@linux-mips.org
3872W: http://www.linux-mips.org/ 3362W: http://www.linux-mips.org/
3873L: linux-mips@linux-mips.org 3363L: linux-mips@linux-mips.org
3874T: git git://git.linux-mips.org/pub/scm/linux.git 3364T: git git://git.linux-mips.org/pub/scm/linux.git
@@ -3877,8 +3367,7 @@ F: Documentation/mips/
3877F: arch/mips/ 3367F: arch/mips/
3878 3368
3879MISCELLANEOUS MCA-SUPPORT 3369MISCELLANEOUS MCA-SUPPORT
3880P: James Bottomley 3370M: James Bottomley <James.Bottomley@HansenPartnership.com>
3881M: James.Bottomley@HansenPartnership.com
3882S: Maintained 3371S: Maintained
3883F: Documentation/ia64/mca.txt 3372F: Documentation/ia64/mca.txt
3884F: Documentation/mca.txt 3373F: Documentation/mca.txt
@@ -3886,15 +3375,13 @@ F: drivers/mca/
3886F: include/linux/mca* 3375F: include/linux/mca*
3887 3376
3888MODULE SUPPORT 3377MODULE SUPPORT
3889P: Rusty Russell 3378M: Rusty Russell <rusty@rustcorp.com.au>
3890M: rusty@rustcorp.com.au
3891S: Maintained 3379S: Maintained
3892F: include/linux/module.h 3380F: include/linux/module.h
3893F: kernel/module.c 3381F: kernel/module.c
3894 3382
3895MOTION EYE VAIO PICTUREBOOK CAMERA DRIVER 3383MOTION EYE VAIO PICTUREBOOK CAMERA DRIVER
3896P: Stelian Pop 3384M: Stelian Pop <stelian@popies.net>
3897M: stelian@popies.net
3898W: http://popies.net/meye/ 3385W: http://popies.net/meye/
3899S: Maintained 3386S: Maintained
3900F: Documentation/video4linux/meye.txt 3387F: Documentation/video4linux/meye.txt
@@ -3902,135 +3389,111 @@ F: drivers/media/video/meye.*
3902F: include/linux/meye.h 3389F: include/linux/meye.h
3903 3390
3904MOTOROLA IMX MMC/SD HOST CONTROLLER INTERFACE DRIVER 3391MOTOROLA IMX MMC/SD HOST CONTROLLER INTERFACE DRIVER
3905P: Pavel Pisa 3392M: Pavel Pisa <ppisa@pikron.com>
3906M: ppisa@pikron.com
3907L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only) 3393L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only)
3908S: Maintained 3394S: Maintained
3909F: drivers/mmc/host/imxmmc.* 3395F: drivers/mmc/host/imxmmc.*
3910 3396
3911MOUSE AND MISC DEVICES [GENERAL] 3397MOUSE AND MISC DEVICES [GENERAL]
3912P: Alessandro Rubini 3398M: Alessandro Rubini <rubini@ipvvis.unipv.it>
3913M: rubini@ipvvis.unipv.it
3914S: Maintained 3399S: Maintained
3915F: drivers/input/mouse/ 3400F: drivers/input/mouse/
3916F: include/linux/gpio_mouse.h 3401F: include/linux/gpio_mouse.h
3917 3402
3918MOXA SMARTIO/INDUSTIO/INTELLIO SERIAL CARD 3403MOXA SMARTIO/INDUSTIO/INTELLIO SERIAL CARD
3919P: Jiri Slaby 3404M: Jiri Slaby <jirislaby@gmail.com>
3920M: jirislaby@gmail.com
3921S: Maintained 3405S: Maintained
3922F: Documentation/serial/moxa-smartio 3406F: Documentation/serial/moxa-smartio
3923F: drivers/char/mxser.* 3407F: drivers/char/mxser.*
3924 3408
3925MSI LAPTOP SUPPORT 3409MSI LAPTOP SUPPORT
3926P: Lennart Poettering 3410M: Lennart Poettering <mzxreary@0pointer.de>
3927M: mzxreary@0pointer.de
3928W: https://tango.0pointer.de/mailman/listinfo/s270-linux 3411W: https://tango.0pointer.de/mailman/listinfo/s270-linux
3929W: http://0pointer.de/lennart/tchibo.html 3412W: http://0pointer.de/lennart/tchibo.html
3930S: Maintained 3413S: Maintained
3931F: drivers/platform/x86/msi-laptop.c 3414F: drivers/platform/x86/msi-laptop.c
3932 3415
3933MULTIFUNCTION DEVICES (MFD) 3416MULTIFUNCTION DEVICES (MFD)
3934P: Samuel Ortiz 3417M: Samuel Ortiz <sameo@linux.intel.com>
3935M: sameo@linux.intel.com
3936T: git git://git.kernel.org/pub/scm/linux/kernel/git/sameo/mfd-2.6.git 3418T: git git://git.kernel.org/pub/scm/linux/kernel/git/sameo/mfd-2.6.git
3937S: Supported 3419S: Supported
3938F: drivers/mfd/ 3420F: drivers/mfd/
3939 3421
3940MULTIMEDIA CARD (MMC), SECURE DIGITAL (SD) AND SDIO SUBSYSTEM 3422MULTIMEDIA CARD (MMC), SECURE DIGITAL (SD) AND SDIO SUBSYSTEM
3941P: Pierre Ossman 3423S: Orphan
3942M: pierre@ossman.eu
3943S: Maintained
3944F: drivers/mmc/ 3424F: drivers/mmc/
3945F: include/linux/mmc/ 3425F: include/linux/mmc/
3946 3426
3947MULTIMEDIA CARD (MMC) ETC. OVER SPI 3427MULTIMEDIA CARD (MMC) ETC. OVER SPI
3948P: David Brownell 3428M: David Brownell <dbrownell@users.sourceforge.net>
3949M: dbrownell@users.sourceforge.net
3950S: Odd Fixes 3429S: Odd Fixes
3951F: drivers/mmc/host/mmc_spi.c 3430F: drivers/mmc/host/mmc_spi.c
3952F: include/linux/spi/mmc_spi.h 3431F: include/linux/spi/mmc_spi.h
3953 3432
3954MULTISOUND SOUND DRIVER 3433MULTISOUND SOUND DRIVER
3955P: Andrew Veliath 3434M: Andrew Veliath <andrewtv@usa.net>
3956M: andrewtv@usa.net
3957S: Maintained 3435S: Maintained
3958F: Documentation/sound/oss/MultiSound 3436F: Documentation/sound/oss/MultiSound
3959F: sound/oss/msnd* 3437F: sound/oss/msnd*
3960 3438
3961MULTITECH MULTIPORT CARD (ISICOM) 3439MULTITECH MULTIPORT CARD (ISICOM)
3962P: Jiri Slaby 3440M: Jiri Slaby <jirislaby@gmail.com>
3963M: jirislaby@gmail.com
3964S: Maintained 3441S: Maintained
3965F: drivers/char/isicom.c 3442F: drivers/char/isicom.c
3966F: include/linux/isicom.h 3443F: include/linux/isicom.h
3967 3444
3968MUSB MULTIPOINT HIGH SPEED DUAL-ROLE CONTROLLER 3445MUSB MULTIPOINT HIGH SPEED DUAL-ROLE CONTROLLER
3969P: Felipe Balbi 3446M: Felipe Balbi <felipe.balbi@nokia.com>
3970M: felipe.balbi@nokia.com
3971L: linux-usb@vger.kernel.org 3447L: linux-usb@vger.kernel.org
3972T: git git://gitorious.org/musb/mainline.git 3448T: git git://gitorious.org/musb/mainline.git
3973S: Maintained 3449S: Maintained
3974F: drivers/usb/musb/ 3450F: drivers/usb/musb/
3975 3451
3976MYRICOM MYRI-10G 10GbE DRIVER (MYRI10GE) 3452MYRICOM MYRI-10G 10GbE DRIVER (MYRI10GE)
3977P: Andrew Gallatin 3453M: Andrew Gallatin <gallatin@myri.com>
3978M: gallatin@myri.com 3454M: Brice Goglin <brice@myri.com>
3979P: Brice Goglin
3980M: brice@myri.com
3981L: netdev@vger.kernel.org 3455L: netdev@vger.kernel.org
3982W: http://www.myri.com/scs/download-Myri10GE.html 3456W: http://www.myri.com/scs/download-Myri10GE.html
3983S: Supported 3457S: Supported
3984F: drivers/net/myri10ge/ 3458F: drivers/net/myri10ge/
3985 3459
3986NATSEMI ETHERNET DRIVER (DP8381x) 3460NATSEMI ETHERNET DRIVER (DP8381x)
3987P: Tim Hockin 3461M: Tim Hockin <thockin@hockin.org>
3988M: thockin@hockin.org
3989S: Maintained 3462S: Maintained
3990F: drivers/net/natsemi.c 3463F: drivers/net/natsemi.c
3991 3464
3992NCP FILESYSTEM 3465NCP FILESYSTEM
3993P: Petr Vandrovec 3466M: Petr Vandrovec <vandrove@vc.cvut.cz>
3994M: vandrove@vc.cvut.cz
3995L: linware@sh.cvut.cz 3467L: linware@sh.cvut.cz
3996S: Maintained 3468S: Maintained
3997F: fs/ncpfs/ 3469F: fs/ncpfs/
3998 3470
3999NCR DUAL 700 SCSI DRIVER (MICROCHANNEL) 3471NCR DUAL 700 SCSI DRIVER (MICROCHANNEL)
4000P: James E.J. Bottomley 3472M: "James E.J. Bottomley" <James.Bottomley@HansenPartnership.com>
4001M: James.Bottomley@HansenPartnership.com
4002L: linux-scsi@vger.kernel.org 3473L: linux-scsi@vger.kernel.org
4003S: Maintained 3474S: Maintained
4004F: drivers/scsi/NCR_D700.* 3475F: drivers/scsi/NCR_D700.*
4005 3476
4006NETEFFECT IWARP RNIC DRIVER (IW_NES) 3477NETEFFECT IWARP RNIC DRIVER (IW_NES)
4007P: Faisal Latif 3478M: Faisal Latif <faisal.latif@intel.com>
4008M: faisal.latif@intel.com 3479M: Chien Tung <chien.tin.tung@intel.com>
4009P: Chien Tung
4010M: chien.tin.tung@intel.com
4011L: general@lists.openfabrics.org 3480L: general@lists.openfabrics.org
4012W: http://www.neteffect.com 3481W: http://www.neteffect.com
4013S: Supported 3482S: Supported
4014F: drivers/infiniband/hw/nes/ 3483F: drivers/infiniband/hw/nes/
4015 3484
4016NETEM NETWORK EMULATOR 3485NETEM NETWORK EMULATOR
4017P: Stephen Hemminger 3486M: Stephen Hemminger <shemminger@linux-foundation.org>
4018M: shemminger@linux-foundation.org
4019L: netem@lists.linux-foundation.org 3487L: netem@lists.linux-foundation.org
4020S: Maintained 3488S: Maintained
4021F: net/sched/sch_netem.c 3489F: net/sched/sch_netem.c
4022 3490
4023NETERION (S2IO) 10GbE DRIVER (xframe/vxge) 3491NETERION (S2IO) 10GbE DRIVER (xframe/vxge)
4024P: Ramkrishna Vepa 3492M: Ramkrishna Vepa <ram.vepa@neterion.com>
4025M: ram.vepa@neterion.com 3493M: Rastapur Santosh <santosh.rastapur@neterion.com>
4026P: Rastapur Santosh 3494M: Sivakumar Subramani <sivakumar.subramani@neterion.com>
4027M: santosh.rastapur@neterion.com 3495M: Sreenivasa Honnur <sreenivasa.honnur@neterion.com>
4028P: Sivakumar Subramani 3496M: Anil Murthy <anil.murthy@neterion.com>
4029M: sivakumar.subramani@neterion.com
4030P: Sreenivasa Honnur
4031M: sreenivasa.honnur@neterion.com
4032P: Anil Murthy
4033M: anil.murthy@neterion.com
4034L: netdev@vger.kernel.org 3497L: netdev@vger.kernel.org
4035W: http://trac.neterion.com/cgi-bin/trac.cgi/wiki/Linux?Anonymous 3498W: http://trac.neterion.com/cgi-bin/trac.cgi/wiki/Linux?Anonymous
4036W: http://trac.neterion.com/cgi-bin/trac.cgi/wiki/X3100Linux?Anonymous 3499W: http://trac.neterion.com/cgi-bin/trac.cgi/wiki/X3100Linux?Anonymous
@@ -4044,8 +3507,7 @@ P: Marc Boucher
4044P: James Morris 3507P: James Morris
4045P: Harald Welte 3508P: Harald Welte
4046P: Jozsef Kadlecsik 3509P: Jozsef Kadlecsik
4047P: Patrick McHardy 3510M: Patrick McHardy <kaber@trash.net>
4048M: kaber@trash.net
4049L: netfilter-devel@vger.kernel.org 3511L: netfilter-devel@vger.kernel.org
4050L: netfilter@vger.kernel.org 3512L: netfilter@vger.kernel.org
4051L: coreteam@netfilter.org 3513L: coreteam@netfilter.org
@@ -4061,8 +3523,7 @@ F: net/*/netfilter/
4061F: net/netfilter/ 3523F: net/netfilter/
4062 3524
4063NETLABEL 3525NETLABEL
4064P: Paul Moore 3526M: Paul Moore <paul.moore@hp.com>
4065M: paul.moore@hp.com
4066W: http://netlabel.sf.net 3527W: http://netlabel.sf.net
4067L: netdev@vger.kernel.org 3528L: netdev@vger.kernel.org
4068S: Supported 3529S: Supported
@@ -4071,8 +3532,7 @@ F: include/net/netlabel.h
4071F: net/netlabel/ 3532F: net/netlabel/
4072 3533
4073NETROM NETWORK LAYER 3534NETROM NETWORK LAYER
4074P: Ralf Baechle 3535M: Ralf Baechle <ralf@linux-mips.org>
4075M: ralf@linux-mips.org
4076L: linux-hams@vger.kernel.org 3536L: linux-hams@vger.kernel.org
4077W: http://www.linux-ax25.org/ 3537W: http://www.linux-ax25.org/
4078S: Maintained 3538S: Maintained
@@ -4081,16 +3541,14 @@ F: include/net/netrom.h
4081F: net/netrom/ 3541F: net/netrom/
4082 3542
4083NETWORK BLOCK DEVICE (NBD) 3543NETWORK BLOCK DEVICE (NBD)
4084P: Paul Clements 3544M: Paul Clements <Paul.Clements@steeleye.com>
4085M: Paul.Clements@steeleye.com
4086S: Maintained 3545S: Maintained
4087F: Documentation/blockdev/nbd.txt 3546F: Documentation/blockdev/nbd.txt
4088F: drivers/block/nbd.c 3547F: drivers/block/nbd.c
4089F: include/linux/nbd.h 3548F: include/linux/nbd.h
4090 3549
4091NETWORKING [GENERAL] 3550NETWORKING [GENERAL]
4092P: David S. Miller 3551M: "David S. Miller" <davem@davemloft.net>
4093M: davem@davemloft.net
4094L: netdev@vger.kernel.org 3552L: netdev@vger.kernel.org
4095W: http://www.linuxfoundation.org/en/Net 3553W: http://www.linuxfoundation.org/en/Net
4096T: git git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6.git 3554T: git git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6.git
@@ -4099,18 +3557,12 @@ F: net/
4099F: include/net/ 3557F: include/net/
4100 3558
4101NETWORKING [IPv4/IPv6] 3559NETWORKING [IPv4/IPv6]
4102P: David S. Miller 3560M: "David S. Miller" <davem@davemloft.net>
4103M: davem@davemloft.net 3561M: Alexey Kuznetsov <kuznet@ms2.inr.ac.ru>
4104P: Alexey Kuznetsov 3562M: "Pekka Savola (ipv6)" <pekkas@netcore.fi>
4105M: kuznet@ms2.inr.ac.ru 3563M: James Morris <jmorris@namei.org>
4106P: Pekka Savola (ipv6) 3564M: Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>
4107M: pekkas@netcore.fi 3565M: Patrick McHardy <kaber@trash.net>
4108P: James Morris
4109M: jmorris@namei.org
4110P: Hideaki YOSHIFUJI
4111M: yoshfuji@linux-ipv6.org
4112P: Patrick McHardy
4113M: kaber@trash.net
4114L: netdev@vger.kernel.org 3566L: netdev@vger.kernel.org
4115T: git git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6.git 3567T: git git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6.git
4116S: Maintained 3568S: Maintained
@@ -4119,14 +3571,12 @@ F: net/ipv6/
4119F: include/net/ip* 3571F: include/net/ip*
4120 3572
4121NETWORKING [LABELED] (NetLabel, CIPSO, Labeled IPsec, SECMARK) 3573NETWORKING [LABELED] (NetLabel, CIPSO, Labeled IPsec, SECMARK)
4122P: Paul Moore 3574M: Paul Moore <paul.moore@hp.com>
4123M: paul.moore@hp.com
4124L: netdev@vger.kernel.org 3575L: netdev@vger.kernel.org
4125S: Maintained 3576S: Maintained
4126 3577
4127NETWORKING [WIRELESS] 3578NETWORKING [WIRELESS]
4128P: John W. Linville 3579M: "John W. Linville" <linville@tuxdriver.com>
4129M: linville@tuxdriver.com
4130L: linux-wireless@vger.kernel.org 3580L: linux-wireless@vger.kernel.org
4131T: git git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-2.6.git 3581T: git git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-2.6.git
4132S: Maintained 3582S: Maintained
@@ -4142,16 +3592,14 @@ S: Odd Fixes
4142F: drivers/net/ 3592F: drivers/net/
4143 3593
4144NETXEN (1/10) GbE SUPPORT 3594NETXEN (1/10) GbE SUPPORT
4145P: Dhananjay Phadke 3595M: Dhananjay Phadke <dhananjay@netxen.com>
4146M: dhananjay@netxen.com
4147L: netdev@vger.kernel.org 3596L: netdev@vger.kernel.org
4148W: http://www.netxen.com 3597W: http://www.netxen.com
4149S: Supported 3598S: Supported
4150F: drivers/net/netxen/ 3599F: drivers/net/netxen/
4151 3600
4152NFS, SUNRPC, AND LOCKD CLIENTS 3601NFS, SUNRPC, AND LOCKD CLIENTS
4153P: Trond Myklebust 3602M: Trond Myklebust <Trond.Myklebust@netapp.com>
4154M: Trond.Myklebust@netapp.com
4155L: linux-nfs@vger.kernel.org 3603L: linux-nfs@vger.kernel.org
4156W: http://client.linux-nfs.org 3604W: http://client.linux-nfs.org
4157T: git git://git.linux-nfs.org/pub/linux/nfs-2.6.git 3605T: git git://git.linux-nfs.org/pub/linux/nfs-2.6.git
@@ -4165,17 +3613,14 @@ F: include/linux/nfs*
4165F: include/linux/sunrpc/ 3613F: include/linux/sunrpc/
4166 3614
4167NI5010 NETWORK DRIVER 3615NI5010 NETWORK DRIVER
4168P: Jan-Pascal van Best 3616M: Jan-Pascal van Best <janpascal@vanbest.org>
4169M: janpascal@vanbest.org 3617M: Andreas Mohr <andi@lisas.de>
4170P: Andreas Mohr
4171M: andi@lisas.de
4172L: netdev@vger.kernel.org 3618L: netdev@vger.kernel.org
4173S: Maintained 3619S: Maintained
4174F: drivers/net/ni5010.* 3620F: drivers/net/ni5010.*
4175 3621
4176NILFS2 FILESYSTEM 3622NILFS2 FILESYSTEM
4177P: KONISHI Ryusuke 3623M: KONISHI Ryusuke <konishi.ryusuke@lab.ntt.co.jp>
4178M: konishi.ryusuke@lab.ntt.co.jp
4179L: users@nilfs.org 3624L: users@nilfs.org
4180W: http://www.nilfs.org/en/ 3625W: http://www.nilfs.org/en/
4181S: Supported 3626S: Supported
@@ -4184,26 +3629,22 @@ F: fs/nilfs2/
4184F: include/linux/nilfs2_fs.h 3629F: include/linux/nilfs2_fs.h
4185 3630
4186NINJA SCSI-3 / NINJA SCSI-32Bi (16bit/CardBus) PCMCIA SCSI HOST ADAPTER DRIVER 3631NINJA SCSI-3 / NINJA SCSI-32Bi (16bit/CardBus) PCMCIA SCSI HOST ADAPTER DRIVER
4187P: YOKOTA Hiroshi 3632M: YOKOTA Hiroshi <yokota@netlab.is.tsukuba.ac.jp>
4188M: yokota@netlab.is.tsukuba.ac.jp
4189W: http://www.netlab.is.tsukuba.ac.jp/~yokota/izumi/ninja/ 3633W: http://www.netlab.is.tsukuba.ac.jp/~yokota/izumi/ninja/
4190S: Maintained 3634S: Maintained
4191F: Documentation/scsi/NinjaSCSI.txt 3635F: Documentation/scsi/NinjaSCSI.txt
4192F: drivers/scsi/pcmcia/nsp_* 3636F: drivers/scsi/pcmcia/nsp_*
4193 3637
4194NINJA SCSI-32Bi/UDE PCI/CARDBUS SCSI HOST ADAPTER DRIVER 3638NINJA SCSI-32Bi/UDE PCI/CARDBUS SCSI HOST ADAPTER DRIVER
4195P: GOTO Masanori 3639M: GOTO Masanori <gotom@debian.or.jp>
4196M: gotom@debian.or.jp 3640M: YOKOTA Hiroshi <yokota@netlab.is.tsukuba.ac.jp>
4197P: YOKOTA Hiroshi
4198M: yokota@netlab.is.tsukuba.ac.jp
4199W: http://www.netlab.is.tsukuba.ac.jp/~yokota/izumi/ninja/ 3641W: http://www.netlab.is.tsukuba.ac.jp/~yokota/izumi/ninja/
4200S: Maintained 3642S: Maintained
4201F: Documentation/scsi/NinjaSCSI.txt 3643F: Documentation/scsi/NinjaSCSI.txt
4202F: drivers/scsi/nsp32* 3644F: drivers/scsi/nsp32*
4203 3645
4204NTFS FILESYSTEM 3646NTFS FILESYSTEM
4205P: Anton Altaparmakov 3647M: Anton Altaparmakov <aia21@cantab.net>
4206M: aia21@cantab.net
4207L: linux-ntfs-dev@lists.sourceforge.net 3648L: linux-ntfs-dev@lists.sourceforge.net
4208W: http://www.linux-ntfs.org/ 3649W: http://www.linux-ntfs.org/
4209T: git git://git.kernel.org/pub/scm/linux/kernel/git/aia21/ntfs-2.6.git 3650T: git git://git.kernel.org/pub/scm/linux/kernel/git/aia21/ntfs-2.6.git
@@ -4212,16 +3653,14 @@ F: Documentation/filesystems/ntfs.txt
4212F: fs/ntfs/ 3653F: fs/ntfs/
4213 3654
4214NVIDIA (rivafb and nvidiafb) FRAMEBUFFER DRIVER 3655NVIDIA (rivafb and nvidiafb) FRAMEBUFFER DRIVER
4215P: Antonino Daplas 3656M: Antonino Daplas <adaplas@gmail.com>
4216M: adaplas@gmail.com
4217L: linux-fbdev-devel@lists.sourceforge.net (moderated for non-subscribers) 3657L: linux-fbdev-devel@lists.sourceforge.net (moderated for non-subscribers)
4218S: Maintained 3658S: Maintained
4219F: drivers/video/riva/ 3659F: drivers/video/riva/
4220F: drivers/video/nvidia/ 3660F: drivers/video/nvidia/
4221 3661
4222OMAP SUPPORT 3662OMAP SUPPORT
4223P: Tony Lindgren <tony@atomide.com> 3663M: "Tony Lindgren <tony@atomide.com>" <tony@atomide.com>
4224M: tony@atomide.com
4225L: linux-omap@vger.kernel.org 3664L: linux-omap@vger.kernel.org
4226W: http://www.muru.com/linux/omap/ 3665W: http://www.muru.com/linux/omap/
4227W: http://linux.omap.com/ 3666W: http://linux.omap.com/
@@ -4230,98 +3669,83 @@ S: Maintained
4230F: arch/arm/*omap* 3669F: arch/arm/*omap*
4231 3670
4232OMAP CLOCK FRAMEWORK SUPPORT 3671OMAP CLOCK FRAMEWORK SUPPORT
4233P: Paul Walmsley 3672M: Paul Walmsley <paul@pwsan.com>
4234M: paul@pwsan.com
4235L: linux-omap@vger.kernel.org 3673L: linux-omap@vger.kernel.org
4236S: Maintained 3674S: Maintained
4237F: arch/arm/*omap*/*clock* 3675F: arch/arm/*omap*/*clock*
4238 3676
4239OMAP POWER MANAGEMENT SUPPORT 3677OMAP POWER MANAGEMENT SUPPORT
4240P: Kevin Hilman 3678M: Kevin Hilman <khilman@deeprootsystems.com>
4241M: khilman@deeprootsystems.com
4242L: linux-omap@vger.kernel.org 3679L: linux-omap@vger.kernel.org
4243S: Maintained 3680S: Maintained
4244F: arch/arm/*omap*/*pm* 3681F: arch/arm/*omap*/*pm*
4245 3682
4246OMAP AUDIO SUPPORT 3683OMAP AUDIO SUPPORT
4247P: Jarkko Nikula 3684M: Jarkko Nikula <jhnikula@gmail.com>
4248M: jhnikula@gmail.com
4249L: alsa-devel@alsa-project.org (subscribers-only) 3685L: alsa-devel@alsa-project.org (subscribers-only)
4250L: linux-omap@vger.kernel.org 3686L: linux-omap@vger.kernel.org
4251S: Maintained 3687S: Maintained
4252F: sound/soc/omap/ 3688F: sound/soc/omap/
4253 3689
4254OMAP FRAMEBUFFER SUPPORT 3690OMAP FRAMEBUFFER SUPPORT
4255P: Imre Deak 3691M: Imre Deak <imre.deak@nokia.com>
4256M: imre.deak@nokia.com
4257L: linux-fbdev-devel@lists.sourceforge.net (moderated for non-subscribers) 3692L: linux-fbdev-devel@lists.sourceforge.net (moderated for non-subscribers)
4258L: linux-omap@vger.kernel.org 3693L: linux-omap@vger.kernel.org
4259S: Maintained 3694S: Maintained
4260F: drivers/video/omap/ 3695F: drivers/video/omap/
4261 3696
4262OMAP MMC SUPPORT 3697OMAP MMC SUPPORT
4263P: Jarkko Lavinen 3698M: Jarkko Lavinen <jarkko.lavinen@nokia.com>
4264M: jarkko.lavinen@nokia.com
4265L: linux-kernel@vger.kernel.org
4266L: linux-omap@vger.kernel.org 3699L: linux-omap@vger.kernel.org
4267S: Maintained 3700S: Maintained
4268F: drivers/mmc/host/*omap* 3701F: drivers/mmc/host/*omap*
4269 3702
4270OMAP RANDOM NUMBER GENERATOR SUPPORT 3703OMAP RANDOM NUMBER GENERATOR SUPPORT
4271P: Deepak Saxena 3704M: Deepak Saxena <dsaxena@plexity.net>
4272M: dsaxena@plexity.net
4273S: Maintained 3705S: Maintained
4274F: drivers/char/hw_random/omap-rng.c 3706F: drivers/char/hw_random/omap-rng.c
4275 3707
4276OMAP USB SUPPORT 3708OMAP USB SUPPORT
4277P: Felipe Balbi 3709M: Felipe Balbi <felipe.balbi@nokia.com>
4278M: felipe.balbi@nokia.com 3710M: David Brownell <dbrownell@users.sourceforge.net>
4279P: David Brownell
4280M: dbrownell@users.sourceforge.net
4281L: linux-usb@vger.kernel.org 3711L: linux-usb@vger.kernel.org
4282L: linux-omap@vger.kernel.org 3712L: linux-omap@vger.kernel.org
4283S: Maintained 3713S: Maintained
4284 3714
4285OMFS FILESYSTEM 3715OMFS FILESYSTEM
4286P: Bob Copeland 3716M: Bob Copeland <me@bobcopeland.com>
4287M: me@bobcopeland.com
4288L: linux-karma-devel@lists.sourceforge.net 3717L: linux-karma-devel@lists.sourceforge.net
4289S: Maintained 3718S: Maintained
4290F: Documentation/filesystems/omfs.txt 3719F: Documentation/filesystems/omfs.txt
4291F: fs/omfs/ 3720F: fs/omfs/
4292 3721
4293OMNIKEY CARDMAN 4000 DRIVER 3722OMNIKEY CARDMAN 4000 DRIVER
4294P: Harald Welte 3723M: Harald Welte <laforge@gnumonks.org>
4295M: laforge@gnumonks.org
4296S: Maintained 3724S: Maintained
4297F: drivers/char/pcmcia/cm4000_cs.c 3725F: drivers/char/pcmcia/cm4000_cs.c
4298F: include/linux/cm4000_cs.h 3726F: include/linux/cm4000_cs.h
4299 3727
4300OMNIKEY CARDMAN 4040 DRIVER 3728OMNIKEY CARDMAN 4040 DRIVER
4301P: Harald Welte 3729M: Harald Welte <laforge@gnumonks.org>
4302M: laforge@gnumonks.org
4303S: Maintained 3730S: Maintained
4304F: drivers/char/pcmcia/cm4040_cs.* 3731F: drivers/char/pcmcia/cm4040_cs.*
4305 3732
4306OMNIVISION OV7670 SENSOR DRIVER 3733OMNIVISION OV7670 SENSOR DRIVER
4307P: Jonathan Corbet 3734M: Jonathan Corbet <corbet@lwn.net>
4308M: corbet@lwn.net
4309L: linux-media@vger.kernel.org 3735L: linux-media@vger.kernel.org
4310T: git git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6.git 3736T: git git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6.git
4311S: Maintained 3737S: Maintained
4312F: drivers/media/video/ov7670.c 3738F: drivers/media/video/ov7670.c
4313 3739
4314ONENAND FLASH DRIVER 3740ONENAND FLASH DRIVER
4315P: Kyungmin Park 3741M: Kyungmin Park <kyungmin.park@samsung.com>
4316M: kyungmin.park@samsung.com
4317L: linux-mtd@lists.infradead.org 3742L: linux-mtd@lists.infradead.org
4318S: Maintained 3743S: Maintained
4319F: drivers/mtd/onenand/ 3744F: drivers/mtd/onenand/
4320F: include/linux/mtd/onenand*.h 3745F: include/linux/mtd/onenand*.h
4321 3746
4322ONSTREAM SCSI TAPE DRIVER 3747ONSTREAM SCSI TAPE DRIVER
4323P: Willem Riede 3748M: Willem Riede <osst@riede.org>
4324M: osst@riede.org
4325L: osst-users@lists.sourceforge.net 3749L: osst-users@lists.sourceforge.net
4326L: linux-scsi@vger.kernel.org 3750L: linux-scsi@vger.kernel.org
4327S: Maintained 3751S: Maintained
@@ -4329,16 +3753,14 @@ F: drivers/scsi/osst*
4329F: drivers/scsi/st* 3753F: drivers/scsi/st*
4330 3754
4331OPENCORES I2C BUS DRIVER 3755OPENCORES I2C BUS DRIVER
4332P: Peter Korsgaard 3756M: Peter Korsgaard <jacmet@sunsite.dk>
4333M: jacmet@sunsite.dk
4334L: linux-i2c@vger.kernel.org 3757L: linux-i2c@vger.kernel.org
4335S: Maintained 3758S: Maintained
4336F: Documentation/i2c/busses/i2c-ocores 3759F: Documentation/i2c/busses/i2c-ocores
4337F: drivers/i2c/busses/i2c-ocores.c 3760F: drivers/i2c/busses/i2c-ocores.c
4338 3761
4339OPROFILE 3762OPROFILE
4340P: Robert Richter 3763M: Robert Richter <robert.richter@amd.com>
4341M: robert.richter@amd.com
4342L: oprofile-list@lists.sf.net 3764L: oprofile-list@lists.sf.net
4343S: Maintained 3765S: Maintained
4344F: arch/*/oprofile/ 3766F: arch/*/oprofile/
@@ -4346,10 +3768,8 @@ F: drivers/oprofile/
4346F: include/linux/oprofile.h 3768F: include/linux/oprofile.h
4347 3769
4348ORACLE CLUSTER FILESYSTEM 2 (OCFS2) 3770ORACLE CLUSTER FILESYSTEM 2 (OCFS2)
4349P: Mark Fasheh 3771M: Mark Fasheh <mfasheh@suse.com>
4350M: mfasheh@suse.com 3772M: Joel Becker <joel.becker@oracle.com>
4351P: Joel Becker
4352M: joel.becker@oracle.com
4353L: ocfs2-devel@oss.oracle.com (moderated for non-subscribers) 3773L: ocfs2-devel@oss.oracle.com (moderated for non-subscribers)
4354W: http://oss.oracle.com/projects/ocfs2/ 3774W: http://oss.oracle.com/projects/ocfs2/
4355T: git git://git.kernel.org/pub/scm/linux/kernel/git/jlbec/ocfs2.git 3775T: git git://git.kernel.org/pub/scm/linux/kernel/git/jlbec/ocfs2.git
@@ -4359,10 +3779,8 @@ F: Documentation/filesystems/dlmfs.txt
4359F: fs/ocfs2/ 3779F: fs/ocfs2/
4360 3780
4361ORINOCO DRIVER 3781ORINOCO DRIVER
4362P: Pavel Roskin 3782M: Pavel Roskin <proski@gnu.org>
4363M: proski@gnu.org 3783M: David Gibson <hermes@gibson.dropbear.id.au>
4364P: David Gibson
4365M: hermes@gibson.dropbear.id.au
4366L: linux-wireless@vger.kernel.org 3784L: linux-wireless@vger.kernel.org
4367L: orinoco-users@lists.sourceforge.net 3785L: orinoco-users@lists.sourceforge.net
4368L: orinoco-devel@lists.sourceforge.net 3786L: orinoco-devel@lists.sourceforge.net
@@ -4370,19 +3788,19 @@ W: http://www.nongnu.org/orinoco/
4370S: Maintained 3788S: Maintained
4371F: drivers/net/wireless/orinoco/ 3789F: drivers/net/wireless/orinoco/
4372 3790
4373OSD LIBRARY 3791OSD LIBRARY and FILESYSTEM
4374P: Boaz Harrosh 3792M: Boaz Harrosh <bharrosh@panasas.com>
4375M: bharrosh@panasas.com 3793M: Benny Halevy <bhalevy@panasas.com>
4376P: Benny Halevy
4377M: bhalevy@panasas.com
4378L: osd-dev@open-osd.org 3794L: osd-dev@open-osd.org
4379W: http://open-osd.org 3795W: http://open-osd.org
4380T: git git://git.open-osd.org/open-osd.git 3796T: git git://git.open-osd.org/open-osd.git
4381S: Maintained 3797S: Maintained
3798F: drivers/scsi/osd/
3799F: drivers/include/scsi/osd_*
3800F: fs/exofs/
4382 3801
4383P54 WIRELESS DRIVER 3802P54 WIRELESS DRIVER
4384P: Michael Wu 3803M: Michael Wu <flamingice@sourmilk.net>
4385M: flamingice@sourmilk.net
4386L: linux-wireless@vger.kernel.org 3804L: linux-wireless@vger.kernel.org
4387W: http://prism54.org 3805W: http://prism54.org
4388T: git git://git.kernel.org/pub/scm/linux/kernel/git/mwu/mac80211-drivers.git 3806T: git git://git.kernel.org/pub/scm/linux/kernel/git/mwu/mac80211-drivers.git
@@ -4390,30 +3808,25 @@ S: Maintained
4390F: drivers/net/wireless/p54/ 3808F: drivers/net/wireless/p54/
4391 3809
4392PA SEMI ETHERNET DRIVER 3810PA SEMI ETHERNET DRIVER
4393P: Olof Johansson 3811M: Olof Johansson <olof@lixom.net>
4394M: olof@lixom.net
4395L: netdev@vger.kernel.org 3812L: netdev@vger.kernel.org
4396S: Maintained 3813S: Maintained
4397F: drivers/net/pasemi_mac.* 3814F: drivers/net/pasemi_mac.*
4398 3815
4399PA SEMI SMBUS DRIVER 3816PA SEMI SMBUS DRIVER
4400P: Olof Johansson 3817M: Olof Johansson <olof@lixom.net>
4401M: olof@lixom.net
4402L: linux-i2c@vger.kernel.org 3818L: linux-i2c@vger.kernel.org
4403S: Maintained 3819S: Maintained
4404F: drivers/i2c/busses/i2c-pasemi.c 3820F: drivers/i2c/busses/i2c-pasemi.c
4405 3821
4406PANASONIC LAPTOP ACPI EXTRAS DRIVER 3822PANASONIC LAPTOP ACPI EXTRAS DRIVER
4407P: Harald Welte 3823M: Harald Welte <laforge@gnumonks.org>
4408M: laforge@gnumonks.org
4409S: Maintained 3824S: Maintained
4410F: drivers/platform/x86/panasonic-laptop.c 3825F: drivers/platform/x86/panasonic-laptop.c
4411 3826
4412PANASONIC MN10300/AM33 PORT 3827PANASONIC MN10300/AM33 PORT
4413P: David Howells 3828M: David Howells <dhowells@redhat.com>
4414M: dhowells@redhat.com 3829M: Koichi Yasutake <yasutake.koichi@jp.panasonic.com>
4415P: Koichi Yasutake
4416M: yasutake.koichi@jp.panasonic.com
4417L: linux-am33-list@redhat.com (moderated for non-subscribers) 3830L: linux-am33-list@redhat.com (moderated for non-subscribers)
4418W: ftp://ftp.redhat.com/pub/redhat/gnupro/AM33/ 3831W: ftp://ftp.redhat.com/pub/redhat/gnupro/AM33/
4419S: Maintained 3832S: Maintained
@@ -4429,14 +3842,10 @@ F: drivers/char/ppdev.c
4429F: include/linux/ppdev.h 3842F: include/linux/ppdev.h
4430 3843
4431PARAVIRT_OPS INTERFACE 3844PARAVIRT_OPS INTERFACE
4432P: Jeremy Fitzhardinge 3845M: Jeremy Fitzhardinge <jeremy@xensource.com>
4433M: jeremy@xensource.com 3846M: Chris Wright <chrisw@sous-sol.org>
4434P: Chris Wright 3847M: Alok Kataria <akataria@vmware.com>
4435M: chrisw@sous-sol.org 3848M: Rusty Russell <rusty@rustcorp.com.au>
4436P: Alok Kataria
4437M: akataria@vmware.com
4438P: Rusty Russell
4439M: rusty@rustcorp.com.au
4440L: virtualization@lists.osdl.org 3849L: virtualization@lists.osdl.org
4441S: Supported 3850S: Supported
4442F: Documentation/ia64/paravirt_ops.txt 3851F: Documentation/ia64/paravirt_ops.txt
@@ -4444,8 +3853,7 @@ F: arch/*/kernel/paravirt*
4444F: arch/*/include/asm/paravirt.h 3853F: arch/*/include/asm/paravirt.h
4445 3854
4446PARIDE DRIVERS FOR PARALLEL PORT IDE DEVICES 3855PARIDE DRIVERS FOR PARALLEL PORT IDE DEVICES
4447P: Tim Waugh 3856M: Tim Waugh <tim@cyberelk.net>
4448M: tim@cyberelk.net
4449L: linux-parport@lists.infradead.org (subscribers-only) 3857L: linux-parport@lists.infradead.org (subscribers-only)
4450W: http://www.torque.net/linux-pp.html 3858W: http://www.torque.net/linux-pp.html
4451S: Maintained 3859S: Maintained
@@ -4453,10 +3861,8 @@ F: Documentation/blockdev/paride.txt
4453F: drivers/block/paride/ 3861F: drivers/block/paride/
4454 3862
4455PARISC ARCHITECTURE 3863PARISC ARCHITECTURE
4456P: Kyle McMartin 3864M: Kyle McMartin <kyle@mcmartin.ca>
4457M: kyle@mcmartin.ca 3865M: Helge Deller <deller@gmx.de>
4458P: Helge Deller
4459M: deller@gmx.de
4460L: linux-parisc@vger.kernel.org 3866L: linux-parisc@vger.kernel.org
4461W: http://www.parisc-linux.org/ 3867W: http://www.parisc-linux.org/
4462T: git git://git.kernel.org/pub/scm/linux/kernel/git/kyle/parisc-2.6.git 3868T: git git://git.kernel.org/pub/scm/linux/kernel/git/kyle/parisc-2.6.git
@@ -4465,37 +3871,32 @@ F: arch/parisc/
4465F: drivers/parisc/ 3871F: drivers/parisc/
4466 3872
4467PC87360 HARDWARE MONITORING DRIVER 3873PC87360 HARDWARE MONITORING DRIVER
4468P: Jim Cromie 3874M: Jim Cromie <jim.cromie@gmail.com>
4469M: jim.cromie@gmail.com
4470L: lm-sensors@lm-sensors.org 3875L: lm-sensors@lm-sensors.org
4471S: Maintained 3876S: Maintained
4472F: Documentation/hwmon/pc87360 3877F: Documentation/hwmon/pc87360
4473F: drivers/hwmon/pc87360.c 3878F: drivers/hwmon/pc87360.c
4474 3879
4475PC8736x GPIO DRIVER 3880PC8736x GPIO DRIVER
4476P: Jim Cromie 3881M: Jim Cromie <jim.cromie@gmail.com>
4477M: jim.cromie@gmail.com
4478S: Maintained 3882S: Maintained
4479F: drivers/char/pc8736x_gpio.c 3883F: drivers/char/pc8736x_gpio.c
4480 3884
4481PCA9532 LED DRIVER 3885PCA9532 LED DRIVER
4482P: Riku Voipio 3886M: Riku Voipio <riku.voipio@iki.fi>
4483M: riku.voipio@iki.fi
4484S: Maintained 3887S: Maintained
4485F: drivers/leds/leds-pca9532.c 3888F: drivers/leds/leds-pca9532.c
4486F: include/linux/leds-pca9532.h 3889F: include/linux/leds-pca9532.h
4487 3890
4488PCI ERROR RECOVERY 3891PCI ERROR RECOVERY
4489P: Linas Vepstas 3892M: Linas Vepstas <linas@austin.ibm.com>
4490M: linas@austin.ibm.com
4491L: linux-pci@vger.kernel.org 3893L: linux-pci@vger.kernel.org
4492S: Supported 3894S: Supported
4493F: Documentation/PCI/pci-error-recovery.txt 3895F: Documentation/PCI/pci-error-recovery.txt
4494F: Documentation/powerpc/eeh-pci-error-recovery.txt 3896F: Documentation/powerpc/eeh-pci-error-recovery.txt
4495 3897
4496PCI SUBSYSTEM 3898PCI SUBSYSTEM
4497P: Jesse Barnes 3899M: Jesse Barnes <jbarnes@virtuousgeek.org>
4498M: jbarnes@virtuousgeek.org
4499L: linux-pci@vger.kernel.org 3900L: linux-pci@vger.kernel.org
4500T: git git://git.kernel.org/pub/scm/linux/kernel/git/jbarnes/pci-2.6.git 3901T: git git://git.kernel.org/pub/scm/linux/kernel/git/jbarnes/pci-2.6.git
4501S: Supported 3902S: Supported
@@ -4504,8 +3905,7 @@ F: drivers/pci/
4504F: include/linux/pci* 3905F: include/linux/pci*
4505 3906
4506PCIE HOTPLUG DRIVER 3907PCIE HOTPLUG DRIVER
4507P: Kristen Carlson Accardi 3908M: Kristen Carlson Accardi <kristen.c.accardi@intel.com>
4508M: kristen.c.accardi@intel.com
4509L: linux-pci@vger.kernel.org 3909L: linux-pci@vger.kernel.org
4510S: Supported 3910S: Supported
4511F: drivers/pci/pcie/ 3911F: drivers/pci/pcie/
@@ -4521,121 +3921,103 @@ F: drivers/pcmcia/
4521F: include/pcmcia/ 3921F: include/pcmcia/
4522 3922
4523PCNET32 NETWORK DRIVER 3923PCNET32 NETWORK DRIVER
4524P: Don Fry 3924M: Don Fry <pcnet32@verizon.net>
4525M: pcnet32@verizon.net
4526L: netdev@vger.kernel.org 3925L: netdev@vger.kernel.org
4527S: Maintained 3926S: Maintained
4528F: drivers/net/pcnet32.c 3927F: drivers/net/pcnet32.c
4529 3928
4530PER-TASK DELAY ACCOUNTING 3929PER-TASK DELAY ACCOUNTING
4531P: Balbir Singh 3930M: Balbir Singh <balbir@linux.vnet.ibm.com>
4532M: balbir@linux.vnet.ibm.com
4533S: Maintained 3931S: Maintained
4534F: include/linux/delayacct.h 3932F: include/linux/delayacct.h
4535F: kernel/delayacct.c 3933F: kernel/delayacct.c
4536 3934
4537PERFORMANCE COUNTER SUBSYSTEM 3935PERFORMANCE COUNTER SUBSYSTEM
4538P: Peter Zijlstra 3936M: Peter Zijlstra <a.p.zijlstra@chello.nl>
4539M: a.p.zijlstra@chello.nl 3937M: Paul Mackerras <paulus@samba.org>
4540P: Paul Mackerras 3938M: Ingo Molnar <mingo@elte.hu>
4541M: paulus@samba.org
4542P: Ingo Molnar
4543M: mingo@elte.hu
4544L: linux-kernel@vger.kernel.org
4545S: Supported 3939S: Supported
4546 3940
4547PERSONALITY HANDLING 3941PERSONALITY HANDLING
4548P: Christoph Hellwig 3942M: Christoph Hellwig <hch@infradead.org>
4549M: hch@infradead.org
4550L: linux-abi-devel@lists.sourceforge.net 3943L: linux-abi-devel@lists.sourceforge.net
4551S: Maintained 3944S: Maintained
4552F: include/linux/personality.h 3945F: include/linux/personality.h
4553 3946
4554PHRAM MTD DRIVER 3947PHRAM MTD DRIVER
4555P: Joern Engel 3948M: Joern Engel <joern@lazybastard.org>
4556M: joern@lazybastard.org
4557L: linux-mtd@lists.infradead.org 3949L: linux-mtd@lists.infradead.org
4558S: Maintained 3950S: Maintained
4559F: drivers/mtd/devices/phram.c 3951F: drivers/mtd/devices/phram.c
4560 3952
4561PKTCDVD DRIVER 3953PKTCDVD DRIVER
4562P: Peter Osterlund 3954M: Peter Osterlund <petero2@telia.com>
4563M: petero2@telia.com
4564S: Maintained 3955S: Maintained
4565F: drivers/block/pktcdvd.c 3956F: drivers/block/pktcdvd.c
4566F: include/linux/pktcdvd.h 3957F: include/linux/pktcdvd.h
4567 3958
4568POSIX CLOCKS and TIMERS 3959POSIX CLOCKS and TIMERS
4569P: Thomas Gleixner 3960M: Thomas Gleixner <tglx@linutronix.de>
4570M: tglx@linutronix.de
4571S: Supported 3961S: Supported
4572F: fs/timerfd.c 3962F: fs/timerfd.c
4573F: include/linux/timer* 3963F: include/linux/timer*
4574F: kernel/*timer* 3964F: kernel/*timer*
4575 3965
4576POWER SUPPLY CLASS/SUBSYSTEM and DRIVERS 3966POWER SUPPLY CLASS/SUBSYSTEM and DRIVERS
4577P: Anton Vorontsov 3967M: Anton Vorontsov <cbou@mail.ru>
4578M: cbou@mail.ru 3968M: David Woodhouse <dwmw2@infradead.org>
4579P: David Woodhouse
4580M: dwmw2@infradead.org
4581T: git git://git.infradead.org/battery-2.6.git 3969T: git git://git.infradead.org/battery-2.6.git
4582S: Maintained 3970S: Maintained
4583F: include/linux/power_supply.h 3971F: include/linux/power_supply.h
4584F: drivers/power/power_supply* 3972F: drivers/power/power_supply*
4585 3973
4586PNP SUPPORT 3974PNP SUPPORT
4587P: Adam Belay 3975M: Adam Belay <abelay@mit.edu>
4588M: abelay@mit.edu 3976M: Bjorn Helgaas <bjorn.helgaas@hp.com>
4589P: Bjorn Helgaas
4590M: bjorn.helgaas@hp.com
4591S: Maintained 3977S: Maintained
4592F: drivers/pnp/ 3978F: drivers/pnp/
4593 3979
4594PNXxxxx I2C DRIVER 3980PNXxxxx I2C DRIVER
4595P: Vitaly Wool 3981M: Vitaly Wool <vitalywool@gmail.com>
4596M: vitalywool@gmail.com
4597L: linux-i2c@vger.kernel.org 3982L: linux-i2c@vger.kernel.org
4598S: Maintained 3983S: Maintained
4599F: drivers/i2c/busses/i2c-pnx.c 3984F: drivers/i2c/busses/i2c-pnx.c
4600 3985
4601PPP PROTOCOL DRIVERS AND COMPRESSORS 3986PPP PROTOCOL DRIVERS AND COMPRESSORS
4602P: Paul Mackerras 3987M: Paul Mackerras <paulus@samba.org>
4603M: paulus@samba.org
4604L: linux-ppp@vger.kernel.org 3988L: linux-ppp@vger.kernel.org
4605S: Maintained 3989S: Maintained
4606F: drivers/net/ppp_* 3990F: drivers/net/ppp_*
4607 3991
4608PPP OVER ATM (RFC 2364) 3992PPP OVER ATM (RFC 2364)
4609P: Mitchell Blank Jr 3993M: Mitchell Blank Jr <mitch@sfgoth.com>
4610M: mitch@sfgoth.com
4611S: Maintained 3994S: Maintained
4612F: net/atm/pppoatm.c 3995F: net/atm/pppoatm.c
4613F: include/linux/atmppp.h 3996F: include/linux/atmppp.h
4614 3997
4615PPP OVER ETHERNET 3998PPP OVER ETHERNET
4616P: Michal Ostrowski 3999M: Michal Ostrowski <mostrows@earthlink.net>
4617M: mostrows@earthlink.net
4618S: Maintained 4000S: Maintained
4619F: drivers/net/pppoe.c 4001F: drivers/net/pppoe.c
4620F: drivers/net/pppox.c 4002F: drivers/net/pppox.c
4621 4003
4622PPP OVER L2TP 4004PPP OVER L2TP
4623P: James Chapman 4005M: James Chapman <jchapman@katalix.com>
4624M: jchapman@katalix.com
4625S: Maintained 4006S: Maintained
4626F: drivers/net/pppol2tp.c 4007F: drivers/net/pppol2tp.c
4627F: include/linux/if_pppol2tp.h 4008F: include/linux/if_pppol2tp.h
4628 4009
4629PPS SUPPORT 4010PPS SUPPORT
4630P: Rodolfo Giometti 4011M: Rodolfo Giometti <giometti@enneenne.com>
4631M: giometti@enneenne.com
4632W: http://wiki.enneenne.com/index.php/LinuxPPS_support 4012W: http://wiki.enneenne.com/index.php/LinuxPPS_support
4633L: linuxpps@ml.enneenne.com (subscribers-only) 4013L: linuxpps@ml.enneenne.com (subscribers-only)
4634S: Maintained 4014S: Maintained
4015F: Documentation/pps/
4016F: drivers/pps/
4017F: include/linux/pps*.h
4635 4018
4636PREEMPTIBLE KERNEL 4019PREEMPTIBLE KERNEL
4637P: Robert Love 4020M: Robert Love <rml@tech9.net>
4638M: rml@tech9.net
4639L: kpreempt-tech@lists.sourceforge.net 4021L: kpreempt-tech@lists.sourceforge.net
4640W: ftp://ftp.kernel.org/pub/linux/kernel/people/rml/preempt-kernel 4022W: ftp://ftp.kernel.org/pub/linux/kernel/people/rml/preempt-kernel
4641S: Supported 4023S: Supported
@@ -4643,37 +4025,32 @@ F: Documentation/preempt-locking.txt
4643F: include/linux/preempt.h 4025F: include/linux/preempt.h
4644 4026
4645PRISM54 WIRELESS DRIVER 4027PRISM54 WIRELESS DRIVER
4646P: Luis R. Rodriguez 4028M: "Luis R. Rodriguez" <mcgrof@gmail.com>
4647M: mcgrof@gmail.com
4648L: linux-wireless@vger.kernel.org 4029L: linux-wireless@vger.kernel.org
4649W: http://prism54.org 4030W: http://prism54.org
4650S: Maintained 4031S: Maintained
4651F: drivers/net/wireless/prism54/ 4032F: drivers/net/wireless/prism54/
4652 4033
4653PROMISE DC4030 CACHING DISK CONTROLLER DRIVER 4034PROMISE DC4030 CACHING DISK CONTROLLER DRIVER
4654P: Peter Denison 4035M: Peter Denison <promise@pnd-pc.demon.co.uk>
4655M: promise@pnd-pc.demon.co.uk
4656W: http://www.pnd-pc.demon.co.uk/promise/ 4036W: http://www.pnd-pc.demon.co.uk/promise/
4657S: Maintained 4037S: Maintained
4658 4038
4659PROMISE SATA TX2/TX4 CONTROLLER LIBATA DRIVER 4039PROMISE SATA TX2/TX4 CONTROLLER LIBATA DRIVER
4660P: Mikael Pettersson 4040M: Mikael Pettersson <mikpe@it.uu.se>
4661M: mikpe@it.uu.se
4662L: linux-ide@vger.kernel.org 4041L: linux-ide@vger.kernel.org
4663S: Maintained 4042S: Maintained
4664F: drivers/ata/sata_promise.* 4043F: drivers/ata/sata_promise.*
4665 4044
4666PS3 NETWORK SUPPORT 4045PS3 NETWORK SUPPORT
4667P: Geoff Levand 4046M: Geoff Levand <geoffrey.levand@am.sony.com>
4668M: geoffrey.levand@am.sony.com
4669L: netdev@vger.kernel.org 4047L: netdev@vger.kernel.org
4670L: cbe-oss-dev@ozlabs.org 4048L: cbe-oss-dev@ozlabs.org
4671S: Supported 4049S: Supported
4672F: drivers/net/ps3_gelic_net.* 4050F: drivers/net/ps3_gelic_net.*
4673 4051
4674PS3 PLATFORM SUPPORT 4052PS3 PLATFORM SUPPORT
4675P: Geoff Levand 4053M: Geoff Levand <geoffrey.levand@am.sony.com>
4676M: geoffrey.levand@am.sony.com
4677L: linuxppc-dev@ozlabs.org 4054L: linuxppc-dev@ozlabs.org
4678L: cbe-oss-dev@ozlabs.org 4055L: cbe-oss-dev@ozlabs.org
4679S: Supported 4056S: Supported
@@ -4688,16 +4065,13 @@ F: drivers/usb/host/*ps3.c
4688F: sound/ppc/snd_ps3* 4065F: sound/ppc/snd_ps3*
4689 4066
4690PS3VRAM DRIVER 4067PS3VRAM DRIVER
4691P: Jim Paris 4068M: Jim Paris <jim@jtan.com>
4692M: jim@jtan.com
4693L: cbe-oss-dev@ozlabs.org 4069L: cbe-oss-dev@ozlabs.org
4694S: Maintained 4070S: Maintained
4695 4071
4696PTRACE SUPPORT 4072PTRACE SUPPORT
4697P: Roland McGrath 4073M: Roland McGrath <roland@redhat.com>
4698M: roland@redhat.com 4074M: Oleg Nesterov <oleg@redhat.com>
4699P: Oleg Nesterov
4700M: oleg@redhat.com
4701S: Maintained 4075S: Maintained
4702F: include/asm-generic/syscall.h 4076F: include/asm-generic/syscall.h
4703F: include/linux/ptrace.h 4077F: include/linux/ptrace.h
@@ -4706,8 +4080,7 @@ F: include/linux/tracehook.h
4706F: kernel/ptrace.c 4080F: kernel/ptrace.c
4707 4081
4708PVRUSB2 VIDEO4LINUX DRIVER 4082PVRUSB2 VIDEO4LINUX DRIVER
4709P: Mike Isely 4083M: Mike Isely <isely@pobox.com>
4710M: isely@pobox.com
4711L: pvrusb2@isely.net (subscribers-only) 4084L: pvrusb2@isely.net (subscribers-only)
4712L: linux-media@vger.kernel.org 4085L: linux-media@vger.kernel.org
4713W: http://www.isely.net/pvrusb2/ 4086W: http://www.isely.net/pvrusb2/
@@ -4717,10 +4090,8 @@ F: Documentation/video4linux/README.pvrusb2
4717F: drivers/media/video/pvrusb2/ 4090F: drivers/media/video/pvrusb2/
4718 4091
4719PXA2xx/PXA3xx SUPPORT 4092PXA2xx/PXA3xx SUPPORT
4720P: Eric Miao 4093M: Eric Miao <eric.y.miao@gmail.com>
4721M: eric.y.miao@gmail.com 4094M: Russell King <linux@arm.linux.org.uk>
4722P: Russell King
4723M: linux@arm.linux.org.uk
4724L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only) 4095L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only)
4725S: Maintained 4096S: Maintained
4726F: arch/arm/mach-pxa/ 4097F: arch/arm/mach-pxa/
@@ -4732,17 +4103,14 @@ F: sound/arm/pxa*
4732F: sound/soc/pxa 4103F: sound/soc/pxa
4733 4104
4734PXA168 SUPPORT 4105PXA168 SUPPORT
4735P: Eric Miao 4106M: Eric Miao <eric.y.miao@gmail.com>
4736M: eric.y.miao@gmail.com 4107M: Jason Chagas <jason.chagas@marvell.com>
4737P: Jason Chagas
4738M: jason.chagas@marvell.com
4739L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only) 4108L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only)
4740T: git git://git.kernel.org/pub/scm/linux/kernel/git/ycmiao/pxa-linux-2.6.git 4109T: git git://git.kernel.org/pub/scm/linux/kernel/git/ycmiao/pxa-linux-2.6.git
4741S: Maintained 4110S: Maintained
4742 4111
4743PXA910 SUPPORT 4112PXA910 SUPPORT
4744P: Eric Miao 4113M: Eric Miao <eric.y.miao@gmail.com>
4745M: eric.y.miao@gmail.com
4746L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only) 4114L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only)
4747T: git git://git.kernel.org/pub/scm/linux/kernel/git/ycmiao/pxa-linux-2.6.git 4115T: git git://git.kernel.org/pub/scm/linux/kernel/git/ycmiao/pxa-linux-2.6.git
4748S: Maintained 4116S: Maintained
@@ -4751,13 +4119,12 @@ PXA MMCI DRIVER
4751S: Orphan 4119S: Orphan
4752 4120
4753PXA RTC DRIVER 4121PXA RTC DRIVER
4754P: Robert Jarzmik 4122M: Robert Jarzmik <robert.jarzmik@free.fr>
4755M: robert.jarzmik@free.fr
4756L: rtc-linux@googlegroups.com 4123L: rtc-linux@googlegroups.com
4757S: Maintained 4124S: Maintained
4758 4125
4759QLOGIC QLA2XXX FC-SCSI DRIVER 4126QLOGIC QLA2XXX FC-SCSI DRIVER
4760P: Andrew Vasquez 4127M: Andrew Vasquez <andrew.vasquez@qlogic.com>
4761M: linux-driver@qlogic.com 4128M: linux-driver@qlogic.com
4762L: linux-scsi@vger.kernel.org 4129L: linux-scsi@vger.kernel.org
4763S: Supported 4130S: Supported
@@ -4765,7 +4132,7 @@ F: Documentation/scsi/LICENSE.qla2xxx
4765F: drivers/scsi/qla2xxx/ 4132F: drivers/scsi/qla2xxx/
4766 4133
4767QLOGIC QLA3XXX NETWORK DRIVER 4134QLOGIC QLA3XXX NETWORK DRIVER
4768P: Ron Mercer 4135M: Ron Mercer <ron.mercer@qlogic.com>
4769M: linux-driver@qlogic.com 4136M: linux-driver@qlogic.com
4770L: netdev@vger.kernel.org 4137L: netdev@vger.kernel.org
4771S: Supported 4138S: Supported
@@ -4773,16 +4140,14 @@ F: Documentation/networking/LICENSE.qla3xxx
4773F: drivers/net/qla3xxx.* 4140F: drivers/net/qla3xxx.*
4774 4141
4775QLOGIC QLGE 10Gb ETHERNET DRIVER 4142QLOGIC QLGE 10Gb ETHERNET DRIVER
4776P: Ron Mercer 4143M: Ron Mercer <ron.mercer@qlogic.com>
4777M: linux-driver@qlogic.com 4144M: linux-driver@qlogic.com
4778M: ron.mercer@qlogic.com
4779L: netdev@vger.kernel.org 4145L: netdev@vger.kernel.org
4780S: Supported 4146S: Supported
4781F: drivers/net/qlge/ 4147F: drivers/net/qlge/
4782 4148
4783QNX4 FILESYSTEM 4149QNX4 FILESYSTEM
4784P: Anders Larsen 4150M: Anders Larsen <al@alarsen.net>
4785M: al@alarsen.net
4786W: http://www.alarsen.net/linux/qnx4fs/ 4151W: http://www.alarsen.net/linux/qnx4fs/
4787S: Maintained 4152S: Maintained
4788F: fs/qnx4/ 4153F: fs/qnx4/
@@ -4790,16 +4155,14 @@ F: include/linux/qnx4_fs.h
4790F: include/linux/qnxtypes.h 4155F: include/linux/qnxtypes.h
4791 4156
4792RADEON FRAMEBUFFER DISPLAY DRIVER 4157RADEON FRAMEBUFFER DISPLAY DRIVER
4793P: Benjamin Herrenschmidt 4158M: Benjamin Herrenschmidt <benh@kernel.crashing.org>
4794M: benh@kernel.crashing.org
4795L: linux-fbdev-devel@lists.sourceforge.net (moderated for non-subscribers) 4159L: linux-fbdev-devel@lists.sourceforge.net (moderated for non-subscribers)
4796S: Maintained 4160S: Maintained
4797F: drivers/video/aty/radeon* 4161F: drivers/video/aty/radeon*
4798F: include/linux/radeonfb.h 4162F: include/linux/radeonfb.h
4799 4163
4800RAGE128 FRAMEBUFFER DISPLAY DRIVER 4164RAGE128 FRAMEBUFFER DISPLAY DRIVER
4801P: Paul Mackerras 4165M: Paul Mackerras <paulus@samba.org>
4802M: paulus@samba.org
4803L: linux-fbdev-devel@lists.sourceforge.net (moderated for non-subscribers) 4166L: linux-fbdev-devel@lists.sourceforge.net (moderated for non-subscribers)
4804S: Maintained 4167S: Maintained
4805F: drivers/video/aty/aty128fb.c 4168F: drivers/video/aty/aty128fb.c
@@ -4814,64 +4177,53 @@ T: git git://git.kernel.org/pub/scm/linux/kernel/git/ivd/rt2x00.git
4814F: drivers/net/wireless/rt2x00/ 4177F: drivers/net/wireless/rt2x00/
4815 4178
4816RAMDISK RAM BLOCK DEVICE DRIVER 4179RAMDISK RAM BLOCK DEVICE DRIVER
4817P: Nick Piggin 4180M: Nick Piggin <npiggin@suse.de>
4818M: npiggin@suse.de
4819S: Maintained 4181S: Maintained
4820F: Documentation/blockdev/ramdisk.txt 4182F: Documentation/blockdev/ramdisk.txt
4821F: drivers/block/brd.c 4183F: drivers/block/brd.c
4822 4184
4823RANDOM NUMBER DRIVER 4185RANDOM NUMBER DRIVER
4824P: Matt Mackall 4186M: Matt Mackall <mpm@selenic.com>
4825M: mpm@selenic.com
4826S: Maintained 4187S: Maintained
4827F: drivers/char/random.c 4188F: drivers/char/random.c
4828 4189
4829RAPIDIO SUBSYSTEM 4190RAPIDIO SUBSYSTEM
4830P: Matt Porter 4191M: Matt Porter <mporter@kernel.crashing.org>
4831M: mporter@kernel.crashing.org
4832S: Maintained 4192S: Maintained
4833F: drivers/rapidio/ 4193F: drivers/rapidio/
4834 4194
4835RAYLINK/WEBGEAR 802.11 WIRELESS LAN DRIVER 4195RAYLINK/WEBGEAR 802.11 WIRELESS LAN DRIVER
4836P: Corey Thomas 4196M: Corey Thomas <coreythomas@charter.net>
4837M: coreythomas@charter.net
4838L: linux-wireless@vger.kernel.org 4197L: linux-wireless@vger.kernel.org
4839S: Maintained 4198S: Maintained
4840F: drivers/net/wireless/ray* 4199F: drivers/net/wireless/ray*
4841 4200
4842RCUTORTURE MODULE 4201RCUTORTURE MODULE
4843P: Josh Triplett 4202M: Josh Triplett <josh@freedesktop.org>
4844M: josh@freedesktop.org 4203M: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
4845P: Paul E. McKenney
4846M: paulmck@linux.vnet.ibm.com
4847S: Maintained 4204S: Maintained
4848F: Documentation/RCU/torture.txt 4205F: Documentation/RCU/torture.txt
4849F: kernel/rcutorture.c 4206F: kernel/rcutorture.c
4850 4207
4851RDC R-321X SoC 4208RDC R-321X SoC
4852P: Florian Fainelli 4209M: Florian Fainelli <florian@openwrt.org>
4853M: florian@openwrt.org
4854S: Maintained 4210S: Maintained
4855 4211
4856RDC R6040 FAST ETHERNET DRIVER 4212RDC R6040 FAST ETHERNET DRIVER
4857P: Florian Fainelli 4213M: Florian Fainelli <florian@openwrt.org>
4858M: florian@openwrt.org
4859L: netdev@vger.kernel.org 4214L: netdev@vger.kernel.org
4860S: Maintained 4215S: Maintained
4861F: drivers/net/r6040.c 4216F: drivers/net/r6040.c
4862 4217
4863RDS - RELIABLE DATAGRAM SOCKETS 4218RDS - RELIABLE DATAGRAM SOCKETS
4864P: Andy Grover 4219M: Andy Grover <andy.grover@oracle.com>
4865M: andy.grover@oracle.com
4866L: rds-devel@oss.oracle.com (moderated for non-subscribers) 4220L: rds-devel@oss.oracle.com (moderated for non-subscribers)
4867S: Supported 4221S: Supported
4868F: net/rds/ 4222F: net/rds/
4869 4223
4870READ-COPY UPDATE (RCU) 4224READ-COPY UPDATE (RCU)
4871P: Dipankar Sarma 4225M: Dipankar Sarma <dipankar@in.ibm.com>
4872M: dipankar@in.ibm.com 4226M: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
4873P: Paul E. McKenney
4874M: paulmck@linux.vnet.ibm.com
4875W: http://www.rdrop.com/users/paulmck/rclock/ 4227W: http://www.rdrop.com/users/paulmck/rclock/
4876S: Supported 4228S: Supported
4877F: Documentation/RCU/rcu.txt 4229F: Documentation/RCU/rcu.txt
@@ -4881,16 +4233,14 @@ F: include/linux/srcu.h
4881F: kernel/rcupdate.c 4233F: kernel/rcupdate.c
4882 4234
4883REAL TIME CLOCK DRIVER 4235REAL TIME CLOCK DRIVER
4884P: Paul Gortmaker 4236M: Paul Gortmaker <p_gortmaker@yahoo.com>
4885M: p_gortmaker@yahoo.com
4886S: Maintained 4237S: Maintained
4887F: Documentation/rtc.txt 4238F: Documentation/rtc.txt
4888F: drivers/rtc/ 4239F: drivers/rtc/
4889F: include/linux/rtc.h 4240F: include/linux/rtc.h
4890 4241
4891REAL TIME CLOCK (RTC) SUBSYSTEM 4242REAL TIME CLOCK (RTC) SUBSYSTEM
4892P: Alessandro Zummo 4243M: Alessandro Zummo <a.zummo@towertech.it>
4893M: a.zummo@towertech.it
4894L: rtc-linux@googlegroups.com 4244L: rtc-linux@googlegroups.com
4895S: Maintained 4245S: Maintained
4896F: Documentation/rtc.txt 4246F: Documentation/rtc.txt
@@ -4903,8 +4253,7 @@ S: Supported
4903F: fs/reiserfs/ 4253F: fs/reiserfs/
4904 4254
4905RFKILL 4255RFKILL
4906P: Johannes Berg 4256M: Johannes Berg <johannes@sipsolutions.net>
4907M: johannes@sipsolutions.net
4908L: linux-wireless@vger.kernel.org 4257L: linux-wireless@vger.kernel.org
4909S: Maintained 4258S: Maintained
4910F Documentation/rfkill.txt 4259F Documentation/rfkill.txt
@@ -4923,8 +4272,7 @@ F: Documentation/serial/rocket.txt
4923F: drivers/char/rocket* 4272F: drivers/char/rocket*
4924 4273
4925ROSE NETWORK LAYER 4274ROSE NETWORK LAYER
4926P: Ralf Baechle 4275M: Ralf Baechle <ralf@linux-mips.org>
4927M: ralf@linux-mips.org
4928L: linux-hams@vger.kernel.org 4276L: linux-hams@vger.kernel.org
4929W: http://www.linux-ax25.org/ 4277W: http://www.linux-ax25.org/
4930S: Maintained 4278S: Maintained
@@ -4933,8 +4281,7 @@ F: include/net/rose.h
4933F: net/rose/ 4281F: net/rose/
4934 4282
4935RTL8180 WIRELESS DRIVER 4283RTL8180 WIRELESS DRIVER
4936P: John W. Linville 4284M: "John W. Linville" <linville@tuxdriver.com>
4937M: linville@tuxdriver.com
4938L: linux-wireless@vger.kernel.org 4285L: linux-wireless@vger.kernel.org
4939W: http://linuxwireless.org/ 4286W: http://linuxwireless.org/
4940T: git git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-testing.git 4287T: git git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-testing.git
@@ -4942,12 +4289,9 @@ S: Maintained
4942F: drivers/net/wireless/rtl818* 4289F: drivers/net/wireless/rtl818*
4943 4290
4944RTL8187 WIRELESS DRIVER 4291RTL8187 WIRELESS DRIVER
4945P: Herton Ronaldo Krzesinski 4292M: Herton Ronaldo Krzesinski <herton@mandriva.com.br>
4946M: herton@mandriva.com.br 4293M: Hin-Tak Leung <htl10@users.sourceforge.net>
4947P: Hin-Tak Leung 4294M: Larry Finger <Larry.Finger@lwfinger.net>
4948M: htl10@users.sourceforge.net
4949P: Larry Finger
4950M: Larry.Finger@lwfinger.net
4951L: linux-wireless@vger.kernel.org 4295L: linux-wireless@vger.kernel.org
4952W: http://linuxwireless.org/ 4296W: http://linuxwireless.org/
4953T: git git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-testing.git 4297T: git git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-testing.git
@@ -4955,17 +4299,14 @@ S: Maintained
4955F: drivers/net/wireless/rtl818x/rtl8187* 4299F: drivers/net/wireless/rtl818x/rtl8187*
4956 4300
4957S3 SAVAGE FRAMEBUFFER DRIVER 4301S3 SAVAGE FRAMEBUFFER DRIVER
4958P: Antonino Daplas 4302M: Antonino Daplas <adaplas@gmail.com>
4959M: adaplas@gmail.com
4960L: linux-fbdev-devel@lists.sourceforge.net (moderated for non-subscribers) 4303L: linux-fbdev-devel@lists.sourceforge.net (moderated for non-subscribers)
4961S: Maintained 4304S: Maintained
4962F: drivers/video/savage/ 4305F: drivers/video/savage/
4963 4306
4964S390 4307S390
4965P: Martin Schwidefsky 4308M: Martin Schwidefsky <schwidefsky@de.ibm.com>
4966M: schwidefsky@de.ibm.com 4309M: Heiko Carstens <heiko.carstens@de.ibm.com>
4967P: Heiko Carstens
4968M: heiko.carstens@de.ibm.com
4969M: linux390@de.ibm.com 4310M: linux390@de.ibm.com
4970L: linux-s390@vger.kernel.org 4311L: linux-s390@vger.kernel.org
4971W: http://www.ibm.com/developerworks/linux/linux390/ 4312W: http://www.ibm.com/developerworks/linux/linux390/
@@ -4973,10 +4314,8 @@ S: Supported
4973F: arch/s390/ 4314F: arch/s390/
4974 4315
4975S390 NETWORK DRIVERS 4316S390 NETWORK DRIVERS
4976P: Ursula Braun 4317M: Ursula Braun <ursula.braun@de.ibm.com>
4977M: ursula.braun@de.ibm.com 4318M: Frank Blaschka <blaschka@linux.vnet.ibm.com>
4978P: Frank Blaschka
4979M: blaschka@linux.vnet.ibm.com
4980M: linux390@de.ibm.com 4319M: linux390@de.ibm.com
4981L: linux-s390@vger.kernel.org 4320L: linux-s390@vger.kernel.org
4982W: http://www.ibm.com/developerworks/linux/linux390/ 4321W: http://www.ibm.com/developerworks/linux/linux390/
@@ -4984,20 +4323,16 @@ S: Supported
4984F: drivers/s390/net/ 4323F: drivers/s390/net/
4985 4324
4986S390 ZCRYPT DRIVER 4325S390 ZCRYPT DRIVER
4987P: Felix Beck 4326M: Felix Beck <felix.beck@de.ibm.com>
4988M: felix.beck@de.ibm.com 4327M: Ralph Wuerthner <ralph.wuerthner@de.ibm.com>
4989P: Ralph Wuerthner
4990M: ralph.wuerthner@de.ibm.com
4991M: linux390@de.ibm.com 4328M: linux390@de.ibm.com
4992L: linux-s390@vger.kernel.org 4329L: linux-s390@vger.kernel.org
4993S: Supported 4330S: Supported
4994F: drivers/s390/crypto/ 4331F: drivers/s390/crypto/
4995 4332
4996S390 ZFCP DRIVER 4333S390 ZFCP DRIVER
4997P: Christof Schmitt 4334M: Christof Schmitt <christof.schmitt@de.ibm.com>
4998M: christof.schmitt@de.ibm.com 4335M: Martin Peschke <mp3@de.ibm.com>
4999P: Martin Peschke
5000M: mp3@de.ibm.com
5001M: linux390@de.ibm.com 4336M: linux390@de.ibm.com
5002L: linux-s390@vger.kernel.org 4337L: linux-s390@vger.kernel.org
5003W: http://www.ibm.com/developerworks/linux/linux390/ 4338W: http://www.ibm.com/developerworks/linux/linux390/
@@ -5006,8 +4341,7 @@ F: Documentation/s390/zfcpdump.txt
5006F: drivers/s390/scsi/zfcp_* 4341F: drivers/s390/scsi/zfcp_*
5007 4342
5008S390 IUCV NETWORK LAYER 4343S390 IUCV NETWORK LAYER
5009P: Ursula Braun 4344M: Ursula Braun <ursula.braun@de.ibm.com>
5010M: ursula.braun@de.ibm.com
5011M: linux390@de.ibm.com 4345M: linux390@de.ibm.com
5012L: linux-s390@vger.kernel.org 4346L: linux-s390@vger.kernel.org
5013W: http://www.ibm.com/developerworks/linux/linux390/ 4347W: http://www.ibm.com/developerworks/linux/linux390/
@@ -5017,15 +4351,13 @@ F: include/net/iucv/
5017F: net/iucv/ 4351F: net/iucv/
5018 4352
5019S3C24XX SD/MMC Driver 4353S3C24XX SD/MMC Driver
5020P: Ben Dooks 4354M: Ben Dooks <ben-linux@fluff.org>
5021M: ben-linux@fluff.org
5022L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only) 4355L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only)
5023S: Supported 4356S: Supported
5024F: drivers/mmc/host/s3cmci.* 4357F: drivers/mmc/host/s3cmci.*
5025 4358
5026SAA7146 VIDEO4LINUX-2 DRIVER 4359SAA7146 VIDEO4LINUX-2 DRIVER
5027P: Michael Hunold 4360M: Michael Hunold <michael@mihu.de>
5028M: michael@mihu.de
5029L: linux-media@vger.kernel.org 4361L: linux-media@vger.kernel.org
5030T: git git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6.git 4362T: git git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6.git
5031W: http://www.mihu.de/linux/saa7146 4363W: http://www.mihu.de/linux/saa7146
@@ -5035,31 +4367,26 @@ F: drivers/media/video/*7146*
5035F: include/media/*7146* 4367F: include/media/*7146*
5036 4368
5037SC1200 WDT DRIVER 4369SC1200 WDT DRIVER
5038P: Zwane Mwaikambo 4370M: Zwane Mwaikambo <zwane@arm.linux.org.uk>
5039M: zwane@arm.linux.org.uk
5040S: Maintained 4371S: Maintained
5041F: drivers/watchdog/sc1200wdt.c 4372F: drivers/watchdog/sc1200wdt.c
5042 4373
5043SCHEDULER 4374SCHEDULER
5044P: Ingo Molnar 4375M: Ingo Molnar <mingo@elte.hu>
5045M: mingo@elte.hu 4376M: Peter Zijlstra <peterz@infradead.org>
5046P: Peter Zijlstra
5047M: peterz@infradead.org
5048S: Maintained 4377S: Maintained
5049F: kernel/sched* 4378F: kernel/sched*
5050F: include/linux/sched.h 4379F: include/linux/sched.h
5051 4380
5052SCSI CDROM DRIVER 4381SCSI CDROM DRIVER
5053P: Jens Axboe 4382M: Jens Axboe <axboe@kernel.dk>
5054M: axboe@kernel.dk
5055L: linux-scsi@vger.kernel.org 4383L: linux-scsi@vger.kernel.org
5056W: http://www.kernel.dk 4384W: http://www.kernel.dk
5057S: Maintained 4385S: Maintained
5058F: drivers/scsi/sr* 4386F: drivers/scsi/sr*
5059 4387
5060SCSI SG DRIVER 4388SCSI SG DRIVER
5061P: Doug Gilbert 4389M: Doug Gilbert <dgilbert@interlog.com>
5062M: dgilbert@interlog.com
5063L: linux-scsi@vger.kernel.org 4390L: linux-scsi@vger.kernel.org
5064W: http://www.torque.net/sg 4391W: http://www.torque.net/sg
5065S: Maintained 4392S: Maintained
@@ -5067,8 +4394,7 @@ F: drivers/scsi/sg.c
5067F: include/scsi/sg.h 4394F: include/scsi/sg.h
5068 4395
5069SCSI SUBSYSTEM 4396SCSI SUBSYSTEM
5070P: James E.J. Bottomley 4397M: "James E.J. Bottomley" <James.Bottomley@HansenPartnership.com>
5071M: James.Bottomley@HansenPartnership.com
5072L: linux-scsi@vger.kernel.org 4398L: linux-scsi@vger.kernel.org
5073T: git git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6.git 4399T: git git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6.git
5074T: git git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-rc-fixes-2.6.git 4400T: git git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-rc-fixes-2.6.git
@@ -5078,18 +4404,15 @@ F: drivers/scsi/
5078F: include/scsi/ 4404F: include/scsi/
5079 4405
5080SCSI TAPE DRIVER 4406SCSI TAPE DRIVER
5081P: Kai Mäkisara 4407M: Kai Mäkisara <Kai.Makisara@kolumbus.fi>
5082M: Kai.Makisara@kolumbus.fi
5083L: linux-scsi@vger.kernel.org 4408L: linux-scsi@vger.kernel.org
5084S: Maintained 4409S: Maintained
5085F: Documentation/scsi/st.txt 4410F: Documentation/scsi/st.txt
5086F: drivers/scsi/st* 4411F: drivers/scsi/st*
5087 4412
5088SCTP PROTOCOL 4413SCTP PROTOCOL
5089P: Vlad Yasevich 4414M: Vlad Yasevich <vladislav.yasevich@hp.com>
5090M: vladislav.yasevich@hp.com 4415M: Sridhar Samudrala <sri@us.ibm.com>
5091P: Sridhar Samudrala
5092M: sri@us.ibm.com
5093L: linux-sctp@vger.kernel.org 4416L: linux-sctp@vger.kernel.org
5094W: http://lksctp.sourceforge.net 4417W: http://lksctp.sourceforge.net
5095S: Supported 4418S: Supported
@@ -5099,8 +4422,7 @@ F: include/net/sctp/
5099F: net/sctp/ 4422F: net/sctp/
5100 4423
5101SCx200 CPU SUPPORT 4424SCx200 CPU SUPPORT
5102P: Jim Cromie 4425M: Jim Cromie <jim.cromie@gmail.com>
5103M: jim.cromie@gmail.com
5104S: Odd Fixes 4426S: Odd Fixes
5105F: Documentation/i2c/busses/scx200_acb 4427F: Documentation/i2c/busses/scx200_acb
5106F: arch/x86/kernel/scx200_32.c 4428F: arch/x86/kernel/scx200_32.c
@@ -5110,49 +4432,42 @@ F: drivers/mtd/maps/scx200_docflash.c
5110F: include/linux/scx200.h 4432F: include/linux/scx200.h
5111 4433
5112SCx200 GPIO DRIVER 4434SCx200 GPIO DRIVER
5113P: Jim Cromie 4435M: Jim Cromie <jim.cromie@gmail.com>
5114M: jim.cromie@gmail.com
5115S: Maintained 4436S: Maintained
5116F: drivers/char/scx200_gpio.c 4437F: drivers/char/scx200_gpio.c
5117F: include/linux/scx200_gpio.h 4438F: include/linux/scx200_gpio.h
5118 4439
5119SCx200 HRT CLOCKSOURCE DRIVER 4440SCx200 HRT CLOCKSOURCE DRIVER
5120P: Jim Cromie 4441M: Jim Cromie <jim.cromie@gmail.com>
5121M: jim.cromie@gmail.com
5122S: Maintained 4442S: Maintained
5123F: drivers/clocksource/scx200_hrt.c 4443F: drivers/clocksource/scx200_hrt.c
5124 4444
5125SDRICOH_CS MMC/SD HOST CONTROLLER INTERFACE DRIVER 4445SDRICOH_CS MMC/SD HOST CONTROLLER INTERFACE DRIVER
5126P: Sascha Sommer 4446M: Sascha Sommer <saschasommer@freenet.de>
5127M: saschasommer@freenet.de
5128L: sdricohcs-devel@lists.sourceforge.net (subscribers-only) 4447L: sdricohcs-devel@lists.sourceforge.net (subscribers-only)
5129S: Maintained 4448S: Maintained
5130F: drivers/mmc/host/sdricoh_cs.c 4449F: drivers/mmc/host/sdricoh_cs.c
5131 4450
5132SECURE DIGITAL HOST CONTROLLER INTERFACE (SDHCI) DRIVER 4451SECURE DIGITAL HOST CONTROLLER INTERFACE (SDHCI) DRIVER
5133P: Pierre Ossman 4452M: Pierre Ossman <pierre@ossman.eu>
5134M: pierre@ossman.eu
5135L: sdhci-devel@lists.ossman.eu 4453L: sdhci-devel@lists.ossman.eu
5136S: Maintained 4454S: Maintained
5137 4455
5138SECURE DIGITAL HOST CONTROLLER INTERFACE, OPEN FIRMWARE BINDINGS (SDHCI-OF) 4456SECURE DIGITAL HOST CONTROLLER INTERFACE, OPEN FIRMWARE BINDINGS (SDHCI-OF)
5139P: Anton Vorontsov 4457M: Anton Vorontsov <avorontsov@ru.mvista.com>
5140M: avorontsov@ru.mvista.com
5141L: linuxppc-dev@ozlabs.org 4458L: linuxppc-dev@ozlabs.org
5142L: sdhci-devel@lists.ossman.eu 4459L: sdhci-devel@lists.ossman.eu
5143S: Maintained 4460S: Maintained
5144F: drivers/mmc/host/sdhci.* 4461F: drivers/mmc/host/sdhci.*
5145 4462
5146SECURE DIGITAL HOST CONTROLLER INTERFACE (SDHCI) SAMSUNG DRIVER 4463SECURE DIGITAL HOST CONTROLLER INTERFACE (SDHCI) SAMSUNG DRIVER
5147P: Ben Dooks 4464M: Ben Dooks <ben-linux@fluff.org>
5148M: ben-linux@fluff.org
5149L: sdhci-devel@lists.ossman.eu 4465L: sdhci-devel@lists.ossman.eu
5150S: Maintained 4466S: Maintained
5151F: drivers/mmc/host/sdhci-s3c.c 4467F: drivers/mmc/host/sdhci-s3c.c
5152 4468
5153SECURITY SUBSYSTEM 4469SECURITY SUBSYSTEM
5154P: James Morris 4470M: James Morris <jmorris@namei.org>
5155M: jmorris@namei.org
5156L: linux-security-module@vger.kernel.org (suggested Cc:) 4471L: linux-security-module@vger.kernel.org (suggested Cc:)
5157T: git git://www.kernel.org/pub/scm/linux/kernel/git/jmorris/security-testing-2.6.git 4472T: git git://www.kernel.org/pub/scm/linux/kernel/git/jmorris/security-testing-2.6.git
5158W: http://security.wiki.kernel.org/ 4473W: http://security.wiki.kernel.org/
@@ -5160,17 +4475,13 @@ S: Supported
5160F: security/ 4475F: security/
5161 4476
5162SECURITY CONTACT 4477SECURITY CONTACT
5163P: Security Officers 4478M: Security Officers <security@kernel.org>
5164M: security@kernel.org
5165S: Supported 4479S: Supported
5166 4480
5167SELINUX SECURITY MODULE 4481SELINUX SECURITY MODULE
5168P: Stephen Smalley 4482M: Stephen Smalley <sds@tycho.nsa.gov>
5169M: sds@tycho.nsa.gov 4483M: James Morris <jmorris@namei.org>
5170P: James Morris 4484M: Eric Paris <eparis@parisplace.org>
5171M: jmorris@namei.org
5172P: Eric Paris
5173M: eparis@parisplace.org
5174L: selinux@tycho.nsa.gov (subscribers-only, general discussion) 4485L: selinux@tycho.nsa.gov (subscribers-only, general discussion)
5175W: http://selinuxproject.org 4486W: http://selinuxproject.org
5176T: git git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/security-testing-2.6.git 4487T: git git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/security-testing-2.6.git
@@ -5179,15 +4490,13 @@ F: include/linux/selinux*
5179F: security/selinux/ 4490F: security/selinux/
5180 4491
5181SENSABLE PHANTOM 4492SENSABLE PHANTOM
5182P: Jiri Slaby 4493M: Jiri Slaby <jirislaby@gmail.com>
5183M: jirislaby@gmail.com
5184S: Maintained 4494S: Maintained
5185F: drivers/misc/phantom.c 4495F: drivers/misc/phantom.c
5186F: include/linux/phantom.h 4496F: include/linux/phantom.h
5187 4497
5188SERIAL ATA (SATA) SUBSYSTEM 4498SERIAL ATA (SATA) SUBSYSTEM
5189P: Jeff Garzik 4499M: Jeff Garzik <jgarzik@pobox.com>
5190M: jgarzik@pobox.com
5191L: linux-ide@vger.kernel.org 4500L: linux-ide@vger.kernel.org
5192T: git git://git.kernel.org/pub/scm/linux/kernel/git/jgarzik/libata-dev.git 4501T: git git://git.kernel.org/pub/scm/linux/kernel/git/jgarzik/libata-dev.git
5193S: Supported 4502S: Supported
@@ -5196,10 +4505,8 @@ F: include/linux/ata.h
5196F: include/linux/libata.h 4505F: include/linux/libata.h
5197 4506
5198SERVER ENGINES 10Gbps NIC - BladeEngine 2 DRIVER 4507SERVER ENGINES 10Gbps NIC - BladeEngine 2 DRIVER
5199P: Sathya Perla 4508M: Sathya Perla <sathyap@serverengines.com>
5200M: sathyap@serverengines.com 4509M: Subbu Seetharaman <subbus@serverengines.com>
5201P: Subbu Seetharaman
5202M: subbus@serverengines.com
5203L: netdev@vger.kernel.org 4510L: netdev@vger.kernel.org
5204W: http://www.serverengines.com 4511W: http://www.serverengines.com
5205S: Supported 4512S: Supported
@@ -5208,20 +4515,17 @@ F: drivers/net/benet/
5208SFC NETWORK DRIVER 4515SFC NETWORK DRIVER
5209P: Steve Hodgson 4516P: Steve Hodgson
5210P: Ben Hutchings 4517P: Ben Hutchings
5211P: Robert Stonehouse 4518M: Robert Stonehouse <linux-net-drivers@solarflare.com>
5212M: linux-net-drivers@solarflare.com
5213S: Supported 4519S: Supported
5214F: drivers/net/sfc/ 4520F: drivers/net/sfc/
5215 4521
5216SGI GRU DRIVER 4522SGI GRU DRIVER
5217P: Jack Steiner 4523M: Jack Steiner <steiner@sgi.com>
5218M: steiner@sgi.com
5219S: Maintained 4524S: Maintained
5220F: drivers/misc/sgi-gru/ 4525F: drivers/misc/sgi-gru/
5221 4526
5222SGI SN-IA64 (Altix) SERIAL CONSOLE DRIVER 4527SGI SN-IA64 (Altix) SERIAL CONSOLE DRIVER
5223P: Pat Gefre 4528M: Pat Gefre <pfg@sgi.com>
5224M: pfg@sgi.com
5225L: linux-ia64@vger.kernel.org 4529L: linux-ia64@vger.kernel.org
5226S: Supported 4530S: Supported
5227F: Documentation/ia64/serial.txt 4531F: Documentation/ia64/serial.txt
@@ -5229,22 +4533,19 @@ F: drivers/serial/ioc?_serial.c
5229F: include/linux/ioc?.h 4533F: include/linux/ioc?.h
5230 4534
5231SGI VISUAL WORKSTATION 320 AND 540 4535SGI VISUAL WORKSTATION 320 AND 540
5232P: Andrey Panin 4536M: Andrey Panin <pazke@donpac.ru>
5233M: pazke@donpac.ru
5234L: linux-visws-devel@lists.sf.net 4537L: linux-visws-devel@lists.sf.net
5235W: http://linux-visws.sf.net 4538W: http://linux-visws.sf.net
5236S: Maintained for 2.6. 4539S: Maintained for 2.6.
5237F: Documentation/sgi-visws.txt 4540F: Documentation/sgi-visws.txt
5238 4541
5239SGI XP/XPC/XPNET DRIVER 4542SGI XP/XPC/XPNET DRIVER
5240P: Robin Holt 4543M: Robin Holt <holt@sgi.com>
5241M: holt@sgi.com
5242S: Maintained 4544S: Maintained
5243F: drivers/misc/sgi-xp/ 4545F: drivers/misc/sgi-xp/
5244 4546
5245SHARP LH SUPPORT (LH7952X & LH7A40X) 4547SHARP LH SUPPORT (LH7952X & LH7A40X)
5246P: Marc Singer 4548M: Marc Singer <elf@buici.com>
5247M: elf@buici.com
5248W: http://projects.buici.com/arm 4549W: http://projects.buici.com/arm
5249L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only) 4550L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only)
5250S: Maintained 4551S: Maintained
@@ -5255,23 +4556,20 @@ F: drivers/usb/gadget/lh7a40*
5255F: drivers/usb/host/ohci-lh7a40* 4556F: drivers/usb/host/ohci-lh7a40*
5256 4557
5257SHPC HOTPLUG DRIVER 4558SHPC HOTPLUG DRIVER
5258P: Kristen Carlson Accardi 4559M: Kristen Carlson Accardi <kristen.c.accardi@intel.com>
5259M: kristen.c.accardi@intel.com
5260L: linux-pci@vger.kernel.org 4560L: linux-pci@vger.kernel.org
5261S: Supported 4561S: Supported
5262F: drivers/pci/hotplug/shpchp* 4562F: drivers/pci/hotplug/shpchp*
5263 4563
5264SIMTEC EB110ATX (Chalice CATS) 4564SIMTEC EB110ATX (Chalice CATS)
5265P: Ben Dooks 4565P: Ben Dooks
5266P: Vincent Sanders 4566M: Vincent Sanders <support@simtec.co.uk>
5267M: support@simtec.co.uk
5268W: http://www.simtec.co.uk/products/EB110ATX/ 4567W: http://www.simtec.co.uk/products/EB110ATX/
5269S: Supported 4568S: Supported
5270 4569
5271SIMTEC EB2410ITX (BAST) 4570SIMTEC EB2410ITX (BAST)
5272P: Ben Dooks 4571P: Ben Dooks
5273P: Vincent Sanders 4572M: Vincent Sanders <support@simtec.co.uk>
5274M: support@simtec.co.uk
5275W: http://www.simtec.co.uk/products/EB2410ITX/ 4573W: http://www.simtec.co.uk/products/EB2410ITX/
5276S: Supported 4574S: Supported
5277F: arch/arm/mach-s3c2410/ 4575F: arch/arm/mach-s3c2410/
@@ -5279,31 +4577,27 @@ F: drivers/*/*s3c2410*
5279F: drivers/*/*/*s3c2410* 4577F: drivers/*/*/*s3c2410*
5280 4578
5281SIS 190 ETHERNET DRIVER 4579SIS 190 ETHERNET DRIVER
5282P: Francois Romieu 4580M: Francois Romieu <romieu@fr.zoreil.com>
5283M: romieu@fr.zoreil.com
5284L: netdev@vger.kernel.org 4581L: netdev@vger.kernel.org
5285S: Maintained 4582S: Maintained
5286F: drivers/net/sis190.c 4583F: drivers/net/sis190.c
5287 4584
5288SIS 900/7016 FAST ETHERNET DRIVER 4585SIS 900/7016 FAST ETHERNET DRIVER
5289P: Daniele Venzano 4586M: Daniele Venzano <venza@brownhat.org>
5290M: venza@brownhat.org
5291W: http://www.brownhat.org/sis900.html 4587W: http://www.brownhat.org/sis900.html
5292L: netdev@vger.kernel.org 4588L: netdev@vger.kernel.org
5293S: Maintained 4589S: Maintained
5294F: drivers/net/sis900.* 4590F: drivers/net/sis900.*
5295 4591
5296SIS 96X I2C/SMBUS DRIVER 4592SIS 96X I2C/SMBUS DRIVER
5297P: Mark M. Hoffman 4593M: "Mark M. Hoffman" <mhoffman@lightlink.com>
5298M: mhoffman@lightlink.com
5299L: linux-i2c@vger.kernel.org 4594L: linux-i2c@vger.kernel.org
5300S: Maintained 4595S: Maintained
5301F: Documentation/i2c/busses/i2c-sis96x 4596F: Documentation/i2c/busses/i2c-sis96x
5302F: drivers/i2c/busses/i2c-sis96x.c 4597F: drivers/i2c/busses/i2c-sis96x.c
5303 4598
5304SIS FRAMEBUFFER DRIVER 4599SIS FRAMEBUFFER DRIVER
5305P: Thomas Winischhofer 4600M: Thomas Winischhofer <thomas@winischhofer.net>
5306M: thomas@winischhofer.net
5307W: http://www.winischhofer.net/linuxsisvga.shtml 4601W: http://www.winischhofer.net/linuxsisvga.shtml
5308S: Maintained 4602S: Maintained
5309F: Documentation/fb/sisfb.txt 4603F: Documentation/fb/sisfb.txt
@@ -5311,70 +4605,59 @@ F: drivers/video/sis/
5311F: include/video/sisfb.h 4605F: include/video/sisfb.h
5312 4606
5313SIS USB2VGA DRIVER 4607SIS USB2VGA DRIVER
5314P: Thomas Winischhofer 4608M: Thomas Winischhofer <thomas@winischhofer.net>
5315M: thomas@winischhofer.net
5316W: http://www.winischhofer.at/linuxsisusbvga.shtml 4609W: http://www.winischhofer.at/linuxsisusbvga.shtml
5317S: Maintained 4610S: Maintained
5318F: drivers/usb/misc/sisusbvga/ 4611F: drivers/usb/misc/sisusbvga/
5319 4612
5320SKGE, SKY2 10/100/1000 GIGABIT ETHERNET DRIVERS 4613SKGE, SKY2 10/100/1000 GIGABIT ETHERNET DRIVERS
5321P: Stephen Hemminger 4614M: Stephen Hemminger <shemminger@linux-foundation.org>
5322M: shemminger@linux-foundation.org
5323L: netdev@vger.kernel.org 4615L: netdev@vger.kernel.org
5324S: Maintained 4616S: Maintained
5325F: drivers/net/skge.* 4617F: drivers/net/skge.*
5326F: drivers/net/sky2.* 4618F: drivers/net/sky2.*
5327 4619
5328SLAB ALLOCATOR 4620SLAB ALLOCATOR
5329P: Christoph Lameter 4621M: Christoph Lameter <cl@linux-foundation.org>
5330M: cl@linux-foundation.org 4622M: Pekka Enberg <penberg@cs.helsinki.fi>
5331P: Pekka Enberg 4623M: Matt Mackall <mpm@selenic.com>
5332M: penberg@cs.helsinki.fi
5333P: Matt Mackall
5334M: mpm@selenic.com
5335L: linux-mm@kvack.org 4624L: linux-mm@kvack.org
5336S: Maintained 4625S: Maintained
5337F: include/linux/sl?b*.h 4626F: include/linux/sl?b*.h
5338F: mm/sl?b.c 4627F: mm/sl?b.c
5339 4628
5340SMC91x ETHERNET DRIVER 4629SMC91x ETHERNET DRIVER
5341P: Nicolas Pitre 4630M: Nicolas Pitre <nico@cam.org>
5342M: nico@cam.org
5343S: Maintained 4631S: Maintained
5344F: drivers/net/smc91x.* 4632F: drivers/net/smc91x.*
5345 4633
5346SMSC47B397 HARDWARE MONITOR DRIVER 4634SMSC47B397 HARDWARE MONITOR DRIVER
5347P: Mark M. Hoffman 4635M: "Mark M. Hoffman" <mhoffman@lightlink.com>
5348M: mhoffman@lightlink.com
5349L: lm-sensors@lm-sensors.org 4636L: lm-sensors@lm-sensors.org
5350S: Maintained 4637S: Maintained
5351F: Documentation/hwmon/smsc47b397 4638F: Documentation/hwmon/smsc47b397
5352F: drivers/hwmon/smsc47b397.c 4639F: drivers/hwmon/smsc47b397.c
5353 4640
5354SMSC911x ETHERNET DRIVER 4641SMSC911x ETHERNET DRIVER
5355P: Steve Glendinning 4642M: Steve Glendinning <steve.glendinning@smsc.com>
5356M: steve.glendinning@smsc.com
5357L: netdev@vger.kernel.org 4643L: netdev@vger.kernel.org
5358S: Supported 4644S: Supported
5359F: include/linux/smsc911x.h 4645F: include/linux/smsc911x.h
5360F: drivers/net/smsc911x.* 4646F: drivers/net/smsc911x.*
5361 4647
5362SMSC9420 PCI ETHERNET DRIVER 4648SMSC9420 PCI ETHERNET DRIVER
5363P: Steve Glendinning 4649M: Steve Glendinning <steve.glendinning@smsc.com>
5364M: steve.glendinning@smsc.com
5365L: netdev@vger.kernel.org 4650L: netdev@vger.kernel.org
5366S: Supported 4651S: Supported
5367F: drivers/net/smsc9420.* 4652F: drivers/net/smsc9420.*
5368 4653
5369SMX UIO Interface 4654SMX UIO Interface
5370P: Ben Nizette 4655M: Ben Nizette <bn@niasdigital.com>
5371M: bn@niasdigital.com
5372S: Maintained 4656S: Maintained
5373F: drivers/uio/uio_smx.c 4657F: drivers/uio/uio_smx.c
5374 4658
5375SN-IA64 (Itanium) SUB-PLATFORM 4659SN-IA64 (Itanium) SUB-PLATFORM
5376P: Jes Sorensen 4660M: Jes Sorensen <jes@sgi.com>
5377M: jes@sgi.com
5378L: linux-altix@sgi.com 4661L: linux-altix@sgi.com
5379L: linux-ia64@vger.kernel.org 4662L: linux-ia64@vger.kernel.org
5380W: http://www.sgi.com/altix 4663W: http://www.sgi.com/altix
@@ -5382,8 +4665,7 @@ S: Maintained
5382F: arch/ia64/sn/ 4665F: arch/ia64/sn/
5383 4666
5384SOC-CAMERA V4L2 SUBSYSTEM 4667SOC-CAMERA V4L2 SUBSYSTEM
5385P: Guennadi Liakhovetski 4668M: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
5386M: g.liakhovetski@gmx.de
5387L: linux-media@vger.kernel.org 4669L: linux-media@vger.kernel.org
5388T: git git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6.git 4670T: git git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6.git
5389S: Maintained 4671S: Maintained
@@ -5391,37 +4673,32 @@ F: include/media/v4l2*
5391F: drivers/media/video/v4l2* 4673F: drivers/media/video/v4l2*
5392 4674
5393SOEKRIS NET48XX LED SUPPORT 4675SOEKRIS NET48XX LED SUPPORT
5394P: Chris Boot 4676M: Chris Boot <bootc@bootc.net>
5395M: bootc@bootc.net
5396S: Maintained 4677S: Maintained
5397F: drivers/leds/leds-net48xx.c 4678F: drivers/leds/leds-net48xx.c
5398 4679
5399SOFTWARE RAID (Multiple Disks) SUPPORT 4680SOFTWARE RAID (Multiple Disks) SUPPORT
5400P: Neil Brown 4681M: Neil Brown <neilb@suse.de>
5401M: neilb@suse.de
5402L: linux-raid@vger.kernel.org 4682L: linux-raid@vger.kernel.org
5403S: Supported 4683S: Supported
5404F: drivers/md/ 4684F: drivers/md/
5405F: include/linux/raid/ 4685F: include/linux/raid/
5406 4686
5407SONIC NETWORK DRIVER 4687SONIC NETWORK DRIVER
5408P: Thomas Bogendoerfer 4688M: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
5409M: tsbogend@alpha.franken.de
5410L: netdev@vger.kernel.org 4689L: netdev@vger.kernel.org
5411S: Maintained 4690S: Maintained
5412F: drivers/net/sonic.* 4691F: drivers/net/sonic.*
5413 4692
5414SONICS SILICON BACKPLANE DRIVER (SSB) 4693SONICS SILICON BACKPLANE DRIVER (SSB)
5415P: Michael Buesch 4694M: Michael Buesch <mb@bu3sch.de>
5416M: mb@bu3sch.de
5417L: netdev@vger.kernel.org 4695L: netdev@vger.kernel.org
5418S: Maintained 4696S: Maintained
5419F: drivers/ssb/ 4697F: drivers/ssb/
5420F: include/linux/ssb/ 4698F: include/linux/ssb/
5421 4699
5422SONY VAIO CONTROL DEVICE DRIVER 4700SONY VAIO CONTROL DEVICE DRIVER
5423P: Mattia Dongili 4701M: Mattia Dongili <malattia@linux.it>
5424M: malattia@linux.it
5425L: linux-acpi@vger.kernel.org 4702L: linux-acpi@vger.kernel.org
5426W: http://www.linux.it/~malattia/wiki/index.php/Sony_drivers 4703W: http://www.linux.it/~malattia/wiki/index.php/Sony_drivers
5427S: Maintained 4704S: Maintained
@@ -5431,17 +4708,14 @@ F: drivers/platform/x86/sony-laptop.c
5431F: include/linux/sony-laptop.h 4708F: include/linux/sony-laptop.h
5432 4709
5433SONY MEMORYSTICK CARD SUPPORT 4710SONY MEMORYSTICK CARD SUPPORT
5434P: Alex Dubov 4711M: Alex Dubov <oakad@yahoo.com>
5435M: oakad@yahoo.com
5436W: http://tifmxx.berlios.de/ 4712W: http://tifmxx.berlios.de/
5437S: Maintained 4713S: Maintained
5438F: drivers/memstick/host/tifm_ms.c 4714F: drivers/memstick/host/tifm_ms.c
5439 4715
5440SOUND 4716SOUND
5441P: Jaroslav Kysela 4717M: Jaroslav Kysela <perex@perex.cz>
5442M: perex@perex.cz 4718M: Takashi Iwai <tiwai@suse.de>
5443P: Takashi Iwai
5444M: tiwai@suse.de
5445L: alsa-devel@alsa-project.org (moderated for non-subscribers) 4719L: alsa-devel@alsa-project.org (moderated for non-subscribers)
5446W: http://www.alsa-project.org/ 4720W: http://www.alsa-project.org/
5447T: git git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6.git 4721T: git git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6.git
@@ -5452,10 +4726,8 @@ F: include/sound/
5452F: sound/ 4726F: sound/
5453 4727
5454SOUND - SOC LAYER / DYNAMIC AUDIO POWER MANAGEMENT (ASoC) 4728SOUND - SOC LAYER / DYNAMIC AUDIO POWER MANAGEMENT (ASoC)
5455P: Liam Girdwood 4729M: Liam Girdwood <lrg@slimlogic.co.uk>
5456M: lrg@slimlogic.co.uk 4730M: Mark Brown <broonie@opensource.wolfsonmicro.com>
5457P: Mark Brown
5458M: broonie@opensource.wolfsonmicro.com
5459T: git git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound-2.6.git 4731T: git git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound-2.6.git
5460L: alsa-devel@alsa-project.org (moderated for non-subscribers) 4732L: alsa-devel@alsa-project.org (moderated for non-subscribers)
5461W: http://alsa-project.org/main/index.php/ASoC 4733W: http://alsa-project.org/main/index.php/ASoC
@@ -5464,8 +4736,7 @@ F: sound/soc/
5464F: include/sound/soc* 4736F: include/sound/soc*
5465 4737
5466SPARC + UltraSPARC (sparc/sparc64) 4738SPARC + UltraSPARC (sparc/sparc64)
5467P: David S. Miller 4739M: "David S. Miller" <davem@davemloft.net>
5468M: davem@davemloft.net
5469L: sparclinux@vger.kernel.org 4740L: sparclinux@vger.kernel.org
5470T: git git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-2.6.git 4741T: git git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-2.6.git
5471T: git git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-next-2.6.git 4742T: git git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-next-2.6.git
@@ -5473,15 +4744,13 @@ S: Maintained
5473F: arch/sparc/ 4744F: arch/sparc/
5474 4745
5475SPECIALIX IO8+ MULTIPORT SERIAL CARD DRIVER 4746SPECIALIX IO8+ MULTIPORT SERIAL CARD DRIVER
5476P: Roger Wolff 4747M: Roger Wolff <R.E.Wolff@BitWizard.nl>
5477M: R.E.Wolff@BitWizard.nl
5478S: Supported 4748S: Supported
5479F: Documentation/serial/specialix.txt 4749F: Documentation/serial/specialix.txt
5480F: drivers/char/specialix* 4750F: drivers/char/specialix*
5481 4751
5482SPI SUBSYSTEM 4752SPI SUBSYSTEM
5483P: David Brownell 4753M: David Brownell <dbrownell@users.sourceforge.net>
5484M: dbrownell@users.sourceforge.net
5485L: spi-devel-general@lists.sourceforge.net 4754L: spi-devel-general@lists.sourceforge.net
5486S: Maintained 4755S: Maintained
5487F: Documentation/spi/ 4756F: Documentation/spi/
@@ -5489,18 +4758,15 @@ F: drivers/spi/
5489F: include/linux/spi/ 4758F: include/linux/spi/
5490 4759
5491SPIDERNET NETWORK DRIVER for CELL 4760SPIDERNET NETWORK DRIVER for CELL
5492P: Ishizaki Kou 4761M: Ishizaki Kou <kou.ishizaki@toshiba.co.jp>
5493M: kou.ishizaki@toshiba.co.jp 4762M: Jens Osterkamp <jens@de.ibm.com>
5494P: Jens Osterkamp
5495M: jens@de.ibm.com
5496L: netdev@vger.kernel.org 4763L: netdev@vger.kernel.org
5497S: Supported 4764S: Supported
5498F: Documentation/networking/spider_net.txt 4765F: Documentation/networking/spider_net.txt
5499F: drivers/net/spider_net* 4766F: drivers/net/spider_net*
5500 4767
5501SPU FILE SYSTEM 4768SPU FILE SYSTEM
5502P: Jeremy Kerr 4769M: Jeremy Kerr <jk@ozlabs.org>
5503M: jk@ozlabs.org
5504L: linuxppc-dev@ozlabs.org 4770L: linuxppc-dev@ozlabs.org
5505L: cbe-oss-dev@ozlabs.org 4771L: cbe-oss-dev@ozlabs.org
5506W: http://www.ibm.com/developerworks/power/cell/ 4772W: http://www.ibm.com/developerworks/power/cell/
@@ -5509,8 +4775,7 @@ F: Documentation/filesystems/spufs.txt
5509F: arch/powerpc/platforms/cell/spufs/ 4775F: arch/powerpc/platforms/cell/spufs/
5510 4776
5511SQUASHFS FILE SYSTEM 4777SQUASHFS FILE SYSTEM
5512P: Phillip Lougher 4778M: Phillip Lougher <phillip@lougher.demon.co.uk>
5513M: phillip@lougher.demon.co.uk
5514L: squashfs-devel@lists.sourceforge.net (subscribers-only) 4779L: squashfs-devel@lists.sourceforge.net (subscribers-only)
5515W: http://squashfs.org.uk 4780W: http://squashfs.org.uk
5516S: Maintained 4781S: Maintained
@@ -5518,31 +4783,26 @@ F: Documentation/filesystems/squashfs.txt
5518F: fs/squashfs/ 4783F: fs/squashfs/
5519 4784
5520SRM (Alpha) environment access 4785SRM (Alpha) environment access
5521P: Jan-Benedict Glaw 4786M: Jan-Benedict Glaw <jbglaw@lug-owl.de>
5522M: jbglaw@lug-owl.de
5523S: Maintained 4787S: Maintained
5524F: arch/alpha/kernel/srm_env.c 4788F: arch/alpha/kernel/srm_env.c
5525 4789
5526STABLE BRANCH 4790STABLE BRANCH
5527P: Greg Kroah-Hartman 4791M: Greg Kroah-Hartman <greg@kroah.com>
5528M: greg@kroah.com 4792M: Chris Wright <chrisw@sous-sol.org>
5529P: Chris Wright
5530M: chrisw@sous-sol.org
5531L: stable@kernel.org 4793L: stable@kernel.org
5532S: Maintained 4794S: Maintained
5533 4795
5534STAGING SUBSYSTEM 4796STAGING SUBSYSTEM
5535P: Greg Kroah-Hartman 4797M: Greg Kroah-Hartman <gregkh@suse.de>
5536M: gregkh@suse.de
5537T: quilt kernel.org/pub/linux/kernel/people/gregkh/gregkh-2.6/ 4798T: quilt kernel.org/pub/linux/kernel/people/gregkh/gregkh-2.6/
5538L: devel@driverdev.osuosl.org 4799L: devel@driverdev.osuosl.org
5539S: Maintained 4800S: Maintained
5540F: drivers/staging/ 4801F: drivers/staging/
5541 4802
5542STARFIRE/DURALAN NETWORK DRIVER 4803STARFIRE/DURALAN NETWORK DRIVER
5543P: Ion Badulescu 4804M: Ion Badulescu <ionut@badula.org>
5544M: ionut@cs.columbia.edu 4805S: Odd Fixes
5545S: Maintained
5546F: drivers/net/starfire* 4806F: drivers/net/starfire*
5547 4807
5548STARMODE RADIO IP (STRIP) PROTOCOL DRIVER 4808STARMODE RADIO IP (STRIP) PROTOCOL DRIVER
@@ -5551,15 +4811,13 @@ F: drivers/net/wireless/strip.c
5551F: include/linux/if_strip.h 4811F: include/linux/if_strip.h
5552 4812
5553STRADIS MPEG-2 DECODER DRIVER 4813STRADIS MPEG-2 DECODER DRIVER
5554P: Nathan Laredo 4814M: Nathan Laredo <laredo@gnu.org>
5555M: laredo@gnu.org
5556W: http://www.stradis.com/ 4815W: http://www.stradis.com/
5557S: Maintained 4816S: Maintained
5558F: drivers/media/video/stradis.c 4817F: drivers/media/video/stradis.c
5559 4818
5560SUN3/3X 4819SUN3/3X
5561P: Sam Creasey 4820M: Sam Creasey <sammy@sammy.net>
5562M: sammy@sammy.net
5563W: http://sammy.net/sun3/ 4821W: http://sammy.net/sun3/
5564S: Maintained 4822S: Maintained
5565F: arch/m68k/kernel/*sun3* 4823F: arch/m68k/kernel/*sun3*
@@ -5567,8 +4825,7 @@ F: arch/m68k/sun3*/
5567F: arch/m68k/include/asm/sun3* 4825F: arch/m68k/include/asm/sun3*
5568 4826
5569SUPERH 4827SUPERH
5570P: Paul Mundt 4828M: Paul Mundt <lethal@linux-sh.org>
5571M: lethal@linux-sh.org
5572L: linux-sh@vger.kernel.org 4829L: linux-sh@vger.kernel.org
5573W: http://www.linux-sh.org 4830W: http://www.linux-sh.org
5574T: git git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6.git 4831T: git git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6.git
@@ -5578,12 +4835,9 @@ F: arch/sh/
5578F: drivers/sh/ 4835F: drivers/sh/
5579 4836
5580SUSPEND TO RAM 4837SUSPEND TO RAM
5581P: Len Brown 4838M: Len Brown <len.brown@intel.com>
5582M: len.brown@intel.com 4839M: Pavel Machek <pavel@ucw.cz>
5583P: Pavel Machek 4840M: "Rafael J. Wysocki" <rjw@sisk.pl>
5584M: pavel@ucw.cz
5585P: Rafael J. Wysocki
5586M: rjw@sisk.pl
5587L: linux-pm@lists.linux-foundation.org 4841L: linux-pm@lists.linux-foundation.org
5588S: Supported 4842S: Supported
5589F: Documentation/power/ 4843F: Documentation/power/
@@ -5595,32 +4849,28 @@ F: include/linux/freezer.h
5595F: include/linux/pm.h 4849F: include/linux/pm.h
5596 4850
5597SVGA HANDLING 4851SVGA HANDLING
5598P: Martin Mares 4852M: Martin Mares <mj@ucw.cz>
5599M: mj@ucw.cz
5600L: linux-video@atrey.karlin.mff.cuni.cz 4853L: linux-video@atrey.karlin.mff.cuni.cz
5601S: Maintained 4854S: Maintained
5602F: Documentation/svga.txt 4855F: Documentation/svga.txt
5603F: arch/x86/boot/video* 4856F: arch/x86/boot/video*
5604 4857
5605SYSV FILESYSTEM 4858SYSV FILESYSTEM
5606P: Christoph Hellwig 4859M: Christoph Hellwig <hch@infradead.org>
5607M: hch@infradead.org
5608S: Maintained 4860S: Maintained
5609F: Documentation/filesystems/sysv-fs.txt 4861F: Documentation/filesystems/sysv-fs.txt
5610F: fs/sysv/ 4862F: fs/sysv/
5611F: include/linux/sysv_fs.h 4863F: include/linux/sysv_fs.h
5612 4864
5613TASKSTATS STATISTICS INTERFACE 4865TASKSTATS STATISTICS INTERFACE
5614P: Balbir Singh 4866M: Balbir Singh <balbir@linux.vnet.ibm.com>
5615M: balbir@linux.vnet.ibm.com
5616S: Maintained 4867S: Maintained
5617F: Documentation/accounting/taskstats* 4868F: Documentation/accounting/taskstats*
5618F: include/linux/taskstats* 4869F: include/linux/taskstats*
5619F: kernel/taskstats.c 4870F: kernel/taskstats.c
5620 4871
5621TC CLASSIFIER 4872TC CLASSIFIER
5622P: Jamal Hadi Salim 4873M: Jamal Hadi Salim <hadi@cyberus.ca>
5623M: hadi@cyberus.ca
5624L: netdev@vger.kernel.org 4874L: netdev@vger.kernel.org
5625S: Maintained 4875S: Maintained
5626F: include/linux/pkt_cls.h 4876F: include/linux/pkt_cls.h
@@ -5628,38 +4878,31 @@ F: include/net/pkt_cls.h
5628F: net/sched/ 4878F: net/sched/
5629 4879
5630TCP LOW PRIORITY MODULE 4880TCP LOW PRIORITY MODULE
5631P: Wong Hoi Sing, Edison 4881M: "Wong Hoi Sing, Edison" <hswong3i@gmail.com>
5632M: hswong3i@gmail.com 4882M: "Hung Hing Lun, Mike" <hlhung3i@gmail.com>
5633P: Hung Hing Lun, Mike
5634M: hlhung3i@gmail.com
5635W: http://tcp-lp-mod.sourceforge.net/ 4883W: http://tcp-lp-mod.sourceforge.net/
5636S: Maintained 4884S: Maintained
5637F: net/ipv4/tcp_lp.c 4885F: net/ipv4/tcp_lp.c
5638 4886
5639TEHUTI ETHERNET DRIVER 4887TEHUTI ETHERNET DRIVER
5640P: Alexander Indenbaum 4888M: Alexander Indenbaum <baum@tehutinetworks.net>
5641M: baum@tehutinetworks.net 4889M: Andy Gospodarek <andy@greyhouse.net>
5642P: Andy Gospodarek
5643M: andy@greyhouse.net
5644L: netdev@vger.kernel.org 4890L: netdev@vger.kernel.org
5645S: Supported 4891S: Supported
5646F: drivers/net/tehuti* 4892F: drivers/net/tehuti*
5647 4893
5648Telecom Clock Driver for MCPL0010 4894Telecom Clock Driver for MCPL0010
5649P: Mark Gross 4895M: Mark Gross <mark.gross@intel.com>
5650M: mark.gross@intel.com
5651S: Supported 4896S: Supported
5652F: drivers/char/tlclk.c 4897F: drivers/char/tlclk.c
5653 4898
5654TENSILICA XTENSA PORT (xtensa) 4899TENSILICA XTENSA PORT (xtensa)
5655P: Chris Zankel 4900M: Chris Zankel <chris@zankel.net>
5656M: chris@zankel.net
5657S: Maintained 4901S: Maintained
5658F: arch/xtensa/ 4902F: arch/xtensa/
5659 4903
5660THINKPAD ACPI EXTRAS DRIVER 4904THINKPAD ACPI EXTRAS DRIVER
5661P: Henrique de Moraes Holschuh 4905M: Henrique de Moraes Holschuh <ibm-acpi@hmh.eng.br>
5662M: ibm-acpi@hmh.eng.br
5663L: ibm-acpi-devel@lists.sourceforge.net 4906L: ibm-acpi-devel@lists.sourceforge.net
5664W: http://ibm-acpi.sourceforge.net 4907W: http://ibm-acpi.sourceforge.net
5665W: http://thinkwiki.org/wiki/Ibm-acpi 4908W: http://thinkwiki.org/wiki/Ibm-acpi
@@ -5668,20 +4911,22 @@ S: Maintained
5668F: drivers/platform/x86/thinkpad_acpi.c 4911F: drivers/platform/x86/thinkpad_acpi.c
5669 4912
5670TI FLASH MEDIA INTERFACE DRIVER 4913TI FLASH MEDIA INTERFACE DRIVER
5671P: Alex Dubov 4914M: Alex Dubov <oakad@yahoo.com>
5672M: oakad@yahoo.com
5673S: Maintained 4915S: Maintained
5674F: drivers/misc/tifm* 4916F: drivers/misc/tifm*
5675F: drivers/mmc/host/tifm_sd.c 4917F: drivers/mmc/host/tifm_sd.c
5676F: include/linux/tifm.h 4918F: include/linux/tifm.h
5677 4919
4920TI TWL4030 SERIES SOC CODEC DRIVER
4921M: Peter Ujfalusi <peter.ujfalusi@nokia.com>
4922L: alsa-devel@alsa-project.org (moderated for non-subscribers)
4923S: Maintained
4924F: sound/soc/codecs/twl4030*
4925
5678TIPC NETWORK LAYER 4926TIPC NETWORK LAYER
5679P: Per Liden 4927M: Per Liden <per.liden@ericsson.com>
5680M: per.liden@ericsson.com 4928M: Jon Maloy <jon.maloy@ericsson.com>
5681P: Jon Maloy 4929M: Allan Stephens <allan.stephens@windriver.com>
5682M: jon.maloy@ericsson.com
5683P: Allan Stephens
5684M: allan.stephens@windriver.com
5685L: tipc-discussion@lists.sourceforge.net 4930L: tipc-discussion@lists.sourceforge.net
5686W: http://tipc.sourceforge.net/ 4931W: http://tipc.sourceforge.net/
5687W: http://tipc.cslab.ericsson.net/ 4932W: http://tipc.cslab.ericsson.net/
@@ -5692,8 +4937,7 @@ F: include/net/tipc/
5692F: net/tipc/ 4937F: net/tipc/
5693 4938
5694TLAN NETWORK DRIVER 4939TLAN NETWORK DRIVER
5695P: Samuel Chessman 4940M: Samuel Chessman <chessman@tux.org>
5696M: chessman@tux.org
5697L: tlan-devel@lists.sourceforge.net (subscribers-only) 4941L: tlan-devel@lists.sourceforge.net (subscribers-only)
5698W: http://sourceforge.net/projects/tlan/ 4942W: http://sourceforge.net/projects/tlan/
5699S: Maintained 4943S: Maintained
@@ -5701,10 +4945,8 @@ F: Documentation/networking/tlan.txt
5701F: drivers/net/tlan.* 4945F: drivers/net/tlan.*
5702 4946
5703TOMOYO SECURITY MODULE 4947TOMOYO SECURITY MODULE
5704P: Kentaro Takeda 4948M: Kentaro Takeda <takedakn@nttdata.co.jp>
5705M: takedakn@nttdata.co.jp 4949M: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
5706P: Tetsuo Handa
5707M: penguin-kernel@I-love.SAKURA.ne.jp
5708L: tomoyo-users-en@lists.sourceforge.jp (subscribers-only, for developers and users in English) 4950L: tomoyo-users-en@lists.sourceforge.jp (subscribers-only, for developers and users in English)
5709L: tomoyo-dev@lists.sourceforge.jp (subscribers-only, for developers in Japanese) 4951L: tomoyo-dev@lists.sourceforge.jp (subscribers-only, for developers in Japanese)
5710L: tomoyo-users@lists.sourceforge.jp (subscribers-only, for users in Japanese) 4952L: tomoyo-users@lists.sourceforge.jp (subscribers-only, for users in Japanese)
@@ -5718,8 +4960,7 @@ S: Orphan
5718F: drivers/platform/x86/toshiba_acpi.c 4960F: drivers/platform/x86/toshiba_acpi.c
5719 4961
5720TOSHIBA SMM DRIVER 4962TOSHIBA SMM DRIVER
5721P: Jonathan Buzzard 4963M: Jonathan Buzzard <jonathan@buzzard.org.uk>
5722M: jonathan@buzzard.org.uk
5723L: tlinux-users@tce.toshiba-dme.co.jp 4964L: tlinux-users@tce.toshiba-dme.co.jp
5724W: http://www.buzzard.org.uk/toshiba/ 4965W: http://www.buzzard.org.uk/toshiba/
5725S: Maintained 4966S: Maintained
@@ -5727,61 +4968,51 @@ F: drivers/char/toshiba.c
5727F: include/linux/toshiba.h 4968F: include/linux/toshiba.h
5728 4969
5729TMIO MMC DRIVER 4970TMIO MMC DRIVER
5730P: Ian Molton 4971M: Ian Molton <ian@mnementh.co.uk>
5731M: ian@mnementh.co.uk
5732S: Maintained 4972S: Maintained
5733F: drivers/mmc/host/tmio_mmc.* 4973F: drivers/mmc/host/tmio_mmc.*
5734 4974
5735TMPFS (SHMEM FILESYSTEM) 4975TMPFS (SHMEM FILESYSTEM)
5736P: Hugh Dickins 4976M: Hugh Dickins <hugh.dickins@tiscali.co.uk>
5737M: hugh.dickins@tiscali.co.uk
5738L: linux-mm@kvack.org 4977L: linux-mm@kvack.org
5739S: Maintained 4978S: Maintained
5740F: include/linux/shmem_fs.h 4979F: include/linux/shmem_fs.h
5741F: mm/shmem.c 4980F: mm/shmem.c
5742 4981
5743TPM DEVICE DRIVER 4982TPM DEVICE DRIVER
5744P: Debora Velarde 4983M: Debora Velarde <debora@linux.vnet.ibm.com>
5745M: debora@linux.vnet.ibm.com 4984M: Rajiv Andrade <srajiv@linux.vnet.ibm.com>
5746P: Rajiv Andrade
5747M: srajiv@linux.vnet.ibm.com
5748W: http://tpmdd.sourceforge.net 4985W: http://tpmdd.sourceforge.net
5749P: Marcel Selhorst 4986M: Marcel Selhorst <m.selhorst@sirrix.com>
5750M: m.selhorst@sirrix.com
5751W: http://www.sirrix.com 4987W: http://www.sirrix.com
5752L: tpmdd-devel@lists.sourceforge.net (moderated for non-subscribers) 4988L: tpmdd-devel@lists.sourceforge.net (moderated for non-subscribers)
5753S: Maintained 4989S: Maintained
5754F: drivers/char/tpm/ 4990F: drivers/char/tpm/
5755 4991
5756TRIVIAL PATCHES 4992TRIVIAL PATCHES
5757P: Jiri Kosina 4993M: Jiri Kosina <trivial@kernel.org>
5758M: trivial@kernel.org
5759T: git git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial.git 4994T: git git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial.git
5760S: Maintained 4995S: Maintained
4996
4997TTY LAYER
4998M: Greg Kroah-Hartman <gregkh@suse.de>
4999S: Maintained
5000T: quilt kernel.org/pub/linux/kernel/people/gregkh/gregkh-2.6/
5761F: drivers/char/tty_* 5001F: drivers/char/tty_*
5762F: drivers/serial/serial_core.c 5002F: drivers/serial/serial_core.c
5763F: include/linux/serial_core.h 5003F: include/linux/serial_core.h
5764F: include/linux/serial.h 5004F: include/linux/serial.h
5765F: include/linux/tty.h 5005F: include/linux/tty.h
5766 5006
5767TTY LAYER
5768P: Alan Cox
5769M: alan@lxorguk.ukuu.org.uk
5770S: Maintained
5771T: stgit http://zeniv.linux.org.uk/~alan/ttydev/
5772
5773TULIP NETWORK DRIVERS 5007TULIP NETWORK DRIVERS
5774P: Grant Grundler 5008M: Grant Grundler <grundler@parisc-linux.org>
5775M: grundler@parisc-linux.org 5009M: Kyle McMartin <kyle@mcmartin.ca>
5776P: Kyle McMartin
5777M: kyle@mcmartin.ca
5778L: netdev@vger.kernel.org 5010L: netdev@vger.kernel.org
5779S: Maintained 5011S: Maintained
5780F: drivers/net/tulip/ 5012F: drivers/net/tulip/
5781 5013
5782TUN/TAP driver 5014TUN/TAP driver
5783P: Maxim Krasnyansky 5015M: Maxim Krasnyansky <maxk@qualcomm.com>
5784M: maxk@qualcomm.com
5785L: vtun@office.satix.net 5016L: vtun@office.satix.net
5786W: http://vtun.sourceforge.net/tun 5017W: http://vtun.sourceforge.net/tun
5787S: Maintained 5018S: Maintained
@@ -5789,24 +5020,20 @@ F: Documentation/networking/tuntap.txt
5789F: arch/um/os-Linux/drivers/ 5020F: arch/um/os-Linux/drivers/
5790 5021
5791TURBOCHANNEL SUBSYSTEM 5022TURBOCHANNEL SUBSYSTEM
5792P: Maciej W. Rozycki 5023M: "Maciej W. Rozycki" <macro@linux-mips.org>
5793M: macro@linux-mips.org
5794S: Maintained 5024S: Maintained
5795F: drivers/tc/ 5025F: drivers/tc/
5796F: include/linux/tc.h 5026F: include/linux/tc.h
5797 5027
5798U14-34F SCSI DRIVER 5028U14-34F SCSI DRIVER
5799P: Dario Ballabio 5029M: Dario Ballabio <ballabio_dario@emc.com>
5800M: ballabio_dario@emc.com
5801L: linux-scsi@vger.kernel.org 5030L: linux-scsi@vger.kernel.org
5802S: Maintained 5031S: Maintained
5803F: drivers/scsi/u14-34f.c 5032F: drivers/scsi/u14-34f.c
5804 5033
5805UBI FILE SYSTEM (UBIFS) 5034UBI FILE SYSTEM (UBIFS)
5806P: Artem Bityutskiy 5035M: Artem Bityutskiy <dedekind@infradead.org>
5807M: dedekind@infradead.org 5036M: Adrian Hunter <adrian.hunter@nokia.com>
5808P: Adrian Hunter
5809M: ext-adrian.hunter@nokia.com
5810L: linux-mtd@lists.infradead.org 5037L: linux-mtd@lists.infradead.org
5811T: git git://git.infradead.org/ubifs-2.6.git 5038T: git git://git.infradead.org/ubifs-2.6.git
5812W: http://www.linux-mtd.infradead.org/doc/ubifs.html 5039W: http://www.linux-mtd.infradead.org/doc/ubifs.html
@@ -5815,37 +5042,32 @@ F: Documentation/filesystems/ubifs.txt
5815F: fs/ubifs/ 5042F: fs/ubifs/
5816 5043
5817UCLINUX (AND M68KNOMMU) 5044UCLINUX (AND M68KNOMMU)
5818P: Greg Ungerer 5045M: Greg Ungerer <gerg@uclinux.org>
5819M: gerg@uclinux.org
5820W: http://www.uclinux.org/ 5046W: http://www.uclinux.org/
5821L: uclinux-dev@uclinux.org (subscribers-only) 5047L: uclinux-dev@uclinux.org (subscribers-only)
5822S: Maintained 5048S: Maintained
5823F: arch/m68knommu/ 5049F: arch/m68knommu/
5824 5050
5825UCLINUX FOR RENESAS H8/300 (H8300) 5051UCLINUX FOR RENESAS H8/300 (H8300)
5826P: Yoshinori Sato 5052M: Yoshinori Sato <ysato@users.sourceforge.jp>
5827M: ysato@users.sourceforge.jp
5828W: http://uclinux-h8.sourceforge.jp/ 5053W: http://uclinux-h8.sourceforge.jp/
5829S: Supported 5054S: Supported
5830 5055
5831UDF FILESYSTEM 5056UDF FILESYSTEM
5832P: Jan Kara 5057M: Jan Kara <jack@suse.cz>
5833M: jack@suse.cz
5834W: http://linux-udf.sourceforge.net 5058W: http://linux-udf.sourceforge.net
5835S: Maintained 5059S: Maintained
5836F: Documentation/filesystems/udf.txt 5060F: Documentation/filesystems/udf.txt
5837F: fs/udf/ 5061F: fs/udf/
5838 5062
5839UFS FILESYSTEM 5063UFS FILESYSTEM
5840P: Evgeniy Dushistov 5064M: Evgeniy Dushistov <dushistov@mail.ru>
5841M: dushistov@mail.ru
5842S: Maintained 5065S: Maintained
5843F: Documentation/filesystems/ufs.txt 5066F: Documentation/filesystems/ufs.txt
5844F: fs/ufs/ 5067F: fs/ufs/
5845 5068
5846ULTRA-WIDEBAND (UWB) SUBSYSTEM: 5069ULTRA-WIDEBAND (UWB) SUBSYSTEM:
5847P: David Vrabel 5070M: David Vrabel <david.vrabel@csr.com>
5848M: david.vrabel@csr.com
5849L: linux-usb@vger.kernel.org 5071L: linux-usb@vger.kernel.org
5850S: Supported 5072S: Supported
5851F: drivers/uwb/* 5073F: drivers/uwb/*
@@ -5853,8 +5075,7 @@ F: include/linux/uwb.h
5853F: include/linux/uwb/ 5075F: include/linux/uwb/
5854 5076
5855UNIFORM CDROM DRIVER 5077UNIFORM CDROM DRIVER
5856P: Jens Axboe 5078M: Jens Axboe <axboe@kernel.dk>
5857M: axboe@kernel.dk
5858W: http://www.kernel.dk 5079W: http://www.kernel.dk
5859S: Maintained 5080S: Maintained
5860F: Documentation/cdrom/ 5081F: Documentation/cdrom/
@@ -5862,8 +5083,7 @@ F: drivers/cdrom/cdrom.c
5862F: include/linux/cdrom.h 5083F: include/linux/cdrom.h
5863 5084
5864UNSORTED BLOCK IMAGES (UBI) 5085UNSORTED BLOCK IMAGES (UBI)
5865P: Artem Bityutskiy 5086M: Artem Bityutskiy <dedekind@infradead.org>
5866M: dedekind@infradead.org
5867W: http://www.linux-mtd.infradead.org/ 5087W: http://www.linux-mtd.infradead.org/
5868L: linux-mtd@lists.infradead.org 5088L: linux-mtd@lists.infradead.org
5869T: git git://git.infradead.org/ubi-2.6.git 5089T: git git://git.infradead.org/ubi-2.6.git
@@ -5873,23 +5093,20 @@ F: include/linux/mtd/ubi.h
5873F: include/mtd/ubi-user.h 5093F: include/mtd/ubi-user.h
5874 5094
5875USB ACM DRIVER 5095USB ACM DRIVER
5876P: Oliver Neukum 5096M: Oliver Neukum <oliver@neukum.name>
5877M: oliver@neukum.name
5878L: linux-usb@vger.kernel.org 5097L: linux-usb@vger.kernel.org
5879S: Maintained 5098S: Maintained
5880F: Documentation/usb/acm.txt 5099F: Documentation/usb/acm.txt
5881F: drivers/usb/class/cdc-acm.* 5100F: drivers/usb/class/cdc-acm.*
5882 5101
5883USB BLOCK DRIVER (UB ub) 5102USB BLOCK DRIVER (UB ub)
5884P: Pete Zaitcev 5103M: Pete Zaitcev <zaitcev@redhat.com>
5885M: zaitcev@redhat.com
5886L: linux-usb@vger.kernel.org 5104L: linux-usb@vger.kernel.org
5887S: Supported 5105S: Supported
5888F: drivers/block/ub.c 5106F: drivers/block/ub.c
5889 5107
5890USB CDC ETHERNET DRIVER 5108USB CDC ETHERNET DRIVER
5891P: Greg Kroah-Hartman 5109M: Greg Kroah-Hartman <greg@kroah.com>
5892M: greg@kroah.com
5893L: linux-usb@vger.kernel.org 5110L: linux-usb@vger.kernel.org
5894S: Maintained 5111S: Maintained
5895W: http://www.kroah.com/linux-usb/ 5112W: http://www.kroah.com/linux-usb/
@@ -5897,39 +5114,34 @@ F: drivers/net/usb/cdc_*.c
5897F: include/linux/usb/cdc.h 5114F: include/linux/usb/cdc.h
5898 5115
5899USB CYPRESS C67X00 DRIVER 5116USB CYPRESS C67X00 DRIVER
5900P: Peter Korsgaard 5117M: Peter Korsgaard <jacmet@sunsite.dk>
5901M: jacmet@sunsite.dk
5902L: linux-usb@vger.kernel.org 5118L: linux-usb@vger.kernel.org
5903S: Maintained 5119S: Maintained
5904F: drivers/usb/c67x00/ 5120F: drivers/usb/c67x00/
5905 5121
5906USB DAVICOM DM9601 DRIVER 5122USB DAVICOM DM9601 DRIVER
5907P: Peter Korsgaard 5123M: Peter Korsgaard <jacmet@sunsite.dk>
5908M: jacmet@sunsite.dk
5909L: netdev@vger.kernel.org 5124L: netdev@vger.kernel.org
5910W: http://www.linux-usb.org/usbnet 5125W: http://www.linux-usb.org/usbnet
5911S: Maintained 5126S: Maintained
5912F: drivers/net/usb/dm9601.c 5127F: drivers/net/usb/dm9601.c
5913 5128
5914USB DIAMOND RIO500 DRIVER 5129USB DIAMOND RIO500 DRIVER
5915P: Cesar Miquel 5130M: Cesar Miquel <miquel@df.uba.ar>
5916M: miquel@df.uba.ar
5917L: rio500-users@lists.sourceforge.net 5131L: rio500-users@lists.sourceforge.net
5918W: http://rio500.sourceforge.net 5132W: http://rio500.sourceforge.net
5919S: Maintained 5133S: Maintained
5920F: drivers/usb/misc/rio500* 5134F: drivers/usb/misc/rio500*
5921 5135
5922USB EHCI DRIVER 5136USB EHCI DRIVER
5923P: David Brownell 5137M: David Brownell <dbrownell@users.sourceforge.net>
5924M: dbrownell@users.sourceforge.net
5925L: linux-usb@vger.kernel.org 5138L: linux-usb@vger.kernel.org
5926S: Odd Fixes 5139S: Odd Fixes
5927F: Documentation/usb/ehci.txt 5140F: Documentation/usb/ehci.txt
5928F: drivers/usb/host/ehci* 5141F: drivers/usb/host/ehci*
5929 5142
5930USB ET61X[12]51 DRIVER 5143USB ET61X[12]51 DRIVER
5931P: Luca Risolia 5144M: Luca Risolia <luca.risolia@studio.unibo.it>
5932M: luca.risolia@studio.unibo.it
5933L: linux-usb@vger.kernel.org 5145L: linux-usb@vger.kernel.org
5934L: linux-media@vger.kernel.org 5146L: linux-media@vger.kernel.org
5935T: git git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6.git 5147T: git git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6.git
@@ -5938,8 +5150,7 @@ S: Maintained
5938F: drivers/media/video/et61x251/ 5150F: drivers/media/video/et61x251/
5939 5151
5940USB GADGET/PERIPHERAL SUBSYSTEM 5152USB GADGET/PERIPHERAL SUBSYSTEM
5941P: David Brownell 5153M: David Brownell <dbrownell@users.sourceforge.net>
5942M: dbrownell@users.sourceforge.net
5943L: linux-usb@vger.kernel.org 5154L: linux-usb@vger.kernel.org
5944W: http://www.linux-usb.org/gadget 5155W: http://www.linux-usb.org/gadget
5945S: Maintained 5156S: Maintained
@@ -5947,8 +5158,7 @@ F: drivers/usb/gadget/
5947F: include/linux/usb/gadget* 5158F: include/linux/usb/gadget*
5948 5159
5949USB HID/HIDBP DRIVERS (USB KEYBOARDS, MICE, REMOTE CONTROLS, ...) 5160USB HID/HIDBP DRIVERS (USB KEYBOARDS, MICE, REMOTE CONTROLS, ...)
5950P: Jiri Kosina 5161M: Jiri Kosina <jkosina@suse.cz>
5951M: jkosina@suse.cz
5952L: linux-usb@vger.kernel.org 5162L: linux-usb@vger.kernel.org
5953T: git git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid.git 5163T: git git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid.git
5954S: Maintained 5164S: Maintained
@@ -5956,23 +5166,20 @@ F: Documentation/usb/hiddev.txt
5956F: drivers/hid/usbhid/ 5166F: drivers/hid/usbhid/
5957 5167
5958USB ISP116X DRIVER 5168USB ISP116X DRIVER
5959P: Olav Kongas 5169M: Olav Kongas <ok@artecdesign.ee>
5960M: ok@artecdesign.ee
5961L: linux-usb@vger.kernel.org 5170L: linux-usb@vger.kernel.org
5962S: Maintained 5171S: Maintained
5963F: drivers/usb/host/isp116x* 5172F: drivers/usb/host/isp116x*
5964F: include/linux/usb/isp116x.h 5173F: include/linux/usb/isp116x.h
5965 5174
5966USB KAWASAKI LSI DRIVER 5175USB KAWASAKI LSI DRIVER
5967P: Oliver Neukum 5176M: Oliver Neukum <oliver@neukum.name>
5968M: oliver@neukum.name
5969L: linux-usb@vger.kernel.org 5177L: linux-usb@vger.kernel.org
5970S: Maintained 5178S: Maintained
5971F: drivers/usb/serial/kl5kusb105.* 5179F: drivers/usb/serial/kl5kusb105.*
5972 5180
5973USB MASS STORAGE DRIVER 5181USB MASS STORAGE DRIVER
5974P: Matthew Dharm 5182M: Matthew Dharm <mdharm-usb@one-eyed-alien.net>
5975M: mdharm-usb@one-eyed-alien.net
5976L: linux-usb@vger.kernel.org 5183L: linux-usb@vger.kernel.org
5977L: usb-storage@lists.one-eyed-alien.net 5184L: usb-storage@lists.one-eyed-alien.net
5978S: Maintained 5185S: Maintained
@@ -5980,31 +5187,27 @@ W: http://www.one-eyed-alien.net/~mdharm/linux-usb/
5980F: drivers/usb/storage/ 5187F: drivers/usb/storage/
5981 5188
5982USB OHCI DRIVER 5189USB OHCI DRIVER
5983P: David Brownell 5190M: David Brownell <dbrownell@users.sourceforge.net>
5984M: dbrownell@users.sourceforge.net
5985L: linux-usb@vger.kernel.org 5191L: linux-usb@vger.kernel.org
5986S: Odd Fixes 5192S: Odd Fixes
5987F: Documentation/usb/ohci.txt 5193F: Documentation/usb/ohci.txt
5988F: drivers/usb/host/ohci* 5194F: drivers/usb/host/ohci*
5989 5195
5990USB OPTION-CARD DRIVER 5196USB OPTION-CARD DRIVER
5991P: Matthias Urlichs 5197M: Matthias Urlichs <smurf@smurf.noris.de>
5992M: smurf@smurf.noris.de
5993L: linux-usb@vger.kernel.org 5198L: linux-usb@vger.kernel.org
5994S: Maintained 5199S: Maintained
5995F: drivers/usb/serial/option.c 5200F: drivers/usb/serial/option.c
5996 5201
5997USB OV511 DRIVER 5202USB OV511 DRIVER
5998P: Mark McClelland 5203M: Mark McClelland <mmcclell@bigfoot.com>
5999M: mmcclell@bigfoot.com
6000L: linux-usb@vger.kernel.org 5204L: linux-usb@vger.kernel.org
6001W: http://alpha.dyndns.org/ov511/ 5205W: http://alpha.dyndns.org/ov511/
6002S: Maintained 5206S: Maintained
6003F: drivers/media/video/ov511.* 5207F: drivers/media/video/ov511.*
6004 5208
6005USB PEGASUS DRIVER 5209USB PEGASUS DRIVER
6006P: Petko Manolov 5210M: Petko Manolov <petkan@users.sourceforge.net>
6007M: petkan@users.sourceforge.net
6008L: linux-usb@vger.kernel.org 5211L: linux-usb@vger.kernel.org
6009L: netdev@vger.kernel.org 5212L: netdev@vger.kernel.org
6010W: http://pegasus2.sourceforge.net/ 5213W: http://pegasus2.sourceforge.net/
@@ -6012,15 +5215,13 @@ S: Maintained
6012F: drivers/net/usb/pegasus.* 5215F: drivers/net/usb/pegasus.*
6013 5216
6014USB PRINTER DRIVER (usblp) 5217USB PRINTER DRIVER (usblp)
6015P: Pete Zaitcev 5218M: Pete Zaitcev <zaitcev@redhat.com>
6016M: zaitcev@redhat.com
6017L: linux-usb@vger.kernel.org 5219L: linux-usb@vger.kernel.org
6018S: Supported 5220S: Supported
6019F: drivers/usb/class/usblp.c 5221F: drivers/usb/class/usblp.c
6020 5222
6021USB RTL8150 DRIVER 5223USB RTL8150 DRIVER
6022P: Petko Manolov 5224M: Petko Manolov <petkan@users.sourceforge.net>
6023M: petkan@users.sourceforge.net
6024L: linux-usb@vger.kernel.org 5225L: linux-usb@vger.kernel.org
6025L: netdev@vger.kernel.org 5226L: netdev@vger.kernel.org
6026W: http://pegasus2.sourceforge.net/ 5227W: http://pegasus2.sourceforge.net/
@@ -6028,8 +5229,7 @@ S: Maintained
6028F: drivers/net/usb/rtl8150.c 5229F: drivers/net/usb/rtl8150.c
6029 5230
6030USB SE401 DRIVER 5231USB SE401 DRIVER
6031P: Jeroen Vreeken 5232M: Jeroen Vreeken <pe1rxq@amsat.org>
6032M: pe1rxq@amsat.org
6033L: linux-usb@vger.kernel.org 5233L: linux-usb@vger.kernel.org
6034W: http://www.chello.nl/~j.vreeken/se401/ 5234W: http://www.chello.nl/~j.vreeken/se401/
6035S: Maintained 5235S: Maintained
@@ -6037,15 +5237,13 @@ F: Documentation/video4linux/se401.txt
6037F: drivers/media/video/se401.* 5237F: drivers/media/video/se401.*
6038 5238
6039USB SERIAL BELKIN F5U103 DRIVER 5239USB SERIAL BELKIN F5U103 DRIVER
6040P: William Greathouse 5240M: William Greathouse <wgreathouse@smva.com>
6041M: wgreathouse@smva.com
6042L: linux-usb@vger.kernel.org 5241L: linux-usb@vger.kernel.org
6043S: Maintained 5242S: Maintained
6044F: drivers/usb/serial/belkin_sa.* 5243F: drivers/usb/serial/belkin_sa.*
6045 5244
6046USB SERIAL CYPRESS M8 DRIVER 5245USB SERIAL CYPRESS M8 DRIVER
6047P: Lonnie Mendez 5246M: Lonnie Mendez <dignome@gmail.com>
6048M: dignome@gmail.com
6049L: linux-usb@vger.kernel.org 5247L: linux-usb@vger.kernel.org
6050S: Maintained 5248S: Maintained
6051W: http://geocities.com/i0xox0i 5249W: http://geocities.com/i0xox0i
@@ -6053,23 +5251,20 @@ W: http://firstlight.net/cvs
6053F: drivers/usb/serial/cypress_m8.* 5251F: drivers/usb/serial/cypress_m8.*
6054 5252
6055USB SERIAL CYBERJACK DRIVER 5253USB SERIAL CYBERJACK DRIVER
6056P: Matthias Bruestle and Harald Welte 5254M: Matthias Bruestle and Harald Welte <support@reiner-sct.com>
6057M: support@reiner-sct.com
6058W: http://www.reiner-sct.de/support/treiber_cyberjack.php 5255W: http://www.reiner-sct.de/support/treiber_cyberjack.php
6059S: Maintained 5256S: Maintained
6060F: drivers/usb/serial/cyberjack.c 5257F: drivers/usb/serial/cyberjack.c
6061 5258
6062USB SERIAL DIGI ACCELEPORT DRIVER 5259USB SERIAL DIGI ACCELEPORT DRIVER
6063P: Peter Berger and Al Borchers 5260M: Peter Berger <pberger@brimson.com>
6064M: pberger@brimson.com 5261M: Al Borchers <alborchers@steinerpoint.com>
6065M: alborchers@steinerpoint.com
6066L: linux-usb@vger.kernel.org 5262L: linux-usb@vger.kernel.org
6067S: Maintained 5263S: Maintained
6068F: drivers/usb/serial/digi_acceleport.c 5264F: drivers/usb/serial/digi_acceleport.c
6069 5265
6070USB SERIAL DRIVER 5266USB SERIAL DRIVER
6071P: Greg Kroah-Hartman 5267M: Greg Kroah-Hartman <gregkh@suse.de>
6072M: gregkh@suse.de
6073L: linux-usb@vger.kernel.org 5268L: linux-usb@vger.kernel.org
6074S: Supported 5269S: Supported
6075F: Documentation/usb/usb-serial.txt 5270F: Documentation/usb/usb-serial.txt
@@ -6078,38 +5273,33 @@ F: drivers/usb/serial/usb-serial.c
6078F: include/linux/usb/serial.h 5273F: include/linux/usb/serial.h
6079 5274
6080USB SERIAL EMPEG EMPEG-CAR MARK I/II DRIVER 5275USB SERIAL EMPEG EMPEG-CAR MARK I/II DRIVER
6081P: Gary Brubaker 5276M: Gary Brubaker <xavyer@ix.netcom.com>
6082M: xavyer@ix.netcom.com
6083L: linux-usb@vger.kernel.org 5277L: linux-usb@vger.kernel.org
6084S: Maintained 5278S: Maintained
6085F: drivers/usb/serial/empeg.c 5279F: drivers/usb/serial/empeg.c
6086 5280
6087USB SERIAL KEYSPAN DRIVER 5281USB SERIAL KEYSPAN DRIVER
6088P: Greg Kroah-Hartman 5282M: Greg Kroah-Hartman <greg@kroah.com>
6089M: greg@kroah.com
6090L: linux-usb@vger.kernel.org 5283L: linux-usb@vger.kernel.org
6091W: http://www.kroah.com/linux/ 5284W: http://www.kroah.com/linux/
6092S: Maintained 5285S: Maintained
6093F: drivers/usb/serial/*keyspan* 5286F: drivers/usb/serial/*keyspan*
6094 5287
6095USB SERIAL WHITEHEAT DRIVER 5288USB SERIAL WHITEHEAT DRIVER
6096P: Support Department 5289M: Support Department <support@connecttech.com>
6097M: support@connecttech.com
6098L: linux-usb@vger.kernel.org 5290L: linux-usb@vger.kernel.org
6099W: http://www.connecttech.com 5291W: http://www.connecttech.com
6100S: Supported 5292S: Supported
6101F: drivers/usb/serial/whiteheat* 5293F: drivers/usb/serial/whiteheat*
6102 5294
6103USB SMSC95XX ETHERNET DRIVER 5295USB SMSC95XX ETHERNET DRIVER
6104P: Steve Glendinning 5296M: Steve Glendinning <steve.glendinning@smsc.com>
6105M: steve.glendinning@smsc.com
6106L: netdev@vger.kernel.org 5297L: netdev@vger.kernel.org
6107S: Supported 5298S: Supported
6108F: drivers/net/usb/smsc95xx.* 5299F: drivers/net/usb/smsc95xx.*
6109 5300
6110USB SN9C1xx DRIVER 5301USB SN9C1xx DRIVER
6111P: Luca Risolia 5302M: Luca Risolia <luca.risolia@studio.unibo.it>
6112M: luca.risolia@studio.unibo.it
6113L: linux-usb@vger.kernel.org 5303L: linux-usb@vger.kernel.org
6114L: linux-media@vger.kernel.org 5304L: linux-media@vger.kernel.org
6115T: git git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6.git 5305T: git git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6.git
@@ -6119,8 +5309,7 @@ F: Documentation/video4linux/sn9c102.txt
6119F: drivers/media/video/sn9c102/ 5309F: drivers/media/video/sn9c102/
6120 5310
6121USB SUBSYSTEM 5311USB SUBSYSTEM
6122P: Greg Kroah-Hartman 5312M: Greg Kroah-Hartman <gregkh@suse.de>
6123M: gregkh@suse.de
6124L: linux-usb@vger.kernel.org 5313L: linux-usb@vger.kernel.org
6125W: http://www.linux-usb.org 5314W: http://www.linux-usb.org
6126T: quilt kernel.org/pub/linux/kernel/people/gregkh/gregkh-2.6/ 5315T: quilt kernel.org/pub/linux/kernel/people/gregkh/gregkh-2.6/
@@ -6132,15 +5321,13 @@ F: include/linux/usb.h
6132F: include/linux/usb/ 5321F: include/linux/usb/
6133 5322
6134USB UHCI DRIVER 5323USB UHCI DRIVER
6135P: Alan Stern 5324M: Alan Stern <stern@rowland.harvard.edu>
6136M: stern@rowland.harvard.edu
6137L: linux-usb@vger.kernel.org 5325L: linux-usb@vger.kernel.org
6138S: Maintained 5326S: Maintained
6139F: drivers/usb/host/uhci* 5327F: drivers/usb/host/uhci*
6140 5328
6141USB "USBNET" DRIVER FRAMEWORK 5329USB "USBNET" DRIVER FRAMEWORK
6142P: David Brownell 5330M: David Brownell <dbrownell@users.sourceforge.net>
6143M: dbrownell@users.sourceforge.net
6144L: netdev@vger.kernel.org 5331L: netdev@vger.kernel.org
6145W: http://www.linux-usb.org/usbnet 5332W: http://www.linux-usb.org/usbnet
6146S: Maintained 5333S: Maintained
@@ -6148,8 +5335,7 @@ F: drivers/net/usb/usbnet.c
6148F: include/linux/usb/usbnet.h 5335F: include/linux/usb/usbnet.h
6149 5336
6150USB VIDEO CLASS 5337USB VIDEO CLASS
6151P: Laurent Pinchart 5338M: Laurent Pinchart <laurent.pinchart@skynet.be>
6152M: laurent.pinchart@skynet.be
6153L: linux-uvc-devel@lists.berlios.de (subscribers-only) 5339L: linux-uvc-devel@lists.berlios.de (subscribers-only)
6154L: linux-media@vger.kernel.org 5340L: linux-media@vger.kernel.org
6155T: git git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6.git 5341T: git git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6.git
@@ -6158,8 +5344,7 @@ S: Maintained
6158F: drivers/media/video/uvc/ 5344F: drivers/media/video/uvc/
6159 5345
6160USB W996[87]CF DRIVER 5346USB W996[87]CF DRIVER
6161P: Luca Risolia 5347M: Luca Risolia <luca.risolia@studio.unibo.it>
6162M: luca.risolia@studio.unibo.it
6163L: linux-usb@vger.kernel.org 5348L: linux-usb@vger.kernel.org
6164L: linux-media@vger.kernel.org 5349L: linux-media@vger.kernel.org
6165T: git git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6.git 5350T: git git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6.git
@@ -6169,21 +5354,18 @@ F: Documentation/video4linux/w9968cf.txt
6169F: drivers/media/video/w996* 5354F: drivers/media/video/w996*
6170 5355
6171USB WIRELESS RNDIS DRIVER (rndis_wlan) 5356USB WIRELESS RNDIS DRIVER (rndis_wlan)
6172P: Jussi Kivilinna 5357M: Jussi Kivilinna <jussi.kivilinna@mbnet.fi>
6173M: jussi.kivilinna@mbnet.fi
6174L: linux-wireless@vger.kernel.org 5358L: linux-wireless@vger.kernel.org
6175S: Maintained 5359S: Maintained
6176F: drivers/net/wireless/rndis_wlan.c 5360F: drivers/net/wireless/rndis_wlan.c
6177 5361
6178USB XHCI DRIVER 5362USB XHCI DRIVER
6179P: Sarah Sharp 5363M: Sarah Sharp <sarah.a.sharp@intel.com>
6180M: sarah.a.sharp@intel.com
6181L: linux-usb@vger.kernel.org 5364L: linux-usb@vger.kernel.org
6182S: Supported 5365S: Supported
6183 5366
6184USB ZC0301 DRIVER 5367USB ZC0301 DRIVER
6185P: Luca Risolia 5368M: Luca Risolia <luca.risolia@studio.unibo.it>
6186M: luca.risolia@studio.unibo.it
6187L: linux-usb@vger.kernel.org 5369L: linux-usb@vger.kernel.org
6188L: linux-media@vger.kernel.org 5370L: linux-media@vger.kernel.org
6189T: git git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6.git 5371T: git git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6.git
@@ -6193,16 +5375,14 @@ F: Documentation/video4linux/zc0301.txt
6193F: drivers/media/video/zc0301/ 5375F: drivers/media/video/zc0301/
6194 5376
6195USB ZD1201 DRIVER 5377USB ZD1201 DRIVER
6196P: Jeroen Vreeken 5378M: Jeroen Vreeken <pe1rxq@amsat.org>
6197M: pe1rxq@amsat.org
6198L: linux-usb@vger.kernel.org 5379L: linux-usb@vger.kernel.org
6199W: http://linux-lc100020.sourceforge.net 5380W: http://linux-lc100020.sourceforge.net
6200S: Maintained 5381S: Maintained
6201F: drivers/net/wireless/zd1201.* 5382F: drivers/net/wireless/zd1201.*
6202 5383
6203USB ZR364XX DRIVER 5384USB ZR364XX DRIVER
6204P: Antoine Jacquet 5385M: Antoine Jacquet <royale@zerezo.com>
6205M: royale@zerezo.com
6206L: linux-usb@vger.kernel.org 5386L: linux-usb@vger.kernel.org
6207L: linux-media@vger.kernel.org 5387L: linux-media@vger.kernel.org
6208T: git git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6.git 5388T: git git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6.git
@@ -6212,8 +5392,7 @@ F: Documentation/video4linux/zr364xx.txt
6212F: drivers/media/video/zr364xx.c 5392F: drivers/media/video/zr364xx.c
6213 5393
6214USER-MODE LINUX (UML) 5394USER-MODE LINUX (UML)
6215P: Jeff Dike 5395M: Jeff Dike <jdike@addtoit.com>
6216M: jdike@addtoit.com
6217L: user-mode-linux-devel@lists.sourceforge.net 5396L: user-mode-linux-devel@lists.sourceforge.net
6218L: user-mode-linux-user@lists.sourceforge.net 5397L: user-mode-linux-user@lists.sourceforge.net
6219W: http://user-mode-linux.sourceforge.net 5398W: http://user-mode-linux.sourceforge.net
@@ -6224,26 +5403,22 @@ F: fs/hostfs/
6224F: fs/hppfs/ 5403F: fs/hppfs/
6225 5404
6226USERSPACE I/O (UIO) 5405USERSPACE I/O (UIO)
6227P: Hans J. Koch 5406M: "Hans J. Koch" <hjk@linutronix.de>
6228M: hjk@linutronix.de 5407M: Greg Kroah-Hartman <gregkh@suse.de>
6229P: Greg Kroah-Hartman
6230M: gregkh@suse.de
6231S: Maintained 5408S: Maintained
6232F: Documentation/DocBook/uio-howto.tmpl 5409F: Documentation/DocBook/uio-howto.tmpl
6233F: drivers/uio/ 5410F: drivers/uio/
6234F: include/linux/uio*.h 5411F: include/linux/uio*.h
6235 5412
6236UTIL-LINUX-NG PACKAGE 5413UTIL-LINUX-NG PACKAGE
6237P: Karel Zak 5414M: Karel Zak <kzak@redhat.com>
6238M: kzak@redhat.com
6239L: util-linux-ng@vger.kernel.org 5415L: util-linux-ng@vger.kernel.org
6240W: http://kernel.org/~kzak/util-linux-ng/ 5416W: http://kernel.org/~kzak/util-linux-ng/
6241T: git git://git.kernel.org/pub/scm/utils/util-linux-ng/util-linux-ng.git 5417T: git git://git.kernel.org/pub/scm/utils/util-linux-ng/util-linux-ng.git
6242S: Maintained 5418S: Maintained
6243 5419
6244UVESAFB DRIVER 5420UVESAFB DRIVER
6245P: Michal Januszewski 5421M: Michal Januszewski <spock@gentoo.org>
6246M: spock@gentoo.org
6247L: linux-fbdev-devel@lists.sourceforge.net (moderated for non-subscribers) 5422L: linux-fbdev-devel@lists.sourceforge.net (moderated for non-subscribers)
6248W: http://dev.gentoo.org/~spock/projects/uvesafb/ 5423W: http://dev.gentoo.org/~spock/projects/uvesafb/
6249S: Maintained 5424S: Maintained
@@ -6251,53 +5426,44 @@ F: Documentation/fb/uvesafb.txt
6251F: drivers/video/uvesafb.* 5426F: drivers/video/uvesafb.*
6252 5427
6253VFAT/FAT/MSDOS FILESYSTEM 5428VFAT/FAT/MSDOS FILESYSTEM
6254P: OGAWA Hirofumi 5429M: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
6255M: hirofumi@mail.parknet.co.jp
6256S: Maintained 5430S: Maintained
6257F: Documentation/filesystems/vfat.txt 5431F: Documentation/filesystems/vfat.txt
6258F: fs/fat/ 5432F: fs/fat/
6259 5433
6260VIA RHINE NETWORK DRIVER 5434VIA RHINE NETWORK DRIVER
6261P: Roger Luethi 5435M: Roger Luethi <rl@hellgate.ch>
6262M: rl@hellgate.ch
6263S: Maintained 5436S: Maintained
6264F: drivers/net/via-rhine.c 5437F: drivers/net/via-rhine.c
6265 5438
6266VIAPRO SMBUS DRIVER 5439VIAPRO SMBUS DRIVER
6267P: Jean Delvare 5440M: Jean Delvare <khali@linux-fr.org>
6268M: khali@linux-fr.org
6269L: linux-i2c@vger.kernel.org 5441L: linux-i2c@vger.kernel.org
6270S: Maintained 5442S: Maintained
6271F: Documentation/i2c/busses/i2c-viapro 5443F: Documentation/i2c/busses/i2c-viapro
6272F: drivers/i2c/busses/i2c-viapro.c 5444F: drivers/i2c/busses/i2c-viapro.c
6273 5445
6274VIA SD/MMC CARD CONTROLLER DRIVER 5446VIA SD/MMC CARD CONTROLLER DRIVER
6275P: Joseph Chan 5447M: Joseph Chan <JosephChan@via.com.tw>
6276M: JosephChan@via.com.tw 5448M: Harald Welte <HaraldWelte@viatech.com>
6277P: Harald Welte
6278M: HaraldWelte@viatech.com
6279S: Maintained 5449S: Maintained
6280F: drivers/mmc/host/via-sdmmc.c 5450F: drivers/mmc/host/via-sdmmc.c
6281 5451
6282VIA UNICHROME(PRO)/CHROME9 FRAMEBUFFER DRIVER 5452VIA UNICHROME(PRO)/CHROME9 FRAMEBUFFER DRIVER
6283P: Joseph Chan 5453M: Joseph Chan <JosephChan@via.com.tw>
6284M: JosephChan@via.com.tw 5454M: Scott Fang <ScottFang@viatech.com.cn>
6285P: Scott Fang
6286M: ScottFang@viatech.com.cn
6287L: linux-fbdev-devel@lists.sourceforge.net (moderated for non-subscribers) 5455L: linux-fbdev-devel@lists.sourceforge.net (moderated for non-subscribers)
6288S: Maintained 5456S: Maintained
6289F: drivers/video/via/ 5457F: drivers/video/via/
6290 5458
6291VIA VELOCITY NETWORK DRIVER 5459VIA VELOCITY NETWORK DRIVER
6292P: Francois Romieu 5460M: Francois Romieu <romieu@fr.zoreil.com>
6293M: romieu@fr.zoreil.com
6294L: netdev@vger.kernel.org 5461L: netdev@vger.kernel.org
6295S: Maintained 5462S: Maintained
6296F: drivers/net/via-velocity.* 5463F: drivers/net/via-velocity.*
6297 5464
6298VLAN (802.1Q) 5465VLAN (802.1Q)
6299P: Patrick McHardy 5466M: Patrick McHardy <kaber@trash.net>
6300M: kaber@trash.net
6301L: netdev@vger.kernel.org 5467L: netdev@vger.kernel.org
6302S: Maintained 5468S: Maintained
6303F: drivers/net/macvlan.c 5469F: drivers/net/macvlan.c
@@ -6305,18 +5471,15 @@ F: include/linux/if_*vlan.h
6305F: net/8021q/ 5471F: net/8021q/
6306 5472
6307VLYNQ BUS 5473VLYNQ BUS
6308P: Florian Fainelli 5474M: Florian Fainelli <florian@openwrt.org>
6309M: florian@openwrt.org
6310L: openwrt-devel@lists.openwrt.org 5475L: openwrt-devel@lists.openwrt.org
6311S: Maintained 5476S: Maintained
6312F: drivers/vlynq/vlynq.c 5477F: drivers/vlynq/vlynq.c
6313F: include/linux/vlynq.h 5478F: include/linux/vlynq.h
6314 5479
6315VOLTAGE AND CURRENT REGULATOR FRAMEWORK 5480VOLTAGE AND CURRENT REGULATOR FRAMEWORK
6316P: Liam Girdwood 5481M: Liam Girdwood <lrg@slimlogic.co.uk>
6317M: lrg@slimlogic.co.uk 5482M: Mark Brown <broonie@opensource.wolfsonmicro.com>
6318P: Mark Brown
6319M: broonie@opensource.wolfsonmicro.com
6320W: http://opensource.wolfsonmicro.com/node/15 5483W: http://opensource.wolfsonmicro.com/node/15
6321W: http://www.slimlogic.co.uk/?p=48 5484W: http://www.slimlogic.co.uk/?p=48
6322T: git git://git.kernel.org/pub/scm/linux/kernel/git/lrg/voltage-2.6.git 5485T: git git://git.kernel.org/pub/scm/linux/kernel/git/lrg/voltage-2.6.git
@@ -6325,52 +5488,45 @@ F: drivers/regulator/
6325F: include/linux/regulator/ 5488F: include/linux/regulator/
6326 5489
6327VT1211 HARDWARE MONITOR DRIVER 5490VT1211 HARDWARE MONITOR DRIVER
6328P: Juerg Haefliger 5491M: Juerg Haefliger <juergh@gmail.com>
6329M: juergh@gmail.com
6330L: lm-sensors@lm-sensors.org 5492L: lm-sensors@lm-sensors.org
6331S: Maintained 5493S: Maintained
6332F: Documentation/hwmon/vt1211 5494F: Documentation/hwmon/vt1211
6333F: drivers/hwmon/vt1211.c 5495F: drivers/hwmon/vt1211.c
6334 5496
6335VT8231 HARDWARE MONITOR DRIVER 5497VT8231 HARDWARE MONITOR DRIVER
6336P: Roger Lucas 5498M: Roger Lucas <vt8231@hiddenengine.co.uk>
6337M: vt8231@hiddenengine.co.uk
6338L: lm-sensors@lm-sensors.org 5499L: lm-sensors@lm-sensors.org
6339S: Maintained 5500S: Maintained
6340F: drivers/hwmon/vt8231.c 5501F: drivers/hwmon/vt8231.c
6341 5502
6342W1 DALLAS'S 1-WIRE BUS 5503W1 DALLAS'S 1-WIRE BUS
6343P: Evgeniy Polyakov 5504M: Evgeniy Polyakov <johnpol@2ka.mipt.ru>
6344M: johnpol@2ka.mipt.ru
6345S: Maintained 5505S: Maintained
6346F: Documentation/w1/ 5506F: Documentation/w1/
6347F: drivers/w1/ 5507F: drivers/w1/
6348 5508
6349W83791D HARDWARE MONITORING DRIVER 5509W83791D HARDWARE MONITORING DRIVER
6350P: Marc Hulsman 5510M: Marc Hulsman <m.hulsman@tudelft.nl>
6351M: m.hulsman@tudelft.nl
6352L: lm-sensors@lm-sensors.org 5511L: lm-sensors@lm-sensors.org
6353S: Maintained 5512S: Maintained
6354F: Documentation/hwmon/w83791d 5513F: Documentation/hwmon/w83791d
6355F: drivers/hwmon/w83791d.c 5514F: drivers/hwmon/w83791d.c
6356 5515
6357W83793 HARDWARE MONITORING DRIVER 5516W83793 HARDWARE MONITORING DRIVER
6358P: Rudolf Marek 5517M: Rudolf Marek <r.marek@assembler.cz>
6359M: r.marek@assembler.cz
6360L: lm-sensors@lm-sensors.org 5518L: lm-sensors@lm-sensors.org
6361S: Maintained 5519S: Maintained
6362F: Documentation/hwmon/w83793 5520F: Documentation/hwmon/w83793
6363F: drivers/hwmon/w83793.c 5521F: drivers/hwmon/w83793.c
6364 5522
6365W83L51xD SD/MMC CARD INTERFACE DRIVER 5523W83L51xD SD/MMC CARD INTERFACE DRIVER
6366P: Pierre Ossman 5524M: Pierre Ossman <pierre@ossman.eu>
6367M: pierre@ossman.eu
6368S: Maintained 5525S: Maintained
6369F: drivers/mmc/host/wbsd.* 5526F: drivers/mmc/host/wbsd.*
6370 5527
6371WATCHDOG DEVICE DRIVERS 5528WATCHDOG DEVICE DRIVERS
6372P: Wim Van Sebroeck 5529M: Wim Van Sebroeck <wim@iguana.be>
6373M: wim@iguana.be
6374T: git git://git.kernel.org/pub/scm/linux/kernel/git/wim/linux-2.6-watchdog.git 5530T: git git://git.kernel.org/pub/scm/linux/kernel/git/wim/linux-2.6-watchdog.git
6375S: Maintained 5531S: Maintained
6376F: Documentation/watchdog/ 5532F: Documentation/watchdog/
@@ -6378,8 +5534,7 @@ F: drivers/watchdog/
6378F: include/linux/watchdog.h 5534F: include/linux/watchdog.h
6379 5535
6380WAVELAN NETWORK DRIVER & WIRELESS EXTENSIONS 5536WAVELAN NETWORK DRIVER & WIRELESS EXTENSIONS
6381P: Jean Tourrilhes 5537M: Jean Tourrilhes <jt@hpl.hp.com>
6382M: jt@hpl.hp.com
6383L: linux-wireless@vger.kernel.org 5538L: linux-wireless@vger.kernel.org
6384W: http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/ 5539W: http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/
6385S: Maintained 5540S: Maintained
@@ -6387,46 +5542,39 @@ F: Documentation/networking/wavelan.txt
6387F: drivers/net/wireless/wavelan* 5542F: drivers/net/wireless/wavelan*
6388 5543
6389WD7000 SCSI DRIVER 5544WD7000 SCSI DRIVER
6390P: Miroslav Zagorac 5545M: Miroslav Zagorac <zaga@fly.cc.fer.hr>
6391M: zaga@fly.cc.fer.hr
6392L: linux-scsi@vger.kernel.org 5546L: linux-scsi@vger.kernel.org
6393S: Maintained 5547S: Maintained
6394F: drivers/scsi/wd7000.c 5548F: drivers/scsi/wd7000.c
6395 5549
6396WIMAX STACK 5550WIMAX STACK
6397P: Inaky Perez-Gonzalez 5551M: Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>
6398M: inaky.perez-gonzalez@intel.com
6399M: linux-wimax@intel.com 5552M: linux-wimax@intel.com
6400L: wimax@linuxwimax.org 5553L: wimax@linuxwimax.org
6401S: Supported 5554S: Supported
6402W: http://linuxwimax.org 5555W: http://linuxwimax.org
6403 5556
6404WIMEDIA LLC PROTOCOL (WLP) SUBSYSTEM 5557WIMEDIA LLC PROTOCOL (WLP) SUBSYSTEM
6405P: David Vrabel 5558M: David Vrabel <david.vrabel@csr.com>
6406M: david.vrabel@csr.com
6407S: Maintained 5559S: Maintained
6408F: include/linux/wlp.h 5560F: include/linux/wlp.h
6409F: drivers/uwb/wlp/ 5561F: drivers/uwb/wlp/
6410 5562
6411WISTRON LAPTOP BUTTON DRIVER 5563WISTRON LAPTOP BUTTON DRIVER
6412P: Miloslav Trmac 5564M: Miloslav Trmac <mitr@volny.cz>
6413M: mitr@volny.cz
6414S: Maintained 5565S: Maintained
6415F: drivers/input/misc/wistron_btns.c 5566F: drivers/input/misc/wistron_btns.c
6416 5567
6417WL3501 WIRELESS PCMCIA CARD DRIVER 5568WL3501 WIRELESS PCMCIA CARD DRIVER
6418P: Arnaldo Carvalho de Melo 5569M: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
6419M: acme@ghostprotocols.net
6420L: linux-wireless@vger.kernel.org 5570L: linux-wireless@vger.kernel.org
6421W: http://oops.ghostprotocols.net:81/blog 5571W: http://oops.ghostprotocols.net:81/blog
6422S: Maintained 5572S: Maintained
6423F: drivers/net/wireless/wl3501* 5573F: drivers/net/wireless/wl3501*
6424 5574
6425WM97XX TOUCHSCREEN DRIVERS 5575WM97XX TOUCHSCREEN DRIVERS
6426P: Mark Brown 5576M: Mark Brown <broonie@opensource.wolfsonmicro.com>
6427M: broonie@opensource.wolfsonmicro.com 5577M: Liam Girdwood <lrg@slimlogic.co.uk>
6428P: Liam Girdwood
6429M: lrg@slimlogic.co.uk
6430L: linux-input@vger.kernel.org 5578L: linux-input@vger.kernel.org
6431T: git git://opensource.wolfsonmicro.com/linux-2.6-touch 5579T: git git://opensource.wolfsonmicro.com/linux-2.6-touch
6432W: http://opensource.wolfsonmicro.com/node/7 5580W: http://opensource.wolfsonmicro.com/node/7
@@ -6435,8 +5583,7 @@ F: drivers/input/touchscreen/*wm97*
6435F: include/linux/wm97xx.h 5583F: include/linux/wm97xx.h
6436 5584
6437X.25 NETWORK LAYER 5585X.25 NETWORK LAYER
6438P: Henner Eisen 5586M: Henner Eisen <eis@baty.hanse.de>
6439M: eis@baty.hanse.de
6440L: linux-x25@vger.kernel.org 5587L: linux-x25@vger.kernel.org
6441S: Maintained 5588S: Maintained
6442F: Documentation/networking/x25* 5589F: Documentation/networking/x25*
@@ -6444,12 +5591,9 @@ F: include/net/x25*
6444F: net/x25/ 5591F: net/x25/
6445 5592
6446X86 ARCHITECTURE (32-BIT AND 64-BIT) 5593X86 ARCHITECTURE (32-BIT AND 64-BIT)
6447P: Thomas Gleixner 5594M: Thomas Gleixner <tglx@linutronix.de>
6448M: tglx@linutronix.de 5595M: Ingo Molnar <mingo@redhat.com>
6449P: Ingo Molnar 5596M: "H. Peter Anvin" <hpa@zytor.com>
6450M: mingo@redhat.com
6451P: H. Peter Anvin
6452M: hpa@zytor.com
6453M: x86@kernel.org 5597M: x86@kernel.org
6454T: git git://git.kernel.org/pub/scm/linux/kernel/git/x86/linux-2.6-x86.git 5598T: git git://git.kernel.org/pub/scm/linux/kernel/git/x86/linux-2.6-x86.git
6455S: Maintained 5599S: Maintained
@@ -6457,10 +5601,8 @@ F: Documentation/x86/
6457F: arch/x86/ 5601F: arch/x86/
6458 5602
6459XEN HYPERVISOR INTERFACE 5603XEN HYPERVISOR INTERFACE
6460P: Jeremy Fitzhardinge 5604M: Jeremy Fitzhardinge <jeremy@xensource.com>
6461M: jeremy@xensource.com 5605M: Chris Wright <chrisw@sous-sol.org>
6462P: Chris Wright
6463M: chrisw@sous-sol.org
6464L: virtualization@lists.osdl.org 5606L: virtualization@lists.osdl.org
6465L: xen-devel@lists.xensource.com 5607L: xen-devel@lists.xensource.com
6466S: Supported 5608S: Supported
@@ -6472,8 +5614,7 @@ F: include/xen/
6472 5614
6473XFS FILESYSTEM 5615XFS FILESYSTEM
6474P: Silicon Graphics Inc 5616P: Silicon Graphics Inc
6475P: Felix Blyakher 5617M: Felix Blyakher <felixb@sgi.com>
6476M: felixb@sgi.com
6477M: xfs-masters@oss.sgi.com 5618M: xfs-masters@oss.sgi.com
6478L: xfs@oss.sgi.com 5619L: xfs@oss.sgi.com
6479W: http://oss.sgi.com/projects/xfs 5620W: http://oss.sgi.com/projects/xfs
@@ -6483,38 +5624,33 @@ F: Documentation/filesystems/xfs.txt
6483F: fs/xfs/ 5624F: fs/xfs/
6484 5625
6485XILINX SYSTEMACE DRIVER 5626XILINX SYSTEMACE DRIVER
6486P: Grant Likely 5627M: Grant Likely <grant.likely@secretlab.ca>
6487M: grant.likely@secretlab.ca
6488W: http://www.secretlab.ca/ 5628W: http://www.secretlab.ca/
6489S: Maintained 5629S: Maintained
6490F: drivers/block/xsysace.c 5630F: drivers/block/xsysace.c
6491 5631
6492XILINX UARTLITE SERIAL DRIVER 5632XILINX UARTLITE SERIAL DRIVER
6493P: Peter Korsgaard 5633M: Peter Korsgaard <jacmet@sunsite.dk>
6494M: jacmet@sunsite.dk
6495L: linux-serial@vger.kernel.org 5634L: linux-serial@vger.kernel.org
6496S: Maintained 5635S: Maintained
6497F: drivers/serial/uartlite.c 5636F: drivers/serial/uartlite.c
6498 5637
6499YAM DRIVER FOR AX.25 5638YAM DRIVER FOR AX.25
6500P: Jean-Paul Roubelat 5639M: Jean-Paul Roubelat <jpr@f6fbb.org>
6501M: jpr@f6fbb.org
6502L: linux-hams@vger.kernel.org 5640L: linux-hams@vger.kernel.org
6503S: Maintained 5641S: Maintained
6504F: drivers/net/hamradio/yam* 5642F: drivers/net/hamradio/yam*
6505F: include/linux/yam.h 5643F: include/linux/yam.h
6506 5644
6507YEALINK PHONE DRIVER 5645YEALINK PHONE DRIVER
6508P: Henk Vergonet 5646M: Henk Vergonet <Henk.Vergonet@gmail.com>
6509M: Henk.Vergonet@gmail.com
6510L: usbb2k-api-dev@nongnu.org 5647L: usbb2k-api-dev@nongnu.org
6511S: Maintained 5648S: Maintained
6512F: Documentation/input/yealink.txt 5649F: Documentation/input/yealink.txt
6513F: drivers/input/misc/yealink.* 5650F: drivers/input/misc/yealink.*
6514 5651
6515Z8530 DRIVER FOR AX.25 5652Z8530 DRIVER FOR AX.25
6516P: Joerg Reuter 5653M: Joerg Reuter <jreuter@yaina.de>
6517M: jreuter@yaina.de
6518W: http://yaina.de/jreuter/ 5654W: http://yaina.de/jreuter/
6519W: http://www.qsl.net/dl1bke/ 5655W: http://www.qsl.net/dl1bke/
6520L: linux-hams@vger.kernel.org 5656L: linux-hams@vger.kernel.org
@@ -6524,10 +5660,8 @@ F: drivers/net/hamradio/*scc.c
6524F: drivers/net/hamradio/z8530.h 5660F: drivers/net/hamradio/z8530.h
6525 5661
6526ZD1211RW WIRELESS DRIVER 5662ZD1211RW WIRELESS DRIVER
6527P: Daniel Drake 5663M: Daniel Drake <dsd@gentoo.org>
6528M: dsd@gentoo.org 5664M: Ulrich Kunitz <kune@deine-taler.de>
6529P: Ulrich Kunitz
6530M: kune@deine-taler.de
6531W: http://zd1211.ath.cx/wiki/DriverRewrite 5665W: http://zd1211.ath.cx/wiki/DriverRewrite
6532L: linux-wireless@vger.kernel.org 5666L: linux-wireless@vger.kernel.org
6533L: zd1211-devs@lists.sourceforge.net (subscribers-only) 5667L: zd1211-devs@lists.sourceforge.net (subscribers-only)
@@ -6543,14 +5677,12 @@ S: Odd Fixes
6543F: drivers/media/video/zoran/ 5677F: drivers/media/video/zoran/
6544 5678
6545ZS DECSTATION Z85C30 SERIAL DRIVER 5679ZS DECSTATION Z85C30 SERIAL DRIVER
6546P: Maciej W. Rozycki 5680M: "Maciej W. Rozycki" <macro@linux-mips.org>
6547M: macro@linux-mips.org
6548S: Maintained 5681S: Maintained
6549F: drivers/serial/zs.* 5682F: drivers/serial/zs.*
6550 5683
6551THE REST 5684THE REST
6552P: Linus Torvalds 5685M: Linus Torvalds <torvalds@linux-foundation.org>
6553M: torvalds@linux-foundation.org
6554L: linux-kernel@vger.kernel.org 5686L: linux-kernel@vger.kernel.org
6555T: git git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git 5687T: git git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git
6556S: Buried alive in reporters 5688S: Buried alive in reporters
diff --git a/Makefile b/Makefile
index d1216fea0c92..0d46615bffe5 100644
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,7 @@
1VERSION = 2 1VERSION = 2
2PATCHLEVEL = 6 2PATCHLEVEL = 6
3SUBLEVEL = 31 3SUBLEVEL = 31
4EXTRAVERSION = -rc1 4EXTRAVERSION = -rc5
5NAME = Man-Eating Seals of Antiquity 5NAME = Man-Eating Seals of Antiquity
6 6
7# *DOCUMENTATION* 7# *DOCUMENTATION*
@@ -140,15 +140,13 @@ _all: modules
140endif 140endif
141 141
142srctree := $(if $(KBUILD_SRC),$(KBUILD_SRC),$(CURDIR)) 142srctree := $(if $(KBUILD_SRC),$(KBUILD_SRC),$(CURDIR))
143TOPDIR := $(srctree)
144# FIXME - TOPDIR is obsolete, use srctree/objtree
145objtree := $(CURDIR) 143objtree := $(CURDIR)
146src := $(srctree) 144src := $(srctree)
147obj := $(objtree) 145obj := $(objtree)
148 146
149VPATH := $(srctree)$(if $(KBUILD_EXTMOD),:$(KBUILD_EXTMOD)) 147VPATH := $(srctree)$(if $(KBUILD_EXTMOD),:$(KBUILD_EXTMOD))
150 148
151export srctree objtree VPATH TOPDIR 149export srctree objtree VPATH
152 150
153 151
154# SUBARCH tells the usermode build what the underlying arch is. That is set 152# SUBARCH tells the usermode build what the underlying arch is. That is set
@@ -344,7 +342,9 @@ KBUILD_CPPFLAGS := -D__KERNEL__
344 342
345KBUILD_CFLAGS := -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs \ 343KBUILD_CFLAGS := -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs \
346 -fno-strict-aliasing -fno-common \ 344 -fno-strict-aliasing -fno-common \
347 -Werror-implicit-function-declaration 345 -Werror-implicit-function-declaration \
346 -Wno-format-security \
347 -fno-delete-null-pointer-checks
348KBUILD_AFLAGS := -D__ASSEMBLY__ 348KBUILD_AFLAGS := -D__ASSEMBLY__
349 349
350# Read KERNELRELEASE from include/config/kernel.release (if it exists) 350# Read KERNELRELEASE from include/config/kernel.release (if it exists)
@@ -566,7 +566,7 @@ KBUILD_CFLAGS += $(call cc-option,-Wdeclaration-after-statement,)
566KBUILD_CFLAGS += $(call cc-option,-Wno-pointer-sign,) 566KBUILD_CFLAGS += $(call cc-option,-Wno-pointer-sign,)
567 567
568# disable invalid "can't wrap" optimizations for signed / pointers 568# disable invalid "can't wrap" optimizations for signed / pointers
569KBUILD_CFLAGS += $(call cc-option,-fwrapv) 569KBUILD_CFLAGS += $(call cc-option,-fno-strict-overflow)
570 570
571# revert to pre-gcc-4.4 behaviour of .eh_frame 571# revert to pre-gcc-4.4 behaviour of .eh_frame
572KBUILD_CFLAGS += $(call cc-option,-fno-dwarf2-cfi-asm) 572KBUILD_CFLAGS += $(call cc-option,-fno-dwarf2-cfi-asm)
diff --git a/arch/alpha/include/asm/percpu.h b/arch/alpha/include/asm/percpu.h
index 06c5c7a4afd3..b663f1f10b6a 100644
--- a/arch/alpha/include/asm/percpu.h
+++ b/arch/alpha/include/asm/percpu.h
@@ -30,7 +30,7 @@ extern unsigned long __per_cpu_offset[NR_CPUS];
30 30
31#ifndef MODULE 31#ifndef MODULE
32#define SHIFT_PERCPU_PTR(var, offset) RELOC_HIDE(&per_cpu_var(var), (offset)) 32#define SHIFT_PERCPU_PTR(var, offset) RELOC_HIDE(&per_cpu_var(var), (offset))
33#define PER_CPU_ATTRIBUTES 33#define PER_CPU_DEF_ATTRIBUTES
34#else 34#else
35/* 35/*
36 * To calculate addresses of locally defined variables, GCC uses 32-bit 36 * To calculate addresses of locally defined variables, GCC uses 32-bit
@@ -49,7 +49,7 @@ extern unsigned long __per_cpu_offset[NR_CPUS];
49 : "=&r"(__ptr), "=&r"(tmp_gp)); \ 49 : "=&r"(__ptr), "=&r"(tmp_gp)); \
50 (typeof(&per_cpu_var(var)))(__ptr + (offset)); }) 50 (typeof(&per_cpu_var(var)))(__ptr + (offset)); })
51 51
52#define PER_CPU_ATTRIBUTES __used 52#define PER_CPU_DEF_ATTRIBUTES __used
53 53
54#endif /* MODULE */ 54#endif /* MODULE */
55 55
@@ -71,7 +71,7 @@ extern unsigned long __per_cpu_offset[NR_CPUS];
71#define __get_cpu_var(var) per_cpu_var(var) 71#define __get_cpu_var(var) per_cpu_var(var)
72#define __raw_get_cpu_var(var) per_cpu_var(var) 72#define __raw_get_cpu_var(var) per_cpu_var(var)
73 73
74#define PER_CPU_ATTRIBUTES 74#define PER_CPU_DEF_ATTRIBUTES
75 75
76#endif /* SMP */ 76#endif /* SMP */
77 77
diff --git a/arch/alpha/include/asm/thread_info.h b/arch/alpha/include/asm/thread_info.h
index d069526bd767..60c83abfde70 100644
--- a/arch/alpha/include/asm/thread_info.h
+++ b/arch/alpha/include/asm/thread_info.h
@@ -37,6 +37,7 @@ struct thread_info {
37 .task = &tsk, \ 37 .task = &tsk, \
38 .exec_domain = &default_exec_domain, \ 38 .exec_domain = &default_exec_domain, \
39 .addr_limit = KERNEL_DS, \ 39 .addr_limit = KERNEL_DS, \
40 .preempt_count = INIT_PREEMPT_COUNT, \
40 .restart_block = { \ 41 .restart_block = { \
41 .fn = do_no_restart_syscall, \ 42 .fn = do_no_restart_syscall, \
42 }, \ 43 }, \
diff --git a/arch/alpha/include/asm/tlb.h b/arch/alpha/include/asm/tlb.h
index c13636575fba..42866759f3fa 100644
--- a/arch/alpha/include/asm/tlb.h
+++ b/arch/alpha/include/asm/tlb.h
@@ -9,7 +9,7 @@
9 9
10#include <asm-generic/tlb.h> 10#include <asm-generic/tlb.h>
11 11
12#define __pte_free_tlb(tlb, pte) pte_free((tlb)->mm, pte) 12#define __pte_free_tlb(tlb, pte, address) pte_free((tlb)->mm, pte)
13#define __pmd_free_tlb(tlb, pmd) pmd_free((tlb)->mm, pmd) 13#define __pmd_free_tlb(tlb, pmd, address) pmd_free((tlb)->mm, pmd)
14 14
15#endif 15#endif
diff --git a/arch/alpha/kernel/ptrace.c b/arch/alpha/kernel/ptrace.c
index 1e9ad52c460e..e072041d19f8 100644
--- a/arch/alpha/kernel/ptrace.c
+++ b/arch/alpha/kernel/ptrace.c
@@ -8,7 +8,6 @@
8#include <linux/sched.h> 8#include <linux/sched.h>
9#include <linux/mm.h> 9#include <linux/mm.h>
10#include <linux/smp.h> 10#include <linux/smp.h>
11#include <linux/smp_lock.h>
12#include <linux/errno.h> 11#include <linux/errno.h>
13#include <linux/ptrace.h> 12#include <linux/ptrace.h>
14#include <linux/user.h> 13#include <linux/user.h>
diff --git a/arch/arm/Kconfig.debug b/arch/arm/Kconfig.debug
index a71fd941ade7..a89e4734b8f0 100644
--- a/arch/arm/Kconfig.debug
+++ b/arch/arm/Kconfig.debug
@@ -99,14 +99,6 @@ config DEBUG_CLPS711X_UART2
99 output to the second serial port on these devices. Saying N will 99 output to the second serial port on these devices. Saying N will
100 cause the debug messages to appear on the first serial port. 100 cause the debug messages to appear on the first serial port.
101 101
102config DEBUG_S3C_PORT
103 depends on DEBUG_LL && PLAT_S3C
104 bool "Kernel low-level debugging messages via S3C UART"
105 help
106 Say Y here if you want debug print routines to go to one of the
107 S3C internal UARTs. The chosen UART must have been configured
108 before it is used.
109
110config DEBUG_S3C_UART 102config DEBUG_S3C_UART
111 depends on PLAT_S3C 103 depends on PLAT_S3C
112 int "S3C UART to use for low-level debug" 104 int "S3C UART to use for low-level debug"
diff --git a/arch/arm/boot/compressed/misc.c b/arch/arm/boot/compressed/misc.c
index 9e6e512f0117..17153b54613b 100644
--- a/arch/arm/boot/compressed/misc.c
+++ b/arch/arm/boot/compressed/misc.c
@@ -29,7 +29,6 @@ unsigned int __machine_arch_type;
29 29
30static void putstr(const char *ptr); 30static void putstr(const char *ptr);
31 31
32#include <linux/compiler.h>
33#include <mach/uncompress.h> 32#include <mach/uncompress.h>
34 33
35#ifdef CONFIG_DEBUG_ICEDCC 34#ifdef CONFIG_DEBUG_ICEDCC
diff --git a/arch/arm/common/clkdev.c b/arch/arm/common/clkdev.c
index f37afd9422f3..aae5bc01acc8 100644
--- a/arch/arm/common/clkdev.c
+++ b/arch/arm/common/clkdev.c
@@ -17,6 +17,7 @@
17#include <linux/err.h> 17#include <linux/err.h>
18#include <linux/string.h> 18#include <linux/string.h>
19#include <linux/mutex.h> 19#include <linux/mutex.h>
20#include <linux/clk.h>
20 21
21#include <asm/clkdev.h> 22#include <asm/clkdev.h>
22#include <mach/clkdev.h> 23#include <mach/clkdev.h>
diff --git a/arch/arm/configs/kb9202_defconfig b/arch/arm/configs/kb9202_defconfig
index 8e74c66f239d..605a8462f172 100644
--- a/arch/arm/configs/kb9202_defconfig
+++ b/arch/arm/configs/kb9202_defconfig
@@ -1,109 +1,246 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.13-rc2 3# Linux kernel version: 2.6.30-rc8
4# Sun Aug 14 19:26:59 2005 4# Wed Jun 3 13:52:33 2009
5# 5#
6CONFIG_ARM=y 6CONFIG_ARM=y
7CONFIG_SYS_SUPPORTS_APM_EMULATION=y
8CONFIG_GENERIC_GPIO=y
9CONFIG_GENERIC_TIME=y
10CONFIG_GENERIC_CLOCKEVENTS=y
7CONFIG_MMU=y 11CONFIG_MMU=y
8CONFIG_UID16=y 12# CONFIG_NO_IOPORT is not set
13CONFIG_GENERIC_HARDIRQS=y
14CONFIG_STACKTRACE_SUPPORT=y
15CONFIG_HAVE_LATENCYTOP_SUPPORT=y
16CONFIG_LOCKDEP_SUPPORT=y
17CONFIG_TRACE_IRQFLAGS_SUPPORT=y
18CONFIG_HARDIRQS_SW_RESEND=y
19CONFIG_GENERIC_IRQ_PROBE=y
9CONFIG_RWSEM_GENERIC_SPINLOCK=y 20CONFIG_RWSEM_GENERIC_SPINLOCK=y
21# CONFIG_ARCH_HAS_ILOG2_U32 is not set
22# CONFIG_ARCH_HAS_ILOG2_U64 is not set
23CONFIG_GENERIC_HWEIGHT=y
10CONFIG_GENERIC_CALIBRATE_DELAY=y 24CONFIG_GENERIC_CALIBRATE_DELAY=y
25CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
26CONFIG_VECTORS_BASE=0xffff0000
27CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
11 28
12# 29#
13# Code maturity level options 30# General setup
14# 31#
15# CONFIG_EXPERIMENTAL is not set 32CONFIG_EXPERIMENTAL=y
16CONFIG_CLEAN_COMPILE=y
17CONFIG_BROKEN_ON_SMP=y 33CONFIG_BROKEN_ON_SMP=y
34CONFIG_LOCK_KERNEL=y
18CONFIG_INIT_ENV_ARG_LIMIT=32 35CONFIG_INIT_ENV_ARG_LIMIT=32
19
20#
21# General setup
22#
23CONFIG_LOCALVERSION="" 36CONFIG_LOCALVERSION=""
37CONFIG_LOCALVERSION_AUTO=y
24# CONFIG_SWAP is not set 38# CONFIG_SWAP is not set
25# CONFIG_SYSVIPC is not set 39CONFIG_SYSVIPC=y
26# CONFIG_BSD_PROCESS_ACCT is not set 40CONFIG_SYSVIPC_SYSCTL=y
41CONFIG_POSIX_MQUEUE=y
42CONFIG_POSIX_MQUEUE_SYSCTL=y
43CONFIG_BSD_PROCESS_ACCT=y
44# CONFIG_BSD_PROCESS_ACCT_V3 is not set
45# CONFIG_TASKSTATS is not set
46CONFIG_AUDIT=y
47
48#
49# RCU Subsystem
50#
51CONFIG_CLASSIC_RCU=y
52# CONFIG_TREE_RCU is not set
53# CONFIG_PREEMPT_RCU is not set
54# CONFIG_TREE_RCU_TRACE is not set
55# CONFIG_PREEMPT_RCU_TRACE is not set
56CONFIG_IKCONFIG=y
57CONFIG_IKCONFIG_PROC=y
58CONFIG_LOG_BUF_SHIFT=17
59# CONFIG_GROUP_SCHED is not set
60# CONFIG_CGROUPS is not set
61# CONFIG_SYSFS_DEPRECATED_V2 is not set
62# CONFIG_RELAY is not set
63CONFIG_NAMESPACES=y
64# CONFIG_UTS_NS is not set
65# CONFIG_IPC_NS is not set
66# CONFIG_USER_NS is not set
67# CONFIG_PID_NS is not set
68# CONFIG_NET_NS is not set
69CONFIG_BLK_DEV_INITRD=y
70CONFIG_INITRAMFS_SOURCE=""
71CONFIG_RD_GZIP=y
72CONFIG_RD_BZIP2=y
73CONFIG_RD_LZMA=y
74CONFIG_CC_OPTIMIZE_FOR_SIZE=y
27CONFIG_SYSCTL=y 75CONFIG_SYSCTL=y
28# CONFIG_AUDIT is not set 76CONFIG_ANON_INODES=y
29CONFIG_HOTPLUG=y
30# CONFIG_KOBJECT_UEVENT is not set
31# CONFIG_IKCONFIG is not set
32# CONFIG_EMBEDDED is not set 77# CONFIG_EMBEDDED is not set
78CONFIG_UID16=y
79CONFIG_SYSCTL_SYSCALL=y
33CONFIG_KALLSYMS=y 80CONFIG_KALLSYMS=y
34# CONFIG_KALLSYMS_ALL is not set 81# CONFIG_KALLSYMS_ALL is not set
35# CONFIG_KALLSYMS_EXTRA_PASS is not set 82CONFIG_KALLSYMS_EXTRA_PASS=y
83# CONFIG_STRIP_ASM_SYMS is not set
84CONFIG_HOTPLUG=y
36CONFIG_PRINTK=y 85CONFIG_PRINTK=y
37CONFIG_BUG=y 86CONFIG_BUG=y
87CONFIG_ELF_CORE=y
38CONFIG_BASE_FULL=y 88CONFIG_BASE_FULL=y
39CONFIG_FUTEX=y 89CONFIG_FUTEX=y
40CONFIG_EPOLL=y 90CONFIG_EPOLL=y
41CONFIG_CC_OPTIMIZE_FOR_SIZE=y 91CONFIG_SIGNALFD=y
92CONFIG_TIMERFD=y
93CONFIG_EVENTFD=y
42CONFIG_SHMEM=y 94CONFIG_SHMEM=y
43CONFIG_CC_ALIGN_FUNCTIONS=0 95CONFIG_AIO=y
44CONFIG_CC_ALIGN_LABELS=0 96CONFIG_VM_EVENT_COUNTERS=y
45CONFIG_CC_ALIGN_LOOPS=0 97CONFIG_SLUB_DEBUG=y
46CONFIG_CC_ALIGN_JUMPS=0 98CONFIG_COMPAT_BRK=y
47# CONFIG_TINY_SHMEM is not set 99# CONFIG_SLAB is not set
100CONFIG_SLUB=y
101# CONFIG_SLOB is not set
102# CONFIG_PROFILING is not set
103CONFIG_TRACEPOINTS=y
104CONFIG_MARKERS=y
105CONFIG_HAVE_OPROFILE=y
106# CONFIG_KPROBES is not set
107CONFIG_HAVE_KPROBES=y
108CONFIG_HAVE_KRETPROBES=y
109CONFIG_HAVE_CLK=y
110# CONFIG_SLOW_WORK is not set
111CONFIG_HAVE_GENERIC_DMA_COHERENT=y
112CONFIG_SLABINFO=y
113CONFIG_RT_MUTEXES=y
48CONFIG_BASE_SMALL=0 114CONFIG_BASE_SMALL=0
115CONFIG_MODULES=y
116# CONFIG_MODULE_FORCE_LOAD is not set
117CONFIG_MODULE_UNLOAD=y
118# CONFIG_MODULE_FORCE_UNLOAD is not set
119CONFIG_MODVERSIONS=y
120CONFIG_MODULE_SRCVERSION_ALL=y
121CONFIG_BLOCK=y
122# CONFIG_LBD is not set
123# CONFIG_BLK_DEV_BSG is not set
124# CONFIG_BLK_DEV_INTEGRITY is not set
49 125
50# 126#
51# Loadable module support 127# IO Schedulers
52# 128#
53CONFIG_MODULES=y 129CONFIG_IOSCHED_NOOP=y
54CONFIG_MODULE_UNLOAD=y 130# CONFIG_IOSCHED_AS is not set
55CONFIG_OBSOLETE_MODPARM=y 131# CONFIG_IOSCHED_DEADLINE is not set
56# CONFIG_MODULE_SRCVERSION_ALL is not set 132CONFIG_IOSCHED_CFQ=y
57CONFIG_KMOD=y 133# CONFIG_DEFAULT_AS is not set
134# CONFIG_DEFAULT_DEADLINE is not set
135CONFIG_DEFAULT_CFQ=y
136# CONFIG_DEFAULT_NOOP is not set
137CONFIG_DEFAULT_IOSCHED="cfq"
138# CONFIG_FREEZER is not set
58 139
59# 140#
60# System Type 141# System Type
61# 142#
62# CONFIG_ARCH_CLPS7500 is not set 143# CONFIG_ARCH_AAEC2000 is not set
144# CONFIG_ARCH_INTEGRATOR is not set
145# CONFIG_ARCH_REALVIEW is not set
146# CONFIG_ARCH_VERSATILE is not set
147CONFIG_ARCH_AT91=y
63# CONFIG_ARCH_CLPS711X is not set 148# CONFIG_ARCH_CLPS711X is not set
64# CONFIG_ARCH_CO285 is not set
65# CONFIG_ARCH_EBSA110 is not set 149# CONFIG_ARCH_EBSA110 is not set
150# CONFIG_ARCH_EP93XX is not set
151# CONFIG_ARCH_GEMINI is not set
66# CONFIG_ARCH_FOOTBRIDGE is not set 152# CONFIG_ARCH_FOOTBRIDGE is not set
67# CONFIG_ARCH_INTEGRATOR is not set 153# CONFIG_ARCH_NETX is not set
68# CONFIG_ARCH_IOP3XX is not set 154# CONFIG_ARCH_H720X is not set
69# CONFIG_ARCH_IXP4XX is not set 155# CONFIG_ARCH_IMX is not set
156# CONFIG_ARCH_IOP13XX is not set
157# CONFIG_ARCH_IOP32X is not set
158# CONFIG_ARCH_IOP33X is not set
159# CONFIG_ARCH_IXP23XX is not set
70# CONFIG_ARCH_IXP2000 is not set 160# CONFIG_ARCH_IXP2000 is not set
161# CONFIG_ARCH_IXP4XX is not set
71# CONFIG_ARCH_L7200 is not set 162# CONFIG_ARCH_L7200 is not set
163# CONFIG_ARCH_KIRKWOOD is not set
164# CONFIG_ARCH_KS8695 is not set
165# CONFIG_ARCH_NS9XXX is not set
166# CONFIG_ARCH_LOKI is not set
167# CONFIG_ARCH_MV78XX0 is not set
168# CONFIG_ARCH_MXC is not set
169# CONFIG_ARCH_ORION5X is not set
170# CONFIG_ARCH_PNX4008 is not set
72# CONFIG_ARCH_PXA is not set 171# CONFIG_ARCH_PXA is not set
172# CONFIG_ARCH_MMP is not set
73# CONFIG_ARCH_RPC is not set 173# CONFIG_ARCH_RPC is not set
74# CONFIG_ARCH_SA1100 is not set 174# CONFIG_ARCH_SA1100 is not set
75# CONFIG_ARCH_S3C2410 is not set 175# CONFIG_ARCH_S3C2410 is not set
176# CONFIG_ARCH_S3C64XX is not set
76# CONFIG_ARCH_SHARK is not set 177# CONFIG_ARCH_SHARK is not set
77# CONFIG_ARCH_LH7A40X is not set 178# CONFIG_ARCH_LH7A40X is not set
179# CONFIG_ARCH_DAVINCI is not set
78# CONFIG_ARCH_OMAP is not set 180# CONFIG_ARCH_OMAP is not set
79# CONFIG_ARCH_VERSATILE is not set 181# CONFIG_ARCH_MSM is not set
80# CONFIG_ARCH_IMX is not set 182# CONFIG_ARCH_W90X900 is not set
81# CONFIG_ARCH_H720X is not set 183
82# CONFIG_ARCH_AAEC2000 is not set 184#
83CONFIG_ARCH_AT91=y 185# Atmel AT91 System-on-Chip
186#
84CONFIG_ARCH_AT91RM9200=y 187CONFIG_ARCH_AT91RM9200=y
188# CONFIG_ARCH_AT91SAM9260 is not set
189# CONFIG_ARCH_AT91SAM9261 is not set
190# CONFIG_ARCH_AT91SAM9263 is not set
191# CONFIG_ARCH_AT91SAM9RL is not set
192# CONFIG_ARCH_AT91SAM9G20 is not set
193# CONFIG_ARCH_AT91CAP9 is not set
194# CONFIG_ARCH_AT91X40 is not set
195CONFIG_AT91_PMC_UNIT=y
85 196
86# 197#
87# AT91RM9200 Implementations 198# AT91RM9200 Board Type
88# 199#
200# CONFIG_MACH_ONEARM is not set
89# CONFIG_ARCH_AT91RM9200DK is not set 201# CONFIG_ARCH_AT91RM9200DK is not set
90# CONFIG_MACH_AT91RM9200EK is not set 202# CONFIG_MACH_AT91RM9200EK is not set
91# CONFIG_MACH_CSB337 is not set 203# CONFIG_MACH_CSB337 is not set
92# CONFIG_MACH_CSB637 is not set 204# CONFIG_MACH_CSB637 is not set
93# CONFIG_MACH_CARMEVA is not set 205# CONFIG_MACH_CARMEVA is not set
206# CONFIG_MACH_ATEB9200 is not set
94CONFIG_MACH_KB9200=y 207CONFIG_MACH_KB9200=y
208# CONFIG_MACH_PICOTUX2XX is not set
209# CONFIG_MACH_KAFA is not set
210# CONFIG_MACH_ECBAT91 is not set
211# CONFIG_MACH_YL9200 is not set
212
213#
214# AT91 Board Options
215#
216
217#
218# AT91 Feature Selections
219#
220CONFIG_AT91_PROGRAMMABLE_CLOCKS=y
221CONFIG_AT91_TIMER_HZ=128
222CONFIG_AT91_EARLY_DBGU=y
223# CONFIG_AT91_EARLY_USART0 is not set
224# CONFIG_AT91_EARLY_USART1 is not set
225# CONFIG_AT91_EARLY_USART2 is not set
226# CONFIG_AT91_EARLY_USART3 is not set
227# CONFIG_AT91_EARLY_USART4 is not set
228# CONFIG_AT91_EARLY_USART5 is not set
95 229
96# 230#
97# Processor Type 231# Processor Type
98# 232#
99CONFIG_CPU_32=y 233CONFIG_CPU_32=y
100CONFIG_CPU_ARM920T=y 234CONFIG_CPU_ARM920T=y
101CONFIG_CPU_32v4=y 235CONFIG_CPU_32v4T=y
102CONFIG_CPU_ABRT_EV4T=y 236CONFIG_CPU_ABRT_EV4T=y
237CONFIG_CPU_PABRT_NOIFAR=y
103CONFIG_CPU_CACHE_V4WT=y 238CONFIG_CPU_CACHE_V4WT=y
104CONFIG_CPU_CACHE_VIVT=y 239CONFIG_CPU_CACHE_VIVT=y
105CONFIG_CPU_COPY_V4WB=y 240CONFIG_CPU_COPY_V4WB=y
106CONFIG_CPU_TLB_V4WBI=y 241CONFIG_CPU_TLB_V4WBI=y
242CONFIG_CPU_CP15=y
243CONFIG_CPU_CP15_MMU=y
107 244
108# 245#
109# Processor Features 246# Processor Features
@@ -112,23 +249,48 @@ CONFIG_ARM_THUMB=y
112# CONFIG_CPU_ICACHE_DISABLE is not set 249# CONFIG_CPU_ICACHE_DISABLE is not set
113# CONFIG_CPU_DCACHE_DISABLE is not set 250# CONFIG_CPU_DCACHE_DISABLE is not set
114# CONFIG_CPU_DCACHE_WRITETHROUGH is not set 251# CONFIG_CPU_DCACHE_WRITETHROUGH is not set
252# CONFIG_OUTER_CACHE is not set
115 253
116# 254#
117# Bus support 255# Bus support
118# 256#
119CONFIG_ISA_DMA_API=y 257# CONFIG_PCI_SYSCALL is not set
120 258# CONFIG_ARCH_SUPPORTS_MSI is not set
121#
122# PCCARD (PCMCIA/CardBus) support
123#
124# CONFIG_PCCARD is not set 259# CONFIG_PCCARD is not set
125 260
126# 261#
127# Kernel Features 262# Kernel Features
128# 263#
129# CONFIG_ARCH_DISCONTIGMEM_ENABLE is not set 264CONFIG_TICK_ONESHOT=y
265CONFIG_NO_HZ=y
266CONFIG_HIGH_RES_TIMERS=y
267CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
268CONFIG_VMSPLIT_3G=y
269# CONFIG_VMSPLIT_2G is not set
270# CONFIG_VMSPLIT_1G is not set
271CONFIG_PAGE_OFFSET=0xC0000000
272CONFIG_PREEMPT=y
273CONFIG_HZ=128
274CONFIG_AEABI=y
275CONFIG_OABI_COMPAT=y
276# CONFIG_ARCH_HAS_HOLES_MEMORYMODEL is not set
277# CONFIG_ARCH_SPARSEMEM_DEFAULT is not set
278# CONFIG_ARCH_SELECT_MEMORY_MODEL is not set
279# CONFIG_HIGHMEM is not set
280CONFIG_SELECT_MEMORY_MODEL=y
281CONFIG_FLATMEM_MANUAL=y
282# CONFIG_DISCONTIGMEM_MANUAL is not set
283# CONFIG_SPARSEMEM_MANUAL is not set
130CONFIG_FLATMEM=y 284CONFIG_FLATMEM=y
131CONFIG_FLAT_NODE_MEM_MAP=y 285CONFIG_FLAT_NODE_MEM_MAP=y
286CONFIG_PAGEFLAGS_EXTENDED=y
287CONFIG_SPLIT_PTLOCK_CPUS=4096
288# CONFIG_PHYS_ADDR_T_64BIT is not set
289CONFIG_ZONE_DMA_FLAG=0
290CONFIG_VIRT_TO_BUS=y
291CONFIG_UNEVICTABLE_LRU=y
292CONFIG_HAVE_MLOCK=y
293CONFIG_HAVE_MLOCKED_PAGE_BIT=y
132# CONFIG_LEDS is not set 294# CONFIG_LEDS is not set
133CONFIG_ALIGNMENT_TRAP=y 295CONFIG_ALIGNMENT_TRAP=y
134 296
@@ -137,8 +299,16 @@ CONFIG_ALIGNMENT_TRAP=y
137# 299#
138CONFIG_ZBOOT_ROM_TEXT=0x10000000 300CONFIG_ZBOOT_ROM_TEXT=0x10000000
139CONFIG_ZBOOT_ROM_BSS=0x20040000 301CONFIG_ZBOOT_ROM_BSS=0x20040000
140CONFIG_ZBOOT_ROM=y 302# CONFIG_ZBOOT_ROM is not set
141CONFIG_CMDLINE="console=ttyS0,115200 root=/dev/ram rw initrd=0x20210000,654933" 303CONFIG_CMDLINE="noinitrd root=/dev/mtdblock0 rootfstype=jffs2 mem=64M"
304# CONFIG_XIP_KERNEL is not set
305CONFIG_KEXEC=y
306CONFIG_ATAGS_PROC=y
307
308#
309# CPU Power Management
310#
311# CONFIG_CPU_IDLE is not set
142 312
143# 313#
144# Floating point emulation 314# Floating point emulation
@@ -149,74 +319,251 @@ CONFIG_CMDLINE="console=ttyS0,115200 root=/dev/ram rw initrd=0x20210000,654933"
149# 319#
150CONFIG_FPE_NWFPE=y 320CONFIG_FPE_NWFPE=y
151# CONFIG_FPE_NWFPE_XP is not set 321# CONFIG_FPE_NWFPE_XP is not set
322# CONFIG_FPE_FASTFPE is not set
152 323
153# 324#
154# Userspace binary formats 325# Userspace binary formats
155# 326#
156CONFIG_BINFMT_ELF=y 327CONFIG_BINFMT_ELF=y
157CONFIG_BINFMT_AOUT=y 328# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
329CONFIG_HAVE_AOUT=y
330# CONFIG_BINFMT_AOUT is not set
158CONFIG_BINFMT_MISC=y 331CONFIG_BINFMT_MISC=y
159# CONFIG_ARTHUR is not set
160 332
161# 333#
162# Power management options 334# Power management options
163# 335#
164# CONFIG_PM is not set 336# CONFIG_PM is not set
337CONFIG_ARCH_SUSPEND_POSSIBLE=y
338CONFIG_NET=y
165 339
166# 340#
167# Device Drivers 341# Networking options
168# 342#
343CONFIG_PACKET=y
344# CONFIG_PACKET_MMAP is not set
345CONFIG_UNIX=y
346# CONFIG_NET_KEY is not set
347CONFIG_INET=y
348# CONFIG_IP_MULTICAST is not set
349# CONFIG_IP_ADVANCED_ROUTER is not set
350CONFIG_IP_FIB_HASH=y
351CONFIG_IP_PNP=y
352CONFIG_IP_PNP_DHCP=y
353CONFIG_IP_PNP_BOOTP=y
354# CONFIG_IP_PNP_RARP is not set
355# CONFIG_NET_IPIP is not set
356# CONFIG_NET_IPGRE is not set
357# CONFIG_ARPD is not set
358# CONFIG_SYN_COOKIES is not set
359# CONFIG_INET_AH is not set
360# CONFIG_INET_ESP is not set
361# CONFIG_INET_IPCOMP is not set
362# CONFIG_INET_XFRM_TUNNEL is not set
363# CONFIG_INET_TUNNEL is not set
364# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
365# CONFIG_INET_XFRM_MODE_TUNNEL is not set
366# CONFIG_INET_XFRM_MODE_BEET is not set
367# CONFIG_INET_LRO is not set
368# CONFIG_INET_DIAG is not set
369# CONFIG_TCP_CONG_ADVANCED is not set
370CONFIG_TCP_CONG_CUBIC=y
371CONFIG_DEFAULT_TCP_CONG="cubic"
372# CONFIG_TCP_MD5SIG is not set
373# CONFIG_IPV6 is not set
374# CONFIG_NETWORK_SECMARK is not set
375# CONFIG_NETFILTER is not set
376# CONFIG_IP_DCCP is not set
377# CONFIG_IP_SCTP is not set
378# CONFIG_TIPC is not set
379# CONFIG_ATM is not set
380# CONFIG_BRIDGE is not set
381# CONFIG_NET_DSA is not set
382# CONFIG_VLAN_8021Q is not set
383# CONFIG_DECNET is not set
384# CONFIG_LLC2 is not set
385# CONFIG_IPX is not set
386# CONFIG_ATALK is not set
387# CONFIG_X25 is not set
388# CONFIG_LAPB is not set
389# CONFIG_ECONET is not set
390# CONFIG_WAN_ROUTER is not set
391# CONFIG_PHONET is not set
392# CONFIG_NET_SCHED is not set
393# CONFIG_DCB is not set
169 394
170# 395#
171# Generic Driver Options 396# Network testing
172# 397#
173CONFIG_STANDALONE=y 398# CONFIG_NET_PKTGEN is not set
174CONFIG_PREVENT_FIRMWARE_BUILD=y 399# CONFIG_NET_DROP_MONITOR is not set
175# CONFIG_FW_LOADER is not set 400# CONFIG_HAMRADIO is not set
176CONFIG_DEBUG_DRIVER=y 401# CONFIG_CAN is not set
402# CONFIG_IRDA is not set
403# CONFIG_BT is not set
404# CONFIG_AF_RXRPC is not set
405# CONFIG_WIRELESS is not set
406# CONFIG_WIMAX is not set
407# CONFIG_RFKILL is not set
408# CONFIG_NET_9P is not set
177 409
178# 410#
179# Memory Technology Devices (MTD) 411# Device Drivers
180# 412#
181# CONFIG_MTD is not set
182 413
183# 414#
184# Parallel port support 415# Generic Driver Options
185# 416#
417CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
418CONFIG_STANDALONE=y
419CONFIG_PREVENT_FIRMWARE_BUILD=y
420CONFIG_FW_LOADER=y
421# CONFIG_FIRMWARE_IN_KERNEL is not set
422CONFIG_EXTRA_FIRMWARE=""
423# CONFIG_DEBUG_DRIVER is not set
424# CONFIG_DEBUG_DEVRES is not set
425# CONFIG_SYS_HYPERVISOR is not set
426# CONFIG_CONNECTOR is not set
427CONFIG_MTD=y
428# CONFIG_MTD_DEBUG is not set
429CONFIG_MTD_CONCAT=y
430CONFIG_MTD_PARTITIONS=y
431# CONFIG_MTD_TESTS is not set
432# CONFIG_MTD_REDBOOT_PARTS is not set
433CONFIG_MTD_CMDLINE_PARTS=y
434# CONFIG_MTD_AFS_PARTS is not set
435# CONFIG_MTD_AR7_PARTS is not set
436
437#
438# User Modules And Translation Layers
439#
440CONFIG_MTD_CHAR=y
441CONFIG_MTD_BLKDEVS=y
442CONFIG_MTD_BLOCK=y
443# CONFIG_FTL is not set
444# CONFIG_NFTL is not set
445# CONFIG_INFTL is not set
446# CONFIG_RFD_FTL is not set
447# CONFIG_SSFDC is not set
448# CONFIG_MTD_OOPS is not set
449
450#
451# RAM/ROM/Flash chip drivers
452#
453CONFIG_MTD_CFI=y
454# CONFIG_MTD_JEDECPROBE is not set
455CONFIG_MTD_GEN_PROBE=y
456# CONFIG_MTD_CFI_ADV_OPTIONS is not set
457CONFIG_MTD_MAP_BANK_WIDTH_1=y
458CONFIG_MTD_MAP_BANK_WIDTH_2=y
459CONFIG_MTD_MAP_BANK_WIDTH_4=y
460# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
461# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
462# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
463CONFIG_MTD_CFI_I1=y
464CONFIG_MTD_CFI_I2=y
465# CONFIG_MTD_CFI_I4 is not set
466# CONFIG_MTD_CFI_I8 is not set
467CONFIG_MTD_CFI_INTELEXT=y
468# CONFIG_MTD_CFI_AMDSTD is not set
469# CONFIG_MTD_CFI_STAA is not set
470CONFIG_MTD_CFI_UTIL=y
471# CONFIG_MTD_RAM is not set
472# CONFIG_MTD_ROM is not set
473# CONFIG_MTD_ABSENT is not set
474
475#
476# Mapping drivers for chip access
477#
478CONFIG_MTD_COMPLEX_MAPPINGS=y
479CONFIG_MTD_PHYSMAP=y
480# CONFIG_MTD_PHYSMAP_COMPAT is not set
481# CONFIG_MTD_ARM_INTEGRATOR is not set
482# CONFIG_MTD_PLATRAM is not set
483
484#
485# Self-contained MTD device drivers
486#
487# CONFIG_MTD_SLRAM is not set
488# CONFIG_MTD_PHRAM is not set
489# CONFIG_MTD_MTDRAM is not set
490# CONFIG_MTD_BLOCK2MTD is not set
491
492#
493# Disk-On-Chip Device Drivers
494#
495# CONFIG_MTD_DOC2000 is not set
496# CONFIG_MTD_DOC2001 is not set
497# CONFIG_MTD_DOC2001PLUS is not set
498CONFIG_MTD_NAND=y
499# CONFIG_MTD_NAND_VERIFY_WRITE is not set
500# CONFIG_MTD_NAND_ECC_SMC is not set
501# CONFIG_MTD_NAND_MUSEUM_IDS is not set
502# CONFIG_MTD_NAND_GPIO is not set
503CONFIG_MTD_NAND_IDS=y
504# CONFIG_MTD_NAND_DISKONCHIP is not set
505CONFIG_MTD_NAND_ATMEL=y
506# CONFIG_MTD_NAND_ATMEL_ECC_HW is not set
507CONFIG_MTD_NAND_ATMEL_ECC_SOFT=y
508# CONFIG_MTD_NAND_ATMEL_ECC_NONE is not set
509# CONFIG_MTD_NAND_NANDSIM is not set
510# CONFIG_MTD_NAND_PLATFORM is not set
511# CONFIG_MTD_ALAUDA is not set
512# CONFIG_MTD_ONENAND is not set
513
514#
515# LPDDR flash memory drivers
516#
517# CONFIG_MTD_LPDDR is not set
518
519#
520# UBI - Unsorted block images
521#
522CONFIG_MTD_UBI=y
523CONFIG_MTD_UBI_WL_THRESHOLD=4096
524CONFIG_MTD_UBI_BEB_RESERVE=1
525CONFIG_MTD_UBI_GLUEBI=y
526
527#
528# UBI debugging options
529#
530# CONFIG_MTD_UBI_DEBUG is not set
186# CONFIG_PARPORT is not set 531# CONFIG_PARPORT is not set
187 532CONFIG_BLK_DEV=y
188#
189# Plug and Play support
190#
191
192#
193# Block devices
194#
195# CONFIG_BLK_DEV_COW_COMMON is not set 533# CONFIG_BLK_DEV_COW_COMMON is not set
196CONFIG_BLK_DEV_LOOP=y 534CONFIG_BLK_DEV_LOOP=y
197# CONFIG_BLK_DEV_CRYPTOLOOP is not set 535# CONFIG_BLK_DEV_CRYPTOLOOP is not set
198CONFIG_BLK_DEV_NBD=y 536# CONFIG_BLK_DEV_NBD is not set
199# CONFIG_BLK_DEV_UB is not set 537# CONFIG_BLK_DEV_UB is not set
200CONFIG_BLK_DEV_RAM=y 538CONFIG_BLK_DEV_RAM=y
201CONFIG_BLK_DEV_RAM_COUNT=16 539CONFIG_BLK_DEV_RAM_COUNT=16
202CONFIG_BLK_DEV_RAM_SIZE=4096 540CONFIG_BLK_DEV_RAM_SIZE=16384
203CONFIG_BLK_DEV_INITRD=y 541# CONFIG_BLK_DEV_XIP is not set
204CONFIG_INITRAMFS_SOURCE=""
205# CONFIG_CDROM_PKTCDVD is not set 542# CONFIG_CDROM_PKTCDVD is not set
543# CONFIG_ATA_OVER_ETH is not set
544CONFIG_MISC_DEVICES=y
545CONFIG_ATMEL_TCLIB=y
546CONFIG_ATMEL_TCB_CLKSRC=y
547CONFIG_ATMEL_TCB_CLKSRC_BLOCK=0
548CONFIG_ATMEL_SSC=y
549# CONFIG_ENCLOSURE_SERVICES is not set
550# CONFIG_C2PORT is not set
206 551
207# 552#
208# IO Schedulers 553# EEPROM support
209# 554#
210CONFIG_IOSCHED_NOOP=y 555# CONFIG_EEPROM_93CX6 is not set
211CONFIG_IOSCHED_AS=y 556CONFIG_HAVE_IDE=y
212CONFIG_IOSCHED_DEADLINE=y 557# CONFIG_IDE is not set
213CONFIG_IOSCHED_CFQ=y
214# CONFIG_ATA_OVER_ETH is not set
215 558
216# 559#
217# SCSI device support 560# SCSI device support
218# 561#
562# CONFIG_RAID_ATTRS is not set
219CONFIG_SCSI=y 563CONFIG_SCSI=y
564CONFIG_SCSI_DMA=y
565# CONFIG_SCSI_TGT is not set
566# CONFIG_SCSI_NETLINK is not set
220CONFIG_SCSI_PROC_FS=y 567CONFIG_SCSI_PROC_FS=y
221 568
222# 569#
@@ -232,145 +579,87 @@ CONFIG_CHR_DEV_SG=y
232# 579#
233# Some SCSI devices (e.g. CD jukebox) support multiple LUNs 580# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
234# 581#
235# CONFIG_SCSI_MULTI_LUN is not set 582CONFIG_SCSI_MULTI_LUN=y
236# CONFIG_SCSI_CONSTANTS is not set 583CONFIG_SCSI_CONSTANTS=y
237# CONFIG_SCSI_LOGGING is not set 584CONFIG_SCSI_LOGGING=y
585# CONFIG_SCSI_SCAN_ASYNC is not set
586CONFIG_SCSI_WAIT_SCAN=m
238 587
239# 588#
240# SCSI Transport Attributes 589# SCSI Transports
241# 590#
242# CONFIG_SCSI_SPI_ATTRS is not set 591CONFIG_SCSI_SPI_ATTRS=m
243# CONFIG_SCSI_FC_ATTRS is not set 592# CONFIG_SCSI_FC_ATTRS is not set
244# CONFIG_SCSI_ISCSI_ATTRS is not set 593# CONFIG_SCSI_ISCSI_ATTRS is not set
245 594# CONFIG_SCSI_SAS_LIBSAS is not set
246# 595# CONFIG_SCSI_SRP_ATTRS is not set
247# SCSI low-level drivers 596# CONFIG_SCSI_LOWLEVEL is not set
248# 597# CONFIG_SCSI_DH is not set
249# CONFIG_SCSI_SATA is not set 598# CONFIG_SCSI_OSD_INITIATOR is not set
250# CONFIG_SCSI_DEBUG is not set 599# CONFIG_ATA is not set
251
252#
253# Multi-device support (RAID and LVM)
254#
255# CONFIG_MD is not set 600# CONFIG_MD is not set
256
257#
258# Fusion MPT device support
259#
260# CONFIG_FUSION is not set
261
262#
263# IEEE 1394 (FireWire) support
264#
265
266#
267# I2O device support
268#
269
270#
271# Networking support
272#
273CONFIG_NET=y
274
275#
276# Networking options
277#
278CONFIG_PACKET=y
279# CONFIG_PACKET_MMAP is not set
280CONFIG_UNIX=y
281# CONFIG_NET_KEY is not set
282CONFIG_INET=y
283CONFIG_IP_MULTICAST=y
284# CONFIG_IP_ADVANCED_ROUTER is not set
285CONFIG_IP_FIB_HASH=y
286CONFIG_IP_PNP=y
287CONFIG_IP_PNP_DHCP=y
288# CONFIG_IP_PNP_BOOTP is not set
289# CONFIG_IP_PNP_RARP is not set
290# CONFIG_NET_IPIP is not set
291# CONFIG_NET_IPGRE is not set
292# CONFIG_IP_MROUTE is not set
293# CONFIG_SYN_COOKIES is not set
294# CONFIG_INET_AH is not set
295# CONFIG_INET_ESP is not set
296# CONFIG_INET_IPCOMP is not set
297# CONFIG_INET_TUNNEL is not set
298# CONFIG_IP_TCPDIAG is not set
299# CONFIG_IP_TCPDIAG_IPV6 is not set
300# CONFIG_TCP_CONG_ADVANCED is not set
301CONFIG_TCP_CONG_BIC=y
302# CONFIG_IPV6 is not set
303# CONFIG_NETFILTER is not set
304# CONFIG_BRIDGE is not set
305# CONFIG_VLAN_8021Q is not set
306# CONFIG_DECNET is not set
307# CONFIG_LLC2 is not set
308# CONFIG_IPX is not set
309# CONFIG_ATALK is not set
310
311#
312# QoS and/or fair queueing
313#
314# CONFIG_NET_SCHED is not set
315# CONFIG_NET_CLS_ROUTE is not set
316
317#
318# Network testing
319#
320# CONFIG_NET_PKTGEN is not set
321# CONFIG_NETPOLL is not set
322# CONFIG_NET_POLL_CONTROLLER is not set
323# CONFIG_HAMRADIO is not set
324# CONFIG_IRDA is not set
325# CONFIG_BT is not set
326CONFIG_NETDEVICES=y 601CONFIG_NETDEVICES=y
602CONFIG_COMPAT_NET_DEV_OPS=y
327# CONFIG_DUMMY is not set 603# CONFIG_DUMMY is not set
328# CONFIG_BONDING is not set 604# CONFIG_BONDING is not set
605# CONFIG_MACVLAN is not set
329# CONFIG_EQUALIZER is not set 606# CONFIG_EQUALIZER is not set
330# CONFIG_TUN is not set 607# CONFIG_TUN is not set
331 608# CONFIG_VETH is not set
332# 609# CONFIG_PHYLIB is not set
333# Ethernet (10 or 100Mbit)
334#
335CONFIG_NET_ETHERNET=y 610CONFIG_NET_ETHERNET=y
336CONFIG_MII=y 611CONFIG_MII=y
337CONFIG_ARM_AT91_ETHER=y 612CONFIG_ARM_AT91_ETHER=y
613# CONFIG_AX88796 is not set
338# CONFIG_SMC91X is not set 614# CONFIG_SMC91X is not set
339# CONFIG_DM9000 is not set 615# CONFIG_DM9000 is not set
616# CONFIG_ETHOC is not set
617# CONFIG_SMC911X is not set
618# CONFIG_SMSC911X is not set
619# CONFIG_DNET is not set
620# CONFIG_IBM_NEW_EMAC_ZMII is not set
621# CONFIG_IBM_NEW_EMAC_RGMII is not set
622# CONFIG_IBM_NEW_EMAC_TAH is not set
623# CONFIG_IBM_NEW_EMAC_EMAC4 is not set
624# CONFIG_IBM_NEW_EMAC_NO_FLOW_CTRL is not set
625# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set
626# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
627# CONFIG_B44 is not set
628# CONFIG_NETDEV_1000 is not set
629# CONFIG_NETDEV_10000 is not set
340 630
341# 631#
342# Ethernet (1000 Mbit) 632# Wireless LAN
343#
344
345#
346# Ethernet (10000 Mbit)
347#
348
349#
350# Token Ring devices
351# 633#
634# CONFIG_WLAN_PRE80211 is not set
635# CONFIG_WLAN_80211 is not set
352 636
353# 637#
354# Wireless LAN (non-hamradio) 638# Enable WiMAX (Networking options) to see the WiMAX drivers
355# 639#
356# CONFIG_NET_RADIO is not set
357 640
358# 641#
359# Wan interfaces 642# USB Network Adapters
360# 643#
644# CONFIG_USB_CATC is not set
645# CONFIG_USB_KAWETH is not set
646# CONFIG_USB_PEGASUS is not set
647# CONFIG_USB_RTL8150 is not set
648# CONFIG_USB_USBNET is not set
361# CONFIG_WAN is not set 649# CONFIG_WAN is not set
362# CONFIG_PPP is not set 650# CONFIG_PPP is not set
363# CONFIG_SLIP is not set 651# CONFIG_SLIP is not set
364 652# CONFIG_NETCONSOLE is not set
365# 653# CONFIG_NETPOLL is not set
366# ISDN subsystem 654# CONFIG_NET_POLL_CONTROLLER is not set
367#
368# CONFIG_ISDN is not set 655# CONFIG_ISDN is not set
369 656
370# 657#
371# Input device support 658# Input device support
372# 659#
373CONFIG_INPUT=y 660CONFIG_INPUT=y
661# CONFIG_INPUT_FF_MEMLESS is not set
662# CONFIG_INPUT_POLLDEV is not set
374 663
375# 664#
376# Userland interfaces 665# Userland interfaces
@@ -380,7 +669,6 @@ CONFIG_INPUT_MOUSEDEV=y
380CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024 669CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
381CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768 670CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
382# CONFIG_INPUT_JOYDEV is not set 671# CONFIG_INPUT_JOYDEV is not set
383# CONFIG_INPUT_TSDEV is not set
384# CONFIG_INPUT_EVDEV is not set 672# CONFIG_INPUT_EVDEV is not set
385# CONFIG_INPUT_EVBUG is not set 673# CONFIG_INPUT_EVBUG is not set
386 674
@@ -390,23 +678,25 @@ CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
390# CONFIG_INPUT_KEYBOARD is not set 678# CONFIG_INPUT_KEYBOARD is not set
391# CONFIG_INPUT_MOUSE is not set 679# CONFIG_INPUT_MOUSE is not set
392# CONFIG_INPUT_JOYSTICK is not set 680# CONFIG_INPUT_JOYSTICK is not set
681# CONFIG_INPUT_TABLET is not set
393# CONFIG_INPUT_TOUCHSCREEN is not set 682# CONFIG_INPUT_TOUCHSCREEN is not set
394# CONFIG_INPUT_MISC is not set 683# CONFIG_INPUT_MISC is not set
395 684
396# 685#
397# Hardware I/O ports 686# Hardware I/O ports
398# 687#
399CONFIG_SERIO=y 688# CONFIG_SERIO is not set
400# CONFIG_SERIO_SERPORT is not set
401# CONFIG_SERIO_RAW is not set
402# CONFIG_GAMEPORT is not set 689# CONFIG_GAMEPORT is not set
403 690
404# 691#
405# Character devices 692# Character devices
406# 693#
407CONFIG_VT=y 694CONFIG_VT=y
695CONFIG_CONSOLE_TRANSLATIONS=y
408CONFIG_VT_CONSOLE=y 696CONFIG_VT_CONSOLE=y
409CONFIG_HW_CONSOLE=y 697CONFIG_HW_CONSOLE=y
698# CONFIG_VT_HW_CONSOLE_BINDING is not set
699CONFIG_DEVKMEM=y
410# CONFIG_SERIAL_NONSTANDARD is not set 700# CONFIG_SERIAL_NONSTANDARD is not set
411 701
412# 702#
@@ -419,215 +709,362 @@ CONFIG_HW_CONSOLE=y
419# 709#
420CONFIG_SERIAL_ATMEL=y 710CONFIG_SERIAL_ATMEL=y
421CONFIG_SERIAL_ATMEL_CONSOLE=y 711CONFIG_SERIAL_ATMEL_CONSOLE=y
712CONFIG_SERIAL_ATMEL_PDC=y
713# CONFIG_SERIAL_ATMEL_TTYAT is not set
422CONFIG_SERIAL_CORE=y 714CONFIG_SERIAL_CORE=y
423CONFIG_SERIAL_CORE_CONSOLE=y 715CONFIG_SERIAL_CORE_CONSOLE=y
424CONFIG_UNIX98_PTYS=y 716CONFIG_UNIX98_PTYS=y
425CONFIG_LEGACY_PTYS=y 717# CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set
426CONFIG_LEGACY_PTY_COUNT=256 718# CONFIG_LEGACY_PTYS is not set
719# CONFIG_IPMI_HANDLER is not set
720# CONFIG_HW_RANDOM is not set
721# CONFIG_R3964 is not set
722# CONFIG_RAW_DRIVER is not set
723# CONFIG_TCG_TPM is not set
724# CONFIG_I2C is not set
725# CONFIG_SPI is not set
726CONFIG_ARCH_REQUIRE_GPIOLIB=y
727CONFIG_GPIOLIB=y
728# CONFIG_DEBUG_GPIO is not set
729# CONFIG_GPIO_SYSFS is not set
427 730
428# 731#
429# IPMI 732# Memory mapped GPIO expanders:
430# 733#
431# CONFIG_IPMI_HANDLER is not set
432 734
433# 735#
434# Watchdog Cards 736# I2C GPIO expanders:
435# 737#
436# CONFIG_WATCHDOG is not set
437# CONFIG_NVRAM is not set
438# CONFIG_RTC is not set
439# CONFIG_AT91RM9200_RTC is not set
440# CONFIG_DTLK is not set
441# CONFIG_R3964 is not set
442 738
443# 739#
444# Ftape, the floppy tape device driver 740# PCI GPIO expanders:
445# 741#
446# CONFIG_RAW_DRIVER is not set
447 742
448# 743#
449# TPM devices 744# SPI GPIO expanders:
450# 745#
451# CONFIG_AT91_SPI is not set 746# CONFIG_W1 is not set
747# CONFIG_POWER_SUPPLY is not set
748# CONFIG_HWMON is not set
749# CONFIG_THERMAL is not set
750# CONFIG_THERMAL_HWMON is not set
751CONFIG_WATCHDOG=y
752# CONFIG_WATCHDOG_NOWAYOUT is not set
452 753
453# 754#
454# I2C support 755# Watchdog Device Drivers
455# 756#
456# CONFIG_I2C is not set 757# CONFIG_SOFT_WATCHDOG is not set
758CONFIG_AT91RM9200_WATCHDOG=y
759
760#
761# USB-based Watchdog Cards
762#
763# CONFIG_USBPCWATCHDOG is not set
764CONFIG_SSB_POSSIBLE=y
457 765
458# 766#
459# Misc devices 767# Sonics Silicon Backplane
460# 768#
769# CONFIG_SSB is not set
770
771#
772# Multifunction device drivers
773#
774# CONFIG_MFD_CORE is not set
775# CONFIG_MFD_SM501 is not set
776# CONFIG_MFD_ASIC3 is not set
777# CONFIG_HTC_EGPIO is not set
778# CONFIG_HTC_PASIC3 is not set
779# CONFIG_MFD_TMIO is not set
780# CONFIG_MFD_T7L66XB is not set
781# CONFIG_MFD_TC6387XB is not set
782# CONFIG_MFD_TC6393XB is not set
461 783
462# 784#
463# Multimedia devices 785# Multimedia devices
464# 786#
787
788#
789# Multimedia core support
790#
465# CONFIG_VIDEO_DEV is not set 791# CONFIG_VIDEO_DEV is not set
792# CONFIG_DVB_CORE is not set
793# CONFIG_VIDEO_MEDIA is not set
466 794
467# 795#
468# Digital Video Broadcasting Devices 796# Multimedia drivers
469# 797#
470# CONFIG_DVB is not set 798# CONFIG_DAB is not set
471 799
472# 800#
473# Graphics support 801# Graphics support
474# 802#
475# CONFIG_FB is not set 803# CONFIG_VGASTATE is not set
804# CONFIG_VIDEO_OUTPUT_CONTROL is not set
805CONFIG_FB=y
806# CONFIG_FIRMWARE_EDID is not set
807# CONFIG_FB_DDC is not set
808# CONFIG_FB_BOOT_VESA_SUPPORT is not set
809# CONFIG_FB_CFB_FILLRECT is not set
810# CONFIG_FB_CFB_COPYAREA is not set
811# CONFIG_FB_CFB_IMAGEBLIT is not set
812# CONFIG_FB_CFB_REV_PIXELS_IN_BYTE is not set
813# CONFIG_FB_SYS_FILLRECT is not set
814# CONFIG_FB_SYS_COPYAREA is not set
815# CONFIG_FB_SYS_IMAGEBLIT is not set
816# CONFIG_FB_FOREIGN_ENDIAN is not set
817# CONFIG_FB_SYS_FOPS is not set
818# CONFIG_FB_SVGALIB is not set
819# CONFIG_FB_MACMODES is not set
820# CONFIG_FB_BACKLIGHT is not set
821CONFIG_FB_MODE_HELPERS=y
822CONFIG_FB_TILEBLITTING=y
823
824#
825# Frame buffer hardware drivers
826#
827# CONFIG_FB_S1D13XXX is not set
828# CONFIG_FB_VIRTUAL is not set
829# CONFIG_FB_METRONOME is not set
830# CONFIG_FB_MB862XX is not set
831# CONFIG_FB_BROADSHEET is not set
832CONFIG_BACKLIGHT_LCD_SUPPORT=y
833# CONFIG_LCD_CLASS_DEVICE is not set
834CONFIG_BACKLIGHT_CLASS_DEVICE=y
835# CONFIG_BACKLIGHT_GENERIC is not set
836
837#
838# Display device support
839#
840# CONFIG_DISPLAY_SUPPORT is not set
476 841
477# 842#
478# Console display driver support 843# Console display driver support
479# 844#
480# CONFIG_VGA_CONSOLE is not set 845# CONFIG_VGA_CONSOLE is not set
481CONFIG_DUMMY_CONSOLE=y 846CONFIG_DUMMY_CONSOLE=y
482 847CONFIG_FRAMEBUFFER_CONSOLE=y
483# 848# CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY is not set
484# Sound 849# CONFIG_FRAMEBUFFER_CONSOLE_ROTATION is not set
485# 850CONFIG_FONTS=y
851# CONFIG_FONT_8x8 is not set
852# CONFIG_FONT_8x16 is not set
853# CONFIG_FONT_6x11 is not set
854# CONFIG_FONT_7x14 is not set
855# CONFIG_FONT_PEARL_8x8 is not set
856# CONFIG_FONT_ACORN_8x8 is not set
857CONFIG_FONT_MINI_4x6=y
858# CONFIG_FONT_SUN8x16 is not set
859# CONFIG_FONT_SUN12x22 is not set
860# CONFIG_FONT_10x18 is not set
861# CONFIG_LOGO is not set
486# CONFIG_SOUND is not set 862# CONFIG_SOUND is not set
487 863# CONFIG_HID_SUPPORT is not set
488# 864CONFIG_USB_SUPPORT=y
489# USB support
490#
491CONFIG_USB_ARCH_HAS_HCD=y 865CONFIG_USB_ARCH_HAS_HCD=y
492CONFIG_USB_ARCH_HAS_OHCI=y 866CONFIG_USB_ARCH_HAS_OHCI=y
867# CONFIG_USB_ARCH_HAS_EHCI is not set
493CONFIG_USB=y 868CONFIG_USB=y
494CONFIG_USB_DEBUG=y 869# CONFIG_USB_DEBUG is not set
870# CONFIG_USB_ANNOUNCE_NEW_DEVICES is not set
495 871
496# 872#
497# Miscellaneous USB options 873# Miscellaneous USB options
498# 874#
499CONFIG_USB_DEVICEFS=y 875CONFIG_USB_DEVICEFS=y
876CONFIG_USB_DEVICE_CLASS=y
877# CONFIG_USB_DYNAMIC_MINORS is not set
878# CONFIG_USB_OTG is not set
879# CONFIG_USB_MON is not set
880# CONFIG_USB_WUSB is not set
881# CONFIG_USB_WUSB_CBAF is not set
500 882
501# 883#
502# USB Host Controller Drivers 884# USB Host Controller Drivers
503# 885#
886# CONFIG_USB_C67X00_HCD is not set
887# CONFIG_USB_OXU210HP_HCD is not set
504# CONFIG_USB_ISP116X_HCD is not set 888# CONFIG_USB_ISP116X_HCD is not set
889# CONFIG_USB_ISP1760_HCD is not set
505CONFIG_USB_OHCI_HCD=y 890CONFIG_USB_OHCI_HCD=y
506# CONFIG_USB_OHCI_BIG_ENDIAN is not set 891# CONFIG_USB_OHCI_BIG_ENDIAN_DESC is not set
892# CONFIG_USB_OHCI_BIG_ENDIAN_MMIO is not set
507CONFIG_USB_OHCI_LITTLE_ENDIAN=y 893CONFIG_USB_OHCI_LITTLE_ENDIAN=y
508# CONFIG_USB_SL811_HCD is not set 894# CONFIG_USB_SL811_HCD is not set
895# CONFIG_USB_R8A66597_HCD is not set
896# CONFIG_USB_HWA_HCD is not set
897# CONFIG_USB_MUSB_HDRC is not set
509 898
510# 899#
511# USB Device Class drivers 900# USB Device Class drivers
512# 901#
513# CONFIG_USB_BLUETOOTH_TTY is not set
514# CONFIG_USB_ACM is not set 902# CONFIG_USB_ACM is not set
515# CONFIG_USB_PRINTER is not set 903# CONFIG_USB_PRINTER is not set
904# CONFIG_USB_WDM is not set
905# CONFIG_USB_TMC is not set
516 906
517# 907#
518# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information 908# NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may
519# 909#
520CONFIG_USB_STORAGE=y
521CONFIG_USB_STORAGE_DEBUG=y
522# CONFIG_USB_STORAGE_FREECOM is not set
523# CONFIG_USB_STORAGE_DPCM is not set
524
525#
526# USB Input Devices
527#
528# CONFIG_USB_HID is not set
529 910
530# 911#
531# USB HID Boot Protocol drivers 912# also be needed; see USB_STORAGE Help for more info
532# 913#
533# CONFIG_USB_KBD is not set 914CONFIG_USB_STORAGE=y
534# CONFIG_USB_MOUSE is not set 915# CONFIG_USB_STORAGE_DEBUG is not set
535# CONFIG_USB_AIPTEK is not set 916# CONFIG_USB_STORAGE_DATAFAB is not set
536# CONFIG_USB_WACOM is not set 917# CONFIG_USB_STORAGE_FREECOM is not set
537# CONFIG_USB_ACECAD is not set 918# CONFIG_USB_STORAGE_ISD200 is not set
538# CONFIG_USB_KBTAB is not set 919# CONFIG_USB_STORAGE_USBAT is not set
539# CONFIG_USB_POWERMATE is not set 920# CONFIG_USB_STORAGE_SDDR09 is not set
540# CONFIG_USB_MTOUCH is not set 921# CONFIG_USB_STORAGE_SDDR55 is not set
541# CONFIG_USB_ITMTOUCH is not set 922# CONFIG_USB_STORAGE_JUMPSHOT is not set
542# CONFIG_USB_EGALAX is not set 923# CONFIG_USB_STORAGE_ALAUDA is not set
543# CONFIG_USB_XPAD is not set 924# CONFIG_USB_STORAGE_ONETOUCH is not set
544# CONFIG_USB_ATI_REMOTE is not set 925# CONFIG_USB_STORAGE_KARMA is not set
926# CONFIG_USB_STORAGE_CYPRESS_ATACB is not set
927CONFIG_USB_LIBUSUAL=y
545 928
546# 929#
547# USB Imaging devices 930# USB Imaging devices
548# 931#
932# CONFIG_USB_MDC800 is not set
549# CONFIG_USB_MICROTEK is not set 933# CONFIG_USB_MICROTEK is not set
550 934
551# 935#
552# USB Multimedia devices 936# USB port drivers
553# 937#
554# CONFIG_USB_DABUSB is not set 938# CONFIG_USB_SERIAL is not set
555 939
556# 940#
557# Video4Linux support is needed for USB Multimedia device support 941# USB Miscellaneous drivers
558# 942#
943# CONFIG_USB_EMI62 is not set
944# CONFIG_USB_EMI26 is not set
945# CONFIG_USB_ADUTUX is not set
946# CONFIG_USB_SEVSEG is not set
947# CONFIG_USB_RIO500 is not set
948# CONFIG_USB_LEGOTOWER is not set
949# CONFIG_USB_LCD is not set
950# CONFIG_USB_BERRY_CHARGE is not set
951# CONFIG_USB_LED is not set
952# CONFIG_USB_CYPRESS_CY7C63 is not set
953# CONFIG_USB_CYTHERM is not set
954# CONFIG_USB_IDMOUSE is not set
955# CONFIG_USB_FTDI_ELAN is not set
956# CONFIG_USB_APPLEDISPLAY is not set
957# CONFIG_USB_LD is not set
958# CONFIG_USB_TRANCEVIBRATOR is not set
959# CONFIG_USB_IOWARRIOR is not set
960# CONFIG_USB_TEST is not set
961# CONFIG_USB_ISIGHTFW is not set
962# CONFIG_USB_VST is not set
963# CONFIG_USB_GADGET is not set
559 964
560# 965#
561# USB Network Adapters 966# OTG and related infrastructure
562# 967#
563# CONFIG_USB_KAWETH is not set 968# CONFIG_USB_GPIO_VBUS is not set
564# CONFIG_USB_PEGASUS is not set 969# CONFIG_NOP_USB_XCEIV is not set
565# CONFIG_USB_USBNET is not set 970CONFIG_MMC=y
566# CONFIG_USB_MON is not set 971# CONFIG_MMC_DEBUG is not set
972# CONFIG_MMC_UNSAFE_RESUME is not set
567 973
568# 974#
569# USB port drivers 975# MMC/SD/SDIO Card Drivers
570# 976#
977CONFIG_MMC_BLOCK=y
978CONFIG_MMC_BLOCK_BOUNCE=y
979# CONFIG_SDIO_UART is not set
980# CONFIG_MMC_TEST is not set
571 981
572# 982#
573# USB Serial Converter support 983# MMC/SD/SDIO Host Controller Drivers
574# 984#
575# CONFIG_USB_SERIAL is not set 985# CONFIG_MMC_SDHCI is not set
986CONFIG_MMC_AT91=y
987# CONFIG_MEMSTICK is not set
988# CONFIG_ACCESSIBILITY is not set
989# CONFIG_NEW_LEDS is not set
990CONFIG_RTC_LIB=y
991CONFIG_RTC_CLASS=y
992CONFIG_RTC_HCTOSYS=y
993CONFIG_RTC_HCTOSYS_DEVICE="rtc0"
994# CONFIG_RTC_DEBUG is not set
576 995
577# 996#
578# USB Miscellaneous drivers 997# RTC interfaces
579# 998#
580# CONFIG_USB_EMI62 is not set 999CONFIG_RTC_INTF_SYSFS=y
581# CONFIG_USB_EMI26 is not set 1000CONFIG_RTC_INTF_PROC=y
582# CONFIG_USB_LCD is not set 1001CONFIG_RTC_INTF_DEV=y
583# CONFIG_USB_LED is not set 1002# CONFIG_RTC_INTF_DEV_UIE_EMUL is not set
584# CONFIG_USB_CYTHERM is not set 1003# CONFIG_RTC_DRV_TEST is not set
585# CONFIG_USB_PHIDGETKIT is not set
586# CONFIG_USB_PHIDGETSERVO is not set
587# CONFIG_USB_IDMOUSE is not set
588 1004
589# 1005#
590# USB DSL modem support 1006# SPI RTC drivers
591# 1007#
592 1008
593# 1009#
594# USB Gadget Support 1010# Platform RTC drivers
595# 1011#
596# CONFIG_USB_GADGET is not set 1012# CONFIG_RTC_DRV_CMOS is not set
1013# CONFIG_RTC_DRV_DS1286 is not set
1014# CONFIG_RTC_DRV_DS1511 is not set
1015# CONFIG_RTC_DRV_DS1553 is not set
1016# CONFIG_RTC_DRV_DS1742 is not set
1017# CONFIG_RTC_DRV_STK17TA8 is not set
1018# CONFIG_RTC_DRV_M48T86 is not set
1019# CONFIG_RTC_DRV_M48T35 is not set
1020# CONFIG_RTC_DRV_M48T59 is not set
1021# CONFIG_RTC_DRV_BQ4802 is not set
1022# CONFIG_RTC_DRV_V3020 is not set
597 1023
598# 1024#
599# MMC/SD Card support 1025# on-CPU RTC drivers
600# 1026#
601# CONFIG_MMC is not set 1027CONFIG_RTC_DRV_AT91RM9200=y
1028# CONFIG_DMADEVICES is not set
1029# CONFIG_AUXDISPLAY is not set
1030# CONFIG_REGULATOR is not set
1031# CONFIG_UIO is not set
1032# CONFIG_STAGING is not set
602 1033
603# 1034#
604# File systems 1035# File systems
605# 1036#
606CONFIG_EXT2_FS=y 1037CONFIG_EXT2_FS=y
607CONFIG_EXT2_FS_XATTR=y 1038# CONFIG_EXT2_FS_XATTR is not set
608# CONFIG_EXT2_FS_POSIX_ACL is not set
609# CONFIG_EXT2_FS_SECURITY is not set
610# CONFIG_EXT2_FS_XIP is not set 1039# CONFIG_EXT2_FS_XIP is not set
611CONFIG_EXT3_FS=y 1040CONFIG_EXT3_FS=y
1041# CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set
612CONFIG_EXT3_FS_XATTR=y 1042CONFIG_EXT3_FS_XATTR=y
613# CONFIG_EXT3_FS_POSIX_ACL is not set 1043# CONFIG_EXT3_FS_POSIX_ACL is not set
614# CONFIG_EXT3_FS_SECURITY is not set 1044# CONFIG_EXT3_FS_SECURITY is not set
1045# CONFIG_EXT4_FS is not set
615CONFIG_JBD=y 1046CONFIG_JBD=y
616# CONFIG_JBD_DEBUG is not set 1047# CONFIG_JBD_DEBUG is not set
617CONFIG_FS_MBCACHE=y 1048CONFIG_FS_MBCACHE=y
618# CONFIG_REISERFS_FS is not set 1049# CONFIG_REISERFS_FS is not set
619# CONFIG_JFS_FS is not set 1050# CONFIG_JFS_FS is not set
1051# CONFIG_FS_POSIX_ACL is not set
1052CONFIG_FILE_LOCKING=y
1053# CONFIG_XFS_FS is not set
1054# CONFIG_OCFS2_FS is not set
1055# CONFIG_BTRFS_FS is not set
1056# CONFIG_DNOTIFY is not set
1057CONFIG_INOTIFY=y
1058CONFIG_INOTIFY_USER=y
1059# CONFIG_QUOTA is not set
1060# CONFIG_AUTOFS_FS is not set
1061# CONFIG_AUTOFS4_FS is not set
1062# CONFIG_FUSE_FS is not set
620 1063
621# 1064#
622# XFS support 1065# Caches
623# 1066#
624# CONFIG_XFS_FS is not set 1067# CONFIG_FSCACHE is not set
625# CONFIG_MINIX_FS is not set
626# CONFIG_ROMFS_FS is not set
627# CONFIG_QUOTA is not set
628CONFIG_DNOTIFY=y
629CONFIG_AUTOFS_FS=y
630CONFIG_AUTOFS4_FS=y
631 1068
632# 1069#
633# CD-ROM/DVD Filesystems 1070# CD-ROM/DVD Filesystems
@@ -639,7 +1076,7 @@ CONFIG_AUTOFS4_FS=y
639# DOS/FAT/NT Filesystems 1076# DOS/FAT/NT Filesystems
640# 1077#
641CONFIG_FAT_FS=y 1078CONFIG_FAT_FS=y
642CONFIG_MSDOS_FS=y 1079# CONFIG_MSDOS_FS is not set
643CONFIG_VFAT_FS=y 1080CONFIG_VFAT_FS=y
644CONFIG_FAT_DEFAULT_CODEPAGE=437 1081CONFIG_FAT_DEFAULT_CODEPAGE=437
645CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1" 1082CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
@@ -649,53 +1086,70 @@ CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
649# Pseudo filesystems 1086# Pseudo filesystems
650# 1087#
651CONFIG_PROC_FS=y 1088CONFIG_PROC_FS=y
1089CONFIG_PROC_SYSCTL=y
1090CONFIG_PROC_PAGE_MONITOR=y
652CONFIG_SYSFS=y 1091CONFIG_SYSFS=y
653CONFIG_DEVPTS_FS_XATTR=y
654# CONFIG_DEVPTS_FS_SECURITY is not set
655CONFIG_TMPFS=y 1092CONFIG_TMPFS=y
656# CONFIG_TMPFS_XATTR is not set 1093# CONFIG_TMPFS_POSIX_ACL is not set
657# CONFIG_HUGETLB_PAGE is not set 1094# CONFIG_HUGETLB_PAGE is not set
658CONFIG_RAMFS=y 1095CONFIG_CONFIGFS_FS=y
659 1096CONFIG_MISC_FILESYSTEMS=y
660# 1097# CONFIG_ADFS_FS is not set
661# Miscellaneous filesystems 1098# CONFIG_AFFS_FS is not set
662# 1099# CONFIG_HFS_FS is not set
663# CONFIG_HFSPLUS_FS is not set 1100# CONFIG_HFSPLUS_FS is not set
1101# CONFIG_BEFS_FS is not set
1102# CONFIG_BFS_FS is not set
1103# CONFIG_EFS_FS is not set
1104CONFIG_JFFS2_FS=y
1105CONFIG_JFFS2_FS_DEBUG=0
1106CONFIG_JFFS2_FS_WRITEBUFFER=y
1107# CONFIG_JFFS2_FS_WBUF_VERIFY is not set
1108# CONFIG_JFFS2_SUMMARY is not set
1109# CONFIG_JFFS2_FS_XATTR is not set
1110# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set
1111CONFIG_JFFS2_ZLIB=y
1112# CONFIG_JFFS2_LZO is not set
1113CONFIG_JFFS2_RTIME=y
1114# CONFIG_JFFS2_RUBIN is not set
1115# CONFIG_UBIFS_FS is not set
664# CONFIG_CRAMFS is not set 1116# CONFIG_CRAMFS is not set
1117# CONFIG_SQUASHFS is not set
665# CONFIG_VXFS_FS is not set 1118# CONFIG_VXFS_FS is not set
1119# CONFIG_MINIX_FS is not set
1120# CONFIG_OMFS_FS is not set
666# CONFIG_HPFS_FS is not set 1121# CONFIG_HPFS_FS is not set
667# CONFIG_QNX4FS_FS is not set 1122# CONFIG_QNX4FS_FS is not set
1123# CONFIG_ROMFS_FS is not set
668# CONFIG_SYSV_FS is not set 1124# CONFIG_SYSV_FS is not set
669# CONFIG_UFS_FS is not set 1125# CONFIG_UFS_FS is not set
670 1126# CONFIG_NILFS2_FS is not set
671# 1127CONFIG_NETWORK_FILESYSTEMS=y
672# Network File Systems
673#
674CONFIG_NFS_FS=y 1128CONFIG_NFS_FS=y
675CONFIG_NFS_V3=y 1129CONFIG_NFS_V3=y
676# CONFIG_NFS_V3_ACL is not set 1130# CONFIG_NFS_V3_ACL is not set
677# CONFIG_NFSD is not set 1131# CONFIG_NFS_V4 is not set
678CONFIG_ROOT_NFS=y 1132CONFIG_ROOT_NFS=y
1133# CONFIG_NFSD is not set
679CONFIG_LOCKD=y 1134CONFIG_LOCKD=y
680CONFIG_LOCKD_V4=y 1135CONFIG_LOCKD_V4=y
681CONFIG_NFS_COMMON=y 1136CONFIG_NFS_COMMON=y
682CONFIG_SUNRPC=y 1137CONFIG_SUNRPC=y
1138# CONFIG_RPCSEC_GSS_KRB5 is not set
1139# CONFIG_RPCSEC_GSS_SPKM3 is not set
683# CONFIG_SMB_FS is not set 1140# CONFIG_SMB_FS is not set
684# CONFIG_CIFS is not set 1141# CONFIG_CIFS is not set
685# CONFIG_NCP_FS is not set 1142# CONFIG_NCP_FS is not set
686# CONFIG_CODA_FS is not set 1143# CONFIG_CODA_FS is not set
1144# CONFIG_AFS_FS is not set
687 1145
688# 1146#
689# Partition Types 1147# Partition Types
690# 1148#
691# CONFIG_PARTITION_ADVANCED is not set 1149# CONFIG_PARTITION_ADVANCED is not set
692CONFIG_MSDOS_PARTITION=y 1150CONFIG_MSDOS_PARTITION=y
693
694#
695# Native Language Support
696#
697CONFIG_NLS=y 1151CONFIG_NLS=y
698CONFIG_NLS_DEFAULT="utf8" 1152CONFIG_NLS_DEFAULT="iso8859-1"
699CONFIG_NLS_CODEPAGE_437=y 1153CONFIG_NLS_CODEPAGE_437=y
700# CONFIG_NLS_CODEPAGE_737 is not set 1154# CONFIG_NLS_CODEPAGE_737 is not set
701# CONFIG_NLS_CODEPAGE_775 is not set 1155# CONFIG_NLS_CODEPAGE_775 is not set
@@ -719,7 +1173,7 @@ CONFIG_NLS_CODEPAGE_437=y
719# CONFIG_NLS_ISO8859_8 is not set 1173# CONFIG_NLS_ISO8859_8 is not set
720# CONFIG_NLS_CODEPAGE_1250 is not set 1174# CONFIG_NLS_CODEPAGE_1250 is not set
721# CONFIG_NLS_CODEPAGE_1251 is not set 1175# CONFIG_NLS_CODEPAGE_1251 is not set
722CONFIG_NLS_ASCII=y 1176# CONFIG_NLS_ASCII is not set
723# CONFIG_NLS_ISO8859_1 is not set 1177# CONFIG_NLS_ISO8859_1 is not set
724# CONFIG_NLS_ISO8859_2 is not set 1178# CONFIG_NLS_ISO8859_2 is not set
725# CONFIG_NLS_ISO8859_3 is not set 1179# CONFIG_NLS_ISO8859_3 is not set
@@ -733,47 +1187,119 @@ CONFIG_NLS_ASCII=y
733# CONFIG_NLS_ISO8859_15 is not set 1187# CONFIG_NLS_ISO8859_15 is not set
734# CONFIG_NLS_KOI8_R is not set 1188# CONFIG_NLS_KOI8_R is not set
735# CONFIG_NLS_KOI8_U is not set 1189# CONFIG_NLS_KOI8_U is not set
736# CONFIG_NLS_UTF8 is not set 1190CONFIG_NLS_UTF8=y
1191# CONFIG_DLM is not set
737 1192
738# 1193#
739# Kernel hacking 1194# Kernel hacking
740# 1195#
741# CONFIG_PRINTK_TIME is not set 1196# CONFIG_PRINTK_TIME is not set
1197CONFIG_ENABLE_WARN_DEPRECATED=y
1198CONFIG_ENABLE_MUST_CHECK=y
1199CONFIG_FRAME_WARN=1024
1200CONFIG_MAGIC_SYSRQ=y
1201# CONFIG_UNUSED_SYMBOLS is not set
1202CONFIG_DEBUG_FS=y
1203# CONFIG_HEADERS_CHECK is not set
742CONFIG_DEBUG_KERNEL=y 1204CONFIG_DEBUG_KERNEL=y
743# CONFIG_MAGIC_SYSRQ is not set 1205# CONFIG_DEBUG_SHIRQ is not set
744CONFIG_LOG_BUF_SHIFT=14 1206CONFIG_DETECT_SOFTLOCKUP=y
1207# CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC is not set
1208CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE=0
1209CONFIG_DETECT_HUNG_TASK=y
1210# CONFIG_BOOTPARAM_HUNG_TASK_PANIC is not set
1211CONFIG_BOOTPARAM_HUNG_TASK_PANIC_VALUE=0
1212# CONFIG_SCHED_DEBUG is not set
745# CONFIG_SCHEDSTATS is not set 1213# CONFIG_SCHEDSTATS is not set
746# CONFIG_DEBUG_SLAB is not set 1214# CONFIG_TIMER_STATS is not set
1215# CONFIG_DEBUG_OBJECTS is not set
1216# CONFIG_SLUB_DEBUG_ON is not set
1217# CONFIG_SLUB_STATS is not set
1218# CONFIG_DEBUG_PREEMPT is not set
1219# CONFIG_DEBUG_RT_MUTEXES is not set
1220# CONFIG_RT_MUTEX_TESTER is not set
747# CONFIG_DEBUG_SPINLOCK is not set 1221# CONFIG_DEBUG_SPINLOCK is not set
1222# CONFIG_DEBUG_MUTEXES is not set
1223# CONFIG_DEBUG_LOCK_ALLOC is not set
1224# CONFIG_PROVE_LOCKING is not set
1225# CONFIG_LOCK_STAT is not set
748# CONFIG_DEBUG_SPINLOCK_SLEEP is not set 1226# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
1227# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
749# CONFIG_DEBUG_KOBJECT is not set 1228# CONFIG_DEBUG_KOBJECT is not set
750CONFIG_DEBUG_BUGVERBOSE=y 1229CONFIG_DEBUG_BUGVERBOSE=y
751# CONFIG_DEBUG_INFO is not set 1230# CONFIG_DEBUG_INFO is not set
752# CONFIG_DEBUG_FS is not set 1231# CONFIG_DEBUG_VM is not set
753CONFIG_FRAME_POINTER=y 1232# CONFIG_DEBUG_WRITECOUNT is not set
754CONFIG_DEBUG_USER=y 1233CONFIG_DEBUG_MEMORY_INIT=y
755CONFIG_DEBUG_ERRORS=y 1234# CONFIG_DEBUG_LIST is not set
756CONFIG_DEBUG_LL=y 1235# CONFIG_DEBUG_SG is not set
757# CONFIG_DEBUG_ICEDCC is not set 1236# CONFIG_DEBUG_NOTIFIERS is not set
1237# CONFIG_BOOT_PRINTK_DELAY is not set
1238# CONFIG_RCU_TORTURE_TEST is not set
1239# CONFIG_RCU_CPU_STALL_DETECTOR is not set
1240# CONFIG_BACKTRACE_SELF_TEST is not set
1241# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
1242# CONFIG_FAULT_INJECTION is not set
1243# CONFIG_LATENCYTOP is not set
1244# CONFIG_SYSCTL_SYSCALL_CHECK is not set
1245# CONFIG_PAGE_POISONING is not set
1246CONFIG_HAVE_FUNCTION_TRACER=y
1247CONFIG_TRACING_SUPPORT=y
1248
1249#
1250# Tracers
1251#
1252# CONFIG_FUNCTION_TRACER is not set
1253# CONFIG_IRQSOFF_TRACER is not set
1254# CONFIG_PREEMPT_TRACER is not set
1255# CONFIG_SCHED_TRACER is not set
1256# CONFIG_CONTEXT_SWITCH_TRACER is not set
1257# CONFIG_EVENT_TRACER is not set
1258# CONFIG_BOOT_TRACER is not set
1259# CONFIG_TRACE_BRANCH_PROFILING is not set
1260# CONFIG_STACK_TRACER is not set
1261# CONFIG_KMEMTRACE is not set
1262# CONFIG_WORKQUEUE_TRACER is not set
1263# CONFIG_BLK_DEV_IO_TRACE is not set
1264# CONFIG_DYNAMIC_DEBUG is not set
1265# CONFIG_SAMPLES is not set
1266CONFIG_HAVE_ARCH_KGDB=y
1267# CONFIG_KGDB is not set
1268CONFIG_ARM_UNWIND=y
1269# CONFIG_DEBUG_USER is not set
1270# CONFIG_DEBUG_ERRORS is not set
1271# CONFIG_DEBUG_STACK_USAGE is not set
1272# CONFIG_DEBUG_LL is not set
758 1273
759# 1274#
760# Security options 1275# Security options
761# 1276#
762# CONFIG_KEYS is not set 1277# CONFIG_KEYS is not set
763# CONFIG_SECURITY is not set 1278# CONFIG_SECURITY is not set
764 1279# CONFIG_SECURITYFS is not set
765# 1280# CONFIG_SECURITY_FILE_CAPABILITIES is not set
766# Cryptographic options
767#
768# CONFIG_CRYPTO is not set 1281# CONFIG_CRYPTO is not set
769 1282# CONFIG_BINARY_PRINTF is not set
770#
771# Hardware crypto devices
772#
773 1283
774# 1284#
775# Library routines 1285# Library routines
776# 1286#
1287CONFIG_BITREVERSE=y
1288CONFIG_GENERIC_FIND_LAST_BIT=y
777# CONFIG_CRC_CCITT is not set 1289# CONFIG_CRC_CCITT is not set
1290# CONFIG_CRC16 is not set
1291# CONFIG_CRC_T10DIF is not set
1292# CONFIG_CRC_ITU_T is not set
778CONFIG_CRC32=y 1293CONFIG_CRC32=y
1294# CONFIG_CRC7 is not set
779# CONFIG_LIBCRC32C is not set 1295# CONFIG_LIBCRC32C is not set
1296CONFIG_AUDIT_GENERIC=y
1297CONFIG_ZLIB_INFLATE=y
1298CONFIG_ZLIB_DEFLATE=y
1299CONFIG_DECOMPRESS_GZIP=y
1300CONFIG_DECOMPRESS_BZIP2=y
1301CONFIG_DECOMPRESS_LZMA=y
1302CONFIG_HAS_IOMEM=y
1303CONFIG_HAS_IOPORT=y
1304CONFIG_HAS_DMA=y
1305CONFIG_NLATTR=y
diff --git a/arch/arm/configs/mx27_defconfig b/arch/arm/configs/mx27_defconfig
index 083516cd0d7f..75263a83741c 100644
--- a/arch/arm/configs/mx27_defconfig
+++ b/arch/arm/configs/mx27_defconfig
@@ -1,15 +1,15 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.30-rc1 3# Linux kernel version: 2.6.31-rc4
4# Wed Apr 8 10:18:06 2009 4# Fri Jul 24 16:08:06 2009
5# 5#
6CONFIG_ARM=y 6CONFIG_ARM=y
7CONFIG_HAVE_PWM=y
7CONFIG_SYS_SUPPORTS_APM_EMULATION=y 8CONFIG_SYS_SUPPORTS_APM_EMULATION=y
8CONFIG_GENERIC_GPIO=y 9CONFIG_GENERIC_GPIO=y
9CONFIG_GENERIC_TIME=y 10CONFIG_GENERIC_TIME=y
10CONFIG_GENERIC_CLOCKEVENTS=y 11CONFIG_GENERIC_CLOCKEVENTS=y
11CONFIG_MMU=y 12CONFIG_MMU=y
12# CONFIG_NO_IOPORT is not set
13CONFIG_GENERIC_HARDIRQS=y 13CONFIG_GENERIC_HARDIRQS=y
14CONFIG_STACKTRACE_SUPPORT=y 14CONFIG_STACKTRACE_SUPPORT=y
15CONFIG_HAVE_LATENCYTOP_SUPPORT=y 15CONFIG_HAVE_LATENCYTOP_SUPPORT=y
@@ -18,14 +18,13 @@ CONFIG_TRACE_IRQFLAGS_SUPPORT=y
18CONFIG_HARDIRQS_SW_RESEND=y 18CONFIG_HARDIRQS_SW_RESEND=y
19CONFIG_GENERIC_IRQ_PROBE=y 19CONFIG_GENERIC_IRQ_PROBE=y
20CONFIG_RWSEM_GENERIC_SPINLOCK=y 20CONFIG_RWSEM_GENERIC_SPINLOCK=y
21# CONFIG_ARCH_HAS_ILOG2_U32 is not set
22# CONFIG_ARCH_HAS_ILOG2_U64 is not set
23CONFIG_GENERIC_HWEIGHT=y 21CONFIG_GENERIC_HWEIGHT=y
24CONFIG_GENERIC_CALIBRATE_DELAY=y 22CONFIG_GENERIC_CALIBRATE_DELAY=y
25CONFIG_ARCH_MTD_XIP=y 23CONFIG_ARCH_MTD_XIP=y
26CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y 24CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
27CONFIG_VECTORS_BASE=0xffff0000 25CONFIG_VECTORS_BASE=0xffff0000
28CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" 26CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
27CONFIG_CONSTRUCTORS=y
29 28
30# 29#
31# General setup 30# General setup
@@ -85,7 +84,12 @@ CONFIG_TIMERFD=y
85CONFIG_EVENTFD=y 84CONFIG_EVENTFD=y
86CONFIG_SHMEM=y 85CONFIG_SHMEM=y
87CONFIG_AIO=y 86CONFIG_AIO=y
87
88#
89# Performance Counters
90#
88CONFIG_VM_EVENT_COUNTERS=y 91CONFIG_VM_EVENT_COUNTERS=y
92# CONFIG_STRIP_ASM_SYMS is not set
89# CONFIG_COMPAT_BRK is not set 93# CONFIG_COMPAT_BRK is not set
90CONFIG_SLAB=y 94CONFIG_SLAB=y
91# CONFIG_SLUB is not set 95# CONFIG_SLUB is not set
@@ -99,6 +103,12 @@ CONFIG_KPROBES=y
99CONFIG_KRETPROBES=y 103CONFIG_KRETPROBES=y
100CONFIG_HAVE_KPROBES=y 104CONFIG_HAVE_KPROBES=y
101CONFIG_HAVE_KRETPROBES=y 105CONFIG_HAVE_KRETPROBES=y
106CONFIG_HAVE_CLK=y
107
108#
109# GCOV-based kernel profiling
110#
111# CONFIG_GCOV_KERNEL is not set
102# CONFIG_SLOW_WORK is not set 112# CONFIG_SLOW_WORK is not set
103CONFIG_HAVE_GENERIC_DMA_COHERENT=y 113CONFIG_HAVE_GENERIC_DMA_COHERENT=y
104CONFIG_SLABINFO=y 114CONFIG_SLABINFO=y
@@ -111,7 +121,7 @@ CONFIG_MODULE_UNLOAD=y
111# CONFIG_MODVERSIONS is not set 121# CONFIG_MODVERSIONS is not set
112# CONFIG_MODULE_SRCVERSION_ALL is not set 122# CONFIG_MODULE_SRCVERSION_ALL is not set
113CONFIG_BLOCK=y 123CONFIG_BLOCK=y
114# CONFIG_LBD is not set 124CONFIG_LBDAF=y
115# CONFIG_BLK_DEV_BSG is not set 125# CONFIG_BLK_DEV_BSG is not set
116# CONFIG_BLK_DEV_INTEGRITY is not set 126# CONFIG_BLK_DEV_INTEGRITY is not set
117 127
@@ -138,13 +148,14 @@ CONFIG_FREEZER=y
138# CONFIG_ARCH_VERSATILE is not set 148# CONFIG_ARCH_VERSATILE is not set
139# CONFIG_ARCH_AT91 is not set 149# CONFIG_ARCH_AT91 is not set
140# CONFIG_ARCH_CLPS711X is not set 150# CONFIG_ARCH_CLPS711X is not set
151# CONFIG_ARCH_GEMINI is not set
141# CONFIG_ARCH_EBSA110 is not set 152# CONFIG_ARCH_EBSA110 is not set
142# CONFIG_ARCH_EP93XX is not set 153# CONFIG_ARCH_EP93XX is not set
143# CONFIG_ARCH_GEMINI is not set
144# CONFIG_ARCH_FOOTBRIDGE is not set 154# CONFIG_ARCH_FOOTBRIDGE is not set
155CONFIG_ARCH_MXC=y
156# CONFIG_ARCH_STMP3XXX is not set
145# CONFIG_ARCH_NETX is not set 157# CONFIG_ARCH_NETX is not set
146# CONFIG_ARCH_H720X is not set 158# CONFIG_ARCH_H720X is not set
147# CONFIG_ARCH_IMX is not set
148# CONFIG_ARCH_IOP13XX is not set 159# CONFIG_ARCH_IOP13XX is not set
149# CONFIG_ARCH_IOP32X is not set 160# CONFIG_ARCH_IOP32X is not set
150# CONFIG_ARCH_IOP33X is not set 161# CONFIG_ARCH_IOP33X is not set
@@ -153,25 +164,25 @@ CONFIG_FREEZER=y
153# CONFIG_ARCH_IXP4XX is not set 164# CONFIG_ARCH_IXP4XX is not set
154# CONFIG_ARCH_L7200 is not set 165# CONFIG_ARCH_L7200 is not set
155# CONFIG_ARCH_KIRKWOOD is not set 166# CONFIG_ARCH_KIRKWOOD is not set
156# CONFIG_ARCH_KS8695 is not set
157# CONFIG_ARCH_NS9XXX is not set
158# CONFIG_ARCH_LOKI is not set 167# CONFIG_ARCH_LOKI is not set
159# CONFIG_ARCH_MV78XX0 is not set 168# CONFIG_ARCH_MV78XX0 is not set
160CONFIG_ARCH_MXC=y
161# CONFIG_ARCH_ORION5X is not set 169# CONFIG_ARCH_ORION5X is not set
170# CONFIG_ARCH_MMP is not set
171# CONFIG_ARCH_KS8695 is not set
172# CONFIG_ARCH_NS9XXX is not set
173# CONFIG_ARCH_W90X900 is not set
162# CONFIG_ARCH_PNX4008 is not set 174# CONFIG_ARCH_PNX4008 is not set
163# CONFIG_ARCH_PXA is not set 175# CONFIG_ARCH_PXA is not set
164# CONFIG_ARCH_MMP is not set 176# CONFIG_ARCH_MSM is not set
165# CONFIG_ARCH_RPC is not set 177# CONFIG_ARCH_RPC is not set
166# CONFIG_ARCH_SA1100 is not set 178# CONFIG_ARCH_SA1100 is not set
167# CONFIG_ARCH_S3C2410 is not set 179# CONFIG_ARCH_S3C2410 is not set
168# CONFIG_ARCH_S3C64XX is not set 180# CONFIG_ARCH_S3C64XX is not set
169# CONFIG_ARCH_SHARK is not set 181# CONFIG_ARCH_SHARK is not set
170# CONFIG_ARCH_LH7A40X is not set 182# CONFIG_ARCH_LH7A40X is not set
183# CONFIG_ARCH_U300 is not set
171# CONFIG_ARCH_DAVINCI is not set 184# CONFIG_ARCH_DAVINCI is not set
172# CONFIG_ARCH_OMAP is not set 185# CONFIG_ARCH_OMAP is not set
173# CONFIG_ARCH_MSM is not set
174# CONFIG_ARCH_W90X900 is not set
175 186
176# 187#
177# Freescale MXC Implementations 188# Freescale MXC Implementations
@@ -188,6 +199,8 @@ CONFIG_MACH_MX27=y
188CONFIG_MACH_MX27ADS=y 199CONFIG_MACH_MX27ADS=y
189CONFIG_MACH_PCM038=y 200CONFIG_MACH_PCM038=y
190CONFIG_MACH_PCM970_BASEBOARD=y 201CONFIG_MACH_PCM970_BASEBOARD=y
202CONFIG_MACH_MX27_3DS=y
203CONFIG_MACH_MX27LITE=y
191CONFIG_MXC_IRQ_PRIOR=y 204CONFIG_MXC_IRQ_PRIOR=y
192CONFIG_MXC_PWM=y 205CONFIG_MXC_PWM=y
193 206
@@ -213,7 +226,6 @@ CONFIG_ARM_THUMB=y
213# CONFIG_CPU_DCACHE_DISABLE is not set 226# CONFIG_CPU_DCACHE_DISABLE is not set
214# CONFIG_CPU_DCACHE_WRITETHROUGH is not set 227# CONFIG_CPU_DCACHE_WRITETHROUGH is not set
215# CONFIG_CPU_CACHE_ROUND_ROBIN is not set 228# CONFIG_CPU_CACHE_ROUND_ROBIN is not set
216# CONFIG_OUTER_CACHE is not set
217CONFIG_COMMON_CLKDEV=y 229CONFIG_COMMON_CLKDEV=y
218 230
219# 231#
@@ -238,7 +250,6 @@ CONFIG_PREEMPT=y
238CONFIG_HZ=100 250CONFIG_HZ=100
239CONFIG_AEABI=y 251CONFIG_AEABI=y
240CONFIG_OABI_COMPAT=y 252CONFIG_OABI_COMPAT=y
241CONFIG_ARCH_FLATMEM_HAS_HOLES=y
242# CONFIG_ARCH_SPARSEMEM_DEFAULT is not set 253# CONFIG_ARCH_SPARSEMEM_DEFAULT is not set
243# CONFIG_ARCH_SELECT_MEMORY_MODEL is not set 254# CONFIG_ARCH_SELECT_MEMORY_MODEL is not set
244# CONFIG_HIGHMEM is not set 255# CONFIG_HIGHMEM is not set
@@ -253,10 +264,11 @@ CONFIG_SPLIT_PTLOCK_CPUS=4096
253# CONFIG_PHYS_ADDR_T_64BIT is not set 264# CONFIG_PHYS_ADDR_T_64BIT is not set
254CONFIG_ZONE_DMA_FLAG=0 265CONFIG_ZONE_DMA_FLAG=0
255CONFIG_VIRT_TO_BUS=y 266CONFIG_VIRT_TO_BUS=y
256CONFIG_UNEVICTABLE_LRU=y
257CONFIG_HAVE_MLOCK=y 267CONFIG_HAVE_MLOCK=y
258CONFIG_HAVE_MLOCKED_PAGE_BIT=y 268CONFIG_HAVE_MLOCKED_PAGE_BIT=y
269CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
259CONFIG_ALIGNMENT_TRAP=y 270CONFIG_ALIGNMENT_TRAP=y
271# CONFIG_UACCESS_WITH_MEMCPY is not set
260 272
261# 273#
262# Boot options 274# Boot options
@@ -361,6 +373,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
361# CONFIG_ECONET is not set 373# CONFIG_ECONET is not set
362# CONFIG_WAN_ROUTER is not set 374# CONFIG_WAN_ROUTER is not set
363# CONFIG_PHONET is not set 375# CONFIG_PHONET is not set
376# CONFIG_IEEE802154 is not set
364# CONFIG_NET_SCHED is not set 377# CONFIG_NET_SCHED is not set
365# CONFIG_DCB is not set 378# CONFIG_DCB is not set
366 379
@@ -474,7 +487,16 @@ CONFIG_MTD_PHYSMAP=y
474# CONFIG_MTD_DOC2000 is not set 487# CONFIG_MTD_DOC2000 is not set
475# CONFIG_MTD_DOC2001 is not set 488# CONFIG_MTD_DOC2001 is not set
476# CONFIG_MTD_DOC2001PLUS is not set 489# CONFIG_MTD_DOC2001PLUS is not set
477# CONFIG_MTD_NAND is not set 490CONFIG_MTD_NAND=y
491# CONFIG_MTD_NAND_VERIFY_WRITE is not set
492# CONFIG_MTD_NAND_ECC_SMC is not set
493# CONFIG_MTD_NAND_MUSEUM_IDS is not set
494# CONFIG_MTD_NAND_GPIO is not set
495CONFIG_MTD_NAND_IDS=y
496# CONFIG_MTD_NAND_DISKONCHIP is not set
497# CONFIG_MTD_NAND_NANDSIM is not set
498# CONFIG_MTD_NAND_PLATFORM is not set
499CONFIG_MTD_NAND_MXC=y
478# CONFIG_MTD_ONENAND is not set 500# CONFIG_MTD_ONENAND is not set
479 501
480# 502#
@@ -485,7 +507,15 @@ CONFIG_MTD_PHYSMAP=y
485# 507#
486# UBI - Unsorted block images 508# UBI - Unsorted block images
487# 509#
488# CONFIG_MTD_UBI is not set 510CONFIG_MTD_UBI=y
511CONFIG_MTD_UBI_WL_THRESHOLD=4096
512CONFIG_MTD_UBI_BEB_RESERVE=1
513# CONFIG_MTD_UBI_GLUEBI is not set
514
515#
516# UBI debugging options
517#
518# CONFIG_MTD_UBI_DEBUG is not set
489# CONFIG_PARPORT is not set 519# CONFIG_PARPORT is not set
490CONFIG_BLK_DEV=y 520CONFIG_BLK_DEV=y
491# CONFIG_BLK_DEV_COW_COMMON is not set 521# CONFIG_BLK_DEV_COW_COMMON is not set
@@ -494,7 +524,21 @@ CONFIG_BLK_DEV=y
494# CONFIG_BLK_DEV_RAM is not set 524# CONFIG_BLK_DEV_RAM is not set
495# CONFIG_CDROM_PKTCDVD is not set 525# CONFIG_CDROM_PKTCDVD is not set
496# CONFIG_ATA_OVER_ETH is not set 526# CONFIG_ATA_OVER_ETH is not set
497# CONFIG_MISC_DEVICES is not set 527# CONFIG_MG_DISK is not set
528CONFIG_MISC_DEVICES=y
529# CONFIG_ICS932S401 is not set
530# CONFIG_ENCLOSURE_SERVICES is not set
531# CONFIG_ISL29003 is not set
532# CONFIG_C2PORT is not set
533
534#
535# EEPROM support
536#
537CONFIG_EEPROM_AT24=y
538# CONFIG_EEPROM_AT25 is not set
539# CONFIG_EEPROM_LEGACY is not set
540# CONFIG_EEPROM_MAX6875 is not set
541# CONFIG_EEPROM_93CX6 is not set
498CONFIG_HAVE_IDE=y 542CONFIG_HAVE_IDE=y
499# CONFIG_IDE is not set 543# CONFIG_IDE is not set
500 544
@@ -508,7 +552,6 @@ CONFIG_HAVE_IDE=y
508# CONFIG_ATA is not set 552# CONFIG_ATA is not set
509# CONFIG_MD is not set 553# CONFIG_MD is not set
510CONFIG_NETDEVICES=y 554CONFIG_NETDEVICES=y
511CONFIG_COMPAT_NET_DEV_OPS=y
512# CONFIG_DUMMY is not set 555# CONFIG_DUMMY is not set
513# CONFIG_BONDING is not set 556# CONFIG_BONDING is not set
514# CONFIG_MACVLAN is not set 557# CONFIG_MACVLAN is not set
@@ -534,6 +577,8 @@ CONFIG_NET_ETHERNET=y
534# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set 577# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set
535# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set 578# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
536# CONFIG_B44 is not set 579# CONFIG_B44 is not set
580# CONFIG_KS8842 is not set
581# CONFIG_KS8851 is not set
537CONFIG_FEC=y 582CONFIG_FEC=y
538# CONFIG_FEC2 is not set 583# CONFIG_FEC2 is not set
539# CONFIG_NETDEV_1000 is not set 584# CONFIG_NETDEV_1000 is not set
@@ -580,6 +625,11 @@ CONFIG_INPUT_EVDEV=y
580# CONFIG_INPUT_TABLET is not set 625# CONFIG_INPUT_TABLET is not set
581CONFIG_INPUT_TOUCHSCREEN=y 626CONFIG_INPUT_TOUCHSCREEN=y
582# CONFIG_TOUCHSCREEN_ADS7846 is not set 627# CONFIG_TOUCHSCREEN_ADS7846 is not set
628# CONFIG_TOUCHSCREEN_AD7877 is not set
629# CONFIG_TOUCHSCREEN_AD7879_I2C is not set
630# CONFIG_TOUCHSCREEN_AD7879_SPI is not set
631# CONFIG_TOUCHSCREEN_AD7879 is not set
632# CONFIG_TOUCHSCREEN_EETI is not set
583# CONFIG_TOUCHSCREEN_FUJITSU is not set 633# CONFIG_TOUCHSCREEN_FUJITSU is not set
584# CONFIG_TOUCHSCREEN_GUNZE is not set 634# CONFIG_TOUCHSCREEN_GUNZE is not set
585# CONFIG_TOUCHSCREEN_ELO is not set 635# CONFIG_TOUCHSCREEN_ELO is not set
@@ -592,6 +642,7 @@ CONFIG_INPUT_TOUCHSCREEN=y
592# CONFIG_TOUCHSCREEN_TOUCHWIN is not set 642# CONFIG_TOUCHSCREEN_TOUCHWIN is not set
593# CONFIG_TOUCHSCREEN_TOUCHIT213 is not set 643# CONFIG_TOUCHSCREEN_TOUCHIT213 is not set
594# CONFIG_TOUCHSCREEN_TSC2007 is not set 644# CONFIG_TOUCHSCREEN_TSC2007 is not set
645# CONFIG_TOUCHSCREEN_W90X900 is not set
595# CONFIG_INPUT_MISC is not set 646# CONFIG_INPUT_MISC is not set
596 647
597# 648#
@@ -644,6 +695,7 @@ CONFIG_I2C_HELPER_AUTO=y
644# 695#
645# I2C system bus drivers (mostly embedded / system-on-chip) 696# I2C system bus drivers (mostly embedded / system-on-chip)
646# 697#
698# CONFIG_I2C_DESIGNWARE is not set
647# CONFIG_I2C_GPIO is not set 699# CONFIG_I2C_GPIO is not set
648CONFIG_I2C_IMX=y 700CONFIG_I2C_IMX=y
649# CONFIG_I2C_OCORES is not set 701# CONFIG_I2C_OCORES is not set
@@ -668,7 +720,6 @@ CONFIG_I2C_IMX=y
668# CONFIG_SENSORS_PCF8574 is not set 720# CONFIG_SENSORS_PCF8574 is not set
669# CONFIG_PCF8575 is not set 721# CONFIG_PCF8575 is not set
670# CONFIG_SENSORS_PCA9539 is not set 722# CONFIG_SENSORS_PCA9539 is not set
671# CONFIG_SENSORS_MAX6875 is not set
672# CONFIG_SENSORS_TSL2550 is not set 723# CONFIG_SENSORS_TSL2550 is not set
673# CONFIG_I2C_DEBUG_CORE is not set 724# CONFIG_I2C_DEBUG_CORE is not set
674# CONFIG_I2C_DEBUG_ALGO is not set 725# CONFIG_I2C_DEBUG_ALGO is not set
@@ -719,6 +770,7 @@ CONFIG_W1=y
719# 770#
720# CONFIG_W1_MASTER_DS2482 is not set 771# CONFIG_W1_MASTER_DS2482 is not set
721CONFIG_W1_MASTER_MXC=y 772CONFIG_W1_MASTER_MXC=y
773# CONFIG_W1_MASTER_DS1WM is not set
722# CONFIG_W1_MASTER_GPIO is not set 774# CONFIG_W1_MASTER_GPIO is not set
723 775
724# 776#
@@ -753,54 +805,16 @@ CONFIG_SSB_POSSIBLE=y
753# CONFIG_TPS65010 is not set 805# CONFIG_TPS65010 is not set
754# CONFIG_TWL4030_CORE is not set 806# CONFIG_TWL4030_CORE is not set
755# CONFIG_MFD_TMIO is not set 807# CONFIG_MFD_TMIO is not set
808# CONFIG_MFD_T7L66XB is not set
809# CONFIG_MFD_TC6387XB is not set
756# CONFIG_MFD_TC6393XB is not set 810# CONFIG_MFD_TC6393XB is not set
757# CONFIG_PMIC_DA903X is not set 811# CONFIG_PMIC_DA903X is not set
758# CONFIG_MFD_WM8400 is not set 812# CONFIG_MFD_WM8400 is not set
759# CONFIG_MFD_WM8350_I2C is not set 813# CONFIG_MFD_WM8350_I2C is not set
760# CONFIG_MFD_PCF50633 is not set 814# CONFIG_MFD_PCF50633 is not set
761 815# CONFIG_AB3100_CORE is not set
762# 816# CONFIG_EZX_PCAP is not set
763# Multimedia devices 817# CONFIG_MEDIA_SUPPORT is not set
764#
765
766#
767# Multimedia core support
768#
769CONFIG_VIDEO_DEV=y
770CONFIG_VIDEO_V4L2_COMMON=y
771CONFIG_VIDEO_ALLOW_V4L1=y
772CONFIG_VIDEO_V4L1_COMPAT=y
773# CONFIG_DVB_CORE is not set
774CONFIG_VIDEO_MEDIA=y
775
776#
777# Multimedia drivers
778#
779# CONFIG_MEDIA_ATTACH is not set
780CONFIG_MEDIA_TUNER=y
781# CONFIG_MEDIA_TUNER_CUSTOMISE is not set
782CONFIG_MEDIA_TUNER_SIMPLE=y
783CONFIG_MEDIA_TUNER_TDA8290=y
784CONFIG_MEDIA_TUNER_TDA9887=y
785CONFIG_MEDIA_TUNER_TEA5761=y
786CONFIG_MEDIA_TUNER_TEA5767=y
787CONFIG_MEDIA_TUNER_MT20XX=y
788CONFIG_MEDIA_TUNER_XC2028=y
789CONFIG_MEDIA_TUNER_XC5000=y
790CONFIG_MEDIA_TUNER_MC44S803=y
791CONFIG_VIDEO_V4L2=y
792CONFIG_VIDEO_V4L1=y
793CONFIG_VIDEO_CAPTURE_DRIVERS=y
794# CONFIG_VIDEO_ADV_DEBUG is not set
795# CONFIG_VIDEO_FIXED_MINOR_RANGES is not set
796CONFIG_VIDEO_HELPER_CHIPS_AUTO=y
797# CONFIG_VIDEO_VIVI is not set
798# CONFIG_VIDEO_CPIA is not set
799# CONFIG_VIDEO_SAA5246A is not set
800# CONFIG_VIDEO_SAA5249 is not set
801# CONFIG_SOC_CAMERA is not set
802# CONFIG_RADIO_ADAPTERS is not set
803# CONFIG_DAB is not set
804 818
805# 819#
806# Graphics support 820# Graphics support
@@ -917,6 +931,7 @@ CONFIG_RTC_DRV_PCF8563=y
917# CONFIG_RTC_DRV_S35390A is not set 931# CONFIG_RTC_DRV_S35390A is not set
918# CONFIG_RTC_DRV_FM3130 is not set 932# CONFIG_RTC_DRV_FM3130 is not set
919# CONFIG_RTC_DRV_RX8581 is not set 933# CONFIG_RTC_DRV_RX8581 is not set
934# CONFIG_RTC_DRV_RX8025 is not set
920 935
921# 936#
922# SPI RTC drivers 937# SPI RTC drivers
@@ -962,12 +977,15 @@ CONFIG_RTC_DRV_PCF8563=y
962# CONFIG_REISERFS_FS is not set 977# CONFIG_REISERFS_FS is not set
963# CONFIG_JFS_FS is not set 978# CONFIG_JFS_FS is not set
964# CONFIG_FS_POSIX_ACL is not set 979# CONFIG_FS_POSIX_ACL is not set
965CONFIG_FILE_LOCKING=y
966# CONFIG_XFS_FS is not set 980# CONFIG_XFS_FS is not set
981# CONFIG_GFS2_FS is not set
967# CONFIG_OCFS2_FS is not set 982# CONFIG_OCFS2_FS is not set
968# CONFIG_BTRFS_FS is not set 983# CONFIG_BTRFS_FS is not set
984CONFIG_FILE_LOCKING=y
985CONFIG_FSNOTIFY=y
969# CONFIG_DNOTIFY is not set 986# CONFIG_DNOTIFY is not set
970# CONFIG_INOTIFY is not set 987# CONFIG_INOTIFY is not set
988CONFIG_INOTIFY_USER=y
971# CONFIG_QUOTA is not set 989# CONFIG_QUOTA is not set
972# CONFIG_AUTOFS_FS is not set 990# CONFIG_AUTOFS_FS is not set
973# CONFIG_AUTOFS4_FS is not set 991# CONFIG_AUTOFS4_FS is not set
@@ -1021,6 +1039,12 @@ CONFIG_JFFS2_ZLIB=y
1021# CONFIG_JFFS2_LZO is not set 1039# CONFIG_JFFS2_LZO is not set
1022CONFIG_JFFS2_RTIME=y 1040CONFIG_JFFS2_RTIME=y
1023# CONFIG_JFFS2_RUBIN is not set 1041# CONFIG_JFFS2_RUBIN is not set
1042CONFIG_UBIFS_FS=y
1043# CONFIG_UBIFS_FS_XATTR is not set
1044# CONFIG_UBIFS_FS_ADVANCED_COMPR is not set
1045CONFIG_UBIFS_FS_LZO=y
1046CONFIG_UBIFS_FS_ZLIB=y
1047# CONFIG_UBIFS_FS_DEBUG is not set
1024# CONFIG_CRAMFS is not set 1048# CONFIG_CRAMFS is not set
1025# CONFIG_SQUASHFS is not set 1049# CONFIG_SQUASHFS is not set
1026# CONFIG_VXFS_FS is not set 1050# CONFIG_VXFS_FS is not set
@@ -1119,25 +1143,11 @@ CONFIG_SYSCTL_SYSCALL_CHECK=y
1119CONFIG_NOP_TRACER=y 1143CONFIG_NOP_TRACER=y
1120CONFIG_HAVE_FUNCTION_TRACER=y 1144CONFIG_HAVE_FUNCTION_TRACER=y
1121CONFIG_RING_BUFFER=y 1145CONFIG_RING_BUFFER=y
1146CONFIG_EVENT_TRACING=y
1147CONFIG_CONTEXT_SWITCH_TRACER=y
1122CONFIG_TRACING=y 1148CONFIG_TRACING=y
1123CONFIG_TRACING_SUPPORT=y 1149CONFIG_TRACING_SUPPORT=y
1124 1150# CONFIG_FTRACE is not set
1125#
1126# Tracers
1127#
1128# CONFIG_FUNCTION_TRACER is not set
1129# CONFIG_IRQSOFF_TRACER is not set
1130# CONFIG_PREEMPT_TRACER is not set
1131# CONFIG_SCHED_TRACER is not set
1132# CONFIG_CONTEXT_SWITCH_TRACER is not set
1133# CONFIG_EVENT_TRACER is not set
1134# CONFIG_BOOT_TRACER is not set
1135# CONFIG_TRACE_BRANCH_PROFILING is not set
1136# CONFIG_STACK_TRACER is not set
1137# CONFIG_KMEMTRACE is not set
1138# CONFIG_WORKQUEUE_TRACER is not set
1139# CONFIG_BLK_DEV_IO_TRACE is not set
1140# CONFIG_FTRACE_STARTUP_TEST is not set
1141# CONFIG_DYNAMIC_DEBUG is not set 1151# CONFIG_DYNAMIC_DEBUG is not set
1142# CONFIG_SAMPLES is not set 1152# CONFIG_SAMPLES is not set
1143CONFIG_HAVE_ARCH_KGDB=y 1153CONFIG_HAVE_ARCH_KGDB=y
@@ -1151,16 +1161,104 @@ CONFIG_ARM_UNWIND=y
1151# CONFIG_SECURITY is not set 1161# CONFIG_SECURITY is not set
1152# CONFIG_SECURITYFS is not set 1162# CONFIG_SECURITYFS is not set
1153# CONFIG_SECURITY_FILE_CAPABILITIES is not set 1163# CONFIG_SECURITY_FILE_CAPABILITIES is not set
1154# CONFIG_CRYPTO is not set 1164CONFIG_CRYPTO=y
1165
1166#
1167# Crypto core or helper
1168#
1169# CONFIG_CRYPTO_FIPS is not set
1170CONFIG_CRYPTO_ALGAPI=y
1171CONFIG_CRYPTO_ALGAPI2=y
1172# CONFIG_CRYPTO_MANAGER is not set
1173# CONFIG_CRYPTO_MANAGER2 is not set
1174# CONFIG_CRYPTO_GF128MUL is not set
1175# CONFIG_CRYPTO_NULL is not set
1176# CONFIG_CRYPTO_CRYPTD is not set
1177# CONFIG_CRYPTO_AUTHENC is not set
1178# CONFIG_CRYPTO_TEST is not set
1179
1180#
1181# Authenticated Encryption with Associated Data
1182#
1183# CONFIG_CRYPTO_CCM is not set
1184# CONFIG_CRYPTO_GCM is not set
1185# CONFIG_CRYPTO_SEQIV is not set
1186
1187#
1188# Block modes
1189#
1190# CONFIG_CRYPTO_CBC is not set
1191# CONFIG_CRYPTO_CTR is not set
1192# CONFIG_CRYPTO_CTS is not set
1193# CONFIG_CRYPTO_ECB is not set
1194# CONFIG_CRYPTO_LRW is not set
1195# CONFIG_CRYPTO_PCBC is not set
1196# CONFIG_CRYPTO_XTS is not set
1197
1198#
1199# Hash modes
1200#
1201# CONFIG_CRYPTO_HMAC is not set
1202# CONFIG_CRYPTO_XCBC is not set
1203
1204#
1205# Digest
1206#
1207# CONFIG_CRYPTO_CRC32C is not set
1208# CONFIG_CRYPTO_MD4 is not set
1209# CONFIG_CRYPTO_MD5 is not set
1210# CONFIG_CRYPTO_MICHAEL_MIC is not set
1211# CONFIG_CRYPTO_RMD128 is not set
1212# CONFIG_CRYPTO_RMD160 is not set
1213# CONFIG_CRYPTO_RMD256 is not set
1214# CONFIG_CRYPTO_RMD320 is not set
1215# CONFIG_CRYPTO_SHA1 is not set
1216# CONFIG_CRYPTO_SHA256 is not set
1217# CONFIG_CRYPTO_SHA512 is not set
1218# CONFIG_CRYPTO_TGR192 is not set
1219# CONFIG_CRYPTO_WP512 is not set
1220
1221#
1222# Ciphers
1223#
1224# CONFIG_CRYPTO_AES is not set
1225# CONFIG_CRYPTO_ANUBIS is not set
1226# CONFIG_CRYPTO_ARC4 is not set
1227# CONFIG_CRYPTO_BLOWFISH is not set
1228# CONFIG_CRYPTO_CAMELLIA is not set
1229# CONFIG_CRYPTO_CAST5 is not set
1230# CONFIG_CRYPTO_CAST6 is not set
1231# CONFIG_CRYPTO_DES is not set
1232# CONFIG_CRYPTO_FCRYPT is not set
1233# CONFIG_CRYPTO_KHAZAD is not set
1234# CONFIG_CRYPTO_SALSA20 is not set
1235# CONFIG_CRYPTO_SEED is not set
1236# CONFIG_CRYPTO_SERPENT is not set
1237# CONFIG_CRYPTO_TEA is not set
1238# CONFIG_CRYPTO_TWOFISH is not set
1239
1240#
1241# Compression
1242#
1243CONFIG_CRYPTO_DEFLATE=y
1244# CONFIG_CRYPTO_ZLIB is not set
1245CONFIG_CRYPTO_LZO=y
1246
1247#
1248# Random Number Generation
1249#
1250# CONFIG_CRYPTO_ANSI_CPRNG is not set
1251CONFIG_CRYPTO_HW=y
1155CONFIG_BINARY_PRINTF=y 1252CONFIG_BINARY_PRINTF=y
1156 1253
1157# 1254#
1158# Library routines 1255# Library routines
1159# 1256#
1160CONFIG_BITREVERSE=y 1257CONFIG_BITREVERSE=y
1258CONFIG_RATIONAL=y
1161CONFIG_GENERIC_FIND_LAST_BIT=y 1259CONFIG_GENERIC_FIND_LAST_BIT=y
1162# CONFIG_CRC_CCITT is not set 1260# CONFIG_CRC_CCITT is not set
1163# CONFIG_CRC16 is not set 1261CONFIG_CRC16=y
1164# CONFIG_CRC_T10DIF is not set 1262# CONFIG_CRC_T10DIF is not set
1165# CONFIG_CRC_ITU_T is not set 1263# CONFIG_CRC_ITU_T is not set
1166CONFIG_CRC32=y 1264CONFIG_CRC32=y
@@ -1168,6 +1266,8 @@ CONFIG_CRC32=y
1168# CONFIG_LIBCRC32C is not set 1266# CONFIG_LIBCRC32C is not set
1169CONFIG_ZLIB_INFLATE=y 1267CONFIG_ZLIB_INFLATE=y
1170CONFIG_ZLIB_DEFLATE=y 1268CONFIG_ZLIB_DEFLATE=y
1269CONFIG_LZO_COMPRESS=y
1270CONFIG_LZO_DECOMPRESS=y
1171CONFIG_HAS_IOMEM=y 1271CONFIG_HAS_IOMEM=y
1172CONFIG_HAS_IOPORT=y 1272CONFIG_HAS_IOPORT=y
1173CONFIG_HAS_DMA=y 1273CONFIG_HAS_DMA=y
diff --git a/arch/arm/configs/mx3_defconfig b/arch/arm/configs/mx3_defconfig
index 20ada526f6de..a4f9a2a8149c 100644
--- a/arch/arm/configs/mx3_defconfig
+++ b/arch/arm/configs/mx3_defconfig
@@ -1,15 +1,15 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.30-rc1 3# Linux kernel version: 2.6.31-rc4
4# Wed Apr 8 11:06:37 2009 4# Tue Jul 28 14:11:34 2009
5# 5#
6CONFIG_ARM=y 6CONFIG_ARM=y
7CONFIG_HAVE_PWM=y
7CONFIG_SYS_SUPPORTS_APM_EMULATION=y 8CONFIG_SYS_SUPPORTS_APM_EMULATION=y
8CONFIG_GENERIC_GPIO=y 9CONFIG_GENERIC_GPIO=y
9CONFIG_GENERIC_TIME=y 10CONFIG_GENERIC_TIME=y
10CONFIG_GENERIC_CLOCKEVENTS=y 11CONFIG_GENERIC_CLOCKEVENTS=y
11CONFIG_MMU=y 12CONFIG_MMU=y
12# CONFIG_NO_IOPORT is not set
13CONFIG_GENERIC_HARDIRQS=y 13CONFIG_GENERIC_HARDIRQS=y
14CONFIG_STACKTRACE_SUPPORT=y 14CONFIG_STACKTRACE_SUPPORT=y
15CONFIG_HAVE_LATENCYTOP_SUPPORT=y 15CONFIG_HAVE_LATENCYTOP_SUPPORT=y
@@ -18,14 +18,13 @@ CONFIG_TRACE_IRQFLAGS_SUPPORT=y
18CONFIG_HARDIRQS_SW_RESEND=y 18CONFIG_HARDIRQS_SW_RESEND=y
19CONFIG_GENERIC_IRQ_PROBE=y 19CONFIG_GENERIC_IRQ_PROBE=y
20CONFIG_RWSEM_GENERIC_SPINLOCK=y 20CONFIG_RWSEM_GENERIC_SPINLOCK=y
21# CONFIG_ARCH_HAS_ILOG2_U32 is not set
22# CONFIG_ARCH_HAS_ILOG2_U64 is not set
23CONFIG_GENERIC_HWEIGHT=y 21CONFIG_GENERIC_HWEIGHT=y
24CONFIG_GENERIC_CALIBRATE_DELAY=y 22CONFIG_GENERIC_CALIBRATE_DELAY=y
25CONFIG_ARCH_MTD_XIP=y 23CONFIG_ARCH_MTD_XIP=y
26CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y 24CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
27CONFIG_VECTORS_BASE=0xffff0000 25CONFIG_VECTORS_BASE=0xffff0000
28CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" 26CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
27CONFIG_CONSTRUCTORS=y
29 28
30# 29#
31# General setup 30# General setup
@@ -86,7 +85,12 @@ CONFIG_TIMERFD=y
86CONFIG_EVENTFD=y 85CONFIG_EVENTFD=y
87CONFIG_SHMEM=y 86CONFIG_SHMEM=y
88CONFIG_AIO=y 87CONFIG_AIO=y
88
89#
90# Performance Counters
91#
89CONFIG_VM_EVENT_COUNTERS=y 92CONFIG_VM_EVENT_COUNTERS=y
93# CONFIG_STRIP_ASM_SYMS is not set
90CONFIG_COMPAT_BRK=y 94CONFIG_COMPAT_BRK=y
91CONFIG_SLAB=y 95CONFIG_SLAB=y
92# CONFIG_SLUB is not set 96# CONFIG_SLUB is not set
@@ -97,6 +101,11 @@ CONFIG_HAVE_OPROFILE=y
97# CONFIG_KPROBES is not set 101# CONFIG_KPROBES is not set
98CONFIG_HAVE_KPROBES=y 102CONFIG_HAVE_KPROBES=y
99CONFIG_HAVE_KRETPROBES=y 103CONFIG_HAVE_KRETPROBES=y
104CONFIG_HAVE_CLK=y
105
106#
107# GCOV-based kernel profiling
108#
100# CONFIG_SLOW_WORK is not set 109# CONFIG_SLOW_WORK is not set
101CONFIG_HAVE_GENERIC_DMA_COHERENT=y 110CONFIG_HAVE_GENERIC_DMA_COHERENT=y
102CONFIG_SLABINFO=y 111CONFIG_SLABINFO=y
@@ -109,7 +118,7 @@ CONFIG_MODULE_FORCE_UNLOAD=y
109CONFIG_MODVERSIONS=y 118CONFIG_MODVERSIONS=y
110# CONFIG_MODULE_SRCVERSION_ALL is not set 119# CONFIG_MODULE_SRCVERSION_ALL is not set
111CONFIG_BLOCK=y 120CONFIG_BLOCK=y
112# CONFIG_LBD is not set 121CONFIG_LBDAF=y
113# CONFIG_BLK_DEV_BSG is not set 122# CONFIG_BLK_DEV_BSG is not set
114# CONFIG_BLK_DEV_INTEGRITY is not set 123# CONFIG_BLK_DEV_INTEGRITY is not set
115 124
@@ -136,13 +145,14 @@ CONFIG_FREEZER=y
136# CONFIG_ARCH_VERSATILE is not set 145# CONFIG_ARCH_VERSATILE is not set
137# CONFIG_ARCH_AT91 is not set 146# CONFIG_ARCH_AT91 is not set
138# CONFIG_ARCH_CLPS711X is not set 147# CONFIG_ARCH_CLPS711X is not set
148# CONFIG_ARCH_GEMINI is not set
139# CONFIG_ARCH_EBSA110 is not set 149# CONFIG_ARCH_EBSA110 is not set
140# CONFIG_ARCH_EP93XX is not set 150# CONFIG_ARCH_EP93XX is not set
141# CONFIG_ARCH_GEMINI is not set
142# CONFIG_ARCH_FOOTBRIDGE is not set 151# CONFIG_ARCH_FOOTBRIDGE is not set
152CONFIG_ARCH_MXC=y
153# CONFIG_ARCH_STMP3XXX is not set
143# CONFIG_ARCH_NETX is not set 154# CONFIG_ARCH_NETX is not set
144# CONFIG_ARCH_H720X is not set 155# CONFIG_ARCH_H720X is not set
145# CONFIG_ARCH_IMX is not set
146# CONFIG_ARCH_IOP13XX is not set 156# CONFIG_ARCH_IOP13XX is not set
147# CONFIG_ARCH_IOP32X is not set 157# CONFIG_ARCH_IOP32X is not set
148# CONFIG_ARCH_IOP33X is not set 158# CONFIG_ARCH_IOP33X is not set
@@ -151,25 +161,25 @@ CONFIG_FREEZER=y
151# CONFIG_ARCH_IXP4XX is not set 161# CONFIG_ARCH_IXP4XX is not set
152# CONFIG_ARCH_L7200 is not set 162# CONFIG_ARCH_L7200 is not set
153# CONFIG_ARCH_KIRKWOOD is not set 163# CONFIG_ARCH_KIRKWOOD is not set
154# CONFIG_ARCH_KS8695 is not set
155# CONFIG_ARCH_NS9XXX is not set
156# CONFIG_ARCH_LOKI is not set 164# CONFIG_ARCH_LOKI is not set
157# CONFIG_ARCH_MV78XX0 is not set 165# CONFIG_ARCH_MV78XX0 is not set
158CONFIG_ARCH_MXC=y
159# CONFIG_ARCH_ORION5X is not set 166# CONFIG_ARCH_ORION5X is not set
167# CONFIG_ARCH_MMP is not set
168# CONFIG_ARCH_KS8695 is not set
169# CONFIG_ARCH_NS9XXX is not set
170# CONFIG_ARCH_W90X900 is not set
160# CONFIG_ARCH_PNX4008 is not set 171# CONFIG_ARCH_PNX4008 is not set
161# CONFIG_ARCH_PXA is not set 172# CONFIG_ARCH_PXA is not set
162# CONFIG_ARCH_MMP is not set 173# CONFIG_ARCH_MSM is not set
163# CONFIG_ARCH_RPC is not set 174# CONFIG_ARCH_RPC is not set
164# CONFIG_ARCH_SA1100 is not set 175# CONFIG_ARCH_SA1100 is not set
165# CONFIG_ARCH_S3C2410 is not set 176# CONFIG_ARCH_S3C2410 is not set
166# CONFIG_ARCH_S3C64XX is not set 177# CONFIG_ARCH_S3C64XX is not set
167# CONFIG_ARCH_SHARK is not set 178# CONFIG_ARCH_SHARK is not set
168# CONFIG_ARCH_LH7A40X is not set 179# CONFIG_ARCH_LH7A40X is not set
180# CONFIG_ARCH_U300 is not set
169# CONFIG_ARCH_DAVINCI is not set 181# CONFIG_ARCH_DAVINCI is not set
170# CONFIG_ARCH_OMAP is not set 182# CONFIG_ARCH_OMAP is not set
171# CONFIG_ARCH_MSM is not set
172# CONFIG_ARCH_W90X900 is not set
173 183
174# 184#
175# Freescale MXC Implementations 185# Freescale MXC Implementations
@@ -178,6 +188,7 @@ CONFIG_ARCH_MXC=y
178# CONFIG_ARCH_MX2 is not set 188# CONFIG_ARCH_MX2 is not set
179CONFIG_ARCH_MX3=y 189CONFIG_ARCH_MX3=y
180CONFIG_ARCH_MX31=y 190CONFIG_ARCH_MX31=y
191CONFIG_ARCH_MX35=y
181 192
182# 193#
183# MX3 platforms: 194# MX3 platforms:
@@ -185,12 +196,19 @@ CONFIG_ARCH_MX31=y
185CONFIG_MACH_MX31ADS=y 196CONFIG_MACH_MX31ADS=y
186CONFIG_MACH_MX31ADS_WM1133_EV1=y 197CONFIG_MACH_MX31ADS_WM1133_EV1=y
187CONFIG_MACH_PCM037=y 198CONFIG_MACH_PCM037=y
199CONFIG_MACH_PCM037_EET=y
188CONFIG_MACH_MX31LITE=y 200CONFIG_MACH_MX31LITE=y
189CONFIG_MACH_MX31_3DS=y 201CONFIG_MACH_MX31_3DS=y
190CONFIG_MACH_MX31MOBOARD=y 202CONFIG_MACH_MX31MOBOARD=y
203CONFIG_MACH_MX31LILLY=y
191CONFIG_MACH_QONG=y 204CONFIG_MACH_QONG=y
205CONFIG_MACH_PCM043=y
206CONFIG_MACH_ARMADILLO5X0=y
207CONFIG_MACH_MX35_3DS=y
192CONFIG_MXC_IRQ_PRIOR=y 208CONFIG_MXC_IRQ_PRIOR=y
193CONFIG_MXC_PWM=y 209CONFIG_MXC_PWM=y
210CONFIG_ARCH_HAS_RNGA=y
211CONFIG_ARCH_MXC_IOMUX_V3=y
194 212
195# 213#
196# Processor Type 214# Processor Type
@@ -218,6 +236,7 @@ CONFIG_ARM_THUMB=y
218# CONFIG_CPU_BPREDICT_DISABLE is not set 236# CONFIG_CPU_BPREDICT_DISABLE is not set
219CONFIG_OUTER_CACHE=y 237CONFIG_OUTER_CACHE=y
220CONFIG_CACHE_L2X0=y 238CONFIG_CACHE_L2X0=y
239# CONFIG_ARM_ERRATA_411920 is not set
221CONFIG_COMMON_CLKDEV=y 240CONFIG_COMMON_CLKDEV=y
222 241
223# 242#
@@ -242,7 +261,6 @@ CONFIG_PREEMPT=y
242CONFIG_HZ=100 261CONFIG_HZ=100
243CONFIG_AEABI=y 262CONFIG_AEABI=y
244CONFIG_OABI_COMPAT=y 263CONFIG_OABI_COMPAT=y
245CONFIG_ARCH_FLATMEM_HAS_HOLES=y
246# CONFIG_ARCH_SPARSEMEM_DEFAULT is not set 264# CONFIG_ARCH_SPARSEMEM_DEFAULT is not set
247# CONFIG_ARCH_SELECT_MEMORY_MODEL is not set 265# CONFIG_ARCH_SELECT_MEMORY_MODEL is not set
248# CONFIG_HIGHMEM is not set 266# CONFIG_HIGHMEM is not set
@@ -257,10 +275,11 @@ CONFIG_SPLIT_PTLOCK_CPUS=4
257# CONFIG_PHYS_ADDR_T_64BIT is not set 275# CONFIG_PHYS_ADDR_T_64BIT is not set
258CONFIG_ZONE_DMA_FLAG=0 276CONFIG_ZONE_DMA_FLAG=0
259CONFIG_VIRT_TO_BUS=y 277CONFIG_VIRT_TO_BUS=y
260CONFIG_UNEVICTABLE_LRU=y
261CONFIG_HAVE_MLOCK=y 278CONFIG_HAVE_MLOCK=y
262CONFIG_HAVE_MLOCKED_PAGE_BIT=y 279CONFIG_HAVE_MLOCKED_PAGE_BIT=y
280CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
263CONFIG_ALIGNMENT_TRAP=y 281CONFIG_ALIGNMENT_TRAP=y
282# CONFIG_UACCESS_WITH_MEMCPY is not set
264 283
265# 284#
266# Boot options 285# Boot options
@@ -362,6 +381,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
362# CONFIG_ECONET is not set 381# CONFIG_ECONET is not set
363# CONFIG_WAN_ROUTER is not set 382# CONFIG_WAN_ROUTER is not set
364# CONFIG_PHONET is not set 383# CONFIG_PHONET is not set
384# CONFIG_IEEE802154 is not set
365# CONFIG_NET_SCHED is not set 385# CONFIG_NET_SCHED is not set
366# CONFIG_DCB is not set 386# CONFIG_DCB is not set
367 387
@@ -465,7 +485,16 @@ CONFIG_MTD_PHYSMAP=y
465# CONFIG_MTD_DOC2000 is not set 485# CONFIG_MTD_DOC2000 is not set
466# CONFIG_MTD_DOC2001 is not set 486# CONFIG_MTD_DOC2001 is not set
467# CONFIG_MTD_DOC2001PLUS is not set 487# CONFIG_MTD_DOC2001PLUS is not set
468# CONFIG_MTD_NAND is not set 488CONFIG_MTD_NAND=y
489# CONFIG_MTD_NAND_VERIFY_WRITE is not set
490# CONFIG_MTD_NAND_ECC_SMC is not set
491# CONFIG_MTD_NAND_MUSEUM_IDS is not set
492# CONFIG_MTD_NAND_GPIO is not set
493CONFIG_MTD_NAND_IDS=y
494# CONFIG_MTD_NAND_DISKONCHIP is not set
495# CONFIG_MTD_NAND_NANDSIM is not set
496# CONFIG_MTD_NAND_PLATFORM is not set
497CONFIG_MTD_NAND_MXC=y
469# CONFIG_MTD_ONENAND is not set 498# CONFIG_MTD_ONENAND is not set
470 499
471# 500#
@@ -476,10 +505,30 @@ CONFIG_MTD_PHYSMAP=y
476# 505#
477# UBI - Unsorted block images 506# UBI - Unsorted block images
478# 507#
479# CONFIG_MTD_UBI is not set 508CONFIG_MTD_UBI=y
509CONFIG_MTD_UBI_WL_THRESHOLD=4096
510CONFIG_MTD_UBI_BEB_RESERVE=1
511# CONFIG_MTD_UBI_GLUEBI is not set
512
513#
514# UBI debugging options
515#
516# CONFIG_MTD_UBI_DEBUG is not set
480# CONFIG_PARPORT is not set 517# CONFIG_PARPORT is not set
481# CONFIG_BLK_DEV is not set 518# CONFIG_BLK_DEV is not set
482# CONFIG_MISC_DEVICES is not set 519CONFIG_MISC_DEVICES=y
520# CONFIG_ICS932S401 is not set
521# CONFIG_ENCLOSURE_SERVICES is not set
522# CONFIG_ISL29003 is not set
523# CONFIG_C2PORT is not set
524
525#
526# EEPROM support
527#
528CONFIG_EEPROM_AT24=y
529# CONFIG_EEPROM_LEGACY is not set
530# CONFIG_EEPROM_MAX6875 is not set
531# CONFIG_EEPROM_93CX6 is not set
483CONFIG_HAVE_IDE=y 532CONFIG_HAVE_IDE=y
484# CONFIG_IDE is not set 533# CONFIG_IDE is not set
485 534
@@ -493,7 +542,6 @@ CONFIG_HAVE_IDE=y
493# CONFIG_ATA is not set 542# CONFIG_ATA is not set
494# CONFIG_MD is not set 543# CONFIG_MD is not set
495CONFIG_NETDEVICES=y 544CONFIG_NETDEVICES=y
496CONFIG_COMPAT_NET_DEV_OPS=y
497# CONFIG_DUMMY is not set 545# CONFIG_DUMMY is not set
498# CONFIG_BONDING is not set 546# CONFIG_BONDING is not set
499# CONFIG_MACVLAN is not set 547# CONFIG_MACVLAN is not set
@@ -528,7 +576,7 @@ CONFIG_MII=y
528# CONFIG_ETHOC is not set 576# CONFIG_ETHOC is not set
529# CONFIG_SMC911X is not set 577# CONFIG_SMC911X is not set
530CONFIG_SMSC911X=y 578CONFIG_SMSC911X=y
531# CONFIG_DNET is not set 579CONFIG_DNET=y
532# CONFIG_IBM_NEW_EMAC_ZMII is not set 580# CONFIG_IBM_NEW_EMAC_ZMII is not set
533# CONFIG_IBM_NEW_EMAC_RGMII is not set 581# CONFIG_IBM_NEW_EMAC_RGMII is not set
534# CONFIG_IBM_NEW_EMAC_TAH is not set 582# CONFIG_IBM_NEW_EMAC_TAH is not set
@@ -537,8 +585,10 @@ CONFIG_SMSC911X=y
537# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set 585# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set
538# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set 586# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
539# CONFIG_B44 is not set 587# CONFIG_B44 is not set
540CONFIG_CS89x0=y 588# CONFIG_CS89x0 is not set
541CONFIG_CS89x0_NONISA_IRQ=y 589# CONFIG_KS8842 is not set
590CONFIG_FEC=y
591# CONFIG_FEC2 is not set
542# CONFIG_NETDEV_1000 is not set 592# CONFIG_NETDEV_1000 is not set
543# CONFIG_NETDEV_10000 is not set 593# CONFIG_NETDEV_10000 is not set
544 594
@@ -609,6 +659,7 @@ CONFIG_I2C_HELPER_AUTO=y
609# 659#
610# I2C system bus drivers (mostly embedded / system-on-chip) 660# I2C system bus drivers (mostly embedded / system-on-chip)
611# 661#
662# CONFIG_I2C_DESIGNWARE is not set
612# CONFIG_I2C_GPIO is not set 663# CONFIG_I2C_GPIO is not set
613CONFIG_I2C_IMX=y 664CONFIG_I2C_IMX=y
614# CONFIG_I2C_OCORES is not set 665# CONFIG_I2C_OCORES is not set
@@ -633,7 +684,6 @@ CONFIG_I2C_IMX=y
633# CONFIG_SENSORS_PCF8574 is not set 684# CONFIG_SENSORS_PCF8574 is not set
634# CONFIG_PCF8575 is not set 685# CONFIG_PCF8575 is not set
635# CONFIG_SENSORS_PCA9539 is not set 686# CONFIG_SENSORS_PCA9539 is not set
636# CONFIG_SENSORS_MAX6875 is not set
637# CONFIG_SENSORS_TSL2550 is not set 687# CONFIG_SENSORS_TSL2550 is not set
638# CONFIG_I2C_DEBUG_CORE is not set 688# CONFIG_I2C_DEBUG_CORE is not set
639# CONFIG_I2C_DEBUG_ALGO is not set 689# CONFIG_I2C_DEBUG_ALGO is not set
@@ -669,6 +719,7 @@ CONFIG_W1=y
669# 719#
670# CONFIG_W1_MASTER_DS2482 is not set 720# CONFIG_W1_MASTER_DS2482 is not set
671CONFIG_W1_MASTER_MXC=y 721CONFIG_W1_MASTER_MXC=y
722# CONFIG_W1_MASTER_DS1WM is not set
672# CONFIG_W1_MASTER_GPIO is not set 723# CONFIG_W1_MASTER_GPIO is not set
673 724
674# 725#
@@ -703,6 +754,8 @@ CONFIG_SSB_POSSIBLE=y
703# CONFIG_TPS65010 is not set 754# CONFIG_TPS65010 is not set
704# CONFIG_TWL4030_CORE is not set 755# CONFIG_TWL4030_CORE is not set
705# CONFIG_MFD_TMIO is not set 756# CONFIG_MFD_TMIO is not set
757# CONFIG_MFD_T7L66XB is not set
758# CONFIG_MFD_TC6387XB is not set
706# CONFIG_MFD_TC6393XB is not set 759# CONFIG_MFD_TC6393XB is not set
707# CONFIG_PMIC_DA903X is not set 760# CONFIG_PMIC_DA903X is not set
708# CONFIG_MFD_WM8400 is not set 761# CONFIG_MFD_WM8400 is not set
@@ -711,10 +764,8 @@ CONFIG_MFD_WM8350_CONFIG_MODE_0=y
711CONFIG_MFD_WM8352_CONFIG_MODE_0=y 764CONFIG_MFD_WM8352_CONFIG_MODE_0=y
712CONFIG_MFD_WM8350_I2C=y 765CONFIG_MFD_WM8350_I2C=y
713# CONFIG_MFD_PCF50633 is not set 766# CONFIG_MFD_PCF50633 is not set
714 767# CONFIG_AB3100_CORE is not set
715# 768CONFIG_MEDIA_SUPPORT=y
716# Multimedia devices
717#
718 769
719# 770#
720# Multimedia core support 771# Multimedia core support
@@ -758,8 +809,10 @@ CONFIG_SOC_CAMERA_MT9T031=y
758CONFIG_SOC_CAMERA_MT9V022=y 809CONFIG_SOC_CAMERA_MT9V022=y
759CONFIG_SOC_CAMERA_TW9910=y 810CONFIG_SOC_CAMERA_TW9910=y
760# CONFIG_SOC_CAMERA_PLATFORM is not set 811# CONFIG_SOC_CAMERA_PLATFORM is not set
761# CONFIG_SOC_CAMERA_OV772X is not set 812CONFIG_SOC_CAMERA_OV772X=y
813CONFIG_MX3_VIDEO=y
762CONFIG_VIDEO_MX3=y 814CONFIG_VIDEO_MX3=y
815# CONFIG_VIDEO_SH_MOBILE_CEU is not set
763# CONFIG_RADIO_ADAPTERS is not set 816# CONFIG_RADIO_ADAPTERS is not set
764# CONFIG_DAB is not set 817# CONFIG_DAB is not set
765 818
@@ -847,8 +900,11 @@ CONFIG_REGULATOR=y
847# CONFIG_REGULATOR_DEBUG is not set 900# CONFIG_REGULATOR_DEBUG is not set
848# CONFIG_REGULATOR_FIXED_VOLTAGE is not set 901# CONFIG_REGULATOR_FIXED_VOLTAGE is not set
849# CONFIG_REGULATOR_VIRTUAL_CONSUMER is not set 902# CONFIG_REGULATOR_VIRTUAL_CONSUMER is not set
903# CONFIG_REGULATOR_USERSPACE_CONSUMER is not set
850# CONFIG_REGULATOR_BQ24022 is not set 904# CONFIG_REGULATOR_BQ24022 is not set
905# CONFIG_REGULATOR_MAX1586 is not set
851CONFIG_REGULATOR_WM8350=y 906CONFIG_REGULATOR_WM8350=y
907# CONFIG_REGULATOR_LP3971 is not set
852# CONFIG_UIO is not set 908# CONFIG_UIO is not set
853# CONFIG_STAGING is not set 909# CONFIG_STAGING is not set
854 910
@@ -861,10 +917,12 @@ CONFIG_REGULATOR_WM8350=y
861# CONFIG_REISERFS_FS is not set 917# CONFIG_REISERFS_FS is not set
862# CONFIG_JFS_FS is not set 918# CONFIG_JFS_FS is not set
863# CONFIG_FS_POSIX_ACL is not set 919# CONFIG_FS_POSIX_ACL is not set
864CONFIG_FILE_LOCKING=y
865# CONFIG_XFS_FS is not set 920# CONFIG_XFS_FS is not set
921# CONFIG_GFS2_FS is not set
866# CONFIG_OCFS2_FS is not set 922# CONFIG_OCFS2_FS is not set
867# CONFIG_BTRFS_FS is not set 923# CONFIG_BTRFS_FS is not set
924CONFIG_FILE_LOCKING=y
925CONFIG_FSNOTIFY=y
868# CONFIG_DNOTIFY is not set 926# CONFIG_DNOTIFY is not set
869CONFIG_INOTIFY=y 927CONFIG_INOTIFY=y
870CONFIG_INOTIFY_USER=y 928CONFIG_INOTIFY_USER=y
@@ -921,6 +979,12 @@ CONFIG_JFFS2_ZLIB=y
921# CONFIG_JFFS2_LZO is not set 979# CONFIG_JFFS2_LZO is not set
922CONFIG_JFFS2_RTIME=y 980CONFIG_JFFS2_RTIME=y
923# CONFIG_JFFS2_RUBIN is not set 981# CONFIG_JFFS2_RUBIN is not set
982CONFIG_UBIFS_FS=y
983# CONFIG_UBIFS_FS_XATTR is not set
984# CONFIG_UBIFS_FS_ADVANCED_COMPR is not set
985CONFIG_UBIFS_FS_LZO=y
986CONFIG_UBIFS_FS_ZLIB=y
987# CONFIG_UBIFS_FS_DEBUG is not set
924# CONFIG_CRAMFS is not set 988# CONFIG_CRAMFS is not set
925# CONFIG_SQUASHFS is not set 989# CONFIG_SQUASHFS is not set
926# CONFIG_VXFS_FS is not set 990# CONFIG_VXFS_FS is not set
@@ -937,6 +1001,7 @@ CONFIG_NFS_FS=y
937CONFIG_NFS_V3=y 1001CONFIG_NFS_V3=y
938# CONFIG_NFS_V3_ACL is not set 1002# CONFIG_NFS_V3_ACL is not set
939CONFIG_NFS_V4=y 1003CONFIG_NFS_V4=y
1004# CONFIG_NFS_V4_1 is not set
940CONFIG_ROOT_NFS=y 1005CONFIG_ROOT_NFS=y
941# CONFIG_NFSD is not set 1006# CONFIG_NFSD is not set
942CONFIG_LOCKD=y 1007CONFIG_LOCKD=y
@@ -979,22 +1044,7 @@ CONFIG_FRAME_WARN=1024
979CONFIG_SYSCTL_SYSCALL_CHECK=y 1044CONFIG_SYSCTL_SYSCALL_CHECK=y
980CONFIG_HAVE_FUNCTION_TRACER=y 1045CONFIG_HAVE_FUNCTION_TRACER=y
981CONFIG_TRACING_SUPPORT=y 1046CONFIG_TRACING_SUPPORT=y
982 1047# CONFIG_FTRACE is not set
983#
984# Tracers
985#
986# CONFIG_FUNCTION_TRACER is not set
987# CONFIG_IRQSOFF_TRACER is not set
988# CONFIG_PREEMPT_TRACER is not set
989# CONFIG_SCHED_TRACER is not set
990# CONFIG_CONTEXT_SWITCH_TRACER is not set
991# CONFIG_EVENT_TRACER is not set
992# CONFIG_BOOT_TRACER is not set
993# CONFIG_TRACE_BRANCH_PROFILING is not set
994# CONFIG_STACK_TRACER is not set
995# CONFIG_KMEMTRACE is not set
996# CONFIG_WORKQUEUE_TRACER is not set
997# CONFIG_BLK_DEV_IO_TRACE is not set
998# CONFIG_SAMPLES is not set 1048# CONFIG_SAMPLES is not set
999CONFIG_HAVE_ARCH_KGDB=y 1049CONFIG_HAVE_ARCH_KGDB=y
1000CONFIG_ARM_UNWIND=y 1050CONFIG_ARM_UNWIND=y
@@ -1094,9 +1144,9 @@ CONFIG_CRYPTO_DES=y
1094# 1144#
1095# Compression 1145# Compression
1096# 1146#
1097# CONFIG_CRYPTO_DEFLATE is not set 1147CONFIG_CRYPTO_DEFLATE=y
1098# CONFIG_CRYPTO_ZLIB is not set 1148# CONFIG_CRYPTO_ZLIB is not set
1099# CONFIG_CRYPTO_LZO is not set 1149CONFIG_CRYPTO_LZO=y
1100 1150
1101# 1151#
1102# Random Number Generation 1152# Random Number Generation
@@ -1109,9 +1159,10 @@ CONFIG_CRYPTO_HW=y
1109# Library routines 1159# Library routines
1110# 1160#
1111CONFIG_BITREVERSE=y 1161CONFIG_BITREVERSE=y
1162CONFIG_RATIONAL=y
1112CONFIG_GENERIC_FIND_LAST_BIT=y 1163CONFIG_GENERIC_FIND_LAST_BIT=y
1113# CONFIG_CRC_CCITT is not set 1164# CONFIG_CRC_CCITT is not set
1114# CONFIG_CRC16 is not set 1165CONFIG_CRC16=y
1115# CONFIG_CRC_T10DIF is not set 1166# CONFIG_CRC_T10DIF is not set
1116# CONFIG_CRC_ITU_T is not set 1167# CONFIG_CRC_ITU_T is not set
1117CONFIG_CRC32=y 1168CONFIG_CRC32=y
@@ -1119,6 +1170,8 @@ CONFIG_CRC32=y
1119# CONFIG_LIBCRC32C is not set 1170# CONFIG_LIBCRC32C is not set
1120CONFIG_ZLIB_INFLATE=y 1171CONFIG_ZLIB_INFLATE=y
1121CONFIG_ZLIB_DEFLATE=y 1172CONFIG_ZLIB_DEFLATE=y
1173CONFIG_LZO_COMPRESS=y
1174CONFIG_LZO_DECOMPRESS=y
1122CONFIG_HAS_IOMEM=y 1175CONFIG_HAS_IOMEM=y
1123CONFIG_HAS_IOPORT=y 1176CONFIG_HAS_IOPORT=y
1124CONFIG_HAS_DMA=y 1177CONFIG_HAS_DMA=y
diff --git a/arch/arm/configs/omap3_evm_defconfig b/arch/arm/configs/omap3_evm_defconfig
index 28be17fbc157..d5ff4776cd0a 100644
--- a/arch/arm/configs/omap3_evm_defconfig
+++ b/arch/arm/configs/omap3_evm_defconfig
@@ -1107,7 +1107,7 @@ CONFIG_USB_ZERO=m
1107CONFIG_USB_OTG_UTILS=y 1107CONFIG_USB_OTG_UTILS=y
1108# CONFIG_USB_GPIO_VBUS is not set 1108# CONFIG_USB_GPIO_VBUS is not set
1109# CONFIG_ISP1301_OMAP is not set 1109# CONFIG_ISP1301_OMAP is not set
1110CONFIG_TWL4030_USB=y 1110# CONFIG_TWL4030_USB is not set
1111# CONFIG_NOP_USB_XCEIV is not set 1111# CONFIG_NOP_USB_XCEIV is not set
1112CONFIG_MMC=y 1112CONFIG_MMC=y
1113# CONFIG_MMC_DEBUG is not set 1113# CONFIG_MMC_DEBUG is not set
diff --git a/arch/arm/configs/s3c2410_defconfig b/arch/arm/configs/s3c2410_defconfig
index 2d58b8fe59be..b49810461e41 100644
--- a/arch/arm/configs/s3c2410_defconfig
+++ b/arch/arm/configs/s3c2410_defconfig
@@ -260,6 +260,7 @@ CONFIG_MACH_NEXCODER_2440=y
260CONFIG_SMDK2440_CPU2440=y 260CONFIG_SMDK2440_CPU2440=y
261CONFIG_MACH_AT2440EVB=y 261CONFIG_MACH_AT2440EVB=y
262CONFIG_CPU_S3C2442=y 262CONFIG_CPU_S3C2442=y
263CONFIG_MACH_MINI2440=y
263 264
264# 265#
265# S3C2442 Machines 266# S3C2442 Machines
@@ -2298,7 +2299,6 @@ CONFIG_DEBUG_ERRORS=y
2298# CONFIG_DEBUG_STACK_USAGE is not set 2299# CONFIG_DEBUG_STACK_USAGE is not set
2299CONFIG_DEBUG_LL=y 2300CONFIG_DEBUG_LL=y
2300# CONFIG_DEBUG_ICEDCC is not set 2301# CONFIG_DEBUG_ICEDCC is not set
2301CONFIG_DEBUG_S3C_PORT=y
2302CONFIG_DEBUG_S3C_UART=0 2302CONFIG_DEBUG_S3C_UART=0
2303 2303
2304# 2304#
diff --git a/arch/arm/configs/s3c6400_defconfig b/arch/arm/configs/s3c6400_defconfig
index 2e8fa50e9a09..32860609e057 100644
--- a/arch/arm/configs/s3c6400_defconfig
+++ b/arch/arm/configs/s3c6400_defconfig
@@ -816,7 +816,6 @@ CONFIG_DEBUG_ERRORS=y
816# CONFIG_DEBUG_STACK_USAGE is not set 816# CONFIG_DEBUG_STACK_USAGE is not set
817CONFIG_DEBUG_LL=y 817CONFIG_DEBUG_LL=y
818# CONFIG_DEBUG_ICEDCC is not set 818# CONFIG_DEBUG_ICEDCC is not set
819CONFIG_DEBUG_S3C_PORT=y
820CONFIG_DEBUG_S3C_UART=0 819CONFIG_DEBUG_S3C_UART=0
821 820
822# 821#
diff --git a/arch/arm/configs/tct_hammer_defconfig b/arch/arm/configs/tct_hammer_defconfig
index 07dfb98df4f0..9d32faef05f6 100644
--- a/arch/arm/configs/tct_hammer_defconfig
+++ b/arch/arm/configs/tct_hammer_defconfig
@@ -857,7 +857,6 @@ CONFIG_DEBUG_ERRORS=y
857# CONFIG_DEBUG_STACK_USAGE is not set 857# CONFIG_DEBUG_STACK_USAGE is not set
858CONFIG_DEBUG_LL=y 858CONFIG_DEBUG_LL=y
859# CONFIG_DEBUG_ICEDCC is not set 859# CONFIG_DEBUG_ICEDCC is not set
860# CONFIG_DEBUG_S3C_PORT is not set
861CONFIG_DEBUG_S3C_UART=0 860CONFIG_DEBUG_S3C_UART=0
862 861
863# 862#
diff --git a/arch/arm/configs/u300_defconfig b/arch/arm/configs/u300_defconfig
index 2d827e121147..7d61ae6e75da 100644
--- a/arch/arm/configs/u300_defconfig
+++ b/arch/arm/configs/u300_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.30-rc6 3# Linux kernel version: 2.6.31-rc3
4# Mon Jun 1 09:18:22 2009 4# Thu Jul 16 23:36:10 2009
5# 5#
6CONFIG_ARM=y 6CONFIG_ARM=y
7CONFIG_SYS_SUPPORTS_APM_EMULATION=y 7CONFIG_SYS_SUPPORTS_APM_EMULATION=y
@@ -9,7 +9,6 @@ CONFIG_GENERIC_GPIO=y
9CONFIG_GENERIC_TIME=y 9CONFIG_GENERIC_TIME=y
10CONFIG_GENERIC_CLOCKEVENTS=y 10CONFIG_GENERIC_CLOCKEVENTS=y
11CONFIG_MMU=y 11CONFIG_MMU=y
12# CONFIG_NO_IOPORT is not set
13CONFIG_GENERIC_HARDIRQS=y 12CONFIG_GENERIC_HARDIRQS=y
14CONFIG_STACKTRACE_SUPPORT=y 13CONFIG_STACKTRACE_SUPPORT=y
15CONFIG_HAVE_LATENCYTOP_SUPPORT=y 14CONFIG_HAVE_LATENCYTOP_SUPPORT=y
@@ -18,13 +17,12 @@ CONFIG_TRACE_IRQFLAGS_SUPPORT=y
18CONFIG_HARDIRQS_SW_RESEND=y 17CONFIG_HARDIRQS_SW_RESEND=y
19CONFIG_GENERIC_IRQ_PROBE=y 18CONFIG_GENERIC_IRQ_PROBE=y
20CONFIG_RWSEM_GENERIC_SPINLOCK=y 19CONFIG_RWSEM_GENERIC_SPINLOCK=y
21# CONFIG_ARCH_HAS_ILOG2_U32 is not set
22# CONFIG_ARCH_HAS_ILOG2_U64 is not set
23CONFIG_GENERIC_HWEIGHT=y 20CONFIG_GENERIC_HWEIGHT=y
24CONFIG_GENERIC_CALIBRATE_DELAY=y 21CONFIG_GENERIC_CALIBRATE_DELAY=y
25CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y 22CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
26CONFIG_VECTORS_BASE=0xffff0000 23CONFIG_VECTORS_BASE=0xffff0000
27CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" 24CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
25CONFIG_CONSTRUCTORS=y
28 26
29# 27#
30# General setup 28# General setup
@@ -68,7 +66,6 @@ CONFIG_SYSCTL_SYSCALL=y
68CONFIG_KALLSYMS=y 66CONFIG_KALLSYMS=y
69# CONFIG_KALLSYMS_ALL is not set 67# CONFIG_KALLSYMS_ALL is not set
70# CONFIG_KALLSYMS_EXTRA_PASS is not set 68# CONFIG_KALLSYMS_EXTRA_PASS is not set
71# CONFIG_STRIP_ASM_SYMS is not set
72CONFIG_HOTPLUG=y 69CONFIG_HOTPLUG=y
73CONFIG_PRINTK=y 70CONFIG_PRINTK=y
74CONFIG_BUG=y 71CONFIG_BUG=y
@@ -81,8 +78,13 @@ CONFIG_TIMERFD=y
81CONFIG_EVENTFD=y 78CONFIG_EVENTFD=y
82CONFIG_SHMEM=y 79CONFIG_SHMEM=y
83# CONFIG_AIO is not set 80# CONFIG_AIO is not set
81
82#
83# Performance Counters
84#
84# CONFIG_VM_EVENT_COUNTERS is not set 85# CONFIG_VM_EVENT_COUNTERS is not set
85CONFIG_SLUB_DEBUG=y 86CONFIG_SLUB_DEBUG=y
87# CONFIG_STRIP_ASM_SYMS is not set
86CONFIG_COMPAT_BRK=y 88CONFIG_COMPAT_BRK=y
87# CONFIG_SLAB is not set 89# CONFIG_SLAB is not set
88CONFIG_SLUB=y 90CONFIG_SLUB=y
@@ -94,6 +96,10 @@ CONFIG_HAVE_OPROFILE=y
94CONFIG_HAVE_KPROBES=y 96CONFIG_HAVE_KPROBES=y
95CONFIG_HAVE_KRETPROBES=y 97CONFIG_HAVE_KRETPROBES=y
96CONFIG_HAVE_CLK=y 98CONFIG_HAVE_CLK=y
99
100#
101# GCOV-based kernel profiling
102#
97# CONFIG_SLOW_WORK is not set 103# CONFIG_SLOW_WORK is not set
98CONFIG_HAVE_GENERIC_DMA_COHERENT=y 104CONFIG_HAVE_GENERIC_DMA_COHERENT=y
99CONFIG_SLABINFO=y 105CONFIG_SLABINFO=y
@@ -106,7 +112,7 @@ CONFIG_MODULE_UNLOAD=y
106# CONFIG_MODVERSIONS is not set 112# CONFIG_MODVERSIONS is not set
107# CONFIG_MODULE_SRCVERSION_ALL is not set 113# CONFIG_MODULE_SRCVERSION_ALL is not set
108CONFIG_BLOCK=y 114CONFIG_BLOCK=y
109# CONFIG_LBD is not set 115# CONFIG_LBDAF is not set
110# CONFIG_BLK_DEV_BSG is not set 116# CONFIG_BLK_DEV_BSG is not set
111# CONFIG_BLK_DEV_INTEGRITY is not set 117# CONFIG_BLK_DEV_INTEGRITY is not set
112 118
@@ -138,9 +144,9 @@ CONFIG_DEFAULT_IOSCHED="deadline"
138# CONFIG_ARCH_EP93XX is not set 144# CONFIG_ARCH_EP93XX is not set
139# CONFIG_ARCH_FOOTBRIDGE is not set 145# CONFIG_ARCH_FOOTBRIDGE is not set
140# CONFIG_ARCH_MXC is not set 146# CONFIG_ARCH_MXC is not set
147# CONFIG_ARCH_STMP3XXX is not set
141# CONFIG_ARCH_NETX is not set 148# CONFIG_ARCH_NETX is not set
142# CONFIG_ARCH_H720X is not set 149# CONFIG_ARCH_H720X is not set
143# CONFIG_ARCH_IMX is not set
144# CONFIG_ARCH_IOP13XX is not set 150# CONFIG_ARCH_IOP13XX is not set
145# CONFIG_ARCH_IOP32X is not set 151# CONFIG_ARCH_IOP32X is not set
146# CONFIG_ARCH_IOP33X is not set 152# CONFIG_ARCH_IOP33X is not set
@@ -216,8 +222,8 @@ CONFIG_ARM_THUMB=y
216# CONFIG_CPU_DCACHE_DISABLE is not set 222# CONFIG_CPU_DCACHE_DISABLE is not set
217# CONFIG_CPU_DCACHE_WRITETHROUGH is not set 223# CONFIG_CPU_DCACHE_WRITETHROUGH is not set
218# CONFIG_CPU_CACHE_ROUND_ROBIN is not set 224# CONFIG_CPU_CACHE_ROUND_ROBIN is not set
219# CONFIG_OUTER_CACHE is not set
220CONFIG_ARM_VIC=y 225CONFIG_ARM_VIC=y
226CONFIG_ARM_VIC_NR=2
221CONFIG_COMMON_CLKDEV=y 227CONFIG_COMMON_CLKDEV=y
222 228
223# 229#
@@ -243,7 +249,6 @@ CONFIG_PREEMPT=y
243CONFIG_HZ=100 249CONFIG_HZ=100
244CONFIG_AEABI=y 250CONFIG_AEABI=y
245CONFIG_OABI_COMPAT=y 251CONFIG_OABI_COMPAT=y
246CONFIG_ARCH_FLATMEM_HAS_HOLES=y
247# CONFIG_ARCH_SPARSEMEM_DEFAULT is not set 252# CONFIG_ARCH_SPARSEMEM_DEFAULT is not set
248# CONFIG_ARCH_SELECT_MEMORY_MODEL is not set 253# CONFIG_ARCH_SELECT_MEMORY_MODEL is not set
249# CONFIG_HIGHMEM is not set 254# CONFIG_HIGHMEM is not set
@@ -258,17 +263,18 @@ CONFIG_SPLIT_PTLOCK_CPUS=4096
258# CONFIG_PHYS_ADDR_T_64BIT is not set 263# CONFIG_PHYS_ADDR_T_64BIT is not set
259CONFIG_ZONE_DMA_FLAG=0 264CONFIG_ZONE_DMA_FLAG=0
260CONFIG_VIRT_TO_BUS=y 265CONFIG_VIRT_TO_BUS=y
261CONFIG_UNEVICTABLE_LRU=y
262CONFIG_HAVE_MLOCK=y 266CONFIG_HAVE_MLOCK=y
263CONFIG_HAVE_MLOCKED_PAGE_BIT=y 267CONFIG_HAVE_MLOCKED_PAGE_BIT=y
268CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
264CONFIG_ALIGNMENT_TRAP=y 269CONFIG_ALIGNMENT_TRAP=y
270# CONFIG_UACCESS_WITH_MEMCPY is not set
265 271
266# 272#
267# Boot options 273# Boot options
268# 274#
269CONFIG_ZBOOT_ROM_TEXT=0x0 275CONFIG_ZBOOT_ROM_TEXT=0x0
270CONFIG_ZBOOT_ROM_BSS=0x0 276CONFIG_ZBOOT_ROM_BSS=0x0
271CONFIG_CMDLINE="root=/dev/mtdblock2 rw rootfstype=yaffs2 console=ttyAMA0,115200n8 ab3100.force=0,0x48 mtdparts=u300nand:128k@0x0(bootrecords)ro,8064k@128k(free)ro,253952k@8192k(platform) lpj=515072" 277CONFIG_CMDLINE="root=/dev/ram0 rw rootfstype=rootfs console=ttyAMA0,115200n8 lpj=515072"
272# CONFIG_XIP_KERNEL is not set 278# CONFIG_XIP_KERNEL is not set
273# CONFIG_KEXEC is not set 279# CONFIG_KEXEC is not set
274 280
@@ -359,6 +365,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
359# CONFIG_ECONET is not set 365# CONFIG_ECONET is not set
360# CONFIG_WAN_ROUTER is not set 366# CONFIG_WAN_ROUTER is not set
361# CONFIG_PHONET is not set 367# CONFIG_PHONET is not set
368# CONFIG_IEEE802154 is not set
362# CONFIG_NET_SCHED is not set 369# CONFIG_NET_SCHED is not set
363# CONFIG_DCB is not set 370# CONFIG_DCB is not set
364 371
@@ -497,6 +504,7 @@ CONFIG_MISC_DEVICES=y
497# CONFIG_EEPROM_AT24 is not set 504# CONFIG_EEPROM_AT24 is not set
498# CONFIG_EEPROM_AT25 is not set 505# CONFIG_EEPROM_AT25 is not set
499# CONFIG_EEPROM_LEGACY is not set 506# CONFIG_EEPROM_LEGACY is not set
507# CONFIG_EEPROM_MAX6875 is not set
500# CONFIG_EEPROM_93CX6 is not set 508# CONFIG_EEPROM_93CX6 is not set
501CONFIG_HAVE_IDE=y 509CONFIG_HAVE_IDE=y
502# CONFIG_IDE is not set 510# CONFIG_IDE is not set
@@ -533,12 +541,14 @@ CONFIG_INPUT_EVDEV=y
533# 541#
534CONFIG_INPUT_KEYBOARD=y 542CONFIG_INPUT_KEYBOARD=y
535# CONFIG_KEYBOARD_ATKBD is not set 543# CONFIG_KEYBOARD_ATKBD is not set
536# CONFIG_KEYBOARD_SUNKBD is not set
537# CONFIG_KEYBOARD_LKKBD is not set 544# CONFIG_KEYBOARD_LKKBD is not set
538# CONFIG_KEYBOARD_XTKBD is not set 545# CONFIG_KEYBOARD_GPIO is not set
546# CONFIG_KEYBOARD_MATRIX is not set
547# CONFIG_KEYBOARD_LM8323 is not set
539# CONFIG_KEYBOARD_NEWTON is not set 548# CONFIG_KEYBOARD_NEWTON is not set
540# CONFIG_KEYBOARD_STOWAWAY is not set 549# CONFIG_KEYBOARD_STOWAWAY is not set
541# CONFIG_KEYBOARD_GPIO is not set 550# CONFIG_KEYBOARD_SUNKBD is not set
551# CONFIG_KEYBOARD_XTKBD is not set
542# CONFIG_INPUT_MOUSE is not set 552# CONFIG_INPUT_MOUSE is not set
543# CONFIG_INPUT_JOYSTICK is not set 553# CONFIG_INPUT_JOYSTICK is not set
544# CONFIG_INPUT_TABLET is not set 554# CONFIG_INPUT_TABLET is not set
@@ -597,9 +607,11 @@ CONFIG_I2C_HELPER_AUTO=y
597# 607#
598# I2C system bus drivers (mostly embedded / system-on-chip) 608# I2C system bus drivers (mostly embedded / system-on-chip)
599# 609#
610# CONFIG_I2C_DESIGNWARE is not set
600# CONFIG_I2C_GPIO is not set 611# CONFIG_I2C_GPIO is not set
601# CONFIG_I2C_OCORES is not set 612# CONFIG_I2C_OCORES is not set
602# CONFIG_I2C_SIMTEC is not set 613# CONFIG_I2C_SIMTEC is not set
614CONFIG_I2C_STU300=y
603 615
604# 616#
605# External I2C/SMBus adapter drivers 617# External I2C/SMBus adapter drivers
@@ -620,7 +632,6 @@ CONFIG_I2C_HELPER_AUTO=y
620# CONFIG_SENSORS_PCF8574 is not set 632# CONFIG_SENSORS_PCF8574 is not set
621# CONFIG_PCF8575 is not set 633# CONFIG_PCF8575 is not set
622# CONFIG_SENSORS_PCA9539 is not set 634# CONFIG_SENSORS_PCA9539 is not set
623# CONFIG_SENSORS_MAX6875 is not set
624# CONFIG_SENSORS_TSL2550 is not set 635# CONFIG_SENSORS_TSL2550 is not set
625# CONFIG_I2C_DEBUG_CORE is not set 636# CONFIG_I2C_DEBUG_CORE is not set
626# CONFIG_I2C_DEBUG_ALGO is not set 637# CONFIG_I2C_DEBUG_ALGO is not set
@@ -635,6 +646,7 @@ CONFIG_SPI_MASTER=y
635# 646#
636# CONFIG_SPI_BITBANG is not set 647# CONFIG_SPI_BITBANG is not set
637# CONFIG_SPI_GPIO is not set 648# CONFIG_SPI_GPIO is not set
649CONFIG_SPI_PL022=y
638 650
639# 651#
640# SPI Protocol Masters 652# SPI Protocol Masters
@@ -647,6 +659,7 @@ CONFIG_POWER_SUPPLY=y
647# CONFIG_PDA_POWER is not set 659# CONFIG_PDA_POWER is not set
648# CONFIG_BATTERY_DS2760 is not set 660# CONFIG_BATTERY_DS2760 is not set
649# CONFIG_BATTERY_BQ27x00 is not set 661# CONFIG_BATTERY_BQ27x00 is not set
662# CONFIG_BATTERY_MAX17040 is not set
650# CONFIG_HWMON is not set 663# CONFIG_HWMON is not set
651# CONFIG_THERMAL is not set 664# CONFIG_THERMAL is not set
652# CONFIG_THERMAL_HWMON is not set 665# CONFIG_THERMAL_HWMON is not set
@@ -657,6 +670,7 @@ CONFIG_WATCHDOG=y
657# Watchdog Device Drivers 670# Watchdog Device Drivers
658# 671#
659# CONFIG_SOFT_WATCHDOG is not set 672# CONFIG_SOFT_WATCHDOG is not set
673CONFIG_COH901327_WATCHDOG=y
660CONFIG_SSB_POSSIBLE=y 674CONFIG_SSB_POSSIBLE=y
661 675
662# 676#
@@ -678,22 +692,9 @@ CONFIG_SSB_POSSIBLE=y
678# CONFIG_MFD_WM8400 is not set 692# CONFIG_MFD_WM8400 is not set
679# CONFIG_MFD_WM8350_I2C is not set 693# CONFIG_MFD_WM8350_I2C is not set
680# CONFIG_MFD_PCF50633 is not set 694# CONFIG_MFD_PCF50633 is not set
681 695CONFIG_AB3100_CORE=y
682# 696# CONFIG_EZX_PCAP is not set
683# Multimedia devices 697# CONFIG_MEDIA_SUPPORT is not set
684#
685
686#
687# Multimedia core support
688#
689# CONFIG_VIDEO_DEV is not set
690# CONFIG_DVB_CORE is not set
691# CONFIG_VIDEO_MEDIA is not set
692
693#
694# Multimedia drivers
695#
696# CONFIG_DAB is not set
697 698
698# 699#
699# Graphics support 700# Graphics support
@@ -760,6 +761,11 @@ CONFIG_SND_JACK=y
760# CONFIG_SND_VERBOSE_PROCFS is not set 761# CONFIG_SND_VERBOSE_PROCFS is not set
761# CONFIG_SND_VERBOSE_PRINTK is not set 762# CONFIG_SND_VERBOSE_PRINTK is not set
762# CONFIG_SND_DEBUG is not set 763# CONFIG_SND_DEBUG is not set
764# CONFIG_SND_RAWMIDI_SEQ is not set
765# CONFIG_SND_OPL3_LIB_SEQ is not set
766# CONFIG_SND_OPL4_LIB_SEQ is not set
767# CONFIG_SND_SBAWE_SEQ is not set
768# CONFIG_SND_EMU10K1_SEQ is not set
763# CONFIG_SND_DRIVERS is not set 769# CONFIG_SND_DRIVERS is not set
764# CONFIG_SND_ARM is not set 770# CONFIG_SND_ARM is not set
765# CONFIG_SND_SPI is not set 771# CONFIG_SND_SPI is not set
@@ -770,7 +776,7 @@ CONFIG_SND_SOC_I2C_AND_SPI=y
770# CONFIG_HID_SUPPORT is not set 776# CONFIG_HID_SUPPORT is not set
771# CONFIG_USB_SUPPORT is not set 777# CONFIG_USB_SUPPORT is not set
772CONFIG_MMC=y 778CONFIG_MMC=y
773# CONFIG_MMC_DEBUG is not set 779CONFIG_MMC_DEBUG=y
774# CONFIG_MMC_UNSAFE_RESUME is not set 780# CONFIG_MMC_UNSAFE_RESUME is not set
775 781
776# 782#
@@ -797,7 +803,7 @@ CONFIG_LEDS_CLASS=y
797# 803#
798# CONFIG_LEDS_PCA9532 is not set 804# CONFIG_LEDS_PCA9532 is not set
799# CONFIG_LEDS_GPIO is not set 805# CONFIG_LEDS_GPIO is not set
800# CONFIG_LEDS_LP5521 is not set 806# CONFIG_LEDS_LP3944 is not set
801# CONFIG_LEDS_PCA955X is not set 807# CONFIG_LEDS_PCA955X is not set
802# CONFIG_LEDS_DAC124S085 is not set 808# CONFIG_LEDS_DAC124S085 is not set
803# CONFIG_LEDS_BD2802 is not set 809# CONFIG_LEDS_BD2802 is not set
@@ -845,6 +851,7 @@ CONFIG_RTC_INTF_DEV=y
845# CONFIG_RTC_DRV_S35390A is not set 851# CONFIG_RTC_DRV_S35390A is not set
846# CONFIG_RTC_DRV_FM3130 is not set 852# CONFIG_RTC_DRV_FM3130 is not set
847# CONFIG_RTC_DRV_RX8581 is not set 853# CONFIG_RTC_DRV_RX8581 is not set
854# CONFIG_RTC_DRV_RX8025 is not set
848 855
849# 856#
850# SPI RTC drivers 857# SPI RTC drivers
@@ -887,7 +894,10 @@ CONFIG_REGULATOR=y
887# CONFIG_REGULATOR_DEBUG is not set 894# CONFIG_REGULATOR_DEBUG is not set
888# CONFIG_REGULATOR_FIXED_VOLTAGE is not set 895# CONFIG_REGULATOR_FIXED_VOLTAGE is not set
889# CONFIG_REGULATOR_VIRTUAL_CONSUMER is not set 896# CONFIG_REGULATOR_VIRTUAL_CONSUMER is not set
897# CONFIG_REGULATOR_USERSPACE_CONSUMER is not set
890# CONFIG_REGULATOR_BQ24022 is not set 898# CONFIG_REGULATOR_BQ24022 is not set
899# CONFIG_REGULATOR_MAX1586 is not set
900# CONFIG_REGULATOR_LP3971 is not set
891# CONFIG_UIO is not set 901# CONFIG_UIO is not set
892# CONFIG_STAGING is not set 902# CONFIG_STAGING is not set
893 903
@@ -900,16 +910,19 @@ CONFIG_REGULATOR=y
900# CONFIG_REISERFS_FS is not set 910# CONFIG_REISERFS_FS is not set
901# CONFIG_JFS_FS is not set 911# CONFIG_JFS_FS is not set
902# CONFIG_FS_POSIX_ACL is not set 912# CONFIG_FS_POSIX_ACL is not set
903CONFIG_FILE_LOCKING=y
904# CONFIG_XFS_FS is not set 913# CONFIG_XFS_FS is not set
905# CONFIG_OCFS2_FS is not set 914# CONFIG_OCFS2_FS is not set
906# CONFIG_BTRFS_FS is not set 915# CONFIG_BTRFS_FS is not set
916CONFIG_FILE_LOCKING=y
917CONFIG_FSNOTIFY=y
907# CONFIG_DNOTIFY is not set 918# CONFIG_DNOTIFY is not set
908# CONFIG_INOTIFY is not set 919# CONFIG_INOTIFY is not set
920CONFIG_INOTIFY_USER=y
909# CONFIG_QUOTA is not set 921# CONFIG_QUOTA is not set
910# CONFIG_AUTOFS_FS is not set 922# CONFIG_AUTOFS_FS is not set
911# CONFIG_AUTOFS4_FS is not set 923# CONFIG_AUTOFS4_FS is not set
912CONFIG_FUSE_FS=y 924CONFIG_FUSE_FS=y
925# CONFIG_CUSE is not set
913 926
914# 927#
915# Caches 928# Caches
@@ -1033,6 +1046,7 @@ CONFIG_TIMER_STATS=y
1033# CONFIG_DEBUG_OBJECTS is not set 1046# CONFIG_DEBUG_OBJECTS is not set
1034# CONFIG_SLUB_DEBUG_ON is not set 1047# CONFIG_SLUB_DEBUG_ON is not set
1035# CONFIG_SLUB_STATS is not set 1048# CONFIG_SLUB_STATS is not set
1049# CONFIG_DEBUG_KMEMLEAK is not set
1036# CONFIG_DEBUG_PREEMPT is not set 1050# CONFIG_DEBUG_PREEMPT is not set
1037# CONFIG_DEBUG_RT_MUTEXES is not set 1051# CONFIG_DEBUG_RT_MUTEXES is not set
1038# CONFIG_RT_MUTEX_TESTER is not set 1052# CONFIG_RT_MUTEX_TESTER is not set
@@ -1063,18 +1077,16 @@ CONFIG_DEBUG_INFO=y
1063# CONFIG_PAGE_POISONING is not set 1077# CONFIG_PAGE_POISONING is not set
1064CONFIG_HAVE_FUNCTION_TRACER=y 1078CONFIG_HAVE_FUNCTION_TRACER=y
1065CONFIG_TRACING_SUPPORT=y 1079CONFIG_TRACING_SUPPORT=y
1066 1080CONFIG_FTRACE=y
1067#
1068# Tracers
1069#
1070# CONFIG_FUNCTION_TRACER is not set 1081# CONFIG_FUNCTION_TRACER is not set
1071# CONFIG_IRQSOFF_TRACER is not set 1082# CONFIG_IRQSOFF_TRACER is not set
1072# CONFIG_PREEMPT_TRACER is not set 1083# CONFIG_PREEMPT_TRACER is not set
1073# CONFIG_SCHED_TRACER is not set 1084# CONFIG_SCHED_TRACER is not set
1074# CONFIG_CONTEXT_SWITCH_TRACER is not set 1085# CONFIG_ENABLE_DEFAULT_TRACERS is not set
1075# CONFIG_EVENT_TRACER is not set
1076# CONFIG_BOOT_TRACER is not set 1086# CONFIG_BOOT_TRACER is not set
1077# CONFIG_TRACE_BRANCH_PROFILING is not set 1087CONFIG_BRANCH_PROFILE_NONE=y
1088# CONFIG_PROFILE_ANNOTATED_BRANCHES is not set
1089# CONFIG_PROFILE_ALL_BRANCHES is not set
1078# CONFIG_STACK_TRACER is not set 1090# CONFIG_STACK_TRACER is not set
1079# CONFIG_KMEMTRACE is not set 1091# CONFIG_KMEMTRACE is not set
1080# CONFIG_WORKQUEUE_TRACER is not set 1092# CONFIG_WORKQUEUE_TRACER is not set
diff --git a/arch/arm/include/asm/atomic.h b/arch/arm/include/asm/atomic.h
index 9e07fe507029..9ed2377fe8e5 100644
--- a/arch/arm/include/asm/atomic.h
+++ b/arch/arm/include/asm/atomic.h
@@ -159,8 +159,6 @@ static inline void atomic_clear_mask(unsigned long mask, unsigned long *addr)
159 159
160#else /* ARM_ARCH_6 */ 160#else /* ARM_ARCH_6 */
161 161
162#include <asm/system.h>
163
164#ifdef CONFIG_SMP 162#ifdef CONFIG_SMP
165#error SMP not supported on pre-ARMv6 CPUs 163#error SMP not supported on pre-ARMv6 CPUs
166#endif 164#endif
diff --git a/arch/arm/include/asm/page.h b/arch/arm/include/asm/page.h
index be962c1349c4..9c746af1bf6e 100644
--- a/arch/arm/include/asm/page.h
+++ b/arch/arm/include/asm/page.h
@@ -12,7 +12,7 @@
12 12
13/* PAGE_SHIFT determines the page size */ 13/* PAGE_SHIFT determines the page size */
14#define PAGE_SHIFT 12 14#define PAGE_SHIFT 12
15#define PAGE_SIZE (1UL << PAGE_SHIFT) 15#define PAGE_SIZE (_AC(1,UL) << PAGE_SHIFT)
16#define PAGE_MASK (~(PAGE_SIZE-1)) 16#define PAGE_MASK (~(PAGE_SIZE-1))
17 17
18#ifndef __ASSEMBLY__ 18#ifndef __ASSEMBLY__
diff --git a/arch/arm/include/asm/pgtable.h b/arch/arm/include/asm/pgtable.h
index 1cd2d6416bda..c433c6c73112 100644
--- a/arch/arm/include/asm/pgtable.h
+++ b/arch/arm/include/asm/pgtable.h
@@ -285,15 +285,6 @@ extern struct page *empty_zero_page;
285#define pte_young(pte) (pte_val(pte) & L_PTE_YOUNG) 285#define pte_young(pte) (pte_val(pte) & L_PTE_YOUNG)
286#define pte_special(pte) (0) 286#define pte_special(pte) (0)
287 287
288/*
289 * The following only works if pte_present() is not true.
290 */
291#define pte_file(pte) (pte_val(pte) & L_PTE_FILE)
292#define pte_to_pgoff(x) (pte_val(x) >> 2)
293#define pgoff_to_pte(x) __pte(((x) << 2) | L_PTE_FILE)
294
295#define PTE_FILE_MAX_BITS 30
296
297#define PTE_BIT_FUNC(fn,op) \ 288#define PTE_BIT_FUNC(fn,op) \
298static inline pte_t pte_##fn(pte_t pte) { pte_val(pte) op; return pte; } 289static inline pte_t pte_##fn(pte_t pte) { pte_val(pte) op; return pte; }
299 290
@@ -384,16 +375,50 @@ static inline pte_t pte_modify(pte_t pte, pgprot_t newprot)
384 375
385extern pgd_t swapper_pg_dir[PTRS_PER_PGD]; 376extern pgd_t swapper_pg_dir[PTRS_PER_PGD];
386 377
387/* Encode and decode a swap entry. 378/*
379 * Encode and decode a swap entry. Swap entries are stored in the Linux
380 * page tables as follows:
388 * 381 *
389 * We support up to 32GB of swap on 4k machines 382 * 3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1
383 * 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0
384 * <--------------- offset --------------------> <--- type --> 0 0
385 *
386 * This gives us up to 127 swap files and 32GB per swap file. Note that
387 * the offset field is always non-zero.
390 */ 388 */
391#define __swp_type(x) (((x).val >> 2) & 0x7f) 389#define __SWP_TYPE_SHIFT 2
392#define __swp_offset(x) ((x).val >> 9) 390#define __SWP_TYPE_BITS 7
393#define __swp_entry(type,offset) ((swp_entry_t) { ((type) << 2) | ((offset) << 9) }) 391#define __SWP_TYPE_MASK ((1 << __SWP_TYPE_BITS) - 1)
392#define __SWP_OFFSET_SHIFT (__SWP_TYPE_BITS + __SWP_TYPE_SHIFT)
393
394#define __swp_type(x) (((x).val >> __SWP_TYPE_SHIFT) & __SWP_TYPE_MASK)
395#define __swp_offset(x) ((x).val >> __SWP_OFFSET_SHIFT)
396#define __swp_entry(type,offset) ((swp_entry_t) { ((type) << __SWP_TYPE_SHIFT) | ((offset) << __SWP_OFFSET_SHIFT) })
397
394#define __pte_to_swp_entry(pte) ((swp_entry_t) { pte_val(pte) }) 398#define __pte_to_swp_entry(pte) ((swp_entry_t) { pte_val(pte) })
395#define __swp_entry_to_pte(swp) ((pte_t) { (swp).val }) 399#define __swp_entry_to_pte(swp) ((pte_t) { (swp).val })
396 400
401/*
402 * It is an error for the kernel to have more swap files than we can
403 * encode in the PTEs. This ensures that we know when MAX_SWAPFILES
404 * is increased beyond what we presently support.
405 */
406#define MAX_SWAPFILES_CHECK() BUILD_BUG_ON(MAX_SWAPFILES_SHIFT > __SWP_TYPE_BITS)
407
408/*
409 * Encode and decode a file entry. File entries are stored in the Linux
410 * page tables as follows:
411 *
412 * 3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1
413 * 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0
414 * <------------------------ offset -------------------------> 1 0
415 */
416#define pte_file(pte) (pte_val(pte) & L_PTE_FILE)
417#define pte_to_pgoff(x) (pte_val(x) >> 2)
418#define pgoff_to_pte(x) __pte(((x) << 2) | L_PTE_FILE)
419
420#define PTE_FILE_MAX_BITS 30
421
397/* Needs to be defined here and not in linux/mm.h, as it is arch dependent */ 422/* Needs to be defined here and not in linux/mm.h, as it is arch dependent */
398/* FIXME: this is not correct */ 423/* FIXME: this is not correct */
399#define kern_addr_valid(addr) (1) 424#define kern_addr_valid(addr) (1)
diff --git a/arch/arm/include/asm/thread_info.h b/arch/arm/include/asm/thread_info.h
index 4f8848260ee2..73394e50cbca 100644
--- a/arch/arm/include/asm/thread_info.h
+++ b/arch/arm/include/asm/thread_info.h
@@ -73,7 +73,7 @@ struct thread_info {
73 .task = &tsk, \ 73 .task = &tsk, \
74 .exec_domain = &default_exec_domain, \ 74 .exec_domain = &default_exec_domain, \
75 .flags = 0, \ 75 .flags = 0, \
76 .preempt_count = 1, \ 76 .preempt_count = INIT_PREEMPT_COUNT, \
77 .addr_limit = KERNEL_DS, \ 77 .addr_limit = KERNEL_DS, \
78 .cpu_domain = domain_val(DOMAIN_USER, DOMAIN_MANAGER) | \ 78 .cpu_domain = domain_val(DOMAIN_USER, DOMAIN_MANAGER) | \
79 domain_val(DOMAIN_KERNEL, DOMAIN_MANAGER) | \ 79 domain_val(DOMAIN_KERNEL, DOMAIN_MANAGER) | \
diff --git a/arch/arm/include/asm/tlb.h b/arch/arm/include/asm/tlb.h
index 321c83e43a1e..f41a6f57cd12 100644
--- a/arch/arm/include/asm/tlb.h
+++ b/arch/arm/include/asm/tlb.h
@@ -102,8 +102,8 @@ tlb_end_vma(struct mmu_gather *tlb, struct vm_area_struct *vma)
102} 102}
103 103
104#define tlb_remove_page(tlb,page) free_page_and_swap_cache(page) 104#define tlb_remove_page(tlb,page) free_page_and_swap_cache(page)
105#define pte_free_tlb(tlb, ptep) pte_free((tlb)->mm, ptep) 105#define pte_free_tlb(tlb, ptep, addr) pte_free((tlb)->mm, ptep)
106#define pmd_free_tlb(tlb, pmdp) pmd_free((tlb)->mm, pmdp) 106#define pmd_free_tlb(tlb, pmdp, addr) pmd_free((tlb)->mm, pmdp)
107 107
108#define tlb_migrate_finish(mm) do { } while (0) 108#define tlb_migrate_finish(mm) do { } while (0)
109 109
diff --git a/arch/arm/kernel/entry-common.S b/arch/arm/kernel/entry-common.S
index 366e5097a41a..8c3de1a350b5 100644
--- a/arch/arm/kernel/entry-common.S
+++ b/arch/arm/kernel/entry-common.S
@@ -148,7 +148,7 @@ trace:
148 sub r0, r0, #MCOUNT_INSN_SIZE 148 sub r0, r0, #MCOUNT_INSN_SIZE
149 mov lr, pc 149 mov lr, pc
150 mov pc, r2 150 mov pc, r2
151 mov lr, r1 @ restore lr 151 ldr lr, [fp, #-4] @ restore lr
152 ldmia sp!, {r0-r3, pc} 152 ldmia sp!, {r0-r3, pc}
153 153
154#endif /* CONFIG_DYNAMIC_FTRACE */ 154#endif /* CONFIG_DYNAMIC_FTRACE */
diff --git a/arch/arm/kernel/irq.c b/arch/arm/kernel/irq.c
index 096f600dc8d8..b7c3490eaa24 100644
--- a/arch/arm/kernel/irq.c
+++ b/arch/arm/kernel/irq.c
@@ -98,17 +98,6 @@ unlock:
98 return 0; 98 return 0;
99} 99}
100 100
101/* Handle bad interrupts */
102static struct irq_desc bad_irq_desc = {
103 .handle_irq = handle_bad_irq,
104 .lock = __SPIN_LOCK_UNLOCKED(bad_irq_desc.lock),
105};
106
107#ifdef CONFIG_CPUMASK_OFFSTACK
108/* We are not allocating bad_irq_desc.affinity or .pending_mask */
109#error "ARM architecture does not support CONFIG_CPUMASK_OFFSTACK."
110#endif
111
112/* 101/*
113 * do_IRQ handles all hardware IRQ's. Decoded IRQs should not 102 * do_IRQ handles all hardware IRQ's. Decoded IRQs should not
114 * come via this function. Instead, they should provide their 103 * come via this function. Instead, they should provide their
@@ -124,10 +113,13 @@ asmlinkage void __exception asm_do_IRQ(unsigned int irq, struct pt_regs *regs)
124 * Some hardware gives randomly wrong interrupts. Rather 113 * Some hardware gives randomly wrong interrupts. Rather
125 * than crashing, do something sensible. 114 * than crashing, do something sensible.
126 */ 115 */
127 if (irq >= NR_IRQS) 116 if (unlikely(irq >= NR_IRQS)) {
128 handle_bad_irq(irq, &bad_irq_desc); 117 if (printk_ratelimit())
129 else 118 printk(KERN_WARNING "Bad IRQ%u\n", irq);
119 ack_bad_irq(irq);
120 } else {
130 generic_handle_irq(irq); 121 generic_handle_irq(irq);
122 }
131 123
132 /* AT91 specific workaround */ 124 /* AT91 specific workaround */
133 irq_finish(irq); 125 irq_finish(irq);
@@ -165,10 +157,6 @@ void __init init_IRQ(void)
165 for (irq = 0; irq < NR_IRQS; irq++) 157 for (irq = 0; irq < NR_IRQS; irq++)
166 irq_desc[irq].status |= IRQ_NOREQUEST | IRQ_NOPROBE; 158 irq_desc[irq].status |= IRQ_NOREQUEST | IRQ_NOPROBE;
167 159
168#ifdef CONFIG_SMP
169 cpumask_setall(bad_irq_desc.affinity);
170 bad_irq_desc.node = smp_processor_id();
171#endif
172 init_arch_irq(); 160 init_arch_irq();
173} 161}
174 162
diff --git a/arch/arm/kernel/signal.c b/arch/arm/kernel/signal.c
index 93bb4247b7ed..f6bc5d442782 100644
--- a/arch/arm/kernel/signal.c
+++ b/arch/arm/kernel/signal.c
@@ -133,7 +133,7 @@ sys_sigaction(int sig, const struct old_sigaction __user *act,
133} 133}
134 134
135#ifdef CONFIG_CRUNCH 135#ifdef CONFIG_CRUNCH
136static int preserve_crunch_context(struct crunch_sigframe *frame) 136static int preserve_crunch_context(struct crunch_sigframe __user *frame)
137{ 137{
138 char kbuf[sizeof(*frame) + 8]; 138 char kbuf[sizeof(*frame) + 8];
139 struct crunch_sigframe *kframe; 139 struct crunch_sigframe *kframe;
@@ -146,7 +146,7 @@ static int preserve_crunch_context(struct crunch_sigframe *frame)
146 return __copy_to_user(frame, kframe, sizeof(*frame)); 146 return __copy_to_user(frame, kframe, sizeof(*frame));
147} 147}
148 148
149static int restore_crunch_context(struct crunch_sigframe *frame) 149static int restore_crunch_context(struct crunch_sigframe __user *frame)
150{ 150{
151 char kbuf[sizeof(*frame) + 8]; 151 char kbuf[sizeof(*frame) + 8];
152 struct crunch_sigframe *kframe; 152 struct crunch_sigframe *kframe;
diff --git a/arch/arm/kernel/vmlinux.lds.S b/arch/arm/kernel/vmlinux.lds.S
index 4340bf3d2c84..69371028a202 100644
--- a/arch/arm/kernel/vmlinux.lds.S
+++ b/arch/arm/kernel/vmlinux.lds.S
@@ -6,6 +6,7 @@
6#include <asm-generic/vmlinux.lds.h> 6#include <asm-generic/vmlinux.lds.h>
7#include <asm/thread_info.h> 7#include <asm/thread_info.h>
8#include <asm/memory.h> 8#include <asm/memory.h>
9#include <asm/page.h>
9 10
10OUTPUT_ARCH(arm) 11OUTPUT_ARCH(arm)
11ENTRY(stext) 12ENTRY(stext)
@@ -63,7 +64,7 @@ SECTIONS
63 usr/built-in.o(.init.ramfs) 64 usr/built-in.o(.init.ramfs)
64 __initramfs_end = .; 65 __initramfs_end = .;
65#endif 66#endif
66 . = ALIGN(4096); 67 . = ALIGN(PAGE_SIZE);
67 __per_cpu_load = .; 68 __per_cpu_load = .;
68 __per_cpu_start = .; 69 __per_cpu_start = .;
69 *(.data.percpu.page_aligned) 70 *(.data.percpu.page_aligned)
@@ -73,7 +74,7 @@ SECTIONS
73#ifndef CONFIG_XIP_KERNEL 74#ifndef CONFIG_XIP_KERNEL
74 __init_begin = _stext; 75 __init_begin = _stext;
75 INIT_DATA 76 INIT_DATA
76 . = ALIGN(4096); 77 . = ALIGN(PAGE_SIZE);
77 __init_end = .; 78 __init_end = .;
78#endif 79#endif
79 } 80 }
@@ -118,7 +119,7 @@ SECTIONS
118 *(.got) /* Global offset table */ 119 *(.got) /* Global offset table */
119 } 120 }
120 121
121 RODATA 122 RO_DATA(PAGE_SIZE)
122 123
123 _etext = .; /* End of text and rodata section */ 124 _etext = .; /* End of text and rodata section */
124 125
@@ -158,17 +159,17 @@ SECTIONS
158 *(.data.init_task) 159 *(.data.init_task)
159 160
160#ifdef CONFIG_XIP_KERNEL 161#ifdef CONFIG_XIP_KERNEL
161 . = ALIGN(4096); 162 . = ALIGN(PAGE_SIZE);
162 __init_begin = .; 163 __init_begin = .;
163 INIT_DATA 164 INIT_DATA
164 . = ALIGN(4096); 165 . = ALIGN(PAGE_SIZE);
165 __init_end = .; 166 __init_end = .;
166#endif 167#endif
167 168
168 . = ALIGN(4096); 169 . = ALIGN(PAGE_SIZE);
169 __nosave_begin = .; 170 __nosave_begin = .;
170 *(.data.nosave) 171 *(.data.nosave)
171 . = ALIGN(4096); 172 . = ALIGN(PAGE_SIZE);
172 __nosave_end = .; 173 __nosave_end = .;
173 174
174 /* 175 /*
diff --git a/arch/arm/mach-at91/board-sam9g20ek.c b/arch/arm/mach-at91/board-sam9g20ek.c
index cc270beadd5d..a55398ed1211 100644
--- a/arch/arm/mach-at91/board-sam9g20ek.c
+++ b/arch/arm/mach-at91/board-sam9g20ek.c
@@ -24,6 +24,8 @@
24#include <linux/platform_device.h> 24#include <linux/platform_device.h>
25#include <linux/spi/spi.h> 25#include <linux/spi/spi.h>
26#include <linux/spi/at73c213.h> 26#include <linux/spi/at73c213.h>
27#include <linux/gpio_keys.h>
28#include <linux/input.h>
27#include <linux/clk.h> 29#include <linux/clk.h>
28 30
29#include <mach/hardware.h> 31#include <mach/hardware.h>
@@ -218,6 +220,56 @@ static struct gpio_led ek_leds[] = {
218 } 220 }
219}; 221};
220 222
223
224/*
225 * GPIO Buttons
226 */
227#if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
228static struct gpio_keys_button ek_buttons[] = {
229 {
230 .gpio = AT91_PIN_PA30,
231 .code = BTN_3,
232 .desc = "Button 3",
233 .active_low = 1,
234 .wakeup = 1,
235 },
236 {
237 .gpio = AT91_PIN_PA31,
238 .code = BTN_4,
239 .desc = "Button 4",
240 .active_low = 1,
241 .wakeup = 1,
242 }
243};
244
245static struct gpio_keys_platform_data ek_button_data = {
246 .buttons = ek_buttons,
247 .nbuttons = ARRAY_SIZE(ek_buttons),
248};
249
250static struct platform_device ek_button_device = {
251 .name = "gpio-keys",
252 .id = -1,
253 .num_resources = 0,
254 .dev = {
255 .platform_data = &ek_button_data,
256 }
257};
258
259static void __init ek_add_device_buttons(void)
260{
261 at91_set_gpio_input(AT91_PIN_PA30, 1); /* btn3 */
262 at91_set_deglitch(AT91_PIN_PA30, 1);
263 at91_set_gpio_input(AT91_PIN_PA31, 1); /* btn4 */
264 at91_set_deglitch(AT91_PIN_PA31, 1);
265
266 platform_device_register(&ek_button_device);
267}
268#else
269static void __init ek_add_device_buttons(void) {}
270#endif
271
272
221static struct i2c_board_info __initdata ek_i2c_devices[] = { 273static struct i2c_board_info __initdata ek_i2c_devices[] = {
222 { 274 {
223 I2C_BOARD_INFO("24c512", 0x50), 275 I2C_BOARD_INFO("24c512", 0x50),
@@ -245,6 +297,8 @@ static void __init ek_board_init(void)
245 at91_add_device_i2c(ek_i2c_devices, ARRAY_SIZE(ek_i2c_devices)); 297 at91_add_device_i2c(ek_i2c_devices, ARRAY_SIZE(ek_i2c_devices));
246 /* LEDs */ 298 /* LEDs */
247 at91_gpio_leds(ek_leds, ARRAY_SIZE(ek_leds)); 299 at91_gpio_leds(ek_leds, ARRAY_SIZE(ek_leds));
300 /* Push Buttons */
301 ek_add_device_buttons();
248 /* PCK0 provides MCLK to the WM8731 */ 302 /* PCK0 provides MCLK to the WM8731 */
249 at91_set_B_periph(AT91_PIN_PC1, 0); 303 at91_set_B_periph(AT91_PIN_PC1, 0);
250 /* SSC (for WM8731) */ 304 /* SSC (for WM8731) */
diff --git a/arch/arm/mach-at91/board-sam9rlek.c b/arch/arm/mach-at91/board-sam9rlek.c
index 35e12a49d1a6..f6b5672cabd6 100644
--- a/arch/arm/mach-at91/board-sam9rlek.c
+++ b/arch/arm/mach-at91/board-sam9rlek.c
@@ -186,19 +186,21 @@ static struct fb_monspecs at91fb_default_monspecs = {
186static void at91_lcdc_power_control(int on) 186static void at91_lcdc_power_control(int on)
187{ 187{
188 if (on) 188 if (on)
189 at91_set_gpio_value(AT91_PIN_PA30, 0); /* power up */ 189 at91_set_gpio_value(AT91_PIN_PC1, 0); /* power up */
190 else 190 else
191 at91_set_gpio_value(AT91_PIN_PA30, 1); /* power down */ 191 at91_set_gpio_value(AT91_PIN_PC1, 1); /* power down */
192} 192}
193 193
194/* Driver datas */ 194/* Driver datas */
195static struct atmel_lcdfb_info __initdata ek_lcdc_data = { 195static struct atmel_lcdfb_info __initdata ek_lcdc_data = {
196 .lcdcon_is_backlight = true,
196 .default_bpp = 16, 197 .default_bpp = 16,
197 .default_dmacon = ATMEL_LCDC_DMAEN, 198 .default_dmacon = ATMEL_LCDC_DMAEN,
198 .default_lcdcon2 = AT91SAM9RL_DEFAULT_LCDCON2, 199 .default_lcdcon2 = AT91SAM9RL_DEFAULT_LCDCON2,
199 .default_monspecs = &at91fb_default_monspecs, 200 .default_monspecs = &at91fb_default_monspecs,
200 .atmel_lcdfb_power_control = at91_lcdc_power_control, 201 .atmel_lcdfb_power_control = at91_lcdc_power_control,
201 .guard_time = 1, 202 .guard_time = 1,
203 .lcd_wiring_mode = ATMEL_LCDC_WIRING_RGB,
202}; 204};
203 205
204#else 206#else
diff --git a/arch/arm/mach-at91/include/mach/at_hdmac.h b/arch/arm/mach-at91/include/mach/at_hdmac.h
new file mode 100644
index 000000000000..187cb58345c0
--- /dev/null
+++ b/arch/arm/mach-at91/include/mach/at_hdmac.h
@@ -0,0 +1,102 @@
1/*
2 * Header file for the Atmel AHB DMA Controller driver
3 *
4 * Copyright (C) 2008 Atmel Corporation
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 */
11#ifndef AT_HDMAC_H
12#define AT_HDMAC_H
13
14#include <linux/dmaengine.h>
15
16/**
17 * struct at_dma_platform_data - Controller configuration parameters
18 * @nr_channels: Number of channels supported by hardware (max 8)
19 * @cap_mask: dma_capability flags supported by the platform
20 */
21struct at_dma_platform_data {
22 unsigned int nr_channels;
23 dma_cap_mask_t cap_mask;
24};
25
26/**
27 * enum at_dma_slave_width - DMA slave register access width.
28 * @AT_DMA_SLAVE_WIDTH_8BIT: Do 8-bit slave register accesses
29 * @AT_DMA_SLAVE_WIDTH_16BIT: Do 16-bit slave register accesses
30 * @AT_DMA_SLAVE_WIDTH_32BIT: Do 32-bit slave register accesses
31 */
32enum at_dma_slave_width {
33 AT_DMA_SLAVE_WIDTH_8BIT = 0,
34 AT_DMA_SLAVE_WIDTH_16BIT,
35 AT_DMA_SLAVE_WIDTH_32BIT,
36};
37
38/**
39 * struct at_dma_slave - Controller-specific information about a slave
40 * @dma_dev: required DMA master device
41 * @tx_reg: physical address of data register used for
42 * memory-to-peripheral transfers
43 * @rx_reg: physical address of data register used for
44 * peripheral-to-memory transfers
45 * @reg_width: peripheral register width
46 * @cfg: Platform-specific initializer for the CFG register
47 * @ctrla: Platform-specific initializer for the CTRLA register
48 */
49struct at_dma_slave {
50 struct device *dma_dev;
51 dma_addr_t tx_reg;
52 dma_addr_t rx_reg;
53 enum at_dma_slave_width reg_width;
54 u32 cfg;
55 u32 ctrla;
56};
57
58
59/* Platform-configurable bits in CFG */
60#define ATC_SRC_PER(h) (0xFU & (h)) /* Channel src rq associated with periph handshaking ifc h */
61#define ATC_DST_PER(h) ((0xFU & (h)) << 4) /* Channel dst rq associated with periph handshaking ifc h */
62#define ATC_SRC_REP (0x1 << 8) /* Source Replay Mod */
63#define ATC_SRC_H2SEL (0x1 << 9) /* Source Handshaking Mod */
64#define ATC_SRC_H2SEL_SW (0x0 << 9)
65#define ATC_SRC_H2SEL_HW (0x1 << 9)
66#define ATC_DST_REP (0x1 << 12) /* Destination Replay Mod */
67#define ATC_DST_H2SEL (0x1 << 13) /* Destination Handshaking Mod */
68#define ATC_DST_H2SEL_SW (0x0 << 13)
69#define ATC_DST_H2SEL_HW (0x1 << 13)
70#define ATC_SOD (0x1 << 16) /* Stop On Done */
71#define ATC_LOCK_IF (0x1 << 20) /* Interface Lock */
72#define ATC_LOCK_B (0x1 << 21) /* AHB Bus Lock */
73#define ATC_LOCK_IF_L (0x1 << 22) /* Master Interface Arbiter Lock */
74#define ATC_LOCK_IF_L_CHUNK (0x0 << 22)
75#define ATC_LOCK_IF_L_BUFFER (0x1 << 22)
76#define ATC_AHB_PROT_MASK (0x7 << 24) /* AHB Protection */
77#define ATC_FIFOCFG_MASK (0x3 << 28) /* FIFO Request Configuration */
78#define ATC_FIFOCFG_LARGESTBURST (0x0 << 28)
79#define ATC_FIFOCFG_HALFFIFO (0x1 << 28)
80#define ATC_FIFOCFG_ENOUGHSPACE (0x2 << 28)
81
82/* Platform-configurable bits in CTRLA */
83#define ATC_SCSIZE_MASK (0x7 << 16) /* Source Chunk Transfer Size */
84#define ATC_SCSIZE_1 (0x0 << 16)
85#define ATC_SCSIZE_4 (0x1 << 16)
86#define ATC_SCSIZE_8 (0x2 << 16)
87#define ATC_SCSIZE_16 (0x3 << 16)
88#define ATC_SCSIZE_32 (0x4 << 16)
89#define ATC_SCSIZE_64 (0x5 << 16)
90#define ATC_SCSIZE_128 (0x6 << 16)
91#define ATC_SCSIZE_256 (0x7 << 16)
92#define ATC_DCSIZE_MASK (0x7 << 20) /* Destination Chunk Transfer Size */
93#define ATC_DCSIZE_1 (0x0 << 20)
94#define ATC_DCSIZE_4 (0x1 << 20)
95#define ATC_DCSIZE_8 (0x2 << 20)
96#define ATC_DCSIZE_16 (0x3 << 20)
97#define ATC_DCSIZE_32 (0x4 << 20)
98#define ATC_DCSIZE_64 (0x5 << 20)
99#define ATC_DCSIZE_128 (0x6 << 20)
100#define ATC_DCSIZE_256 (0x7 << 20)
101
102#endif /* AT_HDMAC_H */
diff --git a/arch/arm/mach-davinci/board-dm355-evm.c b/arch/arm/mach-davinci/board-dm355-evm.c
index 5ac2f565d860..d6ab64ccd496 100644
--- a/arch/arm/mach-davinci/board-dm355-evm.c
+++ b/arch/arm/mach-davinci/board-dm355-evm.c
@@ -37,7 +37,6 @@
37#include <mach/serial.h> 37#include <mach/serial.h>
38#include <mach/nand.h> 38#include <mach/nand.h>
39#include <mach/mmc.h> 39#include <mach/mmc.h>
40#include <mach/common.h>
41 40
42#define DAVINCI_ASYNC_EMIF_CONTROL_BASE 0x01e10000 41#define DAVINCI_ASYNC_EMIF_CONTROL_BASE 0x01e10000
43#define DAVINCI_ASYNC_EMIF_DATA_CE0_BASE 0x02000000 42#define DAVINCI_ASYNC_EMIF_DATA_CE0_BASE 0x02000000
diff --git a/arch/arm/mach-davinci/board-dm355-leopard.c b/arch/arm/mach-davinci/board-dm355-leopard.c
index 28c9008df4f4..84ad5d161a87 100644
--- a/arch/arm/mach-davinci/board-dm355-leopard.c
+++ b/arch/arm/mach-davinci/board-dm355-leopard.c
@@ -36,7 +36,6 @@
36#include <mach/serial.h> 36#include <mach/serial.h>
37#include <mach/nand.h> 37#include <mach/nand.h>
38#include <mach/mmc.h> 38#include <mach/mmc.h>
39#include <mach/common.h>
40 39
41#define DAVINCI_ASYNC_EMIF_CONTROL_BASE 0x01e10000 40#define DAVINCI_ASYNC_EMIF_CONTROL_BASE 0x01e10000
42#define DAVINCI_ASYNC_EMIF_DATA_CE0_BASE 0x02000000 41#define DAVINCI_ASYNC_EMIF_DATA_CE0_BASE 0x02000000
diff --git a/arch/arm/mach-davinci/board-dm644x-evm.c b/arch/arm/mach-davinci/board-dm644x-evm.c
index d9d40450bdc5..56c8cd01de9a 100644
--- a/arch/arm/mach-davinci/board-dm644x-evm.c
+++ b/arch/arm/mach-davinci/board-dm644x-evm.c
@@ -45,7 +45,6 @@
45#include <mach/nand.h> 45#include <mach/nand.h>
46#include <mach/mmc.h> 46#include <mach/mmc.h>
47#include <mach/emac.h> 47#include <mach/emac.h>
48#include <mach/common.h>
49 48
50#define DM644X_EVM_PHY_MASK (0x2) 49#define DM644X_EVM_PHY_MASK (0x2)
51#define DM644X_EVM_MDIO_FREQUENCY (2200000) /* PHY bus frequency */ 50#define DM644X_EVM_MDIO_FREQUENCY (2200000) /* PHY bus frequency */
diff --git a/arch/arm/mach-davinci/board-dm646x-evm.c b/arch/arm/mach-davinci/board-dm646x-evm.c
index e17de6352624..8657e72debc1 100644
--- a/arch/arm/mach-davinci/board-dm646x-evm.c
+++ b/arch/arm/mach-davinci/board-dm646x-evm.c
@@ -47,7 +47,6 @@
47#include <mach/i2c.h> 47#include <mach/i2c.h>
48#include <mach/mmc.h> 48#include <mach/mmc.h>
49#include <mach/emac.h> 49#include <mach/emac.h>
50#include <mach/common.h>
51 50
52#define DM646X_EVM_PHY_MASK (0x2) 51#define DM646X_EVM_PHY_MASK (0x2)
53#define DM646X_EVM_MDIO_FREQUENCY (2200000) /* PHY bus frequency */ 52#define DM646X_EVM_MDIO_FREQUENCY (2200000) /* PHY bus frequency */
diff --git a/arch/arm/mach-davinci/board-sffsdr.c b/arch/arm/mach-davinci/board-sffsdr.c
index 748a8e48541e..7acdfd8ac071 100644
--- a/arch/arm/mach-davinci/board-sffsdr.c
+++ b/arch/arm/mach-davinci/board-sffsdr.c
@@ -52,7 +52,6 @@
52#include <mach/serial.h> 52#include <mach/serial.h>
53#include <mach/psc.h> 53#include <mach/psc.h>
54#include <mach/mux.h> 54#include <mach/mux.h>
55#include <mach/common.h>
56 55
57#define SFFSDR_PHY_MASK (0x2) 56#define SFFSDR_PHY_MASK (0x2)
58#define SFFSDR_MDIO_FREQUENCY (2200000) /* PHY bus frequency */ 57#define SFFSDR_MDIO_FREQUENCY (2200000) /* PHY bus frequency */
diff --git a/arch/arm/mach-ep93xx/dma-m2p.c b/arch/arm/mach-ep93xx/dma-m2p.c
index a2df5bb7dff0..dbcac9c40a28 100644
--- a/arch/arm/mach-ep93xx/dma-m2p.c
+++ b/arch/arm/mach-ep93xx/dma-m2p.c
@@ -33,6 +33,7 @@
33#include <linux/err.h> 33#include <linux/err.h>
34#include <linux/interrupt.h> 34#include <linux/interrupt.h>
35#include <linux/module.h> 35#include <linux/module.h>
36#include <linux/io.h>
36 37
37#include <mach/dma.h> 38#include <mach/dma.h>
38#include <mach/hardware.h> 39#include <mach/hardware.h>
diff --git a/arch/arm/mach-ep93xx/include/mach/ts72xx.h b/arch/arm/mach-ep93xx/include/mach/ts72xx.h
index 34ddec081c40..411734422c1d 100644
--- a/arch/arm/mach-ep93xx/include/mach/ts72xx.h
+++ b/arch/arm/mach-ep93xx/include/mach/ts72xx.h
@@ -41,9 +41,6 @@
41#define TS72XX_OPTIONS2_TS9420_BOOT 0x02 41#define TS72XX_OPTIONS2_TS9420_BOOT 0x02
42 42
43 43
44#define TS72XX_NOR_PHYS_BASE 0x60000000
45#define TS72XX_NOR2_PHYS_BASE 0x62000000
46
47#define TS72XX_NAND1_DATA_PHYS_BASE 0x60000000 44#define TS72XX_NAND1_DATA_PHYS_BASE 0x60000000
48#define TS72XX_NAND2_DATA_PHYS_BASE 0x70000000 45#define TS72XX_NAND2_DATA_PHYS_BASE 0x70000000
49#define TS72XX_NAND_DATA_VIRT_BASE 0xfebfc000 46#define TS72XX_NAND_DATA_VIRT_BASE 0xfebfc000
diff --git a/arch/arm/mach-ep93xx/ts72xx.c b/arch/arm/mach-ep93xx/ts72xx.c
index 7ee024d34829..aaf1371412af 100644
--- a/arch/arm/mach-ep93xx/ts72xx.c
+++ b/arch/arm/mach-ep93xx/ts72xx.c
@@ -112,13 +112,16 @@ static void __init ts72xx_map_io(void)
112 } 112 }
113} 113}
114 114
115/*************************************************************************
116 * NOR flash (TS-7200 only)
117 *************************************************************************/
115static struct physmap_flash_data ts72xx_flash_data = { 118static struct physmap_flash_data ts72xx_flash_data = {
116 .width = 1, 119 .width = 2,
117}; 120};
118 121
119static struct resource ts72xx_flash_resource = { 122static struct resource ts72xx_flash_resource = {
120 .start = TS72XX_NOR_PHYS_BASE, 123 .start = EP93XX_CS6_PHYS_BASE,
121 .end = TS72XX_NOR_PHYS_BASE + SZ_16M - 1, 124 .end = EP93XX_CS6_PHYS_BASE + SZ_16M - 1,
122 .flags = IORESOURCE_MEM, 125 .flags = IORESOURCE_MEM,
123}; 126};
124 127
@@ -132,6 +135,12 @@ static struct platform_device ts72xx_flash = {
132 .resource = &ts72xx_flash_resource, 135 .resource = &ts72xx_flash_resource,
133}; 136};
134 137
138static void __init ts72xx_register_flash(void)
139{
140 if (board_is_ts7200())
141 platform_device_register(&ts72xx_flash);
142}
143
135static unsigned char ts72xx_rtc_readbyte(unsigned long addr) 144static unsigned char ts72xx_rtc_readbyte(unsigned long addr)
136{ 145{
137 __raw_writeb(addr, TS72XX_RTC_INDEX_VIRT_BASE); 146 __raw_writeb(addr, TS72XX_RTC_INDEX_VIRT_BASE);
@@ -165,8 +174,7 @@ static struct ep93xx_eth_data ts72xx_eth_data = {
165static void __init ts72xx_init_machine(void) 174static void __init ts72xx_init_machine(void)
166{ 175{
167 ep93xx_init_devices(); 176 ep93xx_init_devices();
168 if (board_is_ts7200()) 177 ts72xx_register_flash();
169 platform_device_register(&ts72xx_flash);
170 platform_device_register(&ts72xx_rtc_device); 178 platform_device_register(&ts72xx_rtc_device);
171 179
172 ep93xx_register_eth(&ts72xx_eth_data, 1); 180 ep93xx_register_eth(&ts72xx_eth_data, 1);
diff --git a/arch/arm/mach-kirkwood/mpp.h b/arch/arm/mach-kirkwood/mpp.h
index e021a80c2caf..bc74278ed311 100644
--- a/arch/arm/mach-kirkwood/mpp.h
+++ b/arch/arm/mach-kirkwood/mpp.h
@@ -289,7 +289,7 @@
289 289
290#define MPP48_GPIO MPP( 48, 0x0, 1, 1, 0, 0, 0, 1 ) 290#define MPP48_GPIO MPP( 48, 0x0, 1, 1, 0, 0, 0, 1 )
291#define MPP48_TSMP12 MPP( 48, 0x1, 1, 1, 0, 0, 0, 1 ) 291#define MPP48_TSMP12 MPP( 48, 0x1, 1, 1, 0, 0, 0, 1 )
292#define MPP48_TDM_DTX MPP( 48. 0x2, 0, 1, 0, 0, 0, 1 ) 292#define MPP48_TDM_DTX MPP( 48, 0x2, 0, 1, 0, 0, 0, 1 )
293 293
294#define MPP49_GPIO MPP( 49, 0x0, 1, 1, 0, 0, 0, 1 ) 294#define MPP49_GPIO MPP( 49, 0x0, 1, 1, 0, 0, 0, 1 )
295#define MPP49_TSMP9 MPP( 49, 0x1, 1, 1, 0, 0, 0, 1 ) 295#define MPP49_TSMP9 MPP( 49, 0x1, 1, 1, 0, 0, 0, 1 )
diff --git a/arch/arm/mach-ks8695/include/mach/hardware.h b/arch/arm/mach-ks8695/include/mach/hardware.h
index 1d640d075b7e..e0f911d9e021 100644
--- a/arch/arm/mach-ks8695/include/mach/hardware.h
+++ b/arch/arm/mach-ks8695/include/mach/hardware.h
@@ -17,6 +17,11 @@
17#include <asm/sizes.h> 17#include <asm/sizes.h>
18 18
19/* 19/*
20 * Clocks are derived from MCLK, which is 25Mhz
21 */
22#define KS8695_CLOCK_RATE 25000000
23
24/*
20 * Physical RAM address. 25 * Physical RAM address.
21 */ 26 */
22#define KS8695_SDRAM_PA 0x00000000 27#define KS8695_SDRAM_PA 0x00000000
diff --git a/arch/arm/mach-ks8695/include/mach/timex.h b/arch/arm/mach-ks8695/include/mach/timex.h
index 4682e350369b..10f716371bd3 100644
--- a/arch/arm/mach-ks8695/include/mach/timex.h
+++ b/arch/arm/mach-ks8695/include/mach/timex.h
@@ -14,7 +14,8 @@
14#ifndef __ASM_ARCH_TIMEX_H 14#ifndef __ASM_ARCH_TIMEX_H
15#define __ASM_ARCH_TIMEX_H 15#define __ASM_ARCH_TIMEX_H
16 16
17/* timers are derived from MCLK, which is 25MHz */ 17#include <mach/hardware.h>
18#define CLOCK_TICK_RATE 25000000 18
19#define CLOCK_TICK_RATE KS8695_CLOCK_RATE
19 20
20#endif 21#endif
diff --git a/arch/arm/mach-ks8695/pci.c b/arch/arm/mach-ks8695/pci.c
index f5ebcc0fcab9..78499667eb7b 100644
--- a/arch/arm/mach-ks8695/pci.c
+++ b/arch/arm/mach-ks8695/pci.c
@@ -245,6 +245,9 @@ static int ks8695_pci_fault(unsigned long addr, unsigned int fsr, struct pt_regs
245 245
246static void __init ks8695_pci_preinit(void) 246static void __init ks8695_pci_preinit(void)
247{ 247{
248 /* make software reset to avoid freeze if PCI bus was messed up */
249 __raw_writel(0x80000000, KS8695_PCI_VA + KS8695_PBCS);
250
248 /* stage 1 initialization, subid, subdevice = 0x0001 */ 251 /* stage 1 initialization, subid, subdevice = 0x0001 */
249 __raw_writel(0x00010001, KS8695_PCI_VA + KS8695_CRCSID); 252 __raw_writel(0x00010001, KS8695_PCI_VA + KS8695_CRCSID);
250 253
diff --git a/arch/arm/mach-mx3/Kconfig b/arch/arm/mach-mx3/Kconfig
index 17a21a291e2f..851f2458bf65 100644
--- a/arch/arm/mach-mx3/Kconfig
+++ b/arch/arm/mach-mx3/Kconfig
@@ -36,6 +36,14 @@ config MACH_PCM037
36 Include support for Phytec pcm037 platform. This includes 36 Include support for Phytec pcm037 platform. This includes
37 specific configurations for the board and its peripherals. 37 specific configurations for the board and its peripherals.
38 38
39config MACH_PCM037_EET
40 bool "Support pcm037 EET board extensions"
41 depends on MACH_PCM037
42 help
43 Add support for PCM037 EET baseboard extensions. If you are using the
44 OLED display with EET, use "video=mx3fb:CMEL-OLED" kernel
45 command-line parameter.
46
39config MACH_MX31LITE 47config MACH_MX31LITE
40 bool "Support MX31 LITEKIT (LogicPD)" 48 bool "Support MX31 LITEKIT (LogicPD)"
41 select ARCH_MX31 49 select ARCH_MX31
diff --git a/arch/arm/mach-mx3/Makefile b/arch/arm/mach-mx3/Makefile
index 0322696bd11a..6b9775471be6 100644
--- a/arch/arm/mach-mx3/Makefile
+++ b/arch/arm/mach-mx3/Makefile
@@ -11,6 +11,7 @@ obj-$(CONFIG_MACH_MX31ADS) += mx31ads.o
11obj-$(CONFIG_MACH_MX31LILLY) += mx31lilly.o mx31lilly-db.o 11obj-$(CONFIG_MACH_MX31LILLY) += mx31lilly.o mx31lilly-db.o
12obj-$(CONFIG_MACH_MX31LITE) += mx31lite.o 12obj-$(CONFIG_MACH_MX31LITE) += mx31lite.o
13obj-$(CONFIG_MACH_PCM037) += pcm037.o 13obj-$(CONFIG_MACH_PCM037) += pcm037.o
14obj-$(CONFIG_MACH_PCM037_EET) += pcm037_eet.o
14obj-$(CONFIG_MACH_MX31_3DS) += mx31pdk.o 15obj-$(CONFIG_MACH_MX31_3DS) += mx31pdk.o
15obj-$(CONFIG_MACH_MX31MOBOARD) += mx31moboard.o mx31moboard-devboard.o \ 16obj-$(CONFIG_MACH_MX31MOBOARD) += mx31moboard.o mx31moboard-devboard.o \
16 mx31moboard-marxbot.o 17 mx31moboard-marxbot.o
diff --git a/arch/arm/mach-mx3/armadillo5x0.c b/arch/arm/mach-mx3/armadillo5x0.c
index 541181090b37..ee331fd6b1bd 100644
--- a/arch/arm/mach-mx3/armadillo5x0.c
+++ b/arch/arm/mach-mx3/armadillo5x0.c
@@ -31,6 +31,8 @@
31#include <linux/smsc911x.h> 31#include <linux/smsc911x.h>
32#include <linux/interrupt.h> 32#include <linux/interrupt.h>
33#include <linux/irq.h> 33#include <linux/irq.h>
34#include <linux/mtd/physmap.h>
35#include <linux/io.h>
34 36
35#include <mach/hardware.h> 37#include <mach/hardware.h>
36#include <asm/mach-types.h> 38#include <asm/mach-types.h>
@@ -46,8 +48,10 @@
46#include <mach/mmc.h> 48#include <mach/mmc.h>
47#include <mach/ipu.h> 49#include <mach/ipu.h>
48#include <mach/mx3fb.h> 50#include <mach/mx3fb.h>
51#include <mach/mxc_nand.h>
49 52
50#include "devices.h" 53#include "devices.h"
54#include "crm_regs.h"
51 55
52static int armadillo5x0_pins[] = { 56static int armadillo5x0_pins[] = {
53 /* UART1 */ 57 /* UART1 */
@@ -93,7 +97,56 @@ static int armadillo5x0_pins[] = {
93 MX31_PIN_FPSHIFT__FPSHIFT, 97 MX31_PIN_FPSHIFT__FPSHIFT,
94 MX31_PIN_DRDY0__DRDY0, 98 MX31_PIN_DRDY0__DRDY0,
95 IOMUX_MODE(MX31_PIN_LCS1, IOMUX_CONFIG_GPIO), /*ADV7125_PSAVE*/ 99 IOMUX_MODE(MX31_PIN_LCS1, IOMUX_CONFIG_GPIO), /*ADV7125_PSAVE*/
100};
96 101
102/*
103 * NAND Flash
104 */
105static struct mxc_nand_platform_data armadillo5x0_nand_flash_pdata = {
106 .width = 1,
107 .hw_ecc = 1,
108};
109
110/*
111 * MTD NOR Flash
112 */
113static struct mtd_partition armadillo5x0_nor_flash_partitions[] = {
114 {
115 .name = "nor.bootloader",
116 .offset = 0x00000000,
117 .size = 4*32*1024,
118 }, {
119 .name = "nor.kernel",
120 .offset = MTDPART_OFS_APPEND,
121 .size = 16*128*1024,
122 }, {
123 .name = "nor.userland",
124 .offset = MTDPART_OFS_APPEND,
125 .size = 110*128*1024,
126 }, {
127 .name = "nor.config",
128 .offset = MTDPART_OFS_APPEND,
129 .size = 1*128*1024,
130 },
131};
132
133static struct physmap_flash_data armadillo5x0_nor_flash_pdata = {
134 .width = 2,
135 .parts = armadillo5x0_nor_flash_partitions,
136 .nr_parts = ARRAY_SIZE(armadillo5x0_nor_flash_partitions),
137};
138
139static struct resource armadillo5x0_nor_flash_resource = {
140 .flags = IORESOURCE_MEM,
141 .start = CS0_BASE_ADDR,
142 .end = CS0_BASE_ADDR + SZ_64M - 1,
143};
144
145static struct platform_device armadillo5x0_nor_flash = {
146 .name = "physmap-flash",
147 .id = -1,
148 .num_resources = 1,
149 .resource = &armadillo5x0_nor_flash_resource,
97}; 150};
98 151
99/* 152/*
@@ -272,6 +325,16 @@ static void __init armadillo5x0_init(void)
272 /* Register FB */ 325 /* Register FB */
273 mxc_register_device(&mx3_ipu, &mx3_ipu_data); 326 mxc_register_device(&mx3_ipu, &mx3_ipu_data);
274 mxc_register_device(&mx3_fb, &mx3fb_pdata); 327 mxc_register_device(&mx3_fb, &mx3fb_pdata);
328
329 /* Register NOR Flash */
330 mxc_register_device(&armadillo5x0_nor_flash,
331 &armadillo5x0_nor_flash_pdata);
332
333 /* Register NAND Flash */
334 mxc_register_device(&mxc_nand_device, &armadillo5x0_nand_flash_pdata);
335
336 /* set NAND page size to 2k if not configured via boot mode pins */
337 __raw_writel(__raw_readl(MXC_CCM_RCSR) | (1 << 30), MXC_CCM_RCSR);
275} 338}
276 339
277static void __init armadillo5x0_timer_init(void) 340static void __init armadillo5x0_timer_init(void)
diff --git a/arch/arm/mach-mx3/devices.c b/arch/arm/mach-mx3/devices.c
index d927eddcad46..9e87e08fb121 100644
--- a/arch/arm/mach-mx3/devices.c
+++ b/arch/arm/mach-mx3/devices.c
@@ -22,7 +22,6 @@
22#include <linux/platform_device.h> 22#include <linux/platform_device.h>
23#include <linux/serial.h> 23#include <linux/serial.h>
24#include <linux/gpio.h> 24#include <linux/gpio.h>
25#include <linux/dma-mapping.h>
26#include <mach/hardware.h> 25#include <mach/hardware.h>
27#include <mach/irqs.h> 26#include <mach/irqs.h>
28#include <mach/common.h> 27#include <mach/common.h>
diff --git a/arch/arm/mach-mx3/pcm037.c b/arch/arm/mach-mx3/pcm037.c
index c6f61a1f06c8..840cfda341d0 100644
--- a/arch/arm/mach-mx3/pcm037.c
+++ b/arch/arm/mach-mx3/pcm037.c
@@ -18,7 +18,7 @@
18 18
19#include <linux/types.h> 19#include <linux/types.h>
20#include <linux/init.h> 20#include <linux/init.h>
21 21#include <linux/dma-mapping.h>
22#include <linux/platform_device.h> 22#include <linux/platform_device.h>
23#include <linux/mtd/physmap.h> 23#include <linux/mtd/physmap.h>
24#include <linux/mtd/plat-ram.h> 24#include <linux/mtd/plat-ram.h>
@@ -33,29 +33,67 @@
33#include <linux/irq.h> 33#include <linux/irq.h>
34#include <linux/fsl_devices.h> 34#include <linux/fsl_devices.h>
35 35
36#include <mach/hardware.h> 36#include <media/soc_camera.h>
37
37#include <asm/mach-types.h> 38#include <asm/mach-types.h>
38#include <asm/mach/arch.h> 39#include <asm/mach/arch.h>
39#include <asm/mach/time.h> 40#include <asm/mach/time.h>
40#include <asm/mach/map.h> 41#include <asm/mach/map.h>
42#include <mach/board-pcm037.h>
41#include <mach/common.h> 43#include <mach/common.h>
44#include <mach/hardware.h>
45#include <mach/i2c.h>
42#include <mach/imx-uart.h> 46#include <mach/imx-uart.h>
43#include <mach/iomux-mx3.h> 47#include <mach/iomux-mx3.h>
44#include <mach/ipu.h> 48#include <mach/ipu.h>
45#include <mach/board-pcm037.h> 49#include <mach/mmc.h>
50#include <mach/mx3_camera.h>
46#include <mach/mx3fb.h> 51#include <mach/mx3fb.h>
47#include <mach/mxc_nand.h> 52#include <mach/mxc_nand.h>
48#include <mach/mmc.h>
49#ifdef CONFIG_I2C_IMX
50#include <mach/i2c.h>
51#endif
52 53
53#include "devices.h" 54#include "devices.h"
55#include "pcm037.h"
56
57static enum pcm037_board_variant pcm037_instance = PCM037_PCM970;
58
59static int __init pcm037_variant_setup(char *str)
60{
61 if (!strcmp("eet", str))
62 pcm037_instance = PCM037_EET;
63 else if (strcmp("pcm970", str))
64 pr_warning("Unknown pcm037 baseboard variant %s\n", str);
65
66 return 1;
67}
68
69/* Supported values: "pcm970" (default) and "eet" */
70__setup("pcm037_variant=", pcm037_variant_setup);
71
72enum pcm037_board_variant pcm037_variant(void)
73{
74 return pcm037_instance;
75}
76
77/* UART1 with RTS/CTS handshake signals */
78static unsigned int pcm037_uart1_handshake_pins[] = {
79 MX31_PIN_CTS1__CTS1,
80 MX31_PIN_RTS1__RTS1,
81 MX31_PIN_TXD1__TXD1,
82 MX31_PIN_RXD1__RXD1,
83};
84
85/* UART1 without RTS/CTS handshake signals */
86static unsigned int pcm037_uart1_pins[] = {
87 MX31_PIN_TXD1__TXD1,
88 MX31_PIN_RXD1__RXD1,
89};
54 90
55static unsigned int pcm037_pins[] = { 91static unsigned int pcm037_pins[] = {
56 /* I2C */ 92 /* I2C */
57 MX31_PIN_CSPI2_MOSI__SCL, 93 MX31_PIN_CSPI2_MOSI__SCL,
58 MX31_PIN_CSPI2_MISO__SDA, 94 MX31_PIN_CSPI2_MISO__SDA,
95 MX31_PIN_CSPI2_SS2__I2C3_SDA,
96 MX31_PIN_CSPI2_SCLK__I2C3_SCL,
59 /* SDHC1 */ 97 /* SDHC1 */
60 MX31_PIN_SD1_DATA3__SD1_DATA3, 98 MX31_PIN_SD1_DATA3__SD1_DATA3,
61 MX31_PIN_SD1_DATA2__SD1_DATA2, 99 MX31_PIN_SD1_DATA2__SD1_DATA2,
@@ -73,11 +111,6 @@ static unsigned int pcm037_pins[] = {
73 MX31_PIN_CSPI1_SS0__SS0, 111 MX31_PIN_CSPI1_SS0__SS0,
74 MX31_PIN_CSPI1_SS1__SS1, 112 MX31_PIN_CSPI1_SS1__SS1,
75 MX31_PIN_CSPI1_SS2__SS2, 113 MX31_PIN_CSPI1_SS2__SS2,
76 /* UART1 */
77 MX31_PIN_CTS1__CTS1,
78 MX31_PIN_RTS1__RTS1,
79 MX31_PIN_TXD1__TXD1,
80 MX31_PIN_RXD1__RXD1,
81 /* UART2 */ 114 /* UART2 */
82 MX31_PIN_TXD2__TXD2, 115 MX31_PIN_TXD2__TXD2,
83 MX31_PIN_RXD2__RXD2, 116 MX31_PIN_RXD2__RXD2,
@@ -120,6 +153,22 @@ static unsigned int pcm037_pins[] = {
120 MX31_PIN_D3_SPL__D3_SPL, 153 MX31_PIN_D3_SPL__D3_SPL,
121 MX31_PIN_D3_CLS__D3_CLS, 154 MX31_PIN_D3_CLS__D3_CLS,
122 MX31_PIN_LCS0__GPI03_23, 155 MX31_PIN_LCS0__GPI03_23,
156 /* CSI */
157 IOMUX_MODE(MX31_PIN_CSI_D5, IOMUX_CONFIG_GPIO),
158 MX31_PIN_CSI_D6__CSI_D6,
159 MX31_PIN_CSI_D7__CSI_D7,
160 MX31_PIN_CSI_D8__CSI_D8,
161 MX31_PIN_CSI_D9__CSI_D9,
162 MX31_PIN_CSI_D10__CSI_D10,
163 MX31_PIN_CSI_D11__CSI_D11,
164 MX31_PIN_CSI_D12__CSI_D12,
165 MX31_PIN_CSI_D13__CSI_D13,
166 MX31_PIN_CSI_D14__CSI_D14,
167 MX31_PIN_CSI_D15__CSI_D15,
168 MX31_PIN_CSI_HSYNC__CSI_HSYNC,
169 MX31_PIN_CSI_MCLK__CSI_MCLK,
170 MX31_PIN_CSI_PIXCLK__CSI_PIXCLK,
171 MX31_PIN_CSI_VSYNC__CSI_VSYNC,
123}; 172};
124 173
125static struct physmap_flash_data pcm037_flash_data = { 174static struct physmap_flash_data pcm037_flash_data = {
@@ -250,19 +299,43 @@ static struct mxc_nand_platform_data pcm037_nand_board_info = {
250 .hw_ecc = 1, 299 .hw_ecc = 1,
251}; 300};
252 301
253#ifdef CONFIG_I2C_IMX
254static struct imxi2c_platform_data pcm037_i2c_1_data = { 302static struct imxi2c_platform_data pcm037_i2c_1_data = {
255 .bitrate = 100000, 303 .bitrate = 100000,
256}; 304};
257 305
306static struct imxi2c_platform_data pcm037_i2c_2_data = {
307 .bitrate = 20000,
308};
309
258static struct at24_platform_data board_eeprom = { 310static struct at24_platform_data board_eeprom = {
259 .byte_len = 4096, 311 .byte_len = 4096,
260 .page_size = 32, 312 .page_size = 32,
261 .flags = AT24_FLAG_ADDR16, 313 .flags = AT24_FLAG_ADDR16,
262}; 314};
263 315
316static int pcm037_camera_power(struct device *dev, int on)
317{
318 /* disable or enable the camera in X7 or X8 PCM970 connector */
319 gpio_set_value(IOMUX_TO_GPIO(MX31_PIN_CSI_D5), !on);
320 return 0;
321}
322
323static struct i2c_board_info pcm037_i2c_2_devices[] = {
324 {
325 I2C_BOARD_INFO("mt9t031", 0x5d),
326 },
327};
328
329static struct soc_camera_link iclink = {
330 .bus_id = 0, /* Must match with the camera ID */
331 .power = pcm037_camera_power,
332 .board_info = &pcm037_i2c_2_devices[0],
333 .i2c_adapter_id = 2,
334 .module_name = "mt9t031",
335};
336
264static struct i2c_board_info pcm037_i2c_devices[] = { 337static struct i2c_board_info pcm037_i2c_devices[] = {
265 { 338 {
266 I2C_BOARD_INFO("at24", 0x52), /* E0=0, E1=1, E2=0 */ 339 I2C_BOARD_INFO("at24", 0x52), /* E0=0, E1=1, E2=0 */
267 .platform_data = &board_eeprom, 340 .platform_data = &board_eeprom,
268 }, { 341 }, {
@@ -270,7 +343,14 @@ static struct i2c_board_info pcm037_i2c_devices[] = {
270 .type = "pcf8563", 343 .type = "pcf8563",
271 } 344 }
272}; 345};
273#endif 346
347static struct platform_device pcm037_camera = {
348 .name = "soc-camera-pdrv",
349 .id = 0,
350 .dev = {
351 .platform_data = &iclink,
352 },
353};
274 354
275/* Not connected by default */ 355/* Not connected by default */
276#ifdef PCM970_SDHC_RW_SWITCH 356#ifdef PCM970_SDHC_RW_SWITCH
@@ -334,9 +414,41 @@ static struct imxmmc_platform_data sdhc_pdata = {
334 .exit = pcm970_sdhc1_exit, 414 .exit = pcm970_sdhc1_exit,
335}; 415};
336 416
417struct mx3_camera_pdata camera_pdata = {
418 .dma_dev = &mx3_ipu.dev,
419 .flags = MX3_CAMERA_DATAWIDTH_8 | MX3_CAMERA_DATAWIDTH_10,
420 .mclk_10khz = 2000,
421};
422
423static int __init pcm037_camera_alloc_dma(const size_t buf_size)
424{
425 dma_addr_t dma_handle;
426 void *buf;
427 int dma;
428
429 if (buf_size < 2 * 1024 * 1024)
430 return -EINVAL;
431
432 buf = dma_alloc_coherent(NULL, buf_size, &dma_handle, GFP_KERNEL);
433 if (!buf) {
434 pr_err("%s: cannot allocate camera buffer-memory\n", __func__);
435 return -ENOMEM;
436 }
437
438 memset(buf, 0, buf_size);
439
440 dma = dma_declare_coherent_memory(&mx3_camera.dev,
441 dma_handle, dma_handle, buf_size,
442 DMA_MEMORY_MAP | DMA_MEMORY_EXCLUSIVE);
443
444 /* The way we call dma_declare_coherent_memory only a malloc can fail */
445 return dma & DMA_MEMORY_MAP ? 0 : -ENOMEM;
446}
447
337static struct platform_device *devices[] __initdata = { 448static struct platform_device *devices[] __initdata = {
338 &pcm037_flash, 449 &pcm037_flash,
339 &pcm037_sram_device, 450 &pcm037_sram_device,
451 &pcm037_camera,
340}; 452};
341 453
342static struct ipu_platform_data mx3_ipu_data = { 454static struct ipu_platform_data mx3_ipu_data = {
@@ -377,6 +489,22 @@ static const struct fb_videomode fb_modedb[] = {
377 .sync = FB_SYNC_VERT_HIGH_ACT | FB_SYNC_OE_ACT_HIGH, 489 .sync = FB_SYNC_VERT_HIGH_ACT | FB_SYNC_OE_ACT_HIGH,
378 .vmode = FB_VMODE_NONINTERLACED, 490 .vmode = FB_VMODE_NONINTERLACED,
379 .flag = 0, 491 .flag = 0,
492 }, {
493 /* 240x320 @ 60 Hz */
494 .name = "CMEL-OLED",
495 .refresh = 60,
496 .xres = 240,
497 .yres = 320,
498 .pixclock = 185925,
499 .left_margin = 9,
500 .right_margin = 16,
501 .upper_margin = 7,
502 .lower_margin = 9,
503 .hsync_len = 1,
504 .vsync_len = 1,
505 .sync = FB_SYNC_OE_ACT_HIGH | FB_SYNC_CLK_INVERT,
506 .vmode = FB_VMODE_NONINTERLACED,
507 .flag = 0,
380 }, 508 },
381}; 509};
382 510
@@ -397,6 +525,14 @@ static void __init mxc_board_init(void)
397 mxc_iomux_setup_multiple_pins(pcm037_pins, ARRAY_SIZE(pcm037_pins), 525 mxc_iomux_setup_multiple_pins(pcm037_pins, ARRAY_SIZE(pcm037_pins),
398 "pcm037"); 526 "pcm037");
399 527
528 if (pcm037_variant() == PCM037_EET)
529 mxc_iomux_setup_multiple_pins(pcm037_uart1_pins,
530 ARRAY_SIZE(pcm037_uart1_pins), "pcm037_uart1");
531 else
532 mxc_iomux_setup_multiple_pins(pcm037_uart1_handshake_pins,
533 ARRAY_SIZE(pcm037_uart1_handshake_pins),
534 "pcm037_uart1");
535
400 platform_add_devices(devices, ARRAY_SIZE(devices)); 536 platform_add_devices(devices, ARRAY_SIZE(devices));
401 537
402 mxc_register_device(&mxc_uart_device0, &uart_pdata); 538 mxc_register_device(&mxc_uart_device0, &uart_pdata);
@@ -415,18 +551,30 @@ static void __init mxc_board_init(void)
415 } 551 }
416 552
417 553
418#ifdef CONFIG_I2C_IMX 554 /* I2C adapters and devices */
419 i2c_register_board_info(1, pcm037_i2c_devices, 555 i2c_register_board_info(1, pcm037_i2c_devices,
420 ARRAY_SIZE(pcm037_i2c_devices)); 556 ARRAY_SIZE(pcm037_i2c_devices));
421 557
422 mxc_register_device(&mxc_i2c_device1, &pcm037_i2c_1_data); 558 mxc_register_device(&mxc_i2c_device1, &pcm037_i2c_1_data);
423#endif 559 mxc_register_device(&mxc_i2c_device2, &pcm037_i2c_2_data);
560
424 mxc_register_device(&mxc_nand_device, &pcm037_nand_board_info); 561 mxc_register_device(&mxc_nand_device, &pcm037_nand_board_info);
425 mxc_register_device(&mxcsdhc_device0, &sdhc_pdata); 562 mxc_register_device(&mxcsdhc_device0, &sdhc_pdata);
426 mxc_register_device(&mx3_ipu, &mx3_ipu_data); 563 mxc_register_device(&mx3_ipu, &mx3_ipu_data);
427 mxc_register_device(&mx3_fb, &mx3fb_pdata); 564 mxc_register_device(&mx3_fb, &mx3fb_pdata);
428 if (!gpio_usbotg_hs_activate()) 565 if (!gpio_usbotg_hs_activate())
429 mxc_register_device(&mxc_otg_udc_device, &usb_pdata); 566 mxc_register_device(&mxc_otg_udc_device, &usb_pdata);
567
568 /* CSI */
569 /* Camera power: default - off */
570 ret = gpio_request(IOMUX_TO_GPIO(MX31_PIN_CSI_D5), "mt9t031-power");
571 if (!ret)
572 gpio_direction_output(IOMUX_TO_GPIO(MX31_PIN_CSI_D5), 1);
573 else
574 iclink.power = NULL;
575
576 if (!pcm037_camera_alloc_dma(4 * 1024 * 1024))
577 mxc_register_device(&mx3_camera, &camera_pdata);
430} 578}
431 579
432static void __init pcm037_timer_init(void) 580static void __init pcm037_timer_init(void)
@@ -448,4 +596,3 @@ MACHINE_START(PCM037, "Phytec Phycore pcm037")
448 .init_machine = mxc_board_init, 596 .init_machine = mxc_board_init,
449 .timer = &pcm037_timer, 597 .timer = &pcm037_timer,
450MACHINE_END 598MACHINE_END
451
diff --git a/arch/arm/mach-mx3/pcm037.h b/arch/arm/mach-mx3/pcm037.h
new file mode 100644
index 000000000000..d6929721a5fd
--- /dev/null
+++ b/arch/arm/mach-mx3/pcm037.h
@@ -0,0 +1,11 @@
1#ifndef __PCM037_H__
2#define __PCM037_H__
3
4enum pcm037_board_variant {
5 PCM037_PCM970,
6 PCM037_EET,
7};
8
9extern enum pcm037_board_variant pcm037_variant(void);
10
11#endif
diff --git a/arch/arm/mach-mx3/pcm037_eet.c b/arch/arm/mach-mx3/pcm037_eet.c
new file mode 100644
index 000000000000..fe52fb1bb8b7
--- /dev/null
+++ b/arch/arm/mach-mx3/pcm037_eet.c
@@ -0,0 +1,204 @@
1/*
2 * Copyright (C) 2009
3 * Guennadi Liakhovetski, DENX Software Engineering, <lg@denx.de>
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation.
8 */
9#include <linux/gpio.h>
10#include <linux/gpio_keys.h>
11#include <linux/input.h>
12#include <linux/platform_device.h>
13#include <linux/spi/spi.h>
14
15#include <mach/common.h>
16#if defined(CONFIG_SPI_IMX) || defined(CONFIG_SPI_IMX_MODULE)
17#include <mach/spi.h>
18#endif
19#include <mach/iomux-mx3.h>
20
21#include <asm/mach-types.h>
22
23#include "pcm037.h"
24#include "devices.h"
25
26static unsigned int pcm037_eet_pins[] = {
27 /* SPI #1 */
28 MX31_PIN_CSPI1_MISO__MISO,
29 MX31_PIN_CSPI1_MOSI__MOSI,
30 MX31_PIN_CSPI1_SCLK__SCLK,
31 MX31_PIN_CSPI1_SPI_RDY__SPI_RDY,
32 MX31_PIN_CSPI1_SS0__SS0,
33 MX31_PIN_CSPI1_SS1__SS1,
34 MX31_PIN_CSPI1_SS2__SS2,
35
36 /* Reserve and hardwire GPIO 57 high - S6E63D6 chipselect */
37 IOMUX_MODE(MX31_PIN_KEY_COL7, IOMUX_CONFIG_GPIO),
38 /* GPIO keys */
39 IOMUX_MODE(MX31_PIN_GPIO1_0, IOMUX_CONFIG_GPIO), /* 0 */
40 IOMUX_MODE(MX31_PIN_GPIO1_1, IOMUX_CONFIG_GPIO), /* 1 */
41 IOMUX_MODE(MX31_PIN_GPIO1_2, IOMUX_CONFIG_GPIO), /* 2 */
42 IOMUX_MODE(MX31_PIN_GPIO1_3, IOMUX_CONFIG_GPIO), /* 3 */
43 IOMUX_MODE(MX31_PIN_SVEN0, IOMUX_CONFIG_GPIO), /* 32 */
44 IOMUX_MODE(MX31_PIN_STX0, IOMUX_CONFIG_GPIO), /* 33 */
45 IOMUX_MODE(MX31_PIN_SRX0, IOMUX_CONFIG_GPIO), /* 34 */
46 IOMUX_MODE(MX31_PIN_SIMPD0, IOMUX_CONFIG_GPIO), /* 35 */
47 IOMUX_MODE(MX31_PIN_RTS1, IOMUX_CONFIG_GPIO), /* 38 */
48 IOMUX_MODE(MX31_PIN_CTS1, IOMUX_CONFIG_GPIO), /* 39 */
49 IOMUX_MODE(MX31_PIN_KEY_ROW4, IOMUX_CONFIG_GPIO), /* 50 */
50 IOMUX_MODE(MX31_PIN_KEY_ROW5, IOMUX_CONFIG_GPIO), /* 51 */
51 IOMUX_MODE(MX31_PIN_KEY_ROW6, IOMUX_CONFIG_GPIO), /* 52 */
52 IOMUX_MODE(MX31_PIN_KEY_ROW7, IOMUX_CONFIG_GPIO), /* 53 */
53
54 /* LEDs */
55 IOMUX_MODE(MX31_PIN_DTR_DTE1, IOMUX_CONFIG_GPIO), /* 44 */
56 IOMUX_MODE(MX31_PIN_DSR_DTE1, IOMUX_CONFIG_GPIO), /* 45 */
57 IOMUX_MODE(MX31_PIN_KEY_COL5, IOMUX_CONFIG_GPIO), /* 55 */
58 IOMUX_MODE(MX31_PIN_KEY_COL6, IOMUX_CONFIG_GPIO), /* 56 */
59};
60
61/* SPI */
62static struct spi_board_info pcm037_spi_dev[] = {
63 {
64 .modalias = "dac124s085",
65 .max_speed_hz = 400000,
66 .bus_num = 0,
67 .chip_select = 0, /* Index in pcm037_spi1_cs[] */
68 .mode = SPI_CPHA,
69 },
70};
71
72/* Platform Data for MXC CSPI */
73#if defined(CONFIG_SPI_IMX) || defined(CONFIG_SPI_IMX_MODULE)
74static int pcm037_spi1_cs[] = {MXC_SPI_CS(1), IOMUX_TO_GPIO(MX31_PIN_KEY_COL7)};
75
76struct spi_imx_master pcm037_spi1_master = {
77 .chipselect = pcm037_spi1_cs,
78 .num_chipselect = ARRAY_SIZE(pcm037_spi1_cs),
79};
80#endif
81
82/* GPIO-keys input device */
83static struct gpio_keys_button pcm037_gpio_keys[] = {
84 {
85 .type = EV_KEY,
86 .code = KEY_L,
87 .gpio = 0,
88 .desc = "Wheel Manual",
89 .wakeup = 0,
90 }, {
91 .type = EV_KEY,
92 .code = KEY_A,
93 .gpio = 1,
94 .desc = "Wheel AF",
95 .wakeup = 0,
96 }, {
97 .type = EV_KEY,
98 .code = KEY_V,
99 .gpio = 2,
100 .desc = "Wheel View",
101 .wakeup = 0,
102 }, {
103 .type = EV_KEY,
104 .code = KEY_M,
105 .gpio = 3,
106 .desc = "Wheel Menu",
107 .wakeup = 0,
108 }, {
109 .type = EV_KEY,
110 .code = KEY_UP,
111 .gpio = 32,
112 .desc = "Nav Pad Up",
113 .wakeup = 0,
114 }, {
115 .type = EV_KEY,
116 .code = KEY_RIGHT,
117 .gpio = 33,
118 .desc = "Nav Pad Right",
119 .wakeup = 0,
120 }, {
121 .type = EV_KEY,
122 .code = KEY_DOWN,
123 .gpio = 34,
124 .desc = "Nav Pad Down",
125 .wakeup = 0,
126 }, {
127 .type = EV_KEY,
128 .code = KEY_LEFT,
129 .gpio = 35,
130 .desc = "Nav Pad Left",
131 .wakeup = 0,
132 }, {
133 .type = EV_KEY,
134 .code = KEY_ENTER,
135 .gpio = 38,
136 .desc = "Nav Pad Ok",
137 .wakeup = 0,
138 }, {
139 .type = EV_KEY,
140 .code = KEY_O,
141 .gpio = 39,
142 .desc = "Wheel Off",
143 .wakeup = 0,
144 }, {
145 .type = EV_KEY,
146 .code = BTN_FORWARD,
147 .gpio = 50,
148 .desc = "Focus Forward",
149 .wakeup = 0,
150 }, {
151 .type = EV_KEY,
152 .code = BTN_BACK,
153 .gpio = 51,
154 .desc = "Focus Backward",
155 .wakeup = 0,
156 }, {
157 .type = EV_KEY,
158 .code = BTN_MIDDLE,
159 .gpio = 52,
160 .desc = "Release Half",
161 .wakeup = 0,
162 }, {
163 .type = EV_KEY,
164 .code = BTN_EXTRA,
165 .gpio = 53,
166 .desc = "Release Full",
167 .wakeup = 0,
168 },
169};
170
171static struct gpio_keys_platform_data pcm037_gpio_keys_platform_data = {
172 .buttons = pcm037_gpio_keys,
173 .nbuttons = ARRAY_SIZE(pcm037_gpio_keys),
174 .rep = 0, /* No auto-repeat */
175};
176
177static struct platform_device pcm037_gpio_keys_device = {
178 .name = "gpio-keys",
179 .id = -1,
180 .dev = {
181 .platform_data = &pcm037_gpio_keys_platform_data,
182 },
183};
184
185static int eet_init_devices(void)
186{
187 if (!machine_is_pcm037() || pcm037_variant() != PCM037_EET)
188 return 0;
189
190 mxc_iomux_setup_multiple_pins(pcm037_eet_pins,
191 ARRAY_SIZE(pcm037_eet_pins), "pcm037_eet");
192
193 /* SPI */
194 spi_register_board_info(pcm037_spi_dev, ARRAY_SIZE(pcm037_spi_dev));
195#if defined(CONFIG_SPI_IMX) || defined(CONFIG_SPI_IMX_MODULE)
196 mxc_register_device(&mxc_spi_device0, &pcm037_spi1_master);
197#endif
198
199 platform_device_register(&pcm037_gpio_keys_device);
200
201 return 0;
202}
203
204late_initcall(eet_init_devices);
diff --git a/arch/arm/mach-omap1/board-nokia770.c b/arch/arm/mach-omap1/board-nokia770.c
index e70fc7c66bbb..ed2a48a9ce74 100644
--- a/arch/arm/mach-omap1/board-nokia770.c
+++ b/arch/arm/mach-omap1/board-nokia770.c
@@ -36,7 +36,6 @@
36#include <mach/hwa742.h> 36#include <mach/hwa742.h>
37#include <mach/lcd_mipid.h> 37#include <mach/lcd_mipid.h>
38#include <mach/mmc.h> 38#include <mach/mmc.h>
39#include <mach/usb.h>
40#include <mach/clock.h> 39#include <mach/clock.h>
41 40
42#define ADS7846_PENDOWN_GPIO 15 41#define ADS7846_PENDOWN_GPIO 15
@@ -205,9 +204,11 @@ static int nokia770_mmc_get_cover_state(struct device *dev, int slot)
205static struct omap_mmc_platform_data nokia770_mmc2_data = { 204static struct omap_mmc_platform_data nokia770_mmc2_data = {
206 .nr_slots = 1, 205 .nr_slots = 1,
207 .dma_mask = 0xffffffff, 206 .dma_mask = 0xffffffff,
207 .max_freq = 12000000,
208 .slots[0] = { 208 .slots[0] = {
209 .set_power = nokia770_mmc_set_power, 209 .set_power = nokia770_mmc_set_power,
210 .get_cover_state = nokia770_mmc_get_cover_state, 210 .get_cover_state = nokia770_mmc_get_cover_state,
211 .ocr_mask = MMC_VDD_32_33|MMC_VDD_33_34,
211 .name = "mmcblk", 212 .name = "mmcblk",
212 }, 213 },
213}; 214};
diff --git a/arch/arm/mach-omap1/mailbox.c b/arch/arm/mach-omap1/mailbox.c
index 0af4d6c85b47..6810b4aeb02c 100644
--- a/arch/arm/mach-omap1/mailbox.c
+++ b/arch/arm/mach-omap1/mailbox.c
@@ -203,5 +203,5 @@ module_exit(omap1_mbox_exit);
203 203
204MODULE_LICENSE("GPL v2"); 204MODULE_LICENSE("GPL v2");
205MODULE_DESCRIPTION("omap mailbox: omap1 architecture specific functions"); 205MODULE_DESCRIPTION("omap mailbox: omap1 architecture specific functions");
206MODULE_AUTHOR("Hiroshi DOYU" <Hiroshi.DOYU@nokia.com>); 206MODULE_AUTHOR("Hiroshi DOYU <Hiroshi.DOYU@nokia.com>");
207MODULE_ALIAS("platform:omap1-mailbox"); 207MODULE_ALIAS("platform:omap1-mailbox");
diff --git a/arch/arm/mach-omap1/mcbsp.c b/arch/arm/mach-omap1/mcbsp.c
index a2d7814896be..505d98cfe508 100644
--- a/arch/arm/mach-omap1/mcbsp.c
+++ b/arch/arm/mach-omap1/mcbsp.c
@@ -19,7 +19,6 @@
19 19
20#include <mach/irqs.h> 20#include <mach/irqs.h>
21#include <mach/dma.h> 21#include <mach/dma.h>
22#include <mach/irqs.h>
23#include <mach/mux.h> 22#include <mach/mux.h>
24#include <mach/cpu.h> 23#include <mach/cpu.h>
25#include <mach/mcbsp.h> 24#include <mach/mcbsp.h>
diff --git a/arch/arm/mach-omap2/board-omap3evm.c b/arch/arm/mach-omap2/board-omap3evm.c
index d3cc145814d0..cf3dd771a678 100644
--- a/arch/arm/mach-omap2/board-omap3evm.c
+++ b/arch/arm/mach-omap2/board-omap3evm.c
@@ -25,6 +25,7 @@
25#include <linux/spi/spi.h> 25#include <linux/spi/spi.h>
26#include <linux/spi/ads7846.h> 26#include <linux/spi/ads7846.h>
27#include <linux/i2c/twl4030.h> 27#include <linux/i2c/twl4030.h>
28#include <linux/usb/otg.h>
28 29
29#include <mach/hardware.h> 30#include <mach/hardware.h>
30#include <asm/mach-types.h> 31#include <asm/mach-types.h>
@@ -307,6 +308,10 @@ static void __init omap3_evm_init(void)
307 ARRAY_SIZE(omap3evm_spi_board_info)); 308 ARRAY_SIZE(omap3evm_spi_board_info));
308 309
309 omap_serial_init(); 310 omap_serial_init();
311#ifdef CONFIG_NOP_USB_XCEIV
312 /* OMAP3EVM uses ISP1504 phy and so register nop transceiver */
313 usb_nop_xceiv_register();
314#endif
310 usb_musb_init(); 315 usb_musb_init();
311 ads7846_dev_init(); 316 ads7846_dev_init();
312} 317}
diff --git a/arch/arm/mach-omap2/board-rx51-peripherals.c b/arch/arm/mach-omap2/board-rx51-peripherals.c
index da93b86234ed..9a0bf6744a05 100644
--- a/arch/arm/mach-omap2/board-rx51-peripherals.c
+++ b/arch/arm/mach-omap2/board-rx51-peripherals.c
@@ -362,6 +362,7 @@ static struct omap_onenand_platform_data board_onenand_data = {
362 .gpio_irq = 65, 362 .gpio_irq = 65,
363 .parts = onenand_partitions, 363 .parts = onenand_partitions,
364 .nr_parts = ARRAY_SIZE(onenand_partitions), 364 .nr_parts = ARRAY_SIZE(onenand_partitions),
365 .flags = ONENAND_SYNC_READWRITE,
365}; 366};
366 367
367static void __init board_onenand_init(void) 368static void __init board_onenand_init(void)
diff --git a/arch/arm/mach-omap2/gpmc-onenand.c b/arch/arm/mach-omap2/gpmc-onenand.c
index 2fd22f9c5f0e..54fec53a48e7 100644
--- a/arch/arm/mach-omap2/gpmc-onenand.c
+++ b/arch/arm/mach-omap2/gpmc-onenand.c
@@ -31,6 +31,8 @@ static struct platform_device gpmc_onenand_device = {
31static int omap2_onenand_set_async_mode(int cs, void __iomem *onenand_base) 31static int omap2_onenand_set_async_mode(int cs, void __iomem *onenand_base)
32{ 32{
33 struct gpmc_timings t; 33 struct gpmc_timings t;
34 u32 reg;
35 int err;
34 36
35 const int t_cer = 15; 37 const int t_cer = 15;
36 const int t_avdp = 12; 38 const int t_avdp = 12;
@@ -43,6 +45,11 @@ static int omap2_onenand_set_async_mode(int cs, void __iomem *onenand_base)
43 const int t_wpl = 40; 45 const int t_wpl = 40;
44 const int t_wph = 30; 46 const int t_wph = 30;
45 47
48 /* Ensure sync read and sync write are disabled */
49 reg = readw(onenand_base + ONENAND_REG_SYS_CFG1);
50 reg &= ~ONENAND_SYS_CFG1_SYNC_READ & ~ONENAND_SYS_CFG1_SYNC_WRITE;
51 writew(reg, onenand_base + ONENAND_REG_SYS_CFG1);
52
46 memset(&t, 0, sizeof(t)); 53 memset(&t, 0, sizeof(t));
47 t.sync_clk = 0; 54 t.sync_clk = 0;
48 t.cs_on = 0; 55 t.cs_on = 0;
@@ -74,7 +81,16 @@ static int omap2_onenand_set_async_mode(int cs, void __iomem *onenand_base)
74 GPMC_CONFIG1_DEVICESIZE_16 | 81 GPMC_CONFIG1_DEVICESIZE_16 |
75 GPMC_CONFIG1_MUXADDDATA); 82 GPMC_CONFIG1_MUXADDDATA);
76 83
77 return gpmc_cs_set_timings(cs, &t); 84 err = gpmc_cs_set_timings(cs, &t);
85 if (err)
86 return err;
87
88 /* Ensure sync read and sync write are disabled */
89 reg = readw(onenand_base + ONENAND_REG_SYS_CFG1);
90 reg &= ~ONENAND_SYS_CFG1_SYNC_READ & ~ONENAND_SYS_CFG1_SYNC_WRITE;
91 writew(reg, onenand_base + ONENAND_REG_SYS_CFG1);
92
93 return 0;
78} 94}
79 95
80static void set_onenand_cfg(void __iomem *onenand_base, int latency, 96static void set_onenand_cfg(void __iomem *onenand_base, int latency,
@@ -124,7 +140,8 @@ static int omap2_onenand_set_sync_mode(struct omap_onenand_platform_data *cfg,
124 } else if (cfg->flags & ONENAND_SYNC_READWRITE) { 140 } else if (cfg->flags & ONENAND_SYNC_READWRITE) {
125 sync_read = 1; 141 sync_read = 1;
126 sync_write = 1; 142 sync_write = 1;
127 } 143 } else
144 return omap2_onenand_set_async_mode(cs, onenand_base);
128 145
129 if (!freq) { 146 if (!freq) {
130 /* Very first call freq is not known */ 147 /* Very first call freq is not known */
diff --git a/arch/arm/mach-omap2/id.c b/arch/arm/mach-omap2/id.c
index 458990e20c60..a98201cc265c 100644
--- a/arch/arm/mach-omap2/id.c
+++ b/arch/arm/mach-omap2/id.c
@@ -48,6 +48,28 @@ int omap_chip_is(struct omap_chip_id oci)
48} 48}
49EXPORT_SYMBOL(omap_chip_is); 49EXPORT_SYMBOL(omap_chip_is);
50 50
51int omap_type(void)
52{
53 u32 val = 0;
54
55 if (cpu_is_omap24xx())
56 val = omap_ctrl_readl(OMAP24XX_CONTROL_STATUS);
57 else if (cpu_is_omap34xx())
58 val = omap_ctrl_readl(OMAP343X_CONTROL_STATUS);
59 else {
60 pr_err("Cannot detect omap type!\n");
61 goto out;
62 }
63
64 val &= OMAP2_DEVICETYPE_MASK;
65 val >>= 8;
66
67out:
68 return val;
69}
70EXPORT_SYMBOL(omap_type);
71
72
51/*----------------------------------------------------------------------------*/ 73/*----------------------------------------------------------------------------*/
52 74
53#define OMAP_TAP_IDCODE 0x0204 75#define OMAP_TAP_IDCODE 0x0204
diff --git a/arch/arm/mach-omap2/mailbox.c b/arch/arm/mach-omap2/mailbox.c
index fd5b8a5925cc..6f71f3730c97 100644
--- a/arch/arm/mach-omap2/mailbox.c
+++ b/arch/arm/mach-omap2/mailbox.c
@@ -282,12 +282,12 @@ static int __devinit omap2_mbox_probe(struct platform_device *pdev)
282 return -ENOMEM; 282 return -ENOMEM;
283 283
284 /* DSP or IVA2 IRQ */ 284 /* DSP or IVA2 IRQ */
285 mbox_dsp_info.irq = platform_get_irq(pdev, 0); 285 ret = platform_get_irq(pdev, 0);
286 if (mbox_dsp_info.irq < 0) { 286 if (ret < 0) {
287 dev_err(&pdev->dev, "invalid irq resource\n"); 287 dev_err(&pdev->dev, "invalid irq resource\n");
288 ret = -ENODEV;
289 goto err_dsp; 288 goto err_dsp;
290 } 289 }
290 mbox_dsp_info.irq = ret;
291 291
292 ret = omap_mbox_register(&pdev->dev, &mbox_dsp_info); 292 ret = omap_mbox_register(&pdev->dev, &mbox_dsp_info);
293 if (ret) 293 if (ret)
diff --git a/arch/arm/mach-omap2/mcbsp.c b/arch/arm/mach-omap2/mcbsp.c
index a5c0f0435cd6..99b6e1546311 100644
--- a/arch/arm/mach-omap2/mcbsp.c
+++ b/arch/arm/mach-omap2/mcbsp.c
@@ -19,7 +19,6 @@
19 19
20#include <mach/irqs.h> 20#include <mach/irqs.h>
21#include <mach/dma.h> 21#include <mach/dma.h>
22#include <mach/irqs.h>
23#include <mach/mux.h> 22#include <mach/mux.h>
24#include <mach/cpu.h> 23#include <mach/cpu.h>
25#include <mach/mcbsp.h> 24#include <mach/mcbsp.h>
diff --git a/arch/arm/mach-omap2/mmc-twl4030.c b/arch/arm/mach-omap2/mmc-twl4030.c
index 9756a878fd90..1541fd4c8d0f 100644
--- a/arch/arm/mach-omap2/mmc-twl4030.c
+++ b/arch/arm/mach-omap2/mmc-twl4030.c
@@ -263,8 +263,19 @@ static int twl_mmc1_set_power(struct device *dev, int slot, int power_on,
263static int twl_mmc23_set_power(struct device *dev, int slot, int power_on, int vdd) 263static int twl_mmc23_set_power(struct device *dev, int slot, int power_on, int vdd)
264{ 264{
265 int ret = 0; 265 int ret = 0;
266 struct twl_mmc_controller *c = &hsmmc[1]; 266 struct twl_mmc_controller *c = NULL;
267 struct omap_mmc_platform_data *mmc = dev->platform_data; 267 struct omap_mmc_platform_data *mmc = dev->platform_data;
268 int i;
269
270 for (i = 1; i < ARRAY_SIZE(hsmmc); i++) {
271 if (mmc == hsmmc[i].mmc) {
272 c = &hsmmc[i];
273 break;
274 }
275 }
276
277 if (c == NULL)
278 return -ENODEV;
268 279
269 /* If we don't see a Vcc regulator, assume it's a fixed 280 /* If we don't see a Vcc regulator, assume it's a fixed
270 * voltage always-on regulator. 281 * voltage always-on regulator.
diff --git a/arch/arm/mach-omap2/usb-musb.c b/arch/arm/mach-omap2/usb-musb.c
index d85296dc896c..739e59e8025c 100644
--- a/arch/arm/mach-omap2/usb-musb.c
+++ b/arch/arm/mach-omap2/usb-musb.c
@@ -155,20 +155,6 @@ static struct platform_device musb_device = {
155 .resource = musb_resources, 155 .resource = musb_resources,
156}; 156};
157 157
158#ifdef CONFIG_NOP_USB_XCEIV
159static u64 nop_xceiv_dmamask = DMA_BIT_MASK(32);
160
161static struct platform_device nop_xceiv_device = {
162 .name = "nop_usb_xceiv",
163 .id = -1,
164 .dev = {
165 .dma_mask = &nop_xceiv_dmamask,
166 .coherent_dma_mask = DMA_BIT_MASK(32),
167 .platform_data = NULL,
168 },
169};
170#endif
171
172void __init usb_musb_init(void) 158void __init usb_musb_init(void)
173{ 159{
174 if (cpu_is_omap243x()) 160 if (cpu_is_omap243x())
@@ -183,13 +169,6 @@ void __init usb_musb_init(void)
183 */ 169 */
184 musb_plat.clock = "ick"; 170 musb_plat.clock = "ick";
185 171
186#ifdef CONFIG_NOP_USB_XCEIV
187 if (platform_device_register(&nop_xceiv_device) < 0) {
188 printk(KERN_ERR "Unable to register NOP-XCEIV device\n");
189 return;
190 }
191#endif
192
193 if (platform_device_register(&musb_device) < 0) { 172 if (platform_device_register(&musb_device) < 0) {
194 printk(KERN_ERR "Unable to register HS-USB (MUSB) device\n"); 173 printk(KERN_ERR "Unable to register HS-USB (MUSB) device\n");
195 return; 174 return;
diff --git a/arch/arm/mach-pxa/em-x270.c b/arch/arm/mach-pxa/em-x270.c
index 63b10d9bb1d3..9cd09465a0e8 100644
--- a/arch/arm/mach-pxa/em-x270.c
+++ b/arch/arm/mach-pxa/em-x270.c
@@ -1141,12 +1141,16 @@ struct power_supply_info em_x270_psy_info = {
1141 1141
1142static void em_x270_battery_low(void) 1142static void em_x270_battery_low(void)
1143{ 1143{
1144#if defined(CONFIG_APM_EMULATION)
1144 apm_queue_event(APM_LOW_BATTERY); 1145 apm_queue_event(APM_LOW_BATTERY);
1146#endif
1145} 1147}
1146 1148
1147static void em_x270_battery_critical(void) 1149static void em_x270_battery_critical(void)
1148{ 1150{
1151#if defined(CONFIG_APM_EMULATION)
1149 apm_queue_event(APM_CRITICAL_SUSPEND); 1152 apm_queue_event(APM_CRITICAL_SUSPEND);
1153#endif
1150} 1154}
1151 1155
1152struct da9030_battery_info em_x270_batterty_info = { 1156struct da9030_battery_info em_x270_batterty_info = {
diff --git a/arch/arm/mach-pxa/include/mach/mfp-pxa300.h b/arch/arm/mach-pxa/include/mach/mfp-pxa300.h
index ae8441192ef0..7139e0dc26d1 100644
--- a/arch/arm/mach-pxa/include/mach/mfp-pxa300.h
+++ b/arch/arm/mach-pxa/include/mach/mfp-pxa300.h
@@ -567,9 +567,9 @@
567#define GPIO37_ULPI_DATA_OUT_7 MFP_CFG(GPIO37, AF3) 567#define GPIO37_ULPI_DATA_OUT_7 MFP_CFG(GPIO37, AF3)
568#define GPIO33_ULPI_OTG_INTR MFP_CFG(GPIO33, AF1) 568#define GPIO33_ULPI_OTG_INTR MFP_CFG(GPIO33, AF1)
569 569
570#define ULPI_DIR MFP_CFG_DRV(ULPI_DIR, MFP_AF0, MFP_DS01X) 570#define ULPI_DIR MFP_CFG_DRV(ULPI_DIR, AF0, DS01X)
571#define ULPI_NXT MFP_CFG_DRV(ULPI_NXT, MFP_AF0, MFP_DS01X) 571#define ULPI_NXT MFP_CFG_DRV(ULPI_NXT, AF0, DS01X)
572#define ULPI_STP MFP_CFG_DRV(ULPI_STP, MFP_AF0, MFP_DS01X) 572#define ULPI_STP MFP_CFG_DRV(ULPI_STP, AF0, DS01X)
573#endif /* CONFIG_CPU_PXA310 */ 573#endif /* CONFIG_CPU_PXA310 */
574 574
575#endif /* __ASM_ARCH_MFP_PXA300_H */ 575#endif /* __ASM_ARCH_MFP_PXA300_H */
diff --git a/arch/arm/mach-pxa/palmld.c b/arch/arm/mach-pxa/palmld.c
index ed70f281dd09..169fcc18154e 100644
--- a/arch/arm/mach-pxa/palmld.c
+++ b/arch/arm/mach-pxa/palmld.c
@@ -128,6 +128,10 @@ static unsigned long palmld_pin_config[] __initdata = {
128 GPIO38_GPIO, /* wifi ready */ 128 GPIO38_GPIO, /* wifi ready */
129 GPIO81_GPIO, /* wifi reset */ 129 GPIO81_GPIO, /* wifi reset */
130 130
131 /* FFUART */
132 GPIO34_FFUART_RXD,
133 GPIO39_FFUART_TXD,
134
131 /* HDD */ 135 /* HDD */
132 GPIO98_GPIO, /* HDD reset */ 136 GPIO98_GPIO, /* HDD reset */
133 GPIO115_GPIO, /* HDD power */ 137 GPIO115_GPIO, /* HDD power */
diff --git a/arch/arm/mach-pxa/palmt5.c b/arch/arm/mach-pxa/palmt5.c
index aae64a12a734..33f726ff55e5 100644
--- a/arch/arm/mach-pxa/palmt5.c
+++ b/arch/arm/mach-pxa/palmt5.c
@@ -111,6 +111,10 @@ static unsigned long palmt5_pin_config[] __initdata = {
111 /* PWM */ 111 /* PWM */
112 GPIO16_PWM0_OUT, 112 GPIO16_PWM0_OUT,
113 113
114 /* FFUART */
115 GPIO34_FFUART_RXD,
116 GPIO39_FFUART_TXD,
117
114 /* MISC */ 118 /* MISC */
115 GPIO10_GPIO, /* hotsync button */ 119 GPIO10_GPIO, /* hotsync button */
116 GPIO90_GPIO, /* power detect */ 120 GPIO90_GPIO, /* power detect */
diff --git a/arch/arm/mach-pxa/palmtx.c b/arch/arm/mach-pxa/palmtx.c
index 6c15d84bde53..83d020879581 100644
--- a/arch/arm/mach-pxa/palmtx.c
+++ b/arch/arm/mach-pxa/palmtx.c
@@ -127,6 +127,10 @@ static unsigned long palmtx_pin_config[] __initdata = {
127 GPIO76_LCD_PCLK, 127 GPIO76_LCD_PCLK,
128 GPIO77_LCD_BIAS, 128 GPIO77_LCD_BIAS,
129 129
130 /* FFUART */
131 GPIO34_FFUART_RXD,
132 GPIO39_FFUART_TXD,
133
130 /* MISC. */ 134 /* MISC. */
131 GPIO10_GPIO, /* hotsync button */ 135 GPIO10_GPIO, /* hotsync button */
132 GPIO12_GPIO, /* power detect */ 136 GPIO12_GPIO, /* power detect */
diff --git a/arch/arm/mach-pxa/pxa3xx.c b/arch/arm/mach-pxa/pxa3xx.c
index 6f678d93bf4e..09b7b1a10cad 100644
--- a/arch/arm/mach-pxa/pxa3xx.c
+++ b/arch/arm/mach-pxa/pxa3xx.c
@@ -250,7 +250,7 @@ static DEFINE_PXA3_CKEN(pxa3xx_mmc2, MMC2, 19500000, 0);
250static struct clk_lookup pxa3xx_clkregs[] = { 250static struct clk_lookup pxa3xx_clkregs[] = {
251 INIT_CLKREG(&clk_pxa3xx_pout, NULL, "CLK_POUT"), 251 INIT_CLKREG(&clk_pxa3xx_pout, NULL, "CLK_POUT"),
252 /* Power I2C clock is always on */ 252 /* Power I2C clock is always on */
253 INIT_CLKREG(&clk_dummy, "pxa2xx-i2c.1", NULL), 253 INIT_CLKREG(&clk_dummy, "pxa3xx-pwri2c.1", NULL),
254 INIT_CLKREG(&clk_pxa3xx_lcd, "pxa2xx-fb", NULL), 254 INIT_CLKREG(&clk_pxa3xx_lcd, "pxa2xx-fb", NULL),
255 INIT_CLKREG(&clk_pxa3xx_camera, NULL, "CAMCLK"), 255 INIT_CLKREG(&clk_pxa3xx_camera, NULL, "CAMCLK"),
256 INIT_CLKREG(&clk_pxa3xx_ac97, NULL, "AC97CLK"), 256 INIT_CLKREG(&clk_pxa3xx_ac97, NULL, "AC97CLK"),
diff --git a/arch/arm/mach-pxa/treo680.c b/arch/arm/mach-pxa/treo680.c
index a06f19edebb3..753ec4df17b9 100644
--- a/arch/arm/mach-pxa/treo680.c
+++ b/arch/arm/mach-pxa/treo680.c
@@ -409,7 +409,7 @@ err1:
409 409
410static void treo680_irda_shutdown(struct device *dev) 410static void treo680_irda_shutdown(struct device *dev)
411{ 411{
412 gpio_free(GPIO_NR_TREO680_AMP_EN); 412 gpio_free(GPIO_NR_TREO680_IR_EN);
413} 413}
414 414
415static struct pxaficp_platform_data treo680_ficp_info = { 415static struct pxaficp_platform_data treo680_ficp_info = {
diff --git a/arch/arm/mach-pxa/zylonite_pxa300.c b/arch/arm/mach-pxa/zylonite_pxa300.c
index cefd1c0a854a..84095440a878 100644
--- a/arch/arm/mach-pxa/zylonite_pxa300.c
+++ b/arch/arm/mach-pxa/zylonite_pxa300.c
@@ -197,10 +197,12 @@ static void __init zylonite_detect_lcd_panel(void)
197 for (i = 0; i < NUM_LCD_DETECT_PINS; i++) { 197 for (i = 0; i < NUM_LCD_DETECT_PINS; i++) {
198 id = id << 1; 198 id = id << 1;
199 gpio = mfp_to_gpio(lcd_detect_pins[i]); 199 gpio = mfp_to_gpio(lcd_detect_pins[i]);
200 gpio_request(gpio, "LCD_ID_PINS");
200 gpio_direction_input(gpio); 201 gpio_direction_input(gpio);
201 202
202 if (gpio_get_value(gpio)) 203 if (gpio_get_value(gpio))
203 id = id | 0x1; 204 id = id | 0x1;
205 gpio_free(gpio);
204 } 206 }
205 207
206 /* lcd id, flush out bit 1 */ 208 /* lcd id, flush out bit 1 */
diff --git a/arch/arm/mach-pxa/zylonite_pxa320.c b/arch/arm/mach-pxa/zylonite_pxa320.c
index cc5a22833605..60d08f23f5e4 100644
--- a/arch/arm/mach-pxa/zylonite_pxa320.c
+++ b/arch/arm/mach-pxa/zylonite_pxa320.c
@@ -176,10 +176,12 @@ static void __init zylonite_detect_lcd_panel(void)
176 for (i = 0; i < NUM_LCD_DETECT_PINS; i++) { 176 for (i = 0; i < NUM_LCD_DETECT_PINS; i++) {
177 id = id << 1; 177 id = id << 1;
178 gpio = mfp_to_gpio(lcd_detect_pins[i]); 178 gpio = mfp_to_gpio(lcd_detect_pins[i]);
179 gpio_request(gpio, "LCD_ID_PINS");
179 gpio_direction_input(gpio); 180 gpio_direction_input(gpio);
180 181
181 if (gpio_get_value(gpio)) 182 if (gpio_get_value(gpio))
182 id = id | 0x1; 183 id = id | 0x1;
184 gpio_free(gpio);
183 } 185 }
184 186
185 /* lcd id, flush out bit 1 */ 187 /* lcd id, flush out bit 1 */
diff --git a/arch/arm/mach-realview/core.c b/arch/arm/mach-realview/core.c
index 9ea9c05093cd..facbd49eec67 100644
--- a/arch/arm/mach-realview/core.c
+++ b/arch/arm/mach-realview/core.c
@@ -208,8 +208,7 @@ struct platform_device realview_i2c_device = {
208 208
209static struct i2c_board_info realview_i2c_board_info[] = { 209static struct i2c_board_info realview_i2c_board_info[] = {
210 { 210 {
211 I2C_BOARD_INFO("rtc-ds1307", 0xd0 >> 1), 211 I2C_BOARD_INFO("ds1338", 0xd0 >> 1),
212 .type = "ds1338",
213 }, 212 },
214}; 213};
215 214
diff --git a/arch/arm/mach-s3c2410/include/mach/gpio-core.h b/arch/arm/mach-s3c2410/include/mach/gpio-core.h
index 8fe192081d3a..f8b879a7973c 100644
--- a/arch/arm/mach-s3c2410/include/mach/gpio-core.h
+++ b/arch/arm/mach-s3c2410/include/mach/gpio-core.h
@@ -28,7 +28,7 @@ static inline struct s3c_gpio_chip *s3c_gpiolib_getchip(unsigned int pin)
28 return NULL; 28 return NULL;
29 29
30 chip = &s3c24xx_gpios[pin/32]; 30 chip = &s3c24xx_gpios[pin/32];
31 return (S3C2410_GPIO_OFFSET(pin) > chip->chip.ngpio) ? chip : NULL; 31 return (S3C2410_GPIO_OFFSET(pin) < chip->chip.ngpio) ? chip : NULL;
32} 32}
33 33
34#endif /* __ASM_ARCH_GPIO_CORE_H */ 34#endif /* __ASM_ARCH_GPIO_CORE_H */
diff --git a/arch/arm/mach-s3c2440/mach-mini2440.c b/arch/arm/mach-s3c2440/mach-mini2440.c
index 6a5bc3021bdb..ec71a6965786 100644
--- a/arch/arm/mach-s3c2440/mach-mini2440.c
+++ b/arch/arm/mach-s3c2440/mach-mini2440.c
@@ -48,8 +48,6 @@
48#include <plat/mci.h> 48#include <plat/mci.h>
49#include <plat/udc.h> 49#include <plat/udc.h>
50 50
51#include <plat/regs-serial.h>
52
53#include <linux/mtd/mtd.h> 51#include <linux/mtd/mtd.h>
54#include <linux/mtd/nand.h> 52#include <linux/mtd/nand.h>
55#include <linux/mtd/nand_ecc.h> 53#include <linux/mtd/nand_ecc.h>
@@ -275,6 +273,7 @@ static struct s3c2410_nand_set mini2440_nand_sets[] __initdata = {
275 .nr_chips = 1, 273 .nr_chips = 1,
276 .nr_partitions = ARRAY_SIZE(mini2440_default_nand_part), 274 .nr_partitions = ARRAY_SIZE(mini2440_default_nand_part),
277 .partitions = mini2440_default_nand_part, 275 .partitions = mini2440_default_nand_part,
276 .flash_bbt = 1, /* we use u-boot to create a BBT */
278 }, 277 },
279}; 278};
280 279
diff --git a/arch/arm/mach-s3c2442/mach-gta02.c b/arch/arm/mach-s3c2442/mach-gta02.c
index e23b581aa0e1..0fb385bd9cd9 100644
--- a/arch/arm/mach-s3c2442/mach-gta02.c
+++ b/arch/arm/mach-s3c2442/mach-gta02.c
@@ -433,8 +433,7 @@ static struct s3c2410_nand_set gta02_nand_sets[] = {
433 */ 433 */
434 .name = "neo1973-nand", 434 .name = "neo1973-nand",
435 .nr_chips = 1, 435 .nr_chips = 1,
436 .use_bbt = 1, 436 .flash_bbt = 1,
437 .force_soft_ecc = 1,
438 }, 437 },
439}; 438};
440 439
diff --git a/arch/arm/mach-u300/clock.c b/arch/arm/mach-u300/clock.c
index 5cd04d6751b3..111f7ea32b38 100644
--- a/arch/arm/mach-u300/clock.c
+++ b/arch/arm/mach-u300/clock.c
@@ -24,6 +24,7 @@
24#include <linux/init.h> 24#include <linux/init.h>
25#include <linux/timer.h> 25#include <linux/timer.h>
26#include <linux/io.h> 26#include <linux/io.h>
27#include <linux/seq_file.h>
27 28
28#include <asm/clkdev.h> 29#include <asm/clkdev.h>
29#include <mach/hardware.h> 30#include <mach/hardware.h>
@@ -702,6 +703,7 @@ static struct clk amba_clk = {
702 .rate = 52000000, /* this varies! */ 703 .rate = 52000000, /* this varies! */
703 .hw_ctrld = true, 704 .hw_ctrld = true,
704 .reset = false, 705 .reset = false,
706 .lock = __SPIN_LOCK_UNLOCKED(amba_clk.lock),
705}; 707};
706 708
707/* 709/*
@@ -720,6 +722,7 @@ static struct clk cpu_clk = {
720 .set_rate = clk_set_rate_cpuclk, 722 .set_rate = clk_set_rate_cpuclk,
721 .get_rate = clk_get_rate_cpuclk, 723 .get_rate = clk_get_rate_cpuclk,
722 .round_rate = clk_round_rate_cpuclk, 724 .round_rate = clk_round_rate_cpuclk,
725 .lock = __SPIN_LOCK_UNLOCKED(cpu_clk.lock),
723}; 726};
724 727
725static struct clk nandif_clk = { 728static struct clk nandif_clk = {
@@ -732,6 +735,7 @@ static struct clk nandif_clk = {
732 .clk_val = U300_SYSCON_SBCER_NANDIF_CLK_EN, 735 .clk_val = U300_SYSCON_SBCER_NANDIF_CLK_EN,
733 .enable = syscon_clk_enable, 736 .enable = syscon_clk_enable,
734 .disable = syscon_clk_disable, 737 .disable = syscon_clk_disable,
738 .lock = __SPIN_LOCK_UNLOCKED(nandif_clk.lock),
735}; 739};
736 740
737static struct clk semi_clk = { 741static struct clk semi_clk = {
@@ -744,6 +748,7 @@ static struct clk semi_clk = {
744 .clk_val = U300_SYSCON_SBCER_SEMI_CLK_EN, 748 .clk_val = U300_SYSCON_SBCER_SEMI_CLK_EN,
745 .enable = syscon_clk_enable, 749 .enable = syscon_clk_enable,
746 .disable = syscon_clk_disable, 750 .disable = syscon_clk_disable,
751 .lock = __SPIN_LOCK_UNLOCKED(semi_clk.lock),
747}; 752};
748 753
749#ifdef CONFIG_MACH_U300_BS335 754#ifdef CONFIG_MACH_U300_BS335
@@ -758,6 +763,7 @@ static struct clk isp_clk = {
758 .clk_val = U300_SYSCON_SBCER_ISP_CLK_EN, 763 .clk_val = U300_SYSCON_SBCER_ISP_CLK_EN,
759 .enable = syscon_clk_enable, 764 .enable = syscon_clk_enable,
760 .disable = syscon_clk_disable, 765 .disable = syscon_clk_disable,
766 .lock = __SPIN_LOCK_UNLOCKED(isp_clk.lock),
761}; 767};
762 768
763static struct clk cds_clk = { 769static struct clk cds_clk = {
@@ -771,6 +777,7 @@ static struct clk cds_clk = {
771 .clk_val = U300_SYSCON_SBCER_CDS_CLK_EN, 777 .clk_val = U300_SYSCON_SBCER_CDS_CLK_EN,
772 .enable = syscon_clk_enable, 778 .enable = syscon_clk_enable,
773 .disable = syscon_clk_disable, 779 .disable = syscon_clk_disable,
780 .lock = __SPIN_LOCK_UNLOCKED(cds_clk.lock),
774}; 781};
775#endif 782#endif
776 783
@@ -785,6 +792,7 @@ static struct clk dma_clk = {
785 .clk_val = U300_SYSCON_SBCER_DMAC_CLK_EN, 792 .clk_val = U300_SYSCON_SBCER_DMAC_CLK_EN,
786 .enable = syscon_clk_enable, 793 .enable = syscon_clk_enable,
787 .disable = syscon_clk_disable, 794 .disable = syscon_clk_disable,
795 .lock = __SPIN_LOCK_UNLOCKED(dma_clk.lock),
788}; 796};
789 797
790static struct clk aaif_clk = { 798static struct clk aaif_clk = {
@@ -798,6 +806,7 @@ static struct clk aaif_clk = {
798 .clk_val = U300_SYSCON_SBCER_AAIF_CLK_EN, 806 .clk_val = U300_SYSCON_SBCER_AAIF_CLK_EN,
799 .enable = syscon_clk_enable, 807 .enable = syscon_clk_enable,
800 .disable = syscon_clk_disable, 808 .disable = syscon_clk_disable,
809 .lock = __SPIN_LOCK_UNLOCKED(aaif_clk.lock),
801}; 810};
802 811
803static struct clk apex_clk = { 812static struct clk apex_clk = {
@@ -811,6 +820,7 @@ static struct clk apex_clk = {
811 .clk_val = U300_SYSCON_SBCER_APEX_CLK_EN, 820 .clk_val = U300_SYSCON_SBCER_APEX_CLK_EN,
812 .enable = syscon_clk_enable, 821 .enable = syscon_clk_enable,
813 .disable = syscon_clk_disable, 822 .disable = syscon_clk_disable,
823 .lock = __SPIN_LOCK_UNLOCKED(apex_clk.lock),
814}; 824};
815 825
816static struct clk video_enc_clk = { 826static struct clk video_enc_clk = {
@@ -825,6 +835,7 @@ static struct clk video_enc_clk = {
825 .clk_val = U300_SYSCON_SBCER_VIDEO_ENC_CLK_EN, 835 .clk_val = U300_SYSCON_SBCER_VIDEO_ENC_CLK_EN,
826 .enable = syscon_clk_enable, 836 .enable = syscon_clk_enable,
827 .disable = syscon_clk_disable, 837 .disable = syscon_clk_disable,
838 .lock = __SPIN_LOCK_UNLOCKED(video_enc_clk.lock),
828}; 839};
829 840
830static struct clk xgam_clk = { 841static struct clk xgam_clk = {
@@ -839,6 +850,7 @@ static struct clk xgam_clk = {
839 .get_rate = clk_get_rate_xgamclk, 850 .get_rate = clk_get_rate_xgamclk,
840 .enable = syscon_clk_enable, 851 .enable = syscon_clk_enable,
841 .disable = syscon_clk_disable, 852 .disable = syscon_clk_disable,
853 .lock = __SPIN_LOCK_UNLOCKED(xgam_clk.lock),
842}; 854};
843 855
844/* This clock is used to activate the video encoder */ 856/* This clock is used to activate the video encoder */
@@ -854,6 +866,7 @@ static struct clk ahb_clk = {
854 .enable = syscon_clk_enable, 866 .enable = syscon_clk_enable,
855 .disable = syscon_clk_disable, 867 .disable = syscon_clk_disable,
856 .get_rate = clk_get_rate_ahb_clk, 868 .get_rate = clk_get_rate_ahb_clk,
869 .lock = __SPIN_LOCK_UNLOCKED(ahb_clk.lock),
857}; 870};
858 871
859 872
@@ -871,6 +884,7 @@ static struct clk ahb_subsys_clk = {
871 .enable = syscon_clk_enable, 884 .enable = syscon_clk_enable,
872 .disable = syscon_clk_disable, 885 .disable = syscon_clk_disable,
873 .get_rate = clk_get_rate_ahb_clk, 886 .get_rate = clk_get_rate_ahb_clk,
887 .lock = __SPIN_LOCK_UNLOCKED(ahb_subsys_clk.lock),
874}; 888};
875 889
876static struct clk intcon_clk = { 890static struct clk intcon_clk = {
@@ -882,6 +896,8 @@ static struct clk intcon_clk = {
882 .res_reg = U300_SYSCON_VBASE + U300_SYSCON_RRR, 896 .res_reg = U300_SYSCON_VBASE + U300_SYSCON_RRR,
883 .res_mask = U300_SYSCON_RRR_INTCON_RESET_EN, 897 .res_mask = U300_SYSCON_RRR_INTCON_RESET_EN,
884 /* INTCON can be reset but not clock-gated */ 898 /* INTCON can be reset but not clock-gated */
899 .lock = __SPIN_LOCK_UNLOCKED(intcon_clk.lock),
900
885}; 901};
886 902
887static struct clk mspro_clk = { 903static struct clk mspro_clk = {
@@ -895,6 +911,7 @@ static struct clk mspro_clk = {
895 .clk_val = U300_SYSCON_SBCER_MSPRO_CLK_EN, 911 .clk_val = U300_SYSCON_SBCER_MSPRO_CLK_EN,
896 .enable = syscon_clk_enable, 912 .enable = syscon_clk_enable,
897 .disable = syscon_clk_disable, 913 .disable = syscon_clk_disable,
914 .lock = __SPIN_LOCK_UNLOCKED(mspro_clk.lock),
898}; 915};
899 916
900static struct clk emif_clk = { 917static struct clk emif_clk = {
@@ -909,6 +926,7 @@ static struct clk emif_clk = {
909 .enable = syscon_clk_enable, 926 .enable = syscon_clk_enable,
910 .disable = syscon_clk_disable, 927 .disable = syscon_clk_disable,
911 .get_rate = clk_get_rate_emif_clk, 928 .get_rate = clk_get_rate_emif_clk,
929 .lock = __SPIN_LOCK_UNLOCKED(emif_clk.lock),
912}; 930};
913 931
914 932
@@ -926,6 +944,7 @@ static struct clk fast_clk = {
926 .clk_val = U300_SYSCON_SBCER_FAST_BRIDGE_CLK_EN, 944 .clk_val = U300_SYSCON_SBCER_FAST_BRIDGE_CLK_EN,
927 .enable = syscon_clk_enable, 945 .enable = syscon_clk_enable,
928 .disable = syscon_clk_disable, 946 .disable = syscon_clk_disable,
947 .lock = __SPIN_LOCK_UNLOCKED(fast_clk.lock),
929}; 948};
930 949
931static struct clk mmcsd_clk = { 950static struct clk mmcsd_clk = {
@@ -942,6 +961,7 @@ static struct clk mmcsd_clk = {
942 .round_rate = clk_round_rate_mclk, 961 .round_rate = clk_round_rate_mclk,
943 .disable = syscon_clk_disable, 962 .disable = syscon_clk_disable,
944 .enable = syscon_clk_enable, 963 .enable = syscon_clk_enable,
964 .lock = __SPIN_LOCK_UNLOCKED(mmcsd_clk.lock),
945}; 965};
946 966
947static struct clk i2s0_clk = { 967static struct clk i2s0_clk = {
@@ -956,6 +976,7 @@ static struct clk i2s0_clk = {
956 .enable = syscon_clk_enable, 976 .enable = syscon_clk_enable,
957 .disable = syscon_clk_disable, 977 .disable = syscon_clk_disable,
958 .get_rate = clk_get_rate_i2s_i2c_spi, 978 .get_rate = clk_get_rate_i2s_i2c_spi,
979 .lock = __SPIN_LOCK_UNLOCKED(i2s0_clk.lock),
959}; 980};
960 981
961static struct clk i2s1_clk = { 982static struct clk i2s1_clk = {
@@ -970,6 +991,7 @@ static struct clk i2s1_clk = {
970 .enable = syscon_clk_enable, 991 .enable = syscon_clk_enable,
971 .disable = syscon_clk_disable, 992 .disable = syscon_clk_disable,
972 .get_rate = clk_get_rate_i2s_i2c_spi, 993 .get_rate = clk_get_rate_i2s_i2c_spi,
994 .lock = __SPIN_LOCK_UNLOCKED(i2s1_clk.lock),
973}; 995};
974 996
975static struct clk i2c0_clk = { 997static struct clk i2c0_clk = {
@@ -984,6 +1006,7 @@ static struct clk i2c0_clk = {
984 .enable = syscon_clk_enable, 1006 .enable = syscon_clk_enable,
985 .disable = syscon_clk_disable, 1007 .disable = syscon_clk_disable,
986 .get_rate = clk_get_rate_i2s_i2c_spi, 1008 .get_rate = clk_get_rate_i2s_i2c_spi,
1009 .lock = __SPIN_LOCK_UNLOCKED(i2c0_clk.lock),
987}; 1010};
988 1011
989static struct clk i2c1_clk = { 1012static struct clk i2c1_clk = {
@@ -998,6 +1021,7 @@ static struct clk i2c1_clk = {
998 .enable = syscon_clk_enable, 1021 .enable = syscon_clk_enable,
999 .disable = syscon_clk_disable, 1022 .disable = syscon_clk_disable,
1000 .get_rate = clk_get_rate_i2s_i2c_spi, 1023 .get_rate = clk_get_rate_i2s_i2c_spi,
1024 .lock = __SPIN_LOCK_UNLOCKED(i2c1_clk.lock),
1001}; 1025};
1002 1026
1003static struct clk spi_clk = { 1027static struct clk spi_clk = {
@@ -1012,6 +1036,7 @@ static struct clk spi_clk = {
1012 .enable = syscon_clk_enable, 1036 .enable = syscon_clk_enable,
1013 .disable = syscon_clk_disable, 1037 .disable = syscon_clk_disable,
1014 .get_rate = clk_get_rate_i2s_i2c_spi, 1038 .get_rate = clk_get_rate_i2s_i2c_spi,
1039 .lock = __SPIN_LOCK_UNLOCKED(spi_clk.lock),
1015}; 1040};
1016 1041
1017#ifdef CONFIG_MACH_U300_BS335 1042#ifdef CONFIG_MACH_U300_BS335
@@ -1026,6 +1051,7 @@ static struct clk uart1_clk = {
1026 .clk_val = U300_SYSCON_SBCER_UART1_CLK_EN, 1051 .clk_val = U300_SYSCON_SBCER_UART1_CLK_EN,
1027 .enable = syscon_clk_enable, 1052 .enable = syscon_clk_enable,
1028 .disable = syscon_clk_disable, 1053 .disable = syscon_clk_disable,
1054 .lock = __SPIN_LOCK_UNLOCKED(uart1_clk.lock),
1029}; 1055};
1030#endif 1056#endif
1031 1057
@@ -1044,6 +1070,7 @@ static struct clk slow_clk = {
1044 .clk_val = U300_SYSCON_SBCER_SLOW_BRIDGE_CLK_EN, 1070 .clk_val = U300_SYSCON_SBCER_SLOW_BRIDGE_CLK_EN,
1045 .enable = syscon_clk_enable, 1071 .enable = syscon_clk_enable,
1046 .disable = syscon_clk_disable, 1072 .disable = syscon_clk_disable,
1073 .lock = __SPIN_LOCK_UNLOCKED(slow_clk.lock),
1047}; 1074};
1048 1075
1049/* TODO: implement SYSCON clock? */ 1076/* TODO: implement SYSCON clock? */
@@ -1055,6 +1082,7 @@ static struct clk wdog_clk = {
1055 .rate = 32768, 1082 .rate = 32768,
1056 .reset = false, 1083 .reset = false,
1057 /* This is always on, cannot be enabled/disabled or reset */ 1084 /* This is always on, cannot be enabled/disabled or reset */
1085 .lock = __SPIN_LOCK_UNLOCKED(wdog_clk.lock),
1058}; 1086};
1059 1087
1060/* This one is hardwired to PLL13 */ 1088/* This one is hardwired to PLL13 */
@@ -1069,6 +1097,7 @@ static struct clk uart_clk = {
1069 .clk_val = U300_SYSCON_SBCER_UART_CLK_EN, 1097 .clk_val = U300_SYSCON_SBCER_UART_CLK_EN,
1070 .enable = syscon_clk_enable, 1098 .enable = syscon_clk_enable,
1071 .disable = syscon_clk_disable, 1099 .disable = syscon_clk_disable,
1100 .lock = __SPIN_LOCK_UNLOCKED(uart_clk.lock),
1072}; 1101};
1073 1102
1074static struct clk keypad_clk = { 1103static struct clk keypad_clk = {
@@ -1082,6 +1111,7 @@ static struct clk keypad_clk = {
1082 .clk_val = U300_SYSCON_SBCER_KEYPAD_CLK_EN, 1111 .clk_val = U300_SYSCON_SBCER_KEYPAD_CLK_EN,
1083 .enable = syscon_clk_enable, 1112 .enable = syscon_clk_enable,
1084 .disable = syscon_clk_disable, 1113 .disable = syscon_clk_disable,
1114 .lock = __SPIN_LOCK_UNLOCKED(keypad_clk.lock),
1085}; 1115};
1086 1116
1087static struct clk gpio_clk = { 1117static struct clk gpio_clk = {
@@ -1095,6 +1125,7 @@ static struct clk gpio_clk = {
1095 .clk_val = U300_SYSCON_SBCER_GPIO_CLK_EN, 1125 .clk_val = U300_SYSCON_SBCER_GPIO_CLK_EN,
1096 .enable = syscon_clk_enable, 1126 .enable = syscon_clk_enable,
1097 .disable = syscon_clk_disable, 1127 .disable = syscon_clk_disable,
1128 .lock = __SPIN_LOCK_UNLOCKED(gpio_clk.lock),
1098}; 1129};
1099 1130
1100static struct clk rtc_clk = { 1131static struct clk rtc_clk = {
@@ -1106,6 +1137,7 @@ static struct clk rtc_clk = {
1106 .res_reg = U300_SYSCON_VBASE + U300_SYSCON_RSR, 1137 .res_reg = U300_SYSCON_VBASE + U300_SYSCON_RSR,
1107 .res_mask = U300_SYSCON_RSR_RTC_RESET_EN, 1138 .res_mask = U300_SYSCON_RSR_RTC_RESET_EN,
1108 /* This clock is always on, cannot be enabled/disabled */ 1139 /* This clock is always on, cannot be enabled/disabled */
1140 .lock = __SPIN_LOCK_UNLOCKED(rtc_clk.lock),
1109}; 1141};
1110 1142
1111static struct clk bustr_clk = { 1143static struct clk bustr_clk = {
@@ -1119,6 +1151,7 @@ static struct clk bustr_clk = {
1119 .clk_val = U300_SYSCON_SBCER_BTR_CLK_EN, 1151 .clk_val = U300_SYSCON_SBCER_BTR_CLK_EN,
1120 .enable = syscon_clk_enable, 1152 .enable = syscon_clk_enable,
1121 .disable = syscon_clk_disable, 1153 .disable = syscon_clk_disable,
1154 .lock = __SPIN_LOCK_UNLOCKED(bustr_clk.lock),
1122}; 1155};
1123 1156
1124static struct clk evhist_clk = { 1157static struct clk evhist_clk = {
@@ -1132,6 +1165,7 @@ static struct clk evhist_clk = {
1132 .clk_val = U300_SYSCON_SBCER_EH_CLK_EN, 1165 .clk_val = U300_SYSCON_SBCER_EH_CLK_EN,
1133 .enable = syscon_clk_enable, 1166 .enable = syscon_clk_enable,
1134 .disable = syscon_clk_disable, 1167 .disable = syscon_clk_disable,
1168 .lock = __SPIN_LOCK_UNLOCKED(evhist_clk.lock),
1135}; 1169};
1136 1170
1137static struct clk timer_clk = { 1171static struct clk timer_clk = {
@@ -1145,6 +1179,7 @@ static struct clk timer_clk = {
1145 .clk_val = U300_SYSCON_SBCER_ACC_TMR_CLK_EN, 1179 .clk_val = U300_SYSCON_SBCER_ACC_TMR_CLK_EN,
1146 .enable = syscon_clk_enable, 1180 .enable = syscon_clk_enable,
1147 .disable = syscon_clk_disable, 1181 .disable = syscon_clk_disable,
1182 .lock = __SPIN_LOCK_UNLOCKED(timer_clk.lock),
1148}; 1183};
1149 1184
1150static struct clk app_timer_clk = { 1185static struct clk app_timer_clk = {
@@ -1158,6 +1193,7 @@ static struct clk app_timer_clk = {
1158 .clk_val = U300_SYSCON_SBCER_APP_TMR_CLK_EN, 1193 .clk_val = U300_SYSCON_SBCER_APP_TMR_CLK_EN,
1159 .enable = syscon_clk_enable, 1194 .enable = syscon_clk_enable,
1160 .disable = syscon_clk_disable, 1195 .disable = syscon_clk_disable,
1196 .lock = __SPIN_LOCK_UNLOCKED(app_timer_clk.lock),
1161}; 1197};
1162 1198
1163#ifdef CONFIG_MACH_U300_BS335 1199#ifdef CONFIG_MACH_U300_BS335
@@ -1172,6 +1208,7 @@ static struct clk ppm_clk = {
1172 .clk_val = U300_SYSCON_SBCER_PPM_CLK_EN, 1208 .clk_val = U300_SYSCON_SBCER_PPM_CLK_EN,
1173 .enable = syscon_clk_enable, 1209 .enable = syscon_clk_enable,
1174 .disable = syscon_clk_disable, 1210 .disable = syscon_clk_disable,
1211 .lock = __SPIN_LOCK_UNLOCKED(ppm_clk.lock),
1175}; 1212};
1176#endif 1213#endif
1177 1214
@@ -1187,53 +1224,53 @@ static struct clk ppm_clk = {
1187 */ 1224 */
1188static struct clk_lookup lookups[] = { 1225static struct clk_lookup lookups[] = {
1189 /* Connected directly to the AMBA bus */ 1226 /* Connected directly to the AMBA bus */
1190 DEF_LOOKUP("amba", &amba_clk), 1227 DEF_LOOKUP("amba", &amba_clk),
1191 DEF_LOOKUP("cpu", &cpu_clk), 1228 DEF_LOOKUP("cpu", &cpu_clk),
1192 DEF_LOOKUP("nandif", &nandif_clk), 1229 DEF_LOOKUP("fsmc", &nandif_clk),
1193 DEF_LOOKUP("semi", &semi_clk), 1230 DEF_LOOKUP("semi", &semi_clk),
1194#ifdef CONFIG_MACH_U300_BS335 1231#ifdef CONFIG_MACH_U300_BS335
1195 DEF_LOOKUP("isp", &isp_clk), 1232 DEF_LOOKUP("isp", &isp_clk),
1196 DEF_LOOKUP("cds", &cds_clk), 1233 DEF_LOOKUP("cds", &cds_clk),
1197#endif 1234#endif
1198 DEF_LOOKUP("dma", &dma_clk), 1235 DEF_LOOKUP("dma", &dma_clk),
1199 DEF_LOOKUP("aaif", &aaif_clk), 1236 DEF_LOOKUP("msl", &aaif_clk),
1200 DEF_LOOKUP("apex", &apex_clk), 1237 DEF_LOOKUP("apex", &apex_clk),
1201 DEF_LOOKUP("video_enc", &video_enc_clk), 1238 DEF_LOOKUP("video_enc", &video_enc_clk),
1202 DEF_LOOKUP("xgam", &xgam_clk), 1239 DEF_LOOKUP("xgam", &xgam_clk),
1203 DEF_LOOKUP("ahb", &ahb_clk), 1240 DEF_LOOKUP("ahb", &ahb_clk),
1204 /* AHB bridge clocks */ 1241 /* AHB bridge clocks */
1205 DEF_LOOKUP("ahb", &ahb_subsys_clk), 1242 DEF_LOOKUP("ahb_subsys", &ahb_subsys_clk),
1206 DEF_LOOKUP("intcon", &intcon_clk), 1243 DEF_LOOKUP("intcon", &intcon_clk),
1207 DEF_LOOKUP("mspro", &mspro_clk), 1244 DEF_LOOKUP("mspro", &mspro_clk),
1208 DEF_LOOKUP("pl172", &emif_clk), 1245 DEF_LOOKUP("pl172", &emif_clk),
1209 /* FAST bridge clocks */ 1246 /* FAST bridge clocks */
1210 DEF_LOOKUP("fast", &fast_clk), 1247 DEF_LOOKUP("fast", &fast_clk),
1211 DEF_LOOKUP("mmci", &mmcsd_clk), 1248 DEF_LOOKUP("mmci", &mmcsd_clk),
1212 /* 1249 /*
1213 * The .0 and .1 identifiers on these comes from the platform device 1250 * The .0 and .1 identifiers on these comes from the platform device
1214 * .id field and are assigned when the platform devices are registered. 1251 * .id field and are assigned when the platform devices are registered.
1215 */ 1252 */
1216 DEF_LOOKUP("i2s.0", &i2s0_clk), 1253 DEF_LOOKUP("i2s.0", &i2s0_clk),
1217 DEF_LOOKUP("i2s.1", &i2s1_clk), 1254 DEF_LOOKUP("i2s.1", &i2s1_clk),
1218 DEF_LOOKUP("stddci2c.0", &i2c0_clk), 1255 DEF_LOOKUP("stu300.0", &i2c0_clk),
1219 DEF_LOOKUP("stddci2c.1", &i2c1_clk), 1256 DEF_LOOKUP("stu300.1", &i2c1_clk),
1220 DEF_LOOKUP("pl022", &spi_clk), 1257 DEF_LOOKUP("pl022", &spi_clk),
1221#ifdef CONFIG_MACH_U300_BS335 1258#ifdef CONFIG_MACH_U300_BS335
1222 DEF_LOOKUP("uart1", &uart1_clk), 1259 DEF_LOOKUP("uart1", &uart1_clk),
1223#endif 1260#endif
1224 /* SLOW bridge clocks */ 1261 /* SLOW bridge clocks */
1225 DEF_LOOKUP("slow", &slow_clk), 1262 DEF_LOOKUP("slow", &slow_clk),
1226 DEF_LOOKUP("wdog", &wdog_clk), 1263 DEF_LOOKUP("coh901327_wdog", &wdog_clk),
1227 DEF_LOOKUP("uart0", &uart_clk), 1264 DEF_LOOKUP("uart0", &uart_clk),
1228 DEF_LOOKUP("apptimer", &app_timer_clk), 1265 DEF_LOOKUP("apptimer", &app_timer_clk),
1229 DEF_LOOKUP("keypad", &keypad_clk), 1266 DEF_LOOKUP("coh901461-keypad", &keypad_clk),
1230 DEF_LOOKUP("u300-gpio", &gpio_clk), 1267 DEF_LOOKUP("u300-gpio", &gpio_clk),
1231 DEF_LOOKUP("rtc0", &rtc_clk), 1268 DEF_LOOKUP("rtc-coh901331", &rtc_clk),
1232 DEF_LOOKUP("bustr", &bustr_clk), 1269 DEF_LOOKUP("bustr", &bustr_clk),
1233 DEF_LOOKUP("evhist", &evhist_clk), 1270 DEF_LOOKUP("evhist", &evhist_clk),
1234 DEF_LOOKUP("timer", &timer_clk), 1271 DEF_LOOKUP("timer", &timer_clk),
1235#ifdef CONFIG_MACH_U300_BS335 1272#ifdef CONFIG_MACH_U300_BS335
1236 DEF_LOOKUP("ppm", &ppm_clk), 1273 DEF_LOOKUP("ppm", &ppm_clk),
1237#endif 1274#endif
1238}; 1275};
1239 1276
@@ -1427,16 +1464,20 @@ static const struct file_operations u300_clocks_operations = {
1427 .release = single_release, 1464 .release = single_release,
1428}; 1465};
1429 1466
1430static void init_clk_read_procfs(void) 1467static int __init init_clk_read_debugfs(void)
1431{ 1468{
1432 /* Expose a simple debugfs interface to view all clocks */ 1469 /* Expose a simple debugfs interface to view all clocks */
1433 (void) debugfs_create_file("u300_clocks", S_IFREG | S_IRUGO, 1470 (void) debugfs_create_file("u300_clocks", S_IFREG | S_IRUGO,
1434 NULL, NULL, &u300_clocks_operations); 1471 NULL, NULL,
1435} 1472 &u300_clocks_operations);
1436#else 1473 return 0;
1437static inline void init_clk_read_procfs(void)
1438{
1439} 1474}
1475/*
1476 * This needs to come in after the core_initcall() for the
1477 * overall clocks, because debugfs is not available until
1478 * the subsystems come up.
1479 */
1480module_init(init_clk_read_debugfs);
1440#endif 1481#endif
1441 1482
1442static int __init u300_clock_init(void) 1483static int __init u300_clock_init(void)
@@ -1462,8 +1503,6 @@ static int __init u300_clock_init(void)
1462 1503
1463 clk_register(); 1504 clk_register();
1464 1505
1465 init_clk_read_procfs();
1466
1467 /* 1506 /*
1468 * Some of these may be on when we boot the system so make sure they 1507 * Some of these may be on when we boot the system so make sure they
1469 * are turned OFF. 1508 * are turned OFF.
diff --git a/arch/arm/mach-u300/core.c b/arch/arm/mach-u300/core.c
index 89b3ccf35e1b..7936085dd758 100644
--- a/arch/arm/mach-u300/core.c
+++ b/arch/arm/mach-u300/core.c
@@ -455,8 +455,8 @@ void __init u300_init_irq(void)
455 for (i = 0; i < NR_IRQS; i++) 455 for (i = 0; i < NR_IRQS; i++)
456 set_bit(i, (unsigned long *) &mask[0]); 456 set_bit(i, (unsigned long *) &mask[0]);
457 u300_enable_intcon_clock(); 457 u300_enable_intcon_clock();
458 vic_init((void __iomem *) U300_INTCON0_VBASE, 0, mask[0], 0); 458 vic_init((void __iomem *) U300_INTCON0_VBASE, 0, mask[0], mask[0]);
459 vic_init((void __iomem *) U300_INTCON1_VBASE, 32, mask[1], 0); 459 vic_init((void __iomem *) U300_INTCON1_VBASE, 32, mask[1], mask[1]);
460} 460}
461 461
462 462
diff --git a/arch/arm/mach-versatile/core.c b/arch/arm/mach-versatile/core.c
index 69214fc8bd19..31093af7d052 100644
--- a/arch/arm/mach-versatile/core.c
+++ b/arch/arm/mach-versatile/core.c
@@ -342,8 +342,7 @@ static struct platform_device versatile_i2c_device = {
342 342
343static struct i2c_board_info versatile_i2c_board_info[] = { 343static struct i2c_board_info versatile_i2c_board_info[] = {
344 { 344 {
345 I2C_BOARD_INFO("rtc-ds1307", 0xd0 >> 1), 345 I2C_BOARD_INFO("ds1338", 0xd0 >> 1),
346 .type = "ds1338",
347 }, 346 },
348}; 347};
349 348
diff --git a/arch/arm/mm/proc-syms.c b/arch/arm/mm/proc-syms.c
index 195e48edd8c2..ac5c80062b70 100644
--- a/arch/arm/mm/proc-syms.c
+++ b/arch/arm/mm/proc-syms.c
@@ -27,6 +27,7 @@ EXPORT_SYMBOL(__cpuc_flush_kern_all);
27EXPORT_SYMBOL(__cpuc_flush_user_all); 27EXPORT_SYMBOL(__cpuc_flush_user_all);
28EXPORT_SYMBOL(__cpuc_flush_user_range); 28EXPORT_SYMBOL(__cpuc_flush_user_range);
29EXPORT_SYMBOL(__cpuc_coherent_kern_range); 29EXPORT_SYMBOL(__cpuc_coherent_kern_range);
30EXPORT_SYMBOL(__cpuc_flush_dcache_page);
30EXPORT_SYMBOL(dmac_inv_range); /* because of flush_ioremap_region() */ 31EXPORT_SYMBOL(dmac_inv_range); /* because of flush_ioremap_region() */
31#else 32#else
32EXPORT_SYMBOL(cpu_cache); 33EXPORT_SYMBOL(cpu_cache);
diff --git a/arch/arm/plat-mxc/include/mach/iomux-mx3.h b/arch/arm/plat-mxc/include/mach/iomux-mx3.h
index 27f8d1b2bc6b..2eb182f73876 100644
--- a/arch/arm/plat-mxc/include/mach/iomux-mx3.h
+++ b/arch/arm/plat-mxc/include/mach/iomux-mx3.h
@@ -602,6 +602,8 @@ enum iomux_pins {
602#define MX31_PIN_I2C_DAT__SDA IOMUX_MODE(MX31_PIN_I2C_DAT, IOMUX_CONFIG_FUNC) 602#define MX31_PIN_I2C_DAT__SDA IOMUX_MODE(MX31_PIN_I2C_DAT, IOMUX_CONFIG_FUNC)
603#define MX31_PIN_DCD_DTE1__I2C2_SDA IOMUX_MODE(MX31_PIN_DCD_DTE1, IOMUX_CONFIG_ALT2) 603#define MX31_PIN_DCD_DTE1__I2C2_SDA IOMUX_MODE(MX31_PIN_DCD_DTE1, IOMUX_CONFIG_ALT2)
604#define MX31_PIN_RI_DTE1__I2C2_SCL IOMUX_MODE(MX31_PIN_RI_DTE1, IOMUX_CONFIG_ALT2) 604#define MX31_PIN_RI_DTE1__I2C2_SCL IOMUX_MODE(MX31_PIN_RI_DTE1, IOMUX_CONFIG_ALT2)
605#define MX31_PIN_CSPI2_SS2__I2C3_SDA IOMUX_MODE(MX31_PIN_CSPI2_SS2, IOMUX_CONFIG_ALT1)
606#define MX31_PIN_CSPI2_SCLK__I2C3_SCL IOMUX_MODE(MX31_PIN_CSPI2_SCLK, IOMUX_CONFIG_ALT1)
605#define MX31_PIN_CSI_D4__CSI_D4 IOMUX_MODE(MX31_PIN_CSI_D4, IOMUX_CONFIG_FUNC) 607#define MX31_PIN_CSI_D4__CSI_D4 IOMUX_MODE(MX31_PIN_CSI_D4, IOMUX_CONFIG_FUNC)
606#define MX31_PIN_CSI_D5__CSI_D5 IOMUX_MODE(MX31_PIN_CSI_D5, IOMUX_CONFIG_FUNC) 608#define MX31_PIN_CSI_D5__CSI_D5 IOMUX_MODE(MX31_PIN_CSI_D5, IOMUX_CONFIG_FUNC)
607#define MX31_PIN_CSI_D6__CSI_D6 IOMUX_MODE(MX31_PIN_CSI_D6, IOMUX_CONFIG_FUNC) 609#define MX31_PIN_CSI_D6__CSI_D6 IOMUX_MODE(MX31_PIN_CSI_D6, IOMUX_CONFIG_FUNC)
diff --git a/arch/arm/plat-omap/dma.c b/arch/arm/plat-omap/dma.c
index def14ec265b3..7677a4a1cef2 100644
--- a/arch/arm/plat-omap/dma.c
+++ b/arch/arm/plat-omap/dma.c
@@ -2457,6 +2457,19 @@ static int __init omap_init_dma(void)
2457 setup_irq(irq, &omap24xx_dma_irq); 2457 setup_irq(irq, &omap24xx_dma_irq);
2458 } 2458 }
2459 2459
2460 /* Enable smartidle idlemodes and autoidle */
2461 if (cpu_is_omap34xx()) {
2462 u32 v = dma_read(OCP_SYSCONFIG);
2463 v &= ~(DMA_SYSCONFIG_MIDLEMODE_MASK |
2464 DMA_SYSCONFIG_SIDLEMODE_MASK |
2465 DMA_SYSCONFIG_AUTOIDLE);
2466 v |= (DMA_SYSCONFIG_MIDLEMODE(DMA_IDLEMODE_SMARTIDLE) |
2467 DMA_SYSCONFIG_SIDLEMODE(DMA_IDLEMODE_SMARTIDLE) |
2468 DMA_SYSCONFIG_AUTOIDLE);
2469 dma_write(v , OCP_SYSCONFIG);
2470 }
2471
2472
2460 /* FIXME: Update LCD DMA to work on 24xx */ 2473 /* FIXME: Update LCD DMA to work on 24xx */
2461 if (cpu_class_is_omap1()) { 2474 if (cpu_class_is_omap1()) {
2462 r = request_irq(INT_DMA_LCD, lcd_dma_irq_handler, 0, 2475 r = request_irq(INT_DMA_LCD, lcd_dma_irq_handler, 0,
diff --git a/arch/arm/plat-omap/gpio.c b/arch/arm/plat-omap/gpio.c
index 7fd89ba8d3b5..26b387c12423 100644
--- a/arch/arm/plat-omap/gpio.c
+++ b/arch/arm/plat-omap/gpio.c
@@ -1585,6 +1585,7 @@ static int __init _omap_gpio_init(void)
1585 __raw_writel(0x00000000, bank->base + OMAP24XX_GPIO_IRQENABLE1); 1585 __raw_writel(0x00000000, bank->base + OMAP24XX_GPIO_IRQENABLE1);
1586 __raw_writel(0xffffffff, bank->base + OMAP24XX_GPIO_IRQSTATUS1); 1586 __raw_writel(0xffffffff, bank->base + OMAP24XX_GPIO_IRQSTATUS1);
1587 __raw_writew(0x0015, bank->base + OMAP24XX_GPIO_SYSCONFIG); 1587 __raw_writew(0x0015, bank->base + OMAP24XX_GPIO_SYSCONFIG);
1588 __raw_writel(0x00000000, bank->base + OMAP24XX_GPIO_DEBOUNCE_EN);
1588 1589
1589 /* Initialize interface clock ungated, module enabled */ 1590 /* Initialize interface clock ungated, module enabled */
1590 __raw_writel(0, bank->base + OMAP24XX_GPIO_CTRL); 1591 __raw_writel(0, bank->base + OMAP24XX_GPIO_CTRL);
diff --git a/arch/arm/plat-omap/include/mach/cpu.h b/arch/arm/plat-omap/include/mach/cpu.h
index fc60c4ebcc28..285eaa3a8275 100644
--- a/arch/arm/plat-omap/include/mach/cpu.h
+++ b/arch/arm/plat-omap/include/mach/cpu.h
@@ -30,6 +30,17 @@
30#ifndef __ASM_ARCH_OMAP_CPU_H 30#ifndef __ASM_ARCH_OMAP_CPU_H
31#define __ASM_ARCH_OMAP_CPU_H 31#define __ASM_ARCH_OMAP_CPU_H
32 32
33/*
34 * Omap device type i.e. EMU/HS/TST/GP/BAD
35 */
36#define OMAP2_DEVICE_TYPE_TEST 0
37#define OMAP2_DEVICE_TYPE_EMU 1
38#define OMAP2_DEVICE_TYPE_SEC 2
39#define OMAP2_DEVICE_TYPE_GP 3
40#define OMAP2_DEVICE_TYPE_BAD 4
41
42int omap_type(void);
43
33struct omap_chip_id { 44struct omap_chip_id {
34 u8 oc; 45 u8 oc;
35 u8 type; 46 u8 type;
@@ -424,17 +435,6 @@ IS_OMAP_TYPE(3430, 0x3430)
424 435
425 436
426int omap_chip_is(struct omap_chip_id oci); 437int omap_chip_is(struct omap_chip_id oci);
427int omap_type(void);
428
429/*
430 * Macro to detect device type i.e. EMU/HS/TST/GP/BAD
431 */
432#define OMAP2_DEVICE_TYPE_TEST 0
433#define OMAP2_DEVICE_TYPE_EMU 1
434#define OMAP2_DEVICE_TYPE_SEC 2
435#define OMAP2_DEVICE_TYPE_GP 3
436#define OMAP2_DEVICE_TYPE_BAD 4
437
438void omap2_check_revision(void); 438void omap2_check_revision(void);
439 439
440#endif /* defined(CONFIG_ARCH_OMAP2) || defined(CONFIG_ARCH_OMAP3) */ 440#endif /* defined(CONFIG_ARCH_OMAP2) || defined(CONFIG_ARCH_OMAP3) */
diff --git a/arch/arm/plat-omap/include/mach/dma.h b/arch/arm/plat-omap/include/mach/dma.h
index 8c1eae88737e..7b939cc01962 100644
--- a/arch/arm/plat-omap/include/mach/dma.h
+++ b/arch/arm/plat-omap/include/mach/dma.h
@@ -389,6 +389,21 @@
389#define DMA_THREAD_FIFO_25 (0x02 << 14) 389#define DMA_THREAD_FIFO_25 (0x02 << 14)
390#define DMA_THREAD_FIFO_50 (0x03 << 14) 390#define DMA_THREAD_FIFO_50 (0x03 << 14)
391 391
392/* DMA4_OCP_SYSCONFIG bits */
393#define DMA_SYSCONFIG_MIDLEMODE_MASK (3 << 12)
394#define DMA_SYSCONFIG_CLOCKACTIVITY_MASK (3 << 8)
395#define DMA_SYSCONFIG_EMUFREE (1 << 5)
396#define DMA_SYSCONFIG_SIDLEMODE_MASK (3 << 3)
397#define DMA_SYSCONFIG_SOFTRESET (1 << 2)
398#define DMA_SYSCONFIG_AUTOIDLE (1 << 0)
399
400#define DMA_SYSCONFIG_MIDLEMODE(n) ((n) << 12)
401#define DMA_SYSCONFIG_SIDLEMODE(n) ((n) << 3)
402
403#define DMA_IDLEMODE_SMARTIDLE 0x2
404#define DMA_IDLEMODE_NO_IDLE 0x1
405#define DMA_IDLEMODE_FORCE_IDLE 0x0
406
392/* Chaining modes*/ 407/* Chaining modes*/
393#ifndef CONFIG_ARCH_OMAP1 408#ifndef CONFIG_ARCH_OMAP1
394#define OMAP_DMA_STATIC_CHAIN 0x1 409#define OMAP_DMA_STATIC_CHAIN 0x1
diff --git a/arch/arm/plat-omap/include/mach/io.h b/arch/arm/plat-omap/include/mach/io.h
index 3b2814720569..73f483d56ca6 100644
--- a/arch/arm/plat-omap/include/mach/io.h
+++ b/arch/arm/plat-omap/include/mach/io.h
@@ -201,7 +201,7 @@
201#define OMAP2_IO_ADDRESS(pa) IOMEM(__OMAP2_IO_ADDRESS(pa)) 201#define OMAP2_IO_ADDRESS(pa) IOMEM(__OMAP2_IO_ADDRESS(pa))
202 202
203#ifdef __ASSEMBLER__ 203#ifdef __ASSEMBLER__
204#define IOMEM(x) x 204#define IOMEM(x) (x)
205#else 205#else
206#define IOMEM(x) ((void __force __iomem *)(x)) 206#define IOMEM(x) ((void __force __iomem *)(x))
207 207
diff --git a/arch/arm/plat-omap/iommu.c b/arch/arm/plat-omap/iommu.c
index 4cf449fa2cb5..4a0301399013 100644
--- a/arch/arm/plat-omap/iommu.c
+++ b/arch/arm/plat-omap/iommu.c
@@ -298,7 +298,7 @@ void flush_iotlb_page(struct iommu *obj, u32 da)
298 if ((start <= da) && (da < start + bytes)) { 298 if ((start <= da) && (da < start + bytes)) {
299 dev_dbg(obj->dev, "%s: %08x<=%08x(%x)\n", 299 dev_dbg(obj->dev, "%s: %08x<=%08x(%x)\n",
300 __func__, start, da, bytes); 300 __func__, start, da, bytes);
301 301 iotlb_load_cr(obj, &cr);
302 iommu_write_reg(obj, 1, MMU_FLUSH_ENTRY); 302 iommu_write_reg(obj, 1, MMU_FLUSH_ENTRY);
303 } 303 }
304 } 304 }
diff --git a/arch/arm/plat-omap/sram.c b/arch/arm/plat-omap/sram.c
index 65006df3f1b7..4ea73804d21e 100644
--- a/arch/arm/plat-omap/sram.c
+++ b/arch/arm/plat-omap/sram.c
@@ -133,7 +133,12 @@ void __init omap_detect_sram(void)
133 if (cpu_is_omap34xx()) { 133 if (cpu_is_omap34xx()) {
134 omap_sram_base = OMAP3_SRAM_PUB_VA; 134 omap_sram_base = OMAP3_SRAM_PUB_VA;
135 omap_sram_start = OMAP3_SRAM_PUB_PA; 135 omap_sram_start = OMAP3_SRAM_PUB_PA;
136 omap_sram_size = 0x8000; /* 32K */ 136 if ((omap_type() == OMAP2_DEVICE_TYPE_EMU) ||
137 (omap_type() == OMAP2_DEVICE_TYPE_SEC)) {
138 omap_sram_size = 0x7000; /* 28K */
139 } else {
140 omap_sram_size = 0x8000; /* 32K */
141 }
137 } else { 142 } else {
138 omap_sram_base = OMAP2_SRAM_PUB_VA; 143 omap_sram_base = OMAP2_SRAM_PUB_VA;
139 omap_sram_start = OMAP2_SRAM_PUB_PA; 144 omap_sram_start = OMAP2_SRAM_PUB_PA;
diff --git a/arch/arm/plat-pxa/gpio.c b/arch/arm/plat-pxa/gpio.c
index abc79d44acaa..98548c6903a0 100644
--- a/arch/arm/plat-pxa/gpio.c
+++ b/arch/arm/plat-pxa/gpio.c
@@ -16,7 +16,7 @@
16#include <linux/irq.h> 16#include <linux/irq.h>
17#include <linux/io.h> 17#include <linux/io.h>
18#include <linux/sysdev.h> 18#include <linux/sysdev.h>
19#include <linux/bootmem.h> 19#include <linux/slab.h>
20 20
21#include <mach/gpio.h> 21#include <mach/gpio.h>
22 22
@@ -112,17 +112,12 @@ static int __init pxa_init_gpio_chip(int gpio_end)
112 int i, gpio, nbanks = gpio_to_bank(gpio_end) + 1; 112 int i, gpio, nbanks = gpio_to_bank(gpio_end) + 1;
113 struct pxa_gpio_chip *chips; 113 struct pxa_gpio_chip *chips;
114 114
115 /* this is early, we have to use bootmem allocator, and we really 115 chips = kzalloc(nbanks * sizeof(struct pxa_gpio_chip), GFP_KERNEL);
116 * want this to be allocated dynamically for different 'gpio_end'
117 */
118 chips = alloc_bootmem_low(nbanks * sizeof(struct pxa_gpio_chip));
119 if (chips == NULL) { 116 if (chips == NULL) {
120 pr_err("%s: failed to allocate GPIO chips\n", __func__); 117 pr_err("%s: failed to allocate GPIO chips\n", __func__);
121 return -ENOMEM; 118 return -ENOMEM;
122 } 119 }
123 120
124 memset(chips, 0, nbanks * sizeof(struct pxa_gpio_chip));
125
126 for (i = 0, gpio = 0; i < nbanks; i++, gpio += 32) { 121 for (i = 0, gpio = 0; i < nbanks; i++, gpio += 32) {
127 struct gpio_chip *c = &chips[i].chip; 122 struct gpio_chip *c = &chips[i].chip;
128 123
diff --git a/arch/arm/plat-s3c/Makefile b/arch/arm/plat-s3c/Makefile
index 74bb7cb5da49..0761766b1833 100644
--- a/arch/arm/plat-s3c/Makefile
+++ b/arch/arm/plat-s3c/Makefile
@@ -34,7 +34,7 @@ obj-$(CONFIG_S3C_DEV_HSMMC) += dev-hsmmc.o
34obj-$(CONFIG_S3C_DEV_HSMMC1) += dev-hsmmc1.o 34obj-$(CONFIG_S3C_DEV_HSMMC1) += dev-hsmmc1.o
35obj-y += dev-i2c0.o 35obj-y += dev-i2c0.o
36obj-$(CONFIG_S3C_DEV_I2C1) += dev-i2c1.o 36obj-$(CONFIG_S3C_DEV_I2C1) += dev-i2c1.o
37obj-$(CONFIG_SND_S3C24XX_SOC) += dev-audio.o 37obj-$(CONFIG_SND_S3C64XX_SOC_I2S) += dev-audio.o
38obj-$(CONFIG_S3C_DEV_FB) += dev-fb.o 38obj-$(CONFIG_S3C_DEV_FB) += dev-fb.o
39obj-$(CONFIG_S3C_DEV_USB_HOST) += dev-usb.o 39obj-$(CONFIG_S3C_DEV_USB_HOST) += dev-usb.o
40obj-$(CONFIG_S3C_DEV_USB_HSOTG) += dev-usb-hsotg.o 40obj-$(CONFIG_S3C_DEV_USB_HSOTG) += dev-usb-hsotg.o
diff --git a/arch/arm/plat-s3c/include/plat/devs.h b/arch/arm/plat-s3c/include/plat/devs.h
index b5b9c4d46e9a..2e170827e0b0 100644
--- a/arch/arm/plat-s3c/include/plat/devs.h
+++ b/arch/arm/plat-s3c/include/plat/devs.h
@@ -37,6 +37,7 @@ extern struct platform_device s3c_device_i2c1;
37extern struct platform_device s3c_device_rtc; 37extern struct platform_device s3c_device_rtc;
38extern struct platform_device s3c_device_adc; 38extern struct platform_device s3c_device_adc;
39extern struct platform_device s3c_device_sdi; 39extern struct platform_device s3c_device_sdi;
40extern struct platform_device s3c_device_iis;
40extern struct platform_device s3c_device_hwmon; 41extern struct platform_device s3c_device_hwmon;
41extern struct platform_device s3c_device_hsmmc0; 42extern struct platform_device s3c_device_hsmmc0;
42extern struct platform_device s3c_device_hsmmc1; 43extern struct platform_device s3c_device_hsmmc1;
diff --git a/arch/arm/plat-s3c24xx/Makefile b/arch/arm/plat-s3c24xx/Makefile
index 636cb12711df..579a165c2827 100644
--- a/arch/arm/plat-s3c24xx/Makefile
+++ b/arch/arm/plat-s3c24xx/Makefile
@@ -29,7 +29,7 @@ obj-$(CONFIG_PM_SIMTEC) += pm-simtec.o
29obj-$(CONFIG_PM) += pm.o 29obj-$(CONFIG_PM) += pm.o
30obj-$(CONFIG_PM) += irq-pm.o 30obj-$(CONFIG_PM) += irq-pm.o
31obj-$(CONFIG_PM) += sleep.o 31obj-$(CONFIG_PM) += sleep.o
32obj-$(CONFIG_HAVE_PWM) += pwm.o 32obj-$(CONFIG_S3C24XX_PWM) += pwm.o
33obj-$(CONFIG_S3C2410_CLOCK) += s3c2410-clock.o 33obj-$(CONFIG_S3C2410_CLOCK) += s3c2410-clock.o
34obj-$(CONFIG_S3C2410_DMA) += dma.o 34obj-$(CONFIG_S3C2410_DMA) += dma.o
35obj-$(CONFIG_S3C24XX_ADC) += adc.o 35obj-$(CONFIG_S3C24XX_ADC) += adc.o
diff --git a/arch/arm/plat-s3c24xx/pwm.c b/arch/arm/plat-s3c24xx/pwm.c
index 0120b760315b..82a6d4de02a3 100644
--- a/arch/arm/plat-s3c24xx/pwm.c
+++ b/arch/arm/plat-s3c24xx/pwm.c
@@ -246,6 +246,10 @@ int pwm_config(struct pwm_device *pwm, int duty_ns, int period_ns)
246 246
247 tcmp = duty_ns / tin_ns; 247 tcmp = duty_ns / tin_ns;
248 tcmp = tcnt - tcmp; 248 tcmp = tcnt - tcmp;
249 /* the pwm hw only checks the compare register after a decrement,
250 so the pin never toggles if tcmp = tcnt */
251 if (tcmp == tcnt)
252 tcmp--;
249 253
250 pwm_dbg(pwm, "tin_ns=%lu, tcmp=%ld/%lu\n", tin_ns, tcmp, tcnt); 254 pwm_dbg(pwm, "tin_ns=%lu, tcmp=%ld/%lu\n", tin_ns, tcmp, tcnt);
251 255
diff --git a/arch/arm/plat-s3c24xx/spi-bus0-gpe11_12_13.c b/arch/arm/plat-s3c24xx/spi-bus0-gpe11_12_13.c
index 9edf7894eedd..da7a61728c18 100644
--- a/arch/arm/plat-s3c24xx/spi-bus0-gpe11_12_13.c
+++ b/arch/arm/plat-s3c24xx/spi-bus0-gpe11_12_13.c
@@ -12,8 +12,7 @@
12*/ 12*/
13 13
14#include <linux/kernel.h> 14#include <linux/kernel.h>
15 15#include <linux/gpio.h>
16#include <mach/hardware.h>
17 16
18#include <mach/spi.h> 17#include <mach/spi.h>
19#include <mach/regs-gpio.h> 18#include <mach/regs-gpio.h>
diff --git a/arch/arm/plat-s3c24xx/spi-bus1-gpg5_6_7.c b/arch/arm/plat-s3c24xx/spi-bus1-gpg5_6_7.c
index f34d0fc69ad8..86b9edc67413 100644
--- a/arch/arm/plat-s3c24xx/spi-bus1-gpg5_6_7.c
+++ b/arch/arm/plat-s3c24xx/spi-bus1-gpg5_6_7.c
@@ -12,8 +12,7 @@
12*/ 12*/
13 13
14#include <linux/kernel.h> 14#include <linux/kernel.h>
15 15#include <linux/gpio.h>
16#include <mach/hardware.h>
17 16
18#include <mach/spi.h> 17#include <mach/spi.h>
19#include <mach/regs-gpio.h> 18#include <mach/regs-gpio.h>
diff --git a/arch/arm/plat-s3c64xx/pm.c b/arch/arm/plat-s3c64xx/pm.c
index 07a6516a4f3c..47632fc7eb66 100644
--- a/arch/arm/plat-s3c64xx/pm.c
+++ b/arch/arm/plat-s3c64xx/pm.c
@@ -117,8 +117,6 @@ void s3c_pm_save_core(void)
117 * this. 117 * this.
118 */ 118 */
119 119
120#include <plat/regs-gpio.h>
121
122static void s3c64xx_cpu_suspend(void) 120static void s3c64xx_cpu_suspend(void)
123{ 121{
124 unsigned long tmp; 122 unsigned long tmp;
diff --git a/arch/arm/plat-s3c64xx/s3c6400-clock.c b/arch/arm/plat-s3c64xx/s3c6400-clock.c
index 1debc1f9f987..febac1950d8e 100644
--- a/arch/arm/plat-s3c64xx/s3c6400-clock.c
+++ b/arch/arm/plat-s3c64xx/s3c6400-clock.c
@@ -153,7 +153,7 @@ static unsigned long s3c64xx_clk_arm_round_rate(struct clk *clk,
153 u32 div; 153 u32 div;
154 154
155 if (parent < rate) 155 if (parent < rate)
156 return rate; 156 return parent;
157 157
158 div = (parent / rate) - 1; 158 div = (parent / rate) - 1;
159 if (div > armclk_mask) 159 if (div > armclk_mask)
@@ -175,7 +175,7 @@ static int s3c64xx_clk_arm_set_rate(struct clk *clk, unsigned long rate)
175 div = clk_get_rate(clk->parent) / rate; 175 div = clk_get_rate(clk->parent) / rate;
176 176
177 val = __raw_readl(S3C_CLK_DIV0); 177 val = __raw_readl(S3C_CLK_DIV0);
178 val &= armclk_mask; 178 val &= ~armclk_mask;
179 val |= (div - 1); 179 val |= (div - 1);
180 __raw_writel(val, S3C_CLK_DIV0); 180 __raw_writel(val, S3C_CLK_DIV0);
181 181
diff --git a/arch/arm/plat-stmp3xxx/pinmux.c b/arch/arm/plat-stmp3xxx/pinmux.c
index d41200382208..6d6b1a468eda 100644
--- a/arch/arm/plat-stmp3xxx/pinmux.c
+++ b/arch/arm/plat-stmp3xxx/pinmux.c
@@ -22,7 +22,6 @@
22#include <linux/sysdev.h> 22#include <linux/sysdev.h>
23#include <linux/string.h> 23#include <linux/string.h>
24#include <linux/bitops.h> 24#include <linux/bitops.h>
25#include <linux/sysdev.h>
26#include <linux/irq.h> 25#include <linux/irq.h>
27 26
28#include <mach/hardware.h> 27#include <mach/hardware.h>
diff --git a/arch/avr32/include/asm/pgalloc.h b/arch/avr32/include/asm/pgalloc.h
index 640821323943..92ecd8446ef8 100644
--- a/arch/avr32/include/asm/pgalloc.h
+++ b/arch/avr32/include/asm/pgalloc.h
@@ -83,7 +83,7 @@ static inline void pte_free(struct mm_struct *mm, pgtable_t pte)
83 quicklist_free_page(QUICK_PT, NULL, pte); 83 quicklist_free_page(QUICK_PT, NULL, pte);
84} 84}
85 85
86#define __pte_free_tlb(tlb,pte) \ 86#define __pte_free_tlb(tlb,pte,addr) \
87do { \ 87do { \
88 pgtable_page_dtor(pte); \ 88 pgtable_page_dtor(pte); \
89 tlb_remove_page((tlb), pte); \ 89 tlb_remove_page((tlb), pte); \
diff --git a/arch/avr32/include/asm/thread_info.h b/arch/avr32/include/asm/thread_info.h
index 4442f8d2d423..fc42de5ca209 100644
--- a/arch/avr32/include/asm/thread_info.h
+++ b/arch/avr32/include/asm/thread_info.h
@@ -40,7 +40,7 @@ struct thread_info {
40 .exec_domain = &default_exec_domain, \ 40 .exec_domain = &default_exec_domain, \
41 .flags = 0, \ 41 .flags = 0, \
42 .cpu = 0, \ 42 .cpu = 0, \
43 .preempt_count = 1, \ 43 .preempt_count = INIT_PREEMPT_COUNT, \
44 .restart_block = { \ 44 .restart_block = { \
45 .fn = do_no_restart_syscall \ 45 .fn = do_no_restart_syscall \
46 } \ 46 } \
diff --git a/arch/avr32/kernel/traps.c b/arch/avr32/kernel/traps.c
index 6e3d491184ea..b91b2044af9c 100644
--- a/arch/avr32/kernel/traps.c
+++ b/arch/avr32/kernel/traps.c
@@ -32,22 +32,25 @@ void NORET_TYPE die(const char *str, struct pt_regs *regs, long err)
32 spin_lock_irq(&die_lock); 32 spin_lock_irq(&die_lock);
33 bust_spinlocks(1); 33 bust_spinlocks(1);
34 34
35 printk(KERN_ALERT "Oops: %s, sig: %ld [#%d]\n" KERN_EMERG, 35 printk(KERN_ALERT "Oops: %s, sig: %ld [#%d]\n",
36 str, err, ++die_counter); 36 str, err, ++die_counter);
37
38 printk(KERN_EMERG);
39
37#ifdef CONFIG_PREEMPT 40#ifdef CONFIG_PREEMPT
38 printk("PREEMPT "); 41 printk(KERN_CONT "PREEMPT ");
39#endif 42#endif
40#ifdef CONFIG_FRAME_POINTER 43#ifdef CONFIG_FRAME_POINTER
41 printk("FRAME_POINTER "); 44 printk(KERN_CONT "FRAME_POINTER ");
42#endif 45#endif
43 if (current_cpu_data.features & AVR32_FEATURE_OCD) { 46 if (current_cpu_data.features & AVR32_FEATURE_OCD) {
44 unsigned long did = ocd_read(DID); 47 unsigned long did = ocd_read(DID);
45 printk("chip: 0x%03lx:0x%04lx rev %lu\n", 48 printk(KERN_CONT "chip: 0x%03lx:0x%04lx rev %lu\n",
46 (did >> 1) & 0x7ff, 49 (did >> 1) & 0x7ff,
47 (did >> 12) & 0x7fff, 50 (did >> 12) & 0x7fff,
48 (did >> 28) & 0xf); 51 (did >> 28) & 0xf);
49 } else { 52 } else {
50 printk("cpu: arch %u r%u / core %u r%u\n", 53 printk(KERN_CONT "cpu: arch %u r%u / core %u r%u\n",
51 current_cpu_data.arch_type, 54 current_cpu_data.arch_type,
52 current_cpu_data.arch_revision, 55 current_cpu_data.arch_revision,
53 current_cpu_data.cpu_type, 56 current_cpu_data.cpu_type,
diff --git a/arch/blackfin/include/asm/context.S b/arch/blackfin/include/asm/context.S
index 16561ab18b38..f8a664f022b1 100644
--- a/arch/blackfin/include/asm/context.S
+++ b/arch/blackfin/include/asm/context.S
@@ -223,9 +223,10 @@
223 [--sp] = RETN; 223 [--sp] = RETN;
224 [--sp] = RETE; 224 [--sp] = RETE;
225 [--sp] = SEQSTAT; 225 [--sp] = SEQSTAT;
226#ifdef CONFIG_KGDB 226#ifdef CONFIG_DEBUG_KERNEL
227 r1.l = lo(IPEND); 227 p1.l = lo(IPEND);
228 r1.h = hi(IPEND); 228 p1.h = hi(IPEND);
229 r1 = [p1];
229 [--sp] = r1; 230 [--sp] = r1;
230#else 231#else
231 [--sp] = r0; /* Skip IPEND as well. */ 232 [--sp] = r0; /* Skip IPEND as well. */
diff --git a/arch/blackfin/include/asm/cpu.h b/arch/blackfin/include/asm/cpu.h
index 565b8136855e..fadfa82f93b2 100644
--- a/arch/blackfin/include/asm/cpu.h
+++ b/arch/blackfin/include/asm/cpu.h
@@ -32,7 +32,6 @@ struct blackfin_cpudata {
32 struct task_struct *idle; 32 struct task_struct *idle;
33 unsigned int imemctl; 33 unsigned int imemctl;
34 unsigned int dmemctl; 34 unsigned int dmemctl;
35 unsigned long loops_per_jiffy;
36 unsigned long dcache_invld_count; 35 unsigned long dcache_invld_count;
37 unsigned long icache_invld_count; 36 unsigned long icache_invld_count;
38}; 37};
diff --git a/arch/blackfin/include/asm/hardirq.h b/arch/blackfin/include/asm/hardirq.h
index cbd52f86bb9f..0b78b873df51 100644
--- a/arch/blackfin/include/asm/hardirq.h
+++ b/arch/blackfin/include/asm/hardirq.h
@@ -6,6 +6,9 @@
6extern void ack_bad_irq(unsigned int irq); 6extern void ack_bad_irq(unsigned int irq);
7#define ack_bad_irq ack_bad_irq 7#define ack_bad_irq ack_bad_irq
8 8
9/* Define until common code gets sane defaults */
10#define HARDIRQ_BITS 9
11
9#include <asm-generic/hardirq.h> 12#include <asm-generic/hardirq.h>
10 13
11#endif 14#endif
diff --git a/arch/blackfin/include/asm/processor.h b/arch/blackfin/include/asm/processor.h
index d0be99be8308..a36ad8dac068 100644
--- a/arch/blackfin/include/asm/processor.h
+++ b/arch/blackfin/include/asm/processor.h
@@ -105,23 +105,16 @@ static inline uint32_t __pure bfin_revid(void)
105 /* Always use CHIPID, to work around ANOMALY_05000234 */ 105 /* Always use CHIPID, to work around ANOMALY_05000234 */
106 uint32_t revid = (bfin_read_CHIPID() & CHIPID_VERSION) >> 28; 106 uint32_t revid = (bfin_read_CHIPID() & CHIPID_VERSION) >> 28;
107 107
108#ifdef CONFIG_BF52x 108#ifdef _BOOTROM_GET_DXE_ADDRESS_TWI
109 /* ANOMALY_05000357 109 /*
110 * ANOMALY_05000364
110 * Incorrect Revision Number in DSPID Register 111 * Incorrect Revision Number in DSPID Register
111 */ 112 */
112 if (revid == 0) 113 if (ANOMALY_05000364 &&
113 switch (bfin_read16(_BOOTROM_GET_DXE_ADDRESS_TWI)) { 114 bfin_read16(_BOOTROM_GET_DXE_ADDRESS_TWI) == 0x2796)
114 case 0x0010: 115 revid = 1;
115 revid = 0;
116 break;
117 case 0x2796:
118 revid = 1;
119 break;
120 default:
121 revid = 0xFFFF;
122 break;
123 }
124#endif 116#endif
117
125 return revid; 118 return revid;
126} 119}
127 120
diff --git a/arch/blackfin/include/asm/thread_info.h b/arch/blackfin/include/asm/thread_info.h
index 2920087516f2..2bbfdd950afc 100644
--- a/arch/blackfin/include/asm/thread_info.h
+++ b/arch/blackfin/include/asm/thread_info.h
@@ -77,7 +77,7 @@ struct thread_info {
77 .exec_domain = &default_exec_domain, \ 77 .exec_domain = &default_exec_domain, \
78 .flags = 0, \ 78 .flags = 0, \
79 .cpu = 0, \ 79 .cpu = 0, \
80 .preempt_count = 1, \ 80 .preempt_count = INIT_PREEMPT_COUNT, \
81 .restart_block = { \ 81 .restart_block = { \
82 .fn = do_no_restart_syscall, \ 82 .fn = do_no_restart_syscall, \
83 }, \ 83 }, \
diff --git a/arch/blackfin/kernel/bfin_dma_5xx.c b/arch/blackfin/kernel/bfin_dma_5xx.c
index e0bf8cc06907..9f9b82816652 100644
--- a/arch/blackfin/kernel/bfin_dma_5xx.c
+++ b/arch/blackfin/kernel/bfin_dma_5xx.c
@@ -253,32 +253,31 @@ void __init early_dma_memcpy(void *pdst, const void *psrc, size_t size)
253 BUG_ON(src % 4); 253 BUG_ON(src % 4);
254 BUG_ON(size % 4); 254 BUG_ON(size % 4);
255 255
256 /* Force a sync in case a previous config reset on this channel
257 * occurred. This is needed so subsequent writes to DMA registers
258 * are not spuriously lost/corrupted.
259 */
260 __builtin_bfin_ssync();
261
262 src_ch = 0; 256 src_ch = 0;
263 /* Find an avalible memDMA channel */ 257 /* Find an avalible memDMA channel */
264 while (1) { 258 while (1) {
265 if (!src_ch || src_ch == (struct dma_register *)MDMA_S1_NEXT_DESC_PTR) { 259 if (src_ch == (struct dma_register *)MDMA_S0_NEXT_DESC_PTR) {
266 dst_ch = (struct dma_register *)MDMA_D0_NEXT_DESC_PTR;
267 src_ch = (struct dma_register *)MDMA_S0_NEXT_DESC_PTR;
268 } else {
269 dst_ch = (struct dma_register *)MDMA_D1_NEXT_DESC_PTR; 260 dst_ch = (struct dma_register *)MDMA_D1_NEXT_DESC_PTR;
270 src_ch = (struct dma_register *)MDMA_S1_NEXT_DESC_PTR; 261 src_ch = (struct dma_register *)MDMA_S1_NEXT_DESC_PTR;
262 } else {
263 dst_ch = (struct dma_register *)MDMA_D0_NEXT_DESC_PTR;
264 src_ch = (struct dma_register *)MDMA_S0_NEXT_DESC_PTR;
271 } 265 }
272 266
273 if (!bfin_read16(&src_ch->cfg)) { 267 if (!bfin_read16(&src_ch->cfg))
268 break;
269 else if (bfin_read16(&dst_ch->irq_status) & DMA_DONE) {
270 bfin_write16(&src_ch->cfg, 0);
274 break; 271 break;
275 } else {
276 if (bfin_read16(&src_ch->irq_status) & DMA_DONE)
277 bfin_write16(&src_ch->cfg, 0);
278 } 272 }
279
280 } 273 }
281 274
275 /* Force a sync in case a previous config reset on this channel
276 * occurred. This is needed so subsequent writes to DMA registers
277 * are not spuriously lost/corrupted.
278 */
279 __builtin_bfin_ssync();
280
282 /* Destination */ 281 /* Destination */
283 bfin_write32(&dst_ch->start_addr, dst); 282 bfin_write32(&dst_ch->start_addr, dst);
284 bfin_write16(&dst_ch->x_count, size >> 2); 283 bfin_write16(&dst_ch->x_count, size >> 2);
diff --git a/arch/blackfin/kernel/bfin_gpio.c b/arch/blackfin/kernel/bfin_gpio.c
index beffa00a93c3..6b9446271371 100644
--- a/arch/blackfin/kernel/bfin_gpio.c
+++ b/arch/blackfin/kernel/bfin_gpio.c
@@ -686,14 +686,12 @@ void bfin_gpio_pm_hibernate_restore(void)
686 *port_fer[bank] = gpio_bank_saved[bank].fer; 686 *port_fer[bank] = gpio_bank_saved[bank].fer;
687#endif 687#endif
688 gpio_array[bank]->inen = gpio_bank_saved[bank].inen; 688 gpio_array[bank]->inen = gpio_bank_saved[bank].inen;
689 gpio_array[bank]->data_set = gpio_bank_saved[bank].data
690 & gpio_bank_saved[bank].dir;
689 gpio_array[bank]->dir = gpio_bank_saved[bank].dir; 691 gpio_array[bank]->dir = gpio_bank_saved[bank].dir;
690 gpio_array[bank]->polar = gpio_bank_saved[bank].polar; 692 gpio_array[bank]->polar = gpio_bank_saved[bank].polar;
691 gpio_array[bank]->edge = gpio_bank_saved[bank].edge; 693 gpio_array[bank]->edge = gpio_bank_saved[bank].edge;
692 gpio_array[bank]->both = gpio_bank_saved[bank].both; 694 gpio_array[bank]->both = gpio_bank_saved[bank].both;
693
694 gpio_array[bank]->data_set = gpio_bank_saved[bank].data
695 | gpio_bank_saved[bank].dir;
696
697 gpio_array[bank]->maska = gpio_bank_saved[bank].maska; 695 gpio_array[bank]->maska = gpio_bank_saved[bank].maska;
698 } 696 }
699 AWA_DUMMY_READ(maska); 697 AWA_DUMMY_READ(maska);
diff --git a/arch/blackfin/kernel/cplb-nompu/cplbinit.c b/arch/blackfin/kernel/cplb-nompu/cplbinit.c
index d6c067782e63..685f160a5a36 100644
--- a/arch/blackfin/kernel/cplb-nompu/cplbinit.c
+++ b/arch/blackfin/kernel/cplb-nompu/cplbinit.c
@@ -72,13 +72,24 @@ void __init generate_cplb_tables_cpu(unsigned int cpu)
72 } 72 }
73 73
74 /* Cover L1 memory. One 4M area for code and data each is enough. */ 74 /* Cover L1 memory. One 4M area for code and data each is enough. */
75 if (L1_DATA_A_LENGTH || L1_DATA_B_LENGTH) { 75 if (cpu == 0) {
76 d_tbl[i_d].addr = L1_DATA_A_START; 76 if (L1_DATA_A_LENGTH || L1_DATA_B_LENGTH) {
77 d_tbl[i_d++].data = L1_DMEMORY | PAGE_SIZE_4MB; 77 d_tbl[i_d].addr = L1_DATA_A_START;
78 d_tbl[i_d++].data = L1_DMEMORY | PAGE_SIZE_4MB;
79 }
80 i_tbl[i_i].addr = L1_CODE_START;
81 i_tbl[i_i++].data = L1_IMEMORY | PAGE_SIZE_4MB;
78 } 82 }
79 i_tbl[i_i].addr = L1_CODE_START; 83#ifdef CONFIG_SMP
80 i_tbl[i_i++].data = L1_IMEMORY | PAGE_SIZE_4MB; 84 else {
81 85 if (L1_DATA_A_LENGTH || L1_DATA_B_LENGTH) {
86 d_tbl[i_d].addr = COREB_L1_DATA_A_START;
87 d_tbl[i_d++].data = L1_DMEMORY | PAGE_SIZE_4MB;
88 }
89 i_tbl[i_i].addr = COREB_L1_CODE_START;
90 i_tbl[i_i++].data = L1_IMEMORY | PAGE_SIZE_4MB;
91 }
92#endif
82 first_switched_dcplb = i_d; 93 first_switched_dcplb = i_d;
83 first_switched_icplb = i_i; 94 first_switched_icplb = i_i;
84 95
diff --git a/arch/blackfin/kernel/process.c b/arch/blackfin/kernel/process.c
index 79cad0ac5892..9da36bab7ccb 100644
--- a/arch/blackfin/kernel/process.c
+++ b/arch/blackfin/kernel/process.c
@@ -361,7 +361,7 @@ static inline
361int in_mem_const(unsigned long addr, unsigned long size, 361int in_mem_const(unsigned long addr, unsigned long size,
362 unsigned long const_addr, unsigned long const_size) 362 unsigned long const_addr, unsigned long const_size)
363{ 363{
364 return in_mem_const_off(addr, 0, size, const_addr, const_size); 364 return in_mem_const_off(addr, size, 0, const_addr, const_size);
365} 365}
366#define IN_ASYNC(bnum, bctlnum) \ 366#define IN_ASYNC(bnum, bctlnum) \
367({ \ 367({ \
@@ -390,13 +390,13 @@ int bfin_mem_access_type(unsigned long addr, unsigned long size)
390 if (in_mem_const(addr, size, L1_DATA_B_START, L1_DATA_B_LENGTH)) 390 if (in_mem_const(addr, size, L1_DATA_B_START, L1_DATA_B_LENGTH))
391 return cpu == 0 ? BFIN_MEM_ACCESS_CORE : BFIN_MEM_ACCESS_IDMA; 391 return cpu == 0 ? BFIN_MEM_ACCESS_CORE : BFIN_MEM_ACCESS_IDMA;
392#ifdef COREB_L1_CODE_START 392#ifdef COREB_L1_CODE_START
393 if (in_mem_const(addr, size, COREB_L1_CODE_START, L1_CODE_LENGTH)) 393 if (in_mem_const(addr, size, COREB_L1_CODE_START, COREB_L1_CODE_LENGTH))
394 return cpu == 1 ? BFIN_MEM_ACCESS_ITEST : BFIN_MEM_ACCESS_IDMA; 394 return cpu == 1 ? BFIN_MEM_ACCESS_ITEST : BFIN_MEM_ACCESS_IDMA;
395 if (in_mem_const(addr, size, COREB_L1_SCRATCH_START, L1_SCRATCH_LENGTH)) 395 if (in_mem_const(addr, size, COREB_L1_SCRATCH_START, L1_SCRATCH_LENGTH))
396 return cpu == 1 ? BFIN_MEM_ACCESS_CORE_ONLY : -EFAULT; 396 return cpu == 1 ? BFIN_MEM_ACCESS_CORE_ONLY : -EFAULT;
397 if (in_mem_const(addr, size, COREB_L1_DATA_A_START, L1_DATA_A_LENGTH)) 397 if (in_mem_const(addr, size, COREB_L1_DATA_A_START, COREB_L1_DATA_A_LENGTH))
398 return cpu == 1 ? BFIN_MEM_ACCESS_CORE : BFIN_MEM_ACCESS_IDMA; 398 return cpu == 1 ? BFIN_MEM_ACCESS_CORE : BFIN_MEM_ACCESS_IDMA;
399 if (in_mem_const(addr, size, COREB_L1_DATA_B_START, L1_DATA_B_LENGTH)) 399 if (in_mem_const(addr, size, COREB_L1_DATA_B_START, COREB_L1_DATA_B_LENGTH))
400 return cpu == 1 ? BFIN_MEM_ACCESS_CORE : BFIN_MEM_ACCESS_IDMA; 400 return cpu == 1 ? BFIN_MEM_ACCESS_CORE : BFIN_MEM_ACCESS_IDMA;
401#endif 401#endif
402 if (in_mem_const(addr, size, L2_START, L2_LENGTH)) 402 if (in_mem_const(addr, size, L2_START, L2_LENGTH))
@@ -472,13 +472,13 @@ int _access_ok(unsigned long addr, unsigned long size)
472 if (in_mem_const_off(addr, size, _ebss_b_l1 - _sdata_b_l1, L1_DATA_B_START, L1_DATA_B_LENGTH)) 472 if (in_mem_const_off(addr, size, _ebss_b_l1 - _sdata_b_l1, L1_DATA_B_START, L1_DATA_B_LENGTH))
473 return 1; 473 return 1;
474#ifdef COREB_L1_CODE_START 474#ifdef COREB_L1_CODE_START
475 if (in_mem_const(addr, size, COREB_L1_CODE_START, L1_CODE_LENGTH)) 475 if (in_mem_const(addr, size, COREB_L1_CODE_START, COREB_L1_CODE_LENGTH))
476 return 1; 476 return 1;
477 if (in_mem_const(addr, size, COREB_L1_SCRATCH_START, L1_SCRATCH_LENGTH)) 477 if (in_mem_const(addr, size, COREB_L1_SCRATCH_START, L1_SCRATCH_LENGTH))
478 return 1; 478 return 1;
479 if (in_mem_const(addr, size, COREB_L1_DATA_A_START, L1_DATA_A_LENGTH)) 479 if (in_mem_const(addr, size, COREB_L1_DATA_A_START, COREB_L1_DATA_A_LENGTH))
480 return 1; 480 return 1;
481 if (in_mem_const(addr, size, COREB_L1_DATA_B_START, L1_DATA_B_LENGTH)) 481 if (in_mem_const(addr, size, COREB_L1_DATA_B_START, COREB_L1_DATA_B_LENGTH))
482 return 1; 482 return 1;
483#endif 483#endif
484 if (in_mem_const_off(addr, size, _ebss_l2 - _stext_l2, L2_START, L2_LENGTH)) 484 if (in_mem_const_off(addr, size, _ebss_l2 - _stext_l2, L2_START, L2_LENGTH))
diff --git a/arch/blackfin/kernel/ptrace.c b/arch/blackfin/kernel/ptrace.c
index d76618db50df..6a387eec6b65 100644
--- a/arch/blackfin/kernel/ptrace.c
+++ b/arch/blackfin/kernel/ptrace.c
@@ -31,7 +31,6 @@
31#include <linux/sched.h> 31#include <linux/sched.h>
32#include <linux/mm.h> 32#include <linux/mm.h>
33#include <linux/smp.h> 33#include <linux/smp.h>
34#include <linux/smp_lock.h>
35#include <linux/errno.h> 34#include <linux/errno.h>
36#include <linux/ptrace.h> 35#include <linux/ptrace.h>
37#include <linux/user.h> 36#include <linux/user.h>
diff --git a/arch/blackfin/kernel/setup.c b/arch/blackfin/kernel/setup.c
index 298f023bcc09..6225edae488e 100644
--- a/arch/blackfin/kernel/setup.c
+++ b/arch/blackfin/kernel/setup.c
@@ -168,7 +168,6 @@ void __cpuinit bfin_setup_cpudata(unsigned int cpu)
168 struct blackfin_cpudata *cpudata = &per_cpu(cpu_data, cpu); 168 struct blackfin_cpudata *cpudata = &per_cpu(cpu_data, cpu);
169 169
170 cpudata->idle = current; 170 cpudata->idle = current;
171 cpudata->loops_per_jiffy = loops_per_jiffy;
172 cpudata->imemctl = bfin_read_IMEM_CONTROL(); 171 cpudata->imemctl = bfin_read_IMEM_CONTROL();
173 cpudata->dmemctl = bfin_read_DMEM_CONTROL(); 172 cpudata->dmemctl = bfin_read_DMEM_CONTROL();
174} 173}
@@ -408,13 +407,14 @@ static void __init print_memory_map(char *who)
408 bfin_memmap.map[i].addr + bfin_memmap.map[i].size); 407 bfin_memmap.map[i].addr + bfin_memmap.map[i].size);
409 switch (bfin_memmap.map[i].type) { 408 switch (bfin_memmap.map[i].type) {
410 case BFIN_MEMMAP_RAM: 409 case BFIN_MEMMAP_RAM:
411 printk("(usable)\n"); 410 printk(KERN_CONT "(usable)\n");
412 break; 411 break;
413 case BFIN_MEMMAP_RESERVED: 412 case BFIN_MEMMAP_RESERVED:
414 printk("(reserved)\n"); 413 printk(KERN_CONT "(reserved)\n");
415 break; 414 break;
416 default: printk("type %lu\n", bfin_memmap.map[i].type); 415 default:
417 break; 416 printk(KERN_CONT "type %lu\n", bfin_memmap.map[i].type);
417 break;
418 } 418 }
419 } 419 }
420} 420}
@@ -567,17 +567,23 @@ static __init void memory_setup(void)
567# endif /* ANOMALY_05000263 */ 567# endif /* ANOMALY_05000263 */
568# endif /* CONFIG_ROMFS_FS */ 568# endif /* CONFIG_ROMFS_FS */
569 569
570 memory_end -= mtd_size; 570 /* Since the default MTD_UCLINUX has no magic number, we just blindly
571 571 * read 8 past the end of the kernel's image, and look at it.
572 if (mtd_size == 0) { 572 * When no image is attached, mtd_size is set to a random number
573 console_init(); 573 * Do some basic sanity checks before operating on things
574 panic("Don't boot kernel without rootfs attached."); 574 */
575 if (mtd_size == 0 || memory_end <= mtd_size) {
576 pr_emerg("Could not find valid ram mtd attached.\n");
577 } else {
578 memory_end -= mtd_size;
579
580 /* Relocate MTD image to the top of memory after the uncached memory area */
581 uclinux_ram_map.phys = memory_mtd_start = memory_end;
582 uclinux_ram_map.size = mtd_size;
583 pr_info("Found mtd parition at 0x%p, (len=0x%lx), moving to 0x%p\n",
584 _end, mtd_size, (void *)memory_mtd_start);
585 dma_memcpy((void *)uclinux_ram_map.phys, _end, uclinux_ram_map.size);
575 } 586 }
576
577 /* Relocate MTD image to the top of memory after the uncached memory area */
578 uclinux_ram_map.phys = memory_mtd_start = memory_end;
579 uclinux_ram_map.size = mtd_size;
580 dma_memcpy((void *)uclinux_ram_map.phys, _end, uclinux_ram_map.size);
581#endif /* CONFIG_MTD_UCLINUX */ 587#endif /* CONFIG_MTD_UCLINUX */
582 588
583#if (defined(CONFIG_BFIN_EXTMEM_ICACHEABLE) && ANOMALY_05000263) 589#if (defined(CONFIG_BFIN_EXTMEM_ICACHEABLE) && ANOMALY_05000263)
@@ -614,19 +620,19 @@ static __init void memory_setup(void)
614 printk(KERN_INFO "Kernel Managed Memory: %ldMB\n", _ramend >> 20); 620 printk(KERN_INFO "Kernel Managed Memory: %ldMB\n", _ramend >> 20);
615 621
616 printk(KERN_INFO "Memory map:\n" 622 printk(KERN_INFO "Memory map:\n"
617 KERN_INFO " fixedcode = 0x%p-0x%p\n" 623 " fixedcode = 0x%p-0x%p\n"
618 KERN_INFO " text = 0x%p-0x%p\n" 624 " text = 0x%p-0x%p\n"
619 KERN_INFO " rodata = 0x%p-0x%p\n" 625 " rodata = 0x%p-0x%p\n"
620 KERN_INFO " bss = 0x%p-0x%p\n" 626 " bss = 0x%p-0x%p\n"
621 KERN_INFO " data = 0x%p-0x%p\n" 627 " data = 0x%p-0x%p\n"
622 KERN_INFO " stack = 0x%p-0x%p\n" 628 " stack = 0x%p-0x%p\n"
623 KERN_INFO " init = 0x%p-0x%p\n" 629 " init = 0x%p-0x%p\n"
624 KERN_INFO " available = 0x%p-0x%p\n" 630 " available = 0x%p-0x%p\n"
625#ifdef CONFIG_MTD_UCLINUX 631#ifdef CONFIG_MTD_UCLINUX
626 KERN_INFO " rootfs = 0x%p-0x%p\n" 632 " rootfs = 0x%p-0x%p\n"
627#endif 633#endif
628#if DMA_UNCACHED_REGION > 0 634#if DMA_UNCACHED_REGION > 0
629 KERN_INFO " DMA Zone = 0x%p-0x%p\n" 635 " DMA Zone = 0x%p-0x%p\n"
630#endif 636#endif
631 , (void *)FIXED_CODE_START, (void *)FIXED_CODE_END, 637 , (void *)FIXED_CODE_START, (void *)FIXED_CODE_END,
632 _stext, _etext, 638 _stext, _etext,
@@ -859,20 +865,13 @@ void __init setup_arch(char **cmdline_p)
859#endif 865#endif
860 printk(KERN_INFO "Hardware Trace "); 866 printk(KERN_INFO "Hardware Trace ");
861 if (bfin_read_TBUFCTL() & 0x1) 867 if (bfin_read_TBUFCTL() & 0x1)
862 printk("Active "); 868 printk(KERN_CONT "Active ");
863 else 869 else
864 printk("Off "); 870 printk(KERN_CONT "Off ");
865 if (bfin_read_TBUFCTL() & 0x2) 871 if (bfin_read_TBUFCTL() & 0x2)
866 printk("and Enabled\n"); 872 printk(KERN_CONT "and Enabled\n");
867 else 873 else
868 printk("and Disabled\n"); 874 printk(KERN_CONT "and Disabled\n");
869
870#if defined(CONFIG_CHR_DEV_FLASH) || defined(CONFIG_BLK_DEV_FLASH)
871 /* we need to initialize the Flashrom device here since we might
872 * do things with flash early on in the boot
873 */
874 flash_probe();
875#endif
876 875
877 printk(KERN_INFO "Boot Mode: %i\n", bfin_read_SYSCR() & 0xF); 876 printk(KERN_INFO "Boot Mode: %i\n", bfin_read_SYSCR() & 0xF);
878 877
@@ -937,10 +936,6 @@ void __init setup_arch(char **cmdline_p)
937 CPU, bfin_revid()); 936 CPU, bfin_revid());
938 } 937 }
939 938
940 /* We can't run on BF548-0.1 due to ANOMALY 05000448 */
941 if (bfin_cpuid() == 0x27de && bfin_revid() == 1)
942 panic("You can't run on this processor due to 05000448");
943
944 printk(KERN_INFO "Blackfin Linux support by http://blackfin.uclinux.org/\n"); 939 printk(KERN_INFO "Blackfin Linux support by http://blackfin.uclinux.org/\n");
945 940
946 printk(KERN_INFO "Processor Speed: %lu MHz core clock and %lu MHz System Clock\n", 941 printk(KERN_INFO "Processor Speed: %lu MHz core clock and %lu MHz System Clock\n",
@@ -1163,9 +1158,9 @@ static int show_cpuinfo(struct seq_file *m, void *v)
1163 sclk/1000000, sclk%1000000); 1158 sclk/1000000, sclk%1000000);
1164 seq_printf(m, "bogomips\t: %lu.%02lu\n" 1159 seq_printf(m, "bogomips\t: %lu.%02lu\n"
1165 "Calibration\t: %lu loops\n", 1160 "Calibration\t: %lu loops\n",
1166 (cpudata->loops_per_jiffy * HZ) / 500000, 1161 (loops_per_jiffy * HZ) / 500000,
1167 ((cpudata->loops_per_jiffy * HZ) / 5000) % 100, 1162 ((loops_per_jiffy * HZ) / 5000) % 100,
1168 (cpudata->loops_per_jiffy * HZ)); 1163 (loops_per_jiffy * HZ));
1169 1164
1170 /* Check Cache configutation */ 1165 /* Check Cache configutation */
1171 switch (cpudata->dmemctl & (1 << DMC0_P | 1 << DMC1_P)) { 1166 switch (cpudata->dmemctl & (1 << DMC0_P | 1 << DMC1_P)) {
diff --git a/arch/blackfin/kernel/sys_bfin.c b/arch/blackfin/kernel/sys_bfin.c
index a8f1329c15a4..3da60fb13ce4 100644
--- a/arch/blackfin/kernel/sys_bfin.c
+++ b/arch/blackfin/kernel/sys_bfin.c
@@ -29,7 +29,6 @@
29 * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 29 * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
30 */ 30 */
31 31
32#include <linux/smp_lock.h>
33#include <linux/spinlock.h> 32#include <linux/spinlock.h>
34#include <linux/sem.h> 33#include <linux/sem.h>
35#include <linux/msg.h> 34#include <linux/msg.h>
diff --git a/arch/blackfin/kernel/traps.c b/arch/blackfin/kernel/traps.c
index 8eeb457ce5d5..bf2b2d1f8ae5 100644
--- a/arch/blackfin/kernel/traps.c
+++ b/arch/blackfin/kernel/traps.c
@@ -212,7 +212,7 @@ asmlinkage void double_fault_c(struct pt_regs *fp)
212 console_verbose(); 212 console_verbose();
213 oops_in_progress = 1; 213 oops_in_progress = 1;
214#ifdef CONFIG_DEBUG_VERBOSE 214#ifdef CONFIG_DEBUG_VERBOSE
215 printk(KERN_EMERG "\n" KERN_EMERG "Double Fault\n"); 215 printk(KERN_EMERG "Double Fault\n");
216#ifdef CONFIG_DEBUG_DOUBLEFAULT_PRINT 216#ifdef CONFIG_DEBUG_DOUBLEFAULT_PRINT
217 if (((long)fp->seqstat & SEQSTAT_EXCAUSE) == VEC_UNCOV) { 217 if (((long)fp->seqstat & SEQSTAT_EXCAUSE) == VEC_UNCOV) {
218 unsigned int cpu = smp_processor_id(); 218 unsigned int cpu = smp_processor_id();
@@ -570,11 +570,12 @@ asmlinkage void trap_c(struct pt_regs *fp)
570 if (kernel_mode_regs(fp) || (current && !current->mm)) { 570 if (kernel_mode_regs(fp) || (current && !current->mm)) {
571 console_verbose(); 571 console_verbose();
572 oops_in_progress = 1; 572 oops_in_progress = 1;
573 if (strerror)
574 verbose_printk(strerror);
575 } 573 }
576 574
577 if (sig != SIGTRAP) { 575 if (sig != SIGTRAP) {
576 if (strerror)
577 verbose_printk(strerror);
578
578 dump_bfin_process(fp); 579 dump_bfin_process(fp);
579 dump_bfin_mem(fp); 580 dump_bfin_mem(fp);
580 show_regs(fp); 581 show_regs(fp);
@@ -583,15 +584,14 @@ asmlinkage void trap_c(struct pt_regs *fp)
583#ifndef CONFIG_DEBUG_BFIN_NO_KERN_HWTRACE 584#ifndef CONFIG_DEBUG_BFIN_NO_KERN_HWTRACE
584 if (trapnr == VEC_CPLB_I_M || trapnr == VEC_CPLB_M) 585 if (trapnr == VEC_CPLB_I_M || trapnr == VEC_CPLB_M)
585 verbose_printk(KERN_NOTICE "No trace since you do not have " 586 verbose_printk(KERN_NOTICE "No trace since you do not have "
586 "CONFIG_DEBUG_BFIN_NO_KERN_HWTRACE enabled\n" 587 "CONFIG_DEBUG_BFIN_NO_KERN_HWTRACE enabled\n\n");
587 KERN_NOTICE "\n");
588 else 588 else
589#endif 589#endif
590 dump_bfin_trace_buffer(); 590 dump_bfin_trace_buffer();
591 591
592 if (oops_in_progress) { 592 if (oops_in_progress) {
593 /* Dump the current kernel stack */ 593 /* Dump the current kernel stack */
594 verbose_printk(KERN_NOTICE "\n" KERN_NOTICE "Kernel Stack\n"); 594 verbose_printk(KERN_NOTICE "Kernel Stack\n");
595 show_stack(current, NULL); 595 show_stack(current, NULL);
596 print_modules(); 596 print_modules();
597#ifndef CONFIG_ACCESS_CHECK 597#ifndef CONFIG_ACCESS_CHECK
@@ -620,7 +620,9 @@ asmlinkage void trap_c(struct pt_regs *fp)
620 force_sig_info(sig, &info, current); 620 force_sig_info(sig, &info, current);
621 } 621 }
622 622
623 if (ANOMALY_05000461 && trapnr == VEC_HWERR && !access_ok(VERIFY_READ, fp->pc, 8)) 623 if ((ANOMALY_05000461 && trapnr == VEC_HWERR && !access_ok(VERIFY_READ, fp->pc, 8)) ||
624 (ANOMALY_05000281 && trapnr == VEC_HWERR) ||
625 (ANOMALY_05000189 && (trapnr == VEC_CPLB_I_VL || trapnr == VEC_CPLB_VL)))
624 fp->pc = SAFE_USER_INSTRUCTION; 626 fp->pc = SAFE_USER_INSTRUCTION;
625 627
626 traps_done: 628 traps_done:
@@ -906,7 +908,7 @@ void show_stack(struct task_struct *task, unsigned long *stack)
906 908
907 ret_addr = 0; 909 ret_addr = 0;
908 if (!j && i % 8 == 0) 910 if (!j && i % 8 == 0)
909 printk("\n" KERN_NOTICE "%p:",addr); 911 printk(KERN_NOTICE "%p:",addr);
910 912
911 /* if it is an odd address, or zero, just skip it */ 913 /* if it is an odd address, or zero, just skip it */
912 if (*addr & 0x1 || !*addr) 914 if (*addr & 0x1 || !*addr)
@@ -996,9 +998,9 @@ void dump_bfin_process(struct pt_regs *fp)
996 998
997 printk(KERN_NOTICE "CPU = %d\n", current_thread_info()->cpu); 999 printk(KERN_NOTICE "CPU = %d\n", current_thread_info()->cpu);
998 if (!((unsigned long)current->mm & 0x3) && (unsigned long)current->mm >= FIXED_CODE_START) 1000 if (!((unsigned long)current->mm & 0x3) && (unsigned long)current->mm >= FIXED_CODE_START)
999 verbose_printk(KERN_NOTICE "TEXT = 0x%p-0x%p DATA = 0x%p-0x%p\n" 1001 verbose_printk(KERN_NOTICE
1000 KERN_NOTICE " BSS = 0x%p-0x%p USER-STACK = 0x%p\n" 1002 "TEXT = 0x%p-0x%p DATA = 0x%p-0x%p\n"
1001 KERN_NOTICE "\n", 1003 " BSS = 0x%p-0x%p USER-STACK = 0x%p\n\n",
1002 (void *)current->mm->start_code, 1004 (void *)current->mm->start_code,
1003 (void *)current->mm->end_code, 1005 (void *)current->mm->end_code,
1004 (void *)current->mm->start_data, 1006 (void *)current->mm->start_data,
@@ -1009,8 +1011,8 @@ void dump_bfin_process(struct pt_regs *fp)
1009 else 1011 else
1010 verbose_printk(KERN_NOTICE "invalid mm\n"); 1012 verbose_printk(KERN_NOTICE "invalid mm\n");
1011 } else 1013 } else
1012 verbose_printk(KERN_NOTICE "\n" KERN_NOTICE 1014 verbose_printk(KERN_NOTICE
1013 "No Valid process in current context\n"); 1015 "No Valid process in current context\n");
1014#endif 1016#endif
1015} 1017}
1016 1018
@@ -1028,7 +1030,7 @@ void dump_bfin_mem(struct pt_regs *fp)
1028 addr < (unsigned short *)((unsigned long)erraddr & ~0xF) + 0x10; 1030 addr < (unsigned short *)((unsigned long)erraddr & ~0xF) + 0x10;
1029 addr++) { 1031 addr++) {
1030 if (!((unsigned long)addr & 0xF)) 1032 if (!((unsigned long)addr & 0xF))
1031 verbose_printk("\n" KERN_NOTICE "0x%p: ", addr); 1033 verbose_printk(KERN_NOTICE "0x%p: ", addr);
1032 1034
1033 if (!get_instruction(&val, addr)) { 1035 if (!get_instruction(&val, addr)) {
1034 val = 0; 1036 val = 0;
@@ -1056,9 +1058,9 @@ void dump_bfin_mem(struct pt_regs *fp)
1056 oops_in_progress)){ 1058 oops_in_progress)){
1057 verbose_printk(KERN_NOTICE "Looks like this was a deferred error - sorry\n"); 1059 verbose_printk(KERN_NOTICE "Looks like this was a deferred error - sorry\n");
1058#ifndef CONFIG_DEBUG_HWERR 1060#ifndef CONFIG_DEBUG_HWERR
1059 verbose_printk(KERN_NOTICE "The remaining message may be meaningless\n" 1061 verbose_printk(KERN_NOTICE
1060 KERN_NOTICE "You should enable CONFIG_DEBUG_HWERR to get a" 1062"The remaining message may be meaningless\n"
1061 " better idea where it came from\n"); 1063"You should enable CONFIG_DEBUG_HWERR to get a better idea where it came from\n");
1062#else 1064#else
1063 /* If we are handling only one peripheral interrupt 1065 /* If we are handling only one peripheral interrupt
1064 * and current mm and pid are valid, and the last error 1066 * and current mm and pid are valid, and the last error
@@ -1114,9 +1116,10 @@ void show_regs(struct pt_regs *fp)
1114 1116
1115 verbose_printk(KERN_NOTICE "%s", linux_banner); 1117 verbose_printk(KERN_NOTICE "%s", linux_banner);
1116 1118
1117 verbose_printk(KERN_NOTICE "\n" KERN_NOTICE "SEQUENCER STATUS:\t\t%s\n", print_tainted()); 1119 verbose_printk(KERN_NOTICE "\nSEQUENCER STATUS:\t\t%s\n",
1120 print_tainted());
1118 verbose_printk(KERN_NOTICE " SEQSTAT: %08lx IPEND: %04lx SYSCFG: %04lx\n", 1121 verbose_printk(KERN_NOTICE " SEQSTAT: %08lx IPEND: %04lx SYSCFG: %04lx\n",
1119 (long)fp->seqstat, fp->ipend, fp->syscfg); 1122 (long)fp->seqstat, fp->ipend, fp->syscfg);
1120 if ((fp->seqstat & SEQSTAT_EXCAUSE) == VEC_HWERR) { 1123 if ((fp->seqstat & SEQSTAT_EXCAUSE) == VEC_HWERR) {
1121 verbose_printk(KERN_NOTICE " HWERRCAUSE: 0x%lx\n", 1124 verbose_printk(KERN_NOTICE " HWERRCAUSE: 0x%lx\n",
1122 (fp->seqstat & SEQSTAT_HWERRCAUSE) >> 14); 1125 (fp->seqstat & SEQSTAT_HWERRCAUSE) >> 14);
@@ -1184,7 +1187,7 @@ unlock:
1184 verbose_printk(KERN_NOTICE "ICPLB_FAULT_ADDR: %s\n", buf); 1187 verbose_printk(KERN_NOTICE "ICPLB_FAULT_ADDR: %s\n", buf);
1185 } 1188 }
1186 1189
1187 verbose_printk(KERN_NOTICE "\n" KERN_NOTICE "PROCESSOR STATE:\n"); 1190 verbose_printk(KERN_NOTICE "PROCESSOR STATE:\n");
1188 verbose_printk(KERN_NOTICE " R0 : %08lx R1 : %08lx R2 : %08lx R3 : %08lx\n", 1191 verbose_printk(KERN_NOTICE " R0 : %08lx R1 : %08lx R2 : %08lx R3 : %08lx\n",
1189 fp->r0, fp->r1, fp->r2, fp->r3); 1192 fp->r0, fp->r1, fp->r2, fp->r3);
1190 verbose_printk(KERN_NOTICE " R4 : %08lx R5 : %08lx R6 : %08lx R7 : %08lx\n", 1193 verbose_printk(KERN_NOTICE " R4 : %08lx R5 : %08lx R6 : %08lx R7 : %08lx\n",
diff --git a/arch/blackfin/lib/lshrdi3.c b/arch/blackfin/lib/lshrdi3.c
index 84b9c5592220..e57bf6fbdf3f 100644
--- a/arch/blackfin/lib/lshrdi3.c
+++ b/arch/blackfin/lib/lshrdi3.c
@@ -27,21 +27,7 @@
27 * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 27 * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
28 */ 28 */
29 29
30#define BITS_PER_UNIT 8 30#include "gcclib.h"
31
32typedef int SItype __attribute__ ((mode(SI)));
33typedef unsigned int USItype __attribute__ ((mode(SI)));
34typedef int DItype __attribute__ ((mode(DI)));
35typedef int word_type __attribute__ ((mode(__word__)));
36
37struct DIstruct {
38 SItype high, low;
39};
40
41typedef union {
42 struct DIstruct s;
43 DItype ll;
44} DIunion;
45 31
46#ifdef CONFIG_ARITHMETIC_OPS_L1 32#ifdef CONFIG_ARITHMETIC_OPS_L1
47DItype __lshrdi3(DItype u, word_type b)__attribute__((l1_text)); 33DItype __lshrdi3(DItype u, word_type b)__attribute__((l1_text));
diff --git a/arch/blackfin/mach-bf518/boards/ezbrd.c b/arch/blackfin/mach-bf518/boards/ezbrd.c
index d9791106be9f..809be268e42d 100644
--- a/arch/blackfin/mach-bf518/boards/ezbrd.c
+++ b/arch/blackfin/mach-bf518/boards/ezbrd.c
@@ -534,7 +534,7 @@ static struct platform_device i2c_bfin_twi_device = {
534#endif 534#endif
535 535
536static struct i2c_board_info __initdata bfin_i2c_board_info[] = { 536static struct i2c_board_info __initdata bfin_i2c_board_info[] = {
537#if defined(CONFIG_BFIN_TWI_LCD) || defined(CONFIG_TWI_LCD_MODULE) 537#if defined(CONFIG_BFIN_TWI_LCD) || defined(CONFIG_BFIN_TWI_LCD_MODULE)
538 { 538 {
539 I2C_BOARD_INFO("pcf8574_lcd", 0x22), 539 I2C_BOARD_INFO("pcf8574_lcd", 0x22),
540 }, 540 },
diff --git a/arch/blackfin/mach-bf518/include/mach/anomaly.h b/arch/blackfin/mach-bf518/include/mach/anomaly.h
index 426e064062a0..753ed810e1c6 100644
--- a/arch/blackfin/mach-bf518/include/mach/anomaly.h
+++ b/arch/blackfin/mach-bf518/include/mach/anomaly.h
@@ -82,6 +82,7 @@
82#define ANOMALY_05000179 (0) 82#define ANOMALY_05000179 (0)
83#define ANOMALY_05000182 (0) 83#define ANOMALY_05000182 (0)
84#define ANOMALY_05000183 (0) 84#define ANOMALY_05000183 (0)
85#define ANOMALY_05000189 (0)
85#define ANOMALY_05000198 (0) 86#define ANOMALY_05000198 (0)
86#define ANOMALY_05000202 (0) 87#define ANOMALY_05000202 (0)
87#define ANOMALY_05000215 (0) 88#define ANOMALY_05000215 (0)
@@ -117,6 +118,7 @@
117#define ANOMALY_05000357 (0) 118#define ANOMALY_05000357 (0)
118#define ANOMALY_05000362 (1) 119#define ANOMALY_05000362 (1)
119#define ANOMALY_05000363 (0) 120#define ANOMALY_05000363 (0)
121#define ANOMALY_05000364 (0)
120#define ANOMALY_05000371 (0) 122#define ANOMALY_05000371 (0)
121#define ANOMALY_05000380 (0) 123#define ANOMALY_05000380 (0)
122#define ANOMALY_05000386 (0) 124#define ANOMALY_05000386 (0)
diff --git a/arch/blackfin/mach-bf518/include/mach/bfin_serial_5xx.h b/arch/blackfin/mach-bf518/include/mach/bfin_serial_5xx.h
index 0fb2ce5d840e..dbade93395eb 100644
--- a/arch/blackfin/mach-bf518/include/mach/bfin_serial_5xx.h
+++ b/arch/blackfin/mach-bf518/include/mach/bfin_serial_5xx.h
@@ -53,7 +53,7 @@
53#define UART_SET_DLAB(uart) do { UART_PUT_LCR(uart, UART_GET_LCR(uart) | DLAB); SSYNC(); } while (0) 53#define UART_SET_DLAB(uart) do { UART_PUT_LCR(uart, UART_GET_LCR(uart) | DLAB); SSYNC(); } while (0)
54#define UART_CLEAR_DLAB(uart) do { UART_PUT_LCR(uart, UART_GET_LCR(uart) & ~DLAB); SSYNC(); } while (0) 54#define UART_CLEAR_DLAB(uart) do { UART_PUT_LCR(uart, UART_GET_LCR(uart) & ~DLAB); SSYNC(); } while (0)
55 55
56#define UART_GET_CTS(x) (!gpio_get_value(x->cts_pin)) 56#define UART_GET_CTS(x) gpio_get_value(x->cts_pin)
57#define UART_DISABLE_RTS(x) gpio_set_value(x->rts_pin, 1) 57#define UART_DISABLE_RTS(x) gpio_set_value(x->rts_pin, 1)
58#define UART_ENABLE_RTS(x) gpio_set_value(x->rts_pin, 0) 58#define UART_ENABLE_RTS(x) gpio_set_value(x->rts_pin, 0)
59#define UART_ENABLE_INTS(x, v) UART_PUT_IER(x, v) 59#define UART_ENABLE_INTS(x, v) UART_PUT_IER(x, v)
diff --git a/arch/blackfin/mach-bf527/boards/cm_bf527.c b/arch/blackfin/mach-bf527/boards/cm_bf527.c
index f4867ce0c618..b09484f538f4 100644
--- a/arch/blackfin/mach-bf527/boards/cm_bf527.c
+++ b/arch/blackfin/mach-bf527/boards/cm_bf527.c
@@ -793,7 +793,7 @@ static struct platform_device i2c_bfin_twi_device = {
793#endif 793#endif
794 794
795static struct i2c_board_info __initdata bfin_i2c_board_info[] = { 795static struct i2c_board_info __initdata bfin_i2c_board_info[] = {
796#if defined(CONFIG_BFIN_TWI_LCD) || defined(CONFIG_TWI_LCD_MODULE) 796#if defined(CONFIG_BFIN_TWI_LCD) || defined(CONFIG_BFIN_TWI_LCD_MODULE)
797 { 797 {
798 I2C_BOARD_INFO("pcf8574_lcd", 0x22), 798 I2C_BOARD_INFO("pcf8574_lcd", 0x22),
799 .type = "pcf8574_lcd", 799 .type = "pcf8574_lcd",
diff --git a/arch/blackfin/mach-bf527/boards/ezbrd.c b/arch/blackfin/mach-bf527/boards/ezbrd.c
index b2f30f06b73e..2ad68cd10ae6 100644
--- a/arch/blackfin/mach-bf527/boards/ezbrd.c
+++ b/arch/blackfin/mach-bf527/boards/ezbrd.c
@@ -591,7 +591,7 @@ static struct platform_device i2c_bfin_twi_device = {
591#endif 591#endif
592 592
593static struct i2c_board_info __initdata bfin_i2c_board_info[] = { 593static struct i2c_board_info __initdata bfin_i2c_board_info[] = {
594#if defined(CONFIG_BFIN_TWI_LCD) || defined(CONFIG_TWI_LCD_MODULE) 594#if defined(CONFIG_BFIN_TWI_LCD) || defined(CONFIG_BFIN_TWI_LCD_MODULE)
595 { 595 {
596 I2C_BOARD_INFO("pcf8574_lcd", 0x22), 596 I2C_BOARD_INFO("pcf8574_lcd", 0x22),
597 }, 597 },
diff --git a/arch/blackfin/mach-bf527/boards/ezkit.c b/arch/blackfin/mach-bf527/boards/ezkit.c
index 799a1d1fa890..75e563d3f9d4 100644
--- a/arch/blackfin/mach-bf527/boards/ezkit.c
+++ b/arch/blackfin/mach-bf527/boards/ezkit.c
@@ -858,7 +858,7 @@ static struct platform_device i2c_bfin_twi_device = {
858#endif 858#endif
859 859
860static struct i2c_board_info __initdata bfin_i2c_board_info[] = { 860static struct i2c_board_info __initdata bfin_i2c_board_info[] = {
861#if defined(CONFIG_BFIN_TWI_LCD) || defined(CONFIG_TWI_LCD_MODULE) 861#if defined(CONFIG_BFIN_TWI_LCD) || defined(CONFIG_BFIN_TWI_LCD_MODULE)
862 { 862 {
863 I2C_BOARD_INFO("pcf8574_lcd", 0x22), 863 I2C_BOARD_INFO("pcf8574_lcd", 0x22),
864 }, 864 },
diff --git a/arch/blackfin/mach-bf527/include/mach/anomaly.h b/arch/blackfin/mach-bf527/include/mach/anomaly.h
index 0d63f7406168..c438ca89d8c9 100644
--- a/arch/blackfin/mach-bf527/include/mach/anomaly.h
+++ b/arch/blackfin/mach-bf527/include/mach/anomaly.h
@@ -176,6 +176,8 @@
176#define ANOMALY_05000443 (1) 176#define ANOMALY_05000443 (1)
177/* The WURESET Bit in the SYSCR Register is not Functional */ 177/* The WURESET Bit in the SYSCR Register is not Functional */
178#define ANOMALY_05000445 (1) 178#define ANOMALY_05000445 (1)
179/* USB DMA Short Packet Data Corruption */
180#define ANOMALY_05000450 (1)
179/* BCODE_QUICKBOOT, BCODE_ALLBOOT, and BCODE_FULLBOOT Settings in SYSCR Register Not Functional */ 181/* BCODE_QUICKBOOT, BCODE_ALLBOOT, and BCODE_FULLBOOT Settings in SYSCR Register Not Functional */
180#define ANOMALY_05000451 (1) 182#define ANOMALY_05000451 (1)
181/* Incorrect Default Hysteresis Setting for RESET, NMI, and BMODE Signals */ 183/* Incorrect Default Hysteresis Setting for RESET, NMI, and BMODE Signals */
@@ -201,6 +203,7 @@
201#define ANOMALY_05000179 (0) 203#define ANOMALY_05000179 (0)
202#define ANOMALY_05000182 (0) 204#define ANOMALY_05000182 (0)
203#define ANOMALY_05000183 (0) 205#define ANOMALY_05000183 (0)
206#define ANOMALY_05000189 (0)
204#define ANOMALY_05000198 (0) 207#define ANOMALY_05000198 (0)
205#define ANOMALY_05000202 (0) 208#define ANOMALY_05000202 (0)
206#define ANOMALY_05000215 (0) 209#define ANOMALY_05000215 (0)
@@ -238,6 +241,5 @@
238#define ANOMALY_05000412 (0) 241#define ANOMALY_05000412 (0)
239#define ANOMALY_05000447 (0) 242#define ANOMALY_05000447 (0)
240#define ANOMALY_05000448 (0) 243#define ANOMALY_05000448 (0)
241#define ANOMALY_05000450 (0)
242 244
243#endif 245#endif
diff --git a/arch/blackfin/mach-bf527/include/mach/bfin_serial_5xx.h b/arch/blackfin/mach-bf527/include/mach/bfin_serial_5xx.h
index a625659dd67f..ebd6cebc1fbc 100644
--- a/arch/blackfin/mach-bf527/include/mach/bfin_serial_5xx.h
+++ b/arch/blackfin/mach-bf527/include/mach/bfin_serial_5xx.h
@@ -53,7 +53,7 @@
53#define UART_SET_DLAB(uart) do { UART_PUT_LCR(uart, UART_GET_LCR(uart) | DLAB); SSYNC(); } while (0) 53#define UART_SET_DLAB(uart) do { UART_PUT_LCR(uart, UART_GET_LCR(uart) | DLAB); SSYNC(); } while (0)
54#define UART_CLEAR_DLAB(uart) do { UART_PUT_LCR(uart, UART_GET_LCR(uart) & ~DLAB); SSYNC(); } while (0) 54#define UART_CLEAR_DLAB(uart) do { UART_PUT_LCR(uart, UART_GET_LCR(uart) & ~DLAB); SSYNC(); } while (0)
55 55
56#define UART_GET_CTS(x) (!gpio_get_value(x->cts_pin)) 56#define UART_GET_CTS(x) gpio_get_value(x->cts_pin)
57#define UART_DISABLE_RTS(x) gpio_set_value(x->rts_pin, 1) 57#define UART_DISABLE_RTS(x) gpio_set_value(x->rts_pin, 1)
58#define UART_ENABLE_RTS(x) gpio_set_value(x->rts_pin, 0) 58#define UART_ENABLE_RTS(x) gpio_set_value(x->rts_pin, 0)
59#define UART_ENABLE_INTS(x, v) UART_PUT_IER(x, v) 59#define UART_ENABLE_INTS(x, v) UART_PUT_IER(x, v)
diff --git a/arch/blackfin/mach-bf533/boards/stamp.c b/arch/blackfin/mach-bf533/boards/stamp.c
index a68ade8a3ca2..3d743ccaff6a 100644
--- a/arch/blackfin/mach-bf533/boards/stamp.c
+++ b/arch/blackfin/mach-bf533/boards/stamp.c
@@ -453,7 +453,7 @@ static struct i2c_board_info __initdata bfin_i2c_board_info[] = {
453 .irq = 39, 453 .irq = 39,
454 }, 454 },
455#endif 455#endif
456#if defined(CONFIG_BFIN_TWI_LCD) || defined(CONFIG_TWI_LCD_MODULE) 456#if defined(CONFIG_BFIN_TWI_LCD) || defined(CONFIG_BFIN_TWI_LCD_MODULE)
457 { 457 {
458 I2C_BOARD_INFO("pcf8574_lcd", 0x22), 458 I2C_BOARD_INFO("pcf8574_lcd", 0x22),
459 }, 459 },
diff --git a/arch/blackfin/mach-bf533/include/mach/anomaly.h b/arch/blackfin/mach-bf533/include/mach/anomaly.h
index 70a0ad69c610..cd83db2fb1a1 100644
--- a/arch/blackfin/mach-bf533/include/mach/anomaly.h
+++ b/arch/blackfin/mach-bf533/include/mach/anomaly.h
@@ -335,6 +335,7 @@
335#define ANOMALY_05000323 (0) 335#define ANOMALY_05000323 (0)
336#define ANOMALY_05000353 (1) 336#define ANOMALY_05000353 (1)
337#define ANOMALY_05000362 (1) 337#define ANOMALY_05000362 (1)
338#define ANOMALY_05000364 (0)
338#define ANOMALY_05000380 (0) 339#define ANOMALY_05000380 (0)
339#define ANOMALY_05000386 (1) 340#define ANOMALY_05000386 (1)
340#define ANOMALY_05000389 (0) 341#define ANOMALY_05000389 (0)
diff --git a/arch/blackfin/mach-bf533/include/mach/bfin_serial_5xx.h b/arch/blackfin/mach-bf533/include/mach/bfin_serial_5xx.h
index a3789d7ccf8c..4062e24e759b 100644
--- a/arch/blackfin/mach-bf533/include/mach/bfin_serial_5xx.h
+++ b/arch/blackfin/mach-bf533/include/mach/bfin_serial_5xx.h
@@ -53,7 +53,7 @@
53#define UART_SET_DLAB(uart) do { UART_PUT_LCR(uart, UART_GET_LCR(uart) | DLAB); SSYNC(); } while (0) 53#define UART_SET_DLAB(uart) do { UART_PUT_LCR(uart, UART_GET_LCR(uart) | DLAB); SSYNC(); } while (0)
54#define UART_CLEAR_DLAB(uart) do { UART_PUT_LCR(uart, UART_GET_LCR(uart) & ~DLAB); SSYNC(); } while (0) 54#define UART_CLEAR_DLAB(uart) do { UART_PUT_LCR(uart, UART_GET_LCR(uart) & ~DLAB); SSYNC(); } while (0)
55 55
56#define UART_GET_CTS(x) (!gpio_get_value(x->cts_pin)) 56#define UART_GET_CTS(x) gpio_get_value(x->cts_pin)
57#define UART_DISABLE_RTS(x) gpio_set_value(x->rts_pin, 1) 57#define UART_DISABLE_RTS(x) gpio_set_value(x->rts_pin, 1)
58#define UART_ENABLE_RTS(x) gpio_set_value(x->rts_pin, 0) 58#define UART_ENABLE_RTS(x) gpio_set_value(x->rts_pin, 0)
59#define UART_ENABLE_INTS(x, v) UART_PUT_IER(x, v) 59#define UART_ENABLE_INTS(x, v) UART_PUT_IER(x, v)
diff --git a/arch/blackfin/mach-bf537/boards/stamp.c b/arch/blackfin/mach-bf537/boards/stamp.c
index c1f76dd2c4ed..bd656907b8c0 100644
--- a/arch/blackfin/mach-bf537/boards/stamp.c
+++ b/arch/blackfin/mach-bf537/boards/stamp.c
@@ -1313,10 +1313,10 @@ static struct i2c_board_info __initdata bfin_i2c_board_info[] = {
1313#if defined(CONFIG_JOYSTICK_AD7142) || defined(CONFIG_JOYSTICK_AD7142_MODULE) 1313#if defined(CONFIG_JOYSTICK_AD7142) || defined(CONFIG_JOYSTICK_AD7142_MODULE)
1314 { 1314 {
1315 I2C_BOARD_INFO("ad7142_joystick", 0x2C), 1315 I2C_BOARD_INFO("ad7142_joystick", 0x2C),
1316 .irq = IRQ_PF5, 1316 .irq = IRQ_PG5,
1317 }, 1317 },
1318#endif 1318#endif
1319#if defined(CONFIG_BFIN_TWI_LCD) || defined(CONFIG_TWI_LCD_MODULE) 1319#if defined(CONFIG_BFIN_TWI_LCD) || defined(CONFIG_BFIN_TWI_LCD_MODULE)
1320 { 1320 {
1321 I2C_BOARD_INFO("pcf8574_lcd", 0x22), 1321 I2C_BOARD_INFO("pcf8574_lcd", 0x22),
1322 }, 1322 },
diff --git a/arch/blackfin/mach-bf537/include/mach/anomaly.h b/arch/blackfin/mach-bf537/include/mach/anomaly.h
index 57c128cc3b64..e66aa131f517 100644
--- a/arch/blackfin/mach-bf537/include/mach/anomaly.h
+++ b/arch/blackfin/mach-bf537/include/mach/anomaly.h
@@ -167,6 +167,7 @@
167#define ANOMALY_05000179 (0) 167#define ANOMALY_05000179 (0)
168#define ANOMALY_05000182 (0) 168#define ANOMALY_05000182 (0)
169#define ANOMALY_05000183 (0) 169#define ANOMALY_05000183 (0)
170#define ANOMALY_05000189 (0)
170#define ANOMALY_05000198 (0) 171#define ANOMALY_05000198 (0)
171#define ANOMALY_05000202 (0) 172#define ANOMALY_05000202 (0)
172#define ANOMALY_05000215 (0) 173#define ANOMALY_05000215 (0)
@@ -186,6 +187,7 @@
186#define ANOMALY_05000353 (1) 187#define ANOMALY_05000353 (1)
187#define ANOMALY_05000362 (1) 188#define ANOMALY_05000362 (1)
188#define ANOMALY_05000363 (0) 189#define ANOMALY_05000363 (0)
190#define ANOMALY_05000364 (0)
189#define ANOMALY_05000380 (0) 191#define ANOMALY_05000380 (0)
190#define ANOMALY_05000386 (1) 192#define ANOMALY_05000386 (1)
191#define ANOMALY_05000389 (0) 193#define ANOMALY_05000389 (0)
diff --git a/arch/blackfin/mach-bf537/include/mach/bfin_serial_5xx.h b/arch/blackfin/mach-bf537/include/mach/bfin_serial_5xx.h
index b86662fb9de7..e95d54f9af6c 100644
--- a/arch/blackfin/mach-bf537/include/mach/bfin_serial_5xx.h
+++ b/arch/blackfin/mach-bf537/include/mach/bfin_serial_5xx.h
@@ -53,7 +53,7 @@
53#define UART_SET_DLAB(uart) do { UART_PUT_LCR(uart, UART_GET_LCR(uart) | DLAB); SSYNC(); } while (0) 53#define UART_SET_DLAB(uart) do { UART_PUT_LCR(uart, UART_GET_LCR(uart) | DLAB); SSYNC(); } while (0)
54#define UART_CLEAR_DLAB(uart) do { UART_PUT_LCR(uart, UART_GET_LCR(uart) & ~DLAB); SSYNC(); } while (0) 54#define UART_CLEAR_DLAB(uart) do { UART_PUT_LCR(uart, UART_GET_LCR(uart) & ~DLAB); SSYNC(); } while (0)
55 55
56#define UART_GET_CTS(x) (!gpio_get_value(x->cts_pin)) 56#define UART_GET_CTS(x) gpio_get_value(x->cts_pin)
57#define UART_DISABLE_RTS(x) gpio_set_value(x->rts_pin, 1) 57#define UART_DISABLE_RTS(x) gpio_set_value(x->rts_pin, 1)
58#define UART_ENABLE_RTS(x) gpio_set_value(x->rts_pin, 0) 58#define UART_ENABLE_RTS(x) gpio_set_value(x->rts_pin, 0)
59#define UART_ENABLE_INTS(x, v) UART_PUT_IER(x, v) 59#define UART_ENABLE_INTS(x, v) UART_PUT_IER(x, v)
diff --git a/arch/blackfin/mach-bf538/include/mach/anomaly.h b/arch/blackfin/mach-bf538/include/mach/anomaly.h
index c97acdf85cd3..451cf8a82a42 100644
--- a/arch/blackfin/mach-bf538/include/mach/anomaly.h
+++ b/arch/blackfin/mach-bf538/include/mach/anomaly.h
@@ -137,6 +137,7 @@
137#define ANOMALY_05000158 (0) 137#define ANOMALY_05000158 (0)
138#define ANOMALY_05000171 (0) 138#define ANOMALY_05000171 (0)
139#define ANOMALY_05000182 (0) 139#define ANOMALY_05000182 (0)
140#define ANOMALY_05000189 (0)
140#define ANOMALY_05000198 (0) 141#define ANOMALY_05000198 (0)
141#define ANOMALY_05000202 (0) 142#define ANOMALY_05000202 (0)
142#define ANOMALY_05000215 (0) 143#define ANOMALY_05000215 (0)
@@ -160,6 +161,7 @@
160#define ANOMALY_05000353 (1) 161#define ANOMALY_05000353 (1)
161#define ANOMALY_05000362 (1) 162#define ANOMALY_05000362 (1)
162#define ANOMALY_05000363 (0) 163#define ANOMALY_05000363 (0)
164#define ANOMALY_05000364 (0)
163#define ANOMALY_05000380 (0) 165#define ANOMALY_05000380 (0)
164#define ANOMALY_05000386 (1) 166#define ANOMALY_05000386 (1)
165#define ANOMALY_05000389 (0) 167#define ANOMALY_05000389 (0)
diff --git a/arch/blackfin/mach-bf538/include/mach/bfin_serial_5xx.h b/arch/blackfin/mach-bf538/include/mach/bfin_serial_5xx.h
index c536551eb4b8..999f239fe1a6 100644
--- a/arch/blackfin/mach-bf538/include/mach/bfin_serial_5xx.h
+++ b/arch/blackfin/mach-bf538/include/mach/bfin_serial_5xx.h
@@ -53,7 +53,7 @@
53#define UART_SET_DLAB(uart) do { UART_PUT_LCR(uart, UART_GET_LCR(uart) | DLAB); SSYNC(); } while (0) 53#define UART_SET_DLAB(uart) do { UART_PUT_LCR(uart, UART_GET_LCR(uart) | DLAB); SSYNC(); } while (0)
54#define UART_CLEAR_DLAB(uart) do { UART_PUT_LCR(uart, UART_GET_LCR(uart) & ~DLAB); SSYNC(); } while (0) 54#define UART_CLEAR_DLAB(uart) do { UART_PUT_LCR(uart, UART_GET_LCR(uart) & ~DLAB); SSYNC(); } while (0)
55 55
56#define UART_GET_CTS(x) (!gpio_get_value(x->cts_pin)) 56#define UART_GET_CTS(x) gpio_get_value(x->cts_pin)
57#define UART_DISABLE_RTS(x) gpio_set_value(x->rts_pin, 1) 57#define UART_DISABLE_RTS(x) gpio_set_value(x->rts_pin, 1)
58#define UART_ENABLE_RTS(x) gpio_set_value(x->rts_pin, 0) 58#define UART_ENABLE_RTS(x) gpio_set_value(x->rts_pin, 0)
59#define UART_ENABLE_INTS(x, v) UART_PUT_IER(x, v) 59#define UART_ENABLE_INTS(x, v) UART_PUT_IER(x, v)
diff --git a/arch/blackfin/mach-bf548/boards/ezkit.c b/arch/blackfin/mach-bf548/boards/ezkit.c
index 81f5b95cc361..dc0dd9b2bcef 100644
--- a/arch/blackfin/mach-bf548/boards/ezkit.c
+++ b/arch/blackfin/mach-bf548/boards/ezkit.c
@@ -864,7 +864,7 @@ static struct i2c_board_info __initdata bfin_i2c_board_info0[] = {
864 864
865#if !defined(CONFIG_BF542) /* The BF542 only has 1 TWI */ 865#if !defined(CONFIG_BF542) /* The BF542 only has 1 TWI */
866static struct i2c_board_info __initdata bfin_i2c_board_info1[] = { 866static struct i2c_board_info __initdata bfin_i2c_board_info1[] = {
867#if defined(CONFIG_BFIN_TWI_LCD) || defined(CONFIG_TWI_LCD_MODULE) 867#if defined(CONFIG_BFIN_TWI_LCD) || defined(CONFIG_BFIN_TWI_LCD_MODULE)
868 { 868 {
869 I2C_BOARD_INFO("pcf8574_lcd", 0x22), 869 I2C_BOARD_INFO("pcf8574_lcd", 0x22),
870 }, 870 },
diff --git a/arch/blackfin/mach-bf548/include/mach/anomaly.h b/arch/blackfin/mach-bf548/include/mach/anomaly.h
index 18a4cd24f673..cd040fe0bc5c 100644
--- a/arch/blackfin/mach-bf548/include/mach/anomaly.h
+++ b/arch/blackfin/mach-bf548/include/mach/anomaly.h
@@ -195,6 +195,7 @@
195#define ANOMALY_05000179 (0) 195#define ANOMALY_05000179 (0)
196#define ANOMALY_05000182 (0) 196#define ANOMALY_05000182 (0)
197#define ANOMALY_05000183 (0) 197#define ANOMALY_05000183 (0)
198#define ANOMALY_05000189 (0)
198#define ANOMALY_05000198 (0) 199#define ANOMALY_05000198 (0)
199#define ANOMALY_05000202 (0) 200#define ANOMALY_05000202 (0)
200#define ANOMALY_05000215 (0) 201#define ANOMALY_05000215 (0)
@@ -226,6 +227,7 @@
226#define ANOMALY_05000323 (0) 227#define ANOMALY_05000323 (0)
227#define ANOMALY_05000362 (1) 228#define ANOMALY_05000362 (1)
228#define ANOMALY_05000363 (0) 229#define ANOMALY_05000363 (0)
230#define ANOMALY_05000364 (0)
229#define ANOMALY_05000380 (0) 231#define ANOMALY_05000380 (0)
230#define ANOMALY_05000400 (0) 232#define ANOMALY_05000400 (0)
231#define ANOMALY_05000412 (0) 233#define ANOMALY_05000412 (0)
diff --git a/arch/blackfin/mach-bf561/include/mach/anomaly.h b/arch/blackfin/mach-bf561/include/mach/anomaly.h
index 94b8e277f09d..a5312b2d267e 100644
--- a/arch/blackfin/mach-bf561/include/mach/anomaly.h
+++ b/arch/blackfin/mach-bf561/include/mach/anomaly.h
@@ -288,6 +288,7 @@
288#define ANOMALY_05000273 (0) 288#define ANOMALY_05000273 (0)
289#define ANOMALY_05000311 (0) 289#define ANOMALY_05000311 (0)
290#define ANOMALY_05000353 (1) 290#define ANOMALY_05000353 (1)
291#define ANOMALY_05000364 (0)
291#define ANOMALY_05000380 (0) 292#define ANOMALY_05000380 (0)
292#define ANOMALY_05000386 (1) 293#define ANOMALY_05000386 (1)
293#define ANOMALY_05000389 (0) 294#define ANOMALY_05000389 (0)
diff --git a/arch/blackfin/mach-bf561/include/mach/bfin_serial_5xx.h b/arch/blackfin/mach-bf561/include/mach/bfin_serial_5xx.h
index a1b50878553f..fd5e8878b8c4 100644
--- a/arch/blackfin/mach-bf561/include/mach/bfin_serial_5xx.h
+++ b/arch/blackfin/mach-bf561/include/mach/bfin_serial_5xx.h
@@ -53,7 +53,7 @@
53#define UART_SET_DLAB(uart) do { UART_PUT_LCR(uart, UART_GET_LCR(uart) | DLAB); SSYNC(); } while (0) 53#define UART_SET_DLAB(uart) do { UART_PUT_LCR(uart, UART_GET_LCR(uart) | DLAB); SSYNC(); } while (0)
54#define UART_CLEAR_DLAB(uart) do { UART_PUT_LCR(uart, UART_GET_LCR(uart) & ~DLAB); SSYNC(); } while (0) 54#define UART_CLEAR_DLAB(uart) do { UART_PUT_LCR(uart, UART_GET_LCR(uart) & ~DLAB); SSYNC(); } while (0)
55 55
56#define UART_GET_CTS(x) (!gpio_get_value(x->cts_pin)) 56#define UART_GET_CTS(x) gpio_get_value(x->cts_pin)
57#define UART_DISABLE_RTS(x) gpio_set_value(x->rts_pin, 1) 57#define UART_DISABLE_RTS(x) gpio_set_value(x->rts_pin, 1)
58#define UART_ENABLE_RTS(x) gpio_set_value(x->rts_pin, 0) 58#define UART_ENABLE_RTS(x) gpio_set_value(x->rts_pin, 0)
59#define UART_ENABLE_INTS(x, v) UART_PUT_IER(x, v) 59#define UART_ENABLE_INTS(x, v) UART_PUT_IER(x, v)
diff --git a/arch/blackfin/mach-bf561/include/mach/mem_map.h b/arch/blackfin/mach-bf561/include/mach/mem_map.h
index a63e15c86d90..5b96ea549a04 100644
--- a/arch/blackfin/mach-bf561/include/mach/mem_map.h
+++ b/arch/blackfin/mach-bf561/include/mach/mem_map.h
@@ -37,7 +37,6 @@
37 37
38/* Memory Map for ADSP-BF561 processors */ 38/* Memory Map for ADSP-BF561 processors */
39 39
40#ifdef CONFIG_BF561
41#define COREA_L1_CODE_START 0xFFA00000 40#define COREA_L1_CODE_START 0xFFA00000
42#define COREA_L1_DATA_A_START 0xFF800000 41#define COREA_L1_DATA_A_START 0xFF800000
43#define COREA_L1_DATA_B_START 0xFF900000 42#define COREA_L1_DATA_B_START 0xFF900000
@@ -74,6 +73,28 @@
74#define BFIN_DCACHESIZE (0*1024) 73#define BFIN_DCACHESIZE (0*1024)
75#define BFIN_DSUPBANKS 0 74#define BFIN_DSUPBANKS 0
76#endif /*CONFIG_BFIN_DCACHE*/ 75#endif /*CONFIG_BFIN_DCACHE*/
76
77/*
78 * If we are in SMP mode, then the cache settings of Core B will match
79 * the settings of Core A. If we aren't, then we assume Core B is not
80 * using any cache. This allows the rest of the kernel to work with
81 * the core in either mode as we are only loading user code into it and
82 * it is the user's problem to make sure they aren't doing something
83 * stupid there.
84 *
85 * Note that we treat the L1 code region as a contiguous blob to make
86 * the rest of the kernel simpler. Easier to check one region than a
87 * bunch of small ones. Again, possible misbehavior here is the fault
88 * of the user -- don't try to use memory that doesn't exist.
89 */
90#ifdef CONFIG_SMP
91# define COREB_L1_CODE_LENGTH L1_CODE_LENGTH
92# define COREB_L1_DATA_A_LENGTH L1_DATA_A_LENGTH
93# define COREB_L1_DATA_B_LENGTH L1_DATA_B_LENGTH
94#else
95# define COREB_L1_CODE_LENGTH 0x14000
96# define COREB_L1_DATA_A_LENGTH 0x8000
97# define COREB_L1_DATA_B_LENGTH 0x8000
77#endif 98#endif
78 99
79/* Level 2 Memory */ 100/* Level 2 Memory */
diff --git a/arch/blackfin/mach-common/entry.S b/arch/blackfin/mach-common/entry.S
index 5a4e7c7fd92c..fb1795d5be2a 100644
--- a/arch/blackfin/mach-common/entry.S
+++ b/arch/blackfin/mach-common/entry.S
@@ -218,7 +218,7 @@ ENTRY(_ex_single_step)
218 /* Single stepping only a single instruction, so clear the trace 218 /* Single stepping only a single instruction, so clear the trace
219 * bit here. */ 219 * bit here. */
220 r7 = syscfg; 220 r7 = syscfg;
221 bitclr (r7, 0); 221 bitclr (r7, SYSCFG_SSSTEP_P);
222 syscfg = R7; 222 syscfg = R7;
223 jump _ex_trap_c; 223 jump _ex_trap_c;
224 224
@@ -251,7 +251,7 @@ ENTRY(_ex_single_step)
251 if !cc jump _bfin_return_from_exception; 251 if !cc jump _bfin_return_from_exception;
252 252
253 r7 = syscfg; 253 r7 = syscfg;
254 bitclr (r7, 0); 254 bitclr (r7, SYSCFG_SSSTEP_P); /* Turn off single step */
255 syscfg = R7; 255 syscfg = R7;
256 256
257 /* Fall through to _bfin_return_from_exception. */ 257 /* Fall through to _bfin_return_from_exception. */
@@ -342,9 +342,11 @@ ENTRY(_ex_trap_c)
342 r6 = retx; 342 r6 = retx;
343 [p5 + PDA_RETX] = r6; 343 [p5 + PDA_RETX] = r6;
344#endif 344#endif
345 /* Save the state of single stepping */
345 r6 = SYSCFG; 346 r6 = SYSCFG;
346 [p5 + PDA_SYSCFG] = r6; 347 [p5 + PDA_SYSCFG] = r6;
347 BITCLR(r6, 0); 348 /* Clear it while we handle the exception in IRQ5 mode */
349 BITCLR(r6, SYSCFG_SSSTEP_P);
348 SYSCFG = r6; 350 SYSCFG = r6;
349 351
350 /* Disable all interrupts, but make sure level 5 is enabled so 352 /* Disable all interrupts, but make sure level 5 is enabled so
@@ -367,7 +369,7 @@ ENDPROC(_ex_trap_c)
367 * exception. This is a unrecoverable event, so crash. 369 * exception. This is a unrecoverable event, so crash.
368 * Note: this cannot be ENTRY() as we jump here with "if cc jump" ... 370 * Note: this cannot be ENTRY() as we jump here with "if cc jump" ...
369 */ 371 */
370_double_fault: 372ENTRY(_double_fault)
371 /* Turn caches & protection off, to ensure we don't get any more 373 /* Turn caches & protection off, to ensure we don't get any more
372 * double exceptions 374 * double exceptions
373 */ 375 */
@@ -872,7 +874,7 @@ ENTRY(_ret_from_exception)
872 raise 15; /* raise evt15 to do signal or reschedule */ 874 raise 15; /* raise evt15 to do signal or reschedule */
8734: 8754:
874 r0 = syscfg; 876 r0 = syscfg;
875 bitclr(r0, 0); 877 bitclr(r0, SYSCFG_SSSTEP_P); /* Turn off single step */
876 syscfg = r0; 878 syscfg = r0;
8775: 8795:
878 rts; 880 rts;
diff --git a/arch/blackfin/mach-common/smp.c b/arch/blackfin/mach-common/smp.c
index 61840059dfac..349ee3f5466a 100644
--- a/arch/blackfin/mach-common/smp.c
+++ b/arch/blackfin/mach-common/smp.c
@@ -211,6 +211,8 @@ int smp_call_function(void (*func)(void *info), void *info, int wait)
211 return 0; 211 return 0;
212 212
213 msg = kmalloc(sizeof(*msg), GFP_ATOMIC); 213 msg = kmalloc(sizeof(*msg), GFP_ATOMIC);
214 if (!msg)
215 return -ENOMEM;
214 INIT_LIST_HEAD(&msg->list); 216 INIT_LIST_HEAD(&msg->list);
215 msg->call_struct.func = func; 217 msg->call_struct.func = func;
216 msg->call_struct.info = info; 218 msg->call_struct.info = info;
@@ -252,6 +254,8 @@ int smp_call_function_single(int cpuid, void (*func) (void *info), void *info,
252 cpu_set(cpu, callmap); 254 cpu_set(cpu, callmap);
253 255
254 msg = kmalloc(sizeof(*msg), GFP_ATOMIC); 256 msg = kmalloc(sizeof(*msg), GFP_ATOMIC);
257 if (!msg)
258 return -ENOMEM;
255 INIT_LIST_HEAD(&msg->list); 259 INIT_LIST_HEAD(&msg->list);
256 msg->call_struct.func = func; 260 msg->call_struct.func = func;
257 msg->call_struct.info = info; 261 msg->call_struct.info = info;
@@ -287,6 +291,8 @@ void smp_send_reschedule(int cpu)
287 return; 291 return;
288 292
289 msg = kmalloc(sizeof(*msg), GFP_ATOMIC); 293 msg = kmalloc(sizeof(*msg), GFP_ATOMIC);
294 if (!msg)
295 return;
290 memset(msg, 0, sizeof(msg)); 296 memset(msg, 0, sizeof(msg));
291 INIT_LIST_HEAD(&msg->list); 297 INIT_LIST_HEAD(&msg->list);
292 msg->type = BFIN_IPI_RESCHEDULE; 298 msg->type = BFIN_IPI_RESCHEDULE;
@@ -314,6 +320,8 @@ void smp_send_stop(void)
314 return; 320 return;
315 321
316 msg = kmalloc(sizeof(*msg), GFP_ATOMIC); 322 msg = kmalloc(sizeof(*msg), GFP_ATOMIC);
323 if (!msg)
324 return;
317 memset(msg, 0, sizeof(msg)); 325 memset(msg, 0, sizeof(msg));
318 INIT_LIST_HEAD(&msg->list); 326 INIT_LIST_HEAD(&msg->list);
319 msg->type = BFIN_IPI_CPU_STOP; 327 msg->type = BFIN_IPI_CPU_STOP;
@@ -450,7 +458,7 @@ void __init smp_cpus_done(unsigned int max_cpus)
450 unsigned int cpu; 458 unsigned int cpu;
451 459
452 for_each_online_cpu(cpu) 460 for_each_online_cpu(cpu)
453 bogosum += per_cpu(cpu_data, cpu).loops_per_jiffy; 461 bogosum += loops_per_jiffy;
454 462
455 printk(KERN_INFO "SMP: Total of %d processors activated " 463 printk(KERN_INFO "SMP: Total of %d processors activated "
456 "(%lu.%02lu BogoMIPS).\n", 464 "(%lu.%02lu BogoMIPS).\n",
diff --git a/arch/cris/include/asm/pgalloc.h b/arch/cris/include/asm/pgalloc.h
index a1ba761d0573..6da975db112f 100644
--- a/arch/cris/include/asm/pgalloc.h
+++ b/arch/cris/include/asm/pgalloc.h
@@ -47,7 +47,7 @@ static inline void pte_free(struct mm_struct *mm, pgtable_t pte)
47 __free_page(pte); 47 __free_page(pte);
48} 48}
49 49
50#define __pte_free_tlb(tlb,pte) \ 50#define __pte_free_tlb(tlb,pte,address) \
51do { \ 51do { \
52 pgtable_page_dtor(pte); \ 52 pgtable_page_dtor(pte); \
53 tlb_remove_page((tlb), pte); \ 53 tlb_remove_page((tlb), pte); \
diff --git a/arch/cris/include/asm/thread_info.h b/arch/cris/include/asm/thread_info.h
index bc5b2935ca53..c3aade36c330 100644
--- a/arch/cris/include/asm/thread_info.h
+++ b/arch/cris/include/asm/thread_info.h
@@ -50,8 +50,6 @@ struct thread_info {
50 50
51/* 51/*
52 * macros/functions for gaining access to the thread information structure 52 * macros/functions for gaining access to the thread information structure
53 *
54 * preempt_count needs to be 1 initially, until the scheduler is functional.
55 */ 53 */
56#ifndef __ASSEMBLY__ 54#ifndef __ASSEMBLY__
57#define INIT_THREAD_INFO(tsk) \ 55#define INIT_THREAD_INFO(tsk) \
@@ -60,7 +58,7 @@ struct thread_info {
60 .exec_domain = &default_exec_domain, \ 58 .exec_domain = &default_exec_domain, \
61 .flags = 0, \ 59 .flags = 0, \
62 .cpu = 0, \ 60 .cpu = 0, \
63 .preempt_count = 1, \ 61 .preempt_count = INIT_PREEMPT_COUNT, \
64 .addr_limit = KERNEL_DS, \ 62 .addr_limit = KERNEL_DS, \
65 .restart_block = { \ 63 .restart_block = { \
66 .fn = do_no_restart_syscall, \ 64 .fn = do_no_restart_syscall, \
diff --git a/arch/cris/kernel/sys_cris.c b/arch/cris/kernel/sys_cris.c
index a79fbd87021b..2ad962c7e88e 100644
--- a/arch/cris/kernel/sys_cris.c
+++ b/arch/cris/kernel/sys_cris.c
@@ -15,7 +15,6 @@
15#include <linux/mm.h> 15#include <linux/mm.h>
16#include <linux/fs.h> 16#include <linux/fs.h>
17#include <linux/smp.h> 17#include <linux/smp.h>
18#include <linux/smp_lock.h>
19#include <linux/sem.h> 18#include <linux/sem.h>
20#include <linux/msg.h> 19#include <linux/msg.h>
21#include <linux/shm.h> 20#include <linux/shm.h>
diff --git a/arch/frv/Kconfig b/arch/frv/Kconfig
index 8a5bd7a9c6f5..b86e19c9b5b0 100644
--- a/arch/frv/Kconfig
+++ b/arch/frv/Kconfig
@@ -7,6 +7,7 @@ config FRV
7 default y 7 default y
8 select HAVE_IDE 8 select HAVE_IDE
9 select HAVE_ARCH_TRACEHOOK 9 select HAVE_ARCH_TRACEHOOK
10 select HAVE_PERF_COUNTERS
10 11
11config ZONE_DMA 12config ZONE_DMA
12 bool 13 bool
diff --git a/arch/frv/include/asm/atomic.h b/arch/frv/include/asm/atomic.h
index 0409d981fd39..00a57af79afc 100644
--- a/arch/frv/include/asm/atomic.h
+++ b/arch/frv/include/asm/atomic.h
@@ -121,10 +121,72 @@ static inline void atomic_dec(atomic_t *v)
121#define atomic_dec_and_test(v) (atomic_sub_return(1, (v)) == 0) 121#define atomic_dec_and_test(v) (atomic_sub_return(1, (v)) == 0)
122#define atomic_inc_and_test(v) (atomic_add_return(1, (v)) == 0) 122#define atomic_inc_and_test(v) (atomic_add_return(1, (v)) == 0)
123 123
124/*
125 * 64-bit atomic ops
126 */
127typedef struct {
128 volatile long long counter;
129} atomic64_t;
130
131#define ATOMIC64_INIT(i) { (i) }
132
133static inline long long atomic64_read(atomic64_t *v)
134{
135 long long counter;
136
137 asm("ldd%I1 %M1,%0"
138 : "=e"(counter)
139 : "m"(v->counter));
140 return counter;
141}
142
143static inline void atomic64_set(atomic64_t *v, long long i)
144{
145 asm volatile("std%I0 %1,%M0"
146 : "=m"(v->counter)
147 : "e"(i));
148}
149
150extern long long atomic64_inc_return(atomic64_t *v);
151extern long long atomic64_dec_return(atomic64_t *v);
152extern long long atomic64_add_return(long long i, atomic64_t *v);
153extern long long atomic64_sub_return(long long i, atomic64_t *v);
154
155static inline long long atomic64_add_negative(long long i, atomic64_t *v)
156{
157 return atomic64_add_return(i, v) < 0;
158}
159
160static inline void atomic64_add(long long i, atomic64_t *v)
161{
162 atomic64_add_return(i, v);
163}
164
165static inline void atomic64_sub(long long i, atomic64_t *v)
166{
167 atomic64_sub_return(i, v);
168}
169
170static inline void atomic64_inc(atomic64_t *v)
171{
172 atomic64_inc_return(v);
173}
174
175static inline void atomic64_dec(atomic64_t *v)
176{
177 atomic64_dec_return(v);
178}
179
180#define atomic64_sub_and_test(i,v) (atomic64_sub_return((i), (v)) == 0)
181#define atomic64_dec_and_test(v) (atomic64_dec_return((v)) == 0)
182#define atomic64_inc_and_test(v) (atomic64_inc_return((v)) == 0)
183
124/*****************************************************************************/ 184/*****************************************************************************/
125/* 185/*
126 * exchange value with memory 186 * exchange value with memory
127 */ 187 */
188extern uint64_t __xchg_64(uint64_t i, volatile void *v);
189
128#ifndef CONFIG_FRV_OUTOFLINE_ATOMIC_OPS 190#ifndef CONFIG_FRV_OUTOFLINE_ATOMIC_OPS
129 191
130#define xchg(ptr, x) \ 192#define xchg(ptr, x) \
@@ -174,8 +236,10 @@ extern uint32_t __xchg_32(uint32_t i, volatile void *v);
174 236
175#define tas(ptr) (xchg((ptr), 1)) 237#define tas(ptr) (xchg((ptr), 1))
176 238
177#define atomic_cmpxchg(v, old, new) (cmpxchg(&((v)->counter), old, new)) 239#define atomic_cmpxchg(v, old, new) (cmpxchg(&(v)->counter, old, new))
178#define atomic_xchg(v, new) (xchg(&((v)->counter), new)) 240#define atomic_xchg(v, new) (xchg(&(v)->counter, new))
241#define atomic64_cmpxchg(v, old, new) (__cmpxchg_64(old, new, &(v)->counter))
242#define atomic64_xchg(v, new) (__xchg_64(new, &(v)->counter))
179 243
180static __inline__ int atomic_add_unless(atomic_t *v, int a, int u) 244static __inline__ int atomic_add_unless(atomic_t *v, int a, int u)
181{ 245{
diff --git a/arch/frv/include/asm/perf_counter.h b/arch/frv/include/asm/perf_counter.h
new file mode 100644
index 000000000000..ccf726e61b2e
--- /dev/null
+++ b/arch/frv/include/asm/perf_counter.h
@@ -0,0 +1,17 @@
1/* FRV performance counter support
2 *
3 * Copyright (C) 2009 Red Hat, Inc. All Rights Reserved.
4 * Written by David Howells (dhowells@redhat.com)
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public Licence
8 * as published by the Free Software Foundation; either version
9 * 2 of the Licence, or (at your option) any later version.
10 */
11
12#ifndef _ASM_PERF_COUNTER_H
13#define _ASM_PERF_COUNTER_H
14
15#define PERF_COUNTER_INDEX_OFFSET 0
16
17#endif /* _ASM_PERF_COUNTER_H */
diff --git a/arch/frv/include/asm/pgalloc.h b/arch/frv/include/asm/pgalloc.h
index 971e6addb009..416d19a632f2 100644
--- a/arch/frv/include/asm/pgalloc.h
+++ b/arch/frv/include/asm/pgalloc.h
@@ -49,7 +49,7 @@ static inline void pte_free(struct mm_struct *mm, pgtable_t pte)
49 __free_page(pte); 49 __free_page(pte);
50} 50}
51 51
52#define __pte_free_tlb(tlb,pte) \ 52#define __pte_free_tlb(tlb,pte,address) \
53do { \ 53do { \
54 pgtable_page_dtor(pte); \ 54 pgtable_page_dtor(pte); \
55 tlb_remove_page((tlb),(pte)); \ 55 tlb_remove_page((tlb),(pte)); \
@@ -62,7 +62,7 @@ do { \
62 */ 62 */
63#define pmd_alloc_one(mm, addr) ({ BUG(); ((pmd_t *) 2); }) 63#define pmd_alloc_one(mm, addr) ({ BUG(); ((pmd_t *) 2); })
64#define pmd_free(mm, x) do { } while (0) 64#define pmd_free(mm, x) do { } while (0)
65#define __pmd_free_tlb(tlb,x) do { } while (0) 65#define __pmd_free_tlb(tlb,x,a) do { } while (0)
66 66
67#endif /* CONFIG_MMU */ 67#endif /* CONFIG_MMU */
68 68
diff --git a/arch/frv/include/asm/pgtable.h b/arch/frv/include/asm/pgtable.h
index 33233011b1c1..22c60692b551 100644
--- a/arch/frv/include/asm/pgtable.h
+++ b/arch/frv/include/asm/pgtable.h
@@ -225,7 +225,7 @@ static inline pud_t *pud_offset(pgd_t *pgd, unsigned long address)
225 */ 225 */
226#define pud_alloc_one(mm, address) NULL 226#define pud_alloc_one(mm, address) NULL
227#define pud_free(mm, x) do { } while (0) 227#define pud_free(mm, x) do { } while (0)
228#define __pud_free_tlb(tlb, x) do { } while (0) 228#define __pud_free_tlb(tlb, x, address) do { } while (0)
229 229
230/* 230/*
231 * The "pud_xxx()" functions here are trivial for a folded two-level 231 * The "pud_xxx()" functions here are trivial for a folded two-level
diff --git a/arch/frv/include/asm/system.h b/arch/frv/include/asm/system.h
index 7742ec000cc4..efd22d9077ac 100644
--- a/arch/frv/include/asm/system.h
+++ b/arch/frv/include/asm/system.h
@@ -208,6 +208,8 @@ extern void free_initmem(void);
208 * - if (*ptr == test) then orig = *ptr; *ptr = test; 208 * - if (*ptr == test) then orig = *ptr; *ptr = test;
209 * - if (*ptr != test) then orig = *ptr; 209 * - if (*ptr != test) then orig = *ptr;
210 */ 210 */
211extern uint64_t __cmpxchg_64(uint64_t test, uint64_t new, volatile uint64_t *v);
212
211#ifndef CONFIG_FRV_OUTOFLINE_ATOMIC_OPS 213#ifndef CONFIG_FRV_OUTOFLINE_ATOMIC_OPS
212 214
213#define cmpxchg(ptr, test, new) \ 215#define cmpxchg(ptr, test, new) \
diff --git a/arch/frv/include/asm/thread_info.h b/arch/frv/include/asm/thread_info.h
index e8a5ed7be021..e608e056bb53 100644
--- a/arch/frv/include/asm/thread_info.h
+++ b/arch/frv/include/asm/thread_info.h
@@ -56,8 +56,6 @@ struct thread_info {
56 56
57/* 57/*
58 * macros/functions for gaining access to the thread information structure 58 * macros/functions for gaining access to the thread information structure
59 *
60 * preempt_count needs to be 1 initially, until the scheduler is functional.
61 */ 59 */
62#ifndef __ASSEMBLY__ 60#ifndef __ASSEMBLY__
63 61
@@ -67,7 +65,7 @@ struct thread_info {
67 .exec_domain = &default_exec_domain, \ 65 .exec_domain = &default_exec_domain, \
68 .flags = 0, \ 66 .flags = 0, \
69 .cpu = 0, \ 67 .cpu = 0, \
70 .preempt_count = 1, \ 68 .preempt_count = INIT_PREEMPT_COUNT, \
71 .addr_limit = KERNEL_DS, \ 69 .addr_limit = KERNEL_DS, \
72 .restart_block = { \ 70 .restart_block = { \
73 .fn = do_no_restart_syscall, \ 71 .fn = do_no_restart_syscall, \
diff --git a/arch/frv/include/asm/unistd.h b/arch/frv/include/asm/unistd.h
index 96d78d5d2c41..4a8fb427ce0a 100644
--- a/arch/frv/include/asm/unistd.h
+++ b/arch/frv/include/asm/unistd.h
@@ -341,10 +341,12 @@
341#define __NR_inotify_init1 332 341#define __NR_inotify_init1 332
342#define __NR_preadv 333 342#define __NR_preadv 333
343#define __NR_pwritev 334 343#define __NR_pwritev 334
344#define __NR_rt_tgsigqueueinfo 335
345#define __NR_perf_counter_open 336
344 346
345#ifdef __KERNEL__ 347#ifdef __KERNEL__
346 348
347#define NR_syscalls 335 349#define NR_syscalls 337
348 350
349#define __ARCH_WANT_IPC_PARSE_VERSION 351#define __ARCH_WANT_IPC_PARSE_VERSION
350/* #define __ARCH_WANT_OLD_READDIR */ 352/* #define __ARCH_WANT_OLD_READDIR */
diff --git a/arch/frv/kernel/entry.S b/arch/frv/kernel/entry.S
index 356e0e327a89..fde1e446b440 100644
--- a/arch/frv/kernel/entry.S
+++ b/arch/frv/kernel/entry.S
@@ -1524,5 +1524,7 @@ sys_call_table:
1524 .long sys_inotify_init1 1524 .long sys_inotify_init1
1525 .long sys_preadv 1525 .long sys_preadv
1526 .long sys_pwritev 1526 .long sys_pwritev
1527 .long sys_rt_tgsigqueueinfo /* 335 */
1528 .long sys_perf_counter_open
1527 1529
1528syscall_table_size = (. - sys_call_table) 1530syscall_table_size = (. - sys_call_table)
diff --git a/arch/frv/kernel/frv_ksyms.c b/arch/frv/kernel/frv_ksyms.c
index 0316b3c50eff..a89803b58b9a 100644
--- a/arch/frv/kernel/frv_ksyms.c
+++ b/arch/frv/kernel/frv_ksyms.c
@@ -67,6 +67,10 @@ EXPORT_SYMBOL(atomic_sub_return);
67EXPORT_SYMBOL(__xchg_32); 67EXPORT_SYMBOL(__xchg_32);
68EXPORT_SYMBOL(__cmpxchg_32); 68EXPORT_SYMBOL(__cmpxchg_32);
69#endif 69#endif
70EXPORT_SYMBOL(atomic64_add_return);
71EXPORT_SYMBOL(atomic64_sub_return);
72EXPORT_SYMBOL(__xchg_64);
73EXPORT_SYMBOL(__cmpxchg_64);
70 74
71EXPORT_SYMBOL(__debug_bug_printk); 75EXPORT_SYMBOL(__debug_bug_printk);
72EXPORT_SYMBOL(__delay_loops_MHz); 76EXPORT_SYMBOL(__delay_loops_MHz);
diff --git a/arch/frv/lib/Makefile b/arch/frv/lib/Makefile
index 08be305c9f44..0a377210c89b 100644
--- a/arch/frv/lib/Makefile
+++ b/arch/frv/lib/Makefile
@@ -4,5 +4,5 @@
4 4
5lib-y := \ 5lib-y := \
6 __ashldi3.o __lshrdi3.o __muldi3.o __ashrdi3.o __negdi2.o __ucmpdi2.o \ 6 __ashldi3.o __lshrdi3.o __muldi3.o __ashrdi3.o __negdi2.o __ucmpdi2.o \
7 checksum.o memcpy.o memset.o atomic-ops.o \ 7 checksum.o memcpy.o memset.o atomic-ops.o atomic64-ops.o \
8 outsl_ns.o outsl_sw.o insl_ns.o insl_sw.o cache.o 8 outsl_ns.o outsl_sw.o insl_ns.o insl_sw.o cache.o perf_counter.o
diff --git a/arch/frv/lib/atomic-ops.S b/arch/frv/lib/atomic-ops.S
index ee0ac905fb08..5e9e6ab5dd0e 100644
--- a/arch/frv/lib/atomic-ops.S
+++ b/arch/frv/lib/atomic-ops.S
@@ -163,11 +163,10 @@ __cmpxchg_32:
163 ld.p @(gr11,gr0),gr8 163 ld.p @(gr11,gr0),gr8
164 orcr cc7,cc7,cc3 164 orcr cc7,cc7,cc3
165 subcc gr8,gr9,gr7,icc0 165 subcc gr8,gr9,gr7,icc0
166 bne icc0,#0,1f 166 bnelr icc0,#0
167 cst.p gr10,@(gr11,gr0) ,cc3,#1 167 cst.p gr10,@(gr11,gr0) ,cc3,#1
168 corcc gr29,gr29,gr0 ,cc3,#1 168 corcc gr29,gr29,gr0 ,cc3,#1
169 beq icc3,#0,0b 169 beq icc3,#0,0b
1701:
171 bralr 170 bralr
172 171
173 .size __cmpxchg_32, .-__cmpxchg_32 172 .size __cmpxchg_32, .-__cmpxchg_32
diff --git a/arch/frv/lib/atomic64-ops.S b/arch/frv/lib/atomic64-ops.S
new file mode 100644
index 000000000000..b6194eeac127
--- /dev/null
+++ b/arch/frv/lib/atomic64-ops.S
@@ -0,0 +1,162 @@
1/* kernel atomic64 operations
2 *
3 * For an explanation of how atomic ops work in this arch, see:
4 * Documentation/frv/atomic-ops.txt
5 *
6 * Copyright (C) 2009 Red Hat, Inc. All Rights Reserved.
7 * Written by David Howells (dhowells@redhat.com)
8 *
9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License
11 * as published by the Free Software Foundation; either version
12 * 2 of the License, or (at your option) any later version.
13 */
14
15#include <asm/spr-regs.h>
16
17 .text
18 .balign 4
19
20
21###############################################################################
22#
23# long long atomic64_inc_return(atomic64_t *v)
24#
25###############################################################################
26 .globl atomic64_inc_return
27 .type atomic64_inc_return,@function
28atomic64_inc_return:
29 or.p gr8,gr8,gr10
300:
31 orcc gr0,gr0,gr0,icc3 /* set ICC3.Z */
32 ckeq icc3,cc7
33 ldd.p @(gr10,gr0),gr8 /* LDD.P/ORCR must be atomic */
34 orcr cc7,cc7,cc3 /* set CC3 to true */
35 addicc gr9,#1,gr9,icc0
36 addxi gr8,#0,gr8,icc0
37 cstd.p gr8,@(gr10,gr0) ,cc3,#1
38 corcc gr29,gr29,gr0 ,cc3,#1 /* clear ICC3.Z if store happens */
39 beq icc3,#0,0b
40 bralr
41
42 .size atomic64_inc_return, .-atomic64_inc_return
43
44###############################################################################
45#
46# long long atomic64_dec_return(atomic64_t *v)
47#
48###############################################################################
49 .globl atomic64_dec_return
50 .type atomic64_dec_return,@function
51atomic64_dec_return:
52 or.p gr8,gr8,gr10
530:
54 orcc gr0,gr0,gr0,icc3 /* set ICC3.Z */
55 ckeq icc3,cc7
56 ldd.p @(gr10,gr0),gr8 /* LDD.P/ORCR must be atomic */
57 orcr cc7,cc7,cc3 /* set CC3 to true */
58 subicc gr9,#1,gr9,icc0
59 subxi gr8,#0,gr8,icc0
60 cstd.p gr8,@(gr10,gr0) ,cc3,#1
61 corcc gr29,gr29,gr0 ,cc3,#1 /* clear ICC3.Z if store happens */
62 beq icc3,#0,0b
63 bralr
64
65 .size atomic64_dec_return, .-atomic64_dec_return
66
67###############################################################################
68#
69# long long atomic64_add_return(long long i, atomic64_t *v)
70#
71###############################################################################
72 .globl atomic64_add_return
73 .type atomic64_add_return,@function
74atomic64_add_return:
75 or.p gr8,gr8,gr4
76 or gr9,gr9,gr5
770:
78 orcc gr0,gr0,gr0,icc3 /* set ICC3.Z */
79 ckeq icc3,cc7
80 ldd.p @(gr10,gr0),gr8 /* LDD.P/ORCR must be atomic */
81 orcr cc7,cc7,cc3 /* set CC3 to true */
82 addcc gr9,gr5,gr9,icc0
83 addx gr8,gr4,gr8,icc0
84 cstd.p gr8,@(gr10,gr0) ,cc3,#1
85 corcc gr29,gr29,gr0 ,cc3,#1 /* clear ICC3.Z if store happens */
86 beq icc3,#0,0b
87 bralr
88
89 .size atomic64_add_return, .-atomic64_add_return
90
91###############################################################################
92#
93# long long atomic64_sub_return(long long i, atomic64_t *v)
94#
95###############################################################################
96 .globl atomic64_sub_return
97 .type atomic64_sub_return,@function
98atomic64_sub_return:
99 or.p gr8,gr8,gr4
100 or gr9,gr9,gr5
1010:
102 orcc gr0,gr0,gr0,icc3 /* set ICC3.Z */
103 ckeq icc3,cc7
104 ldd.p @(gr10,gr0),gr8 /* LDD.P/ORCR must be atomic */
105 orcr cc7,cc7,cc3 /* set CC3 to true */
106 subcc gr9,gr5,gr9,icc0
107 subx gr8,gr4,gr8,icc0
108 cstd.p gr8,@(gr10,gr0) ,cc3,#1
109 corcc gr29,gr29,gr0 ,cc3,#1 /* clear ICC3.Z if store happens */
110 beq icc3,#0,0b
111 bralr
112
113 .size atomic64_sub_return, .-atomic64_sub_return
114
115###############################################################################
116#
117# uint64_t __xchg_64(uint64_t i, uint64_t *v)
118#
119###############################################################################
120 .globl __xchg_64
121 .type __xchg_64,@function
122__xchg_64:
123 or.p gr8,gr8,gr4
124 or gr9,gr9,gr5
1250:
126 orcc gr0,gr0,gr0,icc3 /* set ICC3.Z */
127 ckeq icc3,cc7
128 ldd.p @(gr10,gr0),gr8 /* LDD.P/ORCR must be atomic */
129 orcr cc7,cc7,cc3 /* set CC3 to true */
130 cstd.p gr4,@(gr10,gr0) ,cc3,#1
131 corcc gr29,gr29,gr0 ,cc3,#1 /* clear ICC3.Z if store happens */
132 beq icc3,#0,0b
133 bralr
134
135 .size __xchg_64, .-__xchg_64
136
137###############################################################################
138#
139# uint64_t __cmpxchg_64(uint64_t test, uint64_t new, uint64_t *v)
140#
141###############################################################################
142 .globl __cmpxchg_64
143 .type __cmpxchg_64,@function
144__cmpxchg_64:
145 or.p gr8,gr8,gr4
146 or gr9,gr9,gr5
1470:
148 orcc gr0,gr0,gr0,icc3 /* set ICC3.Z */
149 ckeq icc3,cc7
150 ldd.p @(gr12,gr0),gr8 /* LDD.P/ORCR must be atomic */
151 orcr cc7,cc7,cc3
152 subcc gr8,gr4,gr0,icc0
153 subcc.p gr9,gr5,gr0,icc1
154 bnelr icc0,#0
155 bnelr icc1,#0
156 cstd.p gr10,@(gr12,gr0) ,cc3,#1
157 corcc gr29,gr29,gr0 ,cc3,#1 /* clear ICC3.Z if store happens */
158 beq icc3,#0,0b
159 bralr
160
161 .size __cmpxchg_64, .-__cmpxchg_64
162
diff --git a/arch/frv/lib/perf_counter.c b/arch/frv/lib/perf_counter.c
new file mode 100644
index 000000000000..2000feecd571
--- /dev/null
+++ b/arch/frv/lib/perf_counter.c
@@ -0,0 +1,19 @@
1/* Performance counter handling
2 *
3 * Copyright (C) 2009 Red Hat, Inc. All Rights Reserved.
4 * Written by David Howells (dhowells@redhat.com)
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public Licence
8 * as published by the Free Software Foundation; either version
9 * 2 of the Licence, or (at your option) any later version.
10 */
11
12#include <linux/perf_counter.h>
13
14/*
15 * mark the performance counter as pending
16 */
17void set_perf_counter_pending(void)
18{
19}
diff --git a/arch/h8300/include/asm/thread_info.h b/arch/h8300/include/asm/thread_info.h
index 700014d2155f..8bbc8b0ee45d 100644
--- a/arch/h8300/include/asm/thread_info.h
+++ b/arch/h8300/include/asm/thread_info.h
@@ -36,7 +36,7 @@ struct thread_info {
36 .exec_domain = &default_exec_domain, \ 36 .exec_domain = &default_exec_domain, \
37 .flags = 0, \ 37 .flags = 0, \
38 .cpu = 0, \ 38 .cpu = 0, \
39 .preempt_count = 1, \ 39 .preempt_count = INIT_PREEMPT_COUNT, \
40 .restart_block = { \ 40 .restart_block = { \
41 .fn = do_no_restart_syscall, \ 41 .fn = do_no_restart_syscall, \
42 }, \ 42 }, \
diff --git a/arch/ia64/include/asm/fpu.h b/arch/ia64/include/asm/fpu.h
index 0c26157cffa5..b6395ad1500a 100644
--- a/arch/ia64/include/asm/fpu.h
+++ b/arch/ia64/include/asm/fpu.h
@@ -6,6 +6,8 @@
6 * David Mosberger-Tang <davidm@hpl.hp.com> 6 * David Mosberger-Tang <davidm@hpl.hp.com>
7 */ 7 */
8 8
9#include <linux/types.h>
10
9/* floating point status register: */ 11/* floating point status register: */
10#define FPSR_TRAP_VD (1 << 0) /* invalid op trap disabled */ 12#define FPSR_TRAP_VD (1 << 0) /* invalid op trap disabled */
11#define FPSR_TRAP_DD (1 << 1) /* denormal trap disabled */ 13#define FPSR_TRAP_DD (1 << 1) /* denormal trap disabled */
diff --git a/arch/ia64/include/asm/pgalloc.h b/arch/ia64/include/asm/pgalloc.h
index b9ac1a6fc216..96a8d927db28 100644
--- a/arch/ia64/include/asm/pgalloc.h
+++ b/arch/ia64/include/asm/pgalloc.h
@@ -48,7 +48,7 @@ static inline void pud_free(struct mm_struct *mm, pud_t *pud)
48{ 48{
49 quicklist_free(0, NULL, pud); 49 quicklist_free(0, NULL, pud);
50} 50}
51#define __pud_free_tlb(tlb, pud) pud_free((tlb)->mm, pud) 51#define __pud_free_tlb(tlb, pud, address) pud_free((tlb)->mm, pud)
52#endif /* CONFIG_PGTABLE_4 */ 52#endif /* CONFIG_PGTABLE_4 */
53 53
54static inline void 54static inline void
@@ -67,7 +67,7 @@ static inline void pmd_free(struct mm_struct *mm, pmd_t *pmd)
67 quicklist_free(0, NULL, pmd); 67 quicklist_free(0, NULL, pmd);
68} 68}
69 69
70#define __pmd_free_tlb(tlb, pmd) pmd_free((tlb)->mm, pmd) 70#define __pmd_free_tlb(tlb, pmd, address) pmd_free((tlb)->mm, pmd)
71 71
72static inline void 72static inline void
73pmd_populate(struct mm_struct *mm, pmd_t * pmd_entry, pgtable_t pte) 73pmd_populate(struct mm_struct *mm, pmd_t * pmd_entry, pgtable_t pte)
@@ -117,6 +117,6 @@ static inline void check_pgt_cache(void)
117 quicklist_trim(0, NULL, 25, 16); 117 quicklist_trim(0, NULL, 25, 16);
118} 118}
119 119
120#define __pte_free_tlb(tlb, pte) pte_free((tlb)->mm, pte) 120#define __pte_free_tlb(tlb, pte, address) pte_free((tlb)->mm, pte)
121 121
122#endif /* _ASM_IA64_PGALLOC_H */ 122#endif /* _ASM_IA64_PGALLOC_H */
diff --git a/arch/ia64/include/asm/thread_info.h b/arch/ia64/include/asm/thread_info.h
index ae6922626bf4..8ce2e388e37c 100644
--- a/arch/ia64/include/asm/thread_info.h
+++ b/arch/ia64/include/asm/thread_info.h
@@ -48,7 +48,7 @@ struct thread_info {
48 .flags = 0, \ 48 .flags = 0, \
49 .cpu = 0, \ 49 .cpu = 0, \
50 .addr_limit = KERNEL_DS, \ 50 .addr_limit = KERNEL_DS, \
51 .preempt_count = 0, \ 51 .preempt_count = INIT_PREEMPT_COUNT, \
52 .restart_block = { \ 52 .restart_block = { \
53 .fn = do_no_restart_syscall, \ 53 .fn = do_no_restart_syscall, \
54 }, \ 54 }, \
diff --git a/arch/ia64/include/asm/tlb.h b/arch/ia64/include/asm/tlb.h
index 20d8a39680c2..85d965cb19a0 100644
--- a/arch/ia64/include/asm/tlb.h
+++ b/arch/ia64/include/asm/tlb.h
@@ -236,22 +236,22 @@ do { \
236 __tlb_remove_tlb_entry(tlb, ptep, addr); \ 236 __tlb_remove_tlb_entry(tlb, ptep, addr); \
237} while (0) 237} while (0)
238 238
239#define pte_free_tlb(tlb, ptep) \ 239#define pte_free_tlb(tlb, ptep, address) \
240do { \ 240do { \
241 tlb->need_flush = 1; \ 241 tlb->need_flush = 1; \
242 __pte_free_tlb(tlb, ptep); \ 242 __pte_free_tlb(tlb, ptep, address); \
243} while (0) 243} while (0)
244 244
245#define pmd_free_tlb(tlb, ptep) \ 245#define pmd_free_tlb(tlb, ptep, address) \
246do { \ 246do { \
247 tlb->need_flush = 1; \ 247 tlb->need_flush = 1; \
248 __pmd_free_tlb(tlb, ptep); \ 248 __pmd_free_tlb(tlb, ptep, address); \
249} while (0) 249} while (0)
250 250
251#define pud_free_tlb(tlb, pudp) \ 251#define pud_free_tlb(tlb, pudp, address) \
252do { \ 252do { \
253 tlb->need_flush = 1; \ 253 tlb->need_flush = 1; \
254 __pud_free_tlb(tlb, pudp); \ 254 __pud_free_tlb(tlb, pudp, address); \
255} while (0) 255} while (0)
256 256
257#endif /* _ASM_IA64_TLB_H */ 257#endif /* _ASM_IA64_TLB_H */
diff --git a/arch/ia64/include/asm/xen/hypervisor.h b/arch/ia64/include/asm/xen/hypervisor.h
index e425227a418e..88afb54501e4 100644
--- a/arch/ia64/include/asm/xen/hypervisor.h
+++ b/arch/ia64/include/asm/xen/hypervisor.h
@@ -33,6 +33,7 @@
33#ifndef _ASM_IA64_XEN_HYPERVISOR_H 33#ifndef _ASM_IA64_XEN_HYPERVISOR_H
34#define _ASM_IA64_XEN_HYPERVISOR_H 34#define _ASM_IA64_XEN_HYPERVISOR_H
35 35
36#include <linux/err.h>
36#include <xen/interface/xen.h> 37#include <xen/interface/xen.h>
37#include <xen/interface/version.h> /* to compile feature.c */ 38#include <xen/interface/version.h> /* to compile feature.c */
38#include <xen/features.h> /* to comiple xen-netfront.c */ 39#include <xen/features.h> /* to comiple xen-netfront.c */
diff --git a/arch/ia64/kernel/dma-mapping.c b/arch/ia64/kernel/dma-mapping.c
index 086a2aeb0404..39a3cd0a4173 100644
--- a/arch/ia64/kernel/dma-mapping.c
+++ b/arch/ia64/kernel/dma-mapping.c
@@ -6,6 +6,14 @@ int iommu_detected __read_mostly;
6struct dma_map_ops *dma_ops; 6struct dma_map_ops *dma_ops;
7EXPORT_SYMBOL(dma_ops); 7EXPORT_SYMBOL(dma_ops);
8 8
9#define PREALLOC_DMA_DEBUG_ENTRIES (1 << 16)
10
11static int __init dma_init(void)
12{
13 dma_debug_init(PREALLOC_DMA_DEBUG_ENTRIES);
14}
15fs_initcall(dma_init);
16
9struct dma_map_ops *dma_get_ops(struct device *dev) 17struct dma_map_ops *dma_get_ops(struct device *dev)
10{ 18{
11 return dma_ops; 19 return dma_ops;
diff --git a/arch/ia64/kernel/esi.c b/arch/ia64/kernel/esi.c
index ebf4e988e78c..d5764a3d74af 100644
--- a/arch/ia64/kernel/esi.c
+++ b/arch/ia64/kernel/esi.c
@@ -65,7 +65,7 @@ static int __init esi_init (void)
65 } 65 }
66 66
67 if (!esi) 67 if (!esi)
68 return -ENODEV;; 68 return -ENODEV;
69 69
70 systab = __va(esi); 70 systab = __va(esi);
71 71
diff --git a/arch/ia64/kernel/perfmon.c b/arch/ia64/kernel/perfmon.c
index abce2468a40b..f1782705b1f7 100644
--- a/arch/ia64/kernel/perfmon.c
+++ b/arch/ia64/kernel/perfmon.c
@@ -5603,7 +5603,7 @@ pfm_interrupt_handler(int irq, void *arg)
5603 * /proc/perfmon interface, for debug only 5603 * /proc/perfmon interface, for debug only
5604 */ 5604 */
5605 5605
5606#define PFM_PROC_SHOW_HEADER ((void *)nr_cpu_ids+1) 5606#define PFM_PROC_SHOW_HEADER ((void *)(long)nr_cpu_ids+1)
5607 5607
5608static void * 5608static void *
5609pfm_proc_start(struct seq_file *m, loff_t *pos) 5609pfm_proc_start(struct seq_file *m, loff_t *pos)
diff --git a/arch/ia64/kernel/ptrace.c b/arch/ia64/kernel/ptrace.c
index 92c9689b7d97..9daa87fdb018 100644
--- a/arch/ia64/kernel/ptrace.c
+++ b/arch/ia64/kernel/ptrace.c
@@ -15,7 +15,6 @@
15#include <linux/mm.h> 15#include <linux/mm.h>
16#include <linux/errno.h> 16#include <linux/errno.h>
17#include <linux/ptrace.h> 17#include <linux/ptrace.h>
18#include <linux/smp_lock.h>
19#include <linux/user.h> 18#include <linux/user.h>
20#include <linux/security.h> 19#include <linux/security.h>
21#include <linux/audit.h> 20#include <linux/audit.h>
diff --git a/arch/ia64/kernel/salinfo.c b/arch/ia64/kernel/salinfo.c
index 7053c55b7649..e6676fca4828 100644
--- a/arch/ia64/kernel/salinfo.c
+++ b/arch/ia64/kernel/salinfo.c
@@ -192,7 +192,7 @@ struct salinfo_platform_oemdata_parms {
192static void 192static void
193salinfo_work_to_do(struct salinfo_data *data) 193salinfo_work_to_do(struct salinfo_data *data)
194{ 194{
195 down_trylock(&data->mutex); 195 (void)(down_trylock(&data->mutex) ?: 0);
196 up(&data->mutex); 196 up(&data->mutex);
197} 197}
198 198
diff --git a/arch/ia64/kvm/kvm_lib.c b/arch/ia64/kvm/kvm_lib.c
index a85cb611ecd7..f1268b8e6f9e 100644
--- a/arch/ia64/kvm/kvm_lib.c
+++ b/arch/ia64/kvm/kvm_lib.c
@@ -11,5 +11,11 @@
11 * 11 *
12 */ 12 */
13#undef CONFIG_MODULES 13#undef CONFIG_MODULES
14#include <linux/module.h>
15#undef CONFIG_KALLSYMS
16#undef EXPORT_SYMBOL
17#undef EXPORT_SYMBOL_GPL
18#define EXPORT_SYMBOL(sym)
19#define EXPORT_SYMBOL_GPL(sym)
14#include "../../../lib/vsprintf.c" 20#include "../../../lib/vsprintf.c"
15#include "../../../lib/ctype.c" 21#include "../../../lib/ctype.c"
diff --git a/arch/ia64/kvm/mmio.c b/arch/ia64/kvm/mmio.c
index 21f63fffc379..9bf55afd08d0 100644
--- a/arch/ia64/kvm/mmio.c
+++ b/arch/ia64/kvm/mmio.c
@@ -247,7 +247,8 @@ void emulate_io_inst(struct kvm_vcpu *vcpu, u64 padr, u64 ma)
247 vcpu_get_fpreg(vcpu, inst.M9.f2, &v); 247 vcpu_get_fpreg(vcpu, inst.M9.f2, &v);
248 /* Write high word. FIXME: this is a kludge! */ 248 /* Write high word. FIXME: this is a kludge! */
249 v.u.bits[1] &= 0x3ffff; 249 v.u.bits[1] &= 0x3ffff;
250 mmio_access(vcpu, padr + 8, &v.u.bits[1], 8, ma, IOREQ_WRITE); 250 mmio_access(vcpu, padr + 8, (u64 *)&v.u.bits[1], 8,
251 ma, IOREQ_WRITE);
251 data = v.u.bits[0]; 252 data = v.u.bits[0];
252 size = 3; 253 size = 3;
253 } else if (inst.M10.major == 7 && inst.M10.x6 == 0x3B) { 254 } else if (inst.M10.major == 7 && inst.M10.x6 == 0x3B) {
@@ -265,7 +266,8 @@ void emulate_io_inst(struct kvm_vcpu *vcpu, u64 padr, u64 ma)
265 266
266 /* Write high word.FIXME: this is a kludge! */ 267 /* Write high word.FIXME: this is a kludge! */
267 v.u.bits[1] &= 0x3ffff; 268 v.u.bits[1] &= 0x3ffff;
268 mmio_access(vcpu, padr + 8, &v.u.bits[1], 8, ma, IOREQ_WRITE); 269 mmio_access(vcpu, padr + 8, (u64 *)&v.u.bits[1],
270 8, ma, IOREQ_WRITE);
269 data = v.u.bits[0]; 271 data = v.u.bits[0];
270 size = 3; 272 size = 3;
271 } else if (inst.M10.major == 7 && inst.M10.x6 == 0x31) { 273 } else if (inst.M10.major == 7 && inst.M10.x6 == 0x31) {
diff --git a/arch/ia64/kvm/process.c b/arch/ia64/kvm/process.c
index a8f84da04b49..bb862fb224f2 100644
--- a/arch/ia64/kvm/process.c
+++ b/arch/ia64/kvm/process.c
@@ -130,7 +130,7 @@ static void collect_interruption(struct kvm_vcpu *vcpu)
130 if (vdcr & IA64_DCR_PP) { 130 if (vdcr & IA64_DCR_PP) {
131 vpsr |= IA64_PSR_PP; 131 vpsr |= IA64_PSR_PP;
132 } else { 132 } else {
133 vpsr &= ~IA64_PSR_PP;; 133 vpsr &= ~IA64_PSR_PP;
134 } 134 }
135 135
136 vcpu_set_psr(vcpu, vpsr); 136 vcpu_set_psr(vcpu, vpsr);
@@ -594,11 +594,11 @@ static void set_pal_call_data(struct kvm_vcpu *vcpu)
594 p->u.pal_data.gr30 = vcpu_get_gr(vcpu, 30); 594 p->u.pal_data.gr30 = vcpu_get_gr(vcpu, 30);
595 break; 595 break;
596 case PAL_BRAND_INFO: 596 case PAL_BRAND_INFO:
597 p->u.pal_data.gr29 = gr29;; 597 p->u.pal_data.gr29 = gr29;
598 p->u.pal_data.gr30 = kvm_trans_pal_call_args(vcpu, gr30); 598 p->u.pal_data.gr30 = kvm_trans_pal_call_args(vcpu, gr30);
599 break; 599 break;
600 default: 600 default:
601 p->u.pal_data.gr29 = gr29;; 601 p->u.pal_data.gr29 = gr29;
602 p->u.pal_data.gr30 = vcpu_get_gr(vcpu, 30); 602 p->u.pal_data.gr30 = vcpu_get_gr(vcpu, 30);
603 } 603 }
604 p->u.pal_data.gr28 = gr28; 604 p->u.pal_data.gr28 = gr28;
diff --git a/arch/ia64/kvm/vcpu.c b/arch/ia64/kvm/vcpu.c
index a2c6c15e4761..cc406d064a09 100644
--- a/arch/ia64/kvm/vcpu.c
+++ b/arch/ia64/kvm/vcpu.c
@@ -406,7 +406,7 @@ void getreg(unsigned long regnum, unsigned long *val,
406 * Now look at registers in [0-31] range and init correct UNAT 406 * Now look at registers in [0-31] range and init correct UNAT
407 */ 407 */
408 addr = (unsigned long)regs; 408 addr = (unsigned long)regs;
409 unat = &regs->eml_unat;; 409 unat = &regs->eml_unat;
410 410
411 addr += gr_info[regnum]; 411 addr += gr_info[regnum];
412 412
@@ -461,7 +461,7 @@ void setreg(unsigned long regnum, unsigned long val,
461u64 vcpu_get_gr(struct kvm_vcpu *vcpu, unsigned long reg) 461u64 vcpu_get_gr(struct kvm_vcpu *vcpu, unsigned long reg)
462{ 462{
463 struct kvm_pt_regs *regs = vcpu_regs(vcpu); 463 struct kvm_pt_regs *regs = vcpu_regs(vcpu);
464 u64 val; 464 unsigned long val;
465 465
466 if (!reg) 466 if (!reg)
467 return 0; 467 return 0;
@@ -469,7 +469,7 @@ u64 vcpu_get_gr(struct kvm_vcpu *vcpu, unsigned long reg)
469 return val; 469 return val;
470} 470}
471 471
472void vcpu_set_gr(struct kvm_vcpu *vcpu, u64 reg, u64 value, int nat) 472void vcpu_set_gr(struct kvm_vcpu *vcpu, unsigned long reg, u64 value, int nat)
473{ 473{
474 struct kvm_pt_regs *regs = vcpu_regs(vcpu); 474 struct kvm_pt_regs *regs = vcpu_regs(vcpu);
475 long sof = (regs->cr_ifs) & 0x7f; 475 long sof = (regs->cr_ifs) & 0x7f;
@@ -1072,7 +1072,7 @@ void kvm_ttag(struct kvm_vcpu *vcpu, INST64 inst)
1072 vcpu_set_gr(vcpu, inst.M46.r1, tag, 0); 1072 vcpu_set_gr(vcpu, inst.M46.r1, tag, 0);
1073} 1073}
1074 1074
1075int vcpu_tpa(struct kvm_vcpu *vcpu, u64 vadr, u64 *padr) 1075int vcpu_tpa(struct kvm_vcpu *vcpu, u64 vadr, unsigned long *padr)
1076{ 1076{
1077 struct thash_data *data; 1077 struct thash_data *data;
1078 union ia64_isr visr, pt_isr; 1078 union ia64_isr visr, pt_isr;
diff --git a/arch/ia64/kvm/vcpu.h b/arch/ia64/kvm/vcpu.h
index 042af92ced83..360724d3ae69 100644
--- a/arch/ia64/kvm/vcpu.h
+++ b/arch/ia64/kvm/vcpu.h
@@ -686,14 +686,15 @@ static inline int highest_inservice_irq(struct kvm_vcpu *vcpu)
686 return highest_bits((int *)&(VMX(vcpu, insvc[0]))); 686 return highest_bits((int *)&(VMX(vcpu, insvc[0])));
687} 687}
688 688
689extern void vcpu_get_fpreg(struct kvm_vcpu *vcpu, u64 reg, 689extern void vcpu_get_fpreg(struct kvm_vcpu *vcpu, unsigned long reg,
690 struct ia64_fpreg *val); 690 struct ia64_fpreg *val);
691extern void vcpu_set_fpreg(struct kvm_vcpu *vcpu, u64 reg, 691extern void vcpu_set_fpreg(struct kvm_vcpu *vcpu, unsigned long reg,
692 struct ia64_fpreg *val); 692 struct ia64_fpreg *val);
693extern u64 vcpu_get_gr(struct kvm_vcpu *vcpu, u64 reg); 693extern u64 vcpu_get_gr(struct kvm_vcpu *vcpu, unsigned long reg);
694extern void vcpu_set_gr(struct kvm_vcpu *vcpu, u64 reg, u64 val, int nat); 694extern void vcpu_set_gr(struct kvm_vcpu *vcpu, unsigned long reg,
695extern u64 vcpu_get_psr(struct kvm_vcpu *vcpu); 695 u64 val, int nat);
696extern void vcpu_set_psr(struct kvm_vcpu *vcpu, u64 val); 696extern unsigned long vcpu_get_psr(struct kvm_vcpu *vcpu);
697extern void vcpu_set_psr(struct kvm_vcpu *vcpu, unsigned long val);
697extern u64 vcpu_thash(struct kvm_vcpu *vcpu, u64 vadr); 698extern u64 vcpu_thash(struct kvm_vcpu *vcpu, u64 vadr);
698extern void vcpu_bsw0(struct kvm_vcpu *vcpu); 699extern void vcpu_bsw0(struct kvm_vcpu *vcpu);
699extern void thash_vhpt_insert(struct kvm_vcpu *v, u64 pte, 700extern void thash_vhpt_insert(struct kvm_vcpu *v, u64 pte,
diff --git a/arch/ia64/kvm/vtlb.c b/arch/ia64/kvm/vtlb.c
index 4290a429bf7c..20b3852f7a6e 100644
--- a/arch/ia64/kvm/vtlb.c
+++ b/arch/ia64/kvm/vtlb.c
@@ -135,7 +135,7 @@ struct thash_data *__vtr_lookup(struct kvm_vcpu *vcpu, u64 va, int type)
135 u64 rid; 135 u64 rid;
136 136
137 rid = vcpu_get_rr(vcpu, va); 137 rid = vcpu_get_rr(vcpu, va);
138 rid = rid & RR_RID_MASK;; 138 rid = rid & RR_RID_MASK;
139 if (type == D_TLB) { 139 if (type == D_TLB) {
140 if (vcpu_quick_region_check(vcpu->arch.dtr_regions, va)) { 140 if (vcpu_quick_region_check(vcpu->arch.dtr_regions, va)) {
141 for (trp = (struct thash_data *)&vcpu->arch.dtrs, i = 0; 141 for (trp = (struct thash_data *)&vcpu->arch.dtrs, i = 0;
@@ -518,7 +518,7 @@ struct thash_data *vtlb_lookup(struct kvm_vcpu *v, u64 va, int is_data)
518 518
519 struct thash_cb *hcb = &v->arch.vtlb; 519 struct thash_cb *hcb = &v->arch.vtlb;
520 520
521 cch = __vtr_lookup(v, va, is_data);; 521 cch = __vtr_lookup(v, va, is_data);
522 if (cch) 522 if (cch)
523 return cch; 523 return cch;
524 524
diff --git a/arch/ia64/pci/pci.c b/arch/ia64/pci/pci.c
index 729298f4b234..7de76dd352fe 100644
--- a/arch/ia64/pci/pci.c
+++ b/arch/ia64/pci/pci.c
@@ -537,7 +537,7 @@ pcibios_align_resource (void *data, struct resource *res,
537/* 537/*
538 * PCI BIOS setup, always defaults to SAL interface 538 * PCI BIOS setup, always defaults to SAL interface
539 */ 539 */
540char * __devinit 540char * __init
541pcibios_setup (char *str) 541pcibios_setup (char *str)
542{ 542{
543 return str; 543 return str;
diff --git a/arch/ia64/sn/kernel/io_common.c b/arch/ia64/sn/kernel/io_common.c
index 76645cf6ac5d..25831c47c579 100644
--- a/arch/ia64/sn/kernel/io_common.c
+++ b/arch/ia64/sn/kernel/io_common.c
@@ -435,7 +435,8 @@ void sn_generate_path(struct pci_bus *pci_bus, char *address)
435 bricktype = MODULE_GET_BTYPE(moduleid); 435 bricktype = MODULE_GET_BTYPE(moduleid);
436 if ((bricktype == L1_BRICKTYPE_191010) || 436 if ((bricktype == L1_BRICKTYPE_191010) ||
437 (bricktype == L1_BRICKTYPE_1932)) 437 (bricktype == L1_BRICKTYPE_1932))
438 sprintf(address, "%s^%d", address, geo_slot(geoid)); 438 sprintf(address + strlen(address), "^%d",
439 geo_slot(geoid));
439} 440}
440 441
441void __devinit 442void __devinit
diff --git a/arch/m32r/include/asm/pgalloc.h b/arch/m32r/include/asm/pgalloc.h
index f11a2b909cdb..0fc736198979 100644
--- a/arch/m32r/include/asm/pgalloc.h
+++ b/arch/m32r/include/asm/pgalloc.h
@@ -58,7 +58,7 @@ static inline void pte_free(struct mm_struct *mm, pgtable_t pte)
58 __free_page(pte); 58 __free_page(pte);
59} 59}
60 60
61#define __pte_free_tlb(tlb, pte) pte_free((tlb)->mm, (pte)) 61#define __pte_free_tlb(tlb, pte, addr) pte_free((tlb)->mm, (pte))
62 62
63/* 63/*
64 * allocating and freeing a pmd is trivial: the 1-entry pmd is 64 * allocating and freeing a pmd is trivial: the 1-entry pmd is
@@ -68,7 +68,7 @@ static inline void pte_free(struct mm_struct *mm, pgtable_t pte)
68 68
69#define pmd_alloc_one(mm, addr) ({ BUG(); ((pmd_t *)2); }) 69#define pmd_alloc_one(mm, addr) ({ BUG(); ((pmd_t *)2); })
70#define pmd_free(mm, x) do { } while (0) 70#define pmd_free(mm, x) do { } while (0)
71#define __pmd_free_tlb(tlb, x) do { } while (0) 71#define __pmd_free_tlb(tlb, x, addr) do { } while (0)
72#define pgd_populate(mm, pmd, pte) BUG() 72#define pgd_populate(mm, pmd, pte) BUG()
73 73
74#define check_pgt_cache() do { } while (0) 74#define check_pgt_cache() do { } while (0)
diff --git a/arch/m32r/include/asm/thread_info.h b/arch/m32r/include/asm/thread_info.h
index 8589d462df27..07bb5bd00e2a 100644
--- a/arch/m32r/include/asm/thread_info.h
+++ b/arch/m32r/include/asm/thread_info.h
@@ -57,8 +57,6 @@ struct thread_info {
57 57
58/* 58/*
59 * macros/functions for gaining access to the thread information structure 59 * macros/functions for gaining access to the thread information structure
60 *
61 * preempt_count needs to be 1 initially, until the scheduler is functional.
62 */ 60 */
63#ifndef __ASSEMBLY__ 61#ifndef __ASSEMBLY__
64 62
@@ -68,7 +66,7 @@ struct thread_info {
68 .exec_domain = &default_exec_domain, \ 66 .exec_domain = &default_exec_domain, \
69 .flags = 0, \ 67 .flags = 0, \
70 .cpu = 0, \ 68 .cpu = 0, \
71 .preempt_count = 1, \ 69 .preempt_count = INIT_PREEMPT_COUNT, \
72 .addr_limit = KERNEL_DS, \ 70 .addr_limit = KERNEL_DS, \
73 .restart_block = { \ 71 .restart_block = { \
74 .fn = do_no_restart_syscall, \ 72 .fn = do_no_restart_syscall, \
diff --git a/arch/m32r/kernel/ptrace.c b/arch/m32r/kernel/ptrace.c
index bf0abe9e1f73..98b8feb12ed8 100644
--- a/arch/m32r/kernel/ptrace.c
+++ b/arch/m32r/kernel/ptrace.c
@@ -19,7 +19,6 @@
19#include <linux/mm.h> 19#include <linux/mm.h>
20#include <linux/err.h> 20#include <linux/err.h>
21#include <linux/smp.h> 21#include <linux/smp.h>
22#include <linux/smp_lock.h>
23#include <linux/errno.h> 22#include <linux/errno.h>
24#include <linux/ptrace.h> 23#include <linux/ptrace.h>
25#include <linux/user.h> 24#include <linux/user.h>
diff --git a/arch/m68k/include/asm/motorola_pgalloc.h b/arch/m68k/include/asm/motorola_pgalloc.h
index d08bf6261df8..15ee4c74a9f0 100644
--- a/arch/m68k/include/asm/motorola_pgalloc.h
+++ b/arch/m68k/include/asm/motorola_pgalloc.h
@@ -54,7 +54,8 @@ static inline void pte_free(struct mm_struct *mm, pgtable_t page)
54 __free_page(page); 54 __free_page(page);
55} 55}
56 56
57static inline void __pte_free_tlb(struct mmu_gather *tlb, pgtable_t page) 57static inline void __pte_free_tlb(struct mmu_gather *tlb, pgtable_t page,
58 unsigned long address)
58{ 59{
59 pgtable_page_dtor(page); 60 pgtable_page_dtor(page);
60 cache_page(kmap(page)); 61 cache_page(kmap(page));
@@ -73,7 +74,8 @@ static inline int pmd_free(struct mm_struct *mm, pmd_t *pmd)
73 return free_pointer_table(pmd); 74 return free_pointer_table(pmd);
74} 75}
75 76
76static inline int __pmd_free_tlb(struct mmu_gather *tlb, pmd_t *pmd) 77static inline int __pmd_free_tlb(struct mmu_gather *tlb, pmd_t *pmd,
78 unsigned long address)
77{ 79{
78 return free_pointer_table(pmd); 80 return free_pointer_table(pmd);
79} 81}
diff --git a/arch/m68k/include/asm/sun3_pgalloc.h b/arch/m68k/include/asm/sun3_pgalloc.h
index d4c83f143816..48d80d5a666f 100644
--- a/arch/m68k/include/asm/sun3_pgalloc.h
+++ b/arch/m68k/include/asm/sun3_pgalloc.h
@@ -32,7 +32,7 @@ static inline void pte_free(struct mm_struct *mm, pgtable_t page)
32 __free_page(page); 32 __free_page(page);
33} 33}
34 34
35#define __pte_free_tlb(tlb,pte) \ 35#define __pte_free_tlb(tlb,pte,addr) \
36do { \ 36do { \
37 pgtable_page_dtor(pte); \ 37 pgtable_page_dtor(pte); \
38 tlb_remove_page((tlb), pte); \ 38 tlb_remove_page((tlb), pte); \
@@ -80,7 +80,7 @@ static inline void pmd_populate(struct mm_struct *mm, pmd_t *pmd, pgtable_t page
80 * inside the pgd, so has no extra memory associated with it. 80 * inside the pgd, so has no extra memory associated with it.
81 */ 81 */
82#define pmd_free(mm, x) do { } while (0) 82#define pmd_free(mm, x) do { } while (0)
83#define __pmd_free_tlb(tlb, x) do { } while (0) 83#define __pmd_free_tlb(tlb, x, addr) do { } while (0)
84 84
85static inline void pgd_free(struct mm_struct *mm, pgd_t *pgd) 85static inline void pgd_free(struct mm_struct *mm, pgd_t *pgd)
86{ 86{
diff --git a/arch/m68k/include/asm/thread_info_mm.h b/arch/m68k/include/asm/thread_info_mm.h
index af0fda46e94b..6ea5c33b3c56 100644
--- a/arch/m68k/include/asm/thread_info_mm.h
+++ b/arch/m68k/include/asm/thread_info_mm.h
@@ -19,6 +19,7 @@ struct thread_info {
19{ \ 19{ \
20 .task = &tsk, \ 20 .task = &tsk, \
21 .exec_domain = &default_exec_domain, \ 21 .exec_domain = &default_exec_domain, \
22 .preempt_count = INIT_PREEMPT_COUNT, \
22 .restart_block = { \ 23 .restart_block = { \
23 .fn = do_no_restart_syscall, \ 24 .fn = do_no_restart_syscall, \
24 }, \ 25 }, \
diff --git a/arch/m68k/include/asm/thread_info_no.h b/arch/m68k/include/asm/thread_info_no.h
index 82529f424ea3..c2bde5e24b0b 100644
--- a/arch/m68k/include/asm/thread_info_no.h
+++ b/arch/m68k/include/asm/thread_info_no.h
@@ -49,6 +49,7 @@ struct thread_info {
49 .exec_domain = &default_exec_domain, \ 49 .exec_domain = &default_exec_domain, \
50 .flags = 0, \ 50 .flags = 0, \
51 .cpu = 0, \ 51 .cpu = 0, \
52 .preempt_count = INIT_PREEMPT_COUNT, \
52 .restart_block = { \ 53 .restart_block = { \
53 .fn = do_no_restart_syscall, \ 54 .fn = do_no_restart_syscall, \
54 }, \ 55 }, \
diff --git a/arch/m68knommu/kernel/process.c b/arch/m68knommu/kernel/process.c
index 1e96c6eb6312..8f8f4abab2ff 100644
--- a/arch/m68knommu/kernel/process.c
+++ b/arch/m68knommu/kernel/process.c
@@ -290,7 +290,7 @@ void dump(struct pt_regs *fp)
290 unsigned char *tp; 290 unsigned char *tp;
291 int i; 291 int i;
292 292
293 printk(KERN_EMERG "\n" KERN_EMERG "CURRENT PROCESS:\n" KERN_EMERG "\n"); 293 printk(KERN_EMERG "\nCURRENT PROCESS:\n\n");
294 printk(KERN_EMERG "COMM=%s PID=%d\n", current->comm, current->pid); 294 printk(KERN_EMERG "COMM=%s PID=%d\n", current->comm, current->pid);
295 295
296 if (current->mm) { 296 if (current->mm) {
@@ -301,8 +301,7 @@ void dump(struct pt_regs *fp)
301 (int) current->mm->end_data, 301 (int) current->mm->end_data,
302 (int) current->mm->end_data, 302 (int) current->mm->end_data,
303 (int) current->mm->brk); 303 (int) current->mm->brk);
304 printk(KERN_EMERG "USER-STACK=%08x KERNEL-STACK=%08x\n" 304 printk(KERN_EMERG "USER-STACK=%08x KERNEL-STACK=%08x\n\n",
305 KERN_EMERG "\n",
306 (int) current->mm->start_stack, 305 (int) current->mm->start_stack,
307 (int)(((unsigned long) current) + THREAD_SIZE)); 306 (int)(((unsigned long) current) + THREAD_SIZE));
308 } 307 }
@@ -313,35 +312,35 @@ void dump(struct pt_regs *fp)
313 fp->d0, fp->d1, fp->d2, fp->d3); 312 fp->d0, fp->d1, fp->d2, fp->d3);
314 printk(KERN_EMERG "d4: %08lx d5: %08lx a0: %08lx a1: %08lx\n", 313 printk(KERN_EMERG "d4: %08lx d5: %08lx a0: %08lx a1: %08lx\n",
315 fp->d4, fp->d5, fp->a0, fp->a1); 314 fp->d4, fp->d5, fp->a0, fp->a1);
316 printk(KERN_EMERG "\n" KERN_EMERG "USP: %08x TRAPFRAME: %08x\n", 315 printk(KERN_EMERG "\nUSP: %08x TRAPFRAME: %08x\n",
317 (unsigned int) rdusp(), (unsigned int) fp); 316 (unsigned int) rdusp(), (unsigned int) fp);
318 317
319 printk(KERN_EMERG "\n" KERN_EMERG "CODE:"); 318 printk(KERN_EMERG "\nCODE:");
320 tp = ((unsigned char *) fp->pc) - 0x20; 319 tp = ((unsigned char *) fp->pc) - 0x20;
321 for (sp = (unsigned long *) tp, i = 0; (i < 0x40); i += 4) { 320 for (sp = (unsigned long *) tp, i = 0; (i < 0x40); i += 4) {
322 if ((i % 0x10) == 0) 321 if ((i % 0x10) == 0)
323 printk("\n" KERN_EMERG "%08x: ", (int) (tp + i)); 322 printk(KERN_EMERG "%08x: ", (int) (tp + i));
324 printk("%08x ", (int) *sp++); 323 printk("%08x ", (int) *sp++);
325 } 324 }
326 printk("\n" KERN_EMERG "\n"); 325 printk(KERN_EMERG "\n");
327 326
328 printk(KERN_EMERG "KERNEL STACK:"); 327 printk(KERN_EMERG "KERNEL STACK:");
329 tp = ((unsigned char *) fp) - 0x40; 328 tp = ((unsigned char *) fp) - 0x40;
330 for (sp = (unsigned long *) tp, i = 0; (i < 0xc0); i += 4) { 329 for (sp = (unsigned long *) tp, i = 0; (i < 0xc0); i += 4) {
331 if ((i % 0x10) == 0) 330 if ((i % 0x10) == 0)
332 printk("\n" KERN_EMERG "%08x: ", (int) (tp + i)); 331 printk(KERN_EMERG "%08x: ", (int) (tp + i));
333 printk("%08x ", (int) *sp++); 332 printk("%08x ", (int) *sp++);
334 } 333 }
335 printk("\n" KERN_EMERG "\n"); 334 printk(KERN_EMERG "\n");
336 335
337 printk(KERN_EMERG "USER STACK:"); 336 printk(KERN_EMERG "USER STACK:");
338 tp = (unsigned char *) (rdusp() - 0x10); 337 tp = (unsigned char *) (rdusp() - 0x10);
339 for (sp = (unsigned long *) tp, i = 0; (i < 0x80); i += 4) { 338 for (sp = (unsigned long *) tp, i = 0; (i < 0x80); i += 4) {
340 if ((i % 0x10) == 0) 339 if ((i % 0x10) == 0)
341 printk("\n" KERN_EMERG "%08x: ", (int) (tp + i)); 340 printk(KERN_EMERG "%08x: ", (int) (tp + i));
342 printk("%08x ", (int) *sp++); 341 printk("%08x ", (int) *sp++);
343 } 342 }
344 printk("\n" KERN_EMERG "\n"); 343 printk(KERN_EMERG "\n");
345} 344}
346 345
347/* 346/*
diff --git a/arch/m68knommu/kernel/traps.c b/arch/m68knommu/kernel/traps.c
index 51d325343ab5..3739c8f657d7 100644
--- a/arch/m68knommu/kernel/traps.c
+++ b/arch/m68knommu/kernel/traps.c
@@ -111,7 +111,7 @@ static void print_this_address(unsigned long addr, int i)
111 if (i % 5) 111 if (i % 5)
112 printk(KERN_CONT " [%08lx] ", addr); 112 printk(KERN_CONT " [%08lx] ", addr);
113 else 113 else
114 printk(KERN_CONT "\n" KERN_EMERG " [%08lx] ", addr); 114 printk(KERN_EMERG " [%08lx] ", addr);
115 i++; 115 i++;
116#endif 116#endif
117} 117}
@@ -137,8 +137,8 @@ static void __show_stack(struct task_struct *task, unsigned long *stack)
137 if (stack + 1 + i > endstack) 137 if (stack + 1 + i > endstack)
138 break; 138 break;
139 if (i % 8 == 0) 139 if (i % 8 == 0)
140 printk("\n" KERN_EMERG " "); 140 printk(KERN_EMERG " ");
141 printk(" %08lx", *(stack + i)); 141 printk(KERN_CONT " %08lx", *(stack + i));
142 } 142 }
143 printk("\n"); 143 printk("\n");
144 i = 0; 144 i = 0;
diff --git a/arch/microblaze/Kconfig b/arch/microblaze/Kconfig
index b50b845fdd50..2db722d80d4d 100644
--- a/arch/microblaze/Kconfig
+++ b/arch/microblaze/Kconfig
@@ -53,6 +53,9 @@ config GENERIC_HARDIRQS_NO__DO_IRQ
53config GENERIC_GPIO 53config GENERIC_GPIO
54 def_bool y 54 def_bool y
55 55
56config GENERIC_CSUM
57 def_bool y
58
56config PCI 59config PCI
57 def_bool n 60 def_bool n
58 61
diff --git a/arch/microblaze/Makefile b/arch/microblaze/Makefile
index d0bcf80a1136..8439598d4655 100644
--- a/arch/microblaze/Makefile
+++ b/arch/microblaze/Makefile
@@ -6,14 +6,16 @@ endif
6 6
7# What CPU vesion are we building for, and crack it open 7# What CPU vesion are we building for, and crack it open
8# as major.minor.rev 8# as major.minor.rev
9CPU_VER=$(subst ",,$(CONFIG_XILINX_MICROBLAZE0_HW_VER) ) 9CPU_VER := $(shell echo $(CONFIG_XILINX_MICROBLAZE0_HW_VER))
10CPU_MAJOR=$(shell echo $(CPU_VER) | cut -d '.' -f 1) 10CPU_MAJOR := $(shell echo $(CPU_VER) | cut -d '.' -f 1)
11CPU_MINOR=$(shell echo $(CPU_VER) | cut -d '.' -f 2) 11CPU_MINOR := $(shell echo $(CPU_VER) | cut -d '.' -f 2)
12CPU_REV=$(shell echo $(CPU_VER) | cut -d '.' -f 3) 12CPU_REV := $(shell echo $(CPU_VER) | cut -d '.' -f 3)
13 13
14export CPU_VER CPU_MAJOR CPU_MINOR CPU_REV 14export CPU_VER CPU_MAJOR CPU_MINOR CPU_REV
15 15
16# Use cpu-related CONFIG_ vars to set compile options. 16# Use cpu-related CONFIG_ vars to set compile options.
17# The various CONFIG_XILINX cpu features options are integers 0/1/2...
18# rather than bools y/n
17 19
18# Work out HW multipler support. This is icky. 20# Work out HW multipler support. This is icky.
19# 1. Spartan2 has no HW multiplers. 21# 1. Spartan2 has no HW multiplers.
@@ -34,30 +36,29 @@ CPUFLAGS-$(CONFIG_XILINX_MICROBLAZE0_USE_PCMP_INSTR) += -mxl-pattern-compare
34 36
35CPUFLAGS-1 += $(call cc-option,-mcpu=v$(CPU_VER)) 37CPUFLAGS-1 += $(call cc-option,-mcpu=v$(CPU_VER))
36 38
37# The various CONFIG_XILINX cpu features options are integers 0/1/2...
38# rather than bools y/n
39
40# r31 holds current when in kernel mode 39# r31 holds current when in kernel mode
41CFLAGS_KERNEL += -ffixed-r31 $(CPUFLAGS-1) $(CPUFLAGS-2) 40KBUILD_KERNEL += -ffixed-r31 $(CPUFLAGS-1) $(CPUFLAGS-2)
42 41
43LDFLAGS := 42LDFLAGS :=
44LDFLAGS_vmlinux := 43LDFLAGS_vmlinux :=
45LDFLAGS_BLOB := --format binary --oformat elf32-microblaze
46 44
47LIBGCC := $(shell $(CC) $(CFLAGS_KERNEL) -print-libgcc-file-name) 45LIBGCC := $(shell $(CC) $(KBUILD_KERNEL) -print-libgcc-file-name)
48 46
49head-y := arch/microblaze/kernel/head.o 47head-y := arch/microblaze/kernel/head.o
50libs-y += arch/microblaze/lib/ $(LIBGCC) 48libs-y += arch/microblaze/lib/
51core-y += arch/microblaze/kernel/ arch/microblaze/mm/ \ 49libs-y += $(LIBGCC)
52 arch/microblaze/platform/ 50core-y += arch/microblaze/kernel/
51core-y += arch/microblaze/mm/
52core-y += arch/microblaze/platform/
53 53
54boot := arch/$(ARCH)/boot 54boot := arch/microblaze/boot
55 55
56# defines filename extension depending memory management type 56# defines filename extension depending memory management type
57ifeq ($(CONFIG_MMU),) 57ifeq ($(CONFIG_MMU),)
58MMUEXT := -nommu 58MMU := -nommu
59endif 59endif
60export MMUEXT 60
61export MMU
61 62
62all: linux.bin 63all: linux.bin
63 64
diff --git a/arch/microblaze/include/asm/atomic.h b/arch/microblaze/include/asm/atomic.h
index 0de612ad7cb2..6d2e1d418be7 100644
--- a/arch/microblaze/include/asm/atomic.h
+++ b/arch/microblaze/include/asm/atomic.h
@@ -1,95 +1,7 @@
1/*
2 * Copyright (C) 2006 Atmark Techno, Inc.
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
9#ifndef _ASM_MICROBLAZE_ATOMIC_H 1#ifndef _ASM_MICROBLAZE_ATOMIC_H
10#define _ASM_MICROBLAZE_ATOMIC_H 2#define _ASM_MICROBLAZE_ATOMIC_H
11 3
12#include <linux/types.h> 4#include <asm-generic/atomic.h>
13#include <linux/compiler.h> /* likely */
14#include <asm/system.h> /* local_irq_XXX and friends */
15
16#define ATOMIC_INIT(i) { (i) }
17#define atomic_read(v) ((v)->counter)
18#define atomic_set(v, i) (((v)->counter) = (i))
19
20#define atomic_inc(v) (atomic_add_return(1, (v)))
21#define atomic_dec(v) (atomic_sub_return(1, (v)))
22
23#define atomic_add(i, v) (atomic_add_return(i, (v)))
24#define atomic_sub(i, v) (atomic_sub_return(i, (v)))
25
26#define atomic_inc_return(v) (atomic_add_return(1, (v)))
27#define atomic_dec_return(v) (atomic_sub_return(1, (v)))
28
29#define atomic_inc_and_test(v) (atomic_add_return(1, (v)) == 0)
30#define atomic_dec_and_test(v) (atomic_sub_return(1, (v)) == 0)
31
32#define atomic_inc_not_zero(v) (atomic_add_unless((v), 1, 0))
33
34#define atomic_sub_and_test(i, v) (atomic_sub_return((i), (v)) == 0)
35
36static inline int atomic_cmpxchg(atomic_t *v, int old, int new)
37{
38 int ret;
39 unsigned long flags;
40
41 local_irq_save(flags);
42 ret = v->counter;
43 if (likely(ret == old))
44 v->counter = new;
45 local_irq_restore(flags);
46
47 return ret;
48}
49
50static inline int atomic_add_unless(atomic_t *v, int a, int u)
51{
52 int c, old;
53
54 c = atomic_read(v);
55 while (c != u && (old = atomic_cmpxchg((v), c, c + a)) != c)
56 c = old;
57 return c != u;
58}
59
60static inline void atomic_clear_mask(unsigned long mask, unsigned long *addr)
61{
62 unsigned long flags;
63
64 local_irq_save(flags);
65 *addr &= ~mask;
66 local_irq_restore(flags);
67}
68
69/**
70 * atomic_add_return - add and return
71 * @i: integer value to add
72 * @v: pointer of type atomic_t
73 *
74 * Atomically adds @i to @v and returns @i + @v
75 */
76static inline int atomic_add_return(int i, atomic_t *v)
77{
78 unsigned long flags;
79 int val;
80
81 local_irq_save(flags);
82 val = v->counter;
83 v->counter = val += i;
84 local_irq_restore(flags);
85
86 return val;
87}
88
89static inline int atomic_sub_return(int i, atomic_t *v)
90{
91 return atomic_add_return(-i, v);
92}
93 5
94/* 6/*
95 * Atomically test *v and decrement if it is greater than 0. 7 * Atomically test *v and decrement if it is greater than 0.
@@ -109,15 +21,4 @@ static inline int atomic_dec_if_positive(atomic_t *v)
109 return res; 21 return res;
110} 22}
111 23
112#define atomic_add_negative(a, v) (atomic_add_return((a), (v)) < 0)
113#define atomic_xchg(v, new) (xchg(&((v)->counter), new))
114
115/* Atomic operations are already serializing */
116#define smp_mb__before_atomic_dec() barrier()
117#define smp_mb__after_atomic_dec() barrier()
118#define smp_mb__before_atomic_inc() barrier()
119#define smp_mb__after_atomic_inc() barrier()
120
121#include <asm-generic/atomic-long.h>
122
123#endif /* _ASM_MICROBLAZE_ATOMIC_H */ 24#endif /* _ASM_MICROBLAZE_ATOMIC_H */
diff --git a/arch/microblaze/include/asm/bitops.h b/arch/microblaze/include/asm/bitops.h
index d6df1fd4e1e8..a72468f15c8b 100644
--- a/arch/microblaze/include/asm/bitops.h
+++ b/arch/microblaze/include/asm/bitops.h
@@ -1,27 +1 @@
1/*
2 * Copyright (C) 2006 Atmark Techno, Inc.
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
9#ifndef _ASM_MICROBLAZE_BITOPS_H
10#define _ASM_MICROBLAZE_BITOPS_H
11
12/*
13 * Copyright 1992, Linus Torvalds.
14 */
15
16#include <asm/byteorder.h> /* swab32 */
17#include <asm/system.h> /* save_flags */
18
19/*
20 * clear_bit() doesn't provide any barrier for the compiler.
21 */
22#define smp_mb__before_clear_bit() barrier()
23#define smp_mb__after_clear_bit() barrier()
24#include <asm-generic/bitops.h> #include <asm-generic/bitops.h>
25#include <asm-generic/bitops/__fls.h>
26
27#endif /* _ASM_MICROBLAZE_BITOPS_H */
diff --git a/arch/microblaze/include/asm/bug.h b/arch/microblaze/include/asm/bug.h
index 8eb2cdde11d7..b12fd89e42e9 100644
--- a/arch/microblaze/include/asm/bug.h
+++ b/arch/microblaze/include/asm/bug.h
@@ -1,15 +1 @@
1/*
2 * Copyright (C) 2006 Atmark Techno, Inc.
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
9#ifndef _ASM_MICROBLAZE_BUG_H
10#define _ASM_MICROBLAZE_BUG_H
11
12#include <linux/kernel.h>
13#include <asm-generic/bug.h> #include <asm-generic/bug.h>
14
15#endif /* _ASM_MICROBLAZE_BUG_H */
diff --git a/arch/microblaze/include/asm/bugs.h b/arch/microblaze/include/asm/bugs.h
index f2c6593653fb..61791e1ad9f5 100644
--- a/arch/microblaze/include/asm/bugs.h
+++ b/arch/microblaze/include/asm/bugs.h
@@ -1,17 +1 @@
1/* #include <asm-generic/bugs.h>
2 * Copyright (C) 2006 Atmark Techno, Inc.
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
9#ifndef _ASM_MICROBLAZE_BUGS_H
10#define _ASM_MICROBLAZE_BUGS_H
11
12static inline void check_bugs(void)
13{
14 /* nothing to do */
15}
16
17#endif /* _ASM_MICROBLAZE_BUGS_H */
diff --git a/arch/microblaze/include/asm/checksum.h b/arch/microblaze/include/asm/checksum.h
index 97ea46b5cf80..128bf03b54b7 100644
--- a/arch/microblaze/include/asm/checksum.h
+++ b/arch/microblaze/include/asm/checksum.h
@@ -10,12 +10,11 @@
10#ifndef _ASM_MICROBLAZE_CHECKSUM_H 10#ifndef _ASM_MICROBLAZE_CHECKSUM_H
11#define _ASM_MICROBLAZE_CHECKSUM_H 11#define _ASM_MICROBLAZE_CHECKSUM_H
12 12
13#include <linux/in6.h>
14
15/* 13/*
16 * computes the checksum of the TCP/UDP pseudo-header 14 * computes the checksum of the TCP/UDP pseudo-header
17 * returns a 16-bit checksum, already complemented 15 * returns a 16-bit checksum, already complemented
18 */ 16 */
17#define csum_tcpudp_nofold csum_tcpudp_nofold
19static inline __wsum 18static inline __wsum
20csum_tcpudp_nofold(__be32 saddr, __be32 daddr, unsigned short len, 19csum_tcpudp_nofold(__be32 saddr, __be32 daddr, unsigned short len,
21 unsigned short proto, __wsum sum) 20 unsigned short proto, __wsum sum)
@@ -30,71 +29,6 @@ csum_tcpudp_nofold(__be32 saddr, __be32 daddr, unsigned short len,
30 return sum; 29 return sum;
31} 30}
32 31
33/* 32#include <asm-generic/checksum.h>
34 * computes the checksum of a memory block at buff, length len,
35 * and adds in "sum" (32-bit)
36 *
37 * returns a 32-bit number suitable for feeding into itself
38 * or csum_tcpudp_magic
39 *
40 * this function must be called with even lengths, except
41 * for the last fragment, which may be odd
42 *
43 * it's best to have buff aligned on a 32-bit boundary
44 */
45extern __wsum csum_partial(const void *buff, int len, __wsum sum);
46
47/*
48 * the same as csum_partial, but copies from src while it
49 * checksums
50 *
51 * here even more important to align src and dst on a 32-bit (or even
52 * better 64-bit) boundary
53 */
54extern __wsum csum_partial_copy(const void *src, void *dst, int len,
55 __wsum sum);
56
57/*
58 * the same as csum_partial_copy, but copies from user space.
59 *
60 * here even more important to align src and dst on a 32-bit (or even
61 * better 64-bit) boundary
62 */
63extern __wsum csum_partial_copy_from_user(const void __user *src, void *dst,
64 int len, __wsum sum, int *csum_err);
65
66#define csum_partial_copy_nocheck(src, dst, len, sum) \
67 csum_partial_copy((src), (dst), (len), (sum))
68
69/*
70 * This is a version of ip_compute_csum() optimized for IP headers,
71 * which always checksum on 4 octet boundaries.
72 *
73 */
74extern __sum16 ip_fast_csum(const void *iph, unsigned int ihl);
75
76/*
77 * Fold a partial checksum
78 */
79static inline __sum16 csum_fold(__wsum csum)
80{
81 u32 sum = (__force u32)csum;
82 sum = (sum & 0xffff) + (sum >> 16);
83 sum = (sum & 0xffff) + (sum >> 16);
84 return (__force __sum16)~sum;
85}
86
87static inline __sum16
88csum_tcpudp_magic(__be32 saddr, __be32 daddr, unsigned short len,
89 unsigned short proto, __wsum sum)
90{
91 return csum_fold(csum_tcpudp_nofold(saddr, daddr, len, proto, sum));
92}
93
94/*
95 * this routine is used for miscellaneous IP-like checksums, mainly
96 * in icmp.c
97 */
98extern __sum16 ip_compute_csum(const void *buff, int len);
99 33
100#endif /* _ASM_MICROBLAZE_CHECKSUM_H */ 34#endif /* _ASM_MICROBLAZE_CHECKSUM_H */
diff --git a/arch/microblaze/include/asm/fb.h b/arch/microblaze/include/asm/fb.h
new file mode 100644
index 000000000000..3a4988e8df45
--- /dev/null
+++ b/arch/microblaze/include/asm/fb.h
@@ -0,0 +1 @@
#include <asm-generic/fb.h>
diff --git a/arch/microblaze/include/asm/hardirq.h b/arch/microblaze/include/asm/hardirq.h
index 0f2d6b013e11..41e1e1aa36ac 100644
--- a/arch/microblaze/include/asm/hardirq.h
+++ b/arch/microblaze/include/asm/hardirq.h
@@ -9,21 +9,11 @@
9#ifndef _ASM_MICROBLAZE_HARDIRQ_H 9#ifndef _ASM_MICROBLAZE_HARDIRQ_H
10#define _ASM_MICROBLAZE_HARDIRQ_H 10#define _ASM_MICROBLAZE_HARDIRQ_H
11 11
12#include <linux/cache.h>
13#include <linux/irq.h>
14#include <asm/irq.h>
15#include <asm/current.h>
16#include <linux/ptrace.h>
17
18/* should be defined in each interrupt controller driver */ 12/* should be defined in each interrupt controller driver */
19extern unsigned int get_irq(struct pt_regs *regs); 13extern unsigned int get_irq(struct pt_regs *regs);
20 14
21typedef struct { 15#define ack_bad_irq ack_bad_irq
22 unsigned int __softirq_pending;
23} ____cacheline_aligned irq_cpustat_t;
24
25void ack_bad_irq(unsigned int irq); 16void ack_bad_irq(unsigned int irq);
26 17#include <asm-generic/hardirq.h>
27#include <linux/irq_cpustat.h> /* Standard mappings for irq_cpustat_t above */
28 18
29#endif /* _ASM_MICROBLAZE_HARDIRQ_H */ 19#endif /* _ASM_MICROBLAZE_HARDIRQ_H */
diff --git a/arch/microblaze/include/asm/io.h b/arch/microblaze/include/asm/io.h
index 5c173424d074..7c3ec13b44d8 100644
--- a/arch/microblaze/include/asm/io.h
+++ b/arch/microblaze/include/asm/io.h
@@ -14,7 +14,6 @@
14#include <asm/byteorder.h> 14#include <asm/byteorder.h>
15#include <asm/page.h> 15#include <asm/page.h>
16#include <linux/types.h> 16#include <linux/types.h>
17#include <asm/byteorder.h>
18#include <linux/mm.h> /* Get struct page {...} */ 17#include <linux/mm.h> /* Get struct page {...} */
19 18
20 19
diff --git a/arch/microblaze/include/asm/ioctls.h b/arch/microblaze/include/asm/ioctls.h
index 03582b249204..ec34c760665e 100644
--- a/arch/microblaze/include/asm/ioctls.h
+++ b/arch/microblaze/include/asm/ioctls.h
@@ -1,91 +1 @@
1/* #include <asm-generic/ioctls.h>
2 * Copyright (C) 2006 Atmark Techno, Inc.
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
9#ifndef _ASM_MICROBLAZE_IOCTLS_H
10#define _ASM_MICROBLAZE_IOCTLS_H
11
12#include <linux/ioctl.h>
13
14/* 0x54 is just a magic number to make these relatively unique ('T') */
15
16#define TCGETS 0x5401
17#define TCSETS 0x5402
18#define TCSETSW 0x5403
19#define TCSETSF 0x5404
20#define TCGETA 0x5405
21#define TCSETA 0x5406
22#define TCSETAW 0x5407
23#define TCSETAF 0x5408
24#define TCSBRK 0x5409
25#define TCXONC 0x540A
26#define TCFLSH 0x540B
27#define TIOCEXCL 0x540C
28#define TIOCNXCL 0x540D
29#define TIOCSCTTY 0x540E
30#define TIOCGPGRP 0x540F
31#define TIOCSPGRP 0x5410
32#define TIOCOUTQ 0x5411
33#define TIOCSTI 0x5412
34#define TIOCGWINSZ 0x5413
35#define TIOCSWINSZ 0x5414
36#define TIOCMGET 0x5415
37#define TIOCMBIS 0x5416
38#define TIOCMBIC 0x5417
39#define TIOCMSET 0x5418
40#define TIOCGSOFTCAR 0x5419
41#define TIOCSSOFTCAR 0x541A
42#define FIONREAD 0x541B
43#define TIOCINQ FIONREAD
44#define TIOCLINUX 0x541C
45#define TIOCCONS 0x541D
46#define TIOCGSERIAL 0x541E
47#define TIOCSSERIAL 0x541F
48#define TIOCPKT 0x5420
49#define FIONBIO 0x5421
50#define TIOCNOTTY 0x5422
51#define TIOCSETD 0x5423
52#define TIOCGETD 0x5424
53#define TCSBRKP 0x5425 /* Needed for POSIX tcsendbreak() */
54#define TIOCTTYGSTRUCT 0x5426 /* For debugging only */
55#define TIOCSBRK 0x5427 /* BSD compatibility */
56#define TIOCCBRK 0x5428 /* BSD compatibility */
57#define TIOCGSID 0x5429 /* Return the session ID of FD */
58/* Get Pty Number (of pty-mux device) */
59#define TIOCGPTN _IOR('T', 0x30, unsigned int)
60#define TIOCSPTLCK _IOW('T', 0x31, int) /* Lock/unlock Pty */
61
62#define FIONCLEX 0x5450 /* these numbers need to be adjusted. */
63#define FIOCLEX 0x5451
64#define FIOASYNC 0x5452
65#define TIOCSERCONFIG 0x5453
66#define TIOCSERGWILD 0x5454
67#define TIOCSERSWILD 0x5455
68#define TIOCGLCKTRMIOS 0x5456
69#define TIOCSLCKTRMIOS 0x5457
70#define TIOCSERGSTRUCT 0x5458 /* For debugging only */
71#define TIOCSERGETLSR 0x5459 /* Get line status register */
72#define TIOCSERGETMULTI 0x545A /* Get multiport config */
73#define TIOCSERSETMULTI 0x545B /* Set multiport config */
74
75#define TIOCMIWAIT 0x545C /* wait for a change on serial input line(s) */
76#define TIOCGICOUNT 0x545D /* read serial port inline interrupt counts */
77
78#define FIOQSIZE 0x545E
79
80/* Used for packet mode */
81#define TIOCPKT_DATA 0
82#define TIOCPKT_FLUSHREAD 1
83#define TIOCPKT_FLUSHWRITE 2
84#define TIOCPKT_STOP 4
85#define TIOCPKT_START 8
86#define TIOCPKT_NOSTOP 16
87#define TIOCPKT_DOSTOP 32
88
89#define TIOCSER_TEMT 0x01 /* Transmitter physically empty */
90
91#endif /* _ASM_MICROBLAZE_IOCTLS_H */
diff --git a/arch/microblaze/include/asm/ipcbuf.h b/arch/microblaze/include/asm/ipcbuf.h
index b056fa420654..84c7e51cb6d0 100644
--- a/arch/microblaze/include/asm/ipcbuf.h
+++ b/arch/microblaze/include/asm/ipcbuf.h
@@ -1,36 +1 @@
1/* #include <asm-generic/ipcbuf.h>
2 * Copyright (C) 2006 Atmark Techno, Inc.
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
9#ifndef _ASM_MICROBLAZE_IPCBUF_H
10#define _ASM_MICROBLAZE_IPCBUF_H
11
12/*
13 * The user_ipc_perm structure for microblaze architecture.
14 * Note extra padding because this structure is passed back and forth
15 * between kernel and user space.
16 *
17 * Pad space is left for:
18 * - 32-bit mode_t and seq
19 * - 2 miscellaneous 32-bit values
20 */
21
22struct ipc64_perm {
23 __kernel_key_t key;
24 __kernel_uid32_t uid;
25 __kernel_gid32_t gid;
26 __kernel_uid32_t cuid;
27 __kernel_gid32_t cgid;
28 __kernel_mode_t mode;
29 unsigned short __pad1;
30 unsigned short seq;
31 unsigned short __pad2;
32 unsigned long __unused1;
33 unsigned long __unused2;
34};
35
36#endif /* _ASM_MICROBLAZE_IPCBUF_H */
diff --git a/arch/microblaze/include/asm/irq.h b/arch/microblaze/include/asm/irq.h
index db515deaa720..90f050535ebe 100644
--- a/arch/microblaze/include/asm/irq.h
+++ b/arch/microblaze/include/asm/irq.h
@@ -10,6 +10,7 @@
10#define _ASM_MICROBLAZE_IRQ_H 10#define _ASM_MICROBLAZE_IRQ_H
11 11
12#define NR_IRQS 32 12#define NR_IRQS 32
13#include <asm-generic/irq.h>
13 14
14#include <linux/interrupt.h> 15#include <linux/interrupt.h>
15 16
@@ -17,11 +18,6 @@ extern unsigned int nr_irq;
17 18
18#define NO_IRQ (-1) 19#define NO_IRQ (-1)
19 20
20static inline int irq_canonicalize(int irq)
21{
22 return irq;
23}
24
25struct pt_regs; 21struct pt_regs;
26extern void do_IRQ(struct pt_regs *regs); 22extern void do_IRQ(struct pt_regs *regs);
27 23
diff --git a/arch/microblaze/include/asm/mman.h b/arch/microblaze/include/asm/mman.h
index 4914b1329445..8eebf89f5ab1 100644
--- a/arch/microblaze/include/asm/mman.h
+++ b/arch/microblaze/include/asm/mman.h
@@ -1,25 +1 @@
1/*
2 * Copyright (C) 2006 Atmark Techno, Inc.
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
9#ifndef _ASM_MICROBLAZE_MMAN_H
10#define _ASM_MICROBLAZE_MMAN_H
11
12#include <asm-generic/mman.h> #include <asm-generic/mman.h>
13
14#define MAP_GROWSDOWN 0x0100 /* stack-like segment */
15#define MAP_DENYWRITE 0x0800 /* ETXTBSY */
16#define MAP_EXECUTABLE 0x1000 /* mark it as an executable */
17#define MAP_LOCKED 0x2000 /* pages are locked */
18#define MAP_NORESERVE 0x4000 /* don't check for reservations */
19#define MAP_POPULATE 0x8000 /* populate (prefault) pagetables */
20#define MAP_NONBLOCK 0x10000 /* do not block on IO */
21
22#define MCL_CURRENT 1 /* lock all current mappings */
23#define MCL_FUTURE 2 /* lock all future mappings */
24
25#endif /* _ASM_MICROBLAZE_MMAN_H */
diff --git a/arch/microblaze/include/asm/mmu.h b/arch/microblaze/include/asm/mmu.h
index 66cad6a99d77..8d6a654ceffb 100644
--- a/arch/microblaze/include/asm/mmu.h
+++ b/arch/microblaze/include/asm/mmu.h
@@ -12,12 +12,7 @@
12#define _ASM_MICROBLAZE_MMU_H 12#define _ASM_MICROBLAZE_MMU_H
13 13
14# ifndef CONFIG_MMU 14# ifndef CONFIG_MMU
15# ifndef __ASSEMBLY__ 15# include <asm-generic/mmu.h>
16typedef struct {
17 struct vm_list_struct *vmlist;
18 unsigned long end_brk;
19} mm_context_t;
20# endif /* __ASSEMBLY__ */
21# else /* CONFIG_MMU */ 16# else /* CONFIG_MMU */
22# ifdef __KERNEL__ 17# ifdef __KERNEL__
23# ifndef __ASSEMBLY__ 18# ifndef __ASSEMBLY__
diff --git a/arch/microblaze/include/asm/mmu_context.h b/arch/microblaze/include/asm/mmu_context.h
index 385fed16bbfb..24eab1674d3e 100644
--- a/arch/microblaze/include/asm/mmu_context.h
+++ b/arch/microblaze/include/asm/mmu_context.h
@@ -1,5 +1,5 @@
1#ifdef CONFIG_MMU 1#ifdef CONFIG_MMU
2# include "mmu_context_mm.h" 2# include "mmu_context_mm.h"
3#else 3#else
4# include "mmu_context_no.h" 4# include <asm-generic/mmu_context.h>
5#endif 5#endif
diff --git a/arch/microblaze/include/asm/mmu_context_no.h b/arch/microblaze/include/asm/mmu_context_no.h
deleted file mode 100644
index ba5567190154..000000000000
--- a/arch/microblaze/include/asm/mmu_context_no.h
+++ /dev/null
@@ -1,23 +0,0 @@
1/*
2 * Copyright (C) 2008-2009 Michal Simek <monstr@monstr.eu>
3 * Copyright (C) 2008-2009 PetaLogix
4 * Copyright (C) 2006 Atmark Techno, Inc.
5 *
6 * This file is subject to the terms and conditions of the GNU General Public
7 * License. See the file "COPYING" in the main directory of this archive
8 * for more details.
9 */
10
11#ifndef _ASM_MICROBLAZE_MMU_CONTEXT_H
12#define _ASM_MICROBLAZE_MMU_CONTEXT_H
13
14# define init_new_context(tsk, mm) ({ 0; })
15
16# define enter_lazy_tlb(mm, tsk) do {} while (0)
17# define change_mm_context(old, ctx, _pml4) do {} while (0)
18# define destroy_context(mm) do {} while (0)
19# define deactivate_mm(tsk, mm) do {} while (0)
20# define switch_mm(prev, next, tsk) do {} while (0)
21# define activate_mm(prev, next) do {} while (0)
22
23#endif /* _ASM_MICROBLAZE_MMU_CONTEXT_H */
diff --git a/arch/microblaze/include/asm/module.h b/arch/microblaze/include/asm/module.h
index 914565a90315..7be1347fce42 100644
--- a/arch/microblaze/include/asm/module.h
+++ b/arch/microblaze/include/asm/module.h
@@ -9,6 +9,8 @@
9#ifndef _ASM_MICROBLAZE_MODULE_H 9#ifndef _ASM_MICROBLAZE_MODULE_H
10#define _ASM_MICROBLAZE_MODULE_H 10#define _ASM_MICROBLAZE_MODULE_H
11 11
12#include <asm-generic/module.h>
13
12/* Microblaze Relocations */ 14/* Microblaze Relocations */
13#define R_MICROBLAZE_NONE 0 15#define R_MICROBLAZE_NONE 0
14#define R_MICROBLAZE_32 1 16#define R_MICROBLAZE_32 1
@@ -24,14 +26,6 @@
24/* Keep this the last entry. */ 26/* Keep this the last entry. */
25#define R_MICROBLAZE_NUM 11 27#define R_MICROBLAZE_NUM 11
26 28
27struct mod_arch_specific {
28 int foo;
29};
30
31#define Elf_Shdr Elf32_Shdr
32#define Elf_Sym Elf32_Sym
33#define Elf_Ehdr Elf32_Ehdr
34
35typedef struct { volatile int counter; } module_t; 29typedef struct { volatile int counter; } module_t;
36 30
37#endif /* _ASM_MICROBLAZE_MODULE_H */ 31#endif /* _ASM_MICROBLAZE_MODULE_H */
diff --git a/arch/microblaze/include/asm/msgbuf.h b/arch/microblaze/include/asm/msgbuf.h
index 09dd97097211..809134c644a6 100644
--- a/arch/microblaze/include/asm/msgbuf.h
+++ b/arch/microblaze/include/asm/msgbuf.h
@@ -1,31 +1 @@
1#ifndef _ASM_MICROBLAZE_MSGBUF_H #include <asm-generic/msgbuf.h>
2#define _ASM_MICROBLAZE_MSGBUF_H
3
4/*
5 * The msqid64_ds structure for microblaze architecture.
6 * Note extra padding because this structure is passed back and forth
7 * between kernel and user space.
8 *
9 * Pad space is left for:
10 * - 64-bit time_t to solve y2038 problem
11 * - 2 miscellaneous 32-bit values
12 */
13
14struct msqid64_ds {
15 struct ipc64_perm msg_perm;
16 __kernel_time_t msg_stime; /* last msgsnd time */
17 unsigned long __unused1;
18 __kernel_time_t msg_rtime; /* last msgrcv time */
19 unsigned long __unused2;
20 __kernel_time_t msg_ctime; /* last change time */
21 unsigned long __unused3;
22 unsigned long msg_cbytes; /* current number of bytes on queue */
23 unsigned long msg_qnum; /* number of messages in queue */
24 unsigned long msg_qbytes; /* max number of bytes on queue */
25 __kernel_pid_t msg_lspid; /* pid of last msgsnd */
26 __kernel_pid_t msg_lrpid; /* last receive pid */
27 unsigned long __unused4;
28 unsigned long __unused5;
29};
30
31#endif /* _ASM_MICROBLAZE_MSGBUF_H */
diff --git a/arch/microblaze/include/asm/param.h b/arch/microblaze/include/asm/param.h
index 8c538a49616d..965d45427975 100644
--- a/arch/microblaze/include/asm/param.h
+++ b/arch/microblaze/include/asm/param.h
@@ -1,30 +1 @@
1/* #include <asm-generic/param.h>
2 * Copyright (C) 2006 Atmark Techno, Inc.
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
9#ifndef _ASM_MICROBLAZE_PARAM_H
10#define _ASM_MICROBLAZE_PARAM_H
11
12#ifdef __KERNEL__
13#define HZ CONFIG_HZ /* internal kernel timer frequency */
14#define USER_HZ 100 /* for user interfaces in "ticks" */
15#define CLOCKS_PER_SEC (USER_HZ) /* frequency at which times() counts */
16#endif /* __KERNEL__ */
17
18#ifndef HZ
19#define HZ 100
20#endif
21
22#define EXEC_PAGESIZE 4096
23
24#ifndef NOGROUP
25#define NOGROUP (-1)
26#endif
27
28#define MAXHOSTNAMELEN 64 /* max length of hostname */
29
30#endif /* _ASM_MICROBLAZE_PARAM_H */
diff --git a/arch/microblaze/include/asm/parport.h b/arch/microblaze/include/asm/parport.h
new file mode 100644
index 000000000000..cf252af64590
--- /dev/null
+++ b/arch/microblaze/include/asm/parport.h
@@ -0,0 +1 @@
#include <asm-generic/parport.h>
diff --git a/arch/microblaze/include/asm/pci.h b/arch/microblaze/include/asm/pci.h
index ca03794cf3f0..9f0df5faf2c8 100644
--- a/arch/microblaze/include/asm/pci.h
+++ b/arch/microblaze/include/asm/pci.h
@@ -1 +1 @@
#include <linux/io.h> #include <asm-generic/pci.h>
diff --git a/arch/microblaze/include/asm/pgalloc.h b/arch/microblaze/include/asm/pgalloc.h
index 59a757e46ba5..b0131da1387b 100644
--- a/arch/microblaze/include/asm/pgalloc.h
+++ b/arch/microblaze/include/asm/pgalloc.h
@@ -180,7 +180,7 @@ extern inline void pte_free(struct mm_struct *mm, struct page *ptepage)
180 __free_page(ptepage); 180 __free_page(ptepage);
181} 181}
182 182
183#define __pte_free_tlb(tlb, pte) pte_free((tlb)->mm, (pte)) 183#define __pte_free_tlb(tlb, pte, addr) pte_free((tlb)->mm, (pte))
184 184
185#define pmd_populate(mm, pmd, pte) (pmd_val(*(pmd)) = page_address(pte)) 185#define pmd_populate(mm, pmd, pte) (pmd_val(*(pmd)) = page_address(pte))
186 186
@@ -193,7 +193,7 @@ extern inline void pte_free(struct mm_struct *mm, struct page *ptepage)
193 */ 193 */
194#define pmd_alloc_one(mm, address) ({ BUG(); ((pmd_t *)2); }) 194#define pmd_alloc_one(mm, address) ({ BUG(); ((pmd_t *)2); })
195/*#define pmd_free(mm, x) do { } while (0)*/ 195/*#define pmd_free(mm, x) do { } while (0)*/
196#define __pmd_free_tlb(tlb, x) do { } while (0) 196#define __pmd_free_tlb(tlb, x, addr) do { } while (0)
197#define pgd_populate(mm, pmd, pte) BUG() 197#define pgd_populate(mm, pmd, pte) BUG()
198 198
199extern int do_check_pgt_cache(int, int); 199extern int do_check_pgt_cache(int, int);
diff --git a/arch/microblaze/include/asm/pgtable.h b/arch/microblaze/include/asm/pgtable.h
index 4c57a586a989..cc3a4dfc3eaa 100644
--- a/arch/microblaze/include/asm/pgtable.h
+++ b/arch/microblaze/include/asm/pgtable.h
@@ -185,6 +185,7 @@ static inline pte_t pte_mkspecial(pte_t pte) { return pte; }
185 185
186/* Definitions for MicroBlaze. */ 186/* Definitions for MicroBlaze. */
187#define _PAGE_GUARDED 0x001 /* G: page is guarded from prefetch */ 187#define _PAGE_GUARDED 0x001 /* G: page is guarded from prefetch */
188#define _PAGE_FILE 0x001 /* when !present: nonlinear file mapping */
188#define _PAGE_PRESENT 0x002 /* software: PTE contains a translation */ 189#define _PAGE_PRESENT 0x002 /* software: PTE contains a translation */
189#define _PAGE_NO_CACHE 0x004 /* I: caching is inhibited */ 190#define _PAGE_NO_CACHE 0x004 /* I: caching is inhibited */
190#define _PAGE_WRITETHRU 0x008 /* W: caching is write-through */ 191#define _PAGE_WRITETHRU 0x008 /* W: caching is write-through */
@@ -320,8 +321,7 @@ static inline int pte_write(pte_t pte) { return pte_val(pte) & _PAGE_RW; }
320static inline int pte_exec(pte_t pte) { return pte_val(pte) & _PAGE_EXEC; } 321static inline int pte_exec(pte_t pte) { return pte_val(pte) & _PAGE_EXEC; }
321static inline int pte_dirty(pte_t pte) { return pte_val(pte) & _PAGE_DIRTY; } 322static inline int pte_dirty(pte_t pte) { return pte_val(pte) & _PAGE_DIRTY; }
322static inline int pte_young(pte_t pte) { return pte_val(pte) & _PAGE_ACCESSED; } 323static inline int pte_young(pte_t pte) { return pte_val(pte) & _PAGE_ACCESSED; }
323/* FIXME */ 324static inline int pte_file(pte_t pte) { return pte_val(pte) & _PAGE_FILE; }
324static inline int pte_file(pte_t pte) { return 0; }
325 325
326static inline void pte_uncache(pte_t pte) { pte_val(pte) |= _PAGE_NO_CACHE; } 326static inline void pte_uncache(pte_t pte) { pte_val(pte) |= _PAGE_NO_CACHE; }
327static inline void pte_cache(pte_t pte) { pte_val(pte) &= ~_PAGE_NO_CACHE; } 327static inline void pte_cache(pte_t pte) { pte_val(pte) &= ~_PAGE_NO_CACHE; }
@@ -488,7 +488,7 @@ static inline pmd_t *pmd_offset(pgd_t *dir, unsigned long address)
488/* Encode and decode a nonlinear file mapping entry */ 488/* Encode and decode a nonlinear file mapping entry */
489#define PTE_FILE_MAX_BITS 29 489#define PTE_FILE_MAX_BITS 29
490#define pte_to_pgoff(pte) (pte_val(pte) >> 3) 490#define pte_to_pgoff(pte) (pte_val(pte) >> 3)
491#define pgoff_to_pte(off) ((pte_t) { ((off) << 3) }) 491#define pgoff_to_pte(off) ((pte_t) { ((off) << 3) | _PAGE_FILE })
492 492
493extern pgd_t swapper_pg_dir[PTRS_PER_PGD]; 493extern pgd_t swapper_pg_dir[PTRS_PER_PGD];
494 494
diff --git a/arch/microblaze/include/asm/posix_types.h b/arch/microblaze/include/asm/posix_types.h
index 8c758b231f37..0e15039673e3 100644
--- a/arch/microblaze/include/asm/posix_types.h
+++ b/arch/microblaze/include/asm/posix_types.h
@@ -1,73 +1,9 @@
1/*
2 * Copyright (C) 2006 Atmark Techno, Inc.
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
9#ifndef _ASM_MICROBLAZE_POSIX_TYPES_H 1#ifndef _ASM_MICROBLAZE_POSIX_TYPES_H
10#define _ASM_MICROBLAZE_POSIX_TYPES_H 2#define _ASM_MICROBLAZE_POSIX_TYPES_H
11 3
12/*
13 * This file is generally used by user-level software, so you need to
14 * be a little careful about namespace pollution etc. Also, we cannot
15 * assume GCC is being used.
16 */
17
18typedef unsigned long __kernel_ino_t;
19typedef unsigned short __kernel_mode_t; 4typedef unsigned short __kernel_mode_t;
20typedef unsigned int __kernel_nlink_t; 5#define __kernel_mode_t __kernel_mode_t
21typedef long __kernel_off_t;
22typedef int __kernel_pid_t;
23typedef unsigned int __kernel_ipc_pid_t;
24typedef unsigned int __kernel_uid_t;
25typedef unsigned int __kernel_gid_t;
26typedef unsigned long __kernel_size_t;
27typedef long __kernel_ssize_t;
28typedef int __kernel_ptrdiff_t;
29typedef long __kernel_time_t;
30typedef long __kernel_suseconds_t;
31typedef long __kernel_clock_t;
32typedef int __kernel_timer_t;
33typedef int __kernel_clockid_t;
34typedef int __kernel_daddr_t;
35typedef char *__kernel_caddr_t;
36typedef unsigned short __kernel_uid16_t;
37typedef unsigned short __kernel_gid16_t;
38typedef unsigned int __kernel_uid32_t;
39typedef unsigned int __kernel_gid32_t;
40
41typedef unsigned int __kernel_old_uid_t;
42typedef unsigned int __kernel_old_gid_t;
43typedef unsigned int __kernel_old_dev_t;
44
45#ifdef __GNUC__
46typedef long long __kernel_loff_t;
47#endif
48
49typedef struct {
50#if defined(__KERNEL__) || defined(__USE_ALL)
51 int val[2];
52#else /* !defined(__KERNEL__) && !defined(__USE_ALL) */
53 int __val[2];
54#endif /* !defined(__KERNEL__) && !defined(__USE_ALL) */
55} __kernel_fsid_t;
56
57#if defined(__KERNEL__) || !defined(__GLIBC__) || (__GLIBC__ < 2)
58
59#undef __FD_SET
60#define __FD_SET(d, set) ((set)->fds_bits[__FDELT(d)] |= __FDMASK(d))
61
62#undef __FD_CLR
63#define __FD_CLR(d, set) ((set)->fds_bits[__FDELT(d)] &= ~__FDMASK(d))
64
65#undef __FD_ISSET
66#define __FD_ISSET(d, set) (!!((set)->fds_bits[__FDELT(d)] & __FDMASK(d)))
67
68#undef __FD_ZERO
69#define __FD_ZERO(fdsetp) (memset(fdsetp, 0, sizeof(*(fd_set *)fdsetp)))
70 6
71#endif /* defined(__KERNEL__) || !defined(__GLIBC__) || (__GLIBC__ < 2) */ 7#include <asm-generic/posix_types.h>
72 8
73#endif /* _ASM_MICROBLAZE_POSIX_TYPES_H */ 9#endif /* _ASM_MICROBLAZE_POSIX_TYPES_H */
diff --git a/arch/microblaze/include/asm/prom.h b/arch/microblaze/include/asm/prom.h
index 20f7b3a926e8..37e6f305a68e 100644
--- a/arch/microblaze/include/asm/prom.h
+++ b/arch/microblaze/include/asm/prom.h
@@ -16,6 +16,18 @@
16#define _ASM_MICROBLAZE_PROM_H 16#define _ASM_MICROBLAZE_PROM_H
17#ifdef __KERNEL__ 17#ifdef __KERNEL__
18 18
19/* Definitions used by the flattened device tree */
20#define OF_DT_HEADER 0xd00dfeed /* marker */
21#define OF_DT_BEGIN_NODE 0x1 /* Start of node, full name */
22#define OF_DT_END_NODE 0x2 /* End node */
23#define OF_DT_PROP 0x3 /* Property: name off, size, content */
24#define OF_DT_NOP 0x4 /* nop */
25#define OF_DT_END 0x9
26
27#define OF_DT_VERSION 0x10
28
29#ifndef __ASSEMBLY__
30
19#include <linux/types.h> 31#include <linux/types.h>
20#include <linux/proc_fs.h> 32#include <linux/proc_fs.h>
21#include <linux/platform_device.h> 33#include <linux/platform_device.h>
@@ -29,16 +41,6 @@
29#define of_prop_cmp(s1, s2) strcmp((s1), (s2)) 41#define of_prop_cmp(s1, s2) strcmp((s1), (s2))
30#define of_node_cmp(s1, s2) strcasecmp((s1), (s2)) 42#define of_node_cmp(s1, s2) strcasecmp((s1), (s2))
31 43
32/* Definitions used by the flattened device tree */
33#define OF_DT_HEADER 0xd00dfeed /* marker */
34#define OF_DT_BEGIN_NODE 0x1 /* Start of node, full name */
35#define OF_DT_END_NODE 0x2 /* End node */
36#define OF_DT_PROP 0x3 /* Property: name off, size, content */
37#define OF_DT_NOP 0x4 /* nop */
38#define OF_DT_END 0x9
39
40#define OF_DT_VERSION 0x10
41
42/* 44/*
43 * This is what gets passed to the kernel by prom_init or kexec 45 * This is what gets passed to the kernel by prom_init or kexec
44 * 46 *
@@ -309,5 +311,6 @@ extern void __iomem *of_iomap(struct device_node *device, int index);
309 */ 311 */
310#include <linux/of.h> 312#include <linux/of.h>
311 313
314#endif /* __ASSEMBLY__ */
312#endif /* __KERNEL__ */ 315#endif /* __KERNEL__ */
313#endif /* _ASM_MICROBLAZE_PROM_H */ 316#endif /* _ASM_MICROBLAZE_PROM_H */
diff --git a/arch/microblaze/include/asm/scatterlist.h b/arch/microblaze/include/asm/scatterlist.h
index 08ff1d049b42..35d786fe93ae 100644
--- a/arch/microblaze/include/asm/scatterlist.h
+++ b/arch/microblaze/include/asm/scatterlist.h
@@ -1,28 +1 @@
1/* #include <asm-generic/scatterlist.h>
2 * Copyright (C) 2008 Michal Simek <monstr@monstr.eu>
3 * Copyright (C) 2006 Atmark Techno, Inc.
4 *
5 * This file is subject to the terms and conditions of the GNU General Public
6 * License. See the file "COPYING" in the main directory of this archive
7 * for more details.
8 */
9
10#ifndef _ASM_MICROBLAZE_SCATTERLIST_H
11#define _ASM_MICROBLAZE_SCATTERLIST_H
12
13struct scatterlist {
14#ifdef CONFIG_DEBUG_SG
15 unsigned long sg_magic;
16#endif
17 unsigned long page_link;
18 dma_addr_t dma_address;
19 unsigned int offset;
20 unsigned int length;
21};
22
23#define sg_dma_address(sg) ((sg)->dma_address)
24#define sg_dma_len(sg) ((sg)->length)
25
26#define ISA_DMA_THRESHOLD (~0UL)
27
28#endif /* _ASM_MICROBLAZE_SCATTERLIST_H */
diff --git a/arch/microblaze/include/asm/sembuf.h b/arch/microblaze/include/asm/sembuf.h
index b804ed71a57e..7673b83cfef7 100644
--- a/arch/microblaze/include/asm/sembuf.h
+++ b/arch/microblaze/include/asm/sembuf.h
@@ -1,34 +1 @@
1/* #include <asm-generic/sembuf.h>
2 * Copyright (C) 2006 Atmark Techno, Inc.
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
9#ifndef _ASM_MICROBLAZE_SEMBUF_H
10#define _ASM_MICROBLAZE_SEMBUF_H
11
12/*
13 * The semid64_ds structure for microblaze architecture.
14 * Note extra padding because this structure is passed back and forth
15 * between kernel and user space.
16 *
17 * Pad space is left for:
18 * - 64-bit time_t to solve y2038 problem
19 * - 2 miscellaneous 32-bit values
20 */
21
22struct semid64_ds {
23 struct ipc64_perm sem_perm; /* permissions .. see ipc.h */
24 __kernel_time_t sem_otime; /* last semop time */
25 unsigned long __unused1;
26 __kernel_time_t sem_ctime; /* last change time */
27 unsigned long __unused2;
28 unsigned long sem_nsems; /* no. of semaphores in array */
29 unsigned long __unused3;
30 unsigned long __unused4;
31};
32
33
34#endif /* _ASM_MICROBLAZE_SEMBUF_H */
diff --git a/arch/microblaze/include/asm/serial.h b/arch/microblaze/include/asm/serial.h
index 39bfc8ce6af5..a0cb0caff152 100644
--- a/arch/microblaze/include/asm/serial.h
+++ b/arch/microblaze/include/asm/serial.h
@@ -1,14 +1 @@
1/* #include <asm-generic/serial.h>
2 * Copyright (C) 2009 Michal Simek <monstr@monstr.eu>
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
9#ifndef _ASM_MICROBLAZE_SERIAL_H
10#define _ASM_MICROBLAZE_SERIAL_H
11
12# define BASE_BAUD (1843200 / 16)
13
14#endif /* _ASM_MICROBLAZE_SERIAL_H */
diff --git a/arch/microblaze/include/asm/shmbuf.h b/arch/microblaze/include/asm/shmbuf.h
index f829c5843618..83c05fc2de38 100644
--- a/arch/microblaze/include/asm/shmbuf.h
+++ b/arch/microblaze/include/asm/shmbuf.h
@@ -1,42 +1 @@
1#ifndef _ASM_MICROBLAZE_SHMBUF_H #include <asm-generic/shmbuf.h>
2#define _ASM_MICROBLAZE_SHMBUF_H
3
4/*
5 * The shmid64_ds structure for microblaze architecture.
6 * Note extra padding because this structure is passed back and forth
7 * between kernel and user space.
8 *
9 * Pad space is left for:
10 * - 64-bit time_t to solve y2038 problem
11 * - 2 miscellaneous 32-bit values
12 */
13
14struct shmid64_ds {
15 struct ipc64_perm shm_perm; /* operation perms */
16 size_t shm_segsz; /* size of segment (bytes) */
17 __kernel_time_t shm_atime; /* last attach time */
18 unsigned long __unused1;
19 __kernel_time_t shm_dtime; /* last detach time */
20 unsigned long __unused2;
21 __kernel_time_t shm_ctime; /* last change time */
22 unsigned long __unused3;
23 __kernel_pid_t shm_cpid; /* pid of creator */
24 __kernel_pid_t shm_lpid; /* pid of last operator */
25 unsigned long shm_nattch; /* no. of current attaches */
26 unsigned long __unused4;
27 unsigned long __unused5;
28};
29
30struct shminfo64 {
31 unsigned long shmmax;
32 unsigned long shmmin;
33 unsigned long shmmni;
34 unsigned long shmseg;
35 unsigned long shmall;
36 unsigned long __unused1;
37 unsigned long __unused2;
38 unsigned long __unused3;
39 unsigned long __unused4;
40};
41
42#endif /* _ASM_MICROBLAZE_SHMBUF_H */
diff --git a/arch/microblaze/include/asm/shmparam.h b/arch/microblaze/include/asm/shmparam.h
index 9f5fc2b3b6a3..93f30deb95d0 100644
--- a/arch/microblaze/include/asm/shmparam.h
+++ b/arch/microblaze/include/asm/shmparam.h
@@ -1,6 +1 @@
1#ifndef _ASM_MICROBLAZE_SHMPARAM_H #include <asm-generic/shmparam.h>
2#define _ASM_MICROBLAZE_SHMPARAM_H
3
4#define SHMLBA PAGE_SIZE /* attach addr a multiple of this */
5
6#endif /* _ASM_MICROBLAZE_SHMPARAM_H */
diff --git a/arch/microblaze/include/asm/siginfo.h b/arch/microblaze/include/asm/siginfo.h
index f162911a8f50..0815d29d82e5 100644
--- a/arch/microblaze/include/asm/siginfo.h
+++ b/arch/microblaze/include/asm/siginfo.h
@@ -1,15 +1 @@
1/*
2 * Copyright (C) 2006 Atmark Techno, Inc.
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
9#ifndef _ASM_MICROBLAZE_SIGINFO_H
10#define _ASM_MICROBLAZE_SIGINFO_H
11
12#include <linux/types.h>
13#include <asm-generic/siginfo.h> #include <asm-generic/siginfo.h>
14
15#endif /* _ASM_MICROBLAZE_SIGINFO_H */
diff --git a/arch/microblaze/include/asm/signal.h b/arch/microblaze/include/asm/signal.h
index 46bc2267d949..7b1573ce19de 100644
--- a/arch/microblaze/include/asm/signal.h
+++ b/arch/microblaze/include/asm/signal.h
@@ -1,165 +1 @@
1/* #include <asm-generic/signal.h>
2 * Copyright (C) 2006 Atmark Techno, Inc.
3 * Yasushi SHOJI <yashi@atmark-techno.com>
4 * Tetsuya OHKAWA <tetsuya@atmark-techno.com>
5 *
6 * This file is subject to the terms and conditions of the GNU General Public
7 * License. See the file "COPYING" in the main directory of this archive
8 * for more details.
9 */
10
11#ifndef _ASM_MICROBLAZE_SIGNAL_H
12#define _ASM_MICROBLAZE_SIGNAL_H
13
14#define SIGHUP 1
15#define SIGINT 2
16#define SIGQUIT 3
17#define SIGILL 4
18#define SIGTRAP 5
19#define SIGABRT 6
20#define SIGIOT 6
21#define SIGBUS 7
22#define SIGFPE 8
23#define SIGKILL 9
24#define SIGUSR1 10
25#define SIGSEGV 11
26#define SIGUSR2 12
27#define SIGPIPE 13
28#define SIGALRM 14
29#define SIGTERM 15
30#define SIGSTKFLT 16
31#define SIGCHLD 17
32#define SIGCONT 18
33#define SIGSTOP 19
34#define SIGTSTP 20
35#define SIGTTIN 21
36#define SIGTTOU 22
37#define SIGURG 23
38#define SIGXCPU 24
39#define SIGXFSZ 25
40#define SIGVTALRM 26
41#define SIGPROF 27
42#define SIGWINCH 28
43#define SIGIO 29
44#define SIGPOLL SIGIO
45/*
46#define SIGLOST 29
47*/
48#define SIGPWR 30
49#define SIGSYS 31
50#define SIGUNUSED 31
51
52/* These should not be considered constants from userland. */
53#define SIGRTMIN 32
54#define SIGRTMAX _NSIG
55
56/*
57 * SA_FLAGS values:
58 *
59 * SA_ONSTACK indicates that a registered stack_t will be used.
60 * SA_RESTART flag to get restarting signals (which were the default long ago)
61 * SA_NOCLDSTOP flag to turn off SIGCHLD when children stop.
62 * SA_RESETHAND clears the handler when the signal is delivered.
63 * SA_NOCLDWAIT flag on SIGCHLD to inhibit zombies.
64 * SA_NODEFER prevents the current signal from being masked in the handler.
65 *
66 * SA_ONESHOT and SA_NOMASK are the historical Linux names for the Single
67 * Unix names RESETHAND and NODEFER respectively.
68 */
69#define SA_NOCLDSTOP 0x00000001
70#define SA_NOCLDWAIT 0x00000002
71#define SA_SIGINFO 0x00000004
72#define SA_ONSTACK 0x08000000
73#define SA_RESTART 0x10000000
74#define SA_NODEFER 0x40000000
75#define SA_RESETHAND 0x80000000
76
77#define SA_NOMASK SA_NODEFER
78#define SA_ONESHOT SA_RESETHAND
79
80#define SA_RESTORER 0x04000000
81
82/*
83 * sigaltstack controls
84 */
85#define SS_ONSTACK 1
86#define SS_DISABLE 2
87
88#define MINSIGSTKSZ 2048
89#define SIGSTKSZ 8192
90
91# ifndef __ASSEMBLY__
92# include <linux/types.h>
93# include <asm-generic/signal-defs.h>
94
95/* Avoid too many header ordering problems. */
96struct siginfo;
97
98# ifdef __KERNEL__
99/*
100 * Most things should be clean enough to redefine this at will, if care
101 * is taken to make libc match.
102 */
103# define _NSIG 64
104# define _NSIG_BPW 32
105# define _NSIG_WORDS (_NSIG / _NSIG_BPW)
106
107typedef unsigned long old_sigset_t; /* at least 32 bits */
108
109typedef struct {
110 unsigned long sig[_NSIG_WORDS];
111} sigset_t;
112
113struct old_sigaction {
114 __sighandler_t sa_handler;
115 old_sigset_t sa_mask;
116 unsigned long sa_flags;
117 void (*sa_restorer)(void);
118};
119
120struct sigaction {
121 __sighandler_t sa_handler;
122 unsigned long sa_flags;
123 void (*sa_restorer)(void);
124 sigset_t sa_mask; /* mask last for extensibility */
125};
126
127struct k_sigaction {
128 struct sigaction sa;
129};
130
131# include <asm/sigcontext.h>
132# undef __HAVE_ARCH_SIG_BITOPS
133
134# define ptrace_signal_deliver(regs, cookie) do { } while (0)
135
136# else /* !__KERNEL__ */
137
138/* Here we must cater to libcs that poke about in kernel headers. */
139
140# define NSIG 32
141typedef unsigned long sigset_t;
142
143struct sigaction {
144 union {
145 __sighandler_t _sa_handler;
146 void (*_sa_sigaction)(int, struct siginfo *, void *);
147 } _u;
148 sigset_t sa_mask;
149 unsigned long sa_flags;
150 void (*sa_restorer)(void);
151};
152
153# define sa_handler _u._sa_handler
154# define sa_sigaction _u._sa_sigaction
155
156# endif /* __KERNEL__ */
157
158typedef struct sigaltstack {
159 void *ss_sp;
160 int ss_flags;
161 size_t ss_size;
162} stack_t;
163
164# endif /* __ASSEMBLY__ */
165#endif /* _ASM_MICROBLAZE_SIGNAL_H */
diff --git a/arch/microblaze/include/asm/socket.h b/arch/microblaze/include/asm/socket.h
index 825936860314..6b71384b9d8b 100644
--- a/arch/microblaze/include/asm/socket.h
+++ b/arch/microblaze/include/asm/socket.h
@@ -1,69 +1 @@
1/* #include <asm-generic/socket.h>
2 * Copyright (C) 2006 Atmark Techno, Inc.
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
9#ifndef _ASM_MICROBLAZE_SOCKET_H
10#define _ASM_MICROBLAZE_SOCKET_H
11
12#include <asm/sockios.h>
13
14/* For setsockoptions(2) */
15#define SOL_SOCKET 1
16
17#define SO_DEBUG 1
18#define SO_REUSEADDR 2
19#define SO_TYPE 3
20#define SO_ERROR 4
21#define SO_DONTROUTE 5
22#define SO_BROADCAST 6
23#define SO_SNDBUF 7
24#define SO_RCVBUF 8
25#define SO_SNDBUFFORCE 32
26#define SO_RCVBUFFORCE 33
27#define SO_KEEPALIVE 9
28#define SO_OOBINLINE 10
29#define SO_NO_CHECK 11
30#define SO_PRIORITY 12
31#define SO_LINGER 13
32#define SO_BSDCOMPAT 14
33/* To add :#define SO_REUSEPORT 15 */
34#define SO_PASSCRED 16
35#define SO_PEERCRED 17
36#define SO_RCVLOWAT 18
37#define SO_SNDLOWAT 19
38#define SO_RCVTIMEO 20
39#define SO_SNDTIMEO 21
40
41/* Security levels - as per NRL IPv6 - don't actually do anything */
42#define SO_SECURITY_AUTHENTICATION 22
43#define SO_SECURITY_ENCRYPTION_TRANSPORT 23
44#define SO_SECURITY_ENCRYPTION_NETWORK 24
45
46#define SO_BINDTODEVICE 25
47
48/* Socket filtering */
49#define SO_ATTACH_FILTER 26
50#define SO_DETACH_FILTER 27
51
52#define SO_PEERNAME 28
53#define SO_TIMESTAMP 29
54#define SCM_TIMESTAMP SO_TIMESTAMP
55
56#define SO_ACCEPTCONN 30
57
58#define SO_PEERSEC 31
59#define SO_PASSSEC 34
60
61#define SO_TIMESTAMPNS 35
62#define SCM_TIMESTAMPNS SO_TIMESTAMPNS
63
64#define SO_MARK 36
65
66#define SO_TIMESTAMPING 37
67#define SCM_TIMESTAMPING SO_TIMESTAMPING
68
69#endif /* _ASM_MICROBLAZE_SOCKET_H */
diff --git a/arch/microblaze/include/asm/sockios.h b/arch/microblaze/include/asm/sockios.h
index 9fff57a701e1..def6d4746ee7 100644
--- a/arch/microblaze/include/asm/sockios.h
+++ b/arch/microblaze/include/asm/sockios.h
@@ -1,23 +1 @@
1/* #include <asm-generic/sockios.h>
2 * Copyright (C) 2006 Atmark Techno, Inc.
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
9#ifndef _ASM_MICROBLAZE_SOCKIOS_H
10#define _ASM_MICROBLAZE_SOCKIOS_H
11
12#include <linux/ioctl.h>
13
14/* Socket-level I/O control calls. */
15#define FIOSETOWN 0x8901
16#define SIOCSPGRP 0x8902
17#define FIOGETOWN 0x8903
18#define SIOCGPGRP 0x8904
19#define SIOCATMARK 0x8905
20#define SIOCGSTAMP 0x8906 /* Get stamp (timeval) */
21#define SIOCGSTAMPNS 0x8907 /* Get stamp (timespec) */
22
23#endif /* _ASM_MICROBLAZE_SOCKIOS_H */
diff --git a/arch/microblaze/include/asm/stat.h b/arch/microblaze/include/asm/stat.h
index a15f77520bfd..3dc90fa92c70 100644
--- a/arch/microblaze/include/asm/stat.h
+++ b/arch/microblaze/include/asm/stat.h
@@ -1,68 +1 @@
1/* #include <asm-generic/stat.h>
2 * Microblaze stat structure
3 *
4 * Copyright (C) 2001,02,03 NEC Electronics Corporation
5 * Copyright (C) 2001,02,03 Miles Bader <miles@gnu.org>
6 *
7 * This file is subject to the terms and conditions of the GNU General
8 * Public License. See the file COPYING in the main directory of this
9 * archive for more details.
10 *
11 * Written by Miles Bader <miles@gnu.org>
12 */
13
14#ifndef _ASM_MICROBLAZE_STAT_H
15#define _ASM_MICROBLAZE_STAT_H
16
17#include <linux/posix_types.h>
18
19#define STAT_HAVE_NSEC 1
20
21struct stat {
22 unsigned long st_dev;
23 unsigned long st_ino;
24 unsigned int st_mode;
25 unsigned int st_nlink;
26 unsigned int st_uid;
27 unsigned int st_gid;
28 unsigned long st_rdev;
29 unsigned long __pad1;
30 long st_size;
31 int st_blksize;
32 int __pad2;
33 long st_blocks;
34 int st_atime;
35 unsigned int st_atime_nsec;
36 int st_mtime;
37 unsigned int st_mtime_nsec;
38 int st_ctime;
39 unsigned int st_ctime_nsec;
40 unsigned long __unused4;
41 unsigned long __unused5;
42};
43
44struct stat64 {
45 unsigned long long st_dev; /* Device. */
46 unsigned long long st_ino; /* File serial number. */
47 unsigned int st_mode; /* File mode. */
48 unsigned int st_nlink; /* Link count. */
49 unsigned int st_uid; /* User ID of the file's owner. */
50 unsigned int st_gid; /* Group ID of the file's group. */
51 unsigned long long st_rdev; /* Device number, if device. */
52 unsigned long long __pad1;
53 long long st_size; /* Size of file, in bytes. */
54 int st_blksize; /* Optimal block size for I/O. */
55 int __pad2;
56 long long st_blocks; /* Number 512-byte blocks allocated. */
57 int st_atime; /* Time of last access. */
58 unsigned int st_atime_nsec;
59 int st_mtime; /* Time of last modification. */
60 unsigned int st_mtime_nsec;
61 int st_ctime; /* Time of last status change. */
62 unsigned int st_ctime_nsec;
63 unsigned int __unused4;
64 unsigned int __unused5;
65};
66
67#endif /* _ASM_MICROBLAZE_STAT_H */
68
diff --git a/arch/microblaze/include/asm/swab.h b/arch/microblaze/include/asm/swab.h
index b375d7b65ad7..7847e563ab66 100644
--- a/arch/microblaze/include/asm/swab.h
+++ b/arch/microblaze/include/asm/swab.h
@@ -1,8 +1 @@
1#ifndef _ASM_MICROBLAZE_SWAB_H #include <asm-generic/swab.h>
2#define _ASM_MICROBLAZE_SWAB_H
3
4#if defined(__GNUC__) && !defined(__STRICT_ANSI__) || defined(__KERNEL__)
5#define __SWAB_64_THRU_32__
6#endif
7
8#endif /* _ASM_MICROBLAZE_SWAB_H */
diff --git a/arch/microblaze/include/asm/syscalls.h b/arch/microblaze/include/asm/syscalls.h
index ddea9eb31f8d..720761cc741f 100644
--- a/arch/microblaze/include/asm/syscalls.h
+++ b/arch/microblaze/include/asm/syscalls.h
@@ -1,48 +1,8 @@
1#ifndef __ASM_MICROBLAZE_SYSCALLS_H 1#ifndef __ASM_MICROBLAZE_SYSCALLS_H
2#define __ASM_MICROBLAZE_SYSCALLS_H
3#ifdef __KERNEL__
4 2
5#include <linux/compiler.h> 3asmlinkage long sys_clone(int flags, unsigned long stack, struct pt_regs *regs);
6#include <linux/linkage.h> 4#define sys_clone sys_clone
7#include <linux/types.h>
8#include <linux/signal.h>
9 5
10/* FIXME will be removed */ 6#include <asm-generic/syscalls.h>
11asmlinkage int sys_ipc(uint call, int first, int second,
12 int third, void *ptr, long fifth);
13 7
14struct pt_regs;
15asmlinkage int sys_vfork(struct pt_regs *regs);
16asmlinkage int sys_clone(int flags, unsigned long stack, struct pt_regs *regs);
17asmlinkage int sys_execve(char __user *filenamei, char __user *__user *argv,
18 char __user *__user *envp, struct pt_regs *regs);
19
20asmlinkage unsigned long sys_mmap2(unsigned long addr, size_t len,
21 unsigned long prot, unsigned long flags,
22 unsigned long fd, unsigned long pgoff);
23
24asmlinkage unsigned long sys_mmap(unsigned long addr, size_t len,
25 unsigned long prot, unsigned long flags,
26 unsigned long fd, off_t offset);
27
28/* from signal.c */
29asmlinkage int sys_sigsuspend(old_sigset_t mask, struct pt_regs *regs);
30
31asmlinkage int sys_rt_sigsuspend(sigset_t __user *unewset, size_t sigsetsize,
32 struct pt_regs *regs);
33
34asmlinkage int sys_sigaction(int sig, const struct old_sigaction *act,
35 struct old_sigaction *oact);
36
37asmlinkage long sys_rt_sigaction(int sig, const struct sigaction __user *act,
38 struct sigaction __user *oact, size_t sigsetsize);
39
40asmlinkage int sys_sigaltstack(const stack_t __user *uss, stack_t __user *uoss,
41 struct pt_regs *regs);
42
43asmlinkage int sys_sigreturn(struct pt_regs *regs);
44
45asmlinkage int sys_rt_sigreturn(struct pt_regs *regs);
46
47#endif /* __KERNEL__ */
48#endif /* __ASM_MICROBLAZE_SYSCALLS_H */ 8#endif /* __ASM_MICROBLAZE_SYSCALLS_H */
diff --git a/arch/microblaze/include/asm/system.h b/arch/microblaze/include/asm/system.h
index c4e308850b5d..b1ed61590660 100644
--- a/arch/microblaze/include/asm/system.h
+++ b/arch/microblaze/include/asm/system.h
@@ -13,6 +13,9 @@
13#include <asm/setup.h> 13#include <asm/setup.h>
14#include <asm/irqflags.h> 14#include <asm/irqflags.h>
15 15
16#include <asm-generic/cmpxchg.h>
17#include <asm-generic/cmpxchg-local.h>
18
16struct task_struct; 19struct task_struct;
17struct thread_info; 20struct thread_info;
18 21
diff --git a/arch/microblaze/include/asm/termbits.h b/arch/microblaze/include/asm/termbits.h
index a1b64bc4724a..3935b106de79 100644
--- a/arch/microblaze/include/asm/termbits.h
+++ b/arch/microblaze/include/asm/termbits.h
@@ -1,203 +1 @@
1/* #include <asm-generic/termbits.h>
2 * Copyright (C) 2006 Atmark Techno, Inc.
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
9#ifndef _ASM_MICROBLAZE_TERMBITS_H
10#define _ASM_MICROBLAZE_TERMBITS_H
11
12#include <linux/posix_types.h>
13
14typedef unsigned char cc_t;
15typedef unsigned int speed_t;
16typedef unsigned int tcflag_t;
17
18#define NCCS 19
19struct termios {
20 tcflag_t c_iflag; /* input mode flags */
21 tcflag_t c_oflag; /* output mode flags */
22 tcflag_t c_cflag; /* control mode flags */
23 tcflag_t c_lflag; /* local mode flags */
24 cc_t c_line; /* line discipline */
25 cc_t c_cc[NCCS]; /* control characters */
26};
27
28struct ktermios {
29 tcflag_t c_iflag; /* input mode flags */
30 tcflag_t c_oflag; /* output mode flags */
31 tcflag_t c_cflag; /* control mode flags */
32 tcflag_t c_lflag; /* local mode flags */
33 cc_t c_line; /* line discipline */
34 cc_t c_cc[NCCS]; /* control characters */
35 speed_t c_ispeed; /* input speed */
36 speed_t c_ospeed; /* output speed */
37};
38
39/* c_cc characters */
40
41#define VINTR 0
42#define VQUIT 1
43#define VERASE 2
44#define VKILL 3
45#define VEOF 4
46#define VTIME 5
47#define VMIN 6
48#define VSWTC 7
49#define VSTART 8
50#define VSTOP 9
51#define VSUSP 10
52#define VEOL 11
53#define VREPRINT 12
54#define VDISCARD 13
55#define VWERASE 14
56#define VLNEXT 15
57#define VEOL2 16
58
59/* c_iflag bits */
60
61#define IGNBRK 0000001
62#define BRKINT 0000002
63#define IGNPAR 0000004
64#define PARMRK 0000010
65#define INPCK 0000020
66#define ISTRIP 0000040
67#define INLCR 0000100
68#define IGNCR 0000200
69#define ICRNL 0000400
70#define IUCLC 0001000
71#define IXON 0002000
72#define IXANY 0004000
73#define IXOFF 0010000
74#define IMAXBEL 0020000
75#define IUTF8 0040000
76
77/* c_oflag bits */
78
79#define OPOST 0000001
80#define OLCUC 0000002
81#define ONLCR 0000004
82#define OCRNL 0000010
83#define ONOCR 0000020
84#define ONLRET 0000040
85#define OFILL 0000100
86#define OFDEL 0000200
87#define NLDLY 0000400
88#define NL0 0000000
89#define NL1 0000400
90#define CRDLY 0003000
91#define CR0 0000000
92#define CR1 0001000
93#define CR2 0002000
94#define CR3 0003000
95#define TABDLY 0014000
96#define TAB0 0000000
97#define TAB1 0004000
98#define TAB2 0010000
99#define TAB3 0014000
100#define XTABS 0014000
101#define BSDLY 0020000
102#define BS0 0000000
103#define BS1 0020000
104#define VTDLY 0040000
105#define VT0 0000000
106#define VT1 0040000
107#define FFDLY 0100000
108#define FF0 0000000
109#define FF1 0100000
110
111/* c_cflag bit meaning */
112
113#define CBAUD 0010017
114#define B0 0000000 /* hang up */
115#define B50 0000001
116#define B75 0000002
117#define B110 0000003
118#define B134 0000004
119#define B150 0000005
120#define B200 0000006
121#define B300 0000007
122#define B600 0000010
123#define B1200 0000011
124#define B1800 0000012
125#define B2400 0000013
126#define B4800 0000014
127#define B9600 0000015
128#define B19200 0000016
129#define B38400 0000017
130#define EXTA B19200
131#define EXTB B38400
132#define CSIZE 0000060
133#define CS5 0000000
134#define CS6 0000020
135#define CS7 0000040
136#define CS8 0000060
137#define CSTOPB 0000100
138#define CREAD 0000200
139#define PARENB 0000400
140#define PARODD 0001000
141#define HUPCL 0002000
142#define CLOCAL 0004000
143#define CBAUDEX 0010000
144#define B57600 0010001
145#define B115200 0010002
146#define B230400 0010003
147#define B460800 0010004
148#define B500000 0010005
149#define B576000 0010006
150#define B921600 0010007
151#define BOTHER 0010000
152#define B1000000 0010010
153#define B1152000 0010011
154#define B1500000 0010012
155#define B2000000 0010013
156#define B2500000 0010014
157#define B3000000 0010015
158#define B3500000 0010016
159#define B4000000 0010017
160#define CIBAUD 002003600000 /* input baud rate (not used) */
161#define CMSPAR 010000000000 /* mark or space (stick) parity */
162#define CRTSCTS 020000000000 /* flow control */
163
164#define IBSHIFT 16 /* Shift from CBAUD to CIBAUD */
165
166/* c_lflag bits */
167
168#define ISIG 0000001
169#define ICANON 0000002
170#define XCASE 0000004
171#define ECHO 0000010
172#define ECHOE 0000020
173#define ECHOK 0000040
174#define ECHONL 0000100
175#define NOFLSH 0000200
176#define TOSTOP 0000400
177#define ECHOCTL 0001000
178#define ECHOPRT 0002000
179#define ECHOKE 0004000
180#define FLUSHO 0010000
181#define PENDIN 0040000
182#define IEXTEN 0100000
183
184/* tcflow() and TCXONC use these */
185
186#define TCOOFF 0
187#define TCOON 1
188#define TCIOFF 2
189#define TCION 3
190
191/* tcflush() and TCFLSH use these */
192
193#define TCIFLUSH 0
194#define TCOFLUSH 1
195#define TCIOFLUSH 2
196
197/* tcsetattr uses these */
198
199#define TCSANOW 0
200#define TCSADRAIN 1
201#define TCSAFLUSH 2
202
203#endif /* _ASM_MICROBLAZE_TERMBITS_H */
diff --git a/arch/microblaze/include/asm/termios.h b/arch/microblaze/include/asm/termios.h
index 47a46d1fbe26..280d78a9d966 100644
--- a/arch/microblaze/include/asm/termios.h
+++ b/arch/microblaze/include/asm/termios.h
@@ -1,88 +1 @@
1/* #include <asm-generic/termios.h>
2 * Copyright (C) 2006 Atmark Techno, Inc.
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
9#ifndef _ASM_MICROBLAZE_TERMIOS_H
10#define _ASM_MICROBLAZE_TERMIOS_H
11
12#include <linux/string.h>
13#include <asm/termbits.h>
14#include <asm/ioctls.h>
15
16struct winsize {
17 unsigned short ws_row;
18 unsigned short ws_col;
19 unsigned short ws_xpixel;
20 unsigned short ws_ypixel;
21};
22
23#define NCC 8
24struct termio {
25 unsigned short c_iflag; /* input mode flags */
26 unsigned short c_oflag; /* output mode flags */
27 unsigned short c_cflag; /* control mode flags */
28 unsigned short c_lflag; /* local mode flags */
29 unsigned char c_line; /* line discipline */
30 unsigned char c_cc[NCC]; /* control characters */
31};
32
33#ifdef __KERNEL__
34/* intr=^C quit=^| erase=del kill=^U
35 eof=^D vtime=\0 vmin=\1 sxtc=\0
36 start=^Q stop=^S susp=^Z eol=\0
37 reprint=^R discard=^U werase=^W lnext=^V
38 eol2=\0
39*/
40#define INIT_C_CC "\003\034\177\025\004\0\1\0\021\023\032\0\022\017\027\026\0"
41#endif
42
43/* Modem lines */
44
45#define TIOCM_LE 0x001
46#define TIOCM_DTR 0x002
47#define TIOCM_RTS 0x004
48#define TIOCM_ST 0x008
49#define TIOCM_SR 0x010
50#define TIOCM_CTS 0x020
51#define TIOCM_CAR 0x040
52#define TIOCM_RNG 0x080
53#define TIOCM_DSR 0x100
54#define TIOCM_CD TIOCM_CAR
55#define TIOCM_RI TIOCM_RNG
56#define TIOCM_OUT1 0x2000
57#define TIOCM_OUT2 0x4000
58#define TIOCM_LOOP 0x8000
59
60/* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */
61
62/* Line disciplines */
63
64#define N_TTY 0
65#define N_SLIP 1
66#define N_MOUSE 2
67#define N_PPP 3
68#define N_STRIP 4
69#define N_AX25 5
70#define N_X25 6 /* X.25 async */
71#define N_6PACK 7
72#define N_MASC 8 /* Reserved for Mobitex module <kaz@cafe.net> */
73#define N_R3964 9 /* Reserved for Simatic R3964 module */
74#define N_PROFIBUS_FDL 10 /* Reserved for Profibus <Dave@mvhi.com> */
75#define N_IRDA 11 /* Linux IR - http://irda.sourceforge.net/ */
76#define N_SMSBLOCK 12 /* SMS block mode - for talking to GSM data cards
77 about SMS messages */
78#define N_HDLC 13 /* synchronous HDLC */
79#define N_SYNC_PPP 14
80#define N_HCI 15 /* Bluetooth HCI UART */
81
82#ifdef __KERNEL__
83
84#include <asm-generic/termios-base.h>
85
86#endif /* __KERNEL__ */
87
88#endif /* _ASM_MICROBLAZE_TERMIOS_H */
diff --git a/arch/microblaze/include/asm/thread_info.h b/arch/microblaze/include/asm/thread_info.h
index 7fac44498445..6e92885d381a 100644
--- a/arch/microblaze/include/asm/thread_info.h
+++ b/arch/microblaze/include/asm/thread_info.h
@@ -75,8 +75,6 @@ struct thread_info {
75 75
76/* 76/*
77 * macros/functions for gaining access to the thread information structure 77 * macros/functions for gaining access to the thread information structure
78 *
79 * preempt_count needs to be 1 initially, until the scheduler is functional.
80 */ 78 */
81#define INIT_THREAD_INFO(tsk) \ 79#define INIT_THREAD_INFO(tsk) \
82{ \ 80{ \
@@ -84,7 +82,7 @@ struct thread_info {
84 .exec_domain = &default_exec_domain, \ 82 .exec_domain = &default_exec_domain, \
85 .flags = 0, \ 83 .flags = 0, \
86 .cpu = 0, \ 84 .cpu = 0, \
87 .preempt_count = 1, \ 85 .preempt_count = INIT_PREEMPT_COUNT, \
88 .addr_limit = KERNEL_DS, \ 86 .addr_limit = KERNEL_DS, \
89 .restart_block = { \ 87 .restart_block = { \
90 .fn = do_no_restart_syscall, \ 88 .fn = do_no_restart_syscall, \
diff --git a/arch/microblaze/include/asm/timex.h b/arch/microblaze/include/asm/timex.h
index 678525dc6d0b..befcf3de5532 100644
--- a/arch/microblaze/include/asm/timex.h
+++ b/arch/microblaze/include/asm/timex.h
@@ -9,10 +9,8 @@
9#ifndef _ASM_MICROBLAZE_TIMEX_H 9#ifndef _ASM_MICROBLAZE_TIMEX_H
10#define _ASM_MICROBLAZE_TIMEX_H 10#define _ASM_MICROBLAZE_TIMEX_H
11 11
12#define CLOCK_TICK_RATE 1000 /* Timer input freq. */ 12#include <asm-generic/timex.h>
13
14typedef unsigned long cycles_t;
15 13
16#define get_cycles() (0) 14#define CLOCK_TICK_RATE 1000 /* Timer input freq. */
17 15
18#endif /* _ASM_TIMEX_H */ 16#endif /* _ASM_TIMEX_H */
diff --git a/arch/microblaze/include/asm/tlb.h b/arch/microblaze/include/asm/tlb.h
index c472d2801132..e8abd4a0349c 100644
--- a/arch/microblaze/include/asm/tlb.h
+++ b/arch/microblaze/include/asm/tlb.h
@@ -11,7 +11,7 @@
11#ifndef _ASM_MICROBLAZE_TLB_H 11#ifndef _ASM_MICROBLAZE_TLB_H
12#define _ASM_MICROBLAZE_TLB_H 12#define _ASM_MICROBLAZE_TLB_H
13 13
14#define tlb_flush(tlb) do {} while (0) 14#define tlb_flush(tlb) flush_tlb_mm((tlb)->mm)
15 15
16#include <asm-generic/tlb.h> 16#include <asm-generic/tlb.h>
17 17
diff --git a/arch/microblaze/include/asm/types.h b/arch/microblaze/include/asm/types.h
index bebc018318f5..b9e79bc580dd 100644
--- a/arch/microblaze/include/asm/types.h
+++ b/arch/microblaze/include/asm/types.h
@@ -1,38 +1 @@
1/* #include <asm-generic/types.h>
2 * Copyright (C) Atmark Techno, Inc.
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
9#ifndef _ASM_MICROBLAZE_TYPES_H
10#define _ASM_MICROBLAZE_TYPES_H
11
12/*
13 * This file is never included by application software unless
14 * explicitly requested (e.g., via linux/types.h) in which case the
15 * application is Linux specific so (user-) name space pollution is
16 * not a major issue. However, for interoperability, libraries still
17 * need to be careful to avoid a name clashes.
18 */
19
20#include <asm-generic/int-ll64.h>
21
22# ifndef __ASSEMBLY__
23
24typedef unsigned short umode_t;
25
26/*
27 * These aren't exported outside the kernel to avoid name space clashes
28 */
29# ifdef __KERNEL__
30# define BITS_PER_LONG 32
31
32/* Dma addresses are 32-bits wide. */
33
34typedef u32 dma_addr_t;
35
36# endif/* __KERNEL__ */
37# endif /* __ASSEMBLY__ */
38#endif /* _ASM_MICROBLAZE_TYPES_H */
diff --git a/arch/microblaze/include/asm/uaccess.h b/arch/microblaze/include/asm/uaccess.h
index 65adad61e7e9..5431b4631a7a 100644
--- a/arch/microblaze/include/asm/uaccess.h
+++ b/arch/microblaze/include/asm/uaccess.h
@@ -189,7 +189,7 @@ extern long strnlen_user(const char *src, long count);
189 189
190#define __put_user(x, ptr) \ 190#define __put_user(x, ptr) \
191({ \ 191({ \
192 __typeof__(*(ptr)) __gu_val = x; \ 192 __typeof__(*(ptr)) volatile __gu_val = (x); \
193 long __gu_err = 0; \ 193 long __gu_err = 0; \
194 switch (sizeof(__gu_val)) { \ 194 switch (sizeof(__gu_val)) { \
195 case 1: \ 195 case 1: \
diff --git a/arch/microblaze/include/asm/ucontext.h b/arch/microblaze/include/asm/ucontext.h
index 11f6bb3ae3a4..9bc07b9f30fb 100644
--- a/arch/microblaze/include/asm/ucontext.h
+++ b/arch/microblaze/include/asm/ucontext.h
@@ -1,22 +1 @@
1/* #include <asm-generic/ucontext.h>
2 * Copyright (C) 2006 Atmark Techno, Inc.
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
9#ifndef _ASM_MICROBLAZE_UCONTEXT_H
10#define _ASM_MICROBLAZE_UCONTEXT_H
11
12#include <asm/sigcontext.h>
13
14struct ucontext {
15 unsigned long uc_flags;
16 struct ucontext *uc_link;
17 stack_t uc_stack;
18 struct sigcontext uc_mcontext;
19 sigset_t uc_sigmask; /* mask last for extensibility */
20};
21
22#endif /* _ASM_MICROBLAZE_UCONTEXT_H */
diff --git a/arch/microblaze/include/asm/unistd.h b/arch/microblaze/include/asm/unistd.h
index b5e2f5fa5c53..0b852327c0e7 100644
--- a/arch/microblaze/include/asm/unistd.h
+++ b/arch/microblaze/include/asm/unistd.h
@@ -380,8 +380,10 @@
380#define __NR_accept04 362 /* new */ 380#define __NR_accept04 362 /* new */
381#define __NR_preadv 363 /* new */ 381#define __NR_preadv 363 /* new */
382#define __NR_pwritev 364 /* new */ 382#define __NR_pwritev 364 /* new */
383#define __NR_rt_tgsigqueueinfo 365 /* new */
384#define __NR_perf_counter_open 366 /* new */
383 385
384#define __NR_syscalls 365 386#define __NR_syscalls 367
385 387
386#ifdef __KERNEL__ 388#ifdef __KERNEL__
387#ifndef __ASSEMBLY__ 389#ifndef __ASSEMBLY__
@@ -408,7 +410,7 @@
408#define __ARCH_WANT_SYS_SIGPENDING 410#define __ARCH_WANT_SYS_SIGPENDING
409#define __ARCH_WANT_SYS_SIGPROCMASK 411#define __ARCH_WANT_SYS_SIGPROCMASK
410#define __ARCH_WANT_SYS_RT_SIGACTION 412#define __ARCH_WANT_SYS_RT_SIGACTION
411/* #define __ARCH_WANT_SYS_RT_SIGSUSPEND */ 413#define __ARCH_WANT_SYS_RT_SIGSUSPEND
412 414
413/* 415/*
414 * "Conditional" syscalls 416 * "Conditional" syscalls
diff --git a/arch/microblaze/include/asm/vga.h b/arch/microblaze/include/asm/vga.h
index 8b137891791f..89d82fd8fcf1 100644
--- a/arch/microblaze/include/asm/vga.h
+++ b/arch/microblaze/include/asm/vga.h
@@ -1 +1 @@
#include <asm-generic/vga.h>
diff --git a/arch/microblaze/kernel/Makefile b/arch/microblaze/kernel/Makefile
index f4a5e19a20eb..d487729683de 100644
--- a/arch/microblaze/kernel/Makefile
+++ b/arch/microblaze/kernel/Makefile
@@ -17,4 +17,4 @@ obj-$(CONFIG_HEART_BEAT) += heartbeat.o
17obj-$(CONFIG_MODULES) += microblaze_ksyms.o module.o 17obj-$(CONFIG_MODULES) += microblaze_ksyms.o module.o
18obj-$(CONFIG_MMU) += misc.o 18obj-$(CONFIG_MMU) += misc.o
19 19
20obj-y += entry$(MMUEXT).o 20obj-y += entry$(MMU).o
diff --git a/arch/microblaze/kernel/cpu/cpuinfo-pvr-full.c b/arch/microblaze/kernel/cpu/cpuinfo-pvr-full.c
index 153f57c57b6d..c259786e7faa 100644
--- a/arch/microblaze/kernel/cpu/cpuinfo-pvr-full.c
+++ b/arch/microblaze/kernel/cpu/cpuinfo-pvr-full.c
@@ -22,7 +22,7 @@
22 22
23#define CI(c, p) { ci->c = PVR_##p(pvr); } 23#define CI(c, p) { ci->c = PVR_##p(pvr); }
24#define err_printk(x) \ 24#define err_printk(x) \
25 early_printk("ERROR: Microblaze " x " - different for PVR and DTS\n"); 25 early_printk("ERROR: Microblaze " x "-different for PVR and DTS\n");
26 26
27void set_cpuinfo_pvr_full(struct cpuinfo *ci, struct device_node *cpu) 27void set_cpuinfo_pvr_full(struct cpuinfo *ci, struct device_node *cpu)
28{ 28{
diff --git a/arch/microblaze/kernel/cpu/cpuinfo-static.c b/arch/microblaze/kernel/cpu/cpuinfo-static.c
index 450ca6bb828d..adb448f93d5f 100644
--- a/arch/microblaze/kernel/cpu/cpuinfo-static.c
+++ b/arch/microblaze/kernel/cpu/cpuinfo-static.c
@@ -18,7 +18,7 @@ static const char family_string[] = CONFIG_XILINX_MICROBLAZE0_FAMILY;
18static const char cpu_ver_string[] = CONFIG_XILINX_MICROBLAZE0_HW_VER; 18static const char cpu_ver_string[] = CONFIG_XILINX_MICROBLAZE0_HW_VER;
19 19
20#define err_printk(x) \ 20#define err_printk(x) \
21 early_printk("ERROR: Microblaze " x "- different for kernel and DTS\n"); 21 early_printk("ERROR: Microblaze " x "-different for kernel and DTS\n");
22 22
23void __init set_cpuinfo_static(struct cpuinfo *ci, struct device_node *cpu) 23void __init set_cpuinfo_static(struct cpuinfo *ci, struct device_node *cpu)
24{ 24{
diff --git a/arch/microblaze/kernel/cpu/cpuinfo.c b/arch/microblaze/kernel/cpu/cpuinfo.c
index a10bea119b94..c411c6757deb 100644
--- a/arch/microblaze/kernel/cpu/cpuinfo.c
+++ b/arch/microblaze/kernel/cpu/cpuinfo.c
@@ -26,6 +26,8 @@ const struct cpu_ver_key cpu_ver_lookup[] = {
26 {"7.10.b", 0x09}, 26 {"7.10.b", 0x09},
27 {"7.10.c", 0x0a}, 27 {"7.10.c", 0x0a},
28 {"7.10.d", 0x0b}, 28 {"7.10.d", 0x0b},
29 {"7.20.a", 0x0c},
30 {"7.20.b", 0x0d},
29 /* FIXME There is no keycode defined in MBV for these versions */ 31 /* FIXME There is no keycode defined in MBV for these versions */
30 {"2.10.a", 0x10}, 32 {"2.10.a", 0x10},
31 {"3.00.a", 0x20}, 33 {"3.00.a", 0x20},
diff --git a/arch/microblaze/kernel/entry-nommu.S b/arch/microblaze/kernel/entry-nommu.S
index 1fce6b803f54..9083d85376a4 100644
--- a/arch/microblaze/kernel/entry-nommu.S
+++ b/arch/microblaze/kernel/entry-nommu.S
@@ -551,30 +551,22 @@ no_work_pending:
551 rtid r14, 0 551 rtid r14, 0
552 nop 552 nop
553 553
554sys_vfork_wrapper: 554sys_vfork:
555 brid sys_vfork 555 brid microblaze_vfork
556 addk r5, r1, r0 556 addk r5, r1, r0
557 557
558sys_clone_wrapper: 558sys_clone:
559 brid sys_clone 559 brid microblaze_clone
560 addk r7, r1, r0 560 addk r7, r1, r0
561 561
562sys_execve_wrapper: 562sys_execve:
563 brid sys_execve 563 brid microblaze_execve
564 addk r8, r1, r0 564 addk r8, r1, r0
565 565
566sys_sigreturn_wrapper:
567 brid sys_sigreturn
568 addk r5, r1, r0
569
570sys_rt_sigreturn_wrapper: 566sys_rt_sigreturn_wrapper:
571 brid sys_rt_sigreturn 567 brid sys_rt_sigreturn
572 addk r5, r1, r0 568 addk r5, r1, r0
573 569
574sys_sigsuspend_wrapper:
575 brid sys_rt_sigsuspend
576 addk r6, r1, r0
577
578sys_rt_sigsuspend_wrapper: 570sys_rt_sigsuspend_wrapper:
579 brid sys_rt_sigsuspend 571 brid sys_rt_sigsuspend
580 addk r7, r1, r0 572 addk r7, r1, r0
diff --git a/arch/microblaze/kernel/entry.S b/arch/microblaze/kernel/entry.S
index 91a0e7b185dd..c7353e79f4a2 100644
--- a/arch/microblaze/kernel/entry.S
+++ b/arch/microblaze/kernel/entry.S
@@ -429,12 +429,11 @@ C_ENTRY(ret_from_fork):
429 brid ret_from_trap; /* Do normal trap return */ 429 brid ret_from_trap; /* Do normal trap return */
430 nop; 430 nop;
431 431
432C_ENTRY(sys_vfork_wrapper): 432C_ENTRY(sys_vfork):
433 brid microblaze_vfork /* Do real work (tail-call) */
433 la r5, r1, PTO 434 la r5, r1, PTO
434 brid sys_vfork /* Do real work (tail-call) */
435 nop
436 435
437C_ENTRY(sys_clone_wrapper): 436C_ENTRY(sys_clone):
438 bnei r6, 1f; /* See if child SP arg (arg 1) is 0. */ 437 bnei r6, 1f; /* See if child SP arg (arg 1) is 0. */
439 lwi r6, r1, PTO+PT_R1; /* If so, use paret's stack ptr */ 438 lwi r6, r1, PTO+PT_R1; /* If so, use paret's stack ptr */
4401: la r7, r1, PTO; /* Arg 2: parent context */ 4391: la r7, r1, PTO; /* Arg 2: parent context */
@@ -444,20 +443,9 @@ C_ENTRY(sys_clone_wrapper):
444 brid do_fork /* Do real work (tail-call) */ 443 brid do_fork /* Do real work (tail-call) */
445 nop; 444 nop;
446 445
447C_ENTRY(sys_execve_wrapper): 446C_ENTRY(sys_execve):
448 la r8, r1, PTO; /* add user context as 4th arg */ 447 la r8, r1, PTO; /* add user context as 4th arg */
449 brid sys_execve; /* Do real work (tail-call).*/ 448 brid microblaze_execve; /* Do real work (tail-call).*/
450 nop;
451
452C_ENTRY(sys_sigsuspend_wrapper):
453 swi r3, r1, PTO+PT_R3; /* restore saved r3, r4 registers */
454 swi r4, r1, PTO+PT_R4;
455 la r6, r1, PTO; /* add user context as 2nd arg */
456 bralid r15, sys_sigsuspend; /* Do real work.*/
457 nop;
458 lwi r3, r1, PTO+PT_R3; /* restore saved r3, r4 registers */
459 lwi r4, r1, PTO+PT_R4;
460 bri ret_from_trap /* fall through will not work here due to align */
461 nop; 449 nop;
462 450
463C_ENTRY(sys_rt_sigsuspend_wrapper): 451C_ENTRY(sys_rt_sigsuspend_wrapper):
@@ -471,18 +459,6 @@ C_ENTRY(sys_rt_sigsuspend_wrapper):
471 bri ret_from_trap /* fall through will not work here due to align */ 459 bri ret_from_trap /* fall through will not work here due to align */
472 nop; 460 nop;
473 461
474
475C_ENTRY(sys_sigreturn_wrapper):
476 swi r3, r1, PTO+PT_R3; /* restore saved r3, r4 registers */
477 swi r4, r1, PTO+PT_R4;
478 la r5, r1, PTO; /* add user context as 1st arg */
479 brlid r15, sys_sigreturn; /* Do real work.*/
480 nop;
481 lwi r3, r1, PTO+PT_R3; /* restore saved r3, r4 registers */
482 lwi r4, r1, PTO+PT_R4;
483 bri ret_from_trap /* fall through will not work here due to align */
484 nop;
485
486C_ENTRY(sys_rt_sigreturn_wrapper): 462C_ENTRY(sys_rt_sigreturn_wrapper):
487 swi r3, r1, PTO+PT_R3; /* restore saved r3, r4 registers */ 463 swi r3, r1, PTO+PT_R3; /* restore saved r3, r4 registers */
488 swi r4, r1, PTO+PT_R4; 464 swi r4, r1, PTO+PT_R4;
diff --git a/arch/microblaze/kernel/head.S b/arch/microblaze/kernel/head.S
index e568d6ec621b..e41c6ce2a7be 100644
--- a/arch/microblaze/kernel/head.S
+++ b/arch/microblaze/kernel/head.S
@@ -31,6 +31,7 @@
31#include <linux/linkage.h> 31#include <linux/linkage.h>
32#include <asm/thread_info.h> 32#include <asm/thread_info.h>
33#include <asm/page.h> 33#include <asm/page.h>
34#include <asm/prom.h> /* for OF_DT_HEADER */
34 35
35#ifdef CONFIG_MMU 36#ifdef CONFIG_MMU
36#include <asm/setup.h> /* COMMAND_LINE_SIZE */ 37#include <asm/setup.h> /* COMMAND_LINE_SIZE */
@@ -54,11 +55,19 @@ ENTRY(_start)
54 andi r1, r1, ~2 55 andi r1, r1, ~2
55 mts rmsr, r1 56 mts rmsr, r1
56 57
57/* save fdt to kernel location */ 58/* r7 may point to an FDT, or there may be one linked in.
58/* r7 stores pointer to fdt blob */ 59 if it's in r7, we've got to save it away ASAP.
59 beqi r7, no_fdt_arg 60 We ensure r7 points to a valid FDT, just in case the bootloader
61 is broken or non-existent */
62 beqi r7, no_fdt_arg /* NULL pointer? don't copy */
63 lw r11, r0, r7 /* Does r7 point to a */
64 rsubi r11, r11, OF_DT_HEADER /* valid FDT? */
65 beqi r11, _prepare_copy_fdt
66 or r7, r0, r0 /* clear R7 when not valid DTB */
67 bnei r11, no_fdt_arg /* No - get out of here */
68_prepare_copy_fdt:
60 or r11, r0, r0 /* incremment */ 69 or r11, r0, r0 /* incremment */
61 ori r4, r0, TOPHYS(_fdt_start) /* save bram context */ 70 ori r4, r0, TOPHYS(_fdt_start)
62 ori r3, r0, (0x4000 - 4) 71 ori r3, r0, (0x4000 - 4)
63_copy_fdt: 72_copy_fdt:
64 lw r12, r7, r11 /* r12 = r7 + r11 */ 73 lw r12, r7, r11 /* r12 = r7 + r11 */
diff --git a/arch/microblaze/kernel/hw_exception_handler.S b/arch/microblaze/kernel/hw_exception_handler.S
index 9d591cd74fc2..3288c9737671 100644
--- a/arch/microblaze/kernel/hw_exception_handler.S
+++ b/arch/microblaze/kernel/hw_exception_handler.S
@@ -74,6 +74,7 @@
74 74
75#include <asm/mmu.h> 75#include <asm/mmu.h>
76#include <asm/pgtable.h> 76#include <asm/pgtable.h>
77#include <asm/signal.h>
77#include <asm/asm-offsets.h> 78#include <asm/asm-offsets.h>
78 79
79/* Helpful Macros */ 80/* Helpful Macros */
@@ -428,19 +429,9 @@ handle_unaligned_ex:
428 mfs r17, rbtr; /* ESR[DS] set - return address in BTR */ 429 mfs r17, rbtr; /* ESR[DS] set - return address in BTR */
429 nop 430 nop
430_no_delayslot: 431_no_delayslot:
431#endif 432 /* jump to high level unaligned handler */
432 433 RESTORE_STATE;
433#ifdef CONFIG_MMU 434 bri unaligned_data_trap
434 /* Check if unaligned address is last on a 4k page */
435 andi r5, r4, 0xffc
436 xori r5, r5, 0xffc
437 bnei r5, _unaligned_ex2
438 _unaligned_ex1:
439 RESTORE_STATE;
440/* Another page must be accessed or physical address not in page table */
441 bri unaligned_data_trap
442
443 _unaligned_ex2:
444#endif 435#endif
445 andi r6, r3, 0x3E0; /* Mask and extract the register operand */ 436 andi r6, r3, 0x3E0; /* Mask and extract the register operand */
446 srl r6, r6; /* r6 >> 5 */ 437 srl r6, r6; /* r6 >> 5 */
@@ -450,45 +441,6 @@ _no_delayslot:
450 srl r6, r6; 441 srl r6, r6;
451 /* Store the register operand in a temporary location */ 442 /* Store the register operand in a temporary location */
452 sbi r6, r0, TOPHYS(ex_reg_op); 443 sbi r6, r0, TOPHYS(ex_reg_op);
453#ifdef CONFIG_MMU
454 /* Get physical address */
455 /* If we are faulting a kernel address, we have to use the
456 * kernel page tables.
457 */
458 ori r5, r0, CONFIG_KERNEL_START
459 cmpu r5, r4, r5
460 bgti r5, _unaligned_ex3
461 ori r5, r0, swapper_pg_dir
462 bri _unaligned_ex4
463
464 /* Get the PGD for the current thread. */
465_unaligned_ex3: /* user thread */
466 addi r5 ,CURRENT_TASK, TOPHYS(0); /* get current task address */
467 lwi r5, r5, TASK_THREAD + PGDIR
468_unaligned_ex4:
469 tophys(r5,r5)
470 BSRLI(r6,r4,20) /* Create L1 (pgdir/pmd) address */
471 andi r6, r6, 0xffc
472/* Assume pgdir aligned on 4K boundary, no need for "andi r5,r5,0xfffff003" */
473 or r5, r5, r6
474 lwi r6, r5, 0 /* Get L1 entry */
475 andi r5, r6, 0xfffff000 /* Extract L2 (pte) base address. */
476 beqi r5, _unaligned_ex1 /* Bail if no table */
477
478 tophys(r5,r5)
479 BSRLI(r6,r4,10) /* Compute PTE address */
480 andi r6, r6, 0xffc
481 andi r5, r5, 0xfffff003
482 or r5, r5, r6
483 lwi r5, r5, 0 /* Get Linux PTE */
484
485 andi r6, r5, _PAGE_PRESENT
486 beqi r6, _unaligned_ex1 /* Bail if no page */
487
488 andi r5, r5, 0xfffff000 /* Extract RPN */
489 andi r4, r4, 0x00000fff /* Extract offset */
490 or r4, r4, r5 /* Create physical address */
491#endif /* CONFIG_MMU */
492 444
493 andi r6, r3, 0x400; /* Extract ESR[S] */ 445 andi r6, r3, 0x400; /* Extract ESR[S] */
494 bnei r6, ex_sw; 446 bnei r6, ex_sw;
@@ -959,15 +911,15 @@ _unaligned_data_exception:
959 andi r6, r3, 0x800; /* Extract ESR[W] - delay slot */ 911 andi r6, r3, 0x800; /* Extract ESR[W] - delay slot */
960ex_lw_vm: 912ex_lw_vm:
961 beqid r6, ex_lhw_vm; 913 beqid r6, ex_lhw_vm;
962 lbui r5, r4, 0; /* Exception address in r4 - delay slot */ 914load1: lbui r5, r4, 0; /* Exception address in r4 - delay slot */
963/* Load a word, byte-by-byte from destination address and save it in tmp space*/ 915/* Load a word, byte-by-byte from destination address and save it in tmp space*/
964 la r6, r0, ex_tmp_data_loc_0; 916 la r6, r0, ex_tmp_data_loc_0;
965 sbi r5, r6, 0; 917 sbi r5, r6, 0;
966 lbui r5, r4, 1; 918load2: lbui r5, r4, 1;
967 sbi r5, r6, 1; 919 sbi r5, r6, 1;
968 lbui r5, r4, 2; 920load3: lbui r5, r4, 2;
969 sbi r5, r6, 2; 921 sbi r5, r6, 2;
970 lbui r5, r4, 3; 922load4: lbui r5, r4, 3;
971 sbi r5, r6, 3; 923 sbi r5, r6, 3;
972 brid ex_lw_tail_vm; 924 brid ex_lw_tail_vm;
973/* Get the destination register value into r3 - delay slot */ 925/* Get the destination register value into r3 - delay slot */
@@ -977,7 +929,7 @@ ex_lhw_vm:
977 * save it in tmp space */ 929 * save it in tmp space */
978 la r6, r0, ex_tmp_data_loc_0; 930 la r6, r0, ex_tmp_data_loc_0;
979 sbi r5, r6, 0; 931 sbi r5, r6, 0;
980 lbui r5, r4, 1; 932load5: lbui r5, r4, 1;
981 sbi r5, r6, 1; 933 sbi r5, r6, 1;
982 lhui r3, r6, 0; /* Get the destination register value into r3 */ 934 lhui r3, r6, 0; /* Get the destination register value into r3 */
983ex_lw_tail_vm: 935ex_lw_tail_vm:
@@ -996,22 +948,53 @@ ex_sw_tail_vm:
996 swi r3, r5, 0; /* Get the word - delay slot */ 948 swi r3, r5, 0; /* Get the word - delay slot */
997 /* Store the word, byte-by-byte into destination address */ 949 /* Store the word, byte-by-byte into destination address */
998 lbui r3, r5, 0; 950 lbui r3, r5, 0;
999 sbi r3, r4, 0; 951store1: sbi r3, r4, 0;
1000 lbui r3, r5, 1; 952 lbui r3, r5, 1;
1001 sbi r3, r4, 1; 953store2: sbi r3, r4, 1;
1002 lbui r3, r5, 2; 954 lbui r3, r5, 2;
1003 sbi r3, r4, 2; 955store3: sbi r3, r4, 2;
1004 lbui r3, r5, 3; 956 lbui r3, r5, 3;
1005 brid ret_from_exc; 957 brid ret_from_exc;
1006 sbi r3, r4, 3; /* Delay slot */ 958store4: sbi r3, r4, 3; /* Delay slot */
1007ex_shw_vm: 959ex_shw_vm:
1008 /* Store the lower half-word, byte-by-byte into destination address */ 960 /* Store the lower half-word, byte-by-byte into destination address */
1009 lbui r3, r5, 2; 961 lbui r3, r5, 2;
1010 sbi r3, r4, 0; 962store5: sbi r3, r4, 0;
1011 lbui r3, r5, 3; 963 lbui r3, r5, 3;
1012 brid ret_from_exc; 964 brid ret_from_exc;
1013 sbi r3, r4, 1; /* Delay slot */ 965store6: sbi r3, r4, 1; /* Delay slot */
1014ex_sw_end_vm: /* Exception handling of store word, ends. */ 966ex_sw_end_vm: /* Exception handling of store word, ends. */
967
968/* We have to prevent cases that get/put_user macros get unaligned pointer
969 * to bad page area. We have to find out which origin instruction caused it
970 * and called fixup for that origin instruction not instruction in unaligned
971 * handler */
972ex_unaligned_fixup:
973 ori r5, r7, 0 /* setup pointer to pt_regs */
974 lwi r6, r7, PT_PC; /* faulting address is one instruction above */
975 addik r6, r6, -4 /* for finding proper fixup */
976 swi r6, r7, PT_PC; /* a save back it to PT_PC */
977 addik r7, r0, SIGSEGV
978 /* call bad_page_fault for finding aligned fixup, fixup address is saved
979 * in PT_PC which is used as return address from exception */
980 la r15, r0, ret_from_exc-8 /* setup return address */
981 brid bad_page_fault
982 nop
983
984/* We prevent all load/store because it could failed any attempt to access */
985.section __ex_table,"a";
986 .word load1,ex_unaligned_fixup;
987 .word load2,ex_unaligned_fixup;
988 .word load3,ex_unaligned_fixup;
989 .word load4,ex_unaligned_fixup;
990 .word load5,ex_unaligned_fixup;
991 .word store1,ex_unaligned_fixup;
992 .word store2,ex_unaligned_fixup;
993 .word store3,ex_unaligned_fixup;
994 .word store4,ex_unaligned_fixup;
995 .word store5,ex_unaligned_fixup;
996 .word store6,ex_unaligned_fixup;
997.previous;
1015.end _unaligned_data_exception 998.end _unaligned_data_exception
1016#endif /* CONFIG_MMU */ 999#endif /* CONFIG_MMU */
1017 1000
diff --git a/arch/microblaze/kernel/module.c b/arch/microblaze/kernel/module.c
index 51414171326f..5a45b1adfef1 100644
--- a/arch/microblaze/kernel/module.c
+++ b/arch/microblaze/kernel/module.c
@@ -57,7 +57,6 @@ int apply_relocate_add(Elf32_Shdr *sechdrs, const char *strtab,
57 Elf32_Rela *rela = (void *)sechdrs[relsec].sh_addr; 57 Elf32_Rela *rela = (void *)sechdrs[relsec].sh_addr;
58 Elf32_Sym *sym; 58 Elf32_Sym *sym;
59 unsigned long int *location; 59 unsigned long int *location;
60 unsigned long int locoffs;
61 unsigned long int value; 60 unsigned long int value;
62#if __GNUC__ < 4 61#if __GNUC__ < 4
63 unsigned long int old_value; 62 unsigned long int old_value;
@@ -113,10 +112,12 @@ int apply_relocate_add(Elf32_Shdr *sechdrs, const char *strtab,
113 break; 112 break;
114 113
115 case R_MICROBLAZE_64_PCREL: 114 case R_MICROBLAZE_64_PCREL:
116 locoffs = (location[0] & 0xFFFF) << 16 | 115#if __GNUC__ < 4
116 old_value = (location[0] & 0xFFFF) << 16 |
117 (location[1] & 0xFFFF); 117 (location[1] & 0xFFFF);
118 value -= (unsigned long int)(location) + 4 + 118 value -= old_value;
119 locoffs; 119#endif
120 value -= (unsigned long int)(location) + 4;
120 location[0] = (location[0] & 0xFFFF0000) | 121 location[0] = (location[0] & 0xFFFF0000) |
121 (value >> 16); 122 (value >> 16);
122 location[1] = (location[1] & 0xFFFF0000) | 123 location[1] = (location[1] & 0xFFFF0000) |
@@ -125,6 +126,14 @@ int apply_relocate_add(Elf32_Shdr *sechdrs, const char *strtab,
125 value); 126 value);
126 break; 127 break;
127 128
129 case R_MICROBLAZE_32_PCREL_LO:
130 pr_debug("R_MICROBLAZE_32_PCREL_LO\n");
131 break;
132
133 case R_MICROBLAZE_64_NONE:
134 pr_debug("R_MICROBLAZE_NONE\n");
135 break;
136
128 case R_MICROBLAZE_NONE: 137 case R_MICROBLAZE_NONE:
129 pr_debug("R_MICROBLAZE_NONE\n"); 138 pr_debug("R_MICROBLAZE_NONE\n");
130 break; 139 break;
@@ -133,7 +142,7 @@ int apply_relocate_add(Elf32_Shdr *sechdrs, const char *strtab,
133 printk(KERN_ERR "module %s: " 142 printk(KERN_ERR "module %s: "
134 "Unknown relocation: %u\n", 143 "Unknown relocation: %u\n",
135 module->name, 144 module->name,
136 ELF32_R_TYPE(rela->r_info)); 145 ELF32_R_TYPE(rela[i].r_info));
137 return -ENOEXEC; 146 return -ENOEXEC;
138 } 147 }
139 } 148 }
diff --git a/arch/microblaze/kernel/ptrace.c b/arch/microblaze/kernel/ptrace.c
index b86aa623e36d..53ff39af6a5c 100644
--- a/arch/microblaze/kernel/ptrace.c
+++ b/arch/microblaze/kernel/ptrace.c
@@ -27,7 +27,6 @@
27#include <linux/kernel.h> 27#include <linux/kernel.h>
28#include <linux/mm.h> 28#include <linux/mm.h>
29#include <linux/sched.h> 29#include <linux/sched.h>
30#include <linux/smp_lock.h>
31#include <linux/ptrace.h> 30#include <linux/ptrace.h>
32#include <linux/signal.h> 31#include <linux/signal.h>
33 32
diff --git a/arch/microblaze/kernel/setup.c b/arch/microblaze/kernel/setup.c
index 8709bea09604..2a97bf513b64 100644
--- a/arch/microblaze/kernel/setup.c
+++ b/arch/microblaze/kernel/setup.c
@@ -138,8 +138,12 @@ void __init machine_early_init(const char *cmdline, unsigned int ram,
138 setup_early_printk(NULL); 138 setup_early_printk(NULL);
139#endif 139#endif
140 140
141 early_printk("Ramdisk addr 0x%08x, FDT 0x%08x\n", ram, fdt); 141 early_printk("Ramdisk addr 0x%08x, ", ram);
142 printk(KERN_NOTICE "Found FDT at 0x%08x\n", fdt); 142 if (fdt)
143 early_printk("FDT at 0x%08x\n", fdt);
144 else
145 early_printk("Compiled-in FDT at 0x%08x\n",
146 (unsigned int)_fdt_start);
143 147
144#ifdef CONFIG_MTD_UCLINUX 148#ifdef CONFIG_MTD_UCLINUX
145 early_printk("Found romfs @ 0x%08x (0x%08x)\n", 149 early_printk("Found romfs @ 0x%08x (0x%08x)\n",
diff --git a/arch/microblaze/kernel/signal.c b/arch/microblaze/kernel/signal.c
index 4c0e6521b114..1c80e4fc40ce 100644
--- a/arch/microblaze/kernel/signal.c
+++ b/arch/microblaze/kernel/signal.c
@@ -21,7 +21,6 @@
21#include <linux/sched.h> 21#include <linux/sched.h>
22#include <linux/mm.h> 22#include <linux/mm.h>
23#include <linux/smp.h> 23#include <linux/smp.h>
24#include <linux/smp_lock.h>
25#include <linux/kernel.h> 24#include <linux/kernel.h>
26#include <linux/signal.h> 25#include <linux/signal.h>
27#include <linux/errno.h> 26#include <linux/errno.h>
@@ -45,91 +44,8 @@
45 44
46asmlinkage int do_signal(struct pt_regs *regs, sigset_t *oldset, int in_sycall); 45asmlinkage int do_signal(struct pt_regs *regs, sigset_t *oldset, int in_sycall);
47 46
48/*
49 * Atomically swap in the new signal mask, and wait for a signal.
50 */
51asmlinkage int
52sys_sigsuspend(old_sigset_t mask, struct pt_regs *regs)
53{
54 sigset_t saveset;
55
56 mask &= _BLOCKABLE;
57 spin_lock_irq(&current->sighand->siglock);
58 saveset = current->blocked;
59 siginitset(&current->blocked, mask);
60 recalc_sigpending();
61 spin_unlock_irq(&current->sighand->siglock);
62
63 regs->r3 = -EINTR;
64 while (1) {
65 current->state = TASK_INTERRUPTIBLE;
66 schedule();
67 if (do_signal(regs, &saveset, 1))
68 return -EINTR;
69 }
70}
71
72asmlinkage int
73sys_rt_sigsuspend(sigset_t __user *unewset, size_t sigsetsize,
74 struct pt_regs *regs)
75{
76 sigset_t saveset, newset;
77
78 /* XXX: Don't preclude handling different sized sigset_t's. */
79 if (sigsetsize != sizeof(sigset_t))
80 return -EINVAL;
81
82 if (copy_from_user(&newset, unewset, sizeof(newset)))
83 return -EFAULT;
84 sigdelsetmask(&newset, ~_BLOCKABLE);
85 spin_lock_irq(&current->sighand->siglock);
86 saveset = current->blocked;
87 current->blocked = newset;
88 recalc_sigpending();
89 spin_unlock_irq(&current->sighand->siglock);
90
91 regs->r3 = -EINTR;
92 while (1) {
93 current->state = TASK_INTERRUPTIBLE;
94 schedule();
95 if (do_signal(regs, &saveset, 1))
96 return -EINTR;
97 }
98}
99
100asmlinkage int
101sys_sigaction(int sig, const struct old_sigaction *act,
102 struct old_sigaction *oact)
103{
104 struct k_sigaction new_ka, old_ka;
105 int ret;
106
107 if (act) {
108 old_sigset_t mask;
109 if (!access_ok(VERIFY_READ, act, sizeof(*act)) ||
110 __get_user(new_ka.sa.sa_handler, &act->sa_handler) ||
111 __get_user(new_ka.sa.sa_restorer, &act->sa_restorer))
112 return -EFAULT;
113 __get_user(new_ka.sa.sa_flags, &act->sa_flags);
114 __get_user(mask, &act->sa_mask);
115 siginitset(&new_ka.sa.sa_mask, mask);
116 }
117 47
118 ret = do_sigaction(sig, act ? &new_ka : NULL, oact ? &old_ka : NULL); 48asmlinkage long
119
120 if (!ret && oact) {
121 if (!access_ok(VERIFY_WRITE, oact, sizeof(*oact)) ||
122 __put_user(old_ka.sa.sa_handler, &oact->sa_handler) ||
123 __put_user(old_ka.sa.sa_restorer, &oact->sa_restorer))
124 return -EFAULT;
125 __put_user(old_ka.sa.sa_flags, &oact->sa_flags);
126 __put_user(old_ka.sa.sa_mask.sig[0], &oact->sa_mask);
127 }
128
129 return ret;
130}
131
132asmlinkage int
133sys_sigaltstack(const stack_t __user *uss, stack_t __user *uoss, 49sys_sigaltstack(const stack_t __user *uss, stack_t __user *uoss,
134 struct pt_regs *regs) 50 struct pt_regs *regs)
135{ 51{
@@ -139,7 +55,6 @@ sys_sigaltstack(const stack_t __user *uss, stack_t __user *uoss,
139/* 55/*
140 * Do a signal return; undo the signal stack. 56 * Do a signal return; undo the signal stack.
141 */ 57 */
142
143struct sigframe { 58struct sigframe {
144 struct sigcontext sc; 59 struct sigcontext sc;
145 unsigned long extramask[_NSIG_WORDS-1]; 60 unsigned long extramask[_NSIG_WORDS-1];
@@ -176,40 +91,7 @@ static int restore_sigcontext(struct pt_regs *regs,
176 return err; 91 return err;
177} 92}
178 93
179asmlinkage int sys_sigreturn(struct pt_regs *regs) 94asmlinkage long sys_rt_sigreturn(struct pt_regs *regs)
180{
181 struct sigframe *frame =
182 (struct sigframe *)(regs->r1 + STATE_SAVE_ARG_SPACE);
183
184 sigset_t set;
185 int rval;
186
187 if (!access_ok(VERIFY_READ, frame, sizeof(*frame)))
188 goto badframe;
189
190 if (__get_user(set.sig[0], &frame->sc.oldmask)
191 || (_NSIG_WORDS > 1
192 && __copy_from_user(&set.sig[1], &frame->extramask,
193 sizeof(frame->extramask))))
194 goto badframe;
195
196 sigdelsetmask(&set, ~_BLOCKABLE);
197
198 spin_lock_irq(&current->sighand->siglock);
199 current->blocked = set;
200 recalc_sigpending();
201 spin_unlock_irq(&current->sighand->siglock);
202
203 if (restore_sigcontext(regs, &frame->sc, &rval))
204 goto badframe;
205 return rval;
206
207badframe:
208 force_sig(SIGSEGV, current);
209 return 0;
210}
211
212asmlinkage int sys_rt_sigreturn(struct pt_regs *regs)
213{ 95{
214 struct rt_sigframe __user *frame = 96 struct rt_sigframe __user *frame =
215 (struct rt_sigframe __user *)(regs->r1 + STATE_SAVE_ARG_SPACE); 97 (struct rt_sigframe __user *)(regs->r1 + STATE_SAVE_ARG_SPACE);
@@ -324,21 +206,17 @@ static void setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
324 /* Set up to return from userspace. If provided, use a stub 206 /* Set up to return from userspace. If provided, use a stub
325 already in userspace. */ 207 already in userspace. */
326 /* minus 8 is offset to cater for "rtsd r15,8" */ 208 /* minus 8 is offset to cater for "rtsd r15,8" */
327 if (ka->sa.sa_flags & SA_RESTORER) { 209 /* addi r12, r0, __NR_sigreturn */
328 regs->r15 = ((unsigned long)ka->sa.sa_restorer)-8; 210 err |= __put_user(0x31800000 | __NR_rt_sigreturn ,
329 } else { 211 frame->tramp + 0);
330 /* addi r12, r0, __NR_sigreturn */ 212 /* brki r14, 0x8 */
331 err |= __put_user(0x31800000 | __NR_rt_sigreturn , 213 err |= __put_user(0xb9cc0008, frame->tramp + 1);
332 frame->tramp + 0); 214
333 /* brki r14, 0x8 */ 215 /* Return from sighandler will jump to the tramp.
334 err |= __put_user(0xb9cc0008, frame->tramp + 1); 216 Negative 8 offset because return is rtsd r15, 8 */
335 217 regs->r15 = ((unsigned long)frame->tramp)-8;
336 /* Return from sighandler will jump to the tramp. 218
337 Negative 8 offset because return is rtsd r15, 8 */ 219 __invalidate_cache_sigtramp((unsigned long)frame->tramp);
338 regs->r15 = ((unsigned long)frame->tramp)-8;
339
340 __invalidate_cache_sigtramp((unsigned long)frame->tramp);
341 }
342 220
343 if (err) 221 if (err)
344 goto give_sigsegv; 222 goto give_sigsegv;
@@ -405,7 +283,7 @@ do_restart:
405 * OK, we're invoking a handler 283 * OK, we're invoking a handler
406 */ 284 */
407 285
408static void 286static int
409handle_signal(unsigned long sig, struct k_sigaction *ka, 287handle_signal(unsigned long sig, struct k_sigaction *ka,
410 siginfo_t *info, sigset_t *oldset, struct pt_regs *regs) 288 siginfo_t *info, sigset_t *oldset, struct pt_regs *regs)
411{ 289{
@@ -426,6 +304,7 @@ handle_signal(unsigned long sig, struct k_sigaction *ka,
426 recalc_sigpending(); 304 recalc_sigpending();
427 spin_unlock_irq(&current->sighand->siglock); 305 spin_unlock_irq(&current->sighand->siglock);
428 } 306 }
307 return 1;
429} 308}
430 309
431/* 310/*
@@ -456,7 +335,9 @@ int do_signal(struct pt_regs *regs, sigset_t *oldset, int in_syscall)
456 if (kernel_mode(regs)) 335 if (kernel_mode(regs))
457 return 1; 336 return 1;
458 337
459 if (!oldset) 338 if (current_thread_info()->status & TS_RESTORE_SIGMASK)
339 oldset = &current->saved_sigmask;
340 else
460 oldset = &current->blocked; 341 oldset = &current->blocked;
461 342
462 signr = get_signal_to_deliver(&info, &ka, regs, NULL); 343 signr = get_signal_to_deliver(&info, &ka, regs, NULL);
@@ -464,13 +345,31 @@ int do_signal(struct pt_regs *regs, sigset_t *oldset, int in_syscall)
464 /* Whee! Actually deliver the signal. */ 345 /* Whee! Actually deliver the signal. */
465 if (in_syscall) 346 if (in_syscall)
466 handle_restart(regs, &ka, 1); 347 handle_restart(regs, &ka, 1);
467 handle_signal(signr, &ka, &info, oldset, regs); 348 if (handle_signal(signr, &ka, &info, oldset, regs)) {
349 /*
350 * A signal was successfully delivered; the saved
351 * sigmask will have been stored in the signal frame,
352 * and will be restored by sigreturn, so we can simply
353 * clear the TS_RESTORE_SIGMASK flag.
354 */
355 current_thread_info()->status &=
356 ~TS_RESTORE_SIGMASK;
357 }
468 return 1; 358 return 1;
469 } 359 }
470 360
471 if (in_syscall) 361 if (in_syscall)
472 handle_restart(regs, NULL, 0); 362 handle_restart(regs, NULL, 0);
473 363
364 /*
365 * If there's no signal to deliver, we just put the saved sigmask
366 * back.
367 */
368 if (current_thread_info()->status & TS_RESTORE_SIGMASK) {
369 current_thread_info()->status &= ~TS_RESTORE_SIGMASK;
370 sigprocmask(SIG_SETMASK, &current->saved_sigmask, NULL);
371 }
372
474 /* Did we come from a system call? */ 373 /* Did we come from a system call? */
475 return 0; 374 return 0;
476} 375}
diff --git a/arch/microblaze/kernel/sys_microblaze.c b/arch/microblaze/kernel/sys_microblaze.c
index 31905ff590b7..b96f1682bb24 100644
--- a/arch/microblaze/kernel/sys_microblaze.c
+++ b/arch/microblaze/kernel/sys_microblaze.c
@@ -15,7 +15,6 @@
15#include <linux/errno.h> 15#include <linux/errno.h>
16#include <linux/mm.h> 16#include <linux/mm.h>
17#include <linux/smp.h> 17#include <linux/smp.h>
18#include <linux/smp_lock.h>
19#include <linux/syscalls.h> 18#include <linux/syscalls.h>
20#include <linux/sem.h> 19#include <linux/sem.h>
21#include <linux/msg.h> 20#include <linux/msg.h>
@@ -34,120 +33,21 @@
34#include <linux/unistd.h> 33#include <linux/unistd.h>
35 34
36#include <asm/syscalls.h> 35#include <asm/syscalls.h>
37/*
38 * sys_ipc() is the de-multiplexer for the SysV IPC calls..
39 *
40 * This is really horribly ugly. This will be remove with new toolchain.
41 */
42asmlinkage int
43sys_ipc(uint call, int first, int second, int third, void *ptr, long fifth)
44{
45 int version, ret;
46
47 version = call >> 16; /* hack for backward compatibility */
48 call &= 0xffff;
49
50 ret = -EINVAL;
51 switch (call) {
52 case SEMOP:
53 ret = sys_semop(first, (struct sembuf *)ptr, second);
54 break;
55 case SEMGET:
56 ret = sys_semget(first, second, third);
57 break;
58 case SEMCTL:
59 {
60 union semun fourth;
61
62 if (!ptr)
63 break;
64 ret = (access_ok(VERIFY_READ, ptr, sizeof(long)) ? 0 : -EFAULT)
65 || (get_user(fourth.__pad, (void **)ptr)) ;
66 if (ret)
67 break;
68 ret = sys_semctl(first, second, third, fourth);
69 break;
70 }
71 case MSGSND:
72 ret = sys_msgsnd(first, (struct msgbuf *) ptr, second, third);
73 break;
74 case MSGRCV:
75 switch (version) {
76 case 0: {
77 struct ipc_kludge tmp;
78
79 if (!ptr)
80 break;
81 ret = (access_ok(VERIFY_READ, ptr, sizeof(tmp))
82 ? 0 : -EFAULT) || copy_from_user(&tmp,
83 (struct ipc_kludge *) ptr, sizeof(tmp));
84 if (ret)
85 break;
86 ret = sys_msgrcv(first, tmp.msgp, second, tmp.msgtyp,
87 third);
88 break;
89 }
90 default:
91 ret = sys_msgrcv(first, (struct msgbuf *) ptr,
92 second, fifth, third);
93 break;
94 }
95 break;
96 case MSGGET:
97 ret = sys_msgget((key_t) first, second);
98 break;
99 case MSGCTL:
100 ret = sys_msgctl(first, second, (struct msqid_ds *) ptr);
101 break;
102 case SHMAT:
103 switch (version) {
104 default: {
105 ulong raddr;
106 ret = access_ok(VERIFY_WRITE, (ulong *) third,
107 sizeof(ulong)) ? 0 : -EFAULT;
108 if (ret)
109 break;
110 ret = do_shmat(first, (char *) ptr, second, &raddr);
111 if (ret)
112 break;
113 ret = put_user(raddr, (ulong *) third);
114 break;
115 }
116 case 1: /* iBCS2 emulator entry point */
117 if (!segment_eq(get_fs(), get_ds()))
118 break;
119 ret = do_shmat(first, (char *) ptr, second,
120 (ulong *) third);
121 break;
122 }
123 break;
124 case SHMDT:
125 ret = sys_shmdt((char *)ptr);
126 break;
127 case SHMGET:
128 ret = sys_shmget(first, second, third);
129 break;
130 case SHMCTL:
131 ret = sys_shmctl(first, second, (struct shmid_ds *) ptr);
132 break;
133 }
134 return ret;
135}
136 36
137asmlinkage int sys_vfork(struct pt_regs *regs) 37asmlinkage long microblaze_vfork(struct pt_regs *regs)
138{ 38{
139 return do_fork(CLONE_VFORK | CLONE_VM | SIGCHLD, regs->r1, 39 return do_fork(CLONE_VFORK | CLONE_VM | SIGCHLD, regs->r1,
140 regs, 0, NULL, NULL); 40 regs, 0, NULL, NULL);
141} 41}
142 42
143asmlinkage int sys_clone(int flags, unsigned long stack, struct pt_regs *regs) 43asmlinkage long microblaze_clone(int flags, unsigned long stack, struct pt_regs *regs)
144{ 44{
145 if (!stack) 45 if (!stack)
146 stack = regs->r1; 46 stack = regs->r1;
147 return do_fork(flags, stack, regs, 0, NULL, NULL); 47 return do_fork(flags, stack, regs, 0, NULL, NULL);
148} 48}
149 49
150asmlinkage int sys_execve(char __user *filenamei, char __user *__user *argv, 50asmlinkage long microblaze_execve(char __user *filenamei, char __user *__user *argv,
151 char __user *__user *envp, struct pt_regs *regs) 51 char __user *__user *envp, struct pt_regs *regs)
152{ 52{
153 int error; 53 int error;
@@ -163,8 +63,8 @@ out:
163 return error; 63 return error;
164} 64}
165 65
166asmlinkage unsigned long 66asmlinkage long
167sys_mmap2(unsigned long addr, size_t len, 67sys_mmap2(unsigned long addr, unsigned long len,
168 unsigned long prot, unsigned long flags, 68 unsigned long prot, unsigned long flags,
169 unsigned long fd, unsigned long pgoff) 69 unsigned long fd, unsigned long pgoff)
170{ 70{
@@ -189,18 +89,18 @@ out:
189 return ret; 89 return ret;
190} 90}
191 91
192asmlinkage unsigned long sys_mmap(unsigned long addr, size_t len, 92asmlinkage long sys_mmap(unsigned long addr, unsigned long len,
193 unsigned long prot, unsigned long flags, 93 unsigned long prot, unsigned long flags,
194 unsigned long fd, off_t offset) 94 unsigned long fd, off_t pgoff)
195{ 95{
196 int err = -EINVAL; 96 int err = -EINVAL;
197 97
198 if (offset & ~PAGE_MASK) { 98 if (pgoff & ~PAGE_MASK) {
199 printk(KERN_INFO "no pagemask in mmap\r\n"); 99 printk(KERN_INFO "no pagemask in mmap\r\n");
200 goto out; 100 goto out;
201 } 101 }
202 102
203 err = sys_mmap2(addr, len, prot, flags, fd, offset >> PAGE_SHIFT); 103 err = sys_mmap2(addr, len, prot, flags, fd, pgoff >> PAGE_SHIFT);
204out: 104out:
205 return err; 105 return err;
206} 106}
diff --git a/arch/microblaze/kernel/syscall_table.S b/arch/microblaze/kernel/syscall_table.S
index 376d1789f7c0..216db817beb6 100644
--- a/arch/microblaze/kernel/syscall_table.S
+++ b/arch/microblaze/kernel/syscall_table.S
@@ -15,7 +15,7 @@ ENTRY(sys_call_table)
15 .long sys_creat 15 .long sys_creat
16 .long sys_link 16 .long sys_link
17 .long sys_unlink /* 10 */ 17 .long sys_unlink /* 10 */
18 .long sys_execve_wrapper 18 .long sys_execve
19 .long sys_chdir 19 .long sys_chdir
20 .long sys_time 20 .long sys_time
21 .long sys_mknod 21 .long sys_mknod
@@ -71,12 +71,12 @@ ENTRY(sys_call_table)
71 .long sys_getppid 71 .long sys_getppid
72 .long sys_getpgrp /* 65 */ 72 .long sys_getpgrp /* 65 */
73 .long sys_setsid 73 .long sys_setsid
74 .long sys_sigaction 74 .long sys_ni_syscall /* sys_sigaction */
75 .long sys_sgetmask 75 .long sys_sgetmask
76 .long sys_ssetmask 76 .long sys_ssetmask
77 .long sys_setreuid /* 70 */ 77 .long sys_setreuid /* 70 */
78 .long sys_setregid 78 .long sys_setregid
79 .long sys_sigsuspend_wrapper 79 .long sys_ni_syscall /* sys_sigsuspend_wrapper */
80 .long sys_sigpending 80 .long sys_sigpending
81 .long sys_sethostname 81 .long sys_sethostname
82 .long sys_setrlimit /* 75 */ 82 .long sys_setrlimit /* 75 */
@@ -121,10 +121,10 @@ ENTRY(sys_call_table)
121 .long sys_wait4 121 .long sys_wait4
122 .long sys_swapoff /* 115 */ 122 .long sys_swapoff /* 115 */
123 .long sys_sysinfo 123 .long sys_sysinfo
124 .long sys_ipc 124 .long sys_ni_syscall /* old sys_ipc */
125 .long sys_fsync 125 .long sys_fsync
126 .long sys_sigreturn_wrapper 126 .long sys_ni_syscall /* sys_sigreturn_wrapper */
127 .long sys_clone_wrapper /* 120 */ 127 .long sys_clone /* 120 */
128 .long sys_setdomainname 128 .long sys_setdomainname
129 .long sys_newuname 129 .long sys_newuname
130 .long sys_ni_syscall /* modify_ldt */ 130 .long sys_ni_syscall /* modify_ldt */
@@ -194,7 +194,7 @@ ENTRY(sys_call_table)
194 .long sys_sendfile 194 .long sys_sendfile
195 .long sys_ni_syscall /* reserved for streams1 */ 195 .long sys_ni_syscall /* reserved for streams1 */
196 .long sys_ni_syscall /* reserved for streams2 */ 196 .long sys_ni_syscall /* reserved for streams2 */
197 .long sys_vfork_wrapper /* 190 */ 197 .long sys_vfork /* 190 */
198 .long sys_getrlimit 198 .long sys_getrlimit
199 .long sys_mmap2 /* mmap2 */ 199 .long sys_mmap2 /* mmap2 */
200 .long sys_truncate64 200 .long sys_truncate64
@@ -369,3 +369,5 @@ ENTRY(sys_call_table)
369 .long sys_ni_syscall 369 .long sys_ni_syscall
370 .long sys_ni_syscall 370 .long sys_ni_syscall
371 .long sys_ni_syscall 371 .long sys_ni_syscall
372 .long sys_rt_tgsigqueueinfo /* 365 */
373 .long sys_perf_counter_open
diff --git a/arch/microblaze/lib/Makefile b/arch/microblaze/lib/Makefile
index 71c8cb6c9e43..b579db068c06 100644
--- a/arch/microblaze/lib/Makefile
+++ b/arch/microblaze/lib/Makefile
@@ -2,7 +2,7 @@
2# Makefile 2# Makefile
3# 3#
4 4
5lib-y := memset.o checksum.o 5lib-y := memset.o
6 6
7ifeq ($(CONFIG_OPT_LIB_ASM),y) 7ifeq ($(CONFIG_OPT_LIB_ASM),y)
8lib-y += fastcopy.o 8lib-y += fastcopy.o
diff --git a/arch/microblaze/lib/checksum.c b/arch/microblaze/lib/checksum.c
deleted file mode 100644
index f08e74591418..000000000000
--- a/arch/microblaze/lib/checksum.c
+++ /dev/null
@@ -1,172 +0,0 @@
1/*
2 *
3 * INET An implementation of the TCP/IP protocol suite for the LINUX
4 * operating system. INET is implemented using the BSD Socket
5 * interface as the means of communication with the user level.
6 *
7 * IP/TCP/UDP checksumming routines
8 *
9 * Authors: Jorge Cwik, <jorge@laser.satlink.net>
10 * Arnt Gulbrandsen, <agulbra@nvg.unit.no>
11 * Tom May, <ftom@netcom.com>
12 * Andreas Schwab, <schwab@issan.informatik.uni-dortmund.de>
13 * Lots of code moved from tcp.c and ip.c; see those files
14 * for more names.
15 *
16 * 03/02/96 Jes Sorensen, Andreas Schwab, Roman Hodek:
17 * Fixed some nasty bugs, causing some horrible crashes.
18 * A: At some points, the sum (%0) was used as
19 * length-counter instead of the length counter
20 * (%1). Thanks to Roman Hodek for pointing this out.
21 * B: GCC seems to mess up if one uses too many
22 * data-registers to hold input values and one tries to
23 * specify d0 and d1 as scratch registers. Letting gcc
24 * choose these registers itself solves the problem.
25 *
26 * This program is free software; you can redistribute it and/or
27 * modify it under the terms of the GNU General Public License
28 * as published by the Free Software Foundation; either version
29 * 2 of the License, or (at your option) any later version.
30 */
31
32/* Revised by Kenneth Albanowski for m68knommu. Basic problem: unaligned access
33 kills, so most of the assembly has to go. */
34
35#include <linux/module.h>
36#include <net/checksum.h>
37
38#include <asm/byteorder.h>
39
40static inline unsigned short from32to16(unsigned long x)
41{
42 /* add up 16-bit and 16-bit for 16+c bit */
43 x = (x & 0xffff) + (x >> 16);
44 /* add up carry.. */
45 x = (x & 0xffff) + (x >> 16);
46 return x;
47}
48
49static unsigned int do_csum(const unsigned char *buff, int len)
50{
51 int odd, count;
52 unsigned long result = 0;
53
54 if (len <= 0)
55 goto out;
56 odd = 1 & (unsigned long) buff;
57 if (odd) {
58 result = *buff;
59 len--;
60 buff++;
61 }
62 count = len >> 1; /* nr of 16-bit words.. */
63 if (count) {
64 if (2 & (unsigned long) buff) {
65 result += *(unsigned short *) buff;
66 count--;
67 len -= 2;
68 buff += 2;
69 }
70 count >>= 1; /* nr of 32-bit words.. */
71 if (count) {
72 unsigned long carry = 0;
73 do {
74 unsigned long w = *(unsigned long *) buff;
75 count--;
76 buff += 4;
77 result += carry;
78 result += w;
79 carry = (w > result);
80 } while (count);
81 result += carry;
82 result = (result & 0xffff) + (result >> 16);
83 }
84 if (len & 2) {
85 result += *(unsigned short *) buff;
86 buff += 2;
87 }
88 }
89 if (len & 1)
90 result += (*buff << 8);
91 result = from32to16(result);
92 if (odd)
93 result = ((result >> 8) & 0xff) | ((result & 0xff) << 8);
94out:
95 return result;
96}
97
98/*
99 * This is a version of ip_compute_csum() optimized for IP headers,
100 * which always checksum on 4 octet boundaries.
101 */
102__sum16 ip_fast_csum(const void *iph, unsigned int ihl)
103{
104 return (__force __sum16)~do_csum(iph, ihl*4);
105}
106EXPORT_SYMBOL(ip_fast_csum);
107
108/*
109 * computes the checksum of a memory block at buff, length len,
110 * and adds in "sum" (32-bit)
111 *
112 * returns a 32-bit number suitable for feeding into itself
113 * or csum_tcpudp_magic
114 *
115 * this function must be called with even lengths, except
116 * for the last fragment, which may be odd
117 *
118 * it's best to have buff aligned on a 32-bit boundary
119 */
120__wsum csum_partial(const void *buff, int len, __wsum wsum)
121{
122 unsigned int sum = (__force unsigned int)wsum;
123 unsigned int result = do_csum(buff, len);
124
125 /* add in old sum, and carry.. */
126 result += sum;
127 if (sum > result)
128 result += 1;
129 return (__force __wsum)result;
130}
131EXPORT_SYMBOL(csum_partial);
132
133/*
134 * this routine is used for miscellaneous IP-like checksums, mainly
135 * in icmp.c
136 */
137__sum16 ip_compute_csum(const void *buff, int len)
138{
139 return (__force __sum16)~do_csum(buff, len);
140}
141EXPORT_SYMBOL(ip_compute_csum);
142
143/*
144 * copy from fs while checksumming, otherwise like csum_partial
145 */
146__wsum
147csum_partial_copy_from_user(const void __user *src, void *dst, int len,
148 __wsum sum, int *csum_err)
149{
150 int missing;
151
152 missing = __copy_from_user(dst, src, len);
153 if (missing) {
154 memset(dst + len - missing, 0, missing);
155 *csum_err = -EFAULT;
156 } else
157 *csum_err = 0;
158
159 return csum_partial(dst, len, sum);
160}
161EXPORT_SYMBOL(csum_partial_copy_from_user);
162
163/*
164 * copy from ds while checksumming, otherwise like csum_partial
165 */
166__wsum
167csum_partial_copy(const void *src, void *dst, int len, __wsum sum)
168{
169 memcpy(dst, src, len);
170 return csum_partial(dst, len, sum);
171}
172EXPORT_SYMBOL(csum_partial_copy);
diff --git a/arch/microblaze/mm/fault.c b/arch/microblaze/mm/fault.c
index 956607a63f4c..d9d249a66ff2 100644
--- a/arch/microblaze/mm/fault.c
+++ b/arch/microblaze/mm/fault.c
@@ -69,7 +69,7 @@ static int store_updates_sp(struct pt_regs *regs)
69 * It is called from do_page_fault above and from some of the procedures 69 * It is called from do_page_fault above and from some of the procedures
70 * in traps.c. 70 * in traps.c.
71 */ 71 */
72static void bad_page_fault(struct pt_regs *regs, unsigned long address, int sig) 72void bad_page_fault(struct pt_regs *regs, unsigned long address, int sig)
73{ 73{
74 const struct exception_table_entry *fixup; 74 const struct exception_table_entry *fixup;
75/* MS: no context */ 75/* MS: no context */
@@ -122,15 +122,10 @@ void do_page_fault(struct pt_regs *regs, unsigned long address,
122 } 122 }
123#endif /* CONFIG_KGDB */ 123#endif /* CONFIG_KGDB */
124 124
125 if (in_atomic() || mm == NULL) { 125 if (in_atomic() || !mm) {
126 /* FIXME */ 126 if (kernel_mode(regs))
127 if (kernel_mode(regs)) { 127 goto bad_area_nosemaphore;
128 printk(KERN_EMERG 128
129 "Page fault in kernel mode - Oooou!!! pid %d\n",
130 current->pid);
131 _exception(SIGSEGV, regs, code, address);
132 return;
133 }
134 /* in_atomic() in user mode is really bad, 129 /* in_atomic() in user mode is really bad,
135 as is current->mm == NULL. */ 130 as is current->mm == NULL. */
136 printk(KERN_EMERG "Page fault in user mode with " 131 printk(KERN_EMERG "Page fault in user mode with "
diff --git a/arch/microblaze/mm/init.c b/arch/microblaze/mm/init.c
index b5a701cd71e0..8d92c4efe9a4 100644
--- a/arch/microblaze/mm/init.c
+++ b/arch/microblaze/mm/init.c
@@ -80,15 +80,15 @@ void __init setup_memory(void)
80 memory_size = memory_end - memory_start; 80 memory_size = memory_end - memory_start;
81 PAGE_OFFSET = memory_start; 81 PAGE_OFFSET = memory_start;
82 printk(KERN_INFO "%s: Main mem: 0x%x-0x%x, " 82 printk(KERN_INFO "%s: Main mem: 0x%x-0x%x, "
83 "size 0x%08x\n", __func__, memory_start, 83 "size 0x%08x\n", __func__, (u32) memory_start,
84 memory_end, memory_size); 84 (u32) memory_end, (u32) memory_size);
85 break; 85 break;
86 } 86 }
87 } 87 }
88 88
89 if (!memory_start || !memory_end) { 89 if (!memory_start || !memory_end) {
90 panic("%s: Missing memory setting 0x%08x-0x%08x\n", 90 panic("%s: Missing memory setting 0x%08x-0x%08x\n",
91 __func__, memory_start, memory_end); 91 __func__, (u32) memory_start, (u32) memory_end);
92 } 92 }
93 93
94 /* reservation of region where is the kernel */ 94 /* reservation of region where is the kernel */
diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
index 8c4be1f301cf..3ca0fe1a9123 100644
--- a/arch/mips/Kconfig
+++ b/arch/mips/Kconfig
@@ -22,6 +22,26 @@ choice
22config MACH_ALCHEMY 22config MACH_ALCHEMY
23 bool "Alchemy processor based machines" 23 bool "Alchemy processor based machines"
24 24
25config AR7
26 bool "Texas Instruments AR7"
27 select BOOT_ELF32
28 select DMA_NONCOHERENT
29 select CEVT_R4K
30 select CSRC_R4K
31 select IRQ_CPU
32 select NO_EXCEPT_FILL
33 select SWAP_IO_SPACE
34 select SYS_HAS_CPU_MIPS32_R1
35 select SYS_HAS_EARLY_PRINTK
36 select SYS_SUPPORTS_32BIT_KERNEL
37 select SYS_SUPPORTS_LITTLE_ENDIAN
38 select GENERIC_GPIO
39 select GCD
40 select VLYNQ
41 help
42 Support for the Texas Instruments AR7 System-on-a-Chip
43 family: TNETD7100, 7200 and 7300.
44
25config BASLER_EXCITE 45config BASLER_EXCITE
26 bool "Basler eXcite smart camera" 46 bool "Basler eXcite smart camera"
27 select CEVT_R4K 47 select CEVT_R4K
@@ -209,7 +229,7 @@ config MIPS_MALTA
209 select SYS_SUPPORTS_64BIT_KERNEL 229 select SYS_SUPPORTS_64BIT_KERNEL
210 select SYS_SUPPORTS_BIG_ENDIAN 230 select SYS_SUPPORTS_BIG_ENDIAN
211 select SYS_SUPPORTS_LITTLE_ENDIAN 231 select SYS_SUPPORTS_LITTLE_ENDIAN
212 select SYS_SUPPORTS_MIPS_CMP if BROKEN # because SYNC_R4K is broken 232 select SYS_SUPPORTS_MIPS_CMP
213 select SYS_SUPPORTS_MULTITHREADING 233 select SYS_SUPPORTS_MULTITHREADING
214 select SYS_SUPPORTS_SMARTMIPS 234 select SYS_SUPPORTS_SMARTMIPS
215 help 235 help
@@ -247,6 +267,7 @@ config MACH_VR41XX
247 select CEVT_R4K 267 select CEVT_R4K
248 select CSRC_R4K 268 select CSRC_R4K
249 select SYS_HAS_CPU_VR41XX 269 select SYS_HAS_CPU_VR41XX
270 select ARCH_REQUIRE_GPIOLIB
250 271
251config NXP_STB220 272config NXP_STB220
252 bool "NXP STB220 board" 273 bool "NXP STB220 board"
@@ -1635,7 +1656,7 @@ config MIPS_APSP_KSPD
1635config MIPS_CMP 1656config MIPS_CMP
1636 bool "MIPS CMP framework support" 1657 bool "MIPS CMP framework support"
1637 depends on SYS_SUPPORTS_MIPS_CMP 1658 depends on SYS_SUPPORTS_MIPS_CMP
1638 select SYNC_R4K if BROKEN 1659 select SYNC_R4K
1639 select SYS_SUPPORTS_SMP 1660 select SYS_SUPPORTS_SMP
1640 select SYS_SUPPORTS_SCHED_SMT if SMP 1661 select SYS_SUPPORTS_SCHED_SMT if SMP
1641 select WEAK_ORDERING 1662 select WEAK_ORDERING
@@ -2147,11 +2168,11 @@ menu "Power management options"
2147 2168
2148config ARCH_HIBERNATION_POSSIBLE 2169config ARCH_HIBERNATION_POSSIBLE
2149 def_bool y 2170 def_bool y
2150 depends on SYS_SUPPORTS_HOTPLUG_CPU 2171 depends on SYS_SUPPORTS_HOTPLUG_CPU || !SMP
2151 2172
2152config ARCH_SUSPEND_POSSIBLE 2173config ARCH_SUSPEND_POSSIBLE
2153 def_bool y 2174 def_bool y
2154 depends on SYS_SUPPORTS_HOTPLUG_CPU 2175 depends on SYS_SUPPORTS_HOTPLUG_CPU || !SMP
2155 2176
2156source "kernel/power/Kconfig" 2177source "kernel/power/Kconfig"
2157 2178
diff --git a/arch/mips/Makefile b/arch/mips/Makefile
index 807572a6a4d2..861da514a468 100644
--- a/arch/mips/Makefile
+++ b/arch/mips/Makefile
@@ -173,6 +173,13 @@ libs-y += arch/mips/fw/lib/
173# 173#
174 174
175# 175#
176# Texas Instruments AR7
177#
178core-$(CONFIG_AR7) += arch/mips/ar7/
179cflags-$(CONFIG_AR7) += -I$(srctree)/arch/mips/include/asm/mach-ar7
180load-$(CONFIG_AR7) += 0xffffffff94100000
181
182#
176# Acer PICA 61, Mips Magnum 4000 and Olivetti M700. 183# Acer PICA 61, Mips Magnum 4000 and Olivetti M700.
177# 184#
178core-$(CONFIG_MACH_JAZZ) += arch/mips/jazz/ 185core-$(CONFIG_MACH_JAZZ) += arch/mips/jazz/
diff --git a/arch/mips/alchemy/mtx-1/platform.c b/arch/mips/alchemy/mtx-1/platform.c
index 8b5914d1241f..e30e42add697 100644
--- a/arch/mips/alchemy/mtx-1/platform.c
+++ b/arch/mips/alchemy/mtx-1/platform.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * MTX-1 platform devices registration 2 * MTX-1 platform devices registration
3 * 3 *
4 * Copyright (C) 2007, Florian Fainelli <florian@openwrt.org> 4 * Copyright (C) 2007-2009, Florian Fainelli <florian@openwrt.org>
5 * 5 *
6 * This program is free software; you can redistribute it and/or modify 6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by 7 * it under the terms of the GNU General Public License as published by
@@ -142,7 +142,17 @@ static struct __initdata platform_device * mtx1_devs[] = {
142 142
143static int __init mtx1_register_devices(void) 143static int __init mtx1_register_devices(void)
144{ 144{
145 gpio_direction_input(207); 145 int rc;
146
147 rc = gpio_request(mtx1_gpio_button[0].gpio,
148 mtx1_gpio_button[0].desc);
149 if (rc < 0) {
150 printk(KERN_INFO "mtx1: failed to request %d\n",
151 mtx1_gpio_button[0].gpio);
152 goto out;
153 }
154 gpio_direction_input(mtx1_gpio_button[0].gpio);
155out:
146 return platform_add_devices(mtx1_devs, ARRAY_SIZE(mtx1_devs)); 156 return platform_add_devices(mtx1_devs, ARRAY_SIZE(mtx1_devs));
147} 157}
148 158
diff --git a/arch/mips/ar7/Makefile b/arch/mips/ar7/Makefile
new file mode 100644
index 000000000000..26bc5da18997
--- /dev/null
+++ b/arch/mips/ar7/Makefile
@@ -0,0 +1,11 @@
1
2obj-y := \
3 prom.o \
4 setup.o \
5 memory.o \
6 irq.o \
7 time.o \
8 platform.o \
9 gpio.o \
10 clock.o
11EXTRA_CFLAGS += -Werror
diff --git a/arch/mips/ar7/clock.c b/arch/mips/ar7/clock.c
new file mode 100644
index 000000000000..cc65c8eb391b
--- /dev/null
+++ b/arch/mips/ar7/clock.c
@@ -0,0 +1,427 @@
1/*
2 * Copyright (C) 2007 Felix Fietkau <nbd@openwrt.org>
3 * Copyright (C) 2007 Eugene Konev <ejka@openwrt.org>
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18 */
19
20#include <linux/kernel.h>
21#include <linux/init.h>
22#include <linux/types.h>
23#include <linux/module.h>
24#include <linux/delay.h>
25#include <linux/gcd.h>
26#include <linux/io.h>
27
28#include <asm/addrspace.h>
29#include <asm/mach-ar7/ar7.h>
30
31#define BOOT_PLL_SOURCE_MASK 0x3
32#define CPU_PLL_SOURCE_SHIFT 16
33#define BUS_PLL_SOURCE_SHIFT 14
34#define USB_PLL_SOURCE_SHIFT 18
35#define DSP_PLL_SOURCE_SHIFT 22
36#define BOOT_PLL_SOURCE_AFE 0
37#define BOOT_PLL_SOURCE_BUS 0
38#define BOOT_PLL_SOURCE_REF 1
39#define BOOT_PLL_SOURCE_XTAL 2
40#define BOOT_PLL_SOURCE_CPU 3
41#define BOOT_PLL_BYPASS 0x00000020
42#define BOOT_PLL_ASYNC_MODE 0x02000000
43#define BOOT_PLL_2TO1_MODE 0x00008000
44
45#define TNETD7200_CLOCK_ID_CPU 0
46#define TNETD7200_CLOCK_ID_DSP 1
47#define TNETD7200_CLOCK_ID_USB 2
48
49#define TNETD7200_DEF_CPU_CLK 211000000
50#define TNETD7200_DEF_DSP_CLK 125000000
51#define TNETD7200_DEF_USB_CLK 48000000
52
53struct tnetd7300_clock {
54 u32 ctrl;
55#define PREDIV_MASK 0x001f0000
56#define PREDIV_SHIFT 16
57#define POSTDIV_MASK 0x0000001f
58 u32 unused1[3];
59 u32 pll;
60#define MUL_MASK 0x0000f000
61#define MUL_SHIFT 12
62#define PLL_MODE_MASK 0x00000001
63#define PLL_NDIV 0x00000800
64#define PLL_DIV 0x00000002
65#define PLL_STATUS 0x00000001
66 u32 unused2[3];
67};
68
69struct tnetd7300_clocks {
70 struct tnetd7300_clock bus;
71 struct tnetd7300_clock cpu;
72 struct tnetd7300_clock usb;
73 struct tnetd7300_clock dsp;
74};
75
76struct tnetd7200_clock {
77 u32 ctrl;
78 u32 unused1[3];
79#define DIVISOR_ENABLE_MASK 0x00008000
80 u32 mul;
81 u32 prediv;
82 u32 postdiv;
83 u32 postdiv2;
84 u32 unused2[6];
85 u32 cmd;
86 u32 status;
87 u32 cmden;
88 u32 padding[15];
89};
90
91struct tnetd7200_clocks {
92 struct tnetd7200_clock cpu;
93 struct tnetd7200_clock dsp;
94 struct tnetd7200_clock usb;
95};
96
97int ar7_cpu_clock = 150000000;
98EXPORT_SYMBOL(ar7_cpu_clock);
99int ar7_bus_clock = 125000000;
100EXPORT_SYMBOL(ar7_bus_clock);
101int ar7_dsp_clock;
102EXPORT_SYMBOL(ar7_dsp_clock);
103
104static void approximate(int base, int target, int *prediv,
105 int *postdiv, int *mul)
106{
107 int i, j, k, freq, res = target;
108 for (i = 1; i <= 16; i++)
109 for (j = 1; j <= 32; j++)
110 for (k = 1; k <= 32; k++) {
111 freq = abs(base / j * i / k - target);
112 if (freq < res) {
113 res = freq;
114 *mul = i;
115 *prediv = j;
116 *postdiv = k;
117 }
118 }
119}
120
121static void calculate(int base, int target, int *prediv, int *postdiv,
122 int *mul)
123{
124 int tmp_gcd, tmp_base, tmp_freq;
125
126 for (*prediv = 1; *prediv <= 32; (*prediv)++) {
127 tmp_base = base / *prediv;
128 tmp_gcd = gcd(target, tmp_base);
129 *mul = target / tmp_gcd;
130 *postdiv = tmp_base / tmp_gcd;
131 if ((*mul < 1) || (*mul >= 16))
132 continue;
133 if ((*postdiv > 0) & (*postdiv <= 32))
134 break;
135 }
136
137 if (base / *prediv * *mul / *postdiv != target) {
138 approximate(base, target, prediv, postdiv, mul);
139 tmp_freq = base / *prediv * *mul / *postdiv;
140 printk(KERN_WARNING
141 "Adjusted requested frequency %d to %d\n",
142 target, tmp_freq);
143 }
144
145 printk(KERN_DEBUG "Clocks: prediv: %d, postdiv: %d, mul: %d\n",
146 *prediv, *postdiv, *mul);
147}
148
149static int tnetd7300_dsp_clock(void)
150{
151 u32 didr1, didr2;
152 u8 rev = ar7_chip_rev();
153 didr1 = readl((void *)KSEG1ADDR(AR7_REGS_GPIO + 0x18));
154 didr2 = readl((void *)KSEG1ADDR(AR7_REGS_GPIO + 0x1c));
155 if (didr2 & (1 << 23))
156 return 0;
157 if ((rev >= 0x23) && (rev != 0x57))
158 return 250000000;
159 if ((((didr2 & 0x1fff) << 10) | ((didr1 & 0xffc00000) >> 22))
160 > 4208000)
161 return 250000000;
162 return 0;
163}
164
165static int tnetd7300_get_clock(u32 shift, struct tnetd7300_clock *clock,
166 u32 *bootcr, u32 bus_clock)
167{
168 int product;
169 int base_clock = AR7_REF_CLOCK;
170 u32 ctrl = readl(&clock->ctrl);
171 u32 pll = readl(&clock->pll);
172 int prediv = ((ctrl & PREDIV_MASK) >> PREDIV_SHIFT) + 1;
173 int postdiv = (ctrl & POSTDIV_MASK) + 1;
174 int divisor = prediv * postdiv;
175 int mul = ((pll & MUL_MASK) >> MUL_SHIFT) + 1;
176
177 switch ((*bootcr & (BOOT_PLL_SOURCE_MASK << shift)) >> shift) {
178 case BOOT_PLL_SOURCE_BUS:
179 base_clock = bus_clock;
180 break;
181 case BOOT_PLL_SOURCE_REF:
182 base_clock = AR7_REF_CLOCK;
183 break;
184 case BOOT_PLL_SOURCE_XTAL:
185 base_clock = AR7_XTAL_CLOCK;
186 break;
187 case BOOT_PLL_SOURCE_CPU:
188 base_clock = ar7_cpu_clock;
189 break;
190 }
191
192 if (*bootcr & BOOT_PLL_BYPASS)
193 return base_clock / divisor;
194
195 if ((pll & PLL_MODE_MASK) == 0)
196 return (base_clock >> (mul / 16 + 1)) / divisor;
197
198 if ((pll & (PLL_NDIV | PLL_DIV)) == (PLL_NDIV | PLL_DIV)) {
199 product = (mul & 1) ?
200 (base_clock * mul) >> 1 :
201 (base_clock * (mul - 1)) >> 2;
202 return product / divisor;
203 }
204
205 if (mul == 16)
206 return base_clock / divisor;
207
208 return base_clock * mul / divisor;
209}
210
211static void tnetd7300_set_clock(u32 shift, struct tnetd7300_clock *clock,
212 u32 *bootcr, u32 frequency)
213{
214 int prediv, postdiv, mul;
215 int base_clock = ar7_bus_clock;
216
217 switch ((*bootcr & (BOOT_PLL_SOURCE_MASK << shift)) >> shift) {
218 case BOOT_PLL_SOURCE_BUS:
219 base_clock = ar7_bus_clock;
220 break;
221 case BOOT_PLL_SOURCE_REF:
222 base_clock = AR7_REF_CLOCK;
223 break;
224 case BOOT_PLL_SOURCE_XTAL:
225 base_clock = AR7_XTAL_CLOCK;
226 break;
227 case BOOT_PLL_SOURCE_CPU:
228 base_clock = ar7_cpu_clock;
229 break;
230 }
231
232 calculate(base_clock, frequency, &prediv, &postdiv, &mul);
233
234 writel(((prediv - 1) << PREDIV_SHIFT) | (postdiv - 1), &clock->ctrl);
235 msleep(1);
236 writel(4, &clock->pll);
237 while (readl(&clock->pll) & PLL_STATUS)
238 ;
239 writel(((mul - 1) << MUL_SHIFT) | (0xff << 3) | 0x0e, &clock->pll);
240 msleep(75);
241}
242
243static void __init tnetd7300_init_clocks(void)
244{
245 u32 *bootcr = (u32 *)ioremap_nocache(AR7_REGS_DCL, 4);
246 struct tnetd7300_clocks *clocks =
247 ioremap_nocache(UR8_REGS_CLOCKS,
248 sizeof(struct tnetd7300_clocks));
249
250 ar7_bus_clock = tnetd7300_get_clock(BUS_PLL_SOURCE_SHIFT,
251 &clocks->bus, bootcr, AR7_AFE_CLOCK);
252
253 if (*bootcr & BOOT_PLL_ASYNC_MODE)
254 ar7_cpu_clock = tnetd7300_get_clock(CPU_PLL_SOURCE_SHIFT,
255 &clocks->cpu, bootcr, AR7_AFE_CLOCK);
256 else
257 ar7_cpu_clock = ar7_bus_clock;
258
259 if (ar7_dsp_clock == 250000000)
260 tnetd7300_set_clock(DSP_PLL_SOURCE_SHIFT, &clocks->dsp,
261 bootcr, ar7_dsp_clock);
262
263 iounmap(clocks);
264 iounmap(bootcr);
265}
266
267static void tnetd7200_set_clock(int base, struct tnetd7200_clock *clock,
268 int prediv, int postdiv, int postdiv2, int mul, u32 frequency)
269{
270 printk(KERN_INFO
271 "Clocks: base = %d, frequency = %u, prediv = %d, "
272 "postdiv = %d, postdiv2 = %d, mul = %d\n",
273 base, frequency, prediv, postdiv, postdiv2, mul);
274
275 writel(0, &clock->ctrl);
276 writel(DIVISOR_ENABLE_MASK | ((prediv - 1) & 0x1F), &clock->prediv);
277 writel((mul - 1) & 0xF, &clock->mul);
278
279 while (readl(&clock->status) & 0x1)
280 ; /* nop */
281
282 writel(DIVISOR_ENABLE_MASK | ((postdiv - 1) & 0x1F), &clock->postdiv);
283
284 writel(readl(&clock->cmden) | 1, &clock->cmden);
285 writel(readl(&clock->cmd) | 1, &clock->cmd);
286
287 while (readl(&clock->status) & 0x1)
288 ; /* nop */
289
290 writel(DIVISOR_ENABLE_MASK | ((postdiv2 - 1) & 0x1F), &clock->postdiv2);
291
292 writel(readl(&clock->cmden) | 1, &clock->cmden);
293 writel(readl(&clock->cmd) | 1, &clock->cmd);
294
295 while (readl(&clock->status) & 0x1)
296 ; /* nop */
297
298 writel(readl(&clock->ctrl) | 1, &clock->ctrl);
299}
300
301static int tnetd7200_get_clock_base(int clock_id, u32 *bootcr)
302{
303 if (*bootcr & BOOT_PLL_ASYNC_MODE)
304 /* Async */
305 switch (clock_id) {
306 case TNETD7200_CLOCK_ID_DSP:
307 return AR7_REF_CLOCK;
308 default:
309 return AR7_AFE_CLOCK;
310 }
311 else
312 /* Sync */
313 if (*bootcr & BOOT_PLL_2TO1_MODE)
314 /* 2:1 */
315 switch (clock_id) {
316 case TNETD7200_CLOCK_ID_DSP:
317 return AR7_REF_CLOCK;
318 default:
319 return AR7_AFE_CLOCK;
320 }
321 else
322 /* 1:1 */
323 return AR7_REF_CLOCK;
324}
325
326
327static void __init tnetd7200_init_clocks(void)
328{
329 u32 *bootcr = (u32 *)ioremap_nocache(AR7_REGS_DCL, 4);
330 struct tnetd7200_clocks *clocks =
331 ioremap_nocache(AR7_REGS_CLOCKS,
332 sizeof(struct tnetd7200_clocks));
333 int cpu_base, cpu_mul, cpu_prediv, cpu_postdiv;
334 int dsp_base, dsp_mul, dsp_prediv, dsp_postdiv;
335 int usb_base, usb_mul, usb_prediv, usb_postdiv;
336
337 cpu_base = tnetd7200_get_clock_base(TNETD7200_CLOCK_ID_CPU, bootcr);
338 dsp_base = tnetd7200_get_clock_base(TNETD7200_CLOCK_ID_DSP, bootcr);
339
340 if (*bootcr & BOOT_PLL_ASYNC_MODE) {
341 printk(KERN_INFO "Clocks: Async mode\n");
342
343 printk(KERN_INFO "Clocks: Setting DSP clock\n");
344 calculate(dsp_base, TNETD7200_DEF_DSP_CLK,
345 &dsp_prediv, &dsp_postdiv, &dsp_mul);
346 ar7_bus_clock =
347 ((dsp_base / dsp_prediv) * dsp_mul) / dsp_postdiv;
348 tnetd7200_set_clock(dsp_base, &clocks->dsp,
349 dsp_prediv, dsp_postdiv * 2, dsp_postdiv, dsp_mul * 2,
350 ar7_bus_clock);
351
352 printk(KERN_INFO "Clocks: Setting CPU clock\n");
353 calculate(cpu_base, TNETD7200_DEF_CPU_CLK, &cpu_prediv,
354 &cpu_postdiv, &cpu_mul);
355 ar7_cpu_clock =
356 ((cpu_base / cpu_prediv) * cpu_mul) / cpu_postdiv;
357 tnetd7200_set_clock(cpu_base, &clocks->cpu,
358 cpu_prediv, cpu_postdiv, -1, cpu_mul,
359 ar7_cpu_clock);
360
361 } else
362 if (*bootcr & BOOT_PLL_2TO1_MODE) {
363 printk(KERN_INFO "Clocks: Sync 2:1 mode\n");
364
365 printk(KERN_INFO "Clocks: Setting CPU clock\n");
366 calculate(cpu_base, TNETD7200_DEF_CPU_CLK, &cpu_prediv,
367 &cpu_postdiv, &cpu_mul);
368 ar7_cpu_clock = ((cpu_base / cpu_prediv) * cpu_mul)
369 / cpu_postdiv;
370 tnetd7200_set_clock(cpu_base, &clocks->cpu,
371 cpu_prediv, cpu_postdiv, -1, cpu_mul,
372 ar7_cpu_clock);
373
374 printk(KERN_INFO "Clocks: Setting DSP clock\n");
375 calculate(dsp_base, TNETD7200_DEF_DSP_CLK, &dsp_prediv,
376 &dsp_postdiv, &dsp_mul);
377 ar7_bus_clock = ar7_cpu_clock / 2;
378 tnetd7200_set_clock(dsp_base, &clocks->dsp,
379 dsp_prediv, dsp_postdiv * 2, dsp_postdiv,
380 dsp_mul * 2, ar7_bus_clock);
381 } else {
382 printk(KERN_INFO "Clocks: Sync 1:1 mode\n");
383
384 printk(KERN_INFO "Clocks: Setting DSP clock\n");
385 calculate(dsp_base, TNETD7200_DEF_DSP_CLK, &dsp_prediv,
386 &dsp_postdiv, &dsp_mul);
387 ar7_bus_clock = ((dsp_base / dsp_prediv) * dsp_mul)
388 / dsp_postdiv;
389 tnetd7200_set_clock(dsp_base, &clocks->dsp,
390 dsp_prediv, dsp_postdiv * 2, dsp_postdiv,
391 dsp_mul * 2, ar7_bus_clock);
392
393 ar7_cpu_clock = ar7_bus_clock;
394 }
395
396 printk(KERN_INFO "Clocks: Setting USB clock\n");
397 usb_base = ar7_bus_clock;
398 calculate(usb_base, TNETD7200_DEF_USB_CLK, &usb_prediv,
399 &usb_postdiv, &usb_mul);
400 tnetd7200_set_clock(usb_base, &clocks->usb,
401 usb_prediv, usb_postdiv, -1, usb_mul,
402 TNETD7200_DEF_USB_CLK);
403
404 ar7_dsp_clock = ar7_cpu_clock;
405
406 iounmap(clocks);
407 iounmap(bootcr);
408}
409
410int __init ar7_init_clocks(void)
411{
412 switch (ar7_chip_id()) {
413 case AR7_CHIP_7100:
414 case AR7_CHIP_7200:
415 tnetd7200_init_clocks();
416 break;
417 case AR7_CHIP_7300:
418 ar7_dsp_clock = tnetd7300_dsp_clock();
419 tnetd7300_init_clocks();
420 break;
421 default:
422 break;
423 }
424
425 return 0;
426}
427arch_initcall(ar7_init_clocks);
diff --git a/arch/mips/ar7/gpio.c b/arch/mips/ar7/gpio.c
new file mode 100644
index 000000000000..74e14a3dbf4a
--- /dev/null
+++ b/arch/mips/ar7/gpio.c
@@ -0,0 +1,48 @@
1/*
2 * Copyright (C) 2007 Felix Fietkau <nbd@openwrt.org>
3 * Copyright (C) 2007 Eugene Konev <ejka@openwrt.org>
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18 */
19
20#include <linux/module.h>
21
22#include <asm/mach-ar7/gpio.h>
23
24static const char *ar7_gpio_list[AR7_GPIO_MAX];
25
26int gpio_request(unsigned gpio, const char *label)
27{
28 if (gpio >= AR7_GPIO_MAX)
29 return -EINVAL;
30
31 if (ar7_gpio_list[gpio])
32 return -EBUSY;
33
34 if (label)
35 ar7_gpio_list[gpio] = label;
36 else
37 ar7_gpio_list[gpio] = "busy";
38
39 return 0;
40}
41EXPORT_SYMBOL(gpio_request);
42
43void gpio_free(unsigned gpio)
44{
45 BUG_ON(!ar7_gpio_list[gpio]);
46 ar7_gpio_list[gpio] = NULL;
47}
48EXPORT_SYMBOL(gpio_free);
diff --git a/arch/mips/ar7/irq.c b/arch/mips/ar7/irq.c
new file mode 100644
index 000000000000..c781556c44e4
--- /dev/null
+++ b/arch/mips/ar7/irq.c
@@ -0,0 +1,176 @@
1/*
2 * Copyright (C) 2006,2007 Felix Fietkau <nbd@openwrt.org>
3 * Copyright (C) 2006,2007 Eugene Konev <ejka@openwrt.org>
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18 */
19
20#include <linux/interrupt.h>
21#include <linux/io.h>
22
23#include <asm/irq_cpu.h>
24#include <asm/mipsregs.h>
25#include <asm/mach-ar7/ar7.h>
26
27#define EXCEPT_OFFSET 0x80
28#define PACE_OFFSET 0xA0
29#define CHNLS_OFFSET 0x200
30
31#define REG_OFFSET(irq, reg) ((irq) / 32 * 0x4 + reg * 0x10)
32#define SEC_REG_OFFSET(reg) (EXCEPT_OFFSET + reg * 0x8)
33#define SEC_SR_OFFSET (SEC_REG_OFFSET(0)) /* 0x80 */
34#define CR_OFFSET(irq) (REG_OFFSET(irq, 1)) /* 0x10 */
35#define SEC_CR_OFFSET (SEC_REG_OFFSET(1)) /* 0x88 */
36#define ESR_OFFSET(irq) (REG_OFFSET(irq, 2)) /* 0x20 */
37#define SEC_ESR_OFFSET (SEC_REG_OFFSET(2)) /* 0x90 */
38#define ECR_OFFSET(irq) (REG_OFFSET(irq, 3)) /* 0x30 */
39#define SEC_ECR_OFFSET (SEC_REG_OFFSET(3)) /* 0x98 */
40#define PIR_OFFSET (0x40)
41#define MSR_OFFSET (0x44)
42#define PM_OFFSET(irq) (REG_OFFSET(irq, 5)) /* 0x50 */
43#define TM_OFFSET(irq) (REG_OFFSET(irq, 6)) /* 0x60 */
44
45#define REG(addr) ((u32 *)(KSEG1ADDR(AR7_REGS_IRQ) + addr))
46
47#define CHNL_OFFSET(chnl) (CHNLS_OFFSET + (chnl * 4))
48
49static int ar7_irq_base;
50
51static void ar7_unmask_irq(unsigned int irq)
52{
53 writel(1 << ((irq - ar7_irq_base) % 32),
54 REG(ESR_OFFSET(irq - ar7_irq_base)));
55}
56
57static void ar7_mask_irq(unsigned int irq)
58{
59 writel(1 << ((irq - ar7_irq_base) % 32),
60 REG(ECR_OFFSET(irq - ar7_irq_base)));
61}
62
63static void ar7_ack_irq(unsigned int irq)
64{
65 writel(1 << ((irq - ar7_irq_base) % 32),
66 REG(CR_OFFSET(irq - ar7_irq_base)));
67}
68
69static void ar7_unmask_sec_irq(unsigned int irq)
70{
71 writel(1 << (irq - ar7_irq_base - 40), REG(SEC_ESR_OFFSET));
72}
73
74static void ar7_mask_sec_irq(unsigned int irq)
75{
76 writel(1 << (irq - ar7_irq_base - 40), REG(SEC_ECR_OFFSET));
77}
78
79static void ar7_ack_sec_irq(unsigned int irq)
80{
81 writel(1 << (irq - ar7_irq_base - 40), REG(SEC_CR_OFFSET));
82}
83
84static struct irq_chip ar7_irq_type = {
85 .name = "AR7",
86 .unmask = ar7_unmask_irq,
87 .mask = ar7_mask_irq,
88 .ack = ar7_ack_irq
89};
90
91static struct irq_chip ar7_sec_irq_type = {
92 .name = "AR7",
93 .unmask = ar7_unmask_sec_irq,
94 .mask = ar7_mask_sec_irq,
95 .ack = ar7_ack_sec_irq,
96};
97
98static struct irqaction ar7_cascade_action = {
99 .handler = no_action,
100 .name = "AR7 cascade interrupt"
101};
102
103static void __init ar7_irq_init(int base)
104{
105 int i;
106 /*
107 * Disable interrupts and clear pending
108 */
109 writel(0xffffffff, REG(ECR_OFFSET(0)));
110 writel(0xff, REG(ECR_OFFSET(32)));
111 writel(0xffffffff, REG(SEC_ECR_OFFSET));
112 writel(0xffffffff, REG(CR_OFFSET(0)));
113 writel(0xff, REG(CR_OFFSET(32)));
114 writel(0xffffffff, REG(SEC_CR_OFFSET));
115
116 ar7_irq_base = base;
117
118 for (i = 0; i < 40; i++) {
119 writel(i, REG(CHNL_OFFSET(i)));
120 /* Primary IRQ's */
121 set_irq_chip_and_handler(base + i, &ar7_irq_type,
122 handle_level_irq);
123 /* Secondary IRQ's */
124 if (i < 32)
125 set_irq_chip_and_handler(base + i + 40,
126 &ar7_sec_irq_type,
127 handle_level_irq);
128 }
129
130 setup_irq(2, &ar7_cascade_action);
131 setup_irq(ar7_irq_base, &ar7_cascade_action);
132 set_c0_status(IE_IRQ0);
133}
134
135void __init arch_init_irq(void)
136{
137 mips_cpu_irq_init();
138 ar7_irq_init(8);
139}
140
141static void ar7_cascade(void)
142{
143 u32 status;
144 int i, irq;
145
146 /* Primary IRQ's */
147 irq = readl(REG(PIR_OFFSET)) & 0x3f;
148 if (irq) {
149 do_IRQ(ar7_irq_base + irq);
150 return;
151 }
152
153 /* Secondary IRQ's are cascaded through primary '0' */
154 writel(1, REG(CR_OFFSET(irq)));
155 status = readl(REG(SEC_SR_OFFSET));
156 for (i = 0; i < 32; i++) {
157 if (status & 1) {
158 do_IRQ(ar7_irq_base + i + 40);
159 return;
160 }
161 status >>= 1;
162 }
163
164 spurious_interrupt();
165}
166
167asmlinkage void plat_irq_dispatch(void)
168{
169 unsigned int pending = read_c0_status() & read_c0_cause() & ST0_IM;
170 if (pending & STATUSF_IP7) /* cpu timer */
171 do_IRQ(7);
172 else if (pending & STATUSF_IP2) /* int0 hardware line */
173 ar7_cascade();
174 else
175 spurious_interrupt();
176}
diff --git a/arch/mips/ar7/memory.c b/arch/mips/ar7/memory.c
new file mode 100644
index 000000000000..696c723dc6d4
--- /dev/null
+++ b/arch/mips/ar7/memory.c
@@ -0,0 +1,72 @@
1/*
2 * Copyright (C) 2007 Felix Fietkau <nbd@openwrt.org>
3 * Copyright (C) 2007 Eugene Konev <ejka@openwrt.org>
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18 */
19#include <linux/bootmem.h>
20#include <linux/init.h>
21#include <linux/mm.h>
22#include <linux/module.h>
23#include <linux/pfn.h>
24#include <linux/proc_fs.h>
25#include <linux/string.h>
26#include <linux/swap.h>
27
28#include <asm/bootinfo.h>
29#include <asm/page.h>
30#include <asm/sections.h>
31
32#include <asm/mach-ar7/ar7.h>
33#include <asm/mips-boards/prom.h>
34
35static int __init memsize(void)
36{
37 u32 size = (64 << 20);
38 u32 *addr = (u32 *)KSEG1ADDR(AR7_SDRAM_BASE + size - 4);
39 u32 *kernel_end = (u32 *)KSEG1ADDR(CPHYSADDR((u32)&_end));
40 u32 *tmpaddr = addr;
41
42 while (tmpaddr > kernel_end) {
43 *tmpaddr = (u32)tmpaddr;
44 size >>= 1;
45 tmpaddr -= size >> 2;
46 }
47
48 do {
49 tmpaddr += size >> 2;
50 if (*tmpaddr != (u32)tmpaddr)
51 break;
52 size <<= 1;
53 } while (size < (64 << 20));
54
55 writel((u32)tmpaddr, &addr);
56
57 return size;
58}
59
60void __init prom_meminit(void)
61{
62 unsigned long pages;
63
64 pages = memsize() >> PAGE_SHIFT;
65 add_memory_region(PHYS_OFFSET, pages << PAGE_SHIFT,
66 BOOT_MEM_RAM);
67}
68
69void __init prom_free_prom_memory(void)
70{
71 /* Nothing to free */
72}
diff --git a/arch/mips/ar7/platform.c b/arch/mips/ar7/platform.c
new file mode 100644
index 000000000000..2ecab6155932
--- /dev/null
+++ b/arch/mips/ar7/platform.c
@@ -0,0 +1,555 @@
1/*
2 * Copyright (C) 2006,2007 Felix Fietkau <nbd@openwrt.org>
3 * Copyright (C) 2006,2007 Eugene Konev <ejka@openwrt.org>
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18 */
19
20#include <linux/init.h>
21#include <linux/types.h>
22#include <linux/module.h>
23#include <linux/delay.h>
24#include <linux/dma-mapping.h>
25#include <linux/platform_device.h>
26#include <linux/mtd/physmap.h>
27#include <linux/serial.h>
28#include <linux/serial_8250.h>
29#include <linux/ioport.h>
30#include <linux/io.h>
31#include <linux/vlynq.h>
32#include <linux/leds.h>
33#include <linux/string.h>
34#include <linux/etherdevice.h>
35
36#include <asm/addrspace.h>
37#include <asm/mach-ar7/ar7.h>
38#include <asm/mach-ar7/gpio.h>
39#include <asm/mach-ar7/prom.h>
40
41struct plat_vlynq_data {
42 struct plat_vlynq_ops ops;
43 int gpio_bit;
44 int reset_bit;
45};
46
47
48static int vlynq_on(struct vlynq_device *dev)
49{
50 int result;
51 struct plat_vlynq_data *pdata = dev->dev.platform_data;
52
53 result = gpio_request(pdata->gpio_bit, "vlynq");
54 if (result)
55 goto out;
56
57 ar7_device_reset(pdata->reset_bit);
58
59 result = ar7_gpio_disable(pdata->gpio_bit);
60 if (result)
61 goto out_enabled;
62
63 result = ar7_gpio_enable(pdata->gpio_bit);
64 if (result)
65 goto out_enabled;
66
67 result = gpio_direction_output(pdata->gpio_bit, 0);
68 if (result)
69 goto out_gpio_enabled;
70
71 msleep(50);
72
73 gpio_set_value(pdata->gpio_bit, 1);
74 msleep(50);
75
76 return 0;
77
78out_gpio_enabled:
79 ar7_gpio_disable(pdata->gpio_bit);
80out_enabled:
81 ar7_device_disable(pdata->reset_bit);
82 gpio_free(pdata->gpio_bit);
83out:
84 return result;
85}
86
87static void vlynq_off(struct vlynq_device *dev)
88{
89 struct plat_vlynq_data *pdata = dev->dev.platform_data;
90 ar7_gpio_disable(pdata->gpio_bit);
91 gpio_free(pdata->gpio_bit);
92 ar7_device_disable(pdata->reset_bit);
93}
94
95static struct resource physmap_flash_resource = {
96 .name = "mem",
97 .flags = IORESOURCE_MEM,
98 .start = 0x10000000,
99 .end = 0x107fffff,
100};
101
102static struct resource cpmac_low_res[] = {
103 {
104 .name = "regs",
105 .flags = IORESOURCE_MEM,
106 .start = AR7_REGS_MAC0,
107 .end = AR7_REGS_MAC0 + 0x7ff,
108 },
109 {
110 .name = "irq",
111 .flags = IORESOURCE_IRQ,
112 .start = 27,
113 .end = 27,
114 },
115};
116
117static struct resource cpmac_high_res[] = {
118 {
119 .name = "regs",
120 .flags = IORESOURCE_MEM,
121 .start = AR7_REGS_MAC1,
122 .end = AR7_REGS_MAC1 + 0x7ff,
123 },
124 {
125 .name = "irq",
126 .flags = IORESOURCE_IRQ,
127 .start = 41,
128 .end = 41,
129 },
130};
131
132static struct resource vlynq_low_res[] = {
133 {
134 .name = "regs",
135 .flags = IORESOURCE_MEM,
136 .start = AR7_REGS_VLYNQ0,
137 .end = AR7_REGS_VLYNQ0 + 0xff,
138 },
139 {
140 .name = "irq",
141 .flags = IORESOURCE_IRQ,
142 .start = 29,
143 .end = 29,
144 },
145 {
146 .name = "mem",
147 .flags = IORESOURCE_MEM,
148 .start = 0x04000000,
149 .end = 0x04ffffff,
150 },
151 {
152 .name = "devirq",
153 .flags = IORESOURCE_IRQ,
154 .start = 80,
155 .end = 111,
156 },
157};
158
159static struct resource vlynq_high_res[] = {
160 {
161 .name = "regs",
162 .flags = IORESOURCE_MEM,
163 .start = AR7_REGS_VLYNQ1,
164 .end = AR7_REGS_VLYNQ1 + 0xff,
165 },
166 {
167 .name = "irq",
168 .flags = IORESOURCE_IRQ,
169 .start = 33,
170 .end = 33,
171 },
172 {
173 .name = "mem",
174 .flags = IORESOURCE_MEM,
175 .start = 0x0c000000,
176 .end = 0x0cffffff,
177 },
178 {
179 .name = "devirq",
180 .flags = IORESOURCE_IRQ,
181 .start = 112,
182 .end = 143,
183 },
184};
185
186static struct resource usb_res[] = {
187 {
188 .name = "regs",
189 .flags = IORESOURCE_MEM,
190 .start = AR7_REGS_USB,
191 .end = AR7_REGS_USB + 0xff,
192 },
193 {
194 .name = "irq",
195 .flags = IORESOURCE_IRQ,
196 .start = 32,
197 .end = 32,
198 },
199 {
200 .name = "mem",
201 .flags = IORESOURCE_MEM,
202 .start = 0x03400000,
203 .end = 0x034001fff,
204 },
205};
206
207static struct physmap_flash_data physmap_flash_data = {
208 .width = 2,
209};
210
211static struct plat_cpmac_data cpmac_low_data = {
212 .reset_bit = 17,
213 .power_bit = 20,
214 .phy_mask = 0x80000000,
215};
216
217static struct plat_cpmac_data cpmac_high_data = {
218 .reset_bit = 21,
219 .power_bit = 22,
220 .phy_mask = 0x7fffffff,
221};
222
223static struct plat_vlynq_data vlynq_low_data = {
224 .ops.on = vlynq_on,
225 .ops.off = vlynq_off,
226 .reset_bit = 20,
227 .gpio_bit = 18,
228};
229
230static struct plat_vlynq_data vlynq_high_data = {
231 .ops.on = vlynq_on,
232 .ops.off = vlynq_off,
233 .reset_bit = 16,
234 .gpio_bit = 19,
235};
236
237static struct platform_device physmap_flash = {
238 .id = 0,
239 .name = "physmap-flash",
240 .dev.platform_data = &physmap_flash_data,
241 .resource = &physmap_flash_resource,
242 .num_resources = 1,
243};
244
245static u64 cpmac_dma_mask = DMA_BIT_MASK(32);
246static struct platform_device cpmac_low = {
247 .id = 0,
248 .name = "cpmac",
249 .dev = {
250 .dma_mask = &cpmac_dma_mask,
251 .coherent_dma_mask = DMA_BIT_MASK(32),
252 .platform_data = &cpmac_low_data,
253 },
254 .resource = cpmac_low_res,
255 .num_resources = ARRAY_SIZE(cpmac_low_res),
256};
257
258static struct platform_device cpmac_high = {
259 .id = 1,
260 .name = "cpmac",
261 .dev = {
262 .dma_mask = &cpmac_dma_mask,
263 .coherent_dma_mask = DMA_BIT_MASK(32),
264 .platform_data = &cpmac_high_data,
265 },
266 .resource = cpmac_high_res,
267 .num_resources = ARRAY_SIZE(cpmac_high_res),
268};
269
270static struct platform_device vlynq_low = {
271 .id = 0,
272 .name = "vlynq",
273 .dev.platform_data = &vlynq_low_data,
274 .resource = vlynq_low_res,
275 .num_resources = ARRAY_SIZE(vlynq_low_res),
276};
277
278static struct platform_device vlynq_high = {
279 .id = 1,
280 .name = "vlynq",
281 .dev.platform_data = &vlynq_high_data,
282 .resource = vlynq_high_res,
283 .num_resources = ARRAY_SIZE(vlynq_high_res),
284};
285
286
287static struct gpio_led default_leds[] = {
288 {
289 .name = "status",
290 .gpio = 8,
291 .active_low = 1,
292 },
293};
294
295static struct gpio_led dsl502t_leds[] = {
296 {
297 .name = "status",
298 .gpio = 9,
299 .active_low = 1,
300 },
301 {
302 .name = "ethernet",
303 .gpio = 7,
304 .active_low = 1,
305 },
306 {
307 .name = "usb",
308 .gpio = 12,
309 .active_low = 1,
310 },
311};
312
313static struct gpio_led dg834g_leds[] = {
314 {
315 .name = "ppp",
316 .gpio = 6,
317 .active_low = 1,
318 },
319 {
320 .name = "status",
321 .gpio = 7,
322 .active_low = 1,
323 },
324 {
325 .name = "adsl",
326 .gpio = 8,
327 .active_low = 1,
328 },
329 {
330 .name = "wifi",
331 .gpio = 12,
332 .active_low = 1,
333 },
334 {
335 .name = "power",
336 .gpio = 14,
337 .active_low = 1,
338 .default_trigger = "default-on",
339 },
340};
341
342static struct gpio_led fb_sl_leds[] = {
343 {
344 .name = "1",
345 .gpio = 7,
346 },
347 {
348 .name = "2",
349 .gpio = 13,
350 .active_low = 1,
351 },
352 {
353 .name = "3",
354 .gpio = 10,
355 .active_low = 1,
356 },
357 {
358 .name = "4",
359 .gpio = 12,
360 .active_low = 1,
361 },
362 {
363 .name = "5",
364 .gpio = 9,
365 .active_low = 1,
366 },
367};
368
369static struct gpio_led fb_fon_leds[] = {
370 {
371 .name = "1",
372 .gpio = 8,
373 },
374 {
375 .name = "2",
376 .gpio = 3,
377 .active_low = 1,
378 },
379 {
380 .name = "3",
381 .gpio = 5,
382 },
383 {
384 .name = "4",
385 .gpio = 4,
386 .active_low = 1,
387 },
388 {
389 .name = "5",
390 .gpio = 11,
391 .active_low = 1,
392 },
393};
394
395static struct gpio_led_platform_data ar7_led_data;
396
397static struct platform_device ar7_gpio_leds = {
398 .name = "leds-gpio",
399 .id = -1,
400 .dev = {
401 .platform_data = &ar7_led_data,
402 }
403};
404
405static struct platform_device ar7_udc = {
406 .id = -1,
407 .name = "ar7_udc",
408 .resource = usb_res,
409 .num_resources = ARRAY_SIZE(usb_res),
410};
411
412static inline unsigned char char2hex(char h)
413{
414 switch (h) {
415 case '0': case '1': case '2': case '3': case '4':
416 case '5': case '6': case '7': case '8': case '9':
417 return h - '0';
418 case 'A': case 'B': case 'C': case 'D': case 'E': case 'F':
419 return h - 'A' + 10;
420 case 'a': case 'b': case 'c': case 'd': case 'e': case 'f':
421 return h - 'a' + 10;
422 default:
423 return 0;
424 }
425}
426
427static void cpmac_get_mac(int instance, unsigned char *dev_addr)
428{
429 int i;
430 char name[5], default_mac[ETH_ALEN], *mac;
431
432 mac = NULL;
433 sprintf(name, "mac%c", 'a' + instance);
434 mac = prom_getenv(name);
435 if (!mac) {
436 sprintf(name, "mac%c", 'a');
437 mac = prom_getenv(name);
438 }
439 if (!mac) {
440 random_ether_addr(default_mac);
441 mac = default_mac;
442 }
443 for (i = 0; i < 6; i++)
444 dev_addr[i] = (char2hex(mac[i * 3]) << 4) +
445 char2hex(mac[i * 3 + 1]);
446}
447
448static void __init detect_leds(void)
449{
450 char *prid, *usb_prod;
451
452 /* Default LEDs */
453 ar7_led_data.num_leds = ARRAY_SIZE(default_leds);
454 ar7_led_data.leds = default_leds;
455
456 /* FIXME: the whole thing is unreliable */
457 prid = prom_getenv("ProductID");
458 usb_prod = prom_getenv("usb_prod");
459
460 /* If we can't get the product id from PROM, use the default LEDs */
461 if (!prid)
462 return;
463
464 if (strstr(prid, "Fritz_Box_FON")) {
465 ar7_led_data.num_leds = ARRAY_SIZE(fb_fon_leds);
466 ar7_led_data.leds = fb_fon_leds;
467 } else if (strstr(prid, "Fritz_Box_")) {
468 ar7_led_data.num_leds = ARRAY_SIZE(fb_sl_leds);
469 ar7_led_data.leds = fb_sl_leds;
470 } else if ((!strcmp(prid, "AR7RD") || !strcmp(prid, "AR7DB"))
471 && usb_prod != NULL && strstr(usb_prod, "DSL-502T")) {
472 ar7_led_data.num_leds = ARRAY_SIZE(dsl502t_leds);
473 ar7_led_data.leds = dsl502t_leds;
474 } else if (strstr(prid, "DG834")) {
475 ar7_led_data.num_leds = ARRAY_SIZE(dg834g_leds);
476 ar7_led_data.leds = dg834g_leds;
477 }
478}
479
480static int __init ar7_register_devices(void)
481{
482 int res;
483#ifdef CONFIG_SERIAL_8250
484 static struct uart_port uart_port[2];
485
486 memset(uart_port, 0, sizeof(struct uart_port) * 2);
487
488 uart_port[0].type = PORT_16550A;
489 uart_port[0].line = 0;
490 uart_port[0].irq = AR7_IRQ_UART0;
491 uart_port[0].uartclk = ar7_bus_freq() / 2;
492 uart_port[0].iotype = UPIO_MEM32;
493 uart_port[0].mapbase = AR7_REGS_UART0;
494 uart_port[0].membase = ioremap(uart_port[0].mapbase, 256);
495 uart_port[0].regshift = 2;
496 res = early_serial_setup(&uart_port[0]);
497 if (res)
498 return res;
499
500
501 /* Only TNETD73xx have a second serial port */
502 if (ar7_has_second_uart()) {
503 uart_port[1].type = PORT_16550A;
504 uart_port[1].line = 1;
505 uart_port[1].irq = AR7_IRQ_UART1;
506 uart_port[1].uartclk = ar7_bus_freq() / 2;
507 uart_port[1].iotype = UPIO_MEM32;
508 uart_port[1].mapbase = UR8_REGS_UART1;
509 uart_port[1].membase = ioremap(uart_port[1].mapbase, 256);
510 uart_port[1].regshift = 2;
511 res = early_serial_setup(&uart_port[1]);
512 if (res)
513 return res;
514 }
515#endif /* CONFIG_SERIAL_8250 */
516 res = platform_device_register(&physmap_flash);
517 if (res)
518 return res;
519
520 ar7_device_disable(vlynq_low_data.reset_bit);
521 res = platform_device_register(&vlynq_low);
522 if (res)
523 return res;
524
525 if (ar7_has_high_vlynq()) {
526 ar7_device_disable(vlynq_high_data.reset_bit);
527 res = platform_device_register(&vlynq_high);
528 if (res)
529 return res;
530 }
531
532 if (ar7_has_high_cpmac()) {
533 cpmac_get_mac(1, cpmac_high_data.dev_addr);
534 res = platform_device_register(&cpmac_high);
535 if (res)
536 return res;
537 } else {
538 cpmac_low_data.phy_mask = 0xffffffff;
539 }
540
541 cpmac_get_mac(0, cpmac_low_data.dev_addr);
542 res = platform_device_register(&cpmac_low);
543 if (res)
544 return res;
545
546 detect_leds();
547 res = platform_device_register(&ar7_gpio_leds);
548 if (res)
549 return res;
550
551 res = platform_device_register(&ar7_udc);
552
553 return res;
554}
555arch_initcall(ar7_register_devices);
diff --git a/arch/mips/ar7/prom.c b/arch/mips/ar7/prom.c
new file mode 100644
index 000000000000..5ad6f1db6567
--- /dev/null
+++ b/arch/mips/ar7/prom.c
@@ -0,0 +1,297 @@
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 * Putting things on the screen/serial line using YAMONs facilities.
19 */
20#include <linux/init.h>
21#include <linux/kernel.h>
22#include <linux/serial_reg.h>
23#include <linux/spinlock.h>
24#include <linux/module.h>
25#include <linux/string.h>
26#include <linux/io.h>
27#include <asm/bootinfo.h>
28
29#include <asm/mach-ar7/ar7.h>
30#include <asm/mach-ar7/prom.h>
31
32#define MAX_ENTRY 80
33
34struct env_var {
35 char *name;
36 char *value;
37};
38
39static struct env_var adam2_env[MAX_ENTRY];
40
41char *prom_getenv(const char *name)
42{
43 int i;
44 for (i = 0; (i < MAX_ENTRY) && adam2_env[i].name; i++)
45 if (!strcmp(name, adam2_env[i].name))
46 return adam2_env[i].value;
47
48 return NULL;
49}
50EXPORT_SYMBOL(prom_getenv);
51
52char * __init prom_getcmdline(void)
53{
54 return &(arcs_cmdline[0]);
55}
56
57static void __init ar7_init_cmdline(int argc, char *argv[])
58{
59 char *cp;
60 int actr;
61
62 actr = 1; /* Always ignore argv[0] */
63
64 cp = &(arcs_cmdline[0]);
65 while (actr < argc) {
66 strcpy(cp, argv[actr]);
67 cp += strlen(argv[actr]);
68 *cp++ = ' ';
69 actr++;
70 }
71 if (cp != &(arcs_cmdline[0])) {
72 /* get rid of trailing space */
73 --cp;
74 *cp = '\0';
75 }
76}
77
78struct psbl_rec {
79 u32 psbl_size;
80 u32 env_base;
81 u32 env_size;
82 u32 ffs_base;
83 u32 ffs_size;
84};
85
86static __initdata char psp_env_version[] = "TIENV0.8";
87
88struct psp_env_chunk {
89 u8 num;
90 u8 ctrl;
91 u16 csum;
92 u8 len;
93 char data[11];
94} __attribute__ ((packed));
95
96struct psp_var_map_entry {
97 u8 num;
98 char *value;
99};
100
101static struct psp_var_map_entry psp_var_map[] = {
102 { 1, "cpufrequency" },
103 { 2, "memsize" },
104 { 3, "flashsize" },
105 { 4, "modetty0" },
106 { 5, "modetty1" },
107 { 8, "maca" },
108 { 9, "macb" },
109 { 28, "sysfrequency" },
110 { 38, "mipsfrequency" },
111};
112
113/*
114
115Well-known variable (num is looked up in table above for matching variable name)
116Example: cpufrequency=211968000
117+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+---
118| 01 |CTRL|CHECKSUM | 01 | _2 | _1 | _1 | _9 | _6 | _8 | _0 | _0 | _0 | \0 | FF
119+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+---
120
121Name=Value pair in a single chunk
122Example: NAME=VALUE
123+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+---
124| 00 |CTRL|CHECKSUM | 01 | _N | _A | _M | _E | _0 | _V | _A | _L | _U | _E | \0
125+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+---
126
127Name=Value pair in 2 chunks (len is the number of chunks)
128Example: bootloaderVersion=1.3.7.15
129+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+---
130| 00 |CTRL|CHECKSUM | 02 | _b | _o | _o | _t | _l | _o | _a | _d | _e | _r | _V
131+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+---
132| _e | _r | _s | _i | _o | _n | \0 | _1 | _. | _3 | _. | _7 | _. | _1 | _5 | \0
133+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+---
134
135Data is padded with 0xFF
136
137*/
138
139#define PSP_ENV_SIZE 4096
140
141static char psp_env_data[PSP_ENV_SIZE] = { 0, };
142
143static char * __init lookup_psp_var_map(u8 num)
144{
145 int i;
146
147 for (i = 0; i < ARRAY_SIZE(psp_var_map); i++)
148 if (psp_var_map[i].num == num)
149 return psp_var_map[i].value;
150
151 return NULL;
152}
153
154static void __init add_adam2_var(char *name, char *value)
155{
156 int i;
157 for (i = 0; i < MAX_ENTRY; i++) {
158 if (!adam2_env[i].name) {
159 adam2_env[i].name = name;
160 adam2_env[i].value = value;
161 return;
162 } else if (!strcmp(adam2_env[i].name, name)) {
163 adam2_env[i].value = value;
164 return;
165 }
166 }
167}
168
169static int __init parse_psp_env(void *psp_env_base)
170{
171 int i, n;
172 char *name, *value;
173 struct psp_env_chunk *chunks = (struct psp_env_chunk *)psp_env_data;
174
175 memcpy_fromio(chunks, psp_env_base, PSP_ENV_SIZE);
176
177 i = 1;
178 n = PSP_ENV_SIZE / sizeof(struct psp_env_chunk);
179 while (i < n) {
180 if ((chunks[i].num == 0xff) || ((i + chunks[i].len) > n))
181 break;
182 value = chunks[i].data;
183 if (chunks[i].num) {
184 name = lookup_psp_var_map(chunks[i].num);
185 } else {
186 name = value;
187 value += strlen(name) + 1;
188 }
189 if (name)
190 add_adam2_var(name, value);
191 i += chunks[i].len;
192 }
193 return 0;
194}
195
196static void __init ar7_init_env(struct env_var *env)
197{
198 int i;
199 struct psbl_rec *psbl = (struct psbl_rec *)(KSEG1ADDR(0x14000300));
200 void *psp_env = (void *)KSEG1ADDR(psbl->env_base);
201
202 if (strcmp(psp_env, psp_env_version) == 0) {
203 parse_psp_env(psp_env);
204 } else {
205 for (i = 0; i < MAX_ENTRY; i++, env++)
206 if (env->name)
207 add_adam2_var(env->name, env->value);
208 }
209}
210
211static void __init console_config(void)
212{
213#ifdef CONFIG_SERIAL_8250_CONSOLE
214 char console_string[40];
215 int baud = 0;
216 char parity = '\0', bits = '\0', flow = '\0';
217 char *s, *p;
218
219 if (strstr(prom_getcmdline(), "console="))
220 return;
221
222#ifdef CONFIG_KGDB
223 if (!strstr(prom_getcmdline(), "nokgdb")) {
224 strcat(prom_getcmdline(), " console=kgdb");
225 kgdb_enabled = 1;
226 return;
227 }
228#endif
229
230 s = prom_getenv("modetty0");
231 if (s) {
232 baud = simple_strtoul(s, &p, 10);
233 s = p;
234 if (*s == ',')
235 s++;
236 if (*s)
237 parity = *s++;
238 if (*s == ',')
239 s++;
240 if (*s)
241 bits = *s++;
242 if (*s == ',')
243 s++;
244 if (*s == 'h')
245 flow = 'r';
246 }
247
248 if (baud == 0)
249 baud = 38400;
250 if (parity != 'n' && parity != 'o' && parity != 'e')
251 parity = 'n';
252 if (bits != '7' && bits != '8')
253 bits = '8';
254
255 if (flow == 'r')
256 sprintf(console_string, " console=ttyS0,%d%c%c%c", baud,
257 parity, bits, flow);
258 else
259 sprintf(console_string, " console=ttyS0,%d%c%c", baud, parity,
260 bits);
261 strcat(prom_getcmdline(), console_string);
262#endif
263}
264
265void __init prom_init(void)
266{
267 ar7_init_cmdline(fw_arg0, (char **)fw_arg1);
268 ar7_init_env((struct env_var *)fw_arg2);
269 console_config();
270}
271
272#define PORT(offset) (KSEG1ADDR(AR7_REGS_UART0 + (offset * 4)))
273static inline unsigned int serial_in(int offset)
274{
275 return readl((void *)PORT(offset));
276}
277
278static inline void serial_out(int offset, int value)
279{
280 writel(value, (void *)PORT(offset));
281}
282
283char prom_getchar(void)
284{
285 while (!(serial_in(UART_LSR) & UART_LSR_DR))
286 ;
287 return serial_in(UART_RX);
288}
289
290int prom_putchar(char c)
291{
292 while ((serial_in(UART_LSR) & UART_LSR_TEMT) == 0)
293 ;
294 serial_out(UART_TX, c);
295 return 1;
296}
297
diff --git a/arch/mips/ar7/setup.c b/arch/mips/ar7/setup.c
new file mode 100644
index 000000000000..39f6b5b96463
--- /dev/null
+++ b/arch/mips/ar7/setup.c
@@ -0,0 +1,93 @@
1/*
2 * Carsten Langgaard, carstenl@mips.com
3 * Copyright (C) 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#include <linux/init.h>
19#include <linux/ioport.h>
20#include <linux/pm.h>
21#include <linux/time.h>
22
23#include <asm/reboot.h>
24#include <asm/mach-ar7/ar7.h>
25#include <asm/mach-ar7/prom.h>
26
27static void ar7_machine_restart(char *command)
28{
29 u32 *softres_reg = ioremap(AR7_REGS_RESET +
30 AR7_RESET_SOFTWARE, 1);
31 writel(1, softres_reg);
32}
33
34static void ar7_machine_halt(void)
35{
36 while (1)
37 ;
38}
39
40static void ar7_machine_power_off(void)
41{
42 u32 *power_reg = (u32 *)ioremap(AR7_REGS_POWER, 1);
43 u32 power_state = readl(power_reg) | (3 << 30);
44 writel(power_state, power_reg);
45 ar7_machine_halt();
46}
47
48const char *get_system_type(void)
49{
50 u16 chip_id = ar7_chip_id();
51 switch (chip_id) {
52 case AR7_CHIP_7300:
53 return "TI AR7 (TNETD7300)";
54 case AR7_CHIP_7100:
55 return "TI AR7 (TNETD7100)";
56 case AR7_CHIP_7200:
57 return "TI AR7 (TNETD7200)";
58 default:
59 return "TI AR7 (Unknown)";
60 }
61}
62
63static int __init ar7_init_console(void)
64{
65 return 0;
66}
67console_initcall(ar7_init_console);
68
69/*
70 * Initializes basic routines and structures pointers, memory size (as
71 * given by the bios and saves the command line.
72 */
73
74void __init plat_mem_setup(void)
75{
76 unsigned long io_base;
77
78 _machine_restart = ar7_machine_restart;
79 _machine_halt = ar7_machine_halt;
80 pm_power_off = ar7_machine_power_off;
81 panic_timeout = 3;
82
83 io_base = (unsigned long)ioremap(AR7_REGS_BASE, 0x10000);
84 if (!io_base)
85 panic("Can't remap IO base!\n");
86 set_io_port_base(io_base);
87
88 prom_meminit();
89
90 printk(KERN_INFO "%s, ID: 0x%04x, Revision: 0x%02x\n",
91 get_system_type(),
92 ar7_chip_id(), ar7_chip_rev());
93}
diff --git a/arch/mips/ar7/time.c b/arch/mips/ar7/time.c
new file mode 100644
index 000000000000..a1fba894daa2
--- /dev/null
+++ b/arch/mips/ar7/time.c
@@ -0,0 +1,30 @@
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 * Setting up the clock on the MIPS boards.
19 */
20
21#include <linux/init.h>
22#include <linux/time.h>
23
24#include <asm/time.h>
25#include <asm/mach-ar7/ar7.h>
26
27void __init plat_time_init(void)
28{
29 mips_hpt_frequency = ar7_cpu_freq() / 2;
30}
diff --git a/arch/mips/cavium-octeon/Makefile b/arch/mips/cavium-octeon/Makefile
index 7c0528b0e34c..d6903c3f3d51 100644
--- a/arch/mips/cavium-octeon/Makefile
+++ b/arch/mips/cavium-octeon/Makefile
@@ -14,9 +14,5 @@ obj-y += dma-octeon.o flash_setup.o
14obj-y += octeon-memcpy.o 14obj-y += octeon-memcpy.o
15 15
16obj-$(CONFIG_SMP) += smp.o 16obj-$(CONFIG_SMP) += smp.o
17obj-$(CONFIG_PCI) += pci-common.o
18obj-$(CONFIG_PCI) += pci.o
19obj-$(CONFIG_PCI) += pcie.o
20obj-$(CONFIG_PCI_MSI) += msi.o
21 17
22EXTRA_CFLAGS += -Werror 18EXTRA_CFLAGS += -Werror
diff --git a/arch/mips/cavium-octeon/dma-octeon.c b/arch/mips/cavium-octeon/dma-octeon.c
index 627c162a6159..4b92bfc662db 100644
--- a/arch/mips/cavium-octeon/dma-octeon.c
+++ b/arch/mips/cavium-octeon/dma-octeon.c
@@ -29,7 +29,7 @@
29#include <dma-coherence.h> 29#include <dma-coherence.h>
30 30
31#ifdef CONFIG_PCI 31#ifdef CONFIG_PCI
32#include "pci-common.h" 32#include <asm/octeon/pci-octeon.h>
33#endif 33#endif
34 34
35#define BAR2_PCI_ADDRESS 0x8000000000ul 35#define BAR2_PCI_ADDRESS 0x8000000000ul
diff --git a/arch/mips/cavium-octeon/pci-common.c b/arch/mips/cavium-octeon/pci-common.c
deleted file mode 100644
index cd029f88da7f..000000000000
--- a/arch/mips/cavium-octeon/pci-common.c
+++ /dev/null
@@ -1,137 +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) 2005-2007 Cavium Networks
7 */
8#include <linux/kernel.h>
9#include <linux/init.h>
10#include <linux/pci.h>
11#include <linux/interrupt.h>
12#include <linux/time.h>
13#include <linux/delay.h>
14#include "pci-common.h"
15
16typeof(pcibios_map_irq) *octeon_pcibios_map_irq;
17enum octeon_dma_bar_type octeon_dma_bar_type = OCTEON_DMA_BAR_TYPE_INVALID;
18
19/**
20 * Map a PCI device to the appropriate interrupt line
21 *
22 * @param dev The Linux PCI device structure for the device to map
23 * @param slot The slot number for this device on __BUS 0__. Linux
24 * enumerates through all the bridges and figures out the
25 * slot on Bus 0 where this device eventually hooks to.
26 * @param pin The PCI interrupt pin read from the device, then swizzled
27 * as it goes through each bridge.
28 * @return Interrupt number for the device
29 */
30int __init pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
31{
32 if (octeon_pcibios_map_irq)
33 return octeon_pcibios_map_irq(dev, slot, pin);
34 else
35 panic("octeon_pcibios_map_irq doesn't point to a "
36 "pcibios_map_irq() function");
37}
38
39
40/**
41 * Called to perform platform specific PCI setup
42 *
43 * @param dev
44 * @return
45 */
46int pcibios_plat_dev_init(struct pci_dev *dev)
47{
48 uint16_t config;
49 uint32_t dconfig;
50 int pos;
51 /*
52 * Force the Cache line setting to 64 bytes. The standard
53 * Linux bus scan doesn't seem to set it. Octeon really has
54 * 128 byte lines, but Intel bridges get really upset if you
55 * try and set values above 64 bytes. Value is specified in
56 * 32bit words.
57 */
58 pci_write_config_byte(dev, PCI_CACHE_LINE_SIZE, 64 / 4);
59 /* Set latency timers for all devices */
60 pci_write_config_byte(dev, PCI_LATENCY_TIMER, 48);
61
62 /* Enable reporting System errors and parity errors on all devices */
63 /* Enable parity checking and error reporting */
64 pci_read_config_word(dev, PCI_COMMAND, &config);
65 config |= PCI_COMMAND_PARITY | PCI_COMMAND_SERR;
66 pci_write_config_word(dev, PCI_COMMAND, config);
67
68 if (dev->subordinate) {
69 /* Set latency timers on sub bridges */
70 pci_write_config_byte(dev, PCI_SEC_LATENCY_TIMER, 48);
71 /* More bridge error detection */
72 pci_read_config_word(dev, PCI_BRIDGE_CONTROL, &config);
73 config |= PCI_BRIDGE_CTL_PARITY | PCI_BRIDGE_CTL_SERR;
74 pci_write_config_word(dev, PCI_BRIDGE_CONTROL, config);
75 }
76
77 /* Enable the PCIe normal error reporting */
78 pos = pci_find_capability(dev, PCI_CAP_ID_EXP);
79 if (pos) {
80 /* Update Device Control */
81 pci_read_config_word(dev, pos + PCI_EXP_DEVCTL, &config);
82 /* Correctable Error Reporting */
83 config |= PCI_EXP_DEVCTL_CERE;
84 /* Non-Fatal Error Reporting */
85 config |= PCI_EXP_DEVCTL_NFERE;
86 /* Fatal Error Reporting */
87 config |= PCI_EXP_DEVCTL_FERE;
88 /* Unsupported Request */
89 config |= PCI_EXP_DEVCTL_URRE;
90 pci_write_config_word(dev, pos + PCI_EXP_DEVCTL, config);
91 }
92
93 /* Find the Advanced Error Reporting capability */
94 pos = pci_find_ext_capability(dev, PCI_EXT_CAP_ID_ERR);
95 if (pos) {
96 /* Clear Uncorrectable Error Status */
97 pci_read_config_dword(dev, pos + PCI_ERR_UNCOR_STATUS,
98 &dconfig);
99 pci_write_config_dword(dev, pos + PCI_ERR_UNCOR_STATUS,
100 dconfig);
101 /* Enable reporting of all uncorrectable errors */
102 /* Uncorrectable Error Mask - turned on bits disable errors */
103 pci_write_config_dword(dev, pos + PCI_ERR_UNCOR_MASK, 0);
104 /*
105 * Leave severity at HW default. This only controls if
106 * errors are reported as uncorrectable or
107 * correctable, not if the error is reported.
108 */
109 /* PCI_ERR_UNCOR_SEVER - Uncorrectable Error Severity */
110 /* Clear Correctable Error Status */
111 pci_read_config_dword(dev, pos + PCI_ERR_COR_STATUS, &dconfig);
112 pci_write_config_dword(dev, pos + PCI_ERR_COR_STATUS, dconfig);
113 /* Enable reporting of all correctable errors */
114 /* Correctable Error Mask - turned on bits disable errors */
115 pci_write_config_dword(dev, pos + PCI_ERR_COR_MASK, 0);
116 /* Advanced Error Capabilities */
117 pci_read_config_dword(dev, pos + PCI_ERR_CAP, &dconfig);
118 /* ECRC Generation Enable */
119 if (config & PCI_ERR_CAP_ECRC_GENC)
120 config |= PCI_ERR_CAP_ECRC_GENE;
121 /* ECRC Check Enable */
122 if (config & PCI_ERR_CAP_ECRC_CHKC)
123 config |= PCI_ERR_CAP_ECRC_CHKE;
124 pci_write_config_dword(dev, pos + PCI_ERR_CAP, dconfig);
125 /* PCI_ERR_HEADER_LOG - Header Log Register (16 bytes) */
126 /* Report all errors to the root complex */
127 pci_write_config_dword(dev, pos + PCI_ERR_ROOT_COMMAND,
128 PCI_ERR_ROOT_CMD_COR_EN |
129 PCI_ERR_ROOT_CMD_NONFATAL_EN |
130 PCI_ERR_ROOT_CMD_FATAL_EN);
131 /* Clear the Root status register */
132 pci_read_config_dword(dev, pos + PCI_ERR_ROOT_STATUS, &dconfig);
133 pci_write_config_dword(dev, pos + PCI_ERR_ROOT_STATUS, dconfig);
134 }
135
136 return 0;
137}
diff --git a/arch/mips/cavium-octeon/smp.c b/arch/mips/cavium-octeon/smp.c
index 0b891a9c6253..32d51a31dc48 100644
--- a/arch/mips/cavium-octeon/smp.c
+++ b/arch/mips/cavium-octeon/smp.c
@@ -194,11 +194,11 @@ static void octeon_init_secondary(void)
194void octeon_prepare_cpus(unsigned int max_cpus) 194void octeon_prepare_cpus(unsigned int max_cpus)
195{ 195{
196 cvmx_write_csr(CVMX_CIU_MBOX_CLRX(cvmx_get_core_num()), 0xffffffff); 196 cvmx_write_csr(CVMX_CIU_MBOX_CLRX(cvmx_get_core_num()), 0xffffffff);
197 if (request_irq(OCTEON_IRQ_MBOX0, mailbox_interrupt, IRQF_SHARED, 197 if (request_irq(OCTEON_IRQ_MBOX0, mailbox_interrupt, IRQF_DISABLED,
198 "mailbox0", mailbox_interrupt)) { 198 "mailbox0", mailbox_interrupt)) {
199 panic("Cannot request_irq(OCTEON_IRQ_MBOX0)\n"); 199 panic("Cannot request_irq(OCTEON_IRQ_MBOX0)\n");
200 } 200 }
201 if (request_irq(OCTEON_IRQ_MBOX1, mailbox_interrupt, IRQF_SHARED, 201 if (request_irq(OCTEON_IRQ_MBOX1, mailbox_interrupt, IRQF_DISABLED,
202 "mailbox1", mailbox_interrupt)) { 202 "mailbox1", mailbox_interrupt)) {
203 panic("Cannot request_irq(OCTEON_IRQ_MBOX1)\n"); 203 panic("Cannot request_irq(OCTEON_IRQ_MBOX1)\n");
204 } 204 }
diff --git a/arch/mips/cobalt/buttons.c b/arch/mips/cobalt/buttons.c
index 9e143989c7b8..4eaec8b46e0c 100644
--- a/arch/mips/cobalt/buttons.c
+++ b/arch/mips/cobalt/buttons.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * Cobalt buttons platform device. 2 * Cobalt buttons platform device.
3 * 3 *
4 * Copyright (C) 2007 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> 4 * Copyright (C) 2007 Yoichi Yuasa <yuasa@linux-mips.org>
5 * 5 *
6 * This program is free software; you can redistribute it and/or modify 6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by 7 * it under the terms of the GNU General Public License as published by
diff --git a/arch/mips/cobalt/lcd.c b/arch/mips/cobalt/lcd.c
index 0720e4fae311..0f1cd90f37ed 100644
--- a/arch/mips/cobalt/lcd.c
+++ b/arch/mips/cobalt/lcd.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * Registration of Cobalt LCD platform device. 2 * Registration of Cobalt LCD platform device.
3 * 3 *
4 * Copyright (C) 2008 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> 4 * Copyright (C) 2008 Yoichi Yuasa <yuasa@linux-mips.org>
5 * 5 *
6 * This program is free software; you can redistribute it and/or modify 6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by 7 * it under the terms of the GNU General Public License as published by
diff --git a/arch/mips/cobalt/led.c b/arch/mips/cobalt/led.c
index 1c6ebd468b07..d3ce6fa1dc74 100644
--- a/arch/mips/cobalt/led.c
+++ b/arch/mips/cobalt/led.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * Registration of Cobalt LED platform device. 2 * Registration of Cobalt LED platform device.
3 * 3 *
4 * Copyright (C) 2007 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> 4 * Copyright (C) 2007 Yoichi Yuasa <yuasa@linux-mips.org>
5 * 5 *
6 * This program is free software; you can redistribute it and/or modify 6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by 7 * it under the terms of the GNU General Public License as published by
diff --git a/arch/mips/cobalt/mtd.c b/arch/mips/cobalt/mtd.c
index 2b088ef3839a..691d620b6766 100644
--- a/arch/mips/cobalt/mtd.c
+++ b/arch/mips/cobalt/mtd.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * Registration of Cobalt MTD device. 2 * Registration of Cobalt MTD device.
3 * 3 *
4 * Copyright (C) 2006 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> 4 * Copyright (C) 2006 Yoichi Yuasa <yuasa@linux-mips.org>
5 * 5 *
6 * This program is free software; you can redistribute it and/or modify 6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by 7 * it under the terms of the GNU General Public License as published by
diff --git a/arch/mips/cobalt/rtc.c b/arch/mips/cobalt/rtc.c
index e70794b8bcba..3ab39898b4e4 100644
--- a/arch/mips/cobalt/rtc.c
+++ b/arch/mips/cobalt/rtc.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * Registration of Cobalt RTC platform device. 2 * Registration of Cobalt RTC platform device.
3 * 3 *
4 * Copyright (C) 2007 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> 4 * Copyright (C) 2007 Yoichi Yuasa <yuasa@linux-mips.org>
5 * 5 *
6 * This program is free software; you can redistribute it and/or modify 6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by 7 * it under the terms of the GNU General Public License as published by
diff --git a/arch/mips/cobalt/serial.c b/arch/mips/cobalt/serial.c
index 53b8d0d6da90..7cb51f57275e 100644
--- a/arch/mips/cobalt/serial.c
+++ b/arch/mips/cobalt/serial.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * Registration of Cobalt UART platform device. 2 * Registration of Cobalt UART platform device.
3 * 3 *
4 * Copyright (C) 2007 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> 4 * Copyright (C) 2007 Yoichi Yuasa <yuasa@linux-mips.org>
5 * 5 *
6 * This program is free software; you can redistribute it and/or modify 6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by 7 * it under the terms of the GNU General Public License as published by
diff --git a/arch/mips/cobalt/time.c b/arch/mips/cobalt/time.c
index 4a570e7145fe..0162f9edc693 100644
--- a/arch/mips/cobalt/time.c
+++ b/arch/mips/cobalt/time.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * Cobalt time initialization. 2 * Cobalt time initialization.
3 * 3 *
4 * Copyright (C) 2007 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> 4 * Copyright (C) 2007 Yoichi Yuasa <yuasa@linux-mips.org>
5 * 5 *
6 * This program is free software; you can redistribute it and/or modify 6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by 7 * it under the terms of the GNU General Public License as published by
diff --git a/arch/mips/configs/ar7_defconfig b/arch/mips/configs/ar7_defconfig
new file mode 100644
index 000000000000..dad5b6769d74
--- /dev/null
+++ b/arch/mips/configs/ar7_defconfig
@@ -0,0 +1,1182 @@
1#
2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.30
4# Wed Jun 24 14:08:59 2009
5#
6CONFIG_MIPS=y
7
8#
9# Machine selection
10#
11# CONFIG_MACH_ALCHEMY is not set
12CONFIG_AR7=y
13# CONFIG_BASLER_EXCITE is not set
14# CONFIG_BCM47XX is not set
15# CONFIG_MIPS_COBALT is not set
16# CONFIG_MACH_DECSTATION is not set
17# CONFIG_MACH_JAZZ is not set
18# CONFIG_LASAT is not set
19# CONFIG_LEMOTE_FULONG is not set
20# CONFIG_MIPS_MALTA is not set
21# CONFIG_MIPS_SIM is not set
22# CONFIG_NEC_MARKEINS is not set
23# CONFIG_MACH_VR41XX is not set
24# CONFIG_NXP_STB220 is not set
25# CONFIG_NXP_STB225 is not set
26# CONFIG_PNX8550_JBS is not set
27# CONFIG_PNX8550_STB810 is not set
28# CONFIG_PMC_MSP is not set
29# CONFIG_PMC_YOSEMITE is not set
30# CONFIG_SGI_IP22 is not set
31# CONFIG_SGI_IP27 is not set
32# CONFIG_SGI_IP28 is not set
33# CONFIG_SGI_IP32 is not set
34# CONFIG_SIBYTE_CRHINE is not set
35# CONFIG_SIBYTE_CARMEL is not set
36# CONFIG_SIBYTE_CRHONE is not set
37# CONFIG_SIBYTE_RHONE is not set
38# CONFIG_SIBYTE_SWARM is not set
39# CONFIG_SIBYTE_LITTLESUR is not set
40# CONFIG_SIBYTE_SENTOSA is not set
41# CONFIG_SIBYTE_BIGSUR is not set
42# CONFIG_SNI_RM is not set
43# CONFIG_MACH_TX39XX is not set
44# CONFIG_MACH_TX49XX is not set
45# CONFIG_MIKROTIK_RB532 is not set
46# CONFIG_WR_PPMC is not set
47# CONFIG_CAVIUM_OCTEON_SIMULATOR is not set
48# CONFIG_CAVIUM_OCTEON_REFERENCE_BOARD is not set
49# CONFIG_ALCHEMY_GPIO_INDIRECT is not set
50CONFIG_RWSEM_GENERIC_SPINLOCK=y
51# CONFIG_ARCH_HAS_ILOG2_U32 is not set
52# CONFIG_ARCH_HAS_ILOG2_U64 is not set
53CONFIG_ARCH_SUPPORTS_OPROFILE=y
54CONFIG_GENERIC_FIND_NEXT_BIT=y
55CONFIG_GENERIC_HWEIGHT=y
56CONFIG_GENERIC_CALIBRATE_DELAY=y
57CONFIG_GENERIC_CLOCKEVENTS=y
58CONFIG_GENERIC_TIME=y
59CONFIG_GENERIC_CMOS_UPDATE=y
60CONFIG_SCHED_OMIT_FRAME_POINTER=y
61CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
62CONFIG_CEVT_R4K_LIB=y
63CONFIG_CEVT_R4K=y
64CONFIG_CSRC_R4K_LIB=y
65CONFIG_CSRC_R4K=y
66CONFIG_DMA_NONCOHERENT=y
67CONFIG_DMA_NEED_PCI_MAP_STATE=y
68CONFIG_EARLY_PRINTK=y
69CONFIG_SYS_HAS_EARLY_PRINTK=y
70# CONFIG_HOTPLUG_CPU is not set
71# CONFIG_NO_IOPORT is not set
72CONFIG_GENERIC_GPIO=y
73# CONFIG_CPU_BIG_ENDIAN is not set
74CONFIG_CPU_LITTLE_ENDIAN=y
75CONFIG_SYS_SUPPORTS_LITTLE_ENDIAN=y
76CONFIG_IRQ_CPU=y
77CONFIG_NO_EXCEPT_FILL=y
78CONFIG_SWAP_IO_SPACE=y
79CONFIG_BOOT_ELF32=y
80CONFIG_MIPS_L1_CACHE_SHIFT=5
81
82#
83# CPU selection
84#
85# CONFIG_CPU_LOONGSON2 is not set
86CONFIG_CPU_MIPS32_R1=y
87# CONFIG_CPU_MIPS32_R2 is not set
88# CONFIG_CPU_MIPS64_R1 is not set
89# CONFIG_CPU_MIPS64_R2 is not set
90# CONFIG_CPU_R3000 is not set
91# CONFIG_CPU_TX39XX is not set
92# CONFIG_CPU_VR41XX is not set
93# CONFIG_CPU_R4300 is not set
94# CONFIG_CPU_R4X00 is not set
95# CONFIG_CPU_TX49XX is not set
96# CONFIG_CPU_R5000 is not set
97# CONFIG_CPU_R5432 is not set
98# CONFIG_CPU_R5500 is not set
99# CONFIG_CPU_R6000 is not set
100# CONFIG_CPU_NEVADA is not set
101# CONFIG_CPU_R8000 is not set
102# CONFIG_CPU_R10000 is not set
103# CONFIG_CPU_RM7000 is not set
104# CONFIG_CPU_RM9000 is not set
105# CONFIG_CPU_SB1 is not set
106# CONFIG_CPU_CAVIUM_OCTEON is not set
107CONFIG_SYS_HAS_CPU_MIPS32_R1=y
108CONFIG_CPU_MIPS32=y
109CONFIG_CPU_MIPSR1=y
110CONFIG_SYS_SUPPORTS_32BIT_KERNEL=y
111CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y
112CONFIG_HARDWARE_WATCHPOINTS=y
113
114#
115# Kernel type
116#
117CONFIG_32BIT=y
118# CONFIG_64BIT is not set
119CONFIG_PAGE_SIZE_4KB=y
120# CONFIG_PAGE_SIZE_8KB is not set
121# CONFIG_PAGE_SIZE_16KB is not set
122# CONFIG_PAGE_SIZE_32KB is not set
123# CONFIG_PAGE_SIZE_64KB is not set
124CONFIG_CPU_HAS_PREFETCH=y
125CONFIG_MIPS_MT_DISABLED=y
126# CONFIG_MIPS_MT_SMP is not set
127# CONFIG_MIPS_MT_SMTC is not set
128CONFIG_CPU_HAS_LLSC=y
129CONFIG_CPU_HAS_SYNC=y
130CONFIG_GENERIC_HARDIRQS=y
131CONFIG_GENERIC_IRQ_PROBE=y
132CONFIG_CPU_SUPPORTS_HIGHMEM=y
133CONFIG_ARCH_FLATMEM_ENABLE=y
134CONFIG_ARCH_POPULATES_NODE_MAP=y
135CONFIG_SELECT_MEMORY_MODEL=y
136CONFIG_FLATMEM_MANUAL=y
137# CONFIG_DISCONTIGMEM_MANUAL is not set
138# CONFIG_SPARSEMEM_MANUAL is not set
139CONFIG_FLATMEM=y
140CONFIG_FLAT_NODE_MEM_MAP=y
141CONFIG_PAGEFLAGS_EXTENDED=y
142CONFIG_SPLIT_PTLOCK_CPUS=4
143# CONFIG_PHYS_ADDR_T_64BIT is not set
144CONFIG_ZONE_DMA_FLAG=0
145CONFIG_VIRT_TO_BUS=y
146CONFIG_HAVE_MLOCK=y
147CONFIG_HAVE_MLOCKED_PAGE_BIT=y
148CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
149CONFIG_TICK_ONESHOT=y
150# CONFIG_NO_HZ is not set
151CONFIG_HIGH_RES_TIMERS=y
152CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
153# CONFIG_HZ_48 is not set
154CONFIG_HZ_100=y
155# CONFIG_HZ_128 is not set
156# CONFIG_HZ_250 is not set
157# CONFIG_HZ_256 is not set
158# CONFIG_HZ_1000 is not set
159# CONFIG_HZ_1024 is not set
160CONFIG_SYS_SUPPORTS_ARBIT_HZ=y
161CONFIG_HZ=100
162CONFIG_PREEMPT_NONE=y
163# CONFIG_PREEMPT_VOLUNTARY is not set
164# CONFIG_PREEMPT is not set
165CONFIG_KEXEC=y
166# CONFIG_SECCOMP is not set
167CONFIG_LOCKDEP_SUPPORT=y
168CONFIG_STACKTRACE_SUPPORT=y
169CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
170
171#
172# General setup
173#
174CONFIG_EXPERIMENTAL=y
175CONFIG_BROKEN_ON_SMP=y
176CONFIG_INIT_ENV_ARG_LIMIT=32
177CONFIG_LOCALVERSION=""
178# CONFIG_LOCALVERSION_AUTO is not set
179CONFIG_SWAP=y
180CONFIG_SYSVIPC=y
181CONFIG_SYSVIPC_SYSCTL=y
182# CONFIG_POSIX_MQUEUE is not set
183CONFIG_BSD_PROCESS_ACCT=y
184# CONFIG_BSD_PROCESS_ACCT_V3 is not set
185# CONFIG_TASKSTATS is not set
186# CONFIG_AUDIT is not set
187
188#
189# RCU Subsystem
190#
191CONFIG_CLASSIC_RCU=y
192# CONFIG_TREE_RCU is not set
193# CONFIG_PREEMPT_RCU is not set
194# CONFIG_TREE_RCU_TRACE is not set
195# CONFIG_PREEMPT_RCU_TRACE is not set
196# CONFIG_IKCONFIG is not set
197CONFIG_LOG_BUF_SHIFT=14
198# CONFIG_GROUP_SCHED is not set
199# CONFIG_CGROUPS is not set
200CONFIG_SYSFS_DEPRECATED=y
201CONFIG_SYSFS_DEPRECATED_V2=y
202CONFIG_RELAY=y
203# CONFIG_NAMESPACES is not set
204CONFIG_BLK_DEV_INITRD=y
205CONFIG_INITRAMFS_SOURCE=""
206CONFIG_RD_GZIP=y
207# CONFIG_RD_BZIP2 is not set
208CONFIG_RD_LZMA=y
209CONFIG_CC_OPTIMIZE_FOR_SIZE=y
210CONFIG_SYSCTL=y
211CONFIG_ANON_INODES=y
212CONFIG_EMBEDDED=y
213CONFIG_SYSCTL_SYSCALL=y
214# CONFIG_KALLSYMS is not set
215CONFIG_HOTPLUG=y
216CONFIG_PRINTK=y
217CONFIG_BUG=y
218# CONFIG_ELF_CORE is not set
219# CONFIG_PCSPKR_PLATFORM is not set
220CONFIG_BASE_FULL=y
221CONFIG_FUTEX=y
222CONFIG_EPOLL=y
223CONFIG_SIGNALFD=y
224CONFIG_TIMERFD=y
225CONFIG_EVENTFD=y
226CONFIG_SHMEM=y
227CONFIG_AIO=y
228
229#
230# Performance Counters
231#
232# CONFIG_VM_EVENT_COUNTERS is not set
233CONFIG_STRIP_ASM_SYMS=y
234# CONFIG_COMPAT_BRK is not set
235CONFIG_SLAB=y
236# CONFIG_SLUB is not set
237# CONFIG_SLOB is not set
238# CONFIG_PROFILING is not set
239# CONFIG_MARKERS is not set
240CONFIG_HAVE_OPROFILE=y
241# CONFIG_SLOW_WORK is not set
242# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
243CONFIG_SLABINFO=y
244CONFIG_RT_MUTEXES=y
245CONFIG_BASE_SMALL=0
246CONFIG_MODULES=y
247# CONFIG_MODULE_FORCE_LOAD is not set
248CONFIG_MODULE_UNLOAD=y
249# CONFIG_MODULE_FORCE_UNLOAD is not set
250# CONFIG_MODVERSIONS is not set
251# CONFIG_MODULE_SRCVERSION_ALL is not set
252CONFIG_BLOCK=y
253# CONFIG_LBD is not set
254# CONFIG_BLK_DEV_BSG is not set
255# CONFIG_BLK_DEV_INTEGRITY is not set
256
257#
258# IO Schedulers
259#
260CONFIG_IOSCHED_NOOP=y
261# CONFIG_IOSCHED_AS is not set
262CONFIG_IOSCHED_DEADLINE=y
263# CONFIG_IOSCHED_CFQ is not set
264# CONFIG_DEFAULT_AS is not set
265CONFIG_DEFAULT_DEADLINE=y
266# CONFIG_DEFAULT_CFQ is not set
267# CONFIG_DEFAULT_NOOP is not set
268CONFIG_DEFAULT_IOSCHED="deadline"
269CONFIG_PROBE_INITRD_HEADER=y
270# CONFIG_FREEZER is not set
271
272#
273# Bus options (PCI, PCMCIA, EISA, ISA, TC)
274#
275# CONFIG_ARCH_SUPPORTS_MSI is not set
276CONFIG_MMU=y
277# CONFIG_PCCARD is not set
278
279#
280# Executable file formats
281#
282CONFIG_BINFMT_ELF=y
283# CONFIG_HAVE_AOUT is not set
284# CONFIG_BINFMT_MISC is not set
285CONFIG_TRAD_SIGNALS=y
286
287#
288# Power management options
289#
290CONFIG_ARCH_HIBERNATION_POSSIBLE=y
291CONFIG_ARCH_SUSPEND_POSSIBLE=y
292# CONFIG_PM is not set
293CONFIG_NET=y
294
295#
296# Networking options
297#
298CONFIG_PACKET=y
299CONFIG_PACKET_MMAP=y
300CONFIG_UNIX=y
301# CONFIG_NET_KEY is not set
302CONFIG_INET=y
303CONFIG_IP_MULTICAST=y
304CONFIG_IP_ADVANCED_ROUTER=y
305CONFIG_ASK_IP_FIB_HASH=y
306# CONFIG_IP_FIB_TRIE is not set
307CONFIG_IP_FIB_HASH=y
308CONFIG_IP_MULTIPLE_TABLES=y
309CONFIG_IP_ROUTE_MULTIPATH=y
310CONFIG_IP_ROUTE_VERBOSE=y
311# CONFIG_IP_PNP is not set
312# CONFIG_NET_IPIP is not set
313# CONFIG_NET_IPGRE is not set
314CONFIG_IP_MROUTE=y
315# CONFIG_IP_PIMSM_V1 is not set
316# CONFIG_IP_PIMSM_V2 is not set
317CONFIG_ARPD=y
318CONFIG_SYN_COOKIES=y
319# CONFIG_INET_AH is not set
320# CONFIG_INET_ESP is not set
321# CONFIG_INET_IPCOMP is not set
322# CONFIG_INET_XFRM_TUNNEL is not set
323# CONFIG_INET_TUNNEL is not set
324# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
325# CONFIG_INET_XFRM_MODE_TUNNEL is not set
326# CONFIG_INET_XFRM_MODE_BEET is not set
327# CONFIG_INET_LRO is not set
328# CONFIG_INET_DIAG is not set
329CONFIG_TCP_CONG_ADVANCED=y
330# CONFIG_TCP_CONG_BIC is not set
331# CONFIG_TCP_CONG_CUBIC is not set
332CONFIG_TCP_CONG_WESTWOOD=y
333# CONFIG_TCP_CONG_HTCP is not set
334# CONFIG_TCP_CONG_HSTCP is not set
335# CONFIG_TCP_CONG_HYBLA is not set
336# CONFIG_TCP_CONG_VEGAS is not set
337# CONFIG_TCP_CONG_SCALABLE is not set
338# CONFIG_TCP_CONG_LP is not set
339# CONFIG_TCP_CONG_VENO is not set
340# CONFIG_TCP_CONG_YEAH is not set
341# CONFIG_TCP_CONG_ILLINOIS is not set
342# CONFIG_DEFAULT_BIC is not set
343# CONFIG_DEFAULT_CUBIC is not set
344# CONFIG_DEFAULT_HTCP is not set
345# CONFIG_DEFAULT_VEGAS is not set
346CONFIG_DEFAULT_WESTWOOD=y
347# CONFIG_DEFAULT_RENO is not set
348CONFIG_DEFAULT_TCP_CONG="westwood"
349# CONFIG_TCP_MD5SIG is not set
350# CONFIG_IPV6 is not set
351# CONFIG_NETWORK_SECMARK is not set
352CONFIG_NETFILTER=y
353# CONFIG_NETFILTER_DEBUG is not set
354CONFIG_NETFILTER_ADVANCED=y
355# CONFIG_BRIDGE_NETFILTER is not set
356
357#
358# Core Netfilter Configuration
359#
360# CONFIG_NETFILTER_NETLINK_QUEUE is not set
361# CONFIG_NETFILTER_NETLINK_LOG is not set
362CONFIG_NF_CONNTRACK=m
363# CONFIG_NF_CT_ACCT is not set
364CONFIG_NF_CONNTRACK_MARK=y
365# CONFIG_NF_CONNTRACK_EVENTS is not set
366# CONFIG_NF_CT_PROTO_DCCP is not set
367# CONFIG_NF_CT_PROTO_SCTP is not set
368# CONFIG_NF_CT_PROTO_UDPLITE is not set
369# CONFIG_NF_CONNTRACK_AMANDA is not set
370CONFIG_NF_CONNTRACK_FTP=m
371# CONFIG_NF_CONNTRACK_H323 is not set
372CONFIG_NF_CONNTRACK_IRC=m
373# CONFIG_NF_CONNTRACK_NETBIOS_NS is not set
374# CONFIG_NF_CONNTRACK_PPTP is not set
375# CONFIG_NF_CONNTRACK_SANE is not set
376# CONFIG_NF_CONNTRACK_SIP is not set
377CONFIG_NF_CONNTRACK_TFTP=m
378# CONFIG_NF_CT_NETLINK is not set
379# CONFIG_NETFILTER_TPROXY is not set
380CONFIG_NETFILTER_XTABLES=m
381# CONFIG_NETFILTER_XT_TARGET_CLASSIFY is not set
382# CONFIG_NETFILTER_XT_TARGET_CONNMARK is not set
383# CONFIG_NETFILTER_XT_TARGET_DSCP is not set
384# CONFIG_NETFILTER_XT_TARGET_HL is not set
385# CONFIG_NETFILTER_XT_TARGET_LED is not set
386# CONFIG_NETFILTER_XT_TARGET_MARK is not set
387# CONFIG_NETFILTER_XT_TARGET_NFLOG is not set
388# CONFIG_NETFILTER_XT_TARGET_NFQUEUE is not set
389CONFIG_NETFILTER_XT_TARGET_NOTRACK=m
390# CONFIG_NETFILTER_XT_TARGET_RATEEST is not set
391# CONFIG_NETFILTER_XT_TARGET_TRACE is not set
392CONFIG_NETFILTER_XT_TARGET_TCPMSS=m
393# CONFIG_NETFILTER_XT_TARGET_TCPOPTSTRIP is not set
394# CONFIG_NETFILTER_XT_MATCH_CLUSTER is not set
395# CONFIG_NETFILTER_XT_MATCH_COMMENT is not set
396# CONFIG_NETFILTER_XT_MATCH_CONNBYTES is not set
397# CONFIG_NETFILTER_XT_MATCH_CONNLIMIT is not set
398# CONFIG_NETFILTER_XT_MATCH_CONNMARK is not set
399# CONFIG_NETFILTER_XT_MATCH_CONNTRACK is not set
400# CONFIG_NETFILTER_XT_MATCH_DCCP is not set
401# CONFIG_NETFILTER_XT_MATCH_DSCP is not set
402# CONFIG_NETFILTER_XT_MATCH_ESP is not set
403# CONFIG_NETFILTER_XT_MATCH_HASHLIMIT is not set
404# CONFIG_NETFILTER_XT_MATCH_HELPER is not set
405# CONFIG_NETFILTER_XT_MATCH_HL is not set
406# CONFIG_NETFILTER_XT_MATCH_IPRANGE is not set
407# CONFIG_NETFILTER_XT_MATCH_LENGTH is not set
408CONFIG_NETFILTER_XT_MATCH_LIMIT=m
409CONFIG_NETFILTER_XT_MATCH_MAC=m
410# CONFIG_NETFILTER_XT_MATCH_MARK is not set
411CONFIG_NETFILTER_XT_MATCH_MULTIPORT=m
412# CONFIG_NETFILTER_XT_MATCH_OWNER is not set
413# CONFIG_NETFILTER_XT_MATCH_PKTTYPE is not set
414# CONFIG_NETFILTER_XT_MATCH_QUOTA is not set
415# CONFIG_NETFILTER_XT_MATCH_RATEEST is not set
416# CONFIG_NETFILTER_XT_MATCH_REALM is not set
417# CONFIG_NETFILTER_XT_MATCH_RECENT is not set
418# CONFIG_NETFILTER_XT_MATCH_SCTP is not set
419CONFIG_NETFILTER_XT_MATCH_STATE=m
420# CONFIG_NETFILTER_XT_MATCH_STATISTIC is not set
421# CONFIG_NETFILTER_XT_MATCH_STRING is not set
422# CONFIG_NETFILTER_XT_MATCH_TCPMSS is not set
423# CONFIG_NETFILTER_XT_MATCH_TIME is not set
424# CONFIG_NETFILTER_XT_MATCH_U32 is not set
425# CONFIG_IP_VS is not set
426
427#
428# IP: Netfilter Configuration
429#
430CONFIG_NF_DEFRAG_IPV4=m
431CONFIG_NF_CONNTRACK_IPV4=m
432CONFIG_NF_CONNTRACK_PROC_COMPAT=y
433# CONFIG_IP_NF_QUEUE is not set
434CONFIG_IP_NF_IPTABLES=m
435# CONFIG_IP_NF_MATCH_ADDRTYPE is not set
436# CONFIG_IP_NF_MATCH_AH is not set
437# CONFIG_IP_NF_MATCH_ECN is not set
438# CONFIG_IP_NF_MATCH_TTL is not set
439CONFIG_IP_NF_FILTER=m
440CONFIG_IP_NF_TARGET_REJECT=m
441CONFIG_IP_NF_TARGET_LOG=m
442# CONFIG_IP_NF_TARGET_ULOG is not set
443CONFIG_NF_NAT=m
444CONFIG_NF_NAT_NEEDED=y
445CONFIG_IP_NF_TARGET_MASQUERADE=m
446# CONFIG_IP_NF_TARGET_NETMAP is not set
447# CONFIG_IP_NF_TARGET_REDIRECT is not set
448# CONFIG_NF_NAT_SNMP_BASIC is not set
449CONFIG_NF_NAT_FTP=m
450CONFIG_NF_NAT_IRC=m
451CONFIG_NF_NAT_TFTP=m
452# CONFIG_NF_NAT_AMANDA is not set
453# CONFIG_NF_NAT_PPTP is not set
454# CONFIG_NF_NAT_H323 is not set
455# CONFIG_NF_NAT_SIP is not set
456CONFIG_IP_NF_MANGLE=m
457# CONFIG_IP_NF_TARGET_CLUSTERIP is not set
458# CONFIG_IP_NF_TARGET_ECN is not set
459# CONFIG_IP_NF_TARGET_TTL is not set
460CONFIG_IP_NF_RAW=m
461# CONFIG_IP_NF_ARPTABLES is not set
462# CONFIG_IP_DCCP is not set
463# CONFIG_IP_SCTP is not set
464# CONFIG_TIPC is not set
465CONFIG_ATM=m
466# CONFIG_ATM_CLIP is not set
467# CONFIG_ATM_LANE is not set
468CONFIG_ATM_BR2684=m
469CONFIG_ATM_BR2684_IPFILTER=y
470CONFIG_STP=y
471CONFIG_BRIDGE=y
472# CONFIG_NET_DSA is not set
473CONFIG_VLAN_8021Q=y
474# CONFIG_VLAN_8021Q_GVRP is not set
475# CONFIG_DECNET is not set
476CONFIG_LLC=y
477# CONFIG_LLC2 is not set
478# CONFIG_IPX is not set
479# CONFIG_ATALK is not set
480# CONFIG_X25 is not set
481# CONFIG_LAPB is not set
482# CONFIG_ECONET is not set
483# CONFIG_WAN_ROUTER is not set
484# CONFIG_PHONET is not set
485# CONFIG_IEEE802154 is not set
486CONFIG_NET_SCHED=y
487
488#
489# Queueing/Scheduling
490#
491# CONFIG_NET_SCH_CBQ is not set
492# CONFIG_NET_SCH_HTB is not set
493# CONFIG_NET_SCH_HFSC is not set
494# CONFIG_NET_SCH_ATM is not set
495# CONFIG_NET_SCH_PRIO is not set
496# CONFIG_NET_SCH_MULTIQ is not set
497# CONFIG_NET_SCH_RED is not set
498# CONFIG_NET_SCH_SFQ is not set
499# CONFIG_NET_SCH_TEQL is not set
500# CONFIG_NET_SCH_TBF is not set
501# CONFIG_NET_SCH_GRED is not set
502# CONFIG_NET_SCH_DSMARK is not set
503# CONFIG_NET_SCH_NETEM is not set
504# CONFIG_NET_SCH_DRR is not set
505# CONFIG_NET_SCH_INGRESS is not set
506
507#
508# Classification
509#
510# CONFIG_NET_CLS_BASIC is not set
511# CONFIG_NET_CLS_TCINDEX is not set
512# CONFIG_NET_CLS_ROUTE4 is not set
513# CONFIG_NET_CLS_FW is not set
514# CONFIG_NET_CLS_U32 is not set
515# CONFIG_NET_CLS_RSVP is not set
516# CONFIG_NET_CLS_RSVP6 is not set
517# CONFIG_NET_CLS_FLOW is not set
518# CONFIG_NET_EMATCH is not set
519CONFIG_NET_CLS_ACT=y
520CONFIG_NET_ACT_POLICE=y
521# CONFIG_NET_ACT_GACT is not set
522# CONFIG_NET_ACT_MIRRED is not set
523# CONFIG_NET_ACT_IPT is not set
524# CONFIG_NET_ACT_NAT is not set
525# CONFIG_NET_ACT_PEDIT is not set
526# CONFIG_NET_ACT_SIMP is not set
527# CONFIG_NET_ACT_SKBEDIT is not set
528CONFIG_NET_SCH_FIFO=y
529# CONFIG_DCB is not set
530
531#
532# Network testing
533#
534# CONFIG_NET_PKTGEN is not set
535CONFIG_HAMRADIO=y
536
537#
538# Packet Radio protocols
539#
540# CONFIG_AX25 is not set
541# CONFIG_CAN is not set
542# CONFIG_IRDA is not set
543# CONFIG_BT is not set
544# CONFIG_AF_RXRPC is not set
545CONFIG_FIB_RULES=y
546CONFIG_WIRELESS=y
547CONFIG_CFG80211=m
548# CONFIG_CFG80211_REG_DEBUG is not set
549# CONFIG_CFG80211_DEBUGFS is not set
550# CONFIG_WIRELESS_OLD_REGULATORY is not set
551CONFIG_WIRELESS_EXT=y
552CONFIG_WIRELESS_EXT_SYSFS=y
553# CONFIG_LIB80211 is not set
554CONFIG_MAC80211=m
555CONFIG_MAC80211_DEFAULT_PS=y
556CONFIG_MAC80211_DEFAULT_PS_VALUE=1
557
558#
559# Rate control algorithm selection
560#
561CONFIG_MAC80211_RC_PID=y
562CONFIG_MAC80211_RC_MINSTREL=y
563CONFIG_MAC80211_RC_DEFAULT_PID=y
564# CONFIG_MAC80211_RC_DEFAULT_MINSTREL is not set
565CONFIG_MAC80211_RC_DEFAULT="pid"
566# CONFIG_MAC80211_MESH is not set
567# CONFIG_MAC80211_LEDS is not set
568# CONFIG_MAC80211_DEBUGFS is not set
569# CONFIG_MAC80211_DEBUG_MENU is not set
570# CONFIG_WIMAX is not set
571# CONFIG_RFKILL is not set
572# CONFIG_NET_9P is not set
573
574#
575# Device Drivers
576#
577
578#
579# Generic Driver Options
580#
581CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
582CONFIG_STANDALONE=y
583CONFIG_PREVENT_FIRMWARE_BUILD=y
584CONFIG_FW_LOADER=y
585# CONFIG_FIRMWARE_IN_KERNEL is not set
586CONFIG_EXTRA_FIRMWARE=""
587# CONFIG_SYS_HYPERVISOR is not set
588# CONFIG_CONNECTOR is not set
589CONFIG_MTD=y
590# CONFIG_MTD_DEBUG is not set
591# CONFIG_MTD_CONCAT is not set
592CONFIG_MTD_PARTITIONS=y
593# CONFIG_MTD_TESTS is not set
594# CONFIG_MTD_REDBOOT_PARTS is not set
595# CONFIG_MTD_CMDLINE_PARTS is not set
596# CONFIG_MTD_AR7_PARTS is not set
597
598#
599# User Modules And Translation Layers
600#
601CONFIG_MTD_CHAR=y
602CONFIG_MTD_BLKDEVS=y
603CONFIG_MTD_BLOCK=y
604# CONFIG_FTL is not set
605# CONFIG_NFTL is not set
606# CONFIG_INFTL is not set
607# CONFIG_RFD_FTL is not set
608# CONFIG_SSFDC is not set
609# CONFIG_MTD_OOPS is not set
610
611#
612# RAM/ROM/Flash chip drivers
613#
614CONFIG_MTD_CFI=y
615# CONFIG_MTD_JEDECPROBE is not set
616CONFIG_MTD_GEN_PROBE=y
617# CONFIG_MTD_CFI_ADV_OPTIONS is not set
618CONFIG_MTD_MAP_BANK_WIDTH_1=y
619CONFIG_MTD_MAP_BANK_WIDTH_2=y
620CONFIG_MTD_MAP_BANK_WIDTH_4=y
621# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
622# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
623# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
624CONFIG_MTD_CFI_I1=y
625CONFIG_MTD_CFI_I2=y
626# CONFIG_MTD_CFI_I4 is not set
627# CONFIG_MTD_CFI_I8 is not set
628CONFIG_MTD_CFI_INTELEXT=y
629CONFIG_MTD_CFI_AMDSTD=y
630CONFIG_MTD_CFI_STAA=y
631CONFIG_MTD_CFI_UTIL=y
632# CONFIG_MTD_RAM is not set
633# CONFIG_MTD_ROM is not set
634# CONFIG_MTD_ABSENT is not set
635
636#
637# Mapping drivers for chip access
638#
639CONFIG_MTD_COMPLEX_MAPPINGS=y
640CONFIG_MTD_PHYSMAP=y
641# CONFIG_MTD_PHYSMAP_COMPAT is not set
642# CONFIG_MTD_PLATRAM is not set
643
644#
645# Self-contained MTD device drivers
646#
647# CONFIG_MTD_SLRAM is not set
648# CONFIG_MTD_PHRAM is not set
649# CONFIG_MTD_MTDRAM is not set
650# CONFIG_MTD_BLOCK2MTD is not set
651
652#
653# Disk-On-Chip Device Drivers
654#
655# CONFIG_MTD_DOC2000 is not set
656# CONFIG_MTD_DOC2001 is not set
657# CONFIG_MTD_DOC2001PLUS is not set
658# CONFIG_MTD_NAND is not set
659# CONFIG_MTD_ONENAND is not set
660
661#
662# LPDDR flash memory drivers
663#
664# CONFIG_MTD_LPDDR is not set
665
666#
667# UBI - Unsorted block images
668#
669# CONFIG_MTD_UBI is not set
670# CONFIG_PARPORT is not set
671CONFIG_BLK_DEV=y
672# CONFIG_BLK_DEV_COW_COMMON is not set
673# CONFIG_BLK_DEV_LOOP is not set
674# CONFIG_BLK_DEV_NBD is not set
675# CONFIG_BLK_DEV_RAM is not set
676# CONFIG_CDROM_PKTCDVD is not set
677# CONFIG_ATA_OVER_ETH is not set
678# CONFIG_BLK_DEV_HD is not set
679CONFIG_MISC_DEVICES=y
680# CONFIG_ENCLOSURE_SERVICES is not set
681# CONFIG_C2PORT is not set
682
683#
684# EEPROM support
685#
686# CONFIG_EEPROM_93CX6 is not set
687CONFIG_HAVE_IDE=y
688# CONFIG_IDE is not set
689
690#
691# SCSI device support
692#
693# CONFIG_RAID_ATTRS is not set
694# CONFIG_SCSI is not set
695# CONFIG_SCSI_DMA is not set
696# CONFIG_SCSI_NETLINK is not set
697# CONFIG_ATA is not set
698# CONFIG_MD is not set
699CONFIG_NETDEVICES=y
700# CONFIG_IFB is not set
701# CONFIG_DUMMY is not set
702# CONFIG_BONDING is not set
703# CONFIG_MACVLAN is not set
704# CONFIG_EQUALIZER is not set
705# CONFIG_TUN is not set
706# CONFIG_VETH is not set
707CONFIG_PHYLIB=y
708
709#
710# MII PHY device drivers
711#
712# CONFIG_MARVELL_PHY is not set
713# CONFIG_DAVICOM_PHY is not set
714# CONFIG_QSEMI_PHY is not set
715# CONFIG_LXT_PHY is not set
716# CONFIG_CICADA_PHY is not set
717# CONFIG_VITESSE_PHY is not set
718# CONFIG_SMSC_PHY is not set
719# CONFIG_BROADCOM_PHY is not set
720# CONFIG_ICPLUS_PHY is not set
721# CONFIG_REALTEK_PHY is not set
722# CONFIG_NATIONAL_PHY is not set
723# CONFIG_STE10XP is not set
724# CONFIG_LSI_ET1011C_PHY is not set
725CONFIG_FIXED_PHY=y
726# CONFIG_MDIO_BITBANG is not set
727CONFIG_NET_ETHERNET=y
728CONFIG_MII=y
729# CONFIG_AX88796 is not set
730# CONFIG_SMC91X is not set
731# CONFIG_DM9000 is not set
732# CONFIG_ETHOC is not set
733# CONFIG_DNET is not set
734# CONFIG_IBM_NEW_EMAC_ZMII is not set
735# CONFIG_IBM_NEW_EMAC_RGMII is not set
736# CONFIG_IBM_NEW_EMAC_TAH is not set
737# CONFIG_IBM_NEW_EMAC_EMAC4 is not set
738# CONFIG_IBM_NEW_EMAC_NO_FLOW_CTRL is not set
739# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set
740# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
741# CONFIG_B44 is not set
742# CONFIG_KS8842 is not set
743CONFIG_CPMAC=y
744# CONFIG_NETDEV_1000 is not set
745# CONFIG_NETDEV_10000 is not set
746
747#
748# Wireless LAN
749#
750# CONFIG_WLAN_PRE80211 is not set
751CONFIG_WLAN_80211=y
752# CONFIG_LIBERTAS is not set
753# CONFIG_LIBERTAS_THINFIRM is not set
754# CONFIG_MAC80211_HWSIM is not set
755# CONFIG_P54_COMMON is not set
756# CONFIG_HOSTAP is not set
757# CONFIG_B43 is not set
758# CONFIG_B43LEGACY is not set
759# CONFIG_RT2X00 is not set
760
761#
762# Enable WiMAX (Networking options) to see the WiMAX drivers
763#
764# CONFIG_WAN is not set
765CONFIG_ATM_DRIVERS=y
766# CONFIG_ATM_DUMMY is not set
767# CONFIG_ATM_TCP is not set
768CONFIG_PPP=m
769CONFIG_PPP_MULTILINK=y
770CONFIG_PPP_FILTER=y
771CONFIG_PPP_ASYNC=m
772# CONFIG_PPP_SYNC_TTY is not set
773# CONFIG_PPP_DEFLATE is not set
774# CONFIG_PPP_BSDCOMP is not set
775# CONFIG_PPP_MPPE is not set
776CONFIG_PPPOE=m
777CONFIG_PPPOATM=m
778# CONFIG_PPPOL2TP is not set
779# CONFIG_SLIP is not set
780CONFIG_SLHC=m
781# CONFIG_NETCONSOLE is not set
782# CONFIG_NETPOLL is not set
783# CONFIG_NET_POLL_CONTROLLER is not set
784# CONFIG_ISDN is not set
785# CONFIG_PHONE is not set
786
787#
788# Input device support
789#
790# CONFIG_INPUT is not set
791
792#
793# Hardware I/O ports
794#
795# CONFIG_SERIO is not set
796# CONFIG_GAMEPORT is not set
797
798#
799# Character devices
800#
801# CONFIG_VT is not set
802# CONFIG_DEVKMEM is not set
803# CONFIG_SERIAL_NONSTANDARD is not set
804
805#
806# Serial drivers
807#
808CONFIG_SERIAL_8250=y
809CONFIG_SERIAL_8250_CONSOLE=y
810CONFIG_SERIAL_8250_NR_UARTS=2
811CONFIG_SERIAL_8250_RUNTIME_UARTS=2
812# CONFIG_SERIAL_8250_EXTENDED is not set
813
814#
815# Non-8250 serial port support
816#
817CONFIG_SERIAL_CORE=y
818CONFIG_SERIAL_CORE_CONSOLE=y
819CONFIG_UNIX98_PTYS=y
820# CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set
821# CONFIG_LEGACY_PTYS is not set
822# CONFIG_IPMI_HANDLER is not set
823CONFIG_HW_RANDOM=y
824# CONFIG_HW_RANDOM_TIMERIOMEM is not set
825# CONFIG_R3964 is not set
826# CONFIG_RAW_DRIVER is not set
827# CONFIG_TCG_TPM is not set
828# CONFIG_I2C is not set
829# CONFIG_SPI is not set
830# CONFIG_W1 is not set
831# CONFIG_POWER_SUPPLY is not set
832# CONFIG_HWMON is not set
833# CONFIG_THERMAL is not set
834# CONFIG_THERMAL_HWMON is not set
835CONFIG_WATCHDOG=y
836# CONFIG_WATCHDOG_NOWAYOUT is not set
837
838#
839# Watchdog Device Drivers
840#
841# CONFIG_SOFT_WATCHDOG is not set
842CONFIG_AR7_WDT=y
843CONFIG_SSB_POSSIBLE=y
844
845#
846# Sonics Silicon Backplane
847#
848CONFIG_SSB=y
849# CONFIG_SSB_SILENT is not set
850# CONFIG_SSB_DEBUG is not set
851CONFIG_SSB_SERIAL=y
852CONFIG_SSB_DRIVER_MIPS=y
853CONFIG_SSB_EMBEDDED=y
854CONFIG_SSB_DRIVER_EXTIF=y
855
856#
857# Multifunction device drivers
858#
859# CONFIG_MFD_CORE is not set
860# CONFIG_MFD_SM501 is not set
861# CONFIG_HTC_PASIC3 is not set
862# CONFIG_MFD_TMIO is not set
863# CONFIG_REGULATOR is not set
864# CONFIG_MEDIA_SUPPORT is not set
865
866#
867# Graphics support
868#
869# CONFIG_VGASTATE is not set
870# CONFIG_VIDEO_OUTPUT_CONTROL is not set
871# CONFIG_FB is not set
872# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
873
874#
875# Display device support
876#
877# CONFIG_DISPLAY_SUPPORT is not set
878# CONFIG_SOUND is not set
879# CONFIG_USB_SUPPORT is not set
880# CONFIG_MMC is not set
881# CONFIG_MEMSTICK is not set
882CONFIG_NEW_LEDS=y
883CONFIG_LEDS_CLASS=y
884
885#
886# LED drivers
887#
888# CONFIG_LEDS_GPIO is not set
889
890#
891# LED Triggers
892#
893CONFIG_LEDS_TRIGGERS=y
894CONFIG_LEDS_TRIGGER_TIMER=y
895CONFIG_LEDS_TRIGGER_HEARTBEAT=y
896# CONFIG_LEDS_TRIGGER_BACKLIGHT is not set
897CONFIG_LEDS_TRIGGER_DEFAULT_ON=y
898
899#
900# iptables trigger is under Netfilter config (LED target)
901#
902# CONFIG_ACCESSIBILITY is not set
903CONFIG_RTC_LIB=y
904# CONFIG_RTC_CLASS is not set
905# CONFIG_DMADEVICES is not set
906# CONFIG_AUXDISPLAY is not set
907# CONFIG_UIO is not set
908
909#
910# TI VLYNQ
911#
912CONFIG_VLYNQ=y
913# CONFIG_STAGING is not set
914
915#
916# File systems
917#
918# CONFIG_EXT2_FS is not set
919# CONFIG_EXT3_FS is not set
920# CONFIG_EXT4_FS is not set
921# CONFIG_REISERFS_FS is not set
922# CONFIG_JFS_FS is not set
923# CONFIG_FS_POSIX_ACL is not set
924# CONFIG_XFS_FS is not set
925# CONFIG_OCFS2_FS is not set
926# CONFIG_BTRFS_FS is not set
927CONFIG_FILE_LOCKING=y
928CONFIG_FSNOTIFY=y
929# CONFIG_DNOTIFY is not set
930# CONFIG_INOTIFY is not set
931CONFIG_INOTIFY_USER=y
932# CONFIG_QUOTA is not set
933# CONFIG_AUTOFS_FS is not set
934# CONFIG_AUTOFS4_FS is not set
935# CONFIG_FUSE_FS is not set
936
937#
938# Caches
939#
940# CONFIG_FSCACHE is not set
941
942#
943# CD-ROM/DVD Filesystems
944#
945# CONFIG_ISO9660_FS is not set
946# CONFIG_UDF_FS is not set
947
948#
949# DOS/FAT/NT Filesystems
950#
951# CONFIG_MSDOS_FS is not set
952# CONFIG_VFAT_FS is not set
953# CONFIG_NTFS_FS is not set
954
955#
956# Pseudo filesystems
957#
958CONFIG_PROC_FS=y
959CONFIG_PROC_KCORE=y
960CONFIG_PROC_SYSCTL=y
961# CONFIG_PROC_PAGE_MONITOR is not set
962CONFIG_SYSFS=y
963CONFIG_TMPFS=y
964# CONFIG_TMPFS_POSIX_ACL is not set
965# CONFIG_HUGETLB_PAGE is not set
966# CONFIG_CONFIGFS_FS is not set
967CONFIG_MISC_FILESYSTEMS=y
968# CONFIG_ADFS_FS is not set
969# CONFIG_AFFS_FS is not set
970# CONFIG_HFS_FS is not set
971# CONFIG_HFSPLUS_FS is not set
972# CONFIG_BEFS_FS is not set
973# CONFIG_BFS_FS is not set
974# CONFIG_EFS_FS is not set
975CONFIG_JFFS2_FS=y
976CONFIG_JFFS2_FS_DEBUG=0
977CONFIG_JFFS2_FS_WRITEBUFFER=y
978# CONFIG_JFFS2_FS_WBUF_VERIFY is not set
979CONFIG_JFFS2_SUMMARY=y
980# CONFIG_JFFS2_FS_XATTR is not set
981CONFIG_JFFS2_COMPRESSION_OPTIONS=y
982CONFIG_JFFS2_ZLIB=y
983# CONFIG_JFFS2_LZO is not set
984CONFIG_JFFS2_RTIME=y
985# CONFIG_JFFS2_RUBIN is not set
986# CONFIG_JFFS2_CMODE_NONE is not set
987CONFIG_JFFS2_CMODE_PRIORITY=y
988# CONFIG_JFFS2_CMODE_SIZE is not set
989# CONFIG_JFFS2_CMODE_FAVOURLZO is not set
990# CONFIG_CRAMFS is not set
991CONFIG_SQUASHFS=y
992# CONFIG_SQUASHFS_EMBEDDED is not set
993CONFIG_SQUASHFS_FRAGMENT_CACHE_SIZE=3
994# CONFIG_VXFS_FS is not set
995# CONFIG_MINIX_FS is not set
996# CONFIG_OMFS_FS is not set
997# CONFIG_HPFS_FS is not set
998# CONFIG_QNX4FS_FS is not set
999# CONFIG_ROMFS_FS is not set
1000# CONFIG_SYSV_FS is not set
1001# CONFIG_UFS_FS is not set
1002# CONFIG_NILFS2_FS is not set
1003CONFIG_NETWORK_FILESYSTEMS=y
1004# CONFIG_NFS_FS is not set
1005# CONFIG_NFSD is not set
1006# CONFIG_SMB_FS is not set
1007# CONFIG_CIFS is not set
1008# CONFIG_NCP_FS is not set
1009# CONFIG_CODA_FS is not set
1010# CONFIG_AFS_FS is not set
1011
1012#
1013# Partition Types
1014#
1015CONFIG_PARTITION_ADVANCED=y
1016# CONFIG_ACORN_PARTITION is not set
1017# CONFIG_OSF_PARTITION is not set
1018# CONFIG_AMIGA_PARTITION is not set
1019# CONFIG_ATARI_PARTITION is not set
1020# CONFIG_MAC_PARTITION is not set
1021CONFIG_MSDOS_PARTITION=y
1022CONFIG_BSD_DISKLABEL=y
1023# CONFIG_MINIX_SUBPARTITION is not set
1024# CONFIG_SOLARIS_X86_PARTITION is not set
1025# CONFIG_UNIXWARE_DISKLABEL is not set
1026# CONFIG_LDM_PARTITION is not set
1027# CONFIG_SGI_PARTITION is not set
1028# CONFIG_ULTRIX_PARTITION is not set
1029# CONFIG_SUN_PARTITION is not set
1030# CONFIG_KARMA_PARTITION is not set
1031# CONFIG_EFI_PARTITION is not set
1032# CONFIG_SYSV68_PARTITION is not set
1033# CONFIG_NLS is not set
1034# CONFIG_DLM is not set
1035
1036#
1037# Kernel hacking
1038#
1039CONFIG_TRACE_IRQFLAGS_SUPPORT=y
1040# CONFIG_PRINTK_TIME is not set
1041CONFIG_ENABLE_WARN_DEPRECATED=y
1042# CONFIG_ENABLE_MUST_CHECK is not set
1043CONFIG_FRAME_WARN=1024
1044# CONFIG_MAGIC_SYSRQ is not set
1045# CONFIG_UNUSED_SYMBOLS is not set
1046CONFIG_DEBUG_FS=y
1047# CONFIG_HEADERS_CHECK is not set
1048# CONFIG_DEBUG_KERNEL is not set
1049# CONFIG_DEBUG_MEMORY_INIT is not set
1050# CONFIG_RCU_CPU_STALL_DETECTOR is not set
1051CONFIG_SYSCTL_SYSCALL_CHECK=y
1052CONFIG_TRACING_SUPPORT=y
1053# CONFIG_FTRACE is not set
1054# CONFIG_DYNAMIC_DEBUG is not set
1055# CONFIG_SAMPLES is not set
1056CONFIG_HAVE_ARCH_KGDB=y
1057CONFIG_CMDLINE="rootfstype=squashfs,jffs2"
1058
1059#
1060# Security options
1061#
1062# CONFIG_KEYS is not set
1063# CONFIG_SECURITY is not set
1064# CONFIG_SECURITYFS is not set
1065# CONFIG_SECURITY_FILE_CAPABILITIES is not set
1066CONFIG_CRYPTO=y
1067
1068#
1069# Crypto core or helper
1070#
1071# CONFIG_CRYPTO_FIPS is not set
1072CONFIG_CRYPTO_ALGAPI=m
1073CONFIG_CRYPTO_ALGAPI2=m
1074CONFIG_CRYPTO_AEAD2=m
1075CONFIG_CRYPTO_BLKCIPHER=m
1076CONFIG_CRYPTO_BLKCIPHER2=m
1077CONFIG_CRYPTO_HASH2=m
1078CONFIG_CRYPTO_RNG2=m
1079CONFIG_CRYPTO_PCOMP=m
1080CONFIG_CRYPTO_MANAGER=m
1081CONFIG_CRYPTO_MANAGER2=m
1082# CONFIG_CRYPTO_GF128MUL is not set
1083# CONFIG_CRYPTO_NULL is not set
1084CONFIG_CRYPTO_WORKQUEUE=m
1085# CONFIG_CRYPTO_CRYPTD is not set
1086# CONFIG_CRYPTO_AUTHENC is not set
1087# CONFIG_CRYPTO_TEST is not set
1088
1089#
1090# Authenticated Encryption with Associated Data
1091#
1092# CONFIG_CRYPTO_CCM is not set
1093# CONFIG_CRYPTO_GCM is not set
1094# CONFIG_CRYPTO_SEQIV is not set
1095
1096#
1097# Block modes
1098#
1099# CONFIG_CRYPTO_CBC is not set
1100# CONFIG_CRYPTO_CTR is not set
1101# CONFIG_CRYPTO_CTS is not set
1102CONFIG_CRYPTO_ECB=m
1103# CONFIG_CRYPTO_LRW is not set
1104# CONFIG_CRYPTO_PCBC is not set
1105# CONFIG_CRYPTO_XTS is not set
1106
1107#
1108# Hash modes
1109#
1110# CONFIG_CRYPTO_HMAC is not set
1111# CONFIG_CRYPTO_XCBC is not set
1112
1113#
1114# Digest
1115#
1116# CONFIG_CRYPTO_CRC32C is not set
1117# CONFIG_CRYPTO_MD4 is not set
1118# CONFIG_CRYPTO_MD5 is not set
1119# CONFIG_CRYPTO_MICHAEL_MIC is not set
1120# CONFIG_CRYPTO_RMD128 is not set
1121# CONFIG_CRYPTO_RMD160 is not set
1122# CONFIG_CRYPTO_RMD256 is not set
1123# CONFIG_CRYPTO_RMD320 is not set
1124# CONFIG_CRYPTO_SHA1 is not set
1125# CONFIG_CRYPTO_SHA256 is not set
1126# CONFIG_CRYPTO_SHA512 is not set
1127# CONFIG_CRYPTO_TGR192 is not set
1128# CONFIG_CRYPTO_WP512 is not set
1129
1130#
1131# Ciphers
1132#
1133CONFIG_CRYPTO_AES=m
1134# CONFIG_CRYPTO_ANUBIS is not set
1135CONFIG_CRYPTO_ARC4=m
1136# CONFIG_CRYPTO_BLOWFISH is not set
1137# CONFIG_CRYPTO_CAMELLIA is not set
1138# CONFIG_CRYPTO_CAST5 is not set
1139# CONFIG_CRYPTO_CAST6 is not set
1140# CONFIG_CRYPTO_DES is not set
1141# CONFIG_CRYPTO_FCRYPT is not set
1142# CONFIG_CRYPTO_KHAZAD is not set
1143# CONFIG_CRYPTO_SALSA20 is not set
1144# CONFIG_CRYPTO_SEED is not set
1145# CONFIG_CRYPTO_SERPENT is not set
1146# CONFIG_CRYPTO_TEA is not set
1147# CONFIG_CRYPTO_TWOFISH is not set
1148
1149#
1150# Compression
1151#
1152# CONFIG_CRYPTO_DEFLATE is not set
1153# CONFIG_CRYPTO_ZLIB is not set
1154# CONFIG_CRYPTO_LZO is not set
1155
1156#
1157# Random Number Generation
1158#
1159# CONFIG_CRYPTO_ANSI_CPRNG is not set
1160# CONFIG_CRYPTO_HW is not set
1161# CONFIG_BINARY_PRINTF is not set
1162
1163#
1164# Library routines
1165#
1166CONFIG_BITREVERSE=y
1167CONFIG_GENERIC_FIND_LAST_BIT=y
1168CONFIG_CRC_CCITT=m
1169# CONFIG_CRC16 is not set
1170# CONFIG_CRC_T10DIF is not set
1171# CONFIG_CRC_ITU_T is not set
1172CONFIG_CRC32=y
1173# CONFIG_CRC7 is not set
1174# CONFIG_LIBCRC32C is not set
1175CONFIG_ZLIB_INFLATE=y
1176CONFIG_ZLIB_DEFLATE=y
1177CONFIG_DECOMPRESS_GZIP=y
1178CONFIG_DECOMPRESS_LZMA=y
1179CONFIG_HAS_IOMEM=y
1180CONFIG_HAS_IOPORT=y
1181CONFIG_HAS_DMA=y
1182CONFIG_NLATTR=y
diff --git a/arch/mips/dec/ecc-berr.c b/arch/mips/dec/ecc-berr.c
index 6a17c9b508ea..7abce661b90f 100644
--- a/arch/mips/dec/ecc-berr.c
+++ b/arch/mips/dec/ecc-berr.c
@@ -1,6 +1,4 @@
1/* 1/*
2 * linux/arch/mips/dec/ecc-berr.c
3 *
4 * Bus error event handling code for systems equipped with ECC 2 * Bus error event handling code for systems equipped with ECC
5 * handling logic, i.e. DECstation/DECsystem 5000/200 (KN02), 3 * handling logic, i.e. DECstation/DECsystem 5000/200 (KN02),
6 * 5000/240 (KN03), 5000/260 (KN05) and DECsystem 5900 (KN03), 4 * 5000/240 (KN03), 5000/260 (KN05) and DECsystem 5900 (KN03),
diff --git a/arch/mips/dec/int-handler.S b/arch/mips/dec/int-handler.S
index 00cecdcc75f2..82c852818781 100644
--- a/arch/mips/dec/int-handler.S
+++ b/arch/mips/dec/int-handler.S
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/mips/dec/int-handler.S
3 *
4 * Copyright (C) 1995, 1996, 1997 Paul M. Antoine and Harald Koerfgen 2 * Copyright (C) 1995, 1996, 1997 Paul M. Antoine and Harald Koerfgen
5 * Copyright (C) 2000, 2001, 2002, 2003, 2005 Maciej W. Rozycki 3 * Copyright (C) 2000, 2001, 2002, 2003, 2005 Maciej W. Rozycki
6 * 4 *
diff --git a/arch/mips/dec/ioasic-irq.c b/arch/mips/dec/ioasic-irq.c
index 3acb133668dc..cb41954fc321 100644
--- a/arch/mips/dec/ioasic-irq.c
+++ b/arch/mips/dec/ioasic-irq.c
@@ -1,6 +1,4 @@
1/* 1/*
2 * linux/arch/mips/dec/ioasic-irq.c
3 *
4 * DEC I/O ASIC interrupts. 2 * DEC I/O ASIC interrupts.
5 * 3 *
6 * Copyright (c) 2002, 2003 Maciej W. Rozycki 4 * Copyright (c) 2002, 2003 Maciej W. Rozycki
diff --git a/arch/mips/dec/kn01-berr.c b/arch/mips/dec/kn01-berr.c
index d3b8002bf1e7..b0dc6d53edd6 100644
--- a/arch/mips/dec/kn01-berr.c
+++ b/arch/mips/dec/kn01-berr.c
@@ -1,6 +1,4 @@
1/* 1/*
2 * linux/arch/mips/dec/kn01-berr.c
3 *
4 * Bus error event handling code for DECstation/DECsystem 3100 2 * Bus error event handling code for DECstation/DECsystem 3100
5 * and 2100 (KN01) systems equipped with parity error detection 3 * and 2100 (KN01) systems equipped with parity error detection
6 * logic. 4 * logic.
diff --git a/arch/mips/dec/kn02-irq.c b/arch/mips/dec/kn02-irq.c
index 02439dc0ba83..ed90a8deabcc 100644
--- a/arch/mips/dec/kn02-irq.c
+++ b/arch/mips/dec/kn02-irq.c
@@ -1,6 +1,4 @@
1/* 1/*
2 * linux/arch/mips/dec/kn02-irq.c
3 *
4 * DECstation 5000/200 (KN02) Control and Status Register 2 * DECstation 5000/200 (KN02) Control and Status Register
5 * interrupts. 3 * interrupts.
6 * 4 *
diff --git a/arch/mips/dec/kn02xa-berr.c b/arch/mips/dec/kn02xa-berr.c
index 5f04545c3606..07ca5405d48d 100644
--- a/arch/mips/dec/kn02xa-berr.c
+++ b/arch/mips/dec/kn02xa-berr.c
@@ -1,6 +1,4 @@
1/* 1/*
2 * linux/arch/mips/dec/kn02xa-berr.c
3 *
4 * Bus error event handling code for 5000-series systems equipped 2 * Bus error event handling code for 5000-series systems equipped
5 * with parity error detection logic, i.e. DECstation/DECsystem 3 * with parity error detection logic, i.e. DECstation/DECsystem
6 * 5000/120, /125, /133 (KN02-BA), 5000/150 (KN04-BA) and Personal 4 * 5000/120, /125, /133 (KN02-BA), 5000/150 (KN04-BA) and Personal
diff --git a/arch/mips/dec/prom/call_o32.S b/arch/mips/dec/prom/call_o32.S
index e523454bda3a..8c8498159e43 100644
--- a/arch/mips/dec/prom/call_o32.S
+++ b/arch/mips/dec/prom/call_o32.S
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/mips/dec/prom/call_o32.S
3 *
4 * O32 interface for the 64 (or N32) ABI. 2 * O32 interface for the 64 (or N32) ABI.
5 * 3 *
6 * Copyright (C) 2002 Maciej W. Rozycki 4 * Copyright (C) 2002 Maciej W. Rozycki
diff --git a/arch/mips/dec/prom/console.c b/arch/mips/dec/prom/console.c
index 078e1a12421d..caa6e047caf1 100644
--- a/arch/mips/dec/prom/console.c
+++ b/arch/mips/dec/prom/console.c
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/mips/dec/prom/console.c
3 *
4 * DECstation PROM-based early console support. 2 * DECstation PROM-based early console support.
5 * 3 *
6 * Copyright (C) 2004, 2007 Maciej W. Rozycki 4 * Copyright (C) 2004, 2007 Maciej W. Rozycki
diff --git a/arch/mips/dec/time.c b/arch/mips/dec/time.c
index 1359c03ded51..463136e6685a 100644
--- a/arch/mips/dec/time.c
+++ b/arch/mips/dec/time.c
@@ -1,6 +1,4 @@
1/* 1/*
2 * linux/arch/mips/dec/time.c
3 *
4 * Copyright (C) 1991, 1992, 1995 Linus Torvalds 2 * Copyright (C) 1991, 1992, 1995 Linus Torvalds
5 * Copyright (C) 2000, 2003 Maciej W. Rozycki 3 * Copyright (C) 2000, 2003 Maciej W. Rozycki
6 * 4 *
diff --git a/arch/mips/emma/common/Makefile b/arch/mips/emma/common/Makefile
index c392d28c1ef1..f27d84d1904f 100644
--- a/arch/mips/emma/common/Makefile
+++ b/arch/mips/emma/common/Makefile
@@ -1,7 +1,4 @@
1# 1#
2# arch/mips/emma2rh/common/Makefile
3# Makefile for the common code of NEC EMMA2RH based board.
4#
5# Copyright (C) NEC Electronics Corporation 2005-2006 2# Copyright (C) NEC Electronics Corporation 2005-2006
6# 3#
7# This program is free software; you can redistribute it and/or modify 4# This program is free software; you can redistribute it and/or modify
diff --git a/arch/mips/emma/common/prom.c b/arch/mips/emma/common/prom.c
index 120f53fbdb45..708f08761406 100644
--- a/arch/mips/emma/common/prom.c
+++ b/arch/mips/emma/common/prom.c
@@ -1,7 +1,4 @@
1/* 1/*
2 * arch/mips/emma2rh/common/prom.c
3 * This file is prom file.
4 *
5 * Copyright (C) NEC Electronics Corporation 2004-2006 2 * Copyright (C) NEC Electronics Corporation 2004-2006
6 * 3 *
7 * This file is based on the arch/mips/ddb5xxx/common/prom.c 4 * This file is based on the arch/mips/ddb5xxx/common/prom.c
diff --git a/arch/mips/emma/markeins/Makefile b/arch/mips/emma/markeins/Makefile
index 16e0017ba919..f8ba2508fa2b 100644
--- a/arch/mips/emma/markeins/Makefile
+++ b/arch/mips/emma/markeins/Makefile
@@ -1,7 +1,4 @@
1# 1#
2# arch/mips/emma2rh/markeins/Makefile
3# Makefile for the common code of NEC EMMA2RH based board.
4#
5# Copyright (C) NEC Electronics Corporation 2005-2006 2# Copyright (C) NEC Electronics Corporation 2005-2006
6# 3#
7# This program is free software; you can redistribute it and/or modify 4# This program is free software; you can redistribute it and/or modify
diff --git a/arch/mips/emma/markeins/irq.c b/arch/mips/emma/markeins/irq.c
index 43828ae796ec..9504b7ee0b7c 100644
--- a/arch/mips/emma/markeins/irq.c
+++ b/arch/mips/emma/markeins/irq.c
@@ -1,7 +1,4 @@
1/* 1/*
2 * arch/mips/emma2rh/markeins/irq.c
3 * This file defines the irq handler for EMMA2RH.
4 *
5 * Copyright (C) NEC Electronics Corporation 2004-2006 2 * Copyright (C) NEC Electronics Corporation 2004-2006
6 * 3 *
7 * This file is based on the arch/mips/ddb5xxx/ddb5477/irq.c 4 * This file is based on the arch/mips/ddb5xxx/ddb5477/irq.c
diff --git a/arch/mips/emma/markeins/led.c b/arch/mips/emma/markeins/led.c
index 377a181b6561..49755896857f 100644
--- a/arch/mips/emma/markeins/led.c
+++ b/arch/mips/emma/markeins/led.c
@@ -1,7 +1,4 @@
1/* 1/*
2 * arch/mips/emma2rh/markeins/led.c
3 * This file defines the led display for Mark-eins.
4 *
5 * Copyright (C) NEC Electronics Corporation 2004-2006 2 * Copyright (C) NEC Electronics Corporation 2004-2006
6 * 3 *
7 * This program is free software; you can redistribute it and/or modify 4 * This program is free software; you can redistribute it and/or modify
diff --git a/arch/mips/emma/markeins/platform.c b/arch/mips/emma/markeins/platform.c
index 80ae12ef87db..b05b08b92a34 100644
--- a/arch/mips/emma/markeins/platform.c
+++ b/arch/mips/emma/markeins/platform.c
@@ -1,7 +1,4 @@
1/* 1/*
2 * arch/mips/emma2rh/markeins/platofrm.c
3 * This file sets up platform devices for EMMA2RH Mark-eins.
4 *
5 * Copyright(C) MontaVista Software Inc, 2006 2 * Copyright(C) MontaVista Software Inc, 2006
6 * 3 *
7 * Author: dmitry pervushin <dpervushin@ru.mvista.com> 4 * Author: dmitry pervushin <dpervushin@ru.mvista.com>
diff --git a/arch/mips/emma/markeins/setup.c b/arch/mips/emma/markeins/setup.c
index 67f456500084..335dc8c1a1bb 100644
--- a/arch/mips/emma/markeins/setup.c
+++ b/arch/mips/emma/markeins/setup.c
@@ -1,7 +1,4 @@
1/* 1/*
2 * arch/mips/emma2rh/markeins/setup.c
3 * This file is setup for EMMA2RH Mark-eins.
4 *
5 * Copyright (C) NEC Electronics Corporation 2004-2006 2 * Copyright (C) NEC Electronics Corporation 2004-2006
6 * 3 *
7 * This file is based on the arch/mips/ddb5xxx/ddb5477/setup.c. 4 * This file is based on the arch/mips/ddb5xxx/ddb5477/setup.c.
diff --git a/arch/mips/fw/lib/call_o32.S b/arch/mips/fw/lib/call_o32.S
index bdf7d1d4081a..e0a68713b3c3 100644
--- a/arch/mips/fw/lib/call_o32.S
+++ b/arch/mips/fw/lib/call_o32.S
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/mips/dec/prom/call_o32.S
3 *
4 * O32 interface for the 64 (or N32) ABI. 2 * O32 interface for the 64 (or N32) ABI.
5 * 3 *
6 * Copyright (C) 2002 Maciej W. Rozycki 4 * Copyright (C) 2002 Maciej W. Rozycki
diff --git a/arch/mips/gt64120/wrppmc/serial.c b/arch/mips/gt64120/wrppmc/serial.c
index 5ec1c2ffd3a5..6f9d0858f596 100644
--- a/arch/mips/gt64120/wrppmc/serial.c
+++ b/arch/mips/gt64120/wrppmc/serial.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * Registration of WRPPMC UART platform device. 2 * Registration of WRPPMC UART platform device.
3 * 3 *
4 * Copyright (C) 2007 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> 4 * Copyright (C) 2007 Yoichi Yuasa <yuasa@linux-mips.org>
5 * 5 *
6 * This program is free software; you can redistribute it and/or modify 6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by 7 * it under the terms of the GNU General Public License as published by
diff --git a/arch/mips/include/asm/amon.h b/arch/mips/include/asm/amon.h
new file mode 100644
index 000000000000..c3dc1a68dd8d
--- /dev/null
+++ b/arch/mips/include/asm/amon.h
@@ -0,0 +1,7 @@
1/*
2 * Amon support
3 */
4
5int amon_cpu_avail(int);
6void amon_cpu_start(int, unsigned long, unsigned long,
7 unsigned long, unsigned long);
diff --git a/arch/mips/include/asm/ds1287.h b/arch/mips/include/asm/ds1287.h
index ba1702e86931..3af0b8fb3b8c 100644
--- a/arch/mips/include/asm/ds1287.h
+++ b/arch/mips/include/asm/ds1287.h
@@ -1,7 +1,7 @@
1/* 1/*
2 * DS1287 timer functions. 2 * DS1287 timer functions.
3 * 3 *
4 * Copyright (C) 2008 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> 4 * Copyright (C) 2008 Yoichi Yuasa <yuasa@linux-mips.org>
5 * 5 *
6 * This program is free software; you can redistribute it and/or modify 6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by 7 * it under the terms of the GNU General Public License as published by
diff --git a/arch/mips/include/asm/elf.h b/arch/mips/include/asm/elf.h
index d58f128aa747..7990694cda22 100644
--- a/arch/mips/include/asm/elf.h
+++ b/arch/mips/include/asm/elf.h
@@ -316,9 +316,13 @@ extern void elf_dump_regs(elf_greg_t *, struct pt_regs *regs);
316extern int dump_task_regs(struct task_struct *, elf_gregset_t *); 316extern int dump_task_regs(struct task_struct *, elf_gregset_t *);
317extern int dump_task_fpu(struct task_struct *, elf_fpregset_t *); 317extern int dump_task_fpu(struct task_struct *, elf_fpregset_t *);
318 318
319#ifndef ELF_CORE_COPY_REGS
319#define ELF_CORE_COPY_REGS(elf_regs, regs) \ 320#define ELF_CORE_COPY_REGS(elf_regs, regs) \
320 elf_dump_regs((elf_greg_t *)&(elf_regs), regs); 321 elf_dump_regs((elf_greg_t *)&(elf_regs), regs);
322#endif
323#ifndef ELF_CORE_COPY_TASK_REGS
321#define ELF_CORE_COPY_TASK_REGS(tsk, elf_regs) dump_task_regs(tsk, elf_regs) 324#define ELF_CORE_COPY_TASK_REGS(tsk, elf_regs) dump_task_regs(tsk, elf_regs)
325#endif
322#define ELF_CORE_COPY_FPREGS(tsk, elf_fpregs) \ 326#define ELF_CORE_COPY_FPREGS(tsk, elf_fpregs) \
323 dump_task_fpu(tsk, elf_fpregs) 327 dump_task_fpu(tsk, elf_fpregs)
324 328
diff --git a/arch/mips/include/asm/emma/emma2rh.h b/arch/mips/include/asm/emma/emma2rh.h
index 30aea91de626..2afb2fe11b30 100644
--- a/arch/mips/include/asm/emma/emma2rh.h
+++ b/arch/mips/include/asm/emma/emma2rh.h
@@ -1,7 +1,4 @@
1/* 1/*
2 * arch/mips/include/asm/emma/emma2rh.h
3 * This file is EMMA2RH common header.
4 *
5 * Copyright (C) NEC Electronics Corporation 2005-2006 2 * Copyright (C) NEC Electronics Corporation 2005-2006
6 * 3 *
7 * This file based on include/asm-mips/ddb5xxx/ddb5xxx.h 4 * This file based on include/asm-mips/ddb5xxx/ddb5xxx.h
diff --git a/arch/mips/include/asm/emma/markeins.h b/arch/mips/include/asm/emma/markeins.h
index 973b0628490d..2618bf230248 100644
--- a/arch/mips/include/asm/emma/markeins.h
+++ b/arch/mips/include/asm/emma/markeins.h
@@ -1,7 +1,4 @@
1/* 1/*
2 * include/asm-mips/emma2rh/markeins.h
3 * This file is EMMA2RH board depended header.
4 *
5 * Copyright (C) NEC Electronics Corporation 2005-2006 2 * Copyright (C) NEC Electronics Corporation 2005-2006
6 * 3 *
7 * This file based on include/asm-mips/ddb5xxx/ddb5xxx.h 4 * This file based on include/asm-mips/ddb5xxx/ddb5xxx.h
diff --git a/arch/mips/include/asm/gcmpregs.h b/arch/mips/include/asm/gcmpregs.h
index d74a8a4ca861..36fd969d64d6 100644
--- a/arch/mips/include/asm/gcmpregs.h
+++ b/arch/mips/include/asm/gcmpregs.h
@@ -114,4 +114,6 @@
114#define GCMP_CCB_DINTGROUP_OFS 0x0030 /* DINT Group Participate */ 114#define GCMP_CCB_DINTGROUP_OFS 0x0030 /* DINT Group Participate */
115#define GCMP_CCB_DBGGROUP_OFS 0x0100 /* DebugBreak Group */ 115#define GCMP_CCB_DBGGROUP_OFS 0x0100 /* DebugBreak Group */
116 116
117extern int __init gcmp_probe(unsigned long, unsigned long);
118
117#endif /* _ASM_GCMPREGS_H */ 119#endif /* _ASM_GCMPREGS_H */
diff --git a/arch/mips/include/asm/gic.h b/arch/mips/include/asm/gic.h
index 954807d9d66a..a8f57341f123 100644
--- a/arch/mips/include/asm/gic.h
+++ b/arch/mips/include/asm/gic.h
@@ -20,7 +20,11 @@
20#define GIC_TRIG_EDGE 1 20#define GIC_TRIG_EDGE 1
21#define GIC_TRIG_LEVEL 0 21#define GIC_TRIG_LEVEL 0
22 22
23#ifdef CONFIG_SMP
24#define GIC_NUM_INTRS (24 + NR_CPUS * 2)
25#else
23#define GIC_NUM_INTRS 32 26#define GIC_NUM_INTRS 32
27#endif
24 28
25#define MSK(n) ((1 << (n)) - 1) 29#define MSK(n) ((1 << (n)) - 1)
26#define REG32(addr) (*(volatile unsigned int *) (addr)) 30#define REG32(addr) (*(volatile unsigned int *) (addr))
@@ -483,5 +487,7 @@ extern void gic_init(unsigned long gic_base_addr,
483 487
484extern unsigned int gic_get_int(void); 488extern unsigned int gic_get_int(void);
485extern void gic_send_ipi(unsigned int intr); 489extern void gic_send_ipi(unsigned int intr);
490extern unsigned int plat_ipi_call_int_xlate(unsigned int);
491extern unsigned int plat_ipi_resched_int_xlate(unsigned int);
486 492
487#endif /* _ASM_GICREGS_H */ 493#endif /* _ASM_GICREGS_H */
diff --git a/arch/mips/include/asm/irq_gt641xx.h b/arch/mips/include/asm/irq_gt641xx.h
index f9a7c3ac2e66..250a2407b599 100644
--- a/arch/mips/include/asm/irq_gt641xx.h
+++ b/arch/mips/include/asm/irq_gt641xx.h
@@ -1,7 +1,7 @@
1/* 1/*
2 * Galileo/Marvell GT641xx IRQ definitions. 2 * Galileo/Marvell GT641xx IRQ definitions.
3 * 3 *
4 * Copyright (C) 2007 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> 4 * Copyright (C) 2007 Yoichi Yuasa <yuasa@linux-mips.org>
5 * 5 *
6 * This program is free software; you can redistribute it and/or modify 6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by 7 * it under the terms of the GNU General Public License as published by
diff --git a/arch/mips/include/asm/mach-ar7/ar7.h b/arch/mips/include/asm/mach-ar7/ar7.h
new file mode 100644
index 000000000000..de71694614de
--- /dev/null
+++ b/arch/mips/include/asm/mach-ar7/ar7.h
@@ -0,0 +1,178 @@
1/*
2 * Copyright (C) 2006,2007 Felix Fietkau <nbd@openwrt.org>
3 * Copyright (C) 2006,2007 Eugene Konev <ejka@openwrt.org>
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18 */
19
20#ifndef __AR7_H__
21#define __AR7_H__
22
23#include <linux/delay.h>
24#include <linux/io.h>
25#include <linux/errno.h>
26
27#include <asm/addrspace.h>
28
29#define AR7_SDRAM_BASE 0x14000000
30
31#define AR7_REGS_BASE 0x08610000
32
33#define AR7_REGS_MAC0 (AR7_REGS_BASE + 0x0000)
34#define AR7_REGS_GPIO (AR7_REGS_BASE + 0x0900)
35/* 0x08610A00 - 0x08610BFF (512 bytes, 128 bytes / clock) */
36#define AR7_REGS_POWER (AR7_REGS_BASE + 0x0a00)
37#define AR7_REGS_CLOCKS (AR7_REGS_POWER + 0x80)
38#define UR8_REGS_CLOCKS (AR7_REGS_POWER + 0x20)
39#define AR7_REGS_UART0 (AR7_REGS_BASE + 0x0e00)
40#define AR7_REGS_USB (AR7_REGS_BASE + 0x1200)
41#define AR7_REGS_RESET (AR7_REGS_BASE + 0x1600)
42#define AR7_REGS_VLYNQ0 (AR7_REGS_BASE + 0x1800)
43#define AR7_REGS_DCL (AR7_REGS_BASE + 0x1a00)
44#define AR7_REGS_VLYNQ1 (AR7_REGS_BASE + 0x1c00)
45#define AR7_REGS_MDIO (AR7_REGS_BASE + 0x1e00)
46#define AR7_REGS_IRQ (AR7_REGS_BASE + 0x2400)
47#define AR7_REGS_MAC1 (AR7_REGS_BASE + 0x2800)
48
49#define AR7_REGS_WDT (AR7_REGS_BASE + 0x1f00)
50#define UR8_REGS_WDT (AR7_REGS_BASE + 0x0b00)
51#define UR8_REGS_UART1 (AR7_REGS_BASE + 0x0f00)
52
53#define AR7_RESET_PEREPHERIAL 0x0
54#define AR7_RESET_SOFTWARE 0x4
55#define AR7_RESET_STATUS 0x8
56
57#define AR7_RESET_BIT_CPMAC_LO 17
58#define AR7_RESET_BIT_CPMAC_HI 21
59#define AR7_RESET_BIT_MDIO 22
60#define AR7_RESET_BIT_EPHY 26
61
62/* GPIO control registers */
63#define AR7_GPIO_INPUT 0x0
64#define AR7_GPIO_OUTPUT 0x4
65#define AR7_GPIO_DIR 0x8
66#define AR7_GPIO_ENABLE 0xc
67
68#define AR7_CHIP_7100 0x18
69#define AR7_CHIP_7200 0x2b
70#define AR7_CHIP_7300 0x05
71
72/* Interrupts */
73#define AR7_IRQ_UART0 15
74#define AR7_IRQ_UART1 16
75
76/* Clocks */
77#define AR7_AFE_CLOCK 35328000
78#define AR7_REF_CLOCK 25000000
79#define AR7_XTAL_CLOCK 24000000
80
81struct plat_cpmac_data {
82 int reset_bit;
83 int power_bit;
84 u32 phy_mask;
85 char dev_addr[6];
86};
87
88struct plat_dsl_data {
89 int reset_bit_dsl;
90 int reset_bit_sar;
91};
92
93extern int ar7_cpu_clock, ar7_bus_clock, ar7_dsp_clock;
94
95static inline u16 ar7_chip_id(void)
96{
97 return readl((void *)KSEG1ADDR(AR7_REGS_GPIO + 0x14)) & 0xffff;
98}
99
100static inline u8 ar7_chip_rev(void)
101{
102 return (readl((void *)KSEG1ADDR(AR7_REGS_GPIO + 0x14)) >> 16) & 0xff;
103}
104
105static inline int ar7_cpu_freq(void)
106{
107 return ar7_cpu_clock;
108}
109
110static inline int ar7_bus_freq(void)
111{
112 return ar7_bus_clock;
113}
114
115static inline int ar7_vbus_freq(void)
116{
117 return ar7_bus_clock / 2;
118}
119#define ar7_cpmac_freq ar7_vbus_freq
120
121static inline int ar7_dsp_freq(void)
122{
123 return ar7_dsp_clock;
124}
125
126static inline int ar7_has_high_cpmac(void)
127{
128 u16 chip_id = ar7_chip_id();
129 switch (chip_id) {
130 case AR7_CHIP_7100:
131 case AR7_CHIP_7200:
132 return 0;
133 case AR7_CHIP_7300:
134 return 1;
135 default:
136 return -ENXIO;
137 }
138}
139#define ar7_has_high_vlynq ar7_has_high_cpmac
140#define ar7_has_second_uart ar7_has_high_cpmac
141
142static inline void ar7_device_enable(u32 bit)
143{
144 void *reset_reg =
145 (void *)KSEG1ADDR(AR7_REGS_RESET + AR7_RESET_PEREPHERIAL);
146 writel(readl(reset_reg) | (1 << bit), reset_reg);
147 msleep(20);
148}
149
150static inline void ar7_device_disable(u32 bit)
151{
152 void *reset_reg =
153 (void *)KSEG1ADDR(AR7_REGS_RESET + AR7_RESET_PEREPHERIAL);
154 writel(readl(reset_reg) & ~(1 << bit), reset_reg);
155 msleep(20);
156}
157
158static inline void ar7_device_reset(u32 bit)
159{
160 ar7_device_disable(bit);
161 ar7_device_enable(bit);
162}
163
164static inline void ar7_device_on(u32 bit)
165{
166 void *power_reg = (void *)KSEG1ADDR(AR7_REGS_POWER);
167 writel(readl(power_reg) | (1 << bit), power_reg);
168 msleep(20);
169}
170
171static inline void ar7_device_off(u32 bit)
172{
173 void *power_reg = (void *)KSEG1ADDR(AR7_REGS_POWER);
174 writel(readl(power_reg) & ~(1 << bit), power_reg);
175 msleep(20);
176}
177
178#endif /* __AR7_H__ */
diff --git a/arch/mips/include/asm/mach-ar7/gpio.h b/arch/mips/include/asm/mach-ar7/gpio.h
new file mode 100644
index 000000000000..cbe9c4f126df
--- /dev/null
+++ b/arch/mips/include/asm/mach-ar7/gpio.h
@@ -0,0 +1,110 @@
1/*
2 * Copyright (C) 2007 Florian Fainelli <florian@openwrt.org>
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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
17 */
18
19#ifndef __AR7_GPIO_H__
20#define __AR7_GPIO_H__
21
22#include <asm/mach-ar7/ar7.h>
23
24#define AR7_GPIO_MAX 32
25
26extern int gpio_request(unsigned gpio, const char *label);
27extern void gpio_free(unsigned gpio);
28
29/* Common GPIO layer */
30static inline int gpio_get_value(unsigned gpio)
31{
32 void __iomem *gpio_in =
33 (void __iomem *)KSEG1ADDR(AR7_REGS_GPIO + AR7_GPIO_INPUT);
34
35 return readl(gpio_in) & (1 << gpio);
36}
37
38static inline void gpio_set_value(unsigned gpio, int value)
39{
40 void __iomem *gpio_out =
41 (void __iomem *)KSEG1ADDR(AR7_REGS_GPIO + AR7_GPIO_OUTPUT);
42 unsigned tmp;
43
44 tmp = readl(gpio_out) & ~(1 << gpio);
45 if (value)
46 tmp |= 1 << gpio;
47 writel(tmp, gpio_out);
48}
49
50static inline int gpio_direction_input(unsigned gpio)
51{
52 void __iomem *gpio_dir =
53 (void __iomem *)KSEG1ADDR(AR7_REGS_GPIO + AR7_GPIO_DIR);
54
55 if (gpio >= AR7_GPIO_MAX)
56 return -EINVAL;
57
58 writel(readl(gpio_dir) | (1 << gpio), gpio_dir);
59
60 return 0;
61}
62
63static inline int gpio_direction_output(unsigned gpio, int value)
64{
65 void __iomem *gpio_dir =
66 (void __iomem *)KSEG1ADDR(AR7_REGS_GPIO + AR7_GPIO_DIR);
67
68 if (gpio >= AR7_GPIO_MAX)
69 return -EINVAL;
70
71 gpio_set_value(gpio, value);
72 writel(readl(gpio_dir) & ~(1 << gpio), gpio_dir);
73
74 return 0;
75}
76
77static inline int gpio_to_irq(unsigned gpio)
78{
79 return -EINVAL;
80}
81
82static inline int irq_to_gpio(unsigned irq)
83{
84 return -EINVAL;
85}
86
87/* Board specific GPIO functions */
88static inline int ar7_gpio_enable(unsigned gpio)
89{
90 void __iomem *gpio_en =
91 (void __iomem *)KSEG1ADDR(AR7_REGS_GPIO + AR7_GPIO_ENABLE);
92
93 writel(readl(gpio_en) | (1 << gpio), gpio_en);
94
95 return 0;
96}
97
98static inline int ar7_gpio_disable(unsigned gpio)
99{
100 void __iomem *gpio_en =
101 (void __iomem *)KSEG1ADDR(AR7_REGS_GPIO + AR7_GPIO_ENABLE);
102
103 writel(readl(gpio_en) & ~(1 << gpio), gpio_en);
104
105 return 0;
106}
107
108#include <asm-generic/gpio.h>
109
110#endif
diff --git a/arch/mips/include/asm/mach-ar7/irq.h b/arch/mips/include/asm/mach-ar7/irq.h
new file mode 100644
index 000000000000..39e9757e3d93
--- /dev/null
+++ b/arch/mips/include/asm/mach-ar7/irq.h
@@ -0,0 +1,16 @@
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 * Shamelessly copied from asm-mips/mach-emma2rh/
7 * Copyright (C) 2003 by Ralf Baechle
8 */
9#ifndef __ASM_AR7_IRQ_H
10#define __ASM_AR7_IRQ_H
11
12#define NR_IRQS 256
13
14#include_next <irq.h>
15
16#endif /* __ASM_AR7_IRQ_H */
diff --git a/arch/mips/include/asm/mach-ar7/prom.h b/arch/mips/include/asm/mach-ar7/prom.h
new file mode 100644
index 000000000000..088f61fe85ea
--- /dev/null
+++ b/arch/mips/include/asm/mach-ar7/prom.h
@@ -0,0 +1,25 @@
1/*
2 * Copyright (C) 2006, 2007 Florian Fainelli <florian@openwrt.org>
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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
17 */
18
19#ifndef __PROM_H__
20#define __PROM_H__
21
22extern char *prom_getenv(const char *name);
23extern void prom_meminit(void);
24
25#endif /* __PROM_H__ */
diff --git a/arch/mips/include/asm/mach-ar7/spaces.h b/arch/mips/include/asm/mach-ar7/spaces.h
new file mode 100644
index 000000000000..ac28f273449c
--- /dev/null
+++ b/arch/mips/include/asm/mach-ar7/spaces.h
@@ -0,0 +1,22 @@
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) 1994 - 1999, 2000, 03, 04 Ralf Baechle
7 * Copyright (C) 2000, 2002 Maciej W. Rozycki
8 * Copyright (C) 1990, 1999, 2000 Silicon Graphics, Inc.
9 */
10#ifndef _ASM_AR7_SPACES_H
11#define _ASM_AR7_SPACES_H
12
13/*
14 * This handles the memory map.
15 * We handle pages at KSEG0 for kernels with 32 bit address space.
16 */
17#define PAGE_OFFSET 0x94000000UL
18#define PHYS_OFFSET 0x14000000UL
19
20#include <asm/mach-generic/spaces.h>
21
22#endif /* __ASM_AR7_SPACES_H */
diff --git a/arch/mips/include/asm/mach-ar7/war.h b/arch/mips/include/asm/mach-ar7/war.h
new file mode 100644
index 000000000000..f4862b563080
--- /dev/null
+++ b/arch/mips/include/asm/mach-ar7/war.h
@@ -0,0 +1,25 @@
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) 2002, 2004, 2007 by Ralf Baechle <ralf@linux-mips.org>
7 */
8#ifndef __ASM_MIPS_MACH_AR7_WAR_H
9#define __ASM_MIPS_MACH_AR7_WAR_H
10
11#define R4600_V1_INDEX_ICACHEOP_WAR 0
12#define R4600_V1_HIT_CACHEOP_WAR 0
13#define R4600_V2_HIT_CACHEOP_WAR 0
14#define R5432_CP0_INTERRUPT_WAR 0
15#define BCM1250_M3_WAR 0
16#define SIBYTE_1956_WAR 0
17#define MIPS4K_ICACHE_REFILL_WAR 0
18#define MIPS_CACHE_SYNC_WAR 0
19#define TX49XX_ICACHE_INDEX_INV_WAR 0
20#define RM9000_CDEX_SMP_WAR 0
21#define ICACHE_REFILLS_WORKAROUND_WAR 0
22#define R10000_LLSC_WAR 0
23#define MIPS34K_MISSED_ITLB_WAR 0
24
25#endif /* __ASM_MIPS_MACH_AR7_WAR_H */
diff --git a/arch/mips/include/asm/mach-cobalt/irq.h b/arch/mips/include/asm/mach-cobalt/irq.h
index 57c8c9ac5851..9da9acf5dcba 100644
--- a/arch/mips/include/asm/mach-cobalt/irq.h
+++ b/arch/mips/include/asm/mach-cobalt/irq.h
@@ -8,7 +8,7 @@
8 * Copyright (C) 1997 Cobalt Microserver 8 * Copyright (C) 1997 Cobalt Microserver
9 * Copyright (C) 1997, 2003 Ralf Baechle 9 * Copyright (C) 1997, 2003 Ralf Baechle
10 * Copyright (C) 2001-2003 Liam Davies (ldavies@agile.tv) 10 * Copyright (C) 2001-2003 Liam Davies (ldavies@agile.tv)
11 * Copyright (C) 2007 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> 11 * Copyright (C) 2007 Yoichi Yuasa <yuasa@linux-mips.org>
12 */ 12 */
13#ifndef _ASM_COBALT_IRQ_H 13#ifndef _ASM_COBALT_IRQ_H
14#define _ASM_COBALT_IRQ_H 14#define _ASM_COBALT_IRQ_H
diff --git a/arch/mips/include/asm/mach-cobalt/mach-gt64120.h b/arch/mips/include/asm/mach-cobalt/mach-gt64120.h
index ae9c5523c7ef..f8afec3f2943 100644
--- a/arch/mips/include/asm/mach-cobalt/mach-gt64120.h
+++ b/arch/mips/include/asm/mach-cobalt/mach-gt64120.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (C) 2006 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> 2 * Copyright (C) 2006 Yoichi Yuasa <yuasa@linux-mips.org>
3 * 3 *
4 * This program is free software; you can redistribute it and/or modify 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 5 * it under the terms of the GNU General Public License as published by
diff --git a/arch/mips/cavium-octeon/pci-common.h b/arch/mips/include/asm/octeon/pci-octeon.h
index 74ae79991e45..6ac5d3e3398e 100644
--- a/arch/mips/cavium-octeon/pci-common.h
+++ b/arch/mips/include/asm/octeon/pci-octeon.h
@@ -3,23 +3,29 @@
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) 2005-2007 Cavium Networks 6 * Copyright (C) 2005-2009 Cavium Networks
7 */ 7 */
8#ifndef __OCTEON_PCI_COMMON_H__ 8
9#define __OCTEON_PCI_COMMON_H__ 9#ifndef __PCI_OCTEON_H__
10#define __PCI_OCTEON_H__
10 11
11#include <linux/pci.h> 12#include <linux/pci.h>
12 13
13/* Some PCI cards require delays when accessing config space. */ 14/* Some PCI cards require delays when accessing config space. */
14#define PCI_CONFIG_SPACE_DELAY 10000 15#define PCI_CONFIG_SPACE_DELAY 10000
15 16
16/* pcibios_map_irq() is defined inside pci-common.c. All it does is call the 17/*
17 Octeon specific version pointed to by this variable. This function needs to 18 * pcibios_map_irq() is defined inside pci-octeon.c. All it does is
18 change for PCI or PCIe based hosts */ 19 * call the Octeon specific version pointed to by this variable. This
19extern typeof(pcibios_map_irq) *octeon_pcibios_map_irq; 20 * function needs to change for PCI or PCIe based hosts.
21 */
22extern int (*octeon_pcibios_map_irq)(const struct pci_dev *dev,
23 u8 slot, u8 pin);
20 24
21/* The following defines are only used when octeon_dma_bar_type = 25/*
22 OCTEON_DMA_BAR_TYPE_BIG */ 26 * The following defines are used when octeon_dma_bar_type =
27 * OCTEON_DMA_BAR_TYPE_BIG
28 */
23#define OCTEON_PCI_BAR1_HOLE_BITS 5 29#define OCTEON_PCI_BAR1_HOLE_BITS 5
24#define OCTEON_PCI_BAR1_HOLE_SIZE (1ul<<(OCTEON_PCI_BAR1_HOLE_BITS+3)) 30#define OCTEON_PCI_BAR1_HOLE_SIZE (1ul<<(OCTEON_PCI_BAR1_HOLE_BITS+3))
25 31
@@ -30,9 +36,9 @@ enum octeon_dma_bar_type {
30 OCTEON_DMA_BAR_TYPE_PCIE 36 OCTEON_DMA_BAR_TYPE_PCIE
31}; 37};
32 38
33/** 39/*
34 * This is a variable to tell the DMA mapping system in dma-octeon.c 40 * This tells the DMA mapping system in dma-octeon.c how to map PCI
35 * how to map PCI DMA addresses. 41 * DMA addresses.
36 */ 42 */
37extern enum octeon_dma_bar_type octeon_dma_bar_type; 43extern enum octeon_dma_bar_type octeon_dma_bar_type;
38 44
diff --git a/arch/mips/include/asm/page.h b/arch/mips/include/asm/page.h
index dc0eaa731281..96a14a426a7c 100644
--- a/arch/mips/include/asm/page.h
+++ b/arch/mips/include/asm/page.h
@@ -165,7 +165,14 @@ typedef struct { unsigned long pgprot; } pgprot_t;
165 165
166#ifdef CONFIG_FLATMEM 166#ifdef CONFIG_FLATMEM
167 167
168#define pfn_valid(pfn) ((pfn) >= ARCH_PFN_OFFSET && (pfn) < max_mapnr) 168#define pfn_valid(pfn) \
169({ \
170 unsigned long __pfn = (pfn); \
171 /* avoid <linux/bootmem.h> include hell */ \
172 extern unsigned long min_low_pfn; \
173 \
174 __pfn >= min_low_pfn && __pfn < max_mapnr; \
175})
169 176
170#elif defined(CONFIG_SPARSEMEM) 177#elif defined(CONFIG_SPARSEMEM)
171 178
diff --git a/arch/mips/include/asm/pgalloc.h b/arch/mips/include/asm/pgalloc.h
index 1275831dda29..3738f4b48cbd 100644
--- a/arch/mips/include/asm/pgalloc.h
+++ b/arch/mips/include/asm/pgalloc.h
@@ -98,23 +98,12 @@ static inline void pte_free(struct mm_struct *mm, pgtable_t pte)
98 __free_pages(pte, PTE_ORDER); 98 __free_pages(pte, PTE_ORDER);
99} 99}
100 100
101#define __pte_free_tlb(tlb,pte) \ 101#define __pte_free_tlb(tlb,pte,address) \
102do { \ 102do { \
103 pgtable_page_dtor(pte); \ 103 pgtable_page_dtor(pte); \
104 tlb_remove_page((tlb), pte); \ 104 tlb_remove_page((tlb), pte); \
105} while (0) 105} while (0)
106 106
107#ifdef CONFIG_32BIT
108
109/*
110 * allocating and freeing a pmd is trivial: the 1-entry pmd is
111 * inside the pgd, so has no extra memory associated with it.
112 */
113#define pmd_free(mm, x) do { } while (0)
114#define __pmd_free_tlb(tlb, x) do { } while (0)
115
116#endif
117
118#ifdef CONFIG_64BIT 107#ifdef CONFIG_64BIT
119 108
120static inline pmd_t *pmd_alloc_one(struct mm_struct *mm, unsigned long address) 109static inline pmd_t *pmd_alloc_one(struct mm_struct *mm, unsigned long address)
@@ -132,7 +121,7 @@ static inline void pmd_free(struct mm_struct *mm, pmd_t *pmd)
132 free_pages((unsigned long)pmd, PMD_ORDER); 121 free_pages((unsigned long)pmd, PMD_ORDER);
133} 122}
134 123
135#define __pmd_free_tlb(tlb, x) pmd_free((tlb)->mm, x) 124#define __pmd_free_tlb(tlb, x, addr) pmd_free((tlb)->mm, x)
136 125
137#endif 126#endif
138 127
diff --git a/arch/mips/include/asm/pmc-sierra/msp71xx/war.h b/arch/mips/include/asm/pmc-sierra/msp71xx/war.h
index 0bf48fc1892b..9e2ee429c529 100644
--- a/arch/mips/include/asm/pmc-sierra/msp71xx/war.h
+++ b/arch/mips/include/asm/pmc-sierra/msp71xx/war.h
@@ -23,6 +23,8 @@
23#if defined(CONFIG_PMC_MSP7120_EVAL) || defined(CONFIG_PMC_MSP7120_GW) || \ 23#if defined(CONFIG_PMC_MSP7120_EVAL) || defined(CONFIG_PMC_MSP7120_GW) || \
24 defined(CONFIG_PMC_MSP7120_FPGA) 24 defined(CONFIG_PMC_MSP7120_FPGA)
25#define MIPS34K_MISSED_ITLB_WAR 1 25#define MIPS34K_MISSED_ITLB_WAR 1
26#else
27#define MIPS34K_MISSED_ITLB_WAR 0
26#endif 28#endif
27 29
28#endif /* __ASM_MIPS_PMC_SIERRA_WAR_H */ 30#endif /* __ASM_MIPS_PMC_SIERRA_WAR_H */
diff --git a/arch/mips/include/asm/processor.h b/arch/mips/include/asm/processor.h
index 0f926aa0cb47..087a8884ef06 100644
--- a/arch/mips/include/asm/processor.h
+++ b/arch/mips/include/asm/processor.h
@@ -311,8 +311,9 @@ extern void start_thread(struct pt_regs * regs, unsigned long pc, unsigned long
311 311
312unsigned long get_wchan(struct task_struct *p); 312unsigned long get_wchan(struct task_struct *p);
313 313
314#define __KSTK_TOS(tsk) ((unsigned long)task_stack_page(tsk) + THREAD_SIZE - 32) 314#define __KSTK_TOS(tsk) ((unsigned long)task_stack_page(tsk) + \
315#define task_pt_regs(tsk) ((struct pt_regs *)__KSTK_TOS(tsk) - 1) 315 THREAD_SIZE - 32 - sizeof(struct pt_regs))
316#define task_pt_regs(tsk) ((struct pt_regs *)__KSTK_TOS(tsk))
316#define KSTK_EIP(tsk) (task_pt_regs(tsk)->cp0_epc) 317#define KSTK_EIP(tsk) (task_pt_regs(tsk)->cp0_epc)
317#define KSTK_ESP(tsk) (task_pt_regs(tsk)->regs[29]) 318#define KSTK_ESP(tsk) (task_pt_regs(tsk)->regs[29])
318#define KSTK_STATUS(tsk) (task_pt_regs(tsk)->cp0_status) 319#define KSTK_STATUS(tsk) (task_pt_regs(tsk)->cp0_status)
diff --git a/arch/mips/include/asm/reg.h b/arch/mips/include/asm/reg.h
index 634b55d7e7f6..910e71a12466 100644
--- a/arch/mips/include/asm/reg.h
+++ b/arch/mips/include/asm/reg.h
@@ -69,7 +69,7 @@
69 69
70#endif 70#endif
71 71
72#ifdef CONFIG_64BIT 72#if defined(CONFIG_64BIT) && !defined(WANT_COMPAT_REG_H)
73 73
74#define EF_R0 0 74#define EF_R0 0
75#define EF_R1 1 75#define EF_R1 1
diff --git a/arch/mips/include/asm/swab.h b/arch/mips/include/asm/swab.h
index 99993c0d6c12..97c2f81b4b43 100644
--- a/arch/mips/include/asm/swab.h
+++ b/arch/mips/include/asm/swab.h
@@ -38,7 +38,11 @@ static inline __attribute_const__ __u32 __arch_swab32(__u32 x)
38} 38}
39#define __arch_swab32 __arch_swab32 39#define __arch_swab32 __arch_swab32
40 40
41#ifdef CONFIG_CPU_MIPS64_R2 41/*
42 * Having already checked for CONFIG_CPU_MIPSR2, enable the
43 * optimized version for 64-bit kernel on r2 CPUs.
44 */
45#ifdef CONFIG_64BIT
42static inline __attribute_const__ __u64 __arch_swab64(__u64 x) 46static inline __attribute_const__ __u64 __arch_swab64(__u64 x)
43{ 47{
44 __asm__( 48 __asm__(
@@ -50,6 +54,6 @@ static inline __attribute_const__ __u64 __arch_swab64(__u64 x)
50 return x; 54 return x;
51} 55}
52#define __arch_swab64 __arch_swab64 56#define __arch_swab64 __arch_swab64
53#endif /* CONFIG_CPU_MIPS64_R2 */ 57#endif /* CONFIG_64BIT */
54#endif /* CONFIG_CPU_MIPSR2 */ 58#endif /* CONFIG_CPU_MIPSR2 */
55#endif /* _ASM_SWAB_H */ 59#endif /* _ASM_SWAB_H */
diff --git a/arch/mips/include/asm/thread_info.h b/arch/mips/include/asm/thread_info.h
index 143a48136a4b..f9df720d2e40 100644
--- a/arch/mips/include/asm/thread_info.h
+++ b/arch/mips/include/asm/thread_info.h
@@ -39,8 +39,6 @@ struct thread_info {
39 39
40/* 40/*
41 * macros/functions for gaining access to the thread information structure 41 * macros/functions for gaining access to the thread information structure
42 *
43 * preempt_count needs to be 1 initially, until the scheduler is functional.
44 */ 42 */
45#define INIT_THREAD_INFO(tsk) \ 43#define INIT_THREAD_INFO(tsk) \
46{ \ 44{ \
@@ -48,7 +46,7 @@ struct thread_info {
48 .exec_domain = &default_exec_domain, \ 46 .exec_domain = &default_exec_domain, \
49 .flags = _TIF_FIXADE, \ 47 .flags = _TIF_FIXADE, \
50 .cpu = 0, \ 48 .cpu = 0, \
51 .preempt_count = 1, \ 49 .preempt_count = INIT_PREEMPT_COUNT, \
52 .addr_limit = KERNEL_DS, \ 50 .addr_limit = KERNEL_DS, \
53 .restart_block = { \ 51 .restart_block = { \
54 .fn = do_no_restart_syscall, \ 52 .fn = do_no_restart_syscall, \
diff --git a/arch/mips/include/asm/unistd.h b/arch/mips/include/asm/unistd.h
index 40005010827c..e753a777949b 100644
--- a/arch/mips/include/asm/unistd.h
+++ b/arch/mips/include/asm/unistd.h
@@ -352,16 +352,19 @@
352#define __NR_inotify_init1 (__NR_Linux + 329) 352#define __NR_inotify_init1 (__NR_Linux + 329)
353#define __NR_preadv (__NR_Linux + 330) 353#define __NR_preadv (__NR_Linux + 330)
354#define __NR_pwritev (__NR_Linux + 331) 354#define __NR_pwritev (__NR_Linux + 331)
355#define __NR_rt_tgsigqueueinfo (__NR_Linux + 332)
356#define __NR_perf_counter_open (__NR_Linux + 333)
357#define __NR_accept4 (__NR_Linux + 334)
355 358
356/* 359/*
357 * Offset of the last Linux o32 flavoured syscall 360 * Offset of the last Linux o32 flavoured syscall
358 */ 361 */
359#define __NR_Linux_syscalls 331 362#define __NR_Linux_syscalls 334
360 363
361#endif /* _MIPS_SIM == _MIPS_SIM_ABI32 */ 364#endif /* _MIPS_SIM == _MIPS_SIM_ABI32 */
362 365
363#define __NR_O32_Linux 4000 366#define __NR_O32_Linux 4000
364#define __NR_O32_Linux_syscalls 331 367#define __NR_O32_Linux_syscalls 334
365 368
366#if _MIPS_SIM == _MIPS_SIM_ABI64 369#if _MIPS_SIM == _MIPS_SIM_ABI64
367 370
@@ -660,16 +663,19 @@
660#define __NR_inotify_init1 (__NR_Linux + 288) 663#define __NR_inotify_init1 (__NR_Linux + 288)
661#define __NR_preadv (__NR_Linux + 289) 664#define __NR_preadv (__NR_Linux + 289)
662#define __NR_pwritev (__NR_Linux + 290) 665#define __NR_pwritev (__NR_Linux + 290)
666#define __NR_rt_tgsigqueueinfo (__NR_Linux + 291)
667#define __NR_perf_counter_open (__NR_Linux + 292)
668#define __NR_accept4 (__NR_Linux + 293)
663 669
664/* 670/*
665 * Offset of the last Linux 64-bit flavoured syscall 671 * Offset of the last Linux 64-bit flavoured syscall
666 */ 672 */
667#define __NR_Linux_syscalls 290 673#define __NR_Linux_syscalls 293
668 674
669#endif /* _MIPS_SIM == _MIPS_SIM_ABI64 */ 675#endif /* _MIPS_SIM == _MIPS_SIM_ABI64 */
670 676
671#define __NR_64_Linux 5000 677#define __NR_64_Linux 5000
672#define __NR_64_Linux_syscalls 290 678#define __NR_64_Linux_syscalls 293
673 679
674#if _MIPS_SIM == _MIPS_SIM_NABI32 680#if _MIPS_SIM == _MIPS_SIM_NABI32
675 681
@@ -972,16 +978,19 @@
972#define __NR_inotify_init1 (__NR_Linux + 292) 978#define __NR_inotify_init1 (__NR_Linux + 292)
973#define __NR_preadv (__NR_Linux + 293) 979#define __NR_preadv (__NR_Linux + 293)
974#define __NR_pwritev (__NR_Linux + 294) 980#define __NR_pwritev (__NR_Linux + 294)
981#define __NR_rt_tgsigqueueinfo (__NR_Linux + 295)
982#define __NR_perf_counter_open (__NR_Linux + 296)
983#define __NR_accept4 (__NR_Linux + 297)
975 984
976/* 985/*
977 * Offset of the last N32 flavoured syscall 986 * Offset of the last N32 flavoured syscall
978 */ 987 */
979#define __NR_Linux_syscalls 294 988#define __NR_Linux_syscalls 297
980 989
981#endif /* _MIPS_SIM == _MIPS_SIM_NABI32 */ 990#endif /* _MIPS_SIM == _MIPS_SIM_NABI32 */
982 991
983#define __NR_N32_Linux 6000 992#define __NR_N32_Linux 6000
984#define __NR_N32_Linux_syscalls 294 993#define __NR_N32_Linux_syscalls 297
985 994
986#ifdef __KERNEL__ 995#ifdef __KERNEL__
987 996
diff --git a/arch/mips/include/asm/vr41xx/capcella.h b/arch/mips/include/asm/vr41xx/capcella.h
index e0ee05a3dfcc..fcc6569414fa 100644
--- a/arch/mips/include/asm/vr41xx/capcella.h
+++ b/arch/mips/include/asm/vr41xx/capcella.h
@@ -1,7 +1,7 @@
1/* 1/*
2 * capcella.h, Include file for ZAO Networks Capcella. 2 * capcella.h, Include file for ZAO Networks Capcella.
3 * 3 *
4 * Copyright (C) 2002-2004 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> 4 * Copyright (C) 2002-2004 Yoichi Yuasa <yuasa@linux-mips.org>
5 * 5 *
6 * This program is free software; you can redistribute it and/or modify 6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by 7 * it under the terms of the GNU General Public License as published by
diff --git a/arch/mips/include/asm/vr41xx/giu.h b/arch/mips/include/asm/vr41xx/giu.h
index 0bcdd3a5c256..6a90bc1d916b 100644
--- a/arch/mips/include/asm/vr41xx/giu.h
+++ b/arch/mips/include/asm/vr41xx/giu.h
@@ -1,7 +1,7 @@
1/* 1/*
2 * Include file for NEC VR4100 series General-purpose I/O Unit. 2 * Include file for NEC VR4100 series General-purpose I/O Unit.
3 * 3 *
4 * Copyright (C) 2005 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> 4 * Copyright (C) 2005-2009 Yoichi Yuasa <yuasa@linux-mips.org>
5 * 5 *
6 * This program is free software; you can redistribute it and/or modify 6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by 7 * it under the terms of the GNU General Public License as published by
@@ -41,7 +41,8 @@ typedef enum {
41 IRQ_SIGNAL_HOLD, 41 IRQ_SIGNAL_HOLD,
42} irq_signal_t; 42} irq_signal_t;
43 43
44extern void vr41xx_set_irq_trigger(unsigned int pin, irq_trigger_t trigger, irq_signal_t signal); 44extern void vr41xx_set_irq_trigger(unsigned int pin, irq_trigger_t trigger,
45 irq_signal_t signal);
45 46
46typedef enum { 47typedef enum {
47 IRQ_LEVEL_LOW, 48 IRQ_LEVEL_LOW,
@@ -51,23 +52,6 @@ typedef enum {
51extern void vr41xx_set_irq_level(unsigned int pin, irq_level_t level); 52extern void vr41xx_set_irq_level(unsigned int pin, irq_level_t level);
52 53
53typedef enum { 54typedef enum {
54 GPIO_DATA_LOW,
55 GPIO_DATA_HIGH,
56 GPIO_DATA_INVAL,
57} gpio_data_t;
58
59extern gpio_data_t vr41xx_gpio_get_pin(unsigned int pin);
60extern int vr41xx_gpio_set_pin(unsigned int pin, gpio_data_t data);
61
62typedef enum {
63 GPIO_INPUT,
64 GPIO_OUTPUT,
65 GPIO_OUTPUT_DISABLE,
66} gpio_direction_t;
67
68extern int vr41xx_gpio_set_direction(unsigned int pin, gpio_direction_t dir);
69
70typedef enum {
71 GPIO_PULL_DOWN, 55 GPIO_PULL_DOWN,
72 GPIO_PULL_UP, 56 GPIO_PULL_UP,
73 GPIO_PULL_DISABLE, 57 GPIO_PULL_DISABLE,
diff --git a/arch/mips/include/asm/vr41xx/irq.h b/arch/mips/include/asm/vr41xx/irq.h
index d315dfbc08f2..b07f7321751d 100644
--- a/arch/mips/include/asm/vr41xx/irq.h
+++ b/arch/mips/include/asm/vr41xx/irq.h
@@ -7,7 +7,7 @@
7 * Copyright (C) 2001, 2002 Paul Mundt 7 * Copyright (C) 2001, 2002 Paul Mundt
8 * Copyright (C) 2002 MontaVista Software, Inc. 8 * Copyright (C) 2002 MontaVista Software, Inc.
9 * Copyright (C) 2002 TimeSys Corp. 9 * Copyright (C) 2002 TimeSys Corp.
10 * Copyright (C) 2003-2006 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> 10 * Copyright (C) 2003-2006 Yoichi Yuasa <yuasa@linux-mips.org>
11 * 11 *
12 * This program is free software; you can redistribute it and/or modify it 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 13 * under the terms of the GNU General Public License as published by the
diff --git a/arch/mips/include/asm/vr41xx/mpc30x.h b/arch/mips/include/asm/vr41xx/mpc30x.h
index 1d67df843dc3..130d09d8c8cb 100644
--- a/arch/mips/include/asm/vr41xx/mpc30x.h
+++ b/arch/mips/include/asm/vr41xx/mpc30x.h
@@ -1,7 +1,7 @@
1/* 1/*
2 * mpc30x.h, Include file for Victor MP-C303/304. 2 * mpc30x.h, Include file for Victor MP-C303/304.
3 * 3 *
4 * Copyright (C) 2002-2004 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> 4 * Copyright (C) 2002-2004 Yoichi Yuasa <yuasa@linux-mips.org>
5 * 5 *
6 * This program is free software; you can redistribute it and/or modify 6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by 7 * it under the terms of the GNU General Public License as published by
diff --git a/arch/mips/include/asm/vr41xx/pci.h b/arch/mips/include/asm/vr41xx/pci.h
index 6fc01ce19777..c231a3d6cfd8 100644
--- a/arch/mips/include/asm/vr41xx/pci.h
+++ b/arch/mips/include/asm/vr41xx/pci.h
@@ -1,7 +1,7 @@
1/* 1/*
2 * Include file for NEC VR4100 series PCI Control Unit. 2 * Include file for NEC VR4100 series PCI Control Unit.
3 * 3 *
4 * Copyright (C) 2004-2005 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> 4 * Copyright (C) 2004-2005 Yoichi Yuasa <yuasa@linux-mips.org>
5 * 5 *
6 * This program is free software; you can redistribute it and/or modify 6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by 7 * it under the terms of the GNU General Public License as published by
diff --git a/arch/mips/include/asm/vr41xx/siu.h b/arch/mips/include/asm/vr41xx/siu.h
index da9f6e373409..ca806bc4ddc8 100644
--- a/arch/mips/include/asm/vr41xx/siu.h
+++ b/arch/mips/include/asm/vr41xx/siu.h
@@ -1,7 +1,7 @@
1/* 1/*
2 * Include file for NEC VR4100 series Serial Interface Unit. 2 * Include file for NEC VR4100 series Serial Interface Unit.
3 * 3 *
4 * Copyright (C) 2005-2008 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> 4 * Copyright (C) 2005-2008 Yoichi Yuasa <yuasa@linux-mips.org>
5 * 5 *
6 * This program is free software; you can redistribute it and/or modify 6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by 7 * it under the terms of the GNU General Public License as published by
diff --git a/arch/mips/include/asm/vr41xx/tb0219.h b/arch/mips/include/asm/vr41xx/tb0219.h
index dc981b4be0a4..c78e8243b447 100644
--- a/arch/mips/include/asm/vr41xx/tb0219.h
+++ b/arch/mips/include/asm/vr41xx/tb0219.h
@@ -1,7 +1,7 @@
1/* 1/*
2 * tb0219.h, Include file for TANBAC TB0219. 2 * tb0219.h, Include file for TANBAC TB0219.
3 * 3 *
4 * Copyright (C) 2002-2004 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> 4 * Copyright (C) 2002-2004 Yoichi Yuasa <yuasa@linux-mips.org>
5 * 5 *
6 * Modified for TANBAC TB0219: 6 * Modified for TANBAC TB0219:
7 * Copyright (C) 2003 Megasolution Inc. <matsu@megasolution.jp> 7 * Copyright (C) 2003 Megasolution Inc. <matsu@megasolution.jp>
diff --git a/arch/mips/include/asm/vr41xx/tb0226.h b/arch/mips/include/asm/vr41xx/tb0226.h
index de527dcfa5f3..36f5f798e416 100644
--- a/arch/mips/include/asm/vr41xx/tb0226.h
+++ b/arch/mips/include/asm/vr41xx/tb0226.h
@@ -1,7 +1,7 @@
1/* 1/*
2 * tb0226.h, Include file for TANBAC TB0226. 2 * tb0226.h, Include file for TANBAC TB0226.
3 * 3 *
4 * Copyright (C) 2002-2004 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> 4 * Copyright (C) 2002-2004 Yoichi Yuasa <yuasa@linux-mips.org>
5 * 5 *
6 * This program is free software; you can redistribute it and/or modify 6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by 7 * it under the terms of the GNU General Public License as published by
diff --git a/arch/mips/include/asm/vr41xx/vr41xx.h b/arch/mips/include/asm/vr41xx/vr41xx.h
index 22be64971cc6..7b96a43b72ba 100644
--- a/arch/mips/include/asm/vr41xx/vr41xx.h
+++ b/arch/mips/include/asm/vr41xx/vr41xx.h
@@ -7,7 +7,7 @@
7 * Copyright (C) 2001, 2002 Paul Mundt 7 * Copyright (C) 2001, 2002 Paul Mundt
8 * Copyright (C) 2002 MontaVista Software, Inc. 8 * Copyright (C) 2002 MontaVista Software, Inc.
9 * Copyright (C) 2002 TimeSys Corp. 9 * Copyright (C) 2002 TimeSys Corp.
10 * Copyright (C) 2003-2008 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> 10 * Copyright (C) 2003-2008 Yoichi Yuasa <yuasa@linux-mips.org>
11 * 11 *
12 * This program is free software; you can redistribute it and/or modify it 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 13 * under the terms of the GNU General Public License as published by the
diff --git a/arch/mips/jazz/jazzdma.c b/arch/mips/jazz/jazzdma.c
index f0fd636723be..0d64d0f46418 100644
--- a/arch/mips/jazz/jazzdma.c
+++ b/arch/mips/jazz/jazzdma.c
@@ -190,7 +190,7 @@ int vdma_free(unsigned long laddr)
190 return -1; 190 return -1;
191 } 191 }
192 192
193 while (pgtbl[i].owner == laddr && i < VDMA_PGTBL_ENTRIES) { 193 while (i < VDMA_PGTBL_ENTRIES && pgtbl[i].owner == laddr) {
194 pgtbl[i].owner = VDMA_PAGE_EMPTY; 194 pgtbl[i].owner = VDMA_PAGE_EMPTY;
195 i++; 195 i++;
196 } 196 }
diff --git a/arch/mips/kernel/binfmt_elfo32.c b/arch/mips/kernel/binfmt_elfo32.c
index e1333d7319e2..ff448233dab5 100644
--- a/arch/mips/kernel/binfmt_elfo32.c
+++ b/arch/mips/kernel/binfmt_elfo32.c
@@ -53,6 +53,23 @@ typedef elf_fpreg_t elf_fpregset_t[ELF_NFPREG];
53#define ELF_ET_DYN_BASE (TASK32_SIZE / 3 * 2) 53#define ELF_ET_DYN_BASE (TASK32_SIZE / 3 * 2)
54 54
55#include <asm/processor.h> 55#include <asm/processor.h>
56
57/*
58 * When this file is selected, we are definitely running a 64bit kernel.
59 * So using the right regs define in asm/reg.h
60 */
61#define WANT_COMPAT_REG_H
62
63/* These MUST be defined before elf.h gets included */
64extern void elf32_core_copy_regs(elf_gregset_t grp, struct pt_regs *regs);
65#define ELF_CORE_COPY_REGS(_dest, _regs) elf32_core_copy_regs(_dest, _regs);
66#define ELF_CORE_COPY_TASK_REGS(_tsk, _dest) \
67({ \
68 int __res = 1; \
69 elf32_core_copy_regs(*(_dest), task_pt_regs(_tsk)); \
70 __res; \
71})
72
56#include <linux/module.h> 73#include <linux/module.h>
57#include <linux/elfcore.h> 74#include <linux/elfcore.h>
58#include <linux/compat.h> 75#include <linux/compat.h>
@@ -110,9 +127,6 @@ jiffies_to_compat_timeval(unsigned long jiffies, struct compat_timeval *value)
110 value->tv_usec = rem / NSEC_PER_USEC; 127 value->tv_usec = rem / NSEC_PER_USEC;
111} 128}
112 129
113#undef ELF_CORE_COPY_REGS
114#define ELF_CORE_COPY_REGS(_dest, _regs) elf32_core_copy_regs(_dest, _regs);
115
116void elf32_core_copy_regs(elf_gregset_t grp, struct pt_regs *regs) 130void elf32_core_copy_regs(elf_gregset_t grp, struct pt_regs *regs)
117{ 131{
118 int i; 132 int i;
diff --git a/arch/mips/kernel/cevt-ds1287.c b/arch/mips/kernel/cevt-ds1287.c
index 1ada45ea0700..6996da4d74a2 100644
--- a/arch/mips/kernel/cevt-ds1287.c
+++ b/arch/mips/kernel/cevt-ds1287.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * DS1287 clockevent driver 2 * DS1287 clockevent driver
3 * 3 *
4 * Copyright (C) 2008 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> 4 * Copyright (C) 2008 Yoichi Yuasa <yuasa@linux-mips.org>
5 * 5 *
6 * This program is free software; you can redistribute it and/or modify 6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by 7 * it under the terms of the GNU General Public License as published by
diff --git a/arch/mips/kernel/cevt-gt641xx.c b/arch/mips/kernel/cevt-gt641xx.c
index e9b787feedcb..92351e00ae0e 100644
--- a/arch/mips/kernel/cevt-gt641xx.c
+++ b/arch/mips/kernel/cevt-gt641xx.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * GT641xx clockevent routines. 2 * GT641xx clockevent routines.
3 * 3 *
4 * Copyright (C) 2007 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> 4 * Copyright (C) 2007 Yoichi Yuasa <yuasa@linux-mips.org>
5 * 5 *
6 * This program is free software; you can redistribute it and/or modify 6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by 7 * it under the terms of the GNU General Public License as published by
diff --git a/arch/mips/kernel/csrc-ioasic.c b/arch/mips/kernel/csrc-ioasic.c
index b551f48d3a07..23da108506b0 100644
--- a/arch/mips/kernel/csrc-ioasic.c
+++ b/arch/mips/kernel/csrc-ioasic.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * DEC I/O ASIC's counter clocksource 2 * DEC I/O ASIC's counter clocksource
3 * 3 *
4 * Copyright (C) 2008 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> 4 * Copyright (C) 2008 Yoichi Yuasa <yuasa@linux-mips.org>
5 * 5 *
6 * This program is free software; you can redistribute it and/or modify 6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by 7 * it under the terms of the GNU General Public License as published by
diff --git a/arch/mips/kernel/head.S b/arch/mips/kernel/head.S
index 492a0a8d70fb..531ce7b16124 100644
--- a/arch/mips/kernel/head.S
+++ b/arch/mips/kernel/head.S
@@ -188,7 +188,8 @@ NESTED(kernel_entry, 16, sp) # kernel entry point
188 188
189 MTC0 zero, CP0_CONTEXT # clear context register 189 MTC0 zero, CP0_CONTEXT # clear context register
190 PTR_LA $28, init_thread_union 190 PTR_LA $28, init_thread_union
191 PTR_LI sp, _THREAD_SIZE - 32 191 /* Set the SP after an empty pt_regs. */
192 PTR_LI sp, _THREAD_SIZE - 32 - PT_SIZE
192 PTR_ADDU sp, $28 193 PTR_ADDU sp, $28
193 set_saved_sp sp, t0, t1 194 set_saved_sp sp, t0, t1
194 PTR_SUBU sp, 4 * SZREG # init stack pointer 195 PTR_SUBU sp, 4 * SZREG # init stack pointer
diff --git a/arch/mips/kernel/irq-gic.c b/arch/mips/kernel/irq-gic.c
index 39000f103f2c..d2072cd38592 100644
--- a/arch/mips/kernel/irq-gic.c
+++ b/arch/mips/kernel/irq-gic.c
@@ -107,9 +107,7 @@ static unsigned int gic_irq_startup(unsigned int irq)
107{ 107{
108 pr_debug("CPU%d: %s: irq%d\n", smp_processor_id(), __func__, irq); 108 pr_debug("CPU%d: %s: irq%d\n", smp_processor_id(), __func__, irq);
109 irq -= _irqbase; 109 irq -= _irqbase;
110 /* FIXME: this is wrong for !GICISWORDLITTLEENDIAN */ 110 GIC_SET_INTR_MASK(irq, 1);
111 GICWRITE(GIC_REG_ADDR(SHARED, (GIC_SH_SMASK_31_0_OFS + (irq / 32))),
112 1 << (irq % 32));
113 return 0; 111 return 0;
114} 112}
115 113
@@ -120,8 +118,7 @@ static void gic_irq_ack(unsigned int irq)
120#endif 118#endif
121 pr_debug("CPU%d: %s: irq%d\n", smp_processor_id(), __func__, irq); 119 pr_debug("CPU%d: %s: irq%d\n", smp_processor_id(), __func__, irq);
122 irq -= _irqbase; 120 irq -= _irqbase;
123 GICWRITE(GIC_REG_ADDR(SHARED, (GIC_SH_RMASK_31_0_OFS + (irq / 32))), 121 GIC_CLR_INTR_MASK(irq, 1);
124 1 << (irq % 32));
125 122
126 if (_intrmap[irq].trigtype == GIC_TRIG_EDGE) { 123 if (_intrmap[irq].trigtype == GIC_TRIG_EDGE) {
127 if (!gic_wedgeb2bok) 124 if (!gic_wedgeb2bok)
@@ -138,18 +135,14 @@ static void gic_mask_irq(unsigned int irq)
138{ 135{
139 pr_debug("CPU%d: %s: irq%d\n", smp_processor_id(), __func__, irq); 136 pr_debug("CPU%d: %s: irq%d\n", smp_processor_id(), __func__, irq);
140 irq -= _irqbase; 137 irq -= _irqbase;
141 /* FIXME: this is wrong for !GICISWORDLITTLEENDIAN */ 138 GIC_CLR_INTR_MASK(irq, 1);
142 GICWRITE(GIC_REG_ADDR(SHARED, (GIC_SH_RMASK_31_0_OFS + (irq / 32))),
143 1 << (irq % 32));
144} 139}
145 140
146static void gic_unmask_irq(unsigned int irq) 141static void gic_unmask_irq(unsigned int irq)
147{ 142{
148 pr_debug("CPU%d: %s: irq%d\n", smp_processor_id(), __func__, irq); 143 pr_debug("CPU%d: %s: irq%d\n", smp_processor_id(), __func__, irq);
149 irq -= _irqbase; 144 irq -= _irqbase;
150 /* FIXME: this is wrong for !GICISWORDLITTLEENDIAN */ 145 GIC_SET_INTR_MASK(irq, 1);
151 GICWRITE(GIC_REG_ADDR(SHARED, (GIC_SH_SMASK_31_0_OFS + (irq / 32))),
152 1 << (irq % 32));
153} 146}
154 147
155#ifdef CONFIG_SMP 148#ifdef CONFIG_SMP
@@ -254,6 +247,10 @@ static void __init gic_basic_init(void)
254 if (cpu == X) 247 if (cpu == X)
255 continue; 248 continue;
256 249
250 if (cpu == 0 && i != 0 && _intrmap[i].intrnum == 0 &&
251 _intrmap[i].ipiflag == 0)
252 continue;
253
257 setup_intr(_intrmap[i].intrnum, 254 setup_intr(_intrmap[i].intrnum,
258 _intrmap[i].cpunum, 255 _intrmap[i].cpunum,
259 _intrmap[i].pin, 256 _intrmap[i].pin,
diff --git a/arch/mips/kernel/irq-gt641xx.c b/arch/mips/kernel/irq-gt641xx.c
index 1b81b131f43c..ebcc5f7ad9c2 100644
--- a/arch/mips/kernel/irq-gt641xx.c
+++ b/arch/mips/kernel/irq-gt641xx.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * GT641xx IRQ routines. 2 * GT641xx IRQ routines.
3 * 3 *
4 * Copyright (C) 2007 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> 4 * Copyright (C) 2007 Yoichi Yuasa <yuasa@linux-mips.org>
5 * 5 *
6 * This program is free software; you can redistribute it and/or modify 6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by 7 * it under the terms of the GNU General Public License as published by
diff --git a/arch/mips/kernel/irq_txx9.c b/arch/mips/kernel/irq_txx9.c
index a4d1462c27f7..9b78029bea70 100644
--- a/arch/mips/kernel/irq_txx9.c
+++ b/arch/mips/kernel/irq_txx9.c
@@ -1,6 +1,4 @@
1/* 1/*
2 * linux/arch/mips/kernel/irq_txx9.c
3 *
4 * Based on linux/arch/mips/jmr3927/rbhma3100/irq.c, 2 * Based on linux/arch/mips/jmr3927/rbhma3100/irq.c,
5 * linux/arch/mips/tx4927/common/tx4927_irq.c, 3 * linux/arch/mips/tx4927/common/tx4927_irq.c,
6 * linux/arch/mips/tx4938/common/irq.c 4 * linux/arch/mips/tx4938/common/irq.c
diff --git a/arch/mips/kernel/module.c b/arch/mips/kernel/module.c
index 3e9100dcc12d..6f51dda87fce 100644
--- a/arch/mips/kernel/module.c
+++ b/arch/mips/kernel/module.c
@@ -98,7 +98,8 @@ static int apply_r_mips_32_rela(struct module *me, u32 *location, Elf_Addr v)
98static int apply_r_mips_26_rel(struct module *me, u32 *location, Elf_Addr v) 98static int apply_r_mips_26_rel(struct module *me, u32 *location, Elf_Addr v)
99{ 99{
100 if (v % 4) { 100 if (v % 4) {
101 printk(KERN_ERR "module %s: dangerous relocation\n", me->name); 101 pr_err("module %s: dangerous R_MIPS_26 REL relocation\n",
102 me->name);
102 return -ENOEXEC; 103 return -ENOEXEC;
103 } 104 }
104 105
@@ -118,7 +119,8 @@ static int apply_r_mips_26_rel(struct module *me, u32 *location, Elf_Addr v)
118static int apply_r_mips_26_rela(struct module *me, u32 *location, Elf_Addr v) 119static int apply_r_mips_26_rela(struct module *me, u32 *location, Elf_Addr v)
119{ 120{
120 if (v % 4) { 121 if (v % 4) {
121 printk(KERN_ERR "module %s: dangerous relocation\n", me->name); 122 pr_err("module %s: dangerous R_MIPS_26 RELArelocation\n",
123 me->name);
122 return -ENOEXEC; 124 return -ENOEXEC;
123 } 125 }
124 126
@@ -222,7 +224,7 @@ static int apply_r_mips_lo16_rel(struct module *me, u32 *location, Elf_Addr v)
222 return 0; 224 return 0;
223 225
224out_danger: 226out_danger:
225 printk(KERN_ERR "module %s: dangerous " "relocation\n", me->name); 227 pr_err("module %s: dangerous R_MIPS_LO16 REL relocation\n", me->name);
226 228
227 return -ENOEXEC; 229 return -ENOEXEC;
228} 230}
@@ -301,7 +303,7 @@ int apply_relocate(Elf_Shdr *sechdrs, const char *strtab,
301 /* This is the symbol it is referring to */ 303 /* This is the symbol it is referring to */
302 sym = (Elf_Sym *)sechdrs[symindex].sh_addr 304 sym = (Elf_Sym *)sechdrs[symindex].sh_addr
303 + ELF_MIPS_R_SYM(rel[i]); 305 + ELF_MIPS_R_SYM(rel[i]);
304 if (!sym->st_value) { 306 if (IS_ERR_VALUE(sym->st_value)) {
305 /* Ignore unresolved weak symbol */ 307 /* Ignore unresolved weak symbol */
306 if (ELF_ST_BIND(sym->st_info) == STB_WEAK) 308 if (ELF_ST_BIND(sym->st_info) == STB_WEAK)
307 continue; 309 continue;
@@ -341,7 +343,7 @@ int apply_relocate_add(Elf_Shdr *sechdrs, const char *strtab,
341 /* This is the symbol it is referring to */ 343 /* This is the symbol it is referring to */
342 sym = (Elf_Sym *)sechdrs[symindex].sh_addr 344 sym = (Elf_Sym *)sechdrs[symindex].sh_addr
343 + ELF_MIPS_R_SYM(rel[i]); 345 + ELF_MIPS_R_SYM(rel[i]);
344 if (!sym->st_value) { 346 if (IS_ERR_VALUE(sym->st_value)) {
345 /* Ignore unresolved weak symbol */ 347 /* Ignore unresolved weak symbol */
346 if (ELF_ST_BIND(sym->st_info) == STB_WEAK) 348 if (ELF_ST_BIND(sym->st_info) == STB_WEAK)
347 continue; 349 continue;
diff --git a/arch/mips/kernel/proc.c b/arch/mips/kernel/proc.c
index e0a4ac18fa07..26109c4d5170 100644
--- a/arch/mips/kernel/proc.c
+++ b/arch/mips/kernel/proc.c
@@ -1,6 +1,4 @@
1/* 1/*
2 * linux/arch/mips/kernel/proc.c
3 *
4 * Copyright (C) 1995, 1996, 2001 Ralf Baechle 2 * Copyright (C) 1995, 1996, 2001 Ralf Baechle
5 * Copyright (C) 2001, 2004 MIPS Technologies, Inc. 3 * Copyright (C) 2001, 2004 MIPS Technologies, Inc.
6 * Copyright (C) 2004 Maciej W. Rozycki 4 * Copyright (C) 2004 Maciej W. Rozycki
diff --git a/arch/mips/kernel/process.c b/arch/mips/kernel/process.c
index c09d681b7181..f3d73e1831c1 100644
--- a/arch/mips/kernel/process.c
+++ b/arch/mips/kernel/process.c
@@ -115,7 +115,7 @@ int copy_thread(unsigned long clone_flags, unsigned long usp,
115{ 115{
116 struct thread_info *ti = task_thread_info(p); 116 struct thread_info *ti = task_thread_info(p);
117 struct pt_regs *childregs; 117 struct pt_regs *childregs;
118 long childksp; 118 unsigned long childksp;
119 p->set_child_tid = p->clear_child_tid = NULL; 119 p->set_child_tid = p->clear_child_tid = NULL;
120 120
121 childksp = (unsigned long)task_stack_page(p) + THREAD_SIZE - 32; 121 childksp = (unsigned long)task_stack_page(p) + THREAD_SIZE - 32;
@@ -132,6 +132,8 @@ int copy_thread(unsigned long clone_flags, unsigned long usp,
132 132
133 /* set up new TSS. */ 133 /* set up new TSS. */
134 childregs = (struct pt_regs *) childksp - 1; 134 childregs = (struct pt_regs *) childksp - 1;
135 /* Put the stack after the struct pt_regs. */
136 childksp = (unsigned long) childregs;
135 *childregs = *regs; 137 *childregs = *regs;
136 childregs->regs[7] = 0; /* Clear error flag */ 138 childregs->regs[7] = 0; /* Clear error flag */
137 139
diff --git a/arch/mips/kernel/ptrace32.c b/arch/mips/kernel/ptrace32.c
index c4f9ac17474a..32644b4a0714 100644
--- a/arch/mips/kernel/ptrace32.c
+++ b/arch/mips/kernel/ptrace32.c
@@ -22,7 +22,6 @@
22#include <linux/errno.h> 22#include <linux/errno.h>
23#include <linux/ptrace.h> 23#include <linux/ptrace.h>
24#include <linux/smp.h> 24#include <linux/smp.h>
25#include <linux/smp_lock.h>
26#include <linux/user.h> 25#include <linux/user.h>
27#include <linux/security.h> 26#include <linux/security.h>
28 27
diff --git a/arch/mips/kernel/scall32-o32.S b/arch/mips/kernel/scall32-o32.S
index 0b31b9bda048..b57082123536 100644
--- a/arch/mips/kernel/scall32-o32.S
+++ b/arch/mips/kernel/scall32-o32.S
@@ -652,6 +652,9 @@ einval: li v0, -ENOSYS
652 sys sys_inotify_init1 1 652 sys sys_inotify_init1 1
653 sys sys_preadv 6 /* 4330 */ 653 sys sys_preadv 6 /* 4330 */
654 sys sys_pwritev 6 654 sys sys_pwritev 6
655 sys sys_rt_tgsigqueueinfo 4
656 sys sys_perf_counter_open 5
657 sys sys_accept4 4
655 .endm 658 .endm
656 659
657 /* We pre-compute the number of _instruction_ bytes needed to 660 /* 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 c647fd6e722f..3d866f24e064 100644
--- a/arch/mips/kernel/scall64-64.S
+++ b/arch/mips/kernel/scall64-64.S
@@ -489,4 +489,7 @@ sys_call_table:
489 PTR sys_inotify_init1 489 PTR sys_inotify_init1
490 PTR sys_preadv 490 PTR sys_preadv
491 PTR sys_pwritev /* 5390 */ 491 PTR sys_pwritev /* 5390 */
492 PTR sys_rt_tgsigqueueinfo
493 PTR sys_perf_counter_open
494 PTR sys_accept4
492 .size sys_call_table,.-sys_call_table 495 .size sys_call_table,.-sys_call_table
diff --git a/arch/mips/kernel/scall64-n32.S b/arch/mips/kernel/scall64-n32.S
index 93cc672f4522..e855b118a079 100644
--- a/arch/mips/kernel/scall64-n32.S
+++ b/arch/mips/kernel/scall64-n32.S
@@ -415,4 +415,7 @@ EXPORT(sysn32_call_table)
415 PTR sys_inotify_init1 415 PTR sys_inotify_init1
416 PTR sys_preadv 416 PTR sys_preadv
417 PTR sys_pwritev 417 PTR sys_pwritev
418 PTR compat_sys_rt_tgsigqueueinfo /* 5295 */
419 PTR sys_perf_counter_open
420 PTR sys_accept4
418 .size sysn32_call_table,.-sysn32_call_table 421 .size sysn32_call_table,.-sysn32_call_table
diff --git a/arch/mips/kernel/scall64-o32.S b/arch/mips/kernel/scall64-o32.S
index a5598b2339dd..0c49f1a660be 100644
--- a/arch/mips/kernel/scall64-o32.S
+++ b/arch/mips/kernel/scall64-o32.S
@@ -535,4 +535,7 @@ sys_call_table:
535 PTR sys_inotify_init1 535 PTR sys_inotify_init1
536 PTR compat_sys_preadv /* 4330 */ 536 PTR compat_sys_preadv /* 4330 */
537 PTR compat_sys_pwritev 537 PTR compat_sys_pwritev
538 PTR compat_sys_rt_tgsigqueueinfo
539 PTR sys_perf_counter_open
540 PTR sys_accept4
538 .size sys_call_table,.-sys_call_table 541 .size sys_call_table,.-sys_call_table
diff --git a/arch/mips/kernel/smp-cmp.c b/arch/mips/kernel/smp-cmp.c
index 653be061b9ec..ad0ff5dc4d59 100644
--- a/arch/mips/kernel/smp-cmp.c
+++ b/arch/mips/kernel/smp-cmp.c
@@ -37,80 +37,24 @@
37#include <asm/mipsregs.h> 37#include <asm/mipsregs.h>
38#include <asm/mipsmtregs.h> 38#include <asm/mipsmtregs.h>
39#include <asm/mips_mt.h> 39#include <asm/mips_mt.h>
40 40#include <asm/amon.h>
41/* 41#include <asm/gic.h>
42 * Crude manipulation of the CPU masks to control which
43 * which CPU's are brought online during initialisation
44 *
45 * Beware... this needs to be called after CPU discovery
46 * but before CPU bringup
47 */
48static int __init allowcpus(char *str)
49{
50 cpumask_t cpu_allow_map;
51 char buf[256];
52 int len;
53
54 cpus_clear(cpu_allow_map);
55 if (cpulist_parse(str, &cpu_allow_map) == 0) {
56 cpu_set(0, cpu_allow_map);
57 cpus_and(cpu_possible_map, cpu_possible_map, cpu_allow_map);
58 len = cpulist_scnprintf(buf, sizeof(buf)-1, &cpu_possible_map);
59 buf[len] = '\0';
60 pr_debug("Allowable CPUs: %s\n", buf);
61 return 1;
62 } else
63 return 0;
64}
65__setup("allowcpus=", allowcpus);
66 42
67static void ipi_call_function(unsigned int cpu) 43static void ipi_call_function(unsigned int cpu)
68{ 44{
69 unsigned int action = 0;
70
71 pr_debug("CPU%d: %s cpu %d status %08x\n", 45 pr_debug("CPU%d: %s cpu %d status %08x\n",
72 smp_processor_id(), __func__, cpu, read_c0_status()); 46 smp_processor_id(), __func__, cpu, read_c0_status());
73 47
74 switch (cpu) { 48 gic_send_ipi(plat_ipi_call_int_xlate(cpu));
75 case 0:
76 action = GIC_IPI_EXT_INTR_CALLFNC_VPE0;
77 break;
78 case 1:
79 action = GIC_IPI_EXT_INTR_CALLFNC_VPE1;
80 break;
81 case 2:
82 action = GIC_IPI_EXT_INTR_CALLFNC_VPE2;
83 break;
84 case 3:
85 action = GIC_IPI_EXT_INTR_CALLFNC_VPE3;
86 break;
87 }
88 gic_send_ipi(action);
89} 49}
90 50
91 51
92static void ipi_resched(unsigned int cpu) 52static void ipi_resched(unsigned int cpu)
93{ 53{
94 unsigned int action = 0;
95
96 pr_debug("CPU%d: %s cpu %d status %08x\n", 54 pr_debug("CPU%d: %s cpu %d status %08x\n",
97 smp_processor_id(), __func__, cpu, read_c0_status()); 55 smp_processor_id(), __func__, cpu, read_c0_status());
98 56
99 switch (cpu) { 57 gic_send_ipi(plat_ipi_resched_int_xlate(cpu));
100 case 0:
101 action = GIC_IPI_EXT_INTR_RESCHED_VPE0;
102 break;
103 case 1:
104 action = GIC_IPI_EXT_INTR_RESCHED_VPE1;
105 break;
106 case 2:
107 action = GIC_IPI_EXT_INTR_RESCHED_VPE2;
108 break;
109 case 3:
110 action = GIC_IPI_EXT_INTR_RESCHED_VPE3;
111 break;
112 }
113 gic_send_ipi(action);
114} 58}
115 59
116/* 60/*
@@ -206,7 +150,7 @@ static void cmp_boot_secondary(int cpu, struct task_struct *idle)
206 (unsigned long)(gp + sizeof(struct thread_info))); 150 (unsigned long)(gp + sizeof(struct thread_info)));
207#endif 151#endif
208 152
209 amon_cpu_start(cpu, pc, sp, gp, a0); 153 amon_cpu_start(cpu, pc, sp, (unsigned long)gp, a0);
210} 154}
211 155
212/* 156/*
diff --git a/arch/mips/kernel/smtc.c b/arch/mips/kernel/smtc.c
index 8a0626cbb108..c16bb6d6c25c 100644
--- a/arch/mips/kernel/smtc.c
+++ b/arch/mips/kernel/smtc.c
@@ -465,11 +465,8 @@ void smtc_prepare_cpus(int cpus)
465 smtc_configure_tlb(); 465 smtc_configure_tlb();
466 466
467 for (tc = 0, vpe = 0 ; (vpe < nvpe) && (tc < ntc) ; vpe++) { 467 for (tc = 0, vpe = 0 ; (vpe < nvpe) && (tc < ntc) ; vpe++) {
468 /* 468 if (tcpervpe[vpe] == 0)
469 * Set the MVP bits. 469 continue;
470 */
471 settc(tc);
472 write_vpe_c0_vpeconf0(read_vpe_c0_vpeconf0() | VPECONF0_MVP);
473 if (vpe != 0) 470 if (vpe != 0)
474 printk(", "); 471 printk(", ");
475 printk("VPE %d: TC", vpe); 472 printk("VPE %d: TC", vpe);
@@ -488,6 +485,12 @@ void smtc_prepare_cpus(int cpus)
488 } 485 }
489 if (vpe != 0) { 486 if (vpe != 0) {
490 /* 487 /*
488 * Allow this VPE to control others.
489 */
490 write_vpe_c0_vpeconf0(read_vpe_c0_vpeconf0() |
491 VPECONF0_MVP);
492
493 /*
491 * Clear any stale software interrupts from VPE's Cause 494 * Clear any stale software interrupts from VPE's Cause
492 */ 495 */
493 write_vpe_c0_cause(0); 496 write_vpe_c0_cause(0);
diff --git a/arch/mips/kernel/stacktrace.c b/arch/mips/kernel/stacktrace.c
index 58f5cd76c8c3..d52ff77baf3f 100644
--- a/arch/mips/kernel/stacktrace.c
+++ b/arch/mips/kernel/stacktrace.c
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/mips/kernel/stacktrace.c
3 *
4 * Stack trace management functions 2 * Stack trace management functions
5 * 3 *
6 * Copyright (C) 2006 Atsushi Nemoto <anemo@mba.ocn.ne.jp> 4 * Copyright (C) 2006 Atsushi Nemoto <anemo@mba.ocn.ne.jp>
diff --git a/arch/mips/kernel/sync-r4k.c b/arch/mips/kernel/sync-r4k.c
index 9021108eb9c1..05dd170a83f7 100644
--- a/arch/mips/kernel/sync-r4k.c
+++ b/arch/mips/kernel/sync-r4k.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * Count register synchronisation. 2 * Count register synchronisation.
3 * 3 *
4 * All CPUs will have their count registers synchronised to the CPU0 expirelo 4 * All CPUs will have their count registers synchronised to the CPU0 next time
5 * value. This can cause a small timewarp for CPU0. All other CPU's should 5 * value. This can cause a small timewarp for CPU0. All other CPU's should
6 * not have done anything significant (but they may have had interrupts 6 * not have done anything significant (but they may have had interrupts
7 * enabled briefly - prom_smp_finish() should not be responsible for enabling 7 * enabled briefly - prom_smp_finish() should not be responsible for enabling
@@ -13,21 +13,22 @@
13#include <linux/kernel.h> 13#include <linux/kernel.h>
14#include <linux/init.h> 14#include <linux/init.h>
15#include <linux/irqflags.h> 15#include <linux/irqflags.h>
16#include <linux/r4k-timer.h> 16#include <linux/cpumask.h>
17 17
18#include <asm/r4k-timer.h>
18#include <asm/atomic.h> 19#include <asm/atomic.h>
19#include <asm/barrier.h> 20#include <asm/barrier.h>
20#include <asm/cpumask.h>
21#include <asm/mipsregs.h> 21#include <asm/mipsregs.h>
22 22
23static atomic_t __initdata count_start_flag = ATOMIC_INIT(0); 23static atomic_t __cpuinitdata count_start_flag = ATOMIC_INIT(0);
24static atomic_t __initdata count_count_start = ATOMIC_INIT(0); 24static atomic_t __cpuinitdata count_count_start = ATOMIC_INIT(0);
25static atomic_t __initdata count_count_stop = ATOMIC_INIT(0); 25static atomic_t __cpuinitdata count_count_stop = ATOMIC_INIT(0);
26static atomic_t __cpuinitdata count_reference = ATOMIC_INIT(0);
26 27
27#define COUNTON 100 28#define COUNTON 100
28#define NR_LOOPS 5 29#define NR_LOOPS 5
29 30
30void __init synchronise_count_master(void) 31void __cpuinit synchronise_count_master(void)
31{ 32{
32 int i; 33 int i;
33 unsigned long flags; 34 unsigned long flags;
@@ -42,19 +43,20 @@ void __init synchronise_count_master(void)
42 return; 43 return;
43#endif 44#endif
44 45
45 pr_info("Checking COUNT synchronization across %u CPUs: ", 46 printk(KERN_INFO "Synchronize counters across %u CPUs: ",
46 num_online_cpus()); 47 num_online_cpus());
47 48
48 local_irq_save(flags); 49 local_irq_save(flags);
49 50
50 /* 51 /*
51 * Notify the slaves that it's time to start 52 * Notify the slaves that it's time to start
52 */ 53 */
54 atomic_set(&count_reference, read_c0_count());
53 atomic_set(&count_start_flag, 1); 55 atomic_set(&count_start_flag, 1);
54 smp_wmb(); 56 smp_wmb();
55 57
56 /* Count will be initialised to expirelo for all CPU's */ 58 /* Count will be initialised to current timer for all CPU's */
57 initcount = expirelo; 59 initcount = read_c0_count();
58 60
59 /* 61 /*
60 * We loop a few times to get a primed instruction cache, 62 * We loop a few times to get a primed instruction cache,
@@ -106,7 +108,7 @@ void __init synchronise_count_master(void)
106 printk("done.\n"); 108 printk("done.\n");
107} 109}
108 110
109void __init synchronise_count_slave(void) 111void __cpuinit synchronise_count_slave(void)
110{ 112{
111 int i; 113 int i;
112 unsigned long flags; 114 unsigned long flags;
@@ -131,8 +133,8 @@ void __init synchronise_count_slave(void)
131 while (!atomic_read(&count_start_flag)) 133 while (!atomic_read(&count_start_flag))
132 mb(); 134 mb();
133 135
134 /* Count will be initialised to expirelo for all CPU's */ 136 /* Count will be initialised to next expire for all CPU's */
135 initcount = expirelo; 137 initcount = atomic_read(&count_reference);
136 138
137 ncpus = num_online_cpus(); 139 ncpus = num_online_cpus();
138 for (i = 0; i < NR_LOOPS; i++) { 140 for (i = 0; i < NR_LOOPS; i++) {
@@ -156,4 +158,3 @@ void __init synchronise_count_slave(void)
156 local_irq_restore(flags); 158 local_irq_restore(flags);
157} 159}
158#undef NR_LOOPS 160#undef NR_LOOPS
159#endif
diff --git a/arch/mips/kernel/vpe.c b/arch/mips/kernel/vpe.c
index 3ca5f42e819d..9a1ab7e87fd4 100644
--- a/arch/mips/kernel/vpe.c
+++ b/arch/mips/kernel/vpe.c
@@ -73,7 +73,7 @@ static int major;
73static const int minor = 1; /* fixed for now */ 73static const int minor = 1; /* fixed for now */
74 74
75#ifdef CONFIG_MIPS_APSP_KSPD 75#ifdef CONFIG_MIPS_APSP_KSPD
76 static struct kspd_notifications kspd_events; 76static struct kspd_notifications kspd_events;
77static int kspd_events_reqd = 0; 77static int kspd_events_reqd = 0;
78#endif 78#endif
79 79
@@ -155,10 +155,9 @@ struct {
155}; 155};
156 156
157static void release_progmem(void *ptr); 157static void release_progmem(void *ptr);
158extern void save_gp_address(unsigned int secbase, unsigned int rel);
159 158
160/* get the vpe associated with this minor */ 159/* get the vpe associated with this minor */
161struct vpe *get_vpe(int minor) 160static struct vpe *get_vpe(int minor)
162{ 161{
163 struct vpe *v; 162 struct vpe *v;
164 163
@@ -174,7 +173,7 @@ struct vpe *get_vpe(int minor)
174} 173}
175 174
176/* get the vpe associated with this minor */ 175/* get the vpe associated with this minor */
177struct tc *get_tc(int index) 176static struct tc *get_tc(int index)
178{ 177{
179 struct tc *t; 178 struct tc *t;
180 179
@@ -186,20 +185,8 @@ struct tc *get_tc(int index)
186 return NULL; 185 return NULL;
187} 186}
188 187
189struct tc *get_tc_unused(void)
190{
191 struct tc *t;
192
193 list_for_each_entry(t, &vpecontrol.tc_list, list) {
194 if (t->state == TC_STATE_UNUSED)
195 return t;
196 }
197
198 return NULL;
199}
200
201/* allocate a vpe and associate it with this minor (or index) */ 188/* allocate a vpe and associate it with this minor (or index) */
202struct vpe *alloc_vpe(int minor) 189static struct vpe *alloc_vpe(int minor)
203{ 190{
204 struct vpe *v; 191 struct vpe *v;
205 192
@@ -216,7 +203,7 @@ struct vpe *alloc_vpe(int minor)
216} 203}
217 204
218/* allocate a tc. At startup only tc0 is running, all other can be halted. */ 205/* allocate a tc. At startup only tc0 is running, all other can be halted. */
219struct tc *alloc_tc(int index) 206static struct tc *alloc_tc(int index)
220{ 207{
221 struct tc *tc; 208 struct tc *tc;
222 209
@@ -232,7 +219,7 @@ out:
232} 219}
233 220
234/* clean up and free everything */ 221/* clean up and free everything */
235void release_vpe(struct vpe *v) 222static void release_vpe(struct vpe *v)
236{ 223{
237 list_del(&v->list); 224 list_del(&v->list);
238 if (v->load_addr) 225 if (v->load_addr)
@@ -240,7 +227,7 @@ void release_vpe(struct vpe *v)
240 kfree(v); 227 kfree(v);
241} 228}
242 229
243void dump_mtregs(void) 230static void dump_mtregs(void)
244{ 231{
245 unsigned long val; 232 unsigned long val;
246 233
@@ -327,7 +314,8 @@ static void layout_sections(struct module *mod, const Elf_Ehdr * hdr,
327 || (s->sh_flags & masks[m][1]) 314 || (s->sh_flags & masks[m][1])
328 || s->sh_entsize != ~0UL) 315 || s->sh_entsize != ~0UL)
329 continue; 316 continue;
330 s->sh_entsize = get_offset(&mod->core_size, s); 317 s->sh_entsize =
318 get_offset((unsigned long *)&mod->core_size, s);
331 } 319 }
332 320
333 if (m == 0) 321 if (m == 0)
@@ -461,16 +449,15 @@ static int apply_r_mips_lo16(struct module *me, uint32_t *location,
461{ 449{
462 unsigned long insnlo = *location; 450 unsigned long insnlo = *location;
463 Elf32_Addr val, vallo; 451 Elf32_Addr val, vallo;
452 struct mips_hi16 *l, *next;
464 453
465 /* Sign extend the addend we extract from the lo insn. */ 454 /* Sign extend the addend we extract from the lo insn. */
466 vallo = ((insnlo & 0xffff) ^ 0x8000) - 0x8000; 455 vallo = ((insnlo & 0xffff) ^ 0x8000) - 0x8000;
467 456
468 if (mips_hi16_list != NULL) { 457 if (mips_hi16_list != NULL) {
469 struct mips_hi16 *l;
470 458
471 l = mips_hi16_list; 459 l = mips_hi16_list;
472 while (l != NULL) { 460 while (l != NULL) {
473 struct mips_hi16 *next;
474 unsigned long insn; 461 unsigned long insn;
475 462
476 /* 463 /*
@@ -480,7 +467,7 @@ static int apply_r_mips_lo16(struct module *me, uint32_t *location,
480 printk(KERN_DEBUG "VPE loader: " 467 printk(KERN_DEBUG "VPE loader: "
481 "apply_r_mips_lo16/hi16: \t" 468 "apply_r_mips_lo16/hi16: \t"
482 "inconsistent value information\n"); 469 "inconsistent value information\n");
483 return -ENOEXEC; 470 goto out_free;
484 } 471 }
485 472
486 /* 473 /*
@@ -518,6 +505,16 @@ static int apply_r_mips_lo16(struct module *me, uint32_t *location,
518 *location = insnlo; 505 *location = insnlo;
519 506
520 return 0; 507 return 0;
508
509out_free:
510 while (l != NULL) {
511 next = l->next;
512 kfree(l);
513 l = next;
514 }
515 mips_hi16_list = NULL;
516
517 return -ENOEXEC;
521} 518}
522 519
523static int (*reloc_handlers[]) (struct module *me, uint32_t *location, 520static int (*reloc_handlers[]) (struct module *me, uint32_t *location,
@@ -541,7 +538,7 @@ static char *rstrs[] = {
541 [R_MIPS_PC16] = "MIPS_PC16" 538 [R_MIPS_PC16] = "MIPS_PC16"
542}; 539};
543 540
544int apply_relocations(Elf32_Shdr *sechdrs, 541static int apply_relocations(Elf32_Shdr *sechdrs,
545 const char *strtab, 542 const char *strtab,
546 unsigned int symindex, 543 unsigned int symindex,
547 unsigned int relsec, 544 unsigned int relsec,
@@ -586,7 +583,7 @@ int apply_relocations(Elf32_Shdr *sechdrs,
586 return 0; 583 return 0;
587} 584}
588 585
589void save_gp_address(unsigned int secbase, unsigned int rel) 586static inline void save_gp_address(unsigned int secbase, unsigned int rel)
590{ 587{
591 gp_addr = secbase + rel; 588 gp_addr = secbase + rel;
592 gp_offs = gp_addr - (secbase & 0xffff0000); 589 gp_offs = gp_addr - (secbase & 0xffff0000);
@@ -1387,7 +1384,7 @@ static ssize_t store_ntcs(struct device *dev, struct device_attribute *attr,
1387 return len; 1384 return len;
1388 1385
1389out_einval: 1386out_einval:
1390 return -EINVAL;; 1387 return -EINVAL;
1391} 1388}
1392 1389
1393static struct device_attribute vpe_class_attributes[] = { 1390static struct device_attribute vpe_class_attributes[] = {
diff --git a/arch/mips/mipssim/sim_time.c b/arch/mips/mipssim/sim_time.c
index 0cea932f1241..5492c42f7650 100644
--- a/arch/mips/mipssim/sim_time.c
+++ b/arch/mips/mipssim/sim_time.c
@@ -89,13 +89,13 @@ unsigned __cpuinit get_c0_compare_int(void)
89 if (cpu_has_veic) { 89 if (cpu_has_veic) {
90 set_vi_handler(MSC01E_INT_CPUCTR, mips_timer_dispatch); 90 set_vi_handler(MSC01E_INT_CPUCTR, mips_timer_dispatch);
91 mips_cpu_timer_irq = MSC01E_INT_BASE + MSC01E_INT_CPUCTR; 91 mips_cpu_timer_irq = MSC01E_INT_BASE + MSC01E_INT_CPUCTR;
92 } else { 92
93#endif 93 return mips_cpu_timer_irq;
94 {
95 if (cpu_has_vint)
96 set_vi_handler(cp0_compare_irq, mips_timer_dispatch);
97 mips_cpu_timer_irq = MIPS_CPU_IRQ_BASE + cp0_compare_irq;
98 } 94 }
95#endif
96 if (cpu_has_vint)
97 set_vi_handler(cp0_compare_irq, mips_timer_dispatch);
98 mips_cpu_timer_irq = MIPS_CPU_IRQ_BASE + cp0_compare_irq;
99 99
100 return mips_cpu_timer_irq; 100 return mips_cpu_timer_irq;
101} 101}
diff --git a/arch/mips/mm/c-octeon.c b/arch/mips/mm/c-octeon.c
index b165cdcb2818..10ab69f7183f 100644
--- a/arch/mips/mm/c-octeon.c
+++ b/arch/mips/mm/c-octeon.c
@@ -289,7 +289,7 @@ static void cache_parity_error_octeon(int non_recoverable)
289} 289}
290 290
291/** 291/**
292 * Called when the the exception is not recoverable 292 * Called when the the exception is recoverable
293 */ 293 */
294 294
295asmlinkage void cache_parity_error_octeon_recoverable(void) 295asmlinkage void cache_parity_error_octeon_recoverable(void)
@@ -298,7 +298,7 @@ asmlinkage void cache_parity_error_octeon_recoverable(void)
298} 298}
299 299
300/** 300/**
301 * Called when the the exception is recoverable 301 * Called when the the exception is not recoverable
302 */ 302 */
303 303
304asmlinkage void cache_parity_error_octeon_non_recoverable(void) 304asmlinkage void cache_parity_error_octeon_non_recoverable(void)
diff --git a/arch/mips/mm/extable.c b/arch/mips/mm/extable.c
index 297fb9f390dc..9d25d2ba4b9e 100644
--- a/arch/mips/mm/extable.c
+++ b/arch/mips/mm/extable.c
@@ -1,5 +1,9 @@
1/* 1/*
2 * linux/arch/mips/mm/extable.c 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) 1997, 99, 2001 - 2004 Ralf Baechle <ralf@linux-mips.org>
3 */ 7 */
4#include <linux/module.h> 8#include <linux/module.h>
5#include <linux/spinlock.h> 9#include <linux/spinlock.h>
diff --git a/arch/mips/mm/fault.c b/arch/mips/mm/fault.c
index 6751ce9ede9e..f956ecbb8136 100644
--- a/arch/mips/mm/fault.c
+++ b/arch/mips/mm/fault.c
@@ -171,6 +171,7 @@ out_of_memory:
171 * We ran out of memory, call the OOM killer, and return the userspace 171 * We ran out of memory, call the OOM killer, and return the userspace
172 * (which will retry the fault, or kill us if we got oom-killed). 172 * (which will retry the fault, or kill us if we got oom-killed).
173 */ 173 */
174 up_read(&mm->mmap_sem);
174 pagefault_out_of_memory(); 175 pagefault_out_of_memory();
175 return; 176 return;
176 177
diff --git a/arch/mips/mm/hugetlbpage.c b/arch/mips/mm/hugetlbpage.c
index 471c09aa1614..8c2834f5919d 100644
--- a/arch/mips/mm/hugetlbpage.c
+++ b/arch/mips/mm/hugetlbpage.c
@@ -16,7 +16,6 @@
16#include <linux/mm.h> 16#include <linux/mm.h>
17#include <linux/hugetlb.h> 17#include <linux/hugetlb.h>
18#include <linux/pagemap.h> 18#include <linux/pagemap.h>
19#include <linux/smp_lock.h>
20#include <linux/slab.h> 19#include <linux/slab.h>
21#include <linux/err.h> 20#include <linux/err.h>
22#include <linux/sysctl.h> 21#include <linux/sysctl.h>
diff --git a/arch/mips/mti-malta/malta-init.c b/arch/mips/mti-malta/malta-init.c
index 475038a141a6..27c807b67fea 100644
--- a/arch/mips/mti-malta/malta-init.c
+++ b/arch/mips/mti-malta/malta-init.c
@@ -30,6 +30,7 @@
30#include <asm/cacheflush.h> 30#include <asm/cacheflush.h>
31#include <asm/traps.h> 31#include <asm/traps.h>
32 32
33#include <asm/gcmpregs.h>
33#include <asm/mips-boards/prom.h> 34#include <asm/mips-boards/prom.h>
34#include <asm/mips-boards/generic.h> 35#include <asm/mips-boards/generic.h>
35#include <asm/mips-boards/bonito64.h> 36#include <asm/mips-boards/bonito64.h>
@@ -192,6 +193,8 @@ extern struct plat_smp_ops msmtc_smp_ops;
192 193
193void __init prom_init(void) 194void __init prom_init(void)
194{ 195{
196 int result;
197
195 prom_argc = fw_arg0; 198 prom_argc = fw_arg0;
196 _prom_argv = (int *) fw_arg1; 199 _prom_argv = (int *) fw_arg1;
197 _prom_envp = (int *) fw_arg2; 200 _prom_envp = (int *) fw_arg2;
@@ -358,12 +361,21 @@ void __init prom_init(void)
358#ifdef CONFIG_SERIAL_8250_CONSOLE 361#ifdef CONFIG_SERIAL_8250_CONSOLE
359 console_config(); 362 console_config();
360#endif 363#endif
364 /* Early detection of CMP support */
365 result = gcmp_probe(GCMP_BASE_ADDR, GCMP_ADDRSPACE_SZ);
366
361#ifdef CONFIG_MIPS_CMP 367#ifdef CONFIG_MIPS_CMP
362 register_smp_ops(&cmp_smp_ops); 368 if (result)
369 register_smp_ops(&cmp_smp_ops);
363#endif 370#endif
364#ifdef CONFIG_MIPS_MT_SMP 371#ifdef CONFIG_MIPS_MT_SMP
372#ifdef CONFIG_MIPS_CMP
373 if (!result)
374 register_smp_ops(&vsmp_smp_ops);
375#else
365 register_smp_ops(&vsmp_smp_ops); 376 register_smp_ops(&vsmp_smp_ops);
366#endif 377#endif
378#endif
367#ifdef CONFIG_MIPS_MT_SMTC 379#ifdef CONFIG_MIPS_MT_SMTC
368 register_smp_ops(&msmtc_smp_ops); 380 register_smp_ops(&msmtc_smp_ops);
369#endif 381#endif
diff --git a/arch/mips/mti-malta/malta-int.c b/arch/mips/mti-malta/malta-int.c
index b4eaf137e4a7..3e0a9b35ba5c 100644
--- a/arch/mips/mti-malta/malta-int.c
+++ b/arch/mips/mti-malta/malta-int.c
@@ -333,6 +333,21 @@ static struct irqaction irq_call = {
333}; 333};
334#endif /* CONFIG_MIPS_MT_SMP */ 334#endif /* CONFIG_MIPS_MT_SMP */
335 335
336static int gic_resched_int_base;
337static int gic_call_int_base;
338#define GIC_RESCHED_INT(cpu) (gic_resched_int_base+(cpu))
339#define GIC_CALL_INT(cpu) (gic_call_int_base+(cpu))
340
341unsigned int plat_ipi_call_int_xlate(unsigned int cpu)
342{
343 return GIC_CALL_INT(cpu);
344}
345
346unsigned int plat_ipi_resched_int_xlate(unsigned int cpu)
347{
348 return GIC_RESCHED_INT(cpu);
349}
350
336static struct irqaction i8259irq = { 351static struct irqaction i8259irq = {
337 .handler = no_action, 352 .handler = no_action,
338 .name = "XT-PIC cascade" 353 .name = "XT-PIC cascade"
@@ -370,7 +385,7 @@ static int __initdata msc_nr_eicirqs = ARRAY_SIZE(msc_eicirqmap);
370 * Interrupts and CPUs/Core Interrupts. The nature of the External 385 * Interrupts and CPUs/Core Interrupts. The nature of the External
371 * Interrupts is also defined here - polarity/trigger. 386 * Interrupts is also defined here - polarity/trigger.
372 */ 387 */
373static struct gic_intr_map gic_intr_map[] = { 388static struct gic_intr_map gic_intr_map[GIC_NUM_INTRS] = {
374 { GIC_EXT_INTR(0), X, X, X, X, 0 }, 389 { GIC_EXT_INTR(0), X, X, X, X, 0 },
375 { GIC_EXT_INTR(1), X, X, X, X, 0 }, 390 { GIC_EXT_INTR(1), X, X, X, X, 0 },
376 { GIC_EXT_INTR(2), X, X, X, X, 0 }, 391 { GIC_EXT_INTR(2), X, X, X, X, 0 },
@@ -387,21 +402,14 @@ static struct gic_intr_map gic_intr_map[] = {
387 { GIC_EXT_INTR(13), 0, GIC_MAP_TO_NMI_MSK, GIC_POL_POS, GIC_TRIG_LEVEL, 0 }, 402 { GIC_EXT_INTR(13), 0, GIC_MAP_TO_NMI_MSK, GIC_POL_POS, GIC_TRIG_LEVEL, 0 },
388 { GIC_EXT_INTR(14), 0, GIC_MAP_TO_NMI_MSK, GIC_POL_POS, GIC_TRIG_LEVEL, 0 }, 403 { GIC_EXT_INTR(14), 0, GIC_MAP_TO_NMI_MSK, GIC_POL_POS, GIC_TRIG_LEVEL, 0 },
389 { GIC_EXT_INTR(15), X, X, X, X, 0 }, 404 { GIC_EXT_INTR(15), X, X, X, X, 0 },
390 { GIC_EXT_INTR(16), 0, GIC_CPU_INT1, GIC_POL_POS, GIC_TRIG_EDGE, 1 }, 405/* This is the end of the general interrupts now we do IPI ones */
391 { GIC_EXT_INTR(17), 0, GIC_CPU_INT2, GIC_POL_POS, GIC_TRIG_EDGE, 1 },
392 { GIC_EXT_INTR(18), 1, GIC_CPU_INT1, GIC_POL_POS, GIC_TRIG_EDGE, 1 },
393 { GIC_EXT_INTR(19), 1, GIC_CPU_INT2, GIC_POL_POS, GIC_TRIG_EDGE, 1 },
394 { GIC_EXT_INTR(20), 2, GIC_CPU_INT1, GIC_POL_POS, GIC_TRIG_EDGE, 1 },
395 { GIC_EXT_INTR(21), 2, GIC_CPU_INT2, GIC_POL_POS, GIC_TRIG_EDGE, 1 },
396 { GIC_EXT_INTR(22), 3, GIC_CPU_INT1, GIC_POL_POS, GIC_TRIG_EDGE, 1 },
397 { GIC_EXT_INTR(23), 3, GIC_CPU_INT2, GIC_POL_POS, GIC_TRIG_EDGE, 1 },
398}; 406};
399#endif 407#endif
400 408
401/* 409/*
402 * GCMP needs to be detected before any SMP initialisation 410 * GCMP needs to be detected before any SMP initialisation
403 */ 411 */
404static int __init gcmp_probe(unsigned long addr, unsigned long size) 412int __init gcmp_probe(unsigned long addr, unsigned long size)
405{ 413{
406 if (gcmp_present >= 0) 414 if (gcmp_present >= 0)
407 return gcmp_present; 415 return gcmp_present;
@@ -416,28 +424,36 @@ static int __init gcmp_probe(unsigned long addr, unsigned long size)
416} 424}
417 425
418#if defined(CONFIG_MIPS_MT_SMP) 426#if defined(CONFIG_MIPS_MT_SMP)
427static void __init fill_ipi_map1(int baseintr, int cpu, int cpupin)
428{
429 int intr = baseintr + cpu;
430 gic_intr_map[intr].intrnum = GIC_EXT_INTR(intr);
431 gic_intr_map[intr].cpunum = cpu;
432 gic_intr_map[intr].pin = cpupin;
433 gic_intr_map[intr].polarity = GIC_POL_POS;
434 gic_intr_map[intr].trigtype = GIC_TRIG_EDGE;
435 gic_intr_map[intr].ipiflag = 1;
436 ipi_map[cpu] |= (1 << (cpupin + 2));
437}
438
419static void __init fill_ipi_map(void) 439static void __init fill_ipi_map(void)
420{ 440{
421 int i; 441 int cpu;
422 442
423 for (i = 0; i < ARRAY_SIZE(gic_intr_map); i++) { 443 for (cpu = 0; cpu < NR_CPUS; cpu++) {
424 if (gic_intr_map[i].ipiflag && (gic_intr_map[i].cpunum != X)) 444 fill_ipi_map1(gic_resched_int_base, cpu, GIC_CPU_INT1);
425 ipi_map[gic_intr_map[i].cpunum] |= 445 fill_ipi_map1(gic_call_int_base, cpu, GIC_CPU_INT2);
426 (1 << (gic_intr_map[i].pin + 2));
427 } 446 }
428} 447}
429#endif 448#endif
430 449
431void __init arch_init_irq(void) 450void __init arch_init_irq(void)
432{ 451{
433 int gic_present, gcmp_present;
434
435 init_i8259_irqs(); 452 init_i8259_irqs();
436 453
437 if (!cpu_has_veic) 454 if (!cpu_has_veic)
438 mips_cpu_irq_init(); 455 mips_cpu_irq_init();
439 456
440 gcmp_present = gcmp_probe(GCMP_BASE_ADDR, GCMP_ADDRSPACE_SZ);
441 if (gcmp_present) { 457 if (gcmp_present) {
442 GCMPGCB(GICBA) = GIC_BASE_ADDR | GCMP_GCB_GICBA_EN_MSK; 458 GCMPGCB(GICBA) = GIC_BASE_ADDR | GCMP_GCB_GICBA_EN_MSK;
443 gic_present = 1; 459 gic_present = 1;
@@ -514,24 +530,10 @@ void __init arch_init_irq(void)
514 if (gic_present) { 530 if (gic_present) {
515 /* FIXME */ 531 /* FIXME */
516 int i; 532 int i;
517 struct { 533
518 unsigned int resched; 534 gic_call_int_base = GIC_NUM_INTRS - NR_CPUS;
519 unsigned int call; 535 gic_resched_int_base = gic_call_int_base - NR_CPUS;
520 } ipiirq[] = { 536
521 {
522 .resched = GIC_IPI_EXT_INTR_RESCHED_VPE0,
523 .call = GIC_IPI_EXT_INTR_CALLFNC_VPE0},
524 {
525 .resched = GIC_IPI_EXT_INTR_RESCHED_VPE1,
526 .call = GIC_IPI_EXT_INTR_CALLFNC_VPE1
527 }, {
528 .resched = GIC_IPI_EXT_INTR_RESCHED_VPE2,
529 .call = GIC_IPI_EXT_INTR_CALLFNC_VPE2
530 }, {
531 .resched = GIC_IPI_EXT_INTR_RESCHED_VPE3,
532 .call = GIC_IPI_EXT_INTR_CALLFNC_VPE3
533 }
534 };
535 fill_ipi_map(); 537 fill_ipi_map();
536 gic_init(GIC_BASE_ADDR, GIC_ADDRSPACE_SZ, gic_intr_map, ARRAY_SIZE(gic_intr_map), MIPS_GIC_IRQ_BASE); 538 gic_init(GIC_BASE_ADDR, GIC_ADDRSPACE_SZ, gic_intr_map, ARRAY_SIZE(gic_intr_map), MIPS_GIC_IRQ_BASE);
537 if (!gcmp_present) { 539 if (!gcmp_present) {
@@ -553,12 +555,15 @@ void __init arch_init_irq(void)
553 printk("CPU%d: status register now %08x\n", smp_processor_id(), read_c0_status()); 555 printk("CPU%d: status register now %08x\n", smp_processor_id(), read_c0_status());
554 write_c0_status(0x1100dc00); 556 write_c0_status(0x1100dc00);
555 printk("CPU%d: status register frc %08x\n", smp_processor_id(), read_c0_status()); 557 printk("CPU%d: status register frc %08x\n", smp_processor_id(), read_c0_status());
556 for (i = 0; i < ARRAY_SIZE(ipiirq); i++) { 558 for (i = 0; i < NR_CPUS; i++) {
557 setup_irq(MIPS_GIC_IRQ_BASE + ipiirq[i].resched, &irq_resched); 559 setup_irq(MIPS_GIC_IRQ_BASE +
558 setup_irq(MIPS_GIC_IRQ_BASE + ipiirq[i].call, &irq_call); 560 GIC_RESCHED_INT(i), &irq_resched);
559 561 setup_irq(MIPS_GIC_IRQ_BASE +
560 set_irq_handler(MIPS_GIC_IRQ_BASE + ipiirq[i].resched, handle_percpu_irq); 562 GIC_CALL_INT(i), &irq_call);
561 set_irq_handler(MIPS_GIC_IRQ_BASE + ipiirq[i].call, handle_percpu_irq); 563 set_irq_handler(MIPS_GIC_IRQ_BASE +
564 GIC_RESCHED_INT(i), handle_percpu_irq);
565 set_irq_handler(MIPS_GIC_IRQ_BASE +
566 GIC_CALL_INT(i), handle_percpu_irq);
562 } 567 }
563 } else { 568 } else {
564 /* set up ipi interrupts */ 569 /* set up ipi interrupts */
diff --git a/arch/mips/mti-malta/malta-reset.c b/arch/mips/mti-malta/malta-reset.c
index 42dee4da37ba..f48d60e84290 100644
--- a/arch/mips/mti-malta/malta-reset.c
+++ b/arch/mips/mti-malta/malta-reset.c
@@ -28,9 +28,6 @@
28#include <asm/reboot.h> 28#include <asm/reboot.h>
29#include <asm/mips-boards/generic.h> 29#include <asm/mips-boards/generic.h>
30 30
31static void mips_machine_restart(char *command);
32static void mips_machine_halt(void);
33
34static void mips_machine_restart(char *command) 31static void mips_machine_restart(char *command)
35{ 32{
36 unsigned int __iomem *softres_reg = 33 unsigned int __iomem *softres_reg =
diff --git a/arch/mips/nxp/pnx8550/common/time.c b/arch/mips/nxp/pnx8550/common/time.c
index 8df43e9e4d90..18b192784877 100644
--- a/arch/mips/nxp/pnx8550/common/time.c
+++ b/arch/mips/nxp/pnx8550/common/time.c
@@ -138,7 +138,7 @@ __init void plat_time_init(void)
138 * HZ timer interrupts per second. 138 * HZ timer interrupts per second.
139 */ 139 */
140 mips_hpt_frequency = 27UL * ((1000000UL * n)/(m * pow2p)); 140 mips_hpt_frequency = 27UL * ((1000000UL * n)/(m * pow2p));
141 cpj = (mips_hpt_frequency + HZ / 2) / HZ; 141 cpj = DIV_ROUND_CLOSEST(mips_hpt_frequency, HZ);
142 write_c0_count(0); 142 write_c0_count(0);
143 timer_ack(); 143 timer_ack();
144 144
diff --git a/arch/mips/pci/Makefile b/arch/mips/pci/Makefile
index e8a97f59e066..63d8a297c58d 100644
--- a/arch/mips/pci/Makefile
+++ b/arch/mips/pci/Makefile
@@ -52,3 +52,8 @@ obj-$(CONFIG_VICTOR_MPC30X) += fixup-mpc30x.o
52obj-$(CONFIG_ZAO_CAPCELLA) += fixup-capcella.o 52obj-$(CONFIG_ZAO_CAPCELLA) += fixup-capcella.o
53obj-$(CONFIG_WR_PPMC) += fixup-wrppmc.o 53obj-$(CONFIG_WR_PPMC) += fixup-wrppmc.o
54obj-$(CONFIG_MIKROTIK_RB532) += pci-rc32434.o ops-rc32434.o fixup-rc32434.o 54obj-$(CONFIG_MIKROTIK_RB532) += pci-rc32434.o ops-rc32434.o fixup-rc32434.o
55obj-$(CONFIG_CPU_CAVIUM_OCTEON) += pci-octeon.o pcie-octeon.o
56
57ifdef CONFIG_PCI_MSI
58obj-$(CONFIG_CPU_CAVIUM_OCTEON) += msi-octeon.o
59endif
diff --git a/arch/mips/pci/fixup-capcella.c b/arch/mips/pci/fixup-capcella.c
index 1416bca6d1a3..1c02f5737367 100644
--- a/arch/mips/pci/fixup-capcella.c
+++ b/arch/mips/pci/fixup-capcella.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * fixup-cappcela.c, The ZAO Networks Capcella specific PCI fixups. 2 * fixup-cappcela.c, The ZAO Networks Capcella specific PCI fixups.
3 * 3 *
4 * Copyright (C) 2002,2004 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> 4 * Copyright (C) 2002,2004 Yoichi Yuasa <yuasa@linux-mips.org>
5 * 5 *
6 * This program is free software; you can redistribute it and/or modify 6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by 7 * it under the terms of the GNU General Public License as published by
diff --git a/arch/mips/pci/fixup-emma2rh.c b/arch/mips/pci/fixup-emma2rh.c
index fba5aad00d51..0d9ccf4dfc5a 100644
--- a/arch/mips/pci/fixup-emma2rh.c
+++ b/arch/mips/pci/fixup-emma2rh.c
@@ -1,7 +1,4 @@
1/* 1/*
2 * arch/mips/pci/fixup-emma2rh.c
3 * This file defines the PCI configration.
4 *
5 * Copyright (C) NEC Electronics Corporation 2004-2006 2 * Copyright (C) NEC Electronics Corporation 2004-2006
6 * 3 *
7 * This file is based on the arch/mips/ddb5xxx/ddb5477/pci.c 4 * This file is based on the arch/mips/ddb5xxx/ddb5477/pci.c
diff --git a/arch/mips/pci/fixup-mpc30x.c b/arch/mips/pci/fixup-mpc30x.c
index 591159625722..e08f49cb6875 100644
--- a/arch/mips/pci/fixup-mpc30x.c
+++ b/arch/mips/pci/fixup-mpc30x.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * fixup-mpc30x.c, The Victor MP-C303/304 specific PCI fixups. 2 * fixup-mpc30x.c, The Victor MP-C303/304 specific PCI fixups.
3 * 3 *
4 * Copyright (C) 2002,2004 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> 4 * Copyright (C) 2002,2004 Yoichi Yuasa <yuasa@linux-mips.org>
5 * 5 *
6 * This program is free software; you can redistribute it and/or modify 6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by 7 * it under the terms of the GNU General Public License as published by
diff --git a/arch/mips/pci/fixup-sb1250.c b/arch/mips/pci/fixup-sb1250.c
index 0ad39e53f7b1..f0bb9146e6c0 100644
--- a/arch/mips/pci/fixup-sb1250.c
+++ b/arch/mips/pci/fixup-sb1250.c
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/mips/pci/fixup-sb1250.c
3 *
4 * Copyright (C) 2004, 2006 MIPS Technologies, Inc. All rights reserved. 2 * Copyright (C) 2004, 2006 MIPS Technologies, Inc. All rights reserved.
5 * Author: Maciej W. Rozycki <macro@mips.com> 3 * Author: Maciej W. Rozycki <macro@mips.com>
6 * 4 *
diff --git a/arch/mips/pci/fixup-tb0219.c b/arch/mips/pci/fixup-tb0219.c
index ed87733f6796..8084b17d4406 100644
--- a/arch/mips/pci/fixup-tb0219.c
+++ b/arch/mips/pci/fixup-tb0219.c
@@ -2,7 +2,7 @@
2 * fixup-tb0219.c, The TANBAC TB0219 specific PCI fixups. 2 * fixup-tb0219.c, The TANBAC TB0219 specific PCI fixups.
3 * 3 *
4 * Copyright (C) 2003 Megasolution Inc. <matsu@megasolution.jp> 4 * Copyright (C) 2003 Megasolution Inc. <matsu@megasolution.jp>
5 * Copyright (C) 2004-2005 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> 5 * Copyright (C) 2004-2005 Yoichi Yuasa <yuasa@linux-mips.org>
6 * 6 *
7 * This program is free software; you can redistribute it and/or modify 7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by 8 * it under the terms of the GNU General Public License as published by
diff --git a/arch/mips/pci/fixup-tb0226.c b/arch/mips/pci/fixup-tb0226.c
index e3eedf4bf9bd..4196ccf3ea3d 100644
--- a/arch/mips/pci/fixup-tb0226.c
+++ b/arch/mips/pci/fixup-tb0226.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * fixup-tb0226.c, The TANBAC TB0226 specific PCI fixups. 2 * fixup-tb0226.c, The TANBAC TB0226 specific PCI fixups.
3 * 3 *
4 * Copyright (C) 2002-2005 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> 4 * Copyright (C) 2002-2005 Yoichi Yuasa <yuasa@linux-mips.org>
5 * 5 *
6 * This program is free software; you can redistribute it and/or modify 6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by 7 * it under the terms of the GNU General Public License as published by
diff --git a/arch/mips/pci/fixup-tb0287.c b/arch/mips/pci/fixup-tb0287.c
index 267ab3dc3d42..2fe29db43725 100644
--- a/arch/mips/pci/fixup-tb0287.c
+++ b/arch/mips/pci/fixup-tb0287.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * fixup-tb0287.c, The TANBAC TB0287 specific PCI fixups. 2 * fixup-tb0287.c, The TANBAC TB0287 specific PCI fixups.
3 * 3 *
4 * Copyright (C) 2005 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> 4 * Copyright (C) 2005 Yoichi Yuasa <yuasa@linux-mips.org>
5 * 5 *
6 * This program is free software; you can redistribute it and/or modify 6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by 7 * it under the terms of the GNU General Public License as published by
diff --git a/arch/mips/cavium-octeon/msi.c b/arch/mips/pci/msi-octeon.c
index 964b03b75a8f..03742e647657 100644
--- a/arch/mips/cavium-octeon/msi.c
+++ b/arch/mips/pci/msi-octeon.c
@@ -3,7 +3,7 @@
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) 2005-2007 Cavium Networks 6 * Copyright (C) 2005-2009 Cavium Networks
7 */ 7 */
8#include <linux/kernel.h> 8#include <linux/kernel.h>
9#include <linux/init.h> 9#include <linux/init.h>
@@ -16,8 +16,7 @@
16#include <asm/octeon/cvmx-pci-defs.h> 16#include <asm/octeon/cvmx-pci-defs.h>
17#include <asm/octeon/cvmx-npei-defs.h> 17#include <asm/octeon/cvmx-npei-defs.h>
18#include <asm/octeon/cvmx-pexp-defs.h> 18#include <asm/octeon/cvmx-pexp-defs.h>
19 19#include <asm/octeon/pci-octeon.h>
20#include "pci-common.h"
21 20
22/* 21/*
23 * Each bit in msi_free_irq_bitmask represents a MSI interrupt that is 22 * Each bit in msi_free_irq_bitmask represents a MSI interrupt that is
@@ -47,8 +46,8 @@ static DEFINE_SPINLOCK(msi_free_irq_bitmask_lock);
47 * programming the MSI control bits [6:4] before calling 46 * programming the MSI control bits [6:4] before calling
48 * pci_enable_msi(). 47 * pci_enable_msi().
49 * 48 *
50 * @param dev Device requesting MSI interrupts 49 * @dev: Device requesting MSI interrupts
51 * @param desc MSI descriptor 50 * @desc: MSI descriptor
52 * 51 *
53 * Returns 0 on success. 52 * Returns 0 on success.
54 */ 53 */
@@ -213,14 +212,9 @@ void arch_teardown_msi_irq(unsigned int irq)
213} 212}
214 213
215 214
216/** 215/*
217 * Called by the interrupt handling code when an MSI interrupt 216 * Called by the interrupt handling code when an MSI interrupt
218 * occurs. 217 * occurs.
219 *
220 * @param cpl
221 * @param dev_id
222 *
223 * @return
224 */ 218 */
225static irqreturn_t octeon_msi_interrupt(int cpl, void *dev_id) 219static irqreturn_t octeon_msi_interrupt(int cpl, void *dev_id)
226{ 220{
@@ -256,31 +250,37 @@ static irqreturn_t octeon_msi_interrupt(int cpl, void *dev_id)
256} 250}
257 251
258 252
259/** 253/*
260 * Initializes the MSI interrupt handling code 254 * Initializes the MSI interrupt handling code
261 *
262 * @return
263 */ 255 */
264int octeon_msi_initialize(void) 256int octeon_msi_initialize(void)
265{ 257{
266 int r;
267 if (octeon_has_feature(OCTEON_FEATURE_PCIE)) { 258 if (octeon_has_feature(OCTEON_FEATURE_PCIE)) {
268 r = request_irq(OCTEON_IRQ_PCI_MSI0, octeon_msi_interrupt, 259 if (request_irq(OCTEON_IRQ_PCI_MSI0, octeon_msi_interrupt,
269 IRQF_SHARED, 260 IRQF_SHARED,
270 "MSI[0:63]", octeon_msi_interrupt); 261 "MSI[0:63]", octeon_msi_interrupt))
262 panic("request_irq(OCTEON_IRQ_PCI_MSI0) failed");
271 } else if (octeon_is_pci_host()) { 263 } else if (octeon_is_pci_host()) {
272 r = request_irq(OCTEON_IRQ_PCI_MSI0, octeon_msi_interrupt, 264 if (request_irq(OCTEON_IRQ_PCI_MSI0, octeon_msi_interrupt,
273 IRQF_SHARED, 265 IRQF_SHARED,
274 "MSI[0:15]", octeon_msi_interrupt); 266 "MSI[0:15]", octeon_msi_interrupt))
275 r += request_irq(OCTEON_IRQ_PCI_MSI1, octeon_msi_interrupt, 267 panic("request_irq(OCTEON_IRQ_PCI_MSI0) failed");
276 IRQF_SHARED, 268
277 "MSI[16:31]", octeon_msi_interrupt); 269 if (request_irq(OCTEON_IRQ_PCI_MSI1, octeon_msi_interrupt,
278 r += request_irq(OCTEON_IRQ_PCI_MSI2, octeon_msi_interrupt, 270 IRQF_SHARED,
279 IRQF_SHARED, 271 "MSI[16:31]", octeon_msi_interrupt))
280 "MSI[32:47]", octeon_msi_interrupt); 272 panic("request_irq(OCTEON_IRQ_PCI_MSI1) failed");
281 r += request_irq(OCTEON_IRQ_PCI_MSI3, octeon_msi_interrupt, 273
282 IRQF_SHARED, 274 if (request_irq(OCTEON_IRQ_PCI_MSI2, octeon_msi_interrupt,
283 "MSI[48:63]", octeon_msi_interrupt); 275 IRQF_SHARED,
276 "MSI[32:47]", octeon_msi_interrupt))
277 panic("request_irq(OCTEON_IRQ_PCI_MSI2) failed");
278
279 if (request_irq(OCTEON_IRQ_PCI_MSI3, octeon_msi_interrupt,
280 IRQF_SHARED,
281 "MSI[48:63]", octeon_msi_interrupt))
282 panic("request_irq(OCTEON_IRQ_PCI_MSI3) failed");
283
284 } 284 }
285 return 0; 285 return 0;
286} 286}
diff --git a/arch/mips/pci/ops-emma2rh.c b/arch/mips/pci/ops-emma2rh.c
index 5947a70b0b7f..710aef5c070e 100644
--- a/arch/mips/pci/ops-emma2rh.c
+++ b/arch/mips/pci/ops-emma2rh.c
@@ -1,7 +1,4 @@
1/* 1/*
2 * arch/mips/pci/ops-emma2rh.c
3 * This file defines the PCI operation for EMMA2RH.
4 *
5 * Copyright (C) NEC Electronics Corporation 2004-2006 2 * Copyright (C) NEC Electronics Corporation 2004-2006
6 * 3 *
7 * This file is based on the arch/mips/pci/ops-vr41xx.c 4 * This file is based on the arch/mips/pci/ops-vr41xx.c
diff --git a/arch/mips/pci/ops-vr41xx.c b/arch/mips/pci/ops-vr41xx.c
index 900c6b32576c..28962a7c6606 100644
--- a/arch/mips/pci/ops-vr41xx.c
+++ b/arch/mips/pci/ops-vr41xx.c
@@ -2,8 +2,8 @@
2 * ops-vr41xx.c, PCI configuration routines for the PCIU of NEC VR4100 series. 2 * ops-vr41xx.c, PCI configuration routines for the PCIU of NEC VR4100 series.
3 * 3 *
4 * Copyright (C) 2001-2003 MontaVista Software Inc. 4 * Copyright (C) 2001-2003 MontaVista Software Inc.
5 * Author: Yoichi Yuasa <yyuasa@mvista.com or source@mvista.com> 5 * Author: Yoichi Yuasa <source@mvista.com>
6 * Copyright (C) 2004-2005 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> 6 * Copyright (C) 2004-2005 Yoichi Yuasa <yuasa@linux-mips.org>
7 * 7 *
8 * This program is free software; you can redistribute it and/or modify 8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by 9 * it under the terms of the GNU General Public License as published by
@@ -21,7 +21,7 @@
21 */ 21 */
22/* 22/*
23 * Changes: 23 * Changes:
24 * MontaVista Software Inc. <yyuasa@mvista.com> or <source@mvista.com> 24 * MontaVista Software Inc. <source@mvista.com>
25 * - New creation, NEC VR4122 and VR4131 are supported. 25 * - New creation, NEC VR4122 and VR4131 are supported.
26 */ 26 */
27#include <linux/pci.h> 27#include <linux/pci.h>
diff --git a/arch/mips/pci/pci-emma2rh.c b/arch/mips/pci/pci-emma2rh.c
index 2df4190232cd..773e34ff4d1c 100644
--- a/arch/mips/pci/pci-emma2rh.c
+++ b/arch/mips/pci/pci-emma2rh.c
@@ -1,7 +1,4 @@
1/* 1/*
2 * arch/mips/pci/pci-emma2rh.c
3 * This file defines the PCI configration.
4 *
5 * Copyright (C) NEC Electronics Corporation 2004-2006 2 * Copyright (C) NEC Electronics Corporation 2004-2006
6 * 3 *
7 * This file is based on the arch/mips/ddb5xxx/ddb5477/pci.c 4 * This file is based on the arch/mips/ddb5xxx/ddb5477/pci.c
diff --git a/arch/mips/cavium-octeon/pci.c b/arch/mips/pci/pci-octeon.c
index 67c0ff5e92f1..9cb0c807f564 100644
--- a/arch/mips/cavium-octeon/pci.c
+++ b/arch/mips/pci/pci-octeon.c
@@ -3,7 +3,7 @@
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) 2005-2007 Cavium Networks 6 * Copyright (C) 2005-2009 Cavium Networks
7 */ 7 */
8#include <linux/kernel.h> 8#include <linux/kernel.h>
9#include <linux/init.h> 9#include <linux/init.h>
@@ -17,8 +17,7 @@
17#include <asm/octeon/octeon.h> 17#include <asm/octeon/octeon.h>
18#include <asm/octeon/cvmx-npi-defs.h> 18#include <asm/octeon/cvmx-npi-defs.h>
19#include <asm/octeon/cvmx-pci-defs.h> 19#include <asm/octeon/cvmx-pci-defs.h>
20 20#include <asm/octeon/pci-octeon.h>
21#include "pci-common.h"
22 21
23#define USE_OCTEON_INTERNAL_ARBITER 22#define USE_OCTEON_INTERNAL_ARBITER
24 23
@@ -54,6 +53,126 @@ union octeon_pci_address {
54 } s; 53 } s;
55}; 54};
56 55
56int __initdata (*octeon_pcibios_map_irq)(const struct pci_dev *dev,
57 u8 slot, u8 pin);
58enum octeon_dma_bar_type octeon_dma_bar_type = OCTEON_DMA_BAR_TYPE_INVALID;
59
60/**
61 * Map a PCI device to the appropriate interrupt line
62 *
63 * @dev: The Linux PCI device structure for the device to map
64 * @slot: The slot number for this device on __BUS 0__. Linux
65 * enumerates through all the bridges and figures out the
66 * slot on Bus 0 where this device eventually hooks to.
67 * @pin: The PCI interrupt pin read from the device, then swizzled
68 * as it goes through each bridge.
69 * Returns Interrupt number for the device
70 */
71int __init pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
72{
73 if (octeon_pcibios_map_irq)
74 return octeon_pcibios_map_irq(dev, slot, pin);
75 else
76 panic("octeon_pcibios_map_irq not set.");
77}
78
79
80/*
81 * Called to perform platform specific PCI setup
82 */
83int pcibios_plat_dev_init(struct pci_dev *dev)
84{
85 uint16_t config;
86 uint32_t dconfig;
87 int pos;
88 /*
89 * Force the Cache line setting to 64 bytes. The standard
90 * Linux bus scan doesn't seem to set it. Octeon really has
91 * 128 byte lines, but Intel bridges get really upset if you
92 * try and set values above 64 bytes. Value is specified in
93 * 32bit words.
94 */
95 pci_write_config_byte(dev, PCI_CACHE_LINE_SIZE, 64 / 4);
96 /* Set latency timers for all devices */
97 pci_write_config_byte(dev, PCI_LATENCY_TIMER, 48);
98
99 /* Enable reporting System errors and parity errors on all devices */
100 /* Enable parity checking and error reporting */
101 pci_read_config_word(dev, PCI_COMMAND, &config);
102 config |= PCI_COMMAND_PARITY | PCI_COMMAND_SERR;
103 pci_write_config_word(dev, PCI_COMMAND, config);
104
105 if (dev->subordinate) {
106 /* Set latency timers on sub bridges */
107 pci_write_config_byte(dev, PCI_SEC_LATENCY_TIMER, 48);
108 /* More bridge error detection */
109 pci_read_config_word(dev, PCI_BRIDGE_CONTROL, &config);
110 config |= PCI_BRIDGE_CTL_PARITY | PCI_BRIDGE_CTL_SERR;
111 pci_write_config_word(dev, PCI_BRIDGE_CONTROL, config);
112 }
113
114 /* Enable the PCIe normal error reporting */
115 pos = pci_find_capability(dev, PCI_CAP_ID_EXP);
116 if (pos) {
117 /* Update Device Control */
118 pci_read_config_word(dev, pos + PCI_EXP_DEVCTL, &config);
119 /* Correctable Error Reporting */
120 config |= PCI_EXP_DEVCTL_CERE;
121 /* Non-Fatal Error Reporting */
122 config |= PCI_EXP_DEVCTL_NFERE;
123 /* Fatal Error Reporting */
124 config |= PCI_EXP_DEVCTL_FERE;
125 /* Unsupported Request */
126 config |= PCI_EXP_DEVCTL_URRE;
127 pci_write_config_word(dev, pos + PCI_EXP_DEVCTL, config);
128 }
129
130 /* Find the Advanced Error Reporting capability */
131 pos = pci_find_ext_capability(dev, PCI_EXT_CAP_ID_ERR);
132 if (pos) {
133 /* Clear Uncorrectable Error Status */
134 pci_read_config_dword(dev, pos + PCI_ERR_UNCOR_STATUS,
135 &dconfig);
136 pci_write_config_dword(dev, pos + PCI_ERR_UNCOR_STATUS,
137 dconfig);
138 /* Enable reporting of all uncorrectable errors */
139 /* Uncorrectable Error Mask - turned on bits disable errors */
140 pci_write_config_dword(dev, pos + PCI_ERR_UNCOR_MASK, 0);
141 /*
142 * Leave severity at HW default. This only controls if
143 * errors are reported as uncorrectable or
144 * correctable, not if the error is reported.
145 */
146 /* PCI_ERR_UNCOR_SEVER - Uncorrectable Error Severity */
147 /* Clear Correctable Error Status */
148 pci_read_config_dword(dev, pos + PCI_ERR_COR_STATUS, &dconfig);
149 pci_write_config_dword(dev, pos + PCI_ERR_COR_STATUS, dconfig);
150 /* Enable reporting of all correctable errors */
151 /* Correctable Error Mask - turned on bits disable errors */
152 pci_write_config_dword(dev, pos + PCI_ERR_COR_MASK, 0);
153 /* Advanced Error Capabilities */
154 pci_read_config_dword(dev, pos + PCI_ERR_CAP, &dconfig);
155 /* ECRC Generation Enable */
156 if (config & PCI_ERR_CAP_ECRC_GENC)
157 config |= PCI_ERR_CAP_ECRC_GENE;
158 /* ECRC Check Enable */
159 if (config & PCI_ERR_CAP_ECRC_CHKC)
160 config |= PCI_ERR_CAP_ECRC_CHKE;
161 pci_write_config_dword(dev, pos + PCI_ERR_CAP, dconfig);
162 /* PCI_ERR_HEADER_LOG - Header Log Register (16 bytes) */
163 /* Report all errors to the root complex */
164 pci_write_config_dword(dev, pos + PCI_ERR_ROOT_COMMAND,
165 PCI_ERR_ROOT_CMD_COR_EN |
166 PCI_ERR_ROOT_CMD_NONFATAL_EN |
167 PCI_ERR_ROOT_CMD_FATAL_EN);
168 /* Clear the Root status register */
169 pci_read_config_dword(dev, pos + PCI_ERR_ROOT_STATUS, &dconfig);
170 pci_write_config_dword(dev, pos + PCI_ERR_ROOT_STATUS, dconfig);
171 }
172
173 return 0;
174}
175
57/** 176/**
58 * Return the mapping of PCI device number to IRQ line. Each 177 * Return the mapping of PCI device number to IRQ line. Each
59 * character in the return string represents the interrupt 178 * character in the return string represents the interrupt
@@ -136,9 +255,8 @@ int __init octeon_pci_pcibios_map_irq(const struct pci_dev *dev,
136} 255}
137 256
138 257
139/** 258/*
140 * Read a value from configuration space 259 * Read a value from configuration space
141 *
142 */ 260 */
143static int octeon_read_config(struct pci_bus *bus, unsigned int devfn, 261static int octeon_read_config(struct pci_bus *bus, unsigned int devfn,
144 int reg, int size, u32 *val) 262 int reg, int size, u32 *val)
@@ -174,15 +292,8 @@ static int octeon_read_config(struct pci_bus *bus, unsigned int devfn,
174} 292}
175 293
176 294
177/** 295/*
178 * Write a value to PCI configuration space 296 * Write a value to PCI configuration space
179 *
180 * @bus:
181 * @devfn:
182 * @reg:
183 * @size:
184 * @val:
185 * Returns
186 */ 297 */
187static int octeon_write_config(struct pci_bus *bus, unsigned int devfn, 298static int octeon_write_config(struct pci_bus *bus, unsigned int devfn,
188 int reg, int size, u32 val) 299 int reg, int size, u32 val)
@@ -251,10 +362,8 @@ static struct pci_controller octeon_pci_controller = {
251}; 362};
252 363
253 364
254/** 365/*
255 * Low level initialize the Octeon PCI controller 366 * Low level initialize the Octeon PCI controller
256 *
257 * Returns
258 */ 367 */
259static void octeon_pci_initialize(void) 368static void octeon_pci_initialize(void)
260{ 369{
@@ -398,7 +507,7 @@ static void octeon_pci_initialize(void)
398 pci_int_arb_cfg.s.en = 1; /* Internal arbiter enable */ 507 pci_int_arb_cfg.s.en = 1; /* Internal arbiter enable */
399 cvmx_write_csr(CVMX_NPI_PCI_INT_ARB_CFG, pci_int_arb_cfg.u64); 508 cvmx_write_csr(CVMX_NPI_PCI_INT_ARB_CFG, pci_int_arb_cfg.u64);
400 } 509 }
401#endif /* USE_OCTEON_INTERNAL_ARBITER */ 510#endif /* USE_OCTEON_INTERNAL_ARBITER */
402 511
403 /* 512 /*
404 * Preferrably written to 1 to set MLTD. [RDSATI,TRTAE, 513 * Preferrably written to 1 to set MLTD. [RDSATI,TRTAE,
@@ -457,10 +566,8 @@ static void octeon_pci_initialize(void)
457} 566}
458 567
459 568
460/** 569/*
461 * Initialize the Octeon PCI controller 570 * Initialize the Octeon PCI controller
462 *
463 * Returns
464 */ 571 */
465static int __init octeon_pci_setup(void) 572static int __init octeon_pci_setup(void)
466{ 573{
diff --git a/arch/mips/pci/pci-tx4927.c b/arch/mips/pci/pci-tx4927.c
index aaa900596792..a5807406a7f1 100644
--- a/arch/mips/pci/pci-tx4927.c
+++ b/arch/mips/pci/pci-tx4927.c
@@ -1,6 +1,4 @@
1/* 1/*
2 * linux/arch/mips/pci/pci-tx4927.c
3 *
4 * Based on linux/arch/mips/txx9/rbtx4938/setup.c, 2 * Based on linux/arch/mips/txx9/rbtx4938/setup.c,
5 * and RBTX49xx patch from CELF patch archive. 3 * and RBTX49xx patch from CELF patch archive.
6 * 4 *
diff --git a/arch/mips/pci/pci-tx4938.c b/arch/mips/pci/pci-tx4938.c
index 1ea257bc3b8f..20e45f30b2ef 100644
--- a/arch/mips/pci/pci-tx4938.c
+++ b/arch/mips/pci/pci-tx4938.c
@@ -1,6 +1,4 @@
1/* 1/*
2 * linux/arch/mips/pci/pci-tx4938.c
3 *
4 * Based on linux/arch/mips/txx9/rbtx4938/setup.c, 2 * Based on linux/arch/mips/txx9/rbtx4938/setup.c,
5 * and RBTX49xx patch from CELF patch archive. 3 * and RBTX49xx patch from CELF patch archive.
6 * 4 *
diff --git a/arch/mips/pci/pci-tx4939.c b/arch/mips/pci/pci-tx4939.c
index 5fecf1cdc325..9ef840693baf 100644
--- a/arch/mips/pci/pci-tx4939.c
+++ b/arch/mips/pci/pci-tx4939.c
@@ -1,6 +1,4 @@
1/* 1/*
2 * linux/arch/mips/pci/pci-tx4939.c
3 *
4 * Based on linux/arch/mips/txx9/rbtx4939/setup.c, 2 * Based on linux/arch/mips/txx9/rbtx4939/setup.c,
5 * and RBTX49xx patch from CELF patch archive. 3 * and RBTX49xx patch from CELF patch archive.
6 * 4 *
diff --git a/arch/mips/pci/pci-vr41xx.c b/arch/mips/pci/pci-vr41xx.c
index d1e049b55f34..56525711f8b7 100644
--- a/arch/mips/pci/pci-vr41xx.c
+++ b/arch/mips/pci/pci-vr41xx.c
@@ -2,8 +2,8 @@
2 * pci-vr41xx.c, PCI Control Unit routines for the NEC VR4100 series. 2 * pci-vr41xx.c, PCI Control Unit routines for the NEC VR4100 series.
3 * 3 *
4 * Copyright (C) 2001-2003 MontaVista Software Inc. 4 * Copyright (C) 2001-2003 MontaVista Software Inc.
5 * Author: Yoichi Yuasa <yyuasa@mvista.com or source@mvista.com> 5 * Author: Yoichi Yuasa <source@mvista.com>
6 * Copyright (C) 2004-2008 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> 6 * Copyright (C) 2004-2008 Yoichi Yuasa <yuasa@linux-mips.org>
7 * Copyright (C) 2004 by Ralf Baechle (ralf@linux-mips.org) 7 * Copyright (C) 2004 by Ralf Baechle (ralf@linux-mips.org)
8 * 8 *
9 * This program is free software; you can redistribute it and/or modify 9 * This program is free software; you can redistribute it and/or modify
@@ -22,7 +22,7 @@
22 */ 22 */
23/* 23/*
24 * Changes: 24 * Changes:
25 * MontaVista Software Inc. <yyuasa@mvista.com> or <source@mvista.com> 25 * MontaVista Software Inc. <source@mvista.com>
26 * - New creation, NEC VR4122 and VR4131 are supported. 26 * - New creation, NEC VR4122 and VR4131 are supported.
27 */ 27 */
28#include <linux/init.h> 28#include <linux/init.h>
diff --git a/arch/mips/pci/pci-vr41xx.h b/arch/mips/pci/pci-vr41xx.h
index 8a35e32b8376..6b1ae2eb1c06 100644
--- a/arch/mips/pci/pci-vr41xx.h
+++ b/arch/mips/pci/pci-vr41xx.h
@@ -2,8 +2,8 @@
2 * pci-vr41xx.h, Include file for PCI Control Unit of the NEC VR4100 series. 2 * pci-vr41xx.h, Include file for PCI Control Unit of the NEC VR4100 series.
3 * 3 *
4 * Copyright (C) 2002 MontaVista Software Inc. 4 * Copyright (C) 2002 MontaVista Software Inc.
5 * Author: Yoichi Yuasa <yyuasa@mvista.com or source@mvista.com> 5 * Author: Yoichi Yuasa <source@mvista.com>
6 * Copyright (C) 2004-2005 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> 6 * Copyright (C) 2004-2005 Yoichi Yuasa <yuasa@linux-mips.org>
7 * 7 *
8 * This program is free software; you can redistribute it and/or modify 8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by 9 * it under the terms of the GNU General Public License as published by
diff --git a/arch/mips/cavium-octeon/pcie.c b/arch/mips/pci/pcie-octeon.c
index 49d14081b3b5..6aa5c542d52d 100644
--- a/arch/mips/cavium-octeon/pcie.c
+++ b/arch/mips/pci/pcie-octeon.c
@@ -18,8 +18,7 @@
18#include <asm/octeon/cvmx-pescx-defs.h> 18#include <asm/octeon/cvmx-pescx-defs.h>
19#include <asm/octeon/cvmx-pexp-defs.h> 19#include <asm/octeon/cvmx-pexp-defs.h>
20#include <asm/octeon/cvmx-helper-errata.h> 20#include <asm/octeon/cvmx-helper-errata.h>
21 21#include <asm/octeon/pci-octeon.h>
22#include "pci-common.h"
23 22
24union cvmx_pcie_address { 23union cvmx_pcie_address {
25 uint64_t u64; 24 uint64_t u64;
@@ -976,13 +975,13 @@ static int cvmx_pcie_rc_initialize(int pcie_port)
976/** 975/**
977 * Map a PCI device to the appropriate interrupt line 976 * Map a PCI device to the appropriate interrupt line
978 * 977 *
979 * @param dev The Linux PCI device structure for the device to map 978 * @dev: The Linux PCI device structure for the device to map
980 * @param slot The slot number for this device on __BUS 0__. Linux 979 * @slot: The slot number for this device on __BUS 0__. Linux
981 * enumerates through all the bridges and figures out the 980 * enumerates through all the bridges and figures out the
982 * slot on Bus 0 where this device eventually hooks to. 981 * slot on Bus 0 where this device eventually hooks to.
983 * @param pin The PCI interrupt pin read from the device, then swizzled 982 * @pin: The PCI interrupt pin read from the device, then swizzled
984 * as it goes through each bridge. 983 * as it goes through each bridge.
985 * @return Interrupt number for the device 984 * Returns Interrupt number for the device
986 */ 985 */
987int __init octeon_pcie_pcibios_map_irq(const struct pci_dev *dev, 986int __init octeon_pcie_pcibios_map_irq(const struct pci_dev *dev,
988 u8 slot, u8 pin) 987 u8 slot, u8 pin)
@@ -1025,12 +1024,12 @@ int __init octeon_pcie_pcibios_map_irq(const struct pci_dev *dev,
1025/** 1024/**
1026 * Read a value from configuration space 1025 * Read a value from configuration space
1027 * 1026 *
1028 * @param bus 1027 * @bus:
1029 * @param devfn 1028 * @devfn:
1030 * @param reg 1029 * @reg:
1031 * @param size 1030 * @size:
1032 * @param val 1031 * @val:
1033 * @return 1032 * Returns
1034 */ 1033 */
1035static inline int octeon_pcie_read_config(int pcie_port, struct pci_bus *bus, 1034static inline int octeon_pcie_read_config(int pcie_port, struct pci_bus *bus,
1036 unsigned int devfn, int reg, int size, 1035 unsigned int devfn, int reg, int size,
@@ -1041,19 +1040,29 @@ static inline int octeon_pcie_read_config(int pcie_port, struct pci_bus *bus,
1041 int bus_number = bus->number; 1040 int bus_number = bus->number;
1042 1041
1043 /* 1042 /*
1044 * We need to force the bus number to be zero on the root 1043 * For the top level bus make sure our hardware bus number
1045 * bus. Linux numbers the 2nd root bus to start after all 1044 * matches the software one.
1046 * buses on root 0.
1047 */ 1045 */
1048 if (bus->parent == NULL) 1046 if (bus->parent == NULL) {
1049 bus_number = 0; 1047 union cvmx_pciercx_cfg006 pciercx_cfg006;
1048 pciercx_cfg006.u32 = cvmx_pcie_cfgx_read(pcie_port,
1049 CVMX_PCIERCX_CFG006(pcie_port));
1050 if (pciercx_cfg006.s.pbnum != bus_number) {
1051 pciercx_cfg006.s.pbnum = bus_number;
1052 pciercx_cfg006.s.sbnum = bus_number;
1053 pciercx_cfg006.s.subbnum = bus_number;
1054 cvmx_pcie_cfgx_write(pcie_port,
1055 CVMX_PCIERCX_CFG006(pcie_port),
1056 pciercx_cfg006.u32);
1057 }
1058 }
1050 1059
1051 /* 1060 /*
1052 * PCIe only has a single device connected to Octeon. It is 1061 * PCIe only has a single device connected to Octeon. It is
1053 * always device ID 0. Don't bother doing reads for other 1062 * always device ID 0. Don't bother doing reads for other
1054 * device IDs on the first segment. 1063 * device IDs on the first segment.
1055 */ 1064 */
1056 if ((bus_number == 0) && (devfn >> 3 != 0)) 1065 if ((bus->parent == NULL) && (devfn >> 3 != 0))
1057 return PCIBIOS_FUNC_NOT_SUPPORTED; 1066 return PCIBIOS_FUNC_NOT_SUPPORTED;
1058 1067
1059 /* 1068 /*
@@ -1071,7 +1080,7 @@ static inline int octeon_pcie_read_config(int pcie_port, struct pci_bus *bus,
1071 * bridge only respondes to device ID 0, function 1080 * bridge only respondes to device ID 0, function
1072 * 0-1 1081 * 0-1
1073 */ 1082 */
1074 if ((bus_number == 0) && (devfn >= 2)) 1083 if ((bus->parent == NULL) && (devfn >= 2))
1075 return PCIBIOS_FUNC_NOT_SUPPORTED; 1084 return PCIBIOS_FUNC_NOT_SUPPORTED;
1076 /* 1085 /*
1077 * The PCI-X slots are device ID 2,3. Choose one of 1086 * The PCI-X slots are device ID 2,3. Choose one of
@@ -1156,25 +1165,18 @@ static int octeon_pcie1_read_config(struct pci_bus *bus, unsigned int devfn,
1156/** 1165/**
1157 * Write a value to PCI configuration space 1166 * Write a value to PCI configuration space
1158 * 1167 *
1159 * @param bus 1168 * @bus:
1160 * @param devfn 1169 * @devfn:
1161 * @param reg 1170 * @reg:
1162 * @param size 1171 * @size:
1163 * @param val 1172 * @val:
1164 * @return 1173 * Returns
1165 */ 1174 */
1166static inline int octeon_pcie_write_config(int pcie_port, struct pci_bus *bus, 1175static inline int octeon_pcie_write_config(int pcie_port, struct pci_bus *bus,
1167 unsigned int devfn, int reg, 1176 unsigned int devfn, int reg,
1168 int size, u32 val) 1177 int size, u32 val)
1169{ 1178{
1170 int bus_number = bus->number; 1179 int bus_number = bus->number;
1171 /*
1172 * We need to force the bus number to be zero on the root
1173 * bus. Linux numbers the 2nd root bus to start after all
1174 * busses on root 0.
1175 */
1176 if (bus->parent == NULL)
1177 bus_number = 0;
1178 1180
1179 switch (size) { 1181 switch (size) {
1180 case 4: 1182 case 4:
@@ -1254,7 +1256,7 @@ static struct pci_controller octeon_pcie1_controller = {
1254/** 1256/**
1255 * Initialize the Octeon PCIe controllers 1257 * Initialize the Octeon PCIe controllers
1256 * 1258 *
1257 * @return 1259 * Returns
1258 */ 1260 */
1259static int __init octeon_pcie_setup(void) 1261static int __init octeon_pcie_setup(void)
1260{ 1262{
diff --git a/arch/mips/pmc-sierra/msp71xx/gpio.c b/arch/mips/pmc-sierra/msp71xx/gpio.c
index 69848c5813e2..aaccbe524386 100644
--- a/arch/mips/pmc-sierra/msp71xx/gpio.c
+++ b/arch/mips/pmc-sierra/msp71xx/gpio.c
@@ -1,6 +1,4 @@
1/* 1/*
2 * @file /arch/mips/pmc-sierra/msp71xx/gpio.c
3 *
4 * Generic PMC MSP71xx GPIO handling. These base gpio are controlled by two 2 * Generic PMC MSP71xx GPIO handling. These base gpio are controlled by two
5 * types of registers. The data register sets the output level when in output 3 * types of registers. The data register sets the output level when in output
6 * mode and when in input mode will contain the value at the input. The config 4 * mode and when in input mode will contain the value at the input. The config
diff --git a/arch/mips/pmc-sierra/msp71xx/gpio_extended.c b/arch/mips/pmc-sierra/msp71xx/gpio_extended.c
index fc6dbc6cf1c0..2a99f360fae4 100644
--- a/arch/mips/pmc-sierra/msp71xx/gpio_extended.c
+++ b/arch/mips/pmc-sierra/msp71xx/gpio_extended.c
@@ -1,6 +1,4 @@
1/* 1/*
2 * @file /arch/mips/pmc-sierra/msp71xx/gpio_extended.c
3 *
4 * Generic PMC MSP71xx EXTENDED (EXD) GPIO handling. The extended gpio is 2 * Generic PMC MSP71xx EXTENDED (EXD) GPIO handling. The extended gpio is
5 * a set of hardware registers that have no need for explicit locking as 3 * a set of hardware registers that have no need for explicit locking as
6 * it is handled by unique method of writing individual set/clr bits. 4 * it is handled by unique method of writing individual set/clr bits.
diff --git a/arch/mips/pmc-sierra/msp71xx/msp_irq_slp.c b/arch/mips/pmc-sierra/msp71xx/msp_irq_slp.c
index f5f1b8d2bb9a..61f390232346 100644
--- a/arch/mips/pmc-sierra/msp71xx/msp_irq_slp.c
+++ b/arch/mips/pmc-sierra/msp71xx/msp_irq_slp.c
@@ -45,13 +45,6 @@ static inline void mask_msp_slp_irq(unsigned int irq)
45 */ 45 */
46static inline void ack_msp_slp_irq(unsigned int irq) 46static inline void ack_msp_slp_irq(unsigned int irq)
47{ 47{
48 mask_slp_irq(irq);
49
50 /*
51 * only really necessary for 18, 16-14 and sometimes 3:0 (since
52 * these can be edge sensitive) but it doesn't hurt for the others.
53 */
54
55 /* check for PER interrupt range */ 48 /* check for PER interrupt range */
56 if (irq < MSP_PER_INTBASE) 49 if (irq < MSP_PER_INTBASE)
57 *SLP_INT_STS_REG = (1 << (irq - MSP_SLP_INTBASE)); 50 *SLP_INT_STS_REG = (1 << (irq - MSP_SLP_INTBASE));
@@ -62,8 +55,7 @@ static inline void ack_msp_slp_irq(unsigned int irq)
62static struct irq_chip msp_slp_irq_controller = { 55static struct irq_chip msp_slp_irq_controller = {
63 .name = "MSP_SLP", 56 .name = "MSP_SLP",
64 .ack = ack_msp_slp_irq, 57 .ack = ack_msp_slp_irq,
65 .mask = ack_msp_slp_irq, 58 .mask = mask_msp_slp_irq,
66 .mask_ack = ack_msp_slp_irq,
67 .unmask = unmask_msp_slp_irq, 59 .unmask = unmask_msp_slp_irq,
68}; 60};
69 61
@@ -79,7 +71,7 @@ void __init msp_slp_irq_init(void)
79 71
80 /* initialize all the IRQ descriptors */ 72 /* initialize all the IRQ descriptors */
81 for (i = MSP_SLP_INTBASE; i < MSP_PER_INTBASE + 32; i++) 73 for (i = MSP_SLP_INTBASE; i < MSP_PER_INTBASE + 32; i++)
82 set_irq_chip_and_handler(i, &msp_slp_irq_controller 74 set_irq_chip_and_handler(i, &msp_slp_irq_controller,
83 handle_level_irq); 75 handle_level_irq);
84} 76}
85 77
diff --git a/arch/mips/pmc-sierra/yosemite/atmel_read_eeprom.c b/arch/mips/pmc-sierra/yosemite/atmel_read_eeprom.c
index caf5e9a0acc7..fc990cb31941 100644
--- a/arch/mips/pmc-sierra/yosemite/atmel_read_eeprom.c
+++ b/arch/mips/pmc-sierra/yosemite/atmel_read_eeprom.c
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/mips/pmc-sierra/yosemite/atmel_read_eeprom.c
3 *
4 * Copyright (C) 2003 PMC-Sierra Inc. 2 * Copyright (C) 2003 PMC-Sierra Inc.
5 * Author: Manish Lachwani (lachwani@pmc-sierra.com) 3 * Author: Manish Lachwani (lachwani@pmc-sierra.com)
6 * 4 *
diff --git a/arch/mips/sibyte/swarm/swarm-i2c.c b/arch/mips/sibyte/swarm/swarm-i2c.c
index 4282ac9d01d2..062505054d42 100644
--- a/arch/mips/sibyte/swarm/swarm-i2c.c
+++ b/arch/mips/sibyte/swarm/swarm-i2c.c
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/mips/sibyte/swarm/swarm-i2c.c
3 *
4 * Broadcom BCM91250A (SWARM), etc. I2C platform setup. 2 * Broadcom BCM91250A (SWARM), etc. I2C platform setup.
5 * 3 *
6 * Copyright (c) 2008 Maciej W. Rozycki 4 * Copyright (c) 2008 Maciej W. Rozycki
diff --git a/arch/mips/txx9/generic/mem_tx4927.c b/arch/mips/txx9/generic/mem_tx4927.c
index ef6ea6e97873..70f9626f8227 100644
--- a/arch/mips/txx9/generic/mem_tx4927.c
+++ b/arch/mips/txx9/generic/mem_tx4927.c
@@ -1,6 +1,4 @@
1/* 1/*
2 * linux/arch/mips/txx9/generic/mem_tx4927.c
3 *
4 * common tx4927 memory interface 2 * common tx4927 memory interface
5 * 3 *
6 * Author: MontaVista Software, Inc. 4 * Author: MontaVista Software, Inc.
diff --git a/arch/mips/txx9/generic/setup.c b/arch/mips/txx9/generic/setup.c
index 3b7d77d61ce0..a205e2ba8e7b 100644
--- a/arch/mips/txx9/generic/setup.c
+++ b/arch/mips/txx9/generic/setup.c
@@ -1,6 +1,4 @@
1/* 1/*
2 * linux/arch/mips/txx9/generic/setup.c
3 *
4 * Based on linux/arch/mips/txx9/rbtx4938/setup.c, 2 * Based on linux/arch/mips/txx9/rbtx4938/setup.c,
5 * and RBTX49xx patch from CELF patch archive. 3 * and RBTX49xx patch from CELF patch archive.
6 * 4 *
diff --git a/arch/mips/txx9/rbtx4939/setup.c b/arch/mips/txx9/rbtx4939/setup.c
index c033ffe71cdf..b0c241ecf603 100644
--- a/arch/mips/txx9/rbtx4939/setup.c
+++ b/arch/mips/txx9/rbtx4939/setup.c
@@ -512,10 +512,10 @@ static void __init rbtx4939_setup(void)
512 rbtx4939_ebusc_setup(); 512 rbtx4939_ebusc_setup();
513 /* always enable ATA0 */ 513 /* always enable ATA0 */
514 txx9_set64(&tx4939_ccfgptr->pcfg, TX4939_PCFG_ATA0MODE); 514 txx9_set64(&tx4939_ccfgptr->pcfg, TX4939_PCFG_ATA0MODE);
515 rbtx4939_update_ioc_pen();
516 if (txx9_master_clock == 0) 515 if (txx9_master_clock == 0)
517 txx9_master_clock = 20000000; 516 txx9_master_clock = 20000000;
518 tx4939_setup(); 517 tx4939_setup();
518 rbtx4939_update_ioc_pen();
519#ifdef HAVE_RBTX4939_IOSWAB 519#ifdef HAVE_RBTX4939_IOSWAB
520 ioswabw = rbtx4939_ioswabw; 520 ioswabw = rbtx4939_ioswabw;
521 __mem_ioswabw = rbtx4939_mem_ioswabw; 521 __mem_ioswabw = rbtx4939_mem_ioswabw;
diff --git a/arch/mips/vr41xx/casio-e55/setup.c b/arch/mips/vr41xx/casio-e55/setup.c
index 6d9bab890587..719f4a5b9844 100644
--- a/arch/mips/vr41xx/casio-e55/setup.c
+++ b/arch/mips/vr41xx/casio-e55/setup.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * setup.c, Setup for the CASIO CASSIOPEIA E-11/15/55/65. 2 * setup.c, Setup for the CASIO CASSIOPEIA E-11/15/55/65.
3 * 3 *
4 * Copyright (C) 2002-2006 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> 4 * Copyright (C) 2002-2006 Yoichi Yuasa <yuasa@linux-mips.org>
5 * 5 *
6 * This program is free software; you can redistribute it and/or modify 6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by 7 * it under the terms of the GNU General Public License as published by
diff --git a/arch/mips/vr41xx/common/bcu.c b/arch/mips/vr41xx/common/bcu.c
index d77c330a0d59..6346c59c9f9d 100644
--- a/arch/mips/vr41xx/common/bcu.c
+++ b/arch/mips/vr41xx/common/bcu.c
@@ -2,8 +2,8 @@
2 * bcu.c, Bus Control Unit routines for the NEC VR4100 series. 2 * bcu.c, Bus Control Unit routines for the NEC VR4100 series.
3 * 3 *
4 * Copyright (C) 2002 MontaVista Software Inc. 4 * Copyright (C) 2002 MontaVista Software Inc.
5 * Author: Yoichi Yuasa <yyuasa@mvista.com, or source@mvista.com> 5 * Author: Yoichi Yuasa <source@mvista.com>
6 * Copyright (C) 2003-2005 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> 6 * Copyright (C) 2003-2005 Yoichi Yuasa <yuasa@linux-mips.org>
7 * 7 *
8 * This program is free software; you can redistribute it and/or modify 8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by 9 * it under the terms of the GNU General Public License as published by
@@ -21,11 +21,11 @@
21 */ 21 */
22/* 22/*
23 * Changes: 23 * Changes:
24 * MontaVista Software Inc. <yyuasa@mvista.com> or <source@mvista.com> 24 * MontaVista Software Inc. <source@mvista.com>
25 * - New creation, NEC VR4122 and VR4131 are supported. 25 * - New creation, NEC VR4122 and VR4131 are supported.
26 * - Added support for NEC VR4111 and VR4121. 26 * - Added support for NEC VR4111 and VR4121.
27 * 27 *
28 * Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> 28 * Yoichi Yuasa <yuasa@linux-mips.org>
29 * - Added support for NEC VR4133. 29 * - Added support for NEC VR4133.
30 */ 30 */
31#include <linux/kernel.h> 31#include <linux/kernel.h>
diff --git a/arch/mips/vr41xx/common/cmu.c b/arch/mips/vr41xx/common/cmu.c
index ad0e8e3409d9..8ba7d04a5ec5 100644
--- a/arch/mips/vr41xx/common/cmu.c
+++ b/arch/mips/vr41xx/common/cmu.c
@@ -2,8 +2,8 @@
2 * cmu.c, Clock Mask Unit routines for the NEC VR4100 series. 2 * cmu.c, Clock Mask Unit routines for the NEC VR4100 series.
3 * 3 *
4 * Copyright (C) 2001-2002 MontaVista Software Inc. 4 * Copyright (C) 2001-2002 MontaVista Software Inc.
5 * Author: Yoichi Yuasa <yyuasa@mvista.com or source@mvista.com> 5 * Author: Yoichi Yuasa <source@mvista.com>
6 * Copuright (C) 2003-2005 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> 6 * Copuright (C) 2003-2005 Yoichi Yuasa <yuasa@linux-mips.org>
7 * 7 *
8 * This program is free software; you can redistribute it and/or modify 8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by 9 * it under the terms of the GNU General Public License as published by
@@ -21,11 +21,11 @@
21 */ 21 */
22/* 22/*
23 * Changes: 23 * Changes:
24 * MontaVista Software Inc. <yyuasa@mvista.com> or <source@mvista.com> 24 * MontaVista Software Inc. <source@mvista.com>
25 * - New creation, NEC VR4122 and VR4131 are supported. 25 * - New creation, NEC VR4122 and VR4131 are supported.
26 * - Added support for NEC VR4111 and VR4121. 26 * - Added support for NEC VR4111 and VR4121.
27 * 27 *
28 * Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> 28 * Yoichi Yuasa <yuasa@linux-mips.org>
29 * - Added support for NEC VR4133. 29 * - Added support for NEC VR4133.
30 */ 30 */
31#include <linux/init.h> 31#include <linux/init.h>
diff --git a/arch/mips/vr41xx/common/giu.c b/arch/mips/vr41xx/common/giu.c
index 2b272f1496fe..22cc6f2100a1 100644
--- a/arch/mips/vr41xx/common/giu.c
+++ b/arch/mips/vr41xx/common/giu.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * NEC VR4100 series GIU platform device. 2 * NEC VR4100 series GIU platform device.
3 * 3 *
4 * Copyright (C) 2007 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> 4 * Copyright (C) 2007 Yoichi Yuasa <yuasa@linux-mips.org>
5 * 5 *
6 * This program is free software; you can redistribute it and/or modify 6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by 7 * it under the terms of the GNU General Public License as published by
diff --git a/arch/mips/vr41xx/common/icu.c b/arch/mips/vr41xx/common/icu.c
index 3f23d9fda662..6d39e222b170 100644
--- a/arch/mips/vr41xx/common/icu.c
+++ b/arch/mips/vr41xx/common/icu.c
@@ -2,8 +2,8 @@
2 * icu.c, Interrupt Control Unit routines for the NEC VR4100 series. 2 * icu.c, Interrupt Control Unit routines for the NEC VR4100 series.
3 * 3 *
4 * Copyright (C) 2001-2002 MontaVista Software Inc. 4 * Copyright (C) 2001-2002 MontaVista Software Inc.
5 * Author: Yoichi Yuasa <yyuasa@mvista.com or source@mvista.com> 5 * Author: Yoichi Yuasa <source@mvista.com>
6 * Copyright (C) 2003-2006 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> 6 * Copyright (C) 2003-2006 Yoichi Yuasa <yuasa@linux-mips.org>
7 * 7 *
8 * This program is free software; you can redistribute it and/or modify 8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by 9 * it under the terms of the GNU General Public License as published by
@@ -21,11 +21,11 @@
21 */ 21 */
22/* 22/*
23 * Changes: 23 * Changes:
24 * MontaVista Software Inc. <yyuasa@mvista.com> or <source@mvista.com> 24 * MontaVista Software Inc. <source@mvista.com>
25 * - New creation, NEC VR4122 and VR4131 are supported. 25 * - New creation, NEC VR4122 and VR4131 are supported.
26 * - Added support for NEC VR4111 and VR4121. 26 * - Added support for NEC VR4111 and VR4121.
27 * 27 *
28 * Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> 28 * Yoichi Yuasa <yuasa@linux-mips.org>
29 * - Coped with INTASSIGN of NEC VR4133. 29 * - Coped with INTASSIGN of NEC VR4133.
30 */ 30 */
31#include <linux/errno.h> 31#include <linux/errno.h>
diff --git a/arch/mips/vr41xx/common/init.c b/arch/mips/vr41xx/common/init.c
index c64995342ba8..1386e6f081c8 100644
--- a/arch/mips/vr41xx/common/init.c
+++ b/arch/mips/vr41xx/common/init.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * init.c, Common initialization routines for NEC VR4100 series. 2 * init.c, Common initialization routines for NEC VR4100 series.
3 * 3 *
4 * Copyright (C) 2003-2008 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> 4 * Copyright (C) 2003-2008 Yoichi Yuasa <yuasa@linux-mips.org>
5 * 5 *
6 * This program is free software; you can redistribute it and/or modify 6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by 7 * it under the terms of the GNU General Public License as published by
diff --git a/arch/mips/vr41xx/common/irq.c b/arch/mips/vr41xx/common/irq.c
index 9cc389109b19..bef06872f012 100644
--- a/arch/mips/vr41xx/common/irq.c
+++ b/arch/mips/vr41xx/common/irq.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * Interrupt handing routines for NEC VR4100 series. 2 * Interrupt handing routines for NEC VR4100 series.
3 * 3 *
4 * Copyright (C) 2005-2007 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> 4 * Copyright (C) 2005-2007 Yoichi Yuasa <yuasa@linux-mips.org>
5 * 5 *
6 * This program is free software; you can redistribute it and/or modify 6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by 7 * it under the terms of the GNU General Public License as published by
diff --git a/arch/mips/vr41xx/common/pmu.c b/arch/mips/vr41xx/common/pmu.c
index 028aaf75eb21..692b4e85b7fc 100644
--- a/arch/mips/vr41xx/common/pmu.c
+++ b/arch/mips/vr41xx/common/pmu.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * pmu.c, Power Management Unit routines for NEC VR4100 series. 2 * pmu.c, Power Management Unit routines for NEC VR4100 series.
3 * 3 *
4 * Copyright (C) 2003-2007 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> 4 * Copyright (C) 2003-2007 Yoichi Yuasa <yuasa@linux-mips.org>
5 * 5 *
6 * This program is free software; you can redistribute it and/or modify 6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by 7 * it under the terms of the GNU General Public License as published by
diff --git a/arch/mips/vr41xx/common/rtc.c b/arch/mips/vr41xx/common/rtc.c
index 9f26c14edcac..ebc5dcf0ed8e 100644
--- a/arch/mips/vr41xx/common/rtc.c
+++ b/arch/mips/vr41xx/common/rtc.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * NEC VR4100 series RTC platform device. 2 * NEC VR4100 series RTC platform device.
3 * 3 *
4 * Copyright (C) 2007 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> 4 * Copyright (C) 2007 Yoichi Yuasa <yuasa@linux-mips.org>
5 * 5 *
6 * This program is free software; you can redistribute it and/or modify 6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by 7 * it under the terms of the GNU General Public License as published by
diff --git a/arch/mips/vr41xx/common/siu.c b/arch/mips/vr41xx/common/siu.c
index 654dee6208be..54eae56108fb 100644
--- a/arch/mips/vr41xx/common/siu.c
+++ b/arch/mips/vr41xx/common/siu.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * NEC VR4100 series SIU platform device. 2 * NEC VR4100 series SIU platform device.
3 * 3 *
4 * Copyright (C) 2007-2008 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> 4 * Copyright (C) 2007-2008 Yoichi Yuasa <yuasa@linux-mips.org>
5 * 5 *
6 * This program is free software; you can redistribute it and/or modify 6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by 7 * it under the terms of the GNU General Public License as published by
diff --git a/arch/mips/vr41xx/common/type.c b/arch/mips/vr41xx/common/type.c
index e0c1ac5e988e..ff841422b638 100644
--- a/arch/mips/vr41xx/common/type.c
+++ b/arch/mips/vr41xx/common/type.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * type.c, System type for NEC VR4100 series. 2 * type.c, System type for NEC VR4100 series.
3 * 3 *
4 * Copyright (C) 2005 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> 4 * Copyright (C) 2005 Yoichi Yuasa <yuasa@linux-mips.org>
5 * 5 *
6 * This program is free software; you can redistribute it and/or modify 6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by 7 * it under the terms of the GNU General Public License as published by
diff --git a/arch/mips/vr41xx/ibm-workpad/setup.c b/arch/mips/vr41xx/ibm-workpad/setup.c
index 9eef297eca1a..3982f378a3e6 100644
--- a/arch/mips/vr41xx/ibm-workpad/setup.c
+++ b/arch/mips/vr41xx/ibm-workpad/setup.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * setup.c, Setup for the IBM WorkPad z50. 2 * setup.c, Setup for the IBM WorkPad z50.
3 * 3 *
4 * Copyright (C) 2002-2006 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> 4 * Copyright (C) 2002-2006 Yoichi Yuasa <yuasa@linux-mips.org>
5 * 5 *
6 * This program is free software; you can redistribute it and/or modify 6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by 7 * it under the terms of the GNU General Public License as published by
diff --git a/arch/mn10300/include/asm/pci.h b/arch/mn10300/include/asm/pci.h
index e58b9a46e1b1..35d2ed6396f6 100644
--- a/arch/mn10300/include/asm/pci.h
+++ b/arch/mn10300/include/asm/pci.h
@@ -70,10 +70,6 @@ struct pci_dev;
70 */ 70 */
71#define PCI_DMA_BUS_IS_PHYS (1) 71#define PCI_DMA_BUS_IS_PHYS (1)
72 72
73
74/* This is always fine. */
75#define pci_dac_dma_supported(pci_dev, mask) (0)
76
77/* Return the index of the PCI controller for device. */ 73/* Return the index of the PCI controller for device. */
78static inline int pci_controller_num(struct pci_dev *dev) 74static inline int pci_controller_num(struct pci_dev *dev)
79{ 75{
diff --git a/arch/mn10300/include/asm/pgalloc.h b/arch/mn10300/include/asm/pgalloc.h
index ec057e1bd4cf..a19f11327cd8 100644
--- a/arch/mn10300/include/asm/pgalloc.h
+++ b/arch/mn10300/include/asm/pgalloc.h
@@ -51,6 +51,6 @@ static inline void pte_free(struct mm_struct *mm, struct page *pte)
51} 51}
52 52
53 53
54#define __pte_free_tlb(tlb, pte) tlb_remove_page((tlb), (pte)) 54#define __pte_free_tlb(tlb, pte, addr) tlb_remove_page((tlb), (pte))
55 55
56#endif /* _ASM_PGALLOC_H */ 56#endif /* _ASM_PGALLOC_H */
diff --git a/arch/mn10300/include/asm/thread_info.h b/arch/mn10300/include/asm/thread_info.h
index 78a3881f3c12..58d64f8b2cc3 100644
--- a/arch/mn10300/include/asm/thread_info.h
+++ b/arch/mn10300/include/asm/thread_info.h
@@ -65,8 +65,6 @@ struct thread_info {
65 65
66/* 66/*
67 * macros/functions for gaining access to the thread information structure 67 * macros/functions for gaining access to the thread information structure
68 *
69 * preempt_count needs to be 1 initially, until the scheduler is functional.
70 */ 68 */
71#ifndef __ASSEMBLY__ 69#ifndef __ASSEMBLY__
72 70
@@ -76,7 +74,7 @@ struct thread_info {
76 .exec_domain = &default_exec_domain, \ 74 .exec_domain = &default_exec_domain, \
77 .flags = 0, \ 75 .flags = 0, \
78 .cpu = 0, \ 76 .cpu = 0, \
79 .preempt_count = 1, \ 77 .preempt_count = INIT_PREEMPT_COUNT, \
80 .addr_limit = KERNEL_DS, \ 78 .addr_limit = KERNEL_DS, \
81 .restart_block = { \ 79 .restart_block = { \
82 .fn = do_no_restart_syscall, \ 80 .fn = do_no_restart_syscall, \
diff --git a/arch/mn10300/include/asm/unistd.h b/arch/mn10300/include/asm/unistd.h
index fef5b434dadc..fad68616af32 100644
--- a/arch/mn10300/include/asm/unistd.h
+++ b/arch/mn10300/include/asm/unistd.h
@@ -346,10 +346,12 @@
346#define __NR_inotify_init1 333 346#define __NR_inotify_init1 333
347#define __NR_preadv 334 347#define __NR_preadv 334
348#define __NR_pwritev 335 348#define __NR_pwritev 335
349#define __NR_rt_tgsigqueueinfo 336
350#define __NR_perf_counter_open 337
349 351
350#ifdef __KERNEL__ 352#ifdef __KERNEL__
351 353
352#define NR_syscalls 326 354#define NR_syscalls 338
353 355
354/* 356/*
355 * specify the deprecated syscalls we want to support on this arch 357 * specify the deprecated syscalls we want to support on this arch
diff --git a/arch/mn10300/kernel/entry.S b/arch/mn10300/kernel/entry.S
index 7408a27199f3..e0d2563af4f2 100644
--- a/arch/mn10300/kernel/entry.S
+++ b/arch/mn10300/kernel/entry.S
@@ -722,6 +722,8 @@ ENTRY(sys_call_table)
722 .long sys_inotify_init1 722 .long sys_inotify_init1
723 .long sys_preadv 723 .long sys_preadv
724 .long sys_pwritev /* 335 */ 724 .long sys_pwritev /* 335 */
725 .long sys_rt_tgsigqueueinfo
726 .long sys_perf_counter_open
725 727
726 728
727nr_syscalls=(.-sys_call_table)/4 729nr_syscalls=(.-sys_call_table)/4
diff --git a/arch/mn10300/kernel/ptrace.c b/arch/mn10300/kernel/ptrace.c
index e143339ad28e..cf847dabc1bd 100644
--- a/arch/mn10300/kernel/ptrace.c
+++ b/arch/mn10300/kernel/ptrace.c
@@ -13,7 +13,6 @@
13#include <linux/sched.h> 13#include <linux/sched.h>
14#include <linux/mm.h> 14#include <linux/mm.h>
15#include <linux/smp.h> 15#include <linux/smp.h>
16#include <linux/smp_lock.h>
17#include <linux/errno.h> 16#include <linux/errno.h>
18#include <linux/ptrace.h> 17#include <linux/ptrace.h>
19#include <linux/user.h> 18#include <linux/user.h>
diff --git a/arch/mn10300/kernel/signal.c b/arch/mn10300/kernel/signal.c
index 9f7572a0f578..feb2f2e810db 100644
--- a/arch/mn10300/kernel/signal.c
+++ b/arch/mn10300/kernel/signal.c
@@ -12,7 +12,6 @@
12#include <linux/sched.h> 12#include <linux/sched.h>
13#include <linux/mm.h> 13#include <linux/mm.h>
14#include <linux/smp.h> 14#include <linux/smp.h>
15#include <linux/smp_lock.h>
16#include <linux/kernel.h> 15#include <linux/kernel.h>
17#include <linux/signal.h> 16#include <linux/signal.h>
18#include <linux/errno.h> 17#include <linux/errno.h>
diff --git a/arch/mn10300/kernel/sys_mn10300.c b/arch/mn10300/kernel/sys_mn10300.c
index bca5a84dc72c..3e52a1054327 100644
--- a/arch/mn10300/kernel/sys_mn10300.c
+++ b/arch/mn10300/kernel/sys_mn10300.c
@@ -13,7 +13,6 @@
13#include <linux/syscalls.h> 13#include <linux/syscalls.h>
14#include <linux/mm.h> 14#include <linux/mm.h>
15#include <linux/smp.h> 15#include <linux/smp.h>
16#include <linux/smp_lock.h>
17#include <linux/sem.h> 16#include <linux/sem.h>
18#include <linux/msg.h> 17#include <linux/msg.h>
19#include <linux/shm.h> 18#include <linux/shm.h>
@@ -21,7 +20,6 @@
21#include <linux/mman.h> 20#include <linux/mman.h>
22#include <linux/file.h> 21#include <linux/file.h>
23#include <linux/utsname.h> 22#include <linux/utsname.h>
24#include <linux/syscalls.h>
25#include <linux/tty.h> 23#include <linux/tty.h>
26 24
27#include <asm/uaccess.h> 25#include <asm/uaccess.h>
diff --git a/arch/mn10300/kernel/traps.c b/arch/mn10300/kernel/traps.c
index 681ad8c9e4fb..91365adba4f5 100644
--- a/arch/mn10300/kernel/traps.c
+++ b/arch/mn10300/kernel/traps.c
@@ -17,7 +17,6 @@
17#include <linux/timer.h> 17#include <linux/timer.h>
18#include <linux/mm.h> 18#include <linux/mm.h>
19#include <linux/smp.h> 19#include <linux/smp.h>
20#include <linux/smp_lock.h>
21#include <linux/init.h> 20#include <linux/init.h>
22#include <linux/delay.h> 21#include <linux/delay.h>
23#include <linux/spinlock.h> 22#include <linux/spinlock.h>
@@ -136,8 +135,7 @@ void show_trace(unsigned long *sp)
136 unsigned long *stack, addr, module_start, module_end; 135 unsigned long *stack, addr, module_start, module_end;
137 int i; 136 int i;
138 137
139 printk(KERN_EMERG "\n" 138 printk(KERN_EMERG "\nCall Trace:");
140 KERN_EMERG "Call Trace:");
141 139
142 stack = sp; 140 stack = sp;
143 i = 0; 141 i = 0;
@@ -153,7 +151,7 @@ void show_trace(unsigned long *sp)
153 printk("\n"); 151 printk("\n");
154#else 152#else
155 if ((i % 6) == 0) 153 if ((i % 6) == 0)
156 printk("\n" KERN_EMERG " "); 154 printk(KERN_EMERG " ");
157 printk("[<%08lx>] ", addr); 155 printk("[<%08lx>] ", addr);
158 i++; 156 i++;
159#endif 157#endif
@@ -180,7 +178,7 @@ void show_stack(struct task_struct *task, unsigned long *sp)
180 if (((long) stack & (THREAD_SIZE - 1)) == 0) 178 if (((long) stack & (THREAD_SIZE - 1)) == 0)
181 break; 179 break;
182 if ((i % 8) == 0) 180 if ((i % 8) == 0)
183 printk("\n" KERN_EMERG " "); 181 printk(KERN_EMERG " ");
184 printk("%08lx ", *stack++); 182 printk("%08lx ", *stack++);
185 } 183 }
186 184
@@ -264,8 +262,7 @@ void show_registers(struct pt_regs *regs)
264 show_stack(current, (unsigned long *) sp); 262 show_stack(current, (unsigned long *) sp);
265 263
266#if 0 264#if 0
267 printk(KERN_EMERG "\n" 265 printk(KERN_EMERG "\nCode: ");
268 KERN_EMERG "Code: ");
269 if (regs->pc < PAGE_OFFSET) 266 if (regs->pc < PAGE_OFFSET)
270 goto bad; 267 goto bad;
271 268
@@ -311,16 +308,14 @@ void die(const char *str, struct pt_regs *regs, enum exception_code code)
311{ 308{
312 console_verbose(); 309 console_verbose();
313 spin_lock_irq(&die_lock); 310 spin_lock_irq(&die_lock);
314 printk(KERN_EMERG "\n" 311 printk(KERN_EMERG "\n%s: %04x\n",
315 KERN_EMERG "%s: %04x\n",
316 str, code & 0xffff); 312 str, code & 0xffff);
317 show_registers(regs); 313 show_registers(regs);
318 314
319 if (regs->pc >= 0x02000000 && regs->pc < 0x04000000 && 315 if (regs->pc >= 0x02000000 && regs->pc < 0x04000000 &&
320 (regs->epsw & (EPSW_IM | EPSW_IE)) != (EPSW_IM | EPSW_IE)) { 316 (regs->epsw & (EPSW_IM | EPSW_IE)) != (EPSW_IM | EPSW_IE)) {
321 printk(KERN_EMERG "Exception in usermode interrupt handler\n"); 317 printk(KERN_EMERG "Exception in usermode interrupt handler\n");
322 printk(KERN_EMERG "\n" 318 printk(KERN_EMERG "\nPlease connect to kernel debugger !!\n");
323 KERN_EMERG " Please connect to kernel debugger !!\n");
324 asm volatile ("0: bra 0b"); 319 asm volatile ("0: bra 0b");
325 } 320 }
326 321
@@ -429,9 +424,8 @@ asmlinkage void io_bus_error(u32 bcberr, u32 bcbear, struct pt_regs *regs)
429{ 424{
430 console_verbose(); 425 console_verbose();
431 426
432 printk(KERN_EMERG "\n" 427 printk(KERN_EMERG "Asynchronous I/O Bus Error\n");
433 KERN_EMERG "Asynchronous I/O Bus Error\n" 428 printk(KERN_EMERG "==========================\n");
434 KERN_EMERG "==========================\n");
435 429
436 if (bcberr & BCBERR_BEME) 430 if (bcberr & BCBERR_BEME)
437 printk(KERN_EMERG "- Multiple recorded errors\n"); 431 printk(KERN_EMERG "- Multiple recorded errors\n");
diff --git a/arch/mn10300/kernel/vmlinux.lds.S b/arch/mn10300/kernel/vmlinux.lds.S
index bcebcefb4ad7..f4aa07934654 100644
--- a/arch/mn10300/kernel/vmlinux.lds.S
+++ b/arch/mn10300/kernel/vmlinux.lds.S
@@ -61,7 +61,7 @@ SECTIONS
61 _edata = .; /* End of data section */ 61 _edata = .; /* End of data section */
62 } 62 }
63 63
64 .data.init_task : { INIT_TASK(THREAD_SIZE); } 64 .data.init_task : { INIT_TASK_DATA(THREAD_SIZE); }
65 65
66 /* might get freed after init */ 66 /* might get freed after init */
67 . = ALIGN(PAGE_SIZE); 67 . = ALIGN(PAGE_SIZE);
@@ -107,7 +107,7 @@ SECTIONS
107 __init_end = .; 107 __init_end = .;
108 /* freed after init ends here */ 108 /* freed after init ends here */
109 109
110 BSS(4) 110 BSS_SECTION(0, PAGE_SIZE, 4)
111 111
112 _end = . ; 112 _end = . ;
113 113
diff --git a/arch/mn10300/mm/fault.c b/arch/mn10300/mm/fault.c
index a62e1e138bc1..53bb17d0f068 100644
--- a/arch/mn10300/mm/fault.c
+++ b/arch/mn10300/mm/fault.c
@@ -20,7 +20,6 @@
20#include <linux/mman.h> 20#include <linux/mman.h>
21#include <linux/mm.h> 21#include <linux/mm.h>
22#include <linux/smp.h> 22#include <linux/smp.h>
23#include <linux/smp_lock.h>
24#include <linux/interrupt.h> 23#include <linux/interrupt.h>
25#include <linux/init.h> 24#include <linux/init.h>
26#include <linux/vt_kern.h> /* For unblank_screen() */ 25#include <linux/vt_kern.h> /* For unblank_screen() */
diff --git a/arch/mn10300/mm/misalignment.c b/arch/mn10300/mm/misalignment.c
index 94c4a4358065..30016251f658 100644
--- a/arch/mn10300/mm/misalignment.c
+++ b/arch/mn10300/mm/misalignment.c
@@ -17,7 +17,6 @@
17#include <linux/timer.h> 17#include <linux/timer.h>
18#include <linux/mm.h> 18#include <linux/mm.h>
19#include <linux/smp.h> 19#include <linux/smp.h>
20#include <linux/smp_lock.h>
21#include <linux/init.h> 20#include <linux/init.h>
22#include <linux/delay.h> 21#include <linux/delay.h>
23#include <linux/spinlock.h> 22#include <linux/spinlock.h>
diff --git a/arch/parisc/Kconfig b/arch/parisc/Kconfig
index 9038f39d9d73..06f8d5b5b0f9 100644
--- a/arch/parisc/Kconfig
+++ b/arch/parisc/Kconfig
@@ -16,6 +16,8 @@ config PARISC
16 select RTC_DRV_GENERIC 16 select RTC_DRV_GENERIC
17 select INIT_ALL_POSSIBLE 17 select INIT_ALL_POSSIBLE
18 select BUG 18 select BUG
19 select HAVE_PERF_COUNTERS
20 select GENERIC_ATOMIC64 if !64BIT
19 help 21 help
20 The PA-RISC microprocessor is designed by Hewlett-Packard and used 22 The PA-RISC microprocessor is designed by Hewlett-Packard and used
21 in many of their workstations & servers (HP9000 700 and 800 series, 23 in many of their workstations & servers (HP9000 700 and 800 series,
diff --git a/arch/parisc/include/asm/atomic.h b/arch/parisc/include/asm/atomic.h
index 7eeaff944360..8bc9e96699b2 100644
--- a/arch/parisc/include/asm/atomic.h
+++ b/arch/parisc/include/asm/atomic.h
@@ -222,13 +222,13 @@ static __inline__ int atomic_add_unless(atomic_t *v, int a, int u)
222 222
223#define atomic_inc_not_zero(v) atomic_add_unless((v), 1, 0) 223#define atomic_inc_not_zero(v) atomic_add_unless((v), 1, 0)
224 224
225#define atomic_add(i,v) ((void)(__atomic_add_return( ((int)(i)),(v)))) 225#define atomic_add(i,v) ((void)(__atomic_add_return( (i),(v))))
226#define atomic_sub(i,v) ((void)(__atomic_add_return(-((int)(i)),(v)))) 226#define atomic_sub(i,v) ((void)(__atomic_add_return(-(i),(v))))
227#define atomic_inc(v) ((void)(__atomic_add_return( 1,(v)))) 227#define atomic_inc(v) ((void)(__atomic_add_return( 1,(v))))
228#define atomic_dec(v) ((void)(__atomic_add_return( -1,(v)))) 228#define atomic_dec(v) ((void)(__atomic_add_return( -1,(v))))
229 229
230#define atomic_add_return(i,v) (__atomic_add_return( ((int)(i)),(v))) 230#define atomic_add_return(i,v) (__atomic_add_return( (i),(v)))
231#define atomic_sub_return(i,v) (__atomic_add_return(-((int)(i)),(v))) 231#define atomic_sub_return(i,v) (__atomic_add_return(-(i),(v)))
232#define atomic_inc_return(v) (__atomic_add_return( 1,(v))) 232#define atomic_inc_return(v) (__atomic_add_return( 1,(v)))
233#define atomic_dec_return(v) (__atomic_add_return( -1,(v))) 233#define atomic_dec_return(v) (__atomic_add_return( -1,(v)))
234 234
@@ -336,7 +336,11 @@ static __inline__ int atomic64_add_unless(atomic64_t *v, long a, long u)
336 336
337#define atomic64_inc_not_zero(v) atomic64_add_unless((v), 1, 0) 337#define atomic64_inc_not_zero(v) atomic64_add_unless((v), 1, 0)
338 338
339#endif /* CONFIG_64BIT */ 339#else /* CONFIG_64BIT */
340
341#include <asm-generic/atomic64.h>
342
343#endif /* !CONFIG_64BIT */
340 344
341#include <asm-generic/atomic-long.h> 345#include <asm-generic/atomic-long.h>
342 346
diff --git a/arch/parisc/include/asm/dma.h b/arch/parisc/include/asm/dma.h
index 31ad0f05af3d..f7a18f968703 100644
--- a/arch/parisc/include/asm/dma.h
+++ b/arch/parisc/include/asm/dma.h
@@ -1,5 +1,4 @@
1/* $Id: dma.h,v 1.2 1999/04/27 00:46:18 deller Exp $ 1/* asm/dma.h: Defines for using and allocating dma channels.
2 * linux/include/asm/dma.h: Defines for using and allocating dma channels.
3 * Written by Hennus Bergman, 1992. 2 * Written by Hennus Bergman, 1992.
4 * High DMA channel support & info by Hannu Savolainen 3 * High DMA channel support & info by Hannu Savolainen
5 * and John Boyd, Nov. 1992. 4 * and John Boyd, Nov. 1992.
diff --git a/arch/parisc/include/asm/perf_counter.h b/arch/parisc/include/asm/perf_counter.h
new file mode 100644
index 000000000000..dc9e829f7013
--- /dev/null
+++ b/arch/parisc/include/asm/perf_counter.h
@@ -0,0 +1,7 @@
1#ifndef __ASM_PARISC_PERF_COUNTER_H
2#define __ASM_PARISC_PERF_COUNTER_H
3
4/* parisc only supports software counters through this interface. */
5static inline void set_perf_counter_pending(void) { }
6
7#endif /* __ASM_PARISC_PERF_COUNTER_H */
diff --git a/arch/parisc/include/asm/processor.h b/arch/parisc/include/asm/processor.h
index 9d64df8754ba..9ce66e9d1c2b 100644
--- a/arch/parisc/include/asm/processor.h
+++ b/arch/parisc/include/asm/processor.h
@@ -18,6 +18,7 @@
18#include <asm/types.h> 18#include <asm/types.h>
19#include <asm/system.h> 19#include <asm/system.h>
20#include <asm/percpu.h> 20#include <asm/percpu.h>
21
21#endif /* __ASSEMBLY__ */ 22#endif /* __ASSEMBLY__ */
22 23
23#define KERNEL_STACK_SIZE (4*PAGE_SIZE) 24#define KERNEL_STACK_SIZE (4*PAGE_SIZE)
@@ -127,6 +128,8 @@ struct thread_struct {
127 unsigned long flags; 128 unsigned long flags;
128}; 129};
129 130
131#define task_pt_regs(tsk) ((struct pt_regs *)&((tsk)->thread.regs))
132
130/* Thread struct flags. */ 133/* Thread struct flags. */
131#define PARISC_UAC_NOPRINT (1UL << 0) /* see prctl and unaligned.c */ 134#define PARISC_UAC_NOPRINT (1UL << 0) /* see prctl and unaligned.c */
132#define PARISC_UAC_SIGBUS (1UL << 1) 135#define PARISC_UAC_SIGBUS (1UL << 1)
diff --git a/arch/parisc/include/asm/system.h b/arch/parisc/include/asm/system.h
index ee80c920b464..d91357bca5b4 100644
--- a/arch/parisc/include/asm/system.h
+++ b/arch/parisc/include/asm/system.h
@@ -168,8 +168,8 @@ static inline void set_eiem(unsigned long val)
168/* LDCW, the only atomic read-write operation PA-RISC has. *sigh*. */ 168/* LDCW, the only atomic read-write operation PA-RISC has. *sigh*. */
169#define __ldcw(a) ({ \ 169#define __ldcw(a) ({ \
170 unsigned __ret; \ 170 unsigned __ret; \
171 __asm__ __volatile__(__LDCW " 0(%1),%0" \ 171 __asm__ __volatile__(__LDCW " 0(%2),%0" \
172 : "=r" (__ret) : "r" (a)); \ 172 : "=r" (__ret), "+m" (*(a)) : "r" (a)); \
173 __ret; \ 173 __ret; \
174}) 174})
175 175
diff --git a/arch/parisc/include/asm/thread_info.h b/arch/parisc/include/asm/thread_info.h
index 0407959da489..4ce0edfbe969 100644
--- a/arch/parisc/include/asm/thread_info.h
+++ b/arch/parisc/include/asm/thread_info.h
@@ -23,7 +23,7 @@ struct thread_info {
23 .flags = 0, \ 23 .flags = 0, \
24 .cpu = 0, \ 24 .cpu = 0, \
25 .addr_limit = KERNEL_DS, \ 25 .addr_limit = KERNEL_DS, \
26 .preempt_count = 1, \ 26 .preempt_count = INIT_PREEMPT_COUNT, \
27 .restart_block = { \ 27 .restart_block = { \
28 .fn = do_no_restart_syscall \ 28 .fn = do_no_restart_syscall \
29 } \ 29 } \
diff --git a/arch/parisc/include/asm/tlb.h b/arch/parisc/include/asm/tlb.h
index 383b1db310ee..07924903989e 100644
--- a/arch/parisc/include/asm/tlb.h
+++ b/arch/parisc/include/asm/tlb.h
@@ -21,7 +21,7 @@ do { if (!(tlb)->fullmm) \
21 21
22#include <asm-generic/tlb.h> 22#include <asm-generic/tlb.h>
23 23
24#define __pmd_free_tlb(tlb, pmd) pmd_free((tlb)->mm, pmd) 24#define __pmd_free_tlb(tlb, pmd, addr) pmd_free((tlb)->mm, pmd)
25#define __pte_free_tlb(tlb, pte) pte_free((tlb)->mm, pte) 25#define __pte_free_tlb(tlb, pte, addr) pte_free((tlb)->mm, pte)
26 26
27#endif 27#endif
diff --git a/arch/parisc/include/asm/tlbflush.h b/arch/parisc/include/asm/tlbflush.h
index 1f6fd4fc05b9..8f1a8100bf2d 100644
--- a/arch/parisc/include/asm/tlbflush.h
+++ b/arch/parisc/include/asm/tlbflush.h
@@ -12,14 +12,12 @@
12 * N class systems, only one PxTLB inter processor broadcast can be 12 * N class systems, only one PxTLB inter processor broadcast can be
13 * active at any one time on the Merced bus. This tlb purge 13 * active at any one time on the Merced bus. This tlb purge
14 * synchronisation is fairly lightweight and harmless so we activate 14 * synchronisation is fairly lightweight and harmless so we activate
15 * it on all SMP systems not just the N class. We also need to have 15 * it on all systems not just the N class.
16 * preemption disabled on uniprocessor machines, and spin_lock does that
17 * nicely.
18 */ 16 */
19extern spinlock_t pa_tlb_lock; 17extern spinlock_t pa_tlb_lock;
20 18
21#define purge_tlb_start(x) spin_lock(&pa_tlb_lock) 19#define purge_tlb_start(flags) spin_lock_irqsave(&pa_tlb_lock, flags)
22#define purge_tlb_end(x) spin_unlock(&pa_tlb_lock) 20#define purge_tlb_end(flags) spin_unlock_irqrestore(&pa_tlb_lock, flags)
23 21
24extern void flush_tlb_all(void); 22extern void flush_tlb_all(void);
25extern void flush_tlb_all_local(void *); 23extern void flush_tlb_all_local(void *);
@@ -63,14 +61,16 @@ static inline void flush_tlb_mm(struct mm_struct *mm)
63static inline void flush_tlb_page(struct vm_area_struct *vma, 61static inline void flush_tlb_page(struct vm_area_struct *vma,
64 unsigned long addr) 62 unsigned long addr)
65{ 63{
64 unsigned long flags;
65
66 /* For one page, it's not worth testing the split_tlb variable */ 66 /* For one page, it's not worth testing the split_tlb variable */
67 67
68 mb(); 68 mb();
69 mtsp(vma->vm_mm->context,1); 69 mtsp(vma->vm_mm->context,1);
70 purge_tlb_start(); 70 purge_tlb_start(flags);
71 pdtlb(addr); 71 pdtlb(addr);
72 pitlb(addr); 72 pitlb(addr);
73 purge_tlb_end(); 73 purge_tlb_end(flags);
74} 74}
75 75
76void __flush_tlb_range(unsigned long sid, 76void __flush_tlb_range(unsigned long sid,
diff --git a/arch/parisc/include/asm/unistd.h b/arch/parisc/include/asm/unistd.h
index ef26b009dc5d..f3d3b8b012c4 100644
--- a/arch/parisc/include/asm/unistd.h
+++ b/arch/parisc/include/asm/unistd.h
@@ -807,8 +807,12 @@
807#define __NR_dup3 (__NR_Linux + 312) 807#define __NR_dup3 (__NR_Linux + 312)
808#define __NR_pipe2 (__NR_Linux + 313) 808#define __NR_pipe2 (__NR_Linux + 313)
809#define __NR_inotify_init1 (__NR_Linux + 314) 809#define __NR_inotify_init1 (__NR_Linux + 314)
810#define __NR_preadv (__NR_Linux + 315)
811#define __NR_pwritev (__NR_Linux + 316)
812#define __NR_rt_tgsigqueueinfo (__NR_Linux + 317)
813#define __NR_perf_counter_open (__NR_Linux + 318)
810 814
811#define __NR_Linux_syscalls (__NR_inotify_init1 + 1) 815#define __NR_Linux_syscalls (__NR_perf_counter_open + 1)
812 816
813 817
814#define __IGNORE_select /* newselect */ 818#define __IGNORE_select /* newselect */
diff --git a/arch/parisc/kernel/cache.c b/arch/parisc/kernel/cache.c
index 837530ea32e7..b6ed34de14e1 100644
--- a/arch/parisc/kernel/cache.c
+++ b/arch/parisc/kernel/cache.c
@@ -1,5 +1,4 @@
1/* $Id: cache.c,v 1.4 2000/01/25 00:11:38 prumpf Exp $ 1/*
2 *
3 * This file is subject to the terms and conditions of the GNU General Public 2 * This file is subject to the terms and conditions of the GNU General Public
4 * 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
5 * for more details. 4 * for more details.
@@ -398,12 +397,13 @@ EXPORT_SYMBOL(flush_kernel_icache_range_asm);
398 397
399void clear_user_page_asm(void *page, unsigned long vaddr) 398void clear_user_page_asm(void *page, unsigned long vaddr)
400{ 399{
400 unsigned long flags;
401 /* This function is implemented in assembly in pacache.S */ 401 /* This function is implemented in assembly in pacache.S */
402 extern void __clear_user_page_asm(void *page, unsigned long vaddr); 402 extern void __clear_user_page_asm(void *page, unsigned long vaddr);
403 403
404 purge_tlb_start(); 404 purge_tlb_start(flags);
405 __clear_user_page_asm(page, vaddr); 405 __clear_user_page_asm(page, vaddr);
406 purge_tlb_end(); 406 purge_tlb_end(flags);
407} 407}
408 408
409#define FLUSH_THRESHOLD 0x80000 /* 0.5MB */ 409#define FLUSH_THRESHOLD 0x80000 /* 0.5MB */
@@ -444,20 +444,24 @@ extern void clear_user_page_asm(void *page, unsigned long vaddr);
444 444
445void clear_user_page(void *page, unsigned long vaddr, struct page *pg) 445void clear_user_page(void *page, unsigned long vaddr, struct page *pg)
446{ 446{
447 unsigned long flags;
448
447 purge_kernel_dcache_page((unsigned long)page); 449 purge_kernel_dcache_page((unsigned long)page);
448 purge_tlb_start(); 450 purge_tlb_start(flags);
449 pdtlb_kernel(page); 451 pdtlb_kernel(page);
450 purge_tlb_end(); 452 purge_tlb_end(flags);
451 clear_user_page_asm(page, vaddr); 453 clear_user_page_asm(page, vaddr);
452} 454}
453EXPORT_SYMBOL(clear_user_page); 455EXPORT_SYMBOL(clear_user_page);
454 456
455void flush_kernel_dcache_page_addr(void *addr) 457void flush_kernel_dcache_page_addr(void *addr)
456{ 458{
459 unsigned long flags;
460
457 flush_kernel_dcache_page_asm(addr); 461 flush_kernel_dcache_page_asm(addr);
458 purge_tlb_start(); 462 purge_tlb_start(flags);
459 pdtlb_kernel(addr); 463 pdtlb_kernel(addr);
460 purge_tlb_end(); 464 purge_tlb_end(flags);
461} 465}
462EXPORT_SYMBOL(flush_kernel_dcache_page_addr); 466EXPORT_SYMBOL(flush_kernel_dcache_page_addr);
463 467
@@ -490,8 +494,10 @@ void __flush_tlb_range(unsigned long sid, unsigned long start,
490 if (npages >= 512) /* 2MB of space: arbitrary, should be tuned */ 494 if (npages >= 512) /* 2MB of space: arbitrary, should be tuned */
491 flush_tlb_all(); 495 flush_tlb_all();
492 else { 496 else {
497 unsigned long flags;
498
493 mtsp(sid, 1); 499 mtsp(sid, 1);
494 purge_tlb_start(); 500 purge_tlb_start(flags);
495 if (split_tlb) { 501 if (split_tlb) {
496 while (npages--) { 502 while (npages--) {
497 pdtlb(start); 503 pdtlb(start);
@@ -504,7 +510,7 @@ void __flush_tlb_range(unsigned long sid, unsigned long start,
504 start += PAGE_SIZE; 510 start += PAGE_SIZE;
505 } 511 }
506 } 512 }
507 purge_tlb_end(); 513 purge_tlb_end(flags);
508 } 514 }
509} 515}
510 516
diff --git a/arch/parisc/kernel/entry.S b/arch/parisc/kernel/entry.S
index ae3e70cd1e14..e552e547cb93 100644
--- a/arch/parisc/kernel/entry.S
+++ b/arch/parisc/kernel/entry.S
@@ -553,7 +553,7 @@
553 * on most of those machines only handles cache transactions. 553 * on most of those machines only handles cache transactions.
554 */ 554 */
555 extrd,u,*= \pte,_PAGE_NO_CACHE_BIT+32,1,%r0 555 extrd,u,*= \pte,_PAGE_NO_CACHE_BIT+32,1,%r0
556 depi 1,12,1,\prot 556 depdi 1,12,1,\prot
557 557
558 /* Drop prot bits and convert to page addr for iitlbt and idtlbt */ 558 /* Drop prot bits and convert to page addr for iitlbt and idtlbt */
559 convert_for_tlb_insert20 \pte 559 convert_for_tlb_insert20 \pte
diff --git a/arch/parisc/kernel/inventory.c b/arch/parisc/kernel/inventory.c
index bd1f7f1ff74e..d228d8237879 100644
--- a/arch/parisc/kernel/inventory.c
+++ b/arch/parisc/kernel/inventory.c
@@ -170,23 +170,27 @@ static void __init pagezero_memconfig(void)
170static int __init 170static int __init
171pat_query_module(ulong pcell_loc, ulong mod_index) 171pat_query_module(ulong pcell_loc, ulong mod_index)
172{ 172{
173 pdc_pat_cell_mod_maddr_block_t pa_pdc_cell; 173 pdc_pat_cell_mod_maddr_block_t *pa_pdc_cell;
174 unsigned long bytecnt; 174 unsigned long bytecnt;
175 unsigned long temp; /* 64-bit scratch value */ 175 unsigned long temp; /* 64-bit scratch value */
176 long status; /* PDC return value status */ 176 long status; /* PDC return value status */
177 struct parisc_device *dev; 177 struct parisc_device *dev;
178 178
179 pa_pdc_cell = kmalloc(sizeof (*pa_pdc_cell), GFP_KERNEL);
180 if (!pa_pdc_cell)
181 panic("couldn't allocate memory for PDC_PAT_CELL!");
182
179 /* return cell module (PA or Processor view) */ 183 /* return cell module (PA or Processor view) */
180 status = pdc_pat_cell_module(&bytecnt, pcell_loc, mod_index, 184 status = pdc_pat_cell_module(&bytecnt, pcell_loc, mod_index,
181 PA_VIEW, &pa_pdc_cell); 185 PA_VIEW, pa_pdc_cell);
182 186
183 if (status != PDC_OK) { 187 if (status != PDC_OK) {
184 /* no more cell modules or error */ 188 /* no more cell modules or error */
185 return status; 189 return status;
186 } 190 }
187 191
188 temp = pa_pdc_cell.cba; 192 temp = pa_pdc_cell->cba;
189 dev = alloc_pa_dev(PAT_GET_CBA(temp), &pa_pdc_cell.mod_path); 193 dev = alloc_pa_dev(PAT_GET_CBA(temp), &(pa_pdc_cell->mod_path));
190 if (!dev) { 194 if (!dev) {
191 return PDC_OK; 195 return PDC_OK;
192 } 196 }
@@ -203,8 +207,8 @@ pat_query_module(ulong pcell_loc, ulong mod_index)
203 207
204 /* save generic info returned from the call */ 208 /* save generic info returned from the call */
205 /* REVISIT: who is the consumer of this? not sure yet... */ 209 /* REVISIT: who is the consumer of this? not sure yet... */
206 dev->mod_info = pa_pdc_cell.mod_info; /* pass to PAT_GET_ENTITY() */ 210 dev->mod_info = pa_pdc_cell->mod_info; /* pass to PAT_GET_ENTITY() */
207 dev->pmod_loc = pa_pdc_cell.mod_location; 211 dev->pmod_loc = pa_pdc_cell->mod_location;
208 212
209 register_parisc_device(dev); /* advertise device */ 213 register_parisc_device(dev); /* advertise device */
210 214
@@ -216,14 +220,14 @@ pat_query_module(ulong pcell_loc, ulong mod_index)
216 220
217 case PAT_ENTITY_PROC: 221 case PAT_ENTITY_PROC:
218 printk(KERN_DEBUG "PAT_ENTITY_PROC: id_eid 0x%lx\n", 222 printk(KERN_DEBUG "PAT_ENTITY_PROC: id_eid 0x%lx\n",
219 pa_pdc_cell.mod[0]); 223 pa_pdc_cell->mod[0]);
220 break; 224 break;
221 225
222 case PAT_ENTITY_MEM: 226 case PAT_ENTITY_MEM:
223 printk(KERN_DEBUG 227 printk(KERN_DEBUG
224 "PAT_ENTITY_MEM: amount 0x%lx min_gni_base 0x%lx min_gni_len 0x%lx\n", 228 "PAT_ENTITY_MEM: amount 0x%lx min_gni_base 0x%lx min_gni_len 0x%lx\n",
225 pa_pdc_cell.mod[0], pa_pdc_cell.mod[1], 229 pa_pdc_cell->mod[0], pa_pdc_cell->mod[1],
226 pa_pdc_cell.mod[2]); 230 pa_pdc_cell->mod[2]);
227 break; 231 break;
228 case PAT_ENTITY_CA: 232 case PAT_ENTITY_CA:
229 printk(KERN_DEBUG "PAT_ENTITY_CA: %ld\n", pcell_loc); 233 printk(KERN_DEBUG "PAT_ENTITY_CA: %ld\n", pcell_loc);
@@ -243,23 +247,26 @@ pat_query_module(ulong pcell_loc, ulong mod_index)
243 print_ranges: 247 print_ranges:
244 pdc_pat_cell_module(&bytecnt, pcell_loc, mod_index, 248 pdc_pat_cell_module(&bytecnt, pcell_loc, mod_index,
245 IO_VIEW, &io_pdc_cell); 249 IO_VIEW, &io_pdc_cell);
246 printk(KERN_DEBUG "ranges %ld\n", pa_pdc_cell.mod[1]); 250 printk(KERN_DEBUG "ranges %ld\n", pa_pdc_cell->mod[1]);
247 for (i = 0; i < pa_pdc_cell.mod[1]; i++) { 251 for (i = 0; i < pa_pdc_cell->mod[1]; i++) {
248 printk(KERN_DEBUG 252 printk(KERN_DEBUG
249 " PA_VIEW %ld: 0x%016lx 0x%016lx 0x%016lx\n", 253 " PA_VIEW %ld: 0x%016lx 0x%016lx 0x%016lx\n",
250 i, pa_pdc_cell.mod[2 + i * 3], /* type */ 254 i, pa_pdc_cell->mod[2 + i * 3], /* type */
251 pa_pdc_cell.mod[3 + i * 3], /* start */ 255 pa_pdc_cell->mod[3 + i * 3], /* start */
252 pa_pdc_cell.mod[4 + i * 3]); /* finish (ie end) */ 256 pa_pdc_cell->mod[4 + i * 3]); /* finish (ie end) */
253 printk(KERN_DEBUG 257 printk(KERN_DEBUG
254 " IO_VIEW %ld: 0x%016lx 0x%016lx 0x%016lx\n", 258 " IO_VIEW %ld: 0x%016lx 0x%016lx 0x%016lx\n",
255 i, io_pdc_cell.mod[2 + i * 3], /* type */ 259 i, io_pdc_cell->mod[2 + i * 3], /* type */
256 io_pdc_cell.mod[3 + i * 3], /* start */ 260 io_pdc_cell->mod[3 + i * 3], /* start */
257 io_pdc_cell.mod[4 + i * 3]); /* finish (ie end) */ 261 io_pdc_cell->mod[4 + i * 3]); /* finish (ie end) */
258 } 262 }
259 printk(KERN_DEBUG "\n"); 263 printk(KERN_DEBUG "\n");
260 break; 264 break;
261 } 265 }
262#endif /* DEBUG_PAT */ 266#endif /* DEBUG_PAT */
267
268 kfree(pa_pdc_cell);
269
263 return PDC_OK; 270 return PDC_OK;
264} 271}
265 272
diff --git a/arch/parisc/kernel/irq.c b/arch/parisc/kernel/irq.c
index 8007f1e65729..330f536a9324 100644
--- a/arch/parisc/kernel/irq.c
+++ b/arch/parisc/kernel/irq.c
@@ -120,7 +120,7 @@ int cpu_check_affinity(unsigned int irq, const struct cpumask *dest)
120 if (CHECK_IRQ_PER_CPU(irq)) { 120 if (CHECK_IRQ_PER_CPU(irq)) {
121 /* Bad linux design decision. The mask has already 121 /* Bad linux design decision. The mask has already
122 * been set; we must reset it */ 122 * been set; we must reset it */
123 cpumask_setall(&irq_desc[irq].affinity); 123 cpumask_setall(irq_desc[irq].affinity);
124 return -EINVAL; 124 return -EINVAL;
125 } 125 }
126 126
@@ -138,13 +138,13 @@ static int cpu_set_affinity_irq(unsigned int irq, const struct cpumask *dest)
138 if (cpu_dest < 0) 138 if (cpu_dest < 0)
139 return -1; 139 return -1;
140 140
141 cpumask_copy(&irq_desc[irq].affinity, dest); 141 cpumask_copy(irq_desc[irq].affinity, dest);
142 142
143 return 0; 143 return 0;
144} 144}
145#endif 145#endif
146 146
147static struct hw_interrupt_type cpu_interrupt_type = { 147static struct irq_chip cpu_interrupt_type = {
148 .typename = "CPU", 148 .typename = "CPU",
149 .startup = cpu_startup_irq, 149 .startup = cpu_startup_irq,
150 .shutdown = cpu_disable_irq, 150 .shutdown = cpu_disable_irq,
@@ -299,7 +299,7 @@ int txn_alloc_irq(unsigned int bits_wide)
299unsigned long txn_affinity_addr(unsigned int irq, int cpu) 299unsigned long txn_affinity_addr(unsigned int irq, int cpu)
300{ 300{
301#ifdef CONFIG_SMP 301#ifdef CONFIG_SMP
302 cpumask_copy(&irq_desc[irq].affinity, cpumask_of(cpu)); 302 cpumask_copy(irq_desc[irq].affinity, cpumask_of(cpu));
303#endif 303#endif
304 304
305 return per_cpu(cpu_data, cpu).txn_addr; 305 return per_cpu(cpu_data, cpu).txn_addr;
@@ -356,7 +356,7 @@ void do_cpu_irq_mask(struct pt_regs *regs)
356 irq = eirr_to_irq(eirr_val); 356 irq = eirr_to_irq(eirr_val);
357 357
358#ifdef CONFIG_SMP 358#ifdef CONFIG_SMP
359 cpumask_copy(&dest, &irq_desc[irq].affinity); 359 cpumask_copy(&dest, irq_desc[irq].affinity);
360 if (CHECK_IRQ_PER_CPU(irq_desc[irq].status) && 360 if (CHECK_IRQ_PER_CPU(irq_desc[irq].status) &&
361 !cpu_isset(smp_processor_id(), dest)) { 361 !cpu_isset(smp_processor_id(), dest)) {
362 int cpu = first_cpu(dest); 362 int cpu = first_cpu(dest);
diff --git a/arch/parisc/kernel/module.c b/arch/parisc/kernel/module.c
index ef5caf2e6ed0..61ee0eec4e69 100644
--- a/arch/parisc/kernel/module.c
+++ b/arch/parisc/kernel/module.c
@@ -86,8 +86,12 @@
86 * the bottom of the table, which has a maximum signed displacement of 86 * the bottom of the table, which has a maximum signed displacement of
87 * 0x3fff; however, since we're only going forward, this becomes 87 * 0x3fff; however, since we're only going forward, this becomes
88 * 0x1fff, and thus, since each GOT entry is 8 bytes long we can have 88 * 0x1fff, and thus, since each GOT entry is 8 bytes long we can have
89 * at most 1023 entries */ 89 * at most 1023 entries.
90#define MAX_GOTS 1023 90 * To overcome this 14bit displacement with some kernel modules, we'll
91 * use instead the unusal 16bit displacement method (see reassemble_16a)
92 * which gives us a maximum positive displacement of 0x7fff, and as such
93 * allows us to allocate up to 4095 GOT entries. */
94#define MAX_GOTS 4095
91 95
92/* three functions to determine where in the module core 96/* three functions to determine where in the module core
93 * or init pieces the location is */ 97 * or init pieces the location is */
@@ -145,12 +149,40 @@ struct stub_entry {
145/* The reassemble_* functions prepare an immediate value for 149/* The reassemble_* functions prepare an immediate value for
146 insertion into an opcode. pa-risc uses all sorts of weird bitfields 150 insertion into an opcode. pa-risc uses all sorts of weird bitfields
147 in the instruction to hold the value. */ 151 in the instruction to hold the value. */
152static inline int sign_unext(int x, int len)
153{
154 int len_ones;
155
156 len_ones = (1 << len) - 1;
157 return x & len_ones;
158}
159
160static inline int low_sign_unext(int x, int len)
161{
162 int sign, temp;
163
164 sign = (x >> (len-1)) & 1;
165 temp = sign_unext(x, len-1);
166 return (temp << 1) | sign;
167}
168
148static inline int reassemble_14(int as14) 169static inline int reassemble_14(int as14)
149{ 170{
150 return (((as14 & 0x1fff) << 1) | 171 return (((as14 & 0x1fff) << 1) |
151 ((as14 & 0x2000) >> 13)); 172 ((as14 & 0x2000) >> 13));
152} 173}
153 174
175static inline int reassemble_16a(int as16)
176{
177 int s, t;
178
179 /* Unusual 16-bit encoding, for wide mode only. */
180 t = (as16 << 1) & 0xffff;
181 s = (as16 & 0x8000);
182 return (t ^ s ^ (s >> 1)) | (s >> 15);
183}
184
185
154static inline int reassemble_17(int as17) 186static inline int reassemble_17(int as17)
155{ 187{
156 return (((as17 & 0x10000) >> 16) | 188 return (((as17 & 0x10000) >> 16) |
@@ -407,6 +439,7 @@ static Elf_Addr get_stub(struct module *me, unsigned long value, long addend,
407 enum elf_stub_type stub_type, Elf_Addr loc0, unsigned int targetsec) 439 enum elf_stub_type stub_type, Elf_Addr loc0, unsigned int targetsec)
408{ 440{
409 struct stub_entry *stub; 441 struct stub_entry *stub;
442 int __maybe_unused d;
410 443
411 /* initialize stub_offset to point in front of the section */ 444 /* initialize stub_offset to point in front of the section */
412 if (!me->arch.section[targetsec].stub_offset) { 445 if (!me->arch.section[targetsec].stub_offset) {
@@ -460,12 +493,19 @@ static Elf_Addr get_stub(struct module *me, unsigned long value, long addend,
460 */ 493 */
461 switch (stub_type) { 494 switch (stub_type) {
462 case ELF_STUB_GOT: 495 case ELF_STUB_GOT:
463 stub->insns[0] = 0x537b0000; /* ldd 0(%dp),%dp */ 496 d = get_got(me, value, addend);
497 if (d <= 15) {
498 /* Format 5 */
499 stub->insns[0] = 0x0f6010db; /* ldd 0(%dp),%dp */
500 stub->insns[0] |= low_sign_unext(d, 5) << 16;
501 } else {
502 /* Format 3 */
503 stub->insns[0] = 0x537b0000; /* ldd 0(%dp),%dp */
504 stub->insns[0] |= reassemble_16a(d);
505 }
464 stub->insns[1] = 0x53610020; /* ldd 10(%dp),%r1 */ 506 stub->insns[1] = 0x53610020; /* ldd 10(%dp),%r1 */
465 stub->insns[2] = 0xe820d000; /* bve (%r1) */ 507 stub->insns[2] = 0xe820d000; /* bve (%r1) */
466 stub->insns[3] = 0x537b0030; /* ldd 18(%dp),%dp */ 508 stub->insns[3] = 0x537b0030; /* ldd 18(%dp),%dp */
467
468 stub->insns[0] |= reassemble_14(get_got(me, value, addend) & 0x3fff);
469 break; 509 break;
470 case ELF_STUB_MILLI: 510 case ELF_STUB_MILLI:
471 stub->insns[0] = 0x20200000; /* ldil 0,%r1 */ 511 stub->insns[0] = 0x20200000; /* ldil 0,%r1 */
diff --git a/arch/parisc/kernel/pci-dma.c b/arch/parisc/kernel/pci-dma.c
index 7d927eac932b..c07f618ff7da 100644
--- a/arch/parisc/kernel/pci-dma.c
+++ b/arch/parisc/kernel/pci-dma.c
@@ -90,12 +90,14 @@ static inline int map_pte_uncached(pte_t * pte,
90 if (end > PMD_SIZE) 90 if (end > PMD_SIZE)
91 end = PMD_SIZE; 91 end = PMD_SIZE;
92 do { 92 do {
93 unsigned long flags;
94
93 if (!pte_none(*pte)) 95 if (!pte_none(*pte))
94 printk(KERN_ERR "map_pte_uncached: page already exists\n"); 96 printk(KERN_ERR "map_pte_uncached: page already exists\n");
95 set_pte(pte, __mk_pte(*paddr_ptr, PAGE_KERNEL_UNC)); 97 set_pte(pte, __mk_pte(*paddr_ptr, PAGE_KERNEL_UNC));
96 purge_tlb_start(); 98 purge_tlb_start(flags);
97 pdtlb_kernel(orig_vaddr); 99 pdtlb_kernel(orig_vaddr);
98 purge_tlb_end(); 100 purge_tlb_end(flags);
99 vaddr += PAGE_SIZE; 101 vaddr += PAGE_SIZE;
100 orig_vaddr += PAGE_SIZE; 102 orig_vaddr += PAGE_SIZE;
101 (*paddr_ptr) += PAGE_SIZE; 103 (*paddr_ptr) += PAGE_SIZE;
@@ -168,11 +170,13 @@ static inline void unmap_uncached_pte(pmd_t * pmd, unsigned long vaddr,
168 if (end > PMD_SIZE) 170 if (end > PMD_SIZE)
169 end = PMD_SIZE; 171 end = PMD_SIZE;
170 do { 172 do {
173 unsigned long flags;
171 pte_t page = *pte; 174 pte_t page = *pte;
175
172 pte_clear(&init_mm, vaddr, pte); 176 pte_clear(&init_mm, vaddr, pte);
173 purge_tlb_start(); 177 purge_tlb_start(flags);
174 pdtlb_kernel(orig_vaddr); 178 pdtlb_kernel(orig_vaddr);
175 purge_tlb_end(); 179 purge_tlb_end(flags);
176 vaddr += PAGE_SIZE; 180 vaddr += PAGE_SIZE;
177 orig_vaddr += PAGE_SIZE; 181 orig_vaddr += PAGE_SIZE;
178 pte++; 182 pte++;
diff --git a/arch/parisc/kernel/pci.c b/arch/parisc/kernel/pci.c
index 6936386c9861..f7064abc3bb6 100644
--- a/arch/parisc/kernel/pci.c
+++ b/arch/parisc/kernel/pci.c
@@ -1,5 +1,4 @@
1/* $Id: pci.c,v 1.6 2000/01/29 00:12:05 grundler Exp $ 1/*
2 *
3 * This file is subject to the terms and conditions of the GNU General Public 2 * This file is subject to the terms and conditions of the GNU General Public
4 * 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
5 * for more details. 4 * for more details.
diff --git a/arch/parisc/kernel/process.c b/arch/parisc/kernel/process.c
index 61c07078c072..1f3aa8db0203 100644
--- a/arch/parisc/kernel/process.c
+++ b/arch/parisc/kernel/process.c
@@ -156,7 +156,7 @@ void machine_power_off(void)
156 * software. The user has to press the button himself. */ 156 * software. The user has to press the button himself. */
157 157
158 printk(KERN_EMERG "System shut down completed.\n" 158 printk(KERN_EMERG "System shut down completed.\n"
159 KERN_EMERG "Please power this system off now."); 159 "Please power this system off now.");
160} 160}
161 161
162void (*pm_power_off)(void) = machine_power_off; 162void (*pm_power_off)(void) = machine_power_off;
diff --git a/arch/parisc/kernel/processor.c b/arch/parisc/kernel/processor.c
index e09d0f7fb6b0..c8fb61ed32f4 100644
--- a/arch/parisc/kernel/processor.c
+++ b/arch/parisc/kernel/processor.c
@@ -1,5 +1,4 @@
1/* $Id: processor.c,v 1.1 2002/07/20 16:27:06 rhirst Exp $ 1/*
2 *
3 * Initial setup-routines for HP 9000 based hardware. 2 * Initial setup-routines for HP 9000 based hardware.
4 * 3 *
5 * Copyright (C) 1991, 1992, 1995 Linus Torvalds 4 * Copyright (C) 1991, 1992, 1995 Linus Torvalds
@@ -121,22 +120,28 @@ static int __cpuinit processor_probe(struct parisc_device *dev)
121 if (is_pdc_pat()) { 120 if (is_pdc_pat()) {
122 ulong status; 121 ulong status;
123 unsigned long bytecnt; 122 unsigned long bytecnt;
124 pdc_pat_cell_mod_maddr_block_t pa_pdc_cell; 123 pdc_pat_cell_mod_maddr_block_t *pa_pdc_cell;
125#undef USE_PAT_CPUID 124#undef USE_PAT_CPUID
126#ifdef USE_PAT_CPUID 125#ifdef USE_PAT_CPUID
127 struct pdc_pat_cpu_num cpu_info; 126 struct pdc_pat_cpu_num cpu_info;
128#endif 127#endif
129 128
129 pa_pdc_cell = kmalloc(sizeof (*pa_pdc_cell), GFP_KERNEL);
130 if (!pa_pdc_cell)
131 panic("couldn't allocate memory for PDC_PAT_CELL!");
132
130 status = pdc_pat_cell_module(&bytecnt, dev->pcell_loc, 133 status = pdc_pat_cell_module(&bytecnt, dev->pcell_loc,
131 dev->mod_index, PA_VIEW, &pa_pdc_cell); 134 dev->mod_index, PA_VIEW, pa_pdc_cell);
132 135
133 BUG_ON(PDC_OK != status); 136 BUG_ON(PDC_OK != status);
134 137
135 /* verify it's the same as what do_pat_inventory() found */ 138 /* verify it's the same as what do_pat_inventory() found */
136 BUG_ON(dev->mod_info != pa_pdc_cell.mod_info); 139 BUG_ON(dev->mod_info != pa_pdc_cell->mod_info);
137 BUG_ON(dev->pmod_loc != pa_pdc_cell.mod_location); 140 BUG_ON(dev->pmod_loc != pa_pdc_cell->mod_location);
141
142 txn_addr = pa_pdc_cell->mod[0]; /* id_eid for IO sapic */
138 143
139 txn_addr = pa_pdc_cell.mod[0]; /* id_eid for IO sapic */ 144 kfree(pa_pdc_cell);
140 145
141#ifdef USE_PAT_CPUID 146#ifdef USE_PAT_CPUID
142/* We need contiguous numbers for cpuid. Firmware's notion 147/* We need contiguous numbers for cpuid. Firmware's notion
diff --git a/arch/parisc/kernel/setup.c b/arch/parisc/kernel/setup.c
index 82131ca8e05c..cb71f3dac995 100644
--- a/arch/parisc/kernel/setup.c
+++ b/arch/parisc/kernel/setup.c
@@ -1,5 +1,4 @@
1/* $Id: setup.c,v 1.8 2000/02/02 04:42:38 prumpf Exp $ 1/*
2 *
3 * Initial setup-routines for HP 9000 based hardware. 2 * Initial setup-routines for HP 9000 based hardware.
4 * 3 *
5 * Copyright (C) 1991, 1992, 1995 Linus Torvalds 4 * Copyright (C) 1991, 1992, 1995 Linus Torvalds
diff --git a/arch/parisc/kernel/sys_parisc32.c b/arch/parisc/kernel/sys_parisc32.c
index 1adb40c81669..92a0acaa0d12 100644
--- a/arch/parisc/kernel/sys_parisc32.c
+++ b/arch/parisc/kernel/sys_parisc32.c
@@ -174,68 +174,6 @@ asmlinkage long sys32_sched_rr_get_interval(pid_t pid,
174 return ret; 174 return ret;
175} 175}
176 176
177/*** copied from mips64 ***/
178/*
179 * Ooo, nasty. We need here to frob 32-bit unsigned longs to
180 * 64-bit unsigned longs.
181 */
182
183static inline int
184get_fd_set32(unsigned long n, u32 *ufdset, unsigned long *fdset)
185{
186 n = (n + 8*sizeof(u32) - 1) / (8*sizeof(u32));
187 if (ufdset) {
188 unsigned long odd;
189
190 if (!access_ok(VERIFY_WRITE, ufdset, n*sizeof(u32)))
191 return -EFAULT;
192
193 odd = n & 1UL;
194 n &= ~1UL;
195 while (n) {
196 unsigned long h, l;
197 __get_user(l, ufdset);
198 __get_user(h, ufdset+1);
199 ufdset += 2;
200 *fdset++ = h << 32 | l;
201 n -= 2;
202 }
203 if (odd)
204 __get_user(*fdset, ufdset);
205 } else {
206 /* Tricky, must clear full unsigned long in the
207 * kernel fdset at the end, this makes sure that
208 * actually happens.
209 */
210 memset(fdset, 0, ((n + 1) & ~1)*sizeof(u32));
211 }
212 return 0;
213}
214
215static inline void
216set_fd_set32(unsigned long n, u32 *ufdset, unsigned long *fdset)
217{
218 unsigned long odd;
219 n = (n + 8*sizeof(u32) - 1) / (8*sizeof(u32));
220
221 if (!ufdset)
222 return;
223
224 odd = n & 1UL;
225 n &= ~1UL;
226 while (n) {
227 unsigned long h, l;
228 l = *fdset++;
229 h = l >> 32;
230 __put_user(l, ufdset);
231 __put_user(h, ufdset+1);
232 ufdset += 2;
233 n -= 2;
234 }
235 if (odd)
236 __put_user(*fdset, ufdset);
237}
238
239struct msgbuf32 { 177struct msgbuf32 {
240 int mtype; 178 int mtype;
241 char mtext[1]; 179 char mtext[1];
diff --git a/arch/parisc/kernel/syscall_table.S b/arch/parisc/kernel/syscall_table.S
index 03b9a01bc16c..cf145eb026b3 100644
--- a/arch/parisc/kernel/syscall_table.S
+++ b/arch/parisc/kernel/syscall_table.S
@@ -413,6 +413,10 @@
413 ENTRY_SAME(dup3) 413 ENTRY_SAME(dup3)
414 ENTRY_SAME(pipe2) 414 ENTRY_SAME(pipe2)
415 ENTRY_SAME(inotify_init1) 415 ENTRY_SAME(inotify_init1)
416 ENTRY_COMP(preadv) /* 315 */
417 ENTRY_COMP(pwritev)
418 ENTRY_COMP(rt_tgsigqueueinfo)
419 ENTRY_SAME(perf_counter_open)
416 420
417 /* Nothing yet */ 421 /* Nothing yet */
418 422
diff --git a/arch/parisc/kernel/time.c b/arch/parisc/kernel/time.c
index d4dd05674c62..a79c6f9e7e2c 100644
--- a/arch/parisc/kernel/time.c
+++ b/arch/parisc/kernel/time.c
@@ -56,9 +56,9 @@ static unsigned long clocktick __read_mostly; /* timer cycles per tick */
56 */ 56 */
57irqreturn_t __irq_entry timer_interrupt(int irq, void *dev_id) 57irqreturn_t __irq_entry timer_interrupt(int irq, void *dev_id)
58{ 58{
59 unsigned long now; 59 unsigned long now, now2;
60 unsigned long next_tick; 60 unsigned long next_tick;
61 unsigned long cycles_elapsed, ticks_elapsed; 61 unsigned long cycles_elapsed, ticks_elapsed = 1;
62 unsigned long cycles_remainder; 62 unsigned long cycles_remainder;
63 unsigned int cpu = smp_processor_id(); 63 unsigned int cpu = smp_processor_id();
64 struct cpuinfo_parisc *cpuinfo = &per_cpu(cpu_data, cpu); 64 struct cpuinfo_parisc *cpuinfo = &per_cpu(cpu_data, cpu);
@@ -71,44 +71,24 @@ irqreturn_t __irq_entry timer_interrupt(int irq, void *dev_id)
71 /* Initialize next_tick to the expected tick time. */ 71 /* Initialize next_tick to the expected tick time. */
72 next_tick = cpuinfo->it_value; 72 next_tick = cpuinfo->it_value;
73 73
74 /* Get current interval timer. 74 /* Get current cycle counter (Control Register 16). */
75 * CR16 reads as 64 bits in CPU wide mode.
76 * CR16 reads as 32 bits in CPU narrow mode.
77 */
78 now = mfctl(16); 75 now = mfctl(16);
79 76
80 cycles_elapsed = now - next_tick; 77 cycles_elapsed = now - next_tick;
81 78
82 if ((cycles_elapsed >> 5) < cpt) { 79 if ((cycles_elapsed >> 6) < cpt) {
83 /* use "cheap" math (add/subtract) instead 80 /* use "cheap" math (add/subtract) instead
84 * of the more expensive div/mul method 81 * of the more expensive div/mul method
85 */ 82 */
86 cycles_remainder = cycles_elapsed; 83 cycles_remainder = cycles_elapsed;
87 ticks_elapsed = 1;
88 while (cycles_remainder > cpt) { 84 while (cycles_remainder > cpt) {
89 cycles_remainder -= cpt; 85 cycles_remainder -= cpt;
90 ticks_elapsed++; 86 ticks_elapsed++;
91 } 87 }
92 } else { 88 } else {
89 /* TODO: Reduce this to one fdiv op */
93 cycles_remainder = cycles_elapsed % cpt; 90 cycles_remainder = cycles_elapsed % cpt;
94 ticks_elapsed = 1 + cycles_elapsed / cpt; 91 ticks_elapsed += cycles_elapsed / cpt;
95 }
96
97 /* Can we differentiate between "early CR16" (aka Scenario 1) and
98 * "long delay" (aka Scenario 3)? I don't think so.
99 *
100 * We expected timer_interrupt to be delivered at least a few hundred
101 * cycles after the IT fires. But it's arbitrary how much time passes
102 * before we call it "late". I've picked one second.
103 */
104 if (unlikely(ticks_elapsed > HZ)) {
105 /* Scenario 3: very long delay? bad in any case */
106 printk (KERN_CRIT "timer_interrupt(CPU %d): delayed!"
107 " cycles %lX rem %lX "
108 " next/now %lX/%lX\n",
109 cpu,
110 cycles_elapsed, cycles_remainder,
111 next_tick, now );
112 } 92 }
113 93
114 /* convert from "division remainder" to "remainder of clock tick" */ 94 /* convert from "division remainder" to "remainder of clock tick" */
@@ -122,18 +102,56 @@ irqreturn_t __irq_entry timer_interrupt(int irq, void *dev_id)
122 102
123 cpuinfo->it_value = next_tick; 103 cpuinfo->it_value = next_tick;
124 104
125 /* Skip one clocktick on purpose if we are likely to miss next_tick. 105 /* Program the IT when to deliver the next interrupt.
126 * We want to avoid the new next_tick being less than CR16. 106 * Only bottom 32-bits of next_tick are writable in CR16!
127 * If that happened, itimer wouldn't fire until CR16 wrapped.
128 * We'll catch the tick we missed on the tick after that.
129 */ 107 */
130 if (!(cycles_remainder >> 13))
131 next_tick += cpt;
132
133 /* Program the IT when to deliver the next interrupt. */
134 /* Only bottom 32-bits of next_tick are written to cr16. */
135 mtctl(next_tick, 16); 108 mtctl(next_tick, 16);
136 109
110 /* Skip one clocktick on purpose if we missed next_tick.
111 * The new CR16 must be "later" than current CR16 otherwise
112 * itimer would not fire until CR16 wrapped - e.g 4 seconds
113 * later on a 1Ghz processor. We'll account for the missed
114 * tick on the next timer interrupt.
115 *
116 * "next_tick - now" will always give the difference regardless
117 * if one or the other wrapped. If "now" is "bigger" we'll end up
118 * with a very large unsigned number.
119 */
120 now2 = mfctl(16);
121 if (next_tick - now2 > cpt)
122 mtctl(next_tick+cpt, 16);
123
124#if 1
125/*
126 * GGG: DEBUG code for how many cycles programming CR16 used.
127 */
128 if (unlikely(now2 - now > 0x3000)) /* 12K cycles */
129 printk (KERN_CRIT "timer_interrupt(CPU %d): SLOW! 0x%lx cycles!"
130 " cyc %lX rem %lX "
131 " next/now %lX/%lX\n",
132 cpu, now2 - now, cycles_elapsed, cycles_remainder,
133 next_tick, now );
134#endif
135
136 /* Can we differentiate between "early CR16" (aka Scenario 1) and
137 * "long delay" (aka Scenario 3)? I don't think so.
138 *
139 * Timer_interrupt will be delivered at least a few hundred cycles
140 * after the IT fires. But it's arbitrary how much time passes
141 * before we call it "late". I've picked one second.
142 *
143 * It's important NO printk's are between reading CR16 and
144 * setting up the next value. May introduce huge variance.
145 */
146 if (unlikely(ticks_elapsed > HZ)) {
147 /* Scenario 3: very long delay? bad in any case */
148 printk (KERN_CRIT "timer_interrupt(CPU %d): delayed!"
149 " cycles %lX rem %lX "
150 " next/now %lX/%lX\n",
151 cpu,
152 cycles_elapsed, cycles_remainder,
153 next_tick, now );
154 }
137 155
138 /* Done mucking with unreliable delivery of interrupts. 156 /* Done mucking with unreliable delivery of interrupts.
139 * Go do system house keeping. 157 * Go do system house keeping.
@@ -173,7 +191,7 @@ EXPORT_SYMBOL(profile_pc);
173 191
174/* clock source code */ 192/* clock source code */
175 193
176static cycle_t read_cr16(void) 194static cycle_t read_cr16(struct clocksource *cs)
177{ 195{
178 return get_cycles(); 196 return get_cycles();
179} 197}
diff --git a/arch/parisc/kernel/traps.c b/arch/parisc/kernel/traps.c
index c32f5d6d778e..528f0ff9b273 100644
--- a/arch/parisc/kernel/traps.c
+++ b/arch/parisc/kernel/traps.c
@@ -250,15 +250,14 @@ void die_if_kernel(char *str, struct pt_regs *regs, long err)
250 oops_enter(); 250 oops_enter();
251 251
252 /* Amuse the user in a SPARC fashion */ 252 /* Amuse the user in a SPARC fashion */
253 if (err) printk( 253 if (err) printk(KERN_CRIT
254KERN_CRIT " _______________________________ \n" 254 " _______________________________ \n"
255KERN_CRIT " < Your System ate a SPARC! Gah! >\n" 255 " < Your System ate a SPARC! Gah! >\n"
256KERN_CRIT " ------------------------------- \n" 256 " ------------------------------- \n"
257KERN_CRIT " \\ ^__^\n" 257 " \\ ^__^\n"
258KERN_CRIT " \\ (xx)\\_______\n" 258 " (__)\\ )\\/\\\n"
259KERN_CRIT " (__)\\ )\\/\\\n" 259 " U ||----w |\n"
260KERN_CRIT " U ||----w |\n" 260 " || ||\n");
261KERN_CRIT " || ||\n");
262 261
263 /* unlock the pdc lock if necessary */ 262 /* unlock the pdc lock if necessary */
264 pdc_emergency_unlock(); 263 pdc_emergency_unlock();
@@ -797,7 +796,8 @@ void notrace handle_interruption(int code, struct pt_regs *regs)
797 else 796 else
798 printk(KERN_DEBUG "User Fault (long pointer) (fault %d) ", 797 printk(KERN_DEBUG "User Fault (long pointer) (fault %d) ",
799 code); 798 code);
800 printk("pid=%d command='%s'\n", task_pid_nr(current), current->comm); 799 printk(KERN_CONT "pid=%d command='%s'\n",
800 task_pid_nr(current), current->comm);
801 show_regs(regs); 801 show_regs(regs);
802#endif 802#endif
803 si.si_signo = SIGSEGV; 803 si.si_signo = SIGSEGV;
diff --git a/arch/parisc/lib/checksum.c b/arch/parisc/lib/checksum.c
index 462696d30d3b..ae66d31f9ecf 100644
--- a/arch/parisc/lib/checksum.c
+++ b/arch/parisc/lib/checksum.c
@@ -13,8 +13,6 @@
13 * modify it under the terms of the GNU General Public License 13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 14 * as published by the Free Software Foundation; either version
15 * 2 of the License, or (at your option) any later version. 15 * 2 of the License, or (at your option) any later version.
16 *
17 * $Id: checksum.c,v 1.3 1997/12/01 17:57:34 ralf Exp $
18 */ 16 */
19#include <linux/module.h> 17#include <linux/module.h>
20#include <linux/types.h> 18#include <linux/types.h>
diff --git a/arch/parisc/lib/memcpy.c b/arch/parisc/lib/memcpy.c
index bbda909c866e..abf41f4632a9 100644
--- a/arch/parisc/lib/memcpy.c
+++ b/arch/parisc/lib/memcpy.c
@@ -405,7 +405,7 @@ byte_copy:
405 405
406unaligned_copy: 406unaligned_copy:
407 /* possibly we are aligned on a word, but not on a double... */ 407 /* possibly we are aligned on a word, but not on a double... */
408 if (likely(t1 & (sizeof(unsigned int)-1)) == 0) { 408 if (likely((t1 & (sizeof(unsigned int)-1)) == 0)) {
409 t2 = src & (sizeof(unsigned int) - 1); 409 t2 = src & (sizeof(unsigned int) - 1);
410 410
411 if (unlikely(t2 != 0)) { 411 if (unlikely(t2 != 0)) {
diff --git a/arch/parisc/math-emu/decode_exc.c b/arch/parisc/math-emu/decode_exc.c
index 66c8a9f6a27e..3ca1c6149218 100644
--- a/arch/parisc/math-emu/decode_exc.c
+++ b/arch/parisc/math-emu/decode_exc.c
@@ -40,7 +40,7 @@
40 * END_DESC 40 * END_DESC
41*/ 41*/
42 42
43 43#include <linux/kernel.h>
44#include "float.h" 44#include "float.h"
45#include "sgl_float.h" 45#include "sgl_float.h"
46#include "dbl_float.h" 46#include "dbl_float.h"
diff --git a/arch/parisc/mm/fault.c b/arch/parisc/mm/fault.c
index bfb6dd6ab380..c6afbfc95770 100644
--- a/arch/parisc/mm/fault.c
+++ b/arch/parisc/mm/fault.c
@@ -1,5 +1,4 @@
1/* $Id: fault.c,v 1.5 2000/01/26 16:20:29 jsm Exp $ 1/*
2 *
3 * This file is subject to the terms and conditions of the GNU General Public 2 * This file is subject to the terms and conditions of the GNU General Public
4 * 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
5 * for more details. 4 * for more details.
diff --git a/arch/parisc/mm/init.c b/arch/parisc/mm/init.c
index 4356ceb1e366..b0831d9e35cb 100644
--- a/arch/parisc/mm/init.c
+++ b/arch/parisc/mm/init.c
@@ -370,34 +370,22 @@ static void __init setup_bootmem(void)
370 370
371void free_initmem(void) 371void free_initmem(void)
372{ 372{
373 unsigned long addr, init_begin, init_end; 373 unsigned long addr;
374 374 unsigned long init_begin = (unsigned long)__init_begin;
375 printk(KERN_INFO "Freeing unused kernel memory: "); 375 unsigned long init_end = (unsigned long)__init_end;
376 376
377#ifdef CONFIG_DEBUG_KERNEL 377#ifdef CONFIG_DEBUG_KERNEL
378 /* Attempt to catch anyone trying to execute code here 378 /* Attempt to catch anyone trying to execute code here
379 * by filling the page with BRK insns. 379 * by filling the page with BRK insns.
380 *
381 * If we disable interrupts for all CPUs, then IPI stops working.
382 * Kinda breaks the global cache flushing.
383 */ 380 */
384 local_irq_disable(); 381 memset((void *)init_begin, 0x00, init_end - init_begin);
385 382 flush_icache_range(init_begin, init_end);
386 memset(__init_begin, 0x00,
387 (unsigned long)__init_end - (unsigned long)__init_begin);
388
389 flush_data_cache();
390 asm volatile("sync" : : );
391 flush_icache_range((unsigned long)__init_begin, (unsigned long)__init_end);
392 asm volatile("sync" : : );
393
394 local_irq_enable();
395#endif 383#endif
396 384
397 /* align __init_begin and __init_end to page size, 385 /* align __init_begin and __init_end to page size,
398 ignoring linker script where we might have tried to save RAM */ 386 ignoring linker script where we might have tried to save RAM */
399 init_begin = PAGE_ALIGN((unsigned long)(__init_begin)); 387 init_begin = PAGE_ALIGN(init_begin);
400 init_end = PAGE_ALIGN((unsigned long)(__init_end)); 388 init_end = PAGE_ALIGN(init_end);
401 for (addr = init_begin; addr < init_end; addr += PAGE_SIZE) { 389 for (addr = init_begin; addr < init_end; addr += PAGE_SIZE) {
402 ClearPageReserved(virt_to_page(addr)); 390 ClearPageReserved(virt_to_page(addr));
403 init_page_count(virt_to_page(addr)); 391 init_page_count(virt_to_page(addr));
@@ -409,7 +397,8 @@ void free_initmem(void)
409 /* set up a new led state on systems shipped LED State panel */ 397 /* set up a new led state on systems shipped LED State panel */
410 pdc_chassis_send_status(PDC_CHASSIS_DIRECT_BCOMPLETE); 398 pdc_chassis_send_status(PDC_CHASSIS_DIRECT_BCOMPLETE);
411 399
412 printk("%luk freed\n", (init_end - init_begin) >> 10); 400 printk(KERN_INFO "Freeing unused kernel memory: %luk freed\n",
401 (init_end - init_begin) >> 10);
413} 402}
414 403
415 404
diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index bf6cedfa05db..d00131ca0835 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -62,7 +62,6 @@ config HAVE_LATENCYTOP_SUPPORT
62 62
63config TRACE_IRQFLAGS_SUPPORT 63config TRACE_IRQFLAGS_SUPPORT
64 bool 64 bool
65 depends on PPC64
66 default y 65 default y
67 66
68config LOCKDEP_SUPPORT 67config LOCKDEP_SUPPORT
diff --git a/arch/powerpc/boot/.gitignore b/arch/powerpc/boot/.gitignore
index 2f50acd11a60..3d80c3e9cf60 100644
--- a/arch/powerpc/boot/.gitignore
+++ b/arch/powerpc/boot/.gitignore
@@ -36,3 +36,13 @@ zImage.pseries
36zconf.h 36zconf.h
37zlib.h 37zlib.h
38zutil.h 38zutil.h
39fdt.c
40fdt.h
41fdt_ro.c
42fdt_rw.c
43fdt_strerror.c
44fdt_sw.c
45fdt_wip.c
46libfdt.h
47libfdt_internal.h
48
diff --git a/arch/powerpc/boot/dts/amigaone.dts b/arch/powerpc/boot/dts/amigaone.dts
index 26549fca2ed4..49ac36b16dd7 100644
--- a/arch/powerpc/boot/dts/amigaone.dts
+++ b/arch/powerpc/boot/dts/amigaone.dts
@@ -70,8 +70,8 @@
70 devsel-speed = <0x00000001>; 70 devsel-speed = <0x00000001>;
71 min-grant = <0>; 71 min-grant = <0>;
72 max-latency = <0>; 72 max-latency = <0>;
73 /* First 64k for I/O at 0x0 on PCI mapped to 0x0 on ISA. */ 73 /* First 4k for I/O at 0x0 on PCI mapped to 0x0 on ISA. */
74 ranges = <0x00000001 0 0x01000000 0 0x00000000 0x00010000>; 74 ranges = <0x00000001 0 0x01000000 0 0x00000000 0x00001000>;
75 interrupt-parent = <&i8259>; 75 interrupt-parent = <&i8259>;
76 #interrupt-cells = <2>; 76 #interrupt-cells = <2>;
77 #address-cells = <2>; 77 #address-cells = <2>;
diff --git a/arch/powerpc/boot/dts/mpc8377_rdb.dts b/arch/powerpc/boot/dts/mpc8377_rdb.dts
index 224b4f0704b8..4f06dbc0d27e 100644
--- a/arch/powerpc/boot/dts/mpc8377_rdb.dts
+++ b/arch/powerpc/boot/dts/mpc8377_rdb.dts
@@ -410,7 +410,7 @@
410 bus-range = <0 0>; 410 bus-range = <0 0>;
411 ranges = <0x02000000 0x0 0x90000000 0x90000000 0x0 0x10000000 411 ranges = <0x02000000 0x0 0x90000000 0x90000000 0x0 0x10000000
412 0x42000000 0x0 0x80000000 0x80000000 0x0 0x10000000 412 0x42000000 0x0 0x80000000 0x80000000 0x0 0x10000000
413 0x01000000 0x0 0x00000000 0xe2000000 0x0 0x00100000>; 413 0x01000000 0x0 0x00000000 0xe0300000 0x0 0x00100000>;
414 sleep = <&pmc 0x00010000>; 414 sleep = <&pmc 0x00010000>;
415 clock-frequency = <66666666>; 415 clock-frequency = <66666666>;
416 #interrupt-cells = <1>; 416 #interrupt-cells = <1>;
diff --git a/arch/powerpc/boot/dts/mpc8378_rdb.dts b/arch/powerpc/boot/dts/mpc8378_rdb.dts
index 474ea2fa3f86..aabf3437cadf 100644
--- a/arch/powerpc/boot/dts/mpc8378_rdb.dts
+++ b/arch/powerpc/boot/dts/mpc8378_rdb.dts
@@ -394,7 +394,7 @@
394 bus-range = <0 0>; 394 bus-range = <0 0>;
395 ranges = <0x02000000 0x0 0x90000000 0x90000000 0x0 0x10000000 395 ranges = <0x02000000 0x0 0x90000000 0x90000000 0x0 0x10000000
396 0x42000000 0x0 0x80000000 0x80000000 0x0 0x10000000 396 0x42000000 0x0 0x80000000 0x80000000 0x0 0x10000000
397 0x01000000 0x0 0x00000000 0xe2000000 0x0 0x00100000>; 397 0x01000000 0x0 0x00000000 0xe0300000 0x0 0x00100000>;
398 sleep = <&pmc 0x00010000>; 398 sleep = <&pmc 0x00010000>;
399 clock-frequency = <66666666>; 399 clock-frequency = <66666666>;
400 #interrupt-cells = <1>; 400 #interrupt-cells = <1>;
diff --git a/arch/powerpc/boot/dts/mpc8379_rdb.dts b/arch/powerpc/boot/dts/mpc8379_rdb.dts
index d4838af8d379..9b1da864d890 100644
--- a/arch/powerpc/boot/dts/mpc8379_rdb.dts
+++ b/arch/powerpc/boot/dts/mpc8379_rdb.dts
@@ -424,7 +424,7 @@
424 bus-range = <0x0 0x0>; 424 bus-range = <0x0 0x0>;
425 ranges = <0x02000000 0x0 0x90000000 0x90000000 0x0 0x10000000 425 ranges = <0x02000000 0x0 0x90000000 0x90000000 0x0 0x10000000
426 0x42000000 0x0 0x80000000 0x80000000 0x0 0x10000000 426 0x42000000 0x0 0x80000000 0x80000000 0x0 0x10000000
427 0x01000000 0x0 0x00000000 0xe2000000 0x0 0x00100000>; 427 0x01000000 0x0 0x00000000 0xe0300000 0x0 0x00100000>;
428 sleep = <&pmc 0x00010000>; 428 sleep = <&pmc 0x00010000>;
429 clock-frequency = <66666666>; 429 clock-frequency = <66666666>;
430 #interrupt-cells = <1>; 430 #interrupt-cells = <1>;
diff --git a/arch/powerpc/boot/dts/mpc8569mds.dts b/arch/powerpc/boot/dts/mpc8569mds.dts
index a8dcb018c4a5..9e4ce99e1613 100644
--- a/arch/powerpc/boot/dts/mpc8569mds.dts
+++ b/arch/powerpc/boot/dts/mpc8569mds.dts
@@ -253,6 +253,7 @@
253 /* Filled in by U-Boot */ 253 /* Filled in by U-Boot */
254 clock-frequency = <0>; 254 clock-frequency = <0>;
255 status = "disabled"; 255 status = "disabled";
256 sdhci,1-bit-only;
256 }; 257 };
257 258
258 crypto@30000 { 259 crypto@30000 {
@@ -500,6 +501,10 @@
500 reg = <0x6>; 501 reg = <0x6>;
501 device_type = "ethernet-phy"; 502 device_type = "ethernet-phy";
502 }; 503 };
504 tbi-phy@11 {
505 reg = <0x11>;
506 device_type = "tbi-phy";
507 };
503 }; 508 };
504 mdio@3520 { 509 mdio@3520 {
505 #address-cells = <1>; 510 #address-cells = <1>;
diff --git a/arch/powerpc/boot/dts/warp.dts b/arch/powerpc/boot/dts/warp.dts
index 01bfb56bbe80..31605ee4afb6 100644
--- a/arch/powerpc/boot/dts/warp.dts
+++ b/arch/powerpc/boot/dts/warp.dts
@@ -261,10 +261,11 @@
261 compatible = "gpio-leds"; 261 compatible = "gpio-leds";
262 green { 262 green {
263 gpios = <&GPIO1 0 0>; 263 gpios = <&GPIO1 0 0>;
264 default-state = "on"; 264 default-state = "keep";
265 }; 265 };
266 red { 266 red {
267 gpios = <&GPIO1 1 0>; 267 gpios = <&GPIO1 1 0>;
268 default-state = "keep";
268 }; 269 };
269 }; 270 };
270 271
diff --git a/arch/powerpc/configs/44x/warp_defconfig b/arch/powerpc/configs/44x/warp_defconfig
index 3b77f092abe1..787635f23d8f 100644
--- a/arch/powerpc/configs/44x/warp_defconfig
+++ b/arch/powerpc/configs/44x/warp_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.29-rc2 3# Linux kernel version: 2.6.30
4# Fri Jan 23 07:57:16 2009 4# Tue Jun 9 23:35:36 2009
5# 5#
6# CONFIG_PPC64 is not set 6# CONFIG_PPC64 is not set
7 7
@@ -41,6 +41,7 @@ CONFIG_ARCH_HAS_ILOG2_U32=y
41CONFIG_GENERIC_HWEIGHT=y 41CONFIG_GENERIC_HWEIGHT=y
42CONFIG_GENERIC_CALIBRATE_DELAY=y 42CONFIG_GENERIC_CALIBRATE_DELAY=y
43CONFIG_GENERIC_FIND_NEXT_BIT=y 43CONFIG_GENERIC_FIND_NEXT_BIT=y
44CONFIG_GENERIC_GPIO=y
44# CONFIG_ARCH_NO_VIRT_TO_BUS is not set 45# CONFIG_ARCH_NO_VIRT_TO_BUS is not set
45CONFIG_PPC=y 46CONFIG_PPC=y
46CONFIG_EARLY_PRINTK=y 47CONFIG_EARLY_PRINTK=y
@@ -53,10 +54,12 @@ CONFIG_PPC_UDBG_16550=y
53# CONFIG_GENERIC_TBSYNC is not set 54# CONFIG_GENERIC_TBSYNC is not set
54CONFIG_AUDIT_ARCH=y 55CONFIG_AUDIT_ARCH=y
55CONFIG_GENERIC_BUG=y 56CONFIG_GENERIC_BUG=y
57CONFIG_DTC=y
56# CONFIG_DEFAULT_UIMAGE is not set 58# CONFIG_DEFAULT_UIMAGE is not set
57CONFIG_PPC_DCR_NATIVE=y 59CONFIG_PPC_DCR_NATIVE=y
58# CONFIG_PPC_DCR_MMIO is not set 60# CONFIG_PPC_DCR_MMIO is not set
59CONFIG_PPC_DCR=y 61CONFIG_PPC_DCR=y
62CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y
60CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" 63CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
61 64
62# 65#
@@ -74,7 +77,17 @@ CONFIG_SYSVIPC_SYSCTL=y
74# CONFIG_BSD_PROCESS_ACCT is not set 77# CONFIG_BSD_PROCESS_ACCT is not set
75# CONFIG_TASKSTATS is not set 78# CONFIG_TASKSTATS is not set
76# CONFIG_AUDIT is not set 79# CONFIG_AUDIT is not set
77# CONFIG_IKCONFIG is not set 80
81#
82# RCU Subsystem
83#
84CONFIG_CLASSIC_RCU=y
85# CONFIG_TREE_RCU is not set
86# CONFIG_PREEMPT_RCU is not set
87# CONFIG_TREE_RCU_TRACE is not set
88# CONFIG_PREEMPT_RCU_TRACE is not set
89CONFIG_IKCONFIG=y
90CONFIG_IKCONFIG_PROC=y
78CONFIG_LOG_BUF_SHIFT=14 91CONFIG_LOG_BUF_SHIFT=14
79CONFIG_GROUP_SCHED=y 92CONFIG_GROUP_SCHED=y
80CONFIG_FAIR_GROUP_SCHED=y 93CONFIG_FAIR_GROUP_SCHED=y
@@ -82,27 +95,29 @@ CONFIG_FAIR_GROUP_SCHED=y
82CONFIG_USER_SCHED=y 95CONFIG_USER_SCHED=y
83# CONFIG_CGROUP_SCHED is not set 96# CONFIG_CGROUP_SCHED is not set
84# CONFIG_CGROUPS is not set 97# CONFIG_CGROUPS is not set
85CONFIG_SYSFS_DEPRECATED=y 98# CONFIG_SYSFS_DEPRECATED_V2 is not set
86CONFIG_SYSFS_DEPRECATED_V2=y
87# CONFIG_RELAY is not set 99# CONFIG_RELAY is not set
88# CONFIG_NAMESPACES is not set 100# CONFIG_NAMESPACES is not set
89CONFIG_BLK_DEV_INITRD=y 101CONFIG_BLK_DEV_INITRD=y
90CONFIG_INITRAMFS_SOURCE="" 102CONFIG_INITRAMFS_SOURCE=""
103CONFIG_RD_GZIP=y
104# CONFIG_RD_BZIP2 is not set
105# CONFIG_RD_LZMA is not set
91# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 106# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
92CONFIG_SYSCTL=y 107CONFIG_SYSCTL=y
108CONFIG_ANON_INODES=y
93CONFIG_EMBEDDED=y 109CONFIG_EMBEDDED=y
94CONFIG_SYSCTL_SYSCALL=y 110CONFIG_SYSCTL_SYSCALL=y
95CONFIG_KALLSYMS=y 111CONFIG_KALLSYMS=y
96# CONFIG_KALLSYMS_ALL is not set 112# CONFIG_KALLSYMS_ALL is not set
97# CONFIG_KALLSYMS_EXTRA_PASS is not set 113# CONFIG_KALLSYMS_EXTRA_PASS is not set
98# CONFIG_HOTPLUG is not set 114# CONFIG_STRIP_ASM_SYMS is not set
115CONFIG_HOTPLUG=y
99CONFIG_PRINTK=y 116CONFIG_PRINTK=y
100CONFIG_BUG=y 117CONFIG_BUG=y
101CONFIG_ELF_CORE=y 118CONFIG_ELF_CORE=y
102CONFIG_COMPAT_BRK=y
103CONFIG_BASE_FULL=y 119CONFIG_BASE_FULL=y
104CONFIG_FUTEX=y 120CONFIG_FUTEX=y
105CONFIG_ANON_INODES=y
106CONFIG_EPOLL=y 121CONFIG_EPOLL=y
107CONFIG_SIGNALFD=y 122CONFIG_SIGNALFD=y
108CONFIG_TIMERFD=y 123CONFIG_TIMERFD=y
@@ -110,10 +125,13 @@ CONFIG_EVENTFD=y
110CONFIG_SHMEM=y 125CONFIG_SHMEM=y
111CONFIG_AIO=y 126CONFIG_AIO=y
112CONFIG_VM_EVENT_COUNTERS=y 127CONFIG_VM_EVENT_COUNTERS=y
113CONFIG_SLAB=y 128CONFIG_SLUB_DEBUG=y
114# CONFIG_SLUB is not set 129CONFIG_COMPAT_BRK=y
130# CONFIG_SLAB is not set
131CONFIG_SLUB=y
115# CONFIG_SLOB is not set 132# CONFIG_SLOB is not set
116# CONFIG_PROFILING is not set 133# CONFIG_PROFILING is not set
134# CONFIG_MARKERS is not set
117CONFIG_HAVE_OPROFILE=y 135CONFIG_HAVE_OPROFILE=y
118# CONFIG_KPROBES is not set 136# CONFIG_KPROBES is not set
119CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y 137CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y
@@ -121,6 +139,7 @@ CONFIG_HAVE_IOREMAP_PROT=y
121CONFIG_HAVE_KPROBES=y 139CONFIG_HAVE_KPROBES=y
122CONFIG_HAVE_KRETPROBES=y 140CONFIG_HAVE_KRETPROBES=y
123CONFIG_HAVE_ARCH_TRACEHOOK=y 141CONFIG_HAVE_ARCH_TRACEHOOK=y
142# CONFIG_SLOW_WORK is not set
124# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set 143# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
125CONFIG_SLABINFO=y 144CONFIG_SLABINFO=y
126CONFIG_RT_MUTEXES=y 145CONFIG_RT_MUTEXES=y
@@ -133,7 +152,6 @@ CONFIG_MODULE_UNLOAD=y
133# CONFIG_MODULE_SRCVERSION_ALL is not set 152# CONFIG_MODULE_SRCVERSION_ALL is not set
134CONFIG_BLOCK=y 153CONFIG_BLOCK=y
135# CONFIG_LBD is not set 154# CONFIG_LBD is not set
136# CONFIG_BLK_DEV_IO_TRACE is not set
137# CONFIG_BLK_DEV_BSG is not set 155# CONFIG_BLK_DEV_BSG is not set
138# CONFIG_BLK_DEV_INTEGRITY is not set 156# CONFIG_BLK_DEV_INTEGRITY is not set
139 157
@@ -149,11 +167,6 @@ CONFIG_DEFAULT_AS=y
149# CONFIG_DEFAULT_CFQ is not set 167# CONFIG_DEFAULT_CFQ is not set
150# CONFIG_DEFAULT_NOOP is not set 168# CONFIG_DEFAULT_NOOP is not set
151CONFIG_DEFAULT_IOSCHED="anticipatory" 169CONFIG_DEFAULT_IOSCHED="anticipatory"
152CONFIG_CLASSIC_RCU=y
153# CONFIG_TREE_RCU is not set
154# CONFIG_PREEMPT_RCU is not set
155# CONFIG_TREE_RCU_TRACE is not set
156# CONFIG_PREEMPT_RCU_TRACE is not set
157# CONFIG_FREEZER is not set 170# CONFIG_FREEZER is not set
158 171
159# 172#
@@ -173,10 +186,11 @@ CONFIG_WARP=y
173# CONFIG_ARCHES is not set 186# CONFIG_ARCHES is not set
174# CONFIG_CANYONLANDS is not set 187# CONFIG_CANYONLANDS is not set
175# CONFIG_GLACIER is not set 188# CONFIG_GLACIER is not set
189# CONFIG_REDWOOD is not set
176# CONFIG_YOSEMITE is not set 190# CONFIG_YOSEMITE is not set
177# CONFIG_XILINX_VIRTEX440_GENERIC_BOARD is not set 191# CONFIG_XILINX_VIRTEX440_GENERIC_BOARD is not set
178# CONFIG_PPC44x_SIMPLE is not set 192# CONFIG_PPC44x_SIMPLE is not set
179# CONFIG_PPC4xx_GPIO is not set 193CONFIG_PPC4xx_GPIO=y
180CONFIG_440EP=y 194CONFIG_440EP=y
181CONFIG_IBM440EP_ERR42=y 195CONFIG_IBM440EP_ERR42=y
182# CONFIG_IPIC is not set 196# CONFIG_IPIC is not set
@@ -235,9 +249,13 @@ CONFIG_ZONE_DMA_FLAG=1
235CONFIG_BOUNCE=y 249CONFIG_BOUNCE=y
236CONFIG_VIRT_TO_BUS=y 250CONFIG_VIRT_TO_BUS=y
237CONFIG_UNEVICTABLE_LRU=y 251CONFIG_UNEVICTABLE_LRU=y
252CONFIG_HAVE_MLOCK=y
253CONFIG_HAVE_MLOCKED_PAGE_BIT=y
254CONFIG_STDBINUTILS=y
238CONFIG_PPC_4K_PAGES=y 255CONFIG_PPC_4K_PAGES=y
239# CONFIG_PPC_16K_PAGES is not set 256# CONFIG_PPC_16K_PAGES is not set
240# CONFIG_PPC_64K_PAGES is not set 257# CONFIG_PPC_64K_PAGES is not set
258# CONFIG_PPC_256K_PAGES is not set
241CONFIG_FORCE_MAX_ZONEORDER=11 259CONFIG_FORCE_MAX_ZONEORDER=11
242CONFIG_PROC_DEVICETREE=y 260CONFIG_PROC_DEVICETREE=y
243CONFIG_CMDLINE_BOOL=y 261CONFIG_CMDLINE_BOOL=y
@@ -256,6 +274,7 @@ CONFIG_PPC_PCI_CHOICE=y
256# CONFIG_PCI_DOMAINS is not set 274# CONFIG_PCI_DOMAINS is not set
257# CONFIG_PCI_SYSCALL is not set 275# CONFIG_PCI_SYSCALL is not set
258# CONFIG_ARCH_SUPPORTS_MSI is not set 276# CONFIG_ARCH_SUPPORTS_MSI is not set
277# CONFIG_PCCARD is not set
259# CONFIG_HAS_RAPIDIO is not set 278# CONFIG_HAS_RAPIDIO is not set
260 279
261# 280#
@@ -271,14 +290,12 @@ CONFIG_PAGE_OFFSET=0xc0000000
271CONFIG_KERNEL_START=0xc0000000 290CONFIG_KERNEL_START=0xc0000000
272CONFIG_PHYSICAL_START=0x00000000 291CONFIG_PHYSICAL_START=0x00000000
273CONFIG_TASK_SIZE=0xc0000000 292CONFIG_TASK_SIZE=0xc0000000
274CONFIG_CONSISTENT_START=0xff100000
275CONFIG_CONSISTENT_SIZE=0x00200000 293CONFIG_CONSISTENT_SIZE=0x00200000
276CONFIG_NET=y 294CONFIG_NET=y
277 295
278# 296#
279# Networking options 297# Networking options
280# 298#
281CONFIG_COMPAT_NET_DEV_OPS=y
282CONFIG_PACKET=y 299CONFIG_PACKET=y
283# CONFIG_PACKET_MMAP is not set 300# CONFIG_PACKET_MMAP is not set
284CONFIG_UNIX=y 301CONFIG_UNIX=y
@@ -353,6 +370,7 @@ CONFIG_VLAN_8021Q=y
353# CONFIG_LAPB is not set 370# CONFIG_LAPB is not set
354# CONFIG_ECONET is not set 371# CONFIG_ECONET is not set
355# CONFIG_WAN_ROUTER is not set 372# CONFIG_WAN_ROUTER is not set
373# CONFIG_PHONET is not set
356# CONFIG_NET_SCHED is not set 374# CONFIG_NET_SCHED is not set
357# CONFIG_DCB is not set 375# CONFIG_DCB is not set
358 376
@@ -365,7 +383,6 @@ CONFIG_VLAN_8021Q=y
365# CONFIG_IRDA is not set 383# CONFIG_IRDA is not set
366# CONFIG_BT is not set 384# CONFIG_BT is not set
367# CONFIG_AF_RXRPC is not set 385# CONFIG_AF_RXRPC is not set
368# CONFIG_PHONET is not set
369# CONFIG_WIRELESS is not set 386# CONFIG_WIRELESS is not set
370# CONFIG_WIMAX is not set 387# CONFIG_WIMAX is not set
371# CONFIG_RFKILL is not set 388# CONFIG_RFKILL is not set
@@ -378,8 +395,12 @@ CONFIG_VLAN_8021Q=y
378# 395#
379# Generic Driver Options 396# Generic Driver Options
380# 397#
398CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
381# CONFIG_STANDALONE is not set 399# CONFIG_STANDALONE is not set
382CONFIG_PREVENT_FIRMWARE_BUILD=y 400CONFIG_PREVENT_FIRMWARE_BUILD=y
401CONFIG_FW_LOADER=y
402# CONFIG_FIRMWARE_IN_KERNEL is not set
403CONFIG_EXTRA_FIRMWARE=""
383# CONFIG_DEBUG_DRIVER is not set 404# CONFIG_DEBUG_DRIVER is not set
384# CONFIG_DEBUG_DEVRES is not set 405# CONFIG_DEBUG_DEVRES is not set
385# CONFIG_SYS_HYPERVISOR is not set 406# CONFIG_SYS_HYPERVISOR is not set
@@ -471,13 +492,21 @@ CONFIG_MTD_NAND_NDFC=y
471# LPDDR flash memory drivers 492# LPDDR flash memory drivers
472# 493#
473# CONFIG_MTD_LPDDR is not set 494# CONFIG_MTD_LPDDR is not set
474# CONFIG_MTD_QINFO_PROBE is not set
475 495
476# 496#
477# UBI - Unsorted block images 497# UBI - Unsorted block images
478# 498#
479# CONFIG_MTD_UBI is not set 499CONFIG_MTD_UBI=y
500CONFIG_MTD_UBI_WL_THRESHOLD=4096
501CONFIG_MTD_UBI_BEB_RESERVE=1
502# CONFIG_MTD_UBI_GLUEBI is not set
503
504#
505# UBI debugging options
506#
507# CONFIG_MTD_UBI_DEBUG is not set
480CONFIG_OF_DEVICE=y 508CONFIG_OF_DEVICE=y
509CONFIG_OF_GPIO=y
481CONFIG_OF_I2C=y 510CONFIG_OF_I2C=y
482# CONFIG_PARPORT is not set 511# CONFIG_PARPORT is not set
483CONFIG_BLK_DEV=y 512CONFIG_BLK_DEV=y
@@ -495,10 +524,17 @@ CONFIG_BLK_DEV_RAM_SIZE=4096
495# CONFIG_XILINX_SYSACE is not set 524# CONFIG_XILINX_SYSACE is not set
496# CONFIG_BLK_DEV_HD is not set 525# CONFIG_BLK_DEV_HD is not set
497CONFIG_MISC_DEVICES=y 526CONFIG_MISC_DEVICES=y
498# CONFIG_EEPROM_93CX6 is not set
499# CONFIG_ICS932S401 is not set 527# CONFIG_ICS932S401 is not set
500# CONFIG_ENCLOSURE_SERVICES is not set 528# CONFIG_ENCLOSURE_SERVICES is not set
529# CONFIG_ISL29003 is not set
501# CONFIG_C2PORT is not set 530# CONFIG_C2PORT is not set
531
532#
533# EEPROM support
534#
535CONFIG_EEPROM_AT24=y
536# CONFIG_EEPROM_LEGACY is not set
537# CONFIG_EEPROM_93CX6 is not set
502CONFIG_HAVE_IDE=y 538CONFIG_HAVE_IDE=y
503# CONFIG_IDE is not set 539# CONFIG_IDE is not set
504 540
@@ -529,7 +565,7 @@ CONFIG_BLK_DEV_SD=y
529# CONFIG_SCSI_CONSTANTS is not set 565# CONFIG_SCSI_CONSTANTS is not set
530# CONFIG_SCSI_LOGGING is not set 566# CONFIG_SCSI_LOGGING is not set
531# CONFIG_SCSI_SCAN_ASYNC is not set 567# CONFIG_SCSI_SCAN_ASYNC is not set
532CONFIG_SCSI_WAIT_SCAN=m 568# CONFIG_SCSI_WAIT_SCAN is not set
533 569
534# 570#
535# SCSI Transports 571# SCSI Transports
@@ -541,10 +577,12 @@ CONFIG_SCSI_SPI_ATTRS=y
541# CONFIG_SCSI_SRP_ATTRS is not set 577# CONFIG_SCSI_SRP_ATTRS is not set
542# CONFIG_SCSI_LOWLEVEL is not set 578# CONFIG_SCSI_LOWLEVEL is not set
543# CONFIG_SCSI_DH is not set 579# CONFIG_SCSI_DH is not set
580# CONFIG_SCSI_OSD_INITIATOR is not set
544# CONFIG_ATA is not set 581# CONFIG_ATA is not set
545# CONFIG_MD is not set 582# CONFIG_MD is not set
546# CONFIG_MACINTOSH_DRIVERS is not set 583# CONFIG_MACINTOSH_DRIVERS is not set
547CONFIG_NETDEVICES=y 584CONFIG_NETDEVICES=y
585CONFIG_COMPAT_NET_DEV_OPS=y
548# CONFIG_DUMMY is not set 586# CONFIG_DUMMY is not set
549# CONFIG_BONDING is not set 587# CONFIG_BONDING is not set
550# CONFIG_MACVLAN is not set 588# CONFIG_MACVLAN is not set
@@ -554,6 +592,8 @@ CONFIG_NETDEVICES=y
554# CONFIG_PHYLIB is not set 592# CONFIG_PHYLIB is not set
555CONFIG_NET_ETHERNET=y 593CONFIG_NET_ETHERNET=y
556CONFIG_MII=y 594CONFIG_MII=y
595# CONFIG_ETHOC is not set
596# CONFIG_DNET is not set
557CONFIG_IBM_NEW_EMAC=y 597CONFIG_IBM_NEW_EMAC=y
558CONFIG_IBM_NEW_EMAC_RXB=128 598CONFIG_IBM_NEW_EMAC_RXB=128
559CONFIG_IBM_NEW_EMAC_TXB=64 599CONFIG_IBM_NEW_EMAC_TXB=64
@@ -577,7 +617,6 @@ CONFIG_IBM_NEW_EMAC_ZMII=y
577# 617#
578# CONFIG_WLAN_PRE80211 is not set 618# CONFIG_WLAN_PRE80211 is not set
579# CONFIG_WLAN_80211 is not set 619# CONFIG_WLAN_80211 is not set
580# CONFIG_IWLWIFI_LEDS is not set
581 620
582# 621#
583# Enable WiMAX (Networking options) to see the WiMAX drivers 622# Enable WiMAX (Networking options) to see the WiMAX drivers
@@ -646,6 +685,7 @@ CONFIG_LEGACY_PTY_COUNT=256
646# CONFIG_HVC_UDBG is not set 685# CONFIG_HVC_UDBG is not set
647# CONFIG_IPMI_HANDLER is not set 686# CONFIG_IPMI_HANDLER is not set
648CONFIG_HW_RANDOM=y 687CONFIG_HW_RANDOM=y
688# CONFIG_HW_RANDOM_TIMERIOMEM is not set
649# CONFIG_NVRAM is not set 689# CONFIG_NVRAM is not set
650# CONFIG_GEN_RTC is not set 690# CONFIG_GEN_RTC is not set
651# CONFIG_R3964 is not set 691# CONFIG_R3964 is not set
@@ -663,6 +703,7 @@ CONFIG_I2C_HELPER_AUTO=y
663# 703#
664# I2C system bus drivers (mostly embedded / system-on-chip) 704# I2C system bus drivers (mostly embedded / system-on-chip)
665# 705#
706# CONFIG_I2C_GPIO is not set
666CONFIG_I2C_IBM_IIC=y 707CONFIG_I2C_IBM_IIC=y
667# CONFIG_I2C_MPC is not set 708# CONFIG_I2C_MPC is not set
668# CONFIG_I2C_OCORES is not set 709# CONFIG_I2C_OCORES is not set
@@ -685,12 +726,9 @@ CONFIG_I2C_IBM_IIC=y
685# Miscellaneous I2C Chip support 726# Miscellaneous I2C Chip support
686# 727#
687# CONFIG_DS1682 is not set 728# CONFIG_DS1682 is not set
688CONFIG_EEPROM_AT24=y
689CONFIG_EEPROM_LEGACY=y
690# CONFIG_SENSORS_PCF8574 is not set 729# CONFIG_SENSORS_PCF8574 is not set
691# CONFIG_PCF8575 is not set 730# CONFIG_PCF8575 is not set
692# CONFIG_SENSORS_PCA9539 is not set 731# CONFIG_SENSORS_PCA9539 is not set
693# CONFIG_SENSORS_PCF8591 is not set
694# CONFIG_SENSORS_MAX6875 is not set 732# CONFIG_SENSORS_MAX6875 is not set
695# CONFIG_SENSORS_TSL2550 is not set 733# CONFIG_SENSORS_TSL2550 is not set
696# CONFIG_I2C_DEBUG_CORE is not set 734# CONFIG_I2C_DEBUG_CORE is not set
@@ -699,7 +737,30 @@ CONFIG_EEPROM_LEGACY=y
699# CONFIG_I2C_DEBUG_CHIP is not set 737# CONFIG_I2C_DEBUG_CHIP is not set
700# CONFIG_SPI is not set 738# CONFIG_SPI is not set
701CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y 739CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
702# CONFIG_GPIOLIB is not set 740CONFIG_ARCH_REQUIRE_GPIOLIB=y
741CONFIG_GPIOLIB=y
742# CONFIG_DEBUG_GPIO is not set
743CONFIG_GPIO_SYSFS=y
744
745#
746# Memory mapped GPIO expanders:
747#
748# CONFIG_GPIO_XILINX is not set
749
750#
751# I2C GPIO expanders:
752#
753# CONFIG_GPIO_MAX732X is not set
754# CONFIG_GPIO_PCA953X is not set
755# CONFIG_GPIO_PCF857X is not set
756
757#
758# PCI GPIO expanders:
759#
760
761#
762# SPI GPIO expanders:
763#
703# CONFIG_W1 is not set 764# CONFIG_W1 is not set
704# CONFIG_POWER_SUPPLY is not set 765# CONFIG_POWER_SUPPLY is not set
705CONFIG_HWMON=y 766CONFIG_HWMON=y
@@ -721,6 +782,7 @@ CONFIG_SENSORS_AD7414=y
721# CONFIG_SENSORS_F71805F is not set 782# CONFIG_SENSORS_F71805F is not set
722# CONFIG_SENSORS_F71882FG is not set 783# CONFIG_SENSORS_F71882FG is not set
723# CONFIG_SENSORS_F75375S is not set 784# CONFIG_SENSORS_F75375S is not set
785# CONFIG_SENSORS_G760A is not set
724# CONFIG_SENSORS_GL518SM is not set 786# CONFIG_SENSORS_GL518SM is not set
725# CONFIG_SENSORS_GL520SM is not set 787# CONFIG_SENSORS_GL520SM is not set
726# CONFIG_SENSORS_IT87 is not set 788# CONFIG_SENSORS_IT87 is not set
@@ -735,11 +797,15 @@ CONFIG_SENSORS_AD7414=y
735# CONFIG_SENSORS_LM90 is not set 797# CONFIG_SENSORS_LM90 is not set
736# CONFIG_SENSORS_LM92 is not set 798# CONFIG_SENSORS_LM92 is not set
737# CONFIG_SENSORS_LM93 is not set 799# CONFIG_SENSORS_LM93 is not set
800# CONFIG_SENSORS_LTC4215 is not set
738# CONFIG_SENSORS_LTC4245 is not set 801# CONFIG_SENSORS_LTC4245 is not set
802# CONFIG_SENSORS_LM95241 is not set
739# CONFIG_SENSORS_MAX1619 is not set 803# CONFIG_SENSORS_MAX1619 is not set
740# CONFIG_SENSORS_MAX6650 is not set 804# CONFIG_SENSORS_MAX6650 is not set
741# CONFIG_SENSORS_PC87360 is not set 805# CONFIG_SENSORS_PC87360 is not set
742# CONFIG_SENSORS_PC87427 is not set 806# CONFIG_SENSORS_PC87427 is not set
807# CONFIG_SENSORS_PCF8591 is not set
808# CONFIG_SENSORS_SHT15 is not set
743# CONFIG_SENSORS_DME1737 is not set 809# CONFIG_SENSORS_DME1737 is not set
744# CONFIG_SENSORS_SMSC47M1 is not set 810# CONFIG_SENSORS_SMSC47M1 is not set
745# CONFIG_SENSORS_SMSC47M192 is not set 811# CONFIG_SENSORS_SMSC47M192 is not set
@@ -785,6 +851,7 @@ CONFIG_SSB_POSSIBLE=y
785# CONFIG_MFD_CORE is not set 851# CONFIG_MFD_CORE is not set
786# CONFIG_MFD_SM501 is not set 852# CONFIG_MFD_SM501 is not set
787# CONFIG_HTC_PASIC3 is not set 853# CONFIG_HTC_PASIC3 is not set
854# CONFIG_TPS65010 is not set
788# CONFIG_TWL4030_CORE is not set 855# CONFIG_TWL4030_CORE is not set
789# CONFIG_MFD_TMIO is not set 856# CONFIG_MFD_TMIO is not set
790# CONFIG_PMIC_DA903X is not set 857# CONFIG_PMIC_DA903X is not set
@@ -870,11 +937,11 @@ CONFIG_USB_OHCI_LITTLE_ENDIAN=y
870# CONFIG_USB_TMC is not set 937# CONFIG_USB_TMC is not set
871 938
872# 939#
873# NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may also be needed; 940# NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may
874# 941#
875 942
876# 943#
877# see USB_STORAGE Help for more information 944# also be needed; see USB_STORAGE Help for more info
878# 945#
879CONFIG_USB_STORAGE=y 946CONFIG_USB_STORAGE=y
880# CONFIG_USB_STORAGE_DEBUG is not set 947# CONFIG_USB_STORAGE_DEBUG is not set
@@ -915,7 +982,6 @@ CONFIG_USB_STORAGE=y
915# CONFIG_USB_LED is not set 982# CONFIG_USB_LED is not set
916# CONFIG_USB_CYPRESS_CY7C63 is not set 983# CONFIG_USB_CYPRESS_CY7C63 is not set
917# CONFIG_USB_CYTHERM is not set 984# CONFIG_USB_CYTHERM is not set
918# CONFIG_USB_PHIDGET is not set
919# CONFIG_USB_IDMOUSE is not set 985# CONFIG_USB_IDMOUSE is not set
920# CONFIG_USB_FTDI_ELAN is not set 986# CONFIG_USB_FTDI_ELAN is not set
921# CONFIG_USB_APPLEDISPLAY is not set 987# CONFIG_USB_APPLEDISPLAY is not set
@@ -929,6 +995,8 @@ CONFIG_USB_STORAGE=y
929# 995#
930# OTG and related infrastructure 996# OTG and related infrastructure
931# 997#
998# CONFIG_USB_GPIO_VBUS is not set
999# CONFIG_NOP_USB_XCEIV is not set
932CONFIG_MMC=y 1000CONFIG_MMC=y
933# CONFIG_MMC_DEBUG is not set 1001# CONFIG_MMC_DEBUG is not set
934# CONFIG_MMC_UNSAFE_RESUME is not set 1002# CONFIG_MMC_UNSAFE_RESUME is not set
@@ -946,6 +1014,7 @@ CONFIG_MMC_BLOCK_BOUNCE=y
946# 1014#
947# CONFIG_MMC_SDHCI is not set 1015# CONFIG_MMC_SDHCI is not set
948# CONFIG_MMC_WBSD is not set 1016# CONFIG_MMC_WBSD is not set
1017CONFIG_MMC_PIKASD=y
949# CONFIG_MEMSTICK is not set 1018# CONFIG_MEMSTICK is not set
950CONFIG_NEW_LEDS=y 1019CONFIG_NEW_LEDS=y
951CONFIG_LEDS_CLASS=y 1020CONFIG_LEDS_CLASS=y
@@ -953,16 +1022,31 @@ CONFIG_LEDS_CLASS=y
953# 1022#
954# LED drivers 1023# LED drivers
955# 1024#
1025CONFIG_LEDS_GPIO=y
1026# CONFIG_LEDS_GPIO_PLATFORM is not set
1027CONFIG_LEDS_GPIO_OF=y
1028# CONFIG_LEDS_LP5521 is not set
956# CONFIG_LEDS_PCA955X is not set 1029# CONFIG_LEDS_PCA955X is not set
1030# CONFIG_LEDS_BD2802 is not set
957 1031
958# 1032#
959# LED Triggers 1033# LED Triggers
960# 1034#
961# CONFIG_LEDS_TRIGGERS is not set 1035CONFIG_LEDS_TRIGGERS=y
1036# CONFIG_LEDS_TRIGGER_TIMER is not set
1037# CONFIG_LEDS_TRIGGER_HEARTBEAT is not set
1038# CONFIG_LEDS_TRIGGER_BACKLIGHT is not set
1039# CONFIG_LEDS_TRIGGER_GPIO is not set
1040CONFIG_LEDS_TRIGGER_DEFAULT_ON=y
1041
1042#
1043# iptables trigger is under Netfilter config (LED target)
1044#
962# CONFIG_ACCESSIBILITY is not set 1045# CONFIG_ACCESSIBILITY is not set
963# CONFIG_EDAC is not set 1046# CONFIG_EDAC is not set
964# CONFIG_RTC_CLASS is not set 1047# CONFIG_RTC_CLASS is not set
965# CONFIG_DMADEVICES is not set 1048# CONFIG_DMADEVICES is not set
1049# CONFIG_AUXDISPLAY is not set
966# CONFIG_UIO is not set 1050# CONFIG_UIO is not set
967# CONFIG_STAGING is not set 1051# CONFIG_STAGING is not set
968 1052
@@ -973,6 +1057,7 @@ CONFIG_EXT2_FS=y
973# CONFIG_EXT2_FS_XATTR is not set 1057# CONFIG_EXT2_FS_XATTR is not set
974# CONFIG_EXT2_FS_XIP is not set 1058# CONFIG_EXT2_FS_XIP is not set
975CONFIG_EXT3_FS=y 1059CONFIG_EXT3_FS=y
1060# CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set
976# CONFIG_EXT3_FS_XATTR is not set 1061# CONFIG_EXT3_FS_XATTR is not set
977# CONFIG_EXT4_FS is not set 1062# CONFIG_EXT4_FS is not set
978CONFIG_JBD=y 1063CONFIG_JBD=y
@@ -993,6 +1078,11 @@ CONFIG_INOTIFY_USER=y
993# CONFIG_FUSE_FS is not set 1078# CONFIG_FUSE_FS is not set
994 1079
995# 1080#
1081# Caches
1082#
1083# CONFIG_FSCACHE is not set
1084
1085#
996# CD-ROM/DVD Filesystems 1086# CD-ROM/DVD Filesystems
997# 1087#
998# CONFIG_ISO9660_FS is not set 1088# CONFIG_ISO9660_FS is not set
@@ -1039,6 +1129,12 @@ CONFIG_JFFS2_ZLIB=y
1039# CONFIG_JFFS2_LZO is not set 1129# CONFIG_JFFS2_LZO is not set
1040CONFIG_JFFS2_RTIME=y 1130CONFIG_JFFS2_RTIME=y
1041# CONFIG_JFFS2_RUBIN is not set 1131# CONFIG_JFFS2_RUBIN is not set
1132CONFIG_UBIFS_FS=y
1133# CONFIG_UBIFS_FS_XATTR is not set
1134# CONFIG_UBIFS_FS_ADVANCED_COMPR is not set
1135CONFIG_UBIFS_FS_LZO=y
1136CONFIG_UBIFS_FS_ZLIB=y
1137# CONFIG_UBIFS_FS_DEBUG is not set
1042CONFIG_CRAMFS=y 1138CONFIG_CRAMFS=y
1043# CONFIG_SQUASHFS is not set 1139# CONFIG_SQUASHFS is not set
1044# CONFIG_VXFS_FS is not set 1140# CONFIG_VXFS_FS is not set
@@ -1049,6 +1145,7 @@ CONFIG_CRAMFS=y
1049# CONFIG_ROMFS_FS is not set 1145# CONFIG_ROMFS_FS is not set
1050# CONFIG_SYSV_FS is not set 1146# CONFIG_SYSV_FS is not set
1051# CONFIG_UFS_FS is not set 1147# CONFIG_UFS_FS is not set
1148# CONFIG_NILFS2_FS is not set
1052CONFIG_NETWORK_FILESYSTEMS=y 1149CONFIG_NETWORK_FILESYSTEMS=y
1053CONFIG_NFS_FS=y 1150CONFIG_NFS_FS=y
1054CONFIG_NFS_V3=y 1151CONFIG_NFS_V3=y
@@ -1060,7 +1157,6 @@ CONFIG_LOCKD=y
1060CONFIG_LOCKD_V4=y 1157CONFIG_LOCKD_V4=y
1061CONFIG_NFS_COMMON=y 1158CONFIG_NFS_COMMON=y
1062CONFIG_SUNRPC=y 1159CONFIG_SUNRPC=y
1063# CONFIG_SUNRPC_REGISTER_V4 is not set
1064# CONFIG_RPCSEC_GSS_KRB5 is not set 1160# CONFIG_RPCSEC_GSS_KRB5 is not set
1065# CONFIG_RPCSEC_GSS_SPKM3 is not set 1161# CONFIG_RPCSEC_GSS_SPKM3 is not set
1066# CONFIG_SMB_FS is not set 1162# CONFIG_SMB_FS is not set
@@ -1115,6 +1211,7 @@ CONFIG_NLS_ISO8859_15=y
1115# CONFIG_NLS_KOI8_U is not set 1211# CONFIG_NLS_KOI8_U is not set
1116CONFIG_NLS_UTF8=y 1212CONFIG_NLS_UTF8=y
1117# CONFIG_DLM is not set 1213# CONFIG_DLM is not set
1214# CONFIG_BINARY_PRINTF is not set
1118 1215
1119# 1216#
1120# Library routines 1217# Library routines
@@ -1122,7 +1219,7 @@ CONFIG_NLS_UTF8=y
1122CONFIG_BITREVERSE=y 1219CONFIG_BITREVERSE=y
1123CONFIG_GENERIC_FIND_LAST_BIT=y 1220CONFIG_GENERIC_FIND_LAST_BIT=y
1124CONFIG_CRC_CCITT=y 1221CONFIG_CRC_CCITT=y
1125# CONFIG_CRC16 is not set 1222CONFIG_CRC16=y
1126CONFIG_CRC_T10DIF=y 1223CONFIG_CRC_T10DIF=y
1127# CONFIG_CRC_ITU_T is not set 1224# CONFIG_CRC_ITU_T is not set
1128CONFIG_CRC32=y 1225CONFIG_CRC32=y
@@ -1130,16 +1227,19 @@ CONFIG_CRC32=y
1130# CONFIG_LIBCRC32C is not set 1227# CONFIG_LIBCRC32C is not set
1131CONFIG_ZLIB_INFLATE=y 1228CONFIG_ZLIB_INFLATE=y
1132CONFIG_ZLIB_DEFLATE=y 1229CONFIG_ZLIB_DEFLATE=y
1133CONFIG_PLIST=y 1230CONFIG_LZO_COMPRESS=y
1231CONFIG_LZO_DECOMPRESS=y
1232CONFIG_DECOMPRESS_GZIP=y
1134CONFIG_HAS_IOMEM=y 1233CONFIG_HAS_IOMEM=y
1135CONFIG_HAS_IOPORT=y 1234CONFIG_HAS_IOPORT=y
1136CONFIG_HAS_DMA=y 1235CONFIG_HAS_DMA=y
1137CONFIG_HAVE_LMB=y 1236CONFIG_HAVE_LMB=y
1237CONFIG_NLATTR=y
1138 1238
1139# 1239#
1140# Kernel hacking 1240# Kernel hacking
1141# 1241#
1142# CONFIG_PRINTK_TIME is not set 1242CONFIG_PRINTK_TIME=y
1143CONFIG_ENABLE_WARN_DEPRECATED=y 1243CONFIG_ENABLE_WARN_DEPRECATED=y
1144CONFIG_ENABLE_MUST_CHECK=y 1244CONFIG_ENABLE_MUST_CHECK=y
1145CONFIG_FRAME_WARN=1024 1245CONFIG_FRAME_WARN=1024
@@ -1152,11 +1252,15 @@ CONFIG_DEBUG_KERNEL=y
1152CONFIG_DETECT_SOFTLOCKUP=y 1252CONFIG_DETECT_SOFTLOCKUP=y
1153# CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC is not set 1253# CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC is not set
1154CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE=0 1254CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE=0
1255CONFIG_DETECT_HUNG_TASK=y
1256# CONFIG_BOOTPARAM_HUNG_TASK_PANIC is not set
1257CONFIG_BOOTPARAM_HUNG_TASK_PANIC_VALUE=0
1155# CONFIG_SCHED_DEBUG is not set 1258# CONFIG_SCHED_DEBUG is not set
1156# CONFIG_SCHEDSTATS is not set 1259# CONFIG_SCHEDSTATS is not set
1157# CONFIG_TIMER_STATS is not set 1260# CONFIG_TIMER_STATS is not set
1158# CONFIG_DEBUG_OBJECTS is not set 1261# CONFIG_DEBUG_OBJECTS is not set
1159# CONFIG_DEBUG_SLAB is not set 1262# CONFIG_SLUB_DEBUG_ON is not set
1263# CONFIG_SLUB_STATS is not set
1160# CONFIG_DEBUG_RT_MUTEXES is not set 1264# CONFIG_DEBUG_RT_MUTEXES is not set
1161# CONFIG_RT_MUTEX_TESTER is not set 1265# CONFIG_RT_MUTEX_TESTER is not set
1162# CONFIG_DEBUG_SPINLOCK is not set 1266# CONFIG_DEBUG_SPINLOCK is not set
@@ -1180,9 +1284,12 @@ CONFIG_DEBUG_INFO=y
1180# CONFIG_FAULT_INJECTION is not set 1284# CONFIG_FAULT_INJECTION is not set
1181# CONFIG_LATENCYTOP is not set 1285# CONFIG_LATENCYTOP is not set
1182CONFIG_SYSCTL_SYSCALL_CHECK=y 1286CONFIG_SYSCTL_SYSCALL_CHECK=y
1287# CONFIG_DEBUG_PAGEALLOC is not set
1183CONFIG_HAVE_FUNCTION_TRACER=y 1288CONFIG_HAVE_FUNCTION_TRACER=y
1289CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
1184CONFIG_HAVE_DYNAMIC_FTRACE=y 1290CONFIG_HAVE_DYNAMIC_FTRACE=y
1185CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y 1291CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
1292CONFIG_TRACING_SUPPORT=y
1186 1293
1187# 1294#
1188# Tracers 1295# Tracers
@@ -1190,24 +1297,27 @@ CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
1190# CONFIG_FUNCTION_TRACER is not set 1297# CONFIG_FUNCTION_TRACER is not set
1191# CONFIG_SCHED_TRACER is not set 1298# CONFIG_SCHED_TRACER is not set
1192# CONFIG_CONTEXT_SWITCH_TRACER is not set 1299# CONFIG_CONTEXT_SWITCH_TRACER is not set
1300# CONFIG_EVENT_TRACER is not set
1193# CONFIG_BOOT_TRACER is not set 1301# CONFIG_BOOT_TRACER is not set
1194# CONFIG_TRACE_BRANCH_PROFILING is not set 1302# CONFIG_TRACE_BRANCH_PROFILING is not set
1195# CONFIG_STACK_TRACER is not set 1303# CONFIG_STACK_TRACER is not set
1196# CONFIG_DYNAMIC_PRINTK_DEBUG is not set 1304# CONFIG_KMEMTRACE is not set
1305# CONFIG_WORKQUEUE_TRACER is not set
1306# CONFIG_BLK_DEV_IO_TRACE is not set
1307# CONFIG_DYNAMIC_DEBUG is not set
1197# CONFIG_SAMPLES is not set 1308# CONFIG_SAMPLES is not set
1198CONFIG_HAVE_ARCH_KGDB=y 1309CONFIG_HAVE_ARCH_KGDB=y
1199# CONFIG_KGDB is not set 1310# CONFIG_KGDB is not set
1200CONFIG_PRINT_STACK_DEPTH=64 1311CONFIG_PRINT_STACK_DEPTH=64
1201# CONFIG_DEBUG_STACKOVERFLOW is not set 1312# CONFIG_DEBUG_STACKOVERFLOW is not set
1202# CONFIG_DEBUG_STACK_USAGE is not set 1313# CONFIG_DEBUG_STACK_USAGE is not set
1203# CONFIG_DEBUG_PAGEALLOC is not set
1204# CONFIG_CODE_PATCHING_SELFTEST is not set 1314# CONFIG_CODE_PATCHING_SELFTEST is not set
1205# CONFIG_FTR_FIXUP_SELFTEST is not set 1315# CONFIG_FTR_FIXUP_SELFTEST is not set
1206# CONFIG_MSI_BITMAP_SELFTEST is not set 1316# CONFIG_MSI_BITMAP_SELFTEST is not set
1207# CONFIG_XMON is not set 1317# CONFIG_XMON is not set
1208CONFIG_IRQSTACKS=y 1318CONFIG_IRQSTACKS=y
1209# CONFIG_VIRQ_DEBUG is not set 1319# CONFIG_VIRQ_DEBUG is not set
1210CONFIG_BDI_SWITCH=y 1320# CONFIG_BDI_SWITCH is not set
1211# CONFIG_PPC_EARLY_DEBUG is not set 1321# CONFIG_PPC_EARLY_DEBUG is not set
1212 1322
1213# 1323#
@@ -1223,6 +1333,8 @@ CONFIG_CRYPTO=y
1223# Crypto core or helper 1333# Crypto core or helper
1224# 1334#
1225# CONFIG_CRYPTO_FIPS is not set 1335# CONFIG_CRYPTO_FIPS is not set
1336CONFIG_CRYPTO_ALGAPI=y
1337CONFIG_CRYPTO_ALGAPI2=y
1226# CONFIG_CRYPTO_MANAGER is not set 1338# CONFIG_CRYPTO_MANAGER is not set
1227# CONFIG_CRYPTO_MANAGER2 is not set 1339# CONFIG_CRYPTO_MANAGER2 is not set
1228# CONFIG_CRYPTO_GF128MUL is not set 1340# CONFIG_CRYPTO_GF128MUL is not set
@@ -1294,13 +1406,15 @@ CONFIG_CRYPTO=y
1294# 1406#
1295# Compression 1407# Compression
1296# 1408#
1297# CONFIG_CRYPTO_DEFLATE is not set 1409CONFIG_CRYPTO_DEFLATE=y
1298# CONFIG_CRYPTO_LZO is not set 1410# CONFIG_CRYPTO_ZLIB is not set
1411CONFIG_CRYPTO_LZO=y
1299 1412
1300# 1413#
1301# Random Number Generation 1414# Random Number Generation
1302# 1415#
1303# CONFIG_CRYPTO_ANSI_CPRNG is not set 1416# CONFIG_CRYPTO_ANSI_CPRNG is not set
1304CONFIG_CRYPTO_HW=y 1417CONFIG_CRYPTO_HW=y
1418# CONFIG_CRYPTO_DEV_PPC4XX is not set
1305# CONFIG_PPC_CLOCK is not set 1419# CONFIG_PPC_CLOCK is not set
1306# CONFIG_VIRTUALIZATION is not set 1420# CONFIG_VIRTUALIZATION is not set
diff --git a/arch/powerpc/configs/83xx/asp8347_defconfig b/arch/powerpc/configs/83xx/asp8347_defconfig
index 278939713775..a2df0635b6de 100644
--- a/arch/powerpc/configs/83xx/asp8347_defconfig
+++ b/arch/powerpc/configs/83xx/asp8347_defconfig
@@ -1,26 +1,28 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.30-rc3 3# Linux kernel version: 2.6.31-rc4
4# Wed May 13 17:22:05 2009 4# Wed Jul 29 23:32:02 2009
5# 5#
6# CONFIG_PPC64 is not set 6# CONFIG_PPC64 is not set
7 7
8# 8#
9# Processor support 9# Processor support
10# 10#
11CONFIG_6xx=y 11CONFIG_PPC_BOOK3S_32=y
12# CONFIG_PPC_85xx is not set 12# CONFIG_PPC_85xx is not set
13# CONFIG_PPC_8xx is not set 13# CONFIG_PPC_8xx is not set
14# CONFIG_40x is not set 14# CONFIG_40x is not set
15# CONFIG_44x is not set 15# CONFIG_44x is not set
16# CONFIG_E200 is not set 16# CONFIG_E200 is not set
17CONFIG_PPC_BOOK3S=y 17CONFIG_PPC_BOOK3S=y
18CONFIG_6xx=y
18CONFIG_PPC_FPU=y 19CONFIG_PPC_FPU=y
19CONFIG_FSL_EMB_PERFMON=y 20CONFIG_FSL_EMB_PERFMON=y
20# CONFIG_ALTIVEC is not set 21# CONFIG_ALTIVEC is not set
21CONFIG_PPC_STD_MMU=y 22CONFIG_PPC_STD_MMU=y
22CONFIG_PPC_STD_MMU_32=y 23CONFIG_PPC_STD_MMU_32=y
23# CONFIG_PPC_MM_SLICES is not set 24# CONFIG_PPC_MM_SLICES is not set
25CONFIG_PPC_HAVE_PMU_SUPPORT=y
24# CONFIG_SMP is not set 26# CONFIG_SMP is not set
25CONFIG_PPC32=y 27CONFIG_PPC32=y
26CONFIG_WORD_SIZE=32 28CONFIG_WORD_SIZE=32
@@ -31,15 +33,16 @@ CONFIG_GENERIC_TIME=y
31CONFIG_GENERIC_TIME_VSYSCALL=y 33CONFIG_GENERIC_TIME_VSYSCALL=y
32CONFIG_GENERIC_CLOCKEVENTS=y 34CONFIG_GENERIC_CLOCKEVENTS=y
33CONFIG_GENERIC_HARDIRQS=y 35CONFIG_GENERIC_HARDIRQS=y
36CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
34# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set 37# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set
35CONFIG_IRQ_PER_CPU=y 38CONFIG_IRQ_PER_CPU=y
36CONFIG_STACKTRACE_SUPPORT=y 39CONFIG_STACKTRACE_SUPPORT=y
37CONFIG_HAVE_LATENCYTOP_SUPPORT=y 40CONFIG_HAVE_LATENCYTOP_SUPPORT=y
41CONFIG_TRACE_IRQFLAGS_SUPPORT=y
38CONFIG_LOCKDEP_SUPPORT=y 42CONFIG_LOCKDEP_SUPPORT=y
39CONFIG_RWSEM_XCHGADD_ALGORITHM=y 43CONFIG_RWSEM_XCHGADD_ALGORITHM=y
40CONFIG_ARCH_HAS_ILOG2_U32=y 44CONFIG_ARCH_HAS_ILOG2_U32=y
41CONFIG_GENERIC_HWEIGHT=y 45CONFIG_GENERIC_HWEIGHT=y
42CONFIG_GENERIC_CALIBRATE_DELAY=y
43CONFIG_GENERIC_FIND_NEXT_BIT=y 46CONFIG_GENERIC_FIND_NEXT_BIT=y
44# CONFIG_ARCH_NO_VIRT_TO_BUS is not set 47# CONFIG_ARCH_NO_VIRT_TO_BUS is not set
45CONFIG_PPC=y 48CONFIG_PPC=y
@@ -53,6 +56,7 @@ CONFIG_PPC_UDBG_16550=y
53# CONFIG_GENERIC_TBSYNC is not set 56# CONFIG_GENERIC_TBSYNC is not set
54CONFIG_AUDIT_ARCH=y 57CONFIG_AUDIT_ARCH=y
55CONFIG_GENERIC_BUG=y 58CONFIG_GENERIC_BUG=y
59CONFIG_DTC=y
56# CONFIG_DEFAULT_UIMAGE is not set 60# CONFIG_DEFAULT_UIMAGE is not set
57CONFIG_REDBOOT=y 61CONFIG_REDBOOT=y
58CONFIG_ARCH_SUSPEND_POSSIBLE=y 62CONFIG_ARCH_SUSPEND_POSSIBLE=y
@@ -60,6 +64,7 @@ CONFIG_ARCH_SUSPEND_POSSIBLE=y
60# CONFIG_PPC_DCR_MMIO is not set 64# CONFIG_PPC_DCR_MMIO is not set
61CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y 65CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y
62CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" 66CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
67CONFIG_CONSTRUCTORS=y
63 68
64# 69#
65# General setup 70# General setup
@@ -108,7 +113,6 @@ CONFIG_ANON_INODES=y
108CONFIG_EMBEDDED=y 113CONFIG_EMBEDDED=y
109CONFIG_SYSCTL_SYSCALL=y 114CONFIG_SYSCTL_SYSCALL=y
110# CONFIG_KALLSYMS is not set 115# CONFIG_KALLSYMS is not set
111# CONFIG_STRIP_ASM_SYMS is not set
112CONFIG_HOTPLUG=y 116CONFIG_HOTPLUG=y
113CONFIG_PRINTK=y 117CONFIG_PRINTK=y
114CONFIG_BUG=y 118CONFIG_BUG=y
@@ -121,9 +125,16 @@ CONFIG_TIMERFD=y
121CONFIG_EVENTFD=y 125CONFIG_EVENTFD=y
122CONFIG_SHMEM=y 126CONFIG_SHMEM=y
123CONFIG_AIO=y 127CONFIG_AIO=y
128CONFIG_HAVE_PERF_COUNTERS=y
129
130#
131# Performance Counters
132#
133# CONFIG_PERF_COUNTERS is not set
124CONFIG_VM_EVENT_COUNTERS=y 134CONFIG_VM_EVENT_COUNTERS=y
125CONFIG_PCI_QUIRKS=y 135CONFIG_PCI_QUIRKS=y
126CONFIG_SLUB_DEBUG=y 136CONFIG_SLUB_DEBUG=y
137# CONFIG_STRIP_ASM_SYMS is not set
127CONFIG_COMPAT_BRK=y 138CONFIG_COMPAT_BRK=y
128# CONFIG_SLAB is not set 139# CONFIG_SLAB is not set
129CONFIG_SLUB=y 140CONFIG_SLUB=y
@@ -136,6 +147,10 @@ CONFIG_HAVE_IOREMAP_PROT=y
136CONFIG_HAVE_KPROBES=y 147CONFIG_HAVE_KPROBES=y
137CONFIG_HAVE_KRETPROBES=y 148CONFIG_HAVE_KRETPROBES=y
138CONFIG_HAVE_ARCH_TRACEHOOK=y 149CONFIG_HAVE_ARCH_TRACEHOOK=y
150
151#
152# GCOV-based kernel profiling
153#
139# CONFIG_SLOW_WORK is not set 154# CONFIG_SLOW_WORK is not set
140# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set 155# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
141CONFIG_SLABINFO=y 156CONFIG_SLABINFO=y
@@ -148,7 +163,7 @@ CONFIG_MODULE_UNLOAD=y
148# CONFIG_MODVERSIONS is not set 163# CONFIG_MODVERSIONS is not set
149# CONFIG_MODULE_SRCVERSION_ALL is not set 164# CONFIG_MODULE_SRCVERSION_ALL is not set
150CONFIG_BLOCK=y 165CONFIG_BLOCK=y
151# CONFIG_LBD is not set 166CONFIG_LBDAF=y
152# CONFIG_BLK_DEV_BSG is not set 167# CONFIG_BLK_DEV_BSG is not set
153# CONFIG_BLK_DEV_INTEGRITY is not set 168# CONFIG_BLK_DEV_INTEGRITY is not set
154 169
@@ -190,6 +205,7 @@ CONFIG_PPC_83xx=y
190# CONFIG_MPC837x_RDB is not set 205# CONFIG_MPC837x_RDB is not set
191# CONFIG_SBC834x is not set 206# CONFIG_SBC834x is not set
192CONFIG_ASP834x=y 207CONFIG_ASP834x=y
208# CONFIG_KMETER1 is not set
193CONFIG_PPC_MPC834x=y 209CONFIG_PPC_MPC834x=y
194# CONFIG_PPC_86xx is not set 210# CONFIG_PPC_86xx is not set
195# CONFIG_EMBEDDED6xx is not set 211# CONFIG_EMBEDDED6xx is not set
@@ -235,6 +251,7 @@ CONFIG_BINFMT_ELF=y
235# CONFIG_HAVE_AOUT is not set 251# CONFIG_HAVE_AOUT is not set
236# CONFIG_BINFMT_MISC is not set 252# CONFIG_BINFMT_MISC is not set
237# CONFIG_IOMMU_HELPER is not set 253# CONFIG_IOMMU_HELPER is not set
254# CONFIG_SWIOTLB is not set
238CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y 255CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
239CONFIG_ARCH_HAS_WALK_MEMORY=y 256CONFIG_ARCH_HAS_WALK_MEMORY=y
240CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y 257CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y
@@ -255,9 +272,9 @@ CONFIG_MIGRATION=y
255CONFIG_ZONE_DMA_FLAG=1 272CONFIG_ZONE_DMA_FLAG=1
256CONFIG_BOUNCE=y 273CONFIG_BOUNCE=y
257CONFIG_VIRT_TO_BUS=y 274CONFIG_VIRT_TO_BUS=y
258CONFIG_UNEVICTABLE_LRU=y
259CONFIG_HAVE_MLOCK=y 275CONFIG_HAVE_MLOCK=y
260CONFIG_HAVE_MLOCKED_PAGE_BIT=y 276CONFIG_HAVE_MLOCKED_PAGE_BIT=y
277CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
261CONFIG_PPC_4K_PAGES=y 278CONFIG_PPC_4K_PAGES=y
262# CONFIG_PPC_16K_PAGES is not set 279# CONFIG_PPC_16K_PAGES is not set
263# CONFIG_PPC_64K_PAGES is not set 280# CONFIG_PPC_64K_PAGES is not set
@@ -366,6 +383,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
366# CONFIG_ECONET is not set 383# CONFIG_ECONET is not set
367# CONFIG_WAN_ROUTER is not set 384# CONFIG_WAN_ROUTER is not set
368# CONFIG_PHONET is not set 385# CONFIG_PHONET is not set
386# CONFIG_IEEE802154 is not set
369# CONFIG_NET_SCHED is not set 387# CONFIG_NET_SCHED is not set
370# CONFIG_DCB is not set 388# CONFIG_DCB is not set
371 389
@@ -383,7 +401,11 @@ CONFIG_WIRELESS=y
383CONFIG_WIRELESS_OLD_REGULATORY=y 401CONFIG_WIRELESS_OLD_REGULATORY=y
384# CONFIG_WIRELESS_EXT is not set 402# CONFIG_WIRELESS_EXT is not set
385# CONFIG_LIB80211 is not set 403# CONFIG_LIB80211 is not set
386# CONFIG_MAC80211 is not set 404
405#
406# CFG80211 needs to be enabled for MAC80211
407#
408CONFIG_MAC80211_DEFAULT_PS_VALUE=0
387# CONFIG_WIMAX is not set 409# CONFIG_WIMAX is not set
388# CONFIG_RFKILL is not set 410# CONFIG_RFKILL is not set
389# CONFIG_NET_9P is not set 411# CONFIG_NET_9P is not set
@@ -490,6 +512,7 @@ CONFIG_MTD_PHYSMAP_OF=y
490# CONFIG_MTD_UBI is not set 512# CONFIG_MTD_UBI is not set
491CONFIG_OF_DEVICE=y 513CONFIG_OF_DEVICE=y
492CONFIG_OF_I2C=y 514CONFIG_OF_I2C=y
515CONFIG_OF_MDIO=y
493# CONFIG_PARPORT is not set 516# CONFIG_PARPORT is not set
494CONFIG_BLK_DEV=y 517CONFIG_BLK_DEV=y
495# CONFIG_BLK_DEV_FD is not set 518# CONFIG_BLK_DEV_FD is not set
@@ -525,7 +548,9 @@ CONFIG_MISC_DEVICES=y
525# 548#
526# CONFIG_EEPROM_AT24 is not set 549# CONFIG_EEPROM_AT24 is not set
527# CONFIG_EEPROM_LEGACY is not set 550# CONFIG_EEPROM_LEGACY is not set
551# CONFIG_EEPROM_MAX6875 is not set
528# CONFIG_EEPROM_93CX6 is not set 552# CONFIG_EEPROM_93CX6 is not set
553# CONFIG_CB710_CORE is not set
529CONFIG_HAVE_IDE=y 554CONFIG_HAVE_IDE=y
530# CONFIG_IDE is not set 555# CONFIG_IDE is not set
531 556
@@ -545,14 +570,17 @@ CONFIG_HAVE_IDE=y
545# 570#
546 571
547# 572#
548# Enable only one of the two stacks, unless you know what you are doing 573# You can enable one or both FireWire driver stacks.
574#
575
576#
577# See the help texts for more information.
549# 578#
550# CONFIG_FIREWIRE is not set 579# CONFIG_FIREWIRE is not set
551# CONFIG_IEEE1394 is not set 580# CONFIG_IEEE1394 is not set
552# CONFIG_I2O is not set 581# CONFIG_I2O is not set
553# CONFIG_MACINTOSH_DRIVERS is not set 582# CONFIG_MACINTOSH_DRIVERS is not set
554CONFIG_NETDEVICES=y 583CONFIG_NETDEVICES=y
555CONFIG_COMPAT_NET_DEV_OPS=y
556# CONFIG_DUMMY is not set 584# CONFIG_DUMMY is not set
557# CONFIG_BONDING is not set 585# CONFIG_BONDING is not set
558# CONFIG_MACVLAN is not set 586# CONFIG_MACVLAN is not set
@@ -599,6 +627,7 @@ CONFIG_MII=y
599# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set 627# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
600# CONFIG_NET_PCI is not set 628# CONFIG_NET_PCI is not set
601# CONFIG_B44 is not set 629# CONFIG_B44 is not set
630# CONFIG_KS8842 is not set
602# CONFIG_ATL2 is not set 631# CONFIG_ATL2 is not set
603CONFIG_NETDEV_1000=y 632CONFIG_NETDEV_1000=y
604# CONFIG_ACENIC is not set 633# CONFIG_ACENIC is not set
@@ -618,8 +647,10 @@ CONFIG_NETDEV_1000=y
618# CONFIG_VIA_VELOCITY is not set 647# CONFIG_VIA_VELOCITY is not set
619# CONFIG_TIGON3 is not set 648# CONFIG_TIGON3 is not set
620# CONFIG_BNX2 is not set 649# CONFIG_BNX2 is not set
650# CONFIG_CNIC is not set
621CONFIG_FSL_PQ_MDIO=y 651CONFIG_FSL_PQ_MDIO=y
622CONFIG_GIANFAR=y 652CONFIG_GIANFAR=y
653# CONFIG_MV643XX_ETH is not set
623# CONFIG_QLA3XXX is not set 654# CONFIG_QLA3XXX is not set
624# CONFIG_ATL1 is not set 655# CONFIG_ATL1 is not set
625# CONFIG_ATL1E is not set 656# CONFIG_ATL1E is not set
@@ -786,13 +817,17 @@ CONFIG_I2C_MPC=y
786# CONFIG_SENSORS_PCF8574 is not set 817# CONFIG_SENSORS_PCF8574 is not set
787# CONFIG_PCF8575 is not set 818# CONFIG_PCF8575 is not set
788# CONFIG_SENSORS_PCA9539 is not set 819# CONFIG_SENSORS_PCA9539 is not set
789# CONFIG_SENSORS_MAX6875 is not set
790# CONFIG_SENSORS_TSL2550 is not set 820# CONFIG_SENSORS_TSL2550 is not set
791# CONFIG_I2C_DEBUG_CORE is not set 821# CONFIG_I2C_DEBUG_CORE is not set
792# CONFIG_I2C_DEBUG_ALGO is not set 822# CONFIG_I2C_DEBUG_ALGO is not set
793# CONFIG_I2C_DEBUG_BUS is not set 823# CONFIG_I2C_DEBUG_BUS is not set
794# CONFIG_I2C_DEBUG_CHIP is not set 824# CONFIG_I2C_DEBUG_CHIP is not set
795# CONFIG_SPI is not set 825# CONFIG_SPI is not set
826
827#
828# PPS support
829#
830# CONFIG_PPS is not set
796CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y 831CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
797# CONFIG_GPIOLIB is not set 832# CONFIG_GPIOLIB is not set
798# CONFIG_W1 is not set 833# CONFIG_W1 is not set
@@ -847,6 +882,7 @@ CONFIG_HWMON=y
847# CONFIG_SENSORS_SMSC47B397 is not set 882# CONFIG_SENSORS_SMSC47B397 is not set
848# CONFIG_SENSORS_ADS7828 is not set 883# CONFIG_SENSORS_ADS7828 is not set
849# CONFIG_SENSORS_THMC50 is not set 884# CONFIG_SENSORS_THMC50 is not set
885# CONFIG_SENSORS_TMP401 is not set
850# CONFIG_SENSORS_VIA686A is not set 886# CONFIG_SENSORS_VIA686A is not set
851# CONFIG_SENSORS_VT1211 is not set 887# CONFIG_SENSORS_VT1211 is not set
852# CONFIG_SENSORS_VT8231 is not set 888# CONFIG_SENSORS_VT8231 is not set
@@ -900,24 +936,9 @@ CONFIG_SSB_POSSIBLE=y
900# CONFIG_MFD_WM8400 is not set 936# CONFIG_MFD_WM8400 is not set
901# CONFIG_MFD_WM8350_I2C is not set 937# CONFIG_MFD_WM8350_I2C is not set
902# CONFIG_MFD_PCF50633 is not set 938# CONFIG_MFD_PCF50633 is not set
939# CONFIG_AB3100_CORE is not set
903# CONFIG_REGULATOR is not set 940# CONFIG_REGULATOR is not set
904 941# CONFIG_MEDIA_SUPPORT is not set
905#
906# Multimedia devices
907#
908
909#
910# Multimedia core support
911#
912# CONFIG_VIDEO_DEV is not set
913# CONFIG_DVB_CORE is not set
914# CONFIG_VIDEO_MEDIA is not set
915
916#
917# Multimedia drivers
918#
919CONFIG_DAB=y
920# CONFIG_USB_DABUSB is not set
921 942
922# 943#
923# Graphics support 944# Graphics support
@@ -960,6 +981,7 @@ CONFIG_USB_MON=y
960# USB Host Controller Drivers 981# USB Host Controller Drivers
961# 982#
962# CONFIG_USB_C67X00_HCD is not set 983# CONFIG_USB_C67X00_HCD is not set
984# CONFIG_USB_XHCI_HCD is not set
963CONFIG_USB_EHCI_HCD=y 985CONFIG_USB_EHCI_HCD=y
964CONFIG_USB_EHCI_ROOT_HUB_TT=y 986CONFIG_USB_EHCI_ROOT_HUB_TT=y
965# CONFIG_USB_EHCI_TT_NEWSCHED is not set 987# CONFIG_USB_EHCI_TT_NEWSCHED is not set
@@ -1069,6 +1091,7 @@ CONFIG_RTC_DRV_DS1374=y
1069# CONFIG_RTC_DRV_S35390A is not set 1091# CONFIG_RTC_DRV_S35390A is not set
1070# CONFIG_RTC_DRV_FM3130 is not set 1092# CONFIG_RTC_DRV_FM3130 is not set
1071# CONFIG_RTC_DRV_RX8581 is not set 1093# CONFIG_RTC_DRV_RX8581 is not set
1094# CONFIG_RTC_DRV_RX8025 is not set
1072 1095
1073# 1096#
1074# SPI RTC drivers 1097# SPI RTC drivers
@@ -1096,6 +1119,10 @@ CONFIG_RTC_DRV_DS1374=y
1096# CONFIG_DMADEVICES is not set 1119# CONFIG_DMADEVICES is not set
1097# CONFIG_AUXDISPLAY is not set 1120# CONFIG_AUXDISPLAY is not set
1098# CONFIG_UIO is not set 1121# CONFIG_UIO is not set
1122
1123#
1124# TI VLYNQ
1125#
1099# CONFIG_STAGING is not set 1126# CONFIG_STAGING is not set
1100 1127
1101# 1128#
@@ -1115,10 +1142,12 @@ CONFIG_FS_MBCACHE=y
1115# CONFIG_REISERFS_FS is not set 1142# CONFIG_REISERFS_FS is not set
1116# CONFIG_JFS_FS is not set 1143# CONFIG_JFS_FS is not set
1117# CONFIG_FS_POSIX_ACL is not set 1144# CONFIG_FS_POSIX_ACL is not set
1118CONFIG_FILE_LOCKING=y
1119# CONFIG_XFS_FS is not set 1145# CONFIG_XFS_FS is not set
1146# CONFIG_GFS2_FS is not set
1120# CONFIG_OCFS2_FS is not set 1147# CONFIG_OCFS2_FS is not set
1121# CONFIG_BTRFS_FS is not set 1148# CONFIG_BTRFS_FS is not set
1149CONFIG_FILE_LOCKING=y
1150CONFIG_FSNOTIFY=y
1122CONFIG_DNOTIFY=y 1151CONFIG_DNOTIFY=y
1123CONFIG_INOTIFY=y 1152CONFIG_INOTIFY=y
1124CONFIG_INOTIFY_USER=y 1153CONFIG_INOTIFY_USER=y
@@ -1192,6 +1221,7 @@ CONFIG_NFS_FS=y
1192CONFIG_NFS_V3=y 1221CONFIG_NFS_V3=y
1193# CONFIG_NFS_V3_ACL is not set 1222# CONFIG_NFS_V3_ACL is not set
1194CONFIG_NFS_V4=y 1223CONFIG_NFS_V4=y
1224# CONFIG_NFS_V4_1 is not set
1195CONFIG_ROOT_NFS=y 1225CONFIG_ROOT_NFS=y
1196# CONFIG_NFSD is not set 1226# CONFIG_NFSD is not set
1197CONFIG_LOCKD=y 1227CONFIG_LOCKD=y
@@ -1287,6 +1317,7 @@ CONFIG_HAS_IOPORT=y
1287CONFIG_HAS_DMA=y 1317CONFIG_HAS_DMA=y
1288CONFIG_HAVE_LMB=y 1318CONFIG_HAVE_LMB=y
1289CONFIG_NLATTR=y 1319CONFIG_NLATTR=y
1320CONFIG_GENERIC_ATOMIC64=y
1290 1321
1291# 1322#
1292# Kernel hacking 1323# Kernel hacking
@@ -1312,22 +1343,11 @@ CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
1312CONFIG_HAVE_DYNAMIC_FTRACE=y 1343CONFIG_HAVE_DYNAMIC_FTRACE=y
1313CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y 1344CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
1314CONFIG_TRACING_SUPPORT=y 1345CONFIG_TRACING_SUPPORT=y
1315 1346# CONFIG_FTRACE is not set
1316#
1317# Tracers
1318#
1319# CONFIG_FUNCTION_TRACER is not set
1320# CONFIG_SCHED_TRACER is not set
1321# CONFIG_CONTEXT_SWITCH_TRACER is not set
1322# CONFIG_EVENT_TRACER is not set
1323# CONFIG_BOOT_TRACER is not set
1324# CONFIG_TRACE_BRANCH_PROFILING is not set
1325# CONFIG_STACK_TRACER is not set
1326# CONFIG_KMEMTRACE is not set
1327# CONFIG_WORKQUEUE_TRACER is not set
1328# CONFIG_BLK_DEV_IO_TRACE is not set
1329# CONFIG_SAMPLES is not set 1347# CONFIG_SAMPLES is not set
1330CONFIG_HAVE_ARCH_KGDB=y 1348CONFIG_HAVE_ARCH_KGDB=y
1349# CONFIG_PPC_DISABLE_WERROR is not set
1350CONFIG_PPC_WERROR=y
1331CONFIG_PRINT_STACK_DEPTH=64 1351CONFIG_PRINT_STACK_DEPTH=64
1332# CONFIG_IRQSTACKS is not set 1352# CONFIG_IRQSTACKS is not set
1333# CONFIG_BOOTX_TEXT is not set 1353# CONFIG_BOOTX_TEXT is not set
diff --git a/arch/powerpc/configs/83xx/kmeter1_defconfig b/arch/powerpc/configs/83xx/kmeter1_defconfig
index bf0853f29f31..93ebd443a18f 100644
--- a/arch/powerpc/configs/83xx/kmeter1_defconfig
+++ b/arch/powerpc/configs/83xx/kmeter1_defconfig
@@ -1,25 +1,28 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.28 3# Linux kernel version: 2.6.31-rc4
4# Fri Apr 3 10:34:33 2009 4# Wed Jul 29 23:32:03 2009
5# 5#
6# CONFIG_PPC64 is not set 6# CONFIG_PPC64 is not set
7 7
8# 8#
9# Processor support 9# Processor support
10# 10#
11CONFIG_6xx=y 11CONFIG_PPC_BOOK3S_32=y
12# CONFIG_PPC_85xx is not set 12# CONFIG_PPC_85xx is not set
13# CONFIG_PPC_8xx is not set 13# CONFIG_PPC_8xx is not set
14# CONFIG_40x is not set 14# CONFIG_40x is not set
15# CONFIG_44x is not set 15# CONFIG_44x is not set
16# CONFIG_E200 is not set 16# CONFIG_E200 is not set
17CONFIG_PPC_BOOK3S=y
18CONFIG_6xx=y
17CONFIG_PPC_FPU=y 19CONFIG_PPC_FPU=y
18# CONFIG_FSL_EMB_PERFMON is not set 20# CONFIG_FSL_EMB_PERFMON is not set
19# CONFIG_ALTIVEC is not set 21# CONFIG_ALTIVEC is not set
20CONFIG_PPC_STD_MMU=y 22CONFIG_PPC_STD_MMU=y
21CONFIG_PPC_STD_MMU_32=y 23CONFIG_PPC_STD_MMU_32=y
22# CONFIG_PPC_MM_SLICES is not set 24# CONFIG_PPC_MM_SLICES is not set
25CONFIG_PPC_HAVE_PMU_SUPPORT=y
23# CONFIG_SMP is not set 26# CONFIG_SMP is not set
24CONFIG_PPC32=y 27CONFIG_PPC32=y
25CONFIG_WORD_SIZE=32 28CONFIG_WORD_SIZE=32
@@ -30,21 +33,22 @@ CONFIG_GENERIC_TIME=y
30CONFIG_GENERIC_TIME_VSYSCALL=y 33CONFIG_GENERIC_TIME_VSYSCALL=y
31CONFIG_GENERIC_CLOCKEVENTS=y 34CONFIG_GENERIC_CLOCKEVENTS=y
32CONFIG_GENERIC_HARDIRQS=y 35CONFIG_GENERIC_HARDIRQS=y
36CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
33# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set 37# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set
34CONFIG_IRQ_PER_CPU=y 38CONFIG_IRQ_PER_CPU=y
35CONFIG_STACKTRACE_SUPPORT=y 39CONFIG_STACKTRACE_SUPPORT=y
36CONFIG_HAVE_LATENCYTOP_SUPPORT=y 40CONFIG_HAVE_LATENCYTOP_SUPPORT=y
41CONFIG_TRACE_IRQFLAGS_SUPPORT=y
37CONFIG_LOCKDEP_SUPPORT=y 42CONFIG_LOCKDEP_SUPPORT=y
38CONFIG_RWSEM_XCHGADD_ALGORITHM=y 43CONFIG_RWSEM_XCHGADD_ALGORITHM=y
39CONFIG_ARCH_HAS_ILOG2_U32=y 44CONFIG_ARCH_HAS_ILOG2_U32=y
40CONFIG_GENERIC_HWEIGHT=y 45CONFIG_GENERIC_HWEIGHT=y
41CONFIG_GENERIC_CALIBRATE_DELAY=y
42CONFIG_GENERIC_FIND_NEXT_BIT=y 46CONFIG_GENERIC_FIND_NEXT_BIT=y
43# CONFIG_ARCH_NO_VIRT_TO_BUS is not set 47# CONFIG_ARCH_NO_VIRT_TO_BUS is not set
44CONFIG_PPC=y 48CONFIG_PPC=y
45CONFIG_EARLY_PRINTK=y 49CONFIG_EARLY_PRINTK=y
46CONFIG_GENERIC_NVRAM=y 50CONFIG_GENERIC_NVRAM=y
47CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y 51CONFIG_SCHED_OMIT_FRAME_POINTER=y
48CONFIG_ARCH_MAY_HAVE_PC_FDC=y 52CONFIG_ARCH_MAY_HAVE_PC_FDC=y
49CONFIG_PPC_OF=y 53CONFIG_PPC_OF=y
50CONFIG_OF=y 54CONFIG_OF=y
@@ -52,11 +56,14 @@ CONFIG_PPC_UDBG_16550=y
52# CONFIG_GENERIC_TBSYNC is not set 56# CONFIG_GENERIC_TBSYNC is not set
53CONFIG_AUDIT_ARCH=y 57CONFIG_AUDIT_ARCH=y
54CONFIG_GENERIC_BUG=y 58CONFIG_GENERIC_BUG=y
59CONFIG_DTC=y
55CONFIG_DEFAULT_UIMAGE=y 60CONFIG_DEFAULT_UIMAGE=y
56CONFIG_ARCH_SUSPEND_POSSIBLE=y 61CONFIG_ARCH_SUSPEND_POSSIBLE=y
57# CONFIG_PPC_DCR_NATIVE is not set 62# CONFIG_PPC_DCR_NATIVE is not set
58# CONFIG_PPC_DCR_MMIO is not set 63# CONFIG_PPC_DCR_MMIO is not set
64CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y
59CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" 65CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
66CONFIG_CONSTRUCTORS=y
60 67
61# 68#
62# General setup 69# General setup
@@ -71,19 +78,30 @@ CONFIG_LOCALVERSION_AUTO=y
71CONFIG_SYSVIPC=y 78CONFIG_SYSVIPC=y
72CONFIG_SYSVIPC_SYSCTL=y 79CONFIG_SYSVIPC_SYSCTL=y
73CONFIG_POSIX_MQUEUE=y 80CONFIG_POSIX_MQUEUE=y
81CONFIG_POSIX_MQUEUE_SYSCTL=y
74# CONFIG_BSD_PROCESS_ACCT is not set 82# CONFIG_BSD_PROCESS_ACCT is not set
75# CONFIG_TASKSTATS is not set 83# CONFIG_TASKSTATS is not set
76# CONFIG_AUDIT is not set 84# CONFIG_AUDIT is not set
85
86#
87# RCU Subsystem
88#
89CONFIG_CLASSIC_RCU=y
90# CONFIG_TREE_RCU is not set
91# CONFIG_PREEMPT_RCU is not set
92# CONFIG_TREE_RCU_TRACE is not set
93# CONFIG_PREEMPT_RCU_TRACE is not set
77# CONFIG_IKCONFIG is not set 94# CONFIG_IKCONFIG is not set
78CONFIG_LOG_BUF_SHIFT=14 95CONFIG_LOG_BUF_SHIFT=14
79# CONFIG_CGROUPS is not set
80# CONFIG_GROUP_SCHED is not set 96# CONFIG_GROUP_SCHED is not set
97# CONFIG_CGROUPS is not set
81# CONFIG_SYSFS_DEPRECATED_V2 is not set 98# CONFIG_SYSFS_DEPRECATED_V2 is not set
82# CONFIG_RELAY is not set 99# CONFIG_RELAY is not set
83# CONFIG_NAMESPACES is not set 100# CONFIG_NAMESPACES is not set
84# CONFIG_BLK_DEV_INITRD is not set 101# CONFIG_BLK_DEV_INITRD is not set
85CONFIG_CC_OPTIMIZE_FOR_SIZE=y 102CONFIG_CC_OPTIMIZE_FOR_SIZE=y
86CONFIG_SYSCTL=y 103CONFIG_SYSCTL=y
104CONFIG_ANON_INODES=y
87CONFIG_EMBEDDED=y 105CONFIG_EMBEDDED=y
88CONFIG_SYSCTL_SYSCALL=y 106CONFIG_SYSCTL_SYSCALL=y
89CONFIG_KALLSYMS=y 107CONFIG_KALLSYMS=y
@@ -93,17 +111,23 @@ CONFIG_KALLSYMS_ALL=y
93CONFIG_PRINTK=y 111CONFIG_PRINTK=y
94CONFIG_BUG=y 112CONFIG_BUG=y
95CONFIG_ELF_CORE=y 113CONFIG_ELF_CORE=y
96CONFIG_COMPAT_BRK=y
97CONFIG_BASE_FULL=y 114CONFIG_BASE_FULL=y
98CONFIG_FUTEX=y 115CONFIG_FUTEX=y
99CONFIG_ANON_INODES=y
100CONFIG_EPOLL=y 116CONFIG_EPOLL=y
101CONFIG_SIGNALFD=y 117CONFIG_SIGNALFD=y
102CONFIG_TIMERFD=y 118CONFIG_TIMERFD=y
103CONFIG_EVENTFD=y 119CONFIG_EVENTFD=y
104CONFIG_SHMEM=y 120CONFIG_SHMEM=y
105CONFIG_AIO=y 121CONFIG_AIO=y
122CONFIG_HAVE_PERF_COUNTERS=y
123
124#
125# Performance Counters
126#
127# CONFIG_PERF_COUNTERS is not set
106CONFIG_VM_EVENT_COUNTERS=y 128CONFIG_VM_EVENT_COUNTERS=y
129# CONFIG_STRIP_ASM_SYMS is not set
130CONFIG_COMPAT_BRK=y
107CONFIG_SLAB=y 131CONFIG_SLAB=y
108# CONFIG_SLUB is not set 132# CONFIG_SLUB is not set
109# CONFIG_SLOB is not set 133# CONFIG_SLOB is not set
@@ -116,10 +140,15 @@ CONFIG_HAVE_IOREMAP_PROT=y
116CONFIG_HAVE_KPROBES=y 140CONFIG_HAVE_KPROBES=y
117CONFIG_HAVE_KRETPROBES=y 141CONFIG_HAVE_KRETPROBES=y
118CONFIG_HAVE_ARCH_TRACEHOOK=y 142CONFIG_HAVE_ARCH_TRACEHOOK=y
143
144#
145# GCOV-based kernel profiling
146#
147# CONFIG_GCOV_KERNEL is not set
148# CONFIG_SLOW_WORK is not set
119# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set 149# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
120CONFIG_SLABINFO=y 150CONFIG_SLABINFO=y
121CONFIG_RT_MUTEXES=y 151CONFIG_RT_MUTEXES=y
122# CONFIG_TINY_SHMEM is not set
123CONFIG_BASE_SMALL=0 152CONFIG_BASE_SMALL=0
124CONFIG_MODULES=y 153CONFIG_MODULES=y
125# CONFIG_MODULE_FORCE_LOAD is not set 154# CONFIG_MODULE_FORCE_LOAD is not set
@@ -127,11 +156,8 @@ CONFIG_MODULE_UNLOAD=y
127# CONFIG_MODULE_FORCE_UNLOAD is not set 156# CONFIG_MODULE_FORCE_UNLOAD is not set
128# CONFIG_MODVERSIONS is not set 157# CONFIG_MODVERSIONS is not set
129# CONFIG_MODULE_SRCVERSION_ALL is not set 158# CONFIG_MODULE_SRCVERSION_ALL is not set
130CONFIG_KMOD=y
131CONFIG_BLOCK=y 159CONFIG_BLOCK=y
132# CONFIG_LBD is not set 160CONFIG_LBDAF=y
133# CONFIG_BLK_DEV_IO_TRACE is not set
134# CONFIG_LSF is not set
135# CONFIG_BLK_DEV_BSG is not set 161# CONFIG_BLK_DEV_BSG is not set
136# CONFIG_BLK_DEV_INTEGRITY is not set 162# CONFIG_BLK_DEV_INTEGRITY is not set
137 163
@@ -147,14 +173,11 @@ CONFIG_IOSCHED_NOOP=y
147# CONFIG_DEFAULT_CFQ is not set 173# CONFIG_DEFAULT_CFQ is not set
148CONFIG_DEFAULT_NOOP=y 174CONFIG_DEFAULT_NOOP=y
149CONFIG_DEFAULT_IOSCHED="noop" 175CONFIG_DEFAULT_IOSCHED="noop"
150CONFIG_CLASSIC_RCU=y
151# CONFIG_FREEZER is not set 176# CONFIG_FREEZER is not set
152 177
153# 178#
154# Platform support 179# Platform support
155# 180#
156CONFIG_PPC_MULTIPLATFORM=y
157CONFIG_CLASSIC32=y
158# CONFIG_PPC_CHRP is not set 181# CONFIG_PPC_CHRP is not set
159# CONFIG_MPC5121_ADS is not set 182# CONFIG_MPC5121_ADS is not set
160# CONFIG_MPC5121_GENERIC is not set 183# CONFIG_MPC5121_GENERIC is not set
@@ -179,6 +202,8 @@ CONFIG_PPC_83xx=y
179CONFIG_KMETER1=y 202CONFIG_KMETER1=y
180# CONFIG_PPC_86xx is not set 203# CONFIG_PPC_86xx is not set
181# CONFIG_EMBEDDED6xx is not set 204# CONFIG_EMBEDDED6xx is not set
205# CONFIG_AMIGAONE is not set
206CONFIG_PPC_OF_BOOT_TRAMPOLINE=y
182CONFIG_IPIC=y 207CONFIG_IPIC=y
183# CONFIG_MPIC is not set 208# CONFIG_MPIC is not set
184# CONFIG_MPIC_WEIRD is not set 209# CONFIG_MPIC_WEIRD is not set
@@ -194,6 +219,8 @@ CONFIG_IPIC=y
194CONFIG_QUICC_ENGINE=y 219CONFIG_QUICC_ENGINE=y
195# CONFIG_QE_GPIO is not set 220# CONFIG_QE_GPIO is not set
196# CONFIG_FSL_ULI1575 is not set 221# CONFIG_FSL_ULI1575 is not set
222# CONFIG_SIMPLE_GPIO is not set
223# CONFIG_MCU_MPC8349EMITX is not set
197 224
198# 225#
199# Kernel options 226# Kernel options
@@ -212,16 +239,17 @@ CONFIG_SCHED_HRTICK=y
212# CONFIG_PREEMPT_NONE is not set 239# CONFIG_PREEMPT_NONE is not set
213# CONFIG_PREEMPT_VOLUNTARY is not set 240# CONFIG_PREEMPT_VOLUNTARY is not set
214CONFIG_PREEMPT=y 241CONFIG_PREEMPT=y
215# CONFIG_PREEMPT_RCU is not set
216CONFIG_BINFMT_ELF=y 242CONFIG_BINFMT_ELF=y
217# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set 243# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
218# CONFIG_HAVE_AOUT is not set 244# CONFIG_HAVE_AOUT is not set
219# CONFIG_BINFMT_MISC is not set 245# CONFIG_BINFMT_MISC is not set
220# CONFIG_IOMMU_HELPER is not set 246# CONFIG_IOMMU_HELPER is not set
247# CONFIG_SWIOTLB is not set
221CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y 248CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
222CONFIG_ARCH_HAS_WALK_MEMORY=y 249CONFIG_ARCH_HAS_WALK_MEMORY=y
223CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y 250CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y
224# CONFIG_KEXEC is not set 251# CONFIG_KEXEC is not set
252# CONFIG_CRASH_DUMP is not set
225CONFIG_ARCH_FLATMEM_ENABLE=y 253CONFIG_ARCH_FLATMEM_ENABLE=y
226CONFIG_ARCH_POPULATES_NODE_MAP=y 254CONFIG_ARCH_POPULATES_NODE_MAP=y
227CONFIG_SELECT_MEMORY_MODEL=y 255CONFIG_SELECT_MEMORY_MODEL=y
@@ -233,12 +261,17 @@ CONFIG_FLAT_NODE_MEM_MAP=y
233CONFIG_PAGEFLAGS_EXTENDED=y 261CONFIG_PAGEFLAGS_EXTENDED=y
234CONFIG_SPLIT_PTLOCK_CPUS=4 262CONFIG_SPLIT_PTLOCK_CPUS=4
235CONFIG_MIGRATION=y 263CONFIG_MIGRATION=y
236# CONFIG_RESOURCES_64BIT is not set
237# CONFIG_PHYS_ADDR_T_64BIT is not set 264# CONFIG_PHYS_ADDR_T_64BIT is not set
238CONFIG_ZONE_DMA_FLAG=1 265CONFIG_ZONE_DMA_FLAG=1
239CONFIG_BOUNCE=y 266CONFIG_BOUNCE=y
240CONFIG_VIRT_TO_BUS=y 267CONFIG_VIRT_TO_BUS=y
241CONFIG_UNEVICTABLE_LRU=y 268CONFIG_HAVE_MLOCK=y
269CONFIG_HAVE_MLOCKED_PAGE_BIT=y
270CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
271CONFIG_PPC_4K_PAGES=y
272# CONFIG_PPC_16K_PAGES is not set
273# CONFIG_PPC_64K_PAGES is not set
274# CONFIG_PPC_256K_PAGES is not set
242CONFIG_FORCE_MAX_ZONEORDER=11 275CONFIG_FORCE_MAX_ZONEORDER=11
243CONFIG_PROC_DEVICETREE=y 276CONFIG_PROC_DEVICETREE=y
244# CONFIG_CMDLINE_BOOL is not set 277# CONFIG_CMDLINE_BOOL is not set
@@ -331,7 +364,10 @@ CONFIG_LLC=m
331# CONFIG_LAPB is not set 364# CONFIG_LAPB is not set
332# CONFIG_ECONET is not set 365# CONFIG_ECONET is not set
333# CONFIG_WAN_ROUTER is not set 366# CONFIG_WAN_ROUTER is not set
367# CONFIG_PHONET is not set
368# CONFIG_IEEE802154 is not set
334# CONFIG_NET_SCHED is not set 369# CONFIG_NET_SCHED is not set
370# CONFIG_DCB is not set
335 371
336# 372#
337# Network testing 373# Network testing
@@ -342,8 +378,8 @@ CONFIG_LLC=m
342# CONFIG_IRDA is not set 378# CONFIG_IRDA is not set
343# CONFIG_BT is not set 379# CONFIG_BT is not set
344# CONFIG_AF_RXRPC is not set 380# CONFIG_AF_RXRPC is not set
345# CONFIG_PHONET is not set
346# CONFIG_WIRELESS is not set 381# CONFIG_WIRELESS is not set
382# CONFIG_WIMAX is not set
347# CONFIG_RFKILL is not set 383# CONFIG_RFKILL is not set
348# CONFIG_NET_9P is not set 384# CONFIG_NET_9P is not set
349 385
@@ -362,6 +398,7 @@ CONFIG_MTD=y
362# CONFIG_MTD_DEBUG is not set 398# CONFIG_MTD_DEBUG is not set
363CONFIG_MTD_CONCAT=y 399CONFIG_MTD_CONCAT=y
364CONFIG_MTD_PARTITIONS=y 400CONFIG_MTD_PARTITIONS=y
401# CONFIG_MTD_TESTS is not set
365# CONFIG_MTD_REDBOOT_PARTS is not set 402# CONFIG_MTD_REDBOOT_PARTS is not set
366CONFIG_MTD_CMDLINE_PARTS=y 403CONFIG_MTD_CMDLINE_PARTS=y
367CONFIG_MTD_OF_PARTS=y 404CONFIG_MTD_OF_PARTS=y
@@ -431,6 +468,11 @@ CONFIG_MTD_PHRAM=y
431# CONFIG_MTD_ONENAND is not set 468# CONFIG_MTD_ONENAND is not set
432 469
433# 470#
471# LPDDR flash memory drivers
472#
473# CONFIG_MTD_LPDDR is not set
474
475#
434# UBI - Unsorted block images 476# UBI - Unsorted block images
435# 477#
436CONFIG_MTD_UBI=y 478CONFIG_MTD_UBI=y
@@ -445,7 +487,6 @@ CONFIG_MTD_UBI_DEBUG=y
445# CONFIG_MTD_UBI_DEBUG_MSG is not set 487# CONFIG_MTD_UBI_DEBUG_MSG is not set
446# CONFIG_MTD_UBI_DEBUG_PARANOID is not set 488# CONFIG_MTD_UBI_DEBUG_PARANOID is not set
447# CONFIG_MTD_UBI_DEBUG_DISABLE_BGT is not set 489# CONFIG_MTD_UBI_DEBUG_DISABLE_BGT is not set
448# CONFIG_MTD_UBI_DEBUG_USERSPACE_IO is not set
449# CONFIG_MTD_UBI_DEBUG_EMULATE_BITFLIPS is not set 490# CONFIG_MTD_UBI_DEBUG_EMULATE_BITFLIPS is not set
450# CONFIG_MTD_UBI_DEBUG_EMULATE_WRITE_FAILURES is not set 491# CONFIG_MTD_UBI_DEBUG_EMULATE_WRITE_FAILURES is not set
451# CONFIG_MTD_UBI_DEBUG_EMULATE_ERASE_FAILURES is not set 492# CONFIG_MTD_UBI_DEBUG_EMULATE_ERASE_FAILURES is not set
@@ -459,6 +500,7 @@ CONFIG_MTD_UBI_DEBUG=y
459# CONFIG_MTD_UBI_DEBUG_MSG_IO is not set 500# CONFIG_MTD_UBI_DEBUG_MSG_IO is not set
460CONFIG_OF_DEVICE=y 501CONFIG_OF_DEVICE=y
461CONFIG_OF_I2C=y 502CONFIG_OF_I2C=y
503CONFIG_OF_MDIO=y
462# CONFIG_PARPORT is not set 504# CONFIG_PARPORT is not set
463CONFIG_BLK_DEV=y 505CONFIG_BLK_DEV=y
464# CONFIG_BLK_DEV_FD is not set 506# CONFIG_BLK_DEV_FD is not set
@@ -505,10 +547,15 @@ CONFIG_MARVELL_PHY=y
505# CONFIG_BROADCOM_PHY is not set 547# CONFIG_BROADCOM_PHY is not set
506# CONFIG_ICPLUS_PHY is not set 548# CONFIG_ICPLUS_PHY is not set
507# CONFIG_REALTEK_PHY is not set 549# CONFIG_REALTEK_PHY is not set
550# CONFIG_NATIONAL_PHY is not set
551# CONFIG_STE10XP is not set
552# CONFIG_LSI_ET1011C_PHY is not set
508# CONFIG_FIXED_PHY is not set 553# CONFIG_FIXED_PHY is not set
509# CONFIG_MDIO_BITBANG is not set 554# CONFIG_MDIO_BITBANG is not set
510CONFIG_NET_ETHERNET=y 555CONFIG_NET_ETHERNET=y
511CONFIG_MII=y 556CONFIG_MII=y
557# CONFIG_ETHOC is not set
558# CONFIG_DNET is not set
512# CONFIG_IBM_NEW_EMAC_ZMII is not set 559# CONFIG_IBM_NEW_EMAC_ZMII is not set
513# CONFIG_IBM_NEW_EMAC_RGMII is not set 560# CONFIG_IBM_NEW_EMAC_RGMII is not set
514# CONFIG_IBM_NEW_EMAC_TAH is not set 561# CONFIG_IBM_NEW_EMAC_TAH is not set
@@ -517,11 +564,12 @@ CONFIG_MII=y
517# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set 564# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set
518# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set 565# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
519# CONFIG_B44 is not set 566# CONFIG_B44 is not set
567# CONFIG_KS8842 is not set
520CONFIG_NETDEV_1000=y 568CONFIG_NETDEV_1000=y
569CONFIG_FSL_PQ_MDIO=y
521# CONFIG_GIANFAR is not set 570# CONFIG_GIANFAR is not set
522CONFIG_UCC_GETH=y 571CONFIG_UCC_GETH=y
523# CONFIG_UGETH_MAGIC_PACKET is not set 572# CONFIG_UGETH_MAGIC_PACKET is not set
524# CONFIG_UGETH_FILTERING is not set
525# CONFIG_UGETH_TX_ON_DEMAND is not set 573# CONFIG_UGETH_TX_ON_DEMAND is not set
526# CONFIG_MV643XX_ETH is not set 574# CONFIG_MV643XX_ETH is not set
527# CONFIG_NETDEV_10000 is not set 575# CONFIG_NETDEV_10000 is not set
@@ -531,7 +579,10 @@ CONFIG_UCC_GETH=y
531# 579#
532# CONFIG_WLAN_PRE80211 is not set 580# CONFIG_WLAN_PRE80211 is not set
533# CONFIG_WLAN_80211 is not set 581# CONFIG_WLAN_80211 is not set
534# CONFIG_IWLWIFI_LEDS is not set 582
583#
584# Enable WiMAX (Networking options) to see the WiMAX drivers
585#
535CONFIG_WAN=y 586CONFIG_WAN=y
536CONFIG_HDLC=y 587CONFIG_HDLC=y
537# CONFIG_HDLC_RAW is not set 588# CONFIG_HDLC_RAW is not set
@@ -543,8 +594,6 @@ CONFIG_HDLC=y
543# 594#
544# X.25/LAPB support is disabled 595# X.25/LAPB support is disabled
545# 596#
546CONFIG_HDLC_KM=y
547CONFIG_FS_UCC_HDLC=y
548# CONFIG_DLCI is not set 597# CONFIG_DLCI is not set
549CONFIG_PPP=y 598CONFIG_PPP=y
550CONFIG_PPP_MULTILINK=y 599CONFIG_PPP_MULTILINK=y
@@ -600,16 +649,18 @@ CONFIG_SERIAL_CORE_CONSOLE=y
600# CONFIG_SERIAL_OF_PLATFORM is not set 649# CONFIG_SERIAL_OF_PLATFORM is not set
601# CONFIG_SERIAL_QE is not set 650# CONFIG_SERIAL_QE is not set
602CONFIG_UNIX98_PTYS=y 651CONFIG_UNIX98_PTYS=y
652# CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set
603CONFIG_LEGACY_PTYS=y 653CONFIG_LEGACY_PTYS=y
604CONFIG_LEGACY_PTY_COUNT=256 654CONFIG_LEGACY_PTY_COUNT=256
655# CONFIG_HVC_UDBG is not set
605# CONFIG_IPMI_HANDLER is not set 656# CONFIG_IPMI_HANDLER is not set
606CONFIG_HW_RANDOM=y 657CONFIG_HW_RANDOM=y
658# CONFIG_HW_RANDOM_TIMERIOMEM is not set
607# CONFIG_NVRAM is not set 659# CONFIG_NVRAM is not set
608# CONFIG_GEN_RTC is not set 660# CONFIG_GEN_RTC is not set
609# CONFIG_R3964 is not set 661# CONFIG_R3964 is not set
610# CONFIG_RAW_DRIVER is not set 662# CONFIG_RAW_DRIVER is not set
611# CONFIG_TCG_TPM is not set 663# CONFIG_TCG_TPM is not set
612CONFIG_BOOTCOUNT=y
613CONFIG_I2C=y 664CONFIG_I2C=y
614CONFIG_I2C_BOARDINFO=y 665CONFIG_I2C_BOARDINFO=y
615CONFIG_I2C_CHARDEV=y 666CONFIG_I2C_CHARDEV=y
@@ -642,20 +693,20 @@ CONFIG_I2C_MPC=y
642# Miscellaneous I2C Chip support 693# Miscellaneous I2C Chip support
643# 694#
644# CONFIG_DS1682 is not set 695# CONFIG_DS1682 is not set
645# CONFIG_AT24 is not set
646# CONFIG_SENSORS_EEPROM is not set
647# CONFIG_SENSORS_PCF8574 is not set 696# CONFIG_SENSORS_PCF8574 is not set
648# CONFIG_PCF8575 is not set 697# CONFIG_PCF8575 is not set
649# CONFIG_SENSORS_PCA9539 is not set 698# CONFIG_SENSORS_PCA9539 is not set
650# CONFIG_SENSORS_PCF8591 is not set
651# CONFIG_SENSORS_MAX6875 is not set
652# CONFIG_SENSORS_TSL2550 is not set 699# CONFIG_SENSORS_TSL2550 is not set
653# CONFIG_MCU_MPC8349EMITX is not set
654# CONFIG_I2C_DEBUG_CORE is not set 700# CONFIG_I2C_DEBUG_CORE is not set
655# CONFIG_I2C_DEBUG_ALGO is not set 701# CONFIG_I2C_DEBUG_ALGO is not set
656# CONFIG_I2C_DEBUG_BUS is not set 702# CONFIG_I2C_DEBUG_BUS is not set
657# CONFIG_I2C_DEBUG_CHIP is not set 703# CONFIG_I2C_DEBUG_CHIP is not set
658# CONFIG_SPI is not set 704# CONFIG_SPI is not set
705
706#
707# PPS support
708#
709# CONFIG_PPS is not set
659CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y 710CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
660# CONFIG_GPIOLIB is not set 711# CONFIG_GPIOLIB is not set
661# CONFIG_W1 is not set 712# CONFIG_W1 is not set
@@ -677,27 +728,15 @@ CONFIG_SSB_POSSIBLE=y
677# CONFIG_MFD_CORE is not set 728# CONFIG_MFD_CORE is not set
678# CONFIG_MFD_SM501 is not set 729# CONFIG_MFD_SM501 is not set
679# CONFIG_HTC_PASIC3 is not set 730# CONFIG_HTC_PASIC3 is not set
731# CONFIG_TWL4030_CORE is not set
680# CONFIG_MFD_TMIO is not set 732# CONFIG_MFD_TMIO is not set
681# CONFIG_PMIC_DA903X is not set 733# CONFIG_PMIC_DA903X is not set
682# CONFIG_MFD_WM8400 is not set 734# CONFIG_MFD_WM8400 is not set
683# CONFIG_MFD_WM8350_I2C is not set 735# CONFIG_MFD_WM8350_I2C is not set
736# CONFIG_MFD_PCF50633 is not set
737# CONFIG_AB3100_CORE is not set
684# CONFIG_REGULATOR is not set 738# CONFIG_REGULATOR is not set
685 739# CONFIG_MEDIA_SUPPORT is not set
686#
687# Multimedia devices
688#
689
690#
691# Multimedia core support
692#
693# CONFIG_VIDEO_DEV is not set
694# CONFIG_DVB_CORE is not set
695# CONFIG_VIDEO_MEDIA is not set
696
697#
698# Multimedia drivers
699#
700# CONFIG_DAB is not set
701 740
702# 741#
703# Graphics support 742# Graphics support
@@ -720,11 +759,16 @@ CONFIG_SSB_POSSIBLE=y
720# CONFIG_EDAC is not set 759# CONFIG_EDAC is not set
721# CONFIG_RTC_CLASS is not set 760# CONFIG_RTC_CLASS is not set
722# CONFIG_DMADEVICES is not set 761# CONFIG_DMADEVICES is not set
762# CONFIG_AUXDISPLAY is not set
723CONFIG_UIO=y 763CONFIG_UIO=y
724# CONFIG_UIO_PDRV is not set 764# CONFIG_UIO_PDRV is not set
725# CONFIG_UIO_PDRV_GENIRQ is not set 765# CONFIG_UIO_PDRV_GENIRQ is not set
726# CONFIG_UIO_SMX is not set 766# CONFIG_UIO_SMX is not set
727# CONFIG_UIO_SERCOS3 is not set 767# CONFIG_UIO_SERCOS3 is not set
768
769#
770# TI VLYNQ
771#
728# CONFIG_STAGING is not set 772# CONFIG_STAGING is not set
729 773
730# 774#
@@ -736,9 +780,12 @@ CONFIG_UIO=y
736# CONFIG_REISERFS_FS is not set 780# CONFIG_REISERFS_FS is not set
737# CONFIG_JFS_FS is not set 781# CONFIG_JFS_FS is not set
738# CONFIG_FS_POSIX_ACL is not set 782# CONFIG_FS_POSIX_ACL is not set
739CONFIG_FILE_LOCKING=y
740# CONFIG_XFS_FS is not set 783# CONFIG_XFS_FS is not set
784# CONFIG_GFS2_FS is not set
741# CONFIG_OCFS2_FS is not set 785# CONFIG_OCFS2_FS is not set
786# CONFIG_BTRFS_FS is not set
787CONFIG_FILE_LOCKING=y
788CONFIG_FSNOTIFY=y
742# CONFIG_DNOTIFY is not set 789# CONFIG_DNOTIFY is not set
743CONFIG_INOTIFY=y 790CONFIG_INOTIFY=y
744CONFIG_INOTIFY_USER=y 791CONFIG_INOTIFY_USER=y
@@ -748,6 +795,11 @@ CONFIG_INOTIFY_USER=y
748# CONFIG_FUSE_FS is not set 795# CONFIG_FUSE_FS is not set
749 796
750# 797#
798# Caches
799#
800# CONFIG_FSCACHE is not set
801
802#
751# CD-ROM/DVD Filesystems 803# CD-ROM/DVD Filesystems
752# 804#
753# CONFIG_ISO9660_FS is not set 805# CONFIG_ISO9660_FS is not set
@@ -772,10 +824,7 @@ CONFIG_TMPFS=y
772# CONFIG_TMPFS_POSIX_ACL is not set 824# CONFIG_TMPFS_POSIX_ACL is not set
773# CONFIG_HUGETLB_PAGE is not set 825# CONFIG_HUGETLB_PAGE is not set
774# CONFIG_CONFIGFS_FS is not set 826# CONFIG_CONFIGFS_FS is not set
775 827CONFIG_MISC_FILESYSTEMS=y
776#
777# Miscellaneous filesystems
778#
779# CONFIG_ADFS_FS is not set 828# CONFIG_ADFS_FS is not set
780# CONFIG_AFFS_FS is not set 829# CONFIG_AFFS_FS is not set
781# CONFIG_HFS_FS is not set 830# CONFIG_HFS_FS is not set
@@ -796,6 +845,7 @@ CONFIG_JFFS2_RTIME=y
796# CONFIG_JFFS2_RUBIN is not set 845# CONFIG_JFFS2_RUBIN is not set
797# CONFIG_UBIFS_FS is not set 846# CONFIG_UBIFS_FS is not set
798# CONFIG_CRAMFS is not set 847# CONFIG_CRAMFS is not set
848# CONFIG_SQUASHFS is not set
799# CONFIG_VXFS_FS is not set 849# CONFIG_VXFS_FS is not set
800# CONFIG_MINIX_FS is not set 850# CONFIG_MINIX_FS is not set
801# CONFIG_OMFS_FS is not set 851# CONFIG_OMFS_FS is not set
@@ -804,6 +854,7 @@ CONFIG_JFFS2_RTIME=y
804# CONFIG_ROMFS_FS is not set 854# CONFIG_ROMFS_FS is not set
805# CONFIG_SYSV_FS is not set 855# CONFIG_SYSV_FS is not set
806# CONFIG_UFS_FS is not set 856# CONFIG_UFS_FS is not set
857# CONFIG_NILFS2_FS is not set
807CONFIG_NETWORK_FILESYSTEMS=y 858CONFIG_NETWORK_FILESYSTEMS=y
808CONFIG_NFS_FS=y 859CONFIG_NFS_FS=y
809CONFIG_NFS_V3=y 860CONFIG_NFS_V3=y
@@ -815,7 +866,6 @@ CONFIG_LOCKD=y
815CONFIG_LOCKD_V4=y 866CONFIG_LOCKD_V4=y
816CONFIG_NFS_COMMON=y 867CONFIG_NFS_COMMON=y
817CONFIG_SUNRPC=y 868CONFIG_SUNRPC=y
818# CONFIG_SUNRPC_REGISTER_V4 is not set
819# CONFIG_RPCSEC_GSS_KRB5 is not set 869# CONFIG_RPCSEC_GSS_KRB5 is not set
820# CONFIG_RPCSEC_GSS_SPKM3 is not set 870# CONFIG_RPCSEC_GSS_SPKM3 is not set
821# CONFIG_SMB_FS is not set 871# CONFIG_SMB_FS is not set
@@ -845,11 +895,13 @@ CONFIG_PARTITION_ADVANCED=y
845# CONFIG_DLM is not set 895# CONFIG_DLM is not set
846CONFIG_UCC_FAST=y 896CONFIG_UCC_FAST=y
847CONFIG_UCC=y 897CONFIG_UCC=y
898# CONFIG_BINARY_PRINTF is not set
848 899
849# 900#
850# Library routines 901# Library routines
851# 902#
852CONFIG_BITREVERSE=y 903CONFIG_BITREVERSE=y
904CONFIG_GENERIC_FIND_LAST_BIT=y
853# CONFIG_CRC_CCITT is not set 905# CONFIG_CRC_CCITT is not set
854# CONFIG_CRC16 is not set 906# CONFIG_CRC16 is not set
855# CONFIG_CRC_T10DIF is not set 907# CONFIG_CRC_T10DIF is not set
@@ -859,11 +911,12 @@ CONFIG_CRC32=y
859# CONFIG_LIBCRC32C is not set 911# CONFIG_LIBCRC32C is not set
860CONFIG_ZLIB_INFLATE=y 912CONFIG_ZLIB_INFLATE=y
861CONFIG_ZLIB_DEFLATE=y 913CONFIG_ZLIB_DEFLATE=y
862CONFIG_PLIST=y
863CONFIG_HAS_IOMEM=y 914CONFIG_HAS_IOMEM=y
864CONFIG_HAS_IOPORT=y 915CONFIG_HAS_IOPORT=y
865CONFIG_HAS_DMA=y 916CONFIG_HAS_DMA=y
866CONFIG_HAVE_LMB=y 917CONFIG_HAVE_LMB=y
918CONFIG_NLATTR=y
919CONFIG_GENERIC_ATOMIC64=y
867 920
868# 921#
869# Kernel hacking 922# Kernel hacking
@@ -883,13 +936,18 @@ CONFIG_DEBUG_FS=y
883# CONFIG_LATENCYTOP is not set 936# CONFIG_LATENCYTOP is not set
884CONFIG_SYSCTL_SYSCALL_CHECK=y 937CONFIG_SYSCTL_SYSCALL_CHECK=y
885CONFIG_HAVE_FUNCTION_TRACER=y 938CONFIG_HAVE_FUNCTION_TRACER=y
886 939CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
887# 940CONFIG_HAVE_DYNAMIC_FTRACE=y
888# Tracers 941CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
889# 942CONFIG_TRACING_SUPPORT=y
890# CONFIG_DYNAMIC_PRINTK_DEBUG is not set 943# CONFIG_FTRACE is not set
944# CONFIG_DYNAMIC_DEBUG is not set
891# CONFIG_SAMPLES is not set 945# CONFIG_SAMPLES is not set
892CONFIG_HAVE_ARCH_KGDB=y 946CONFIG_HAVE_ARCH_KGDB=y
947# CONFIG_PPC_DISABLE_WERROR is not set
948CONFIG_PPC_WERROR=y
949CONFIG_PRINT_STACK_DEPTH=64
950# CONFIG_PPC_EMULATED_STATS is not set
893# CONFIG_IRQSTACKS is not set 951# CONFIG_IRQSTACKS is not set
894# CONFIG_VIRQ_DEBUG is not set 952# CONFIG_VIRQ_DEBUG is not set
895# CONFIG_BOOTX_TEXT is not set 953# CONFIG_BOOTX_TEXT is not set
diff --git a/arch/powerpc/configs/83xx/mpc8313_rdb_defconfig b/arch/powerpc/configs/83xx/mpc8313_rdb_defconfig
index c5c0fe71a438..ff33a7db2eab 100644
--- a/arch/powerpc/configs/83xx/mpc8313_rdb_defconfig
+++ b/arch/powerpc/configs/83xx/mpc8313_rdb_defconfig
@@ -1,26 +1,28 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.30-rc3 3# Linux kernel version: 2.6.31-rc4
4# Wed May 13 17:22:06 2009 4# Wed Jul 29 23:32:04 2009
5# 5#
6# CONFIG_PPC64 is not set 6# CONFIG_PPC64 is not set
7 7
8# 8#
9# Processor support 9# Processor support
10# 10#
11CONFIG_6xx=y 11CONFIG_PPC_BOOK3S_32=y
12# CONFIG_PPC_85xx is not set 12# CONFIG_PPC_85xx is not set
13# CONFIG_PPC_8xx is not set 13# CONFIG_PPC_8xx is not set
14# CONFIG_40x is not set 14# CONFIG_40x is not set
15# CONFIG_44x is not set 15# CONFIG_44x is not set
16# CONFIG_E200 is not set 16# CONFIG_E200 is not set
17CONFIG_PPC_BOOK3S=y 17CONFIG_PPC_BOOK3S=y
18CONFIG_6xx=y
18CONFIG_PPC_FPU=y 19CONFIG_PPC_FPU=y
19# CONFIG_FSL_EMB_PERFMON is not set 20# CONFIG_FSL_EMB_PERFMON is not set
20# CONFIG_ALTIVEC is not set 21# CONFIG_ALTIVEC is not set
21CONFIG_PPC_STD_MMU=y 22CONFIG_PPC_STD_MMU=y
22CONFIG_PPC_STD_MMU_32=y 23CONFIG_PPC_STD_MMU_32=y
23# CONFIG_PPC_MM_SLICES is not set 24# CONFIG_PPC_MM_SLICES is not set
25CONFIG_PPC_HAVE_PMU_SUPPORT=y
24# CONFIG_SMP is not set 26# CONFIG_SMP is not set
25CONFIG_PPC32=y 27CONFIG_PPC32=y
26CONFIG_WORD_SIZE=32 28CONFIG_WORD_SIZE=32
@@ -31,15 +33,16 @@ CONFIG_GENERIC_TIME=y
31CONFIG_GENERIC_TIME_VSYSCALL=y 33CONFIG_GENERIC_TIME_VSYSCALL=y
32CONFIG_GENERIC_CLOCKEVENTS=y 34CONFIG_GENERIC_CLOCKEVENTS=y
33CONFIG_GENERIC_HARDIRQS=y 35CONFIG_GENERIC_HARDIRQS=y
36CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
34# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set 37# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set
35CONFIG_IRQ_PER_CPU=y 38CONFIG_IRQ_PER_CPU=y
36CONFIG_STACKTRACE_SUPPORT=y 39CONFIG_STACKTRACE_SUPPORT=y
37CONFIG_HAVE_LATENCYTOP_SUPPORT=y 40CONFIG_HAVE_LATENCYTOP_SUPPORT=y
41CONFIG_TRACE_IRQFLAGS_SUPPORT=y
38CONFIG_LOCKDEP_SUPPORT=y 42CONFIG_LOCKDEP_SUPPORT=y
39CONFIG_RWSEM_XCHGADD_ALGORITHM=y 43CONFIG_RWSEM_XCHGADD_ALGORITHM=y
40CONFIG_ARCH_HAS_ILOG2_U32=y 44CONFIG_ARCH_HAS_ILOG2_U32=y
41CONFIG_GENERIC_HWEIGHT=y 45CONFIG_GENERIC_HWEIGHT=y
42CONFIG_GENERIC_CALIBRATE_DELAY=y
43CONFIG_GENERIC_FIND_NEXT_BIT=y 46CONFIG_GENERIC_FIND_NEXT_BIT=y
44# CONFIG_ARCH_NO_VIRT_TO_BUS is not set 47# CONFIG_ARCH_NO_VIRT_TO_BUS is not set
45CONFIG_PPC=y 48CONFIG_PPC=y
@@ -53,12 +56,14 @@ CONFIG_PPC_UDBG_16550=y
53# CONFIG_GENERIC_TBSYNC is not set 56# CONFIG_GENERIC_TBSYNC is not set
54CONFIG_AUDIT_ARCH=y 57CONFIG_AUDIT_ARCH=y
55CONFIG_GENERIC_BUG=y 58CONFIG_GENERIC_BUG=y
59CONFIG_DTC=y
56CONFIG_DEFAULT_UIMAGE=y 60CONFIG_DEFAULT_UIMAGE=y
57CONFIG_ARCH_SUSPEND_POSSIBLE=y 61CONFIG_ARCH_SUSPEND_POSSIBLE=y
58# CONFIG_PPC_DCR_NATIVE is not set 62# CONFIG_PPC_DCR_NATIVE is not set
59# CONFIG_PPC_DCR_MMIO is not set 63# CONFIG_PPC_DCR_MMIO is not set
60CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y 64CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y
61CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" 65CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
66CONFIG_CONSTRUCTORS=y
62 67
63# 68#
64# General setup 69# General setup
@@ -107,7 +112,6 @@ CONFIG_ANON_INODES=y
107CONFIG_EMBEDDED=y 112CONFIG_EMBEDDED=y
108CONFIG_SYSCTL_SYSCALL=y 113CONFIG_SYSCTL_SYSCALL=y
109# CONFIG_KALLSYMS is not set 114# CONFIG_KALLSYMS is not set
110# CONFIG_STRIP_ASM_SYMS is not set
111CONFIG_HOTPLUG=y 115CONFIG_HOTPLUG=y
112CONFIG_PRINTK=y 116CONFIG_PRINTK=y
113CONFIG_BUG=y 117CONFIG_BUG=y
@@ -120,9 +124,16 @@ CONFIG_TIMERFD=y
120CONFIG_EVENTFD=y 124CONFIG_EVENTFD=y
121CONFIG_SHMEM=y 125CONFIG_SHMEM=y
122CONFIG_AIO=y 126CONFIG_AIO=y
127CONFIG_HAVE_PERF_COUNTERS=y
128
129#
130# Performance Counters
131#
132# CONFIG_PERF_COUNTERS is not set
123CONFIG_VM_EVENT_COUNTERS=y 133CONFIG_VM_EVENT_COUNTERS=y
124CONFIG_PCI_QUIRKS=y 134CONFIG_PCI_QUIRKS=y
125CONFIG_SLUB_DEBUG=y 135CONFIG_SLUB_DEBUG=y
136# CONFIG_STRIP_ASM_SYMS is not set
126CONFIG_COMPAT_BRK=y 137CONFIG_COMPAT_BRK=y
127# CONFIG_SLAB is not set 138# CONFIG_SLAB is not set
128CONFIG_SLUB=y 139CONFIG_SLUB=y
@@ -135,6 +146,10 @@ CONFIG_HAVE_IOREMAP_PROT=y
135CONFIG_HAVE_KPROBES=y 146CONFIG_HAVE_KPROBES=y
136CONFIG_HAVE_KRETPROBES=y 147CONFIG_HAVE_KRETPROBES=y
137CONFIG_HAVE_ARCH_TRACEHOOK=y 148CONFIG_HAVE_ARCH_TRACEHOOK=y
149
150#
151# GCOV-based kernel profiling
152#
138# CONFIG_SLOW_WORK is not set 153# CONFIG_SLOW_WORK is not set
139# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set 154# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
140CONFIG_SLABINFO=y 155CONFIG_SLABINFO=y
@@ -147,7 +162,7 @@ CONFIG_MODULE_UNLOAD=y
147# CONFIG_MODVERSIONS is not set 162# CONFIG_MODVERSIONS is not set
148# CONFIG_MODULE_SRCVERSION_ALL is not set 163# CONFIG_MODULE_SRCVERSION_ALL is not set
149CONFIG_BLOCK=y 164CONFIG_BLOCK=y
150# CONFIG_LBD is not set 165CONFIG_LBDAF=y
151# CONFIG_BLK_DEV_BSG is not set 166# CONFIG_BLK_DEV_BSG is not set
152# CONFIG_BLK_DEV_INTEGRITY is not set 167# CONFIG_BLK_DEV_INTEGRITY is not set
153 168
@@ -189,6 +204,7 @@ CONFIG_MPC831x_RDB=y
189# CONFIG_MPC837x_RDB is not set 204# CONFIG_MPC837x_RDB is not set
190# CONFIG_SBC834x is not set 205# CONFIG_SBC834x is not set
191# CONFIG_ASP834x is not set 206# CONFIG_ASP834x is not set
207# CONFIG_KMETER1 is not set
192CONFIG_PPC_MPC831x=y 208CONFIG_PPC_MPC831x=y
193# CONFIG_PPC_86xx is not set 209# CONFIG_PPC_86xx is not set
194# CONFIG_EMBEDDED6xx is not set 210# CONFIG_EMBEDDED6xx is not set
@@ -234,6 +250,7 @@ CONFIG_BINFMT_ELF=y
234# CONFIG_HAVE_AOUT is not set 250# CONFIG_HAVE_AOUT is not set
235# CONFIG_BINFMT_MISC is not set 251# CONFIG_BINFMT_MISC is not set
236# CONFIG_IOMMU_HELPER is not set 252# CONFIG_IOMMU_HELPER is not set
253# CONFIG_SWIOTLB is not set
237CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y 254CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
238CONFIG_ARCH_HAS_WALK_MEMORY=y 255CONFIG_ARCH_HAS_WALK_MEMORY=y
239CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y 256CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y
@@ -254,9 +271,9 @@ CONFIG_MIGRATION=y
254CONFIG_ZONE_DMA_FLAG=1 271CONFIG_ZONE_DMA_FLAG=1
255CONFIG_BOUNCE=y 272CONFIG_BOUNCE=y
256CONFIG_VIRT_TO_BUS=y 273CONFIG_VIRT_TO_BUS=y
257CONFIG_UNEVICTABLE_LRU=y
258CONFIG_HAVE_MLOCK=y 274CONFIG_HAVE_MLOCK=y
259CONFIG_HAVE_MLOCKED_PAGE_BIT=y 275CONFIG_HAVE_MLOCKED_PAGE_BIT=y
276CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
260CONFIG_PPC_4K_PAGES=y 277CONFIG_PPC_4K_PAGES=y
261# CONFIG_PPC_16K_PAGES is not set 278# CONFIG_PPC_16K_PAGES is not set
262# CONFIG_PPC_64K_PAGES is not set 279# CONFIG_PPC_64K_PAGES is not set
@@ -366,6 +383,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
366# CONFIG_ECONET is not set 383# CONFIG_ECONET is not set
367# CONFIG_WAN_ROUTER is not set 384# CONFIG_WAN_ROUTER is not set
368# CONFIG_PHONET is not set 385# CONFIG_PHONET is not set
386# CONFIG_IEEE802154 is not set
369# CONFIG_NET_SCHED is not set 387# CONFIG_NET_SCHED is not set
370# CONFIG_DCB is not set 388# CONFIG_DCB is not set
371 389
@@ -383,7 +401,11 @@ CONFIG_WIRELESS=y
383CONFIG_WIRELESS_OLD_REGULATORY=y 401CONFIG_WIRELESS_OLD_REGULATORY=y
384# CONFIG_WIRELESS_EXT is not set 402# CONFIG_WIRELESS_EXT is not set
385# CONFIG_LIB80211 is not set 403# CONFIG_LIB80211 is not set
386# CONFIG_MAC80211 is not set 404
405#
406# CFG80211 needs to be enabled for MAC80211
407#
408CONFIG_MAC80211_DEFAULT_PS_VALUE=0
387# CONFIG_WIMAX is not set 409# CONFIG_WIMAX is not set
388# CONFIG_RFKILL is not set 410# CONFIG_RFKILL is not set
389# CONFIG_NET_9P is not set 411# CONFIG_NET_9P is not set
@@ -503,6 +525,7 @@ CONFIG_MTD_NAND_FSL_ELBC=y
503CONFIG_OF_DEVICE=y 525CONFIG_OF_DEVICE=y
504CONFIG_OF_I2C=y 526CONFIG_OF_I2C=y
505CONFIG_OF_SPI=y 527CONFIG_OF_SPI=y
528CONFIG_OF_MDIO=y
506# CONFIG_PARPORT is not set 529# CONFIG_PARPORT is not set
507CONFIG_BLK_DEV=y 530CONFIG_BLK_DEV=y
508# CONFIG_BLK_DEV_FD is not set 531# CONFIG_BLK_DEV_FD is not set
@@ -539,7 +562,9 @@ CONFIG_MISC_DEVICES=y
539# CONFIG_EEPROM_AT24 is not set 562# CONFIG_EEPROM_AT24 is not set
540# CONFIG_EEPROM_AT25 is not set 563# CONFIG_EEPROM_AT25 is not set
541# CONFIG_EEPROM_LEGACY is not set 564# CONFIG_EEPROM_LEGACY is not set
565# CONFIG_EEPROM_MAX6875 is not set
542# CONFIG_EEPROM_93CX6 is not set 566# CONFIG_EEPROM_93CX6 is not set
567# CONFIG_CB710_CORE is not set
543CONFIG_HAVE_IDE=y 568CONFIG_HAVE_IDE=y
544# CONFIG_IDE is not set 569# CONFIG_IDE is not set
545 570
@@ -562,10 +587,6 @@ CONFIG_SCSI_PROC_FS=y
562# CONFIG_BLK_DEV_SR is not set 587# CONFIG_BLK_DEV_SR is not set
563CONFIG_CHR_DEV_SG=y 588CONFIG_CHR_DEV_SG=y
564# CONFIG_CHR_DEV_SCH is not set 589# CONFIG_CHR_DEV_SCH is not set
565
566#
567# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
568#
569# CONFIG_SCSI_MULTI_LUN is not set 590# CONFIG_SCSI_MULTI_LUN is not set
570# CONFIG_SCSI_CONSTANTS is not set 591# CONFIG_SCSI_CONSTANTS is not set
571# CONFIG_SCSI_LOGGING is not set 592# CONFIG_SCSI_LOGGING is not set
@@ -583,6 +604,7 @@ CONFIG_SCSI_SPI_ATTRS=y
583CONFIG_SCSI_LOWLEVEL=y 604CONFIG_SCSI_LOWLEVEL=y
584# CONFIG_ISCSI_TCP is not set 605# CONFIG_ISCSI_TCP is not set
585# CONFIG_SCSI_CXGB3_ISCSI is not set 606# CONFIG_SCSI_CXGB3_ISCSI is not set
607# CONFIG_SCSI_BNX2_ISCSI is not set
586# CONFIG_BLK_DEV_3W_XXXX_RAID is not set 608# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
587# CONFIG_SCSI_3W_9XXX is not set 609# CONFIG_SCSI_3W_9XXX is not set
588# CONFIG_SCSI_ACARD is not set 610# CONFIG_SCSI_ACARD is not set
@@ -591,6 +613,7 @@ CONFIG_SCSI_LOWLEVEL=y
591# CONFIG_SCSI_AIC7XXX_OLD is not set 613# CONFIG_SCSI_AIC7XXX_OLD is not set
592# CONFIG_SCSI_AIC79XX is not set 614# CONFIG_SCSI_AIC79XX is not set
593# CONFIG_SCSI_AIC94XX is not set 615# CONFIG_SCSI_AIC94XX is not set
616# CONFIG_SCSI_MVSAS is not set
594# CONFIG_SCSI_DPT_I2O is not set 617# CONFIG_SCSI_DPT_I2O is not set
595# CONFIG_SCSI_ADVANSYS is not set 618# CONFIG_SCSI_ADVANSYS is not set
596# CONFIG_SCSI_ARCMSR is not set 619# CONFIG_SCSI_ARCMSR is not set
@@ -610,7 +633,6 @@ CONFIG_SCSI_LOWLEVEL=y
610# CONFIG_SCSI_IPS is not set 633# CONFIG_SCSI_IPS is not set
611# CONFIG_SCSI_INITIO is not set 634# CONFIG_SCSI_INITIO is not set
612# CONFIG_SCSI_INIA100 is not set 635# CONFIG_SCSI_INIA100 is not set
613# CONFIG_SCSI_MVSAS is not set
614# CONFIG_SCSI_STEX is not set 636# CONFIG_SCSI_STEX is not set
615# CONFIG_SCSI_SYM53C8XX_2 is not set 637# CONFIG_SCSI_SYM53C8XX_2 is not set
616# CONFIG_SCSI_QLOGIC_1280 is not set 638# CONFIG_SCSI_QLOGIC_1280 is not set
@@ -643,14 +665,17 @@ CONFIG_MD_RAID1=y
643# 665#
644 666
645# 667#
646# Enable only one of the two stacks, unless you know what you are doing 668# You can enable one or both FireWire driver stacks.
669#
670
671#
672# See the help texts for more information.
647# 673#
648# CONFIG_FIREWIRE is not set 674# CONFIG_FIREWIRE is not set
649# CONFIG_IEEE1394 is not set 675# CONFIG_IEEE1394 is not set
650# CONFIG_I2O is not set 676# CONFIG_I2O is not set
651# CONFIG_MACINTOSH_DRIVERS is not set 677# CONFIG_MACINTOSH_DRIVERS is not set
652CONFIG_NETDEVICES=y 678CONFIG_NETDEVICES=y
653CONFIG_COMPAT_NET_DEV_OPS=y
654# CONFIG_DUMMY is not set 679# CONFIG_DUMMY is not set
655# CONFIG_BONDING is not set 680# CONFIG_BONDING is not set
656# CONFIG_MACVLAN is not set 681# CONFIG_MACVLAN is not set
@@ -714,6 +739,8 @@ CONFIG_E100=y
714# CONFIG_SMSC9420 is not set 739# CONFIG_SMSC9420 is not set
715# CONFIG_SUNDANCE is not set 740# CONFIG_SUNDANCE is not set
716# CONFIG_TLAN is not set 741# CONFIG_TLAN is not set
742# CONFIG_KS8842 is not set
743# CONFIG_KS8851 is not set
717# CONFIG_VIA_RHINE is not set 744# CONFIG_VIA_RHINE is not set
718# CONFIG_SC92031 is not set 745# CONFIG_SC92031 is not set
719# CONFIG_ATL2 is not set 746# CONFIG_ATL2 is not set
@@ -735,8 +762,10 @@ CONFIG_NETDEV_1000=y
735# CONFIG_VIA_VELOCITY is not set 762# CONFIG_VIA_VELOCITY is not set
736# CONFIG_TIGON3 is not set 763# CONFIG_TIGON3 is not set
737# CONFIG_BNX2 is not set 764# CONFIG_BNX2 is not set
765# CONFIG_CNIC is not set
738CONFIG_FSL_PQ_MDIO=y 766CONFIG_FSL_PQ_MDIO=y
739CONFIG_GIANFAR=y 767CONFIG_GIANFAR=y
768# CONFIG_MV643XX_ETH is not set
740# CONFIG_QLA3XXX is not set 769# CONFIG_QLA3XXX is not set
741# CONFIG_ATL1 is not set 770# CONFIG_ATL1 is not set
742# CONFIG_ATL1E is not set 771# CONFIG_ATL1E is not set
@@ -924,7 +953,6 @@ CONFIG_I2C_MPC=y
924# CONFIG_SENSORS_PCF8574 is not set 953# CONFIG_SENSORS_PCF8574 is not set
925# CONFIG_PCF8575 is not set 954# CONFIG_PCF8575 is not set
926# CONFIG_SENSORS_PCA9539 is not set 955# CONFIG_SENSORS_PCA9539 is not set
927# CONFIG_SENSORS_MAX6875 is not set
928# CONFIG_SENSORS_TSL2550 is not set 956# CONFIG_SENSORS_TSL2550 is not set
929# CONFIG_I2C_DEBUG_CORE is not set 957# CONFIG_I2C_DEBUG_CORE is not set
930# CONFIG_I2C_DEBUG_ALGO is not set 958# CONFIG_I2C_DEBUG_ALGO is not set
@@ -938,13 +966,18 @@ CONFIG_SPI_MASTER=y
938# SPI Master Controller Drivers 966# SPI Master Controller Drivers
939# 967#
940CONFIG_SPI_BITBANG=y 968CONFIG_SPI_BITBANG=y
941CONFIG_SPI_MPC83xx=y 969# CONFIG_SPI_MPC8xxx is not set
942 970
943# 971#
944# SPI Protocol Masters 972# SPI Protocol Masters
945# 973#
946# CONFIG_SPI_SPIDEV is not set 974# CONFIG_SPI_SPIDEV is not set
947# CONFIG_SPI_TLE62X0 is not set 975# CONFIG_SPI_TLE62X0 is not set
976
977#
978# PPS support
979#
980# CONFIG_PPS is not set
948CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y 981CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
949# CONFIG_GPIOLIB is not set 982# CONFIG_GPIOLIB is not set
950# CONFIG_W1 is not set 983# CONFIG_W1 is not set
@@ -1002,6 +1035,7 @@ CONFIG_HWMON=y
1002# CONFIG_SENSORS_SMSC47B397 is not set 1035# CONFIG_SENSORS_SMSC47B397 is not set
1003# CONFIG_SENSORS_ADS7828 is not set 1036# CONFIG_SENSORS_ADS7828 is not set
1004# CONFIG_SENSORS_THMC50 is not set 1037# CONFIG_SENSORS_THMC50 is not set
1038# CONFIG_SENSORS_TMP401 is not set
1005# CONFIG_SENSORS_VIA686A is not set 1039# CONFIG_SENSORS_VIA686A is not set
1006# CONFIG_SENSORS_VT1211 is not set 1040# CONFIG_SENSORS_VT1211 is not set
1007# CONFIG_SENSORS_VT8231 is not set 1041# CONFIG_SENSORS_VT8231 is not set
@@ -1056,24 +1090,10 @@ CONFIG_SSB_POSSIBLE=y
1056# CONFIG_MFD_WM8400 is not set 1090# CONFIG_MFD_WM8400 is not set
1057# CONFIG_MFD_WM8350_I2C is not set 1091# CONFIG_MFD_WM8350_I2C is not set
1058# CONFIG_MFD_PCF50633 is not set 1092# CONFIG_MFD_PCF50633 is not set
1093# CONFIG_AB3100_CORE is not set
1094# CONFIG_EZX_PCAP is not set
1059# CONFIG_REGULATOR is not set 1095# CONFIG_REGULATOR is not set
1060 1096# CONFIG_MEDIA_SUPPORT is not set
1061#
1062# Multimedia devices
1063#
1064
1065#
1066# Multimedia core support
1067#
1068# CONFIG_VIDEO_DEV is not set
1069# CONFIG_DVB_CORE is not set
1070# CONFIG_VIDEO_MEDIA is not set
1071
1072#
1073# Multimedia drivers
1074#
1075CONFIG_DAB=y
1076# CONFIG_USB_DABUSB is not set
1077 1097
1078# 1098#
1079# Graphics support 1099# Graphics support
@@ -1135,6 +1155,7 @@ CONFIG_USB_MON=y
1135# USB Host Controller Drivers 1155# USB Host Controller Drivers
1136# 1156#
1137# CONFIG_USB_C67X00_HCD is not set 1157# CONFIG_USB_C67X00_HCD is not set
1158# CONFIG_USB_XHCI_HCD is not set
1138CONFIG_USB_EHCI_HCD=y 1159CONFIG_USB_EHCI_HCD=y
1139CONFIG_USB_EHCI_ROOT_HUB_TT=y 1160CONFIG_USB_EHCI_ROOT_HUB_TT=y
1140# CONFIG_USB_EHCI_TT_NEWSCHED is not set 1161# CONFIG_USB_EHCI_TT_NEWSCHED is not set
@@ -1144,9 +1165,9 @@ CONFIG_USB_EHCI_HCD_PPC_OF=y
1144# CONFIG_USB_ISP116X_HCD is not set 1165# CONFIG_USB_ISP116X_HCD is not set
1145# CONFIG_USB_ISP1760_HCD is not set 1166# CONFIG_USB_ISP1760_HCD is not set
1146CONFIG_USB_OHCI_HCD=y 1167CONFIG_USB_OHCI_HCD=y
1147CONFIG_USB_OHCI_HCD_PPC_OF=y
1148CONFIG_USB_OHCI_HCD_PPC_OF_BE=y 1168CONFIG_USB_OHCI_HCD_PPC_OF_BE=y
1149# CONFIG_USB_OHCI_HCD_PPC_OF_LE is not set 1169# CONFIG_USB_OHCI_HCD_PPC_OF_LE is not set
1170CONFIG_USB_OHCI_HCD_PPC_OF=y
1150CONFIG_USB_OHCI_HCD_PCI=y 1171CONFIG_USB_OHCI_HCD_PCI=y
1151CONFIG_USB_OHCI_BIG_ENDIAN_DESC=y 1172CONFIG_USB_OHCI_BIG_ENDIAN_DESC=y
1152CONFIG_USB_OHCI_BIG_ENDIAN_MMIO=y 1173CONFIG_USB_OHCI_BIG_ENDIAN_MMIO=y
@@ -1235,8 +1256,9 @@ CONFIG_USB_GADGET_SELECTED=y
1235# CONFIG_USB_GADGET_OMAP is not set 1256# CONFIG_USB_GADGET_OMAP is not set
1236# CONFIG_USB_GADGET_PXA25X is not set 1257# CONFIG_USB_GADGET_PXA25X is not set
1237# CONFIG_USB_GADGET_PXA27X is not set 1258# CONFIG_USB_GADGET_PXA27X is not set
1238# CONFIG_USB_GADGET_S3C2410 is not set 1259# CONFIG_USB_GADGET_S3C_HSOTG is not set
1239# CONFIG_USB_GADGET_IMX is not set 1260# CONFIG_USB_GADGET_IMX is not set
1261# CONFIG_USB_GADGET_S3C2410 is not set
1240# CONFIG_USB_GADGET_M66592 is not set 1262# CONFIG_USB_GADGET_M66592 is not set
1241# CONFIG_USB_GADGET_AMD5536UDC is not set 1263# CONFIG_USB_GADGET_AMD5536UDC is not set
1242# CONFIG_USB_GADGET_FSL_QE is not set 1264# CONFIG_USB_GADGET_FSL_QE is not set
@@ -1244,9 +1266,11 @@ CONFIG_USB_GADGET_SELECTED=y
1244CONFIG_USB_GADGET_NET2280=y 1266CONFIG_USB_GADGET_NET2280=y
1245CONFIG_USB_NET2280=y 1267CONFIG_USB_NET2280=y
1246# CONFIG_USB_GADGET_GOKU is not set 1268# CONFIG_USB_GADGET_GOKU is not set
1269# CONFIG_USB_GADGET_LANGWELL is not set
1247# CONFIG_USB_GADGET_DUMMY_HCD is not set 1270# CONFIG_USB_GADGET_DUMMY_HCD is not set
1248CONFIG_USB_GADGET_DUALSPEED=y 1271CONFIG_USB_GADGET_DUALSPEED=y
1249# CONFIG_USB_ZERO is not set 1272# CONFIG_USB_ZERO is not set
1273# CONFIG_USB_AUDIO is not set
1250CONFIG_USB_ETH=y 1274CONFIG_USB_ETH=y
1251CONFIG_USB_ETH_RNDIS=y 1275CONFIG_USB_ETH_RNDIS=y
1252# CONFIG_USB_GADGETFS is not set 1276# CONFIG_USB_GADGETFS is not set
@@ -1298,6 +1322,7 @@ CONFIG_RTC_DRV_DS1307=y
1298# CONFIG_RTC_DRV_S35390A is not set 1322# CONFIG_RTC_DRV_S35390A is not set
1299# CONFIG_RTC_DRV_FM3130 is not set 1323# CONFIG_RTC_DRV_FM3130 is not set
1300# CONFIG_RTC_DRV_RX8581 is not set 1324# CONFIG_RTC_DRV_RX8581 is not set
1325# CONFIG_RTC_DRV_RX8025 is not set
1301 1326
1302# 1327#
1303# SPI RTC drivers 1328# SPI RTC drivers
@@ -1332,6 +1357,10 @@ CONFIG_RTC_DRV_DS1307=y
1332# CONFIG_DMADEVICES is not set 1357# CONFIG_DMADEVICES is not set
1333# CONFIG_AUXDISPLAY is not set 1358# CONFIG_AUXDISPLAY is not set
1334# CONFIG_UIO is not set 1359# CONFIG_UIO is not set
1360
1361#
1362# TI VLYNQ
1363#
1335# CONFIG_STAGING is not set 1364# CONFIG_STAGING is not set
1336 1365
1337# 1366#
@@ -1351,10 +1380,12 @@ CONFIG_FS_MBCACHE=y
1351# CONFIG_REISERFS_FS is not set 1380# CONFIG_REISERFS_FS is not set
1352# CONFIG_JFS_FS is not set 1381# CONFIG_JFS_FS is not set
1353# CONFIG_FS_POSIX_ACL is not set 1382# CONFIG_FS_POSIX_ACL is not set
1354CONFIG_FILE_LOCKING=y
1355# CONFIG_XFS_FS is not set 1383# CONFIG_XFS_FS is not set
1384# CONFIG_GFS2_FS is not set
1356# CONFIG_OCFS2_FS is not set 1385# CONFIG_OCFS2_FS is not set
1357# CONFIG_BTRFS_FS is not set 1386# CONFIG_BTRFS_FS is not set
1387CONFIG_FILE_LOCKING=y
1388CONFIG_FSNOTIFY=y
1358CONFIG_DNOTIFY=y 1389CONFIG_DNOTIFY=y
1359CONFIG_INOTIFY=y 1390CONFIG_INOTIFY=y
1360CONFIG_INOTIFY_USER=y 1391CONFIG_INOTIFY_USER=y
@@ -1428,6 +1459,7 @@ CONFIG_NFS_FS=y
1428CONFIG_NFS_V3=y 1459CONFIG_NFS_V3=y
1429# CONFIG_NFS_V3_ACL is not set 1460# CONFIG_NFS_V3_ACL is not set
1430CONFIG_NFS_V4=y 1461CONFIG_NFS_V4=y
1462# CONFIG_NFS_V4_1 is not set
1431CONFIG_ROOT_NFS=y 1463CONFIG_ROOT_NFS=y
1432# CONFIG_NFSD is not set 1464# CONFIG_NFSD is not set
1433CONFIG_LOCKD=y 1465CONFIG_LOCKD=y
@@ -1464,7 +1496,46 @@ CONFIG_MSDOS_PARTITION=y
1464# CONFIG_KARMA_PARTITION is not set 1496# CONFIG_KARMA_PARTITION is not set
1465# CONFIG_EFI_PARTITION is not set 1497# CONFIG_EFI_PARTITION is not set
1466# CONFIG_SYSV68_PARTITION is not set 1498# CONFIG_SYSV68_PARTITION is not set
1467# CONFIG_NLS is not set 1499CONFIG_NLS=y
1500CONFIG_NLS_DEFAULT="iso8859-1"
1501# CONFIG_NLS_CODEPAGE_437 is not set
1502# CONFIG_NLS_CODEPAGE_737 is not set
1503# CONFIG_NLS_CODEPAGE_775 is not set
1504# CONFIG_NLS_CODEPAGE_850 is not set
1505# CONFIG_NLS_CODEPAGE_852 is not set
1506# CONFIG_NLS_CODEPAGE_855 is not set
1507# CONFIG_NLS_CODEPAGE_857 is not set
1508# CONFIG_NLS_CODEPAGE_860 is not set
1509# CONFIG_NLS_CODEPAGE_861 is not set
1510# CONFIG_NLS_CODEPAGE_862 is not set
1511# CONFIG_NLS_CODEPAGE_863 is not set
1512# CONFIG_NLS_CODEPAGE_864 is not set
1513# CONFIG_NLS_CODEPAGE_865 is not set
1514# CONFIG_NLS_CODEPAGE_866 is not set
1515# CONFIG_NLS_CODEPAGE_869 is not set
1516# CONFIG_NLS_CODEPAGE_936 is not set
1517# CONFIG_NLS_CODEPAGE_950 is not set
1518# CONFIG_NLS_CODEPAGE_932 is not set
1519# CONFIG_NLS_CODEPAGE_949 is not set
1520# CONFIG_NLS_CODEPAGE_874 is not set
1521# CONFIG_NLS_ISO8859_8 is not set
1522# CONFIG_NLS_CODEPAGE_1250 is not set
1523# CONFIG_NLS_CODEPAGE_1251 is not set
1524# CONFIG_NLS_ASCII is not set
1525# CONFIG_NLS_ISO8859_1 is not set
1526# CONFIG_NLS_ISO8859_2 is not set
1527# CONFIG_NLS_ISO8859_3 is not set
1528# CONFIG_NLS_ISO8859_4 is not set
1529# CONFIG_NLS_ISO8859_5 is not set
1530# CONFIG_NLS_ISO8859_6 is not set
1531# CONFIG_NLS_ISO8859_7 is not set
1532# CONFIG_NLS_ISO8859_9 is not set
1533# CONFIG_NLS_ISO8859_13 is not set
1534# CONFIG_NLS_ISO8859_14 is not set
1535# CONFIG_NLS_ISO8859_15 is not set
1536# CONFIG_NLS_KOI8_R is not set
1537# CONFIG_NLS_KOI8_U is not set
1538# CONFIG_NLS_UTF8 is not set
1468# CONFIG_DLM is not set 1539# CONFIG_DLM is not set
1469# CONFIG_BINARY_PRINTF is not set 1540# CONFIG_BINARY_PRINTF is not set
1470 1541
@@ -1488,6 +1559,7 @@ CONFIG_HAS_IOPORT=y
1488CONFIG_HAS_DMA=y 1559CONFIG_HAS_DMA=y
1489CONFIG_HAVE_LMB=y 1560CONFIG_HAVE_LMB=y
1490CONFIG_NLATTR=y 1561CONFIG_NLATTR=y
1562CONFIG_GENERIC_ATOMIC64=y
1491 1563
1492# 1564#
1493# Kernel hacking 1565# Kernel hacking
@@ -1518,6 +1590,9 @@ CONFIG_SCHED_DEBUG=y
1518# CONFIG_RT_MUTEX_TESTER is not set 1590# CONFIG_RT_MUTEX_TESTER is not set
1519# CONFIG_DEBUG_SPINLOCK is not set 1591# CONFIG_DEBUG_SPINLOCK is not set
1520# CONFIG_DEBUG_MUTEXES is not set 1592# CONFIG_DEBUG_MUTEXES is not set
1593# CONFIG_DEBUG_LOCK_ALLOC is not set
1594# CONFIG_PROVE_LOCKING is not set
1595# CONFIG_LOCK_STAT is not set
1521# CONFIG_DEBUG_SPINLOCK_SLEEP is not set 1596# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
1522# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set 1597# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
1523# CONFIG_DEBUG_KOBJECT is not set 1598# CONFIG_DEBUG_KOBJECT is not set
@@ -1529,7 +1604,6 @@ CONFIG_SCHED_DEBUG=y
1529# CONFIG_DEBUG_LIST is not set 1604# CONFIG_DEBUG_LIST is not set
1530# CONFIG_DEBUG_SG is not set 1605# CONFIG_DEBUG_SG is not set
1531# CONFIG_DEBUG_NOTIFIERS is not set 1606# CONFIG_DEBUG_NOTIFIERS is not set
1532# CONFIG_BOOT_PRINTK_DELAY is not set
1533# CONFIG_RCU_TORTURE_TEST is not set 1607# CONFIG_RCU_TORTURE_TEST is not set
1534# CONFIG_RCU_CPU_STALL_DETECTOR is not set 1608# CONFIG_RCU_CPU_STALL_DETECTOR is not set
1535# CONFIG_BACKTRACE_SELF_TEST is not set 1609# CONFIG_BACKTRACE_SELF_TEST is not set
@@ -1543,16 +1617,15 @@ CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
1543CONFIG_HAVE_DYNAMIC_FTRACE=y 1617CONFIG_HAVE_DYNAMIC_FTRACE=y
1544CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y 1618CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
1545CONFIG_TRACING_SUPPORT=y 1619CONFIG_TRACING_SUPPORT=y
1546 1620CONFIG_FTRACE=y
1547#
1548# Tracers
1549#
1550# CONFIG_FUNCTION_TRACER is not set 1621# CONFIG_FUNCTION_TRACER is not set
1622# CONFIG_IRQSOFF_TRACER is not set
1551# CONFIG_SCHED_TRACER is not set 1623# CONFIG_SCHED_TRACER is not set
1552# CONFIG_CONTEXT_SWITCH_TRACER is not set 1624# CONFIG_ENABLE_DEFAULT_TRACERS is not set
1553# CONFIG_EVENT_TRACER is not set
1554# CONFIG_BOOT_TRACER is not set 1625# CONFIG_BOOT_TRACER is not set
1555# CONFIG_TRACE_BRANCH_PROFILING is not set 1626CONFIG_BRANCH_PROFILE_NONE=y
1627# CONFIG_PROFILE_ANNOTATED_BRANCHES is not set
1628# CONFIG_PROFILE_ALL_BRANCHES is not set
1556# CONFIG_STACK_TRACER is not set 1629# CONFIG_STACK_TRACER is not set
1557# CONFIG_KMEMTRACE is not set 1630# CONFIG_KMEMTRACE is not set
1558# CONFIG_WORKQUEUE_TRACER is not set 1631# CONFIG_WORKQUEUE_TRACER is not set
@@ -1560,6 +1633,9 @@ CONFIG_TRACING_SUPPORT=y
1560# CONFIG_SAMPLES is not set 1633# CONFIG_SAMPLES is not set
1561CONFIG_HAVE_ARCH_KGDB=y 1634CONFIG_HAVE_ARCH_KGDB=y
1562# CONFIG_KGDB is not set 1635# CONFIG_KGDB is not set
1636# CONFIG_KMEMCHECK is not set
1637# CONFIG_PPC_DISABLE_WERROR is not set
1638CONFIG_PPC_WERROR=y
1563CONFIG_PRINT_STACK_DEPTH=64 1639CONFIG_PRINT_STACK_DEPTH=64
1564# CONFIG_DEBUG_STACKOVERFLOW is not set 1640# CONFIG_DEBUG_STACKOVERFLOW is not set
1565# CONFIG_DEBUG_STACK_USAGE is not set 1641# CONFIG_DEBUG_STACK_USAGE is not set
diff --git a/arch/powerpc/configs/83xx/mpc8315_rdb_defconfig b/arch/powerpc/configs/83xx/mpc8315_rdb_defconfig
index af4952feba36..76237d466702 100644
--- a/arch/powerpc/configs/83xx/mpc8315_rdb_defconfig
+++ b/arch/powerpc/configs/83xx/mpc8315_rdb_defconfig
@@ -1,26 +1,28 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.30-rc3 3# Linux kernel version: 2.6.31-rc4
4# Wed May 13 17:22:06 2009 4# Wed Jul 29 23:32:05 2009
5# 5#
6# CONFIG_PPC64 is not set 6# CONFIG_PPC64 is not set
7 7
8# 8#
9# Processor support 9# Processor support
10# 10#
11CONFIG_6xx=y 11CONFIG_PPC_BOOK3S_32=y
12# CONFIG_PPC_85xx is not set 12# CONFIG_PPC_85xx is not set
13# CONFIG_PPC_8xx is not set 13# CONFIG_PPC_8xx is not set
14# CONFIG_40x is not set 14# CONFIG_40x is not set
15# CONFIG_44x is not set 15# CONFIG_44x is not set
16# CONFIG_E200 is not set 16# CONFIG_E200 is not set
17CONFIG_PPC_BOOK3S=y 17CONFIG_PPC_BOOK3S=y
18CONFIG_6xx=y
18CONFIG_PPC_FPU=y 19CONFIG_PPC_FPU=y
19# CONFIG_FSL_EMB_PERFMON is not set 20# CONFIG_FSL_EMB_PERFMON is not set
20# CONFIG_ALTIVEC is not set 21# CONFIG_ALTIVEC is not set
21CONFIG_PPC_STD_MMU=y 22CONFIG_PPC_STD_MMU=y
22CONFIG_PPC_STD_MMU_32=y 23CONFIG_PPC_STD_MMU_32=y
23# CONFIG_PPC_MM_SLICES is not set 24# CONFIG_PPC_MM_SLICES is not set
25CONFIG_PPC_HAVE_PMU_SUPPORT=y
24# CONFIG_SMP is not set 26# CONFIG_SMP is not set
25CONFIG_PPC32=y 27CONFIG_PPC32=y
26CONFIG_WORD_SIZE=32 28CONFIG_WORD_SIZE=32
@@ -31,15 +33,16 @@ CONFIG_GENERIC_TIME=y
31CONFIG_GENERIC_TIME_VSYSCALL=y 33CONFIG_GENERIC_TIME_VSYSCALL=y
32CONFIG_GENERIC_CLOCKEVENTS=y 34CONFIG_GENERIC_CLOCKEVENTS=y
33CONFIG_GENERIC_HARDIRQS=y 35CONFIG_GENERIC_HARDIRQS=y
36CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
34# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set 37# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set
35CONFIG_IRQ_PER_CPU=y 38CONFIG_IRQ_PER_CPU=y
36CONFIG_STACKTRACE_SUPPORT=y 39CONFIG_STACKTRACE_SUPPORT=y
37CONFIG_HAVE_LATENCYTOP_SUPPORT=y 40CONFIG_HAVE_LATENCYTOP_SUPPORT=y
41CONFIG_TRACE_IRQFLAGS_SUPPORT=y
38CONFIG_LOCKDEP_SUPPORT=y 42CONFIG_LOCKDEP_SUPPORT=y
39CONFIG_RWSEM_XCHGADD_ALGORITHM=y 43CONFIG_RWSEM_XCHGADD_ALGORITHM=y
40CONFIG_ARCH_HAS_ILOG2_U32=y 44CONFIG_ARCH_HAS_ILOG2_U32=y
41CONFIG_GENERIC_HWEIGHT=y 45CONFIG_GENERIC_HWEIGHT=y
42CONFIG_GENERIC_CALIBRATE_DELAY=y
43CONFIG_GENERIC_FIND_NEXT_BIT=y 46CONFIG_GENERIC_FIND_NEXT_BIT=y
44# CONFIG_ARCH_NO_VIRT_TO_BUS is not set 47# CONFIG_ARCH_NO_VIRT_TO_BUS is not set
45CONFIG_PPC=y 48CONFIG_PPC=y
@@ -53,12 +56,14 @@ CONFIG_PPC_UDBG_16550=y
53# CONFIG_GENERIC_TBSYNC is not set 56# CONFIG_GENERIC_TBSYNC is not set
54CONFIG_AUDIT_ARCH=y 57CONFIG_AUDIT_ARCH=y
55CONFIG_GENERIC_BUG=y 58CONFIG_GENERIC_BUG=y
59CONFIG_DTC=y
56CONFIG_DEFAULT_UIMAGE=y 60CONFIG_DEFAULT_UIMAGE=y
57CONFIG_ARCH_SUSPEND_POSSIBLE=y 61CONFIG_ARCH_SUSPEND_POSSIBLE=y
58# CONFIG_PPC_DCR_NATIVE is not set 62# CONFIG_PPC_DCR_NATIVE is not set
59# CONFIG_PPC_DCR_MMIO is not set 63# CONFIG_PPC_DCR_MMIO is not set
60CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y 64CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y
61CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" 65CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
66CONFIG_CONSTRUCTORS=y
62 67
63# 68#
64# General setup 69# General setup
@@ -107,7 +112,6 @@ CONFIG_ANON_INODES=y
107CONFIG_EMBEDDED=y 112CONFIG_EMBEDDED=y
108CONFIG_SYSCTL_SYSCALL=y 113CONFIG_SYSCTL_SYSCALL=y
109# CONFIG_KALLSYMS is not set 114# CONFIG_KALLSYMS is not set
110# CONFIG_STRIP_ASM_SYMS is not set
111CONFIG_HOTPLUG=y 115CONFIG_HOTPLUG=y
112CONFIG_PRINTK=y 116CONFIG_PRINTK=y
113CONFIG_BUG=y 117CONFIG_BUG=y
@@ -120,9 +124,16 @@ CONFIG_TIMERFD=y
120CONFIG_EVENTFD=y 124CONFIG_EVENTFD=y
121CONFIG_SHMEM=y 125CONFIG_SHMEM=y
122CONFIG_AIO=y 126CONFIG_AIO=y
127CONFIG_HAVE_PERF_COUNTERS=y
128
129#
130# Performance Counters
131#
132# CONFIG_PERF_COUNTERS is not set
123CONFIG_VM_EVENT_COUNTERS=y 133CONFIG_VM_EVENT_COUNTERS=y
124CONFIG_PCI_QUIRKS=y 134CONFIG_PCI_QUIRKS=y
125CONFIG_SLUB_DEBUG=y 135CONFIG_SLUB_DEBUG=y
136# CONFIG_STRIP_ASM_SYMS is not set
126CONFIG_COMPAT_BRK=y 137CONFIG_COMPAT_BRK=y
127# CONFIG_SLAB is not set 138# CONFIG_SLAB is not set
128CONFIG_SLUB=y 139CONFIG_SLUB=y
@@ -135,6 +146,10 @@ CONFIG_HAVE_IOREMAP_PROT=y
135CONFIG_HAVE_KPROBES=y 146CONFIG_HAVE_KPROBES=y
136CONFIG_HAVE_KRETPROBES=y 147CONFIG_HAVE_KRETPROBES=y
137CONFIG_HAVE_ARCH_TRACEHOOK=y 148CONFIG_HAVE_ARCH_TRACEHOOK=y
149
150#
151# GCOV-based kernel profiling
152#
138# CONFIG_SLOW_WORK is not set 153# CONFIG_SLOW_WORK is not set
139# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set 154# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
140CONFIG_SLABINFO=y 155CONFIG_SLABINFO=y
@@ -147,7 +162,7 @@ CONFIG_MODULE_UNLOAD=y
147# CONFIG_MODVERSIONS is not set 162# CONFIG_MODVERSIONS is not set
148# CONFIG_MODULE_SRCVERSION_ALL is not set 163# CONFIG_MODULE_SRCVERSION_ALL is not set
149CONFIG_BLOCK=y 164CONFIG_BLOCK=y
150# CONFIG_LBD is not set 165CONFIG_LBDAF=y
151# CONFIG_BLK_DEV_BSG is not set 166# CONFIG_BLK_DEV_BSG is not set
152# CONFIG_BLK_DEV_INTEGRITY is not set 167# CONFIG_BLK_DEV_INTEGRITY is not set
153 168
@@ -189,6 +204,7 @@ CONFIG_MPC831x_RDB=y
189# CONFIG_MPC837x_RDB is not set 204# CONFIG_MPC837x_RDB is not set
190# CONFIG_SBC834x is not set 205# CONFIG_SBC834x is not set
191# CONFIG_ASP834x is not set 206# CONFIG_ASP834x is not set
207# CONFIG_KMETER1 is not set
192CONFIG_PPC_MPC831x=y 208CONFIG_PPC_MPC831x=y
193# CONFIG_PPC_86xx is not set 209# CONFIG_PPC_86xx is not set
194# CONFIG_EMBEDDED6xx is not set 210# CONFIG_EMBEDDED6xx is not set
@@ -234,6 +250,7 @@ CONFIG_BINFMT_ELF=y
234# CONFIG_HAVE_AOUT is not set 250# CONFIG_HAVE_AOUT is not set
235# CONFIG_BINFMT_MISC is not set 251# CONFIG_BINFMT_MISC is not set
236# CONFIG_IOMMU_HELPER is not set 252# CONFIG_IOMMU_HELPER is not set
253# CONFIG_SWIOTLB is not set
237CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y 254CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
238CONFIG_ARCH_HAS_WALK_MEMORY=y 255CONFIG_ARCH_HAS_WALK_MEMORY=y
239CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y 256CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y
@@ -254,9 +271,9 @@ CONFIG_MIGRATION=y
254CONFIG_ZONE_DMA_FLAG=1 271CONFIG_ZONE_DMA_FLAG=1
255CONFIG_BOUNCE=y 272CONFIG_BOUNCE=y
256CONFIG_VIRT_TO_BUS=y 273CONFIG_VIRT_TO_BUS=y
257CONFIG_UNEVICTABLE_LRU=y
258CONFIG_HAVE_MLOCK=y 274CONFIG_HAVE_MLOCK=y
259CONFIG_HAVE_MLOCKED_PAGE_BIT=y 275CONFIG_HAVE_MLOCKED_PAGE_BIT=y
276CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
260CONFIG_PPC_4K_PAGES=y 277CONFIG_PPC_4K_PAGES=y
261# CONFIG_PPC_16K_PAGES is not set 278# CONFIG_PPC_16K_PAGES is not set
262# CONFIG_PPC_64K_PAGES is not set 279# CONFIG_PPC_64K_PAGES is not set
@@ -366,6 +383,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
366# CONFIG_ECONET is not set 383# CONFIG_ECONET is not set
367# CONFIG_WAN_ROUTER is not set 384# CONFIG_WAN_ROUTER is not set
368# CONFIG_PHONET is not set 385# CONFIG_PHONET is not set
386# CONFIG_IEEE802154 is not set
369# CONFIG_NET_SCHED is not set 387# CONFIG_NET_SCHED is not set
370# CONFIG_DCB is not set 388# CONFIG_DCB is not set
371 389
@@ -383,7 +401,11 @@ CONFIG_WIRELESS=y
383CONFIG_WIRELESS_OLD_REGULATORY=y 401CONFIG_WIRELESS_OLD_REGULATORY=y
384# CONFIG_WIRELESS_EXT is not set 402# CONFIG_WIRELESS_EXT is not set
385# CONFIG_LIB80211 is not set 403# CONFIG_LIB80211 is not set
386# CONFIG_MAC80211 is not set 404
405#
406# CFG80211 needs to be enabled for MAC80211
407#
408CONFIG_MAC80211_DEFAULT_PS_VALUE=0
387# CONFIG_WIMAX is not set 409# CONFIG_WIMAX is not set
388# CONFIG_RFKILL is not set 410# CONFIG_RFKILL is not set
389# CONFIG_NET_9P is not set 411# CONFIG_NET_9P is not set
@@ -503,6 +525,7 @@ CONFIG_MTD_NAND_IDS=y
503CONFIG_OF_DEVICE=y 525CONFIG_OF_DEVICE=y
504CONFIG_OF_I2C=y 526CONFIG_OF_I2C=y
505CONFIG_OF_SPI=y 527CONFIG_OF_SPI=y
528CONFIG_OF_MDIO=y
506# CONFIG_PARPORT is not set 529# CONFIG_PARPORT is not set
507CONFIG_BLK_DEV=y 530CONFIG_BLK_DEV=y
508# CONFIG_BLK_DEV_FD is not set 531# CONFIG_BLK_DEV_FD is not set
@@ -539,7 +562,9 @@ CONFIG_MISC_DEVICES=y
539# CONFIG_EEPROM_AT24 is not set 562# CONFIG_EEPROM_AT24 is not set
540# CONFIG_EEPROM_AT25 is not set 563# CONFIG_EEPROM_AT25 is not set
541# CONFIG_EEPROM_LEGACY is not set 564# CONFIG_EEPROM_LEGACY is not set
565# CONFIG_EEPROM_MAX6875 is not set
542# CONFIG_EEPROM_93CX6 is not set 566# CONFIG_EEPROM_93CX6 is not set
567# CONFIG_CB710_CORE is not set
543CONFIG_HAVE_IDE=y 568CONFIG_HAVE_IDE=y
544# CONFIG_IDE is not set 569# CONFIG_IDE is not set
545 570
@@ -562,10 +587,6 @@ CONFIG_SCSI_PROC_FS=y
562# CONFIG_BLK_DEV_SR is not set 587# CONFIG_BLK_DEV_SR is not set
563CONFIG_CHR_DEV_SG=y 588CONFIG_CHR_DEV_SG=y
564# CONFIG_CHR_DEV_SCH is not set 589# CONFIG_CHR_DEV_SCH is not set
565
566#
567# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
568#
569# CONFIG_SCSI_MULTI_LUN is not set 590# CONFIG_SCSI_MULTI_LUN is not set
570# CONFIG_SCSI_CONSTANTS is not set 591# CONFIG_SCSI_CONSTANTS is not set
571# CONFIG_SCSI_LOGGING is not set 592# CONFIG_SCSI_LOGGING is not set
@@ -583,6 +604,7 @@ CONFIG_SCSI_SPI_ATTRS=y
583CONFIG_SCSI_LOWLEVEL=y 604CONFIG_SCSI_LOWLEVEL=y
584# CONFIG_ISCSI_TCP is not set 605# CONFIG_ISCSI_TCP is not set
585# CONFIG_SCSI_CXGB3_ISCSI is not set 606# CONFIG_SCSI_CXGB3_ISCSI is not set
607# CONFIG_SCSI_BNX2_ISCSI is not set
586# CONFIG_BLK_DEV_3W_XXXX_RAID is not set 608# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
587# CONFIG_SCSI_3W_9XXX is not set 609# CONFIG_SCSI_3W_9XXX is not set
588# CONFIG_SCSI_ACARD is not set 610# CONFIG_SCSI_ACARD is not set
@@ -591,6 +613,7 @@ CONFIG_SCSI_LOWLEVEL=y
591# CONFIG_SCSI_AIC7XXX_OLD is not set 613# CONFIG_SCSI_AIC7XXX_OLD is not set
592# CONFIG_SCSI_AIC79XX is not set 614# CONFIG_SCSI_AIC79XX is not set
593# CONFIG_SCSI_AIC94XX is not set 615# CONFIG_SCSI_AIC94XX is not set
616# CONFIG_SCSI_MVSAS is not set
594# CONFIG_SCSI_DPT_I2O is not set 617# CONFIG_SCSI_DPT_I2O is not set
595# CONFIG_SCSI_ADVANSYS is not set 618# CONFIG_SCSI_ADVANSYS is not set
596# CONFIG_SCSI_ARCMSR is not set 619# CONFIG_SCSI_ARCMSR is not set
@@ -610,7 +633,6 @@ CONFIG_SCSI_LOWLEVEL=y
610# CONFIG_SCSI_IPS is not set 633# CONFIG_SCSI_IPS is not set
611# CONFIG_SCSI_INITIO is not set 634# CONFIG_SCSI_INITIO is not set
612# CONFIG_SCSI_INIA100 is not set 635# CONFIG_SCSI_INIA100 is not set
613# CONFIG_SCSI_MVSAS is not set
614# CONFIG_SCSI_STEX is not set 636# CONFIG_SCSI_STEX is not set
615# CONFIG_SCSI_SYM53C8XX_2 is not set 637# CONFIG_SCSI_SYM53C8XX_2 is not set
616# CONFIG_SCSI_IPR is not set 638# CONFIG_SCSI_IPR is not set
@@ -704,14 +726,17 @@ CONFIG_MD_RAID1=y
704# 726#
705 727
706# 728#
707# Enable only one of the two stacks, unless you know what you are doing 729# You can enable one or both FireWire driver stacks.
730#
731
732#
733# See the help texts for more information.
708# 734#
709# CONFIG_FIREWIRE is not set 735# CONFIG_FIREWIRE is not set
710# CONFIG_IEEE1394 is not set 736# CONFIG_IEEE1394 is not set
711# CONFIG_I2O is not set 737# CONFIG_I2O is not set
712# CONFIG_MACINTOSH_DRIVERS is not set 738# CONFIG_MACINTOSH_DRIVERS is not set
713CONFIG_NETDEVICES=y 739CONFIG_NETDEVICES=y
714CONFIG_COMPAT_NET_DEV_OPS=y
715# CONFIG_DUMMY is not set 740# CONFIG_DUMMY is not set
716# CONFIG_BONDING is not set 741# CONFIG_BONDING is not set
717# CONFIG_MACVLAN is not set 742# CONFIG_MACVLAN is not set
@@ -775,6 +800,8 @@ CONFIG_E100=y
775# CONFIG_SMSC9420 is not set 800# CONFIG_SMSC9420 is not set
776# CONFIG_SUNDANCE is not set 801# CONFIG_SUNDANCE is not set
777# CONFIG_TLAN is not set 802# CONFIG_TLAN is not set
803# CONFIG_KS8842 is not set
804# CONFIG_KS8851 is not set
778# CONFIG_VIA_RHINE is not set 805# CONFIG_VIA_RHINE is not set
779# CONFIG_SC92031 is not set 806# CONFIG_SC92031 is not set
780# CONFIG_ATL2 is not set 807# CONFIG_ATL2 is not set
@@ -796,8 +823,10 @@ CONFIG_NETDEV_1000=y
796# CONFIG_VIA_VELOCITY is not set 823# CONFIG_VIA_VELOCITY is not set
797# CONFIG_TIGON3 is not set 824# CONFIG_TIGON3 is not set
798# CONFIG_BNX2 is not set 825# CONFIG_BNX2 is not set
826# CONFIG_CNIC is not set
799CONFIG_FSL_PQ_MDIO=y 827CONFIG_FSL_PQ_MDIO=y
800CONFIG_GIANFAR=y 828CONFIG_GIANFAR=y
829# CONFIG_MV643XX_ETH is not set
801# CONFIG_QLA3XXX is not set 830# CONFIG_QLA3XXX is not set
802# CONFIG_ATL1 is not set 831# CONFIG_ATL1 is not set
803# CONFIG_ATL1E is not set 832# CONFIG_ATL1E is not set
@@ -985,7 +1014,6 @@ CONFIG_I2C_MPC=y
985# CONFIG_SENSORS_PCF8574 is not set 1014# CONFIG_SENSORS_PCF8574 is not set
986# CONFIG_PCF8575 is not set 1015# CONFIG_PCF8575 is not set
987# CONFIG_SENSORS_PCA9539 is not set 1016# CONFIG_SENSORS_PCA9539 is not set
988# CONFIG_SENSORS_MAX6875 is not set
989# CONFIG_SENSORS_TSL2550 is not set 1017# CONFIG_SENSORS_TSL2550 is not set
990# CONFIG_I2C_DEBUG_CORE is not set 1018# CONFIG_I2C_DEBUG_CORE is not set
991# CONFIG_I2C_DEBUG_ALGO is not set 1019# CONFIG_I2C_DEBUG_ALGO is not set
@@ -999,13 +1027,18 @@ CONFIG_SPI_MASTER=y
999# SPI Master Controller Drivers 1027# SPI Master Controller Drivers
1000# 1028#
1001CONFIG_SPI_BITBANG=y 1029CONFIG_SPI_BITBANG=y
1002CONFIG_SPI_MPC83xx=y 1030# CONFIG_SPI_MPC8xxx is not set
1003 1031
1004# 1032#
1005# SPI Protocol Masters 1033# SPI Protocol Masters
1006# 1034#
1007# CONFIG_SPI_SPIDEV is not set 1035# CONFIG_SPI_SPIDEV is not set
1008# CONFIG_SPI_TLE62X0 is not set 1036# CONFIG_SPI_TLE62X0 is not set
1037
1038#
1039# PPS support
1040#
1041# CONFIG_PPS is not set
1009CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y 1042CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
1010# CONFIG_GPIOLIB is not set 1043# CONFIG_GPIOLIB is not set
1011# CONFIG_W1 is not set 1044# CONFIG_W1 is not set
@@ -1063,6 +1096,7 @@ CONFIG_HWMON=y
1063# CONFIG_SENSORS_SMSC47B397 is not set 1096# CONFIG_SENSORS_SMSC47B397 is not set
1064# CONFIG_SENSORS_ADS7828 is not set 1097# CONFIG_SENSORS_ADS7828 is not set
1065# CONFIG_SENSORS_THMC50 is not set 1098# CONFIG_SENSORS_THMC50 is not set
1099# CONFIG_SENSORS_TMP401 is not set
1066# CONFIG_SENSORS_VIA686A is not set 1100# CONFIG_SENSORS_VIA686A is not set
1067# CONFIG_SENSORS_VT1211 is not set 1101# CONFIG_SENSORS_VT1211 is not set
1068# CONFIG_SENSORS_VT8231 is not set 1102# CONFIG_SENSORS_VT8231 is not set
@@ -1117,24 +1151,10 @@ CONFIG_SSB_POSSIBLE=y
1117# CONFIG_MFD_WM8400 is not set 1151# CONFIG_MFD_WM8400 is not set
1118# CONFIG_MFD_WM8350_I2C is not set 1152# CONFIG_MFD_WM8350_I2C is not set
1119# CONFIG_MFD_PCF50633 is not set 1153# CONFIG_MFD_PCF50633 is not set
1154# CONFIG_AB3100_CORE is not set
1155# CONFIG_EZX_PCAP is not set
1120# CONFIG_REGULATOR is not set 1156# CONFIG_REGULATOR is not set
1121 1157# CONFIG_MEDIA_SUPPORT is not set
1122#
1123# Multimedia devices
1124#
1125
1126#
1127# Multimedia core support
1128#
1129# CONFIG_VIDEO_DEV is not set
1130# CONFIG_DVB_CORE is not set
1131# CONFIG_VIDEO_MEDIA is not set
1132
1133#
1134# Multimedia drivers
1135#
1136CONFIG_DAB=y
1137# CONFIG_USB_DABUSB is not set
1138 1158
1139# 1159#
1140# Graphics support 1160# Graphics support
@@ -1196,6 +1216,7 @@ CONFIG_USB_MON=y
1196# USB Host Controller Drivers 1216# USB Host Controller Drivers
1197# 1217#
1198# CONFIG_USB_C67X00_HCD is not set 1218# CONFIG_USB_C67X00_HCD is not set
1219# CONFIG_USB_XHCI_HCD is not set
1199CONFIG_USB_EHCI_HCD=y 1220CONFIG_USB_EHCI_HCD=y
1200CONFIG_USB_EHCI_ROOT_HUB_TT=y 1221CONFIG_USB_EHCI_ROOT_HUB_TT=y
1201# CONFIG_USB_EHCI_TT_NEWSCHED is not set 1222# CONFIG_USB_EHCI_TT_NEWSCHED is not set
@@ -1205,9 +1226,9 @@ CONFIG_USB_EHCI_HCD_PPC_OF=y
1205# CONFIG_USB_ISP116X_HCD is not set 1226# CONFIG_USB_ISP116X_HCD is not set
1206# CONFIG_USB_ISP1760_HCD is not set 1227# CONFIG_USB_ISP1760_HCD is not set
1207CONFIG_USB_OHCI_HCD=y 1228CONFIG_USB_OHCI_HCD=y
1208CONFIG_USB_OHCI_HCD_PPC_OF=y
1209CONFIG_USB_OHCI_HCD_PPC_OF_BE=y 1229CONFIG_USB_OHCI_HCD_PPC_OF_BE=y
1210# CONFIG_USB_OHCI_HCD_PPC_OF_LE is not set 1230# CONFIG_USB_OHCI_HCD_PPC_OF_LE is not set
1231CONFIG_USB_OHCI_HCD_PPC_OF=y
1211CONFIG_USB_OHCI_HCD_PCI=y 1232CONFIG_USB_OHCI_HCD_PCI=y
1212CONFIG_USB_OHCI_BIG_ENDIAN_DESC=y 1233CONFIG_USB_OHCI_BIG_ENDIAN_DESC=y
1213CONFIG_USB_OHCI_BIG_ENDIAN_MMIO=y 1234CONFIG_USB_OHCI_BIG_ENDIAN_MMIO=y
@@ -1296,8 +1317,9 @@ CONFIG_USB_GADGET_SELECTED=y
1296# CONFIG_USB_GADGET_OMAP is not set 1317# CONFIG_USB_GADGET_OMAP is not set
1297# CONFIG_USB_GADGET_PXA25X is not set 1318# CONFIG_USB_GADGET_PXA25X is not set
1298# CONFIG_USB_GADGET_PXA27X is not set 1319# CONFIG_USB_GADGET_PXA27X is not set
1299# CONFIG_USB_GADGET_S3C2410 is not set 1320# CONFIG_USB_GADGET_S3C_HSOTG is not set
1300# CONFIG_USB_GADGET_IMX is not set 1321# CONFIG_USB_GADGET_IMX is not set
1322# CONFIG_USB_GADGET_S3C2410 is not set
1301# CONFIG_USB_GADGET_M66592 is not set 1323# CONFIG_USB_GADGET_M66592 is not set
1302# CONFIG_USB_GADGET_AMD5536UDC is not set 1324# CONFIG_USB_GADGET_AMD5536UDC is not set
1303# CONFIG_USB_GADGET_FSL_QE is not set 1325# CONFIG_USB_GADGET_FSL_QE is not set
@@ -1305,9 +1327,11 @@ CONFIG_USB_GADGET_SELECTED=y
1305CONFIG_USB_GADGET_NET2280=y 1327CONFIG_USB_GADGET_NET2280=y
1306CONFIG_USB_NET2280=y 1328CONFIG_USB_NET2280=y
1307# CONFIG_USB_GADGET_GOKU is not set 1329# CONFIG_USB_GADGET_GOKU is not set
1330# CONFIG_USB_GADGET_LANGWELL is not set
1308# CONFIG_USB_GADGET_DUMMY_HCD is not set 1331# CONFIG_USB_GADGET_DUMMY_HCD is not set
1309CONFIG_USB_GADGET_DUALSPEED=y 1332CONFIG_USB_GADGET_DUALSPEED=y
1310# CONFIG_USB_ZERO is not set 1333# CONFIG_USB_ZERO is not set
1334# CONFIG_USB_AUDIO is not set
1311CONFIG_USB_ETH=y 1335CONFIG_USB_ETH=y
1312CONFIG_USB_ETH_RNDIS=y 1336CONFIG_USB_ETH_RNDIS=y
1313# CONFIG_USB_GADGETFS is not set 1337# CONFIG_USB_GADGETFS is not set
@@ -1359,6 +1383,7 @@ CONFIG_RTC_DRV_DS1307=y
1359# CONFIG_RTC_DRV_S35390A is not set 1383# CONFIG_RTC_DRV_S35390A is not set
1360# CONFIG_RTC_DRV_FM3130 is not set 1384# CONFIG_RTC_DRV_FM3130 is not set
1361# CONFIG_RTC_DRV_RX8581 is not set 1385# CONFIG_RTC_DRV_RX8581 is not set
1386# CONFIG_RTC_DRV_RX8025 is not set
1362 1387
1363# 1388#
1364# SPI RTC drivers 1389# SPI RTC drivers
@@ -1393,6 +1418,10 @@ CONFIG_RTC_DRV_DS1307=y
1393# CONFIG_DMADEVICES is not set 1418# CONFIG_DMADEVICES is not set
1394# CONFIG_AUXDISPLAY is not set 1419# CONFIG_AUXDISPLAY is not set
1395# CONFIG_UIO is not set 1420# CONFIG_UIO is not set
1421
1422#
1423# TI VLYNQ
1424#
1396# CONFIG_STAGING is not set 1425# CONFIG_STAGING is not set
1397 1426
1398# 1427#
@@ -1412,10 +1441,12 @@ CONFIG_FS_MBCACHE=y
1412# CONFIG_REISERFS_FS is not set 1441# CONFIG_REISERFS_FS is not set
1413# CONFIG_JFS_FS is not set 1442# CONFIG_JFS_FS is not set
1414# CONFIG_FS_POSIX_ACL is not set 1443# CONFIG_FS_POSIX_ACL is not set
1415CONFIG_FILE_LOCKING=y
1416# CONFIG_XFS_FS is not set 1444# CONFIG_XFS_FS is not set
1445# CONFIG_GFS2_FS is not set
1417# CONFIG_OCFS2_FS is not set 1446# CONFIG_OCFS2_FS is not set
1418# CONFIG_BTRFS_FS is not set 1447# CONFIG_BTRFS_FS is not set
1448CONFIG_FILE_LOCKING=y
1449CONFIG_FSNOTIFY=y
1419CONFIG_DNOTIFY=y 1450CONFIG_DNOTIFY=y
1420CONFIG_INOTIFY=y 1451CONFIG_INOTIFY=y
1421CONFIG_INOTIFY_USER=y 1452CONFIG_INOTIFY_USER=y
@@ -1489,6 +1520,7 @@ CONFIG_NFS_FS=y
1489CONFIG_NFS_V3=y 1520CONFIG_NFS_V3=y
1490# CONFIG_NFS_V3_ACL is not set 1521# CONFIG_NFS_V3_ACL is not set
1491CONFIG_NFS_V4=y 1522CONFIG_NFS_V4=y
1523# CONFIG_NFS_V4_1 is not set
1492CONFIG_ROOT_NFS=y 1524CONFIG_ROOT_NFS=y
1493# CONFIG_NFSD is not set 1525# CONFIG_NFSD is not set
1494CONFIG_LOCKD=y 1526CONFIG_LOCKD=y
@@ -1525,7 +1557,46 @@ CONFIG_MSDOS_PARTITION=y
1525# CONFIG_KARMA_PARTITION is not set 1557# CONFIG_KARMA_PARTITION is not set
1526# CONFIG_EFI_PARTITION is not set 1558# CONFIG_EFI_PARTITION is not set
1527# CONFIG_SYSV68_PARTITION is not set 1559# CONFIG_SYSV68_PARTITION is not set
1528# CONFIG_NLS is not set 1560CONFIG_NLS=y
1561CONFIG_NLS_DEFAULT="iso8859-1"
1562# CONFIG_NLS_CODEPAGE_437 is not set
1563# CONFIG_NLS_CODEPAGE_737 is not set
1564# CONFIG_NLS_CODEPAGE_775 is not set
1565# CONFIG_NLS_CODEPAGE_850 is not set
1566# CONFIG_NLS_CODEPAGE_852 is not set
1567# CONFIG_NLS_CODEPAGE_855 is not set
1568# CONFIG_NLS_CODEPAGE_857 is not set
1569# CONFIG_NLS_CODEPAGE_860 is not set
1570# CONFIG_NLS_CODEPAGE_861 is not set
1571# CONFIG_NLS_CODEPAGE_862 is not set
1572# CONFIG_NLS_CODEPAGE_863 is not set
1573# CONFIG_NLS_CODEPAGE_864 is not set
1574# CONFIG_NLS_CODEPAGE_865 is not set
1575# CONFIG_NLS_CODEPAGE_866 is not set
1576# CONFIG_NLS_CODEPAGE_869 is not set
1577# CONFIG_NLS_CODEPAGE_936 is not set
1578# CONFIG_NLS_CODEPAGE_950 is not set
1579# CONFIG_NLS_CODEPAGE_932 is not set
1580# CONFIG_NLS_CODEPAGE_949 is not set
1581# CONFIG_NLS_CODEPAGE_874 is not set
1582# CONFIG_NLS_ISO8859_8 is not set
1583# CONFIG_NLS_CODEPAGE_1250 is not set
1584# CONFIG_NLS_CODEPAGE_1251 is not set
1585# CONFIG_NLS_ASCII is not set
1586# CONFIG_NLS_ISO8859_1 is not set
1587# CONFIG_NLS_ISO8859_2 is not set
1588# CONFIG_NLS_ISO8859_3 is not set
1589# CONFIG_NLS_ISO8859_4 is not set
1590# CONFIG_NLS_ISO8859_5 is not set
1591# CONFIG_NLS_ISO8859_6 is not set
1592# CONFIG_NLS_ISO8859_7 is not set
1593# CONFIG_NLS_ISO8859_9 is not set
1594# CONFIG_NLS_ISO8859_13 is not set
1595# CONFIG_NLS_ISO8859_14 is not set
1596# CONFIG_NLS_ISO8859_15 is not set
1597# CONFIG_NLS_KOI8_R is not set
1598# CONFIG_NLS_KOI8_U is not set
1599# CONFIG_NLS_UTF8 is not set
1529# CONFIG_DLM is not set 1600# CONFIG_DLM is not set
1530# CONFIG_BINARY_PRINTF is not set 1601# CONFIG_BINARY_PRINTF is not set
1531 1602
@@ -1549,6 +1620,7 @@ CONFIG_HAS_IOPORT=y
1549CONFIG_HAS_DMA=y 1620CONFIG_HAS_DMA=y
1550CONFIG_HAVE_LMB=y 1621CONFIG_HAVE_LMB=y
1551CONFIG_NLATTR=y 1622CONFIG_NLATTR=y
1623CONFIG_GENERIC_ATOMIC64=y
1552 1624
1553# 1625#
1554# Kernel hacking 1626# Kernel hacking
@@ -1579,6 +1651,9 @@ CONFIG_SCHED_DEBUG=y
1579# CONFIG_RT_MUTEX_TESTER is not set 1651# CONFIG_RT_MUTEX_TESTER is not set
1580# CONFIG_DEBUG_SPINLOCK is not set 1652# CONFIG_DEBUG_SPINLOCK is not set
1581# CONFIG_DEBUG_MUTEXES is not set 1653# CONFIG_DEBUG_MUTEXES is not set
1654# CONFIG_DEBUG_LOCK_ALLOC is not set
1655# CONFIG_PROVE_LOCKING is not set
1656# CONFIG_LOCK_STAT is not set
1582# CONFIG_DEBUG_SPINLOCK_SLEEP is not set 1657# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
1583# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set 1658# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
1584# CONFIG_DEBUG_KOBJECT is not set 1659# CONFIG_DEBUG_KOBJECT is not set
@@ -1590,7 +1665,6 @@ CONFIG_SCHED_DEBUG=y
1590# CONFIG_DEBUG_LIST is not set 1665# CONFIG_DEBUG_LIST is not set
1591# CONFIG_DEBUG_SG is not set 1666# CONFIG_DEBUG_SG is not set
1592# CONFIG_DEBUG_NOTIFIERS is not set 1667# CONFIG_DEBUG_NOTIFIERS is not set
1593# CONFIG_BOOT_PRINTK_DELAY is not set
1594# CONFIG_RCU_TORTURE_TEST is not set 1668# CONFIG_RCU_TORTURE_TEST is not set
1595# CONFIG_RCU_CPU_STALL_DETECTOR is not set 1669# CONFIG_RCU_CPU_STALL_DETECTOR is not set
1596# CONFIG_BACKTRACE_SELF_TEST is not set 1670# CONFIG_BACKTRACE_SELF_TEST is not set
@@ -1604,16 +1678,15 @@ CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
1604CONFIG_HAVE_DYNAMIC_FTRACE=y 1678CONFIG_HAVE_DYNAMIC_FTRACE=y
1605CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y 1679CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
1606CONFIG_TRACING_SUPPORT=y 1680CONFIG_TRACING_SUPPORT=y
1607 1681CONFIG_FTRACE=y
1608#
1609# Tracers
1610#
1611# CONFIG_FUNCTION_TRACER is not set 1682# CONFIG_FUNCTION_TRACER is not set
1683# CONFIG_IRQSOFF_TRACER is not set
1612# CONFIG_SCHED_TRACER is not set 1684# CONFIG_SCHED_TRACER is not set
1613# CONFIG_CONTEXT_SWITCH_TRACER is not set 1685# CONFIG_ENABLE_DEFAULT_TRACERS is not set
1614# CONFIG_EVENT_TRACER is not set
1615# CONFIG_BOOT_TRACER is not set 1686# CONFIG_BOOT_TRACER is not set
1616# CONFIG_TRACE_BRANCH_PROFILING is not set 1687CONFIG_BRANCH_PROFILE_NONE=y
1688# CONFIG_PROFILE_ANNOTATED_BRANCHES is not set
1689# CONFIG_PROFILE_ALL_BRANCHES is not set
1617# CONFIG_STACK_TRACER is not set 1690# CONFIG_STACK_TRACER is not set
1618# CONFIG_KMEMTRACE is not set 1691# CONFIG_KMEMTRACE is not set
1619# CONFIG_WORKQUEUE_TRACER is not set 1692# CONFIG_WORKQUEUE_TRACER is not set
@@ -1621,6 +1694,9 @@ CONFIG_TRACING_SUPPORT=y
1621# CONFIG_SAMPLES is not set 1694# CONFIG_SAMPLES is not set
1622CONFIG_HAVE_ARCH_KGDB=y 1695CONFIG_HAVE_ARCH_KGDB=y
1623# CONFIG_KGDB is not set 1696# CONFIG_KGDB is not set
1697# CONFIG_KMEMCHECK is not set
1698# CONFIG_PPC_DISABLE_WERROR is not set
1699CONFIG_PPC_WERROR=y
1624CONFIG_PRINT_STACK_DEPTH=64 1700CONFIG_PRINT_STACK_DEPTH=64
1625# CONFIG_DEBUG_STACKOVERFLOW is not set 1701# CONFIG_DEBUG_STACKOVERFLOW is not set
1626# CONFIG_DEBUG_STACK_USAGE is not set 1702# CONFIG_DEBUG_STACK_USAGE is not set
diff --git a/arch/powerpc/configs/83xx/mpc832x_mds_defconfig b/arch/powerpc/configs/83xx/mpc832x_mds_defconfig
index 8c8f660b4fc7..e0e36a113409 100644
--- a/arch/powerpc/configs/83xx/mpc832x_mds_defconfig
+++ b/arch/powerpc/configs/83xx/mpc832x_mds_defconfig
@@ -1,26 +1,28 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.30-rc3 3# Linux kernel version: 2.6.31-rc4
4# Wed May 13 17:22:07 2009 4# Wed Jul 29 23:32:06 2009
5# 5#
6# CONFIG_PPC64 is not set 6# CONFIG_PPC64 is not set
7 7
8# 8#
9# Processor support 9# Processor support
10# 10#
11CONFIG_6xx=y 11CONFIG_PPC_BOOK3S_32=y
12# CONFIG_PPC_85xx is not set 12# CONFIG_PPC_85xx is not set
13# CONFIG_PPC_8xx is not set 13# CONFIG_PPC_8xx is not set
14# CONFIG_40x is not set 14# CONFIG_40x is not set
15# CONFIG_44x is not set 15# CONFIG_44x is not set
16# CONFIG_E200 is not set 16# CONFIG_E200 is not set
17CONFIG_PPC_BOOK3S=y 17CONFIG_PPC_BOOK3S=y
18CONFIG_6xx=y
18CONFIG_PPC_FPU=y 19CONFIG_PPC_FPU=y
19# CONFIG_FSL_EMB_PERFMON is not set 20# CONFIG_FSL_EMB_PERFMON is not set
20# CONFIG_ALTIVEC is not set 21# CONFIG_ALTIVEC is not set
21CONFIG_PPC_STD_MMU=y 22CONFIG_PPC_STD_MMU=y
22CONFIG_PPC_STD_MMU_32=y 23CONFIG_PPC_STD_MMU_32=y
23# CONFIG_PPC_MM_SLICES is not set 24# CONFIG_PPC_MM_SLICES is not set
25CONFIG_PPC_HAVE_PMU_SUPPORT=y
24# CONFIG_SMP is not set 26# CONFIG_SMP is not set
25CONFIG_PPC32=y 27CONFIG_PPC32=y
26CONFIG_WORD_SIZE=32 28CONFIG_WORD_SIZE=32
@@ -31,15 +33,16 @@ CONFIG_GENERIC_TIME=y
31CONFIG_GENERIC_TIME_VSYSCALL=y 33CONFIG_GENERIC_TIME_VSYSCALL=y
32CONFIG_GENERIC_CLOCKEVENTS=y 34CONFIG_GENERIC_CLOCKEVENTS=y
33CONFIG_GENERIC_HARDIRQS=y 35CONFIG_GENERIC_HARDIRQS=y
36CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
34# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set 37# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set
35CONFIG_IRQ_PER_CPU=y 38CONFIG_IRQ_PER_CPU=y
36CONFIG_STACKTRACE_SUPPORT=y 39CONFIG_STACKTRACE_SUPPORT=y
37CONFIG_HAVE_LATENCYTOP_SUPPORT=y 40CONFIG_HAVE_LATENCYTOP_SUPPORT=y
41CONFIG_TRACE_IRQFLAGS_SUPPORT=y
38CONFIG_LOCKDEP_SUPPORT=y 42CONFIG_LOCKDEP_SUPPORT=y
39CONFIG_RWSEM_XCHGADD_ALGORITHM=y 43CONFIG_RWSEM_XCHGADD_ALGORITHM=y
40CONFIG_ARCH_HAS_ILOG2_U32=y 44CONFIG_ARCH_HAS_ILOG2_U32=y
41CONFIG_GENERIC_HWEIGHT=y 45CONFIG_GENERIC_HWEIGHT=y
42CONFIG_GENERIC_CALIBRATE_DELAY=y
43CONFIG_GENERIC_FIND_NEXT_BIT=y 46CONFIG_GENERIC_FIND_NEXT_BIT=y
44# CONFIG_ARCH_NO_VIRT_TO_BUS is not set 47# CONFIG_ARCH_NO_VIRT_TO_BUS is not set
45CONFIG_PPC=y 48CONFIG_PPC=y
@@ -53,12 +56,14 @@ CONFIG_PPC_UDBG_16550=y
53# CONFIG_GENERIC_TBSYNC is not set 56# CONFIG_GENERIC_TBSYNC is not set
54CONFIG_AUDIT_ARCH=y 57CONFIG_AUDIT_ARCH=y
55CONFIG_GENERIC_BUG=y 58CONFIG_GENERIC_BUG=y
59CONFIG_DTC=y
56CONFIG_DEFAULT_UIMAGE=y 60CONFIG_DEFAULT_UIMAGE=y
57CONFIG_ARCH_SUSPEND_POSSIBLE=y 61CONFIG_ARCH_SUSPEND_POSSIBLE=y
58# CONFIG_PPC_DCR_NATIVE is not set 62# CONFIG_PPC_DCR_NATIVE is not set
59# CONFIG_PPC_DCR_MMIO is not set 63# CONFIG_PPC_DCR_MMIO is not set
60CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y 64CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y
61CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" 65CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
66CONFIG_CONSTRUCTORS=y
62 67
63# 68#
64# General setup 69# General setup
@@ -107,7 +112,6 @@ CONFIG_ANON_INODES=y
107CONFIG_EMBEDDED=y 112CONFIG_EMBEDDED=y
108CONFIG_SYSCTL_SYSCALL=y 113CONFIG_SYSCTL_SYSCALL=y
109# CONFIG_KALLSYMS is not set 114# CONFIG_KALLSYMS is not set
110# CONFIG_STRIP_ASM_SYMS is not set
111CONFIG_HOTPLUG=y 115CONFIG_HOTPLUG=y
112CONFIG_PRINTK=y 116CONFIG_PRINTK=y
113CONFIG_BUG=y 117CONFIG_BUG=y
@@ -120,9 +124,16 @@ CONFIG_TIMERFD=y
120CONFIG_EVENTFD=y 124CONFIG_EVENTFD=y
121CONFIG_SHMEM=y 125CONFIG_SHMEM=y
122CONFIG_AIO=y 126CONFIG_AIO=y
127CONFIG_HAVE_PERF_COUNTERS=y
128
129#
130# Performance Counters
131#
132# CONFIG_PERF_COUNTERS is not set
123CONFIG_VM_EVENT_COUNTERS=y 133CONFIG_VM_EVENT_COUNTERS=y
124CONFIG_PCI_QUIRKS=y 134CONFIG_PCI_QUIRKS=y
125CONFIG_SLUB_DEBUG=y 135CONFIG_SLUB_DEBUG=y
136# CONFIG_STRIP_ASM_SYMS is not set
126CONFIG_COMPAT_BRK=y 137CONFIG_COMPAT_BRK=y
127# CONFIG_SLAB is not set 138# CONFIG_SLAB is not set
128CONFIG_SLUB=y 139CONFIG_SLUB=y
@@ -135,6 +146,10 @@ CONFIG_HAVE_IOREMAP_PROT=y
135CONFIG_HAVE_KPROBES=y 146CONFIG_HAVE_KPROBES=y
136CONFIG_HAVE_KRETPROBES=y 147CONFIG_HAVE_KRETPROBES=y
137CONFIG_HAVE_ARCH_TRACEHOOK=y 148CONFIG_HAVE_ARCH_TRACEHOOK=y
149
150#
151# GCOV-based kernel profiling
152#
138# CONFIG_SLOW_WORK is not set 153# CONFIG_SLOW_WORK is not set
139# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set 154# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
140CONFIG_SLABINFO=y 155CONFIG_SLABINFO=y
@@ -147,7 +162,7 @@ CONFIG_MODULE_UNLOAD=y
147# CONFIG_MODVERSIONS is not set 162# CONFIG_MODVERSIONS is not set
148# CONFIG_MODULE_SRCVERSION_ALL is not set 163# CONFIG_MODULE_SRCVERSION_ALL is not set
149CONFIG_BLOCK=y 164CONFIG_BLOCK=y
150# CONFIG_LBD is not set 165CONFIG_LBDAF=y
151# CONFIG_BLK_DEV_BSG is not set 166# CONFIG_BLK_DEV_BSG is not set
152# CONFIG_BLK_DEV_INTEGRITY is not set 167# CONFIG_BLK_DEV_INTEGRITY is not set
153 168
@@ -189,6 +204,7 @@ CONFIG_MPC832x_MDS=y
189# CONFIG_MPC837x_RDB is not set 204# CONFIG_MPC837x_RDB is not set
190# CONFIG_SBC834x is not set 205# CONFIG_SBC834x is not set
191# CONFIG_ASP834x is not set 206# CONFIG_ASP834x is not set
207# CONFIG_KMETER1 is not set
192CONFIG_PPC_MPC832x=y 208CONFIG_PPC_MPC832x=y
193# CONFIG_PPC_86xx is not set 209# CONFIG_PPC_86xx is not set
194# CONFIG_EMBEDDED6xx is not set 210# CONFIG_EMBEDDED6xx is not set
@@ -235,6 +251,7 @@ CONFIG_BINFMT_ELF=y
235# CONFIG_BINFMT_MISC is not set 251# CONFIG_BINFMT_MISC is not set
236CONFIG_MATH_EMULATION=y 252CONFIG_MATH_EMULATION=y
237# CONFIG_IOMMU_HELPER is not set 253# CONFIG_IOMMU_HELPER is not set
254# CONFIG_SWIOTLB is not set
238CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y 255CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
239CONFIG_ARCH_HAS_WALK_MEMORY=y 256CONFIG_ARCH_HAS_WALK_MEMORY=y
240CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y 257CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y
@@ -255,9 +272,9 @@ CONFIG_MIGRATION=y
255CONFIG_ZONE_DMA_FLAG=1 272CONFIG_ZONE_DMA_FLAG=1
256CONFIG_BOUNCE=y 273CONFIG_BOUNCE=y
257CONFIG_VIRT_TO_BUS=y 274CONFIG_VIRT_TO_BUS=y
258CONFIG_UNEVICTABLE_LRU=y
259CONFIG_HAVE_MLOCK=y 275CONFIG_HAVE_MLOCK=y
260CONFIG_HAVE_MLOCKED_PAGE_BIT=y 276CONFIG_HAVE_MLOCKED_PAGE_BIT=y
277CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
261CONFIG_PPC_4K_PAGES=y 278CONFIG_PPC_4K_PAGES=y
262# CONFIG_PPC_16K_PAGES is not set 279# CONFIG_PPC_16K_PAGES is not set
263# CONFIG_PPC_64K_PAGES is not set 280# CONFIG_PPC_64K_PAGES is not set
@@ -366,6 +383,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
366# CONFIG_ECONET is not set 383# CONFIG_ECONET is not set
367# CONFIG_WAN_ROUTER is not set 384# CONFIG_WAN_ROUTER is not set
368# CONFIG_PHONET is not set 385# CONFIG_PHONET is not set
386# CONFIG_IEEE802154 is not set
369# CONFIG_NET_SCHED is not set 387# CONFIG_NET_SCHED is not set
370# CONFIG_DCB is not set 388# CONFIG_DCB is not set
371 389
@@ -383,7 +401,11 @@ CONFIG_WIRELESS=y
383CONFIG_WIRELESS_OLD_REGULATORY=y 401CONFIG_WIRELESS_OLD_REGULATORY=y
384# CONFIG_WIRELESS_EXT is not set 402# CONFIG_WIRELESS_EXT is not set
385# CONFIG_LIB80211 is not set 403# CONFIG_LIB80211 is not set
386# CONFIG_MAC80211 is not set 404
405#
406# CFG80211 needs to be enabled for MAC80211
407#
408CONFIG_MAC80211_DEFAULT_PS_VALUE=0
387# CONFIG_WIMAX is not set 409# CONFIG_WIMAX is not set
388# CONFIG_RFKILL is not set 410# CONFIG_RFKILL is not set
389# CONFIG_NET_9P is not set 411# CONFIG_NET_9P is not set
@@ -404,6 +426,7 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y
404# CONFIG_MTD is not set 426# CONFIG_MTD is not set
405CONFIG_OF_DEVICE=y 427CONFIG_OF_DEVICE=y
406CONFIG_OF_I2C=y 428CONFIG_OF_I2C=y
429CONFIG_OF_MDIO=y
407# CONFIG_PARPORT is not set 430# CONFIG_PARPORT is not set
408CONFIG_BLK_DEV=y 431CONFIG_BLK_DEV=y
409# CONFIG_BLK_DEV_FD is not set 432# CONFIG_BLK_DEV_FD is not set
@@ -438,7 +461,9 @@ CONFIG_MISC_DEVICES=y
438# 461#
439# CONFIG_EEPROM_AT24 is not set 462# CONFIG_EEPROM_AT24 is not set
440# CONFIG_EEPROM_LEGACY is not set 463# CONFIG_EEPROM_LEGACY is not set
464# CONFIG_EEPROM_MAX6875 is not set
441# CONFIG_EEPROM_93CX6 is not set 465# CONFIG_EEPROM_93CX6 is not set
466# CONFIG_CB710_CORE is not set
442CONFIG_HAVE_IDE=y 467CONFIG_HAVE_IDE=y
443# CONFIG_IDE is not set 468# CONFIG_IDE is not set
444 469
@@ -461,10 +486,6 @@ CONFIG_SCSI_PROC_FS=y
461# CONFIG_BLK_DEV_SR is not set 486# CONFIG_BLK_DEV_SR is not set
462# CONFIG_CHR_DEV_SG is not set 487# CONFIG_CHR_DEV_SG is not set
463# CONFIG_CHR_DEV_SCH is not set 488# CONFIG_CHR_DEV_SCH is not set
464
465#
466# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
467#
468# CONFIG_SCSI_MULTI_LUN is not set 489# CONFIG_SCSI_MULTI_LUN is not set
469# CONFIG_SCSI_CONSTANTS is not set 490# CONFIG_SCSI_CONSTANTS is not set
470# CONFIG_SCSI_LOGGING is not set 491# CONFIG_SCSI_LOGGING is not set
@@ -482,6 +503,7 @@ CONFIG_SCSI_WAIT_SCAN=m
482CONFIG_SCSI_LOWLEVEL=y 503CONFIG_SCSI_LOWLEVEL=y
483# CONFIG_ISCSI_TCP is not set 504# CONFIG_ISCSI_TCP is not set
484# CONFIG_SCSI_CXGB3_ISCSI is not set 505# CONFIG_SCSI_CXGB3_ISCSI is not set
506# CONFIG_SCSI_BNX2_ISCSI is not set
485# CONFIG_BLK_DEV_3W_XXXX_RAID is not set 507# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
486# CONFIG_SCSI_3W_9XXX is not set 508# CONFIG_SCSI_3W_9XXX is not set
487# CONFIG_SCSI_ACARD is not set 509# CONFIG_SCSI_ACARD is not set
@@ -490,6 +512,7 @@ CONFIG_SCSI_LOWLEVEL=y
490# CONFIG_SCSI_AIC7XXX_OLD is not set 512# CONFIG_SCSI_AIC7XXX_OLD is not set
491# CONFIG_SCSI_AIC79XX is not set 513# CONFIG_SCSI_AIC79XX is not set
492# CONFIG_SCSI_AIC94XX is not set 514# CONFIG_SCSI_AIC94XX is not set
515# CONFIG_SCSI_MVSAS is not set
493# CONFIG_SCSI_DPT_I2O is not set 516# CONFIG_SCSI_DPT_I2O is not set
494# CONFIG_SCSI_ADVANSYS is not set 517# CONFIG_SCSI_ADVANSYS is not set
495# CONFIG_SCSI_ARCMSR is not set 518# CONFIG_SCSI_ARCMSR is not set
@@ -509,7 +532,6 @@ CONFIG_SCSI_LOWLEVEL=y
509# CONFIG_SCSI_IPS is not set 532# CONFIG_SCSI_IPS is not set
510# CONFIG_SCSI_INITIO is not set 533# CONFIG_SCSI_INITIO is not set
511# CONFIG_SCSI_INIA100 is not set 534# CONFIG_SCSI_INIA100 is not set
512# CONFIG_SCSI_MVSAS is not set
513# CONFIG_SCSI_STEX is not set 535# CONFIG_SCSI_STEX is not set
514# CONFIG_SCSI_SYM53C8XX_2 is not set 536# CONFIG_SCSI_SYM53C8XX_2 is not set
515# CONFIG_SCSI_QLOGIC_1280 is not set 537# CONFIG_SCSI_QLOGIC_1280 is not set
@@ -532,14 +554,17 @@ CONFIG_SCSI_LOWLEVEL=y
532# 554#
533 555
534# 556#
535# Enable only one of the two stacks, unless you know what you are doing 557# You can enable one or both FireWire driver stacks.
558#
559
560#
561# See the help texts for more information.
536# 562#
537# CONFIG_FIREWIRE is not set 563# CONFIG_FIREWIRE is not set
538# CONFIG_IEEE1394 is not set 564# CONFIG_IEEE1394 is not set
539# CONFIG_I2O is not set 565# CONFIG_I2O is not set
540# CONFIG_MACINTOSH_DRIVERS is not set 566# CONFIG_MACINTOSH_DRIVERS is not set
541CONFIG_NETDEVICES=y 567CONFIG_NETDEVICES=y
542CONFIG_COMPAT_NET_DEV_OPS=y
543# CONFIG_DUMMY is not set 568# CONFIG_DUMMY is not set
544# CONFIG_BONDING is not set 569# CONFIG_BONDING is not set
545# CONFIG_MACVLAN is not set 570# CONFIG_MACVLAN is not set
@@ -586,6 +611,7 @@ CONFIG_MII=y
586# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set 611# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
587# CONFIG_NET_PCI is not set 612# CONFIG_NET_PCI is not set
588# CONFIG_B44 is not set 613# CONFIG_B44 is not set
614# CONFIG_KS8842 is not set
589# CONFIG_ATL2 is not set 615# CONFIG_ATL2 is not set
590CONFIG_NETDEV_1000=y 616CONFIG_NETDEV_1000=y
591# CONFIG_ACENIC is not set 617# CONFIG_ACENIC is not set
@@ -605,11 +631,13 @@ CONFIG_NETDEV_1000=y
605# CONFIG_VIA_VELOCITY is not set 631# CONFIG_VIA_VELOCITY is not set
606# CONFIG_TIGON3 is not set 632# CONFIG_TIGON3 is not set
607# CONFIG_BNX2 is not set 633# CONFIG_BNX2 is not set
634# CONFIG_CNIC is not set
608CONFIG_FSL_PQ_MDIO=y 635CONFIG_FSL_PQ_MDIO=y
609# CONFIG_GIANFAR is not set 636# CONFIG_GIANFAR is not set
610CONFIG_UCC_GETH=y 637CONFIG_UCC_GETH=y
611# CONFIG_UGETH_MAGIC_PACKET is not set 638# CONFIG_UGETH_MAGIC_PACKET is not set
612# CONFIG_UGETH_TX_ON_DEMAND is not set 639# CONFIG_UGETH_TX_ON_DEMAND is not set
640# CONFIG_MV643XX_ETH is not set
613# CONFIG_QLA3XXX is not set 641# CONFIG_QLA3XXX is not set
614# CONFIG_ATL1 is not set 642# CONFIG_ATL1 is not set
615# CONFIG_ATL1E is not set 643# CONFIG_ATL1E is not set
@@ -787,13 +815,17 @@ CONFIG_I2C_MPC=y
787# CONFIG_SENSORS_PCF8574 is not set 815# CONFIG_SENSORS_PCF8574 is not set
788# CONFIG_PCF8575 is not set 816# CONFIG_PCF8575 is not set
789# CONFIG_SENSORS_PCA9539 is not set 817# CONFIG_SENSORS_PCA9539 is not set
790# CONFIG_SENSORS_MAX6875 is not set
791# CONFIG_SENSORS_TSL2550 is not set 818# CONFIG_SENSORS_TSL2550 is not set
792# CONFIG_I2C_DEBUG_CORE is not set 819# CONFIG_I2C_DEBUG_CORE is not set
793# CONFIG_I2C_DEBUG_ALGO is not set 820# CONFIG_I2C_DEBUG_ALGO is not set
794# CONFIG_I2C_DEBUG_BUS is not set 821# CONFIG_I2C_DEBUG_BUS is not set
795# CONFIG_I2C_DEBUG_CHIP is not set 822# CONFIG_I2C_DEBUG_CHIP is not set
796# CONFIG_SPI is not set 823# CONFIG_SPI is not set
824
825#
826# PPS support
827#
828# CONFIG_PPS is not set
797CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y 829CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
798# CONFIG_GPIOLIB is not set 830# CONFIG_GPIOLIB is not set
799# CONFIG_W1 is not set 831# CONFIG_W1 is not set
@@ -848,6 +880,7 @@ CONFIG_HWMON=y
848# CONFIG_SENSORS_SMSC47B397 is not set 880# CONFIG_SENSORS_SMSC47B397 is not set
849# CONFIG_SENSORS_ADS7828 is not set 881# CONFIG_SENSORS_ADS7828 is not set
850# CONFIG_SENSORS_THMC50 is not set 882# CONFIG_SENSORS_THMC50 is not set
883# CONFIG_SENSORS_TMP401 is not set
851# CONFIG_SENSORS_VIA686A is not set 884# CONFIG_SENSORS_VIA686A is not set
852# CONFIG_SENSORS_VT1211 is not set 885# CONFIG_SENSORS_VT1211 is not set
853# CONFIG_SENSORS_VT8231 is not set 886# CONFIG_SENSORS_VT8231 is not set
@@ -896,23 +929,9 @@ CONFIG_SSB_POSSIBLE=y
896# CONFIG_MFD_WM8400 is not set 929# CONFIG_MFD_WM8400 is not set
897# CONFIG_MFD_WM8350_I2C is not set 930# CONFIG_MFD_WM8350_I2C is not set
898# CONFIG_MFD_PCF50633 is not set 931# CONFIG_MFD_PCF50633 is not set
932# CONFIG_AB3100_CORE is not set
899# CONFIG_REGULATOR is not set 933# CONFIG_REGULATOR is not set
900 934# CONFIG_MEDIA_SUPPORT is not set
901#
902# Multimedia devices
903#
904
905#
906# Multimedia core support
907#
908# CONFIG_VIDEO_DEV is not set
909# CONFIG_DVB_CORE is not set
910# CONFIG_VIDEO_MEDIA is not set
911
912#
913# Multimedia drivers
914#
915CONFIG_DAB=y
916 935
917# 936#
918# Graphics support 937# Graphics support
@@ -996,6 +1015,7 @@ CONFIG_RTC_DRV_DS1374=y
996# CONFIG_RTC_DRV_S35390A is not set 1015# CONFIG_RTC_DRV_S35390A is not set
997# CONFIG_RTC_DRV_FM3130 is not set 1016# CONFIG_RTC_DRV_FM3130 is not set
998# CONFIG_RTC_DRV_RX8581 is not set 1017# CONFIG_RTC_DRV_RX8581 is not set
1018# CONFIG_RTC_DRV_RX8025 is not set
999 1019
1000# 1020#
1001# SPI RTC drivers 1021# SPI RTC drivers
@@ -1023,6 +1043,10 @@ CONFIG_RTC_DRV_DS1374=y
1023# CONFIG_DMADEVICES is not set 1043# CONFIG_DMADEVICES is not set
1024# CONFIG_AUXDISPLAY is not set 1044# CONFIG_AUXDISPLAY is not set
1025# CONFIG_UIO is not set 1045# CONFIG_UIO is not set
1046
1047#
1048# TI VLYNQ
1049#
1026# CONFIG_STAGING is not set 1050# CONFIG_STAGING is not set
1027 1051
1028# 1052#
@@ -1042,10 +1066,12 @@ CONFIG_FS_MBCACHE=y
1042# CONFIG_REISERFS_FS is not set 1066# CONFIG_REISERFS_FS is not set
1043# CONFIG_JFS_FS is not set 1067# CONFIG_JFS_FS is not set
1044# CONFIG_FS_POSIX_ACL is not set 1068# CONFIG_FS_POSIX_ACL is not set
1045CONFIG_FILE_LOCKING=y
1046# CONFIG_XFS_FS is not set 1069# CONFIG_XFS_FS is not set
1070# CONFIG_GFS2_FS is not set
1047# CONFIG_OCFS2_FS is not set 1071# CONFIG_OCFS2_FS is not set
1048# CONFIG_BTRFS_FS is not set 1072# CONFIG_BTRFS_FS is not set
1073CONFIG_FILE_LOCKING=y
1074CONFIG_FSNOTIFY=y
1049CONFIG_DNOTIFY=y 1075CONFIG_DNOTIFY=y
1050CONFIG_INOTIFY=y 1076CONFIG_INOTIFY=y
1051CONFIG_INOTIFY_USER=y 1077CONFIG_INOTIFY_USER=y
@@ -1108,6 +1134,7 @@ CONFIG_NFS_FS=y
1108CONFIG_NFS_V3=y 1134CONFIG_NFS_V3=y
1109# CONFIG_NFS_V3_ACL is not set 1135# CONFIG_NFS_V3_ACL is not set
1110CONFIG_NFS_V4=y 1136CONFIG_NFS_V4=y
1137# CONFIG_NFS_V4_1 is not set
1111CONFIG_ROOT_NFS=y 1138CONFIG_ROOT_NFS=y
1112# CONFIG_NFSD is not set 1139# CONFIG_NFSD is not set
1113CONFIG_LOCKD=y 1140CONFIG_LOCKD=y
@@ -1165,6 +1192,7 @@ CONFIG_HAS_IOPORT=y
1165CONFIG_HAS_DMA=y 1192CONFIG_HAS_DMA=y
1166CONFIG_HAVE_LMB=y 1193CONFIG_HAVE_LMB=y
1167CONFIG_NLATTR=y 1194CONFIG_NLATTR=y
1195CONFIG_GENERIC_ATOMIC64=y
1168 1196
1169# 1197#
1170# Kernel hacking 1198# Kernel hacking
@@ -1190,22 +1218,11 @@ CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
1190CONFIG_HAVE_DYNAMIC_FTRACE=y 1218CONFIG_HAVE_DYNAMIC_FTRACE=y
1191CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y 1219CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
1192CONFIG_TRACING_SUPPORT=y 1220CONFIG_TRACING_SUPPORT=y
1193 1221# CONFIG_FTRACE is not set
1194#
1195# Tracers
1196#
1197# CONFIG_FUNCTION_TRACER is not set
1198# CONFIG_SCHED_TRACER is not set
1199# CONFIG_CONTEXT_SWITCH_TRACER is not set
1200# CONFIG_EVENT_TRACER is not set
1201# CONFIG_BOOT_TRACER is not set
1202# CONFIG_TRACE_BRANCH_PROFILING is not set
1203# CONFIG_STACK_TRACER is not set
1204# CONFIG_KMEMTRACE is not set
1205# CONFIG_WORKQUEUE_TRACER is not set
1206# CONFIG_BLK_DEV_IO_TRACE is not set
1207# CONFIG_SAMPLES is not set 1222# CONFIG_SAMPLES is not set
1208CONFIG_HAVE_ARCH_KGDB=y 1223CONFIG_HAVE_ARCH_KGDB=y
1224# CONFIG_PPC_DISABLE_WERROR is not set
1225CONFIG_PPC_WERROR=y
1209CONFIG_PRINT_STACK_DEPTH=64 1226CONFIG_PRINT_STACK_DEPTH=64
1210# CONFIG_IRQSTACKS is not set 1227# CONFIG_IRQSTACKS is not set
1211# CONFIG_BOOTX_TEXT is not set 1228# CONFIG_BOOTX_TEXT is not set
diff --git a/arch/powerpc/configs/83xx/mpc832x_rdb_defconfig b/arch/powerpc/configs/83xx/mpc832x_rdb_defconfig
index 227dbba76795..4f27d4548223 100644
--- a/arch/powerpc/configs/83xx/mpc832x_rdb_defconfig
+++ b/arch/powerpc/configs/83xx/mpc832x_rdb_defconfig
@@ -1,26 +1,28 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.30-rc3 3# Linux kernel version: 2.6.31-rc4
4# Wed May 13 17:22:08 2009 4# Wed Jul 29 23:32:07 2009
5# 5#
6# CONFIG_PPC64 is not set 6# CONFIG_PPC64 is not set
7 7
8# 8#
9# Processor support 9# Processor support
10# 10#
11CONFIG_6xx=y 11CONFIG_PPC_BOOK3S_32=y
12# CONFIG_PPC_85xx is not set 12# CONFIG_PPC_85xx is not set
13# CONFIG_PPC_8xx is not set 13# CONFIG_PPC_8xx is not set
14# CONFIG_40x is not set 14# CONFIG_40x is not set
15# CONFIG_44x is not set 15# CONFIG_44x is not set
16# CONFIG_E200 is not set 16# CONFIG_E200 is not set
17CONFIG_PPC_BOOK3S=y 17CONFIG_PPC_BOOK3S=y
18CONFIG_6xx=y
18CONFIG_PPC_FPU=y 19CONFIG_PPC_FPU=y
19# CONFIG_FSL_EMB_PERFMON is not set 20# CONFIG_FSL_EMB_PERFMON is not set
20# CONFIG_ALTIVEC is not set 21# CONFIG_ALTIVEC is not set
21CONFIG_PPC_STD_MMU=y 22CONFIG_PPC_STD_MMU=y
22CONFIG_PPC_STD_MMU_32=y 23CONFIG_PPC_STD_MMU_32=y
23# CONFIG_PPC_MM_SLICES is not set 24# CONFIG_PPC_MM_SLICES is not set
25CONFIG_PPC_HAVE_PMU_SUPPORT=y
24# CONFIG_SMP is not set 26# CONFIG_SMP is not set
25CONFIG_PPC32=y 27CONFIG_PPC32=y
26CONFIG_WORD_SIZE=32 28CONFIG_WORD_SIZE=32
@@ -31,15 +33,16 @@ CONFIG_GENERIC_TIME=y
31CONFIG_GENERIC_TIME_VSYSCALL=y 33CONFIG_GENERIC_TIME_VSYSCALL=y
32CONFIG_GENERIC_CLOCKEVENTS=y 34CONFIG_GENERIC_CLOCKEVENTS=y
33CONFIG_GENERIC_HARDIRQS=y 35CONFIG_GENERIC_HARDIRQS=y
36CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
34# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set 37# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set
35CONFIG_IRQ_PER_CPU=y 38CONFIG_IRQ_PER_CPU=y
36CONFIG_STACKTRACE_SUPPORT=y 39CONFIG_STACKTRACE_SUPPORT=y
37CONFIG_HAVE_LATENCYTOP_SUPPORT=y 40CONFIG_HAVE_LATENCYTOP_SUPPORT=y
41CONFIG_TRACE_IRQFLAGS_SUPPORT=y
38CONFIG_LOCKDEP_SUPPORT=y 42CONFIG_LOCKDEP_SUPPORT=y
39CONFIG_RWSEM_XCHGADD_ALGORITHM=y 43CONFIG_RWSEM_XCHGADD_ALGORITHM=y
40CONFIG_ARCH_HAS_ILOG2_U32=y 44CONFIG_ARCH_HAS_ILOG2_U32=y
41CONFIG_GENERIC_HWEIGHT=y 45CONFIG_GENERIC_HWEIGHT=y
42CONFIG_GENERIC_CALIBRATE_DELAY=y
43CONFIG_GENERIC_FIND_NEXT_BIT=y 46CONFIG_GENERIC_FIND_NEXT_BIT=y
44# CONFIG_ARCH_NO_VIRT_TO_BUS is not set 47# CONFIG_ARCH_NO_VIRT_TO_BUS is not set
45CONFIG_PPC=y 48CONFIG_PPC=y
@@ -53,12 +56,14 @@ CONFIG_PPC_UDBG_16550=y
53# CONFIG_GENERIC_TBSYNC is not set 56# CONFIG_GENERIC_TBSYNC is not set
54CONFIG_AUDIT_ARCH=y 57CONFIG_AUDIT_ARCH=y
55CONFIG_GENERIC_BUG=y 58CONFIG_GENERIC_BUG=y
59CONFIG_DTC=y
56CONFIG_DEFAULT_UIMAGE=y 60CONFIG_DEFAULT_UIMAGE=y
57CONFIG_ARCH_SUSPEND_POSSIBLE=y 61CONFIG_ARCH_SUSPEND_POSSIBLE=y
58# CONFIG_PPC_DCR_NATIVE is not set 62# CONFIG_PPC_DCR_NATIVE is not set
59# CONFIG_PPC_DCR_MMIO is not set 63# CONFIG_PPC_DCR_MMIO is not set
60CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y 64CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y
61CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" 65CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
66CONFIG_CONSTRUCTORS=y
62 67
63# 68#
64# General setup 69# General setup
@@ -107,7 +112,6 @@ CONFIG_ANON_INODES=y
107CONFIG_EMBEDDED=y 112CONFIG_EMBEDDED=y
108CONFIG_SYSCTL_SYSCALL=y 113CONFIG_SYSCTL_SYSCALL=y
109# CONFIG_KALLSYMS is not set 114# CONFIG_KALLSYMS is not set
110# CONFIG_STRIP_ASM_SYMS is not set
111CONFIG_HOTPLUG=y 115CONFIG_HOTPLUG=y
112CONFIG_PRINTK=y 116CONFIG_PRINTK=y
113CONFIG_BUG=y 117CONFIG_BUG=y
@@ -120,9 +124,16 @@ CONFIG_TIMERFD=y
120CONFIG_EVENTFD=y 124CONFIG_EVENTFD=y
121CONFIG_SHMEM=y 125CONFIG_SHMEM=y
122CONFIG_AIO=y 126CONFIG_AIO=y
127CONFIG_HAVE_PERF_COUNTERS=y
128
129#
130# Performance Counters
131#
132# CONFIG_PERF_COUNTERS is not set
123CONFIG_VM_EVENT_COUNTERS=y 133CONFIG_VM_EVENT_COUNTERS=y
124CONFIG_PCI_QUIRKS=y 134CONFIG_PCI_QUIRKS=y
125CONFIG_SLUB_DEBUG=y 135CONFIG_SLUB_DEBUG=y
136# CONFIG_STRIP_ASM_SYMS is not set
126CONFIG_COMPAT_BRK=y 137CONFIG_COMPAT_BRK=y
127# CONFIG_SLAB is not set 138# CONFIG_SLAB is not set
128CONFIG_SLUB=y 139CONFIG_SLUB=y
@@ -135,6 +146,10 @@ CONFIG_HAVE_IOREMAP_PROT=y
135CONFIG_HAVE_KPROBES=y 146CONFIG_HAVE_KPROBES=y
136CONFIG_HAVE_KRETPROBES=y 147CONFIG_HAVE_KRETPROBES=y
137CONFIG_HAVE_ARCH_TRACEHOOK=y 148CONFIG_HAVE_ARCH_TRACEHOOK=y
149
150#
151# GCOV-based kernel profiling
152#
138# CONFIG_SLOW_WORK is not set 153# CONFIG_SLOW_WORK is not set
139# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set 154# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
140CONFIG_SLABINFO=y 155CONFIG_SLABINFO=y
@@ -147,7 +162,7 @@ CONFIG_MODULE_UNLOAD=y
147# CONFIG_MODVERSIONS is not set 162# CONFIG_MODVERSIONS is not set
148# CONFIG_MODULE_SRCVERSION_ALL is not set 163# CONFIG_MODULE_SRCVERSION_ALL is not set
149CONFIG_BLOCK=y 164CONFIG_BLOCK=y
150# CONFIG_LBD is not set 165CONFIG_LBDAF=y
151# CONFIG_BLK_DEV_BSG is not set 166# CONFIG_BLK_DEV_BSG is not set
152# CONFIG_BLK_DEV_INTEGRITY is not set 167# CONFIG_BLK_DEV_INTEGRITY is not set
153 168
@@ -189,6 +204,7 @@ CONFIG_MPC832x_RDB=y
189# CONFIG_MPC837x_RDB is not set 204# CONFIG_MPC837x_RDB is not set
190# CONFIG_SBC834x is not set 205# CONFIG_SBC834x is not set
191# CONFIG_ASP834x is not set 206# CONFIG_ASP834x is not set
207# CONFIG_KMETER1 is not set
192CONFIG_PPC_MPC832x=y 208CONFIG_PPC_MPC832x=y
193# CONFIG_PPC_86xx is not set 209# CONFIG_PPC_86xx is not set
194# CONFIG_EMBEDDED6xx is not set 210# CONFIG_EMBEDDED6xx is not set
@@ -235,6 +251,7 @@ CONFIG_BINFMT_ELF=y
235# CONFIG_BINFMT_MISC is not set 251# CONFIG_BINFMT_MISC is not set
236CONFIG_MATH_EMULATION=y 252CONFIG_MATH_EMULATION=y
237# CONFIG_IOMMU_HELPER is not set 253# CONFIG_IOMMU_HELPER is not set
254# CONFIG_SWIOTLB is not set
238CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y 255CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
239CONFIG_ARCH_HAS_WALK_MEMORY=y 256CONFIG_ARCH_HAS_WALK_MEMORY=y
240CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y 257CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y
@@ -255,9 +272,9 @@ CONFIG_MIGRATION=y
255CONFIG_ZONE_DMA_FLAG=1 272CONFIG_ZONE_DMA_FLAG=1
256CONFIG_BOUNCE=y 273CONFIG_BOUNCE=y
257CONFIG_VIRT_TO_BUS=y 274CONFIG_VIRT_TO_BUS=y
258CONFIG_UNEVICTABLE_LRU=y
259CONFIG_HAVE_MLOCK=y 275CONFIG_HAVE_MLOCK=y
260CONFIG_HAVE_MLOCKED_PAGE_BIT=y 276CONFIG_HAVE_MLOCKED_PAGE_BIT=y
277CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
261CONFIG_PPC_4K_PAGES=y 278CONFIG_PPC_4K_PAGES=y
262# CONFIG_PPC_16K_PAGES is not set 279# CONFIG_PPC_16K_PAGES is not set
263# CONFIG_PPC_64K_PAGES is not set 280# CONFIG_PPC_64K_PAGES is not set
@@ -366,6 +383,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
366# CONFIG_ECONET is not set 383# CONFIG_ECONET is not set
367# CONFIG_WAN_ROUTER is not set 384# CONFIG_WAN_ROUTER is not set
368# CONFIG_PHONET is not set 385# CONFIG_PHONET is not set
386# CONFIG_IEEE802154 is not set
369# CONFIG_NET_SCHED is not set 387# CONFIG_NET_SCHED is not set
370# CONFIG_DCB is not set 388# CONFIG_DCB is not set
371 389
@@ -383,7 +401,11 @@ CONFIG_WIRELESS=y
383CONFIG_WIRELESS_OLD_REGULATORY=y 401CONFIG_WIRELESS_OLD_REGULATORY=y
384# CONFIG_WIRELESS_EXT is not set 402# CONFIG_WIRELESS_EXT is not set
385# CONFIG_LIB80211 is not set 403# CONFIG_LIB80211 is not set
386# CONFIG_MAC80211 is not set 404
405#
406# CFG80211 needs to be enabled for MAC80211
407#
408CONFIG_MAC80211_DEFAULT_PS_VALUE=0
387# CONFIG_WIMAX is not set 409# CONFIG_WIMAX is not set
388# CONFIG_RFKILL is not set 410# CONFIG_RFKILL is not set
389# CONFIG_NET_9P is not set 411# CONFIG_NET_9P is not set
@@ -405,6 +427,7 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y
405CONFIG_OF_DEVICE=y 427CONFIG_OF_DEVICE=y
406CONFIG_OF_I2C=y 428CONFIG_OF_I2C=y
407CONFIG_OF_SPI=y 429CONFIG_OF_SPI=y
430CONFIG_OF_MDIO=y
408# CONFIG_PARPORT is not set 431# CONFIG_PARPORT is not set
409CONFIG_BLK_DEV=y 432CONFIG_BLK_DEV=y
410# CONFIG_BLK_DEV_FD is not set 433# CONFIG_BLK_DEV_FD is not set
@@ -441,7 +464,9 @@ CONFIG_MISC_DEVICES=y
441# CONFIG_EEPROM_AT24 is not set 464# CONFIG_EEPROM_AT24 is not set
442# CONFIG_EEPROM_AT25 is not set 465# CONFIG_EEPROM_AT25 is not set
443# CONFIG_EEPROM_LEGACY is not set 466# CONFIG_EEPROM_LEGACY is not set
467# CONFIG_EEPROM_MAX6875 is not set
444# CONFIG_EEPROM_93CX6 is not set 468# CONFIG_EEPROM_93CX6 is not set
469# CONFIG_CB710_CORE is not set
445CONFIG_HAVE_IDE=y 470CONFIG_HAVE_IDE=y
446# CONFIG_IDE is not set 471# CONFIG_IDE is not set
447 472
@@ -464,10 +489,6 @@ CONFIG_BLK_DEV_SD=y
464# CONFIG_BLK_DEV_SR is not set 489# CONFIG_BLK_DEV_SR is not set
465# CONFIG_CHR_DEV_SG is not set 490# CONFIG_CHR_DEV_SG is not set
466# CONFIG_CHR_DEV_SCH is not set 491# CONFIG_CHR_DEV_SCH is not set
467
468#
469# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
470#
471# CONFIG_SCSI_MULTI_LUN is not set 492# CONFIG_SCSI_MULTI_LUN is not set
472# CONFIG_SCSI_CONSTANTS is not set 493# CONFIG_SCSI_CONSTANTS is not set
473# CONFIG_SCSI_LOGGING is not set 494# CONFIG_SCSI_LOGGING is not set
@@ -485,6 +506,7 @@ CONFIG_SCSI_WAIT_SCAN=m
485CONFIG_SCSI_LOWLEVEL=y 506CONFIG_SCSI_LOWLEVEL=y
486# CONFIG_ISCSI_TCP is not set 507# CONFIG_ISCSI_TCP is not set
487# CONFIG_SCSI_CXGB3_ISCSI is not set 508# CONFIG_SCSI_CXGB3_ISCSI is not set
509# CONFIG_SCSI_BNX2_ISCSI is not set
488# CONFIG_BLK_DEV_3W_XXXX_RAID is not set 510# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
489# CONFIG_SCSI_3W_9XXX is not set 511# CONFIG_SCSI_3W_9XXX is not set
490# CONFIG_SCSI_ACARD is not set 512# CONFIG_SCSI_ACARD is not set
@@ -493,6 +515,7 @@ CONFIG_SCSI_LOWLEVEL=y
493# CONFIG_SCSI_AIC7XXX_OLD is not set 515# CONFIG_SCSI_AIC7XXX_OLD is not set
494# CONFIG_SCSI_AIC79XX is not set 516# CONFIG_SCSI_AIC79XX is not set
495# CONFIG_SCSI_AIC94XX is not set 517# CONFIG_SCSI_AIC94XX is not set
518# CONFIG_SCSI_MVSAS is not set
496# CONFIG_SCSI_DPT_I2O is not set 519# CONFIG_SCSI_DPT_I2O is not set
497# CONFIG_SCSI_ADVANSYS is not set 520# CONFIG_SCSI_ADVANSYS is not set
498# CONFIG_SCSI_ARCMSR is not set 521# CONFIG_SCSI_ARCMSR is not set
@@ -512,7 +535,6 @@ CONFIG_SCSI_LOWLEVEL=y
512# CONFIG_SCSI_IPS is not set 535# CONFIG_SCSI_IPS is not set
513# CONFIG_SCSI_INITIO is not set 536# CONFIG_SCSI_INITIO is not set
514# CONFIG_SCSI_INIA100 is not set 537# CONFIG_SCSI_INIA100 is not set
515# CONFIG_SCSI_MVSAS is not set
516# CONFIG_SCSI_STEX is not set 538# CONFIG_SCSI_STEX is not set
517# CONFIG_SCSI_SYM53C8XX_2 is not set 539# CONFIG_SCSI_SYM53C8XX_2 is not set
518# CONFIG_SCSI_QLOGIC_1280 is not set 540# CONFIG_SCSI_QLOGIC_1280 is not set
@@ -535,14 +557,17 @@ CONFIG_SCSI_LOWLEVEL=y
535# 557#
536 558
537# 559#
538# Enable only one of the two stacks, unless you know what you are doing 560# You can enable one or both FireWire driver stacks.
561#
562
563#
564# See the help texts for more information.
539# 565#
540# CONFIG_FIREWIRE is not set 566# CONFIG_FIREWIRE is not set
541# CONFIG_IEEE1394 is not set 567# CONFIG_IEEE1394 is not set
542# CONFIG_I2O is not set 568# CONFIG_I2O is not set
543# CONFIG_MACINTOSH_DRIVERS is not set 569# CONFIG_MACINTOSH_DRIVERS is not set
544CONFIG_NETDEVICES=y 570CONFIG_NETDEVICES=y
545CONFIG_COMPAT_NET_DEV_OPS=y
546# CONFIG_DUMMY is not set 571# CONFIG_DUMMY is not set
547# CONFIG_BONDING is not set 572# CONFIG_BONDING is not set
548# CONFIG_MACVLAN is not set 573# CONFIG_MACVLAN is not set
@@ -590,6 +615,8 @@ CONFIG_MII=y
590# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set 615# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
591# CONFIG_NET_PCI is not set 616# CONFIG_NET_PCI is not set
592# CONFIG_B44 is not set 617# CONFIG_B44 is not set
618# CONFIG_KS8842 is not set
619# CONFIG_KS8851 is not set
593# CONFIG_ATL2 is not set 620# CONFIG_ATL2 is not set
594CONFIG_NETDEV_1000=y 621CONFIG_NETDEV_1000=y
595# CONFIG_ACENIC is not set 622# CONFIG_ACENIC is not set
@@ -609,11 +636,13 @@ CONFIG_E1000=y
609# CONFIG_VIA_VELOCITY is not set 636# CONFIG_VIA_VELOCITY is not set
610# CONFIG_TIGON3 is not set 637# CONFIG_TIGON3 is not set
611# CONFIG_BNX2 is not set 638# CONFIG_BNX2 is not set
639# CONFIG_CNIC is not set
612CONFIG_FSL_PQ_MDIO=y 640CONFIG_FSL_PQ_MDIO=y
613# CONFIG_GIANFAR is not set 641# CONFIG_GIANFAR is not set
614CONFIG_UCC_GETH=y 642CONFIG_UCC_GETH=y
615# CONFIG_UGETH_MAGIC_PACKET is not set 643# CONFIG_UGETH_MAGIC_PACKET is not set
616# CONFIG_UGETH_TX_ON_DEMAND is not set 644# CONFIG_UGETH_TX_ON_DEMAND is not set
645# CONFIG_MV643XX_ETH is not set
617# CONFIG_QLA3XXX is not set 646# CONFIG_QLA3XXX is not set
618# CONFIG_ATL1 is not set 647# CONFIG_ATL1 is not set
619# CONFIG_ATL1E is not set 648# CONFIG_ATL1E is not set
@@ -804,7 +833,6 @@ CONFIG_I2C_MPC=y
804# CONFIG_SENSORS_PCF8574 is not set 833# CONFIG_SENSORS_PCF8574 is not set
805# CONFIG_PCF8575 is not set 834# CONFIG_PCF8575 is not set
806# CONFIG_SENSORS_PCA9539 is not set 835# CONFIG_SENSORS_PCA9539 is not set
807# CONFIG_SENSORS_MAX6875 is not set
808# CONFIG_SENSORS_TSL2550 is not set 836# CONFIG_SENSORS_TSL2550 is not set
809# CONFIG_I2C_DEBUG_CORE is not set 837# CONFIG_I2C_DEBUG_CORE is not set
810# CONFIG_I2C_DEBUG_ALGO is not set 838# CONFIG_I2C_DEBUG_ALGO is not set
@@ -817,13 +845,18 @@ CONFIG_SPI_MASTER=y
817# SPI Master Controller Drivers 845# SPI Master Controller Drivers
818# 846#
819CONFIG_SPI_BITBANG=y 847CONFIG_SPI_BITBANG=y
820CONFIG_SPI_MPC83xx=y 848# CONFIG_SPI_MPC8xxx is not set
821 849
822# 850#
823# SPI Protocol Masters 851# SPI Protocol Masters
824# 852#
825# CONFIG_SPI_SPIDEV is not set 853# CONFIG_SPI_SPIDEV is not set
826# CONFIG_SPI_TLE62X0 is not set 854# CONFIG_SPI_TLE62X0 is not set
855
856#
857# PPS support
858#
859# CONFIG_PPS is not set
827CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y 860CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
828# CONFIG_GPIOLIB is not set 861# CONFIG_GPIOLIB is not set
829# CONFIG_W1 is not set 862# CONFIG_W1 is not set
@@ -881,6 +914,7 @@ CONFIG_HWMON=y
881# CONFIG_SENSORS_SMSC47B397 is not set 914# CONFIG_SENSORS_SMSC47B397 is not set
882# CONFIG_SENSORS_ADS7828 is not set 915# CONFIG_SENSORS_ADS7828 is not set
883# CONFIG_SENSORS_THMC50 is not set 916# CONFIG_SENSORS_THMC50 is not set
917# CONFIG_SENSORS_TMP401 is not set
884# CONFIG_SENSORS_VIA686A is not set 918# CONFIG_SENSORS_VIA686A is not set
885# CONFIG_SENSORS_VT1211 is not set 919# CONFIG_SENSORS_VT1211 is not set
886# CONFIG_SENSORS_VT8231 is not set 920# CONFIG_SENSORS_VT8231 is not set
@@ -935,24 +969,10 @@ CONFIG_SSB_POSSIBLE=y
935# CONFIG_MFD_WM8400 is not set 969# CONFIG_MFD_WM8400 is not set
936# CONFIG_MFD_WM8350_I2C is not set 970# CONFIG_MFD_WM8350_I2C is not set
937# CONFIG_MFD_PCF50633 is not set 971# CONFIG_MFD_PCF50633 is not set
972# CONFIG_AB3100_CORE is not set
973# CONFIG_EZX_PCAP is not set
938# CONFIG_REGULATOR is not set 974# CONFIG_REGULATOR is not set
939 975# CONFIG_MEDIA_SUPPORT is not set
940#
941# Multimedia devices
942#
943
944#
945# Multimedia core support
946#
947# CONFIG_VIDEO_DEV is not set
948# CONFIG_DVB_CORE is not set
949# CONFIG_VIDEO_MEDIA is not set
950
951#
952# Multimedia drivers
953#
954CONFIG_DAB=y
955# CONFIG_USB_DABUSB is not set
956 976
957# 977#
958# Graphics support 978# Graphics support
@@ -1014,6 +1034,7 @@ CONFIG_USB_MON=y
1014# USB Host Controller Drivers 1034# USB Host Controller Drivers
1015# 1035#
1016# CONFIG_USB_C67X00_HCD is not set 1036# CONFIG_USB_C67X00_HCD is not set
1037# CONFIG_USB_XHCI_HCD is not set
1017CONFIG_USB_EHCI_HCD=y 1038CONFIG_USB_EHCI_HCD=y
1018# CONFIG_USB_EHCI_ROOT_HUB_TT is not set 1039# CONFIG_USB_EHCI_ROOT_HUB_TT is not set
1019# CONFIG_USB_EHCI_TT_NEWSCHED is not set 1040# CONFIG_USB_EHCI_TT_NEWSCHED is not set
@@ -1023,9 +1044,9 @@ CONFIG_USB_EHCI_HCD_PPC_OF=y
1023# CONFIG_USB_ISP116X_HCD is not set 1044# CONFIG_USB_ISP116X_HCD is not set
1024# CONFIG_USB_ISP1760_HCD is not set 1045# CONFIG_USB_ISP1760_HCD is not set
1025CONFIG_USB_OHCI_HCD=y 1046CONFIG_USB_OHCI_HCD=y
1026CONFIG_USB_OHCI_HCD_PPC_OF=y
1027CONFIG_USB_OHCI_HCD_PPC_OF_BE=y 1047CONFIG_USB_OHCI_HCD_PPC_OF_BE=y
1028# CONFIG_USB_OHCI_HCD_PPC_OF_LE is not set 1048# CONFIG_USB_OHCI_HCD_PPC_OF_LE is not set
1049CONFIG_USB_OHCI_HCD_PPC_OF=y
1029CONFIG_USB_OHCI_HCD_PCI=y 1050CONFIG_USB_OHCI_HCD_PCI=y
1030CONFIG_USB_OHCI_BIG_ENDIAN_DESC=y 1051CONFIG_USB_OHCI_BIG_ENDIAN_DESC=y
1031CONFIG_USB_OHCI_BIG_ENDIAN_MMIO=y 1052CONFIG_USB_OHCI_BIG_ENDIAN_MMIO=y
@@ -1127,6 +1148,8 @@ CONFIG_MMC_BLOCK_BOUNCE=y
1127# CONFIG_MMC_WBSD is not set 1148# CONFIG_MMC_WBSD is not set
1128# CONFIG_MMC_TIFM_SD is not set 1149# CONFIG_MMC_TIFM_SD is not set
1129CONFIG_MMC_SPI=y 1150CONFIG_MMC_SPI=y
1151# CONFIG_MMC_CB710 is not set
1152# CONFIG_MMC_VIA_SDMMC is not set
1130# CONFIG_MEMSTICK is not set 1153# CONFIG_MEMSTICK is not set
1131# CONFIG_NEW_LEDS is not set 1154# CONFIG_NEW_LEDS is not set
1132# CONFIG_ACCESSIBILITY is not set 1155# CONFIG_ACCESSIBILITY is not set
@@ -1136,6 +1159,10 @@ CONFIG_MMC_SPI=y
1136# CONFIG_DMADEVICES is not set 1159# CONFIG_DMADEVICES is not set
1137# CONFIG_AUXDISPLAY is not set 1160# CONFIG_AUXDISPLAY is not set
1138# CONFIG_UIO is not set 1161# CONFIG_UIO is not set
1162
1163#
1164# TI VLYNQ
1165#
1139# CONFIG_STAGING is not set 1166# CONFIG_STAGING is not set
1140 1167
1141# 1168#
@@ -1155,10 +1182,12 @@ CONFIG_FS_MBCACHE=y
1155# CONFIG_REISERFS_FS is not set 1182# CONFIG_REISERFS_FS is not set
1156# CONFIG_JFS_FS is not set 1183# CONFIG_JFS_FS is not set
1157# CONFIG_FS_POSIX_ACL is not set 1184# CONFIG_FS_POSIX_ACL is not set
1158CONFIG_FILE_LOCKING=y
1159# CONFIG_XFS_FS is not set 1185# CONFIG_XFS_FS is not set
1186# CONFIG_GFS2_FS is not set
1160# CONFIG_OCFS2_FS is not set 1187# CONFIG_OCFS2_FS is not set
1161# CONFIG_BTRFS_FS is not set 1188# CONFIG_BTRFS_FS is not set
1189CONFIG_FILE_LOCKING=y
1190CONFIG_FSNOTIFY=y
1162CONFIG_DNOTIFY=y 1191CONFIG_DNOTIFY=y
1163CONFIG_INOTIFY=y 1192CONFIG_INOTIFY=y
1164CONFIG_INOTIFY_USER=y 1193CONFIG_INOTIFY_USER=y
@@ -1224,6 +1253,7 @@ CONFIG_NFS_FS=y
1224CONFIG_NFS_V3=y 1253CONFIG_NFS_V3=y
1225# CONFIG_NFS_V3_ACL is not set 1254# CONFIG_NFS_V3_ACL is not set
1226CONFIG_NFS_V4=y 1255CONFIG_NFS_V4=y
1256# CONFIG_NFS_V4_1 is not set
1227CONFIG_ROOT_NFS=y 1257CONFIG_ROOT_NFS=y
1228# CONFIG_NFSD is not set 1258# CONFIG_NFSD is not set
1229CONFIG_LOCKD=y 1259CONFIG_LOCKD=y
@@ -1325,6 +1355,7 @@ CONFIG_HAS_IOPORT=y
1325CONFIG_HAS_DMA=y 1355CONFIG_HAS_DMA=y
1326CONFIG_HAVE_LMB=y 1356CONFIG_HAVE_LMB=y
1327CONFIG_NLATTR=y 1357CONFIG_NLATTR=y
1358CONFIG_GENERIC_ATOMIC64=y
1328 1359
1329# 1360#
1330# Kernel hacking 1361# Kernel hacking
@@ -1350,22 +1381,11 @@ CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
1350CONFIG_HAVE_DYNAMIC_FTRACE=y 1381CONFIG_HAVE_DYNAMIC_FTRACE=y
1351CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y 1382CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
1352CONFIG_TRACING_SUPPORT=y 1383CONFIG_TRACING_SUPPORT=y
1353 1384# CONFIG_FTRACE is not set
1354#
1355# Tracers
1356#
1357# CONFIG_FUNCTION_TRACER is not set
1358# CONFIG_SCHED_TRACER is not set
1359# CONFIG_CONTEXT_SWITCH_TRACER is not set
1360# CONFIG_EVENT_TRACER is not set
1361# CONFIG_BOOT_TRACER is not set
1362# CONFIG_TRACE_BRANCH_PROFILING is not set
1363# CONFIG_STACK_TRACER is not set
1364# CONFIG_KMEMTRACE is not set
1365# CONFIG_WORKQUEUE_TRACER is not set
1366# CONFIG_BLK_DEV_IO_TRACE is not set
1367# CONFIG_SAMPLES is not set 1385# CONFIG_SAMPLES is not set
1368CONFIG_HAVE_ARCH_KGDB=y 1386CONFIG_HAVE_ARCH_KGDB=y
1387# CONFIG_PPC_DISABLE_WERROR is not set
1388CONFIG_PPC_WERROR=y
1369CONFIG_PRINT_STACK_DEPTH=64 1389CONFIG_PRINT_STACK_DEPTH=64
1370# CONFIG_IRQSTACKS is not set 1390# CONFIG_IRQSTACKS is not set
1371# CONFIG_BOOTX_TEXT is not set 1391# CONFIG_BOOTX_TEXT is not set
diff --git a/arch/powerpc/configs/83xx/mpc834x_itx_defconfig b/arch/powerpc/configs/83xx/mpc834x_itx_defconfig
index 24ee7fcac87e..648dac0c9d8d 100644
--- a/arch/powerpc/configs/83xx/mpc834x_itx_defconfig
+++ b/arch/powerpc/configs/83xx/mpc834x_itx_defconfig
@@ -1,26 +1,28 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.30-rc3 3# Linux kernel version: 2.6.31-rc4
4# Wed May 13 17:22:09 2009 4# Wed Jul 29 23:32:07 2009
5# 5#
6# CONFIG_PPC64 is not set 6# CONFIG_PPC64 is not set
7 7
8# 8#
9# Processor support 9# Processor support
10# 10#
11CONFIG_6xx=y 11CONFIG_PPC_BOOK3S_32=y
12# CONFIG_PPC_85xx is not set 12# CONFIG_PPC_85xx is not set
13# CONFIG_PPC_8xx is not set 13# CONFIG_PPC_8xx is not set
14# CONFIG_40x is not set 14# CONFIG_40x is not set
15# CONFIG_44x is not set 15# CONFIG_44x is not set
16# CONFIG_E200 is not set 16# CONFIG_E200 is not set
17CONFIG_PPC_BOOK3S=y 17CONFIG_PPC_BOOK3S=y
18CONFIG_6xx=y
18CONFIG_PPC_FPU=y 19CONFIG_PPC_FPU=y
19# CONFIG_FSL_EMB_PERFMON is not set 20# CONFIG_FSL_EMB_PERFMON is not set
20# CONFIG_ALTIVEC is not set 21# CONFIG_ALTIVEC is not set
21CONFIG_PPC_STD_MMU=y 22CONFIG_PPC_STD_MMU=y
22CONFIG_PPC_STD_MMU_32=y 23CONFIG_PPC_STD_MMU_32=y
23# CONFIG_PPC_MM_SLICES is not set 24# CONFIG_PPC_MM_SLICES is not set
25CONFIG_PPC_HAVE_PMU_SUPPORT=y
24# CONFIG_SMP is not set 26# CONFIG_SMP is not set
25CONFIG_PPC32=y 27CONFIG_PPC32=y
26CONFIG_WORD_SIZE=32 28CONFIG_WORD_SIZE=32
@@ -31,15 +33,16 @@ CONFIG_GENERIC_TIME=y
31CONFIG_GENERIC_TIME_VSYSCALL=y 33CONFIG_GENERIC_TIME_VSYSCALL=y
32CONFIG_GENERIC_CLOCKEVENTS=y 34CONFIG_GENERIC_CLOCKEVENTS=y
33CONFIG_GENERIC_HARDIRQS=y 35CONFIG_GENERIC_HARDIRQS=y
36CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
34# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set 37# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set
35CONFIG_IRQ_PER_CPU=y 38CONFIG_IRQ_PER_CPU=y
36CONFIG_STACKTRACE_SUPPORT=y 39CONFIG_STACKTRACE_SUPPORT=y
37CONFIG_HAVE_LATENCYTOP_SUPPORT=y 40CONFIG_HAVE_LATENCYTOP_SUPPORT=y
41CONFIG_TRACE_IRQFLAGS_SUPPORT=y
38CONFIG_LOCKDEP_SUPPORT=y 42CONFIG_LOCKDEP_SUPPORT=y
39CONFIG_RWSEM_XCHGADD_ALGORITHM=y 43CONFIG_RWSEM_XCHGADD_ALGORITHM=y
40CONFIG_ARCH_HAS_ILOG2_U32=y 44CONFIG_ARCH_HAS_ILOG2_U32=y
41CONFIG_GENERIC_HWEIGHT=y 45CONFIG_GENERIC_HWEIGHT=y
42CONFIG_GENERIC_CALIBRATE_DELAY=y
43CONFIG_GENERIC_FIND_NEXT_BIT=y 46CONFIG_GENERIC_FIND_NEXT_BIT=y
44# CONFIG_ARCH_NO_VIRT_TO_BUS is not set 47# CONFIG_ARCH_NO_VIRT_TO_BUS is not set
45CONFIG_PPC=y 48CONFIG_PPC=y
@@ -53,12 +56,14 @@ CONFIG_PPC_UDBG_16550=y
53# CONFIG_GENERIC_TBSYNC is not set 56# CONFIG_GENERIC_TBSYNC is not set
54CONFIG_AUDIT_ARCH=y 57CONFIG_AUDIT_ARCH=y
55CONFIG_GENERIC_BUG=y 58CONFIG_GENERIC_BUG=y
59CONFIG_DTC=y
56CONFIG_DEFAULT_UIMAGE=y 60CONFIG_DEFAULT_UIMAGE=y
57CONFIG_ARCH_SUSPEND_POSSIBLE=y 61CONFIG_ARCH_SUSPEND_POSSIBLE=y
58# CONFIG_PPC_DCR_NATIVE is not set 62# CONFIG_PPC_DCR_NATIVE is not set
59# CONFIG_PPC_DCR_MMIO is not set 63# CONFIG_PPC_DCR_MMIO is not set
60CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y 64CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y
61CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" 65CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
66CONFIG_CONSTRUCTORS=y
62 67
63# 68#
64# General setup 69# General setup
@@ -107,7 +112,6 @@ CONFIG_ANON_INODES=y
107CONFIG_EMBEDDED=y 112CONFIG_EMBEDDED=y
108CONFIG_SYSCTL_SYSCALL=y 113CONFIG_SYSCTL_SYSCALL=y
109# CONFIG_KALLSYMS is not set 114# CONFIG_KALLSYMS is not set
110# CONFIG_STRIP_ASM_SYMS is not set
111CONFIG_HOTPLUG=y 115CONFIG_HOTPLUG=y
112CONFIG_PRINTK=y 116CONFIG_PRINTK=y
113CONFIG_BUG=y 117CONFIG_BUG=y
@@ -120,9 +124,16 @@ CONFIG_TIMERFD=y
120CONFIG_EVENTFD=y 124CONFIG_EVENTFD=y
121CONFIG_SHMEM=y 125CONFIG_SHMEM=y
122CONFIG_AIO=y 126CONFIG_AIO=y
127CONFIG_HAVE_PERF_COUNTERS=y
128
129#
130# Performance Counters
131#
132# CONFIG_PERF_COUNTERS is not set
123CONFIG_VM_EVENT_COUNTERS=y 133CONFIG_VM_EVENT_COUNTERS=y
124CONFIG_PCI_QUIRKS=y 134CONFIG_PCI_QUIRKS=y
125CONFIG_SLUB_DEBUG=y 135CONFIG_SLUB_DEBUG=y
136# CONFIG_STRIP_ASM_SYMS is not set
126CONFIG_COMPAT_BRK=y 137CONFIG_COMPAT_BRK=y
127# CONFIG_SLAB is not set 138# CONFIG_SLAB is not set
128CONFIG_SLUB=y 139CONFIG_SLUB=y
@@ -135,6 +146,10 @@ CONFIG_HAVE_IOREMAP_PROT=y
135CONFIG_HAVE_KPROBES=y 146CONFIG_HAVE_KPROBES=y
136CONFIG_HAVE_KRETPROBES=y 147CONFIG_HAVE_KRETPROBES=y
137CONFIG_HAVE_ARCH_TRACEHOOK=y 148CONFIG_HAVE_ARCH_TRACEHOOK=y
149
150#
151# GCOV-based kernel profiling
152#
138# CONFIG_SLOW_WORK is not set 153# CONFIG_SLOW_WORK is not set
139# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set 154# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
140CONFIG_SLABINFO=y 155CONFIG_SLABINFO=y
@@ -147,7 +162,7 @@ CONFIG_MODULE_UNLOAD=y
147# CONFIG_MODVERSIONS is not set 162# CONFIG_MODVERSIONS is not set
148# CONFIG_MODULE_SRCVERSION_ALL is not set 163# CONFIG_MODULE_SRCVERSION_ALL is not set
149CONFIG_BLOCK=y 164CONFIG_BLOCK=y
150# CONFIG_LBD is not set 165CONFIG_LBDAF=y
151# CONFIG_BLK_DEV_BSG is not set 166# CONFIG_BLK_DEV_BSG is not set
152# CONFIG_BLK_DEV_INTEGRITY is not set 167# CONFIG_BLK_DEV_INTEGRITY is not set
153 168
@@ -189,6 +204,7 @@ CONFIG_MPC834x_ITX=y
189# CONFIG_MPC837x_RDB is not set 204# CONFIG_MPC837x_RDB is not set
190# CONFIG_SBC834x is not set 205# CONFIG_SBC834x is not set
191# CONFIG_ASP834x is not set 206# CONFIG_ASP834x is not set
207# CONFIG_KMETER1 is not set
192CONFIG_PPC_MPC834x=y 208CONFIG_PPC_MPC834x=y
193# CONFIG_PPC_86xx is not set 209# CONFIG_PPC_86xx is not set
194# CONFIG_EMBEDDED6xx is not set 210# CONFIG_EMBEDDED6xx is not set
@@ -234,6 +250,7 @@ CONFIG_BINFMT_ELF=y
234# CONFIG_HAVE_AOUT is not set 250# CONFIG_HAVE_AOUT is not set
235# CONFIG_BINFMT_MISC is not set 251# CONFIG_BINFMT_MISC is not set
236# CONFIG_IOMMU_HELPER is not set 252# CONFIG_IOMMU_HELPER is not set
253# CONFIG_SWIOTLB is not set
237CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y 254CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
238CONFIG_ARCH_HAS_WALK_MEMORY=y 255CONFIG_ARCH_HAS_WALK_MEMORY=y
239CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y 256CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y
@@ -254,9 +271,9 @@ CONFIG_MIGRATION=y
254CONFIG_ZONE_DMA_FLAG=1 271CONFIG_ZONE_DMA_FLAG=1
255CONFIG_BOUNCE=y 272CONFIG_BOUNCE=y
256CONFIG_VIRT_TO_BUS=y 273CONFIG_VIRT_TO_BUS=y
257CONFIG_UNEVICTABLE_LRU=y
258CONFIG_HAVE_MLOCK=y 274CONFIG_HAVE_MLOCK=y
259CONFIG_HAVE_MLOCKED_PAGE_BIT=y 275CONFIG_HAVE_MLOCKED_PAGE_BIT=y
276CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
260CONFIG_PPC_4K_PAGES=y 277CONFIG_PPC_4K_PAGES=y
261# CONFIG_PPC_16K_PAGES is not set 278# CONFIG_PPC_16K_PAGES is not set
262# CONFIG_PPC_64K_PAGES is not set 279# CONFIG_PPC_64K_PAGES is not set
@@ -365,6 +382,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
365# CONFIG_ECONET is not set 382# CONFIG_ECONET is not set
366# CONFIG_WAN_ROUTER is not set 383# CONFIG_WAN_ROUTER is not set
367# CONFIG_PHONET is not set 384# CONFIG_PHONET is not set
385# CONFIG_IEEE802154 is not set
368# CONFIG_NET_SCHED is not set 386# CONFIG_NET_SCHED is not set
369# CONFIG_DCB is not set 387# CONFIG_DCB is not set
370 388
@@ -382,7 +400,11 @@ CONFIG_WIRELESS=y
382CONFIG_WIRELESS_OLD_REGULATORY=y 400CONFIG_WIRELESS_OLD_REGULATORY=y
383# CONFIG_WIRELESS_EXT is not set 401# CONFIG_WIRELESS_EXT is not set
384# CONFIG_LIB80211 is not set 402# CONFIG_LIB80211 is not set
385# CONFIG_MAC80211 is not set 403
404#
405# CFG80211 needs to be enabled for MAC80211
406#
407CONFIG_MAC80211_DEFAULT_PS_VALUE=0
386# CONFIG_WIMAX is not set 408# CONFIG_WIMAX is not set
387# CONFIG_RFKILL is not set 409# CONFIG_RFKILL is not set
388# CONFIG_NET_9P is not set 410# CONFIG_NET_9P is not set
@@ -487,6 +509,7 @@ CONFIG_MTD_PHYSMAP=y
487CONFIG_OF_DEVICE=y 509CONFIG_OF_DEVICE=y
488CONFIG_OF_I2C=y 510CONFIG_OF_I2C=y
489CONFIG_OF_SPI=y 511CONFIG_OF_SPI=y
512CONFIG_OF_MDIO=y
490# CONFIG_PARPORT is not set 513# CONFIG_PARPORT is not set
491CONFIG_BLK_DEV=y 514CONFIG_BLK_DEV=y
492# CONFIG_BLK_DEV_FD is not set 515# CONFIG_BLK_DEV_FD is not set
@@ -523,7 +546,9 @@ CONFIG_MISC_DEVICES=y
523# CONFIG_EEPROM_AT24 is not set 546# CONFIG_EEPROM_AT24 is not set
524# CONFIG_EEPROM_AT25 is not set 547# CONFIG_EEPROM_AT25 is not set
525# CONFIG_EEPROM_LEGACY is not set 548# CONFIG_EEPROM_LEGACY is not set
549# CONFIG_EEPROM_MAX6875 is not set
526# CONFIG_EEPROM_93CX6 is not set 550# CONFIG_EEPROM_93CX6 is not set
551# CONFIG_CB710_CORE is not set
527CONFIG_HAVE_IDE=y 552CONFIG_HAVE_IDE=y
528CONFIG_IDE=y 553CONFIG_IDE=y
529 554
@@ -594,10 +619,6 @@ CONFIG_BLK_DEV_SD=y
594# CONFIG_BLK_DEV_SR is not set 619# CONFIG_BLK_DEV_SR is not set
595CONFIG_CHR_DEV_SG=y 620CONFIG_CHR_DEV_SG=y
596# CONFIG_CHR_DEV_SCH is not set 621# CONFIG_CHR_DEV_SCH is not set
597
598#
599# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
600#
601# CONFIG_SCSI_MULTI_LUN is not set 622# CONFIG_SCSI_MULTI_LUN is not set
602# CONFIG_SCSI_CONSTANTS is not set 623# CONFIG_SCSI_CONSTANTS is not set
603# CONFIG_SCSI_LOGGING is not set 624# CONFIG_SCSI_LOGGING is not set
@@ -615,6 +636,7 @@ CONFIG_SCSI_SPI_ATTRS=y
615CONFIG_SCSI_LOWLEVEL=y 636CONFIG_SCSI_LOWLEVEL=y
616# CONFIG_ISCSI_TCP is not set 637# CONFIG_ISCSI_TCP is not set
617# CONFIG_SCSI_CXGB3_ISCSI is not set 638# CONFIG_SCSI_CXGB3_ISCSI is not set
639# CONFIG_SCSI_BNX2_ISCSI is not set
618# CONFIG_BLK_DEV_3W_XXXX_RAID is not set 640# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
619# CONFIG_SCSI_3W_9XXX is not set 641# CONFIG_SCSI_3W_9XXX is not set
620# CONFIG_SCSI_ACARD is not set 642# CONFIG_SCSI_ACARD is not set
@@ -623,6 +645,7 @@ CONFIG_SCSI_LOWLEVEL=y
623# CONFIG_SCSI_AIC7XXX_OLD is not set 645# CONFIG_SCSI_AIC7XXX_OLD is not set
624# CONFIG_SCSI_AIC79XX is not set 646# CONFIG_SCSI_AIC79XX is not set
625# CONFIG_SCSI_AIC94XX is not set 647# CONFIG_SCSI_AIC94XX is not set
648# CONFIG_SCSI_MVSAS is not set
626# CONFIG_SCSI_DPT_I2O is not set 649# CONFIG_SCSI_DPT_I2O is not set
627# CONFIG_SCSI_ADVANSYS is not set 650# CONFIG_SCSI_ADVANSYS is not set
628# CONFIG_SCSI_ARCMSR is not set 651# CONFIG_SCSI_ARCMSR is not set
@@ -642,7 +665,6 @@ CONFIG_SCSI_LOWLEVEL=y
642# CONFIG_SCSI_IPS is not set 665# CONFIG_SCSI_IPS is not set
643# CONFIG_SCSI_INITIO is not set 666# CONFIG_SCSI_INITIO is not set
644# CONFIG_SCSI_INIA100 is not set 667# CONFIG_SCSI_INIA100 is not set
645# CONFIG_SCSI_MVSAS is not set
646# CONFIG_SCSI_STEX is not set 668# CONFIG_SCSI_STEX is not set
647# CONFIG_SCSI_SYM53C8XX_2 is not set 669# CONFIG_SCSI_SYM53C8XX_2 is not set
648# CONFIG_SCSI_IPR is not set 670# CONFIG_SCSI_IPR is not set
@@ -737,14 +759,17 @@ CONFIG_MD_RAID1=y
737# 759#
738 760
739# 761#
740# Enable only one of the two stacks, unless you know what you are doing 762# You can enable one or both FireWire driver stacks.
763#
764
765#
766# See the help texts for more information.
741# 767#
742# CONFIG_FIREWIRE is not set 768# CONFIG_FIREWIRE is not set
743# CONFIG_IEEE1394 is not set 769# CONFIG_IEEE1394 is not set
744# CONFIG_I2O is not set 770# CONFIG_I2O is not set
745# CONFIG_MACINTOSH_DRIVERS is not set 771# CONFIG_MACINTOSH_DRIVERS is not set
746CONFIG_NETDEVICES=y 772CONFIG_NETDEVICES=y
747CONFIG_COMPAT_NET_DEV_OPS=y
748# CONFIG_DUMMY is not set 773# CONFIG_DUMMY is not set
749# CONFIG_BONDING is not set 774# CONFIG_BONDING is not set
750# CONFIG_MACVLAN is not set 775# CONFIG_MACVLAN is not set
@@ -791,8 +816,10 @@ CONFIG_NETDEV_1000=y
791# CONFIG_VIA_VELOCITY is not set 816# CONFIG_VIA_VELOCITY is not set
792# CONFIG_TIGON3 is not set 817# CONFIG_TIGON3 is not set
793# CONFIG_BNX2 is not set 818# CONFIG_BNX2 is not set
819# CONFIG_CNIC is not set
794CONFIG_FSL_PQ_MDIO=y 820CONFIG_FSL_PQ_MDIO=y
795CONFIG_GIANFAR=y 821CONFIG_GIANFAR=y
822# CONFIG_MV643XX_ETH is not set
796# CONFIG_QLA3XXX is not set 823# CONFIG_QLA3XXX is not set
797# CONFIG_ATL1 is not set 824# CONFIG_ATL1 is not set
798# CONFIG_ATL1E is not set 825# CONFIG_ATL1E is not set
@@ -960,7 +987,6 @@ CONFIG_I2C_MPC=y
960CONFIG_SENSORS_PCF8574=y 987CONFIG_SENSORS_PCF8574=y
961# CONFIG_PCF8575 is not set 988# CONFIG_PCF8575 is not set
962# CONFIG_SENSORS_PCA9539 is not set 989# CONFIG_SENSORS_PCA9539 is not set
963# CONFIG_SENSORS_MAX6875 is not set
964# CONFIG_SENSORS_TSL2550 is not set 990# CONFIG_SENSORS_TSL2550 is not set
965# CONFIG_I2C_DEBUG_CORE is not set 991# CONFIG_I2C_DEBUG_CORE is not set
966# CONFIG_I2C_DEBUG_ALGO is not set 992# CONFIG_I2C_DEBUG_ALGO is not set
@@ -973,13 +999,18 @@ CONFIG_SPI_MASTER=y
973# SPI Master Controller Drivers 999# SPI Master Controller Drivers
974# 1000#
975CONFIG_SPI_BITBANG=y 1001CONFIG_SPI_BITBANG=y
976CONFIG_SPI_MPC83xx=y 1002# CONFIG_SPI_MPC8xxx is not set
977 1003
978# 1004#
979# SPI Protocol Masters 1005# SPI Protocol Masters
980# 1006#
981# CONFIG_SPI_SPIDEV is not set 1007# CONFIG_SPI_SPIDEV is not set
982# CONFIG_SPI_TLE62X0 is not set 1008# CONFIG_SPI_TLE62X0 is not set
1009
1010#
1011# PPS support
1012#
1013# CONFIG_PPS is not set
983CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y 1014CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
984# CONFIG_GPIOLIB is not set 1015# CONFIG_GPIOLIB is not set
985# CONFIG_W1 is not set 1016# CONFIG_W1 is not set
@@ -1026,24 +1057,10 @@ CONFIG_SSB_POSSIBLE=y
1026# CONFIG_MFD_WM8400 is not set 1057# CONFIG_MFD_WM8400 is not set
1027# CONFIG_MFD_WM8350_I2C is not set 1058# CONFIG_MFD_WM8350_I2C is not set
1028# CONFIG_MFD_PCF50633 is not set 1059# CONFIG_MFD_PCF50633 is not set
1060# CONFIG_AB3100_CORE is not set
1061# CONFIG_EZX_PCAP is not set
1029# CONFIG_REGULATOR is not set 1062# CONFIG_REGULATOR is not set
1030 1063# CONFIG_MEDIA_SUPPORT is not set
1031#
1032# Multimedia devices
1033#
1034
1035#
1036# Multimedia core support
1037#
1038# CONFIG_VIDEO_DEV is not set
1039# CONFIG_DVB_CORE is not set
1040# CONFIG_VIDEO_MEDIA is not set
1041
1042#
1043# Multimedia drivers
1044#
1045CONFIG_DAB=y
1046# CONFIG_USB_DABUSB is not set
1047 1064
1048# 1065#
1049# Graphics support 1066# Graphics support
@@ -1085,6 +1102,7 @@ CONFIG_USB_MON=y
1085# USB Host Controller Drivers 1102# USB Host Controller Drivers
1086# 1103#
1087# CONFIG_USB_C67X00_HCD is not set 1104# CONFIG_USB_C67X00_HCD is not set
1105# CONFIG_USB_XHCI_HCD is not set
1088CONFIG_USB_EHCI_HCD=y 1106CONFIG_USB_EHCI_HCD=y
1089CONFIG_USB_EHCI_ROOT_HUB_TT=y 1107CONFIG_USB_EHCI_ROOT_HUB_TT=y
1090# CONFIG_USB_EHCI_TT_NEWSCHED is not set 1108# CONFIG_USB_EHCI_TT_NEWSCHED is not set
@@ -1208,6 +1226,7 @@ CONFIG_RTC_DRV_DS1307=y
1208# CONFIG_RTC_DRV_S35390A is not set 1226# CONFIG_RTC_DRV_S35390A is not set
1209# CONFIG_RTC_DRV_FM3130 is not set 1227# CONFIG_RTC_DRV_FM3130 is not set
1210# CONFIG_RTC_DRV_RX8581 is not set 1228# CONFIG_RTC_DRV_RX8581 is not set
1229# CONFIG_RTC_DRV_RX8025 is not set
1211 1230
1212# 1231#
1213# SPI RTC drivers 1232# SPI RTC drivers
@@ -1242,6 +1261,10 @@ CONFIG_RTC_DRV_DS1307=y
1242# CONFIG_DMADEVICES is not set 1261# CONFIG_DMADEVICES is not set
1243# CONFIG_AUXDISPLAY is not set 1262# CONFIG_AUXDISPLAY is not set
1244# CONFIG_UIO is not set 1263# CONFIG_UIO is not set
1264
1265#
1266# TI VLYNQ
1267#
1245# CONFIG_STAGING is not set 1268# CONFIG_STAGING is not set
1246 1269
1247# 1270#
@@ -1261,10 +1284,12 @@ CONFIG_FS_MBCACHE=y
1261# CONFIG_REISERFS_FS is not set 1284# CONFIG_REISERFS_FS is not set
1262# CONFIG_JFS_FS is not set 1285# CONFIG_JFS_FS is not set
1263# CONFIG_FS_POSIX_ACL is not set 1286# CONFIG_FS_POSIX_ACL is not set
1264CONFIG_FILE_LOCKING=y
1265# CONFIG_XFS_FS is not set 1287# CONFIG_XFS_FS is not set
1288# CONFIG_GFS2_FS is not set
1266# CONFIG_OCFS2_FS is not set 1289# CONFIG_OCFS2_FS is not set
1267# CONFIG_BTRFS_FS is not set 1290# CONFIG_BTRFS_FS is not set
1291CONFIG_FILE_LOCKING=y
1292CONFIG_FSNOTIFY=y
1268CONFIG_DNOTIFY=y 1293CONFIG_DNOTIFY=y
1269CONFIG_INOTIFY=y 1294CONFIG_INOTIFY=y
1270CONFIG_INOTIFY_USER=y 1295CONFIG_INOTIFY_USER=y
@@ -1331,6 +1356,7 @@ CONFIG_NFS_FS=y
1331CONFIG_NFS_V3=y 1356CONFIG_NFS_V3=y
1332# CONFIG_NFS_V3_ACL is not set 1357# CONFIG_NFS_V3_ACL is not set
1333CONFIG_NFS_V4=y 1358CONFIG_NFS_V4=y
1359# CONFIG_NFS_V4_1 is not set
1334CONFIG_ROOT_NFS=y 1360CONFIG_ROOT_NFS=y
1335# CONFIG_NFSD is not set 1361# CONFIG_NFSD is not set
1336CONFIG_LOCKD=y 1362CONFIG_LOCKD=y
@@ -1429,6 +1455,7 @@ CONFIG_HAS_IOPORT=y
1429CONFIG_HAS_DMA=y 1455CONFIG_HAS_DMA=y
1430CONFIG_HAVE_LMB=y 1456CONFIG_HAVE_LMB=y
1431CONFIG_NLATTR=y 1457CONFIG_NLATTR=y
1458CONFIG_GENERIC_ATOMIC64=y
1432 1459
1433# 1460#
1434# Kernel hacking 1461# Kernel hacking
@@ -1454,22 +1481,11 @@ CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
1454CONFIG_HAVE_DYNAMIC_FTRACE=y 1481CONFIG_HAVE_DYNAMIC_FTRACE=y
1455CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y 1482CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
1456CONFIG_TRACING_SUPPORT=y 1483CONFIG_TRACING_SUPPORT=y
1457 1484# CONFIG_FTRACE is not set
1458#
1459# Tracers
1460#
1461# CONFIG_FUNCTION_TRACER is not set
1462# CONFIG_SCHED_TRACER is not set
1463# CONFIG_CONTEXT_SWITCH_TRACER is not set
1464# CONFIG_EVENT_TRACER is not set
1465# CONFIG_BOOT_TRACER is not set
1466# CONFIG_TRACE_BRANCH_PROFILING is not set
1467# CONFIG_STACK_TRACER is not set
1468# CONFIG_KMEMTRACE is not set
1469# CONFIG_WORKQUEUE_TRACER is not set
1470# CONFIG_BLK_DEV_IO_TRACE is not set
1471# CONFIG_SAMPLES is not set 1485# CONFIG_SAMPLES is not set
1472CONFIG_HAVE_ARCH_KGDB=y 1486CONFIG_HAVE_ARCH_KGDB=y
1487# CONFIG_PPC_DISABLE_WERROR is not set
1488CONFIG_PPC_WERROR=y
1473CONFIG_PRINT_STACK_DEPTH=64 1489CONFIG_PRINT_STACK_DEPTH=64
1474# CONFIG_IRQSTACKS is not set 1490# CONFIG_IRQSTACKS is not set
1475# CONFIG_BOOTX_TEXT is not set 1491# CONFIG_BOOTX_TEXT is not set
diff --git a/arch/powerpc/configs/83xx/mpc834x_itxgp_defconfig b/arch/powerpc/configs/83xx/mpc834x_itxgp_defconfig
index 7f39543205a9..bf6deb831dc3 100644
--- a/arch/powerpc/configs/83xx/mpc834x_itxgp_defconfig
+++ b/arch/powerpc/configs/83xx/mpc834x_itxgp_defconfig
@@ -1,26 +1,28 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.30-rc3 3# Linux kernel version: 2.6.31-rc4
4# Wed May 13 17:22:10 2009 4# Wed Jul 29 23:32:08 2009
5# 5#
6# CONFIG_PPC64 is not set 6# CONFIG_PPC64 is not set
7 7
8# 8#
9# Processor support 9# Processor support
10# 10#
11CONFIG_6xx=y 11CONFIG_PPC_BOOK3S_32=y
12# CONFIG_PPC_85xx is not set 12# CONFIG_PPC_85xx is not set
13# CONFIG_PPC_8xx is not set 13# CONFIG_PPC_8xx is not set
14# CONFIG_40x is not set 14# CONFIG_40x is not set
15# CONFIG_44x is not set 15# CONFIG_44x is not set
16# CONFIG_E200 is not set 16# CONFIG_E200 is not set
17CONFIG_PPC_BOOK3S=y 17CONFIG_PPC_BOOK3S=y
18CONFIG_6xx=y
18CONFIG_PPC_FPU=y 19CONFIG_PPC_FPU=y
19# CONFIG_FSL_EMB_PERFMON is not set 20# CONFIG_FSL_EMB_PERFMON is not set
20# CONFIG_ALTIVEC is not set 21# CONFIG_ALTIVEC is not set
21CONFIG_PPC_STD_MMU=y 22CONFIG_PPC_STD_MMU=y
22CONFIG_PPC_STD_MMU_32=y 23CONFIG_PPC_STD_MMU_32=y
23# CONFIG_PPC_MM_SLICES is not set 24# CONFIG_PPC_MM_SLICES is not set
25CONFIG_PPC_HAVE_PMU_SUPPORT=y
24# CONFIG_SMP is not set 26# CONFIG_SMP is not set
25CONFIG_PPC32=y 27CONFIG_PPC32=y
26CONFIG_WORD_SIZE=32 28CONFIG_WORD_SIZE=32
@@ -31,15 +33,16 @@ CONFIG_GENERIC_TIME=y
31CONFIG_GENERIC_TIME_VSYSCALL=y 33CONFIG_GENERIC_TIME_VSYSCALL=y
32CONFIG_GENERIC_CLOCKEVENTS=y 34CONFIG_GENERIC_CLOCKEVENTS=y
33CONFIG_GENERIC_HARDIRQS=y 35CONFIG_GENERIC_HARDIRQS=y
36CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
34# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set 37# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set
35CONFIG_IRQ_PER_CPU=y 38CONFIG_IRQ_PER_CPU=y
36CONFIG_STACKTRACE_SUPPORT=y 39CONFIG_STACKTRACE_SUPPORT=y
37CONFIG_HAVE_LATENCYTOP_SUPPORT=y 40CONFIG_HAVE_LATENCYTOP_SUPPORT=y
41CONFIG_TRACE_IRQFLAGS_SUPPORT=y
38CONFIG_LOCKDEP_SUPPORT=y 42CONFIG_LOCKDEP_SUPPORT=y
39CONFIG_RWSEM_XCHGADD_ALGORITHM=y 43CONFIG_RWSEM_XCHGADD_ALGORITHM=y
40CONFIG_ARCH_HAS_ILOG2_U32=y 44CONFIG_ARCH_HAS_ILOG2_U32=y
41CONFIG_GENERIC_HWEIGHT=y 45CONFIG_GENERIC_HWEIGHT=y
42CONFIG_GENERIC_CALIBRATE_DELAY=y
43CONFIG_GENERIC_FIND_NEXT_BIT=y 46CONFIG_GENERIC_FIND_NEXT_BIT=y
44# CONFIG_ARCH_NO_VIRT_TO_BUS is not set 47# CONFIG_ARCH_NO_VIRT_TO_BUS is not set
45CONFIG_PPC=y 48CONFIG_PPC=y
@@ -53,12 +56,14 @@ CONFIG_PPC_UDBG_16550=y
53# CONFIG_GENERIC_TBSYNC is not set 56# CONFIG_GENERIC_TBSYNC is not set
54CONFIG_AUDIT_ARCH=y 57CONFIG_AUDIT_ARCH=y
55CONFIG_GENERIC_BUG=y 58CONFIG_GENERIC_BUG=y
59CONFIG_DTC=y
56CONFIG_DEFAULT_UIMAGE=y 60CONFIG_DEFAULT_UIMAGE=y
57CONFIG_ARCH_SUSPEND_POSSIBLE=y 61CONFIG_ARCH_SUSPEND_POSSIBLE=y
58# CONFIG_PPC_DCR_NATIVE is not set 62# CONFIG_PPC_DCR_NATIVE is not set
59# CONFIG_PPC_DCR_MMIO is not set 63# CONFIG_PPC_DCR_MMIO is not set
60CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y 64CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y
61CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" 65CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
66CONFIG_CONSTRUCTORS=y
62 67
63# 68#
64# General setup 69# General setup
@@ -107,7 +112,6 @@ CONFIG_ANON_INODES=y
107CONFIG_EMBEDDED=y 112CONFIG_EMBEDDED=y
108CONFIG_SYSCTL_SYSCALL=y 113CONFIG_SYSCTL_SYSCALL=y
109# CONFIG_KALLSYMS is not set 114# CONFIG_KALLSYMS is not set
110# CONFIG_STRIP_ASM_SYMS is not set
111CONFIG_HOTPLUG=y 115CONFIG_HOTPLUG=y
112CONFIG_PRINTK=y 116CONFIG_PRINTK=y
113CONFIG_BUG=y 117CONFIG_BUG=y
@@ -120,9 +124,16 @@ CONFIG_TIMERFD=y
120CONFIG_EVENTFD=y 124CONFIG_EVENTFD=y
121CONFIG_SHMEM=y 125CONFIG_SHMEM=y
122CONFIG_AIO=y 126CONFIG_AIO=y
127CONFIG_HAVE_PERF_COUNTERS=y
128
129#
130# Performance Counters
131#
132# CONFIG_PERF_COUNTERS is not set
123CONFIG_VM_EVENT_COUNTERS=y 133CONFIG_VM_EVENT_COUNTERS=y
124CONFIG_PCI_QUIRKS=y 134CONFIG_PCI_QUIRKS=y
125CONFIG_SLUB_DEBUG=y 135CONFIG_SLUB_DEBUG=y
136# CONFIG_STRIP_ASM_SYMS is not set
126CONFIG_COMPAT_BRK=y 137CONFIG_COMPAT_BRK=y
127# CONFIG_SLAB is not set 138# CONFIG_SLAB is not set
128CONFIG_SLUB=y 139CONFIG_SLUB=y
@@ -135,6 +146,10 @@ CONFIG_HAVE_IOREMAP_PROT=y
135CONFIG_HAVE_KPROBES=y 146CONFIG_HAVE_KPROBES=y
136CONFIG_HAVE_KRETPROBES=y 147CONFIG_HAVE_KRETPROBES=y
137CONFIG_HAVE_ARCH_TRACEHOOK=y 148CONFIG_HAVE_ARCH_TRACEHOOK=y
149
150#
151# GCOV-based kernel profiling
152#
138# CONFIG_SLOW_WORK is not set 153# CONFIG_SLOW_WORK is not set
139# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set 154# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
140CONFIG_SLABINFO=y 155CONFIG_SLABINFO=y
@@ -147,7 +162,7 @@ CONFIG_MODULE_UNLOAD=y
147# CONFIG_MODVERSIONS is not set 162# CONFIG_MODVERSIONS is not set
148# CONFIG_MODULE_SRCVERSION_ALL is not set 163# CONFIG_MODULE_SRCVERSION_ALL is not set
149CONFIG_BLOCK=y 164CONFIG_BLOCK=y
150# CONFIG_LBD is not set 165CONFIG_LBDAF=y
151# CONFIG_BLK_DEV_BSG is not set 166# CONFIG_BLK_DEV_BSG is not set
152# CONFIG_BLK_DEV_INTEGRITY is not set 167# CONFIG_BLK_DEV_INTEGRITY is not set
153 168
@@ -189,6 +204,7 @@ CONFIG_MPC834x_ITX=y
189# CONFIG_MPC837x_RDB is not set 204# CONFIG_MPC837x_RDB is not set
190# CONFIG_SBC834x is not set 205# CONFIG_SBC834x is not set
191# CONFIG_ASP834x is not set 206# CONFIG_ASP834x is not set
207# CONFIG_KMETER1 is not set
192CONFIG_PPC_MPC834x=y 208CONFIG_PPC_MPC834x=y
193# CONFIG_PPC_86xx is not set 209# CONFIG_PPC_86xx is not set
194# CONFIG_EMBEDDED6xx is not set 210# CONFIG_EMBEDDED6xx is not set
@@ -234,6 +250,7 @@ CONFIG_BINFMT_ELF=y
234# CONFIG_HAVE_AOUT is not set 250# CONFIG_HAVE_AOUT is not set
235# CONFIG_BINFMT_MISC is not set 251# CONFIG_BINFMT_MISC is not set
236# CONFIG_IOMMU_HELPER is not set 252# CONFIG_IOMMU_HELPER is not set
253# CONFIG_SWIOTLB is not set
237CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y 254CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
238CONFIG_ARCH_HAS_WALK_MEMORY=y 255CONFIG_ARCH_HAS_WALK_MEMORY=y
239CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y 256CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y
@@ -254,9 +271,9 @@ CONFIG_MIGRATION=y
254CONFIG_ZONE_DMA_FLAG=1 271CONFIG_ZONE_DMA_FLAG=1
255CONFIG_BOUNCE=y 272CONFIG_BOUNCE=y
256CONFIG_VIRT_TO_BUS=y 273CONFIG_VIRT_TO_BUS=y
257CONFIG_UNEVICTABLE_LRU=y
258CONFIG_HAVE_MLOCK=y 274CONFIG_HAVE_MLOCK=y
259CONFIG_HAVE_MLOCKED_PAGE_BIT=y 275CONFIG_HAVE_MLOCKED_PAGE_BIT=y
276CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
260CONFIG_PPC_4K_PAGES=y 277CONFIG_PPC_4K_PAGES=y
261# CONFIG_PPC_16K_PAGES is not set 278# CONFIG_PPC_16K_PAGES is not set
262# CONFIG_PPC_64K_PAGES is not set 279# CONFIG_PPC_64K_PAGES is not set
@@ -365,6 +382,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
365# CONFIG_ECONET is not set 382# CONFIG_ECONET is not set
366# CONFIG_WAN_ROUTER is not set 383# CONFIG_WAN_ROUTER is not set
367# CONFIG_PHONET is not set 384# CONFIG_PHONET is not set
385# CONFIG_IEEE802154 is not set
368# CONFIG_NET_SCHED is not set 386# CONFIG_NET_SCHED is not set
369# CONFIG_DCB is not set 387# CONFIG_DCB is not set
370 388
@@ -382,7 +400,11 @@ CONFIG_WIRELESS=y
382CONFIG_WIRELESS_OLD_REGULATORY=y 400CONFIG_WIRELESS_OLD_REGULATORY=y
383# CONFIG_WIRELESS_EXT is not set 401# CONFIG_WIRELESS_EXT is not set
384# CONFIG_LIB80211 is not set 402# CONFIG_LIB80211 is not set
385# CONFIG_MAC80211 is not set 403
404#
405# CFG80211 needs to be enabled for MAC80211
406#
407CONFIG_MAC80211_DEFAULT_PS_VALUE=0
386# CONFIG_WIMAX is not set 408# CONFIG_WIMAX is not set
387# CONFIG_RFKILL is not set 409# CONFIG_RFKILL is not set
388# CONFIG_NET_9P is not set 410# CONFIG_NET_9P is not set
@@ -487,6 +509,7 @@ CONFIG_MTD_PHYSMAP=y
487CONFIG_OF_DEVICE=y 509CONFIG_OF_DEVICE=y
488CONFIG_OF_I2C=y 510CONFIG_OF_I2C=y
489CONFIG_OF_SPI=y 511CONFIG_OF_SPI=y
512CONFIG_OF_MDIO=y
490# CONFIG_PARPORT is not set 513# CONFIG_PARPORT is not set
491CONFIG_BLK_DEV=y 514CONFIG_BLK_DEV=y
492# CONFIG_BLK_DEV_FD is not set 515# CONFIG_BLK_DEV_FD is not set
@@ -523,7 +546,9 @@ CONFIG_MISC_DEVICES=y
523# CONFIG_EEPROM_AT24 is not set 546# CONFIG_EEPROM_AT24 is not set
524# CONFIG_EEPROM_AT25 is not set 547# CONFIG_EEPROM_AT25 is not set
525# CONFIG_EEPROM_LEGACY is not set 548# CONFIG_EEPROM_LEGACY is not set
549# CONFIG_EEPROM_MAX6875 is not set
526# CONFIG_EEPROM_93CX6 is not set 550# CONFIG_EEPROM_93CX6 is not set
551# CONFIG_CB710_CORE is not set
527CONFIG_HAVE_IDE=y 552CONFIG_HAVE_IDE=y
528# CONFIG_IDE is not set 553# CONFIG_IDE is not set
529 554
@@ -546,10 +571,6 @@ CONFIG_BLK_DEV_SD=y
546# CONFIG_BLK_DEV_SR is not set 571# CONFIG_BLK_DEV_SR is not set
547CONFIG_CHR_DEV_SG=y 572CONFIG_CHR_DEV_SG=y
548# CONFIG_CHR_DEV_SCH is not set 573# CONFIG_CHR_DEV_SCH is not set
549
550#
551# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
552#
553# CONFIG_SCSI_MULTI_LUN is not set 574# CONFIG_SCSI_MULTI_LUN is not set
554# CONFIG_SCSI_CONSTANTS is not set 575# CONFIG_SCSI_CONSTANTS is not set
555# CONFIG_SCSI_LOGGING is not set 576# CONFIG_SCSI_LOGGING is not set
@@ -567,6 +588,7 @@ CONFIG_SCSI_SPI_ATTRS=y
567CONFIG_SCSI_LOWLEVEL=y 588CONFIG_SCSI_LOWLEVEL=y
568# CONFIG_ISCSI_TCP is not set 589# CONFIG_ISCSI_TCP is not set
569# CONFIG_SCSI_CXGB3_ISCSI is not set 590# CONFIG_SCSI_CXGB3_ISCSI is not set
591# CONFIG_SCSI_BNX2_ISCSI is not set
570# CONFIG_BLK_DEV_3W_XXXX_RAID is not set 592# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
571# CONFIG_SCSI_3W_9XXX is not set 593# CONFIG_SCSI_3W_9XXX is not set
572# CONFIG_SCSI_ACARD is not set 594# CONFIG_SCSI_ACARD is not set
@@ -575,6 +597,7 @@ CONFIG_SCSI_LOWLEVEL=y
575# CONFIG_SCSI_AIC7XXX_OLD is not set 597# CONFIG_SCSI_AIC7XXX_OLD is not set
576# CONFIG_SCSI_AIC79XX is not set 598# CONFIG_SCSI_AIC79XX is not set
577# CONFIG_SCSI_AIC94XX is not set 599# CONFIG_SCSI_AIC94XX is not set
600# CONFIG_SCSI_MVSAS is not set
578# CONFIG_SCSI_DPT_I2O is not set 601# CONFIG_SCSI_DPT_I2O is not set
579# CONFIG_SCSI_ADVANSYS is not set 602# CONFIG_SCSI_ADVANSYS is not set
580# CONFIG_SCSI_ARCMSR is not set 603# CONFIG_SCSI_ARCMSR is not set
@@ -594,7 +617,6 @@ CONFIG_SCSI_LOWLEVEL=y
594# CONFIG_SCSI_IPS is not set 617# CONFIG_SCSI_IPS is not set
595# CONFIG_SCSI_INITIO is not set 618# CONFIG_SCSI_INITIO is not set
596# CONFIG_SCSI_INIA100 is not set 619# CONFIG_SCSI_INIA100 is not set
597# CONFIG_SCSI_MVSAS is not set
598# CONFIG_SCSI_STEX is not set 620# CONFIG_SCSI_STEX is not set
599# CONFIG_SCSI_SYM53C8XX_2 is not set 621# CONFIG_SCSI_SYM53C8XX_2 is not set
600# CONFIG_SCSI_QLOGIC_1280 is not set 622# CONFIG_SCSI_QLOGIC_1280 is not set
@@ -617,14 +639,17 @@ CONFIG_SCSI_LOWLEVEL=y
617# 639#
618 640
619# 641#
620# Enable only one of the two stacks, unless you know what you are doing 642# You can enable one or both FireWire driver stacks.
643#
644
645#
646# See the help texts for more information.
621# 647#
622# CONFIG_FIREWIRE is not set 648# CONFIG_FIREWIRE is not set
623# CONFIG_IEEE1394 is not set 649# CONFIG_IEEE1394 is not set
624# CONFIG_I2O is not set 650# CONFIG_I2O is not set
625# CONFIG_MACINTOSH_DRIVERS is not set 651# CONFIG_MACINTOSH_DRIVERS is not set
626CONFIG_NETDEVICES=y 652CONFIG_NETDEVICES=y
627CONFIG_COMPAT_NET_DEV_OPS=y
628# CONFIG_DUMMY is not set 653# CONFIG_DUMMY is not set
629# CONFIG_BONDING is not set 654# CONFIG_BONDING is not set
630# CONFIG_MACVLAN is not set 655# CONFIG_MACVLAN is not set
@@ -671,8 +696,10 @@ CONFIG_NETDEV_1000=y
671# CONFIG_VIA_VELOCITY is not set 696# CONFIG_VIA_VELOCITY is not set
672# CONFIG_TIGON3 is not set 697# CONFIG_TIGON3 is not set
673# CONFIG_BNX2 is not set 698# CONFIG_BNX2 is not set
699# CONFIG_CNIC is not set
674CONFIG_FSL_PQ_MDIO=y 700CONFIG_FSL_PQ_MDIO=y
675CONFIG_GIANFAR=y 701CONFIG_GIANFAR=y
702# CONFIG_MV643XX_ETH is not set
676# CONFIG_QLA3XXX is not set 703# CONFIG_QLA3XXX is not set
677# CONFIG_ATL1 is not set 704# CONFIG_ATL1 is not set
678# CONFIG_ATL1E is not set 705# CONFIG_ATL1E is not set
@@ -840,7 +867,6 @@ CONFIG_I2C_MPC=y
840CONFIG_SENSORS_PCF8574=y 867CONFIG_SENSORS_PCF8574=y
841# CONFIG_PCF8575 is not set 868# CONFIG_PCF8575 is not set
842# CONFIG_SENSORS_PCA9539 is not set 869# CONFIG_SENSORS_PCA9539 is not set
843# CONFIG_SENSORS_MAX6875 is not set
844# CONFIG_SENSORS_TSL2550 is not set 870# CONFIG_SENSORS_TSL2550 is not set
845# CONFIG_I2C_DEBUG_CORE is not set 871# CONFIG_I2C_DEBUG_CORE is not set
846# CONFIG_I2C_DEBUG_ALGO is not set 872# CONFIG_I2C_DEBUG_ALGO is not set
@@ -853,13 +879,18 @@ CONFIG_SPI_MASTER=y
853# SPI Master Controller Drivers 879# SPI Master Controller Drivers
854# 880#
855CONFIG_SPI_BITBANG=y 881CONFIG_SPI_BITBANG=y
856CONFIG_SPI_MPC83xx=y 882# CONFIG_SPI_MPC8xxx is not set
857 883
858# 884#
859# SPI Protocol Masters 885# SPI Protocol Masters
860# 886#
861# CONFIG_SPI_SPIDEV is not set 887# CONFIG_SPI_SPIDEV is not set
862# CONFIG_SPI_TLE62X0 is not set 888# CONFIG_SPI_TLE62X0 is not set
889
890#
891# PPS support
892#
893# CONFIG_PPS is not set
863CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y 894CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
864# CONFIG_GPIOLIB is not set 895# CONFIG_GPIOLIB is not set
865# CONFIG_W1 is not set 896# CONFIG_W1 is not set
@@ -906,24 +937,10 @@ CONFIG_SSB_POSSIBLE=y
906# CONFIG_MFD_WM8400 is not set 937# CONFIG_MFD_WM8400 is not set
907# CONFIG_MFD_WM8350_I2C is not set 938# CONFIG_MFD_WM8350_I2C is not set
908# CONFIG_MFD_PCF50633 is not set 939# CONFIG_MFD_PCF50633 is not set
940# CONFIG_AB3100_CORE is not set
941# CONFIG_EZX_PCAP is not set
909# CONFIG_REGULATOR is not set 942# CONFIG_REGULATOR is not set
910 943# CONFIG_MEDIA_SUPPORT is not set
911#
912# Multimedia devices
913#
914
915#
916# Multimedia core support
917#
918# CONFIG_VIDEO_DEV is not set
919# CONFIG_DVB_CORE is not set
920# CONFIG_VIDEO_MEDIA is not set
921
922#
923# Multimedia drivers
924#
925CONFIG_DAB=y
926# CONFIG_USB_DABUSB is not set
927 944
928# 945#
929# Graphics support 946# Graphics support
@@ -965,6 +982,7 @@ CONFIG_USB_MON=y
965# USB Host Controller Drivers 982# USB Host Controller Drivers
966# 983#
967# CONFIG_USB_C67X00_HCD is not set 984# CONFIG_USB_C67X00_HCD is not set
985# CONFIG_USB_XHCI_HCD is not set
968CONFIG_USB_EHCI_HCD=y 986CONFIG_USB_EHCI_HCD=y
969CONFIG_USB_EHCI_ROOT_HUB_TT=y 987CONFIG_USB_EHCI_ROOT_HUB_TT=y
970# CONFIG_USB_EHCI_TT_NEWSCHED is not set 988# CONFIG_USB_EHCI_TT_NEWSCHED is not set
@@ -1087,6 +1105,7 @@ CONFIG_RTC_DRV_DS1307=y
1087# CONFIG_RTC_DRV_S35390A is not set 1105# CONFIG_RTC_DRV_S35390A is not set
1088# CONFIG_RTC_DRV_FM3130 is not set 1106# CONFIG_RTC_DRV_FM3130 is not set
1089# CONFIG_RTC_DRV_RX8581 is not set 1107# CONFIG_RTC_DRV_RX8581 is not set
1108# CONFIG_RTC_DRV_RX8025 is not set
1090 1109
1091# 1110#
1092# SPI RTC drivers 1111# SPI RTC drivers
@@ -1121,6 +1140,10 @@ CONFIG_RTC_DRV_DS1307=y
1121# CONFIG_DMADEVICES is not set 1140# CONFIG_DMADEVICES is not set
1122# CONFIG_AUXDISPLAY is not set 1141# CONFIG_AUXDISPLAY is not set
1123# CONFIG_UIO is not set 1142# CONFIG_UIO is not set
1143
1144#
1145# TI VLYNQ
1146#
1124# CONFIG_STAGING is not set 1147# CONFIG_STAGING is not set
1125 1148
1126# 1149#
@@ -1140,10 +1163,12 @@ CONFIG_FS_MBCACHE=y
1140# CONFIG_REISERFS_FS is not set 1163# CONFIG_REISERFS_FS is not set
1141# CONFIG_JFS_FS is not set 1164# CONFIG_JFS_FS is not set
1142# CONFIG_FS_POSIX_ACL is not set 1165# CONFIG_FS_POSIX_ACL is not set
1143CONFIG_FILE_LOCKING=y
1144# CONFIG_XFS_FS is not set 1166# CONFIG_XFS_FS is not set
1167# CONFIG_GFS2_FS is not set
1145# CONFIG_OCFS2_FS is not set 1168# CONFIG_OCFS2_FS is not set
1146# CONFIG_BTRFS_FS is not set 1169# CONFIG_BTRFS_FS is not set
1170CONFIG_FILE_LOCKING=y
1171CONFIG_FSNOTIFY=y
1147CONFIG_DNOTIFY=y 1172CONFIG_DNOTIFY=y
1148CONFIG_INOTIFY=y 1173CONFIG_INOTIFY=y
1149CONFIG_INOTIFY_USER=y 1174CONFIG_INOTIFY_USER=y
@@ -1210,6 +1235,7 @@ CONFIG_NFS_FS=y
1210CONFIG_NFS_V3=y 1235CONFIG_NFS_V3=y
1211# CONFIG_NFS_V3_ACL is not set 1236# CONFIG_NFS_V3_ACL is not set
1212CONFIG_NFS_V4=y 1237CONFIG_NFS_V4=y
1238# CONFIG_NFS_V4_1 is not set
1213CONFIG_ROOT_NFS=y 1239CONFIG_ROOT_NFS=y
1214# CONFIG_NFSD is not set 1240# CONFIG_NFSD is not set
1215CONFIG_LOCKD=y 1241CONFIG_LOCKD=y
@@ -1308,6 +1334,7 @@ CONFIG_HAS_IOPORT=y
1308CONFIG_HAS_DMA=y 1334CONFIG_HAS_DMA=y
1309CONFIG_HAVE_LMB=y 1335CONFIG_HAVE_LMB=y
1310CONFIG_NLATTR=y 1336CONFIG_NLATTR=y
1337CONFIG_GENERIC_ATOMIC64=y
1311 1338
1312# 1339#
1313# Kernel hacking 1340# Kernel hacking
@@ -1333,22 +1360,11 @@ CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
1333CONFIG_HAVE_DYNAMIC_FTRACE=y 1360CONFIG_HAVE_DYNAMIC_FTRACE=y
1334CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y 1361CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
1335CONFIG_TRACING_SUPPORT=y 1362CONFIG_TRACING_SUPPORT=y
1336 1363# CONFIG_FTRACE is not set
1337#
1338# Tracers
1339#
1340# CONFIG_FUNCTION_TRACER is not set
1341# CONFIG_SCHED_TRACER is not set
1342# CONFIG_CONTEXT_SWITCH_TRACER is not set
1343# CONFIG_EVENT_TRACER is not set
1344# CONFIG_BOOT_TRACER is not set
1345# CONFIG_TRACE_BRANCH_PROFILING is not set
1346# CONFIG_STACK_TRACER is not set
1347# CONFIG_KMEMTRACE is not set
1348# CONFIG_WORKQUEUE_TRACER is not set
1349# CONFIG_BLK_DEV_IO_TRACE is not set
1350# CONFIG_SAMPLES is not set 1364# CONFIG_SAMPLES is not set
1351CONFIG_HAVE_ARCH_KGDB=y 1365CONFIG_HAVE_ARCH_KGDB=y
1366# CONFIG_PPC_DISABLE_WERROR is not set
1367CONFIG_PPC_WERROR=y
1352CONFIG_PRINT_STACK_DEPTH=64 1368CONFIG_PRINT_STACK_DEPTH=64
1353# CONFIG_IRQSTACKS is not set 1369# CONFIG_IRQSTACKS is not set
1354# CONFIG_BOOTX_TEXT is not set 1370# CONFIG_BOOTX_TEXT is not set
diff --git a/arch/powerpc/configs/83xx/mpc834x_mds_defconfig b/arch/powerpc/configs/83xx/mpc834x_mds_defconfig
index 1cd1fcac22c8..3236c47712c2 100644
--- a/arch/powerpc/configs/83xx/mpc834x_mds_defconfig
+++ b/arch/powerpc/configs/83xx/mpc834x_mds_defconfig
@@ -1,26 +1,28 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.30-rc3 3# Linux kernel version: 2.6.31-rc4
4# Wed May 13 17:22:11 2009 4# Wed Jul 29 23:32:09 2009
5# 5#
6# CONFIG_PPC64 is not set 6# CONFIG_PPC64 is not set
7 7
8# 8#
9# Processor support 9# Processor support
10# 10#
11CONFIG_6xx=y 11CONFIG_PPC_BOOK3S_32=y
12# CONFIG_PPC_85xx is not set 12# CONFIG_PPC_85xx is not set
13# CONFIG_PPC_8xx is not set 13# CONFIG_PPC_8xx is not set
14# CONFIG_40x is not set 14# CONFIG_40x is not set
15# CONFIG_44x is not set 15# CONFIG_44x is not set
16# CONFIG_E200 is not set 16# CONFIG_E200 is not set
17CONFIG_PPC_BOOK3S=y 17CONFIG_PPC_BOOK3S=y
18CONFIG_6xx=y
18CONFIG_PPC_FPU=y 19CONFIG_PPC_FPU=y
19# CONFIG_FSL_EMB_PERFMON is not set 20# CONFIG_FSL_EMB_PERFMON is not set
20# CONFIG_ALTIVEC is not set 21# CONFIG_ALTIVEC is not set
21CONFIG_PPC_STD_MMU=y 22CONFIG_PPC_STD_MMU=y
22CONFIG_PPC_STD_MMU_32=y 23CONFIG_PPC_STD_MMU_32=y
23# CONFIG_PPC_MM_SLICES is not set 24# CONFIG_PPC_MM_SLICES is not set
25CONFIG_PPC_HAVE_PMU_SUPPORT=y
24# CONFIG_SMP is not set 26# CONFIG_SMP is not set
25CONFIG_PPC32=y 27CONFIG_PPC32=y
26CONFIG_WORD_SIZE=32 28CONFIG_WORD_SIZE=32
@@ -31,15 +33,16 @@ CONFIG_GENERIC_TIME=y
31CONFIG_GENERIC_TIME_VSYSCALL=y 33CONFIG_GENERIC_TIME_VSYSCALL=y
32CONFIG_GENERIC_CLOCKEVENTS=y 34CONFIG_GENERIC_CLOCKEVENTS=y
33CONFIG_GENERIC_HARDIRQS=y 35CONFIG_GENERIC_HARDIRQS=y
36CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
34# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set 37# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set
35CONFIG_IRQ_PER_CPU=y 38CONFIG_IRQ_PER_CPU=y
36CONFIG_STACKTRACE_SUPPORT=y 39CONFIG_STACKTRACE_SUPPORT=y
37CONFIG_HAVE_LATENCYTOP_SUPPORT=y 40CONFIG_HAVE_LATENCYTOP_SUPPORT=y
41CONFIG_TRACE_IRQFLAGS_SUPPORT=y
38CONFIG_LOCKDEP_SUPPORT=y 42CONFIG_LOCKDEP_SUPPORT=y
39CONFIG_RWSEM_XCHGADD_ALGORITHM=y 43CONFIG_RWSEM_XCHGADD_ALGORITHM=y
40CONFIG_ARCH_HAS_ILOG2_U32=y 44CONFIG_ARCH_HAS_ILOG2_U32=y
41CONFIG_GENERIC_HWEIGHT=y 45CONFIG_GENERIC_HWEIGHT=y
42CONFIG_GENERIC_CALIBRATE_DELAY=y
43CONFIG_GENERIC_FIND_NEXT_BIT=y 46CONFIG_GENERIC_FIND_NEXT_BIT=y
44# CONFIG_ARCH_NO_VIRT_TO_BUS is not set 47# CONFIG_ARCH_NO_VIRT_TO_BUS is not set
45CONFIG_PPC=y 48CONFIG_PPC=y
@@ -53,12 +56,14 @@ CONFIG_PPC_UDBG_16550=y
53# CONFIG_GENERIC_TBSYNC is not set 56# CONFIG_GENERIC_TBSYNC is not set
54CONFIG_AUDIT_ARCH=y 57CONFIG_AUDIT_ARCH=y
55CONFIG_GENERIC_BUG=y 58CONFIG_GENERIC_BUG=y
59CONFIG_DTC=y
56CONFIG_DEFAULT_UIMAGE=y 60CONFIG_DEFAULT_UIMAGE=y
57CONFIG_ARCH_SUSPEND_POSSIBLE=y 61CONFIG_ARCH_SUSPEND_POSSIBLE=y
58# CONFIG_PPC_DCR_NATIVE is not set 62# CONFIG_PPC_DCR_NATIVE is not set
59# CONFIG_PPC_DCR_MMIO is not set 63# CONFIG_PPC_DCR_MMIO is not set
60CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y 64CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y
61CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" 65CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
66CONFIG_CONSTRUCTORS=y
62 67
63# 68#
64# General setup 69# General setup
@@ -107,7 +112,6 @@ CONFIG_ANON_INODES=y
107CONFIG_EMBEDDED=y 112CONFIG_EMBEDDED=y
108CONFIG_SYSCTL_SYSCALL=y 113CONFIG_SYSCTL_SYSCALL=y
109# CONFIG_KALLSYMS is not set 114# CONFIG_KALLSYMS is not set
110# CONFIG_STRIP_ASM_SYMS is not set
111CONFIG_HOTPLUG=y 115CONFIG_HOTPLUG=y
112CONFIG_PRINTK=y 116CONFIG_PRINTK=y
113CONFIG_BUG=y 117CONFIG_BUG=y
@@ -120,9 +124,16 @@ CONFIG_TIMERFD=y
120CONFIG_EVENTFD=y 124CONFIG_EVENTFD=y
121CONFIG_SHMEM=y 125CONFIG_SHMEM=y
122CONFIG_AIO=y 126CONFIG_AIO=y
127CONFIG_HAVE_PERF_COUNTERS=y
128
129#
130# Performance Counters
131#
132# CONFIG_PERF_COUNTERS is not set
123CONFIG_VM_EVENT_COUNTERS=y 133CONFIG_VM_EVENT_COUNTERS=y
124CONFIG_PCI_QUIRKS=y 134CONFIG_PCI_QUIRKS=y
125CONFIG_SLUB_DEBUG=y 135CONFIG_SLUB_DEBUG=y
136# CONFIG_STRIP_ASM_SYMS is not set
126CONFIG_COMPAT_BRK=y 137CONFIG_COMPAT_BRK=y
127# CONFIG_SLAB is not set 138# CONFIG_SLAB is not set
128CONFIG_SLUB=y 139CONFIG_SLUB=y
@@ -135,6 +146,10 @@ CONFIG_HAVE_IOREMAP_PROT=y
135CONFIG_HAVE_KPROBES=y 146CONFIG_HAVE_KPROBES=y
136CONFIG_HAVE_KRETPROBES=y 147CONFIG_HAVE_KRETPROBES=y
137CONFIG_HAVE_ARCH_TRACEHOOK=y 148CONFIG_HAVE_ARCH_TRACEHOOK=y
149
150#
151# GCOV-based kernel profiling
152#
138# CONFIG_SLOW_WORK is not set 153# CONFIG_SLOW_WORK is not set
139# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set 154# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
140CONFIG_SLABINFO=y 155CONFIG_SLABINFO=y
@@ -147,7 +162,7 @@ CONFIG_MODULE_UNLOAD=y
147# CONFIG_MODVERSIONS is not set 162# CONFIG_MODVERSIONS is not set
148# CONFIG_MODULE_SRCVERSION_ALL is not set 163# CONFIG_MODULE_SRCVERSION_ALL is not set
149CONFIG_BLOCK=y 164CONFIG_BLOCK=y
150# CONFIG_LBD is not set 165CONFIG_LBDAF=y
151# CONFIG_BLK_DEV_BSG is not set 166# CONFIG_BLK_DEV_BSG is not set
152# CONFIG_BLK_DEV_INTEGRITY is not set 167# CONFIG_BLK_DEV_INTEGRITY is not set
153 168
@@ -189,6 +204,7 @@ CONFIG_MPC834x_MDS=y
189# CONFIG_MPC837x_RDB is not set 204# CONFIG_MPC837x_RDB is not set
190# CONFIG_SBC834x is not set 205# CONFIG_SBC834x is not set
191# CONFIG_ASP834x is not set 206# CONFIG_ASP834x is not set
207# CONFIG_KMETER1 is not set
192CONFIG_PPC_MPC834x=y 208CONFIG_PPC_MPC834x=y
193# CONFIG_PPC_86xx is not set 209# CONFIG_PPC_86xx is not set
194# CONFIG_EMBEDDED6xx is not set 210# CONFIG_EMBEDDED6xx is not set
@@ -234,6 +250,7 @@ CONFIG_BINFMT_ELF=y
234# CONFIG_HAVE_AOUT is not set 250# CONFIG_HAVE_AOUT is not set
235# CONFIG_BINFMT_MISC is not set 251# CONFIG_BINFMT_MISC is not set
236# CONFIG_IOMMU_HELPER is not set 252# CONFIG_IOMMU_HELPER is not set
253# CONFIG_SWIOTLB is not set
237CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y 254CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
238CONFIG_ARCH_HAS_WALK_MEMORY=y 255CONFIG_ARCH_HAS_WALK_MEMORY=y
239CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y 256CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y
@@ -254,9 +271,9 @@ CONFIG_MIGRATION=y
254CONFIG_ZONE_DMA_FLAG=1 271CONFIG_ZONE_DMA_FLAG=1
255CONFIG_BOUNCE=y 272CONFIG_BOUNCE=y
256CONFIG_VIRT_TO_BUS=y 273CONFIG_VIRT_TO_BUS=y
257CONFIG_UNEVICTABLE_LRU=y
258CONFIG_HAVE_MLOCK=y 274CONFIG_HAVE_MLOCK=y
259CONFIG_HAVE_MLOCKED_PAGE_BIT=y 275CONFIG_HAVE_MLOCKED_PAGE_BIT=y
276CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
260CONFIG_PPC_4K_PAGES=y 277CONFIG_PPC_4K_PAGES=y
261# CONFIG_PPC_16K_PAGES is not set 278# CONFIG_PPC_16K_PAGES is not set
262# CONFIG_PPC_64K_PAGES is not set 279# CONFIG_PPC_64K_PAGES is not set
@@ -365,6 +382,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
365# CONFIG_ECONET is not set 382# CONFIG_ECONET is not set
366# CONFIG_WAN_ROUTER is not set 383# CONFIG_WAN_ROUTER is not set
367# CONFIG_PHONET is not set 384# CONFIG_PHONET is not set
385# CONFIG_IEEE802154 is not set
368# CONFIG_NET_SCHED is not set 386# CONFIG_NET_SCHED is not set
369# CONFIG_DCB is not set 387# CONFIG_DCB is not set
370 388
@@ -382,7 +400,11 @@ CONFIG_WIRELESS=y
382CONFIG_WIRELESS_OLD_REGULATORY=y 400CONFIG_WIRELESS_OLD_REGULATORY=y
383# CONFIG_WIRELESS_EXT is not set 401# CONFIG_WIRELESS_EXT is not set
384# CONFIG_LIB80211 is not set 402# CONFIG_LIB80211 is not set
385# CONFIG_MAC80211 is not set 403
404#
405# CFG80211 needs to be enabled for MAC80211
406#
407CONFIG_MAC80211_DEFAULT_PS_VALUE=0
386# CONFIG_WIMAX is not set 408# CONFIG_WIMAX is not set
387# CONFIG_RFKILL is not set 409# CONFIG_RFKILL is not set
388# CONFIG_NET_9P is not set 410# CONFIG_NET_9P is not set
@@ -403,6 +425,7 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y
403# CONFIG_MTD is not set 425# CONFIG_MTD is not set
404CONFIG_OF_DEVICE=y 426CONFIG_OF_DEVICE=y
405CONFIG_OF_I2C=y 427CONFIG_OF_I2C=y
428CONFIG_OF_MDIO=y
406# CONFIG_PARPORT is not set 429# CONFIG_PARPORT is not set
407CONFIG_BLK_DEV=y 430CONFIG_BLK_DEV=y
408# CONFIG_BLK_DEV_FD is not set 431# CONFIG_BLK_DEV_FD is not set
@@ -437,7 +460,9 @@ CONFIG_MISC_DEVICES=y
437# 460#
438# CONFIG_EEPROM_AT24 is not set 461# CONFIG_EEPROM_AT24 is not set
439# CONFIG_EEPROM_LEGACY is not set 462# CONFIG_EEPROM_LEGACY is not set
463# CONFIG_EEPROM_MAX6875 is not set
440# CONFIG_EEPROM_93CX6 is not set 464# CONFIG_EEPROM_93CX6 is not set
465# CONFIG_CB710_CORE is not set
441CONFIG_HAVE_IDE=y 466CONFIG_HAVE_IDE=y
442# CONFIG_IDE is not set 467# CONFIG_IDE is not set
443 468
@@ -457,14 +482,17 @@ CONFIG_HAVE_IDE=y
457# 482#
458 483
459# 484#
460# Enable only one of the two stacks, unless you know what you are doing 485# You can enable one or both FireWire driver stacks.
486#
487
488#
489# See the help texts for more information.
461# 490#
462# CONFIG_FIREWIRE is not set 491# CONFIG_FIREWIRE is not set
463# CONFIG_IEEE1394 is not set 492# CONFIG_IEEE1394 is not set
464# CONFIG_I2O is not set 493# CONFIG_I2O is not set
465# CONFIG_MACINTOSH_DRIVERS is not set 494# CONFIG_MACINTOSH_DRIVERS is not set
466CONFIG_NETDEVICES=y 495CONFIG_NETDEVICES=y
467CONFIG_COMPAT_NET_DEV_OPS=y
468# CONFIG_DUMMY is not set 496# CONFIG_DUMMY is not set
469# CONFIG_BONDING is not set 497# CONFIG_BONDING is not set
470# CONFIG_MACVLAN is not set 498# CONFIG_MACVLAN is not set
@@ -527,6 +555,7 @@ CONFIG_E100=y
527# CONFIG_SMSC9420 is not set 555# CONFIG_SMSC9420 is not set
528# CONFIG_SUNDANCE is not set 556# CONFIG_SUNDANCE is not set
529# CONFIG_TLAN is not set 557# CONFIG_TLAN is not set
558# CONFIG_KS8842 is not set
530# CONFIG_VIA_RHINE is not set 559# CONFIG_VIA_RHINE is not set
531# CONFIG_SC92031 is not set 560# CONFIG_SC92031 is not set
532# CONFIG_ATL2 is not set 561# CONFIG_ATL2 is not set
@@ -548,8 +577,10 @@ CONFIG_NETDEV_1000=y
548# CONFIG_VIA_VELOCITY is not set 577# CONFIG_VIA_VELOCITY is not set
549# CONFIG_TIGON3 is not set 578# CONFIG_TIGON3 is not set
550# CONFIG_BNX2 is not set 579# CONFIG_BNX2 is not set
580# CONFIG_CNIC is not set
551CONFIG_FSL_PQ_MDIO=y 581CONFIG_FSL_PQ_MDIO=y
552CONFIG_GIANFAR=y 582CONFIG_GIANFAR=y
583# CONFIG_MV643XX_ETH is not set
553# CONFIG_QLA3XXX is not set 584# CONFIG_QLA3XXX is not set
554# CONFIG_ATL1 is not set 585# CONFIG_ATL1 is not set
555# CONFIG_ATL1E is not set 586# CONFIG_ATL1E is not set
@@ -724,13 +755,17 @@ CONFIG_I2C_MPC=y
724# CONFIG_SENSORS_PCF8574 is not set 755# CONFIG_SENSORS_PCF8574 is not set
725# CONFIG_PCF8575 is not set 756# CONFIG_PCF8575 is not set
726# CONFIG_SENSORS_PCA9539 is not set 757# CONFIG_SENSORS_PCA9539 is not set
727# CONFIG_SENSORS_MAX6875 is not set
728# CONFIG_SENSORS_TSL2550 is not set 758# CONFIG_SENSORS_TSL2550 is not set
729# CONFIG_I2C_DEBUG_CORE is not set 759# CONFIG_I2C_DEBUG_CORE is not set
730# CONFIG_I2C_DEBUG_ALGO is not set 760# CONFIG_I2C_DEBUG_ALGO is not set
731# CONFIG_I2C_DEBUG_BUS is not set 761# CONFIG_I2C_DEBUG_BUS is not set
732# CONFIG_I2C_DEBUG_CHIP is not set 762# CONFIG_I2C_DEBUG_CHIP is not set
733# CONFIG_SPI is not set 763# CONFIG_SPI is not set
764
765#
766# PPS support
767#
768# CONFIG_PPS is not set
734CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y 769CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
735# CONFIG_GPIOLIB is not set 770# CONFIG_GPIOLIB is not set
736# CONFIG_W1 is not set 771# CONFIG_W1 is not set
@@ -785,6 +820,7 @@ CONFIG_HWMON=y
785# CONFIG_SENSORS_SMSC47B397 is not set 820# CONFIG_SENSORS_SMSC47B397 is not set
786# CONFIG_SENSORS_ADS7828 is not set 821# CONFIG_SENSORS_ADS7828 is not set
787# CONFIG_SENSORS_THMC50 is not set 822# CONFIG_SENSORS_THMC50 is not set
823# CONFIG_SENSORS_TMP401 is not set
788# CONFIG_SENSORS_VIA686A is not set 824# CONFIG_SENSORS_VIA686A is not set
789# CONFIG_SENSORS_VT1211 is not set 825# CONFIG_SENSORS_VT1211 is not set
790# CONFIG_SENSORS_VT8231 is not set 826# CONFIG_SENSORS_VT8231 is not set
@@ -833,23 +869,9 @@ CONFIG_SSB_POSSIBLE=y
833# CONFIG_MFD_WM8400 is not set 869# CONFIG_MFD_WM8400 is not set
834# CONFIG_MFD_WM8350_I2C is not set 870# CONFIG_MFD_WM8350_I2C is not set
835# CONFIG_MFD_PCF50633 is not set 871# CONFIG_MFD_PCF50633 is not set
872# CONFIG_AB3100_CORE is not set
836# CONFIG_REGULATOR is not set 873# CONFIG_REGULATOR is not set
837 874# CONFIG_MEDIA_SUPPORT is not set
838#
839# Multimedia devices
840#
841
842#
843# Multimedia core support
844#
845# CONFIG_VIDEO_DEV is not set
846# CONFIG_DVB_CORE is not set
847# CONFIG_VIDEO_MEDIA is not set
848
849#
850# Multimedia drivers
851#
852CONFIG_DAB=y
853 875
854# 876#
855# Graphics support 877# Graphics support
@@ -933,6 +955,7 @@ CONFIG_RTC_DRV_DS1374=y
933# CONFIG_RTC_DRV_S35390A is not set 955# CONFIG_RTC_DRV_S35390A is not set
934# CONFIG_RTC_DRV_FM3130 is not set 956# CONFIG_RTC_DRV_FM3130 is not set
935# CONFIG_RTC_DRV_RX8581 is not set 957# CONFIG_RTC_DRV_RX8581 is not set
958# CONFIG_RTC_DRV_RX8025 is not set
936 959
937# 960#
938# SPI RTC drivers 961# SPI RTC drivers
@@ -960,6 +983,10 @@ CONFIG_RTC_DRV_DS1374=y
960# CONFIG_DMADEVICES is not set 983# CONFIG_DMADEVICES is not set
961# CONFIG_AUXDISPLAY is not set 984# CONFIG_AUXDISPLAY is not set
962# CONFIG_UIO is not set 985# CONFIG_UIO is not set
986
987#
988# TI VLYNQ
989#
963# CONFIG_STAGING is not set 990# CONFIG_STAGING is not set
964 991
965# 992#
@@ -979,10 +1006,12 @@ CONFIG_FS_MBCACHE=y
979# CONFIG_REISERFS_FS is not set 1006# CONFIG_REISERFS_FS is not set
980# CONFIG_JFS_FS is not set 1007# CONFIG_JFS_FS is not set
981# CONFIG_FS_POSIX_ACL is not set 1008# CONFIG_FS_POSIX_ACL is not set
982CONFIG_FILE_LOCKING=y
983# CONFIG_XFS_FS is not set 1009# CONFIG_XFS_FS is not set
1010# CONFIG_GFS2_FS is not set
984# CONFIG_OCFS2_FS is not set 1011# CONFIG_OCFS2_FS is not set
985# CONFIG_BTRFS_FS is not set 1012# CONFIG_BTRFS_FS is not set
1013CONFIG_FILE_LOCKING=y
1014CONFIG_FSNOTIFY=y
986CONFIG_DNOTIFY=y 1015CONFIG_DNOTIFY=y
987CONFIG_INOTIFY=y 1016CONFIG_INOTIFY=y
988CONFIG_INOTIFY_USER=y 1017CONFIG_INOTIFY_USER=y
@@ -1045,6 +1074,7 @@ CONFIG_NFS_FS=y
1045CONFIG_NFS_V3=y 1074CONFIG_NFS_V3=y
1046# CONFIG_NFS_V3_ACL is not set 1075# CONFIG_NFS_V3_ACL is not set
1047CONFIG_NFS_V4=y 1076CONFIG_NFS_V4=y
1077# CONFIG_NFS_V4_1 is not set
1048CONFIG_ROOT_NFS=y 1078CONFIG_ROOT_NFS=y
1049# CONFIG_NFSD is not set 1079# CONFIG_NFSD is not set
1050CONFIG_LOCKD=y 1080CONFIG_LOCKD=y
@@ -1100,6 +1130,7 @@ CONFIG_HAS_IOPORT=y
1100CONFIG_HAS_DMA=y 1130CONFIG_HAS_DMA=y
1101CONFIG_HAVE_LMB=y 1131CONFIG_HAVE_LMB=y
1102CONFIG_NLATTR=y 1132CONFIG_NLATTR=y
1133CONFIG_GENERIC_ATOMIC64=y
1103 1134
1104# 1135#
1105# Kernel hacking 1136# Kernel hacking
@@ -1125,22 +1156,11 @@ CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
1125CONFIG_HAVE_DYNAMIC_FTRACE=y 1156CONFIG_HAVE_DYNAMIC_FTRACE=y
1126CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y 1157CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
1127CONFIG_TRACING_SUPPORT=y 1158CONFIG_TRACING_SUPPORT=y
1128 1159# CONFIG_FTRACE is not set
1129#
1130# Tracers
1131#
1132# CONFIG_FUNCTION_TRACER is not set
1133# CONFIG_SCHED_TRACER is not set
1134# CONFIG_CONTEXT_SWITCH_TRACER is not set
1135# CONFIG_EVENT_TRACER is not set
1136# CONFIG_BOOT_TRACER is not set
1137# CONFIG_TRACE_BRANCH_PROFILING is not set
1138# CONFIG_STACK_TRACER is not set
1139# CONFIG_KMEMTRACE is not set
1140# CONFIG_WORKQUEUE_TRACER is not set
1141# CONFIG_BLK_DEV_IO_TRACE is not set
1142# CONFIG_SAMPLES is not set 1160# CONFIG_SAMPLES is not set
1143CONFIG_HAVE_ARCH_KGDB=y 1161CONFIG_HAVE_ARCH_KGDB=y
1162# CONFIG_PPC_DISABLE_WERROR is not set
1163CONFIG_PPC_WERROR=y
1144CONFIG_PRINT_STACK_DEPTH=64 1164CONFIG_PRINT_STACK_DEPTH=64
1145# CONFIG_IRQSTACKS is not set 1165# CONFIG_IRQSTACKS is not set
1146# CONFIG_BOOTX_TEXT is not set 1166# CONFIG_BOOTX_TEXT is not set
diff --git a/arch/powerpc/configs/83xx/mpc836x_mds_defconfig b/arch/powerpc/configs/83xx/mpc836x_mds_defconfig
index ce5177393a0d..8c5299d74813 100644
--- a/arch/powerpc/configs/83xx/mpc836x_mds_defconfig
+++ b/arch/powerpc/configs/83xx/mpc836x_mds_defconfig
@@ -1,26 +1,28 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.30-rc3 3# Linux kernel version: 2.6.31-rc4
4# Wed May 13 17:22:12 2009 4# Wed Jul 29 23:32:10 2009
5# 5#
6# CONFIG_PPC64 is not set 6# CONFIG_PPC64 is not set
7 7
8# 8#
9# Processor support 9# Processor support
10# 10#
11CONFIG_6xx=y 11CONFIG_PPC_BOOK3S_32=y
12# CONFIG_PPC_85xx is not set 12# CONFIG_PPC_85xx is not set
13# CONFIG_PPC_8xx is not set 13# CONFIG_PPC_8xx is not set
14# CONFIG_40x is not set 14# CONFIG_40x is not set
15# CONFIG_44x is not set 15# CONFIG_44x is not set
16# CONFIG_E200 is not set 16# CONFIG_E200 is not set
17CONFIG_PPC_BOOK3S=y 17CONFIG_PPC_BOOK3S=y
18CONFIG_6xx=y
18CONFIG_PPC_FPU=y 19CONFIG_PPC_FPU=y
19# CONFIG_FSL_EMB_PERFMON is not set 20# CONFIG_FSL_EMB_PERFMON is not set
20# CONFIG_ALTIVEC is not set 21# CONFIG_ALTIVEC is not set
21CONFIG_PPC_STD_MMU=y 22CONFIG_PPC_STD_MMU=y
22CONFIG_PPC_STD_MMU_32=y 23CONFIG_PPC_STD_MMU_32=y
23# CONFIG_PPC_MM_SLICES is not set 24# CONFIG_PPC_MM_SLICES is not set
25CONFIG_PPC_HAVE_PMU_SUPPORT=y
24# CONFIG_SMP is not set 26# CONFIG_SMP is not set
25CONFIG_PPC32=y 27CONFIG_PPC32=y
26CONFIG_WORD_SIZE=32 28CONFIG_WORD_SIZE=32
@@ -31,15 +33,16 @@ CONFIG_GENERIC_TIME=y
31CONFIG_GENERIC_TIME_VSYSCALL=y 33CONFIG_GENERIC_TIME_VSYSCALL=y
32CONFIG_GENERIC_CLOCKEVENTS=y 34CONFIG_GENERIC_CLOCKEVENTS=y
33CONFIG_GENERIC_HARDIRQS=y 35CONFIG_GENERIC_HARDIRQS=y
36CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
34# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set 37# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set
35CONFIG_IRQ_PER_CPU=y 38CONFIG_IRQ_PER_CPU=y
36CONFIG_STACKTRACE_SUPPORT=y 39CONFIG_STACKTRACE_SUPPORT=y
37CONFIG_HAVE_LATENCYTOP_SUPPORT=y 40CONFIG_HAVE_LATENCYTOP_SUPPORT=y
41CONFIG_TRACE_IRQFLAGS_SUPPORT=y
38CONFIG_LOCKDEP_SUPPORT=y 42CONFIG_LOCKDEP_SUPPORT=y
39CONFIG_RWSEM_XCHGADD_ALGORITHM=y 43CONFIG_RWSEM_XCHGADD_ALGORITHM=y
40CONFIG_ARCH_HAS_ILOG2_U32=y 44CONFIG_ARCH_HAS_ILOG2_U32=y
41CONFIG_GENERIC_HWEIGHT=y 45CONFIG_GENERIC_HWEIGHT=y
42CONFIG_GENERIC_CALIBRATE_DELAY=y
43CONFIG_GENERIC_FIND_NEXT_BIT=y 46CONFIG_GENERIC_FIND_NEXT_BIT=y
44# CONFIG_ARCH_NO_VIRT_TO_BUS is not set 47# CONFIG_ARCH_NO_VIRT_TO_BUS is not set
45CONFIG_PPC=y 48CONFIG_PPC=y
@@ -53,12 +56,14 @@ CONFIG_PPC_UDBG_16550=y
53# CONFIG_GENERIC_TBSYNC is not set 56# CONFIG_GENERIC_TBSYNC is not set
54CONFIG_AUDIT_ARCH=y 57CONFIG_AUDIT_ARCH=y
55CONFIG_GENERIC_BUG=y 58CONFIG_GENERIC_BUG=y
59CONFIG_DTC=y
56CONFIG_DEFAULT_UIMAGE=y 60CONFIG_DEFAULT_UIMAGE=y
57CONFIG_ARCH_SUSPEND_POSSIBLE=y 61CONFIG_ARCH_SUSPEND_POSSIBLE=y
58# CONFIG_PPC_DCR_NATIVE is not set 62# CONFIG_PPC_DCR_NATIVE is not set
59# CONFIG_PPC_DCR_MMIO is not set 63# CONFIG_PPC_DCR_MMIO is not set
60CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y 64CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y
61CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" 65CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
66CONFIG_CONSTRUCTORS=y
62 67
63# 68#
64# General setup 69# General setup
@@ -107,7 +112,6 @@ CONFIG_ANON_INODES=y
107CONFIG_EMBEDDED=y 112CONFIG_EMBEDDED=y
108CONFIG_SYSCTL_SYSCALL=y 113CONFIG_SYSCTL_SYSCALL=y
109# CONFIG_KALLSYMS is not set 114# CONFIG_KALLSYMS is not set
110# CONFIG_STRIP_ASM_SYMS is not set
111CONFIG_HOTPLUG=y 115CONFIG_HOTPLUG=y
112CONFIG_PRINTK=y 116CONFIG_PRINTK=y
113CONFIG_BUG=y 117CONFIG_BUG=y
@@ -120,9 +124,16 @@ CONFIG_TIMERFD=y
120CONFIG_EVENTFD=y 124CONFIG_EVENTFD=y
121CONFIG_SHMEM=y 125CONFIG_SHMEM=y
122CONFIG_AIO=y 126CONFIG_AIO=y
127CONFIG_HAVE_PERF_COUNTERS=y
128
129#
130# Performance Counters
131#
132# CONFIG_PERF_COUNTERS is not set
123CONFIG_VM_EVENT_COUNTERS=y 133CONFIG_VM_EVENT_COUNTERS=y
124CONFIG_PCI_QUIRKS=y 134CONFIG_PCI_QUIRKS=y
125CONFIG_SLUB_DEBUG=y 135CONFIG_SLUB_DEBUG=y
136# CONFIG_STRIP_ASM_SYMS is not set
126CONFIG_COMPAT_BRK=y 137CONFIG_COMPAT_BRK=y
127# CONFIG_SLAB is not set 138# CONFIG_SLAB is not set
128CONFIG_SLUB=y 139CONFIG_SLUB=y
@@ -135,6 +146,10 @@ CONFIG_HAVE_IOREMAP_PROT=y
135CONFIG_HAVE_KPROBES=y 146CONFIG_HAVE_KPROBES=y
136CONFIG_HAVE_KRETPROBES=y 147CONFIG_HAVE_KRETPROBES=y
137CONFIG_HAVE_ARCH_TRACEHOOK=y 148CONFIG_HAVE_ARCH_TRACEHOOK=y
149
150#
151# GCOV-based kernel profiling
152#
138# CONFIG_SLOW_WORK is not set 153# CONFIG_SLOW_WORK is not set
139# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set 154# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
140CONFIG_SLABINFO=y 155CONFIG_SLABINFO=y
@@ -147,7 +162,7 @@ CONFIG_MODULE_UNLOAD=y
147# CONFIG_MODVERSIONS is not set 162# CONFIG_MODVERSIONS is not set
148# CONFIG_MODULE_SRCVERSION_ALL is not set 163# CONFIG_MODULE_SRCVERSION_ALL is not set
149CONFIG_BLOCK=y 164CONFIG_BLOCK=y
150# CONFIG_LBD is not set 165CONFIG_LBDAF=y
151# CONFIG_BLK_DEV_BSG is not set 166# CONFIG_BLK_DEV_BSG is not set
152# CONFIG_BLK_DEV_INTEGRITY is not set 167# CONFIG_BLK_DEV_INTEGRITY is not set
153 168
@@ -189,6 +204,7 @@ CONFIG_MPC836x_MDS=y
189# CONFIG_MPC837x_RDB is not set 204# CONFIG_MPC837x_RDB is not set
190# CONFIG_SBC834x is not set 205# CONFIG_SBC834x is not set
191# CONFIG_ASP834x is not set 206# CONFIG_ASP834x is not set
207# CONFIG_KMETER1 is not set
192# CONFIG_PPC_86xx is not set 208# CONFIG_PPC_86xx is not set
193# CONFIG_EMBEDDED6xx is not set 209# CONFIG_EMBEDDED6xx is not set
194# CONFIG_AMIGAONE is not set 210# CONFIG_AMIGAONE is not set
@@ -233,6 +249,7 @@ CONFIG_BINFMT_ELF=y
233# CONFIG_HAVE_AOUT is not set 249# CONFIG_HAVE_AOUT is not set
234# CONFIG_BINFMT_MISC is not set 250# CONFIG_BINFMT_MISC is not set
235# CONFIG_IOMMU_HELPER is not set 251# CONFIG_IOMMU_HELPER is not set
252# CONFIG_SWIOTLB is not set
236CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y 253CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
237CONFIG_ARCH_HAS_WALK_MEMORY=y 254CONFIG_ARCH_HAS_WALK_MEMORY=y
238CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y 255CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y
@@ -253,9 +270,9 @@ CONFIG_MIGRATION=y
253CONFIG_ZONE_DMA_FLAG=1 270CONFIG_ZONE_DMA_FLAG=1
254CONFIG_BOUNCE=y 271CONFIG_BOUNCE=y
255CONFIG_VIRT_TO_BUS=y 272CONFIG_VIRT_TO_BUS=y
256CONFIG_UNEVICTABLE_LRU=y
257CONFIG_HAVE_MLOCK=y 273CONFIG_HAVE_MLOCK=y
258CONFIG_HAVE_MLOCKED_PAGE_BIT=y 274CONFIG_HAVE_MLOCKED_PAGE_BIT=y
275CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
259CONFIG_PPC_4K_PAGES=y 276CONFIG_PPC_4K_PAGES=y
260# CONFIG_PPC_16K_PAGES is not set 277# CONFIG_PPC_16K_PAGES is not set
261# CONFIG_PPC_64K_PAGES is not set 278# CONFIG_PPC_64K_PAGES is not set
@@ -364,6 +381,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
364# CONFIG_ECONET is not set 381# CONFIG_ECONET is not set
365# CONFIG_WAN_ROUTER is not set 382# CONFIG_WAN_ROUTER is not set
366# CONFIG_PHONET is not set 383# CONFIG_PHONET is not set
384# CONFIG_IEEE802154 is not set
367# CONFIG_NET_SCHED is not set 385# CONFIG_NET_SCHED is not set
368# CONFIG_DCB is not set 386# CONFIG_DCB is not set
369 387
@@ -381,7 +399,11 @@ CONFIG_WIRELESS=y
381CONFIG_WIRELESS_OLD_REGULATORY=y 399CONFIG_WIRELESS_OLD_REGULATORY=y
382# CONFIG_WIRELESS_EXT is not set 400# CONFIG_WIRELESS_EXT is not set
383# CONFIG_LIB80211 is not set 401# CONFIG_LIB80211 is not set
384# CONFIG_MAC80211 is not set 402
403#
404# CFG80211 needs to be enabled for MAC80211
405#
406CONFIG_MAC80211_DEFAULT_PS_VALUE=0
385# CONFIG_WIMAX is not set 407# CONFIG_WIMAX is not set
386# CONFIG_RFKILL is not set 408# CONFIG_RFKILL is not set
387# CONFIG_NET_9P is not set 409# CONFIG_NET_9P is not set
@@ -485,6 +507,7 @@ CONFIG_MTD_PHYSMAP_OF=y
485# CONFIG_MTD_UBI is not set 507# CONFIG_MTD_UBI is not set
486CONFIG_OF_DEVICE=y 508CONFIG_OF_DEVICE=y
487CONFIG_OF_I2C=y 509CONFIG_OF_I2C=y
510CONFIG_OF_MDIO=y
488# CONFIG_PARPORT is not set 511# CONFIG_PARPORT is not set
489CONFIG_BLK_DEV=y 512CONFIG_BLK_DEV=y
490# CONFIG_BLK_DEV_FD is not set 513# CONFIG_BLK_DEV_FD is not set
@@ -519,7 +542,9 @@ CONFIG_MISC_DEVICES=y
519# 542#
520# CONFIG_EEPROM_AT24 is not set 543# CONFIG_EEPROM_AT24 is not set
521# CONFIG_EEPROM_LEGACY is not set 544# CONFIG_EEPROM_LEGACY is not set
545# CONFIG_EEPROM_MAX6875 is not set
522# CONFIG_EEPROM_93CX6 is not set 546# CONFIG_EEPROM_93CX6 is not set
547# CONFIG_CB710_CORE is not set
523CONFIG_HAVE_IDE=y 548CONFIG_HAVE_IDE=y
524# CONFIG_IDE is not set 549# CONFIG_IDE is not set
525 550
@@ -542,10 +567,6 @@ CONFIG_SCSI_PROC_FS=y
542# CONFIG_BLK_DEV_SR is not set 567# CONFIG_BLK_DEV_SR is not set
543# CONFIG_CHR_DEV_SG is not set 568# CONFIG_CHR_DEV_SG is not set
544# CONFIG_CHR_DEV_SCH is not set 569# CONFIG_CHR_DEV_SCH is not set
545
546#
547# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
548#
549# CONFIG_SCSI_MULTI_LUN is not set 570# CONFIG_SCSI_MULTI_LUN is not set
550# CONFIG_SCSI_CONSTANTS is not set 571# CONFIG_SCSI_CONSTANTS is not set
551# CONFIG_SCSI_LOGGING is not set 572# CONFIG_SCSI_LOGGING is not set
@@ -563,6 +584,7 @@ CONFIG_SCSI_WAIT_SCAN=m
563CONFIG_SCSI_LOWLEVEL=y 584CONFIG_SCSI_LOWLEVEL=y
564# CONFIG_ISCSI_TCP is not set 585# CONFIG_ISCSI_TCP is not set
565# CONFIG_SCSI_CXGB3_ISCSI is not set 586# CONFIG_SCSI_CXGB3_ISCSI is not set
587# CONFIG_SCSI_BNX2_ISCSI is not set
566# CONFIG_BLK_DEV_3W_XXXX_RAID is not set 588# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
567# CONFIG_SCSI_3W_9XXX is not set 589# CONFIG_SCSI_3W_9XXX is not set
568# CONFIG_SCSI_ACARD is not set 590# CONFIG_SCSI_ACARD is not set
@@ -571,6 +593,7 @@ CONFIG_SCSI_LOWLEVEL=y
571# CONFIG_SCSI_AIC7XXX_OLD is not set 593# CONFIG_SCSI_AIC7XXX_OLD is not set
572# CONFIG_SCSI_AIC79XX is not set 594# CONFIG_SCSI_AIC79XX is not set
573# CONFIG_SCSI_AIC94XX is not set 595# CONFIG_SCSI_AIC94XX is not set
596# CONFIG_SCSI_MVSAS is not set
574# CONFIG_SCSI_DPT_I2O is not set 597# CONFIG_SCSI_DPT_I2O is not set
575# CONFIG_SCSI_ADVANSYS is not set 598# CONFIG_SCSI_ADVANSYS is not set
576# CONFIG_SCSI_ARCMSR is not set 599# CONFIG_SCSI_ARCMSR is not set
@@ -590,7 +613,6 @@ CONFIG_SCSI_LOWLEVEL=y
590# CONFIG_SCSI_IPS is not set 613# CONFIG_SCSI_IPS is not set
591# CONFIG_SCSI_INITIO is not set 614# CONFIG_SCSI_INITIO is not set
592# CONFIG_SCSI_INIA100 is not set 615# CONFIG_SCSI_INIA100 is not set
593# CONFIG_SCSI_MVSAS is not set
594# CONFIG_SCSI_STEX is not set 616# CONFIG_SCSI_STEX is not set
595# CONFIG_SCSI_SYM53C8XX_2 is not set 617# CONFIG_SCSI_SYM53C8XX_2 is not set
596# CONFIG_SCSI_QLOGIC_1280 is not set 618# CONFIG_SCSI_QLOGIC_1280 is not set
@@ -613,14 +635,17 @@ CONFIG_SCSI_LOWLEVEL=y
613# 635#
614 636
615# 637#
616# Enable only one of the two stacks, unless you know what you are doing 638# You can enable one or both FireWire driver stacks.
639#
640
641#
642# See the help texts for more information.
617# 643#
618# CONFIG_FIREWIRE is not set 644# CONFIG_FIREWIRE is not set
619# CONFIG_IEEE1394 is not set 645# CONFIG_IEEE1394 is not set
620# CONFIG_I2O is not set 646# CONFIG_I2O is not set
621# CONFIG_MACINTOSH_DRIVERS is not set 647# CONFIG_MACINTOSH_DRIVERS is not set
622CONFIG_NETDEVICES=y 648CONFIG_NETDEVICES=y
623CONFIG_COMPAT_NET_DEV_OPS=y
624# CONFIG_DUMMY is not set 649# CONFIG_DUMMY is not set
625# CONFIG_BONDING is not set 650# CONFIG_BONDING is not set
626# CONFIG_MACVLAN is not set 651# CONFIG_MACVLAN is not set
@@ -667,6 +692,7 @@ CONFIG_MII=y
667# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set 692# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
668# CONFIG_NET_PCI is not set 693# CONFIG_NET_PCI is not set
669# CONFIG_B44 is not set 694# CONFIG_B44 is not set
695# CONFIG_KS8842 is not set
670# CONFIG_ATL2 is not set 696# CONFIG_ATL2 is not set
671CONFIG_NETDEV_1000=y 697CONFIG_NETDEV_1000=y
672# CONFIG_ACENIC is not set 698# CONFIG_ACENIC is not set
@@ -686,11 +712,13 @@ CONFIG_NETDEV_1000=y
686# CONFIG_VIA_VELOCITY is not set 712# CONFIG_VIA_VELOCITY is not set
687# CONFIG_TIGON3 is not set 713# CONFIG_TIGON3 is not set
688# CONFIG_BNX2 is not set 714# CONFIG_BNX2 is not set
715# CONFIG_CNIC is not set
689CONFIG_FSL_PQ_MDIO=y 716CONFIG_FSL_PQ_MDIO=y
690# CONFIG_GIANFAR is not set 717# CONFIG_GIANFAR is not set
691CONFIG_UCC_GETH=y 718CONFIG_UCC_GETH=y
692# CONFIG_UGETH_MAGIC_PACKET is not set 719# CONFIG_UGETH_MAGIC_PACKET is not set
693# CONFIG_UGETH_TX_ON_DEMAND is not set 720# CONFIG_UGETH_TX_ON_DEMAND is not set
721# CONFIG_MV643XX_ETH is not set
694# CONFIG_QLA3XXX is not set 722# CONFIG_QLA3XXX is not set
695# CONFIG_ATL1 is not set 723# CONFIG_ATL1 is not set
696# CONFIG_ATL1E is not set 724# CONFIG_ATL1E is not set
@@ -868,13 +896,17 @@ CONFIG_I2C_MPC=y
868# CONFIG_SENSORS_PCF8574 is not set 896# CONFIG_SENSORS_PCF8574 is not set
869# CONFIG_PCF8575 is not set 897# CONFIG_PCF8575 is not set
870# CONFIG_SENSORS_PCA9539 is not set 898# CONFIG_SENSORS_PCA9539 is not set
871# CONFIG_SENSORS_MAX6875 is not set
872# CONFIG_SENSORS_TSL2550 is not set 899# CONFIG_SENSORS_TSL2550 is not set
873# CONFIG_I2C_DEBUG_CORE is not set 900# CONFIG_I2C_DEBUG_CORE is not set
874# CONFIG_I2C_DEBUG_ALGO is not set 901# CONFIG_I2C_DEBUG_ALGO is not set
875# CONFIG_I2C_DEBUG_BUS is not set 902# CONFIG_I2C_DEBUG_BUS is not set
876# CONFIG_I2C_DEBUG_CHIP is not set 903# CONFIG_I2C_DEBUG_CHIP is not set
877# CONFIG_SPI is not set 904# CONFIG_SPI is not set
905
906#
907# PPS support
908#
909# CONFIG_PPS is not set
878CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y 910CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
879# CONFIG_GPIOLIB is not set 911# CONFIG_GPIOLIB is not set
880# CONFIG_W1 is not set 912# CONFIG_W1 is not set
@@ -929,6 +961,7 @@ CONFIG_HWMON=y
929# CONFIG_SENSORS_SMSC47B397 is not set 961# CONFIG_SENSORS_SMSC47B397 is not set
930# CONFIG_SENSORS_ADS7828 is not set 962# CONFIG_SENSORS_ADS7828 is not set
931# CONFIG_SENSORS_THMC50 is not set 963# CONFIG_SENSORS_THMC50 is not set
964# CONFIG_SENSORS_TMP401 is not set
932# CONFIG_SENSORS_VIA686A is not set 965# CONFIG_SENSORS_VIA686A is not set
933# CONFIG_SENSORS_VT1211 is not set 966# CONFIG_SENSORS_VT1211 is not set
934# CONFIG_SENSORS_VT8231 is not set 967# CONFIG_SENSORS_VT8231 is not set
@@ -977,23 +1010,9 @@ CONFIG_SSB_POSSIBLE=y
977# CONFIG_MFD_WM8400 is not set 1010# CONFIG_MFD_WM8400 is not set
978# CONFIG_MFD_WM8350_I2C is not set 1011# CONFIG_MFD_WM8350_I2C is not set
979# CONFIG_MFD_PCF50633 is not set 1012# CONFIG_MFD_PCF50633 is not set
1013# CONFIG_AB3100_CORE is not set
980# CONFIG_REGULATOR is not set 1014# CONFIG_REGULATOR is not set
981 1015# CONFIG_MEDIA_SUPPORT is not set
982#
983# Multimedia devices
984#
985
986#
987# Multimedia core support
988#
989# CONFIG_VIDEO_DEV is not set
990# CONFIG_DVB_CORE is not set
991# CONFIG_VIDEO_MEDIA is not set
992
993#
994# Multimedia drivers
995#
996CONFIG_DAB=y
997 1016
998# 1017#
999# Graphics support 1018# Graphics support
@@ -1077,6 +1096,7 @@ CONFIG_RTC_DRV_DS1374=y
1077# CONFIG_RTC_DRV_S35390A is not set 1096# CONFIG_RTC_DRV_S35390A is not set
1078# CONFIG_RTC_DRV_FM3130 is not set 1097# CONFIG_RTC_DRV_FM3130 is not set
1079# CONFIG_RTC_DRV_RX8581 is not set 1098# CONFIG_RTC_DRV_RX8581 is not set
1099# CONFIG_RTC_DRV_RX8025 is not set
1080 1100
1081# 1101#
1082# SPI RTC drivers 1102# SPI RTC drivers
@@ -1104,6 +1124,10 @@ CONFIG_RTC_DRV_DS1374=y
1104# CONFIG_DMADEVICES is not set 1124# CONFIG_DMADEVICES is not set
1105# CONFIG_AUXDISPLAY is not set 1125# CONFIG_AUXDISPLAY is not set
1106# CONFIG_UIO is not set 1126# CONFIG_UIO is not set
1127
1128#
1129# TI VLYNQ
1130#
1107# CONFIG_STAGING is not set 1131# CONFIG_STAGING is not set
1108 1132
1109# 1133#
@@ -1123,10 +1147,12 @@ CONFIG_FS_MBCACHE=y
1123# CONFIG_REISERFS_FS is not set 1147# CONFIG_REISERFS_FS is not set
1124# CONFIG_JFS_FS is not set 1148# CONFIG_JFS_FS is not set
1125# CONFIG_FS_POSIX_ACL is not set 1149# CONFIG_FS_POSIX_ACL is not set
1126CONFIG_FILE_LOCKING=y
1127# CONFIG_XFS_FS is not set 1150# CONFIG_XFS_FS is not set
1151# CONFIG_GFS2_FS is not set
1128# CONFIG_OCFS2_FS is not set 1152# CONFIG_OCFS2_FS is not set
1129# CONFIG_BTRFS_FS is not set 1153# CONFIG_BTRFS_FS is not set
1154CONFIG_FILE_LOCKING=y
1155CONFIG_FSNOTIFY=y
1130CONFIG_DNOTIFY=y 1156CONFIG_DNOTIFY=y
1131CONFIG_INOTIFY=y 1157CONFIG_INOTIFY=y
1132CONFIG_INOTIFY_USER=y 1158CONFIG_INOTIFY_USER=y
@@ -1190,6 +1216,7 @@ CONFIG_NFS_FS=y
1190CONFIG_NFS_V3=y 1216CONFIG_NFS_V3=y
1191# CONFIG_NFS_V3_ACL is not set 1217# CONFIG_NFS_V3_ACL is not set
1192CONFIG_NFS_V4=y 1218CONFIG_NFS_V4=y
1219# CONFIG_NFS_V4_1 is not set
1193CONFIG_ROOT_NFS=y 1220CONFIG_ROOT_NFS=y
1194# CONFIG_NFSD is not set 1221# CONFIG_NFSD is not set
1195CONFIG_LOCKD=y 1222CONFIG_LOCKD=y
@@ -1247,6 +1274,7 @@ CONFIG_HAS_IOPORT=y
1247CONFIG_HAS_DMA=y 1274CONFIG_HAS_DMA=y
1248CONFIG_HAVE_LMB=y 1275CONFIG_HAVE_LMB=y
1249CONFIG_NLATTR=y 1276CONFIG_NLATTR=y
1277CONFIG_GENERIC_ATOMIC64=y
1250 1278
1251# 1279#
1252# Kernel hacking 1280# Kernel hacking
@@ -1272,22 +1300,11 @@ CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
1272CONFIG_HAVE_DYNAMIC_FTRACE=y 1300CONFIG_HAVE_DYNAMIC_FTRACE=y
1273CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y 1301CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
1274CONFIG_TRACING_SUPPORT=y 1302CONFIG_TRACING_SUPPORT=y
1275 1303# CONFIG_FTRACE is not set
1276#
1277# Tracers
1278#
1279# CONFIG_FUNCTION_TRACER is not set
1280# CONFIG_SCHED_TRACER is not set
1281# CONFIG_CONTEXT_SWITCH_TRACER is not set
1282# CONFIG_EVENT_TRACER is not set
1283# CONFIG_BOOT_TRACER is not set
1284# CONFIG_TRACE_BRANCH_PROFILING is not set
1285# CONFIG_STACK_TRACER is not set
1286# CONFIG_KMEMTRACE is not set
1287# CONFIG_WORKQUEUE_TRACER is not set
1288# CONFIG_BLK_DEV_IO_TRACE is not set
1289# CONFIG_SAMPLES is not set 1304# CONFIG_SAMPLES is not set
1290CONFIG_HAVE_ARCH_KGDB=y 1305CONFIG_HAVE_ARCH_KGDB=y
1306# CONFIG_PPC_DISABLE_WERROR is not set
1307CONFIG_PPC_WERROR=y
1291CONFIG_PRINT_STACK_DEPTH=64 1308CONFIG_PRINT_STACK_DEPTH=64
1292# CONFIG_IRQSTACKS is not set 1309# CONFIG_IRQSTACKS is not set
1293# CONFIG_BOOTX_TEXT is not set 1310# CONFIG_BOOTX_TEXT is not set
diff --git a/arch/powerpc/configs/83xx/mpc836x_rdk_defconfig b/arch/powerpc/configs/83xx/mpc836x_rdk_defconfig
index 7f1d1383a249..ff31667a890b 100644
--- a/arch/powerpc/configs/83xx/mpc836x_rdk_defconfig
+++ b/arch/powerpc/configs/83xx/mpc836x_rdk_defconfig
@@ -1,26 +1,28 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.30-rc3 3# Linux kernel version: 2.6.31-rc4
4# Wed May 13 17:22:13 2009 4# Wed Jul 29 23:32:12 2009
5# 5#
6# CONFIG_PPC64 is not set 6# CONFIG_PPC64 is not set
7 7
8# 8#
9# Processor support 9# Processor support
10# 10#
11CONFIG_6xx=y 11CONFIG_PPC_BOOK3S_32=y
12# CONFIG_PPC_85xx is not set 12# CONFIG_PPC_85xx is not set
13# CONFIG_PPC_8xx is not set 13# CONFIG_PPC_8xx is not set
14# CONFIG_40x is not set 14# CONFIG_40x is not set
15# CONFIG_44x is not set 15# CONFIG_44x is not set
16# CONFIG_E200 is not set 16# CONFIG_E200 is not set
17CONFIG_PPC_BOOK3S=y 17CONFIG_PPC_BOOK3S=y
18CONFIG_6xx=y
18CONFIG_PPC_FPU=y 19CONFIG_PPC_FPU=y
19# CONFIG_FSL_EMB_PERFMON is not set 20# CONFIG_FSL_EMB_PERFMON is not set
20# CONFIG_ALTIVEC is not set 21# CONFIG_ALTIVEC is not set
21CONFIG_PPC_STD_MMU=y 22CONFIG_PPC_STD_MMU=y
22CONFIG_PPC_STD_MMU_32=y 23CONFIG_PPC_STD_MMU_32=y
23# CONFIG_PPC_MM_SLICES is not set 24# CONFIG_PPC_MM_SLICES is not set
25CONFIG_PPC_HAVE_PMU_SUPPORT=y
24# CONFIG_SMP is not set 26# CONFIG_SMP is not set
25CONFIG_PPC32=y 27CONFIG_PPC32=y
26CONFIG_WORD_SIZE=32 28CONFIG_WORD_SIZE=32
@@ -31,15 +33,16 @@ CONFIG_GENERIC_TIME=y
31CONFIG_GENERIC_TIME_VSYSCALL=y 33CONFIG_GENERIC_TIME_VSYSCALL=y
32CONFIG_GENERIC_CLOCKEVENTS=y 34CONFIG_GENERIC_CLOCKEVENTS=y
33CONFIG_GENERIC_HARDIRQS=y 35CONFIG_GENERIC_HARDIRQS=y
36CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
34# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set 37# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set
35CONFIG_IRQ_PER_CPU=y 38CONFIG_IRQ_PER_CPU=y
36CONFIG_STACKTRACE_SUPPORT=y 39CONFIG_STACKTRACE_SUPPORT=y
37CONFIG_HAVE_LATENCYTOP_SUPPORT=y 40CONFIG_HAVE_LATENCYTOP_SUPPORT=y
41CONFIG_TRACE_IRQFLAGS_SUPPORT=y
38CONFIG_LOCKDEP_SUPPORT=y 42CONFIG_LOCKDEP_SUPPORT=y
39CONFIG_RWSEM_XCHGADD_ALGORITHM=y 43CONFIG_RWSEM_XCHGADD_ALGORITHM=y
40CONFIG_ARCH_HAS_ILOG2_U32=y 44CONFIG_ARCH_HAS_ILOG2_U32=y
41CONFIG_GENERIC_HWEIGHT=y 45CONFIG_GENERIC_HWEIGHT=y
42CONFIG_GENERIC_CALIBRATE_DELAY=y
43CONFIG_GENERIC_FIND_NEXT_BIT=y 46CONFIG_GENERIC_FIND_NEXT_BIT=y
44CONFIG_GENERIC_GPIO=y 47CONFIG_GENERIC_GPIO=y
45# CONFIG_ARCH_NO_VIRT_TO_BUS is not set 48# CONFIG_ARCH_NO_VIRT_TO_BUS is not set
@@ -54,12 +57,14 @@ CONFIG_PPC_UDBG_16550=y
54# CONFIG_GENERIC_TBSYNC is not set 57# CONFIG_GENERIC_TBSYNC is not set
55CONFIG_AUDIT_ARCH=y 58CONFIG_AUDIT_ARCH=y
56CONFIG_GENERIC_BUG=y 59CONFIG_GENERIC_BUG=y
60CONFIG_DTC=y
57CONFIG_DEFAULT_UIMAGE=y 61CONFIG_DEFAULT_UIMAGE=y
58CONFIG_ARCH_SUSPEND_POSSIBLE=y 62CONFIG_ARCH_SUSPEND_POSSIBLE=y
59# CONFIG_PPC_DCR_NATIVE is not set 63# CONFIG_PPC_DCR_NATIVE is not set
60# CONFIG_PPC_DCR_MMIO is not set 64# CONFIG_PPC_DCR_MMIO is not set
61CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y 65CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y
62CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" 66CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
67CONFIG_CONSTRUCTORS=y
63 68
64# 69#
65# General setup 70# General setup
@@ -108,7 +113,6 @@ CONFIG_ANON_INODES=y
108CONFIG_EMBEDDED=y 113CONFIG_EMBEDDED=y
109CONFIG_SYSCTL_SYSCALL=y 114CONFIG_SYSCTL_SYSCALL=y
110# CONFIG_KALLSYMS is not set 115# CONFIG_KALLSYMS is not set
111# CONFIG_STRIP_ASM_SYMS is not set
112CONFIG_HOTPLUG=y 116CONFIG_HOTPLUG=y
113CONFIG_PRINTK=y 117CONFIG_PRINTK=y
114CONFIG_BUG=y 118CONFIG_BUG=y
@@ -121,9 +125,16 @@ CONFIG_TIMERFD=y
121CONFIG_EVENTFD=y 125CONFIG_EVENTFD=y
122CONFIG_SHMEM=y 126CONFIG_SHMEM=y
123CONFIG_AIO=y 127CONFIG_AIO=y
128CONFIG_HAVE_PERF_COUNTERS=y
129
130#
131# Performance Counters
132#
133# CONFIG_PERF_COUNTERS is not set
124CONFIG_VM_EVENT_COUNTERS=y 134CONFIG_VM_EVENT_COUNTERS=y
125CONFIG_PCI_QUIRKS=y 135CONFIG_PCI_QUIRKS=y
126CONFIG_SLUB_DEBUG=y 136CONFIG_SLUB_DEBUG=y
137# CONFIG_STRIP_ASM_SYMS is not set
127CONFIG_COMPAT_BRK=y 138CONFIG_COMPAT_BRK=y
128# CONFIG_SLAB is not set 139# CONFIG_SLAB is not set
129CONFIG_SLUB=y 140CONFIG_SLUB=y
@@ -136,6 +147,10 @@ CONFIG_HAVE_IOREMAP_PROT=y
136CONFIG_HAVE_KPROBES=y 147CONFIG_HAVE_KPROBES=y
137CONFIG_HAVE_KRETPROBES=y 148CONFIG_HAVE_KRETPROBES=y
138CONFIG_HAVE_ARCH_TRACEHOOK=y 149CONFIG_HAVE_ARCH_TRACEHOOK=y
150
151#
152# GCOV-based kernel profiling
153#
139# CONFIG_SLOW_WORK is not set 154# CONFIG_SLOW_WORK is not set
140# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set 155# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
141CONFIG_SLABINFO=y 156CONFIG_SLABINFO=y
@@ -148,7 +163,7 @@ CONFIG_MODULE_UNLOAD=y
148# CONFIG_MODVERSIONS is not set 163# CONFIG_MODVERSIONS is not set
149# CONFIG_MODULE_SRCVERSION_ALL is not set 164# CONFIG_MODULE_SRCVERSION_ALL is not set
150CONFIG_BLOCK=y 165CONFIG_BLOCK=y
151# CONFIG_LBD is not set 166CONFIG_LBDAF=y
152# CONFIG_BLK_DEV_BSG is not set 167# CONFIG_BLK_DEV_BSG is not set
153# CONFIG_BLK_DEV_INTEGRITY is not set 168# CONFIG_BLK_DEV_INTEGRITY is not set
154 169
@@ -190,6 +205,7 @@ CONFIG_MPC836x_RDK=y
190# CONFIG_MPC837x_RDB is not set 205# CONFIG_MPC837x_RDB is not set
191# CONFIG_SBC834x is not set 206# CONFIG_SBC834x is not set
192# CONFIG_ASP834x is not set 207# CONFIG_ASP834x is not set
208# CONFIG_KMETER1 is not set
193# CONFIG_PPC_86xx is not set 209# CONFIG_PPC_86xx is not set
194# CONFIG_EMBEDDED6xx is not set 210# CONFIG_EMBEDDED6xx is not set
195# CONFIG_AMIGAONE is not set 211# CONFIG_AMIGAONE is not set
@@ -233,6 +249,7 @@ CONFIG_BINFMT_ELF=y
233# CONFIG_HAVE_AOUT is not set 249# CONFIG_HAVE_AOUT is not set
234# CONFIG_BINFMT_MISC is not set 250# CONFIG_BINFMT_MISC is not set
235# CONFIG_IOMMU_HELPER is not set 251# CONFIG_IOMMU_HELPER is not set
252# CONFIG_SWIOTLB is not set
236CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y 253CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
237CONFIG_ARCH_HAS_WALK_MEMORY=y 254CONFIG_ARCH_HAS_WALK_MEMORY=y
238CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y 255CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y
@@ -253,9 +270,9 @@ CONFIG_MIGRATION=y
253CONFIG_ZONE_DMA_FLAG=1 270CONFIG_ZONE_DMA_FLAG=1
254CONFIG_BOUNCE=y 271CONFIG_BOUNCE=y
255CONFIG_VIRT_TO_BUS=y 272CONFIG_VIRT_TO_BUS=y
256CONFIG_UNEVICTABLE_LRU=y
257CONFIG_HAVE_MLOCK=y 273CONFIG_HAVE_MLOCK=y
258CONFIG_HAVE_MLOCKED_PAGE_BIT=y 274CONFIG_HAVE_MLOCKED_PAGE_BIT=y
275CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
259CONFIG_PPC_4K_PAGES=y 276CONFIG_PPC_4K_PAGES=y
260# CONFIG_PPC_16K_PAGES is not set 277# CONFIG_PPC_16K_PAGES is not set
261# CONFIG_PPC_64K_PAGES is not set 278# CONFIG_PPC_64K_PAGES is not set
@@ -366,6 +383,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
366# CONFIG_ECONET is not set 383# CONFIG_ECONET is not set
367# CONFIG_WAN_ROUTER is not set 384# CONFIG_WAN_ROUTER is not set
368# CONFIG_PHONET is not set 385# CONFIG_PHONET is not set
386# CONFIG_IEEE802154 is not set
369# CONFIG_NET_SCHED is not set 387# CONFIG_NET_SCHED is not set
370# CONFIG_DCB is not set 388# CONFIG_DCB is not set
371 389
@@ -383,7 +401,11 @@ CONFIG_WIRELESS=y
383CONFIG_WIRELESS_OLD_REGULATORY=y 401CONFIG_WIRELESS_OLD_REGULATORY=y
384# CONFIG_WIRELESS_EXT is not set 402# CONFIG_WIRELESS_EXT is not set
385# CONFIG_LIB80211 is not set 403# CONFIG_LIB80211 is not set
386# CONFIG_MAC80211 is not set 404
405#
406# CFG80211 needs to be enabled for MAC80211
407#
408CONFIG_MAC80211_DEFAULT_PS_VALUE=0
387# CONFIG_WIMAX is not set 409# CONFIG_WIMAX is not set
388# CONFIG_RFKILL is not set 410# CONFIG_RFKILL is not set
389# CONFIG_NET_9P is not set 411# CONFIG_NET_9P is not set
@@ -498,6 +520,7 @@ CONFIG_OF_DEVICE=y
498CONFIG_OF_GPIO=y 520CONFIG_OF_GPIO=y
499CONFIG_OF_I2C=y 521CONFIG_OF_I2C=y
500CONFIG_OF_SPI=y 522CONFIG_OF_SPI=y
523CONFIG_OF_MDIO=y
501# CONFIG_PARPORT is not set 524# CONFIG_PARPORT is not set
502CONFIG_BLK_DEV=y 525CONFIG_BLK_DEV=y
503# CONFIG_BLK_DEV_FD is not set 526# CONFIG_BLK_DEV_FD is not set
@@ -533,7 +556,9 @@ CONFIG_MISC_DEVICES=y
533# CONFIG_EEPROM_AT24 is not set 556# CONFIG_EEPROM_AT24 is not set
534# CONFIG_EEPROM_AT25 is not set 557# CONFIG_EEPROM_AT25 is not set
535# CONFIG_EEPROM_LEGACY is not set 558# CONFIG_EEPROM_LEGACY is not set
559# CONFIG_EEPROM_MAX6875 is not set
536# CONFIG_EEPROM_93CX6 is not set 560# CONFIG_EEPROM_93CX6 is not set
561# CONFIG_CB710_CORE is not set
537CONFIG_HAVE_IDE=y 562CONFIG_HAVE_IDE=y
538# CONFIG_IDE is not set 563# CONFIG_IDE is not set
539 564
@@ -553,14 +578,17 @@ CONFIG_HAVE_IDE=y
553# 578#
554 579
555# 580#
556# Enable only one of the two stacks, unless you know what you are doing 581# You can enable one or both FireWire driver stacks.
582#
583
584#
585# See the help texts for more information.
557# 586#
558# CONFIG_FIREWIRE is not set 587# CONFIG_FIREWIRE is not set
559# CONFIG_IEEE1394 is not set 588# CONFIG_IEEE1394 is not set
560# CONFIG_I2O is not set 589# CONFIG_I2O is not set
561# CONFIG_MACINTOSH_DRIVERS is not set 590# CONFIG_MACINTOSH_DRIVERS is not set
562CONFIG_NETDEVICES=y 591CONFIG_NETDEVICES=y
563CONFIG_COMPAT_NET_DEV_OPS=y
564# CONFIG_DUMMY is not set 592# CONFIG_DUMMY is not set
565# CONFIG_BONDING is not set 593# CONFIG_BONDING is not set
566# CONFIG_MACVLAN is not set 594# CONFIG_MACVLAN is not set
@@ -607,11 +635,13 @@ CONFIG_NETDEV_1000=y
607# CONFIG_VIA_VELOCITY is not set 635# CONFIG_VIA_VELOCITY is not set
608# CONFIG_TIGON3 is not set 636# CONFIG_TIGON3 is not set
609# CONFIG_BNX2 is not set 637# CONFIG_BNX2 is not set
638# CONFIG_CNIC is not set
610CONFIG_FSL_PQ_MDIO=y 639CONFIG_FSL_PQ_MDIO=y
611# CONFIG_GIANFAR is not set 640# CONFIG_GIANFAR is not set
612CONFIG_UCC_GETH=y 641CONFIG_UCC_GETH=y
613# CONFIG_UGETH_MAGIC_PACKET is not set 642# CONFIG_UGETH_MAGIC_PACKET is not set
614# CONFIG_UGETH_TX_ON_DEMAND is not set 643# CONFIG_UGETH_TX_ON_DEMAND is not set
644# CONFIG_MV643XX_ETH is not set
615# CONFIG_QLA3XXX is not set 645# CONFIG_QLA3XXX is not set
616# CONFIG_ATL1 is not set 646# CONFIG_ATL1 is not set
617# CONFIG_ATL1E is not set 647# CONFIG_ATL1E is not set
@@ -777,7 +807,6 @@ CONFIG_I2C_MPC=y
777# CONFIG_SENSORS_PCF8574 is not set 807# CONFIG_SENSORS_PCF8574 is not set
778# CONFIG_PCF8575 is not set 808# CONFIG_PCF8575 is not set
779# CONFIG_SENSORS_PCA9539 is not set 809# CONFIG_SENSORS_PCA9539 is not set
780# CONFIG_SENSORS_MAX6875 is not set
781# CONFIG_SENSORS_TSL2550 is not set 810# CONFIG_SENSORS_TSL2550 is not set
782# CONFIG_I2C_DEBUG_CORE is not set 811# CONFIG_I2C_DEBUG_CORE is not set
783# CONFIG_I2C_DEBUG_ALGO is not set 812# CONFIG_I2C_DEBUG_ALGO is not set
@@ -791,13 +820,18 @@ CONFIG_SPI_MASTER=y
791# 820#
792CONFIG_SPI_BITBANG=y 821CONFIG_SPI_BITBANG=y
793# CONFIG_SPI_GPIO is not set 822# CONFIG_SPI_GPIO is not set
794CONFIG_SPI_MPC83xx=y 823# CONFIG_SPI_MPC8xxx is not set
795 824
796# 825#
797# SPI Protocol Masters 826# SPI Protocol Masters
798# 827#
799CONFIG_SPI_SPIDEV=y 828CONFIG_SPI_SPIDEV=y
800# CONFIG_SPI_TLE62X0 is not set 829# CONFIG_SPI_TLE62X0 is not set
830
831#
832# PPS support
833#
834# CONFIG_PPS is not set
801CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y 835CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
802CONFIG_ARCH_REQUIRE_GPIOLIB=y 836CONFIG_ARCH_REQUIRE_GPIOLIB=y
803CONFIG_GPIOLIB=y 837CONFIG_GPIOLIB=y
@@ -865,23 +899,10 @@ CONFIG_SSB_POSSIBLE=y
865# CONFIG_MFD_WM8400 is not set 899# CONFIG_MFD_WM8400 is not set
866# CONFIG_MFD_WM8350_I2C is not set 900# CONFIG_MFD_WM8350_I2C is not set
867# CONFIG_MFD_PCF50633 is not set 901# CONFIG_MFD_PCF50633 is not set
902# CONFIG_AB3100_CORE is not set
903# CONFIG_EZX_PCAP is not set
868# CONFIG_REGULATOR is not set 904# CONFIG_REGULATOR is not set
869 905# CONFIG_MEDIA_SUPPORT is not set
870#
871# Multimedia devices
872#
873
874#
875# Multimedia core support
876#
877# CONFIG_VIDEO_DEV is not set
878# CONFIG_DVB_CORE is not set
879# CONFIG_VIDEO_MEDIA is not set
880
881#
882# Multimedia drivers
883#
884CONFIG_DAB=y
885 906
886# 907#
887# Graphics support 908# Graphics support
@@ -990,6 +1011,10 @@ CONFIG_HID=y
990# CONFIG_DMADEVICES is not set 1011# CONFIG_DMADEVICES is not set
991# CONFIG_AUXDISPLAY is not set 1012# CONFIG_AUXDISPLAY is not set
992# CONFIG_UIO is not set 1013# CONFIG_UIO is not set
1014
1015#
1016# TI VLYNQ
1017#
993# CONFIG_STAGING is not set 1018# CONFIG_STAGING is not set
994 1019
995# 1020#
@@ -1009,10 +1034,12 @@ CONFIG_FS_MBCACHE=y
1009# CONFIG_REISERFS_FS is not set 1034# CONFIG_REISERFS_FS is not set
1010# CONFIG_JFS_FS is not set 1035# CONFIG_JFS_FS is not set
1011# CONFIG_FS_POSIX_ACL is not set 1036# CONFIG_FS_POSIX_ACL is not set
1012CONFIG_FILE_LOCKING=y
1013# CONFIG_XFS_FS is not set 1037# CONFIG_XFS_FS is not set
1038# CONFIG_GFS2_FS is not set
1014# CONFIG_OCFS2_FS is not set 1039# CONFIG_OCFS2_FS is not set
1015# CONFIG_BTRFS_FS is not set 1040# CONFIG_BTRFS_FS is not set
1041CONFIG_FILE_LOCKING=y
1042CONFIG_FSNOTIFY=y
1016CONFIG_DNOTIFY=y 1043CONFIG_DNOTIFY=y
1017CONFIG_INOTIFY=y 1044CONFIG_INOTIFY=y
1018CONFIG_INOTIFY_USER=y 1045CONFIG_INOTIFY_USER=y
@@ -1086,6 +1113,7 @@ CONFIG_NFS_FS=y
1086CONFIG_NFS_V3=y 1113CONFIG_NFS_V3=y
1087# CONFIG_NFS_V3_ACL is not set 1114# CONFIG_NFS_V3_ACL is not set
1088CONFIG_NFS_V4=y 1115CONFIG_NFS_V4=y
1116# CONFIG_NFS_V4_1 is not set
1089CONFIG_ROOT_NFS=y 1117CONFIG_ROOT_NFS=y
1090# CONFIG_NFSD is not set 1118# CONFIG_NFSD is not set
1091CONFIG_LOCKD=y 1119CONFIG_LOCKD=y
@@ -1145,6 +1173,7 @@ CONFIG_HAS_IOPORT=y
1145CONFIG_HAS_DMA=y 1173CONFIG_HAS_DMA=y
1146CONFIG_HAVE_LMB=y 1174CONFIG_HAVE_LMB=y
1147CONFIG_NLATTR=y 1175CONFIG_NLATTR=y
1176CONFIG_GENERIC_ATOMIC64=y
1148 1177
1149# 1178#
1150# Kernel hacking 1179# Kernel hacking
@@ -1170,22 +1199,11 @@ CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
1170CONFIG_HAVE_DYNAMIC_FTRACE=y 1199CONFIG_HAVE_DYNAMIC_FTRACE=y
1171CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y 1200CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
1172CONFIG_TRACING_SUPPORT=y 1201CONFIG_TRACING_SUPPORT=y
1173 1202# CONFIG_FTRACE is not set
1174#
1175# Tracers
1176#
1177# CONFIG_FUNCTION_TRACER is not set
1178# CONFIG_SCHED_TRACER is not set
1179# CONFIG_CONTEXT_SWITCH_TRACER is not set
1180# CONFIG_EVENT_TRACER is not set
1181# CONFIG_BOOT_TRACER is not set
1182# CONFIG_TRACE_BRANCH_PROFILING is not set
1183# CONFIG_STACK_TRACER is not set
1184# CONFIG_KMEMTRACE is not set
1185# CONFIG_WORKQUEUE_TRACER is not set
1186# CONFIG_BLK_DEV_IO_TRACE is not set
1187# CONFIG_SAMPLES is not set 1203# CONFIG_SAMPLES is not set
1188CONFIG_HAVE_ARCH_KGDB=y 1204CONFIG_HAVE_ARCH_KGDB=y
1205# CONFIG_PPC_DISABLE_WERROR is not set
1206CONFIG_PPC_WERROR=y
1189CONFIG_PRINT_STACK_DEPTH=64 1207CONFIG_PRINT_STACK_DEPTH=64
1190# CONFIG_IRQSTACKS is not set 1208# CONFIG_IRQSTACKS is not set
1191# CONFIG_BOOTX_TEXT is not set 1209# CONFIG_BOOTX_TEXT is not set
diff --git a/arch/powerpc/configs/83xx/mpc837x_mds_defconfig b/arch/powerpc/configs/83xx/mpc837x_mds_defconfig
index bf636fd560ad..e285ec0fe958 100644
--- a/arch/powerpc/configs/83xx/mpc837x_mds_defconfig
+++ b/arch/powerpc/configs/83xx/mpc837x_mds_defconfig
@@ -1,26 +1,28 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.30-rc3 3# Linux kernel version: 2.6.31-rc4
4# Wed May 13 17:22:12 2009 4# Wed Jul 29 23:32:11 2009
5# 5#
6# CONFIG_PPC64 is not set 6# CONFIG_PPC64 is not set
7 7
8# 8#
9# Processor support 9# Processor support
10# 10#
11CONFIG_6xx=y 11CONFIG_PPC_BOOK3S_32=y
12# CONFIG_PPC_85xx is not set 12# CONFIG_PPC_85xx is not set
13# CONFIG_PPC_8xx is not set 13# CONFIG_PPC_8xx is not set
14# CONFIG_40x is not set 14# CONFIG_40x is not set
15# CONFIG_44x is not set 15# CONFIG_44x is not set
16# CONFIG_E200 is not set 16# CONFIG_E200 is not set
17CONFIG_PPC_BOOK3S=y 17CONFIG_PPC_BOOK3S=y
18CONFIG_6xx=y
18CONFIG_PPC_FPU=y 19CONFIG_PPC_FPU=y
19# CONFIG_FSL_EMB_PERFMON is not set 20# CONFIG_FSL_EMB_PERFMON is not set
20# CONFIG_ALTIVEC is not set 21# CONFIG_ALTIVEC is not set
21CONFIG_PPC_STD_MMU=y 22CONFIG_PPC_STD_MMU=y
22CONFIG_PPC_STD_MMU_32=y 23CONFIG_PPC_STD_MMU_32=y
23# CONFIG_PPC_MM_SLICES is not set 24# CONFIG_PPC_MM_SLICES is not set
25CONFIG_PPC_HAVE_PMU_SUPPORT=y
24# CONFIG_SMP is not set 26# CONFIG_SMP is not set
25CONFIG_PPC32=y 27CONFIG_PPC32=y
26CONFIG_WORD_SIZE=32 28CONFIG_WORD_SIZE=32
@@ -31,15 +33,16 @@ CONFIG_GENERIC_TIME=y
31CONFIG_GENERIC_TIME_VSYSCALL=y 33CONFIG_GENERIC_TIME_VSYSCALL=y
32CONFIG_GENERIC_CLOCKEVENTS=y 34CONFIG_GENERIC_CLOCKEVENTS=y
33CONFIG_GENERIC_HARDIRQS=y 35CONFIG_GENERIC_HARDIRQS=y
36CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
34# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set 37# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set
35CONFIG_IRQ_PER_CPU=y 38CONFIG_IRQ_PER_CPU=y
36CONFIG_STACKTRACE_SUPPORT=y 39CONFIG_STACKTRACE_SUPPORT=y
37CONFIG_HAVE_LATENCYTOP_SUPPORT=y 40CONFIG_HAVE_LATENCYTOP_SUPPORT=y
41CONFIG_TRACE_IRQFLAGS_SUPPORT=y
38CONFIG_LOCKDEP_SUPPORT=y 42CONFIG_LOCKDEP_SUPPORT=y
39CONFIG_RWSEM_XCHGADD_ALGORITHM=y 43CONFIG_RWSEM_XCHGADD_ALGORITHM=y
40CONFIG_ARCH_HAS_ILOG2_U32=y 44CONFIG_ARCH_HAS_ILOG2_U32=y
41CONFIG_GENERIC_HWEIGHT=y 45CONFIG_GENERIC_HWEIGHT=y
42CONFIG_GENERIC_CALIBRATE_DELAY=y
43CONFIG_GENERIC_FIND_NEXT_BIT=y 46CONFIG_GENERIC_FIND_NEXT_BIT=y
44# CONFIG_ARCH_NO_VIRT_TO_BUS is not set 47# CONFIG_ARCH_NO_VIRT_TO_BUS is not set
45CONFIG_PPC=y 48CONFIG_PPC=y
@@ -53,12 +56,14 @@ CONFIG_PPC_UDBG_16550=y
53# CONFIG_GENERIC_TBSYNC is not set 56# CONFIG_GENERIC_TBSYNC is not set
54CONFIG_AUDIT_ARCH=y 57CONFIG_AUDIT_ARCH=y
55CONFIG_GENERIC_BUG=y 58CONFIG_GENERIC_BUG=y
59CONFIG_DTC=y
56CONFIG_DEFAULT_UIMAGE=y 60CONFIG_DEFAULT_UIMAGE=y
57CONFIG_ARCH_SUSPEND_POSSIBLE=y 61CONFIG_ARCH_SUSPEND_POSSIBLE=y
58# CONFIG_PPC_DCR_NATIVE is not set 62# CONFIG_PPC_DCR_NATIVE is not set
59# CONFIG_PPC_DCR_MMIO is not set 63# CONFIG_PPC_DCR_MMIO is not set
60CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y 64CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y
61CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" 65CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
66CONFIG_CONSTRUCTORS=y
62 67
63# 68#
64# General setup 69# General setup
@@ -108,7 +113,6 @@ CONFIG_EMBEDDED=y
108CONFIG_SYSCTL_SYSCALL=y 113CONFIG_SYSCTL_SYSCALL=y
109CONFIG_KALLSYMS=y 114CONFIG_KALLSYMS=y
110# CONFIG_KALLSYMS_EXTRA_PASS is not set 115# CONFIG_KALLSYMS_EXTRA_PASS is not set
111# CONFIG_STRIP_ASM_SYMS is not set
112CONFIG_HOTPLUG=y 116CONFIG_HOTPLUG=y
113CONFIG_PRINTK=y 117CONFIG_PRINTK=y
114CONFIG_BUG=y 118CONFIG_BUG=y
@@ -121,8 +125,15 @@ CONFIG_TIMERFD=y
121CONFIG_EVENTFD=y 125CONFIG_EVENTFD=y
122CONFIG_SHMEM=y 126CONFIG_SHMEM=y
123CONFIG_AIO=y 127CONFIG_AIO=y
128CONFIG_HAVE_PERF_COUNTERS=y
129
130#
131# Performance Counters
132#
133# CONFIG_PERF_COUNTERS is not set
124CONFIG_VM_EVENT_COUNTERS=y 134CONFIG_VM_EVENT_COUNTERS=y
125CONFIG_PCI_QUIRKS=y 135CONFIG_PCI_QUIRKS=y
136# CONFIG_STRIP_ASM_SYMS is not set
126CONFIG_COMPAT_BRK=y 137CONFIG_COMPAT_BRK=y
127CONFIG_SLAB=y 138CONFIG_SLAB=y
128# CONFIG_SLUB is not set 139# CONFIG_SLUB is not set
@@ -136,6 +147,10 @@ CONFIG_HAVE_IOREMAP_PROT=y
136CONFIG_HAVE_KPROBES=y 147CONFIG_HAVE_KPROBES=y
137CONFIG_HAVE_KRETPROBES=y 148CONFIG_HAVE_KRETPROBES=y
138CONFIG_HAVE_ARCH_TRACEHOOK=y 149CONFIG_HAVE_ARCH_TRACEHOOK=y
150
151#
152# GCOV-based kernel profiling
153#
139# CONFIG_SLOW_WORK is not set 154# CONFIG_SLOW_WORK is not set
140# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set 155# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
141CONFIG_SLABINFO=y 156CONFIG_SLABINFO=y
@@ -148,7 +163,7 @@ CONFIG_MODULE_UNLOAD=y
148# CONFIG_MODVERSIONS is not set 163# CONFIG_MODVERSIONS is not set
149# CONFIG_MODULE_SRCVERSION_ALL is not set 164# CONFIG_MODULE_SRCVERSION_ALL is not set
150CONFIG_BLOCK=y 165CONFIG_BLOCK=y
151# CONFIG_LBD is not set 166CONFIG_LBDAF=y
152# CONFIG_BLK_DEV_BSG is not set 167# CONFIG_BLK_DEV_BSG is not set
153# CONFIG_BLK_DEV_INTEGRITY is not set 168# CONFIG_BLK_DEV_INTEGRITY is not set
154 169
@@ -190,6 +205,7 @@ CONFIG_MPC837x_MDS=y
190# CONFIG_MPC837x_RDB is not set 205# CONFIG_MPC837x_RDB is not set
191# CONFIG_SBC834x is not set 206# CONFIG_SBC834x is not set
192# CONFIG_ASP834x is not set 207# CONFIG_ASP834x is not set
208# CONFIG_KMETER1 is not set
193CONFIG_PPC_MPC837x=y 209CONFIG_PPC_MPC837x=y
194# CONFIG_PPC_86xx is not set 210# CONFIG_PPC_86xx is not set
195# CONFIG_EMBEDDED6xx is not set 211# CONFIG_EMBEDDED6xx is not set
@@ -234,6 +250,7 @@ CONFIG_BINFMT_ELF=y
234# CONFIG_HAVE_AOUT is not set 250# CONFIG_HAVE_AOUT is not set
235# CONFIG_BINFMT_MISC is not set 251# CONFIG_BINFMT_MISC is not set
236# CONFIG_IOMMU_HELPER is not set 252# CONFIG_IOMMU_HELPER is not set
253# CONFIG_SWIOTLB is not set
237CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y 254CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
238CONFIG_ARCH_HAS_WALK_MEMORY=y 255CONFIG_ARCH_HAS_WALK_MEMORY=y
239CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y 256CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y
@@ -254,9 +271,9 @@ CONFIG_MIGRATION=y
254CONFIG_ZONE_DMA_FLAG=1 271CONFIG_ZONE_DMA_FLAG=1
255CONFIG_BOUNCE=y 272CONFIG_BOUNCE=y
256CONFIG_VIRT_TO_BUS=y 273CONFIG_VIRT_TO_BUS=y
257CONFIG_UNEVICTABLE_LRU=y
258CONFIG_HAVE_MLOCK=y 274CONFIG_HAVE_MLOCK=y
259CONFIG_HAVE_MLOCKED_PAGE_BIT=y 275CONFIG_HAVE_MLOCKED_PAGE_BIT=y
276CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
260CONFIG_PPC_4K_PAGES=y 277CONFIG_PPC_4K_PAGES=y
261# CONFIG_PPC_16K_PAGES is not set 278# CONFIG_PPC_16K_PAGES is not set
262# CONFIG_PPC_64K_PAGES is not set 279# CONFIG_PPC_64K_PAGES is not set
@@ -365,6 +382,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
365# CONFIG_ECONET is not set 382# CONFIG_ECONET is not set
366# CONFIG_WAN_ROUTER is not set 383# CONFIG_WAN_ROUTER is not set
367# CONFIG_PHONET is not set 384# CONFIG_PHONET is not set
385# CONFIG_IEEE802154 is not set
368# CONFIG_NET_SCHED is not set 386# CONFIG_NET_SCHED is not set
369# CONFIG_DCB is not set 387# CONFIG_DCB is not set
370 388
@@ -382,7 +400,11 @@ CONFIG_WIRELESS=y
382CONFIG_WIRELESS_OLD_REGULATORY=y 400CONFIG_WIRELESS_OLD_REGULATORY=y
383# CONFIG_WIRELESS_EXT is not set 401# CONFIG_WIRELESS_EXT is not set
384# CONFIG_LIB80211 is not set 402# CONFIG_LIB80211 is not set
385# CONFIG_MAC80211 is not set 403
404#
405# CFG80211 needs to be enabled for MAC80211
406#
407CONFIG_MAC80211_DEFAULT_PS_VALUE=0
386# CONFIG_WIMAX is not set 408# CONFIG_WIMAX is not set
387# CONFIG_RFKILL is not set 409# CONFIG_RFKILL is not set
388# CONFIG_NET_9P is not set 410# CONFIG_NET_9P is not set
@@ -403,6 +425,7 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y
403# CONFIG_MTD is not set 425# CONFIG_MTD is not set
404CONFIG_OF_DEVICE=y 426CONFIG_OF_DEVICE=y
405CONFIG_OF_I2C=y 427CONFIG_OF_I2C=y
428CONFIG_OF_MDIO=y
406# CONFIG_PARPORT is not set 429# CONFIG_PARPORT is not set
407CONFIG_BLK_DEV=y 430CONFIG_BLK_DEV=y
408# CONFIG_BLK_DEV_FD is not set 431# CONFIG_BLK_DEV_FD is not set
@@ -437,7 +460,9 @@ CONFIG_MISC_DEVICES=y
437# 460#
438# CONFIG_EEPROM_AT24 is not set 461# CONFIG_EEPROM_AT24 is not set
439# CONFIG_EEPROM_LEGACY is not set 462# CONFIG_EEPROM_LEGACY is not set
463# CONFIG_EEPROM_MAX6875 is not set
440# CONFIG_EEPROM_93CX6 is not set 464# CONFIG_EEPROM_93CX6 is not set
465# CONFIG_CB710_CORE is not set
441CONFIG_HAVE_IDE=y 466CONFIG_HAVE_IDE=y
442# CONFIG_IDE is not set 467# CONFIG_IDE is not set
443 468
@@ -460,10 +485,6 @@ CONFIG_BLK_DEV_SD=y
460# CONFIG_BLK_DEV_SR is not set 485# CONFIG_BLK_DEV_SR is not set
461CONFIG_CHR_DEV_SG=y 486CONFIG_CHR_DEV_SG=y
462# CONFIG_CHR_DEV_SCH is not set 487# CONFIG_CHR_DEV_SCH is not set
463
464#
465# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
466#
467# CONFIG_SCSI_MULTI_LUN is not set 488# CONFIG_SCSI_MULTI_LUN is not set
468# CONFIG_SCSI_CONSTANTS is not set 489# CONFIG_SCSI_CONSTANTS is not set
469# CONFIG_SCSI_LOGGING is not set 490# CONFIG_SCSI_LOGGING is not set
@@ -481,6 +502,7 @@ CONFIG_SCSI_WAIT_SCAN=m
481CONFIG_SCSI_LOWLEVEL=y 502CONFIG_SCSI_LOWLEVEL=y
482# CONFIG_ISCSI_TCP is not set 503# CONFIG_ISCSI_TCP is not set
483# CONFIG_SCSI_CXGB3_ISCSI is not set 504# CONFIG_SCSI_CXGB3_ISCSI is not set
505# CONFIG_SCSI_BNX2_ISCSI is not set
484# CONFIG_BLK_DEV_3W_XXXX_RAID is not set 506# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
485# CONFIG_SCSI_3W_9XXX is not set 507# CONFIG_SCSI_3W_9XXX is not set
486# CONFIG_SCSI_ACARD is not set 508# CONFIG_SCSI_ACARD is not set
@@ -489,6 +511,7 @@ CONFIG_SCSI_LOWLEVEL=y
489# CONFIG_SCSI_AIC7XXX_OLD is not set 511# CONFIG_SCSI_AIC7XXX_OLD is not set
490# CONFIG_SCSI_AIC79XX is not set 512# CONFIG_SCSI_AIC79XX is not set
491# CONFIG_SCSI_AIC94XX is not set 513# CONFIG_SCSI_AIC94XX is not set
514# CONFIG_SCSI_MVSAS is not set
492# CONFIG_SCSI_DPT_I2O is not set 515# CONFIG_SCSI_DPT_I2O is not set
493# CONFIG_SCSI_ADVANSYS is not set 516# CONFIG_SCSI_ADVANSYS is not set
494# CONFIG_SCSI_ARCMSR is not set 517# CONFIG_SCSI_ARCMSR is not set
@@ -508,7 +531,6 @@ CONFIG_SCSI_LOWLEVEL=y
508# CONFIG_SCSI_IPS is not set 531# CONFIG_SCSI_IPS is not set
509# CONFIG_SCSI_INITIO is not set 532# CONFIG_SCSI_INITIO is not set
510# CONFIG_SCSI_INIA100 is not set 533# CONFIG_SCSI_INIA100 is not set
511# CONFIG_SCSI_MVSAS is not set
512# CONFIG_SCSI_STEX is not set 534# CONFIG_SCSI_STEX is not set
513# CONFIG_SCSI_SYM53C8XX_2 is not set 535# CONFIG_SCSI_SYM53C8XX_2 is not set
514# CONFIG_SCSI_IPR is not set 536# CONFIG_SCSI_IPR is not set
@@ -592,14 +614,17 @@ CONFIG_ATA_SFF=y
592# 614#
593 615
594# 616#
595# Enable only one of the two stacks, unless you know what you are doing 617# You can enable one or both FireWire driver stacks.
618#
619
620#
621# See the help texts for more information.
596# 622#
597# CONFIG_FIREWIRE is not set 623# CONFIG_FIREWIRE is not set
598# CONFIG_IEEE1394 is not set 624# CONFIG_IEEE1394 is not set
599# CONFIG_I2O is not set 625# CONFIG_I2O is not set
600# CONFIG_MACINTOSH_DRIVERS is not set 626# CONFIG_MACINTOSH_DRIVERS is not set
601CONFIG_NETDEVICES=y 627CONFIG_NETDEVICES=y
602CONFIG_COMPAT_NET_DEV_OPS=y
603# CONFIG_DUMMY is not set 628# CONFIG_DUMMY is not set
604# CONFIG_BONDING is not set 629# CONFIG_BONDING is not set
605# CONFIG_MACVLAN is not set 630# CONFIG_MACVLAN is not set
@@ -646,6 +671,7 @@ CONFIG_MII=y
646# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set 671# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
647# CONFIG_NET_PCI is not set 672# CONFIG_NET_PCI is not set
648# CONFIG_B44 is not set 673# CONFIG_B44 is not set
674# CONFIG_KS8842 is not set
649# CONFIG_ATL2 is not set 675# CONFIG_ATL2 is not set
650CONFIG_NETDEV_1000=y 676CONFIG_NETDEV_1000=y
651# CONFIG_ACENIC is not set 677# CONFIG_ACENIC is not set
@@ -665,8 +691,10 @@ CONFIG_NETDEV_1000=y
665# CONFIG_VIA_VELOCITY is not set 691# CONFIG_VIA_VELOCITY is not set
666# CONFIG_TIGON3 is not set 692# CONFIG_TIGON3 is not set
667# CONFIG_BNX2 is not set 693# CONFIG_BNX2 is not set
694# CONFIG_CNIC is not set
668CONFIG_FSL_PQ_MDIO=y 695CONFIG_FSL_PQ_MDIO=y
669CONFIG_GIANFAR=y 696CONFIG_GIANFAR=y
697# CONFIG_MV643XX_ETH is not set
670# CONFIG_QLA3XXX is not set 698# CONFIG_QLA3XXX is not set
671# CONFIG_ATL1 is not set 699# CONFIG_ATL1 is not set
672# CONFIG_ATL1E is not set 700# CONFIG_ATL1E is not set
@@ -844,13 +872,17 @@ CONFIG_I2C_MPC=y
844# CONFIG_SENSORS_PCF8574 is not set 872# CONFIG_SENSORS_PCF8574 is not set
845# CONFIG_PCF8575 is not set 873# CONFIG_PCF8575 is not set
846# CONFIG_SENSORS_PCA9539 is not set 874# CONFIG_SENSORS_PCA9539 is not set
847# CONFIG_SENSORS_MAX6875 is not set
848# CONFIG_SENSORS_TSL2550 is not set 875# CONFIG_SENSORS_TSL2550 is not set
849# CONFIG_I2C_DEBUG_CORE is not set 876# CONFIG_I2C_DEBUG_CORE is not set
850# CONFIG_I2C_DEBUG_ALGO is not set 877# CONFIG_I2C_DEBUG_ALGO is not set
851# CONFIG_I2C_DEBUG_BUS is not set 878# CONFIG_I2C_DEBUG_BUS is not set
852# CONFIG_I2C_DEBUG_CHIP is not set 879# CONFIG_I2C_DEBUG_CHIP is not set
853# CONFIG_SPI is not set 880# CONFIG_SPI is not set
881
882#
883# PPS support
884#
885# CONFIG_PPS is not set
854CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y 886CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
855# CONFIG_GPIOLIB is not set 887# CONFIG_GPIOLIB is not set
856# CONFIG_W1 is not set 888# CONFIG_W1 is not set
@@ -905,6 +937,7 @@ CONFIG_HWMON=y
905# CONFIG_SENSORS_SMSC47B397 is not set 937# CONFIG_SENSORS_SMSC47B397 is not set
906# CONFIG_SENSORS_ADS7828 is not set 938# CONFIG_SENSORS_ADS7828 is not set
907# CONFIG_SENSORS_THMC50 is not set 939# CONFIG_SENSORS_THMC50 is not set
940# CONFIG_SENSORS_TMP401 is not set
908# CONFIG_SENSORS_VIA686A is not set 941# CONFIG_SENSORS_VIA686A is not set
909# CONFIG_SENSORS_VT1211 is not set 942# CONFIG_SENSORS_VT1211 is not set
910# CONFIG_SENSORS_VT8231 is not set 943# CONFIG_SENSORS_VT8231 is not set
@@ -953,23 +986,9 @@ CONFIG_SSB_POSSIBLE=y
953# CONFIG_MFD_WM8400 is not set 986# CONFIG_MFD_WM8400 is not set
954# CONFIG_MFD_WM8350_I2C is not set 987# CONFIG_MFD_WM8350_I2C is not set
955# CONFIG_MFD_PCF50633 is not set 988# CONFIG_MFD_PCF50633 is not set
989# CONFIG_AB3100_CORE is not set
956# CONFIG_REGULATOR is not set 990# CONFIG_REGULATOR is not set
957 991# CONFIG_MEDIA_SUPPORT is not set
958#
959# Multimedia devices
960#
961
962#
963# Multimedia core support
964#
965# CONFIG_VIDEO_DEV is not set
966# CONFIG_DVB_CORE is not set
967# CONFIG_VIDEO_MEDIA is not set
968
969#
970# Multimedia drivers
971#
972CONFIG_DAB=y
973 992
974# 993#
975# Graphics support 994# Graphics support
@@ -1026,6 +1045,10 @@ CONFIG_USB_ARCH_HAS_EHCI=y
1026# CONFIG_DMADEVICES is not set 1045# CONFIG_DMADEVICES is not set
1027# CONFIG_AUXDISPLAY is not set 1046# CONFIG_AUXDISPLAY is not set
1028# CONFIG_UIO is not set 1047# CONFIG_UIO is not set
1048
1049#
1050# TI VLYNQ
1051#
1029# CONFIG_STAGING is not set 1052# CONFIG_STAGING is not set
1030 1053
1031# 1054#
@@ -1045,10 +1068,12 @@ CONFIG_FS_MBCACHE=y
1045# CONFIG_REISERFS_FS is not set 1068# CONFIG_REISERFS_FS is not set
1046# CONFIG_JFS_FS is not set 1069# CONFIG_JFS_FS is not set
1047# CONFIG_FS_POSIX_ACL is not set 1070# CONFIG_FS_POSIX_ACL is not set
1048CONFIG_FILE_LOCKING=y
1049# CONFIG_XFS_FS is not set 1071# CONFIG_XFS_FS is not set
1072# CONFIG_GFS2_FS is not set
1050# CONFIG_OCFS2_FS is not set 1073# CONFIG_OCFS2_FS is not set
1051# CONFIG_BTRFS_FS is not set 1074# CONFIG_BTRFS_FS is not set
1075CONFIG_FILE_LOCKING=y
1076CONFIG_FSNOTIFY=y
1052CONFIG_DNOTIFY=y 1077CONFIG_DNOTIFY=y
1053CONFIG_INOTIFY=y 1078CONFIG_INOTIFY=y
1054CONFIG_INOTIFY_USER=y 1079CONFIG_INOTIFY_USER=y
@@ -1111,6 +1136,7 @@ CONFIG_NFS_FS=y
1111CONFIG_NFS_V3=y 1136CONFIG_NFS_V3=y
1112# CONFIG_NFS_V3_ACL is not set 1137# CONFIG_NFS_V3_ACL is not set
1113CONFIG_NFS_V4=y 1138CONFIG_NFS_V4=y
1139# CONFIG_NFS_V4_1 is not set
1114CONFIG_ROOT_NFS=y 1140CONFIG_ROOT_NFS=y
1115# CONFIG_NFSD is not set 1141# CONFIG_NFSD is not set
1116CONFIG_LOCKD=y 1142CONFIG_LOCKD=y
@@ -1170,6 +1196,7 @@ CONFIG_HAS_IOPORT=y
1170CONFIG_HAS_DMA=y 1196CONFIG_HAS_DMA=y
1171CONFIG_HAVE_LMB=y 1197CONFIG_HAVE_LMB=y
1172CONFIG_NLATTR=y 1198CONFIG_NLATTR=y
1199CONFIG_GENERIC_ATOMIC64=y
1173 1200
1174# 1201#
1175# Kernel hacking 1202# Kernel hacking
@@ -1193,22 +1220,11 @@ CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
1193CONFIG_HAVE_DYNAMIC_FTRACE=y 1220CONFIG_HAVE_DYNAMIC_FTRACE=y
1194CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y 1221CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
1195CONFIG_TRACING_SUPPORT=y 1222CONFIG_TRACING_SUPPORT=y
1196 1223# CONFIG_FTRACE is not set
1197#
1198# Tracers
1199#
1200# CONFIG_FUNCTION_TRACER is not set
1201# CONFIG_SCHED_TRACER is not set
1202# CONFIG_CONTEXT_SWITCH_TRACER is not set
1203# CONFIG_EVENT_TRACER is not set
1204# CONFIG_BOOT_TRACER is not set
1205# CONFIG_TRACE_BRANCH_PROFILING is not set
1206# CONFIG_STACK_TRACER is not set
1207# CONFIG_KMEMTRACE is not set
1208# CONFIG_WORKQUEUE_TRACER is not set
1209# CONFIG_BLK_DEV_IO_TRACE is not set
1210# CONFIG_SAMPLES is not set 1224# CONFIG_SAMPLES is not set
1211CONFIG_HAVE_ARCH_KGDB=y 1225CONFIG_HAVE_ARCH_KGDB=y
1226# CONFIG_PPC_DISABLE_WERROR is not set
1227CONFIG_PPC_WERROR=y
1212CONFIG_PRINT_STACK_DEPTH=64 1228CONFIG_PRINT_STACK_DEPTH=64
1213# CONFIG_IRQSTACKS is not set 1229# CONFIG_IRQSTACKS is not set
1214# CONFIG_BOOTX_TEXT is not set 1230# CONFIG_BOOTX_TEXT is not set
diff --git a/arch/powerpc/configs/83xx/mpc837x_rdb_defconfig b/arch/powerpc/configs/83xx/mpc837x_rdb_defconfig
index fe6454eacbdb..1ab3e4cd3018 100644
--- a/arch/powerpc/configs/83xx/mpc837x_rdb_defconfig
+++ b/arch/powerpc/configs/83xx/mpc837x_rdb_defconfig
@@ -1,26 +1,28 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.30-rc3 3# Linux kernel version: 2.6.31-rc4
4# Wed May 13 17:22:14 2009 4# Wed Jul 29 23:32:13 2009
5# 5#
6# CONFIG_PPC64 is not set 6# CONFIG_PPC64 is not set
7 7
8# 8#
9# Processor support 9# Processor support
10# 10#
11CONFIG_6xx=y 11CONFIG_PPC_BOOK3S_32=y
12# CONFIG_PPC_85xx is not set 12# CONFIG_PPC_85xx is not set
13# CONFIG_PPC_8xx is not set 13# CONFIG_PPC_8xx is not set
14# CONFIG_40x is not set 14# CONFIG_40x is not set
15# CONFIG_44x is not set 15# CONFIG_44x is not set
16# CONFIG_E200 is not set 16# CONFIG_E200 is not set
17CONFIG_PPC_BOOK3S=y 17CONFIG_PPC_BOOK3S=y
18CONFIG_6xx=y
18CONFIG_PPC_FPU=y 19CONFIG_PPC_FPU=y
19# CONFIG_FSL_EMB_PERFMON is not set 20# CONFIG_FSL_EMB_PERFMON is not set
20# CONFIG_ALTIVEC is not set 21# CONFIG_ALTIVEC is not set
21CONFIG_PPC_STD_MMU=y 22CONFIG_PPC_STD_MMU=y
22CONFIG_PPC_STD_MMU_32=y 23CONFIG_PPC_STD_MMU_32=y
23# CONFIG_PPC_MM_SLICES is not set 24# CONFIG_PPC_MM_SLICES is not set
25CONFIG_PPC_HAVE_PMU_SUPPORT=y
24# CONFIG_SMP is not set 26# CONFIG_SMP is not set
25CONFIG_PPC32=y 27CONFIG_PPC32=y
26CONFIG_WORD_SIZE=32 28CONFIG_WORD_SIZE=32
@@ -31,15 +33,16 @@ CONFIG_GENERIC_TIME=y
31CONFIG_GENERIC_TIME_VSYSCALL=y 33CONFIG_GENERIC_TIME_VSYSCALL=y
32CONFIG_GENERIC_CLOCKEVENTS=y 34CONFIG_GENERIC_CLOCKEVENTS=y
33CONFIG_GENERIC_HARDIRQS=y 35CONFIG_GENERIC_HARDIRQS=y
36CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
34# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set 37# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set
35CONFIG_IRQ_PER_CPU=y 38CONFIG_IRQ_PER_CPU=y
36CONFIG_STACKTRACE_SUPPORT=y 39CONFIG_STACKTRACE_SUPPORT=y
37CONFIG_HAVE_LATENCYTOP_SUPPORT=y 40CONFIG_HAVE_LATENCYTOP_SUPPORT=y
41CONFIG_TRACE_IRQFLAGS_SUPPORT=y
38CONFIG_LOCKDEP_SUPPORT=y 42CONFIG_LOCKDEP_SUPPORT=y
39CONFIG_RWSEM_XCHGADD_ALGORITHM=y 43CONFIG_RWSEM_XCHGADD_ALGORITHM=y
40CONFIG_ARCH_HAS_ILOG2_U32=y 44CONFIG_ARCH_HAS_ILOG2_U32=y
41CONFIG_GENERIC_HWEIGHT=y 45CONFIG_GENERIC_HWEIGHT=y
42CONFIG_GENERIC_CALIBRATE_DELAY=y
43CONFIG_GENERIC_FIND_NEXT_BIT=y 46CONFIG_GENERIC_FIND_NEXT_BIT=y
44# CONFIG_ARCH_NO_VIRT_TO_BUS is not set 47# CONFIG_ARCH_NO_VIRT_TO_BUS is not set
45CONFIG_PPC=y 48CONFIG_PPC=y
@@ -53,12 +56,14 @@ CONFIG_PPC_UDBG_16550=y
53# CONFIG_GENERIC_TBSYNC is not set 56# CONFIG_GENERIC_TBSYNC is not set
54CONFIG_AUDIT_ARCH=y 57CONFIG_AUDIT_ARCH=y
55CONFIG_GENERIC_BUG=y 58CONFIG_GENERIC_BUG=y
59CONFIG_DTC=y
56CONFIG_DEFAULT_UIMAGE=y 60CONFIG_DEFAULT_UIMAGE=y
57CONFIG_ARCH_SUSPEND_POSSIBLE=y 61CONFIG_ARCH_SUSPEND_POSSIBLE=y
58# CONFIG_PPC_DCR_NATIVE is not set 62# CONFIG_PPC_DCR_NATIVE is not set
59# CONFIG_PPC_DCR_MMIO is not set 63# CONFIG_PPC_DCR_MMIO is not set
60CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y 64CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y
61CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" 65CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
66CONFIG_CONSTRUCTORS=y
62 67
63# 68#
64# General setup 69# General setup
@@ -108,7 +113,6 @@ CONFIG_EMBEDDED=y
108CONFIG_SYSCTL_SYSCALL=y 113CONFIG_SYSCTL_SYSCALL=y
109CONFIG_KALLSYMS=y 114CONFIG_KALLSYMS=y
110# CONFIG_KALLSYMS_EXTRA_PASS is not set 115# CONFIG_KALLSYMS_EXTRA_PASS is not set
111# CONFIG_STRIP_ASM_SYMS is not set
112CONFIG_HOTPLUG=y 116CONFIG_HOTPLUG=y
113CONFIG_PRINTK=y 117CONFIG_PRINTK=y
114CONFIG_BUG=y 118CONFIG_BUG=y
@@ -121,8 +125,15 @@ CONFIG_TIMERFD=y
121CONFIG_EVENTFD=y 125CONFIG_EVENTFD=y
122CONFIG_SHMEM=y 126CONFIG_SHMEM=y
123CONFIG_AIO=y 127CONFIG_AIO=y
128CONFIG_HAVE_PERF_COUNTERS=y
129
130#
131# Performance Counters
132#
133# CONFIG_PERF_COUNTERS is not set
124CONFIG_VM_EVENT_COUNTERS=y 134CONFIG_VM_EVENT_COUNTERS=y
125CONFIG_PCI_QUIRKS=y 135CONFIG_PCI_QUIRKS=y
136# CONFIG_STRIP_ASM_SYMS is not set
126CONFIG_COMPAT_BRK=y 137CONFIG_COMPAT_BRK=y
127CONFIG_SLAB=y 138CONFIG_SLAB=y
128# CONFIG_SLUB is not set 139# CONFIG_SLUB is not set
@@ -136,6 +147,10 @@ CONFIG_HAVE_IOREMAP_PROT=y
136CONFIG_HAVE_KPROBES=y 147CONFIG_HAVE_KPROBES=y
137CONFIG_HAVE_KRETPROBES=y 148CONFIG_HAVE_KRETPROBES=y
138CONFIG_HAVE_ARCH_TRACEHOOK=y 149CONFIG_HAVE_ARCH_TRACEHOOK=y
150
151#
152# GCOV-based kernel profiling
153#
139# CONFIG_SLOW_WORK is not set 154# CONFIG_SLOW_WORK is not set
140# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set 155# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
141CONFIG_SLABINFO=y 156CONFIG_SLABINFO=y
@@ -148,7 +163,7 @@ CONFIG_MODULE_UNLOAD=y
148# CONFIG_MODVERSIONS is not set 163# CONFIG_MODVERSIONS is not set
149# CONFIG_MODULE_SRCVERSION_ALL is not set 164# CONFIG_MODULE_SRCVERSION_ALL is not set
150CONFIG_BLOCK=y 165CONFIG_BLOCK=y
151# CONFIG_LBD is not set 166CONFIG_LBDAF=y
152# CONFIG_BLK_DEV_BSG is not set 167# CONFIG_BLK_DEV_BSG is not set
153# CONFIG_BLK_DEV_INTEGRITY is not set 168# CONFIG_BLK_DEV_INTEGRITY is not set
154 169
@@ -190,6 +205,7 @@ CONFIG_PPC_83xx=y
190CONFIG_MPC837x_RDB=y 205CONFIG_MPC837x_RDB=y
191# CONFIG_SBC834x is not set 206# CONFIG_SBC834x is not set
192# CONFIG_ASP834x is not set 207# CONFIG_ASP834x is not set
208# CONFIG_KMETER1 is not set
193CONFIG_PPC_MPC837x=y 209CONFIG_PPC_MPC837x=y
194# CONFIG_PPC_86xx is not set 210# CONFIG_PPC_86xx is not set
195# CONFIG_EMBEDDED6xx is not set 211# CONFIG_EMBEDDED6xx is not set
@@ -234,6 +250,7 @@ CONFIG_BINFMT_ELF=y
234# CONFIG_HAVE_AOUT is not set 250# CONFIG_HAVE_AOUT is not set
235# CONFIG_BINFMT_MISC is not set 251# CONFIG_BINFMT_MISC is not set
236# CONFIG_IOMMU_HELPER is not set 252# CONFIG_IOMMU_HELPER is not set
253# CONFIG_SWIOTLB is not set
237CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y 254CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
238CONFIG_ARCH_HAS_WALK_MEMORY=y 255CONFIG_ARCH_HAS_WALK_MEMORY=y
239CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y 256CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y
@@ -254,9 +271,9 @@ CONFIG_MIGRATION=y
254CONFIG_ZONE_DMA_FLAG=1 271CONFIG_ZONE_DMA_FLAG=1
255CONFIG_BOUNCE=y 272CONFIG_BOUNCE=y
256CONFIG_VIRT_TO_BUS=y 273CONFIG_VIRT_TO_BUS=y
257CONFIG_UNEVICTABLE_LRU=y
258CONFIG_HAVE_MLOCK=y 274CONFIG_HAVE_MLOCK=y
259CONFIG_HAVE_MLOCKED_PAGE_BIT=y 275CONFIG_HAVE_MLOCKED_PAGE_BIT=y
276CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
260CONFIG_PPC_4K_PAGES=y 277CONFIG_PPC_4K_PAGES=y
261# CONFIG_PPC_16K_PAGES is not set 278# CONFIG_PPC_16K_PAGES is not set
262# CONFIG_PPC_64K_PAGES is not set 279# CONFIG_PPC_64K_PAGES is not set
@@ -360,6 +377,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
360# CONFIG_ECONET is not set 377# CONFIG_ECONET is not set
361# CONFIG_WAN_ROUTER is not set 378# CONFIG_WAN_ROUTER is not set
362# CONFIG_PHONET is not set 379# CONFIG_PHONET is not set
380# CONFIG_IEEE802154 is not set
363# CONFIG_NET_SCHED is not set 381# CONFIG_NET_SCHED is not set
364# CONFIG_DCB is not set 382# CONFIG_DCB is not set
365 383
@@ -377,7 +395,11 @@ CONFIG_WIRELESS=y
377CONFIG_WIRELESS_OLD_REGULATORY=y 395CONFIG_WIRELESS_OLD_REGULATORY=y
378# CONFIG_WIRELESS_EXT is not set 396# CONFIG_WIRELESS_EXT is not set
379# CONFIG_LIB80211 is not set 397# CONFIG_LIB80211 is not set
380# CONFIG_MAC80211 is not set 398
399#
400# CFG80211 needs to be enabled for MAC80211
401#
402CONFIG_MAC80211_DEFAULT_PS_VALUE=0
381# CONFIG_WIMAX is not set 403# CONFIG_WIMAX is not set
382# CONFIG_RFKILL is not set 404# CONFIG_RFKILL is not set
383# CONFIG_NET_9P is not set 405# CONFIG_NET_9P is not set
@@ -398,6 +420,7 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y
398# CONFIG_MTD is not set 420# CONFIG_MTD is not set
399CONFIG_OF_DEVICE=y 421CONFIG_OF_DEVICE=y
400CONFIG_OF_I2C=y 422CONFIG_OF_I2C=y
423CONFIG_OF_MDIO=y
401# CONFIG_PARPORT is not set 424# CONFIG_PARPORT is not set
402CONFIG_BLK_DEV=y 425CONFIG_BLK_DEV=y
403# CONFIG_BLK_DEV_FD is not set 426# CONFIG_BLK_DEV_FD is not set
@@ -433,7 +456,9 @@ CONFIG_MISC_DEVICES=y
433# 456#
434# CONFIG_EEPROM_AT24 is not set 457# CONFIG_EEPROM_AT24 is not set
435# CONFIG_EEPROM_LEGACY is not set 458# CONFIG_EEPROM_LEGACY is not set
459# CONFIG_EEPROM_MAX6875 is not set
436# CONFIG_EEPROM_93CX6 is not set 460# CONFIG_EEPROM_93CX6 is not set
461# CONFIG_CB710_CORE is not set
437CONFIG_HAVE_IDE=y 462CONFIG_HAVE_IDE=y
438# CONFIG_IDE is not set 463# CONFIG_IDE is not set
439 464
@@ -456,10 +481,6 @@ CONFIG_BLK_DEV_SD=y
456# CONFIG_BLK_DEV_SR is not set 481# CONFIG_BLK_DEV_SR is not set
457CONFIG_CHR_DEV_SG=y 482CONFIG_CHR_DEV_SG=y
458# CONFIG_CHR_DEV_SCH is not set 483# CONFIG_CHR_DEV_SCH is not set
459
460#
461# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
462#
463# CONFIG_SCSI_MULTI_LUN is not set 484# CONFIG_SCSI_MULTI_LUN is not set
464# CONFIG_SCSI_CONSTANTS is not set 485# CONFIG_SCSI_CONSTANTS is not set
465# CONFIG_SCSI_LOGGING is not set 486# CONFIG_SCSI_LOGGING is not set
@@ -476,6 +497,7 @@ CONFIG_SCSI_WAIT_SCAN=m
476# CONFIG_SCSI_SRP_ATTRS is not set 497# CONFIG_SCSI_SRP_ATTRS is not set
477CONFIG_SCSI_LOWLEVEL=y 498CONFIG_SCSI_LOWLEVEL=y
478# CONFIG_ISCSI_TCP is not set 499# CONFIG_ISCSI_TCP is not set
500# CONFIG_SCSI_BNX2_ISCSI is not set
479# CONFIG_BLK_DEV_3W_XXXX_RAID is not set 501# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
480# CONFIG_SCSI_3W_9XXX is not set 502# CONFIG_SCSI_3W_9XXX is not set
481# CONFIG_SCSI_ACARD is not set 503# CONFIG_SCSI_ACARD is not set
@@ -484,6 +506,7 @@ CONFIG_SCSI_LOWLEVEL=y
484# CONFIG_SCSI_AIC7XXX_OLD is not set 506# CONFIG_SCSI_AIC7XXX_OLD is not set
485# CONFIG_SCSI_AIC79XX is not set 507# CONFIG_SCSI_AIC79XX is not set
486# CONFIG_SCSI_AIC94XX is not set 508# CONFIG_SCSI_AIC94XX is not set
509# CONFIG_SCSI_MVSAS is not set
487# CONFIG_SCSI_DPT_I2O is not set 510# CONFIG_SCSI_DPT_I2O is not set
488# CONFIG_SCSI_ADVANSYS is not set 511# CONFIG_SCSI_ADVANSYS is not set
489# CONFIG_SCSI_ARCMSR is not set 512# CONFIG_SCSI_ARCMSR is not set
@@ -503,7 +526,6 @@ CONFIG_SCSI_LOWLEVEL=y
503# CONFIG_SCSI_IPS is not set 526# CONFIG_SCSI_IPS is not set
504# CONFIG_SCSI_INITIO is not set 527# CONFIG_SCSI_INITIO is not set
505# CONFIG_SCSI_INIA100 is not set 528# CONFIG_SCSI_INIA100 is not set
506# CONFIG_SCSI_MVSAS is not set
507# CONFIG_SCSI_STEX is not set 529# CONFIG_SCSI_STEX is not set
508# CONFIG_SCSI_SYM53C8XX_2 is not set 530# CONFIG_SCSI_SYM53C8XX_2 is not set
509# CONFIG_SCSI_IPR is not set 531# CONFIG_SCSI_IPR is not set
@@ -598,14 +620,17 @@ CONFIG_MD_RAID6_PQ=y
598# 620#
599 621
600# 622#
601# Enable only one of the two stacks, unless you know what you are doing 623# You can enable one or both FireWire driver stacks.
624#
625
626#
627# See the help texts for more information.
602# 628#
603# CONFIG_FIREWIRE is not set 629# CONFIG_FIREWIRE is not set
604# CONFIG_IEEE1394 is not set 630# CONFIG_IEEE1394 is not set
605# CONFIG_I2O is not set 631# CONFIG_I2O is not set
606# CONFIG_MACINTOSH_DRIVERS is not set 632# CONFIG_MACINTOSH_DRIVERS is not set
607CONFIG_NETDEVICES=y 633CONFIG_NETDEVICES=y
608CONFIG_COMPAT_NET_DEV_OPS=y
609# CONFIG_DUMMY is not set 634# CONFIG_DUMMY is not set
610# CONFIG_BONDING is not set 635# CONFIG_BONDING is not set
611# CONFIG_MACVLAN is not set 636# CONFIG_MACVLAN is not set
@@ -652,6 +677,7 @@ CONFIG_MII=y
652# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set 677# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
653# CONFIG_NET_PCI is not set 678# CONFIG_NET_PCI is not set
654# CONFIG_B44 is not set 679# CONFIG_B44 is not set
680# CONFIG_KS8842 is not set
655# CONFIG_ATL2 is not set 681# CONFIG_ATL2 is not set
656CONFIG_NETDEV_1000=y 682CONFIG_NETDEV_1000=y
657# CONFIG_ACENIC is not set 683# CONFIG_ACENIC is not set
@@ -671,8 +697,10 @@ CONFIG_NETDEV_1000=y
671# CONFIG_VIA_VELOCITY is not set 697# CONFIG_VIA_VELOCITY is not set
672# CONFIG_TIGON3 is not set 698# CONFIG_TIGON3 is not set
673# CONFIG_BNX2 is not set 699# CONFIG_BNX2 is not set
700# CONFIG_CNIC is not set
674CONFIG_FSL_PQ_MDIO=y 701CONFIG_FSL_PQ_MDIO=y
675CONFIG_GIANFAR=y 702CONFIG_GIANFAR=y
703# CONFIG_MV643XX_ETH is not set
676# CONFIG_QLA3XXX is not set 704# CONFIG_QLA3XXX is not set
677# CONFIG_ATL1 is not set 705# CONFIG_ATL1 is not set
678# CONFIG_ATL1E is not set 706# CONFIG_ATL1E is not set
@@ -842,13 +870,17 @@ CONFIG_I2C_MPC=y
842# CONFIG_SENSORS_PCF8574 is not set 870# CONFIG_SENSORS_PCF8574 is not set
843# CONFIG_PCF8575 is not set 871# CONFIG_PCF8575 is not set
844# CONFIG_SENSORS_PCA9539 is not set 872# CONFIG_SENSORS_PCA9539 is not set
845# CONFIG_SENSORS_MAX6875 is not set
846# CONFIG_SENSORS_TSL2550 is not set 873# CONFIG_SENSORS_TSL2550 is not set
847# CONFIG_I2C_DEBUG_CORE is not set 874# CONFIG_I2C_DEBUG_CORE is not set
848# CONFIG_I2C_DEBUG_ALGO is not set 875# CONFIG_I2C_DEBUG_ALGO is not set
849# CONFIG_I2C_DEBUG_BUS is not set 876# CONFIG_I2C_DEBUG_BUS is not set
850# CONFIG_I2C_DEBUG_CHIP is not set 877# CONFIG_I2C_DEBUG_CHIP is not set
851# CONFIG_SPI is not set 878# CONFIG_SPI is not set
879
880#
881# PPS support
882#
883# CONFIG_PPS is not set
852CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y 884CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
853# CONFIG_GPIOLIB is not set 885# CONFIG_GPIOLIB is not set
854# CONFIG_W1 is not set 886# CONFIG_W1 is not set
@@ -903,6 +935,7 @@ CONFIG_HWMON=y
903# CONFIG_SENSORS_SMSC47B397 is not set 935# CONFIG_SENSORS_SMSC47B397 is not set
904# CONFIG_SENSORS_ADS7828 is not set 936# CONFIG_SENSORS_ADS7828 is not set
905# CONFIG_SENSORS_THMC50 is not set 937# CONFIG_SENSORS_THMC50 is not set
938# CONFIG_SENSORS_TMP401 is not set
906# CONFIG_SENSORS_VIA686A is not set 939# CONFIG_SENSORS_VIA686A is not set
907# CONFIG_SENSORS_VT1211 is not set 940# CONFIG_SENSORS_VT1211 is not set
908# CONFIG_SENSORS_VT8231 is not set 941# CONFIG_SENSORS_VT8231 is not set
@@ -956,24 +989,9 @@ CONFIG_SSB_POSSIBLE=y
956# CONFIG_MFD_WM8400 is not set 989# CONFIG_MFD_WM8400 is not set
957# CONFIG_MFD_WM8350_I2C is not set 990# CONFIG_MFD_WM8350_I2C is not set
958# CONFIG_MFD_PCF50633 is not set 991# CONFIG_MFD_PCF50633 is not set
992# CONFIG_AB3100_CORE is not set
959# CONFIG_REGULATOR is not set 993# CONFIG_REGULATOR is not set
960 994# CONFIG_MEDIA_SUPPORT is not set
961#
962# Multimedia devices
963#
964
965#
966# Multimedia core support
967#
968# CONFIG_VIDEO_DEV is not set
969# CONFIG_DVB_CORE is not set
970# CONFIG_VIDEO_MEDIA is not set
971
972#
973# Multimedia drivers
974#
975CONFIG_DAB=y
976# CONFIG_USB_DABUSB is not set
977 995
978# 996#
979# Graphics support 997# Graphics support
@@ -1011,7 +1029,7 @@ CONFIG_HID_BELKIN=y
1011CONFIG_HID_CHERRY=y 1029CONFIG_HID_CHERRY=y
1012CONFIG_HID_CHICONY=y 1030CONFIG_HID_CHICONY=y
1013CONFIG_HID_CYPRESS=y 1031CONFIG_HID_CYPRESS=y
1014# CONFIG_DRAGONRISE_FF is not set 1032# CONFIG_HID_DRAGONRISE is not set
1015CONFIG_HID_EZKEY=y 1033CONFIG_HID_EZKEY=y
1016# CONFIG_HID_KYE is not set 1034# CONFIG_HID_KYE is not set
1017CONFIG_HID_GYRATION=y 1035CONFIG_HID_GYRATION=y
@@ -1028,10 +1046,11 @@ CONFIG_HID_PETALYNX=y
1028CONFIG_HID_SAMSUNG=y 1046CONFIG_HID_SAMSUNG=y
1029CONFIG_HID_SONY=y 1047CONFIG_HID_SONY=y
1030CONFIG_HID_SUNPLUS=y 1048CONFIG_HID_SUNPLUS=y
1031# CONFIG_GREENASIA_FF is not set 1049# CONFIG_HID_GREENASIA is not set
1050# CONFIG_HID_SMARTJOYPLUS is not set
1032# CONFIG_HID_TOPSEED is not set 1051# CONFIG_HID_TOPSEED is not set
1033CONFIG_THRUSTMASTER_FF=m 1052# CONFIG_HID_THRUSTMASTER is not set
1034CONFIG_ZEROPLUS_FF=m 1053# CONFIG_HID_ZEROPLUS is not set
1035CONFIG_USB_SUPPORT=y 1054CONFIG_USB_SUPPORT=y
1036CONFIG_USB_ARCH_HAS_HCD=y 1055CONFIG_USB_ARCH_HAS_HCD=y
1037CONFIG_USB_ARCH_HAS_OHCI=y 1056CONFIG_USB_ARCH_HAS_OHCI=y
@@ -1057,6 +1076,7 @@ CONFIG_USB_MON=y
1057# USB Host Controller Drivers 1076# USB Host Controller Drivers
1058# 1077#
1059# CONFIG_USB_C67X00_HCD is not set 1078# CONFIG_USB_C67X00_HCD is not set
1079# CONFIG_USB_XHCI_HCD is not set
1060CONFIG_USB_EHCI_HCD=y 1080CONFIG_USB_EHCI_HCD=y
1061CONFIG_USB_EHCI_ROOT_HUB_TT=y 1081CONFIG_USB_EHCI_ROOT_HUB_TT=y
1062# CONFIG_USB_EHCI_TT_NEWSCHED is not set 1082# CONFIG_USB_EHCI_TT_NEWSCHED is not set
@@ -1141,6 +1161,10 @@ CONFIG_USB_EHCI_HCD_PPC_OF=y
1141# CONFIG_DMADEVICES is not set 1161# CONFIG_DMADEVICES is not set
1142# CONFIG_AUXDISPLAY is not set 1162# CONFIG_AUXDISPLAY is not set
1143# CONFIG_UIO is not set 1163# CONFIG_UIO is not set
1164
1165#
1166# TI VLYNQ
1167#
1144# CONFIG_STAGING is not set 1168# CONFIG_STAGING is not set
1145 1169
1146# 1170#
@@ -1160,10 +1184,12 @@ CONFIG_FS_MBCACHE=y
1160# CONFIG_REISERFS_FS is not set 1184# CONFIG_REISERFS_FS is not set
1161# CONFIG_JFS_FS is not set 1185# CONFIG_JFS_FS is not set
1162# CONFIG_FS_POSIX_ACL is not set 1186# CONFIG_FS_POSIX_ACL is not set
1163CONFIG_FILE_LOCKING=y
1164# CONFIG_XFS_FS is not set 1187# CONFIG_XFS_FS is not set
1188# CONFIG_GFS2_FS is not set
1165# CONFIG_OCFS2_FS is not set 1189# CONFIG_OCFS2_FS is not set
1166# CONFIG_BTRFS_FS is not set 1190# CONFIG_BTRFS_FS is not set
1191CONFIG_FILE_LOCKING=y
1192CONFIG_FSNOTIFY=y
1167CONFIG_DNOTIFY=y 1193CONFIG_DNOTIFY=y
1168CONFIG_INOTIFY=y 1194CONFIG_INOTIFY=y
1169CONFIG_INOTIFY_USER=y 1195CONFIG_INOTIFY_USER=y
@@ -1226,6 +1252,7 @@ CONFIG_NFS_FS=y
1226CONFIG_NFS_V3=y 1252CONFIG_NFS_V3=y
1227# CONFIG_NFS_V3_ACL is not set 1253# CONFIG_NFS_V3_ACL is not set
1228CONFIG_NFS_V4=y 1254CONFIG_NFS_V4=y
1255# CONFIG_NFS_V4_1 is not set
1229CONFIG_ROOT_NFS=y 1256CONFIG_ROOT_NFS=y
1230# CONFIG_NFSD is not set 1257# CONFIG_NFSD is not set
1231CONFIG_LOCKD=y 1258CONFIG_LOCKD=y
@@ -1262,7 +1289,46 @@ CONFIG_MSDOS_PARTITION=y
1262# CONFIG_KARMA_PARTITION is not set 1289# CONFIG_KARMA_PARTITION is not set
1263# CONFIG_EFI_PARTITION is not set 1290# CONFIG_EFI_PARTITION is not set
1264# CONFIG_SYSV68_PARTITION is not set 1291# CONFIG_SYSV68_PARTITION is not set
1265# CONFIG_NLS is not set 1292CONFIG_NLS=y
1293CONFIG_NLS_DEFAULT="iso8859-1"
1294# CONFIG_NLS_CODEPAGE_437 is not set
1295# CONFIG_NLS_CODEPAGE_737 is not set
1296# CONFIG_NLS_CODEPAGE_775 is not set
1297# CONFIG_NLS_CODEPAGE_850 is not set
1298# CONFIG_NLS_CODEPAGE_852 is not set
1299# CONFIG_NLS_CODEPAGE_855 is not set
1300# CONFIG_NLS_CODEPAGE_857 is not set
1301# CONFIG_NLS_CODEPAGE_860 is not set
1302# CONFIG_NLS_CODEPAGE_861 is not set
1303# CONFIG_NLS_CODEPAGE_862 is not set
1304# CONFIG_NLS_CODEPAGE_863 is not set
1305# CONFIG_NLS_CODEPAGE_864 is not set
1306# CONFIG_NLS_CODEPAGE_865 is not set
1307# CONFIG_NLS_CODEPAGE_866 is not set
1308# CONFIG_NLS_CODEPAGE_869 is not set
1309# CONFIG_NLS_CODEPAGE_936 is not set
1310# CONFIG_NLS_CODEPAGE_950 is not set
1311# CONFIG_NLS_CODEPAGE_932 is not set
1312# CONFIG_NLS_CODEPAGE_949 is not set
1313# CONFIG_NLS_CODEPAGE_874 is not set
1314# CONFIG_NLS_ISO8859_8 is not set
1315# CONFIG_NLS_CODEPAGE_1250 is not set
1316# CONFIG_NLS_CODEPAGE_1251 is not set
1317# CONFIG_NLS_ASCII is not set
1318# CONFIG_NLS_ISO8859_1 is not set
1319# CONFIG_NLS_ISO8859_2 is not set
1320# CONFIG_NLS_ISO8859_3 is not set
1321# CONFIG_NLS_ISO8859_4 is not set
1322# CONFIG_NLS_ISO8859_5 is not set
1323# CONFIG_NLS_ISO8859_6 is not set
1324# CONFIG_NLS_ISO8859_7 is not set
1325# CONFIG_NLS_ISO8859_9 is not set
1326# CONFIG_NLS_ISO8859_13 is not set
1327# CONFIG_NLS_ISO8859_14 is not set
1328# CONFIG_NLS_ISO8859_15 is not set
1329# CONFIG_NLS_KOI8_R is not set
1330# CONFIG_NLS_KOI8_U is not set
1331# CONFIG_NLS_UTF8 is not set
1266# CONFIG_DLM is not set 1332# CONFIG_DLM is not set
1267# CONFIG_BINARY_PRINTF is not set 1333# CONFIG_BINARY_PRINTF is not set
1268 1334
@@ -1285,6 +1351,7 @@ CONFIG_HAS_IOPORT=y
1285CONFIG_HAS_DMA=y 1351CONFIG_HAS_DMA=y
1286CONFIG_HAVE_LMB=y 1352CONFIG_HAVE_LMB=y
1287CONFIG_NLATTR=y 1353CONFIG_NLATTR=y
1354CONFIG_GENERIC_ATOMIC64=y
1288 1355
1289# 1356#
1290# Kernel hacking 1357# Kernel hacking
@@ -1308,22 +1375,11 @@ CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
1308CONFIG_HAVE_DYNAMIC_FTRACE=y 1375CONFIG_HAVE_DYNAMIC_FTRACE=y
1309CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y 1376CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
1310CONFIG_TRACING_SUPPORT=y 1377CONFIG_TRACING_SUPPORT=y
1311 1378# CONFIG_FTRACE is not set
1312#
1313# Tracers
1314#
1315# CONFIG_FUNCTION_TRACER is not set
1316# CONFIG_SCHED_TRACER is not set
1317# CONFIG_CONTEXT_SWITCH_TRACER is not set
1318# CONFIG_EVENT_TRACER is not set
1319# CONFIG_BOOT_TRACER is not set
1320# CONFIG_TRACE_BRANCH_PROFILING is not set
1321# CONFIG_STACK_TRACER is not set
1322# CONFIG_KMEMTRACE is not set
1323# CONFIG_WORKQUEUE_TRACER is not set
1324# CONFIG_BLK_DEV_IO_TRACE is not set
1325# CONFIG_SAMPLES is not set 1379# CONFIG_SAMPLES is not set
1326CONFIG_HAVE_ARCH_KGDB=y 1380CONFIG_HAVE_ARCH_KGDB=y
1381# CONFIG_PPC_DISABLE_WERROR is not set
1382CONFIG_PPC_WERROR=y
1327CONFIG_PRINT_STACK_DEPTH=64 1383CONFIG_PRINT_STACK_DEPTH=64
1328# CONFIG_IRQSTACKS is not set 1384# CONFIG_IRQSTACKS is not set
1329# CONFIG_BOOTX_TEXT is not set 1385# CONFIG_BOOTX_TEXT is not set
diff --git a/arch/powerpc/configs/83xx/sbc834x_defconfig b/arch/powerpc/configs/83xx/sbc834x_defconfig
index fe08f672cb27..a592b5efdc4d 100644
--- a/arch/powerpc/configs/83xx/sbc834x_defconfig
+++ b/arch/powerpc/configs/83xx/sbc834x_defconfig
@@ -1,26 +1,28 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.30-rc3 3# Linux kernel version: 2.6.31-rc4
4# Wed May 13 17:22:15 2009 4# Wed Jul 29 23:32:13 2009
5# 5#
6# CONFIG_PPC64 is not set 6# CONFIG_PPC64 is not set
7 7
8# 8#
9# Processor support 9# Processor support
10# 10#
11CONFIG_6xx=y 11CONFIG_PPC_BOOK3S_32=y
12# CONFIG_PPC_85xx is not set 12# CONFIG_PPC_85xx is not set
13# CONFIG_PPC_8xx is not set 13# CONFIG_PPC_8xx is not set
14# CONFIG_40x is not set 14# CONFIG_40x is not set
15# CONFIG_44x is not set 15# CONFIG_44x is not set
16# CONFIG_E200 is not set 16# CONFIG_E200 is not set
17CONFIG_PPC_BOOK3S=y 17CONFIG_PPC_BOOK3S=y
18CONFIG_6xx=y
18CONFIG_PPC_FPU=y 19CONFIG_PPC_FPU=y
19# CONFIG_FSL_EMB_PERFMON is not set 20# CONFIG_FSL_EMB_PERFMON is not set
20# CONFIG_ALTIVEC is not set 21# CONFIG_ALTIVEC is not set
21CONFIG_PPC_STD_MMU=y 22CONFIG_PPC_STD_MMU=y
22CONFIG_PPC_STD_MMU_32=y 23CONFIG_PPC_STD_MMU_32=y
23# CONFIG_PPC_MM_SLICES is not set 24# CONFIG_PPC_MM_SLICES is not set
25CONFIG_PPC_HAVE_PMU_SUPPORT=y
24# CONFIG_SMP is not set 26# CONFIG_SMP is not set
25CONFIG_PPC32=y 27CONFIG_PPC32=y
26CONFIG_WORD_SIZE=32 28CONFIG_WORD_SIZE=32
@@ -31,15 +33,16 @@ CONFIG_GENERIC_TIME=y
31CONFIG_GENERIC_TIME_VSYSCALL=y 33CONFIG_GENERIC_TIME_VSYSCALL=y
32CONFIG_GENERIC_CLOCKEVENTS=y 34CONFIG_GENERIC_CLOCKEVENTS=y
33CONFIG_GENERIC_HARDIRQS=y 35CONFIG_GENERIC_HARDIRQS=y
36CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
34# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set 37# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set
35CONFIG_IRQ_PER_CPU=y 38CONFIG_IRQ_PER_CPU=y
36CONFIG_STACKTRACE_SUPPORT=y 39CONFIG_STACKTRACE_SUPPORT=y
37CONFIG_HAVE_LATENCYTOP_SUPPORT=y 40CONFIG_HAVE_LATENCYTOP_SUPPORT=y
41CONFIG_TRACE_IRQFLAGS_SUPPORT=y
38CONFIG_LOCKDEP_SUPPORT=y 42CONFIG_LOCKDEP_SUPPORT=y
39CONFIG_RWSEM_XCHGADD_ALGORITHM=y 43CONFIG_RWSEM_XCHGADD_ALGORITHM=y
40CONFIG_ARCH_HAS_ILOG2_U32=y 44CONFIG_ARCH_HAS_ILOG2_U32=y
41CONFIG_GENERIC_HWEIGHT=y 45CONFIG_GENERIC_HWEIGHT=y
42CONFIG_GENERIC_CALIBRATE_DELAY=y
43CONFIG_GENERIC_FIND_NEXT_BIT=y 46CONFIG_GENERIC_FIND_NEXT_BIT=y
44# CONFIG_ARCH_NO_VIRT_TO_BUS is not set 47# CONFIG_ARCH_NO_VIRT_TO_BUS is not set
45CONFIG_PPC=y 48CONFIG_PPC=y
@@ -53,12 +56,14 @@ CONFIG_PPC_UDBG_16550=y
53# CONFIG_GENERIC_TBSYNC is not set 56# CONFIG_GENERIC_TBSYNC is not set
54CONFIG_AUDIT_ARCH=y 57CONFIG_AUDIT_ARCH=y
55CONFIG_GENERIC_BUG=y 58CONFIG_GENERIC_BUG=y
59CONFIG_DTC=y
56CONFIG_DEFAULT_UIMAGE=y 60CONFIG_DEFAULT_UIMAGE=y
57CONFIG_ARCH_SUSPEND_POSSIBLE=y 61CONFIG_ARCH_SUSPEND_POSSIBLE=y
58# CONFIG_PPC_DCR_NATIVE is not set 62# CONFIG_PPC_DCR_NATIVE is not set
59# CONFIG_PPC_DCR_MMIO is not set 63# CONFIG_PPC_DCR_MMIO is not set
60CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y 64CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y
61CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" 65CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
66CONFIG_CONSTRUCTORS=y
62 67
63# 68#
64# General setup 69# General setup
@@ -107,7 +112,6 @@ CONFIG_ANON_INODES=y
107CONFIG_EMBEDDED=y 112CONFIG_EMBEDDED=y
108CONFIG_SYSCTL_SYSCALL=y 113CONFIG_SYSCTL_SYSCALL=y
109# CONFIG_KALLSYMS is not set 114# CONFIG_KALLSYMS is not set
110# CONFIG_STRIP_ASM_SYMS is not set
111CONFIG_HOTPLUG=y 115CONFIG_HOTPLUG=y
112CONFIG_PRINTK=y 116CONFIG_PRINTK=y
113CONFIG_BUG=y 117CONFIG_BUG=y
@@ -120,8 +124,15 @@ CONFIG_TIMERFD=y
120CONFIG_EVENTFD=y 124CONFIG_EVENTFD=y
121CONFIG_SHMEM=y 125CONFIG_SHMEM=y
122CONFIG_AIO=y 126CONFIG_AIO=y
127CONFIG_HAVE_PERF_COUNTERS=y
128
129#
130# Performance Counters
131#
132# CONFIG_PERF_COUNTERS is not set
123CONFIG_VM_EVENT_COUNTERS=y 133CONFIG_VM_EVENT_COUNTERS=y
124CONFIG_PCI_QUIRKS=y 134CONFIG_PCI_QUIRKS=y
135# CONFIG_STRIP_ASM_SYMS is not set
125CONFIG_COMPAT_BRK=y 136CONFIG_COMPAT_BRK=y
126CONFIG_SLAB=y 137CONFIG_SLAB=y
127# CONFIG_SLUB is not set 138# CONFIG_SLUB is not set
@@ -134,6 +145,10 @@ CONFIG_HAVE_IOREMAP_PROT=y
134CONFIG_HAVE_KPROBES=y 145CONFIG_HAVE_KPROBES=y
135CONFIG_HAVE_KRETPROBES=y 146CONFIG_HAVE_KRETPROBES=y
136CONFIG_HAVE_ARCH_TRACEHOOK=y 147CONFIG_HAVE_ARCH_TRACEHOOK=y
148
149#
150# GCOV-based kernel profiling
151#
137# CONFIG_SLOW_WORK is not set 152# CONFIG_SLOW_WORK is not set
138# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set 153# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
139CONFIG_SLABINFO=y 154CONFIG_SLABINFO=y
@@ -146,7 +161,7 @@ CONFIG_MODULE_UNLOAD=y
146# CONFIG_MODVERSIONS is not set 161# CONFIG_MODVERSIONS is not set
147# CONFIG_MODULE_SRCVERSION_ALL is not set 162# CONFIG_MODULE_SRCVERSION_ALL is not set
148CONFIG_BLOCK=y 163CONFIG_BLOCK=y
149# CONFIG_LBD is not set 164CONFIG_LBDAF=y
150# CONFIG_BLK_DEV_BSG is not set 165# CONFIG_BLK_DEV_BSG is not set
151# CONFIG_BLK_DEV_INTEGRITY is not set 166# CONFIG_BLK_DEV_INTEGRITY is not set
152 167
@@ -188,6 +203,7 @@ CONFIG_PPC_83xx=y
188# CONFIG_MPC837x_RDB is not set 203# CONFIG_MPC837x_RDB is not set
189CONFIG_SBC834x=y 204CONFIG_SBC834x=y
190# CONFIG_ASP834x is not set 205# CONFIG_ASP834x is not set
206# CONFIG_KMETER1 is not set
191CONFIG_PPC_MPC834x=y 207CONFIG_PPC_MPC834x=y
192# CONFIG_PPC_86xx is not set 208# CONFIG_PPC_86xx is not set
193# CONFIG_EMBEDDED6xx is not set 209# CONFIG_EMBEDDED6xx is not set
@@ -232,6 +248,7 @@ CONFIG_BINFMT_ELF=y
232# CONFIG_HAVE_AOUT is not set 248# CONFIG_HAVE_AOUT is not set
233# CONFIG_BINFMT_MISC is not set 249# CONFIG_BINFMT_MISC is not set
234# CONFIG_IOMMU_HELPER is not set 250# CONFIG_IOMMU_HELPER is not set
251# CONFIG_SWIOTLB is not set
235CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y 252CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
236CONFIG_ARCH_HAS_WALK_MEMORY=y 253CONFIG_ARCH_HAS_WALK_MEMORY=y
237CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y 254CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y
@@ -252,9 +269,9 @@ CONFIG_MIGRATION=y
252CONFIG_ZONE_DMA_FLAG=1 269CONFIG_ZONE_DMA_FLAG=1
253CONFIG_BOUNCE=y 270CONFIG_BOUNCE=y
254CONFIG_VIRT_TO_BUS=y 271CONFIG_VIRT_TO_BUS=y
255CONFIG_UNEVICTABLE_LRU=y
256CONFIG_HAVE_MLOCK=y 272CONFIG_HAVE_MLOCK=y
257CONFIG_HAVE_MLOCKED_PAGE_BIT=y 273CONFIG_HAVE_MLOCKED_PAGE_BIT=y
274CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
258CONFIG_PPC_4K_PAGES=y 275CONFIG_PPC_4K_PAGES=y
259# CONFIG_PPC_16K_PAGES is not set 276# CONFIG_PPC_16K_PAGES is not set
260# CONFIG_PPC_64K_PAGES is not set 277# CONFIG_PPC_64K_PAGES is not set
@@ -363,6 +380,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
363# CONFIG_ECONET is not set 380# CONFIG_ECONET is not set
364# CONFIG_WAN_ROUTER is not set 381# CONFIG_WAN_ROUTER is not set
365# CONFIG_PHONET is not set 382# CONFIG_PHONET is not set
383# CONFIG_IEEE802154 is not set
366# CONFIG_NET_SCHED is not set 384# CONFIG_NET_SCHED is not set
367# CONFIG_DCB is not set 385# CONFIG_DCB is not set
368 386
@@ -380,7 +398,11 @@ CONFIG_WIRELESS=y
380CONFIG_WIRELESS_OLD_REGULATORY=y 398CONFIG_WIRELESS_OLD_REGULATORY=y
381# CONFIG_WIRELESS_EXT is not set 399# CONFIG_WIRELESS_EXT is not set
382# CONFIG_LIB80211 is not set 400# CONFIG_LIB80211 is not set
383# CONFIG_MAC80211 is not set 401
402#
403# CFG80211 needs to be enabled for MAC80211
404#
405CONFIG_MAC80211_DEFAULT_PS_VALUE=0
384# CONFIG_WIMAX is not set 406# CONFIG_WIMAX is not set
385# CONFIG_RFKILL is not set 407# CONFIG_RFKILL is not set
386# CONFIG_NET_9P is not set 408# CONFIG_NET_9P is not set
@@ -401,6 +423,7 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y
401# CONFIG_MTD is not set 423# CONFIG_MTD is not set
402CONFIG_OF_DEVICE=y 424CONFIG_OF_DEVICE=y
403CONFIG_OF_I2C=y 425CONFIG_OF_I2C=y
426CONFIG_OF_MDIO=y
404# CONFIG_PARPORT is not set 427# CONFIG_PARPORT is not set
405CONFIG_BLK_DEV=y 428CONFIG_BLK_DEV=y
406# CONFIG_BLK_DEV_FD is not set 429# CONFIG_BLK_DEV_FD is not set
@@ -435,7 +458,9 @@ CONFIG_MISC_DEVICES=y
435# 458#
436# CONFIG_EEPROM_AT24 is not set 459# CONFIG_EEPROM_AT24 is not set
437# CONFIG_EEPROM_LEGACY is not set 460# CONFIG_EEPROM_LEGACY is not set
461# CONFIG_EEPROM_MAX6875 is not set
438# CONFIG_EEPROM_93CX6 is not set 462# CONFIG_EEPROM_93CX6 is not set
463# CONFIG_CB710_CORE is not set
439CONFIG_HAVE_IDE=y 464CONFIG_HAVE_IDE=y
440# CONFIG_IDE is not set 465# CONFIG_IDE is not set
441 466
@@ -455,14 +480,17 @@ CONFIG_HAVE_IDE=y
455# 480#
456 481
457# 482#
458# Enable only one of the two stacks, unless you know what you are doing 483# You can enable one or both FireWire driver stacks.
484#
485
486#
487# See the help texts for more information.
459# 488#
460# CONFIG_FIREWIRE is not set 489# CONFIG_FIREWIRE is not set
461# CONFIG_IEEE1394 is not set 490# CONFIG_IEEE1394 is not set
462# CONFIG_I2O is not set 491# CONFIG_I2O is not set
463# CONFIG_MACINTOSH_DRIVERS is not set 492# CONFIG_MACINTOSH_DRIVERS is not set
464CONFIG_NETDEVICES=y 493CONFIG_NETDEVICES=y
465CONFIG_COMPAT_NET_DEV_OPS=y
466# CONFIG_DUMMY is not set 494# CONFIG_DUMMY is not set
467# CONFIG_BONDING is not set 495# CONFIG_BONDING is not set
468# CONFIG_MACVLAN is not set 496# CONFIG_MACVLAN is not set
@@ -509,6 +537,7 @@ CONFIG_MII=y
509# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set 537# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
510# CONFIG_NET_PCI is not set 538# CONFIG_NET_PCI is not set
511# CONFIG_B44 is not set 539# CONFIG_B44 is not set
540# CONFIG_KS8842 is not set
512# CONFIG_ATL2 is not set 541# CONFIG_ATL2 is not set
513CONFIG_NETDEV_1000=y 542CONFIG_NETDEV_1000=y
514# CONFIG_ACENIC is not set 543# CONFIG_ACENIC is not set
@@ -528,8 +557,10 @@ CONFIG_NETDEV_1000=y
528# CONFIG_VIA_VELOCITY is not set 557# CONFIG_VIA_VELOCITY is not set
529# CONFIG_TIGON3 is not set 558# CONFIG_TIGON3 is not set
530# CONFIG_BNX2 is not set 559# CONFIG_BNX2 is not set
560# CONFIG_CNIC is not set
531CONFIG_FSL_PQ_MDIO=y 561CONFIG_FSL_PQ_MDIO=y
532CONFIG_GIANFAR=y 562CONFIG_GIANFAR=y
563# CONFIG_MV643XX_ETH is not set
533# CONFIG_QLA3XXX is not set 564# CONFIG_QLA3XXX is not set
534# CONFIG_ATL1 is not set 565# CONFIG_ATL1 is not set
535# CONFIG_ATL1E is not set 566# CONFIG_ATL1E is not set
@@ -688,13 +719,17 @@ CONFIG_I2C_MPC=y
688# CONFIG_SENSORS_PCF8574 is not set 719# CONFIG_SENSORS_PCF8574 is not set
689# CONFIG_PCF8575 is not set 720# CONFIG_PCF8575 is not set
690# CONFIG_SENSORS_PCA9539 is not set 721# CONFIG_SENSORS_PCA9539 is not set
691# CONFIG_SENSORS_MAX6875 is not set
692# CONFIG_SENSORS_TSL2550 is not set 722# CONFIG_SENSORS_TSL2550 is not set
693# CONFIG_I2C_DEBUG_CORE is not set 723# CONFIG_I2C_DEBUG_CORE is not set
694# CONFIG_I2C_DEBUG_ALGO is not set 724# CONFIG_I2C_DEBUG_ALGO is not set
695# CONFIG_I2C_DEBUG_BUS is not set 725# CONFIG_I2C_DEBUG_BUS is not set
696# CONFIG_I2C_DEBUG_CHIP is not set 726# CONFIG_I2C_DEBUG_CHIP is not set
697# CONFIG_SPI is not set 727# CONFIG_SPI is not set
728
729#
730# PPS support
731#
732# CONFIG_PPS is not set
698CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y 733CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
699# CONFIG_GPIOLIB is not set 734# CONFIG_GPIOLIB is not set
700# CONFIG_W1 is not set 735# CONFIG_W1 is not set
@@ -749,6 +784,7 @@ CONFIG_HWMON=y
749# CONFIG_SENSORS_SMSC47B397 is not set 784# CONFIG_SENSORS_SMSC47B397 is not set
750# CONFIG_SENSORS_ADS7828 is not set 785# CONFIG_SENSORS_ADS7828 is not set
751# CONFIG_SENSORS_THMC50 is not set 786# CONFIG_SENSORS_THMC50 is not set
787# CONFIG_SENSORS_TMP401 is not set
752# CONFIG_SENSORS_VIA686A is not set 788# CONFIG_SENSORS_VIA686A is not set
753# CONFIG_SENSORS_VT1211 is not set 789# CONFIG_SENSORS_VT1211 is not set
754# CONFIG_SENSORS_VT8231 is not set 790# CONFIG_SENSORS_VT8231 is not set
@@ -797,23 +833,9 @@ CONFIG_SSB_POSSIBLE=y
797# CONFIG_MFD_WM8400 is not set 833# CONFIG_MFD_WM8400 is not set
798# CONFIG_MFD_WM8350_I2C is not set 834# CONFIG_MFD_WM8350_I2C is not set
799# CONFIG_MFD_PCF50633 is not set 835# CONFIG_MFD_PCF50633 is not set
836# CONFIG_AB3100_CORE is not set
800# CONFIG_REGULATOR is not set 837# CONFIG_REGULATOR is not set
801 838# CONFIG_MEDIA_SUPPORT is not set
802#
803# Multimedia devices
804#
805
806#
807# Multimedia core support
808#
809# CONFIG_VIDEO_DEV is not set
810# CONFIG_DVB_CORE is not set
811# CONFIG_VIDEO_MEDIA is not set
812
813#
814# Multimedia drivers
815#
816# CONFIG_DAB is not set
817 839
818# 840#
819# Graphics support 841# Graphics support
@@ -851,6 +873,10 @@ CONFIG_HID=y
851# CONFIG_DMADEVICES is not set 873# CONFIG_DMADEVICES is not set
852# CONFIG_AUXDISPLAY is not set 874# CONFIG_AUXDISPLAY is not set
853# CONFIG_UIO is not set 875# CONFIG_UIO is not set
876
877#
878# TI VLYNQ
879#
854# CONFIG_STAGING is not set 880# CONFIG_STAGING is not set
855 881
856# 882#
@@ -862,10 +888,12 @@ CONFIG_HID=y
862# CONFIG_REISERFS_FS is not set 888# CONFIG_REISERFS_FS is not set
863# CONFIG_JFS_FS is not set 889# CONFIG_JFS_FS is not set
864# CONFIG_FS_POSIX_ACL is not set 890# CONFIG_FS_POSIX_ACL is not set
865CONFIG_FILE_LOCKING=y
866# CONFIG_XFS_FS is not set 891# CONFIG_XFS_FS is not set
892# CONFIG_GFS2_FS is not set
867# CONFIG_OCFS2_FS is not set 893# CONFIG_OCFS2_FS is not set
868# CONFIG_BTRFS_FS is not set 894# CONFIG_BTRFS_FS is not set
895CONFIG_FILE_LOCKING=y
896CONFIG_FSNOTIFY=y
869CONFIG_DNOTIFY=y 897CONFIG_DNOTIFY=y
870CONFIG_INOTIFY=y 898CONFIG_INOTIFY=y
871CONFIG_INOTIFY_USER=y 899CONFIG_INOTIFY_USER=y
@@ -928,6 +956,7 @@ CONFIG_NFS_FS=y
928CONFIG_NFS_V3=y 956CONFIG_NFS_V3=y
929# CONFIG_NFS_V3_ACL is not set 957# CONFIG_NFS_V3_ACL is not set
930CONFIG_NFS_V4=y 958CONFIG_NFS_V4=y
959# CONFIG_NFS_V4_1 is not set
931CONFIG_ROOT_NFS=y 960CONFIG_ROOT_NFS=y
932# CONFIG_NFSD is not set 961# CONFIG_NFSD is not set
933CONFIG_LOCKD=y 962CONFIG_LOCKD=y
@@ -971,6 +1000,7 @@ CONFIG_HAS_IOPORT=y
971CONFIG_HAS_DMA=y 1000CONFIG_HAS_DMA=y
972CONFIG_HAVE_LMB=y 1001CONFIG_HAVE_LMB=y
973CONFIG_NLATTR=y 1002CONFIG_NLATTR=y
1003CONFIG_GENERIC_ATOMIC64=y
974 1004
975# 1005#
976# Kernel hacking 1006# Kernel hacking
@@ -994,22 +1024,11 @@ CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
994CONFIG_HAVE_DYNAMIC_FTRACE=y 1024CONFIG_HAVE_DYNAMIC_FTRACE=y
995CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y 1025CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
996CONFIG_TRACING_SUPPORT=y 1026CONFIG_TRACING_SUPPORT=y
997 1027# CONFIG_FTRACE is not set
998#
999# Tracers
1000#
1001# CONFIG_FUNCTION_TRACER is not set
1002# CONFIG_SCHED_TRACER is not set
1003# CONFIG_CONTEXT_SWITCH_TRACER is not set
1004# CONFIG_EVENT_TRACER is not set
1005# CONFIG_BOOT_TRACER is not set
1006# CONFIG_TRACE_BRANCH_PROFILING is not set
1007# CONFIG_STACK_TRACER is not set
1008# CONFIG_KMEMTRACE is not set
1009# CONFIG_WORKQUEUE_TRACER is not set
1010# CONFIG_BLK_DEV_IO_TRACE is not set
1011# CONFIG_SAMPLES is not set 1028# CONFIG_SAMPLES is not set
1012CONFIG_HAVE_ARCH_KGDB=y 1029CONFIG_HAVE_ARCH_KGDB=y
1030# CONFIG_PPC_DISABLE_WERROR is not set
1031CONFIG_PPC_WERROR=y
1013CONFIG_PRINT_STACK_DEPTH=64 1032CONFIG_PRINT_STACK_DEPTH=64
1014# CONFIG_IRQSTACKS is not set 1033# CONFIG_IRQSTACKS is not set
1015# CONFIG_BOOTX_TEXT is not set 1034# CONFIG_BOOTX_TEXT is not set
diff --git a/arch/powerpc/configs/85xx/ksi8560_defconfig b/arch/powerpc/configs/85xx/ksi8560_defconfig
index 09146ddaa3ca..ff04e1028f5e 100644
--- a/arch/powerpc/configs/85xx/ksi8560_defconfig
+++ b/arch/powerpc/configs/85xx/ksi8560_defconfig
@@ -1,14 +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.30-rc3 3# Linux kernel version: 2.6.31-rc4
4# Wed May 13 17:22:16 2009 4# Wed Jul 29 23:32:14 2009
5# 5#
6# CONFIG_PPC64 is not set 6# CONFIG_PPC64 is not set
7 7
8# 8#
9# Processor support 9# Processor support
10# 10#
11# CONFIG_6xx is not set 11# CONFIG_PPC_BOOK3S_32 is not set
12CONFIG_PPC_85xx=y 12CONFIG_PPC_85xx=y
13# CONFIG_PPC_8xx is not set 13# CONFIG_PPC_8xx is not set
14# CONFIG_40x is not set 14# CONFIG_40x is not set
@@ -34,15 +34,16 @@ CONFIG_GENERIC_TIME=y
34CONFIG_GENERIC_TIME_VSYSCALL=y 34CONFIG_GENERIC_TIME_VSYSCALL=y
35CONFIG_GENERIC_CLOCKEVENTS=y 35CONFIG_GENERIC_CLOCKEVENTS=y
36CONFIG_GENERIC_HARDIRQS=y 36CONFIG_GENERIC_HARDIRQS=y
37CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
37# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set 38# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set
38CONFIG_IRQ_PER_CPU=y 39CONFIG_IRQ_PER_CPU=y
39CONFIG_STACKTRACE_SUPPORT=y 40CONFIG_STACKTRACE_SUPPORT=y
40CONFIG_HAVE_LATENCYTOP_SUPPORT=y 41CONFIG_HAVE_LATENCYTOP_SUPPORT=y
42CONFIG_TRACE_IRQFLAGS_SUPPORT=y
41CONFIG_LOCKDEP_SUPPORT=y 43CONFIG_LOCKDEP_SUPPORT=y
42CONFIG_RWSEM_XCHGADD_ALGORITHM=y 44CONFIG_RWSEM_XCHGADD_ALGORITHM=y
43CONFIG_ARCH_HAS_ILOG2_U32=y 45CONFIG_ARCH_HAS_ILOG2_U32=y
44CONFIG_GENERIC_HWEIGHT=y 46CONFIG_GENERIC_HWEIGHT=y
45CONFIG_GENERIC_CALIBRATE_DELAY=y
46CONFIG_GENERIC_FIND_NEXT_BIT=y 47CONFIG_GENERIC_FIND_NEXT_BIT=y
47CONFIG_GENERIC_GPIO=y 48CONFIG_GENERIC_GPIO=y
48# CONFIG_ARCH_NO_VIRT_TO_BUS is not set 49# CONFIG_ARCH_NO_VIRT_TO_BUS is not set
@@ -57,11 +58,13 @@ CONFIG_PPC_UDBG_16550=y
57# CONFIG_GENERIC_TBSYNC is not set 58# CONFIG_GENERIC_TBSYNC is not set
58CONFIG_AUDIT_ARCH=y 59CONFIG_AUDIT_ARCH=y
59CONFIG_GENERIC_BUG=y 60CONFIG_GENERIC_BUG=y
61CONFIG_DTC=y
60CONFIG_DEFAULT_UIMAGE=y 62CONFIG_DEFAULT_UIMAGE=y
61# CONFIG_PPC_DCR_NATIVE is not set 63# CONFIG_PPC_DCR_NATIVE is not set
62# CONFIG_PPC_DCR_MMIO is not set 64# CONFIG_PPC_DCR_MMIO is not set
63CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y 65CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y
64CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" 66CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
67CONFIG_CONSTRUCTORS=y
65 68
66# 69#
67# General setup 70# General setup
@@ -108,7 +111,6 @@ CONFIG_SYSCTL_SYSCALL=y
108CONFIG_KALLSYMS=y 111CONFIG_KALLSYMS=y
109# CONFIG_KALLSYMS_ALL is not set 112# CONFIG_KALLSYMS_ALL is not set
110# CONFIG_KALLSYMS_EXTRA_PASS is not set 113# CONFIG_KALLSYMS_EXTRA_PASS is not set
111# CONFIG_STRIP_ASM_SYMS is not set
112CONFIG_HOTPLUG=y 114CONFIG_HOTPLUG=y
113CONFIG_PRINTK=y 115CONFIG_PRINTK=y
114CONFIG_BUG=y 116CONFIG_BUG=y
@@ -121,8 +123,15 @@ CONFIG_TIMERFD=y
121CONFIG_EVENTFD=y 123CONFIG_EVENTFD=y
122CONFIG_SHMEM=y 124CONFIG_SHMEM=y
123CONFIG_AIO=y 125CONFIG_AIO=y
126CONFIG_HAVE_PERF_COUNTERS=y
127
128#
129# Performance Counters
130#
131# CONFIG_PERF_COUNTERS is not set
124CONFIG_VM_EVENT_COUNTERS=y 132CONFIG_VM_EVENT_COUNTERS=y
125CONFIG_SLUB_DEBUG=y 133CONFIG_SLUB_DEBUG=y
134# CONFIG_STRIP_ASM_SYMS is not set
126CONFIG_COMPAT_BRK=y 135CONFIG_COMPAT_BRK=y
127# CONFIG_SLAB is not set 136# CONFIG_SLAB is not set
128CONFIG_SLUB=y 137CONFIG_SLUB=y
@@ -136,6 +145,11 @@ CONFIG_HAVE_KPROBES=y
136CONFIG_HAVE_KRETPROBES=y 145CONFIG_HAVE_KRETPROBES=y
137CONFIG_HAVE_ARCH_TRACEHOOK=y 146CONFIG_HAVE_ARCH_TRACEHOOK=y
138CONFIG_HAVE_CLK=y 147CONFIG_HAVE_CLK=y
148
149#
150# GCOV-based kernel profiling
151#
152# CONFIG_GCOV_KERNEL is not set
139# CONFIG_SLOW_WORK is not set 153# CONFIG_SLOW_WORK is not set
140# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set 154# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
141CONFIG_SLABINFO=y 155CONFIG_SLABINFO=y
@@ -143,7 +157,7 @@ CONFIG_RT_MUTEXES=y
143CONFIG_BASE_SMALL=0 157CONFIG_BASE_SMALL=0
144# CONFIG_MODULES is not set 158# CONFIG_MODULES is not set
145CONFIG_BLOCK=y 159CONFIG_BLOCK=y
146# CONFIG_LBD is not set 160CONFIG_LBDAF=y
147# CONFIG_BLK_DEV_BSG is not set 161# CONFIG_BLK_DEV_BSG is not set
148# CONFIG_BLK_DEV_INTEGRITY is not set 162# CONFIG_BLK_DEV_INTEGRITY is not set
149 163
@@ -176,6 +190,7 @@ CONFIG_MPC85xx=y
176# CONFIG_MPC85xx_DS is not set 190# CONFIG_MPC85xx_DS is not set
177# CONFIG_SOCRATES is not set 191# CONFIG_SOCRATES is not set
178CONFIG_KSI8560=y 192CONFIG_KSI8560=y
193# CONFIG_XES_MPC85xx is not set
179# CONFIG_STX_GP3 is not set 194# CONFIG_STX_GP3 is not set
180# CONFIG_TQM8540 is not set 195# CONFIG_TQM8540 is not set
181# CONFIG_TQM8541 is not set 196# CONFIG_TQM8541 is not set
@@ -224,6 +239,7 @@ CONFIG_BINFMT_ELF=y
224CONFIG_BINFMT_MISC=y 239CONFIG_BINFMT_MISC=y
225CONFIG_MATH_EMULATION=y 240CONFIG_MATH_EMULATION=y
226# CONFIG_IOMMU_HELPER is not set 241# CONFIG_IOMMU_HELPER is not set
242# CONFIG_SWIOTLB is not set
227CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y 243CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
228CONFIG_ARCH_HAS_WALK_MEMORY=y 244CONFIG_ARCH_HAS_WALK_MEMORY=y
229CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y 245CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y
@@ -242,9 +258,9 @@ CONFIG_MIGRATION=y
242CONFIG_ZONE_DMA_FLAG=1 258CONFIG_ZONE_DMA_FLAG=1
243CONFIG_BOUNCE=y 259CONFIG_BOUNCE=y
244CONFIG_VIRT_TO_BUS=y 260CONFIG_VIRT_TO_BUS=y
245CONFIG_UNEVICTABLE_LRU=y
246CONFIG_HAVE_MLOCK=y 261CONFIG_HAVE_MLOCK=y
247CONFIG_HAVE_MLOCKED_PAGE_BIT=y 262CONFIG_HAVE_MLOCKED_PAGE_BIT=y
263CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
248CONFIG_PPC_4K_PAGES=y 264CONFIG_PPC_4K_PAGES=y
249# CONFIG_PPC_16K_PAGES is not set 265# CONFIG_PPC_16K_PAGES is not set
250# CONFIG_PPC_64K_PAGES is not set 266# CONFIG_PPC_64K_PAGES is not set
@@ -346,6 +362,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
346# CONFIG_ECONET is not set 362# CONFIG_ECONET is not set
347# CONFIG_WAN_ROUTER is not set 363# CONFIG_WAN_ROUTER is not set
348# CONFIG_PHONET is not set 364# CONFIG_PHONET is not set
365# CONFIG_IEEE802154 is not set
349# CONFIG_NET_SCHED is not set 366# CONFIG_NET_SCHED is not set
350# CONFIG_DCB is not set 367# CONFIG_DCB is not set
351 368
@@ -363,7 +380,11 @@ CONFIG_WIRELESS=y
363CONFIG_WIRELESS_OLD_REGULATORY=y 380CONFIG_WIRELESS_OLD_REGULATORY=y
364# CONFIG_WIRELESS_EXT is not set 381# CONFIG_WIRELESS_EXT is not set
365# CONFIG_LIB80211 is not set 382# CONFIG_LIB80211 is not set
366# CONFIG_MAC80211 is not set 383
384#
385# CFG80211 needs to be enabled for MAC80211
386#
387CONFIG_MAC80211_DEFAULT_PS_VALUE=0
367# CONFIG_WIMAX is not set 388# CONFIG_WIMAX is not set
368# CONFIG_RFKILL is not set 389# CONFIG_RFKILL is not set
369# CONFIG_NET_9P is not set 390# CONFIG_NET_9P is not set
@@ -466,6 +487,7 @@ CONFIG_MTD_PHYSMAP_OF=y
466# CONFIG_MTD_UBI is not set 487# CONFIG_MTD_UBI is not set
467CONFIG_OF_DEVICE=y 488CONFIG_OF_DEVICE=y
468CONFIG_OF_GPIO=y 489CONFIG_OF_GPIO=y
490CONFIG_OF_MDIO=y
469# CONFIG_PARPORT is not set 491# CONFIG_PARPORT is not set
470CONFIG_BLK_DEV=y 492CONFIG_BLK_DEV=y
471# CONFIG_BLK_DEV_FD is not set 493# CONFIG_BLK_DEV_FD is not set
@@ -520,7 +542,6 @@ CONFIG_IDE_PROC_FS=y
520# CONFIG_MD is not set 542# CONFIG_MD is not set
521# CONFIG_MACINTOSH_DRIVERS is not set 543# CONFIG_MACINTOSH_DRIVERS is not set
522CONFIG_NETDEVICES=y 544CONFIG_NETDEVICES=y
523CONFIG_COMPAT_NET_DEV_OPS=y
524# CONFIG_DUMMY is not set 545# CONFIG_DUMMY is not set
525# CONFIG_BONDING is not set 546# CONFIG_BONDING is not set
526# CONFIG_MACVLAN is not set 547# CONFIG_MACVLAN is not set
@@ -560,6 +581,7 @@ CONFIG_MII=y
560# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set 581# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set
561# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set 582# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
562# CONFIG_B44 is not set 583# CONFIG_B44 is not set
584# CONFIG_KS8842 is not set
563CONFIG_FS_ENET=y 585CONFIG_FS_ENET=y
564# CONFIG_FS_ENET_HAS_SCC is not set 586# CONFIG_FS_ENET_HAS_SCC is not set
565CONFIG_FS_ENET_HAS_FCC=y 587CONFIG_FS_ENET_HAS_FCC=y
@@ -567,6 +589,7 @@ CONFIG_FS_ENET_MDIO_FCC=y
567CONFIG_NETDEV_1000=y 589CONFIG_NETDEV_1000=y
568CONFIG_FSL_PQ_MDIO=y 590CONFIG_FSL_PQ_MDIO=y
569CONFIG_GIANFAR=y 591CONFIG_GIANFAR=y
592# CONFIG_MV643XX_ETH is not set
570CONFIG_NETDEV_10000=y 593CONFIG_NETDEV_10000=y
571 594
572# 595#
@@ -654,6 +677,11 @@ CONFIG_GEN_RTC=y
654# CONFIG_TCG_TPM is not set 677# CONFIG_TCG_TPM is not set
655# CONFIG_I2C is not set 678# CONFIG_I2C is not set
656# CONFIG_SPI is not set 679# CONFIG_SPI is not set
680
681#
682# PPS support
683#
684# CONFIG_PPS is not set
657CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y 685CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
658CONFIG_ARCH_REQUIRE_GPIOLIB=y 686CONFIG_ARCH_REQUIRE_GPIOLIB=y
659CONFIG_GPIOLIB=y 687CONFIG_GPIOLIB=y
@@ -710,22 +738,7 @@ CONFIG_SSB_POSSIBLE=y
710# CONFIG_HTC_PASIC3 is not set 738# CONFIG_HTC_PASIC3 is not set
711# CONFIG_MFD_TMIO is not set 739# CONFIG_MFD_TMIO is not set
712# CONFIG_REGULATOR is not set 740# CONFIG_REGULATOR is not set
713 741# CONFIG_MEDIA_SUPPORT is not set
714#
715# Multimedia devices
716#
717
718#
719# Multimedia core support
720#
721# CONFIG_VIDEO_DEV is not set
722# CONFIG_DVB_CORE is not set
723# CONFIG_VIDEO_MEDIA is not set
724
725#
726# Multimedia drivers
727#
728CONFIG_DAB=y
729 742
730# 743#
731# Graphics support 744# Graphics support
@@ -777,6 +790,10 @@ CONFIG_USB_SUPPORT=y
777# CONFIG_DMADEVICES is not set 790# CONFIG_DMADEVICES is not set
778# CONFIG_AUXDISPLAY is not set 791# CONFIG_AUXDISPLAY is not set
779# CONFIG_UIO is not set 792# CONFIG_UIO is not set
793
794#
795# TI VLYNQ
796#
780# CONFIG_STAGING is not set 797# CONFIG_STAGING is not set
781 798
782# 799#
@@ -797,10 +814,12 @@ CONFIG_FS_MBCACHE=y
797# CONFIG_REISERFS_FS is not set 814# CONFIG_REISERFS_FS is not set
798# CONFIG_JFS_FS is not set 815# CONFIG_JFS_FS is not set
799# CONFIG_FS_POSIX_ACL is not set 816# CONFIG_FS_POSIX_ACL is not set
800CONFIG_FILE_LOCKING=y
801# CONFIG_XFS_FS is not set 817# CONFIG_XFS_FS is not set
818# CONFIG_GFS2_FS is not set
802# CONFIG_OCFS2_FS is not set 819# CONFIG_OCFS2_FS is not set
803# CONFIG_BTRFS_FS is not set 820# CONFIG_BTRFS_FS is not set
821CONFIG_FILE_LOCKING=y
822CONFIG_FSNOTIFY=y
804CONFIG_DNOTIFY=y 823CONFIG_DNOTIFY=y
805CONFIG_INOTIFY=y 824CONFIG_INOTIFY=y
806CONFIG_INOTIFY_USER=y 825CONFIG_INOTIFY_USER=y
@@ -916,6 +935,7 @@ CONFIG_HAS_IOPORT=y
916CONFIG_HAS_DMA=y 935CONFIG_HAS_DMA=y
917CONFIG_HAVE_LMB=y 936CONFIG_HAVE_LMB=y
918CONFIG_NLATTR=y 937CONFIG_NLATTR=y
938CONFIG_GENERIC_ATOMIC64=y
919 939
920# 940#
921# Kernel hacking 941# Kernel hacking
@@ -946,6 +966,9 @@ CONFIG_SCHED_DEBUG=y
946# CONFIG_RT_MUTEX_TESTER is not set 966# CONFIG_RT_MUTEX_TESTER is not set
947# CONFIG_DEBUG_SPINLOCK is not set 967# CONFIG_DEBUG_SPINLOCK is not set
948CONFIG_DEBUG_MUTEXES=y 968CONFIG_DEBUG_MUTEXES=y
969# CONFIG_DEBUG_LOCK_ALLOC is not set
970# CONFIG_PROVE_LOCKING is not set
971# CONFIG_LOCK_STAT is not set
949# CONFIG_DEBUG_SPINLOCK_SLEEP is not set 972# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
950# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set 973# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
951# CONFIG_DEBUG_KOBJECT is not set 974# CONFIG_DEBUG_KOBJECT is not set
@@ -958,7 +981,6 @@ CONFIG_DEBUG_MUTEXES=y
958# CONFIG_DEBUG_LIST is not set 981# CONFIG_DEBUG_LIST is not set
959# CONFIG_DEBUG_SG is not set 982# CONFIG_DEBUG_SG is not set
960# CONFIG_DEBUG_NOTIFIERS is not set 983# CONFIG_DEBUG_NOTIFIERS is not set
961# CONFIG_BOOT_PRINTK_DELAY is not set
962# CONFIG_RCU_TORTURE_TEST is not set 984# CONFIG_RCU_TORTURE_TEST is not set
963# CONFIG_RCU_CPU_STALL_DETECTOR is not set 985# CONFIG_RCU_CPU_STALL_DETECTOR is not set
964# CONFIG_BACKTRACE_SELF_TEST is not set 986# CONFIG_BACKTRACE_SELF_TEST is not set
@@ -972,16 +994,15 @@ CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
972CONFIG_HAVE_DYNAMIC_FTRACE=y 994CONFIG_HAVE_DYNAMIC_FTRACE=y
973CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y 995CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
974CONFIG_TRACING_SUPPORT=y 996CONFIG_TRACING_SUPPORT=y
975 997CONFIG_FTRACE=y
976#
977# Tracers
978#
979# CONFIG_FUNCTION_TRACER is not set 998# CONFIG_FUNCTION_TRACER is not set
999# CONFIG_IRQSOFF_TRACER is not set
980# CONFIG_SCHED_TRACER is not set 1000# CONFIG_SCHED_TRACER is not set
981# CONFIG_CONTEXT_SWITCH_TRACER is not set 1001# CONFIG_ENABLE_DEFAULT_TRACERS is not set
982# CONFIG_EVENT_TRACER is not set
983# CONFIG_BOOT_TRACER is not set 1002# CONFIG_BOOT_TRACER is not set
984# CONFIG_TRACE_BRANCH_PROFILING is not set 1003CONFIG_BRANCH_PROFILE_NONE=y
1004# CONFIG_PROFILE_ANNOTATED_BRANCHES is not set
1005# CONFIG_PROFILE_ALL_BRANCHES is not set
985# CONFIG_STACK_TRACER is not set 1006# CONFIG_STACK_TRACER is not set
986# CONFIG_KMEMTRACE is not set 1007# CONFIG_KMEMTRACE is not set
987# CONFIG_WORKQUEUE_TRACER is not set 1008# CONFIG_WORKQUEUE_TRACER is not set
@@ -990,9 +1011,13 @@ CONFIG_TRACING_SUPPORT=y
990# CONFIG_SAMPLES is not set 1011# CONFIG_SAMPLES is not set
991CONFIG_HAVE_ARCH_KGDB=y 1012CONFIG_HAVE_ARCH_KGDB=y
992# CONFIG_KGDB is not set 1013# CONFIG_KGDB is not set
1014# CONFIG_KMEMCHECK is not set
1015# CONFIG_PPC_DISABLE_WERROR is not set
1016CONFIG_PPC_WERROR=y
993CONFIG_PRINT_STACK_DEPTH=64 1017CONFIG_PRINT_STACK_DEPTH=64
994# CONFIG_DEBUG_STACKOVERFLOW is not set 1018# CONFIG_DEBUG_STACKOVERFLOW is not set
995# CONFIG_DEBUG_STACK_USAGE is not set 1019# CONFIG_DEBUG_STACK_USAGE is not set
1020# CONFIG_PPC_EMULATED_STATS is not set
996# CONFIG_CODE_PATCHING_SELFTEST is not set 1021# CONFIG_CODE_PATCHING_SELFTEST is not set
997# CONFIG_FTR_FIXUP_SELFTEST is not set 1022# CONFIG_FTR_FIXUP_SELFTEST is not set
998# CONFIG_MSI_BITMAP_SELFTEST is not set 1023# CONFIG_MSI_BITMAP_SELFTEST is not set
diff --git a/arch/powerpc/configs/85xx/mpc8540_ads_defconfig b/arch/powerpc/configs/85xx/mpc8540_ads_defconfig
index 7b43be7586b6..fb10cc83702e 100644
--- a/arch/powerpc/configs/85xx/mpc8540_ads_defconfig
+++ b/arch/powerpc/configs/85xx/mpc8540_ads_defconfig
@@ -1,14 +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.30-rc3 3# Linux kernel version: 2.6.31-rc4
4# Wed May 13 17:22:17 2009 4# Wed Jul 29 23:32:15 2009
5# 5#
6# CONFIG_PPC64 is not set 6# CONFIG_PPC64 is not set
7 7
8# 8#
9# Processor support 9# Processor support
10# 10#
11# CONFIG_6xx is not set 11# CONFIG_PPC_BOOK3S_32 is not set
12CONFIG_PPC_85xx=y 12CONFIG_PPC_85xx=y
13# CONFIG_PPC_8xx is not set 13# CONFIG_PPC_8xx is not set
14# CONFIG_40x is not set 14# CONFIG_40x is not set
@@ -34,15 +34,16 @@ CONFIG_GENERIC_TIME=y
34CONFIG_GENERIC_TIME_VSYSCALL=y 34CONFIG_GENERIC_TIME_VSYSCALL=y
35CONFIG_GENERIC_CLOCKEVENTS=y 35CONFIG_GENERIC_CLOCKEVENTS=y
36CONFIG_GENERIC_HARDIRQS=y 36CONFIG_GENERIC_HARDIRQS=y
37CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
37# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set 38# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set
38CONFIG_IRQ_PER_CPU=y 39CONFIG_IRQ_PER_CPU=y
39CONFIG_STACKTRACE_SUPPORT=y 40CONFIG_STACKTRACE_SUPPORT=y
40CONFIG_HAVE_LATENCYTOP_SUPPORT=y 41CONFIG_HAVE_LATENCYTOP_SUPPORT=y
42CONFIG_TRACE_IRQFLAGS_SUPPORT=y
41CONFIG_LOCKDEP_SUPPORT=y 43CONFIG_LOCKDEP_SUPPORT=y
42CONFIG_RWSEM_XCHGADD_ALGORITHM=y 44CONFIG_RWSEM_XCHGADD_ALGORITHM=y
43CONFIG_ARCH_HAS_ILOG2_U32=y 45CONFIG_ARCH_HAS_ILOG2_U32=y
44CONFIG_GENERIC_HWEIGHT=y 46CONFIG_GENERIC_HWEIGHT=y
45CONFIG_GENERIC_CALIBRATE_DELAY=y
46CONFIG_GENERIC_FIND_NEXT_BIT=y 47CONFIG_GENERIC_FIND_NEXT_BIT=y
47# CONFIG_ARCH_NO_VIRT_TO_BUS is not set 48# CONFIG_ARCH_NO_VIRT_TO_BUS is not set
48CONFIG_PPC=y 49CONFIG_PPC=y
@@ -56,11 +57,13 @@ CONFIG_PPC_UDBG_16550=y
56# CONFIG_GENERIC_TBSYNC is not set 57# CONFIG_GENERIC_TBSYNC is not set
57CONFIG_AUDIT_ARCH=y 58CONFIG_AUDIT_ARCH=y
58CONFIG_GENERIC_BUG=y 59CONFIG_GENERIC_BUG=y
60CONFIG_DTC=y
59CONFIG_DEFAULT_UIMAGE=y 61CONFIG_DEFAULT_UIMAGE=y
60# CONFIG_PPC_DCR_NATIVE is not set 62# CONFIG_PPC_DCR_NATIVE is not set
61# CONFIG_PPC_DCR_MMIO is not set 63# CONFIG_PPC_DCR_MMIO is not set
62CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y 64CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y
63CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" 65CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
66CONFIG_CONSTRUCTORS=y
64 67
65# 68#
66# General setup 69# General setup
@@ -111,7 +114,6 @@ CONFIG_SYSCTL_SYSCALL=y
111CONFIG_KALLSYMS=y 114CONFIG_KALLSYMS=y
112# CONFIG_KALLSYMS_ALL is not set 115# CONFIG_KALLSYMS_ALL is not set
113# CONFIG_KALLSYMS_EXTRA_PASS is not set 116# CONFIG_KALLSYMS_EXTRA_PASS is not set
114# CONFIG_STRIP_ASM_SYMS is not set
115CONFIG_HOTPLUG=y 117CONFIG_HOTPLUG=y
116CONFIG_PRINTK=y 118CONFIG_PRINTK=y
117CONFIG_BUG=y 119CONFIG_BUG=y
@@ -124,8 +126,15 @@ CONFIG_TIMERFD=y
124CONFIG_EVENTFD=y 126CONFIG_EVENTFD=y
125CONFIG_SHMEM=y 127CONFIG_SHMEM=y
126CONFIG_AIO=y 128CONFIG_AIO=y
129CONFIG_HAVE_PERF_COUNTERS=y
130
131#
132# Performance Counters
133#
134# CONFIG_PERF_COUNTERS is not set
127CONFIG_VM_EVENT_COUNTERS=y 135CONFIG_VM_EVENT_COUNTERS=y
128CONFIG_SLUB_DEBUG=y 136CONFIG_SLUB_DEBUG=y
137# CONFIG_STRIP_ASM_SYMS is not set
129CONFIG_COMPAT_BRK=y 138CONFIG_COMPAT_BRK=y
130# CONFIG_SLAB is not set 139# CONFIG_SLAB is not set
131CONFIG_SLUB=y 140CONFIG_SLUB=y
@@ -138,6 +147,10 @@ CONFIG_HAVE_IOREMAP_PROT=y
138CONFIG_HAVE_KPROBES=y 147CONFIG_HAVE_KPROBES=y
139CONFIG_HAVE_KRETPROBES=y 148CONFIG_HAVE_KRETPROBES=y
140CONFIG_HAVE_ARCH_TRACEHOOK=y 149CONFIG_HAVE_ARCH_TRACEHOOK=y
150
151#
152# GCOV-based kernel profiling
153#
141# CONFIG_SLOW_WORK is not set 154# CONFIG_SLOW_WORK is not set
142# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set 155# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
143CONFIG_SLABINFO=y 156CONFIG_SLABINFO=y
@@ -145,7 +158,7 @@ CONFIG_RT_MUTEXES=y
145CONFIG_BASE_SMALL=0 158CONFIG_BASE_SMALL=0
146# CONFIG_MODULES is not set 159# CONFIG_MODULES is not set
147CONFIG_BLOCK=y 160CONFIG_BLOCK=y
148# CONFIG_LBD is not set 161CONFIG_LBDAF=y
149# CONFIG_BLK_DEV_BSG is not set 162# CONFIG_BLK_DEV_BSG is not set
150# CONFIG_BLK_DEV_INTEGRITY is not set 163# CONFIG_BLK_DEV_INTEGRITY is not set
151 164
@@ -178,6 +191,7 @@ CONFIG_MPC8540_ADS=y
178# CONFIG_MPC85xx_DS is not set 191# CONFIG_MPC85xx_DS is not set
179# CONFIG_SOCRATES is not set 192# CONFIG_SOCRATES is not set
180# CONFIG_KSI8560 is not set 193# CONFIG_KSI8560 is not set
194# CONFIG_XES_MPC85xx is not set
181# CONFIG_STX_GP3 is not set 195# CONFIG_STX_GP3 is not set
182# CONFIG_TQM8540 is not set 196# CONFIG_TQM8540 is not set
183# CONFIG_TQM8541 is not set 197# CONFIG_TQM8541 is not set
@@ -226,6 +240,7 @@ CONFIG_BINFMT_ELF=y
226CONFIG_BINFMT_MISC=y 240CONFIG_BINFMT_MISC=y
227CONFIG_MATH_EMULATION=y 241CONFIG_MATH_EMULATION=y
228# CONFIG_IOMMU_HELPER is not set 242# CONFIG_IOMMU_HELPER is not set
243# CONFIG_SWIOTLB is not set
229CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y 244CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
230CONFIG_ARCH_HAS_WALK_MEMORY=y 245CONFIG_ARCH_HAS_WALK_MEMORY=y
231CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y 246CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y
@@ -244,9 +259,9 @@ CONFIG_MIGRATION=y
244CONFIG_ZONE_DMA_FLAG=1 259CONFIG_ZONE_DMA_FLAG=1
245CONFIG_BOUNCE=y 260CONFIG_BOUNCE=y
246CONFIG_VIRT_TO_BUS=y 261CONFIG_VIRT_TO_BUS=y
247CONFIG_UNEVICTABLE_LRU=y
248CONFIG_HAVE_MLOCK=y 262CONFIG_HAVE_MLOCK=y
249CONFIG_HAVE_MLOCKED_PAGE_BIT=y 263CONFIG_HAVE_MLOCKED_PAGE_BIT=y
264CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
250CONFIG_PPC_4K_PAGES=y 265CONFIG_PPC_4K_PAGES=y
251# CONFIG_PPC_16K_PAGES is not set 266# CONFIG_PPC_16K_PAGES is not set
252# CONFIG_PPC_64K_PAGES is not set 267# CONFIG_PPC_64K_PAGES is not set
@@ -348,6 +363,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
348# CONFIG_ECONET is not set 363# CONFIG_ECONET is not set
349# CONFIG_WAN_ROUTER is not set 364# CONFIG_WAN_ROUTER is not set
350# CONFIG_PHONET is not set 365# CONFIG_PHONET is not set
366# CONFIG_IEEE802154 is not set
351# CONFIG_NET_SCHED is not set 367# CONFIG_NET_SCHED is not set
352# CONFIG_DCB is not set 368# CONFIG_DCB is not set
353 369
@@ -365,7 +381,11 @@ CONFIG_WIRELESS=y
365CONFIG_WIRELESS_OLD_REGULATORY=y 381CONFIG_WIRELESS_OLD_REGULATORY=y
366# CONFIG_WIRELESS_EXT is not set 382# CONFIG_WIRELESS_EXT is not set
367# CONFIG_LIB80211 is not set 383# CONFIG_LIB80211 is not set
368# CONFIG_MAC80211 is not set 384
385#
386# CFG80211 needs to be enabled for MAC80211
387#
388CONFIG_MAC80211_DEFAULT_PS_VALUE=0
369# CONFIG_WIMAX is not set 389# CONFIG_WIMAX is not set
370# CONFIG_RFKILL is not set 390# CONFIG_RFKILL is not set
371# CONFIG_NET_9P is not set 391# CONFIG_NET_9P is not set
@@ -387,6 +407,7 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y
387# CONFIG_CONNECTOR is not set 407# CONFIG_CONNECTOR is not set
388# CONFIG_MTD is not set 408# CONFIG_MTD is not set
389CONFIG_OF_DEVICE=y 409CONFIG_OF_DEVICE=y
410CONFIG_OF_MDIO=y
390# CONFIG_PARPORT is not set 411# CONFIG_PARPORT is not set
391CONFIG_BLK_DEV=y 412CONFIG_BLK_DEV=y
392# CONFIG_BLK_DEV_FD is not set 413# CONFIG_BLK_DEV_FD is not set
@@ -423,7 +444,6 @@ CONFIG_HAVE_IDE=y
423# CONFIG_MD is not set 444# CONFIG_MD is not set
424# CONFIG_MACINTOSH_DRIVERS is not set 445# CONFIG_MACINTOSH_DRIVERS is not set
425CONFIG_NETDEVICES=y 446CONFIG_NETDEVICES=y
426CONFIG_COMPAT_NET_DEV_OPS=y
427# CONFIG_DUMMY is not set 447# CONFIG_DUMMY is not set
428# CONFIG_BONDING is not set 448# CONFIG_BONDING is not set
429# CONFIG_MACVLAN is not set 449# CONFIG_MACVLAN is not set
@@ -462,9 +482,11 @@ CONFIG_MII=y
462# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set 482# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set
463# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set 483# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
464# CONFIG_B44 is not set 484# CONFIG_B44 is not set
485# CONFIG_KS8842 is not set
465CONFIG_NETDEV_1000=y 486CONFIG_NETDEV_1000=y
466CONFIG_FSL_PQ_MDIO=y 487CONFIG_FSL_PQ_MDIO=y
467CONFIG_GIANFAR=y 488CONFIG_GIANFAR=y
489# CONFIG_MV643XX_ETH is not set
468CONFIG_NETDEV_10000=y 490CONFIG_NETDEV_10000=y
469 491
470# 492#
@@ -555,6 +577,11 @@ CONFIG_GEN_RTC=y
555# CONFIG_TCG_TPM is not set 577# CONFIG_TCG_TPM is not set
556# CONFIG_I2C is not set 578# CONFIG_I2C is not set
557# CONFIG_SPI is not set 579# CONFIG_SPI is not set
580
581#
582# PPS support
583#
584# CONFIG_PPS is not set
558CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y 585CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
559# CONFIG_GPIOLIB is not set 586# CONFIG_GPIOLIB is not set
560# CONFIG_W1 is not set 587# CONFIG_W1 is not set
@@ -590,22 +617,7 @@ CONFIG_SSB_POSSIBLE=y
590# CONFIG_HTC_PASIC3 is not set 617# CONFIG_HTC_PASIC3 is not set
591# CONFIG_MFD_TMIO is not set 618# CONFIG_MFD_TMIO is not set
592# CONFIG_REGULATOR is not set 619# CONFIG_REGULATOR is not set
593 620# CONFIG_MEDIA_SUPPORT is not set
594#
595# Multimedia devices
596#
597
598#
599# Multimedia core support
600#
601# CONFIG_VIDEO_DEV is not set
602# CONFIG_DVB_CORE is not set
603# CONFIG_VIDEO_MEDIA is not set
604
605#
606# Multimedia drivers
607#
608CONFIG_DAB=y
609 621
610# 622#
611# Graphics support 623# Graphics support
@@ -657,6 +669,10 @@ CONFIG_USB_SUPPORT=y
657# CONFIG_DMADEVICES is not set 669# CONFIG_DMADEVICES is not set
658# CONFIG_AUXDISPLAY is not set 670# CONFIG_AUXDISPLAY is not set
659# CONFIG_UIO is not set 671# CONFIG_UIO is not set
672
673#
674# TI VLYNQ
675#
660# CONFIG_STAGING is not set 676# CONFIG_STAGING is not set
661 677
662# 678#
@@ -676,10 +692,12 @@ CONFIG_FS_MBCACHE=y
676# CONFIG_REISERFS_FS is not set 692# CONFIG_REISERFS_FS is not set
677# CONFIG_JFS_FS is not set 693# CONFIG_JFS_FS is not set
678# CONFIG_FS_POSIX_ACL is not set 694# CONFIG_FS_POSIX_ACL is not set
679CONFIG_FILE_LOCKING=y
680# CONFIG_XFS_FS is not set 695# CONFIG_XFS_FS is not set
696# CONFIG_GFS2_FS is not set
681# CONFIG_OCFS2_FS is not set 697# CONFIG_OCFS2_FS is not set
682# CONFIG_BTRFS_FS is not set 698# CONFIG_BTRFS_FS is not set
699CONFIG_FILE_LOCKING=y
700CONFIG_FSNOTIFY=y
683CONFIG_DNOTIFY=y 701CONFIG_DNOTIFY=y
684CONFIG_INOTIFY=y 702CONFIG_INOTIFY=y
685CONFIG_INOTIFY_USER=y 703CONFIG_INOTIFY_USER=y
@@ -794,6 +812,7 @@ CONFIG_HAS_IOPORT=y
794CONFIG_HAS_DMA=y 812CONFIG_HAS_DMA=y
795CONFIG_HAVE_LMB=y 813CONFIG_HAVE_LMB=y
796CONFIG_NLATTR=y 814CONFIG_NLATTR=y
815CONFIG_GENERIC_ATOMIC64=y
797 816
798# 817#
799# Kernel hacking 818# Kernel hacking
@@ -824,6 +843,9 @@ CONFIG_SCHED_DEBUG=y
824# CONFIG_RT_MUTEX_TESTER is not set 843# CONFIG_RT_MUTEX_TESTER is not set
825# CONFIG_DEBUG_SPINLOCK is not set 844# CONFIG_DEBUG_SPINLOCK is not set
826CONFIG_DEBUG_MUTEXES=y 845CONFIG_DEBUG_MUTEXES=y
846# CONFIG_DEBUG_LOCK_ALLOC is not set
847# CONFIG_PROVE_LOCKING is not set
848# CONFIG_LOCK_STAT is not set
827# CONFIG_DEBUG_SPINLOCK_SLEEP is not set 849# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
828# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set 850# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
829# CONFIG_DEBUG_KOBJECT is not set 851# CONFIG_DEBUG_KOBJECT is not set
@@ -835,7 +857,6 @@ CONFIG_DEBUG_MUTEXES=y
835# CONFIG_DEBUG_LIST is not set 857# CONFIG_DEBUG_LIST is not set
836# CONFIG_DEBUG_SG is not set 858# CONFIG_DEBUG_SG is not set
837# CONFIG_DEBUG_NOTIFIERS is not set 859# CONFIG_DEBUG_NOTIFIERS is not set
838# CONFIG_BOOT_PRINTK_DELAY is not set
839# CONFIG_RCU_TORTURE_TEST is not set 860# CONFIG_RCU_TORTURE_TEST is not set
840# CONFIG_RCU_CPU_STALL_DETECTOR is not set 861# CONFIG_RCU_CPU_STALL_DETECTOR is not set
841# CONFIG_BACKTRACE_SELF_TEST is not set 862# CONFIG_BACKTRACE_SELF_TEST is not set
@@ -849,16 +870,15 @@ CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
849CONFIG_HAVE_DYNAMIC_FTRACE=y 870CONFIG_HAVE_DYNAMIC_FTRACE=y
850CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y 871CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
851CONFIG_TRACING_SUPPORT=y 872CONFIG_TRACING_SUPPORT=y
852 873CONFIG_FTRACE=y
853#
854# Tracers
855#
856# CONFIG_FUNCTION_TRACER is not set 874# CONFIG_FUNCTION_TRACER is not set
875# CONFIG_IRQSOFF_TRACER is not set
857# CONFIG_SCHED_TRACER is not set 876# CONFIG_SCHED_TRACER is not set
858# CONFIG_CONTEXT_SWITCH_TRACER is not set 877# CONFIG_ENABLE_DEFAULT_TRACERS is not set
859# CONFIG_EVENT_TRACER is not set
860# CONFIG_BOOT_TRACER is not set 878# CONFIG_BOOT_TRACER is not set
861# CONFIG_TRACE_BRANCH_PROFILING is not set 879CONFIG_BRANCH_PROFILE_NONE=y
880# CONFIG_PROFILE_ANNOTATED_BRANCHES is not set
881# CONFIG_PROFILE_ALL_BRANCHES is not set
862# CONFIG_STACK_TRACER is not set 882# CONFIG_STACK_TRACER is not set
863# CONFIG_KMEMTRACE is not set 883# CONFIG_KMEMTRACE is not set
864# CONFIG_WORKQUEUE_TRACER is not set 884# CONFIG_WORKQUEUE_TRACER is not set
@@ -866,6 +886,9 @@ CONFIG_TRACING_SUPPORT=y
866# CONFIG_SAMPLES is not set 886# CONFIG_SAMPLES is not set
867CONFIG_HAVE_ARCH_KGDB=y 887CONFIG_HAVE_ARCH_KGDB=y
868# CONFIG_KGDB is not set 888# CONFIG_KGDB is not set
889# CONFIG_KMEMCHECK is not set
890# CONFIG_PPC_DISABLE_WERROR is not set
891CONFIG_PPC_WERROR=y
869CONFIG_PRINT_STACK_DEPTH=64 892CONFIG_PRINT_STACK_DEPTH=64
870# CONFIG_DEBUG_STACKOVERFLOW is not set 893# CONFIG_DEBUG_STACKOVERFLOW is not set
871# CONFIG_DEBUG_STACK_USAGE is not set 894# CONFIG_DEBUG_STACK_USAGE is not set
diff --git a/arch/powerpc/configs/85xx/mpc8560_ads_defconfig b/arch/powerpc/configs/85xx/mpc8560_ads_defconfig
index 62adb71a5d4f..5c8ce6978825 100644
--- a/arch/powerpc/configs/85xx/mpc8560_ads_defconfig
+++ b/arch/powerpc/configs/85xx/mpc8560_ads_defconfig
@@ -1,14 +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.30-rc3 3# Linux kernel version: 2.6.31-rc4
4# Wed May 13 17:22:17 2009 4# Wed Jul 29 23:32:16 2009
5# 5#
6# CONFIG_PPC64 is not set 6# CONFIG_PPC64 is not set
7 7
8# 8#
9# Processor support 9# Processor support
10# 10#
11# CONFIG_6xx is not set 11# CONFIG_PPC_BOOK3S_32 is not set
12CONFIG_PPC_85xx=y 12CONFIG_PPC_85xx=y
13# CONFIG_PPC_8xx is not set 13# CONFIG_PPC_8xx is not set
14# CONFIG_40x is not set 14# CONFIG_40x is not set
@@ -34,15 +34,16 @@ CONFIG_GENERIC_TIME=y
34CONFIG_GENERIC_TIME_VSYSCALL=y 34CONFIG_GENERIC_TIME_VSYSCALL=y
35CONFIG_GENERIC_CLOCKEVENTS=y 35CONFIG_GENERIC_CLOCKEVENTS=y
36CONFIG_GENERIC_HARDIRQS=y 36CONFIG_GENERIC_HARDIRQS=y
37CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
37# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set 38# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set
38CONFIG_IRQ_PER_CPU=y 39CONFIG_IRQ_PER_CPU=y
39CONFIG_STACKTRACE_SUPPORT=y 40CONFIG_STACKTRACE_SUPPORT=y
40CONFIG_HAVE_LATENCYTOP_SUPPORT=y 41CONFIG_HAVE_LATENCYTOP_SUPPORT=y
42CONFIG_TRACE_IRQFLAGS_SUPPORT=y
41CONFIG_LOCKDEP_SUPPORT=y 43CONFIG_LOCKDEP_SUPPORT=y
42CONFIG_RWSEM_XCHGADD_ALGORITHM=y 44CONFIG_RWSEM_XCHGADD_ALGORITHM=y
43CONFIG_ARCH_HAS_ILOG2_U32=y 45CONFIG_ARCH_HAS_ILOG2_U32=y
44CONFIG_GENERIC_HWEIGHT=y 46CONFIG_GENERIC_HWEIGHT=y
45CONFIG_GENERIC_CALIBRATE_DELAY=y
46CONFIG_GENERIC_FIND_NEXT_BIT=y 47CONFIG_GENERIC_FIND_NEXT_BIT=y
47CONFIG_GENERIC_GPIO=y 48CONFIG_GENERIC_GPIO=y
48# CONFIG_ARCH_NO_VIRT_TO_BUS is not set 49# CONFIG_ARCH_NO_VIRT_TO_BUS is not set
@@ -57,11 +58,13 @@ CONFIG_PPC_UDBG_16550=y
57# CONFIG_GENERIC_TBSYNC is not set 58# CONFIG_GENERIC_TBSYNC is not set
58CONFIG_AUDIT_ARCH=y 59CONFIG_AUDIT_ARCH=y
59CONFIG_GENERIC_BUG=y 60CONFIG_GENERIC_BUG=y
61CONFIG_DTC=y
60CONFIG_DEFAULT_UIMAGE=y 62CONFIG_DEFAULT_UIMAGE=y
61# CONFIG_PPC_DCR_NATIVE is not set 63# CONFIG_PPC_DCR_NATIVE is not set
62# CONFIG_PPC_DCR_MMIO is not set 64# CONFIG_PPC_DCR_MMIO is not set
63CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y 65CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y
64CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" 66CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
67CONFIG_CONSTRUCTORS=y
65 68
66# 69#
67# General setup 70# General setup
@@ -112,7 +115,6 @@ CONFIG_SYSCTL_SYSCALL=y
112CONFIG_KALLSYMS=y 115CONFIG_KALLSYMS=y
113# CONFIG_KALLSYMS_ALL is not set 116# CONFIG_KALLSYMS_ALL is not set
114# CONFIG_KALLSYMS_EXTRA_PASS is not set 117# CONFIG_KALLSYMS_EXTRA_PASS is not set
115# CONFIG_STRIP_ASM_SYMS is not set
116CONFIG_HOTPLUG=y 118CONFIG_HOTPLUG=y
117CONFIG_PRINTK=y 119CONFIG_PRINTK=y
118CONFIG_BUG=y 120CONFIG_BUG=y
@@ -125,9 +127,16 @@ CONFIG_TIMERFD=y
125CONFIG_EVENTFD=y 127CONFIG_EVENTFD=y
126CONFIG_SHMEM=y 128CONFIG_SHMEM=y
127CONFIG_AIO=y 129CONFIG_AIO=y
130CONFIG_HAVE_PERF_COUNTERS=y
131
132#
133# Performance Counters
134#
135# CONFIG_PERF_COUNTERS is not set
128CONFIG_VM_EVENT_COUNTERS=y 136CONFIG_VM_EVENT_COUNTERS=y
129CONFIG_PCI_QUIRKS=y 137CONFIG_PCI_QUIRKS=y
130CONFIG_SLUB_DEBUG=y 138CONFIG_SLUB_DEBUG=y
139# CONFIG_STRIP_ASM_SYMS is not set
131CONFIG_COMPAT_BRK=y 140CONFIG_COMPAT_BRK=y
132# CONFIG_SLAB is not set 141# CONFIG_SLAB is not set
133CONFIG_SLUB=y 142CONFIG_SLUB=y
@@ -141,6 +150,10 @@ CONFIG_HAVE_KPROBES=y
141CONFIG_HAVE_KRETPROBES=y 150CONFIG_HAVE_KRETPROBES=y
142CONFIG_HAVE_ARCH_TRACEHOOK=y 151CONFIG_HAVE_ARCH_TRACEHOOK=y
143CONFIG_HAVE_CLK=y 152CONFIG_HAVE_CLK=y
153
154#
155# GCOV-based kernel profiling
156#
144# CONFIG_SLOW_WORK is not set 157# CONFIG_SLOW_WORK is not set
145# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set 158# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
146CONFIG_SLABINFO=y 159CONFIG_SLABINFO=y
@@ -148,7 +161,7 @@ CONFIG_RT_MUTEXES=y
148CONFIG_BASE_SMALL=0 161CONFIG_BASE_SMALL=0
149# CONFIG_MODULES is not set 162# CONFIG_MODULES is not set
150CONFIG_BLOCK=y 163CONFIG_BLOCK=y
151# CONFIG_LBD is not set 164CONFIG_LBDAF=y
152# CONFIG_BLK_DEV_BSG is not set 165# CONFIG_BLK_DEV_BSG is not set
153# CONFIG_BLK_DEV_INTEGRITY is not set 166# CONFIG_BLK_DEV_INTEGRITY is not set
154 167
@@ -181,6 +194,7 @@ CONFIG_MPC8560_ADS=y
181# CONFIG_MPC85xx_DS is not set 194# CONFIG_MPC85xx_DS is not set
182# CONFIG_SOCRATES is not set 195# CONFIG_SOCRATES is not set
183# CONFIG_KSI8560 is not set 196# CONFIG_KSI8560 is not set
197# CONFIG_XES_MPC85xx is not set
184# CONFIG_STX_GP3 is not set 198# CONFIG_STX_GP3 is not set
185# CONFIG_TQM8540 is not set 199# CONFIG_TQM8540 is not set
186# CONFIG_TQM8541 is not set 200# CONFIG_TQM8541 is not set
@@ -229,6 +243,7 @@ CONFIG_BINFMT_ELF=y
229CONFIG_BINFMT_MISC=y 243CONFIG_BINFMT_MISC=y
230CONFIG_MATH_EMULATION=y 244CONFIG_MATH_EMULATION=y
231# CONFIG_IOMMU_HELPER is not set 245# CONFIG_IOMMU_HELPER is not set
246# CONFIG_SWIOTLB is not set
232CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y 247CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
233CONFIG_ARCH_HAS_WALK_MEMORY=y 248CONFIG_ARCH_HAS_WALK_MEMORY=y
234CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y 249CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y
@@ -247,9 +262,9 @@ CONFIG_MIGRATION=y
247CONFIG_ZONE_DMA_FLAG=1 262CONFIG_ZONE_DMA_FLAG=1
248CONFIG_BOUNCE=y 263CONFIG_BOUNCE=y
249CONFIG_VIRT_TO_BUS=y 264CONFIG_VIRT_TO_BUS=y
250CONFIG_UNEVICTABLE_LRU=y
251CONFIG_HAVE_MLOCK=y 265CONFIG_HAVE_MLOCK=y
252CONFIG_HAVE_MLOCKED_PAGE_BIT=y 266CONFIG_HAVE_MLOCKED_PAGE_BIT=y
267CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
253CONFIG_PPC_4K_PAGES=y 268CONFIG_PPC_4K_PAGES=y
254# CONFIG_PPC_16K_PAGES is not set 269# CONFIG_PPC_16K_PAGES is not set
255# CONFIG_PPC_64K_PAGES is not set 270# CONFIG_PPC_64K_PAGES is not set
@@ -360,6 +375,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
360# CONFIG_ECONET is not set 375# CONFIG_ECONET is not set
361# CONFIG_WAN_ROUTER is not set 376# CONFIG_WAN_ROUTER is not set
362# CONFIG_PHONET is not set 377# CONFIG_PHONET is not set
378# CONFIG_IEEE802154 is not set
363# CONFIG_NET_SCHED is not set 379# CONFIG_NET_SCHED is not set
364# CONFIG_DCB is not set 380# CONFIG_DCB is not set
365 381
@@ -377,7 +393,11 @@ CONFIG_WIRELESS=y
377CONFIG_WIRELESS_OLD_REGULATORY=y 393CONFIG_WIRELESS_OLD_REGULATORY=y
378# CONFIG_WIRELESS_EXT is not set 394# CONFIG_WIRELESS_EXT is not set
379# CONFIG_LIB80211 is not set 395# CONFIG_LIB80211 is not set
380# CONFIG_MAC80211 is not set 396
397#
398# CFG80211 needs to be enabled for MAC80211
399#
400CONFIG_MAC80211_DEFAULT_PS_VALUE=0
381# CONFIG_WIMAX is not set 401# CONFIG_WIMAX is not set
382# CONFIG_RFKILL is not set 402# CONFIG_RFKILL is not set
383# CONFIG_NET_9P is not set 403# CONFIG_NET_9P is not set
@@ -400,6 +420,7 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y
400# CONFIG_MTD is not set 420# CONFIG_MTD is not set
401CONFIG_OF_DEVICE=y 421CONFIG_OF_DEVICE=y
402CONFIG_OF_GPIO=y 422CONFIG_OF_GPIO=y
423CONFIG_OF_MDIO=y
403# CONFIG_PARPORT is not set 424# CONFIG_PARPORT is not set
404CONFIG_BLK_DEV=y 425CONFIG_BLK_DEV=y
405# CONFIG_BLK_DEV_FD is not set 426# CONFIG_BLK_DEV_FD is not set
@@ -431,6 +452,7 @@ CONFIG_MISC_DEVICES=y
431# EEPROM support 452# EEPROM support
432# 453#
433# CONFIG_EEPROM_93CX6 is not set 454# CONFIG_EEPROM_93CX6 is not set
455# CONFIG_CB710_CORE is not set
434CONFIG_HAVE_IDE=y 456CONFIG_HAVE_IDE=y
435# CONFIG_IDE is not set 457# CONFIG_IDE is not set
436 458
@@ -450,14 +472,17 @@ CONFIG_HAVE_IDE=y
450# 472#
451 473
452# 474#
453# Enable only one of the two stacks, unless you know what you are doing 475# You can enable one or both FireWire driver stacks.
476#
477
478#
479# See the help texts for more information.
454# 480#
455# CONFIG_FIREWIRE is not set 481# CONFIG_FIREWIRE is not set
456# CONFIG_IEEE1394 is not set 482# CONFIG_IEEE1394 is not set
457# CONFIG_I2O is not set 483# CONFIG_I2O is not set
458# CONFIG_MACINTOSH_DRIVERS is not set 484# CONFIG_MACINTOSH_DRIVERS is not set
459CONFIG_NETDEVICES=y 485CONFIG_NETDEVICES=y
460CONFIG_COMPAT_NET_DEV_OPS=y
461# CONFIG_DUMMY is not set 486# CONFIG_DUMMY is not set
462# CONFIG_BONDING is not set 487# CONFIG_BONDING is not set
463# CONFIG_MACVLAN is not set 488# CONFIG_MACVLAN is not set
@@ -504,6 +529,7 @@ CONFIG_MII=y
504# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set 529# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
505# CONFIG_NET_PCI is not set 530# CONFIG_NET_PCI is not set
506# CONFIG_B44 is not set 531# CONFIG_B44 is not set
532# CONFIG_KS8842 is not set
507# CONFIG_ATL2 is not set 533# CONFIG_ATL2 is not set
508CONFIG_FS_ENET=y 534CONFIG_FS_ENET=y
509# CONFIG_FS_ENET_HAS_SCC is not set 535# CONFIG_FS_ENET_HAS_SCC is not set
@@ -527,8 +553,10 @@ CONFIG_E1000=y
527# CONFIG_VIA_VELOCITY is not set 553# CONFIG_VIA_VELOCITY is not set
528# CONFIG_TIGON3 is not set 554# CONFIG_TIGON3 is not set
529# CONFIG_BNX2 is not set 555# CONFIG_BNX2 is not set
556# CONFIG_CNIC is not set
530CONFIG_FSL_PQ_MDIO=y 557CONFIG_FSL_PQ_MDIO=y
531CONFIG_GIANFAR=y 558CONFIG_GIANFAR=y
559# CONFIG_MV643XX_ETH is not set
532# CONFIG_QLA3XXX is not set 560# CONFIG_QLA3XXX is not set
533# CONFIG_ATL1 is not set 561# CONFIG_ATL1 is not set
534# CONFIG_ATL1E is not set 562# CONFIG_ATL1E is not set
@@ -646,6 +674,11 @@ CONFIG_GEN_RTC=y
646CONFIG_DEVPORT=y 674CONFIG_DEVPORT=y
647# CONFIG_I2C is not set 675# CONFIG_I2C is not set
648# CONFIG_SPI is not set 676# CONFIG_SPI is not set
677
678#
679# PPS support
680#
681# CONFIG_PPS is not set
649CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y 682CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
650CONFIG_ARCH_REQUIRE_GPIOLIB=y 683CONFIG_ARCH_REQUIRE_GPIOLIB=y
651CONFIG_GPIOLIB=y 684CONFIG_GPIOLIB=y
@@ -707,22 +740,7 @@ CONFIG_SSB_POSSIBLE=y
707# CONFIG_HTC_PASIC3 is not set 740# CONFIG_HTC_PASIC3 is not set
708# CONFIG_MFD_TMIO is not set 741# CONFIG_MFD_TMIO is not set
709# CONFIG_REGULATOR is not set 742# CONFIG_REGULATOR is not set
710 743# CONFIG_MEDIA_SUPPORT is not set
711#
712# Multimedia devices
713#
714
715#
716# Multimedia core support
717#
718# CONFIG_VIDEO_DEV is not set
719# CONFIG_DVB_CORE is not set
720# CONFIG_VIDEO_MEDIA is not set
721
722#
723# Multimedia drivers
724#
725CONFIG_DAB=y
726 744
727# 745#
728# Graphics support 746# Graphics support
@@ -779,6 +797,10 @@ CONFIG_USB_ARCH_HAS_EHCI=y
779# CONFIG_DMADEVICES is not set 797# CONFIG_DMADEVICES is not set
780# CONFIG_AUXDISPLAY is not set 798# CONFIG_AUXDISPLAY is not set
781# CONFIG_UIO is not set 799# CONFIG_UIO is not set
800
801#
802# TI VLYNQ
803#
782# CONFIG_STAGING is not set 804# CONFIG_STAGING is not set
783 805
784# 806#
@@ -798,10 +820,12 @@ CONFIG_FS_MBCACHE=y
798# CONFIG_REISERFS_FS is not set 820# CONFIG_REISERFS_FS is not set
799# CONFIG_JFS_FS is not set 821# CONFIG_JFS_FS is not set
800# CONFIG_FS_POSIX_ACL is not set 822# CONFIG_FS_POSIX_ACL is not set
801CONFIG_FILE_LOCKING=y
802# CONFIG_XFS_FS is not set 823# CONFIG_XFS_FS is not set
824# CONFIG_GFS2_FS is not set
803# CONFIG_OCFS2_FS is not set 825# CONFIG_OCFS2_FS is not set
804# CONFIG_BTRFS_FS is not set 826# CONFIG_BTRFS_FS is not set
827CONFIG_FILE_LOCKING=y
828CONFIG_FSNOTIFY=y
805CONFIG_DNOTIFY=y 829CONFIG_DNOTIFY=y
806CONFIG_INOTIFY=y 830CONFIG_INOTIFY=y
807CONFIG_INOTIFY_USER=y 831CONFIG_INOTIFY_USER=y
@@ -916,6 +940,7 @@ CONFIG_HAS_IOPORT=y
916CONFIG_HAS_DMA=y 940CONFIG_HAS_DMA=y
917CONFIG_HAVE_LMB=y 941CONFIG_HAVE_LMB=y
918CONFIG_NLATTR=y 942CONFIG_NLATTR=y
943CONFIG_GENERIC_ATOMIC64=y
919 944
920# 945#
921# Kernel hacking 946# Kernel hacking
@@ -946,6 +971,9 @@ CONFIG_SCHED_DEBUG=y
946# CONFIG_RT_MUTEX_TESTER is not set 971# CONFIG_RT_MUTEX_TESTER is not set
947# CONFIG_DEBUG_SPINLOCK is not set 972# CONFIG_DEBUG_SPINLOCK is not set
948CONFIG_DEBUG_MUTEXES=y 973CONFIG_DEBUG_MUTEXES=y
974# CONFIG_DEBUG_LOCK_ALLOC is not set
975# CONFIG_PROVE_LOCKING is not set
976# CONFIG_LOCK_STAT is not set
949# CONFIG_DEBUG_SPINLOCK_SLEEP is not set 977# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
950# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set 978# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
951# CONFIG_DEBUG_KOBJECT is not set 979# CONFIG_DEBUG_KOBJECT is not set
@@ -957,7 +985,6 @@ CONFIG_DEBUG_MUTEXES=y
957# CONFIG_DEBUG_LIST is not set 985# CONFIG_DEBUG_LIST is not set
958# CONFIG_DEBUG_SG is not set 986# CONFIG_DEBUG_SG is not set
959# CONFIG_DEBUG_NOTIFIERS is not set 987# CONFIG_DEBUG_NOTIFIERS is not set
960# CONFIG_BOOT_PRINTK_DELAY is not set
961# CONFIG_RCU_TORTURE_TEST is not set 988# CONFIG_RCU_TORTURE_TEST is not set
962# CONFIG_RCU_CPU_STALL_DETECTOR is not set 989# CONFIG_RCU_CPU_STALL_DETECTOR is not set
963# CONFIG_BACKTRACE_SELF_TEST is not set 990# CONFIG_BACKTRACE_SELF_TEST is not set
@@ -971,16 +998,15 @@ CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
971CONFIG_HAVE_DYNAMIC_FTRACE=y 998CONFIG_HAVE_DYNAMIC_FTRACE=y
972CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y 999CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
973CONFIG_TRACING_SUPPORT=y 1000CONFIG_TRACING_SUPPORT=y
974 1001CONFIG_FTRACE=y
975#
976# Tracers
977#
978# CONFIG_FUNCTION_TRACER is not set 1002# CONFIG_FUNCTION_TRACER is not set
1003# CONFIG_IRQSOFF_TRACER is not set
979# CONFIG_SCHED_TRACER is not set 1004# CONFIG_SCHED_TRACER is not set
980# CONFIG_CONTEXT_SWITCH_TRACER is not set 1005# CONFIG_ENABLE_DEFAULT_TRACERS is not set
981# CONFIG_EVENT_TRACER is not set
982# CONFIG_BOOT_TRACER is not set 1006# CONFIG_BOOT_TRACER is not set
983# CONFIG_TRACE_BRANCH_PROFILING is not set 1007CONFIG_BRANCH_PROFILE_NONE=y
1008# CONFIG_PROFILE_ANNOTATED_BRANCHES is not set
1009# CONFIG_PROFILE_ALL_BRANCHES is not set
984# CONFIG_STACK_TRACER is not set 1010# CONFIG_STACK_TRACER is not set
985# CONFIG_KMEMTRACE is not set 1011# CONFIG_KMEMTRACE is not set
986# CONFIG_WORKQUEUE_TRACER is not set 1012# CONFIG_WORKQUEUE_TRACER is not set
@@ -988,6 +1014,9 @@ CONFIG_TRACING_SUPPORT=y
988# CONFIG_SAMPLES is not set 1014# CONFIG_SAMPLES is not set
989CONFIG_HAVE_ARCH_KGDB=y 1015CONFIG_HAVE_ARCH_KGDB=y
990# CONFIG_KGDB is not set 1016# CONFIG_KGDB is not set
1017# CONFIG_KMEMCHECK is not set
1018# CONFIG_PPC_DISABLE_WERROR is not set
1019CONFIG_PPC_WERROR=y
991CONFIG_PRINT_STACK_DEPTH=64 1020CONFIG_PRINT_STACK_DEPTH=64
992# CONFIG_DEBUG_STACKOVERFLOW is not set 1021# CONFIG_DEBUG_STACKOVERFLOW is not set
993# CONFIG_DEBUG_STACK_USAGE is not set 1022# CONFIG_DEBUG_STACK_USAGE is not set
diff --git a/arch/powerpc/configs/85xx/mpc85xx_cds_defconfig b/arch/powerpc/configs/85xx/mpc85xx_cds_defconfig
index 41209e3a6545..158e63e8607f 100644
--- a/arch/powerpc/configs/85xx/mpc85xx_cds_defconfig
+++ b/arch/powerpc/configs/85xx/mpc85xx_cds_defconfig
@@ -1,14 +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.30-rc3 3# Linux kernel version: 2.6.31-rc4
4# Wed May 13 17:22:18 2009 4# Wed Jul 29 23:32:17 2009
5# 5#
6# CONFIG_PPC64 is not set 6# CONFIG_PPC64 is not set
7 7
8# 8#
9# Processor support 9# Processor support
10# 10#
11# CONFIG_6xx is not set 11# CONFIG_PPC_BOOK3S_32 is not set
12CONFIG_PPC_85xx=y 12CONFIG_PPC_85xx=y
13# CONFIG_PPC_8xx is not set 13# CONFIG_PPC_8xx is not set
14# CONFIG_40x is not set 14# CONFIG_40x is not set
@@ -34,15 +34,16 @@ CONFIG_GENERIC_TIME=y
34CONFIG_GENERIC_TIME_VSYSCALL=y 34CONFIG_GENERIC_TIME_VSYSCALL=y
35CONFIG_GENERIC_CLOCKEVENTS=y 35CONFIG_GENERIC_CLOCKEVENTS=y
36CONFIG_GENERIC_HARDIRQS=y 36CONFIG_GENERIC_HARDIRQS=y
37CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
37# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set 38# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set
38CONFIG_IRQ_PER_CPU=y 39CONFIG_IRQ_PER_CPU=y
39CONFIG_STACKTRACE_SUPPORT=y 40CONFIG_STACKTRACE_SUPPORT=y
40CONFIG_HAVE_LATENCYTOP_SUPPORT=y 41CONFIG_HAVE_LATENCYTOP_SUPPORT=y
42CONFIG_TRACE_IRQFLAGS_SUPPORT=y
41CONFIG_LOCKDEP_SUPPORT=y 43CONFIG_LOCKDEP_SUPPORT=y
42CONFIG_RWSEM_XCHGADD_ALGORITHM=y 44CONFIG_RWSEM_XCHGADD_ALGORITHM=y
43CONFIG_ARCH_HAS_ILOG2_U32=y 45CONFIG_ARCH_HAS_ILOG2_U32=y
44CONFIG_GENERIC_HWEIGHT=y 46CONFIG_GENERIC_HWEIGHT=y
45CONFIG_GENERIC_CALIBRATE_DELAY=y
46CONFIG_GENERIC_FIND_NEXT_BIT=y 47CONFIG_GENERIC_FIND_NEXT_BIT=y
47# CONFIG_ARCH_NO_VIRT_TO_BUS is not set 48# CONFIG_ARCH_NO_VIRT_TO_BUS is not set
48CONFIG_PPC=y 49CONFIG_PPC=y
@@ -56,11 +57,13 @@ CONFIG_PPC_UDBG_16550=y
56# CONFIG_GENERIC_TBSYNC is not set 57# CONFIG_GENERIC_TBSYNC is not set
57CONFIG_AUDIT_ARCH=y 58CONFIG_AUDIT_ARCH=y
58CONFIG_GENERIC_BUG=y 59CONFIG_GENERIC_BUG=y
60CONFIG_DTC=y
59CONFIG_DEFAULT_UIMAGE=y 61CONFIG_DEFAULT_UIMAGE=y
60# CONFIG_PPC_DCR_NATIVE is not set 62# CONFIG_PPC_DCR_NATIVE is not set
61# CONFIG_PPC_DCR_MMIO is not set 63# CONFIG_PPC_DCR_MMIO is not set
62CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y 64CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y
63CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" 65CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
66CONFIG_CONSTRUCTORS=y
64 67
65# 68#
66# General setup 69# General setup
@@ -111,7 +114,6 @@ CONFIG_SYSCTL_SYSCALL=y
111CONFIG_KALLSYMS=y 114CONFIG_KALLSYMS=y
112# CONFIG_KALLSYMS_ALL is not set 115# CONFIG_KALLSYMS_ALL is not set
113# CONFIG_KALLSYMS_EXTRA_PASS is not set 116# CONFIG_KALLSYMS_EXTRA_PASS is not set
114# CONFIG_STRIP_ASM_SYMS is not set
115CONFIG_HOTPLUG=y 117CONFIG_HOTPLUG=y
116CONFIG_PRINTK=y 118CONFIG_PRINTK=y
117CONFIG_BUG=y 119CONFIG_BUG=y
@@ -124,9 +126,16 @@ CONFIG_TIMERFD=y
124CONFIG_EVENTFD=y 126CONFIG_EVENTFD=y
125CONFIG_SHMEM=y 127CONFIG_SHMEM=y
126CONFIG_AIO=y 128CONFIG_AIO=y
129CONFIG_HAVE_PERF_COUNTERS=y
130
131#
132# Performance Counters
133#
134# CONFIG_PERF_COUNTERS is not set
127CONFIG_VM_EVENT_COUNTERS=y 135CONFIG_VM_EVENT_COUNTERS=y
128CONFIG_PCI_QUIRKS=y 136CONFIG_PCI_QUIRKS=y
129CONFIG_SLUB_DEBUG=y 137CONFIG_SLUB_DEBUG=y
138# CONFIG_STRIP_ASM_SYMS is not set
130CONFIG_COMPAT_BRK=y 139CONFIG_COMPAT_BRK=y
131# CONFIG_SLAB is not set 140# CONFIG_SLAB is not set
132CONFIG_SLUB=y 141CONFIG_SLUB=y
@@ -139,6 +148,10 @@ CONFIG_HAVE_IOREMAP_PROT=y
139CONFIG_HAVE_KPROBES=y 148CONFIG_HAVE_KPROBES=y
140CONFIG_HAVE_KRETPROBES=y 149CONFIG_HAVE_KRETPROBES=y
141CONFIG_HAVE_ARCH_TRACEHOOK=y 150CONFIG_HAVE_ARCH_TRACEHOOK=y
151
152#
153# GCOV-based kernel profiling
154#
142# CONFIG_SLOW_WORK is not set 155# CONFIG_SLOW_WORK is not set
143# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set 156# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
144CONFIG_SLABINFO=y 157CONFIG_SLABINFO=y
@@ -146,7 +159,7 @@ CONFIG_RT_MUTEXES=y
146CONFIG_BASE_SMALL=0 159CONFIG_BASE_SMALL=0
147# CONFIG_MODULES is not set 160# CONFIG_MODULES is not set
148CONFIG_BLOCK=y 161CONFIG_BLOCK=y
149# CONFIG_LBD is not set 162CONFIG_LBDAF=y
150# CONFIG_BLK_DEV_BSG is not set 163# CONFIG_BLK_DEV_BSG is not set
151# CONFIG_BLK_DEV_INTEGRITY is not set 164# CONFIG_BLK_DEV_INTEGRITY is not set
152 165
@@ -179,6 +192,7 @@ CONFIG_MPC85xx_CDS=y
179# CONFIG_MPC85xx_DS is not set 192# CONFIG_MPC85xx_DS is not set
180# CONFIG_SOCRATES is not set 193# CONFIG_SOCRATES is not set
181# CONFIG_KSI8560 is not set 194# CONFIG_KSI8560 is not set
195# CONFIG_XES_MPC85xx is not set
182# CONFIG_STX_GP3 is not set 196# CONFIG_STX_GP3 is not set
183# CONFIG_TQM8540 is not set 197# CONFIG_TQM8540 is not set
184# CONFIG_TQM8541 is not set 198# CONFIG_TQM8541 is not set
@@ -227,6 +241,7 @@ CONFIG_BINFMT_ELF=y
227CONFIG_BINFMT_MISC=y 241CONFIG_BINFMT_MISC=y
228CONFIG_MATH_EMULATION=y 242CONFIG_MATH_EMULATION=y
229# CONFIG_IOMMU_HELPER is not set 243# CONFIG_IOMMU_HELPER is not set
244# CONFIG_SWIOTLB is not set
230CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y 245CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
231CONFIG_ARCH_HAS_WALK_MEMORY=y 246CONFIG_ARCH_HAS_WALK_MEMORY=y
232CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y 247CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y
@@ -245,9 +260,9 @@ CONFIG_MIGRATION=y
245CONFIG_ZONE_DMA_FLAG=1 260CONFIG_ZONE_DMA_FLAG=1
246CONFIG_BOUNCE=y 261CONFIG_BOUNCE=y
247CONFIG_VIRT_TO_BUS=y 262CONFIG_VIRT_TO_BUS=y
248CONFIG_UNEVICTABLE_LRU=y
249CONFIG_HAVE_MLOCK=y 263CONFIG_HAVE_MLOCK=y
250CONFIG_HAVE_MLOCKED_PAGE_BIT=y 264CONFIG_HAVE_MLOCKED_PAGE_BIT=y
265CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
251CONFIG_PPC_4K_PAGES=y 266CONFIG_PPC_4K_PAGES=y
252# CONFIG_PPC_16K_PAGES is not set 267# CONFIG_PPC_16K_PAGES is not set
253# CONFIG_PPC_64K_PAGES is not set 268# CONFIG_PPC_64K_PAGES is not set
@@ -358,6 +373,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
358# CONFIG_ECONET is not set 373# CONFIG_ECONET is not set
359# CONFIG_WAN_ROUTER is not set 374# CONFIG_WAN_ROUTER is not set
360# CONFIG_PHONET is not set 375# CONFIG_PHONET is not set
376# CONFIG_IEEE802154 is not set
361# CONFIG_NET_SCHED is not set 377# CONFIG_NET_SCHED is not set
362# CONFIG_DCB is not set 378# CONFIG_DCB is not set
363 379
@@ -375,7 +391,11 @@ CONFIG_WIRELESS=y
375CONFIG_WIRELESS_OLD_REGULATORY=y 391CONFIG_WIRELESS_OLD_REGULATORY=y
376# CONFIG_WIRELESS_EXT is not set 392# CONFIG_WIRELESS_EXT is not set
377# CONFIG_LIB80211 is not set 393# CONFIG_LIB80211 is not set
378# CONFIG_MAC80211 is not set 394
395#
396# CFG80211 needs to be enabled for MAC80211
397#
398CONFIG_MAC80211_DEFAULT_PS_VALUE=0
379# CONFIG_WIMAX is not set 399# CONFIG_WIMAX is not set
380# CONFIG_RFKILL is not set 400# CONFIG_RFKILL is not set
381# CONFIG_NET_9P is not set 401# CONFIG_NET_9P is not set
@@ -397,6 +417,7 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y
397# CONFIG_CONNECTOR is not set 417# CONFIG_CONNECTOR is not set
398# CONFIG_MTD is not set 418# CONFIG_MTD is not set
399CONFIG_OF_DEVICE=y 419CONFIG_OF_DEVICE=y
420CONFIG_OF_MDIO=y
400# CONFIG_PARPORT is not set 421# CONFIG_PARPORT is not set
401CONFIG_BLK_DEV=y 422CONFIG_BLK_DEV=y
402# CONFIG_BLK_DEV_FD is not set 423# CONFIG_BLK_DEV_FD is not set
@@ -428,6 +449,7 @@ CONFIG_MISC_DEVICES=y
428# EEPROM support 449# EEPROM support
429# 450#
430# CONFIG_EEPROM_93CX6 is not set 451# CONFIG_EEPROM_93CX6 is not set
452# CONFIG_CB710_CORE is not set
431CONFIG_HAVE_IDE=y 453CONFIG_HAVE_IDE=y
432CONFIG_IDE=y 454CONFIG_IDE=y
433 455
@@ -502,14 +524,17 @@ CONFIG_BLK_DEV_IDEDMA=y
502# 524#
503 525
504# 526#
505# Enable only one of the two stacks, unless you know what you are doing 527# You can enable one or both FireWire driver stacks.
528#
529
530#
531# See the help texts for more information.
506# 532#
507# CONFIG_FIREWIRE is not set 533# CONFIG_FIREWIRE is not set
508# CONFIG_IEEE1394 is not set 534# CONFIG_IEEE1394 is not set
509# CONFIG_I2O is not set 535# CONFIG_I2O is not set
510# CONFIG_MACINTOSH_DRIVERS is not set 536# CONFIG_MACINTOSH_DRIVERS is not set
511CONFIG_NETDEVICES=y 537CONFIG_NETDEVICES=y
512CONFIG_COMPAT_NET_DEV_OPS=y
513# CONFIG_DUMMY is not set 538# CONFIG_DUMMY is not set
514# CONFIG_BONDING is not set 539# CONFIG_BONDING is not set
515# CONFIG_MACVLAN is not set 540# CONFIG_MACVLAN is not set
@@ -556,6 +581,7 @@ CONFIG_MII=y
556# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set 581# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
557# CONFIG_NET_PCI is not set 582# CONFIG_NET_PCI is not set
558# CONFIG_B44 is not set 583# CONFIG_B44 is not set
584# CONFIG_KS8842 is not set
559# CONFIG_ATL2 is not set 585# CONFIG_ATL2 is not set
560CONFIG_NETDEV_1000=y 586CONFIG_NETDEV_1000=y
561# CONFIG_ACENIC is not set 587# CONFIG_ACENIC is not set
@@ -575,8 +601,10 @@ CONFIG_E1000=y
575# CONFIG_VIA_VELOCITY is not set 601# CONFIG_VIA_VELOCITY is not set
576# CONFIG_TIGON3 is not set 602# CONFIG_TIGON3 is not set
577# CONFIG_BNX2 is not set 603# CONFIG_BNX2 is not set
604# CONFIG_CNIC is not set
578CONFIG_FSL_PQ_MDIO=y 605CONFIG_FSL_PQ_MDIO=y
579CONFIG_GIANFAR=y 606CONFIG_GIANFAR=y
607# CONFIG_MV643XX_ETH is not set
580# CONFIG_QLA3XXX is not set 608# CONFIG_QLA3XXX is not set
581# CONFIG_ATL1 is not set 609# CONFIG_ATL1 is not set
582# CONFIG_ATL1E is not set 610# CONFIG_ATL1E is not set
@@ -698,6 +726,11 @@ CONFIG_GEN_RTC=y
698CONFIG_DEVPORT=y 726CONFIG_DEVPORT=y
699# CONFIG_I2C is not set 727# CONFIG_I2C is not set
700# CONFIG_SPI is not set 728# CONFIG_SPI is not set
729
730#
731# PPS support
732#
733# CONFIG_PPS is not set
701CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y 734CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
702# CONFIG_GPIOLIB is not set 735# CONFIG_GPIOLIB is not set
703# CONFIG_W1 is not set 736# CONFIG_W1 is not set
@@ -737,22 +770,7 @@ CONFIG_SSB_POSSIBLE=y
737# CONFIG_HTC_PASIC3 is not set 770# CONFIG_HTC_PASIC3 is not set
738# CONFIG_MFD_TMIO is not set 771# CONFIG_MFD_TMIO is not set
739# CONFIG_REGULATOR is not set 772# CONFIG_REGULATOR is not set
740 773# CONFIG_MEDIA_SUPPORT is not set
741#
742# Multimedia devices
743#
744
745#
746# Multimedia core support
747#
748# CONFIG_VIDEO_DEV is not set
749# CONFIG_DVB_CORE is not set
750# CONFIG_VIDEO_MEDIA is not set
751
752#
753# Multimedia drivers
754#
755CONFIG_DAB=y
756 774
757# 775#
758# Graphics support 776# Graphics support
@@ -809,6 +827,10 @@ CONFIG_USB_ARCH_HAS_EHCI=y
809# CONFIG_DMADEVICES is not set 827# CONFIG_DMADEVICES is not set
810# CONFIG_AUXDISPLAY is not set 828# CONFIG_AUXDISPLAY is not set
811# CONFIG_UIO is not set 829# CONFIG_UIO is not set
830
831#
832# TI VLYNQ
833#
812# CONFIG_STAGING is not set 834# CONFIG_STAGING is not set
813 835
814# 836#
@@ -828,10 +850,12 @@ CONFIG_FS_MBCACHE=y
828# CONFIG_REISERFS_FS is not set 850# CONFIG_REISERFS_FS is not set
829# CONFIG_JFS_FS is not set 851# CONFIG_JFS_FS is not set
830# CONFIG_FS_POSIX_ACL is not set 852# CONFIG_FS_POSIX_ACL is not set
831CONFIG_FILE_LOCKING=y
832# CONFIG_XFS_FS is not set 853# CONFIG_XFS_FS is not set
854# CONFIG_GFS2_FS is not set
833# CONFIG_OCFS2_FS is not set 855# CONFIG_OCFS2_FS is not set
834# CONFIG_BTRFS_FS is not set 856# CONFIG_BTRFS_FS is not set
857CONFIG_FILE_LOCKING=y
858CONFIG_FSNOTIFY=y
835CONFIG_DNOTIFY=y 859CONFIG_DNOTIFY=y
836CONFIG_INOTIFY=y 860CONFIG_INOTIFY=y
837CONFIG_INOTIFY_USER=y 861CONFIG_INOTIFY_USER=y
@@ -946,6 +970,7 @@ CONFIG_HAS_IOPORT=y
946CONFIG_HAS_DMA=y 970CONFIG_HAS_DMA=y
947CONFIG_HAVE_LMB=y 971CONFIG_HAVE_LMB=y
948CONFIG_NLATTR=y 972CONFIG_NLATTR=y
973CONFIG_GENERIC_ATOMIC64=y
949 974
950# 975#
951# Kernel hacking 976# Kernel hacking
@@ -976,6 +1001,9 @@ CONFIG_SCHED_DEBUG=y
976# CONFIG_RT_MUTEX_TESTER is not set 1001# CONFIG_RT_MUTEX_TESTER is not set
977# CONFIG_DEBUG_SPINLOCK is not set 1002# CONFIG_DEBUG_SPINLOCK is not set
978CONFIG_DEBUG_MUTEXES=y 1003CONFIG_DEBUG_MUTEXES=y
1004# CONFIG_DEBUG_LOCK_ALLOC is not set
1005# CONFIG_PROVE_LOCKING is not set
1006# CONFIG_LOCK_STAT is not set
979# CONFIG_DEBUG_SPINLOCK_SLEEP is not set 1007# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
980# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set 1008# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
981# CONFIG_DEBUG_KOBJECT is not set 1009# CONFIG_DEBUG_KOBJECT is not set
@@ -987,7 +1015,6 @@ CONFIG_DEBUG_MUTEXES=y
987# CONFIG_DEBUG_LIST is not set 1015# CONFIG_DEBUG_LIST is not set
988# CONFIG_DEBUG_SG is not set 1016# CONFIG_DEBUG_SG is not set
989# CONFIG_DEBUG_NOTIFIERS is not set 1017# CONFIG_DEBUG_NOTIFIERS is not set
990# CONFIG_BOOT_PRINTK_DELAY is not set
991# CONFIG_RCU_TORTURE_TEST is not set 1018# CONFIG_RCU_TORTURE_TEST is not set
992# CONFIG_RCU_CPU_STALL_DETECTOR is not set 1019# CONFIG_RCU_CPU_STALL_DETECTOR is not set
993# CONFIG_BACKTRACE_SELF_TEST is not set 1020# CONFIG_BACKTRACE_SELF_TEST is not set
@@ -1001,16 +1028,15 @@ CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
1001CONFIG_HAVE_DYNAMIC_FTRACE=y 1028CONFIG_HAVE_DYNAMIC_FTRACE=y
1002CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y 1029CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
1003CONFIG_TRACING_SUPPORT=y 1030CONFIG_TRACING_SUPPORT=y
1004 1031CONFIG_FTRACE=y
1005#
1006# Tracers
1007#
1008# CONFIG_FUNCTION_TRACER is not set 1032# CONFIG_FUNCTION_TRACER is not set
1033# CONFIG_IRQSOFF_TRACER is not set
1009# CONFIG_SCHED_TRACER is not set 1034# CONFIG_SCHED_TRACER is not set
1010# CONFIG_CONTEXT_SWITCH_TRACER is not set 1035# CONFIG_ENABLE_DEFAULT_TRACERS is not set
1011# CONFIG_EVENT_TRACER is not set
1012# CONFIG_BOOT_TRACER is not set 1036# CONFIG_BOOT_TRACER is not set
1013# CONFIG_TRACE_BRANCH_PROFILING is not set 1037CONFIG_BRANCH_PROFILE_NONE=y
1038# CONFIG_PROFILE_ANNOTATED_BRANCHES is not set
1039# CONFIG_PROFILE_ALL_BRANCHES is not set
1014# CONFIG_STACK_TRACER is not set 1040# CONFIG_STACK_TRACER is not set
1015# CONFIG_KMEMTRACE is not set 1041# CONFIG_KMEMTRACE is not set
1016# CONFIG_WORKQUEUE_TRACER is not set 1042# CONFIG_WORKQUEUE_TRACER is not set
@@ -1018,6 +1044,9 @@ CONFIG_TRACING_SUPPORT=y
1018# CONFIG_SAMPLES is not set 1044# CONFIG_SAMPLES is not set
1019CONFIG_HAVE_ARCH_KGDB=y 1045CONFIG_HAVE_ARCH_KGDB=y
1020# CONFIG_KGDB is not set 1046# CONFIG_KGDB is not set
1047# CONFIG_KMEMCHECK is not set
1048# CONFIG_PPC_DISABLE_WERROR is not set
1049CONFIG_PPC_WERROR=y
1021CONFIG_PRINT_STACK_DEPTH=64 1050CONFIG_PRINT_STACK_DEPTH=64
1022# CONFIG_DEBUG_STACKOVERFLOW is not set 1051# CONFIG_DEBUG_STACKOVERFLOW is not set
1023# CONFIG_DEBUG_STACK_USAGE is not set 1052# CONFIG_DEBUG_STACK_USAGE is not set
diff --git a/arch/powerpc/configs/85xx/sbc8548_defconfig b/arch/powerpc/configs/85xx/sbc8548_defconfig
index 6c36c9c7abfd..2726fca1d694 100644
--- a/arch/powerpc/configs/85xx/sbc8548_defconfig
+++ b/arch/powerpc/configs/85xx/sbc8548_defconfig
@@ -1,14 +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.30-rc3 3# Linux kernel version: 2.6.31-rc4
4# Wed May 13 17:22:19 2009 4# Wed Jul 29 23:32:18 2009
5# 5#
6# CONFIG_PPC64 is not set 6# CONFIG_PPC64 is not set
7 7
8# 8#
9# Processor support 9# Processor support
10# 10#
11# CONFIG_6xx is not set 11# CONFIG_PPC_BOOK3S_32 is not set
12CONFIG_PPC_85xx=y 12CONFIG_PPC_85xx=y
13# CONFIG_PPC_8xx is not set 13# CONFIG_PPC_8xx is not set
14# CONFIG_40x is not set 14# CONFIG_40x is not set
@@ -34,15 +34,16 @@ CONFIG_GENERIC_TIME=y
34CONFIG_GENERIC_TIME_VSYSCALL=y 34CONFIG_GENERIC_TIME_VSYSCALL=y
35CONFIG_GENERIC_CLOCKEVENTS=y 35CONFIG_GENERIC_CLOCKEVENTS=y
36CONFIG_GENERIC_HARDIRQS=y 36CONFIG_GENERIC_HARDIRQS=y
37CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
37# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set 38# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set
38CONFIG_IRQ_PER_CPU=y 39CONFIG_IRQ_PER_CPU=y
39CONFIG_STACKTRACE_SUPPORT=y 40CONFIG_STACKTRACE_SUPPORT=y
40CONFIG_HAVE_LATENCYTOP_SUPPORT=y 41CONFIG_HAVE_LATENCYTOP_SUPPORT=y
42CONFIG_TRACE_IRQFLAGS_SUPPORT=y
41CONFIG_LOCKDEP_SUPPORT=y 43CONFIG_LOCKDEP_SUPPORT=y
42CONFIG_RWSEM_XCHGADD_ALGORITHM=y 44CONFIG_RWSEM_XCHGADD_ALGORITHM=y
43CONFIG_ARCH_HAS_ILOG2_U32=y 45CONFIG_ARCH_HAS_ILOG2_U32=y
44CONFIG_GENERIC_HWEIGHT=y 46CONFIG_GENERIC_HWEIGHT=y
45CONFIG_GENERIC_CALIBRATE_DELAY=y
46CONFIG_GENERIC_FIND_NEXT_BIT=y 47CONFIG_GENERIC_FIND_NEXT_BIT=y
47# CONFIG_ARCH_NO_VIRT_TO_BUS is not set 48# CONFIG_ARCH_NO_VIRT_TO_BUS is not set
48CONFIG_PPC=y 49CONFIG_PPC=y
@@ -56,11 +57,13 @@ CONFIG_PPC_UDBG_16550=y
56# CONFIG_GENERIC_TBSYNC is not set 57# CONFIG_GENERIC_TBSYNC is not set
57CONFIG_AUDIT_ARCH=y 58CONFIG_AUDIT_ARCH=y
58CONFIG_GENERIC_BUG=y 59CONFIG_GENERIC_BUG=y
60CONFIG_DTC=y
59CONFIG_DEFAULT_UIMAGE=y 61CONFIG_DEFAULT_UIMAGE=y
60# CONFIG_PPC_DCR_NATIVE is not set 62# CONFIG_PPC_DCR_NATIVE is not set
61# CONFIG_PPC_DCR_MMIO is not set 63# CONFIG_PPC_DCR_MMIO is not set
62CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y 64CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y
63CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" 65CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
66CONFIG_CONSTRUCTORS=y
64 67
65# 68#
66# General setup 69# General setup
@@ -110,7 +113,6 @@ CONFIG_EMBEDDED=y
110CONFIG_SYSCTL_SYSCALL=y 113CONFIG_SYSCTL_SYSCALL=y
111CONFIG_KALLSYMS=y 114CONFIG_KALLSYMS=y
112# CONFIG_KALLSYMS_EXTRA_PASS is not set 115# CONFIG_KALLSYMS_EXTRA_PASS is not set
113# CONFIG_STRIP_ASM_SYMS is not set
114CONFIG_HOTPLUG=y 116CONFIG_HOTPLUG=y
115CONFIG_PRINTK=y 117CONFIG_PRINTK=y
116CONFIG_BUG=y 118CONFIG_BUG=y
@@ -123,8 +125,15 @@ CONFIG_TIMERFD=y
123CONFIG_EVENTFD=y 125CONFIG_EVENTFD=y
124CONFIG_SHMEM=y 126CONFIG_SHMEM=y
125CONFIG_AIO=y 127CONFIG_AIO=y
128CONFIG_HAVE_PERF_COUNTERS=y
129
130#
131# Performance Counters
132#
133# CONFIG_PERF_COUNTERS is not set
126CONFIG_VM_EVENT_COUNTERS=y 134CONFIG_VM_EVENT_COUNTERS=y
127CONFIG_PCI_QUIRKS=y 135CONFIG_PCI_QUIRKS=y
136# CONFIG_STRIP_ASM_SYMS is not set
128CONFIG_COMPAT_BRK=y 137CONFIG_COMPAT_BRK=y
129CONFIG_SLAB=y 138CONFIG_SLAB=y
130# CONFIG_SLUB is not set 139# CONFIG_SLUB is not set
@@ -137,6 +146,10 @@ CONFIG_HAVE_IOREMAP_PROT=y
137CONFIG_HAVE_KPROBES=y 146CONFIG_HAVE_KPROBES=y
138CONFIG_HAVE_KRETPROBES=y 147CONFIG_HAVE_KRETPROBES=y
139CONFIG_HAVE_ARCH_TRACEHOOK=y 148CONFIG_HAVE_ARCH_TRACEHOOK=y
149
150#
151# GCOV-based kernel profiling
152#
140# CONFIG_SLOW_WORK is not set 153# CONFIG_SLOW_WORK is not set
141# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set 154# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
142CONFIG_SLABINFO=y 155CONFIG_SLABINFO=y
@@ -144,7 +157,7 @@ CONFIG_RT_MUTEXES=y
144CONFIG_BASE_SMALL=0 157CONFIG_BASE_SMALL=0
145# CONFIG_MODULES is not set 158# CONFIG_MODULES is not set
146CONFIG_BLOCK=y 159CONFIG_BLOCK=y
147# CONFIG_LBD is not set 160CONFIG_LBDAF=y
148# CONFIG_BLK_DEV_BSG is not set 161# CONFIG_BLK_DEV_BSG is not set
149# CONFIG_BLK_DEV_INTEGRITY is not set 162# CONFIG_BLK_DEV_INTEGRITY is not set
150 163
@@ -177,6 +190,7 @@ CONFIG_MPC85xx=y
177# CONFIG_MPC85xx_DS is not set 190# CONFIG_MPC85xx_DS is not set
178# CONFIG_SOCRATES is not set 191# CONFIG_SOCRATES is not set
179# CONFIG_KSI8560 is not set 192# CONFIG_KSI8560 is not set
193# CONFIG_XES_MPC85xx is not set
180# CONFIG_STX_GP3 is not set 194# CONFIG_STX_GP3 is not set
181# CONFIG_TQM8540 is not set 195# CONFIG_TQM8540 is not set
182# CONFIG_TQM8541 is not set 196# CONFIG_TQM8541 is not set
@@ -224,6 +238,7 @@ CONFIG_BINFMT_ELF=y
224CONFIG_BINFMT_MISC=y 238CONFIG_BINFMT_MISC=y
225CONFIG_MATH_EMULATION=y 239CONFIG_MATH_EMULATION=y
226# CONFIG_IOMMU_HELPER is not set 240# CONFIG_IOMMU_HELPER is not set
241# CONFIG_SWIOTLB is not set
227CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y 242CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
228CONFIG_ARCH_HAS_WALK_MEMORY=y 243CONFIG_ARCH_HAS_WALK_MEMORY=y
229CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y 244CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y
@@ -242,9 +257,9 @@ CONFIG_MIGRATION=y
242CONFIG_ZONE_DMA_FLAG=1 257CONFIG_ZONE_DMA_FLAG=1
243CONFIG_BOUNCE=y 258CONFIG_BOUNCE=y
244CONFIG_VIRT_TO_BUS=y 259CONFIG_VIRT_TO_BUS=y
245CONFIG_UNEVICTABLE_LRU=y
246CONFIG_HAVE_MLOCK=y 260CONFIG_HAVE_MLOCK=y
247CONFIG_HAVE_MLOCKED_PAGE_BIT=y 261CONFIG_HAVE_MLOCKED_PAGE_BIT=y
262CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
248CONFIG_PPC_4K_PAGES=y 263CONFIG_PPC_4K_PAGES=y
249# CONFIG_PPC_16K_PAGES is not set 264# CONFIG_PPC_16K_PAGES is not set
250# CONFIG_PPC_64K_PAGES is not set 265# CONFIG_PPC_64K_PAGES is not set
@@ -354,6 +369,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
354# CONFIG_ECONET is not set 369# CONFIG_ECONET is not set
355# CONFIG_WAN_ROUTER is not set 370# CONFIG_WAN_ROUTER is not set
356# CONFIG_PHONET is not set 371# CONFIG_PHONET is not set
372# CONFIG_IEEE802154 is not set
357# CONFIG_NET_SCHED is not set 373# CONFIG_NET_SCHED is not set
358# CONFIG_DCB is not set 374# CONFIG_DCB is not set
359 375
@@ -371,7 +387,11 @@ CONFIG_WIRELESS=y
371CONFIG_WIRELESS_OLD_REGULATORY=y 387CONFIG_WIRELESS_OLD_REGULATORY=y
372# CONFIG_WIRELESS_EXT is not set 388# CONFIG_WIRELESS_EXT is not set
373# CONFIG_LIB80211 is not set 389# CONFIG_LIB80211 is not set
374# CONFIG_MAC80211 is not set 390
391#
392# CFG80211 needs to be enabled for MAC80211
393#
394CONFIG_MAC80211_DEFAULT_PS_VALUE=0
375# CONFIG_WIMAX is not set 395# CONFIG_WIMAX is not set
376# CONFIG_RFKILL is not set 396# CONFIG_RFKILL is not set
377# CONFIG_NET_9P is not set 397# CONFIG_NET_9P is not set
@@ -391,6 +411,7 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y
391# CONFIG_CONNECTOR is not set 411# CONFIG_CONNECTOR is not set
392# CONFIG_MTD is not set 412# CONFIG_MTD is not set
393CONFIG_OF_DEVICE=y 413CONFIG_OF_DEVICE=y
414CONFIG_OF_MDIO=y
394# CONFIG_PARPORT is not set 415# CONFIG_PARPORT is not set
395CONFIG_BLK_DEV=y 416CONFIG_BLK_DEV=y
396# CONFIG_BLK_DEV_FD is not set 417# CONFIG_BLK_DEV_FD is not set
@@ -422,6 +443,7 @@ CONFIG_MISC_DEVICES=y
422# EEPROM support 443# EEPROM support
423# 444#
424# CONFIG_EEPROM_93CX6 is not set 445# CONFIG_EEPROM_93CX6 is not set
446# CONFIG_CB710_CORE is not set
425CONFIG_HAVE_IDE=y 447CONFIG_HAVE_IDE=y
426# CONFIG_IDE is not set 448# CONFIG_IDE is not set
427 449
@@ -441,14 +463,17 @@ CONFIG_HAVE_IDE=y
441# 463#
442 464
443# 465#
444# Enable only one of the two stacks, unless you know what you are doing 466# You can enable one or both FireWire driver stacks.
467#
468
469#
470# See the help texts for more information.
445# 471#
446# CONFIG_FIREWIRE is not set 472# CONFIG_FIREWIRE is not set
447# CONFIG_IEEE1394 is not set 473# CONFIG_IEEE1394 is not set
448# CONFIG_I2O is not set 474# CONFIG_I2O is not set
449# CONFIG_MACINTOSH_DRIVERS is not set 475# CONFIG_MACINTOSH_DRIVERS is not set
450CONFIG_NETDEVICES=y 476CONFIG_NETDEVICES=y
451CONFIG_COMPAT_NET_DEV_OPS=y
452# CONFIG_DUMMY is not set 477# CONFIG_DUMMY is not set
453# CONFIG_BONDING is not set 478# CONFIG_BONDING is not set
454# CONFIG_MACVLAN is not set 479# CONFIG_MACVLAN is not set
@@ -495,6 +520,7 @@ CONFIG_MII=y
495# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set 520# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
496# CONFIG_NET_PCI is not set 521# CONFIG_NET_PCI is not set
497# CONFIG_B44 is not set 522# CONFIG_B44 is not set
523# CONFIG_KS8842 is not set
498# CONFIG_ATL2 is not set 524# CONFIG_ATL2 is not set
499CONFIG_NETDEV_1000=y 525CONFIG_NETDEV_1000=y
500# CONFIG_ACENIC is not set 526# CONFIG_ACENIC is not set
@@ -514,8 +540,10 @@ CONFIG_NETDEV_1000=y
514# CONFIG_VIA_VELOCITY is not set 540# CONFIG_VIA_VELOCITY is not set
515# CONFIG_TIGON3 is not set 541# CONFIG_TIGON3 is not set
516# CONFIG_BNX2 is not set 542# CONFIG_BNX2 is not set
543# CONFIG_CNIC is not set
517CONFIG_FSL_PQ_MDIO=y 544CONFIG_FSL_PQ_MDIO=y
518CONFIG_GIANFAR=y 545CONFIG_GIANFAR=y
546# CONFIG_MV643XX_ETH is not set
519# CONFIG_QLA3XXX is not set 547# CONFIG_QLA3XXX is not set
520# CONFIG_ATL1 is not set 548# CONFIG_ATL1 is not set
521# CONFIG_ATL1E is not set 549# CONFIG_ATL1E is not set
@@ -637,6 +665,11 @@ CONFIG_GEN_RTC=y
637CONFIG_DEVPORT=y 665CONFIG_DEVPORT=y
638# CONFIG_I2C is not set 666# CONFIG_I2C is not set
639# CONFIG_SPI is not set 667# CONFIG_SPI is not set
668
669#
670# PPS support
671#
672# CONFIG_PPS is not set
640CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y 673CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
641# CONFIG_GPIOLIB is not set 674# CONFIG_GPIOLIB is not set
642# CONFIG_W1 is not set 675# CONFIG_W1 is not set
@@ -676,22 +709,7 @@ CONFIG_SSB_POSSIBLE=y
676# CONFIG_HTC_PASIC3 is not set 709# CONFIG_HTC_PASIC3 is not set
677# CONFIG_MFD_TMIO is not set 710# CONFIG_MFD_TMIO is not set
678# CONFIG_REGULATOR is not set 711# CONFIG_REGULATOR is not set
679 712# CONFIG_MEDIA_SUPPORT is not set
680#
681# Multimedia devices
682#
683
684#
685# Multimedia core support
686#
687# CONFIG_VIDEO_DEV is not set
688# CONFIG_DVB_CORE is not set
689# CONFIG_VIDEO_MEDIA is not set
690
691#
692# Multimedia drivers
693#
694CONFIG_DAB=y
695 713
696# 714#
697# Graphics support 715# Graphics support
@@ -721,6 +739,10 @@ CONFIG_VIDEO_OUTPUT_CONTROL=y
721# CONFIG_DMADEVICES is not set 739# CONFIG_DMADEVICES is not set
722# CONFIG_AUXDISPLAY is not set 740# CONFIG_AUXDISPLAY is not set
723# CONFIG_UIO is not set 741# CONFIG_UIO is not set
742
743#
744# TI VLYNQ
745#
724# CONFIG_STAGING is not set 746# CONFIG_STAGING is not set
725 747
726# 748#
@@ -732,10 +754,12 @@ CONFIG_VIDEO_OUTPUT_CONTROL=y
732# CONFIG_REISERFS_FS is not set 754# CONFIG_REISERFS_FS is not set
733# CONFIG_JFS_FS is not set 755# CONFIG_JFS_FS is not set
734# CONFIG_FS_POSIX_ACL is not set 756# CONFIG_FS_POSIX_ACL is not set
735CONFIG_FILE_LOCKING=y
736# CONFIG_XFS_FS is not set 757# CONFIG_XFS_FS is not set
758# CONFIG_GFS2_FS is not set
737# CONFIG_OCFS2_FS is not set 759# CONFIG_OCFS2_FS is not set
738# CONFIG_BTRFS_FS is not set 760# CONFIG_BTRFS_FS is not set
761CONFIG_FILE_LOCKING=y
762CONFIG_FSNOTIFY=y
739CONFIG_DNOTIFY=y 763CONFIG_DNOTIFY=y
740CONFIG_INOTIFY=y 764CONFIG_INOTIFY=y
741CONFIG_INOTIFY_USER=y 765CONFIG_INOTIFY_USER=y
@@ -838,6 +862,7 @@ CONFIG_HAS_IOPORT=y
838CONFIG_HAS_DMA=y 862CONFIG_HAS_DMA=y
839CONFIG_HAVE_LMB=y 863CONFIG_HAVE_LMB=y
840CONFIG_NLATTR=y 864CONFIG_NLATTR=y
865CONFIG_GENERIC_ATOMIC64=y
841 866
842# 867#
843# Kernel hacking 868# Kernel hacking
@@ -861,22 +886,11 @@ CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
861CONFIG_HAVE_DYNAMIC_FTRACE=y 886CONFIG_HAVE_DYNAMIC_FTRACE=y
862CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y 887CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
863CONFIG_TRACING_SUPPORT=y 888CONFIG_TRACING_SUPPORT=y
864 889# CONFIG_FTRACE is not set
865#
866# Tracers
867#
868# CONFIG_FUNCTION_TRACER is not set
869# CONFIG_SCHED_TRACER is not set
870# CONFIG_CONTEXT_SWITCH_TRACER is not set
871# CONFIG_EVENT_TRACER is not set
872# CONFIG_BOOT_TRACER is not set
873# CONFIG_TRACE_BRANCH_PROFILING is not set
874# CONFIG_STACK_TRACER is not set
875# CONFIG_KMEMTRACE is not set
876# CONFIG_WORKQUEUE_TRACER is not set
877# CONFIG_BLK_DEV_IO_TRACE is not set
878# CONFIG_SAMPLES is not set 890# CONFIG_SAMPLES is not set
879CONFIG_HAVE_ARCH_KGDB=y 891CONFIG_HAVE_ARCH_KGDB=y
892# CONFIG_PPC_DISABLE_WERROR is not set
893CONFIG_PPC_WERROR=y
880CONFIG_PRINT_STACK_DEPTH=64 894CONFIG_PRINT_STACK_DEPTH=64
881# CONFIG_IRQSTACKS is not set 895# CONFIG_IRQSTACKS is not set
882# CONFIG_PPC_EARLY_DEBUG is not set 896# CONFIG_PPC_EARLY_DEBUG is not set
diff --git a/arch/powerpc/configs/85xx/sbc8560_defconfig b/arch/powerpc/configs/85xx/sbc8560_defconfig
index 4aaf1a6bdc7d..b0c469823b02 100644
--- a/arch/powerpc/configs/85xx/sbc8560_defconfig
+++ b/arch/powerpc/configs/85xx/sbc8560_defconfig
@@ -1,14 +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.30-rc3 3# Linux kernel version: 2.6.31-rc4
4# Wed May 13 17:22:20 2009 4# Wed Jul 29 23:32:19 2009
5# 5#
6# CONFIG_PPC64 is not set 6# CONFIG_PPC64 is not set
7 7
8# 8#
9# Processor support 9# Processor support
10# 10#
11# CONFIG_6xx is not set 11# CONFIG_PPC_BOOK3S_32 is not set
12CONFIG_PPC_85xx=y 12CONFIG_PPC_85xx=y
13# CONFIG_PPC_8xx is not set 13# CONFIG_PPC_8xx is not set
14# CONFIG_40x is not set 14# CONFIG_40x is not set
@@ -34,15 +34,16 @@ CONFIG_GENERIC_TIME=y
34CONFIG_GENERIC_TIME_VSYSCALL=y 34CONFIG_GENERIC_TIME_VSYSCALL=y
35CONFIG_GENERIC_CLOCKEVENTS=y 35CONFIG_GENERIC_CLOCKEVENTS=y
36CONFIG_GENERIC_HARDIRQS=y 36CONFIG_GENERIC_HARDIRQS=y
37CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
37# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set 38# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set
38CONFIG_IRQ_PER_CPU=y 39CONFIG_IRQ_PER_CPU=y
39CONFIG_STACKTRACE_SUPPORT=y 40CONFIG_STACKTRACE_SUPPORT=y
40CONFIG_HAVE_LATENCYTOP_SUPPORT=y 41CONFIG_HAVE_LATENCYTOP_SUPPORT=y
42CONFIG_TRACE_IRQFLAGS_SUPPORT=y
41CONFIG_LOCKDEP_SUPPORT=y 43CONFIG_LOCKDEP_SUPPORT=y
42CONFIG_RWSEM_XCHGADD_ALGORITHM=y 44CONFIG_RWSEM_XCHGADD_ALGORITHM=y
43CONFIG_ARCH_HAS_ILOG2_U32=y 45CONFIG_ARCH_HAS_ILOG2_U32=y
44CONFIG_GENERIC_HWEIGHT=y 46CONFIG_GENERIC_HWEIGHT=y
45CONFIG_GENERIC_CALIBRATE_DELAY=y
46CONFIG_GENERIC_FIND_NEXT_BIT=y 47CONFIG_GENERIC_FIND_NEXT_BIT=y
47# CONFIG_ARCH_NO_VIRT_TO_BUS is not set 48# CONFIG_ARCH_NO_VIRT_TO_BUS is not set
48CONFIG_PPC=y 49CONFIG_PPC=y
@@ -56,11 +57,13 @@ CONFIG_PPC_UDBG_16550=y
56# CONFIG_GENERIC_TBSYNC is not set 57# CONFIG_GENERIC_TBSYNC is not set
57CONFIG_AUDIT_ARCH=y 58CONFIG_AUDIT_ARCH=y
58CONFIG_GENERIC_BUG=y 59CONFIG_GENERIC_BUG=y
60CONFIG_DTC=y
59CONFIG_DEFAULT_UIMAGE=y 61CONFIG_DEFAULT_UIMAGE=y
60# CONFIG_PPC_DCR_NATIVE is not set 62# CONFIG_PPC_DCR_NATIVE is not set
61# CONFIG_PPC_DCR_MMIO is not set 63# CONFIG_PPC_DCR_MMIO is not set
62CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y 64CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y
63CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" 65CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
66CONFIG_CONSTRUCTORS=y
64 67
65# 68#
66# General setup 69# General setup
@@ -111,7 +114,6 @@ CONFIG_SYSCTL_SYSCALL=y
111CONFIG_KALLSYMS=y 114CONFIG_KALLSYMS=y
112# CONFIG_KALLSYMS_ALL is not set 115# CONFIG_KALLSYMS_ALL is not set
113# CONFIG_KALLSYMS_EXTRA_PASS is not set 116# CONFIG_KALLSYMS_EXTRA_PASS is not set
114# CONFIG_STRIP_ASM_SYMS is not set
115CONFIG_HOTPLUG=y 117CONFIG_HOTPLUG=y
116CONFIG_PRINTK=y 118CONFIG_PRINTK=y
117CONFIG_BUG=y 119CONFIG_BUG=y
@@ -124,7 +126,14 @@ CONFIG_TIMERFD=y
124CONFIG_EVENTFD=y 126CONFIG_EVENTFD=y
125CONFIG_SHMEM=y 127CONFIG_SHMEM=y
126CONFIG_AIO=y 128CONFIG_AIO=y
129CONFIG_HAVE_PERF_COUNTERS=y
130
131#
132# Performance Counters
133#
134# CONFIG_PERF_COUNTERS is not set
127CONFIG_VM_EVENT_COUNTERS=y 135CONFIG_VM_EVENT_COUNTERS=y
136# CONFIG_STRIP_ASM_SYMS is not set
128CONFIG_COMPAT_BRK=y 137CONFIG_COMPAT_BRK=y
129CONFIG_SLAB=y 138CONFIG_SLAB=y
130# CONFIG_SLUB is not set 139# CONFIG_SLUB is not set
@@ -137,6 +146,10 @@ CONFIG_HAVE_IOREMAP_PROT=y
137CONFIG_HAVE_KPROBES=y 146CONFIG_HAVE_KPROBES=y
138CONFIG_HAVE_KRETPROBES=y 147CONFIG_HAVE_KRETPROBES=y
139CONFIG_HAVE_ARCH_TRACEHOOK=y 148CONFIG_HAVE_ARCH_TRACEHOOK=y
149
150#
151# GCOV-based kernel profiling
152#
140# CONFIG_SLOW_WORK is not set 153# CONFIG_SLOW_WORK is not set
141# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set 154# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
142CONFIG_SLABINFO=y 155CONFIG_SLABINFO=y
@@ -144,7 +157,7 @@ CONFIG_RT_MUTEXES=y
144CONFIG_BASE_SMALL=0 157CONFIG_BASE_SMALL=0
145# CONFIG_MODULES is not set 158# CONFIG_MODULES is not set
146CONFIG_BLOCK=y 159CONFIG_BLOCK=y
147# CONFIG_LBD is not set 160CONFIG_LBDAF=y
148# CONFIG_BLK_DEV_BSG is not set 161# CONFIG_BLK_DEV_BSG is not set
149# CONFIG_BLK_DEV_INTEGRITY is not set 162# CONFIG_BLK_DEV_INTEGRITY is not set
150 163
@@ -177,6 +190,7 @@ CONFIG_MPC85xx=y
177# CONFIG_MPC85xx_DS is not set 190# CONFIG_MPC85xx_DS is not set
178# CONFIG_SOCRATES is not set 191# CONFIG_SOCRATES is not set
179# CONFIG_KSI8560 is not set 192# CONFIG_KSI8560 is not set
193# CONFIG_XES_MPC85xx is not set
180# CONFIG_STX_GP3 is not set 194# CONFIG_STX_GP3 is not set
181# CONFIG_TQM8540 is not set 195# CONFIG_TQM8540 is not set
182# CONFIG_TQM8541 is not set 196# CONFIG_TQM8541 is not set
@@ -224,6 +238,7 @@ CONFIG_BINFMT_ELF=y
224CONFIG_BINFMT_MISC=y 238CONFIG_BINFMT_MISC=y
225# CONFIG_MATH_EMULATION is not set 239# CONFIG_MATH_EMULATION is not set
226# CONFIG_IOMMU_HELPER is not set 240# CONFIG_IOMMU_HELPER is not set
241# CONFIG_SWIOTLB is not set
227CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y 242CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
228CONFIG_ARCH_HAS_WALK_MEMORY=y 243CONFIG_ARCH_HAS_WALK_MEMORY=y
229CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y 244CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y
@@ -242,9 +257,9 @@ CONFIG_MIGRATION=y
242CONFIG_ZONE_DMA_FLAG=1 257CONFIG_ZONE_DMA_FLAG=1
243CONFIG_BOUNCE=y 258CONFIG_BOUNCE=y
244CONFIG_VIRT_TO_BUS=y 259CONFIG_VIRT_TO_BUS=y
245CONFIG_UNEVICTABLE_LRU=y
246CONFIG_HAVE_MLOCK=y 260CONFIG_HAVE_MLOCK=y
247CONFIG_HAVE_MLOCKED_PAGE_BIT=y 261CONFIG_HAVE_MLOCKED_PAGE_BIT=y
262CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
248CONFIG_PPC_4K_PAGES=y 263CONFIG_PPC_4K_PAGES=y
249# CONFIG_PPC_16K_PAGES is not set 264# CONFIG_PPC_16K_PAGES is not set
250# CONFIG_PPC_64K_PAGES is not set 265# CONFIG_PPC_64K_PAGES is not set
@@ -346,6 +361,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
346# CONFIG_ECONET is not set 361# CONFIG_ECONET is not set
347# CONFIG_WAN_ROUTER is not set 362# CONFIG_WAN_ROUTER is not set
348# CONFIG_PHONET is not set 363# CONFIG_PHONET is not set
364# CONFIG_IEEE802154 is not set
349# CONFIG_NET_SCHED is not set 365# CONFIG_NET_SCHED is not set
350# CONFIG_DCB is not set 366# CONFIG_DCB is not set
351 367
@@ -363,7 +379,11 @@ CONFIG_WIRELESS=y
363CONFIG_WIRELESS_OLD_REGULATORY=y 379CONFIG_WIRELESS_OLD_REGULATORY=y
364# CONFIG_WIRELESS_EXT is not set 380# CONFIG_WIRELESS_EXT is not set
365# CONFIG_LIB80211 is not set 381# CONFIG_LIB80211 is not set
366# CONFIG_MAC80211 is not set 382
383#
384# CFG80211 needs to be enabled for MAC80211
385#
386CONFIG_MAC80211_DEFAULT_PS_VALUE=0
367# CONFIG_WIMAX is not set 387# CONFIG_WIMAX is not set
368# CONFIG_RFKILL is not set 388# CONFIG_RFKILL is not set
369# CONFIG_NET_9P is not set 389# CONFIG_NET_9P is not set
@@ -385,6 +405,7 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y
385# CONFIG_CONNECTOR is not set 405# CONFIG_CONNECTOR is not set
386# CONFIG_MTD is not set 406# CONFIG_MTD is not set
387CONFIG_OF_DEVICE=y 407CONFIG_OF_DEVICE=y
408CONFIG_OF_MDIO=y
388# CONFIG_PARPORT is not set 409# CONFIG_PARPORT is not set
389CONFIG_BLK_DEV=y 410CONFIG_BLK_DEV=y
390# CONFIG_BLK_DEV_FD is not set 411# CONFIG_BLK_DEV_FD is not set
@@ -421,7 +442,6 @@ CONFIG_HAVE_IDE=y
421# CONFIG_MD is not set 442# CONFIG_MD is not set
422# CONFIG_MACINTOSH_DRIVERS is not set 443# CONFIG_MACINTOSH_DRIVERS is not set
423CONFIG_NETDEVICES=y 444CONFIG_NETDEVICES=y
424CONFIG_COMPAT_NET_DEV_OPS=y
425# CONFIG_DUMMY is not set 445# CONFIG_DUMMY is not set
426# CONFIG_BONDING is not set 446# CONFIG_BONDING is not set
427# CONFIG_MACVLAN is not set 447# CONFIG_MACVLAN is not set
@@ -460,9 +480,11 @@ CONFIG_MII=y
460# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set 480# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set
461# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set 481# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
462# CONFIG_B44 is not set 482# CONFIG_B44 is not set
483# CONFIG_KS8842 is not set
463CONFIG_NETDEV_1000=y 484CONFIG_NETDEV_1000=y
464CONFIG_FSL_PQ_MDIO=y 485CONFIG_FSL_PQ_MDIO=y
465CONFIG_GIANFAR=y 486CONFIG_GIANFAR=y
487# CONFIG_MV643XX_ETH is not set
466CONFIG_NETDEV_10000=y 488CONFIG_NETDEV_10000=y
467 489
468# 490#
@@ -551,6 +573,11 @@ CONFIG_LEGACY_PTY_COUNT=256
551# CONFIG_TCG_TPM is not set 573# CONFIG_TCG_TPM is not set
552# CONFIG_I2C is not set 574# CONFIG_I2C is not set
553# CONFIG_SPI is not set 575# CONFIG_SPI is not set
576
577#
578# PPS support
579#
580# CONFIG_PPS is not set
554CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y 581CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
555# CONFIG_GPIOLIB is not set 582# CONFIG_GPIOLIB is not set
556# CONFIG_W1 is not set 583# CONFIG_W1 is not set
@@ -586,22 +613,7 @@ CONFIG_SSB_POSSIBLE=y
586# CONFIG_HTC_PASIC3 is not set 613# CONFIG_HTC_PASIC3 is not set
587# CONFIG_MFD_TMIO is not set 614# CONFIG_MFD_TMIO is not set
588# CONFIG_REGULATOR is not set 615# CONFIG_REGULATOR is not set
589 616# CONFIG_MEDIA_SUPPORT is not set
590#
591# Multimedia devices
592#
593
594#
595# Multimedia core support
596#
597# CONFIG_VIDEO_DEV is not set
598# CONFIG_DVB_CORE is not set
599# CONFIG_VIDEO_MEDIA is not set
600
601#
602# Multimedia drivers
603#
604CONFIG_DAB=y
605 617
606# 618#
607# Graphics support 619# Graphics support
@@ -690,6 +702,10 @@ CONFIG_RTC_DRV_M48T59=y
690# CONFIG_DMADEVICES is not set 702# CONFIG_DMADEVICES is not set
691# CONFIG_AUXDISPLAY is not set 703# CONFIG_AUXDISPLAY is not set
692# CONFIG_UIO is not set 704# CONFIG_UIO is not set
705
706#
707# TI VLYNQ
708#
693# CONFIG_STAGING is not set 709# CONFIG_STAGING is not set
694 710
695# 711#
@@ -701,10 +717,12 @@ CONFIG_RTC_DRV_M48T59=y
701# CONFIG_REISERFS_FS is not set 717# CONFIG_REISERFS_FS is not set
702# CONFIG_JFS_FS is not set 718# CONFIG_JFS_FS is not set
703# CONFIG_FS_POSIX_ACL is not set 719# CONFIG_FS_POSIX_ACL is not set
704CONFIG_FILE_LOCKING=y
705# CONFIG_XFS_FS is not set 720# CONFIG_XFS_FS is not set
721# CONFIG_GFS2_FS is not set
706# CONFIG_OCFS2_FS is not set 722# CONFIG_OCFS2_FS is not set
707# CONFIG_BTRFS_FS is not set 723# CONFIG_BTRFS_FS is not set
724CONFIG_FILE_LOCKING=y
725CONFIG_FSNOTIFY=y
708CONFIG_DNOTIFY=y 726CONFIG_DNOTIFY=y
709CONFIG_INOTIFY=y 727CONFIG_INOTIFY=y
710CONFIG_INOTIFY_USER=y 728CONFIG_INOTIFY_USER=y
@@ -819,6 +837,7 @@ CONFIG_HAS_IOPORT=y
819CONFIG_HAS_DMA=y 837CONFIG_HAS_DMA=y
820CONFIG_HAVE_LMB=y 838CONFIG_HAVE_LMB=y
821CONFIG_NLATTR=y 839CONFIG_NLATTR=y
840CONFIG_GENERIC_ATOMIC64=y
822 841
823# 842#
824# Kernel hacking 843# Kernel hacking
@@ -848,6 +867,9 @@ CONFIG_SCHED_DEBUG=y
848# CONFIG_RT_MUTEX_TESTER is not set 867# CONFIG_RT_MUTEX_TESTER is not set
849# CONFIG_DEBUG_SPINLOCK is not set 868# CONFIG_DEBUG_SPINLOCK is not set
850CONFIG_DEBUG_MUTEXES=y 869CONFIG_DEBUG_MUTEXES=y
870# CONFIG_DEBUG_LOCK_ALLOC is not set
871# CONFIG_PROVE_LOCKING is not set
872# CONFIG_LOCK_STAT is not set
851# CONFIG_DEBUG_SPINLOCK_SLEEP is not set 873# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
852# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set 874# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
853# CONFIG_DEBUG_KOBJECT is not set 875# CONFIG_DEBUG_KOBJECT is not set
@@ -859,7 +881,6 @@ CONFIG_DEBUG_MUTEXES=y
859# CONFIG_DEBUG_LIST is not set 881# CONFIG_DEBUG_LIST is not set
860# CONFIG_DEBUG_SG is not set 882# CONFIG_DEBUG_SG is not set
861# CONFIG_DEBUG_NOTIFIERS is not set 883# CONFIG_DEBUG_NOTIFIERS is not set
862# CONFIG_BOOT_PRINTK_DELAY is not set
863# CONFIG_RCU_TORTURE_TEST is not set 884# CONFIG_RCU_TORTURE_TEST is not set
864# CONFIG_RCU_CPU_STALL_DETECTOR is not set 885# CONFIG_RCU_CPU_STALL_DETECTOR is not set
865# CONFIG_BACKTRACE_SELF_TEST is not set 886# CONFIG_BACKTRACE_SELF_TEST is not set
@@ -873,16 +894,15 @@ CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
873CONFIG_HAVE_DYNAMIC_FTRACE=y 894CONFIG_HAVE_DYNAMIC_FTRACE=y
874CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y 895CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
875CONFIG_TRACING_SUPPORT=y 896CONFIG_TRACING_SUPPORT=y
876 897CONFIG_FTRACE=y
877#
878# Tracers
879#
880# CONFIG_FUNCTION_TRACER is not set 898# CONFIG_FUNCTION_TRACER is not set
899# CONFIG_IRQSOFF_TRACER is not set
881# CONFIG_SCHED_TRACER is not set 900# CONFIG_SCHED_TRACER is not set
882# CONFIG_CONTEXT_SWITCH_TRACER is not set 901# CONFIG_ENABLE_DEFAULT_TRACERS is not set
883# CONFIG_EVENT_TRACER is not set
884# CONFIG_BOOT_TRACER is not set 902# CONFIG_BOOT_TRACER is not set
885# CONFIG_TRACE_BRANCH_PROFILING is not set 903CONFIG_BRANCH_PROFILE_NONE=y
904# CONFIG_PROFILE_ANNOTATED_BRANCHES is not set
905# CONFIG_PROFILE_ALL_BRANCHES is not set
886# CONFIG_STACK_TRACER is not set 906# CONFIG_STACK_TRACER is not set
887# CONFIG_KMEMTRACE is not set 907# CONFIG_KMEMTRACE is not set
888# CONFIG_WORKQUEUE_TRACER is not set 908# CONFIG_WORKQUEUE_TRACER is not set
@@ -890,6 +910,9 @@ CONFIG_TRACING_SUPPORT=y
890# CONFIG_SAMPLES is not set 910# CONFIG_SAMPLES is not set
891CONFIG_HAVE_ARCH_KGDB=y 911CONFIG_HAVE_ARCH_KGDB=y
892# CONFIG_KGDB is not set 912# CONFIG_KGDB is not set
913# CONFIG_KMEMCHECK is not set
914# CONFIG_PPC_DISABLE_WERROR is not set
915CONFIG_PPC_WERROR=y
893CONFIG_PRINT_STACK_DEPTH=64 916CONFIG_PRINT_STACK_DEPTH=64
894# CONFIG_DEBUG_STACKOVERFLOW is not set 917# CONFIG_DEBUG_STACKOVERFLOW is not set
895# CONFIG_DEBUG_STACK_USAGE is not set 918# CONFIG_DEBUG_STACK_USAGE is not set
diff --git a/arch/powerpc/configs/85xx/socrates_defconfig b/arch/powerpc/configs/85xx/socrates_defconfig
index 79984589db69..04c85dada845 100644
--- a/arch/powerpc/configs/85xx/socrates_defconfig
+++ b/arch/powerpc/configs/85xx/socrates_defconfig
@@ -1,14 +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.30-rc3 3# Linux kernel version: 2.6.31-rc4
4# Wed May 13 17:22:21 2009 4# Wed Jul 29 23:32:19 2009
5# 5#
6# CONFIG_PPC64 is not set 6# CONFIG_PPC64 is not set
7 7
8# 8#
9# Processor support 9# Processor support
10# 10#
11# CONFIG_6xx is not set 11# CONFIG_PPC_BOOK3S_32 is not set
12CONFIG_PPC_85xx=y 12CONFIG_PPC_85xx=y
13# CONFIG_PPC_8xx is not set 13# CONFIG_PPC_8xx is not set
14# CONFIG_40x is not set 14# CONFIG_40x is not set
@@ -34,15 +34,16 @@ CONFIG_GENERIC_TIME=y
34CONFIG_GENERIC_TIME_VSYSCALL=y 34CONFIG_GENERIC_TIME_VSYSCALL=y
35CONFIG_GENERIC_CLOCKEVENTS=y 35CONFIG_GENERIC_CLOCKEVENTS=y
36CONFIG_GENERIC_HARDIRQS=y 36CONFIG_GENERIC_HARDIRQS=y
37CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
37# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set 38# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set
38CONFIG_IRQ_PER_CPU=y 39CONFIG_IRQ_PER_CPU=y
39CONFIG_STACKTRACE_SUPPORT=y 40CONFIG_STACKTRACE_SUPPORT=y
40CONFIG_HAVE_LATENCYTOP_SUPPORT=y 41CONFIG_HAVE_LATENCYTOP_SUPPORT=y
42CONFIG_TRACE_IRQFLAGS_SUPPORT=y
41CONFIG_LOCKDEP_SUPPORT=y 43CONFIG_LOCKDEP_SUPPORT=y
42CONFIG_RWSEM_XCHGADD_ALGORITHM=y 44CONFIG_RWSEM_XCHGADD_ALGORITHM=y
43CONFIG_ARCH_HAS_ILOG2_U32=y 45CONFIG_ARCH_HAS_ILOG2_U32=y
44CONFIG_GENERIC_HWEIGHT=y 46CONFIG_GENERIC_HWEIGHT=y
45CONFIG_GENERIC_CALIBRATE_DELAY=y
46CONFIG_GENERIC_FIND_NEXT_BIT=y 47CONFIG_GENERIC_FIND_NEXT_BIT=y
47# CONFIG_ARCH_NO_VIRT_TO_BUS is not set 48# CONFIG_ARCH_NO_VIRT_TO_BUS is not set
48CONFIG_PPC=y 49CONFIG_PPC=y
@@ -56,11 +57,13 @@ CONFIG_PPC_UDBG_16550=y
56# CONFIG_GENERIC_TBSYNC is not set 57# CONFIG_GENERIC_TBSYNC is not set
57CONFIG_AUDIT_ARCH=y 58CONFIG_AUDIT_ARCH=y
58CONFIG_GENERIC_BUG=y 59CONFIG_GENERIC_BUG=y
60CONFIG_DTC=y
59CONFIG_DEFAULT_UIMAGE=y 61CONFIG_DEFAULT_UIMAGE=y
60# CONFIG_PPC_DCR_NATIVE is not set 62# CONFIG_PPC_DCR_NATIVE is not set
61# CONFIG_PPC_DCR_MMIO is not set 63# CONFIG_PPC_DCR_MMIO is not set
62CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y 64CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y
63CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" 65CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
66CONFIG_CONSTRUCTORS=y
64 67
65# 68#
66# General setup 69# General setup
@@ -109,7 +112,6 @@ CONFIG_ANON_INODES=y
109CONFIG_EMBEDDED=y 112CONFIG_EMBEDDED=y
110CONFIG_SYSCTL_SYSCALL=y 113CONFIG_SYSCTL_SYSCALL=y
111# CONFIG_KALLSYMS is not set 114# CONFIG_KALLSYMS is not set
112# CONFIG_STRIP_ASM_SYMS is not set
113# CONFIG_HOTPLUG is not set 115# CONFIG_HOTPLUG is not set
114CONFIG_PRINTK=y 116CONFIG_PRINTK=y
115CONFIG_BUG=y 117CONFIG_BUG=y
@@ -122,9 +124,16 @@ CONFIG_TIMERFD=y
122CONFIG_EVENTFD=y 124CONFIG_EVENTFD=y
123CONFIG_SHMEM=y 125CONFIG_SHMEM=y
124CONFIG_AIO=y 126CONFIG_AIO=y
127CONFIG_HAVE_PERF_COUNTERS=y
128
129#
130# Performance Counters
131#
132# CONFIG_PERF_COUNTERS is not set
125CONFIG_VM_EVENT_COUNTERS=y 133CONFIG_VM_EVENT_COUNTERS=y
126CONFIG_PCI_QUIRKS=y 134CONFIG_PCI_QUIRKS=y
127CONFIG_SLUB_DEBUG=y 135CONFIG_SLUB_DEBUG=y
136# CONFIG_STRIP_ASM_SYMS is not set
128CONFIG_COMPAT_BRK=y 137CONFIG_COMPAT_BRK=y
129# CONFIG_SLAB is not set 138# CONFIG_SLAB is not set
130CONFIG_SLUB=y 139CONFIG_SLUB=y
@@ -137,6 +146,10 @@ CONFIG_HAVE_IOREMAP_PROT=y
137CONFIG_HAVE_KPROBES=y 146CONFIG_HAVE_KPROBES=y
138CONFIG_HAVE_KRETPROBES=y 147CONFIG_HAVE_KRETPROBES=y
139CONFIG_HAVE_ARCH_TRACEHOOK=y 148CONFIG_HAVE_ARCH_TRACEHOOK=y
149
150#
151# GCOV-based kernel profiling
152#
140# CONFIG_SLOW_WORK is not set 153# CONFIG_SLOW_WORK is not set
141# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set 154# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
142CONFIG_SLABINFO=y 155CONFIG_SLABINFO=y
@@ -149,7 +162,7 @@ CONFIG_MODULE_FORCE_UNLOAD=y
149# CONFIG_MODVERSIONS is not set 162# CONFIG_MODVERSIONS is not set
150# CONFIG_MODULE_SRCVERSION_ALL is not set 163# CONFIG_MODULE_SRCVERSION_ALL is not set
151CONFIG_BLOCK=y 164CONFIG_BLOCK=y
152# CONFIG_LBD is not set 165CONFIG_LBDAF=y
153# CONFIG_BLK_DEV_BSG is not set 166# CONFIG_BLK_DEV_BSG is not set
154# CONFIG_BLK_DEV_INTEGRITY is not set 167# CONFIG_BLK_DEV_INTEGRITY is not set
155 168
@@ -182,6 +195,7 @@ CONFIG_MPC85xx=y
182# CONFIG_MPC85xx_DS is not set 195# CONFIG_MPC85xx_DS is not set
183CONFIG_SOCRATES=y 196CONFIG_SOCRATES=y
184# CONFIG_KSI8560 is not set 197# CONFIG_KSI8560 is not set
198# CONFIG_XES_MPC85xx is not set
185# CONFIG_STX_GP3 is not set 199# CONFIG_STX_GP3 is not set
186# CONFIG_TQM8540 is not set 200# CONFIG_TQM8540 is not set
187# CONFIG_TQM8541 is not set 201# CONFIG_TQM8541 is not set
@@ -229,6 +243,7 @@ CONFIG_BINFMT_ELF=y
229# CONFIG_BINFMT_MISC is not set 243# CONFIG_BINFMT_MISC is not set
230CONFIG_MATH_EMULATION=y 244CONFIG_MATH_EMULATION=y
231# CONFIG_IOMMU_HELPER is not set 245# CONFIG_IOMMU_HELPER is not set
246# CONFIG_SWIOTLB is not set
232CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y 247CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
233CONFIG_ARCH_HAS_WALK_MEMORY=y 248CONFIG_ARCH_HAS_WALK_MEMORY=y
234CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y 249CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y
@@ -247,9 +262,9 @@ CONFIG_MIGRATION=y
247CONFIG_ZONE_DMA_FLAG=1 262CONFIG_ZONE_DMA_FLAG=1
248CONFIG_BOUNCE=y 263CONFIG_BOUNCE=y
249CONFIG_VIRT_TO_BUS=y 264CONFIG_VIRT_TO_BUS=y
250CONFIG_UNEVICTABLE_LRU=y
251CONFIG_HAVE_MLOCK=y 265CONFIG_HAVE_MLOCK=y
252CONFIG_HAVE_MLOCKED_PAGE_BIT=y 266CONFIG_HAVE_MLOCKED_PAGE_BIT=y
267CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
253CONFIG_PPC_4K_PAGES=y 268CONFIG_PPC_4K_PAGES=y
254# CONFIG_PPC_16K_PAGES is not set 269# CONFIG_PPC_16K_PAGES is not set
255# CONFIG_PPC_64K_PAGES is not set 270# CONFIG_PPC_64K_PAGES is not set
@@ -357,6 +372,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
357# CONFIG_ECONET is not set 372# CONFIG_ECONET is not set
358# CONFIG_WAN_ROUTER is not set 373# CONFIG_WAN_ROUTER is not set
359# CONFIG_PHONET is not set 374# CONFIG_PHONET is not set
375# CONFIG_IEEE802154 is not set
360# CONFIG_NET_SCHED is not set 376# CONFIG_NET_SCHED is not set
361# CONFIG_DCB is not set 377# CONFIG_DCB is not set
362 378
@@ -373,6 +389,7 @@ CONFIG_CAN_BCM=y
373# CAN Device Drivers 389# CAN Device Drivers
374# 390#
375# CONFIG_CAN_VCAN is not set 391# CONFIG_CAN_VCAN is not set
392# CONFIG_CAN_DEV is not set
376# CONFIG_CAN_DEBUG_DEVICES is not set 393# CONFIG_CAN_DEBUG_DEVICES is not set
377# CONFIG_IRDA is not set 394# CONFIG_IRDA is not set
378# CONFIG_BT is not set 395# CONFIG_BT is not set
@@ -382,7 +399,11 @@ CONFIG_WIRELESS=y
382# CONFIG_WIRELESS_OLD_REGULATORY is not set 399# CONFIG_WIRELESS_OLD_REGULATORY is not set
383# CONFIG_WIRELESS_EXT is not set 400# CONFIG_WIRELESS_EXT is not set
384# CONFIG_LIB80211 is not set 401# CONFIG_LIB80211 is not set
385# CONFIG_MAC80211 is not set 402
403#
404# CFG80211 needs to be enabled for MAC80211
405#
406CONFIG_MAC80211_DEFAULT_PS_VALUE=0
386# CONFIG_WIMAX is not set 407# CONFIG_WIMAX is not set
387# CONFIG_RFKILL is not set 408# CONFIG_RFKILL is not set
388# CONFIG_NET_9P is not set 409# CONFIG_NET_9P is not set
@@ -499,6 +520,7 @@ CONFIG_MTD_NAND_SOCRATES=y
499CONFIG_OF_DEVICE=y 520CONFIG_OF_DEVICE=y
500CONFIG_OF_I2C=y 521CONFIG_OF_I2C=y
501CONFIG_OF_SPI=y 522CONFIG_OF_SPI=y
523CONFIG_OF_MDIO=y
502# CONFIG_PARPORT is not set 524# CONFIG_PARPORT is not set
503CONFIG_BLK_DEV=y 525CONFIG_BLK_DEV=y
504# CONFIG_BLK_DEV_FD is not set 526# CONFIG_BLK_DEV_FD is not set
@@ -535,7 +557,9 @@ CONFIG_MISC_DEVICES=y
535# CONFIG_EEPROM_AT24 is not set 557# CONFIG_EEPROM_AT24 is not set
536# CONFIG_EEPROM_AT25 is not set 558# CONFIG_EEPROM_AT25 is not set
537# CONFIG_EEPROM_LEGACY is not set 559# CONFIG_EEPROM_LEGACY is not set
560# CONFIG_EEPROM_MAX6875 is not set
538# CONFIG_EEPROM_93CX6 is not set 561# CONFIG_EEPROM_93CX6 is not set
562# CONFIG_CB710_CORE is not set
539CONFIG_HAVE_IDE=y 563CONFIG_HAVE_IDE=y
540# CONFIG_IDE is not set 564# CONFIG_IDE is not set
541 565
@@ -558,10 +582,6 @@ CONFIG_BLK_DEV_SD=y
558# CONFIG_BLK_DEV_SR is not set 582# CONFIG_BLK_DEV_SR is not set
559# CONFIG_CHR_DEV_SG is not set 583# CONFIG_CHR_DEV_SG is not set
560# CONFIG_CHR_DEV_SCH is not set 584# CONFIG_CHR_DEV_SCH is not set
561
562#
563# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
564#
565# CONFIG_SCSI_MULTI_LUN is not set 585# CONFIG_SCSI_MULTI_LUN is not set
566# CONFIG_SCSI_CONSTANTS is not set 586# CONFIG_SCSI_CONSTANTS is not set
567# CONFIG_SCSI_LOGGING is not set 587# CONFIG_SCSI_LOGGING is not set
@@ -588,14 +608,17 @@ CONFIG_SCSI_WAIT_SCAN=m
588# 608#
589 609
590# 610#
591# Enable only one of the two stacks, unless you know what you are doing 611# You can enable one or both FireWire driver stacks.
612#
613
614#
615# See the help texts for more information.
592# 616#
593# CONFIG_FIREWIRE is not set 617# CONFIG_FIREWIRE is not set
594# CONFIG_IEEE1394 is not set 618# CONFIG_IEEE1394 is not set
595# CONFIG_I2O is not set 619# CONFIG_I2O is not set
596# CONFIG_MACINTOSH_DRIVERS is not set 620# CONFIG_MACINTOSH_DRIVERS is not set
597CONFIG_NETDEVICES=y 621CONFIG_NETDEVICES=y
598CONFIG_COMPAT_NET_DEV_OPS=y
599# CONFIG_DUMMY is not set 622# CONFIG_DUMMY is not set
600# CONFIG_BONDING is not set 623# CONFIG_BONDING is not set
601# CONFIG_MACVLAN is not set 624# CONFIG_MACVLAN is not set
@@ -643,6 +666,8 @@ CONFIG_MII=y
643# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set 666# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
644# CONFIG_NET_PCI is not set 667# CONFIG_NET_PCI is not set
645# CONFIG_B44 is not set 668# CONFIG_B44 is not set
669# CONFIG_KS8842 is not set
670# CONFIG_KS8851 is not set
646# CONFIG_ATL2 is not set 671# CONFIG_ATL2 is not set
647CONFIG_NETDEV_1000=y 672CONFIG_NETDEV_1000=y
648# CONFIG_ACENIC is not set 673# CONFIG_ACENIC is not set
@@ -662,8 +687,10 @@ CONFIG_NETDEV_1000=y
662# CONFIG_VIA_VELOCITY is not set 687# CONFIG_VIA_VELOCITY is not set
663# CONFIG_TIGON3 is not set 688# CONFIG_TIGON3 is not set
664# CONFIG_BNX2 is not set 689# CONFIG_BNX2 is not set
690# CONFIG_CNIC is not set
665CONFIG_FSL_PQ_MDIO=y 691CONFIG_FSL_PQ_MDIO=y
666CONFIG_GIANFAR=y 692CONFIG_GIANFAR=y
693# CONFIG_MV643XX_ETH is not set
667# CONFIG_QLA3XXX is not set 694# CONFIG_QLA3XXX is not set
668# CONFIG_ATL1 is not set 695# CONFIG_ATL1 is not set
669# CONFIG_ATL1E is not set 696# CONFIG_ATL1E is not set
@@ -733,6 +760,7 @@ CONFIG_INPUT_TOUCHSCREEN=y
733# CONFIG_TOUCHSCREEN_AD7879_I2C is not set 760# CONFIG_TOUCHSCREEN_AD7879_I2C is not set
734# CONFIG_TOUCHSCREEN_AD7879_SPI is not set 761# CONFIG_TOUCHSCREEN_AD7879_SPI is not set
735# CONFIG_TOUCHSCREEN_AD7879 is not set 762# CONFIG_TOUCHSCREEN_AD7879 is not set
763# CONFIG_TOUCHSCREEN_EETI is not set
736# CONFIG_TOUCHSCREEN_FUJITSU is not set 764# CONFIG_TOUCHSCREEN_FUJITSU is not set
737# CONFIG_TOUCHSCREEN_GUNZE is not set 765# CONFIG_TOUCHSCREEN_GUNZE is not set
738# CONFIG_TOUCHSCREEN_ELO is not set 766# CONFIG_TOUCHSCREEN_ELO is not set
@@ -746,6 +774,7 @@ CONFIG_INPUT_TOUCHSCREEN=y
746# CONFIG_TOUCHSCREEN_USB_COMPOSITE is not set 774# CONFIG_TOUCHSCREEN_USB_COMPOSITE is not set
747# CONFIG_TOUCHSCREEN_TOUCHIT213 is not set 775# CONFIG_TOUCHSCREEN_TOUCHIT213 is not set
748# CONFIG_TOUCHSCREEN_TSC2007 is not set 776# CONFIG_TOUCHSCREEN_TSC2007 is not set
777# CONFIG_TOUCHSCREEN_W90X900 is not set
749# CONFIG_INPUT_MISC is not set 778# CONFIG_INPUT_MISC is not set
750 779
751# 780#
@@ -862,7 +891,6 @@ CONFIG_I2C_MPC=y
862# CONFIG_SENSORS_PCF8574 is not set 891# CONFIG_SENSORS_PCF8574 is not set
863# CONFIG_PCF8575 is not set 892# CONFIG_PCF8575 is not set
864# CONFIG_SENSORS_PCA9539 is not set 893# CONFIG_SENSORS_PCA9539 is not set
865# CONFIG_SENSORS_MAX6875 is not set
866# CONFIG_SENSORS_TSL2550 is not set 894# CONFIG_SENSORS_TSL2550 is not set
867# CONFIG_I2C_DEBUG_CORE is not set 895# CONFIG_I2C_DEBUG_CORE is not set
868# CONFIG_I2C_DEBUG_ALGO is not set 896# CONFIG_I2C_DEBUG_ALGO is not set
@@ -875,12 +903,18 @@ CONFIG_SPI_MASTER=y
875# SPI Master Controller Drivers 903# SPI Master Controller Drivers
876# 904#
877# CONFIG_SPI_BITBANG is not set 905# CONFIG_SPI_BITBANG is not set
906# CONFIG_SPI_MPC8xxx is not set
878 907
879# 908#
880# SPI Protocol Masters 909# SPI Protocol Masters
881# 910#
882# CONFIG_SPI_SPIDEV is not set 911# CONFIG_SPI_SPIDEV is not set
883# CONFIG_SPI_TLE62X0 is not set 912# CONFIG_SPI_TLE62X0 is not set
913
914#
915# PPS support
916#
917# CONFIG_PPS is not set
884CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y 918CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
885# CONFIG_GPIOLIB is not set 919# CONFIG_GPIOLIB is not set
886# CONFIG_W1 is not set 920# CONFIG_W1 is not set
@@ -938,6 +972,7 @@ CONFIG_SENSORS_LM75=y
938# CONFIG_SENSORS_SMSC47B397 is not set 972# CONFIG_SENSORS_SMSC47B397 is not set
939# CONFIG_SENSORS_ADS7828 is not set 973# CONFIG_SENSORS_ADS7828 is not set
940# CONFIG_SENSORS_THMC50 is not set 974# CONFIG_SENSORS_THMC50 is not set
975# CONFIG_SENSORS_TMP401 is not set
941# CONFIG_SENSORS_VIA686A is not set 976# CONFIG_SENSORS_VIA686A is not set
942# CONFIG_SENSORS_VT1211 is not set 977# CONFIG_SENSORS_VT1211 is not set
943# CONFIG_SENSORS_VT8231 is not set 978# CONFIG_SENSORS_VT8231 is not set
@@ -973,24 +1008,10 @@ CONFIG_SSB_POSSIBLE=y
973# CONFIG_MFD_WM8400 is not set 1008# CONFIG_MFD_WM8400 is not set
974# CONFIG_MFD_WM8350_I2C is not set 1009# CONFIG_MFD_WM8350_I2C is not set
975# CONFIG_MFD_PCF50633 is not set 1010# CONFIG_MFD_PCF50633 is not set
1011# CONFIG_AB3100_CORE is not set
1012# CONFIG_EZX_PCAP is not set
976# CONFIG_REGULATOR is not set 1013# CONFIG_REGULATOR is not set
977 1014# CONFIG_MEDIA_SUPPORT is not set
978#
979# Multimedia devices
980#
981
982#
983# Multimedia core support
984#
985# CONFIG_VIDEO_DEV is not set
986# CONFIG_DVB_CORE is not set
987# CONFIG_VIDEO_MEDIA is not set
988
989#
990# Multimedia drivers
991#
992CONFIG_DAB=y
993# CONFIG_USB_DABUSB is not set
994 1015
995# 1016#
996# Graphics support 1017# Graphics support
@@ -1110,7 +1131,7 @@ CONFIG_USB_HID=y
1110# CONFIG_HID_CHERRY is not set 1131# CONFIG_HID_CHERRY is not set
1111# CONFIG_HID_CHICONY is not set 1132# CONFIG_HID_CHICONY is not set
1112# CONFIG_HID_CYPRESS is not set 1133# CONFIG_HID_CYPRESS is not set
1113# CONFIG_DRAGONRISE_FF is not set 1134# CONFIG_HID_DRAGONRISE is not set
1114# CONFIG_HID_EZKEY is not set 1135# CONFIG_HID_EZKEY is not set
1115# CONFIG_HID_KYE is not set 1136# CONFIG_HID_KYE is not set
1116# CONFIG_HID_GYRATION is not set 1137# CONFIG_HID_GYRATION is not set
@@ -1124,10 +1145,11 @@ CONFIG_USB_HID=y
1124# CONFIG_HID_SAMSUNG is not set 1145# CONFIG_HID_SAMSUNG is not set
1125# CONFIG_HID_SONY is not set 1146# CONFIG_HID_SONY is not set
1126# CONFIG_HID_SUNPLUS is not set 1147# CONFIG_HID_SUNPLUS is not set
1127# CONFIG_GREENASIA_FF is not set 1148# CONFIG_HID_GREENASIA is not set
1149# CONFIG_HID_SMARTJOYPLUS is not set
1128# CONFIG_HID_TOPSEED is not set 1150# CONFIG_HID_TOPSEED is not set
1129# CONFIG_THRUSTMASTER_FF is not set 1151# CONFIG_HID_THRUSTMASTER is not set
1130# CONFIG_ZEROPLUS_FF is not set 1152# CONFIG_HID_ZEROPLUS is not set
1131CONFIG_USB_SUPPORT=y 1153CONFIG_USB_SUPPORT=y
1132CONFIG_USB_ARCH_HAS_HCD=y 1154CONFIG_USB_ARCH_HAS_HCD=y
1133CONFIG_USB_ARCH_HAS_OHCI=y 1155CONFIG_USB_ARCH_HAS_OHCI=y
@@ -1153,6 +1175,7 @@ CONFIG_USB_MON=y
1153# USB Host Controller Drivers 1175# USB Host Controller Drivers
1154# 1176#
1155# CONFIG_USB_C67X00_HCD is not set 1177# CONFIG_USB_C67X00_HCD is not set
1178# CONFIG_USB_XHCI_HCD is not set
1156CONFIG_USB_EHCI_HCD=y 1179CONFIG_USB_EHCI_HCD=y
1157# CONFIG_USB_EHCI_ROOT_HUB_TT is not set 1180# CONFIG_USB_EHCI_ROOT_HUB_TT is not set
1158# CONFIG_USB_EHCI_TT_NEWSCHED is not set 1181# CONFIG_USB_EHCI_TT_NEWSCHED is not set
@@ -1162,9 +1185,9 @@ CONFIG_USB_EHCI_HCD_PPC_OF=y
1162# CONFIG_USB_ISP116X_HCD is not set 1185# CONFIG_USB_ISP116X_HCD is not set
1163# CONFIG_USB_ISP1760_HCD is not set 1186# CONFIG_USB_ISP1760_HCD is not set
1164CONFIG_USB_OHCI_HCD=y 1187CONFIG_USB_OHCI_HCD=y
1165CONFIG_USB_OHCI_HCD_PPC_OF=y
1166CONFIG_USB_OHCI_HCD_PPC_OF_BE=y 1188CONFIG_USB_OHCI_HCD_PPC_OF_BE=y
1167# CONFIG_USB_OHCI_HCD_PPC_OF_LE is not set 1189# CONFIG_USB_OHCI_HCD_PPC_OF_LE is not set
1190CONFIG_USB_OHCI_HCD_PPC_OF=y
1168CONFIG_USB_OHCI_HCD_PCI=y 1191CONFIG_USB_OHCI_HCD_PCI=y
1169CONFIG_USB_OHCI_BIG_ENDIAN_DESC=y 1192CONFIG_USB_OHCI_BIG_ENDIAN_DESC=y
1170CONFIG_USB_OHCI_BIG_ENDIAN_MMIO=y 1193CONFIG_USB_OHCI_BIG_ENDIAN_MMIO=y
@@ -1284,6 +1307,7 @@ CONFIG_RTC_INTF_DEV=y
1284# CONFIG_RTC_DRV_S35390A is not set 1307# CONFIG_RTC_DRV_S35390A is not set
1285# CONFIG_RTC_DRV_FM3130 is not set 1308# CONFIG_RTC_DRV_FM3130 is not set
1286# CONFIG_RTC_DRV_RX8581 is not set 1309# CONFIG_RTC_DRV_RX8581 is not set
1310# CONFIG_RTC_DRV_RX8025 is not set
1287 1311
1288# 1312#
1289# SPI RTC drivers 1313# SPI RTC drivers
@@ -1318,6 +1342,10 @@ CONFIG_RTC_INTF_DEV=y
1318# CONFIG_DMADEVICES is not set 1342# CONFIG_DMADEVICES is not set
1319# CONFIG_AUXDISPLAY is not set 1343# CONFIG_AUXDISPLAY is not set
1320# CONFIG_UIO is not set 1344# CONFIG_UIO is not set
1345
1346#
1347# TI VLYNQ
1348#
1321# CONFIG_STAGING is not set 1349# CONFIG_STAGING is not set
1322 1350
1323# 1351#
@@ -1337,10 +1365,12 @@ CONFIG_FS_MBCACHE=y
1337# CONFIG_REISERFS_FS is not set 1365# CONFIG_REISERFS_FS is not set
1338# CONFIG_JFS_FS is not set 1366# CONFIG_JFS_FS is not set
1339# CONFIG_FS_POSIX_ACL is not set 1367# CONFIG_FS_POSIX_ACL is not set
1340CONFIG_FILE_LOCKING=y
1341# CONFIG_XFS_FS is not set 1368# CONFIG_XFS_FS is not set
1369# CONFIG_GFS2_FS is not set
1342# CONFIG_OCFS2_FS is not set 1370# CONFIG_OCFS2_FS is not set
1343# CONFIG_BTRFS_FS is not set 1371# CONFIG_BTRFS_FS is not set
1372CONFIG_FILE_LOCKING=y
1373CONFIG_FSNOTIFY=y
1344CONFIG_DNOTIFY=y 1374CONFIG_DNOTIFY=y
1345CONFIG_INOTIFY=y 1375CONFIG_INOTIFY=y
1346CONFIG_INOTIFY_USER=y 1376CONFIG_INOTIFY_USER=y
@@ -1449,7 +1479,46 @@ CONFIG_MSDOS_PARTITION=y
1449# CONFIG_KARMA_PARTITION is not set 1479# CONFIG_KARMA_PARTITION is not set
1450# CONFIG_EFI_PARTITION is not set 1480# CONFIG_EFI_PARTITION is not set
1451# CONFIG_SYSV68_PARTITION is not set 1481# CONFIG_SYSV68_PARTITION is not set
1452# CONFIG_NLS is not set 1482CONFIG_NLS=y
1483CONFIG_NLS_DEFAULT="iso8859-1"
1484# CONFIG_NLS_CODEPAGE_437 is not set
1485# CONFIG_NLS_CODEPAGE_737 is not set
1486# CONFIG_NLS_CODEPAGE_775 is not set
1487# CONFIG_NLS_CODEPAGE_850 is not set
1488# CONFIG_NLS_CODEPAGE_852 is not set
1489# CONFIG_NLS_CODEPAGE_855 is not set
1490# CONFIG_NLS_CODEPAGE_857 is not set
1491# CONFIG_NLS_CODEPAGE_860 is not set
1492# CONFIG_NLS_CODEPAGE_861 is not set
1493# CONFIG_NLS_CODEPAGE_862 is not set
1494# CONFIG_NLS_CODEPAGE_863 is not set
1495# CONFIG_NLS_CODEPAGE_864 is not set
1496# CONFIG_NLS_CODEPAGE_865 is not set
1497# CONFIG_NLS_CODEPAGE_866 is not set
1498# CONFIG_NLS_CODEPAGE_869 is not set
1499# CONFIG_NLS_CODEPAGE_936 is not set
1500# CONFIG_NLS_CODEPAGE_950 is not set
1501# CONFIG_NLS_CODEPAGE_932 is not set
1502# CONFIG_NLS_CODEPAGE_949 is not set
1503# CONFIG_NLS_CODEPAGE_874 is not set
1504# CONFIG_NLS_ISO8859_8 is not set
1505# CONFIG_NLS_CODEPAGE_1250 is not set
1506# CONFIG_NLS_CODEPAGE_1251 is not set
1507# CONFIG_NLS_ASCII is not set
1508# CONFIG_NLS_ISO8859_1 is not set
1509# CONFIG_NLS_ISO8859_2 is not set
1510# CONFIG_NLS_ISO8859_3 is not set
1511# CONFIG_NLS_ISO8859_4 is not set
1512# CONFIG_NLS_ISO8859_5 is not set
1513# CONFIG_NLS_ISO8859_6 is not set
1514# CONFIG_NLS_ISO8859_7 is not set
1515# CONFIG_NLS_ISO8859_9 is not set
1516# CONFIG_NLS_ISO8859_13 is not set
1517# CONFIG_NLS_ISO8859_14 is not set
1518# CONFIG_NLS_ISO8859_15 is not set
1519# CONFIG_NLS_KOI8_R is not set
1520# CONFIG_NLS_KOI8_U is not set
1521# CONFIG_NLS_UTF8 is not set
1453# CONFIG_DLM is not set 1522# CONFIG_DLM is not set
1454# CONFIG_BINARY_PRINTF is not set 1523# CONFIG_BINARY_PRINTF is not set
1455 1524
@@ -1473,6 +1542,7 @@ CONFIG_HAS_IOPORT=y
1473CONFIG_HAS_DMA=y 1542CONFIG_HAS_DMA=y
1474CONFIG_HAVE_LMB=y 1543CONFIG_HAVE_LMB=y
1475CONFIG_NLATTR=y 1544CONFIG_NLATTR=y
1545CONFIG_GENERIC_ATOMIC64=y
1476 1546
1477# 1547#
1478# Kernel hacking 1548# Kernel hacking
@@ -1498,22 +1568,11 @@ CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
1498CONFIG_HAVE_DYNAMIC_FTRACE=y 1568CONFIG_HAVE_DYNAMIC_FTRACE=y
1499CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y 1569CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
1500CONFIG_TRACING_SUPPORT=y 1570CONFIG_TRACING_SUPPORT=y
1501 1571# CONFIG_FTRACE is not set
1502#
1503# Tracers
1504#
1505# CONFIG_FUNCTION_TRACER is not set
1506# CONFIG_SCHED_TRACER is not set
1507# CONFIG_CONTEXT_SWITCH_TRACER is not set
1508# CONFIG_EVENT_TRACER is not set
1509# CONFIG_BOOT_TRACER is not set
1510# CONFIG_TRACE_BRANCH_PROFILING is not set
1511# CONFIG_STACK_TRACER is not set
1512# CONFIG_KMEMTRACE is not set
1513# CONFIG_WORKQUEUE_TRACER is not set
1514# CONFIG_BLK_DEV_IO_TRACE is not set
1515# CONFIG_SAMPLES is not set 1572# CONFIG_SAMPLES is not set
1516CONFIG_HAVE_ARCH_KGDB=y 1573CONFIG_HAVE_ARCH_KGDB=y
1574# CONFIG_PPC_DISABLE_WERROR is not set
1575CONFIG_PPC_WERROR=y
1517CONFIG_PRINT_STACK_DEPTH=64 1576CONFIG_PRINT_STACK_DEPTH=64
1518# CONFIG_IRQSTACKS is not set 1577# CONFIG_IRQSTACKS is not set
1519# CONFIG_PPC_EARLY_DEBUG is not set 1578# CONFIG_PPC_EARLY_DEBUG is not set
diff --git a/arch/powerpc/configs/85xx/stx_gp3_defconfig b/arch/powerpc/configs/85xx/stx_gp3_defconfig
index bd1bfcddbd0c..e7e81d6769fe 100644
--- a/arch/powerpc/configs/85xx/stx_gp3_defconfig
+++ b/arch/powerpc/configs/85xx/stx_gp3_defconfig
@@ -1,14 +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.30-rc3 3# Linux kernel version: 2.6.31-rc4
4# Wed May 13 17:22:22 2009 4# Wed Jul 29 23:32:20 2009
5# 5#
6# CONFIG_PPC64 is not set 6# CONFIG_PPC64 is not set
7 7
8# 8#
9# Processor support 9# Processor support
10# 10#
11# CONFIG_6xx is not set 11# CONFIG_PPC_BOOK3S_32 is not set
12CONFIG_PPC_85xx=y 12CONFIG_PPC_85xx=y
13# CONFIG_PPC_8xx is not set 13# CONFIG_PPC_8xx is not set
14# CONFIG_40x is not set 14# CONFIG_40x is not set
@@ -34,15 +34,16 @@ CONFIG_GENERIC_TIME=y
34CONFIG_GENERIC_TIME_VSYSCALL=y 34CONFIG_GENERIC_TIME_VSYSCALL=y
35CONFIG_GENERIC_CLOCKEVENTS=y 35CONFIG_GENERIC_CLOCKEVENTS=y
36CONFIG_GENERIC_HARDIRQS=y 36CONFIG_GENERIC_HARDIRQS=y
37CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
37# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set 38# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set
38CONFIG_IRQ_PER_CPU=y 39CONFIG_IRQ_PER_CPU=y
39CONFIG_STACKTRACE_SUPPORT=y 40CONFIG_STACKTRACE_SUPPORT=y
40CONFIG_HAVE_LATENCYTOP_SUPPORT=y 41CONFIG_HAVE_LATENCYTOP_SUPPORT=y
42CONFIG_TRACE_IRQFLAGS_SUPPORT=y
41CONFIG_LOCKDEP_SUPPORT=y 43CONFIG_LOCKDEP_SUPPORT=y
42CONFIG_RWSEM_XCHGADD_ALGORITHM=y 44CONFIG_RWSEM_XCHGADD_ALGORITHM=y
43CONFIG_ARCH_HAS_ILOG2_U32=y 45CONFIG_ARCH_HAS_ILOG2_U32=y
44CONFIG_GENERIC_HWEIGHT=y 46CONFIG_GENERIC_HWEIGHT=y
45CONFIG_GENERIC_CALIBRATE_DELAY=y
46CONFIG_GENERIC_FIND_NEXT_BIT=y 47CONFIG_GENERIC_FIND_NEXT_BIT=y
47CONFIG_GENERIC_GPIO=y 48CONFIG_GENERIC_GPIO=y
48# CONFIG_ARCH_NO_VIRT_TO_BUS is not set 49# CONFIG_ARCH_NO_VIRT_TO_BUS is not set
@@ -57,11 +58,13 @@ CONFIG_PPC_UDBG_16550=y
57# CONFIG_GENERIC_TBSYNC is not set 58# CONFIG_GENERIC_TBSYNC is not set
58CONFIG_AUDIT_ARCH=y 59CONFIG_AUDIT_ARCH=y
59CONFIG_GENERIC_BUG=y 60CONFIG_GENERIC_BUG=y
61CONFIG_DTC=y
60CONFIG_DEFAULT_UIMAGE=y 62CONFIG_DEFAULT_UIMAGE=y
61# CONFIG_PPC_DCR_NATIVE is not set 63# CONFIG_PPC_DCR_NATIVE is not set
62# CONFIG_PPC_DCR_MMIO is not set 64# CONFIG_PPC_DCR_MMIO is not set
63CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y 65CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y
64CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" 66CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
67CONFIG_CONSTRUCTORS=y
65 68
66# 69#
67# General setup 70# General setup
@@ -112,7 +115,6 @@ CONFIG_SYSCTL_SYSCALL=y
112CONFIG_KALLSYMS=y 115CONFIG_KALLSYMS=y
113# CONFIG_KALLSYMS_ALL is not set 116# CONFIG_KALLSYMS_ALL is not set
114# CONFIG_KALLSYMS_EXTRA_PASS is not set 117# CONFIG_KALLSYMS_EXTRA_PASS is not set
115# CONFIG_STRIP_ASM_SYMS is not set
116CONFIG_HOTPLUG=y 118CONFIG_HOTPLUG=y
117CONFIG_PRINTK=y 119CONFIG_PRINTK=y
118CONFIG_BUG=y 120CONFIG_BUG=y
@@ -125,9 +127,16 @@ CONFIG_TIMERFD=y
125CONFIG_EVENTFD=y 127CONFIG_EVENTFD=y
126CONFIG_SHMEM=y 128CONFIG_SHMEM=y
127CONFIG_AIO=y 129CONFIG_AIO=y
130CONFIG_HAVE_PERF_COUNTERS=y
131
132#
133# Performance Counters
134#
135# CONFIG_PERF_COUNTERS is not set
128CONFIG_VM_EVENT_COUNTERS=y 136CONFIG_VM_EVENT_COUNTERS=y
129CONFIG_PCI_QUIRKS=y 137CONFIG_PCI_QUIRKS=y
130CONFIG_SLUB_DEBUG=y 138CONFIG_SLUB_DEBUG=y
139# CONFIG_STRIP_ASM_SYMS is not set
131CONFIG_COMPAT_BRK=y 140CONFIG_COMPAT_BRK=y
132# CONFIG_SLAB is not set 141# CONFIG_SLAB is not set
133CONFIG_SLUB=y 142CONFIG_SLUB=y
@@ -142,6 +151,10 @@ CONFIG_HAVE_KPROBES=y
142CONFIG_HAVE_KRETPROBES=y 151CONFIG_HAVE_KRETPROBES=y
143CONFIG_HAVE_ARCH_TRACEHOOK=y 152CONFIG_HAVE_ARCH_TRACEHOOK=y
144CONFIG_HAVE_CLK=y 153CONFIG_HAVE_CLK=y
154
155#
156# GCOV-based kernel profiling
157#
145# CONFIG_SLOW_WORK is not set 158# CONFIG_SLOW_WORK is not set
146# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set 159# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
147CONFIG_SLABINFO=y 160CONFIG_SLABINFO=y
@@ -153,7 +166,7 @@ CONFIG_MODULES=y
153CONFIG_MODVERSIONS=y 166CONFIG_MODVERSIONS=y
154# CONFIG_MODULE_SRCVERSION_ALL is not set 167# CONFIG_MODULE_SRCVERSION_ALL is not set
155CONFIG_BLOCK=y 168CONFIG_BLOCK=y
156# CONFIG_LBD is not set 169CONFIG_LBDAF=y
157# CONFIG_BLK_DEV_BSG is not set 170# CONFIG_BLK_DEV_BSG is not set
158# CONFIG_BLK_DEV_INTEGRITY is not set 171# CONFIG_BLK_DEV_INTEGRITY is not set
159 172
@@ -186,6 +199,7 @@ CONFIG_MPC85xx=y
186# CONFIG_MPC85xx_DS is not set 199# CONFIG_MPC85xx_DS is not set
187# CONFIG_SOCRATES is not set 200# CONFIG_SOCRATES is not set
188# CONFIG_KSI8560 is not set 201# CONFIG_KSI8560 is not set
202# CONFIG_XES_MPC85xx is not set
189CONFIG_STX_GP3=y 203CONFIG_STX_GP3=y
190# CONFIG_TQM8540 is not set 204# CONFIG_TQM8540 is not set
191# CONFIG_TQM8541 is not set 205# CONFIG_TQM8541 is not set
@@ -234,6 +248,7 @@ CONFIG_BINFMT_ELF=y
234CONFIG_BINFMT_MISC=m 248CONFIG_BINFMT_MISC=m
235CONFIG_MATH_EMULATION=y 249CONFIG_MATH_EMULATION=y
236# CONFIG_IOMMU_HELPER is not set 250# CONFIG_IOMMU_HELPER is not set
251# CONFIG_SWIOTLB is not set
237CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y 252CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
238CONFIG_ARCH_HAS_WALK_MEMORY=y 253CONFIG_ARCH_HAS_WALK_MEMORY=y
239CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y 254CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y
@@ -252,9 +267,9 @@ CONFIG_MIGRATION=y
252CONFIG_ZONE_DMA_FLAG=1 267CONFIG_ZONE_DMA_FLAG=1
253CONFIG_BOUNCE=y 268CONFIG_BOUNCE=y
254CONFIG_VIRT_TO_BUS=y 269CONFIG_VIRT_TO_BUS=y
255CONFIG_UNEVICTABLE_LRU=y
256CONFIG_HAVE_MLOCK=y 270CONFIG_HAVE_MLOCK=y
257CONFIG_HAVE_MLOCKED_PAGE_BIT=y 271CONFIG_HAVE_MLOCKED_PAGE_BIT=y
272CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
258CONFIG_PPC_4K_PAGES=y 273CONFIG_PPC_4K_PAGES=y
259# CONFIG_PPC_16K_PAGES is not set 274# CONFIG_PPC_16K_PAGES is not set
260# CONFIG_PPC_64K_PAGES is not set 275# CONFIG_PPC_64K_PAGES is not set
@@ -425,6 +440,7 @@ CONFIG_IP_NF_FILTER=m
425# CONFIG_ECONET is not set 440# CONFIG_ECONET is not set
426# CONFIG_WAN_ROUTER is not set 441# CONFIG_WAN_ROUTER is not set
427# CONFIG_PHONET is not set 442# CONFIG_PHONET is not set
443# CONFIG_IEEE802154 is not set
428# CONFIG_NET_SCHED is not set 444# CONFIG_NET_SCHED is not set
429# CONFIG_DCB is not set 445# CONFIG_DCB is not set
430 446
@@ -442,7 +458,11 @@ CONFIG_WIRELESS=y
442CONFIG_WIRELESS_OLD_REGULATORY=y 458CONFIG_WIRELESS_OLD_REGULATORY=y
443# CONFIG_WIRELESS_EXT is not set 459# CONFIG_WIRELESS_EXT is not set
444# CONFIG_LIB80211 is not set 460# CONFIG_LIB80211 is not set
445# CONFIG_MAC80211 is not set 461
462#
463# CFG80211 needs to be enabled for MAC80211
464#
465CONFIG_MAC80211_DEFAULT_PS_VALUE=0
446# CONFIG_WIMAX is not set 466# CONFIG_WIMAX is not set
447# CONFIG_RFKILL is not set 467# CONFIG_RFKILL is not set
448# CONFIG_NET_9P is not set 468# CONFIG_NET_9P is not set
@@ -466,6 +486,7 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y
466CONFIG_OF_DEVICE=y 486CONFIG_OF_DEVICE=y
467CONFIG_OF_GPIO=y 487CONFIG_OF_GPIO=y
468CONFIG_OF_I2C=m 488CONFIG_OF_I2C=m
489CONFIG_OF_MDIO=y
469CONFIG_PARPORT=m 490CONFIG_PARPORT=m
470CONFIG_PARPORT_PC=m 491CONFIG_PARPORT_PC=m
471# CONFIG_PARPORT_PC_FIFO is not set 492# CONFIG_PARPORT_PC_FIFO is not set
@@ -507,7 +528,9 @@ CONFIG_MISC_DEVICES=y
507# 528#
508# CONFIG_EEPROM_AT24 is not set 529# CONFIG_EEPROM_AT24 is not set
509# CONFIG_EEPROM_LEGACY is not set 530# CONFIG_EEPROM_LEGACY is not set
531# CONFIG_EEPROM_MAX6875 is not set
510# CONFIG_EEPROM_93CX6 is not set 532# CONFIG_EEPROM_93CX6 is not set
533# CONFIG_CB710_CORE is not set
511CONFIG_HAVE_IDE=y 534CONFIG_HAVE_IDE=y
512CONFIG_IDE=y 535CONFIG_IDE=y
513 536
@@ -581,10 +604,6 @@ CONFIG_BLK_DEV_SR=m
581# CONFIG_BLK_DEV_SR_VENDOR is not set 604# CONFIG_BLK_DEV_SR_VENDOR is not set
582CONFIG_CHR_DEV_SG=m 605CONFIG_CHR_DEV_SG=m
583# CONFIG_CHR_DEV_SCH is not set 606# CONFIG_CHR_DEV_SCH is not set
584
585#
586# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
587#
588CONFIG_SCSI_MULTI_LUN=y 607CONFIG_SCSI_MULTI_LUN=y
589CONFIG_SCSI_CONSTANTS=y 608CONFIG_SCSI_CONSTANTS=y
590# CONFIG_SCSI_LOGGING is not set 609# CONFIG_SCSI_LOGGING is not set
@@ -602,6 +621,7 @@ CONFIG_SCSI_WAIT_SCAN=m
602CONFIG_SCSI_LOWLEVEL=y 621CONFIG_SCSI_LOWLEVEL=y
603# CONFIG_ISCSI_TCP is not set 622# CONFIG_ISCSI_TCP is not set
604# CONFIG_SCSI_CXGB3_ISCSI is not set 623# CONFIG_SCSI_CXGB3_ISCSI is not set
624# CONFIG_SCSI_BNX2_ISCSI is not set
605# CONFIG_BLK_DEV_3W_XXXX_RAID is not set 625# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
606# CONFIG_SCSI_3W_9XXX is not set 626# CONFIG_SCSI_3W_9XXX is not set
607# CONFIG_SCSI_ACARD is not set 627# CONFIG_SCSI_ACARD is not set
@@ -610,6 +630,7 @@ CONFIG_SCSI_LOWLEVEL=y
610# CONFIG_SCSI_AIC7XXX_OLD is not set 630# CONFIG_SCSI_AIC7XXX_OLD is not set
611# CONFIG_SCSI_AIC79XX is not set 631# CONFIG_SCSI_AIC79XX is not set
612# CONFIG_SCSI_AIC94XX is not set 632# CONFIG_SCSI_AIC94XX is not set
633# CONFIG_SCSI_MVSAS is not set
613# CONFIG_SCSI_DPT_I2O is not set 634# CONFIG_SCSI_DPT_I2O is not set
614# CONFIG_SCSI_ADVANSYS is not set 635# CONFIG_SCSI_ADVANSYS is not set
615# CONFIG_SCSI_ARCMSR is not set 636# CONFIG_SCSI_ARCMSR is not set
@@ -631,7 +652,6 @@ CONFIG_SCSI_LOWLEVEL=y
631# CONFIG_SCSI_INIA100 is not set 652# CONFIG_SCSI_INIA100 is not set
632# CONFIG_SCSI_PPA is not set 653# CONFIG_SCSI_PPA is not set
633# CONFIG_SCSI_IMM is not set 654# CONFIG_SCSI_IMM is not set
634# CONFIG_SCSI_MVSAS is not set
635# CONFIG_SCSI_STEX is not set 655# CONFIG_SCSI_STEX is not set
636# CONFIG_SCSI_SYM53C8XX_2 is not set 656# CONFIG_SCSI_SYM53C8XX_2 is not set
637# CONFIG_SCSI_QLOGIC_1280 is not set 657# CONFIG_SCSI_QLOGIC_1280 is not set
@@ -654,14 +674,17 @@ CONFIG_SCSI_LOWLEVEL=y
654# 674#
655 675
656# 676#
657# Enable only one of the two stacks, unless you know what you are doing 677# You can enable one or both FireWire driver stacks.
678#
679
680#
681# See the help texts for more information.
658# 682#
659# CONFIG_FIREWIRE is not set 683# CONFIG_FIREWIRE is not set
660# CONFIG_IEEE1394 is not set 684# CONFIG_IEEE1394 is not set
661# CONFIG_I2O is not set 685# CONFIG_I2O is not set
662# CONFIG_MACINTOSH_DRIVERS is not set 686# CONFIG_MACINTOSH_DRIVERS is not set
663CONFIG_NETDEVICES=y 687CONFIG_NETDEVICES=y
664CONFIG_COMPAT_NET_DEV_OPS=y
665# CONFIG_DUMMY is not set 688# CONFIG_DUMMY is not set
666# CONFIG_BONDING is not set 689# CONFIG_BONDING is not set
667# CONFIG_MACVLAN is not set 690# CONFIG_MACVLAN is not set
@@ -708,6 +731,7 @@ CONFIG_NET_ETHERNET=y
708# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set 731# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
709# CONFIG_NET_PCI is not set 732# CONFIG_NET_PCI is not set
710# CONFIG_B44 is not set 733# CONFIG_B44 is not set
734# CONFIG_KS8842 is not set
711# CONFIG_NET_POCKET is not set 735# CONFIG_NET_POCKET is not set
712# CONFIG_ATL2 is not set 736# CONFIG_ATL2 is not set
713# CONFIG_FS_ENET is not set 737# CONFIG_FS_ENET is not set
@@ -729,8 +753,10 @@ CONFIG_NETDEV_1000=y
729# CONFIG_VIA_VELOCITY is not set 753# CONFIG_VIA_VELOCITY is not set
730# CONFIG_TIGON3 is not set 754# CONFIG_TIGON3 is not set
731# CONFIG_BNX2 is not set 755# CONFIG_BNX2 is not set
756# CONFIG_CNIC is not set
732CONFIG_FSL_PQ_MDIO=y 757CONFIG_FSL_PQ_MDIO=y
733CONFIG_GIANFAR=y 758CONFIG_GIANFAR=y
759# CONFIG_MV643XX_ETH is not set
734# CONFIG_QLA3XXX is not set 760# CONFIG_QLA3XXX is not set
735# CONFIG_ATL1 is not set 761# CONFIG_ATL1 is not set
736# CONFIG_ATL1E is not set 762# CONFIG_ATL1E is not set
@@ -802,12 +828,13 @@ CONFIG_INPUT_EVDEV=m
802# 828#
803CONFIG_INPUT_KEYBOARD=y 829CONFIG_INPUT_KEYBOARD=y
804CONFIG_KEYBOARD_ATKBD=y 830CONFIG_KEYBOARD_ATKBD=y
805# CONFIG_KEYBOARD_SUNKBD is not set
806# CONFIG_KEYBOARD_LKKBD is not set 831# CONFIG_KEYBOARD_LKKBD is not set
807# CONFIG_KEYBOARD_XTKBD is not set 832# CONFIG_KEYBOARD_GPIO is not set
833# CONFIG_KEYBOARD_MATRIX is not set
808# CONFIG_KEYBOARD_NEWTON is not set 834# CONFIG_KEYBOARD_NEWTON is not set
809# CONFIG_KEYBOARD_STOWAWAY is not set 835# CONFIG_KEYBOARD_STOWAWAY is not set
810# CONFIG_KEYBOARD_GPIO is not set 836# CONFIG_KEYBOARD_SUNKBD is not set
837# CONFIG_KEYBOARD_XTKBD is not set
811CONFIG_INPUT_MOUSE=y 838CONFIG_INPUT_MOUSE=y
812CONFIG_MOUSE_PS2=y 839CONFIG_MOUSE_PS2=y
813CONFIG_MOUSE_PS2_ALPS=y 840CONFIG_MOUSE_PS2_ALPS=y
@@ -821,6 +848,7 @@ CONFIG_MOUSE_PS2_TRACKPOINT=y
821# CONFIG_MOUSE_BCM5974 is not set 848# CONFIG_MOUSE_BCM5974 is not set
822# CONFIG_MOUSE_VSXXXAA is not set 849# CONFIG_MOUSE_VSXXXAA is not set
823# CONFIG_MOUSE_GPIO is not set 850# CONFIG_MOUSE_GPIO is not set
851# CONFIG_MOUSE_SYNAPTICS_I2C is not set
824# CONFIG_INPUT_JOYSTICK is not set 852# CONFIG_INPUT_JOYSTICK is not set
825# CONFIG_INPUT_TABLET is not set 853# CONFIG_INPUT_TABLET is not set
826# CONFIG_INPUT_TOUCHSCREEN is not set 854# CONFIG_INPUT_TOUCHSCREEN is not set
@@ -911,6 +939,7 @@ CONFIG_I2C_ALGOBIT=m
911# I2C system bus drivers (mostly embedded / system-on-chip) 939# I2C system bus drivers (mostly embedded / system-on-chip)
912# 940#
913# CONFIG_I2C_CPM is not set 941# CONFIG_I2C_CPM is not set
942# CONFIG_I2C_DESIGNWARE is not set
914# CONFIG_I2C_GPIO is not set 943# CONFIG_I2C_GPIO is not set
915# CONFIG_I2C_MPC is not set 944# CONFIG_I2C_MPC is not set
916# CONFIG_I2C_OCORES is not set 945# CONFIG_I2C_OCORES is not set
@@ -941,13 +970,17 @@ CONFIG_I2C_ALGOBIT=m
941# CONFIG_SENSORS_PCF8574 is not set 970# CONFIG_SENSORS_PCF8574 is not set
942# CONFIG_PCF8575 is not set 971# CONFIG_PCF8575 is not set
943# CONFIG_SENSORS_PCA9539 is not set 972# CONFIG_SENSORS_PCA9539 is not set
944# CONFIG_SENSORS_MAX6875 is not set
945# CONFIG_SENSORS_TSL2550 is not set 973# CONFIG_SENSORS_TSL2550 is not set
946# CONFIG_I2C_DEBUG_CORE is not set 974# CONFIG_I2C_DEBUG_CORE is not set
947# CONFIG_I2C_DEBUG_ALGO is not set 975# CONFIG_I2C_DEBUG_ALGO is not set
948# CONFIG_I2C_DEBUG_BUS is not set 976# CONFIG_I2C_DEBUG_BUS is not set
949# CONFIG_I2C_DEBUG_CHIP is not set 977# CONFIG_I2C_DEBUG_CHIP is not set
950# CONFIG_SPI is not set 978# CONFIG_SPI is not set
979
980#
981# PPS support
982#
983# CONFIG_PPS is not set
951CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y 984CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
952CONFIG_ARCH_REQUIRE_GPIOLIB=y 985CONFIG_ARCH_REQUIRE_GPIOLIB=y
953CONFIG_GPIOLIB=y 986CONFIG_GPIOLIB=y
@@ -1027,6 +1060,7 @@ CONFIG_HWMON=y
1027# CONFIG_SENSORS_SMSC47B397 is not set 1060# CONFIG_SENSORS_SMSC47B397 is not set
1028# CONFIG_SENSORS_ADS7828 is not set 1061# CONFIG_SENSORS_ADS7828 is not set
1029# CONFIG_SENSORS_THMC50 is not set 1062# CONFIG_SENSORS_THMC50 is not set
1063# CONFIG_SENSORS_TMP401 is not set
1030# CONFIG_SENSORS_VIA686A is not set 1064# CONFIG_SENSORS_VIA686A is not set
1031# CONFIG_SENSORS_VT1211 is not set 1065# CONFIG_SENSORS_VT1211 is not set
1032# CONFIG_SENSORS_VT8231 is not set 1066# CONFIG_SENSORS_VT8231 is not set
@@ -1060,23 +1094,9 @@ CONFIG_SSB_POSSIBLE=y
1060# CONFIG_MFD_WM8400 is not set 1094# CONFIG_MFD_WM8400 is not set
1061# CONFIG_MFD_WM8350_I2C is not set 1095# CONFIG_MFD_WM8350_I2C is not set
1062# CONFIG_MFD_PCF50633 is not set 1096# CONFIG_MFD_PCF50633 is not set
1097# CONFIG_AB3100_CORE is not set
1063# CONFIG_REGULATOR is not set 1098# CONFIG_REGULATOR is not set
1064 1099# CONFIG_MEDIA_SUPPORT is not set
1065#
1066# Multimedia devices
1067#
1068
1069#
1070# Multimedia core support
1071#
1072# CONFIG_VIDEO_DEV is not set
1073# CONFIG_DVB_CORE is not set
1074# CONFIG_VIDEO_MEDIA is not set
1075
1076#
1077# Multimedia drivers
1078#
1079CONFIG_DAB=y
1080 1100
1081# 1101#
1082# Graphics support 1102# Graphics support
@@ -1143,6 +1163,10 @@ CONFIG_USB_ARCH_HAS_EHCI=y
1143# CONFIG_DMADEVICES is not set 1163# CONFIG_DMADEVICES is not set
1144# CONFIG_AUXDISPLAY is not set 1164# CONFIG_AUXDISPLAY is not set
1145# CONFIG_UIO is not set 1165# CONFIG_UIO is not set
1166
1167#
1168# TI VLYNQ
1169#
1146# CONFIG_STAGING is not set 1170# CONFIG_STAGING is not set
1147 1171
1148# 1172#
@@ -1162,10 +1186,12 @@ CONFIG_FS_MBCACHE=y
1162# CONFIG_REISERFS_FS is not set 1186# CONFIG_REISERFS_FS is not set
1163# CONFIG_JFS_FS is not set 1187# CONFIG_JFS_FS is not set
1164# CONFIG_FS_POSIX_ACL is not set 1188# CONFIG_FS_POSIX_ACL is not set
1165CONFIG_FILE_LOCKING=y
1166# CONFIG_XFS_FS is not set 1189# CONFIG_XFS_FS is not set
1190# CONFIG_GFS2_FS is not set
1167# CONFIG_OCFS2_FS is not set 1191# CONFIG_OCFS2_FS is not set
1168# CONFIG_BTRFS_FS is not set 1192# CONFIG_BTRFS_FS is not set
1193CONFIG_FILE_LOCKING=y
1194CONFIG_FSNOTIFY=y
1169CONFIG_DNOTIFY=y 1195CONFIG_DNOTIFY=y
1170CONFIG_INOTIFY=y 1196CONFIG_INOTIFY=y
1171CONFIG_INOTIFY_USER=y 1197CONFIG_INOTIFY_USER=y
@@ -1316,6 +1342,7 @@ CONFIG_HAS_IOPORT=y
1316CONFIG_HAS_DMA=y 1342CONFIG_HAS_DMA=y
1317CONFIG_HAVE_LMB=y 1343CONFIG_HAVE_LMB=y
1318CONFIG_NLATTR=y 1344CONFIG_NLATTR=y
1345CONFIG_GENERIC_ATOMIC64=y
1319 1346
1320# 1347#
1321# Kernel hacking 1348# Kernel hacking
@@ -1346,6 +1373,9 @@ CONFIG_SCHED_DEBUG=y
1346# CONFIG_RT_MUTEX_TESTER is not set 1373# CONFIG_RT_MUTEX_TESTER is not set
1347# CONFIG_DEBUG_SPINLOCK is not set 1374# CONFIG_DEBUG_SPINLOCK is not set
1348# CONFIG_DEBUG_MUTEXES is not set 1375# CONFIG_DEBUG_MUTEXES is not set
1376# CONFIG_DEBUG_LOCK_ALLOC is not set
1377# CONFIG_PROVE_LOCKING is not set
1378# CONFIG_LOCK_STAT is not set
1349# CONFIG_DEBUG_SPINLOCK_SLEEP is not set 1379# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
1350# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set 1380# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
1351# CONFIG_DEBUG_KOBJECT is not set 1381# CONFIG_DEBUG_KOBJECT is not set
@@ -1358,7 +1388,6 @@ CONFIG_SCHED_DEBUG=y
1358# CONFIG_DEBUG_LIST is not set 1388# CONFIG_DEBUG_LIST is not set
1359# CONFIG_DEBUG_SG is not set 1389# CONFIG_DEBUG_SG is not set
1360# CONFIG_DEBUG_NOTIFIERS is not set 1390# CONFIG_DEBUG_NOTIFIERS is not set
1361# CONFIG_BOOT_PRINTK_DELAY is not set
1362# CONFIG_RCU_TORTURE_TEST is not set 1391# CONFIG_RCU_TORTURE_TEST is not set
1363# CONFIG_RCU_CPU_STALL_DETECTOR is not set 1392# CONFIG_RCU_CPU_STALL_DETECTOR is not set
1364# CONFIG_BACKTRACE_SELF_TEST is not set 1393# CONFIG_BACKTRACE_SELF_TEST is not set
@@ -1372,16 +1401,15 @@ CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
1372CONFIG_HAVE_DYNAMIC_FTRACE=y 1401CONFIG_HAVE_DYNAMIC_FTRACE=y
1373CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y 1402CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
1374CONFIG_TRACING_SUPPORT=y 1403CONFIG_TRACING_SUPPORT=y
1375 1404CONFIG_FTRACE=y
1376#
1377# Tracers
1378#
1379# CONFIG_FUNCTION_TRACER is not set 1405# CONFIG_FUNCTION_TRACER is not set
1406# CONFIG_IRQSOFF_TRACER is not set
1380# CONFIG_SCHED_TRACER is not set 1407# CONFIG_SCHED_TRACER is not set
1381# CONFIG_CONTEXT_SWITCH_TRACER is not set 1408# CONFIG_ENABLE_DEFAULT_TRACERS is not set
1382# CONFIG_EVENT_TRACER is not set
1383# CONFIG_BOOT_TRACER is not set 1409# CONFIG_BOOT_TRACER is not set
1384# CONFIG_TRACE_BRANCH_PROFILING is not set 1410CONFIG_BRANCH_PROFILE_NONE=y
1411# CONFIG_PROFILE_ANNOTATED_BRANCHES is not set
1412# CONFIG_PROFILE_ALL_BRANCHES is not set
1385# CONFIG_STACK_TRACER is not set 1413# CONFIG_STACK_TRACER is not set
1386# CONFIG_KMEMTRACE is not set 1414# CONFIG_KMEMTRACE is not set
1387# CONFIG_WORKQUEUE_TRACER is not set 1415# CONFIG_WORKQUEUE_TRACER is not set
@@ -1389,6 +1417,9 @@ CONFIG_TRACING_SUPPORT=y
1389# CONFIG_SAMPLES is not set 1417# CONFIG_SAMPLES is not set
1390CONFIG_HAVE_ARCH_KGDB=y 1418CONFIG_HAVE_ARCH_KGDB=y
1391# CONFIG_KGDB is not set 1419# CONFIG_KGDB is not set
1420# CONFIG_KMEMCHECK is not set
1421# CONFIG_PPC_DISABLE_WERROR is not set
1422CONFIG_PPC_WERROR=y
1392CONFIG_PRINT_STACK_DEPTH=64 1423CONFIG_PRINT_STACK_DEPTH=64
1393# CONFIG_DEBUG_STACKOVERFLOW is not set 1424# CONFIG_DEBUG_STACKOVERFLOW is not set
1394# CONFIG_DEBUG_STACK_USAGE is not set 1425# CONFIG_DEBUG_STACK_USAGE is not set
diff --git a/arch/powerpc/configs/85xx/tqm8540_defconfig b/arch/powerpc/configs/85xx/tqm8540_defconfig
index 767600145fb2..2c407523aad2 100644
--- a/arch/powerpc/configs/85xx/tqm8540_defconfig
+++ b/arch/powerpc/configs/85xx/tqm8540_defconfig
@@ -1,14 +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.30-rc3 3# Linux kernel version: 2.6.31-rc4
4# Wed May 13 17:22:23 2009 4# Wed Jul 29 23:32:21 2009
5# 5#
6# CONFIG_PPC64 is not set 6# CONFIG_PPC64 is not set
7 7
8# 8#
9# Processor support 9# Processor support
10# 10#
11# CONFIG_6xx is not set 11# CONFIG_PPC_BOOK3S_32 is not set
12CONFIG_PPC_85xx=y 12CONFIG_PPC_85xx=y
13# CONFIG_PPC_8xx is not set 13# CONFIG_PPC_8xx is not set
14# CONFIG_40x is not set 14# CONFIG_40x is not set
@@ -34,15 +34,16 @@ CONFIG_GENERIC_TIME=y
34CONFIG_GENERIC_TIME_VSYSCALL=y 34CONFIG_GENERIC_TIME_VSYSCALL=y
35CONFIG_GENERIC_CLOCKEVENTS=y 35CONFIG_GENERIC_CLOCKEVENTS=y
36CONFIG_GENERIC_HARDIRQS=y 36CONFIG_GENERIC_HARDIRQS=y
37CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
37# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set 38# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set
38CONFIG_IRQ_PER_CPU=y 39CONFIG_IRQ_PER_CPU=y
39CONFIG_STACKTRACE_SUPPORT=y 40CONFIG_STACKTRACE_SUPPORT=y
40CONFIG_HAVE_LATENCYTOP_SUPPORT=y 41CONFIG_HAVE_LATENCYTOP_SUPPORT=y
42CONFIG_TRACE_IRQFLAGS_SUPPORT=y
41CONFIG_LOCKDEP_SUPPORT=y 43CONFIG_LOCKDEP_SUPPORT=y
42CONFIG_RWSEM_XCHGADD_ALGORITHM=y 44CONFIG_RWSEM_XCHGADD_ALGORITHM=y
43CONFIG_ARCH_HAS_ILOG2_U32=y 45CONFIG_ARCH_HAS_ILOG2_U32=y
44CONFIG_GENERIC_HWEIGHT=y 46CONFIG_GENERIC_HWEIGHT=y
45CONFIG_GENERIC_CALIBRATE_DELAY=y
46CONFIG_GENERIC_FIND_NEXT_BIT=y 47CONFIG_GENERIC_FIND_NEXT_BIT=y
47# CONFIG_ARCH_NO_VIRT_TO_BUS is not set 48# CONFIG_ARCH_NO_VIRT_TO_BUS is not set
48CONFIG_PPC=y 49CONFIG_PPC=y
@@ -56,11 +57,13 @@ CONFIG_PPC_UDBG_16550=y
56# CONFIG_GENERIC_TBSYNC is not set 57# CONFIG_GENERIC_TBSYNC is not set
57CONFIG_AUDIT_ARCH=y 58CONFIG_AUDIT_ARCH=y
58CONFIG_GENERIC_BUG=y 59CONFIG_GENERIC_BUG=y
60CONFIG_DTC=y
59CONFIG_DEFAULT_UIMAGE=y 61CONFIG_DEFAULT_UIMAGE=y
60# CONFIG_PPC_DCR_NATIVE is not set 62# CONFIG_PPC_DCR_NATIVE is not set
61# CONFIG_PPC_DCR_MMIO is not set 63# CONFIG_PPC_DCR_MMIO is not set
62CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y 64CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y
63CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" 65CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
66CONFIG_CONSTRUCTORS=y
64 67
65# 68#
66# General setup 69# General setup
@@ -109,7 +112,6 @@ CONFIG_ANON_INODES=y
109CONFIG_EMBEDDED=y 112CONFIG_EMBEDDED=y
110CONFIG_SYSCTL_SYSCALL=y 113CONFIG_SYSCTL_SYSCALL=y
111# CONFIG_KALLSYMS is not set 114# CONFIG_KALLSYMS is not set
112# CONFIG_STRIP_ASM_SYMS is not set
113# CONFIG_HOTPLUG is not set 115# CONFIG_HOTPLUG is not set
114CONFIG_PRINTK=y 116CONFIG_PRINTK=y
115CONFIG_BUG=y 117CONFIG_BUG=y
@@ -122,9 +124,16 @@ CONFIG_TIMERFD=y
122CONFIG_EVENTFD=y 124CONFIG_EVENTFD=y
123CONFIG_SHMEM=y 125CONFIG_SHMEM=y
124CONFIG_AIO=y 126CONFIG_AIO=y
127CONFIG_HAVE_PERF_COUNTERS=y
128
129#
130# Performance Counters
131#
132# CONFIG_PERF_COUNTERS is not set
125CONFIG_VM_EVENT_COUNTERS=y 133CONFIG_VM_EVENT_COUNTERS=y
126CONFIG_PCI_QUIRKS=y 134CONFIG_PCI_QUIRKS=y
127CONFIG_SLUB_DEBUG=y 135CONFIG_SLUB_DEBUG=y
136# CONFIG_STRIP_ASM_SYMS is not set
128CONFIG_COMPAT_BRK=y 137CONFIG_COMPAT_BRK=y
129# CONFIG_SLAB is not set 138# CONFIG_SLAB is not set
130CONFIG_SLUB=y 139CONFIG_SLUB=y
@@ -137,6 +146,10 @@ CONFIG_HAVE_IOREMAP_PROT=y
137CONFIG_HAVE_KPROBES=y 146CONFIG_HAVE_KPROBES=y
138CONFIG_HAVE_KRETPROBES=y 147CONFIG_HAVE_KRETPROBES=y
139CONFIG_HAVE_ARCH_TRACEHOOK=y 148CONFIG_HAVE_ARCH_TRACEHOOK=y
149
150#
151# GCOV-based kernel profiling
152#
140# CONFIG_SLOW_WORK is not set 153# CONFIG_SLOW_WORK is not set
141# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set 154# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
142CONFIG_SLABINFO=y 155CONFIG_SLABINFO=y
@@ -144,7 +157,7 @@ CONFIG_RT_MUTEXES=y
144CONFIG_BASE_SMALL=0 157CONFIG_BASE_SMALL=0
145# CONFIG_MODULES is not set 158# CONFIG_MODULES is not set
146CONFIG_BLOCK=y 159CONFIG_BLOCK=y
147# CONFIG_LBD is not set 160CONFIG_LBDAF=y
148# CONFIG_BLK_DEV_BSG is not set 161# CONFIG_BLK_DEV_BSG is not set
149# CONFIG_BLK_DEV_INTEGRITY is not set 162# CONFIG_BLK_DEV_INTEGRITY is not set
150 163
@@ -177,6 +190,7 @@ CONFIG_MPC85xx=y
177# CONFIG_MPC85xx_DS is not set 190# CONFIG_MPC85xx_DS is not set
178# CONFIG_SOCRATES is not set 191# CONFIG_SOCRATES is not set
179# CONFIG_KSI8560 is not set 192# CONFIG_KSI8560 is not set
193# CONFIG_XES_MPC85xx is not set
180# CONFIG_STX_GP3 is not set 194# CONFIG_STX_GP3 is not set
181CONFIG_TQM8540=y 195CONFIG_TQM8540=y
182# CONFIG_TQM8541 is not set 196# CONFIG_TQM8541 is not set
@@ -225,6 +239,7 @@ CONFIG_BINFMT_ELF=y
225# CONFIG_BINFMT_MISC is not set 239# CONFIG_BINFMT_MISC is not set
226CONFIG_MATH_EMULATION=y 240CONFIG_MATH_EMULATION=y
227# CONFIG_IOMMU_HELPER is not set 241# CONFIG_IOMMU_HELPER is not set
242# CONFIG_SWIOTLB is not set
228CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y 243CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
229CONFIG_ARCH_HAS_WALK_MEMORY=y 244CONFIG_ARCH_HAS_WALK_MEMORY=y
230CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y 245CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y
@@ -243,9 +258,9 @@ CONFIG_MIGRATION=y
243CONFIG_ZONE_DMA_FLAG=1 258CONFIG_ZONE_DMA_FLAG=1
244CONFIG_BOUNCE=y 259CONFIG_BOUNCE=y
245CONFIG_VIRT_TO_BUS=y 260CONFIG_VIRT_TO_BUS=y
246CONFIG_UNEVICTABLE_LRU=y
247CONFIG_HAVE_MLOCK=y 261CONFIG_HAVE_MLOCK=y
248CONFIG_HAVE_MLOCKED_PAGE_BIT=y 262CONFIG_HAVE_MLOCKED_PAGE_BIT=y
263CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
249CONFIG_PPC_4K_PAGES=y 264CONFIG_PPC_4K_PAGES=y
250# CONFIG_PPC_16K_PAGES is not set 265# CONFIG_PPC_16K_PAGES is not set
251# CONFIG_PPC_64K_PAGES is not set 266# CONFIG_PPC_64K_PAGES is not set
@@ -353,6 +368,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
353# CONFIG_ECONET is not set 368# CONFIG_ECONET is not set
354# CONFIG_WAN_ROUTER is not set 369# CONFIG_WAN_ROUTER is not set
355# CONFIG_PHONET is not set 370# CONFIG_PHONET is not set
371# CONFIG_IEEE802154 is not set
356# CONFIG_NET_SCHED is not set 372# CONFIG_NET_SCHED is not set
357# CONFIG_DCB is not set 373# CONFIG_DCB is not set
358 374
@@ -370,7 +386,11 @@ CONFIG_WIRELESS=y
370CONFIG_WIRELESS_OLD_REGULATORY=y 386CONFIG_WIRELESS_OLD_REGULATORY=y
371# CONFIG_WIRELESS_EXT is not set 387# CONFIG_WIRELESS_EXT is not set
372# CONFIG_LIB80211 is not set 388# CONFIG_LIB80211 is not set
373# CONFIG_MAC80211 is not set 389
390#
391# CFG80211 needs to be enabled for MAC80211
392#
393CONFIG_MAC80211_DEFAULT_PS_VALUE=0
374# CONFIG_WIMAX is not set 394# CONFIG_WIMAX is not set
375# CONFIG_RFKILL is not set 395# CONFIG_RFKILL is not set
376# CONFIG_NET_9P is not set 396# CONFIG_NET_9P is not set
@@ -471,6 +491,7 @@ CONFIG_MTD_CFI_UTIL=y
471# CONFIG_MTD_UBI is not set 491# CONFIG_MTD_UBI is not set
472CONFIG_OF_DEVICE=y 492CONFIG_OF_DEVICE=y
473CONFIG_OF_I2C=y 493CONFIG_OF_I2C=y
494CONFIG_OF_MDIO=y
474# CONFIG_PARPORT is not set 495# CONFIG_PARPORT is not set
475CONFIG_BLK_DEV=y 496CONFIG_BLK_DEV=y
476# CONFIG_BLK_DEV_FD is not set 497# CONFIG_BLK_DEV_FD is not set
@@ -505,7 +526,9 @@ CONFIG_MISC_DEVICES=y
505# 526#
506# CONFIG_EEPROM_AT24 is not set 527# CONFIG_EEPROM_AT24 is not set
507# CONFIG_EEPROM_LEGACY is not set 528# CONFIG_EEPROM_LEGACY is not set
529# CONFIG_EEPROM_MAX6875 is not set
508# CONFIG_EEPROM_93CX6 is not set 530# CONFIG_EEPROM_93CX6 is not set
531# CONFIG_CB710_CORE is not set
509CONFIG_HAVE_IDE=y 532CONFIG_HAVE_IDE=y
510CONFIG_IDE=y 533CONFIG_IDE=y
511 534
@@ -580,14 +603,17 @@ CONFIG_BLK_DEV_IDEDMA=y
580# 603#
581 604
582# 605#
583# Enable only one of the two stacks, unless you know what you are doing 606# You can enable one or both FireWire driver stacks.
607#
608
609#
610# See the help texts for more information.
584# 611#
585# CONFIG_FIREWIRE is not set 612# CONFIG_FIREWIRE is not set
586# CONFIG_IEEE1394 is not set 613# CONFIG_IEEE1394 is not set
587# CONFIG_I2O is not set 614# CONFIG_I2O is not set
588# CONFIG_MACINTOSH_DRIVERS is not set 615# CONFIG_MACINTOSH_DRIVERS is not set
589CONFIG_NETDEVICES=y 616CONFIG_NETDEVICES=y
590CONFIG_COMPAT_NET_DEV_OPS=y
591# CONFIG_DUMMY is not set 617# CONFIG_DUMMY is not set
592# CONFIG_BONDING is not set 618# CONFIG_BONDING is not set
593# CONFIG_MACVLAN is not set 619# CONFIG_MACVLAN is not set
@@ -650,6 +676,7 @@ CONFIG_E100=y
650# CONFIG_SMSC9420 is not set 676# CONFIG_SMSC9420 is not set
651# CONFIG_SUNDANCE is not set 677# CONFIG_SUNDANCE is not set
652# CONFIG_TLAN is not set 678# CONFIG_TLAN is not set
679# CONFIG_KS8842 is not set
653# CONFIG_VIA_RHINE is not set 680# CONFIG_VIA_RHINE is not set
654# CONFIG_SC92031 is not set 681# CONFIG_SC92031 is not set
655# CONFIG_ATL2 is not set 682# CONFIG_ATL2 is not set
@@ -671,8 +698,10 @@ CONFIG_NETDEV_1000=y
671# CONFIG_VIA_VELOCITY is not set 698# CONFIG_VIA_VELOCITY is not set
672# CONFIG_TIGON3 is not set 699# CONFIG_TIGON3 is not set
673# CONFIG_BNX2 is not set 700# CONFIG_BNX2 is not set
701# CONFIG_CNIC is not set
674CONFIG_FSL_PQ_MDIO=y 702CONFIG_FSL_PQ_MDIO=y
675CONFIG_GIANFAR=y 703CONFIG_GIANFAR=y
704# CONFIG_MV643XX_ETH is not set
676# CONFIG_QLA3XXX is not set 705# CONFIG_QLA3XXX is not set
677# CONFIG_ATL1 is not set 706# CONFIG_ATL1 is not set
678# CONFIG_ATL1E is not set 707# CONFIG_ATL1E is not set
@@ -850,13 +879,17 @@ CONFIG_I2C_MPC=y
850# CONFIG_SENSORS_PCF8574 is not set 879# CONFIG_SENSORS_PCF8574 is not set
851# CONFIG_PCF8575 is not set 880# CONFIG_PCF8575 is not set
852# CONFIG_SENSORS_PCA9539 is not set 881# CONFIG_SENSORS_PCA9539 is not set
853# CONFIG_SENSORS_MAX6875 is not set
854# CONFIG_SENSORS_TSL2550 is not set 882# CONFIG_SENSORS_TSL2550 is not set
855# CONFIG_I2C_DEBUG_CORE is not set 883# CONFIG_I2C_DEBUG_CORE is not set
856# CONFIG_I2C_DEBUG_ALGO is not set 884# CONFIG_I2C_DEBUG_ALGO is not set
857# CONFIG_I2C_DEBUG_BUS is not set 885# CONFIG_I2C_DEBUG_BUS is not set
858# CONFIG_I2C_DEBUG_CHIP is not set 886# CONFIG_I2C_DEBUG_CHIP is not set
859# CONFIG_SPI is not set 887# CONFIG_SPI is not set
888
889#
890# PPS support
891#
892# CONFIG_PPS is not set
860CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y 893CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
861# CONFIG_GPIOLIB is not set 894# CONFIG_GPIOLIB is not set
862# CONFIG_W1 is not set 895# CONFIG_W1 is not set
@@ -911,6 +944,7 @@ CONFIG_SENSORS_LM75=y
911# CONFIG_SENSORS_SMSC47B397 is not set 944# CONFIG_SENSORS_SMSC47B397 is not set
912# CONFIG_SENSORS_ADS7828 is not set 945# CONFIG_SENSORS_ADS7828 is not set
913# CONFIG_SENSORS_THMC50 is not set 946# CONFIG_SENSORS_THMC50 is not set
947# CONFIG_SENSORS_TMP401 is not set
914# CONFIG_SENSORS_VIA686A is not set 948# CONFIG_SENSORS_VIA686A is not set
915# CONFIG_SENSORS_VT1211 is not set 949# CONFIG_SENSORS_VT1211 is not set
916# CONFIG_SENSORS_VT8231 is not set 950# CONFIG_SENSORS_VT8231 is not set
@@ -945,23 +979,9 @@ CONFIG_SSB_POSSIBLE=y
945# CONFIG_MFD_WM8400 is not set 979# CONFIG_MFD_WM8400 is not set
946# CONFIG_MFD_WM8350_I2C is not set 980# CONFIG_MFD_WM8350_I2C is not set
947# CONFIG_MFD_PCF50633 is not set 981# CONFIG_MFD_PCF50633 is not set
982# CONFIG_AB3100_CORE is not set
948# CONFIG_REGULATOR is not set 983# CONFIG_REGULATOR is not set
949 984# CONFIG_MEDIA_SUPPORT is not set
950#
951# Multimedia devices
952#
953
954#
955# Multimedia core support
956#
957# CONFIG_VIDEO_DEV is not set
958# CONFIG_DVB_CORE is not set
959# CONFIG_VIDEO_MEDIA is not set
960
961#
962# Multimedia drivers
963#
964CONFIG_DAB=y
965 985
966# 986#
967# Graphics support 987# Graphics support
@@ -1018,6 +1038,10 @@ CONFIG_USB_ARCH_HAS_EHCI=y
1018# CONFIG_DMADEVICES is not set 1038# CONFIG_DMADEVICES is not set
1019# CONFIG_AUXDISPLAY is not set 1039# CONFIG_AUXDISPLAY is not set
1020# CONFIG_UIO is not set 1040# CONFIG_UIO is not set
1041
1042#
1043# TI VLYNQ
1044#
1021# CONFIG_STAGING is not set 1045# CONFIG_STAGING is not set
1022 1046
1023# 1047#
@@ -1037,10 +1061,12 @@ CONFIG_FS_MBCACHE=y
1037# CONFIG_REISERFS_FS is not set 1061# CONFIG_REISERFS_FS is not set
1038# CONFIG_JFS_FS is not set 1062# CONFIG_JFS_FS is not set
1039# CONFIG_FS_POSIX_ACL is not set 1063# CONFIG_FS_POSIX_ACL is not set
1040CONFIG_FILE_LOCKING=y
1041# CONFIG_XFS_FS is not set 1064# CONFIG_XFS_FS is not set
1065# CONFIG_GFS2_FS is not set
1042# CONFIG_OCFS2_FS is not set 1066# CONFIG_OCFS2_FS is not set
1043# CONFIG_BTRFS_FS is not set 1067# CONFIG_BTRFS_FS is not set
1068CONFIG_FILE_LOCKING=y
1069CONFIG_FSNOTIFY=y
1044CONFIG_DNOTIFY=y 1070CONFIG_DNOTIFY=y
1045CONFIG_INOTIFY=y 1071CONFIG_INOTIFY=y
1046CONFIG_INOTIFY_USER=y 1072CONFIG_INOTIFY_USER=y
@@ -1167,6 +1193,7 @@ CONFIG_HAS_IOPORT=y
1167CONFIG_HAS_DMA=y 1193CONFIG_HAS_DMA=y
1168CONFIG_HAVE_LMB=y 1194CONFIG_HAVE_LMB=y
1169CONFIG_NLATTR=y 1195CONFIG_NLATTR=y
1196CONFIG_GENERIC_ATOMIC64=y
1170 1197
1171# 1198#
1172# Kernel hacking 1199# Kernel hacking
@@ -1192,22 +1219,11 @@ CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
1192CONFIG_HAVE_DYNAMIC_FTRACE=y 1219CONFIG_HAVE_DYNAMIC_FTRACE=y
1193CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y 1220CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
1194CONFIG_TRACING_SUPPORT=y 1221CONFIG_TRACING_SUPPORT=y
1195 1222# CONFIG_FTRACE is not set
1196#
1197# Tracers
1198#
1199# CONFIG_FUNCTION_TRACER is not set
1200# CONFIG_SCHED_TRACER is not set
1201# CONFIG_CONTEXT_SWITCH_TRACER is not set
1202# CONFIG_EVENT_TRACER is not set
1203# CONFIG_BOOT_TRACER is not set
1204# CONFIG_TRACE_BRANCH_PROFILING is not set
1205# CONFIG_STACK_TRACER is not set
1206# CONFIG_KMEMTRACE is not set
1207# CONFIG_WORKQUEUE_TRACER is not set
1208# CONFIG_BLK_DEV_IO_TRACE is not set
1209# CONFIG_SAMPLES is not set 1223# CONFIG_SAMPLES is not set
1210CONFIG_HAVE_ARCH_KGDB=y 1224CONFIG_HAVE_ARCH_KGDB=y
1225# CONFIG_PPC_DISABLE_WERROR is not set
1226CONFIG_PPC_WERROR=y
1211CONFIG_PRINT_STACK_DEPTH=64 1227CONFIG_PRINT_STACK_DEPTH=64
1212# CONFIG_IRQSTACKS is not set 1228# CONFIG_IRQSTACKS is not set
1213# CONFIG_PPC_EARLY_DEBUG is not set 1229# CONFIG_PPC_EARLY_DEBUG is not set
diff --git a/arch/powerpc/configs/85xx/tqm8541_defconfig b/arch/powerpc/configs/85xx/tqm8541_defconfig
index 52fafc006dd0..845731dc51c6 100644
--- a/arch/powerpc/configs/85xx/tqm8541_defconfig
+++ b/arch/powerpc/configs/85xx/tqm8541_defconfig
@@ -1,14 +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.30-rc3 3# Linux kernel version: 2.6.31-rc4
4# Wed May 13 17:22:23 2009 4# Wed Jul 29 23:32:22 2009
5# 5#
6# CONFIG_PPC64 is not set 6# CONFIG_PPC64 is not set
7 7
8# 8#
9# Processor support 9# Processor support
10# 10#
11# CONFIG_6xx is not set 11# CONFIG_PPC_BOOK3S_32 is not set
12CONFIG_PPC_85xx=y 12CONFIG_PPC_85xx=y
13# CONFIG_PPC_8xx is not set 13# CONFIG_PPC_8xx is not set
14# CONFIG_40x is not set 14# CONFIG_40x is not set
@@ -34,15 +34,16 @@ CONFIG_GENERIC_TIME=y
34CONFIG_GENERIC_TIME_VSYSCALL=y 34CONFIG_GENERIC_TIME_VSYSCALL=y
35CONFIG_GENERIC_CLOCKEVENTS=y 35CONFIG_GENERIC_CLOCKEVENTS=y
36CONFIG_GENERIC_HARDIRQS=y 36CONFIG_GENERIC_HARDIRQS=y
37CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
37# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set 38# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set
38CONFIG_IRQ_PER_CPU=y 39CONFIG_IRQ_PER_CPU=y
39CONFIG_STACKTRACE_SUPPORT=y 40CONFIG_STACKTRACE_SUPPORT=y
40CONFIG_HAVE_LATENCYTOP_SUPPORT=y 41CONFIG_HAVE_LATENCYTOP_SUPPORT=y
42CONFIG_TRACE_IRQFLAGS_SUPPORT=y
41CONFIG_LOCKDEP_SUPPORT=y 43CONFIG_LOCKDEP_SUPPORT=y
42CONFIG_RWSEM_XCHGADD_ALGORITHM=y 44CONFIG_RWSEM_XCHGADD_ALGORITHM=y
43CONFIG_ARCH_HAS_ILOG2_U32=y 45CONFIG_ARCH_HAS_ILOG2_U32=y
44CONFIG_GENERIC_HWEIGHT=y 46CONFIG_GENERIC_HWEIGHT=y
45CONFIG_GENERIC_CALIBRATE_DELAY=y
46CONFIG_GENERIC_FIND_NEXT_BIT=y 47CONFIG_GENERIC_FIND_NEXT_BIT=y
47CONFIG_GENERIC_GPIO=y 48CONFIG_GENERIC_GPIO=y
48# CONFIG_ARCH_NO_VIRT_TO_BUS is not set 49# CONFIG_ARCH_NO_VIRT_TO_BUS is not set
@@ -57,11 +58,13 @@ CONFIG_PPC_UDBG_16550=y
57# CONFIG_GENERIC_TBSYNC is not set 58# CONFIG_GENERIC_TBSYNC is not set
58CONFIG_AUDIT_ARCH=y 59CONFIG_AUDIT_ARCH=y
59CONFIG_GENERIC_BUG=y 60CONFIG_GENERIC_BUG=y
61CONFIG_DTC=y
60CONFIG_DEFAULT_UIMAGE=y 62CONFIG_DEFAULT_UIMAGE=y
61# CONFIG_PPC_DCR_NATIVE is not set 63# CONFIG_PPC_DCR_NATIVE is not set
62# CONFIG_PPC_DCR_MMIO is not set 64# CONFIG_PPC_DCR_MMIO is not set
63CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y 65CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y
64CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" 66CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
67CONFIG_CONSTRUCTORS=y
65 68
66# 69#
67# General setup 70# General setup
@@ -110,7 +113,6 @@ CONFIG_ANON_INODES=y
110CONFIG_EMBEDDED=y 113CONFIG_EMBEDDED=y
111CONFIG_SYSCTL_SYSCALL=y 114CONFIG_SYSCTL_SYSCALL=y
112# CONFIG_KALLSYMS is not set 115# CONFIG_KALLSYMS is not set
113# CONFIG_STRIP_ASM_SYMS is not set
114# CONFIG_HOTPLUG is not set 116# CONFIG_HOTPLUG is not set
115CONFIG_PRINTK=y 117CONFIG_PRINTK=y
116CONFIG_BUG=y 118CONFIG_BUG=y
@@ -123,9 +125,16 @@ CONFIG_TIMERFD=y
123CONFIG_EVENTFD=y 125CONFIG_EVENTFD=y
124CONFIG_SHMEM=y 126CONFIG_SHMEM=y
125CONFIG_AIO=y 127CONFIG_AIO=y
128CONFIG_HAVE_PERF_COUNTERS=y
129
130#
131# Performance Counters
132#
133# CONFIG_PERF_COUNTERS is not set
126CONFIG_VM_EVENT_COUNTERS=y 134CONFIG_VM_EVENT_COUNTERS=y
127CONFIG_PCI_QUIRKS=y 135CONFIG_PCI_QUIRKS=y
128CONFIG_SLUB_DEBUG=y 136CONFIG_SLUB_DEBUG=y
137# CONFIG_STRIP_ASM_SYMS is not set
129CONFIG_COMPAT_BRK=y 138CONFIG_COMPAT_BRK=y
130# CONFIG_SLAB is not set 139# CONFIG_SLAB is not set
131CONFIG_SLUB=y 140CONFIG_SLUB=y
@@ -139,6 +148,10 @@ CONFIG_HAVE_KPROBES=y
139CONFIG_HAVE_KRETPROBES=y 148CONFIG_HAVE_KRETPROBES=y
140CONFIG_HAVE_ARCH_TRACEHOOK=y 149CONFIG_HAVE_ARCH_TRACEHOOK=y
141CONFIG_HAVE_CLK=y 150CONFIG_HAVE_CLK=y
151
152#
153# GCOV-based kernel profiling
154#
142# CONFIG_SLOW_WORK is not set 155# CONFIG_SLOW_WORK is not set
143# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set 156# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
144CONFIG_SLABINFO=y 157CONFIG_SLABINFO=y
@@ -146,7 +159,7 @@ CONFIG_RT_MUTEXES=y
146CONFIG_BASE_SMALL=0 159CONFIG_BASE_SMALL=0
147# CONFIG_MODULES is not set 160# CONFIG_MODULES is not set
148CONFIG_BLOCK=y 161CONFIG_BLOCK=y
149# CONFIG_LBD is not set 162CONFIG_LBDAF=y
150# CONFIG_BLK_DEV_BSG is not set 163# CONFIG_BLK_DEV_BSG is not set
151# CONFIG_BLK_DEV_INTEGRITY is not set 164# CONFIG_BLK_DEV_INTEGRITY is not set
152 165
@@ -179,6 +192,7 @@ CONFIG_MPC85xx=y
179# CONFIG_MPC85xx_DS is not set 192# CONFIG_MPC85xx_DS is not set
180# CONFIG_SOCRATES is not set 193# CONFIG_SOCRATES is not set
181# CONFIG_KSI8560 is not set 194# CONFIG_KSI8560 is not set
195# CONFIG_XES_MPC85xx is not set
182# CONFIG_STX_GP3 is not set 196# CONFIG_STX_GP3 is not set
183# CONFIG_TQM8540 is not set 197# CONFIG_TQM8540 is not set
184CONFIG_TQM8541=y 198CONFIG_TQM8541=y
@@ -228,6 +242,7 @@ CONFIG_BINFMT_ELF=y
228# CONFIG_BINFMT_MISC is not set 242# CONFIG_BINFMT_MISC is not set
229CONFIG_MATH_EMULATION=y 243CONFIG_MATH_EMULATION=y
230# CONFIG_IOMMU_HELPER is not set 244# CONFIG_IOMMU_HELPER is not set
245# CONFIG_SWIOTLB is not set
231CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y 246CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
232CONFIG_ARCH_HAS_WALK_MEMORY=y 247CONFIG_ARCH_HAS_WALK_MEMORY=y
233CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y 248CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y
@@ -246,9 +261,9 @@ CONFIG_MIGRATION=y
246CONFIG_ZONE_DMA_FLAG=1 261CONFIG_ZONE_DMA_FLAG=1
247CONFIG_BOUNCE=y 262CONFIG_BOUNCE=y
248CONFIG_VIRT_TO_BUS=y 263CONFIG_VIRT_TO_BUS=y
249CONFIG_UNEVICTABLE_LRU=y
250CONFIG_HAVE_MLOCK=y 264CONFIG_HAVE_MLOCK=y
251CONFIG_HAVE_MLOCKED_PAGE_BIT=y 265CONFIG_HAVE_MLOCKED_PAGE_BIT=y
266CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
252CONFIG_PPC_4K_PAGES=y 267CONFIG_PPC_4K_PAGES=y
253# CONFIG_PPC_16K_PAGES is not set 268# CONFIG_PPC_16K_PAGES is not set
254# CONFIG_PPC_64K_PAGES is not set 269# CONFIG_PPC_64K_PAGES is not set
@@ -356,6 +371,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
356# CONFIG_ECONET is not set 371# CONFIG_ECONET is not set
357# CONFIG_WAN_ROUTER is not set 372# CONFIG_WAN_ROUTER is not set
358# CONFIG_PHONET is not set 373# CONFIG_PHONET is not set
374# CONFIG_IEEE802154 is not set
359# CONFIG_NET_SCHED is not set 375# CONFIG_NET_SCHED is not set
360# CONFIG_DCB is not set 376# CONFIG_DCB is not set
361 377
@@ -373,7 +389,11 @@ CONFIG_WIRELESS=y
373CONFIG_WIRELESS_OLD_REGULATORY=y 389CONFIG_WIRELESS_OLD_REGULATORY=y
374# CONFIG_WIRELESS_EXT is not set 390# CONFIG_WIRELESS_EXT is not set
375# CONFIG_LIB80211 is not set 391# CONFIG_LIB80211 is not set
376# CONFIG_MAC80211 is not set 392
393#
394# CFG80211 needs to be enabled for MAC80211
395#
396CONFIG_MAC80211_DEFAULT_PS_VALUE=0
377# CONFIG_WIMAX is not set 397# CONFIG_WIMAX is not set
378# CONFIG_RFKILL is not set 398# CONFIG_RFKILL is not set
379# CONFIG_NET_9P is not set 399# CONFIG_NET_9P is not set
@@ -475,6 +495,7 @@ CONFIG_MTD_CFI_UTIL=y
475CONFIG_OF_DEVICE=y 495CONFIG_OF_DEVICE=y
476CONFIG_OF_GPIO=y 496CONFIG_OF_GPIO=y
477CONFIG_OF_I2C=y 497CONFIG_OF_I2C=y
498CONFIG_OF_MDIO=y
478# CONFIG_PARPORT is not set 499# CONFIG_PARPORT is not set
479CONFIG_BLK_DEV=y 500CONFIG_BLK_DEV=y
480# CONFIG_BLK_DEV_FD is not set 501# CONFIG_BLK_DEV_FD is not set
@@ -509,7 +530,9 @@ CONFIG_MISC_DEVICES=y
509# 530#
510# CONFIG_EEPROM_AT24 is not set 531# CONFIG_EEPROM_AT24 is not set
511# CONFIG_EEPROM_LEGACY is not set 532# CONFIG_EEPROM_LEGACY is not set
533# CONFIG_EEPROM_MAX6875 is not set
512# CONFIG_EEPROM_93CX6 is not set 534# CONFIG_EEPROM_93CX6 is not set
535# CONFIG_CB710_CORE is not set
513CONFIG_HAVE_IDE=y 536CONFIG_HAVE_IDE=y
514CONFIG_IDE=y 537CONFIG_IDE=y
515 538
@@ -584,14 +607,17 @@ CONFIG_BLK_DEV_IDEDMA=y
584# 607#
585 608
586# 609#
587# Enable only one of the two stacks, unless you know what you are doing 610# You can enable one or both FireWire driver stacks.
611#
612
613#
614# See the help texts for more information.
588# 615#
589# CONFIG_FIREWIRE is not set 616# CONFIG_FIREWIRE is not set
590# CONFIG_IEEE1394 is not set 617# CONFIG_IEEE1394 is not set
591# CONFIG_I2O is not set 618# CONFIG_I2O is not set
592# CONFIG_MACINTOSH_DRIVERS is not set 619# CONFIG_MACINTOSH_DRIVERS is not set
593CONFIG_NETDEVICES=y 620CONFIG_NETDEVICES=y
594CONFIG_COMPAT_NET_DEV_OPS=y
595# CONFIG_DUMMY is not set 621# CONFIG_DUMMY is not set
596# CONFIG_BONDING is not set 622# CONFIG_BONDING is not set
597# CONFIG_MACVLAN is not set 623# CONFIG_MACVLAN is not set
@@ -654,6 +680,7 @@ CONFIG_E100=y
654# CONFIG_SMSC9420 is not set 680# CONFIG_SMSC9420 is not set
655# CONFIG_SUNDANCE is not set 681# CONFIG_SUNDANCE is not set
656# CONFIG_TLAN is not set 682# CONFIG_TLAN is not set
683# CONFIG_KS8842 is not set
657# CONFIG_VIA_RHINE is not set 684# CONFIG_VIA_RHINE is not set
658# CONFIG_SC92031 is not set 685# CONFIG_SC92031 is not set
659# CONFIG_ATL2 is not set 686# CONFIG_ATL2 is not set
@@ -676,8 +703,10 @@ CONFIG_NETDEV_1000=y
676# CONFIG_VIA_VELOCITY is not set 703# CONFIG_VIA_VELOCITY is not set
677# CONFIG_TIGON3 is not set 704# CONFIG_TIGON3 is not set
678# CONFIG_BNX2 is not set 705# CONFIG_BNX2 is not set
706# CONFIG_CNIC is not set
679CONFIG_FSL_PQ_MDIO=y 707CONFIG_FSL_PQ_MDIO=y
680CONFIG_GIANFAR=y 708CONFIG_GIANFAR=y
709# CONFIG_MV643XX_ETH is not set
681# CONFIG_QLA3XXX is not set 710# CONFIG_QLA3XXX is not set
682# CONFIG_ATL1 is not set 711# CONFIG_ATL1 is not set
683# CONFIG_ATL1E is not set 712# CONFIG_ATL1E is not set
@@ -831,6 +860,7 @@ CONFIG_I2C_HELPER_AUTO=y
831# I2C system bus drivers (mostly embedded / system-on-chip) 860# I2C system bus drivers (mostly embedded / system-on-chip)
832# 861#
833# CONFIG_I2C_CPM is not set 862# CONFIG_I2C_CPM is not set
863# CONFIG_I2C_DESIGNWARE is not set
834# CONFIG_I2C_GPIO is not set 864# CONFIG_I2C_GPIO is not set
835CONFIG_I2C_MPC=y 865CONFIG_I2C_MPC=y
836# CONFIG_I2C_OCORES is not set 866# CONFIG_I2C_OCORES is not set
@@ -859,13 +889,17 @@ CONFIG_I2C_MPC=y
859# CONFIG_SENSORS_PCF8574 is not set 889# CONFIG_SENSORS_PCF8574 is not set
860# CONFIG_PCF8575 is not set 890# CONFIG_PCF8575 is not set
861# CONFIG_SENSORS_PCA9539 is not set 891# CONFIG_SENSORS_PCA9539 is not set
862# CONFIG_SENSORS_MAX6875 is not set
863# CONFIG_SENSORS_TSL2550 is not set 892# CONFIG_SENSORS_TSL2550 is not set
864# CONFIG_I2C_DEBUG_CORE is not set 893# CONFIG_I2C_DEBUG_CORE is not set
865# CONFIG_I2C_DEBUG_ALGO is not set 894# CONFIG_I2C_DEBUG_ALGO is not set
866# CONFIG_I2C_DEBUG_BUS is not set 895# CONFIG_I2C_DEBUG_BUS is not set
867# CONFIG_I2C_DEBUG_CHIP is not set 896# CONFIG_I2C_DEBUG_CHIP is not set
868# CONFIG_SPI is not set 897# CONFIG_SPI is not set
898
899#
900# PPS support
901#
902# CONFIG_PPS is not set
869CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y 903CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
870CONFIG_ARCH_REQUIRE_GPIOLIB=y 904CONFIG_ARCH_REQUIRE_GPIOLIB=y
871CONFIG_GPIOLIB=y 905CONFIG_GPIOLIB=y
@@ -944,6 +978,7 @@ CONFIG_SENSORS_LM75=y
944# CONFIG_SENSORS_SMSC47B397 is not set 978# CONFIG_SENSORS_SMSC47B397 is not set
945# CONFIG_SENSORS_ADS7828 is not set 979# CONFIG_SENSORS_ADS7828 is not set
946# CONFIG_SENSORS_THMC50 is not set 980# CONFIG_SENSORS_THMC50 is not set
981# CONFIG_SENSORS_TMP401 is not set
947# CONFIG_SENSORS_VIA686A is not set 982# CONFIG_SENSORS_VIA686A is not set
948# CONFIG_SENSORS_VT1211 is not set 983# CONFIG_SENSORS_VT1211 is not set
949# CONFIG_SENSORS_VT8231 is not set 984# CONFIG_SENSORS_VT8231 is not set
@@ -979,23 +1014,9 @@ CONFIG_SSB_POSSIBLE=y
979# CONFIG_MFD_WM8400 is not set 1014# CONFIG_MFD_WM8400 is not set
980# CONFIG_MFD_WM8350_I2C is not set 1015# CONFIG_MFD_WM8350_I2C is not set
981# CONFIG_MFD_PCF50633 is not set 1016# CONFIG_MFD_PCF50633 is not set
1017# CONFIG_AB3100_CORE is not set
982# CONFIG_REGULATOR is not set 1018# CONFIG_REGULATOR is not set
983 1019# CONFIG_MEDIA_SUPPORT is not set
984#
985# Multimedia devices
986#
987
988#
989# Multimedia core support
990#
991# CONFIG_VIDEO_DEV is not set
992# CONFIG_DVB_CORE is not set
993# CONFIG_VIDEO_MEDIA is not set
994
995#
996# Multimedia drivers
997#
998CONFIG_DAB=y
999 1020
1000# 1021#
1001# Graphics support 1022# Graphics support
@@ -1052,6 +1073,10 @@ CONFIG_USB_ARCH_HAS_EHCI=y
1052# CONFIG_DMADEVICES is not set 1073# CONFIG_DMADEVICES is not set
1053# CONFIG_AUXDISPLAY is not set 1074# CONFIG_AUXDISPLAY is not set
1054# CONFIG_UIO is not set 1075# CONFIG_UIO is not set
1076
1077#
1078# TI VLYNQ
1079#
1055# CONFIG_STAGING is not set 1080# CONFIG_STAGING is not set
1056 1081
1057# 1082#
@@ -1071,10 +1096,12 @@ CONFIG_FS_MBCACHE=y
1071# CONFIG_REISERFS_FS is not set 1096# CONFIG_REISERFS_FS is not set
1072# CONFIG_JFS_FS is not set 1097# CONFIG_JFS_FS is not set
1073# CONFIG_FS_POSIX_ACL is not set 1098# CONFIG_FS_POSIX_ACL is not set
1074CONFIG_FILE_LOCKING=y
1075# CONFIG_XFS_FS is not set 1099# CONFIG_XFS_FS is not set
1100# CONFIG_GFS2_FS is not set
1076# CONFIG_OCFS2_FS is not set 1101# CONFIG_OCFS2_FS is not set
1077# CONFIG_BTRFS_FS is not set 1102# CONFIG_BTRFS_FS is not set
1103CONFIG_FILE_LOCKING=y
1104CONFIG_FSNOTIFY=y
1078CONFIG_DNOTIFY=y 1105CONFIG_DNOTIFY=y
1079CONFIG_INOTIFY=y 1106CONFIG_INOTIFY=y
1080CONFIG_INOTIFY_USER=y 1107CONFIG_INOTIFY_USER=y
@@ -1201,6 +1228,7 @@ CONFIG_HAS_IOPORT=y
1201CONFIG_HAS_DMA=y 1228CONFIG_HAS_DMA=y
1202CONFIG_HAVE_LMB=y 1229CONFIG_HAVE_LMB=y
1203CONFIG_NLATTR=y 1230CONFIG_NLATTR=y
1231CONFIG_GENERIC_ATOMIC64=y
1204 1232
1205# 1233#
1206# Kernel hacking 1234# Kernel hacking
@@ -1226,22 +1254,11 @@ CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
1226CONFIG_HAVE_DYNAMIC_FTRACE=y 1254CONFIG_HAVE_DYNAMIC_FTRACE=y
1227CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y 1255CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
1228CONFIG_TRACING_SUPPORT=y 1256CONFIG_TRACING_SUPPORT=y
1229 1257# CONFIG_FTRACE is not set
1230#
1231# Tracers
1232#
1233# CONFIG_FUNCTION_TRACER is not set
1234# CONFIG_SCHED_TRACER is not set
1235# CONFIG_CONTEXT_SWITCH_TRACER is not set
1236# CONFIG_EVENT_TRACER is not set
1237# CONFIG_BOOT_TRACER is not set
1238# CONFIG_TRACE_BRANCH_PROFILING is not set
1239# CONFIG_STACK_TRACER is not set
1240# CONFIG_KMEMTRACE is not set
1241# CONFIG_WORKQUEUE_TRACER is not set
1242# CONFIG_BLK_DEV_IO_TRACE is not set
1243# CONFIG_SAMPLES is not set 1258# CONFIG_SAMPLES is not set
1244CONFIG_HAVE_ARCH_KGDB=y 1259CONFIG_HAVE_ARCH_KGDB=y
1260# CONFIG_PPC_DISABLE_WERROR is not set
1261CONFIG_PPC_WERROR=y
1245CONFIG_PRINT_STACK_DEPTH=64 1262CONFIG_PRINT_STACK_DEPTH=64
1246# CONFIG_IRQSTACKS is not set 1263# CONFIG_IRQSTACKS is not set
1247# CONFIG_PPC_EARLY_DEBUG is not set 1264# CONFIG_PPC_EARLY_DEBUG is not set
diff --git a/arch/powerpc/configs/85xx/tqm8548_defconfig b/arch/powerpc/configs/85xx/tqm8548_defconfig
index 8b4faae7a9a1..4f228a905274 100644
--- a/arch/powerpc/configs/85xx/tqm8548_defconfig
+++ b/arch/powerpc/configs/85xx/tqm8548_defconfig
@@ -1,14 +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.30-rc3 3# Linux kernel version: 2.6.31-rc4
4# Wed May 13 17:22:24 2009 4# Wed Jul 29 23:32:23 2009
5# 5#
6# CONFIG_PPC64 is not set 6# CONFIG_PPC64 is not set
7 7
8# 8#
9# Processor support 9# Processor support
10# 10#
11# CONFIG_6xx is not set 11# CONFIG_PPC_BOOK3S_32 is not set
12CONFIG_PPC_85xx=y 12CONFIG_PPC_85xx=y
13# CONFIG_PPC_8xx is not set 13# CONFIG_PPC_8xx is not set
14# CONFIG_40x is not set 14# CONFIG_40x is not set
@@ -34,15 +34,16 @@ CONFIG_GENERIC_TIME=y
34CONFIG_GENERIC_TIME_VSYSCALL=y 34CONFIG_GENERIC_TIME_VSYSCALL=y
35CONFIG_GENERIC_CLOCKEVENTS=y 35CONFIG_GENERIC_CLOCKEVENTS=y
36CONFIG_GENERIC_HARDIRQS=y 36CONFIG_GENERIC_HARDIRQS=y
37CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
37# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set 38# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set
38CONFIG_IRQ_PER_CPU=y 39CONFIG_IRQ_PER_CPU=y
39CONFIG_STACKTRACE_SUPPORT=y 40CONFIG_STACKTRACE_SUPPORT=y
40CONFIG_HAVE_LATENCYTOP_SUPPORT=y 41CONFIG_HAVE_LATENCYTOP_SUPPORT=y
42CONFIG_TRACE_IRQFLAGS_SUPPORT=y
41CONFIG_LOCKDEP_SUPPORT=y 43CONFIG_LOCKDEP_SUPPORT=y
42CONFIG_RWSEM_XCHGADD_ALGORITHM=y 44CONFIG_RWSEM_XCHGADD_ALGORITHM=y
43CONFIG_ARCH_HAS_ILOG2_U32=y 45CONFIG_ARCH_HAS_ILOG2_U32=y
44CONFIG_GENERIC_HWEIGHT=y 46CONFIG_GENERIC_HWEIGHT=y
45CONFIG_GENERIC_CALIBRATE_DELAY=y
46CONFIG_GENERIC_FIND_NEXT_BIT=y 47CONFIG_GENERIC_FIND_NEXT_BIT=y
47# CONFIG_ARCH_NO_VIRT_TO_BUS is not set 48# CONFIG_ARCH_NO_VIRT_TO_BUS is not set
48CONFIG_PPC=y 49CONFIG_PPC=y
@@ -56,11 +57,13 @@ CONFIG_PPC_UDBG_16550=y
56# CONFIG_GENERIC_TBSYNC is not set 57# CONFIG_GENERIC_TBSYNC is not set
57CONFIG_AUDIT_ARCH=y 58CONFIG_AUDIT_ARCH=y
58CONFIG_GENERIC_BUG=y 59CONFIG_GENERIC_BUG=y
60CONFIG_DTC=y
59CONFIG_DEFAULT_UIMAGE=y 61CONFIG_DEFAULT_UIMAGE=y
60# CONFIG_PPC_DCR_NATIVE is not set 62# CONFIG_PPC_DCR_NATIVE is not set
61# CONFIG_PPC_DCR_MMIO is not set 63# CONFIG_PPC_DCR_MMIO is not set
62CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y 64CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y
63CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" 65CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
66CONFIG_CONSTRUCTORS=y
64 67
65# 68#
66# General setup 69# General setup
@@ -111,7 +114,6 @@ CONFIG_SYSCTL_SYSCALL=y
111CONFIG_KALLSYMS=y 114CONFIG_KALLSYMS=y
112# CONFIG_KALLSYMS_ALL is not set 115# CONFIG_KALLSYMS_ALL is not set
113# CONFIG_KALLSYMS_EXTRA_PASS is not set 116# CONFIG_KALLSYMS_EXTRA_PASS is not set
114# CONFIG_STRIP_ASM_SYMS is not set
115CONFIG_HOTPLUG=y 117CONFIG_HOTPLUG=y
116CONFIG_PRINTK=y 118CONFIG_PRINTK=y
117CONFIG_BUG=y 119CONFIG_BUG=y
@@ -124,9 +126,16 @@ CONFIG_TIMERFD=y
124CONFIG_EVENTFD=y 126CONFIG_EVENTFD=y
125CONFIG_SHMEM=y 127CONFIG_SHMEM=y
126CONFIG_AIO=y 128CONFIG_AIO=y
129CONFIG_HAVE_PERF_COUNTERS=y
130
131#
132# Performance Counters
133#
134# CONFIG_PERF_COUNTERS is not set
127CONFIG_VM_EVENT_COUNTERS=y 135CONFIG_VM_EVENT_COUNTERS=y
128CONFIG_PCI_QUIRKS=y 136CONFIG_PCI_QUIRKS=y
129CONFIG_SLUB_DEBUG=y 137CONFIG_SLUB_DEBUG=y
138# CONFIG_STRIP_ASM_SYMS is not set
130CONFIG_COMPAT_BRK=y 139CONFIG_COMPAT_BRK=y
131# CONFIG_SLAB is not set 140# CONFIG_SLAB is not set
132CONFIG_SLUB=y 141CONFIG_SLUB=y
@@ -140,6 +149,10 @@ CONFIG_HAVE_IOREMAP_PROT=y
140CONFIG_HAVE_KPROBES=y 149CONFIG_HAVE_KPROBES=y
141CONFIG_HAVE_KRETPROBES=y 150CONFIG_HAVE_KRETPROBES=y
142CONFIG_HAVE_ARCH_TRACEHOOK=y 151CONFIG_HAVE_ARCH_TRACEHOOK=y
152
153#
154# GCOV-based kernel profiling
155#
143# CONFIG_SLOW_WORK is not set 156# CONFIG_SLOW_WORK is not set
144# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set 157# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
145CONFIG_SLABINFO=y 158CONFIG_SLABINFO=y
@@ -152,7 +165,7 @@ CONFIG_MODULE_UNLOAD=y
152# CONFIG_MODVERSIONS is not set 165# CONFIG_MODVERSIONS is not set
153# CONFIG_MODULE_SRCVERSION_ALL is not set 166# CONFIG_MODULE_SRCVERSION_ALL is not set
154CONFIG_BLOCK=y 167CONFIG_BLOCK=y
155# CONFIG_LBD is not set 168CONFIG_LBDAF=y
156# CONFIG_BLK_DEV_BSG is not set 169# CONFIG_BLK_DEV_BSG is not set
157# CONFIG_BLK_DEV_INTEGRITY is not set 170# CONFIG_BLK_DEV_INTEGRITY is not set
158 171
@@ -185,6 +198,7 @@ CONFIG_MPC85xx=y
185# CONFIG_MPC85xx_DS is not set 198# CONFIG_MPC85xx_DS is not set
186# CONFIG_SOCRATES is not set 199# CONFIG_SOCRATES is not set
187# CONFIG_KSI8560 is not set 200# CONFIG_KSI8560 is not set
201# CONFIG_XES_MPC85xx is not set
188# CONFIG_STX_GP3 is not set 202# CONFIG_STX_GP3 is not set
189# CONFIG_TQM8540 is not set 203# CONFIG_TQM8540 is not set
190# CONFIG_TQM8541 is not set 204# CONFIG_TQM8541 is not set
@@ -234,6 +248,7 @@ CONFIG_BINFMT_ELF=y
234CONFIG_BINFMT_MISC=y 248CONFIG_BINFMT_MISC=y
235CONFIG_MATH_EMULATION=y 249CONFIG_MATH_EMULATION=y
236# CONFIG_IOMMU_HELPER is not set 250# CONFIG_IOMMU_HELPER is not set
251# CONFIG_SWIOTLB is not set
237CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y 252CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
238CONFIG_ARCH_HAS_WALK_MEMORY=y 253CONFIG_ARCH_HAS_WALK_MEMORY=y
239CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y 254CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y
@@ -252,9 +267,9 @@ CONFIG_MIGRATION=y
252CONFIG_ZONE_DMA_FLAG=1 267CONFIG_ZONE_DMA_FLAG=1
253CONFIG_BOUNCE=y 268CONFIG_BOUNCE=y
254CONFIG_VIRT_TO_BUS=y 269CONFIG_VIRT_TO_BUS=y
255CONFIG_UNEVICTABLE_LRU=y
256CONFIG_HAVE_MLOCK=y 270CONFIG_HAVE_MLOCK=y
257CONFIG_HAVE_MLOCKED_PAGE_BIT=y 271CONFIG_HAVE_MLOCKED_PAGE_BIT=y
272CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
258CONFIG_PPC_4K_PAGES=y 273CONFIG_PPC_4K_PAGES=y
259# CONFIG_PPC_16K_PAGES is not set 274# CONFIG_PPC_16K_PAGES is not set
260# CONFIG_PPC_64K_PAGES is not set 275# CONFIG_PPC_64K_PAGES is not set
@@ -281,6 +296,8 @@ CONFIG_PCI_DOMAINS=y
281CONFIG_PCI_SYSCALL=y 296CONFIG_PCI_SYSCALL=y
282CONFIG_PCIEPORTBUS=y 297CONFIG_PCIEPORTBUS=y
283CONFIG_PCIEAER=y 298CONFIG_PCIEAER=y
299# CONFIG_PCIE_ECRC is not set
300# CONFIG_PCIEAER_INJECT is not set
284# CONFIG_PCIEASPM is not set 301# CONFIG_PCIEASPM is not set
285CONFIG_ARCH_SUPPORTS_MSI=y 302CONFIG_ARCH_SUPPORTS_MSI=y
286# CONFIG_PCI_MSI is not set 303# CONFIG_PCI_MSI is not set
@@ -368,6 +385,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
368# CONFIG_ECONET is not set 385# CONFIG_ECONET is not set
369# CONFIG_WAN_ROUTER is not set 386# CONFIG_WAN_ROUTER is not set
370# CONFIG_PHONET is not set 387# CONFIG_PHONET is not set
388# CONFIG_IEEE802154 is not set
371# CONFIG_NET_SCHED is not set 389# CONFIG_NET_SCHED is not set
372# CONFIG_DCB is not set 390# CONFIG_DCB is not set
373 391
@@ -497,6 +515,7 @@ CONFIG_MTD_NAND_FSL_UPM=y
497# CONFIG_MTD_UBI is not set 515# CONFIG_MTD_UBI is not set
498CONFIG_OF_DEVICE=y 516CONFIG_OF_DEVICE=y
499CONFIG_OF_I2C=y 517CONFIG_OF_I2C=y
518CONFIG_OF_MDIO=y
500# CONFIG_PARPORT is not set 519# CONFIG_PARPORT is not set
501CONFIG_BLK_DEV=y 520CONFIG_BLK_DEV=y
502# CONFIG_BLK_DEV_FD is not set 521# CONFIG_BLK_DEV_FD is not set
@@ -531,7 +550,9 @@ CONFIG_MISC_DEVICES=y
531# 550#
532# CONFIG_EEPROM_AT24 is not set 551# CONFIG_EEPROM_AT24 is not set
533# CONFIG_EEPROM_LEGACY is not set 552# CONFIG_EEPROM_LEGACY is not set
553# CONFIG_EEPROM_MAX6875 is not set
534# CONFIG_EEPROM_93CX6 is not set 554# CONFIG_EEPROM_93CX6 is not set
555# CONFIG_CB710_CORE is not set
535CONFIG_HAVE_IDE=y 556CONFIG_HAVE_IDE=y
536# CONFIG_IDE is not set 557# CONFIG_IDE is not set
537 558
@@ -551,14 +572,17 @@ CONFIG_HAVE_IDE=y
551# 572#
552 573
553# 574#
554# Enable only one of the two stacks, unless you know what you are doing 575# You can enable one or both FireWire driver stacks.
576#
577
578#
579# See the help texts for more information.
555# 580#
556# CONFIG_FIREWIRE is not set 581# CONFIG_FIREWIRE is not set
557# CONFIG_IEEE1394 is not set 582# CONFIG_IEEE1394 is not set
558# CONFIG_I2O is not set 583# CONFIG_I2O is not set
559# CONFIG_MACINTOSH_DRIVERS is not set 584# CONFIG_MACINTOSH_DRIVERS is not set
560CONFIG_NETDEVICES=y 585CONFIG_NETDEVICES=y
561CONFIG_COMPAT_NET_DEV_OPS=y
562# CONFIG_DUMMY is not set 586# CONFIG_DUMMY is not set
563# CONFIG_BONDING is not set 587# CONFIG_BONDING is not set
564# CONFIG_MACVLAN is not set 588# CONFIG_MACVLAN is not set
@@ -605,6 +629,7 @@ CONFIG_MII=y
605# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set 629# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
606# CONFIG_NET_PCI is not set 630# CONFIG_NET_PCI is not set
607# CONFIG_B44 is not set 631# CONFIG_B44 is not set
632# CONFIG_KS8842 is not set
608# CONFIG_ATL2 is not set 633# CONFIG_ATL2 is not set
609CONFIG_NETDEV_1000=y 634CONFIG_NETDEV_1000=y
610# CONFIG_ACENIC is not set 635# CONFIG_ACENIC is not set
@@ -624,8 +649,10 @@ CONFIG_NETDEV_1000=y
624# CONFIG_VIA_VELOCITY is not set 649# CONFIG_VIA_VELOCITY is not set
625# CONFIG_TIGON3 is not set 650# CONFIG_TIGON3 is not set
626# CONFIG_BNX2 is not set 651# CONFIG_BNX2 is not set
652# CONFIG_CNIC is not set
627CONFIG_FSL_PQ_MDIO=y 653CONFIG_FSL_PQ_MDIO=y
628CONFIG_GIANFAR=y 654CONFIG_GIANFAR=y
655# CONFIG_MV643XX_ETH is not set
629# CONFIG_QLA3XXX is not set 656# CONFIG_QLA3XXX is not set
630# CONFIG_ATL1 is not set 657# CONFIG_ATL1 is not set
631# CONFIG_ATL1E is not set 658# CONFIG_ATL1E is not set
@@ -801,13 +828,17 @@ CONFIG_I2C_MPC=y
801# CONFIG_SENSORS_PCF8574 is not set 828# CONFIG_SENSORS_PCF8574 is not set
802# CONFIG_PCF8575 is not set 829# CONFIG_PCF8575 is not set
803# CONFIG_SENSORS_PCA9539 is not set 830# CONFIG_SENSORS_PCA9539 is not set
804# CONFIG_SENSORS_MAX6875 is not set
805# CONFIG_SENSORS_TSL2550 is not set 831# CONFIG_SENSORS_TSL2550 is not set
806# CONFIG_I2C_DEBUG_CORE is not set 832# CONFIG_I2C_DEBUG_CORE is not set
807# CONFIG_I2C_DEBUG_ALGO is not set 833# CONFIG_I2C_DEBUG_ALGO is not set
808# CONFIG_I2C_DEBUG_BUS is not set 834# CONFIG_I2C_DEBUG_BUS is not set
809# CONFIG_I2C_DEBUG_CHIP is not set 835# CONFIG_I2C_DEBUG_CHIP is not set
810# CONFIG_SPI is not set 836# CONFIG_SPI is not set
837
838#
839# PPS support
840#
841# CONFIG_PPS is not set
811CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y 842CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
812# CONFIG_GPIOLIB is not set 843# CONFIG_GPIOLIB is not set
813# CONFIG_W1 is not set 844# CONFIG_W1 is not set
@@ -862,6 +893,7 @@ CONFIG_SENSORS_LM75=y
862# CONFIG_SENSORS_SMSC47B397 is not set 893# CONFIG_SENSORS_SMSC47B397 is not set
863# CONFIG_SENSORS_ADS7828 is not set 894# CONFIG_SENSORS_ADS7828 is not set
864# CONFIG_SENSORS_THMC50 is not set 895# CONFIG_SENSORS_THMC50 is not set
896# CONFIG_SENSORS_TMP401 is not set
865# CONFIG_SENSORS_VIA686A is not set 897# CONFIG_SENSORS_VIA686A is not set
866# CONFIG_SENSORS_VT1211 is not set 898# CONFIG_SENSORS_VT1211 is not set
867# CONFIG_SENSORS_VT8231 is not set 899# CONFIG_SENSORS_VT8231 is not set
@@ -896,23 +928,9 @@ CONFIG_SSB_POSSIBLE=y
896# CONFIG_MFD_WM8400 is not set 928# CONFIG_MFD_WM8400 is not set
897# CONFIG_MFD_WM8350_I2C is not set 929# CONFIG_MFD_WM8350_I2C is not set
898# CONFIG_MFD_PCF50633 is not set 930# CONFIG_MFD_PCF50633 is not set
931# CONFIG_AB3100_CORE is not set
899# CONFIG_REGULATOR is not set 932# CONFIG_REGULATOR is not set
900 933# CONFIG_MEDIA_SUPPORT is not set
901#
902# Multimedia devices
903#
904
905#
906# Multimedia core support
907#
908# CONFIG_VIDEO_DEV is not set
909# CONFIG_DVB_CORE is not set
910# CONFIG_VIDEO_MEDIA is not set
911
912#
913# Multimedia drivers
914#
915CONFIG_DAB=y
916 934
917# 935#
918# Graphics support 936# Graphics support
@@ -977,6 +995,7 @@ CONFIG_RTC_DRV_DS1307=y
977# CONFIG_RTC_DRV_S35390A is not set 995# CONFIG_RTC_DRV_S35390A is not set
978# CONFIG_RTC_DRV_FM3130 is not set 996# CONFIG_RTC_DRV_FM3130 is not set
979# CONFIG_RTC_DRV_RX8581 is not set 997# CONFIG_RTC_DRV_RX8581 is not set
998# CONFIG_RTC_DRV_RX8025 is not set
980 999
981# 1000#
982# SPI RTC drivers 1001# SPI RTC drivers
@@ -1004,6 +1023,10 @@ CONFIG_RTC_DRV_DS1307=y
1004# CONFIG_DMADEVICES is not set 1023# CONFIG_DMADEVICES is not set
1005# CONFIG_AUXDISPLAY is not set 1024# CONFIG_AUXDISPLAY is not set
1006# CONFIG_UIO is not set 1025# CONFIG_UIO is not set
1026
1027#
1028# TI VLYNQ
1029#
1007# CONFIG_STAGING is not set 1030# CONFIG_STAGING is not set
1008 1031
1009# 1032#
@@ -1015,10 +1038,12 @@ CONFIG_RTC_DRV_DS1307=y
1015# CONFIG_REISERFS_FS is not set 1038# CONFIG_REISERFS_FS is not set
1016# CONFIG_JFS_FS is not set 1039# CONFIG_JFS_FS is not set
1017# CONFIG_FS_POSIX_ACL is not set 1040# CONFIG_FS_POSIX_ACL is not set
1018CONFIG_FILE_LOCKING=y
1019# CONFIG_XFS_FS is not set 1041# CONFIG_XFS_FS is not set
1042# CONFIG_GFS2_FS is not set
1020# CONFIG_OCFS2_FS is not set 1043# CONFIG_OCFS2_FS is not set
1021# CONFIG_BTRFS_FS is not set 1044# CONFIG_BTRFS_FS is not set
1045CONFIG_FILE_LOCKING=y
1046CONFIG_FSNOTIFY=y
1022CONFIG_DNOTIFY=y 1047CONFIG_DNOTIFY=y
1023CONFIG_INOTIFY=y 1048CONFIG_INOTIFY=y
1024CONFIG_INOTIFY_USER=y 1049CONFIG_INOTIFY_USER=y
@@ -1145,6 +1170,7 @@ CONFIG_HAS_IOPORT=y
1145CONFIG_HAS_DMA=y 1170CONFIG_HAS_DMA=y
1146CONFIG_HAVE_LMB=y 1171CONFIG_HAVE_LMB=y
1147CONFIG_NLATTR=y 1172CONFIG_NLATTR=y
1173CONFIG_GENERIC_ATOMIC64=y
1148 1174
1149# 1175#
1150# Kernel hacking 1176# Kernel hacking
@@ -1175,6 +1201,9 @@ CONFIG_SCHED_DEBUG=y
1175# CONFIG_RT_MUTEX_TESTER is not set 1201# CONFIG_RT_MUTEX_TESTER is not set
1176# CONFIG_DEBUG_SPINLOCK is not set 1202# CONFIG_DEBUG_SPINLOCK is not set
1177CONFIG_DEBUG_MUTEXES=y 1203CONFIG_DEBUG_MUTEXES=y
1204# CONFIG_DEBUG_LOCK_ALLOC is not set
1205# CONFIG_PROVE_LOCKING is not set
1206# CONFIG_LOCK_STAT is not set
1178# CONFIG_DEBUG_SPINLOCK_SLEEP is not set 1207# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
1179# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set 1208# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
1180# CONFIG_DEBUG_KOBJECT is not set 1209# CONFIG_DEBUG_KOBJECT is not set
@@ -1187,7 +1216,6 @@ CONFIG_DEBUG_MUTEXES=y
1187# CONFIG_DEBUG_LIST is not set 1216# CONFIG_DEBUG_LIST is not set
1188# CONFIG_DEBUG_SG is not set 1217# CONFIG_DEBUG_SG is not set
1189# CONFIG_DEBUG_NOTIFIERS is not set 1218# CONFIG_DEBUG_NOTIFIERS is not set
1190# CONFIG_BOOT_PRINTK_DELAY is not set
1191# CONFIG_RCU_TORTURE_TEST is not set 1219# CONFIG_RCU_TORTURE_TEST is not set
1192# CONFIG_RCU_CPU_STALL_DETECTOR is not set 1220# CONFIG_RCU_CPU_STALL_DETECTOR is not set
1193# CONFIG_BACKTRACE_SELF_TEST is not set 1221# CONFIG_BACKTRACE_SELF_TEST is not set
@@ -1201,16 +1229,15 @@ CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
1201CONFIG_HAVE_DYNAMIC_FTRACE=y 1229CONFIG_HAVE_DYNAMIC_FTRACE=y
1202CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y 1230CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
1203CONFIG_TRACING_SUPPORT=y 1231CONFIG_TRACING_SUPPORT=y
1204 1232CONFIG_FTRACE=y
1205#
1206# Tracers
1207#
1208# CONFIG_FUNCTION_TRACER is not set 1233# CONFIG_FUNCTION_TRACER is not set
1234# CONFIG_IRQSOFF_TRACER is not set
1209# CONFIG_SCHED_TRACER is not set 1235# CONFIG_SCHED_TRACER is not set
1210# CONFIG_CONTEXT_SWITCH_TRACER is not set 1236# CONFIG_ENABLE_DEFAULT_TRACERS is not set
1211# CONFIG_EVENT_TRACER is not set
1212# CONFIG_BOOT_TRACER is not set 1237# CONFIG_BOOT_TRACER is not set
1213# CONFIG_TRACE_BRANCH_PROFILING is not set 1238CONFIG_BRANCH_PROFILE_NONE=y
1239# CONFIG_PROFILE_ANNOTATED_BRANCHES is not set
1240# CONFIG_PROFILE_ALL_BRANCHES is not set
1214# CONFIG_STACK_TRACER is not set 1241# CONFIG_STACK_TRACER is not set
1215# CONFIG_KMEMTRACE is not set 1242# CONFIG_KMEMTRACE is not set
1216# CONFIG_WORKQUEUE_TRACER is not set 1243# CONFIG_WORKQUEUE_TRACER is not set
@@ -1218,6 +1245,9 @@ CONFIG_TRACING_SUPPORT=y
1218# CONFIG_SAMPLES is not set 1245# CONFIG_SAMPLES is not set
1219CONFIG_HAVE_ARCH_KGDB=y 1246CONFIG_HAVE_ARCH_KGDB=y
1220# CONFIG_KGDB is not set 1247# CONFIG_KGDB is not set
1248# CONFIG_KMEMCHECK is not set
1249# CONFIG_PPC_DISABLE_WERROR is not set
1250CONFIG_PPC_WERROR=y
1221CONFIG_PRINT_STACK_DEPTH=64 1251CONFIG_PRINT_STACK_DEPTH=64
1222# CONFIG_DEBUG_STACKOVERFLOW is not set 1252# CONFIG_DEBUG_STACKOVERFLOW is not set
1223# CONFIG_DEBUG_STACK_USAGE is not set 1253# CONFIG_DEBUG_STACK_USAGE is not set
diff --git a/arch/powerpc/configs/85xx/tqm8555_defconfig b/arch/powerpc/configs/85xx/tqm8555_defconfig
index 170360934cec..9196724bebc7 100644
--- a/arch/powerpc/configs/85xx/tqm8555_defconfig
+++ b/arch/powerpc/configs/85xx/tqm8555_defconfig
@@ -1,14 +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.30-rc3 3# Linux kernel version: 2.6.31-rc4
4# Wed May 13 17:22:25 2009 4# Wed Jul 29 23:32:24 2009
5# 5#
6# CONFIG_PPC64 is not set 6# CONFIG_PPC64 is not set
7 7
8# 8#
9# Processor support 9# Processor support
10# 10#
11# CONFIG_6xx is not set 11# CONFIG_PPC_BOOK3S_32 is not set
12CONFIG_PPC_85xx=y 12CONFIG_PPC_85xx=y
13# CONFIG_PPC_8xx is not set 13# CONFIG_PPC_8xx is not set
14# CONFIG_40x is not set 14# CONFIG_40x is not set
@@ -34,15 +34,16 @@ CONFIG_GENERIC_TIME=y
34CONFIG_GENERIC_TIME_VSYSCALL=y 34CONFIG_GENERIC_TIME_VSYSCALL=y
35CONFIG_GENERIC_CLOCKEVENTS=y 35CONFIG_GENERIC_CLOCKEVENTS=y
36CONFIG_GENERIC_HARDIRQS=y 36CONFIG_GENERIC_HARDIRQS=y
37CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
37# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set 38# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set
38CONFIG_IRQ_PER_CPU=y 39CONFIG_IRQ_PER_CPU=y
39CONFIG_STACKTRACE_SUPPORT=y 40CONFIG_STACKTRACE_SUPPORT=y
40CONFIG_HAVE_LATENCYTOP_SUPPORT=y 41CONFIG_HAVE_LATENCYTOP_SUPPORT=y
42CONFIG_TRACE_IRQFLAGS_SUPPORT=y
41CONFIG_LOCKDEP_SUPPORT=y 43CONFIG_LOCKDEP_SUPPORT=y
42CONFIG_RWSEM_XCHGADD_ALGORITHM=y 44CONFIG_RWSEM_XCHGADD_ALGORITHM=y
43CONFIG_ARCH_HAS_ILOG2_U32=y 45CONFIG_ARCH_HAS_ILOG2_U32=y
44CONFIG_GENERIC_HWEIGHT=y 46CONFIG_GENERIC_HWEIGHT=y
45CONFIG_GENERIC_CALIBRATE_DELAY=y
46CONFIG_GENERIC_FIND_NEXT_BIT=y 47CONFIG_GENERIC_FIND_NEXT_BIT=y
47CONFIG_GENERIC_GPIO=y 48CONFIG_GENERIC_GPIO=y
48# CONFIG_ARCH_NO_VIRT_TO_BUS is not set 49# CONFIG_ARCH_NO_VIRT_TO_BUS is not set
@@ -57,11 +58,13 @@ CONFIG_PPC_UDBG_16550=y
57# CONFIG_GENERIC_TBSYNC is not set 58# CONFIG_GENERIC_TBSYNC is not set
58CONFIG_AUDIT_ARCH=y 59CONFIG_AUDIT_ARCH=y
59CONFIG_GENERIC_BUG=y 60CONFIG_GENERIC_BUG=y
61CONFIG_DTC=y
60CONFIG_DEFAULT_UIMAGE=y 62CONFIG_DEFAULT_UIMAGE=y
61# CONFIG_PPC_DCR_NATIVE is not set 63# CONFIG_PPC_DCR_NATIVE is not set
62# CONFIG_PPC_DCR_MMIO is not set 64# CONFIG_PPC_DCR_MMIO is not set
63CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y 65CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y
64CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" 66CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
67CONFIG_CONSTRUCTORS=y
65 68
66# 69#
67# General setup 70# General setup
@@ -110,7 +113,6 @@ CONFIG_ANON_INODES=y
110CONFIG_EMBEDDED=y 113CONFIG_EMBEDDED=y
111CONFIG_SYSCTL_SYSCALL=y 114CONFIG_SYSCTL_SYSCALL=y
112# CONFIG_KALLSYMS is not set 115# CONFIG_KALLSYMS is not set
113# CONFIG_STRIP_ASM_SYMS is not set
114# CONFIG_HOTPLUG is not set 116# CONFIG_HOTPLUG is not set
115CONFIG_PRINTK=y 117CONFIG_PRINTK=y
116CONFIG_BUG=y 118CONFIG_BUG=y
@@ -123,9 +125,16 @@ CONFIG_TIMERFD=y
123CONFIG_EVENTFD=y 125CONFIG_EVENTFD=y
124CONFIG_SHMEM=y 126CONFIG_SHMEM=y
125CONFIG_AIO=y 127CONFIG_AIO=y
128CONFIG_HAVE_PERF_COUNTERS=y
129
130#
131# Performance Counters
132#
133# CONFIG_PERF_COUNTERS is not set
126CONFIG_VM_EVENT_COUNTERS=y 134CONFIG_VM_EVENT_COUNTERS=y
127CONFIG_PCI_QUIRKS=y 135CONFIG_PCI_QUIRKS=y
128CONFIG_SLUB_DEBUG=y 136CONFIG_SLUB_DEBUG=y
137# CONFIG_STRIP_ASM_SYMS is not set
129CONFIG_COMPAT_BRK=y 138CONFIG_COMPAT_BRK=y
130# CONFIG_SLAB is not set 139# CONFIG_SLAB is not set
131CONFIG_SLUB=y 140CONFIG_SLUB=y
@@ -139,6 +148,10 @@ CONFIG_HAVE_KPROBES=y
139CONFIG_HAVE_KRETPROBES=y 148CONFIG_HAVE_KRETPROBES=y
140CONFIG_HAVE_ARCH_TRACEHOOK=y 149CONFIG_HAVE_ARCH_TRACEHOOK=y
141CONFIG_HAVE_CLK=y 150CONFIG_HAVE_CLK=y
151
152#
153# GCOV-based kernel profiling
154#
142# CONFIG_SLOW_WORK is not set 155# CONFIG_SLOW_WORK is not set
143# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set 156# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
144CONFIG_SLABINFO=y 157CONFIG_SLABINFO=y
@@ -146,7 +159,7 @@ CONFIG_RT_MUTEXES=y
146CONFIG_BASE_SMALL=0 159CONFIG_BASE_SMALL=0
147# CONFIG_MODULES is not set 160# CONFIG_MODULES is not set
148CONFIG_BLOCK=y 161CONFIG_BLOCK=y
149# CONFIG_LBD is not set 162CONFIG_LBDAF=y
150# CONFIG_BLK_DEV_BSG is not set 163# CONFIG_BLK_DEV_BSG is not set
151# CONFIG_BLK_DEV_INTEGRITY is not set 164# CONFIG_BLK_DEV_INTEGRITY is not set
152 165
@@ -179,6 +192,7 @@ CONFIG_MPC85xx=y
179# CONFIG_MPC85xx_DS is not set 192# CONFIG_MPC85xx_DS is not set
180# CONFIG_SOCRATES is not set 193# CONFIG_SOCRATES is not set
181# CONFIG_KSI8560 is not set 194# CONFIG_KSI8560 is not set
195# CONFIG_XES_MPC85xx is not set
182# CONFIG_STX_GP3 is not set 196# CONFIG_STX_GP3 is not set
183# CONFIG_TQM8540 is not set 197# CONFIG_TQM8540 is not set
184# CONFIG_TQM8541 is not set 198# CONFIG_TQM8541 is not set
@@ -228,6 +242,7 @@ CONFIG_BINFMT_ELF=y
228# CONFIG_BINFMT_MISC is not set 242# CONFIG_BINFMT_MISC is not set
229CONFIG_MATH_EMULATION=y 243CONFIG_MATH_EMULATION=y
230# CONFIG_IOMMU_HELPER is not set 244# CONFIG_IOMMU_HELPER is not set
245# CONFIG_SWIOTLB is not set
231CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y 246CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
232CONFIG_ARCH_HAS_WALK_MEMORY=y 247CONFIG_ARCH_HAS_WALK_MEMORY=y
233CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y 248CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y
@@ -246,9 +261,9 @@ CONFIG_MIGRATION=y
246CONFIG_ZONE_DMA_FLAG=1 261CONFIG_ZONE_DMA_FLAG=1
247CONFIG_BOUNCE=y 262CONFIG_BOUNCE=y
248CONFIG_VIRT_TO_BUS=y 263CONFIG_VIRT_TO_BUS=y
249CONFIG_UNEVICTABLE_LRU=y
250CONFIG_HAVE_MLOCK=y 264CONFIG_HAVE_MLOCK=y
251CONFIG_HAVE_MLOCKED_PAGE_BIT=y 265CONFIG_HAVE_MLOCKED_PAGE_BIT=y
266CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
252CONFIG_PPC_4K_PAGES=y 267CONFIG_PPC_4K_PAGES=y
253# CONFIG_PPC_16K_PAGES is not set 268# CONFIG_PPC_16K_PAGES is not set
254# CONFIG_PPC_64K_PAGES is not set 269# CONFIG_PPC_64K_PAGES is not set
@@ -356,6 +371,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
356# CONFIG_ECONET is not set 371# CONFIG_ECONET is not set
357# CONFIG_WAN_ROUTER is not set 372# CONFIG_WAN_ROUTER is not set
358# CONFIG_PHONET is not set 373# CONFIG_PHONET is not set
374# CONFIG_IEEE802154 is not set
359# CONFIG_NET_SCHED is not set 375# CONFIG_NET_SCHED is not set
360# CONFIG_DCB is not set 376# CONFIG_DCB is not set
361 377
@@ -373,7 +389,11 @@ CONFIG_WIRELESS=y
373CONFIG_WIRELESS_OLD_REGULATORY=y 389CONFIG_WIRELESS_OLD_REGULATORY=y
374# CONFIG_WIRELESS_EXT is not set 390# CONFIG_WIRELESS_EXT is not set
375# CONFIG_LIB80211 is not set 391# CONFIG_LIB80211 is not set
376# CONFIG_MAC80211 is not set 392
393#
394# CFG80211 needs to be enabled for MAC80211
395#
396CONFIG_MAC80211_DEFAULT_PS_VALUE=0
377# CONFIG_WIMAX is not set 397# CONFIG_WIMAX is not set
378# CONFIG_RFKILL is not set 398# CONFIG_RFKILL is not set
379# CONFIG_NET_9P is not set 399# CONFIG_NET_9P is not set
@@ -475,6 +495,7 @@ CONFIG_MTD_CFI_UTIL=y
475CONFIG_OF_DEVICE=y 495CONFIG_OF_DEVICE=y
476CONFIG_OF_GPIO=y 496CONFIG_OF_GPIO=y
477CONFIG_OF_I2C=y 497CONFIG_OF_I2C=y
498CONFIG_OF_MDIO=y
478# CONFIG_PARPORT is not set 499# CONFIG_PARPORT is not set
479CONFIG_BLK_DEV=y 500CONFIG_BLK_DEV=y
480# CONFIG_BLK_DEV_FD is not set 501# CONFIG_BLK_DEV_FD is not set
@@ -509,7 +530,9 @@ CONFIG_MISC_DEVICES=y
509# 530#
510# CONFIG_EEPROM_AT24 is not set 531# CONFIG_EEPROM_AT24 is not set
511# CONFIG_EEPROM_LEGACY is not set 532# CONFIG_EEPROM_LEGACY is not set
533# CONFIG_EEPROM_MAX6875 is not set
512# CONFIG_EEPROM_93CX6 is not set 534# CONFIG_EEPROM_93CX6 is not set
535# CONFIG_CB710_CORE is not set
513CONFIG_HAVE_IDE=y 536CONFIG_HAVE_IDE=y
514CONFIG_IDE=y 537CONFIG_IDE=y
515 538
@@ -584,14 +607,17 @@ CONFIG_BLK_DEV_IDEDMA=y
584# 607#
585 608
586# 609#
587# Enable only one of the two stacks, unless you know what you are doing 610# You can enable one or both FireWire driver stacks.
611#
612
613#
614# See the help texts for more information.
588# 615#
589# CONFIG_FIREWIRE is not set 616# CONFIG_FIREWIRE is not set
590# CONFIG_IEEE1394 is not set 617# CONFIG_IEEE1394 is not set
591# CONFIG_I2O is not set 618# CONFIG_I2O is not set
592# CONFIG_MACINTOSH_DRIVERS is not set 619# CONFIG_MACINTOSH_DRIVERS is not set
593CONFIG_NETDEVICES=y 620CONFIG_NETDEVICES=y
594CONFIG_COMPAT_NET_DEV_OPS=y
595# CONFIG_DUMMY is not set 621# CONFIG_DUMMY is not set
596# CONFIG_BONDING is not set 622# CONFIG_BONDING is not set
597# CONFIG_MACVLAN is not set 623# CONFIG_MACVLAN is not set
@@ -654,6 +680,7 @@ CONFIG_E100=y
654# CONFIG_SMSC9420 is not set 680# CONFIG_SMSC9420 is not set
655# CONFIG_SUNDANCE is not set 681# CONFIG_SUNDANCE is not set
656# CONFIG_TLAN is not set 682# CONFIG_TLAN is not set
683# CONFIG_KS8842 is not set
657# CONFIG_VIA_RHINE is not set 684# CONFIG_VIA_RHINE is not set
658# CONFIG_SC92031 is not set 685# CONFIG_SC92031 is not set
659# CONFIG_ATL2 is not set 686# CONFIG_ATL2 is not set
@@ -676,8 +703,10 @@ CONFIG_NETDEV_1000=y
676# CONFIG_VIA_VELOCITY is not set 703# CONFIG_VIA_VELOCITY is not set
677# CONFIG_TIGON3 is not set 704# CONFIG_TIGON3 is not set
678# CONFIG_BNX2 is not set 705# CONFIG_BNX2 is not set
706# CONFIG_CNIC is not set
679CONFIG_FSL_PQ_MDIO=y 707CONFIG_FSL_PQ_MDIO=y
680CONFIG_GIANFAR=y 708CONFIG_GIANFAR=y
709# CONFIG_MV643XX_ETH is not set
681# CONFIG_QLA3XXX is not set 710# CONFIG_QLA3XXX is not set
682# CONFIG_ATL1 is not set 711# CONFIG_ATL1 is not set
683# CONFIG_ATL1E is not set 712# CONFIG_ATL1E is not set
@@ -831,6 +860,7 @@ CONFIG_I2C_HELPER_AUTO=y
831# I2C system bus drivers (mostly embedded / system-on-chip) 860# I2C system bus drivers (mostly embedded / system-on-chip)
832# 861#
833# CONFIG_I2C_CPM is not set 862# CONFIG_I2C_CPM is not set
863# CONFIG_I2C_DESIGNWARE is not set
834# CONFIG_I2C_GPIO is not set 864# CONFIG_I2C_GPIO is not set
835CONFIG_I2C_MPC=y 865CONFIG_I2C_MPC=y
836# CONFIG_I2C_OCORES is not set 866# CONFIG_I2C_OCORES is not set
@@ -859,13 +889,17 @@ CONFIG_I2C_MPC=y
859# CONFIG_SENSORS_PCF8574 is not set 889# CONFIG_SENSORS_PCF8574 is not set
860# CONFIG_PCF8575 is not set 890# CONFIG_PCF8575 is not set
861# CONFIG_SENSORS_PCA9539 is not set 891# CONFIG_SENSORS_PCA9539 is not set
862# CONFIG_SENSORS_MAX6875 is not set
863# CONFIG_SENSORS_TSL2550 is not set 892# CONFIG_SENSORS_TSL2550 is not set
864# CONFIG_I2C_DEBUG_CORE is not set 893# CONFIG_I2C_DEBUG_CORE is not set
865# CONFIG_I2C_DEBUG_ALGO is not set 894# CONFIG_I2C_DEBUG_ALGO is not set
866# CONFIG_I2C_DEBUG_BUS is not set 895# CONFIG_I2C_DEBUG_BUS is not set
867# CONFIG_I2C_DEBUG_CHIP is not set 896# CONFIG_I2C_DEBUG_CHIP is not set
868# CONFIG_SPI is not set 897# CONFIG_SPI is not set
898
899#
900# PPS support
901#
902# CONFIG_PPS is not set
869CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y 903CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
870CONFIG_ARCH_REQUIRE_GPIOLIB=y 904CONFIG_ARCH_REQUIRE_GPIOLIB=y
871CONFIG_GPIOLIB=y 905CONFIG_GPIOLIB=y
@@ -944,6 +978,7 @@ CONFIG_SENSORS_LM75=y
944# CONFIG_SENSORS_SMSC47B397 is not set 978# CONFIG_SENSORS_SMSC47B397 is not set
945# CONFIG_SENSORS_ADS7828 is not set 979# CONFIG_SENSORS_ADS7828 is not set
946# CONFIG_SENSORS_THMC50 is not set 980# CONFIG_SENSORS_THMC50 is not set
981# CONFIG_SENSORS_TMP401 is not set
947# CONFIG_SENSORS_VIA686A is not set 982# CONFIG_SENSORS_VIA686A is not set
948# CONFIG_SENSORS_VT1211 is not set 983# CONFIG_SENSORS_VT1211 is not set
949# CONFIG_SENSORS_VT8231 is not set 984# CONFIG_SENSORS_VT8231 is not set
@@ -979,23 +1014,9 @@ CONFIG_SSB_POSSIBLE=y
979# CONFIG_MFD_WM8400 is not set 1014# CONFIG_MFD_WM8400 is not set
980# CONFIG_MFD_WM8350_I2C is not set 1015# CONFIG_MFD_WM8350_I2C is not set
981# CONFIG_MFD_PCF50633 is not set 1016# CONFIG_MFD_PCF50633 is not set
1017# CONFIG_AB3100_CORE is not set
982# CONFIG_REGULATOR is not set 1018# CONFIG_REGULATOR is not set
983 1019# CONFIG_MEDIA_SUPPORT is not set
984#
985# Multimedia devices
986#
987
988#
989# Multimedia core support
990#
991# CONFIG_VIDEO_DEV is not set
992# CONFIG_DVB_CORE is not set
993# CONFIG_VIDEO_MEDIA is not set
994
995#
996# Multimedia drivers
997#
998CONFIG_DAB=y
999 1020
1000# 1021#
1001# Graphics support 1022# Graphics support
@@ -1052,6 +1073,10 @@ CONFIG_USB_ARCH_HAS_EHCI=y
1052# CONFIG_DMADEVICES is not set 1073# CONFIG_DMADEVICES is not set
1053# CONFIG_AUXDISPLAY is not set 1074# CONFIG_AUXDISPLAY is not set
1054# CONFIG_UIO is not set 1075# CONFIG_UIO is not set
1076
1077#
1078# TI VLYNQ
1079#
1055# CONFIG_STAGING is not set 1080# CONFIG_STAGING is not set
1056 1081
1057# 1082#
@@ -1071,10 +1096,12 @@ CONFIG_FS_MBCACHE=y
1071# CONFIG_REISERFS_FS is not set 1096# CONFIG_REISERFS_FS is not set
1072# CONFIG_JFS_FS is not set 1097# CONFIG_JFS_FS is not set
1073# CONFIG_FS_POSIX_ACL is not set 1098# CONFIG_FS_POSIX_ACL is not set
1074CONFIG_FILE_LOCKING=y
1075# CONFIG_XFS_FS is not set 1099# CONFIG_XFS_FS is not set
1100# CONFIG_GFS2_FS is not set
1076# CONFIG_OCFS2_FS is not set 1101# CONFIG_OCFS2_FS is not set
1077# CONFIG_BTRFS_FS is not set 1102# CONFIG_BTRFS_FS is not set
1103CONFIG_FILE_LOCKING=y
1104CONFIG_FSNOTIFY=y
1078CONFIG_DNOTIFY=y 1105CONFIG_DNOTIFY=y
1079CONFIG_INOTIFY=y 1106CONFIG_INOTIFY=y
1080CONFIG_INOTIFY_USER=y 1107CONFIG_INOTIFY_USER=y
@@ -1201,6 +1228,7 @@ CONFIG_HAS_IOPORT=y
1201CONFIG_HAS_DMA=y 1228CONFIG_HAS_DMA=y
1202CONFIG_HAVE_LMB=y 1229CONFIG_HAVE_LMB=y
1203CONFIG_NLATTR=y 1230CONFIG_NLATTR=y
1231CONFIG_GENERIC_ATOMIC64=y
1204 1232
1205# 1233#
1206# Kernel hacking 1234# Kernel hacking
@@ -1226,22 +1254,11 @@ CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
1226CONFIG_HAVE_DYNAMIC_FTRACE=y 1254CONFIG_HAVE_DYNAMIC_FTRACE=y
1227CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y 1255CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
1228CONFIG_TRACING_SUPPORT=y 1256CONFIG_TRACING_SUPPORT=y
1229 1257# CONFIG_FTRACE is not set
1230#
1231# Tracers
1232#
1233# CONFIG_FUNCTION_TRACER is not set
1234# CONFIG_SCHED_TRACER is not set
1235# CONFIG_CONTEXT_SWITCH_TRACER is not set
1236# CONFIG_EVENT_TRACER is not set
1237# CONFIG_BOOT_TRACER is not set
1238# CONFIG_TRACE_BRANCH_PROFILING is not set
1239# CONFIG_STACK_TRACER is not set
1240# CONFIG_KMEMTRACE is not set
1241# CONFIG_WORKQUEUE_TRACER is not set
1242# CONFIG_BLK_DEV_IO_TRACE is not set
1243# CONFIG_SAMPLES is not set 1258# CONFIG_SAMPLES is not set
1244CONFIG_HAVE_ARCH_KGDB=y 1259CONFIG_HAVE_ARCH_KGDB=y
1260# CONFIG_PPC_DISABLE_WERROR is not set
1261CONFIG_PPC_WERROR=y
1245CONFIG_PRINT_STACK_DEPTH=64 1262CONFIG_PRINT_STACK_DEPTH=64
1246# CONFIG_IRQSTACKS is not set 1263# CONFIG_IRQSTACKS is not set
1247# CONFIG_PPC_EARLY_DEBUG is not set 1264# CONFIG_PPC_EARLY_DEBUG is not set
diff --git a/arch/powerpc/configs/85xx/tqm8560_defconfig b/arch/powerpc/configs/85xx/tqm8560_defconfig
index f41cc2444d48..2e49a6e9faf2 100644
--- a/arch/powerpc/configs/85xx/tqm8560_defconfig
+++ b/arch/powerpc/configs/85xx/tqm8560_defconfig
@@ -1,14 +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.30-rc3 3# Linux kernel version: 2.6.31-rc4
4# Wed May 13 17:22:26 2009 4# Wed Jul 29 23:32:25 2009
5# 5#
6# CONFIG_PPC64 is not set 6# CONFIG_PPC64 is not set
7 7
8# 8#
9# Processor support 9# Processor support
10# 10#
11# CONFIG_6xx is not set 11# CONFIG_PPC_BOOK3S_32 is not set
12CONFIG_PPC_85xx=y 12CONFIG_PPC_85xx=y
13# CONFIG_PPC_8xx is not set 13# CONFIG_PPC_8xx is not set
14# CONFIG_40x is not set 14# CONFIG_40x is not set
@@ -34,15 +34,16 @@ CONFIG_GENERIC_TIME=y
34CONFIG_GENERIC_TIME_VSYSCALL=y 34CONFIG_GENERIC_TIME_VSYSCALL=y
35CONFIG_GENERIC_CLOCKEVENTS=y 35CONFIG_GENERIC_CLOCKEVENTS=y
36CONFIG_GENERIC_HARDIRQS=y 36CONFIG_GENERIC_HARDIRQS=y
37CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
37# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set 38# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set
38CONFIG_IRQ_PER_CPU=y 39CONFIG_IRQ_PER_CPU=y
39CONFIG_STACKTRACE_SUPPORT=y 40CONFIG_STACKTRACE_SUPPORT=y
40CONFIG_HAVE_LATENCYTOP_SUPPORT=y 41CONFIG_HAVE_LATENCYTOP_SUPPORT=y
42CONFIG_TRACE_IRQFLAGS_SUPPORT=y
41CONFIG_LOCKDEP_SUPPORT=y 43CONFIG_LOCKDEP_SUPPORT=y
42CONFIG_RWSEM_XCHGADD_ALGORITHM=y 44CONFIG_RWSEM_XCHGADD_ALGORITHM=y
43CONFIG_ARCH_HAS_ILOG2_U32=y 45CONFIG_ARCH_HAS_ILOG2_U32=y
44CONFIG_GENERIC_HWEIGHT=y 46CONFIG_GENERIC_HWEIGHT=y
45CONFIG_GENERIC_CALIBRATE_DELAY=y
46CONFIG_GENERIC_FIND_NEXT_BIT=y 47CONFIG_GENERIC_FIND_NEXT_BIT=y
47CONFIG_GENERIC_GPIO=y 48CONFIG_GENERIC_GPIO=y
48# CONFIG_ARCH_NO_VIRT_TO_BUS is not set 49# CONFIG_ARCH_NO_VIRT_TO_BUS is not set
@@ -57,11 +58,13 @@ CONFIG_PPC_UDBG_16550=y
57# CONFIG_GENERIC_TBSYNC is not set 58# CONFIG_GENERIC_TBSYNC is not set
58CONFIG_AUDIT_ARCH=y 59CONFIG_AUDIT_ARCH=y
59CONFIG_GENERIC_BUG=y 60CONFIG_GENERIC_BUG=y
61CONFIG_DTC=y
60CONFIG_DEFAULT_UIMAGE=y 62CONFIG_DEFAULT_UIMAGE=y
61# CONFIG_PPC_DCR_NATIVE is not set 63# CONFIG_PPC_DCR_NATIVE is not set
62# CONFIG_PPC_DCR_MMIO is not set 64# CONFIG_PPC_DCR_MMIO is not set
63CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y 65CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y
64CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" 66CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
67CONFIG_CONSTRUCTORS=y
65 68
66# 69#
67# General setup 70# General setup
@@ -110,7 +113,6 @@ CONFIG_ANON_INODES=y
110CONFIG_EMBEDDED=y 113CONFIG_EMBEDDED=y
111CONFIG_SYSCTL_SYSCALL=y 114CONFIG_SYSCTL_SYSCALL=y
112# CONFIG_KALLSYMS is not set 115# CONFIG_KALLSYMS is not set
113# CONFIG_STRIP_ASM_SYMS is not set
114# CONFIG_HOTPLUG is not set 116# CONFIG_HOTPLUG is not set
115CONFIG_PRINTK=y 117CONFIG_PRINTK=y
116CONFIG_BUG=y 118CONFIG_BUG=y
@@ -123,9 +125,16 @@ CONFIG_TIMERFD=y
123CONFIG_EVENTFD=y 125CONFIG_EVENTFD=y
124CONFIG_SHMEM=y 126CONFIG_SHMEM=y
125CONFIG_AIO=y 127CONFIG_AIO=y
128CONFIG_HAVE_PERF_COUNTERS=y
129
130#
131# Performance Counters
132#
133# CONFIG_PERF_COUNTERS is not set
126CONFIG_VM_EVENT_COUNTERS=y 134CONFIG_VM_EVENT_COUNTERS=y
127CONFIG_PCI_QUIRKS=y 135CONFIG_PCI_QUIRKS=y
128CONFIG_SLUB_DEBUG=y 136CONFIG_SLUB_DEBUG=y
137# CONFIG_STRIP_ASM_SYMS is not set
129CONFIG_COMPAT_BRK=y 138CONFIG_COMPAT_BRK=y
130# CONFIG_SLAB is not set 139# CONFIG_SLAB is not set
131CONFIG_SLUB=y 140CONFIG_SLUB=y
@@ -139,6 +148,10 @@ CONFIG_HAVE_KPROBES=y
139CONFIG_HAVE_KRETPROBES=y 148CONFIG_HAVE_KRETPROBES=y
140CONFIG_HAVE_ARCH_TRACEHOOK=y 149CONFIG_HAVE_ARCH_TRACEHOOK=y
141CONFIG_HAVE_CLK=y 150CONFIG_HAVE_CLK=y
151
152#
153# GCOV-based kernel profiling
154#
142# CONFIG_SLOW_WORK is not set 155# CONFIG_SLOW_WORK is not set
143# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set 156# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
144CONFIG_SLABINFO=y 157CONFIG_SLABINFO=y
@@ -146,7 +159,7 @@ CONFIG_RT_MUTEXES=y
146CONFIG_BASE_SMALL=0 159CONFIG_BASE_SMALL=0
147# CONFIG_MODULES is not set 160# CONFIG_MODULES is not set
148CONFIG_BLOCK=y 161CONFIG_BLOCK=y
149# CONFIG_LBD is not set 162CONFIG_LBDAF=y
150# CONFIG_BLK_DEV_BSG is not set 163# CONFIG_BLK_DEV_BSG is not set
151# CONFIG_BLK_DEV_INTEGRITY is not set 164# CONFIG_BLK_DEV_INTEGRITY is not set
152 165
@@ -179,6 +192,7 @@ CONFIG_MPC85xx=y
179# CONFIG_MPC85xx_DS is not set 192# CONFIG_MPC85xx_DS is not set
180# CONFIG_SOCRATES is not set 193# CONFIG_SOCRATES is not set
181# CONFIG_KSI8560 is not set 194# CONFIG_KSI8560 is not set
195# CONFIG_XES_MPC85xx is not set
182# CONFIG_STX_GP3 is not set 196# CONFIG_STX_GP3 is not set
183# CONFIG_TQM8540 is not set 197# CONFIG_TQM8540 is not set
184# CONFIG_TQM8541 is not set 198# CONFIG_TQM8541 is not set
@@ -228,6 +242,7 @@ CONFIG_BINFMT_ELF=y
228# CONFIG_BINFMT_MISC is not set 242# CONFIG_BINFMT_MISC is not set
229CONFIG_MATH_EMULATION=y 243CONFIG_MATH_EMULATION=y
230# CONFIG_IOMMU_HELPER is not set 244# CONFIG_IOMMU_HELPER is not set
245# CONFIG_SWIOTLB is not set
231CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y 246CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
232CONFIG_ARCH_HAS_WALK_MEMORY=y 247CONFIG_ARCH_HAS_WALK_MEMORY=y
233CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y 248CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y
@@ -246,9 +261,9 @@ CONFIG_MIGRATION=y
246CONFIG_ZONE_DMA_FLAG=1 261CONFIG_ZONE_DMA_FLAG=1
247CONFIG_BOUNCE=y 262CONFIG_BOUNCE=y
248CONFIG_VIRT_TO_BUS=y 263CONFIG_VIRT_TO_BUS=y
249CONFIG_UNEVICTABLE_LRU=y
250CONFIG_HAVE_MLOCK=y 264CONFIG_HAVE_MLOCK=y
251CONFIG_HAVE_MLOCKED_PAGE_BIT=y 265CONFIG_HAVE_MLOCKED_PAGE_BIT=y
266CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
252CONFIG_PPC_4K_PAGES=y 267CONFIG_PPC_4K_PAGES=y
253# CONFIG_PPC_16K_PAGES is not set 268# CONFIG_PPC_16K_PAGES is not set
254# CONFIG_PPC_64K_PAGES is not set 269# CONFIG_PPC_64K_PAGES is not set
@@ -356,6 +371,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
356# CONFIG_ECONET is not set 371# CONFIG_ECONET is not set
357# CONFIG_WAN_ROUTER is not set 372# CONFIG_WAN_ROUTER is not set
358# CONFIG_PHONET is not set 373# CONFIG_PHONET is not set
374# CONFIG_IEEE802154 is not set
359# CONFIG_NET_SCHED is not set 375# CONFIG_NET_SCHED is not set
360# CONFIG_DCB is not set 376# CONFIG_DCB is not set
361 377
@@ -373,7 +389,11 @@ CONFIG_WIRELESS=y
373CONFIG_WIRELESS_OLD_REGULATORY=y 389CONFIG_WIRELESS_OLD_REGULATORY=y
374# CONFIG_WIRELESS_EXT is not set 390# CONFIG_WIRELESS_EXT is not set
375# CONFIG_LIB80211 is not set 391# CONFIG_LIB80211 is not set
376# CONFIG_MAC80211 is not set 392
393#
394# CFG80211 needs to be enabled for MAC80211
395#
396CONFIG_MAC80211_DEFAULT_PS_VALUE=0
377# CONFIG_WIMAX is not set 397# CONFIG_WIMAX is not set
378# CONFIG_RFKILL is not set 398# CONFIG_RFKILL is not set
379# CONFIG_NET_9P is not set 399# CONFIG_NET_9P is not set
@@ -475,6 +495,7 @@ CONFIG_MTD_CFI_UTIL=y
475CONFIG_OF_DEVICE=y 495CONFIG_OF_DEVICE=y
476CONFIG_OF_GPIO=y 496CONFIG_OF_GPIO=y
477CONFIG_OF_I2C=y 497CONFIG_OF_I2C=y
498CONFIG_OF_MDIO=y
478# CONFIG_PARPORT is not set 499# CONFIG_PARPORT is not set
479CONFIG_BLK_DEV=y 500CONFIG_BLK_DEV=y
480# CONFIG_BLK_DEV_FD is not set 501# CONFIG_BLK_DEV_FD is not set
@@ -509,7 +530,9 @@ CONFIG_MISC_DEVICES=y
509# 530#
510# CONFIG_EEPROM_AT24 is not set 531# CONFIG_EEPROM_AT24 is not set
511# CONFIG_EEPROM_LEGACY is not set 532# CONFIG_EEPROM_LEGACY is not set
533# CONFIG_EEPROM_MAX6875 is not set
512# CONFIG_EEPROM_93CX6 is not set 534# CONFIG_EEPROM_93CX6 is not set
535# CONFIG_CB710_CORE is not set
513CONFIG_HAVE_IDE=y 536CONFIG_HAVE_IDE=y
514CONFIG_IDE=y 537CONFIG_IDE=y
515 538
@@ -584,14 +607,17 @@ CONFIG_BLK_DEV_IDEDMA=y
584# 607#
585 608
586# 609#
587# Enable only one of the two stacks, unless you know what you are doing 610# You can enable one or both FireWire driver stacks.
611#
612
613#
614# See the help texts for more information.
588# 615#
589# CONFIG_FIREWIRE is not set 616# CONFIG_FIREWIRE is not set
590# CONFIG_IEEE1394 is not set 617# CONFIG_IEEE1394 is not set
591# CONFIG_I2O is not set 618# CONFIG_I2O is not set
592# CONFIG_MACINTOSH_DRIVERS is not set 619# CONFIG_MACINTOSH_DRIVERS is not set
593CONFIG_NETDEVICES=y 620CONFIG_NETDEVICES=y
594CONFIG_COMPAT_NET_DEV_OPS=y
595# CONFIG_DUMMY is not set 621# CONFIG_DUMMY is not set
596# CONFIG_BONDING is not set 622# CONFIG_BONDING is not set
597# CONFIG_MACVLAN is not set 623# CONFIG_MACVLAN is not set
@@ -654,6 +680,7 @@ CONFIG_E100=y
654# CONFIG_SMSC9420 is not set 680# CONFIG_SMSC9420 is not set
655# CONFIG_SUNDANCE is not set 681# CONFIG_SUNDANCE is not set
656# CONFIG_TLAN is not set 682# CONFIG_TLAN is not set
683# CONFIG_KS8842 is not set
657# CONFIG_VIA_RHINE is not set 684# CONFIG_VIA_RHINE is not set
658# CONFIG_SC92031 is not set 685# CONFIG_SC92031 is not set
659# CONFIG_ATL2 is not set 686# CONFIG_ATL2 is not set
@@ -676,8 +703,10 @@ CONFIG_NETDEV_1000=y
676# CONFIG_VIA_VELOCITY is not set 703# CONFIG_VIA_VELOCITY is not set
677# CONFIG_TIGON3 is not set 704# CONFIG_TIGON3 is not set
678# CONFIG_BNX2 is not set 705# CONFIG_BNX2 is not set
706# CONFIG_CNIC is not set
679CONFIG_FSL_PQ_MDIO=y 707CONFIG_FSL_PQ_MDIO=y
680CONFIG_GIANFAR=y 708CONFIG_GIANFAR=y
709# CONFIG_MV643XX_ETH is not set
681# CONFIG_QLA3XXX is not set 710# CONFIG_QLA3XXX is not set
682# CONFIG_ATL1 is not set 711# CONFIG_ATL1 is not set
683# CONFIG_ATL1E is not set 712# CONFIG_ATL1E is not set
@@ -831,6 +860,7 @@ CONFIG_I2C_HELPER_AUTO=y
831# I2C system bus drivers (mostly embedded / system-on-chip) 860# I2C system bus drivers (mostly embedded / system-on-chip)
832# 861#
833# CONFIG_I2C_CPM is not set 862# CONFIG_I2C_CPM is not set
863# CONFIG_I2C_DESIGNWARE is not set
834# CONFIG_I2C_GPIO is not set 864# CONFIG_I2C_GPIO is not set
835CONFIG_I2C_MPC=y 865CONFIG_I2C_MPC=y
836# CONFIG_I2C_OCORES is not set 866# CONFIG_I2C_OCORES is not set
@@ -859,13 +889,17 @@ CONFIG_I2C_MPC=y
859# CONFIG_SENSORS_PCF8574 is not set 889# CONFIG_SENSORS_PCF8574 is not set
860# CONFIG_PCF8575 is not set 890# CONFIG_PCF8575 is not set
861# CONFIG_SENSORS_PCA9539 is not set 891# CONFIG_SENSORS_PCA9539 is not set
862# CONFIG_SENSORS_MAX6875 is not set
863# CONFIG_SENSORS_TSL2550 is not set 892# CONFIG_SENSORS_TSL2550 is not set
864# CONFIG_I2C_DEBUG_CORE is not set 893# CONFIG_I2C_DEBUG_CORE is not set
865# CONFIG_I2C_DEBUG_ALGO is not set 894# CONFIG_I2C_DEBUG_ALGO is not set
866# CONFIG_I2C_DEBUG_BUS is not set 895# CONFIG_I2C_DEBUG_BUS is not set
867# CONFIG_I2C_DEBUG_CHIP is not set 896# CONFIG_I2C_DEBUG_CHIP is not set
868# CONFIG_SPI is not set 897# CONFIG_SPI is not set
898
899#
900# PPS support
901#
902# CONFIG_PPS is not set
869CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y 903CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
870CONFIG_ARCH_REQUIRE_GPIOLIB=y 904CONFIG_ARCH_REQUIRE_GPIOLIB=y
871CONFIG_GPIOLIB=y 905CONFIG_GPIOLIB=y
@@ -944,6 +978,7 @@ CONFIG_SENSORS_LM75=y
944# CONFIG_SENSORS_SMSC47B397 is not set 978# CONFIG_SENSORS_SMSC47B397 is not set
945# CONFIG_SENSORS_ADS7828 is not set 979# CONFIG_SENSORS_ADS7828 is not set
946# CONFIG_SENSORS_THMC50 is not set 980# CONFIG_SENSORS_THMC50 is not set
981# CONFIG_SENSORS_TMP401 is not set
947# CONFIG_SENSORS_VIA686A is not set 982# CONFIG_SENSORS_VIA686A is not set
948# CONFIG_SENSORS_VT1211 is not set 983# CONFIG_SENSORS_VT1211 is not set
949# CONFIG_SENSORS_VT8231 is not set 984# CONFIG_SENSORS_VT8231 is not set
@@ -979,23 +1014,9 @@ CONFIG_SSB_POSSIBLE=y
979# CONFIG_MFD_WM8400 is not set 1014# CONFIG_MFD_WM8400 is not set
980# CONFIG_MFD_WM8350_I2C is not set 1015# CONFIG_MFD_WM8350_I2C is not set
981# CONFIG_MFD_PCF50633 is not set 1016# CONFIG_MFD_PCF50633 is not set
1017# CONFIG_AB3100_CORE is not set
982# CONFIG_REGULATOR is not set 1018# CONFIG_REGULATOR is not set
983 1019# CONFIG_MEDIA_SUPPORT is not set
984#
985# Multimedia devices
986#
987
988#
989# Multimedia core support
990#
991# CONFIG_VIDEO_DEV is not set
992# CONFIG_DVB_CORE is not set
993# CONFIG_VIDEO_MEDIA is not set
994
995#
996# Multimedia drivers
997#
998CONFIG_DAB=y
999 1020
1000# 1021#
1001# Graphics support 1022# Graphics support
@@ -1052,6 +1073,10 @@ CONFIG_USB_ARCH_HAS_EHCI=y
1052# CONFIG_DMADEVICES is not set 1073# CONFIG_DMADEVICES is not set
1053# CONFIG_AUXDISPLAY is not set 1074# CONFIG_AUXDISPLAY is not set
1054# CONFIG_UIO is not set 1075# CONFIG_UIO is not set
1076
1077#
1078# TI VLYNQ
1079#
1055# CONFIG_STAGING is not set 1080# CONFIG_STAGING is not set
1056 1081
1057# 1082#
@@ -1071,10 +1096,12 @@ CONFIG_FS_MBCACHE=y
1071# CONFIG_REISERFS_FS is not set 1096# CONFIG_REISERFS_FS is not set
1072# CONFIG_JFS_FS is not set 1097# CONFIG_JFS_FS is not set
1073# CONFIG_FS_POSIX_ACL is not set 1098# CONFIG_FS_POSIX_ACL is not set
1074CONFIG_FILE_LOCKING=y
1075# CONFIG_XFS_FS is not set 1099# CONFIG_XFS_FS is not set
1100# CONFIG_GFS2_FS is not set
1076# CONFIG_OCFS2_FS is not set 1101# CONFIG_OCFS2_FS is not set
1077# CONFIG_BTRFS_FS is not set 1102# CONFIG_BTRFS_FS is not set
1103CONFIG_FILE_LOCKING=y
1104CONFIG_FSNOTIFY=y
1078CONFIG_DNOTIFY=y 1105CONFIG_DNOTIFY=y
1079CONFIG_INOTIFY=y 1106CONFIG_INOTIFY=y
1080CONFIG_INOTIFY_USER=y 1107CONFIG_INOTIFY_USER=y
@@ -1201,6 +1228,7 @@ CONFIG_HAS_IOPORT=y
1201CONFIG_HAS_DMA=y 1228CONFIG_HAS_DMA=y
1202CONFIG_HAVE_LMB=y 1229CONFIG_HAVE_LMB=y
1203CONFIG_NLATTR=y 1230CONFIG_NLATTR=y
1231CONFIG_GENERIC_ATOMIC64=y
1204 1232
1205# 1233#
1206# Kernel hacking 1234# Kernel hacking
@@ -1226,22 +1254,11 @@ CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
1226CONFIG_HAVE_DYNAMIC_FTRACE=y 1254CONFIG_HAVE_DYNAMIC_FTRACE=y
1227CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y 1255CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
1228CONFIG_TRACING_SUPPORT=y 1256CONFIG_TRACING_SUPPORT=y
1229 1257# CONFIG_FTRACE is not set
1230#
1231# Tracers
1232#
1233# CONFIG_FUNCTION_TRACER is not set
1234# CONFIG_SCHED_TRACER is not set
1235# CONFIG_CONTEXT_SWITCH_TRACER is not set
1236# CONFIG_EVENT_TRACER is not set
1237# CONFIG_BOOT_TRACER is not set
1238# CONFIG_TRACE_BRANCH_PROFILING is not set
1239# CONFIG_STACK_TRACER is not set
1240# CONFIG_KMEMTRACE is not set
1241# CONFIG_WORKQUEUE_TRACER is not set
1242# CONFIG_BLK_DEV_IO_TRACE is not set
1243# CONFIG_SAMPLES is not set 1258# CONFIG_SAMPLES is not set
1244CONFIG_HAVE_ARCH_KGDB=y 1259CONFIG_HAVE_ARCH_KGDB=y
1260# CONFIG_PPC_DISABLE_WERROR is not set
1261CONFIG_PPC_WERROR=y
1245CONFIG_PRINT_STACK_DEPTH=64 1262CONFIG_PRINT_STACK_DEPTH=64
1246# CONFIG_IRQSTACKS is not set 1263# CONFIG_IRQSTACKS is not set
1247# CONFIG_PPC_EARLY_DEBUG is not set 1264# CONFIG_PPC_EARLY_DEBUG is not set
diff --git a/arch/powerpc/configs/85xx/xes_mpc85xx_defconfig b/arch/powerpc/configs/85xx/xes_mpc85xx_defconfig
index 2552cbefba6b..1025da2bf069 100644
--- a/arch/powerpc/configs/85xx/xes_mpc85xx_defconfig
+++ b/arch/powerpc/configs/85xx/xes_mpc85xx_defconfig
@@ -1,14 +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.30-rc6 3# Linux kernel version: 2.6.31-rc4
4# Thu Jun 11 11:25:17 2009 4# Wed Jul 29 23:32:25 2009
5# 5#
6# CONFIG_PPC64 is not set 6# CONFIG_PPC64 is not set
7 7
8# 8#
9# Processor support 9# Processor support
10# 10#
11# CONFIG_6xx is not set 11# CONFIG_PPC_BOOK3S_32 is not set
12CONFIG_PPC_85xx=y 12CONFIG_PPC_85xx=y
13# CONFIG_PPC_8xx is not set 13# CONFIG_PPC_8xx is not set
14# CONFIG_40x is not set 14# CONFIG_40x is not set
@@ -35,15 +35,16 @@ CONFIG_GENERIC_TIME=y
35CONFIG_GENERIC_TIME_VSYSCALL=y 35CONFIG_GENERIC_TIME_VSYSCALL=y
36CONFIG_GENERIC_CLOCKEVENTS=y 36CONFIG_GENERIC_CLOCKEVENTS=y
37CONFIG_GENERIC_HARDIRQS=y 37CONFIG_GENERIC_HARDIRQS=y
38CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
38# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set 39# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set
39CONFIG_IRQ_PER_CPU=y 40CONFIG_IRQ_PER_CPU=y
40CONFIG_STACKTRACE_SUPPORT=y 41CONFIG_STACKTRACE_SUPPORT=y
41CONFIG_HAVE_LATENCYTOP_SUPPORT=y 42CONFIG_HAVE_LATENCYTOP_SUPPORT=y
43CONFIG_TRACE_IRQFLAGS_SUPPORT=y
42CONFIG_LOCKDEP_SUPPORT=y 44CONFIG_LOCKDEP_SUPPORT=y
43CONFIG_RWSEM_XCHGADD_ALGORITHM=y 45CONFIG_RWSEM_XCHGADD_ALGORITHM=y
44CONFIG_ARCH_HAS_ILOG2_U32=y 46CONFIG_ARCH_HAS_ILOG2_U32=y
45CONFIG_GENERIC_HWEIGHT=y 47CONFIG_GENERIC_HWEIGHT=y
46CONFIG_GENERIC_CALIBRATE_DELAY=y
47CONFIG_GENERIC_FIND_NEXT_BIT=y 48CONFIG_GENERIC_FIND_NEXT_BIT=y
48CONFIG_GENERIC_GPIO=y 49CONFIG_GENERIC_GPIO=y
49# CONFIG_ARCH_NO_VIRT_TO_BUS is not set 50# CONFIG_ARCH_NO_VIRT_TO_BUS is not set
@@ -64,6 +65,7 @@ CONFIG_DEFAULT_UIMAGE=y
64# CONFIG_PPC_DCR_MMIO is not set 65# CONFIG_PPC_DCR_MMIO is not set
65CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y 66CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y
66CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" 67CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
68CONFIG_CONSTRUCTORS=y
67 69
68# 70#
69# General setup 71# General setup
@@ -114,7 +116,6 @@ CONFIG_SYSCTL_SYSCALL=y
114CONFIG_KALLSYMS=y 116CONFIG_KALLSYMS=y
115CONFIG_KALLSYMS_ALL=y 117CONFIG_KALLSYMS_ALL=y
116CONFIG_KALLSYMS_EXTRA_PASS=y 118CONFIG_KALLSYMS_EXTRA_PASS=y
117# CONFIG_STRIP_ASM_SYMS is not set
118CONFIG_HOTPLUG=y 119CONFIG_HOTPLUG=y
119CONFIG_PRINTK=y 120CONFIG_PRINTK=y
120CONFIG_BUG=y 121CONFIG_BUG=y
@@ -127,9 +128,16 @@ CONFIG_TIMERFD=y
127CONFIG_EVENTFD=y 128CONFIG_EVENTFD=y
128CONFIG_SHMEM=y 129CONFIG_SHMEM=y
129CONFIG_AIO=y 130CONFIG_AIO=y
131CONFIG_HAVE_PERF_COUNTERS=y
132
133#
134# Performance Counters
135#
136# CONFIG_PERF_COUNTERS is not set
130CONFIG_VM_EVENT_COUNTERS=y 137CONFIG_VM_EVENT_COUNTERS=y
131CONFIG_PCI_QUIRKS=y 138CONFIG_PCI_QUIRKS=y
132CONFIG_SLUB_DEBUG=y 139CONFIG_SLUB_DEBUG=y
140# CONFIG_STRIP_ASM_SYMS is not set
133CONFIG_COMPAT_BRK=y 141CONFIG_COMPAT_BRK=y
134# CONFIG_SLAB is not set 142# CONFIG_SLAB is not set
135CONFIG_SLUB=y 143CONFIG_SLUB=y
@@ -144,6 +152,10 @@ CONFIG_HAVE_KPROBES=y
144CONFIG_HAVE_KRETPROBES=y 152CONFIG_HAVE_KRETPROBES=y
145CONFIG_HAVE_ARCH_TRACEHOOK=y 153CONFIG_HAVE_ARCH_TRACEHOOK=y
146CONFIG_USE_GENERIC_SMP_HELPERS=y 154CONFIG_USE_GENERIC_SMP_HELPERS=y
155
156#
157# GCOV-based kernel profiling
158#
147# CONFIG_SLOW_WORK is not set 159# CONFIG_SLOW_WORK is not set
148# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set 160# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
149CONFIG_SLABINFO=y 161CONFIG_SLABINFO=y
@@ -157,7 +169,7 @@ CONFIG_MODVERSIONS=y
157# CONFIG_MODULE_SRCVERSION_ALL is not set 169# CONFIG_MODULE_SRCVERSION_ALL is not set
158CONFIG_STOP_MACHINE=y 170CONFIG_STOP_MACHINE=y
159CONFIG_BLOCK=y 171CONFIG_BLOCK=y
160CONFIG_LBD=y 172CONFIG_LBDAF=y
161# CONFIG_BLK_DEV_BSG is not set 173# CONFIG_BLK_DEV_BSG is not set
162# CONFIG_BLK_DEV_INTEGRITY is not set 174# CONFIG_BLK_DEV_INTEGRITY is not set
163 175
@@ -239,6 +251,7 @@ CONFIG_BINFMT_ELF=y
239# CONFIG_BINFMT_MISC is not set 251# CONFIG_BINFMT_MISC is not set
240CONFIG_MATH_EMULATION=y 252CONFIG_MATH_EMULATION=y
241# CONFIG_IOMMU_HELPER is not set 253# CONFIG_IOMMU_HELPER is not set
254# CONFIG_SWIOTLB is not set
242CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y 255CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
243CONFIG_ARCH_HAS_WALK_MEMORY=y 256CONFIG_ARCH_HAS_WALK_MEMORY=y
244CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y 257CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y
@@ -258,9 +271,9 @@ CONFIG_MIGRATION=y
258CONFIG_ZONE_DMA_FLAG=1 271CONFIG_ZONE_DMA_FLAG=1
259CONFIG_BOUNCE=y 272CONFIG_BOUNCE=y
260CONFIG_VIRT_TO_BUS=y 273CONFIG_VIRT_TO_BUS=y
261CONFIG_UNEVICTABLE_LRU=y
262CONFIG_HAVE_MLOCK=y 274CONFIG_HAVE_MLOCK=y
263CONFIG_HAVE_MLOCKED_PAGE_BIT=y 275CONFIG_HAVE_MLOCKED_PAGE_BIT=y
276CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
264CONFIG_PPC_4K_PAGES=y 277CONFIG_PPC_4K_PAGES=y
265# CONFIG_PPC_16K_PAGES is not set 278# CONFIG_PPC_16K_PAGES is not set
266# CONFIG_PPC_64K_PAGES is not set 279# CONFIG_PPC_64K_PAGES is not set
@@ -287,6 +300,8 @@ CONFIG_PCI_DOMAINS=y
287CONFIG_PCI_SYSCALL=y 300CONFIG_PCI_SYSCALL=y
288CONFIG_PCIEPORTBUS=y 301CONFIG_PCIEPORTBUS=y
289CONFIG_PCIEAER=y 302CONFIG_PCIEAER=y
303# CONFIG_PCIE_ECRC is not set
304# CONFIG_PCIEAER_INJECT is not set
290# CONFIG_PCIEASPM is not set 305# CONFIG_PCIEASPM is not set
291CONFIG_ARCH_SUPPORTS_MSI=y 306CONFIG_ARCH_SUPPORTS_MSI=y
292CONFIG_PCI_MSI=y 307CONFIG_PCI_MSI=y
@@ -404,6 +419,7 @@ CONFIG_IPV6_NDISC_NODETYPE=y
404# CONFIG_ECONET is not set 419# CONFIG_ECONET is not set
405# CONFIG_WAN_ROUTER is not set 420# CONFIG_WAN_ROUTER is not set
406# CONFIG_PHONET is not set 421# CONFIG_PHONET is not set
422# CONFIG_IEEE802154 is not set
407# CONFIG_NET_SCHED is not set 423# CONFIG_NET_SCHED is not set
408# CONFIG_DCB is not set 424# CONFIG_DCB is not set
409 425
@@ -540,6 +556,7 @@ CONFIG_MTD_NAND_FSL_UPM=y
540CONFIG_OF_DEVICE=y 556CONFIG_OF_DEVICE=y
541CONFIG_OF_GPIO=y 557CONFIG_OF_GPIO=y
542CONFIG_OF_I2C=y 558CONFIG_OF_I2C=y
559CONFIG_OF_MDIO=y
543# CONFIG_PARPORT is not set 560# CONFIG_PARPORT is not set
544CONFIG_BLK_DEV=y 561CONFIG_BLK_DEV=y
545# CONFIG_BLK_DEV_FD is not set 562# CONFIG_BLK_DEV_FD is not set
@@ -575,7 +592,9 @@ CONFIG_MISC_DEVICES=y
575# 592#
576# CONFIG_EEPROM_AT24 is not set 593# CONFIG_EEPROM_AT24 is not set
577# CONFIG_EEPROM_LEGACY is not set 594# CONFIG_EEPROM_LEGACY is not set
595# CONFIG_EEPROM_MAX6875 is not set
578# CONFIG_EEPROM_93CX6 is not set 596# CONFIG_EEPROM_93CX6 is not set
597# CONFIG_CB710_CORE is not set
579CONFIG_HAVE_IDE=y 598CONFIG_HAVE_IDE=y
580# CONFIG_IDE is not set 599# CONFIG_IDE is not set
581 600
@@ -599,10 +618,6 @@ CONFIG_BLK_DEV_SR=y
599# CONFIG_BLK_DEV_SR_VENDOR is not set 618# CONFIG_BLK_DEV_SR_VENDOR is not set
600CONFIG_CHR_DEV_SG=y 619CONFIG_CHR_DEV_SG=y
601# CONFIG_CHR_DEV_SCH is not set 620# CONFIG_CHR_DEV_SCH is not set
602
603#
604# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
605#
606CONFIG_SCSI_MULTI_LUN=y 621CONFIG_SCSI_MULTI_LUN=y
607# CONFIG_SCSI_CONSTANTS is not set 622# CONFIG_SCSI_CONSTANTS is not set
608CONFIG_SCSI_LOGGING=y 623CONFIG_SCSI_LOGGING=y
@@ -619,6 +634,7 @@ CONFIG_SCSI_WAIT_SCAN=m
619# CONFIG_SCSI_SRP_ATTRS is not set 634# CONFIG_SCSI_SRP_ATTRS is not set
620CONFIG_SCSI_LOWLEVEL=y 635CONFIG_SCSI_LOWLEVEL=y
621# CONFIG_ISCSI_TCP is not set 636# CONFIG_ISCSI_TCP is not set
637# CONFIG_SCSI_BNX2_ISCSI is not set
622# CONFIG_BLK_DEV_3W_XXXX_RAID is not set 638# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
623# CONFIG_SCSI_3W_9XXX is not set 639# CONFIG_SCSI_3W_9XXX is not set
624# CONFIG_SCSI_ACARD is not set 640# CONFIG_SCSI_ACARD is not set
@@ -627,6 +643,7 @@ CONFIG_SCSI_LOWLEVEL=y
627# CONFIG_SCSI_AIC7XXX_OLD is not set 643# CONFIG_SCSI_AIC7XXX_OLD is not set
628# CONFIG_SCSI_AIC79XX is not set 644# CONFIG_SCSI_AIC79XX is not set
629# CONFIG_SCSI_AIC94XX is not set 645# CONFIG_SCSI_AIC94XX is not set
646# CONFIG_SCSI_MVSAS is not set
630# CONFIG_SCSI_DPT_I2O is not set 647# CONFIG_SCSI_DPT_I2O is not set
631# CONFIG_SCSI_ADVANSYS is not set 648# CONFIG_SCSI_ADVANSYS is not set
632# CONFIG_SCSI_ARCMSR is not set 649# CONFIG_SCSI_ARCMSR is not set
@@ -646,7 +663,6 @@ CONFIG_SCSI_LOWLEVEL=y
646# CONFIG_SCSI_IPS is not set 663# CONFIG_SCSI_IPS is not set
647# CONFIG_SCSI_INITIO is not set 664# CONFIG_SCSI_INITIO is not set
648# CONFIG_SCSI_INIA100 is not set 665# CONFIG_SCSI_INIA100 is not set
649# CONFIG_SCSI_MVSAS is not set
650# CONFIG_SCSI_STEX is not set 666# CONFIG_SCSI_STEX is not set
651# CONFIG_SCSI_SYM53C8XX_2 is not set 667# CONFIG_SCSI_SYM53C8XX_2 is not set
652# CONFIG_SCSI_IPR is not set 668# CONFIG_SCSI_IPR is not set
@@ -730,14 +746,17 @@ CONFIG_PATA_ALI=y
730# 746#
731 747
732# 748#
733# Enable only one of the two stacks, unless you know what you are doing 749# You can enable one or both FireWire driver stacks.
750#
751
752#
753# See the help texts for more information.
734# 754#
735# CONFIG_FIREWIRE is not set 755# CONFIG_FIREWIRE is not set
736# CONFIG_IEEE1394 is not set 756# CONFIG_IEEE1394 is not set
737# CONFIG_I2O is not set 757# CONFIG_I2O is not set
738# CONFIG_MACINTOSH_DRIVERS is not set 758# CONFIG_MACINTOSH_DRIVERS is not set
739CONFIG_NETDEVICES=y 759CONFIG_NETDEVICES=y
740CONFIG_COMPAT_NET_DEV_OPS=y
741CONFIG_DUMMY=y 760CONFIG_DUMMY=y
742# CONFIG_BONDING is not set 761# CONFIG_BONDING is not set
743# CONFIG_MACVLAN is not set 762# CONFIG_MACVLAN is not set
@@ -784,6 +803,7 @@ CONFIG_MII=y
784# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set 803# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
785# CONFIG_NET_PCI is not set 804# CONFIG_NET_PCI is not set
786# CONFIG_B44 is not set 805# CONFIG_B44 is not set
806# CONFIG_KS8842 is not set
787# CONFIG_ATL2 is not set 807# CONFIG_ATL2 is not set
788CONFIG_NETDEV_1000=y 808CONFIG_NETDEV_1000=y
789# CONFIG_ACENIC is not set 809# CONFIG_ACENIC is not set
@@ -803,8 +823,10 @@ CONFIG_E1000=y
803# CONFIG_VIA_VELOCITY is not set 823# CONFIG_VIA_VELOCITY is not set
804# CONFIG_TIGON3 is not set 824# CONFIG_TIGON3 is not set
805# CONFIG_BNX2 is not set 825# CONFIG_BNX2 is not set
826# CONFIG_CNIC is not set
806CONFIG_FSL_PQ_MDIO=y 827CONFIG_FSL_PQ_MDIO=y
807CONFIG_GIANFAR=y 828CONFIG_GIANFAR=y
829# CONFIG_MV643XX_ETH is not set
808# CONFIG_QLA3XXX is not set 830# CONFIG_QLA3XXX is not set
809# CONFIG_ATL1 is not set 831# CONFIG_ATL1 is not set
810# CONFIG_ATL1E is not set 832# CONFIG_ATL1E is not set
@@ -986,13 +1008,17 @@ CONFIG_I2C_MPC=y
986# CONFIG_DS1682 is not set 1008# CONFIG_DS1682 is not set
987# CONFIG_SENSORS_PCF8574 is not set 1009# CONFIG_SENSORS_PCF8574 is not set
988# CONFIG_PCF8575 is not set 1010# CONFIG_PCF8575 is not set
989# CONFIG_SENSORS_MAX6875 is not set
990# CONFIG_SENSORS_TSL2550 is not set 1011# CONFIG_SENSORS_TSL2550 is not set
991# CONFIG_I2C_DEBUG_CORE is not set 1012# CONFIG_I2C_DEBUG_CORE is not set
992# CONFIG_I2C_DEBUG_ALGO is not set 1013# CONFIG_I2C_DEBUG_ALGO is not set
993# CONFIG_I2C_DEBUG_BUS is not set 1014# CONFIG_I2C_DEBUG_BUS is not set
994# CONFIG_I2C_DEBUG_CHIP is not set 1015# CONFIG_I2C_DEBUG_CHIP is not set
995# CONFIG_SPI is not set 1016# CONFIG_SPI is not set
1017
1018#
1019# PPS support
1020#
1021# CONFIG_PPS is not set
996CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y 1022CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
997CONFIG_ARCH_REQUIRE_GPIOLIB=y 1023CONFIG_ARCH_REQUIRE_GPIOLIB=y
998CONFIG_GPIOLIB=y 1024CONFIG_GPIOLIB=y
@@ -1072,6 +1098,7 @@ CONFIG_SENSORS_LM90=y
1072# CONFIG_SENSORS_SMSC47B397 is not set 1098# CONFIG_SENSORS_SMSC47B397 is not set
1073# CONFIG_SENSORS_ADS7828 is not set 1099# CONFIG_SENSORS_ADS7828 is not set
1074# CONFIG_SENSORS_THMC50 is not set 1100# CONFIG_SENSORS_THMC50 is not set
1101# CONFIG_SENSORS_TMP401 is not set
1075# CONFIG_SENSORS_VIA686A is not set 1102# CONFIG_SENSORS_VIA686A is not set
1076# CONFIG_SENSORS_VT1211 is not set 1103# CONFIG_SENSORS_VT1211 is not set
1077# CONFIG_SENSORS_VT8231 is not set 1104# CONFIG_SENSORS_VT8231 is not set
@@ -1126,23 +1153,9 @@ CONFIG_SSB_POSSIBLE=y
1126# CONFIG_MFD_WM8400 is not set 1153# CONFIG_MFD_WM8400 is not set
1127# CONFIG_MFD_WM8350_I2C is not set 1154# CONFIG_MFD_WM8350_I2C is not set
1128# CONFIG_MFD_PCF50633 is not set 1155# CONFIG_MFD_PCF50633 is not set
1156# CONFIG_AB3100_CORE is not set
1129# CONFIG_REGULATOR is not set 1157# CONFIG_REGULATOR is not set
1130 1158# CONFIG_MEDIA_SUPPORT is not set
1131#
1132# Multimedia devices
1133#
1134
1135#
1136# Multimedia core support
1137#
1138# CONFIG_VIDEO_DEV is not set
1139# CONFIG_DVB_CORE is not set
1140# CONFIG_VIDEO_MEDIA is not set
1141
1142#
1143# Multimedia drivers
1144#
1145# CONFIG_DAB is not set
1146 1159
1147# 1160#
1148# Graphics support 1161# Graphics support
@@ -1187,7 +1200,7 @@ CONFIG_USB_HID=y
1187# CONFIG_HID_CHERRY is not set 1200# CONFIG_HID_CHERRY is not set
1188# CONFIG_HID_CHICONY is not set 1201# CONFIG_HID_CHICONY is not set
1189# CONFIG_HID_CYPRESS is not set 1202# CONFIG_HID_CYPRESS is not set
1190# CONFIG_DRAGONRISE_FF is not set 1203# CONFIG_HID_DRAGONRISE is not set
1191# CONFIG_HID_EZKEY is not set 1204# CONFIG_HID_EZKEY is not set
1192# CONFIG_HID_KYE is not set 1205# CONFIG_HID_KYE is not set
1193# CONFIG_HID_GYRATION is not set 1206# CONFIG_HID_GYRATION is not set
@@ -1201,10 +1214,11 @@ CONFIG_USB_HID=y
1201# CONFIG_HID_SAMSUNG is not set 1214# CONFIG_HID_SAMSUNG is not set
1202# CONFIG_HID_SONY is not set 1215# CONFIG_HID_SONY is not set
1203# CONFIG_HID_SUNPLUS is not set 1216# CONFIG_HID_SUNPLUS is not set
1204# CONFIG_GREENASIA_FF is not set 1217# CONFIG_HID_GREENASIA is not set
1218# CONFIG_HID_SMARTJOYPLUS is not set
1205# CONFIG_HID_TOPSEED is not set 1219# CONFIG_HID_TOPSEED is not set
1206# CONFIG_THRUSTMASTER_FF is not set 1220# CONFIG_HID_THRUSTMASTER is not set
1207# CONFIG_ZEROPLUS_FF is not set 1221# CONFIG_HID_ZEROPLUS is not set
1208CONFIG_USB_SUPPORT=y 1222CONFIG_USB_SUPPORT=y
1209CONFIG_USB_ARCH_HAS_HCD=y 1223CONFIG_USB_ARCH_HAS_HCD=y
1210CONFIG_USB_ARCH_HAS_OHCI=y 1224CONFIG_USB_ARCH_HAS_OHCI=y
@@ -1230,6 +1244,7 @@ CONFIG_USB_MON=y
1230# USB Host Controller Drivers 1244# USB Host Controller Drivers
1231# 1245#
1232# CONFIG_USB_C67X00_HCD is not set 1246# CONFIG_USB_C67X00_HCD is not set
1247# CONFIG_USB_XHCI_HCD is not set
1233# CONFIG_USB_EHCI_HCD is not set 1248# CONFIG_USB_EHCI_HCD is not set
1234# CONFIG_USB_OXU210HP_HCD is not set 1249# CONFIG_USB_OXU210HP_HCD is not set
1235# CONFIG_USB_ISP116X_HCD is not set 1250# CONFIG_USB_ISP116X_HCD is not set
@@ -1325,7 +1340,7 @@ CONFIG_LEDS_CLASS=y
1325CONFIG_LEDS_GPIO=y 1340CONFIG_LEDS_GPIO=y
1326CONFIG_LEDS_GPIO_PLATFORM=y 1341CONFIG_LEDS_GPIO_PLATFORM=y
1327CONFIG_LEDS_GPIO_OF=y 1342CONFIG_LEDS_GPIO_OF=y
1328# CONFIG_LEDS_LP5521 is not set 1343# CONFIG_LEDS_LP3944 is not set
1329CONFIG_LEDS_PCA955X=y 1344CONFIG_LEDS_PCA955X=y
1330# CONFIG_LEDS_BD2802 is not set 1345# CONFIG_LEDS_BD2802 is not set
1331 1346
@@ -1352,8 +1367,6 @@ CONFIG_EDAC=y
1352# CONFIG_EDAC_DEBUG is not set 1367# CONFIG_EDAC_DEBUG is not set
1353CONFIG_EDAC_MM_EDAC=y 1368CONFIG_EDAC_MM_EDAC=y
1354CONFIG_EDAC_MPC85XX=y 1369CONFIG_EDAC_MPC85XX=y
1355# CONFIG_EDAC_AMD8131 is not set
1356# CONFIG_EDAC_AMD8111 is not set
1357CONFIG_RTC_LIB=y 1370CONFIG_RTC_LIB=y
1358CONFIG_RTC_CLASS=y 1371CONFIG_RTC_CLASS=y
1359CONFIG_RTC_HCTOSYS=y 1372CONFIG_RTC_HCTOSYS=y
@@ -1385,6 +1398,7 @@ CONFIG_RTC_DRV_DS1307=y
1385# CONFIG_RTC_DRV_S35390A is not set 1398# CONFIG_RTC_DRV_S35390A is not set
1386# CONFIG_RTC_DRV_FM3130 is not set 1399# CONFIG_RTC_DRV_FM3130 is not set
1387# CONFIG_RTC_DRV_RX8581 is not set 1400# CONFIG_RTC_DRV_RX8581 is not set
1401# CONFIG_RTC_DRV_RX8025 is not set
1388 1402
1389# 1403#
1390# SPI RTC drivers 1404# SPI RTC drivers
@@ -1425,6 +1439,10 @@ CONFIG_NET_DMA=y
1425# CONFIG_DMATEST is not set 1439# CONFIG_DMATEST is not set
1426# CONFIG_AUXDISPLAY is not set 1440# CONFIG_AUXDISPLAY is not set
1427# CONFIG_UIO is not set 1441# CONFIG_UIO is not set
1442
1443#
1444# TI VLYNQ
1445#
1428# CONFIG_STAGING is not set 1446# CONFIG_STAGING is not set
1429 1447
1430# 1448#
@@ -1444,11 +1462,12 @@ CONFIG_FS_MBCACHE=y
1444# CONFIG_REISERFS_FS is not set 1462# CONFIG_REISERFS_FS is not set
1445# CONFIG_JFS_FS is not set 1463# CONFIG_JFS_FS is not set
1446# CONFIG_FS_POSIX_ACL is not set 1464# CONFIG_FS_POSIX_ACL is not set
1447CONFIG_FILE_LOCKING=y
1448# CONFIG_XFS_FS is not set 1465# CONFIG_XFS_FS is not set
1449# CONFIG_GFS2_FS is not set 1466# CONFIG_GFS2_FS is not set
1450# CONFIG_OCFS2_FS is not set 1467# CONFIG_OCFS2_FS is not set
1451# CONFIG_BTRFS_FS is not set 1468# CONFIG_BTRFS_FS is not set
1469CONFIG_FILE_LOCKING=y
1470CONFIG_FSNOTIFY=y
1452CONFIG_DNOTIFY=y 1471CONFIG_DNOTIFY=y
1453CONFIG_INOTIFY=y 1472CONFIG_INOTIFY=y
1454CONFIG_INOTIFY_USER=y 1473CONFIG_INOTIFY_USER=y
@@ -1629,6 +1648,7 @@ CONFIG_HAS_IOPORT=y
1629CONFIG_HAS_DMA=y 1648CONFIG_HAS_DMA=y
1630CONFIG_HAVE_LMB=y 1649CONFIG_HAVE_LMB=y
1631CONFIG_NLATTR=y 1650CONFIG_NLATTR=y
1651CONFIG_GENERIC_ATOMIC64=y
1632 1652
1633# 1653#
1634# Kernel hacking 1654# Kernel hacking
@@ -1659,6 +1679,9 @@ CONFIG_SCHED_DEBUG=y
1659# CONFIG_RT_MUTEX_TESTER is not set 1679# CONFIG_RT_MUTEX_TESTER is not set
1660# CONFIG_DEBUG_SPINLOCK is not set 1680# CONFIG_DEBUG_SPINLOCK is not set
1661# CONFIG_DEBUG_MUTEXES is not set 1681# CONFIG_DEBUG_MUTEXES is not set
1682# CONFIG_DEBUG_LOCK_ALLOC is not set
1683# CONFIG_PROVE_LOCKING is not set
1684# CONFIG_LOCK_STAT is not set
1662# CONFIG_DEBUG_SPINLOCK_SLEEP is not set 1685# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
1663# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set 1686# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
1664# CONFIG_DEBUG_KOBJECT is not set 1687# CONFIG_DEBUG_KOBJECT is not set
@@ -1671,7 +1694,6 @@ CONFIG_SCHED_DEBUG=y
1671# CONFIG_DEBUG_LIST is not set 1694# CONFIG_DEBUG_LIST is not set
1672# CONFIG_DEBUG_SG is not set 1695# CONFIG_DEBUG_SG is not set
1673# CONFIG_DEBUG_NOTIFIERS is not set 1696# CONFIG_DEBUG_NOTIFIERS is not set
1674# CONFIG_BOOT_PRINTK_DELAY is not set
1675# CONFIG_RCU_TORTURE_TEST is not set 1697# CONFIG_RCU_TORTURE_TEST is not set
1676# CONFIG_RCU_CPU_STALL_DETECTOR is not set 1698# CONFIG_RCU_CPU_STALL_DETECTOR is not set
1677# CONFIG_BACKTRACE_SELF_TEST is not set 1699# CONFIG_BACKTRACE_SELF_TEST is not set
@@ -1685,16 +1707,15 @@ CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
1685CONFIG_HAVE_DYNAMIC_FTRACE=y 1707CONFIG_HAVE_DYNAMIC_FTRACE=y
1686CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y 1708CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
1687CONFIG_TRACING_SUPPORT=y 1709CONFIG_TRACING_SUPPORT=y
1688 1710CONFIG_FTRACE=y
1689#
1690# Tracers
1691#
1692# CONFIG_FUNCTION_TRACER is not set 1711# CONFIG_FUNCTION_TRACER is not set
1712# CONFIG_IRQSOFF_TRACER is not set
1693# CONFIG_SCHED_TRACER is not set 1713# CONFIG_SCHED_TRACER is not set
1694# CONFIG_CONTEXT_SWITCH_TRACER is not set 1714# CONFIG_ENABLE_DEFAULT_TRACERS is not set
1695# CONFIG_EVENT_TRACER is not set
1696# CONFIG_BOOT_TRACER is not set 1715# CONFIG_BOOT_TRACER is not set
1697# CONFIG_TRACE_BRANCH_PROFILING is not set 1716CONFIG_BRANCH_PROFILE_NONE=y
1717# CONFIG_PROFILE_ANNOTATED_BRANCHES is not set
1718# CONFIG_PROFILE_ALL_BRANCHES is not set
1698# CONFIG_STACK_TRACER is not set 1719# CONFIG_STACK_TRACER is not set
1699# CONFIG_KMEMTRACE is not set 1720# CONFIG_KMEMTRACE is not set
1700# CONFIG_WORKQUEUE_TRACER is not set 1721# CONFIG_WORKQUEUE_TRACER is not set
@@ -1702,6 +1723,9 @@ CONFIG_TRACING_SUPPORT=y
1702# CONFIG_SAMPLES is not set 1723# CONFIG_SAMPLES is not set
1703CONFIG_HAVE_ARCH_KGDB=y 1724CONFIG_HAVE_ARCH_KGDB=y
1704# CONFIG_KGDB is not set 1725# CONFIG_KGDB is not set
1726# CONFIG_KMEMCHECK is not set
1727# CONFIG_PPC_DISABLE_WERROR is not set
1728CONFIG_PPC_WERROR=y
1705CONFIG_PRINT_STACK_DEPTH=64 1729CONFIG_PRINT_STACK_DEPTH=64
1706# CONFIG_DEBUG_STACKOVERFLOW is not set 1730# CONFIG_DEBUG_STACKOVERFLOW is not set
1707# CONFIG_DEBUG_STACK_USAGE is not set 1731# CONFIG_DEBUG_STACK_USAGE is not set
diff --git a/arch/powerpc/configs/86xx/gef_ppc9a_defconfig b/arch/powerpc/configs/86xx/gef_ppc9a_defconfig
index b6a23af57f46..527ad1a5e802 100644
--- a/arch/powerpc/configs/86xx/gef_ppc9a_defconfig
+++ b/arch/powerpc/configs/86xx/gef_ppc9a_defconfig
@@ -1,26 +1,28 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.30-rc3 3# Linux kernel version: 2.6.31-rc4
4# Wed May 13 17:22:31 2009 4# Wed Jul 29 23:32:31 2009
5# 5#
6# CONFIG_PPC64 is not set 6# CONFIG_PPC64 is not set
7 7
8# 8#
9# Processor support 9# Processor support
10# 10#
11CONFIG_6xx=y 11CONFIG_PPC_BOOK3S_32=y
12# CONFIG_PPC_85xx is not set 12# CONFIG_PPC_85xx is not set
13# CONFIG_PPC_8xx is not set 13# CONFIG_PPC_8xx is not set
14# CONFIG_40x is not set 14# CONFIG_40x is not set
15# CONFIG_44x is not set 15# CONFIG_44x is not set
16# CONFIG_E200 is not set 16# CONFIG_E200 is not set
17CONFIG_PPC_BOOK3S=y 17CONFIG_PPC_BOOK3S=y
18CONFIG_6xx=y
18CONFIG_PPC_FPU=y 19CONFIG_PPC_FPU=y
19# CONFIG_PHYS_64BIT is not set 20# CONFIG_PHYS_64BIT is not set
20CONFIG_ALTIVEC=y 21CONFIG_ALTIVEC=y
21CONFIG_PPC_STD_MMU=y 22CONFIG_PPC_STD_MMU=y
22CONFIG_PPC_STD_MMU_32=y 23CONFIG_PPC_STD_MMU_32=y
23# CONFIG_PPC_MM_SLICES is not set 24# CONFIG_PPC_MM_SLICES is not set
25CONFIG_PPC_HAVE_PMU_SUPPORT=y
24CONFIG_SMP=y 26CONFIG_SMP=y
25CONFIG_NR_CPUS=2 27CONFIG_NR_CPUS=2
26CONFIG_PPC32=y 28CONFIG_PPC32=y
@@ -32,16 +34,17 @@ CONFIG_GENERIC_TIME=y
32CONFIG_GENERIC_TIME_VSYSCALL=y 34CONFIG_GENERIC_TIME_VSYSCALL=y
33CONFIG_GENERIC_CLOCKEVENTS=y 35CONFIG_GENERIC_CLOCKEVENTS=y
34CONFIG_GENERIC_HARDIRQS=y 36CONFIG_GENERIC_HARDIRQS=y
37CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
35# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set 38# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set
36CONFIG_IRQ_PER_CPU=y 39CONFIG_IRQ_PER_CPU=y
37CONFIG_STACKTRACE_SUPPORT=y 40CONFIG_STACKTRACE_SUPPORT=y
38CONFIG_HAVE_LATENCYTOP_SUPPORT=y 41CONFIG_HAVE_LATENCYTOP_SUPPORT=y
42CONFIG_TRACE_IRQFLAGS_SUPPORT=y
39CONFIG_LOCKDEP_SUPPORT=y 43CONFIG_LOCKDEP_SUPPORT=y
40CONFIG_RWSEM_XCHGADD_ALGORITHM=y 44CONFIG_RWSEM_XCHGADD_ALGORITHM=y
41CONFIG_GENERIC_LOCKBREAK=y 45CONFIG_GENERIC_LOCKBREAK=y
42CONFIG_ARCH_HAS_ILOG2_U32=y 46CONFIG_ARCH_HAS_ILOG2_U32=y
43CONFIG_GENERIC_HWEIGHT=y 47CONFIG_GENERIC_HWEIGHT=y
44CONFIG_GENERIC_CALIBRATE_DELAY=y
45CONFIG_GENERIC_FIND_NEXT_BIT=y 48CONFIG_GENERIC_FIND_NEXT_BIT=y
46CONFIG_GENERIC_GPIO=y 49CONFIG_GENERIC_GPIO=y
47# CONFIG_ARCH_NO_VIRT_TO_BUS is not set 50# CONFIG_ARCH_NO_VIRT_TO_BUS is not set
@@ -56,11 +59,13 @@ CONFIG_PPC_UDBG_16550=y
56CONFIG_GENERIC_TBSYNC=y 59CONFIG_GENERIC_TBSYNC=y
57CONFIG_AUDIT_ARCH=y 60CONFIG_AUDIT_ARCH=y
58CONFIG_GENERIC_BUG=y 61CONFIG_GENERIC_BUG=y
62CONFIG_DTC=y
59CONFIG_DEFAULT_UIMAGE=y 63CONFIG_DEFAULT_UIMAGE=y
60# CONFIG_PPC_DCR_NATIVE is not set 64# CONFIG_PPC_DCR_NATIVE is not set
61# CONFIG_PPC_DCR_MMIO is not set 65# CONFIG_PPC_DCR_MMIO is not set
62CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y 66CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y
63CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" 67CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
68CONFIG_CONSTRUCTORS=y
64 69
65# 70#
66# General setup 71# General setup
@@ -112,9 +117,7 @@ CONFIG_ANON_INODES=y
112CONFIG_EMBEDDED=y 117CONFIG_EMBEDDED=y
113CONFIG_SYSCTL_SYSCALL=y 118CONFIG_SYSCTL_SYSCALL=y
114CONFIG_KALLSYMS=y 119CONFIG_KALLSYMS=y
115# CONFIG_KALLSYMS_ALL is not set
116# CONFIG_KALLSYMS_EXTRA_PASS is not set 120# CONFIG_KALLSYMS_EXTRA_PASS is not set
117# CONFIG_STRIP_ASM_SYMS is not set
118CONFIG_HOTPLUG=y 121CONFIG_HOTPLUG=y
119CONFIG_PRINTK=y 122CONFIG_PRINTK=y
120CONFIG_BUG=y 123CONFIG_BUG=y
@@ -127,8 +130,15 @@ CONFIG_TIMERFD=y
127CONFIG_EVENTFD=y 130CONFIG_EVENTFD=y
128CONFIG_SHMEM=y 131CONFIG_SHMEM=y
129CONFIG_AIO=y 132CONFIG_AIO=y
133CONFIG_HAVE_PERF_COUNTERS=y
134
135#
136# Performance Counters
137#
138# CONFIG_PERF_COUNTERS is not set
130CONFIG_VM_EVENT_COUNTERS=y 139CONFIG_VM_EVENT_COUNTERS=y
131CONFIG_PCI_QUIRKS=y 140CONFIG_PCI_QUIRKS=y
141# CONFIG_STRIP_ASM_SYMS is not set
132CONFIG_COMPAT_BRK=y 142CONFIG_COMPAT_BRK=y
133CONFIG_SLAB=y 143CONFIG_SLAB=y
134# CONFIG_SLUB is not set 144# CONFIG_SLUB is not set
@@ -143,6 +153,10 @@ CONFIG_HAVE_KPROBES=y
143CONFIG_HAVE_KRETPROBES=y 153CONFIG_HAVE_KRETPROBES=y
144CONFIG_HAVE_ARCH_TRACEHOOK=y 154CONFIG_HAVE_ARCH_TRACEHOOK=y
145CONFIG_USE_GENERIC_SMP_HELPERS=y 155CONFIG_USE_GENERIC_SMP_HELPERS=y
156
157#
158# GCOV-based kernel profiling
159#
146# CONFIG_SLOW_WORK is not set 160# CONFIG_SLOW_WORK is not set
147# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set 161# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
148CONFIG_SLABINFO=y 162CONFIG_SLABINFO=y
@@ -156,7 +170,7 @@ CONFIG_MODULE_UNLOAD=y
156# CONFIG_MODULE_SRCVERSION_ALL is not set 170# CONFIG_MODULE_SRCVERSION_ALL is not set
157CONFIG_STOP_MACHINE=y 171CONFIG_STOP_MACHINE=y
158CONFIG_BLOCK=y 172CONFIG_BLOCK=y
159# CONFIG_LBD is not set 173CONFIG_LBDAF=y
160# CONFIG_BLK_DEV_BSG is not set 174# CONFIG_BLK_DEV_BSG is not set
161# CONFIG_BLK_DEV_INTEGRITY is not set 175# CONFIG_BLK_DEV_INTEGRITY is not set
162 176
@@ -216,7 +230,7 @@ CONFIG_MPIC=y
216# 230#
217# Kernel options 231# Kernel options
218# 232#
219# CONFIG_HIGHMEM is not set 233CONFIG_HIGHMEM=y
220CONFIG_TICK_ONESHOT=y 234CONFIG_TICK_ONESHOT=y
221# CONFIG_NO_HZ is not set 235# CONFIG_NO_HZ is not set
222CONFIG_HIGH_RES_TIMERS=y 236CONFIG_HIGH_RES_TIMERS=y
@@ -235,6 +249,7 @@ CONFIG_BINFMT_ELF=y
235# CONFIG_HAVE_AOUT is not set 249# CONFIG_HAVE_AOUT is not set
236CONFIG_BINFMT_MISC=m 250CONFIG_BINFMT_MISC=m
237# CONFIG_IOMMU_HELPER is not set 251# CONFIG_IOMMU_HELPER is not set
252# CONFIG_SWIOTLB is not set
238CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y 253CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
239CONFIG_ARCH_HAS_WALK_MEMORY=y 254CONFIG_ARCH_HAS_WALK_MEMORY=y
240CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y 255CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y
@@ -256,9 +271,9 @@ CONFIG_MIGRATION=y
256CONFIG_ZONE_DMA_FLAG=1 271CONFIG_ZONE_DMA_FLAG=1
257CONFIG_BOUNCE=y 272CONFIG_BOUNCE=y
258CONFIG_VIRT_TO_BUS=y 273CONFIG_VIRT_TO_BUS=y
259CONFIG_UNEVICTABLE_LRU=y
260CONFIG_HAVE_MLOCK=y 274CONFIG_HAVE_MLOCK=y
261CONFIG_HAVE_MLOCKED_PAGE_BIT=y 275CONFIG_HAVE_MLOCKED_PAGE_BIT=y
276CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
262CONFIG_PPC_4K_PAGES=y 277CONFIG_PPC_4K_PAGES=y
263# CONFIG_PPC_16K_PAGES is not set 278# CONFIG_PPC_16K_PAGES is not set
264# CONFIG_PPC_64K_PAGES is not set 279# CONFIG_PPC_64K_PAGES is not set
@@ -285,14 +300,32 @@ CONFIG_PCI_DOMAINS=y
285CONFIG_PCI_SYSCALL=y 300CONFIG_PCI_SYSCALL=y
286CONFIG_PCIEPORTBUS=y 301CONFIG_PCIEPORTBUS=y
287CONFIG_PCIEAER=y 302CONFIG_PCIEAER=y
303# CONFIG_PCIE_ECRC is not set
304# CONFIG_PCIEAER_INJECT is not set
288# CONFIG_PCIEASPM is not set 305# CONFIG_PCIEASPM is not set
289CONFIG_ARCH_SUPPORTS_MSI=y 306CONFIG_ARCH_SUPPORTS_MSI=y
290# CONFIG_PCI_MSI is not set 307# CONFIG_PCI_MSI is not set
291# CONFIG_PCI_LEGACY is not set 308# CONFIG_PCI_LEGACY is not set
292CONFIG_PCI_DEBUG=y
293# CONFIG_PCI_STUB is not set 309# CONFIG_PCI_STUB is not set
294# CONFIG_PCI_IOV is not set 310# CONFIG_PCI_IOV is not set
295# CONFIG_PCCARD is not set 311CONFIG_PCCARD=y
312# CONFIG_PCMCIA_DEBUG is not set
313CONFIG_PCMCIA=y
314# CONFIG_PCMCIA_LOAD_CIS is not set
315# CONFIG_PCMCIA_IOCTL is not set
316# CONFIG_CARDBUS is not set
317
318#
319# PC-card bridges
320#
321CONFIG_YENTA=y
322# CONFIG_YENTA_O2 is not set
323# CONFIG_YENTA_RICOH is not set
324CONFIG_YENTA_TI=y
325# CONFIG_YENTA_TOSHIBA is not set
326# CONFIG_PD6729 is not set
327# CONFIG_I82092 is not set
328CONFIG_PCCARD_NONSTATIC=y
296# CONFIG_HOTPLUG_PCI is not set 329# CONFIG_HOTPLUG_PCI is not set
297# CONFIG_HAS_RAPIDIO is not set 330# CONFIG_HAS_RAPIDIO is not set
298 331
@@ -353,8 +386,8 @@ CONFIG_INET_XFRM_TUNNEL=m
353CONFIG_INET_TUNNEL=m 386CONFIG_INET_TUNNEL=m
354CONFIG_INET_XFRM_MODE_TRANSPORT=y 387CONFIG_INET_XFRM_MODE_TRANSPORT=y
355CONFIG_INET_XFRM_MODE_TUNNEL=y 388CONFIG_INET_XFRM_MODE_TUNNEL=y
356CONFIG_INET_XFRM_MODE_BEET=y 389# CONFIG_INET_XFRM_MODE_BEET is not set
357# CONFIG_INET_LRO is not set 390CONFIG_INET_LRO=y
358CONFIG_INET_DIAG=y 391CONFIG_INET_DIAG=y
359CONFIG_INET_TCP_DIAG=y 392CONFIG_INET_TCP_DIAG=y
360# CONFIG_TCP_CONG_ADVANCED is not set 393# CONFIG_TCP_CONG_ADVANCED is not set
@@ -380,174 +413,26 @@ CONFIG_IPV6_NDISC_NODETYPE=y
380CONFIG_IPV6_TUNNEL=m 413CONFIG_IPV6_TUNNEL=m
381# CONFIG_IPV6_MULTIPLE_TABLES is not set 414# CONFIG_IPV6_MULTIPLE_TABLES is not set
382# CONFIG_IPV6_MROUTE is not set 415# CONFIG_IPV6_MROUTE is not set
383# CONFIG_NETLABEL is not set
384# CONFIG_NETWORK_SECMARK is not set 416# CONFIG_NETWORK_SECMARK is not set
385CONFIG_NETFILTER=y 417# CONFIG_NETFILTER is not set
386# CONFIG_NETFILTER_DEBUG is not set
387CONFIG_NETFILTER_ADVANCED=y
388CONFIG_BRIDGE_NETFILTER=y
389
390#
391# Core Netfilter Configuration
392#
393# CONFIG_NETFILTER_NETLINK_QUEUE is not set
394# CONFIG_NETFILTER_NETLINK_LOG is not set
395# CONFIG_NF_CONNTRACK is not set
396# CONFIG_NETFILTER_TPROXY is not set
397CONFIG_NETFILTER_XTABLES=m
398# CONFIG_NETFILTER_XT_TARGET_CLASSIFY is not set
399# CONFIG_NETFILTER_XT_TARGET_DSCP is not set
400# CONFIG_NETFILTER_XT_TARGET_HL is not set
401# CONFIG_NETFILTER_XT_TARGET_MARK is not set
402# CONFIG_NETFILTER_XT_TARGET_NFLOG is not set
403# CONFIG_NETFILTER_XT_TARGET_NFQUEUE is not set
404# CONFIG_NETFILTER_XT_TARGET_RATEEST is not set
405# CONFIG_NETFILTER_XT_TARGET_TRACE is not set
406# CONFIG_NETFILTER_XT_TARGET_TCPMSS is not set
407# CONFIG_NETFILTER_XT_TARGET_TCPOPTSTRIP is not set
408# CONFIG_NETFILTER_XT_MATCH_COMMENT is not set
409# CONFIG_NETFILTER_XT_MATCH_DCCP is not set
410# CONFIG_NETFILTER_XT_MATCH_DSCP is not set
411# CONFIG_NETFILTER_XT_MATCH_ESP is not set
412# CONFIG_NETFILTER_XT_MATCH_HASHLIMIT is not set
413CONFIG_NETFILTER_XT_MATCH_HL=m
414# CONFIG_NETFILTER_XT_MATCH_IPRANGE is not set
415# CONFIG_NETFILTER_XT_MATCH_LENGTH is not set
416# CONFIG_NETFILTER_XT_MATCH_LIMIT is not set
417# CONFIG_NETFILTER_XT_MATCH_MAC is not set
418# CONFIG_NETFILTER_XT_MATCH_MARK is not set
419# CONFIG_NETFILTER_XT_MATCH_MULTIPORT is not set
420# CONFIG_NETFILTER_XT_MATCH_OWNER is not set
421# CONFIG_NETFILTER_XT_MATCH_POLICY is not set
422# CONFIG_NETFILTER_XT_MATCH_PHYSDEV is not set
423# CONFIG_NETFILTER_XT_MATCH_PKTTYPE is not set
424# CONFIG_NETFILTER_XT_MATCH_QUOTA is not set
425# CONFIG_NETFILTER_XT_MATCH_RATEEST is not set
426# CONFIG_NETFILTER_XT_MATCH_REALM is not set
427# CONFIG_NETFILTER_XT_MATCH_RECENT is not set
428# CONFIG_NETFILTER_XT_MATCH_SCTP is not set
429# CONFIG_NETFILTER_XT_MATCH_STATISTIC is not set
430# CONFIG_NETFILTER_XT_MATCH_STRING is not set
431# CONFIG_NETFILTER_XT_MATCH_TCPMSS is not set
432# CONFIG_NETFILTER_XT_MATCH_TIME is not set
433# CONFIG_NETFILTER_XT_MATCH_U32 is not set
434# CONFIG_IP_VS is not set
435
436#
437# IP: Netfilter Configuration
438#
439# CONFIG_NF_DEFRAG_IPV4 is not set
440CONFIG_IP_NF_QUEUE=m
441CONFIG_IP_NF_IPTABLES=m
442CONFIG_IP_NF_MATCH_ADDRTYPE=m
443# CONFIG_IP_NF_MATCH_AH is not set
444CONFIG_IP_NF_MATCH_ECN=m
445CONFIG_IP_NF_MATCH_TTL=m
446CONFIG_IP_NF_FILTER=m
447CONFIG_IP_NF_TARGET_REJECT=m
448CONFIG_IP_NF_TARGET_LOG=m
449CONFIG_IP_NF_TARGET_ULOG=m
450CONFIG_IP_NF_MANGLE=m
451CONFIG_IP_NF_TARGET_ECN=m
452# CONFIG_IP_NF_TARGET_TTL is not set
453CONFIG_IP_NF_RAW=m
454# CONFIG_IP_NF_SECURITY is not set
455CONFIG_IP_NF_ARPTABLES=m
456CONFIG_IP_NF_ARPFILTER=m
457CONFIG_IP_NF_ARP_MANGLE=m
458
459#
460# IPv6: Netfilter Configuration
461#
462CONFIG_IP6_NF_QUEUE=m
463CONFIG_IP6_NF_IPTABLES=m
464# CONFIG_IP6_NF_MATCH_AH is not set
465CONFIG_IP6_NF_MATCH_EUI64=m
466CONFIG_IP6_NF_MATCH_FRAG=m
467CONFIG_IP6_NF_MATCH_OPTS=m
468CONFIG_IP6_NF_MATCH_HL=m
469CONFIG_IP6_NF_MATCH_IPV6HEADER=m
470# CONFIG_IP6_NF_MATCH_MH is not set
471CONFIG_IP6_NF_MATCH_RT=m
472# CONFIG_IP6_NF_TARGET_HL is not set
473CONFIG_IP6_NF_TARGET_LOG=m
474CONFIG_IP6_NF_FILTER=m
475# CONFIG_IP6_NF_TARGET_REJECT is not set
476CONFIG_IP6_NF_MANGLE=m
477CONFIG_IP6_NF_RAW=m
478# CONFIG_IP6_NF_SECURITY is not set
479# CONFIG_BRIDGE_NF_EBTABLES is not set
480# CONFIG_IP_DCCP is not set 418# CONFIG_IP_DCCP is not set
481CONFIG_IP_SCTP=m 419# CONFIG_IP_SCTP is not set
482# CONFIG_SCTP_DBG_MSG is not set 420# CONFIG_TIPC is not set
483# CONFIG_SCTP_DBG_OBJCNT is not set 421# CONFIG_ATM is not set
484# CONFIG_SCTP_HMAC_NONE is not set 422# CONFIG_BRIDGE is not set
485# CONFIG_SCTP_HMAC_SHA1 is not set
486CONFIG_SCTP_HMAC_MD5=y
487CONFIG_TIPC=m
488# CONFIG_TIPC_ADVANCED is not set
489# CONFIG_TIPC_DEBUG is not set
490CONFIG_ATM=m
491CONFIG_ATM_CLIP=m
492# CONFIG_ATM_CLIP_NO_ICMP is not set
493CONFIG_ATM_LANE=m
494CONFIG_ATM_MPOA=m
495CONFIG_ATM_BR2684=m
496# CONFIG_ATM_BR2684_IPFILTER is not set
497CONFIG_STP=m
498CONFIG_BRIDGE=m
499# CONFIG_NET_DSA is not set 423# CONFIG_NET_DSA is not set
500CONFIG_VLAN_8021Q=m 424# CONFIG_VLAN_8021Q is not set
501# CONFIG_VLAN_8021Q_GVRP is not set
502# CONFIG_DECNET is not set 425# CONFIG_DECNET is not set
503CONFIG_LLC=m
504# CONFIG_LLC2 is not set 426# CONFIG_LLC2 is not set
505# CONFIG_IPX is not set 427# CONFIG_IPX is not set
506# CONFIG_ATALK is not set 428# CONFIG_ATALK is not set
507# CONFIG_X25 is not set 429# CONFIG_X25 is not set
508# CONFIG_LAPB is not set 430# CONFIG_LAPB is not set
509# CONFIG_ECONET is not set 431# CONFIG_ECONET is not set
510CONFIG_WAN_ROUTER=m 432# CONFIG_WAN_ROUTER is not set
511# CONFIG_PHONET is not set 433# CONFIG_PHONET is not set
512CONFIG_NET_SCHED=y 434# CONFIG_IEEE802154 is not set
513 435# CONFIG_NET_SCHED is not set
514#
515# Queueing/Scheduling
516#
517CONFIG_NET_SCH_CBQ=m
518CONFIG_NET_SCH_HTB=m
519CONFIG_NET_SCH_HFSC=m
520CONFIG_NET_SCH_ATM=m
521CONFIG_NET_SCH_PRIO=m
522# CONFIG_NET_SCH_MULTIQ is not set
523CONFIG_NET_SCH_RED=m
524CONFIG_NET_SCH_SFQ=m
525CONFIG_NET_SCH_TEQL=m
526CONFIG_NET_SCH_TBF=m
527CONFIG_NET_SCH_GRED=m
528CONFIG_NET_SCH_DSMARK=m
529CONFIG_NET_SCH_NETEM=m
530# CONFIG_NET_SCH_DRR is not set
531
532#
533# Classification
534#
535CONFIG_NET_CLS=y
536# CONFIG_NET_CLS_BASIC is not set
537CONFIG_NET_CLS_TCINDEX=m
538CONFIG_NET_CLS_ROUTE4=m
539CONFIG_NET_CLS_ROUTE=y
540CONFIG_NET_CLS_FW=m
541CONFIG_NET_CLS_U32=m
542# CONFIG_CLS_U32_PERF is not set
543# CONFIG_CLS_U32_MARK is not set
544CONFIG_NET_CLS_RSVP=m
545CONFIG_NET_CLS_RSVP6=m
546# CONFIG_NET_CLS_FLOW is not set
547# CONFIG_NET_EMATCH is not set
548# CONFIG_NET_CLS_ACT is not set
549# CONFIG_NET_CLS_IND is not set
550CONFIG_NET_SCH_FIFO=y
551# CONFIG_DCB is not set 436# CONFIG_DCB is not set
552 437
553# 438#
@@ -560,12 +445,7 @@ CONFIG_NET_PKTGEN=m
560# CONFIG_BT is not set 445# CONFIG_BT is not set
561# CONFIG_AF_RXRPC is not set 446# CONFIG_AF_RXRPC is not set
562CONFIG_FIB_RULES=y 447CONFIG_FIB_RULES=y
563CONFIG_WIRELESS=y 448# CONFIG_WIRELESS is not set
564# CONFIG_CFG80211 is not set
565CONFIG_WIRELESS_OLD_REGULATORY=y
566# CONFIG_WIRELESS_EXT is not set
567# CONFIG_LIB80211 is not set
568# CONFIG_MAC80211 is not set
569# CONFIG_WIMAX is not set 449# CONFIG_WIMAX is not set
570# CONFIG_RFKILL is not set 450# CONFIG_RFKILL is not set
571# CONFIG_NET_9P is not set 451# CONFIG_NET_9P is not set
@@ -580,9 +460,9 @@ CONFIG_WIRELESS_OLD_REGULATORY=y
580CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" 460CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
581CONFIG_STANDALONE=y 461CONFIG_STANDALONE=y
582CONFIG_PREVENT_FIRMWARE_BUILD=y 462CONFIG_PREVENT_FIRMWARE_BUILD=y
583# CONFIG_FW_LOADER is not set 463CONFIG_FW_LOADER=y
584# CONFIG_DEBUG_DRIVER is not set 464CONFIG_FIRMWARE_IN_KERNEL=y
585# CONFIG_DEBUG_DEVRES is not set 465CONFIG_EXTRA_FIRMWARE=""
586# CONFIG_SYS_HYPERVISOR is not set 466# CONFIG_SYS_HYPERVISOR is not set
587# CONFIG_CONNECTOR is not set 467# CONFIG_CONNECTOR is not set
588CONFIG_MTD=y 468CONFIG_MTD=y
@@ -672,6 +552,7 @@ CONFIG_MTD_PHYSMAP_OF=y
672CONFIG_OF_DEVICE=y 552CONFIG_OF_DEVICE=y
673CONFIG_OF_GPIO=y 553CONFIG_OF_GPIO=y
674CONFIG_OF_I2C=y 554CONFIG_OF_I2C=y
555CONFIG_OF_MDIO=y
675# CONFIG_PARPORT is not set 556# CONFIG_PARPORT is not set
676CONFIG_BLK_DEV=y 557CONFIG_BLK_DEV=y
677# CONFIG_BLK_DEV_FD is not set 558# CONFIG_BLK_DEV_FD is not set
@@ -707,9 +588,60 @@ CONFIG_MISC_DEVICES=y
707# 588#
708# CONFIG_EEPROM_AT24 is not set 589# CONFIG_EEPROM_AT24 is not set
709# CONFIG_EEPROM_LEGACY is not set 590# CONFIG_EEPROM_LEGACY is not set
591# CONFIG_EEPROM_MAX6875 is not set
710# CONFIG_EEPROM_93CX6 is not set 592# CONFIG_EEPROM_93CX6 is not set
593# CONFIG_CB710_CORE is not set
711CONFIG_HAVE_IDE=y 594CONFIG_HAVE_IDE=y
712# CONFIG_IDE is not set 595CONFIG_IDE=y
596
597#
598# Please see Documentation/ide/ide.txt for help/info on IDE drives
599#
600# CONFIG_BLK_DEV_IDE_SATA is not set
601CONFIG_IDE_GD=y
602CONFIG_IDE_GD_ATA=y
603# CONFIG_IDE_GD_ATAPI is not set
604CONFIG_BLK_DEV_IDECS=y
605# CONFIG_BLK_DEV_IDECD is not set
606# CONFIG_BLK_DEV_IDETAPE is not set
607# CONFIG_IDE_TASK_IOCTL is not set
608CONFIG_IDE_PROC_FS=y
609
610#
611# IDE chipset support/bugfixes
612#
613# CONFIG_BLK_DEV_PLATFORM is not set
614
615#
616# PCI IDE chipsets support
617#
618# CONFIG_BLK_DEV_GENERIC is not set
619# CONFIG_BLK_DEV_OPTI621 is not set
620# CONFIG_BLK_DEV_AEC62XX is not set
621# CONFIG_BLK_DEV_ALI15X3 is not set
622# CONFIG_BLK_DEV_AMD74XX is not set
623# CONFIG_BLK_DEV_CMD64X is not set
624# CONFIG_BLK_DEV_TRIFLEX is not set
625# CONFIG_BLK_DEV_CS5520 is not set
626# CONFIG_BLK_DEV_CS5530 is not set
627# CONFIG_BLK_DEV_HPT366 is not set
628# CONFIG_BLK_DEV_JMICRON is not set
629# CONFIG_BLK_DEV_SC1200 is not set
630# CONFIG_BLK_DEV_PIIX is not set
631# CONFIG_BLK_DEV_IT8172 is not set
632# CONFIG_BLK_DEV_IT8213 is not set
633# CONFIG_BLK_DEV_IT821X is not set
634# CONFIG_BLK_DEV_NS87415 is not set
635# CONFIG_BLK_DEV_PDC202XX_OLD is not set
636# CONFIG_BLK_DEV_PDC202XX_NEW is not set
637# CONFIG_BLK_DEV_SVWKS is not set
638# CONFIG_BLK_DEV_SIIMAGE is not set
639# CONFIG_BLK_DEV_SL82C105 is not set
640# CONFIG_BLK_DEV_SLC90E66 is not set
641# CONFIG_BLK_DEV_TRM290 is not set
642# CONFIG_BLK_DEV_VIA82CXXX is not set
643# CONFIG_BLK_DEV_TC86C001 is not set
644# CONFIG_BLK_DEV_IDEDMA is not set
713 645
714# 646#
715# SCSI device support 647# SCSI device support
@@ -731,10 +663,6 @@ CONFIG_BLK_DEV_SR=y
731# CONFIG_BLK_DEV_SR_VENDOR is not set 663# CONFIG_BLK_DEV_SR_VENDOR is not set
732# CONFIG_CHR_DEV_SG is not set 664# CONFIG_CHR_DEV_SG is not set
733# CONFIG_CHR_DEV_SCH is not set 665# CONFIG_CHR_DEV_SCH is not set
734
735#
736# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
737#
738# CONFIG_SCSI_MULTI_LUN is not set 666# CONFIG_SCSI_MULTI_LUN is not set
739# CONFIG_SCSI_CONSTANTS is not set 667# CONFIG_SCSI_CONSTANTS is not set
740# CONFIG_SCSI_LOGGING is not set 668# CONFIG_SCSI_LOGGING is not set
@@ -751,6 +679,7 @@ CONFIG_SCSI_WAIT_SCAN=m
751# CONFIG_SCSI_SRP_ATTRS is not set 679# CONFIG_SCSI_SRP_ATTRS is not set
752CONFIG_SCSI_LOWLEVEL=y 680CONFIG_SCSI_LOWLEVEL=y
753# CONFIG_ISCSI_TCP is not set 681# CONFIG_ISCSI_TCP is not set
682# CONFIG_SCSI_BNX2_ISCSI is not set
754# CONFIG_BLK_DEV_3W_XXXX_RAID is not set 683# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
755# CONFIG_SCSI_3W_9XXX is not set 684# CONFIG_SCSI_3W_9XXX is not set
756# CONFIG_SCSI_ACARD is not set 685# CONFIG_SCSI_ACARD is not set
@@ -759,6 +688,7 @@ CONFIG_SCSI_LOWLEVEL=y
759# CONFIG_SCSI_AIC7XXX_OLD is not set 688# CONFIG_SCSI_AIC7XXX_OLD is not set
760# CONFIG_SCSI_AIC79XX is not set 689# CONFIG_SCSI_AIC79XX is not set
761# CONFIG_SCSI_AIC94XX is not set 690# CONFIG_SCSI_AIC94XX is not set
691# CONFIG_SCSI_MVSAS is not set
762# CONFIG_SCSI_DPT_I2O is not set 692# CONFIG_SCSI_DPT_I2O is not set
763# CONFIG_SCSI_ADVANSYS is not set 693# CONFIG_SCSI_ADVANSYS is not set
764# CONFIG_SCSI_ARCMSR is not set 694# CONFIG_SCSI_ARCMSR is not set
@@ -778,7 +708,6 @@ CONFIG_SCSI_LOWLEVEL=y
778# CONFIG_SCSI_IPS is not set 708# CONFIG_SCSI_IPS is not set
779# CONFIG_SCSI_INITIO is not set 709# CONFIG_SCSI_INITIO is not set
780# CONFIG_SCSI_INIA100 is not set 710# CONFIG_SCSI_INIA100 is not set
781# CONFIG_SCSI_MVSAS is not set
782# CONFIG_SCSI_STEX is not set 711# CONFIG_SCSI_STEX is not set
783# CONFIG_SCSI_SYM53C8XX_2 is not set 712# CONFIG_SCSI_SYM53C8XX_2 is not set
784# CONFIG_SCSI_IPR is not set 713# CONFIG_SCSI_IPR is not set
@@ -791,6 +720,7 @@ CONFIG_SCSI_LOWLEVEL=y
791# CONFIG_SCSI_NSP32 is not set 720# CONFIG_SCSI_NSP32 is not set
792# CONFIG_SCSI_DEBUG is not set 721# CONFIG_SCSI_DEBUG is not set
793# CONFIG_SCSI_SRP is not set 722# CONFIG_SCSI_SRP is not set
723# CONFIG_SCSI_LOWLEVEL_PCMCIA is not set
794# CONFIG_SCSI_DH is not set 724# CONFIG_SCSI_DH is not set
795# CONFIG_SCSI_OSD_INITIATOR is not set 725# CONFIG_SCSI_OSD_INITIATOR is not set
796CONFIG_ATA=y 726CONFIG_ATA=y
@@ -842,6 +772,7 @@ CONFIG_SATA_SIL=y
842# CONFIG_PATA_NS87415 is not set 772# CONFIG_PATA_NS87415 is not set
843# CONFIG_PATA_OPTI is not set 773# CONFIG_PATA_OPTI is not set
844# CONFIG_PATA_OPTIDMA is not set 774# CONFIG_PATA_OPTIDMA is not set
775# CONFIG_PATA_PCMCIA is not set
845# CONFIG_PATA_PDC_OLD is not set 776# CONFIG_PATA_PDC_OLD is not set
846# CONFIG_PATA_RADISYS is not set 777# CONFIG_PATA_RADISYS is not set
847# CONFIG_PATA_RZ1000 is not set 778# CONFIG_PATA_RZ1000 is not set
@@ -862,14 +793,17 @@ CONFIG_SATA_SIL=y
862# 793#
863 794
864# 795#
865# Enable only one of the two stacks, unless you know what you are doing 796# You can enable one or both FireWire driver stacks.
797#
798
799#
800# See the help texts for more information.
866# 801#
867# CONFIG_FIREWIRE is not set 802# CONFIG_FIREWIRE is not set
868# CONFIG_IEEE1394 is not set 803# CONFIG_IEEE1394 is not set
869# CONFIG_I2O is not set 804# CONFIG_I2O is not set
870# CONFIG_MACINTOSH_DRIVERS is not set 805# CONFIG_MACINTOSH_DRIVERS is not set
871CONFIG_NETDEVICES=y 806CONFIG_NETDEVICES=y
872CONFIG_COMPAT_NET_DEV_OPS=y
873CONFIG_DUMMY=m 807CONFIG_DUMMY=m
874CONFIG_BONDING=m 808CONFIG_BONDING=m
875# CONFIG_MACVLAN is not set 809# CONFIG_MACVLAN is not set
@@ -916,6 +850,7 @@ CONFIG_MII=y
916# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set 850# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
917# CONFIG_NET_PCI is not set 851# CONFIG_NET_PCI is not set
918# CONFIG_B44 is not set 852# CONFIG_B44 is not set
853# CONFIG_KS8842 is not set
919# CONFIG_ATL2 is not set 854# CONFIG_ATL2 is not set
920CONFIG_NETDEV_1000=y 855CONFIG_NETDEV_1000=y
921# CONFIG_ACENIC is not set 856# CONFIG_ACENIC is not set
@@ -935,8 +870,10 @@ CONFIG_NETDEV_1000=y
935# CONFIG_VIA_VELOCITY is not set 870# CONFIG_VIA_VELOCITY is not set
936# CONFIG_TIGON3 is not set 871# CONFIG_TIGON3 is not set
937# CONFIG_BNX2 is not set 872# CONFIG_BNX2 is not set
873# CONFIG_CNIC is not set
938CONFIG_FSL_PQ_MDIO=y 874CONFIG_FSL_PQ_MDIO=y
939CONFIG_GIANFAR=y 875CONFIG_GIANFAR=y
876# CONFIG_MV643XX_ETH is not set
940# CONFIG_QLA3XXX is not set 877# CONFIG_QLA3XXX is not set
941# CONFIG_ATL1 is not set 878# CONFIG_ATL1 is not set
942# CONFIG_ATL1E is not set 879# CONFIG_ATL1E is not set
@@ -963,22 +900,8 @@ CONFIG_GIANFAR=y
963# CONFIG_USB_PEGASUS is not set 900# CONFIG_USB_PEGASUS is not set
964# CONFIG_USB_RTL8150 is not set 901# CONFIG_USB_RTL8150 is not set
965# CONFIG_USB_USBNET is not set 902# CONFIG_USB_USBNET is not set
903# CONFIG_NET_PCMCIA is not set
966# CONFIG_WAN is not set 904# CONFIG_WAN is not set
967CONFIG_ATM_DRIVERS=y
968# CONFIG_ATM_DUMMY is not set
969# CONFIG_ATM_TCP is not set
970# CONFIG_ATM_LANAI is not set
971# CONFIG_ATM_ENI is not set
972# CONFIG_ATM_FIRESTREAM is not set
973# CONFIG_ATM_ZATM is not set
974# CONFIG_ATM_NICSTAR is not set
975# CONFIG_ATM_IDT77252 is not set
976# CONFIG_ATM_AMBASSADOR is not set
977# CONFIG_ATM_HORIZON is not set
978# CONFIG_ATM_IA is not set
979# CONFIG_ATM_FORE200E is not set
980# CONFIG_ATM_HE is not set
981# CONFIG_ATM_SOLOS is not set
982# CONFIG_FDDI is not set 905# CONFIG_FDDI is not set
983# CONFIG_HIPPI is not set 906# CONFIG_HIPPI is not set
984CONFIG_PPP=m 907CONFIG_PPP=m
@@ -990,7 +913,6 @@ CONFIG_PPP_DEFLATE=m
990CONFIG_PPP_BSDCOMP=m 913CONFIG_PPP_BSDCOMP=m
991# CONFIG_PPP_MPPE is not set 914# CONFIG_PPP_MPPE is not set
992CONFIG_PPPOE=m 915CONFIG_PPPOE=m
993CONFIG_PPPOATM=m
994# CONFIG_PPPOL2TP is not set 916# CONFIG_PPPOL2TP is not set
995CONFIG_SLIP=m 917CONFIG_SLIP=m
996CONFIG_SLIP_COMPRESSED=y 918CONFIG_SLIP_COMPRESSED=y
@@ -1010,7 +932,7 @@ CONFIG_NET_POLL_CONTROLLER=y
1010# Input device support 932# Input device support
1011# 933#
1012CONFIG_INPUT=y 934CONFIG_INPUT=y
1013CONFIG_INPUT_FF_MEMLESS=m 935# CONFIG_INPUT_FF_MEMLESS is not set
1014# CONFIG_INPUT_POLLDEV is not set 936# CONFIG_INPUT_POLLDEV is not set
1015 937
1016# 938#
@@ -1058,6 +980,7 @@ CONFIG_DEVKMEM=y
1058CONFIG_SERIAL_8250=y 980CONFIG_SERIAL_8250=y
1059CONFIG_SERIAL_8250_CONSOLE=y 981CONFIG_SERIAL_8250_CONSOLE=y
1060# CONFIG_SERIAL_8250_PCI is not set 982# CONFIG_SERIAL_8250_PCI is not set
983# CONFIG_SERIAL_8250_CS is not set
1061CONFIG_SERIAL_8250_NR_UARTS=2 984CONFIG_SERIAL_8250_NR_UARTS=2
1062CONFIG_SERIAL_8250_RUNTIME_UARTS=2 985CONFIG_SERIAL_8250_RUNTIME_UARTS=2
1063# CONFIG_SERIAL_8250_EXTENDED is not set 986# CONFIG_SERIAL_8250_EXTENDED is not set
@@ -1080,6 +1003,14 @@ CONFIG_HW_RANDOM=y
1080CONFIG_NVRAM=y 1003CONFIG_NVRAM=y
1081# CONFIG_R3964 is not set 1004# CONFIG_R3964 is not set
1082# CONFIG_APPLICOM is not set 1005# CONFIG_APPLICOM is not set
1006
1007#
1008# PCMCIA character devices
1009#
1010# CONFIG_SYNCLINK_CS is not set
1011# CONFIG_CARDMAN_4000 is not set
1012# CONFIG_CARDMAN_4040 is not set
1013# CONFIG_IPWIRELESS is not set
1083# CONFIG_RAW_DRIVER is not set 1014# CONFIG_RAW_DRIVER is not set
1084# CONFIG_TCG_TPM is not set 1015# CONFIG_TCG_TPM is not set
1085CONFIG_DEVPORT=y 1016CONFIG_DEVPORT=y
@@ -1143,18 +1074,21 @@ CONFIG_DS1682=y
1143# CONFIG_SENSORS_PCF8574 is not set 1074# CONFIG_SENSORS_PCF8574 is not set
1144# CONFIG_PCF8575 is not set 1075# CONFIG_PCF8575 is not set
1145# CONFIG_SENSORS_PCA9539 is not set 1076# CONFIG_SENSORS_PCA9539 is not set
1146# CONFIG_SENSORS_MAX6875 is not set
1147# CONFIG_SENSORS_TSL2550 is not set 1077# CONFIG_SENSORS_TSL2550 is not set
1148# CONFIG_I2C_DEBUG_CORE is not set 1078# CONFIG_I2C_DEBUG_CORE is not set
1149# CONFIG_I2C_DEBUG_ALGO is not set 1079# CONFIG_I2C_DEBUG_ALGO is not set
1150# CONFIG_I2C_DEBUG_BUS is not set 1080# CONFIG_I2C_DEBUG_BUS is not set
1151# CONFIG_I2C_DEBUG_CHIP is not set 1081# CONFIG_I2C_DEBUG_CHIP is not set
1152# CONFIG_SPI is not set 1082# CONFIG_SPI is not set
1083
1084#
1085# PPS support
1086#
1087# CONFIG_PPS is not set
1153CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y 1088CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
1154CONFIG_ARCH_REQUIRE_GPIOLIB=y 1089CONFIG_ARCH_REQUIRE_GPIOLIB=y
1155CONFIG_GPIOLIB=y 1090CONFIG_GPIOLIB=y
1156# CONFIG_DEBUG_GPIO is not set 1091CONFIG_GPIO_SYSFS=y
1157# CONFIG_GPIO_SYSFS is not set
1158 1092
1159# 1093#
1160# Memory mapped GPIO expanders: 1094# Memory mapped GPIO expanders:
@@ -1229,6 +1163,7 @@ CONFIG_SENSORS_LM92=y
1229# CONFIG_SENSORS_SMSC47B397 is not set 1163# CONFIG_SENSORS_SMSC47B397 is not set
1230# CONFIG_SENSORS_ADS7828 is not set 1164# CONFIG_SENSORS_ADS7828 is not set
1231# CONFIG_SENSORS_THMC50 is not set 1165# CONFIG_SENSORS_THMC50 is not set
1166# CONFIG_SENSORS_TMP401 is not set
1232# CONFIG_SENSORS_VIA686A is not set 1167# CONFIG_SENSORS_VIA686A is not set
1233# CONFIG_SENSORS_VT1211 is not set 1168# CONFIG_SENSORS_VT1211 is not set
1234# CONFIG_SENSORS_VT8231 is not set 1169# CONFIG_SENSORS_VT8231 is not set
@@ -1284,24 +1219,9 @@ CONFIG_SSB_POSSIBLE=y
1284# CONFIG_MFD_WM8400 is not set 1219# CONFIG_MFD_WM8400 is not set
1285# CONFIG_MFD_WM8350_I2C is not set 1220# CONFIG_MFD_WM8350_I2C is not set
1286# CONFIG_MFD_PCF50633 is not set 1221# CONFIG_MFD_PCF50633 is not set
1222# CONFIG_AB3100_CORE is not set
1287# CONFIG_REGULATOR is not set 1223# CONFIG_REGULATOR is not set
1288 1224# CONFIG_MEDIA_SUPPORT is not set
1289#
1290# Multimedia devices
1291#
1292
1293#
1294# Multimedia core support
1295#
1296# CONFIG_VIDEO_DEV is not set
1297# CONFIG_DVB_CORE is not set
1298# CONFIG_VIDEO_MEDIA is not set
1299
1300#
1301# Multimedia drivers
1302#
1303CONFIG_DAB=y
1304# CONFIG_USB_DABUSB is not set
1305 1225
1306# 1226#
1307# Graphics support 1227# Graphics support
@@ -1346,7 +1266,7 @@ CONFIG_HID_BELKIN=y
1346CONFIG_HID_CHERRY=y 1266CONFIG_HID_CHERRY=y
1347CONFIG_HID_CHICONY=y 1267CONFIG_HID_CHICONY=y
1348CONFIG_HID_CYPRESS=y 1268CONFIG_HID_CYPRESS=y
1349# CONFIG_DRAGONRISE_FF is not set 1269# CONFIG_HID_DRAGONRISE is not set
1350CONFIG_HID_EZKEY=y 1270CONFIG_HID_EZKEY=y
1351# CONFIG_HID_KYE is not set 1271# CONFIG_HID_KYE is not set
1352CONFIG_HID_GYRATION=y 1272CONFIG_HID_GYRATION=y
@@ -1363,10 +1283,11 @@ CONFIG_HID_PETALYNX=y
1363CONFIG_HID_SAMSUNG=y 1283CONFIG_HID_SAMSUNG=y
1364CONFIG_HID_SONY=y 1284CONFIG_HID_SONY=y
1365CONFIG_HID_SUNPLUS=y 1285CONFIG_HID_SUNPLUS=y
1366# CONFIG_GREENASIA_FF is not set 1286# CONFIG_HID_GREENASIA is not set
1287# CONFIG_HID_SMARTJOYPLUS is not set
1367# CONFIG_HID_TOPSEED is not set 1288# CONFIG_HID_TOPSEED is not set
1368CONFIG_THRUSTMASTER_FF=m 1289# CONFIG_HID_THRUSTMASTER is not set
1369CONFIG_ZEROPLUS_FF=m 1290# CONFIG_HID_ZEROPLUS is not set
1370CONFIG_USB_SUPPORT=y 1291CONFIG_USB_SUPPORT=y
1371CONFIG_USB_ARCH_HAS_HCD=y 1292CONFIG_USB_ARCH_HAS_HCD=y
1372CONFIG_USB_ARCH_HAS_OHCI=y 1293CONFIG_USB_ARCH_HAS_OHCI=y
@@ -1392,6 +1313,7 @@ CONFIG_USB=y
1392# USB Host Controller Drivers 1313# USB Host Controller Drivers
1393# 1314#
1394# CONFIG_USB_C67X00_HCD is not set 1315# CONFIG_USB_C67X00_HCD is not set
1316# CONFIG_USB_XHCI_HCD is not set
1395CONFIG_USB_EHCI_HCD=y 1317CONFIG_USB_EHCI_HCD=y
1396# CONFIG_USB_EHCI_ROOT_HUB_TT is not set 1318# CONFIG_USB_EHCI_ROOT_HUB_TT is not set
1397# CONFIG_USB_EHCI_TT_NEWSCHED is not set 1319# CONFIG_USB_EHCI_TT_NEWSCHED is not set
@@ -1401,6 +1323,8 @@ CONFIG_USB_EHCI_HCD=y
1401# CONFIG_USB_ISP116X_HCD is not set 1323# CONFIG_USB_ISP116X_HCD is not set
1402# CONFIG_USB_ISP1760_HCD is not set 1324# CONFIG_USB_ISP1760_HCD is not set
1403CONFIG_USB_OHCI_HCD=y 1325CONFIG_USB_OHCI_HCD=y
1326# CONFIG_USB_OHCI_HCD_PPC_OF_BE is not set
1327# CONFIG_USB_OHCI_HCD_PPC_OF_LE is not set
1404# CONFIG_USB_OHCI_HCD_PPC_OF is not set 1328# CONFIG_USB_OHCI_HCD_PPC_OF is not set
1405# CONFIG_USB_OHCI_BIG_ENDIAN_DESC is not set 1329# CONFIG_USB_OHCI_BIG_ENDIAN_DESC is not set
1406# CONFIG_USB_OHCI_BIG_ENDIAN_MMIO is not set 1330# CONFIG_USB_OHCI_BIG_ENDIAN_MMIO is not set
@@ -1475,7 +1399,6 @@ CONFIG_USB_STORAGE=y
1475# CONFIG_USB_IOWARRIOR is not set 1399# CONFIG_USB_IOWARRIOR is not set
1476# CONFIG_USB_ISIGHTFW is not set 1400# CONFIG_USB_ISIGHTFW is not set
1477# CONFIG_USB_VST is not set 1401# CONFIG_USB_VST is not set
1478# CONFIG_USB_ATM is not set
1479# CONFIG_USB_GADGET is not set 1402# CONFIG_USB_GADGET is not set
1480 1403
1481# 1404#
@@ -1521,6 +1444,7 @@ CONFIG_RTC_INTF_DEV=y
1521# CONFIG_RTC_DRV_S35390A is not set 1444# CONFIG_RTC_DRV_S35390A is not set
1522# CONFIG_RTC_DRV_FM3130 is not set 1445# CONFIG_RTC_DRV_FM3130 is not set
1523CONFIG_RTC_DRV_RX8581=y 1446CONFIG_RTC_DRV_RX8581=y
1447# CONFIG_RTC_DRV_RX8025 is not set
1524 1448
1525# 1449#
1526# SPI RTC drivers 1450# SPI RTC drivers
@@ -1548,6 +1472,10 @@ CONFIG_RTC_DRV_RX8581=y
1548# CONFIG_DMADEVICES is not set 1472# CONFIG_DMADEVICES is not set
1549# CONFIG_AUXDISPLAY is not set 1473# CONFIG_AUXDISPLAY is not set
1550# CONFIG_UIO is not set 1474# CONFIG_UIO is not set
1475
1476#
1477# TI VLYNQ
1478#
1551# CONFIG_STAGING is not set 1479# CONFIG_STAGING is not set
1552 1480
1553# 1481#
@@ -1569,10 +1497,12 @@ CONFIG_FS_MBCACHE=y
1569# CONFIG_REISERFS_FS is not set 1497# CONFIG_REISERFS_FS is not set
1570# CONFIG_JFS_FS is not set 1498# CONFIG_JFS_FS is not set
1571CONFIG_FS_POSIX_ACL=y 1499CONFIG_FS_POSIX_ACL=y
1572CONFIG_FILE_LOCKING=y
1573# CONFIG_XFS_FS is not set 1500# CONFIG_XFS_FS is not set
1501# CONFIG_GFS2_FS is not set
1574# CONFIG_OCFS2_FS is not set 1502# CONFIG_OCFS2_FS is not set
1575# CONFIG_BTRFS_FS is not set 1503# CONFIG_BTRFS_FS is not set
1504CONFIG_FILE_LOCKING=y
1505CONFIG_FSNOTIFY=y
1576CONFIG_DNOTIFY=y 1506CONFIG_DNOTIFY=y
1577CONFIG_INOTIFY=y 1507CONFIG_INOTIFY=y
1578CONFIG_INOTIFY_USER=y 1508CONFIG_INOTIFY_USER=y
@@ -1589,8 +1519,11 @@ CONFIG_INOTIFY_USER=y
1589# 1519#
1590# CD-ROM/DVD Filesystems 1520# CD-ROM/DVD Filesystems
1591# 1521#
1592# CONFIG_ISO9660_FS is not set 1522CONFIG_ISO9660_FS=y
1593# CONFIG_UDF_FS is not set 1523CONFIG_JOLIET=y
1524CONFIG_ZISOFS=y
1525CONFIG_UDF_FS=y
1526CONFIG_UDF_NLS=y
1594 1527
1595# 1528#
1596# DOS/FAT/NT Filesystems 1529# DOS/FAT/NT Filesystems
@@ -1598,8 +1531,8 @@ CONFIG_INOTIFY_USER=y
1598CONFIG_FAT_FS=y 1531CONFIG_FAT_FS=y
1599CONFIG_MSDOS_FS=y 1532CONFIG_MSDOS_FS=y
1600CONFIG_VFAT_FS=y 1533CONFIG_VFAT_FS=y
1601CONFIG_FAT_DEFAULT_CODEPAGE=437 1534CONFIG_FAT_DEFAULT_CODEPAGE=850
1602CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1" 1535CONFIG_FAT_DEFAULT_IOCHARSET="ascii"
1603# CONFIG_NTFS_FS is not set 1536# CONFIG_NTFS_FS is not set
1604 1537
1605# 1538#
@@ -1649,6 +1582,7 @@ CONFIG_NFS_FS=y
1649CONFIG_NFS_V3=y 1582CONFIG_NFS_V3=y
1650# CONFIG_NFS_V3_ACL is not set 1583# CONFIG_NFS_V3_ACL is not set
1651CONFIG_NFS_V4=y 1584CONFIG_NFS_V4=y
1585# CONFIG_NFS_V4_1 is not set
1652CONFIG_ROOT_NFS=y 1586CONFIG_ROOT_NFS=y
1653# CONFIG_NFSD is not set 1587# CONFIG_NFSD is not set
1654CONFIG_LOCKD=y 1588CONFIG_LOCKD=y
@@ -1723,13 +1657,13 @@ CONFIG_NLS_UTF8=m
1723# 1657#
1724CONFIG_BITREVERSE=y 1658CONFIG_BITREVERSE=y
1725CONFIG_GENERIC_FIND_LAST_BIT=y 1659CONFIG_GENERIC_FIND_LAST_BIT=y
1726CONFIG_CRC_CCITT=m 1660CONFIG_CRC_CCITT=y
1727# CONFIG_CRC16 is not set 1661# CONFIG_CRC16 is not set
1728# CONFIG_CRC_T10DIF is not set 1662CONFIG_CRC_T10DIF=y
1729# CONFIG_CRC_ITU_T is not set 1663CONFIG_CRC_ITU_T=y
1730CONFIG_CRC32=y 1664CONFIG_CRC32=y
1731# CONFIG_CRC7 is not set 1665# CONFIG_CRC7 is not set
1732CONFIG_LIBCRC32C=m 1666CONFIG_LIBCRC32C=y
1733CONFIG_ZLIB_INFLATE=y 1667CONFIG_ZLIB_INFLATE=y
1734CONFIG_ZLIB_DEFLATE=y 1668CONFIG_ZLIB_DEFLATE=y
1735CONFIG_DECOMPRESS_GZIP=y 1669CONFIG_DECOMPRESS_GZIP=y
@@ -1738,6 +1672,7 @@ CONFIG_HAS_IOPORT=y
1738CONFIG_HAS_DMA=y 1672CONFIG_HAS_DMA=y
1739CONFIG_HAVE_LMB=y 1673CONFIG_HAVE_LMB=y
1740CONFIG_NLATTR=y 1674CONFIG_NLATTR=y
1675CONFIG_GENERIC_ATOMIC64=y
1741 1676
1742# 1677#
1743# Kernel hacking 1678# Kernel hacking
@@ -1750,75 +1685,24 @@ CONFIG_MAGIC_SYSRQ=y
1750# CONFIG_UNUSED_SYMBOLS is not set 1685# CONFIG_UNUSED_SYMBOLS is not set
1751# CONFIG_DEBUG_FS is not set 1686# CONFIG_DEBUG_FS is not set
1752# CONFIG_HEADERS_CHECK is not set 1687# CONFIG_HEADERS_CHECK is not set
1753CONFIG_DEBUG_KERNEL=y 1688# CONFIG_DEBUG_KERNEL is not set
1754# CONFIG_DEBUG_SHIRQ is not set
1755CONFIG_DETECT_SOFTLOCKUP=y
1756# CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC is not set
1757CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE=0
1758CONFIG_DETECT_HUNG_TASK=y
1759# CONFIG_BOOTPARAM_HUNG_TASK_PANIC is not set
1760CONFIG_BOOTPARAM_HUNG_TASK_PANIC_VALUE=0
1761CONFIG_SCHED_DEBUG=y
1762# CONFIG_SCHEDSTATS is not set
1763# CONFIG_TIMER_STATS is not set
1764# CONFIG_DEBUG_OBJECTS is not set
1765# CONFIG_DEBUG_SLAB is not set
1766# CONFIG_DEBUG_RT_MUTEXES is not set
1767# CONFIG_RT_MUTEX_TESTER is not set
1768# CONFIG_DEBUG_SPINLOCK is not set
1769# CONFIG_DEBUG_MUTEXES is not set
1770# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
1771# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
1772# CONFIG_DEBUG_KOBJECT is not set
1773# CONFIG_DEBUG_BUGVERBOSE is not set 1689# CONFIG_DEBUG_BUGVERBOSE is not set
1774CONFIG_DEBUG_INFO=y
1775# CONFIG_DEBUG_VM is not set
1776# CONFIG_DEBUG_WRITECOUNT is not set
1777# CONFIG_DEBUG_MEMORY_INIT is not set 1690# CONFIG_DEBUG_MEMORY_INIT is not set
1778# CONFIG_DEBUG_LIST is not set
1779# CONFIG_DEBUG_SG is not set
1780# CONFIG_DEBUG_NOTIFIERS is not set
1781# CONFIG_BOOT_PRINTK_DELAY is not set
1782# CONFIG_RCU_TORTURE_TEST is not set
1783# CONFIG_RCU_CPU_STALL_DETECTOR is not set 1691# CONFIG_RCU_CPU_STALL_DETECTOR is not set
1784# CONFIG_BACKTRACE_SELF_TEST is not set
1785# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
1786# CONFIG_FAULT_INJECTION is not set
1787# CONFIG_LATENCYTOP is not set 1692# CONFIG_LATENCYTOP is not set
1788CONFIG_SYSCTL_SYSCALL_CHECK=y 1693CONFIG_SYSCTL_SYSCALL_CHECK=y
1789# CONFIG_DEBUG_PAGEALLOC is not set
1790CONFIG_HAVE_FUNCTION_TRACER=y 1694CONFIG_HAVE_FUNCTION_TRACER=y
1791CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y 1695CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
1792CONFIG_HAVE_DYNAMIC_FTRACE=y 1696CONFIG_HAVE_DYNAMIC_FTRACE=y
1793CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y 1697CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
1794CONFIG_TRACING_SUPPORT=y 1698CONFIG_TRACING_SUPPORT=y
1795 1699# CONFIG_FTRACE is not set
1796#
1797# Tracers
1798#
1799# CONFIG_FUNCTION_TRACER is not set
1800# CONFIG_PREEMPT_TRACER is not set
1801# CONFIG_SCHED_TRACER is not set
1802# CONFIG_CONTEXT_SWITCH_TRACER is not set
1803# CONFIG_EVENT_TRACER is not set
1804# CONFIG_BOOT_TRACER is not set
1805# CONFIG_TRACE_BRANCH_PROFILING is not set
1806# CONFIG_STACK_TRACER is not set
1807# CONFIG_KMEMTRACE is not set
1808# CONFIG_WORKQUEUE_TRACER is not set
1809# CONFIG_BLK_DEV_IO_TRACE is not set
1810# CONFIG_SAMPLES is not set 1700# CONFIG_SAMPLES is not set
1811CONFIG_HAVE_ARCH_KGDB=y 1701CONFIG_HAVE_ARCH_KGDB=y
1812# CONFIG_KGDB is not set 1702# CONFIG_PPC_DISABLE_WERROR is not set
1703CONFIG_PPC_WERROR=y
1813CONFIG_PRINT_STACK_DEPTH=64 1704CONFIG_PRINT_STACK_DEPTH=64
1814# CONFIG_DEBUG_STACKOVERFLOW is not set
1815# CONFIG_DEBUG_STACK_USAGE is not set
1816# CONFIG_CODE_PATCHING_SELFTEST is not set
1817# CONFIG_FTR_FIXUP_SELFTEST is not set
1818# CONFIG_MSI_BITMAP_SELFTEST is not set
1819# CONFIG_XMON is not set
1820# CONFIG_IRQSTACKS is not set 1705# CONFIG_IRQSTACKS is not set
1821# CONFIG_BDI_SWITCH is not set
1822# CONFIG_BOOTX_TEXT is not set 1706# CONFIG_BOOTX_TEXT is not set
1823# CONFIG_PPC_EARLY_DEBUG is not set 1707# CONFIG_PPC_EARLY_DEBUG is not set
1824 1708
@@ -1826,15 +1710,9 @@ CONFIG_PRINT_STACK_DEPTH=64
1826# Security options 1710# Security options
1827# 1711#
1828# CONFIG_KEYS is not set 1712# CONFIG_KEYS is not set
1829CONFIG_SECURITY=y 1713# CONFIG_SECURITY is not set
1830# CONFIG_SECURITYFS is not set 1714# CONFIG_SECURITYFS is not set
1831CONFIG_SECURITY_NETWORK=y
1832# CONFIG_SECURITY_NETWORK_XFRM is not set
1833# CONFIG_SECURITY_PATH is not set
1834# CONFIG_SECURITY_FILE_CAPABILITIES is not set 1715# CONFIG_SECURITY_FILE_CAPABILITIES is not set
1835# CONFIG_SECURITY_ROOTPLUG is not set
1836CONFIG_SECURITY_DEFAULT_MMAP_MIN_ADDR=0
1837# CONFIG_SECURITY_TOMOYO is not set
1838CONFIG_CRYPTO=y 1716CONFIG_CRYPTO=y
1839 1717
1840# 1718#
@@ -1854,11 +1732,11 @@ CONFIG_CRYPTO_PCOMP=y
1854CONFIG_CRYPTO_MANAGER=y 1732CONFIG_CRYPTO_MANAGER=y
1855CONFIG_CRYPTO_MANAGER2=y 1733CONFIG_CRYPTO_MANAGER2=y
1856# CONFIG_CRYPTO_GF128MUL is not set 1734# CONFIG_CRYPTO_GF128MUL is not set
1857CONFIG_CRYPTO_NULL=m 1735# CONFIG_CRYPTO_NULL is not set
1858CONFIG_CRYPTO_WORKQUEUE=y 1736CONFIG_CRYPTO_WORKQUEUE=y
1859# CONFIG_CRYPTO_CRYPTD is not set 1737# CONFIG_CRYPTO_CRYPTD is not set
1860CONFIG_CRYPTO_AUTHENC=m 1738CONFIG_CRYPTO_AUTHENC=m
1861CONFIG_CRYPTO_TEST=m 1739# CONFIG_CRYPTO_TEST is not set
1862 1740
1863# 1741#
1864# Authenticated Encryption with Associated Data 1742# Authenticated Encryption with Associated Data
@@ -1873,53 +1751,52 @@ CONFIG_CRYPTO_TEST=m
1873CONFIG_CRYPTO_CBC=y 1751CONFIG_CRYPTO_CBC=y
1874# CONFIG_CRYPTO_CTR is not set 1752# CONFIG_CRYPTO_CTR is not set
1875# CONFIG_CRYPTO_CTS is not set 1753# CONFIG_CRYPTO_CTS is not set
1876CONFIG_CRYPTO_ECB=m 1754# CONFIG_CRYPTO_ECB is not set
1877# CONFIG_CRYPTO_LRW is not set 1755# CONFIG_CRYPTO_LRW is not set
1878CONFIG_CRYPTO_PCBC=m 1756# CONFIG_CRYPTO_PCBC is not set
1879# CONFIG_CRYPTO_XTS is not set 1757# CONFIG_CRYPTO_XTS is not set
1880 1758
1881# 1759#
1882# Hash modes 1760# Hash modes
1883# 1761#
1884CONFIG_CRYPTO_HMAC=y 1762CONFIG_CRYPTO_HMAC=m
1885# CONFIG_CRYPTO_XCBC is not set 1763# CONFIG_CRYPTO_XCBC is not set
1886 1764
1887# 1765#
1888# Digest 1766# Digest
1889# 1767#
1890CONFIG_CRYPTO_CRC32C=m 1768CONFIG_CRYPTO_CRC32C=y
1891CONFIG_CRYPTO_MD4=m 1769# CONFIG_CRYPTO_MD4 is not set
1892CONFIG_CRYPTO_MD5=y 1770CONFIG_CRYPTO_MD5=y
1893CONFIG_CRYPTO_MICHAEL_MIC=m 1771# CONFIG_CRYPTO_MICHAEL_MIC is not set
1894# CONFIG_CRYPTO_RMD128 is not set 1772# CONFIG_CRYPTO_RMD128 is not set
1895# CONFIG_CRYPTO_RMD160 is not set 1773# CONFIG_CRYPTO_RMD160 is not set
1896# CONFIG_CRYPTO_RMD256 is not set 1774# CONFIG_CRYPTO_RMD256 is not set
1897# CONFIG_CRYPTO_RMD320 is not set 1775# CONFIG_CRYPTO_RMD320 is not set
1898CONFIG_CRYPTO_SHA1=m 1776CONFIG_CRYPTO_SHA1=m
1899CONFIG_CRYPTO_SHA256=m 1777# CONFIG_CRYPTO_SHA256 is not set
1900CONFIG_CRYPTO_SHA512=m 1778# CONFIG_CRYPTO_SHA512 is not set
1901# CONFIG_CRYPTO_TGR192 is not set 1779# CONFIG_CRYPTO_TGR192 is not set
1902CONFIG_CRYPTO_WP512=m 1780# CONFIG_CRYPTO_WP512 is not set
1903 1781
1904# 1782#
1905# Ciphers 1783# Ciphers
1906# 1784#
1907CONFIG_CRYPTO_AES=m 1785# CONFIG_CRYPTO_AES is not set
1908CONFIG_CRYPTO_ANUBIS=m 1786# CONFIG_CRYPTO_ANUBIS is not set
1909CONFIG_CRYPTO_ARC4=m 1787# CONFIG_CRYPTO_ARC4 is not set
1910CONFIG_CRYPTO_BLOWFISH=m 1788# CONFIG_CRYPTO_BLOWFISH is not set
1911# CONFIG_CRYPTO_CAMELLIA is not set 1789# CONFIG_CRYPTO_CAMELLIA is not set
1912CONFIG_CRYPTO_CAST5=m 1790# CONFIG_CRYPTO_CAST5 is not set
1913CONFIG_CRYPTO_CAST6=m 1791# CONFIG_CRYPTO_CAST6 is not set
1914CONFIG_CRYPTO_DES=y 1792CONFIG_CRYPTO_DES=y
1915# CONFIG_CRYPTO_FCRYPT is not set 1793# CONFIG_CRYPTO_FCRYPT is not set
1916CONFIG_CRYPTO_KHAZAD=m 1794# CONFIG_CRYPTO_KHAZAD is not set
1917# CONFIG_CRYPTO_SALSA20 is not set 1795# CONFIG_CRYPTO_SALSA20 is not set
1918# CONFIG_CRYPTO_SEED is not set 1796# CONFIG_CRYPTO_SEED is not set
1919CONFIG_CRYPTO_SERPENT=m 1797# CONFIG_CRYPTO_SERPENT is not set
1920CONFIG_CRYPTO_TEA=m 1798# CONFIG_CRYPTO_TEA is not set
1921CONFIG_CRYPTO_TWOFISH=m 1799# CONFIG_CRYPTO_TWOFISH is not set
1922CONFIG_CRYPTO_TWOFISH_COMMON=m
1923 1800
1924# 1801#
1925# Compression 1802# Compression
diff --git a/arch/powerpc/configs/86xx/gef_sbc310_defconfig b/arch/powerpc/configs/86xx/gef_sbc310_defconfig
index a66910e63345..cd338d493bed 100644
--- a/arch/powerpc/configs/86xx/gef_sbc310_defconfig
+++ b/arch/powerpc/configs/86xx/gef_sbc310_defconfig
@@ -1,26 +1,28 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.30-rc3 3# Linux kernel version: 2.6.31-rc4
4# Wed May 13 17:22:29 2009 4# Wed Jul 29 23:32:29 2009
5# 5#
6# CONFIG_PPC64 is not set 6# CONFIG_PPC64 is not set
7 7
8# 8#
9# Processor support 9# Processor support
10# 10#
11CONFIG_6xx=y 11CONFIG_PPC_BOOK3S_32=y
12# CONFIG_PPC_85xx is not set 12# CONFIG_PPC_85xx is not set
13# CONFIG_PPC_8xx is not set 13# CONFIG_PPC_8xx is not set
14# CONFIG_40x is not set 14# CONFIG_40x is not set
15# CONFIG_44x is not set 15# CONFIG_44x is not set
16# CONFIG_E200 is not set 16# CONFIG_E200 is not set
17CONFIG_PPC_BOOK3S=y 17CONFIG_PPC_BOOK3S=y
18CONFIG_6xx=y
18CONFIG_PPC_FPU=y 19CONFIG_PPC_FPU=y
19# CONFIG_PHYS_64BIT is not set 20# CONFIG_PHYS_64BIT is not set
20CONFIG_ALTIVEC=y 21CONFIG_ALTIVEC=y
21CONFIG_PPC_STD_MMU=y 22CONFIG_PPC_STD_MMU=y
22CONFIG_PPC_STD_MMU_32=y 23CONFIG_PPC_STD_MMU_32=y
23# CONFIG_PPC_MM_SLICES is not set 24# CONFIG_PPC_MM_SLICES is not set
25CONFIG_PPC_HAVE_PMU_SUPPORT=y
24CONFIG_SMP=y 26CONFIG_SMP=y
25CONFIG_NR_CPUS=2 27CONFIG_NR_CPUS=2
26CONFIG_PPC32=y 28CONFIG_PPC32=y
@@ -32,16 +34,17 @@ CONFIG_GENERIC_TIME=y
32CONFIG_GENERIC_TIME_VSYSCALL=y 34CONFIG_GENERIC_TIME_VSYSCALL=y
33CONFIG_GENERIC_CLOCKEVENTS=y 35CONFIG_GENERIC_CLOCKEVENTS=y
34CONFIG_GENERIC_HARDIRQS=y 36CONFIG_GENERIC_HARDIRQS=y
37CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
35# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set 38# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set
36CONFIG_IRQ_PER_CPU=y 39CONFIG_IRQ_PER_CPU=y
37CONFIG_STACKTRACE_SUPPORT=y 40CONFIG_STACKTRACE_SUPPORT=y
38CONFIG_HAVE_LATENCYTOP_SUPPORT=y 41CONFIG_HAVE_LATENCYTOP_SUPPORT=y
42CONFIG_TRACE_IRQFLAGS_SUPPORT=y
39CONFIG_LOCKDEP_SUPPORT=y 43CONFIG_LOCKDEP_SUPPORT=y
40CONFIG_RWSEM_XCHGADD_ALGORITHM=y 44CONFIG_RWSEM_XCHGADD_ALGORITHM=y
41CONFIG_GENERIC_LOCKBREAK=y 45CONFIG_GENERIC_LOCKBREAK=y
42CONFIG_ARCH_HAS_ILOG2_U32=y 46CONFIG_ARCH_HAS_ILOG2_U32=y
43CONFIG_GENERIC_HWEIGHT=y 47CONFIG_GENERIC_HWEIGHT=y
44CONFIG_GENERIC_CALIBRATE_DELAY=y
45CONFIG_GENERIC_FIND_NEXT_BIT=y 48CONFIG_GENERIC_FIND_NEXT_BIT=y
46CONFIG_GENERIC_GPIO=y 49CONFIG_GENERIC_GPIO=y
47# CONFIG_ARCH_NO_VIRT_TO_BUS is not set 50# CONFIG_ARCH_NO_VIRT_TO_BUS is not set
@@ -56,11 +59,13 @@ CONFIG_PPC_UDBG_16550=y
56CONFIG_GENERIC_TBSYNC=y 59CONFIG_GENERIC_TBSYNC=y
57CONFIG_AUDIT_ARCH=y 60CONFIG_AUDIT_ARCH=y
58CONFIG_GENERIC_BUG=y 61CONFIG_GENERIC_BUG=y
62CONFIG_DTC=y
59CONFIG_DEFAULT_UIMAGE=y 63CONFIG_DEFAULT_UIMAGE=y
60# CONFIG_PPC_DCR_NATIVE is not set 64# CONFIG_PPC_DCR_NATIVE is not set
61# CONFIG_PPC_DCR_MMIO is not set 65# CONFIG_PPC_DCR_MMIO is not set
62CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y 66CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y
63CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" 67CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
68CONFIG_CONSTRUCTORS=y
64 69
65# 70#
66# General setup 71# General setup
@@ -91,7 +96,11 @@ CONFIG_CLASSIC_RCU=y
91CONFIG_IKCONFIG=y 96CONFIG_IKCONFIG=y
92CONFIG_IKCONFIG_PROC=y 97CONFIG_IKCONFIG_PROC=y
93CONFIG_LOG_BUF_SHIFT=14 98CONFIG_LOG_BUF_SHIFT=14
94# CONFIG_GROUP_SCHED is not set 99CONFIG_GROUP_SCHED=y
100CONFIG_FAIR_GROUP_SCHED=y
101# CONFIG_RT_GROUP_SCHED is not set
102CONFIG_USER_SCHED=y
103# CONFIG_CGROUP_SCHED is not set
95# CONFIG_CGROUPS is not set 104# CONFIG_CGROUPS is not set
96CONFIG_SYSFS_DEPRECATED=y 105CONFIG_SYSFS_DEPRECATED=y
97CONFIG_SYSFS_DEPRECATED_V2=y 106CONFIG_SYSFS_DEPRECATED_V2=y
@@ -109,7 +118,6 @@ CONFIG_EMBEDDED=y
109CONFIG_SYSCTL_SYSCALL=y 118CONFIG_SYSCTL_SYSCALL=y
110CONFIG_KALLSYMS=y 119CONFIG_KALLSYMS=y
111# CONFIG_KALLSYMS_EXTRA_PASS is not set 120# CONFIG_KALLSYMS_EXTRA_PASS is not set
112# CONFIG_STRIP_ASM_SYMS is not set
113CONFIG_HOTPLUG=y 121CONFIG_HOTPLUG=y
114CONFIG_PRINTK=y 122CONFIG_PRINTK=y
115CONFIG_BUG=y 123CONFIG_BUG=y
@@ -122,8 +130,15 @@ CONFIG_TIMERFD=y
122CONFIG_EVENTFD=y 130CONFIG_EVENTFD=y
123CONFIG_SHMEM=y 131CONFIG_SHMEM=y
124CONFIG_AIO=y 132CONFIG_AIO=y
133CONFIG_HAVE_PERF_COUNTERS=y
134
135#
136# Performance Counters
137#
138# CONFIG_PERF_COUNTERS is not set
125CONFIG_VM_EVENT_COUNTERS=y 139CONFIG_VM_EVENT_COUNTERS=y
126CONFIG_PCI_QUIRKS=y 140CONFIG_PCI_QUIRKS=y
141# CONFIG_STRIP_ASM_SYMS is not set
127CONFIG_COMPAT_BRK=y 142CONFIG_COMPAT_BRK=y
128CONFIG_SLAB=y 143CONFIG_SLAB=y
129# CONFIG_SLUB is not set 144# CONFIG_SLUB is not set
@@ -138,6 +153,10 @@ CONFIG_HAVE_KPROBES=y
138CONFIG_HAVE_KRETPROBES=y 153CONFIG_HAVE_KRETPROBES=y
139CONFIG_HAVE_ARCH_TRACEHOOK=y 154CONFIG_HAVE_ARCH_TRACEHOOK=y
140CONFIG_USE_GENERIC_SMP_HELPERS=y 155CONFIG_USE_GENERIC_SMP_HELPERS=y
156
157#
158# GCOV-based kernel profiling
159#
141# CONFIG_SLOW_WORK is not set 160# CONFIG_SLOW_WORK is not set
142# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set 161# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
143CONFIG_SLABINFO=y 162CONFIG_SLABINFO=y
@@ -151,7 +170,7 @@ CONFIG_MODULE_UNLOAD=y
151# CONFIG_MODULE_SRCVERSION_ALL is not set 170# CONFIG_MODULE_SRCVERSION_ALL is not set
152CONFIG_STOP_MACHINE=y 171CONFIG_STOP_MACHINE=y
153CONFIG_BLOCK=y 172CONFIG_BLOCK=y
154# CONFIG_LBD is not set 173CONFIG_LBDAF=y
155# CONFIG_BLK_DEV_BSG is not set 174# CONFIG_BLK_DEV_BSG is not set
156# CONFIG_BLK_DEV_INTEGRITY is not set 175# CONFIG_BLK_DEV_INTEGRITY is not set
157 176
@@ -168,7 +187,6 @@ CONFIG_DEFAULT_CFQ=y
168# CONFIG_DEFAULT_NOOP is not set 187# CONFIG_DEFAULT_NOOP is not set
169CONFIG_DEFAULT_IOSCHED="cfq" 188CONFIG_DEFAULT_IOSCHED="cfq"
170# CONFIG_FREEZER is not set 189# CONFIG_FREEZER is not set
171CONFIG_PPC_MSI_BITMAP=y
172 190
173# 191#
174# Platform support 192# Platform support
@@ -212,7 +230,7 @@ CONFIG_MPIC=y
212# 230#
213# Kernel options 231# Kernel options
214# 232#
215# CONFIG_HIGHMEM is not set 233CONFIG_HIGHMEM=y
216CONFIG_TICK_ONESHOT=y 234CONFIG_TICK_ONESHOT=y
217# CONFIG_NO_HZ is not set 235# CONFIG_NO_HZ is not set
218CONFIG_HIGH_RES_TIMERS=y 236CONFIG_HIGH_RES_TIMERS=y
@@ -231,6 +249,7 @@ CONFIG_BINFMT_ELF=y
231# CONFIG_HAVE_AOUT is not set 249# CONFIG_HAVE_AOUT is not set
232CONFIG_BINFMT_MISC=y 250CONFIG_BINFMT_MISC=y
233# CONFIG_IOMMU_HELPER is not set 251# CONFIG_IOMMU_HELPER is not set
252# CONFIG_SWIOTLB is not set
234CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y 253CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
235CONFIG_ARCH_HAS_WALK_MEMORY=y 254CONFIG_ARCH_HAS_WALK_MEMORY=y
236CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y 255CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y
@@ -252,9 +271,9 @@ CONFIG_MIGRATION=y
252CONFIG_ZONE_DMA_FLAG=1 271CONFIG_ZONE_DMA_FLAG=1
253CONFIG_BOUNCE=y 272CONFIG_BOUNCE=y
254CONFIG_VIRT_TO_BUS=y 273CONFIG_VIRT_TO_BUS=y
255CONFIG_UNEVICTABLE_LRU=y
256CONFIG_HAVE_MLOCK=y 274CONFIG_HAVE_MLOCK=y
257CONFIG_HAVE_MLOCKED_PAGE_BIT=y 275CONFIG_HAVE_MLOCKED_PAGE_BIT=y
276CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
258CONFIG_PPC_4K_PAGES=y 277CONFIG_PPC_4K_PAGES=y
259# CONFIG_PPC_16K_PAGES is not set 278# CONFIG_PPC_16K_PAGES is not set
260# CONFIG_PPC_64K_PAGES is not set 279# CONFIG_PPC_64K_PAGES is not set
@@ -281,13 +300,32 @@ CONFIG_PCI_DOMAINS=y
281CONFIG_PCI_SYSCALL=y 300CONFIG_PCI_SYSCALL=y
282CONFIG_PCIEPORTBUS=y 301CONFIG_PCIEPORTBUS=y
283CONFIG_PCIEAER=y 302CONFIG_PCIEAER=y
303# CONFIG_PCIE_ECRC is not set
304# CONFIG_PCIEAER_INJECT is not set
284# CONFIG_PCIEASPM is not set 305# CONFIG_PCIEASPM is not set
285CONFIG_ARCH_SUPPORTS_MSI=y 306CONFIG_ARCH_SUPPORTS_MSI=y
286CONFIG_PCI_MSI=y 307# CONFIG_PCI_MSI is not set
287# CONFIG_PCI_LEGACY is not set 308# CONFIG_PCI_LEGACY is not set
288# CONFIG_PCI_STUB is not set 309# CONFIG_PCI_STUB is not set
289# CONFIG_PCI_IOV is not set 310# CONFIG_PCI_IOV is not set
290# CONFIG_PCCARD is not set 311CONFIG_PCCARD=y
312# CONFIG_PCMCIA_DEBUG is not set
313CONFIG_PCMCIA=y
314# CONFIG_PCMCIA_LOAD_CIS is not set
315# CONFIG_PCMCIA_IOCTL is not set
316# CONFIG_CARDBUS is not set
317
318#
319# PC-card bridges
320#
321CONFIG_YENTA=y
322# CONFIG_YENTA_O2 is not set
323# CONFIG_YENTA_RICOH is not set
324CONFIG_YENTA_TI=y
325# CONFIG_YENTA_TOSHIBA is not set
326# CONFIG_PD6729 is not set
327# CONFIG_I82092 is not set
328CONFIG_PCCARD_NONSTATIC=y
291# CONFIG_HOTPLUG_PCI is not set 329# CONFIG_HOTPLUG_PCI is not set
292# CONFIG_HAS_RAPIDIO is not set 330# CONFIG_HAS_RAPIDIO is not set
293 331
@@ -393,6 +431,7 @@ CONFIG_IPV6_TUNNEL=m
393# CONFIG_ECONET is not set 431# CONFIG_ECONET is not set
394# CONFIG_WAN_ROUTER is not set 432# CONFIG_WAN_ROUTER is not set
395# CONFIG_PHONET is not set 433# CONFIG_PHONET is not set
434# CONFIG_IEEE802154 is not set
396# CONFIG_NET_SCHED is not set 435# CONFIG_NET_SCHED is not set
397# CONFIG_DCB is not set 436# CONFIG_DCB is not set
398 437
@@ -421,7 +460,9 @@ CONFIG_FIB_RULES=y
421CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" 460CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
422CONFIG_STANDALONE=y 461CONFIG_STANDALONE=y
423CONFIG_PREVENT_FIRMWARE_BUILD=y 462CONFIG_PREVENT_FIRMWARE_BUILD=y
424# CONFIG_FW_LOADER is not set 463CONFIG_FW_LOADER=y
464CONFIG_FIRMWARE_IN_KERNEL=y
465CONFIG_EXTRA_FIRMWARE=""
425# CONFIG_SYS_HYPERVISOR is not set 466# CONFIG_SYS_HYPERVISOR is not set
426# CONFIG_CONNECTOR is not set 467# CONFIG_CONNECTOR is not set
427CONFIG_MTD=y 468CONFIG_MTD=y
@@ -511,6 +552,7 @@ CONFIG_MTD_PHYSMAP_OF=y
511CONFIG_OF_DEVICE=y 552CONFIG_OF_DEVICE=y
512CONFIG_OF_GPIO=y 553CONFIG_OF_GPIO=y
513CONFIG_OF_I2C=y 554CONFIG_OF_I2C=y
555CONFIG_OF_MDIO=y
514# CONFIG_PARPORT is not set 556# CONFIG_PARPORT is not set
515CONFIG_BLK_DEV=y 557CONFIG_BLK_DEV=y
516# CONFIG_BLK_DEV_FD is not set 558# CONFIG_BLK_DEV_FD is not set
@@ -546,9 +588,60 @@ CONFIG_MISC_DEVICES=y
546# 588#
547# CONFIG_EEPROM_AT24 is not set 589# CONFIG_EEPROM_AT24 is not set
548# CONFIG_EEPROM_LEGACY is not set 590# CONFIG_EEPROM_LEGACY is not set
591# CONFIG_EEPROM_MAX6875 is not set
549# CONFIG_EEPROM_93CX6 is not set 592# CONFIG_EEPROM_93CX6 is not set
593# CONFIG_CB710_CORE is not set
550CONFIG_HAVE_IDE=y 594CONFIG_HAVE_IDE=y
551# CONFIG_IDE is not set 595CONFIG_IDE=y
596
597#
598# Please see Documentation/ide/ide.txt for help/info on IDE drives
599#
600# CONFIG_BLK_DEV_IDE_SATA is not set
601CONFIG_IDE_GD=y
602CONFIG_IDE_GD_ATA=y
603# CONFIG_IDE_GD_ATAPI is not set
604CONFIG_BLK_DEV_IDECS=y
605# CONFIG_BLK_DEV_IDECD is not set
606# CONFIG_BLK_DEV_IDETAPE is not set
607# CONFIG_IDE_TASK_IOCTL is not set
608CONFIG_IDE_PROC_FS=y
609
610#
611# IDE chipset support/bugfixes
612#
613# CONFIG_BLK_DEV_PLATFORM is not set
614
615#
616# PCI IDE chipsets support
617#
618# CONFIG_BLK_DEV_GENERIC is not set
619# CONFIG_BLK_DEV_OPTI621 is not set
620# CONFIG_BLK_DEV_AEC62XX is not set
621# CONFIG_BLK_DEV_ALI15X3 is not set
622# CONFIG_BLK_DEV_AMD74XX is not set
623# CONFIG_BLK_DEV_CMD64X is not set
624# CONFIG_BLK_DEV_TRIFLEX is not set
625# CONFIG_BLK_DEV_CS5520 is not set
626# CONFIG_BLK_DEV_CS5530 is not set
627# CONFIG_BLK_DEV_HPT366 is not set
628# CONFIG_BLK_DEV_JMICRON is not set
629# CONFIG_BLK_DEV_SC1200 is not set
630# CONFIG_BLK_DEV_PIIX is not set
631# CONFIG_BLK_DEV_IT8172 is not set
632# CONFIG_BLK_DEV_IT8213 is not set
633# CONFIG_BLK_DEV_IT821X is not set
634# CONFIG_BLK_DEV_NS87415 is not set
635# CONFIG_BLK_DEV_PDC202XX_OLD is not set
636# CONFIG_BLK_DEV_PDC202XX_NEW is not set
637# CONFIG_BLK_DEV_SVWKS is not set
638# CONFIG_BLK_DEV_SIIMAGE is not set
639# CONFIG_BLK_DEV_SL82C105 is not set
640# CONFIG_BLK_DEV_SLC90E66 is not set
641# CONFIG_BLK_DEV_TRM290 is not set
642# CONFIG_BLK_DEV_VIA82CXXX is not set
643# CONFIG_BLK_DEV_TC86C001 is not set
644# CONFIG_BLK_DEV_IDEDMA is not set
552 645
553# 646#
554# SCSI device support 647# SCSI device support
@@ -570,10 +663,6 @@ CONFIG_BLK_DEV_SR=y
570# CONFIG_BLK_DEV_SR_VENDOR is not set 663# CONFIG_BLK_DEV_SR_VENDOR is not set
571# CONFIG_CHR_DEV_SG is not set 664# CONFIG_CHR_DEV_SG is not set
572# CONFIG_CHR_DEV_SCH is not set 665# CONFIG_CHR_DEV_SCH is not set
573
574#
575# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
576#
577# CONFIG_SCSI_MULTI_LUN is not set 666# CONFIG_SCSI_MULTI_LUN is not set
578# CONFIG_SCSI_CONSTANTS is not set 667# CONFIG_SCSI_CONSTANTS is not set
579# CONFIG_SCSI_LOGGING is not set 668# CONFIG_SCSI_LOGGING is not set
@@ -590,6 +679,7 @@ CONFIG_SCSI_WAIT_SCAN=m
590# CONFIG_SCSI_SRP_ATTRS is not set 679# CONFIG_SCSI_SRP_ATTRS is not set
591CONFIG_SCSI_LOWLEVEL=y 680CONFIG_SCSI_LOWLEVEL=y
592# CONFIG_ISCSI_TCP is not set 681# CONFIG_ISCSI_TCP is not set
682# CONFIG_SCSI_BNX2_ISCSI is not set
593# CONFIG_BLK_DEV_3W_XXXX_RAID is not set 683# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
594# CONFIG_SCSI_3W_9XXX is not set 684# CONFIG_SCSI_3W_9XXX is not set
595# CONFIG_SCSI_ACARD is not set 685# CONFIG_SCSI_ACARD is not set
@@ -598,6 +688,7 @@ CONFIG_SCSI_LOWLEVEL=y
598# CONFIG_SCSI_AIC7XXX_OLD is not set 688# CONFIG_SCSI_AIC7XXX_OLD is not set
599# CONFIG_SCSI_AIC79XX is not set 689# CONFIG_SCSI_AIC79XX is not set
600# CONFIG_SCSI_AIC94XX is not set 690# CONFIG_SCSI_AIC94XX is not set
691# CONFIG_SCSI_MVSAS is not set
601# CONFIG_SCSI_DPT_I2O is not set 692# CONFIG_SCSI_DPT_I2O is not set
602# CONFIG_SCSI_ADVANSYS is not set 693# CONFIG_SCSI_ADVANSYS is not set
603# CONFIG_SCSI_ARCMSR is not set 694# CONFIG_SCSI_ARCMSR is not set
@@ -617,7 +708,6 @@ CONFIG_SCSI_LOWLEVEL=y
617# CONFIG_SCSI_IPS is not set 708# CONFIG_SCSI_IPS is not set
618# CONFIG_SCSI_INITIO is not set 709# CONFIG_SCSI_INITIO is not set
619# CONFIG_SCSI_INIA100 is not set 710# CONFIG_SCSI_INIA100 is not set
620# CONFIG_SCSI_MVSAS is not set
621# CONFIG_SCSI_STEX is not set 711# CONFIG_SCSI_STEX is not set
622# CONFIG_SCSI_SYM53C8XX_2 is not set 712# CONFIG_SCSI_SYM53C8XX_2 is not set
623# CONFIG_SCSI_IPR is not set 713# CONFIG_SCSI_IPR is not set
@@ -630,6 +720,7 @@ CONFIG_SCSI_LOWLEVEL=y
630# CONFIG_SCSI_NSP32 is not set 720# CONFIG_SCSI_NSP32 is not set
631# CONFIG_SCSI_DEBUG is not set 721# CONFIG_SCSI_DEBUG is not set
632# CONFIG_SCSI_SRP is not set 722# CONFIG_SCSI_SRP is not set
723# CONFIG_SCSI_LOWLEVEL_PCMCIA is not set
633# CONFIG_SCSI_DH is not set 724# CONFIG_SCSI_DH is not set
634# CONFIG_SCSI_OSD_INITIATOR is not set 725# CONFIG_SCSI_OSD_INITIATOR is not set
635CONFIG_ATA=y 726CONFIG_ATA=y
@@ -647,14 +738,17 @@ CONFIG_SATA_SIL24=y
647# 738#
648 739
649# 740#
650# Enable only one of the two stacks, unless you know what you are doing 741# You can enable one or both FireWire driver stacks.
742#
743
744#
745# See the help texts for more information.
651# 746#
652# CONFIG_FIREWIRE is not set 747# CONFIG_FIREWIRE is not set
653# CONFIG_IEEE1394 is not set 748# CONFIG_IEEE1394 is not set
654# CONFIG_I2O is not set 749# CONFIG_I2O is not set
655# CONFIG_MACINTOSH_DRIVERS is not set 750# CONFIG_MACINTOSH_DRIVERS is not set
656CONFIG_NETDEVICES=y 751CONFIG_NETDEVICES=y
657CONFIG_COMPAT_NET_DEV_OPS=y
658CONFIG_DUMMY=m 752CONFIG_DUMMY=m
659CONFIG_BONDING=m 753CONFIG_BONDING=m
660# CONFIG_MACVLAN is not set 754# CONFIG_MACVLAN is not set
@@ -701,6 +795,7 @@ CONFIG_MII=y
701# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set 795# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
702# CONFIG_NET_PCI is not set 796# CONFIG_NET_PCI is not set
703# CONFIG_B44 is not set 797# CONFIG_B44 is not set
798# CONFIG_KS8842 is not set
704# CONFIG_ATL2 is not set 799# CONFIG_ATL2 is not set
705CONFIG_NETDEV_1000=y 800CONFIG_NETDEV_1000=y
706# CONFIG_ACENIC is not set 801# CONFIG_ACENIC is not set
@@ -720,8 +815,10 @@ CONFIG_NETDEV_1000=y
720# CONFIG_VIA_VELOCITY is not set 815# CONFIG_VIA_VELOCITY is not set
721# CONFIG_TIGON3 is not set 816# CONFIG_TIGON3 is not set
722# CONFIG_BNX2 is not set 817# CONFIG_BNX2 is not set
818# CONFIG_CNIC is not set
723CONFIG_FSL_PQ_MDIO=y 819CONFIG_FSL_PQ_MDIO=y
724CONFIG_GIANFAR=y 820CONFIG_GIANFAR=y
821# CONFIG_MV643XX_ETH is not set
725# CONFIG_QLA3XXX is not set 822# CONFIG_QLA3XXX is not set
726# CONFIG_ATL1 is not set 823# CONFIG_ATL1 is not set
727# CONFIG_ATL1E is not set 824# CONFIG_ATL1E is not set
@@ -748,6 +845,7 @@ CONFIG_GIANFAR=y
748# CONFIG_USB_PEGASUS is not set 845# CONFIG_USB_PEGASUS is not set
749# CONFIG_USB_RTL8150 is not set 846# CONFIG_USB_RTL8150 is not set
750# CONFIG_USB_USBNET is not set 847# CONFIG_USB_USBNET is not set
848# CONFIG_NET_PCMCIA is not set
751# CONFIG_WAN is not set 849# CONFIG_WAN is not set
752# CONFIG_FDDI is not set 850# CONFIG_FDDI is not set
753# CONFIG_HIPPI is not set 851# CONFIG_HIPPI is not set
@@ -827,6 +925,7 @@ CONFIG_DEVKMEM=y
827CONFIG_SERIAL_8250=y 925CONFIG_SERIAL_8250=y
828CONFIG_SERIAL_8250_CONSOLE=y 926CONFIG_SERIAL_8250_CONSOLE=y
829# CONFIG_SERIAL_8250_PCI is not set 927# CONFIG_SERIAL_8250_PCI is not set
928# CONFIG_SERIAL_8250_CS is not set
830CONFIG_SERIAL_8250_NR_UARTS=2 929CONFIG_SERIAL_8250_NR_UARTS=2
831CONFIG_SERIAL_8250_RUNTIME_UARTS=2 930CONFIG_SERIAL_8250_RUNTIME_UARTS=2
832# CONFIG_SERIAL_8250_EXTENDED is not set 931# CONFIG_SERIAL_8250_EXTENDED is not set
@@ -849,6 +948,14 @@ CONFIG_HW_RANDOM=y
849CONFIG_NVRAM=y 948CONFIG_NVRAM=y
850# CONFIG_R3964 is not set 949# CONFIG_R3964 is not set
851# CONFIG_APPLICOM is not set 950# CONFIG_APPLICOM is not set
951
952#
953# PCMCIA character devices
954#
955# CONFIG_SYNCLINK_CS is not set
956# CONFIG_CARDMAN_4000 is not set
957# CONFIG_CARDMAN_4040 is not set
958# CONFIG_IPWIRELESS is not set
852# CONFIG_RAW_DRIVER is not set 959# CONFIG_RAW_DRIVER is not set
853# CONFIG_TCG_TPM is not set 960# CONFIG_TCG_TPM is not set
854CONFIG_DEVPORT=y 961CONFIG_DEVPORT=y
@@ -912,13 +1019,17 @@ CONFIG_DS1682=y
912# CONFIG_SENSORS_PCF8574 is not set 1019# CONFIG_SENSORS_PCF8574 is not set
913# CONFIG_PCF8575 is not set 1020# CONFIG_PCF8575 is not set
914# CONFIG_SENSORS_PCA9539 is not set 1021# CONFIG_SENSORS_PCA9539 is not set
915# CONFIG_SENSORS_MAX6875 is not set
916# CONFIG_SENSORS_TSL2550 is not set 1022# CONFIG_SENSORS_TSL2550 is not set
917# CONFIG_I2C_DEBUG_CORE is not set 1023# CONFIG_I2C_DEBUG_CORE is not set
918# CONFIG_I2C_DEBUG_ALGO is not set 1024# CONFIG_I2C_DEBUG_ALGO is not set
919# CONFIG_I2C_DEBUG_BUS is not set 1025# CONFIG_I2C_DEBUG_BUS is not set
920# CONFIG_I2C_DEBUG_CHIP is not set 1026# CONFIG_I2C_DEBUG_CHIP is not set
921# CONFIG_SPI is not set 1027# CONFIG_SPI is not set
1028
1029#
1030# PPS support
1031#
1032# CONFIG_PPS is not set
922CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y 1033CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
923CONFIG_ARCH_REQUIRE_GPIOLIB=y 1034CONFIG_ARCH_REQUIRE_GPIOLIB=y
924CONFIG_GPIOLIB=y 1035CONFIG_GPIOLIB=y
@@ -997,6 +1108,7 @@ CONFIG_SENSORS_LM92=y
997# CONFIG_SENSORS_SMSC47B397 is not set 1108# CONFIG_SENSORS_SMSC47B397 is not set
998# CONFIG_SENSORS_ADS7828 is not set 1109# CONFIG_SENSORS_ADS7828 is not set
999# CONFIG_SENSORS_THMC50 is not set 1110# CONFIG_SENSORS_THMC50 is not set
1111# CONFIG_SENSORS_TMP401 is not set
1000# CONFIG_SENSORS_VIA686A is not set 1112# CONFIG_SENSORS_VIA686A is not set
1001# CONFIG_SENSORS_VT1211 is not set 1113# CONFIG_SENSORS_VT1211 is not set
1002# CONFIG_SENSORS_VT8231 is not set 1114# CONFIG_SENSORS_VT8231 is not set
@@ -1052,24 +1164,9 @@ CONFIG_SSB_POSSIBLE=y
1052# CONFIG_MFD_WM8400 is not set 1164# CONFIG_MFD_WM8400 is not set
1053# CONFIG_MFD_WM8350_I2C is not set 1165# CONFIG_MFD_WM8350_I2C is not set
1054# CONFIG_MFD_PCF50633 is not set 1166# CONFIG_MFD_PCF50633 is not set
1167# CONFIG_AB3100_CORE is not set
1055# CONFIG_REGULATOR is not set 1168# CONFIG_REGULATOR is not set
1056 1169# CONFIG_MEDIA_SUPPORT is not set
1057#
1058# Multimedia devices
1059#
1060
1061#
1062# Multimedia core support
1063#
1064# CONFIG_VIDEO_DEV is not set
1065# CONFIG_DVB_CORE is not set
1066# CONFIG_VIDEO_MEDIA is not set
1067
1068#
1069# Multimedia drivers
1070#
1071CONFIG_DAB=y
1072# CONFIG_USB_DABUSB is not set
1073 1170
1074# 1171#
1075# Graphics support 1172# Graphics support
@@ -1114,7 +1211,7 @@ CONFIG_HID_BELKIN=y
1114CONFIG_HID_CHERRY=y 1211CONFIG_HID_CHERRY=y
1115CONFIG_HID_CHICONY=y 1212CONFIG_HID_CHICONY=y
1116CONFIG_HID_CYPRESS=y 1213CONFIG_HID_CYPRESS=y
1117# CONFIG_DRAGONRISE_FF is not set 1214# CONFIG_HID_DRAGONRISE is not set
1118CONFIG_HID_EZKEY=y 1215CONFIG_HID_EZKEY=y
1119# CONFIG_HID_KYE is not set 1216# CONFIG_HID_KYE is not set
1120CONFIG_HID_GYRATION=y 1217CONFIG_HID_GYRATION=y
@@ -1131,10 +1228,11 @@ CONFIG_HID_PETALYNX=y
1131CONFIG_HID_SAMSUNG=y 1228CONFIG_HID_SAMSUNG=y
1132CONFIG_HID_SONY=y 1229CONFIG_HID_SONY=y
1133CONFIG_HID_SUNPLUS=y 1230CONFIG_HID_SUNPLUS=y
1134# CONFIG_GREENASIA_FF is not set 1231# CONFIG_HID_GREENASIA is not set
1232# CONFIG_HID_SMARTJOYPLUS is not set
1135# CONFIG_HID_TOPSEED is not set 1233# CONFIG_HID_TOPSEED is not set
1136# CONFIG_THRUSTMASTER_FF is not set 1234# CONFIG_HID_THRUSTMASTER is not set
1137# CONFIG_ZEROPLUS_FF is not set 1235# CONFIG_HID_ZEROPLUS is not set
1138CONFIG_USB_SUPPORT=y 1236CONFIG_USB_SUPPORT=y
1139CONFIG_USB_ARCH_HAS_HCD=y 1237CONFIG_USB_ARCH_HAS_HCD=y
1140CONFIG_USB_ARCH_HAS_OHCI=y 1238CONFIG_USB_ARCH_HAS_OHCI=y
@@ -1160,6 +1258,7 @@ CONFIG_USB=y
1160# USB Host Controller Drivers 1258# USB Host Controller Drivers
1161# 1259#
1162# CONFIG_USB_C67X00_HCD is not set 1260# CONFIG_USB_C67X00_HCD is not set
1261# CONFIG_USB_XHCI_HCD is not set
1163CONFIG_USB_EHCI_HCD=y 1262CONFIG_USB_EHCI_HCD=y
1164# CONFIG_USB_EHCI_ROOT_HUB_TT is not set 1263# CONFIG_USB_EHCI_ROOT_HUB_TT is not set
1165# CONFIG_USB_EHCI_TT_NEWSCHED is not set 1264# CONFIG_USB_EHCI_TT_NEWSCHED is not set
@@ -1169,6 +1268,8 @@ CONFIG_USB_EHCI_HCD=y
1169# CONFIG_USB_ISP116X_HCD is not set 1268# CONFIG_USB_ISP116X_HCD is not set
1170# CONFIG_USB_ISP1760_HCD is not set 1269# CONFIG_USB_ISP1760_HCD is not set
1171CONFIG_USB_OHCI_HCD=y 1270CONFIG_USB_OHCI_HCD=y
1271# CONFIG_USB_OHCI_HCD_PPC_OF_BE is not set
1272# CONFIG_USB_OHCI_HCD_PPC_OF_LE is not set
1172# CONFIG_USB_OHCI_HCD_PPC_OF is not set 1273# CONFIG_USB_OHCI_HCD_PPC_OF is not set
1173# CONFIG_USB_OHCI_BIG_ENDIAN_DESC is not set 1274# CONFIG_USB_OHCI_BIG_ENDIAN_DESC is not set
1174# CONFIG_USB_OHCI_BIG_ENDIAN_MMIO is not set 1275# CONFIG_USB_OHCI_BIG_ENDIAN_MMIO is not set
@@ -1288,6 +1389,7 @@ CONFIG_RTC_INTF_DEV=y
1288# CONFIG_RTC_DRV_S35390A is not set 1389# CONFIG_RTC_DRV_S35390A is not set
1289# CONFIG_RTC_DRV_FM3130 is not set 1390# CONFIG_RTC_DRV_FM3130 is not set
1290CONFIG_RTC_DRV_RX8581=y 1391CONFIG_RTC_DRV_RX8581=y
1392# CONFIG_RTC_DRV_RX8025 is not set
1291 1393
1292# 1394#
1293# SPI RTC drivers 1395# SPI RTC drivers
@@ -1315,6 +1417,10 @@ CONFIG_RTC_DRV_RX8581=y
1315# CONFIG_DMADEVICES is not set 1417# CONFIG_DMADEVICES is not set
1316# CONFIG_AUXDISPLAY is not set 1418# CONFIG_AUXDISPLAY is not set
1317# CONFIG_UIO is not set 1419# CONFIG_UIO is not set
1420
1421#
1422# TI VLYNQ
1423#
1318# CONFIG_STAGING is not set 1424# CONFIG_STAGING is not set
1319 1425
1320# 1426#
@@ -1336,10 +1442,12 @@ CONFIG_FS_MBCACHE=y
1336# CONFIG_REISERFS_FS is not set 1442# CONFIG_REISERFS_FS is not set
1337# CONFIG_JFS_FS is not set 1443# CONFIG_JFS_FS is not set
1338CONFIG_FS_POSIX_ACL=y 1444CONFIG_FS_POSIX_ACL=y
1339CONFIG_FILE_LOCKING=y
1340# CONFIG_XFS_FS is not set 1445# CONFIG_XFS_FS is not set
1446# CONFIG_GFS2_FS is not set
1341# CONFIG_OCFS2_FS is not set 1447# CONFIG_OCFS2_FS is not set
1342# CONFIG_BTRFS_FS is not set 1448# CONFIG_BTRFS_FS is not set
1449CONFIG_FILE_LOCKING=y
1450CONFIG_FSNOTIFY=y
1343CONFIG_DNOTIFY=y 1451CONFIG_DNOTIFY=y
1344CONFIG_INOTIFY=y 1452CONFIG_INOTIFY=y
1345CONFIG_INOTIFY_USER=y 1453CONFIG_INOTIFY_USER=y
@@ -1419,6 +1527,7 @@ CONFIG_NFS_FS=y
1419CONFIG_NFS_V3=y 1527CONFIG_NFS_V3=y
1420# CONFIG_NFS_V3_ACL is not set 1528# CONFIG_NFS_V3_ACL is not set
1421CONFIG_NFS_V4=y 1529CONFIG_NFS_V4=y
1530# CONFIG_NFS_V4_1 is not set
1422CONFIG_ROOT_NFS=y 1531CONFIG_ROOT_NFS=y
1423# CONFIG_NFSD is not set 1532# CONFIG_NFSD is not set
1424CONFIG_LOCKD=y 1533CONFIG_LOCKD=y
@@ -1508,6 +1617,7 @@ CONFIG_HAS_IOPORT=y
1508CONFIG_HAS_DMA=y 1617CONFIG_HAS_DMA=y
1509CONFIG_HAVE_LMB=y 1618CONFIG_HAVE_LMB=y
1510CONFIG_NLATTR=y 1619CONFIG_NLATTR=y
1620CONFIG_GENERIC_ATOMIC64=y
1511 1621
1512# 1622#
1513# Kernel hacking 1623# Kernel hacking
@@ -1531,23 +1641,11 @@ CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
1531CONFIG_HAVE_DYNAMIC_FTRACE=y 1641CONFIG_HAVE_DYNAMIC_FTRACE=y
1532CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y 1642CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
1533CONFIG_TRACING_SUPPORT=y 1643CONFIG_TRACING_SUPPORT=y
1534 1644# CONFIG_FTRACE is not set
1535#
1536# Tracers
1537#
1538# CONFIG_FUNCTION_TRACER is not set
1539# CONFIG_PREEMPT_TRACER is not set
1540# CONFIG_SCHED_TRACER is not set
1541# CONFIG_CONTEXT_SWITCH_TRACER is not set
1542# CONFIG_EVENT_TRACER is not set
1543# CONFIG_BOOT_TRACER is not set
1544# CONFIG_TRACE_BRANCH_PROFILING is not set
1545# CONFIG_STACK_TRACER is not set
1546# CONFIG_KMEMTRACE is not set
1547# CONFIG_WORKQUEUE_TRACER is not set
1548# CONFIG_BLK_DEV_IO_TRACE is not set
1549# CONFIG_SAMPLES is not set 1645# CONFIG_SAMPLES is not set
1550CONFIG_HAVE_ARCH_KGDB=y 1646CONFIG_HAVE_ARCH_KGDB=y
1647# CONFIG_PPC_DISABLE_WERROR is not set
1648CONFIG_PPC_WERROR=y
1551CONFIG_PRINT_STACK_DEPTH=64 1649CONFIG_PRINT_STACK_DEPTH=64
1552# CONFIG_IRQSTACKS is not set 1650# CONFIG_IRQSTACKS is not set
1553# CONFIG_BOOTX_TEXT is not set 1651# CONFIG_BOOTX_TEXT is not set
diff --git a/arch/powerpc/configs/86xx/gef_sbc610_defconfig b/arch/powerpc/configs/86xx/gef_sbc610_defconfig
index c6a7fc82b69a..ba47883f4aa0 100644
--- a/arch/powerpc/configs/86xx/gef_sbc610_defconfig
+++ b/arch/powerpc/configs/86xx/gef_sbc610_defconfig
@@ -1,26 +1,28 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.30-rc3 3# Linux kernel version: 2.6.31-rc4
4# Wed May 13 17:22:30 2009 4# Wed Jul 29 23:32:30 2009
5# 5#
6# CONFIG_PPC64 is not set 6# CONFIG_PPC64 is not set
7 7
8# 8#
9# Processor support 9# Processor support
10# 10#
11CONFIG_6xx=y 11CONFIG_PPC_BOOK3S_32=y
12# CONFIG_PPC_85xx is not set 12# CONFIG_PPC_85xx is not set
13# CONFIG_PPC_8xx is not set 13# CONFIG_PPC_8xx is not set
14# CONFIG_40x is not set 14# CONFIG_40x is not set
15# CONFIG_44x is not set 15# CONFIG_44x is not set
16# CONFIG_E200 is not set 16# CONFIG_E200 is not set
17CONFIG_PPC_BOOK3S=y 17CONFIG_PPC_BOOK3S=y
18CONFIG_6xx=y
18CONFIG_PPC_FPU=y 19CONFIG_PPC_FPU=y
19# CONFIG_PHYS_64BIT is not set 20# CONFIG_PHYS_64BIT is not set
20CONFIG_ALTIVEC=y 21CONFIG_ALTIVEC=y
21CONFIG_PPC_STD_MMU=y 22CONFIG_PPC_STD_MMU=y
22CONFIG_PPC_STD_MMU_32=y 23CONFIG_PPC_STD_MMU_32=y
23# CONFIG_PPC_MM_SLICES is not set 24# CONFIG_PPC_MM_SLICES is not set
25CONFIG_PPC_HAVE_PMU_SUPPORT=y
24CONFIG_SMP=y 26CONFIG_SMP=y
25CONFIG_NR_CPUS=2 27CONFIG_NR_CPUS=2
26CONFIG_PPC32=y 28CONFIG_PPC32=y
@@ -32,16 +34,17 @@ CONFIG_GENERIC_TIME=y
32CONFIG_GENERIC_TIME_VSYSCALL=y 34CONFIG_GENERIC_TIME_VSYSCALL=y
33CONFIG_GENERIC_CLOCKEVENTS=y 35CONFIG_GENERIC_CLOCKEVENTS=y
34CONFIG_GENERIC_HARDIRQS=y 36CONFIG_GENERIC_HARDIRQS=y
37CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
35# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set 38# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set
36CONFIG_IRQ_PER_CPU=y 39CONFIG_IRQ_PER_CPU=y
37CONFIG_STACKTRACE_SUPPORT=y 40CONFIG_STACKTRACE_SUPPORT=y
38CONFIG_HAVE_LATENCYTOP_SUPPORT=y 41CONFIG_HAVE_LATENCYTOP_SUPPORT=y
42CONFIG_TRACE_IRQFLAGS_SUPPORT=y
39CONFIG_LOCKDEP_SUPPORT=y 43CONFIG_LOCKDEP_SUPPORT=y
40CONFIG_RWSEM_XCHGADD_ALGORITHM=y 44CONFIG_RWSEM_XCHGADD_ALGORITHM=y
41CONFIG_GENERIC_LOCKBREAK=y 45CONFIG_GENERIC_LOCKBREAK=y
42CONFIG_ARCH_HAS_ILOG2_U32=y 46CONFIG_ARCH_HAS_ILOG2_U32=y
43CONFIG_GENERIC_HWEIGHT=y 47CONFIG_GENERIC_HWEIGHT=y
44CONFIG_GENERIC_CALIBRATE_DELAY=y
45CONFIG_GENERIC_FIND_NEXT_BIT=y 48CONFIG_GENERIC_FIND_NEXT_BIT=y
46CONFIG_GENERIC_GPIO=y 49CONFIG_GENERIC_GPIO=y
47# CONFIG_ARCH_NO_VIRT_TO_BUS is not set 50# CONFIG_ARCH_NO_VIRT_TO_BUS is not set
@@ -56,11 +59,13 @@ CONFIG_PPC_UDBG_16550=y
56CONFIG_GENERIC_TBSYNC=y 59CONFIG_GENERIC_TBSYNC=y
57CONFIG_AUDIT_ARCH=y 60CONFIG_AUDIT_ARCH=y
58CONFIG_GENERIC_BUG=y 61CONFIG_GENERIC_BUG=y
62CONFIG_DTC=y
59CONFIG_DEFAULT_UIMAGE=y 63CONFIG_DEFAULT_UIMAGE=y
60# CONFIG_PPC_DCR_NATIVE is not set 64# CONFIG_PPC_DCR_NATIVE is not set
61# CONFIG_PPC_DCR_MMIO is not set 65# CONFIG_PPC_DCR_MMIO is not set
62CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y 66CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y
63CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" 67CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
68CONFIG_CONSTRUCTORS=y
64 69
65# 70#
66# General setup 71# General setup
@@ -114,7 +119,6 @@ CONFIG_SYSCTL_SYSCALL=y
114CONFIG_KALLSYMS=y 119CONFIG_KALLSYMS=y
115# CONFIG_KALLSYMS_ALL is not set 120# CONFIG_KALLSYMS_ALL is not set
116# CONFIG_KALLSYMS_EXTRA_PASS is not set 121# CONFIG_KALLSYMS_EXTRA_PASS is not set
117# CONFIG_STRIP_ASM_SYMS is not set
118CONFIG_HOTPLUG=y 122CONFIG_HOTPLUG=y
119CONFIG_PRINTK=y 123CONFIG_PRINTK=y
120CONFIG_BUG=y 124CONFIG_BUG=y
@@ -127,8 +131,15 @@ CONFIG_TIMERFD=y
127CONFIG_EVENTFD=y 131CONFIG_EVENTFD=y
128CONFIG_SHMEM=y 132CONFIG_SHMEM=y
129CONFIG_AIO=y 133CONFIG_AIO=y
134CONFIG_HAVE_PERF_COUNTERS=y
135
136#
137# Performance Counters
138#
139# CONFIG_PERF_COUNTERS is not set
130CONFIG_VM_EVENT_COUNTERS=y 140CONFIG_VM_EVENT_COUNTERS=y
131CONFIG_PCI_QUIRKS=y 141CONFIG_PCI_QUIRKS=y
142# CONFIG_STRIP_ASM_SYMS is not set
132CONFIG_COMPAT_BRK=y 143CONFIG_COMPAT_BRK=y
133CONFIG_SLAB=y 144CONFIG_SLAB=y
134# CONFIG_SLUB is not set 145# CONFIG_SLUB is not set
@@ -143,6 +154,10 @@ CONFIG_HAVE_KPROBES=y
143CONFIG_HAVE_KRETPROBES=y 154CONFIG_HAVE_KRETPROBES=y
144CONFIG_HAVE_ARCH_TRACEHOOK=y 155CONFIG_HAVE_ARCH_TRACEHOOK=y
145CONFIG_USE_GENERIC_SMP_HELPERS=y 156CONFIG_USE_GENERIC_SMP_HELPERS=y
157
158#
159# GCOV-based kernel profiling
160#
146# CONFIG_SLOW_WORK is not set 161# CONFIG_SLOW_WORK is not set
147# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set 162# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
148CONFIG_SLABINFO=y 163CONFIG_SLABINFO=y
@@ -156,7 +171,7 @@ CONFIG_MODULE_UNLOAD=y
156# CONFIG_MODULE_SRCVERSION_ALL is not set 171# CONFIG_MODULE_SRCVERSION_ALL is not set
157CONFIG_STOP_MACHINE=y 172CONFIG_STOP_MACHINE=y
158CONFIG_BLOCK=y 173CONFIG_BLOCK=y
159# CONFIG_LBD is not set 174CONFIG_LBDAF=y
160# CONFIG_BLK_DEV_BSG is not set 175# CONFIG_BLK_DEV_BSG is not set
161# CONFIG_BLK_DEV_INTEGRITY is not set 176# CONFIG_BLK_DEV_INTEGRITY is not set
162 177
@@ -235,6 +250,7 @@ CONFIG_BINFMT_ELF=y
235# CONFIG_HAVE_AOUT is not set 250# CONFIG_HAVE_AOUT is not set
236CONFIG_BINFMT_MISC=m 251CONFIG_BINFMT_MISC=m
237# CONFIG_IOMMU_HELPER is not set 252# CONFIG_IOMMU_HELPER is not set
253# CONFIG_SWIOTLB is not set
238CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y 254CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
239CONFIG_ARCH_HAS_WALK_MEMORY=y 255CONFIG_ARCH_HAS_WALK_MEMORY=y
240CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y 256CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y
@@ -256,9 +272,9 @@ CONFIG_MIGRATION=y
256CONFIG_ZONE_DMA_FLAG=1 272CONFIG_ZONE_DMA_FLAG=1
257CONFIG_BOUNCE=y 273CONFIG_BOUNCE=y
258CONFIG_VIRT_TO_BUS=y 274CONFIG_VIRT_TO_BUS=y
259CONFIG_UNEVICTABLE_LRU=y
260CONFIG_HAVE_MLOCK=y 275CONFIG_HAVE_MLOCK=y
261CONFIG_HAVE_MLOCKED_PAGE_BIT=y 276CONFIG_HAVE_MLOCKED_PAGE_BIT=y
277CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
262CONFIG_PPC_4K_PAGES=y 278CONFIG_PPC_4K_PAGES=y
263# CONFIG_PPC_16K_PAGES is not set 279# CONFIG_PPC_16K_PAGES is not set
264# CONFIG_PPC_64K_PAGES is not set 280# CONFIG_PPC_64K_PAGES is not set
@@ -285,6 +301,8 @@ CONFIG_PCI_DOMAINS=y
285CONFIG_PCI_SYSCALL=y 301CONFIG_PCI_SYSCALL=y
286CONFIG_PCIEPORTBUS=y 302CONFIG_PCIEPORTBUS=y
287CONFIG_PCIEAER=y 303CONFIG_PCIEAER=y
304# CONFIG_PCIE_ECRC is not set
305# CONFIG_PCIEAER_INJECT is not set
288# CONFIG_PCIEASPM is not set 306# CONFIG_PCIEASPM is not set
289CONFIG_ARCH_SUPPORTS_MSI=y 307CONFIG_ARCH_SUPPORTS_MSI=y
290# CONFIG_PCI_MSI is not set 308# CONFIG_PCI_MSI is not set
@@ -510,6 +528,7 @@ CONFIG_LLC=m
510# CONFIG_ECONET is not set 528# CONFIG_ECONET is not set
511CONFIG_WAN_ROUTER=m 529CONFIG_WAN_ROUTER=m
512# CONFIG_PHONET is not set 530# CONFIG_PHONET is not set
531# CONFIG_IEEE802154 is not set
513CONFIG_NET_SCHED=y 532CONFIG_NET_SCHED=y
514 533
515# 534#
@@ -566,7 +585,11 @@ CONFIG_WIRELESS=y
566CONFIG_WIRELESS_OLD_REGULATORY=y 585CONFIG_WIRELESS_OLD_REGULATORY=y
567# CONFIG_WIRELESS_EXT is not set 586# CONFIG_WIRELESS_EXT is not set
568# CONFIG_LIB80211 is not set 587# CONFIG_LIB80211 is not set
569# CONFIG_MAC80211 is not set 588
589#
590# CFG80211 needs to be enabled for MAC80211
591#
592CONFIG_MAC80211_DEFAULT_PS_VALUE=0
570# CONFIG_WIMAX is not set 593# CONFIG_WIMAX is not set
571# CONFIG_RFKILL is not set 594# CONFIG_RFKILL is not set
572# CONFIG_NET_9P is not set 595# CONFIG_NET_9P is not set
@@ -678,6 +701,7 @@ CONFIG_MTD_PHYSMAP_OF=y
678CONFIG_OF_DEVICE=y 701CONFIG_OF_DEVICE=y
679CONFIG_OF_GPIO=y 702CONFIG_OF_GPIO=y
680CONFIG_OF_I2C=y 703CONFIG_OF_I2C=y
704CONFIG_OF_MDIO=y
681# CONFIG_PARPORT is not set 705# CONFIG_PARPORT is not set
682CONFIG_BLK_DEV=y 706CONFIG_BLK_DEV=y
683# CONFIG_BLK_DEV_FD is not set 707# CONFIG_BLK_DEV_FD is not set
@@ -713,7 +737,9 @@ CONFIG_MISC_DEVICES=y
713# 737#
714# CONFIG_EEPROM_AT24 is not set 738# CONFIG_EEPROM_AT24 is not set
715# CONFIG_EEPROM_LEGACY is not set 739# CONFIG_EEPROM_LEGACY is not set
740# CONFIG_EEPROM_MAX6875 is not set
716# CONFIG_EEPROM_93CX6 is not set 741# CONFIG_EEPROM_93CX6 is not set
742# CONFIG_CB710_CORE is not set
717CONFIG_HAVE_IDE=y 743CONFIG_HAVE_IDE=y
718# CONFIG_IDE is not set 744# CONFIG_IDE is not set
719 745
@@ -737,10 +763,6 @@ CONFIG_BLK_DEV_SR=y
737# CONFIG_BLK_DEV_SR_VENDOR is not set 763# CONFIG_BLK_DEV_SR_VENDOR is not set
738# CONFIG_CHR_DEV_SG is not set 764# CONFIG_CHR_DEV_SG is not set
739# CONFIG_CHR_DEV_SCH is not set 765# CONFIG_CHR_DEV_SCH is not set
740
741#
742# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
743#
744# CONFIG_SCSI_MULTI_LUN is not set 766# CONFIG_SCSI_MULTI_LUN is not set
745# CONFIG_SCSI_CONSTANTS is not set 767# CONFIG_SCSI_CONSTANTS is not set
746# CONFIG_SCSI_LOGGING is not set 768# CONFIG_SCSI_LOGGING is not set
@@ -757,6 +779,7 @@ CONFIG_SCSI_WAIT_SCAN=m
757# CONFIG_SCSI_SRP_ATTRS is not set 779# CONFIG_SCSI_SRP_ATTRS is not set
758CONFIG_SCSI_LOWLEVEL=y 780CONFIG_SCSI_LOWLEVEL=y
759# CONFIG_ISCSI_TCP is not set 781# CONFIG_ISCSI_TCP is not set
782# CONFIG_SCSI_BNX2_ISCSI is not set
760# CONFIG_BLK_DEV_3W_XXXX_RAID is not set 783# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
761# CONFIG_SCSI_3W_9XXX is not set 784# CONFIG_SCSI_3W_9XXX is not set
762# CONFIG_SCSI_ACARD is not set 785# CONFIG_SCSI_ACARD is not set
@@ -765,6 +788,7 @@ CONFIG_SCSI_LOWLEVEL=y
765# CONFIG_SCSI_AIC7XXX_OLD is not set 788# CONFIG_SCSI_AIC7XXX_OLD is not set
766# CONFIG_SCSI_AIC79XX is not set 789# CONFIG_SCSI_AIC79XX is not set
767# CONFIG_SCSI_AIC94XX is not set 790# CONFIG_SCSI_AIC94XX is not set
791# CONFIG_SCSI_MVSAS is not set
768# CONFIG_SCSI_DPT_I2O is not set 792# CONFIG_SCSI_DPT_I2O is not set
769# CONFIG_SCSI_ADVANSYS is not set 793# CONFIG_SCSI_ADVANSYS is not set
770# CONFIG_SCSI_ARCMSR is not set 794# CONFIG_SCSI_ARCMSR is not set
@@ -784,7 +808,6 @@ CONFIG_SCSI_LOWLEVEL=y
784# CONFIG_SCSI_IPS is not set 808# CONFIG_SCSI_IPS is not set
785# CONFIG_SCSI_INITIO is not set 809# CONFIG_SCSI_INITIO is not set
786# CONFIG_SCSI_INIA100 is not set 810# CONFIG_SCSI_INIA100 is not set
787# CONFIG_SCSI_MVSAS is not set
788# CONFIG_SCSI_STEX is not set 811# CONFIG_SCSI_STEX is not set
789# CONFIG_SCSI_SYM53C8XX_2 is not set 812# CONFIG_SCSI_SYM53C8XX_2 is not set
790# CONFIG_SCSI_IPR is not set 813# CONFIG_SCSI_IPR is not set
@@ -868,14 +891,17 @@ CONFIG_SATA_SIL=y
868# 891#
869 892
870# 893#
871# Enable only one of the two stacks, unless you know what you are doing 894# You can enable one or both FireWire driver stacks.
895#
896
897#
898# See the help texts for more information.
872# 899#
873# CONFIG_FIREWIRE is not set 900# CONFIG_FIREWIRE is not set
874# CONFIG_IEEE1394 is not set 901# CONFIG_IEEE1394 is not set
875# CONFIG_I2O is not set 902# CONFIG_I2O is not set
876# CONFIG_MACINTOSH_DRIVERS is not set 903# CONFIG_MACINTOSH_DRIVERS is not set
877CONFIG_NETDEVICES=y 904CONFIG_NETDEVICES=y
878CONFIG_COMPAT_NET_DEV_OPS=y
879CONFIG_DUMMY=m 905CONFIG_DUMMY=m
880CONFIG_BONDING=m 906CONFIG_BONDING=m
881# CONFIG_MACVLAN is not set 907# CONFIG_MACVLAN is not set
@@ -922,6 +948,7 @@ CONFIG_MII=y
922# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set 948# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
923# CONFIG_NET_PCI is not set 949# CONFIG_NET_PCI is not set
924# CONFIG_B44 is not set 950# CONFIG_B44 is not set
951# CONFIG_KS8842 is not set
925# CONFIG_ATL2 is not set 952# CONFIG_ATL2 is not set
926CONFIG_NETDEV_1000=y 953CONFIG_NETDEV_1000=y
927# CONFIG_ACENIC is not set 954# CONFIG_ACENIC is not set
@@ -941,8 +968,10 @@ CONFIG_NETDEV_1000=y
941# CONFIG_VIA_VELOCITY is not set 968# CONFIG_VIA_VELOCITY is not set
942# CONFIG_TIGON3 is not set 969# CONFIG_TIGON3 is not set
943# CONFIG_BNX2 is not set 970# CONFIG_BNX2 is not set
971# CONFIG_CNIC is not set
944CONFIG_FSL_PQ_MDIO=y 972CONFIG_FSL_PQ_MDIO=y
945CONFIG_GIANFAR=y 973CONFIG_GIANFAR=y
974# CONFIG_MV643XX_ETH is not set
946# CONFIG_QLA3XXX is not set 975# CONFIG_QLA3XXX is not set
947# CONFIG_ATL1 is not set 976# CONFIG_ATL1 is not set
948# CONFIG_ATL1E is not set 977# CONFIG_ATL1E is not set
@@ -1149,13 +1178,17 @@ CONFIG_DS1682=y
1149# CONFIG_SENSORS_PCF8574 is not set 1178# CONFIG_SENSORS_PCF8574 is not set
1150# CONFIG_PCF8575 is not set 1179# CONFIG_PCF8575 is not set
1151# CONFIG_SENSORS_PCA9539 is not set 1180# CONFIG_SENSORS_PCA9539 is not set
1152# CONFIG_SENSORS_MAX6875 is not set
1153# CONFIG_SENSORS_TSL2550 is not set 1181# CONFIG_SENSORS_TSL2550 is not set
1154# CONFIG_I2C_DEBUG_CORE is not set 1182# CONFIG_I2C_DEBUG_CORE is not set
1155# CONFIG_I2C_DEBUG_ALGO is not set 1183# CONFIG_I2C_DEBUG_ALGO is not set
1156# CONFIG_I2C_DEBUG_BUS is not set 1184# CONFIG_I2C_DEBUG_BUS is not set
1157# CONFIG_I2C_DEBUG_CHIP is not set 1185# CONFIG_I2C_DEBUG_CHIP is not set
1158# CONFIG_SPI is not set 1186# CONFIG_SPI is not set
1187
1188#
1189# PPS support
1190#
1191# CONFIG_PPS is not set
1159CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y 1192CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
1160CONFIG_ARCH_REQUIRE_GPIOLIB=y 1193CONFIG_ARCH_REQUIRE_GPIOLIB=y
1161CONFIG_GPIOLIB=y 1194CONFIG_GPIOLIB=y
@@ -1235,6 +1268,7 @@ CONFIG_SENSORS_LM92=y
1235# CONFIG_SENSORS_SMSC47B397 is not set 1268# CONFIG_SENSORS_SMSC47B397 is not set
1236# CONFIG_SENSORS_ADS7828 is not set 1269# CONFIG_SENSORS_ADS7828 is not set
1237# CONFIG_SENSORS_THMC50 is not set 1270# CONFIG_SENSORS_THMC50 is not set
1271# CONFIG_SENSORS_TMP401 is not set
1238# CONFIG_SENSORS_VIA686A is not set 1272# CONFIG_SENSORS_VIA686A is not set
1239# CONFIG_SENSORS_VT1211 is not set 1273# CONFIG_SENSORS_VT1211 is not set
1240# CONFIG_SENSORS_VT8231 is not set 1274# CONFIG_SENSORS_VT8231 is not set
@@ -1290,24 +1324,9 @@ CONFIG_SSB_POSSIBLE=y
1290# CONFIG_MFD_WM8400 is not set 1324# CONFIG_MFD_WM8400 is not set
1291# CONFIG_MFD_WM8350_I2C is not set 1325# CONFIG_MFD_WM8350_I2C is not set
1292# CONFIG_MFD_PCF50633 is not set 1326# CONFIG_MFD_PCF50633 is not set
1327# CONFIG_AB3100_CORE is not set
1293# CONFIG_REGULATOR is not set 1328# CONFIG_REGULATOR is not set
1294 1329# CONFIG_MEDIA_SUPPORT is not set
1295#
1296# Multimedia devices
1297#
1298
1299#
1300# Multimedia core support
1301#
1302# CONFIG_VIDEO_DEV is not set
1303# CONFIG_DVB_CORE is not set
1304# CONFIG_VIDEO_MEDIA is not set
1305
1306#
1307# Multimedia drivers
1308#
1309CONFIG_DAB=y
1310# CONFIG_USB_DABUSB is not set
1311 1330
1312# 1331#
1313# Graphics support 1332# Graphics support
@@ -1352,7 +1371,7 @@ CONFIG_HID_BELKIN=y
1352CONFIG_HID_CHERRY=y 1371CONFIG_HID_CHERRY=y
1353CONFIG_HID_CHICONY=y 1372CONFIG_HID_CHICONY=y
1354CONFIG_HID_CYPRESS=y 1373CONFIG_HID_CYPRESS=y
1355# CONFIG_DRAGONRISE_FF is not set 1374# CONFIG_HID_DRAGONRISE is not set
1356CONFIG_HID_EZKEY=y 1375CONFIG_HID_EZKEY=y
1357# CONFIG_HID_KYE is not set 1376# CONFIG_HID_KYE is not set
1358CONFIG_HID_GYRATION=y 1377CONFIG_HID_GYRATION=y
@@ -1369,10 +1388,11 @@ CONFIG_HID_PETALYNX=y
1369CONFIG_HID_SAMSUNG=y 1388CONFIG_HID_SAMSUNG=y
1370CONFIG_HID_SONY=y 1389CONFIG_HID_SONY=y
1371CONFIG_HID_SUNPLUS=y 1390CONFIG_HID_SUNPLUS=y
1372# CONFIG_GREENASIA_FF is not set 1391# CONFIG_HID_GREENASIA is not set
1392# CONFIG_HID_SMARTJOYPLUS is not set
1373# CONFIG_HID_TOPSEED is not set 1393# CONFIG_HID_TOPSEED is not set
1374CONFIG_THRUSTMASTER_FF=m 1394# CONFIG_HID_THRUSTMASTER is not set
1375CONFIG_ZEROPLUS_FF=m 1395# CONFIG_HID_ZEROPLUS is not set
1376CONFIG_USB_SUPPORT=y 1396CONFIG_USB_SUPPORT=y
1377CONFIG_USB_ARCH_HAS_HCD=y 1397CONFIG_USB_ARCH_HAS_HCD=y
1378CONFIG_USB_ARCH_HAS_OHCI=y 1398CONFIG_USB_ARCH_HAS_OHCI=y
@@ -1398,6 +1418,7 @@ CONFIG_USB=y
1398# USB Host Controller Drivers 1418# USB Host Controller Drivers
1399# 1419#
1400# CONFIG_USB_C67X00_HCD is not set 1420# CONFIG_USB_C67X00_HCD is not set
1421# CONFIG_USB_XHCI_HCD is not set
1401CONFIG_USB_EHCI_HCD=y 1422CONFIG_USB_EHCI_HCD=y
1402# CONFIG_USB_EHCI_ROOT_HUB_TT is not set 1423# CONFIG_USB_EHCI_ROOT_HUB_TT is not set
1403# CONFIG_USB_EHCI_TT_NEWSCHED is not set 1424# CONFIG_USB_EHCI_TT_NEWSCHED is not set
@@ -1407,6 +1428,8 @@ CONFIG_USB_EHCI_HCD=y
1407# CONFIG_USB_ISP116X_HCD is not set 1428# CONFIG_USB_ISP116X_HCD is not set
1408# CONFIG_USB_ISP1760_HCD is not set 1429# CONFIG_USB_ISP1760_HCD is not set
1409CONFIG_USB_OHCI_HCD=y 1430CONFIG_USB_OHCI_HCD=y
1431# CONFIG_USB_OHCI_HCD_PPC_OF_BE is not set
1432# CONFIG_USB_OHCI_HCD_PPC_OF_LE is not set
1410# CONFIG_USB_OHCI_HCD_PPC_OF is not set 1433# CONFIG_USB_OHCI_HCD_PPC_OF is not set
1411# CONFIG_USB_OHCI_BIG_ENDIAN_DESC is not set 1434# CONFIG_USB_OHCI_BIG_ENDIAN_DESC is not set
1412# CONFIG_USB_OHCI_BIG_ENDIAN_MMIO is not set 1435# CONFIG_USB_OHCI_BIG_ENDIAN_MMIO is not set
@@ -1527,6 +1550,7 @@ CONFIG_RTC_INTF_DEV=y
1527# CONFIG_RTC_DRV_S35390A is not set 1550# CONFIG_RTC_DRV_S35390A is not set
1528# CONFIG_RTC_DRV_FM3130 is not set 1551# CONFIG_RTC_DRV_FM3130 is not set
1529CONFIG_RTC_DRV_RX8581=y 1552CONFIG_RTC_DRV_RX8581=y
1553# CONFIG_RTC_DRV_RX8025 is not set
1530 1554
1531# 1555#
1532# SPI RTC drivers 1556# SPI RTC drivers
@@ -1554,6 +1578,10 @@ CONFIG_RTC_DRV_RX8581=y
1554# CONFIG_DMADEVICES is not set 1578# CONFIG_DMADEVICES is not set
1555# CONFIG_AUXDISPLAY is not set 1579# CONFIG_AUXDISPLAY is not set
1556# CONFIG_UIO is not set 1580# CONFIG_UIO is not set
1581
1582#
1583# TI VLYNQ
1584#
1557# CONFIG_STAGING is not set 1585# CONFIG_STAGING is not set
1558 1586
1559# 1587#
@@ -1575,10 +1603,12 @@ CONFIG_FS_MBCACHE=y
1575# CONFIG_REISERFS_FS is not set 1603# CONFIG_REISERFS_FS is not set
1576# CONFIG_JFS_FS is not set 1604# CONFIG_JFS_FS is not set
1577CONFIG_FS_POSIX_ACL=y 1605CONFIG_FS_POSIX_ACL=y
1578CONFIG_FILE_LOCKING=y
1579# CONFIG_XFS_FS is not set 1606# CONFIG_XFS_FS is not set
1607# CONFIG_GFS2_FS is not set
1580# CONFIG_OCFS2_FS is not set 1608# CONFIG_OCFS2_FS is not set
1581# CONFIG_BTRFS_FS is not set 1609# CONFIG_BTRFS_FS is not set
1610CONFIG_FILE_LOCKING=y
1611CONFIG_FSNOTIFY=y
1582CONFIG_DNOTIFY=y 1612CONFIG_DNOTIFY=y
1583CONFIG_INOTIFY=y 1613CONFIG_INOTIFY=y
1584CONFIG_INOTIFY_USER=y 1614CONFIG_INOTIFY_USER=y
@@ -1645,6 +1675,7 @@ CONFIG_NFS_FS=y
1645CONFIG_NFS_V3=y 1675CONFIG_NFS_V3=y
1646# CONFIG_NFS_V3_ACL is not set 1676# CONFIG_NFS_V3_ACL is not set
1647CONFIG_NFS_V4=y 1677CONFIG_NFS_V4=y
1678# CONFIG_NFS_V4_1 is not set
1648CONFIG_ROOT_NFS=y 1679CONFIG_ROOT_NFS=y
1649# CONFIG_NFSD is not set 1680# CONFIG_NFSD is not set
1650CONFIG_LOCKD=y 1681CONFIG_LOCKD=y
@@ -1734,6 +1765,7 @@ CONFIG_HAS_IOPORT=y
1734CONFIG_HAS_DMA=y 1765CONFIG_HAS_DMA=y
1735CONFIG_HAVE_LMB=y 1766CONFIG_HAVE_LMB=y
1736CONFIG_NLATTR=y 1767CONFIG_NLATTR=y
1768CONFIG_GENERIC_ATOMIC64=y
1737 1769
1738# 1770#
1739# Kernel hacking 1771# Kernel hacking
@@ -1759,10 +1791,14 @@ CONFIG_SCHED_DEBUG=y
1759# CONFIG_TIMER_STATS is not set 1791# CONFIG_TIMER_STATS is not set
1760# CONFIG_DEBUG_OBJECTS is not set 1792# CONFIG_DEBUG_OBJECTS is not set
1761# CONFIG_DEBUG_SLAB is not set 1793# CONFIG_DEBUG_SLAB is not set
1794CONFIG_DEBUG_PREEMPT=y
1762# CONFIG_DEBUG_RT_MUTEXES is not set 1795# CONFIG_DEBUG_RT_MUTEXES is not set
1763# CONFIG_RT_MUTEX_TESTER is not set 1796# CONFIG_RT_MUTEX_TESTER is not set
1764# CONFIG_DEBUG_SPINLOCK is not set 1797# CONFIG_DEBUG_SPINLOCK is not set
1765# CONFIG_DEBUG_MUTEXES is not set 1798# CONFIG_DEBUG_MUTEXES is not set
1799# CONFIG_DEBUG_LOCK_ALLOC is not set
1800# CONFIG_PROVE_LOCKING is not set
1801# CONFIG_LOCK_STAT is not set
1766# CONFIG_DEBUG_SPINLOCK_SLEEP is not set 1802# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
1767# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set 1803# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
1768# CONFIG_DEBUG_KOBJECT is not set 1804# CONFIG_DEBUG_KOBJECT is not set
@@ -1774,7 +1810,6 @@ CONFIG_DEBUG_INFO=y
1774# CONFIG_DEBUG_LIST is not set 1810# CONFIG_DEBUG_LIST is not set
1775# CONFIG_DEBUG_SG is not set 1811# CONFIG_DEBUG_SG is not set
1776# CONFIG_DEBUG_NOTIFIERS is not set 1812# CONFIG_DEBUG_NOTIFIERS is not set
1777# CONFIG_BOOT_PRINTK_DELAY is not set
1778# CONFIG_RCU_TORTURE_TEST is not set 1813# CONFIG_RCU_TORTURE_TEST is not set
1779# CONFIG_RCU_CPU_STALL_DETECTOR is not set 1814# CONFIG_RCU_CPU_STALL_DETECTOR is not set
1780# CONFIG_BACKTRACE_SELF_TEST is not set 1815# CONFIG_BACKTRACE_SELF_TEST is not set
@@ -1788,17 +1823,16 @@ CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
1788CONFIG_HAVE_DYNAMIC_FTRACE=y 1823CONFIG_HAVE_DYNAMIC_FTRACE=y
1789CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y 1824CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
1790CONFIG_TRACING_SUPPORT=y 1825CONFIG_TRACING_SUPPORT=y
1791 1826CONFIG_FTRACE=y
1792#
1793# Tracers
1794#
1795# CONFIG_FUNCTION_TRACER is not set 1827# CONFIG_FUNCTION_TRACER is not set
1828# CONFIG_IRQSOFF_TRACER is not set
1796# CONFIG_PREEMPT_TRACER is not set 1829# CONFIG_PREEMPT_TRACER is not set
1797# CONFIG_SCHED_TRACER is not set 1830# CONFIG_SCHED_TRACER is not set
1798# CONFIG_CONTEXT_SWITCH_TRACER is not set 1831# CONFIG_ENABLE_DEFAULT_TRACERS is not set
1799# CONFIG_EVENT_TRACER is not set
1800# CONFIG_BOOT_TRACER is not set 1832# CONFIG_BOOT_TRACER is not set
1801# CONFIG_TRACE_BRANCH_PROFILING is not set 1833CONFIG_BRANCH_PROFILE_NONE=y
1834# CONFIG_PROFILE_ANNOTATED_BRANCHES is not set
1835# CONFIG_PROFILE_ALL_BRANCHES is not set
1802# CONFIG_STACK_TRACER is not set 1836# CONFIG_STACK_TRACER is not set
1803# CONFIG_KMEMTRACE is not set 1837# CONFIG_KMEMTRACE is not set
1804# CONFIG_WORKQUEUE_TRACER is not set 1838# CONFIG_WORKQUEUE_TRACER is not set
@@ -1806,6 +1840,9 @@ CONFIG_TRACING_SUPPORT=y
1806# CONFIG_SAMPLES is not set 1840# CONFIG_SAMPLES is not set
1807CONFIG_HAVE_ARCH_KGDB=y 1841CONFIG_HAVE_ARCH_KGDB=y
1808# CONFIG_KGDB is not set 1842# CONFIG_KGDB is not set
1843# CONFIG_KMEMCHECK is not set
1844# CONFIG_PPC_DISABLE_WERROR is not set
1845CONFIG_PPC_WERROR=y
1809CONFIG_PRINT_STACK_DEPTH=64 1846CONFIG_PRINT_STACK_DEPTH=64
1810# CONFIG_DEBUG_STACKOVERFLOW is not set 1847# CONFIG_DEBUG_STACKOVERFLOW is not set
1811# CONFIG_DEBUG_STACK_USAGE is not set 1848# CONFIG_DEBUG_STACK_USAGE is not set
@@ -1829,7 +1866,6 @@ CONFIG_SECURITY_NETWORK=y
1829# CONFIG_SECURITY_PATH is not set 1866# CONFIG_SECURITY_PATH is not set
1830# CONFIG_SECURITY_FILE_CAPABILITIES is not set 1867# CONFIG_SECURITY_FILE_CAPABILITIES is not set
1831# CONFIG_SECURITY_ROOTPLUG is not set 1868# CONFIG_SECURITY_ROOTPLUG is not set
1832CONFIG_SECURITY_DEFAULT_MMAP_MIN_ADDR=0
1833# CONFIG_SECURITY_TOMOYO is not set 1869# CONFIG_SECURITY_TOMOYO is not set
1834CONFIG_CRYPTO=y 1870CONFIG_CRYPTO=y
1835 1871
diff --git a/arch/powerpc/configs/86xx/mpc8610_hpcd_defconfig b/arch/powerpc/configs/86xx/mpc8610_hpcd_defconfig
index cfd2efcc6bce..a61f183f7186 100644
--- a/arch/powerpc/configs/86xx/mpc8610_hpcd_defconfig
+++ b/arch/powerpc/configs/86xx/mpc8610_hpcd_defconfig
@@ -1,26 +1,28 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.30-rc3 3# Linux kernel version: 2.6.31-rc4
4# Wed May 13 17:22:28 2009 4# Wed Jul 29 23:32:27 2009
5# 5#
6# CONFIG_PPC64 is not set 6# CONFIG_PPC64 is not set
7 7
8# 8#
9# Processor support 9# Processor support
10# 10#
11CONFIG_6xx=y 11CONFIG_PPC_BOOK3S_32=y
12# CONFIG_PPC_85xx is not set 12# CONFIG_PPC_85xx is not set
13# CONFIG_PPC_8xx is not set 13# CONFIG_PPC_8xx is not set
14# CONFIG_40x is not set 14# CONFIG_40x is not set
15# CONFIG_44x is not set 15# CONFIG_44x is not set
16# CONFIG_E200 is not set 16# CONFIG_E200 is not set
17CONFIG_PPC_BOOK3S=y 17CONFIG_PPC_BOOK3S=y
18CONFIG_6xx=y
18CONFIG_PPC_FPU=y 19CONFIG_PPC_FPU=y
19# CONFIG_PHYS_64BIT is not set 20# CONFIG_PHYS_64BIT is not set
20CONFIG_ALTIVEC=y 21CONFIG_ALTIVEC=y
21CONFIG_PPC_STD_MMU=y 22CONFIG_PPC_STD_MMU=y
22CONFIG_PPC_STD_MMU_32=y 23CONFIG_PPC_STD_MMU_32=y
23# CONFIG_PPC_MM_SLICES is not set 24# CONFIG_PPC_MM_SLICES is not set
25CONFIG_PPC_HAVE_PMU_SUPPORT=y
24# CONFIG_SMP is not set 26# CONFIG_SMP is not set
25CONFIG_PPC32=y 27CONFIG_PPC32=y
26CONFIG_WORD_SIZE=32 28CONFIG_WORD_SIZE=32
@@ -31,15 +33,16 @@ CONFIG_GENERIC_TIME=y
31CONFIG_GENERIC_TIME_VSYSCALL=y 33CONFIG_GENERIC_TIME_VSYSCALL=y
32CONFIG_GENERIC_CLOCKEVENTS=y 34CONFIG_GENERIC_CLOCKEVENTS=y
33CONFIG_GENERIC_HARDIRQS=y 35CONFIG_GENERIC_HARDIRQS=y
36CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
34# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set 37# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set
35CONFIG_IRQ_PER_CPU=y 38CONFIG_IRQ_PER_CPU=y
36CONFIG_STACKTRACE_SUPPORT=y 39CONFIG_STACKTRACE_SUPPORT=y
37CONFIG_HAVE_LATENCYTOP_SUPPORT=y 40CONFIG_HAVE_LATENCYTOP_SUPPORT=y
41CONFIG_TRACE_IRQFLAGS_SUPPORT=y
38CONFIG_LOCKDEP_SUPPORT=y 42CONFIG_LOCKDEP_SUPPORT=y
39CONFIG_RWSEM_XCHGADD_ALGORITHM=y 43CONFIG_RWSEM_XCHGADD_ALGORITHM=y
40CONFIG_ARCH_HAS_ILOG2_U32=y 44CONFIG_ARCH_HAS_ILOG2_U32=y
41CONFIG_GENERIC_HWEIGHT=y 45CONFIG_GENERIC_HWEIGHT=y
42CONFIG_GENERIC_CALIBRATE_DELAY=y
43CONFIG_GENERIC_FIND_NEXT_BIT=y 46CONFIG_GENERIC_FIND_NEXT_BIT=y
44# CONFIG_ARCH_NO_VIRT_TO_BUS is not set 47# CONFIG_ARCH_NO_VIRT_TO_BUS is not set
45CONFIG_PPC=y 48CONFIG_PPC=y
@@ -53,11 +56,13 @@ CONFIG_PPC_UDBG_16550=y
53# CONFIG_GENERIC_TBSYNC is not set 56# CONFIG_GENERIC_TBSYNC is not set
54CONFIG_AUDIT_ARCH=y 57CONFIG_AUDIT_ARCH=y
55CONFIG_GENERIC_BUG=y 58CONFIG_GENERIC_BUG=y
59CONFIG_DTC=y
56CONFIG_DEFAULT_UIMAGE=y 60CONFIG_DEFAULT_UIMAGE=y
57# CONFIG_PPC_DCR_NATIVE is not set 61# CONFIG_PPC_DCR_NATIVE is not set
58# CONFIG_PPC_DCR_MMIO is not set 62# CONFIG_PPC_DCR_MMIO is not set
59CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y 63CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y
60CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" 64CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
65CONFIG_CONSTRUCTORS=y
61 66
62# 67#
63# General setup 68# General setup
@@ -109,7 +114,6 @@ CONFIG_SYSCTL_SYSCALL=y
109CONFIG_KALLSYMS=y 114CONFIG_KALLSYMS=y
110# CONFIG_KALLSYMS_ALL is not set 115# CONFIG_KALLSYMS_ALL is not set
111CONFIG_KALLSYMS_EXTRA_PASS=y 116CONFIG_KALLSYMS_EXTRA_PASS=y
112# CONFIG_STRIP_ASM_SYMS is not set
113CONFIG_HOTPLUG=y 117CONFIG_HOTPLUG=y
114CONFIG_PRINTK=y 118CONFIG_PRINTK=y
115CONFIG_BUG=y 119CONFIG_BUG=y
@@ -122,9 +126,16 @@ CONFIG_TIMERFD=y
122CONFIG_EVENTFD=y 126CONFIG_EVENTFD=y
123CONFIG_SHMEM=y 127CONFIG_SHMEM=y
124CONFIG_AIO=y 128CONFIG_AIO=y
129CONFIG_HAVE_PERF_COUNTERS=y
130
131#
132# Performance Counters
133#
134# CONFIG_PERF_COUNTERS is not set
125CONFIG_VM_EVENT_COUNTERS=y 135CONFIG_VM_EVENT_COUNTERS=y
126CONFIG_PCI_QUIRKS=y 136CONFIG_PCI_QUIRKS=y
127CONFIG_SLUB_DEBUG=y 137CONFIG_SLUB_DEBUG=y
138# CONFIG_STRIP_ASM_SYMS is not set
128CONFIG_COMPAT_BRK=y 139CONFIG_COMPAT_BRK=y
129# CONFIG_SLAB is not set 140# CONFIG_SLAB is not set
130CONFIG_SLUB=y 141CONFIG_SLUB=y
@@ -138,6 +149,10 @@ CONFIG_HAVE_IOREMAP_PROT=y
138CONFIG_HAVE_KPROBES=y 149CONFIG_HAVE_KPROBES=y
139CONFIG_HAVE_KRETPROBES=y 150CONFIG_HAVE_KRETPROBES=y
140CONFIG_HAVE_ARCH_TRACEHOOK=y 151CONFIG_HAVE_ARCH_TRACEHOOK=y
152
153#
154# GCOV-based kernel profiling
155#
141# CONFIG_SLOW_WORK is not set 156# CONFIG_SLOW_WORK is not set
142# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set 157# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
143CONFIG_SLABINFO=y 158CONFIG_SLABINFO=y
@@ -150,7 +165,7 @@ CONFIG_MODULE_UNLOAD=y
150# CONFIG_MODVERSIONS is not set 165# CONFIG_MODVERSIONS is not set
151# CONFIG_MODULE_SRCVERSION_ALL is not set 166# CONFIG_MODULE_SRCVERSION_ALL is not set
152CONFIG_BLOCK=y 167CONFIG_BLOCK=y
153# CONFIG_LBD is not set 168CONFIG_LBDAF=y
154# CONFIG_BLK_DEV_BSG is not set 169# CONFIG_BLK_DEV_BSG is not set
155# CONFIG_BLK_DEV_INTEGRITY is not set 170# CONFIG_BLK_DEV_INTEGRITY is not set
156 171
@@ -230,6 +245,7 @@ CONFIG_BINFMT_ELF=y
230# CONFIG_HAVE_AOUT is not set 245# CONFIG_HAVE_AOUT is not set
231# CONFIG_BINFMT_MISC is not set 246# CONFIG_BINFMT_MISC is not set
232# CONFIG_IOMMU_HELPER is not set 247# CONFIG_IOMMU_HELPER is not set
248# CONFIG_SWIOTLB is not set
233CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y 249CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
234CONFIG_ARCH_HAS_WALK_MEMORY=y 250CONFIG_ARCH_HAS_WALK_MEMORY=y
235CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y 251CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y
@@ -250,9 +266,9 @@ CONFIG_MIGRATION=y
250CONFIG_ZONE_DMA_FLAG=1 266CONFIG_ZONE_DMA_FLAG=1
251CONFIG_BOUNCE=y 267CONFIG_BOUNCE=y
252CONFIG_VIRT_TO_BUS=y 268CONFIG_VIRT_TO_BUS=y
253CONFIG_UNEVICTABLE_LRU=y
254CONFIG_HAVE_MLOCK=y 269CONFIG_HAVE_MLOCK=y
255CONFIG_HAVE_MLOCKED_PAGE_BIT=y 270CONFIG_HAVE_MLOCKED_PAGE_BIT=y
271CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
256CONFIG_PPC_4K_PAGES=y 272CONFIG_PPC_4K_PAGES=y
257# CONFIG_PPC_16K_PAGES is not set 273# CONFIG_PPC_16K_PAGES is not set
258# CONFIG_PPC_64K_PAGES is not set 274# CONFIG_PPC_64K_PAGES is not set
@@ -279,6 +295,8 @@ CONFIG_PCI_DOMAINS=y
279CONFIG_PCI_SYSCALL=y 295CONFIG_PCI_SYSCALL=y
280CONFIG_PCIEPORTBUS=y 296CONFIG_PCIEPORTBUS=y
281CONFIG_PCIEAER=y 297CONFIG_PCIEAER=y
298# CONFIG_PCIE_ECRC is not set
299# CONFIG_PCIEAER_INJECT is not set
282# CONFIG_PCIEASPM is not set 300# CONFIG_PCIEASPM is not set
283CONFIG_ARCH_SUPPORTS_MSI=y 301CONFIG_ARCH_SUPPORTS_MSI=y
284# CONFIG_PCI_MSI is not set 302# CONFIG_PCI_MSI is not set
@@ -381,6 +399,7 @@ CONFIG_IPV6_NDISC_NODETYPE=y
381# CONFIG_ECONET is not set 399# CONFIG_ECONET is not set
382# CONFIG_WAN_ROUTER is not set 400# CONFIG_WAN_ROUTER is not set
383# CONFIG_PHONET is not set 401# CONFIG_PHONET is not set
402# CONFIG_IEEE802154 is not set
384# CONFIG_NET_SCHED is not set 403# CONFIG_NET_SCHED is not set
385# CONFIG_DCB is not set 404# CONFIG_DCB is not set
386 405
@@ -398,7 +417,11 @@ CONFIG_WIRELESS=y
398CONFIG_WIRELESS_OLD_REGULATORY=y 417CONFIG_WIRELESS_OLD_REGULATORY=y
399# CONFIG_WIRELESS_EXT is not set 418# CONFIG_WIRELESS_EXT is not set
400# CONFIG_LIB80211 is not set 419# CONFIG_LIB80211 is not set
401# CONFIG_MAC80211 is not set 420
421#
422# CFG80211 needs to be enabled for MAC80211
423#
424CONFIG_MAC80211_DEFAULT_PS_VALUE=0
402# CONFIG_WIMAX is not set 425# CONFIG_WIMAX is not set
403# CONFIG_RFKILL is not set 426# CONFIG_RFKILL is not set
404# CONFIG_NET_9P is not set 427# CONFIG_NET_9P is not set
@@ -549,7 +572,9 @@ CONFIG_MISC_DEVICES=y
549# 572#
550# CONFIG_EEPROM_AT24 is not set 573# CONFIG_EEPROM_AT24 is not set
551# CONFIG_EEPROM_LEGACY is not set 574# CONFIG_EEPROM_LEGACY is not set
575# CONFIG_EEPROM_MAX6875 is not set
552# CONFIG_EEPROM_93CX6 is not set 576# CONFIG_EEPROM_93CX6 is not set
577# CONFIG_CB710_CORE is not set
553CONFIG_HAVE_IDE=y 578CONFIG_HAVE_IDE=y
554CONFIG_IDE=y 579CONFIG_IDE=y
555 580
@@ -620,10 +645,6 @@ CONFIG_BLK_DEV_SD=y
620# CONFIG_BLK_DEV_SR is not set 645# CONFIG_BLK_DEV_SR is not set
621CONFIG_CHR_DEV_SG=y 646CONFIG_CHR_DEV_SG=y
622# CONFIG_CHR_DEV_SCH is not set 647# CONFIG_CHR_DEV_SCH is not set
623
624#
625# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
626#
627# CONFIG_SCSI_MULTI_LUN is not set 648# CONFIG_SCSI_MULTI_LUN is not set
628# CONFIG_SCSI_CONSTANTS is not set 649# CONFIG_SCSI_CONSTANTS is not set
629# CONFIG_SCSI_LOGGING is not set 650# CONFIG_SCSI_LOGGING is not set
@@ -640,6 +661,7 @@ CONFIG_SCSI_WAIT_SCAN=m
640# CONFIG_SCSI_SRP_ATTRS is not set 661# CONFIG_SCSI_SRP_ATTRS is not set
641CONFIG_SCSI_LOWLEVEL=y 662CONFIG_SCSI_LOWLEVEL=y
642# CONFIG_ISCSI_TCP is not set 663# CONFIG_ISCSI_TCP is not set
664# CONFIG_SCSI_BNX2_ISCSI is not set
643# CONFIG_BLK_DEV_3W_XXXX_RAID is not set 665# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
644# CONFIG_SCSI_3W_9XXX is not set 666# CONFIG_SCSI_3W_9XXX is not set
645# CONFIG_SCSI_ACARD is not set 667# CONFIG_SCSI_ACARD is not set
@@ -648,6 +670,7 @@ CONFIG_SCSI_LOWLEVEL=y
648# CONFIG_SCSI_AIC7XXX_OLD is not set 670# CONFIG_SCSI_AIC7XXX_OLD is not set
649# CONFIG_SCSI_AIC79XX is not set 671# CONFIG_SCSI_AIC79XX is not set
650# CONFIG_SCSI_AIC94XX is not set 672# CONFIG_SCSI_AIC94XX is not set
673# CONFIG_SCSI_MVSAS is not set
651# CONFIG_SCSI_DPT_I2O is not set 674# CONFIG_SCSI_DPT_I2O is not set
652# CONFIG_SCSI_ADVANSYS is not set 675# CONFIG_SCSI_ADVANSYS is not set
653# CONFIG_SCSI_ARCMSR is not set 676# CONFIG_SCSI_ARCMSR is not set
@@ -667,7 +690,6 @@ CONFIG_SCSI_LOWLEVEL=y
667# CONFIG_SCSI_IPS is not set 690# CONFIG_SCSI_IPS is not set
668# CONFIG_SCSI_INITIO is not set 691# CONFIG_SCSI_INITIO is not set
669# CONFIG_SCSI_INIA100 is not set 692# CONFIG_SCSI_INIA100 is not set
670# CONFIG_SCSI_MVSAS is not set
671# CONFIG_SCSI_STEX is not set 693# CONFIG_SCSI_STEX is not set
672# CONFIG_SCSI_SYM53C8XX_2 is not set 694# CONFIG_SCSI_SYM53C8XX_2 is not set
673# CONFIG_SCSI_IPR is not set 695# CONFIG_SCSI_IPR is not set
@@ -751,14 +773,17 @@ CONFIG_PATA_ALI=y
751# 773#
752 774
753# 775#
754# Enable only one of the two stacks, unless you know what you are doing 776# You can enable one or both FireWire driver stacks.
777#
778
779#
780# See the help texts for more information.
755# 781#
756# CONFIG_FIREWIRE is not set 782# CONFIG_FIREWIRE is not set
757# CONFIG_IEEE1394 is not set 783# CONFIG_IEEE1394 is not set
758# CONFIG_I2O is not set 784# CONFIG_I2O is not set
759# CONFIG_MACINTOSH_DRIVERS is not set 785# CONFIG_MACINTOSH_DRIVERS is not set
760CONFIG_NETDEVICES=y 786CONFIG_NETDEVICES=y
761CONFIG_COMPAT_NET_DEV_OPS=y
762CONFIG_DUMMY=y 787CONFIG_DUMMY=y
763# CONFIG_BONDING is not set 788# CONFIG_BONDING is not set
764# CONFIG_MACVLAN is not set 789# CONFIG_MACVLAN is not set
@@ -792,6 +817,7 @@ CONFIG_ULI526X=y
792# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set 817# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
793# CONFIG_NET_PCI is not set 818# CONFIG_NET_PCI is not set
794# CONFIG_B44 is not set 819# CONFIG_B44 is not set
820# CONFIG_KS8842 is not set
795# CONFIG_ATL2 is not set 821# CONFIG_ATL2 is not set
796# CONFIG_NETDEV_1000 is not set 822# CONFIG_NETDEV_1000 is not set
797# CONFIG_NETDEV_10000 is not set 823# CONFIG_NETDEV_10000 is not set
@@ -959,13 +985,17 @@ CONFIG_I2C_MPC=y
959# CONFIG_SENSORS_PCF8574 is not set 985# CONFIG_SENSORS_PCF8574 is not set
960# CONFIG_PCF8575 is not set 986# CONFIG_PCF8575 is not set
961# CONFIG_SENSORS_PCA9539 is not set 987# CONFIG_SENSORS_PCA9539 is not set
962# CONFIG_SENSORS_MAX6875 is not set
963# CONFIG_SENSORS_TSL2550 is not set 988# CONFIG_SENSORS_TSL2550 is not set
964# CONFIG_I2C_DEBUG_CORE is not set 989# CONFIG_I2C_DEBUG_CORE is not set
965# CONFIG_I2C_DEBUG_ALGO is not set 990# CONFIG_I2C_DEBUG_ALGO is not set
966# CONFIG_I2C_DEBUG_BUS is not set 991# CONFIG_I2C_DEBUG_BUS is not set
967# CONFIG_I2C_DEBUG_CHIP is not set 992# CONFIG_I2C_DEBUG_CHIP is not set
968# CONFIG_SPI is not set 993# CONFIG_SPI is not set
994
995#
996# PPS support
997#
998# CONFIG_PPS is not set
969CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y 999CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
970# CONFIG_GPIOLIB is not set 1000# CONFIG_GPIOLIB is not set
971# CONFIG_W1 is not set 1001# CONFIG_W1 is not set
@@ -993,23 +1023,9 @@ CONFIG_SSB_POSSIBLE=y
993# CONFIG_MFD_WM8400 is not set 1023# CONFIG_MFD_WM8400 is not set
994# CONFIG_MFD_WM8350_I2C is not set 1024# CONFIG_MFD_WM8350_I2C is not set
995# CONFIG_MFD_PCF50633 is not set 1025# CONFIG_MFD_PCF50633 is not set
1026# CONFIG_AB3100_CORE is not set
996# CONFIG_REGULATOR is not set 1027# CONFIG_REGULATOR is not set
997 1028# CONFIG_MEDIA_SUPPORT is not set
998#
999# Multimedia devices
1000#
1001
1002#
1003# Multimedia core support
1004#
1005# CONFIG_VIDEO_DEV is not set
1006# CONFIG_DVB_CORE is not set
1007# CONFIG_VIDEO_MEDIA is not set
1008
1009#
1010# Multimedia drivers
1011#
1012CONFIG_DAB=y
1013 1029
1014# 1030#
1015# Graphics support 1031# Graphics support
@@ -1106,6 +1122,11 @@ CONFIG_SND_PCM_OSS_PLUGINS=y
1106CONFIG_SND_VERBOSE_PROCFS=y 1122CONFIG_SND_VERBOSE_PROCFS=y
1107# CONFIG_SND_VERBOSE_PRINTK is not set 1123# CONFIG_SND_VERBOSE_PRINTK is not set
1108# CONFIG_SND_DEBUG is not set 1124# CONFIG_SND_DEBUG is not set
1125# CONFIG_SND_RAWMIDI_SEQ is not set
1126# CONFIG_SND_OPL3_LIB_SEQ is not set
1127# CONFIG_SND_OPL4_LIB_SEQ is not set
1128# CONFIG_SND_SBAWE_SEQ is not set
1129# CONFIG_SND_EMU10K1_SEQ is not set
1109CONFIG_SND_DRIVERS=y 1130CONFIG_SND_DRIVERS=y
1110# CONFIG_SND_DUMMY is not set 1131# CONFIG_SND_DUMMY is not set
1111# CONFIG_SND_MTPAV is not set 1132# CONFIG_SND_MTPAV is not set
@@ -1130,6 +1151,7 @@ CONFIG_SND_PCI=y
1130# CONFIG_SND_CS4281 is not set 1151# CONFIG_SND_CS4281 is not set
1131# CONFIG_SND_CS46XX is not set 1152# CONFIG_SND_CS46XX is not set
1132# CONFIG_SND_CS5530 is not set 1153# CONFIG_SND_CS5530 is not set
1154# CONFIG_SND_CTXFI is not set
1133# CONFIG_SND_DARLA20 is not set 1155# CONFIG_SND_DARLA20 is not set
1134# CONFIG_SND_GINA20 is not set 1156# CONFIG_SND_GINA20 is not set
1135# CONFIG_SND_LAYLA20 is not set 1157# CONFIG_SND_LAYLA20 is not set
@@ -1160,6 +1182,7 @@ CONFIG_SND_PCI=y
1160# CONFIG_SND_INTEL8X0 is not set 1182# CONFIG_SND_INTEL8X0 is not set
1161# CONFIG_SND_INTEL8X0M is not set 1183# CONFIG_SND_INTEL8X0M is not set
1162# CONFIG_SND_KORG1212 is not set 1184# CONFIG_SND_KORG1212 is not set
1185# CONFIG_SND_LX6464ES is not set
1163# CONFIG_SND_MAESTRO3 is not set 1186# CONFIG_SND_MAESTRO3 is not set
1164# CONFIG_SND_MIXART is not set 1187# CONFIG_SND_MIXART is not set
1165# CONFIG_SND_NM256 is not set 1188# CONFIG_SND_NM256 is not set
@@ -1251,6 +1274,7 @@ CONFIG_RTC_INTF_DEV=y
1251# CONFIG_RTC_DRV_S35390A is not set 1274# CONFIG_RTC_DRV_S35390A is not set
1252# CONFIG_RTC_DRV_FM3130 is not set 1275# CONFIG_RTC_DRV_FM3130 is not set
1253# CONFIG_RTC_DRV_RX8581 is not set 1276# CONFIG_RTC_DRV_RX8581 is not set
1277# CONFIG_RTC_DRV_RX8025 is not set
1254 1278
1255# 1279#
1256# SPI RTC drivers 1280# SPI RTC drivers
@@ -1278,6 +1302,10 @@ CONFIG_RTC_DRV_CMOS=y
1278# CONFIG_DMADEVICES is not set 1302# CONFIG_DMADEVICES is not set
1279# CONFIG_AUXDISPLAY is not set 1303# CONFIG_AUXDISPLAY is not set
1280# CONFIG_UIO is not set 1304# CONFIG_UIO is not set
1305
1306#
1307# TI VLYNQ
1308#
1281# CONFIG_STAGING is not set 1309# CONFIG_STAGING is not set
1282 1310
1283# 1311#
@@ -1297,12 +1325,15 @@ CONFIG_FS_MBCACHE=y
1297# CONFIG_REISERFS_FS is not set 1325# CONFIG_REISERFS_FS is not set
1298# CONFIG_JFS_FS is not set 1326# CONFIG_JFS_FS is not set
1299# CONFIG_FS_POSIX_ACL is not set 1327# CONFIG_FS_POSIX_ACL is not set
1300CONFIG_FILE_LOCKING=y
1301# CONFIG_XFS_FS is not set 1328# CONFIG_XFS_FS is not set
1329# CONFIG_GFS2_FS is not set
1302# CONFIG_OCFS2_FS is not set 1330# CONFIG_OCFS2_FS is not set
1303# CONFIG_BTRFS_FS is not set 1331# CONFIG_BTRFS_FS is not set
1332CONFIG_FILE_LOCKING=y
1333CONFIG_FSNOTIFY=y
1304# CONFIG_DNOTIFY is not set 1334# CONFIG_DNOTIFY is not set
1305# CONFIG_INOTIFY is not set 1335# CONFIG_INOTIFY is not set
1336CONFIG_INOTIFY_USER=y
1306# CONFIG_QUOTA is not set 1337# CONFIG_QUOTA is not set
1307# CONFIG_AUTOFS_FS is not set 1338# CONFIG_AUTOFS_FS is not set
1308# CONFIG_AUTOFS4_FS is not set 1339# CONFIG_AUTOFS4_FS is not set
@@ -1464,6 +1495,7 @@ CONFIG_HAS_IOPORT=y
1464CONFIG_HAS_DMA=y 1495CONFIG_HAS_DMA=y
1465CONFIG_HAVE_LMB=y 1496CONFIG_HAVE_LMB=y
1466CONFIG_NLATTR=y 1497CONFIG_NLATTR=y
1498CONFIG_GENERIC_ATOMIC64=y
1467 1499
1468# 1500#
1469# Kernel hacking 1501# Kernel hacking
@@ -1494,6 +1526,9 @@ CONFIG_SCHED_DEBUG=y
1494# CONFIG_RT_MUTEX_TESTER is not set 1526# CONFIG_RT_MUTEX_TESTER is not set
1495# CONFIG_DEBUG_SPINLOCK is not set 1527# CONFIG_DEBUG_SPINLOCK is not set
1496# CONFIG_DEBUG_MUTEXES is not set 1528# CONFIG_DEBUG_MUTEXES is not set
1529# CONFIG_DEBUG_LOCK_ALLOC is not set
1530# CONFIG_PROVE_LOCKING is not set
1531# CONFIG_LOCK_STAT is not set
1497# CONFIG_DEBUG_SPINLOCK_SLEEP is not set 1532# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
1498# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set 1533# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
1499# CONFIG_DEBUG_KOBJECT is not set 1534# CONFIG_DEBUG_KOBJECT is not set
@@ -1506,7 +1541,6 @@ CONFIG_DEBUG_INFO=y
1506# CONFIG_DEBUG_LIST is not set 1541# CONFIG_DEBUG_LIST is not set
1507# CONFIG_DEBUG_SG is not set 1542# CONFIG_DEBUG_SG is not set
1508# CONFIG_DEBUG_NOTIFIERS is not set 1543# CONFIG_DEBUG_NOTIFIERS is not set
1509# CONFIG_BOOT_PRINTK_DELAY is not set
1510# CONFIG_RCU_TORTURE_TEST is not set 1544# CONFIG_RCU_TORTURE_TEST is not set
1511# CONFIG_RCU_CPU_STALL_DETECTOR is not set 1545# CONFIG_RCU_CPU_STALL_DETECTOR is not set
1512# CONFIG_BACKTRACE_SELF_TEST is not set 1546# CONFIG_BACKTRACE_SELF_TEST is not set
@@ -1520,16 +1554,15 @@ CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
1520CONFIG_HAVE_DYNAMIC_FTRACE=y 1554CONFIG_HAVE_DYNAMIC_FTRACE=y
1521CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y 1555CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
1522CONFIG_TRACING_SUPPORT=y 1556CONFIG_TRACING_SUPPORT=y
1523 1557CONFIG_FTRACE=y
1524#
1525# Tracers
1526#
1527# CONFIG_FUNCTION_TRACER is not set 1558# CONFIG_FUNCTION_TRACER is not set
1559# CONFIG_IRQSOFF_TRACER is not set
1528# CONFIG_SCHED_TRACER is not set 1560# CONFIG_SCHED_TRACER is not set
1529# CONFIG_CONTEXT_SWITCH_TRACER is not set 1561# CONFIG_ENABLE_DEFAULT_TRACERS is not set
1530# CONFIG_EVENT_TRACER is not set
1531# CONFIG_BOOT_TRACER is not set 1562# CONFIG_BOOT_TRACER is not set
1532# CONFIG_TRACE_BRANCH_PROFILING is not set 1563CONFIG_BRANCH_PROFILE_NONE=y
1564# CONFIG_PROFILE_ANNOTATED_BRANCHES is not set
1565# CONFIG_PROFILE_ALL_BRANCHES is not set
1533# CONFIG_STACK_TRACER is not set 1566# CONFIG_STACK_TRACER is not set
1534# CONFIG_KMEMTRACE is not set 1567# CONFIG_KMEMTRACE is not set
1535# CONFIG_WORKQUEUE_TRACER is not set 1568# CONFIG_WORKQUEUE_TRACER is not set
@@ -1537,6 +1570,9 @@ CONFIG_TRACING_SUPPORT=y
1537# CONFIG_SAMPLES is not set 1570# CONFIG_SAMPLES is not set
1538CONFIG_HAVE_ARCH_KGDB=y 1571CONFIG_HAVE_ARCH_KGDB=y
1539# CONFIG_KGDB is not set 1572# CONFIG_KGDB is not set
1573# CONFIG_KMEMCHECK is not set
1574# CONFIG_PPC_DISABLE_WERROR is not set
1575CONFIG_PPC_WERROR=y
1540CONFIG_PRINT_STACK_DEPTH=64 1576CONFIG_PRINT_STACK_DEPTH=64
1541# CONFIG_DEBUG_STACKOVERFLOW is not set 1577# CONFIG_DEBUG_STACKOVERFLOW is not set
1542# CONFIG_DEBUG_STACK_USAGE is not set 1578# CONFIG_DEBUG_STACK_USAGE is not set
diff --git a/arch/powerpc/configs/86xx/mpc8641_hpcn_defconfig b/arch/powerpc/configs/86xx/mpc8641_hpcn_defconfig
index 0bee3e303942..7016ce732605 100644
--- a/arch/powerpc/configs/86xx/mpc8641_hpcn_defconfig
+++ b/arch/powerpc/configs/86xx/mpc8641_hpcn_defconfig
@@ -1,26 +1,28 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.30-rc3 3# Linux kernel version: 2.6.31-rc4
4# Wed May 13 17:22:28 2009 4# Wed Jul 29 23:32:28 2009
5# 5#
6# CONFIG_PPC64 is not set 6# CONFIG_PPC64 is not set
7 7
8# 8#
9# Processor support 9# Processor support
10# 10#
11CONFIG_6xx=y 11CONFIG_PPC_BOOK3S_32=y
12# CONFIG_PPC_85xx is not set 12# CONFIG_PPC_85xx is not set
13# CONFIG_PPC_8xx is not set 13# CONFIG_PPC_8xx is not set
14# CONFIG_40x is not set 14# CONFIG_40x is not set
15# CONFIG_44x is not set 15# CONFIG_44x is not set
16# CONFIG_E200 is not set 16# CONFIG_E200 is not set
17CONFIG_PPC_BOOK3S=y 17CONFIG_PPC_BOOK3S=y
18CONFIG_6xx=y
18CONFIG_PPC_FPU=y 19CONFIG_PPC_FPU=y
19# CONFIG_PHYS_64BIT is not set 20# CONFIG_PHYS_64BIT is not set
20CONFIG_ALTIVEC=y 21CONFIG_ALTIVEC=y
21CONFIG_PPC_STD_MMU=y 22CONFIG_PPC_STD_MMU=y
22CONFIG_PPC_STD_MMU_32=y 23CONFIG_PPC_STD_MMU_32=y
23# CONFIG_PPC_MM_SLICES is not set 24# CONFIG_PPC_MM_SLICES is not set
25CONFIG_PPC_HAVE_PMU_SUPPORT=y
24CONFIG_SMP=y 26CONFIG_SMP=y
25CONFIG_NR_CPUS=2 27CONFIG_NR_CPUS=2
26CONFIG_PPC32=y 28CONFIG_PPC32=y
@@ -32,15 +34,16 @@ CONFIG_GENERIC_TIME=y
32CONFIG_GENERIC_TIME_VSYSCALL=y 34CONFIG_GENERIC_TIME_VSYSCALL=y
33CONFIG_GENERIC_CLOCKEVENTS=y 35CONFIG_GENERIC_CLOCKEVENTS=y
34CONFIG_GENERIC_HARDIRQS=y 36CONFIG_GENERIC_HARDIRQS=y
37CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
35# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set 38# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set
36CONFIG_IRQ_PER_CPU=y 39CONFIG_IRQ_PER_CPU=y
37CONFIG_STACKTRACE_SUPPORT=y 40CONFIG_STACKTRACE_SUPPORT=y
38CONFIG_HAVE_LATENCYTOP_SUPPORT=y 41CONFIG_HAVE_LATENCYTOP_SUPPORT=y
42CONFIG_TRACE_IRQFLAGS_SUPPORT=y
39CONFIG_LOCKDEP_SUPPORT=y 43CONFIG_LOCKDEP_SUPPORT=y
40CONFIG_RWSEM_XCHGADD_ALGORITHM=y 44CONFIG_RWSEM_XCHGADD_ALGORITHM=y
41CONFIG_ARCH_HAS_ILOG2_U32=y 45CONFIG_ARCH_HAS_ILOG2_U32=y
42CONFIG_GENERIC_HWEIGHT=y 46CONFIG_GENERIC_HWEIGHT=y
43CONFIG_GENERIC_CALIBRATE_DELAY=y
44CONFIG_GENERIC_FIND_NEXT_BIT=y 47CONFIG_GENERIC_FIND_NEXT_BIT=y
45# CONFIG_ARCH_NO_VIRT_TO_BUS is not set 48# CONFIG_ARCH_NO_VIRT_TO_BUS is not set
46CONFIG_PPC=y 49CONFIG_PPC=y
@@ -54,11 +57,13 @@ CONFIG_PPC_UDBG_16550=y
54CONFIG_GENERIC_TBSYNC=y 57CONFIG_GENERIC_TBSYNC=y
55CONFIG_AUDIT_ARCH=y 58CONFIG_AUDIT_ARCH=y
56CONFIG_GENERIC_BUG=y 59CONFIG_GENERIC_BUG=y
60CONFIG_DTC=y
57CONFIG_DEFAULT_UIMAGE=y 61CONFIG_DEFAULT_UIMAGE=y
58# CONFIG_PPC_DCR_NATIVE is not set 62# CONFIG_PPC_DCR_NATIVE is not set
59# CONFIG_PPC_DCR_MMIO is not set 63# CONFIG_PPC_DCR_MMIO is not set
60CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y 64CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y
61CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" 65CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
66CONFIG_CONSTRUCTORS=y
62 67
63# 68#
64# General setup 69# General setup
@@ -113,7 +118,6 @@ CONFIG_SYSCTL_SYSCALL=y
113CONFIG_KALLSYMS=y 118CONFIG_KALLSYMS=y
114CONFIG_KALLSYMS_ALL=y 119CONFIG_KALLSYMS_ALL=y
115CONFIG_KALLSYMS_EXTRA_PASS=y 120CONFIG_KALLSYMS_EXTRA_PASS=y
116# CONFIG_STRIP_ASM_SYMS is not set
117CONFIG_HOTPLUG=y 121CONFIG_HOTPLUG=y
118CONFIG_PRINTK=y 122CONFIG_PRINTK=y
119CONFIG_BUG=y 123CONFIG_BUG=y
@@ -126,9 +130,16 @@ CONFIG_TIMERFD=y
126CONFIG_EVENTFD=y 130CONFIG_EVENTFD=y
127CONFIG_SHMEM=y 131CONFIG_SHMEM=y
128CONFIG_AIO=y 132CONFIG_AIO=y
133CONFIG_HAVE_PERF_COUNTERS=y
134
135#
136# Performance Counters
137#
138# CONFIG_PERF_COUNTERS is not set
129CONFIG_VM_EVENT_COUNTERS=y 139CONFIG_VM_EVENT_COUNTERS=y
130CONFIG_PCI_QUIRKS=y 140CONFIG_PCI_QUIRKS=y
131CONFIG_SLUB_DEBUG=y 141CONFIG_SLUB_DEBUG=y
142# CONFIG_STRIP_ASM_SYMS is not set
132CONFIG_COMPAT_BRK=y 143CONFIG_COMPAT_BRK=y
133# CONFIG_SLAB is not set 144# CONFIG_SLAB is not set
134CONFIG_SLUB=y 145CONFIG_SLUB=y
@@ -143,6 +154,10 @@ CONFIG_HAVE_KPROBES=y
143CONFIG_HAVE_KRETPROBES=y 154CONFIG_HAVE_KRETPROBES=y
144CONFIG_HAVE_ARCH_TRACEHOOK=y 155CONFIG_HAVE_ARCH_TRACEHOOK=y
145CONFIG_USE_GENERIC_SMP_HELPERS=y 156CONFIG_USE_GENERIC_SMP_HELPERS=y
157
158#
159# GCOV-based kernel profiling
160#
146# CONFIG_SLOW_WORK is not set 161# CONFIG_SLOW_WORK is not set
147# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set 162# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
148CONFIG_SLABINFO=y 163CONFIG_SLABINFO=y
@@ -156,7 +171,7 @@ CONFIG_MODVERSIONS=y
156# CONFIG_MODULE_SRCVERSION_ALL is not set 171# CONFIG_MODULE_SRCVERSION_ALL is not set
157CONFIG_STOP_MACHINE=y 172CONFIG_STOP_MACHINE=y
158CONFIG_BLOCK=y 173CONFIG_BLOCK=y
159CONFIG_LBD=y 174CONFIG_LBDAF=y
160# CONFIG_BLK_DEV_BSG is not set 175# CONFIG_BLK_DEV_BSG is not set
161# CONFIG_BLK_DEV_INTEGRITY is not set 176# CONFIG_BLK_DEV_INTEGRITY is not set
162 177
@@ -234,7 +249,9 @@ CONFIG_BINFMT_ELF=y
234# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set 249# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
235# CONFIG_HAVE_AOUT is not set 250# CONFIG_HAVE_AOUT is not set
236CONFIG_BINFMT_MISC=m 251CONFIG_BINFMT_MISC=m
237# CONFIG_IOMMU_HELPER is not set 252CONFIG_IOMMU_HELPER=y
253CONFIG_SWIOTLB=y
254CONFIG_PPC_NEED_DMA_SYNC_OPS=y
238CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y 255CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
239CONFIG_ARCH_HAS_WALK_MEMORY=y 256CONFIG_ARCH_HAS_WALK_MEMORY=y
240CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y 257CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y
@@ -256,9 +273,9 @@ CONFIG_MIGRATION=y
256CONFIG_ZONE_DMA_FLAG=1 273CONFIG_ZONE_DMA_FLAG=1
257CONFIG_BOUNCE=y 274CONFIG_BOUNCE=y
258CONFIG_VIRT_TO_BUS=y 275CONFIG_VIRT_TO_BUS=y
259CONFIG_UNEVICTABLE_LRU=y
260CONFIG_HAVE_MLOCK=y 276CONFIG_HAVE_MLOCK=y
261CONFIG_HAVE_MLOCKED_PAGE_BIT=y 277CONFIG_HAVE_MLOCKED_PAGE_BIT=y
278CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
262CONFIG_PPC_4K_PAGES=y 279CONFIG_PPC_4K_PAGES=y
263# CONFIG_PPC_16K_PAGES is not set 280# CONFIG_PPC_16K_PAGES is not set
264# CONFIG_PPC_64K_PAGES is not set 281# CONFIG_PPC_64K_PAGES is not set
@@ -401,6 +418,7 @@ CONFIG_SCTP_HMAC_MD5=y
401# CONFIG_ECONET is not set 418# CONFIG_ECONET is not set
402# CONFIG_WAN_ROUTER is not set 419# CONFIG_WAN_ROUTER is not set
403# CONFIG_PHONET is not set 420# CONFIG_PHONET is not set
421# CONFIG_IEEE802154 is not set
404# CONFIG_NET_SCHED is not set 422# CONFIG_NET_SCHED is not set
405# CONFIG_DCB is not set 423# CONFIG_DCB is not set
406 424
@@ -419,7 +437,11 @@ CONFIG_WIRELESS=y
419CONFIG_WIRELESS_OLD_REGULATORY=y 437CONFIG_WIRELESS_OLD_REGULATORY=y
420# CONFIG_WIRELESS_EXT is not set 438# CONFIG_WIRELESS_EXT is not set
421# CONFIG_LIB80211 is not set 439# CONFIG_LIB80211 is not set
422# CONFIG_MAC80211 is not set 440
441#
442# CFG80211 needs to be enabled for MAC80211
443#
444CONFIG_MAC80211_DEFAULT_PS_VALUE=0
423# CONFIG_WIMAX is not set 445# CONFIG_WIMAX is not set
424# CONFIG_RFKILL is not set 446# CONFIG_RFKILL is not set
425# CONFIG_NET_9P is not set 447# CONFIG_NET_9P is not set
@@ -444,6 +466,7 @@ CONFIG_EXTRA_FIRMWARE=""
444# CONFIG_MTD is not set 466# CONFIG_MTD is not set
445CONFIG_OF_DEVICE=y 467CONFIG_OF_DEVICE=y
446CONFIG_OF_I2C=y 468CONFIG_OF_I2C=y
469CONFIG_OF_MDIO=y
447# CONFIG_PARPORT is not set 470# CONFIG_PARPORT is not set
448CONFIG_BLK_DEV=y 471CONFIG_BLK_DEV=y
449# CONFIG_BLK_DEV_FD is not set 472# CONFIG_BLK_DEV_FD is not set
@@ -479,7 +502,9 @@ CONFIG_MISC_DEVICES=y
479# 502#
480# CONFIG_EEPROM_AT24 is not set 503# CONFIG_EEPROM_AT24 is not set
481CONFIG_EEPROM_LEGACY=y 504CONFIG_EEPROM_LEGACY=y
505# CONFIG_EEPROM_MAX6875 is not set
482# CONFIG_EEPROM_93CX6 is not set 506# CONFIG_EEPROM_93CX6 is not set
507# CONFIG_CB710_CORE is not set
483CONFIG_HAVE_IDE=y 508CONFIG_HAVE_IDE=y
484# CONFIG_IDE is not set 509# CONFIG_IDE is not set
485 510
@@ -503,10 +528,6 @@ CONFIG_BLK_DEV_SR=y
503# CONFIG_BLK_DEV_SR_VENDOR is not set 528# CONFIG_BLK_DEV_SR_VENDOR is not set
504CONFIG_CHR_DEV_SG=y 529CONFIG_CHR_DEV_SG=y
505# CONFIG_CHR_DEV_SCH is not set 530# CONFIG_CHR_DEV_SCH is not set
506
507#
508# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
509#
510CONFIG_SCSI_MULTI_LUN=y 531CONFIG_SCSI_MULTI_LUN=y
511# CONFIG_SCSI_CONSTANTS is not set 532# CONFIG_SCSI_CONSTANTS is not set
512CONFIG_SCSI_LOGGING=y 533CONFIG_SCSI_LOGGING=y
@@ -524,6 +545,7 @@ CONFIG_SCSI_WAIT_SCAN=m
524CONFIG_SCSI_LOWLEVEL=y 545CONFIG_SCSI_LOWLEVEL=y
525# CONFIG_ISCSI_TCP is not set 546# CONFIG_ISCSI_TCP is not set
526# CONFIG_SCSI_CXGB3_ISCSI is not set 547# CONFIG_SCSI_CXGB3_ISCSI is not set
548# CONFIG_SCSI_BNX2_ISCSI is not set
527# CONFIG_BLK_DEV_3W_XXXX_RAID is not set 549# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
528# CONFIG_SCSI_3W_9XXX is not set 550# CONFIG_SCSI_3W_9XXX is not set
529# CONFIG_SCSI_ACARD is not set 551# CONFIG_SCSI_ACARD is not set
@@ -532,6 +554,7 @@ CONFIG_SCSI_LOWLEVEL=y
532# CONFIG_SCSI_AIC7XXX_OLD is not set 554# CONFIG_SCSI_AIC7XXX_OLD is not set
533# CONFIG_SCSI_AIC79XX is not set 555# CONFIG_SCSI_AIC79XX is not set
534# CONFIG_SCSI_AIC94XX is not set 556# CONFIG_SCSI_AIC94XX is not set
557# CONFIG_SCSI_MVSAS is not set
535# CONFIG_SCSI_DPT_I2O is not set 558# CONFIG_SCSI_DPT_I2O is not set
536# CONFIG_SCSI_ADVANSYS is not set 559# CONFIG_SCSI_ADVANSYS is not set
537# CONFIG_SCSI_ARCMSR is not set 560# CONFIG_SCSI_ARCMSR is not set
@@ -551,7 +574,6 @@ CONFIG_SCSI_LOWLEVEL=y
551# CONFIG_SCSI_IPS is not set 574# CONFIG_SCSI_IPS is not set
552# CONFIG_SCSI_INITIO is not set 575# CONFIG_SCSI_INITIO is not set
553# CONFIG_SCSI_INIA100 is not set 576# CONFIG_SCSI_INIA100 is not set
554# CONFIG_SCSI_MVSAS is not set
555# CONFIG_SCSI_STEX is not set 577# CONFIG_SCSI_STEX is not set
556# CONFIG_SCSI_SYM53C8XX_2 is not set 578# CONFIG_SCSI_SYM53C8XX_2 is not set
557# CONFIG_SCSI_IPR is not set 579# CONFIG_SCSI_IPR is not set
@@ -635,14 +657,17 @@ CONFIG_PATA_ALI=y
635# 657#
636 658
637# 659#
638# Enable only one of the two stacks, unless you know what you are doing 660# You can enable one or both FireWire driver stacks.
661#
662
663#
664# See the help texts for more information.
639# 665#
640# CONFIG_FIREWIRE is not set 666# CONFIG_FIREWIRE is not set
641# CONFIG_IEEE1394 is not set 667# CONFIG_IEEE1394 is not set
642# CONFIG_I2O is not set 668# CONFIG_I2O is not set
643# CONFIG_MACINTOSH_DRIVERS is not set 669# CONFIG_MACINTOSH_DRIVERS is not set
644CONFIG_NETDEVICES=y 670CONFIG_NETDEVICES=y
645CONFIG_COMPAT_NET_DEV_OPS=y
646CONFIG_DUMMY=y 671CONFIG_DUMMY=y
647# CONFIG_BONDING is not set 672# CONFIG_BONDING is not set
648# CONFIG_MACVLAN is not set 673# CONFIG_MACVLAN is not set
@@ -689,6 +714,7 @@ CONFIG_MII=y
689# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set 714# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
690# CONFIG_NET_PCI is not set 715# CONFIG_NET_PCI is not set
691# CONFIG_B44 is not set 716# CONFIG_B44 is not set
717# CONFIG_KS8842 is not set
692# CONFIG_ATL2 is not set 718# CONFIG_ATL2 is not set
693CONFIG_NETDEV_1000=y 719CONFIG_NETDEV_1000=y
694# CONFIG_ACENIC is not set 720# CONFIG_ACENIC is not set
@@ -708,8 +734,10 @@ CONFIG_NETDEV_1000=y
708# CONFIG_VIA_VELOCITY is not set 734# CONFIG_VIA_VELOCITY is not set
709# CONFIG_TIGON3 is not set 735# CONFIG_TIGON3 is not set
710# CONFIG_BNX2 is not set 736# CONFIG_BNX2 is not set
737# CONFIG_CNIC is not set
711CONFIG_FSL_PQ_MDIO=y 738CONFIG_FSL_PQ_MDIO=y
712CONFIG_GIANFAR=y 739CONFIG_GIANFAR=y
740# CONFIG_MV643XX_ETH is not set
713# CONFIG_QLA3XXX is not set 741# CONFIG_QLA3XXX is not set
714# CONFIG_ATL1 is not set 742# CONFIG_ATL1 is not set
715# CONFIG_ATL1E is not set 743# CONFIG_ATL1E is not set
@@ -909,13 +937,17 @@ CONFIG_I2C_MPC=y
909# CONFIG_SENSORS_PCF8574 is not set 937# CONFIG_SENSORS_PCF8574 is not set
910# CONFIG_PCF8575 is not set 938# CONFIG_PCF8575 is not set
911# CONFIG_SENSORS_PCA9539 is not set 939# CONFIG_SENSORS_PCA9539 is not set
912# CONFIG_SENSORS_MAX6875 is not set
913# CONFIG_SENSORS_TSL2550 is not set 940# CONFIG_SENSORS_TSL2550 is not set
914# CONFIG_I2C_DEBUG_CORE is not set 941# CONFIG_I2C_DEBUG_CORE is not set
915# CONFIG_I2C_DEBUG_ALGO is not set 942# CONFIG_I2C_DEBUG_ALGO is not set
916# CONFIG_I2C_DEBUG_BUS is not set 943# CONFIG_I2C_DEBUG_BUS is not set
917# CONFIG_I2C_DEBUG_CHIP is not set 944# CONFIG_I2C_DEBUG_CHIP is not set
918# CONFIG_SPI is not set 945# CONFIG_SPI is not set
946
947#
948# PPS support
949#
950# CONFIG_PPS is not set
919CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y 951CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
920# CONFIG_GPIOLIB is not set 952# CONFIG_GPIOLIB is not set
921# CONFIG_W1 is not set 953# CONFIG_W1 is not set
@@ -943,76 +975,9 @@ CONFIG_SSB_POSSIBLE=y
943# CONFIG_MFD_WM8400 is not set 975# CONFIG_MFD_WM8400 is not set
944# CONFIG_MFD_WM8350_I2C is not set 976# CONFIG_MFD_WM8350_I2C is not set
945# CONFIG_MFD_PCF50633 is not set 977# CONFIG_MFD_PCF50633 is not set
978# CONFIG_AB3100_CORE is not set
946# CONFIG_REGULATOR is not set 979# CONFIG_REGULATOR is not set
947 980# CONFIG_MEDIA_SUPPORT is not set
948#
949# Multimedia devices
950#
951
952#
953# Multimedia core support
954#
955# CONFIG_VIDEO_DEV is not set
956CONFIG_DVB_CORE=m
957CONFIG_VIDEO_MEDIA=m
958
959#
960# Multimedia drivers
961#
962# CONFIG_MEDIA_ATTACH is not set
963CONFIG_MEDIA_TUNER=m
964# CONFIG_MEDIA_TUNER_CUSTOMISE is not set
965CONFIG_MEDIA_TUNER_SIMPLE=m
966CONFIG_MEDIA_TUNER_TDA8290=m
967CONFIG_MEDIA_TUNER_TDA9887=m
968CONFIG_MEDIA_TUNER_TEA5761=m
969CONFIG_MEDIA_TUNER_TEA5767=m
970CONFIG_MEDIA_TUNER_MT20XX=m
971CONFIG_MEDIA_TUNER_XC2028=m
972CONFIG_MEDIA_TUNER_XC5000=m
973CONFIG_MEDIA_TUNER_MC44S803=m
974# CONFIG_DVB_DYNAMIC_MINORS is not set
975CONFIG_DVB_CAPTURE_DRIVERS=y
976
977#
978# Supported SAA7146 based PCI Adapters
979#
980# CONFIG_TTPCI_EEPROM is not set
981# CONFIG_DVB_BUDGET_CORE is not set
982
983#
984# Supported USB Adapters
985#
986# CONFIG_DVB_USB is not set
987# CONFIG_DVB_TTUSB_BUDGET is not set
988# CONFIG_DVB_TTUSB_DEC is not set
989# CONFIG_DVB_SIANO_SMS1XXX is not set
990
991#
992# Supported FlexCopII (B2C2) Adapters
993#
994# CONFIG_DVB_B2C2_FLEXCOP is not set
995
996#
997# Supported BT878 Adapters
998#
999
1000#
1001# Supported Pluto2 Adapters
1002#
1003# CONFIG_DVB_PLUTO2 is not set
1004
1005#
1006# Supported SDMC DM1105 Adapters
1007#
1008# CONFIG_DVB_DM1105 is not set
1009
1010#
1011# Supported DVB Frontends
1012#
1013# CONFIG_DVB_FE_CUSTOMISE is not set
1014CONFIG_DAB=y
1015# CONFIG_USB_DABUSB is not set
1016 981
1017# 982#
1018# Graphics support 983# Graphics support
@@ -1052,6 +1017,11 @@ CONFIG_SND_VERBOSE_PROCFS=y
1052# CONFIG_SND_VERBOSE_PRINTK is not set 1017# CONFIG_SND_VERBOSE_PRINTK is not set
1053# CONFIG_SND_DEBUG is not set 1018# CONFIG_SND_DEBUG is not set
1054CONFIG_SND_VMASTER=y 1019CONFIG_SND_VMASTER=y
1020# CONFIG_SND_RAWMIDI_SEQ is not set
1021# CONFIG_SND_OPL3_LIB_SEQ is not set
1022# CONFIG_SND_OPL4_LIB_SEQ is not set
1023# CONFIG_SND_SBAWE_SEQ is not set
1024# CONFIG_SND_EMU10K1_SEQ is not set
1055CONFIG_SND_AC97_CODEC=y 1025CONFIG_SND_AC97_CODEC=y
1056CONFIG_SND_DRIVERS=y 1026CONFIG_SND_DRIVERS=y
1057# CONFIG_SND_DUMMY is not set 1027# CONFIG_SND_DUMMY is not set
@@ -1078,6 +1048,7 @@ CONFIG_SND_PCI=y
1078# CONFIG_SND_CS4281 is not set 1048# CONFIG_SND_CS4281 is not set
1079# CONFIG_SND_CS46XX is not set 1049# CONFIG_SND_CS46XX is not set
1080# CONFIG_SND_CS5530 is not set 1050# CONFIG_SND_CS5530 is not set
1051# CONFIG_SND_CTXFI is not set
1081# CONFIG_SND_DARLA20 is not set 1052# CONFIG_SND_DARLA20 is not set
1082# CONFIG_SND_GINA20 is not set 1053# CONFIG_SND_GINA20 is not set
1083# CONFIG_SND_LAYLA20 is not set 1054# CONFIG_SND_LAYLA20 is not set
@@ -1108,6 +1079,7 @@ CONFIG_SND_PCI=y
1108CONFIG_SND_INTEL8X0=y 1079CONFIG_SND_INTEL8X0=y
1109# CONFIG_SND_INTEL8X0M is not set 1080# CONFIG_SND_INTEL8X0M is not set
1110# CONFIG_SND_KORG1212 is not set 1081# CONFIG_SND_KORG1212 is not set
1082# CONFIG_SND_LX6464ES is not set
1111# CONFIG_SND_MAESTRO3 is not set 1083# CONFIG_SND_MAESTRO3 is not set
1112# CONFIG_SND_MIXART is not set 1084# CONFIG_SND_MIXART is not set
1113# CONFIG_SND_NM256 is not set 1085# CONFIG_SND_NM256 is not set
@@ -1152,7 +1124,7 @@ CONFIG_HID_BELKIN=y
1152CONFIG_HID_CHERRY=y 1124CONFIG_HID_CHERRY=y
1153CONFIG_HID_CHICONY=y 1125CONFIG_HID_CHICONY=y
1154CONFIG_HID_CYPRESS=y 1126CONFIG_HID_CYPRESS=y
1155# CONFIG_DRAGONRISE_FF is not set 1127# CONFIG_HID_DRAGONRISE is not set
1156CONFIG_HID_EZKEY=y 1128CONFIG_HID_EZKEY=y
1157# CONFIG_HID_KYE is not set 1129# CONFIG_HID_KYE is not set
1158CONFIG_HID_GYRATION=y 1130CONFIG_HID_GYRATION=y
@@ -1169,10 +1141,11 @@ CONFIG_HID_PETALYNX=y
1169CONFIG_HID_SAMSUNG=y 1141CONFIG_HID_SAMSUNG=y
1170CONFIG_HID_SONY=y 1142CONFIG_HID_SONY=y
1171CONFIG_HID_SUNPLUS=y 1143CONFIG_HID_SUNPLUS=y
1172# CONFIG_GREENASIA_FF is not set 1144# CONFIG_HID_GREENASIA is not set
1145# CONFIG_HID_SMARTJOYPLUS is not set
1173# CONFIG_HID_TOPSEED is not set 1146# CONFIG_HID_TOPSEED is not set
1174CONFIG_THRUSTMASTER_FF=m 1147# CONFIG_HID_THRUSTMASTER is not set
1175CONFIG_ZEROPLUS_FF=m 1148# CONFIG_HID_ZEROPLUS is not set
1176CONFIG_USB_SUPPORT=y 1149CONFIG_USB_SUPPORT=y
1177CONFIG_USB_ARCH_HAS_HCD=y 1150CONFIG_USB_ARCH_HAS_HCD=y
1178CONFIG_USB_ARCH_HAS_OHCI=y 1151CONFIG_USB_ARCH_HAS_OHCI=y
@@ -1198,6 +1171,7 @@ CONFIG_USB_MON=y
1198# USB Host Controller Drivers 1171# USB Host Controller Drivers
1199# 1172#
1200# CONFIG_USB_C67X00_HCD is not set 1173# CONFIG_USB_C67X00_HCD is not set
1174# CONFIG_USB_XHCI_HCD is not set
1201CONFIG_USB_EHCI_HCD=y 1175CONFIG_USB_EHCI_HCD=y
1202# CONFIG_USB_EHCI_ROOT_HUB_TT is not set 1176# CONFIG_USB_EHCI_ROOT_HUB_TT is not set
1203# CONFIG_USB_EHCI_TT_NEWSCHED is not set 1177# CONFIG_USB_EHCI_TT_NEWSCHED is not set
@@ -1207,9 +1181,9 @@ CONFIG_USB_EHCI_HCD_PPC_OF=y
1207# CONFIG_USB_ISP116X_HCD is not set 1181# CONFIG_USB_ISP116X_HCD is not set
1208# CONFIG_USB_ISP1760_HCD is not set 1182# CONFIG_USB_ISP1760_HCD is not set
1209CONFIG_USB_OHCI_HCD=y 1183CONFIG_USB_OHCI_HCD=y
1210CONFIG_USB_OHCI_HCD_PPC_OF=y
1211CONFIG_USB_OHCI_HCD_PPC_OF_BE=y 1184CONFIG_USB_OHCI_HCD_PPC_OF_BE=y
1212CONFIG_USB_OHCI_HCD_PPC_OF_LE=y 1185CONFIG_USB_OHCI_HCD_PPC_OF_LE=y
1186CONFIG_USB_OHCI_HCD_PPC_OF=y
1213CONFIG_USB_OHCI_HCD_PCI=y 1187CONFIG_USB_OHCI_HCD_PCI=y
1214CONFIG_USB_OHCI_BIG_ENDIAN_DESC=y 1188CONFIG_USB_OHCI_BIG_ENDIAN_DESC=y
1215CONFIG_USB_OHCI_BIG_ENDIAN_MMIO=y 1189CONFIG_USB_OHCI_BIG_ENDIAN_MMIO=y
@@ -1329,6 +1303,7 @@ CONFIG_RTC_INTF_DEV=y
1329# CONFIG_RTC_DRV_S35390A is not set 1303# CONFIG_RTC_DRV_S35390A is not set
1330# CONFIG_RTC_DRV_FM3130 is not set 1304# CONFIG_RTC_DRV_FM3130 is not set
1331# CONFIG_RTC_DRV_RX8581 is not set 1305# CONFIG_RTC_DRV_RX8581 is not set
1306# CONFIG_RTC_DRV_RX8025 is not set
1332 1307
1333# 1308#
1334# SPI RTC drivers 1309# SPI RTC drivers
@@ -1356,6 +1331,10 @@ CONFIG_RTC_DRV_CMOS=y
1356# CONFIG_DMADEVICES is not set 1331# CONFIG_DMADEVICES is not set
1357# CONFIG_AUXDISPLAY is not set 1332# CONFIG_AUXDISPLAY is not set
1358# CONFIG_UIO is not set 1333# CONFIG_UIO is not set
1334
1335#
1336# TI VLYNQ
1337#
1359# CONFIG_STAGING is not set 1338# CONFIG_STAGING is not set
1360 1339
1361# 1340#
@@ -1375,11 +1354,12 @@ CONFIG_FS_MBCACHE=y
1375# CONFIG_REISERFS_FS is not set 1354# CONFIG_REISERFS_FS is not set
1376# CONFIG_JFS_FS is not set 1355# CONFIG_JFS_FS is not set
1377# CONFIG_FS_POSIX_ACL is not set 1356# CONFIG_FS_POSIX_ACL is not set
1378CONFIG_FILE_LOCKING=y
1379# CONFIG_XFS_FS is not set 1357# CONFIG_XFS_FS is not set
1380# CONFIG_GFS2_FS is not set 1358# CONFIG_GFS2_FS is not set
1381# CONFIG_OCFS2_FS is not set 1359# CONFIG_OCFS2_FS is not set
1382# CONFIG_BTRFS_FS is not set 1360# CONFIG_BTRFS_FS is not set
1361CONFIG_FILE_LOCKING=y
1362CONFIG_FSNOTIFY=y
1383CONFIG_DNOTIFY=y 1363CONFIG_DNOTIFY=y
1384CONFIG_INOTIFY=y 1364CONFIG_INOTIFY=y
1385CONFIG_INOTIFY_USER=y 1365CONFIG_INOTIFY_USER=y
@@ -1454,6 +1434,7 @@ CONFIG_NFS_FS=y
1454CONFIG_NFS_V3=y 1434CONFIG_NFS_V3=y
1455# CONFIG_NFS_V3_ACL is not set 1435# CONFIG_NFS_V3_ACL is not set
1456CONFIG_NFS_V4=y 1436CONFIG_NFS_V4=y
1437# CONFIG_NFS_V4_1 is not set
1457CONFIG_ROOT_NFS=y 1438CONFIG_ROOT_NFS=y
1458CONFIG_NFSD=y 1439CONFIG_NFSD=y
1459# CONFIG_NFSD_V3 is not set 1440# CONFIG_NFSD_V3 is not set
@@ -1555,6 +1536,7 @@ CONFIG_HAS_IOPORT=y
1555CONFIG_HAS_DMA=y 1536CONFIG_HAS_DMA=y
1556CONFIG_HAVE_LMB=y 1537CONFIG_HAVE_LMB=y
1557CONFIG_NLATTR=y 1538CONFIG_NLATTR=y
1539CONFIG_GENERIC_ATOMIC64=y
1558 1540
1559# 1541#
1560# Kernel hacking 1542# Kernel hacking
@@ -1585,6 +1567,9 @@ CONFIG_SCHED_DEBUG=y
1585# CONFIG_RT_MUTEX_TESTER is not set 1567# CONFIG_RT_MUTEX_TESTER is not set
1586# CONFIG_DEBUG_SPINLOCK is not set 1568# CONFIG_DEBUG_SPINLOCK is not set
1587# CONFIG_DEBUG_MUTEXES is not set 1569# CONFIG_DEBUG_MUTEXES is not set
1570# CONFIG_DEBUG_LOCK_ALLOC is not set
1571# CONFIG_PROVE_LOCKING is not set
1572# CONFIG_LOCK_STAT is not set
1588# CONFIG_DEBUG_SPINLOCK_SLEEP is not set 1573# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
1589# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set 1574# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
1590# CONFIG_DEBUG_KOBJECT is not set 1575# CONFIG_DEBUG_KOBJECT is not set
@@ -1597,7 +1582,6 @@ CONFIG_DEBUG_INFO=y
1597# CONFIG_DEBUG_LIST is not set 1582# CONFIG_DEBUG_LIST is not set
1598# CONFIG_DEBUG_SG is not set 1583# CONFIG_DEBUG_SG is not set
1599# CONFIG_DEBUG_NOTIFIERS is not set 1584# CONFIG_DEBUG_NOTIFIERS is not set
1600# CONFIG_BOOT_PRINTK_DELAY is not set
1601# CONFIG_RCU_TORTURE_TEST is not set 1585# CONFIG_RCU_TORTURE_TEST is not set
1602# CONFIG_RCU_CPU_STALL_DETECTOR is not set 1586# CONFIG_RCU_CPU_STALL_DETECTOR is not set
1603# CONFIG_BACKTRACE_SELF_TEST is not set 1587# CONFIG_BACKTRACE_SELF_TEST is not set
@@ -1611,16 +1595,15 @@ CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
1611CONFIG_HAVE_DYNAMIC_FTRACE=y 1595CONFIG_HAVE_DYNAMIC_FTRACE=y
1612CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y 1596CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
1613CONFIG_TRACING_SUPPORT=y 1597CONFIG_TRACING_SUPPORT=y
1614 1598CONFIG_FTRACE=y
1615#
1616# Tracers
1617#
1618# CONFIG_FUNCTION_TRACER is not set 1599# CONFIG_FUNCTION_TRACER is not set
1600# CONFIG_IRQSOFF_TRACER is not set
1619# CONFIG_SCHED_TRACER is not set 1601# CONFIG_SCHED_TRACER is not set
1620# CONFIG_CONTEXT_SWITCH_TRACER is not set 1602# CONFIG_ENABLE_DEFAULT_TRACERS is not set
1621# CONFIG_EVENT_TRACER is not set
1622# CONFIG_BOOT_TRACER is not set 1603# CONFIG_BOOT_TRACER is not set
1623# CONFIG_TRACE_BRANCH_PROFILING is not set 1604CONFIG_BRANCH_PROFILE_NONE=y
1605# CONFIG_PROFILE_ANNOTATED_BRANCHES is not set
1606# CONFIG_PROFILE_ALL_BRANCHES is not set
1624# CONFIG_STACK_TRACER is not set 1607# CONFIG_STACK_TRACER is not set
1625# CONFIG_KMEMTRACE is not set 1608# CONFIG_KMEMTRACE is not set
1626# CONFIG_WORKQUEUE_TRACER is not set 1609# CONFIG_WORKQUEUE_TRACER is not set
@@ -1628,6 +1611,9 @@ CONFIG_TRACING_SUPPORT=y
1628# CONFIG_SAMPLES is not set 1611# CONFIG_SAMPLES is not set
1629CONFIG_HAVE_ARCH_KGDB=y 1612CONFIG_HAVE_ARCH_KGDB=y
1630# CONFIG_KGDB is not set 1613# CONFIG_KGDB is not set
1614# CONFIG_KMEMCHECK is not set
1615# CONFIG_PPC_DISABLE_WERROR is not set
1616CONFIG_PPC_WERROR=y
1631CONFIG_PRINT_STACK_DEPTH=64 1617CONFIG_PRINT_STACK_DEPTH=64
1632# CONFIG_DEBUG_STACKOVERFLOW is not set 1618# CONFIG_DEBUG_STACKOVERFLOW is not set
1633# CONFIG_DEBUG_STACK_USAGE is not set 1619# CONFIG_DEBUG_STACK_USAGE is not set
diff --git a/arch/powerpc/configs/86xx/sbc8641d_defconfig b/arch/powerpc/configs/86xx/sbc8641d_defconfig
index c30a0c715873..f5ca2e0cd402 100644
--- a/arch/powerpc/configs/86xx/sbc8641d_defconfig
+++ b/arch/powerpc/configs/86xx/sbc8641d_defconfig
@@ -1,26 +1,28 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.30-rc3 3# Linux kernel version: 2.6.31-rc4
4# Wed May 13 17:22:27 2009 4# Wed Jul 29 23:32:26 2009
5# 5#
6# CONFIG_PPC64 is not set 6# CONFIG_PPC64 is not set
7 7
8# 8#
9# Processor support 9# Processor support
10# 10#
11CONFIG_6xx=y 11CONFIG_PPC_BOOK3S_32=y
12# CONFIG_PPC_85xx is not set 12# CONFIG_PPC_85xx is not set
13# CONFIG_PPC_8xx is not set 13# CONFIG_PPC_8xx is not set
14# CONFIG_40x is not set 14# CONFIG_40x is not set
15# CONFIG_44x is not set 15# CONFIG_44x is not set
16# CONFIG_E200 is not set 16# CONFIG_E200 is not set
17CONFIG_PPC_BOOK3S=y 17CONFIG_PPC_BOOK3S=y
18CONFIG_6xx=y
18CONFIG_PPC_FPU=y 19CONFIG_PPC_FPU=y
19# CONFIG_PHYS_64BIT is not set 20# CONFIG_PHYS_64BIT is not set
20CONFIG_ALTIVEC=y 21CONFIG_ALTIVEC=y
21CONFIG_PPC_STD_MMU=y 22CONFIG_PPC_STD_MMU=y
22CONFIG_PPC_STD_MMU_32=y 23CONFIG_PPC_STD_MMU_32=y
23# CONFIG_PPC_MM_SLICES is not set 24# CONFIG_PPC_MM_SLICES is not set
25CONFIG_PPC_HAVE_PMU_SUPPORT=y
24CONFIG_SMP=y 26CONFIG_SMP=y
25CONFIG_NR_CPUS=2 27CONFIG_NR_CPUS=2
26CONFIG_PPC32=y 28CONFIG_PPC32=y
@@ -32,16 +34,17 @@ CONFIG_GENERIC_TIME=y
32CONFIG_GENERIC_TIME_VSYSCALL=y 34CONFIG_GENERIC_TIME_VSYSCALL=y
33CONFIG_GENERIC_CLOCKEVENTS=y 35CONFIG_GENERIC_CLOCKEVENTS=y
34CONFIG_GENERIC_HARDIRQS=y 36CONFIG_GENERIC_HARDIRQS=y
37CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
35# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set 38# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set
36CONFIG_IRQ_PER_CPU=y 39CONFIG_IRQ_PER_CPU=y
37CONFIG_STACKTRACE_SUPPORT=y 40CONFIG_STACKTRACE_SUPPORT=y
38CONFIG_HAVE_LATENCYTOP_SUPPORT=y 41CONFIG_HAVE_LATENCYTOP_SUPPORT=y
42CONFIG_TRACE_IRQFLAGS_SUPPORT=y
39CONFIG_LOCKDEP_SUPPORT=y 43CONFIG_LOCKDEP_SUPPORT=y
40CONFIG_RWSEM_XCHGADD_ALGORITHM=y 44CONFIG_RWSEM_XCHGADD_ALGORITHM=y
41CONFIG_GENERIC_LOCKBREAK=y 45CONFIG_GENERIC_LOCKBREAK=y
42CONFIG_ARCH_HAS_ILOG2_U32=y 46CONFIG_ARCH_HAS_ILOG2_U32=y
43CONFIG_GENERIC_HWEIGHT=y 47CONFIG_GENERIC_HWEIGHT=y
44CONFIG_GENERIC_CALIBRATE_DELAY=y
45CONFIG_GENERIC_FIND_NEXT_BIT=y 48CONFIG_GENERIC_FIND_NEXT_BIT=y
46# CONFIG_ARCH_NO_VIRT_TO_BUS is not set 49# CONFIG_ARCH_NO_VIRT_TO_BUS is not set
47CONFIG_PPC=y 50CONFIG_PPC=y
@@ -55,11 +58,13 @@ CONFIG_PPC_UDBG_16550=y
55CONFIG_GENERIC_TBSYNC=y 58CONFIG_GENERIC_TBSYNC=y
56CONFIG_AUDIT_ARCH=y 59CONFIG_AUDIT_ARCH=y
57CONFIG_GENERIC_BUG=y 60CONFIG_GENERIC_BUG=y
61CONFIG_DTC=y
58CONFIG_DEFAULT_UIMAGE=y 62CONFIG_DEFAULT_UIMAGE=y
59# CONFIG_PPC_DCR_NATIVE is not set 63# CONFIG_PPC_DCR_NATIVE is not set
60# CONFIG_PPC_DCR_MMIO is not set 64# CONFIG_PPC_DCR_MMIO is not set
61CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y 65CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y
62CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" 66CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
67CONFIG_CONSTRUCTORS=y
63 68
64# 69#
65# General setup 70# General setup
@@ -113,7 +118,6 @@ CONFIG_SYSCTL_SYSCALL=y
113CONFIG_KALLSYMS=y 118CONFIG_KALLSYMS=y
114# CONFIG_KALLSYMS_ALL is not set 119# CONFIG_KALLSYMS_ALL is not set
115# CONFIG_KALLSYMS_EXTRA_PASS is not set 120# CONFIG_KALLSYMS_EXTRA_PASS is not set
116# CONFIG_STRIP_ASM_SYMS is not set
117CONFIG_HOTPLUG=y 121CONFIG_HOTPLUG=y
118CONFIG_PRINTK=y 122CONFIG_PRINTK=y
119CONFIG_BUG=y 123CONFIG_BUG=y
@@ -126,8 +130,15 @@ CONFIG_TIMERFD=y
126CONFIG_EVENTFD=y 130CONFIG_EVENTFD=y
127CONFIG_SHMEM=y 131CONFIG_SHMEM=y
128CONFIG_AIO=y 132CONFIG_AIO=y
133CONFIG_HAVE_PERF_COUNTERS=y
134
135#
136# Performance Counters
137#
138# CONFIG_PERF_COUNTERS is not set
129CONFIG_VM_EVENT_COUNTERS=y 139CONFIG_VM_EVENT_COUNTERS=y
130CONFIG_PCI_QUIRKS=y 140CONFIG_PCI_QUIRKS=y
141# CONFIG_STRIP_ASM_SYMS is not set
131CONFIG_COMPAT_BRK=y 142CONFIG_COMPAT_BRK=y
132CONFIG_SLAB=y 143CONFIG_SLAB=y
133# CONFIG_SLUB is not set 144# CONFIG_SLUB is not set
@@ -142,6 +153,11 @@ CONFIG_HAVE_KPROBES=y
142CONFIG_HAVE_KRETPROBES=y 153CONFIG_HAVE_KRETPROBES=y
143CONFIG_HAVE_ARCH_TRACEHOOK=y 154CONFIG_HAVE_ARCH_TRACEHOOK=y
144CONFIG_USE_GENERIC_SMP_HELPERS=y 155CONFIG_USE_GENERIC_SMP_HELPERS=y
156
157#
158# GCOV-based kernel profiling
159#
160# CONFIG_GCOV_KERNEL is not set
145# CONFIG_SLOW_WORK is not set 161# CONFIG_SLOW_WORK is not set
146# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set 162# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
147CONFIG_SLABINFO=y 163CONFIG_SLABINFO=y
@@ -155,7 +171,7 @@ CONFIG_MODULE_UNLOAD=y
155# CONFIG_MODULE_SRCVERSION_ALL is not set 171# CONFIG_MODULE_SRCVERSION_ALL is not set
156CONFIG_STOP_MACHINE=y 172CONFIG_STOP_MACHINE=y
157CONFIG_BLOCK=y 173CONFIG_BLOCK=y
158# CONFIG_LBD is not set 174CONFIG_LBDAF=y
159# CONFIG_BLK_DEV_BSG is not set 175# CONFIG_BLK_DEV_BSG is not set
160# CONFIG_BLK_DEV_INTEGRITY is not set 176# CONFIG_BLK_DEV_INTEGRITY is not set
161 177
@@ -234,6 +250,7 @@ CONFIG_BINFMT_ELF=y
234# CONFIG_HAVE_AOUT is not set 250# CONFIG_HAVE_AOUT is not set
235CONFIG_BINFMT_MISC=m 251CONFIG_BINFMT_MISC=m
236# CONFIG_IOMMU_HELPER is not set 252# CONFIG_IOMMU_HELPER is not set
253# CONFIG_SWIOTLB is not set
237CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y 254CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
238CONFIG_ARCH_HAS_WALK_MEMORY=y 255CONFIG_ARCH_HAS_WALK_MEMORY=y
239CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y 256CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y
@@ -255,9 +272,9 @@ CONFIG_MIGRATION=y
255CONFIG_ZONE_DMA_FLAG=1 272CONFIG_ZONE_DMA_FLAG=1
256CONFIG_BOUNCE=y 273CONFIG_BOUNCE=y
257CONFIG_VIRT_TO_BUS=y 274CONFIG_VIRT_TO_BUS=y
258CONFIG_UNEVICTABLE_LRU=y
259CONFIG_HAVE_MLOCK=y 275CONFIG_HAVE_MLOCK=y
260CONFIG_HAVE_MLOCKED_PAGE_BIT=y 276CONFIG_HAVE_MLOCKED_PAGE_BIT=y
277CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
261CONFIG_PPC_4K_PAGES=y 278CONFIG_PPC_4K_PAGES=y
262# CONFIG_PPC_16K_PAGES is not set 279# CONFIG_PPC_16K_PAGES is not set
263# CONFIG_PPC_64K_PAGES is not set 280# CONFIG_PPC_64K_PAGES is not set
@@ -284,6 +301,8 @@ CONFIG_PCI_DOMAINS=y
284CONFIG_PCI_SYSCALL=y 301CONFIG_PCI_SYSCALL=y
285CONFIG_PCIEPORTBUS=y 302CONFIG_PCIEPORTBUS=y
286CONFIG_PCIEAER=y 303CONFIG_PCIEAER=y
304# CONFIG_PCIE_ECRC is not set
305# CONFIG_PCIEAER_INJECT is not set
287# CONFIG_PCIEASPM is not set 306# CONFIG_PCIEASPM is not set
288CONFIG_ARCH_SUPPORTS_MSI=y 307CONFIG_ARCH_SUPPORTS_MSI=y
289# CONFIG_PCI_MSI is not set 308# CONFIG_PCI_MSI is not set
@@ -508,6 +527,7 @@ CONFIG_LLC=m
508# CONFIG_ECONET is not set 527# CONFIG_ECONET is not set
509CONFIG_WAN_ROUTER=m 528CONFIG_WAN_ROUTER=m
510# CONFIG_PHONET is not set 529# CONFIG_PHONET is not set
530# CONFIG_IEEE802154 is not set
511CONFIG_NET_SCHED=y 531CONFIG_NET_SCHED=y
512 532
513# 533#
@@ -564,7 +584,11 @@ CONFIG_WIRELESS=y
564CONFIG_WIRELESS_OLD_REGULATORY=y 584CONFIG_WIRELESS_OLD_REGULATORY=y
565# CONFIG_WIRELESS_EXT is not set 585# CONFIG_WIRELESS_EXT is not set
566# CONFIG_LIB80211 is not set 586# CONFIG_LIB80211 is not set
567# CONFIG_MAC80211 is not set 587
588#
589# CFG80211 needs to be enabled for MAC80211
590#
591CONFIG_MAC80211_DEFAULT_PS_VALUE=0
568# CONFIG_WIMAX is not set 592# CONFIG_WIMAX is not set
569# CONFIG_RFKILL is not set 593# CONFIG_RFKILL is not set
570# CONFIG_NET_9P is not set 594# CONFIG_NET_9P is not set
@@ -675,6 +699,7 @@ CONFIG_MTD_PHYSMAP_OF=y
675# CONFIG_MTD_UBI is not set 699# CONFIG_MTD_UBI is not set
676CONFIG_OF_DEVICE=y 700CONFIG_OF_DEVICE=y
677CONFIG_OF_I2C=y 701CONFIG_OF_I2C=y
702CONFIG_OF_MDIO=y
678# CONFIG_PARPORT is not set 703# CONFIG_PARPORT is not set
679CONFIG_BLK_DEV=y 704CONFIG_BLK_DEV=y
680# CONFIG_BLK_DEV_FD is not set 705# CONFIG_BLK_DEV_FD is not set
@@ -709,7 +734,9 @@ CONFIG_MISC_DEVICES=y
709# 734#
710# CONFIG_EEPROM_AT24 is not set 735# CONFIG_EEPROM_AT24 is not set
711# CONFIG_EEPROM_LEGACY is not set 736# CONFIG_EEPROM_LEGACY is not set
737# CONFIG_EEPROM_MAX6875 is not set
712# CONFIG_EEPROM_93CX6 is not set 738# CONFIG_EEPROM_93CX6 is not set
739# CONFIG_CB710_CORE is not set
713CONFIG_HAVE_IDE=y 740CONFIG_HAVE_IDE=y
714# CONFIG_IDE is not set 741# CONFIG_IDE is not set
715 742
@@ -736,6 +763,7 @@ CONFIG_BLK_DEV_DM=y
736CONFIG_DM_CRYPT=y 763CONFIG_DM_CRYPT=y
737CONFIG_DM_SNAPSHOT=y 764CONFIG_DM_SNAPSHOT=y
738CONFIG_DM_MIRROR=y 765CONFIG_DM_MIRROR=y
766# CONFIG_DM_LOG_USERSPACE is not set
739CONFIG_DM_ZERO=y 767CONFIG_DM_ZERO=y
740# CONFIG_DM_MULTIPATH is not set 768# CONFIG_DM_MULTIPATH is not set
741# CONFIG_DM_DELAY is not set 769# CONFIG_DM_DELAY is not set
@@ -747,14 +775,17 @@ CONFIG_DM_ZERO=y
747# 775#
748 776
749# 777#
750# Enable only one of the two stacks, unless you know what you are doing 778# You can enable one or both FireWire driver stacks.
779#
780
781#
782# See the help texts for more information.
751# 783#
752# CONFIG_FIREWIRE is not set 784# CONFIG_FIREWIRE is not set
753# CONFIG_IEEE1394 is not set 785# CONFIG_IEEE1394 is not set
754# CONFIG_I2O is not set 786# CONFIG_I2O is not set
755# CONFIG_MACINTOSH_DRIVERS is not set 787# CONFIG_MACINTOSH_DRIVERS is not set
756CONFIG_NETDEVICES=y 788CONFIG_NETDEVICES=y
757CONFIG_COMPAT_NET_DEV_OPS=y
758CONFIG_DUMMY=m 789CONFIG_DUMMY=m
759CONFIG_BONDING=m 790CONFIG_BONDING=m
760# CONFIG_MACVLAN is not set 791# CONFIG_MACVLAN is not set
@@ -801,6 +832,7 @@ CONFIG_MII=y
801# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set 832# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
802# CONFIG_NET_PCI is not set 833# CONFIG_NET_PCI is not set
803# CONFIG_B44 is not set 834# CONFIG_B44 is not set
835# CONFIG_KS8842 is not set
804# CONFIG_ATL2 is not set 836# CONFIG_ATL2 is not set
805CONFIG_NETDEV_1000=y 837CONFIG_NETDEV_1000=y
806# CONFIG_ACENIC is not set 838# CONFIG_ACENIC is not set
@@ -820,8 +852,10 @@ CONFIG_NETDEV_1000=y
820# CONFIG_VIA_VELOCITY is not set 852# CONFIG_VIA_VELOCITY is not set
821# CONFIG_TIGON3 is not set 853# CONFIG_TIGON3 is not set
822# CONFIG_BNX2 is not set 854# CONFIG_BNX2 is not set
855# CONFIG_CNIC is not set
823CONFIG_FSL_PQ_MDIO=y 856CONFIG_FSL_PQ_MDIO=y
824CONFIG_GIANFAR=y 857CONFIG_GIANFAR=y
858# CONFIG_MV643XX_ETH is not set
825# CONFIG_QLA3XXX is not set 859# CONFIG_QLA3XXX is not set
826# CONFIG_ATL1 is not set 860# CONFIG_ATL1 is not set
827# CONFIG_ATL1E is not set 861# CONFIG_ATL1E is not set
@@ -1018,13 +1052,17 @@ CONFIG_I2C_MPC=y
1018# CONFIG_SENSORS_PCF8574 is not set 1052# CONFIG_SENSORS_PCF8574 is not set
1019# CONFIG_PCF8575 is not set 1053# CONFIG_PCF8575 is not set
1020# CONFIG_SENSORS_PCA9539 is not set 1054# CONFIG_SENSORS_PCA9539 is not set
1021# CONFIG_SENSORS_MAX6875 is not set
1022# CONFIG_SENSORS_TSL2550 is not set 1055# CONFIG_SENSORS_TSL2550 is not set
1023# CONFIG_I2C_DEBUG_CORE is not set 1056# CONFIG_I2C_DEBUG_CORE is not set
1024# CONFIG_I2C_DEBUG_ALGO is not set 1057# CONFIG_I2C_DEBUG_ALGO is not set
1025# CONFIG_I2C_DEBUG_BUS is not set 1058# CONFIG_I2C_DEBUG_BUS is not set
1026# CONFIG_I2C_DEBUG_CHIP is not set 1059# CONFIG_I2C_DEBUG_CHIP is not set
1027# CONFIG_SPI is not set 1060# CONFIG_SPI is not set
1061
1062#
1063# PPS support
1064#
1065# CONFIG_PPS is not set
1028CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y 1066CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
1029# CONFIG_GPIOLIB is not set 1067# CONFIG_GPIOLIB is not set
1030# CONFIG_W1 is not set 1068# CONFIG_W1 is not set
@@ -1079,6 +1117,7 @@ CONFIG_HWMON=y
1079# CONFIG_SENSORS_SMSC47B397 is not set 1117# CONFIG_SENSORS_SMSC47B397 is not set
1080# CONFIG_SENSORS_ADS7828 is not set 1118# CONFIG_SENSORS_ADS7828 is not set
1081# CONFIG_SENSORS_THMC50 is not set 1119# CONFIG_SENSORS_THMC50 is not set
1120# CONFIG_SENSORS_TMP401 is not set
1082# CONFIG_SENSORS_VIA686A is not set 1121# CONFIG_SENSORS_VIA686A is not set
1083# CONFIG_SENSORS_VT1211 is not set 1122# CONFIG_SENSORS_VT1211 is not set
1084# CONFIG_SENSORS_VT8231 is not set 1123# CONFIG_SENSORS_VT8231 is not set
@@ -1127,23 +1166,9 @@ CONFIG_SSB_POSSIBLE=y
1127# CONFIG_MFD_WM8400 is not set 1166# CONFIG_MFD_WM8400 is not set
1128# CONFIG_MFD_WM8350_I2C is not set 1167# CONFIG_MFD_WM8350_I2C is not set
1129# CONFIG_MFD_PCF50633 is not set 1168# CONFIG_MFD_PCF50633 is not set
1169# CONFIG_AB3100_CORE is not set
1130# CONFIG_REGULATOR is not set 1170# CONFIG_REGULATOR is not set
1131 1171# CONFIG_MEDIA_SUPPORT is not set
1132#
1133# Multimedia devices
1134#
1135
1136#
1137# Multimedia core support
1138#
1139# CONFIG_VIDEO_DEV is not set
1140# CONFIG_DVB_CORE is not set
1141# CONFIG_VIDEO_MEDIA is not set
1142
1143#
1144# Multimedia drivers
1145#
1146CONFIG_DAB=y
1147 1172
1148# 1173#
1149# Graphics support 1174# Graphics support
@@ -1207,6 +1232,10 @@ CONFIG_USB_ARCH_HAS_EHCI=y
1207# CONFIG_DMADEVICES is not set 1232# CONFIG_DMADEVICES is not set
1208# CONFIG_AUXDISPLAY is not set 1233# CONFIG_AUXDISPLAY is not set
1209# CONFIG_UIO is not set 1234# CONFIG_UIO is not set
1235
1236#
1237# TI VLYNQ
1238#
1210# CONFIG_STAGING is not set 1239# CONFIG_STAGING is not set
1211 1240
1212# 1241#
@@ -1236,8 +1265,8 @@ CONFIG_REISERFS_FS_POSIX_ACL=y
1236# CONFIG_REISERFS_FS_SECURITY is not set 1265# CONFIG_REISERFS_FS_SECURITY is not set
1237# CONFIG_JFS_FS is not set 1266# CONFIG_JFS_FS is not set
1238CONFIG_FS_POSIX_ACL=y 1267CONFIG_FS_POSIX_ACL=y
1239CONFIG_FILE_LOCKING=y
1240# CONFIG_XFS_FS is not set 1268# CONFIG_XFS_FS is not set
1269# CONFIG_GFS2_FS is not set
1241CONFIG_OCFS2_FS=m 1270CONFIG_OCFS2_FS=m
1242CONFIG_OCFS2_FS_O2CB=m 1271CONFIG_OCFS2_FS_O2CB=m
1243CONFIG_OCFS2_FS_STATS=y 1272CONFIG_OCFS2_FS_STATS=y
@@ -1245,6 +1274,8 @@ CONFIG_OCFS2_DEBUG_MASKLOG=y
1245# CONFIG_OCFS2_DEBUG_FS is not set 1274# CONFIG_OCFS2_DEBUG_FS is not set
1246# CONFIG_OCFS2_FS_POSIX_ACL is not set 1275# CONFIG_OCFS2_FS_POSIX_ACL is not set
1247# CONFIG_BTRFS_FS is not set 1276# CONFIG_BTRFS_FS is not set
1277CONFIG_FILE_LOCKING=y
1278CONFIG_FSNOTIFY=y
1248CONFIG_DNOTIFY=y 1279CONFIG_DNOTIFY=y
1249CONFIG_INOTIFY=y 1280CONFIG_INOTIFY=y
1250CONFIG_INOTIFY_USER=y 1281CONFIG_INOTIFY_USER=y
@@ -1318,6 +1349,7 @@ CONFIG_NFS_FS=y
1318CONFIG_NFS_V3=y 1349CONFIG_NFS_V3=y
1319# CONFIG_NFS_V3_ACL is not set 1350# CONFIG_NFS_V3_ACL is not set
1320CONFIG_NFS_V4=y 1351CONFIG_NFS_V4=y
1352# CONFIG_NFS_V4_1 is not set
1321CONFIG_ROOT_NFS=y 1353CONFIG_ROOT_NFS=y
1322# CONFIG_NFSD is not set 1354# CONFIG_NFSD is not set
1323CONFIG_LOCKD=y 1355CONFIG_LOCKD=y
@@ -1409,6 +1441,7 @@ CONFIG_HAS_IOPORT=y
1409CONFIG_HAS_DMA=y 1441CONFIG_HAS_DMA=y
1410CONFIG_HAVE_LMB=y 1442CONFIG_HAVE_LMB=y
1411CONFIG_NLATTR=y 1443CONFIG_NLATTR=y
1444CONFIG_GENERIC_ATOMIC64=y
1412 1445
1413# 1446#
1414# Kernel hacking 1447# Kernel hacking
@@ -1434,10 +1467,14 @@ CONFIG_SCHED_DEBUG=y
1434# CONFIG_TIMER_STATS is not set 1467# CONFIG_TIMER_STATS is not set
1435# CONFIG_DEBUG_OBJECTS is not set 1468# CONFIG_DEBUG_OBJECTS is not set
1436# CONFIG_DEBUG_SLAB is not set 1469# CONFIG_DEBUG_SLAB is not set
1470CONFIG_DEBUG_PREEMPT=y
1437# CONFIG_DEBUG_RT_MUTEXES is not set 1471# CONFIG_DEBUG_RT_MUTEXES is not set
1438# CONFIG_RT_MUTEX_TESTER is not set 1472# CONFIG_RT_MUTEX_TESTER is not set
1439# CONFIG_DEBUG_SPINLOCK is not set 1473# CONFIG_DEBUG_SPINLOCK is not set
1440# CONFIG_DEBUG_MUTEXES is not set 1474# CONFIG_DEBUG_MUTEXES is not set
1475# CONFIG_DEBUG_LOCK_ALLOC is not set
1476# CONFIG_PROVE_LOCKING is not set
1477# CONFIG_LOCK_STAT is not set
1441# CONFIG_DEBUG_SPINLOCK_SLEEP is not set 1478# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
1442# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set 1479# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
1443# CONFIG_DEBUG_KOBJECT is not set 1480# CONFIG_DEBUG_KOBJECT is not set
@@ -1449,7 +1486,6 @@ CONFIG_DEBUG_INFO=y
1449# CONFIG_DEBUG_LIST is not set 1486# CONFIG_DEBUG_LIST is not set
1450# CONFIG_DEBUG_SG is not set 1487# CONFIG_DEBUG_SG is not set
1451# CONFIG_DEBUG_NOTIFIERS is not set 1488# CONFIG_DEBUG_NOTIFIERS is not set
1452# CONFIG_BOOT_PRINTK_DELAY is not set
1453# CONFIG_RCU_TORTURE_TEST is not set 1489# CONFIG_RCU_TORTURE_TEST is not set
1454# CONFIG_RCU_CPU_STALL_DETECTOR is not set 1490# CONFIG_RCU_CPU_STALL_DETECTOR is not set
1455# CONFIG_BACKTRACE_SELF_TEST is not set 1491# CONFIG_BACKTRACE_SELF_TEST is not set
@@ -1463,17 +1499,16 @@ CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
1463CONFIG_HAVE_DYNAMIC_FTRACE=y 1499CONFIG_HAVE_DYNAMIC_FTRACE=y
1464CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y 1500CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
1465CONFIG_TRACING_SUPPORT=y 1501CONFIG_TRACING_SUPPORT=y
1466 1502CONFIG_FTRACE=y
1467#
1468# Tracers
1469#
1470# CONFIG_FUNCTION_TRACER is not set 1503# CONFIG_FUNCTION_TRACER is not set
1504# CONFIG_IRQSOFF_TRACER is not set
1471# CONFIG_PREEMPT_TRACER is not set 1505# CONFIG_PREEMPT_TRACER is not set
1472# CONFIG_SCHED_TRACER is not set 1506# CONFIG_SCHED_TRACER is not set
1473# CONFIG_CONTEXT_SWITCH_TRACER is not set 1507# CONFIG_ENABLE_DEFAULT_TRACERS is not set
1474# CONFIG_EVENT_TRACER is not set
1475# CONFIG_BOOT_TRACER is not set 1508# CONFIG_BOOT_TRACER is not set
1476# CONFIG_TRACE_BRANCH_PROFILING is not set 1509CONFIG_BRANCH_PROFILE_NONE=y
1510# CONFIG_PROFILE_ANNOTATED_BRANCHES is not set
1511# CONFIG_PROFILE_ALL_BRANCHES is not set
1477# CONFIG_STACK_TRACER is not set 1512# CONFIG_STACK_TRACER is not set
1478# CONFIG_KMEMTRACE is not set 1513# CONFIG_KMEMTRACE is not set
1479# CONFIG_WORKQUEUE_TRACER is not set 1514# CONFIG_WORKQUEUE_TRACER is not set
@@ -1482,9 +1517,13 @@ CONFIG_TRACING_SUPPORT=y
1482# CONFIG_SAMPLES is not set 1517# CONFIG_SAMPLES is not set
1483CONFIG_HAVE_ARCH_KGDB=y 1518CONFIG_HAVE_ARCH_KGDB=y
1484# CONFIG_KGDB is not set 1519# CONFIG_KGDB is not set
1520# CONFIG_KMEMCHECK is not set
1521# CONFIG_PPC_DISABLE_WERROR is not set
1522CONFIG_PPC_WERROR=y
1485CONFIG_PRINT_STACK_DEPTH=64 1523CONFIG_PRINT_STACK_DEPTH=64
1486# CONFIG_DEBUG_STACKOVERFLOW is not set 1524# CONFIG_DEBUG_STACKOVERFLOW is not set
1487# CONFIG_DEBUG_STACK_USAGE is not set 1525# CONFIG_DEBUG_STACK_USAGE is not set
1526# CONFIG_PPC_EMULATED_STATS is not set
1488# CONFIG_CODE_PATCHING_SELFTEST is not set 1527# CONFIG_CODE_PATCHING_SELFTEST is not set
1489# CONFIG_FTR_FIXUP_SELFTEST is not set 1528# CONFIG_FTR_FIXUP_SELFTEST is not set
1490# CONFIG_MSI_BITMAP_SELFTEST is not set 1529# CONFIG_MSI_BITMAP_SELFTEST is not set
@@ -1505,7 +1544,6 @@ CONFIG_SECURITY_NETWORK=y
1505# CONFIG_SECURITY_NETWORK_XFRM is not set 1544# CONFIG_SECURITY_NETWORK_XFRM is not set
1506# CONFIG_SECURITY_PATH is not set 1545# CONFIG_SECURITY_PATH is not set
1507# CONFIG_SECURITY_FILE_CAPABILITIES is not set 1546# CONFIG_SECURITY_FILE_CAPABILITIES is not set
1508CONFIG_SECURITY_DEFAULT_MMAP_MIN_ADDR=0
1509# CONFIG_SECURITY_TOMOYO is not set 1547# CONFIG_SECURITY_TOMOYO is not set
1510CONFIG_CRYPTO=y 1548CONFIG_CRYPTO=y
1511 1549
diff --git a/arch/powerpc/configs/adder875_defconfig b/arch/powerpc/configs/adder875_defconfig
index 74f7f7c6fdc4..aece6bb5f733 100644
--- a/arch/powerpc/configs/adder875_defconfig
+++ b/arch/powerpc/configs/adder875_defconfig
@@ -1,14 +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.30-rc3 3# Linux kernel version: 2.6.31-rc4
4# Wed May 13 17:21:50 2009 4# Wed Jul 29 23:31:47 2009
5# 5#
6# CONFIG_PPC64 is not set 6# CONFIG_PPC64 is not set
7 7
8# 8#
9# Processor support 9# Processor support
10# 10#
11# CONFIG_6xx is not set 11# CONFIG_PPC_BOOK3S_32 is not set
12# CONFIG_PPC_85xx is not set 12# CONFIG_PPC_85xx is not set
13CONFIG_PPC_8xx=y 13CONFIG_PPC_8xx=y
14# CONFIG_40x is not set 14# CONFIG_40x is not set
@@ -27,15 +27,16 @@ CONFIG_GENERIC_TIME=y
27CONFIG_GENERIC_TIME_VSYSCALL=y 27CONFIG_GENERIC_TIME_VSYSCALL=y
28CONFIG_GENERIC_CLOCKEVENTS=y 28CONFIG_GENERIC_CLOCKEVENTS=y
29CONFIG_GENERIC_HARDIRQS=y 29CONFIG_GENERIC_HARDIRQS=y
30CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
30# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set 31# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set
31CONFIG_IRQ_PER_CPU=y 32CONFIG_IRQ_PER_CPU=y
32CONFIG_STACKTRACE_SUPPORT=y 33CONFIG_STACKTRACE_SUPPORT=y
33CONFIG_HAVE_LATENCYTOP_SUPPORT=y 34CONFIG_HAVE_LATENCYTOP_SUPPORT=y
35CONFIG_TRACE_IRQFLAGS_SUPPORT=y
34CONFIG_LOCKDEP_SUPPORT=y 36CONFIG_LOCKDEP_SUPPORT=y
35CONFIG_RWSEM_XCHGADD_ALGORITHM=y 37CONFIG_RWSEM_XCHGADD_ALGORITHM=y
36CONFIG_ARCH_HAS_ILOG2_U32=y 38CONFIG_ARCH_HAS_ILOG2_U32=y
37CONFIG_GENERIC_HWEIGHT=y 39CONFIG_GENERIC_HWEIGHT=y
38CONFIG_GENERIC_CALIBRATE_DELAY=y
39CONFIG_GENERIC_FIND_NEXT_BIT=y 40CONFIG_GENERIC_FIND_NEXT_BIT=y
40# CONFIG_ARCH_NO_VIRT_TO_BUS is not set 41# CONFIG_ARCH_NO_VIRT_TO_BUS is not set
41CONFIG_PPC=y 42CONFIG_PPC=y
@@ -49,12 +50,14 @@ CONFIG_OF=y
49# CONFIG_GENERIC_TBSYNC is not set 50# CONFIG_GENERIC_TBSYNC is not set
50CONFIG_AUDIT_ARCH=y 51CONFIG_AUDIT_ARCH=y
51CONFIG_GENERIC_BUG=y 52CONFIG_GENERIC_BUG=y
53CONFIG_DTC=y
52# CONFIG_DEFAULT_UIMAGE is not set 54# CONFIG_DEFAULT_UIMAGE is not set
53CONFIG_REDBOOT=y 55CONFIG_REDBOOT=y
54# CONFIG_PPC_DCR_NATIVE is not set 56# CONFIG_PPC_DCR_NATIVE is not set
55# CONFIG_PPC_DCR_MMIO is not set 57# CONFIG_PPC_DCR_MMIO is not set
56CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y 58CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y
57CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" 59CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
60CONFIG_CONSTRUCTORS=y
58 61
59# 62#
60# General setup 63# General setup
@@ -101,7 +104,6 @@ CONFIG_EMBEDDED=y
101CONFIG_KALLSYMS=y 104CONFIG_KALLSYMS=y
102# CONFIG_KALLSYMS_ALL is not set 105# CONFIG_KALLSYMS_ALL is not set
103# CONFIG_KALLSYMS_EXTRA_PASS is not set 106# CONFIG_KALLSYMS_EXTRA_PASS is not set
104# CONFIG_STRIP_ASM_SYMS is not set
105CONFIG_HOTPLUG=y 107CONFIG_HOTPLUG=y
106CONFIG_PRINTK=y 108CONFIG_PRINTK=y
107CONFIG_BUG=y 109CONFIG_BUG=y
@@ -114,8 +116,15 @@ CONFIG_TIMERFD=y
114CONFIG_EVENTFD=y 116CONFIG_EVENTFD=y
115CONFIG_SHMEM=y 117CONFIG_SHMEM=y
116CONFIG_AIO=y 118CONFIG_AIO=y
119CONFIG_HAVE_PERF_COUNTERS=y
120
121#
122# Performance Counters
123#
124# CONFIG_PERF_COUNTERS is not set
117# CONFIG_VM_EVENT_COUNTERS is not set 125# CONFIG_VM_EVENT_COUNTERS is not set
118CONFIG_SLUB_DEBUG=y 126CONFIG_SLUB_DEBUG=y
127# CONFIG_STRIP_ASM_SYMS is not set
119CONFIG_COMPAT_BRK=y 128CONFIG_COMPAT_BRK=y
120# CONFIG_SLAB is not set 129# CONFIG_SLAB is not set
121CONFIG_SLUB=y 130CONFIG_SLUB=y
@@ -129,13 +138,18 @@ CONFIG_HAVE_KPROBES=y
129CONFIG_HAVE_KRETPROBES=y 138CONFIG_HAVE_KRETPROBES=y
130CONFIG_HAVE_ARCH_TRACEHOOK=y 139CONFIG_HAVE_ARCH_TRACEHOOK=y
131CONFIG_HAVE_CLK=y 140CONFIG_HAVE_CLK=y
141
142#
143# GCOV-based kernel profiling
144#
145# CONFIG_GCOV_KERNEL is not set
132# CONFIG_SLOW_WORK is not set 146# CONFIG_SLOW_WORK is not set
133# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set 147# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
134CONFIG_SLABINFO=y 148CONFIG_SLABINFO=y
135CONFIG_BASE_SMALL=1 149CONFIG_BASE_SMALL=1
136# CONFIG_MODULES is not set 150# CONFIG_MODULES is not set
137CONFIG_BLOCK=y 151CONFIG_BLOCK=y
138# CONFIG_LBD is not set 152CONFIG_LBDAF=y
139# CONFIG_BLK_DEV_BSG is not set 153# CONFIG_BLK_DEV_BSG is not set
140# CONFIG_BLK_DEV_INTEGRITY is not set 154# CONFIG_BLK_DEV_INTEGRITY is not set
141 155
@@ -220,6 +234,7 @@ CONFIG_BINFMT_ELF=y
220# CONFIG_MATH_EMULATION is not set 234# CONFIG_MATH_EMULATION is not set
221# CONFIG_8XX_MINIMAL_FPEMU is not set 235# CONFIG_8XX_MINIMAL_FPEMU is not set
222# CONFIG_IOMMU_HELPER is not set 236# CONFIG_IOMMU_HELPER is not set
237# CONFIG_SWIOTLB is not set
223CONFIG_PPC_NEED_DMA_SYNC_OPS=y 238CONFIG_PPC_NEED_DMA_SYNC_OPS=y
224CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y 239CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
225CONFIG_ARCH_HAS_WALK_MEMORY=y 240CONFIG_ARCH_HAS_WALK_MEMORY=y
@@ -239,9 +254,9 @@ CONFIG_MIGRATION=y
239CONFIG_ZONE_DMA_FLAG=1 254CONFIG_ZONE_DMA_FLAG=1
240CONFIG_BOUNCE=y 255CONFIG_BOUNCE=y
241CONFIG_VIRT_TO_BUS=y 256CONFIG_VIRT_TO_BUS=y
242CONFIG_UNEVICTABLE_LRU=y
243CONFIG_HAVE_MLOCK=y 257CONFIG_HAVE_MLOCK=y
244CONFIG_HAVE_MLOCKED_PAGE_BIT=y 258CONFIG_HAVE_MLOCKED_PAGE_BIT=y
259CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
245CONFIG_PPC_4K_PAGES=y 260CONFIG_PPC_4K_PAGES=y
246# CONFIG_PPC_16K_PAGES is not set 261# CONFIG_PPC_16K_PAGES is not set
247# CONFIG_PPC_64K_PAGES is not set 262# CONFIG_PPC_64K_PAGES is not set
@@ -280,6 +295,7 @@ CONFIG_PAGE_OFFSET=0xc0000000
280CONFIG_KERNEL_START=0xc0000000 295CONFIG_KERNEL_START=0xc0000000
281CONFIG_PHYSICAL_START=0x00000000 296CONFIG_PHYSICAL_START=0x00000000
282CONFIG_TASK_SIZE=0x80000000 297CONFIG_TASK_SIZE=0x80000000
298CONFIG_CONSISTENT_SIZE=0x00200000
283CONFIG_NET=y 299CONFIG_NET=y
284 300
285# 301#
@@ -336,6 +352,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
336# CONFIG_ECONET is not set 352# CONFIG_ECONET is not set
337# CONFIG_WAN_ROUTER is not set 353# CONFIG_WAN_ROUTER is not set
338# CONFIG_PHONET is not set 354# CONFIG_PHONET is not set
355# CONFIG_IEEE802154 is not set
339# CONFIG_NET_SCHED is not set 356# CONFIG_NET_SCHED is not set
340# CONFIG_DCB is not set 357# CONFIG_DCB is not set
341 358
@@ -353,7 +370,11 @@ CONFIG_WIRELESS=y
353CONFIG_WIRELESS_OLD_REGULATORY=y 370CONFIG_WIRELESS_OLD_REGULATORY=y
354# CONFIG_WIRELESS_EXT is not set 371# CONFIG_WIRELESS_EXT is not set
355# CONFIG_LIB80211 is not set 372# CONFIG_LIB80211 is not set
356# CONFIG_MAC80211 is not set 373
374#
375# CFG80211 needs to be enabled for MAC80211
376#
377CONFIG_MAC80211_DEFAULT_PS_VALUE=0
357# CONFIG_WIMAX is not set 378# CONFIG_WIMAX is not set
358# CONFIG_RFKILL is not set 379# CONFIG_RFKILL is not set
359# CONFIG_NET_9P is not set 380# CONFIG_NET_9P is not set
@@ -452,6 +473,7 @@ CONFIG_MTD_PHYSMAP_OF=y
452# 473#
453# CONFIG_MTD_UBI is not set 474# CONFIG_MTD_UBI is not set
454CONFIG_OF_DEVICE=y 475CONFIG_OF_DEVICE=y
476CONFIG_OF_MDIO=y
455# CONFIG_PARPORT is not set 477# CONFIG_PARPORT is not set
456# CONFIG_BLK_DEV is not set 478# CONFIG_BLK_DEV is not set
457# CONFIG_MISC_DEVICES is not set 479# CONFIG_MISC_DEVICES is not set
@@ -469,7 +491,6 @@ CONFIG_HAVE_IDE=y
469# CONFIG_MD is not set 491# CONFIG_MD is not set
470# CONFIG_MACINTOSH_DRIVERS is not set 492# CONFIG_MACINTOSH_DRIVERS is not set
471CONFIG_NETDEVICES=y 493CONFIG_NETDEVICES=y
472CONFIG_COMPAT_NET_DEV_OPS=y
473# CONFIG_DUMMY is not set 494# CONFIG_DUMMY is not set
474# CONFIG_BONDING is not set 495# CONFIG_BONDING is not set
475# CONFIG_MACVLAN is not set 496# CONFIG_MACVLAN is not set
@@ -508,6 +529,7 @@ CONFIG_MII=y
508# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set 529# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set
509# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set 530# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
510# CONFIG_B44 is not set 531# CONFIG_B44 is not set
532# CONFIG_KS8842 is not set
511CONFIG_FS_ENET=y 533CONFIG_FS_ENET=y
512# CONFIG_FS_ENET_HAS_SCC is not set 534# CONFIG_FS_ENET_HAS_SCC is not set
513CONFIG_FS_ENET_HAS_FEC=y 535CONFIG_FS_ENET_HAS_FEC=y
@@ -556,11 +578,11 @@ CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
556# 578#
557CONFIG_INPUT_KEYBOARD=y 579CONFIG_INPUT_KEYBOARD=y
558CONFIG_KEYBOARD_ATKBD=y 580CONFIG_KEYBOARD_ATKBD=y
559# CONFIG_KEYBOARD_SUNKBD is not set
560# CONFIG_KEYBOARD_LKKBD is not set 581# CONFIG_KEYBOARD_LKKBD is not set
561# CONFIG_KEYBOARD_XTKBD is not set
562# CONFIG_KEYBOARD_NEWTON is not set 582# CONFIG_KEYBOARD_NEWTON is not set
563# CONFIG_KEYBOARD_STOWAWAY is not set 583# CONFIG_KEYBOARD_STOWAWAY is not set
584# CONFIG_KEYBOARD_SUNKBD is not set
585# CONFIG_KEYBOARD_XTKBD is not set
564CONFIG_INPUT_MOUSE=y 586CONFIG_INPUT_MOUSE=y
565CONFIG_MOUSE_PS2=y 587CONFIG_MOUSE_PS2=y
566CONFIG_MOUSE_PS2_ALPS=y 588CONFIG_MOUSE_PS2_ALPS=y
@@ -622,6 +644,11 @@ CONFIG_GEN_RTC=y
622# CONFIG_TCG_TPM is not set 644# CONFIG_TCG_TPM is not set
623# CONFIG_I2C is not set 645# CONFIG_I2C is not set
624# CONFIG_SPI is not set 646# CONFIG_SPI is not set
647
648#
649# PPS support
650#
651# CONFIG_PPS is not set
625CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y 652CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
626# CONFIG_GPIOLIB is not set 653# CONFIG_GPIOLIB is not set
627# CONFIG_W1 is not set 654# CONFIG_W1 is not set
@@ -644,22 +671,7 @@ CONFIG_SSB_POSSIBLE=y
644# CONFIG_HTC_PASIC3 is not set 671# CONFIG_HTC_PASIC3 is not set
645# CONFIG_MFD_TMIO is not set 672# CONFIG_MFD_TMIO is not set
646# CONFIG_REGULATOR is not set 673# CONFIG_REGULATOR is not set
647 674# CONFIG_MEDIA_SUPPORT is not set
648#
649# Multimedia devices
650#
651
652#
653# Multimedia core support
654#
655# CONFIG_VIDEO_DEV is not set
656# CONFIG_DVB_CORE is not set
657# CONFIG_VIDEO_MEDIA is not set
658
659#
660# Multimedia drivers
661#
662CONFIG_DAB=y
663 675
664# 676#
665# Graphics support 677# Graphics support
@@ -685,6 +697,10 @@ CONFIG_VIDEO_OUTPUT_CONTROL=y
685# CONFIG_DMADEVICES is not set 697# CONFIG_DMADEVICES is not set
686# CONFIG_AUXDISPLAY is not set 698# CONFIG_AUXDISPLAY is not set
687# CONFIG_UIO is not set 699# CONFIG_UIO is not set
700
701#
702# TI VLYNQ
703#
688# CONFIG_STAGING is not set 704# CONFIG_STAGING is not set
689 705
690# 706#
@@ -696,12 +712,15 @@ CONFIG_VIDEO_OUTPUT_CONTROL=y
696# CONFIG_REISERFS_FS is not set 712# CONFIG_REISERFS_FS is not set
697# CONFIG_JFS_FS is not set 713# CONFIG_JFS_FS is not set
698# CONFIG_FS_POSIX_ACL is not set 714# CONFIG_FS_POSIX_ACL is not set
699CONFIG_FILE_LOCKING=y
700# CONFIG_XFS_FS is not set 715# CONFIG_XFS_FS is not set
716# CONFIG_GFS2_FS is not set
701# CONFIG_OCFS2_FS is not set 717# CONFIG_OCFS2_FS is not set
702# CONFIG_BTRFS_FS is not set 718# CONFIG_BTRFS_FS is not set
719CONFIG_FILE_LOCKING=y
720CONFIG_FSNOTIFY=y
703# CONFIG_DNOTIFY is not set 721# CONFIG_DNOTIFY is not set
704# CONFIG_INOTIFY is not set 722# CONFIG_INOTIFY is not set
723CONFIG_INOTIFY_USER=y
705# CONFIG_QUOTA is not set 724# CONFIG_QUOTA is not set
706# CONFIG_AUTOFS_FS is not set 725# CONFIG_AUTOFS_FS is not set
707# CONFIG_AUTOFS4_FS is not set 726# CONFIG_AUTOFS4_FS is not set
@@ -818,6 +837,7 @@ CONFIG_HAS_IOPORT=y
818CONFIG_HAS_DMA=y 837CONFIG_HAS_DMA=y
819CONFIG_HAVE_LMB=y 838CONFIG_HAVE_LMB=y
820CONFIG_NLATTR=y 839CONFIG_NLATTR=y
840CONFIG_GENERIC_ATOMIC64=y
821 841
822# 842#
823# Kernel hacking 843# Kernel hacking
@@ -846,6 +866,9 @@ CONFIG_SCHED_DEBUG=y
846# CONFIG_SLUB_STATS is not set 866# CONFIG_SLUB_STATS is not set
847# CONFIG_DEBUG_SPINLOCK is not set 867# CONFIG_DEBUG_SPINLOCK is not set
848# CONFIG_DEBUG_MUTEXES is not set 868# CONFIG_DEBUG_MUTEXES is not set
869# CONFIG_DEBUG_LOCK_ALLOC is not set
870# CONFIG_PROVE_LOCKING is not set
871# CONFIG_LOCK_STAT is not set
849# CONFIG_DEBUG_SPINLOCK_SLEEP is not set 872# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
850# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set 873# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
851# CONFIG_DEBUG_KOBJECT is not set 874# CONFIG_DEBUG_KOBJECT is not set
@@ -857,7 +880,6 @@ CONFIG_DEBUG_INFO=y
857# CONFIG_DEBUG_LIST is not set 880# CONFIG_DEBUG_LIST is not set
858# CONFIG_DEBUG_SG is not set 881# CONFIG_DEBUG_SG is not set
859# CONFIG_DEBUG_NOTIFIERS is not set 882# CONFIG_DEBUG_NOTIFIERS is not set
860# CONFIG_BOOT_PRINTK_DELAY is not set
861# CONFIG_RCU_TORTURE_TEST is not set 883# CONFIG_RCU_TORTURE_TEST is not set
862# CONFIG_RCU_CPU_STALL_DETECTOR is not set 884# CONFIG_RCU_CPU_STALL_DETECTOR is not set
863# CONFIG_BACKTRACE_SELF_TEST is not set 885# CONFIG_BACKTRACE_SELF_TEST is not set
@@ -870,16 +892,15 @@ CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
870CONFIG_HAVE_DYNAMIC_FTRACE=y 892CONFIG_HAVE_DYNAMIC_FTRACE=y
871CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y 893CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
872CONFIG_TRACING_SUPPORT=y 894CONFIG_TRACING_SUPPORT=y
873 895CONFIG_FTRACE=y
874#
875# Tracers
876#
877# CONFIG_FUNCTION_TRACER is not set 896# CONFIG_FUNCTION_TRACER is not set
897# CONFIG_IRQSOFF_TRACER is not set
878# CONFIG_SCHED_TRACER is not set 898# CONFIG_SCHED_TRACER is not set
879# CONFIG_CONTEXT_SWITCH_TRACER is not set 899# CONFIG_ENABLE_DEFAULT_TRACERS is not set
880# CONFIG_EVENT_TRACER is not set
881# CONFIG_BOOT_TRACER is not set 900# CONFIG_BOOT_TRACER is not set
882# CONFIG_TRACE_BRANCH_PROFILING is not set 901CONFIG_BRANCH_PROFILE_NONE=y
902# CONFIG_PROFILE_ANNOTATED_BRANCHES is not set
903# CONFIG_PROFILE_ALL_BRANCHES is not set
883# CONFIG_STACK_TRACER is not set 904# CONFIG_STACK_TRACER is not set
884# CONFIG_KMEMTRACE is not set 905# CONFIG_KMEMTRACE is not set
885# CONFIG_WORKQUEUE_TRACER is not set 906# CONFIG_WORKQUEUE_TRACER is not set
@@ -888,9 +909,13 @@ CONFIG_TRACING_SUPPORT=y
888# CONFIG_SAMPLES is not set 909# CONFIG_SAMPLES is not set
889CONFIG_HAVE_ARCH_KGDB=y 910CONFIG_HAVE_ARCH_KGDB=y
890# CONFIG_KGDB is not set 911# CONFIG_KGDB is not set
912# CONFIG_KMEMCHECK is not set
913# CONFIG_PPC_DISABLE_WERROR is not set
914CONFIG_PPC_WERROR=y
891CONFIG_PRINT_STACK_DEPTH=64 915CONFIG_PRINT_STACK_DEPTH=64
892# CONFIG_DEBUG_STACKOVERFLOW is not set 916# CONFIG_DEBUG_STACKOVERFLOW is not set
893# CONFIG_DEBUG_STACK_USAGE is not set 917# CONFIG_DEBUG_STACK_USAGE is not set
918# CONFIG_PPC_EMULATED_STATS is not set
894# CONFIG_CODE_PATCHING_SELFTEST is not set 919# CONFIG_CODE_PATCHING_SELFTEST is not set
895# CONFIG_FTR_FIXUP_SELFTEST is not set 920# CONFIG_FTR_FIXUP_SELFTEST is not set
896# CONFIG_MSI_BITMAP_SELFTEST is not set 921# CONFIG_MSI_BITMAP_SELFTEST is not set
diff --git a/arch/powerpc/configs/c2k_defconfig b/arch/powerpc/configs/c2k_defconfig
index 9ffa8de92803..8105360d53f4 100644
--- a/arch/powerpc/configs/c2k_defconfig
+++ b/arch/powerpc/configs/c2k_defconfig
@@ -1,25 +1,27 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.30-rc3 3# Linux kernel version: 2.6.31-rc4
4# Wed May 13 17:21:51 2009 4# Wed Jul 29 23:31:48 2009
5# 5#
6# CONFIG_PPC64 is not set 6# CONFIG_PPC64 is not set
7 7
8# 8#
9# Processor support 9# Processor support
10# 10#
11CONFIG_6xx=y 11CONFIG_PPC_BOOK3S_32=y
12# CONFIG_PPC_85xx is not set 12# CONFIG_PPC_85xx is not set
13# CONFIG_PPC_8xx is not set 13# CONFIG_PPC_8xx is not set
14# CONFIG_40x is not set 14# CONFIG_40x is not set
15# CONFIG_44x is not set 15# CONFIG_44x is not set
16# CONFIG_E200 is not set 16# CONFIG_E200 is not set
17CONFIG_PPC_BOOK3S=y 17CONFIG_PPC_BOOK3S=y
18CONFIG_6xx=y
18CONFIG_PPC_FPU=y 19CONFIG_PPC_FPU=y
19# CONFIG_ALTIVEC is not set 20# CONFIG_ALTIVEC is not set
20CONFIG_PPC_STD_MMU=y 21CONFIG_PPC_STD_MMU=y
21CONFIG_PPC_STD_MMU_32=y 22CONFIG_PPC_STD_MMU_32=y
22# CONFIG_PPC_MM_SLICES is not set 23# CONFIG_PPC_MM_SLICES is not set
24CONFIG_PPC_HAVE_PMU_SUPPORT=y
23# CONFIG_SMP is not set 25# CONFIG_SMP is not set
24CONFIG_NOT_COHERENT_CACHE=y 26CONFIG_NOT_COHERENT_CACHE=y
25CONFIG_CHECK_CACHE_COHERENCY=y 27CONFIG_CHECK_CACHE_COHERENCY=y
@@ -32,15 +34,16 @@ CONFIG_GENERIC_TIME=y
32CONFIG_GENERIC_TIME_VSYSCALL=y 34CONFIG_GENERIC_TIME_VSYSCALL=y
33CONFIG_GENERIC_CLOCKEVENTS=y 35CONFIG_GENERIC_CLOCKEVENTS=y
34CONFIG_GENERIC_HARDIRQS=y 36CONFIG_GENERIC_HARDIRQS=y
37CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
35# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set 38# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set
36CONFIG_IRQ_PER_CPU=y 39CONFIG_IRQ_PER_CPU=y
37CONFIG_STACKTRACE_SUPPORT=y 40CONFIG_STACKTRACE_SUPPORT=y
38CONFIG_HAVE_LATENCYTOP_SUPPORT=y 41CONFIG_HAVE_LATENCYTOP_SUPPORT=y
42CONFIG_TRACE_IRQFLAGS_SUPPORT=y
39CONFIG_LOCKDEP_SUPPORT=y 43CONFIG_LOCKDEP_SUPPORT=y
40CONFIG_RWSEM_XCHGADD_ALGORITHM=y 44CONFIG_RWSEM_XCHGADD_ALGORITHM=y
41CONFIG_ARCH_HAS_ILOG2_U32=y 45CONFIG_ARCH_HAS_ILOG2_U32=y
42CONFIG_GENERIC_HWEIGHT=y 46CONFIG_GENERIC_HWEIGHT=y
43CONFIG_GENERIC_CALIBRATE_DELAY=y
44CONFIG_GENERIC_FIND_NEXT_BIT=y 47CONFIG_GENERIC_FIND_NEXT_BIT=y
45# CONFIG_ARCH_NO_VIRT_TO_BUS is not set 48# CONFIG_ARCH_NO_VIRT_TO_BUS is not set
46CONFIG_PPC=y 49CONFIG_PPC=y
@@ -54,11 +57,13 @@ CONFIG_OF=y
54# CONFIG_GENERIC_TBSYNC is not set 57# CONFIG_GENERIC_TBSYNC is not set
55CONFIG_AUDIT_ARCH=y 58CONFIG_AUDIT_ARCH=y
56CONFIG_GENERIC_BUG=y 59CONFIG_GENERIC_BUG=y
60CONFIG_DTC=y
57# CONFIG_DEFAULT_UIMAGE is not set 61# CONFIG_DEFAULT_UIMAGE is not set
58# CONFIG_PPC_DCR_NATIVE is not set 62# CONFIG_PPC_DCR_NATIVE is not set
59# CONFIG_PPC_DCR_MMIO is not set 63# CONFIG_PPC_DCR_MMIO is not set
60CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y 64CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y
61CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" 65CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
66CONFIG_CONSTRUCTORS=y
62 67
63# 68#
64# General setup 69# General setup
@@ -118,7 +123,6 @@ CONFIG_SYSCTL_SYSCALL=y
118CONFIG_KALLSYMS=y 123CONFIG_KALLSYMS=y
119# CONFIG_KALLSYMS_ALL is not set 124# CONFIG_KALLSYMS_ALL is not set
120CONFIG_KALLSYMS_EXTRA_PASS=y 125CONFIG_KALLSYMS_EXTRA_PASS=y
121# CONFIG_STRIP_ASM_SYMS is not set
122CONFIG_HOTPLUG=y 126CONFIG_HOTPLUG=y
123CONFIG_PRINTK=y 127CONFIG_PRINTK=y
124CONFIG_BUG=y 128CONFIG_BUG=y
@@ -131,16 +135,23 @@ CONFIG_TIMERFD=y
131CONFIG_EVENTFD=y 135CONFIG_EVENTFD=y
132CONFIG_SHMEM=y 136CONFIG_SHMEM=y
133CONFIG_AIO=y 137CONFIG_AIO=y
138CONFIG_HAVE_PERF_COUNTERS=y
139
140#
141# Performance Counters
142#
143# CONFIG_PERF_COUNTERS is not set
134CONFIG_VM_EVENT_COUNTERS=y 144CONFIG_VM_EVENT_COUNTERS=y
135CONFIG_PCI_QUIRKS=y 145CONFIG_PCI_QUIRKS=y
136CONFIG_SLUB_DEBUG=y 146CONFIG_SLUB_DEBUG=y
147# CONFIG_STRIP_ASM_SYMS is not set
137CONFIG_COMPAT_BRK=y 148CONFIG_COMPAT_BRK=y
138# CONFIG_SLAB is not set 149# CONFIG_SLAB is not set
139CONFIG_SLUB=y 150CONFIG_SLUB=y
140# CONFIG_SLOB is not set 151# CONFIG_SLOB is not set
141CONFIG_PROFILING=y 152CONFIG_PROFILING=y
142CONFIG_TRACEPOINTS=y 153CONFIG_TRACEPOINTS=y
143# CONFIG_MARKERS is not set 154CONFIG_MARKERS=y
144CONFIG_OPROFILE=m 155CONFIG_OPROFILE=m
145CONFIG_HAVE_OPROFILE=y 156CONFIG_HAVE_OPROFILE=y
146CONFIG_KPROBES=y 157CONFIG_KPROBES=y
@@ -150,6 +161,11 @@ CONFIG_HAVE_IOREMAP_PROT=y
150CONFIG_HAVE_KPROBES=y 161CONFIG_HAVE_KPROBES=y
151CONFIG_HAVE_KRETPROBES=y 162CONFIG_HAVE_KRETPROBES=y
152CONFIG_HAVE_ARCH_TRACEHOOK=y 163CONFIG_HAVE_ARCH_TRACEHOOK=y
164
165#
166# GCOV-based kernel profiling
167#
168# CONFIG_GCOV_KERNEL is not set
153# CONFIG_SLOW_WORK is not set 169# CONFIG_SLOW_WORK is not set
154# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set 170# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
155CONFIG_SLABINFO=y 171CONFIG_SLABINFO=y
@@ -162,7 +178,7 @@ CONFIG_MODULE_UNLOAD=y
162CONFIG_MODVERSIONS=y 178CONFIG_MODVERSIONS=y
163# CONFIG_MODULE_SRCVERSION_ALL is not set 179# CONFIG_MODULE_SRCVERSION_ALL is not set
164CONFIG_BLOCK=y 180CONFIG_BLOCK=y
165CONFIG_LBD=y 181CONFIG_LBDAF=y
166# CONFIG_BLK_DEV_BSG is not set 182# CONFIG_BLK_DEV_BSG is not set
167# CONFIG_BLK_DEV_INTEGRITY is not set 183# CONFIG_BLK_DEV_INTEGRITY is not set
168 184
@@ -258,6 +274,7 @@ CONFIG_BINFMT_ELF=y
258# CONFIG_HAVE_AOUT is not set 274# CONFIG_HAVE_AOUT is not set
259CONFIG_BINFMT_MISC=y 275CONFIG_BINFMT_MISC=y
260# CONFIG_IOMMU_HELPER is not set 276# CONFIG_IOMMU_HELPER is not set
277# CONFIG_SWIOTLB is not set
261CONFIG_PPC_NEED_DMA_SYNC_OPS=y 278CONFIG_PPC_NEED_DMA_SYNC_OPS=y
262CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y 279CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
263CONFIG_ARCH_HAS_WALK_MEMORY=y 280CONFIG_ARCH_HAS_WALK_MEMORY=y
@@ -279,9 +296,9 @@ CONFIG_MIGRATION=y
279CONFIG_ZONE_DMA_FLAG=1 296CONFIG_ZONE_DMA_FLAG=1
280CONFIG_BOUNCE=y 297CONFIG_BOUNCE=y
281CONFIG_VIRT_TO_BUS=y 298CONFIG_VIRT_TO_BUS=y
282CONFIG_UNEVICTABLE_LRU=y
283CONFIG_HAVE_MLOCK=y 299CONFIG_HAVE_MLOCK=y
284CONFIG_HAVE_MLOCKED_PAGE_BIT=y 300CONFIG_HAVE_MLOCKED_PAGE_BIT=y
301CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
285CONFIG_PPC_4K_PAGES=y 302CONFIG_PPC_4K_PAGES=y
286# CONFIG_PPC_16K_PAGES is not set 303# CONFIG_PPC_16K_PAGES is not set
287# CONFIG_PPC_64K_PAGES is not set 304# CONFIG_PPC_64K_PAGES is not set
@@ -331,6 +348,7 @@ CONFIG_PAGE_OFFSET=0xc0000000
331CONFIG_KERNEL_START=0xc0000000 348CONFIG_KERNEL_START=0xc0000000
332CONFIG_PHYSICAL_START=0x00000000 349CONFIG_PHYSICAL_START=0x00000000
333CONFIG_TASK_SIZE=0xc0000000 350CONFIG_TASK_SIZE=0xc0000000
351CONFIG_CONSISTENT_SIZE=0x00200000
334CONFIG_NET=y 352CONFIG_NET=y
335 353
336# 354#
@@ -583,6 +601,7 @@ CONFIG_LLC=m
583# CONFIG_ECONET is not set 601# CONFIG_ECONET is not set
584# CONFIG_WAN_ROUTER is not set 602# CONFIG_WAN_ROUTER is not set
585# CONFIG_PHONET is not set 603# CONFIG_PHONET is not set
604# CONFIG_IEEE802154 is not set
586CONFIG_NET_SCHED=y 605CONFIG_NET_SCHED=y
587 606
588# 607#
@@ -663,7 +682,11 @@ CONFIG_WIRELESS_OLD_REGULATORY=y
663CONFIG_WIRELESS_EXT=y 682CONFIG_WIRELESS_EXT=y
664CONFIG_WIRELESS_EXT_SYSFS=y 683CONFIG_WIRELESS_EXT_SYSFS=y
665# CONFIG_LIB80211 is not set 684# CONFIG_LIB80211 is not set
666# CONFIG_MAC80211 is not set 685
686#
687# CFG80211 needs to be enabled for MAC80211
688#
689CONFIG_MAC80211_DEFAULT_PS_VALUE=0
667# CONFIG_WIMAX is not set 690# CONFIG_WIMAX is not set
668# CONFIG_RFKILL is not set 691# CONFIG_RFKILL is not set
669# CONFIG_NET_9P is not set 692# CONFIG_NET_9P is not set
@@ -772,6 +795,7 @@ CONFIG_MTD_PHYSMAP_OF=y
772# CONFIG_MTD_UBI is not set 795# CONFIG_MTD_UBI is not set
773CONFIG_OF_DEVICE=y 796CONFIG_OF_DEVICE=y
774CONFIG_OF_I2C=m 797CONFIG_OF_I2C=m
798CONFIG_OF_MDIO=y
775# CONFIG_PARPORT is not set 799# CONFIG_PARPORT is not set
776CONFIG_BLK_DEV=y 800CONFIG_BLK_DEV=y
777# CONFIG_BLK_DEV_FD is not set 801# CONFIG_BLK_DEV_FD is not set
@@ -816,10 +840,6 @@ CONFIG_BLK_DEV_SR=m
816CONFIG_BLK_DEV_SR_VENDOR=y 840CONFIG_BLK_DEV_SR_VENDOR=y
817CONFIG_CHR_DEV_SG=m 841CONFIG_CHR_DEV_SG=m
818# CONFIG_CHR_DEV_SCH is not set 842# CONFIG_CHR_DEV_SCH is not set
819
820#
821# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
822#
823# CONFIG_SCSI_MULTI_LUN is not set 843# CONFIG_SCSI_MULTI_LUN is not set
824CONFIG_SCSI_CONSTANTS=y 844CONFIG_SCSI_CONSTANTS=y
825CONFIG_SCSI_LOGGING=y 845CONFIG_SCSI_LOGGING=y
@@ -836,6 +856,7 @@ CONFIG_SCSI_ISCSI_ATTRS=m
836CONFIG_SCSI_SRP_ATTRS=m 856CONFIG_SCSI_SRP_ATTRS=m
837CONFIG_SCSI_LOWLEVEL=y 857CONFIG_SCSI_LOWLEVEL=y
838# CONFIG_ISCSI_TCP is not set 858# CONFIG_ISCSI_TCP is not set
859# CONFIG_SCSI_BNX2_ISCSI is not set
839CONFIG_BLK_DEV_3W_XXXX_RAID=m 860CONFIG_BLK_DEV_3W_XXXX_RAID=m
840CONFIG_SCSI_3W_9XXX=m 861CONFIG_SCSI_3W_9XXX=m
841CONFIG_SCSI_ACARD=m 862CONFIG_SCSI_ACARD=m
@@ -854,6 +875,7 @@ CONFIG_AIC79XX_RESET_DELAY_MS=15000
854CONFIG_AIC79XX_DEBUG_MASK=0 875CONFIG_AIC79XX_DEBUG_MASK=0
855# CONFIG_AIC79XX_REG_PRETTY_PRINT is not set 876# CONFIG_AIC79XX_REG_PRETTY_PRINT is not set
856# CONFIG_SCSI_AIC94XX is not set 877# CONFIG_SCSI_AIC94XX is not set
878# CONFIG_SCSI_MVSAS is not set
857# CONFIG_SCSI_DPT_I2O is not set 879# CONFIG_SCSI_DPT_I2O is not set
858# CONFIG_SCSI_ADVANSYS is not set 880# CONFIG_SCSI_ADVANSYS is not set
859CONFIG_SCSI_ARCMSR=m 881CONFIG_SCSI_ARCMSR=m
@@ -875,7 +897,6 @@ CONFIG_SCSI_GDTH=m
875CONFIG_SCSI_IPS=m 897CONFIG_SCSI_IPS=m
876CONFIG_SCSI_INITIO=m 898CONFIG_SCSI_INITIO=m
877# CONFIG_SCSI_INIA100 is not set 899# CONFIG_SCSI_INIA100 is not set
878# CONFIG_SCSI_MVSAS is not set
879# CONFIG_SCSI_STEX is not set 900# CONFIG_SCSI_STEX is not set
880CONFIG_SCSI_SYM53C8XX_2=m 901CONFIG_SCSI_SYM53C8XX_2=m
881CONFIG_SCSI_SYM53C8XX_DMA_ADDRESSING_MODE=1 902CONFIG_SCSI_SYM53C8XX_DMA_ADDRESSING_MODE=1
@@ -903,14 +924,17 @@ CONFIG_SCSI_LPFC=m
903# 924#
904 925
905# 926#
906# Enable only one of the two stacks, unless you know what you are doing 927# You can enable one or both FireWire driver stacks.
928#
929
930#
931# See the help texts for more information.
907# 932#
908# CONFIG_FIREWIRE is not set 933# CONFIG_FIREWIRE is not set
909# CONFIG_IEEE1394 is not set 934# CONFIG_IEEE1394 is not set
910# CONFIG_I2O is not set 935# CONFIG_I2O is not set
911# CONFIG_MACINTOSH_DRIVERS is not set 936# CONFIG_MACINTOSH_DRIVERS is not set
912CONFIG_NETDEVICES=y 937CONFIG_NETDEVICES=y
913CONFIG_COMPAT_NET_DEV_OPS=y
914CONFIG_DUMMY=m 938CONFIG_DUMMY=m
915CONFIG_BONDING=m 939CONFIG_BONDING=m
916# CONFIG_MACVLAN is not set 940# CONFIG_MACVLAN is not set
@@ -957,6 +981,7 @@ CONFIG_MII=y
957# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set 981# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
958# CONFIG_NET_PCI is not set 982# CONFIG_NET_PCI is not set
959# CONFIG_B44 is not set 983# CONFIG_B44 is not set
984# CONFIG_KS8842 is not set
960# CONFIG_ATL2 is not set 985# CONFIG_ATL2 is not set
961CONFIG_NETDEV_1000=y 986CONFIG_NETDEV_1000=y
962# CONFIG_ACENIC is not set 987# CONFIG_ACENIC is not set
@@ -976,6 +1001,7 @@ CONFIG_NETDEV_1000=y
976# CONFIG_VIA_VELOCITY is not set 1001# CONFIG_VIA_VELOCITY is not set
977# CONFIG_TIGON3 is not set 1002# CONFIG_TIGON3 is not set
978# CONFIG_BNX2 is not set 1003# CONFIG_BNX2 is not set
1004# CONFIG_CNIC is not set
979CONFIG_MV643XX_ETH=y 1005CONFIG_MV643XX_ETH=y
980# CONFIG_QLA3XXX is not set 1006# CONFIG_QLA3XXX is not set
981# CONFIG_ATL1 is not set 1007# CONFIG_ATL1 is not set
@@ -1177,13 +1203,17 @@ CONFIG_I2C_MV64XXX=m
1177CONFIG_SENSORS_PCF8574=m 1203CONFIG_SENSORS_PCF8574=m
1178# CONFIG_PCF8575 is not set 1204# CONFIG_PCF8575 is not set
1179# CONFIG_SENSORS_PCA9539 is not set 1205# CONFIG_SENSORS_PCA9539 is not set
1180# CONFIG_SENSORS_MAX6875 is not set
1181# CONFIG_SENSORS_TSL2550 is not set 1206# CONFIG_SENSORS_TSL2550 is not set
1182# CONFIG_I2C_DEBUG_CORE is not set 1207# CONFIG_I2C_DEBUG_CORE is not set
1183# CONFIG_I2C_DEBUG_ALGO is not set 1208# CONFIG_I2C_DEBUG_ALGO is not set
1184# CONFIG_I2C_DEBUG_BUS is not set 1209# CONFIG_I2C_DEBUG_BUS is not set
1185# CONFIG_I2C_DEBUG_CHIP is not set 1210# CONFIG_I2C_DEBUG_CHIP is not set
1186# CONFIG_SPI is not set 1211# CONFIG_SPI is not set
1212
1213#
1214# PPS support
1215#
1216# CONFIG_PPS is not set
1187CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y 1217CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
1188# CONFIG_GPIOLIB is not set 1218# CONFIG_GPIOLIB is not set
1189# CONFIG_W1 is not set 1219# CONFIG_W1 is not set
@@ -1238,6 +1268,7 @@ CONFIG_SENSORS_SMSC47M1=m
1238CONFIG_SENSORS_SMSC47B397=m 1268CONFIG_SENSORS_SMSC47B397=m
1239# CONFIG_SENSORS_ADS7828 is not set 1269# CONFIG_SENSORS_ADS7828 is not set
1240# CONFIG_SENSORS_THMC50 is not set 1270# CONFIG_SENSORS_THMC50 is not set
1271# CONFIG_SENSORS_TMP401 is not set
1241CONFIG_SENSORS_VIA686A=m 1272CONFIG_SENSORS_VIA686A=m
1242# CONFIG_SENSORS_VT1211 is not set 1273# CONFIG_SENSORS_VT1211 is not set
1243# CONFIG_SENSORS_VT8231 is not set 1274# CONFIG_SENSORS_VT8231 is not set
@@ -1266,7 +1297,6 @@ CONFIG_SOFT_WATCHDOG=m
1266# 1297#
1267CONFIG_PCIPCWATCHDOG=m 1298CONFIG_PCIPCWATCHDOG=m
1268CONFIG_WDTPCI=m 1299CONFIG_WDTPCI=m
1269CONFIG_WDT_501_PCI=y
1270 1300
1271# 1301#
1272# USB-based Watchdog Cards 1302# USB-based Watchdog Cards
@@ -1289,23 +1319,9 @@ CONFIG_SSB_POSSIBLE=y
1289# CONFIG_MFD_WM8400 is not set 1319# CONFIG_MFD_WM8400 is not set
1290# CONFIG_MFD_WM8350_I2C is not set 1320# CONFIG_MFD_WM8350_I2C is not set
1291# CONFIG_MFD_PCF50633 is not set 1321# CONFIG_MFD_PCF50633 is not set
1322# CONFIG_AB3100_CORE is not set
1292# CONFIG_REGULATOR is not set 1323# CONFIG_REGULATOR is not set
1293 1324# CONFIG_MEDIA_SUPPORT is not set
1294#
1295# Multimedia devices
1296#
1297
1298#
1299# Multimedia core support
1300#
1301# CONFIG_VIDEO_DEV is not set
1302# CONFIG_DVB_CORE is not set
1303# CONFIG_VIDEO_MEDIA is not set
1304
1305#
1306# Multimedia drivers
1307#
1308# CONFIG_DAB is not set
1309 1325
1310# 1326#
1311# Graphics support 1327# Graphics support
@@ -1354,6 +1370,7 @@ CONFIG_USB_MON=m
1354# USB Host Controller Drivers 1370# USB Host Controller Drivers
1355# 1371#
1356# CONFIG_USB_C67X00_HCD is not set 1372# CONFIG_USB_C67X00_HCD is not set
1373# CONFIG_USB_XHCI_HCD is not set
1357CONFIG_USB_EHCI_HCD=m 1374CONFIG_USB_EHCI_HCD=m
1358CONFIG_USB_EHCI_ROOT_HUB_TT=y 1375CONFIG_USB_EHCI_ROOT_HUB_TT=y
1359# CONFIG_USB_EHCI_TT_NEWSCHED is not set 1376# CONFIG_USB_EHCI_TT_NEWSCHED is not set
@@ -1362,9 +1379,9 @@ CONFIG_USB_EHCI_HCD_PPC_OF=y
1362# CONFIG_USB_ISP116X_HCD is not set 1379# CONFIG_USB_ISP116X_HCD is not set
1363# CONFIG_USB_ISP1760_HCD is not set 1380# CONFIG_USB_ISP1760_HCD is not set
1364CONFIG_USB_OHCI_HCD=m 1381CONFIG_USB_OHCI_HCD=m
1365CONFIG_USB_OHCI_HCD_PPC_OF=y
1366CONFIG_USB_OHCI_HCD_PPC_OF_BE=y 1382CONFIG_USB_OHCI_HCD_PPC_OF_BE=y
1367# CONFIG_USB_OHCI_HCD_PPC_OF_LE is not set 1383# CONFIG_USB_OHCI_HCD_PPC_OF_LE is not set
1384CONFIG_USB_OHCI_HCD_PPC_OF=y
1368CONFIG_USB_OHCI_HCD_PCI=y 1385CONFIG_USB_OHCI_HCD_PCI=y
1369CONFIG_USB_OHCI_BIG_ENDIAN_DESC=y 1386CONFIG_USB_OHCI_BIG_ENDIAN_DESC=y
1370CONFIG_USB_OHCI_BIG_ENDIAN_MMIO=y 1387CONFIG_USB_OHCI_BIG_ENDIAN_MMIO=y
@@ -1545,6 +1562,10 @@ CONFIG_DMADEVICES=y
1545# 1562#
1546# CONFIG_AUXDISPLAY is not set 1563# CONFIG_AUXDISPLAY is not set
1547# CONFIG_UIO is not set 1564# CONFIG_UIO is not set
1565
1566#
1567# TI VLYNQ
1568#
1548# CONFIG_STAGING is not set 1569# CONFIG_STAGING is not set
1549 1570
1550# 1571#
@@ -1563,11 +1584,12 @@ CONFIG_FS_MBCACHE=m
1563# CONFIG_REISERFS_FS is not set 1584# CONFIG_REISERFS_FS is not set
1564# CONFIG_JFS_FS is not set 1585# CONFIG_JFS_FS is not set
1565CONFIG_FS_POSIX_ACL=y 1586CONFIG_FS_POSIX_ACL=y
1566CONFIG_FILE_LOCKING=y
1567# CONFIG_XFS_FS is not set 1587# CONFIG_XFS_FS is not set
1568# CONFIG_GFS2_FS is not set 1588# CONFIG_GFS2_FS is not set
1569# CONFIG_OCFS2_FS is not set 1589# CONFIG_OCFS2_FS is not set
1570# CONFIG_BTRFS_FS is not set 1590# CONFIG_BTRFS_FS is not set
1591CONFIG_FILE_LOCKING=y
1592CONFIG_FSNOTIFY=y
1571CONFIG_DNOTIFY=y 1593CONFIG_DNOTIFY=y
1572CONFIG_INOTIFY=y 1594CONFIG_INOTIFY=y
1573CONFIG_INOTIFY_USER=y 1595CONFIG_INOTIFY_USER=y
@@ -1652,6 +1674,7 @@ CONFIG_NFS_FS=y
1652CONFIG_NFS_V3=y 1674CONFIG_NFS_V3=y
1653CONFIG_NFS_V3_ACL=y 1675CONFIG_NFS_V3_ACL=y
1654CONFIG_NFS_V4=y 1676CONFIG_NFS_V4=y
1677# CONFIG_NFS_V4_1 is not set
1655CONFIG_ROOT_NFS=y 1678CONFIG_ROOT_NFS=y
1656# CONFIG_NFSD is not set 1679# CONFIG_NFSD is not set
1657CONFIG_LOCKD=y 1680CONFIG_LOCKD=y
@@ -1764,6 +1787,7 @@ CONFIG_HAS_DMA=y
1764CONFIG_CHECK_SIGNATURE=y 1787CONFIG_CHECK_SIGNATURE=y
1765CONFIG_HAVE_LMB=y 1788CONFIG_HAVE_LMB=y
1766CONFIG_NLATTR=y 1789CONFIG_NLATTR=y
1790CONFIG_GENERIC_ATOMIC64=y
1767 1791
1768# 1792#
1769# Kernel hacking 1793# Kernel hacking
@@ -1794,6 +1818,9 @@ CONFIG_SCHED_DEBUG=y
1794# CONFIG_RT_MUTEX_TESTER is not set 1818# CONFIG_RT_MUTEX_TESTER is not set
1795CONFIG_DEBUG_SPINLOCK=y 1819CONFIG_DEBUG_SPINLOCK=y
1796# CONFIG_DEBUG_MUTEXES is not set 1820# CONFIG_DEBUG_MUTEXES is not set
1821# CONFIG_DEBUG_LOCK_ALLOC is not set
1822# CONFIG_PROVE_LOCKING is not set
1823# CONFIG_LOCK_STAT is not set
1797CONFIG_DEBUG_SPINLOCK_SLEEP=y 1824CONFIG_DEBUG_SPINLOCK_SLEEP=y
1798# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set 1825# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
1799CONFIG_STACKTRACE=y 1826CONFIG_STACKTRACE=y
@@ -1807,7 +1834,6 @@ CONFIG_DEBUG_MEMORY_INIT=y
1807# CONFIG_DEBUG_LIST is not set 1834# CONFIG_DEBUG_LIST is not set
1808# CONFIG_DEBUG_SG is not set 1835# CONFIG_DEBUG_SG is not set
1809# CONFIG_DEBUG_NOTIFIERS is not set 1836# CONFIG_DEBUG_NOTIFIERS is not set
1810# CONFIG_BOOT_PRINTK_DELAY is not set
1811# CONFIG_RCU_TORTURE_TEST is not set 1837# CONFIG_RCU_TORTURE_TEST is not set
1812# CONFIG_RCU_CPU_STALL_DETECTOR is not set 1838# CONFIG_RCU_CPU_STALL_DETECTOR is not set
1813# CONFIG_KPROBES_SANITY_TEST is not set 1839# CONFIG_KPROBES_SANITY_TEST is not set
@@ -1824,30 +1850,34 @@ CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
1824CONFIG_HAVE_DYNAMIC_FTRACE=y 1850CONFIG_HAVE_DYNAMIC_FTRACE=y
1825CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y 1851CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
1826CONFIG_RING_BUFFER=y 1852CONFIG_RING_BUFFER=y
1853CONFIG_EVENT_TRACING=y
1854CONFIG_CONTEXT_SWITCH_TRACER=y
1827CONFIG_TRACING=y 1855CONFIG_TRACING=y
1828CONFIG_TRACING_SUPPORT=y 1856CONFIG_TRACING_SUPPORT=y
1829 1857CONFIG_FTRACE=y
1830#
1831# Tracers
1832#
1833# CONFIG_FUNCTION_TRACER is not set 1858# CONFIG_FUNCTION_TRACER is not set
1859# CONFIG_IRQSOFF_TRACER is not set
1834# CONFIG_SCHED_TRACER is not set 1860# CONFIG_SCHED_TRACER is not set
1835# CONFIG_CONTEXT_SWITCH_TRACER is not set 1861# CONFIG_ENABLE_DEFAULT_TRACERS is not set
1836# CONFIG_EVENT_TRACER is not set
1837# CONFIG_BOOT_TRACER is not set 1862# CONFIG_BOOT_TRACER is not set
1838# CONFIG_TRACE_BRANCH_PROFILING is not set 1863CONFIG_BRANCH_PROFILE_NONE=y
1864# CONFIG_PROFILE_ANNOTATED_BRANCHES is not set
1865# CONFIG_PROFILE_ALL_BRANCHES is not set
1839# CONFIG_STACK_TRACER is not set 1866# CONFIG_STACK_TRACER is not set
1840# CONFIG_KMEMTRACE is not set 1867# CONFIG_KMEMTRACE is not set
1841# CONFIG_WORKQUEUE_TRACER is not set 1868# CONFIG_WORKQUEUE_TRACER is not set
1842# CONFIG_BLK_DEV_IO_TRACE is not set 1869# CONFIG_BLK_DEV_IO_TRACE is not set
1843# CONFIG_FTRACE_STARTUP_TEST is not set 1870# CONFIG_RING_BUFFER_BENCHMARK is not set
1844# CONFIG_DYNAMIC_DEBUG is not set 1871# CONFIG_DYNAMIC_DEBUG is not set
1845# CONFIG_SAMPLES is not set 1872# CONFIG_SAMPLES is not set
1846CONFIG_HAVE_ARCH_KGDB=y 1873CONFIG_HAVE_ARCH_KGDB=y
1847# CONFIG_KGDB is not set 1874# CONFIG_KGDB is not set
1875# CONFIG_PPC_DISABLE_WERROR is not set
1876CONFIG_PPC_WERROR=y
1848CONFIG_PRINT_STACK_DEPTH=64 1877CONFIG_PRINT_STACK_DEPTH=64
1849CONFIG_DEBUG_STACKOVERFLOW=y 1878CONFIG_DEBUG_STACKOVERFLOW=y
1850CONFIG_DEBUG_STACK_USAGE=y 1879CONFIG_DEBUG_STACK_USAGE=y
1880# CONFIG_PPC_EMULATED_STATS is not set
1851# CONFIG_CODE_PATCHING_SELFTEST is not set 1881# CONFIG_CODE_PATCHING_SELFTEST is not set
1852# CONFIG_FTR_FIXUP_SELFTEST is not set 1882# CONFIG_FTR_FIXUP_SELFTEST is not set
1853# CONFIG_MSI_BITMAP_SELFTEST is not set 1883# CONFIG_MSI_BITMAP_SELFTEST is not set
@@ -1869,7 +1899,6 @@ CONFIG_SECURITY_NETWORK=y
1869# CONFIG_SECURITY_NETWORK_XFRM is not set 1899# CONFIG_SECURITY_NETWORK_XFRM is not set
1870# CONFIG_SECURITY_PATH is not set 1900# CONFIG_SECURITY_PATH is not set
1871# CONFIG_SECURITY_FILE_CAPABILITIES is not set 1901# CONFIG_SECURITY_FILE_CAPABILITIES is not set
1872CONFIG_SECURITY_DEFAULT_MMAP_MIN_ADDR=0
1873CONFIG_SECURITY_SELINUX=y 1902CONFIG_SECURITY_SELINUX=y
1874CONFIG_SECURITY_SELINUX_BOOTPARAM=y 1903CONFIG_SECURITY_SELINUX_BOOTPARAM=y
1875CONFIG_SECURITY_SELINUX_BOOTPARAM_VALUE=1 1904CONFIG_SECURITY_SELINUX_BOOTPARAM_VALUE=1
diff --git a/arch/powerpc/configs/ep8248e_defconfig b/arch/powerpc/configs/ep8248e_defconfig
index 04915c3a43f6..0aa5b43ffeb2 100644
--- a/arch/powerpc/configs/ep8248e_defconfig
+++ b/arch/powerpc/configs/ep8248e_defconfig
@@ -1,25 +1,27 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.30-rc3 3# Linux kernel version: 2.6.31-rc4
4# Wed May 13 17:21:52 2009 4# Wed Jul 29 23:31:49 2009
5# 5#
6# CONFIG_PPC64 is not set 6# CONFIG_PPC64 is not set
7 7
8# 8#
9# Processor support 9# Processor support
10# 10#
11CONFIG_6xx=y 11CONFIG_PPC_BOOK3S_32=y
12# CONFIG_PPC_85xx is not set 12# CONFIG_PPC_85xx is not set
13# CONFIG_PPC_8xx is not set 13# CONFIG_PPC_8xx is not set
14# CONFIG_40x is not set 14# CONFIG_40x is not set
15# CONFIG_44x is not set 15# CONFIG_44x is not set
16# CONFIG_E200 is not set 16# CONFIG_E200 is not set
17CONFIG_PPC_BOOK3S=y 17CONFIG_PPC_BOOK3S=y
18CONFIG_6xx=y
18CONFIG_PPC_FPU=y 19CONFIG_PPC_FPU=y
19# CONFIG_ALTIVEC is not set 20# CONFIG_ALTIVEC is not set
20CONFIG_PPC_STD_MMU=y 21CONFIG_PPC_STD_MMU=y
21CONFIG_PPC_STD_MMU_32=y 22CONFIG_PPC_STD_MMU_32=y
22# CONFIG_PPC_MM_SLICES is not set 23# CONFIG_PPC_MM_SLICES is not set
24CONFIG_PPC_HAVE_PMU_SUPPORT=y
23# CONFIG_SMP is not set 25# CONFIG_SMP is not set
24CONFIG_PPC32=y 26CONFIG_PPC32=y
25CONFIG_WORD_SIZE=32 27CONFIG_WORD_SIZE=32
@@ -30,15 +32,16 @@ CONFIG_GENERIC_TIME=y
30CONFIG_GENERIC_TIME_VSYSCALL=y 32CONFIG_GENERIC_TIME_VSYSCALL=y
31CONFIG_GENERIC_CLOCKEVENTS=y 33CONFIG_GENERIC_CLOCKEVENTS=y
32CONFIG_GENERIC_HARDIRQS=y 34CONFIG_GENERIC_HARDIRQS=y
35CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
33# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set 36# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set
34CONFIG_IRQ_PER_CPU=y 37CONFIG_IRQ_PER_CPU=y
35CONFIG_STACKTRACE_SUPPORT=y 38CONFIG_STACKTRACE_SUPPORT=y
36CONFIG_HAVE_LATENCYTOP_SUPPORT=y 39CONFIG_HAVE_LATENCYTOP_SUPPORT=y
40CONFIG_TRACE_IRQFLAGS_SUPPORT=y
37CONFIG_LOCKDEP_SUPPORT=y 41CONFIG_LOCKDEP_SUPPORT=y
38CONFIG_RWSEM_XCHGADD_ALGORITHM=y 42CONFIG_RWSEM_XCHGADD_ALGORITHM=y
39CONFIG_ARCH_HAS_ILOG2_U32=y 43CONFIG_ARCH_HAS_ILOG2_U32=y
40CONFIG_GENERIC_HWEIGHT=y 44CONFIG_GENERIC_HWEIGHT=y
41CONFIG_GENERIC_CALIBRATE_DELAY=y
42CONFIG_GENERIC_FIND_NEXT_BIT=y 45CONFIG_GENERIC_FIND_NEXT_BIT=y
43CONFIG_GENERIC_GPIO=y 46CONFIG_GENERIC_GPIO=y
44# CONFIG_ARCH_NO_VIRT_TO_BUS is not set 47# CONFIG_ARCH_NO_VIRT_TO_BUS is not set
@@ -53,11 +56,13 @@ CONFIG_OF=y
53# CONFIG_GENERIC_TBSYNC is not set 56# CONFIG_GENERIC_TBSYNC is not set
54CONFIG_AUDIT_ARCH=y 57CONFIG_AUDIT_ARCH=y
55CONFIG_GENERIC_BUG=y 58CONFIG_GENERIC_BUG=y
59CONFIG_DTC=y
56# CONFIG_DEFAULT_UIMAGE is not set 60# CONFIG_DEFAULT_UIMAGE is not set
57# CONFIG_PPC_DCR_NATIVE is not set 61# CONFIG_PPC_DCR_NATIVE is not set
58# CONFIG_PPC_DCR_MMIO is not set 62# CONFIG_PPC_DCR_MMIO is not set
59CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y 63CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y
60CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" 64CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
65CONFIG_CONSTRUCTORS=y
61 66
62# 67#
63# General setup 68# General setup
@@ -99,7 +104,6 @@ CONFIG_SYSCTL_SYSCALL=y
99CONFIG_KALLSYMS=y 104CONFIG_KALLSYMS=y
100CONFIG_KALLSYMS_ALL=y 105CONFIG_KALLSYMS_ALL=y
101# CONFIG_KALLSYMS_EXTRA_PASS is not set 106# CONFIG_KALLSYMS_EXTRA_PASS is not set
102# CONFIG_STRIP_ASM_SYMS is not set
103CONFIG_HOTPLUG=y 107CONFIG_HOTPLUG=y
104CONFIG_PRINTK=y 108CONFIG_PRINTK=y
105CONFIG_BUG=y 109CONFIG_BUG=y
@@ -112,8 +116,15 @@ CONFIG_TIMERFD=y
112CONFIG_EVENTFD=y 116CONFIG_EVENTFD=y
113CONFIG_SHMEM=y 117CONFIG_SHMEM=y
114CONFIG_AIO=y 118CONFIG_AIO=y
119CONFIG_HAVE_PERF_COUNTERS=y
120
121#
122# Performance Counters
123#
124# CONFIG_PERF_COUNTERS is not set
115CONFIG_VM_EVENT_COUNTERS=y 125CONFIG_VM_EVENT_COUNTERS=y
116CONFIG_PCI_QUIRKS=y 126CONFIG_PCI_QUIRKS=y
127# CONFIG_STRIP_ASM_SYMS is not set
117CONFIG_COMPAT_BRK=y 128CONFIG_COMPAT_BRK=y
118CONFIG_SLAB=y 129CONFIG_SLAB=y
119# CONFIG_SLUB is not set 130# CONFIG_SLUB is not set
@@ -127,6 +138,10 @@ CONFIG_HAVE_KPROBES=y
127CONFIG_HAVE_KRETPROBES=y 138CONFIG_HAVE_KRETPROBES=y
128CONFIG_HAVE_ARCH_TRACEHOOK=y 139CONFIG_HAVE_ARCH_TRACEHOOK=y
129CONFIG_HAVE_CLK=y 140CONFIG_HAVE_CLK=y
141
142#
143# GCOV-based kernel profiling
144#
130# CONFIG_SLOW_WORK is not set 145# CONFIG_SLOW_WORK is not set
131# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set 146# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
132CONFIG_SLABINFO=y 147CONFIG_SLABINFO=y
@@ -134,7 +149,7 @@ CONFIG_RT_MUTEXES=y
134CONFIG_BASE_SMALL=0 149CONFIG_BASE_SMALL=0
135# CONFIG_MODULES is not set 150# CONFIG_MODULES is not set
136CONFIG_BLOCK=y 151CONFIG_BLOCK=y
137# CONFIG_LBD is not set 152CONFIG_LBDAF=y
138# CONFIG_BLK_DEV_INTEGRITY is not set 153# CONFIG_BLK_DEV_INTEGRITY is not set
139 154
140# 155#
@@ -213,6 +228,7 @@ CONFIG_BINFMT_ELF=y
213# CONFIG_HAVE_AOUT is not set 228# CONFIG_HAVE_AOUT is not set
214CONFIG_BINFMT_MISC=y 229CONFIG_BINFMT_MISC=y
215# CONFIG_IOMMU_HELPER is not set 230# CONFIG_IOMMU_HELPER is not set
231# CONFIG_SWIOTLB is not set
216CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y 232CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
217CONFIG_ARCH_HAS_WALK_MEMORY=y 233CONFIG_ARCH_HAS_WALK_MEMORY=y
218CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y 234CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y
@@ -228,9 +244,9 @@ CONFIG_MIGRATION=y
228CONFIG_ZONE_DMA_FLAG=1 244CONFIG_ZONE_DMA_FLAG=1
229CONFIG_BOUNCE=y 245CONFIG_BOUNCE=y
230CONFIG_VIRT_TO_BUS=y 246CONFIG_VIRT_TO_BUS=y
231CONFIG_UNEVICTABLE_LRU=y
232CONFIG_HAVE_MLOCK=y 247CONFIG_HAVE_MLOCK=y
233CONFIG_HAVE_MLOCKED_PAGE_BIT=y 248CONFIG_HAVE_MLOCKED_PAGE_BIT=y
249CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
234CONFIG_PPC_4K_PAGES=y 250CONFIG_PPC_4K_PAGES=y
235# CONFIG_PPC_16K_PAGES is not set 251# CONFIG_PPC_16K_PAGES is not set
236# CONFIG_PPC_64K_PAGES is not set 252# CONFIG_PPC_64K_PAGES is not set
@@ -300,6 +316,7 @@ CONFIG_IP_PNP_BOOTP=y
300# CONFIG_NET_IPIP is not set 316# CONFIG_NET_IPIP is not set
301# CONFIG_NET_IPGRE is not set 317# CONFIG_NET_IPGRE is not set
302# CONFIG_IP_MROUTE is not set 318# CONFIG_IP_MROUTE is not set
319# CONFIG_ARPD is not set
303CONFIG_SYN_COOKIES=y 320CONFIG_SYN_COOKIES=y
304# CONFIG_INET_AH is not set 321# CONFIG_INET_AH is not set
305# CONFIG_INET_ESP is not set 322# CONFIG_INET_ESP is not set
@@ -380,7 +397,11 @@ CONFIG_WIRELESS=y
380CONFIG_WIRELESS_OLD_REGULATORY=y 397CONFIG_WIRELESS_OLD_REGULATORY=y
381# CONFIG_WIRELESS_EXT is not set 398# CONFIG_WIRELESS_EXT is not set
382# CONFIG_LIB80211 is not set 399# CONFIG_LIB80211 is not set
383# CONFIG_MAC80211 is not set 400
401#
402# CFG80211 needs to be enabled for MAC80211
403#
404CONFIG_MAC80211_DEFAULT_PS_VALUE=0
384# CONFIG_WIMAX is not set 405# CONFIG_WIMAX is not set
385# CONFIG_RFKILL is not set 406# CONFIG_RFKILL is not set
386 407
@@ -485,6 +506,7 @@ CONFIG_MTD_PHYSMAP_OF=y
485# CONFIG_MTD_UBI is not set 506# CONFIG_MTD_UBI is not set
486CONFIG_OF_DEVICE=y 507CONFIG_OF_DEVICE=y
487CONFIG_OF_GPIO=y 508CONFIG_OF_GPIO=y
509CONFIG_OF_MDIO=y
488# CONFIG_PARPORT is not set 510# CONFIG_PARPORT is not set
489CONFIG_BLK_DEV=y 511CONFIG_BLK_DEV=y
490# CONFIG_BLK_DEV_FD is not set 512# CONFIG_BLK_DEV_FD is not set
@@ -520,13 +542,17 @@ CONFIG_HAVE_IDE=y
520# 542#
521 543
522# 544#
523# A new alternative FireWire stack is available with EXPERIMENTAL=y 545# You can enable one or both FireWire driver stacks.
524# 546#
547
548#
549# See the help texts for more information.
550#
551# CONFIG_FIREWIRE is not set
525# CONFIG_IEEE1394 is not set 552# CONFIG_IEEE1394 is not set
526# CONFIG_I2O is not set 553# CONFIG_I2O is not set
527# CONFIG_MACINTOSH_DRIVERS is not set 554# CONFIG_MACINTOSH_DRIVERS is not set
528CONFIG_NETDEVICES=y 555CONFIG_NETDEVICES=y
529CONFIG_COMPAT_NET_DEV_OPS=y
530# CONFIG_DUMMY is not set 556# CONFIG_DUMMY is not set
531# CONFIG_BONDING is not set 557# CONFIG_BONDING is not set
532# CONFIG_EQUALIZER is not set 558# CONFIG_EQUALIZER is not set
@@ -573,6 +599,7 @@ CONFIG_MII=y
573# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set 599# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
574# CONFIG_NET_PCI is not set 600# CONFIG_NET_PCI is not set
575# CONFIG_B44 is not set 601# CONFIG_B44 is not set
602# CONFIG_KS8842 is not set
576# CONFIG_ATL2 is not set 603# CONFIG_ATL2 is not set
577CONFIG_FS_ENET=y 604CONFIG_FS_ENET=y
578# CONFIG_FS_ENET_HAS_SCC is not set 605# CONFIG_FS_ENET_HAS_SCC is not set
@@ -594,8 +621,10 @@ CONFIG_NETDEV_1000=y
594# CONFIG_VIA_VELOCITY is not set 621# CONFIG_VIA_VELOCITY is not set
595# CONFIG_TIGON3 is not set 622# CONFIG_TIGON3 is not set
596# CONFIG_BNX2 is not set 623# CONFIG_BNX2 is not set
624# CONFIG_CNIC is not set
597# CONFIG_FSL_PQ_MDIO is not set 625# CONFIG_FSL_PQ_MDIO is not set
598# CONFIG_GIANFAR is not set 626# CONFIG_GIANFAR is not set
627# CONFIG_MV643XX_ETH is not set
599# CONFIG_QLA3XXX is not set 628# CONFIG_QLA3XXX is not set
600# CONFIG_ATL1 is not set 629# CONFIG_ATL1 is not set
601# CONFIG_JME is not set 630# CONFIG_JME is not set
@@ -685,6 +714,10 @@ CONFIG_HW_RANDOM=y
685CONFIG_DEVPORT=y 714CONFIG_DEVPORT=y
686# CONFIG_I2C is not set 715# CONFIG_I2C is not set
687# CONFIG_SPI is not set 716# CONFIG_SPI is not set
717
718#
719# PPS support
720#
688CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y 721CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
689CONFIG_ARCH_REQUIRE_GPIOLIB=y 722CONFIG_ARCH_REQUIRE_GPIOLIB=y
690CONFIG_GPIOLIB=y 723CONFIG_GPIOLIB=y
@@ -728,22 +761,7 @@ CONFIG_SSB_POSSIBLE=y
728# CONFIG_HTC_PASIC3 is not set 761# CONFIG_HTC_PASIC3 is not set
729# CONFIG_MFD_TMIO is not set 762# CONFIG_MFD_TMIO is not set
730# CONFIG_REGULATOR is not set 763# CONFIG_REGULATOR is not set
731 764# CONFIG_MEDIA_SUPPORT is not set
732#
733# Multimedia devices
734#
735
736#
737# Multimedia core support
738#
739# CONFIG_VIDEO_DEV is not set
740# CONFIG_DVB_CORE is not set
741# CONFIG_VIDEO_MEDIA is not set
742
743#
744# Multimedia drivers
745#
746CONFIG_DAB=y
747 765
748# 766#
749# Graphics support 767# Graphics support
@@ -771,6 +789,10 @@ CONFIG_DAB=y
771# CONFIG_DMADEVICES is not set 789# CONFIG_DMADEVICES is not set
772# CONFIG_AUXDISPLAY is not set 790# CONFIG_AUXDISPLAY is not set
773# CONFIG_UIO is not set 791# CONFIG_UIO is not set
792
793#
794# TI VLYNQ
795#
774# CONFIG_STAGING is not set 796# CONFIG_STAGING is not set
775 797
776# 798#
@@ -787,9 +809,10 @@ CONFIG_JBD=y
787# CONFIG_REISERFS_FS is not set 809# CONFIG_REISERFS_FS is not set
788# CONFIG_JFS_FS is not set 810# CONFIG_JFS_FS is not set
789# CONFIG_FS_POSIX_ACL is not set 811# CONFIG_FS_POSIX_ACL is not set
790CONFIG_FILE_LOCKING=y
791# CONFIG_XFS_FS is not set 812# CONFIG_XFS_FS is not set
792# CONFIG_OCFS2_FS is not set 813# CONFIG_OCFS2_FS is not set
814CONFIG_FILE_LOCKING=y
815CONFIG_FSNOTIFY=y
793CONFIG_DNOTIFY=y 816CONFIG_DNOTIFY=y
794CONFIG_INOTIFY=y 817CONFIG_INOTIFY=y
795CONFIG_INOTIFY_USER=y 818CONFIG_INOTIFY_USER=y
@@ -935,6 +958,7 @@ CONFIG_HAS_IOPORT=y
935CONFIG_HAS_DMA=y 958CONFIG_HAS_DMA=y
936CONFIG_HAVE_LMB=y 959CONFIG_HAVE_LMB=y
937CONFIG_NLATTR=y 960CONFIG_NLATTR=y
961CONFIG_GENERIC_ATOMIC64=y
938 962
939# 963#
940# Kernel hacking 964# Kernel hacking
@@ -960,6 +984,9 @@ CONFIG_DEBUG_KERNEL=y
960# CONFIG_RT_MUTEX_TESTER is not set 984# CONFIG_RT_MUTEX_TESTER is not set
961# CONFIG_DEBUG_SPINLOCK is not set 985# CONFIG_DEBUG_SPINLOCK is not set
962# CONFIG_DEBUG_MUTEXES is not set 986# CONFIG_DEBUG_MUTEXES is not set
987# CONFIG_DEBUG_LOCK_ALLOC is not set
988# CONFIG_PROVE_LOCKING is not set
989# CONFIG_LOCK_STAT is not set
963# CONFIG_DEBUG_SPINLOCK_SLEEP is not set 990# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
964# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set 991# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
965# CONFIG_DEBUG_KOBJECT is not set 992# CONFIG_DEBUG_KOBJECT is not set
@@ -971,7 +998,6 @@ CONFIG_DEBUG_INFO=y
971# CONFIG_DEBUG_LIST is not set 998# CONFIG_DEBUG_LIST is not set
972# CONFIG_DEBUG_SG is not set 999# CONFIG_DEBUG_SG is not set
973# CONFIG_DEBUG_NOTIFIERS is not set 1000# CONFIG_DEBUG_NOTIFIERS is not set
974# CONFIG_BOOT_PRINTK_DELAY is not set
975# CONFIG_RCU_TORTURE_TEST is not set 1001# CONFIG_RCU_TORTURE_TEST is not set
976# CONFIG_RCU_CPU_STALL_DETECTOR is not set 1002# CONFIG_RCU_CPU_STALL_DETECTOR is not set
977# CONFIG_BACKTRACE_SELF_TEST is not set 1003# CONFIG_BACKTRACE_SELF_TEST is not set
@@ -985,22 +1011,23 @@ CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
985CONFIG_HAVE_DYNAMIC_FTRACE=y 1011CONFIG_HAVE_DYNAMIC_FTRACE=y
986CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y 1012CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
987CONFIG_TRACING_SUPPORT=y 1013CONFIG_TRACING_SUPPORT=y
988 1014CONFIG_FTRACE=y
989#
990# Tracers
991#
992# CONFIG_FUNCTION_TRACER is not set 1015# CONFIG_FUNCTION_TRACER is not set
1016# CONFIG_IRQSOFF_TRACER is not set
993# CONFIG_SCHED_TRACER is not set 1017# CONFIG_SCHED_TRACER is not set
994# CONFIG_CONTEXT_SWITCH_TRACER is not set 1018# CONFIG_ENABLE_DEFAULT_TRACERS is not set
995# CONFIG_EVENT_TRACER is not set
996# CONFIG_BOOT_TRACER is not set 1019# CONFIG_BOOT_TRACER is not set
997# CONFIG_TRACE_BRANCH_PROFILING is not set 1020CONFIG_BRANCH_PROFILE_NONE=y
1021# CONFIG_PROFILE_ANNOTATED_BRANCHES is not set
1022# CONFIG_PROFILE_ALL_BRANCHES is not set
998# CONFIG_STACK_TRACER is not set 1023# CONFIG_STACK_TRACER is not set
999# CONFIG_KMEMTRACE is not set 1024# CONFIG_KMEMTRACE is not set
1000# CONFIG_WORKQUEUE_TRACER is not set 1025# CONFIG_WORKQUEUE_TRACER is not set
1001# CONFIG_BLK_DEV_IO_TRACE is not set 1026# CONFIG_BLK_DEV_IO_TRACE is not set
1002# CONFIG_SAMPLES is not set 1027# CONFIG_SAMPLES is not set
1003CONFIG_HAVE_ARCH_KGDB=y 1028CONFIG_HAVE_ARCH_KGDB=y
1029# CONFIG_PPC_DISABLE_WERROR is not set
1030CONFIG_PPC_WERROR=y
1004CONFIG_PRINT_STACK_DEPTH=64 1031CONFIG_PRINT_STACK_DEPTH=64
1005# CONFIG_DEBUG_STACKOVERFLOW is not set 1032# CONFIG_DEBUG_STACKOVERFLOW is not set
1006# CONFIG_DEBUG_STACK_USAGE is not set 1033# CONFIG_DEBUG_STACK_USAGE is not set
diff --git a/arch/powerpc/configs/ep88xc_defconfig b/arch/powerpc/configs/ep88xc_defconfig
index c2a439595f4d..2c292e25cc01 100644
--- a/arch/powerpc/configs/ep88xc_defconfig
+++ b/arch/powerpc/configs/ep88xc_defconfig
@@ -1,14 +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.30-rc3 3# Linux kernel version: 2.6.31-rc4
4# Wed May 13 17:21:53 2009 4# Wed Jul 29 23:31:49 2009
5# 5#
6# CONFIG_PPC64 is not set 6# CONFIG_PPC64 is not set
7 7
8# 8#
9# Processor support 9# Processor support
10# 10#
11# CONFIG_6xx is not set 11# CONFIG_PPC_BOOK3S_32 is not set
12# CONFIG_PPC_85xx is not set 12# CONFIG_PPC_85xx is not set
13CONFIG_PPC_8xx=y 13CONFIG_PPC_8xx=y
14# CONFIG_40x is not set 14# CONFIG_40x is not set
@@ -27,15 +27,16 @@ CONFIG_GENERIC_TIME=y
27CONFIG_GENERIC_TIME_VSYSCALL=y 27CONFIG_GENERIC_TIME_VSYSCALL=y
28CONFIG_GENERIC_CLOCKEVENTS=y 28CONFIG_GENERIC_CLOCKEVENTS=y
29CONFIG_GENERIC_HARDIRQS=y 29CONFIG_GENERIC_HARDIRQS=y
30CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
30# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set 31# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set
31CONFIG_IRQ_PER_CPU=y 32CONFIG_IRQ_PER_CPU=y
32CONFIG_STACKTRACE_SUPPORT=y 33CONFIG_STACKTRACE_SUPPORT=y
33CONFIG_HAVE_LATENCYTOP_SUPPORT=y 34CONFIG_HAVE_LATENCYTOP_SUPPORT=y
35CONFIG_TRACE_IRQFLAGS_SUPPORT=y
34CONFIG_LOCKDEP_SUPPORT=y 36CONFIG_LOCKDEP_SUPPORT=y
35CONFIG_RWSEM_XCHGADD_ALGORITHM=y 37CONFIG_RWSEM_XCHGADD_ALGORITHM=y
36CONFIG_ARCH_HAS_ILOG2_U32=y 38CONFIG_ARCH_HAS_ILOG2_U32=y
37CONFIG_GENERIC_HWEIGHT=y 39CONFIG_GENERIC_HWEIGHT=y
38CONFIG_GENERIC_CALIBRATE_DELAY=y
39CONFIG_GENERIC_FIND_NEXT_BIT=y 40CONFIG_GENERIC_FIND_NEXT_BIT=y
40# CONFIG_ARCH_NO_VIRT_TO_BUS is not set 41# CONFIG_ARCH_NO_VIRT_TO_BUS is not set
41CONFIG_PPC=y 42CONFIG_PPC=y
@@ -49,11 +50,13 @@ CONFIG_OF=y
49# CONFIG_GENERIC_TBSYNC is not set 50# CONFIG_GENERIC_TBSYNC is not set
50CONFIG_AUDIT_ARCH=y 51CONFIG_AUDIT_ARCH=y
51CONFIG_GENERIC_BUG=y 52CONFIG_GENERIC_BUG=y
53CONFIG_DTC=y
52# CONFIG_DEFAULT_UIMAGE is not set 54# CONFIG_DEFAULT_UIMAGE is not set
53# CONFIG_PPC_DCR_NATIVE is not set 55# CONFIG_PPC_DCR_NATIVE is not set
54# CONFIG_PPC_DCR_MMIO is not set 56# CONFIG_PPC_DCR_MMIO is not set
55CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y 57CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y
56CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" 58CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
59CONFIG_CONSTRUCTORS=y
57 60
58# 61#
59# General setup 62# General setup
@@ -100,7 +103,6 @@ CONFIG_EMBEDDED=y
100CONFIG_KALLSYMS=y 103CONFIG_KALLSYMS=y
101# CONFIG_KALLSYMS_ALL is not set 104# CONFIG_KALLSYMS_ALL is not set
102# CONFIG_KALLSYMS_EXTRA_PASS is not set 105# CONFIG_KALLSYMS_EXTRA_PASS is not set
103# CONFIG_STRIP_ASM_SYMS is not set
104CONFIG_HOTPLUG=y 106CONFIG_HOTPLUG=y
105CONFIG_PRINTK=y 107CONFIG_PRINTK=y
106CONFIG_BUG=y 108CONFIG_BUG=y
@@ -113,8 +115,15 @@ CONFIG_TIMERFD=y
113CONFIG_EVENTFD=y 115CONFIG_EVENTFD=y
114CONFIG_SHMEM=y 116CONFIG_SHMEM=y
115CONFIG_AIO=y 117CONFIG_AIO=y
118CONFIG_HAVE_PERF_COUNTERS=y
119
120#
121# Performance Counters
122#
123# CONFIG_PERF_COUNTERS is not set
116# CONFIG_VM_EVENT_COUNTERS is not set 124# CONFIG_VM_EVENT_COUNTERS is not set
117CONFIG_SLUB_DEBUG=y 125CONFIG_SLUB_DEBUG=y
126# CONFIG_STRIP_ASM_SYMS is not set
118CONFIG_COMPAT_BRK=y 127CONFIG_COMPAT_BRK=y
119# CONFIG_SLAB is not set 128# CONFIG_SLAB is not set
120CONFIG_SLUB=y 129CONFIG_SLUB=y
@@ -128,13 +137,17 @@ CONFIG_HAVE_KPROBES=y
128CONFIG_HAVE_KRETPROBES=y 137CONFIG_HAVE_KRETPROBES=y
129CONFIG_HAVE_ARCH_TRACEHOOK=y 138CONFIG_HAVE_ARCH_TRACEHOOK=y
130CONFIG_HAVE_CLK=y 139CONFIG_HAVE_CLK=y
140
141#
142# GCOV-based kernel profiling
143#
131# CONFIG_SLOW_WORK is not set 144# CONFIG_SLOW_WORK is not set
132# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set 145# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
133CONFIG_SLABINFO=y 146CONFIG_SLABINFO=y
134CONFIG_BASE_SMALL=1 147CONFIG_BASE_SMALL=1
135# CONFIG_MODULES is not set 148# CONFIG_MODULES is not set
136CONFIG_BLOCK=y 149CONFIG_BLOCK=y
137# CONFIG_LBD is not set 150CONFIG_LBDAF=y
138# CONFIG_BLK_DEV_BSG is not set 151# CONFIG_BLK_DEV_BSG is not set
139# CONFIG_BLK_DEV_INTEGRITY is not set 152# CONFIG_BLK_DEV_INTEGRITY is not set
140 153
@@ -220,6 +233,7 @@ CONFIG_BINFMT_ELF=y
220# CONFIG_MATH_EMULATION is not set 233# CONFIG_MATH_EMULATION is not set
221CONFIG_8XX_MINIMAL_FPEMU=y 234CONFIG_8XX_MINIMAL_FPEMU=y
222# CONFIG_IOMMU_HELPER is not set 235# CONFIG_IOMMU_HELPER is not set
236# CONFIG_SWIOTLB is not set
223CONFIG_PPC_NEED_DMA_SYNC_OPS=y 237CONFIG_PPC_NEED_DMA_SYNC_OPS=y
224CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y 238CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
225CONFIG_ARCH_HAS_WALK_MEMORY=y 239CONFIG_ARCH_HAS_WALK_MEMORY=y
@@ -239,9 +253,9 @@ CONFIG_MIGRATION=y
239CONFIG_ZONE_DMA_FLAG=1 253CONFIG_ZONE_DMA_FLAG=1
240CONFIG_BOUNCE=y 254CONFIG_BOUNCE=y
241CONFIG_VIRT_TO_BUS=y 255CONFIG_VIRT_TO_BUS=y
242CONFIG_UNEVICTABLE_LRU=y
243CONFIG_HAVE_MLOCK=y 256CONFIG_HAVE_MLOCK=y
244CONFIG_HAVE_MLOCKED_PAGE_BIT=y 257CONFIG_HAVE_MLOCKED_PAGE_BIT=y
258CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
245CONFIG_PPC_4K_PAGES=y 259CONFIG_PPC_4K_PAGES=y
246# CONFIG_PPC_16K_PAGES is not set 260# CONFIG_PPC_16K_PAGES is not set
247# CONFIG_PPC_64K_PAGES is not set 261# CONFIG_PPC_64K_PAGES is not set
@@ -280,6 +294,7 @@ CONFIG_PAGE_OFFSET=0xc0000000
280CONFIG_KERNEL_START=0xc0000000 294CONFIG_KERNEL_START=0xc0000000
281CONFIG_PHYSICAL_START=0x00000000 295CONFIG_PHYSICAL_START=0x00000000
282CONFIG_TASK_SIZE=0x80000000 296CONFIG_TASK_SIZE=0x80000000
297CONFIG_CONSISTENT_SIZE=0x00200000
283CONFIG_NET=y 298CONFIG_NET=y
284 299
285# 300#
@@ -336,6 +351,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
336# CONFIG_ECONET is not set 351# CONFIG_ECONET is not set
337# CONFIG_WAN_ROUTER is not set 352# CONFIG_WAN_ROUTER is not set
338# CONFIG_PHONET is not set 353# CONFIG_PHONET is not set
354# CONFIG_IEEE802154 is not set
339# CONFIG_NET_SCHED is not set 355# CONFIG_NET_SCHED is not set
340# CONFIG_DCB is not set 356# CONFIG_DCB is not set
341 357
@@ -353,7 +369,11 @@ CONFIG_WIRELESS=y
353CONFIG_WIRELESS_OLD_REGULATORY=y 369CONFIG_WIRELESS_OLD_REGULATORY=y
354# CONFIG_WIRELESS_EXT is not set 370# CONFIG_WIRELESS_EXT is not set
355# CONFIG_LIB80211 is not set 371# CONFIG_LIB80211 is not set
356# CONFIG_MAC80211 is not set 372
373#
374# CFG80211 needs to be enabled for MAC80211
375#
376CONFIG_MAC80211_DEFAULT_PS_VALUE=0
357# CONFIG_WIMAX is not set 377# CONFIG_WIMAX is not set
358# CONFIG_RFKILL is not set 378# CONFIG_RFKILL is not set
359# CONFIG_NET_9P is not set 379# CONFIG_NET_9P is not set
@@ -452,6 +472,7 @@ CONFIG_MTD_PHYSMAP_OF=y
452# 472#
453# CONFIG_MTD_UBI is not set 473# CONFIG_MTD_UBI is not set
454CONFIG_OF_DEVICE=y 474CONFIG_OF_DEVICE=y
475CONFIG_OF_MDIO=y
455# CONFIG_PARPORT is not set 476# CONFIG_PARPORT is not set
456# CONFIG_BLK_DEV is not set 477# CONFIG_BLK_DEV is not set
457# CONFIG_MISC_DEVICES is not set 478# CONFIG_MISC_DEVICES is not set
@@ -469,7 +490,6 @@ CONFIG_HAVE_IDE=y
469# CONFIG_MD is not set 490# CONFIG_MD is not set
470# CONFIG_MACINTOSH_DRIVERS is not set 491# CONFIG_MACINTOSH_DRIVERS is not set
471CONFIG_NETDEVICES=y 492CONFIG_NETDEVICES=y
472CONFIG_COMPAT_NET_DEV_OPS=y
473# CONFIG_DUMMY is not set 493# CONFIG_DUMMY is not set
474# CONFIG_BONDING is not set 494# CONFIG_BONDING is not set
475# CONFIG_MACVLAN is not set 495# CONFIG_MACVLAN is not set
@@ -508,6 +528,7 @@ CONFIG_MII=y
508# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set 528# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set
509# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set 529# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
510# CONFIG_B44 is not set 530# CONFIG_B44 is not set
531# CONFIG_KS8842 is not set
511CONFIG_FS_ENET=y 532CONFIG_FS_ENET=y
512# CONFIG_FS_ENET_HAS_SCC is not set 533# CONFIG_FS_ENET_HAS_SCC is not set
513CONFIG_FS_ENET_HAS_FEC=y 534CONFIG_FS_ENET_HAS_FEC=y
@@ -579,6 +600,11 @@ CONFIG_GEN_RTC=y
579# CONFIG_TCG_TPM is not set 600# CONFIG_TCG_TPM is not set
580# CONFIG_I2C is not set 601# CONFIG_I2C is not set
581# CONFIG_SPI is not set 602# CONFIG_SPI is not set
603
604#
605# PPS support
606#
607# CONFIG_PPS is not set
582CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y 608CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
583# CONFIG_GPIOLIB is not set 609# CONFIG_GPIOLIB is not set
584# CONFIG_W1 is not set 610# CONFIG_W1 is not set
@@ -602,22 +628,7 @@ CONFIG_SSB_POSSIBLE=y
602# CONFIG_HTC_PASIC3 is not set 628# CONFIG_HTC_PASIC3 is not set
603# CONFIG_MFD_TMIO is not set 629# CONFIG_MFD_TMIO is not set
604# CONFIG_REGULATOR is not set 630# CONFIG_REGULATOR is not set
605 631# CONFIG_MEDIA_SUPPORT is not set
606#
607# Multimedia devices
608#
609
610#
611# Multimedia core support
612#
613# CONFIG_VIDEO_DEV is not set
614# CONFIG_DVB_CORE is not set
615# CONFIG_VIDEO_MEDIA is not set
616
617#
618# Multimedia drivers
619#
620CONFIG_DAB=y
621 632
622# 633#
623# Graphics support 634# Graphics support
@@ -642,6 +653,10 @@ CONFIG_DAB=y
642# CONFIG_DMADEVICES is not set 653# CONFIG_DMADEVICES is not set
643# CONFIG_AUXDISPLAY is not set 654# CONFIG_AUXDISPLAY is not set
644# CONFIG_UIO is not set 655# CONFIG_UIO is not set
656
657#
658# TI VLYNQ
659#
645# CONFIG_STAGING is not set 660# CONFIG_STAGING is not set
646 661
647# 662#
@@ -653,12 +668,15 @@ CONFIG_DAB=y
653# CONFIG_REISERFS_FS is not set 668# CONFIG_REISERFS_FS is not set
654# CONFIG_JFS_FS is not set 669# CONFIG_JFS_FS is not set
655# CONFIG_FS_POSIX_ACL is not set 670# CONFIG_FS_POSIX_ACL is not set
656CONFIG_FILE_LOCKING=y
657# CONFIG_XFS_FS is not set 671# CONFIG_XFS_FS is not set
672# CONFIG_GFS2_FS is not set
658# CONFIG_OCFS2_FS is not set 673# CONFIG_OCFS2_FS is not set
659# CONFIG_BTRFS_FS is not set 674# CONFIG_BTRFS_FS is not set
675CONFIG_FILE_LOCKING=y
676CONFIG_FSNOTIFY=y
660# CONFIG_DNOTIFY is not set 677# CONFIG_DNOTIFY is not set
661# CONFIG_INOTIFY is not set 678# CONFIG_INOTIFY is not set
679CONFIG_INOTIFY_USER=y
662# CONFIG_QUOTA is not set 680# CONFIG_QUOTA is not set
663# CONFIG_AUTOFS_FS is not set 681# CONFIG_AUTOFS_FS is not set
664# CONFIG_AUTOFS4_FS is not set 682# CONFIG_AUTOFS4_FS is not set
@@ -775,6 +793,7 @@ CONFIG_HAS_IOPORT=y
775CONFIG_HAS_DMA=y 793CONFIG_HAS_DMA=y
776CONFIG_HAVE_LMB=y 794CONFIG_HAVE_LMB=y
777CONFIG_NLATTR=y 795CONFIG_NLATTR=y
796CONFIG_GENERIC_ATOMIC64=y
778 797
779# 798#
780# Kernel hacking 799# Kernel hacking
@@ -803,6 +822,9 @@ CONFIG_SCHED_DEBUG=y
803# CONFIG_SLUB_STATS is not set 822# CONFIG_SLUB_STATS is not set
804# CONFIG_DEBUG_SPINLOCK is not set 823# CONFIG_DEBUG_SPINLOCK is not set
805# CONFIG_DEBUG_MUTEXES is not set 824# CONFIG_DEBUG_MUTEXES is not set
825# CONFIG_DEBUG_LOCK_ALLOC is not set
826# CONFIG_PROVE_LOCKING is not set
827# CONFIG_LOCK_STAT is not set
806# CONFIG_DEBUG_SPINLOCK_SLEEP is not set 828# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
807# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set 829# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
808# CONFIG_DEBUG_KOBJECT is not set 830# CONFIG_DEBUG_KOBJECT is not set
@@ -814,7 +836,6 @@ CONFIG_DEBUG_INFO=y
814# CONFIG_DEBUG_LIST is not set 836# CONFIG_DEBUG_LIST is not set
815# CONFIG_DEBUG_SG is not set 837# CONFIG_DEBUG_SG is not set
816# CONFIG_DEBUG_NOTIFIERS is not set 838# CONFIG_DEBUG_NOTIFIERS is not set
817# CONFIG_BOOT_PRINTK_DELAY is not set
818# CONFIG_RCU_TORTURE_TEST is not set 839# CONFIG_RCU_TORTURE_TEST is not set
819# CONFIG_RCU_CPU_STALL_DETECTOR is not set 840# CONFIG_RCU_CPU_STALL_DETECTOR is not set
820# CONFIG_BACKTRACE_SELF_TEST is not set 841# CONFIG_BACKTRACE_SELF_TEST is not set
@@ -827,16 +848,15 @@ CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
827CONFIG_HAVE_DYNAMIC_FTRACE=y 848CONFIG_HAVE_DYNAMIC_FTRACE=y
828CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y 849CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
829CONFIG_TRACING_SUPPORT=y 850CONFIG_TRACING_SUPPORT=y
830 851CONFIG_FTRACE=y
831#
832# Tracers
833#
834# CONFIG_FUNCTION_TRACER is not set 852# CONFIG_FUNCTION_TRACER is not set
853# CONFIG_IRQSOFF_TRACER is not set
835# CONFIG_SCHED_TRACER is not set 854# CONFIG_SCHED_TRACER is not set
836# CONFIG_CONTEXT_SWITCH_TRACER is not set 855# CONFIG_ENABLE_DEFAULT_TRACERS is not set
837# CONFIG_EVENT_TRACER is not set
838# CONFIG_BOOT_TRACER is not set 856# CONFIG_BOOT_TRACER is not set
839# CONFIG_TRACE_BRANCH_PROFILING is not set 857CONFIG_BRANCH_PROFILE_NONE=y
858# CONFIG_PROFILE_ANNOTATED_BRANCHES is not set
859# CONFIG_PROFILE_ALL_BRANCHES is not set
840# CONFIG_STACK_TRACER is not set 860# CONFIG_STACK_TRACER is not set
841# CONFIG_KMEMTRACE is not set 861# CONFIG_KMEMTRACE is not set
842# CONFIG_WORKQUEUE_TRACER is not set 862# CONFIG_WORKQUEUE_TRACER is not set
@@ -844,6 +864,9 @@ CONFIG_TRACING_SUPPORT=y
844# CONFIG_SAMPLES is not set 864# CONFIG_SAMPLES is not set
845CONFIG_HAVE_ARCH_KGDB=y 865CONFIG_HAVE_ARCH_KGDB=y
846# CONFIG_KGDB is not set 866# CONFIG_KGDB is not set
867# CONFIG_KMEMCHECK is not set
868# CONFIG_PPC_DISABLE_WERROR is not set
869CONFIG_PPC_WERROR=y
847CONFIG_PRINT_STACK_DEPTH=64 870CONFIG_PRINT_STACK_DEPTH=64
848# CONFIG_DEBUG_STACKOVERFLOW is not set 871# CONFIG_DEBUG_STACKOVERFLOW is not set
849# CONFIG_DEBUG_STACK_USAGE is not set 872# CONFIG_DEBUG_STACK_USAGE is not set
diff --git a/arch/powerpc/configs/linkstation_defconfig b/arch/powerpc/configs/linkstation_defconfig
index a4053ab9e244..45671e7dd2c7 100644
--- a/arch/powerpc/configs/linkstation_defconfig
+++ b/arch/powerpc/configs/linkstation_defconfig
@@ -1,25 +1,27 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.30-rc3 3# Linux kernel version: 2.6.31-rc4
4# Wed May 13 17:21:54 2009 4# Wed Jul 29 23:31:50 2009
5# 5#
6# CONFIG_PPC64 is not set 6# CONFIG_PPC64 is not set
7 7
8# 8#
9# Processor support 9# Processor support
10# 10#
11CONFIG_6xx=y 11CONFIG_PPC_BOOK3S_32=y
12# CONFIG_PPC_85xx is not set 12# CONFIG_PPC_85xx is not set
13# CONFIG_PPC_8xx is not set 13# CONFIG_PPC_8xx is not set
14# CONFIG_40x is not set 14# CONFIG_40x is not set
15# CONFIG_44x is not set 15# CONFIG_44x is not set
16# CONFIG_E200 is not set 16# CONFIG_E200 is not set
17CONFIG_PPC_BOOK3S=y 17CONFIG_PPC_BOOK3S=y
18CONFIG_6xx=y
18CONFIG_PPC_FPU=y 19CONFIG_PPC_FPU=y
19# CONFIG_ALTIVEC is not set 20# CONFIG_ALTIVEC is not set
20CONFIG_PPC_STD_MMU=y 21CONFIG_PPC_STD_MMU=y
21CONFIG_PPC_STD_MMU_32=y 22CONFIG_PPC_STD_MMU_32=y
22# CONFIG_PPC_MM_SLICES is not set 23# CONFIG_PPC_MM_SLICES is not set
24CONFIG_PPC_HAVE_PMU_SUPPORT=y
23# CONFIG_SMP is not set 25# CONFIG_SMP is not set
24CONFIG_PPC32=y 26CONFIG_PPC32=y
25CONFIG_WORD_SIZE=32 27CONFIG_WORD_SIZE=32
@@ -30,15 +32,16 @@ CONFIG_GENERIC_TIME=y
30CONFIG_GENERIC_TIME_VSYSCALL=y 32CONFIG_GENERIC_TIME_VSYSCALL=y
31CONFIG_GENERIC_CLOCKEVENTS=y 33CONFIG_GENERIC_CLOCKEVENTS=y
32CONFIG_GENERIC_HARDIRQS=y 34CONFIG_GENERIC_HARDIRQS=y
35CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
33# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set 36# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set
34CONFIG_IRQ_PER_CPU=y 37CONFIG_IRQ_PER_CPU=y
35CONFIG_STACKTRACE_SUPPORT=y 38CONFIG_STACKTRACE_SUPPORT=y
36CONFIG_HAVE_LATENCYTOP_SUPPORT=y 39CONFIG_HAVE_LATENCYTOP_SUPPORT=y
40CONFIG_TRACE_IRQFLAGS_SUPPORT=y
37CONFIG_LOCKDEP_SUPPORT=y 41CONFIG_LOCKDEP_SUPPORT=y
38CONFIG_RWSEM_XCHGADD_ALGORITHM=y 42CONFIG_RWSEM_XCHGADD_ALGORITHM=y
39CONFIG_ARCH_HAS_ILOG2_U32=y 43CONFIG_ARCH_HAS_ILOG2_U32=y
40CONFIG_GENERIC_HWEIGHT=y 44CONFIG_GENERIC_HWEIGHT=y
41CONFIG_GENERIC_CALIBRATE_DELAY=y
42CONFIG_GENERIC_FIND_NEXT_BIT=y 45CONFIG_GENERIC_FIND_NEXT_BIT=y
43# CONFIG_ARCH_NO_VIRT_TO_BUS is not set 46# CONFIG_ARCH_NO_VIRT_TO_BUS is not set
44CONFIG_PPC=y 47CONFIG_PPC=y
@@ -52,11 +55,13 @@ CONFIG_PPC_UDBG_16550=y
52# CONFIG_GENERIC_TBSYNC is not set 55# CONFIG_GENERIC_TBSYNC is not set
53CONFIG_AUDIT_ARCH=y 56CONFIG_AUDIT_ARCH=y
54CONFIG_GENERIC_BUG=y 57CONFIG_GENERIC_BUG=y
58CONFIG_DTC=y
55CONFIG_DEFAULT_UIMAGE=y 59CONFIG_DEFAULT_UIMAGE=y
56# CONFIG_PPC_DCR_NATIVE is not set 60# CONFIG_PPC_DCR_NATIVE is not set
57# CONFIG_PPC_DCR_MMIO is not set 61# CONFIG_PPC_DCR_MMIO is not set
58CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y 62CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y
59CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" 63CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
64CONFIG_CONSTRUCTORS=y
60 65
61# 66#
62# General setup 67# General setup
@@ -114,7 +119,6 @@ CONFIG_SYSCTL_SYSCALL=y
114CONFIG_KALLSYMS=y 119CONFIG_KALLSYMS=y
115# CONFIG_KALLSYMS_ALL is not set 120# CONFIG_KALLSYMS_ALL is not set
116# CONFIG_KALLSYMS_EXTRA_PASS is not set 121# CONFIG_KALLSYMS_EXTRA_PASS is not set
117# CONFIG_STRIP_ASM_SYMS is not set
118CONFIG_HOTPLUG=y 122CONFIG_HOTPLUG=y
119CONFIG_PRINTK=y 123CONFIG_PRINTK=y
120CONFIG_BUG=y 124CONFIG_BUG=y
@@ -127,9 +131,16 @@ CONFIG_TIMERFD=y
127CONFIG_EVENTFD=y 131CONFIG_EVENTFD=y
128CONFIG_SHMEM=y 132CONFIG_SHMEM=y
129CONFIG_AIO=y 133CONFIG_AIO=y
134CONFIG_HAVE_PERF_COUNTERS=y
135
136#
137# Performance Counters
138#
139# CONFIG_PERF_COUNTERS is not set
130CONFIG_VM_EVENT_COUNTERS=y 140CONFIG_VM_EVENT_COUNTERS=y
131CONFIG_PCI_QUIRKS=y 141CONFIG_PCI_QUIRKS=y
132CONFIG_SLUB_DEBUG=y 142CONFIG_SLUB_DEBUG=y
143# CONFIG_STRIP_ASM_SYMS is not set
133# CONFIG_COMPAT_BRK is not set 144# CONFIG_COMPAT_BRK is not set
134# CONFIG_SLAB is not set 145# CONFIG_SLAB is not set
135CONFIG_SLUB=y 146CONFIG_SLUB=y
@@ -143,6 +154,10 @@ CONFIG_HAVE_IOREMAP_PROT=y
143CONFIG_HAVE_KPROBES=y 154CONFIG_HAVE_KPROBES=y
144CONFIG_HAVE_KRETPROBES=y 155CONFIG_HAVE_KRETPROBES=y
145CONFIG_HAVE_ARCH_TRACEHOOK=y 156CONFIG_HAVE_ARCH_TRACEHOOK=y
157
158#
159# GCOV-based kernel profiling
160#
146# CONFIG_SLOW_WORK is not set 161# CONFIG_SLOW_WORK is not set
147# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set 162# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
148CONFIG_SLABINFO=y 163CONFIG_SLABINFO=y
@@ -155,7 +170,7 @@ CONFIG_MODULE_UNLOAD=y
155# CONFIG_MODVERSIONS is not set 170# CONFIG_MODVERSIONS is not set
156# CONFIG_MODULE_SRCVERSION_ALL is not set 171# CONFIG_MODULE_SRCVERSION_ALL is not set
157CONFIG_BLOCK=y 172CONFIG_BLOCK=y
158# CONFIG_LBD is not set 173CONFIG_LBDAF=y
159# CONFIG_BLK_DEV_BSG is not set 174# CONFIG_BLK_DEV_BSG is not set
160# CONFIG_BLK_DEV_INTEGRITY is not set 175# CONFIG_BLK_DEV_INTEGRITY is not set
161 176
@@ -237,6 +252,7 @@ CONFIG_BINFMT_ELF=y
237# CONFIG_HAVE_AOUT is not set 252# CONFIG_HAVE_AOUT is not set
238# CONFIG_BINFMT_MISC is not set 253# CONFIG_BINFMT_MISC is not set
239# CONFIG_IOMMU_HELPER is not set 254# CONFIG_IOMMU_HELPER is not set
255# CONFIG_SWIOTLB is not set
240CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y 256CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
241CONFIG_ARCH_HAS_WALK_MEMORY=y 257CONFIG_ARCH_HAS_WALK_MEMORY=y
242CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y 258CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y
@@ -257,9 +273,9 @@ CONFIG_MIGRATION=y
257CONFIG_ZONE_DMA_FLAG=1 273CONFIG_ZONE_DMA_FLAG=1
258CONFIG_BOUNCE=y 274CONFIG_BOUNCE=y
259CONFIG_VIRT_TO_BUS=y 275CONFIG_VIRT_TO_BUS=y
260CONFIG_UNEVICTABLE_LRU=y
261CONFIG_HAVE_MLOCK=y 276CONFIG_HAVE_MLOCK=y
262CONFIG_HAVE_MLOCKED_PAGE_BIT=y 277CONFIG_HAVE_MLOCKED_PAGE_BIT=y
278CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
263CONFIG_PPC_4K_PAGES=y 279CONFIG_PPC_4K_PAGES=y
264# CONFIG_PPC_16K_PAGES is not set 280# CONFIG_PPC_16K_PAGES is not set
265# CONFIG_PPC_64K_PAGES is not set 281# CONFIG_PPC_64K_PAGES is not set
@@ -480,6 +496,7 @@ CONFIG_IP_NF_ARP_MANGLE=m
480# CONFIG_ECONET is not set 496# CONFIG_ECONET is not set
481# CONFIG_WAN_ROUTER is not set 497# CONFIG_WAN_ROUTER is not set
482# CONFIG_PHONET is not set 498# CONFIG_PHONET is not set
499# CONFIG_IEEE802154 is not set
483# CONFIG_NET_SCHED is not set 500# CONFIG_NET_SCHED is not set
484# CONFIG_DCB is not set 501# CONFIG_DCB is not set
485 502
@@ -498,7 +515,11 @@ CONFIG_WIRELESS_OLD_REGULATORY=y
498CONFIG_WIRELESS_EXT=y 515CONFIG_WIRELESS_EXT=y
499CONFIG_WIRELESS_EXT_SYSFS=y 516CONFIG_WIRELESS_EXT_SYSFS=y
500# CONFIG_LIB80211 is not set 517# CONFIG_LIB80211 is not set
501# CONFIG_MAC80211 is not set 518
519#
520# CFG80211 needs to be enabled for MAC80211
521#
522CONFIG_MAC80211_DEFAULT_PS_VALUE=0
502# CONFIG_WIMAX is not set 523# CONFIG_WIMAX is not set
503# CONFIG_RFKILL is not set 524# CONFIG_RFKILL is not set
504# CONFIG_NET_9P is not set 525# CONFIG_NET_9P is not set
@@ -647,7 +668,9 @@ CONFIG_MISC_DEVICES=y
647# 668#
648# CONFIG_EEPROM_AT24 is not set 669# CONFIG_EEPROM_AT24 is not set
649CONFIG_EEPROM_LEGACY=m 670CONFIG_EEPROM_LEGACY=m
671# CONFIG_EEPROM_MAX6875 is not set
650# CONFIG_EEPROM_93CX6 is not set 672# CONFIG_EEPROM_93CX6 is not set
673# CONFIG_CB710_CORE is not set
651CONFIG_HAVE_IDE=y 674CONFIG_HAVE_IDE=y
652# CONFIG_IDE is not set 675# CONFIG_IDE is not set
653 676
@@ -670,10 +693,6 @@ CONFIG_BLK_DEV_SD=y
670# CONFIG_BLK_DEV_SR is not set 693# CONFIG_BLK_DEV_SR is not set
671CONFIG_CHR_DEV_SG=y 694CONFIG_CHR_DEV_SG=y
672# CONFIG_CHR_DEV_SCH is not set 695# CONFIG_CHR_DEV_SCH is not set
673
674#
675# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
676#
677CONFIG_SCSI_MULTI_LUN=y 696CONFIG_SCSI_MULTI_LUN=y
678# CONFIG_SCSI_CONSTANTS is not set 697# CONFIG_SCSI_CONSTANTS is not set
679# CONFIG_SCSI_LOGGING is not set 698# CONFIG_SCSI_LOGGING is not set
@@ -691,6 +710,7 @@ CONFIG_SCSI_WAIT_SCAN=m
691CONFIG_SCSI_LOWLEVEL=y 710CONFIG_SCSI_LOWLEVEL=y
692# CONFIG_ISCSI_TCP is not set 711# CONFIG_ISCSI_TCP is not set
693# CONFIG_SCSI_CXGB3_ISCSI is not set 712# CONFIG_SCSI_CXGB3_ISCSI is not set
713# CONFIG_SCSI_BNX2_ISCSI is not set
694# CONFIG_BLK_DEV_3W_XXXX_RAID is not set 714# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
695# CONFIG_SCSI_3W_9XXX is not set 715# CONFIG_SCSI_3W_9XXX is not set
696# CONFIG_SCSI_ACARD is not set 716# CONFIG_SCSI_ACARD is not set
@@ -699,6 +719,7 @@ CONFIG_SCSI_LOWLEVEL=y
699# CONFIG_SCSI_AIC7XXX_OLD is not set 719# CONFIG_SCSI_AIC7XXX_OLD is not set
700# CONFIG_SCSI_AIC79XX is not set 720# CONFIG_SCSI_AIC79XX is not set
701# CONFIG_SCSI_AIC94XX is not set 721# CONFIG_SCSI_AIC94XX is not set
722# CONFIG_SCSI_MVSAS is not set
702# CONFIG_SCSI_DPT_I2O is not set 723# CONFIG_SCSI_DPT_I2O is not set
703# CONFIG_SCSI_ADVANSYS is not set 724# CONFIG_SCSI_ADVANSYS is not set
704# CONFIG_SCSI_ARCMSR is not set 725# CONFIG_SCSI_ARCMSR is not set
@@ -718,7 +739,6 @@ CONFIG_SCSI_LOWLEVEL=y
718# CONFIG_SCSI_IPS is not set 739# CONFIG_SCSI_IPS is not set
719# CONFIG_SCSI_INITIO is not set 740# CONFIG_SCSI_INITIO is not set
720# CONFIG_SCSI_INIA100 is not set 741# CONFIG_SCSI_INIA100 is not set
721# CONFIG_SCSI_MVSAS is not set
722# CONFIG_SCSI_STEX is not set 742# CONFIG_SCSI_STEX is not set
723# CONFIG_SCSI_SYM53C8XX_2 is not set 743# CONFIG_SCSI_SYM53C8XX_2 is not set
724# CONFIG_SCSI_IPR is not set 744# CONFIG_SCSI_IPR is not set
@@ -802,14 +822,17 @@ CONFIG_PATA_SIL680=y
802# 822#
803 823
804# 824#
805# Enable only one of the two stacks, unless you know what you are doing 825# You can enable one or both FireWire driver stacks.
826#
827
828#
829# See the help texts for more information.
806# 830#
807# CONFIG_FIREWIRE is not set 831# CONFIG_FIREWIRE is not set
808# CONFIG_IEEE1394 is not set 832# CONFIG_IEEE1394 is not set
809# CONFIG_I2O is not set 833# CONFIG_I2O is not set
810# CONFIG_MACINTOSH_DRIVERS is not set 834# CONFIG_MACINTOSH_DRIVERS is not set
811CONFIG_NETDEVICES=y 835CONFIG_NETDEVICES=y
812CONFIG_COMPAT_NET_DEV_OPS=y
813# CONFIG_DUMMY is not set 836# CONFIG_DUMMY is not set
814# CONFIG_BONDING is not set 837# CONFIG_BONDING is not set
815# CONFIG_MACVLAN is not set 838# CONFIG_MACVLAN is not set
@@ -846,6 +869,7 @@ CONFIG_TULIP_MMIO=y
846# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set 869# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
847# CONFIG_NET_PCI is not set 870# CONFIG_NET_PCI is not set
848# CONFIG_B44 is not set 871# CONFIG_B44 is not set
872# CONFIG_KS8842 is not set
849# CONFIG_ATL2 is not set 873# CONFIG_ATL2 is not set
850CONFIG_NETDEV_1000=y 874CONFIG_NETDEV_1000=y
851# CONFIG_ACENIC is not set 875# CONFIG_ACENIC is not set
@@ -865,8 +889,10 @@ CONFIG_R8169=y
865# CONFIG_VIA_VELOCITY is not set 889# CONFIG_VIA_VELOCITY is not set
866# CONFIG_TIGON3 is not set 890# CONFIG_TIGON3 is not set
867# CONFIG_BNX2 is not set 891# CONFIG_BNX2 is not set
892# CONFIG_CNIC is not set
868# CONFIG_FSL_PQ_MDIO is not set 893# CONFIG_FSL_PQ_MDIO is not set
869# CONFIG_GIANFAR is not set 894# CONFIG_GIANFAR is not set
895# CONFIG_MV643XX_ETH is not set
870# CONFIG_QLA3XXX is not set 896# CONFIG_QLA3XXX is not set
871# CONFIG_ATL1 is not set 897# CONFIG_ATL1 is not set
872# CONFIG_ATL1E is not set 898# CONFIG_ATL1E is not set
@@ -1074,13 +1100,17 @@ CONFIG_I2C_MPC=y
1074# CONFIG_SENSORS_PCF8574 is not set 1100# CONFIG_SENSORS_PCF8574 is not set
1075# CONFIG_PCF8575 is not set 1101# CONFIG_PCF8575 is not set
1076# CONFIG_SENSORS_PCA9539 is not set 1102# CONFIG_SENSORS_PCA9539 is not set
1077# CONFIG_SENSORS_MAX6875 is not set
1078# CONFIG_SENSORS_TSL2550 is not set 1103# CONFIG_SENSORS_TSL2550 is not set
1079# CONFIG_I2C_DEBUG_CORE is not set 1104# CONFIG_I2C_DEBUG_CORE is not set
1080# CONFIG_I2C_DEBUG_ALGO is not set 1105# CONFIG_I2C_DEBUG_ALGO is not set
1081# CONFIG_I2C_DEBUG_BUS is not set 1106# CONFIG_I2C_DEBUG_BUS is not set
1082# CONFIG_I2C_DEBUG_CHIP is not set 1107# CONFIG_I2C_DEBUG_CHIP is not set
1083# CONFIG_SPI is not set 1108# CONFIG_SPI is not set
1109
1110#
1111# PPS support
1112#
1113# CONFIG_PPS is not set
1084CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y 1114CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
1085# CONFIG_GPIOLIB is not set 1115# CONFIG_GPIOLIB is not set
1086# CONFIG_W1 is not set 1116# CONFIG_W1 is not set
@@ -1135,6 +1165,7 @@ CONFIG_HWMON=y
1135# CONFIG_SENSORS_SMSC47B397 is not set 1165# CONFIG_SENSORS_SMSC47B397 is not set
1136# CONFIG_SENSORS_ADS7828 is not set 1166# CONFIG_SENSORS_ADS7828 is not set
1137# CONFIG_SENSORS_THMC50 is not set 1167# CONFIG_SENSORS_THMC50 is not set
1168# CONFIG_SENSORS_TMP401 is not set
1138# CONFIG_SENSORS_VIA686A is not set 1169# CONFIG_SENSORS_VIA686A is not set
1139# CONFIG_SENSORS_VT1211 is not set 1170# CONFIG_SENSORS_VT1211 is not set
1140# CONFIG_SENSORS_VT8231 is not set 1171# CONFIG_SENSORS_VT8231 is not set
@@ -1169,23 +1200,9 @@ CONFIG_SSB_POSSIBLE=y
1169# CONFIG_MFD_WM8400 is not set 1200# CONFIG_MFD_WM8400 is not set
1170# CONFIG_MFD_WM8350_I2C is not set 1201# CONFIG_MFD_WM8350_I2C is not set
1171# CONFIG_MFD_PCF50633 is not set 1202# CONFIG_MFD_PCF50633 is not set
1203# CONFIG_AB3100_CORE is not set
1172# CONFIG_REGULATOR is not set 1204# CONFIG_REGULATOR is not set
1173 1205# CONFIG_MEDIA_SUPPORT is not set
1174#
1175# Multimedia devices
1176#
1177
1178#
1179# Multimedia core support
1180#
1181# CONFIG_VIDEO_DEV is not set
1182# CONFIG_DVB_CORE is not set
1183# CONFIG_VIDEO_MEDIA is not set
1184
1185#
1186# Multimedia drivers
1187#
1188# CONFIG_DAB is not set
1189 1206
1190# 1207#
1191# Graphics support 1208# Graphics support
@@ -1245,6 +1262,7 @@ CONFIG_USB_MON=y
1245# USB Host Controller Drivers 1262# USB Host Controller Drivers
1246# 1263#
1247# CONFIG_USB_C67X00_HCD is not set 1264# CONFIG_USB_C67X00_HCD is not set
1265# CONFIG_USB_XHCI_HCD is not set
1248CONFIG_USB_EHCI_HCD=y 1266CONFIG_USB_EHCI_HCD=y
1249# CONFIG_USB_EHCI_ROOT_HUB_TT is not set 1267# CONFIG_USB_EHCI_ROOT_HUB_TT is not set
1250# CONFIG_USB_EHCI_TT_NEWSCHED is not set 1268# CONFIG_USB_EHCI_TT_NEWSCHED is not set
@@ -1254,9 +1272,9 @@ CONFIG_USB_EHCI_HCD_PPC_OF=y
1254# CONFIG_USB_ISP116X_HCD is not set 1272# CONFIG_USB_ISP116X_HCD is not set
1255# CONFIG_USB_ISP1760_HCD is not set 1273# CONFIG_USB_ISP1760_HCD is not set
1256CONFIG_USB_OHCI_HCD=y 1274CONFIG_USB_OHCI_HCD=y
1257CONFIG_USB_OHCI_HCD_PPC_OF=y
1258CONFIG_USB_OHCI_HCD_PPC_OF_BE=y 1275CONFIG_USB_OHCI_HCD_PPC_OF_BE=y
1259# CONFIG_USB_OHCI_HCD_PPC_OF_LE is not set 1276# CONFIG_USB_OHCI_HCD_PPC_OF_LE is not set
1277CONFIG_USB_OHCI_HCD_PPC_OF=y
1260CONFIG_USB_OHCI_HCD_PCI=y 1278CONFIG_USB_OHCI_HCD_PCI=y
1261CONFIG_USB_OHCI_BIG_ENDIAN_DESC=y 1279CONFIG_USB_OHCI_BIG_ENDIAN_DESC=y
1262CONFIG_USB_OHCI_BIG_ENDIAN_MMIO=y 1280CONFIG_USB_OHCI_BIG_ENDIAN_MMIO=y
@@ -1423,6 +1441,7 @@ CONFIG_RTC_DRV_RS5C372=y
1423# CONFIG_RTC_DRV_S35390A is not set 1441# CONFIG_RTC_DRV_S35390A is not set
1424# CONFIG_RTC_DRV_FM3130 is not set 1442# CONFIG_RTC_DRV_FM3130 is not set
1425# CONFIG_RTC_DRV_RX8581 is not set 1443# CONFIG_RTC_DRV_RX8581 is not set
1444# CONFIG_RTC_DRV_RX8025 is not set
1426 1445
1427# 1446#
1428# SPI RTC drivers 1447# SPI RTC drivers
@@ -1450,6 +1469,10 @@ CONFIG_RTC_DRV_RS5C372=y
1450# CONFIG_DMADEVICES is not set 1469# CONFIG_DMADEVICES is not set
1451# CONFIG_AUXDISPLAY is not set 1470# CONFIG_AUXDISPLAY is not set
1452# CONFIG_UIO is not set 1471# CONFIG_UIO is not set
1472
1473#
1474# TI VLYNQ
1475#
1453# CONFIG_STAGING is not set 1476# CONFIG_STAGING is not set
1454 1477
1455# 1478#
@@ -1469,14 +1492,16 @@ CONFIG_FS_MBCACHE=y
1469# CONFIG_REISERFS_FS is not set 1492# CONFIG_REISERFS_FS is not set
1470# CONFIG_JFS_FS is not set 1493# CONFIG_JFS_FS is not set
1471CONFIG_FS_POSIX_ACL=y 1494CONFIG_FS_POSIX_ACL=y
1472CONFIG_FILE_LOCKING=y
1473CONFIG_XFS_FS=m 1495CONFIG_XFS_FS=m
1474# CONFIG_XFS_QUOTA is not set 1496# CONFIG_XFS_QUOTA is not set
1475# CONFIG_XFS_POSIX_ACL is not set 1497# CONFIG_XFS_POSIX_ACL is not set
1476# CONFIG_XFS_RT is not set 1498# CONFIG_XFS_RT is not set
1477# CONFIG_XFS_DEBUG is not set 1499# CONFIG_XFS_DEBUG is not set
1500# CONFIG_GFS2_FS is not set
1478# CONFIG_OCFS2_FS is not set 1501# CONFIG_OCFS2_FS is not set
1479# CONFIG_BTRFS_FS is not set 1502# CONFIG_BTRFS_FS is not set
1503CONFIG_FILE_LOCKING=y
1504CONFIG_FSNOTIFY=y
1480CONFIG_DNOTIFY=y 1505CONFIG_DNOTIFY=y
1481CONFIG_INOTIFY=y 1506CONFIG_INOTIFY=y
1482CONFIG_INOTIFY_USER=y 1507CONFIG_INOTIFY_USER=y
@@ -1548,6 +1573,7 @@ CONFIG_NFS_FS=y
1548CONFIG_NFS_V3=y 1573CONFIG_NFS_V3=y
1549CONFIG_NFS_V3_ACL=y 1574CONFIG_NFS_V3_ACL=y
1550CONFIG_NFS_V4=y 1575CONFIG_NFS_V4=y
1576# CONFIG_NFS_V4_1 is not set
1551CONFIG_ROOT_NFS=y 1577CONFIG_ROOT_NFS=y
1552CONFIG_NFSD=m 1578CONFIG_NFSD=m
1553CONFIG_NFSD_V3=y 1579CONFIG_NFSD_V3=y
@@ -1578,7 +1604,7 @@ CONFIG_CIFS=m
1578# 1604#
1579# CONFIG_PARTITION_ADVANCED is not set 1605# CONFIG_PARTITION_ADVANCED is not set
1580CONFIG_MSDOS_PARTITION=y 1606CONFIG_MSDOS_PARTITION=y
1581CONFIG_NLS=m 1607CONFIG_NLS=y
1582CONFIG_NLS_DEFAULT="iso8859-1" 1608CONFIG_NLS_DEFAULT="iso8859-1"
1583CONFIG_NLS_CODEPAGE_437=m 1609CONFIG_NLS_CODEPAGE_437=m
1584# CONFIG_NLS_CODEPAGE_737 is not set 1610# CONFIG_NLS_CODEPAGE_737 is not set
@@ -1645,6 +1671,7 @@ CONFIG_HAS_IOPORT=y
1645CONFIG_HAS_DMA=y 1671CONFIG_HAS_DMA=y
1646CONFIG_HAVE_LMB=y 1672CONFIG_HAVE_LMB=y
1647CONFIG_NLATTR=y 1673CONFIG_NLATTR=y
1674CONFIG_GENERIC_ATOMIC64=y
1648 1675
1649# 1676#
1650# Kernel hacking 1677# Kernel hacking
@@ -1675,6 +1702,9 @@ CONFIG_SCHED_DEBUG=y
1675# CONFIG_RT_MUTEX_TESTER is not set 1702# CONFIG_RT_MUTEX_TESTER is not set
1676# CONFIG_DEBUG_SPINLOCK is not set 1703# CONFIG_DEBUG_SPINLOCK is not set
1677# CONFIG_DEBUG_MUTEXES is not set 1704# CONFIG_DEBUG_MUTEXES is not set
1705# CONFIG_DEBUG_LOCK_ALLOC is not set
1706# CONFIG_PROVE_LOCKING is not set
1707# CONFIG_LOCK_STAT is not set
1678# CONFIG_DEBUG_SPINLOCK_SLEEP is not set 1708# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
1679# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set 1709# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
1680# CONFIG_DEBUG_KOBJECT is not set 1710# CONFIG_DEBUG_KOBJECT is not set
@@ -1686,7 +1716,6 @@ CONFIG_DEBUG_MEMORY_INIT=y
1686# CONFIG_DEBUG_LIST is not set 1716# CONFIG_DEBUG_LIST is not set
1687# CONFIG_DEBUG_SG is not set 1717# CONFIG_DEBUG_SG is not set
1688# CONFIG_DEBUG_NOTIFIERS is not set 1718# CONFIG_DEBUG_NOTIFIERS is not set
1689# CONFIG_BOOT_PRINTK_DELAY is not set
1690# CONFIG_RCU_TORTURE_TEST is not set 1719# CONFIG_RCU_TORTURE_TEST is not set
1691# CONFIG_RCU_CPU_STALL_DETECTOR is not set 1720# CONFIG_RCU_CPU_STALL_DETECTOR is not set
1692# CONFIG_BACKTRACE_SELF_TEST is not set 1721# CONFIG_BACKTRACE_SELF_TEST is not set
@@ -1700,16 +1729,15 @@ CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
1700CONFIG_HAVE_DYNAMIC_FTRACE=y 1729CONFIG_HAVE_DYNAMIC_FTRACE=y
1701CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y 1730CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
1702CONFIG_TRACING_SUPPORT=y 1731CONFIG_TRACING_SUPPORT=y
1703 1732CONFIG_FTRACE=y
1704#
1705# Tracers
1706#
1707# CONFIG_FUNCTION_TRACER is not set 1733# CONFIG_FUNCTION_TRACER is not set
1734# CONFIG_IRQSOFF_TRACER is not set
1708# CONFIG_SCHED_TRACER is not set 1735# CONFIG_SCHED_TRACER is not set
1709# CONFIG_CONTEXT_SWITCH_TRACER is not set 1736# CONFIG_ENABLE_DEFAULT_TRACERS is not set
1710# CONFIG_EVENT_TRACER is not set
1711# CONFIG_BOOT_TRACER is not set 1737# CONFIG_BOOT_TRACER is not set
1712# CONFIG_TRACE_BRANCH_PROFILING is not set 1738CONFIG_BRANCH_PROFILE_NONE=y
1739# CONFIG_PROFILE_ANNOTATED_BRANCHES is not set
1740# CONFIG_PROFILE_ALL_BRANCHES is not set
1713# CONFIG_STACK_TRACER is not set 1741# CONFIG_STACK_TRACER is not set
1714# CONFIG_KMEMTRACE is not set 1742# CONFIG_KMEMTRACE is not set
1715# CONFIG_WORKQUEUE_TRACER is not set 1743# CONFIG_WORKQUEUE_TRACER is not set
@@ -1717,6 +1745,8 @@ CONFIG_TRACING_SUPPORT=y
1717# CONFIG_SAMPLES is not set 1745# CONFIG_SAMPLES is not set
1718CONFIG_HAVE_ARCH_KGDB=y 1746CONFIG_HAVE_ARCH_KGDB=y
1719# CONFIG_KGDB is not set 1747# CONFIG_KGDB is not set
1748# CONFIG_PPC_DISABLE_WERROR is not set
1749CONFIG_PPC_WERROR=y
1720CONFIG_PRINT_STACK_DEPTH=64 1750CONFIG_PRINT_STACK_DEPTH=64
1721# CONFIG_DEBUG_STACKOVERFLOW is not set 1751# CONFIG_DEBUG_STACKOVERFLOW is not set
1722# CONFIG_DEBUG_STACK_USAGE is not set 1752# CONFIG_DEBUG_STACK_USAGE is not set
diff --git a/arch/powerpc/configs/mgcoge_defconfig b/arch/powerpc/configs/mgcoge_defconfig
index 31e1df665157..e9491c1c3f31 100644
--- a/arch/powerpc/configs/mgcoge_defconfig
+++ b/arch/powerpc/configs/mgcoge_defconfig
@@ -1,25 +1,27 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.30-rc3 3# Linux kernel version: 2.6.31-rc4
4# Wed May 13 17:21:55 2009 4# Wed Jul 29 23:31:51 2009
5# 5#
6# CONFIG_PPC64 is not set 6# CONFIG_PPC64 is not set
7 7
8# 8#
9# Processor support 9# Processor support
10# 10#
11CONFIG_6xx=y 11CONFIG_PPC_BOOK3S_32=y
12# CONFIG_PPC_85xx is not set 12# CONFIG_PPC_85xx is not set
13# CONFIG_PPC_8xx is not set 13# CONFIG_PPC_8xx is not set
14# CONFIG_40x is not set 14# CONFIG_40x is not set
15# CONFIG_44x is not set 15# CONFIG_44x is not set
16# CONFIG_E200 is not set 16# CONFIG_E200 is not set
17CONFIG_PPC_BOOK3S=y 17CONFIG_PPC_BOOK3S=y
18CONFIG_6xx=y
18CONFIG_PPC_FPU=y 19CONFIG_PPC_FPU=y
19# CONFIG_ALTIVEC is not set 20# CONFIG_ALTIVEC is not set
20CONFIG_PPC_STD_MMU=y 21CONFIG_PPC_STD_MMU=y
21CONFIG_PPC_STD_MMU_32=y 22CONFIG_PPC_STD_MMU_32=y
22# CONFIG_PPC_MM_SLICES is not set 23# CONFIG_PPC_MM_SLICES is not set
24CONFIG_PPC_HAVE_PMU_SUPPORT=y
23# CONFIG_SMP is not set 25# CONFIG_SMP is not set
24CONFIG_PPC32=y 26CONFIG_PPC32=y
25CONFIG_WORD_SIZE=32 27CONFIG_WORD_SIZE=32
@@ -30,15 +32,16 @@ CONFIG_GENERIC_TIME=y
30CONFIG_GENERIC_TIME_VSYSCALL=y 32CONFIG_GENERIC_TIME_VSYSCALL=y
31CONFIG_GENERIC_CLOCKEVENTS=y 33CONFIG_GENERIC_CLOCKEVENTS=y
32CONFIG_GENERIC_HARDIRQS=y 34CONFIG_GENERIC_HARDIRQS=y
35CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
33# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set 36# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set
34CONFIG_IRQ_PER_CPU=y 37CONFIG_IRQ_PER_CPU=y
35CONFIG_STACKTRACE_SUPPORT=y 38CONFIG_STACKTRACE_SUPPORT=y
36CONFIG_HAVE_LATENCYTOP_SUPPORT=y 39CONFIG_HAVE_LATENCYTOP_SUPPORT=y
40CONFIG_TRACE_IRQFLAGS_SUPPORT=y
37CONFIG_LOCKDEP_SUPPORT=y 41CONFIG_LOCKDEP_SUPPORT=y
38CONFIG_RWSEM_XCHGADD_ALGORITHM=y 42CONFIG_RWSEM_XCHGADD_ALGORITHM=y
39CONFIG_ARCH_HAS_ILOG2_U32=y 43CONFIG_ARCH_HAS_ILOG2_U32=y
40CONFIG_GENERIC_HWEIGHT=y 44CONFIG_GENERIC_HWEIGHT=y
41CONFIG_GENERIC_CALIBRATE_DELAY=y
42CONFIG_GENERIC_FIND_NEXT_BIT=y 45CONFIG_GENERIC_FIND_NEXT_BIT=y
43CONFIG_GENERIC_GPIO=y 46CONFIG_GENERIC_GPIO=y
44# CONFIG_ARCH_NO_VIRT_TO_BUS is not set 47# CONFIG_ARCH_NO_VIRT_TO_BUS is not set
@@ -53,6 +56,7 @@ CONFIG_PPC_UDBG_16550=y
53# CONFIG_GENERIC_TBSYNC is not set 56# CONFIG_GENERIC_TBSYNC is not set
54CONFIG_AUDIT_ARCH=y 57CONFIG_AUDIT_ARCH=y
55CONFIG_GENERIC_BUG=y 58CONFIG_GENERIC_BUG=y
59CONFIG_DTC=y
56# CONFIG_DEFAULT_UIMAGE is not set 60# CONFIG_DEFAULT_UIMAGE is not set
57CONFIG_HIBERNATE_32=y 61CONFIG_HIBERNATE_32=y
58CONFIG_ARCH_HIBERNATION_POSSIBLE=y 62CONFIG_ARCH_HIBERNATION_POSSIBLE=y
@@ -60,6 +64,7 @@ CONFIG_ARCH_HIBERNATION_POSSIBLE=y
60# CONFIG_PPC_DCR_MMIO is not set 64# CONFIG_PPC_DCR_MMIO is not set
61CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y 65CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y
62CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" 66CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
67CONFIG_CONSTRUCTORS=y
63 68
64# 69#
65# General setup 70# General setup
@@ -105,7 +110,6 @@ CONFIG_SYSCTL_SYSCALL=y
105CONFIG_KALLSYMS=y 110CONFIG_KALLSYMS=y
106CONFIG_KALLSYMS_ALL=y 111CONFIG_KALLSYMS_ALL=y
107# CONFIG_KALLSYMS_EXTRA_PASS is not set 112# CONFIG_KALLSYMS_EXTRA_PASS is not set
108# CONFIG_STRIP_ASM_SYMS is not set
109CONFIG_HOTPLUG=y 113CONFIG_HOTPLUG=y
110CONFIG_PRINTK=y 114CONFIG_PRINTK=y
111CONFIG_BUG=y 115CONFIG_BUG=y
@@ -119,8 +123,15 @@ CONFIG_TIMERFD=y
119CONFIG_EVENTFD=y 123CONFIG_EVENTFD=y
120CONFIG_SHMEM=y 124CONFIG_SHMEM=y
121CONFIG_AIO=y 125CONFIG_AIO=y
126CONFIG_HAVE_PERF_COUNTERS=y
127
128#
129# Performance Counters
130#
131# CONFIG_PERF_COUNTERS is not set
122CONFIG_VM_EVENT_COUNTERS=y 132CONFIG_VM_EVENT_COUNTERS=y
123CONFIG_PCI_QUIRKS=y 133CONFIG_PCI_QUIRKS=y
134# CONFIG_STRIP_ASM_SYMS is not set
124CONFIG_COMPAT_BRK=y 135CONFIG_COMPAT_BRK=y
125CONFIG_SLAB=y 136CONFIG_SLAB=y
126# CONFIG_SLUB is not set 137# CONFIG_SLUB is not set
@@ -134,6 +145,11 @@ CONFIG_HAVE_KPROBES=y
134CONFIG_HAVE_KRETPROBES=y 145CONFIG_HAVE_KRETPROBES=y
135CONFIG_HAVE_ARCH_TRACEHOOK=y 146CONFIG_HAVE_ARCH_TRACEHOOK=y
136CONFIG_HAVE_CLK=y 147CONFIG_HAVE_CLK=y
148
149#
150# GCOV-based kernel profiling
151#
152# CONFIG_GCOV_KERNEL is not set
137# CONFIG_SLOW_WORK is not set 153# CONFIG_SLOW_WORK is not set
138# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set 154# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
139CONFIG_SLABINFO=y 155CONFIG_SLABINFO=y
@@ -141,7 +157,7 @@ CONFIG_RT_MUTEXES=y
141CONFIG_BASE_SMALL=0 157CONFIG_BASE_SMALL=0
142# CONFIG_MODULES is not set 158# CONFIG_MODULES is not set
143CONFIG_BLOCK=y 159CONFIG_BLOCK=y
144# CONFIG_LBD is not set 160CONFIG_LBDAF=y
145# CONFIG_BLK_DEV_INTEGRITY is not set 161# CONFIG_BLK_DEV_INTEGRITY is not set
146 162
147# 163#
@@ -225,6 +241,7 @@ CONFIG_BINFMT_ELF=y
225# CONFIG_HAVE_AOUT is not set 241# CONFIG_HAVE_AOUT is not set
226CONFIG_BINFMT_MISC=y 242CONFIG_BINFMT_MISC=y
227# CONFIG_IOMMU_HELPER is not set 243# CONFIG_IOMMU_HELPER is not set
244# CONFIG_SWIOTLB is not set
228CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y 245CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
229CONFIG_ARCH_HAS_WALK_MEMORY=y 246CONFIG_ARCH_HAS_WALK_MEMORY=y
230CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y 247CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y
@@ -240,9 +257,9 @@ CONFIG_MIGRATION=y
240CONFIG_ZONE_DMA_FLAG=1 257CONFIG_ZONE_DMA_FLAG=1
241CONFIG_BOUNCE=y 258CONFIG_BOUNCE=y
242CONFIG_VIRT_TO_BUS=y 259CONFIG_VIRT_TO_BUS=y
243CONFIG_UNEVICTABLE_LRU=y
244CONFIG_HAVE_MLOCK=y 260CONFIG_HAVE_MLOCK=y
245CONFIG_HAVE_MLOCKED_PAGE_BIT=y 261CONFIG_HAVE_MLOCKED_PAGE_BIT=y
262CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
246CONFIG_PPC_4K_PAGES=y 263CONFIG_PPC_4K_PAGES=y
247# CONFIG_PPC_16K_PAGES is not set 264# CONFIG_PPC_16K_PAGES is not set
248# CONFIG_PPC_64K_PAGES is not set 265# CONFIG_PPC_64K_PAGES is not set
@@ -313,6 +330,7 @@ CONFIG_IP_PNP_BOOTP=y
313# CONFIG_NET_IPIP is not set 330# CONFIG_NET_IPIP is not set
314# CONFIG_NET_IPGRE is not set 331# CONFIG_NET_IPGRE is not set
315# CONFIG_IP_MROUTE is not set 332# CONFIG_IP_MROUTE is not set
333# CONFIG_ARPD is not set
316CONFIG_SYN_COOKIES=y 334CONFIG_SYN_COOKIES=y
317# CONFIG_INET_AH is not set 335# CONFIG_INET_AH is not set
318# CONFIG_INET_ESP is not set 336# CONFIG_INET_ESP is not set
@@ -374,7 +392,11 @@ CONFIG_WIRELESS=y
374CONFIG_WIRELESS_OLD_REGULATORY=y 392CONFIG_WIRELESS_OLD_REGULATORY=y
375# CONFIG_WIRELESS_EXT is not set 393# CONFIG_WIRELESS_EXT is not set
376# CONFIG_LIB80211 is not set 394# CONFIG_LIB80211 is not set
377# CONFIG_MAC80211 is not set 395
396#
397# CFG80211 needs to be enabled for MAC80211
398#
399CONFIG_MAC80211_DEFAULT_PS_VALUE=0
378# CONFIG_WIMAX is not set 400# CONFIG_WIMAX is not set
379# CONFIG_RFKILL is not set 401# CONFIG_RFKILL is not set
380 402
@@ -484,6 +506,7 @@ CONFIG_MTD_PHYSMAP_OF=y
484# CONFIG_MTD_UBI is not set 506# CONFIG_MTD_UBI is not set
485CONFIG_OF_DEVICE=y 507CONFIG_OF_DEVICE=y
486CONFIG_OF_GPIO=y 508CONFIG_OF_GPIO=y
509CONFIG_OF_MDIO=y
487# CONFIG_PARPORT is not set 510# CONFIG_PARPORT is not set
488CONFIG_BLK_DEV=y 511CONFIG_BLK_DEV=y
489# CONFIG_BLK_DEV_FD is not set 512# CONFIG_BLK_DEV_FD is not set
@@ -523,13 +546,17 @@ CONFIG_HAVE_IDE=y
523# 546#
524 547
525# 548#
526# A new alternative FireWire stack is available with EXPERIMENTAL=y 549# You can enable one or both FireWire driver stacks.
527# 550#
551
552#
553# See the help texts for more information.
554#
555# CONFIG_FIREWIRE is not set
528# CONFIG_IEEE1394 is not set 556# CONFIG_IEEE1394 is not set
529# CONFIG_I2O is not set 557# CONFIG_I2O is not set
530# CONFIG_MACINTOSH_DRIVERS is not set 558# CONFIG_MACINTOSH_DRIVERS is not set
531CONFIG_NETDEVICES=y 559CONFIG_NETDEVICES=y
532CONFIG_COMPAT_NET_DEV_OPS=y
533# CONFIG_DUMMY is not set 560# CONFIG_DUMMY is not set
534# CONFIG_BONDING is not set 561# CONFIG_BONDING is not set
535# CONFIG_EQUALIZER is not set 562# CONFIG_EQUALIZER is not set
@@ -577,6 +604,7 @@ CONFIG_MII=y
577# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set 604# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
578# CONFIG_NET_PCI is not set 605# CONFIG_NET_PCI is not set
579# CONFIG_B44 is not set 606# CONFIG_B44 is not set
607# CONFIG_KS8842 is not set
580# CONFIG_ATL2 is not set 608# CONFIG_ATL2 is not set
581CONFIG_FS_ENET=y 609CONFIG_FS_ENET=y
582CONFIG_FS_ENET_HAS_SCC=y 610CONFIG_FS_ENET_HAS_SCC=y
@@ -654,6 +682,10 @@ CONFIG_HW_RANDOM=y
654CONFIG_DEVPORT=y 682CONFIG_DEVPORT=y
655# CONFIG_I2C is not set 683# CONFIG_I2C is not set
656# CONFIG_SPI is not set 684# CONFIG_SPI is not set
685
686#
687# PPS support
688#
657CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y 689CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
658CONFIG_ARCH_REQUIRE_GPIOLIB=y 690CONFIG_ARCH_REQUIRE_GPIOLIB=y
659CONFIG_GPIOLIB=y 691CONFIG_GPIOLIB=y
@@ -697,22 +729,7 @@ CONFIG_SSB_POSSIBLE=y
697# CONFIG_HTC_PASIC3 is not set 729# CONFIG_HTC_PASIC3 is not set
698# CONFIG_MFD_TMIO is not set 730# CONFIG_MFD_TMIO is not set
699# CONFIG_REGULATOR is not set 731# CONFIG_REGULATOR is not set
700 732# CONFIG_MEDIA_SUPPORT is not set
701#
702# Multimedia devices
703#
704
705#
706# Multimedia core support
707#
708# CONFIG_VIDEO_DEV is not set
709# CONFIG_DVB_CORE is not set
710# CONFIG_VIDEO_MEDIA is not set
711
712#
713# Multimedia drivers
714#
715# CONFIG_DAB is not set
716 733
717# 734#
718# Graphics support 735# Graphics support
@@ -740,6 +757,10 @@ CONFIG_SSB_POSSIBLE=y
740# CONFIG_DMADEVICES is not set 757# CONFIG_DMADEVICES is not set
741# CONFIG_AUXDISPLAY is not set 758# CONFIG_AUXDISPLAY is not set
742# CONFIG_UIO is not set 759# CONFIG_UIO is not set
760
761#
762# TI VLYNQ
763#
743# CONFIG_STAGING is not set 764# CONFIG_STAGING is not set
744 765
745# 766#
@@ -757,9 +778,10 @@ CONFIG_JBD=y
757# CONFIG_REISERFS_FS is not set 778# CONFIG_REISERFS_FS is not set
758# CONFIG_JFS_FS is not set 779# CONFIG_JFS_FS is not set
759# CONFIG_FS_POSIX_ACL is not set 780# CONFIG_FS_POSIX_ACL is not set
760CONFIG_FILE_LOCKING=y
761# CONFIG_XFS_FS is not set 781# CONFIG_XFS_FS is not set
762# CONFIG_OCFS2_FS is not set 782# CONFIG_OCFS2_FS is not set
783CONFIG_FILE_LOCKING=y
784CONFIG_FSNOTIFY=y
763CONFIG_DNOTIFY=y 785CONFIG_DNOTIFY=y
764CONFIG_INOTIFY=y 786CONFIG_INOTIFY=y
765CONFIG_INOTIFY_USER=y 787CONFIG_INOTIFY_USER=y
@@ -916,6 +938,7 @@ CONFIG_HAS_IOPORT=y
916CONFIG_HAS_DMA=y 938CONFIG_HAS_DMA=y
917CONFIG_HAVE_LMB=y 939CONFIG_HAVE_LMB=y
918CONFIG_NLATTR=y 940CONFIG_NLATTR=y
941CONFIG_GENERIC_ATOMIC64=y
919 942
920# 943#
921# Kernel hacking 944# Kernel hacking
@@ -941,6 +964,9 @@ CONFIG_DEBUG_KERNEL=y
941# CONFIG_RT_MUTEX_TESTER is not set 964# CONFIG_RT_MUTEX_TESTER is not set
942# CONFIG_DEBUG_SPINLOCK is not set 965# CONFIG_DEBUG_SPINLOCK is not set
943# CONFIG_DEBUG_MUTEXES is not set 966# CONFIG_DEBUG_MUTEXES is not set
967# CONFIG_DEBUG_LOCK_ALLOC is not set
968# CONFIG_PROVE_LOCKING is not set
969# CONFIG_LOCK_STAT is not set
944# CONFIG_DEBUG_SPINLOCK_SLEEP is not set 970# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
945# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set 971# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
946# CONFIG_DEBUG_KOBJECT is not set 972# CONFIG_DEBUG_KOBJECT is not set
@@ -952,7 +978,6 @@ CONFIG_DEBUG_INFO=y
952# CONFIG_DEBUG_LIST is not set 978# CONFIG_DEBUG_LIST is not set
953# CONFIG_DEBUG_SG is not set 979# CONFIG_DEBUG_SG is not set
954# CONFIG_DEBUG_NOTIFIERS is not set 980# CONFIG_DEBUG_NOTIFIERS is not set
955# CONFIG_BOOT_PRINTK_DELAY is not set
956# CONFIG_RCU_TORTURE_TEST is not set 981# CONFIG_RCU_TORTURE_TEST is not set
957# CONFIG_RCU_CPU_STALL_DETECTOR is not set 982# CONFIG_RCU_CPU_STALL_DETECTOR is not set
958# CONFIG_BACKTRACE_SELF_TEST is not set 983# CONFIG_BACKTRACE_SELF_TEST is not set
@@ -966,16 +991,15 @@ CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
966CONFIG_HAVE_DYNAMIC_FTRACE=y 991CONFIG_HAVE_DYNAMIC_FTRACE=y
967CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y 992CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
968CONFIG_TRACING_SUPPORT=y 993CONFIG_TRACING_SUPPORT=y
969 994CONFIG_FTRACE=y
970#
971# Tracers
972#
973# CONFIG_FUNCTION_TRACER is not set 995# CONFIG_FUNCTION_TRACER is not set
996# CONFIG_IRQSOFF_TRACER is not set
974# CONFIG_SCHED_TRACER is not set 997# CONFIG_SCHED_TRACER is not set
975# CONFIG_CONTEXT_SWITCH_TRACER is not set 998# CONFIG_ENABLE_DEFAULT_TRACERS is not set
976# CONFIG_EVENT_TRACER is not set
977# CONFIG_BOOT_TRACER is not set 999# CONFIG_BOOT_TRACER is not set
978# CONFIG_TRACE_BRANCH_PROFILING is not set 1000CONFIG_BRANCH_PROFILE_NONE=y
1001# CONFIG_PROFILE_ANNOTATED_BRANCHES is not set
1002# CONFIG_PROFILE_ALL_BRANCHES is not set
979# CONFIG_STACK_TRACER is not set 1003# CONFIG_STACK_TRACER is not set
980# CONFIG_KMEMTRACE is not set 1004# CONFIG_KMEMTRACE is not set
981# CONFIG_WORKQUEUE_TRACER is not set 1005# CONFIG_WORKQUEUE_TRACER is not set
@@ -983,9 +1007,12 @@ CONFIG_TRACING_SUPPORT=y
983# CONFIG_DYNAMIC_DEBUG is not set 1007# CONFIG_DYNAMIC_DEBUG is not set
984# CONFIG_SAMPLES is not set 1008# CONFIG_SAMPLES is not set
985CONFIG_HAVE_ARCH_KGDB=y 1009CONFIG_HAVE_ARCH_KGDB=y
1010# CONFIG_PPC_DISABLE_WERROR is not set
1011CONFIG_PPC_WERROR=y
986CONFIG_PRINT_STACK_DEPTH=64 1012CONFIG_PRINT_STACK_DEPTH=64
987# CONFIG_DEBUG_STACKOVERFLOW is not set 1013# CONFIG_DEBUG_STACKOVERFLOW is not set
988# CONFIG_DEBUG_STACK_USAGE is not set 1014# CONFIG_DEBUG_STACK_USAGE is not set
1015# CONFIG_PPC_EMULATED_STATS is not set
989# CONFIG_CODE_PATCHING_SELFTEST is not set 1016# CONFIG_CODE_PATCHING_SELFTEST is not set
990# CONFIG_FTR_FIXUP_SELFTEST is not set 1017# CONFIG_FTR_FIXUP_SELFTEST is not set
991# CONFIG_MSI_BITMAP_SELFTEST is not set 1018# CONFIG_MSI_BITMAP_SELFTEST is not set
diff --git a/arch/powerpc/configs/mgsuvd_defconfig b/arch/powerpc/configs/mgsuvd_defconfig
index 24fa90792c54..1ae85a3b2942 100644
--- a/arch/powerpc/configs/mgsuvd_defconfig
+++ b/arch/powerpc/configs/mgsuvd_defconfig
@@ -1,14 +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.30-rc3 3# Linux kernel version: 2.6.31-rc4
4# Wed May 13 17:21:55 2009 4# Wed Jul 29 23:31:52 2009
5# 5#
6# CONFIG_PPC64 is not set 6# CONFIG_PPC64 is not set
7 7
8# 8#
9# Processor support 9# Processor support
10# 10#
11# CONFIG_6xx is not set 11# CONFIG_PPC_BOOK3S_32 is not set
12# CONFIG_PPC_85xx is not set 12# CONFIG_PPC_85xx is not set
13CONFIG_PPC_8xx=y 13CONFIG_PPC_8xx=y
14# CONFIG_40x is not set 14# CONFIG_40x is not set
@@ -27,15 +27,16 @@ CONFIG_GENERIC_TIME=y
27CONFIG_GENERIC_TIME_VSYSCALL=y 27CONFIG_GENERIC_TIME_VSYSCALL=y
28CONFIG_GENERIC_CLOCKEVENTS=y 28CONFIG_GENERIC_CLOCKEVENTS=y
29CONFIG_GENERIC_HARDIRQS=y 29CONFIG_GENERIC_HARDIRQS=y
30CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
30# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set 31# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set
31CONFIG_IRQ_PER_CPU=y 32CONFIG_IRQ_PER_CPU=y
32CONFIG_STACKTRACE_SUPPORT=y 33CONFIG_STACKTRACE_SUPPORT=y
33CONFIG_HAVE_LATENCYTOP_SUPPORT=y 34CONFIG_HAVE_LATENCYTOP_SUPPORT=y
35CONFIG_TRACE_IRQFLAGS_SUPPORT=y
34CONFIG_LOCKDEP_SUPPORT=y 36CONFIG_LOCKDEP_SUPPORT=y
35CONFIG_RWSEM_XCHGADD_ALGORITHM=y 37CONFIG_RWSEM_XCHGADD_ALGORITHM=y
36CONFIG_ARCH_HAS_ILOG2_U32=y 38CONFIG_ARCH_HAS_ILOG2_U32=y
37CONFIG_GENERIC_HWEIGHT=y 39CONFIG_GENERIC_HWEIGHT=y
38CONFIG_GENERIC_CALIBRATE_DELAY=y
39CONFIG_GENERIC_FIND_NEXT_BIT=y 40CONFIG_GENERIC_FIND_NEXT_BIT=y
40# CONFIG_ARCH_NO_VIRT_TO_BUS is not set 41# CONFIG_ARCH_NO_VIRT_TO_BUS is not set
41CONFIG_PPC=y 42CONFIG_PPC=y
@@ -48,11 +49,13 @@ CONFIG_OF=y
48# CONFIG_PPC_UDBG_16550 is not set 49# CONFIG_PPC_UDBG_16550 is not set
49# CONFIG_GENERIC_TBSYNC is not set 50# CONFIG_GENERIC_TBSYNC is not set
50CONFIG_AUDIT_ARCH=y 51CONFIG_AUDIT_ARCH=y
52CONFIG_DTC=y
51# CONFIG_DEFAULT_UIMAGE is not set 53# CONFIG_DEFAULT_UIMAGE is not set
52# CONFIG_PPC_DCR_NATIVE is not set 54# CONFIG_PPC_DCR_NATIVE is not set
53# CONFIG_PPC_DCR_MMIO is not set 55# CONFIG_PPC_DCR_MMIO is not set
54CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y 56CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y
55CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" 57CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
58CONFIG_CONSTRUCTORS=y
56 59
57# 60#
58# General setup 61# General setup
@@ -102,7 +105,6 @@ CONFIG_EMBEDDED=y
102# CONFIG_SYSCTL_SYSCALL is not set 105# CONFIG_SYSCTL_SYSCALL is not set
103CONFIG_KALLSYMS=y 106CONFIG_KALLSYMS=y
104# CONFIG_KALLSYMS_EXTRA_PASS is not set 107# CONFIG_KALLSYMS_EXTRA_PASS is not set
105# CONFIG_STRIP_ASM_SYMS is not set
106# CONFIG_HOTPLUG is not set 108# CONFIG_HOTPLUG is not set
107CONFIG_PRINTK=y 109CONFIG_PRINTK=y
108# CONFIG_BUG is not set 110# CONFIG_BUG is not set
@@ -115,7 +117,14 @@ CONFIG_TIMERFD=y
115CONFIG_EVENTFD=y 117CONFIG_EVENTFD=y
116CONFIG_SHMEM=y 118CONFIG_SHMEM=y
117CONFIG_AIO=y 119CONFIG_AIO=y
120CONFIG_HAVE_PERF_COUNTERS=y
121
122#
123# Performance Counters
124#
125# CONFIG_PERF_COUNTERS is not set
118# CONFIG_VM_EVENT_COUNTERS is not set 126# CONFIG_VM_EVENT_COUNTERS is not set
127# CONFIG_STRIP_ASM_SYMS is not set
119CONFIG_COMPAT_BRK=y 128CONFIG_COMPAT_BRK=y
120CONFIG_SLAB=y 129CONFIG_SLAB=y
121# CONFIG_SLUB is not set 130# CONFIG_SLUB is not set
@@ -129,6 +138,11 @@ CONFIG_HAVE_KPROBES=y
129CONFIG_HAVE_KRETPROBES=y 138CONFIG_HAVE_KRETPROBES=y
130CONFIG_HAVE_ARCH_TRACEHOOK=y 139CONFIG_HAVE_ARCH_TRACEHOOK=y
131CONFIG_HAVE_CLK=y 140CONFIG_HAVE_CLK=y
141
142#
143# GCOV-based kernel profiling
144#
145# CONFIG_GCOV_KERNEL is not set
132# CONFIG_SLOW_WORK is not set 146# CONFIG_SLOW_WORK is not set
133# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set 147# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
134CONFIG_SLABINFO=y 148CONFIG_SLABINFO=y
@@ -136,7 +150,7 @@ CONFIG_RT_MUTEXES=y
136CONFIG_BASE_SMALL=1 150CONFIG_BASE_SMALL=1
137# CONFIG_MODULES is not set 151# CONFIG_MODULES is not set
138CONFIG_BLOCK=y 152CONFIG_BLOCK=y
139# CONFIG_LBD is not set 153CONFIG_LBDAF=y
140# CONFIG_BLK_DEV_BSG is not set 154# CONFIG_BLK_DEV_BSG is not set
141# CONFIG_BLK_DEV_INTEGRITY is not set 155# CONFIG_BLK_DEV_INTEGRITY is not set
142 156
@@ -222,6 +236,7 @@ CONFIG_BINFMT_ELF=y
222# CONFIG_BINFMT_MISC is not set 236# CONFIG_BINFMT_MISC is not set
223CONFIG_MATH_EMULATION=y 237CONFIG_MATH_EMULATION=y
224# CONFIG_IOMMU_HELPER is not set 238# CONFIG_IOMMU_HELPER is not set
239# CONFIG_SWIOTLB is not set
225CONFIG_PPC_NEED_DMA_SYNC_OPS=y 240CONFIG_PPC_NEED_DMA_SYNC_OPS=y
226CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y 241CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
227CONFIG_ARCH_HAS_WALK_MEMORY=y 242CONFIG_ARCH_HAS_WALK_MEMORY=y
@@ -241,9 +256,9 @@ CONFIG_MIGRATION=y
241CONFIG_ZONE_DMA_FLAG=1 256CONFIG_ZONE_DMA_FLAG=1
242CONFIG_BOUNCE=y 257CONFIG_BOUNCE=y
243CONFIG_VIRT_TO_BUS=y 258CONFIG_VIRT_TO_BUS=y
244CONFIG_UNEVICTABLE_LRU=y
245CONFIG_HAVE_MLOCK=y 259CONFIG_HAVE_MLOCK=y
246CONFIG_HAVE_MLOCKED_PAGE_BIT=y 260CONFIG_HAVE_MLOCKED_PAGE_BIT=y
261CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
247CONFIG_PPC_4K_PAGES=y 262CONFIG_PPC_4K_PAGES=y
248# CONFIG_PPC_16K_PAGES is not set 263# CONFIG_PPC_16K_PAGES is not set
249# CONFIG_PPC_64K_PAGES is not set 264# CONFIG_PPC_64K_PAGES is not set
@@ -281,6 +296,7 @@ CONFIG_PAGE_OFFSET=0xc0000000
281CONFIG_KERNEL_START=0xc0000000 296CONFIG_KERNEL_START=0xc0000000
282CONFIG_PHYSICAL_START=0x00000000 297CONFIG_PHYSICAL_START=0x00000000
283CONFIG_TASK_SIZE=0x80000000 298CONFIG_TASK_SIZE=0x80000000
299CONFIG_CONSISTENT_SIZE=0x00200000
284CONFIG_NET=y 300CONFIG_NET=y
285 301
286# 302#
@@ -342,6 +358,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
342# CONFIG_ECONET is not set 358# CONFIG_ECONET is not set
343# CONFIG_WAN_ROUTER is not set 359# CONFIG_WAN_ROUTER is not set
344# CONFIG_PHONET is not set 360# CONFIG_PHONET is not set
361# CONFIG_IEEE802154 is not set
345# CONFIG_NET_SCHED is not set 362# CONFIG_NET_SCHED is not set
346# CONFIG_DCB is not set 363# CONFIG_DCB is not set
347 364
@@ -359,7 +376,11 @@ CONFIG_WIRELESS=y
359CONFIG_WIRELESS_OLD_REGULATORY=y 376CONFIG_WIRELESS_OLD_REGULATORY=y
360# CONFIG_WIRELESS_EXT is not set 377# CONFIG_WIRELESS_EXT is not set
361# CONFIG_LIB80211 is not set 378# CONFIG_LIB80211 is not set
362# CONFIG_MAC80211 is not set 379
380#
381# CFG80211 needs to be enabled for MAC80211
382#
383CONFIG_MAC80211_DEFAULT_PS_VALUE=0
363# CONFIG_WIMAX is not set 384# CONFIG_WIMAX is not set
364# CONFIG_RFKILL is not set 385# CONFIG_RFKILL is not set
365# CONFIG_NET_9P is not set 386# CONFIG_NET_9P is not set
@@ -463,6 +484,7 @@ CONFIG_MTD_PHYSMAP_OF=y
463# 484#
464# CONFIG_MTD_UBI is not set 485# CONFIG_MTD_UBI is not set
465CONFIG_OF_DEVICE=y 486CONFIG_OF_DEVICE=y
487CONFIG_OF_MDIO=y
466# CONFIG_PARPORT is not set 488# CONFIG_PARPORT is not set
467CONFIG_BLK_DEV=y 489CONFIG_BLK_DEV=y
468# CONFIG_BLK_DEV_FD is not set 490# CONFIG_BLK_DEV_FD is not set
@@ -492,7 +514,6 @@ CONFIG_HAVE_IDE=y
492# CONFIG_MD is not set 514# CONFIG_MD is not set
493# CONFIG_MACINTOSH_DRIVERS is not set 515# CONFIG_MACINTOSH_DRIVERS is not set
494CONFIG_NETDEVICES=y 516CONFIG_NETDEVICES=y
495CONFIG_COMPAT_NET_DEV_OPS=y
496# CONFIG_DUMMY is not set 517# CONFIG_DUMMY is not set
497# CONFIG_BONDING is not set 518# CONFIG_BONDING is not set
498# CONFIG_MACVLAN is not set 519# CONFIG_MACVLAN is not set
@@ -531,6 +552,7 @@ CONFIG_MII=y
531# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set 552# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set
532# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set 553# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
533# CONFIG_B44 is not set 554# CONFIG_B44 is not set
555# CONFIG_KS8842 is not set
534CONFIG_FS_ENET=y 556CONFIG_FS_ENET=y
535CONFIG_FS_ENET_HAS_SCC=y 557CONFIG_FS_ENET_HAS_SCC=y
536# CONFIG_FS_ENET_HAS_FEC is not set 558# CONFIG_FS_ENET_HAS_FEC is not set
@@ -602,6 +624,11 @@ CONFIG_GEN_RTC=y
602# CONFIG_TCG_TPM is not set 624# CONFIG_TCG_TPM is not set
603# CONFIG_I2C is not set 625# CONFIG_I2C is not set
604# CONFIG_SPI is not set 626# CONFIG_SPI is not set
627
628#
629# PPS support
630#
631# CONFIG_PPS is not set
605CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y 632CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
606# CONFIG_GPIOLIB is not set 633# CONFIG_GPIOLIB is not set
607# CONFIG_W1 is not set 634# CONFIG_W1 is not set
@@ -625,22 +652,7 @@ CONFIG_SSB_POSSIBLE=y
625# CONFIG_HTC_PASIC3 is not set 652# CONFIG_HTC_PASIC3 is not set
626# CONFIG_MFD_TMIO is not set 653# CONFIG_MFD_TMIO is not set
627# CONFIG_REGULATOR is not set 654# CONFIG_REGULATOR is not set
628 655# CONFIG_MEDIA_SUPPORT is not set
629#
630# Multimedia devices
631#
632
633#
634# Multimedia core support
635#
636# CONFIG_VIDEO_DEV is not set
637# CONFIG_DVB_CORE is not set
638# CONFIG_VIDEO_MEDIA is not set
639
640#
641# Multimedia drivers
642#
643# CONFIG_DAB is not set
644 656
645# 657#
646# Graphics support 658# Graphics support
@@ -665,6 +677,10 @@ CONFIG_SSB_POSSIBLE=y
665# CONFIG_DMADEVICES is not set 677# CONFIG_DMADEVICES is not set
666# CONFIG_AUXDISPLAY is not set 678# CONFIG_AUXDISPLAY is not set
667# CONFIG_UIO is not set 679# CONFIG_UIO is not set
680
681#
682# TI VLYNQ
683#
668# CONFIG_STAGING is not set 684# CONFIG_STAGING is not set
669 685
670# 686#
@@ -687,10 +703,12 @@ CONFIG_FS_MBCACHE=y
687# CONFIG_REISERFS_FS is not set 703# CONFIG_REISERFS_FS is not set
688# CONFIG_JFS_FS is not set 704# CONFIG_JFS_FS is not set
689# CONFIG_FS_POSIX_ACL is not set 705# CONFIG_FS_POSIX_ACL is not set
690CONFIG_FILE_LOCKING=y
691# CONFIG_XFS_FS is not set 706# CONFIG_XFS_FS is not set
707# CONFIG_GFS2_FS is not set
692# CONFIG_OCFS2_FS is not set 708# CONFIG_OCFS2_FS is not set
693# CONFIG_BTRFS_FS is not set 709# CONFIG_BTRFS_FS is not set
710CONFIG_FILE_LOCKING=y
711CONFIG_FSNOTIFY=y
694CONFIG_DNOTIFY=y 712CONFIG_DNOTIFY=y
695CONFIG_INOTIFY=y 713CONFIG_INOTIFY=y
696CONFIG_INOTIFY_USER=y 714CONFIG_INOTIFY_USER=y
@@ -823,6 +841,7 @@ CONFIG_HAS_IOPORT=y
823CONFIG_HAS_DMA=y 841CONFIG_HAS_DMA=y
824CONFIG_HAVE_LMB=y 842CONFIG_HAVE_LMB=y
825CONFIG_NLATTR=y 843CONFIG_NLATTR=y
844CONFIG_GENERIC_ATOMIC64=y
826 845
827# 846#
828# Kernel hacking 847# Kernel hacking
@@ -844,24 +863,14 @@ CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
844CONFIG_HAVE_DYNAMIC_FTRACE=y 863CONFIG_HAVE_DYNAMIC_FTRACE=y
845CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y 864CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
846CONFIG_TRACING_SUPPORT=y 865CONFIG_TRACING_SUPPORT=y
847 866# CONFIG_FTRACE is not set
848#
849# Tracers
850#
851# CONFIG_FUNCTION_TRACER is not set
852# CONFIG_SCHED_TRACER is not set
853# CONFIG_CONTEXT_SWITCH_TRACER is not set
854# CONFIG_EVENT_TRACER is not set
855# CONFIG_BOOT_TRACER is not set
856# CONFIG_TRACE_BRANCH_PROFILING is not set
857# CONFIG_STACK_TRACER is not set
858# CONFIG_KMEMTRACE is not set
859# CONFIG_WORKQUEUE_TRACER is not set
860# CONFIG_BLK_DEV_IO_TRACE is not set
861# CONFIG_DYNAMIC_DEBUG is not set 867# CONFIG_DYNAMIC_DEBUG is not set
862# CONFIG_SAMPLES is not set 868# CONFIG_SAMPLES is not set
863CONFIG_HAVE_ARCH_KGDB=y 869CONFIG_HAVE_ARCH_KGDB=y
870# CONFIG_PPC_DISABLE_WERROR is not set
871CONFIG_PPC_WERROR=y
864CONFIG_PRINT_STACK_DEPTH=64 872CONFIG_PRINT_STACK_DEPTH=64
873# CONFIG_PPC_EMULATED_STATS is not set
865# CONFIG_IRQSTACKS is not set 874# CONFIG_IRQSTACKS is not set
866# CONFIG_VIRQ_DEBUG is not set 875# CONFIG_VIRQ_DEBUG is not set
867# CONFIG_PPC_EARLY_DEBUG is not set 876# CONFIG_PPC_EARLY_DEBUG is not set
diff --git a/arch/powerpc/configs/mpc7448_hpc2_defconfig b/arch/powerpc/configs/mpc7448_hpc2_defconfig
index 642ab67c8431..f23428c3b34e 100644
--- a/arch/powerpc/configs/mpc7448_hpc2_defconfig
+++ b/arch/powerpc/configs/mpc7448_hpc2_defconfig
@@ -1,25 +1,27 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.30-rc3 3# Linux kernel version: 2.6.31-rc4
4# Wed May 13 17:21:56 2009 4# Wed Jul 29 23:31:53 2009
5# 5#
6# CONFIG_PPC64 is not set 6# CONFIG_PPC64 is not set
7 7
8# 8#
9# Processor support 9# Processor support
10# 10#
11CONFIG_6xx=y 11CONFIG_PPC_BOOK3S_32=y
12# CONFIG_PPC_85xx is not set 12# CONFIG_PPC_85xx is not set
13# CONFIG_PPC_8xx is not set 13# CONFIG_PPC_8xx is not set
14# CONFIG_40x is not set 14# CONFIG_40x is not set
15# CONFIG_44x is not set 15# CONFIG_44x is not set
16# CONFIG_E200 is not set 16# CONFIG_E200 is not set
17CONFIG_PPC_BOOK3S=y 17CONFIG_PPC_BOOK3S=y
18CONFIG_6xx=y
18CONFIG_PPC_FPU=y 19CONFIG_PPC_FPU=y
19CONFIG_ALTIVEC=y 20CONFIG_ALTIVEC=y
20CONFIG_PPC_STD_MMU=y 21CONFIG_PPC_STD_MMU=y
21CONFIG_PPC_STD_MMU_32=y 22CONFIG_PPC_STD_MMU_32=y
22# CONFIG_PPC_MM_SLICES is not set 23# CONFIG_PPC_MM_SLICES is not set
24CONFIG_PPC_HAVE_PMU_SUPPORT=y
23# CONFIG_SMP is not set 25# CONFIG_SMP is not set
24CONFIG_PPC32=y 26CONFIG_PPC32=y
25CONFIG_WORD_SIZE=32 27CONFIG_WORD_SIZE=32
@@ -30,15 +32,16 @@ CONFIG_GENERIC_TIME=y
30CONFIG_GENERIC_TIME_VSYSCALL=y 32CONFIG_GENERIC_TIME_VSYSCALL=y
31CONFIG_GENERIC_CLOCKEVENTS=y 33CONFIG_GENERIC_CLOCKEVENTS=y
32CONFIG_GENERIC_HARDIRQS=y 34CONFIG_GENERIC_HARDIRQS=y
35CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
33# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set 36# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set
34CONFIG_IRQ_PER_CPU=y 37CONFIG_IRQ_PER_CPU=y
35CONFIG_STACKTRACE_SUPPORT=y 38CONFIG_STACKTRACE_SUPPORT=y
36CONFIG_HAVE_LATENCYTOP_SUPPORT=y 39CONFIG_HAVE_LATENCYTOP_SUPPORT=y
40CONFIG_TRACE_IRQFLAGS_SUPPORT=y
37CONFIG_LOCKDEP_SUPPORT=y 41CONFIG_LOCKDEP_SUPPORT=y
38CONFIG_RWSEM_XCHGADD_ALGORITHM=y 42CONFIG_RWSEM_XCHGADD_ALGORITHM=y
39CONFIG_ARCH_HAS_ILOG2_U32=y 43CONFIG_ARCH_HAS_ILOG2_U32=y
40CONFIG_GENERIC_HWEIGHT=y 44CONFIG_GENERIC_HWEIGHT=y
41CONFIG_GENERIC_CALIBRATE_DELAY=y
42CONFIG_GENERIC_FIND_NEXT_BIT=y 45CONFIG_GENERIC_FIND_NEXT_BIT=y
43# CONFIG_ARCH_NO_VIRT_TO_BUS is not set 46# CONFIG_ARCH_NO_VIRT_TO_BUS is not set
44CONFIG_PPC=y 47CONFIG_PPC=y
@@ -52,11 +55,13 @@ CONFIG_PPC_UDBG_16550=y
52# CONFIG_GENERIC_TBSYNC is not set 55# CONFIG_GENERIC_TBSYNC is not set
53CONFIG_AUDIT_ARCH=y 56CONFIG_AUDIT_ARCH=y
54CONFIG_GENERIC_BUG=y 57CONFIG_GENERIC_BUG=y
58CONFIG_DTC=y
55CONFIG_DEFAULT_UIMAGE=y 59CONFIG_DEFAULT_UIMAGE=y
56# CONFIG_PPC_DCR_NATIVE is not set 60# CONFIG_PPC_DCR_NATIVE is not set
57# CONFIG_PPC_DCR_MMIO is not set 61# CONFIG_PPC_DCR_MMIO is not set
58CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y 62CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y
59CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" 63CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
64CONFIG_CONSTRUCTORS=y
60 65
61# 66#
62# General setup 67# General setup
@@ -106,7 +111,6 @@ CONFIG_EMBEDDED=y
106CONFIG_SYSCTL_SYSCALL=y 111CONFIG_SYSCTL_SYSCALL=y
107CONFIG_KALLSYMS=y 112CONFIG_KALLSYMS=y
108# CONFIG_KALLSYMS_EXTRA_PASS is not set 113# CONFIG_KALLSYMS_EXTRA_PASS is not set
109# CONFIG_STRIP_ASM_SYMS is not set
110CONFIG_HOTPLUG=y 114CONFIG_HOTPLUG=y
111CONFIG_PRINTK=y 115CONFIG_PRINTK=y
112CONFIG_BUG=y 116CONFIG_BUG=y
@@ -119,9 +123,16 @@ CONFIG_TIMERFD=y
119CONFIG_EVENTFD=y 123CONFIG_EVENTFD=y
120CONFIG_SHMEM=y 124CONFIG_SHMEM=y
121CONFIG_AIO=y 125CONFIG_AIO=y
126CONFIG_HAVE_PERF_COUNTERS=y
127
128#
129# Performance Counters
130#
131# CONFIG_PERF_COUNTERS is not set
122CONFIG_VM_EVENT_COUNTERS=y 132CONFIG_VM_EVENT_COUNTERS=y
123CONFIG_PCI_QUIRKS=y 133CONFIG_PCI_QUIRKS=y
124CONFIG_SLUB_DEBUG=y 134CONFIG_SLUB_DEBUG=y
135# CONFIG_STRIP_ASM_SYMS is not set
125CONFIG_COMPAT_BRK=y 136CONFIG_COMPAT_BRK=y
126# CONFIG_SLAB is not set 137# CONFIG_SLAB is not set
127CONFIG_SLUB=y 138CONFIG_SLUB=y
@@ -134,6 +145,10 @@ CONFIG_HAVE_IOREMAP_PROT=y
134CONFIG_HAVE_KPROBES=y 145CONFIG_HAVE_KPROBES=y
135CONFIG_HAVE_KRETPROBES=y 146CONFIG_HAVE_KRETPROBES=y
136CONFIG_HAVE_ARCH_TRACEHOOK=y 147CONFIG_HAVE_ARCH_TRACEHOOK=y
148
149#
150# GCOV-based kernel profiling
151#
137# CONFIG_SLOW_WORK is not set 152# CONFIG_SLOW_WORK is not set
138# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set 153# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
139CONFIG_SLABINFO=y 154CONFIG_SLABINFO=y
@@ -141,7 +156,7 @@ CONFIG_RT_MUTEXES=y
141CONFIG_BASE_SMALL=0 156CONFIG_BASE_SMALL=0
142# CONFIG_MODULES is not set 157# CONFIG_MODULES is not set
143CONFIG_BLOCK=y 158CONFIG_BLOCK=y
144CONFIG_LBD=y 159CONFIG_LBDAF=y
145# CONFIG_BLK_DEV_BSG is not set 160# CONFIG_BLK_DEV_BSG is not set
146# CONFIG_BLK_DEV_INTEGRITY is not set 161# CONFIG_BLK_DEV_INTEGRITY is not set
147 162
@@ -220,6 +235,7 @@ CONFIG_BINFMT_ELF=y
220# CONFIG_HAVE_AOUT is not set 235# CONFIG_HAVE_AOUT is not set
221CONFIG_BINFMT_MISC=y 236CONFIG_BINFMT_MISC=y
222# CONFIG_IOMMU_HELPER is not set 237# CONFIG_IOMMU_HELPER is not set
238# CONFIG_SWIOTLB is not set
223CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y 239CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
224CONFIG_ARCH_HAS_WALK_MEMORY=y 240CONFIG_ARCH_HAS_WALK_MEMORY=y
225CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y 241CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y
@@ -240,9 +256,9 @@ CONFIG_MIGRATION=y
240CONFIG_ZONE_DMA_FLAG=1 256CONFIG_ZONE_DMA_FLAG=1
241CONFIG_BOUNCE=y 257CONFIG_BOUNCE=y
242CONFIG_VIRT_TO_BUS=y 258CONFIG_VIRT_TO_BUS=y
243CONFIG_UNEVICTABLE_LRU=y
244CONFIG_HAVE_MLOCK=y 259CONFIG_HAVE_MLOCK=y
245CONFIG_HAVE_MLOCKED_PAGE_BIT=y 260CONFIG_HAVE_MLOCKED_PAGE_BIT=y
261CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
246CONFIG_PPC_4K_PAGES=y 262CONFIG_PPC_4K_PAGES=y
247# CONFIG_PPC_16K_PAGES is not set 263# CONFIG_PPC_16K_PAGES is not set
248# CONFIG_PPC_64K_PAGES is not set 264# CONFIG_PPC_64K_PAGES is not set
@@ -348,6 +364,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
348# CONFIG_ECONET is not set 364# CONFIG_ECONET is not set
349# CONFIG_WAN_ROUTER is not set 365# CONFIG_WAN_ROUTER is not set
350# CONFIG_PHONET is not set 366# CONFIG_PHONET is not set
367# CONFIG_IEEE802154 is not set
351# CONFIG_NET_SCHED is not set 368# CONFIG_NET_SCHED is not set
352# CONFIG_DCB is not set 369# CONFIG_DCB is not set
353 370
@@ -365,7 +382,11 @@ CONFIG_WIRELESS=y
365CONFIG_WIRELESS_OLD_REGULATORY=y 382CONFIG_WIRELESS_OLD_REGULATORY=y
366# CONFIG_WIRELESS_EXT is not set 383# CONFIG_WIRELESS_EXT is not set
367# CONFIG_LIB80211 is not set 384# CONFIG_LIB80211 is not set
368# CONFIG_MAC80211 is not set 385
386#
387# CFG80211 needs to be enabled for MAC80211
388#
389CONFIG_MAC80211_DEFAULT_PS_VALUE=0
369# CONFIG_WIMAX is not set 390# CONFIG_WIMAX is not set
370# CONFIG_RFKILL is not set 391# CONFIG_RFKILL is not set
371# CONFIG_NET_9P is not set 392# CONFIG_NET_9P is not set
@@ -385,6 +406,7 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y
385# CONFIG_CONNECTOR is not set 406# CONFIG_CONNECTOR is not set
386# CONFIG_MTD is not set 407# CONFIG_MTD is not set
387CONFIG_OF_DEVICE=y 408CONFIG_OF_DEVICE=y
409CONFIG_OF_MDIO=y
388# CONFIG_PARPORT is not set 410# CONFIG_PARPORT is not set
389CONFIG_BLK_DEV=y 411CONFIG_BLK_DEV=y
390# CONFIG_BLK_DEV_FD is not set 412# CONFIG_BLK_DEV_FD is not set
@@ -416,6 +438,7 @@ CONFIG_MISC_DEVICES=y
416# EEPROM support 438# EEPROM support
417# 439#
418# CONFIG_EEPROM_93CX6 is not set 440# CONFIG_EEPROM_93CX6 is not set
441# CONFIG_CB710_CORE is not set
419CONFIG_HAVE_IDE=y 442CONFIG_HAVE_IDE=y
420# CONFIG_IDE is not set 443# CONFIG_IDE is not set
421 444
@@ -438,10 +461,6 @@ CONFIG_BLK_DEV_SD=y
438# CONFIG_BLK_DEV_SR is not set 461# CONFIG_BLK_DEV_SR is not set
439# CONFIG_CHR_DEV_SG is not set 462# CONFIG_CHR_DEV_SG is not set
440# CONFIG_CHR_DEV_SCH is not set 463# CONFIG_CHR_DEV_SCH is not set
441
442#
443# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
444#
445# CONFIG_SCSI_MULTI_LUN is not set 464# CONFIG_SCSI_MULTI_LUN is not set
446# CONFIG_SCSI_CONSTANTS is not set 465# CONFIG_SCSI_CONSTANTS is not set
447# CONFIG_SCSI_LOGGING is not set 466# CONFIG_SCSI_LOGGING is not set
@@ -458,6 +477,7 @@ CONFIG_BLK_DEV_SD=y
458CONFIG_SCSI_LOWLEVEL=y 477CONFIG_SCSI_LOWLEVEL=y
459# CONFIG_ISCSI_TCP is not set 478# CONFIG_ISCSI_TCP is not set
460# CONFIG_SCSI_CXGB3_ISCSI is not set 479# CONFIG_SCSI_CXGB3_ISCSI is not set
480# CONFIG_SCSI_BNX2_ISCSI is not set
461# CONFIG_BLK_DEV_3W_XXXX_RAID is not set 481# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
462# CONFIG_SCSI_3W_9XXX is not set 482# CONFIG_SCSI_3W_9XXX is not set
463# CONFIG_SCSI_ACARD is not set 483# CONFIG_SCSI_ACARD is not set
@@ -466,6 +486,7 @@ CONFIG_SCSI_LOWLEVEL=y
466# CONFIG_SCSI_AIC7XXX_OLD is not set 486# CONFIG_SCSI_AIC7XXX_OLD is not set
467# CONFIG_SCSI_AIC79XX is not set 487# CONFIG_SCSI_AIC79XX is not set
468# CONFIG_SCSI_AIC94XX is not set 488# CONFIG_SCSI_AIC94XX is not set
489# CONFIG_SCSI_MVSAS is not set
469# CONFIG_SCSI_DPT_I2O is not set 490# CONFIG_SCSI_DPT_I2O is not set
470# CONFIG_SCSI_ADVANSYS is not set 491# CONFIG_SCSI_ADVANSYS is not set
471# CONFIG_SCSI_ARCMSR is not set 492# CONFIG_SCSI_ARCMSR is not set
@@ -485,7 +506,6 @@ CONFIG_SCSI_LOWLEVEL=y
485# CONFIG_SCSI_IPS is not set 506# CONFIG_SCSI_IPS is not set
486# CONFIG_SCSI_INITIO is not set 507# CONFIG_SCSI_INITIO is not set
487# CONFIG_SCSI_INIA100 is not set 508# CONFIG_SCSI_INIA100 is not set
488# CONFIG_SCSI_MVSAS is not set
489# CONFIG_SCSI_STEX is not set 509# CONFIG_SCSI_STEX is not set
490# CONFIG_SCSI_SYM53C8XX_2 is not set 510# CONFIG_SCSI_SYM53C8XX_2 is not set
491# CONFIG_SCSI_IPR is not set 511# CONFIG_SCSI_IPR is not set
@@ -568,14 +588,17 @@ CONFIG_SATA_MV=y
568# 588#
569 589
570# 590#
571# Enable only one of the two stacks, unless you know what you are doing 591# You can enable one or both FireWire driver stacks.
592#
593
594#
595# See the help texts for more information.
572# 596#
573# CONFIG_FIREWIRE is not set 597# CONFIG_FIREWIRE is not set
574# CONFIG_IEEE1394 is not set 598# CONFIG_IEEE1394 is not set
575# CONFIG_I2O is not set 599# CONFIG_I2O is not set
576# CONFIG_MACINTOSH_DRIVERS is not set 600# CONFIG_MACINTOSH_DRIVERS is not set
577CONFIG_NETDEVICES=y 601CONFIG_NETDEVICES=y
578CONFIG_COMPAT_NET_DEV_OPS=y
579# CONFIG_DUMMY is not set 602# CONFIG_DUMMY is not set
580# CONFIG_BONDING is not set 603# CONFIG_BONDING is not set
581# CONFIG_MACVLAN is not set 604# CONFIG_MACVLAN is not set
@@ -642,6 +665,7 @@ CONFIG_8139TOO=y
642# CONFIG_SMSC9420 is not set 665# CONFIG_SMSC9420 is not set
643# CONFIG_SUNDANCE is not set 666# CONFIG_SUNDANCE is not set
644# CONFIG_TLAN is not set 667# CONFIG_TLAN is not set
668# CONFIG_KS8842 is not set
645# CONFIG_VIA_RHINE is not set 669# CONFIG_VIA_RHINE is not set
646# CONFIG_SC92031 is not set 670# CONFIG_SC92031 is not set
647# CONFIG_ATL2 is not set 671# CONFIG_ATL2 is not set
@@ -663,7 +687,9 @@ CONFIG_NETDEV_1000=y
663# CONFIG_VIA_VELOCITY is not set 687# CONFIG_VIA_VELOCITY is not set
664# CONFIG_TIGON3 is not set 688# CONFIG_TIGON3 is not set
665# CONFIG_BNX2 is not set 689# CONFIG_BNX2 is not set
690# CONFIG_CNIC is not set
666CONFIG_TSI108_ETH=y 691CONFIG_TSI108_ETH=y
692# CONFIG_MV643XX_ETH is not set
667# CONFIG_QLA3XXX is not set 693# CONFIG_QLA3XXX is not set
668# CONFIG_ATL1 is not set 694# CONFIG_ATL1 is not set
669# CONFIG_ATL1E is not set 695# CONFIG_ATL1E is not set
@@ -785,6 +811,11 @@ CONFIG_GEN_RTC=y
785CONFIG_DEVPORT=y 811CONFIG_DEVPORT=y
786# CONFIG_I2C is not set 812# CONFIG_I2C is not set
787# CONFIG_SPI is not set 813# CONFIG_SPI is not set
814
815#
816# PPS support
817#
818# CONFIG_PPS is not set
788CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y 819CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
789# CONFIG_GPIOLIB is not set 820# CONFIG_GPIOLIB is not set
790# CONFIG_W1 is not set 821# CONFIG_W1 is not set
@@ -824,22 +855,7 @@ CONFIG_SSB_POSSIBLE=y
824# CONFIG_HTC_PASIC3 is not set 855# CONFIG_HTC_PASIC3 is not set
825# CONFIG_MFD_TMIO is not set 856# CONFIG_MFD_TMIO is not set
826# CONFIG_REGULATOR is not set 857# CONFIG_REGULATOR is not set
827 858# CONFIG_MEDIA_SUPPORT is not set
828#
829# Multimedia devices
830#
831
832#
833# Multimedia core support
834#
835# CONFIG_VIDEO_DEV is not set
836# CONFIG_DVB_CORE is not set
837# CONFIG_VIDEO_MEDIA is not set
838
839#
840# Multimedia drivers
841#
842CONFIG_DAB=y
843 859
844# 860#
845# Graphics support 861# Graphics support
@@ -896,6 +912,10 @@ CONFIG_USB_ARCH_HAS_EHCI=y
896# CONFIG_DMADEVICES is not set 912# CONFIG_DMADEVICES is not set
897# CONFIG_AUXDISPLAY is not set 913# CONFIG_AUXDISPLAY is not set
898# CONFIG_UIO is not set 914# CONFIG_UIO is not set
915
916#
917# TI VLYNQ
918#
899# CONFIG_STAGING is not set 919# CONFIG_STAGING is not set
900 920
901# 921#
@@ -915,11 +935,12 @@ CONFIG_FS_MBCACHE=y
915# CONFIG_REISERFS_FS is not set 935# CONFIG_REISERFS_FS is not set
916# CONFIG_JFS_FS is not set 936# CONFIG_JFS_FS is not set
917# CONFIG_FS_POSIX_ACL is not set 937# CONFIG_FS_POSIX_ACL is not set
918CONFIG_FILE_LOCKING=y
919# CONFIG_XFS_FS is not set 938# CONFIG_XFS_FS is not set
920# CONFIG_GFS2_FS is not set 939# CONFIG_GFS2_FS is not set
921# CONFIG_OCFS2_FS is not set 940# CONFIG_OCFS2_FS is not set
922# CONFIG_BTRFS_FS is not set 941# CONFIG_BTRFS_FS is not set
942CONFIG_FILE_LOCKING=y
943CONFIG_FSNOTIFY=y
923CONFIG_DNOTIFY=y 944CONFIG_DNOTIFY=y
924CONFIG_INOTIFY=y 945CONFIG_INOTIFY=y
925CONFIG_INOTIFY_USER=y 946CONFIG_INOTIFY_USER=y
@@ -1038,6 +1059,7 @@ CONFIG_HAS_IOPORT=y
1038CONFIG_HAS_DMA=y 1059CONFIG_HAS_DMA=y
1039CONFIG_HAVE_LMB=y 1060CONFIG_HAVE_LMB=y
1040CONFIG_NLATTR=y 1061CONFIG_NLATTR=y
1062CONFIG_GENERIC_ATOMIC64=y
1041 1063
1042# 1064#
1043# Kernel hacking 1065# Kernel hacking
@@ -1063,22 +1085,11 @@ CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
1063CONFIG_HAVE_DYNAMIC_FTRACE=y 1085CONFIG_HAVE_DYNAMIC_FTRACE=y
1064CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y 1086CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
1065CONFIG_TRACING_SUPPORT=y 1087CONFIG_TRACING_SUPPORT=y
1066 1088# CONFIG_FTRACE is not set
1067#
1068# Tracers
1069#
1070# CONFIG_FUNCTION_TRACER is not set
1071# CONFIG_SCHED_TRACER is not set
1072# CONFIG_CONTEXT_SWITCH_TRACER is not set
1073# CONFIG_EVENT_TRACER is not set
1074# CONFIG_BOOT_TRACER is not set
1075# CONFIG_TRACE_BRANCH_PROFILING is not set
1076# CONFIG_STACK_TRACER is not set
1077# CONFIG_KMEMTRACE is not set
1078# CONFIG_WORKQUEUE_TRACER is not set
1079# CONFIG_BLK_DEV_IO_TRACE is not set
1080# CONFIG_SAMPLES is not set 1089# CONFIG_SAMPLES is not set
1081CONFIG_HAVE_ARCH_KGDB=y 1090CONFIG_HAVE_ARCH_KGDB=y
1091# CONFIG_PPC_DISABLE_WERROR is not set
1092CONFIG_PPC_WERROR=y
1082CONFIG_PRINT_STACK_DEPTH=64 1093CONFIG_PRINT_STACK_DEPTH=64
1083# CONFIG_IRQSTACKS is not set 1094# CONFIG_IRQSTACKS is not set
1084# CONFIG_BOOTX_TEXT is not set 1095# CONFIG_BOOTX_TEXT is not set
diff --git a/arch/powerpc/configs/mpc8272_ads_defconfig b/arch/powerpc/configs/mpc8272_ads_defconfig
index cb966ca2ce89..02716f72db6f 100644
--- a/arch/powerpc/configs/mpc8272_ads_defconfig
+++ b/arch/powerpc/configs/mpc8272_ads_defconfig
@@ -1,25 +1,27 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.30-rc3 3# Linux kernel version: 2.6.31-rc4
4# Wed May 13 17:21:57 2009 4# Wed Jul 29 23:31:54 2009
5# 5#
6# CONFIG_PPC64 is not set 6# CONFIG_PPC64 is not set
7 7
8# 8#
9# Processor support 9# Processor support
10# 10#
11CONFIG_6xx=y 11CONFIG_PPC_BOOK3S_32=y
12# CONFIG_PPC_85xx is not set 12# CONFIG_PPC_85xx is not set
13# CONFIG_PPC_8xx is not set 13# CONFIG_PPC_8xx is not set
14# CONFIG_40x is not set 14# CONFIG_40x is not set
15# CONFIG_44x is not set 15# CONFIG_44x is not set
16# CONFIG_E200 is not set 16# CONFIG_E200 is not set
17CONFIG_PPC_BOOK3S=y 17CONFIG_PPC_BOOK3S=y
18CONFIG_6xx=y
18CONFIG_PPC_FPU=y 19CONFIG_PPC_FPU=y
19# CONFIG_ALTIVEC is not set 20# CONFIG_ALTIVEC is not set
20CONFIG_PPC_STD_MMU=y 21CONFIG_PPC_STD_MMU=y
21CONFIG_PPC_STD_MMU_32=y 22CONFIG_PPC_STD_MMU_32=y
22# CONFIG_PPC_MM_SLICES is not set 23# CONFIG_PPC_MM_SLICES is not set
24CONFIG_PPC_HAVE_PMU_SUPPORT=y
23# CONFIG_SMP is not set 25# CONFIG_SMP is not set
24CONFIG_PPC32=y 26CONFIG_PPC32=y
25CONFIG_WORD_SIZE=32 27CONFIG_WORD_SIZE=32
@@ -30,15 +32,16 @@ CONFIG_GENERIC_TIME=y
30CONFIG_GENERIC_TIME_VSYSCALL=y 32CONFIG_GENERIC_TIME_VSYSCALL=y
31CONFIG_GENERIC_CLOCKEVENTS=y 33CONFIG_GENERIC_CLOCKEVENTS=y
32CONFIG_GENERIC_HARDIRQS=y 34CONFIG_GENERIC_HARDIRQS=y
35CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
33# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set 36# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set
34CONFIG_IRQ_PER_CPU=y 37CONFIG_IRQ_PER_CPU=y
35CONFIG_STACKTRACE_SUPPORT=y 38CONFIG_STACKTRACE_SUPPORT=y
36CONFIG_HAVE_LATENCYTOP_SUPPORT=y 39CONFIG_HAVE_LATENCYTOP_SUPPORT=y
40CONFIG_TRACE_IRQFLAGS_SUPPORT=y
37CONFIG_LOCKDEP_SUPPORT=y 41CONFIG_LOCKDEP_SUPPORT=y
38CONFIG_RWSEM_XCHGADD_ALGORITHM=y 42CONFIG_RWSEM_XCHGADD_ALGORITHM=y
39CONFIG_ARCH_HAS_ILOG2_U32=y 43CONFIG_ARCH_HAS_ILOG2_U32=y
40CONFIG_GENERIC_HWEIGHT=y 44CONFIG_GENERIC_HWEIGHT=y
41CONFIG_GENERIC_CALIBRATE_DELAY=y
42CONFIG_GENERIC_FIND_NEXT_BIT=y 45CONFIG_GENERIC_FIND_NEXT_BIT=y
43CONFIG_GENERIC_GPIO=y 46CONFIG_GENERIC_GPIO=y
44# CONFIG_ARCH_NO_VIRT_TO_BUS is not set 47# CONFIG_ARCH_NO_VIRT_TO_BUS is not set
@@ -53,11 +56,13 @@ CONFIG_OF=y
53# CONFIG_GENERIC_TBSYNC is not set 56# CONFIG_GENERIC_TBSYNC is not set
54CONFIG_AUDIT_ARCH=y 57CONFIG_AUDIT_ARCH=y
55CONFIG_GENERIC_BUG=y 58CONFIG_GENERIC_BUG=y
59CONFIG_DTC=y
56CONFIG_DEFAULT_UIMAGE=y 60CONFIG_DEFAULT_UIMAGE=y
57# CONFIG_PPC_DCR_NATIVE is not set 61# CONFIG_PPC_DCR_NATIVE is not set
58# CONFIG_PPC_DCR_MMIO is not set 62# CONFIG_PPC_DCR_MMIO is not set
59CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y 63CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y
60CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" 64CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
65CONFIG_CONSTRUCTORS=y
61 66
62# 67#
63# General setup 68# General setup
@@ -99,7 +104,6 @@ CONFIG_SYSCTL_SYSCALL=y
99CONFIG_KALLSYMS=y 104CONFIG_KALLSYMS=y
100CONFIG_KALLSYMS_ALL=y 105CONFIG_KALLSYMS_ALL=y
101# CONFIG_KALLSYMS_EXTRA_PASS is not set 106# CONFIG_KALLSYMS_EXTRA_PASS is not set
102# CONFIG_STRIP_ASM_SYMS is not set
103CONFIG_HOTPLUG=y 107CONFIG_HOTPLUG=y
104CONFIG_PRINTK=y 108CONFIG_PRINTK=y
105CONFIG_BUG=y 109CONFIG_BUG=y
@@ -112,9 +116,16 @@ CONFIG_TIMERFD=y
112CONFIG_EVENTFD=y 116CONFIG_EVENTFD=y
113CONFIG_SHMEM=y 117CONFIG_SHMEM=y
114CONFIG_AIO=y 118CONFIG_AIO=y
119CONFIG_HAVE_PERF_COUNTERS=y
120
121#
122# Performance Counters
123#
124# CONFIG_PERF_COUNTERS is not set
115CONFIG_VM_EVENT_COUNTERS=y 125CONFIG_VM_EVENT_COUNTERS=y
116CONFIG_PCI_QUIRKS=y 126CONFIG_PCI_QUIRKS=y
117CONFIG_SLUB_DEBUG=y 127CONFIG_SLUB_DEBUG=y
128# CONFIG_STRIP_ASM_SYMS is not set
118CONFIG_COMPAT_BRK=y 129CONFIG_COMPAT_BRK=y
119# CONFIG_SLAB is not set 130# CONFIG_SLAB is not set
120CONFIG_SLUB=y 131CONFIG_SLUB=y
@@ -128,6 +139,10 @@ CONFIG_HAVE_KPROBES=y
128CONFIG_HAVE_KRETPROBES=y 139CONFIG_HAVE_KRETPROBES=y
129CONFIG_HAVE_ARCH_TRACEHOOK=y 140CONFIG_HAVE_ARCH_TRACEHOOK=y
130CONFIG_HAVE_CLK=y 141CONFIG_HAVE_CLK=y
142
143#
144# GCOV-based kernel profiling
145#
131# CONFIG_SLOW_WORK is not set 146# CONFIG_SLOW_WORK is not set
132# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set 147# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
133CONFIG_SLABINFO=y 148CONFIG_SLABINFO=y
@@ -135,7 +150,7 @@ CONFIG_RT_MUTEXES=y
135CONFIG_BASE_SMALL=0 150CONFIG_BASE_SMALL=0
136# CONFIG_MODULES is not set 151# CONFIG_MODULES is not set
137CONFIG_BLOCK=y 152CONFIG_BLOCK=y
138# CONFIG_LBD is not set 153CONFIG_LBDAF=y
139# CONFIG_BLK_DEV_INTEGRITY is not set 154# CONFIG_BLK_DEV_INTEGRITY is not set
140 155
141# 156#
@@ -216,6 +231,7 @@ CONFIG_BINFMT_ELF=y
216# CONFIG_HAVE_AOUT is not set 231# CONFIG_HAVE_AOUT is not set
217CONFIG_BINFMT_MISC=y 232CONFIG_BINFMT_MISC=y
218# CONFIG_IOMMU_HELPER is not set 233# CONFIG_IOMMU_HELPER is not set
234# CONFIG_SWIOTLB is not set
219CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y 235CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
220CONFIG_ARCH_HAS_WALK_MEMORY=y 236CONFIG_ARCH_HAS_WALK_MEMORY=y
221CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y 237CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y
@@ -231,9 +247,9 @@ CONFIG_MIGRATION=y
231CONFIG_ZONE_DMA_FLAG=1 247CONFIG_ZONE_DMA_FLAG=1
232CONFIG_BOUNCE=y 248CONFIG_BOUNCE=y
233CONFIG_VIRT_TO_BUS=y 249CONFIG_VIRT_TO_BUS=y
234CONFIG_UNEVICTABLE_LRU=y
235CONFIG_HAVE_MLOCK=y 250CONFIG_HAVE_MLOCK=y
236CONFIG_HAVE_MLOCKED_PAGE_BIT=y 251CONFIG_HAVE_MLOCKED_PAGE_BIT=y
252CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
237CONFIG_PPC_4K_PAGES=y 253CONFIG_PPC_4K_PAGES=y
238# CONFIG_PPC_16K_PAGES is not set 254# CONFIG_PPC_16K_PAGES is not set
239# CONFIG_PPC_64K_PAGES is not set 255# CONFIG_PPC_64K_PAGES is not set
@@ -303,6 +319,7 @@ CONFIG_IP_PNP_BOOTP=y
303# CONFIG_NET_IPIP is not set 319# CONFIG_NET_IPIP is not set
304# CONFIG_NET_IPGRE is not set 320# CONFIG_NET_IPGRE is not set
305# CONFIG_IP_MROUTE is not set 321# CONFIG_IP_MROUTE is not set
322# CONFIG_ARPD is not set
306CONFIG_SYN_COOKIES=y 323CONFIG_SYN_COOKIES=y
307# CONFIG_INET_AH is not set 324# CONFIG_INET_AH is not set
308# CONFIG_INET_ESP is not set 325# CONFIG_INET_ESP is not set
@@ -383,7 +400,11 @@ CONFIG_WIRELESS=y
383CONFIG_WIRELESS_OLD_REGULATORY=y 400CONFIG_WIRELESS_OLD_REGULATORY=y
384# CONFIG_WIRELESS_EXT is not set 401# CONFIG_WIRELESS_EXT is not set
385# CONFIG_LIB80211 is not set 402# CONFIG_LIB80211 is not set
386# CONFIG_MAC80211 is not set 403
404#
405# CFG80211 needs to be enabled for MAC80211
406#
407CONFIG_MAC80211_DEFAULT_PS_VALUE=0
387# CONFIG_WIMAX is not set 408# CONFIG_WIMAX is not set
388# CONFIG_RFKILL is not set 409# CONFIG_RFKILL is not set
389 410
@@ -489,6 +510,7 @@ CONFIG_MTD_PHYSMAP_OF=y
489# CONFIG_MTD_UBI is not set 510# CONFIG_MTD_UBI is not set
490CONFIG_OF_DEVICE=y 511CONFIG_OF_DEVICE=y
491CONFIG_OF_GPIO=y 512CONFIG_OF_GPIO=y
513CONFIG_OF_MDIO=y
492# CONFIG_PARPORT is not set 514# CONFIG_PARPORT is not set
493CONFIG_BLK_DEV=y 515CONFIG_BLK_DEV=y
494# CONFIG_BLK_DEV_FD is not set 516# CONFIG_BLK_DEV_FD is not set
@@ -524,13 +546,17 @@ CONFIG_HAVE_IDE=y
524# 546#
525 547
526# 548#
527# A new alternative FireWire stack is available with EXPERIMENTAL=y 549# You can enable one or both FireWire driver stacks.
550#
551
552#
553# See the help texts for more information.
528# 554#
555# CONFIG_FIREWIRE is not set
529# CONFIG_IEEE1394 is not set 556# CONFIG_IEEE1394 is not set
530# CONFIG_I2O is not set 557# CONFIG_I2O is not set
531# CONFIG_MACINTOSH_DRIVERS is not set 558# CONFIG_MACINTOSH_DRIVERS is not set
532CONFIG_NETDEVICES=y 559CONFIG_NETDEVICES=y
533CONFIG_COMPAT_NET_DEV_OPS=y
534# CONFIG_DUMMY is not set 560# CONFIG_DUMMY is not set
535# CONFIG_BONDING is not set 561# CONFIG_BONDING is not set
536# CONFIG_EQUALIZER is not set 562# CONFIG_EQUALIZER is not set
@@ -577,6 +603,7 @@ CONFIG_MII=y
577# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set 603# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
578# CONFIG_NET_PCI is not set 604# CONFIG_NET_PCI is not set
579# CONFIG_B44 is not set 605# CONFIG_B44 is not set
606# CONFIG_KS8842 is not set
580# CONFIG_ATL2 is not set 607# CONFIG_ATL2 is not set
581CONFIG_FS_ENET=y 608CONFIG_FS_ENET=y
582# CONFIG_FS_ENET_HAS_SCC is not set 609# CONFIG_FS_ENET_HAS_SCC is not set
@@ -598,8 +625,10 @@ CONFIG_NETDEV_1000=y
598# CONFIG_VIA_VELOCITY is not set 625# CONFIG_VIA_VELOCITY is not set
599# CONFIG_TIGON3 is not set 626# CONFIG_TIGON3 is not set
600# CONFIG_BNX2 is not set 627# CONFIG_BNX2 is not set
628# CONFIG_CNIC is not set
601# CONFIG_FSL_PQ_MDIO is not set 629# CONFIG_FSL_PQ_MDIO is not set
602# CONFIG_GIANFAR is not set 630# CONFIG_GIANFAR is not set
631# CONFIG_MV643XX_ETH is not set
603# CONFIG_QLA3XXX is not set 632# CONFIG_QLA3XXX is not set
604# CONFIG_ATL1 is not set 633# CONFIG_ATL1 is not set
605# CONFIG_JME is not set 634# CONFIG_JME is not set
@@ -671,12 +700,13 @@ CONFIG_INPUT_EVDEV=y
671# 700#
672CONFIG_INPUT_KEYBOARD=y 701CONFIG_INPUT_KEYBOARD=y
673CONFIG_KEYBOARD_ATKBD=y 702CONFIG_KEYBOARD_ATKBD=y
674# CONFIG_KEYBOARD_SUNKBD is not set
675# CONFIG_KEYBOARD_LKKBD is not set 703# CONFIG_KEYBOARD_LKKBD is not set
676# CONFIG_KEYBOARD_XTKBD is not set 704# CONFIG_KEYBOARD_GPIO is not set
705# CONFIG_KEYBOARD_MATRIX is not set
677# CONFIG_KEYBOARD_NEWTON is not set 706# CONFIG_KEYBOARD_NEWTON is not set
678# CONFIG_KEYBOARD_STOWAWAY is not set 707# CONFIG_KEYBOARD_STOWAWAY is not set
679# CONFIG_KEYBOARD_GPIO is not set 708# CONFIG_KEYBOARD_SUNKBD is not set
709# CONFIG_KEYBOARD_XTKBD is not set
680CONFIG_INPUT_MOUSE=y 710CONFIG_INPUT_MOUSE=y
681CONFIG_MOUSE_PS2=y 711CONFIG_MOUSE_PS2=y
682CONFIG_MOUSE_PS2_ALPS=y 712CONFIG_MOUSE_PS2_ALPS=y
@@ -741,6 +771,10 @@ CONFIG_HW_RANDOM=y
741CONFIG_DEVPORT=y 771CONFIG_DEVPORT=y
742# CONFIG_I2C is not set 772# CONFIG_I2C is not set
743# CONFIG_SPI is not set 773# CONFIG_SPI is not set
774
775#
776# PPS support
777#
744CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y 778CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
745CONFIG_ARCH_REQUIRE_GPIOLIB=y 779CONFIG_ARCH_REQUIRE_GPIOLIB=y
746CONFIG_GPIOLIB=y 780CONFIG_GPIOLIB=y
@@ -784,22 +818,7 @@ CONFIG_SSB_POSSIBLE=y
784# CONFIG_HTC_PASIC3 is not set 818# CONFIG_HTC_PASIC3 is not set
785# CONFIG_MFD_TMIO is not set 819# CONFIG_MFD_TMIO is not set
786# CONFIG_REGULATOR is not set 820# CONFIG_REGULATOR is not set
787 821# CONFIG_MEDIA_SUPPORT is not set
788#
789# Multimedia devices
790#
791
792#
793# Multimedia core support
794#
795# CONFIG_VIDEO_DEV is not set
796# CONFIG_DVB_CORE is not set
797# CONFIG_VIDEO_MEDIA is not set
798
799#
800# Multimedia drivers
801#
802CONFIG_DAB=y
803 822
804# 823#
805# Graphics support 824# Graphics support
@@ -828,6 +847,10 @@ CONFIG_DAB=y
828# CONFIG_DMADEVICES is not set 847# CONFIG_DMADEVICES is not set
829# CONFIG_AUXDISPLAY is not set 848# CONFIG_AUXDISPLAY is not set
830# CONFIG_UIO is not set 849# CONFIG_UIO is not set
850
851#
852# TI VLYNQ
853#
831# CONFIG_STAGING is not set 854# CONFIG_STAGING is not set
832 855
833# 856#
@@ -847,9 +870,10 @@ CONFIG_FS_MBCACHE=y
847# CONFIG_REISERFS_FS is not set 870# CONFIG_REISERFS_FS is not set
848# CONFIG_JFS_FS is not set 871# CONFIG_JFS_FS is not set
849CONFIG_FS_POSIX_ACL=y 872CONFIG_FS_POSIX_ACL=y
850CONFIG_FILE_LOCKING=y
851# CONFIG_XFS_FS is not set 873# CONFIG_XFS_FS is not set
852# CONFIG_OCFS2_FS is not set 874# CONFIG_OCFS2_FS is not set
875CONFIG_FILE_LOCKING=y
876CONFIG_FSNOTIFY=y
853CONFIG_DNOTIFY=y 877CONFIG_DNOTIFY=y
854CONFIG_INOTIFY=y 878CONFIG_INOTIFY=y
855CONFIG_INOTIFY_USER=y 879CONFIG_INOTIFY_USER=y
@@ -998,6 +1022,7 @@ CONFIG_HAS_IOPORT=y
998CONFIG_HAS_DMA=y 1022CONFIG_HAS_DMA=y
999CONFIG_HAVE_LMB=y 1023CONFIG_HAVE_LMB=y
1000CONFIG_NLATTR=y 1024CONFIG_NLATTR=y
1025CONFIG_GENERIC_ATOMIC64=y
1001 1026
1002# 1027#
1003# Kernel hacking 1028# Kernel hacking
@@ -1028,6 +1053,9 @@ CONFIG_SCHED_DEBUG=y
1028# CONFIG_RT_MUTEX_TESTER is not set 1053# CONFIG_RT_MUTEX_TESTER is not set
1029# CONFIG_DEBUG_SPINLOCK is not set 1054# CONFIG_DEBUG_SPINLOCK is not set
1030# CONFIG_DEBUG_MUTEXES is not set 1055# CONFIG_DEBUG_MUTEXES is not set
1056# CONFIG_DEBUG_LOCK_ALLOC is not set
1057# CONFIG_PROVE_LOCKING is not set
1058# CONFIG_LOCK_STAT is not set
1031# CONFIG_DEBUG_SPINLOCK_SLEEP is not set 1059# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
1032# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set 1060# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
1033# CONFIG_DEBUG_KOBJECT is not set 1061# CONFIG_DEBUG_KOBJECT is not set
@@ -1039,7 +1067,6 @@ CONFIG_DEBUG_INFO=y
1039# CONFIG_DEBUG_LIST is not set 1067# CONFIG_DEBUG_LIST is not set
1040# CONFIG_DEBUG_SG is not set 1068# CONFIG_DEBUG_SG is not set
1041# CONFIG_DEBUG_NOTIFIERS is not set 1069# CONFIG_DEBUG_NOTIFIERS is not set
1042# CONFIG_BOOT_PRINTK_DELAY is not set
1043# CONFIG_RCU_TORTURE_TEST is not set 1070# CONFIG_RCU_TORTURE_TEST is not set
1044# CONFIG_RCU_CPU_STALL_DETECTOR is not set 1071# CONFIG_RCU_CPU_STALL_DETECTOR is not set
1045# CONFIG_BACKTRACE_SELF_TEST is not set 1072# CONFIG_BACKTRACE_SELF_TEST is not set
@@ -1053,22 +1080,23 @@ CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
1053CONFIG_HAVE_DYNAMIC_FTRACE=y 1080CONFIG_HAVE_DYNAMIC_FTRACE=y
1054CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y 1081CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
1055CONFIG_TRACING_SUPPORT=y 1082CONFIG_TRACING_SUPPORT=y
1056 1083CONFIG_FTRACE=y
1057#
1058# Tracers
1059#
1060# CONFIG_FUNCTION_TRACER is not set 1084# CONFIG_FUNCTION_TRACER is not set
1085# CONFIG_IRQSOFF_TRACER is not set
1061# CONFIG_SCHED_TRACER is not set 1086# CONFIG_SCHED_TRACER is not set
1062# CONFIG_CONTEXT_SWITCH_TRACER is not set 1087# CONFIG_ENABLE_DEFAULT_TRACERS is not set
1063# CONFIG_EVENT_TRACER is not set
1064# CONFIG_BOOT_TRACER is not set 1088# CONFIG_BOOT_TRACER is not set
1065# CONFIG_TRACE_BRANCH_PROFILING is not set 1089CONFIG_BRANCH_PROFILE_NONE=y
1090# CONFIG_PROFILE_ANNOTATED_BRANCHES is not set
1091# CONFIG_PROFILE_ALL_BRANCHES is not set
1066# CONFIG_STACK_TRACER is not set 1092# CONFIG_STACK_TRACER is not set
1067# CONFIG_KMEMTRACE is not set 1093# CONFIG_KMEMTRACE is not set
1068# CONFIG_WORKQUEUE_TRACER is not set 1094# CONFIG_WORKQUEUE_TRACER is not set
1069# CONFIG_BLK_DEV_IO_TRACE is not set 1095# CONFIG_BLK_DEV_IO_TRACE is not set
1070# CONFIG_SAMPLES is not set 1096# CONFIG_SAMPLES is not set
1071CONFIG_HAVE_ARCH_KGDB=y 1097CONFIG_HAVE_ARCH_KGDB=y
1098# CONFIG_PPC_DISABLE_WERROR is not set
1099CONFIG_PPC_WERROR=y
1072CONFIG_PRINT_STACK_DEPTH=64 1100CONFIG_PRINT_STACK_DEPTH=64
1073# CONFIG_DEBUG_STACKOVERFLOW is not set 1101# CONFIG_DEBUG_STACKOVERFLOW is not set
1074# CONFIG_DEBUG_STACK_USAGE is not set 1102# CONFIG_DEBUG_STACK_USAGE is not set
diff --git a/arch/powerpc/configs/mpc83xx_defconfig b/arch/powerpc/configs/mpc83xx_defconfig
index 433c303eb82b..4a96cb6925b4 100644
--- a/arch/powerpc/configs/mpc83xx_defconfig
+++ b/arch/powerpc/configs/mpc83xx_defconfig
@@ -1,26 +1,28 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.30-rc3 3# Linux kernel version: 2.6.31-rc4
4# Wed May 13 17:21:58 2009 4# Wed Jul 29 23:31:55 2009
5# 5#
6# CONFIG_PPC64 is not set 6# CONFIG_PPC64 is not set
7 7
8# 8#
9# Processor support 9# Processor support
10# 10#
11CONFIG_6xx=y 11CONFIG_PPC_BOOK3S_32=y
12# CONFIG_PPC_85xx is not set 12# CONFIG_PPC_85xx is not set
13# CONFIG_PPC_8xx is not set 13# CONFIG_PPC_8xx is not set
14# CONFIG_40x is not set 14# CONFIG_40x is not set
15# CONFIG_44x is not set 15# CONFIG_44x is not set
16# CONFIG_E200 is not set 16# CONFIG_E200 is not set
17CONFIG_PPC_BOOK3S=y 17CONFIG_PPC_BOOK3S=y
18CONFIG_6xx=y
18CONFIG_PPC_FPU=y 19CONFIG_PPC_FPU=y
19# CONFIG_FSL_EMB_PERFMON is not set 20# CONFIG_FSL_EMB_PERFMON is not set
20# CONFIG_ALTIVEC is not set 21# CONFIG_ALTIVEC is not set
21CONFIG_PPC_STD_MMU=y 22CONFIG_PPC_STD_MMU=y
22CONFIG_PPC_STD_MMU_32=y 23CONFIG_PPC_STD_MMU_32=y
23# CONFIG_PPC_MM_SLICES is not set 24# CONFIG_PPC_MM_SLICES is not set
25CONFIG_PPC_HAVE_PMU_SUPPORT=y
24# CONFIG_SMP is not set 26# CONFIG_SMP is not set
25CONFIG_PPC32=y 27CONFIG_PPC32=y
26CONFIG_WORD_SIZE=32 28CONFIG_WORD_SIZE=32
@@ -31,15 +33,16 @@ CONFIG_GENERIC_TIME=y
31CONFIG_GENERIC_TIME_VSYSCALL=y 33CONFIG_GENERIC_TIME_VSYSCALL=y
32CONFIG_GENERIC_CLOCKEVENTS=y 34CONFIG_GENERIC_CLOCKEVENTS=y
33CONFIG_GENERIC_HARDIRQS=y 35CONFIG_GENERIC_HARDIRQS=y
36CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
34# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set 37# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set
35CONFIG_IRQ_PER_CPU=y 38CONFIG_IRQ_PER_CPU=y
36CONFIG_STACKTRACE_SUPPORT=y 39CONFIG_STACKTRACE_SUPPORT=y
37CONFIG_HAVE_LATENCYTOP_SUPPORT=y 40CONFIG_HAVE_LATENCYTOP_SUPPORT=y
41CONFIG_TRACE_IRQFLAGS_SUPPORT=y
38CONFIG_LOCKDEP_SUPPORT=y 42CONFIG_LOCKDEP_SUPPORT=y
39CONFIG_RWSEM_XCHGADD_ALGORITHM=y 43CONFIG_RWSEM_XCHGADD_ALGORITHM=y
40CONFIG_ARCH_HAS_ILOG2_U32=y 44CONFIG_ARCH_HAS_ILOG2_U32=y
41CONFIG_GENERIC_HWEIGHT=y 45CONFIG_GENERIC_HWEIGHT=y
42CONFIG_GENERIC_CALIBRATE_DELAY=y
43CONFIG_GENERIC_FIND_NEXT_BIT=y 46CONFIG_GENERIC_FIND_NEXT_BIT=y
44CONFIG_GENERIC_GPIO=y 47CONFIG_GENERIC_GPIO=y
45# CONFIG_ARCH_NO_VIRT_TO_BUS is not set 48# CONFIG_ARCH_NO_VIRT_TO_BUS is not set
@@ -54,6 +57,7 @@ CONFIG_PPC_UDBG_16550=y
54# CONFIG_GENERIC_TBSYNC is not set 57# CONFIG_GENERIC_TBSYNC is not set
55CONFIG_AUDIT_ARCH=y 58CONFIG_AUDIT_ARCH=y
56CONFIG_GENERIC_BUG=y 59CONFIG_GENERIC_BUG=y
60CONFIG_DTC=y
57CONFIG_DEFAULT_UIMAGE=y 61CONFIG_DEFAULT_UIMAGE=y
58CONFIG_REDBOOT=y 62CONFIG_REDBOOT=y
59CONFIG_ARCH_SUSPEND_POSSIBLE=y 63CONFIG_ARCH_SUSPEND_POSSIBLE=y
@@ -61,6 +65,7 @@ CONFIG_ARCH_SUSPEND_POSSIBLE=y
61# CONFIG_PPC_DCR_MMIO is not set 65# CONFIG_PPC_DCR_MMIO is not set
62CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y 66CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y
63CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" 67CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
68CONFIG_CONSTRUCTORS=y
64 69
65# 70#
66# General setup 71# General setup
@@ -110,7 +115,6 @@ CONFIG_EMBEDDED=y
110CONFIG_SYSCTL_SYSCALL=y 115CONFIG_SYSCTL_SYSCALL=y
111CONFIG_KALLSYMS=y 116CONFIG_KALLSYMS=y
112# CONFIG_KALLSYMS_EXTRA_PASS is not set 117# CONFIG_KALLSYMS_EXTRA_PASS is not set
113# CONFIG_STRIP_ASM_SYMS is not set
114CONFIG_HOTPLUG=y 118CONFIG_HOTPLUG=y
115CONFIG_PRINTK=y 119CONFIG_PRINTK=y
116CONFIG_BUG=y 120CONFIG_BUG=y
@@ -123,8 +127,15 @@ CONFIG_TIMERFD=y
123CONFIG_EVENTFD=y 127CONFIG_EVENTFD=y
124CONFIG_SHMEM=y 128CONFIG_SHMEM=y
125CONFIG_AIO=y 129CONFIG_AIO=y
130CONFIG_HAVE_PERF_COUNTERS=y
131
132#
133# Performance Counters
134#
135# CONFIG_PERF_COUNTERS is not set
126CONFIG_VM_EVENT_COUNTERS=y 136CONFIG_VM_EVENT_COUNTERS=y
127CONFIG_PCI_QUIRKS=y 137CONFIG_PCI_QUIRKS=y
138# CONFIG_STRIP_ASM_SYMS is not set
128CONFIG_COMPAT_BRK=y 139CONFIG_COMPAT_BRK=y
129CONFIG_SLAB=y 140CONFIG_SLAB=y
130# CONFIG_SLUB is not set 141# CONFIG_SLUB is not set
@@ -138,6 +149,10 @@ CONFIG_HAVE_IOREMAP_PROT=y
138CONFIG_HAVE_KPROBES=y 149CONFIG_HAVE_KPROBES=y
139CONFIG_HAVE_KRETPROBES=y 150CONFIG_HAVE_KRETPROBES=y
140CONFIG_HAVE_ARCH_TRACEHOOK=y 151CONFIG_HAVE_ARCH_TRACEHOOK=y
152
153#
154# GCOV-based kernel profiling
155#
141# CONFIG_SLOW_WORK is not set 156# CONFIG_SLOW_WORK is not set
142# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set 157# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
143CONFIG_SLABINFO=y 158CONFIG_SLABINFO=y
@@ -150,7 +165,7 @@ CONFIG_MODULE_UNLOAD=y
150# CONFIG_MODVERSIONS is not set 165# CONFIG_MODVERSIONS is not set
151# CONFIG_MODULE_SRCVERSION_ALL is not set 166# CONFIG_MODULE_SRCVERSION_ALL is not set
152CONFIG_BLOCK=y 167CONFIG_BLOCK=y
153# CONFIG_LBD is not set 168CONFIG_LBDAF=y
154# CONFIG_BLK_DEV_BSG is not set 169# CONFIG_BLK_DEV_BSG is not set
155# CONFIG_BLK_DEV_INTEGRITY is not set 170# CONFIG_BLK_DEV_INTEGRITY is not set
156 171
@@ -192,6 +207,7 @@ CONFIG_MPC837x_MDS=y
192CONFIG_MPC837x_RDB=y 207CONFIG_MPC837x_RDB=y
193CONFIG_SBC834x=y 208CONFIG_SBC834x=y
194CONFIG_ASP834x=y 209CONFIG_ASP834x=y
210# CONFIG_KMETER1 is not set
195CONFIG_PPC_MPC831x=y 211CONFIG_PPC_MPC831x=y
196CONFIG_PPC_MPC832x=y 212CONFIG_PPC_MPC832x=y
197CONFIG_PPC_MPC834x=y 213CONFIG_PPC_MPC834x=y
@@ -241,6 +257,7 @@ CONFIG_BINFMT_ELF=y
241# CONFIG_BINFMT_MISC is not set 257# CONFIG_BINFMT_MISC is not set
242CONFIG_MATH_EMULATION=y 258CONFIG_MATH_EMULATION=y
243# CONFIG_IOMMU_HELPER is not set 259# CONFIG_IOMMU_HELPER is not set
260# CONFIG_SWIOTLB is not set
244CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y 261CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
245CONFIG_ARCH_HAS_WALK_MEMORY=y 262CONFIG_ARCH_HAS_WALK_MEMORY=y
246CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y 263CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y
@@ -261,9 +278,9 @@ CONFIG_MIGRATION=y
261CONFIG_ZONE_DMA_FLAG=1 278CONFIG_ZONE_DMA_FLAG=1
262CONFIG_BOUNCE=y 279CONFIG_BOUNCE=y
263CONFIG_VIRT_TO_BUS=y 280CONFIG_VIRT_TO_BUS=y
264CONFIG_UNEVICTABLE_LRU=y
265CONFIG_HAVE_MLOCK=y 281CONFIG_HAVE_MLOCK=y
266CONFIG_HAVE_MLOCKED_PAGE_BIT=y 282CONFIG_HAVE_MLOCKED_PAGE_BIT=y
283CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
267CONFIG_PPC_4K_PAGES=y 284CONFIG_PPC_4K_PAGES=y
268# CONFIG_PPC_16K_PAGES is not set 285# CONFIG_PPC_16K_PAGES is not set
269# CONFIG_PPC_64K_PAGES is not set 286# CONFIG_PPC_64K_PAGES is not set
@@ -374,6 +391,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
374# CONFIG_ECONET is not set 391# CONFIG_ECONET is not set
375# CONFIG_WAN_ROUTER is not set 392# CONFIG_WAN_ROUTER is not set
376# CONFIG_PHONET is not set 393# CONFIG_PHONET is not set
394# CONFIG_IEEE802154 is not set
377# CONFIG_NET_SCHED is not set 395# CONFIG_NET_SCHED is not set
378# CONFIG_DCB is not set 396# CONFIG_DCB is not set
379 397
@@ -391,7 +409,11 @@ CONFIG_WIRELESS=y
391CONFIG_WIRELESS_OLD_REGULATORY=y 409CONFIG_WIRELESS_OLD_REGULATORY=y
392# CONFIG_WIRELESS_EXT is not set 410# CONFIG_WIRELESS_EXT is not set
393# CONFIG_LIB80211 is not set 411# CONFIG_LIB80211 is not set
394# CONFIG_MAC80211 is not set 412
413#
414# CFG80211 needs to be enabled for MAC80211
415#
416CONFIG_MAC80211_DEFAULT_PS_VALUE=0
395# CONFIG_WIMAX is not set 417# CONFIG_WIMAX is not set
396# CONFIG_RFKILL is not set 418# CONFIG_RFKILL is not set
397# CONFIG_NET_9P is not set 419# CONFIG_NET_9P is not set
@@ -507,6 +529,7 @@ CONFIG_MTD_NAND_FSL_ELBC=y
507CONFIG_OF_DEVICE=y 529CONFIG_OF_DEVICE=y
508CONFIG_OF_GPIO=y 530CONFIG_OF_GPIO=y
509CONFIG_OF_I2C=y 531CONFIG_OF_I2C=y
532CONFIG_OF_MDIO=y
510# CONFIG_PARPORT is not set 533# CONFIG_PARPORT is not set
511CONFIG_BLK_DEV=y 534CONFIG_BLK_DEV=y
512# CONFIG_BLK_DEV_FD is not set 535# CONFIG_BLK_DEV_FD is not set
@@ -542,7 +565,9 @@ CONFIG_MISC_DEVICES=y
542# 565#
543# CONFIG_EEPROM_AT24 is not set 566# CONFIG_EEPROM_AT24 is not set
544# CONFIG_EEPROM_LEGACY is not set 567# CONFIG_EEPROM_LEGACY is not set
568# CONFIG_EEPROM_MAX6875 is not set
545# CONFIG_EEPROM_93CX6 is not set 569# CONFIG_EEPROM_93CX6 is not set
570# CONFIG_CB710_CORE is not set
546CONFIG_HAVE_IDE=y 571CONFIG_HAVE_IDE=y
547# CONFIG_IDE is not set 572# CONFIG_IDE is not set
548 573
@@ -565,10 +590,6 @@ CONFIG_BLK_DEV_SD=y
565# CONFIG_BLK_DEV_SR is not set 590# CONFIG_BLK_DEV_SR is not set
566CONFIG_CHR_DEV_SG=y 591CONFIG_CHR_DEV_SG=y
567# CONFIG_CHR_DEV_SCH is not set 592# CONFIG_CHR_DEV_SCH is not set
568
569#
570# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
571#
572# CONFIG_SCSI_MULTI_LUN is not set 593# CONFIG_SCSI_MULTI_LUN is not set
573# CONFIG_SCSI_CONSTANTS is not set 594# CONFIG_SCSI_CONSTANTS is not set
574# CONFIG_SCSI_LOGGING is not set 595# CONFIG_SCSI_LOGGING is not set
@@ -586,6 +607,7 @@ CONFIG_SCSI_WAIT_SCAN=m
586CONFIG_SCSI_LOWLEVEL=y 607CONFIG_SCSI_LOWLEVEL=y
587# CONFIG_ISCSI_TCP is not set 608# CONFIG_ISCSI_TCP is not set
588# CONFIG_SCSI_CXGB3_ISCSI is not set 609# CONFIG_SCSI_CXGB3_ISCSI is not set
610# CONFIG_SCSI_BNX2_ISCSI is not set
589# CONFIG_BLK_DEV_3W_XXXX_RAID is not set 611# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
590# CONFIG_SCSI_3W_9XXX is not set 612# CONFIG_SCSI_3W_9XXX is not set
591# CONFIG_SCSI_ACARD is not set 613# CONFIG_SCSI_ACARD is not set
@@ -594,6 +616,7 @@ CONFIG_SCSI_LOWLEVEL=y
594# CONFIG_SCSI_AIC7XXX_OLD is not set 616# CONFIG_SCSI_AIC7XXX_OLD is not set
595# CONFIG_SCSI_AIC79XX is not set 617# CONFIG_SCSI_AIC79XX is not set
596# CONFIG_SCSI_AIC94XX is not set 618# CONFIG_SCSI_AIC94XX is not set
619# CONFIG_SCSI_MVSAS is not set
597# CONFIG_SCSI_DPT_I2O is not set 620# CONFIG_SCSI_DPT_I2O is not set
598# CONFIG_SCSI_ADVANSYS is not set 621# CONFIG_SCSI_ADVANSYS is not set
599# CONFIG_SCSI_ARCMSR is not set 622# CONFIG_SCSI_ARCMSR is not set
@@ -613,7 +636,6 @@ CONFIG_SCSI_LOWLEVEL=y
613# CONFIG_SCSI_IPS is not set 636# CONFIG_SCSI_IPS is not set
614# CONFIG_SCSI_INITIO is not set 637# CONFIG_SCSI_INITIO is not set
615# CONFIG_SCSI_INIA100 is not set 638# CONFIG_SCSI_INIA100 is not set
616# CONFIG_SCSI_MVSAS is not set
617# CONFIG_SCSI_STEX is not set 639# CONFIG_SCSI_STEX is not set
618# CONFIG_SCSI_SYM53C8XX_2 is not set 640# CONFIG_SCSI_SYM53C8XX_2 is not set
619# CONFIG_SCSI_IPR is not set 641# CONFIG_SCSI_IPR is not set
@@ -697,14 +719,17 @@ CONFIG_ATA_SFF=y
697# 719#
698 720
699# 721#
700# Enable only one of the two stacks, unless you know what you are doing 722# You can enable one or both FireWire driver stacks.
723#
724
725#
726# See the help texts for more information.
701# 727#
702# CONFIG_FIREWIRE is not set 728# CONFIG_FIREWIRE is not set
703# CONFIG_IEEE1394 is not set 729# CONFIG_IEEE1394 is not set
704# CONFIG_I2O is not set 730# CONFIG_I2O is not set
705# CONFIG_MACINTOSH_DRIVERS is not set 731# CONFIG_MACINTOSH_DRIVERS is not set
706CONFIG_NETDEVICES=y 732CONFIG_NETDEVICES=y
707CONFIG_COMPAT_NET_DEV_OPS=y
708# CONFIG_DUMMY is not set 733# CONFIG_DUMMY is not set
709# CONFIG_BONDING is not set 734# CONFIG_BONDING is not set
710# CONFIG_MACVLAN is not set 735# CONFIG_MACVLAN is not set
@@ -751,6 +776,7 @@ CONFIG_MII=y
751# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set 776# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
752# CONFIG_NET_PCI is not set 777# CONFIG_NET_PCI is not set
753# CONFIG_B44 is not set 778# CONFIG_B44 is not set
779# CONFIG_KS8842 is not set
754# CONFIG_ATL2 is not set 780# CONFIG_ATL2 is not set
755CONFIG_NETDEV_1000=y 781CONFIG_NETDEV_1000=y
756# CONFIG_ACENIC is not set 782# CONFIG_ACENIC is not set
@@ -770,11 +796,13 @@ CONFIG_NETDEV_1000=y
770# CONFIG_VIA_VELOCITY is not set 796# CONFIG_VIA_VELOCITY is not set
771# CONFIG_TIGON3 is not set 797# CONFIG_TIGON3 is not set
772# CONFIG_BNX2 is not set 798# CONFIG_BNX2 is not set
799# CONFIG_CNIC is not set
773CONFIG_FSL_PQ_MDIO=y 800CONFIG_FSL_PQ_MDIO=y
774CONFIG_GIANFAR=y 801CONFIG_GIANFAR=y
775CONFIG_UCC_GETH=y 802CONFIG_UCC_GETH=y
776# CONFIG_UGETH_MAGIC_PACKET is not set 803# CONFIG_UGETH_MAGIC_PACKET is not set
777# CONFIG_UGETH_TX_ON_DEMAND is not set 804# CONFIG_UGETH_TX_ON_DEMAND is not set
805# CONFIG_MV643XX_ETH is not set
778# CONFIG_QLA3XXX is not set 806# CONFIG_QLA3XXX is not set
779# CONFIG_ATL1 is not set 807# CONFIG_ATL1 is not set
780# CONFIG_ATL1E is not set 808# CONFIG_ATL1E is not set
@@ -965,13 +993,17 @@ CONFIG_I2C_MPC=y
965# CONFIG_SENSORS_PCF8574 is not set 993# CONFIG_SENSORS_PCF8574 is not set
966# CONFIG_PCF8575 is not set 994# CONFIG_PCF8575 is not set
967# CONFIG_SENSORS_PCA9539 is not set 995# CONFIG_SENSORS_PCA9539 is not set
968# CONFIG_SENSORS_MAX6875 is not set
969# CONFIG_SENSORS_TSL2550 is not set 996# CONFIG_SENSORS_TSL2550 is not set
970# CONFIG_I2C_DEBUG_CORE is not set 997# CONFIG_I2C_DEBUG_CORE is not set
971# CONFIG_I2C_DEBUG_ALGO is not set 998# CONFIG_I2C_DEBUG_ALGO is not set
972# CONFIG_I2C_DEBUG_BUS is not set 999# CONFIG_I2C_DEBUG_BUS is not set
973# CONFIG_I2C_DEBUG_CHIP is not set 1000# CONFIG_I2C_DEBUG_CHIP is not set
974# CONFIG_SPI is not set 1001# CONFIG_SPI is not set
1002
1003#
1004# PPS support
1005#
1006# CONFIG_PPS is not set
975CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y 1007CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
976CONFIG_ARCH_REQUIRE_GPIOLIB=y 1008CONFIG_ARCH_REQUIRE_GPIOLIB=y
977CONFIG_GPIOLIB=y 1009CONFIG_GPIOLIB=y
@@ -1050,6 +1082,7 @@ CONFIG_HWMON=y
1050# CONFIG_SENSORS_SMSC47B397 is not set 1082# CONFIG_SENSORS_SMSC47B397 is not set
1051# CONFIG_SENSORS_ADS7828 is not set 1083# CONFIG_SENSORS_ADS7828 is not set
1052# CONFIG_SENSORS_THMC50 is not set 1084# CONFIG_SENSORS_THMC50 is not set
1085# CONFIG_SENSORS_TMP401 is not set
1053# CONFIG_SENSORS_VIA686A is not set 1086# CONFIG_SENSORS_VIA686A is not set
1054# CONFIG_SENSORS_VT1211 is not set 1087# CONFIG_SENSORS_VT1211 is not set
1055# CONFIG_SENSORS_VT8231 is not set 1088# CONFIG_SENSORS_VT8231 is not set
@@ -1104,24 +1137,9 @@ CONFIG_SSB_POSSIBLE=y
1104# CONFIG_MFD_WM8400 is not set 1137# CONFIG_MFD_WM8400 is not set
1105# CONFIG_MFD_WM8350_I2C is not set 1138# CONFIG_MFD_WM8350_I2C is not set
1106# CONFIG_MFD_PCF50633 is not set 1139# CONFIG_MFD_PCF50633 is not set
1140# CONFIG_AB3100_CORE is not set
1107# CONFIG_REGULATOR is not set 1141# CONFIG_REGULATOR is not set
1108 1142# CONFIG_MEDIA_SUPPORT is not set
1109#
1110# Multimedia devices
1111#
1112
1113#
1114# Multimedia core support
1115#
1116# CONFIG_VIDEO_DEV is not set
1117# CONFIG_DVB_CORE is not set
1118# CONFIG_VIDEO_MEDIA is not set
1119
1120#
1121# Multimedia drivers
1122#
1123CONFIG_DAB=y
1124# CONFIG_USB_DABUSB is not set
1125 1143
1126# 1144#
1127# Graphics support 1145# Graphics support
@@ -1159,7 +1177,7 @@ CONFIG_HID_BELKIN=y
1159CONFIG_HID_CHERRY=y 1177CONFIG_HID_CHERRY=y
1160CONFIG_HID_CHICONY=y 1178CONFIG_HID_CHICONY=y
1161CONFIG_HID_CYPRESS=y 1179CONFIG_HID_CYPRESS=y
1162# CONFIG_DRAGONRISE_FF is not set 1180# CONFIG_HID_DRAGONRISE is not set
1163CONFIG_HID_EZKEY=y 1181CONFIG_HID_EZKEY=y
1164# CONFIG_HID_KYE is not set 1182# CONFIG_HID_KYE is not set
1165CONFIG_HID_GYRATION=y 1183CONFIG_HID_GYRATION=y
@@ -1176,10 +1194,11 @@ CONFIG_HID_PETALYNX=y
1176CONFIG_HID_SAMSUNG=y 1194CONFIG_HID_SAMSUNG=y
1177CONFIG_HID_SONY=y 1195CONFIG_HID_SONY=y
1178CONFIG_HID_SUNPLUS=y 1196CONFIG_HID_SUNPLUS=y
1179# CONFIG_GREENASIA_FF is not set 1197# CONFIG_HID_GREENASIA is not set
1198# CONFIG_HID_SMARTJOYPLUS is not set
1180# CONFIG_HID_TOPSEED is not set 1199# CONFIG_HID_TOPSEED is not set
1181CONFIG_THRUSTMASTER_FF=m 1200# CONFIG_HID_THRUSTMASTER is not set
1182CONFIG_ZEROPLUS_FF=m 1201# CONFIG_HID_ZEROPLUS is not set
1183CONFIG_USB_SUPPORT=y 1202CONFIG_USB_SUPPORT=y
1184CONFIG_USB_ARCH_HAS_HCD=y 1203CONFIG_USB_ARCH_HAS_HCD=y
1185CONFIG_USB_ARCH_HAS_OHCI=y 1204CONFIG_USB_ARCH_HAS_OHCI=y
@@ -1205,6 +1224,7 @@ CONFIG_USB_MON=y
1205# USB Host Controller Drivers 1224# USB Host Controller Drivers
1206# 1225#
1207# CONFIG_USB_C67X00_HCD is not set 1226# CONFIG_USB_C67X00_HCD is not set
1227# CONFIG_USB_XHCI_HCD is not set
1208CONFIG_USB_EHCI_HCD=y 1228CONFIG_USB_EHCI_HCD=y
1209CONFIG_USB_EHCI_ROOT_HUB_TT=y 1229CONFIG_USB_EHCI_ROOT_HUB_TT=y
1210# CONFIG_USB_EHCI_TT_NEWSCHED is not set 1230# CONFIG_USB_EHCI_TT_NEWSCHED is not set
@@ -1291,6 +1311,10 @@ CONFIG_USB_EHCI_HCD_PPC_OF=y
1291# CONFIG_DMADEVICES is not set 1311# CONFIG_DMADEVICES is not set
1292# CONFIG_AUXDISPLAY is not set 1312# CONFIG_AUXDISPLAY is not set
1293# CONFIG_UIO is not set 1313# CONFIG_UIO is not set
1314
1315#
1316# TI VLYNQ
1317#
1294# CONFIG_STAGING is not set 1318# CONFIG_STAGING is not set
1295 1319
1296# 1320#
@@ -1310,10 +1334,12 @@ CONFIG_FS_MBCACHE=y
1310# CONFIG_REISERFS_FS is not set 1334# CONFIG_REISERFS_FS is not set
1311# CONFIG_JFS_FS is not set 1335# CONFIG_JFS_FS is not set
1312# CONFIG_FS_POSIX_ACL is not set 1336# CONFIG_FS_POSIX_ACL is not set
1313CONFIG_FILE_LOCKING=y
1314# CONFIG_XFS_FS is not set 1337# CONFIG_XFS_FS is not set
1338# CONFIG_GFS2_FS is not set
1315# CONFIG_OCFS2_FS is not set 1339# CONFIG_OCFS2_FS is not set
1316# CONFIG_BTRFS_FS is not set 1340# CONFIG_BTRFS_FS is not set
1341CONFIG_FILE_LOCKING=y
1342CONFIG_FSNOTIFY=y
1317CONFIG_DNOTIFY=y 1343CONFIG_DNOTIFY=y
1318CONFIG_INOTIFY=y 1344CONFIG_INOTIFY=y
1319CONFIG_INOTIFY_USER=y 1345CONFIG_INOTIFY_USER=y
@@ -1377,6 +1403,7 @@ CONFIG_NFS_FS=y
1377CONFIG_NFS_V3=y 1403CONFIG_NFS_V3=y
1378# CONFIG_NFS_V3_ACL is not set 1404# CONFIG_NFS_V3_ACL is not set
1379CONFIG_NFS_V4=y 1405CONFIG_NFS_V4=y
1406# CONFIG_NFS_V4_1 is not set
1380CONFIG_ROOT_NFS=y 1407CONFIG_ROOT_NFS=y
1381# CONFIG_NFSD is not set 1408# CONFIG_NFSD is not set
1382CONFIG_LOCKD=y 1409CONFIG_LOCKD=y
@@ -1413,7 +1440,46 @@ CONFIG_MSDOS_PARTITION=y
1413# CONFIG_KARMA_PARTITION is not set 1440# CONFIG_KARMA_PARTITION is not set
1414# CONFIG_EFI_PARTITION is not set 1441# CONFIG_EFI_PARTITION is not set
1415# CONFIG_SYSV68_PARTITION is not set 1442# CONFIG_SYSV68_PARTITION is not set
1416# CONFIG_NLS is not set 1443CONFIG_NLS=y
1444CONFIG_NLS_DEFAULT="iso8859-1"
1445# CONFIG_NLS_CODEPAGE_437 is not set
1446# CONFIG_NLS_CODEPAGE_737 is not set
1447# CONFIG_NLS_CODEPAGE_775 is not set
1448# CONFIG_NLS_CODEPAGE_850 is not set
1449# CONFIG_NLS_CODEPAGE_852 is not set
1450# CONFIG_NLS_CODEPAGE_855 is not set
1451# CONFIG_NLS_CODEPAGE_857 is not set
1452# CONFIG_NLS_CODEPAGE_860 is not set
1453# CONFIG_NLS_CODEPAGE_861 is not set
1454# CONFIG_NLS_CODEPAGE_862 is not set
1455# CONFIG_NLS_CODEPAGE_863 is not set
1456# CONFIG_NLS_CODEPAGE_864 is not set
1457# CONFIG_NLS_CODEPAGE_865 is not set
1458# CONFIG_NLS_CODEPAGE_866 is not set
1459# CONFIG_NLS_CODEPAGE_869 is not set
1460# CONFIG_NLS_CODEPAGE_936 is not set
1461# CONFIG_NLS_CODEPAGE_950 is not set
1462# CONFIG_NLS_CODEPAGE_932 is not set
1463# CONFIG_NLS_CODEPAGE_949 is not set
1464# CONFIG_NLS_CODEPAGE_874 is not set
1465# CONFIG_NLS_ISO8859_8 is not set
1466# CONFIG_NLS_CODEPAGE_1250 is not set
1467# CONFIG_NLS_CODEPAGE_1251 is not set
1468# CONFIG_NLS_ASCII is not set
1469# CONFIG_NLS_ISO8859_1 is not set
1470# CONFIG_NLS_ISO8859_2 is not set
1471# CONFIG_NLS_ISO8859_3 is not set
1472# CONFIG_NLS_ISO8859_4 is not set
1473# CONFIG_NLS_ISO8859_5 is not set
1474# CONFIG_NLS_ISO8859_6 is not set
1475# CONFIG_NLS_ISO8859_7 is not set
1476# CONFIG_NLS_ISO8859_9 is not set
1477# CONFIG_NLS_ISO8859_13 is not set
1478# CONFIG_NLS_ISO8859_14 is not set
1479# CONFIG_NLS_ISO8859_15 is not set
1480# CONFIG_NLS_KOI8_R is not set
1481# CONFIG_NLS_KOI8_U is not set
1482# CONFIG_NLS_UTF8 is not set
1417# CONFIG_DLM is not set 1483# CONFIG_DLM is not set
1418CONFIG_UCC_FAST=y 1484CONFIG_UCC_FAST=y
1419CONFIG_UCC=y 1485CONFIG_UCC=y
@@ -1438,6 +1504,7 @@ CONFIG_HAS_IOPORT=y
1438CONFIG_HAS_DMA=y 1504CONFIG_HAS_DMA=y
1439CONFIG_HAVE_LMB=y 1505CONFIG_HAVE_LMB=y
1440CONFIG_NLATTR=y 1506CONFIG_NLATTR=y
1507CONFIG_GENERIC_ATOMIC64=y
1441 1508
1442# 1509#
1443# Kernel hacking 1510# Kernel hacking
@@ -1461,22 +1528,11 @@ CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
1461CONFIG_HAVE_DYNAMIC_FTRACE=y 1528CONFIG_HAVE_DYNAMIC_FTRACE=y
1462CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y 1529CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
1463CONFIG_TRACING_SUPPORT=y 1530CONFIG_TRACING_SUPPORT=y
1464 1531# CONFIG_FTRACE is not set
1465#
1466# Tracers
1467#
1468# CONFIG_FUNCTION_TRACER is not set
1469# CONFIG_SCHED_TRACER is not set
1470# CONFIG_CONTEXT_SWITCH_TRACER is not set
1471# CONFIG_EVENT_TRACER is not set
1472# CONFIG_BOOT_TRACER is not set
1473# CONFIG_TRACE_BRANCH_PROFILING is not set
1474# CONFIG_STACK_TRACER is not set
1475# CONFIG_KMEMTRACE is not set
1476# CONFIG_WORKQUEUE_TRACER is not set
1477# CONFIG_BLK_DEV_IO_TRACE is not set
1478# CONFIG_SAMPLES is not set 1532# CONFIG_SAMPLES is not set
1479CONFIG_HAVE_ARCH_KGDB=y 1533CONFIG_HAVE_ARCH_KGDB=y
1534# CONFIG_PPC_DISABLE_WERROR is not set
1535CONFIG_PPC_WERROR=y
1480CONFIG_PRINT_STACK_DEPTH=64 1536CONFIG_PRINT_STACK_DEPTH=64
1481# CONFIG_IRQSTACKS is not set 1537# CONFIG_IRQSTACKS is not set
1482# CONFIG_BOOTX_TEXT is not set 1538# CONFIG_BOOTX_TEXT is not set
diff --git a/arch/powerpc/configs/mpc85xx_defconfig b/arch/powerpc/configs/mpc85xx_defconfig
index c162724fed4f..ada595898af1 100644
--- a/arch/powerpc/configs/mpc85xx_defconfig
+++ b/arch/powerpc/configs/mpc85xx_defconfig
@@ -1,14 +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.30-rc2 3# Linux kernel version: 2.6.31-rc4
4# Tue Apr 21 15:40:23 2009 4# Wed Jul 29 23:31:55 2009
5# 5#
6# CONFIG_PPC64 is not set 6# CONFIG_PPC64 is not set
7 7
8# 8#
9# Processor support 9# Processor support
10# 10#
11# CONFIG_6xx is not set 11# CONFIG_PPC_BOOK3S_32 is not set
12CONFIG_PPC_85xx=y 12CONFIG_PPC_85xx=y
13# CONFIG_PPC_8xx is not set 13# CONFIG_PPC_8xx is not set
14# CONFIG_40x is not set 14# CONFIG_40x is not set
@@ -34,15 +34,16 @@ CONFIG_GENERIC_TIME=y
34CONFIG_GENERIC_TIME_VSYSCALL=y 34CONFIG_GENERIC_TIME_VSYSCALL=y
35CONFIG_GENERIC_CLOCKEVENTS=y 35CONFIG_GENERIC_CLOCKEVENTS=y
36CONFIG_GENERIC_HARDIRQS=y 36CONFIG_GENERIC_HARDIRQS=y
37CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
37# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set 38# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set
38CONFIG_IRQ_PER_CPU=y 39CONFIG_IRQ_PER_CPU=y
39CONFIG_STACKTRACE_SUPPORT=y 40CONFIG_STACKTRACE_SUPPORT=y
40CONFIG_HAVE_LATENCYTOP_SUPPORT=y 41CONFIG_HAVE_LATENCYTOP_SUPPORT=y
42CONFIG_TRACE_IRQFLAGS_SUPPORT=y
41CONFIG_LOCKDEP_SUPPORT=y 43CONFIG_LOCKDEP_SUPPORT=y
42CONFIG_RWSEM_XCHGADD_ALGORITHM=y 44CONFIG_RWSEM_XCHGADD_ALGORITHM=y
43CONFIG_ARCH_HAS_ILOG2_U32=y 45CONFIG_ARCH_HAS_ILOG2_U32=y
44CONFIG_GENERIC_HWEIGHT=y 46CONFIG_GENERIC_HWEIGHT=y
45CONFIG_GENERIC_CALIBRATE_DELAY=y
46CONFIG_GENERIC_FIND_NEXT_BIT=y 47CONFIG_GENERIC_FIND_NEXT_BIT=y
47CONFIG_GENERIC_GPIO=y 48CONFIG_GENERIC_GPIO=y
48# CONFIG_ARCH_NO_VIRT_TO_BUS is not set 49# CONFIG_ARCH_NO_VIRT_TO_BUS is not set
@@ -57,11 +58,13 @@ CONFIG_PPC_UDBG_16550=y
57# CONFIG_GENERIC_TBSYNC is not set 58# CONFIG_GENERIC_TBSYNC is not set
58CONFIG_AUDIT_ARCH=y 59CONFIG_AUDIT_ARCH=y
59CONFIG_GENERIC_BUG=y 60CONFIG_GENERIC_BUG=y
61CONFIG_DTC=y
60CONFIG_DEFAULT_UIMAGE=y 62CONFIG_DEFAULT_UIMAGE=y
61# CONFIG_PPC_DCR_NATIVE is not set 63# CONFIG_PPC_DCR_NATIVE is not set
62# CONFIG_PPC_DCR_MMIO is not set 64# CONFIG_PPC_DCR_MMIO is not set
63CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y 65CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y
64CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" 66CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
67CONFIG_CONSTRUCTORS=y
65 68
66# 69#
67# General setup 70# General setup
@@ -116,7 +119,6 @@ CONFIG_SYSCTL_SYSCALL=y
116CONFIG_KALLSYMS=y 119CONFIG_KALLSYMS=y
117CONFIG_KALLSYMS_ALL=y 120CONFIG_KALLSYMS_ALL=y
118CONFIG_KALLSYMS_EXTRA_PASS=y 121CONFIG_KALLSYMS_EXTRA_PASS=y
119# CONFIG_STRIP_ASM_SYMS is not set
120CONFIG_HOTPLUG=y 122CONFIG_HOTPLUG=y
121CONFIG_PRINTK=y 123CONFIG_PRINTK=y
122CONFIG_BUG=y 124CONFIG_BUG=y
@@ -129,9 +131,16 @@ CONFIG_TIMERFD=y
129CONFIG_EVENTFD=y 131CONFIG_EVENTFD=y
130CONFIG_SHMEM=y 132CONFIG_SHMEM=y
131CONFIG_AIO=y 133CONFIG_AIO=y
134CONFIG_HAVE_PERF_COUNTERS=y
135
136#
137# Performance Counters
138#
139# CONFIG_PERF_COUNTERS is not set
132CONFIG_VM_EVENT_COUNTERS=y 140CONFIG_VM_EVENT_COUNTERS=y
133CONFIG_PCI_QUIRKS=y 141CONFIG_PCI_QUIRKS=y
134CONFIG_SLUB_DEBUG=y 142CONFIG_SLUB_DEBUG=y
143# CONFIG_STRIP_ASM_SYMS is not set
135CONFIG_COMPAT_BRK=y 144CONFIG_COMPAT_BRK=y
136# CONFIG_SLAB is not set 145# CONFIG_SLAB is not set
137CONFIG_SLUB=y 146CONFIG_SLUB=y
@@ -146,6 +155,11 @@ CONFIG_HAVE_KPROBES=y
146CONFIG_HAVE_KRETPROBES=y 155CONFIG_HAVE_KRETPROBES=y
147CONFIG_HAVE_ARCH_TRACEHOOK=y 156CONFIG_HAVE_ARCH_TRACEHOOK=y
148CONFIG_HAVE_CLK=y 157CONFIG_HAVE_CLK=y
158
159#
160# GCOV-based kernel profiling
161#
162# CONFIG_GCOV_KERNEL is not set
149# CONFIG_SLOW_WORK is not set 163# CONFIG_SLOW_WORK is not set
150# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set 164# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
151CONFIG_SLABINFO=y 165CONFIG_SLABINFO=y
@@ -158,7 +172,7 @@ CONFIG_MODULE_FORCE_UNLOAD=y
158CONFIG_MODVERSIONS=y 172CONFIG_MODVERSIONS=y
159# CONFIG_MODULE_SRCVERSION_ALL is not set 173# CONFIG_MODULE_SRCVERSION_ALL is not set
160CONFIG_BLOCK=y 174CONFIG_BLOCK=y
161CONFIG_LBD=y 175CONFIG_LBDAF=y
162# CONFIG_BLK_DEV_BSG is not set 176# CONFIG_BLK_DEV_BSG is not set
163# CONFIG_BLK_DEV_INTEGRITY is not set 177# CONFIG_BLK_DEV_INTEGRITY is not set
164 178
@@ -191,6 +205,7 @@ CONFIG_MPC8536_DS=y
191CONFIG_MPC85xx_DS=y 205CONFIG_MPC85xx_DS=y
192CONFIG_SOCRATES=y 206CONFIG_SOCRATES=y
193CONFIG_KSI8560=y 207CONFIG_KSI8560=y
208# CONFIG_XES_MPC85xx is not set
194CONFIG_STX_GP3=y 209CONFIG_STX_GP3=y
195CONFIG_TQM8540=y 210CONFIG_TQM8540=y
196CONFIG_TQM8541=y 211CONFIG_TQM8541=y
@@ -241,7 +256,9 @@ CONFIG_BINFMT_ELF=y
241# CONFIG_HAVE_AOUT is not set 256# CONFIG_HAVE_AOUT is not set
242CONFIG_BINFMT_MISC=m 257CONFIG_BINFMT_MISC=m
243CONFIG_MATH_EMULATION=y 258CONFIG_MATH_EMULATION=y
244# CONFIG_IOMMU_HELPER is not set 259CONFIG_IOMMU_HELPER=y
260CONFIG_SWIOTLB=y
261CONFIG_PPC_NEED_DMA_SYNC_OPS=y
245CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y 262CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
246CONFIG_ARCH_HAS_WALK_MEMORY=y 263CONFIG_ARCH_HAS_WALK_MEMORY=y
247CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y 264CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y
@@ -260,9 +277,9 @@ CONFIG_MIGRATION=y
260CONFIG_ZONE_DMA_FLAG=1 277CONFIG_ZONE_DMA_FLAG=1
261CONFIG_BOUNCE=y 278CONFIG_BOUNCE=y
262CONFIG_VIRT_TO_BUS=y 279CONFIG_VIRT_TO_BUS=y
263CONFIG_UNEVICTABLE_LRU=y
264CONFIG_HAVE_MLOCK=y 280CONFIG_HAVE_MLOCK=y
265CONFIG_HAVE_MLOCKED_PAGE_BIT=y 281CONFIG_HAVE_MLOCKED_PAGE_BIT=y
282CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
266CONFIG_PPC_4K_PAGES=y 283CONFIG_PPC_4K_PAGES=y
267# CONFIG_PPC_16K_PAGES is not set 284# CONFIG_PPC_16K_PAGES is not set
268# CONFIG_PPC_64K_PAGES is not set 285# CONFIG_PPC_64K_PAGES is not set
@@ -296,7 +313,8 @@ CONFIG_ARCH_SUPPORTS_MSI=y
296# CONFIG_PCI_IOV is not set 313# CONFIG_PCI_IOV is not set
297# CONFIG_PCCARD is not set 314# CONFIG_PCCARD is not set
298# CONFIG_HOTPLUG_PCI is not set 315# CONFIG_HOTPLUG_PCI is not set
299# CONFIG_HAS_RAPIDIO is not set 316CONFIG_HAS_RAPIDIO=y
317# CONFIG_RAPIDIO is not set
300 318
301# 319#
302# Advanced setup 320# Advanced setup
@@ -406,6 +424,7 @@ CONFIG_SCTP_HMAC_MD5=y
406# CONFIG_ECONET is not set 424# CONFIG_ECONET is not set
407# CONFIG_WAN_ROUTER is not set 425# CONFIG_WAN_ROUTER is not set
408# CONFIG_PHONET is not set 426# CONFIG_PHONET is not set
427# CONFIG_IEEE802154 is not set
409# CONFIG_NET_SCHED is not set 428# CONFIG_NET_SCHED is not set
410# CONFIG_DCB is not set 429# CONFIG_DCB is not set
411 430
@@ -424,7 +443,11 @@ CONFIG_WIRELESS=y
424CONFIG_WIRELESS_OLD_REGULATORY=y 443CONFIG_WIRELESS_OLD_REGULATORY=y
425# CONFIG_WIRELESS_EXT is not set 444# CONFIG_WIRELESS_EXT is not set
426# CONFIG_LIB80211 is not set 445# CONFIG_LIB80211 is not set
427# CONFIG_MAC80211 is not set 446
447#
448# CFG80211 needs to be enabled for MAC80211
449#
450CONFIG_MAC80211_DEFAULT_PS_VALUE=0
428# CONFIG_WIMAX is not set 451# CONFIG_WIMAX is not set
429# CONFIG_RFKILL is not set 452# CONFIG_RFKILL is not set
430# CONFIG_NET_9P is not set 453# CONFIG_NET_9P is not set
@@ -450,6 +473,7 @@ CONFIG_EXTRA_FIRMWARE=""
450CONFIG_OF_DEVICE=y 473CONFIG_OF_DEVICE=y
451CONFIG_OF_GPIO=y 474CONFIG_OF_GPIO=y
452CONFIG_OF_I2C=y 475CONFIG_OF_I2C=y
476CONFIG_OF_MDIO=y
453# CONFIG_PARPORT is not set 477# CONFIG_PARPORT is not set
454CONFIG_BLK_DEV=y 478CONFIG_BLK_DEV=y
455# CONFIG_BLK_DEV_FD is not set 479# CONFIG_BLK_DEV_FD is not set
@@ -485,7 +509,9 @@ CONFIG_MISC_DEVICES=y
485# 509#
486# CONFIG_EEPROM_AT24 is not set 510# CONFIG_EEPROM_AT24 is not set
487CONFIG_EEPROM_LEGACY=y 511CONFIG_EEPROM_LEGACY=y
512# CONFIG_EEPROM_MAX6875 is not set
488# CONFIG_EEPROM_93CX6 is not set 513# CONFIG_EEPROM_93CX6 is not set
514# CONFIG_CB710_CORE is not set
489CONFIG_HAVE_IDE=y 515CONFIG_HAVE_IDE=y
490# CONFIG_IDE is not set 516# CONFIG_IDE is not set
491 517
@@ -509,10 +535,6 @@ CONFIG_BLK_DEV_SR=y
509# CONFIG_BLK_DEV_SR_VENDOR is not set 535# CONFIG_BLK_DEV_SR_VENDOR is not set
510CONFIG_CHR_DEV_SG=y 536CONFIG_CHR_DEV_SG=y
511# CONFIG_CHR_DEV_SCH is not set 537# CONFIG_CHR_DEV_SCH is not set
512
513#
514# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
515#
516CONFIG_SCSI_MULTI_LUN=y 538CONFIG_SCSI_MULTI_LUN=y
517# CONFIG_SCSI_CONSTANTS is not set 539# CONFIG_SCSI_CONSTANTS is not set
518CONFIG_SCSI_LOGGING=y 540CONFIG_SCSI_LOGGING=y
@@ -530,6 +552,7 @@ CONFIG_SCSI_WAIT_SCAN=m
530CONFIG_SCSI_LOWLEVEL=y 552CONFIG_SCSI_LOWLEVEL=y
531# CONFIG_ISCSI_TCP is not set 553# CONFIG_ISCSI_TCP is not set
532# CONFIG_SCSI_CXGB3_ISCSI is not set 554# CONFIG_SCSI_CXGB3_ISCSI is not set
555# CONFIG_SCSI_BNX2_ISCSI is not set
533# CONFIG_BLK_DEV_3W_XXXX_RAID is not set 556# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
534# CONFIG_SCSI_3W_9XXX is not set 557# CONFIG_SCSI_3W_9XXX is not set
535# CONFIG_SCSI_ACARD is not set 558# CONFIG_SCSI_ACARD is not set
@@ -538,6 +561,7 @@ CONFIG_SCSI_LOWLEVEL=y
538# CONFIG_SCSI_AIC7XXX_OLD is not set 561# CONFIG_SCSI_AIC7XXX_OLD is not set
539# CONFIG_SCSI_AIC79XX is not set 562# CONFIG_SCSI_AIC79XX is not set
540# CONFIG_SCSI_AIC94XX is not set 563# CONFIG_SCSI_AIC94XX is not set
564# CONFIG_SCSI_MVSAS is not set
541# CONFIG_SCSI_DPT_I2O is not set 565# CONFIG_SCSI_DPT_I2O is not set
542# CONFIG_SCSI_ADVANSYS is not set 566# CONFIG_SCSI_ADVANSYS is not set
543# CONFIG_SCSI_ARCMSR is not set 567# CONFIG_SCSI_ARCMSR is not set
@@ -557,7 +581,6 @@ CONFIG_SCSI_LOWLEVEL=y
557# CONFIG_SCSI_IPS is not set 581# CONFIG_SCSI_IPS is not set
558# CONFIG_SCSI_INITIO is not set 582# CONFIG_SCSI_INITIO is not set
559# CONFIG_SCSI_INIA100 is not set 583# CONFIG_SCSI_INIA100 is not set
560# CONFIG_SCSI_MVSAS is not set
561# CONFIG_SCSI_STEX is not set 584# CONFIG_SCSI_STEX is not set
562# CONFIG_SCSI_SYM53C8XX_2 is not set 585# CONFIG_SCSI_SYM53C8XX_2 is not set
563# CONFIG_SCSI_IPR is not set 586# CONFIG_SCSI_IPR is not set
@@ -641,14 +664,17 @@ CONFIG_PATA_ALI=y
641# 664#
642 665
643# 666#
644# Enable only one of the two stacks, unless you know what you are doing 667# You can enable one or both FireWire driver stacks.
668#
669
670#
671# See the help texts for more information.
645# 672#
646# CONFIG_FIREWIRE is not set 673# CONFIG_FIREWIRE is not set
647# CONFIG_IEEE1394 is not set 674# CONFIG_IEEE1394 is not set
648# CONFIG_I2O is not set 675# CONFIG_I2O is not set
649# CONFIG_MACINTOSH_DRIVERS is not set 676# CONFIG_MACINTOSH_DRIVERS is not set
650CONFIG_NETDEVICES=y 677CONFIG_NETDEVICES=y
651CONFIG_COMPAT_NET_DEV_OPS=y
652CONFIG_DUMMY=y 678CONFIG_DUMMY=y
653# CONFIG_BONDING is not set 679# CONFIG_BONDING is not set
654# CONFIG_MACVLAN is not set 680# CONFIG_MACVLAN is not set
@@ -695,6 +721,7 @@ CONFIG_MII=y
695# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set 721# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
696# CONFIG_NET_PCI is not set 722# CONFIG_NET_PCI is not set
697# CONFIG_B44 is not set 723# CONFIG_B44 is not set
724# CONFIG_KS8842 is not set
698# CONFIG_ATL2 is not set 725# CONFIG_ATL2 is not set
699CONFIG_FS_ENET=y 726CONFIG_FS_ENET=y
700CONFIG_FS_ENET_HAS_SCC=y 727CONFIG_FS_ENET_HAS_SCC=y
@@ -718,11 +745,13 @@ CONFIG_NETDEV_1000=y
718# CONFIG_VIA_VELOCITY is not set 745# CONFIG_VIA_VELOCITY is not set
719# CONFIG_TIGON3 is not set 746# CONFIG_TIGON3 is not set
720# CONFIG_BNX2 is not set 747# CONFIG_BNX2 is not set
748# CONFIG_CNIC is not set
721CONFIG_FSL_PQ_MDIO=y 749CONFIG_FSL_PQ_MDIO=y
722CONFIG_GIANFAR=y 750CONFIG_GIANFAR=y
723CONFIG_UCC_GETH=y 751CONFIG_UCC_GETH=y
724# CONFIG_UGETH_MAGIC_PACKET is not set 752# CONFIG_UGETH_MAGIC_PACKET is not set
725# CONFIG_UGETH_TX_ON_DEMAND is not set 753# CONFIG_UGETH_TX_ON_DEMAND is not set
754# CONFIG_MV643XX_ETH is not set
726# CONFIG_QLA3XXX is not set 755# CONFIG_QLA3XXX is not set
727# CONFIG_ATL1 is not set 756# CONFIG_ATL1 is not set
728# CONFIG_ATL1E is not set 757# CONFIG_ATL1E is not set
@@ -897,6 +926,7 @@ CONFIG_I2C_HELPER_AUTO=y
897# I2C system bus drivers (mostly embedded / system-on-chip) 926# I2C system bus drivers (mostly embedded / system-on-chip)
898# 927#
899CONFIG_I2C_CPM=m 928CONFIG_I2C_CPM=m
929# CONFIG_I2C_DESIGNWARE is not set
900# CONFIG_I2C_GPIO is not set 930# CONFIG_I2C_GPIO is not set
901CONFIG_I2C_MPC=y 931CONFIG_I2C_MPC=y
902# CONFIG_I2C_OCORES is not set 932# CONFIG_I2C_OCORES is not set
@@ -927,13 +957,17 @@ CONFIG_I2C_MPC=y
927# CONFIG_SENSORS_PCF8574 is not set 957# CONFIG_SENSORS_PCF8574 is not set
928# CONFIG_PCF8575 is not set 958# CONFIG_PCF8575 is not set
929# CONFIG_SENSORS_PCA9539 is not set 959# CONFIG_SENSORS_PCA9539 is not set
930# CONFIG_SENSORS_MAX6875 is not set
931# CONFIG_SENSORS_TSL2550 is not set 960# CONFIG_SENSORS_TSL2550 is not set
932# CONFIG_I2C_DEBUG_CORE is not set 961# CONFIG_I2C_DEBUG_CORE is not set
933# CONFIG_I2C_DEBUG_ALGO is not set 962# CONFIG_I2C_DEBUG_ALGO is not set
934# CONFIG_I2C_DEBUG_BUS is not set 963# CONFIG_I2C_DEBUG_BUS is not set
935# CONFIG_I2C_DEBUG_CHIP is not set 964# CONFIG_I2C_DEBUG_CHIP is not set
936# CONFIG_SPI is not set 965# CONFIG_SPI is not set
966
967#
968# PPS support
969#
970# CONFIG_PPS is not set
937CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y 971CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
938CONFIG_ARCH_REQUIRE_GPIOLIB=y 972CONFIG_ARCH_REQUIRE_GPIOLIB=y
939CONFIG_GPIOLIB=y 973CONFIG_GPIOLIB=y
@@ -987,76 +1021,9 @@ CONFIG_SSB_POSSIBLE=y
987# CONFIG_MFD_WM8400 is not set 1021# CONFIG_MFD_WM8400 is not set
988# CONFIG_MFD_WM8350_I2C is not set 1022# CONFIG_MFD_WM8350_I2C is not set
989# CONFIG_MFD_PCF50633 is not set 1023# CONFIG_MFD_PCF50633 is not set
1024# CONFIG_AB3100_CORE is not set
990# CONFIG_REGULATOR is not set 1025# CONFIG_REGULATOR is not set
991 1026# CONFIG_MEDIA_SUPPORT is not set
992#
993# Multimedia devices
994#
995
996#
997# Multimedia core support
998#
999# CONFIG_VIDEO_DEV is not set
1000CONFIG_DVB_CORE=m
1001CONFIG_VIDEO_MEDIA=m
1002
1003#
1004# Multimedia drivers
1005#
1006# CONFIG_MEDIA_ATTACH is not set
1007CONFIG_MEDIA_TUNER=m
1008# CONFIG_MEDIA_TUNER_CUSTOMISE is not set
1009CONFIG_MEDIA_TUNER_SIMPLE=m
1010CONFIG_MEDIA_TUNER_TDA8290=m
1011CONFIG_MEDIA_TUNER_TDA9887=m
1012CONFIG_MEDIA_TUNER_TEA5761=m
1013CONFIG_MEDIA_TUNER_TEA5767=m
1014CONFIG_MEDIA_TUNER_MT20XX=m
1015CONFIG_MEDIA_TUNER_XC2028=m
1016CONFIG_MEDIA_TUNER_XC5000=m
1017CONFIG_MEDIA_TUNER_MC44S803=m
1018# CONFIG_DVB_DYNAMIC_MINORS is not set
1019CONFIG_DVB_CAPTURE_DRIVERS=y
1020
1021#
1022# Supported SAA7146 based PCI Adapters
1023#
1024# CONFIG_TTPCI_EEPROM is not set
1025# CONFIG_DVB_BUDGET_CORE is not set
1026
1027#
1028# Supported USB Adapters
1029#
1030# CONFIG_DVB_USB is not set
1031# CONFIG_DVB_TTUSB_BUDGET is not set
1032# CONFIG_DVB_TTUSB_DEC is not set
1033# CONFIG_DVB_SIANO_SMS1XXX is not set
1034
1035#
1036# Supported FlexCopII (B2C2) Adapters
1037#
1038# CONFIG_DVB_B2C2_FLEXCOP is not set
1039
1040#
1041# Supported BT878 Adapters
1042#
1043
1044#
1045# Supported Pluto2 Adapters
1046#
1047# CONFIG_DVB_PLUTO2 is not set
1048
1049#
1050# Supported SDMC DM1105 Adapters
1051#
1052# CONFIG_DVB_DM1105 is not set
1053
1054#
1055# Supported DVB Frontends
1056#
1057# CONFIG_DVB_FE_CUSTOMISE is not set
1058CONFIG_DAB=y
1059# CONFIG_USB_DABUSB is not set
1060 1027
1061# 1028#
1062# Graphics support 1029# Graphics support
@@ -1096,6 +1063,11 @@ CONFIG_SND_VERBOSE_PROCFS=y
1096# CONFIG_SND_VERBOSE_PRINTK is not set 1063# CONFIG_SND_VERBOSE_PRINTK is not set
1097# CONFIG_SND_DEBUG is not set 1064# CONFIG_SND_DEBUG is not set
1098CONFIG_SND_VMASTER=y 1065CONFIG_SND_VMASTER=y
1066# CONFIG_SND_RAWMIDI_SEQ is not set
1067# CONFIG_SND_OPL3_LIB_SEQ is not set
1068# CONFIG_SND_OPL4_LIB_SEQ is not set
1069# CONFIG_SND_SBAWE_SEQ is not set
1070# CONFIG_SND_EMU10K1_SEQ is not set
1099CONFIG_SND_AC97_CODEC=y 1071CONFIG_SND_AC97_CODEC=y
1100CONFIG_SND_DRIVERS=y 1072CONFIG_SND_DRIVERS=y
1101# CONFIG_SND_DUMMY is not set 1073# CONFIG_SND_DUMMY is not set
@@ -1122,6 +1094,7 @@ CONFIG_SND_PCI=y
1122# CONFIG_SND_CS4281 is not set 1094# CONFIG_SND_CS4281 is not set
1123# CONFIG_SND_CS46XX is not set 1095# CONFIG_SND_CS46XX is not set
1124# CONFIG_SND_CS5530 is not set 1096# CONFIG_SND_CS5530 is not set
1097# CONFIG_SND_CTXFI is not set
1125# CONFIG_SND_DARLA20 is not set 1098# CONFIG_SND_DARLA20 is not set
1126# CONFIG_SND_GINA20 is not set 1099# CONFIG_SND_GINA20 is not set
1127# CONFIG_SND_LAYLA20 is not set 1100# CONFIG_SND_LAYLA20 is not set
@@ -1152,6 +1125,7 @@ CONFIG_SND_PCI=y
1152CONFIG_SND_INTEL8X0=y 1125CONFIG_SND_INTEL8X0=y
1153# CONFIG_SND_INTEL8X0M is not set 1126# CONFIG_SND_INTEL8X0M is not set
1154# CONFIG_SND_KORG1212 is not set 1127# CONFIG_SND_KORG1212 is not set
1128# CONFIG_SND_LX6464ES is not set
1155# CONFIG_SND_MAESTRO3 is not set 1129# CONFIG_SND_MAESTRO3 is not set
1156# CONFIG_SND_MIXART is not set 1130# CONFIG_SND_MIXART is not set
1157# CONFIG_SND_NM256 is not set 1131# CONFIG_SND_NM256 is not set
@@ -1196,7 +1170,7 @@ CONFIG_HID_BELKIN=y
1196CONFIG_HID_CHERRY=y 1170CONFIG_HID_CHERRY=y
1197CONFIG_HID_CHICONY=y 1171CONFIG_HID_CHICONY=y
1198CONFIG_HID_CYPRESS=y 1172CONFIG_HID_CYPRESS=y
1199# CONFIG_DRAGONRISE_FF is not set 1173# CONFIG_HID_DRAGONRISE is not set
1200CONFIG_HID_EZKEY=y 1174CONFIG_HID_EZKEY=y
1201# CONFIG_HID_KYE is not set 1175# CONFIG_HID_KYE is not set
1202CONFIG_HID_GYRATION=y 1176CONFIG_HID_GYRATION=y
@@ -1213,10 +1187,11 @@ CONFIG_HID_PETALYNX=y
1213CONFIG_HID_SAMSUNG=y 1187CONFIG_HID_SAMSUNG=y
1214CONFIG_HID_SONY=y 1188CONFIG_HID_SONY=y
1215CONFIG_HID_SUNPLUS=y 1189CONFIG_HID_SUNPLUS=y
1216# CONFIG_GREENASIA_FF is not set 1190# CONFIG_HID_GREENASIA is not set
1191# CONFIG_HID_SMARTJOYPLUS is not set
1217# CONFIG_HID_TOPSEED is not set 1192# CONFIG_HID_TOPSEED is not set
1218CONFIG_THRUSTMASTER_FF=m 1193# CONFIG_HID_THRUSTMASTER is not set
1219CONFIG_ZEROPLUS_FF=m 1194# CONFIG_HID_ZEROPLUS is not set
1220CONFIG_USB_SUPPORT=y 1195CONFIG_USB_SUPPORT=y
1221CONFIG_USB_ARCH_HAS_HCD=y 1196CONFIG_USB_ARCH_HAS_HCD=y
1222CONFIG_USB_ARCH_HAS_OHCI=y 1197CONFIG_USB_ARCH_HAS_OHCI=y
@@ -1242,6 +1217,7 @@ CONFIG_USB_MON=y
1242# USB Host Controller Drivers 1217# USB Host Controller Drivers
1243# 1218#
1244# CONFIG_USB_C67X00_HCD is not set 1219# CONFIG_USB_C67X00_HCD is not set
1220# CONFIG_USB_XHCI_HCD is not set
1245CONFIG_USB_EHCI_HCD=y 1221CONFIG_USB_EHCI_HCD=y
1246CONFIG_USB_EHCI_ROOT_HUB_TT=y 1222CONFIG_USB_EHCI_ROOT_HUB_TT=y
1247# CONFIG_USB_EHCI_TT_NEWSCHED is not set 1223# CONFIG_USB_EHCI_TT_NEWSCHED is not set
@@ -1251,9 +1227,9 @@ CONFIG_USB_EHCI_HCD_PPC_OF=y
1251# CONFIG_USB_ISP116X_HCD is not set 1227# CONFIG_USB_ISP116X_HCD is not set
1252# CONFIG_USB_ISP1760_HCD is not set 1228# CONFIG_USB_ISP1760_HCD is not set
1253CONFIG_USB_OHCI_HCD=y 1229CONFIG_USB_OHCI_HCD=y
1254CONFIG_USB_OHCI_HCD_PPC_OF=y
1255CONFIG_USB_OHCI_HCD_PPC_OF_BE=y 1230CONFIG_USB_OHCI_HCD_PPC_OF_BE=y
1256CONFIG_USB_OHCI_HCD_PPC_OF_LE=y 1231CONFIG_USB_OHCI_HCD_PPC_OF_LE=y
1232CONFIG_USB_OHCI_HCD_PPC_OF=y
1257CONFIG_USB_OHCI_HCD_PCI=y 1233CONFIG_USB_OHCI_HCD_PCI=y
1258CONFIG_USB_OHCI_BIG_ENDIAN_DESC=y 1234CONFIG_USB_OHCI_BIG_ENDIAN_DESC=y
1259CONFIG_USB_OHCI_BIG_ENDIAN_MMIO=y 1235CONFIG_USB_OHCI_BIG_ENDIAN_MMIO=y
@@ -1352,8 +1328,6 @@ CONFIG_EDAC=y
1352# CONFIG_EDAC_DEBUG is not set 1328# CONFIG_EDAC_DEBUG is not set
1353CONFIG_EDAC_MM_EDAC=y 1329CONFIG_EDAC_MM_EDAC=y
1354CONFIG_EDAC_MPC85XX=y 1330CONFIG_EDAC_MPC85XX=y
1355# CONFIG_EDAC_AMD8131 is not set
1356# CONFIG_EDAC_AMD8111 is not set
1357CONFIG_RTC_LIB=y 1331CONFIG_RTC_LIB=y
1358CONFIG_RTC_CLASS=y 1332CONFIG_RTC_CLASS=y
1359CONFIG_RTC_HCTOSYS=y 1333CONFIG_RTC_HCTOSYS=y
@@ -1385,6 +1359,7 @@ CONFIG_RTC_INTF_DEV=y
1385# CONFIG_RTC_DRV_S35390A is not set 1359# CONFIG_RTC_DRV_S35390A is not set
1386# CONFIG_RTC_DRV_FM3130 is not set 1360# CONFIG_RTC_DRV_FM3130 is not set
1387# CONFIG_RTC_DRV_RX8581 is not set 1361# CONFIG_RTC_DRV_RX8581 is not set
1362# CONFIG_RTC_DRV_RX8025 is not set
1388 1363
1389# 1364#
1390# SPI RTC drivers 1365# SPI RTC drivers
@@ -1425,6 +1400,10 @@ CONFIG_DMA_ENGINE=y
1425# CONFIG_DMATEST is not set 1400# CONFIG_DMATEST is not set
1426# CONFIG_AUXDISPLAY is not set 1401# CONFIG_AUXDISPLAY is not set
1427# CONFIG_UIO is not set 1402# CONFIG_UIO is not set
1403
1404#
1405# TI VLYNQ
1406#
1428# CONFIG_STAGING is not set 1407# CONFIG_STAGING is not set
1429 1408
1430# 1409#
@@ -1445,11 +1424,12 @@ CONFIG_FS_MBCACHE=y
1445# CONFIG_REISERFS_FS is not set 1424# CONFIG_REISERFS_FS is not set
1446# CONFIG_JFS_FS is not set 1425# CONFIG_JFS_FS is not set
1447# CONFIG_FS_POSIX_ACL is not set 1426# CONFIG_FS_POSIX_ACL is not set
1448CONFIG_FILE_LOCKING=y
1449# CONFIG_XFS_FS is not set 1427# CONFIG_XFS_FS is not set
1450# CONFIG_GFS2_FS is not set 1428# CONFIG_GFS2_FS is not set
1451# CONFIG_OCFS2_FS is not set 1429# CONFIG_OCFS2_FS is not set
1452# CONFIG_BTRFS_FS is not set 1430# CONFIG_BTRFS_FS is not set
1431CONFIG_FILE_LOCKING=y
1432CONFIG_FSNOTIFY=y
1453CONFIG_DNOTIFY=y 1433CONFIG_DNOTIFY=y
1454CONFIG_INOTIFY=y 1434CONFIG_INOTIFY=y
1455CONFIG_INOTIFY_USER=y 1435CONFIG_INOTIFY_USER=y
@@ -1524,6 +1504,7 @@ CONFIG_NFS_FS=y
1524CONFIG_NFS_V3=y 1504CONFIG_NFS_V3=y
1525# CONFIG_NFS_V3_ACL is not set 1505# CONFIG_NFS_V3_ACL is not set
1526CONFIG_NFS_V4=y 1506CONFIG_NFS_V4=y
1507# CONFIG_NFS_V4_1 is not set
1527CONFIG_ROOT_NFS=y 1508CONFIG_ROOT_NFS=y
1528CONFIG_NFSD=y 1509CONFIG_NFSD=y
1529# CONFIG_NFSD_V3 is not set 1510# CONFIG_NFSD_V3 is not set
@@ -1628,6 +1609,7 @@ CONFIG_HAS_IOPORT=y
1628CONFIG_HAS_DMA=y 1609CONFIG_HAS_DMA=y
1629CONFIG_HAVE_LMB=y 1610CONFIG_HAVE_LMB=y
1630CONFIG_NLATTR=y 1611CONFIG_NLATTR=y
1612CONFIG_GENERIC_ATOMIC64=y
1631 1613
1632# 1614#
1633# Kernel hacking 1615# Kernel hacking
@@ -1658,6 +1640,9 @@ CONFIG_SCHED_DEBUG=y
1658# CONFIG_RT_MUTEX_TESTER is not set 1640# CONFIG_RT_MUTEX_TESTER is not set
1659# CONFIG_DEBUG_SPINLOCK is not set 1641# CONFIG_DEBUG_SPINLOCK is not set
1660# CONFIG_DEBUG_MUTEXES is not set 1642# CONFIG_DEBUG_MUTEXES is not set
1643# CONFIG_DEBUG_LOCK_ALLOC is not set
1644# CONFIG_PROVE_LOCKING is not set
1645# CONFIG_LOCK_STAT is not set
1661# CONFIG_DEBUG_SPINLOCK_SLEEP is not set 1646# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
1662# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set 1647# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
1663# CONFIG_DEBUG_KOBJECT is not set 1648# CONFIG_DEBUG_KOBJECT is not set
@@ -1670,7 +1655,6 @@ CONFIG_DEBUG_INFO=y
1670# CONFIG_DEBUG_LIST is not set 1655# CONFIG_DEBUG_LIST is not set
1671# CONFIG_DEBUG_SG is not set 1656# CONFIG_DEBUG_SG is not set
1672# CONFIG_DEBUG_NOTIFIERS is not set 1657# CONFIG_DEBUG_NOTIFIERS is not set
1673# CONFIG_BOOT_PRINTK_DELAY is not set
1674# CONFIG_RCU_TORTURE_TEST is not set 1658# CONFIG_RCU_TORTURE_TEST is not set
1675# CONFIG_RCU_CPU_STALL_DETECTOR is not set 1659# CONFIG_RCU_CPU_STALL_DETECTOR is not set
1676# CONFIG_BACKTRACE_SELF_TEST is not set 1660# CONFIG_BACKTRACE_SELF_TEST is not set
@@ -1684,16 +1668,15 @@ CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
1684CONFIG_HAVE_DYNAMIC_FTRACE=y 1668CONFIG_HAVE_DYNAMIC_FTRACE=y
1685CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y 1669CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
1686CONFIG_TRACING_SUPPORT=y 1670CONFIG_TRACING_SUPPORT=y
1687 1671CONFIG_FTRACE=y
1688#
1689# Tracers
1690#
1691# CONFIG_FUNCTION_TRACER is not set 1672# CONFIG_FUNCTION_TRACER is not set
1673# CONFIG_IRQSOFF_TRACER is not set
1692# CONFIG_SCHED_TRACER is not set 1674# CONFIG_SCHED_TRACER is not set
1693# CONFIG_CONTEXT_SWITCH_TRACER is not set 1675# CONFIG_ENABLE_DEFAULT_TRACERS is not set
1694# CONFIG_EVENT_TRACER is not set
1695# CONFIG_BOOT_TRACER is not set 1676# CONFIG_BOOT_TRACER is not set
1696# CONFIG_TRACE_BRANCH_PROFILING is not set 1677CONFIG_BRANCH_PROFILE_NONE=y
1678# CONFIG_PROFILE_ANNOTATED_BRANCHES is not set
1679# CONFIG_PROFILE_ALL_BRANCHES is not set
1697# CONFIG_STACK_TRACER is not set 1680# CONFIG_STACK_TRACER is not set
1698# CONFIG_KMEMTRACE is not set 1681# CONFIG_KMEMTRACE is not set
1699# CONFIG_WORKQUEUE_TRACER is not set 1682# CONFIG_WORKQUEUE_TRACER is not set
@@ -1702,9 +1685,13 @@ CONFIG_TRACING_SUPPORT=y
1702# CONFIG_SAMPLES is not set 1685# CONFIG_SAMPLES is not set
1703CONFIG_HAVE_ARCH_KGDB=y 1686CONFIG_HAVE_ARCH_KGDB=y
1704# CONFIG_KGDB is not set 1687# CONFIG_KGDB is not set
1688# CONFIG_KMEMCHECK is not set
1689# CONFIG_PPC_DISABLE_WERROR is not set
1690CONFIG_PPC_WERROR=y
1705CONFIG_PRINT_STACK_DEPTH=64 1691CONFIG_PRINT_STACK_DEPTH=64
1706# CONFIG_DEBUG_STACKOVERFLOW is not set 1692# CONFIG_DEBUG_STACKOVERFLOW is not set
1707# CONFIG_DEBUG_STACK_USAGE is not set 1693# CONFIG_DEBUG_STACK_USAGE is not set
1694# CONFIG_PPC_EMULATED_STATS is not set
1708# CONFIG_CODE_PATCHING_SELFTEST is not set 1695# CONFIG_CODE_PATCHING_SELFTEST is not set
1709# CONFIG_FTR_FIXUP_SELFTEST is not set 1696# CONFIG_FTR_FIXUP_SELFTEST is not set
1710# CONFIG_MSI_BITMAP_SELFTEST is not set 1697# CONFIG_MSI_BITMAP_SELFTEST is not set
diff --git a/arch/powerpc/configs/mpc85xx_smp_defconfig b/arch/powerpc/configs/mpc85xx_smp_defconfig
index 1aa1c508d600..db082ce5a1c5 100644
--- a/arch/powerpc/configs/mpc85xx_smp_defconfig
+++ b/arch/powerpc/configs/mpc85xx_smp_defconfig
@@ -1,14 +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.30-rc2 3# Linux kernel version: 2.6.31-rc4
4# Tue Apr 21 15:41:18 2009 4# Wed Jul 29 23:31:56 2009
5# 5#
6# CONFIG_PPC64 is not set 6# CONFIG_PPC64 is not set
7 7
8# 8#
9# Processor support 9# Processor support
10# 10#
11# CONFIG_6xx is not set 11# CONFIG_PPC_BOOK3S_32 is not set
12CONFIG_PPC_85xx=y 12CONFIG_PPC_85xx=y
13# CONFIG_PPC_8xx is not set 13# CONFIG_PPC_8xx is not set
14# CONFIG_40x is not set 14# CONFIG_40x is not set
@@ -35,15 +35,16 @@ CONFIG_GENERIC_TIME=y
35CONFIG_GENERIC_TIME_VSYSCALL=y 35CONFIG_GENERIC_TIME_VSYSCALL=y
36CONFIG_GENERIC_CLOCKEVENTS=y 36CONFIG_GENERIC_CLOCKEVENTS=y
37CONFIG_GENERIC_HARDIRQS=y 37CONFIG_GENERIC_HARDIRQS=y
38CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
38# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set 39# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set
39CONFIG_IRQ_PER_CPU=y 40CONFIG_IRQ_PER_CPU=y
40CONFIG_STACKTRACE_SUPPORT=y 41CONFIG_STACKTRACE_SUPPORT=y
41CONFIG_HAVE_LATENCYTOP_SUPPORT=y 42CONFIG_HAVE_LATENCYTOP_SUPPORT=y
43CONFIG_TRACE_IRQFLAGS_SUPPORT=y
42CONFIG_LOCKDEP_SUPPORT=y 44CONFIG_LOCKDEP_SUPPORT=y
43CONFIG_RWSEM_XCHGADD_ALGORITHM=y 45CONFIG_RWSEM_XCHGADD_ALGORITHM=y
44CONFIG_ARCH_HAS_ILOG2_U32=y 46CONFIG_ARCH_HAS_ILOG2_U32=y
45CONFIG_GENERIC_HWEIGHT=y 47CONFIG_GENERIC_HWEIGHT=y
46CONFIG_GENERIC_CALIBRATE_DELAY=y
47CONFIG_GENERIC_FIND_NEXT_BIT=y 48CONFIG_GENERIC_FIND_NEXT_BIT=y
48CONFIG_GENERIC_GPIO=y 49CONFIG_GENERIC_GPIO=y
49# CONFIG_ARCH_NO_VIRT_TO_BUS is not set 50# CONFIG_ARCH_NO_VIRT_TO_BUS is not set
@@ -58,11 +59,13 @@ CONFIG_PPC_UDBG_16550=y
58CONFIG_GENERIC_TBSYNC=y 59CONFIG_GENERIC_TBSYNC=y
59CONFIG_AUDIT_ARCH=y 60CONFIG_AUDIT_ARCH=y
60CONFIG_GENERIC_BUG=y 61CONFIG_GENERIC_BUG=y
62CONFIG_DTC=y
61CONFIG_DEFAULT_UIMAGE=y 63CONFIG_DEFAULT_UIMAGE=y
62# CONFIG_PPC_DCR_NATIVE is not set 64# CONFIG_PPC_DCR_NATIVE is not set
63# CONFIG_PPC_DCR_MMIO is not set 65# CONFIG_PPC_DCR_MMIO is not set
64CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y 66CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y
65CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" 67CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
68CONFIG_CONSTRUCTORS=y
66 69
67# 70#
68# General setup 71# General setup
@@ -117,7 +120,6 @@ CONFIG_SYSCTL_SYSCALL=y
117CONFIG_KALLSYMS=y 120CONFIG_KALLSYMS=y
118CONFIG_KALLSYMS_ALL=y 121CONFIG_KALLSYMS_ALL=y
119CONFIG_KALLSYMS_EXTRA_PASS=y 122CONFIG_KALLSYMS_EXTRA_PASS=y
120# CONFIG_STRIP_ASM_SYMS is not set
121CONFIG_HOTPLUG=y 123CONFIG_HOTPLUG=y
122CONFIG_PRINTK=y 124CONFIG_PRINTK=y
123CONFIG_BUG=y 125CONFIG_BUG=y
@@ -130,9 +132,16 @@ CONFIG_TIMERFD=y
130CONFIG_EVENTFD=y 132CONFIG_EVENTFD=y
131CONFIG_SHMEM=y 133CONFIG_SHMEM=y
132CONFIG_AIO=y 134CONFIG_AIO=y
135CONFIG_HAVE_PERF_COUNTERS=y
136
137#
138# Performance Counters
139#
140# CONFIG_PERF_COUNTERS is not set
133CONFIG_VM_EVENT_COUNTERS=y 141CONFIG_VM_EVENT_COUNTERS=y
134CONFIG_PCI_QUIRKS=y 142CONFIG_PCI_QUIRKS=y
135CONFIG_SLUB_DEBUG=y 143CONFIG_SLUB_DEBUG=y
144# CONFIG_STRIP_ASM_SYMS is not set
136CONFIG_COMPAT_BRK=y 145CONFIG_COMPAT_BRK=y
137# CONFIG_SLAB is not set 146# CONFIG_SLAB is not set
138CONFIG_SLUB=y 147CONFIG_SLUB=y
@@ -148,6 +157,11 @@ CONFIG_HAVE_KRETPROBES=y
148CONFIG_HAVE_ARCH_TRACEHOOK=y 157CONFIG_HAVE_ARCH_TRACEHOOK=y
149CONFIG_USE_GENERIC_SMP_HELPERS=y 158CONFIG_USE_GENERIC_SMP_HELPERS=y
150CONFIG_HAVE_CLK=y 159CONFIG_HAVE_CLK=y
160
161#
162# GCOV-based kernel profiling
163#
164# CONFIG_GCOV_KERNEL is not set
151# CONFIG_SLOW_WORK is not set 165# CONFIG_SLOW_WORK is not set
152# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set 166# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
153CONFIG_SLABINFO=y 167CONFIG_SLABINFO=y
@@ -161,7 +175,7 @@ CONFIG_MODVERSIONS=y
161# CONFIG_MODULE_SRCVERSION_ALL is not set 175# CONFIG_MODULE_SRCVERSION_ALL is not set
162CONFIG_STOP_MACHINE=y 176CONFIG_STOP_MACHINE=y
163CONFIG_BLOCK=y 177CONFIG_BLOCK=y
164CONFIG_LBD=y 178CONFIG_LBDAF=y
165# CONFIG_BLK_DEV_BSG is not set 179# CONFIG_BLK_DEV_BSG is not set
166# CONFIG_BLK_DEV_INTEGRITY is not set 180# CONFIG_BLK_DEV_INTEGRITY is not set
167 181
@@ -194,6 +208,7 @@ CONFIG_MPC8536_DS=y
194CONFIG_MPC85xx_DS=y 208CONFIG_MPC85xx_DS=y
195CONFIG_SOCRATES=y 209CONFIG_SOCRATES=y
196CONFIG_KSI8560=y 210CONFIG_KSI8560=y
211# CONFIG_XES_MPC85xx is not set
197CONFIG_STX_GP3=y 212CONFIG_STX_GP3=y
198CONFIG_TQM8540=y 213CONFIG_TQM8540=y
199CONFIG_TQM8541=y 214CONFIG_TQM8541=y
@@ -244,7 +259,9 @@ CONFIG_BINFMT_ELF=y
244# CONFIG_HAVE_AOUT is not set 259# CONFIG_HAVE_AOUT is not set
245CONFIG_BINFMT_MISC=m 260CONFIG_BINFMT_MISC=m
246CONFIG_MATH_EMULATION=y 261CONFIG_MATH_EMULATION=y
247# CONFIG_IOMMU_HELPER is not set 262CONFIG_IOMMU_HELPER=y
263CONFIG_SWIOTLB=y
264CONFIG_PPC_NEED_DMA_SYNC_OPS=y
248CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y 265CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
249CONFIG_ARCH_HAS_WALK_MEMORY=y 266CONFIG_ARCH_HAS_WALK_MEMORY=y
250CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y 267CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y
@@ -264,9 +281,9 @@ CONFIG_MIGRATION=y
264CONFIG_ZONE_DMA_FLAG=1 281CONFIG_ZONE_DMA_FLAG=1
265CONFIG_BOUNCE=y 282CONFIG_BOUNCE=y
266CONFIG_VIRT_TO_BUS=y 283CONFIG_VIRT_TO_BUS=y
267CONFIG_UNEVICTABLE_LRU=y
268CONFIG_HAVE_MLOCK=y 284CONFIG_HAVE_MLOCK=y
269CONFIG_HAVE_MLOCKED_PAGE_BIT=y 285CONFIG_HAVE_MLOCKED_PAGE_BIT=y
286CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
270CONFIG_PPC_4K_PAGES=y 287CONFIG_PPC_4K_PAGES=y
271# CONFIG_PPC_16K_PAGES is not set 288# CONFIG_PPC_16K_PAGES is not set
272# CONFIG_PPC_64K_PAGES is not set 289# CONFIG_PPC_64K_PAGES is not set
@@ -300,7 +317,8 @@ CONFIG_ARCH_SUPPORTS_MSI=y
300# CONFIG_PCI_IOV is not set 317# CONFIG_PCI_IOV is not set
301# CONFIG_PCCARD is not set 318# CONFIG_PCCARD is not set
302# CONFIG_HOTPLUG_PCI is not set 319# CONFIG_HOTPLUG_PCI is not set
303# CONFIG_HAS_RAPIDIO is not set 320CONFIG_HAS_RAPIDIO=y
321# CONFIG_RAPIDIO is not set
304 322
305# 323#
306# Advanced setup 324# Advanced setup
@@ -410,6 +428,7 @@ CONFIG_SCTP_HMAC_MD5=y
410# CONFIG_ECONET is not set 428# CONFIG_ECONET is not set
411# CONFIG_WAN_ROUTER is not set 429# CONFIG_WAN_ROUTER is not set
412# CONFIG_PHONET is not set 430# CONFIG_PHONET is not set
431# CONFIG_IEEE802154 is not set
413# CONFIG_NET_SCHED is not set 432# CONFIG_NET_SCHED is not set
414# CONFIG_DCB is not set 433# CONFIG_DCB is not set
415 434
@@ -428,7 +447,11 @@ CONFIG_WIRELESS=y
428CONFIG_WIRELESS_OLD_REGULATORY=y 447CONFIG_WIRELESS_OLD_REGULATORY=y
429# CONFIG_WIRELESS_EXT is not set 448# CONFIG_WIRELESS_EXT is not set
430# CONFIG_LIB80211 is not set 449# CONFIG_LIB80211 is not set
431# CONFIG_MAC80211 is not set 450
451#
452# CFG80211 needs to be enabled for MAC80211
453#
454CONFIG_MAC80211_DEFAULT_PS_VALUE=0
432# CONFIG_WIMAX is not set 455# CONFIG_WIMAX is not set
433# CONFIG_RFKILL is not set 456# CONFIG_RFKILL is not set
434# CONFIG_NET_9P is not set 457# CONFIG_NET_9P is not set
@@ -454,6 +477,7 @@ CONFIG_EXTRA_FIRMWARE=""
454CONFIG_OF_DEVICE=y 477CONFIG_OF_DEVICE=y
455CONFIG_OF_GPIO=y 478CONFIG_OF_GPIO=y
456CONFIG_OF_I2C=y 479CONFIG_OF_I2C=y
480CONFIG_OF_MDIO=y
457# CONFIG_PARPORT is not set 481# CONFIG_PARPORT is not set
458CONFIG_BLK_DEV=y 482CONFIG_BLK_DEV=y
459# CONFIG_BLK_DEV_FD is not set 483# CONFIG_BLK_DEV_FD is not set
@@ -489,7 +513,9 @@ CONFIG_MISC_DEVICES=y
489# 513#
490# CONFIG_EEPROM_AT24 is not set 514# CONFIG_EEPROM_AT24 is not set
491CONFIG_EEPROM_LEGACY=y 515CONFIG_EEPROM_LEGACY=y
516# CONFIG_EEPROM_MAX6875 is not set
492# CONFIG_EEPROM_93CX6 is not set 517# CONFIG_EEPROM_93CX6 is not set
518# CONFIG_CB710_CORE is not set
493CONFIG_HAVE_IDE=y 519CONFIG_HAVE_IDE=y
494# CONFIG_IDE is not set 520# CONFIG_IDE is not set
495 521
@@ -513,10 +539,6 @@ CONFIG_BLK_DEV_SR=y
513# CONFIG_BLK_DEV_SR_VENDOR is not set 539# CONFIG_BLK_DEV_SR_VENDOR is not set
514CONFIG_CHR_DEV_SG=y 540CONFIG_CHR_DEV_SG=y
515# CONFIG_CHR_DEV_SCH is not set 541# CONFIG_CHR_DEV_SCH is not set
516
517#
518# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
519#
520CONFIG_SCSI_MULTI_LUN=y 542CONFIG_SCSI_MULTI_LUN=y
521# CONFIG_SCSI_CONSTANTS is not set 543# CONFIG_SCSI_CONSTANTS is not set
522CONFIG_SCSI_LOGGING=y 544CONFIG_SCSI_LOGGING=y
@@ -534,6 +556,7 @@ CONFIG_SCSI_WAIT_SCAN=m
534CONFIG_SCSI_LOWLEVEL=y 556CONFIG_SCSI_LOWLEVEL=y
535# CONFIG_ISCSI_TCP is not set 557# CONFIG_ISCSI_TCP is not set
536# CONFIG_SCSI_CXGB3_ISCSI is not set 558# CONFIG_SCSI_CXGB3_ISCSI is not set
559# CONFIG_SCSI_BNX2_ISCSI is not set
537# CONFIG_BLK_DEV_3W_XXXX_RAID is not set 560# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
538# CONFIG_SCSI_3W_9XXX is not set 561# CONFIG_SCSI_3W_9XXX is not set
539# CONFIG_SCSI_ACARD is not set 562# CONFIG_SCSI_ACARD is not set
@@ -542,6 +565,7 @@ CONFIG_SCSI_LOWLEVEL=y
542# CONFIG_SCSI_AIC7XXX_OLD is not set 565# CONFIG_SCSI_AIC7XXX_OLD is not set
543# CONFIG_SCSI_AIC79XX is not set 566# CONFIG_SCSI_AIC79XX is not set
544# CONFIG_SCSI_AIC94XX is not set 567# CONFIG_SCSI_AIC94XX is not set
568# CONFIG_SCSI_MVSAS is not set
545# CONFIG_SCSI_DPT_I2O is not set 569# CONFIG_SCSI_DPT_I2O is not set
546# CONFIG_SCSI_ADVANSYS is not set 570# CONFIG_SCSI_ADVANSYS is not set
547# CONFIG_SCSI_ARCMSR is not set 571# CONFIG_SCSI_ARCMSR is not set
@@ -561,7 +585,6 @@ CONFIG_SCSI_LOWLEVEL=y
561# CONFIG_SCSI_IPS is not set 585# CONFIG_SCSI_IPS is not set
562# CONFIG_SCSI_INITIO is not set 586# CONFIG_SCSI_INITIO is not set
563# CONFIG_SCSI_INIA100 is not set 587# CONFIG_SCSI_INIA100 is not set
564# CONFIG_SCSI_MVSAS is not set
565# CONFIG_SCSI_STEX is not set 588# CONFIG_SCSI_STEX is not set
566# CONFIG_SCSI_SYM53C8XX_2 is not set 589# CONFIG_SCSI_SYM53C8XX_2 is not set
567# CONFIG_SCSI_IPR is not set 590# CONFIG_SCSI_IPR is not set
@@ -645,14 +668,17 @@ CONFIG_PATA_ALI=y
645# 668#
646 669
647# 670#
648# Enable only one of the two stacks, unless you know what you are doing 671# You can enable one or both FireWire driver stacks.
672#
673
674#
675# See the help texts for more information.
649# 676#
650# CONFIG_FIREWIRE is not set 677# CONFIG_FIREWIRE is not set
651# CONFIG_IEEE1394 is not set 678# CONFIG_IEEE1394 is not set
652# CONFIG_I2O is not set 679# CONFIG_I2O is not set
653# CONFIG_MACINTOSH_DRIVERS is not set 680# CONFIG_MACINTOSH_DRIVERS is not set
654CONFIG_NETDEVICES=y 681CONFIG_NETDEVICES=y
655CONFIG_COMPAT_NET_DEV_OPS=y
656CONFIG_DUMMY=y 682CONFIG_DUMMY=y
657# CONFIG_BONDING is not set 683# CONFIG_BONDING is not set
658# CONFIG_MACVLAN is not set 684# CONFIG_MACVLAN is not set
@@ -699,6 +725,7 @@ CONFIG_MII=y
699# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set 725# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
700# CONFIG_NET_PCI is not set 726# CONFIG_NET_PCI is not set
701# CONFIG_B44 is not set 727# CONFIG_B44 is not set
728# CONFIG_KS8842 is not set
702# CONFIG_ATL2 is not set 729# CONFIG_ATL2 is not set
703CONFIG_FS_ENET=y 730CONFIG_FS_ENET=y
704CONFIG_FS_ENET_HAS_SCC=y 731CONFIG_FS_ENET_HAS_SCC=y
@@ -722,11 +749,13 @@ CONFIG_NETDEV_1000=y
722# CONFIG_VIA_VELOCITY is not set 749# CONFIG_VIA_VELOCITY is not set
723# CONFIG_TIGON3 is not set 750# CONFIG_TIGON3 is not set
724# CONFIG_BNX2 is not set 751# CONFIG_BNX2 is not set
752# CONFIG_CNIC is not set
725CONFIG_FSL_PQ_MDIO=y 753CONFIG_FSL_PQ_MDIO=y
726CONFIG_GIANFAR=y 754CONFIG_GIANFAR=y
727CONFIG_UCC_GETH=y 755CONFIG_UCC_GETH=y
728# CONFIG_UGETH_MAGIC_PACKET is not set 756# CONFIG_UGETH_MAGIC_PACKET is not set
729# CONFIG_UGETH_TX_ON_DEMAND is not set 757# CONFIG_UGETH_TX_ON_DEMAND is not set
758# CONFIG_MV643XX_ETH is not set
730# CONFIG_QLA3XXX is not set 759# CONFIG_QLA3XXX is not set
731# CONFIG_ATL1 is not set 760# CONFIG_ATL1 is not set
732# CONFIG_ATL1E is not set 761# CONFIG_ATL1E is not set
@@ -901,6 +930,7 @@ CONFIG_I2C_HELPER_AUTO=y
901# I2C system bus drivers (mostly embedded / system-on-chip) 930# I2C system bus drivers (mostly embedded / system-on-chip)
902# 931#
903CONFIG_I2C_CPM=m 932CONFIG_I2C_CPM=m
933# CONFIG_I2C_DESIGNWARE is not set
904# CONFIG_I2C_GPIO is not set 934# CONFIG_I2C_GPIO is not set
905CONFIG_I2C_MPC=y 935CONFIG_I2C_MPC=y
906# CONFIG_I2C_OCORES is not set 936# CONFIG_I2C_OCORES is not set
@@ -931,13 +961,17 @@ CONFIG_I2C_MPC=y
931# CONFIG_SENSORS_PCF8574 is not set 961# CONFIG_SENSORS_PCF8574 is not set
932# CONFIG_PCF8575 is not set 962# CONFIG_PCF8575 is not set
933# CONFIG_SENSORS_PCA9539 is not set 963# CONFIG_SENSORS_PCA9539 is not set
934# CONFIG_SENSORS_MAX6875 is not set
935# CONFIG_SENSORS_TSL2550 is not set 964# CONFIG_SENSORS_TSL2550 is not set
936# CONFIG_I2C_DEBUG_CORE is not set 965# CONFIG_I2C_DEBUG_CORE is not set
937# CONFIG_I2C_DEBUG_ALGO is not set 966# CONFIG_I2C_DEBUG_ALGO is not set
938# CONFIG_I2C_DEBUG_BUS is not set 967# CONFIG_I2C_DEBUG_BUS is not set
939# CONFIG_I2C_DEBUG_CHIP is not set 968# CONFIG_I2C_DEBUG_CHIP is not set
940# CONFIG_SPI is not set 969# CONFIG_SPI is not set
970
971#
972# PPS support
973#
974# CONFIG_PPS is not set
941CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y 975CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
942CONFIG_ARCH_REQUIRE_GPIOLIB=y 976CONFIG_ARCH_REQUIRE_GPIOLIB=y
943CONFIG_GPIOLIB=y 977CONFIG_GPIOLIB=y
@@ -991,76 +1025,9 @@ CONFIG_SSB_POSSIBLE=y
991# CONFIG_MFD_WM8400 is not set 1025# CONFIG_MFD_WM8400 is not set
992# CONFIG_MFD_WM8350_I2C is not set 1026# CONFIG_MFD_WM8350_I2C is not set
993# CONFIG_MFD_PCF50633 is not set 1027# CONFIG_MFD_PCF50633 is not set
1028# CONFIG_AB3100_CORE is not set
994# CONFIG_REGULATOR is not set 1029# CONFIG_REGULATOR is not set
995 1030# CONFIG_MEDIA_SUPPORT is not set
996#
997# Multimedia devices
998#
999
1000#
1001# Multimedia core support
1002#
1003# CONFIG_VIDEO_DEV is not set
1004CONFIG_DVB_CORE=m
1005CONFIG_VIDEO_MEDIA=m
1006
1007#
1008# Multimedia drivers
1009#
1010# CONFIG_MEDIA_ATTACH is not set
1011CONFIG_MEDIA_TUNER=m
1012# CONFIG_MEDIA_TUNER_CUSTOMISE is not set
1013CONFIG_MEDIA_TUNER_SIMPLE=m
1014CONFIG_MEDIA_TUNER_TDA8290=m
1015CONFIG_MEDIA_TUNER_TDA9887=m
1016CONFIG_MEDIA_TUNER_TEA5761=m
1017CONFIG_MEDIA_TUNER_TEA5767=m
1018CONFIG_MEDIA_TUNER_MT20XX=m
1019CONFIG_MEDIA_TUNER_XC2028=m
1020CONFIG_MEDIA_TUNER_XC5000=m
1021CONFIG_MEDIA_TUNER_MC44S803=m
1022# CONFIG_DVB_DYNAMIC_MINORS is not set
1023CONFIG_DVB_CAPTURE_DRIVERS=y
1024
1025#
1026# Supported SAA7146 based PCI Adapters
1027#
1028# CONFIG_TTPCI_EEPROM is not set
1029# CONFIG_DVB_BUDGET_CORE is not set
1030
1031#
1032# Supported USB Adapters
1033#
1034# CONFIG_DVB_USB is not set
1035# CONFIG_DVB_TTUSB_BUDGET is not set
1036# CONFIG_DVB_TTUSB_DEC is not set
1037# CONFIG_DVB_SIANO_SMS1XXX is not set
1038
1039#
1040# Supported FlexCopII (B2C2) Adapters
1041#
1042# CONFIG_DVB_B2C2_FLEXCOP is not set
1043
1044#
1045# Supported BT878 Adapters
1046#
1047
1048#
1049# Supported Pluto2 Adapters
1050#
1051# CONFIG_DVB_PLUTO2 is not set
1052
1053#
1054# Supported SDMC DM1105 Adapters
1055#
1056# CONFIG_DVB_DM1105 is not set
1057
1058#
1059# Supported DVB Frontends
1060#
1061# CONFIG_DVB_FE_CUSTOMISE is not set
1062CONFIG_DAB=y
1063# CONFIG_USB_DABUSB is not set
1064 1031
1065# 1032#
1066# Graphics support 1033# Graphics support
@@ -1100,6 +1067,11 @@ CONFIG_SND_VERBOSE_PROCFS=y
1100# CONFIG_SND_VERBOSE_PRINTK is not set 1067# CONFIG_SND_VERBOSE_PRINTK is not set
1101# CONFIG_SND_DEBUG is not set 1068# CONFIG_SND_DEBUG is not set
1102CONFIG_SND_VMASTER=y 1069CONFIG_SND_VMASTER=y
1070# CONFIG_SND_RAWMIDI_SEQ is not set
1071# CONFIG_SND_OPL3_LIB_SEQ is not set
1072# CONFIG_SND_OPL4_LIB_SEQ is not set
1073# CONFIG_SND_SBAWE_SEQ is not set
1074# CONFIG_SND_EMU10K1_SEQ is not set
1103CONFIG_SND_AC97_CODEC=y 1075CONFIG_SND_AC97_CODEC=y
1104CONFIG_SND_DRIVERS=y 1076CONFIG_SND_DRIVERS=y
1105# CONFIG_SND_DUMMY is not set 1077# CONFIG_SND_DUMMY is not set
@@ -1126,6 +1098,7 @@ CONFIG_SND_PCI=y
1126# CONFIG_SND_CS4281 is not set 1098# CONFIG_SND_CS4281 is not set
1127# CONFIG_SND_CS46XX is not set 1099# CONFIG_SND_CS46XX is not set
1128# CONFIG_SND_CS5530 is not set 1100# CONFIG_SND_CS5530 is not set
1101# CONFIG_SND_CTXFI is not set
1129# CONFIG_SND_DARLA20 is not set 1102# CONFIG_SND_DARLA20 is not set
1130# CONFIG_SND_GINA20 is not set 1103# CONFIG_SND_GINA20 is not set
1131# CONFIG_SND_LAYLA20 is not set 1104# CONFIG_SND_LAYLA20 is not set
@@ -1156,6 +1129,7 @@ CONFIG_SND_PCI=y
1156CONFIG_SND_INTEL8X0=y 1129CONFIG_SND_INTEL8X0=y
1157# CONFIG_SND_INTEL8X0M is not set 1130# CONFIG_SND_INTEL8X0M is not set
1158# CONFIG_SND_KORG1212 is not set 1131# CONFIG_SND_KORG1212 is not set
1132# CONFIG_SND_LX6464ES is not set
1159# CONFIG_SND_MAESTRO3 is not set 1133# CONFIG_SND_MAESTRO3 is not set
1160# CONFIG_SND_MIXART is not set 1134# CONFIG_SND_MIXART is not set
1161# CONFIG_SND_NM256 is not set 1135# CONFIG_SND_NM256 is not set
@@ -1200,7 +1174,7 @@ CONFIG_HID_BELKIN=y
1200CONFIG_HID_CHERRY=y 1174CONFIG_HID_CHERRY=y
1201CONFIG_HID_CHICONY=y 1175CONFIG_HID_CHICONY=y
1202CONFIG_HID_CYPRESS=y 1176CONFIG_HID_CYPRESS=y
1203# CONFIG_DRAGONRISE_FF is not set 1177# CONFIG_HID_DRAGONRISE is not set
1204CONFIG_HID_EZKEY=y 1178CONFIG_HID_EZKEY=y
1205# CONFIG_HID_KYE is not set 1179# CONFIG_HID_KYE is not set
1206CONFIG_HID_GYRATION=y 1180CONFIG_HID_GYRATION=y
@@ -1217,10 +1191,11 @@ CONFIG_HID_PETALYNX=y
1217CONFIG_HID_SAMSUNG=y 1191CONFIG_HID_SAMSUNG=y
1218CONFIG_HID_SONY=y 1192CONFIG_HID_SONY=y
1219CONFIG_HID_SUNPLUS=y 1193CONFIG_HID_SUNPLUS=y
1220# CONFIG_GREENASIA_FF is not set 1194# CONFIG_HID_GREENASIA is not set
1195# CONFIG_HID_SMARTJOYPLUS is not set
1221# CONFIG_HID_TOPSEED is not set 1196# CONFIG_HID_TOPSEED is not set
1222CONFIG_THRUSTMASTER_FF=m 1197# CONFIG_HID_THRUSTMASTER is not set
1223CONFIG_ZEROPLUS_FF=m 1198# CONFIG_HID_ZEROPLUS is not set
1224CONFIG_USB_SUPPORT=y 1199CONFIG_USB_SUPPORT=y
1225CONFIG_USB_ARCH_HAS_HCD=y 1200CONFIG_USB_ARCH_HAS_HCD=y
1226CONFIG_USB_ARCH_HAS_OHCI=y 1201CONFIG_USB_ARCH_HAS_OHCI=y
@@ -1246,6 +1221,7 @@ CONFIG_USB_MON=y
1246# USB Host Controller Drivers 1221# USB Host Controller Drivers
1247# 1222#
1248# CONFIG_USB_C67X00_HCD is not set 1223# CONFIG_USB_C67X00_HCD is not set
1224# CONFIG_USB_XHCI_HCD is not set
1249CONFIG_USB_EHCI_HCD=y 1225CONFIG_USB_EHCI_HCD=y
1250CONFIG_USB_EHCI_ROOT_HUB_TT=y 1226CONFIG_USB_EHCI_ROOT_HUB_TT=y
1251# CONFIG_USB_EHCI_TT_NEWSCHED is not set 1227# CONFIG_USB_EHCI_TT_NEWSCHED is not set
@@ -1255,9 +1231,9 @@ CONFIG_USB_EHCI_HCD_PPC_OF=y
1255# CONFIG_USB_ISP116X_HCD is not set 1231# CONFIG_USB_ISP116X_HCD is not set
1256# CONFIG_USB_ISP1760_HCD is not set 1232# CONFIG_USB_ISP1760_HCD is not set
1257CONFIG_USB_OHCI_HCD=y 1233CONFIG_USB_OHCI_HCD=y
1258CONFIG_USB_OHCI_HCD_PPC_OF=y
1259CONFIG_USB_OHCI_HCD_PPC_OF_BE=y 1234CONFIG_USB_OHCI_HCD_PPC_OF_BE=y
1260CONFIG_USB_OHCI_HCD_PPC_OF_LE=y 1235CONFIG_USB_OHCI_HCD_PPC_OF_LE=y
1236CONFIG_USB_OHCI_HCD_PPC_OF=y
1261CONFIG_USB_OHCI_HCD_PCI=y 1237CONFIG_USB_OHCI_HCD_PCI=y
1262CONFIG_USB_OHCI_BIG_ENDIAN_DESC=y 1238CONFIG_USB_OHCI_BIG_ENDIAN_DESC=y
1263CONFIG_USB_OHCI_BIG_ENDIAN_MMIO=y 1239CONFIG_USB_OHCI_BIG_ENDIAN_MMIO=y
@@ -1356,8 +1332,6 @@ CONFIG_EDAC=y
1356# CONFIG_EDAC_DEBUG is not set 1332# CONFIG_EDAC_DEBUG is not set
1357CONFIG_EDAC_MM_EDAC=y 1333CONFIG_EDAC_MM_EDAC=y
1358CONFIG_EDAC_MPC85XX=y 1334CONFIG_EDAC_MPC85XX=y
1359# CONFIG_EDAC_AMD8131 is not set
1360# CONFIG_EDAC_AMD8111 is not set
1361CONFIG_RTC_LIB=y 1335CONFIG_RTC_LIB=y
1362CONFIG_RTC_CLASS=y 1336CONFIG_RTC_CLASS=y
1363CONFIG_RTC_HCTOSYS=y 1337CONFIG_RTC_HCTOSYS=y
@@ -1389,6 +1363,7 @@ CONFIG_RTC_INTF_DEV=y
1389# CONFIG_RTC_DRV_S35390A is not set 1363# CONFIG_RTC_DRV_S35390A is not set
1390# CONFIG_RTC_DRV_FM3130 is not set 1364# CONFIG_RTC_DRV_FM3130 is not set
1391# CONFIG_RTC_DRV_RX8581 is not set 1365# CONFIG_RTC_DRV_RX8581 is not set
1366# CONFIG_RTC_DRV_RX8025 is not set
1392 1367
1393# 1368#
1394# SPI RTC drivers 1369# SPI RTC drivers
@@ -1429,6 +1404,10 @@ CONFIG_DMA_ENGINE=y
1429# CONFIG_DMATEST is not set 1404# CONFIG_DMATEST is not set
1430# CONFIG_AUXDISPLAY is not set 1405# CONFIG_AUXDISPLAY is not set
1431# CONFIG_UIO is not set 1406# CONFIG_UIO is not set
1407
1408#
1409# TI VLYNQ
1410#
1432# CONFIG_STAGING is not set 1411# CONFIG_STAGING is not set
1433 1412
1434# 1413#
@@ -1449,11 +1428,12 @@ CONFIG_FS_MBCACHE=y
1449# CONFIG_REISERFS_FS is not set 1428# CONFIG_REISERFS_FS is not set
1450# CONFIG_JFS_FS is not set 1429# CONFIG_JFS_FS is not set
1451# CONFIG_FS_POSIX_ACL is not set 1430# CONFIG_FS_POSIX_ACL is not set
1452CONFIG_FILE_LOCKING=y
1453# CONFIG_XFS_FS is not set 1431# CONFIG_XFS_FS is not set
1454# CONFIG_GFS2_FS is not set 1432# CONFIG_GFS2_FS is not set
1455# CONFIG_OCFS2_FS is not set 1433# CONFIG_OCFS2_FS is not set
1456# CONFIG_BTRFS_FS is not set 1434# CONFIG_BTRFS_FS is not set
1435CONFIG_FILE_LOCKING=y
1436CONFIG_FSNOTIFY=y
1457CONFIG_DNOTIFY=y 1437CONFIG_DNOTIFY=y
1458CONFIG_INOTIFY=y 1438CONFIG_INOTIFY=y
1459CONFIG_INOTIFY_USER=y 1439CONFIG_INOTIFY_USER=y
@@ -1528,6 +1508,7 @@ CONFIG_NFS_FS=y
1528CONFIG_NFS_V3=y 1508CONFIG_NFS_V3=y
1529# CONFIG_NFS_V3_ACL is not set 1509# CONFIG_NFS_V3_ACL is not set
1530CONFIG_NFS_V4=y 1510CONFIG_NFS_V4=y
1511# CONFIG_NFS_V4_1 is not set
1531CONFIG_ROOT_NFS=y 1512CONFIG_ROOT_NFS=y
1532CONFIG_NFSD=y 1513CONFIG_NFSD=y
1533# CONFIG_NFSD_V3 is not set 1514# CONFIG_NFSD_V3 is not set
@@ -1632,6 +1613,7 @@ CONFIG_HAS_IOPORT=y
1632CONFIG_HAS_DMA=y 1613CONFIG_HAS_DMA=y
1633CONFIG_HAVE_LMB=y 1614CONFIG_HAVE_LMB=y
1634CONFIG_NLATTR=y 1615CONFIG_NLATTR=y
1616CONFIG_GENERIC_ATOMIC64=y
1635 1617
1636# 1618#
1637# Kernel hacking 1619# Kernel hacking
@@ -1662,6 +1644,9 @@ CONFIG_SCHED_DEBUG=y
1662# CONFIG_RT_MUTEX_TESTER is not set 1644# CONFIG_RT_MUTEX_TESTER is not set
1663# CONFIG_DEBUG_SPINLOCK is not set 1645# CONFIG_DEBUG_SPINLOCK is not set
1664# CONFIG_DEBUG_MUTEXES is not set 1646# CONFIG_DEBUG_MUTEXES is not set
1647# CONFIG_DEBUG_LOCK_ALLOC is not set
1648# CONFIG_PROVE_LOCKING is not set
1649# CONFIG_LOCK_STAT is not set
1665# CONFIG_DEBUG_SPINLOCK_SLEEP is not set 1650# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
1666# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set 1651# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
1667# CONFIG_DEBUG_KOBJECT is not set 1652# CONFIG_DEBUG_KOBJECT is not set
@@ -1674,7 +1659,6 @@ CONFIG_DEBUG_INFO=y
1674# CONFIG_DEBUG_LIST is not set 1659# CONFIG_DEBUG_LIST is not set
1675# CONFIG_DEBUG_SG is not set 1660# CONFIG_DEBUG_SG is not set
1676# CONFIG_DEBUG_NOTIFIERS is not set 1661# CONFIG_DEBUG_NOTIFIERS is not set
1677# CONFIG_BOOT_PRINTK_DELAY is not set
1678# CONFIG_RCU_TORTURE_TEST is not set 1662# CONFIG_RCU_TORTURE_TEST is not set
1679# CONFIG_RCU_CPU_STALL_DETECTOR is not set 1663# CONFIG_RCU_CPU_STALL_DETECTOR is not set
1680# CONFIG_BACKTRACE_SELF_TEST is not set 1664# CONFIG_BACKTRACE_SELF_TEST is not set
@@ -1688,16 +1672,15 @@ CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
1688CONFIG_HAVE_DYNAMIC_FTRACE=y 1672CONFIG_HAVE_DYNAMIC_FTRACE=y
1689CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y 1673CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
1690CONFIG_TRACING_SUPPORT=y 1674CONFIG_TRACING_SUPPORT=y
1691 1675CONFIG_FTRACE=y
1692#
1693# Tracers
1694#
1695# CONFIG_FUNCTION_TRACER is not set 1676# CONFIG_FUNCTION_TRACER is not set
1677# CONFIG_IRQSOFF_TRACER is not set
1696# CONFIG_SCHED_TRACER is not set 1678# CONFIG_SCHED_TRACER is not set
1697# CONFIG_CONTEXT_SWITCH_TRACER is not set 1679# CONFIG_ENABLE_DEFAULT_TRACERS is not set
1698# CONFIG_EVENT_TRACER is not set
1699# CONFIG_BOOT_TRACER is not set 1680# CONFIG_BOOT_TRACER is not set
1700# CONFIG_TRACE_BRANCH_PROFILING is not set 1681CONFIG_BRANCH_PROFILE_NONE=y
1682# CONFIG_PROFILE_ANNOTATED_BRANCHES is not set
1683# CONFIG_PROFILE_ALL_BRANCHES is not set
1701# CONFIG_STACK_TRACER is not set 1684# CONFIG_STACK_TRACER is not set
1702# CONFIG_KMEMTRACE is not set 1685# CONFIG_KMEMTRACE is not set
1703# CONFIG_WORKQUEUE_TRACER is not set 1686# CONFIG_WORKQUEUE_TRACER is not set
@@ -1706,9 +1689,13 @@ CONFIG_TRACING_SUPPORT=y
1706# CONFIG_SAMPLES is not set 1689# CONFIG_SAMPLES is not set
1707CONFIG_HAVE_ARCH_KGDB=y 1690CONFIG_HAVE_ARCH_KGDB=y
1708# CONFIG_KGDB is not set 1691# CONFIG_KGDB is not set
1692# CONFIG_KMEMCHECK is not set
1693# CONFIG_PPC_DISABLE_WERROR is not set
1694CONFIG_PPC_WERROR=y
1709CONFIG_PRINT_STACK_DEPTH=64 1695CONFIG_PRINT_STACK_DEPTH=64
1710# CONFIG_DEBUG_STACKOVERFLOW is not set 1696# CONFIG_DEBUG_STACKOVERFLOW is not set
1711# CONFIG_DEBUG_STACK_USAGE is not set 1697# CONFIG_DEBUG_STACK_USAGE is not set
1698# CONFIG_PPC_EMULATED_STATS is not set
1712# CONFIG_CODE_PATCHING_SELFTEST is not set 1699# CONFIG_CODE_PATCHING_SELFTEST is not set
1713# CONFIG_FTR_FIXUP_SELFTEST is not set 1700# CONFIG_FTR_FIXUP_SELFTEST is not set
1714# CONFIG_MSI_BITMAP_SELFTEST is not set 1701# CONFIG_MSI_BITMAP_SELFTEST is not set
diff --git a/arch/powerpc/configs/mpc866_ads_defconfig b/arch/powerpc/configs/mpc866_ads_defconfig
index 3add6f62b21e..6809b61ed3de 100644
--- a/arch/powerpc/configs/mpc866_ads_defconfig
+++ b/arch/powerpc/configs/mpc866_ads_defconfig
@@ -1,14 +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.30-rc3 3# Linux kernel version: 2.6.31-rc4
4# Wed May 13 17:22:00 2009 4# Wed Jul 29 23:31:57 2009
5# 5#
6# CONFIG_PPC64 is not set 6# CONFIG_PPC64 is not set
7 7
8# 8#
9# Processor support 9# Processor support
10# 10#
11# CONFIG_6xx is not set 11# CONFIG_PPC_BOOK3S_32 is not set
12# CONFIG_PPC_85xx is not set 12# CONFIG_PPC_85xx is not set
13CONFIG_PPC_8xx=y 13CONFIG_PPC_8xx=y
14# CONFIG_40x is not set 14# CONFIG_40x is not set
@@ -27,15 +27,16 @@ CONFIG_GENERIC_TIME=y
27CONFIG_GENERIC_TIME_VSYSCALL=y 27CONFIG_GENERIC_TIME_VSYSCALL=y
28CONFIG_GENERIC_CLOCKEVENTS=y 28CONFIG_GENERIC_CLOCKEVENTS=y
29CONFIG_GENERIC_HARDIRQS=y 29CONFIG_GENERIC_HARDIRQS=y
30CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
30# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set 31# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set
31CONFIG_IRQ_PER_CPU=y 32CONFIG_IRQ_PER_CPU=y
32CONFIG_STACKTRACE_SUPPORT=y 33CONFIG_STACKTRACE_SUPPORT=y
33CONFIG_HAVE_LATENCYTOP_SUPPORT=y 34CONFIG_HAVE_LATENCYTOP_SUPPORT=y
35CONFIG_TRACE_IRQFLAGS_SUPPORT=y
34CONFIG_LOCKDEP_SUPPORT=y 36CONFIG_LOCKDEP_SUPPORT=y
35CONFIG_RWSEM_XCHGADD_ALGORITHM=y 37CONFIG_RWSEM_XCHGADD_ALGORITHM=y
36CONFIG_ARCH_HAS_ILOG2_U32=y 38CONFIG_ARCH_HAS_ILOG2_U32=y
37CONFIG_GENERIC_HWEIGHT=y 39CONFIG_GENERIC_HWEIGHT=y
38CONFIG_GENERIC_CALIBRATE_DELAY=y
39CONFIG_GENERIC_FIND_NEXT_BIT=y 40CONFIG_GENERIC_FIND_NEXT_BIT=y
40# CONFIG_ARCH_NO_VIRT_TO_BUS is not set 41# CONFIG_ARCH_NO_VIRT_TO_BUS is not set
41CONFIG_PPC=y 42CONFIG_PPC=y
@@ -48,11 +49,13 @@ CONFIG_OF=y
48# CONFIG_PPC_UDBG_16550 is not set 49# CONFIG_PPC_UDBG_16550 is not set
49# CONFIG_GENERIC_TBSYNC is not set 50# CONFIG_GENERIC_TBSYNC is not set
50CONFIG_AUDIT_ARCH=y 51CONFIG_AUDIT_ARCH=y
52CONFIG_DTC=y
51# CONFIG_DEFAULT_UIMAGE is not set 53# CONFIG_DEFAULT_UIMAGE is not set
52# CONFIG_PPC_DCR_NATIVE is not set 54# CONFIG_PPC_DCR_NATIVE is not set
53# CONFIG_PPC_DCR_MMIO is not set 55# CONFIG_PPC_DCR_MMIO is not set
54CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y 56CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y
55CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" 57CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
58CONFIG_CONSTRUCTORS=y
56 59
57# 60#
58# General setup 61# General setup
@@ -98,7 +101,6 @@ CONFIG_EMBEDDED=y
98# CONFIG_SYSCTL_SYSCALL is not set 101# CONFIG_SYSCTL_SYSCALL is not set
99CONFIG_KALLSYMS=y 102CONFIG_KALLSYMS=y
100# CONFIG_KALLSYMS_EXTRA_PASS is not set 103# CONFIG_KALLSYMS_EXTRA_PASS is not set
101# CONFIG_STRIP_ASM_SYMS is not set
102# CONFIG_HOTPLUG is not set 104# CONFIG_HOTPLUG is not set
103CONFIG_PRINTK=y 105CONFIG_PRINTK=y
104# CONFIG_BUG is not set 106# CONFIG_BUG is not set
@@ -111,8 +113,15 @@ CONFIG_TIMERFD=y
111CONFIG_EVENTFD=y 113CONFIG_EVENTFD=y
112CONFIG_SHMEM=y 114CONFIG_SHMEM=y
113CONFIG_AIO=y 115CONFIG_AIO=y
116CONFIG_HAVE_PERF_COUNTERS=y
117
118#
119# Performance Counters
120#
121# CONFIG_PERF_COUNTERS is not set
114# CONFIG_VM_EVENT_COUNTERS is not set 122# CONFIG_VM_EVENT_COUNTERS is not set
115CONFIG_SLUB_DEBUG=y 123CONFIG_SLUB_DEBUG=y
124# CONFIG_STRIP_ASM_SYMS is not set
116CONFIG_COMPAT_BRK=y 125CONFIG_COMPAT_BRK=y
117# CONFIG_SLAB is not set 126# CONFIG_SLAB is not set
118CONFIG_SLUB=y 127CONFIG_SLUB=y
@@ -126,6 +135,10 @@ CONFIG_HAVE_KPROBES=y
126CONFIG_HAVE_KRETPROBES=y 135CONFIG_HAVE_KRETPROBES=y
127CONFIG_HAVE_ARCH_TRACEHOOK=y 136CONFIG_HAVE_ARCH_TRACEHOOK=y
128CONFIG_HAVE_CLK=y 137CONFIG_HAVE_CLK=y
138
139#
140# GCOV-based kernel profiling
141#
129# CONFIG_SLOW_WORK is not set 142# CONFIG_SLOW_WORK is not set
130# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set 143# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
131CONFIG_SLABINFO=y 144CONFIG_SLABINFO=y
@@ -133,7 +146,7 @@ CONFIG_RT_MUTEXES=y
133CONFIG_BASE_SMALL=1 146CONFIG_BASE_SMALL=1
134# CONFIG_MODULES is not set 147# CONFIG_MODULES is not set
135CONFIG_BLOCK=y 148CONFIG_BLOCK=y
136# CONFIG_LBD is not set 149CONFIG_LBDAF=y
137# CONFIG_BLK_DEV_BSG is not set 150# CONFIG_BLK_DEV_BSG is not set
138# CONFIG_BLK_DEV_INTEGRITY is not set 151# CONFIG_BLK_DEV_INTEGRITY is not set
139 152
@@ -219,6 +232,7 @@ CONFIG_BINFMT_ELF=y
219# CONFIG_BINFMT_MISC is not set 232# CONFIG_BINFMT_MISC is not set
220CONFIG_MATH_EMULATION=y 233CONFIG_MATH_EMULATION=y
221# CONFIG_IOMMU_HELPER is not set 234# CONFIG_IOMMU_HELPER is not set
235# CONFIG_SWIOTLB is not set
222CONFIG_PPC_NEED_DMA_SYNC_OPS=y 236CONFIG_PPC_NEED_DMA_SYNC_OPS=y
223CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y 237CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
224CONFIG_ARCH_HAS_WALK_MEMORY=y 238CONFIG_ARCH_HAS_WALK_MEMORY=y
@@ -238,9 +252,9 @@ CONFIG_MIGRATION=y
238CONFIG_ZONE_DMA_FLAG=1 252CONFIG_ZONE_DMA_FLAG=1
239CONFIG_BOUNCE=y 253CONFIG_BOUNCE=y
240CONFIG_VIRT_TO_BUS=y 254CONFIG_VIRT_TO_BUS=y
241CONFIG_UNEVICTABLE_LRU=y
242CONFIG_HAVE_MLOCK=y 255CONFIG_HAVE_MLOCK=y
243CONFIG_HAVE_MLOCKED_PAGE_BIT=y 256CONFIG_HAVE_MLOCKED_PAGE_BIT=y
257CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
244CONFIG_PPC_4K_PAGES=y 258CONFIG_PPC_4K_PAGES=y
245# CONFIG_PPC_16K_PAGES is not set 259# CONFIG_PPC_16K_PAGES is not set
246# CONFIG_PPC_64K_PAGES is not set 260# CONFIG_PPC_64K_PAGES is not set
@@ -278,6 +292,7 @@ CONFIG_PAGE_OFFSET=0xc0000000
278CONFIG_KERNEL_START=0xc0000000 292CONFIG_KERNEL_START=0xc0000000
279CONFIG_PHYSICAL_START=0x00000000 293CONFIG_PHYSICAL_START=0x00000000
280CONFIG_TASK_SIZE=0x80000000 294CONFIG_TASK_SIZE=0x80000000
295CONFIG_CONSISTENT_SIZE=0x00200000
281CONFIG_NET=y 296CONFIG_NET=y
282 297
283# 298#
@@ -339,6 +354,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
339# CONFIG_ECONET is not set 354# CONFIG_ECONET is not set
340# CONFIG_WAN_ROUTER is not set 355# CONFIG_WAN_ROUTER is not set
341# CONFIG_PHONET is not set 356# CONFIG_PHONET is not set
357# CONFIG_IEEE802154 is not set
342# CONFIG_NET_SCHED is not set 358# CONFIG_NET_SCHED is not set
343# CONFIG_DCB is not set 359# CONFIG_DCB is not set
344 360
@@ -356,7 +372,11 @@ CONFIG_WIRELESS=y
356CONFIG_WIRELESS_OLD_REGULATORY=y 372CONFIG_WIRELESS_OLD_REGULATORY=y
357# CONFIG_WIRELESS_EXT is not set 373# CONFIG_WIRELESS_EXT is not set
358# CONFIG_LIB80211 is not set 374# CONFIG_LIB80211 is not set
359# CONFIG_MAC80211 is not set 375
376#
377# CFG80211 needs to be enabled for MAC80211
378#
379CONFIG_MAC80211_DEFAULT_PS_VALUE=0
360# CONFIG_WIMAX is not set 380# CONFIG_WIMAX is not set
361# CONFIG_RFKILL is not set 381# CONFIG_RFKILL is not set
362# CONFIG_NET_9P is not set 382# CONFIG_NET_9P is not set
@@ -374,6 +394,7 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y
374# CONFIG_CONNECTOR is not set 394# CONFIG_CONNECTOR is not set
375# CONFIG_MTD is not set 395# CONFIG_MTD is not set
376CONFIG_OF_DEVICE=y 396CONFIG_OF_DEVICE=y
397CONFIG_OF_MDIO=y
377# CONFIG_PARPORT is not set 398# CONFIG_PARPORT is not set
378CONFIG_BLK_DEV=y 399CONFIG_BLK_DEV=y
379# CONFIG_BLK_DEV_FD is not set 400# CONFIG_BLK_DEV_FD is not set
@@ -407,7 +428,6 @@ CONFIG_HAVE_IDE=y
407# CONFIG_MD is not set 428# CONFIG_MD is not set
408# CONFIG_MACINTOSH_DRIVERS is not set 429# CONFIG_MACINTOSH_DRIVERS is not set
409CONFIG_NETDEVICES=y 430CONFIG_NETDEVICES=y
410CONFIG_COMPAT_NET_DEV_OPS=y
411# CONFIG_DUMMY is not set 431# CONFIG_DUMMY is not set
412# CONFIG_BONDING is not set 432# CONFIG_BONDING is not set
413# CONFIG_MACVLAN is not set 433# CONFIG_MACVLAN is not set
@@ -446,6 +466,7 @@ CONFIG_MII=y
446# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set 466# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set
447# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set 467# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
448# CONFIG_B44 is not set 468# CONFIG_B44 is not set
469# CONFIG_KS8842 is not set
449CONFIG_FS_ENET=y 470CONFIG_FS_ENET=y
450CONFIG_FS_ENET_HAS_SCC=y 471CONFIG_FS_ENET_HAS_SCC=y
451CONFIG_FS_ENET_HAS_FEC=y 472CONFIG_FS_ENET_HAS_FEC=y
@@ -453,6 +474,7 @@ CONFIG_FS_ENET_MDIO_FEC=y
453CONFIG_NETDEV_1000=y 474CONFIG_NETDEV_1000=y
454# CONFIG_FSL_PQ_MDIO is not set 475# CONFIG_FSL_PQ_MDIO is not set
455# CONFIG_GIANFAR is not set 476# CONFIG_GIANFAR is not set
477# CONFIG_MV643XX_ETH is not set
456CONFIG_NETDEV_10000=y 478CONFIG_NETDEV_10000=y
457 479
458# 480#
@@ -496,11 +518,11 @@ CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
496# 518#
497CONFIG_INPUT_KEYBOARD=y 519CONFIG_INPUT_KEYBOARD=y
498CONFIG_KEYBOARD_ATKBD=y 520CONFIG_KEYBOARD_ATKBD=y
499# CONFIG_KEYBOARD_SUNKBD is not set
500# CONFIG_KEYBOARD_LKKBD is not set 521# CONFIG_KEYBOARD_LKKBD is not set
501# CONFIG_KEYBOARD_XTKBD is not set
502# CONFIG_KEYBOARD_NEWTON is not set 522# CONFIG_KEYBOARD_NEWTON is not set
503# CONFIG_KEYBOARD_STOWAWAY is not set 523# CONFIG_KEYBOARD_STOWAWAY is not set
524# CONFIG_KEYBOARD_SUNKBD is not set
525# CONFIG_KEYBOARD_XTKBD is not set
504CONFIG_INPUT_MOUSE=y 526CONFIG_INPUT_MOUSE=y
505CONFIG_MOUSE_PS2=y 527CONFIG_MOUSE_PS2=y
506CONFIG_MOUSE_PS2_ALPS=y 528CONFIG_MOUSE_PS2_ALPS=y
@@ -562,6 +584,11 @@ CONFIG_GEN_RTC=y
562# CONFIG_TCG_TPM is not set 584# CONFIG_TCG_TPM is not set
563# CONFIG_I2C is not set 585# CONFIG_I2C is not set
564# CONFIG_SPI is not set 586# CONFIG_SPI is not set
587
588#
589# PPS support
590#
591# CONFIG_PPS is not set
565CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y 592CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
566# CONFIG_GPIOLIB is not set 593# CONFIG_GPIOLIB is not set
567# CONFIG_W1 is not set 594# CONFIG_W1 is not set
@@ -597,22 +624,7 @@ CONFIG_SSB_POSSIBLE=y
597# CONFIG_HTC_PASIC3 is not set 624# CONFIG_HTC_PASIC3 is not set
598# CONFIG_MFD_TMIO is not set 625# CONFIG_MFD_TMIO is not set
599# CONFIG_REGULATOR is not set 626# CONFIG_REGULATOR is not set
600 627# CONFIG_MEDIA_SUPPORT is not set
601#
602# Multimedia devices
603#
604
605#
606# Multimedia core support
607#
608# CONFIG_VIDEO_DEV is not set
609# CONFIG_DVB_CORE is not set
610# CONFIG_VIDEO_MEDIA is not set
611
612#
613# Multimedia drivers
614#
615CONFIG_DAB=y
616 628
617# 629#
618# Graphics support 630# Graphics support
@@ -664,6 +676,10 @@ CONFIG_USB_SUPPORT=y
664# CONFIG_DMADEVICES is not set 676# CONFIG_DMADEVICES is not set
665# CONFIG_AUXDISPLAY is not set 677# CONFIG_AUXDISPLAY is not set
666# CONFIG_UIO is not set 678# CONFIG_UIO is not set
679
680#
681# TI VLYNQ
682#
667# CONFIG_STAGING is not set 683# CONFIG_STAGING is not set
668 684
669# 685#
@@ -685,10 +701,12 @@ CONFIG_FS_MBCACHE=y
685# CONFIG_REISERFS_FS is not set 701# CONFIG_REISERFS_FS is not set
686# CONFIG_JFS_FS is not set 702# CONFIG_JFS_FS is not set
687# CONFIG_FS_POSIX_ACL is not set 703# CONFIG_FS_POSIX_ACL is not set
688CONFIG_FILE_LOCKING=y
689# CONFIG_XFS_FS is not set 704# CONFIG_XFS_FS is not set
705# CONFIG_GFS2_FS is not set
690# CONFIG_OCFS2_FS is not set 706# CONFIG_OCFS2_FS is not set
691# CONFIG_BTRFS_FS is not set 707# CONFIG_BTRFS_FS is not set
708CONFIG_FILE_LOCKING=y
709CONFIG_FSNOTIFY=y
692CONFIG_DNOTIFY=y 710CONFIG_DNOTIFY=y
693CONFIG_INOTIFY=y 711CONFIG_INOTIFY=y
694CONFIG_INOTIFY_USER=y 712CONFIG_INOTIFY_USER=y
@@ -808,6 +826,7 @@ CONFIG_HAS_IOPORT=y
808CONFIG_HAS_DMA=y 826CONFIG_HAS_DMA=y
809CONFIG_HAVE_LMB=y 827CONFIG_HAVE_LMB=y
810CONFIG_NLATTR=y 828CONFIG_NLATTR=y
829CONFIG_GENERIC_ATOMIC64=y
811 830
812# 831#
813# Kernel hacking 832# Kernel hacking
@@ -831,22 +850,11 @@ CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
831CONFIG_HAVE_DYNAMIC_FTRACE=y 850CONFIG_HAVE_DYNAMIC_FTRACE=y
832CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y 851CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
833CONFIG_TRACING_SUPPORT=y 852CONFIG_TRACING_SUPPORT=y
834 853# CONFIG_FTRACE is not set
835#
836# Tracers
837#
838# CONFIG_FUNCTION_TRACER is not set
839# CONFIG_SCHED_TRACER is not set
840# CONFIG_CONTEXT_SWITCH_TRACER is not set
841# CONFIG_EVENT_TRACER is not set
842# CONFIG_BOOT_TRACER is not set
843# CONFIG_TRACE_BRANCH_PROFILING is not set
844# CONFIG_STACK_TRACER is not set
845# CONFIG_KMEMTRACE is not set
846# CONFIG_WORKQUEUE_TRACER is not set
847# CONFIG_BLK_DEV_IO_TRACE is not set
848# CONFIG_SAMPLES is not set 854# CONFIG_SAMPLES is not set
849CONFIG_HAVE_ARCH_KGDB=y 855CONFIG_HAVE_ARCH_KGDB=y
856# CONFIG_PPC_DISABLE_WERROR is not set
857CONFIG_PPC_WERROR=y
850CONFIG_PRINT_STACK_DEPTH=64 858CONFIG_PRINT_STACK_DEPTH=64
851# CONFIG_IRQSTACKS is not set 859# CONFIG_IRQSTACKS is not set
852# CONFIG_PPC_EARLY_DEBUG is not set 860# CONFIG_PPC_EARLY_DEBUG is not set
diff --git a/arch/powerpc/configs/mpc86xx_defconfig b/arch/powerpc/configs/mpc86xx_defconfig
index 5bb1b8eb0b49..0e8684a3138d 100644
--- a/arch/powerpc/configs/mpc86xx_defconfig
+++ b/arch/powerpc/configs/mpc86xx_defconfig
@@ -1,26 +1,28 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.30-rc3 3# Linux kernel version: 2.6.31-rc4
4# Wed May 13 17:22:00 2009 4# Wed Jul 29 23:31:58 2009
5# 5#
6# CONFIG_PPC64 is not set 6# CONFIG_PPC64 is not set
7 7
8# 8#
9# Processor support 9# Processor support
10# 10#
11CONFIG_6xx=y 11CONFIG_PPC_BOOK3S_32=y
12# CONFIG_PPC_85xx is not set 12# CONFIG_PPC_85xx is not set
13# CONFIG_PPC_8xx is not set 13# CONFIG_PPC_8xx is not set
14# CONFIG_40x is not set 14# CONFIG_40x is not set
15# CONFIG_44x is not set 15# CONFIG_44x is not set
16# CONFIG_E200 is not set 16# CONFIG_E200 is not set
17CONFIG_PPC_BOOK3S=y 17CONFIG_PPC_BOOK3S=y
18CONFIG_6xx=y
18CONFIG_PPC_FPU=y 19CONFIG_PPC_FPU=y
19# CONFIG_PHYS_64BIT is not set 20# CONFIG_PHYS_64BIT is not set
20CONFIG_ALTIVEC=y 21CONFIG_ALTIVEC=y
21CONFIG_PPC_STD_MMU=y 22CONFIG_PPC_STD_MMU=y
22CONFIG_PPC_STD_MMU_32=y 23CONFIG_PPC_STD_MMU_32=y
23# CONFIG_PPC_MM_SLICES is not set 24# CONFIG_PPC_MM_SLICES is not set
25CONFIG_PPC_HAVE_PMU_SUPPORT=y
24CONFIG_SMP=y 26CONFIG_SMP=y
25CONFIG_NR_CPUS=2 27CONFIG_NR_CPUS=2
26CONFIG_PPC32=y 28CONFIG_PPC32=y
@@ -32,15 +34,16 @@ CONFIG_GENERIC_TIME=y
32CONFIG_GENERIC_TIME_VSYSCALL=y 34CONFIG_GENERIC_TIME_VSYSCALL=y
33CONFIG_GENERIC_CLOCKEVENTS=y 35CONFIG_GENERIC_CLOCKEVENTS=y
34CONFIG_GENERIC_HARDIRQS=y 36CONFIG_GENERIC_HARDIRQS=y
37CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
35# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set 38# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set
36CONFIG_IRQ_PER_CPU=y 39CONFIG_IRQ_PER_CPU=y
37CONFIG_STACKTRACE_SUPPORT=y 40CONFIG_STACKTRACE_SUPPORT=y
38CONFIG_HAVE_LATENCYTOP_SUPPORT=y 41CONFIG_HAVE_LATENCYTOP_SUPPORT=y
42CONFIG_TRACE_IRQFLAGS_SUPPORT=y
39CONFIG_LOCKDEP_SUPPORT=y 43CONFIG_LOCKDEP_SUPPORT=y
40CONFIG_RWSEM_XCHGADD_ALGORITHM=y 44CONFIG_RWSEM_XCHGADD_ALGORITHM=y
41CONFIG_ARCH_HAS_ILOG2_U32=y 45CONFIG_ARCH_HAS_ILOG2_U32=y
42CONFIG_GENERIC_HWEIGHT=y 46CONFIG_GENERIC_HWEIGHT=y
43CONFIG_GENERIC_CALIBRATE_DELAY=y
44CONFIG_GENERIC_FIND_NEXT_BIT=y 47CONFIG_GENERIC_FIND_NEXT_BIT=y
45CONFIG_GENERIC_GPIO=y 48CONFIG_GENERIC_GPIO=y
46# CONFIG_ARCH_NO_VIRT_TO_BUS is not set 49# CONFIG_ARCH_NO_VIRT_TO_BUS is not set
@@ -55,11 +58,13 @@ CONFIG_PPC_UDBG_16550=y
55CONFIG_GENERIC_TBSYNC=y 58CONFIG_GENERIC_TBSYNC=y
56CONFIG_AUDIT_ARCH=y 59CONFIG_AUDIT_ARCH=y
57CONFIG_GENERIC_BUG=y 60CONFIG_GENERIC_BUG=y
61CONFIG_DTC=y
58CONFIG_DEFAULT_UIMAGE=y 62CONFIG_DEFAULT_UIMAGE=y
59# CONFIG_PPC_DCR_NATIVE is not set 63# CONFIG_PPC_DCR_NATIVE is not set
60# CONFIG_PPC_DCR_MMIO is not set 64# CONFIG_PPC_DCR_MMIO is not set
61CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y 65CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y
62CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" 66CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
67CONFIG_CONSTRUCTORS=y
63 68
64# 69#
65# General setup 70# General setup
@@ -114,7 +119,6 @@ CONFIG_SYSCTL_SYSCALL=y
114CONFIG_KALLSYMS=y 119CONFIG_KALLSYMS=y
115CONFIG_KALLSYMS_ALL=y 120CONFIG_KALLSYMS_ALL=y
116CONFIG_KALLSYMS_EXTRA_PASS=y 121CONFIG_KALLSYMS_EXTRA_PASS=y
117# CONFIG_STRIP_ASM_SYMS is not set
118CONFIG_HOTPLUG=y 122CONFIG_HOTPLUG=y
119CONFIG_PRINTK=y 123CONFIG_PRINTK=y
120CONFIG_BUG=y 124CONFIG_BUG=y
@@ -127,9 +131,16 @@ CONFIG_TIMERFD=y
127CONFIG_EVENTFD=y 131CONFIG_EVENTFD=y
128CONFIG_SHMEM=y 132CONFIG_SHMEM=y
129CONFIG_AIO=y 133CONFIG_AIO=y
134CONFIG_HAVE_PERF_COUNTERS=y
135
136#
137# Performance Counters
138#
139# CONFIG_PERF_COUNTERS is not set
130CONFIG_VM_EVENT_COUNTERS=y 140CONFIG_VM_EVENT_COUNTERS=y
131CONFIG_PCI_QUIRKS=y 141CONFIG_PCI_QUIRKS=y
132CONFIG_SLUB_DEBUG=y 142CONFIG_SLUB_DEBUG=y
143# CONFIG_STRIP_ASM_SYMS is not set
133CONFIG_COMPAT_BRK=y 144CONFIG_COMPAT_BRK=y
134# CONFIG_SLAB is not set 145# CONFIG_SLAB is not set
135CONFIG_SLUB=y 146CONFIG_SLUB=y
@@ -144,6 +155,10 @@ CONFIG_HAVE_KPROBES=y
144CONFIG_HAVE_KRETPROBES=y 155CONFIG_HAVE_KRETPROBES=y
145CONFIG_HAVE_ARCH_TRACEHOOK=y 156CONFIG_HAVE_ARCH_TRACEHOOK=y
146CONFIG_USE_GENERIC_SMP_HELPERS=y 157CONFIG_USE_GENERIC_SMP_HELPERS=y
158
159#
160# GCOV-based kernel profiling
161#
147# CONFIG_SLOW_WORK is not set 162# CONFIG_SLOW_WORK is not set
148# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set 163# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
149CONFIG_SLABINFO=y 164CONFIG_SLABINFO=y
@@ -157,7 +172,7 @@ CONFIG_MODVERSIONS=y
157# CONFIG_MODULE_SRCVERSION_ALL is not set 172# CONFIG_MODULE_SRCVERSION_ALL is not set
158CONFIG_STOP_MACHINE=y 173CONFIG_STOP_MACHINE=y
159CONFIG_BLOCK=y 174CONFIG_BLOCK=y
160CONFIG_LBD=y 175CONFIG_LBDAF=y
161# CONFIG_BLK_DEV_BSG is not set 176# CONFIG_BLK_DEV_BSG is not set
162# CONFIG_BLK_DEV_INTEGRITY is not set 177# CONFIG_BLK_DEV_INTEGRITY is not set
163 178
@@ -236,7 +251,9 @@ CONFIG_BINFMT_ELF=y
236# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set 251# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
237# CONFIG_HAVE_AOUT is not set 252# CONFIG_HAVE_AOUT is not set
238CONFIG_BINFMT_MISC=m 253CONFIG_BINFMT_MISC=m
239# CONFIG_IOMMU_HELPER is not set 254CONFIG_IOMMU_HELPER=y
255CONFIG_SWIOTLB=y
256CONFIG_PPC_NEED_DMA_SYNC_OPS=y
240CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y 257CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
241CONFIG_ARCH_HAS_WALK_MEMORY=y 258CONFIG_ARCH_HAS_WALK_MEMORY=y
242CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y 259CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y
@@ -258,9 +275,9 @@ CONFIG_MIGRATION=y
258CONFIG_ZONE_DMA_FLAG=1 275CONFIG_ZONE_DMA_FLAG=1
259CONFIG_BOUNCE=y 276CONFIG_BOUNCE=y
260CONFIG_VIRT_TO_BUS=y 277CONFIG_VIRT_TO_BUS=y
261CONFIG_UNEVICTABLE_LRU=y
262CONFIG_HAVE_MLOCK=y 278CONFIG_HAVE_MLOCK=y
263CONFIG_HAVE_MLOCKED_PAGE_BIT=y 279CONFIG_HAVE_MLOCKED_PAGE_BIT=y
280CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
264CONFIG_PPC_4K_PAGES=y 281CONFIG_PPC_4K_PAGES=y
265# CONFIG_PPC_16K_PAGES is not set 282# CONFIG_PPC_16K_PAGES is not set
266# CONFIG_PPC_64K_PAGES is not set 283# CONFIG_PPC_64K_PAGES is not set
@@ -403,6 +420,7 @@ CONFIG_SCTP_HMAC_MD5=y
403# CONFIG_ECONET is not set 420# CONFIG_ECONET is not set
404# CONFIG_WAN_ROUTER is not set 421# CONFIG_WAN_ROUTER is not set
405# CONFIG_PHONET is not set 422# CONFIG_PHONET is not set
423# CONFIG_IEEE802154 is not set
406# CONFIG_NET_SCHED is not set 424# CONFIG_NET_SCHED is not set
407# CONFIG_DCB is not set 425# CONFIG_DCB is not set
408 426
@@ -421,7 +439,11 @@ CONFIG_WIRELESS=y
421CONFIG_WIRELESS_OLD_REGULATORY=y 439CONFIG_WIRELESS_OLD_REGULATORY=y
422# CONFIG_WIRELESS_EXT is not set 440# CONFIG_WIRELESS_EXT is not set
423# CONFIG_LIB80211 is not set 441# CONFIG_LIB80211 is not set
424# CONFIG_MAC80211 is not set 442
443#
444# CFG80211 needs to be enabled for MAC80211
445#
446CONFIG_MAC80211_DEFAULT_PS_VALUE=0
425# CONFIG_WIMAX is not set 447# CONFIG_WIMAX is not set
426# CONFIG_RFKILL is not set 448# CONFIG_RFKILL is not set
427# CONFIG_NET_9P is not set 449# CONFIG_NET_9P is not set
@@ -447,6 +469,7 @@ CONFIG_EXTRA_FIRMWARE=""
447CONFIG_OF_DEVICE=y 469CONFIG_OF_DEVICE=y
448CONFIG_OF_GPIO=y 470CONFIG_OF_GPIO=y
449CONFIG_OF_I2C=y 471CONFIG_OF_I2C=y
472CONFIG_OF_MDIO=y
450# CONFIG_PARPORT is not set 473# CONFIG_PARPORT is not set
451CONFIG_BLK_DEV=y 474CONFIG_BLK_DEV=y
452# CONFIG_BLK_DEV_FD is not set 475# CONFIG_BLK_DEV_FD is not set
@@ -482,7 +505,9 @@ CONFIG_MISC_DEVICES=y
482# 505#
483# CONFIG_EEPROM_AT24 is not set 506# CONFIG_EEPROM_AT24 is not set
484CONFIG_EEPROM_LEGACY=y 507CONFIG_EEPROM_LEGACY=y
508# CONFIG_EEPROM_MAX6875 is not set
485# CONFIG_EEPROM_93CX6 is not set 509# CONFIG_EEPROM_93CX6 is not set
510# CONFIG_CB710_CORE is not set
486CONFIG_HAVE_IDE=y 511CONFIG_HAVE_IDE=y
487# CONFIG_IDE is not set 512# CONFIG_IDE is not set
488 513
@@ -506,10 +531,6 @@ CONFIG_BLK_DEV_SR=y
506# CONFIG_BLK_DEV_SR_VENDOR is not set 531# CONFIG_BLK_DEV_SR_VENDOR is not set
507CONFIG_CHR_DEV_SG=y 532CONFIG_CHR_DEV_SG=y
508# CONFIG_CHR_DEV_SCH is not set 533# CONFIG_CHR_DEV_SCH is not set
509
510#
511# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
512#
513CONFIG_SCSI_MULTI_LUN=y 534CONFIG_SCSI_MULTI_LUN=y
514# CONFIG_SCSI_CONSTANTS is not set 535# CONFIG_SCSI_CONSTANTS is not set
515CONFIG_SCSI_LOGGING=y 536CONFIG_SCSI_LOGGING=y
@@ -527,6 +548,7 @@ CONFIG_SCSI_WAIT_SCAN=m
527CONFIG_SCSI_LOWLEVEL=y 548CONFIG_SCSI_LOWLEVEL=y
528# CONFIG_ISCSI_TCP is not set 549# CONFIG_ISCSI_TCP is not set
529# CONFIG_SCSI_CXGB3_ISCSI is not set 550# CONFIG_SCSI_CXGB3_ISCSI is not set
551# CONFIG_SCSI_BNX2_ISCSI is not set
530# CONFIG_BLK_DEV_3W_XXXX_RAID is not set 552# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
531# CONFIG_SCSI_3W_9XXX is not set 553# CONFIG_SCSI_3W_9XXX is not set
532# CONFIG_SCSI_ACARD is not set 554# CONFIG_SCSI_ACARD is not set
@@ -535,6 +557,7 @@ CONFIG_SCSI_LOWLEVEL=y
535# CONFIG_SCSI_AIC7XXX_OLD is not set 557# CONFIG_SCSI_AIC7XXX_OLD is not set
536# CONFIG_SCSI_AIC79XX is not set 558# CONFIG_SCSI_AIC79XX is not set
537# CONFIG_SCSI_AIC94XX is not set 559# CONFIG_SCSI_AIC94XX is not set
560# CONFIG_SCSI_MVSAS is not set
538# CONFIG_SCSI_DPT_I2O is not set 561# CONFIG_SCSI_DPT_I2O is not set
539# CONFIG_SCSI_ADVANSYS is not set 562# CONFIG_SCSI_ADVANSYS is not set
540# CONFIG_SCSI_ARCMSR is not set 563# CONFIG_SCSI_ARCMSR is not set
@@ -554,7 +577,6 @@ CONFIG_SCSI_LOWLEVEL=y
554# CONFIG_SCSI_IPS is not set 577# CONFIG_SCSI_IPS is not set
555# CONFIG_SCSI_INITIO is not set 578# CONFIG_SCSI_INITIO is not set
556# CONFIG_SCSI_INIA100 is not set 579# CONFIG_SCSI_INIA100 is not set
557# CONFIG_SCSI_MVSAS is not set
558# CONFIG_SCSI_STEX is not set 580# CONFIG_SCSI_STEX is not set
559# CONFIG_SCSI_SYM53C8XX_2 is not set 581# CONFIG_SCSI_SYM53C8XX_2 is not set
560# CONFIG_SCSI_IPR is not set 582# CONFIG_SCSI_IPR is not set
@@ -638,14 +660,17 @@ CONFIG_PATA_ALI=y
638# 660#
639 661
640# 662#
641# Enable only one of the two stacks, unless you know what you are doing 663# You can enable one or both FireWire driver stacks.
664#
665
666#
667# See the help texts for more information.
642# 668#
643# CONFIG_FIREWIRE is not set 669# CONFIG_FIREWIRE is not set
644# CONFIG_IEEE1394 is not set 670# CONFIG_IEEE1394 is not set
645# CONFIG_I2O is not set 671# CONFIG_I2O is not set
646# CONFIG_MACINTOSH_DRIVERS is not set 672# CONFIG_MACINTOSH_DRIVERS is not set
647CONFIG_NETDEVICES=y 673CONFIG_NETDEVICES=y
648CONFIG_COMPAT_NET_DEV_OPS=y
649CONFIG_DUMMY=y 674CONFIG_DUMMY=y
650# CONFIG_BONDING is not set 675# CONFIG_BONDING is not set
651# CONFIG_MACVLAN is not set 676# CONFIG_MACVLAN is not set
@@ -692,6 +717,7 @@ CONFIG_MII=y
692# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set 717# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
693# CONFIG_NET_PCI is not set 718# CONFIG_NET_PCI is not set
694# CONFIG_B44 is not set 719# CONFIG_B44 is not set
720# CONFIG_KS8842 is not set
695# CONFIG_ATL2 is not set 721# CONFIG_ATL2 is not set
696CONFIG_NETDEV_1000=y 722CONFIG_NETDEV_1000=y
697# CONFIG_ACENIC is not set 723# CONFIG_ACENIC is not set
@@ -711,8 +737,10 @@ CONFIG_NETDEV_1000=y
711# CONFIG_VIA_VELOCITY is not set 737# CONFIG_VIA_VELOCITY is not set
712# CONFIG_TIGON3 is not set 738# CONFIG_TIGON3 is not set
713# CONFIG_BNX2 is not set 739# CONFIG_BNX2 is not set
740# CONFIG_CNIC is not set
714CONFIG_FSL_PQ_MDIO=y 741CONFIG_FSL_PQ_MDIO=y
715CONFIG_GIANFAR=y 742CONFIG_GIANFAR=y
743# CONFIG_MV643XX_ETH is not set
716# CONFIG_QLA3XXX is not set 744# CONFIG_QLA3XXX is not set
717# CONFIG_ATL1 is not set 745# CONFIG_ATL1 is not set
718# CONFIG_ATL1E is not set 746# CONFIG_ATL1E is not set
@@ -913,13 +941,17 @@ CONFIG_I2C_MPC=y
913# CONFIG_SENSORS_PCF8574 is not set 941# CONFIG_SENSORS_PCF8574 is not set
914# CONFIG_PCF8575 is not set 942# CONFIG_PCF8575 is not set
915# CONFIG_SENSORS_PCA9539 is not set 943# CONFIG_SENSORS_PCA9539 is not set
916# CONFIG_SENSORS_MAX6875 is not set
917# CONFIG_SENSORS_TSL2550 is not set 944# CONFIG_SENSORS_TSL2550 is not set
918# CONFIG_I2C_DEBUG_CORE is not set 945# CONFIG_I2C_DEBUG_CORE is not set
919# CONFIG_I2C_DEBUG_ALGO is not set 946# CONFIG_I2C_DEBUG_ALGO is not set
920# CONFIG_I2C_DEBUG_BUS is not set 947# CONFIG_I2C_DEBUG_BUS is not set
921# CONFIG_I2C_DEBUG_CHIP is not set 948# CONFIG_I2C_DEBUG_CHIP is not set
922# CONFIG_SPI is not set 949# CONFIG_SPI is not set
950
951#
952# PPS support
953#
954# CONFIG_PPS is not set
923CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y 955CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
924CONFIG_ARCH_REQUIRE_GPIOLIB=y 956CONFIG_ARCH_REQUIRE_GPIOLIB=y
925CONFIG_GPIOLIB=y 957CONFIG_GPIOLIB=y
@@ -973,76 +1005,9 @@ CONFIG_SSB_POSSIBLE=y
973# CONFIG_MFD_WM8400 is not set 1005# CONFIG_MFD_WM8400 is not set
974# CONFIG_MFD_WM8350_I2C is not set 1006# CONFIG_MFD_WM8350_I2C is not set
975# CONFIG_MFD_PCF50633 is not set 1007# CONFIG_MFD_PCF50633 is not set
1008# CONFIG_AB3100_CORE is not set
976# CONFIG_REGULATOR is not set 1009# CONFIG_REGULATOR is not set
977 1010# CONFIG_MEDIA_SUPPORT is not set
978#
979# Multimedia devices
980#
981
982#
983# Multimedia core support
984#
985# CONFIG_VIDEO_DEV is not set
986CONFIG_DVB_CORE=m
987CONFIG_VIDEO_MEDIA=m
988
989#
990# Multimedia drivers
991#
992# CONFIG_MEDIA_ATTACH is not set
993CONFIG_MEDIA_TUNER=m
994# CONFIG_MEDIA_TUNER_CUSTOMISE is not set
995CONFIG_MEDIA_TUNER_SIMPLE=m
996CONFIG_MEDIA_TUNER_TDA8290=m
997CONFIG_MEDIA_TUNER_TDA9887=m
998CONFIG_MEDIA_TUNER_TEA5761=m
999CONFIG_MEDIA_TUNER_TEA5767=m
1000CONFIG_MEDIA_TUNER_MT20XX=m
1001CONFIG_MEDIA_TUNER_XC2028=m
1002CONFIG_MEDIA_TUNER_XC5000=m
1003CONFIG_MEDIA_TUNER_MC44S803=m
1004# CONFIG_DVB_DYNAMIC_MINORS is not set
1005CONFIG_DVB_CAPTURE_DRIVERS=y
1006
1007#
1008# Supported SAA7146 based PCI Adapters
1009#
1010# CONFIG_TTPCI_EEPROM is not set
1011# CONFIG_DVB_BUDGET_CORE is not set
1012
1013#
1014# Supported USB Adapters
1015#
1016# CONFIG_DVB_USB is not set
1017# CONFIG_DVB_TTUSB_BUDGET is not set
1018# CONFIG_DVB_TTUSB_DEC is not set
1019# CONFIG_DVB_SIANO_SMS1XXX is not set
1020
1021#
1022# Supported FlexCopII (B2C2) Adapters
1023#
1024# CONFIG_DVB_B2C2_FLEXCOP is not set
1025
1026#
1027# Supported BT878 Adapters
1028#
1029
1030#
1031# Supported Pluto2 Adapters
1032#
1033# CONFIG_DVB_PLUTO2 is not set
1034
1035#
1036# Supported SDMC DM1105 Adapters
1037#
1038# CONFIG_DVB_DM1105 is not set
1039
1040#
1041# Supported DVB Frontends
1042#
1043# CONFIG_DVB_FE_CUSTOMISE is not set
1044CONFIG_DAB=y
1045# CONFIG_USB_DABUSB is not set
1046 1011
1047# 1012#
1048# Graphics support 1013# Graphics support
@@ -1082,6 +1047,11 @@ CONFIG_SND_VERBOSE_PROCFS=y
1082# CONFIG_SND_VERBOSE_PRINTK is not set 1047# CONFIG_SND_VERBOSE_PRINTK is not set
1083# CONFIG_SND_DEBUG is not set 1048# CONFIG_SND_DEBUG is not set
1084CONFIG_SND_VMASTER=y 1049CONFIG_SND_VMASTER=y
1050# CONFIG_SND_RAWMIDI_SEQ is not set
1051# CONFIG_SND_OPL3_LIB_SEQ is not set
1052# CONFIG_SND_OPL4_LIB_SEQ is not set
1053# CONFIG_SND_SBAWE_SEQ is not set
1054# CONFIG_SND_EMU10K1_SEQ is not set
1085CONFIG_SND_AC97_CODEC=y 1055CONFIG_SND_AC97_CODEC=y
1086CONFIG_SND_DRIVERS=y 1056CONFIG_SND_DRIVERS=y
1087# CONFIG_SND_DUMMY is not set 1057# CONFIG_SND_DUMMY is not set
@@ -1108,6 +1078,7 @@ CONFIG_SND_PCI=y
1108# CONFIG_SND_CS4281 is not set 1078# CONFIG_SND_CS4281 is not set
1109# CONFIG_SND_CS46XX is not set 1079# CONFIG_SND_CS46XX is not set
1110# CONFIG_SND_CS5530 is not set 1080# CONFIG_SND_CS5530 is not set
1081# CONFIG_SND_CTXFI is not set
1111# CONFIG_SND_DARLA20 is not set 1082# CONFIG_SND_DARLA20 is not set
1112# CONFIG_SND_GINA20 is not set 1083# CONFIG_SND_GINA20 is not set
1113# CONFIG_SND_LAYLA20 is not set 1084# CONFIG_SND_LAYLA20 is not set
@@ -1138,6 +1109,7 @@ CONFIG_SND_PCI=y
1138CONFIG_SND_INTEL8X0=y 1109CONFIG_SND_INTEL8X0=y
1139# CONFIG_SND_INTEL8X0M is not set 1110# CONFIG_SND_INTEL8X0M is not set
1140# CONFIG_SND_KORG1212 is not set 1111# CONFIG_SND_KORG1212 is not set
1112# CONFIG_SND_LX6464ES is not set
1141# CONFIG_SND_MAESTRO3 is not set 1113# CONFIG_SND_MAESTRO3 is not set
1142# CONFIG_SND_MIXART is not set 1114# CONFIG_SND_MIXART is not set
1143# CONFIG_SND_NM256 is not set 1115# CONFIG_SND_NM256 is not set
@@ -1182,7 +1154,7 @@ CONFIG_HID_BELKIN=y
1182CONFIG_HID_CHERRY=y 1154CONFIG_HID_CHERRY=y
1183CONFIG_HID_CHICONY=y 1155CONFIG_HID_CHICONY=y
1184CONFIG_HID_CYPRESS=y 1156CONFIG_HID_CYPRESS=y
1185# CONFIG_DRAGONRISE_FF is not set 1157# CONFIG_HID_DRAGONRISE is not set
1186CONFIG_HID_EZKEY=y 1158CONFIG_HID_EZKEY=y
1187# CONFIG_HID_KYE is not set 1159# CONFIG_HID_KYE is not set
1188CONFIG_HID_GYRATION=y 1160CONFIG_HID_GYRATION=y
@@ -1199,10 +1171,11 @@ CONFIG_HID_PETALYNX=y
1199CONFIG_HID_SAMSUNG=y 1171CONFIG_HID_SAMSUNG=y
1200CONFIG_HID_SONY=y 1172CONFIG_HID_SONY=y
1201CONFIG_HID_SUNPLUS=y 1173CONFIG_HID_SUNPLUS=y
1202# CONFIG_GREENASIA_FF is not set 1174# CONFIG_HID_GREENASIA is not set
1175# CONFIG_HID_SMARTJOYPLUS is not set
1203# CONFIG_HID_TOPSEED is not set 1176# CONFIG_HID_TOPSEED is not set
1204CONFIG_THRUSTMASTER_FF=m 1177# CONFIG_HID_THRUSTMASTER is not set
1205CONFIG_ZEROPLUS_FF=m 1178# CONFIG_HID_ZEROPLUS is not set
1206CONFIG_USB_SUPPORT=y 1179CONFIG_USB_SUPPORT=y
1207CONFIG_USB_ARCH_HAS_HCD=y 1180CONFIG_USB_ARCH_HAS_HCD=y
1208CONFIG_USB_ARCH_HAS_OHCI=y 1181CONFIG_USB_ARCH_HAS_OHCI=y
@@ -1228,6 +1201,7 @@ CONFIG_USB_MON=y
1228# USB Host Controller Drivers 1201# USB Host Controller Drivers
1229# 1202#
1230# CONFIG_USB_C67X00_HCD is not set 1203# CONFIG_USB_C67X00_HCD is not set
1204# CONFIG_USB_XHCI_HCD is not set
1231CONFIG_USB_EHCI_HCD=y 1205CONFIG_USB_EHCI_HCD=y
1232# CONFIG_USB_EHCI_ROOT_HUB_TT is not set 1206# CONFIG_USB_EHCI_ROOT_HUB_TT is not set
1233# CONFIG_USB_EHCI_TT_NEWSCHED is not set 1207# CONFIG_USB_EHCI_TT_NEWSCHED is not set
@@ -1237,9 +1211,9 @@ CONFIG_USB_EHCI_HCD_PPC_OF=y
1237# CONFIG_USB_ISP116X_HCD is not set 1211# CONFIG_USB_ISP116X_HCD is not set
1238# CONFIG_USB_ISP1760_HCD is not set 1212# CONFIG_USB_ISP1760_HCD is not set
1239CONFIG_USB_OHCI_HCD=y 1213CONFIG_USB_OHCI_HCD=y
1240CONFIG_USB_OHCI_HCD_PPC_OF=y
1241CONFIG_USB_OHCI_HCD_PPC_OF_BE=y 1214CONFIG_USB_OHCI_HCD_PPC_OF_BE=y
1242CONFIG_USB_OHCI_HCD_PPC_OF_LE=y 1215CONFIG_USB_OHCI_HCD_PPC_OF_LE=y
1216CONFIG_USB_OHCI_HCD_PPC_OF=y
1243CONFIG_USB_OHCI_HCD_PCI=y 1217CONFIG_USB_OHCI_HCD_PCI=y
1244CONFIG_USB_OHCI_BIG_ENDIAN_DESC=y 1218CONFIG_USB_OHCI_BIG_ENDIAN_DESC=y
1245CONFIG_USB_OHCI_BIG_ENDIAN_MMIO=y 1219CONFIG_USB_OHCI_BIG_ENDIAN_MMIO=y
@@ -1360,6 +1334,7 @@ CONFIG_RTC_INTF_DEV=y
1360# CONFIG_RTC_DRV_S35390A is not set 1334# CONFIG_RTC_DRV_S35390A is not set
1361# CONFIG_RTC_DRV_FM3130 is not set 1335# CONFIG_RTC_DRV_FM3130 is not set
1362# CONFIG_RTC_DRV_RX8581 is not set 1336# CONFIG_RTC_DRV_RX8581 is not set
1337# CONFIG_RTC_DRV_RX8025 is not set
1363 1338
1364# 1339#
1365# SPI RTC drivers 1340# SPI RTC drivers
@@ -1387,6 +1362,10 @@ CONFIG_RTC_DRV_CMOS=y
1387# CONFIG_DMADEVICES is not set 1362# CONFIG_DMADEVICES is not set
1388# CONFIG_AUXDISPLAY is not set 1363# CONFIG_AUXDISPLAY is not set
1389# CONFIG_UIO is not set 1364# CONFIG_UIO is not set
1365
1366#
1367# TI VLYNQ
1368#
1390# CONFIG_STAGING is not set 1369# CONFIG_STAGING is not set
1391 1370
1392# 1371#
@@ -1406,11 +1385,12 @@ CONFIG_FS_MBCACHE=y
1406# CONFIG_REISERFS_FS is not set 1385# CONFIG_REISERFS_FS is not set
1407# CONFIG_JFS_FS is not set 1386# CONFIG_JFS_FS is not set
1408# CONFIG_FS_POSIX_ACL is not set 1387# CONFIG_FS_POSIX_ACL is not set
1409CONFIG_FILE_LOCKING=y
1410# CONFIG_XFS_FS is not set 1388# CONFIG_XFS_FS is not set
1411# CONFIG_GFS2_FS is not set 1389# CONFIG_GFS2_FS is not set
1412# CONFIG_OCFS2_FS is not set 1390# CONFIG_OCFS2_FS is not set
1413# CONFIG_BTRFS_FS is not set 1391# CONFIG_BTRFS_FS is not set
1392CONFIG_FILE_LOCKING=y
1393CONFIG_FSNOTIFY=y
1414CONFIG_DNOTIFY=y 1394CONFIG_DNOTIFY=y
1415CONFIG_INOTIFY=y 1395CONFIG_INOTIFY=y
1416CONFIG_INOTIFY_USER=y 1396CONFIG_INOTIFY_USER=y
@@ -1485,6 +1465,7 @@ CONFIG_NFS_FS=y
1485CONFIG_NFS_V3=y 1465CONFIG_NFS_V3=y
1486# CONFIG_NFS_V3_ACL is not set 1466# CONFIG_NFS_V3_ACL is not set
1487CONFIG_NFS_V4=y 1467CONFIG_NFS_V4=y
1468# CONFIG_NFS_V4_1 is not set
1488CONFIG_ROOT_NFS=y 1469CONFIG_ROOT_NFS=y
1489CONFIG_NFSD=y 1470CONFIG_NFSD=y
1490# CONFIG_NFSD_V3 is not set 1471# CONFIG_NFSD_V3 is not set
@@ -1586,6 +1567,7 @@ CONFIG_HAS_IOPORT=y
1586CONFIG_HAS_DMA=y 1567CONFIG_HAS_DMA=y
1587CONFIG_HAVE_LMB=y 1568CONFIG_HAVE_LMB=y
1588CONFIG_NLATTR=y 1569CONFIG_NLATTR=y
1570CONFIG_GENERIC_ATOMIC64=y
1589 1571
1590# 1572#
1591# Kernel hacking 1573# Kernel hacking
@@ -1616,6 +1598,9 @@ CONFIG_SCHED_DEBUG=y
1616# CONFIG_RT_MUTEX_TESTER is not set 1598# CONFIG_RT_MUTEX_TESTER is not set
1617# CONFIG_DEBUG_SPINLOCK is not set 1599# CONFIG_DEBUG_SPINLOCK is not set
1618# CONFIG_DEBUG_MUTEXES is not set 1600# CONFIG_DEBUG_MUTEXES is not set
1601# CONFIG_DEBUG_LOCK_ALLOC is not set
1602# CONFIG_PROVE_LOCKING is not set
1603# CONFIG_LOCK_STAT is not set
1619# CONFIG_DEBUG_SPINLOCK_SLEEP is not set 1604# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
1620# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set 1605# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
1621# CONFIG_DEBUG_KOBJECT is not set 1606# CONFIG_DEBUG_KOBJECT is not set
@@ -1628,7 +1613,6 @@ CONFIG_DEBUG_INFO=y
1628# CONFIG_DEBUG_LIST is not set 1613# CONFIG_DEBUG_LIST is not set
1629# CONFIG_DEBUG_SG is not set 1614# CONFIG_DEBUG_SG is not set
1630# CONFIG_DEBUG_NOTIFIERS is not set 1615# CONFIG_DEBUG_NOTIFIERS is not set
1631# CONFIG_BOOT_PRINTK_DELAY is not set
1632# CONFIG_RCU_TORTURE_TEST is not set 1616# CONFIG_RCU_TORTURE_TEST is not set
1633# CONFIG_RCU_CPU_STALL_DETECTOR is not set 1617# CONFIG_RCU_CPU_STALL_DETECTOR is not set
1634# CONFIG_BACKTRACE_SELF_TEST is not set 1618# CONFIG_BACKTRACE_SELF_TEST is not set
@@ -1642,16 +1626,15 @@ CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
1642CONFIG_HAVE_DYNAMIC_FTRACE=y 1626CONFIG_HAVE_DYNAMIC_FTRACE=y
1643CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y 1627CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
1644CONFIG_TRACING_SUPPORT=y 1628CONFIG_TRACING_SUPPORT=y
1645 1629CONFIG_FTRACE=y
1646#
1647# Tracers
1648#
1649# CONFIG_FUNCTION_TRACER is not set 1630# CONFIG_FUNCTION_TRACER is not set
1631# CONFIG_IRQSOFF_TRACER is not set
1650# CONFIG_SCHED_TRACER is not set 1632# CONFIG_SCHED_TRACER is not set
1651# CONFIG_CONTEXT_SWITCH_TRACER is not set 1633# CONFIG_ENABLE_DEFAULT_TRACERS is not set
1652# CONFIG_EVENT_TRACER is not set
1653# CONFIG_BOOT_TRACER is not set 1634# CONFIG_BOOT_TRACER is not set
1654# CONFIG_TRACE_BRANCH_PROFILING is not set 1635CONFIG_BRANCH_PROFILE_NONE=y
1636# CONFIG_PROFILE_ANNOTATED_BRANCHES is not set
1637# CONFIG_PROFILE_ALL_BRANCHES is not set
1655# CONFIG_STACK_TRACER is not set 1638# CONFIG_STACK_TRACER is not set
1656# CONFIG_KMEMTRACE is not set 1639# CONFIG_KMEMTRACE is not set
1657# CONFIG_WORKQUEUE_TRACER is not set 1640# CONFIG_WORKQUEUE_TRACER is not set
@@ -1659,6 +1642,9 @@ CONFIG_TRACING_SUPPORT=y
1659# CONFIG_SAMPLES is not set 1642# CONFIG_SAMPLES is not set
1660CONFIG_HAVE_ARCH_KGDB=y 1643CONFIG_HAVE_ARCH_KGDB=y
1661# CONFIG_KGDB is not set 1644# CONFIG_KGDB is not set
1645# CONFIG_KMEMCHECK is not set
1646# CONFIG_PPC_DISABLE_WERROR is not set
1647CONFIG_PPC_WERROR=y
1662CONFIG_PRINT_STACK_DEPTH=64 1648CONFIG_PRINT_STACK_DEPTH=64
1663# CONFIG_DEBUG_STACKOVERFLOW is not set 1649# CONFIG_DEBUG_STACKOVERFLOW is not set
1664# CONFIG_DEBUG_STACK_USAGE is not set 1650# CONFIG_DEBUG_STACK_USAGE is not set
diff --git a/arch/powerpc/configs/mpc885_ads_defconfig b/arch/powerpc/configs/mpc885_ads_defconfig
index 42e64ebc279d..dbe8e869a827 100644
--- a/arch/powerpc/configs/mpc885_ads_defconfig
+++ b/arch/powerpc/configs/mpc885_ads_defconfig
@@ -1,14 +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.30-rc3 3# Linux kernel version: 2.6.31-rc4
4# Wed May 13 17:22:01 2009 4# Wed Jul 29 23:31:59 2009
5# 5#
6# CONFIG_PPC64 is not set 6# CONFIG_PPC64 is not set
7 7
8# 8#
9# Processor support 9# Processor support
10# 10#
11# CONFIG_6xx is not set 11# CONFIG_PPC_BOOK3S_32 is not set
12# CONFIG_PPC_85xx is not set 12# CONFIG_PPC_85xx is not set
13CONFIG_PPC_8xx=y 13CONFIG_PPC_8xx=y
14# CONFIG_40x is not set 14# CONFIG_40x is not set
@@ -27,15 +27,16 @@ CONFIG_GENERIC_TIME=y
27CONFIG_GENERIC_TIME_VSYSCALL=y 27CONFIG_GENERIC_TIME_VSYSCALL=y
28CONFIG_GENERIC_CLOCKEVENTS=y 28CONFIG_GENERIC_CLOCKEVENTS=y
29CONFIG_GENERIC_HARDIRQS=y 29CONFIG_GENERIC_HARDIRQS=y
30CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
30# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set 31# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set
31CONFIG_IRQ_PER_CPU=y 32CONFIG_IRQ_PER_CPU=y
32CONFIG_STACKTRACE_SUPPORT=y 33CONFIG_STACKTRACE_SUPPORT=y
33CONFIG_HAVE_LATENCYTOP_SUPPORT=y 34CONFIG_HAVE_LATENCYTOP_SUPPORT=y
35CONFIG_TRACE_IRQFLAGS_SUPPORT=y
34CONFIG_LOCKDEP_SUPPORT=y 36CONFIG_LOCKDEP_SUPPORT=y
35CONFIG_RWSEM_XCHGADD_ALGORITHM=y 37CONFIG_RWSEM_XCHGADD_ALGORITHM=y
36CONFIG_ARCH_HAS_ILOG2_U32=y 38CONFIG_ARCH_HAS_ILOG2_U32=y
37CONFIG_GENERIC_HWEIGHT=y 39CONFIG_GENERIC_HWEIGHT=y
38CONFIG_GENERIC_CALIBRATE_DELAY=y
39CONFIG_GENERIC_FIND_NEXT_BIT=y 40CONFIG_GENERIC_FIND_NEXT_BIT=y
40# CONFIG_ARCH_NO_VIRT_TO_BUS is not set 41# CONFIG_ARCH_NO_VIRT_TO_BUS is not set
41CONFIG_PPC=y 42CONFIG_PPC=y
@@ -49,11 +50,13 @@ CONFIG_OF=y
49# CONFIG_GENERIC_TBSYNC is not set 50# CONFIG_GENERIC_TBSYNC is not set
50CONFIG_AUDIT_ARCH=y 51CONFIG_AUDIT_ARCH=y
51CONFIG_GENERIC_BUG=y 52CONFIG_GENERIC_BUG=y
53CONFIG_DTC=y
52# CONFIG_DEFAULT_UIMAGE is not set 54# CONFIG_DEFAULT_UIMAGE is not set
53# CONFIG_PPC_DCR_NATIVE is not set 55# CONFIG_PPC_DCR_NATIVE is not set
54# CONFIG_PPC_DCR_MMIO is not set 56# CONFIG_PPC_DCR_MMIO is not set
55CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y 57CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y
56CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" 58CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
59CONFIG_CONSTRUCTORS=y
57 60
58# 61#
59# General setup 62# General setup
@@ -100,7 +103,6 @@ CONFIG_EMBEDDED=y
100CONFIG_KALLSYMS=y 103CONFIG_KALLSYMS=y
101# CONFIG_KALLSYMS_ALL is not set 104# CONFIG_KALLSYMS_ALL is not set
102# CONFIG_KALLSYMS_EXTRA_PASS is not set 105# CONFIG_KALLSYMS_EXTRA_PASS is not set
103# CONFIG_STRIP_ASM_SYMS is not set
104CONFIG_HOTPLUG=y 106CONFIG_HOTPLUG=y
105CONFIG_PRINTK=y 107CONFIG_PRINTK=y
106CONFIG_BUG=y 108CONFIG_BUG=y
@@ -113,8 +115,15 @@ CONFIG_TIMERFD=y
113CONFIG_EVENTFD=y 115CONFIG_EVENTFD=y
114CONFIG_SHMEM=y 116CONFIG_SHMEM=y
115CONFIG_AIO=y 117CONFIG_AIO=y
118CONFIG_HAVE_PERF_COUNTERS=y
119
120#
121# Performance Counters
122#
123# CONFIG_PERF_COUNTERS is not set
116# CONFIG_VM_EVENT_COUNTERS is not set 124# CONFIG_VM_EVENT_COUNTERS is not set
117CONFIG_SLUB_DEBUG=y 125CONFIG_SLUB_DEBUG=y
126# CONFIG_STRIP_ASM_SYMS is not set
118CONFIG_COMPAT_BRK=y 127CONFIG_COMPAT_BRK=y
119# CONFIG_SLAB is not set 128# CONFIG_SLAB is not set
120CONFIG_SLUB=y 129CONFIG_SLUB=y
@@ -128,13 +137,17 @@ CONFIG_HAVE_KPROBES=y
128CONFIG_HAVE_KRETPROBES=y 137CONFIG_HAVE_KRETPROBES=y
129CONFIG_HAVE_ARCH_TRACEHOOK=y 138CONFIG_HAVE_ARCH_TRACEHOOK=y
130CONFIG_HAVE_CLK=y 139CONFIG_HAVE_CLK=y
140
141#
142# GCOV-based kernel profiling
143#
131# CONFIG_SLOW_WORK is not set 144# CONFIG_SLOW_WORK is not set
132# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set 145# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
133CONFIG_SLABINFO=y 146CONFIG_SLABINFO=y
134CONFIG_BASE_SMALL=1 147CONFIG_BASE_SMALL=1
135# CONFIG_MODULES is not set 148# CONFIG_MODULES is not set
136CONFIG_BLOCK=y 149CONFIG_BLOCK=y
137# CONFIG_LBD is not set 150CONFIG_LBDAF=y
138# CONFIG_BLK_DEV_BSG is not set 151# CONFIG_BLK_DEV_BSG is not set
139# CONFIG_BLK_DEV_INTEGRITY is not set 152# CONFIG_BLK_DEV_INTEGRITY is not set
140 153
@@ -227,6 +240,7 @@ CONFIG_BINFMT_ELF=y
227# CONFIG_MATH_EMULATION is not set 240# CONFIG_MATH_EMULATION is not set
228CONFIG_8XX_MINIMAL_FPEMU=y 241CONFIG_8XX_MINIMAL_FPEMU=y
229# CONFIG_IOMMU_HELPER is not set 242# CONFIG_IOMMU_HELPER is not set
243# CONFIG_SWIOTLB is not set
230CONFIG_PPC_NEED_DMA_SYNC_OPS=y 244CONFIG_PPC_NEED_DMA_SYNC_OPS=y
231CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y 245CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
232CONFIG_ARCH_HAS_WALK_MEMORY=y 246CONFIG_ARCH_HAS_WALK_MEMORY=y
@@ -246,9 +260,9 @@ CONFIG_MIGRATION=y
246CONFIG_ZONE_DMA_FLAG=1 260CONFIG_ZONE_DMA_FLAG=1
247CONFIG_BOUNCE=y 261CONFIG_BOUNCE=y
248CONFIG_VIRT_TO_BUS=y 262CONFIG_VIRT_TO_BUS=y
249CONFIG_UNEVICTABLE_LRU=y
250CONFIG_HAVE_MLOCK=y 263CONFIG_HAVE_MLOCK=y
251CONFIG_HAVE_MLOCKED_PAGE_BIT=y 264CONFIG_HAVE_MLOCKED_PAGE_BIT=y
265CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
252CONFIG_PPC_4K_PAGES=y 266CONFIG_PPC_4K_PAGES=y
253# CONFIG_PPC_16K_PAGES is not set 267# CONFIG_PPC_16K_PAGES is not set
254# CONFIG_PPC_64K_PAGES is not set 268# CONFIG_PPC_64K_PAGES is not set
@@ -287,6 +301,7 @@ CONFIG_PAGE_OFFSET=0xc0000000
287CONFIG_KERNEL_START=0xc0000000 301CONFIG_KERNEL_START=0xc0000000
288CONFIG_PHYSICAL_START=0x00000000 302CONFIG_PHYSICAL_START=0x00000000
289CONFIG_TASK_SIZE=0x80000000 303CONFIG_TASK_SIZE=0x80000000
304CONFIG_CONSISTENT_SIZE=0x00200000
290CONFIG_NET=y 305CONFIG_NET=y
291 306
292# 307#
@@ -343,6 +358,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
343# CONFIG_ECONET is not set 358# CONFIG_ECONET is not set
344# CONFIG_WAN_ROUTER is not set 359# CONFIG_WAN_ROUTER is not set
345# CONFIG_PHONET is not set 360# CONFIG_PHONET is not set
361# CONFIG_IEEE802154 is not set
346# CONFIG_NET_SCHED is not set 362# CONFIG_NET_SCHED is not set
347# CONFIG_DCB is not set 363# CONFIG_DCB is not set
348 364
@@ -360,7 +376,11 @@ CONFIG_WIRELESS=y
360CONFIG_WIRELESS_OLD_REGULATORY=y 376CONFIG_WIRELESS_OLD_REGULATORY=y
361# CONFIG_WIRELESS_EXT is not set 377# CONFIG_WIRELESS_EXT is not set
362# CONFIG_LIB80211 is not set 378# CONFIG_LIB80211 is not set
363# CONFIG_MAC80211 is not set 379
380#
381# CFG80211 needs to be enabled for MAC80211
382#
383CONFIG_MAC80211_DEFAULT_PS_VALUE=0
364# CONFIG_WIMAX is not set 384# CONFIG_WIMAX is not set
365# CONFIG_RFKILL is not set 385# CONFIG_RFKILL is not set
366# CONFIG_NET_9P is not set 386# CONFIG_NET_9P is not set
@@ -463,6 +483,7 @@ CONFIG_MTD_PHYSMAP_OF=y
463# 483#
464# CONFIG_MTD_UBI is not set 484# CONFIG_MTD_UBI is not set
465CONFIG_OF_DEVICE=y 485CONFIG_OF_DEVICE=y
486CONFIG_OF_MDIO=y
466# CONFIG_PARPORT is not set 487# CONFIG_PARPORT is not set
467# CONFIG_BLK_DEV is not set 488# CONFIG_BLK_DEV is not set
468# CONFIG_MISC_DEVICES is not set 489# CONFIG_MISC_DEVICES is not set
@@ -480,7 +501,6 @@ CONFIG_HAVE_IDE=y
480# CONFIG_MD is not set 501# CONFIG_MD is not set
481# CONFIG_MACINTOSH_DRIVERS is not set 502# CONFIG_MACINTOSH_DRIVERS is not set
482CONFIG_NETDEVICES=y 503CONFIG_NETDEVICES=y
483CONFIG_COMPAT_NET_DEV_OPS=y
484# CONFIG_DUMMY is not set 504# CONFIG_DUMMY is not set
485# CONFIG_BONDING is not set 505# CONFIG_BONDING is not set
486# CONFIG_MACVLAN is not set 506# CONFIG_MACVLAN is not set
@@ -519,6 +539,7 @@ CONFIG_MII=y
519# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set 539# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set
520# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set 540# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
521# CONFIG_B44 is not set 541# CONFIG_B44 is not set
542# CONFIG_KS8842 is not set
522CONFIG_FS_ENET=y 543CONFIG_FS_ENET=y
523# CONFIG_FS_ENET_HAS_SCC is not set 544# CONFIG_FS_ENET_HAS_SCC is not set
524CONFIG_FS_ENET_HAS_FEC=y 545CONFIG_FS_ENET_HAS_FEC=y
@@ -590,6 +611,11 @@ CONFIG_GEN_RTC=y
590# CONFIG_TCG_TPM is not set 611# CONFIG_TCG_TPM is not set
591# CONFIG_I2C is not set 612# CONFIG_I2C is not set
592# CONFIG_SPI is not set 613# CONFIG_SPI is not set
614
615#
616# PPS support
617#
618# CONFIG_PPS is not set
593CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y 619CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
594# CONFIG_GPIOLIB is not set 620# CONFIG_GPIOLIB is not set
595# CONFIG_W1 is not set 621# CONFIG_W1 is not set
@@ -613,22 +639,7 @@ CONFIG_SSB_POSSIBLE=y
613# CONFIG_HTC_PASIC3 is not set 639# CONFIG_HTC_PASIC3 is not set
614# CONFIG_MFD_TMIO is not set 640# CONFIG_MFD_TMIO is not set
615# CONFIG_REGULATOR is not set 641# CONFIG_REGULATOR is not set
616 642# CONFIG_MEDIA_SUPPORT is not set
617#
618# Multimedia devices
619#
620
621#
622# Multimedia core support
623#
624# CONFIG_VIDEO_DEV is not set
625# CONFIG_DVB_CORE is not set
626# CONFIG_VIDEO_MEDIA is not set
627
628#
629# Multimedia drivers
630#
631CONFIG_DAB=y
632 643
633# 644#
634# Graphics support 645# Graphics support
@@ -653,6 +664,10 @@ CONFIG_DAB=y
653# CONFIG_DMADEVICES is not set 664# CONFIG_DMADEVICES is not set
654# CONFIG_AUXDISPLAY is not set 665# CONFIG_AUXDISPLAY is not set
655# CONFIG_UIO is not set 666# CONFIG_UIO is not set
667
668#
669# TI VLYNQ
670#
656# CONFIG_STAGING is not set 671# CONFIG_STAGING is not set
657 672
658# 673#
@@ -664,12 +679,15 @@ CONFIG_DAB=y
664# CONFIG_REISERFS_FS is not set 679# CONFIG_REISERFS_FS is not set
665# CONFIG_JFS_FS is not set 680# CONFIG_JFS_FS is not set
666# CONFIG_FS_POSIX_ACL is not set 681# CONFIG_FS_POSIX_ACL is not set
667CONFIG_FILE_LOCKING=y
668# CONFIG_XFS_FS is not set 682# CONFIG_XFS_FS is not set
683# CONFIG_GFS2_FS is not set
669# CONFIG_OCFS2_FS is not set 684# CONFIG_OCFS2_FS is not set
670# CONFIG_BTRFS_FS is not set 685# CONFIG_BTRFS_FS is not set
686CONFIG_FILE_LOCKING=y
687CONFIG_FSNOTIFY=y
671# CONFIG_DNOTIFY is not set 688# CONFIG_DNOTIFY is not set
672# CONFIG_INOTIFY is not set 689# CONFIG_INOTIFY is not set
690CONFIG_INOTIFY_USER=y
673# CONFIG_QUOTA is not set 691# CONFIG_QUOTA is not set
674# CONFIG_AUTOFS_FS is not set 692# CONFIG_AUTOFS_FS is not set
675# CONFIG_AUTOFS4_FS is not set 693# CONFIG_AUTOFS4_FS is not set
@@ -786,6 +804,7 @@ CONFIG_HAS_IOPORT=y
786CONFIG_HAS_DMA=y 804CONFIG_HAS_DMA=y
787CONFIG_HAVE_LMB=y 805CONFIG_HAVE_LMB=y
788CONFIG_NLATTR=y 806CONFIG_NLATTR=y
807CONFIG_GENERIC_ATOMIC64=y
789 808
790# 809#
791# Kernel hacking 810# Kernel hacking
@@ -814,6 +833,9 @@ CONFIG_SCHED_DEBUG=y
814# CONFIG_SLUB_STATS is not set 833# CONFIG_SLUB_STATS is not set
815# CONFIG_DEBUG_SPINLOCK is not set 834# CONFIG_DEBUG_SPINLOCK is not set
816# CONFIG_DEBUG_MUTEXES is not set 835# CONFIG_DEBUG_MUTEXES is not set
836# CONFIG_DEBUG_LOCK_ALLOC is not set
837# CONFIG_PROVE_LOCKING is not set
838# CONFIG_LOCK_STAT is not set
817# CONFIG_DEBUG_SPINLOCK_SLEEP is not set 839# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
818# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set 840# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
819# CONFIG_DEBUG_KOBJECT is not set 841# CONFIG_DEBUG_KOBJECT is not set
@@ -825,7 +847,6 @@ CONFIG_DEBUG_INFO=y
825# CONFIG_DEBUG_LIST is not set 847# CONFIG_DEBUG_LIST is not set
826# CONFIG_DEBUG_SG is not set 848# CONFIG_DEBUG_SG is not set
827# CONFIG_DEBUG_NOTIFIERS is not set 849# CONFIG_DEBUG_NOTIFIERS is not set
828# CONFIG_BOOT_PRINTK_DELAY is not set
829# CONFIG_RCU_TORTURE_TEST is not set 850# CONFIG_RCU_TORTURE_TEST is not set
830# CONFIG_RCU_CPU_STALL_DETECTOR is not set 851# CONFIG_RCU_CPU_STALL_DETECTOR is not set
831# CONFIG_BACKTRACE_SELF_TEST is not set 852# CONFIG_BACKTRACE_SELF_TEST is not set
@@ -838,16 +859,15 @@ CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
838CONFIG_HAVE_DYNAMIC_FTRACE=y 859CONFIG_HAVE_DYNAMIC_FTRACE=y
839CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y 860CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
840CONFIG_TRACING_SUPPORT=y 861CONFIG_TRACING_SUPPORT=y
841 862CONFIG_FTRACE=y
842#
843# Tracers
844#
845# CONFIG_FUNCTION_TRACER is not set 863# CONFIG_FUNCTION_TRACER is not set
864# CONFIG_IRQSOFF_TRACER is not set
846# CONFIG_SCHED_TRACER is not set 865# CONFIG_SCHED_TRACER is not set
847# CONFIG_CONTEXT_SWITCH_TRACER is not set 866# CONFIG_ENABLE_DEFAULT_TRACERS is not set
848# CONFIG_EVENT_TRACER is not set
849# CONFIG_BOOT_TRACER is not set 867# CONFIG_BOOT_TRACER is not set
850# CONFIG_TRACE_BRANCH_PROFILING is not set 868CONFIG_BRANCH_PROFILE_NONE=y
869# CONFIG_PROFILE_ANNOTATED_BRANCHES is not set
870# CONFIG_PROFILE_ALL_BRANCHES is not set
851# CONFIG_STACK_TRACER is not set 871# CONFIG_STACK_TRACER is not set
852# CONFIG_KMEMTRACE is not set 872# CONFIG_KMEMTRACE is not set
853# CONFIG_WORKQUEUE_TRACER is not set 873# CONFIG_WORKQUEUE_TRACER is not set
@@ -855,6 +875,9 @@ CONFIG_TRACING_SUPPORT=y
855# CONFIG_SAMPLES is not set 875# CONFIG_SAMPLES is not set
856CONFIG_HAVE_ARCH_KGDB=y 876CONFIG_HAVE_ARCH_KGDB=y
857# CONFIG_KGDB is not set 877# CONFIG_KGDB is not set
878# CONFIG_KMEMCHECK is not set
879# CONFIG_PPC_DISABLE_WERROR is not set
880CONFIG_PPC_WERROR=y
858CONFIG_PRINT_STACK_DEPTH=64 881CONFIG_PRINT_STACK_DEPTH=64
859# CONFIG_DEBUG_STACKOVERFLOW is not set 882# CONFIG_DEBUG_STACKOVERFLOW is not set
860# CONFIG_DEBUG_STACK_USAGE is not set 883# CONFIG_DEBUG_STACK_USAGE is not set
diff --git a/arch/powerpc/configs/pq2fads_defconfig b/arch/powerpc/configs/pq2fads_defconfig
index 129d80860f2a..ff96bb43c32d 100644
--- a/arch/powerpc/configs/pq2fads_defconfig
+++ b/arch/powerpc/configs/pq2fads_defconfig
@@ -1,25 +1,27 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.30-rc3 3# Linux kernel version: 2.6.31-rc4
4# Wed May 13 17:22:02 2009 4# Wed Jul 29 23:32:00 2009
5# 5#
6# CONFIG_PPC64 is not set 6# CONFIG_PPC64 is not set
7 7
8# 8#
9# Processor support 9# Processor support
10# 10#
11CONFIG_6xx=y 11CONFIG_PPC_BOOK3S_32=y
12# CONFIG_PPC_85xx is not set 12# CONFIG_PPC_85xx is not set
13# CONFIG_PPC_8xx is not set 13# CONFIG_PPC_8xx is not set
14# CONFIG_40x is not set 14# CONFIG_40x is not set
15# CONFIG_44x is not set 15# CONFIG_44x is not set
16# CONFIG_E200 is not set 16# CONFIG_E200 is not set
17CONFIG_PPC_BOOK3S=y 17CONFIG_PPC_BOOK3S=y
18CONFIG_6xx=y
18CONFIG_PPC_FPU=y 19CONFIG_PPC_FPU=y
19# CONFIG_ALTIVEC is not set 20# CONFIG_ALTIVEC is not set
20CONFIG_PPC_STD_MMU=y 21CONFIG_PPC_STD_MMU=y
21CONFIG_PPC_STD_MMU_32=y 22CONFIG_PPC_STD_MMU_32=y
22# CONFIG_PPC_MM_SLICES is not set 23# CONFIG_PPC_MM_SLICES is not set
24CONFIG_PPC_HAVE_PMU_SUPPORT=y
23# CONFIG_SMP is not set 25# CONFIG_SMP is not set
24CONFIG_PPC32=y 26CONFIG_PPC32=y
25CONFIG_WORD_SIZE=32 27CONFIG_WORD_SIZE=32
@@ -30,15 +32,16 @@ CONFIG_GENERIC_TIME=y
30CONFIG_GENERIC_TIME_VSYSCALL=y 32CONFIG_GENERIC_TIME_VSYSCALL=y
31CONFIG_GENERIC_CLOCKEVENTS=y 33CONFIG_GENERIC_CLOCKEVENTS=y
32CONFIG_GENERIC_HARDIRQS=y 34CONFIG_GENERIC_HARDIRQS=y
35CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
33# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set 36# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set
34CONFIG_IRQ_PER_CPU=y 37CONFIG_IRQ_PER_CPU=y
35CONFIG_STACKTRACE_SUPPORT=y 38CONFIG_STACKTRACE_SUPPORT=y
36CONFIG_HAVE_LATENCYTOP_SUPPORT=y 39CONFIG_HAVE_LATENCYTOP_SUPPORT=y
40CONFIG_TRACE_IRQFLAGS_SUPPORT=y
37CONFIG_LOCKDEP_SUPPORT=y 41CONFIG_LOCKDEP_SUPPORT=y
38CONFIG_RWSEM_XCHGADD_ALGORITHM=y 42CONFIG_RWSEM_XCHGADD_ALGORITHM=y
39CONFIG_ARCH_HAS_ILOG2_U32=y 43CONFIG_ARCH_HAS_ILOG2_U32=y
40CONFIG_GENERIC_HWEIGHT=y 44CONFIG_GENERIC_HWEIGHT=y
41CONFIG_GENERIC_CALIBRATE_DELAY=y
42CONFIG_GENERIC_FIND_NEXT_BIT=y 45CONFIG_GENERIC_FIND_NEXT_BIT=y
43CONFIG_GENERIC_GPIO=y 46CONFIG_GENERIC_GPIO=y
44# CONFIG_ARCH_NO_VIRT_TO_BUS is not set 47# CONFIG_ARCH_NO_VIRT_TO_BUS is not set
@@ -53,11 +56,13 @@ CONFIG_OF=y
53# CONFIG_GENERIC_TBSYNC is not set 56# CONFIG_GENERIC_TBSYNC is not set
54CONFIG_AUDIT_ARCH=y 57CONFIG_AUDIT_ARCH=y
55CONFIG_GENERIC_BUG=y 58CONFIG_GENERIC_BUG=y
59CONFIG_DTC=y
56CONFIG_DEFAULT_UIMAGE=y 60CONFIG_DEFAULT_UIMAGE=y
57# CONFIG_PPC_DCR_NATIVE is not set 61# CONFIG_PPC_DCR_NATIVE is not set
58# CONFIG_PPC_DCR_MMIO is not set 62# CONFIG_PPC_DCR_MMIO is not set
59CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y 63CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y
60CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" 64CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
65CONFIG_CONSTRUCTORS=y
61 66
62# 67#
63# General setup 68# General setup
@@ -103,7 +108,6 @@ CONFIG_SYSCTL_SYSCALL=y
103CONFIG_KALLSYMS=y 108CONFIG_KALLSYMS=y
104CONFIG_KALLSYMS_ALL=y 109CONFIG_KALLSYMS_ALL=y
105# CONFIG_KALLSYMS_EXTRA_PASS is not set 110# CONFIG_KALLSYMS_EXTRA_PASS is not set
106# CONFIG_STRIP_ASM_SYMS is not set
107CONFIG_HOTPLUG=y 111CONFIG_HOTPLUG=y
108CONFIG_PRINTK=y 112CONFIG_PRINTK=y
109CONFIG_BUG=y 113CONFIG_BUG=y
@@ -116,9 +120,16 @@ CONFIG_TIMERFD=y
116CONFIG_EVENTFD=y 120CONFIG_EVENTFD=y
117CONFIG_SHMEM=y 121CONFIG_SHMEM=y
118CONFIG_AIO=y 122CONFIG_AIO=y
123CONFIG_HAVE_PERF_COUNTERS=y
124
125#
126# Performance Counters
127#
128# CONFIG_PERF_COUNTERS is not set
119CONFIG_VM_EVENT_COUNTERS=y 129CONFIG_VM_EVENT_COUNTERS=y
120CONFIG_PCI_QUIRKS=y 130CONFIG_PCI_QUIRKS=y
121CONFIG_SLUB_DEBUG=y 131CONFIG_SLUB_DEBUG=y
132# CONFIG_STRIP_ASM_SYMS is not set
122CONFIG_COMPAT_BRK=y 133CONFIG_COMPAT_BRK=y
123# CONFIG_SLAB is not set 134# CONFIG_SLAB is not set
124CONFIG_SLUB=y 135CONFIG_SLUB=y
@@ -132,6 +143,10 @@ CONFIG_HAVE_KPROBES=y
132CONFIG_HAVE_KRETPROBES=y 143CONFIG_HAVE_KRETPROBES=y
133CONFIG_HAVE_ARCH_TRACEHOOK=y 144CONFIG_HAVE_ARCH_TRACEHOOK=y
134CONFIG_HAVE_CLK=y 145CONFIG_HAVE_CLK=y
146
147#
148# GCOV-based kernel profiling
149#
135# CONFIG_SLOW_WORK is not set 150# CONFIG_SLOW_WORK is not set
136# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set 151# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
137CONFIG_SLABINFO=y 152CONFIG_SLABINFO=y
@@ -139,7 +154,7 @@ CONFIG_RT_MUTEXES=y
139CONFIG_BASE_SMALL=0 154CONFIG_BASE_SMALL=0
140# CONFIG_MODULES is not set 155# CONFIG_MODULES is not set
141CONFIG_BLOCK=y 156CONFIG_BLOCK=y
142# CONFIG_LBD is not set 157CONFIG_LBDAF=y
143# CONFIG_BLK_DEV_INTEGRITY is not set 158# CONFIG_BLK_DEV_INTEGRITY is not set
144 159
145# 160#
@@ -219,6 +234,7 @@ CONFIG_BINFMT_ELF=y
219# CONFIG_HAVE_AOUT is not set 234# CONFIG_HAVE_AOUT is not set
220CONFIG_BINFMT_MISC=y 235CONFIG_BINFMT_MISC=y
221# CONFIG_IOMMU_HELPER is not set 236# CONFIG_IOMMU_HELPER is not set
237# CONFIG_SWIOTLB is not set
222CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y 238CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
223CONFIG_ARCH_HAS_WALK_MEMORY=y 239CONFIG_ARCH_HAS_WALK_MEMORY=y
224CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y 240CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y
@@ -234,9 +250,9 @@ CONFIG_MIGRATION=y
234CONFIG_ZONE_DMA_FLAG=1 250CONFIG_ZONE_DMA_FLAG=1
235CONFIG_BOUNCE=y 251CONFIG_BOUNCE=y
236CONFIG_VIRT_TO_BUS=y 252CONFIG_VIRT_TO_BUS=y
237CONFIG_UNEVICTABLE_LRU=y
238CONFIG_HAVE_MLOCK=y 253CONFIG_HAVE_MLOCK=y
239CONFIG_HAVE_MLOCKED_PAGE_BIT=y 254CONFIG_HAVE_MLOCKED_PAGE_BIT=y
255CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
240CONFIG_PPC_4K_PAGES=y 256CONFIG_PPC_4K_PAGES=y
241# CONFIG_PPC_16K_PAGES is not set 257# CONFIG_PPC_16K_PAGES is not set
242# CONFIG_PPC_64K_PAGES is not set 258# CONFIG_PPC_64K_PAGES is not set
@@ -307,6 +323,7 @@ CONFIG_IP_PNP_BOOTP=y
307# CONFIG_NET_IPIP is not set 323# CONFIG_NET_IPIP is not set
308# CONFIG_NET_IPGRE is not set 324# CONFIG_NET_IPGRE is not set
309# CONFIG_IP_MROUTE is not set 325# CONFIG_IP_MROUTE is not set
326# CONFIG_ARPD is not set
310CONFIG_SYN_COOKIES=y 327CONFIG_SYN_COOKIES=y
311# CONFIG_INET_AH is not set 328# CONFIG_INET_AH is not set
312# CONFIG_INET_ESP is not set 329# CONFIG_INET_ESP is not set
@@ -387,7 +404,11 @@ CONFIG_WIRELESS=y
387CONFIG_WIRELESS_OLD_REGULATORY=y 404CONFIG_WIRELESS_OLD_REGULATORY=y
388# CONFIG_WIRELESS_EXT is not set 405# CONFIG_WIRELESS_EXT is not set
389# CONFIG_LIB80211 is not set 406# CONFIG_LIB80211 is not set
390# CONFIG_MAC80211 is not set 407
408#
409# CFG80211 needs to be enabled for MAC80211
410#
411CONFIG_MAC80211_DEFAULT_PS_VALUE=0
391# CONFIG_WIMAX is not set 412# CONFIG_WIMAX is not set
392# CONFIG_RFKILL is not set 413# CONFIG_RFKILL is not set
393 414
@@ -493,6 +514,7 @@ CONFIG_MTD_PHYSMAP_OF=y
493# CONFIG_MTD_UBI is not set 514# CONFIG_MTD_UBI is not set
494CONFIG_OF_DEVICE=y 515CONFIG_OF_DEVICE=y
495CONFIG_OF_GPIO=y 516CONFIG_OF_GPIO=y
517CONFIG_OF_MDIO=y
496# CONFIG_PARPORT is not set 518# CONFIG_PARPORT is not set
497CONFIG_BLK_DEV=y 519CONFIG_BLK_DEV=y
498# CONFIG_BLK_DEV_FD is not set 520# CONFIG_BLK_DEV_FD is not set
@@ -518,6 +540,7 @@ CONFIG_MISC_DEVICES=y
518# EEPROM support 540# EEPROM support
519# 541#
520# CONFIG_EEPROM_93CX6 is not set 542# CONFIG_EEPROM_93CX6 is not set
543# CONFIG_CB710_CORE is not set
521CONFIG_HAVE_IDE=y 544CONFIG_HAVE_IDE=y
522CONFIG_IDE=y 545CONFIG_IDE=y
523 546
@@ -583,13 +606,17 @@ CONFIG_IDE_PROC_FS=y
583# 606#
584 607
585# 608#
586# A new alternative FireWire stack is available with EXPERIMENTAL=y 609# You can enable one or both FireWire driver stacks.
610#
611
612#
613# See the help texts for more information.
587# 614#
615# CONFIG_FIREWIRE is not set
588# CONFIG_IEEE1394 is not set 616# CONFIG_IEEE1394 is not set
589# CONFIG_I2O is not set 617# CONFIG_I2O is not set
590# CONFIG_MACINTOSH_DRIVERS is not set 618# CONFIG_MACINTOSH_DRIVERS is not set
591CONFIG_NETDEVICES=y 619CONFIG_NETDEVICES=y
592CONFIG_COMPAT_NET_DEV_OPS=y
593# CONFIG_DUMMY is not set 620# CONFIG_DUMMY is not set
594# CONFIG_BONDING is not set 621# CONFIG_BONDING is not set
595# CONFIG_EQUALIZER is not set 622# CONFIG_EQUALIZER is not set
@@ -636,6 +663,7 @@ CONFIG_MII=y
636# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set 663# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
637# CONFIG_NET_PCI is not set 664# CONFIG_NET_PCI is not set
638# CONFIG_B44 is not set 665# CONFIG_B44 is not set
666# CONFIG_KS8842 is not set
639# CONFIG_ATL2 is not set 667# CONFIG_ATL2 is not set
640CONFIG_FS_ENET=y 668CONFIG_FS_ENET=y
641# CONFIG_FS_ENET_HAS_SCC is not set 669# CONFIG_FS_ENET_HAS_SCC is not set
@@ -657,8 +685,10 @@ CONFIG_NETDEV_1000=y
657# CONFIG_VIA_VELOCITY is not set 685# CONFIG_VIA_VELOCITY is not set
658# CONFIG_TIGON3 is not set 686# CONFIG_TIGON3 is not set
659# CONFIG_BNX2 is not set 687# CONFIG_BNX2 is not set
688# CONFIG_CNIC is not set
660# CONFIG_FSL_PQ_MDIO is not set 689# CONFIG_FSL_PQ_MDIO is not set
661# CONFIG_GIANFAR is not set 690# CONFIG_GIANFAR is not set
691# CONFIG_MV643XX_ETH is not set
662# CONFIG_QLA3XXX is not set 692# CONFIG_QLA3XXX is not set
663# CONFIG_ATL1 is not set 693# CONFIG_ATL1 is not set
664# CONFIG_JME is not set 694# CONFIG_JME is not set
@@ -730,12 +760,13 @@ CONFIG_INPUT_EVDEV=y
730# 760#
731CONFIG_INPUT_KEYBOARD=y 761CONFIG_INPUT_KEYBOARD=y
732CONFIG_KEYBOARD_ATKBD=y 762CONFIG_KEYBOARD_ATKBD=y
733# CONFIG_KEYBOARD_SUNKBD is not set
734# CONFIG_KEYBOARD_LKKBD is not set 763# CONFIG_KEYBOARD_LKKBD is not set
735# CONFIG_KEYBOARD_XTKBD is not set 764# CONFIG_KEYBOARD_GPIO is not set
765# CONFIG_KEYBOARD_MATRIX is not set
736# CONFIG_KEYBOARD_NEWTON is not set 766# CONFIG_KEYBOARD_NEWTON is not set
737# CONFIG_KEYBOARD_STOWAWAY is not set 767# CONFIG_KEYBOARD_STOWAWAY is not set
738# CONFIG_KEYBOARD_GPIO is not set 768# CONFIG_KEYBOARD_SUNKBD is not set
769# CONFIG_KEYBOARD_XTKBD is not set
739CONFIG_INPUT_MOUSE=y 770CONFIG_INPUT_MOUSE=y
740CONFIG_MOUSE_PS2=y 771CONFIG_MOUSE_PS2=y
741CONFIG_MOUSE_PS2_ALPS=y 772CONFIG_MOUSE_PS2_ALPS=y
@@ -802,6 +833,10 @@ CONFIG_HW_RANDOM=y
802CONFIG_DEVPORT=y 833CONFIG_DEVPORT=y
803# CONFIG_I2C is not set 834# CONFIG_I2C is not set
804# CONFIG_SPI is not set 835# CONFIG_SPI is not set
836
837#
838# PPS support
839#
805CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y 840CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
806CONFIG_ARCH_REQUIRE_GPIOLIB=y 841CONFIG_ARCH_REQUIRE_GPIOLIB=y
807CONFIG_GPIOLIB=y 842CONFIG_GPIOLIB=y
@@ -845,22 +880,7 @@ CONFIG_SSB_POSSIBLE=y
845# CONFIG_HTC_PASIC3 is not set 880# CONFIG_HTC_PASIC3 is not set
846# CONFIG_MFD_TMIO is not set 881# CONFIG_MFD_TMIO is not set
847# CONFIG_REGULATOR is not set 882# CONFIG_REGULATOR is not set
848 883# CONFIG_MEDIA_SUPPORT is not set
849#
850# Multimedia devices
851#
852
853#
854# Multimedia core support
855#
856# CONFIG_VIDEO_DEV is not set
857# CONFIG_DVB_CORE is not set
858# CONFIG_VIDEO_MEDIA is not set
859
860#
861# Multimedia drivers
862#
863CONFIG_DAB=y
864 884
865# 885#
866# Graphics support 886# Graphics support
@@ -903,8 +923,9 @@ CONFIG_USB_GADGET_SELECTED=y
903# CONFIG_USB_GADGET_OMAP is not set 923# CONFIG_USB_GADGET_OMAP is not set
904# CONFIG_USB_GADGET_PXA25X is not set 924# CONFIG_USB_GADGET_PXA25X is not set
905# CONFIG_USB_GADGET_PXA27X is not set 925# CONFIG_USB_GADGET_PXA27X is not set
906# CONFIG_USB_GADGET_S3C2410 is not set 926# CONFIG_USB_GADGET_S3C_HSOTG is not set
907# CONFIG_USB_GADGET_IMX is not set 927# CONFIG_USB_GADGET_IMX is not set
928# CONFIG_USB_GADGET_S3C2410 is not set
908CONFIG_USB_GADGET_M66592=y 929CONFIG_USB_GADGET_M66592=y
909CONFIG_USB_M66592=y 930CONFIG_USB_M66592=y
910# CONFIG_USB_GADGET_AMD5536UDC is not set 931# CONFIG_USB_GADGET_AMD5536UDC is not set
@@ -912,9 +933,11 @@ CONFIG_USB_M66592=y
912# CONFIG_USB_GADGET_CI13XXX is not set 933# CONFIG_USB_GADGET_CI13XXX is not set
913# CONFIG_USB_GADGET_NET2280 is not set 934# CONFIG_USB_GADGET_NET2280 is not set
914# CONFIG_USB_GADGET_GOKU is not set 935# CONFIG_USB_GADGET_GOKU is not set
936# CONFIG_USB_GADGET_LANGWELL is not set
915# CONFIG_USB_GADGET_DUMMY_HCD is not set 937# CONFIG_USB_GADGET_DUMMY_HCD is not set
916CONFIG_USB_GADGET_DUALSPEED=y 938CONFIG_USB_GADGET_DUALSPEED=y
917# CONFIG_USB_ZERO is not set 939# CONFIG_USB_ZERO is not set
940# CONFIG_USB_AUDIO is not set
918CONFIG_USB_ETH=y 941CONFIG_USB_ETH=y
919CONFIG_USB_ETH_RNDIS=y 942CONFIG_USB_ETH_RNDIS=y
920# CONFIG_USB_GADGETFS is not set 943# CONFIG_USB_GADGETFS is not set
@@ -939,6 +962,10 @@ CONFIG_USB_ETH_RNDIS=y
939# CONFIG_DMADEVICES is not set 962# CONFIG_DMADEVICES is not set
940# CONFIG_AUXDISPLAY is not set 963# CONFIG_AUXDISPLAY is not set
941# CONFIG_UIO is not set 964# CONFIG_UIO is not set
965
966#
967# TI VLYNQ
968#
942# CONFIG_STAGING is not set 969# CONFIG_STAGING is not set
943 970
944# 971#
@@ -958,9 +985,10 @@ CONFIG_FS_MBCACHE=y
958# CONFIG_REISERFS_FS is not set 985# CONFIG_REISERFS_FS is not set
959# CONFIG_JFS_FS is not set 986# CONFIG_JFS_FS is not set
960CONFIG_FS_POSIX_ACL=y 987CONFIG_FS_POSIX_ACL=y
961CONFIG_FILE_LOCKING=y
962# CONFIG_XFS_FS is not set 988# CONFIG_XFS_FS is not set
963# CONFIG_OCFS2_FS is not set 989# CONFIG_OCFS2_FS is not set
990CONFIG_FILE_LOCKING=y
991CONFIG_FSNOTIFY=y
964CONFIG_DNOTIFY=y 992CONFIG_DNOTIFY=y
965CONFIG_INOTIFY=y 993CONFIG_INOTIFY=y
966CONFIG_INOTIFY_USER=y 994CONFIG_INOTIFY_USER=y
@@ -1110,6 +1138,7 @@ CONFIG_HAS_IOPORT=y
1110CONFIG_HAS_DMA=y 1138CONFIG_HAS_DMA=y
1111CONFIG_HAVE_LMB=y 1139CONFIG_HAVE_LMB=y
1112CONFIG_NLATTR=y 1140CONFIG_NLATTR=y
1141CONFIG_GENERIC_ATOMIC64=y
1113 1142
1114# 1143#
1115# Kernel hacking 1144# Kernel hacking
@@ -1140,6 +1169,9 @@ CONFIG_BOOTPARAM_HUNG_TASK_PANIC_VALUE=0
1140# CONFIG_RT_MUTEX_TESTER is not set 1169# CONFIG_RT_MUTEX_TESTER is not set
1141# CONFIG_DEBUG_SPINLOCK is not set 1170# CONFIG_DEBUG_SPINLOCK is not set
1142# CONFIG_DEBUG_MUTEXES is not set 1171# CONFIG_DEBUG_MUTEXES is not set
1172# CONFIG_DEBUG_LOCK_ALLOC is not set
1173# CONFIG_PROVE_LOCKING is not set
1174# CONFIG_LOCK_STAT is not set
1143# CONFIG_DEBUG_SPINLOCK_SLEEP is not set 1175# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
1144# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set 1176# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
1145# CONFIG_DEBUG_KOBJECT is not set 1177# CONFIG_DEBUG_KOBJECT is not set
@@ -1151,7 +1183,6 @@ CONFIG_DEBUG_INFO=y
1151# CONFIG_DEBUG_LIST is not set 1183# CONFIG_DEBUG_LIST is not set
1152# CONFIG_DEBUG_SG is not set 1184# CONFIG_DEBUG_SG is not set
1153# CONFIG_DEBUG_NOTIFIERS is not set 1185# CONFIG_DEBUG_NOTIFIERS is not set
1154# CONFIG_BOOT_PRINTK_DELAY is not set
1155# CONFIG_RCU_TORTURE_TEST is not set 1186# CONFIG_RCU_TORTURE_TEST is not set
1156# CONFIG_RCU_CPU_STALL_DETECTOR is not set 1187# CONFIG_RCU_CPU_STALL_DETECTOR is not set
1157# CONFIG_BACKTRACE_SELF_TEST is not set 1188# CONFIG_BACKTRACE_SELF_TEST is not set
@@ -1165,22 +1196,23 @@ CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
1165CONFIG_HAVE_DYNAMIC_FTRACE=y 1196CONFIG_HAVE_DYNAMIC_FTRACE=y
1166CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y 1197CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
1167CONFIG_TRACING_SUPPORT=y 1198CONFIG_TRACING_SUPPORT=y
1168 1199CONFIG_FTRACE=y
1169#
1170# Tracers
1171#
1172# CONFIG_FUNCTION_TRACER is not set 1200# CONFIG_FUNCTION_TRACER is not set
1201# CONFIG_IRQSOFF_TRACER is not set
1173# CONFIG_SCHED_TRACER is not set 1202# CONFIG_SCHED_TRACER is not set
1174# CONFIG_CONTEXT_SWITCH_TRACER is not set 1203# CONFIG_ENABLE_DEFAULT_TRACERS is not set
1175# CONFIG_EVENT_TRACER is not set
1176# CONFIG_BOOT_TRACER is not set 1204# CONFIG_BOOT_TRACER is not set
1177# CONFIG_TRACE_BRANCH_PROFILING is not set 1205CONFIG_BRANCH_PROFILE_NONE=y
1206# CONFIG_PROFILE_ANNOTATED_BRANCHES is not set
1207# CONFIG_PROFILE_ALL_BRANCHES is not set
1178# CONFIG_STACK_TRACER is not set 1208# CONFIG_STACK_TRACER is not set
1179# CONFIG_KMEMTRACE is not set 1209# CONFIG_KMEMTRACE is not set
1180# CONFIG_WORKQUEUE_TRACER is not set 1210# CONFIG_WORKQUEUE_TRACER is not set
1181# CONFIG_BLK_DEV_IO_TRACE is not set 1211# CONFIG_BLK_DEV_IO_TRACE is not set
1182# CONFIG_SAMPLES is not set 1212# CONFIG_SAMPLES is not set
1183CONFIG_HAVE_ARCH_KGDB=y 1213CONFIG_HAVE_ARCH_KGDB=y
1214# CONFIG_PPC_DISABLE_WERROR is not set
1215CONFIG_PPC_WERROR=y
1184CONFIG_PRINT_STACK_DEPTH=64 1216CONFIG_PRINT_STACK_DEPTH=64
1185# CONFIG_DEBUG_STACKOVERFLOW is not set 1217# CONFIG_DEBUG_STACKOVERFLOW is not set
1186# CONFIG_DEBUG_STACK_USAGE is not set 1218# CONFIG_DEBUG_STACK_USAGE is not set
diff --git a/arch/powerpc/configs/prpmc2800_defconfig b/arch/powerpc/configs/prpmc2800_defconfig
index e9f287f313fa..1293c465d7fa 100644
--- a/arch/powerpc/configs/prpmc2800_defconfig
+++ b/arch/powerpc/configs/prpmc2800_defconfig
@@ -1,25 +1,27 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.30-rc3 3# Linux kernel version: 2.6.31-rc4
4# Wed May 13 17:22:03 2009 4# Wed Jul 29 23:32:01 2009
5# 5#
6# CONFIG_PPC64 is not set 6# CONFIG_PPC64 is not set
7 7
8# 8#
9# Processor support 9# Processor support
10# 10#
11CONFIG_6xx=y 11CONFIG_PPC_BOOK3S_32=y
12# CONFIG_PPC_85xx is not set 12# CONFIG_PPC_85xx is not set
13# CONFIG_PPC_8xx is not set 13# CONFIG_PPC_8xx is not set
14# CONFIG_40x is not set 14# CONFIG_40x is not set
15# CONFIG_44x is not set 15# CONFIG_44x is not set
16# CONFIG_E200 is not set 16# CONFIG_E200 is not set
17CONFIG_PPC_BOOK3S=y 17CONFIG_PPC_BOOK3S=y
18CONFIG_6xx=y
18CONFIG_PPC_FPU=y 19CONFIG_PPC_FPU=y
19CONFIG_ALTIVEC=y 20CONFIG_ALTIVEC=y
20CONFIG_PPC_STD_MMU=y 21CONFIG_PPC_STD_MMU=y
21CONFIG_PPC_STD_MMU_32=y 22CONFIG_PPC_STD_MMU_32=y
22# CONFIG_PPC_MM_SLICES is not set 23# CONFIG_PPC_MM_SLICES is not set
24CONFIG_PPC_HAVE_PMU_SUPPORT=y
23# CONFIG_SMP is not set 25# CONFIG_SMP is not set
24CONFIG_NOT_COHERENT_CACHE=y 26CONFIG_NOT_COHERENT_CACHE=y
25CONFIG_CHECK_CACHE_COHERENCY=y 27CONFIG_CHECK_CACHE_COHERENCY=y
@@ -32,15 +34,16 @@ CONFIG_GENERIC_TIME=y
32CONFIG_GENERIC_TIME_VSYSCALL=y 34CONFIG_GENERIC_TIME_VSYSCALL=y
33CONFIG_GENERIC_CLOCKEVENTS=y 35CONFIG_GENERIC_CLOCKEVENTS=y
34CONFIG_GENERIC_HARDIRQS=y 36CONFIG_GENERIC_HARDIRQS=y
37CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
35# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set 38# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set
36CONFIG_IRQ_PER_CPU=y 39CONFIG_IRQ_PER_CPU=y
37CONFIG_STACKTRACE_SUPPORT=y 40CONFIG_STACKTRACE_SUPPORT=y
38CONFIG_HAVE_LATENCYTOP_SUPPORT=y 41CONFIG_HAVE_LATENCYTOP_SUPPORT=y
42CONFIG_TRACE_IRQFLAGS_SUPPORT=y
39CONFIG_LOCKDEP_SUPPORT=y 43CONFIG_LOCKDEP_SUPPORT=y
40CONFIG_RWSEM_XCHGADD_ALGORITHM=y 44CONFIG_RWSEM_XCHGADD_ALGORITHM=y
41CONFIG_ARCH_HAS_ILOG2_U32=y 45CONFIG_ARCH_HAS_ILOG2_U32=y
42CONFIG_GENERIC_HWEIGHT=y 46CONFIG_GENERIC_HWEIGHT=y
43CONFIG_GENERIC_CALIBRATE_DELAY=y
44CONFIG_GENERIC_FIND_NEXT_BIT=y 47CONFIG_GENERIC_FIND_NEXT_BIT=y
45# CONFIG_ARCH_NO_VIRT_TO_BUS is not set 48# CONFIG_ARCH_NO_VIRT_TO_BUS is not set
46CONFIG_PPC=y 49CONFIG_PPC=y
@@ -54,11 +57,13 @@ CONFIG_OF=y
54# CONFIG_GENERIC_TBSYNC is not set 57# CONFIG_GENERIC_TBSYNC is not set
55CONFIG_AUDIT_ARCH=y 58CONFIG_AUDIT_ARCH=y
56CONFIG_GENERIC_BUG=y 59CONFIG_GENERIC_BUG=y
60CONFIG_DTC=y
57# CONFIG_DEFAULT_UIMAGE is not set 61# CONFIG_DEFAULT_UIMAGE is not set
58# CONFIG_PPC_DCR_NATIVE is not set 62# CONFIG_PPC_DCR_NATIVE is not set
59# CONFIG_PPC_DCR_MMIO is not set 63# CONFIG_PPC_DCR_MMIO is not set
60CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y 64CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y
61CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" 65CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
66CONFIG_CONSTRUCTORS=y
62 67
63# 68#
64# General setup 69# General setup
@@ -114,7 +119,6 @@ CONFIG_ANON_INODES=y
114CONFIG_SYSCTL_SYSCALL=y 119CONFIG_SYSCTL_SYSCALL=y
115CONFIG_KALLSYMS=y 120CONFIG_KALLSYMS=y
116# CONFIG_KALLSYMS_EXTRA_PASS is not set 121# CONFIG_KALLSYMS_EXTRA_PASS is not set
117# CONFIG_STRIP_ASM_SYMS is not set
118CONFIG_HOTPLUG=y 122CONFIG_HOTPLUG=y
119CONFIG_PRINTK=y 123CONFIG_PRINTK=y
120CONFIG_BUG=y 124CONFIG_BUG=y
@@ -127,9 +131,16 @@ CONFIG_TIMERFD=y
127CONFIG_EVENTFD=y 131CONFIG_EVENTFD=y
128CONFIG_SHMEM=y 132CONFIG_SHMEM=y
129CONFIG_AIO=y 133CONFIG_AIO=y
134CONFIG_HAVE_PERF_COUNTERS=y
135
136#
137# Performance Counters
138#
139# CONFIG_PERF_COUNTERS is not set
130CONFIG_VM_EVENT_COUNTERS=y 140CONFIG_VM_EVENT_COUNTERS=y
131CONFIG_PCI_QUIRKS=y 141CONFIG_PCI_QUIRKS=y
132CONFIG_SLUB_DEBUG=y 142CONFIG_SLUB_DEBUG=y
143# CONFIG_STRIP_ASM_SYMS is not set
133CONFIG_COMPAT_BRK=y 144CONFIG_COMPAT_BRK=y
134# CONFIG_SLAB is not set 145# CONFIG_SLAB is not set
135CONFIG_SLUB=y 146CONFIG_SLUB=y
@@ -142,6 +153,10 @@ CONFIG_HAVE_IOREMAP_PROT=y
142CONFIG_HAVE_KPROBES=y 153CONFIG_HAVE_KPROBES=y
143CONFIG_HAVE_KRETPROBES=y 154CONFIG_HAVE_KRETPROBES=y
144CONFIG_HAVE_ARCH_TRACEHOOK=y 155CONFIG_HAVE_ARCH_TRACEHOOK=y
156
157#
158# GCOV-based kernel profiling
159#
145# CONFIG_SLOW_WORK is not set 160# CONFIG_SLOW_WORK is not set
146# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set 161# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
147CONFIG_SLABINFO=y 162CONFIG_SLABINFO=y
@@ -149,7 +164,7 @@ CONFIG_RT_MUTEXES=y
149CONFIG_BASE_SMALL=0 164CONFIG_BASE_SMALL=0
150# CONFIG_MODULES is not set 165# CONFIG_MODULES is not set
151CONFIG_BLOCK=y 166CONFIG_BLOCK=y
152CONFIG_LBD=y 167CONFIG_LBDAF=y
153# CONFIG_BLK_DEV_BSG is not set 168# CONFIG_BLK_DEV_BSG is not set
154# CONFIG_BLK_DEV_INTEGRITY is not set 169# CONFIG_BLK_DEV_INTEGRITY is not set
155 170
@@ -228,6 +243,7 @@ CONFIG_BINFMT_ELF=y
228# CONFIG_HAVE_AOUT is not set 243# CONFIG_HAVE_AOUT is not set
229CONFIG_BINFMT_MISC=y 244CONFIG_BINFMT_MISC=y
230# CONFIG_IOMMU_HELPER is not set 245# CONFIG_IOMMU_HELPER is not set
246# CONFIG_SWIOTLB is not set
231CONFIG_PPC_NEED_DMA_SYNC_OPS=y 247CONFIG_PPC_NEED_DMA_SYNC_OPS=y
232CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y 248CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
233CONFIG_ARCH_HAS_WALK_MEMORY=y 249CONFIG_ARCH_HAS_WALK_MEMORY=y
@@ -249,9 +265,9 @@ CONFIG_MIGRATION=y
249CONFIG_ZONE_DMA_FLAG=1 265CONFIG_ZONE_DMA_FLAG=1
250CONFIG_BOUNCE=y 266CONFIG_BOUNCE=y
251CONFIG_VIRT_TO_BUS=y 267CONFIG_VIRT_TO_BUS=y
252CONFIG_UNEVICTABLE_LRU=y
253CONFIG_HAVE_MLOCK=y 268CONFIG_HAVE_MLOCK=y
254CONFIG_HAVE_MLOCKED_PAGE_BIT=y 269CONFIG_HAVE_MLOCKED_PAGE_BIT=y
270CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
255CONFIG_PPC_4K_PAGES=y 271CONFIG_PPC_4K_PAGES=y
256# CONFIG_PPC_16K_PAGES is not set 272# CONFIG_PPC_16K_PAGES is not set
257# CONFIG_PPC_64K_PAGES is not set 273# CONFIG_PPC_64K_PAGES is not set
@@ -296,6 +312,7 @@ CONFIG_PAGE_OFFSET=0xc0000000
296CONFIG_KERNEL_START=0xc0000000 312CONFIG_KERNEL_START=0xc0000000
297CONFIG_PHYSICAL_START=0x00000000 313CONFIG_PHYSICAL_START=0x00000000
298CONFIG_TASK_SIZE=0xc0000000 314CONFIG_TASK_SIZE=0xc0000000
315CONFIG_CONSISTENT_SIZE=0x00200000
299CONFIG_NET=y 316CONFIG_NET=y
300 317
301# 318#
@@ -357,6 +374,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
357# CONFIG_ECONET is not set 374# CONFIG_ECONET is not set
358# CONFIG_WAN_ROUTER is not set 375# CONFIG_WAN_ROUTER is not set
359# CONFIG_PHONET is not set 376# CONFIG_PHONET is not set
377# CONFIG_IEEE802154 is not set
360# CONFIG_NET_SCHED is not set 378# CONFIG_NET_SCHED is not set
361# CONFIG_DCB is not set 379# CONFIG_DCB is not set
362 380
@@ -374,7 +392,11 @@ CONFIG_WIRELESS=y
374CONFIG_WIRELESS_OLD_REGULATORY=y 392CONFIG_WIRELESS_OLD_REGULATORY=y
375# CONFIG_WIRELESS_EXT is not set 393# CONFIG_WIRELESS_EXT is not set
376# CONFIG_LIB80211 is not set 394# CONFIG_LIB80211 is not set
377# CONFIG_MAC80211 is not set 395
396#
397# CFG80211 needs to be enabled for MAC80211
398#
399CONFIG_MAC80211_DEFAULT_PS_VALUE=0
378# CONFIG_WIMAX is not set 400# CONFIG_WIMAX is not set
379# CONFIG_RFKILL is not set 401# CONFIG_RFKILL is not set
380# CONFIG_NET_9P is not set 402# CONFIG_NET_9P is not set
@@ -479,6 +501,7 @@ CONFIG_MTD_PHYSMAP_OF=y
479# CONFIG_MTD_UBI is not set 501# CONFIG_MTD_UBI is not set
480CONFIG_OF_DEVICE=y 502CONFIG_OF_DEVICE=y
481CONFIG_OF_I2C=y 503CONFIG_OF_I2C=y
504CONFIG_OF_MDIO=y
482# CONFIG_PARPORT is not set 505# CONFIG_PARPORT is not set
483CONFIG_BLK_DEV=y 506CONFIG_BLK_DEV=y
484# CONFIG_BLK_DEV_FD is not set 507# CONFIG_BLK_DEV_FD is not set
@@ -514,7 +537,9 @@ CONFIG_MISC_DEVICES=y
514# 537#
515# CONFIG_EEPROM_AT24 is not set 538# CONFIG_EEPROM_AT24 is not set
516# CONFIG_EEPROM_LEGACY is not set 539# CONFIG_EEPROM_LEGACY is not set
540# CONFIG_EEPROM_MAX6875 is not set
517# CONFIG_EEPROM_93CX6 is not set 541# CONFIG_EEPROM_93CX6 is not set
542# CONFIG_CB710_CORE is not set
518CONFIG_HAVE_IDE=y 543CONFIG_HAVE_IDE=y
519CONFIG_IDE=y 544CONFIG_IDE=y
520 545
@@ -591,10 +616,6 @@ CONFIG_BLK_DEV_SD=y
591# CONFIG_BLK_DEV_SR is not set 616# CONFIG_BLK_DEV_SR is not set
592# CONFIG_CHR_DEV_SG is not set 617# CONFIG_CHR_DEV_SG is not set
593# CONFIG_CHR_DEV_SCH is not set 618# CONFIG_CHR_DEV_SCH is not set
594
595#
596# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
597#
598# CONFIG_SCSI_MULTI_LUN is not set 619# CONFIG_SCSI_MULTI_LUN is not set
599# CONFIG_SCSI_CONSTANTS is not set 620# CONFIG_SCSI_CONSTANTS is not set
600# CONFIG_SCSI_LOGGING is not set 621# CONFIG_SCSI_LOGGING is not set
@@ -611,6 +632,7 @@ CONFIG_BLK_DEV_SD=y
611CONFIG_SCSI_LOWLEVEL=y 632CONFIG_SCSI_LOWLEVEL=y
612# CONFIG_ISCSI_TCP is not set 633# CONFIG_ISCSI_TCP is not set
613# CONFIG_SCSI_CXGB3_ISCSI is not set 634# CONFIG_SCSI_CXGB3_ISCSI is not set
635# CONFIG_SCSI_BNX2_ISCSI is not set
614# CONFIG_BLK_DEV_3W_XXXX_RAID is not set 636# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
615# CONFIG_SCSI_3W_9XXX is not set 637# CONFIG_SCSI_3W_9XXX is not set
616# CONFIG_SCSI_ACARD is not set 638# CONFIG_SCSI_ACARD is not set
@@ -619,6 +641,7 @@ CONFIG_SCSI_LOWLEVEL=y
619# CONFIG_SCSI_AIC7XXX_OLD is not set 641# CONFIG_SCSI_AIC7XXX_OLD is not set
620# CONFIG_SCSI_AIC79XX is not set 642# CONFIG_SCSI_AIC79XX is not set
621# CONFIG_SCSI_AIC94XX is not set 643# CONFIG_SCSI_AIC94XX is not set
644# CONFIG_SCSI_MVSAS is not set
622# CONFIG_SCSI_DPT_I2O is not set 645# CONFIG_SCSI_DPT_I2O is not set
623# CONFIG_SCSI_ADVANSYS is not set 646# CONFIG_SCSI_ADVANSYS is not set
624# CONFIG_SCSI_ARCMSR is not set 647# CONFIG_SCSI_ARCMSR is not set
@@ -638,7 +661,6 @@ CONFIG_SCSI_LOWLEVEL=y
638# CONFIG_SCSI_IPS is not set 661# CONFIG_SCSI_IPS is not set
639# CONFIG_SCSI_INITIO is not set 662# CONFIG_SCSI_INITIO is not set
640# CONFIG_SCSI_INIA100 is not set 663# CONFIG_SCSI_INIA100 is not set
641# CONFIG_SCSI_MVSAS is not set
642# CONFIG_SCSI_STEX is not set 664# CONFIG_SCSI_STEX is not set
643# CONFIG_SCSI_SYM53C8XX_2 is not set 665# CONFIG_SCSI_SYM53C8XX_2 is not set
644# CONFIG_SCSI_IPR is not set 666# CONFIG_SCSI_IPR is not set
@@ -721,7 +743,11 @@ CONFIG_SATA_MV=y
721# 743#
722 744
723# 745#
724# Enable only one of the two stacks, unless you know what you are doing 746# You can enable one or both FireWire driver stacks.
747#
748
749#
750# See the help texts for more information.
725# 751#
726# CONFIG_FIREWIRE is not set 752# CONFIG_FIREWIRE is not set
727# CONFIG_IEEE1394 is not set 753# CONFIG_IEEE1394 is not set
@@ -730,7 +756,6 @@ CONFIG_MACINTOSH_DRIVERS=y
730# CONFIG_MAC_EMUMOUSEBTN is not set 756# CONFIG_MAC_EMUMOUSEBTN is not set
731# CONFIG_WINDFARM is not set 757# CONFIG_WINDFARM is not set
732CONFIG_NETDEVICES=y 758CONFIG_NETDEVICES=y
733CONFIG_COMPAT_NET_DEV_OPS=y
734# CONFIG_DUMMY is not set 759# CONFIG_DUMMY is not set
735# CONFIG_BONDING is not set 760# CONFIG_BONDING is not set
736# CONFIG_MACVLAN is not set 761# CONFIG_MACVLAN is not set
@@ -797,6 +822,7 @@ CONFIG_8139TOO=y
797# CONFIG_SMSC9420 is not set 822# CONFIG_SMSC9420 is not set
798# CONFIG_SUNDANCE is not set 823# CONFIG_SUNDANCE is not set
799# CONFIG_TLAN is not set 824# CONFIG_TLAN is not set
825# CONFIG_KS8842 is not set
800# CONFIG_VIA_RHINE is not set 826# CONFIG_VIA_RHINE is not set
801# CONFIG_SC92031 is not set 827# CONFIG_SC92031 is not set
802# CONFIG_ATL2 is not set 828# CONFIG_ATL2 is not set
@@ -818,6 +844,7 @@ CONFIG_E1000=y
818# CONFIG_VIA_VELOCITY is not set 844# CONFIG_VIA_VELOCITY is not set
819# CONFIG_TIGON3 is not set 845# CONFIG_TIGON3 is not set
820# CONFIG_BNX2 is not set 846# CONFIG_BNX2 is not set
847# CONFIG_CNIC is not set
821CONFIG_MV643XX_ETH=y 848CONFIG_MV643XX_ETH=y
822# CONFIG_QLA3XXX is not set 849# CONFIG_QLA3XXX is not set
823# CONFIG_ATL1 is not set 850# CONFIG_ATL1 is not set
@@ -1007,13 +1034,17 @@ CONFIG_I2C_MV64XXX=y
1007# CONFIG_SENSORS_PCF8574 is not set 1034# CONFIG_SENSORS_PCF8574 is not set
1008# CONFIG_PCF8575 is not set 1035# CONFIG_PCF8575 is not set
1009# CONFIG_SENSORS_PCA9539 is not set 1036# CONFIG_SENSORS_PCA9539 is not set
1010# CONFIG_SENSORS_MAX6875 is not set
1011# CONFIG_SENSORS_TSL2550 is not set 1037# CONFIG_SENSORS_TSL2550 is not set
1012# CONFIG_I2C_DEBUG_CORE is not set 1038# CONFIG_I2C_DEBUG_CORE is not set
1013# CONFIG_I2C_DEBUG_ALGO is not set 1039# CONFIG_I2C_DEBUG_ALGO is not set
1014# CONFIG_I2C_DEBUG_BUS is not set 1040# CONFIG_I2C_DEBUG_BUS is not set
1015# CONFIG_I2C_DEBUG_CHIP is not set 1041# CONFIG_I2C_DEBUG_CHIP is not set
1016# CONFIG_SPI is not set 1042# CONFIG_SPI is not set
1043
1044#
1045# PPS support
1046#
1047# CONFIG_PPS is not set
1017CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y 1048CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
1018# CONFIG_GPIOLIB is not set 1049# CONFIG_GPIOLIB is not set
1019# CONFIG_W1 is not set 1050# CONFIG_W1 is not set
@@ -1068,6 +1099,7 @@ CONFIG_HWMON=y
1068# CONFIG_SENSORS_SMSC47B397 is not set 1099# CONFIG_SENSORS_SMSC47B397 is not set
1069# CONFIG_SENSORS_ADS7828 is not set 1100# CONFIG_SENSORS_ADS7828 is not set
1070# CONFIG_SENSORS_THMC50 is not set 1101# CONFIG_SENSORS_THMC50 is not set
1102# CONFIG_SENSORS_TMP401 is not set
1071# CONFIG_SENSORS_VIA686A is not set 1103# CONFIG_SENSORS_VIA686A is not set
1072# CONFIG_SENSORS_VT1211 is not set 1104# CONFIG_SENSORS_VT1211 is not set
1073# CONFIG_SENSORS_VT8231 is not set 1105# CONFIG_SENSORS_VT8231 is not set
@@ -1102,23 +1134,9 @@ CONFIG_SSB_POSSIBLE=y
1102# CONFIG_MFD_WM8400 is not set 1134# CONFIG_MFD_WM8400 is not set
1103# CONFIG_MFD_WM8350_I2C is not set 1135# CONFIG_MFD_WM8350_I2C is not set
1104# CONFIG_MFD_PCF50633 is not set 1136# CONFIG_MFD_PCF50633 is not set
1137# CONFIG_AB3100_CORE is not set
1105# CONFIG_REGULATOR is not set 1138# CONFIG_REGULATOR is not set
1106 1139# CONFIG_MEDIA_SUPPORT is not set
1107#
1108# Multimedia devices
1109#
1110
1111#
1112# Multimedia core support
1113#
1114# CONFIG_VIDEO_DEV is not set
1115# CONFIG_DVB_CORE is not set
1116# CONFIG_VIDEO_MEDIA is not set
1117
1118#
1119# Multimedia drivers
1120#
1121# CONFIG_DAB is not set
1122 1140
1123# 1141#
1124# Graphics support 1142# Graphics support
@@ -1163,6 +1181,7 @@ CONFIG_HID_BELKIN=y
1163CONFIG_HID_CHERRY=y 1181CONFIG_HID_CHERRY=y
1164CONFIG_HID_CHICONY=y 1182CONFIG_HID_CHICONY=y
1165CONFIG_HID_CYPRESS=y 1183CONFIG_HID_CYPRESS=y
1184CONFIG_HID_DRAGONRISE=y
1166# CONFIG_DRAGONRISE_FF is not set 1185# CONFIG_DRAGONRISE_FF is not set
1167CONFIG_HID_EZKEY=y 1186CONFIG_HID_EZKEY=y
1168CONFIG_HID_KYE=y 1187CONFIG_HID_KYE=y
@@ -1180,9 +1199,14 @@ CONFIG_HID_PETALYNX=y
1180CONFIG_HID_SAMSUNG=y 1199CONFIG_HID_SAMSUNG=y
1181CONFIG_HID_SONY=y 1200CONFIG_HID_SONY=y
1182CONFIG_HID_SUNPLUS=y 1201CONFIG_HID_SUNPLUS=y
1202CONFIG_HID_GREENASIA=y
1183# CONFIG_GREENASIA_FF is not set 1203# CONFIG_GREENASIA_FF is not set
1204CONFIG_HID_SMARTJOYPLUS=y
1205# CONFIG_SMARTJOYPLUS_FF is not set
1184CONFIG_HID_TOPSEED=y 1206CONFIG_HID_TOPSEED=y
1207CONFIG_HID_THRUSTMASTER=y
1185CONFIG_THRUSTMASTER_FF=y 1208CONFIG_THRUSTMASTER_FF=y
1209CONFIG_HID_ZEROPLUS=y
1186CONFIG_ZEROPLUS_FF=y 1210CONFIG_ZEROPLUS_FF=y
1187CONFIG_USB_SUPPORT=y 1211CONFIG_USB_SUPPORT=y
1188CONFIG_USB_ARCH_HAS_HCD=y 1212CONFIG_USB_ARCH_HAS_HCD=y
@@ -1207,6 +1231,7 @@ CONFIG_USB_MON=y
1207# USB Host Controller Drivers 1231# USB Host Controller Drivers
1208# 1232#
1209# CONFIG_USB_C67X00_HCD is not set 1233# CONFIG_USB_C67X00_HCD is not set
1234# CONFIG_USB_XHCI_HCD is not set
1210CONFIG_USB_EHCI_HCD=y 1235CONFIG_USB_EHCI_HCD=y
1211# CONFIG_USB_EHCI_ROOT_HUB_TT is not set 1236# CONFIG_USB_EHCI_ROOT_HUB_TT is not set
1212# CONFIG_USB_EHCI_TT_NEWSCHED is not set 1237# CONFIG_USB_EHCI_TT_NEWSCHED is not set
@@ -1215,6 +1240,8 @@ CONFIG_USB_EHCI_HCD_PPC_OF=y
1215# CONFIG_USB_ISP116X_HCD is not set 1240# CONFIG_USB_ISP116X_HCD is not set
1216# CONFIG_USB_ISP1760_HCD is not set 1241# CONFIG_USB_ISP1760_HCD is not set
1217CONFIG_USB_OHCI_HCD=y 1242CONFIG_USB_OHCI_HCD=y
1243# CONFIG_USB_OHCI_HCD_PPC_OF_BE is not set
1244# CONFIG_USB_OHCI_HCD_PPC_OF_LE is not set
1218# CONFIG_USB_OHCI_HCD_PPC_OF is not set 1245# CONFIG_USB_OHCI_HCD_PPC_OF is not set
1219# CONFIG_USB_OHCI_BIG_ENDIAN_DESC is not set 1246# CONFIG_USB_OHCI_BIG_ENDIAN_DESC is not set
1220# CONFIG_USB_OHCI_BIG_ENDIAN_MMIO is not set 1247# CONFIG_USB_OHCI_BIG_ENDIAN_MMIO is not set
@@ -1322,6 +1349,7 @@ CONFIG_RTC_DRV_MAX6900=y
1322# CONFIG_RTC_DRV_S35390A is not set 1349# CONFIG_RTC_DRV_S35390A is not set
1323# CONFIG_RTC_DRV_FM3130 is not set 1350# CONFIG_RTC_DRV_FM3130 is not set
1324# CONFIG_RTC_DRV_RX8581 is not set 1351# CONFIG_RTC_DRV_RX8581 is not set
1352# CONFIG_RTC_DRV_RX8025 is not set
1325 1353
1326# 1354#
1327# SPI RTC drivers 1355# SPI RTC drivers
@@ -1349,6 +1377,10 @@ CONFIG_RTC_DRV_MAX6900=y
1349# CONFIG_DMADEVICES is not set 1377# CONFIG_DMADEVICES is not set
1350# CONFIG_AUXDISPLAY is not set 1378# CONFIG_AUXDISPLAY is not set
1351# CONFIG_UIO is not set 1379# CONFIG_UIO is not set
1380
1381#
1382# TI VLYNQ
1383#
1352# CONFIG_STAGING is not set 1384# CONFIG_STAGING is not set
1353 1385
1354# 1386#
@@ -1368,11 +1400,12 @@ CONFIG_FS_MBCACHE=y
1368# CONFIG_REISERFS_FS is not set 1400# CONFIG_REISERFS_FS is not set
1369# CONFIG_JFS_FS is not set 1401# CONFIG_JFS_FS is not set
1370# CONFIG_FS_POSIX_ACL is not set 1402# CONFIG_FS_POSIX_ACL is not set
1371CONFIG_FILE_LOCKING=y
1372# CONFIG_XFS_FS is not set 1403# CONFIG_XFS_FS is not set
1373# CONFIG_GFS2_FS is not set 1404# CONFIG_GFS2_FS is not set
1374# CONFIG_OCFS2_FS is not set 1405# CONFIG_OCFS2_FS is not set
1375# CONFIG_BTRFS_FS is not set 1406# CONFIG_BTRFS_FS is not set
1407CONFIG_FILE_LOCKING=y
1408CONFIG_FSNOTIFY=y
1376CONFIG_DNOTIFY=y 1409CONFIG_DNOTIFY=y
1377CONFIG_INOTIFY=y 1410CONFIG_INOTIFY=y
1378CONFIG_INOTIFY_USER=y 1411CONFIG_INOTIFY_USER=y
@@ -1469,7 +1502,46 @@ CONFIG_MSDOS_PARTITION=y
1469# CONFIG_KARMA_PARTITION is not set 1502# CONFIG_KARMA_PARTITION is not set
1470# CONFIG_EFI_PARTITION is not set 1503# CONFIG_EFI_PARTITION is not set
1471# CONFIG_SYSV68_PARTITION is not set 1504# CONFIG_SYSV68_PARTITION is not set
1472# CONFIG_NLS is not set 1505CONFIG_NLS=y
1506CONFIG_NLS_DEFAULT="iso8859-1"
1507# CONFIG_NLS_CODEPAGE_437 is not set
1508# CONFIG_NLS_CODEPAGE_737 is not set
1509# CONFIG_NLS_CODEPAGE_775 is not set
1510# CONFIG_NLS_CODEPAGE_850 is not set
1511# CONFIG_NLS_CODEPAGE_852 is not set
1512# CONFIG_NLS_CODEPAGE_855 is not set
1513# CONFIG_NLS_CODEPAGE_857 is not set
1514# CONFIG_NLS_CODEPAGE_860 is not set
1515# CONFIG_NLS_CODEPAGE_861 is not set
1516# CONFIG_NLS_CODEPAGE_862 is not set
1517# CONFIG_NLS_CODEPAGE_863 is not set
1518# CONFIG_NLS_CODEPAGE_864 is not set
1519# CONFIG_NLS_CODEPAGE_865 is not set
1520# CONFIG_NLS_CODEPAGE_866 is not set
1521# CONFIG_NLS_CODEPAGE_869 is not set
1522# CONFIG_NLS_CODEPAGE_936 is not set
1523# CONFIG_NLS_CODEPAGE_950 is not set
1524# CONFIG_NLS_CODEPAGE_932 is not set
1525# CONFIG_NLS_CODEPAGE_949 is not set
1526# CONFIG_NLS_CODEPAGE_874 is not set
1527# CONFIG_NLS_ISO8859_8 is not set
1528# CONFIG_NLS_CODEPAGE_1250 is not set
1529# CONFIG_NLS_CODEPAGE_1251 is not set
1530# CONFIG_NLS_ASCII is not set
1531# CONFIG_NLS_ISO8859_1 is not set
1532# CONFIG_NLS_ISO8859_2 is not set
1533# CONFIG_NLS_ISO8859_3 is not set
1534# CONFIG_NLS_ISO8859_4 is not set
1535# CONFIG_NLS_ISO8859_5 is not set
1536# CONFIG_NLS_ISO8859_6 is not set
1537# CONFIG_NLS_ISO8859_7 is not set
1538# CONFIG_NLS_ISO8859_9 is not set
1539# CONFIG_NLS_ISO8859_13 is not set
1540# CONFIG_NLS_ISO8859_14 is not set
1541# CONFIG_NLS_ISO8859_15 is not set
1542# CONFIG_NLS_KOI8_R is not set
1543# CONFIG_NLS_KOI8_U is not set
1544# CONFIG_NLS_UTF8 is not set
1473# CONFIG_DLM is not set 1545# CONFIG_DLM is not set
1474# CONFIG_BINARY_PRINTF is not set 1546# CONFIG_BINARY_PRINTF is not set
1475 1547
@@ -1494,6 +1566,7 @@ CONFIG_HAS_IOPORT=y
1494CONFIG_HAS_DMA=y 1566CONFIG_HAS_DMA=y
1495CONFIG_HAVE_LMB=y 1567CONFIG_HAVE_LMB=y
1496CONFIG_NLATTR=y 1568CONFIG_NLATTR=y
1569CONFIG_GENERIC_ATOMIC64=y
1497 1570
1498# 1571#
1499# Kernel hacking 1572# Kernel hacking
@@ -1519,22 +1592,11 @@ CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
1519CONFIG_HAVE_DYNAMIC_FTRACE=y 1592CONFIG_HAVE_DYNAMIC_FTRACE=y
1520CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y 1593CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
1521CONFIG_TRACING_SUPPORT=y 1594CONFIG_TRACING_SUPPORT=y
1522 1595# CONFIG_FTRACE is not set
1523#
1524# Tracers
1525#
1526# CONFIG_FUNCTION_TRACER is not set
1527# CONFIG_SCHED_TRACER is not set
1528# CONFIG_CONTEXT_SWITCH_TRACER is not set
1529# CONFIG_EVENT_TRACER is not set
1530# CONFIG_BOOT_TRACER is not set
1531# CONFIG_TRACE_BRANCH_PROFILING is not set
1532# CONFIG_STACK_TRACER is not set
1533# CONFIG_KMEMTRACE is not set
1534# CONFIG_WORKQUEUE_TRACER is not set
1535# CONFIG_BLK_DEV_IO_TRACE is not set
1536# CONFIG_SAMPLES is not set 1596# CONFIG_SAMPLES is not set
1537CONFIG_HAVE_ARCH_KGDB=y 1597CONFIG_HAVE_ARCH_KGDB=y
1598# CONFIG_PPC_DISABLE_WERROR is not set
1599CONFIG_PPC_WERROR=y
1538CONFIG_PRINT_STACK_DEPTH=64 1600CONFIG_PRINT_STACK_DEPTH=64
1539# CONFIG_IRQSTACKS is not set 1601# CONFIG_IRQSTACKS is not set
1540# CONFIG_BOOTX_TEXT is not set 1602# CONFIG_BOOTX_TEXT is not set
diff --git a/arch/powerpc/configs/storcenter_defconfig b/arch/powerpc/configs/storcenter_defconfig
index bd4a8d435c50..28384dc01003 100644
--- a/arch/powerpc/configs/storcenter_defconfig
+++ b/arch/powerpc/configs/storcenter_defconfig
@@ -1,25 +1,27 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.30-rc3 3# Linux kernel version: 2.6.31-rc4
4# Wed May 13 17:22:04 2009 4# Wed Jul 29 23:32:01 2009
5# 5#
6# CONFIG_PPC64 is not set 6# CONFIG_PPC64 is not set
7 7
8# 8#
9# Processor support 9# Processor support
10# 10#
11CONFIG_6xx=y 11CONFIG_PPC_BOOK3S_32=y
12# CONFIG_PPC_85xx is not set 12# CONFIG_PPC_85xx is not set
13# CONFIG_PPC_8xx is not set 13# CONFIG_PPC_8xx is not set
14# CONFIG_40x is not set 14# CONFIG_40x is not set
15# CONFIG_44x is not set 15# CONFIG_44x is not set
16# CONFIG_E200 is not set 16# CONFIG_E200 is not set
17CONFIG_PPC_BOOK3S=y 17CONFIG_PPC_BOOK3S=y
18CONFIG_6xx=y
18CONFIG_PPC_FPU=y 19CONFIG_PPC_FPU=y
19# CONFIG_ALTIVEC is not set 20# CONFIG_ALTIVEC is not set
20CONFIG_PPC_STD_MMU=y 21CONFIG_PPC_STD_MMU=y
21CONFIG_PPC_STD_MMU_32=y 22CONFIG_PPC_STD_MMU_32=y
22# CONFIG_PPC_MM_SLICES is not set 23# CONFIG_PPC_MM_SLICES is not set
24CONFIG_PPC_HAVE_PMU_SUPPORT=y
23# CONFIG_SMP is not set 25# CONFIG_SMP is not set
24CONFIG_PPC32=y 26CONFIG_PPC32=y
25CONFIG_WORD_SIZE=32 27CONFIG_WORD_SIZE=32
@@ -30,15 +32,16 @@ CONFIG_GENERIC_TIME=y
30CONFIG_GENERIC_TIME_VSYSCALL=y 32CONFIG_GENERIC_TIME_VSYSCALL=y
31CONFIG_GENERIC_CLOCKEVENTS=y 33CONFIG_GENERIC_CLOCKEVENTS=y
32CONFIG_GENERIC_HARDIRQS=y 34CONFIG_GENERIC_HARDIRQS=y
35CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
33# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set 36# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set
34CONFIG_IRQ_PER_CPU=y 37CONFIG_IRQ_PER_CPU=y
35CONFIG_STACKTRACE_SUPPORT=y 38CONFIG_STACKTRACE_SUPPORT=y
36CONFIG_HAVE_LATENCYTOP_SUPPORT=y 39CONFIG_HAVE_LATENCYTOP_SUPPORT=y
40CONFIG_TRACE_IRQFLAGS_SUPPORT=y
37CONFIG_LOCKDEP_SUPPORT=y 41CONFIG_LOCKDEP_SUPPORT=y
38CONFIG_RWSEM_XCHGADD_ALGORITHM=y 42CONFIG_RWSEM_XCHGADD_ALGORITHM=y
39CONFIG_ARCH_HAS_ILOG2_U32=y 43CONFIG_ARCH_HAS_ILOG2_U32=y
40CONFIG_GENERIC_HWEIGHT=y 44CONFIG_GENERIC_HWEIGHT=y
41CONFIG_GENERIC_CALIBRATE_DELAY=y
42CONFIG_GENERIC_FIND_NEXT_BIT=y 45CONFIG_GENERIC_FIND_NEXT_BIT=y
43# CONFIG_ARCH_NO_VIRT_TO_BUS is not set 46# CONFIG_ARCH_NO_VIRT_TO_BUS is not set
44CONFIG_PPC=y 47CONFIG_PPC=y
@@ -52,11 +55,13 @@ CONFIG_PPC_UDBG_16550=y
52# CONFIG_GENERIC_TBSYNC is not set 55# CONFIG_GENERIC_TBSYNC is not set
53CONFIG_AUDIT_ARCH=y 56CONFIG_AUDIT_ARCH=y
54CONFIG_GENERIC_BUG=y 57CONFIG_GENERIC_BUG=y
58CONFIG_DTC=y
55# CONFIG_DEFAULT_UIMAGE is not set 59# CONFIG_DEFAULT_UIMAGE is not set
56# CONFIG_PPC_DCR_NATIVE is not set 60# CONFIG_PPC_DCR_NATIVE is not set
57# CONFIG_PPC_DCR_MMIO is not set 61# CONFIG_PPC_DCR_MMIO is not set
58CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y 62CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y
59CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" 63CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
64CONFIG_CONSTRUCTORS=y
60 65
61# 66#
62# General setup 67# General setup
@@ -101,7 +106,6 @@ CONFIG_ANON_INODES=y
101CONFIG_EMBEDDED=y 106CONFIG_EMBEDDED=y
102CONFIG_SYSCTL_SYSCALL=y 107CONFIG_SYSCTL_SYSCALL=y
103# CONFIG_KALLSYMS is not set 108# CONFIG_KALLSYMS is not set
104# CONFIG_STRIP_ASM_SYMS is not set
105CONFIG_HOTPLUG=y 109CONFIG_HOTPLUG=y
106CONFIG_PRINTK=y 110CONFIG_PRINTK=y
107CONFIG_BUG=y 111CONFIG_BUG=y
@@ -114,9 +118,16 @@ CONFIG_TIMERFD=y
114CONFIG_EVENTFD=y 118CONFIG_EVENTFD=y
115CONFIG_SHMEM=y 119CONFIG_SHMEM=y
116CONFIG_AIO=y 120CONFIG_AIO=y
121CONFIG_HAVE_PERF_COUNTERS=y
122
123#
124# Performance Counters
125#
126# CONFIG_PERF_COUNTERS is not set
117CONFIG_VM_EVENT_COUNTERS=y 127CONFIG_VM_EVENT_COUNTERS=y
118CONFIG_PCI_QUIRKS=y 128CONFIG_PCI_QUIRKS=y
119CONFIG_SLUB_DEBUG=y 129CONFIG_SLUB_DEBUG=y
130# CONFIG_STRIP_ASM_SYMS is not set
120CONFIG_COMPAT_BRK=y 131CONFIG_COMPAT_BRK=y
121# CONFIG_SLAB is not set 132# CONFIG_SLAB is not set
122CONFIG_SLUB=y 133CONFIG_SLUB=y
@@ -129,6 +140,10 @@ CONFIG_HAVE_IOREMAP_PROT=y
129CONFIG_HAVE_KPROBES=y 140CONFIG_HAVE_KPROBES=y
130CONFIG_HAVE_KRETPROBES=y 141CONFIG_HAVE_KRETPROBES=y
131CONFIG_HAVE_ARCH_TRACEHOOK=y 142CONFIG_HAVE_ARCH_TRACEHOOK=y
143
144#
145# GCOV-based kernel profiling
146#
132# CONFIG_SLOW_WORK is not set 147# CONFIG_SLOW_WORK is not set
133# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set 148# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
134CONFIG_SLABINFO=y 149CONFIG_SLABINFO=y
@@ -141,7 +156,7 @@ CONFIG_MODULE_UNLOAD=y
141# CONFIG_MODVERSIONS is not set 156# CONFIG_MODVERSIONS is not set
142# CONFIG_MODULE_SRCVERSION_ALL is not set 157# CONFIG_MODULE_SRCVERSION_ALL is not set
143CONFIG_BLOCK=y 158CONFIG_BLOCK=y
144CONFIG_LBD=y 159CONFIG_LBDAF=y
145# CONFIG_BLK_DEV_BSG is not set 160# CONFIG_BLK_DEV_BSG is not set
146# CONFIG_BLK_DEV_INTEGRITY is not set 161# CONFIG_BLK_DEV_INTEGRITY is not set
147 162
@@ -222,6 +237,7 @@ CONFIG_BINFMT_ELF=y
222# CONFIG_HAVE_AOUT is not set 237# CONFIG_HAVE_AOUT is not set
223CONFIG_BINFMT_MISC=y 238CONFIG_BINFMT_MISC=y
224# CONFIG_IOMMU_HELPER is not set 239# CONFIG_IOMMU_HELPER is not set
240# CONFIG_SWIOTLB is not set
225CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y 241CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
226CONFIG_ARCH_HAS_WALK_MEMORY=y 242CONFIG_ARCH_HAS_WALK_MEMORY=y
227CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y 243CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y
@@ -242,9 +258,9 @@ CONFIG_MIGRATION=y
242CONFIG_ZONE_DMA_FLAG=1 258CONFIG_ZONE_DMA_FLAG=1
243CONFIG_BOUNCE=y 259CONFIG_BOUNCE=y
244CONFIG_VIRT_TO_BUS=y 260CONFIG_VIRT_TO_BUS=y
245CONFIG_UNEVICTABLE_LRU=y
246CONFIG_HAVE_MLOCK=y 261CONFIG_HAVE_MLOCK=y
247CONFIG_HAVE_MLOCKED_PAGE_BIT=y 262CONFIG_HAVE_MLOCKED_PAGE_BIT=y
263CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
248CONFIG_PPC_4K_PAGES=y 264CONFIG_PPC_4K_PAGES=y
249# CONFIG_PPC_16K_PAGES is not set 265# CONFIG_PPC_16K_PAGES is not set
250# CONFIG_PPC_64K_PAGES is not set 266# CONFIG_PPC_64K_PAGES is not set
@@ -347,6 +363,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
347# CONFIG_ECONET is not set 363# CONFIG_ECONET is not set
348# CONFIG_WAN_ROUTER is not set 364# CONFIG_WAN_ROUTER is not set
349# CONFIG_PHONET is not set 365# CONFIG_PHONET is not set
366# CONFIG_IEEE802154 is not set
350# CONFIG_NET_SCHED is not set 367# CONFIG_NET_SCHED is not set
351# CONFIG_DCB is not set 368# CONFIG_DCB is not set
352 369
@@ -364,7 +381,11 @@ CONFIG_WIRELESS=y
364CONFIG_WIRELESS_OLD_REGULATORY=y 381CONFIG_WIRELESS_OLD_REGULATORY=y
365# CONFIG_WIRELESS_EXT is not set 382# CONFIG_WIRELESS_EXT is not set
366# CONFIG_LIB80211 is not set 383# CONFIG_LIB80211 is not set
367# CONFIG_MAC80211 is not set 384
385#
386# CFG80211 needs to be enabled for MAC80211
387#
388CONFIG_MAC80211_DEFAULT_PS_VALUE=0
368# CONFIG_WIMAX is not set 389# CONFIG_WIMAX is not set
369# CONFIG_RFKILL is not set 390# CONFIG_RFKILL is not set
370# CONFIG_NET_9P is not set 391# CONFIG_NET_9P is not set
@@ -501,7 +522,9 @@ CONFIG_MISC_DEVICES=y
501# 522#
502# CONFIG_EEPROM_AT24 is not set 523# CONFIG_EEPROM_AT24 is not set
503# CONFIG_EEPROM_LEGACY is not set 524# CONFIG_EEPROM_LEGACY is not set
525# CONFIG_EEPROM_MAX6875 is not set
504# CONFIG_EEPROM_93CX6 is not set 526# CONFIG_EEPROM_93CX6 is not set
527# CONFIG_CB710_CORE is not set
505CONFIG_HAVE_IDE=y 528CONFIG_HAVE_IDE=y
506CONFIG_IDE=y 529CONFIG_IDE=y
507 530
@@ -579,10 +602,6 @@ CONFIG_BLK_DEV_SR=y
579# CONFIG_BLK_DEV_SR_VENDOR is not set 602# CONFIG_BLK_DEV_SR_VENDOR is not set
580# CONFIG_CHR_DEV_SG is not set 603# CONFIG_CHR_DEV_SG is not set
581# CONFIG_CHR_DEV_SCH is not set 604# CONFIG_CHR_DEV_SCH is not set
582
583#
584# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
585#
586# CONFIG_SCSI_MULTI_LUN is not set 605# CONFIG_SCSI_MULTI_LUN is not set
587# CONFIG_SCSI_CONSTANTS is not set 606# CONFIG_SCSI_CONSTANTS is not set
588# CONFIG_SCSI_LOGGING is not set 607# CONFIG_SCSI_LOGGING is not set
@@ -599,6 +618,7 @@ CONFIG_SCSI_SPI_ATTRS=y
599# CONFIG_SCSI_SRP_ATTRS is not set 618# CONFIG_SCSI_SRP_ATTRS is not set
600CONFIG_SCSI_LOWLEVEL=y 619CONFIG_SCSI_LOWLEVEL=y
601# CONFIG_ISCSI_TCP is not set 620# CONFIG_ISCSI_TCP is not set
621# CONFIG_SCSI_BNX2_ISCSI is not set
602# CONFIG_BLK_DEV_3W_XXXX_RAID is not set 622# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
603# CONFIG_SCSI_3W_9XXX is not set 623# CONFIG_SCSI_3W_9XXX is not set
604# CONFIG_SCSI_ACARD is not set 624# CONFIG_SCSI_ACARD is not set
@@ -607,6 +627,7 @@ CONFIG_SCSI_LOWLEVEL=y
607# CONFIG_SCSI_AIC7XXX_OLD is not set 627# CONFIG_SCSI_AIC7XXX_OLD is not set
608# CONFIG_SCSI_AIC79XX is not set 628# CONFIG_SCSI_AIC79XX is not set
609# CONFIG_SCSI_AIC94XX is not set 629# CONFIG_SCSI_AIC94XX is not set
630# CONFIG_SCSI_MVSAS is not set
610# CONFIG_SCSI_DPT_I2O is not set 631# CONFIG_SCSI_DPT_I2O is not set
611# CONFIG_SCSI_ADVANSYS is not set 632# CONFIG_SCSI_ADVANSYS is not set
612# CONFIG_SCSI_ARCMSR is not set 633# CONFIG_SCSI_ARCMSR is not set
@@ -626,7 +647,6 @@ CONFIG_SCSI_LOWLEVEL=y
626# CONFIG_SCSI_IPS is not set 647# CONFIG_SCSI_IPS is not set
627# CONFIG_SCSI_INITIO is not set 648# CONFIG_SCSI_INITIO is not set
628# CONFIG_SCSI_INIA100 is not set 649# CONFIG_SCSI_INIA100 is not set
629# CONFIG_SCSI_MVSAS is not set
630# CONFIG_SCSI_STEX is not set 650# CONFIG_SCSI_STEX is not set
631# CONFIG_SCSI_SYM53C8XX_2 is not set 651# CONFIG_SCSI_SYM53C8XX_2 is not set
632# CONFIG_SCSI_QLOGIC_1280 is not set 652# CONFIG_SCSI_QLOGIC_1280 is not set
@@ -660,14 +680,17 @@ CONFIG_MD_RAID6_PQ=y
660# 680#
661 681
662# 682#
663# Enable only one of the two stacks, unless you know what you are doing 683# You can enable one or both FireWire driver stacks.
684#
685
686#
687# See the help texts for more information.
664# 688#
665# CONFIG_FIREWIRE is not set 689# CONFIG_FIREWIRE is not set
666# CONFIG_IEEE1394 is not set 690# CONFIG_IEEE1394 is not set
667# CONFIG_I2O is not set 691# CONFIG_I2O is not set
668# CONFIG_MACINTOSH_DRIVERS is not set 692# CONFIG_MACINTOSH_DRIVERS is not set
669CONFIG_NETDEVICES=y 693CONFIG_NETDEVICES=y
670CONFIG_COMPAT_NET_DEV_OPS=y
671CONFIG_DUMMY=m 694CONFIG_DUMMY=m
672# CONFIG_BONDING is not set 695# CONFIG_BONDING is not set
673# CONFIG_MACVLAN is not set 696# CONFIG_MACVLAN is not set
@@ -695,8 +718,10 @@ CONFIG_R8169=y
695# CONFIG_VIA_VELOCITY is not set 718# CONFIG_VIA_VELOCITY is not set
696# CONFIG_TIGON3 is not set 719# CONFIG_TIGON3 is not set
697# CONFIG_BNX2 is not set 720# CONFIG_BNX2 is not set
721# CONFIG_CNIC is not set
698# CONFIG_FSL_PQ_MDIO is not set 722# CONFIG_FSL_PQ_MDIO is not set
699# CONFIG_GIANFAR is not set 723# CONFIG_GIANFAR is not set
724# CONFIG_MV643XX_ETH is not set
700# CONFIG_QLA3XXX is not set 725# CONFIG_QLA3XXX is not set
701# CONFIG_ATL1 is not set 726# CONFIG_ATL1 is not set
702# CONFIG_ATL1E is not set 727# CONFIG_ATL1E is not set
@@ -845,13 +870,17 @@ CONFIG_I2C_MPC=y
845# CONFIG_SENSORS_PCF8574 is not set 870# CONFIG_SENSORS_PCF8574 is not set
846# CONFIG_PCF8575 is not set 871# CONFIG_PCF8575 is not set
847# CONFIG_SENSORS_PCA9539 is not set 872# CONFIG_SENSORS_PCA9539 is not set
848# CONFIG_SENSORS_MAX6875 is not set
849# CONFIG_SENSORS_TSL2550 is not set 873# CONFIG_SENSORS_TSL2550 is not set
850# CONFIG_I2C_DEBUG_CORE is not set 874# CONFIG_I2C_DEBUG_CORE is not set
851# CONFIG_I2C_DEBUG_ALGO is not set 875# CONFIG_I2C_DEBUG_ALGO is not set
852# CONFIG_I2C_DEBUG_BUS is not set 876# CONFIG_I2C_DEBUG_BUS is not set
853# CONFIG_I2C_DEBUG_CHIP is not set 877# CONFIG_I2C_DEBUG_CHIP is not set
854# CONFIG_SPI is not set 878# CONFIG_SPI is not set
879
880#
881# PPS support
882#
883# CONFIG_PPS is not set
855CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y 884CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
856# CONFIG_GPIOLIB is not set 885# CONFIG_GPIOLIB is not set
857# CONFIG_W1 is not set 886# CONFIG_W1 is not set
@@ -879,23 +908,9 @@ CONFIG_SSB_POSSIBLE=y
879# CONFIG_MFD_WM8400 is not set 908# CONFIG_MFD_WM8400 is not set
880# CONFIG_MFD_WM8350_I2C is not set 909# CONFIG_MFD_WM8350_I2C is not set
881# CONFIG_MFD_PCF50633 is not set 910# CONFIG_MFD_PCF50633 is not set
911# CONFIG_AB3100_CORE is not set
882# CONFIG_REGULATOR is not set 912# CONFIG_REGULATOR is not set
883 913# CONFIG_MEDIA_SUPPORT is not set
884#
885# Multimedia devices
886#
887
888#
889# Multimedia core support
890#
891# CONFIG_VIDEO_DEV is not set
892# CONFIG_DVB_CORE is not set
893# CONFIG_VIDEO_MEDIA is not set
894
895#
896# Multimedia drivers
897#
898# CONFIG_DAB is not set
899 914
900# 915#
901# Graphics support 916# Graphics support
@@ -937,6 +952,7 @@ CONFIG_USB_DEVICE_CLASS=y
937# USB Host Controller Drivers 952# USB Host Controller Drivers
938# 953#
939# CONFIG_USB_C67X00_HCD is not set 954# CONFIG_USB_C67X00_HCD is not set
955# CONFIG_USB_XHCI_HCD is not set
940CONFIG_USB_EHCI_HCD=y 956CONFIG_USB_EHCI_HCD=y
941# CONFIG_USB_EHCI_ROOT_HUB_TT is not set 957# CONFIG_USB_EHCI_ROOT_HUB_TT is not set
942# CONFIG_USB_EHCI_TT_NEWSCHED is not set 958# CONFIG_USB_EHCI_TT_NEWSCHED is not set
@@ -946,6 +962,8 @@ CONFIG_USB_EHCI_HCD_PPC_OF=y
946# CONFIG_USB_ISP116X_HCD is not set 962# CONFIG_USB_ISP116X_HCD is not set
947# CONFIG_USB_ISP1760_HCD is not set 963# CONFIG_USB_ISP1760_HCD is not set
948CONFIG_USB_OHCI_HCD=y 964CONFIG_USB_OHCI_HCD=y
965# CONFIG_USB_OHCI_HCD_PPC_OF_BE is not set
966# CONFIG_USB_OHCI_HCD_PPC_OF_LE is not set
949# CONFIG_USB_OHCI_HCD_PPC_OF is not set 967# CONFIG_USB_OHCI_HCD_PPC_OF is not set
950# CONFIG_USB_OHCI_BIG_ENDIAN_DESC is not set 968# CONFIG_USB_OHCI_BIG_ENDIAN_DESC is not set
951# CONFIG_USB_OHCI_BIG_ENDIAN_MMIO is not set 969# CONFIG_USB_OHCI_BIG_ENDIAN_MMIO is not set
@@ -1064,6 +1082,7 @@ CONFIG_RTC_DRV_DS1307=y
1064# CONFIG_RTC_DRV_S35390A is not set 1082# CONFIG_RTC_DRV_S35390A is not set
1065# CONFIG_RTC_DRV_FM3130 is not set 1083# CONFIG_RTC_DRV_FM3130 is not set
1066# CONFIG_RTC_DRV_RX8581 is not set 1084# CONFIG_RTC_DRV_RX8581 is not set
1085# CONFIG_RTC_DRV_RX8025 is not set
1067 1086
1068# 1087#
1069# SPI RTC drivers 1088# SPI RTC drivers
@@ -1091,6 +1110,10 @@ CONFIG_RTC_DRV_DS1307=y
1091# CONFIG_DMADEVICES is not set 1110# CONFIG_DMADEVICES is not set
1092# CONFIG_AUXDISPLAY is not set 1111# CONFIG_AUXDISPLAY is not set
1093# CONFIG_UIO is not set 1112# CONFIG_UIO is not set
1113
1114#
1115# TI VLYNQ
1116#
1094# CONFIG_STAGING is not set 1117# CONFIG_STAGING is not set
1095 1118
1096# 1119#
@@ -1110,7 +1133,6 @@ CONFIG_FS_MBCACHE=y
1110# CONFIG_REISERFS_FS is not set 1133# CONFIG_REISERFS_FS is not set
1111# CONFIG_JFS_FS is not set 1134# CONFIG_JFS_FS is not set
1112# CONFIG_FS_POSIX_ACL is not set 1135# CONFIG_FS_POSIX_ACL is not set
1113CONFIG_FILE_LOCKING=y
1114CONFIG_XFS_FS=m 1136CONFIG_XFS_FS=m
1115# CONFIG_XFS_QUOTA is not set 1137# CONFIG_XFS_QUOTA is not set
1116# CONFIG_XFS_POSIX_ACL is not set 1138# CONFIG_XFS_POSIX_ACL is not set
@@ -1119,6 +1141,8 @@ CONFIG_XFS_FS=m
1119# CONFIG_GFS2_FS is not set 1141# CONFIG_GFS2_FS is not set
1120# CONFIG_OCFS2_FS is not set 1142# CONFIG_OCFS2_FS is not set
1121# CONFIG_BTRFS_FS is not set 1143# CONFIG_BTRFS_FS is not set
1144CONFIG_FILE_LOCKING=y
1145CONFIG_FSNOTIFY=y
1122CONFIG_DNOTIFY=y 1146CONFIG_DNOTIFY=y
1123CONFIG_INOTIFY=y 1147CONFIG_INOTIFY=y
1124CONFIG_INOTIFY_USER=y 1148CONFIG_INOTIFY_USER=y
@@ -1273,6 +1297,7 @@ CONFIG_HAS_IOPORT=y
1273CONFIG_HAS_DMA=y 1297CONFIG_HAS_DMA=y
1274CONFIG_HAVE_LMB=y 1298CONFIG_HAVE_LMB=y
1275CONFIG_NLATTR=y 1299CONFIG_NLATTR=y
1300CONFIG_GENERIC_ATOMIC64=y
1276 1301
1277# 1302#
1278# Kernel hacking 1303# Kernel hacking
@@ -1298,22 +1323,11 @@ CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
1298CONFIG_HAVE_DYNAMIC_FTRACE=y 1323CONFIG_HAVE_DYNAMIC_FTRACE=y
1299CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y 1324CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
1300CONFIG_TRACING_SUPPORT=y 1325CONFIG_TRACING_SUPPORT=y
1301 1326# CONFIG_FTRACE is not set
1302#
1303# Tracers
1304#
1305# CONFIG_FUNCTION_TRACER is not set
1306# CONFIG_SCHED_TRACER is not set
1307# CONFIG_CONTEXT_SWITCH_TRACER is not set
1308# CONFIG_EVENT_TRACER is not set
1309# CONFIG_BOOT_TRACER is not set
1310# CONFIG_TRACE_BRANCH_PROFILING is not set
1311# CONFIG_STACK_TRACER is not set
1312# CONFIG_KMEMTRACE is not set
1313# CONFIG_WORKQUEUE_TRACER is not set
1314# CONFIG_BLK_DEV_IO_TRACE is not set
1315# CONFIG_SAMPLES is not set 1327# CONFIG_SAMPLES is not set
1316CONFIG_HAVE_ARCH_KGDB=y 1328CONFIG_HAVE_ARCH_KGDB=y
1329# CONFIG_PPC_DISABLE_WERROR is not set
1330CONFIG_PPC_WERROR=y
1317CONFIG_PRINT_STACK_DEPTH=64 1331CONFIG_PRINT_STACK_DEPTH=64
1318# CONFIG_IRQSTACKS is not set 1332# CONFIG_IRQSTACKS is not set
1319# CONFIG_BOOTX_TEXT is not set 1333# CONFIG_BOOTX_TEXT is not set
diff --git a/arch/powerpc/include/asm/cpm1.h b/arch/powerpc/include/asm/cpm1.h
index 2ff798744c1d..7685ffde8821 100644
--- a/arch/powerpc/include/asm/cpm1.h
+++ b/arch/powerpc/include/asm/cpm1.h
@@ -598,8 +598,6 @@ typedef struct risc_timer_pram {
598#define CICR_IEN ((uint)0x00000080) /* Int. enable */ 598#define CICR_IEN ((uint)0x00000080) /* Int. enable */
599#define CICR_SPS ((uint)0x00000001) /* SCC Spread */ 599#define CICR_SPS ((uint)0x00000001) /* SCC Spread */
600 600
601#define IMAP_ADDR (get_immrbase())
602
603#define CPM_PIN_INPUT 0 601#define CPM_PIN_INPUT 0
604#define CPM_PIN_OUTPUT 1 602#define CPM_PIN_OUTPUT 1
605#define CPM_PIN_PRIMARY 0 603#define CPM_PIN_PRIMARY 0
diff --git a/arch/powerpc/include/asm/delay.h b/arch/powerpc/include/asm/delay.h
index 1e2eb41fa057..52e4d54da2a9 100644
--- a/arch/powerpc/include/asm/delay.h
+++ b/arch/powerpc/include/asm/delay.h
@@ -63,6 +63,8 @@ extern void udelay(unsigned long usecs);
63 udelay(delay); \ 63 udelay(delay); \
64 else \ 64 else \
65 cpu_relax(); \ 65 cpu_relax(); \
66 if (!__ret) \
67 __ret = (condition); \
66 __ret; \ 68 __ret; \
67}) 69})
68 70
diff --git a/arch/powerpc/include/asm/dma-mapping.h b/arch/powerpc/include/asm/dma-mapping.h
index 3d9e887c3c0c..b44aaabdd1a6 100644
--- a/arch/powerpc/include/asm/dma-mapping.h
+++ b/arch/powerpc/include/asm/dma-mapping.h
@@ -309,7 +309,9 @@ static inline void dma_sync_single_for_cpu(struct device *dev,
309 struct dma_mapping_ops *dma_ops = get_dma_ops(dev); 309 struct dma_mapping_ops *dma_ops = get_dma_ops(dev);
310 310
311 BUG_ON(!dma_ops); 311 BUG_ON(!dma_ops);
312 dma_ops->sync_single_range_for_cpu(dev, dma_handle, 0, 312
313 if (dma_ops->sync_single_range_for_cpu)
314 dma_ops->sync_single_range_for_cpu(dev, dma_handle, 0,
313 size, direction); 315 size, direction);
314} 316}
315 317
@@ -320,7 +322,9 @@ static inline void dma_sync_single_for_device(struct device *dev,
320 struct dma_mapping_ops *dma_ops = get_dma_ops(dev); 322 struct dma_mapping_ops *dma_ops = get_dma_ops(dev);
321 323
322 BUG_ON(!dma_ops); 324 BUG_ON(!dma_ops);
323 dma_ops->sync_single_range_for_device(dev, dma_handle, 325
326 if (dma_ops->sync_single_range_for_device)
327 dma_ops->sync_single_range_for_device(dev, dma_handle,
324 0, size, direction); 328 0, size, direction);
325} 329}
326 330
@@ -331,7 +335,9 @@ static inline void dma_sync_sg_for_cpu(struct device *dev,
331 struct dma_mapping_ops *dma_ops = get_dma_ops(dev); 335 struct dma_mapping_ops *dma_ops = get_dma_ops(dev);
332 336
333 BUG_ON(!dma_ops); 337 BUG_ON(!dma_ops);
334 dma_ops->sync_sg_for_cpu(dev, sgl, nents, direction); 338
339 if (dma_ops->sync_sg_for_cpu)
340 dma_ops->sync_sg_for_cpu(dev, sgl, nents, direction);
335} 341}
336 342
337static inline void dma_sync_sg_for_device(struct device *dev, 343static inline void dma_sync_sg_for_device(struct device *dev,
@@ -341,7 +347,9 @@ static inline void dma_sync_sg_for_device(struct device *dev,
341 struct dma_mapping_ops *dma_ops = get_dma_ops(dev); 347 struct dma_mapping_ops *dma_ops = get_dma_ops(dev);
342 348
343 BUG_ON(!dma_ops); 349 BUG_ON(!dma_ops);
344 dma_ops->sync_sg_for_device(dev, sgl, nents, direction); 350
351 if (dma_ops->sync_sg_for_device)
352 dma_ops->sync_sg_for_device(dev, sgl, nents, direction);
345} 353}
346 354
347static inline void dma_sync_single_range_for_cpu(struct device *dev, 355static inline void dma_sync_single_range_for_cpu(struct device *dev,
@@ -351,7 +359,9 @@ static inline void dma_sync_single_range_for_cpu(struct device *dev,
351 struct dma_mapping_ops *dma_ops = get_dma_ops(dev); 359 struct dma_mapping_ops *dma_ops = get_dma_ops(dev);
352 360
353 BUG_ON(!dma_ops); 361 BUG_ON(!dma_ops);
354 dma_ops->sync_single_range_for_cpu(dev, dma_handle, 362
363 if (dma_ops->sync_single_range_for_cpu)
364 dma_ops->sync_single_range_for_cpu(dev, dma_handle,
355 offset, size, direction); 365 offset, size, direction);
356} 366}
357 367
@@ -362,7 +372,9 @@ static inline void dma_sync_single_range_for_device(struct device *dev,
362 struct dma_mapping_ops *dma_ops = get_dma_ops(dev); 372 struct dma_mapping_ops *dma_ops = get_dma_ops(dev);
363 373
364 BUG_ON(!dma_ops); 374 BUG_ON(!dma_ops);
365 dma_ops->sync_single_range_for_device(dev, dma_handle, offset, 375
376 if (dma_ops->sync_single_range_for_device)
377 dma_ops->sync_single_range_for_device(dev, dma_handle, offset,
366 size, direction); 378 size, direction);
367} 379}
368#else /* CONFIG_PPC_NEED_DMA_SYNC_OPS */ 380#else /* CONFIG_PPC_NEED_DMA_SYNC_OPS */
diff --git a/arch/powerpc/include/asm/highmem.h b/arch/powerpc/include/asm/highmem.h
index 684a73f4324f..a74c4ee6c020 100644
--- a/arch/powerpc/include/asm/highmem.h
+++ b/arch/powerpc/include/asm/highmem.h
@@ -22,9 +22,7 @@
22 22
23#ifdef __KERNEL__ 23#ifdef __KERNEL__
24 24
25#include <linux/init.h>
26#include <linux/interrupt.h> 25#include <linux/interrupt.h>
27#include <linux/highmem.h>
28#include <asm/kmap_types.h> 26#include <asm/kmap_types.h>
29#include <asm/tlbflush.h> 27#include <asm/tlbflush.h>
30#include <asm/page.h> 28#include <asm/page.h>
@@ -62,6 +60,9 @@ extern pte_t *pkmap_page_table;
62 60
63extern void *kmap_high(struct page *page); 61extern void *kmap_high(struct page *page);
64extern void kunmap_high(struct page *page); 62extern void kunmap_high(struct page *page);
63extern void *kmap_atomic_prot(struct page *page, enum km_type type,
64 pgprot_t prot);
65extern void kunmap_atomic(void *kvaddr, enum km_type type);
65 66
66static inline void *kmap(struct page *page) 67static inline void *kmap(struct page *page)
67{ 68{
@@ -79,62 +80,11 @@ static inline void kunmap(struct page *page)
79 kunmap_high(page); 80 kunmap_high(page);
80} 81}
81 82
82/*
83 * The use of kmap_atomic/kunmap_atomic is discouraged - kmap/kunmap
84 * gives a more generic (and caching) interface. But kmap_atomic can
85 * be used in IRQ contexts, so in some (very limited) cases we need
86 * it.
87 */
88static inline void *kmap_atomic_prot(struct page *page, enum km_type type, pgprot_t prot)
89{
90 unsigned int idx;
91 unsigned long vaddr;
92
93 /* even !CONFIG_PREEMPT needs this, for in_atomic in do_page_fault */
94 pagefault_disable();
95 if (!PageHighMem(page))
96 return page_address(page);
97
98 debug_kmap_atomic(type);
99 idx = type + KM_TYPE_NR*smp_processor_id();
100 vaddr = __fix_to_virt(FIX_KMAP_BEGIN + idx);
101#ifdef CONFIG_DEBUG_HIGHMEM
102 BUG_ON(!pte_none(*(kmap_pte-idx)));
103#endif
104 __set_pte_at(&init_mm, vaddr, kmap_pte-idx, mk_pte(page, prot), 1);
105 local_flush_tlb_page(NULL, vaddr);
106
107 return (void*) vaddr;
108}
109
110static inline void *kmap_atomic(struct page *page, enum km_type type) 83static inline void *kmap_atomic(struct page *page, enum km_type type)
111{ 84{
112 return kmap_atomic_prot(page, type, kmap_prot); 85 return kmap_atomic_prot(page, type, kmap_prot);
113} 86}
114 87
115static inline void kunmap_atomic(void *kvaddr, enum km_type type)
116{
117#ifdef CONFIG_DEBUG_HIGHMEM
118 unsigned long vaddr = (unsigned long) kvaddr & PAGE_MASK;
119 enum fixed_addresses idx = type + KM_TYPE_NR*smp_processor_id();
120
121 if (vaddr < __fix_to_virt(FIX_KMAP_END)) {
122 pagefault_enable();
123 return;
124 }
125
126 BUG_ON(vaddr != __fix_to_virt(FIX_KMAP_BEGIN + idx));
127
128 /*
129 * force other mappings to Oops if they'll try to access
130 * this pte without first remap it
131 */
132 pte_clear(&init_mm, vaddr, kmap_pte-idx);
133 local_flush_tlb_page(NULL, vaddr);
134#endif
135 pagefault_enable();
136}
137
138static inline struct page *kmap_atomic_to_page(void *ptr) 88static inline struct page *kmap_atomic_to_page(void *ptr)
139{ 89{
140 unsigned long idx, vaddr = (unsigned long) ptr; 90 unsigned long idx, vaddr = (unsigned long) ptr;
@@ -148,6 +98,7 @@ static inline struct page *kmap_atomic_to_page(void *ptr)
148 return pte_page(*pte); 98 return pte_page(*pte);
149} 99}
150 100
101
151#define flush_cache_kmaps() flush_cache_all() 102#define flush_cache_kmaps() flush_cache_all()
152 103
153#endif /* __KERNEL__ */ 104#endif /* __KERNEL__ */
diff --git a/arch/powerpc/include/asm/hw_irq.h b/arch/powerpc/include/asm/hw_irq.h
index 867ab8ed69b3..8b505eaaa38a 100644
--- a/arch/powerpc/include/asm/hw_irq.h
+++ b/arch/powerpc/include/asm/hw_irq.h
@@ -68,13 +68,13 @@ static inline int irqs_disabled_flags(unsigned long flags)
68 68
69#if defined(CONFIG_BOOKE) 69#if defined(CONFIG_BOOKE)
70#define SET_MSR_EE(x) mtmsr(x) 70#define SET_MSR_EE(x) mtmsr(x)
71#define local_irq_restore(flags) __asm__ __volatile__("wrtee %0" : : "r" (flags) : "memory") 71#define raw_local_irq_restore(flags) __asm__ __volatile__("wrtee %0" : : "r" (flags) : "memory")
72#else 72#else
73#define SET_MSR_EE(x) mtmsr(x) 73#define SET_MSR_EE(x) mtmsr(x)
74#define local_irq_restore(flags) mtmsr(flags) 74#define raw_local_irq_restore(flags) mtmsr(flags)
75#endif 75#endif
76 76
77static inline void local_irq_disable(void) 77static inline void raw_local_irq_disable(void)
78{ 78{
79#ifdef CONFIG_BOOKE 79#ifdef CONFIG_BOOKE
80 __asm__ __volatile__("wrteei 0": : :"memory"); 80 __asm__ __volatile__("wrteei 0": : :"memory");
@@ -86,7 +86,7 @@ static inline void local_irq_disable(void)
86#endif 86#endif
87} 87}
88 88
89static inline void local_irq_enable(void) 89static inline void raw_local_irq_enable(void)
90{ 90{
91#ifdef CONFIG_BOOKE 91#ifdef CONFIG_BOOKE
92 __asm__ __volatile__("wrteei 1": : :"memory"); 92 __asm__ __volatile__("wrteei 1": : :"memory");
@@ -98,7 +98,7 @@ static inline void local_irq_enable(void)
98#endif 98#endif
99} 99}
100 100
101static inline void local_irq_save_ptr(unsigned long *flags) 101static inline void raw_local_irq_save_ptr(unsigned long *flags)
102{ 102{
103 unsigned long msr; 103 unsigned long msr;
104 msr = mfmsr(); 104 msr = mfmsr();
@@ -110,12 +110,12 @@ static inline void local_irq_save_ptr(unsigned long *flags)
110#endif 110#endif
111} 111}
112 112
113#define local_save_flags(flags) ((flags) = mfmsr()) 113#define raw_local_save_flags(flags) ((flags) = mfmsr())
114#define local_irq_save(flags) local_irq_save_ptr(&flags) 114#define raw_local_irq_save(flags) raw_local_irq_save_ptr(&flags)
115#define irqs_disabled() ((mfmsr() & MSR_EE) == 0) 115#define raw_irqs_disabled() ((mfmsr() & MSR_EE) == 0)
116#define raw_irqs_disabled_flags(flags) (((flags) & MSR_EE) == 0)
116 117
117#define hard_irq_enable() local_irq_enable() 118#define hard_irq_disable() raw_local_irq_disable()
118#define hard_irq_disable() local_irq_disable()
119 119
120static inline int irqs_disabled_flags(unsigned long flags) 120static inline int irqs_disabled_flags(unsigned long flags)
121{ 121{
diff --git a/arch/powerpc/include/asm/kvm_host.h b/arch/powerpc/include/asm/kvm_host.h
index dfdf13c9fefd..fddc3ed715fa 100644
--- a/arch/powerpc/include/asm/kvm_host.h
+++ b/arch/powerpc/include/asm/kvm_host.h
@@ -34,7 +34,7 @@
34#define KVM_COALESCED_MMIO_PAGE_OFFSET 1 34#define KVM_COALESCED_MMIO_PAGE_OFFSET 1
35 35
36/* We don't currently support large pages. */ 36/* We don't currently support large pages. */
37#define KVM_PAGES_PER_HPAGE (1<<31) 37#define KVM_PAGES_PER_HPAGE (1UL << 31)
38 38
39struct kvm; 39struct kvm;
40struct kvm_run; 40struct kvm_run;
diff --git a/arch/powerpc/include/asm/perf_counter.h b/arch/powerpc/include/asm/perf_counter.h
index 8ccd4e155768..0ea0639fcf75 100644
--- a/arch/powerpc/include/asm/perf_counter.h
+++ b/arch/powerpc/include/asm/perf_counter.h
@@ -61,6 +61,8 @@ struct pt_regs;
61extern unsigned long perf_misc_flags(struct pt_regs *regs); 61extern unsigned long perf_misc_flags(struct pt_regs *regs);
62extern unsigned long perf_instruction_pointer(struct pt_regs *regs); 62extern unsigned long perf_instruction_pointer(struct pt_regs *regs);
63 63
64#define PERF_COUNTER_INDEX_OFFSET 1
65
64/* 66/*
65 * Only override the default definitions in include/linux/perf_counter.h 67 * Only override the default definitions in include/linux/perf_counter.h
66 * if we have hardware PMU support. 68 * if we have hardware PMU support.
diff --git a/arch/powerpc/include/asm/pgalloc-32.h b/arch/powerpc/include/asm/pgalloc-32.h
index 0815eb40acae..c9500d666a1d 100644
--- a/arch/powerpc/include/asm/pgalloc-32.h
+++ b/arch/powerpc/include/asm/pgalloc-32.h
@@ -16,7 +16,7 @@ extern void pgd_free(struct mm_struct *mm, pgd_t *pgd);
16 */ 16 */
17/* #define pmd_alloc_one(mm,address) ({ BUG(); ((pmd_t *)2); }) */ 17/* #define pmd_alloc_one(mm,address) ({ BUG(); ((pmd_t *)2); }) */
18#define pmd_free(mm, x) do { } while (0) 18#define pmd_free(mm, x) do { } while (0)
19#define __pmd_free_tlb(tlb,x) do { } while (0) 19#define __pmd_free_tlb(tlb,x,a) do { } while (0)
20/* #define pgd_populate(mm, pmd, pte) BUG() */ 20/* #define pgd_populate(mm, pmd, pte) BUG() */
21 21
22#ifndef CONFIG_BOOKE 22#ifndef CONFIG_BOOKE
diff --git a/arch/powerpc/include/asm/pgalloc-64.h b/arch/powerpc/include/asm/pgalloc-64.h
index afda2bdd860f..e6f069c4f713 100644
--- a/arch/powerpc/include/asm/pgalloc-64.h
+++ b/arch/powerpc/include/asm/pgalloc-64.h
@@ -118,11 +118,11 @@ static inline void pgtable_free(pgtable_free_t pgf)
118 kmem_cache_free(pgtable_cache[cachenum], p); 118 kmem_cache_free(pgtable_cache[cachenum], p);
119} 119}
120 120
121#define __pmd_free_tlb(tlb, pmd) \ 121#define __pmd_free_tlb(tlb, pmd,addr) \
122 pgtable_free_tlb(tlb, pgtable_free_cache(pmd, \ 122 pgtable_free_tlb(tlb, pgtable_free_cache(pmd, \
123 PMD_CACHE_NUM, PMD_TABLE_SIZE-1)) 123 PMD_CACHE_NUM, PMD_TABLE_SIZE-1))
124#ifndef CONFIG_PPC_64K_PAGES 124#ifndef CONFIG_PPC_64K_PAGES
125#define __pud_free_tlb(tlb, pud) \ 125#define __pud_free_tlb(tlb, pud, addr) \
126 pgtable_free_tlb(tlb, pgtable_free_cache(pud, \ 126 pgtable_free_tlb(tlb, pgtable_free_cache(pud, \
127 PUD_CACHE_NUM, PUD_TABLE_SIZE-1)) 127 PUD_CACHE_NUM, PUD_TABLE_SIZE-1))
128#endif /* CONFIG_PPC_64K_PAGES */ 128#endif /* CONFIG_PPC_64K_PAGES */
diff --git a/arch/powerpc/include/asm/pgalloc.h b/arch/powerpc/include/asm/pgalloc.h
index 5d8480265a77..1730e5e298d6 100644
--- a/arch/powerpc/include/asm/pgalloc.h
+++ b/arch/powerpc/include/asm/pgalloc.h
@@ -38,14 +38,14 @@ static inline pgtable_free_t pgtable_free_cache(void *p, int cachenum,
38extern void pgtable_free_tlb(struct mmu_gather *tlb, pgtable_free_t pgf); 38extern void pgtable_free_tlb(struct mmu_gather *tlb, pgtable_free_t pgf);
39 39
40#ifdef CONFIG_SMP 40#ifdef CONFIG_SMP
41#define __pte_free_tlb(tlb,ptepage) \ 41#define __pte_free_tlb(tlb,ptepage,address) \
42do { \ 42do { \
43 pgtable_page_dtor(ptepage); \ 43 pgtable_page_dtor(ptepage); \
44 pgtable_free_tlb(tlb, pgtable_free_cache(page_address(ptepage), \ 44 pgtable_free_tlb(tlb, pgtable_free_cache(page_address(ptepage), \
45 PTE_NONCACHE_NUM, PTE_TABLE_SIZE-1)); \ 45 PTE_NONCACHE_NUM, PTE_TABLE_SIZE-1)); \
46} while (0) 46} while (0)
47#else 47#else
48#define __pte_free_tlb(tlb, pte) pte_free((tlb)->mm, (pte)) 48#define __pte_free_tlb(tlb, pte, address) pte_free((tlb)->mm, (pte))
49#endif 49#endif
50 50
51 51
diff --git a/arch/powerpc/include/asm/pte-hash64-64k.h b/arch/powerpc/include/asm/pte-hash64-64k.h
index e05d26fa372f..82b72207c51c 100644
--- a/arch/powerpc/include/asm/pte-hash64-64k.h
+++ b/arch/powerpc/include/asm/pte-hash64-64k.h
@@ -47,7 +47,8 @@
47 * generic accessors and iterators here 47 * generic accessors and iterators here
48 */ 48 */
49#define __real_pte(e,p) ((real_pte_t) { \ 49#define __real_pte(e,p) ((real_pte_t) { \
50 (e), pte_val(*((p) + PTRS_PER_PTE)) }) 50 (e), ((e) & _PAGE_COMBO) ? \
51 (pte_val(*((p) + PTRS_PER_PTE))) : 0 })
51#define __rpte_to_hidx(r,index) ((pte_val((r).pte) & _PAGE_COMBO) ? \ 52#define __rpte_to_hidx(r,index) ((pte_val((r).pte) & _PAGE_COMBO) ? \
52 (((r).hidx >> ((index)<<2)) & 0xf) : ((pte_val((r).pte) >> 12) & 0xf)) 53 (((r).hidx >> ((index)<<2)) & 0xf) : ((pte_val((r).pte) >> 12) & 0xf))
53#define __rpte_to_pte(r) ((r).pte) 54#define __rpte_to_pte(r) ((r).pte)
diff --git a/arch/powerpc/include/asm/rtas.h b/arch/powerpc/include/asm/rtas.h
index 01c12339b304..168fce726201 100644
--- a/arch/powerpc/include/asm/rtas.h
+++ b/arch/powerpc/include/asm/rtas.h
@@ -58,7 +58,7 @@ struct rtas_t {
58 unsigned long entry; /* physical address pointer */ 58 unsigned long entry; /* physical address pointer */
59 unsigned long base; /* physical address pointer */ 59 unsigned long base; /* physical address pointer */
60 unsigned long size; 60 unsigned long size;
61 spinlock_t lock; 61 raw_spinlock_t lock;
62 struct rtas_args args; 62 struct rtas_args args;
63 struct device_node *dev; /* virtual address pointer */ 63 struct device_node *dev; /* virtual address pointer */
64}; 64};
@@ -245,5 +245,8 @@ static inline u32 rtas_config_addr(int busno, int devfn, int reg)
245 (devfn << 8) | (reg & 0xff); 245 (devfn << 8) | (reg & 0xff);
246} 246}
247 247
248extern void __cpuinit rtas_give_timebase(void);
249extern void __cpuinit rtas_take_timebase(void);
250
248#endif /* __KERNEL__ */ 251#endif /* __KERNEL__ */
249#endif /* _POWERPC_RTAS_H */ 252#endif /* _POWERPC_RTAS_H */
diff --git a/arch/powerpc/include/asm/thread_info.h b/arch/powerpc/include/asm/thread_info.h
index 9aba5a38a7c4..c8b329255678 100644
--- a/arch/powerpc/include/asm/thread_info.h
+++ b/arch/powerpc/include/asm/thread_info.h
@@ -46,15 +46,13 @@ struct thread_info {
46 46
47/* 47/*
48 * macros/functions for gaining access to the thread information structure 48 * macros/functions for gaining access to the thread information structure
49 *
50 * preempt_count needs to be 1 initially, until the scheduler is functional.
51 */ 49 */
52#define INIT_THREAD_INFO(tsk) \ 50#define INIT_THREAD_INFO(tsk) \
53{ \ 51{ \
54 .task = &tsk, \ 52 .task = &tsk, \
55 .exec_domain = &default_exec_domain, \ 53 .exec_domain = &default_exec_domain, \
56 .cpu = 0, \ 54 .cpu = 0, \
57 .preempt_count = 1, \ 55 .preempt_count = INIT_PREEMPT_COUNT, \
58 .restart_block = { \ 56 .restart_block = { \
59 .fn = do_no_restart_syscall, \ 57 .fn = do_no_restart_syscall, \
60 }, \ 58 }, \
diff --git a/arch/powerpc/kernel/entry_32.S b/arch/powerpc/kernel/entry_32.S
index 4dd38f129153..3cadba60a4b6 100644
--- a/arch/powerpc/kernel/entry_32.S
+++ b/arch/powerpc/kernel/entry_32.S
@@ -191,11 +191,49 @@ transfer_to_handler_cont:
191 mflr r9 191 mflr r9
192 lwz r11,0(r9) /* virtual address of handler */ 192 lwz r11,0(r9) /* virtual address of handler */
193 lwz r9,4(r9) /* where to go when done */ 193 lwz r9,4(r9) /* where to go when done */
194#ifdef CONFIG_TRACE_IRQFLAGS
195 lis r12,reenable_mmu@h
196 ori r12,r12,reenable_mmu@l
197 mtspr SPRN_SRR0,r12
198 mtspr SPRN_SRR1,r10
199 SYNC
200 RFI
201reenable_mmu: /* re-enable mmu so we can */
202 mfmsr r10
203 lwz r12,_MSR(r1)
204 xor r10,r10,r12
205 andi. r10,r10,MSR_EE /* Did EE change? */
206 beq 1f
207
208 /* Save handler and return address into the 2 unused words
209 * of the STACK_FRAME_OVERHEAD (sneak sneak sneak). Everything
210 * else can be recovered from the pt_regs except r3 which for
211 * normal interrupts has been set to pt_regs and for syscalls
212 * is an argument, so we temporarily use ORIG_GPR3 to save it
213 */
214 stw r9,8(r1)
215 stw r11,12(r1)
216 stw r3,ORIG_GPR3(r1)
217 bl trace_hardirqs_off
218 lwz r0,GPR0(r1)
219 lwz r3,ORIG_GPR3(r1)
220 lwz r4,GPR4(r1)
221 lwz r5,GPR5(r1)
222 lwz r6,GPR6(r1)
223 lwz r7,GPR7(r1)
224 lwz r8,GPR8(r1)
225 lwz r9,8(r1)
226 lwz r11,12(r1)
2271: mtctr r11
228 mtlr r9
229 bctr /* jump to handler */
230#else /* CONFIG_TRACE_IRQFLAGS */
194 mtspr SPRN_SRR0,r11 231 mtspr SPRN_SRR0,r11
195 mtspr SPRN_SRR1,r10 232 mtspr SPRN_SRR1,r10
196 mtlr r9 233 mtlr r9
197 SYNC 234 SYNC
198 RFI /* jump to handler, enable MMU */ 235 RFI /* jump to handler, enable MMU */
236#endif /* CONFIG_TRACE_IRQFLAGS */
199 237
200#if defined (CONFIG_6xx) || defined(CONFIG_E500) 238#if defined (CONFIG_6xx) || defined(CONFIG_E500)
2014: rlwinm r12,r12,0,~_TLF_NAPPING 2394: rlwinm r12,r12,0,~_TLF_NAPPING
@@ -251,6 +289,31 @@ _GLOBAL(DoSyscall)
251#ifdef SHOW_SYSCALLS 289#ifdef SHOW_SYSCALLS
252 bl do_show_syscall 290 bl do_show_syscall
253#endif /* SHOW_SYSCALLS */ 291#endif /* SHOW_SYSCALLS */
292#ifdef CONFIG_TRACE_IRQFLAGS
293 /* Return from syscalls can (and generally will) hard enable
294 * interrupts. You aren't supposed to call a syscall with
295 * interrupts disabled in the first place. However, to ensure
296 * that we get it right vs. lockdep if it happens, we force
297 * that hard enable here with appropriate tracing if we see
298 * that we have been called with interrupts off
299 */
300 mfmsr r11
301 andi. r12,r11,MSR_EE
302 bne+ 1f
303 /* We came in with interrupts disabled, we enable them now */
304 bl trace_hardirqs_on
305 mfmsr r11
306 lwz r0,GPR0(r1)
307 lwz r3,GPR3(r1)
308 lwz r4,GPR4(r1)
309 ori r11,r11,MSR_EE
310 lwz r5,GPR5(r1)
311 lwz r6,GPR6(r1)
312 lwz r7,GPR7(r1)
313 lwz r8,GPR8(r1)
314 mtmsr r11
3151:
316#endif /* CONFIG_TRACE_IRQFLAGS */
254 rlwinm r10,r1,0,0,(31-THREAD_SHIFT) /* current_thread_info() */ 317 rlwinm r10,r1,0,0,(31-THREAD_SHIFT) /* current_thread_info() */
255 lwz r11,TI_FLAGS(r10) 318 lwz r11,TI_FLAGS(r10)
256 andi. r11,r11,_TIF_SYSCALL_T_OR_A 319 andi. r11,r11,_TIF_SYSCALL_T_OR_A
@@ -275,6 +338,7 @@ ret_from_syscall:
275 rlwinm r12,r1,0,0,(31-THREAD_SHIFT) /* current_thread_info() */ 338 rlwinm r12,r1,0,0,(31-THREAD_SHIFT) /* current_thread_info() */
276 /* disable interrupts so current_thread_info()->flags can't change */ 339 /* disable interrupts so current_thread_info()->flags can't change */
277 LOAD_MSR_KERNEL(r10,MSR_KERNEL) /* doesn't include MSR_EE */ 340 LOAD_MSR_KERNEL(r10,MSR_KERNEL) /* doesn't include MSR_EE */
341 /* Note: We don't bother telling lockdep about it */
278 SYNC 342 SYNC
279 MTMSRD(r10) 343 MTMSRD(r10)
280 lwz r9,TI_FLAGS(r12) 344 lwz r9,TI_FLAGS(r12)
@@ -288,6 +352,19 @@ ret_from_syscall:
288 oris r11,r11,0x1000 /* Set SO bit in CR */ 352 oris r11,r11,0x1000 /* Set SO bit in CR */
289 stw r11,_CCR(r1) 353 stw r11,_CCR(r1)
290syscall_exit_cont: 354syscall_exit_cont:
355 lwz r8,_MSR(r1)
356#ifdef CONFIG_TRACE_IRQFLAGS
357 /* If we are going to return from the syscall with interrupts
358 * off, we trace that here. It shouldn't happen though but we
359 * want to catch the bugger if it does right ?
360 */
361 andi. r10,r8,MSR_EE
362 bne+ 1f
363 stw r3,GPR3(r1)
364 bl trace_hardirqs_off
365 lwz r3,GPR3(r1)
3661:
367#endif /* CONFIG_TRACE_IRQFLAGS */
291#if defined(CONFIG_4xx) || defined(CONFIG_BOOKE) 368#if defined(CONFIG_4xx) || defined(CONFIG_BOOKE)
292 /* If the process has its own DBCR0 value, load it up. The internal 369 /* If the process has its own DBCR0 value, load it up. The internal
293 debug mode bit tells us that dbcr0 should be loaded. */ 370 debug mode bit tells us that dbcr0 should be loaded. */
@@ -311,7 +388,6 @@ END_FTR_SECTION_IFSET(CPU_FTR_NEED_PAIRED_STWCX)
311 mtlr r4 388 mtlr r4
312 mtcr r5 389 mtcr r5
313 lwz r7,_NIP(r1) 390 lwz r7,_NIP(r1)
314 lwz r8,_MSR(r1)
315 FIX_SRR1(r8, r0) 391 FIX_SRR1(r8, r0)
316 lwz r2,GPR2(r1) 392 lwz r2,GPR2(r1)
317 lwz r1,GPR1(r1) 393 lwz r1,GPR1(r1)
@@ -394,7 +470,9 @@ syscall_exit_work:
394 andi. r0,r9,(_TIF_SYSCALL_T_OR_A|_TIF_SINGLESTEP) 470 andi. r0,r9,(_TIF_SYSCALL_T_OR_A|_TIF_SINGLESTEP)
395 beq ret_from_except 471 beq ret_from_except
396 472
397 /* Re-enable interrupts */ 473 /* Re-enable interrupts. There is no need to trace that with
474 * lockdep as we are supposed to have IRQs on at this point
475 */
398 ori r10,r10,MSR_EE 476 ori r10,r10,MSR_EE
399 SYNC 477 SYNC
400 MTMSRD(r10) 478 MTMSRD(r10)
@@ -705,6 +783,7 @@ ret_from_except:
705 /* Hard-disable interrupts so that current_thread_info()->flags 783 /* Hard-disable interrupts so that current_thread_info()->flags
706 * can't change between when we test it and when we return 784 * can't change between when we test it and when we return
707 * from the interrupt. */ 785 * from the interrupt. */
786 /* Note: We don't bother telling lockdep about it */
708 LOAD_MSR_KERNEL(r10,MSR_KERNEL) 787 LOAD_MSR_KERNEL(r10,MSR_KERNEL)
709 SYNC /* Some chip revs have problems here... */ 788 SYNC /* Some chip revs have problems here... */
710 MTMSRD(r10) /* disable interrupts */ 789 MTMSRD(r10) /* disable interrupts */
@@ -744,11 +823,24 @@ resume_kernel:
744 beq+ restore 823 beq+ restore
745 andi. r0,r3,MSR_EE /* interrupts off? */ 824 andi. r0,r3,MSR_EE /* interrupts off? */
746 beq restore /* don't schedule if so */ 825 beq restore /* don't schedule if so */
826#ifdef CONFIG_TRACE_IRQFLAGS
827 /* Lockdep thinks irqs are enabled, we need to call
828 * preempt_schedule_irq with IRQs off, so we inform lockdep
829 * now that we -did- turn them off already
830 */
831 bl trace_hardirqs_off
832#endif
7471: bl preempt_schedule_irq 8331: bl preempt_schedule_irq
748 rlwinm r9,r1,0,0,(31-THREAD_SHIFT) 834 rlwinm r9,r1,0,0,(31-THREAD_SHIFT)
749 lwz r3,TI_FLAGS(r9) 835 lwz r3,TI_FLAGS(r9)
750 andi. r0,r3,_TIF_NEED_RESCHED 836 andi. r0,r3,_TIF_NEED_RESCHED
751 bne- 1b 837 bne- 1b
838#ifdef CONFIG_TRACE_IRQFLAGS
839 /* And now, to properly rebalance the above, we tell lockdep they
840 * are being turned back on, which will happen when we return
841 */
842 bl trace_hardirqs_on
843#endif
752#else 844#else
753resume_kernel: 845resume_kernel:
754#endif /* CONFIG_PREEMPT */ 846#endif /* CONFIG_PREEMPT */
@@ -765,6 +857,28 @@ restore:
765 stw r6,icache_44x_need_flush@l(r4) 857 stw r6,icache_44x_need_flush@l(r4)
7661: 8581:
767#endif /* CONFIG_44x */ 859#endif /* CONFIG_44x */
860
861 lwz r9,_MSR(r1)
862#ifdef CONFIG_TRACE_IRQFLAGS
863 /* Lockdep doesn't know about the fact that IRQs are temporarily turned
864 * off in this assembly code while peeking at TI_FLAGS() and such. However
865 * we need to inform it if the exception turned interrupts off, and we
866 * are about to trun them back on.
867 *
868 * The problem here sadly is that we don't know whether the exceptions was
869 * one that turned interrupts off or not. So we always tell lockdep about
870 * turning them on here when we go back to wherever we came from with EE
871 * on, even if that may meen some redudant calls being tracked. Maybe later
872 * we could encode what the exception did somewhere or test the exception
873 * type in the pt_regs but that sounds overkill
874 */
875 andi. r10,r9,MSR_EE
876 beq 1f
877 bl trace_hardirqs_on
878 lwz r9,_MSR(r1)
8791:
880#endif /* CONFIG_TRACE_IRQFLAGS */
881
768 lwz r0,GPR0(r1) 882 lwz r0,GPR0(r1)
769 lwz r2,GPR2(r1) 883 lwz r2,GPR2(r1)
770 REST_4GPRS(3, r1) 884 REST_4GPRS(3, r1)
@@ -782,7 +896,6 @@ END_FTR_SECTION_IFSET(CPU_FTR_NEED_PAIRED_STWCX)
782 stwcx. r0,0,r1 /* to clear the reservation */ 896 stwcx. r0,0,r1 /* to clear the reservation */
783 897
784#if !(defined(CONFIG_4xx) || defined(CONFIG_BOOKE)) 898#if !(defined(CONFIG_4xx) || defined(CONFIG_BOOKE))
785 lwz r9,_MSR(r1)
786 andi. r10,r9,MSR_RI /* check if this exception occurred */ 899 andi. r10,r9,MSR_RI /* check if this exception occurred */
787 beql nonrecoverable /* at a bad place (MSR:RI = 0) */ 900 beql nonrecoverable /* at a bad place (MSR:RI = 0) */
788 901
@@ -805,7 +918,6 @@ END_FTR_SECTION_IFSET(CPU_FTR_NEED_PAIRED_STWCX)
805 MTMSRD(r10) /* clear the RI bit */ 918 MTMSRD(r10) /* clear the RI bit */
806 .globl exc_exit_restart 919 .globl exc_exit_restart
807exc_exit_restart: 920exc_exit_restart:
808 lwz r9,_MSR(r1)
809 lwz r12,_NIP(r1) 921 lwz r12,_NIP(r1)
810 FIX_SRR1(r9,r10) 922 FIX_SRR1(r9,r10)
811 mtspr SPRN_SRR0,r12 923 mtspr SPRN_SRR0,r12
@@ -1035,11 +1147,18 @@ do_work: /* r10 contains MSR_KERNEL here */
1035 beq do_user_signal 1147 beq do_user_signal
1036 1148
1037do_resched: /* r10 contains MSR_KERNEL here */ 1149do_resched: /* r10 contains MSR_KERNEL here */
1150 /* Note: We don't need to inform lockdep that we are enabling
1151 * interrupts here. As far as it knows, they are already enabled
1152 */
1038 ori r10,r10,MSR_EE 1153 ori r10,r10,MSR_EE
1039 SYNC 1154 SYNC
1040 MTMSRD(r10) /* hard-enable interrupts */ 1155 MTMSRD(r10) /* hard-enable interrupts */
1041 bl schedule 1156 bl schedule
1042recheck: 1157recheck:
1158 /* Note: And we don't tell it we are disabling them again
1159 * neither. Those disable/enable cycles used to peek at
1160 * TI_FLAGS aren't advertised.
1161 */
1043 LOAD_MSR_KERNEL(r10,MSR_KERNEL) 1162 LOAD_MSR_KERNEL(r10,MSR_KERNEL)
1044 SYNC 1163 SYNC
1045 MTMSRD(r10) /* disable interrupts */ 1164 MTMSRD(r10) /* disable interrupts */
diff --git a/arch/powerpc/kernel/head_32.S b/arch/powerpc/kernel/head_32.S
index 48469463f89e..fc2132942754 100644
--- a/arch/powerpc/kernel/head_32.S
+++ b/arch/powerpc/kernel/head_32.S
@@ -1124,9 +1124,8 @@ mmu_off:
1124 RFI 1124 RFI
1125 1125
1126/* 1126/*
1127 * Use the first pair of BAT registers to map the 1st 16MB 1127 * On 601, we use 3 BATs to map up to 24M of RAM at _PAGE_OFFSET
1128 * of RAM to PAGE_OFFSET. From this point on we can't safely 1128 * (we keep one for debugging) and on others, we use one 256M BAT.
1129 * call OF any more.
1130 */ 1129 */
1131initial_bats: 1130initial_bats:
1132 lis r11,PAGE_OFFSET@h 1131 lis r11,PAGE_OFFSET@h
@@ -1136,12 +1135,16 @@ initial_bats:
1136 bne 4f 1135 bne 4f
1137 ori r11,r11,4 /* set up BAT registers for 601 */ 1136 ori r11,r11,4 /* set up BAT registers for 601 */
1138 li r8,0x7f /* valid, block length = 8MB */ 1137 li r8,0x7f /* valid, block length = 8MB */
1139 oris r9,r11,0x800000@h /* set up BAT reg for 2nd 8M */
1140 oris r10,r8,0x800000@h /* set up BAT reg for 2nd 8M */
1141 mtspr SPRN_IBAT0U,r11 /* N.B. 601 has valid bit in */ 1138 mtspr SPRN_IBAT0U,r11 /* N.B. 601 has valid bit in */
1142 mtspr SPRN_IBAT0L,r8 /* lower BAT register */ 1139 mtspr SPRN_IBAT0L,r8 /* lower BAT register */
1143 mtspr SPRN_IBAT1U,r9 1140 addis r11,r11,0x800000@h
1144 mtspr SPRN_IBAT1L,r10 1141 addis r8,r8,0x800000@h
1142 mtspr SPRN_IBAT1U,r11
1143 mtspr SPRN_IBAT1L,r8
1144 addis r11,r11,0x800000@h
1145 addis r8,r8,0x800000@h
1146 mtspr SPRN_IBAT2U,r11
1147 mtspr SPRN_IBAT2L,r8
1145 isync 1148 isync
1146 blr 1149 blr
1147 1150
diff --git a/arch/powerpc/kernel/mpc7450-pmu.c b/arch/powerpc/kernel/mpc7450-pmu.c
index 75ff47fed7bf..cc466d039af6 100644
--- a/arch/powerpc/kernel/mpc7450-pmu.c
+++ b/arch/powerpc/kernel/mpc7450-pmu.c
@@ -10,7 +10,6 @@
10 */ 10 */
11#include <linux/string.h> 11#include <linux/string.h>
12#include <linux/perf_counter.h> 12#include <linux/perf_counter.h>
13#include <linux/string.h>
14#include <asm/reg.h> 13#include <asm/reg.h>
15#include <asm/cputable.h> 14#include <asm/cputable.h>
16 15
@@ -408,7 +407,8 @@ struct power_pmu mpc7450_pmu = {
408 407
409static int init_mpc7450_pmu(void) 408static int init_mpc7450_pmu(void)
410{ 409{
411 if (strcmp(cur_cpu_spec->oprofile_cpu_type, "ppc/7450")) 410 if (!cur_cpu_spec->oprofile_cpu_type ||
411 strcmp(cur_cpu_spec->oprofile_cpu_type, "ppc/7450"))
412 return -ENODEV; 412 return -ENODEV;
413 413
414 return register_power_pmu(&mpc7450_pmu); 414 return register_power_pmu(&mpc7450_pmu);
diff --git a/arch/powerpc/kernel/of_device.c b/arch/powerpc/kernel/of_device.c
index fa983a59c4ce..a359cb08e900 100644
--- a/arch/powerpc/kernel/of_device.c
+++ b/arch/powerpc/kernel/of_device.c
@@ -76,7 +76,7 @@ struct of_device *of_device_alloc(struct device_node *np,
76 dev->dev.archdata.of_node = np; 76 dev->dev.archdata.of_node = np;
77 77
78 if (bus_id) 78 if (bus_id)
79 dev_set_name(&dev->dev, bus_id); 79 dev_set_name(&dev->dev, "%s", bus_id);
80 else 80 else
81 of_device_make_bus_id(dev); 81 of_device_make_bus_id(dev);
82 82
diff --git a/arch/powerpc/kernel/power4-pmu.c b/arch/powerpc/kernel/power4-pmu.c
index db90b0c5c27b..3c90a3d9173e 100644
--- a/arch/powerpc/kernel/power4-pmu.c
+++ b/arch/powerpc/kernel/power4-pmu.c
@@ -606,7 +606,8 @@ static struct power_pmu power4_pmu = {
606 606
607static int init_power4_pmu(void) 607static int init_power4_pmu(void)
608{ 608{
609 if (strcmp(cur_cpu_spec->oprofile_cpu_type, "ppc64/power4")) 609 if (!cur_cpu_spec->oprofile_cpu_type ||
610 strcmp(cur_cpu_spec->oprofile_cpu_type, "ppc64/power4"))
610 return -ENODEV; 611 return -ENODEV;
611 612
612 return register_power_pmu(&power4_pmu); 613 return register_power_pmu(&power4_pmu);
diff --git a/arch/powerpc/kernel/power5+-pmu.c b/arch/powerpc/kernel/power5+-pmu.c
index f4adca8e98a4..31918af3e355 100644
--- a/arch/powerpc/kernel/power5+-pmu.c
+++ b/arch/powerpc/kernel/power5+-pmu.c
@@ -678,8 +678,9 @@ static struct power_pmu power5p_pmu = {
678 678
679static int init_power5p_pmu(void) 679static int init_power5p_pmu(void)
680{ 680{
681 if (strcmp(cur_cpu_spec->oprofile_cpu_type, "ppc64/power5+") 681 if (!cur_cpu_spec->oprofile_cpu_type ||
682 && strcmp(cur_cpu_spec->oprofile_cpu_type, "ppc64/power5++")) 682 (strcmp(cur_cpu_spec->oprofile_cpu_type, "ppc64/power5+")
683 && strcmp(cur_cpu_spec->oprofile_cpu_type, "ppc64/power5++")))
683 return -ENODEV; 684 return -ENODEV;
684 685
685 return register_power_pmu(&power5p_pmu); 686 return register_power_pmu(&power5p_pmu);
diff --git a/arch/powerpc/kernel/power5-pmu.c b/arch/powerpc/kernel/power5-pmu.c
index 29b2c6c0e83a..867f6f663963 100644
--- a/arch/powerpc/kernel/power5-pmu.c
+++ b/arch/powerpc/kernel/power5-pmu.c
@@ -618,7 +618,8 @@ static struct power_pmu power5_pmu = {
618 618
619static int init_power5_pmu(void) 619static int init_power5_pmu(void)
620{ 620{
621 if (strcmp(cur_cpu_spec->oprofile_cpu_type, "ppc64/power5")) 621 if (!cur_cpu_spec->oprofile_cpu_type ||
622 strcmp(cur_cpu_spec->oprofile_cpu_type, "ppc64/power5"))
622 return -ENODEV; 623 return -ENODEV;
623 624
624 return register_power_pmu(&power5_pmu); 625 return register_power_pmu(&power5_pmu);
diff --git a/arch/powerpc/kernel/power6-pmu.c b/arch/powerpc/kernel/power6-pmu.c
index 09ae5bf5bda7..fa21890531da 100644
--- a/arch/powerpc/kernel/power6-pmu.c
+++ b/arch/powerpc/kernel/power6-pmu.c
@@ -537,7 +537,8 @@ static struct power_pmu power6_pmu = {
537 537
538static int init_power6_pmu(void) 538static int init_power6_pmu(void)
539{ 539{
540 if (strcmp(cur_cpu_spec->oprofile_cpu_type, "ppc64/power6")) 540 if (!cur_cpu_spec->oprofile_cpu_type ||
541 strcmp(cur_cpu_spec->oprofile_cpu_type, "ppc64/power6"))
541 return -ENODEV; 542 return -ENODEV;
542 543
543 return register_power_pmu(&power6_pmu); 544 return register_power_pmu(&power6_pmu);
diff --git a/arch/powerpc/kernel/power7-pmu.c b/arch/powerpc/kernel/power7-pmu.c
index 5d755ef7ac8f..388cf57ad827 100644
--- a/arch/powerpc/kernel/power7-pmu.c
+++ b/arch/powerpc/kernel/power7-pmu.c
@@ -358,6 +358,7 @@ static struct power_pmu power7_pmu = {
358 .get_constraint = power7_get_constraint, 358 .get_constraint = power7_get_constraint,
359 .get_alternatives = power7_get_alternatives, 359 .get_alternatives = power7_get_alternatives,
360 .disable_pmc = power7_disable_pmc, 360 .disable_pmc = power7_disable_pmc,
361 .flags = PPMU_ALT_SIPR,
361 .n_generic = ARRAY_SIZE(power7_generic_events), 362 .n_generic = ARRAY_SIZE(power7_generic_events),
362 .generic_events = power7_generic_events, 363 .generic_events = power7_generic_events,
363 .cache_events = &power7_cache_events, 364 .cache_events = &power7_cache_events,
@@ -365,7 +366,8 @@ static struct power_pmu power7_pmu = {
365 366
366static int init_power7_pmu(void) 367static int init_power7_pmu(void)
367{ 368{
368 if (strcmp(cur_cpu_spec->oprofile_cpu_type, "ppc64/power7")) 369 if (!cur_cpu_spec->oprofile_cpu_type ||
370 strcmp(cur_cpu_spec->oprofile_cpu_type, "ppc64/power7"))
369 return -ENODEV; 371 return -ENODEV;
370 372
371 return register_power_pmu(&power7_pmu); 373 return register_power_pmu(&power7_pmu);
diff --git a/arch/powerpc/kernel/ppc970-pmu.c b/arch/powerpc/kernel/ppc970-pmu.c
index 6637c87fe70e..75dccb71a043 100644
--- a/arch/powerpc/kernel/ppc970-pmu.c
+++ b/arch/powerpc/kernel/ppc970-pmu.c
@@ -10,7 +10,6 @@
10 */ 10 */
11#include <linux/string.h> 11#include <linux/string.h>
12#include <linux/perf_counter.h> 12#include <linux/perf_counter.h>
13#include <linux/string.h>
14#include <asm/reg.h> 13#include <asm/reg.h>
15#include <asm/cputable.h> 14#include <asm/cputable.h>
16 15
@@ -489,8 +488,9 @@ static struct power_pmu ppc970_pmu = {
489 488
490static int init_ppc970_pmu(void) 489static int init_ppc970_pmu(void)
491{ 490{
492 if (strcmp(cur_cpu_spec->oprofile_cpu_type, "ppc64/970") 491 if (!cur_cpu_spec->oprofile_cpu_type ||
493 && strcmp(cur_cpu_spec->oprofile_cpu_type, "ppc64/970MP")) 492 (strcmp(cur_cpu_spec->oprofile_cpu_type, "ppc64/970")
493 && strcmp(cur_cpu_spec->oprofile_cpu_type, "ppc64/970MP")))
494 return -ENODEV; 494 return -ENODEV;
495 495
496 return register_power_pmu(&ppc970_pmu); 496 return register_power_pmu(&ppc970_pmu);
diff --git a/arch/powerpc/kernel/process.c b/arch/powerpc/kernel/process.c
index 3e7135bbe40f..892a9f2e6d76 100644
--- a/arch/powerpc/kernel/process.c
+++ b/arch/powerpc/kernel/process.c
@@ -528,7 +528,7 @@ void show_regs(struct pt_regs * regs)
528 528
529 for (i = 0; i < 32; i++) { 529 for (i = 0; i < 32; i++) {
530 if ((i % REGS_PER_LINE) == 0) 530 if ((i % REGS_PER_LINE) == 0)
531 printk("\n" KERN_INFO "GPR%02d: ", i); 531 printk("\nGPR%02d: ", i);
532 printk(REG " ", regs->gpr[i]); 532 printk(REG " ", regs->gpr[i]);
533 if (i == LAST_VOLATILE && !FULL_REGS(regs)) 533 if (i == LAST_VOLATILE && !FULL_REGS(regs))
534 break; 534 break;
diff --git a/arch/powerpc/kernel/ptrace.c b/arch/powerpc/kernel/ptrace.c
index 9fa2c7dcd05a..ef149880c145 100644
--- a/arch/powerpc/kernel/ptrace.c
+++ b/arch/powerpc/kernel/ptrace.c
@@ -736,15 +736,16 @@ void user_disable_single_step(struct task_struct *task)
736{ 736{
737 struct pt_regs *regs = task->thread.regs; 737 struct pt_regs *regs = task->thread.regs;
738 738
739
740#if defined(CONFIG_BOOKE)
741 /* If DAC then do not single step, skip */
742 if (task->thread.dabr)
743 return;
744#endif
745
746 if (regs != NULL) { 739 if (regs != NULL) {
747#if defined(CONFIG_40x) || defined(CONFIG_BOOKE) 740#if defined(CONFIG_BOOKE)
741 /* If DAC don't clear DBCRO_IDM or MSR_DE */
742 if (task->thread.dabr)
743 task->thread.dbcr0 &= ~(DBCR0_IC | DBCR0_BT);
744 else {
745 task->thread.dbcr0 &= ~(DBCR0_IC | DBCR0_BT | DBCR0_IDM);
746 regs->msr &= ~MSR_DE;
747 }
748#elif defined(CONFIG_40x)
748 task->thread.dbcr0 &= ~(DBCR0_IC | DBCR0_BT | DBCR0_IDM); 749 task->thread.dbcr0 &= ~(DBCR0_IC | DBCR0_BT | DBCR0_IDM);
749 regs->msr &= ~MSR_DE; 750 regs->msr &= ~MSR_DE;
750#else 751#else
diff --git a/arch/powerpc/kernel/ptrace32.c b/arch/powerpc/kernel/ptrace32.c
index 297632cba047..8a6daf4129f6 100644
--- a/arch/powerpc/kernel/ptrace32.c
+++ b/arch/powerpc/kernel/ptrace32.c
@@ -21,7 +21,6 @@
21#include <linux/sched.h> 21#include <linux/sched.h>
22#include <linux/mm.h> 22#include <linux/mm.h>
23#include <linux/smp.h> 23#include <linux/smp.h>
24#include <linux/smp_lock.h>
25#include <linux/errno.h> 24#include <linux/errno.h>
26#include <linux/ptrace.h> 25#include <linux/ptrace.h>
27#include <linux/regset.h> 26#include <linux/regset.h>
diff --git a/arch/powerpc/kernel/rtas.c b/arch/powerpc/kernel/rtas.c
index ee4c7609b649..c434823b8c83 100644
--- a/arch/powerpc/kernel/rtas.c
+++ b/arch/powerpc/kernel/rtas.c
@@ -38,9 +38,10 @@
38#include <asm/syscalls.h> 38#include <asm/syscalls.h>
39#include <asm/smp.h> 39#include <asm/smp.h>
40#include <asm/atomic.h> 40#include <asm/atomic.h>
41#include <asm/time.h>
41 42
42struct rtas_t rtas = { 43struct rtas_t rtas = {
43 .lock = SPIN_LOCK_UNLOCKED 44 .lock = __RAW_SPIN_LOCK_UNLOCKED
44}; 45};
45EXPORT_SYMBOL(rtas); 46EXPORT_SYMBOL(rtas);
46 47
@@ -67,6 +68,28 @@ unsigned long rtas_rmo_buf;
67void (*rtas_flash_term_hook)(int); 68void (*rtas_flash_term_hook)(int);
68EXPORT_SYMBOL(rtas_flash_term_hook); 69EXPORT_SYMBOL(rtas_flash_term_hook);
69 70
71/* RTAS use home made raw locking instead of spin_lock_irqsave
72 * because those can be called from within really nasty contexts
73 * such as having the timebase stopped which would lockup with
74 * normal locks and spinlock debugging enabled
75 */
76static unsigned long lock_rtas(void)
77{
78 unsigned long flags;
79
80 local_irq_save(flags);
81 preempt_disable();
82 __raw_spin_lock_flags(&rtas.lock, flags);
83 return flags;
84}
85
86static void unlock_rtas(unsigned long flags)
87{
88 __raw_spin_unlock(&rtas.lock);
89 local_irq_restore(flags);
90 preempt_enable();
91}
92
70/* 93/*
71 * call_rtas_display_status and call_rtas_display_status_delay 94 * call_rtas_display_status and call_rtas_display_status_delay
72 * are designed only for very early low-level debugging, which 95 * are designed only for very early low-level debugging, which
@@ -79,7 +102,7 @@ static void call_rtas_display_status(char c)
79 102
80 if (!rtas.base) 103 if (!rtas.base)
81 return; 104 return;
82 spin_lock_irqsave(&rtas.lock, s); 105 s = lock_rtas();
83 106
84 args->token = 10; 107 args->token = 10;
85 args->nargs = 1; 108 args->nargs = 1;
@@ -89,7 +112,7 @@ static void call_rtas_display_status(char c)
89 112
90 enter_rtas(__pa(args)); 113 enter_rtas(__pa(args));
91 114
92 spin_unlock_irqrestore(&rtas.lock, s); 115 unlock_rtas(s);
93} 116}
94 117
95static void call_rtas_display_status_delay(char c) 118static void call_rtas_display_status_delay(char c)
@@ -411,8 +434,7 @@ int rtas_call(int token, int nargs, int nret, int *outputs, ...)
411 if (!rtas.entry || token == RTAS_UNKNOWN_SERVICE) 434 if (!rtas.entry || token == RTAS_UNKNOWN_SERVICE)
412 return -1; 435 return -1;
413 436
414 /* Gotta do something different here, use global lock for now... */ 437 s = lock_rtas();
415 spin_lock_irqsave(&rtas.lock, s);
416 rtas_args = &rtas.args; 438 rtas_args = &rtas.args;
417 439
418 rtas_args->token = token; 440 rtas_args->token = token;
@@ -439,8 +461,7 @@ int rtas_call(int token, int nargs, int nret, int *outputs, ...)
439 outputs[i] = rtas_args->rets[i+1]; 461 outputs[i] = rtas_args->rets[i+1];
440 ret = (nret > 0)? rtas_args->rets[0]: 0; 462 ret = (nret > 0)? rtas_args->rets[0]: 0;
441 463
442 /* Gotta do something different here, use global lock for now... */ 464 unlock_rtas(s);
443 spin_unlock_irqrestore(&rtas.lock, s);
444 465
445 if (buff_copy) { 466 if (buff_copy) {
446 log_error(buff_copy, ERR_TYPE_RTAS_LOG, 0); 467 log_error(buff_copy, ERR_TYPE_RTAS_LOG, 0);
@@ -837,7 +858,7 @@ asmlinkage int ppc_rtas(struct rtas_args __user *uargs)
837 858
838 buff_copy = get_errorlog_buffer(); 859 buff_copy = get_errorlog_buffer();
839 860
840 spin_lock_irqsave(&rtas.lock, flags); 861 flags = lock_rtas();
841 862
842 rtas.args = args; 863 rtas.args = args;
843 enter_rtas(__pa(&rtas.args)); 864 enter_rtas(__pa(&rtas.args));
@@ -848,7 +869,7 @@ asmlinkage int ppc_rtas(struct rtas_args __user *uargs)
848 if (args.rets[0] == -1) 869 if (args.rets[0] == -1)
849 errbuf = __fetch_rtas_last_error(buff_copy); 870 errbuf = __fetch_rtas_last_error(buff_copy);
850 871
851 spin_unlock_irqrestore(&rtas.lock, flags); 872 unlock_rtas(flags);
852 873
853 if (buff_copy) { 874 if (buff_copy) {
854 if (errbuf) 875 if (errbuf)
@@ -951,3 +972,33 @@ int __init early_init_dt_scan_rtas(unsigned long node,
951 /* break now */ 972 /* break now */
952 return 1; 973 return 1;
953} 974}
975
976static raw_spinlock_t timebase_lock;
977static u64 timebase = 0;
978
979void __cpuinit rtas_give_timebase(void)
980{
981 unsigned long flags;
982
983 local_irq_save(flags);
984 hard_irq_disable();
985 __raw_spin_lock(&timebase_lock);
986 rtas_call(rtas_token("freeze-time-base"), 0, 1, NULL);
987 timebase = get_tb();
988 __raw_spin_unlock(&timebase_lock);
989
990 while (timebase)
991 barrier();
992 rtas_call(rtas_token("thaw-time-base"), 0, 1, NULL);
993 local_irq_restore(flags);
994}
995
996void __cpuinit rtas_take_timebase(void)
997{
998 while (!timebase)
999 barrier();
1000 __raw_spin_lock(&timebase_lock);
1001 set_tb(timebase >> 32, timebase & 0xffffffff);
1002 timebase = 0;
1003 __raw_spin_unlock(&timebase_lock);
1004}
diff --git a/arch/powerpc/kernel/setup_32.c b/arch/powerpc/kernel/setup_32.c
index 1d154248cf40..e1e3059cf34b 100644
--- a/arch/powerpc/kernel/setup_32.c
+++ b/arch/powerpc/kernel/setup_32.c
@@ -119,6 +119,8 @@ notrace unsigned long __init early_init(unsigned long dt_ptr)
119 */ 119 */
120notrace void __init machine_init(unsigned long dt_ptr) 120notrace void __init machine_init(unsigned long dt_ptr)
121{ 121{
122 lockdep_init();
123
122 /* Enable early debugging if any specified (see udbg.h) */ 124 /* Enable early debugging if any specified (see udbg.h) */
123 udbg_early_init(); 125 udbg_early_init();
124 126
diff --git a/arch/powerpc/kernel/smp.c b/arch/powerpc/kernel/smp.c
index 65484b2200b3..0b47de07302d 100644
--- a/arch/powerpc/kernel/smp.c
+++ b/arch/powerpc/kernel/smp.c
@@ -68,7 +68,8 @@ EXPORT_PER_CPU_SYMBOL(cpu_core_map);
68/* SMP operations for this machine */ 68/* SMP operations for this machine */
69struct smp_ops_t *smp_ops; 69struct smp_ops_t *smp_ops;
70 70
71static volatile unsigned int cpu_callin_map[NR_CPUS]; 71/* Can't be static due to PowerMac hackery */
72volatile unsigned int cpu_callin_map[NR_CPUS];
72 73
73int smt_enabled_at_boot = 1; 74int smt_enabled_at_boot = 1;
74 75
diff --git a/arch/powerpc/kernel/udbg_16550.c b/arch/powerpc/kernel/udbg_16550.c
index 0362a891e54e..acb74a17bbbf 100644
--- a/arch/powerpc/kernel/udbg_16550.c
+++ b/arch/powerpc/kernel/udbg_16550.c
@@ -219,7 +219,7 @@ void udbg_init_pas_realmode(void)
219#ifdef CONFIG_PPC_EARLY_DEBUG_44x 219#ifdef CONFIG_PPC_EARLY_DEBUG_44x
220#include <platforms/44x/44x.h> 220#include <platforms/44x/44x.h>
221 221
222static int udbg_44x_as1_flush(void) 222static void udbg_44x_as1_flush(void)
223{ 223{
224 if (udbg_comport) { 224 if (udbg_comport) {
225 while ((as1_readb(&udbg_comport->lsr) & LSR_THRE) == 0) 225 while ((as1_readb(&udbg_comport->lsr) & LSR_THRE) == 0)
diff --git a/arch/powerpc/kernel/vector.S b/arch/powerpc/kernel/vector.S
index ef36cbbc5882..ea4d64644d02 100644
--- a/arch/powerpc/kernel/vector.S
+++ b/arch/powerpc/kernel/vector.S
@@ -80,10 +80,10 @@ _GLOBAL(load_up_altivec)
80 mtvscr vr0 80 mtvscr vr0
81 REST_32VRS(0,r4,r5) 81 REST_32VRS(0,r4,r5)
82#ifndef CONFIG_SMP 82#ifndef CONFIG_SMP
83 /* Update last_task_used_math to 'current' */ 83 /* Update last_task_used_altivec to 'current' */
84 subi r4,r5,THREAD /* Back to 'current' */ 84 subi r4,r5,THREAD /* Back to 'current' */
85 fromreal(r4) 85 fromreal(r4)
86 PPC_STL r4,ADDROFF(last_task_used_math)(r3) 86 PPC_STL r4,ADDROFF(last_task_used_altivec)(r3)
87#endif /* CONFIG_SMP */ 87#endif /* CONFIG_SMP */
88 /* restore registers and return */ 88 /* restore registers and return */
89 blr 89 blr
@@ -172,7 +172,7 @@ _GLOBAL(load_up_vsx)
172 oris r12,r12,MSR_VSX@h 172 oris r12,r12,MSR_VSX@h
173 std r12,_MSR(r1) 173 std r12,_MSR(r1)
174#ifndef CONFIG_SMP 174#ifndef CONFIG_SMP
175 /* Update last_task_used_math to 'current' */ 175 /* Update last_task_used_vsx to 'current' */
176 ld r4,PACACURRENT(r13) 176 ld r4,PACACURRENT(r13)
177 std r4,0(r3) 177 std r4,0(r3)
178#endif /* CONFIG_SMP */ 178#endif /* CONFIG_SMP */
diff --git a/arch/powerpc/mm/Makefile b/arch/powerpc/mm/Makefile
index 2d2192e48de7..3e68363405b7 100644
--- a/arch/powerpc/mm/Makefile
+++ b/arch/powerpc/mm/Makefile
@@ -30,3 +30,4 @@ obj-$(CONFIG_PPC_MM_SLICES) += slice.o
30obj-$(CONFIG_HUGETLB_PAGE) += hugetlbpage.o 30obj-$(CONFIG_HUGETLB_PAGE) += hugetlbpage.o
31obj-$(CONFIG_PPC_SUBPAGE_PROT) += subpage-prot.o 31obj-$(CONFIG_PPC_SUBPAGE_PROT) += subpage-prot.o
32obj-$(CONFIG_NOT_COHERENT_CACHE) += dma-noncoherent.o 32obj-$(CONFIG_NOT_COHERENT_CACHE) += dma-noncoherent.o
33obj-$(CONFIG_HIGHMEM) += highmem.o
diff --git a/arch/powerpc/mm/gup.c b/arch/powerpc/mm/gup.c
index bc400c78c97f..bc122a120bf0 100644
--- a/arch/powerpc/mm/gup.c
+++ b/arch/powerpc/mm/gup.c
@@ -159,7 +159,7 @@ int get_user_pages_fast(unsigned long start, int nr_pages, int write,
159 int psize; 159 int psize;
160#endif 160#endif
161 161
162 pr_debug("%s(%lx,%x,%s)\n", __func__, start, nr_pages, write ? "write" : "read"); 162 pr_devel("%s(%lx,%x,%s)\n", __func__, start, nr_pages, write ? "write" : "read");
163 163
164 start &= PAGE_MASK; 164 start &= PAGE_MASK;
165 addr = start; 165 addr = start;
@@ -170,7 +170,7 @@ int get_user_pages_fast(unsigned long start, int nr_pages, int write,
170 start, len))) 170 start, len)))
171 goto slow_irqon; 171 goto slow_irqon;
172 172
173 pr_debug(" aligned: %lx .. %lx\n", start, end); 173 pr_devel(" aligned: %lx .. %lx\n", start, end);
174 174
175#ifdef CONFIG_HUGETLB_PAGE 175#ifdef CONFIG_HUGETLB_PAGE
176 /* We bail out on slice boundary crossing when hugetlb is 176 /* We bail out on slice boundary crossing when hugetlb is
@@ -234,7 +234,7 @@ int get_user_pages_fast(unsigned long start, int nr_pages, int write,
234 do { 234 do {
235 VM_BUG_ON(shift != mmu_psize_defs[get_slice_psize(mm, a)].shift); 235 VM_BUG_ON(shift != mmu_psize_defs[get_slice_psize(mm, a)].shift);
236 ptep = huge_pte_offset(mm, a); 236 ptep = huge_pte_offset(mm, a);
237 pr_debug(" %016lx: huge ptep %p\n", a, ptep); 237 pr_devel(" %016lx: huge ptep %p\n", a, ptep);
238 if (!ptep || !gup_huge_pte(ptep, hstate, &a, end, write, pages, 238 if (!ptep || !gup_huge_pte(ptep, hstate, &a, end, write, pages,
239 &nr)) 239 &nr))
240 goto slow; 240 goto slow;
@@ -249,7 +249,7 @@ int get_user_pages_fast(unsigned long start, int nr_pages, int write,
249#ifdef CONFIG_PPC64 249#ifdef CONFIG_PPC64
250 VM_BUG_ON(shift != mmu_psize_defs[get_slice_psize(mm, addr)].shift); 250 VM_BUG_ON(shift != mmu_psize_defs[get_slice_psize(mm, addr)].shift);
251#endif 251#endif
252 pr_debug(" %016lx: normal pgd %p\n", addr, 252 pr_devel(" %016lx: normal pgd %p\n", addr,
253 (void *)pgd_val(pgd)); 253 (void *)pgd_val(pgd));
254 next = pgd_addr_end(addr, end); 254 next = pgd_addr_end(addr, end);
255 if (pgd_none(pgd)) 255 if (pgd_none(pgd))
@@ -269,7 +269,7 @@ int get_user_pages_fast(unsigned long start, int nr_pages, int write,
269slow: 269slow:
270 local_irq_enable(); 270 local_irq_enable();
271slow_irqon: 271slow_irqon:
272 pr_debug(" slow path ! nr = %d\n", nr); 272 pr_devel(" slow path ! nr = %d\n", nr);
273 273
274 /* Try to get the remaining pages with get_user_pages */ 274 /* Try to get the remaining pages with get_user_pages */
275 start += nr << PAGE_SHIFT; 275 start += nr << PAGE_SHIFT;
diff --git a/arch/powerpc/mm/highmem.c b/arch/powerpc/mm/highmem.c
new file mode 100644
index 000000000000..c2186c74c85a
--- /dev/null
+++ b/arch/powerpc/mm/highmem.c
@@ -0,0 +1,77 @@
1/*
2 * highmem.c: virtual kernel memory mappings for high memory
3 *
4 * PowerPC version, stolen from the i386 version.
5 *
6 * Used in CONFIG_HIGHMEM systems for memory pages which
7 * are not addressable by direct kernel virtual addresses.
8 *
9 * Copyright (C) 1999 Gerhard Wichert, Siemens AG
10 * Gerhard.Wichert@pdb.siemens.de
11 *
12 *
13 * Redesigned the x86 32-bit VM architecture to deal with
14 * up to 16 Terrabyte physical memory. With current x86 CPUs
15 * we now support up to 64 Gigabytes physical RAM.
16 *
17 * Copyright (C) 1999 Ingo Molnar <mingo@redhat.com>
18 *
19 * Reworked for PowerPC by various contributors. Moved from
20 * highmem.h by Benjamin Herrenschmidt (c) 2009 IBM Corp.
21 */
22
23#include <linux/highmem.h>
24#include <linux/module.h>
25
26/*
27 * The use of kmap_atomic/kunmap_atomic is discouraged - kmap/kunmap
28 * gives a more generic (and caching) interface. But kmap_atomic can
29 * be used in IRQ contexts, so in some (very limited) cases we need
30 * it.
31 */
32void *kmap_atomic_prot(struct page *page, enum km_type type, pgprot_t prot)
33{
34 unsigned int idx;
35 unsigned long vaddr;
36
37 /* even !CONFIG_PREEMPT needs this, for in_atomic in do_page_fault */
38 pagefault_disable();
39 if (!PageHighMem(page))
40 return page_address(page);
41
42 debug_kmap_atomic(type);
43 idx = type + KM_TYPE_NR*smp_processor_id();
44 vaddr = __fix_to_virt(FIX_KMAP_BEGIN + idx);
45#ifdef CONFIG_DEBUG_HIGHMEM
46 BUG_ON(!pte_none(*(kmap_pte-idx)));
47#endif
48 __set_pte_at(&init_mm, vaddr, kmap_pte-idx, mk_pte(page, prot), 1);
49 local_flush_tlb_page(NULL, vaddr);
50
51 return (void*) vaddr;
52}
53EXPORT_SYMBOL(kmap_atomic_prot);
54
55void kunmap_atomic(void *kvaddr, enum km_type type)
56{
57#ifdef CONFIG_DEBUG_HIGHMEM
58 unsigned long vaddr = (unsigned long) kvaddr & PAGE_MASK;
59 enum fixed_addresses idx = type + KM_TYPE_NR*smp_processor_id();
60
61 if (vaddr < __fix_to_virt(FIX_KMAP_END)) {
62 pagefault_enable();
63 return;
64 }
65
66 BUG_ON(vaddr != __fix_to_virt(FIX_KMAP_BEGIN + idx));
67
68 /*
69 * force other mappings to Oops if they'll try to access
70 * this pte without first remap it
71 */
72 pte_clear(&init_mm, vaddr, kmap_pte-idx);
73 local_flush_tlb_page(NULL, vaddr);
74#endif
75 pagefault_enable();
76}
77EXPORT_SYMBOL(kunmap_atomic);
diff --git a/arch/powerpc/mm/hugetlbpage.c b/arch/powerpc/mm/hugetlbpage.c
index 9920d6a7cf29..c46ef2ffa3d9 100644
--- a/arch/powerpc/mm/hugetlbpage.c
+++ b/arch/powerpc/mm/hugetlbpage.c
@@ -305,7 +305,7 @@ static void hugetlb_free_pmd_range(struct mmu_gather *tlb, pud_t *pud,
305 305
306 pmd = pmd_offset(pud, start); 306 pmd = pmd_offset(pud, start);
307 pud_clear(pud); 307 pud_clear(pud);
308 pmd_free_tlb(tlb, pmd); 308 pmd_free_tlb(tlb, pmd, start);
309} 309}
310 310
311static void hugetlb_free_pud_range(struct mmu_gather *tlb, pgd_t *pgd, 311static void hugetlb_free_pud_range(struct mmu_gather *tlb, pgd_t *pgd,
@@ -348,7 +348,7 @@ static void hugetlb_free_pud_range(struct mmu_gather *tlb, pgd_t *pgd,
348 348
349 pud = pud_offset(pgd, start); 349 pud = pud_offset(pgd, start);
350 pgd_clear(pgd); 350 pgd_clear(pgd);
351 pud_free_tlb(tlb, pud); 351 pud_free_tlb(tlb, pud, start);
352} 352}
353 353
354/* 354/*
diff --git a/arch/powerpc/mm/mmu_context_nohash.c b/arch/powerpc/mm/mmu_context_nohash.c
index 8343986809c0..b1a727def15b 100644
--- a/arch/powerpc/mm/mmu_context_nohash.c
+++ b/arch/powerpc/mm/mmu_context_nohash.c
@@ -89,7 +89,7 @@ static unsigned int steal_context_smp(unsigned int id)
89 id = first_context; 89 id = first_context;
90 continue; 90 continue;
91 } 91 }
92 pr_debug("[%d] steal context %d from mm @%p\n", 92 pr_devel("[%d] steal context %d from mm @%p\n",
93 smp_processor_id(), id, mm); 93 smp_processor_id(), id, mm);
94 94
95 /* Mark this mm has having no context anymore */ 95 /* Mark this mm has having no context anymore */
@@ -126,7 +126,7 @@ static unsigned int steal_context_up(unsigned int id)
126 /* Pick up the victim mm */ 126 /* Pick up the victim mm */
127 mm = context_mm[id]; 127 mm = context_mm[id];
128 128
129 pr_debug("[%d] steal context %d from mm @%p\n", cpu, id, mm); 129 pr_devel("[%d] steal context %d from mm @%p\n", cpu, id, mm);
130 130
131 /* Flush the TLB for that context */ 131 /* Flush the TLB for that context */
132 local_flush_tlb_mm(mm); 132 local_flush_tlb_mm(mm);
@@ -180,7 +180,7 @@ void switch_mmu_context(struct mm_struct *prev, struct mm_struct *next)
180 spin_lock(&context_lock); 180 spin_lock(&context_lock);
181 181
182#ifndef DEBUG_STEAL_ONLY 182#ifndef DEBUG_STEAL_ONLY
183 pr_debug("[%d] activating context for mm @%p, active=%d, id=%d\n", 183 pr_devel("[%d] activating context for mm @%p, active=%d, id=%d\n",
184 cpu, next, next->context.active, next->context.id); 184 cpu, next, next->context.active, next->context.id);
185#endif 185#endif
186 186
@@ -189,7 +189,7 @@ void switch_mmu_context(struct mm_struct *prev, struct mm_struct *next)
189 next->context.active++; 189 next->context.active++;
190 if (prev) { 190 if (prev) {
191#ifndef DEBUG_STEAL_ONLY 191#ifndef DEBUG_STEAL_ONLY
192 pr_debug(" old context %p active was: %d\n", 192 pr_devel(" old context %p active was: %d\n",
193 prev, prev->context.active); 193 prev, prev->context.active);
194#endif 194#endif
195 WARN_ON(prev->context.active < 1); 195 WARN_ON(prev->context.active < 1);
@@ -217,6 +217,7 @@ void switch_mmu_context(struct mm_struct *prev, struct mm_struct *next)
217 id = steal_context_smp(id); 217 id = steal_context_smp(id);
218 if (id == MMU_NO_CONTEXT) 218 if (id == MMU_NO_CONTEXT)
219 goto again; 219 goto again;
220 goto stolen;
220 } 221 }
221#endif /* CONFIG_SMP */ 222#endif /* CONFIG_SMP */
222 id = steal_context_up(id); 223 id = steal_context_up(id);
@@ -236,7 +237,7 @@ void switch_mmu_context(struct mm_struct *prev, struct mm_struct *next)
236 next->context.id = id; 237 next->context.id = id;
237 238
238#ifndef DEBUG_STEAL_ONLY 239#ifndef DEBUG_STEAL_ONLY
239 pr_debug("[%d] picked up new id %d, nrf is now %d\n", 240 pr_devel("[%d] picked up new id %d, nrf is now %d\n",
240 cpu, id, nr_free_contexts); 241 cpu, id, nr_free_contexts);
241#endif 242#endif
242 243
@@ -247,7 +248,7 @@ void switch_mmu_context(struct mm_struct *prev, struct mm_struct *next)
247 * local TLB for it and unmark it before we use it 248 * local TLB for it and unmark it before we use it
248 */ 249 */
249 if (test_bit(id, stale_map[cpu])) { 250 if (test_bit(id, stale_map[cpu])) {
250 pr_debug("[%d] flushing stale context %d for mm @%p !\n", 251 pr_devel("[%d] flushing stale context %d for mm @%p !\n",
251 cpu, id, next); 252 cpu, id, next);
252 local_flush_tlb_mm(next); 253 local_flush_tlb_mm(next);
253 254
@@ -314,13 +315,13 @@ static int __cpuinit mmu_context_cpu_notify(struct notifier_block *self,
314 switch (action) { 315 switch (action) {
315 case CPU_ONLINE: 316 case CPU_ONLINE:
316 case CPU_ONLINE_FROZEN: 317 case CPU_ONLINE_FROZEN:
317 pr_debug("MMU: Allocating stale context map for CPU %d\n", cpu); 318 pr_devel("MMU: Allocating stale context map for CPU %d\n", cpu);
318 stale_map[cpu] = kzalloc(CTX_MAP_SIZE, GFP_KERNEL); 319 stale_map[cpu] = kzalloc(CTX_MAP_SIZE, GFP_KERNEL);
319 break; 320 break;
320#ifdef CONFIG_HOTPLUG_CPU 321#ifdef CONFIG_HOTPLUG_CPU
321 case CPU_DEAD: 322 case CPU_DEAD:
322 case CPU_DEAD_FROZEN: 323 case CPU_DEAD_FROZEN:
323 pr_debug("MMU: Freeing stale context map for CPU %d\n", cpu); 324 pr_devel("MMU: Freeing stale context map for CPU %d\n", cpu);
324 kfree(stale_map[cpu]); 325 kfree(stale_map[cpu]);
325 stale_map[cpu] = NULL; 326 stale_map[cpu] = NULL;
326 break; 327 break;
diff --git a/arch/powerpc/mm/pgtable.c b/arch/powerpc/mm/pgtable.c
index ae1d67cc090c..627767d6169b 100644
--- a/arch/powerpc/mm/pgtable.c
+++ b/arch/powerpc/mm/pgtable.c
@@ -129,12 +129,12 @@ static pte_t do_dcache_icache_coherency(pte_t pte)
129 page = pfn_to_page(pfn); 129 page = pfn_to_page(pfn);
130 130
131 if (!PageReserved(page) && !test_bit(PG_arch_1, &page->flags)) { 131 if (!PageReserved(page) && !test_bit(PG_arch_1, &page->flags)) {
132 pr_debug("do_dcache_icache_coherency... flushing\n"); 132 pr_devel("do_dcache_icache_coherency... flushing\n");
133 flush_dcache_icache_page(page); 133 flush_dcache_icache_page(page);
134 set_bit(PG_arch_1, &page->flags); 134 set_bit(PG_arch_1, &page->flags);
135 } 135 }
136 else 136 else
137 pr_debug("do_dcache_icache_coherency... already clean\n"); 137 pr_devel("do_dcache_icache_coherency... already clean\n");
138 return __pte(pte_val(pte) | _PAGE_HWEXEC); 138 return __pte(pte_val(pte) | _PAGE_HWEXEC);
139} 139}
140 140
diff --git a/arch/powerpc/mm/slb.c b/arch/powerpc/mm/slb.c
index 3b52c80e5e33..5b7038f248b6 100644
--- a/arch/powerpc/mm/slb.c
+++ b/arch/powerpc/mm/slb.c
@@ -14,8 +14,6 @@
14 * 2 of the License, or (at your option) any later version. 14 * 2 of the License, or (at your option) any later version.
15 */ 15 */
16 16
17#undef DEBUG
18
19#include <asm/pgtable.h> 17#include <asm/pgtable.h>
20#include <asm/mmu.h> 18#include <asm/mmu.h>
21#include <asm/mmu_context.h> 19#include <asm/mmu_context.h>
@@ -27,11 +25,6 @@
27#include <linux/compiler.h> 25#include <linux/compiler.h>
28#include <asm/udbg.h> 26#include <asm/udbg.h>
29 27
30#ifdef DEBUG
31#define DBG(fmt...) printk(fmt)
32#else
33#define DBG pr_debug
34#endif
35 28
36extern void slb_allocate_realmode(unsigned long ea); 29extern void slb_allocate_realmode(unsigned long ea);
37extern void slb_allocate_user(unsigned long ea); 30extern void slb_allocate_user(unsigned long ea);
@@ -285,13 +278,13 @@ void slb_initialize(void)
285 patch_slb_encoding(slb_compare_rr_to_size, 278 patch_slb_encoding(slb_compare_rr_to_size,
286 mmu_slb_size); 279 mmu_slb_size);
287 280
288 DBG("SLB: linear LLP = %04lx\n", linear_llp); 281 pr_devel("SLB: linear LLP = %04lx\n", linear_llp);
289 DBG("SLB: io LLP = %04lx\n", io_llp); 282 pr_devel("SLB: io LLP = %04lx\n", io_llp);
290 283
291#ifdef CONFIG_SPARSEMEM_VMEMMAP 284#ifdef CONFIG_SPARSEMEM_VMEMMAP
292 patch_slb_encoding(slb_miss_kernel_load_vmemmap, 285 patch_slb_encoding(slb_miss_kernel_load_vmemmap,
293 SLB_VSID_KERNEL | vmemmap_llp); 286 SLB_VSID_KERNEL | vmemmap_llp);
294 DBG("SLB: vmemmap LLP = %04lx\n", vmemmap_llp); 287 pr_devel("SLB: vmemmap LLP = %04lx\n", vmemmap_llp);
295#endif 288#endif
296 } 289 }
297 290
diff --git a/arch/powerpc/mm/tlb_hash64.c b/arch/powerpc/mm/tlb_hash64.c
index 1be1b5e59796..937eb90677d9 100644
--- a/arch/powerpc/mm/tlb_hash64.c
+++ b/arch/powerpc/mm/tlb_hash64.c
@@ -72,7 +72,7 @@ void hpte_need_flush(struct mm_struct *mm, unsigned long addr,
72 */ 72 */
73 if (huge) { 73 if (huge) {
74#ifdef CONFIG_HUGETLB_PAGE 74#ifdef CONFIG_HUGETLB_PAGE
75 psize = get_slice_psize(mm, addr);; 75 psize = get_slice_psize(mm, addr);
76#else 76#else
77 BUG(); 77 BUG();
78 psize = pte_pagesize_index(mm, addr, pte); /* shutup gcc */ 78 psize = pte_pagesize_index(mm, addr, pte); /* shutup gcc */
diff --git a/arch/powerpc/oprofile/cell/vma_map.c b/arch/powerpc/oprofile/cell/vma_map.c
index 258fa4411e9e..c591339daf58 100644
--- a/arch/powerpc/oprofile/cell/vma_map.c
+++ b/arch/powerpc/oprofile/cell/vma_map.c
@@ -185,7 +185,7 @@ struct vma_to_fileoffset_map *create_vma_map(const struct spu *aSpu,
185 goto fail; 185 goto fail;
186 186
187 if (shdr_str.sh_type != SHT_STRTAB) 187 if (shdr_str.sh_type != SHT_STRTAB)
188 goto fail;; 188 goto fail;
189 189
190 for (j = 0; j < shdr.sh_size / sizeof (sym); j++) { 190 for (j = 0; j < shdr.sh_size / sizeof (sym); j++) {
191 if (copy_from_user(&sym, spu_elf_start + 191 if (copy_from_user(&sym, spu_elf_start +
diff --git a/arch/powerpc/platforms/44x/warp.c b/arch/powerpc/platforms/44x/warp.c
index 42e09a9f77e2..e5c1b096c3e1 100644
--- a/arch/powerpc/platforms/44x/warp.c
+++ b/arch/powerpc/platforms/44x/warp.c
@@ -16,6 +16,7 @@
16#include <linux/interrupt.h> 16#include <linux/interrupt.h>
17#include <linux/delay.h> 17#include <linux/delay.h>
18#include <linux/of_gpio.h> 18#include <linux/of_gpio.h>
19#include <linux/of_i2c.h>
19 20
20#include <asm/machdep.h> 21#include <asm/machdep.h>
21#include <asm/prom.h> 22#include <asm/prom.h>
@@ -63,9 +64,6 @@ define_machine(warp) {
63}; 64};
64 65
65 66
66static u32 post_info;
67
68/* I am not sure this is the best place for this... */
69static int __init warp_post_info(void) 67static int __init warp_post_info(void)
70{ 68{
71 struct device_node *np; 69 struct device_node *np;
@@ -87,10 +85,9 @@ static int __init warp_post_info(void)
87 85
88 iounmap(fpga); 86 iounmap(fpga);
89 87
90 if (post1 || post2) { 88 if (post1 || post2)
91 printk(KERN_INFO "Warp POST %08x %08x\n", post1, post2); 89 printk(KERN_INFO "Warp POST %08x %08x\n", post1, post2);
92 post_info = 1; 90 else
93 } else
94 printk(KERN_INFO "Warp POST OK\n"); 91 printk(KERN_INFO "Warp POST OK\n");
95 92
96 return 0; 93 return 0;
@@ -166,6 +163,9 @@ static irqreturn_t temp_isr(int irq, void *context)
166 value ^= 1; 163 value ^= 1;
167 mdelay(500); 164 mdelay(500);
168 } 165 }
166
167 /* Not reached */
168 return IRQ_HANDLED;
169} 169}
170 170
171static int pika_setup_leds(void) 171static int pika_setup_leds(void)
@@ -179,24 +179,19 @@ static int pika_setup_leds(void)
179 } 179 }
180 180
181 for_each_child_of_node(np, child) 181 for_each_child_of_node(np, child)
182 if (strcmp(child->name, "green") == 0) { 182 if (strcmp(child->name, "green") == 0)
183 green_led = of_get_gpio(child, 0); 183 green_led = of_get_gpio(child, 0);
184 /* Turn back on the green LED */ 184 else if (strcmp(child->name, "red") == 0)
185 gpio_set_value(green_led, 1);
186 } else if (strcmp(child->name, "red") == 0) {
187 red_led = of_get_gpio(child, 0); 185 red_led = of_get_gpio(child, 0);
188 /* Set based on post */
189 gpio_set_value(red_led, post_info);
190 }
191 186
192 of_node_put(np); 187 of_node_put(np);
193 188
194 return 0; 189 return 0;
195} 190}
196 191
197static void pika_setup_critical_temp(struct i2c_client *client) 192static void pika_setup_critical_temp(struct device_node *np,
193 struct i2c_client *client)
198{ 194{
199 struct device_node *np;
200 int irq, rc; 195 int irq, rc;
201 196
202 /* Do this before enabling critical temp interrupt since we 197 /* Do this before enabling critical temp interrupt since we
@@ -208,14 +203,7 @@ static void pika_setup_critical_temp(struct i2c_client *client)
208 i2c_smbus_write_byte_data(client, 2, 65); /* Thigh */ 203 i2c_smbus_write_byte_data(client, 2, 65); /* Thigh */
209 i2c_smbus_write_byte_data(client, 3, 0); /* Tlow */ 204 i2c_smbus_write_byte_data(client, 3, 0); /* Tlow */
210 205
211 np = of_find_compatible_node(NULL, NULL, "adi,ad7414");
212 if (np == NULL) {
213 printk(KERN_ERR __FILE__ ": Unable to find ad7414\n");
214 return;
215 }
216
217 irq = irq_of_parse_and_map(np, 0); 206 irq = irq_of_parse_and_map(np, 0);
218 of_node_put(np);
219 if (irq == NO_IRQ) { 207 if (irq == NO_IRQ) {
220 printk(KERN_ERR __FILE__ ": Unable to get ad7414 irq\n"); 208 printk(KERN_ERR __FILE__ ": Unable to get ad7414 irq\n");
221 return; 209 return;
@@ -244,32 +232,24 @@ static inline void pika_dtm_check_fan(void __iomem *fpga)
244 232
245static int pika_dtm_thread(void __iomem *fpga) 233static int pika_dtm_thread(void __iomem *fpga)
246{ 234{
247 struct i2c_adapter *adap; 235 struct device_node *np;
248 struct i2c_client *client; 236 struct i2c_client *client;
249 237
250 /* We loop in case either driver was compiled as a module and 238 np = of_find_compatible_node(NULL, NULL, "adi,ad7414");
251 * has not been insmoded yet. 239 if (np == NULL)
252 */ 240 return -ENOENT;
253 while (!(adap = i2c_get_adapter(0))) {
254 set_current_state(TASK_INTERRUPTIBLE);
255 schedule_timeout(HZ);
256 }
257
258 while (1) {
259 list_for_each_entry(client, &adap->clients, list)
260 if (client->addr == 0x4a)
261 goto found_it;
262 241
263 set_current_state(TASK_INTERRUPTIBLE); 242 client = of_find_i2c_device_by_node(np);
264 schedule_timeout(HZ); 243 if (client == NULL) {
244 of_node_put(np);
245 return -ENOENT;
265 } 246 }
266 247
267found_it: 248 pika_setup_critical_temp(np, client);
268 pika_setup_critical_temp(client);
269 249
270 i2c_put_adapter(adap); 250 of_node_put(np);
271 251
272 printk(KERN_INFO "PIKA DTM thread running.\n"); 252 printk(KERN_INFO "Warp DTM thread running.\n");
273 253
274 while (!kthread_should_stop()) { 254 while (!kthread_should_stop()) {
275 int val; 255 int val;
@@ -291,7 +271,6 @@ found_it:
291 return 0; 271 return 0;
292} 272}
293 273
294
295static int __init pika_dtm_start(void) 274static int __init pika_dtm_start(void)
296{ 275{
297 struct task_struct *dtm_thread; 276 struct task_struct *dtm_thread;
diff --git a/arch/powerpc/platforms/82xx/pq2ads-pci-pic.c b/arch/powerpc/platforms/82xx/pq2ads-pci-pic.c
index ddf0bdc0fc8b..7ee979f323d1 100644
--- a/arch/powerpc/platforms/82xx/pq2ads-pci-pic.c
+++ b/arch/powerpc/platforms/82xx/pq2ads-pci-pic.c
@@ -147,7 +147,7 @@ int __init pq2ads_pci_init_irq(void)
147 goto out; 147 goto out;
148 } 148 }
149 149
150 priv = alloc_bootmem(sizeof(struct pq2ads_pci_pic)); 150 priv = kzalloc(sizeof(*priv), GFP_KERNEL);
151 if (!priv) { 151 if (!priv) {
152 of_node_put(np); 152 of_node_put(np);
153 ret = -ENOMEM; 153 ret = -ENOMEM;
diff --git a/arch/powerpc/platforms/85xx/mpc85xx_mds.c b/arch/powerpc/platforms/85xx/mpc85xx_mds.c
index 77f90b356356..bfb32834ab0c 100644
--- a/arch/powerpc/platforms/85xx/mpc85xx_mds.c
+++ b/arch/powerpc/platforms/85xx/mpc85xx_mds.c
@@ -233,6 +233,19 @@ static void __init mpc85xx_mds_setup_arch(void)
233 /* Turn UCC1 & UCC2 on */ 233 /* Turn UCC1 & UCC2 on */
234 setbits8(&bcsr_regs[8], BCSR_UCC1_GETH_EN); 234 setbits8(&bcsr_regs[8], BCSR_UCC1_GETH_EN);
235 setbits8(&bcsr_regs[9], BCSR_UCC2_GETH_EN); 235 setbits8(&bcsr_regs[9], BCSR_UCC2_GETH_EN);
236 } else if (machine_is(mpc8569_mds)) {
237#define BCSR7_UCC12_GETHnRST (0x1 << 2)
238#define BCSR8_UEM_MARVELL_RST (0x1 << 1)
239 /*
240 * U-Boot mangles interrupt polarity for Marvell PHYs,
241 * so reset built-in and UEM Marvell PHYs, this puts
242 * the PHYs into their normal state.
243 */
244 clrbits8(&bcsr_regs[7], BCSR7_UCC12_GETHnRST);
245 setbits8(&bcsr_regs[8], BCSR8_UEM_MARVELL_RST);
246
247 setbits8(&bcsr_regs[7], BCSR7_UCC12_GETHnRST);
248 clrbits8(&bcsr_regs[8], BCSR8_UEM_MARVELL_RST);
236 } 249 }
237 iounmap(bcsr_regs); 250 iounmap(bcsr_regs);
238 } 251 }
@@ -285,6 +298,7 @@ static struct of_device_id mpc85xx_ids[] = {
285 { .type = "qe", }, 298 { .type = "qe", },
286 { .compatible = "fsl,qe", }, 299 { .compatible = "fsl,qe", },
287 { .compatible = "gianfar", }, 300 { .compatible = "gianfar", },
301 { .compatible = "fsl,rapidio-delta", },
288 {}, 302 {},
289}; 303};
290 304
diff --git a/arch/powerpc/platforms/85xx/smp.c b/arch/powerpc/platforms/85xx/smp.c
index cc0b0db8a6f3..62c592ede641 100644
--- a/arch/powerpc/platforms/85xx/smp.c
+++ b/arch/powerpc/platforms/85xx/smp.c
@@ -52,20 +52,19 @@ smp_85xx_kick_cpu(int nr)
52 52
53 pr_debug("smp_85xx_kick_cpu: kick CPU #%d\n", nr); 53 pr_debug("smp_85xx_kick_cpu: kick CPU #%d\n", nr);
54 54
55 local_irq_save(flags);
56
57 np = of_get_cpu_node(nr, NULL); 55 np = of_get_cpu_node(nr, NULL);
58 cpu_rel_addr = of_get_property(np, "cpu-release-addr", NULL); 56 cpu_rel_addr = of_get_property(np, "cpu-release-addr", NULL);
59 57
60 if (cpu_rel_addr == NULL) { 58 if (cpu_rel_addr == NULL) {
61 printk(KERN_ERR "No cpu-release-addr for cpu %d\n", nr); 59 printk(KERN_ERR "No cpu-release-addr for cpu %d\n", nr);
62 local_irq_restore(flags);
63 return; 60 return;
64 } 61 }
65 62
66 /* Map the spin table */ 63 /* Map the spin table */
67 bptr_vaddr = ioremap(*cpu_rel_addr, SIZE_BOOT_ENTRY); 64 bptr_vaddr = ioremap(*cpu_rel_addr, SIZE_BOOT_ENTRY);
68 65
66 local_irq_save(flags);
67
69 out_be32(bptr_vaddr + BOOT_ENTRY_PIR, nr); 68 out_be32(bptr_vaddr + BOOT_ENTRY_PIR, nr);
70 out_be32(bptr_vaddr + BOOT_ENTRY_ADDR_LOWER, __pa(__early_start)); 69 out_be32(bptr_vaddr + BOOT_ENTRY_ADDR_LOWER, __pa(__early_start));
71 70
@@ -73,10 +72,10 @@ smp_85xx_kick_cpu(int nr)
73 while ((__secondary_hold_acknowledge != nr) && (++n < 1000)) 72 while ((__secondary_hold_acknowledge != nr) && (++n < 1000))
74 mdelay(1); 73 mdelay(1);
75 74
76 iounmap(bptr_vaddr);
77
78 local_irq_restore(flags); 75 local_irq_restore(flags);
79 76
77 iounmap(bptr_vaddr);
78
80 pr_debug("waited %d msecs for CPU #%d.\n", n, nr); 79 pr_debug("waited %d msecs for CPU #%d.\n", n, nr);
81} 80}
82 81
diff --git a/arch/powerpc/platforms/85xx/socrates.c b/arch/powerpc/platforms/85xx/socrates.c
index d0e8443b12c6..747d8fb3ab82 100644
--- a/arch/powerpc/platforms/85xx/socrates.c
+++ b/arch/powerpc/platforms/85xx/socrates.c
@@ -102,10 +102,11 @@ static struct of_device_id __initdata socrates_of_bus_ids[] = {
102 {}, 102 {},
103}; 103};
104 104
105static void __init socrates_init(void) 105static int __init socrates_publish_devices(void)
106{ 106{
107 of_platform_bus_probe(NULL, socrates_of_bus_ids, NULL); 107 return of_platform_bus_probe(NULL, socrates_of_bus_ids, NULL);
108} 108}
109machine_device_initcall(socrates, socrates_publish_devices);
109 110
110/* 111/*
111 * Called very early, device-tree isn't unflattened 112 * Called very early, device-tree isn't unflattened
@@ -124,7 +125,6 @@ define_machine(socrates) {
124 .name = "Socrates", 125 .name = "Socrates",
125 .probe = socrates_probe, 126 .probe = socrates_probe,
126 .setup_arch = socrates_setup_arch, 127 .setup_arch = socrates_setup_arch,
127 .init = socrates_init,
128 .init_IRQ = socrates_pic_init, 128 .init_IRQ = socrates_pic_init,
129 .get_irq = mpic_get_irq, 129 .get_irq = mpic_get_irq,
130 .restart = fsl_rstcr_restart, 130 .restart = fsl_rstcr_restart,
diff --git a/arch/powerpc/platforms/85xx/xes_mpc85xx.c b/arch/powerpc/platforms/85xx/xes_mpc85xx.c
index ee01532786e4..1b426050a2f9 100644
--- a/arch/powerpc/platforms/85xx/xes_mpc85xx.c
+++ b/arch/powerpc/platforms/85xx/xes_mpc85xx.c
@@ -32,7 +32,6 @@
32 32
33#include <sysdev/fsl_soc.h> 33#include <sysdev/fsl_soc.h>
34#include <sysdev/fsl_pci.h> 34#include <sysdev/fsl_pci.h>
35#include <linux/of_platform.h>
36 35
37/* A few bit definitions needed for fixups on some boards */ 36/* A few bit definitions needed for fixups on some boards */
38#define MPC85xx_L2CTL_L2E 0x80000000 /* L2 enable */ 37#define MPC85xx_L2CTL_L2E 0x80000000 /* L2 enable */
diff --git a/arch/powerpc/platforms/cell/axon_msi.c b/arch/powerpc/platforms/cell/axon_msi.c
index c71498dbf211..aca5741ddc67 100644
--- a/arch/powerpc/platforms/cell/axon_msi.c
+++ b/arch/powerpc/platforms/cell/axon_msi.c
@@ -85,7 +85,7 @@ static inline void axon_msi_debug_setup(struct device_node *dn,
85 85
86static void msic_dcr_write(struct axon_msic *msic, unsigned int dcr_n, u32 val) 86static void msic_dcr_write(struct axon_msic *msic, unsigned int dcr_n, u32 val)
87{ 87{
88 pr_debug("axon_msi: dcr_write(0x%x, 0x%x)\n", val, dcr_n); 88 pr_devel("axon_msi: dcr_write(0x%x, 0x%x)\n", val, dcr_n);
89 89
90 dcr_write(msic->dcr_host, dcr_n, val); 90 dcr_write(msic->dcr_host, dcr_n, val);
91} 91}
@@ -98,7 +98,7 @@ static void axon_msi_cascade(unsigned int irq, struct irq_desc *desc)
98 int retry = 0; 98 int retry = 0;
99 99
100 write_offset = dcr_read(msic->dcr_host, MSIC_WRITE_OFFSET_REG); 100 write_offset = dcr_read(msic->dcr_host, MSIC_WRITE_OFFSET_REG);
101 pr_debug("axon_msi: original write_offset 0x%x\n", write_offset); 101 pr_devel("axon_msi: original write_offset 0x%x\n", write_offset);
102 102
103 /* write_offset doesn't wrap properly, so we have to mask it */ 103 /* write_offset doesn't wrap properly, so we have to mask it */
104 write_offset &= MSIC_FIFO_SIZE_MASK; 104 write_offset &= MSIC_FIFO_SIZE_MASK;
@@ -108,7 +108,7 @@ static void axon_msi_cascade(unsigned int irq, struct irq_desc *desc)
108 msi = le32_to_cpu(msic->fifo_virt[idx]); 108 msi = le32_to_cpu(msic->fifo_virt[idx]);
109 msi &= 0xFFFF; 109 msi &= 0xFFFF;
110 110
111 pr_debug("axon_msi: woff %x roff %x msi %x\n", 111 pr_devel("axon_msi: woff %x roff %x msi %x\n",
112 write_offset, msic->read_offset, msi); 112 write_offset, msic->read_offset, msi);
113 113
114 if (msi < NR_IRQS && irq_map[msi].host == msic->irq_host) { 114 if (msi < NR_IRQS && irq_map[msi].host == msic->irq_host) {
@@ -123,12 +123,12 @@ static void axon_msi_cascade(unsigned int irq, struct irq_desc *desc)
123 */ 123 */
124 udelay(1); 124 udelay(1);
125 retry++; 125 retry++;
126 pr_debug("axon_msi: invalid irq 0x%x!\n", msi); 126 pr_devel("axon_msi: invalid irq 0x%x!\n", msi);
127 continue; 127 continue;
128 } 128 }
129 129
130 if (retry) { 130 if (retry) {
131 pr_debug("axon_msi: late irq 0x%x, retry %d\n", 131 pr_devel("axon_msi: late irq 0x%x, retry %d\n",
132 msi, retry); 132 msi, retry);
133 retry = 0; 133 retry = 0;
134 } 134 }
@@ -332,7 +332,7 @@ static int axon_msi_shutdown(struct of_device *device)
332 struct axon_msic *msic = dev_get_drvdata(&device->dev); 332 struct axon_msic *msic = dev_get_drvdata(&device->dev);
333 u32 tmp; 333 u32 tmp;
334 334
335 pr_debug("axon_msi: disabling %s\n", 335 pr_devel("axon_msi: disabling %s\n",
336 msic->irq_host->of_node->full_name); 336 msic->irq_host->of_node->full_name);
337 tmp = dcr_read(msic->dcr_host, MSIC_CTRL_REG); 337 tmp = dcr_read(msic->dcr_host, MSIC_CTRL_REG);
338 tmp &= ~MSIC_CTRL_ENABLE & ~MSIC_CTRL_IRQ_ENABLE; 338 tmp &= ~MSIC_CTRL_ENABLE & ~MSIC_CTRL_IRQ_ENABLE;
@@ -349,7 +349,7 @@ static int axon_msi_probe(struct of_device *device,
349 unsigned int virq; 349 unsigned int virq;
350 int dcr_base, dcr_len; 350 int dcr_base, dcr_len;
351 351
352 pr_debug("axon_msi: setting up dn %s\n", dn->full_name); 352 pr_devel("axon_msi: setting up dn %s\n", dn->full_name);
353 353
354 msic = kzalloc(sizeof(struct axon_msic), GFP_KERNEL); 354 msic = kzalloc(sizeof(struct axon_msic), GFP_KERNEL);
355 if (!msic) { 355 if (!msic) {
@@ -403,7 +403,7 @@ static int axon_msi_probe(struct of_device *device,
403 403
404 set_irq_data(virq, msic); 404 set_irq_data(virq, msic);
405 set_irq_chained_handler(virq, axon_msi_cascade); 405 set_irq_chained_handler(virq, axon_msi_cascade);
406 pr_debug("axon_msi: irq 0x%x setup for axon_msi\n", virq); 406 pr_devel("axon_msi: irq 0x%x setup for axon_msi\n", virq);
407 407
408 /* Enable the MSIC hardware */ 408 /* Enable the MSIC hardware */
409 msic_dcr_write(msic, MSIC_BASE_ADDR_HI_REG, msic->fifo_phys >> 32); 409 msic_dcr_write(msic, MSIC_BASE_ADDR_HI_REG, msic->fifo_phys >> 32);
@@ -484,13 +484,13 @@ void axon_msi_debug_setup(struct device_node *dn, struct axon_msic *msic)
484 484
485 addr = of_translate_address(dn, of_get_property(dn, "reg", NULL)); 485 addr = of_translate_address(dn, of_get_property(dn, "reg", NULL));
486 if (addr == OF_BAD_ADDR) { 486 if (addr == OF_BAD_ADDR) {
487 pr_debug("axon_msi: couldn't translate reg property\n"); 487 pr_devel("axon_msi: couldn't translate reg property\n");
488 return; 488 return;
489 } 489 }
490 490
491 msic->trigger = ioremap(addr, 0x4); 491 msic->trigger = ioremap(addr, 0x4);
492 if (!msic->trigger) { 492 if (!msic->trigger) {
493 pr_debug("axon_msi: ioremap failed\n"); 493 pr_devel("axon_msi: ioremap failed\n");
494 return; 494 return;
495 } 495 }
496 496
@@ -498,7 +498,7 @@ void axon_msi_debug_setup(struct device_node *dn, struct axon_msic *msic)
498 498
499 if (!debugfs_create_file(name, 0600, powerpc_debugfs_root, 499 if (!debugfs_create_file(name, 0600, powerpc_debugfs_root,
500 msic, &fops_msic)) { 500 msic, &fops_msic)) {
501 pr_debug("axon_msi: debugfs_create_file failed!\n"); 501 pr_devel("axon_msi: debugfs_create_file failed!\n");
502 return; 502 return;
503 } 503 }
504} 504}
diff --git a/arch/powerpc/platforms/cell/smp.c b/arch/powerpc/platforms/cell/smp.c
index 9046803c8276..bc97fada48c6 100644
--- a/arch/powerpc/platforms/cell/smp.c
+++ b/arch/powerpc/platforms/cell/smp.c
@@ -36,7 +36,6 @@
36#include <asm/prom.h> 36#include <asm/prom.h>
37#include <asm/smp.h> 37#include <asm/smp.h>
38#include <asm/paca.h> 38#include <asm/paca.h>
39#include <asm/time.h>
40#include <asm/machdep.h> 39#include <asm/machdep.h>
41#include <asm/cputable.h> 40#include <asm/cputable.h>
42#include <asm/firmware.h> 41#include <asm/firmware.h>
@@ -140,31 +139,6 @@ static void __devinit smp_cell_setup_cpu(int cpu)
140 mtspr(SPRN_DABRX, DABRX_KERNEL | DABRX_USER); 139 mtspr(SPRN_DABRX, DABRX_KERNEL | DABRX_USER);
141} 140}
142 141
143static DEFINE_SPINLOCK(timebase_lock);
144static unsigned long timebase = 0;
145
146static void __devinit cell_give_timebase(void)
147{
148 spin_lock(&timebase_lock);
149 rtas_call(rtas_token("freeze-time-base"), 0, 1, NULL);
150 timebase = get_tb();
151 spin_unlock(&timebase_lock);
152
153 while (timebase)
154 barrier();
155 rtas_call(rtas_token("thaw-time-base"), 0, 1, NULL);
156}
157
158static void __devinit cell_take_timebase(void)
159{
160 while (!timebase)
161 barrier();
162 spin_lock(&timebase_lock);
163 set_tb(timebase >> 32, timebase & 0xffffffff);
164 timebase = 0;
165 spin_unlock(&timebase_lock);
166}
167
168static void __devinit smp_cell_kick_cpu(int nr) 142static void __devinit smp_cell_kick_cpu(int nr)
169{ 143{
170 BUG_ON(nr < 0 || nr >= NR_CPUS); 144 BUG_ON(nr < 0 || nr >= NR_CPUS);
@@ -224,8 +198,8 @@ void __init smp_init_cell(void)
224 198
225 /* Non-lpar has additional take/give timebase */ 199 /* Non-lpar has additional take/give timebase */
226 if (rtas_token("freeze-time-base") != RTAS_UNKNOWN_SERVICE) { 200 if (rtas_token("freeze-time-base") != RTAS_UNKNOWN_SERVICE) {
227 smp_ops->give_timebase = cell_give_timebase; 201 smp_ops->give_timebase = rtas_give_timebase;
228 smp_ops->take_timebase = cell_take_timebase; 202 smp_ops->take_timebase = rtas_take_timebase;
229 } 203 }
230 204
231 DBG(" <- smp_init_cell()\n"); 205 DBG(" <- smp_init_cell()\n");
diff --git a/arch/powerpc/platforms/chrp/smp.c b/arch/powerpc/platforms/chrp/smp.c
index 10a4a4d063b6..02cafecc90e3 100644
--- a/arch/powerpc/platforms/chrp/smp.c
+++ b/arch/powerpc/platforms/chrp/smp.c
@@ -26,7 +26,6 @@
26#include <asm/io.h> 26#include <asm/io.h>
27#include <asm/prom.h> 27#include <asm/prom.h>
28#include <asm/smp.h> 28#include <asm/smp.h>
29#include <asm/time.h>
30#include <asm/machdep.h> 29#include <asm/machdep.h>
31#include <asm/mpic.h> 30#include <asm/mpic.h>
32#include <asm/rtas.h> 31#include <asm/rtas.h>
@@ -42,40 +41,12 @@ static void __devinit smp_chrp_setup_cpu(int cpu_nr)
42 mpic_setup_this_cpu(); 41 mpic_setup_this_cpu();
43} 42}
44 43
45static DEFINE_SPINLOCK(timebase_lock);
46static unsigned int timebase_upper = 0, timebase_lower = 0;
47
48void __devinit smp_chrp_give_timebase(void)
49{
50 spin_lock(&timebase_lock);
51 rtas_call(rtas_token("freeze-time-base"), 0, 1, NULL);
52 timebase_upper = get_tbu();
53 timebase_lower = get_tbl();
54 spin_unlock(&timebase_lock);
55
56 while (timebase_upper || timebase_lower)
57 barrier();
58 rtas_call(rtas_token("thaw-time-base"), 0, 1, NULL);
59}
60
61void __devinit smp_chrp_take_timebase(void)
62{
63 while (!(timebase_upper || timebase_lower))
64 barrier();
65 spin_lock(&timebase_lock);
66 set_tb(timebase_upper, timebase_lower);
67 timebase_upper = 0;
68 timebase_lower = 0;
69 spin_unlock(&timebase_lock);
70 printk("CPU %i taken timebase\n", smp_processor_id());
71}
72
73/* CHRP with openpic */ 44/* CHRP with openpic */
74struct smp_ops_t chrp_smp_ops = { 45struct smp_ops_t chrp_smp_ops = {
75 .message_pass = smp_mpic_message_pass, 46 .message_pass = smp_mpic_message_pass,
76 .probe = smp_mpic_probe, 47 .probe = smp_mpic_probe,
77 .kick_cpu = smp_chrp_kick_cpu, 48 .kick_cpu = smp_chrp_kick_cpu,
78 .setup_cpu = smp_chrp_setup_cpu, 49 .setup_cpu = smp_chrp_setup_cpu,
79 .give_timebase = smp_chrp_give_timebase, 50 .give_timebase = rtas_give_timebase,
80 .take_timebase = smp_chrp_take_timebase, 51 .take_timebase = rtas_take_timebase,
81}; 52};
diff --git a/arch/powerpc/platforms/pasemi/setup.c b/arch/powerpc/platforms/pasemi/setup.c
index 153051eb6d93..a4619347aa7e 100644
--- a/arch/powerpc/platforms/pasemi/setup.c
+++ b/arch/powerpc/platforms/pasemi/setup.c
@@ -71,20 +71,25 @@ static void pas_restart(char *cmd)
71} 71}
72 72
73#ifdef CONFIG_SMP 73#ifdef CONFIG_SMP
74static DEFINE_SPINLOCK(timebase_lock); 74static raw_spinlock_t timebase_lock;
75static unsigned long timebase; 75static unsigned long timebase;
76 76
77static void __devinit pas_give_timebase(void) 77static void __devinit pas_give_timebase(void)
78{ 78{
79 spin_lock(&timebase_lock); 79 unsigned long flags;
80
81 local_irq_save(flags);
82 hard_irq_disable();
83 __raw_spin_lock(&timebase_lock);
80 mtspr(SPRN_TBCTL, TBCTL_FREEZE); 84 mtspr(SPRN_TBCTL, TBCTL_FREEZE);
81 isync(); 85 isync();
82 timebase = get_tb(); 86 timebase = get_tb();
83 spin_unlock(&timebase_lock); 87 __raw_spin_unlock(&timebase_lock);
84 88
85 while (timebase) 89 while (timebase)
86 barrier(); 90 barrier();
87 mtspr(SPRN_TBCTL, TBCTL_RESTART); 91 mtspr(SPRN_TBCTL, TBCTL_RESTART);
92 local_irq_restore(flags);
88} 93}
89 94
90static void __devinit pas_take_timebase(void) 95static void __devinit pas_take_timebase(void)
@@ -92,10 +97,10 @@ static void __devinit pas_take_timebase(void)
92 while (!timebase) 97 while (!timebase)
93 smp_rmb(); 98 smp_rmb();
94 99
95 spin_lock(&timebase_lock); 100 __raw_spin_lock(&timebase_lock);
96 set_tb(timebase >> 32, timebase & 0xffffffff); 101 set_tb(timebase >> 32, timebase & 0xffffffff);
97 timebase = 0; 102 timebase = 0;
98 spin_unlock(&timebase_lock); 103 __raw_spin_unlock(&timebase_lock);
99} 104}
100 105
101struct smp_ops_t pas_smp_ops = { 106struct smp_ops_t pas_smp_ops = {
diff --git a/arch/powerpc/platforms/powermac/cpufreq_64.c b/arch/powerpc/platforms/powermac/cpufreq_64.c
index 22ecfbe7183d..708c75133377 100644
--- a/arch/powerpc/platforms/powermac/cpufreq_64.c
+++ b/arch/powerpc/platforms/powermac/cpufreq_64.c
@@ -251,7 +251,7 @@ static void g5_pfunc_switch_volt(int speed_mode)
251static struct pmf_function *pfunc_cpu_setfreq_high; 251static struct pmf_function *pfunc_cpu_setfreq_high;
252static struct pmf_function *pfunc_cpu_setfreq_low; 252static struct pmf_function *pfunc_cpu_setfreq_low;
253static struct pmf_function *pfunc_cpu_getfreq; 253static struct pmf_function *pfunc_cpu_getfreq;
254static struct pmf_function *pfunc_slewing_done;; 254static struct pmf_function *pfunc_slewing_done;
255 255
256static int g5_pfunc_switch_freq(int speed_mode) 256static int g5_pfunc_switch_freq(int speed_mode)
257{ 257{
diff --git a/arch/powerpc/platforms/powermac/pic.c b/arch/powerpc/platforms/powermac/pic.c
index dce736349107..d212006a5b3c 100644
--- a/arch/powerpc/platforms/powermac/pic.c
+++ b/arch/powerpc/platforms/powermac/pic.c
@@ -609,7 +609,7 @@ static int pmacpic_find_viaint(void)
609 np = of_find_node_by_name(NULL, "via-pmu"); 609 np = of_find_node_by_name(NULL, "via-pmu");
610 if (np == NULL) 610 if (np == NULL)
611 goto not_found; 611 goto not_found;
612 viaint = irq_of_parse_and_map(np, 0);; 612 viaint = irq_of_parse_and_map(np, 0);
613 613
614not_found: 614not_found:
615#endif /* CONFIG_ADB_PMU */ 615#endif /* CONFIG_ADB_PMU */
diff --git a/arch/powerpc/platforms/powermac/setup.c b/arch/powerpc/platforms/powermac/setup.c
index 86f69a4eb49b..c20522656367 100644
--- a/arch/powerpc/platforms/powermac/setup.c
+++ b/arch/powerpc/platforms/powermac/setup.c
@@ -103,11 +103,6 @@ unsigned long smu_cmdbuf_abs;
103EXPORT_SYMBOL(smu_cmdbuf_abs); 103EXPORT_SYMBOL(smu_cmdbuf_abs);
104#endif 104#endif
105 105
106#ifdef CONFIG_SMP
107extern struct smp_ops_t psurge_smp_ops;
108extern struct smp_ops_t core99_smp_ops;
109#endif /* CONFIG_SMP */
110
111static void pmac_show_cpuinfo(struct seq_file *m) 106static void pmac_show_cpuinfo(struct seq_file *m)
112{ 107{
113 struct device_node *np; 108 struct device_node *np;
@@ -341,34 +336,6 @@ static void __init pmac_setup_arch(void)
341 ROOT_DEV = DEFAULT_ROOT_DEVICE; 336 ROOT_DEV = DEFAULT_ROOT_DEVICE;
342#endif 337#endif
343 338
344#ifdef CONFIG_SMP
345 /* Check for Core99 */
346 ic = of_find_node_by_name(NULL, "uni-n");
347 if (!ic)
348 ic = of_find_node_by_name(NULL, "u3");
349 if (!ic)
350 ic = of_find_node_by_name(NULL, "u4");
351 if (ic) {
352 of_node_put(ic);
353 smp_ops = &core99_smp_ops;
354 }
355#ifdef CONFIG_PPC32
356 else {
357 /*
358 * We have to set bits in cpu_possible_map here since the
359 * secondary CPU(s) aren't in the device tree, and
360 * setup_per_cpu_areas only allocates per-cpu data for
361 * CPUs in the cpu_possible_map.
362 */
363 int cpu;
364
365 for (cpu = 1; cpu < 4 && cpu < NR_CPUS; ++cpu)
366 cpu_set(cpu, cpu_possible_map);
367 smp_ops = &psurge_smp_ops;
368 }
369#endif
370#endif /* CONFIG_SMP */
371
372#ifdef CONFIG_ADB 339#ifdef CONFIG_ADB
373 if (strstr(cmd_line, "adb_sync")) { 340 if (strstr(cmd_line, "adb_sync")) {
374 extern int __adb_probe_sync; 341 extern int __adb_probe_sync;
@@ -512,6 +479,14 @@ static void __init pmac_init_early(void)
512#ifdef CONFIG_PPC64 479#ifdef CONFIG_PPC64
513 iommu_init_early_dart(); 480 iommu_init_early_dart();
514#endif 481#endif
482
483 /* SMP Init has to be done early as we need to patch up
484 * cpu_possible_map before interrupt stacks are allocated
485 * or kaboom...
486 */
487#ifdef CONFIG_SMP
488 pmac_setup_smp();
489#endif
515} 490}
516 491
517static int __init pmac_declare_of_platform_devices(void) 492static int __init pmac_declare_of_platform_devices(void)
diff --git a/arch/powerpc/platforms/powermac/smp.c b/arch/powerpc/platforms/powermac/smp.c
index cf1dbe758890..6d4da7b46b41 100644
--- a/arch/powerpc/platforms/powermac/smp.c
+++ b/arch/powerpc/platforms/powermac/smp.c
@@ -64,10 +64,11 @@
64extern void __secondary_start_pmac_0(void); 64extern void __secondary_start_pmac_0(void);
65extern int pmac_pfunc_base_install(void); 65extern int pmac_pfunc_base_install(void);
66 66
67#ifdef CONFIG_PPC32 67static void (*pmac_tb_freeze)(int freeze);
68static u64 timebase;
69static int tb_req;
68 70
69/* Sync flag for HW tb sync */ 71#ifdef CONFIG_PPC32
70static volatile int sec_tb_reset = 0;
71 72
72/* 73/*
73 * Powersurge (old powermac SMP) support. 74 * Powersurge (old powermac SMP) support.
@@ -294,6 +295,9 @@ static int __init smp_psurge_probe(void)
294 psurge_quad_init(); 295 psurge_quad_init();
295 /* All released cards using this HW design have 4 CPUs */ 296 /* All released cards using this HW design have 4 CPUs */
296 ncpus = 4; 297 ncpus = 4;
298 /* No sure how timebase sync works on those, let's use SW */
299 smp_ops->give_timebase = smp_generic_give_timebase;
300 smp_ops->take_timebase = smp_generic_take_timebase;
297 } else { 301 } else {
298 iounmap(quad_base); 302 iounmap(quad_base);
299 if ((in_8(hhead_base + HHEAD_CONFIG) & 0x02) == 0) { 303 if ((in_8(hhead_base + HHEAD_CONFIG) & 0x02) == 0) {
@@ -308,18 +312,15 @@ static int __init smp_psurge_probe(void)
308 psurge_start = ioremap(PSURGE_START, 4); 312 psurge_start = ioremap(PSURGE_START, 4);
309 psurge_pri_intr = ioremap(PSURGE_PRI_INTR, 4); 313 psurge_pri_intr = ioremap(PSURGE_PRI_INTR, 4);
310 314
311 /* 315 /* This is necessary because OF doesn't know about the
312 * This is necessary because OF doesn't know about the
313 * secondary cpu(s), and thus there aren't nodes in the 316 * secondary cpu(s), and thus there aren't nodes in the
314 * device tree for them, and smp_setup_cpu_maps hasn't 317 * device tree for them, and smp_setup_cpu_maps hasn't
315 * set their bits in cpu_possible_map and cpu_present_map. 318 * set their bits in cpu_present_map.
316 */ 319 */
317 if (ncpus > NR_CPUS) 320 if (ncpus > NR_CPUS)
318 ncpus = NR_CPUS; 321 ncpus = NR_CPUS;
319 for (i = 1; i < ncpus ; ++i) { 322 for (i = 1; i < ncpus ; ++i)
320 cpu_set(i, cpu_present_map); 323 cpu_set(i, cpu_present_map);
321 set_hard_smp_processor_id(i, i);
322 }
323 324
324 if (ppc_md.progress) ppc_md.progress("smp_psurge_probe - done", 0x352); 325 if (ppc_md.progress) ppc_md.progress("smp_psurge_probe - done", 0x352);
325 326
@@ -329,8 +330,14 @@ static int __init smp_psurge_probe(void)
329static void __init smp_psurge_kick_cpu(int nr) 330static void __init smp_psurge_kick_cpu(int nr)
330{ 331{
331 unsigned long start = __pa(__secondary_start_pmac_0) + nr * 8; 332 unsigned long start = __pa(__secondary_start_pmac_0) + nr * 8;
332 unsigned long a; 333 unsigned long a, flags;
333 int i; 334 int i, j;
335
336 /* Defining this here is evil ... but I prefer hiding that
337 * crap to avoid giving people ideas that they can do the
338 * same.
339 */
340 extern volatile unsigned int cpu_callin_map[NR_CPUS];
334 341
335 /* may need to flush here if secondary bats aren't setup */ 342 /* may need to flush here if secondary bats aren't setup */
336 for (a = KERNELBASE; a < KERNELBASE + 0x800000; a += 32) 343 for (a = KERNELBASE; a < KERNELBASE + 0x800000; a += 32)
@@ -339,47 +346,52 @@ static void __init smp_psurge_kick_cpu(int nr)
339 346
340 if (ppc_md.progress) ppc_md.progress("smp_psurge_kick_cpu", 0x353); 347 if (ppc_md.progress) ppc_md.progress("smp_psurge_kick_cpu", 0x353);
341 348
349 /* This is going to freeze the timeebase, we disable interrupts */
350 local_irq_save(flags);
351
342 out_be32(psurge_start, start); 352 out_be32(psurge_start, start);
343 mb(); 353 mb();
344 354
345 psurge_set_ipi(nr); 355 psurge_set_ipi(nr);
356
346 /* 357 /*
347 * We can't use udelay here because the timebase is now frozen. 358 * We can't use udelay here because the timebase is now frozen.
348 */ 359 */
349 for (i = 0; i < 2000; ++i) 360 for (i = 0; i < 2000; ++i)
350 barrier(); 361 asm volatile("nop" : : : "memory");
351 psurge_clr_ipi(nr); 362 psurge_clr_ipi(nr);
352 363
353 if (ppc_md.progress) ppc_md.progress("smp_psurge_kick_cpu - done", 0x354); 364 /*
354} 365 * Also, because the timebase is frozen, we must not return to the
355 366 * caller which will try to do udelay's etc... Instead, we wait -here-
356/* 367 * for the CPU to callin.
357 * With the dual-cpu powersurge board, the decrementers and timebases 368 */
358 * of both cpus are frozen after the secondary cpu is started up, 369 for (i = 0; i < 100000 && !cpu_callin_map[nr]; ++i) {
359 * until we give the secondary cpu another interrupt. This routine 370 for (j = 1; j < 10000; j++)
360 * uses this to get the timebases synchronized. 371 asm volatile("nop" : : : "memory");
361 * -- paulus. 372 asm volatile("sync" : : : "memory");
362 */ 373 }
363static void __init psurge_dual_sync_tb(int cpu_nr) 374 if (!cpu_callin_map[nr])
364{ 375 goto stuck;
365 int t; 376
366 377 /* And we do the TB sync here too for standard dual CPU cards */
367 set_dec(tb_ticks_per_jiffy); 378 if (psurge_type == PSURGE_DUAL) {
368 /* XXX fixme */ 379 while(!tb_req)
369 set_tb(0, 0); 380 barrier();
370 381 tb_req = 0;
371 if (cpu_nr > 0) { 382 mb();
383 timebase = get_tb();
384 mb();
385 while (timebase)
386 barrier();
372 mb(); 387 mb();
373 sec_tb_reset = 1;
374 return;
375 } 388 }
389 stuck:
390 /* now interrupt the secondary, restarting both TBs */
391 if (psurge_type == PSURGE_DUAL)
392 psurge_set_ipi(1);
376 393
377 /* wait for the secondary to have reset its TB before proceeding */ 394 if (ppc_md.progress) ppc_md.progress("smp_psurge_kick_cpu - done", 0x354);
378 for (t = 10000000; t > 0 && !sec_tb_reset; --t)
379 ;
380
381 /* now interrupt the secondary, starting both TBs */
382 psurge_set_ipi(1);
383} 395}
384 396
385static struct irqaction psurge_irqaction = { 397static struct irqaction psurge_irqaction = {
@@ -390,36 +402,35 @@ static struct irqaction psurge_irqaction = {
390 402
391static void __init smp_psurge_setup_cpu(int cpu_nr) 403static void __init smp_psurge_setup_cpu(int cpu_nr)
392{ 404{
405 if (cpu_nr != 0)
406 return;
393 407
394 if (cpu_nr == 0) { 408 /* reset the entry point so if we get another intr we won't
395 /* If we failed to start the second CPU, we should still 409 * try to startup again */
396 * send it an IPI to start the timebase & DEC or we might 410 out_be32(psurge_start, 0x100);
397 * have them stuck. 411 if (setup_irq(30, &psurge_irqaction))
398 */ 412 printk(KERN_ERR "Couldn't get primary IPI interrupt");
399 if (num_online_cpus() < 2) {
400 if (psurge_type == PSURGE_DUAL)
401 psurge_set_ipi(1);
402 return;
403 }
404 /* reset the entry point so if we get another intr we won't
405 * try to startup again */
406 out_be32(psurge_start, 0x100);
407 if (setup_irq(30, &psurge_irqaction))
408 printk(KERN_ERR "Couldn't get primary IPI interrupt");
409 }
410
411 if (psurge_type == PSURGE_DUAL)
412 psurge_dual_sync_tb(cpu_nr);
413} 413}
414 414
415void __init smp_psurge_take_timebase(void) 415void __init smp_psurge_take_timebase(void)
416{ 416{
417 /* Dummy implementation */ 417 if (psurge_type != PSURGE_DUAL)
418 return;
419
420 tb_req = 1;
421 mb();
422 while (!timebase)
423 barrier();
424 mb();
425 set_tb(timebase >> 32, timebase & 0xffffffff);
426 timebase = 0;
427 mb();
428 set_dec(tb_ticks_per_jiffy/2);
418} 429}
419 430
420void __init smp_psurge_give_timebase(void) 431void __init smp_psurge_give_timebase(void)
421{ 432{
422 /* Dummy implementation */ 433 /* Nothing to do here */
423} 434}
424 435
425/* PowerSurge-style Macs */ 436/* PowerSurge-style Macs */
@@ -437,9 +448,6 @@ struct smp_ops_t psurge_smp_ops = {
437 * Core 99 and later support 448 * Core 99 and later support
438 */ 449 */
439 450
440static void (*pmac_tb_freeze)(int freeze);
441static u64 timebase;
442static int tb_req;
443 451
444static void smp_core99_give_timebase(void) 452static void smp_core99_give_timebase(void)
445{ 453{
@@ -478,7 +486,6 @@ static void __devinit smp_core99_take_timebase(void)
478 set_tb(timebase >> 32, timebase & 0xffffffff); 486 set_tb(timebase >> 32, timebase & 0xffffffff);
479 timebase = 0; 487 timebase = 0;
480 mb(); 488 mb();
481 set_dec(tb_ticks_per_jiffy/2);
482 489
483 local_irq_restore(flags); 490 local_irq_restore(flags);
484} 491}
@@ -920,3 +927,34 @@ struct smp_ops_t core99_smp_ops = {
920# endif 927# endif
921#endif 928#endif
922}; 929};
930
931void __init pmac_setup_smp(void)
932{
933 struct device_node *np;
934
935 /* Check for Core99 */
936 np = of_find_node_by_name(NULL, "uni-n");
937 if (!np)
938 np = of_find_node_by_name(NULL, "u3");
939 if (!np)
940 np = of_find_node_by_name(NULL, "u4");
941 if (np) {
942 of_node_put(np);
943 smp_ops = &core99_smp_ops;
944 }
945#ifdef CONFIG_PPC32
946 else {
947 /* We have to set bits in cpu_possible_map here since the
948 * secondary CPU(s) aren't in the device tree. Various
949 * things won't be initialized for CPUs not in the possible
950 * map, so we really need to fix it up here.
951 */
952 int cpu;
953
954 for (cpu = 1; cpu < 4 && cpu < NR_CPUS; ++cpu)
955 cpu_set(cpu, cpu_possible_map);
956 smp_ops = &psurge_smp_ops;
957 }
958#endif /* CONFIG_PPC32 */
959}
960
diff --git a/arch/powerpc/platforms/ps3/system-bus.c b/arch/powerpc/platforms/ps3/system-bus.c
index 9fead0faf38b..3f763c5284ac 100644
--- a/arch/powerpc/platforms/ps3/system-bus.c
+++ b/arch/powerpc/platforms/ps3/system-bus.c
@@ -284,7 +284,6 @@ static int ps3_sb_free_mmio_region(struct ps3_mmio_region *r)
284 int result; 284 int result;
285 285
286 dump_mmio_region(r); 286 dump_mmio_region(r);
287;
288 result = lv1_unmap_device_mmio_region(r->dev->bus_id, r->dev->dev_id, 287 result = lv1_unmap_device_mmio_region(r->dev->bus_id, r->dev->dev_id,
289 r->lpar_addr); 288 r->lpar_addr);
290 289
diff --git a/arch/powerpc/platforms/pseries/lpar.c b/arch/powerpc/platforms/pseries/lpar.c
index e3139fa5e556..903eb9eec687 100644
--- a/arch/powerpc/platforms/pseries/lpar.c
+++ b/arch/powerpc/platforms/pseries/lpar.c
@@ -286,7 +286,7 @@ static long pSeries_lpar_hpte_insert(unsigned long hpte_group,
286 unsigned long hpte_v, hpte_r; 286 unsigned long hpte_v, hpte_r;
287 287
288 if (!(vflags & HPTE_V_BOLTED)) 288 if (!(vflags & HPTE_V_BOLTED))
289 pr_debug("hpte_insert(group=%lx, va=%016lx, pa=%016lx, " 289 pr_devel("hpte_insert(group=%lx, va=%016lx, pa=%016lx, "
290 "rflags=%lx, vflags=%lx, psize=%d)\n", 290 "rflags=%lx, vflags=%lx, psize=%d)\n",
291 hpte_group, va, pa, rflags, vflags, psize); 291 hpte_group, va, pa, rflags, vflags, psize);
292 292
@@ -294,7 +294,7 @@ static long pSeries_lpar_hpte_insert(unsigned long hpte_group,
294 hpte_r = hpte_encode_r(pa, psize) | rflags; 294 hpte_r = hpte_encode_r(pa, psize) | rflags;
295 295
296 if (!(vflags & HPTE_V_BOLTED)) 296 if (!(vflags & HPTE_V_BOLTED))
297 pr_debug(" hpte_v=%016lx, hpte_r=%016lx\n", hpte_v, hpte_r); 297 pr_devel(" hpte_v=%016lx, hpte_r=%016lx\n", hpte_v, hpte_r);
298 298
299 /* Now fill in the actual HPTE */ 299 /* Now fill in the actual HPTE */
300 /* Set CEC cookie to 0 */ 300 /* Set CEC cookie to 0 */
@@ -311,7 +311,7 @@ static long pSeries_lpar_hpte_insert(unsigned long hpte_group,
311 lpar_rc = plpar_pte_enter(flags, hpte_group, hpte_v, hpte_r, &slot); 311 lpar_rc = plpar_pte_enter(flags, hpte_group, hpte_v, hpte_r, &slot);
312 if (unlikely(lpar_rc == H_PTEG_FULL)) { 312 if (unlikely(lpar_rc == H_PTEG_FULL)) {
313 if (!(vflags & HPTE_V_BOLTED)) 313 if (!(vflags & HPTE_V_BOLTED))
314 pr_debug(" full\n"); 314 pr_devel(" full\n");
315 return -1; 315 return -1;
316 } 316 }
317 317
@@ -322,11 +322,11 @@ static long pSeries_lpar_hpte_insert(unsigned long hpte_group,
322 */ 322 */
323 if (unlikely(lpar_rc != H_SUCCESS)) { 323 if (unlikely(lpar_rc != H_SUCCESS)) {
324 if (!(vflags & HPTE_V_BOLTED)) 324 if (!(vflags & HPTE_V_BOLTED))
325 pr_debug(" lpar err %lu\n", lpar_rc); 325 pr_devel(" lpar err %lu\n", lpar_rc);
326 return -2; 326 return -2;
327 } 327 }
328 if (!(vflags & HPTE_V_BOLTED)) 328 if (!(vflags & HPTE_V_BOLTED))
329 pr_debug(" -> slot: %lu\n", slot & 7); 329 pr_devel(" -> slot: %lu\n", slot & 7);
330 330
331 /* Because of iSeries, we have to pass down the secondary 331 /* Because of iSeries, we have to pass down the secondary
332 * bucket bit here as well 332 * bucket bit here as well
@@ -418,17 +418,17 @@ static long pSeries_lpar_hpte_updatepp(unsigned long slot,
418 418
419 want_v = hpte_encode_avpn(va, psize, ssize); 419 want_v = hpte_encode_avpn(va, psize, ssize);
420 420
421 pr_debug(" update: avpnv=%016lx, hash=%016lx, f=%lx, psize: %d ...", 421 pr_devel(" update: avpnv=%016lx, hash=%016lx, f=%lx, psize: %d ...",
422 want_v, slot, flags, psize); 422 want_v, slot, flags, psize);
423 423
424 lpar_rc = plpar_pte_protect(flags, slot, want_v); 424 lpar_rc = plpar_pte_protect(flags, slot, want_v);
425 425
426 if (lpar_rc == H_NOT_FOUND) { 426 if (lpar_rc == H_NOT_FOUND) {
427 pr_debug("not found !\n"); 427 pr_devel("not found !\n");
428 return -1; 428 return -1;
429 } 429 }
430 430
431 pr_debug("ok\n"); 431 pr_devel("ok\n");
432 432
433 BUG_ON(lpar_rc != H_SUCCESS); 433 BUG_ON(lpar_rc != H_SUCCESS);
434 434
@@ -503,7 +503,7 @@ static void pSeries_lpar_hpte_invalidate(unsigned long slot, unsigned long va,
503 unsigned long lpar_rc; 503 unsigned long lpar_rc;
504 unsigned long dummy1, dummy2; 504 unsigned long dummy1, dummy2;
505 505
506 pr_debug(" inval : slot=%lx, va=%016lx, psize: %d, local: %d\n", 506 pr_devel(" inval : slot=%lx, va=%016lx, psize: %d, local: %d\n",
507 slot, va, psize, local); 507 slot, va, psize, local);
508 508
509 want_v = hpte_encode_avpn(va, psize, ssize); 509 want_v = hpte_encode_avpn(va, psize, ssize);
diff --git a/arch/powerpc/platforms/pseries/smp.c b/arch/powerpc/platforms/pseries/smp.c
index 1a231c389ba0..1f8f6cfb94f7 100644
--- a/arch/powerpc/platforms/pseries/smp.c
+++ b/arch/powerpc/platforms/pseries/smp.c
@@ -35,7 +35,6 @@
35#include <asm/prom.h> 35#include <asm/prom.h>
36#include <asm/smp.h> 36#include <asm/smp.h>
37#include <asm/paca.h> 37#include <asm/paca.h>
38#include <asm/time.h>
39#include <asm/machdep.h> 38#include <asm/machdep.h>
40#include <asm/cputable.h> 39#include <asm/cputable.h>
41#include <asm/firmware.h> 40#include <asm/firmware.h>
@@ -118,31 +117,6 @@ static void __devinit smp_xics_setup_cpu(int cpu)
118} 117}
119#endif /* CONFIG_XICS */ 118#endif /* CONFIG_XICS */
120 119
121static DEFINE_SPINLOCK(timebase_lock);
122static unsigned long timebase = 0;
123
124static void __devinit pSeries_give_timebase(void)
125{
126 spin_lock(&timebase_lock);
127 rtas_call(rtas_token("freeze-time-base"), 0, 1, NULL);
128 timebase = get_tb();
129 spin_unlock(&timebase_lock);
130
131 while (timebase)
132 barrier();
133 rtas_call(rtas_token("thaw-time-base"), 0, 1, NULL);
134}
135
136static void __devinit pSeries_take_timebase(void)
137{
138 while (!timebase)
139 barrier();
140 spin_lock(&timebase_lock);
141 set_tb(timebase >> 32, timebase & 0xffffffff);
142 timebase = 0;
143 spin_unlock(&timebase_lock);
144}
145
146static void __devinit smp_pSeries_kick_cpu(int nr) 120static void __devinit smp_pSeries_kick_cpu(int nr)
147{ 121{
148 BUG_ON(nr < 0 || nr >= NR_CPUS); 122 BUG_ON(nr < 0 || nr >= NR_CPUS);
@@ -209,8 +183,8 @@ static void __init smp_init_pseries(void)
209 183
210 /* Non-lpar has additional take/give timebase */ 184 /* Non-lpar has additional take/give timebase */
211 if (rtas_token("freeze-time-base") != RTAS_UNKNOWN_SERVICE) { 185 if (rtas_token("freeze-time-base") != RTAS_UNKNOWN_SERVICE) {
212 smp_ops->give_timebase = pSeries_give_timebase; 186 smp_ops->give_timebase = rtas_give_timebase;
213 smp_ops->take_timebase = pSeries_take_timebase; 187 smp_ops->take_timebase = rtas_take_timebase;
214 } 188 }
215 189
216 pr_debug(" <- smp_init_pSeries()\n"); 190 pr_debug(" <- smp_init_pSeries()\n");
diff --git a/arch/powerpc/platforms/pseries/xics.c b/arch/powerpc/platforms/pseries/xics.c
index be3581a8c294..419f8a637ffe 100644
--- a/arch/powerpc/platforms/pseries/xics.c
+++ b/arch/powerpc/platforms/pseries/xics.c
@@ -190,10 +190,10 @@ static void xics_unmask_irq(unsigned int virq)
190 int call_status; 190 int call_status;
191 int server; 191 int server;
192 192
193 pr_debug("xics: unmask virq %d\n", virq); 193 pr_devel("xics: unmask virq %d\n", virq);
194 194
195 irq = (unsigned int)irq_map[virq].hwirq; 195 irq = (unsigned int)irq_map[virq].hwirq;
196 pr_debug(" -> map to hwirq 0x%x\n", irq); 196 pr_devel(" -> map to hwirq 0x%x\n", irq);
197 if (irq == XICS_IPI || irq == XICS_IRQ_SPURIOUS) 197 if (irq == XICS_IPI || irq == XICS_IRQ_SPURIOUS)
198 return; 198 return;
199 199
@@ -252,7 +252,7 @@ static void xics_mask_irq(unsigned int virq)
252{ 252{
253 unsigned int irq; 253 unsigned int irq;
254 254
255 pr_debug("xics: mask virq %d\n", virq); 255 pr_devel("xics: mask virq %d\n", virq);
256 256
257 irq = (unsigned int)irq_map[virq].hwirq; 257 irq = (unsigned int)irq_map[virq].hwirq;
258 if (irq == XICS_IPI || irq == XICS_IRQ_SPURIOUS) 258 if (irq == XICS_IPI || irq == XICS_IRQ_SPURIOUS)
@@ -414,7 +414,7 @@ static int xics_host_match(struct irq_host *h, struct device_node *node)
414static int xics_host_map(struct irq_host *h, unsigned int virq, 414static int xics_host_map(struct irq_host *h, unsigned int virq,
415 irq_hw_number_t hw) 415 irq_hw_number_t hw)
416{ 416{
417 pr_debug("xics: map virq %d, hwirq 0x%lx\n", virq, hw); 417 pr_devel("xics: map virq %d, hwirq 0x%lx\n", virq, hw);
418 418
419 /* Insert the interrupt mapping into the radix tree for fast lookup */ 419 /* Insert the interrupt mapping into the radix tree for fast lookup */
420 irq_radix_revmap_insert(xics_host, virq, hw); 420 irq_radix_revmap_insert(xics_host, virq, hw);
diff --git a/arch/powerpc/sysdev/fsl_rio.c b/arch/powerpc/sysdev/fsl_rio.c
index 39db9d1155d2..cbb3bed75d3c 100644
--- a/arch/powerpc/sysdev/fsl_rio.c
+++ b/arch/powerpc/sysdev/fsl_rio.c
@@ -965,7 +965,7 @@ static inline void fsl_rio_info(struct device *dev, u32 ccsr)
965 break; 965 break;
966 default: 966 default:
967 str = "Unknown"; 967 str = "Unknown";
968 break;; 968 break;
969 } 969 }
970 dev_info(dev, "Hardware port width: %s\n", str); 970 dev_info(dev, "Hardware port width: %s\n", str);
971 971
diff --git a/arch/powerpc/sysdev/ipic.c b/arch/powerpc/sysdev/ipic.c
index a86d3ce01ead..69e2630c9062 100644
--- a/arch/powerpc/sysdev/ipic.c
+++ b/arch/powerpc/sysdev/ipic.c
@@ -728,12 +728,10 @@ struct ipic * __init ipic_init(struct device_node *node, unsigned int flags)
728 if (ret) 728 if (ret)
729 return NULL; 729 return NULL;
730 730
731 ipic = alloc_bootmem(sizeof(struct ipic)); 731 ipic = kzalloc(sizeof(*ipic), GFP_KERNEL);
732 if (ipic == NULL) 732 if (ipic == NULL)
733 return NULL; 733 return NULL;
734 734
735 memset(ipic, 0, sizeof(struct ipic));
736
737 ipic->irqhost = irq_alloc_host(node, IRQ_HOST_MAP_LINEAR, 735 ipic->irqhost = irq_alloc_host(node, IRQ_HOST_MAP_LINEAR,
738 NR_IPIC_INTS, 736 NR_IPIC_INTS,
739 &ipic_host_ops, 0); 737 &ipic_host_ops, 0);
diff --git a/arch/powerpc/sysdev/mpic.c b/arch/powerpc/sysdev/mpic.c
index 9c3af5045495..3981ae4cb58e 100644
--- a/arch/powerpc/sysdev/mpic.c
+++ b/arch/powerpc/sysdev/mpic.c
@@ -279,28 +279,29 @@ static void _mpic_map_mmio(struct mpic *mpic, phys_addr_t phys_addr,
279} 279}
280 280
281#ifdef CONFIG_PPC_DCR 281#ifdef CONFIG_PPC_DCR
282static void _mpic_map_dcr(struct mpic *mpic, struct mpic_reg_bank *rb, 282static void _mpic_map_dcr(struct mpic *mpic, struct device_node *node,
283 struct mpic_reg_bank *rb,
283 unsigned int offset, unsigned int size) 284 unsigned int offset, unsigned int size)
284{ 285{
285 const u32 *dbasep; 286 const u32 *dbasep;
286 287
287 dbasep = of_get_property(mpic->irqhost->of_node, "dcr-reg", NULL); 288 dbasep = of_get_property(node, "dcr-reg", NULL);
288 289
289 rb->dhost = dcr_map(mpic->irqhost->of_node, *dbasep + offset, size); 290 rb->dhost = dcr_map(node, *dbasep + offset, size);
290 BUG_ON(!DCR_MAP_OK(rb->dhost)); 291 BUG_ON(!DCR_MAP_OK(rb->dhost));
291} 292}
292 293
293static inline void mpic_map(struct mpic *mpic, phys_addr_t phys_addr, 294static inline void mpic_map(struct mpic *mpic, struct device_node *node,
294 struct mpic_reg_bank *rb, unsigned int offset, 295 phys_addr_t phys_addr, struct mpic_reg_bank *rb,
295 unsigned int size) 296 unsigned int offset, unsigned int size)
296{ 297{
297 if (mpic->flags & MPIC_USES_DCR) 298 if (mpic->flags & MPIC_USES_DCR)
298 _mpic_map_dcr(mpic, rb, offset, size); 299 _mpic_map_dcr(mpic, node, rb, offset, size);
299 else 300 else
300 _mpic_map_mmio(mpic, phys_addr, rb, offset, size); 301 _mpic_map_mmio(mpic, phys_addr, rb, offset, size);
301} 302}
302#else /* CONFIG_PPC_DCR */ 303#else /* CONFIG_PPC_DCR */
303#define mpic_map(m,p,b,o,s) _mpic_map_mmio(m,p,b,o,s) 304#define mpic_map(m,n,p,b,o,s) _mpic_map_mmio(m,p,b,o,s)
304#endif /* !CONFIG_PPC_DCR */ 305#endif /* !CONFIG_PPC_DCR */
305 306
306 307
@@ -507,9 +508,8 @@ static void __init mpic_scan_ht_pics(struct mpic *mpic)
507 printk(KERN_INFO "mpic: Setting up HT PICs workarounds for U3/U4\n"); 508 printk(KERN_INFO "mpic: Setting up HT PICs workarounds for U3/U4\n");
508 509
509 /* Allocate fixups array */ 510 /* Allocate fixups array */
510 mpic->fixups = alloc_bootmem(128 * sizeof(struct mpic_irq_fixup)); 511 mpic->fixups = kzalloc(128 * sizeof(*mpic->fixups), GFP_KERNEL);
511 BUG_ON(mpic->fixups == NULL); 512 BUG_ON(mpic->fixups == NULL);
512 memset(mpic->fixups, 0, 128 * sizeof(struct mpic_irq_fixup));
513 513
514 /* Init spinlock */ 514 /* Init spinlock */
515 spin_lock_init(&mpic->fixup_lock); 515 spin_lock_init(&mpic->fixup_lock);
@@ -1052,11 +1052,10 @@ struct mpic * __init mpic_alloc(struct device_node *node,
1052 int intvec_top; 1052 int intvec_top;
1053 u64 paddr = phys_addr; 1053 u64 paddr = phys_addr;
1054 1054
1055 mpic = alloc_bootmem(sizeof(struct mpic)); 1055 mpic = kzalloc(sizeof(struct mpic), GFP_KERNEL);
1056 if (mpic == NULL) 1056 if (mpic == NULL)
1057 return NULL; 1057 return NULL;
1058 1058
1059 memset(mpic, 0, sizeof(struct mpic));
1060 mpic->name = name; 1059 mpic->name = name;
1061 1060
1062 mpic->hc_irq = mpic_irq_chip; 1061 mpic->hc_irq = mpic_irq_chip;
@@ -1109,9 +1108,8 @@ struct mpic * __init mpic_alloc(struct device_node *node,
1109 psize /= 4; 1108 psize /= 4;
1110 bits = intvec_top + 1; 1109 bits = intvec_top + 1;
1111 mapsize = BITS_TO_LONGS(bits) * sizeof(unsigned long); 1110 mapsize = BITS_TO_LONGS(bits) * sizeof(unsigned long);
1112 mpic->protected = alloc_bootmem(mapsize); 1111 mpic->protected = kzalloc(mapsize, GFP_KERNEL);
1113 BUG_ON(mpic->protected == NULL); 1112 BUG_ON(mpic->protected == NULL);
1114 memset(mpic->protected, 0, mapsize);
1115 for (i = 0; i < psize; i++) { 1113 for (i = 0; i < psize; i++) {
1116 if (psrc[i] > intvec_top) 1114 if (psrc[i] > intvec_top)
1117 continue; 1115 continue;
@@ -1152,8 +1150,8 @@ struct mpic * __init mpic_alloc(struct device_node *node,
1152 } 1150 }
1153 1151
1154 /* Map the global registers */ 1152 /* Map the global registers */
1155 mpic_map(mpic, paddr, &mpic->gregs, MPIC_INFO(GREG_BASE), 0x1000); 1153 mpic_map(mpic, node, paddr, &mpic->gregs, MPIC_INFO(GREG_BASE), 0x1000);
1156 mpic_map(mpic, paddr, &mpic->tmregs, MPIC_INFO(TIMER_BASE), 0x1000); 1154 mpic_map(mpic, node, paddr, &mpic->tmregs, MPIC_INFO(TIMER_BASE), 0x1000);
1157 1155
1158 /* Reset */ 1156 /* Reset */
1159 if (flags & MPIC_WANTS_RESET) { 1157 if (flags & MPIC_WANTS_RESET) {
@@ -1194,7 +1192,7 @@ struct mpic * __init mpic_alloc(struct device_node *node,
1194 1192
1195 /* Map the per-CPU registers */ 1193 /* Map the per-CPU registers */
1196 for (i = 0; i < mpic->num_cpus; i++) { 1194 for (i = 0; i < mpic->num_cpus; i++) {
1197 mpic_map(mpic, paddr, &mpic->cpuregs[i], 1195 mpic_map(mpic, node, paddr, &mpic->cpuregs[i],
1198 MPIC_INFO(CPU_BASE) + i * MPIC_INFO(CPU_STRIDE), 1196 MPIC_INFO(CPU_BASE) + i * MPIC_INFO(CPU_STRIDE),
1199 0x1000); 1197 0x1000);
1200 } 1198 }
@@ -1202,7 +1200,7 @@ struct mpic * __init mpic_alloc(struct device_node *node,
1202 /* Initialize main ISU if none provided */ 1200 /* Initialize main ISU if none provided */
1203 if (mpic->isu_size == 0) { 1201 if (mpic->isu_size == 0) {
1204 mpic->isu_size = mpic->num_sources; 1202 mpic->isu_size = mpic->num_sources;
1205 mpic_map(mpic, paddr, &mpic->isus[0], 1203 mpic_map(mpic, node, paddr, &mpic->isus[0],
1206 MPIC_INFO(IRQ_BASE), MPIC_INFO(IRQ_STRIDE) * mpic->isu_size); 1204 MPIC_INFO(IRQ_BASE), MPIC_INFO(IRQ_STRIDE) * mpic->isu_size);
1207 } 1205 }
1208 mpic->isu_shift = 1 + __ilog2(mpic->isu_size - 1); 1206 mpic->isu_shift = 1 + __ilog2(mpic->isu_size - 1);
@@ -1256,8 +1254,10 @@ void __init mpic_assign_isu(struct mpic *mpic, unsigned int isu_num,
1256 1254
1257 BUG_ON(isu_num >= MPIC_MAX_ISU); 1255 BUG_ON(isu_num >= MPIC_MAX_ISU);
1258 1256
1259 mpic_map(mpic, paddr, &mpic->isus[isu_num], 0, 1257 mpic_map(mpic, mpic->irqhost->of_node,
1258 paddr, &mpic->isus[isu_num], 0,
1260 MPIC_INFO(IRQ_STRIDE) * mpic->isu_size); 1259 MPIC_INFO(IRQ_STRIDE) * mpic->isu_size);
1260
1261 if ((isu_first + mpic->isu_size) > mpic->num_sources) 1261 if ((isu_first + mpic->isu_size) > mpic->num_sources)
1262 mpic->num_sources = isu_first + mpic->isu_size; 1262 mpic->num_sources = isu_first + mpic->isu_size;
1263} 1263}
@@ -1351,7 +1351,8 @@ void __init mpic_init(struct mpic *mpic)
1351 1351
1352#ifdef CONFIG_PM 1352#ifdef CONFIG_PM
1353 /* allocate memory to save mpic state */ 1353 /* allocate memory to save mpic state */
1354 mpic->save_data = alloc_bootmem(mpic->num_sources * sizeof(struct mpic_irq_save)); 1354 mpic->save_data = kmalloc(mpic->num_sources * sizeof(*mpic->save_data),
1355 GFP_KERNEL);
1355 BUG_ON(mpic->save_data == NULL); 1356 BUG_ON(mpic->save_data == NULL);
1356#endif 1357#endif
1357} 1358}
diff --git a/arch/powerpc/sysdev/ppc4xx_pci.c b/arch/powerpc/sysdev/ppc4xx_pci.c
index daefc93ddffe..6ff9d71b4c0d 100644
--- a/arch/powerpc/sysdev/ppc4xx_pci.c
+++ b/arch/powerpc/sysdev/ppc4xx_pci.c
@@ -1531,7 +1531,7 @@ static void __init ppc4xx_configure_pciex_PIMs(struct ppc4xx_pciex_port *port,
1531 */ 1531 */
1532 1532
1533 /* Calculate window size */ 1533 /* Calculate window size */
1534 sa = (0xffffffffffffffffull << ilog2(ep_size));; 1534 sa = (0xffffffffffffffffull << ilog2(ep_size));
1535 1535
1536 /* Setup BAR0 */ 1536 /* Setup BAR0 */
1537 out_le32(mbase + PECFG_BAR0HMPA, RES_TO_U32_HIGH(sa)); 1537 out_le32(mbase + PECFG_BAR0HMPA, RES_TO_U32_HIGH(sa));
@@ -1550,7 +1550,7 @@ static void __init ppc4xx_configure_pciex_PIMs(struct ppc4xx_pciex_port *port,
1550 out_le32(mbase + PCI_BASE_ADDRESS_1, RES_TO_U32_HIGH(ep_addr)); 1550 out_le32(mbase + PCI_BASE_ADDRESS_1, RES_TO_U32_HIGH(ep_addr));
1551 } else { 1551 } else {
1552 /* Calculate window size */ 1552 /* Calculate window size */
1553 sa = (0xffffffffffffffffull << ilog2(size));; 1553 sa = (0xffffffffffffffffull << ilog2(size));
1554 if (res->flags & IORESOURCE_PREFETCH) 1554 if (res->flags & IORESOURCE_PREFETCH)
1555 sa |= 0x8; 1555 sa |= 0x8;
1556 1556
diff --git a/arch/powerpc/sysdev/qe_lib/qe.c b/arch/powerpc/sysdev/qe_lib/qe.c
index b28b0e512d67..237e3654f48c 100644
--- a/arch/powerpc/sysdev/qe_lib/qe.c
+++ b/arch/powerpc/sysdev/qe_lib/qe.c
@@ -112,6 +112,7 @@ int qe_issue_cmd(u32 cmd, u32 device, u8 mcn_protocol, u32 cmd_input)
112{ 112{
113 unsigned long flags; 113 unsigned long flags;
114 u8 mcn_shift = 0, dev_shift = 0; 114 u8 mcn_shift = 0, dev_shift = 0;
115 u32 ret;
115 116
116 spin_lock_irqsave(&qe_lock, flags); 117 spin_lock_irqsave(&qe_lock, flags);
117 if (cmd == QE_RESET) { 118 if (cmd == QE_RESET) {
@@ -139,11 +140,13 @@ int qe_issue_cmd(u32 cmd, u32 device, u8 mcn_protocol, u32 cmd_input)
139 } 140 }
140 141
141 /* wait for the QE_CR_FLG to clear */ 142 /* wait for the QE_CR_FLG to clear */
142 while(in_be32(&qe_immr->cp.cecr) & QE_CR_FLG) 143 ret = spin_event_timeout((in_be32(&qe_immr->cp.cecr) & QE_CR_FLG) == 0,
143 cpu_relax(); 144 100, 0);
145 /* On timeout (e.g. failure), the expression will be false (ret == 0),
146 otherwise it will be true (ret == 1). */
144 spin_unlock_irqrestore(&qe_lock, flags); 147 spin_unlock_irqrestore(&qe_lock, flags);
145 148
146 return 0; 149 return ret == 1;
147} 150}
148EXPORT_SYMBOL(qe_issue_cmd); 151EXPORT_SYMBOL(qe_issue_cmd);
149 152
diff --git a/arch/powerpc/sysdev/qe_lib/qe_ic.c b/arch/powerpc/sysdev/qe_lib/qe_ic.c
index 63cdf9887f36..074905c3ee5a 100644
--- a/arch/powerpc/sysdev/qe_lib/qe_ic.c
+++ b/arch/powerpc/sysdev/qe_lib/qe_ic.c
@@ -333,12 +333,10 @@ void __init qe_ic_init(struct device_node *node, unsigned int flags,
333 if (ret) 333 if (ret)
334 return; 334 return;
335 335
336 qe_ic = alloc_bootmem(sizeof(struct qe_ic)); 336 qe_ic = kzalloc(sizeof(*qe_ic), GFP_KERNEL);
337 if (qe_ic == NULL) 337 if (qe_ic == NULL)
338 return; 338 return;
339 339
340 memset(qe_ic, 0, sizeof(struct qe_ic));
341
342 qe_ic->irqhost = irq_alloc_host(node, IRQ_HOST_MAP_LINEAR, 340 qe_ic->irqhost = irq_alloc_host(node, IRQ_HOST_MAP_LINEAR,
343 NR_QE_IC_INTS, &qe_ic_host_ops, 0); 341 NR_QE_IC_INTS, &qe_ic_host_ops, 0);
344 if (qe_ic->irqhost == NULL) 342 if (qe_ic->irqhost == NULL)
diff --git a/arch/powerpc/sysdev/uic.c b/arch/powerpc/sysdev/uic.c
index d35405c59434..466ce9ace127 100644
--- a/arch/powerpc/sysdev/uic.c
+++ b/arch/powerpc/sysdev/uic.c
@@ -258,11 +258,10 @@ static struct uic * __init uic_init_one(struct device_node *node)
258 258
259 BUG_ON(! of_device_is_compatible(node, "ibm,uic")); 259 BUG_ON(! of_device_is_compatible(node, "ibm,uic"));
260 260
261 uic = alloc_bootmem(sizeof(*uic)); 261 uic = kzalloc(sizeof(*uic), GFP_KERNEL);
262 if (! uic) 262 if (! uic)
263 return NULL; /* FIXME: panic? */ 263 return NULL; /* FIXME: panic? */
264 264
265 memset(uic, 0, sizeof(*uic));
266 spin_lock_init(&uic->lock); 265 spin_lock_init(&uic->lock);
267 indexp = of_get_property(node, "cell-index", &len); 266 indexp = of_get_property(node, "cell-index", &len);
268 if (!indexp || (len != sizeof(u32))) { 267 if (!indexp || (len != sizeof(u32))) {
diff --git a/arch/s390/Kconfig b/arch/s390/Kconfig
index e577839f3073..2ae5d72f47ed 100644
--- a/arch/s390/Kconfig
+++ b/arch/s390/Kconfig
@@ -95,6 +95,11 @@ config S390
95 select HAVE_ARCH_TRACEHOOK 95 select HAVE_ARCH_TRACEHOOK
96 select INIT_ALL_POSSIBLE 96 select INIT_ALL_POSSIBLE
97 select HAVE_PERF_COUNTERS 97 select HAVE_PERF_COUNTERS
98 select GENERIC_ATOMIC64 if !64BIT
99
100config SCHED_OMIT_FRAME_POINTER
101 bool
102 default y
98 103
99source "init/Kconfig" 104source "init/Kconfig"
100 105
@@ -116,6 +121,9 @@ config 32BIT
116 bool 121 bool
117 default y if !64BIT 122 default y if !64BIT
118 123
124config KTIME_SCALAR
125 def_bool 32BIT
126
119config SMP 127config SMP
120 bool "Symmetric multi-processing support" 128 bool "Symmetric multi-processing support"
121 ---help--- 129 ---help---
diff --git a/arch/s390/include/asm/atomic.h b/arch/s390/include/asm/atomic.h
index fca9dffcc669..c7d0abfb0f00 100644
--- a/arch/s390/include/asm/atomic.h
+++ b/arch/s390/include/asm/atomic.h
@@ -268,7 +268,12 @@ static __inline__ int atomic64_add_unless(atomic64_t *v,
268#define atomic64_inc_not_zero(v) atomic64_add_unless((v), 1, 0) 268#define atomic64_inc_not_zero(v) atomic64_add_unless((v), 1, 0)
269 269
270#undef __CSG_LOOP 270#undef __CSG_LOOP
271#endif 271
272#else /* __s390x__ */
273
274#include <asm-generic/atomic64.h>
275
276#endif /* __s390x__ */
272 277
273#define smp_mb__before_atomic_dec() smp_mb() 278#define smp_mb__before_atomic_dec() smp_mb()
274#define smp_mb__after_atomic_dec() smp_mb() 279#define smp_mb__after_atomic_dec() smp_mb()
diff --git a/arch/s390/include/asm/kvm_host.h b/arch/s390/include/asm/kvm_host.h
index a27d0d5a6f86..1cd02f6073a0 100644
--- a/arch/s390/include/asm/kvm_host.h
+++ b/arch/s390/include/asm/kvm_host.h
@@ -99,7 +99,9 @@ struct kvm_s390_sie_block {
99 __u8 reservedd0[48]; /* 0x00d0 */ 99 __u8 reservedd0[48]; /* 0x00d0 */
100 __u64 gcr[16]; /* 0x0100 */ 100 __u64 gcr[16]; /* 0x0100 */
101 __u64 gbea; /* 0x0180 */ 101 __u64 gbea; /* 0x0180 */
102 __u8 reserved188[120]; /* 0x0188 */ 102 __u8 reserved188[24]; /* 0x0188 */
103 __u32 fac; /* 0x01a0 */
104 __u8 reserved1a4[92]; /* 0x01a4 */
103} __attribute__((packed)); 105} __attribute__((packed));
104 106
105struct kvm_vcpu_stat { 107struct kvm_vcpu_stat {
diff --git a/arch/s390/include/asm/perf_counter.h b/arch/s390/include/asm/perf_counter.h
index a7205a3828cb..7015188c2cc2 100644
--- a/arch/s390/include/asm/perf_counter.h
+++ b/arch/s390/include/asm/perf_counter.h
@@ -6,3 +6,5 @@
6 6
7static inline void set_perf_counter_pending(void) {} 7static inline void set_perf_counter_pending(void) {}
8static inline void clear_perf_counter_pending(void) {} 8static inline void clear_perf_counter_pending(void) {}
9
10#define PERF_COUNTER_INDEX_OFFSET 0
diff --git a/arch/s390/include/asm/thread_info.h b/arch/s390/include/asm/thread_info.h
index 925bcc649035..ba1cab9fc1f9 100644
--- a/arch/s390/include/asm/thread_info.h
+++ b/arch/s390/include/asm/thread_info.h
@@ -61,7 +61,7 @@ struct thread_info {
61 .exec_domain = &default_exec_domain, \ 61 .exec_domain = &default_exec_domain, \
62 .flags = 0, \ 62 .flags = 0, \
63 .cpu = 0, \ 63 .cpu = 0, \
64 .preempt_count = 1, \ 64 .preempt_count = INIT_PREEMPT_COUNT, \
65 .restart_block = { \ 65 .restart_block = { \
66 .fn = do_no_restart_syscall, \ 66 .fn = do_no_restart_syscall, \
67 }, \ 67 }, \
diff --git a/arch/s390/include/asm/tlb.h b/arch/s390/include/asm/tlb.h
index 3d8a96d39d9d..81150b053689 100644
--- a/arch/s390/include/asm/tlb.h
+++ b/arch/s390/include/asm/tlb.h
@@ -96,7 +96,8 @@ static inline void tlb_remove_page(struct mmu_gather *tlb, struct page *page)
96 * pte_free_tlb frees a pte table and clears the CRSTE for the 96 * pte_free_tlb frees a pte table and clears the CRSTE for the
97 * page table from the tlb. 97 * page table from the tlb.
98 */ 98 */
99static inline void pte_free_tlb(struct mmu_gather *tlb, pgtable_t pte) 99static inline void pte_free_tlb(struct mmu_gather *tlb, pgtable_t pte,
100 unsigned long address)
100{ 101{
101 if (!tlb->fullmm) { 102 if (!tlb->fullmm) {
102 tlb->array[tlb->nr_ptes++] = pte; 103 tlb->array[tlb->nr_ptes++] = pte;
@@ -113,7 +114,8 @@ static inline void pte_free_tlb(struct mmu_gather *tlb, pgtable_t pte)
113 * as the pgd. pmd_free_tlb checks the asce_limit against 2GB 114 * as the pgd. pmd_free_tlb checks the asce_limit against 2GB
114 * to avoid the double free of the pmd in this case. 115 * to avoid the double free of the pmd in this case.
115 */ 116 */
116static inline void pmd_free_tlb(struct mmu_gather *tlb, pmd_t *pmd) 117static inline void pmd_free_tlb(struct mmu_gather *tlb, pmd_t *pmd,
118 unsigned long address)
117{ 119{
118#ifdef __s390x__ 120#ifdef __s390x__
119 if (tlb->mm->context.asce_limit <= (1UL << 31)) 121 if (tlb->mm->context.asce_limit <= (1UL << 31))
@@ -134,7 +136,8 @@ static inline void pmd_free_tlb(struct mmu_gather *tlb, pmd_t *pmd)
134 * as the pgd. pud_free_tlb checks the asce_limit against 4TB 136 * as the pgd. pud_free_tlb checks the asce_limit against 4TB
135 * to avoid the double free of the pud in this case. 137 * to avoid the double free of the pud in this case.
136 */ 138 */
137static inline void pud_free_tlb(struct mmu_gather *tlb, pud_t *pud) 139static inline void pud_free_tlb(struct mmu_gather *tlb, pud_t *pud,
140 unsigned long address)
138{ 141{
139#ifdef __s390x__ 142#ifdef __s390x__
140 if (tlb->mm->context.asce_limit <= (1UL << 42)) 143 if (tlb->mm->context.asce_limit <= (1UL << 42))
diff --git a/arch/s390/kernel/dis.c b/arch/s390/kernel/dis.c
index d2f270c995d9..db943a7ec513 100644
--- a/arch/s390/kernel/dis.c
+++ b/arch/s390/kernel/dis.c
@@ -15,7 +15,6 @@
15#include <linux/timer.h> 15#include <linux/timer.h>
16#include <linux/mm.h> 16#include <linux/mm.h>
17#include <linux/smp.h> 17#include <linux/smp.h>
18#include <linux/smp_lock.h>
19#include <linux/init.h> 18#include <linux/init.h>
20#include <linux/interrupt.h> 19#include <linux/interrupt.h>
21#include <linux/delay.h> 20#include <linux/delay.h>
diff --git a/arch/s390/kernel/early.c b/arch/s390/kernel/early.c
index f9b144049dc9..cae14c499511 100644
--- a/arch/s390/kernel/early.c
+++ b/arch/s390/kernel/early.c
@@ -208,9 +208,12 @@ static noinline __init void detect_machine_type(void)
208 machine_flags |= MACHINE_FLAG_KVM; 208 machine_flags |= MACHINE_FLAG_KVM;
209 else 209 else
210 machine_flags |= MACHINE_FLAG_VM; 210 machine_flags |= MACHINE_FLAG_VM;
211
212 /* Store machine flags for setting up lowcore early */
213 S390_lowcore.machine_flags = machine_flags;
211} 214}
212 215
213static void early_pgm_check_handler(void) 216static __init void early_pgm_check_handler(void)
214{ 217{
215 unsigned long addr; 218 unsigned long addr;
216 const struct exception_table_entry *fixup; 219 const struct exception_table_entry *fixup;
@@ -222,7 +225,7 @@ static void early_pgm_check_handler(void)
222 S390_lowcore.program_old_psw.addr = fixup->fixup | PSW_ADDR_AMODE; 225 S390_lowcore.program_old_psw.addr = fixup->fixup | PSW_ADDR_AMODE;
223} 226}
224 227
225void setup_lowcore_early(void) 228static noinline __init void setup_lowcore_early(void)
226{ 229{
227 psw_t psw; 230 psw_t psw;
228 231
diff --git a/arch/s390/kernel/ipl.c b/arch/s390/kernel/ipl.c
index b8bf4b140065..371a2d88f4ac 100644
--- a/arch/s390/kernel/ipl.c
+++ b/arch/s390/kernel/ipl.c
@@ -70,6 +70,7 @@ struct shutdown_action {
70 char *name; 70 char *name;
71 void (*fn) (struct shutdown_trigger *trigger); 71 void (*fn) (struct shutdown_trigger *trigger);
72 int (*init) (void); 72 int (*init) (void);
73 int init_rc;
73}; 74};
74 75
75static char *ipl_type_str(enum ipl_type type) 76static char *ipl_type_str(enum ipl_type type)
@@ -1486,11 +1487,13 @@ static int set_trigger(const char *buf, struct shutdown_trigger *trigger,
1486 int i; 1487 int i;
1487 1488
1488 for (i = 0; i < SHUTDOWN_ACTIONS_COUNT; i++) { 1489 for (i = 0; i < SHUTDOWN_ACTIONS_COUNT; i++) {
1489 if (!shutdown_actions_list[i])
1490 continue;
1491 if (sysfs_streq(buf, shutdown_actions_list[i]->name)) { 1490 if (sysfs_streq(buf, shutdown_actions_list[i]->name)) {
1492 trigger->action = shutdown_actions_list[i]; 1491 if (shutdown_actions_list[i]->init_rc) {
1493 return len; 1492 return shutdown_actions_list[i]->init_rc;
1493 } else {
1494 trigger->action = shutdown_actions_list[i];
1495 return len;
1496 }
1494 } 1497 }
1495 } 1498 }
1496 return -EINVAL; 1499 return -EINVAL;
@@ -1640,8 +1643,8 @@ static void __init shutdown_actions_init(void)
1640 for (i = 0; i < SHUTDOWN_ACTIONS_COUNT; i++) { 1643 for (i = 0; i < SHUTDOWN_ACTIONS_COUNT; i++) {
1641 if (!shutdown_actions_list[i]->init) 1644 if (!shutdown_actions_list[i]->init)
1642 continue; 1645 continue;
1643 if (shutdown_actions_list[i]->init()) 1646 shutdown_actions_list[i]->init_rc =
1644 shutdown_actions_list[i] = NULL; 1647 shutdown_actions_list[i]->init();
1645 } 1648 }
1646} 1649}
1647 1650
diff --git a/arch/s390/kernel/ptrace.c b/arch/s390/kernel/ptrace.c
index 490b39934d65..43acd73105b7 100644
--- a/arch/s390/kernel/ptrace.c
+++ b/arch/s390/kernel/ptrace.c
@@ -26,7 +26,6 @@
26#include <linux/sched.h> 26#include <linux/sched.h>
27#include <linux/mm.h> 27#include <linux/mm.h>
28#include <linux/smp.h> 28#include <linux/smp.h>
29#include <linux/smp_lock.h>
30#include <linux/errno.h> 29#include <linux/errno.h>
31#include <linux/ptrace.h> 30#include <linux/ptrace.h>
32#include <linux/user.h> 31#include <linux/user.h>
diff --git a/arch/s390/kernel/smp.c b/arch/s390/kernel/smp.c
index 2270730f5354..be2cae083406 100644
--- a/arch/s390/kernel/smp.c
+++ b/arch/s390/kernel/smp.c
@@ -687,13 +687,14 @@ void __init smp_prepare_cpus(unsigned int max_cpus)
687#ifndef CONFIG_64BIT 687#ifndef CONFIG_64BIT
688 if (MACHINE_HAS_IEEE) 688 if (MACHINE_HAS_IEEE)
689 lowcore->extended_save_area_addr = (u32) save_area; 689 lowcore->extended_save_area_addr = (u32) save_area;
690#else
691 if (vdso_alloc_per_cpu(smp_processor_id(), lowcore))
692 BUG();
693#endif 690#endif
694 set_prefix((u32)(unsigned long) lowcore); 691 set_prefix((u32)(unsigned long) lowcore);
695 local_mcck_enable(); 692 local_mcck_enable();
696 local_irq_enable(); 693 local_irq_enable();
694#ifdef CONFIG_64BIT
695 if (vdso_alloc_per_cpu(smp_processor_id(), &S390_lowcore))
696 BUG();
697#endif
697 for_each_possible_cpu(cpu) 698 for_each_possible_cpu(cpu)
698 if (cpu != smp_processor_id()) 699 if (cpu != smp_processor_id())
699 smp_create_idle(cpu); 700 smp_create_idle(cpu);
diff --git a/arch/s390/kernel/vdso64/clock_gettime.S b/arch/s390/kernel/vdso64/clock_gettime.S
index 79dbfee831ec..49106c6e6f88 100644
--- a/arch/s390/kernel/vdso64/clock_gettime.S
+++ b/arch/s390/kernel/vdso64/clock_gettime.S
@@ -88,10 +88,17 @@ __kernel_clock_gettime:
88 llilh %r4,0x0100 88 llilh %r4,0x0100
89 sar %a4,%r4 89 sar %a4,%r4
90 lghi %r4,0 90 lghi %r4,0
91 epsw %r5,0
91 sacf 512 /* Magic ectg instruction */ 92 sacf 512 /* Magic ectg instruction */
92 .insn ssf,0xc80100000000,__VDSO_ECTG_BASE(4),__VDSO_ECTG_USER(4),4 93 .insn ssf,0xc80100000000,__VDSO_ECTG_BASE(4),__VDSO_ECTG_USER(4),4
93 sacf 0 94 tml %r5,0x4000
94 sar %a4,%r2 95 jo 11f
96 tml %r5,0x8000
97 jno 10f
98 sacf 256
99 j 11f
10010: sacf 0
10111: sar %a4,%r2
95 algr %r1,%r0 /* r1 = cputime as TOD value */ 102 algr %r1,%r0 /* r1 = cputime as TOD value */
96 mghi %r1,1000 /* convert to nanoseconds */ 103 mghi %r1,1000 /* convert to nanoseconds */
97 srlg %r1,%r1,12 /* r1 = cputime in nanosec */ 104 srlg %r1,%r1,12 /* r1 = cputime in nanosec */
diff --git a/arch/s390/kvm/interrupt.c b/arch/s390/kvm/interrupt.c
index f04f5301b1b4..4d613415c435 100644
--- a/arch/s390/kvm/interrupt.c
+++ b/arch/s390/kvm/interrupt.c
@@ -386,7 +386,7 @@ no_timer:
386 } 386 }
387 __unset_cpu_idle(vcpu); 387 __unset_cpu_idle(vcpu);
388 __set_current_state(TASK_RUNNING); 388 __set_current_state(TASK_RUNNING);
389 remove_wait_queue(&vcpu->wq, &wait); 389 remove_wait_queue(&vcpu->arch.local_int.wq, &wait);
390 spin_unlock_bh(&vcpu->arch.local_int.lock); 390 spin_unlock_bh(&vcpu->arch.local_int.lock);
391 spin_unlock(&vcpu->arch.local_int.float_int->lock); 391 spin_unlock(&vcpu->arch.local_int.float_int->lock);
392 hrtimer_try_to_cancel(&vcpu->arch.ckc_timer); 392 hrtimer_try_to_cancel(&vcpu->arch.ckc_timer);
diff --git a/arch/s390/kvm/kvm-s390.c b/arch/s390/kvm/kvm-s390.c
index c18b21d6991c..90d9d1ba258b 100644
--- a/arch/s390/kvm/kvm-s390.c
+++ b/arch/s390/kvm/kvm-s390.c
@@ -25,6 +25,7 @@
25#include <asm/lowcore.h> 25#include <asm/lowcore.h>
26#include <asm/pgtable.h> 26#include <asm/pgtable.h>
27#include <asm/nmi.h> 27#include <asm/nmi.h>
28#include <asm/system.h>
28#include "kvm-s390.h" 29#include "kvm-s390.h"
29#include "gaccess.h" 30#include "gaccess.h"
30 31
@@ -69,6 +70,7 @@ struct kvm_stats_debugfs_item debugfs_entries[] = {
69 { NULL } 70 { NULL }
70}; 71};
71 72
73static unsigned long long *facilities;
72 74
73/* Section: not file related */ 75/* Section: not file related */
74void kvm_arch_hardware_enable(void *garbage) 76void kvm_arch_hardware_enable(void *garbage)
@@ -288,6 +290,7 @@ int kvm_arch_vcpu_setup(struct kvm_vcpu *vcpu)
288 vcpu->arch.sie_block->gmsor = vcpu->kvm->arch.guest_origin; 290 vcpu->arch.sie_block->gmsor = vcpu->kvm->arch.guest_origin;
289 vcpu->arch.sie_block->ecb = 2; 291 vcpu->arch.sie_block->ecb = 2;
290 vcpu->arch.sie_block->eca = 0xC1002001U; 292 vcpu->arch.sie_block->eca = 0xC1002001U;
293 vcpu->arch.sie_block->fac = (int) (long) facilities;
291 hrtimer_init(&vcpu->arch.ckc_timer, CLOCK_REALTIME, HRTIMER_MODE_ABS); 294 hrtimer_init(&vcpu->arch.ckc_timer, CLOCK_REALTIME, HRTIMER_MODE_ABS);
292 tasklet_init(&vcpu->arch.tasklet, kvm_s390_tasklet, 295 tasklet_init(&vcpu->arch.tasklet, kvm_s390_tasklet,
293 (unsigned long) vcpu); 296 (unsigned long) vcpu);
@@ -739,11 +742,29 @@ gfn_t unalias_gfn(struct kvm *kvm, gfn_t gfn)
739 742
740static int __init kvm_s390_init(void) 743static int __init kvm_s390_init(void)
741{ 744{
742 return kvm_init(NULL, sizeof(struct kvm_vcpu), THIS_MODULE); 745 int ret;
746 ret = kvm_init(NULL, sizeof(struct kvm_vcpu), THIS_MODULE);
747 if (ret)
748 return ret;
749
750 /*
751 * guests can ask for up to 255+1 double words, we need a full page
752 * to hold the maximum amount of facilites. On the other hand, we
753 * only set facilities that are known to work in KVM.
754 */
755 facilities = (unsigned long long *) get_zeroed_page(GFP_DMA);
756 if (!facilities) {
757 kvm_exit();
758 return -ENOMEM;
759 }
760 stfle(facilities, 1);
761 facilities[0] &= 0xff00fff3f0700000ULL;
762 return 0;
743} 763}
744 764
745static void __exit kvm_s390_exit(void) 765static void __exit kvm_s390_exit(void)
746{ 766{
767 free_page((unsigned long) facilities);
747 kvm_exit(); 768 kvm_exit();
748} 769}
749 770
diff --git a/arch/s390/kvm/priv.c b/arch/s390/kvm/priv.c
index 93ecd06e1a74..d426aac8095d 100644
--- a/arch/s390/kvm/priv.c
+++ b/arch/s390/kvm/priv.c
@@ -158,7 +158,7 @@ static int handle_stfl(struct kvm_vcpu *vcpu)
158 158
159 vcpu->stat.instruction_stfl++; 159 vcpu->stat.instruction_stfl++;
160 /* only pass the facility bits, which we can handle */ 160 /* only pass the facility bits, which we can handle */
161 facility_list &= 0xfe00fff3; 161 facility_list &= 0xff00fff3;
162 162
163 rc = copy_to_guest(vcpu, offsetof(struct _lowcore, stfl_fac_list), 163 rc = copy_to_guest(vcpu, offsetof(struct _lowcore, stfl_fac_list),
164 &facility_list, sizeof(facility_list)); 164 &facility_list, sizeof(facility_list));
diff --git a/arch/s390/kvm/sigp.c b/arch/s390/kvm/sigp.c
index 36678835034d..0ef81d6776e9 100644
--- a/arch/s390/kvm/sigp.c
+++ b/arch/s390/kvm/sigp.c
@@ -169,7 +169,7 @@ static int __sigp_set_prefix(struct kvm_vcpu *vcpu, u16 cpu_addr, u32 address,
169 unsigned long *reg) 169 unsigned long *reg)
170{ 170{
171 struct kvm_s390_float_interrupt *fi = &vcpu->kvm->arch.float_int; 171 struct kvm_s390_float_interrupt *fi = &vcpu->kvm->arch.float_int;
172 struct kvm_s390_local_interrupt *li; 172 struct kvm_s390_local_interrupt *li = NULL;
173 struct kvm_s390_interrupt_info *inti; 173 struct kvm_s390_interrupt_info *inti;
174 int rc; 174 int rc;
175 u8 tmp; 175 u8 tmp;
@@ -189,9 +189,10 @@ static int __sigp_set_prefix(struct kvm_vcpu *vcpu, u16 cpu_addr, u32 address,
189 return 2; /* busy */ 189 return 2; /* busy */
190 190
191 spin_lock(&fi->lock); 191 spin_lock(&fi->lock);
192 li = fi->local_int[cpu_addr]; 192 if (cpu_addr < KVM_MAX_VCPUS)
193 li = fi->local_int[cpu_addr];
193 194
194 if ((cpu_addr >= KVM_MAX_VCPUS) || (li == NULL)) { 195 if (li == NULL) {
195 rc = 1; /* incorrect state */ 196 rc = 1; /* incorrect state */
196 *reg &= SIGP_STAT_INCORRECT_STATE; 197 *reg &= SIGP_STAT_INCORRECT_STATE;
197 kfree(inti); 198 kfree(inti);
diff --git a/arch/s390/lib/Makefile b/arch/s390/lib/Makefile
index ab6735df2d21..97975ec7a274 100644
--- a/arch/s390/lib/Makefile
+++ b/arch/s390/lib/Makefile
@@ -3,6 +3,6 @@
3# 3#
4 4
5lib-y += delay.o string.o uaccess_std.o uaccess_pt.o 5lib-y += delay.o string.o uaccess_std.o uaccess_pt.o
6obj-$(CONFIG_32BIT) += div64.o qrnnd.o 6obj-$(CONFIG_32BIT) += div64.o qrnnd.o ucmpdi2.o
7lib-$(CONFIG_64BIT) += uaccess_mvcos.o 7lib-$(CONFIG_64BIT) += uaccess_mvcos.o
8lib-$(CONFIG_SMP) += spinlock.o 8lib-$(CONFIG_SMP) += spinlock.o
diff --git a/arch/s390/lib/delay.c b/arch/s390/lib/delay.c
index 3f5f680726ed..97c1eca83cc2 100644
--- a/arch/s390/lib/delay.c
+++ b/arch/s390/lib/delay.c
@@ -36,9 +36,11 @@ static void __udelay_disabled(unsigned long usecs)
36 cr0 = (cr0_saved & 0xffff00e0) | 0x00000800; 36 cr0 = (cr0_saved & 0xffff00e0) | 0x00000800;
37 __ctl_load(cr0 , 0, 0); 37 __ctl_load(cr0 , 0, 0);
38 mask = psw_kernel_bits | PSW_MASK_WAIT | PSW_MASK_EXT; 38 mask = psw_kernel_bits | PSW_MASK_WAIT | PSW_MASK_EXT;
39 lockdep_off();
39 trace_hardirqs_on(); 40 trace_hardirqs_on();
40 __load_psw_mask(mask); 41 __load_psw_mask(mask);
41 local_irq_disable(); 42 local_irq_disable();
43 lockdep_on();
42 __ctl_load(cr0_saved, 0, 0); 44 __ctl_load(cr0_saved, 0, 0);
43 local_tick_enable(clock_saved); 45 local_tick_enable(clock_saved);
44 set_clock_comparator(S390_lowcore.clock_comparator); 46 set_clock_comparator(S390_lowcore.clock_comparator);
diff --git a/arch/s390/lib/ucmpdi2.c b/arch/s390/lib/ucmpdi2.c
new file mode 100644
index 000000000000..3e05ff532582
--- /dev/null
+++ b/arch/s390/lib/ucmpdi2.c
@@ -0,0 +1,26 @@
1#include <linux/module.h>
2
3union ull_union {
4 unsigned long long ull;
5 struct {
6 unsigned int high;
7 unsigned int low;
8 } ui;
9};
10
11int __ucmpdi2(unsigned long long a, unsigned long long b)
12{
13 union ull_union au = {.ull = a};
14 union ull_union bu = {.ull = b};
15
16 if (au.ui.high < bu.ui.high)
17 return 0;
18 else if (au.ui.high > bu.ui.high)
19 return 2;
20 if (au.ui.low < bu.ui.low)
21 return 0;
22 else if (au.ui.low > bu.ui.low)
23 return 2;
24 return 1;
25}
26EXPORT_SYMBOL(__ucmpdi2);
diff --git a/arch/s390/mm/fault.c b/arch/s390/mm/fault.c
index 74eb26bf1970..e5e119fe03b2 100644
--- a/arch/s390/mm/fault.c
+++ b/arch/s390/mm/fault.c
@@ -22,7 +22,6 @@
22#include <linux/compat.h> 22#include <linux/compat.h>
23#include <linux/smp.h> 23#include <linux/smp.h>
24#include <linux/kdebug.h> 24#include <linux/kdebug.h>
25#include <linux/smp_lock.h>
26#include <linux/init.h> 25#include <linux/init.h>
27#include <linux/console.h> 26#include <linux/console.h>
28#include <linux/module.h> 27#include <linux/module.h>
diff --git a/arch/s390/power/swsusp.c b/arch/s390/power/swsusp.c
index e6a4fe9f5f24..bd1f5c6b0b8c 100644
--- a/arch/s390/power/swsusp.c
+++ b/arch/s390/power/swsusp.c
@@ -7,24 +7,36 @@
7 * 7 *
8 */ 8 */
9 9
10#include <asm/system.h>
10 11
11/*
12 * save CPU registers before creating a hibernation image and before
13 * restoring the memory state from it
14 */
15void save_processor_state(void) 12void save_processor_state(void)
16{ 13{
17 /* implentation contained in the 14 /* swsusp_arch_suspend() actually saves all cpu register contents.
18 * swsusp_arch_suspend function 15 * Machine checks must be disabled since swsusp_arch_suspend() stores
16 * register contents to their lowcore save areas. That's the same
17 * place where register contents on machine checks would be saved.
18 * To avoid register corruption disable machine checks.
19 * We must also disable machine checks in the new psw mask for
20 * program checks, since swsusp_arch_suspend() may generate program
21 * checks. Disabling machine checks for all other new psw masks is
22 * just paranoia.
19 */ 23 */
24 local_mcck_disable();
25 /* Disable lowcore protection */
26 __ctl_clear_bit(0,28);
27 S390_lowcore.external_new_psw.mask &= ~PSW_MASK_MCHECK;
28 S390_lowcore.svc_new_psw.mask &= ~PSW_MASK_MCHECK;
29 S390_lowcore.io_new_psw.mask &= ~PSW_MASK_MCHECK;
30 S390_lowcore.program_new_psw.mask &= ~PSW_MASK_MCHECK;
20} 31}
21 32
22/*
23 * restore the contents of CPU registers
24 */
25void restore_processor_state(void) 33void restore_processor_state(void)
26{ 34{
27 /* implentation contained in the 35 S390_lowcore.external_new_psw.mask |= PSW_MASK_MCHECK;
28 * swsusp_arch_resume function 36 S390_lowcore.svc_new_psw.mask |= PSW_MASK_MCHECK;
29 */ 37 S390_lowcore.io_new_psw.mask |= PSW_MASK_MCHECK;
38 S390_lowcore.program_new_psw.mask |= PSW_MASK_MCHECK;
39 /* Enable lowcore protection */
40 __ctl_set_bit(0,28);
41 local_mcck_enable();
30} 42}
diff --git a/arch/s390/power/swsusp_asm64.S b/arch/s390/power/swsusp_asm64.S
index 76d688da32fa..b26df5c5933e 100644
--- a/arch/s390/power/swsusp_asm64.S
+++ b/arch/s390/power/swsusp_asm64.S
@@ -32,19 +32,14 @@ swsusp_arch_suspend:
32 /* Deactivate DAT */ 32 /* Deactivate DAT */
33 stnsm __SF_EMPTY(%r15),0xfb 33 stnsm __SF_EMPTY(%r15),0xfb
34 34
35 /* Switch off lowcore protection */
36 stctg %c0,%c0,__SF_EMPTY(%r15)
37 ni __SF_EMPTY+4(%r15),0xef
38 lctlg %c0,%c0,__SF_EMPTY(%r15)
39
40 /* Store prefix register on stack */ 35 /* Store prefix register on stack */
41 stpx __SF_EMPTY(%r15) 36 stpx __SF_EMPTY(%r15)
42 37
43 /* Setup base register for lowcore (absolute 0) */ 38 /* Save prefix register contents for lowcore */
44 llgf %r1,__SF_EMPTY(%r15) 39 llgf %r4,__SF_EMPTY(%r15)
45 40
46 /* Get pointer to save area */ 41 /* Get pointer to save area */
47 aghi %r1,0x1000 42 lghi %r1,0x1000
48 43
49 /* Store registers */ 44 /* Store registers */
50 mvc 0x318(4,%r1),__SF_EMPTY(%r15) /* move prefix to lowcore */ 45 mvc 0x318(4,%r1),__SF_EMPTY(%r15) /* move prefix to lowcore */
@@ -79,17 +74,15 @@ swsusp_arch_suspend:
79 xc __SF_EMPTY(4,%r15),__SF_EMPTY(%r15) 74 xc __SF_EMPTY(4,%r15),__SF_EMPTY(%r15)
80 spx __SF_EMPTY(%r15) 75 spx __SF_EMPTY(%r15)
81 76
82 /* Setup lowcore */ 77 lghi %r2,0
83 brasl %r14,setup_lowcore_early 78 lghi %r3,2*PAGE_SIZE
79 lghi %r5,2*PAGE_SIZE
801: mvcle %r2,%r4,0
81 jo 1b
84 82
85 /* Save image */ 83 /* Save image */
86 brasl %r14,swsusp_save 84 brasl %r14,swsusp_save
87 85
88 /* Switch on lowcore protection */
89 stctg %c0,%c0,__SF_EMPTY(%r15)
90 oi __SF_EMPTY+4(%r15),0x10
91 lctlg %c0,%c0,__SF_EMPTY(%r15)
92
93 /* Restore prefix register and return */ 86 /* Restore prefix register and return */
94 lghi %r1,0x1000 87 lghi %r1,0x1000
95 spx 0x318(%r1) 88 spx 0x318(%r1)
@@ -117,11 +110,6 @@ swsusp_arch_resume:
117 /* Deactivate DAT */ 110 /* Deactivate DAT */
118 stnsm __SF_EMPTY(%r15),0xfb 111 stnsm __SF_EMPTY(%r15),0xfb
119 112
120 /* Switch off lowcore protection */
121 stctg %c0,%c0,__SF_EMPTY(%r15)
122 ni __SF_EMPTY+4(%r15),0xef
123 lctlg %c0,%c0,__SF_EMPTY(%r15)
124
125 /* Set prefix page to zero */ 113 /* Set prefix page to zero */
126 xc __SF_EMPTY(4,%r15),__SF_EMPTY(%r15) 114 xc __SF_EMPTY(4,%r15),__SF_EMPTY(%r15)
127 spx __SF_EMPTY(%r15) 115 spx __SF_EMPTY(%r15)
@@ -175,7 +163,7 @@ swsusp_arch_resume:
175 /* Load old stack */ 163 /* Load old stack */
176 lg %r15,0x2f8(%r13) 164 lg %r15,0x2f8(%r13)
177 165
178 /* Pointer to save arae */ 166 /* Pointer to save area */
179 lghi %r13,0x1000 167 lghi %r13,0x1000
180 168
181#ifdef CONFIG_SMP 169#ifdef CONFIG_SMP
@@ -187,11 +175,6 @@ swsusp_arch_resume:
187 /* Restore prefix register */ 175 /* Restore prefix register */
188 spx 0x318(%r13) 176 spx 0x318(%r13)
189 177
190 /* Switch on lowcore protection */
191 stctg %c0,%c0,__SF_EMPTY(%r15)
192 oi __SF_EMPTY+4(%r15),0x10
193 lctlg %c0,%c0,__SF_EMPTY(%r15)
194
195 /* Activate DAT */ 178 /* Activate DAT */
196 stosm __SF_EMPTY(%r15),0x04 179 stosm __SF_EMPTY(%r15),0x04
197 180
diff --git a/arch/sh/Kconfig.debug b/arch/sh/Kconfig.debug
index 8ece0b5bd028..39224b57c6ef 100644
--- a/arch/sh/Kconfig.debug
+++ b/arch/sh/Kconfig.debug
@@ -61,10 +61,6 @@ config EARLY_PRINTK
61 select both the EARLY_SCIF_CONSOLE and SH_STANDARD_BIOS, using 61 select both the EARLY_SCIF_CONSOLE and SH_STANDARD_BIOS, using
62 the kernel command line option to toggle back and forth. 62 the kernel command line option to toggle back and forth.
63 63
64config DEBUG_BOOTMEM
65 depends on DEBUG_KERNEL
66 bool "Debug BOOTMEM initialization"
67
68config DEBUG_STACKOVERFLOW 64config DEBUG_STACKOVERFLOW
69 bool "Check for stack overflows" 65 bool "Check for stack overflows"
70 depends on DEBUG_KERNEL && SUPERH32 66 depends on DEBUG_KERNEL && SUPERH32
diff --git a/arch/sh/boards/mach-se/7206/io.c b/arch/sh/boards/mach-se/7206/io.c
index 9c3a33210d61..180455642a43 100644
--- a/arch/sh/boards/mach-se/7206/io.c
+++ b/arch/sh/boards/mach-se/7206/io.c
@@ -50,7 +50,7 @@ unsigned char se7206_inb_p(unsigned long port)
50 50
51unsigned short se7206_inw(unsigned long port) 51unsigned short se7206_inw(unsigned long port)
52{ 52{
53 return *port2adr(port);; 53 return *port2adr(port);
54} 54}
55 55
56void se7206_outb(unsigned char value, unsigned long port) 56void se7206_outb(unsigned char value, unsigned long port)
diff --git a/arch/sh/boards/mach-se/7724/setup.c b/arch/sh/boards/mach-se/7724/setup.c
index 9cd04bd558b8..8fed45a2fb85 100644
--- a/arch/sh/boards/mach-se/7724/setup.c
+++ b/arch/sh/boards/mach-se/7724/setup.c
@@ -19,10 +19,13 @@
19#include <linux/smc91x.h> 19#include <linux/smc91x.h>
20#include <linux/gpio.h> 20#include <linux/gpio.h>
21#include <linux/input.h> 21#include <linux/input.h>
22#include <linux/usb/r8a66597.h>
22#include <video/sh_mobile_lcdc.h> 23#include <video/sh_mobile_lcdc.h>
23#include <media/sh_mobile_ceu.h> 24#include <media/sh_mobile_ceu.h>
24#include <asm/io.h> 25#include <asm/io.h>
25#include <asm/heartbeat.h> 26#include <asm/heartbeat.h>
27#include <asm/sh_eth.h>
28#include <asm/clock.h>
26#include <asm/sh_keysc.h> 29#include <asm/sh_keysc.h>
27#include <cpu/sh7724.h> 30#include <cpu/sh7724.h>
28#include <mach-se/mach/se7724.h> 31#include <mach-se/mach/se7724.h>
@@ -272,6 +275,62 @@ static struct platform_device keysc_device = {
272 }, 275 },
273}; 276};
274 277
278/* SH Eth */
279static struct resource sh_eth_resources[] = {
280 [0] = {
281 .start = SH_ETH_ADDR,
282 .end = SH_ETH_ADDR + 0x1FC,
283 .flags = IORESOURCE_MEM,
284 },
285 [1] = {
286 .start = 91,
287 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
288 },
289};
290
291struct sh_eth_plat_data sh_eth_plat = {
292 .phy = 0x1f, /* SMSC LAN8187 */
293 .edmac_endian = EDMAC_LITTLE_ENDIAN,
294};
295
296static struct platform_device sh_eth_device = {
297 .name = "sh-eth",
298 .id = 0,
299 .dev = {
300 .platform_data = &sh_eth_plat,
301 },
302 .num_resources = ARRAY_SIZE(sh_eth_resources),
303 .resource = sh_eth_resources,
304};
305
306static struct r8a66597_platdata sh7724_usb0_host_data = {
307};
308
309static struct resource sh7724_usb0_host_resources[] = {
310 [0] = {
311 .start = 0xa4d80000,
312 .end = 0xa4d800ff,
313 .flags = IORESOURCE_MEM,
314 },
315 [1] = {
316 .start = 65,
317 .end = 65,
318 .flags = IORESOURCE_IRQ | IRQF_TRIGGER_LOW,
319 },
320};
321
322static struct platform_device sh7724_usb0_host_device = {
323 .name = "r8a66597_hcd",
324 .id = 0,
325 .dev = {
326 .dma_mask = NULL, /* not use dma */
327 .coherent_dma_mask = 0xffffffff,
328 .platform_data = &sh7724_usb0_host_data,
329 },
330 .num_resources = ARRAY_SIZE(sh7724_usb0_host_resources),
331 .resource = sh7724_usb0_host_resources,
332};
333
275static struct platform_device *ms7724se_devices[] __initdata = { 334static struct platform_device *ms7724se_devices[] __initdata = {
276 &heartbeat_device, 335 &heartbeat_device,
277 &smc91x_eth_device, 336 &smc91x_eth_device,
@@ -280,11 +339,62 @@ static struct platform_device *ms7724se_devices[] __initdata = {
280 &ceu0_device, 339 &ceu0_device,
281 &ceu1_device, 340 &ceu1_device,
282 &keysc_device, 341 &keysc_device,
342 &sh_eth_device,
343 &sh7724_usb0_host_device,
283}; 344};
284 345
346#define EEPROM_OP 0xBA206000
347#define EEPROM_ADR 0xBA206004
348#define EEPROM_DATA 0xBA20600C
349#define EEPROM_STAT 0xBA206010
350#define EEPROM_STRT 0xBA206014
351static int __init sh_eth_is_eeprom_ready(void)
352{
353 int t = 10000;
354
355 while (t--) {
356 if (!ctrl_inw(EEPROM_STAT))
357 return 1;
358 cpu_relax();
359 }
360
361 printk(KERN_ERR "ms7724se can not access to eeprom\n");
362 return 0;
363}
364
365static void __init sh_eth_init(void)
366{
367 int i;
368 u16 mac[3];
369
370 /* check EEPROM status */
371 if (!sh_eth_is_eeprom_ready())
372 return;
373
374 /* read MAC addr from EEPROM */
375 for (i = 0 ; i < 3 ; i++) {
376 ctrl_outw(0x0, EEPROM_OP); /* read */
377 ctrl_outw(i*2, EEPROM_ADR);
378 ctrl_outw(0x1, EEPROM_STRT);
379 if (!sh_eth_is_eeprom_ready())
380 return;
381
382 mac[i] = ctrl_inw(EEPROM_DATA);
383 mac[i] = ((mac[i] & 0xFF) << 8) | (mac[i] >> 8); /* swap */
384 }
385
386 /* reset sh-eth */
387 ctrl_outl(0x1, SH_ETH_ADDR + 0x0);
388
389 /* set MAC addr */
390 ctrl_outl(((mac[0] << 16) | (mac[1])), SH_ETH_MAHR);
391 ctrl_outl((mac[2]), SH_ETH_MALR);
392}
393
285#define SW4140 0xBA201000 394#define SW4140 0xBA201000
286#define FPGA_OUT 0xBA200400 395#define FPGA_OUT 0xBA200400
287#define PORT_HIZA 0xA4050158 396#define PORT_HIZA 0xA4050158
397#define PORT_MSELCRB 0xA4050182
288 398
289#define SW41_A 0x0100 399#define SW41_A 0x0100
290#define SW41_B 0x0200 400#define SW41_B 0x0200
@@ -294,6 +404,7 @@ static struct platform_device *ms7724se_devices[] __initdata = {
294#define SW41_F 0x2000 404#define SW41_F 0x2000
295#define SW41_G 0x4000 405#define SW41_G 0x4000
296#define SW41_H 0x8000 406#define SW41_H 0x8000
407
297static int __init devices_setup(void) 408static int __init devices_setup(void)
298{ 409{
299 u16 sw = ctrl_inw(SW4140); /* select camera, monitor */ 410 u16 sw = ctrl_inw(SW4140); /* select camera, monitor */
@@ -302,9 +413,16 @@ static int __init devices_setup(void)
302 ctrl_outw(ctrl_inw(FPGA_OUT) & 413 ctrl_outw(ctrl_inw(FPGA_OUT) &
303 ~((1 << 1) | /* LAN */ 414 ~((1 << 1) | /* LAN */
304 (1 << 6) | /* VIDEO DAC */ 415 (1 << 6) | /* VIDEO DAC */
305 (1 << 12)), /* USB0 */ 416 (1 << 12) | /* USB0 */
417 (1 << 14)), /* RMII */
306 FPGA_OUT); 418 FPGA_OUT);
307 419
420 /* turn on USB clocks, use external clock */
421 ctrl_outw((ctrl_inw(PORT_MSELCRB) & ~0xc000) | 0x8000, PORT_MSELCRB);
422
423 /* enable USB0 port */
424 ctrl_outw(0x0600, 0xa40501d4);
425
308 /* enable IRQ 0,1,2 */ 426 /* enable IRQ 0,1,2 */
309 gpio_request(GPIO_FN_INTC_IRQ0, NULL); 427 gpio_request(GPIO_FN_INTC_IRQ0, NULL);
310 gpio_request(GPIO_FN_INTC_IRQ1, NULL); 428 gpio_request(GPIO_FN_INTC_IRQ1, NULL);
@@ -374,7 +492,7 @@ static int __init devices_setup(void)
374 gpio_request(GPIO_FN_VIO0_CLK, NULL); 492 gpio_request(GPIO_FN_VIO0_CLK, NULL);
375 gpio_request(GPIO_FN_VIO0_FLD, NULL); 493 gpio_request(GPIO_FN_VIO0_FLD, NULL);
376 gpio_request(GPIO_FN_VIO0_HD, NULL); 494 gpio_request(GPIO_FN_VIO0_HD, NULL);
377 platform_resource_setup_memory(&ceu0_device, "ceu", 4 << 20); 495 platform_resource_setup_memory(&ceu0_device, "ceu0", 4 << 20);
378 496
379 /* enable CEU1 */ 497 /* enable CEU1 */
380 gpio_request(GPIO_FN_VIO1_D7, NULL); 498 gpio_request(GPIO_FN_VIO1_D7, NULL);
@@ -389,7 +507,7 @@ static int __init devices_setup(void)
389 gpio_request(GPIO_FN_VIO1_HD, NULL); 507 gpio_request(GPIO_FN_VIO1_HD, NULL);
390 gpio_request(GPIO_FN_VIO1_VD, NULL); 508 gpio_request(GPIO_FN_VIO1_VD, NULL);
391 gpio_request(GPIO_FN_VIO1_CLK, NULL); 509 gpio_request(GPIO_FN_VIO1_CLK, NULL);
392 platform_resource_setup_memory(&ceu1_device, "ceu", 4 << 20); 510 platform_resource_setup_memory(&ceu1_device, "ceu1", 4 << 20);
393 511
394 /* KEYSC */ 512 /* KEYSC */
395 gpio_request(GPIO_FN_KEYOUT5_IN5, NULL); 513 gpio_request(GPIO_FN_KEYOUT5_IN5, NULL);
@@ -404,6 +522,28 @@ static int __init devices_setup(void)
404 gpio_request(GPIO_FN_KEYOUT1, NULL); 522 gpio_request(GPIO_FN_KEYOUT1, NULL);
405 gpio_request(GPIO_FN_KEYOUT0, NULL); 523 gpio_request(GPIO_FN_KEYOUT0, NULL);
406 524
525 /*
526 * enable SH-Eth
527 *
528 * please remove J33 pin from your board !!
529 *
530 * ms7724 board should not use GPIO_FN_LNKSTA pin
531 * So, This time PTX5 is set to input pin
532 */
533 gpio_request(GPIO_FN_RMII_RXD0, NULL);
534 gpio_request(GPIO_FN_RMII_RXD1, NULL);
535 gpio_request(GPIO_FN_RMII_TXD0, NULL);
536 gpio_request(GPIO_FN_RMII_TXD1, NULL);
537 gpio_request(GPIO_FN_RMII_REF_CLK, NULL);
538 gpio_request(GPIO_FN_RMII_TX_EN, NULL);
539 gpio_request(GPIO_FN_RMII_RX_ER, NULL);
540 gpio_request(GPIO_FN_RMII_CRS_DV, NULL);
541 gpio_request(GPIO_FN_MDIO, NULL);
542 gpio_request(GPIO_FN_MDC, NULL);
543 gpio_request(GPIO_PTX5, NULL);
544 gpio_direction_input(GPIO_PTX5);
545 sh_eth_init();
546
407 if (sw & SW41_B) { 547 if (sw & SW41_B) {
408 /* SVGA */ 548 /* SVGA */
409 lcdc_info.ch[0].lcd_cfg.xres = 800; 549 lcdc_info.ch[0].lcd_cfg.xres = 800;
@@ -437,7 +577,7 @@ static int __init devices_setup(void)
437 } 577 }
438 578
439 return platform_add_devices(ms7724se_devices, 579 return platform_add_devices(ms7724se_devices,
440 ARRAY_SIZE(ms7724se_devices)); 580 ARRAY_SIZE(ms7724se_devices));
441} 581}
442device_initcall(devices_setup); 582device_initcall(devices_setup);
443 583
diff --git a/arch/sh/configs/migor_defconfig b/arch/sh/configs/migor_defconfig
index da627d22c009..b18cfd39cac6 100644
--- a/arch/sh/configs/migor_defconfig
+++ b/arch/sh/configs/migor_defconfig
@@ -309,7 +309,7 @@ CONFIG_ZERO_PAGE_OFFSET=0x00001000
309CONFIG_BOOT_LINK_OFFSET=0x00800000 309CONFIG_BOOT_LINK_OFFSET=0x00800000
310CONFIG_ENTRY_OFFSET=0x00001000 310CONFIG_ENTRY_OFFSET=0x00001000
311CONFIG_CMDLINE_BOOL=y 311CONFIG_CMDLINE_BOOL=y
312CONFIG_CMDLINE="console=ttySC0,115200 earlyprintk=serial ip=on root=/dev/nfs ip=dhcp" 312CONFIG_CMDLINE="console=tty0 console=ttySC0,115200 earlyprintk=serial ip=on root=/dev/nfs ip=dhcp"
313 313
314# 314#
315# Bus options 315# Bus options
@@ -858,7 +858,35 @@ CONFIG_VIDEO_SH_MOBILE_CEU=y
858# 858#
859# CONFIG_VGASTATE is not set 859# CONFIG_VGASTATE is not set
860# CONFIG_VIDEO_OUTPUT_CONTROL is not set 860# CONFIG_VIDEO_OUTPUT_CONTROL is not set
861# CONFIG_FB is not set 861CONFIG_FB=y
862# CONFIG_FIRMWARE_EDID is not set
863# CONFIG_FB_DDC is not set
864# CONFIG_FB_BOOT_VESA_SUPPORT is not set
865# CONFIG_FB_CFB_FILLRECT is not set
866# CONFIG_FB_CFB_COPYAREA is not set
867# CONFIG_FB_CFB_IMAGEBLIT is not set
868# CONFIG_FB_CFB_REV_PIXELS_IN_BYTE is not set
869CONFIG_FB_SYS_FILLRECT=y
870CONFIG_FB_SYS_COPYAREA=y
871CONFIG_FB_SYS_IMAGEBLIT=y
872# CONFIG_FB_FOREIGN_ENDIAN is not set
873CONFIG_FB_SYS_FOPS=y
874CONFIG_FB_DEFERRED_IO=y
875# CONFIG_FB_SVGALIB is not set
876# CONFIG_FB_MACMODES is not set
877# CONFIG_FB_BACKLIGHT is not set
878# CONFIG_FB_MODE_HELPERS is not set
879# CONFIG_FB_TILEBLITTING is not set
880
881#
882# Frame buffer hardware drivers
883#
884# CONFIG_FB_S1D13XXX is not set
885CONFIG_FB_SH_MOBILE_LCDC=y
886# CONFIG_FB_VIRTUAL is not set
887# CONFIG_FB_METRONOME is not set
888# CONFIG_FB_MB862XX is not set
889# CONFIG_FB_BROADSHEET is not set
862# CONFIG_BACKLIGHT_LCD_SUPPORT is not set 890# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
863 891
864# 892#
@@ -870,6 +898,27 @@ CONFIG_VIDEO_SH_MOBILE_CEU=y
870# Console display driver support 898# Console display driver support
871# 899#
872CONFIG_DUMMY_CONSOLE=y 900CONFIG_DUMMY_CONSOLE=y
901CONFIG_FRAMEBUFFER_CONSOLE=y
902CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY=y
903# CONFIG_FRAMEBUFFER_CONSOLE_ROTATION is not set
904CONFIG_FONTS=y
905# CONFIG_FONT_8x8 is not set
906# CONFIG_FONT_8x16 is not set
907# CONFIG_FONT_6x11 is not set
908# CONFIG_FONT_7x14 is not set
909# CONFIG_FONT_PEARL_8x8 is not set
910# CONFIG_FONT_ACORN_8x8 is not set
911CONFIG_FONT_MINI_4x6=y
912# CONFIG_FONT_SUN8x16 is not set
913# CONFIG_FONT_SUN12x22 is not set
914# CONFIG_FONT_10x18 is not set
915CONFIG_LOGO=y
916# CONFIG_LOGO_LINUX_MONO is not set
917# CONFIG_LOGO_LINUX_VGA16 is not set
918# CONFIG_LOGO_LINUX_CLUT224 is not set
919# CONFIG_LOGO_SUPERH_MONO is not set
920CONFIG_LOGO_SUPERH_VGA16=y
921# CONFIG_LOGO_SUPERH_CLUT224 is not set
873# CONFIG_SOUND is not set 922# CONFIG_SOUND is not set
874CONFIG_HID_SUPPORT=y 923CONFIG_HID_SUPPORT=y
875CONFIG_HID=y 924CONFIG_HID=y
diff --git a/arch/sh/configs/se7724_defconfig b/arch/sh/configs/se7724_defconfig
index 3840270283e4..3ee783a0a075 100644
--- a/arch/sh/configs/se7724_defconfig
+++ b/arch/sh/configs/se7724_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.30 3# Linux kernel version: 2.6.30
4# Thu Jun 18 16:09:05 2009 4# Mon Jun 29 16:28:43 2009
5# 5#
6CONFIG_SUPERH=y 6CONFIG_SUPERH=y
7CONFIG_SUPERH32=y 7CONFIG_SUPERH32=y
@@ -14,6 +14,7 @@ CONFIG_GENERIC_HWEIGHT=y
14CONFIG_GENERIC_HARDIRQS=y 14CONFIG_GENERIC_HARDIRQS=y
15CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y 15CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
16CONFIG_GENERIC_IRQ_PROBE=y 16CONFIG_GENERIC_IRQ_PROBE=y
17CONFIG_IRQ_PER_CPU=y
17CONFIG_GENERIC_GPIO=y 18CONFIG_GENERIC_GPIO=y
18CONFIG_GENERIC_TIME=y 19CONFIG_GENERIC_TIME=y
19CONFIG_GENERIC_CLOCKEVENTS=y 20CONFIG_GENERIC_CLOCKEVENTS=y
@@ -28,7 +29,9 @@ CONFIG_HAVE_LATENCYTOP_SUPPORT=y
28# CONFIG_ARCH_HAS_ILOG2_U64 is not set 29# CONFIG_ARCH_HAS_ILOG2_U64 is not set
29CONFIG_ARCH_NO_VIRT_TO_BUS=y 30CONFIG_ARCH_NO_VIRT_TO_BUS=y
30CONFIG_ARCH_HAS_DEFAULT_IDLE=y 31CONFIG_ARCH_HAS_DEFAULT_IDLE=y
32CONFIG_ARCH_HAS_CPU_IDLE_WAIT=y
31CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" 33CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
34CONFIG_CONSTRUCTORS=y
32 35
33# 36#
34# General setup 37# General setup
@@ -88,10 +91,12 @@ CONFIG_TIMERFD=y
88CONFIG_EVENTFD=y 91CONFIG_EVENTFD=y
89CONFIG_SHMEM=y 92CONFIG_SHMEM=y
90CONFIG_AIO=y 93CONFIG_AIO=y
94CONFIG_HAVE_PERF_COUNTERS=y
91 95
92# 96#
93# Performance Counters 97# Performance Counters
94# 98#
99# CONFIG_PERF_COUNTERS is not set
95CONFIG_VM_EVENT_COUNTERS=y 100CONFIG_VM_EVENT_COUNTERS=y
96# CONFIG_STRIP_ASM_SYMS is not set 101# CONFIG_STRIP_ASM_SYMS is not set
97CONFIG_COMPAT_BRK=y 102CONFIG_COMPAT_BRK=y
@@ -107,6 +112,10 @@ CONFIG_HAVE_KRETPROBES=y
107CONFIG_HAVE_ARCH_TRACEHOOK=y 112CONFIG_HAVE_ARCH_TRACEHOOK=y
108CONFIG_HAVE_CLK=y 113CONFIG_HAVE_CLK=y
109CONFIG_HAVE_DMA_API_DEBUG=y 114CONFIG_HAVE_DMA_API_DEBUG=y
115
116#
117# GCOV-based kernel profiling
118#
110# CONFIG_SLOW_WORK is not set 119# CONFIG_SLOW_WORK is not set
111CONFIG_HAVE_GENERIC_DMA_COHERENT=y 120CONFIG_HAVE_GENERIC_DMA_COHERENT=y
112CONFIG_SLABINFO=y 121CONFIG_SLABINFO=y
@@ -119,7 +128,7 @@ CONFIG_MODULE_UNLOAD=y
119# CONFIG_MODVERSIONS is not set 128# CONFIG_MODVERSIONS is not set
120# CONFIG_MODULE_SRCVERSION_ALL is not set 129# CONFIG_MODULE_SRCVERSION_ALL is not set
121CONFIG_BLOCK=y 130CONFIG_BLOCK=y
122# CONFIG_LBD is not set 131CONFIG_LBDAF=y
123# CONFIG_BLK_DEV_BSG is not set 132# CONFIG_BLK_DEV_BSG is not set
124# CONFIG_BLK_DEV_INTEGRITY is not set 133# CONFIG_BLK_DEV_INTEGRITY is not set
125 134
@@ -584,7 +593,6 @@ CONFIG_SCSI_WAIT_SCAN=m
584# CONFIG_SCSI_SRP_ATTRS is not set 593# CONFIG_SCSI_SRP_ATTRS is not set
585CONFIG_SCSI_LOWLEVEL=y 594CONFIG_SCSI_LOWLEVEL=y
586# CONFIG_ISCSI_TCP is not set 595# CONFIG_ISCSI_TCP is not set
587# CONFIG_SCSI_BNX2_ISCSI is not set
588# CONFIG_LIBFC is not set 596# CONFIG_LIBFC is not set
589# CONFIG_LIBFCOE is not set 597# CONFIG_LIBFCOE is not set
590# CONFIG_SCSI_DEBUG is not set 598# CONFIG_SCSI_DEBUG is not set
@@ -624,7 +632,7 @@ CONFIG_NET_ETHERNET=y
624CONFIG_MII=y 632CONFIG_MII=y
625# CONFIG_AX88796 is not set 633# CONFIG_AX88796 is not set
626# CONFIG_STNIC is not set 634# CONFIG_STNIC is not set
627# CONFIG_SH_ETH is not set 635CONFIG_SH_ETH=y
628CONFIG_SMC91X=y 636CONFIG_SMC91X=y
629# CONFIG_ENC28J60 is not set 637# CONFIG_ENC28J60 is not set
630# CONFIG_ETHOC is not set 638# CONFIG_ETHOC is not set
@@ -801,6 +809,11 @@ CONFIG_SPI_BITBANG=y
801# 809#
802# CONFIG_SPI_SPIDEV is not set 810# CONFIG_SPI_SPIDEV is not set
803# CONFIG_SPI_TLE62X0 is not set 811# CONFIG_SPI_TLE62X0 is not set
812
813#
814# PPS support
815#
816# CONFIG_PPS is not set
804CONFIG_ARCH_REQUIRE_GPIOLIB=y 817CONFIG_ARCH_REQUIRE_GPIOLIB=y
805CONFIG_GPIOLIB=y 818CONFIG_GPIOLIB=y
806# CONFIG_GPIO_SYSFS is not set 819# CONFIG_GPIO_SYSFS is not set
@@ -851,6 +864,8 @@ CONFIG_SSB_POSSIBLE=y
851# CONFIG_MFD_WM8400 is not set 864# CONFIG_MFD_WM8400 is not set
852# CONFIG_MFD_WM8350_I2C is not set 865# CONFIG_MFD_WM8350_I2C is not set
853# CONFIG_MFD_PCF50633 is not set 866# CONFIG_MFD_PCF50633 is not set
867# CONFIG_AB3100_CORE is not set
868# CONFIG_EZX_PCAP is not set
854# CONFIG_REGULATOR is not set 869# CONFIG_REGULATOR is not set
855CONFIG_MEDIA_SUPPORT=y 870CONFIG_MEDIA_SUPPORT=y
856 871
@@ -1196,6 +1211,7 @@ CONFIG_RTC_DRV_PCF8563=y
1196# CONFIG_RTC_DRV_S35390A is not set 1211# CONFIG_RTC_DRV_S35390A is not set
1197# CONFIG_RTC_DRV_FM3130 is not set 1212# CONFIG_RTC_DRV_FM3130 is not set
1198# CONFIG_RTC_DRV_RX8581 is not set 1213# CONFIG_RTC_DRV_RX8581 is not set
1214# CONFIG_RTC_DRV_RX8025 is not set
1199 1215
1200# 1216#
1201# SPI RTC drivers 1217# SPI RTC drivers
@@ -1260,6 +1276,7 @@ CONFIG_FS_MBCACHE=y
1260# CONFIG_JFS_FS is not set 1276# CONFIG_JFS_FS is not set
1261CONFIG_FS_POSIX_ACL=y 1277CONFIG_FS_POSIX_ACL=y
1262# CONFIG_XFS_FS is not set 1278# CONFIG_XFS_FS is not set
1279# CONFIG_GFS2_FS is not set
1263# CONFIG_OCFS2_FS is not set 1280# CONFIG_OCFS2_FS is not set
1264# CONFIG_BTRFS_FS is not set 1281# CONFIG_BTRFS_FS is not set
1265CONFIG_FILE_LOCKING=y 1282CONFIG_FILE_LOCKING=y
diff --git a/arch/sh/include/asm/perf_counter.h b/arch/sh/include/asm/perf_counter.h
index a8153c2aa6fa..d8e6bb9c0ccc 100644
--- a/arch/sh/include/asm/perf_counter.h
+++ b/arch/sh/include/asm/perf_counter.h
@@ -2,6 +2,8 @@
2#define __ASM_SH_PERF_COUNTER_H 2#define __ASM_SH_PERF_COUNTER_H
3 3
4/* SH only supports software counters through this interface. */ 4/* SH only supports software counters through this interface. */
5#define set_perf_counter_pending() do { } while (0) 5static inline void set_perf_counter_pending(void) {}
6
7#define PERF_COUNTER_INDEX_OFFSET 0
6 8
7#endif /* __ASM_SH_PERF_COUNTER_H */ 9#endif /* __ASM_SH_PERF_COUNTER_H */
diff --git a/arch/sh/include/asm/pgalloc.h b/arch/sh/include/asm/pgalloc.h
index 84dd2db7104c..63ca37bd9a95 100644
--- a/arch/sh/include/asm/pgalloc.h
+++ b/arch/sh/include/asm/pgalloc.h
@@ -73,20 +73,12 @@ static inline void pte_free(struct mm_struct *mm, pgtable_t pte)
73 quicklist_free_page(QUICK_PT, NULL, pte); 73 quicklist_free_page(QUICK_PT, NULL, pte);
74} 74}
75 75
76#define __pte_free_tlb(tlb,pte) \ 76#define __pte_free_tlb(tlb,pte,addr) \
77do { \ 77do { \
78 pgtable_page_dtor(pte); \ 78 pgtable_page_dtor(pte); \
79 tlb_remove_page((tlb), (pte)); \ 79 tlb_remove_page((tlb), (pte)); \
80} while (0) 80} while (0)
81 81
82/*
83 * allocating and freeing a pmd is trivial: the 1-entry pmd is
84 * inside the pgd, so has no extra memory associated with it.
85 */
86
87#define pmd_free(mm, x) do { } while (0)
88#define __pmd_free_tlb(tlb,x) do { } while (0)
89
90static inline void check_pgt_cache(void) 82static inline void check_pgt_cache(void)
91{ 83{
92 quicklist_trim(QUICK_PGD, NULL, 25, 16); 84 quicklist_trim(QUICK_PGD, NULL, 25, 16);
diff --git a/arch/sh/include/asm/syscall_32.h b/arch/sh/include/asm/syscall_32.h
index 5bc34681d994..6f83f2cc45c1 100644
--- a/arch/sh/include/asm/syscall_32.h
+++ b/arch/sh/include/asm/syscall_32.h
@@ -3,6 +3,7 @@
3 3
4#include <linux/kernel.h> 4#include <linux/kernel.h>
5#include <linux/sched.h> 5#include <linux/sched.h>
6#include <linux/err.h>
6#include <asm/ptrace.h> 7#include <asm/ptrace.h>
7 8
8/* The system call number is given by the user in R3 */ 9/* The system call number is given by the user in R3 */
diff --git a/arch/sh/include/asm/thread_info.h b/arch/sh/include/asm/thread_info.h
index f09ac4806294..d570ac2e5cb9 100644
--- a/arch/sh/include/asm/thread_info.h
+++ b/arch/sh/include/asm/thread_info.h
@@ -51,7 +51,7 @@ struct thread_info {
51 .exec_domain = &default_exec_domain, \ 51 .exec_domain = &default_exec_domain, \
52 .flags = 0, \ 52 .flags = 0, \
53 .cpu = 0, \ 53 .cpu = 0, \
54 .preempt_count = 1, \ 54 .preempt_count = INIT_PREEMPT_COUNT, \
55 .addr_limit = KERNEL_DS, \ 55 .addr_limit = KERNEL_DS, \
56 .restart_block = { \ 56 .restart_block = { \
57 .fn = do_no_restart_syscall, \ 57 .fn = do_no_restart_syscall, \
diff --git a/arch/sh/include/asm/tlb.h b/arch/sh/include/asm/tlb.h
index 9c16f737074a..da8fe7ab8728 100644
--- a/arch/sh/include/asm/tlb.h
+++ b/arch/sh/include/asm/tlb.h
@@ -91,9 +91,9 @@ tlb_end_vma(struct mmu_gather *tlb, struct vm_area_struct *vma)
91} 91}
92 92
93#define tlb_remove_page(tlb,page) free_page_and_swap_cache(page) 93#define tlb_remove_page(tlb,page) free_page_and_swap_cache(page)
94#define pte_free_tlb(tlb, ptep) pte_free((tlb)->mm, ptep) 94#define pte_free_tlb(tlb, ptep, addr) pte_free((tlb)->mm, ptep)
95#define pmd_free_tlb(tlb, pmdp) pmd_free((tlb)->mm, pmdp) 95#define pmd_free_tlb(tlb, pmdp, addr) pmd_free((tlb)->mm, pmdp)
96#define pud_free_tlb(tlb, pudp) pud_free((tlb)->mm, pudp) 96#define pud_free_tlb(tlb, pudp, addr) pud_free((tlb)->mm, pudp)
97 97
98#define tlb_migrate_finish(mm) do { } while (0) 98#define tlb_migrate_finish(mm) do { } while (0)
99 99
diff --git a/arch/sh/include/mach-se/mach/se7724.h b/arch/sh/include/mach-se/mach/se7724.h
index 74164b60d0db..29514a39d0f5 100644
--- a/arch/sh/include/mach-se/mach/se7724.h
+++ b/arch/sh/include/mach-se/mach/se7724.h
@@ -20,6 +20,11 @@
20 */ 20 */
21#include <asm/addrspace.h> 21#include <asm/addrspace.h>
22 22
23/* SH Eth */
24#define SH_ETH_ADDR (0xA4600000)
25#define SH_ETH_MAHR (SH_ETH_ADDR + 0x1C0)
26#define SH_ETH_MALR (SH_ETH_ADDR + 0x1C8)
27
23#define PA_LED (0xba203000) /* 8bit LED */ 28#define PA_LED (0xba203000) /* 8bit LED */
24#define IRQ_MODE (0xba200010) 29#define IRQ_MODE (0xba200010)
25#define IRQ0_SR (0xba200014) 30#define IRQ0_SR (0xba200014)
diff --git a/arch/sh/mm/fault_32.c b/arch/sh/mm/fault_32.c
index cc8ddbdf3d7a..71925946f1e1 100644
--- a/arch/sh/mm/fault_32.c
+++ b/arch/sh/mm/fault_32.c
@@ -15,12 +15,28 @@
15#include <linux/mm.h> 15#include <linux/mm.h>
16#include <linux/hardirq.h> 16#include <linux/hardirq.h>
17#include <linux/kprobes.h> 17#include <linux/kprobes.h>
18#include <linux/marker.h> 18#include <linux/perf_counter.h>
19#include <asm/io_trapped.h> 19#include <asm/io_trapped.h>
20#include <asm/system.h> 20#include <asm/system.h>
21#include <asm/mmu_context.h> 21#include <asm/mmu_context.h>
22#include <asm/tlbflush.h> 22#include <asm/tlbflush.h>
23 23
24static inline int notify_page_fault(struct pt_regs *regs, int trap)
25{
26 int ret = 0;
27
28#ifdef CONFIG_KPROBES
29 if (!user_mode(regs)) {
30 preempt_disable();
31 if (kprobe_running() && kprobe_fault_handler(regs, trap))
32 ret = 1;
33 preempt_enable();
34 }
35#endif
36
37 return ret;
38}
39
24/* 40/*
25 * This routine handles page faults. It determines the address, 41 * This routine handles page faults. It determines the address,
26 * and the problem, and then passes it off to one of the appropriate 42 * and the problem, and then passes it off to one of the appropriate
@@ -87,13 +103,16 @@ asmlinkage void __kprobes do_page_fault(struct pt_regs *regs,
87 return; 103 return;
88 } 104 }
89 105
106 mm = tsk->mm;
107
108 if (unlikely(notify_page_fault(regs, lookup_exception_vector())))
109 return;
110
90 /* Only enable interrupts if they were on before the fault */ 111 /* Only enable interrupts if they were on before the fault */
91 if ((regs->sr & SR_IMASK) != SR_IMASK) { 112 if ((regs->sr & SR_IMASK) != SR_IMASK)
92 trace_hardirqs_on();
93 local_irq_enable(); 113 local_irq_enable();
94 }
95 114
96 mm = tsk->mm; 115 perf_swcounter_event(PERF_COUNT_SW_PAGE_FAULTS, 1, 0, regs, address);
97 116
98 /* 117 /*
99 * If we're in an interrupt or have no user 118 * If we're in an interrupt or have no user
@@ -141,10 +160,15 @@ survive:
141 goto do_sigbus; 160 goto do_sigbus;
142 BUG(); 161 BUG();
143 } 162 }
144 if (fault & VM_FAULT_MAJOR) 163 if (fault & VM_FAULT_MAJOR) {
145 tsk->maj_flt++; 164 tsk->maj_flt++;
146 else 165 perf_swcounter_event(PERF_COUNT_SW_PAGE_FAULTS_MAJ, 1, 0,
166 regs, address);
167 } else {
147 tsk->min_flt++; 168 tsk->min_flt++;
169 perf_swcounter_event(PERF_COUNT_SW_PAGE_FAULTS_MIN, 1, 0,
170 regs, address);
171 }
148 172
149 up_read(&mm->mmap_sem); 173 up_read(&mm->mmap_sem);
150 return; 174 return;
@@ -245,22 +269,6 @@ do_sigbus:
245 goto no_context; 269 goto no_context;
246} 270}
247 271
248static inline int notify_page_fault(struct pt_regs *regs, int trap)
249{
250 int ret = 0;
251
252#ifdef CONFIG_KPROBES
253 if (!user_mode(regs)) {
254 preempt_disable();
255 if (kprobe_running() && kprobe_fault_handler(regs, trap))
256 ret = 1;
257 preempt_enable();
258 }
259#endif
260
261 return ret;
262}
263
264/* 272/*
265 * Called with interrupts disabled. 273 * Called with interrupts disabled.
266 */ 274 */
@@ -273,12 +281,7 @@ asmlinkage int __kprobes __do_page_fault(struct pt_regs *regs,
273 pmd_t *pmd; 281 pmd_t *pmd;
274 pte_t *pte; 282 pte_t *pte;
275 pte_t entry; 283 pte_t entry;
276 int ret = 0; 284 int ret = 1;
277
278 if (notify_page_fault(regs, lookup_exception_vector()))
279 goto out;
280
281 ret = 1;
282 285
283 /* 286 /*
284 * We don't take page faults for P1, P2, and parts of P4, these 287 * We don't take page faults for P1, P2, and parts of P4, these
diff --git a/arch/sh/mm/tlb-sh3.c b/arch/sh/mm/tlb-sh3.c
index 7fbfd5a11ffa..17cb7c3adf22 100644
--- a/arch/sh/mm/tlb-sh3.c
+++ b/arch/sh/mm/tlb-sh3.c
@@ -18,7 +18,6 @@
18#include <linux/mman.h> 18#include <linux/mman.h>
19#include <linux/mm.h> 19#include <linux/mm.h>
20#include <linux/smp.h> 20#include <linux/smp.h>
21#include <linux/smp_lock.h>
22#include <linux/interrupt.h> 21#include <linux/interrupt.h>
23 22
24#include <asm/system.h> 23#include <asm/system.h>
diff --git a/arch/sh/mm/tlbflush_64.c b/arch/sh/mm/tlbflush_64.c
index fcbb6e135cef..3ce40ea34824 100644
--- a/arch/sh/mm/tlbflush_64.c
+++ b/arch/sh/mm/tlbflush_64.c
@@ -3,7 +3,7 @@
3 * 3 *
4 * Copyright (C) 2000, 2001 Paolo Alberelli 4 * Copyright (C) 2000, 2001 Paolo Alberelli
5 * Copyright (C) 2003 Richard Curnow (/proc/tlb, bug fixes) 5 * Copyright (C) 2003 Richard Curnow (/proc/tlb, bug fixes)
6 * Copyright (C) 2003 Paul Mundt 6 * Copyright (C) 2003 - 2009 Paul Mundt
7 * 7 *
8 * This file is subject to the terms and conditions of the GNU General Public 8 * This file is subject to the terms and conditions of the GNU General Public
9 * License. See the file "COPYING" in the main directory of this archive 9 * License. See the file "COPYING" in the main directory of this archive
@@ -20,6 +20,7 @@
20#include <linux/mman.h> 20#include <linux/mman.h>
21#include <linux/mm.h> 21#include <linux/mm.h>
22#include <linux/smp.h> 22#include <linux/smp.h>
23#include <linux/perf_counter.h>
23#include <linux/interrupt.h> 24#include <linux/interrupt.h>
24#include <asm/system.h> 25#include <asm/system.h>
25#include <asm/io.h> 26#include <asm/io.h>
@@ -115,6 +116,8 @@ asmlinkage void do_page_fault(struct pt_regs *regs, unsigned long writeaccess,
115 /* Not an IO address, so reenable interrupts */ 116 /* Not an IO address, so reenable interrupts */
116 local_irq_enable(); 117 local_irq_enable();
117 118
119 perf_swcounter_event(PERF_COUNT_SW_PAGE_FAULTS, 1, 0, regs, address);
120
118 /* 121 /*
119 * If we're in an interrupt or have no user 122 * If we're in an interrupt or have no user
120 * context, we must not take the fault.. 123 * context, we must not take the fault..
@@ -195,10 +198,16 @@ survive:
195 goto do_sigbus; 198 goto do_sigbus;
196 BUG(); 199 BUG();
197 } 200 }
198 if (fault & VM_FAULT_MAJOR) 201
202 if (fault & VM_FAULT_MAJOR) {
199 tsk->maj_flt++; 203 tsk->maj_flt++;
200 else 204 perf_swcounter_event(PERF_COUNT_SW_PAGE_FAULTS_MAJ, 1, 0,
205 regs, address);
206 } else {
201 tsk->min_flt++; 207 tsk->min_flt++;
208 perf_swcounter_event(PERF_COUNT_SW_PAGE_FAULTS_MIN, 1, 0,
209 regs, address);
210 }
202 211
203 /* If we get here, the page fault has been handled. Do the TLB refill 212 /* If we get here, the page fault has been handled. Do the TLB refill
204 now from the newly-setup PTE, to avoid having to fault again right 213 now from the newly-setup PTE, to avoid having to fault again right
diff --git a/arch/sparc/boot/Makefile b/arch/sparc/boot/Makefile
index 96041a8d39e8..1ff0fd924756 100644
--- a/arch/sparc/boot/Makefile
+++ b/arch/sparc/boot/Makefile
@@ -15,7 +15,7 @@ quiet_cmd_elftoaout = ELFTOAOUT $@
15 15
16ifeq ($(CONFIG_SPARC32),y) 16ifeq ($(CONFIG_SPARC32),y)
17quiet_cmd_piggy = PIGGY $@ 17quiet_cmd_piggy = PIGGY $@
18 cmd_piggy = $(obj)/piggyback_32 $@ $(obj)/System.map $(ROOT_IMG) 18 cmd_piggy = $(obj)/piggyback_32 $@ System.map $(ROOT_IMG)
19quiet_cmd_btfix = BTFIX $@ 19quiet_cmd_btfix = BTFIX $@
20 cmd_btfix = $(OBJDUMP) -x vmlinux | $(obj)/btfixupprep > $@ 20 cmd_btfix = $(OBJDUMP) -x vmlinux | $(obj)/btfixupprep > $@
21quiet_cmd_sysmap = SYSMAP $(obj)/System.map 21quiet_cmd_sysmap = SYSMAP $(obj)/System.map
@@ -58,7 +58,7 @@ $(obj)/image: $(obj)/btfix.o FORCE
58$(obj)/zImage: $(obj)/image 58$(obj)/zImage: $(obj)/image
59 $(call if_changed,strip) 59 $(call if_changed,strip)
60 60
61$(obj)/tftpboot.img: $(obj)/piggyback $(obj)/System.map $(obj)/image FORCE 61$(obj)/tftpboot.img: $(obj)/image $(obj)/piggyback_32 System.map $(ROOT_IMG) FORCE
62 $(call if_changed,elftoaout) 62 $(call if_changed,elftoaout)
63 $(call if_changed,piggy) 63 $(call if_changed,piggy)
64 64
@@ -79,7 +79,7 @@ $(obj)/image: vmlinux FORCE
79 $(call if_changed,strip) 79 $(call if_changed,strip)
80 @echo ' kernel: $@ is ready' 80 @echo ' kernel: $@ is ready'
81 81
82$(obj)/tftpboot.img: vmlinux $(obj)/piggyback_64 System.map $(ROOT_IMG) FORCE 82$(obj)/tftpboot.img: $(obj)/image $(obj)/piggyback_64 System.map $(ROOT_IMG) FORCE
83 $(call if_changed,elftoaout) 83 $(call if_changed,elftoaout)
84 $(call if_changed,piggy) 84 $(call if_changed,piggy)
85 @echo ' kernel: $@ is ready' 85 @echo ' kernel: $@ is ready'
diff --git a/arch/sparc/boot/piggyback_32.c b/arch/sparc/boot/piggyback_32.c
index c9f500c1a8b2..e8dc9adfcd61 100644
--- a/arch/sparc/boot/piggyback_32.c
+++ b/arch/sparc/boot/piggyback_32.c
@@ -70,7 +70,7 @@ void die(char *str)
70int main(int argc,char **argv) 70int main(int argc,char **argv)
71{ 71{
72 static char aout_magic[] = { 0x01, 0x03, 0x01, 0x07 }; 72 static char aout_magic[] = { 0x01, 0x03, 0x01, 0x07 };
73 unsigned char buffer[1024], *q, *r; 73 char buffer[1024], *q, *r;
74 unsigned int i, j, k, start, end, offset; 74 unsigned int i, j, k, start, end, offset;
75 FILE *map; 75 FILE *map;
76 struct stat s; 76 struct stat s;
@@ -84,7 +84,7 @@ int main(int argc,char **argv)
84 while (fgets (buffer, 1024, map)) { 84 while (fgets (buffer, 1024, map)) {
85 if (!strcmp (buffer + 8, " T start\n") || !strcmp (buffer + 16, " T start\n")) 85 if (!strcmp (buffer + 8, " T start\n") || !strcmp (buffer + 16, " T start\n"))
86 start = strtoul (buffer, NULL, 16); 86 start = strtoul (buffer, NULL, 16);
87 else if (!strcmp (buffer + 8, " A end\n") || !strcmp (buffer + 16, " A end\n")) 87 else if (!strcmp (buffer + 8, " A _end\n") || !strcmp (buffer + 16, " A _end\n"))
88 end = strtoul (buffer, NULL, 16); 88 end = strtoul (buffer, NULL, 16);
89 } 89 }
90 fclose (map); 90 fclose (map);
diff --git a/arch/sparc/boot/piggyback_64.c b/arch/sparc/boot/piggyback_64.c
index de364bfed0bb..c63fd1b6bdd4 100644
--- a/arch/sparc/boot/piggyback_64.c
+++ b/arch/sparc/boot/piggyback_64.c
@@ -46,6 +46,7 @@ int main(int argc,char **argv)
46 struct stat s; 46 struct stat s;
47 int image, tail; 47 int image, tail;
48 48
49 start = end = 0;
49 if (stat (argv[3], &s) < 0) die (argv[3]); 50 if (stat (argv[3], &s) < 0) die (argv[3]);
50 map = fopen (argv[2], "r"); 51 map = fopen (argv[2], "r");
51 if (!map) die(argv[2]); 52 if (!map) die(argv[2]);
diff --git a/arch/sparc/include/asm/pgalloc_32.h b/arch/sparc/include/asm/pgalloc_32.h
index 681582d26969..ca2b34456c4b 100644
--- a/arch/sparc/include/asm/pgalloc_32.h
+++ b/arch/sparc/include/asm/pgalloc_32.h
@@ -44,8 +44,8 @@ BTFIXUPDEF_CALL(pmd_t *, pmd_alloc_one, struct mm_struct *, unsigned long)
44BTFIXUPDEF_CALL(void, free_pmd_fast, pmd_t *) 44BTFIXUPDEF_CALL(void, free_pmd_fast, pmd_t *)
45#define free_pmd_fast(pmd) BTFIXUP_CALL(free_pmd_fast)(pmd) 45#define free_pmd_fast(pmd) BTFIXUP_CALL(free_pmd_fast)(pmd)
46 46
47#define pmd_free(mm, pmd) free_pmd_fast(pmd) 47#define pmd_free(mm, pmd) free_pmd_fast(pmd)
48#define __pmd_free_tlb(tlb, pmd) pmd_free((tlb)->mm, pmd) 48#define __pmd_free_tlb(tlb, pmd, addr) pmd_free((tlb)->mm, pmd)
49 49
50BTFIXUPDEF_CALL(void, pmd_populate, pmd_t *, struct page *) 50BTFIXUPDEF_CALL(void, pmd_populate, pmd_t *, struct page *)
51#define pmd_populate(MM, PMD, PTE) BTFIXUP_CALL(pmd_populate)(PMD, PTE) 51#define pmd_populate(MM, PMD, PTE) BTFIXUP_CALL(pmd_populate)(PMD, PTE)
@@ -62,7 +62,7 @@ BTFIXUPDEF_CALL(void, free_pte_fast, pte_t *)
62#define pte_free_kernel(mm, pte) BTFIXUP_CALL(free_pte_fast)(pte) 62#define pte_free_kernel(mm, pte) BTFIXUP_CALL(free_pte_fast)(pte)
63 63
64BTFIXUPDEF_CALL(void, pte_free, pgtable_t ) 64BTFIXUPDEF_CALL(void, pte_free, pgtable_t )
65#define pte_free(mm, pte) BTFIXUP_CALL(pte_free)(pte) 65#define pte_free(mm, pte) BTFIXUP_CALL(pte_free)(pte)
66#define __pte_free_tlb(tlb, pte) pte_free((tlb)->mm, pte) 66#define __pte_free_tlb(tlb, pte, addr) pte_free((tlb)->mm, pte)
67 67
68#endif /* _SPARC_PGALLOC_H */ 68#endif /* _SPARC_PGALLOC_H */
diff --git a/arch/sparc/include/asm/thread_info_32.h b/arch/sparc/include/asm/thread_info_32.h
index 0f7b0e5fb1c7..844d73a0340c 100644
--- a/arch/sparc/include/asm/thread_info_32.h
+++ b/arch/sparc/include/asm/thread_info_32.h
@@ -54,8 +54,6 @@ struct thread_info {
54 54
55/* 55/*
56 * macros/functions for gaining access to the thread information structure 56 * macros/functions for gaining access to the thread information structure
57 *
58 * preempt_count needs to be 1 initially, until the scheduler is functional.
59 */ 57 */
60#define INIT_THREAD_INFO(tsk) \ 58#define INIT_THREAD_INFO(tsk) \
61{ \ 59{ \
@@ -64,7 +62,7 @@ struct thread_info {
64 .exec_domain = &default_exec_domain, \ 62 .exec_domain = &default_exec_domain, \
65 .flags = 0, \ 63 .flags = 0, \
66 .cpu = 0, \ 64 .cpu = 0, \
67 .preempt_count = 1, \ 65 .preempt_count = INIT_PREEMPT_COUNT, \
68 .restart_block = { \ 66 .restart_block = { \
69 .fn = do_no_restart_syscall, \ 67 .fn = do_no_restart_syscall, \
70 }, \ 68 }, \
diff --git a/arch/sparc/include/asm/thread_info_64.h b/arch/sparc/include/asm/thread_info_64.h
index 65865726b283..1b45a7bbe407 100644
--- a/arch/sparc/include/asm/thread_info_64.h
+++ b/arch/sparc/include/asm/thread_info_64.h
@@ -125,8 +125,6 @@ struct thread_info {
125 125
126/* 126/*
127 * macros/functions for gaining access to the thread information structure 127 * macros/functions for gaining access to the thread information structure
128 *
129 * preempt_count needs to be 1 initially, until the scheduler is functional.
130 */ 128 */
131#ifndef __ASSEMBLY__ 129#ifndef __ASSEMBLY__
132 130
@@ -135,7 +133,7 @@ struct thread_info {
135 .task = &tsk, \ 133 .task = &tsk, \
136 .flags = ((unsigned long)ASI_P) << TI_FLAG_CURRENT_DS_SHIFT, \ 134 .flags = ((unsigned long)ASI_P) << TI_FLAG_CURRENT_DS_SHIFT, \
137 .exec_domain = &default_exec_domain, \ 135 .exec_domain = &default_exec_domain, \
138 .preempt_count = 1, \ 136 .preempt_count = INIT_PREEMPT_COUNT, \
139 .restart_block = { \ 137 .restart_block = { \
140 .fn = do_no_restart_syscall, \ 138 .fn = do_no_restart_syscall, \
141 }, \ 139 }, \
diff --git a/arch/sparc/include/asm/tlb_64.h b/arch/sparc/include/asm/tlb_64.h
index ee38e731bfa6..dca406b9b6fc 100644
--- a/arch/sparc/include/asm/tlb_64.h
+++ b/arch/sparc/include/asm/tlb_64.h
@@ -100,9 +100,9 @@ static inline void tlb_remove_page(struct mmu_gather *mp, struct page *page)
100} 100}
101 101
102#define tlb_remove_tlb_entry(mp,ptep,addr) do { } while (0) 102#define tlb_remove_tlb_entry(mp,ptep,addr) do { } while (0)
103#define pte_free_tlb(mp, ptepage) pte_free((mp)->mm, ptepage) 103#define pte_free_tlb(mp, ptepage, addr) pte_free((mp)->mm, ptepage)
104#define pmd_free_tlb(mp, pmdp) pmd_free((mp)->mm, pmdp) 104#define pmd_free_tlb(mp, pmdp, addr) pmd_free((mp)->mm, pmdp)
105#define pud_free_tlb(tlb,pudp) __pud_free_tlb(tlb,pudp) 105#define pud_free_tlb(tlb,pudp, addr) __pud_free_tlb(tlb,pudp,addr)
106 106
107#define tlb_migrate_finish(mm) do { } while (0) 107#define tlb_migrate_finish(mm) do { } while (0)
108#define tlb_start_vma(tlb, vma) do { } while (0) 108#define tlb_start_vma(tlb, vma) do { } while (0)
diff --git a/arch/sparc/kernel/irq_64.c b/arch/sparc/kernel/irq_64.c
index bd075054942b..f0ee79055409 100644
--- a/arch/sparc/kernel/irq_64.c
+++ b/arch/sparc/kernel/irq_64.c
@@ -20,7 +20,6 @@
20#include <linux/delay.h> 20#include <linux/delay.h>
21#include <linux/proc_fs.h> 21#include <linux/proc_fs.h>
22#include <linux/seq_file.h> 22#include <linux/seq_file.h>
23#include <linux/bootmem.h>
24#include <linux/irq.h> 23#include <linux/irq.h>
25 24
26#include <asm/ptrace.h> 25#include <asm/ptrace.h>
@@ -914,25 +913,19 @@ void __cpuinit notrace sun4v_register_mondo_queues(int this_cpu)
914 tb->nonresum_qmask); 913 tb->nonresum_qmask);
915} 914}
916 915
917static void __init alloc_one_mondo(unsigned long *pa_ptr, unsigned long qmask) 916/* Each queue region must be a power of 2 multiple of 64 bytes in
918{ 917 * size. The base real address must be aligned to the size of the
919 unsigned long size = PAGE_ALIGN(qmask + 1); 918 * region. Thus, an 8KB queue must be 8KB aligned, for example.
920 void *p = __alloc_bootmem(size, size, 0); 919 */
921 if (!p) { 920static void __init alloc_one_queue(unsigned long *pa_ptr, unsigned long qmask)
922 prom_printf("SUN4V: Error, cannot allocate mondo queue.\n");
923 prom_halt();
924 }
925
926 *pa_ptr = __pa(p);
927}
928
929static void __init alloc_one_kbuf(unsigned long *pa_ptr, unsigned long qmask)
930{ 921{
931 unsigned long size = PAGE_ALIGN(qmask + 1); 922 unsigned long size = PAGE_ALIGN(qmask + 1);
932 void *p = __alloc_bootmem(size, size, 0); 923 unsigned long order = get_order(size);
924 unsigned long p;
933 925
926 p = __get_free_pages(GFP_KERNEL, order);
934 if (!p) { 927 if (!p) {
935 prom_printf("SUN4V: Error, cannot allocate kbuf page.\n"); 928 prom_printf("SUN4V: Error, cannot allocate queue.\n");
936 prom_halt(); 929 prom_halt();
937 } 930 }
938 931
@@ -942,11 +935,11 @@ static void __init alloc_one_kbuf(unsigned long *pa_ptr, unsigned long qmask)
942static void __init init_cpu_send_mondo_info(struct trap_per_cpu *tb) 935static void __init init_cpu_send_mondo_info(struct trap_per_cpu *tb)
943{ 936{
944#ifdef CONFIG_SMP 937#ifdef CONFIG_SMP
945 void *page; 938 unsigned long page;
946 939
947 BUILD_BUG_ON((NR_CPUS * sizeof(u16)) > (PAGE_SIZE - 64)); 940 BUILD_BUG_ON((NR_CPUS * sizeof(u16)) > (PAGE_SIZE - 64));
948 941
949 page = alloc_bootmem_pages(PAGE_SIZE); 942 page = get_zeroed_page(GFP_KERNEL);
950 if (!page) { 943 if (!page) {
951 prom_printf("SUN4V: Error, cannot allocate cpu mondo page.\n"); 944 prom_printf("SUN4V: Error, cannot allocate cpu mondo page.\n");
952 prom_halt(); 945 prom_halt();
@@ -965,13 +958,13 @@ static void __init sun4v_init_mondo_queues(void)
965 for_each_possible_cpu(cpu) { 958 for_each_possible_cpu(cpu) {
966 struct trap_per_cpu *tb = &trap_block[cpu]; 959 struct trap_per_cpu *tb = &trap_block[cpu];
967 960
968 alloc_one_mondo(&tb->cpu_mondo_pa, tb->cpu_mondo_qmask); 961 alloc_one_queue(&tb->cpu_mondo_pa, tb->cpu_mondo_qmask);
969 alloc_one_mondo(&tb->dev_mondo_pa, tb->dev_mondo_qmask); 962 alloc_one_queue(&tb->dev_mondo_pa, tb->dev_mondo_qmask);
970 alloc_one_mondo(&tb->resum_mondo_pa, tb->resum_qmask); 963 alloc_one_queue(&tb->resum_mondo_pa, tb->resum_qmask);
971 alloc_one_kbuf(&tb->resum_kernel_buf_pa, tb->resum_qmask); 964 alloc_one_queue(&tb->resum_kernel_buf_pa, tb->resum_qmask);
972 alloc_one_mondo(&tb->nonresum_mondo_pa, tb->nonresum_qmask); 965 alloc_one_queue(&tb->nonresum_mondo_pa, tb->nonresum_qmask);
973 alloc_one_kbuf(&tb->nonresum_kernel_buf_pa, 966 alloc_one_queue(&tb->nonresum_kernel_buf_pa,
974 tb->nonresum_qmask); 967 tb->nonresum_qmask);
975 } 968 }
976} 969}
977 970
@@ -999,7 +992,7 @@ void __init init_IRQ(void)
999 kill_prom_timer(); 992 kill_prom_timer();
1000 993
1001 size = sizeof(struct ino_bucket) * NUM_IVECS; 994 size = sizeof(struct ino_bucket) * NUM_IVECS;
1002 ivector_table = alloc_bootmem(size); 995 ivector_table = kzalloc(size, GFP_KERNEL);
1003 if (!ivector_table) { 996 if (!ivector_table) {
1004 prom_printf("Fatal error, cannot allocate ivector_table\n"); 997 prom_printf("Fatal error, cannot allocate ivector_table\n");
1005 prom_halt(); 998 prom_halt();
diff --git a/arch/sparc/kernel/ptrace_32.c b/arch/sparc/kernel/ptrace_32.c
index 8ce6285a06d5..7e3dfd9bb97e 100644
--- a/arch/sparc/kernel/ptrace_32.c
+++ b/arch/sparc/kernel/ptrace_32.c
@@ -16,7 +16,6 @@
16#include <linux/ptrace.h> 16#include <linux/ptrace.h>
17#include <linux/user.h> 17#include <linux/user.h>
18#include <linux/smp.h> 18#include <linux/smp.h>
19#include <linux/smp_lock.h>
20#include <linux/security.h> 19#include <linux/security.h>
21#include <linux/signal.h> 20#include <linux/signal.h>
22#include <linux/regset.h> 21#include <linux/regset.h>
diff --git a/arch/sparc/kernel/ptrace_64.c b/arch/sparc/kernel/ptrace_64.c
index a941c610e7ce..4ae91dc2feb9 100644
--- a/arch/sparc/kernel/ptrace_64.c
+++ b/arch/sparc/kernel/ptrace_64.c
@@ -17,7 +17,6 @@
17#include <linux/ptrace.h> 17#include <linux/ptrace.h>
18#include <linux/user.h> 18#include <linux/user.h>
19#include <linux/smp.h> 19#include <linux/smp.h>
20#include <linux/smp_lock.h>
21#include <linux/security.h> 20#include <linux/security.h>
22#include <linux/seccomp.h> 21#include <linux/seccomp.h>
23#include <linux/audit.h> 22#include <linux/audit.h>
diff --git a/arch/sparc/kernel/time_64.c b/arch/sparc/kernel/time_64.c
index 5c12e79b4bdf..da1218e8ee87 100644
--- a/arch/sparc/kernel/time_64.c
+++ b/arch/sparc/kernel/time_64.c
@@ -11,7 +11,6 @@
11#include <linux/errno.h> 11#include <linux/errno.h>
12#include <linux/module.h> 12#include <linux/module.h>
13#include <linux/sched.h> 13#include <linux/sched.h>
14#include <linux/smp_lock.h>
15#include <linux/kernel.h> 14#include <linux/kernel.h>
16#include <linux/param.h> 15#include <linux/param.h>
17#include <linux/string.h> 16#include <linux/string.h>
diff --git a/arch/sparc/kernel/traps_32.c b/arch/sparc/kernel/traps_32.c
index 358283341b47..c0490c7bbde0 100644
--- a/arch/sparc/kernel/traps_32.c
+++ b/arch/sparc/kernel/traps_32.c
@@ -13,7 +13,6 @@
13#include <linux/kernel.h> 13#include <linux/kernel.h>
14#include <linux/signal.h> 14#include <linux/signal.h>
15#include <linux/smp.h> 15#include <linux/smp.h>
16#include <linux/smp_lock.h>
17#include <linux/kdebug.h> 16#include <linux/kdebug.h>
18 17
19#include <asm/delay.h> 18#include <asm/delay.h>
diff --git a/arch/sparc/kernel/vio.c b/arch/sparc/kernel/vio.c
index 753d128ed158..c28c71449a6c 100644
--- a/arch/sparc/kernel/vio.c
+++ b/arch/sparc/kernel/vio.c
@@ -224,7 +224,12 @@ static struct vio_dev *vio_create_one(struct mdesc_handle *hp, u64 mp,
224 if (!strcmp(type, "domain-services-port")) 224 if (!strcmp(type, "domain-services-port"))
225 bus_id_name = "ds"; 225 bus_id_name = "ds";
226 226
227 if (strlen(bus_id_name) >= BUS_ID_SIZE - 4) { 227 /*
228 * 20 char is the old driver-core name size limit, which is no more.
229 * This check can probably be removed after review and possible
230 * adaption of the vio users name length handling.
231 */
232 if (strlen(bus_id_name) >= 20 - 4) {
228 printk(KERN_ERR "VIO: bus_id_name [%s] is too long.\n", 233 printk(KERN_ERR "VIO: bus_id_name [%s] is too long.\n",
229 bus_id_name); 234 bus_id_name);
230 return NULL; 235 return NULL;
diff --git a/arch/um/drivers/slip_kern.c b/arch/um/drivers/slip_kern.c
index 5ec17563142e..dd2aadc14af0 100644
--- a/arch/um/drivers/slip_kern.c
+++ b/arch/um/drivers/slip_kern.c
@@ -30,7 +30,6 @@ static void slip_init(struct net_device *dev, void *data)
30 30
31 slip_proto_init(&spri->slip); 31 slip_proto_init(&spri->slip);
32 32
33 dev->init = NULL;
34 dev->hard_header_len = 0; 33 dev->hard_header_len = 0;
35 dev->header_ops = NULL; 34 dev->header_ops = NULL;
36 dev->addr_len = 0; 35 dev->addr_len = 0;
diff --git a/arch/um/drivers/slirp_kern.c b/arch/um/drivers/slirp_kern.c
index f15a6e7654f3..e376284f0fb7 100644
--- a/arch/um/drivers/slirp_kern.c
+++ b/arch/um/drivers/slirp_kern.c
@@ -32,7 +32,6 @@ void slirp_init(struct net_device *dev, void *data)
32 32
33 slip_proto_init(&spri->slip); 33 slip_proto_init(&spri->slip);
34 34
35 dev->init = NULL;
36 dev->hard_header_len = 0; 35 dev->hard_header_len = 0;
37 dev->header_ops = NULL; 36 dev->header_ops = NULL;
38 dev->addr_len = 0; 37 dev->addr_len = 0;
diff --git a/arch/um/include/asm/dma-mapping.h b/arch/um/include/asm/dma-mapping.h
index 90fc708b320e..378de4bbf49f 100644
--- a/arch/um/include/asm/dma-mapping.h
+++ b/arch/um/include/asm/dma-mapping.h
@@ -79,14 +79,14 @@ dma_unmap_sg(struct device *dev, struct scatterlist *sg, int nhwentries,
79} 79}
80 80
81static inline void 81static inline void
82dma_sync_single(struct device *dev, dma_addr_t dma_handle, size_t size, 82dma_sync_single_for_cpu(struct device *dev, dma_addr_t dma_handle, size_t size,
83 enum dma_data_direction direction) 83 enum dma_data_direction direction)
84{ 84{
85 BUG(); 85 BUG();
86} 86}
87 87
88static inline void 88static inline void
89dma_sync_sg(struct device *dev, struct scatterlist *sg, int nelems, 89dma_sync_sg_for_cpu(struct device *dev, struct scatterlist *sg, int nelems,
90 enum dma_data_direction direction) 90 enum dma_data_direction direction)
91{ 91{
92 BUG(); 92 BUG();
diff --git a/arch/um/include/asm/pgalloc.h b/arch/um/include/asm/pgalloc.h
index 718984359f8c..32c8ce4e1515 100644
--- a/arch/um/include/asm/pgalloc.h
+++ b/arch/um/include/asm/pgalloc.h
@@ -40,7 +40,7 @@ static inline void pte_free(struct mm_struct *mm, pgtable_t pte)
40 __free_page(pte); 40 __free_page(pte);
41} 41}
42 42
43#define __pte_free_tlb(tlb,pte) \ 43#define __pte_free_tlb(tlb,pte, address) \
44do { \ 44do { \
45 pgtable_page_dtor(pte); \ 45 pgtable_page_dtor(pte); \
46 tlb_remove_page((tlb),(pte)); \ 46 tlb_remove_page((tlb),(pte)); \
@@ -53,7 +53,7 @@ static inline void pmd_free(struct mm_struct *mm, pmd_t *pmd)
53 free_page((unsigned long)pmd); 53 free_page((unsigned long)pmd);
54} 54}
55 55
56#define __pmd_free_tlb(tlb,x) tlb_remove_page((tlb),virt_to_page(x)) 56#define __pmd_free_tlb(tlb,x, address) tlb_remove_page((tlb),virt_to_page(x))
57#endif 57#endif
58 58
59#define check_pgt_cache() do { } while (0) 59#define check_pgt_cache() do { } while (0)
diff --git a/arch/um/include/asm/thread_info.h b/arch/um/include/asm/thread_info.h
index 62274ab9471f..fd911f855367 100644
--- a/arch/um/include/asm/thread_info.h
+++ b/arch/um/include/asm/thread_info.h
@@ -32,7 +32,7 @@ struct thread_info {
32 .exec_domain = &default_exec_domain, \ 32 .exec_domain = &default_exec_domain, \
33 .flags = 0, \ 33 .flags = 0, \
34 .cpu = 0, \ 34 .cpu = 0, \
35 .preempt_count = 1, \ 35 .preempt_count = INIT_PREEMPT_COUNT, \
36 .addr_limit = KERNEL_DS, \ 36 .addr_limit = KERNEL_DS, \
37 .restart_block = { \ 37 .restart_block = { \
38 .fn = do_no_restart_syscall, \ 38 .fn = do_no_restart_syscall, \
diff --git a/arch/um/include/asm/tlb.h b/arch/um/include/asm/tlb.h
index 5240fa1c5e08..660caedac9eb 100644
--- a/arch/um/include/asm/tlb.h
+++ b/arch/um/include/asm/tlb.h
@@ -116,11 +116,11 @@ static inline void tlb_remove_page(struct mmu_gather *tlb, struct page *page)
116 __tlb_remove_tlb_entry(tlb, ptep, address); \ 116 __tlb_remove_tlb_entry(tlb, ptep, address); \
117 } while (0) 117 } while (0)
118 118
119#define pte_free_tlb(tlb, ptep) __pte_free_tlb(tlb, ptep) 119#define pte_free_tlb(tlb, ptep, addr) __pte_free_tlb(tlb, ptep, addr)
120 120
121#define pud_free_tlb(tlb, pudp) __pud_free_tlb(tlb, pudp) 121#define pud_free_tlb(tlb, pudp, addr) __pud_free_tlb(tlb, pudp, addr)
122 122
123#define pmd_free_tlb(tlb, pmdp) __pmd_free_tlb(tlb, pmdp) 123#define pmd_free_tlb(tlb, pmdp, addr) __pmd_free_tlb(tlb, pmdp, addr)
124 124
125#define tlb_migrate_finish(mm) do {} while (0) 125#define tlb_migrate_finish(mm) do {} while (0)
126 126
diff --git a/arch/um/kernel/sysrq.c b/arch/um/kernel/sysrq.c
index 56d43d0a3960..0960de54495a 100644
--- a/arch/um/kernel/sysrq.c
+++ b/arch/um/kernel/sysrq.c
@@ -70,8 +70,8 @@ void show_stack(struct task_struct *task, unsigned long *esp)
70 if (kstack_end(stack)) 70 if (kstack_end(stack))
71 break; 71 break;
72 if (i && ((i % 8) == 0)) 72 if (i && ((i % 8) == 0))
73 printk("\n" KERN_INFO " "); 73 printk(KERN_INFO " ");
74 printk("%08lx ", *stack++); 74 printk(KERN_CONT "%08lx ", *stack++);
75 } 75 }
76 76
77 show_trace(task, esp); 77 show_trace(task, esp);
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index d1430ef6b4f9..738bdc6b0f8b 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -1913,25 +1913,26 @@ config DMAR_DEFAULT_ON
1913 recommended you say N here while the DMAR code remains 1913 recommended you say N here while the DMAR code remains
1914 experimental. 1914 experimental.
1915 1915
1916config DMAR_GFX_WA 1916config DMAR_BROKEN_GFX_WA
1917 def_bool y 1917 def_bool n
1918 prompt "Support for Graphics workaround" 1918 prompt "Workaround broken graphics drivers (going away soon)"
1919 depends on DMAR 1919 depends on DMAR
1920 ---help--- 1920 ---help---
1921 Current Graphics drivers tend to use physical address 1921 Current Graphics drivers tend to use physical address
1922 for DMA and avoid using DMA APIs. Setting this config 1922 for DMA and avoid using DMA APIs. Setting this config
1923 option permits the IOMMU driver to set a unity map for 1923 option permits the IOMMU driver to set a unity map for
1924 all the OS-visible memory. Hence the driver can continue 1924 all the OS-visible memory. Hence the driver can continue
1925 to use physical addresses for DMA. 1925 to use physical addresses for DMA, at least until this
1926 option is removed in the 2.6.32 kernel.
1926 1927
1927config DMAR_FLOPPY_WA 1928config DMAR_FLOPPY_WA
1928 def_bool y 1929 def_bool y
1929 depends on DMAR 1930 depends on DMAR
1930 ---help--- 1931 ---help---
1931 Floppy disk drivers are know to bypass DMA API calls 1932 Floppy disk drivers are known to bypass DMA API calls
1932 thereby failing to work when IOMMU is enabled. This 1933 thereby failing to work when IOMMU is enabled. This
1933 workaround will setup a 1:1 mapping for the first 1934 workaround will setup a 1:1 mapping for the first
1934 16M to make floppy (an ISA device) work. 1935 16MiB to make floppy (an ISA device) work.
1935 1936
1936config INTR_REMAP 1937config INTR_REMAP
1937 bool "Support for Interrupt Remapping (EXPERIMENTAL)" 1938 bool "Support for Interrupt Remapping (EXPERIMENTAL)"
diff --git a/arch/x86/boot/video-bios.c b/arch/x86/boot/video-bios.c
index d660be492363..49e0c18833e0 100644
--- a/arch/x86/boot/video-bios.c
+++ b/arch/x86/boot/video-bios.c
@@ -37,14 +37,13 @@ static int set_bios_mode(u8 mode)
37 ireg.al = mode; /* AH=0x00 Set Video Mode */ 37 ireg.al = mode; /* AH=0x00 Set Video Mode */
38 intcall(0x10, &ireg, NULL); 38 intcall(0x10, &ireg, NULL);
39 39
40
41 ireg.ah = 0x0f; /* Get Current Video Mode */ 40 ireg.ah = 0x0f; /* Get Current Video Mode */
42 intcall(0x10, &ireg, &oreg); 41 intcall(0x10, &ireg, &oreg);
43 42
44 do_restore = 1; /* Assume video contents were lost */ 43 do_restore = 1; /* Assume video contents were lost */
45 44
46 /* Not all BIOSes are clean with the top bit */ 45 /* Not all BIOSes are clean with the top bit */
47 new_mode = ireg.al & 0x7f; 46 new_mode = oreg.al & 0x7f;
48 47
49 if (new_mode == mode) 48 if (new_mode == mode)
50 return 0; /* Mode change OK */ 49 return 0; /* Mode change OK */
diff --git a/arch/x86/boot/video-vesa.c b/arch/x86/boot/video-vesa.c
index c700147d6ffb..275dd177f198 100644
--- a/arch/x86/boot/video-vesa.c
+++ b/arch/x86/boot/video-vesa.c
@@ -45,7 +45,7 @@ static int vesa_probe(void)
45 ireg.di = (size_t)&vginfo; 45 ireg.di = (size_t)&vginfo;
46 intcall(0x10, &ireg, &oreg); 46 intcall(0x10, &ireg, &oreg);
47 47
48 if (ireg.ax != 0x004f || 48 if (oreg.ax != 0x004f ||
49 vginfo.signature != VESA_MAGIC || 49 vginfo.signature != VESA_MAGIC ||
50 vginfo.version < 0x0102) 50 vginfo.version < 0x0102)
51 return 0; /* Not present */ 51 return 0; /* Not present */
@@ -70,7 +70,7 @@ static int vesa_probe(void)
70 ireg.di = (size_t)&vminfo; 70 ireg.di = (size_t)&vminfo;
71 intcall(0x10, &ireg, &oreg); 71 intcall(0x10, &ireg, &oreg);
72 72
73 if (ireg.ax != 0x004f) 73 if (oreg.ax != 0x004f)
74 continue; 74 continue;
75 75
76 if ((vminfo.mode_attr & 0x15) == 0x05) { 76 if ((vminfo.mode_attr & 0x15) == 0x05) {
diff --git a/arch/x86/include/asm/atomic_32.h b/arch/x86/include/asm/atomic_32.h
index 2503d4e64c2a..dc5a667ff791 100644
--- a/arch/x86/include/asm/atomic_32.h
+++ b/arch/x86/include/asm/atomic_32.h
@@ -19,7 +19,10 @@
19 * 19 *
20 * Atomically reads the value of @v. 20 * Atomically reads the value of @v.
21 */ 21 */
22#define atomic_read(v) ((v)->counter) 22static inline int atomic_read(const atomic_t *v)
23{
24 return v->counter;
25}
23 26
24/** 27/**
25 * atomic_set - set atomic variable 28 * atomic_set - set atomic variable
@@ -28,7 +31,10 @@
28 * 31 *
29 * Atomically sets the value of @v to @i. 32 * Atomically sets the value of @v to @i.
30 */ 33 */
31#define atomic_set(v, i) (((v)->counter) = (i)) 34static inline void atomic_set(atomic_t *v, int i)
35{
36 v->counter = i;
37}
32 38
33/** 39/**
34 * atomic_add - add integer to atomic variable 40 * atomic_add - add integer to atomic variable
@@ -200,8 +206,15 @@ static inline int atomic_sub_return(int i, atomic_t *v)
200 return atomic_add_return(-i, v); 206 return atomic_add_return(-i, v);
201} 207}
202 208
203#define atomic_cmpxchg(v, old, new) (cmpxchg(&((v)->counter), (old), (new))) 209static inline int atomic_cmpxchg(atomic_t *v, int old, int new)
204#define atomic_xchg(v, new) (xchg(&((v)->counter), (new))) 210{
211 return cmpxchg(&v->counter, old, new);
212}
213
214static inline int atomic_xchg(atomic_t *v, int new)
215{
216 return xchg(&v->counter, new);
217}
205 218
206/** 219/**
207 * atomic_add_unless - add unless the number is already a given value 220 * atomic_add_unless - add unless the number is already a given value
@@ -250,45 +263,12 @@ static inline int atomic_add_unless(atomic_t *v, int a, int u)
250/* An 64bit atomic type */ 263/* An 64bit atomic type */
251 264
252typedef struct { 265typedef struct {
253 unsigned long long counter; 266 u64 __aligned(8) counter;
254} atomic64_t; 267} atomic64_t;
255 268
256#define ATOMIC64_INIT(val) { (val) } 269#define ATOMIC64_INIT(val) { (val) }
257 270
258/** 271extern u64 atomic64_cmpxchg(atomic64_t *ptr, u64 old_val, u64 new_val);
259 * atomic64_read - read atomic64 variable
260 * @ptr: pointer of type atomic64_t
261 *
262 * Atomically reads the value of @v.
263 * Doesn't imply a read memory barrier.
264 */
265#define __atomic64_read(ptr) ((ptr)->counter)
266
267static inline unsigned long long
268cmpxchg8b(unsigned long long *ptr, unsigned long long old, unsigned long long new)
269{
270 asm volatile(
271
272 LOCK_PREFIX "cmpxchg8b (%[ptr])\n"
273
274 : "=A" (old)
275
276 : [ptr] "D" (ptr),
277 "A" (old),
278 "b" (ll_low(new)),
279 "c" (ll_high(new))
280
281 : "memory");
282
283 return old;
284}
285
286static inline unsigned long long
287atomic64_cmpxchg(atomic64_t *ptr, unsigned long long old_val,
288 unsigned long long new_val)
289{
290 return cmpxchg8b(&ptr->counter, old_val, new_val);
291}
292 272
293/** 273/**
294 * atomic64_xchg - xchg atomic64 variable 274 * atomic64_xchg - xchg atomic64 variable
@@ -298,18 +278,7 @@ atomic64_cmpxchg(atomic64_t *ptr, unsigned long long old_val,
298 * Atomically xchgs the value of @ptr to @new_val and returns 278 * Atomically xchgs the value of @ptr to @new_val and returns
299 * the old value. 279 * the old value.
300 */ 280 */
301 281extern u64 atomic64_xchg(atomic64_t *ptr, u64 new_val);
302static inline unsigned long long
303atomic64_xchg(atomic64_t *ptr, unsigned long long new_val)
304{
305 unsigned long long old_val;
306
307 do {
308 old_val = atomic_read(ptr);
309 } while (atomic64_cmpxchg(ptr, old_val, new_val) != old_val);
310
311 return old_val;
312}
313 282
314/** 283/**
315 * atomic64_set - set atomic64 variable 284 * atomic64_set - set atomic64 variable
@@ -318,10 +287,7 @@ atomic64_xchg(atomic64_t *ptr, unsigned long long new_val)
318 * 287 *
319 * Atomically sets the value of @ptr to @new_val. 288 * Atomically sets the value of @ptr to @new_val.
320 */ 289 */
321static inline void atomic64_set(atomic64_t *ptr, unsigned long long new_val) 290extern void atomic64_set(atomic64_t *ptr, u64 new_val);
322{
323 atomic64_xchg(ptr, new_val);
324}
325 291
326/** 292/**
327 * atomic64_read - read atomic64 variable 293 * atomic64_read - read atomic64 variable
@@ -329,17 +295,30 @@ static inline void atomic64_set(atomic64_t *ptr, unsigned long long new_val)
329 * 295 *
330 * Atomically reads the value of @ptr and returns it. 296 * Atomically reads the value of @ptr and returns it.
331 */ 297 */
332static inline unsigned long long atomic64_read(atomic64_t *ptr) 298static inline u64 atomic64_read(atomic64_t *ptr)
333{ 299{
334 unsigned long long curr_val; 300 u64 res;
335 301
336 do { 302 /*
337 curr_val = __atomic64_read(ptr); 303 * Note, we inline this atomic64_t primitive because
338 } while (atomic64_cmpxchg(ptr, curr_val, curr_val) != curr_val); 304 * it only clobbers EAX/EDX and leaves the others
339 305 * untouched. We also (somewhat subtly) rely on the
340 return curr_val; 306 * fact that cmpxchg8b returns the current 64-bit value
307 * of the memory location we are touching:
308 */
309 asm volatile(
310 "mov %%ebx, %%eax\n\t"
311 "mov %%ecx, %%edx\n\t"
312 LOCK_PREFIX "cmpxchg8b %1\n"
313 : "=&A" (res)
314 : "m" (*ptr)
315 );
316
317 return res;
341} 318}
342 319
320extern u64 atomic64_read(atomic64_t *ptr);
321
343/** 322/**
344 * atomic64_add_return - add and return 323 * atomic64_add_return - add and return
345 * @delta: integer value to add 324 * @delta: integer value to add
@@ -347,34 +326,14 @@ static inline unsigned long long atomic64_read(atomic64_t *ptr)
347 * 326 *
348 * Atomically adds @delta to @ptr and returns @delta + *@ptr 327 * Atomically adds @delta to @ptr and returns @delta + *@ptr
349 */ 328 */
350static inline unsigned long long 329extern u64 atomic64_add_return(u64 delta, atomic64_t *ptr);
351atomic64_add_return(unsigned long long delta, atomic64_t *ptr)
352{
353 unsigned long long old_val, new_val;
354
355 do {
356 old_val = atomic_read(ptr);
357 new_val = old_val + delta;
358
359 } while (atomic64_cmpxchg(ptr, old_val, new_val) != old_val);
360
361 return new_val;
362}
363
364static inline long atomic64_sub_return(unsigned long long delta, atomic64_t *ptr)
365{
366 return atomic64_add_return(-delta, ptr);
367}
368 330
369static inline long atomic64_inc_return(atomic64_t *ptr) 331/*
370{ 332 * Other variants with different arithmetic operators:
371 return atomic64_add_return(1, ptr); 333 */
372} 334extern u64 atomic64_sub_return(u64 delta, atomic64_t *ptr);
373 335extern u64 atomic64_inc_return(atomic64_t *ptr);
374static inline long atomic64_dec_return(atomic64_t *ptr) 336extern u64 atomic64_dec_return(atomic64_t *ptr);
375{
376 return atomic64_sub_return(1, ptr);
377}
378 337
379/** 338/**
380 * atomic64_add - add integer to atomic64 variable 339 * atomic64_add - add integer to atomic64 variable
@@ -383,10 +342,7 @@ static inline long atomic64_dec_return(atomic64_t *ptr)
383 * 342 *
384 * Atomically adds @delta to @ptr. 343 * Atomically adds @delta to @ptr.
385 */ 344 */
386static inline void atomic64_add(unsigned long long delta, atomic64_t *ptr) 345extern void atomic64_add(u64 delta, atomic64_t *ptr);
387{
388 atomic64_add_return(delta, ptr);
389}
390 346
391/** 347/**
392 * atomic64_sub - subtract the atomic64 variable 348 * atomic64_sub - subtract the atomic64 variable
@@ -395,10 +351,7 @@ static inline void atomic64_add(unsigned long long delta, atomic64_t *ptr)
395 * 351 *
396 * Atomically subtracts @delta from @ptr. 352 * Atomically subtracts @delta from @ptr.
397 */ 353 */
398static inline void atomic64_sub(unsigned long long delta, atomic64_t *ptr) 354extern void atomic64_sub(u64 delta, atomic64_t *ptr);
399{
400 atomic64_add(-delta, ptr);
401}
402 355
403/** 356/**
404 * atomic64_sub_and_test - subtract value from variable and test result 357 * atomic64_sub_and_test - subtract value from variable and test result
@@ -409,13 +362,7 @@ static inline void atomic64_sub(unsigned long long delta, atomic64_t *ptr)
409 * true if the result is zero, or false for all 362 * true if the result is zero, or false for all
410 * other cases. 363 * other cases.
411 */ 364 */
412static inline int 365extern int atomic64_sub_and_test(u64 delta, atomic64_t *ptr);
413atomic64_sub_and_test(unsigned long long delta, atomic64_t *ptr)
414{
415 unsigned long long old_val = atomic64_sub_return(delta, ptr);
416
417 return old_val == 0;
418}
419 366
420/** 367/**
421 * atomic64_inc - increment atomic64 variable 368 * atomic64_inc - increment atomic64 variable
@@ -423,10 +370,7 @@ atomic64_sub_and_test(unsigned long long delta, atomic64_t *ptr)
423 * 370 *
424 * Atomically increments @ptr by 1. 371 * Atomically increments @ptr by 1.
425 */ 372 */
426static inline void atomic64_inc(atomic64_t *ptr) 373extern void atomic64_inc(atomic64_t *ptr);
427{
428 atomic64_add(1, ptr);
429}
430 374
431/** 375/**
432 * atomic64_dec - decrement atomic64 variable 376 * atomic64_dec - decrement atomic64 variable
@@ -434,10 +378,7 @@ static inline void atomic64_inc(atomic64_t *ptr)
434 * 378 *
435 * Atomically decrements @ptr by 1. 379 * Atomically decrements @ptr by 1.
436 */ 380 */
437static inline void atomic64_dec(atomic64_t *ptr) 381extern void atomic64_dec(atomic64_t *ptr);
438{
439 atomic64_sub(1, ptr);
440}
441 382
442/** 383/**
443 * atomic64_dec_and_test - decrement and test 384 * atomic64_dec_and_test - decrement and test
@@ -447,10 +388,7 @@ static inline void atomic64_dec(atomic64_t *ptr)
447 * returns true if the result is 0, or false for all other 388 * returns true if the result is 0, or false for all other
448 * cases. 389 * cases.
449 */ 390 */
450static inline int atomic64_dec_and_test(atomic64_t *ptr) 391extern int atomic64_dec_and_test(atomic64_t *ptr);
451{
452 return atomic64_sub_and_test(1, ptr);
453}
454 392
455/** 393/**
456 * atomic64_inc_and_test - increment and test 394 * atomic64_inc_and_test - increment and test
@@ -460,10 +398,7 @@ static inline int atomic64_dec_and_test(atomic64_t *ptr)
460 * and returns true if the result is zero, or false for all 398 * and returns true if the result is zero, or false for all
461 * other cases. 399 * other cases.
462 */ 400 */
463static inline int atomic64_inc_and_test(atomic64_t *ptr) 401extern int atomic64_inc_and_test(atomic64_t *ptr);
464{
465 return atomic64_sub_and_test(-1, ptr);
466}
467 402
468/** 403/**
469 * atomic64_add_negative - add and test if negative 404 * atomic64_add_negative - add and test if negative
@@ -474,13 +409,7 @@ static inline int atomic64_inc_and_test(atomic64_t *ptr)
474 * if the result is negative, or false when 409 * if the result is negative, or false when
475 * result is greater than or equal to zero. 410 * result is greater than or equal to zero.
476 */ 411 */
477static inline int 412extern int atomic64_add_negative(u64 delta, atomic64_t *ptr);
478atomic64_add_negative(unsigned long long delta, atomic64_t *ptr)
479{
480 long long old_val = atomic64_add_return(delta, ptr);
481
482 return old_val < 0;
483}
484 413
485#include <asm-generic/atomic-long.h> 414#include <asm-generic/atomic-long.h>
486#endif /* _ASM_X86_ATOMIC_32_H */ 415#endif /* _ASM_X86_ATOMIC_32_H */
diff --git a/arch/x86/include/asm/atomic_64.h b/arch/x86/include/asm/atomic_64.h
index 0d6360220007..d605dc268e79 100644
--- a/arch/x86/include/asm/atomic_64.h
+++ b/arch/x86/include/asm/atomic_64.h
@@ -18,7 +18,10 @@
18 * 18 *
19 * Atomically reads the value of @v. 19 * Atomically reads the value of @v.
20 */ 20 */
21#define atomic_read(v) ((v)->counter) 21static inline int atomic_read(const atomic_t *v)
22{
23 return v->counter;
24}
22 25
23/** 26/**
24 * atomic_set - set atomic variable 27 * atomic_set - set atomic variable
@@ -27,7 +30,10 @@
27 * 30 *
28 * Atomically sets the value of @v to @i. 31 * Atomically sets the value of @v to @i.
29 */ 32 */
30#define atomic_set(v, i) (((v)->counter) = (i)) 33static inline void atomic_set(atomic_t *v, int i)
34{
35 v->counter = i;
36}
31 37
32/** 38/**
33 * atomic_add - add integer to atomic variable 39 * atomic_add - add integer to atomic variable
@@ -192,7 +198,10 @@ static inline int atomic_sub_return(int i, atomic_t *v)
192 * Atomically reads the value of @v. 198 * Atomically reads the value of @v.
193 * Doesn't imply a read memory barrier. 199 * Doesn't imply a read memory barrier.
194 */ 200 */
195#define atomic64_read(v) ((v)->counter) 201static inline long atomic64_read(const atomic64_t *v)
202{
203 return v->counter;
204}
196 205
197/** 206/**
198 * atomic64_set - set atomic64 variable 207 * atomic64_set - set atomic64 variable
@@ -201,7 +210,10 @@ static inline int atomic_sub_return(int i, atomic_t *v)
201 * 210 *
202 * Atomically sets the value of @v to @i. 211 * Atomically sets the value of @v to @i.
203 */ 212 */
204#define atomic64_set(v, i) (((v)->counter) = (i)) 213static inline void atomic64_set(atomic64_t *v, long i)
214{
215 v->counter = i;
216}
205 217
206/** 218/**
207 * atomic64_add - add integer to atomic64 variable 219 * atomic64_add - add integer to atomic64 variable
@@ -355,11 +367,25 @@ static inline long atomic64_sub_return(long i, atomic64_t *v)
355#define atomic64_inc_return(v) (atomic64_add_return(1, (v))) 367#define atomic64_inc_return(v) (atomic64_add_return(1, (v)))
356#define atomic64_dec_return(v) (atomic64_sub_return(1, (v))) 368#define atomic64_dec_return(v) (atomic64_sub_return(1, (v)))
357 369
358#define atomic64_cmpxchg(v, old, new) (cmpxchg(&((v)->counter), (old), (new))) 370static inline long atomic64_cmpxchg(atomic64_t *v, long old, long new)
359#define atomic64_xchg(v, new) (xchg(&((v)->counter), new)) 371{
372 return cmpxchg(&v->counter, old, new);
373}
374
375static inline long atomic64_xchg(atomic64_t *v, long new)
376{
377 return xchg(&v->counter, new);
378}
360 379
361#define atomic_cmpxchg(v, old, new) (cmpxchg(&((v)->counter), (old), (new))) 380static inline long atomic_cmpxchg(atomic_t *v, int old, int new)
362#define atomic_xchg(v, new) (xchg(&((v)->counter), (new))) 381{
382 return cmpxchg(&v->counter, old, new);
383}
384
385static inline long atomic_xchg(atomic_t *v, int new)
386{
387 return xchg(&v->counter, new);
388}
363 389
364/** 390/**
365 * atomic_add_unless - add unless the number is a given value 391 * atomic_add_unless - add unless the number is a given value
diff --git a/arch/x86/include/asm/boot.h b/arch/x86/include/asm/boot.h
index 418e632d4a80..7a1065958ba9 100644
--- a/arch/x86/include/asm/boot.h
+++ b/arch/x86/include/asm/boot.h
@@ -8,7 +8,7 @@
8 8
9#ifdef __KERNEL__ 9#ifdef __KERNEL__
10 10
11#include <asm/page_types.h> 11#include <asm/pgtable_types.h>
12 12
13/* Physical address where kernel should be loaded. */ 13/* Physical address where kernel should be loaded. */
14#define LOAD_PHYSICAL_ADDR ((CONFIG_PHYSICAL_START \ 14#define LOAD_PHYSICAL_ADDR ((CONFIG_PHYSICAL_START \
@@ -16,10 +16,10 @@
16 & ~(CONFIG_PHYSICAL_ALIGN - 1)) 16 & ~(CONFIG_PHYSICAL_ALIGN - 1))
17 17
18/* Minimum kernel alignment, as a power of two */ 18/* Minimum kernel alignment, as a power of two */
19#ifdef CONFIG_x86_64 19#ifdef CONFIG_X86_64
20#define MIN_KERNEL_ALIGN_LG2 PMD_SHIFT 20#define MIN_KERNEL_ALIGN_LG2 PMD_SHIFT
21#else 21#else
22#define MIN_KERNEL_ALIGN_LG2 (PAGE_SHIFT+1) 22#define MIN_KERNEL_ALIGN_LG2 (PAGE_SHIFT + THREAD_ORDER)
23#endif 23#endif
24#define MIN_KERNEL_ALIGN (_AC(1, UL) << MIN_KERNEL_ALIGN_LG2) 24#define MIN_KERNEL_ALIGN (_AC(1, UL) << MIN_KERNEL_ALIGN_LG2)
25 25
diff --git a/arch/x86/include/asm/efi.h b/arch/x86/include/asm/efi.h
index edc90f23e708..8406ed7f9926 100644
--- a/arch/x86/include/asm/efi.h
+++ b/arch/x86/include/asm/efi.h
@@ -33,7 +33,7 @@ extern unsigned long asmlinkage efi_call_phys(void *, ...);
33#define efi_call_virt6(f, a1, a2, a3, a4, a5, a6) \ 33#define efi_call_virt6(f, a1, a2, a3, a4, a5, a6) \
34 efi_call_virt(f, a1, a2, a3, a4, a5, a6) 34 efi_call_virt(f, a1, a2, a3, a4, a5, a6)
35 35
36#define efi_ioremap(addr, size) ioremap_cache(addr, size) 36#define efi_ioremap(addr, size, type) ioremap_cache(addr, size)
37 37
38#else /* !CONFIG_X86_32 */ 38#else /* !CONFIG_X86_32 */
39 39
@@ -84,7 +84,8 @@ extern u64 efi_call6(void *fp, u64 arg1, u64 arg2, u64 arg3,
84 efi_call6((void *)(efi.systab->runtime->f), (u64)(a1), (u64)(a2), \ 84 efi_call6((void *)(efi.systab->runtime->f), (u64)(a1), (u64)(a2), \
85 (u64)(a3), (u64)(a4), (u64)(a5), (u64)(a6)) 85 (u64)(a3), (u64)(a4), (u64)(a5), (u64)(a6))
86 86
87extern void __iomem *efi_ioremap(unsigned long addr, unsigned long size); 87extern void __iomem *efi_ioremap(unsigned long addr, unsigned long size,
88 u32 type);
88 89
89#endif /* CONFIG_X86_32 */ 90#endif /* CONFIG_X86_32 */
90 91
diff --git a/arch/x86/include/asm/fixmap.h b/arch/x86/include/asm/fixmap.h
index 2d81af3974a0..7b2d71df39a6 100644
--- a/arch/x86/include/asm/fixmap.h
+++ b/arch/x86/include/asm/fixmap.h
@@ -111,12 +111,9 @@ enum fixed_addresses {
111#ifdef CONFIG_PARAVIRT 111#ifdef CONFIG_PARAVIRT
112 FIX_PARAVIRT_BOOTMAP, 112 FIX_PARAVIRT_BOOTMAP,
113#endif 113#endif
114 FIX_TEXT_POKE0, /* reserve 2 pages for text_poke() */ 114 FIX_TEXT_POKE1, /* reserve 2 pages for text_poke() */
115 FIX_TEXT_POKE1, 115 FIX_TEXT_POKE0, /* first page is last, because allocation is backward */
116 __end_of_permanent_fixed_addresses, 116 __end_of_permanent_fixed_addresses,
117#ifdef CONFIG_PROVIDE_OHCI1394_DMA_INIT
118 FIX_OHCI1394_BASE,
119#endif
120 /* 117 /*
121 * 256 temporary boot-time mappings, used by early_ioremap(), 118 * 256 temporary boot-time mappings, used by early_ioremap(),
122 * before ioremap() is functional. 119 * before ioremap() is functional.
@@ -129,6 +126,9 @@ enum fixed_addresses {
129 FIX_BTMAP_END = __end_of_permanent_fixed_addresses + 256 - 126 FIX_BTMAP_END = __end_of_permanent_fixed_addresses + 256 -
130 (__end_of_permanent_fixed_addresses & 255), 127 (__end_of_permanent_fixed_addresses & 255),
131 FIX_BTMAP_BEGIN = FIX_BTMAP_END + NR_FIX_BTMAPS*FIX_BTMAPS_SLOTS - 1, 128 FIX_BTMAP_BEGIN = FIX_BTMAP_END + NR_FIX_BTMAPS*FIX_BTMAPS_SLOTS - 1,
129#ifdef CONFIG_PROVIDE_OHCI1394_DMA_INIT
130 FIX_OHCI1394_BASE,
131#endif
132#ifdef CONFIG_X86_32 132#ifdef CONFIG_X86_32
133 FIX_WP_TEST, 133 FIX_WP_TEST,
134#endif 134#endif
diff --git a/arch/x86/include/asm/io_apic.h b/arch/x86/include/asm/io_apic.h
index daf866ed0612..330ee807f89e 100644
--- a/arch/x86/include/asm/io_apic.h
+++ b/arch/x86/include/asm/io_apic.h
@@ -161,6 +161,7 @@ extern int io_apic_set_pci_routing(struct device *dev, int irq,
161 struct io_apic_irq_attr *irq_attr); 161 struct io_apic_irq_attr *irq_attr);
162extern int (*ioapic_renumber_irq)(int ioapic, int irq); 162extern int (*ioapic_renumber_irq)(int ioapic, int irq);
163extern void ioapic_init_mappings(void); 163extern void ioapic_init_mappings(void);
164extern void ioapic_insert_resources(void);
164 165
165extern struct IO_APIC_route_entry **alloc_ioapic_entries(void); 166extern struct IO_APIC_route_entry **alloc_ioapic_entries(void);
166extern void free_ioapic_entries(struct IO_APIC_route_entry **ioapic_entries); 167extern void free_ioapic_entries(struct IO_APIC_route_entry **ioapic_entries);
@@ -180,6 +181,7 @@ extern void ioapic_write_entry(int apic, int pin,
180#define io_apic_assign_pci_irqs 0 181#define io_apic_assign_pci_irqs 0
181static const int timer_through_8259 = 0; 182static const int timer_through_8259 = 0;
182static inline void ioapic_init_mappings(void) { } 183static inline void ioapic_init_mappings(void) { }
184static inline void ioapic_insert_resources(void) { }
183 185
184static inline void probe_nr_irqs_gsi(void) { } 186static inline void probe_nr_irqs_gsi(void) { }
185#endif 187#endif
diff --git a/arch/x86/include/asm/irqflags.h b/arch/x86/include/asm/irqflags.h
index 2bdab21f0898..c6ccbe7e81ad 100644
--- a/arch/x86/include/asm/irqflags.h
+++ b/arch/x86/include/asm/irqflags.h
@@ -12,9 +12,15 @@ static inline unsigned long native_save_fl(void)
12{ 12{
13 unsigned long flags; 13 unsigned long flags;
14 14
15 /*
16 * Note: this needs to be "=r" not "=rm", because we have the
17 * stack offset from what gcc expects at the time the "pop" is
18 * executed, and so a memory reference with respect to the stack
19 * would end up using the wrong address.
20 */
15 asm volatile("# __raw_save_flags\n\t" 21 asm volatile("# __raw_save_flags\n\t"
16 "pushf ; pop %0" 22 "pushf ; pop %0"
17 : "=g" (flags) 23 : "=r" (flags)
18 : /* no input */ 24 : /* no input */
19 : "memory"); 25 : "memory");
20 26
diff --git a/arch/x86/include/asm/lguest.h b/arch/x86/include/asm/lguest.h
index 313389cd50d2..5136dad57cbb 100644
--- a/arch/x86/include/asm/lguest.h
+++ b/arch/x86/include/asm/lguest.h
@@ -17,8 +17,7 @@
17/* Pages for switcher itself, then two pages per cpu */ 17/* Pages for switcher itself, then two pages per cpu */
18#define TOTAL_SWITCHER_PAGES (SHARED_SWITCHER_PAGES + 2 * nr_cpu_ids) 18#define TOTAL_SWITCHER_PAGES (SHARED_SWITCHER_PAGES + 2 * nr_cpu_ids)
19 19
20/* We map at -4M (-2M when PAE is activated) for ease of mapping 20/* We map at -4M (-2M for PAE) for ease of mapping (one PTE page). */
21 * into the guest (one PTE page). */
22#ifdef CONFIG_X86_PAE 21#ifdef CONFIG_X86_PAE
23#define SWITCHER_ADDR 0xFFE00000 22#define SWITCHER_ADDR 0xFFE00000
24#else 23#else
diff --git a/arch/x86/include/asm/lguest_hcall.h b/arch/x86/include/asm/lguest_hcall.h
index d31c4a684078..ba0eed8aa1a6 100644
--- a/arch/x86/include/asm/lguest_hcall.h
+++ b/arch/x86/include/asm/lguest_hcall.h
@@ -30,27 +30,27 @@
30#include <asm/hw_irq.h> 30#include <asm/hw_irq.h>
31#include <asm/kvm_para.h> 31#include <asm/kvm_para.h>
32 32
33/*G:031 But first, how does our Guest contact the Host to ask for privileged 33/*G:030
34 * But first, how does our Guest contact the Host to ask for privileged
34 * operations? There are two ways: the direct way is to make a "hypercall", 35 * operations? There are two ways: the direct way is to make a "hypercall",
35 * to make requests of the Host Itself. 36 * to make requests of the Host Itself.
36 * 37 *
37 * We use the KVM hypercall mechanism. Seventeen hypercalls are 38 * We use the KVM hypercall mechanism, though completely different hypercall
38 * available: the hypercall number is put in the %eax register, and the 39 * numbers. Seventeen hypercalls are available: the hypercall number is put in
39 * arguments (when required) are placed in %ebx, %ecx, %edx and %esi. 40 * the %eax register, and the arguments (when required) are placed in %ebx,
40 * If a return value makes sense, it's returned in %eax. 41 * %ecx, %edx and %esi. If a return value makes sense, it's returned in %eax.
41 * 42 *
42 * Grossly invalid calls result in Sudden Death at the hands of the vengeful 43 * Grossly invalid calls result in Sudden Death at the hands of the vengeful
43 * Host, rather than returning failure. This reflects Winston Churchill's 44 * Host, rather than returning failure. This reflects Winston Churchill's
44 * definition of a gentleman: "someone who is only rude intentionally". */ 45 * definition of a gentleman: "someone who is only rude intentionally".
45/*:*/ 46:*/
46 47
47/* Can't use our min() macro here: needs to be a constant */ 48/* Can't use our min() macro here: needs to be a constant */
48#define LGUEST_IRQS (NR_IRQS < 32 ? NR_IRQS: 32) 49#define LGUEST_IRQS (NR_IRQS < 32 ? NR_IRQS: 32)
49 50
50#define LHCALL_RING_SIZE 64 51#define LHCALL_RING_SIZE 64
51struct hcall_args { 52struct hcall_args {
52 /* These map directly onto eax, ebx, ecx, edx and esi 53 /* These map directly onto eax/ebx/ecx/edx/esi in struct lguest_regs */
53 * in struct lguest_regs */
54 unsigned long arg0, arg1, arg2, arg3, arg4; 54 unsigned long arg0, arg1, arg2, arg3, arg4;
55}; 55};
56 56
diff --git a/arch/x86/include/asm/msr-index.h b/arch/x86/include/asm/msr-index.h
index 1692fb5050e3..6be7fc254b59 100644
--- a/arch/x86/include/asm/msr-index.h
+++ b/arch/x86/include/asm/msr-index.h
@@ -246,10 +246,6 @@
246#define MSR_IA32_MISC_ENABLE_TURBO_DISABLE (1ULL << 38) 246#define MSR_IA32_MISC_ENABLE_TURBO_DISABLE (1ULL << 38)
247#define MSR_IA32_MISC_ENABLE_IP_PREF_DISABLE (1ULL << 39) 247#define MSR_IA32_MISC_ENABLE_IP_PREF_DISABLE (1ULL << 39)
248 248
249/* Intel Model 6 */
250#define MSR_P6_EVNTSEL0 0x00000186
251#define MSR_P6_EVNTSEL1 0x00000187
252
253/* P4/Xeon+ specific */ 249/* P4/Xeon+ specific */
254#define MSR_IA32_MCG_EAX 0x00000180 250#define MSR_IA32_MCG_EAX 0x00000180
255#define MSR_IA32_MCG_EBX 0x00000181 251#define MSR_IA32_MCG_EBX 0x00000181
diff --git a/arch/x86/include/asm/nmi.h b/arch/x86/include/asm/nmi.h
index c97264409934..c86e5ed4af51 100644
--- a/arch/x86/include/asm/nmi.h
+++ b/arch/x86/include/asm/nmi.h
@@ -72,7 +72,6 @@ void lapic_watchdog_stop(void);
72int lapic_watchdog_init(unsigned nmi_hz); 72int lapic_watchdog_init(unsigned nmi_hz);
73int lapic_wd_event(unsigned nmi_hz); 73int lapic_wd_event(unsigned nmi_hz);
74unsigned lapic_adjust_nmi_hz(unsigned hz); 74unsigned lapic_adjust_nmi_hz(unsigned hz);
75int lapic_watchdog_ok(void);
76void disable_lapic_nmi_watchdog(void); 75void disable_lapic_nmi_watchdog(void);
77void enable_lapic_nmi_watchdog(void); 76void enable_lapic_nmi_watchdog(void);
78void stop_nmi(void); 77void stop_nmi(void);
diff --git a/arch/x86/include/asm/pci.h b/arch/x86/include/asm/pci.h
index 927958d13c19..1ff685ca221c 100644
--- a/arch/x86/include/asm/pci.h
+++ b/arch/x86/include/asm/pci.h
@@ -91,7 +91,7 @@ extern void pci_iommu_alloc(void);
91 91
92#define PCI_DMA_BUS_IS_PHYS (dma_ops->is_phys) 92#define PCI_DMA_BUS_IS_PHYS (dma_ops->is_phys)
93 93
94#if defined(CONFIG_X86_64) || defined(CONFIG_DMA_API_DEBUG) 94#if defined(CONFIG_X86_64) || defined(CONFIG_DMAR) || defined(CONFIG_DMA_API_DEBUG)
95 95
96#define DECLARE_PCI_UNMAP_ADDR(ADDR_NAME) \ 96#define DECLARE_PCI_UNMAP_ADDR(ADDR_NAME) \
97 dma_addr_t ADDR_NAME; 97 dma_addr_t ADDR_NAME;
diff --git a/arch/x86/include/asm/percpu.h b/arch/x86/include/asm/percpu.h
index 02ecb30982a3..103f1ddb0d85 100644
--- a/arch/x86/include/asm/percpu.h
+++ b/arch/x86/include/asm/percpu.h
@@ -42,6 +42,7 @@
42 42
43#else /* ...!ASSEMBLY */ 43#else /* ...!ASSEMBLY */
44 44
45#include <linux/kernel.h>
45#include <linux/stringify.h> 46#include <linux/stringify.h>
46 47
47#ifdef CONFIG_SMP 48#ifdef CONFIG_SMP
@@ -155,6 +156,15 @@ do { \
155/* We can use this directly for local CPU (faster). */ 156/* We can use this directly for local CPU (faster). */
156DECLARE_PER_CPU(unsigned long, this_cpu_off); 157DECLARE_PER_CPU(unsigned long, this_cpu_off);
157 158
159#ifdef CONFIG_NEED_MULTIPLE_NODES
160void *pcpu_lpage_remapped(void *kaddr);
161#else
162static inline void *pcpu_lpage_remapped(void *kaddr)
163{
164 return NULL;
165}
166#endif
167
158#endif /* !__ASSEMBLY__ */ 168#endif /* !__ASSEMBLY__ */
159 169
160#ifdef CONFIG_SMP 170#ifdef CONFIG_SMP
diff --git a/arch/x86/include/asm/perf_counter.h b/arch/x86/include/asm/perf_counter.h
index 5fb33e160ea0..fa64e401589d 100644
--- a/arch/x86/include/asm/perf_counter.h
+++ b/arch/x86/include/asm/perf_counter.h
@@ -87,6 +87,9 @@ union cpuid10_edx {
87#ifdef CONFIG_PERF_COUNTERS 87#ifdef CONFIG_PERF_COUNTERS
88extern void init_hw_perf_counters(void); 88extern void init_hw_perf_counters(void);
89extern void perf_counters_lapic_init(void); 89extern void perf_counters_lapic_init(void);
90
91#define PERF_COUNTER_INDEX_OFFSET 0
92
90#else 93#else
91static inline void init_hw_perf_counters(void) { } 94static inline void init_hw_perf_counters(void) { }
92static inline void perf_counters_lapic_init(void) { } 95static inline void perf_counters_lapic_init(void) { }
diff --git a/arch/x86/include/asm/pgalloc.h b/arch/x86/include/asm/pgalloc.h
index dd14c54ac718..0e8c2a0fd922 100644
--- a/arch/x86/include/asm/pgalloc.h
+++ b/arch/x86/include/asm/pgalloc.h
@@ -46,7 +46,13 @@ static inline void pte_free(struct mm_struct *mm, struct page *pte)
46 __free_page(pte); 46 __free_page(pte);
47} 47}
48 48
49extern void __pte_free_tlb(struct mmu_gather *tlb, struct page *pte); 49extern void ___pte_free_tlb(struct mmu_gather *tlb, struct page *pte);
50
51static inline void __pte_free_tlb(struct mmu_gather *tlb, struct page *pte,
52 unsigned long address)
53{
54 ___pte_free_tlb(tlb, pte);
55}
50 56
51static inline void pmd_populate_kernel(struct mm_struct *mm, 57static inline void pmd_populate_kernel(struct mm_struct *mm,
52 pmd_t *pmd, pte_t *pte) 58 pmd_t *pmd, pte_t *pte)
@@ -78,7 +84,13 @@ static inline void pmd_free(struct mm_struct *mm, pmd_t *pmd)
78 free_page((unsigned long)pmd); 84 free_page((unsigned long)pmd);
79} 85}
80 86
81extern void __pmd_free_tlb(struct mmu_gather *tlb, pmd_t *pmd); 87extern void ___pmd_free_tlb(struct mmu_gather *tlb, pmd_t *pmd);
88
89static inline void __pmd_free_tlb(struct mmu_gather *tlb, pmd_t *pmd,
90 unsigned long adddress)
91{
92 ___pmd_free_tlb(tlb, pmd);
93}
82 94
83#ifdef CONFIG_X86_PAE 95#ifdef CONFIG_X86_PAE
84extern void pud_populate(struct mm_struct *mm, pud_t *pudp, pmd_t *pmd); 96extern void pud_populate(struct mm_struct *mm, pud_t *pudp, pmd_t *pmd);
@@ -108,7 +120,14 @@ static inline void pud_free(struct mm_struct *mm, pud_t *pud)
108 free_page((unsigned long)pud); 120 free_page((unsigned long)pud);
109} 121}
110 122
111extern void __pud_free_tlb(struct mmu_gather *tlb, pud_t *pud); 123extern void ___pud_free_tlb(struct mmu_gather *tlb, pud_t *pud);
124
125static inline void __pud_free_tlb(struct mmu_gather *tlb, pud_t *pud,
126 unsigned long address)
127{
128 ___pud_free_tlb(tlb, pud);
129}
130
112#endif /* PAGETABLE_LEVELS > 3 */ 131#endif /* PAGETABLE_LEVELS > 3 */
113#endif /* PAGETABLE_LEVELS > 2 */ 132#endif /* PAGETABLE_LEVELS > 2 */
114 133
diff --git a/arch/x86/include/asm/proto.h b/arch/x86/include/asm/proto.h
index 49fb3ecf3bb3..621f56d73121 100644
--- a/arch/x86/include/asm/proto.h
+++ b/arch/x86/include/asm/proto.h
@@ -22,7 +22,14 @@ extern int reboot_force;
22 22
23long do_arch_prctl(struct task_struct *task, int code, unsigned long addr); 23long do_arch_prctl(struct task_struct *task, int code, unsigned long addr);
24 24
25#define round_up(x, y) (((x) + (y) - 1) & ~((y) - 1)) 25/*
26#define round_down(x, y) ((x) & ~((y) - 1)) 26 * This looks more complex than it should be. But we need to
27 * get the type for the ~ right in round_down (it needs to be
28 * as wide as the result!), and we want to evaluate the macro
29 * arguments just once each.
30 */
31#define __round_mask(x,y) ((__typeof__(x))((y)-1))
32#define round_up(x,y) ((((x)-1) | __round_mask(x,y))+1)
33#define round_down(x,y) ((x) & ~__round_mask(x,y))
27 34
28#endif /* _ASM_X86_PROTO_H */ 35#endif /* _ASM_X86_PROTO_H */
diff --git a/arch/x86/include/asm/stacktrace.h b/arch/x86/include/asm/stacktrace.h
index f517944b2b17..cf86a5e73815 100644
--- a/arch/x86/include/asm/stacktrace.h
+++ b/arch/x86/include/asm/stacktrace.h
@@ -3,6 +3,8 @@
3 3
4extern int kstack_depth_to_print; 4extern int kstack_depth_to_print;
5 5
6int x86_is_stack_id(int id, char *name);
7
6/* Generic stack tracer with callbacks */ 8/* Generic stack tracer with callbacks */
7 9
8struct stacktrace_ops { 10struct stacktrace_ops {
diff --git a/arch/x86/include/asm/thread_info.h b/arch/x86/include/asm/thread_info.h
index b0783520988b..fad7d40b75f8 100644
--- a/arch/x86/include/asm/thread_info.h
+++ b/arch/x86/include/asm/thread_info.h
@@ -49,7 +49,7 @@ struct thread_info {
49 .exec_domain = &default_exec_domain, \ 49 .exec_domain = &default_exec_domain, \
50 .flags = 0, \ 50 .flags = 0, \
51 .cpu = 0, \ 51 .cpu = 0, \
52 .preempt_count = 1, \ 52 .preempt_count = INIT_PREEMPT_COUNT, \
53 .addr_limit = KERNEL_DS, \ 53 .addr_limit = KERNEL_DS, \
54 .restart_block = { \ 54 .restart_block = { \
55 .fn = do_no_restart_syscall, \ 55 .fn = do_no_restart_syscall, \
diff --git a/arch/x86/include/asm/uaccess.h b/arch/x86/include/asm/uaccess.h
index 20e6a795e160..d2c6c930b491 100644
--- a/arch/x86/include/asm/uaccess.h
+++ b/arch/x86/include/asm/uaccess.h
@@ -212,9 +212,9 @@ extern int __get_user_bad(void);
212 : "A" ((typeof(*(ptr)))(x)), "c" (ptr) : "ebx") 212 : "A" ((typeof(*(ptr)))(x)), "c" (ptr) : "ebx")
213#else 213#else
214#define __put_user_asm_u64(x, ptr, retval, errret) \ 214#define __put_user_asm_u64(x, ptr, retval, errret) \
215 __put_user_asm(x, ptr, retval, "q", "", "Zr", errret) 215 __put_user_asm(x, ptr, retval, "q", "", "er", errret)
216#define __put_user_asm_ex_u64(x, addr) \ 216#define __put_user_asm_ex_u64(x, addr) \
217 __put_user_asm_ex(x, addr, "q", "", "Zr") 217 __put_user_asm_ex(x, addr, "q", "", "er")
218#define __put_user_x8(x, ptr, __ret_pu) __put_user_x(8, x, ptr, __ret_pu) 218#define __put_user_x8(x, ptr, __ret_pu) __put_user_x(8, x, ptr, __ret_pu)
219#endif 219#endif
220 220
diff --git a/arch/x86/include/asm/uaccess_64.h b/arch/x86/include/asm/uaccess_64.h
index 8cc687326eb8..db24b215fc50 100644
--- a/arch/x86/include/asm/uaccess_64.h
+++ b/arch/x86/include/asm/uaccess_64.h
@@ -88,11 +88,11 @@ int __copy_to_user(void __user *dst, const void *src, unsigned size)
88 ret, "l", "k", "ir", 4); 88 ret, "l", "k", "ir", 4);
89 return ret; 89 return ret;
90 case 8:__put_user_asm(*(u64 *)src, (u64 __user *)dst, 90 case 8:__put_user_asm(*(u64 *)src, (u64 __user *)dst,
91 ret, "q", "", "ir", 8); 91 ret, "q", "", "er", 8);
92 return ret; 92 return ret;
93 case 10: 93 case 10:
94 __put_user_asm(*(u64 *)src, (u64 __user *)dst, 94 __put_user_asm(*(u64 *)src, (u64 __user *)dst,
95 ret, "q", "", "ir", 10); 95 ret, "q", "", "er", 10);
96 if (unlikely(ret)) 96 if (unlikely(ret))
97 return ret; 97 return ret;
98 asm("":::"memory"); 98 asm("":::"memory");
@@ -101,12 +101,12 @@ int __copy_to_user(void __user *dst, const void *src, unsigned size)
101 return ret; 101 return ret;
102 case 16: 102 case 16:
103 __put_user_asm(*(u64 *)src, (u64 __user *)dst, 103 __put_user_asm(*(u64 *)src, (u64 __user *)dst,
104 ret, "q", "", "ir", 16); 104 ret, "q", "", "er", 16);
105 if (unlikely(ret)) 105 if (unlikely(ret))
106 return ret; 106 return ret;
107 asm("":::"memory"); 107 asm("":::"memory");
108 __put_user_asm(1[(u64 *)src], 1 + (u64 __user *)dst, 108 __put_user_asm(1[(u64 *)src], 1 + (u64 __user *)dst,
109 ret, "q", "", "ir", 8); 109 ret, "q", "", "er", 8);
110 return ret; 110 return ret;
111 default: 111 default:
112 return copy_user_generic((__force void *)dst, src, size); 112 return copy_user_generic((__force void *)dst, src, size);
@@ -157,7 +157,7 @@ int __copy_in_user(void __user *dst, const void __user *src, unsigned size)
157 ret, "q", "", "=r", 8); 157 ret, "q", "", "=r", 8);
158 if (likely(!ret)) 158 if (likely(!ret))
159 __put_user_asm(tmp, (u64 __user *)dst, 159 __put_user_asm(tmp, (u64 __user *)dst,
160 ret, "q", "", "ir", 8); 160 ret, "q", "", "er", 8);
161 return ret; 161 return ret;
162 } 162 }
163 default: 163 default:
diff --git a/arch/x86/include/asm/uv/uv_hub.h b/arch/x86/include/asm/uv/uv_hub.h
index 341070f7ad5c..77a68505419a 100644
--- a/arch/x86/include/asm/uv/uv_hub.h
+++ b/arch/x86/include/asm/uv/uv_hub.h
@@ -175,7 +175,7 @@ DECLARE_PER_CPU(struct uv_hub_info_s, __uv_hub_info);
175#define UV_GLOBAL_MMR32_PNODE_BITS(p) ((p) << (UV_GLOBAL_MMR32_PNODE_SHIFT)) 175#define UV_GLOBAL_MMR32_PNODE_BITS(p) ((p) << (UV_GLOBAL_MMR32_PNODE_SHIFT))
176 176
177#define UV_GLOBAL_MMR64_PNODE_BITS(p) \ 177#define UV_GLOBAL_MMR64_PNODE_BITS(p) \
178 ((unsigned long)(UV_PNODE_TO_GNODE(p)) << UV_GLOBAL_MMR64_PNODE_SHIFT) 178 (((unsigned long)(p)) << UV_GLOBAL_MMR64_PNODE_SHIFT)
179 179
180#define UV_APIC_PNODE_SHIFT 6 180#define UV_APIC_PNODE_SHIFT 6
181 181
@@ -327,6 +327,7 @@ struct uv_blade_info {
327 unsigned short nr_possible_cpus; 327 unsigned short nr_possible_cpus;
328 unsigned short nr_online_cpus; 328 unsigned short nr_online_cpus;
329 unsigned short pnode; 329 unsigned short pnode;
330 short memory_nid;
330}; 331};
331extern struct uv_blade_info *uv_blade_info; 332extern struct uv_blade_info *uv_blade_info;
332extern short *uv_node_to_blade; 333extern short *uv_node_to_blade;
@@ -363,6 +364,12 @@ static inline int uv_blade_to_pnode(int bid)
363 return uv_blade_info[bid].pnode; 364 return uv_blade_info[bid].pnode;
364} 365}
365 366
367/* Nid of memory node on blade. -1 if no blade-local memory */
368static inline int uv_blade_to_memory_nid(int bid)
369{
370 return uv_blade_info[bid].memory_nid;
371}
372
366/* Determine the number of possible cpus on a blade */ 373/* Determine the number of possible cpus on a blade */
367static inline int uv_blade_nr_possible_cpus(int bid) 374static inline int uv_blade_nr_possible_cpus(int bid)
368{ 375{
diff --git a/arch/x86/kernel/Makefile b/arch/x86/kernel/Makefile
index 6c327b852e23..430d5b24af7b 100644
--- a/arch/x86/kernel/Makefile
+++ b/arch/x86/kernel/Makefile
@@ -26,6 +26,8 @@ CFLAGS_tsc.o := $(nostackp)
26CFLAGS_paravirt.o := $(nostackp) 26CFLAGS_paravirt.o := $(nostackp)
27GCOV_PROFILE_vsyscall_64.o := n 27GCOV_PROFILE_vsyscall_64.o := n
28GCOV_PROFILE_hpet.o := n 28GCOV_PROFILE_hpet.o := n
29GCOV_PROFILE_tsc.o := n
30GCOV_PROFILE_paravirt.o := n
29 31
30obj-y := process_$(BITS).o signal.o entry_$(BITS).o 32obj-y := process_$(BITS).o signal.o entry_$(BITS).o
31obj-y += traps.o irq.o irq_$(BITS).o dumpstack_$(BITS).o 33obj-y += traps.o irq.o irq_$(BITS).o dumpstack_$(BITS).o
diff --git a/arch/x86/kernel/amd_iommu.c b/arch/x86/kernel/amd_iommu.c
index 9372f0406ad4..6c99f5037801 100644
--- a/arch/x86/kernel/amd_iommu.c
+++ b/arch/x86/kernel/amd_iommu.c
@@ -1192,7 +1192,7 @@ out:
1192 return 0; 1192 return 0;
1193} 1193}
1194 1194
1195struct notifier_block device_nb = { 1195static struct notifier_block device_nb = {
1196 .notifier_call = device_change_notifier, 1196 .notifier_call = device_change_notifier,
1197}; 1197};
1198 1198
@@ -1763,7 +1763,7 @@ static void *alloc_coherent(struct device *dev, size_t size,
1763 flag |= __GFP_ZERO; 1763 flag |= __GFP_ZERO;
1764 virt_addr = (void *)__get_free_pages(flag, get_order(size)); 1764 virt_addr = (void *)__get_free_pages(flag, get_order(size));
1765 if (!virt_addr) 1765 if (!virt_addr)
1766 return 0; 1766 return NULL;
1767 1767
1768 paddr = virt_to_phys(virt_addr); 1768 paddr = virt_to_phys(virt_addr);
1769 1769
diff --git a/arch/x86/kernel/amd_iommu_init.c b/arch/x86/kernel/amd_iommu_init.c
index 10b2accd12ea..c1b17e97252e 100644
--- a/arch/x86/kernel/amd_iommu_init.c
+++ b/arch/x86/kernel/amd_iommu_init.c
@@ -472,6 +472,8 @@ static u8 * __init alloc_event_buffer(struct amd_iommu *iommu)
472 if (iommu->evt_buf == NULL) 472 if (iommu->evt_buf == NULL)
473 return NULL; 473 return NULL;
474 474
475 iommu->evt_buf_size = EVT_BUFFER_SIZE;
476
475 return iommu->evt_buf; 477 return iommu->evt_buf;
476} 478}
477 479
@@ -691,6 +693,7 @@ static void __init init_iommu_from_acpi(struct amd_iommu *iommu,
691 693
692 devid = e->devid; 694 devid = e->devid;
693 devid_to = e->ext >> 8; 695 devid_to = e->ext >> 8;
696 set_dev_entry_from_acpi(iommu, devid , e->flags, 0);
694 set_dev_entry_from_acpi(iommu, devid_to, e->flags, 0); 697 set_dev_entry_from_acpi(iommu, devid_to, e->flags, 0);
695 amd_iommu_alias_table[devid] = devid_to; 698 amd_iommu_alias_table[devid] = devid_to;
696 break; 699 break;
@@ -749,11 +752,13 @@ static void __init init_iommu_from_acpi(struct amd_iommu *iommu,
749 752
750 devid = e->devid; 753 devid = e->devid;
751 for (dev_i = devid_start; dev_i <= devid; ++dev_i) { 754 for (dev_i = devid_start; dev_i <= devid; ++dev_i) {
752 if (alias) 755 if (alias) {
753 amd_iommu_alias_table[dev_i] = devid_to; 756 amd_iommu_alias_table[dev_i] = devid_to;
754 set_dev_entry_from_acpi(iommu, 757 set_dev_entry_from_acpi(iommu,
755 amd_iommu_alias_table[dev_i], 758 devid_to, flags, ext_flags);
756 flags, ext_flags); 759 }
760 set_dev_entry_from_acpi(iommu, dev_i,
761 flags, ext_flags);
757 } 762 }
758 break; 763 break;
759 default: 764 default:
diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c
index 8c7c042ecad1..0a1c2830ec66 100644
--- a/arch/x86/kernel/apic/apic.c
+++ b/arch/x86/kernel/apic/apic.c
@@ -140,7 +140,6 @@ int x2apic_mode;
140#ifdef CONFIG_X86_X2APIC 140#ifdef CONFIG_X86_X2APIC
141/* x2apic enabled before OS handover */ 141/* x2apic enabled before OS handover */
142static int x2apic_preenabled; 142static int x2apic_preenabled;
143static int disable_x2apic;
144static __init int setup_nox2apic(char *str) 143static __init int setup_nox2apic(char *str)
145{ 144{
146 if (x2apic_enabled()) { 145 if (x2apic_enabled()) {
@@ -149,7 +148,6 @@ static __init int setup_nox2apic(char *str)
149 return 0; 148 return 0;
150 } 149 }
151 150
152 disable_x2apic = 1;
153 setup_clear_cpu_cap(X86_FEATURE_X2APIC); 151 setup_clear_cpu_cap(X86_FEATURE_X2APIC);
154 return 0; 152 return 0;
155} 153}
diff --git a/arch/x86/kernel/apic/es7000_32.c b/arch/x86/kernel/apic/es7000_32.c
index 69328ac8de9c..8952a5890281 100644
--- a/arch/x86/kernel/apic/es7000_32.c
+++ b/arch/x86/kernel/apic/es7000_32.c
@@ -652,7 +652,8 @@ static int es7000_mps_oem_check_cluster(struct mpc_table *mpc, char *oem,
652 return ret && es7000_apic_is_cluster(); 652 return ret && es7000_apic_is_cluster();
653} 653}
654 654
655struct apic apic_es7000_cluster = { 655/* We've been warned by a false positive warning.Use __refdata to keep calm. */
656struct apic __refdata apic_es7000_cluster = {
656 657
657 .name = "es7000", 658 .name = "es7000",
658 .probe = probe_es7000, 659 .probe = probe_es7000,
diff --git a/arch/x86/kernel/apic/io_apic.c b/arch/x86/kernel/apic/io_apic.c
index 4d0216fcb36c..d2ed6c5ddc80 100644
--- a/arch/x86/kernel/apic/io_apic.c
+++ b/arch/x86/kernel/apic/io_apic.c
@@ -1716,25 +1716,19 @@ __apicdebuginit(void) print_IO_APIC(void)
1716 return; 1716 return;
1717} 1717}
1718 1718
1719__apicdebuginit(void) print_APIC_bitfield(int base) 1719__apicdebuginit(void) print_APIC_field(int base)
1720{ 1720{
1721 unsigned int v; 1721 int i;
1722 int i, j;
1723 1722
1724 if (apic_verbosity == APIC_QUIET) 1723 if (apic_verbosity == APIC_QUIET)
1725 return; 1724 return;
1726 1725
1727 printk(KERN_DEBUG "0123456789abcdef0123456789abcdef\n" KERN_DEBUG); 1726 printk(KERN_DEBUG);
1728 for (i = 0; i < 8; i++) { 1727
1729 v = apic_read(base + i*0x10); 1728 for (i = 0; i < 8; i++)
1730 for (j = 0; j < 32; j++) { 1729 printk(KERN_CONT "%08x", apic_read(base + i*0x10));
1731 if (v & (1<<j)) 1730
1732 printk("1"); 1731 printk(KERN_CONT "\n");
1733 else
1734 printk("0");
1735 }
1736 printk("\n");
1737 }
1738} 1732}
1739 1733
1740__apicdebuginit(void) print_local_APIC(void *dummy) 1734__apicdebuginit(void) print_local_APIC(void *dummy)
@@ -1745,7 +1739,7 @@ __apicdebuginit(void) print_local_APIC(void *dummy)
1745 if (apic_verbosity == APIC_QUIET) 1739 if (apic_verbosity == APIC_QUIET)
1746 return; 1740 return;
1747 1741
1748 printk("\n" KERN_DEBUG "printing local APIC contents on CPU#%d/%d:\n", 1742 printk(KERN_DEBUG "printing local APIC contents on CPU#%d/%d:\n",
1749 smp_processor_id(), hard_smp_processor_id()); 1743 smp_processor_id(), hard_smp_processor_id());
1750 v = apic_read(APIC_ID); 1744 v = apic_read(APIC_ID);
1751 printk(KERN_INFO "... APIC ID: %08x (%01x)\n", v, read_apic_id()); 1745 printk(KERN_INFO "... APIC ID: %08x (%01x)\n", v, read_apic_id());
@@ -1786,11 +1780,11 @@ __apicdebuginit(void) print_local_APIC(void *dummy)
1786 printk(KERN_DEBUG "... APIC SPIV: %08x\n", v); 1780 printk(KERN_DEBUG "... APIC SPIV: %08x\n", v);
1787 1781
1788 printk(KERN_DEBUG "... APIC ISR field:\n"); 1782 printk(KERN_DEBUG "... APIC ISR field:\n");
1789 print_APIC_bitfield(APIC_ISR); 1783 print_APIC_field(APIC_ISR);
1790 printk(KERN_DEBUG "... APIC TMR field:\n"); 1784 printk(KERN_DEBUG "... APIC TMR field:\n");
1791 print_APIC_bitfield(APIC_TMR); 1785 print_APIC_field(APIC_TMR);
1792 printk(KERN_DEBUG "... APIC IRR field:\n"); 1786 printk(KERN_DEBUG "... APIC IRR field:\n");
1793 print_APIC_bitfield(APIC_IRR); 1787 print_APIC_field(APIC_IRR);
1794 1788
1795 if (APIC_INTEGRATED(ver)) { /* !82489DX */ 1789 if (APIC_INTEGRATED(ver)) { /* !82489DX */
1796 if (maxlvt > 3) /* Due to the Pentium erratum 3AP. */ 1790 if (maxlvt > 3) /* Due to the Pentium erratum 3AP. */
@@ -3799,6 +3793,9 @@ int arch_enable_uv_irq(char *irq_name, unsigned int irq, int cpu, int mmr_blade,
3799 mmr_pnode = uv_blade_to_pnode(mmr_blade); 3793 mmr_pnode = uv_blade_to_pnode(mmr_blade);
3800 uv_write_global_mmr64(mmr_pnode, mmr_offset, mmr_value); 3794 uv_write_global_mmr64(mmr_pnode, mmr_offset, mmr_value);
3801 3795
3796 if (cfg->move_in_progress)
3797 send_cleanup_vector(cfg);
3798
3802 return irq; 3799 return irq;
3803} 3800}
3804 3801
@@ -4187,28 +4184,20 @@ fake_ioapic_page:
4187 } 4184 }
4188} 4185}
4189 4186
4190static int __init ioapic_insert_resources(void) 4187void __init ioapic_insert_resources(void)
4191{ 4188{
4192 int i; 4189 int i;
4193 struct resource *r = ioapic_resources; 4190 struct resource *r = ioapic_resources;
4194 4191
4195 if (!r) { 4192 if (!r) {
4196 if (nr_ioapics > 0) { 4193 if (nr_ioapics > 0)
4197 printk(KERN_ERR 4194 printk(KERN_ERR
4198 "IO APIC resources couldn't be allocated.\n"); 4195 "IO APIC resources couldn't be allocated.\n");
4199 return -1; 4196 return;
4200 }
4201 return 0;
4202 } 4197 }
4203 4198
4204 for (i = 0; i < nr_ioapics; i++) { 4199 for (i = 0; i < nr_ioapics; i++) {
4205 insert_resource(&iomem_resource, r); 4200 insert_resource(&iomem_resource, r);
4206 r++; 4201 r++;
4207 } 4202 }
4208
4209 return 0;
4210} 4203}
4211
4212/* Insert the IO APIC resources after PCI initialization has occured to handle
4213 * IO APICS that are mapped in on a BAR in PCI space. */
4214late_initcall(ioapic_insert_resources);
diff --git a/arch/x86/kernel/apic/numaq_32.c b/arch/x86/kernel/apic/numaq_32.c
index 533e59c6fc82..ca96e68f0d23 100644
--- a/arch/x86/kernel/apic/numaq_32.c
+++ b/arch/x86/kernel/apic/numaq_32.c
@@ -493,7 +493,8 @@ static void numaq_setup_portio_remap(void)
493 (u_long) xquad_portio, (u_long) num_quads*XQUAD_PORTIO_QUAD); 493 (u_long) xquad_portio, (u_long) num_quads*XQUAD_PORTIO_QUAD);
494} 494}
495 495
496struct apic apic_numaq = { 496/* Use __refdata to keep false positive warning calm. */
497struct apic __refdata apic_numaq = {
497 498
498 .name = "NUMAQ", 499 .name = "NUMAQ",
499 .probe = probe_numaq, 500 .probe = probe_numaq,
diff --git a/arch/x86/kernel/apic/x2apic_cluster.c b/arch/x86/kernel/apic/x2apic_cluster.c
index 8e4cbb255c38..a5371ec36776 100644
--- a/arch/x86/kernel/apic/x2apic_cluster.c
+++ b/arch/x86/kernel/apic/x2apic_cluster.c
@@ -17,11 +17,13 @@ static int x2apic_acpi_madt_oem_check(char *oem_id, char *oem_table_id)
17 return x2apic_enabled(); 17 return x2apic_enabled();
18} 18}
19 19
20/* Start with all IRQs pointing to boot CPU. IRQ balancing will shift them. */ 20/*
21 21 * need to use more than cpu 0, because we need more vectors when
22 * MSI-X are used.
23 */
22static const struct cpumask *x2apic_target_cpus(void) 24static const struct cpumask *x2apic_target_cpus(void)
23{ 25{
24 return cpumask_of(0); 26 return cpu_online_mask;
25} 27}
26 28
27/* 29/*
@@ -170,7 +172,7 @@ static unsigned long set_apic_id(unsigned int id)
170 172
171static int x2apic_cluster_phys_pkg_id(int initial_apicid, int index_msb) 173static int x2apic_cluster_phys_pkg_id(int initial_apicid, int index_msb)
172{ 174{
173 return current_cpu_data.initial_apicid >> index_msb; 175 return initial_apicid >> index_msb;
174} 176}
175 177
176static void x2apic_send_IPI_self(int vector) 178static void x2apic_send_IPI_self(int vector)
diff --git a/arch/x86/kernel/apic/x2apic_phys.c b/arch/x86/kernel/apic/x2apic_phys.c
index a284359627e7..a8989aadc99a 100644
--- a/arch/x86/kernel/apic/x2apic_phys.c
+++ b/arch/x86/kernel/apic/x2apic_phys.c
@@ -27,11 +27,13 @@ static int x2apic_acpi_madt_oem_check(char *oem_id, char *oem_table_id)
27 return 0; 27 return 0;
28} 28}
29 29
30/* Start with all IRQs pointing to boot CPU. IRQ balancing will shift them. */ 30/*
31 31 * need to use more than cpu 0, because we need more vectors when
32 * MSI-X are used.
33 */
32static const struct cpumask *x2apic_target_cpus(void) 34static const struct cpumask *x2apic_target_cpus(void)
33{ 35{
34 return cpumask_of(0); 36 return cpu_online_mask;
35} 37}
36 38
37static void x2apic_vector_allocation_domain(int cpu, struct cpumask *retmask) 39static void x2apic_vector_allocation_domain(int cpu, struct cpumask *retmask)
@@ -162,7 +164,7 @@ static unsigned long set_apic_id(unsigned int id)
162 164
163static int x2apic_phys_pkg_id(int initial_apicid, int index_msb) 165static int x2apic_phys_pkg_id(int initial_apicid, int index_msb)
164{ 166{
165 return current_cpu_data.initial_apicid >> index_msb; 167 return initial_apicid >> index_msb;
166} 168}
167 169
168static void x2apic_send_IPI_self(int vector) 170static void x2apic_send_IPI_self(int vector)
diff --git a/arch/x86/kernel/apic/x2apic_uv_x.c b/arch/x86/kernel/apic/x2apic_uv_x.c
index 096d19aea2f7..832e908adcb5 100644
--- a/arch/x86/kernel/apic/x2apic_uv_x.c
+++ b/arch/x86/kernel/apic/x2apic_uv_x.c
@@ -261,7 +261,7 @@ struct apic apic_x2apic_uv_x = {
261 .apic_id_registered = uv_apic_id_registered, 261 .apic_id_registered = uv_apic_id_registered,
262 262
263 .irq_delivery_mode = dest_Fixed, 263 .irq_delivery_mode = dest_Fixed,
264 .irq_dest_mode = 1, /* logical */ 264 .irq_dest_mode = 0, /* physical */
265 265
266 .target_cpus = uv_target_cpus, 266 .target_cpus = uv_target_cpus,
267 .disable_esr = 0, 267 .disable_esr = 0,
@@ -362,12 +362,6 @@ static __init void get_lowmem_redirect(unsigned long *base, unsigned long *size)
362 BUG(); 362 BUG();
363} 363}
364 364
365static __init void map_low_mmrs(void)
366{
367 init_extra_mapping_uc(UV_GLOBAL_MMR32_BASE, UV_GLOBAL_MMR32_SIZE);
368 init_extra_mapping_uc(UV_LOCAL_MMR_BASE, UV_LOCAL_MMR_SIZE);
369}
370
371enum map_type {map_wb, map_uc}; 365enum map_type {map_wb, map_uc};
372 366
373static __init void map_high(char *id, unsigned long base, int shift, 367static __init void map_high(char *id, unsigned long base, int shift,
@@ -395,26 +389,6 @@ static __init void map_gru_high(int max_pnode)
395 map_high("GRU", gru.s.base, shift, max_pnode, map_wb); 389 map_high("GRU", gru.s.base, shift, max_pnode, map_wb);
396} 390}
397 391
398static __init void map_config_high(int max_pnode)
399{
400 union uvh_rh_gam_cfg_overlay_config_mmr_u cfg;
401 int shift = UVH_RH_GAM_CFG_OVERLAY_CONFIG_MMR_BASE_SHFT;
402
403 cfg.v = uv_read_local_mmr(UVH_RH_GAM_CFG_OVERLAY_CONFIG_MMR);
404 if (cfg.s.enable)
405 map_high("CONFIG", cfg.s.base, shift, max_pnode, map_uc);
406}
407
408static __init void map_mmr_high(int max_pnode)
409{
410 union uvh_rh_gam_mmr_overlay_config_mmr_u mmr;
411 int shift = UVH_RH_GAM_MMR_OVERLAY_CONFIG_MMR_BASE_SHFT;
412
413 mmr.v = uv_read_local_mmr(UVH_RH_GAM_MMR_OVERLAY_CONFIG_MMR);
414 if (mmr.s.enable)
415 map_high("MMR", mmr.s.base, shift, max_pnode, map_uc);
416}
417
418static __init void map_mmioh_high(int max_pnode) 392static __init void map_mmioh_high(int max_pnode)
419{ 393{
420 union uvh_rh_gam_mmioh_overlay_config_mmr_u mmioh; 394 union uvh_rh_gam_mmioh_overlay_config_mmr_u mmioh;
@@ -566,8 +540,6 @@ void __init uv_system_init(void)
566 unsigned long mmr_base, present, paddr; 540 unsigned long mmr_base, present, paddr;
567 unsigned short pnode_mask; 541 unsigned short pnode_mask;
568 542
569 map_low_mmrs();
570
571 m_n_config.v = uv_read_local_mmr(UVH_SI_ADDR_MAP_CONFIG); 543 m_n_config.v = uv_read_local_mmr(UVH_SI_ADDR_MAP_CONFIG);
572 m_val = m_n_config.s.m_skt; 544 m_val = m_n_config.s.m_skt;
573 n_val = m_n_config.s.n_skt; 545 n_val = m_n_config.s.n_skt;
@@ -591,6 +563,8 @@ void __init uv_system_init(void)
591 bytes = sizeof(struct uv_blade_info) * uv_num_possible_blades(); 563 bytes = sizeof(struct uv_blade_info) * uv_num_possible_blades();
592 uv_blade_info = kmalloc(bytes, GFP_KERNEL); 564 uv_blade_info = kmalloc(bytes, GFP_KERNEL);
593 BUG_ON(!uv_blade_info); 565 BUG_ON(!uv_blade_info);
566 for (blade = 0; blade < uv_num_possible_blades(); blade++)
567 uv_blade_info[blade].memory_nid = -1;
594 568
595 get_lowmem_redirect(&lowmem_redir_base, &lowmem_redir_size); 569 get_lowmem_redirect(&lowmem_redir_base, &lowmem_redir_size);
596 570
@@ -629,6 +603,9 @@ void __init uv_system_init(void)
629 lcpu = uv_blade_info[blade].nr_possible_cpus; 603 lcpu = uv_blade_info[blade].nr_possible_cpus;
630 uv_blade_info[blade].nr_possible_cpus++; 604 uv_blade_info[blade].nr_possible_cpus++;
631 605
606 /* Any node on the blade, else will contain -1. */
607 uv_blade_info[blade].memory_nid = nid;
608
632 uv_cpu_hub_info(cpu)->lowmem_remap_base = lowmem_redir_base; 609 uv_cpu_hub_info(cpu)->lowmem_remap_base = lowmem_redir_base;
633 uv_cpu_hub_info(cpu)->lowmem_remap_top = lowmem_redir_size; 610 uv_cpu_hub_info(cpu)->lowmem_remap_top = lowmem_redir_size;
634 uv_cpu_hub_info(cpu)->m_val = m_val; 611 uv_cpu_hub_info(cpu)->m_val = m_val;
@@ -662,11 +639,10 @@ void __init uv_system_init(void)
662 pnode = (paddr >> m_val) & pnode_mask; 639 pnode = (paddr >> m_val) & pnode_mask;
663 blade = boot_pnode_to_blade(pnode); 640 blade = boot_pnode_to_blade(pnode);
664 uv_node_to_blade[nid] = blade; 641 uv_node_to_blade[nid] = blade;
642 max_pnode = max(pnode, max_pnode);
665 } 643 }
666 644
667 map_gru_high(max_pnode); 645 map_gru_high(max_pnode);
668 map_mmr_high(max_pnode);
669 map_config_high(max_pnode);
670 map_mmioh_high(max_pnode); 646 map_mmioh_high(max_pnode);
671 647
672 uv_cpu_init(); 648 uv_cpu_init();
diff --git a/arch/x86/kernel/apm_32.c b/arch/x86/kernel/apm_32.c
index 79302e9a33a4..442b5508893f 100644
--- a/arch/x86/kernel/apm_32.c
+++ b/arch/x86/kernel/apm_32.c
@@ -811,7 +811,7 @@ static int apm_do_idle(void)
811 u8 ret = 0; 811 u8 ret = 0;
812 int idled = 0; 812 int idled = 0;
813 int polling; 813 int polling;
814 int err; 814 int err = 0;
815 815
816 polling = !!(current_thread_info()->status & TS_POLLING); 816 polling = !!(current_thread_info()->status & TS_POLLING);
817 if (polling) { 817 if (polling) {
diff --git a/arch/x86/kernel/cpu/amd.c b/arch/x86/kernel/cpu/amd.c
index e5b27d8f1b47..e2485b03f1cf 100644
--- a/arch/x86/kernel/cpu/amd.c
+++ b/arch/x86/kernel/cpu/amd.c
@@ -258,13 +258,15 @@ static void __cpuinit amd_detect_cmp(struct cpuinfo_x86 *c)
258{ 258{
259#ifdef CONFIG_X86_HT 259#ifdef CONFIG_X86_HT
260 unsigned bits; 260 unsigned bits;
261 int cpu = smp_processor_id();
261 262
262 bits = c->x86_coreid_bits; 263 bits = c->x86_coreid_bits;
263
264 /* Low order bits define the core id (index of core in socket) */ 264 /* Low order bits define the core id (index of core in socket) */
265 c->cpu_core_id = c->initial_apicid & ((1 << bits)-1); 265 c->cpu_core_id = c->initial_apicid & ((1 << bits)-1);
266 /* Convert the initial APIC ID into the socket ID */ 266 /* Convert the initial APIC ID into the socket ID */
267 c->phys_proc_id = c->initial_apicid >> bits; 267 c->phys_proc_id = c->initial_apicid >> bits;
268 /* use socket ID also for last level cache */
269 per_cpu(cpu_llc_id, cpu) = c->phys_proc_id;
268#endif 270#endif
269} 271}
270 272
@@ -354,7 +356,7 @@ static void __cpuinit early_init_amd(struct cpuinfo_x86 *c)
354#endif 356#endif
355#if defined(CONFIG_X86_LOCAL_APIC) && defined(CONFIG_PCI) 357#if defined(CONFIG_X86_LOCAL_APIC) && defined(CONFIG_PCI)
356 /* check CPU config space for extended APIC ID */ 358 /* check CPU config space for extended APIC ID */
357 if (c->x86 >= 0xf) { 359 if (cpu_has_apic && c->x86 >= 0xf) {
358 unsigned int val; 360 unsigned int val;
359 val = read_pci_config(0, 24, 0, 0x68); 361 val = read_pci_config(0, 24, 0, 0x68);
360 if ((val & ((1 << 17) | (1 << 18))) == ((1 << 17) | (1 << 18))) 362 if ((val & ((1 << 17) | (1 << 18))) == ((1 << 17) | (1 << 18)))
diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c
index 6b26d4deada0..f1961c07af9a 100644
--- a/arch/x86/kernel/cpu/common.c
+++ b/arch/x86/kernel/cpu/common.c
@@ -848,9 +848,6 @@ static void __cpuinit identify_cpu(struct cpuinfo_x86 *c)
848#if defined(CONFIG_NUMA) && defined(CONFIG_X86_64) 848#if defined(CONFIG_NUMA) && defined(CONFIG_X86_64)
849 numa_add_cpu(smp_processor_id()); 849 numa_add_cpu(smp_processor_id());
850#endif 850#endif
851
852 /* Cap the iomem address space to what is addressable on all CPUs */
853 iomem_resource.end &= (1ULL << c->x86_phys_bits) - 1;
854} 851}
855 852
856#ifdef CONFIG_X86_64 853#ifdef CONFIG_X86_64
diff --git a/arch/x86/kernel/cpu/cpufreq/powernow-k8.c b/arch/x86/kernel/cpu/cpufreq/powernow-k8.c
index 81cbe64ed6b4..2a50ef891000 100644
--- a/arch/x86/kernel/cpu/cpufreq/powernow-k8.c
+++ b/arch/x86/kernel/cpu/cpufreq/powernow-k8.c
@@ -299,7 +299,7 @@ static int transition_pstate(struct powernow_k8_data *data, u32 pstate)
299static int transition_fid_vid(struct powernow_k8_data *data, 299static int transition_fid_vid(struct powernow_k8_data *data,
300 u32 reqfid, u32 reqvid) 300 u32 reqfid, u32 reqvid)
301{ 301{
302 if (core_voltage_pre_transition(data, reqvid)) 302 if (core_voltage_pre_transition(data, reqvid, reqfid))
303 return 1; 303 return 1;
304 304
305 if (core_frequency_transition(data, reqfid)) 305 if (core_frequency_transition(data, reqfid))
@@ -327,17 +327,20 @@ static int transition_fid_vid(struct powernow_k8_data *data,
327 327
328/* Phase 1 - core voltage transition ... setup voltage */ 328/* Phase 1 - core voltage transition ... setup voltage */
329static int core_voltage_pre_transition(struct powernow_k8_data *data, 329static int core_voltage_pre_transition(struct powernow_k8_data *data,
330 u32 reqvid) 330 u32 reqvid, u32 reqfid)
331{ 331{
332 u32 rvosteps = data->rvo; 332 u32 rvosteps = data->rvo;
333 u32 savefid = data->currfid; 333 u32 savefid = data->currfid;
334 u32 maxvid, lo; 334 u32 maxvid, lo, rvomult = 1;
335 335
336 dprintk("ph1 (cpu%d): start, currfid 0x%x, currvid 0x%x, " 336 dprintk("ph1 (cpu%d): start, currfid 0x%x, currvid 0x%x, "
337 "reqvid 0x%x, rvo 0x%x\n", 337 "reqvid 0x%x, rvo 0x%x\n",
338 smp_processor_id(), 338 smp_processor_id(),
339 data->currfid, data->currvid, reqvid, data->rvo); 339 data->currfid, data->currvid, reqvid, data->rvo);
340 340
341 if ((savefid < LO_FID_TABLE_TOP) && (reqfid < LO_FID_TABLE_TOP))
342 rvomult = 2;
343 rvosteps *= rvomult;
341 rdmsr(MSR_FIDVID_STATUS, lo, maxvid); 344 rdmsr(MSR_FIDVID_STATUS, lo, maxvid);
342 maxvid = 0x1f & (maxvid >> 16); 345 maxvid = 0x1f & (maxvid >> 16);
343 dprintk("ph1 maxvid=0x%x\n", maxvid); 346 dprintk("ph1 maxvid=0x%x\n", maxvid);
@@ -351,7 +354,8 @@ static int core_voltage_pre_transition(struct powernow_k8_data *data,
351 return 1; 354 return 1;
352 } 355 }
353 356
354 while ((rvosteps > 0) && ((data->rvo + data->currvid) > reqvid)) { 357 while ((rvosteps > 0) &&
358 ((rvomult * data->rvo + data->currvid) > reqvid)) {
355 if (data->currvid == maxvid) { 359 if (data->currvid == maxvid) {
356 rvosteps = 0; 360 rvosteps = 0;
357 } else { 361 } else {
@@ -384,13 +388,6 @@ static int core_frequency_transition(struct powernow_k8_data *data, u32 reqfid)
384 u32 vcoreqfid, vcocurrfid, vcofiddiff; 388 u32 vcoreqfid, vcocurrfid, vcofiddiff;
385 u32 fid_interval, savevid = data->currvid; 389 u32 fid_interval, savevid = data->currvid;
386 390
387 if ((reqfid < HI_FID_TABLE_BOTTOM) &&
388 (data->currfid < HI_FID_TABLE_BOTTOM)) {
389 printk(KERN_ERR PFX "ph2: illegal lo-lo transition "
390 "0x%x 0x%x\n", reqfid, data->currfid);
391 return 1;
392 }
393
394 if (data->currfid == reqfid) { 391 if (data->currfid == reqfid) {
395 printk(KERN_ERR PFX "ph2 null fid transition 0x%x\n", 392 printk(KERN_ERR PFX "ph2 null fid transition 0x%x\n",
396 data->currfid); 393 data->currfid);
@@ -407,6 +404,9 @@ static int core_frequency_transition(struct powernow_k8_data *data, u32 reqfid)
407 vcofiddiff = vcocurrfid > vcoreqfid ? vcocurrfid - vcoreqfid 404 vcofiddiff = vcocurrfid > vcoreqfid ? vcocurrfid - vcoreqfid
408 : vcoreqfid - vcocurrfid; 405 : vcoreqfid - vcocurrfid;
409 406
407 if ((reqfid <= LO_FID_TABLE_TOP) && (data->currfid <= LO_FID_TABLE_TOP))
408 vcofiddiff = 0;
409
410 while (vcofiddiff > 2) { 410 while (vcofiddiff > 2) {
411 (data->currfid & 1) ? (fid_interval = 1) : (fid_interval = 2); 411 (data->currfid & 1) ? (fid_interval = 1) : (fid_interval = 2);
412 412
@@ -1081,14 +1081,6 @@ static int transition_frequency_fidvid(struct powernow_k8_data *data,
1081 return 0; 1081 return 0;
1082 } 1082 }
1083 1083
1084 if ((fid < HI_FID_TABLE_BOTTOM) &&
1085 (data->currfid < HI_FID_TABLE_BOTTOM)) {
1086 printk(KERN_ERR PFX
1087 "ignoring illegal change in lo freq table-%x to 0x%x\n",
1088 data->currfid, fid);
1089 return 1;
1090 }
1091
1092 dprintk("cpu %d, changing to fid 0x%x, vid 0x%x\n", 1084 dprintk("cpu %d, changing to fid 0x%x, vid 0x%x\n",
1093 smp_processor_id(), fid, vid); 1085 smp_processor_id(), fid, vid);
1094 freqs.old = find_khz_freq_from_fid(data->currfid); 1086 freqs.old = find_khz_freq_from_fid(data->currfid);
@@ -1267,7 +1259,7 @@ static int __cpuinit powernowk8_cpu_init(struct cpufreq_policy *pol)
1267{ 1259{
1268 static const char ACPI_PSS_BIOS_BUG_MSG[] = 1260 static const char ACPI_PSS_BIOS_BUG_MSG[] =
1269 KERN_ERR FW_BUG PFX "No compatible ACPI _PSS objects found.\n" 1261 KERN_ERR FW_BUG PFX "No compatible ACPI _PSS objects found.\n"
1270 KERN_ERR FW_BUG PFX "Try again with latest BIOS.\n"; 1262 FW_BUG PFX "Try again with latest BIOS.\n";
1271 struct powernow_k8_data *data; 1263 struct powernow_k8_data *data;
1272 struct init_on_cpu init_on_cpu; 1264 struct init_on_cpu init_on_cpu;
1273 int rc; 1265 int rc;
diff --git a/arch/x86/kernel/cpu/cpufreq/powernow-k8.h b/arch/x86/kernel/cpu/cpufreq/powernow-k8.h
index c9c1190b5e1f..02ce824073cb 100644
--- a/arch/x86/kernel/cpu/cpufreq/powernow-k8.h
+++ b/arch/x86/kernel/cpu/cpufreq/powernow-k8.h
@@ -215,7 +215,8 @@ struct pst_s {
215 215
216#define dprintk(msg...) cpufreq_debug_printk(CPUFREQ_DEBUG_DRIVER, "powernow-k8", msg) 216#define dprintk(msg...) cpufreq_debug_printk(CPUFREQ_DEBUG_DRIVER, "powernow-k8", msg)
217 217
218static int core_voltage_pre_transition(struct powernow_k8_data *data, u32 reqvid); 218static int core_voltage_pre_transition(struct powernow_k8_data *data,
219 u32 reqvid, u32 regfid);
219static int core_voltage_post_transition(struct powernow_k8_data *data, u32 reqvid); 220static int core_voltage_post_transition(struct powernow_k8_data *data, u32 reqvid);
220static int core_frequency_transition(struct powernow_k8_data *data, u32 reqfid); 221static int core_frequency_transition(struct powernow_k8_data *data, u32 reqfid);
221 222
diff --git a/arch/x86/kernel/cpu/mcheck/mce.c b/arch/x86/kernel/cpu/mcheck/mce.c
index 284d1de968bc..1cfb623ce11c 100644
--- a/arch/x86/kernel/cpu/mcheck/mce.c
+++ b/arch/x86/kernel/cpu/mcheck/mce.c
@@ -194,14 +194,14 @@ static void print_mce(struct mce *m)
194 m->cs, m->ip); 194 m->cs, m->ip);
195 if (m->cs == __KERNEL_CS) 195 if (m->cs == __KERNEL_CS)
196 print_symbol("{%s}", m->ip); 196 print_symbol("{%s}", m->ip);
197 printk("\n"); 197 printk(KERN_CONT "\n");
198 } 198 }
199 printk(KERN_EMERG "TSC %llx ", m->tsc); 199 printk(KERN_EMERG "TSC %llx ", m->tsc);
200 if (m->addr) 200 if (m->addr)
201 printk("ADDR %llx ", m->addr); 201 printk(KERN_CONT "ADDR %llx ", m->addr);
202 if (m->misc) 202 if (m->misc)
203 printk("MISC %llx ", m->misc); 203 printk(KERN_CONT "MISC %llx ", m->misc);
204 printk("\n"); 204 printk(KERN_CONT "\n");
205 printk(KERN_EMERG "PROCESSOR %u:%x TIME %llu SOCKET %u APIC %x\n", 205 printk(KERN_EMERG "PROCESSOR %u:%x TIME %llu SOCKET %u APIC %x\n",
206 m->cpuvendor, m->cpuid, m->time, m->socketid, 206 m->cpuvendor, m->cpuid, m->time, m->socketid,
207 m->apicid); 207 m->apicid);
@@ -209,13 +209,13 @@ static void print_mce(struct mce *m)
209 209
210static void print_mce_head(void) 210static void print_mce_head(void)
211{ 211{
212 printk(KERN_EMERG "\n" KERN_EMERG "HARDWARE ERROR\n"); 212 printk(KERN_EMERG "\nHARDWARE ERROR\n");
213} 213}
214 214
215static void print_mce_tail(void) 215static void print_mce_tail(void)
216{ 216{
217 printk(KERN_EMERG "This is not a software problem!\n" 217 printk(KERN_EMERG "This is not a software problem!\n"
218 KERN_EMERG "Run through mcelog --ascii to decode and contact your hardware vendor\n"); 218 "Run through mcelog --ascii to decode and contact your hardware vendor\n");
219} 219}
220 220
221#define PANIC_TIMEOUT 5 /* 5 seconds */ 221#define PANIC_TIMEOUT 5 /* 5 seconds */
@@ -1117,7 +1117,7 @@ static void mcheck_timer(unsigned long data)
1117 *n = min(*n*2, (int)round_jiffies_relative(check_interval*HZ)); 1117 *n = min(*n*2, (int)round_jiffies_relative(check_interval*HZ));
1118 1118
1119 t->expires = jiffies + *n; 1119 t->expires = jiffies + *n;
1120 add_timer(t); 1120 add_timer_on(t, smp_processor_id());
1121} 1121}
1122 1122
1123static void mce_do_trigger(struct work_struct *work) 1123static void mce_do_trigger(struct work_struct *work)
@@ -1321,7 +1321,7 @@ static void mce_init_timer(void)
1321 return; 1321 return;
1322 setup_timer(t, mcheck_timer, smp_processor_id()); 1322 setup_timer(t, mcheck_timer, smp_processor_id());
1323 t->expires = round_jiffies(jiffies + *n); 1323 t->expires = round_jiffies(jiffies + *n);
1324 add_timer(t); 1324 add_timer_on(t, smp_processor_id());
1325} 1325}
1326 1326
1327/* 1327/*
@@ -1692,17 +1692,15 @@ static ssize_t set_trigger(struct sys_device *s, struct sysdev_attribute *attr,
1692 const char *buf, size_t siz) 1692 const char *buf, size_t siz)
1693{ 1693{
1694 char *p; 1694 char *p;
1695 int len;
1696 1695
1697 strncpy(mce_helper, buf, sizeof(mce_helper)); 1696 strncpy(mce_helper, buf, sizeof(mce_helper));
1698 mce_helper[sizeof(mce_helper)-1] = 0; 1697 mce_helper[sizeof(mce_helper)-1] = 0;
1699 len = strlen(mce_helper);
1700 p = strchr(mce_helper, '\n'); 1698 p = strchr(mce_helper, '\n');
1701 1699
1702 if (*p) 1700 if (p)
1703 *p = 0; 1701 *p = 0;
1704 1702
1705 return len; 1703 return strlen(mce_helper) + !!p;
1706} 1704}
1707 1705
1708static ssize_t set_ignore_ce(struct sys_device *s, 1706static ssize_t set_ignore_ce(struct sys_device *s,
diff --git a/arch/x86/kernel/cpu/perf_counter.c b/arch/x86/kernel/cpu/perf_counter.c
index 76dfef23f789..a7aa8f900954 100644
--- a/arch/x86/kernel/cpu/perf_counter.c
+++ b/arch/x86/kernel/cpu/perf_counter.c
@@ -66,6 +66,52 @@ static DEFINE_PER_CPU(struct cpu_hw_counters, cpu_hw_counters) = {
66}; 66};
67 67
68/* 68/*
69 * Not sure about some of these
70 */
71static const u64 p6_perfmon_event_map[] =
72{
73 [PERF_COUNT_HW_CPU_CYCLES] = 0x0079,
74 [PERF_COUNT_HW_INSTRUCTIONS] = 0x00c0,
75 [PERF_COUNT_HW_CACHE_REFERENCES] = 0x0000,
76 [PERF_COUNT_HW_CACHE_MISSES] = 0x0000,
77 [PERF_COUNT_HW_BRANCH_INSTRUCTIONS] = 0x00c4,
78 [PERF_COUNT_HW_BRANCH_MISSES] = 0x00c5,
79 [PERF_COUNT_HW_BUS_CYCLES] = 0x0062,
80};
81
82static u64 p6_pmu_event_map(int event)
83{
84 return p6_perfmon_event_map[event];
85}
86
87/*
88 * Counter setting that is specified not to count anything.
89 * We use this to effectively disable a counter.
90 *
91 * L2_RQSTS with 0 MESI unit mask.
92 */
93#define P6_NOP_COUNTER 0x0000002EULL
94
95static u64 p6_pmu_raw_event(u64 event)
96{
97#define P6_EVNTSEL_EVENT_MASK 0x000000FFULL
98#define P6_EVNTSEL_UNIT_MASK 0x0000FF00ULL
99#define P6_EVNTSEL_EDGE_MASK 0x00040000ULL
100#define P6_EVNTSEL_INV_MASK 0x00800000ULL
101#define P6_EVNTSEL_COUNTER_MASK 0xFF000000ULL
102
103#define P6_EVNTSEL_MASK \
104 (P6_EVNTSEL_EVENT_MASK | \
105 P6_EVNTSEL_UNIT_MASK | \
106 P6_EVNTSEL_EDGE_MASK | \
107 P6_EVNTSEL_INV_MASK | \
108 P6_EVNTSEL_COUNTER_MASK)
109
110 return event & P6_EVNTSEL_MASK;
111}
112
113
114/*
69 * Intel PerfMon v3. Used on Core2 and later. 115 * Intel PerfMon v3. Used on Core2 and later.
70 */ 116 */
71static const u64 intel_perfmon_event_map[] = 117static const u64 intel_perfmon_event_map[] =
@@ -401,7 +447,7 @@ static const u64 amd_hw_cache_event_ids
401 [ C(RESULT_MISS) ] = 0x0041, /* Data Cache Misses */ 447 [ C(RESULT_MISS) ] = 0x0041, /* Data Cache Misses */
402 }, 448 },
403 [ C(OP_WRITE) ] = { 449 [ C(OP_WRITE) ] = {
404 [ C(RESULT_ACCESS) ] = 0x0042, /* Data Cache Refills from L2 */ 450 [ C(RESULT_ACCESS) ] = 0x0142, /* Data Cache Refills :system */
405 [ C(RESULT_MISS) ] = 0, 451 [ C(RESULT_MISS) ] = 0,
406 }, 452 },
407 [ C(OP_PREFETCH) ] = { 453 [ C(OP_PREFETCH) ] = {
@@ -666,6 +712,7 @@ static int __hw_perf_counter_init(struct perf_counter *counter)
666{ 712{
667 struct perf_counter_attr *attr = &counter->attr; 713 struct perf_counter_attr *attr = &counter->attr;
668 struct hw_perf_counter *hwc = &counter->hw; 714 struct hw_perf_counter *hwc = &counter->hw;
715 u64 config;
669 int err; 716 int err;
670 717
671 if (!x86_pmu_initialized()) 718 if (!x86_pmu_initialized())
@@ -718,14 +765,40 @@ static int __hw_perf_counter_init(struct perf_counter *counter)
718 765
719 if (attr->config >= x86_pmu.max_events) 766 if (attr->config >= x86_pmu.max_events)
720 return -EINVAL; 767 return -EINVAL;
768
721 /* 769 /*
722 * The generic map: 770 * The generic map:
723 */ 771 */
724 hwc->config |= x86_pmu.event_map(attr->config); 772 config = x86_pmu.event_map(attr->config);
773
774 if (config == 0)
775 return -ENOENT;
776
777 if (config == -1LL)
778 return -EINVAL;
779
780 hwc->config |= config;
725 781
726 return 0; 782 return 0;
727} 783}
728 784
785static void p6_pmu_disable_all(void)
786{
787 struct cpu_hw_counters *cpuc = &__get_cpu_var(cpu_hw_counters);
788 u64 val;
789
790 if (!cpuc->enabled)
791 return;
792
793 cpuc->enabled = 0;
794 barrier();
795
796 /* p6 only has one enable register */
797 rdmsrl(MSR_P6_EVNTSEL0, val);
798 val &= ~ARCH_PERFMON_EVENTSEL0_ENABLE;
799 wrmsrl(MSR_P6_EVNTSEL0, val);
800}
801
729static void intel_pmu_disable_all(void) 802static void intel_pmu_disable_all(void)
730{ 803{
731 wrmsrl(MSR_CORE_PERF_GLOBAL_CTRL, 0); 804 wrmsrl(MSR_CORE_PERF_GLOBAL_CTRL, 0);
@@ -767,6 +840,23 @@ void hw_perf_disable(void)
767 return x86_pmu.disable_all(); 840 return x86_pmu.disable_all();
768} 841}
769 842
843static void p6_pmu_enable_all(void)
844{
845 struct cpu_hw_counters *cpuc = &__get_cpu_var(cpu_hw_counters);
846 unsigned long val;
847
848 if (cpuc->enabled)
849 return;
850
851 cpuc->enabled = 1;
852 barrier();
853
854 /* p6 only has one enable register */
855 rdmsrl(MSR_P6_EVNTSEL0, val);
856 val |= ARCH_PERFMON_EVENTSEL0_ENABLE;
857 wrmsrl(MSR_P6_EVNTSEL0, val);
858}
859
770static void intel_pmu_enable_all(void) 860static void intel_pmu_enable_all(void)
771{ 861{
772 wrmsrl(MSR_CORE_PERF_GLOBAL_CTRL, x86_pmu.intel_ctrl); 862 wrmsrl(MSR_CORE_PERF_GLOBAL_CTRL, x86_pmu.intel_ctrl);
@@ -784,13 +874,13 @@ static void amd_pmu_enable_all(void)
784 barrier(); 874 barrier();
785 875
786 for (idx = 0; idx < x86_pmu.num_counters; idx++) { 876 for (idx = 0; idx < x86_pmu.num_counters; idx++) {
877 struct perf_counter *counter = cpuc->counters[idx];
787 u64 val; 878 u64 val;
788 879
789 if (!test_bit(idx, cpuc->active_mask)) 880 if (!test_bit(idx, cpuc->active_mask))
790 continue; 881 continue;
791 rdmsrl(MSR_K7_EVNTSEL0 + idx, val); 882
792 if (val & ARCH_PERFMON_EVENTSEL0_ENABLE) 883 val = counter->hw.config;
793 continue;
794 val |= ARCH_PERFMON_EVENTSEL0_ENABLE; 884 val |= ARCH_PERFMON_EVENTSEL0_ENABLE;
795 wrmsrl(MSR_K7_EVNTSEL0 + idx, val); 885 wrmsrl(MSR_K7_EVNTSEL0 + idx, val);
796 } 886 }
@@ -819,16 +909,13 @@ static inline void intel_pmu_ack_status(u64 ack)
819 909
820static inline void x86_pmu_enable_counter(struct hw_perf_counter *hwc, int idx) 910static inline void x86_pmu_enable_counter(struct hw_perf_counter *hwc, int idx)
821{ 911{
822 int err; 912 (void)checking_wrmsrl(hwc->config_base + idx,
823 err = checking_wrmsrl(hwc->config_base + idx,
824 hwc->config | ARCH_PERFMON_EVENTSEL0_ENABLE); 913 hwc->config | ARCH_PERFMON_EVENTSEL0_ENABLE);
825} 914}
826 915
827static inline void x86_pmu_disable_counter(struct hw_perf_counter *hwc, int idx) 916static inline void x86_pmu_disable_counter(struct hw_perf_counter *hwc, int idx)
828{ 917{
829 int err; 918 (void)checking_wrmsrl(hwc->config_base + idx, hwc->config);
830 err = checking_wrmsrl(hwc->config_base + idx,
831 hwc->config);
832} 919}
833 920
834static inline void 921static inline void
@@ -836,13 +923,24 @@ intel_pmu_disable_fixed(struct hw_perf_counter *hwc, int __idx)
836{ 923{
837 int idx = __idx - X86_PMC_IDX_FIXED; 924 int idx = __idx - X86_PMC_IDX_FIXED;
838 u64 ctrl_val, mask; 925 u64 ctrl_val, mask;
839 int err;
840 926
841 mask = 0xfULL << (idx * 4); 927 mask = 0xfULL << (idx * 4);
842 928
843 rdmsrl(hwc->config_base, ctrl_val); 929 rdmsrl(hwc->config_base, ctrl_val);
844 ctrl_val &= ~mask; 930 ctrl_val &= ~mask;
845 err = checking_wrmsrl(hwc->config_base, ctrl_val); 931 (void)checking_wrmsrl(hwc->config_base, ctrl_val);
932}
933
934static inline void
935p6_pmu_disable_counter(struct hw_perf_counter *hwc, int idx)
936{
937 struct cpu_hw_counters *cpuc = &__get_cpu_var(cpu_hw_counters);
938 u64 val = P6_NOP_COUNTER;
939
940 if (cpuc->enabled)
941 val |= ARCH_PERFMON_EVENTSEL0_ENABLE;
942
943 (void)checking_wrmsrl(hwc->config_base + idx, val);
846} 944}
847 945
848static inline void 946static inline void
@@ -912,6 +1010,8 @@ x86_perf_counter_set_period(struct perf_counter *counter,
912 err = checking_wrmsrl(hwc->counter_base + idx, 1010 err = checking_wrmsrl(hwc->counter_base + idx,
913 (u64)(-left) & x86_pmu.counter_mask); 1011 (u64)(-left) & x86_pmu.counter_mask);
914 1012
1013 perf_counter_update_userpage(counter);
1014
915 return ret; 1015 return ret;
916} 1016}
917 1017
@@ -941,6 +1041,19 @@ intel_pmu_enable_fixed(struct hw_perf_counter *hwc, int __idx)
941 err = checking_wrmsrl(hwc->config_base, ctrl_val); 1041 err = checking_wrmsrl(hwc->config_base, ctrl_val);
942} 1042}
943 1043
1044static void p6_pmu_enable_counter(struct hw_perf_counter *hwc, int idx)
1045{
1046 struct cpu_hw_counters *cpuc = &__get_cpu_var(cpu_hw_counters);
1047 u64 val;
1048
1049 val = hwc->config;
1050 if (cpuc->enabled)
1051 val |= ARCH_PERFMON_EVENTSEL0_ENABLE;
1052
1053 (void)checking_wrmsrl(hwc->config_base + idx, val);
1054}
1055
1056
944static void intel_pmu_enable_counter(struct hw_perf_counter *hwc, int idx) 1057static void intel_pmu_enable_counter(struct hw_perf_counter *hwc, int idx)
945{ 1058{
946 if (unlikely(hwc->config_base == MSR_ARCH_PERFMON_FIXED_CTR_CTRL)) { 1059 if (unlikely(hwc->config_base == MSR_ARCH_PERFMON_FIXED_CTR_CTRL)) {
@@ -957,8 +1070,6 @@ static void amd_pmu_enable_counter(struct hw_perf_counter *hwc, int idx)
957 1070
958 if (cpuc->enabled) 1071 if (cpuc->enabled)
959 x86_pmu_enable_counter(hwc, idx); 1072 x86_pmu_enable_counter(hwc, idx);
960 else
961 x86_pmu_disable_counter(hwc, idx);
962} 1073}
963 1074
964static int 1075static int
@@ -969,13 +1080,6 @@ fixed_mode_idx(struct perf_counter *counter, struct hw_perf_counter *hwc)
969 if (!x86_pmu.num_counters_fixed) 1080 if (!x86_pmu.num_counters_fixed)
970 return -1; 1081 return -1;
971 1082
972 /*
973 * Quirk, IA32_FIXED_CTRs do not work on current Atom processors:
974 */
975 if (boot_cpu_data.x86_vendor == X86_VENDOR_INTEL &&
976 boot_cpu_data.x86_model == 28)
977 return -1;
978
979 event = hwc->config & ARCH_PERFMON_EVENT_MASK; 1083 event = hwc->config & ARCH_PERFMON_EVENT_MASK;
980 1084
981 if (unlikely(event == x86_pmu.event_map(PERF_COUNT_HW_INSTRUCTIONS))) 1085 if (unlikely(event == x86_pmu.event_map(PERF_COUNT_HW_INSTRUCTIONS)))
@@ -1041,6 +1145,8 @@ try_generic:
1041 x86_perf_counter_set_period(counter, hwc, idx); 1145 x86_perf_counter_set_period(counter, hwc, idx);
1042 x86_pmu.enable(hwc, idx); 1146 x86_pmu.enable(hwc, idx);
1043 1147
1148 perf_counter_update_userpage(counter);
1149
1044 return 0; 1150 return 0;
1045} 1151}
1046 1152
@@ -1133,6 +1239,8 @@ static void x86_pmu_disable(struct perf_counter *counter)
1133 x86_perf_counter_update(counter, hwc, idx); 1239 x86_perf_counter_update(counter, hwc, idx);
1134 cpuc->counters[idx] = NULL; 1240 cpuc->counters[idx] = NULL;
1135 clear_bit(idx, cpuc->used_mask); 1241 clear_bit(idx, cpuc->used_mask);
1242
1243 perf_counter_update_userpage(counter);
1136} 1244}
1137 1245
1138/* 1246/*
@@ -1177,6 +1285,49 @@ static void intel_pmu_reset(void)
1177 local_irq_restore(flags); 1285 local_irq_restore(flags);
1178} 1286}
1179 1287
1288static int p6_pmu_handle_irq(struct pt_regs *regs)
1289{
1290 struct perf_sample_data data;
1291 struct cpu_hw_counters *cpuc;
1292 struct perf_counter *counter;
1293 struct hw_perf_counter *hwc;
1294 int idx, handled = 0;
1295 u64 val;
1296
1297 data.regs = regs;
1298 data.addr = 0;
1299
1300 cpuc = &__get_cpu_var(cpu_hw_counters);
1301
1302 for (idx = 0; idx < x86_pmu.num_counters; idx++) {
1303 if (!test_bit(idx, cpuc->active_mask))
1304 continue;
1305
1306 counter = cpuc->counters[idx];
1307 hwc = &counter->hw;
1308
1309 val = x86_perf_counter_update(counter, hwc, idx);
1310 if (val & (1ULL << (x86_pmu.counter_bits - 1)))
1311 continue;
1312
1313 /*
1314 * counter overflow
1315 */
1316 handled = 1;
1317 data.period = counter->hw.last_period;
1318
1319 if (!x86_perf_counter_set_period(counter, hwc, idx))
1320 continue;
1321
1322 if (perf_counter_overflow(counter, 1, &data))
1323 p6_pmu_disable_counter(hwc, idx);
1324 }
1325
1326 if (handled)
1327 inc_irq_stat(apic_perf_irqs);
1328
1329 return handled;
1330}
1180 1331
1181/* 1332/*
1182 * This handler is triggered by the local APIC, so the APIC IRQ handling 1333 * This handler is triggered by the local APIC, so the APIC IRQ handling
@@ -1186,14 +1337,13 @@ static int intel_pmu_handle_irq(struct pt_regs *regs)
1186{ 1337{
1187 struct perf_sample_data data; 1338 struct perf_sample_data data;
1188 struct cpu_hw_counters *cpuc; 1339 struct cpu_hw_counters *cpuc;
1189 int bit, cpu, loops; 1340 int bit, loops;
1190 u64 ack, status; 1341 u64 ack, status;
1191 1342
1192 data.regs = regs; 1343 data.regs = regs;
1193 data.addr = 0; 1344 data.addr = 0;
1194 1345
1195 cpu = smp_processor_id(); 1346 cpuc = &__get_cpu_var(cpu_hw_counters);
1196 cpuc = &per_cpu(cpu_hw_counters, cpu);
1197 1347
1198 perf_disable(); 1348 perf_disable();
1199 status = intel_pmu_get_status(); 1349 status = intel_pmu_get_status();
@@ -1250,14 +1400,13 @@ static int amd_pmu_handle_irq(struct pt_regs *regs)
1250 struct cpu_hw_counters *cpuc; 1400 struct cpu_hw_counters *cpuc;
1251 struct perf_counter *counter; 1401 struct perf_counter *counter;
1252 struct hw_perf_counter *hwc; 1402 struct hw_perf_counter *hwc;
1253 int cpu, idx, handled = 0; 1403 int idx, handled = 0;
1254 u64 val; 1404 u64 val;
1255 1405
1256 data.regs = regs; 1406 data.regs = regs;
1257 data.addr = 0; 1407 data.addr = 0;
1258 1408
1259 cpu = smp_processor_id(); 1409 cpuc = &__get_cpu_var(cpu_hw_counters);
1260 cpuc = &per_cpu(cpu_hw_counters, cpu);
1261 1410
1262 for (idx = 0; idx < x86_pmu.num_counters; idx++) { 1411 for (idx = 0; idx < x86_pmu.num_counters; idx++) {
1263 if (!test_bit(idx, cpuc->active_mask)) 1412 if (!test_bit(idx, cpuc->active_mask))
@@ -1354,6 +1503,32 @@ static __read_mostly struct notifier_block perf_counter_nmi_notifier = {
1354 .priority = 1 1503 .priority = 1
1355}; 1504};
1356 1505
1506static struct x86_pmu p6_pmu = {
1507 .name = "p6",
1508 .handle_irq = p6_pmu_handle_irq,
1509 .disable_all = p6_pmu_disable_all,
1510 .enable_all = p6_pmu_enable_all,
1511 .enable = p6_pmu_enable_counter,
1512 .disable = p6_pmu_disable_counter,
1513 .eventsel = MSR_P6_EVNTSEL0,
1514 .perfctr = MSR_P6_PERFCTR0,
1515 .event_map = p6_pmu_event_map,
1516 .raw_event = p6_pmu_raw_event,
1517 .max_events = ARRAY_SIZE(p6_perfmon_event_map),
1518 .max_period = (1ULL << 31) - 1,
1519 .version = 0,
1520 .num_counters = 2,
1521 /*
1522 * Counters have 40 bits implemented. However they are designed such
1523 * that bits [32-39] are sign extensions of bit 31. As such the
1524 * effective width of a counter for P6-like PMU is 32 bits only.
1525 *
1526 * See IA-32 Intel Architecture Software developer manual Vol 3B
1527 */
1528 .counter_bits = 32,
1529 .counter_mask = (1ULL << 32) - 1,
1530};
1531
1357static struct x86_pmu intel_pmu = { 1532static struct x86_pmu intel_pmu = {
1358 .name = "Intel", 1533 .name = "Intel",
1359 .handle_irq = intel_pmu_handle_irq, 1534 .handle_irq = intel_pmu_handle_irq,
@@ -1393,6 +1568,37 @@ static struct x86_pmu amd_pmu = {
1393 .max_period = (1ULL << 47) - 1, 1568 .max_period = (1ULL << 47) - 1,
1394}; 1569};
1395 1570
1571static int p6_pmu_init(void)
1572{
1573 switch (boot_cpu_data.x86_model) {
1574 case 1:
1575 case 3: /* Pentium Pro */
1576 case 5:
1577 case 6: /* Pentium II */
1578 case 7:
1579 case 8:
1580 case 11: /* Pentium III */
1581 break;
1582 case 9:
1583 case 13:
1584 /* Pentium M */
1585 break;
1586 default:
1587 pr_cont("unsupported p6 CPU model %d ",
1588 boot_cpu_data.x86_model);
1589 return -ENODEV;
1590 }
1591
1592 if (!cpu_has_apic) {
1593 pr_info("no Local APIC, try rebooting with lapic");
1594 return -ENODEV;
1595 }
1596
1597 x86_pmu = p6_pmu;
1598
1599 return 0;
1600}
1601
1396static int intel_pmu_init(void) 1602static int intel_pmu_init(void)
1397{ 1603{
1398 union cpuid10_edx edx; 1604 union cpuid10_edx edx;
@@ -1401,8 +1607,14 @@ static int intel_pmu_init(void)
1401 unsigned int ebx; 1607 unsigned int ebx;
1402 int version; 1608 int version;
1403 1609
1404 if (!cpu_has(&boot_cpu_data, X86_FEATURE_ARCH_PERFMON)) 1610 if (!cpu_has(&boot_cpu_data, X86_FEATURE_ARCH_PERFMON)) {
1611 /* check for P6 processor family */
1612 if (boot_cpu_data.x86 == 6) {
1613 return p6_pmu_init();
1614 } else {
1405 return -ENODEV; 1615 return -ENODEV;
1616 }
1617 }
1406 1618
1407 /* 1619 /*
1408 * Check whether the Architectural PerfMon supports 1620 * Check whether the Architectural PerfMon supports
@@ -1428,8 +1640,6 @@ static int intel_pmu_init(void)
1428 */ 1640 */
1429 x86_pmu.num_counters_fixed = max((int)edx.split.num_counters_fixed, 3); 1641 x86_pmu.num_counters_fixed = max((int)edx.split.num_counters_fixed, 3);
1430 1642
1431 rdmsrl(MSR_CORE_PERF_GLOBAL_CTRL, x86_pmu.intel_ctrl);
1432
1433 /* 1643 /*
1434 * Install the hw-cache-events table: 1644 * Install the hw-cache-events table:
1435 */ 1645 */
@@ -1499,21 +1709,22 @@ void __init init_hw_perf_counters(void)
1499 pr_cont("%s PMU driver.\n", x86_pmu.name); 1709 pr_cont("%s PMU driver.\n", x86_pmu.name);
1500 1710
1501 if (x86_pmu.num_counters > X86_PMC_MAX_GENERIC) { 1711 if (x86_pmu.num_counters > X86_PMC_MAX_GENERIC) {
1502 x86_pmu.num_counters = X86_PMC_MAX_GENERIC;
1503 WARN(1, KERN_ERR "hw perf counters %d > max(%d), clipping!", 1712 WARN(1, KERN_ERR "hw perf counters %d > max(%d), clipping!",
1504 x86_pmu.num_counters, X86_PMC_MAX_GENERIC); 1713 x86_pmu.num_counters, X86_PMC_MAX_GENERIC);
1714 x86_pmu.num_counters = X86_PMC_MAX_GENERIC;
1505 } 1715 }
1506 perf_counter_mask = (1 << x86_pmu.num_counters) - 1; 1716 perf_counter_mask = (1 << x86_pmu.num_counters) - 1;
1507 perf_max_counters = x86_pmu.num_counters; 1717 perf_max_counters = x86_pmu.num_counters;
1508 1718
1509 if (x86_pmu.num_counters_fixed > X86_PMC_MAX_FIXED) { 1719 if (x86_pmu.num_counters_fixed > X86_PMC_MAX_FIXED) {
1510 x86_pmu.num_counters_fixed = X86_PMC_MAX_FIXED;
1511 WARN(1, KERN_ERR "hw perf counters fixed %d > max(%d), clipping!", 1720 WARN(1, KERN_ERR "hw perf counters fixed %d > max(%d), clipping!",
1512 x86_pmu.num_counters_fixed, X86_PMC_MAX_FIXED); 1721 x86_pmu.num_counters_fixed, X86_PMC_MAX_FIXED);
1722 x86_pmu.num_counters_fixed = X86_PMC_MAX_FIXED;
1513 } 1723 }
1514 1724
1515 perf_counter_mask |= 1725 perf_counter_mask |=
1516 ((1LL << x86_pmu.num_counters_fixed)-1) << X86_PMC_IDX_FIXED; 1726 ((1LL << x86_pmu.num_counters_fixed)-1) << X86_PMC_IDX_FIXED;
1727 x86_pmu.intel_ctrl = perf_counter_mask;
1517 1728
1518 perf_counters_lapic_init(); 1729 perf_counters_lapic_init();
1519 register_die_notifier(&perf_counter_nmi_notifier); 1730 register_die_notifier(&perf_counter_nmi_notifier);
@@ -1563,6 +1774,7 @@ void callchain_store(struct perf_callchain_entry *entry, u64 ip)
1563 1774
1564static DEFINE_PER_CPU(struct perf_callchain_entry, irq_entry); 1775static DEFINE_PER_CPU(struct perf_callchain_entry, irq_entry);
1565static DEFINE_PER_CPU(struct perf_callchain_entry, nmi_entry); 1776static DEFINE_PER_CPU(struct perf_callchain_entry, nmi_entry);
1777static DEFINE_PER_CPU(int, in_nmi_frame);
1566 1778
1567 1779
1568static void 1780static void
@@ -1578,7 +1790,9 @@ static void backtrace_warning(void *data, char *msg)
1578 1790
1579static int backtrace_stack(void *data, char *name) 1791static int backtrace_stack(void *data, char *name)
1580{ 1792{
1581 /* Process all stacks: */ 1793 per_cpu(in_nmi_frame, smp_processor_id()) =
1794 x86_is_stack_id(NMI_STACK, name);
1795
1582 return 0; 1796 return 0;
1583} 1797}
1584 1798
@@ -1586,6 +1800,9 @@ static void backtrace_address(void *data, unsigned long addr, int reliable)
1586{ 1800{
1587 struct perf_callchain_entry *entry = data; 1801 struct perf_callchain_entry *entry = data;
1588 1802
1803 if (per_cpu(in_nmi_frame, smp_processor_id()))
1804 return;
1805
1589 if (reliable) 1806 if (reliable)
1590 callchain_store(entry, addr); 1807 callchain_store(entry, addr);
1591} 1808}
diff --git a/arch/x86/kernel/cpu/perfctr-watchdog.c b/arch/x86/kernel/cpu/perfctr-watchdog.c
index 5c481f6205bf..e60ed740d2b3 100644
--- a/arch/x86/kernel/cpu/perfctr-watchdog.c
+++ b/arch/x86/kernel/cpu/perfctr-watchdog.c
@@ -803,8 +803,3 @@ int __kprobes lapic_wd_event(unsigned nmi_hz)
803 wd_ops->rearm(wd, nmi_hz); 803 wd_ops->rearm(wd, nmi_hz);
804 return 1; 804 return 1;
805} 805}
806
807int lapic_watchdog_ok(void)
808{
809 return wd_ops != NULL;
810}
diff --git a/arch/x86/kernel/dumpstack.c b/arch/x86/kernel/dumpstack.c
index 95ea5fa7d444..c8405718a4c3 100644
--- a/arch/x86/kernel/dumpstack.c
+++ b/arch/x86/kernel/dumpstack.c
@@ -22,6 +22,7 @@
22#include "dumpstack.h" 22#include "dumpstack.h"
23 23
24int panic_on_unrecovered_nmi; 24int panic_on_unrecovered_nmi;
25int panic_on_io_nmi;
25unsigned int code_bytes = 64; 26unsigned int code_bytes = 64;
26int kstack_depth_to_print = 3 * STACKSLOTS_PER_LINE; 27int kstack_depth_to_print = 3 * STACKSLOTS_PER_LINE;
27static int die_counter; 28static int die_counter;
diff --git a/arch/x86/kernel/dumpstack_32.c b/arch/x86/kernel/dumpstack_32.c
index d593cd1f58dc..bca5fba91c9e 100644
--- a/arch/x86/kernel/dumpstack_32.c
+++ b/arch/x86/kernel/dumpstack_32.c
@@ -19,6 +19,12 @@
19 19
20#include "dumpstack.h" 20#include "dumpstack.h"
21 21
22/* Just a stub for now */
23int x86_is_stack_id(int id, char *name)
24{
25 return 0;
26}
27
22void dump_trace(struct task_struct *task, struct pt_regs *regs, 28void dump_trace(struct task_struct *task, struct pt_regs *regs,
23 unsigned long *stack, unsigned long bp, 29 unsigned long *stack, unsigned long bp,
24 const struct stacktrace_ops *ops, void *data) 30 const struct stacktrace_ops *ops, void *data)
diff --git a/arch/x86/kernel/dumpstack_64.c b/arch/x86/kernel/dumpstack_64.c
index d35db5993fd6..54b0a3276766 100644
--- a/arch/x86/kernel/dumpstack_64.c
+++ b/arch/x86/kernel/dumpstack_64.c
@@ -19,10 +19,8 @@
19 19
20#include "dumpstack.h" 20#include "dumpstack.h"
21 21
22static unsigned long *in_exception_stack(unsigned cpu, unsigned long stack, 22
23 unsigned *usedp, char **idp) 23static char x86_stack_ids[][8] = {
24{
25 static char ids[][8] = {
26 [DEBUG_STACK - 1] = "#DB", 24 [DEBUG_STACK - 1] = "#DB",
27 [NMI_STACK - 1] = "NMI", 25 [NMI_STACK - 1] = "NMI",
28 [DOUBLEFAULT_STACK - 1] = "#DF", 26 [DOUBLEFAULT_STACK - 1] = "#DF",
@@ -33,6 +31,15 @@ static unsigned long *in_exception_stack(unsigned cpu, unsigned long stack,
33 N_EXCEPTION_STACKS + DEBUG_STKSZ / EXCEPTION_STKSZ - 2] = "#DB[?]" 31 N_EXCEPTION_STACKS + DEBUG_STKSZ / EXCEPTION_STKSZ - 2] = "#DB[?]"
34#endif 32#endif
35 }; 33 };
34
35int x86_is_stack_id(int id, char *name)
36{
37 return x86_stack_ids[id - 1] == name;
38}
39
40static unsigned long *in_exception_stack(unsigned cpu, unsigned long stack,
41 unsigned *usedp, char **idp)
42{
36 unsigned k; 43 unsigned k;
37 44
38 /* 45 /*
@@ -61,7 +68,7 @@ static unsigned long *in_exception_stack(unsigned cpu, unsigned long stack,
61 if (*usedp & (1U << k)) 68 if (*usedp & (1U << k))
62 break; 69 break;
63 *usedp |= 1U << k; 70 *usedp |= 1U << k;
64 *idp = ids[k]; 71 *idp = x86_stack_ids[k];
65 return (unsigned long *)end; 72 return (unsigned long *)end;
66 } 73 }
67 /* 74 /*
@@ -81,12 +88,13 @@ static unsigned long *in_exception_stack(unsigned cpu, unsigned long stack,
81 do { 88 do {
82 ++j; 89 ++j;
83 end -= EXCEPTION_STKSZ; 90 end -= EXCEPTION_STKSZ;
84 ids[j][4] = '1' + (j - N_EXCEPTION_STACKS); 91 x86_stack_ids[j][4] = '1' +
92 (j - N_EXCEPTION_STACKS);
85 } while (stack < end - EXCEPTION_STKSZ); 93 } while (stack < end - EXCEPTION_STKSZ);
86 if (*usedp & (1U << j)) 94 if (*usedp & (1U << j))
87 break; 95 break;
88 *usedp |= 1U << j; 96 *usedp |= 1U << j;
89 *idp = ids[j]; 97 *idp = x86_stack_ids[j];
90 return (unsigned long *)end; 98 return (unsigned long *)end;
91 } 99 }
92#endif 100#endif
diff --git a/arch/x86/kernel/e820.c b/arch/x86/kernel/e820.c
index 7271fa33d791..5cb5725b2bae 100644
--- a/arch/x86/kernel/e820.c
+++ b/arch/x86/kernel/e820.c
@@ -627,10 +627,9 @@ __init void e820_setup_gap(void)
627#ifdef CONFIG_X86_64 627#ifdef CONFIG_X86_64
628 if (!found) { 628 if (!found) {
629 gapstart = (max_pfn << PAGE_SHIFT) + 1024*1024; 629 gapstart = (max_pfn << PAGE_SHIFT) + 1024*1024;
630 printk(KERN_ERR "PCI: Warning: Cannot find a gap in the 32bit " 630 printk(KERN_ERR
631 "address range\n" 631 "PCI: Warning: Cannot find a gap in the 32bit address range\n"
632 KERN_ERR "PCI: Unassigned devices with 32bit resource " 632 "PCI: Unassigned devices with 32bit resource registers may break!\n");
633 "registers may break!\n");
634 } 633 }
635#endif 634#endif
636 635
@@ -1383,6 +1382,8 @@ static unsigned long ram_alignment(resource_size_t pos)
1383 return 32*1024*1024; 1382 return 32*1024*1024;
1384} 1383}
1385 1384
1385#define MAX_RESOURCE_SIZE ((resource_size_t)-1)
1386
1386void __init e820_reserve_resources_late(void) 1387void __init e820_reserve_resources_late(void)
1387{ 1388{
1388 int i; 1389 int i;
@@ -1400,17 +1401,19 @@ void __init e820_reserve_resources_late(void)
1400 * avoid stolen RAM: 1401 * avoid stolen RAM:
1401 */ 1402 */
1402 for (i = 0; i < e820.nr_map; i++) { 1403 for (i = 0; i < e820.nr_map; i++) {
1403 struct e820entry *entry = &e820_saved.map[i]; 1404 struct e820entry *entry = &e820.map[i];
1404 resource_size_t start, end; 1405 u64 start, end;
1405 1406
1406 if (entry->type != E820_RAM) 1407 if (entry->type != E820_RAM)
1407 continue; 1408 continue;
1408 start = entry->addr + entry->size; 1409 start = entry->addr + entry->size;
1409 end = round_up(start, ram_alignment(start)); 1410 end = round_up(start, ram_alignment(start)) - 1;
1410 if (start == end) 1411 if (end > MAX_RESOURCE_SIZE)
1412 end = MAX_RESOURCE_SIZE;
1413 if (start >= end)
1411 continue; 1414 continue;
1412 reserve_region_with_split(&iomem_resource, start, 1415 reserve_region_with_split(&iomem_resource, start, end,
1413 end - 1, "RAM buffer"); 1416 "RAM buffer");
1414 } 1417 }
1415} 1418}
1416 1419
diff --git a/arch/x86/kernel/efi.c b/arch/x86/kernel/efi.c
index 96f7ac0bbf01..fe26ba3e3451 100644
--- a/arch/x86/kernel/efi.c
+++ b/arch/x86/kernel/efi.c
@@ -354,7 +354,7 @@ void __init efi_init(void)
354 */ 354 */
355 c16 = tmp = early_ioremap(efi.systab->fw_vendor, 2); 355 c16 = tmp = early_ioremap(efi.systab->fw_vendor, 2);
356 if (c16) { 356 if (c16) {
357 for (i = 0; i < sizeof(vendor) && *c16; ++i) 357 for (i = 0; i < sizeof(vendor) - 1 && *c16; ++i)
358 vendor[i] = *c16++; 358 vendor[i] = *c16++;
359 vendor[i] = '\0'; 359 vendor[i] = '\0';
360 } else 360 } else
@@ -512,7 +512,7 @@ void __init efi_enter_virtual_mode(void)
512 && end_pfn <= max_pfn_mapped)) 512 && end_pfn <= max_pfn_mapped))
513 va = __va(md->phys_addr); 513 va = __va(md->phys_addr);
514 else 514 else
515 va = efi_ioremap(md->phys_addr, size); 515 va = efi_ioremap(md->phys_addr, size, md->type);
516 516
517 md->virt_addr = (u64) (unsigned long) va; 517 md->virt_addr = (u64) (unsigned long) va;
518 518
diff --git a/arch/x86/kernel/efi_64.c b/arch/x86/kernel/efi_64.c
index 22c3b7828c50..ac0621a7ac3d 100644
--- a/arch/x86/kernel/efi_64.c
+++ b/arch/x86/kernel/efi_64.c
@@ -98,10 +98,14 @@ void __init efi_call_phys_epilog(void)
98 early_runtime_code_mapping_set_exec(0); 98 early_runtime_code_mapping_set_exec(0);
99} 99}
100 100
101void __iomem *__init efi_ioremap(unsigned long phys_addr, unsigned long size) 101void __iomem *__init efi_ioremap(unsigned long phys_addr, unsigned long size,
102 u32 type)
102{ 103{
103 unsigned long last_map_pfn; 104 unsigned long last_map_pfn;
104 105
106 if (type == EFI_MEMORY_MAPPED_IO)
107 return ioremap(phys_addr, size);
108
105 last_map_pfn = init_memory_mapping(phys_addr, phys_addr + size); 109 last_map_pfn = init_memory_mapping(phys_addr, phys_addr + size);
106 if ((last_map_pfn << PAGE_SHIFT) < phys_addr + size) 110 if ((last_map_pfn << PAGE_SHIFT) < phys_addr + size)
107 return NULL; 111 return NULL;
diff --git a/arch/x86/kernel/head_32.S b/arch/x86/kernel/head_32.S
index 8663afb56535..0d98a01cbdb2 100644
--- a/arch/x86/kernel/head_32.S
+++ b/arch/x86/kernel/head_32.S
@@ -602,7 +602,11 @@ ignore_int:
602#endif 602#endif
603 iret 603 iret
604 604
605.section .cpuinit.data,"wa" 605#ifndef CONFIG_HOTPLUG_CPU
606 __CPUINITDATA
607#else
608 __REFDATA
609#endif
606.align 4 610.align 4
607ENTRY(initial_code) 611ENTRY(initial_code)
608 .long i386_start_kernel 612 .long i386_start_kernel
diff --git a/arch/x86/kernel/irqinit.c b/arch/x86/kernel/irqinit.c
index 696f0e475c2d..92b7703d3d58 100644
--- a/arch/x86/kernel/irqinit.c
+++ b/arch/x86/kernel/irqinit.c
@@ -187,7 +187,7 @@ static void __init apic_intr_init(void)
187#ifdef CONFIG_X86_THERMAL_VECTOR 187#ifdef CONFIG_X86_THERMAL_VECTOR
188 alloc_intr_gate(THERMAL_APIC_VECTOR, thermal_interrupt); 188 alloc_intr_gate(THERMAL_APIC_VECTOR, thermal_interrupt);
189#endif 189#endif
190#ifdef CONFIG_X86_THRESHOLD 190#ifdef CONFIG_X86_MCE_THRESHOLD
191 alloc_intr_gate(THRESHOLD_APIC_VECTOR, threshold_interrupt); 191 alloc_intr_gate(THRESHOLD_APIC_VECTOR, threshold_interrupt);
192#endif 192#endif
193#if defined(CONFIG_X86_NEW_MCE) && defined(CONFIG_X86_LOCAL_APIC) 193#if defined(CONFIG_X86_NEW_MCE) && defined(CONFIG_X86_LOCAL_APIC)
diff --git a/arch/x86/kernel/kvm.c b/arch/x86/kernel/kvm.c
index a78ecad0c900..c664d515f613 100644
--- a/arch/x86/kernel/kvm.c
+++ b/arch/x86/kernel/kvm.c
@@ -200,7 +200,7 @@ static void kvm_leave_lazy_mmu(void)
200 state->mode = paravirt_get_lazy_mode(); 200 state->mode = paravirt_get_lazy_mode();
201} 201}
202 202
203static void paravirt_ops_setup(void) 203static void __init paravirt_ops_setup(void)
204{ 204{
205 pv_info.name = "KVM"; 205 pv_info.name = "KVM";
206 pv_info.paravirt_enabled = 1; 206 pv_info.paravirt_enabled = 1;
diff --git a/arch/x86/kernel/mfgpt_32.c b/arch/x86/kernel/mfgpt_32.c
index 846510b78a09..2a62d843f015 100644
--- a/arch/x86/kernel/mfgpt_32.c
+++ b/arch/x86/kernel/mfgpt_32.c
@@ -347,7 +347,7 @@ static irqreturn_t mfgpt_tick(int irq, void *dev_id)
347 347
348static struct irqaction mfgptirq = { 348static struct irqaction mfgptirq = {
349 .handler = mfgpt_tick, 349 .handler = mfgpt_tick,
350 .flags = IRQF_DISABLED | IRQF_NOBALANCING, 350 .flags = IRQF_DISABLED | IRQF_NOBALANCING | IRQF_TIMER,
351 .name = "mfgpt-timer" 351 .name = "mfgpt-timer"
352}; 352};
353 353
diff --git a/arch/x86/kernel/pci-dma.c b/arch/x86/kernel/pci-dma.c
index 47630479b067..1a041bcf506b 100644
--- a/arch/x86/kernel/pci-dma.c
+++ b/arch/x86/kernel/pci-dma.c
@@ -211,11 +211,11 @@ static __init int iommu_setup(char *p)
211#ifdef CONFIG_SWIOTLB 211#ifdef CONFIG_SWIOTLB
212 if (!strncmp(p, "soft", 4)) 212 if (!strncmp(p, "soft", 4))
213 swiotlb = 1; 213 swiotlb = 1;
214#endif
214 if (!strncmp(p, "pt", 2)) { 215 if (!strncmp(p, "pt", 2)) {
215 iommu_pass_through = 1; 216 iommu_pass_through = 1;
216 return 1; 217 return 1;
217 } 218 }
218#endif
219 219
220 gart_parse_options(p); 220 gart_parse_options(p);
221 221
diff --git a/arch/x86/kernel/pci-gart_64.c b/arch/x86/kernel/pci-gart_64.c
index cfd9f9063896..d2e56b8f48e7 100644
--- a/arch/x86/kernel/pci-gart_64.c
+++ b/arch/x86/kernel/pci-gart_64.c
@@ -675,7 +675,7 @@ static __init int init_k8_gatt(struct agp_kern_info *info)
675 nommu: 675 nommu:
676 /* Should not happen anymore */ 676 /* Should not happen anymore */
677 printk(KERN_WARNING "PCI-DMA: More than 4GB of RAM and no IOMMU\n" 677 printk(KERN_WARNING "PCI-DMA: More than 4GB of RAM and no IOMMU\n"
678 KERN_WARNING "falling back to iommu=soft.\n"); 678 "falling back to iommu=soft.\n");
679 return -1; 679 return -1;
680} 680}
681 681
diff --git a/arch/x86/kernel/pvclock.c b/arch/x86/kernel/pvclock.c
index 4f9c55f3a7c0..03801f2f761f 100644
--- a/arch/x86/kernel/pvclock.c
+++ b/arch/x86/kernel/pvclock.c
@@ -60,7 +60,7 @@ static inline u64 scale_delta(u64 delta, u32 mul_frac, int shift)
60 "adc %5,%%edx ; " 60 "adc %5,%%edx ; "
61 : "=A" (product), "=r" (tmp1), "=r" (tmp2) 61 : "=A" (product), "=r" (tmp1), "=r" (tmp2)
62 : "a" ((u32)delta), "1" ((u32)(delta >> 32)), "2" (mul_frac) ); 62 : "a" ((u32)delta), "1" ((u32)(delta >> 32)), "2" (mul_frac) );
63#elif __x86_64__ 63#elif defined(__x86_64__)
64 __asm__ ( 64 __asm__ (
65 "mul %%rdx ; shrd $32,%%rdx,%%rax" 65 "mul %%rdx ; shrd $32,%%rdx,%%rax"
66 : "=a" (product) : "0" (delta), "d" ((u64)mul_frac) ); 66 : "=a" (product) : "0" (delta), "d" ((u64)mul_frac) );
diff --git a/arch/x86/kernel/reboot.c b/arch/x86/kernel/reboot.c
index d2d1ce8170f0..9eb897603705 100644
--- a/arch/x86/kernel/reboot.c
+++ b/arch/x86/kernel/reboot.c
@@ -3,6 +3,7 @@
3#include <linux/init.h> 3#include <linux/init.h>
4#include <linux/pm.h> 4#include <linux/pm.h>
5#include <linux/efi.h> 5#include <linux/efi.h>
6#include <linux/dmi.h>
6#include <acpi/reboot.h> 7#include <acpi/reboot.h>
7#include <asm/io.h> 8#include <asm/io.h>
8#include <asm/apic.h> 9#include <asm/apic.h>
@@ -17,7 +18,6 @@
17#include <asm/cpu.h> 18#include <asm/cpu.h>
18 19
19#ifdef CONFIG_X86_32 20#ifdef CONFIG_X86_32
20# include <linux/dmi.h>
21# include <linux/ctype.h> 21# include <linux/ctype.h>
22# include <linux/mc146818rtc.h> 22# include <linux/mc146818rtc.h>
23#else 23#else
@@ -249,6 +249,14 @@ static struct dmi_system_id __initdata reboot_dmi_table[] = {
249 DMI_MATCH(DMI_PRODUCT_NAME, "VGN-Z540N"), 249 DMI_MATCH(DMI_PRODUCT_NAME, "VGN-Z540N"),
250 }, 250 },
251 }, 251 },
252 { /* Handle problems with rebooting on CompuLab SBC-FITPC2 */
253 .callback = set_bios_reboot,
254 .ident = "CompuLab SBC-FITPC2",
255 .matches = {
256 DMI_MATCH(DMI_SYS_VENDOR, "CompuLab"),
257 DMI_MATCH(DMI_PRODUCT_NAME, "SBC-FITPC2"),
258 },
259 },
252 { } 260 { }
253}; 261};
254 262
@@ -396,6 +404,46 @@ EXPORT_SYMBOL(machine_real_restart);
396 404
397#endif /* CONFIG_X86_32 */ 405#endif /* CONFIG_X86_32 */
398 406
407/*
408 * Some Apple MacBook and MacBookPro's needs reboot=p to be able to reboot
409 */
410static int __init set_pci_reboot(const struct dmi_system_id *d)
411{
412 if (reboot_type != BOOT_CF9) {
413 reboot_type = BOOT_CF9;
414 printk(KERN_INFO "%s series board detected. "
415 "Selecting PCI-method for reboots.\n", d->ident);
416 }
417 return 0;
418}
419
420static struct dmi_system_id __initdata pci_reboot_dmi_table[] = {
421 { /* Handle problems with rebooting on Apple MacBook5,2 */
422 .callback = set_pci_reboot,
423 .ident = "Apple MacBook",
424 .matches = {
425 DMI_MATCH(DMI_SYS_VENDOR, "Apple Inc."),
426 DMI_MATCH(DMI_PRODUCT_NAME, "MacBook5,2"),
427 },
428 },
429 { /* Handle problems with rebooting on Apple MacBookPro5,1 */
430 .callback = set_pci_reboot,
431 .ident = "Apple MacBookPro5,1",
432 .matches = {
433 DMI_MATCH(DMI_SYS_VENDOR, "Apple Inc."),
434 DMI_MATCH(DMI_PRODUCT_NAME, "MacBookPro5,1"),
435 },
436 },
437 { }
438};
439
440static int __init pci_reboot_init(void)
441{
442 dmi_check_system(pci_reboot_dmi_table);
443 return 0;
444}
445core_initcall(pci_reboot_init);
446
399static inline void kb_wait(void) 447static inline void kb_wait(void)
400{ 448{
401 int i; 449 int i;
diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c
index be5ae80f897f..63f32d220ef2 100644
--- a/arch/x86/kernel/setup.c
+++ b/arch/x86/kernel/setup.c
@@ -289,6 +289,20 @@ void * __init extend_brk(size_t size, size_t align)
289 return ret; 289 return ret;
290} 290}
291 291
292#ifdef CONFIG_X86_64
293static void __init init_gbpages(void)
294{
295 if (direct_gbpages && cpu_has_gbpages)
296 printk(KERN_INFO "Using GB pages for direct mapping\n");
297 else
298 direct_gbpages = 0;
299}
300#else
301static inline void init_gbpages(void)
302{
303}
304#endif
305
292static void __init reserve_brk(void) 306static void __init reserve_brk(void)
293{ 307{
294 if (_brk_end > _brk_start) 308 if (_brk_end > _brk_start)
@@ -658,6 +672,19 @@ static struct dmi_system_id __initdata bad_bios_dmi_table[] = {
658 DMI_MATCH(DMI_BIOS_VENDOR, "Phoenix Technologies"), 672 DMI_MATCH(DMI_BIOS_VENDOR, "Phoenix Technologies"),
659 }, 673 },
660 }, 674 },
675 {
676 /*
677 * AMI BIOS with low memory corruption was found on Intel DG45ID board.
678 * It hase different DMI_BIOS_VENDOR = "Intel Corp.", for now we will
679 * match only DMI_BOARD_NAME and see if there is more bad products
680 * with this vendor.
681 */
682 .callback = dmi_low_memory_corruption,
683 .ident = "AMI BIOS",
684 .matches = {
685 DMI_MATCH(DMI_BOARD_NAME, "DG45ID"),
686 },
687 },
661#endif 688#endif
662 {} 689 {}
663}; 690};
@@ -871,6 +898,8 @@ void __init setup_arch(char **cmdline_p)
871 898
872 reserve_brk(); 899 reserve_brk();
873 900
901 init_gbpages();
902
874 /* max_pfn_mapped is updated here */ 903 /* max_pfn_mapped is updated here */
875 max_low_pfn_mapped = init_memory_mapping(0, max_low_pfn<<PAGE_SHIFT); 904 max_low_pfn_mapped = init_memory_mapping(0, max_low_pfn<<PAGE_SHIFT);
876 max_pfn_mapped = max_low_pfn_mapped; 905 max_pfn_mapped = max_low_pfn_mapped;
diff --git a/arch/x86/kernel/setup_percpu.c b/arch/x86/kernel/setup_percpu.c
index 9c3f0823e6aa..29a3eef7cf4a 100644
--- a/arch/x86/kernel/setup_percpu.c
+++ b/arch/x86/kernel/setup_percpu.c
@@ -124,7 +124,7 @@ static void * __init pcpu_alloc_bootmem(unsigned int cpu, unsigned long size,
124} 124}
125 125
126/* 126/*
127 * Remap allocator 127 * Large page remap allocator
128 * 128 *
129 * This allocator uses PMD page as unit. A PMD page is allocated for 129 * This allocator uses PMD page as unit. A PMD page is allocated for
130 * each cpu and each is remapped into vmalloc area using PMD mapping. 130 * each cpu and each is remapped into vmalloc area using PMD mapping.
@@ -137,105 +137,185 @@ static void * __init pcpu_alloc_bootmem(unsigned int cpu, unsigned long size,
137 * better than only using 4k mappings while still being NUMA friendly. 137 * better than only using 4k mappings while still being NUMA friendly.
138 */ 138 */
139#ifdef CONFIG_NEED_MULTIPLE_NODES 139#ifdef CONFIG_NEED_MULTIPLE_NODES
140static size_t pcpur_size __initdata; 140struct pcpul_ent {
141static void **pcpur_ptrs __initdata; 141 unsigned int cpu;
142 void *ptr;
143};
144
145static size_t pcpul_size;
146static struct pcpul_ent *pcpul_map;
147static struct vm_struct pcpul_vm;
142 148
143static struct page * __init pcpur_get_page(unsigned int cpu, int pageno) 149static struct page * __init pcpul_get_page(unsigned int cpu, int pageno)
144{ 150{
145 size_t off = (size_t)pageno << PAGE_SHIFT; 151 size_t off = (size_t)pageno << PAGE_SHIFT;
146 152
147 if (off >= pcpur_size) 153 if (off >= pcpul_size)
148 return NULL; 154 return NULL;
149 155
150 return virt_to_page(pcpur_ptrs[cpu] + off); 156 return virt_to_page(pcpul_map[cpu].ptr + off);
151} 157}
152 158
153static ssize_t __init setup_pcpu_remap(size_t static_size) 159static ssize_t __init setup_pcpu_lpage(size_t static_size, bool chosen)
154{ 160{
155 static struct vm_struct vm; 161 size_t map_size, dyn_size;
156 size_t ptrs_size, dyn_size;
157 unsigned int cpu; 162 unsigned int cpu;
163 int i, j;
158 ssize_t ret; 164 ssize_t ret;
159 165
160 /* 166 if (!chosen) {
161 * If large page isn't supported, there's no benefit in doing 167 size_t vm_size = VMALLOC_END - VMALLOC_START;
162 * this. Also, on non-NUMA, embedding is better. 168 size_t tot_size = num_possible_cpus() * PMD_SIZE;
163 * 169
164 * NOTE: disabled for now. 170 /* on non-NUMA, embedding is better */
165 */ 171 if (!pcpu_need_numa())
166 if (true || !cpu_has_pse || !pcpu_need_numa()) 172 return -EINVAL;
173
174 /* don't consume more than 20% of vmalloc area */
175 if (tot_size > vm_size / 5) {
176 pr_info("PERCPU: too large chunk size %zuMB for "
177 "large page remap\n", tot_size >> 20);
178 return -EINVAL;
179 }
180 }
181
182 /* need PSE */
183 if (!cpu_has_pse) {
184 pr_warning("PERCPU: lpage allocator requires PSE\n");
167 return -EINVAL; 185 return -EINVAL;
186 }
168 187
169 /* 188 /*
170 * Currently supports only single page. Supporting multiple 189 * Currently supports only single page. Supporting multiple
171 * pages won't be too difficult if it ever becomes necessary. 190 * pages won't be too difficult if it ever becomes necessary.
172 */ 191 */
173 pcpur_size = PFN_ALIGN(static_size + PERCPU_MODULE_RESERVE + 192 pcpul_size = PFN_ALIGN(static_size + PERCPU_MODULE_RESERVE +
174 PERCPU_DYNAMIC_RESERVE); 193 PERCPU_DYNAMIC_RESERVE);
175 if (pcpur_size > PMD_SIZE) { 194 if (pcpul_size > PMD_SIZE) {
176 pr_warning("PERCPU: static data is larger than large page, " 195 pr_warning("PERCPU: static data is larger than large page, "
177 "can't use large page\n"); 196 "can't use large page\n");
178 return -EINVAL; 197 return -EINVAL;
179 } 198 }
180 dyn_size = pcpur_size - static_size - PERCPU_FIRST_CHUNK_RESERVE; 199 dyn_size = pcpul_size - static_size - PERCPU_FIRST_CHUNK_RESERVE;
181 200
182 /* allocate pointer array and alloc large pages */ 201 /* allocate pointer array and alloc large pages */
183 ptrs_size = PFN_ALIGN(num_possible_cpus() * sizeof(pcpur_ptrs[0])); 202 map_size = PFN_ALIGN(num_possible_cpus() * sizeof(pcpul_map[0]));
184 pcpur_ptrs = alloc_bootmem(ptrs_size); 203 pcpul_map = alloc_bootmem(map_size);
185 204
186 for_each_possible_cpu(cpu) { 205 for_each_possible_cpu(cpu) {
187 pcpur_ptrs[cpu] = pcpu_alloc_bootmem(cpu, PMD_SIZE, PMD_SIZE); 206 pcpul_map[cpu].cpu = cpu;
188 if (!pcpur_ptrs[cpu]) 207 pcpul_map[cpu].ptr = pcpu_alloc_bootmem(cpu, PMD_SIZE,
208 PMD_SIZE);
209 if (!pcpul_map[cpu].ptr) {
210 pr_warning("PERCPU: failed to allocate large page "
211 "for cpu%u\n", cpu);
189 goto enomem; 212 goto enomem;
213 }
190 214
191 /* 215 /*
192 * Only use pcpur_size bytes and give back the rest. 216 * Only use pcpul_size bytes and give back the rest.
193 * 217 *
194 * Ingo: The 2MB up-rounding bootmem is needed to make 218 * Ingo: The 2MB up-rounding bootmem is needed to make
195 * sure the partial 2MB page is still fully RAM - it's 219 * sure the partial 2MB page is still fully RAM - it's
196 * not well-specified to have a PAT-incompatible area 220 * not well-specified to have a PAT-incompatible area
197 * (unmapped RAM, device memory, etc.) in that hole. 221 * (unmapped RAM, device memory, etc.) in that hole.
198 */ 222 */
199 free_bootmem(__pa(pcpur_ptrs[cpu] + pcpur_size), 223 free_bootmem(__pa(pcpul_map[cpu].ptr + pcpul_size),
200 PMD_SIZE - pcpur_size); 224 PMD_SIZE - pcpul_size);
201 225
202 memcpy(pcpur_ptrs[cpu], __per_cpu_load, static_size); 226 memcpy(pcpul_map[cpu].ptr, __per_cpu_load, static_size);
203 } 227 }
204 228
205 /* allocate address and map */ 229 /* allocate address and map */
206 vm.flags = VM_ALLOC; 230 pcpul_vm.flags = VM_ALLOC;
207 vm.size = num_possible_cpus() * PMD_SIZE; 231 pcpul_vm.size = num_possible_cpus() * PMD_SIZE;
208 vm_area_register_early(&vm, PMD_SIZE); 232 vm_area_register_early(&pcpul_vm, PMD_SIZE);
209 233
210 for_each_possible_cpu(cpu) { 234 for_each_possible_cpu(cpu) {
211 pmd_t *pmd; 235 pmd_t *pmd, pmd_v;
212 236
213 pmd = populate_extra_pmd((unsigned long)vm.addr 237 pmd = populate_extra_pmd((unsigned long)pcpul_vm.addr +
214 + cpu * PMD_SIZE); 238 cpu * PMD_SIZE);
215 set_pmd(pmd, pfn_pmd(page_to_pfn(virt_to_page(pcpur_ptrs[cpu])), 239 pmd_v = pfn_pmd(page_to_pfn(virt_to_page(pcpul_map[cpu].ptr)),
216 PAGE_KERNEL_LARGE)); 240 PAGE_KERNEL_LARGE);
241 set_pmd(pmd, pmd_v);
217 } 242 }
218 243
219 /* we're ready, commit */ 244 /* we're ready, commit */
220 pr_info("PERCPU: Remapped at %p with large pages, static data " 245 pr_info("PERCPU: Remapped at %p with large pages, static data "
221 "%zu bytes\n", vm.addr, static_size); 246 "%zu bytes\n", pcpul_vm.addr, static_size);
222 247
223 ret = pcpu_setup_first_chunk(pcpur_get_page, static_size, 248 ret = pcpu_setup_first_chunk(pcpul_get_page, static_size,
224 PERCPU_FIRST_CHUNK_RESERVE, dyn_size, 249 PERCPU_FIRST_CHUNK_RESERVE, dyn_size,
225 PMD_SIZE, vm.addr, NULL); 250 PMD_SIZE, pcpul_vm.addr, NULL);
226 goto out_free_ar; 251
252 /* sort pcpul_map array for pcpu_lpage_remapped() */
253 for (i = 0; i < num_possible_cpus() - 1; i++)
254 for (j = i + 1; j < num_possible_cpus(); j++)
255 if (pcpul_map[i].ptr > pcpul_map[j].ptr) {
256 struct pcpul_ent tmp = pcpul_map[i];
257 pcpul_map[i] = pcpul_map[j];
258 pcpul_map[j] = tmp;
259 }
260
261 return ret;
227 262
228enomem: 263enomem:
229 for_each_possible_cpu(cpu) 264 for_each_possible_cpu(cpu)
230 if (pcpur_ptrs[cpu]) 265 if (pcpul_map[cpu].ptr)
231 free_bootmem(__pa(pcpur_ptrs[cpu]), PMD_SIZE); 266 free_bootmem(__pa(pcpul_map[cpu].ptr), pcpul_size);
232 ret = -ENOMEM; 267 free_bootmem(__pa(pcpul_map), map_size);
233out_free_ar: 268 return -ENOMEM;
234 free_bootmem(__pa(pcpur_ptrs), ptrs_size); 269}
235 return ret; 270
271/**
272 * pcpu_lpage_remapped - determine whether a kaddr is in pcpul recycled area
273 * @kaddr: the kernel address in question
274 *
275 * Determine whether @kaddr falls in the pcpul recycled area. This is
276 * used by pageattr to detect VM aliases and break up the pcpu PMD
277 * mapping such that the same physical page is not mapped under
278 * different attributes.
279 *
280 * The recycled area is always at the tail of a partially used PMD
281 * page.
282 *
283 * RETURNS:
284 * Address of corresponding remapped pcpu address if match is found;
285 * otherwise, NULL.
286 */
287void *pcpu_lpage_remapped(void *kaddr)
288{
289 void *pmd_addr = (void *)((unsigned long)kaddr & PMD_MASK);
290 unsigned long offset = (unsigned long)kaddr & ~PMD_MASK;
291 int left = 0, right = num_possible_cpus() - 1;
292 int pos;
293
294 /* pcpul in use at all? */
295 if (!pcpul_map)
296 return NULL;
297
298 /* okay, perform binary search */
299 while (left <= right) {
300 pos = (left + right) / 2;
301
302 if (pcpul_map[pos].ptr < pmd_addr)
303 left = pos + 1;
304 else if (pcpul_map[pos].ptr > pmd_addr)
305 right = pos - 1;
306 else {
307 /* it shouldn't be in the area for the first chunk */
308 WARN_ON(offset < pcpul_size);
309
310 return pcpul_vm.addr +
311 pcpul_map[pos].cpu * PMD_SIZE + offset;
312 }
313 }
314
315 return NULL;
236} 316}
237#else 317#else
238static ssize_t __init setup_pcpu_remap(size_t static_size) 318static ssize_t __init setup_pcpu_lpage(size_t static_size, bool chosen)
239{ 319{
240 return -EINVAL; 320 return -EINVAL;
241} 321}
@@ -249,7 +329,7 @@ static ssize_t __init setup_pcpu_remap(size_t static_size)
249 * mapping so that it can use PMD mapping without additional TLB 329 * mapping so that it can use PMD mapping without additional TLB
250 * pressure. 330 * pressure.
251 */ 331 */
252static ssize_t __init setup_pcpu_embed(size_t static_size) 332static ssize_t __init setup_pcpu_embed(size_t static_size, bool chosen)
253{ 333{
254 size_t reserve = PERCPU_MODULE_RESERVE + PERCPU_DYNAMIC_RESERVE; 334 size_t reserve = PERCPU_MODULE_RESERVE + PERCPU_DYNAMIC_RESERVE;
255 335
@@ -258,7 +338,7 @@ static ssize_t __init setup_pcpu_embed(size_t static_size)
258 * this. Also, embedding allocation doesn't play well with 338 * this. Also, embedding allocation doesn't play well with
259 * NUMA. 339 * NUMA.
260 */ 340 */
261 if (!cpu_has_pse || pcpu_need_numa()) 341 if (!chosen && (!cpu_has_pse || pcpu_need_numa()))
262 return -EINVAL; 342 return -EINVAL;
263 343
264 return pcpu_embed_first_chunk(static_size, PERCPU_FIRST_CHUNK_RESERVE, 344 return pcpu_embed_first_chunk(static_size, PERCPU_FIRST_CHUNK_RESERVE,
@@ -308,8 +388,11 @@ static ssize_t __init setup_pcpu_4k(size_t static_size)
308 void *ptr; 388 void *ptr;
309 389
310 ptr = pcpu_alloc_bootmem(cpu, PAGE_SIZE, PAGE_SIZE); 390 ptr = pcpu_alloc_bootmem(cpu, PAGE_SIZE, PAGE_SIZE);
311 if (!ptr) 391 if (!ptr) {
392 pr_warning("PERCPU: failed to allocate "
393 "4k page for cpu%u\n", cpu);
312 goto enomem; 394 goto enomem;
395 }
313 396
314 memcpy(ptr, __per_cpu_load + i * PAGE_SIZE, PAGE_SIZE); 397 memcpy(ptr, __per_cpu_load + i * PAGE_SIZE, PAGE_SIZE);
315 pcpu4k_pages[j++] = virt_to_page(ptr); 398 pcpu4k_pages[j++] = virt_to_page(ptr);
@@ -333,6 +416,16 @@ out_free_ar:
333 return ret; 416 return ret;
334} 417}
335 418
419/* for explicit first chunk allocator selection */
420static char pcpu_chosen_alloc[16] __initdata;
421
422static int __init percpu_alloc_setup(char *str)
423{
424 strncpy(pcpu_chosen_alloc, str, sizeof(pcpu_chosen_alloc) - 1);
425 return 0;
426}
427early_param("percpu_alloc", percpu_alloc_setup);
428
336static inline void setup_percpu_segment(int cpu) 429static inline void setup_percpu_segment(int cpu)
337{ 430{
338#ifdef CONFIG_X86_32 431#ifdef CONFIG_X86_32
@@ -346,11 +439,6 @@ static inline void setup_percpu_segment(int cpu)
346#endif 439#endif
347} 440}
348 441
349/*
350 * Great future plan:
351 * Declare PDA itself and support (irqstack,tss,pgd) as per cpu data.
352 * Always point %gs to its beginning
353 */
354void __init setup_per_cpu_areas(void) 442void __init setup_per_cpu_areas(void)
355{ 443{
356 size_t static_size = __per_cpu_end - __per_cpu_start; 444 size_t static_size = __per_cpu_end - __per_cpu_start;
@@ -367,9 +455,26 @@ void __init setup_per_cpu_areas(void)
367 * of large page mappings. Please read comments on top of 455 * of large page mappings. Please read comments on top of
368 * each allocator for details. 456 * each allocator for details.
369 */ 457 */
370 ret = setup_pcpu_remap(static_size); 458 ret = -EINVAL;
371 if (ret < 0) 459 if (strlen(pcpu_chosen_alloc)) {
372 ret = setup_pcpu_embed(static_size); 460 if (strcmp(pcpu_chosen_alloc, "4k")) {
461 if (!strcmp(pcpu_chosen_alloc, "lpage"))
462 ret = setup_pcpu_lpage(static_size, true);
463 else if (!strcmp(pcpu_chosen_alloc, "embed"))
464 ret = setup_pcpu_embed(static_size, true);
465 else
466 pr_warning("PERCPU: unknown allocator %s "
467 "specified\n", pcpu_chosen_alloc);
468 if (ret < 0)
469 pr_warning("PERCPU: %s allocator failed (%zd), "
470 "falling back to 4k\n",
471 pcpu_chosen_alloc, ret);
472 }
473 } else {
474 ret = setup_pcpu_lpage(static_size, false);
475 if (ret < 0)
476 ret = setup_pcpu_embed(static_size, false);
477 }
373 if (ret < 0) 478 if (ret < 0)
374 ret = setup_pcpu_4k(static_size); 479 ret = setup_pcpu_4k(static_size);
375 if (ret < 0) 480 if (ret < 0)
diff --git a/arch/x86/kernel/tlb_uv.c b/arch/x86/kernel/tlb_uv.c
index 124d40c575df..8ccabb8a2f6a 100644
--- a/arch/x86/kernel/tlb_uv.c
+++ b/arch/x86/kernel/tlb_uv.c
@@ -711,7 +711,6 @@ uv_activation_descriptor_init(int node, int pnode)
711 unsigned long pa; 711 unsigned long pa;
712 unsigned long m; 712 unsigned long m;
713 unsigned long n; 713 unsigned long n;
714 unsigned long mmr_image;
715 struct bau_desc *adp; 714 struct bau_desc *adp;
716 struct bau_desc *ad2; 715 struct bau_desc *ad2;
717 716
@@ -727,12 +726,8 @@ uv_activation_descriptor_init(int node, int pnode)
727 n = pa >> uv_nshift; 726 n = pa >> uv_nshift;
728 m = pa & uv_mmask; 727 m = pa & uv_mmask;
729 728
730 mmr_image = uv_read_global_mmr64(pnode, UVH_LB_BAU_SB_DESCRIPTOR_BASE); 729 uv_write_global_mmr64(pnode, UVH_LB_BAU_SB_DESCRIPTOR_BASE,
731 if (mmr_image) { 730 (n << UV_DESC_BASE_PNODE_SHIFT | m));
732 uv_write_global_mmr64(pnode, (unsigned long)
733 UVH_LB_BAU_SB_DESCRIPTOR_BASE,
734 (n << UV_DESC_BASE_PNODE_SHIFT | m));
735 }
736 731
737 /* 732 /*
738 * initializing all 8 (UV_ITEMS_PER_DESCRIPTOR) descriptors for each 733 * initializing all 8 (UV_ITEMS_PER_DESCRIPTOR) descriptors for each
diff --git a/arch/x86/kernel/traps.c b/arch/x86/kernel/traps.c
index a0f48f5671c0..5204332f475d 100644
--- a/arch/x86/kernel/traps.c
+++ b/arch/x86/kernel/traps.c
@@ -346,6 +346,9 @@ io_check_error(unsigned char reason, struct pt_regs *regs)
346 printk(KERN_EMERG "NMI: IOCK error (debug interrupt?)\n"); 346 printk(KERN_EMERG "NMI: IOCK error (debug interrupt?)\n");
347 show_registers(regs); 347 show_registers(regs);
348 348
349 if (panic_on_io_nmi)
350 panic("NMI IOCK error: Not continuing");
351
349 /* Re-enable the IOCK line, wait for a few seconds */ 352 /* Re-enable the IOCK line, wait for a few seconds */
350 reason = (reason & 0xf) | 8; 353 reason = (reason & 0xf) | 8;
351 outb(reason, 0x61); 354 outb(reason, 0x61);
diff --git a/arch/x86/kernel/vmi_32.c b/arch/x86/kernel/vmi_32.c
index b263423fbe2a..95a7289e4b0c 100644
--- a/arch/x86/kernel/vmi_32.c
+++ b/arch/x86/kernel/vmi_32.c
@@ -441,7 +441,7 @@ vmi_startup_ipi_hook(int phys_apicid, unsigned long start_eip,
441 ap.ds = __USER_DS; 441 ap.ds = __USER_DS;
442 ap.es = __USER_DS; 442 ap.es = __USER_DS;
443 ap.fs = __KERNEL_PERCPU; 443 ap.fs = __KERNEL_PERCPU;
444 ap.gs = 0; 444 ap.gs = __KERNEL_STACK_CANARY;
445 445
446 ap.eflags = 0; 446 ap.eflags = 0;
447 447
diff --git a/arch/x86/kernel/vmlinux.lds.S b/arch/x86/kernel/vmlinux.lds.S
index 367e87882041..78d185d797de 100644
--- a/arch/x86/kernel/vmlinux.lds.S
+++ b/arch/x86/kernel/vmlinux.lds.S
@@ -112,11 +112,6 @@ SECTIONS
112 _sdata = .; 112 _sdata = .;
113 DATA_DATA 113 DATA_DATA
114 CONSTRUCTORS 114 CONSTRUCTORS
115
116#ifdef CONFIG_X86_64
117 /* End of data section */
118 _edata = .;
119#endif
120 } :data 115 } :data
121 116
122#ifdef CONFIG_X86_32 117#ifdef CONFIG_X86_32
@@ -156,10 +151,8 @@ SECTIONS
156 .data.read_mostly : AT(ADDR(.data.read_mostly) - LOAD_OFFSET) { 151 .data.read_mostly : AT(ADDR(.data.read_mostly) - LOAD_OFFSET) {
157 *(.data.read_mostly) 152 *(.data.read_mostly)
158 153
159#ifdef CONFIG_X86_32
160 /* End of data section */ 154 /* End of data section */
161 _edata = .; 155 _edata = .;
162#endif
163 } 156 }
164 157
165#ifdef CONFIG_X86_64 158#ifdef CONFIG_X86_64
@@ -400,8 +393,8 @@ SECTIONS
400 393
401 394
402#ifdef CONFIG_X86_32 395#ifdef CONFIG_X86_32
403ASSERT((_end - LOAD_OFFSET <= KERNEL_IMAGE_SIZE), 396. = ASSERT((_end - LOAD_OFFSET <= KERNEL_IMAGE_SIZE),
404 "kernel image bigger than KERNEL_IMAGE_SIZE") 397 "kernel image bigger than KERNEL_IMAGE_SIZE");
405#else 398#else
406/* 399/*
407 * Per-cpu symbols which need to be offset from __per_cpu_load 400 * Per-cpu symbols which need to be offset from __per_cpu_load
@@ -414,12 +407,12 @@ INIT_PER_CPU(irq_stack_union);
414/* 407/*
415 * Build-time check on the image size: 408 * Build-time check on the image size:
416 */ 409 */
417ASSERT((_end - _text <= KERNEL_IMAGE_SIZE), 410. = ASSERT((_end - _text <= KERNEL_IMAGE_SIZE),
418 "kernel image bigger than KERNEL_IMAGE_SIZE") 411 "kernel image bigger than KERNEL_IMAGE_SIZE");
419 412
420#ifdef CONFIG_SMP 413#ifdef CONFIG_SMP
421ASSERT((per_cpu__irq_stack_union == 0), 414. = ASSERT((per_cpu__irq_stack_union == 0),
422 "irq_stack_union is not at start of per-cpu area"); 415 "irq_stack_union is not at start of per-cpu area");
423#endif 416#endif
424 417
425#endif /* CONFIG_X86_32 */ 418#endif /* CONFIG_X86_32 */
@@ -427,7 +420,7 @@ ASSERT((per_cpu__irq_stack_union == 0),
427#ifdef CONFIG_KEXEC 420#ifdef CONFIG_KEXEC
428#include <asm/kexec.h> 421#include <asm/kexec.h>
429 422
430ASSERT(kexec_control_code_size <= KEXEC_CONTROL_CODE_MAX_SIZE, 423. = ASSERT(kexec_control_code_size <= KEXEC_CONTROL_CODE_MAX_SIZE,
431 "kexec control code size is too big") 424 "kexec control code size is too big");
432#endif 425#endif
433 426
diff --git a/arch/x86/kvm/i8254.c b/arch/x86/kvm/i8254.c
index 4d6f0d293ee2..21f68e00524f 100644
--- a/arch/x86/kvm/i8254.c
+++ b/arch/x86/kvm/i8254.c
@@ -104,6 +104,9 @@ static s64 __kpit_elapsed(struct kvm *kvm)
104 ktime_t remaining; 104 ktime_t remaining;
105 struct kvm_kpit_state *ps = &kvm->arch.vpit->pit_state; 105 struct kvm_kpit_state *ps = &kvm->arch.vpit->pit_state;
106 106
107 if (!ps->pit_timer.period)
108 return 0;
109
107 /* 110 /*
108 * The Counter does not stop when it reaches zero. In 111 * The Counter does not stop when it reaches zero. In
109 * Modes 0, 1, 4, and 5 the Counter ``wraps around'' to 112 * Modes 0, 1, 4, and 5 the Counter ``wraps around'' to
diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c
index 5c3d6e81a7dc..0ef5bb2b4043 100644
--- a/arch/x86/kvm/mmu.c
+++ b/arch/x86/kvm/mmu.c
@@ -489,16 +489,20 @@ static unsigned long *gfn_to_rmap(struct kvm *kvm, gfn_t gfn, int lpage)
489 * 489 *
490 * If rmapp bit zero is one, (then rmap & ~1) points to a struct kvm_rmap_desc 490 * If rmapp bit zero is one, (then rmap & ~1) points to a struct kvm_rmap_desc
491 * containing more mappings. 491 * containing more mappings.
492 *
493 * Returns the number of rmap entries before the spte was added or zero if
494 * the spte was not added.
495 *
492 */ 496 */
493static void rmap_add(struct kvm_vcpu *vcpu, u64 *spte, gfn_t gfn, int lpage) 497static int rmap_add(struct kvm_vcpu *vcpu, u64 *spte, gfn_t gfn, int lpage)
494{ 498{
495 struct kvm_mmu_page *sp; 499 struct kvm_mmu_page *sp;
496 struct kvm_rmap_desc *desc; 500 struct kvm_rmap_desc *desc;
497 unsigned long *rmapp; 501 unsigned long *rmapp;
498 int i; 502 int i, count = 0;
499 503
500 if (!is_rmap_pte(*spte)) 504 if (!is_rmap_pte(*spte))
501 return; 505 return count;
502 gfn = unalias_gfn(vcpu->kvm, gfn); 506 gfn = unalias_gfn(vcpu->kvm, gfn);
503 sp = page_header(__pa(spte)); 507 sp = page_header(__pa(spte));
504 sp->gfns[spte - sp->spt] = gfn; 508 sp->gfns[spte - sp->spt] = gfn;
@@ -515,8 +519,10 @@ static void rmap_add(struct kvm_vcpu *vcpu, u64 *spte, gfn_t gfn, int lpage)
515 } else { 519 } else {
516 rmap_printk("rmap_add: %p %llx many->many\n", spte, *spte); 520 rmap_printk("rmap_add: %p %llx many->many\n", spte, *spte);
517 desc = (struct kvm_rmap_desc *)(*rmapp & ~1ul); 521 desc = (struct kvm_rmap_desc *)(*rmapp & ~1ul);
518 while (desc->shadow_ptes[RMAP_EXT-1] && desc->more) 522 while (desc->shadow_ptes[RMAP_EXT-1] && desc->more) {
519 desc = desc->more; 523 desc = desc->more;
524 count += RMAP_EXT;
525 }
520 if (desc->shadow_ptes[RMAP_EXT-1]) { 526 if (desc->shadow_ptes[RMAP_EXT-1]) {
521 desc->more = mmu_alloc_rmap_desc(vcpu); 527 desc->more = mmu_alloc_rmap_desc(vcpu);
522 desc = desc->more; 528 desc = desc->more;
@@ -525,6 +531,7 @@ static void rmap_add(struct kvm_vcpu *vcpu, u64 *spte, gfn_t gfn, int lpage)
525 ; 531 ;
526 desc->shadow_ptes[i] = spte; 532 desc->shadow_ptes[i] = spte;
527 } 533 }
534 return count;
528} 535}
529 536
530static void rmap_desc_remove_entry(unsigned long *rmapp, 537static void rmap_desc_remove_entry(unsigned long *rmapp,
@@ -754,6 +761,19 @@ static int kvm_age_rmapp(struct kvm *kvm, unsigned long *rmapp)
754 return young; 761 return young;
755} 762}
756 763
764#define RMAP_RECYCLE_THRESHOLD 1000
765
766static void rmap_recycle(struct kvm_vcpu *vcpu, gfn_t gfn, int lpage)
767{
768 unsigned long *rmapp;
769
770 gfn = unalias_gfn(vcpu->kvm, gfn);
771 rmapp = gfn_to_rmap(vcpu->kvm, gfn, lpage);
772
773 kvm_unmap_rmapp(vcpu->kvm, rmapp);
774 kvm_flush_remote_tlbs(vcpu->kvm);
775}
776
757int kvm_age_hva(struct kvm *kvm, unsigned long hva) 777int kvm_age_hva(struct kvm *kvm, unsigned long hva)
758{ 778{
759 return kvm_handle_hva(kvm, hva, kvm_age_rmapp); 779 return kvm_handle_hva(kvm, hva, kvm_age_rmapp);
@@ -1407,24 +1427,25 @@ static int kvm_mmu_zap_page(struct kvm *kvm, struct kvm_mmu_page *sp)
1407 */ 1427 */
1408void kvm_mmu_change_mmu_pages(struct kvm *kvm, unsigned int kvm_nr_mmu_pages) 1428void kvm_mmu_change_mmu_pages(struct kvm *kvm, unsigned int kvm_nr_mmu_pages)
1409{ 1429{
1430 int used_pages;
1431
1432 used_pages = kvm->arch.n_alloc_mmu_pages - kvm->arch.n_free_mmu_pages;
1433 used_pages = max(0, used_pages);
1434
1410 /* 1435 /*
1411 * If we set the number of mmu pages to be smaller be than the 1436 * If we set the number of mmu pages to be smaller be than the
1412 * number of actived pages , we must to free some mmu pages before we 1437 * number of actived pages , we must to free some mmu pages before we
1413 * change the value 1438 * change the value
1414 */ 1439 */
1415 1440
1416 if ((kvm->arch.n_alloc_mmu_pages - kvm->arch.n_free_mmu_pages) > 1441 if (used_pages > kvm_nr_mmu_pages) {
1417 kvm_nr_mmu_pages) { 1442 while (used_pages > kvm_nr_mmu_pages) {
1418 int n_used_mmu_pages = kvm->arch.n_alloc_mmu_pages
1419 - kvm->arch.n_free_mmu_pages;
1420
1421 while (n_used_mmu_pages > kvm_nr_mmu_pages) {
1422 struct kvm_mmu_page *page; 1443 struct kvm_mmu_page *page;
1423 1444
1424 page = container_of(kvm->arch.active_mmu_pages.prev, 1445 page = container_of(kvm->arch.active_mmu_pages.prev,
1425 struct kvm_mmu_page, link); 1446 struct kvm_mmu_page, link);
1426 kvm_mmu_zap_page(kvm, page); 1447 kvm_mmu_zap_page(kvm, page);
1427 n_used_mmu_pages--; 1448 used_pages--;
1428 } 1449 }
1429 kvm->arch.n_free_mmu_pages = 0; 1450 kvm->arch.n_free_mmu_pages = 0;
1430 } 1451 }
@@ -1740,6 +1761,7 @@ static void mmu_set_spte(struct kvm_vcpu *vcpu, u64 *shadow_pte,
1740{ 1761{
1741 int was_rmapped = 0; 1762 int was_rmapped = 0;
1742 int was_writeble = is_writeble_pte(*shadow_pte); 1763 int was_writeble = is_writeble_pte(*shadow_pte);
1764 int rmap_count;
1743 1765
1744 pgprintk("%s: spte %llx access %x write_fault %d" 1766 pgprintk("%s: spte %llx access %x write_fault %d"
1745 " user_fault %d gfn %lx\n", 1767 " user_fault %d gfn %lx\n",
@@ -1781,9 +1803,11 @@ static void mmu_set_spte(struct kvm_vcpu *vcpu, u64 *shadow_pte,
1781 1803
1782 page_header_update_slot(vcpu->kvm, shadow_pte, gfn); 1804 page_header_update_slot(vcpu->kvm, shadow_pte, gfn);
1783 if (!was_rmapped) { 1805 if (!was_rmapped) {
1784 rmap_add(vcpu, shadow_pte, gfn, largepage); 1806 rmap_count = rmap_add(vcpu, shadow_pte, gfn, largepage);
1785 if (!is_rmap_pte(*shadow_pte)) 1807 if (!is_rmap_pte(*shadow_pte))
1786 kvm_release_pfn_clean(pfn); 1808 kvm_release_pfn_clean(pfn);
1809 if (rmap_count > RMAP_RECYCLE_THRESHOLD)
1810 rmap_recycle(vcpu, gfn, largepage);
1787 } else { 1811 } else {
1788 if (was_writeble) 1812 if (was_writeble)
1789 kvm_release_pfn_dirty(pfn); 1813 kvm_release_pfn_dirty(pfn);
@@ -2157,7 +2181,7 @@ static void reset_rsvds_bits_mask(struct kvm_vcpu *vcpu, int level)
2157 else 2181 else
2158 /* 32 bits PSE 4MB page */ 2182 /* 32 bits PSE 4MB page */
2159 context->rsvd_bits_mask[1][1] = rsvd_bits(13, 21); 2183 context->rsvd_bits_mask[1][1] = rsvd_bits(13, 21);
2160 context->rsvd_bits_mask[1][0] = ~0ull; 2184 context->rsvd_bits_mask[1][0] = context->rsvd_bits_mask[1][0];
2161 break; 2185 break;
2162 case PT32E_ROOT_LEVEL: 2186 case PT32E_ROOT_LEVEL:
2163 context->rsvd_bits_mask[0][2] = 2187 context->rsvd_bits_mask[0][2] =
@@ -2170,7 +2194,7 @@ static void reset_rsvds_bits_mask(struct kvm_vcpu *vcpu, int level)
2170 context->rsvd_bits_mask[1][1] = exb_bit_rsvd | 2194 context->rsvd_bits_mask[1][1] = exb_bit_rsvd |
2171 rsvd_bits(maxphyaddr, 62) | 2195 rsvd_bits(maxphyaddr, 62) |
2172 rsvd_bits(13, 20); /* large page */ 2196 rsvd_bits(13, 20); /* large page */
2173 context->rsvd_bits_mask[1][0] = ~0ull; 2197 context->rsvd_bits_mask[1][0] = context->rsvd_bits_mask[1][0];
2174 break; 2198 break;
2175 case PT64_ROOT_LEVEL: 2199 case PT64_ROOT_LEVEL:
2176 context->rsvd_bits_mask[0][3] = exb_bit_rsvd | 2200 context->rsvd_bits_mask[0][3] = exb_bit_rsvd |
@@ -2186,7 +2210,7 @@ static void reset_rsvds_bits_mask(struct kvm_vcpu *vcpu, int level)
2186 context->rsvd_bits_mask[1][1] = exb_bit_rsvd | 2210 context->rsvd_bits_mask[1][1] = exb_bit_rsvd |
2187 rsvd_bits(maxphyaddr, 51) | 2211 rsvd_bits(maxphyaddr, 51) |
2188 rsvd_bits(13, 20); /* large page */ 2212 rsvd_bits(13, 20); /* large page */
2189 context->rsvd_bits_mask[1][0] = ~0ull; 2213 context->rsvd_bits_mask[1][0] = context->rsvd_bits_mask[1][0];
2190 break; 2214 break;
2191 } 2215 }
2192} 2216}
diff --git a/arch/x86/kvm/paging_tmpl.h b/arch/x86/kvm/paging_tmpl.h
index 258e4591e1ca..67785f635399 100644
--- a/arch/x86/kvm/paging_tmpl.h
+++ b/arch/x86/kvm/paging_tmpl.h
@@ -281,7 +281,7 @@ static u64 *FNAME(fetch)(struct kvm_vcpu *vcpu, gva_t addr,
281{ 281{
282 unsigned access = gw->pt_access; 282 unsigned access = gw->pt_access;
283 struct kvm_mmu_page *shadow_page; 283 struct kvm_mmu_page *shadow_page;
284 u64 spte, *sptep; 284 u64 spte, *sptep = NULL;
285 int direct; 285 int direct;
286 gfn_t table_gfn; 286 gfn_t table_gfn;
287 int r; 287 int r;
diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c
index 71510e07e69e..b1f658ad2f06 100644
--- a/arch/x86/kvm/svm.c
+++ b/arch/x86/kvm/svm.c
@@ -711,6 +711,7 @@ static void svm_vcpu_load(struct kvm_vcpu *vcpu, int cpu)
711 svm->vmcb->control.tsc_offset += delta; 711 svm->vmcb->control.tsc_offset += delta;
712 vcpu->cpu = cpu; 712 vcpu->cpu = cpu;
713 kvm_migrate_timers(vcpu); 713 kvm_migrate_timers(vcpu);
714 svm->asid_generation = 0;
714 } 715 }
715 716
716 for (i = 0; i < NR_HOST_SAVE_USER_MSRS; i++) 717 for (i = 0; i < NR_HOST_SAVE_USER_MSRS; i++)
@@ -1031,7 +1032,6 @@ static void new_asid(struct vcpu_svm *svm, struct svm_cpu_data *svm_data)
1031 svm->vmcb->control.tlb_ctl = TLB_CONTROL_FLUSH_ALL_ASID; 1032 svm->vmcb->control.tlb_ctl = TLB_CONTROL_FLUSH_ALL_ASID;
1032 } 1033 }
1033 1034
1034 svm->vcpu.cpu = svm_data->cpu;
1035 svm->asid_generation = svm_data->asid_generation; 1035 svm->asid_generation = svm_data->asid_generation;
1036 svm->vmcb->control.asid = svm_data->next_asid++; 1036 svm->vmcb->control.asid = svm_data->next_asid++;
1037} 1037}
@@ -2300,8 +2300,8 @@ static void pre_svm_run(struct vcpu_svm *svm)
2300 struct svm_cpu_data *svm_data = per_cpu(svm_data, cpu); 2300 struct svm_cpu_data *svm_data = per_cpu(svm_data, cpu);
2301 2301
2302 svm->vmcb->control.tlb_ctl = TLB_CONTROL_DO_NOTHING; 2302 svm->vmcb->control.tlb_ctl = TLB_CONTROL_DO_NOTHING;
2303 if (svm->vcpu.cpu != cpu || 2303 /* FIXME: handle wraparound of asid_generation */
2304 svm->asid_generation != svm_data->asid_generation) 2304 if (svm->asid_generation != svm_data->asid_generation)
2305 new_asid(svm, svm_data); 2305 new_asid(svm, svm_data);
2306} 2306}
2307 2307
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
index e770bf349ec4..29f912927a58 100644
--- a/arch/x86/kvm/vmx.c
+++ b/arch/x86/kvm/vmx.c
@@ -3012,6 +3012,12 @@ static int handle_vmcall(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run)
3012 return 1; 3012 return 1;
3013} 3013}
3014 3014
3015static int handle_vmx_insn(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run)
3016{
3017 kvm_queue_exception(vcpu, UD_VECTOR);
3018 return 1;
3019}
3020
3015static int handle_invlpg(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run) 3021static int handle_invlpg(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run)
3016{ 3022{
3017 unsigned long exit_qualification = vmcs_readl(EXIT_QUALIFICATION); 3023 unsigned long exit_qualification = vmcs_readl(EXIT_QUALIFICATION);
@@ -3151,8 +3157,8 @@ static void handle_invalid_guest_state(struct kvm_vcpu *vcpu,
3151 struct vcpu_vmx *vmx = to_vmx(vcpu); 3157 struct vcpu_vmx *vmx = to_vmx(vcpu);
3152 enum emulation_result err = EMULATE_DONE; 3158 enum emulation_result err = EMULATE_DONE;
3153 3159
3154 preempt_enable();
3155 local_irq_enable(); 3160 local_irq_enable();
3161 preempt_enable();
3156 3162
3157 while (!guest_state_valid(vcpu)) { 3163 while (!guest_state_valid(vcpu)) {
3158 err = emulate_instruction(vcpu, kvm_run, 0, 0, 0); 3164 err = emulate_instruction(vcpu, kvm_run, 0, 0, 0);
@@ -3162,7 +3168,7 @@ static void handle_invalid_guest_state(struct kvm_vcpu *vcpu,
3162 3168
3163 if (err != EMULATE_DONE) { 3169 if (err != EMULATE_DONE) {
3164 kvm_report_emulation_failure(vcpu, "emulation failure"); 3170 kvm_report_emulation_failure(vcpu, "emulation failure");
3165 return; 3171 break;
3166 } 3172 }
3167 3173
3168 if (signal_pending(current)) 3174 if (signal_pending(current))
@@ -3171,8 +3177,8 @@ static void handle_invalid_guest_state(struct kvm_vcpu *vcpu,
3171 schedule(); 3177 schedule();
3172 } 3178 }
3173 3179
3174 local_irq_disable();
3175 preempt_disable(); 3180 preempt_disable();
3181 local_irq_disable();
3176 3182
3177 vmx->invalid_state_emulation_result = err; 3183 vmx->invalid_state_emulation_result = err;
3178} 3184}
@@ -3198,6 +3204,15 @@ static int (*kvm_vmx_exit_handlers[])(struct kvm_vcpu *vcpu,
3198 [EXIT_REASON_HLT] = handle_halt, 3204 [EXIT_REASON_HLT] = handle_halt,
3199 [EXIT_REASON_INVLPG] = handle_invlpg, 3205 [EXIT_REASON_INVLPG] = handle_invlpg,
3200 [EXIT_REASON_VMCALL] = handle_vmcall, 3206 [EXIT_REASON_VMCALL] = handle_vmcall,
3207 [EXIT_REASON_VMCLEAR] = handle_vmx_insn,
3208 [EXIT_REASON_VMLAUNCH] = handle_vmx_insn,
3209 [EXIT_REASON_VMPTRLD] = handle_vmx_insn,
3210 [EXIT_REASON_VMPTRST] = handle_vmx_insn,
3211 [EXIT_REASON_VMREAD] = handle_vmx_insn,
3212 [EXIT_REASON_VMRESUME] = handle_vmx_insn,
3213 [EXIT_REASON_VMWRITE] = handle_vmx_insn,
3214 [EXIT_REASON_VMOFF] = handle_vmx_insn,
3215 [EXIT_REASON_VMON] = handle_vmx_insn,
3201 [EXIT_REASON_TPR_BELOW_THRESHOLD] = handle_tpr_below_threshold, 3216 [EXIT_REASON_TPR_BELOW_THRESHOLD] = handle_tpr_below_threshold,
3202 [EXIT_REASON_APIC_ACCESS] = handle_apic_access, 3217 [EXIT_REASON_APIC_ACCESS] = handle_apic_access,
3203 [EXIT_REASON_WBINVD] = handle_wbinvd, 3218 [EXIT_REASON_WBINVD] = handle_wbinvd,
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index 249540f98513..3d4529011828 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -704,11 +704,48 @@ static bool msr_mtrr_valid(unsigned msr)
704 return false; 704 return false;
705} 705}
706 706
707static bool valid_pat_type(unsigned t)
708{
709 return t < 8 && (1 << t) & 0xf3; /* 0, 1, 4, 5, 6, 7 */
710}
711
712static bool valid_mtrr_type(unsigned t)
713{
714 return t < 8 && (1 << t) & 0x73; /* 0, 1, 4, 5, 6 */
715}
716
717static bool mtrr_valid(struct kvm_vcpu *vcpu, u32 msr, u64 data)
718{
719 int i;
720
721 if (!msr_mtrr_valid(msr))
722 return false;
723
724 if (msr == MSR_IA32_CR_PAT) {
725 for (i = 0; i < 8; i++)
726 if (!valid_pat_type((data >> (i * 8)) & 0xff))
727 return false;
728 return true;
729 } else if (msr == MSR_MTRRdefType) {
730 if (data & ~0xcff)
731 return false;
732 return valid_mtrr_type(data & 0xff);
733 } else if (msr >= MSR_MTRRfix64K_00000 && msr <= MSR_MTRRfix4K_F8000) {
734 for (i = 0; i < 8 ; i++)
735 if (!valid_mtrr_type((data >> (i * 8)) & 0xff))
736 return false;
737 return true;
738 }
739
740 /* variable MTRRs */
741 return valid_mtrr_type(data & 0xff);
742}
743
707static int set_msr_mtrr(struct kvm_vcpu *vcpu, u32 msr, u64 data) 744static int set_msr_mtrr(struct kvm_vcpu *vcpu, u32 msr, u64 data)
708{ 745{
709 u64 *p = (u64 *)&vcpu->arch.mtrr_state.fixed_ranges; 746 u64 *p = (u64 *)&vcpu->arch.mtrr_state.fixed_ranges;
710 747
711 if (!msr_mtrr_valid(msr)) 748 if (!mtrr_valid(vcpu, msr, data))
712 return 1; 749 return 1;
713 750
714 if (msr == MSR_MTRRdefType) { 751 if (msr == MSR_MTRRdefType) {
@@ -898,6 +935,7 @@ int kvm_get_msr_common(struct kvm_vcpu *vcpu, u32 msr, u64 *pdata)
898 case MSR_VM_HSAVE_PA: 935 case MSR_VM_HSAVE_PA:
899 case MSR_P6_EVNTSEL0: 936 case MSR_P6_EVNTSEL0:
900 case MSR_P6_EVNTSEL1: 937 case MSR_P6_EVNTSEL1:
938 case MSR_K7_EVNTSEL0:
901 data = 0; 939 data = 0;
902 break; 940 break;
903 case MSR_MTRRcap: 941 case MSR_MTRRcap:
@@ -1078,14 +1116,13 @@ long kvm_arch_dev_ioctl(struct file *filp,
1078 if (copy_to_user(user_msr_list, &msr_list, sizeof msr_list)) 1116 if (copy_to_user(user_msr_list, &msr_list, sizeof msr_list))
1079 goto out; 1117 goto out;
1080 r = -E2BIG; 1118 r = -E2BIG;
1081 if (n < num_msrs_to_save) 1119 if (n < msr_list.nmsrs)
1082 goto out; 1120 goto out;
1083 r = -EFAULT; 1121 r = -EFAULT;
1084 if (copy_to_user(user_msr_list->indices, &msrs_to_save, 1122 if (copy_to_user(user_msr_list->indices, &msrs_to_save,
1085 num_msrs_to_save * sizeof(u32))) 1123 num_msrs_to_save * sizeof(u32)))
1086 goto out; 1124 goto out;
1087 if (copy_to_user(user_msr_list->indices 1125 if (copy_to_user(user_msr_list->indices + num_msrs_to_save,
1088 + num_msrs_to_save * sizeof(u32),
1089 &emulated_msrs, 1126 &emulated_msrs,
1090 ARRAY_SIZE(emulated_msrs) * sizeof(u32))) 1127 ARRAY_SIZE(emulated_msrs) * sizeof(u32)))
1091 goto out; 1128 goto out;
diff --git a/arch/x86/kvm/x86_emulate.c b/arch/x86/kvm/x86_emulate.c
index c1b6c232e02b..616de4628d60 100644
--- a/arch/x86/kvm/x86_emulate.c
+++ b/arch/x86/kvm/x86_emulate.c
@@ -1361,7 +1361,7 @@ static inline int writeback(struct x86_emulate_ctxt *ctxt,
1361 return 0; 1361 return 0;
1362} 1362}
1363 1363
1364void toggle_interruptibility(struct x86_emulate_ctxt *ctxt, u32 mask) 1364static void toggle_interruptibility(struct x86_emulate_ctxt *ctxt, u32 mask)
1365{ 1365{
1366 u32 int_shadow = kvm_x86_ops->get_interrupt_shadow(ctxt->vcpu, mask); 1366 u32 int_shadow = kvm_x86_ops->get_interrupt_shadow(ctxt->vcpu, mask);
1367 /* 1367 /*
diff --git a/arch/x86/lguest/boot.c b/arch/x86/lguest/boot.c
index 7bc65f0f62c4..d677fa9ca650 100644
--- a/arch/x86/lguest/boot.c
+++ b/arch/x86/lguest/boot.c
@@ -22,7 +22,8 @@
22 * 22 *
23 * So how does the kernel know it's a Guest? We'll see that later, but let's 23 * So how does the kernel know it's a Guest? We'll see that later, but let's
24 * just say that we end up here where we replace the native functions various 24 * just say that we end up here where we replace the native functions various
25 * "paravirt" structures with our Guest versions, then boot like normal. :*/ 25 * "paravirt" structures with our Guest versions, then boot like normal.
26:*/
26 27
27/* 28/*
28 * Copyright (C) 2006, Rusty Russell <rusty@rustcorp.com.au> IBM Corporation. 29 * Copyright (C) 2006, Rusty Russell <rusty@rustcorp.com.au> IBM Corporation.
@@ -74,7 +75,8 @@
74 * 75 *
75 * The Guest in our tale is a simple creature: identical to the Host but 76 * The Guest in our tale is a simple creature: identical to the Host but
76 * behaving in simplified but equivalent ways. In particular, the Guest is the 77 * behaving in simplified but equivalent ways. In particular, the Guest is the
77 * same kernel as the Host (or at least, built from the same source code). :*/ 78 * same kernel as the Host (or at least, built from the same source code).
79:*/
78 80
79struct lguest_data lguest_data = { 81struct lguest_data lguest_data = {
80 .hcall_status = { [0 ... LHCALL_RING_SIZE-1] = 0xFF }, 82 .hcall_status = { [0 ... LHCALL_RING_SIZE-1] = 0xFF },
@@ -85,7 +87,8 @@ struct lguest_data lguest_data = {
85 .syscall_vec = SYSCALL_VECTOR, 87 .syscall_vec = SYSCALL_VECTOR,
86}; 88};
87 89
88/*G:037 async_hcall() is pretty simple: I'm quite proud of it really. We have a 90/*G:037
91 * async_hcall() is pretty simple: I'm quite proud of it really. We have a
89 * ring buffer of stored hypercalls which the Host will run though next time we 92 * ring buffer of stored hypercalls which the Host will run though next time we
90 * do a normal hypercall. Each entry in the ring has 5 slots for the hypercall 93 * do a normal hypercall. Each entry in the ring has 5 slots for the hypercall
91 * arguments, and a "hcall_status" word which is 0 if the call is ready to go, 94 * arguments, and a "hcall_status" word which is 0 if the call is ready to go,
@@ -94,7 +97,8 @@ struct lguest_data lguest_data = {
94 * If we come around to a slot which hasn't been finished, then the table is 97 * If we come around to a slot which hasn't been finished, then the table is
95 * full and we just make the hypercall directly. This has the nice side 98 * full and we just make the hypercall directly. This has the nice side
96 * effect of causing the Host to run all the stored calls in the ring buffer 99 * effect of causing the Host to run all the stored calls in the ring buffer
97 * which empties it for next time! */ 100 * which empties it for next time!
101 */
98static void async_hcall(unsigned long call, unsigned long arg1, 102static void async_hcall(unsigned long call, unsigned long arg1,
99 unsigned long arg2, unsigned long arg3, 103 unsigned long arg2, unsigned long arg3,
100 unsigned long arg4) 104 unsigned long arg4)
@@ -103,9 +107,11 @@ static void async_hcall(unsigned long call, unsigned long arg1,
103 static unsigned int next_call; 107 static unsigned int next_call;
104 unsigned long flags; 108 unsigned long flags;
105 109
106 /* Disable interrupts if not already disabled: we don't want an 110 /*
111 * Disable interrupts if not already disabled: we don't want an
107 * interrupt handler making a hypercall while we're already doing 112 * interrupt handler making a hypercall while we're already doing
108 * one! */ 113 * one!
114 */
109 local_irq_save(flags); 115 local_irq_save(flags);
110 if (lguest_data.hcall_status[next_call] != 0xFF) { 116 if (lguest_data.hcall_status[next_call] != 0xFF) {
111 /* Table full, so do normal hcall which will flush table. */ 117 /* Table full, so do normal hcall which will flush table. */
@@ -125,8 +131,9 @@ static void async_hcall(unsigned long call, unsigned long arg1,
125 local_irq_restore(flags); 131 local_irq_restore(flags);
126} 132}
127 133
128/*G:035 Notice the lazy_hcall() above, rather than hcall(). This is our first 134/*G:035
129 * real optimization trick! 135 * Notice the lazy_hcall() above, rather than hcall(). This is our first real
136 * optimization trick!
130 * 137 *
131 * When lazy_mode is set, it means we're allowed to defer all hypercalls and do 138 * When lazy_mode is set, it means we're allowed to defer all hypercalls and do
132 * them as a batch when lazy_mode is eventually turned off. Because hypercalls 139 * them as a batch when lazy_mode is eventually turned off. Because hypercalls
@@ -136,7 +143,8 @@ static void async_hcall(unsigned long call, unsigned long arg1,
136 * lguest_leave_lazy_mode(). 143 * lguest_leave_lazy_mode().
137 * 144 *
138 * So, when we're in lazy mode, we call async_hcall() to store the call for 145 * So, when we're in lazy mode, we call async_hcall() to store the call for
139 * future processing: */ 146 * future processing:
147 */
140static void lazy_hcall1(unsigned long call, 148static void lazy_hcall1(unsigned long call,
141 unsigned long arg1) 149 unsigned long arg1)
142{ 150{
@@ -146,6 +154,7 @@ static void lazy_hcall1(unsigned long call,
146 async_hcall(call, arg1, 0, 0, 0); 154 async_hcall(call, arg1, 0, 0, 0);
147} 155}
148 156
157/* You can imagine what lazy_hcall2, 3 and 4 look like. :*/
149static void lazy_hcall2(unsigned long call, 158static void lazy_hcall2(unsigned long call,
150 unsigned long arg1, 159 unsigned long arg1,
151 unsigned long arg2) 160 unsigned long arg2)
@@ -181,8 +190,10 @@ static void lazy_hcall4(unsigned long call,
181} 190}
182#endif 191#endif
183 192
184/* When lazy mode is turned off reset the per-cpu lazy mode variable and then 193/*G:036
185 * issue the do-nothing hypercall to flush any stored calls. */ 194 * When lazy mode is turned off reset the per-cpu lazy mode variable and then
195 * issue the do-nothing hypercall to flush any stored calls.
196:*/
186static void lguest_leave_lazy_mmu_mode(void) 197static void lguest_leave_lazy_mmu_mode(void)
187{ 198{
188 kvm_hypercall0(LHCALL_FLUSH_ASYNC); 199 kvm_hypercall0(LHCALL_FLUSH_ASYNC);
@@ -208,9 +219,11 @@ static void lguest_end_context_switch(struct task_struct *next)
208 * check there before it tries to deliver an interrupt. 219 * check there before it tries to deliver an interrupt.
209 */ 220 */
210 221
211/* save_flags() is expected to return the processor state (ie. "flags"). The 222/*
223 * save_flags() is expected to return the processor state (ie. "flags"). The
212 * flags word contains all kind of stuff, but in practice Linux only cares 224 * flags word contains all kind of stuff, but in practice Linux only cares
213 * about the interrupt flag. Our "save_flags()" just returns that. */ 225 * about the interrupt flag. Our "save_flags()" just returns that.
226 */
214static unsigned long save_fl(void) 227static unsigned long save_fl(void)
215{ 228{
216 return lguest_data.irq_enabled; 229 return lguest_data.irq_enabled;
@@ -222,13 +235,15 @@ static void irq_disable(void)
222 lguest_data.irq_enabled = 0; 235 lguest_data.irq_enabled = 0;
223} 236}
224 237
225/* Let's pause a moment. Remember how I said these are called so often? 238/*
239 * Let's pause a moment. Remember how I said these are called so often?
226 * Jeremy Fitzhardinge optimized them so hard early in 2009 that he had to 240 * Jeremy Fitzhardinge optimized them so hard early in 2009 that he had to
227 * break some rules. In particular, these functions are assumed to save their 241 * break some rules. In particular, these functions are assumed to save their
228 * own registers if they need to: normal C functions assume they can trash the 242 * own registers if they need to: normal C functions assume they can trash the
229 * eax register. To use normal C functions, we use 243 * eax register. To use normal C functions, we use
230 * PV_CALLEE_SAVE_REGS_THUNK(), which pushes %eax onto the stack, calls the 244 * PV_CALLEE_SAVE_REGS_THUNK(), which pushes %eax onto the stack, calls the
231 * C function, then restores it. */ 245 * C function, then restores it.
246 */
232PV_CALLEE_SAVE_REGS_THUNK(save_fl); 247PV_CALLEE_SAVE_REGS_THUNK(save_fl);
233PV_CALLEE_SAVE_REGS_THUNK(irq_disable); 248PV_CALLEE_SAVE_REGS_THUNK(irq_disable);
234/*:*/ 249/*:*/
@@ -237,18 +252,18 @@ PV_CALLEE_SAVE_REGS_THUNK(irq_disable);
237extern void lg_irq_enable(void); 252extern void lg_irq_enable(void);
238extern void lg_restore_fl(unsigned long flags); 253extern void lg_restore_fl(unsigned long flags);
239 254
240/*M:003 Note that we don't check for outstanding interrupts when we re-enable 255/*M:003
241 * them (or when we unmask an interrupt). This seems to work for the moment, 256 * We could be more efficient in our checking of outstanding interrupts, rather
242 * since interrupts are rare and we'll just get the interrupt on the next timer 257 * than using a branch. One way would be to put the "irq_enabled" field in a
243 * tick, but now we can run with CONFIG_NO_HZ, we should revisit this. One way 258 * page by itself, and have the Host write-protect it when an interrupt comes
244 * would be to put the "irq_enabled" field in a page by itself, and have the 259 * in when irqs are disabled. There will then be a page fault as soon as
245 * Host write-protect it when an interrupt comes in when irqs are disabled. 260 * interrupts are re-enabled.
246 * There will then be a page fault as soon as interrupts are re-enabled.
247 * 261 *
248 * A better method is to implement soft interrupt disable generally for x86: 262 * A better method is to implement soft interrupt disable generally for x86:
249 * instead of disabling interrupts, we set a flag. If an interrupt does come 263 * instead of disabling interrupts, we set a flag. If an interrupt does come
250 * in, we then disable them for real. This is uncommon, so we could simply use 264 * in, we then disable them for real. This is uncommon, so we could simply use
251 * a hypercall for interrupt control and not worry about efficiency. :*/ 265 * a hypercall for interrupt control and not worry about efficiency.
266:*/
252 267
253/*G:034 268/*G:034
254 * The Interrupt Descriptor Table (IDT). 269 * The Interrupt Descriptor Table (IDT).
@@ -261,10 +276,12 @@ extern void lg_restore_fl(unsigned long flags);
261static void lguest_write_idt_entry(gate_desc *dt, 276static void lguest_write_idt_entry(gate_desc *dt,
262 int entrynum, const gate_desc *g) 277 int entrynum, const gate_desc *g)
263{ 278{
264 /* The gate_desc structure is 8 bytes long: we hand it to the Host in 279 /*
280 * The gate_desc structure is 8 bytes long: we hand it to the Host in
265 * two 32-bit chunks. The whole 32-bit kernel used to hand descriptors 281 * two 32-bit chunks. The whole 32-bit kernel used to hand descriptors
266 * around like this; typesafety wasn't a big concern in Linux's early 282 * around like this; typesafety wasn't a big concern in Linux's early
267 * years. */ 283 * years.
284 */
268 u32 *desc = (u32 *)g; 285 u32 *desc = (u32 *)g;
269 /* Keep the local copy up to date. */ 286 /* Keep the local copy up to date. */
270 native_write_idt_entry(dt, entrynum, g); 287 native_write_idt_entry(dt, entrynum, g);
@@ -272,9 +289,11 @@ static void lguest_write_idt_entry(gate_desc *dt,
272 kvm_hypercall3(LHCALL_LOAD_IDT_ENTRY, entrynum, desc[0], desc[1]); 289 kvm_hypercall3(LHCALL_LOAD_IDT_ENTRY, entrynum, desc[0], desc[1]);
273} 290}
274 291
275/* Changing to a different IDT is very rare: we keep the IDT up-to-date every 292/*
293 * Changing to a different IDT is very rare: we keep the IDT up-to-date every
276 * time it is written, so we can simply loop through all entries and tell the 294 * time it is written, so we can simply loop through all entries and tell the
277 * Host about them. */ 295 * Host about them.
296 */
278static void lguest_load_idt(const struct desc_ptr *desc) 297static void lguest_load_idt(const struct desc_ptr *desc)
279{ 298{
280 unsigned int i; 299 unsigned int i;
@@ -305,9 +324,11 @@ static void lguest_load_gdt(const struct desc_ptr *desc)
305 kvm_hypercall3(LHCALL_LOAD_GDT_ENTRY, i, gdt[i].a, gdt[i].b); 324 kvm_hypercall3(LHCALL_LOAD_GDT_ENTRY, i, gdt[i].a, gdt[i].b);
306} 325}
307 326
308/* For a single GDT entry which changes, we do the lazy thing: alter our GDT, 327/*
328 * For a single GDT entry which changes, we do the lazy thing: alter our GDT,
309 * then tell the Host to reload the entire thing. This operation is so rare 329 * then tell the Host to reload the entire thing. This operation is so rare
310 * that this naive implementation is reasonable. */ 330 * that this naive implementation is reasonable.
331 */
311static void lguest_write_gdt_entry(struct desc_struct *dt, int entrynum, 332static void lguest_write_gdt_entry(struct desc_struct *dt, int entrynum,
312 const void *desc, int type) 333 const void *desc, int type)
313{ 334{
@@ -317,29 +338,36 @@ static void lguest_write_gdt_entry(struct desc_struct *dt, int entrynum,
317 dt[entrynum].a, dt[entrynum].b); 338 dt[entrynum].a, dt[entrynum].b);
318} 339}
319 340
320/* OK, I lied. There are three "thread local storage" GDT entries which change 341/*
342 * OK, I lied. There are three "thread local storage" GDT entries which change
321 * on every context switch (these three entries are how glibc implements 343 * on every context switch (these three entries are how glibc implements
322 * __thread variables). So we have a hypercall specifically for this case. */ 344 * __thread variables). So we have a hypercall specifically for this case.
345 */
323static void lguest_load_tls(struct thread_struct *t, unsigned int cpu) 346static void lguest_load_tls(struct thread_struct *t, unsigned int cpu)
324{ 347{
325 /* There's one problem which normal hardware doesn't have: the Host 348 /*
349 * There's one problem which normal hardware doesn't have: the Host
326 * can't handle us removing entries we're currently using. So we clear 350 * can't handle us removing entries we're currently using. So we clear
327 * the GS register here: if it's needed it'll be reloaded anyway. */ 351 * the GS register here: if it's needed it'll be reloaded anyway.
352 */
328 lazy_load_gs(0); 353 lazy_load_gs(0);
329 lazy_hcall2(LHCALL_LOAD_TLS, __pa(&t->tls_array), cpu); 354 lazy_hcall2(LHCALL_LOAD_TLS, __pa(&t->tls_array), cpu);
330} 355}
331 356
332/*G:038 That's enough excitement for now, back to ploughing through each of 357/*G:038
333 * the different pv_ops structures (we're about 1/3 of the way through). 358 * That's enough excitement for now, back to ploughing through each of the
359 * different pv_ops structures (we're about 1/3 of the way through).
334 * 360 *
335 * This is the Local Descriptor Table, another weird Intel thingy. Linux only 361 * This is the Local Descriptor Table, another weird Intel thingy. Linux only
336 * uses this for some strange applications like Wine. We don't do anything 362 * uses this for some strange applications like Wine. We don't do anything
337 * here, so they'll get an informative and friendly Segmentation Fault. */ 363 * here, so they'll get an informative and friendly Segmentation Fault.
364 */
338static void lguest_set_ldt(const void *addr, unsigned entries) 365static void lguest_set_ldt(const void *addr, unsigned entries)
339{ 366{
340} 367}
341 368
342/* This loads a GDT entry into the "Task Register": that entry points to a 369/*
370 * This loads a GDT entry into the "Task Register": that entry points to a
343 * structure called the Task State Segment. Some comments scattered though the 371 * structure called the Task State Segment. Some comments scattered though the
344 * kernel code indicate that this used for task switching in ages past, along 372 * kernel code indicate that this used for task switching in ages past, along
345 * with blood sacrifice and astrology. 373 * with blood sacrifice and astrology.
@@ -347,19 +375,21 @@ static void lguest_set_ldt(const void *addr, unsigned entries)
347 * Now there's nothing interesting in here that we don't get told elsewhere. 375 * Now there's nothing interesting in here that we don't get told elsewhere.
348 * But the native version uses the "ltr" instruction, which makes the Host 376 * But the native version uses the "ltr" instruction, which makes the Host
349 * complain to the Guest about a Segmentation Fault and it'll oops. So we 377 * complain to the Guest about a Segmentation Fault and it'll oops. So we
350 * override the native version with a do-nothing version. */ 378 * override the native version with a do-nothing version.
379 */
351static void lguest_load_tr_desc(void) 380static void lguest_load_tr_desc(void)
352{ 381{
353} 382}
354 383
355/* The "cpuid" instruction is a way of querying both the CPU identity 384/*
385 * The "cpuid" instruction is a way of querying both the CPU identity
356 * (manufacturer, model, etc) and its features. It was introduced before the 386 * (manufacturer, model, etc) and its features. It was introduced before the
357 * Pentium in 1993 and keeps getting extended by both Intel, AMD and others. 387 * Pentium in 1993 and keeps getting extended by both Intel, AMD and others.
358 * As you might imagine, after a decade and a half this treatment, it is now a 388 * As you might imagine, after a decade and a half this treatment, it is now a
359 * giant ball of hair. Its entry in the current Intel manual runs to 28 pages. 389 * giant ball of hair. Its entry in the current Intel manual runs to 28 pages.
360 * 390 *
361 * This instruction even it has its own Wikipedia entry. The Wikipedia entry 391 * This instruction even it has its own Wikipedia entry. The Wikipedia entry
362 * has been translated into 4 languages. I am not making this up! 392 * has been translated into 5 languages. I am not making this up!
363 * 393 *
364 * We could get funky here and identify ourselves as "GenuineLguest", but 394 * We could get funky here and identify ourselves as "GenuineLguest", but
365 * instead we just use the real "cpuid" instruction. Then I pretty much turned 395 * instead we just use the real "cpuid" instruction. Then I pretty much turned
@@ -371,7 +401,8 @@ static void lguest_load_tr_desc(void)
371 * Replacing the cpuid so we can turn features off is great for the kernel, but 401 * Replacing the cpuid so we can turn features off is great for the kernel, but
372 * anyone (including userspace) can just use the raw "cpuid" instruction and 402 * anyone (including userspace) can just use the raw "cpuid" instruction and
373 * the Host won't even notice since it isn't privileged. So we try not to get 403 * the Host won't even notice since it isn't privileged. So we try not to get
374 * too worked up about it. */ 404 * too worked up about it.
405 */
375static void lguest_cpuid(unsigned int *ax, unsigned int *bx, 406static void lguest_cpuid(unsigned int *ax, unsigned int *bx,
376 unsigned int *cx, unsigned int *dx) 407 unsigned int *cx, unsigned int *dx)
377{ 408{
@@ -379,38 +410,63 @@ static void lguest_cpuid(unsigned int *ax, unsigned int *bx,
379 410
380 native_cpuid(ax, bx, cx, dx); 411 native_cpuid(ax, bx, cx, dx);
381 switch (function) { 412 switch (function) {
382 case 1: /* Basic feature request. */ 413 /*
383 /* We only allow kernel to see SSE3, CMPXCHG16B and SSSE3 */ 414 * CPUID 0 gives the highest legal CPUID number (and the ID string).
415 * We futureproof our code a little by sticking to known CPUID values.
416 */
417 case 0:
418 if (*ax > 5)
419 *ax = 5;
420 break;
421
422 /*
423 * CPUID 1 is a basic feature request.
424 *
425 * CX: we only allow kernel to see SSE3, CMPXCHG16B and SSSE3
426 * DX: SSE, SSE2, FXSR, MMX, CMOV, CMPXCHG8B, TSC, FPU and PAE.
427 */
428 case 1:
384 *cx &= 0x00002201; 429 *cx &= 0x00002201;
385 /* SSE, SSE2, FXSR, MMX, CMOV, CMPXCHG8B, TSC, FPU, PAE. */
386 *dx &= 0x07808151; 430 *dx &= 0x07808151;
387 /* The Host can do a nice optimization if it knows that the 431 /*
432 * The Host can do a nice optimization if it knows that the
388 * kernel mappings (addresses above 0xC0000000 or whatever 433 * kernel mappings (addresses above 0xC0000000 or whatever
389 * PAGE_OFFSET is set to) haven't changed. But Linux calls 434 * PAGE_OFFSET is set to) haven't changed. But Linux calls
390 * flush_tlb_user() for both user and kernel mappings unless 435 * flush_tlb_user() for both user and kernel mappings unless
391 * the Page Global Enable (PGE) feature bit is set. */ 436 * the Page Global Enable (PGE) feature bit is set.
437 */
392 *dx |= 0x00002000; 438 *dx |= 0x00002000;
393 /* We also lie, and say we're family id 5. 6 or greater 439 /*
440 * We also lie, and say we're family id 5. 6 or greater
394 * leads to a rdmsr in early_init_intel which we can't handle. 441 * leads to a rdmsr in early_init_intel which we can't handle.
395 * Family ID is returned as bits 8-12 in ax. */ 442 * Family ID is returned as bits 8-12 in ax.
443 */
396 *ax &= 0xFFFFF0FF; 444 *ax &= 0xFFFFF0FF;
397 *ax |= 0x00000500; 445 *ax |= 0x00000500;
398 break; 446 break;
447 /*
448 * 0x80000000 returns the highest Extended Function, so we futureproof
449 * like we do above by limiting it to known fields.
450 */
399 case 0x80000000: 451 case 0x80000000:
400 /* Futureproof this a little: if they ask how much extended
401 * processor information there is, limit it to known fields. */
402 if (*ax > 0x80000008) 452 if (*ax > 0x80000008)
403 *ax = 0x80000008; 453 *ax = 0x80000008;
404 break; 454 break;
455
456 /*
457 * PAE systems can mark pages as non-executable. Linux calls this the
458 * NX bit. Intel calls it XD (eXecute Disable), AMD EVP (Enhanced
459 * Virus Protection). We just switch turn if off here, since we don't
460 * support it.
461 */
405 case 0x80000001: 462 case 0x80000001:
406 /* Here we should fix nx cap depending on host. */
407 /* For this version of PAE, we just clear NX bit. */
408 *dx &= ~(1 << 20); 463 *dx &= ~(1 << 20);
409 break; 464 break;
410 } 465 }
411} 466}
412 467
413/* Intel has four control registers, imaginatively named cr0, cr2, cr3 and cr4. 468/*
469 * Intel has four control registers, imaginatively named cr0, cr2, cr3 and cr4.
414 * I assume there's a cr1, but it hasn't bothered us yet, so we'll not bother 470 * I assume there's a cr1, but it hasn't bothered us yet, so we'll not bother
415 * it. The Host needs to know when the Guest wants to change them, so we have 471 * it. The Host needs to know when the Guest wants to change them, so we have
416 * a whole series of functions like read_cr0() and write_cr0(). 472 * a whole series of functions like read_cr0() and write_cr0().
@@ -425,7 +481,8 @@ static void lguest_cpuid(unsigned int *ax, unsigned int *bx,
425 * name like "FPUTRAP bit" be a little less cryptic? 481 * name like "FPUTRAP bit" be a little less cryptic?
426 * 482 *
427 * We store cr0 locally because the Host never changes it. The Guest sometimes 483 * We store cr0 locally because the Host never changes it. The Guest sometimes
428 * wants to read it and we'd prefer not to bother the Host unnecessarily. */ 484 * wants to read it and we'd prefer not to bother the Host unnecessarily.
485 */
429static unsigned long current_cr0; 486static unsigned long current_cr0;
430static void lguest_write_cr0(unsigned long val) 487static void lguest_write_cr0(unsigned long val)
431{ 488{
@@ -438,18 +495,22 @@ static unsigned long lguest_read_cr0(void)
438 return current_cr0; 495 return current_cr0;
439} 496}
440 497
441/* Intel provided a special instruction to clear the TS bit for people too cool 498/*
499 * Intel provided a special instruction to clear the TS bit for people too cool
442 * to use write_cr0() to do it. This "clts" instruction is faster, because all 500 * to use write_cr0() to do it. This "clts" instruction is faster, because all
443 * the vowels have been optimized out. */ 501 * the vowels have been optimized out.
502 */
444static void lguest_clts(void) 503static void lguest_clts(void)
445{ 504{
446 lazy_hcall1(LHCALL_TS, 0); 505 lazy_hcall1(LHCALL_TS, 0);
447 current_cr0 &= ~X86_CR0_TS; 506 current_cr0 &= ~X86_CR0_TS;
448} 507}
449 508
450/* cr2 is the virtual address of the last page fault, which the Guest only ever 509/*
510 * cr2 is the virtual address of the last page fault, which the Guest only ever
451 * reads. The Host kindly writes this into our "struct lguest_data", so we 511 * reads. The Host kindly writes this into our "struct lguest_data", so we
452 * just read it out of there. */ 512 * just read it out of there.
513 */
453static unsigned long lguest_read_cr2(void) 514static unsigned long lguest_read_cr2(void)
454{ 515{
455 return lguest_data.cr2; 516 return lguest_data.cr2;
@@ -458,10 +519,12 @@ static unsigned long lguest_read_cr2(void)
458/* See lguest_set_pte() below. */ 519/* See lguest_set_pte() below. */
459static bool cr3_changed = false; 520static bool cr3_changed = false;
460 521
461/* cr3 is the current toplevel pagetable page: the principle is the same as 522/*
523 * cr3 is the current toplevel pagetable page: the principle is the same as
462 * cr0. Keep a local copy, and tell the Host when it changes. The only 524 * cr0. Keep a local copy, and tell the Host when it changes. The only
463 * difference is that our local copy is in lguest_data because the Host needs 525 * difference is that our local copy is in lguest_data because the Host needs
464 * to set it upon our initial hypercall. */ 526 * to set it upon our initial hypercall.
527 */
465static void lguest_write_cr3(unsigned long cr3) 528static void lguest_write_cr3(unsigned long cr3)
466{ 529{
467 lguest_data.pgdir = cr3; 530 lguest_data.pgdir = cr3;
@@ -506,7 +569,7 @@ static void lguest_write_cr4(unsigned long val)
506 * cr3 ---> +---------+ 569 * cr3 ---> +---------+
507 * | --------->+---------+ 570 * | --------->+---------+
508 * | | | PADDR1 | 571 * | | | PADDR1 |
509 * Top-level | | PADDR2 | 572 * Mid-level | | PADDR2 |
510 * (PMD) page | | | 573 * (PMD) page | | |
511 * | | Lower-level | 574 * | | Lower-level |
512 * | | (PTE) page | 575 * | | (PTE) page |
@@ -526,21 +589,62 @@ static void lguest_write_cr4(unsigned long val)
526 * Index into top Index into second Offset within page 589 * Index into top Index into second Offset within page
527 * page directory page pagetable page 590 * page directory page pagetable page
528 * 591 *
529 * The kernel spends a lot of time changing both the top-level page directory 592 * Now, unfortunately, this isn't the whole story: Intel added Physical Address
530 * and lower-level pagetable pages. The Guest doesn't know physical addresses, 593 * Extension (PAE) to allow 32 bit systems to use 64GB of memory (ie. 36 bits).
531 * so while it maintains these page tables exactly like normal, it also needs 594 * These are held in 64-bit page table entries, so we can now only fit 512
532 * to keep the Host informed whenever it makes a change: the Host will create 595 * entries in a page, and the neat three-level tree breaks down.
533 * the real page tables based on the Guests'. 596 *
597 * The result is a four level page table:
598 *
599 * cr3 --> [ 4 Upper ]
600 * [ Level ]
601 * [ Entries ]
602 * [(PUD Page)]---> +---------+
603 * | --------->+---------+
604 * | | | PADDR1 |
605 * Mid-level | | PADDR2 |
606 * (PMD) page | | |
607 * | | Lower-level |
608 * | | (PTE) page |
609 * | | | |
610 * .... ....
611 *
612 *
613 * And the virtual address is decoded as:
614 *
615 * 1 1 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
616 * |<-2->|<--- 9 bits ---->|<---- 9 bits --->|<------ 12 bits ------>|
617 * Index into Index into mid Index into lower Offset within page
618 * top entries directory page pagetable page
619 *
620 * It's too hard to switch between these two formats at runtime, so Linux only
621 * supports one or the other depending on whether CONFIG_X86_PAE is set. Many
622 * distributions turn it on, and not just for people with silly amounts of
623 * memory: the larger PTE entries allow room for the NX bit, which lets the
624 * kernel disable execution of pages and increase security.
625 *
626 * This was a problem for lguest, which couldn't run on these distributions;
627 * then Matias Zabaljauregui figured it all out and implemented it, and only a
628 * handful of puppies were crushed in the process!
629 *
630 * Back to our point: the kernel spends a lot of time changing both the
631 * top-level page directory and lower-level pagetable pages. The Guest doesn't
632 * know physical addresses, so while it maintains these page tables exactly
633 * like normal, it also needs to keep the Host informed whenever it makes a
634 * change: the Host will create the real page tables based on the Guests'.
534 */ 635 */
535 636
536/* The Guest calls this to set a second-level entry (pte), ie. to map a page 637/*
537 * into a process' address space. We set the entry then tell the Host the 638 * The Guest calls this after it has set a second-level entry (pte), ie. to map
538 * toplevel and address this corresponds to. The Guest uses one pagetable per 639 * a page into a process' address space. Wetell the Host the toplevel and
539 * process, so we need to tell the Host which one we're changing (mm->pgd). */ 640 * address this corresponds to. The Guest uses one pagetable per process, so
641 * we need to tell the Host which one we're changing (mm->pgd).
642 */
540static void lguest_pte_update(struct mm_struct *mm, unsigned long addr, 643static void lguest_pte_update(struct mm_struct *mm, unsigned long addr,
541 pte_t *ptep) 644 pte_t *ptep)
542{ 645{
543#ifdef CONFIG_X86_PAE 646#ifdef CONFIG_X86_PAE
647 /* PAE needs to hand a 64 bit page table entry, so it uses two args. */
544 lazy_hcall4(LHCALL_SET_PTE, __pa(mm->pgd), addr, 648 lazy_hcall4(LHCALL_SET_PTE, __pa(mm->pgd), addr,
545 ptep->pte_low, ptep->pte_high); 649 ptep->pte_low, ptep->pte_high);
546#else 650#else
@@ -548,6 +652,7 @@ static void lguest_pte_update(struct mm_struct *mm, unsigned long addr,
548#endif 652#endif
549} 653}
550 654
655/* This is the "set and update" combo-meal-deal version. */
551static void lguest_set_pte_at(struct mm_struct *mm, unsigned long addr, 656static void lguest_set_pte_at(struct mm_struct *mm, unsigned long addr,
552 pte_t *ptep, pte_t pteval) 657 pte_t *ptep, pte_t pteval)
553{ 658{
@@ -555,10 +660,13 @@ static void lguest_set_pte_at(struct mm_struct *mm, unsigned long addr,
555 lguest_pte_update(mm, addr, ptep); 660 lguest_pte_update(mm, addr, ptep);
556} 661}
557 662
558/* The Guest calls lguest_set_pud to set a top-level entry and lguest_set_pmd 663/*
664 * The Guest calls lguest_set_pud to set a top-level entry and lguest_set_pmd
559 * to set a middle-level entry when PAE is activated. 665 * to set a middle-level entry when PAE is activated.
666 *
560 * Again, we set the entry then tell the Host which page we changed, 667 * Again, we set the entry then tell the Host which page we changed,
561 * and the index of the entry we changed. */ 668 * and the index of the entry we changed.
669 */
562#ifdef CONFIG_X86_PAE 670#ifdef CONFIG_X86_PAE
563static void lguest_set_pud(pud_t *pudp, pud_t pudval) 671static void lguest_set_pud(pud_t *pudp, pud_t pudval)
564{ 672{
@@ -577,8 +685,7 @@ static void lguest_set_pmd(pmd_t *pmdp, pmd_t pmdval)
577} 685}
578#else 686#else
579 687
580/* The Guest calls lguest_set_pmd to set a top-level entry when PAE is not 688/* The Guest calls lguest_set_pmd to set a top-level entry when !PAE. */
581 * activated. */
582static void lguest_set_pmd(pmd_t *pmdp, pmd_t pmdval) 689static void lguest_set_pmd(pmd_t *pmdp, pmd_t pmdval)
583{ 690{
584 native_set_pmd(pmdp, pmdval); 691 native_set_pmd(pmdp, pmdval);
@@ -587,7 +694,8 @@ static void lguest_set_pmd(pmd_t *pmdp, pmd_t pmdval)
587} 694}
588#endif 695#endif
589 696
590/* There are a couple of legacy places where the kernel sets a PTE, but we 697/*
698 * There are a couple of legacy places where the kernel sets a PTE, but we
591 * don't know the top level any more. This is useless for us, since we don't 699 * don't know the top level any more. This is useless for us, since we don't
592 * know which pagetable is changing or what address, so we just tell the Host 700 * know which pagetable is changing or what address, so we just tell the Host
593 * to forget all of them. Fortunately, this is very rare. 701 * to forget all of them. Fortunately, this is very rare.
@@ -595,7 +703,8 @@ static void lguest_set_pmd(pmd_t *pmdp, pmd_t pmdval)
595 * ... except in early boot when the kernel sets up the initial pagetables, 703 * ... except in early boot when the kernel sets up the initial pagetables,
596 * which makes booting astonishingly slow: 1.83 seconds! So we don't even tell 704 * which makes booting astonishingly slow: 1.83 seconds! So we don't even tell
597 * the Host anything changed until we've done the first page table switch, 705 * the Host anything changed until we've done the first page table switch,
598 * which brings boot back to 0.25 seconds. */ 706 * which brings boot back to 0.25 seconds.
707 */
599static void lguest_set_pte(pte_t *ptep, pte_t pteval) 708static void lguest_set_pte(pte_t *ptep, pte_t pteval)
600{ 709{
601 native_set_pte(ptep, pteval); 710 native_set_pte(ptep, pteval);
@@ -604,6 +713,11 @@ static void lguest_set_pte(pte_t *ptep, pte_t pteval)
604} 713}
605 714
606#ifdef CONFIG_X86_PAE 715#ifdef CONFIG_X86_PAE
716/*
717 * With 64-bit PTE values, we need to be careful setting them: if we set 32
718 * bits at a time, the hardware could see a weird half-set entry. These
719 * versions ensure we update all 64 bits at once.
720 */
607static void lguest_set_pte_atomic(pte_t *ptep, pte_t pte) 721static void lguest_set_pte_atomic(pte_t *ptep, pte_t pte)
608{ 722{
609 native_set_pte_atomic(ptep, pte); 723 native_set_pte_atomic(ptep, pte);
@@ -611,19 +725,21 @@ static void lguest_set_pte_atomic(pte_t *ptep, pte_t pte)
611 lazy_hcall1(LHCALL_FLUSH_TLB, 1); 725 lazy_hcall1(LHCALL_FLUSH_TLB, 1);
612} 726}
613 727
614void lguest_pte_clear(struct mm_struct *mm, unsigned long addr, pte_t *ptep) 728static void lguest_pte_clear(struct mm_struct *mm, unsigned long addr,
729 pte_t *ptep)
615{ 730{
616 native_pte_clear(mm, addr, ptep); 731 native_pte_clear(mm, addr, ptep);
617 lguest_pte_update(mm, addr, ptep); 732 lguest_pte_update(mm, addr, ptep);
618} 733}
619 734
620void lguest_pmd_clear(pmd_t *pmdp) 735static void lguest_pmd_clear(pmd_t *pmdp)
621{ 736{
622 lguest_set_pmd(pmdp, __pmd(0)); 737 lguest_set_pmd(pmdp, __pmd(0));
623} 738}
624#endif 739#endif
625 740
626/* Unfortunately for Lguest, the pv_mmu_ops for page tables were based on 741/*
742 * Unfortunately for Lguest, the pv_mmu_ops for page tables were based on
627 * native page table operations. On native hardware you can set a new page 743 * native page table operations. On native hardware you can set a new page
628 * table entry whenever you want, but if you want to remove one you have to do 744 * table entry whenever you want, but if you want to remove one you have to do
629 * a TLB flush (a TLB is a little cache of page table entries kept by the CPU). 745 * a TLB flush (a TLB is a little cache of page table entries kept by the CPU).
@@ -632,24 +748,29 @@ void lguest_pmd_clear(pmd_t *pmdp)
632 * called when a valid entry is written, not when it's removed (ie. marked not 748 * called when a valid entry is written, not when it's removed (ie. marked not
633 * present). Instead, this is where we come when the Guest wants to remove a 749 * present). Instead, this is where we come when the Guest wants to remove a
634 * page table entry: we tell the Host to set that entry to 0 (ie. the present 750 * page table entry: we tell the Host to set that entry to 0 (ie. the present
635 * bit is zero). */ 751 * bit is zero).
752 */
636static void lguest_flush_tlb_single(unsigned long addr) 753static void lguest_flush_tlb_single(unsigned long addr)
637{ 754{
638 /* Simply set it to zero: if it was not, it will fault back in. */ 755 /* Simply set it to zero: if it was not, it will fault back in. */
639 lazy_hcall3(LHCALL_SET_PTE, lguest_data.pgdir, addr, 0); 756 lazy_hcall3(LHCALL_SET_PTE, lguest_data.pgdir, addr, 0);
640} 757}
641 758
642/* This is what happens after the Guest has removed a large number of entries. 759/*
760 * This is what happens after the Guest has removed a large number of entries.
643 * This tells the Host that any of the page table entries for userspace might 761 * This tells the Host that any of the page table entries for userspace might
644 * have changed, ie. virtual addresses below PAGE_OFFSET. */ 762 * have changed, ie. virtual addresses below PAGE_OFFSET.
763 */
645static void lguest_flush_tlb_user(void) 764static void lguest_flush_tlb_user(void)
646{ 765{
647 lazy_hcall1(LHCALL_FLUSH_TLB, 0); 766 lazy_hcall1(LHCALL_FLUSH_TLB, 0);
648} 767}
649 768
650/* This is called when the kernel page tables have changed. That's not very 769/*
770 * This is called when the kernel page tables have changed. That's not very
651 * common (unless the Guest is using highmem, which makes the Guest extremely 771 * common (unless the Guest is using highmem, which makes the Guest extremely
652 * slow), so it's worth separating this from the user flushing above. */ 772 * slow), so it's worth separating this from the user flushing above.
773 */
653static void lguest_flush_tlb_kernel(void) 774static void lguest_flush_tlb_kernel(void)
654{ 775{
655 lazy_hcall1(LHCALL_FLUSH_TLB, 1); 776 lazy_hcall1(LHCALL_FLUSH_TLB, 1);
@@ -686,26 +807,38 @@ static struct irq_chip lguest_irq_controller = {
686 .unmask = enable_lguest_irq, 807 .unmask = enable_lguest_irq,
687}; 808};
688 809
689/* This sets up the Interrupt Descriptor Table (IDT) entry for each hardware 810/*
811 * This sets up the Interrupt Descriptor Table (IDT) entry for each hardware
690 * interrupt (except 128, which is used for system calls), and then tells the 812 * interrupt (except 128, which is used for system calls), and then tells the
691 * Linux infrastructure that each interrupt is controlled by our level-based 813 * Linux infrastructure that each interrupt is controlled by our level-based
692 * lguest interrupt controller. */ 814 * lguest interrupt controller.
815 */
693static void __init lguest_init_IRQ(void) 816static void __init lguest_init_IRQ(void)
694{ 817{
695 unsigned int i; 818 unsigned int i;
696 819
697 for (i = FIRST_EXTERNAL_VECTOR; i < NR_VECTORS; i++) { 820 for (i = FIRST_EXTERNAL_VECTOR; i < NR_VECTORS; i++) {
698 /* Some systems map "vectors" to interrupts weirdly. Lguest has 821 /* Some systems map "vectors" to interrupts weirdly. Not us! */
699 * a straightforward 1 to 1 mapping, so force that here. */
700 __get_cpu_var(vector_irq)[i] = i - FIRST_EXTERNAL_VECTOR; 822 __get_cpu_var(vector_irq)[i] = i - FIRST_EXTERNAL_VECTOR;
701 if (i != SYSCALL_VECTOR) 823 if (i != SYSCALL_VECTOR)
702 set_intr_gate(i, interrupt[i - FIRST_EXTERNAL_VECTOR]); 824 set_intr_gate(i, interrupt[i - FIRST_EXTERNAL_VECTOR]);
703 } 825 }
704 /* This call is required to set up for 4k stacks, where we have 826
705 * separate stacks for hard and soft interrupts. */ 827 /*
828 * This call is required to set up for 4k stacks, where we have
829 * separate stacks for hard and soft interrupts.
830 */
706 irq_ctx_init(smp_processor_id()); 831 irq_ctx_init(smp_processor_id());
707} 832}
708 833
834/*
835 * With CONFIG_SPARSE_IRQ, interrupt descriptors are allocated as-needed, so
836 * rather than set them in lguest_init_IRQ we are called here every time an
837 * lguest device needs an interrupt.
838 *
839 * FIXME: irq_to_desc_alloc_node() can fail due to lack of memory, we should
840 * pass that up!
841 */
709void lguest_setup_irq(unsigned int irq) 842void lguest_setup_irq(unsigned int irq)
710{ 843{
711 irq_to_desc_alloc_node(irq, 0); 844 irq_to_desc_alloc_node(irq, 0);
@@ -724,31 +857,39 @@ static unsigned long lguest_get_wallclock(void)
724 return lguest_data.time.tv_sec; 857 return lguest_data.time.tv_sec;
725} 858}
726 859
727/* The TSC is an Intel thing called the Time Stamp Counter. The Host tells us 860/*
861 * The TSC is an Intel thing called the Time Stamp Counter. The Host tells us
728 * what speed it runs at, or 0 if it's unusable as a reliable clock source. 862 * what speed it runs at, or 0 if it's unusable as a reliable clock source.
729 * This matches what we want here: if we return 0 from this function, the x86 863 * This matches what we want here: if we return 0 from this function, the x86
730 * TSC clock will give up and not register itself. */ 864 * TSC clock will give up and not register itself.
865 */
731static unsigned long lguest_tsc_khz(void) 866static unsigned long lguest_tsc_khz(void)
732{ 867{
733 return lguest_data.tsc_khz; 868 return lguest_data.tsc_khz;
734} 869}
735 870
736/* If we can't use the TSC, the kernel falls back to our lower-priority 871/*
737 * "lguest_clock", where we read the time value given to us by the Host. */ 872 * If we can't use the TSC, the kernel falls back to our lower-priority
873 * "lguest_clock", where we read the time value given to us by the Host.
874 */
738static cycle_t lguest_clock_read(struct clocksource *cs) 875static cycle_t lguest_clock_read(struct clocksource *cs)
739{ 876{
740 unsigned long sec, nsec; 877 unsigned long sec, nsec;
741 878
742 /* Since the time is in two parts (seconds and nanoseconds), we risk 879 /*
880 * Since the time is in two parts (seconds and nanoseconds), we risk
743 * reading it just as it's changing from 99 & 0.999999999 to 100 and 0, 881 * reading it just as it's changing from 99 & 0.999999999 to 100 and 0,
744 * and getting 99 and 0. As Linux tends to come apart under the stress 882 * and getting 99 and 0. As Linux tends to come apart under the stress
745 * of time travel, we must be careful: */ 883 * of time travel, we must be careful:
884 */
746 do { 885 do {
747 /* First we read the seconds part. */ 886 /* First we read the seconds part. */
748 sec = lguest_data.time.tv_sec; 887 sec = lguest_data.time.tv_sec;
749 /* This read memory barrier tells the compiler and the CPU that 888 /*
889 * This read memory barrier tells the compiler and the CPU that
750 * this can't be reordered: we have to complete the above 890 * this can't be reordered: we have to complete the above
751 * before going on. */ 891 * before going on.
892 */
752 rmb(); 893 rmb();
753 /* Now we read the nanoseconds part. */ 894 /* Now we read the nanoseconds part. */
754 nsec = lguest_data.time.tv_nsec; 895 nsec = lguest_data.time.tv_nsec;
@@ -772,9 +913,11 @@ static struct clocksource lguest_clock = {
772 .flags = CLOCK_SOURCE_IS_CONTINUOUS, 913 .flags = CLOCK_SOURCE_IS_CONTINUOUS,
773}; 914};
774 915
775/* We also need a "struct clock_event_device": Linux asks us to set it to go 916/*
917 * We also need a "struct clock_event_device": Linux asks us to set it to go
776 * off some time in the future. Actually, James Morris figured all this out, I 918 * off some time in the future. Actually, James Morris figured all this out, I
777 * just applied the patch. */ 919 * just applied the patch.
920 */
778static int lguest_clockevent_set_next_event(unsigned long delta, 921static int lguest_clockevent_set_next_event(unsigned long delta,
779 struct clock_event_device *evt) 922 struct clock_event_device *evt)
780{ 923{
@@ -824,8 +967,10 @@ static struct clock_event_device lguest_clockevent = {
824 .max_delta_ns = LG_CLOCK_MAX_DELTA, 967 .max_delta_ns = LG_CLOCK_MAX_DELTA,
825}; 968};
826 969
827/* This is the Guest timer interrupt handler (hardware interrupt 0). We just 970/*
828 * call the clockevent infrastructure and it does whatever needs doing. */ 971 * This is the Guest timer interrupt handler (hardware interrupt 0). We just
972 * call the clockevent infrastructure and it does whatever needs doing.
973 */
829static void lguest_time_irq(unsigned int irq, struct irq_desc *desc) 974static void lguest_time_irq(unsigned int irq, struct irq_desc *desc)
830{ 975{
831 unsigned long flags; 976 unsigned long flags;
@@ -836,10 +981,12 @@ static void lguest_time_irq(unsigned int irq, struct irq_desc *desc)
836 local_irq_restore(flags); 981 local_irq_restore(flags);
837} 982}
838 983
839/* At some point in the boot process, we get asked to set up our timing 984/*
985 * At some point in the boot process, we get asked to set up our timing
840 * infrastructure. The kernel doesn't expect timer interrupts before this, but 986 * infrastructure. The kernel doesn't expect timer interrupts before this, but
841 * we cleverly initialized the "blocked_interrupts" field of "struct 987 * we cleverly initialized the "blocked_interrupts" field of "struct
842 * lguest_data" so that timer interrupts were blocked until now. */ 988 * lguest_data" so that timer interrupts were blocked until now.
989 */
843static void lguest_time_init(void) 990static void lguest_time_init(void)
844{ 991{
845 /* Set up the timer interrupt (0) to go to our simple timer routine */ 992 /* Set up the timer interrupt (0) to go to our simple timer routine */
@@ -863,14 +1010,16 @@ static void lguest_time_init(void)
863 * to work. They're pretty simple. 1010 * to work. They're pretty simple.
864 */ 1011 */
865 1012
866/* The Guest needs to tell the Host what stack it expects traps to use. For 1013/*
1014 * The Guest needs to tell the Host what stack it expects traps to use. For
867 * native hardware, this is part of the Task State Segment mentioned above in 1015 * native hardware, this is part of the Task State Segment mentioned above in
868 * lguest_load_tr_desc(), but to help hypervisors there's this special call. 1016 * lguest_load_tr_desc(), but to help hypervisors there's this special call.
869 * 1017 *
870 * We tell the Host the segment we want to use (__KERNEL_DS is the kernel data 1018 * We tell the Host the segment we want to use (__KERNEL_DS is the kernel data
871 * segment), the privilege level (we're privilege level 1, the Host is 0 and 1019 * segment), the privilege level (we're privilege level 1, the Host is 0 and
872 * will not tolerate us trying to use that), the stack pointer, and the number 1020 * will not tolerate us trying to use that), the stack pointer, and the number
873 * of pages in the stack. */ 1021 * of pages in the stack.
1022 */
874static void lguest_load_sp0(struct tss_struct *tss, 1023static void lguest_load_sp0(struct tss_struct *tss,
875 struct thread_struct *thread) 1024 struct thread_struct *thread)
876{ 1025{
@@ -884,7 +1033,8 @@ static void lguest_set_debugreg(int regno, unsigned long value)
884 /* FIXME: Implement */ 1033 /* FIXME: Implement */
885} 1034}
886 1035
887/* There are times when the kernel wants to make sure that no memory writes are 1036/*
1037 * There are times when the kernel wants to make sure that no memory writes are
888 * caught in the cache (that they've all reached real hardware devices). This 1038 * caught in the cache (that they've all reached real hardware devices). This
889 * doesn't matter for the Guest which has virtual hardware. 1039 * doesn't matter for the Guest which has virtual hardware.
890 * 1040 *
@@ -898,11 +1048,13 @@ static void lguest_wbinvd(void)
898{ 1048{
899} 1049}
900 1050
901/* If the Guest expects to have an Advanced Programmable Interrupt Controller, 1051/*
1052 * If the Guest expects to have an Advanced Programmable Interrupt Controller,
902 * we play dumb by ignoring writes and returning 0 for reads. So it's no 1053 * we play dumb by ignoring writes and returning 0 for reads. So it's no
903 * longer Programmable nor Controlling anything, and I don't think 8 lines of 1054 * longer Programmable nor Controlling anything, and I don't think 8 lines of
904 * code qualifies for Advanced. It will also never interrupt anything. It 1055 * code qualifies for Advanced. It will also never interrupt anything. It
905 * does, however, allow us to get through the Linux boot code. */ 1056 * does, however, allow us to get through the Linux boot code.
1057 */
906#ifdef CONFIG_X86_LOCAL_APIC 1058#ifdef CONFIG_X86_LOCAL_APIC
907static void lguest_apic_write(u32 reg, u32 v) 1059static void lguest_apic_write(u32 reg, u32 v)
908{ 1060{
@@ -951,11 +1103,13 @@ static void lguest_safe_halt(void)
951 kvm_hypercall0(LHCALL_HALT); 1103 kvm_hypercall0(LHCALL_HALT);
952} 1104}
953 1105
954/* The SHUTDOWN hypercall takes a string to describe what's happening, and 1106/*
1107 * The SHUTDOWN hypercall takes a string to describe what's happening, and
955 * an argument which says whether this to restart (reboot) the Guest or not. 1108 * an argument which says whether this to restart (reboot) the Guest or not.
956 * 1109 *
957 * Note that the Host always prefers that the Guest speak in physical addresses 1110 * Note that the Host always prefers that the Guest speak in physical addresses
958 * rather than virtual addresses, so we use __pa() here. */ 1111 * rather than virtual addresses, so we use __pa() here.
1112 */
959static void lguest_power_off(void) 1113static void lguest_power_off(void)
960{ 1114{
961 kvm_hypercall2(LHCALL_SHUTDOWN, __pa("Power down"), 1115 kvm_hypercall2(LHCALL_SHUTDOWN, __pa("Power down"),
@@ -986,8 +1140,10 @@ static __init char *lguest_memory_setup(void)
986 * nice to move it back to lguest_init. Patch welcome... */ 1140 * nice to move it back to lguest_init. Patch welcome... */
987 atomic_notifier_chain_register(&panic_notifier_list, &paniced); 1141 atomic_notifier_chain_register(&panic_notifier_list, &paniced);
988 1142
989 /* The Linux bootloader header contains an "e820" memory map: the 1143 /*
990 * Launcher populated the first entry with our memory limit. */ 1144 *The Linux bootloader header contains an "e820" memory map: the
1145 * Launcher populated the first entry with our memory limit.
1146 */
991 e820_add_region(boot_params.e820_map[0].addr, 1147 e820_add_region(boot_params.e820_map[0].addr,
992 boot_params.e820_map[0].size, 1148 boot_params.e820_map[0].size,
993 boot_params.e820_map[0].type); 1149 boot_params.e820_map[0].type);
@@ -996,16 +1152,17 @@ static __init char *lguest_memory_setup(void)
996 return "LGUEST"; 1152 return "LGUEST";
997} 1153}
998 1154
999/* We will eventually use the virtio console device to produce console output, 1155/*
1156 * We will eventually use the virtio console device to produce console output,
1000 * but before that is set up we use LHCALL_NOTIFY on normal memory to produce 1157 * but before that is set up we use LHCALL_NOTIFY on normal memory to produce
1001 * console output. */ 1158 * console output.
1159 */
1002static __init int early_put_chars(u32 vtermno, const char *buf, int count) 1160static __init int early_put_chars(u32 vtermno, const char *buf, int count)
1003{ 1161{
1004 char scratch[17]; 1162 char scratch[17];
1005 unsigned int len = count; 1163 unsigned int len = count;
1006 1164
1007 /* We use a nul-terminated string, so we have to make a copy. Icky, 1165 /* We use a nul-terminated string, so we make a copy. Icky, huh? */
1008 * huh? */
1009 if (len > sizeof(scratch) - 1) 1166 if (len > sizeof(scratch) - 1)
1010 len = sizeof(scratch) - 1; 1167 len = sizeof(scratch) - 1;
1011 scratch[len] = '\0'; 1168 scratch[len] = '\0';
@@ -1016,8 +1173,10 @@ static __init int early_put_chars(u32 vtermno, const char *buf, int count)
1016 return len; 1173 return len;
1017} 1174}
1018 1175
1019/* Rebooting also tells the Host we're finished, but the RESTART flag tells the 1176/*
1020 * Launcher to reboot us. */ 1177 * Rebooting also tells the Host we're finished, but the RESTART flag tells the
1178 * Launcher to reboot us.
1179 */
1021static void lguest_restart(char *reason) 1180static void lguest_restart(char *reason)
1022{ 1181{
1023 kvm_hypercall2(LHCALL_SHUTDOWN, __pa(reason), LGUEST_SHUTDOWN_RESTART); 1182 kvm_hypercall2(LHCALL_SHUTDOWN, __pa(reason), LGUEST_SHUTDOWN_RESTART);
@@ -1044,7 +1203,8 @@ static void lguest_restart(char *reason)
1044 * fit comfortably. 1203 * fit comfortably.
1045 * 1204 *
1046 * First we need assembly templates of each of the patchable Guest operations, 1205 * First we need assembly templates of each of the patchable Guest operations,
1047 * and these are in i386_head.S. */ 1206 * and these are in i386_head.S.
1207 */
1048 1208
1049/*G:060 We construct a table from the assembler templates: */ 1209/*G:060 We construct a table from the assembler templates: */
1050static const struct lguest_insns 1210static const struct lguest_insns
@@ -1055,9 +1215,11 @@ static const struct lguest_insns
1055 [PARAVIRT_PATCH(pv_irq_ops.save_fl)] = { lgstart_pushf, lgend_pushf }, 1215 [PARAVIRT_PATCH(pv_irq_ops.save_fl)] = { lgstart_pushf, lgend_pushf },
1056}; 1216};
1057 1217
1058/* Now our patch routine is fairly simple (based on the native one in 1218/*
1219 * Now our patch routine is fairly simple (based on the native one in
1059 * paravirt.c). If we have a replacement, we copy it in and return how much of 1220 * paravirt.c). If we have a replacement, we copy it in and return how much of
1060 * the available space we used. */ 1221 * the available space we used.
1222 */
1061static unsigned lguest_patch(u8 type, u16 clobber, void *ibuf, 1223static unsigned lguest_patch(u8 type, u16 clobber, void *ibuf,
1062 unsigned long addr, unsigned len) 1224 unsigned long addr, unsigned len)
1063{ 1225{
@@ -1069,8 +1231,7 @@ static unsigned lguest_patch(u8 type, u16 clobber, void *ibuf,
1069 1231
1070 insn_len = lguest_insns[type].end - lguest_insns[type].start; 1232 insn_len = lguest_insns[type].end - lguest_insns[type].start;
1071 1233
1072 /* Similarly if we can't fit replacement (shouldn't happen, but let's 1234 /* Similarly if it can't fit (doesn't happen, but let's be thorough). */
1073 * be thorough). */
1074 if (len < insn_len) 1235 if (len < insn_len)
1075 return paravirt_patch_default(type, clobber, ibuf, addr, len); 1236 return paravirt_patch_default(type, clobber, ibuf, addr, len);
1076 1237
@@ -1079,22 +1240,28 @@ static unsigned lguest_patch(u8 type, u16 clobber, void *ibuf,
1079 return insn_len; 1240 return insn_len;
1080} 1241}
1081 1242
1082/*G:030 Once we get to lguest_init(), we know we're a Guest. The various 1243/*G:029
1244 * Once we get to lguest_init(), we know we're a Guest. The various
1083 * pv_ops structures in the kernel provide points for (almost) every routine we 1245 * pv_ops structures in the kernel provide points for (almost) every routine we
1084 * have to override to avoid privileged instructions. */ 1246 * have to override to avoid privileged instructions.
1247 */
1085__init void lguest_init(void) 1248__init void lguest_init(void)
1086{ 1249{
1087 /* We're under lguest, paravirt is enabled, and we're running at 1250 /* We're under lguest. */
1088 * privilege level 1, not 0 as normal. */
1089 pv_info.name = "lguest"; 1251 pv_info.name = "lguest";
1252 /* Paravirt is enabled. */
1090 pv_info.paravirt_enabled = 1; 1253 pv_info.paravirt_enabled = 1;
1254 /* We're running at privilege level 1, not 0 as normal. */
1091 pv_info.kernel_rpl = 1; 1255 pv_info.kernel_rpl = 1;
1256 /* Everyone except Xen runs with this set. */
1092 pv_info.shared_kernel_pmd = 1; 1257 pv_info.shared_kernel_pmd = 1;
1093 1258
1094 /* We set up all the lguest overrides for sensitive operations. These 1259 /*
1095 * are detailed with the operations themselves. */ 1260 * We set up all the lguest overrides for sensitive operations. These
1261 * are detailed with the operations themselves.
1262 */
1096 1263
1097 /* interrupt-related operations */ 1264 /* Interrupt-related operations */
1098 pv_irq_ops.init_IRQ = lguest_init_IRQ; 1265 pv_irq_ops.init_IRQ = lguest_init_IRQ;
1099 pv_irq_ops.save_fl = PV_CALLEE_SAVE(save_fl); 1266 pv_irq_ops.save_fl = PV_CALLEE_SAVE(save_fl);
1100 pv_irq_ops.restore_fl = __PV_IS_CALLEE_SAVE(lg_restore_fl); 1267 pv_irq_ops.restore_fl = __PV_IS_CALLEE_SAVE(lg_restore_fl);
@@ -1102,11 +1269,11 @@ __init void lguest_init(void)
1102 pv_irq_ops.irq_enable = __PV_IS_CALLEE_SAVE(lg_irq_enable); 1269 pv_irq_ops.irq_enable = __PV_IS_CALLEE_SAVE(lg_irq_enable);
1103 pv_irq_ops.safe_halt = lguest_safe_halt; 1270 pv_irq_ops.safe_halt = lguest_safe_halt;
1104 1271
1105 /* init-time operations */ 1272 /* Setup operations */
1106 pv_init_ops.memory_setup = lguest_memory_setup; 1273 pv_init_ops.memory_setup = lguest_memory_setup;
1107 pv_init_ops.patch = lguest_patch; 1274 pv_init_ops.patch = lguest_patch;
1108 1275
1109 /* Intercepts of various cpu instructions */ 1276 /* Intercepts of various CPU instructions */
1110 pv_cpu_ops.load_gdt = lguest_load_gdt; 1277 pv_cpu_ops.load_gdt = lguest_load_gdt;
1111 pv_cpu_ops.cpuid = lguest_cpuid; 1278 pv_cpu_ops.cpuid = lguest_cpuid;
1112 pv_cpu_ops.load_idt = lguest_load_idt; 1279 pv_cpu_ops.load_idt = lguest_load_idt;
@@ -1127,7 +1294,7 @@ __init void lguest_init(void)
1127 pv_cpu_ops.start_context_switch = paravirt_start_context_switch; 1294 pv_cpu_ops.start_context_switch = paravirt_start_context_switch;
1128 pv_cpu_ops.end_context_switch = lguest_end_context_switch; 1295 pv_cpu_ops.end_context_switch = lguest_end_context_switch;
1129 1296
1130 /* pagetable management */ 1297 /* Pagetable management */
1131 pv_mmu_ops.write_cr3 = lguest_write_cr3; 1298 pv_mmu_ops.write_cr3 = lguest_write_cr3;
1132 pv_mmu_ops.flush_tlb_user = lguest_flush_tlb_user; 1299 pv_mmu_ops.flush_tlb_user = lguest_flush_tlb_user;
1133 pv_mmu_ops.flush_tlb_single = lguest_flush_tlb_single; 1300 pv_mmu_ops.flush_tlb_single = lguest_flush_tlb_single;
@@ -1149,54 +1316,71 @@ __init void lguest_init(void)
1149 pv_mmu_ops.pte_update_defer = lguest_pte_update; 1316 pv_mmu_ops.pte_update_defer = lguest_pte_update;
1150 1317
1151#ifdef CONFIG_X86_LOCAL_APIC 1318#ifdef CONFIG_X86_LOCAL_APIC
1152 /* apic read/write intercepts */ 1319 /* APIC read/write intercepts */
1153 set_lguest_basic_apic_ops(); 1320 set_lguest_basic_apic_ops();
1154#endif 1321#endif
1155 1322
1156 /* time operations */ 1323 /* Time operations */
1157 pv_time_ops.get_wallclock = lguest_get_wallclock; 1324 pv_time_ops.get_wallclock = lguest_get_wallclock;
1158 pv_time_ops.time_init = lguest_time_init; 1325 pv_time_ops.time_init = lguest_time_init;
1159 pv_time_ops.get_tsc_khz = lguest_tsc_khz; 1326 pv_time_ops.get_tsc_khz = lguest_tsc_khz;
1160 1327
1161 /* Now is a good time to look at the implementations of these functions 1328 /*
1162 * before returning to the rest of lguest_init(). */ 1329 * Now is a good time to look at the implementations of these functions
1330 * before returning to the rest of lguest_init().
1331 */
1163 1332
1164 /*G:070 Now we've seen all the paravirt_ops, we return to 1333 /*G:070
1334 * Now we've seen all the paravirt_ops, we return to
1165 * lguest_init() where the rest of the fairly chaotic boot setup 1335 * lguest_init() where the rest of the fairly chaotic boot setup
1166 * occurs. */ 1336 * occurs.
1337 */
1167 1338
1168 /* The stack protector is a weird thing where gcc places a canary 1339 /*
1340 * The stack protector is a weird thing where gcc places a canary
1169 * value on the stack and then checks it on return. This file is 1341 * value on the stack and then checks it on return. This file is
1170 * compiled with -fno-stack-protector it, so we got this far without 1342 * compiled with -fno-stack-protector it, so we got this far without
1171 * problems. The value of the canary is kept at offset 20 from the 1343 * problems. The value of the canary is kept at offset 20 from the
1172 * %gs register, so we need to set that up before calling C functions 1344 * %gs register, so we need to set that up before calling C functions
1173 * in other files. */ 1345 * in other files.
1346 */
1174 setup_stack_canary_segment(0); 1347 setup_stack_canary_segment(0);
1175 /* We could just call load_stack_canary_segment(), but we might as 1348
1176 * call switch_to_new_gdt() which loads the whole table and sets up 1349 /*
1177 * the per-cpu segment descriptor register %fs as well. */ 1350 * We could just call load_stack_canary_segment(), but we might as well
1351 * call switch_to_new_gdt() which loads the whole table and sets up the
1352 * per-cpu segment descriptor register %fs as well.
1353 */
1178 switch_to_new_gdt(0); 1354 switch_to_new_gdt(0);
1179 1355
1180 /* As described in head_32.S, we map the first 128M of memory. */ 1356 /* We actually boot with all memory mapped, but let's say 128MB. */
1181 max_pfn_mapped = (128*1024*1024) >> PAGE_SHIFT; 1357 max_pfn_mapped = (128*1024*1024) >> PAGE_SHIFT;
1182 1358
1183 /* The Host<->Guest Switcher lives at the top of our address space, and 1359 /*
1360 * The Host<->Guest Switcher lives at the top of our address space, and
1184 * the Host told us how big it is when we made LGUEST_INIT hypercall: 1361 * the Host told us how big it is when we made LGUEST_INIT hypercall:
1185 * it put the answer in lguest_data.reserve_mem */ 1362 * it put the answer in lguest_data.reserve_mem
1363 */
1186 reserve_top_address(lguest_data.reserve_mem); 1364 reserve_top_address(lguest_data.reserve_mem);
1187 1365
1188 /* If we don't initialize the lock dependency checker now, it crashes 1366 /*
1189 * paravirt_disable_iospace. */ 1367 * If we don't initialize the lock dependency checker now, it crashes
1368 * paravirt_disable_iospace.
1369 */
1190 lockdep_init(); 1370 lockdep_init();
1191 1371
1192 /* The IDE code spends about 3 seconds probing for disks: if we reserve 1372 /*
1373 * The IDE code spends about 3 seconds probing for disks: if we reserve
1193 * all the I/O ports up front it can't get them and so doesn't probe. 1374 * all the I/O ports up front it can't get them and so doesn't probe.
1194 * Other device drivers are similar (but less severe). This cuts the 1375 * Other device drivers are similar (but less severe). This cuts the
1195 * kernel boot time on my machine from 4.1 seconds to 0.45 seconds. */ 1376 * kernel boot time on my machine from 4.1 seconds to 0.45 seconds.
1377 */
1196 paravirt_disable_iospace(); 1378 paravirt_disable_iospace();
1197 1379
1198 /* This is messy CPU setup stuff which the native boot code does before 1380 /*
1199 * start_kernel, so we have to do, too: */ 1381 * This is messy CPU setup stuff which the native boot code does before
1382 * start_kernel, so we have to do, too:
1383 */
1200 cpu_detect(&new_cpu_data); 1384 cpu_detect(&new_cpu_data);
1201 /* head.S usually sets up the first capability word, so do it here. */ 1385 /* head.S usually sets up the first capability word, so do it here. */
1202 new_cpu_data.x86_capability[0] = cpuid_edx(1); 1386 new_cpu_data.x86_capability[0] = cpuid_edx(1);
@@ -1213,22 +1397,28 @@ __init void lguest_init(void)
1213 acpi_ht = 0; 1397 acpi_ht = 0;
1214#endif 1398#endif
1215 1399
1216 /* We set the preferred console to "hvc". This is the "hypervisor 1400 /*
1401 * We set the preferred console to "hvc". This is the "hypervisor
1217 * virtual console" driver written by the PowerPC people, which we also 1402 * virtual console" driver written by the PowerPC people, which we also
1218 * adapted for lguest's use. */ 1403 * adapted for lguest's use.
1404 */
1219 add_preferred_console("hvc", 0, NULL); 1405 add_preferred_console("hvc", 0, NULL);
1220 1406
1221 /* Register our very early console. */ 1407 /* Register our very early console. */
1222 virtio_cons_early_init(early_put_chars); 1408 virtio_cons_early_init(early_put_chars);
1223 1409
1224 /* Last of all, we set the power management poweroff hook to point to 1410 /*
1411 * Last of all, we set the power management poweroff hook to point to
1225 * the Guest routine to power off, and the reboot hook to our restart 1412 * the Guest routine to power off, and the reboot hook to our restart
1226 * routine. */ 1413 * routine.
1414 */
1227 pm_power_off = lguest_power_off; 1415 pm_power_off = lguest_power_off;
1228 machine_ops.restart = lguest_restart; 1416 machine_ops.restart = lguest_restart;
1229 1417
1230 /* Now we're set up, call i386_start_kernel() in head32.c and we proceed 1418 /*
1231 * to boot as normal. It never returns. */ 1419 * Now we're set up, call i386_start_kernel() in head32.c and we proceed
1420 * to boot as normal. It never returns.
1421 */
1232 i386_start_kernel(); 1422 i386_start_kernel();
1233} 1423}
1234/* 1424/*
diff --git a/arch/x86/lguest/i386_head.S b/arch/x86/lguest/i386_head.S
index a9c8cfe61cd4..27eac0faee48 100644
--- a/arch/x86/lguest/i386_head.S
+++ b/arch/x86/lguest/i386_head.S
@@ -5,7 +5,8 @@
5#include <asm/thread_info.h> 5#include <asm/thread_info.h>
6#include <asm/processor-flags.h> 6#include <asm/processor-flags.h>
7 7
8/*G:020 Our story starts with the kernel booting into startup_32 in 8/*G:020
9 * Our story starts with the kernel booting into startup_32 in
9 * arch/x86/kernel/head_32.S. It expects a boot header, which is created by 10 * arch/x86/kernel/head_32.S. It expects a boot header, which is created by
10 * the bootloader (the Launcher in our case). 11 * the bootloader (the Launcher in our case).
11 * 12 *
@@ -21,11 +22,14 @@
21 * data without remembering to subtract __PAGE_OFFSET! 22 * data without remembering to subtract __PAGE_OFFSET!
22 * 23 *
23 * The .section line puts this code in .init.text so it will be discarded after 24 * The .section line puts this code in .init.text so it will be discarded after
24 * boot. */ 25 * boot.
26 */
25.section .init.text, "ax", @progbits 27.section .init.text, "ax", @progbits
26ENTRY(lguest_entry) 28ENTRY(lguest_entry)
27 /* We make the "initialization" hypercall now to tell the Host about 29 /*
28 * us, and also find out where it put our page tables. */ 30 * We make the "initialization" hypercall now to tell the Host about
31 * us, and also find out where it put our page tables.
32 */
29 movl $LHCALL_LGUEST_INIT, %eax 33 movl $LHCALL_LGUEST_INIT, %eax
30 movl $lguest_data - __PAGE_OFFSET, %ebx 34 movl $lguest_data - __PAGE_OFFSET, %ebx
31 .byte 0x0f,0x01,0xc1 /* KVM_HYPERCALL */ 35 .byte 0x0f,0x01,0xc1 /* KVM_HYPERCALL */
@@ -33,13 +37,14 @@ ENTRY(lguest_entry)
33 /* Set up the initial stack so we can run C code. */ 37 /* Set up the initial stack so we can run C code. */
34 movl $(init_thread_union+THREAD_SIZE),%esp 38 movl $(init_thread_union+THREAD_SIZE),%esp
35 39
36 /* Jumps are relative, and we're running __PAGE_OFFSET too low at the 40 /* Jumps are relative: we're running __PAGE_OFFSET too low. */
37 * moment. */
38 jmp lguest_init+__PAGE_OFFSET 41 jmp lguest_init+__PAGE_OFFSET
39 42
40/*G:055 We create a macro which puts the assembler code between lgstart_ and 43/*G:055
41 * lgend_ markers. These templates are put in the .text section: they can't be 44 * We create a macro which puts the assembler code between lgstart_ and lgend_
42 * discarded after boot as we may need to patch modules, too. */ 45 * markers. These templates are put in the .text section: they can't be
46 * discarded after boot as we may need to patch modules, too.
47 */
43.text 48.text
44#define LGUEST_PATCH(name, insns...) \ 49#define LGUEST_PATCH(name, insns...) \
45 lgstart_##name: insns; lgend_##name:; \ 50 lgstart_##name: insns; lgend_##name:; \
@@ -48,83 +53,103 @@ ENTRY(lguest_entry)
48LGUEST_PATCH(cli, movl $0, lguest_data+LGUEST_DATA_irq_enabled) 53LGUEST_PATCH(cli, movl $0, lguest_data+LGUEST_DATA_irq_enabled)
49LGUEST_PATCH(pushf, movl lguest_data+LGUEST_DATA_irq_enabled, %eax) 54LGUEST_PATCH(pushf, movl lguest_data+LGUEST_DATA_irq_enabled, %eax)
50 55
51/*G:033 But using those wrappers is inefficient (we'll see why that doesn't 56/*G:033
52 * matter for save_fl and irq_disable later). If we write our routines 57 * But using those wrappers is inefficient (we'll see why that doesn't matter
53 * carefully in assembler, we can avoid clobbering any registers and avoid 58 * for save_fl and irq_disable later). If we write our routines carefully in
54 * jumping through the wrapper functions. 59 * assembler, we can avoid clobbering any registers and avoid jumping through
60 * the wrapper functions.
55 * 61 *
56 * I skipped over our first piece of assembler, but this one is worth studying 62 * I skipped over our first piece of assembler, but this one is worth studying
57 * in a bit more detail so I'll describe in easy stages. First, the routine 63 * in a bit more detail so I'll describe in easy stages. First, the routine to
58 * to enable interrupts: */ 64 * enable interrupts:
65 */
59ENTRY(lg_irq_enable) 66ENTRY(lg_irq_enable)
60 /* The reverse of irq_disable, this sets lguest_data.irq_enabled to 67 /*
61 * X86_EFLAGS_IF (ie. "Interrupts enabled"). */ 68 * The reverse of irq_disable, this sets lguest_data.irq_enabled to
69 * X86_EFLAGS_IF (ie. "Interrupts enabled").
70 */
62 movl $X86_EFLAGS_IF, lguest_data+LGUEST_DATA_irq_enabled 71 movl $X86_EFLAGS_IF, lguest_data+LGUEST_DATA_irq_enabled
63 /* But now we need to check if the Host wants to know: there might have 72 /*
73 * But now we need to check if the Host wants to know: there might have
64 * been interrupts waiting to be delivered, in which case it will have 74 * been interrupts waiting to be delivered, in which case it will have
65 * set lguest_data.irq_pending to X86_EFLAGS_IF. If it's not zero, we 75 * set lguest_data.irq_pending to X86_EFLAGS_IF. If it's not zero, we
66 * jump to send_interrupts, otherwise we're done. */ 76 * jump to send_interrupts, otherwise we're done.
77 */
67 testl $0, lguest_data+LGUEST_DATA_irq_pending 78 testl $0, lguest_data+LGUEST_DATA_irq_pending
68 jnz send_interrupts 79 jnz send_interrupts
69 /* One cool thing about x86 is that you can do many things without using 80 /*
81 * One cool thing about x86 is that you can do many things without using
70 * a register. In this case, the normal path hasn't needed to save or 82 * a register. In this case, the normal path hasn't needed to save or
71 * restore any registers at all! */ 83 * restore any registers at all!
84 */
72 ret 85 ret
73send_interrupts: 86send_interrupts:
74 /* OK, now we need a register: eax is used for the hypercall number, 87 /*
88 * OK, now we need a register: eax is used for the hypercall number,
75 * which is LHCALL_SEND_INTERRUPTS. 89 * which is LHCALL_SEND_INTERRUPTS.
76 * 90 *
77 * We used not to bother with this pending detection at all, which was 91 * We used not to bother with this pending detection at all, which was
78 * much simpler. Sooner or later the Host would realize it had to 92 * much simpler. Sooner or later the Host would realize it had to
79 * send us an interrupt. But that turns out to make performance 7 93 * send us an interrupt. But that turns out to make performance 7
80 * times worse on a simple tcp benchmark. So now we do this the hard 94 * times worse on a simple tcp benchmark. So now we do this the hard
81 * way. */ 95 * way.
96 */
82 pushl %eax 97 pushl %eax
83 movl $LHCALL_SEND_INTERRUPTS, %eax 98 movl $LHCALL_SEND_INTERRUPTS, %eax
84 /* This is a vmcall instruction (same thing that KVM uses). Older 99 /*
100 * This is a vmcall instruction (same thing that KVM uses). Older
85 * assembler versions might not know the "vmcall" instruction, so we 101 * assembler versions might not know the "vmcall" instruction, so we
86 * create one manually here. */ 102 * create one manually here.
103 */
87 .byte 0x0f,0x01,0xc1 /* KVM_HYPERCALL */ 104 .byte 0x0f,0x01,0xc1 /* KVM_HYPERCALL */
105 /* Put eax back the way we found it. */
88 popl %eax 106 popl %eax
89 ret 107 ret
90 108
91/* Finally, the "popf" or "restore flags" routine. The %eax register holds the 109/*
110 * Finally, the "popf" or "restore flags" routine. The %eax register holds the
92 * flags (in practice, either X86_EFLAGS_IF or 0): if it's X86_EFLAGS_IF we're 111 * flags (in practice, either X86_EFLAGS_IF or 0): if it's X86_EFLAGS_IF we're
93 * enabling interrupts again, if it's 0 we're leaving them off. */ 112 * enabling interrupts again, if it's 0 we're leaving them off.
113 */
94ENTRY(lg_restore_fl) 114ENTRY(lg_restore_fl)
95 /* This is just "lguest_data.irq_enabled = flags;" */ 115 /* This is just "lguest_data.irq_enabled = flags;" */
96 movl %eax, lguest_data+LGUEST_DATA_irq_enabled 116 movl %eax, lguest_data+LGUEST_DATA_irq_enabled
97 /* Now, if the %eax value has enabled interrupts and 117 /*
118 * Now, if the %eax value has enabled interrupts and
98 * lguest_data.irq_pending is set, we want to tell the Host so it can 119 * lguest_data.irq_pending is set, we want to tell the Host so it can
99 * deliver any outstanding interrupts. Fortunately, both values will 120 * deliver any outstanding interrupts. Fortunately, both values will
100 * be X86_EFLAGS_IF (ie. 512) in that case, and the "testl" 121 * be X86_EFLAGS_IF (ie. 512) in that case, and the "testl"
101 * instruction will AND them together for us. If both are set, we 122 * instruction will AND them together for us. If both are set, we
102 * jump to send_interrupts. */ 123 * jump to send_interrupts.
124 */
103 testl lguest_data+LGUEST_DATA_irq_pending, %eax 125 testl lguest_data+LGUEST_DATA_irq_pending, %eax
104 jnz send_interrupts 126 jnz send_interrupts
105 /* Again, the normal path has used no extra registers. Clever, huh? */ 127 /* Again, the normal path has used no extra registers. Clever, huh? */
106 ret 128 ret
129/*:*/
107 130
108/* These demark the EIP range where host should never deliver interrupts. */ 131/* These demark the EIP range where host should never deliver interrupts. */
109.global lguest_noirq_start 132.global lguest_noirq_start
110.global lguest_noirq_end 133.global lguest_noirq_end
111 134
112/*M:004 When the Host reflects a trap or injects an interrupt into the Guest, 135/*M:004
113 * it sets the eflags interrupt bit on the stack based on 136 * When the Host reflects a trap or injects an interrupt into the Guest, it
114 * lguest_data.irq_enabled, so the Guest iret logic does the right thing when 137 * sets the eflags interrupt bit on the stack based on lguest_data.irq_enabled,
115 * restoring it. However, when the Host sets the Guest up for direct traps, 138 * so the Guest iret logic does the right thing when restoring it. However,
116 * such as system calls, the processor is the one to push eflags onto the 139 * when the Host sets the Guest up for direct traps, such as system calls, the
117 * stack, and the interrupt bit will be 1 (in reality, interrupts are always 140 * processor is the one to push eflags onto the stack, and the interrupt bit
118 * enabled in the Guest). 141 * will be 1 (in reality, interrupts are always enabled in the Guest).
119 * 142 *
120 * This turns out to be harmless: the only trap which should happen under Linux 143 * This turns out to be harmless: the only trap which should happen under Linux
121 * with interrupts disabled is Page Fault (due to our lazy mapping of vmalloc 144 * with interrupts disabled is Page Fault (due to our lazy mapping of vmalloc
122 * regions), which has to be reflected through the Host anyway. If another 145 * regions), which has to be reflected through the Host anyway. If another
123 * trap *does* go off when interrupts are disabled, the Guest will panic, and 146 * trap *does* go off when interrupts are disabled, the Guest will panic, and
124 * we'll never get to this iret! :*/ 147 * we'll never get to this iret!
148:*/
125 149
126/*G:045 There is one final paravirt_op that the Guest implements, and glancing 150/*G:045
127 * at it you can see why I left it to last. It's *cool*! It's in *assembler*! 151 * There is one final paravirt_op that the Guest implements, and glancing at it
152 * you can see why I left it to last. It's *cool*! It's in *assembler*!
128 * 153 *
129 * The "iret" instruction is used to return from an interrupt or trap. The 154 * The "iret" instruction is used to return from an interrupt or trap. The
130 * stack looks like this: 155 * stack looks like this:
@@ -148,15 +173,18 @@ ENTRY(lg_restore_fl)
148 * return to userspace or wherever. Our solution to this is to surround the 173 * return to userspace or wherever. Our solution to this is to surround the
149 * code with lguest_noirq_start: and lguest_noirq_end: labels. We tell the 174 * code with lguest_noirq_start: and lguest_noirq_end: labels. We tell the
150 * Host that it is *never* to interrupt us there, even if interrupts seem to be 175 * Host that it is *never* to interrupt us there, even if interrupts seem to be
151 * enabled. */ 176 * enabled.
177 */
152ENTRY(lguest_iret) 178ENTRY(lguest_iret)
153 pushl %eax 179 pushl %eax
154 movl 12(%esp), %eax 180 movl 12(%esp), %eax
155lguest_noirq_start: 181lguest_noirq_start:
156 /* Note the %ss: segment prefix here. Normal data accesses use the 182 /*
183 * Note the %ss: segment prefix here. Normal data accesses use the
157 * "ds" segment, but that will have already been restored for whatever 184 * "ds" segment, but that will have already been restored for whatever
158 * we're returning to (such as userspace): we can't trust it. The %ss: 185 * we're returning to (such as userspace): we can't trust it. The %ss:
159 * prefix makes sure we use the stack segment, which is still valid. */ 186 * prefix makes sure we use the stack segment, which is still valid.
187 */
160 movl %eax,%ss:lguest_data+LGUEST_DATA_irq_enabled 188 movl %eax,%ss:lguest_data+LGUEST_DATA_irq_enabled
161 popl %eax 189 popl %eax
162 iret 190 iret
diff --git a/arch/x86/lib/Makefile b/arch/x86/lib/Makefile
index f9d35632666b..07c31899c9c2 100644
--- a/arch/x86/lib/Makefile
+++ b/arch/x86/lib/Makefile
@@ -10,6 +10,7 @@ lib-y += usercopy_$(BITS).o getuser.o putuser.o
10lib-y += memcpy_$(BITS).o 10lib-y += memcpy_$(BITS).o
11 11
12ifeq ($(CONFIG_X86_32),y) 12ifeq ($(CONFIG_X86_32),y)
13 obj-y += atomic64_32.o
13 lib-y += checksum_32.o 14 lib-y += checksum_32.o
14 lib-y += strstr_32.o 15 lib-y += strstr_32.o
15 lib-y += semaphore_32.o string_32.o 16 lib-y += semaphore_32.o string_32.o
diff --git a/arch/x86/lib/atomic64_32.c b/arch/x86/lib/atomic64_32.c
new file mode 100644
index 000000000000..824fa0be55a3
--- /dev/null
+++ b/arch/x86/lib/atomic64_32.c
@@ -0,0 +1,230 @@
1#include <linux/compiler.h>
2#include <linux/module.h>
3#include <linux/types.h>
4
5#include <asm/processor.h>
6#include <asm/cmpxchg.h>
7#include <asm/atomic.h>
8
9static noinline u64 cmpxchg8b(u64 *ptr, u64 old, u64 new)
10{
11 u32 low = new;
12 u32 high = new >> 32;
13
14 asm volatile(
15 LOCK_PREFIX "cmpxchg8b %1\n"
16 : "+A" (old), "+m" (*ptr)
17 : "b" (low), "c" (high)
18 );
19 return old;
20}
21
22u64 atomic64_cmpxchg(atomic64_t *ptr, u64 old_val, u64 new_val)
23{
24 return cmpxchg8b(&ptr->counter, old_val, new_val);
25}
26EXPORT_SYMBOL(atomic64_cmpxchg);
27
28/**
29 * atomic64_xchg - xchg atomic64 variable
30 * @ptr: pointer to type atomic64_t
31 * @new_val: value to assign
32 *
33 * Atomically xchgs the value of @ptr to @new_val and returns
34 * the old value.
35 */
36u64 atomic64_xchg(atomic64_t *ptr, u64 new_val)
37{
38 /*
39 * Try first with a (possibly incorrect) assumption about
40 * what we have there. We'll do two loops most likely,
41 * but we'll get an ownership MESI transaction straight away
42 * instead of a read transaction followed by a
43 * flush-for-ownership transaction:
44 */
45 u64 old_val, real_val = 0;
46
47 do {
48 old_val = real_val;
49
50 real_val = atomic64_cmpxchg(ptr, old_val, new_val);
51
52 } while (real_val != old_val);
53
54 return old_val;
55}
56EXPORT_SYMBOL(atomic64_xchg);
57
58/**
59 * atomic64_set - set atomic64 variable
60 * @ptr: pointer to type atomic64_t
61 * @new_val: value to assign
62 *
63 * Atomically sets the value of @ptr to @new_val.
64 */
65void atomic64_set(atomic64_t *ptr, u64 new_val)
66{
67 atomic64_xchg(ptr, new_val);
68}
69EXPORT_SYMBOL(atomic64_set);
70
71/**
72EXPORT_SYMBOL(atomic64_read);
73 * atomic64_add_return - add and return
74 * @delta: integer value to add
75 * @ptr: pointer to type atomic64_t
76 *
77 * Atomically adds @delta to @ptr and returns @delta + *@ptr
78 */
79noinline u64 atomic64_add_return(u64 delta, atomic64_t *ptr)
80{
81 /*
82 * Try first with a (possibly incorrect) assumption about
83 * what we have there. We'll do two loops most likely,
84 * but we'll get an ownership MESI transaction straight away
85 * instead of a read transaction followed by a
86 * flush-for-ownership transaction:
87 */
88 u64 old_val, new_val, real_val = 0;
89
90 do {
91 old_val = real_val;
92 new_val = old_val + delta;
93
94 real_val = atomic64_cmpxchg(ptr, old_val, new_val);
95
96 } while (real_val != old_val);
97
98 return new_val;
99}
100EXPORT_SYMBOL(atomic64_add_return);
101
102u64 atomic64_sub_return(u64 delta, atomic64_t *ptr)
103{
104 return atomic64_add_return(-delta, ptr);
105}
106EXPORT_SYMBOL(atomic64_sub_return);
107
108u64 atomic64_inc_return(atomic64_t *ptr)
109{
110 return atomic64_add_return(1, ptr);
111}
112EXPORT_SYMBOL(atomic64_inc_return);
113
114u64 atomic64_dec_return(atomic64_t *ptr)
115{
116 return atomic64_sub_return(1, ptr);
117}
118EXPORT_SYMBOL(atomic64_dec_return);
119
120/**
121 * atomic64_add - add integer to atomic64 variable
122 * @delta: integer value to add
123 * @ptr: pointer to type atomic64_t
124 *
125 * Atomically adds @delta to @ptr.
126 */
127void atomic64_add(u64 delta, atomic64_t *ptr)
128{
129 atomic64_add_return(delta, ptr);
130}
131EXPORT_SYMBOL(atomic64_add);
132
133/**
134 * atomic64_sub - subtract the atomic64 variable
135 * @delta: integer value to subtract
136 * @ptr: pointer to type atomic64_t
137 *
138 * Atomically subtracts @delta from @ptr.
139 */
140void atomic64_sub(u64 delta, atomic64_t *ptr)
141{
142 atomic64_add(-delta, ptr);
143}
144EXPORT_SYMBOL(atomic64_sub);
145
146/**
147 * atomic64_sub_and_test - subtract value from variable and test result
148 * @delta: integer value to subtract
149 * @ptr: pointer to type atomic64_t
150 *
151 * Atomically subtracts @delta from @ptr and returns
152 * true if the result is zero, or false for all
153 * other cases.
154 */
155int atomic64_sub_and_test(u64 delta, atomic64_t *ptr)
156{
157 u64 new_val = atomic64_sub_return(delta, ptr);
158
159 return new_val == 0;
160}
161EXPORT_SYMBOL(atomic64_sub_and_test);
162
163/**
164 * atomic64_inc - increment atomic64 variable
165 * @ptr: pointer to type atomic64_t
166 *
167 * Atomically increments @ptr by 1.
168 */
169void atomic64_inc(atomic64_t *ptr)
170{
171 atomic64_add(1, ptr);
172}
173EXPORT_SYMBOL(atomic64_inc);
174
175/**
176 * atomic64_dec - decrement atomic64 variable
177 * @ptr: pointer to type atomic64_t
178 *
179 * Atomically decrements @ptr by 1.
180 */
181void atomic64_dec(atomic64_t *ptr)
182{
183 atomic64_sub(1, ptr);
184}
185EXPORT_SYMBOL(atomic64_dec);
186
187/**
188 * atomic64_dec_and_test - decrement and test
189 * @ptr: pointer to type atomic64_t
190 *
191 * Atomically decrements @ptr by 1 and
192 * returns true if the result is 0, or false for all other
193 * cases.
194 */
195int atomic64_dec_and_test(atomic64_t *ptr)
196{
197 return atomic64_sub_and_test(1, ptr);
198}
199EXPORT_SYMBOL(atomic64_dec_and_test);
200
201/**
202 * atomic64_inc_and_test - increment and test
203 * @ptr: pointer to type atomic64_t
204 *
205 * Atomically increments @ptr by 1
206 * and returns true if the result is zero, or false for all
207 * other cases.
208 */
209int atomic64_inc_and_test(atomic64_t *ptr)
210{
211 return atomic64_sub_and_test(-1, ptr);
212}
213EXPORT_SYMBOL(atomic64_inc_and_test);
214
215/**
216 * atomic64_add_negative - add and test if negative
217 * @delta: integer value to add
218 * @ptr: pointer to type atomic64_t
219 *
220 * Atomically adds @delta to @ptr and returns true
221 * if the result is negative, or false when
222 * result is greater than or equal to zero.
223 */
224int atomic64_add_negative(u64 delta, atomic64_t *ptr)
225{
226 s64 new_val = atomic64_add_return(delta, ptr);
227
228 return new_val < 0;
229}
230EXPORT_SYMBOL(atomic64_add_negative);
diff --git a/arch/x86/lib/clear_page_64.S b/arch/x86/lib/clear_page_64.S
index 9a10a78bb4a4..ebeafcce04a9 100644
--- a/arch/x86/lib/clear_page_64.S
+++ b/arch/x86/lib/clear_page_64.S
@@ -5,15 +5,14 @@
5 * Zero a page. 5 * Zero a page.
6 * rdi page 6 * rdi page
7 */ 7 */
8 ALIGN 8ENTRY(clear_page_c)
9clear_page_c:
10 CFI_STARTPROC 9 CFI_STARTPROC
11 movl $4096/8,%ecx 10 movl $4096/8,%ecx
12 xorl %eax,%eax 11 xorl %eax,%eax
13 rep stosq 12 rep stosq
14 ret 13 ret
15 CFI_ENDPROC 14 CFI_ENDPROC
16ENDPROC(clear_page) 15ENDPROC(clear_page_c)
17 16
18ENTRY(clear_page) 17ENTRY(clear_page)
19 CFI_STARTPROC 18 CFI_STARTPROC
diff --git a/arch/x86/lib/copy_user_64.S b/arch/x86/lib/copy_user_64.S
index f118c110af32..6ba0f7bb85ea 100644
--- a/arch/x86/lib/copy_user_64.S
+++ b/arch/x86/lib/copy_user_64.S
@@ -75,6 +75,7 @@ ENTRY(copy_to_user)
75 jae bad_to_user 75 jae bad_to_user
76 ALTERNATIVE_JUMP X86_FEATURE_REP_GOOD,copy_user_generic_unrolled,copy_user_generic_string 76 ALTERNATIVE_JUMP X86_FEATURE_REP_GOOD,copy_user_generic_unrolled,copy_user_generic_string
77 CFI_ENDPROC 77 CFI_ENDPROC
78ENDPROC(copy_to_user)
78 79
79/* Standard copy_from_user with segment limit checking */ 80/* Standard copy_from_user with segment limit checking */
80ENTRY(copy_from_user) 81ENTRY(copy_from_user)
diff --git a/arch/x86/lib/delay.c b/arch/x86/lib/delay.c
index f4568605d7d5..ff485d361182 100644
--- a/arch/x86/lib/delay.c
+++ b/arch/x86/lib/delay.c
@@ -55,8 +55,10 @@ static void delay_tsc(unsigned long loops)
55 55
56 preempt_disable(); 56 preempt_disable();
57 cpu = smp_processor_id(); 57 cpu = smp_processor_id();
58 rdtsc_barrier();
58 rdtscl(bclock); 59 rdtscl(bclock);
59 for (;;) { 60 for (;;) {
61 rdtsc_barrier();
60 rdtscl(now); 62 rdtscl(now);
61 if ((now - bclock) >= loops) 63 if ((now - bclock) >= loops)
62 break; 64 break;
@@ -78,6 +80,7 @@ static void delay_tsc(unsigned long loops)
78 if (unlikely(cpu != smp_processor_id())) { 80 if (unlikely(cpu != smp_processor_id())) {
79 loops -= (now - bclock); 81 loops -= (now - bclock);
80 cpu = smp_processor_id(); 82 cpu = smp_processor_id();
83 rdtsc_barrier();
81 rdtscl(bclock); 84 rdtscl(bclock);
82 } 85 }
83 } 86 }
diff --git a/arch/x86/lib/msr.c b/arch/x86/lib/msr.c
index 1440b9c0547e..caa24aca8115 100644
--- a/arch/x86/lib/msr.c
+++ b/arch/x86/lib/msr.c
@@ -89,16 +89,13 @@ void rdmsr_on_cpus(const cpumask_t *mask, u32 msr_no, struct msr *msrs)
89 rv.msrs = msrs; 89 rv.msrs = msrs;
90 rv.msr_no = msr_no; 90 rv.msr_no = msr_no;
91 91
92 preempt_disable(); 92 this_cpu = get_cpu();
93 /* 93
94 * FIXME: handle the CPU we're executing on separately for now until 94 if (cpumask_test_cpu(this_cpu, mask))
95 * smp_call_function_many has been fixed to not skip it. 95 __rdmsr_on_cpu(&rv);
96 */
97 this_cpu = raw_smp_processor_id();
98 smp_call_function_single(this_cpu, __rdmsr_on_cpu, &rv, 1);
99 96
100 smp_call_function_many(mask, __rdmsr_on_cpu, &rv, 1); 97 smp_call_function_many(mask, __rdmsr_on_cpu, &rv, 1);
101 preempt_enable(); 98 put_cpu();
102} 99}
103EXPORT_SYMBOL(rdmsr_on_cpus); 100EXPORT_SYMBOL(rdmsr_on_cpus);
104 101
@@ -121,16 +118,13 @@ void wrmsr_on_cpus(const cpumask_t *mask, u32 msr_no, struct msr *msrs)
121 rv.msrs = msrs; 118 rv.msrs = msrs;
122 rv.msr_no = msr_no; 119 rv.msr_no = msr_no;
123 120
124 preempt_disable(); 121 this_cpu = get_cpu();
125 /* 122
126 * FIXME: handle the CPU we're executing on separately for now until 123 if (cpumask_test_cpu(this_cpu, mask))
127 * smp_call_function_many has been fixed to not skip it. 124 __wrmsr_on_cpu(&rv);
128 */
129 this_cpu = raw_smp_processor_id();
130 smp_call_function_single(this_cpu, __wrmsr_on_cpu, &rv, 1);
131 125
132 smp_call_function_many(mask, __wrmsr_on_cpu, &rv, 1); 126 smp_call_function_many(mask, __wrmsr_on_cpu, &rv, 1);
133 preempt_enable(); 127 put_cpu();
134} 128}
135EXPORT_SYMBOL(wrmsr_on_cpus); 129EXPORT_SYMBOL(wrmsr_on_cpus);
136 130
diff --git a/arch/x86/lib/usercopy_32.c b/arch/x86/lib/usercopy_32.c
index 7c8ca91bb9ec..1f118d462acc 100644
--- a/arch/x86/lib/usercopy_32.c
+++ b/arch/x86/lib/usercopy_32.c
@@ -751,7 +751,7 @@ survive:
751 751
752 if (retval == -ENOMEM && is_global_init(current)) { 752 if (retval == -ENOMEM && is_global_init(current)) {
753 up_read(&current->mm->mmap_sem); 753 up_read(&current->mm->mmap_sem);
754 congestion_wait(WRITE, HZ/50); 754 congestion_wait(BLK_RW_ASYNC, HZ/50);
755 goto survive; 755 goto survive;
756 } 756 }
757 757
diff --git a/arch/x86/mm/fault.c b/arch/x86/mm/fault.c
index 78a5fff857be..bfae139182ff 100644
--- a/arch/x86/mm/fault.c
+++ b/arch/x86/mm/fault.c
@@ -426,10 +426,11 @@ static noinline int vmalloc_fault(unsigned long address)
426} 426}
427 427
428static const char errata93_warning[] = 428static const char errata93_warning[] =
429KERN_ERR "******* Your BIOS seems to not contain a fix for K8 errata #93\n" 429KERN_ERR
430KERN_ERR "******* Working around it, but it may cause SEGVs or burn power.\n" 430"******* Your BIOS seems to not contain a fix for K8 errata #93\n"
431KERN_ERR "******* Please consider a BIOS update.\n" 431"******* Working around it, but it may cause SEGVs or burn power.\n"
432KERN_ERR "******* Disabling USB legacy in the BIOS may also help.\n"; 432"******* Please consider a BIOS update.\n"
433"******* Disabling USB legacy in the BIOS may also help.\n";
433 434
434/* 435/*
435 * No vm86 mode in 64-bit mode: 436 * No vm86 mode in 64-bit mode:
@@ -696,7 +697,7 @@ show_signal_msg(struct pt_regs *regs, unsigned long error_code,
696 if (!printk_ratelimit()) 697 if (!printk_ratelimit())
697 return; 698 return;
698 699
699 printk(KERN_CONT "%s%s[%d]: segfault at %lx ip %p sp %p error %lx", 700 printk("%s%s[%d]: segfault at %lx ip %p sp %p error %lx",
700 task_pid_nr(tsk) > 1 ? KERN_INFO : KERN_EMERG, 701 task_pid_nr(tsk) > 1 ? KERN_INFO : KERN_EMERG,
701 tsk->comm, task_pid_nr(tsk), address, 702 tsk->comm, task_pid_nr(tsk), address,
702 (void *)regs->ip, (void *)regs->sp, error_code); 703 (void *)regs->ip, (void *)regs->sp, error_code);
diff --git a/arch/x86/mm/highmem_32.c b/arch/x86/mm/highmem_32.c
index 58f621e81919..2112ed55e7ea 100644
--- a/arch/x86/mm/highmem_32.c
+++ b/arch/x86/mm/highmem_32.c
@@ -103,6 +103,7 @@ EXPORT_SYMBOL(kmap);
103EXPORT_SYMBOL(kunmap); 103EXPORT_SYMBOL(kunmap);
104EXPORT_SYMBOL(kmap_atomic); 104EXPORT_SYMBOL(kmap_atomic);
105EXPORT_SYMBOL(kunmap_atomic); 105EXPORT_SYMBOL(kunmap_atomic);
106EXPORT_SYMBOL(kmap_atomic_prot);
106 107
107void __init set_highmem_pages_init(void) 108void __init set_highmem_pages_init(void)
108{ 109{
diff --git a/arch/x86/mm/init.c b/arch/x86/mm/init.c
index f53b57e4086f..0607119cef94 100644
--- a/arch/x86/mm/init.c
+++ b/arch/x86/mm/init.c
@@ -12,6 +12,7 @@
12#include <asm/system.h> 12#include <asm/system.h>
13#include <asm/tlbflush.h> 13#include <asm/tlbflush.h>
14#include <asm/tlb.h> 14#include <asm/tlb.h>
15#include <asm/proto.h>
15 16
16DEFINE_PER_CPU(struct mmu_gather, mmu_gathers); 17DEFINE_PER_CPU(struct mmu_gather, mmu_gathers);
17 18
@@ -177,20 +178,6 @@ static int __meminit save_mr(struct map_range *mr, int nr_range,
177 return nr_range; 178 return nr_range;
178} 179}
179 180
180#ifdef CONFIG_X86_64
181static void __init init_gbpages(void)
182{
183 if (direct_gbpages && cpu_has_gbpages)
184 printk(KERN_INFO "Using GB pages for direct mapping\n");
185 else
186 direct_gbpages = 0;
187}
188#else
189static inline void init_gbpages(void)
190{
191}
192#endif
193
194/* 181/*
195 * Setup the direct mapping of the physical memory at PAGE_OFFSET. 182 * Setup the direct mapping of the physical memory at PAGE_OFFSET.
196 * This runs before bootmem is initialized and gets pages directly from 183 * This runs before bootmem is initialized and gets pages directly from
@@ -210,9 +197,6 @@ unsigned long __init_refok init_memory_mapping(unsigned long start,
210 197
211 printk(KERN_INFO "init_memory_mapping: %016lx-%016lx\n", start, end); 198 printk(KERN_INFO "init_memory_mapping: %016lx-%016lx\n", start, end);
212 199
213 if (!after_bootmem)
214 init_gbpages();
215
216#if defined(CONFIG_DEBUG_PAGEALLOC) || defined(CONFIG_KMEMCHECK) 200#if defined(CONFIG_DEBUG_PAGEALLOC) || defined(CONFIG_KMEMCHECK)
217 /* 201 /*
218 * For CONFIG_DEBUG_PAGEALLOC, identity mapping will use small pages. 202 * For CONFIG_DEBUG_PAGEALLOC, identity mapping will use small pages.
diff --git a/arch/x86/mm/init_64.c b/arch/x86/mm/init_64.c
index c4378f4fd4a5..6176fe8f29e0 100644
--- a/arch/x86/mm/init_64.c
+++ b/arch/x86/mm/init_64.c
@@ -598,6 +598,15 @@ void __init paging_init(void)
598 598
599 sparse_memory_present_with_active_regions(MAX_NUMNODES); 599 sparse_memory_present_with_active_regions(MAX_NUMNODES);
600 sparse_init(); 600 sparse_init();
601
602 /*
603 * clear the default setting with node 0
604 * note: don't use nodes_clear here, that is really clearing when
605 * numa support is not compiled in, and later node_set_state
606 * will not set it back.
607 */
608 node_clear_state(0, N_NORMAL_MEMORY);
609
601 free_area_init_nodes(max_zone_pfns); 610 free_area_init_nodes(max_zone_pfns);
602} 611}
603 612
diff --git a/arch/x86/mm/pageattr.c b/arch/x86/mm/pageattr.c
index 3cfe9ced8a4c..7e600c1962db 100644
--- a/arch/x86/mm/pageattr.c
+++ b/arch/x86/mm/pageattr.c
@@ -11,6 +11,7 @@
11#include <linux/interrupt.h> 11#include <linux/interrupt.h>
12#include <linux/seq_file.h> 12#include <linux/seq_file.h>
13#include <linux/debugfs.h> 13#include <linux/debugfs.h>
14#include <linux/pfn.h>
14 15
15#include <asm/e820.h> 16#include <asm/e820.h>
16#include <asm/processor.h> 17#include <asm/processor.h>
@@ -590,9 +591,12 @@ static int __change_page_attr(struct cpa_data *cpa, int primary)
590 unsigned int level; 591 unsigned int level;
591 pte_t *kpte, old_pte; 592 pte_t *kpte, old_pte;
592 593
593 if (cpa->flags & CPA_PAGES_ARRAY) 594 if (cpa->flags & CPA_PAGES_ARRAY) {
594 address = (unsigned long)page_address(cpa->pages[cpa->curpage]); 595 struct page *page = cpa->pages[cpa->curpage];
595 else if (cpa->flags & CPA_ARRAY) 596 if (unlikely(PageHighMem(page)))
597 return 0;
598 address = (unsigned long)page_address(page);
599 } else if (cpa->flags & CPA_ARRAY)
596 address = cpa->vaddr[cpa->curpage]; 600 address = cpa->vaddr[cpa->curpage];
597 else 601 else
598 address = *cpa->vaddr; 602 address = *cpa->vaddr;
@@ -681,8 +685,9 @@ static int __change_page_attr_set_clr(struct cpa_data *cpa, int checkalias);
681static int cpa_process_alias(struct cpa_data *cpa) 685static int cpa_process_alias(struct cpa_data *cpa)
682{ 686{
683 struct cpa_data alias_cpa; 687 struct cpa_data alias_cpa;
684 int ret = 0; 688 unsigned long laddr = (unsigned long)__va(cpa->pfn << PAGE_SHIFT);
685 unsigned long temp_cpa_vaddr, vaddr; 689 unsigned long vaddr, remapped;
690 int ret;
686 691
687 if (cpa->pfn >= max_pfn_mapped) 692 if (cpa->pfn >= max_pfn_mapped)
688 return 0; 693 return 0;
@@ -695,9 +700,12 @@ static int cpa_process_alias(struct cpa_data *cpa)
695 * No need to redo, when the primary call touched the direct 700 * No need to redo, when the primary call touched the direct
696 * mapping already: 701 * mapping already:
697 */ 702 */
698 if (cpa->flags & CPA_PAGES_ARRAY) 703 if (cpa->flags & CPA_PAGES_ARRAY) {
699 vaddr = (unsigned long)page_address(cpa->pages[cpa->curpage]); 704 struct page *page = cpa->pages[cpa->curpage];
700 else if (cpa->flags & CPA_ARRAY) 705 if (unlikely(PageHighMem(page)))
706 return 0;
707 vaddr = (unsigned long)page_address(page);
708 } else if (cpa->flags & CPA_ARRAY)
701 vaddr = cpa->vaddr[cpa->curpage]; 709 vaddr = cpa->vaddr[cpa->curpage];
702 else 710 else
703 vaddr = *cpa->vaddr; 711 vaddr = *cpa->vaddr;
@@ -706,42 +714,55 @@ static int cpa_process_alias(struct cpa_data *cpa)
706 PAGE_OFFSET + (max_pfn_mapped << PAGE_SHIFT)))) { 714 PAGE_OFFSET + (max_pfn_mapped << PAGE_SHIFT)))) {
707 715
708 alias_cpa = *cpa; 716 alias_cpa = *cpa;
709 temp_cpa_vaddr = (unsigned long) __va(cpa->pfn << PAGE_SHIFT); 717 alias_cpa.vaddr = &laddr;
710 alias_cpa.vaddr = &temp_cpa_vaddr;
711 alias_cpa.flags &= ~(CPA_PAGES_ARRAY | CPA_ARRAY); 718 alias_cpa.flags &= ~(CPA_PAGES_ARRAY | CPA_ARRAY);
712 719
713
714 ret = __change_page_attr_set_clr(&alias_cpa, 0); 720 ret = __change_page_attr_set_clr(&alias_cpa, 0);
721 if (ret)
722 return ret;
715 } 723 }
716 724
717#ifdef CONFIG_X86_64 725#ifdef CONFIG_X86_64
718 if (ret)
719 return ret;
720 /*
721 * No need to redo, when the primary call touched the high
722 * mapping already:
723 */
724 if (within(vaddr, (unsigned long) _text, _brk_end))
725 return 0;
726
727 /* 726 /*
728 * If the physical address is inside the kernel map, we need 727 * If the primary call didn't touch the high mapping already
728 * and the physical address is inside the kernel map, we need
729 * to touch the high mapped kernel as well: 729 * to touch the high mapped kernel as well:
730 */ 730 */
731 if (!within(cpa->pfn, highmap_start_pfn(), highmap_end_pfn())) 731 if (!within(vaddr, (unsigned long)_text, _brk_end) &&
732 return 0; 732 within(cpa->pfn, highmap_start_pfn(), highmap_end_pfn())) {
733 unsigned long temp_cpa_vaddr = (cpa->pfn << PAGE_SHIFT) +
734 __START_KERNEL_map - phys_base;
735 alias_cpa = *cpa;
736 alias_cpa.vaddr = &temp_cpa_vaddr;
737 alias_cpa.flags &= ~(CPA_PAGES_ARRAY | CPA_ARRAY);
733 738
734 alias_cpa = *cpa; 739 /*
735 temp_cpa_vaddr = (cpa->pfn << PAGE_SHIFT) + __START_KERNEL_map - phys_base; 740 * The high mapping range is imprecise, so ignore the
736 alias_cpa.vaddr = &temp_cpa_vaddr; 741 * return value.
737 alias_cpa.flags &= ~(CPA_PAGES_ARRAY | CPA_ARRAY); 742 */
743 __change_page_attr_set_clr(&alias_cpa, 0);
744 }
745#endif
738 746
739 /* 747 /*
740 * The high mapping range is imprecise, so ignore the return value. 748 * If the PMD page was partially used for per-cpu remapping,
749 * the recycled area needs to be split and modified. Because
750 * the area is always proper subset of a PMD page
751 * cpa->numpages is guaranteed to be 1 for these areas, so
752 * there's no need to loop over and check for further remaps.
741 */ 753 */
742 __change_page_attr_set_clr(&alias_cpa, 0); 754 remapped = (unsigned long)pcpu_lpage_remapped((void *)laddr);
743#endif 755 if (remapped) {
744 return ret; 756 WARN_ON(cpa->numpages > 1);
757 alias_cpa = *cpa;
758 alias_cpa.vaddr = &remapped;
759 alias_cpa.flags &= ~(CPA_PAGES_ARRAY | CPA_ARRAY);
760 ret = __change_page_attr_set_clr(&alias_cpa, 0);
761 if (ret)
762 return ret;
763 }
764
765 return 0;
745} 766}
746 767
747static int __change_page_attr_set_clr(struct cpa_data *cpa, int checkalias) 768static int __change_page_attr_set_clr(struct cpa_data *cpa, int checkalias)
@@ -982,12 +1003,15 @@ EXPORT_SYMBOL(set_memory_array_uc);
982int _set_memory_wc(unsigned long addr, int numpages) 1003int _set_memory_wc(unsigned long addr, int numpages)
983{ 1004{
984 int ret; 1005 int ret;
1006 unsigned long addr_copy = addr;
1007
985 ret = change_page_attr_set(&addr, numpages, 1008 ret = change_page_attr_set(&addr, numpages,
986 __pgprot(_PAGE_CACHE_UC_MINUS), 0); 1009 __pgprot(_PAGE_CACHE_UC_MINUS), 0);
987
988 if (!ret) { 1010 if (!ret) {
989 ret = change_page_attr_set(&addr, numpages, 1011 ret = change_page_attr_set_clr(&addr_copy, numpages,
990 __pgprot(_PAGE_CACHE_WC), 0); 1012 __pgprot(_PAGE_CACHE_WC),
1013 __pgprot(_PAGE_CACHE_MASK),
1014 0, 0, NULL);
991 } 1015 }
992 return ret; 1016 return ret;
993} 1017}
@@ -1104,7 +1128,9 @@ int set_pages_array_uc(struct page **pages, int addrinarray)
1104 int free_idx; 1128 int free_idx;
1105 1129
1106 for (i = 0; i < addrinarray; i++) { 1130 for (i = 0; i < addrinarray; i++) {
1107 start = (unsigned long)page_address(pages[i]); 1131 if (PageHighMem(pages[i]))
1132 continue;
1133 start = page_to_pfn(pages[i]) << PAGE_SHIFT;
1108 end = start + PAGE_SIZE; 1134 end = start + PAGE_SIZE;
1109 if (reserve_memtype(start, end, _PAGE_CACHE_UC_MINUS, NULL)) 1135 if (reserve_memtype(start, end, _PAGE_CACHE_UC_MINUS, NULL))
1110 goto err_out; 1136 goto err_out;
@@ -1117,7 +1143,9 @@ int set_pages_array_uc(struct page **pages, int addrinarray)
1117err_out: 1143err_out:
1118 free_idx = i; 1144 free_idx = i;
1119 for (i = 0; i < free_idx; i++) { 1145 for (i = 0; i < free_idx; i++) {
1120 start = (unsigned long)page_address(pages[i]); 1146 if (PageHighMem(pages[i]))
1147 continue;
1148 start = page_to_pfn(pages[i]) << PAGE_SHIFT;
1121 end = start + PAGE_SIZE; 1149 end = start + PAGE_SIZE;
1122 free_memtype(start, end); 1150 free_memtype(start, end);
1123 } 1151 }
@@ -1146,7 +1174,9 @@ int set_pages_array_wb(struct page **pages, int addrinarray)
1146 return retval; 1174 return retval;
1147 1175
1148 for (i = 0; i < addrinarray; i++) { 1176 for (i = 0; i < addrinarray; i++) {
1149 start = (unsigned long)page_address(pages[i]); 1177 if (PageHighMem(pages[i]))
1178 continue;
1179 start = page_to_pfn(pages[i]) << PAGE_SHIFT;
1150 end = start + PAGE_SIZE; 1180 end = start + PAGE_SIZE;
1151 free_memtype(start, end); 1181 free_memtype(start, end);
1152 } 1182 }
diff --git a/arch/x86/mm/pgtable.c b/arch/x86/mm/pgtable.c
index 8e43bdd45456..ed34f5e35999 100644
--- a/arch/x86/mm/pgtable.c
+++ b/arch/x86/mm/pgtable.c
@@ -25,7 +25,7 @@ pgtable_t pte_alloc_one(struct mm_struct *mm, unsigned long address)
25 return pte; 25 return pte;
26} 26}
27 27
28void __pte_free_tlb(struct mmu_gather *tlb, struct page *pte) 28void ___pte_free_tlb(struct mmu_gather *tlb, struct page *pte)
29{ 29{
30 pgtable_page_dtor(pte); 30 pgtable_page_dtor(pte);
31 paravirt_release_pte(page_to_pfn(pte)); 31 paravirt_release_pte(page_to_pfn(pte));
@@ -33,14 +33,14 @@ void __pte_free_tlb(struct mmu_gather *tlb, struct page *pte)
33} 33}
34 34
35#if PAGETABLE_LEVELS > 2 35#if PAGETABLE_LEVELS > 2
36void __pmd_free_tlb(struct mmu_gather *tlb, pmd_t *pmd) 36void ___pmd_free_tlb(struct mmu_gather *tlb, pmd_t *pmd)
37{ 37{
38 paravirt_release_pmd(__pa(pmd) >> PAGE_SHIFT); 38 paravirt_release_pmd(__pa(pmd) >> PAGE_SHIFT);
39 tlb_remove_page(tlb, virt_to_page(pmd)); 39 tlb_remove_page(tlb, virt_to_page(pmd));
40} 40}
41 41
42#if PAGETABLE_LEVELS > 3 42#if PAGETABLE_LEVELS > 3
43void __pud_free_tlb(struct mmu_gather *tlb, pud_t *pud) 43void ___pud_free_tlb(struct mmu_gather *tlb, pud_t *pud)
44{ 44{
45 paravirt_release_pud(__pa(pud) >> PAGE_SHIFT); 45 paravirt_release_pud(__pa(pud) >> PAGE_SHIFT);
46 tlb_remove_page(tlb, virt_to_page(pud)); 46 tlb_remove_page(tlb, virt_to_page(pud));
@@ -329,7 +329,6 @@ void __init reserve_top_address(unsigned long reserve)
329 printk(KERN_INFO "Reserving virtual address space above 0x%08x\n", 329 printk(KERN_INFO "Reserving virtual address space above 0x%08x\n",
330 (int)-reserve); 330 (int)-reserve);
331 __FIXADDR_TOP = -reserve - PAGE_SIZE; 331 __FIXADDR_TOP = -reserve - PAGE_SIZE;
332 __VMALLOC_RESERVE += reserve;
333#endif 332#endif
334} 333}
335 334
diff --git a/arch/x86/mm/srat_64.c b/arch/x86/mm/srat_64.c
index 2dfcbf9df2ae..dbb5381f7b3b 100644
--- a/arch/x86/mm/srat_64.c
+++ b/arch/x86/mm/srat_64.c
@@ -79,8 +79,10 @@ static __init void bad_srat(void)
79 acpi_numa = -1; 79 acpi_numa = -1;
80 for (i = 0; i < MAX_LOCAL_APIC; i++) 80 for (i = 0; i < MAX_LOCAL_APIC; i++)
81 apicid_to_node[i] = NUMA_NO_NODE; 81 apicid_to_node[i] = NUMA_NO_NODE;
82 for (i = 0; i < MAX_NUMNODES; i++) 82 for (i = 0; i < MAX_NUMNODES; i++) {
83 nodes_add[i].start = nodes[i].end = 0; 83 nodes[i].start = nodes[i].end = 0;
84 nodes_add[i].start = nodes_add[i].end = 0;
85 }
84 remove_all_active_ranges(); 86 remove_all_active_ranges();
85} 87}
86 88
diff --git a/arch/x86/oprofile/nmi_int.c b/arch/x86/oprofile/nmi_int.c
index b07dd8d0b321..89b9a5cd63da 100644
--- a/arch/x86/oprofile/nmi_int.c
+++ b/arch/x86/oprofile/nmi_int.c
@@ -390,7 +390,7 @@ static int __init p4_init(char **cpu_type)
390static int force_arch_perfmon; 390static int force_arch_perfmon;
391static int force_cpu_type(const char *str, struct kernel_param *kp) 391static int force_cpu_type(const char *str, struct kernel_param *kp)
392{ 392{
393 if (!strcmp(str, "archperfmon")) { 393 if (!strcmp(str, "arch_perfmon")) {
394 force_arch_perfmon = 1; 394 force_arch_perfmon = 1;
395 printk(KERN_INFO "oprofile: forcing architectural perfmon\n"); 395 printk(KERN_INFO "oprofile: forcing architectural perfmon\n");
396 } 396 }
diff --git a/arch/x86/pci/acpi.c b/arch/x86/pci/acpi.c
index b26626dc517c..1014eb4bfc37 100644
--- a/arch/x86/pci/acpi.c
+++ b/arch/x86/pci/acpi.c
@@ -68,6 +68,10 @@ setup_resource(struct acpi_resource *acpi_res, void *data)
68 unsigned long flags; 68 unsigned long flags;
69 struct resource *root; 69 struct resource *root;
70 int max_root_bus_resources = PCI_BUS_NUM_RESOURCES; 70 int max_root_bus_resources = PCI_BUS_NUM_RESOURCES;
71 u64 start, end;
72
73 if (bus_has_transparent_bridge(info->bus))
74 max_root_bus_resources -= 3;
71 75
72 status = resource_to_addr(acpi_res, &addr); 76 status = resource_to_addr(acpi_res, &addr);
73 if (!ACPI_SUCCESS(status)) 77 if (!ACPI_SUCCESS(status))
@@ -84,25 +88,24 @@ setup_resource(struct acpi_resource *acpi_res, void *data)
84 } else 88 } else
85 return AE_OK; 89 return AE_OK;
86 90
87 res = &info->res[info->res_num]; 91 start = addr.minimum + addr.translation_offset;
88 res->name = info->name; 92 end = start + addr.address_length - 1;
89 res->flags = flags;
90 res->start = addr.minimum + addr.translation_offset;
91 res->end = res->start + addr.address_length - 1;
92 res->child = NULL;
93
94 if (bus_has_transparent_bridge(info->bus))
95 max_root_bus_resources -= 3;
96 if (info->res_num >= max_root_bus_resources) { 93 if (info->res_num >= max_root_bus_resources) {
97 printk(KERN_WARNING "PCI: Failed to allocate 0x%lx-0x%lx " 94 printk(KERN_WARNING "PCI: Failed to allocate 0x%lx-0x%lx "
98 "from %s for %s due to _CRS returning more than " 95 "from %s for %s due to _CRS returning more than "
99 "%d resource descriptors\n", (unsigned long) res->start, 96 "%d resource descriptors\n", (unsigned long) start,
100 (unsigned long) res->end, root->name, info->name, 97 (unsigned long) end, root->name, info->name,
101 max_root_bus_resources); 98 max_root_bus_resources);
102 info->res_num++;
103 return AE_OK; 99 return AE_OK;
104 } 100 }
105 101
102 res = &info->res[info->res_num];
103 res->name = info->name;
104 res->flags = flags;
105 res->start = start;
106 res->end = end;
107 res->child = NULL;
108
106 if (insert_resource(root, res)) { 109 if (insert_resource(root, res)) {
107 printk(KERN_ERR "PCI: Failed to allocate 0x%lx-0x%lx " 110 printk(KERN_ERR "PCI: Failed to allocate 0x%lx-0x%lx "
108 "from %s for %s\n", (unsigned long) res->start, 111 "from %s for %s\n", (unsigned long) res->start,
@@ -115,23 +118,6 @@ setup_resource(struct acpi_resource *acpi_res, void *data)
115} 118}
116 119
117static void 120static void
118adjust_transparent_bridge_resources(struct pci_bus *bus)
119{
120 struct pci_dev *dev;
121
122 list_for_each_entry(dev, &bus->devices, bus_list) {
123 int i;
124 u16 class = dev->class >> 8;
125
126 if (class == PCI_CLASS_BRIDGE_PCI && dev->transparent) {
127 for(i = 3; i < PCI_BUS_NUM_RESOURCES; i++)
128 dev->subordinate->resource[i] =
129 dev->bus->resource[i - 3];
130 }
131 }
132}
133
134static void
135get_current_resources(struct acpi_device *device, int busnum, 121get_current_resources(struct acpi_device *device, int busnum,
136 int domain, struct pci_bus *bus) 122 int domain, struct pci_bus *bus)
137{ 123{
@@ -158,8 +144,6 @@ get_current_resources(struct acpi_device *device, int busnum,
158 info.res_num = 0; 144 info.res_num = 0;
159 acpi_walk_resources(device->handle, METHOD_NAME__CRS, setup_resource, 145 acpi_walk_resources(device->handle, METHOD_NAME__CRS, setup_resource,
160 &info); 146 &info);
161 if (info.res_num)
162 adjust_transparent_bridge_resources(bus);
163 147
164 return; 148 return;
165 149
@@ -222,8 +206,15 @@ struct pci_bus * __devinit pci_acpi_scan_root(struct acpi_device *device, int do
222 */ 206 */
223 memcpy(bus->sysdata, sd, sizeof(*sd)); 207 memcpy(bus->sysdata, sd, sizeof(*sd));
224 kfree(sd); 208 kfree(sd);
225 } else 209 } else {
226 bus = pci_scan_bus_parented(NULL, busnum, &pci_root_ops, sd); 210 bus = pci_create_bus(NULL, busnum, &pci_root_ops, sd);
211 if (bus) {
212 if (pci_probe & PCI_USE__CRS)
213 get_current_resources(device, busnum, domain,
214 bus);
215 bus->subordinate = pci_scan_child_bus(bus);
216 }
217 }
227 218
228 if (!bus) 219 if (!bus)
229 kfree(sd); 220 kfree(sd);
@@ -238,8 +229,6 @@ struct pci_bus * __devinit pci_acpi_scan_root(struct acpi_device *device, int do
238#endif 229#endif
239 } 230 }
240 231
241 if (bus && (pci_probe & PCI_USE__CRS))
242 get_current_resources(device, busnum, domain, bus);
243 return bus; 232 return bus;
244} 233}
245 234
diff --git a/arch/x86/pci/amd_bus.c b/arch/x86/pci/amd_bus.c
index f893d6a6e803..3ffa10df20b9 100644
--- a/arch/x86/pci/amd_bus.c
+++ b/arch/x86/pci/amd_bus.c
@@ -100,8 +100,9 @@ void x86_pci_root_bus_res_quirks(struct pci_bus *b)
100 int j; 100 int j;
101 struct pci_root_info *info; 101 struct pci_root_info *info;
102 102
103 /* don't go for it if _CRS is used */ 103 /* don't go for it if _CRS is used already */
104 if (pci_probe & PCI_USE__CRS) 104 if (b->resource[0] != &ioport_resource ||
105 b->resource[1] != &iomem_resource)
105 return; 106 return;
106 107
107 /* if only one root bus, don't need to anything */ 108 /* if only one root bus, don't need to anything */
@@ -116,6 +117,9 @@ void x86_pci_root_bus_res_quirks(struct pci_bus *b)
116 if (i == pci_root_num) 117 if (i == pci_root_num)
117 return; 118 return;
118 119
120 printk(KERN_DEBUG "PCI: peer root bus %02x res updated from pci conf\n",
121 b->number);
122
119 info = &pci_root_info[i]; 123 info = &pci_root_info[i];
120 for (j = 0; j < info->res_num; j++) { 124 for (j = 0; j < info->res_num; j++) {
121 struct resource *res; 125 struct resource *res;
diff --git a/arch/x86/pci/i386.c b/arch/x86/pci/i386.c
index 0fb56db16d18..52e62e57fedd 100644
--- a/arch/x86/pci/i386.c
+++ b/arch/x86/pci/i386.c
@@ -35,6 +35,7 @@
35#include <asm/pat.h> 35#include <asm/pat.h>
36#include <asm/e820.h> 36#include <asm/e820.h>
37#include <asm/pci_x86.h> 37#include <asm/pci_x86.h>
38#include <asm/io_apic.h>
38 39
39 40
40static int 41static int
@@ -227,6 +228,12 @@ void __init pcibios_resource_survey(void)
227 pcibios_allocate_resources(1); 228 pcibios_allocate_resources(1);
228 229
229 e820_reserve_resources_late(); 230 e820_reserve_resources_late();
231 /*
232 * Insert the IO APIC resources after PCI initialization has
233 * occured to handle IO APICS that are mapped in on a BAR in
234 * PCI space, but before trying to assign unassigned pci res.
235 */
236 ioapic_insert_resources();
230} 237}
231 238
232/** 239/**
diff --git a/arch/x86/power/Makefile b/arch/x86/power/Makefile
index de2abbd07544..a6a198c33623 100644
--- a/arch/x86/power/Makefile
+++ b/arch/x86/power/Makefile
@@ -1,7 +1,7 @@
1# __restore_processor_state() restores %gs after S3 resume and so should not 1# __restore_processor_state() restores %gs after S3 resume and so should not
2# itself be stack-protected 2# itself be stack-protected
3nostackp := $(call cc-option, -fno-stack-protector) 3nostackp := $(call cc-option, -fno-stack-protector)
4CFLAGS_cpu_$(BITS).o := $(nostackp) 4CFLAGS_cpu.o := $(nostackp)
5 5
6obj-$(CONFIG_PM_SLEEP) += cpu.o 6obj-$(CONFIG_PM_SLEEP) += cpu.o
7obj-$(CONFIG_HIBERNATION) += hibernate_$(BITS).o hibernate_asm_$(BITS).o 7obj-$(CONFIG_HIBERNATION) += hibernate_$(BITS).o hibernate_asm_$(BITS).o
diff --git a/arch/x86/power/cpu.c b/arch/x86/power/cpu.c
index d277ef1eea51..b3d20b9cac63 100644
--- a/arch/x86/power/cpu.c
+++ b/arch/x86/power/cpu.c
@@ -244,7 +244,7 @@ static void __restore_processor_state(struct saved_context *ctxt)
244 do_fpu_end(); 244 do_fpu_end();
245 mtrr_ap_init(); 245 mtrr_ap_init();
246 246
247#ifdef CONFIG_X86_32 247#ifdef CONFIG_X86_OLD_MCE
248 mcheck_init(&boot_cpu_data); 248 mcheck_init(&boot_cpu_data);
249#endif 249#endif
250} 250}
diff --git a/arch/xtensa/include/asm/thread_info.h b/arch/xtensa/include/asm/thread_info.h
index 0f4fe1faf9ba..13165641cc51 100644
--- a/arch/xtensa/include/asm/thread_info.h
+++ b/arch/xtensa/include/asm/thread_info.h
@@ -80,8 +80,6 @@ struct thread_info {
80 80
81/* 81/*
82 * macros/functions for gaining access to the thread information structure 82 * macros/functions for gaining access to the thread information structure
83 *
84 * preempt_count needs to be 1 initially, until the scheduler is functional.
85 */ 83 */
86 84
87#ifndef __ASSEMBLY__ 85#ifndef __ASSEMBLY__
@@ -92,7 +90,7 @@ struct thread_info {
92 .exec_domain = &default_exec_domain, \ 90 .exec_domain = &default_exec_domain, \
93 .flags = 0, \ 91 .flags = 0, \
94 .cpu = 0, \ 92 .cpu = 0, \
95 .preempt_count = 1, \ 93 .preempt_count = INIT_PREEMPT_COUNT, \
96 .addr_limit = KERNEL_DS, \ 94 .addr_limit = KERNEL_DS, \
97 .restart_block = { \ 95 .restart_block = { \
98 .fn = do_no_restart_syscall, \ 96 .fn = do_no_restart_syscall, \
diff --git a/arch/xtensa/include/asm/tlb.h b/arch/xtensa/include/asm/tlb.h
index 31c220faca02..0d766f9c1083 100644
--- a/arch/xtensa/include/asm/tlb.h
+++ b/arch/xtensa/include/asm/tlb.h
@@ -42,6 +42,6 @@
42 42
43#include <asm-generic/tlb.h> 43#include <asm-generic/tlb.h>
44 44
45#define __pte_free_tlb(tlb, pte) pte_free((tlb)->mm, pte) 45#define __pte_free_tlb(tlb, pte, address) pte_free((tlb)->mm, pte)
46 46
47#endif /* _XTENSA_TLB_H */ 47#endif /* _XTENSA_TLB_H */
diff --git a/arch/xtensa/kernel/traps.c b/arch/xtensa/kernel/traps.c
index ba9ab9349782..e64efac3b9db 100644
--- a/arch/xtensa/kernel/traps.c
+++ b/arch/xtensa/kernel/traps.c
@@ -354,10 +354,10 @@ void show_regs(struct pt_regs * regs)
354 354
355 for (i = 0; i < 16; i++) { 355 for (i = 0; i < 16; i++) {
356 if ((i % 8) == 0) 356 if ((i % 8) == 0)
357 printk ("\n" KERN_INFO "a%02d: ", i); 357 printk(KERN_INFO "a%02d:", i);
358 printk("%08lx ", regs->areg[i]); 358 printk(KERN_CONT " %08lx", regs->areg[i]);
359 } 359 }
360 printk("\n"); 360 printk(KERN_CONT "\n");
361 361
362 printk("pc: %08lx, ps: %08lx, depc: %08lx, excvaddr: %08lx\n", 362 printk("pc: %08lx, ps: %08lx, depc: %08lx, excvaddr: %08lx\n",
363 regs->pc, regs->ps, regs->depc, regs->excvaddr); 363 regs->pc, regs->ps, regs->depc, regs->excvaddr);
diff --git a/block/Kconfig b/block/Kconfig
index 95a86adc33a1..9be0b56eaee1 100644
--- a/block/Kconfig
+++ b/block/Kconfig
@@ -48,9 +48,9 @@ config LBDAF
48 If unsure, say Y. 48 If unsure, say Y.
49 49
50config BLK_DEV_BSG 50config BLK_DEV_BSG
51 bool "Block layer SG support v4 (EXPERIMENTAL)" 51 bool "Block layer SG support v4"
52 depends on EXPERIMENTAL 52 default y
53 ---help--- 53 help
54 Saying Y here will enable generic SG (SCSI generic) v4 support 54 Saying Y here will enable generic SG (SCSI generic) v4 support
55 for any block device. 55 for any block device.
56 56
@@ -60,7 +60,10 @@ config BLK_DEV_BSG
60 protocols (e.g. Task Management Functions and SMP in Serial 60 protocols (e.g. Task Management Functions and SMP in Serial
61 Attached SCSI). 61 Attached SCSI).
62 62
63 If unsure, say N. 63 This option is required by recent UDEV versions to properly
64 access device serial numbers, etc.
65
66 If unsure, say Y.
64 67
65config BLK_DEV_INTEGRITY 68config BLK_DEV_INTEGRITY
66 bool "Block layer data integrity support" 69 bool "Block layer data integrity support"
diff --git a/block/Makefile b/block/Makefile
index e9fa4dd690f2..6c54ed0ff755 100644
--- a/block/Makefile
+++ b/block/Makefile
@@ -5,7 +5,7 @@
5obj-$(CONFIG_BLOCK) := elevator.o blk-core.o blk-tag.o blk-sysfs.o \ 5obj-$(CONFIG_BLOCK) := elevator.o blk-core.o blk-tag.o blk-sysfs.o \
6 blk-barrier.o blk-settings.o blk-ioc.o blk-map.o \ 6 blk-barrier.o blk-settings.o blk-ioc.o blk-map.o \
7 blk-exec.o blk-merge.o blk-softirq.o blk-timeout.o \ 7 blk-exec.o blk-merge.o blk-softirq.o blk-timeout.o \
8 ioctl.o genhd.o scsi_ioctl.o cmd-filter.o 8 ioctl.o genhd.o scsi_ioctl.o
9 9
10obj-$(CONFIG_BLK_DEV_BSG) += bsg.o 10obj-$(CONFIG_BLK_DEV_BSG) += bsg.o
11obj-$(CONFIG_IOSCHED_NOOP) += noop-iosched.o 11obj-$(CONFIG_IOSCHED_NOOP) += noop-iosched.o
diff --git a/block/blk-core.c b/block/blk-core.c
index b06cf5c2a829..e3299a77a0d8 100644
--- a/block/blk-core.c
+++ b/block/blk-core.c
@@ -575,13 +575,6 @@ blk_init_queue_node(request_fn_proc *rfn, spinlock_t *lock, int node_id)
575 return NULL; 575 return NULL;
576 } 576 }
577 577
578 /*
579 * if caller didn't supply a lock, they get per-queue locking with
580 * our embedded lock
581 */
582 if (!lock)
583 lock = &q->__queue_lock;
584
585 q->request_fn = rfn; 578 q->request_fn = rfn;
586 q->prep_rq_fn = NULL; 579 q->prep_rq_fn = NULL;
587 q->unplug_fn = generic_unplug_device; 580 q->unplug_fn = generic_unplug_device;
@@ -595,8 +588,6 @@ blk_init_queue_node(request_fn_proc *rfn, spinlock_t *lock, int node_id)
595 588
596 q->sg_reserved_size = INT_MAX; 589 q->sg_reserved_size = INT_MAX;
597 590
598 blk_set_cmd_filter_defaults(&q->cmd_filter);
599
600 /* 591 /*
601 * all done 592 * all done
602 */ 593 */
@@ -1172,6 +1163,11 @@ static int __make_request(struct request_queue *q, struct bio *bio)
1172 const int unplug = bio_unplug(bio); 1163 const int unplug = bio_unplug(bio);
1173 int rw_flags; 1164 int rw_flags;
1174 1165
1166 if (bio_barrier(bio) && bio_has_data(bio) &&
1167 (q->next_ordered == QUEUE_ORDERED_NONE)) {
1168 bio_endio(bio, -EOPNOTSUPP);
1169 return 0;
1170 }
1175 /* 1171 /*
1176 * low level driver can indicate that it wants pages above a 1172 * low level driver can indicate that it wants pages above a
1177 * certain limit bounced to low memory (ie for highmem, or even 1173 * certain limit bounced to low memory (ie for highmem, or even
@@ -1472,11 +1468,6 @@ static inline void __generic_make_request(struct bio *bio)
1472 err = -EOPNOTSUPP; 1468 err = -EOPNOTSUPP;
1473 goto end_io; 1469 goto end_io;
1474 } 1470 }
1475 if (bio_barrier(bio) && bio_has_data(bio) &&
1476 (q->next_ordered == QUEUE_ORDERED_NONE)) {
1477 err = -EOPNOTSUPP;
1478 goto end_io;
1479 }
1480 1471
1481 ret = q->make_request_fn(q, bio); 1472 ret = q->make_request_fn(q, bio);
1482 } while (ret); 1473 } while (ret);
@@ -2145,7 +2136,7 @@ bool blk_end_request(struct request *rq, int error, unsigned int nr_bytes)
2145{ 2136{
2146 return blk_end_bidi_request(rq, error, nr_bytes, 0); 2137 return blk_end_bidi_request(rq, error, nr_bytes, 0);
2147} 2138}
2148EXPORT_SYMBOL_GPL(blk_end_request); 2139EXPORT_SYMBOL(blk_end_request);
2149 2140
2150/** 2141/**
2151 * blk_end_request_all - Helper function for drives to finish the request. 2142 * blk_end_request_all - Helper function for drives to finish the request.
@@ -2166,7 +2157,7 @@ void blk_end_request_all(struct request *rq, int error)
2166 pending = blk_end_bidi_request(rq, error, blk_rq_bytes(rq), bidi_bytes); 2157 pending = blk_end_bidi_request(rq, error, blk_rq_bytes(rq), bidi_bytes);
2167 BUG_ON(pending); 2158 BUG_ON(pending);
2168} 2159}
2169EXPORT_SYMBOL_GPL(blk_end_request_all); 2160EXPORT_SYMBOL(blk_end_request_all);
2170 2161
2171/** 2162/**
2172 * blk_end_request_cur - Helper function to finish the current request chunk. 2163 * blk_end_request_cur - Helper function to finish the current request chunk.
@@ -2184,7 +2175,7 @@ bool blk_end_request_cur(struct request *rq, int error)
2184{ 2175{
2185 return blk_end_request(rq, error, blk_rq_cur_bytes(rq)); 2176 return blk_end_request(rq, error, blk_rq_cur_bytes(rq));
2186} 2177}
2187EXPORT_SYMBOL_GPL(blk_end_request_cur); 2178EXPORT_SYMBOL(blk_end_request_cur);
2188 2179
2189/** 2180/**
2190 * __blk_end_request - Helper function for drivers to complete the request. 2181 * __blk_end_request - Helper function for drivers to complete the request.
@@ -2203,7 +2194,7 @@ bool __blk_end_request(struct request *rq, int error, unsigned int nr_bytes)
2203{ 2194{
2204 return __blk_end_bidi_request(rq, error, nr_bytes, 0); 2195 return __blk_end_bidi_request(rq, error, nr_bytes, 0);
2205} 2196}
2206EXPORT_SYMBOL_GPL(__blk_end_request); 2197EXPORT_SYMBOL(__blk_end_request);
2207 2198
2208/** 2199/**
2209 * __blk_end_request_all - Helper function for drives to finish the request. 2200 * __blk_end_request_all - Helper function for drives to finish the request.
@@ -2224,7 +2215,7 @@ void __blk_end_request_all(struct request *rq, int error)
2224 pending = __blk_end_bidi_request(rq, error, blk_rq_bytes(rq), bidi_bytes); 2215 pending = __blk_end_bidi_request(rq, error, blk_rq_bytes(rq), bidi_bytes);
2225 BUG_ON(pending); 2216 BUG_ON(pending);
2226} 2217}
2227EXPORT_SYMBOL_GPL(__blk_end_request_all); 2218EXPORT_SYMBOL(__blk_end_request_all);
2228 2219
2229/** 2220/**
2230 * __blk_end_request_cur - Helper function to finish the current request chunk. 2221 * __blk_end_request_cur - Helper function to finish the current request chunk.
@@ -2243,7 +2234,7 @@ bool __blk_end_request_cur(struct request *rq, int error)
2243{ 2234{
2244 return __blk_end_request(rq, error, blk_rq_cur_bytes(rq)); 2235 return __blk_end_request(rq, error, blk_rq_cur_bytes(rq));
2245} 2236}
2246EXPORT_SYMBOL_GPL(__blk_end_request_cur); 2237EXPORT_SYMBOL(__blk_end_request_cur);
2247 2238
2248void blk_rq_bio_prep(struct request_queue *q, struct request *rq, 2239void blk_rq_bio_prep(struct request_queue *q, struct request *rq,
2249 struct bio *bio) 2240 struct bio *bio)
@@ -2365,7 +2356,7 @@ int blk_rq_prep_clone(struct request *rq, struct request *rq_src,
2365 __bio_clone(bio, bio_src); 2356 __bio_clone(bio, bio_src);
2366 2357
2367 if (bio_integrity(bio_src) && 2358 if (bio_integrity(bio_src) &&
2368 bio_integrity_clone(bio, bio_src, gfp_mask)) 2359 bio_integrity_clone(bio, bio_src, gfp_mask, bs))
2369 goto free_and_out; 2360 goto free_and_out;
2370 2361
2371 if (bio_ctr && bio_ctr(bio, bio_src, data)) 2362 if (bio_ctr && bio_ctr(bio, bio_src, data))
diff --git a/block/blk-integrity.c b/block/blk-integrity.c
index 73e28d355688..15c630813b1c 100644
--- a/block/blk-integrity.c
+++ b/block/blk-integrity.c
@@ -379,6 +379,7 @@ void blk_integrity_unregister(struct gendisk *disk)
379 379
380 kobject_uevent(&bi->kobj, KOBJ_REMOVE); 380 kobject_uevent(&bi->kobj, KOBJ_REMOVE);
381 kobject_del(&bi->kobj); 381 kobject_del(&bi->kobj);
382 kobject_put(&bi->kobj);
382 kmem_cache_free(integrity_cachep, bi); 383 kmem_cache_free(integrity_cachep, bi);
383 disk->integrity = NULL; 384 disk->integrity = NULL;
384} 385}
diff --git a/block/blk-merge.c b/block/blk-merge.c
index 39ce64432ba6..e1999679a4d5 100644
--- a/block/blk-merge.c
+++ b/block/blk-merge.c
@@ -350,6 +350,12 @@ static int attempt_merge(struct request_queue *q, struct request *req,
350 if (blk_integrity_rq(req) != blk_integrity_rq(next)) 350 if (blk_integrity_rq(req) != blk_integrity_rq(next))
351 return 0; 351 return 0;
352 352
353 /* don't merge requests of different failfast settings */
354 if (blk_failfast_dev(req) != blk_failfast_dev(next) ||
355 blk_failfast_transport(req) != blk_failfast_transport(next) ||
356 blk_failfast_driver(req) != blk_failfast_driver(next))
357 return 0;
358
353 /* 359 /*
354 * If we are allowed to merge, then append bio list 360 * If we are allowed to merge, then append bio list
355 * from next to rq and release next. merge_requests_fn 361 * from next to rq and release next. merge_requests_fn
diff --git a/block/blk-settings.c b/block/blk-settings.c
index bd582a7f5310..476d87065073 100644
--- a/block/blk-settings.c
+++ b/block/blk-settings.c
@@ -7,6 +7,7 @@
7#include <linux/bio.h> 7#include <linux/bio.h>
8#include <linux/blkdev.h> 8#include <linux/blkdev.h>
9#include <linux/bootmem.h> /* for max_pfn/max_low_pfn */ 9#include <linux/bootmem.h> /* for max_pfn/max_low_pfn */
10#include <linux/gcd.h>
10 11
11#include "blk.h" 12#include "blk.h"
12 13
@@ -165,6 +166,13 @@ void blk_queue_make_request(struct request_queue *q, make_request_fn *mfn)
165 blk_set_default_limits(&q->limits); 166 blk_set_default_limits(&q->limits);
166 167
167 /* 168 /*
169 * If the caller didn't supply a lock, fall back to our embedded
170 * per-queue locks
171 */
172 if (!q->queue_lock)
173 q->queue_lock = &q->__queue_lock;
174
175 /*
168 * by default assume old behaviour and bounce for any highmem page 176 * by default assume old behaviour and bounce for any highmem page
169 */ 177 */
170 blk_queue_bounce_limit(q, BLK_BOUNCE_HIGH); 178 blk_queue_bounce_limit(q, BLK_BOUNCE_HIGH);
@@ -377,8 +385,8 @@ void blk_queue_alignment_offset(struct request_queue *q, unsigned int offset)
377EXPORT_SYMBOL(blk_queue_alignment_offset); 385EXPORT_SYMBOL(blk_queue_alignment_offset);
378 386
379/** 387/**
380 * blk_queue_io_min - set minimum request size for the queue 388 * blk_limits_io_min - set minimum request size for a device
381 * @q: the request queue for the device 389 * @limits: the queue limits
382 * @min: smallest I/O size in bytes 390 * @min: smallest I/O size in bytes
383 * 391 *
384 * Description: 392 * Description:
@@ -387,15 +395,35 @@ EXPORT_SYMBOL(blk_queue_alignment_offset);
387 * smallest I/O the device can perform without incurring a performance 395 * smallest I/O the device can perform without incurring a performance
388 * penalty. 396 * penalty.
389 */ 397 */
390void blk_queue_io_min(struct request_queue *q, unsigned int min) 398void blk_limits_io_min(struct queue_limits *limits, unsigned int min)
391{ 399{
392 q->limits.io_min = min; 400 limits->io_min = min;
393 401
394 if (q->limits.io_min < q->limits.logical_block_size) 402 if (limits->io_min < limits->logical_block_size)
395 q->limits.io_min = q->limits.logical_block_size; 403 limits->io_min = limits->logical_block_size;
396 404
397 if (q->limits.io_min < q->limits.physical_block_size) 405 if (limits->io_min < limits->physical_block_size)
398 q->limits.io_min = q->limits.physical_block_size; 406 limits->io_min = limits->physical_block_size;
407}
408EXPORT_SYMBOL(blk_limits_io_min);
409
410/**
411 * blk_queue_io_min - set minimum request size for the queue
412 * @q: the request queue for the device
413 * @min: smallest I/O size in bytes
414 *
415 * Description:
416 * Storage devices may report a granularity or preferred minimum I/O
417 * size which is the smallest request the device can perform without
418 * incurring a performance penalty. For disk drives this is often the
419 * physical block size. For RAID arrays it is often the stripe chunk
420 * size. A properly aligned multiple of minimum_io_size is the
421 * preferred request size for workloads where a high number of I/O
422 * operations is desired.
423 */
424void blk_queue_io_min(struct request_queue *q, unsigned int min)
425{
426 blk_limits_io_min(&q->limits, min);
399} 427}
400EXPORT_SYMBOL(blk_queue_io_min); 428EXPORT_SYMBOL(blk_queue_io_min);
401 429
@@ -405,8 +433,12 @@ EXPORT_SYMBOL(blk_queue_io_min);
405 * @opt: optimal request size in bytes 433 * @opt: optimal request size in bytes
406 * 434 *
407 * Description: 435 * Description:
408 * Drivers can call this function to set the preferred I/O request 436 * Storage devices may report an optimal I/O size, which is the
409 * size for devices that report such a value. 437 * device's preferred unit for sustained I/O. This is rarely reported
438 * for disk drives. For RAID arrays it is usually the stripe width or
439 * the internal track size. A properly aligned multiple of
440 * optimal_io_size is the preferred request size for workloads where
441 * sustained throughput is desired.
410 */ 442 */
411void blk_queue_io_opt(struct request_queue *q, unsigned int opt) 443void blk_queue_io_opt(struct request_queue *q, unsigned int opt)
412{ 444{
@@ -426,27 +458,7 @@ EXPORT_SYMBOL(blk_queue_io_opt);
426 **/ 458 **/
427void blk_queue_stack_limits(struct request_queue *t, struct request_queue *b) 459void blk_queue_stack_limits(struct request_queue *t, struct request_queue *b)
428{ 460{
429 /* zero is "infinity" */ 461 blk_stack_limits(&t->limits, &b->limits, 0);
430 t->limits.max_sectors = min_not_zero(queue_max_sectors(t),
431 queue_max_sectors(b));
432
433 t->limits.max_hw_sectors = min_not_zero(queue_max_hw_sectors(t),
434 queue_max_hw_sectors(b));
435
436 t->limits.seg_boundary_mask = min_not_zero(queue_segment_boundary(t),
437 queue_segment_boundary(b));
438
439 t->limits.max_phys_segments = min_not_zero(queue_max_phys_segments(t),
440 queue_max_phys_segments(b));
441
442 t->limits.max_hw_segments = min_not_zero(queue_max_hw_segments(t),
443 queue_max_hw_segments(b));
444
445 t->limits.max_segment_size = min_not_zero(queue_max_segment_size(t),
446 queue_max_segment_size(b));
447
448 t->limits.logical_block_size = max(queue_logical_block_size(t),
449 queue_logical_block_size(b));
450 462
451 if (!t->queue_lock) 463 if (!t->queue_lock)
452 WARN_ON_ONCE(1); 464 WARN_ON_ONCE(1);
@@ -516,6 +528,16 @@ int blk_stack_limits(struct queue_limits *t, struct queue_limits *b,
516 return -1; 528 return -1;
517 } 529 }
518 530
531 /* Find lcm() of optimal I/O size */
532 if (t->io_opt && b->io_opt)
533 t->io_opt = (t->io_opt * b->io_opt) / gcd(t->io_opt, b->io_opt);
534 else if (b->io_opt)
535 t->io_opt = b->io_opt;
536
537 /* Verify that optimal I/O size is a multiple of io_min */
538 if (t->io_min && t->io_opt % t->io_min)
539 return -1;
540
519 return 0; 541 return 0;
520} 542}
521EXPORT_SYMBOL(blk_stack_limits); 543EXPORT_SYMBOL(blk_stack_limits);
diff --git a/block/blk-sysfs.c b/block/blk-sysfs.c
index b1cd04087d6a..418d63619680 100644
--- a/block/blk-sysfs.c
+++ b/block/blk-sysfs.c
@@ -16,9 +16,9 @@ struct queue_sysfs_entry {
16}; 16};
17 17
18static ssize_t 18static ssize_t
19queue_var_show(unsigned int var, char *page) 19queue_var_show(unsigned long var, char *page)
20{ 20{
21 return sprintf(page, "%d\n", var); 21 return sprintf(page, "%lu\n", var);
22} 22}
23 23
24static ssize_t 24static ssize_t
@@ -77,7 +77,8 @@ queue_requests_store(struct request_queue *q, const char *page, size_t count)
77 77
78static ssize_t queue_ra_show(struct request_queue *q, char *page) 78static ssize_t queue_ra_show(struct request_queue *q, char *page)
79{ 79{
80 int ra_kb = q->backing_dev_info.ra_pages << (PAGE_CACHE_SHIFT - 10); 80 unsigned long ra_kb = q->backing_dev_info.ra_pages <<
81 (PAGE_CACHE_SHIFT - 10);
81 82
82 return queue_var_show(ra_kb, (page)); 83 return queue_var_show(ra_kb, (page));
83} 84}
@@ -189,9 +190,9 @@ static ssize_t queue_nomerges_store(struct request_queue *q, const char *page,
189 190
190static ssize_t queue_rq_affinity_show(struct request_queue *q, char *page) 191static ssize_t queue_rq_affinity_show(struct request_queue *q, char *page)
191{ 192{
192 unsigned int set = test_bit(QUEUE_FLAG_SAME_COMP, &q->queue_flags); 193 bool set = test_bit(QUEUE_FLAG_SAME_COMP, &q->queue_flags);
193 194
194 return queue_var_show(set != 0, page); 195 return queue_var_show(set, page);
195} 196}
196 197
197static ssize_t 198static ssize_t
diff --git a/block/bsg.c b/block/bsg.c
index e7d475254248..5f184bb3ff9e 100644
--- a/block/bsg.c
+++ b/block/bsg.c
@@ -186,7 +186,7 @@ static int blk_fill_sgv4_hdr_rq(struct request_queue *q, struct request *rq,
186 return -EFAULT; 186 return -EFAULT;
187 187
188 if (hdr->subprotocol == BSG_SUB_PROTOCOL_SCSI_CMD) { 188 if (hdr->subprotocol == BSG_SUB_PROTOCOL_SCSI_CMD) {
189 if (blk_verify_command(&q->cmd_filter, rq->cmd, has_write_perm)) 189 if (blk_verify_command(rq->cmd, has_write_perm))
190 return -EPERM; 190 return -EPERM;
191 } else if (!capable(CAP_SYS_RAWIO)) 191 } else if (!capable(CAP_SYS_RAWIO))
192 return -EPERM; 192 return -EPERM;
diff --git a/block/cfq-iosched.c b/block/cfq-iosched.c
index 833ec18eaa63..fd7080ed7935 100644
--- a/block/cfq-iosched.c
+++ b/block/cfq-iosched.c
@@ -71,6 +71,51 @@ struct cfq_rb_root {
71#define CFQ_RB_ROOT (struct cfq_rb_root) { RB_ROOT, NULL, } 71#define CFQ_RB_ROOT (struct cfq_rb_root) { RB_ROOT, NULL, }
72 72
73/* 73/*
74 * Per process-grouping structure
75 */
76struct cfq_queue {
77 /* reference count */
78 atomic_t ref;
79 /* various state flags, see below */
80 unsigned int flags;
81 /* parent cfq_data */
82 struct cfq_data *cfqd;
83 /* service_tree member */
84 struct rb_node rb_node;
85 /* service_tree key */
86 unsigned long rb_key;
87 /* prio tree member */
88 struct rb_node p_node;
89 /* prio tree root we belong to, if any */
90 struct rb_root *p_root;
91 /* sorted list of pending requests */
92 struct rb_root sort_list;
93 /* if fifo isn't expired, next request to serve */
94 struct request *next_rq;
95 /* requests queued in sort_list */
96 int queued[2];
97 /* currently allocated requests */
98 int allocated[2];
99 /* fifo list of requests in sort_list */
100 struct list_head fifo;
101
102 unsigned long slice_end;
103 long slice_resid;
104 unsigned int slice_dispatch;
105
106 /* pending metadata requests */
107 int meta_pending;
108 /* number of requests that are on the dispatch list or inside driver */
109 int dispatched;
110
111 /* io prio of this group */
112 unsigned short ioprio, org_ioprio;
113 unsigned short ioprio_class, org_ioprio_class;
114
115 pid_t pid;
116};
117
118/*
74 * Per block device queue structure 119 * Per block device queue structure
75 */ 120 */
76struct cfq_data { 121struct cfq_data {
@@ -135,51 +180,11 @@ struct cfq_data {
135 unsigned int cfq_slice_idle; 180 unsigned int cfq_slice_idle;
136 181
137 struct list_head cic_list; 182 struct list_head cic_list;
138};
139 183
140/* 184 /*
141 * Per process-grouping structure 185 * Fallback dummy cfqq for extreme OOM conditions
142 */ 186 */
143struct cfq_queue { 187 struct cfq_queue oom_cfqq;
144 /* reference count */
145 atomic_t ref;
146 /* various state flags, see below */
147 unsigned int flags;
148 /* parent cfq_data */
149 struct cfq_data *cfqd;
150 /* service_tree member */
151 struct rb_node rb_node;
152 /* service_tree key */
153 unsigned long rb_key;
154 /* prio tree member */
155 struct rb_node p_node;
156 /* prio tree root we belong to, if any */
157 struct rb_root *p_root;
158 /* sorted list of pending requests */
159 struct rb_root sort_list;
160 /* if fifo isn't expired, next request to serve */
161 struct request *next_rq;
162 /* requests queued in sort_list */
163 int queued[2];
164 /* currently allocated requests */
165 int allocated[2];
166 /* fifo list of requests in sort_list */
167 struct list_head fifo;
168
169 unsigned long slice_end;
170 long slice_resid;
171 unsigned int slice_dispatch;
172
173 /* pending metadata requests */
174 int meta_pending;
175 /* number of requests that are on the dispatch list or inside driver */
176 int dispatched;
177
178 /* io prio of this group */
179 unsigned short ioprio, org_ioprio;
180 unsigned short ioprio_class, org_ioprio_class;
181
182 pid_t pid;
183}; 188};
184 189
185enum cfqq_state_flags { 190enum cfqq_state_flags {
@@ -1641,6 +1646,26 @@ static void cfq_ioc_set_ioprio(struct io_context *ioc)
1641 ioc->ioprio_changed = 0; 1646 ioc->ioprio_changed = 0;
1642} 1647}
1643 1648
1649static void cfq_init_cfqq(struct cfq_data *cfqd, struct cfq_queue *cfqq,
1650 pid_t pid, int is_sync)
1651{
1652 RB_CLEAR_NODE(&cfqq->rb_node);
1653 RB_CLEAR_NODE(&cfqq->p_node);
1654 INIT_LIST_HEAD(&cfqq->fifo);
1655
1656 atomic_set(&cfqq->ref, 0);
1657 cfqq->cfqd = cfqd;
1658
1659 cfq_mark_cfqq_prio_changed(cfqq);
1660
1661 if (is_sync) {
1662 if (!cfq_class_idle(cfqq))
1663 cfq_mark_cfqq_idle_window(cfqq);
1664 cfq_mark_cfqq_sync(cfqq);
1665 }
1666 cfqq->pid = pid;
1667}
1668
1644static struct cfq_queue * 1669static struct cfq_queue *
1645cfq_find_alloc_queue(struct cfq_data *cfqd, int is_sync, 1670cfq_find_alloc_queue(struct cfq_data *cfqd, int is_sync,
1646 struct io_context *ioc, gfp_t gfp_mask) 1671 struct io_context *ioc, gfp_t gfp_mask)
@@ -1653,56 +1678,40 @@ retry:
1653 /* cic always exists here */ 1678 /* cic always exists here */
1654 cfqq = cic_to_cfqq(cic, is_sync); 1679 cfqq = cic_to_cfqq(cic, is_sync);
1655 1680
1656 if (!cfqq) { 1681 /*
1682 * Always try a new alloc if we fell back to the OOM cfqq
1683 * originally, since it should just be a temporary situation.
1684 */
1685 if (!cfqq || cfqq == &cfqd->oom_cfqq) {
1686 cfqq = NULL;
1657 if (new_cfqq) { 1687 if (new_cfqq) {
1658 cfqq = new_cfqq; 1688 cfqq = new_cfqq;
1659 new_cfqq = NULL; 1689 new_cfqq = NULL;
1660 } else if (gfp_mask & __GFP_WAIT) { 1690 } else if (gfp_mask & __GFP_WAIT) {
1661 /*
1662 * Inform the allocator of the fact that we will
1663 * just repeat this allocation if it fails, to allow
1664 * the allocator to do whatever it needs to attempt to
1665 * free memory.
1666 */
1667 spin_unlock_irq(cfqd->queue->queue_lock); 1691 spin_unlock_irq(cfqd->queue->queue_lock);
1668 new_cfqq = kmem_cache_alloc_node(cfq_pool, 1692 new_cfqq = kmem_cache_alloc_node(cfq_pool,
1669 gfp_mask | __GFP_NOFAIL | __GFP_ZERO, 1693 gfp_mask | __GFP_ZERO,
1670 cfqd->queue->node); 1694 cfqd->queue->node);
1671 spin_lock_irq(cfqd->queue->queue_lock); 1695 spin_lock_irq(cfqd->queue->queue_lock);
1672 goto retry; 1696 if (new_cfqq)
1697 goto retry;
1673 } else { 1698 } else {
1674 cfqq = kmem_cache_alloc_node(cfq_pool, 1699 cfqq = kmem_cache_alloc_node(cfq_pool,
1675 gfp_mask | __GFP_ZERO, 1700 gfp_mask | __GFP_ZERO,
1676 cfqd->queue->node); 1701 cfqd->queue->node);
1677 if (!cfqq)
1678 goto out;
1679 } 1702 }
1680 1703
1681 RB_CLEAR_NODE(&cfqq->rb_node); 1704 if (cfqq) {
1682 RB_CLEAR_NODE(&cfqq->p_node); 1705 cfq_init_cfqq(cfqd, cfqq, current->pid, is_sync);
1683 INIT_LIST_HEAD(&cfqq->fifo); 1706 cfq_init_prio_data(cfqq, ioc);
1684 1707 cfq_log_cfqq(cfqd, cfqq, "alloced");
1685 atomic_set(&cfqq->ref, 0); 1708 } else
1686 cfqq->cfqd = cfqd; 1709 cfqq = &cfqd->oom_cfqq;
1687
1688 cfq_mark_cfqq_prio_changed(cfqq);
1689
1690 cfq_init_prio_data(cfqq, ioc);
1691
1692 if (is_sync) {
1693 if (!cfq_class_idle(cfqq))
1694 cfq_mark_cfqq_idle_window(cfqq);
1695 cfq_mark_cfqq_sync(cfqq);
1696 }
1697 cfqq->pid = current->pid;
1698 cfq_log_cfqq(cfqd, cfqq, "alloced");
1699 } 1710 }
1700 1711
1701 if (new_cfqq) 1712 if (new_cfqq)
1702 kmem_cache_free(cfq_pool, new_cfqq); 1713 kmem_cache_free(cfq_pool, new_cfqq);
1703 1714
1704out:
1705 WARN_ON((gfp_mask & __GFP_WAIT) && !cfqq);
1706 return cfqq; 1715 return cfqq;
1707} 1716}
1708 1717
@@ -1735,11 +1744,8 @@ cfq_get_queue(struct cfq_data *cfqd, int is_sync, struct io_context *ioc,
1735 cfqq = *async_cfqq; 1744 cfqq = *async_cfqq;
1736 } 1745 }
1737 1746
1738 if (!cfqq) { 1747 if (!cfqq)
1739 cfqq = cfq_find_alloc_queue(cfqd, is_sync, ioc, gfp_mask); 1748 cfqq = cfq_find_alloc_queue(cfqd, is_sync, ioc, gfp_mask);
1740 if (!cfqq)
1741 return NULL;
1742 }
1743 1749
1744 /* 1750 /*
1745 * pin the queue now that it's allocated, scheduler exit will prune it 1751 * pin the queue now that it's allocated, scheduler exit will prune it
@@ -2305,12 +2311,8 @@ cfq_set_request(struct request_queue *q, struct request *rq, gfp_t gfp_mask)
2305 goto queue_fail; 2311 goto queue_fail;
2306 2312
2307 cfqq = cic_to_cfqq(cic, is_sync); 2313 cfqq = cic_to_cfqq(cic, is_sync);
2308 if (!cfqq) { 2314 if (!cfqq || cfqq == &cfqd->oom_cfqq) {
2309 cfqq = cfq_get_queue(cfqd, is_sync, cic->ioc, gfp_mask); 2315 cfqq = cfq_get_queue(cfqd, is_sync, cic->ioc, gfp_mask);
2310
2311 if (!cfqq)
2312 goto queue_fail;
2313
2314 cic_set_cfqq(cic, cfqq, is_sync); 2316 cic_set_cfqq(cic, cfqq, is_sync);
2315 } 2317 }
2316 2318
@@ -2465,6 +2467,14 @@ static void *cfq_init_queue(struct request_queue *q)
2465 for (i = 0; i < CFQ_PRIO_LISTS; i++) 2467 for (i = 0; i < CFQ_PRIO_LISTS; i++)
2466 cfqd->prio_trees[i] = RB_ROOT; 2468 cfqd->prio_trees[i] = RB_ROOT;
2467 2469
2470 /*
2471 * Our fallback cfqq if cfq_find_alloc_queue() runs into OOM issues.
2472 * Grab a permanent reference to it, so that the normal code flow
2473 * will not attempt to free it.
2474 */
2475 cfq_init_cfqq(cfqd, &cfqd->oom_cfqq, 1, 0);
2476 atomic_inc(&cfqd->oom_cfqq.ref);
2477
2468 INIT_LIST_HEAD(&cfqd->cic_list); 2478 INIT_LIST_HEAD(&cfqd->cic_list);
2469 2479
2470 cfqd->queue = q; 2480 cfqd->queue = q;
diff --git a/block/cmd-filter.c b/block/cmd-filter.c
deleted file mode 100644
index 572bbc2f900d..000000000000
--- a/block/cmd-filter.c
+++ /dev/null
@@ -1,233 +0,0 @@
1/*
2 * Copyright 2004 Peter M. Jones <pjones@redhat.com>
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 version 2 as
6 * published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 *
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 Licens
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-
17 *
18 */
19
20#include <linux/list.h>
21#include <linux/genhd.h>
22#include <linux/spinlock.h>
23#include <linux/capability.h>
24#include <linux/bitops.h>
25#include <linux/blkdev.h>
26
27#include <scsi/scsi.h>
28#include <linux/cdrom.h>
29
30int blk_verify_command(struct blk_cmd_filter *filter,
31 unsigned char *cmd, fmode_t has_write_perm)
32{
33 /* root can do any command. */
34 if (capable(CAP_SYS_RAWIO))
35 return 0;
36
37 /* if there's no filter set, assume we're filtering everything out */
38 if (!filter)
39 return -EPERM;
40
41 /* Anybody who can open the device can do a read-safe command */
42 if (test_bit(cmd[0], filter->read_ok))
43 return 0;
44
45 /* Write-safe commands require a writable open */
46 if (test_bit(cmd[0], filter->write_ok) && has_write_perm)
47 return 0;
48
49 return -EPERM;
50}
51EXPORT_SYMBOL(blk_verify_command);
52
53#if 0
54/* and now, the sysfs stuff */
55static ssize_t rcf_cmds_show(struct blk_cmd_filter *filter, char *page,
56 int rw)
57{
58 char *npage = page;
59 unsigned long *okbits;
60 int i;
61
62 if (rw == READ)
63 okbits = filter->read_ok;
64 else
65 okbits = filter->write_ok;
66
67 for (i = 0; i < BLK_SCSI_MAX_CMDS; i++) {
68 if (test_bit(i, okbits)) {
69 npage += sprintf(npage, "0x%02x", i);
70 if (i < BLK_SCSI_MAX_CMDS - 1)
71 sprintf(npage++, " ");
72 }
73 }
74
75 if (npage != page)
76 npage += sprintf(npage, "\n");
77
78 return npage - page;
79}
80
81static ssize_t rcf_readcmds_show(struct blk_cmd_filter *filter, char *page)
82{
83 return rcf_cmds_show(filter, page, READ);
84}
85
86static ssize_t rcf_writecmds_show(struct blk_cmd_filter *filter,
87 char *page)
88{
89 return rcf_cmds_show(filter, page, WRITE);
90}
91
92static ssize_t rcf_cmds_store(struct blk_cmd_filter *filter,
93 const char *page, size_t count, int rw)
94{
95 unsigned long okbits[BLK_SCSI_CMD_PER_LONG], *target_okbits;
96 int cmd, set;
97 char *p, *status;
98
99 if (rw == READ) {
100 memcpy(&okbits, filter->read_ok, sizeof(okbits));
101 target_okbits = filter->read_ok;
102 } else {
103 memcpy(&okbits, filter->write_ok, sizeof(okbits));
104 target_okbits = filter->write_ok;
105 }
106
107 while ((p = strsep((char **)&page, " ")) != NULL) {
108 set = 1;
109
110 if (p[0] == '+') {
111 p++;
112 } else if (p[0] == '-') {
113 set = 0;
114 p++;
115 }
116
117 cmd = simple_strtol(p, &status, 16);
118
119 /* either of these cases means invalid input, so do nothing. */
120 if ((status == p) || cmd >= BLK_SCSI_MAX_CMDS)
121 return -EINVAL;
122
123 if (set)
124 __set_bit(cmd, okbits);
125 else
126 __clear_bit(cmd, okbits);
127 }
128
129 memcpy(target_okbits, okbits, sizeof(okbits));
130 return count;
131}
132
133static ssize_t rcf_readcmds_store(struct blk_cmd_filter *filter,
134 const char *page, size_t count)
135{
136 return rcf_cmds_store(filter, page, count, READ);
137}
138
139static ssize_t rcf_writecmds_store(struct blk_cmd_filter *filter,
140 const char *page, size_t count)
141{
142 return rcf_cmds_store(filter, page, count, WRITE);
143}
144
145struct rcf_sysfs_entry {
146 struct attribute attr;
147 ssize_t (*show)(struct blk_cmd_filter *, char *);
148 ssize_t (*store)(struct blk_cmd_filter *, const char *, size_t);
149};
150
151static struct rcf_sysfs_entry rcf_readcmds_entry = {
152 .attr = { .name = "read_table", .mode = S_IRUGO | S_IWUSR },
153 .show = rcf_readcmds_show,
154 .store = rcf_readcmds_store,
155};
156
157static struct rcf_sysfs_entry rcf_writecmds_entry = {
158 .attr = {.name = "write_table", .mode = S_IRUGO | S_IWUSR },
159 .show = rcf_writecmds_show,
160 .store = rcf_writecmds_store,
161};
162
163static struct attribute *default_attrs[] = {
164 &rcf_readcmds_entry.attr,
165 &rcf_writecmds_entry.attr,
166 NULL,
167};
168
169#define to_rcf(atr) container_of((atr), struct rcf_sysfs_entry, attr)
170
171static ssize_t
172rcf_attr_show(struct kobject *kobj, struct attribute *attr, char *page)
173{
174 struct rcf_sysfs_entry *entry = to_rcf(attr);
175 struct blk_cmd_filter *filter;
176
177 filter = container_of(kobj, struct blk_cmd_filter, kobj);
178 if (entry->show)
179 return entry->show(filter, page);
180
181 return 0;
182}
183
184static ssize_t
185rcf_attr_store(struct kobject *kobj, struct attribute *attr,
186 const char *page, size_t length)
187{
188 struct rcf_sysfs_entry *entry = to_rcf(attr);
189 struct blk_cmd_filter *filter;
190
191 if (!capable(CAP_SYS_RAWIO))
192 return -EPERM;
193
194 if (!entry->store)
195 return -EINVAL;
196
197 filter = container_of(kobj, struct blk_cmd_filter, kobj);
198 return entry->store(filter, page, length);
199}
200
201static struct sysfs_ops rcf_sysfs_ops = {
202 .show = rcf_attr_show,
203 .store = rcf_attr_store,
204};
205
206static struct kobj_type rcf_ktype = {
207 .sysfs_ops = &rcf_sysfs_ops,
208 .default_attrs = default_attrs,
209};
210
211int blk_register_filter(struct gendisk *disk)
212{
213 int ret;
214 struct blk_cmd_filter *filter = &disk->queue->cmd_filter;
215
216 ret = kobject_init_and_add(&filter->kobj, &rcf_ktype,
217 &disk_to_dev(disk)->kobj,
218 "%s", "cmd_filter");
219 if (ret < 0)
220 return ret;
221
222 return 0;
223}
224EXPORT_SYMBOL(blk_register_filter);
225
226void blk_unregister_filter(struct gendisk *disk)
227{
228 struct blk_cmd_filter *filter = &disk->queue->cmd_filter;
229
230 kobject_put(&filter->kobj);
231}
232EXPORT_SYMBOL(blk_unregister_filter);
233#endif
diff --git a/block/elevator.c b/block/elevator.c
index ca861927ba41..2d511f9105e1 100644
--- a/block/elevator.c
+++ b/block/elevator.c
@@ -100,6 +100,19 @@ int elv_rq_merge_ok(struct request *rq, struct bio *bio)
100 if (bio_integrity(bio) != blk_integrity_rq(rq)) 100 if (bio_integrity(bio) != blk_integrity_rq(rq))
101 return 0; 101 return 0;
102 102
103 /*
104 * Don't merge if failfast settings don't match.
105 *
106 * FIXME: The negation in front of each condition is necessary
107 * because bio and request flags use different bit positions
108 * and the accessors return those bits directly. This
109 * ugliness will soon go away.
110 */
111 if (!bio_failfast_dev(bio) != !blk_failfast_dev(rq) ||
112 !bio_failfast_transport(bio) != !blk_failfast_transport(rq) ||
113 !bio_failfast_driver(bio) != !blk_failfast_driver(rq))
114 return 0;
115
103 if (!elv_iosched_allow_merge(rq, bio)) 116 if (!elv_iosched_allow_merge(rq, bio))
104 return 0; 117 return 0;
105 118
diff --git a/block/scsi_ioctl.c b/block/scsi_ioctl.c
index 5f8e798ede4e..e5b10017a50b 100644
--- a/block/scsi_ioctl.c
+++ b/block/scsi_ioctl.c
@@ -32,6 +32,11 @@
32#include <scsi/scsi_ioctl.h> 32#include <scsi/scsi_ioctl.h>
33#include <scsi/scsi_cmnd.h> 33#include <scsi/scsi_cmnd.h>
34 34
35struct blk_cmd_filter {
36 unsigned long read_ok[BLK_SCSI_CMD_PER_LONG];
37 unsigned long write_ok[BLK_SCSI_CMD_PER_LONG];
38} blk_default_cmd_filter;
39
35/* Command group 3 is reserved and should never be used. */ 40/* Command group 3 is reserved and should never be used. */
36const unsigned char scsi_command_size_tbl[8] = 41const unsigned char scsi_command_size_tbl[8] =
37{ 42{
@@ -105,7 +110,7 @@ static int sg_emulated_host(struct request_queue *q, int __user *p)
105 return put_user(1, p); 110 return put_user(1, p);
106} 111}
107 112
108void blk_set_cmd_filter_defaults(struct blk_cmd_filter *filter) 113static void blk_set_cmd_filter_defaults(struct blk_cmd_filter *filter)
109{ 114{
110 /* Basic read-only commands */ 115 /* Basic read-only commands */
111 __set_bit(TEST_UNIT_READY, filter->read_ok); 116 __set_bit(TEST_UNIT_READY, filter->read_ok);
@@ -187,14 +192,37 @@ void blk_set_cmd_filter_defaults(struct blk_cmd_filter *filter)
187 __set_bit(GPCMD_SET_STREAMING, filter->write_ok); 192 __set_bit(GPCMD_SET_STREAMING, filter->write_ok);
188 __set_bit(GPCMD_SET_READ_AHEAD, filter->write_ok); 193 __set_bit(GPCMD_SET_READ_AHEAD, filter->write_ok);
189} 194}
190EXPORT_SYMBOL_GPL(blk_set_cmd_filter_defaults); 195
196int blk_verify_command(unsigned char *cmd, fmode_t has_write_perm)
197{
198 struct blk_cmd_filter *filter = &blk_default_cmd_filter;
199
200 /* root can do any command. */
201 if (capable(CAP_SYS_RAWIO))
202 return 0;
203
204 /* if there's no filter set, assume we're filtering everything out */
205 if (!filter)
206 return -EPERM;
207
208 /* Anybody who can open the device can do a read-safe command */
209 if (test_bit(cmd[0], filter->read_ok))
210 return 0;
211
212 /* Write-safe commands require a writable open */
213 if (test_bit(cmd[0], filter->write_ok) && has_write_perm)
214 return 0;
215
216 return -EPERM;
217}
218EXPORT_SYMBOL(blk_verify_command);
191 219
192static int blk_fill_sghdr_rq(struct request_queue *q, struct request *rq, 220static int blk_fill_sghdr_rq(struct request_queue *q, struct request *rq,
193 struct sg_io_hdr *hdr, fmode_t mode) 221 struct sg_io_hdr *hdr, fmode_t mode)
194{ 222{
195 if (copy_from_user(rq->cmd, hdr->cmdp, hdr->cmd_len)) 223 if (copy_from_user(rq->cmd, hdr->cmdp, hdr->cmd_len))
196 return -EFAULT; 224 return -EFAULT;
197 if (blk_verify_command(&q->cmd_filter, rq->cmd, mode & FMODE_WRITE)) 225 if (blk_verify_command(rq->cmd, mode & FMODE_WRITE))
198 return -EPERM; 226 return -EPERM;
199 227
200 /* 228 /*
@@ -427,7 +455,7 @@ int sg_scsi_ioctl(struct request_queue *q, struct gendisk *disk, fmode_t mode,
427 if (in_len && copy_from_user(buffer, sic->data + cmdlen, in_len)) 455 if (in_len && copy_from_user(buffer, sic->data + cmdlen, in_len))
428 goto error; 456 goto error;
429 457
430 err = blk_verify_command(&q->cmd_filter, rq->cmd, mode & FMODE_WRITE); 458 err = blk_verify_command(rq->cmd, mode & FMODE_WRITE);
431 if (err) 459 if (err)
432 goto error; 460 goto error;
433 461
@@ -645,5 +673,11 @@ int scsi_cmd_ioctl(struct request_queue *q, struct gendisk *bd_disk, fmode_t mod
645 blk_put_queue(q); 673 blk_put_queue(q);
646 return err; 674 return err;
647} 675}
648
649EXPORT_SYMBOL(scsi_cmd_ioctl); 676EXPORT_SYMBOL(scsi_cmd_ioctl);
677
678int __init blk_scsi_ioctl_init(void)
679{
680 blk_set_cmd_filter_defaults(&blk_default_cmd_filter);
681 return 0;
682}
683fs_initcall(blk_scsi_ioctl_init);
diff --git a/crypto/async_tx/async_xor.c b/crypto/async_tx/async_xor.c
index 95fe2c8d6c51..90dd3f8bd283 100644
--- a/crypto/async_tx/async_xor.c
+++ b/crypto/async_tx/async_xor.c
@@ -300,7 +300,7 @@ EXPORT_SYMBOL_GPL(async_xor_zero_sum);
300 300
301static int __init async_xor_init(void) 301static int __init async_xor_init(void)
302{ 302{
303 #ifdef CONFIG_DMA_ENGINE 303 #ifdef CONFIG_ASYNC_TX_DMA
304 /* To conserve stack space the input src_list (array of page pointers) 304 /* To conserve stack space the input src_list (array of page pointers)
305 * is reused to hold the array of dma addresses passed to the driver. 305 * is reused to hold the array of dma addresses passed to the driver.
306 * This conversion is only possible when dma_addr_t is less than the 306 * This conversion is only possible when dma_addr_t is less than the
diff --git a/drivers/acpi/acpi_memhotplug.c b/drivers/acpi/acpi_memhotplug.c
index 7a0f4aa4fa1e..9a62224cc278 100644
--- a/drivers/acpi/acpi_memhotplug.c
+++ b/drivers/acpi/acpi_memhotplug.c
@@ -38,6 +38,9 @@
38 38
39#define _COMPONENT ACPI_MEMORY_DEVICE_COMPONENT 39#define _COMPONENT ACPI_MEMORY_DEVICE_COMPONENT
40 40
41#undef PREFIX
42#define PREFIX "ACPI:memory_hp:"
43
41ACPI_MODULE_NAME("acpi_memhotplug"); 44ACPI_MODULE_NAME("acpi_memhotplug");
42MODULE_AUTHOR("Naveen B S <naveen.b.s@intel.com>"); 45MODULE_AUTHOR("Naveen B S <naveen.b.s@intel.com>");
43MODULE_DESCRIPTION("Hotplug Mem Driver"); 46MODULE_DESCRIPTION("Hotplug Mem Driver");
@@ -153,6 +156,7 @@ acpi_memory_get_device(acpi_handle handle,
153 acpi_handle phandle; 156 acpi_handle phandle;
154 struct acpi_device *device = NULL; 157 struct acpi_device *device = NULL;
155 struct acpi_device *pdevice = NULL; 158 struct acpi_device *pdevice = NULL;
159 int result;
156 160
157 161
158 if (!acpi_bus_get_device(handle, &device) && device) 162 if (!acpi_bus_get_device(handle, &device) && device)
@@ -165,9 +169,9 @@ acpi_memory_get_device(acpi_handle handle,
165 } 169 }
166 170
167 /* Get the parent device */ 171 /* Get the parent device */
168 status = acpi_bus_get_device(phandle, &pdevice); 172 result = acpi_bus_get_device(phandle, &pdevice);
169 if (ACPI_FAILURE(status)) { 173 if (result) {
170 ACPI_EXCEPTION((AE_INFO, status, "Cannot get acpi bus device")); 174 printk(KERN_WARNING PREFIX "Cannot get acpi bus device");
171 return -EINVAL; 175 return -EINVAL;
172 } 176 }
173 177
@@ -175,9 +179,9 @@ acpi_memory_get_device(acpi_handle handle,
175 * Now add the notified device. This creates the acpi_device 179 * Now add the notified device. This creates the acpi_device
176 * and invokes .add function 180 * and invokes .add function
177 */ 181 */
178 status = acpi_bus_add(&device, pdevice, handle, ACPI_BUS_TYPE_DEVICE); 182 result = acpi_bus_add(&device, pdevice, handle, ACPI_BUS_TYPE_DEVICE);
179 if (ACPI_FAILURE(status)) { 183 if (result) {
180 ACPI_EXCEPTION((AE_INFO, status, "Cannot add acpi bus")); 184 printk(KERN_WARNING PREFIX "Cannot add acpi bus");
181 return -EINVAL; 185 return -EINVAL;
182 } 186 }
183 187
@@ -238,7 +242,12 @@ static int acpi_memory_enable_device(struct acpi_memory_device *mem_device)
238 num_enabled++; 242 num_enabled++;
239 continue; 243 continue;
240 } 244 }
241 245 /*
246 * If the memory block size is zero, please ignore it.
247 * Don't try to do the following memory hotplug flowchart.
248 */
249 if (!info->length)
250 continue;
242 if (node < 0) 251 if (node < 0)
243 node = memory_add_physaddr_to_nid(info->start_addr); 252 node = memory_add_physaddr_to_nid(info->start_addr);
244 253
@@ -253,8 +262,15 @@ static int acpi_memory_enable_device(struct acpi_memory_device *mem_device)
253 mem_device->state = MEMORY_INVALID_STATE; 262 mem_device->state = MEMORY_INVALID_STATE;
254 return -EINVAL; 263 return -EINVAL;
255 } 264 }
256 265 /*
257 return result; 266 * Sometimes the memory device will contain several memory blocks.
267 * When one memory block is hot-added to the system memory, it will
268 * be regarded as a success.
269 * Otherwise if the last memory block can't be hot-added to the system
270 * memory, it will be failure and the memory device can't be bound with
271 * driver.
272 */
273 return 0;
258} 274}
259 275
260static int acpi_memory_powerdown_device(struct acpi_memory_device *mem_device) 276static int acpi_memory_powerdown_device(struct acpi_memory_device *mem_device)
diff --git a/drivers/acpi/acpica/acobject.h b/drivers/acpi/acpica/acobject.h
index 544dcf834922..eb6f038b03d9 100644
--- a/drivers/acpi/acpica/acobject.h
+++ b/drivers/acpi/acpica/acobject.h
@@ -97,6 +97,7 @@
97#define AOPOBJ_OBJECT_INITIALIZED 0x08 97#define AOPOBJ_OBJECT_INITIALIZED 0x08
98#define AOPOBJ_SETUP_COMPLETE 0x10 98#define AOPOBJ_SETUP_COMPLETE 0x10
99#define AOPOBJ_SINGLE_DATUM 0x20 99#define AOPOBJ_SINGLE_DATUM 0x20
100#define AOPOBJ_INVALID 0x40 /* Used if host OS won't allow an op_region address */
100 101
101/****************************************************************************** 102/******************************************************************************
102 * 103 *
diff --git a/drivers/acpi/acpica/dsopcode.c b/drivers/acpi/acpica/dsopcode.c
index 584d766e6f12..b79978f7bc71 100644
--- a/drivers/acpi/acpica/dsopcode.c
+++ b/drivers/acpi/acpica/dsopcode.c
@@ -397,6 +397,30 @@ acpi_status acpi_ds_get_region_arguments(union acpi_operand_object *obj_desc)
397 status = acpi_ds_execute_arguments(node, acpi_ns_get_parent_node(node), 397 status = acpi_ds_execute_arguments(node, acpi_ns_get_parent_node(node),
398 extra_desc->extra.aml_length, 398 extra_desc->extra.aml_length,
399 extra_desc->extra.aml_start); 399 extra_desc->extra.aml_start);
400 if (ACPI_FAILURE(status)) {
401 return_ACPI_STATUS(status);
402 }
403
404 /* Validate the region address/length via the host OS */
405
406 status = acpi_os_validate_address(obj_desc->region.space_id,
407 obj_desc->region.address,
408 (acpi_size) obj_desc->region.length,
409 acpi_ut_get_node_name(node));
410
411 if (ACPI_FAILURE(status)) {
412 /*
413 * Invalid address/length. We will emit an error message and mark
414 * the region as invalid, so that it will cause an additional error if
415 * it is ever used. Then return AE_OK.
416 */
417 ACPI_EXCEPTION((AE_INFO, status,
418 "During address validation of OpRegion [%4.4s]",
419 node->name.ascii));
420 obj_desc->common.flags |= AOPOBJ_INVALID;
421 status = AE_OK;
422 }
423
400 return_ACPI_STATUS(status); 424 return_ACPI_STATUS(status);
401} 425}
402 426
diff --git a/drivers/acpi/acpica/exfldio.c b/drivers/acpi/acpica/exfldio.c
index d4075b821021..6687be167f5f 100644
--- a/drivers/acpi/acpica/exfldio.c
+++ b/drivers/acpi/acpica/exfldio.c
@@ -113,6 +113,12 @@ acpi_ex_setup_region(union acpi_operand_object *obj_desc,
113 } 113 }
114 } 114 }
115 115
116 /* Exit if Address/Length have been disallowed by the host OS */
117
118 if (rgn_desc->common.flags & AOPOBJ_INVALID) {
119 return_ACPI_STATUS(AE_AML_ILLEGAL_ADDRESS);
120 }
121
116 /* 122 /*
117 * Exit now for SMBus address space, it has a non-linear address space 123 * Exit now for SMBus address space, it has a non-linear address space
118 * and the request cannot be directly validated 124 * and the request cannot be directly validated
diff --git a/drivers/acpi/osl.c b/drivers/acpi/osl.c
index 71670719d61a..5691f165a952 100644
--- a/drivers/acpi/osl.c
+++ b/drivers/acpi/osl.c
@@ -189,11 +189,36 @@ acpi_status __init acpi_os_initialize(void)
189 return AE_OK; 189 return AE_OK;
190} 190}
191 191
192static void bind_to_cpu0(struct work_struct *work)
193{
194 set_cpus_allowed(current, cpumask_of_cpu(0));
195 kfree(work);
196}
197
198static void bind_workqueue(struct workqueue_struct *wq)
199{
200 struct work_struct *work;
201
202 work = kzalloc(sizeof(struct work_struct), GFP_KERNEL);
203 INIT_WORK(work, bind_to_cpu0);
204 queue_work(wq, work);
205}
206
192acpi_status acpi_os_initialize1(void) 207acpi_status acpi_os_initialize1(void)
193{ 208{
209 /*
210 * On some machines, a software-initiated SMI causes corruption unless
211 * the SMI runs on CPU 0. An SMI can be initiated by any AML, but
212 * typically it's done in GPE-related methods that are run via
213 * workqueues, so we can avoid the known corruption cases by binding
214 * the workqueues to CPU 0.
215 */
194 kacpid_wq = create_singlethread_workqueue("kacpid"); 216 kacpid_wq = create_singlethread_workqueue("kacpid");
217 bind_workqueue(kacpid_wq);
195 kacpi_notify_wq = create_singlethread_workqueue("kacpi_notify"); 218 kacpi_notify_wq = create_singlethread_workqueue("kacpi_notify");
219 bind_workqueue(kacpi_notify_wq);
196 kacpi_hotplug_wq = create_singlethread_workqueue("kacpi_hotplug"); 220 kacpi_hotplug_wq = create_singlethread_workqueue("kacpi_hotplug");
221 bind_workqueue(kacpi_hotplug_wq);
197 BUG_ON(!kacpid_wq); 222 BUG_ON(!kacpid_wq);
198 BUG_ON(!kacpi_notify_wq); 223 BUG_ON(!kacpi_notify_wq);
199 BUG_ON(!kacpi_hotplug_wq); 224 BUG_ON(!kacpi_hotplug_wq);
diff --git a/drivers/acpi/pci_root.c b/drivers/acpi/pci_root.c
index 8a5bf3b356fa..55b5b90c2a44 100644
--- a/drivers/acpi/pci_root.c
+++ b/drivers/acpi/pci_root.c
@@ -395,7 +395,7 @@ struct pci_dev *acpi_get_pci_dev(acpi_handle handle)
395 fn = adr & 0xffff; 395 fn = adr & 0xffff;
396 396
397 pdev = pci_get_slot(pbus, PCI_DEVFN(dev, fn)); 397 pdev = pci_get_slot(pbus, PCI_DEVFN(dev, fn));
398 if (hnd == handle) 398 if (!pdev || hnd == handle)
399 break; 399 break;
400 400
401 pbus = pdev->subordinate; 401 pbus = pdev->subordinate;
diff --git a/drivers/acpi/sleep.c b/drivers/acpi/sleep.c
index 01574a066534..42159a28f433 100644
--- a/drivers/acpi/sleep.c
+++ b/drivers/acpi/sleep.c
@@ -397,6 +397,14 @@ static struct dmi_system_id __initdata acpisleep_dmi_table[] = {
397 }, 397 },
398 }, 398 },
399 { 399 {
400 .callback = init_set_sci_en_on_resume,
401 .ident = "Hewlett-Packard HP G7000 Notebook PC",
402 .matches = {
403 DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
404 DMI_MATCH(DMI_PRODUCT_NAME, "HP G7000 Notebook PC"),
405 },
406 },
407 {
400 .callback = init_old_suspend_ordering, 408 .callback = init_old_suspend_ordering,
401 .ident = "Panasonic CF51-2L", 409 .ident = "Panasonic CF51-2L",
402 .matches = { 410 .matches = {
diff --git a/drivers/acpi/system.c b/drivers/acpi/system.c
index 0944daec064f..9c61ab2177cf 100644
--- a/drivers/acpi/system.c
+++ b/drivers/acpi/system.c
@@ -121,7 +121,7 @@ static void acpi_table_attr_init(struct acpi_table_attr *table_attr,
121 table_attr->attr.size = 0; 121 table_attr->attr.size = 0;
122 table_attr->attr.read = acpi_table_show; 122 table_attr->attr.read = acpi_table_show;
123 table_attr->attr.attr.name = table_attr->name; 123 table_attr->attr.attr.name = table_attr->name;
124 table_attr->attr.attr.mode = 0444; 124 table_attr->attr.attr.mode = 0400;
125 125
126 return; 126 return;
127} 127}
diff --git a/drivers/amba/bus.c b/drivers/amba/bus.c
index 3d763fdf99b7..246650673010 100644
--- a/drivers/amba/bus.c
+++ b/drivers/amba/bus.c
@@ -207,6 +207,16 @@ int amba_device_register(struct amba_device *dev, struct resource *parent)
207 void __iomem *tmp; 207 void __iomem *tmp;
208 int i, ret; 208 int i, ret;
209 209
210 device_initialize(&dev->dev);
211
212 /*
213 * Copy from device_add
214 */
215 if (dev->dev.init_name) {
216 dev_set_name(&dev->dev, "%s", dev->dev.init_name);
217 dev->dev.init_name = NULL;
218 }
219
210 dev->dev.release = amba_device_release; 220 dev->dev.release = amba_device_release;
211 dev->dev.bus = &amba_bustype; 221 dev->dev.bus = &amba_bustype;
212 dev->dev.dma_mask = &dev->dma_mask; 222 dev->dev.dma_mask = &dev->dma_mask;
@@ -240,7 +250,7 @@ int amba_device_register(struct amba_device *dev, struct resource *parent)
240 goto err_release; 250 goto err_release;
241 } 251 }
242 252
243 ret = device_register(&dev->dev); 253 ret = device_add(&dev->dev);
244 if (ret) 254 if (ret)
245 goto err_release; 255 goto err_release;
246 256
diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c
index 15a23031833f..958c1fa41900 100644
--- a/drivers/ata/ahci.c
+++ b/drivers/ata/ahci.c
@@ -513,11 +513,16 @@ static const struct pci_device_id ahci_pci_tbl[] = {
513 { PCI_VDEVICE(INTEL, 0x502a), board_ahci }, /* Tolapai */ 513 { PCI_VDEVICE(INTEL, 0x502a), board_ahci }, /* Tolapai */
514 { PCI_VDEVICE(INTEL, 0x502b), board_ahci }, /* Tolapai */ 514 { PCI_VDEVICE(INTEL, 0x502b), board_ahci }, /* Tolapai */
515 { PCI_VDEVICE(INTEL, 0x3a05), board_ahci }, /* ICH10 */ 515 { PCI_VDEVICE(INTEL, 0x3a05), board_ahci }, /* ICH10 */
516 { PCI_VDEVICE(INTEL, 0x3a22), board_ahci }, /* ICH10 */
516 { PCI_VDEVICE(INTEL, 0x3a25), board_ahci }, /* ICH10 */ 517 { PCI_VDEVICE(INTEL, 0x3a25), board_ahci }, /* ICH10 */
518 { PCI_VDEVICE(INTEL, 0x3b22), board_ahci }, /* PCH AHCI */
519 { PCI_VDEVICE(INTEL, 0x3b23), board_ahci }, /* PCH AHCI */
517 { PCI_VDEVICE(INTEL, 0x3b24), board_ahci }, /* PCH RAID */ 520 { PCI_VDEVICE(INTEL, 0x3b24), board_ahci }, /* PCH RAID */
518 { PCI_VDEVICE(INTEL, 0x3b25), board_ahci }, /* PCH RAID */ 521 { PCI_VDEVICE(INTEL, 0x3b25), board_ahci }, /* PCH RAID */
522 { PCI_VDEVICE(INTEL, 0x3b29), board_ahci }, /* PCH AHCI */
519 { PCI_VDEVICE(INTEL, 0x3b2b), board_ahci }, /* PCH RAID */ 523 { PCI_VDEVICE(INTEL, 0x3b2b), board_ahci }, /* PCH RAID */
520 { PCI_VDEVICE(INTEL, 0x3b2c), board_ahci }, /* PCH RAID */ 524 { PCI_VDEVICE(INTEL, 0x3b2c), board_ahci }, /* PCH RAID */
525 { PCI_VDEVICE(INTEL, 0x3b2f), board_ahci }, /* PCH AHCI */
521 526
522 /* JMicron 360/1/3/5/6, match class to avoid IDE function */ 527 /* JMicron 360/1/3/5/6, match class to avoid IDE function */
523 { PCI_VENDOR_ID_JMICRON, PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, 528 { PCI_VENDOR_ID_JMICRON, PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID,
diff --git a/drivers/ata/ata_piix.c b/drivers/ata/ata_piix.c
index d0a14cf2bd74..56b8a3ff1286 100644
--- a/drivers/ata/ata_piix.c
+++ b/drivers/ata/ata_piix.c
@@ -596,9 +596,12 @@ static const struct ich_laptop ich_laptop[] = {
596 { 0x27DF, 0x0005, 0x0280 }, /* ICH7 on Acer 5602WLMi */ 596 { 0x27DF, 0x0005, 0x0280 }, /* ICH7 on Acer 5602WLMi */
597 { 0x27DF, 0x1025, 0x0102 }, /* ICH7 on Acer 5602aWLMi */ 597 { 0x27DF, 0x1025, 0x0102 }, /* ICH7 on Acer 5602aWLMi */
598 { 0x27DF, 0x1025, 0x0110 }, /* ICH7 on Acer 3682WLMi */ 598 { 0x27DF, 0x1025, 0x0110 }, /* ICH7 on Acer 3682WLMi */
599 { 0x27DF, 0x1028, 0x02b0 }, /* ICH7 on unknown Dell */
599 { 0x27DF, 0x1043, 0x1267 }, /* ICH7 on Asus W5F */ 600 { 0x27DF, 0x1043, 0x1267 }, /* ICH7 on Asus W5F */
600 { 0x27DF, 0x103C, 0x30A1 }, /* ICH7 on HP Compaq nc2400 */ 601 { 0x27DF, 0x103C, 0x30A1 }, /* ICH7 on HP Compaq nc2400 */
602 { 0x27DF, 0x103C, 0x361a }, /* ICH7 on unkown HP */
601 { 0x27DF, 0x1071, 0xD221 }, /* ICH7 on Hercules EC-900 */ 603 { 0x27DF, 0x1071, 0xD221 }, /* ICH7 on Hercules EC-900 */
604 { 0x27DF, 0x152D, 0x0778 }, /* ICH7 on unknown Intel */
602 { 0x24CA, 0x1025, 0x0061 }, /* ICH4 on ACER Aspire 2023WLMi */ 605 { 0x24CA, 0x1025, 0x0061 }, /* ICH4 on ACER Aspire 2023WLMi */
603 { 0x24CA, 0x1025, 0x003d }, /* ICH4 on ACER TM290 */ 606 { 0x24CA, 0x1025, 0x003d }, /* ICH4 on ACER TM290 */
604 { 0x266F, 0x1025, 0x0066 }, /* ICH6 on ACER Aspire 1694WLMi */ 607 { 0x266F, 0x1025, 0x0066 }, /* ICH6 on ACER Aspire 1694WLMi */
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index 045a486a09ea..8ac98ff16d7d 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -1515,6 +1515,7 @@ static int ata_hpa_resize(struct ata_device *dev)
1515 1515
1516 return rc; 1516 return rc;
1517 } 1517 }
1518 dev->n_native_sectors = native_sectors;
1518 1519
1519 /* nothing to do? */ 1520 /* nothing to do? */
1520 if (native_sectors <= sectors || !ata_ignore_hpa) { 1521 if (native_sectors <= sectors || !ata_ignore_hpa) {
@@ -3392,17 +3393,27 @@ int ata_down_xfermask_limit(struct ata_device *dev, unsigned int sel)
3392 3393
3393static int ata_dev_set_mode(struct ata_device *dev) 3394static int ata_dev_set_mode(struct ata_device *dev)
3394{ 3395{
3396 struct ata_port *ap = dev->link->ap;
3395 struct ata_eh_context *ehc = &dev->link->eh_context; 3397 struct ata_eh_context *ehc = &dev->link->eh_context;
3398 const bool nosetxfer = dev->horkage & ATA_HORKAGE_NOSETXFER;
3396 const char *dev_err_whine = ""; 3399 const char *dev_err_whine = "";
3397 int ign_dev_err = 0; 3400 int ign_dev_err = 0;
3398 unsigned int err_mask; 3401 unsigned int err_mask = 0;
3399 int rc; 3402 int rc;
3400 3403
3401 dev->flags &= ~ATA_DFLAG_PIO; 3404 dev->flags &= ~ATA_DFLAG_PIO;
3402 if (dev->xfer_shift == ATA_SHIFT_PIO) 3405 if (dev->xfer_shift == ATA_SHIFT_PIO)
3403 dev->flags |= ATA_DFLAG_PIO; 3406 dev->flags |= ATA_DFLAG_PIO;
3404 3407
3405 err_mask = ata_dev_set_xfermode(dev); 3408 if (nosetxfer && ap->flags & ATA_FLAG_SATA && ata_id_is_sata(dev->id))
3409 dev_err_whine = " (SET_XFERMODE skipped)";
3410 else {
3411 if (nosetxfer)
3412 ata_dev_printk(dev, KERN_WARNING,
3413 "NOSETXFER but PATA detected - can't "
3414 "skip SETXFER, might malfunction\n");
3415 err_mask = ata_dev_set_xfermode(dev);
3416 }
3406 3417
3407 if (err_mask & ~AC_ERR_DEV) 3418 if (err_mask & ~AC_ERR_DEV)
3408 goto fail; 3419 goto fail;
@@ -4089,6 +4100,7 @@ int ata_dev_revalidate(struct ata_device *dev, unsigned int new_class,
4089 unsigned int readid_flags) 4100 unsigned int readid_flags)
4090{ 4101{
4091 u64 n_sectors = dev->n_sectors; 4102 u64 n_sectors = dev->n_sectors;
4103 u64 n_native_sectors = dev->n_native_sectors;
4092 int rc; 4104 int rc;
4093 4105
4094 if (!ata_dev_enabled(dev)) 4106 if (!ata_dev_enabled(dev))
@@ -4118,16 +4130,30 @@ int ata_dev_revalidate(struct ata_device *dev, unsigned int new_class,
4118 /* verify n_sectors hasn't changed */ 4130 /* verify n_sectors hasn't changed */
4119 if (dev->class == ATA_DEV_ATA && n_sectors && 4131 if (dev->class == ATA_DEV_ATA && n_sectors &&
4120 dev->n_sectors != n_sectors) { 4132 dev->n_sectors != n_sectors) {
4121 ata_dev_printk(dev, KERN_INFO, "n_sectors mismatch " 4133 ata_dev_printk(dev, KERN_WARNING, "n_sectors mismatch "
4122 "%llu != %llu\n", 4134 "%llu != %llu\n",
4123 (unsigned long long)n_sectors, 4135 (unsigned long long)n_sectors,
4124 (unsigned long long)dev->n_sectors); 4136 (unsigned long long)dev->n_sectors);
4125 4137 /*
4126 /* restore original n_sectors */ 4138 * Something could have caused HPA to be unlocked
4127 dev->n_sectors = n_sectors; 4139 * involuntarily. If n_native_sectors hasn't changed
4128 4140 * and the new size matches it, keep the device.
4129 rc = -ENODEV; 4141 */
4130 goto fail; 4142 if (dev->n_native_sectors == n_native_sectors &&
4143 dev->n_sectors > n_sectors &&
4144 dev->n_sectors == n_native_sectors) {
4145 ata_dev_printk(dev, KERN_WARNING,
4146 "new n_sectors matches native, probably "
4147 "late HPA unlock, continuing\n");
4148 /* keep using the old n_sectors */
4149 dev->n_sectors = n_sectors;
4150 } else {
4151 /* restore original n_[native]_sectors and fail */
4152 dev->n_native_sectors = n_native_sectors;
4153 dev->n_sectors = n_sectors;
4154 rc = -ENODEV;
4155 goto fail;
4156 }
4131 } 4157 }
4132 4158
4133 return 0; 4159 return 0;
@@ -4297,6 +4323,12 @@ static const struct ata_blacklist_entry ata_device_blacklist [] = {
4297 /* Devices which aren't very happy with higher link speeds */ 4323 /* Devices which aren't very happy with higher link speeds */
4298 { "WD My Book", NULL, ATA_HORKAGE_1_5_GBPS, }, 4324 { "WD My Book", NULL, ATA_HORKAGE_1_5_GBPS, },
4299 4325
4326 /*
4327 * Devices which choke on SETXFER. Applies only if both the
4328 * device and controller are SATA.
4329 */
4330 { "PIONEER DVD-RW DVRTD08", "1.00", ATA_HORKAGE_NOSETXFER },
4331
4300 /* End Marker */ 4332 /* End Marker */
4301 { } 4333 { }
4302}; 4334};
diff --git a/drivers/ata/libata-eh.c b/drivers/ata/libata-eh.c
index fa22f94ca415..79711b64054b 100644
--- a/drivers/ata/libata-eh.c
+++ b/drivers/ata/libata-eh.c
@@ -2327,7 +2327,7 @@ int ata_eh_reset(struct ata_link *link, int classify,
2327 struct ata_port *ap = link->ap; 2327 struct ata_port *ap = link->ap;
2328 struct ata_link *slave = ap->slave_link; 2328 struct ata_link *slave = ap->slave_link;
2329 struct ata_eh_context *ehc = &link->eh_context; 2329 struct ata_eh_context *ehc = &link->eh_context;
2330 struct ata_eh_context *sehc = &slave->eh_context; 2330 struct ata_eh_context *sehc = slave ? &slave->eh_context : NULL;
2331 unsigned int *classes = ehc->classes; 2331 unsigned int *classes = ehc->classes;
2332 unsigned int lflags = link->flags; 2332 unsigned int lflags = link->flags;
2333 int verbose = !(ehc->i.flags & ATA_EHI_QUIET); 2333 int verbose = !(ehc->i.flags & ATA_EHI_QUIET);
@@ -2517,6 +2517,10 @@ int ata_eh_reset(struct ata_link *link, int classify,
2517 2517
2518 ata_eh_about_to_do(link, NULL, ATA_EH_RESET); 2518 ata_eh_about_to_do(link, NULL, ATA_EH_RESET);
2519 rc = ata_do_reset(link, reset, classes, deadline, true); 2519 rc = ata_do_reset(link, reset, classes, deadline, true);
2520 if (rc) {
2521 failed_link = link;
2522 goto fail;
2523 }
2520 } 2524 }
2521 } else { 2525 } else {
2522 if (verbose) 2526 if (verbose)
diff --git a/drivers/ata/pata_at91.c b/drivers/ata/pata_at91.c
index 4b27617be26d..5702affcb325 100644
--- a/drivers/ata/pata_at91.c
+++ b/drivers/ata/pata_at91.c
@@ -26,9 +26,7 @@
26#include <linux/platform_device.h> 26#include <linux/platform_device.h>
27#include <linux/ata_platform.h> 27#include <linux/ata_platform.h>
28 28
29#include <mach/at91sam9260_matrix.h>
30#include <mach/at91sam9_smc.h> 29#include <mach/at91sam9_smc.h>
31#include <mach/at91sam9260.h>
32#include <mach/board.h> 30#include <mach/board.h>
33#include <mach/gpio.h> 31#include <mach/gpio.h>
34 32
@@ -44,65 +42,62 @@ struct at91_ide_info {
44 unsigned long mode; 42 unsigned long mode;
45 unsigned int cs; 43 unsigned int cs;
46 44
45 struct clk *mck;
46
47 void __iomem *ide_addr; 47 void __iomem *ide_addr;
48 void __iomem *alt_addr; 48 void __iomem *alt_addr;
49}; 49};
50 50
51const struct ata_timing initial_timing = 51static const struct ata_timing initial_timing =
52 {XFER_PIO_0, 70, 290, 240, 600, 165, 150, 600, 0}; 52 {XFER_PIO_0, 70, 290, 240, 600, 165, 150, 600, 0};
53 53
54static unsigned int calc_mck_cycles(unsigned int ns, unsigned int mck_hz) 54static unsigned long calc_mck_cycles(unsigned long ns, unsigned long mck_hz)
55{ 55{
56 unsigned long mul; 56 unsigned long mul;
57 57
58 /* 58 /*
59 * cycles = x [nsec] * f [Hz] / 10^9 [ns in sec] = 59 * cycles = x [nsec] * f [Hz] / 10^9 [ns in sec] =
60 * x * (f / 1_000_000_000) = 60 * x * (f / 1_000_000_000) =
61 * x * ((f * 65536) / 1_000_000_000) / 65536 = 61 * x * ((f * 65536) / 1_000_000_000) / 65536 =
62 * x * (((f / 10_000) * 65536) / 100_000) / 65536 = 62 * x * (((f / 10_000) * 65536) / 100_000) / 65536 =
63 */ 63 */
64 64
65 mul = (mck_hz / 10000) << 16; 65 mul = (mck_hz / 10000) << 16;
66 mul /= 100000; 66 mul /= 100000;
67 67
68 return (ns * mul + 65536) >> 16; /* rounding */ 68 return (ns * mul + 65536) >> 16; /* rounding */
69} 69}
70 70
71static void set_smc_mode(struct at91_ide_info *info) 71static void set_smc_mode(struct at91_ide_info *info)
72{ 72{
73 at91_sys_write(AT91_SMC_MODE(info->cs), info->mode); 73 at91_sys_write(AT91_SMC_MODE(info->cs), info->mode);
74 return; 74 return;
75} 75}
76 76
77static void set_smc_timing(struct device *dev, 77static void set_smc_timing(struct device *dev,
78 struct at91_ide_info *info, const struct ata_timing *ata) 78 struct at91_ide_info *info, const struct ata_timing *ata)
79{ 79{
80 int read_cycle, write_cycle, active, recover; 80 unsigned long read_cycle, write_cycle, active, recover;
81 int nrd_setup, nrd_pulse, nrd_recover; 81 unsigned long nrd_setup, nrd_pulse, nrd_recover;
82 int nwe_setup, nwe_pulse; 82 unsigned long nwe_setup, nwe_pulse;
83 83
84 int ncs_write_setup, ncs_write_pulse; 84 unsigned long ncs_write_setup, ncs_write_pulse;
85 int ncs_read_setup, ncs_read_pulse; 85 unsigned long ncs_read_setup, ncs_read_pulse;
86 86
87 unsigned int mck_hz; 87 unsigned long mck_hz;
88 struct clk *mck;
89 88
90 read_cycle = ata->cyc8b; 89 read_cycle = ata->cyc8b;
91 nrd_setup = ata->setup; 90 nrd_setup = ata->setup;
92 nrd_pulse = ata->act8b; 91 nrd_pulse = ata->act8b;
93 nrd_recover = ata->rec8b; 92 nrd_recover = ata->rec8b;
94 93
95 mck = clk_get(NULL, "mck"); 94 mck_hz = clk_get_rate(info->mck);
96 BUG_ON(IS_ERR(mck));
97 mck_hz = clk_get_rate(mck);
98 95
99 read_cycle = calc_mck_cycles(read_cycle, mck_hz); 96 read_cycle = calc_mck_cycles(read_cycle, mck_hz);
100 nrd_setup = calc_mck_cycles(nrd_setup, mck_hz); 97 nrd_setup = calc_mck_cycles(nrd_setup, mck_hz);
101 nrd_pulse = calc_mck_cycles(nrd_pulse, mck_hz); 98 nrd_pulse = calc_mck_cycles(nrd_pulse, mck_hz);
102 nrd_recover = calc_mck_cycles(nrd_recover, mck_hz); 99 nrd_recover = calc_mck_cycles(nrd_recover, mck_hz);
103 100
104 clk_put(mck);
105
106 active = nrd_setup + nrd_pulse; 101 active = nrd_setup + nrd_pulse;
107 recover = read_cycle - active; 102 recover = read_cycle - active;
108 103
@@ -121,13 +116,13 @@ static void set_smc_timing(struct device *dev,
121 ncs_write_setup = ncs_read_setup; 116 ncs_write_setup = ncs_read_setup;
122 ncs_write_pulse = ncs_read_pulse; 117 ncs_write_pulse = ncs_read_pulse;
123 118
124 dev_dbg(dev, "ATA timings: nrd_setup = %d nrd_pulse = %d nrd_cycle = %d\n", 119 dev_dbg(dev, "ATA timings: nrd_setup = %lu nrd_pulse = %lu nrd_cycle = %lu\n",
125 nrd_setup, nrd_pulse, read_cycle); 120 nrd_setup, nrd_pulse, read_cycle);
126 dev_dbg(dev, "ATA timings: nwe_setup = %d nwe_pulse = %d nwe_cycle = %d\n", 121 dev_dbg(dev, "ATA timings: nwe_setup = %lu nwe_pulse = %lu nwe_cycle = %lu\n",
127 nwe_setup, nwe_pulse, write_cycle); 122 nwe_setup, nwe_pulse, write_cycle);
128 dev_dbg(dev, "ATA timings: ncs_read_setup = %d ncs_read_pulse = %d\n", 123 dev_dbg(dev, "ATA timings: ncs_read_setup = %lu ncs_read_pulse = %lu\n",
129 ncs_read_setup, ncs_read_pulse); 124 ncs_read_setup, ncs_read_pulse);
130 dev_dbg(dev, "ATA timings: ncs_write_setup = %d ncs_write_pulse = %d\n", 125 dev_dbg(dev, "ATA timings: ncs_write_setup = %lu ncs_write_pulse = %lu\n",
131 ncs_write_setup, ncs_write_pulse); 126 ncs_write_setup, ncs_write_pulse);
132 127
133 at91_sys_write(AT91_SMC_SETUP(info->cs), 128 at91_sys_write(AT91_SMC_SETUP(info->cs),
@@ -217,6 +212,7 @@ static int __devinit pata_at91_probe(struct platform_device *pdev)
217 struct resource *mem_res; 212 struct resource *mem_res;
218 struct ata_host *host; 213 struct ata_host *host;
219 struct ata_port *ap; 214 struct ata_port *ap;
215
220 int irq_flags = 0; 216 int irq_flags = 0;
221 int irq = 0; 217 int irq = 0;
222 int ret; 218 int ret;
@@ -261,6 +257,13 @@ static int __devinit pata_at91_probe(struct platform_device *pdev)
261 return -ENOMEM; 257 return -ENOMEM;
262 } 258 }
263 259
260 info->mck = clk_get(NULL, "mck");
261
262 if (IS_ERR(info->mck)) {
263 dev_err(dev, "failed to get access to mck clock\n");
264 return -ENODEV;
265 }
266
264 info->cs = board->chipselect; 267 info->cs = board->chipselect;
265 info->mode = AT91_SMC_READMODE | AT91_SMC_WRITEMODE | 268 info->mode = AT91_SMC_READMODE | AT91_SMC_WRITEMODE |
266 AT91_SMC_EXNWMODE_READY | AT91_SMC_BAT_SELECT | 269 AT91_SMC_EXNWMODE_READY | AT91_SMC_BAT_SELECT |
@@ -304,6 +307,7 @@ err_alt_ioremap:
304 devm_iounmap(dev, info->ide_addr); 307 devm_iounmap(dev, info->ide_addr);
305 308
306err_ide_ioremap: 309err_ide_ioremap:
310 clk_put(info->mck);
307 kfree(info); 311 kfree(info);
308 312
309 return ret; 313 return ret;
@@ -312,11 +316,12 @@ err_ide_ioremap:
312static int __devexit pata_at91_remove(struct platform_device *pdev) 316static int __devexit pata_at91_remove(struct platform_device *pdev)
313{ 317{
314 struct ata_host *host = dev_get_drvdata(&pdev->dev); 318 struct ata_host *host = dev_get_drvdata(&pdev->dev);
315 struct at91_ide_info *info = host->private_data; 319 struct at91_ide_info *info;
316 struct device *dev = &pdev->dev; 320 struct device *dev = &pdev->dev;
317 321
318 if (!host) 322 if (!host)
319 return 0; 323 return 0;
324 info = host->private_data;
320 325
321 ata_host_detach(host); 326 ata_host_detach(host);
322 327
@@ -325,6 +330,7 @@ static int __devexit pata_at91_remove(struct platform_device *pdev)
325 330
326 devm_iounmap(dev, info->ide_addr); 331 devm_iounmap(dev, info->ide_addr);
327 devm_iounmap(dev, info->alt_addr); 332 devm_iounmap(dev, info->alt_addr);
333 clk_put(info->mck);
328 334
329 kfree(info); 335 kfree(info);
330 return 0; 336 return 0;
diff --git a/drivers/ata/pata_octeon_cf.c b/drivers/ata/pata_octeon_cf.c
index 8d9343accf3c..abdd19fe990a 100644
--- a/drivers/ata/pata_octeon_cf.c
+++ b/drivers/ata/pata_octeon_cf.c
@@ -653,7 +653,8 @@ static irqreturn_t octeon_cf_interrupt(int irq, void *dev_instance)
653 653
654 ap = host->ports[i]; 654 ap = host->ports[i];
655 ocd = ap->dev->platform_data; 655 ocd = ap->dev->platform_data;
656 if (!ap || (ap->flags & ATA_FLAG_DISABLED)) 656
657 if (ap->flags & ATA_FLAG_DISABLED)
657 continue; 658 continue;
658 659
659 ocd = ap->dev->platform_data; 660 ocd = ap->dev->platform_data;
diff --git a/drivers/ata/pata_pcmcia.c b/drivers/ata/pata_pcmcia.c
index f4d009ed50ac..dc99e26f8e5b 100644
--- a/drivers/ata/pata_pcmcia.c
+++ b/drivers/ata/pata_pcmcia.c
@@ -411,6 +411,7 @@ static struct pcmcia_device_id pcmcia_devices[] = {
411 PCMCIA_DEVICE_PROD_ID123("PCMCIA", "IDE CARD", "F1", 0x281f1c5d, 0x1907960c, 0xf7fde8b9), 411 PCMCIA_DEVICE_PROD_ID123("PCMCIA", "IDE CARD", "F1", 0x281f1c5d, 0x1907960c, 0xf7fde8b9),
412 PCMCIA_DEVICE_PROD_ID12("ARGOSY", "CD-ROM", 0x78f308dc, 0x66536591), 412 PCMCIA_DEVICE_PROD_ID12("ARGOSY", "CD-ROM", 0x78f308dc, 0x66536591),
413 PCMCIA_DEVICE_PROD_ID12("ARGOSY", "PnPIDE", 0x78f308dc, 0x0c694728), 413 PCMCIA_DEVICE_PROD_ID12("ARGOSY", "PnPIDE", 0x78f308dc, 0x0c694728),
414 PCMCIA_DEVICE_PROD_ID12("CNF ", "CD-ROM", 0x46d7db81, 0x66536591),
414 PCMCIA_DEVICE_PROD_ID12("CNF CD-M", "CD-ROM", 0x7d93b852, 0x66536591), 415 PCMCIA_DEVICE_PROD_ID12("CNF CD-M", "CD-ROM", 0x7d93b852, 0x66536591),
415 PCMCIA_DEVICE_PROD_ID12("Creative Technology Ltd.", "PCMCIA CD-ROM Interface Card", 0xff8c8a45, 0xfe8020c4), 416 PCMCIA_DEVICE_PROD_ID12("Creative Technology Ltd.", "PCMCIA CD-ROM Interface Card", 0xff8c8a45, 0xfe8020c4),
416 PCMCIA_DEVICE_PROD_ID12("Digital Equipment Corporation.", "Digital Mobile Media CD-ROM", 0x17692a66, 0xef1dcbde), 417 PCMCIA_DEVICE_PROD_ID12("Digital Equipment Corporation.", "Digital Mobile Media CD-ROM", 0x17692a66, 0xef1dcbde),
diff --git a/drivers/ata/sata_mv.c b/drivers/ata/sata_mv.c
index 23714aefb825..c19417e02208 100644
--- a/drivers/ata/sata_mv.c
+++ b/drivers/ata/sata_mv.c
@@ -2514,7 +2514,7 @@ static void mv_unexpected_intr(struct ata_port *ap, int edma_was_enabled)
2514 char *when = "idle"; 2514 char *when = "idle";
2515 2515
2516 ata_ehi_clear_desc(ehi); 2516 ata_ehi_clear_desc(ehi);
2517 if (!ap || (ap->flags & ATA_FLAG_DISABLED)) { 2517 if (ap->flags & ATA_FLAG_DISABLED) {
2518 when = "disabled"; 2518 when = "disabled";
2519 } else if (edma_was_enabled) { 2519 } else if (edma_was_enabled) {
2520 when = "EDMA enabled"; 2520 when = "EDMA enabled";
diff --git a/drivers/ata/sata_sil.c b/drivers/ata/sata_sil.c
index 030ec079b184..35bd5cc7f285 100644
--- a/drivers/ata/sata_sil.c
+++ b/drivers/ata/sata_sil.c
@@ -532,7 +532,7 @@ static irqreturn_t sil_interrupt(int irq, void *dev_instance)
532 struct ata_port *ap = host->ports[i]; 532 struct ata_port *ap = host->ports[i];
533 u32 bmdma2 = readl(mmio_base + sil_port[ap->port_no].bmdma2); 533 u32 bmdma2 = readl(mmio_base + sil_port[ap->port_no].bmdma2);
534 534
535 if (unlikely(!ap || ap->flags & ATA_FLAG_DISABLED)) 535 if (unlikely(ap->flags & ATA_FLAG_DISABLED))
536 continue; 536 continue;
537 537
538 /* turn off SATA_IRQ if not supported */ 538 /* turn off SATA_IRQ if not supported */
diff --git a/drivers/base/devres.c b/drivers/base/devres.c
index e8beb8e5b626..05dd307e8f02 100644
--- a/drivers/base/devres.c
+++ b/drivers/base/devres.c
@@ -428,6 +428,9 @@ int devres_release_all(struct device *dev)
428{ 428{
429 unsigned long flags; 429 unsigned long flags;
430 430
431 /* Looks like an uninitialized device structure */
432 if (WARN_ON(dev->devres_head.next == NULL))
433 return -ENODEV;
431 spin_lock_irqsave(&dev->devres_lock, flags); 434 spin_lock_irqsave(&dev->devres_lock, flags);
432 return release_nodes(dev, dev->devres_head.next, &dev->devres_head, 435 return release_nodes(dev, dev->devres_head.next, &dev->devres_head,
433 flags); 436 flags);
diff --git a/drivers/base/firmware_class.c b/drivers/base/firmware_class.c
index ddeb819c8f87..7376367bcb80 100644
--- a/drivers/base/firmware_class.c
+++ b/drivers/base/firmware_class.c
@@ -180,7 +180,6 @@ static ssize_t firmware_loading_store(struct device *dev,
180 goto err; 180 goto err;
181 } 181 }
182 /* Pages will be freed by vfree() */ 182 /* Pages will be freed by vfree() */
183 fw_priv->pages = NULL;
184 fw_priv->page_array_size = 0; 183 fw_priv->page_array_size = 0;
185 fw_priv->nr_pages = 0; 184 fw_priv->nr_pages = 0;
186 complete(&fw_priv->completion); 185 complete(&fw_priv->completion);
@@ -217,8 +216,10 @@ firmware_data_read(struct kobject *kobj, struct bin_attribute *bin_attr,
217 ret_count = -ENODEV; 216 ret_count = -ENODEV;
218 goto out; 217 goto out;
219 } 218 }
220 if (offset > fw->size) 219 if (offset > fw->size) {
221 return 0; 220 ret_count = 0;
221 goto out;
222 }
222 if (count > fw->size - offset) 223 if (count > fw->size - offset)
223 count = fw->size - offset; 224 count = fw->size - offset;
224 225
@@ -357,7 +358,7 @@ static void fw_dev_release(struct device *dev)
357 kfree(fw_priv->pages); 358 kfree(fw_priv->pages);
358 kfree(fw_priv->fw_id); 359 kfree(fw_priv->fw_id);
359 kfree(fw_priv); 360 kfree(fw_priv);
360 put_device(dev); 361 kfree(dev);
361 362
362 module_put(THIS_MODULE); 363 module_put(THIS_MODULE);
363} 364}
@@ -408,13 +409,11 @@ static int fw_register_device(struct device **dev_p, const char *fw_name,
408 if (retval) { 409 if (retval) {
409 dev_err(device, "%s: device_register failed\n", __func__); 410 dev_err(device, "%s: device_register failed\n", __func__);
410 put_device(f_dev); 411 put_device(f_dev);
411 goto error_kfree_fw_id; 412 return retval;
412 } 413 }
413 *dev_p = f_dev; 414 *dev_p = f_dev;
414 return 0; 415 return 0;
415 416
416error_kfree_fw_id:
417 kfree(fw_priv->fw_id);
418error_kfree: 417error_kfree:
419 kfree(f_dev); 418 kfree(f_dev);
420 kfree(fw_priv); 419 kfree(fw_priv);
diff --git a/drivers/base/power/main.c b/drivers/base/power/main.c
index fae725458981..58a3e572f2c9 100644
--- a/drivers/base/power/main.c
+++ b/drivers/base/power/main.c
@@ -762,6 +762,7 @@ static int dpm_prepare(pm_message_t state)
762 dev->power.status = DPM_ON; 762 dev->power.status = DPM_ON;
763 if (error == -EAGAIN) { 763 if (error == -EAGAIN) {
764 put_device(dev); 764 put_device(dev);
765 error = 0;
765 continue; 766 continue;
766 } 767 }
767 printk(KERN_ERR "PM: Failed to prepare device %s " 768 printk(KERN_ERR "PM: Failed to prepare device %s "
diff --git a/drivers/base/sys.c b/drivers/base/sys.c
index 79a9ae5238ac..0d903909af7e 100644
--- a/drivers/base/sys.c
+++ b/drivers/base/sys.c
@@ -275,9 +275,9 @@ int sysdev_register(struct sys_device *sysdev)
275 drv->add(sysdev); 275 drv->add(sysdev);
276 } 276 }
277 mutex_unlock(&sysdev_drivers_lock); 277 mutex_unlock(&sysdev_drivers_lock);
278 kobject_uevent(&sysdev->kobj, KOBJ_ADD);
278 } 279 }
279 280
280 kobject_uevent(&sysdev->kobj, KOBJ_ADD);
281 return error; 281 return error;
282} 282}
283 283
diff --git a/drivers/block/DAC960.c b/drivers/block/DAC960.c
index 668dc234b8e2..1e6b7c14f697 100644
--- a/drivers/block/DAC960.c
+++ b/drivers/block/DAC960.c
@@ -36,6 +36,7 @@
36#include <linux/ioport.h> 36#include <linux/ioport.h>
37#include <linux/mm.h> 37#include <linux/mm.h>
38#include <linux/slab.h> 38#include <linux/slab.h>
39#include <linux/smp_lock.h>
39#include <linux/proc_fs.h> 40#include <linux/proc_fs.h>
40#include <linux/reboot.h> 41#include <linux/reboot.h>
41#include <linux/spinlock.h> 42#include <linux/spinlock.h>
diff --git a/drivers/block/Kconfig b/drivers/block/Kconfig
index bb72ada9f074..1d886e079c58 100644
--- a/drivers/block/Kconfig
+++ b/drivers/block/Kconfig
@@ -298,6 +298,22 @@ config BLK_DEV_NBD
298 298
299 If unsure, say N. 299 If unsure, say N.
300 300
301config BLK_DEV_OSD
302 tristate "OSD object-as-blkdev support"
303 depends on SCSI_OSD_ULD
304 ---help---
305 Saying Y or M here will allow the exporting of a single SCSI
306 OSD (object-based storage) object as a Linux block device.
307
308 For example, if you create a 2G object on an OSD device,
309 you can then use this module to present that 2G object as
310 a Linux block device.
311
312 To compile this driver as a module, choose M here: the
313 module will be called osdblk.
314
315 If unsure, say N.
316
301config BLK_DEV_SX8 317config BLK_DEV_SX8
302 tristate "Promise SATA SX8 support" 318 tristate "Promise SATA SX8 support"
303 depends on PCI 319 depends on PCI
diff --git a/drivers/block/Makefile b/drivers/block/Makefile
index 7755a5e2a85e..cdaa3f8fddf0 100644
--- a/drivers/block/Makefile
+++ b/drivers/block/Makefile
@@ -23,6 +23,7 @@ obj-$(CONFIG_XILINX_SYSACE) += xsysace.o
23obj-$(CONFIG_CDROM_PKTCDVD) += pktcdvd.o 23obj-$(CONFIG_CDROM_PKTCDVD) += pktcdvd.o
24obj-$(CONFIG_MG_DISK) += mg_disk.o 24obj-$(CONFIG_MG_DISK) += mg_disk.o
25obj-$(CONFIG_SUNVDC) += sunvdc.o 25obj-$(CONFIG_SUNVDC) += sunvdc.o
26obj-$(CONFIG_BLK_DEV_OSD) += osdblk.o
26 27
27obj-$(CONFIG_BLK_DEV_UMEM) += umem.o 28obj-$(CONFIG_BLK_DEV_UMEM) += umem.o
28obj-$(CONFIG_BLK_DEV_NBD) += nbd.o 29obj-$(CONFIG_BLK_DEV_NBD) += nbd.o
diff --git a/drivers/block/amiflop.c b/drivers/block/amiflop.c
index 9c6e5b0fe894..2f07b7c99a95 100644
--- a/drivers/block/amiflop.c
+++ b/drivers/block/amiflop.c
@@ -1645,7 +1645,7 @@ static int __init fd_probe_drives(void)
1645{ 1645{
1646 int drive,drives,nomem; 1646 int drive,drives,nomem;
1647 1647
1648 printk(KERN_INFO "FD: probing units\n" KERN_INFO "found "); 1648 printk(KERN_INFO "FD: probing units\nfound ");
1649 drives=0; 1649 drives=0;
1650 nomem=0; 1650 nomem=0;
1651 for(drive=0;drive<FD_MAX_UNITS;drive++) { 1651 for(drive=0;drive<FD_MAX_UNITS;drive++) {
diff --git a/drivers/block/ataflop.c b/drivers/block/ataflop.c
index f5e7180d7f47..3ff02941b3dd 100644
--- a/drivers/block/ataflop.c
+++ b/drivers/block/ataflop.c
@@ -1627,7 +1627,7 @@ static int fd_ioctl(struct block_device *bdev, fmode_t mode,
1627 drive, dtp->blocks, dtp->spt, dtp->stretch); 1627 drive, dtp->blocks, dtp->spt, dtp->stretch);
1628 1628
1629 /* sanity check */ 1629 /* sanity check */
1630 if (!dtp || setprm.track != dtp->blocks/dtp->spt/2 || 1630 if (setprm.track != dtp->blocks/dtp->spt/2 ||
1631 setprm.head != 2) { 1631 setprm.head != 2) {
1632 redo_fd_request(); 1632 redo_fd_request();
1633 return -EINVAL; 1633 return -EINVAL;
diff --git a/drivers/block/cciss.c b/drivers/block/cciss.c
index c7a527c08a09..a52cc7fe45ea 100644
--- a/drivers/block/cciss.c
+++ b/drivers/block/cciss.c
@@ -26,6 +26,7 @@
26#include <linux/pci.h> 26#include <linux/pci.h>
27#include <linux/kernel.h> 27#include <linux/kernel.h>
28#include <linux/slab.h> 28#include <linux/slab.h>
29#include <linux/smp_lock.h>
29#include <linux/delay.h> 30#include <linux/delay.h>
30#include <linux/major.h> 31#include <linux/major.h>
31#include <linux/fs.h> 32#include <linux/fs.h>
@@ -226,8 +227,18 @@ static inline void addQ(struct hlist_head *list, CommandList_struct *c)
226 227
227static inline void removeQ(CommandList_struct *c) 228static inline void removeQ(CommandList_struct *c)
228{ 229{
229 if (WARN_ON(hlist_unhashed(&c->list))) 230 /*
231 * After kexec/dump some commands might still
232 * be in flight, which the firmware will try
233 * to complete. Resetting the firmware doesn't work
234 * with old fw revisions, so we have to mark
235 * them off as 'stale' to prevent the driver from
236 * falling over.
237 */
238 if (WARN_ON(hlist_unhashed(&c->list))) {
239 c->cmd_type = CMD_MSG_STALE;
230 return; 240 return;
241 }
231 242
232 hlist_del_init(&c->list); 243 hlist_del_init(&c->list);
233} 244}
@@ -4246,7 +4257,8 @@ static void fail_all_cmds(unsigned long ctlr)
4246 while (!hlist_empty(&h->cmpQ)) { 4257 while (!hlist_empty(&h->cmpQ)) {
4247 c = hlist_entry(h->cmpQ.first, CommandList_struct, list); 4258 c = hlist_entry(h->cmpQ.first, CommandList_struct, list);
4248 removeQ(c); 4259 removeQ(c);
4249 c->err_info->CommandStatus = CMD_HARDWARE_ERR; 4260 if (c->cmd_type != CMD_MSG_STALE)
4261 c->err_info->CommandStatus = CMD_HARDWARE_ERR;
4250 if (c->cmd_type == CMD_RWREQ) { 4262 if (c->cmd_type == CMD_RWREQ) {
4251 complete_command(h, c, 0); 4263 complete_command(h, c, 0);
4252 } else if (c->cmd_type == CMD_IOCTL_PEND) 4264 } else if (c->cmd_type == CMD_IOCTL_PEND)
diff --git a/drivers/block/cciss_cmd.h b/drivers/block/cciss_cmd.h
index cd665b00c7c5..dbaed1ea0da3 100644
--- a/drivers/block/cciss_cmd.h
+++ b/drivers/block/cciss_cmd.h
@@ -274,6 +274,7 @@ typedef struct _ErrorInfo_struct {
274#define CMD_SCSI 0x03 274#define CMD_SCSI 0x03
275#define CMD_MSG_DONE 0x04 275#define CMD_MSG_DONE 0x04
276#define CMD_MSG_TIMEOUT 0x05 276#define CMD_MSG_TIMEOUT 0x05
277#define CMD_MSG_STALE 0xff
277 278
278/* This structure needs to be divisible by 8 for new 279/* This structure needs to be divisible by 8 for new
279 * indexing method. 280 * indexing method.
diff --git a/drivers/block/floppy.c b/drivers/block/floppy.c
index 862b40c90181..91b753013780 100644
--- a/drivers/block/floppy.c
+++ b/drivers/block/floppy.c
@@ -3327,7 +3327,10 @@ static inline int set_geometry(unsigned int cmd, struct floppy_struct *g,
3327 if (!capable(CAP_SYS_ADMIN)) 3327 if (!capable(CAP_SYS_ADMIN))
3328 return -EPERM; 3328 return -EPERM;
3329 mutex_lock(&open_lock); 3329 mutex_lock(&open_lock);
3330 LOCK_FDC(drive, 1); 3330 if (lock_fdc(drive, 1)) {
3331 mutex_unlock(&open_lock);
3332 return -EINTR;
3333 }
3331 floppy_type[type] = *g; 3334 floppy_type[type] = *g;
3332 floppy_type[type].name = "user format"; 3335 floppy_type[type].name = "user format";
3333 for (cnt = type << 2; cnt < (type << 2) + 4; cnt++) 3336 for (cnt = type << 2; cnt < (type << 2) + 4; cnt++)
diff --git a/drivers/block/loop.c b/drivers/block/loop.c
index 801f4ab83302..5757188cd1fb 100644
--- a/drivers/block/loop.c
+++ b/drivers/block/loop.c
@@ -61,7 +61,6 @@
61#include <linux/blkdev.h> 61#include <linux/blkdev.h>
62#include <linux/blkpg.h> 62#include <linux/blkpg.h>
63#include <linux/init.h> 63#include <linux/init.h>
64#include <linux/smp_lock.h>
65#include <linux/swap.h> 64#include <linux/swap.h>
66#include <linux/slab.h> 65#include <linux/slab.h>
67#include <linux/loop.h> 66#include <linux/loop.h>
diff --git a/drivers/block/mg_disk.c b/drivers/block/mg_disk.c
index f703f5478246..6d7fbaa92248 100644
--- a/drivers/block/mg_disk.c
+++ b/drivers/block/mg_disk.c
@@ -36,7 +36,6 @@
36 36
37/* Register offsets */ 37/* Register offsets */
38#define MG_BUFF_OFFSET 0x8000 38#define MG_BUFF_OFFSET 0x8000
39#define MG_STORAGE_BUFFER_SIZE 0x200
40#define MG_REG_OFFSET 0xC000 39#define MG_REG_OFFSET 0xC000
41#define MG_REG_FEATURE (MG_REG_OFFSET + 2) /* write case */ 40#define MG_REG_FEATURE (MG_REG_OFFSET + 2) /* write case */
42#define MG_REG_ERROR (MG_REG_OFFSET + 2) /* read case */ 41#define MG_REG_ERROR (MG_REG_OFFSET + 2) /* read case */
@@ -219,6 +218,16 @@ static unsigned int mg_wait(struct mg_host *host, u32 expect, u32 msec)
219 host->error = MG_ERR_NONE; 218 host->error = MG_ERR_NONE;
220 expire = jiffies + msecs_to_jiffies(msec); 219 expire = jiffies + msecs_to_jiffies(msec);
221 220
221 /* These 2 times dummy status read prevents reading invalid
222 * status. A very little time (3 times of mflash operating clk)
223 * is required for busy bit is set. Use dummy read instead of
224 * busy wait, because mflash's PLL is machine dependent.
225 */
226 if (prv_data->use_polling) {
227 status = inb((unsigned long)host->dev_base + MG_REG_STATUS);
228 status = inb((unsigned long)host->dev_base + MG_REG_STATUS);
229 }
230
222 status = inb((unsigned long)host->dev_base + MG_REG_STATUS); 231 status = inb((unsigned long)host->dev_base + MG_REG_STATUS);
223 232
224 do { 233 do {
@@ -245,8 +254,6 @@ static unsigned int mg_wait(struct mg_host *host, u32 expect, u32 msec)
245 mg_dump_status("not ready", status, host); 254 mg_dump_status("not ready", status, host);
246 return MG_ERR_INV_STAT; 255 return MG_ERR_INV_STAT;
247 } 256 }
248 if (prv_data->use_polling)
249 msleep(1);
250 257
251 status = inb((unsigned long)host->dev_base + MG_REG_STATUS); 258 status = inb((unsigned long)host->dev_base + MG_REG_STATUS);
252 } while (time_before(cur_jiffies, expire)); 259 } while (time_before(cur_jiffies, expire));
@@ -469,9 +476,18 @@ static unsigned int mg_out(struct mg_host *host,
469 return MG_ERR_NONE; 476 return MG_ERR_NONE;
470} 477}
471 478
479static void mg_read_one(struct mg_host *host, struct request *req)
480{
481 u16 *buff = (u16 *)req->buffer;
482 u32 i;
483
484 for (i = 0; i < MG_SECTOR_SIZE >> 1; i++)
485 *buff++ = inw((unsigned long)host->dev_base + MG_BUFF_OFFSET +
486 (i << 1));
487}
488
472static void mg_read(struct request *req) 489static void mg_read(struct request *req)
473{ 490{
474 u32 j;
475 struct mg_host *host = req->rq_disk->private_data; 491 struct mg_host *host = req->rq_disk->private_data;
476 492
477 if (mg_out(host, blk_rq_pos(req), blk_rq_sectors(req), 493 if (mg_out(host, blk_rq_pos(req), blk_rq_sectors(req),
@@ -482,49 +498,65 @@ static void mg_read(struct request *req)
482 blk_rq_sectors(req), blk_rq_pos(req), req->buffer); 498 blk_rq_sectors(req), blk_rq_pos(req), req->buffer);
483 499
484 do { 500 do {
485 u16 *buff = (u16 *)req->buffer;
486
487 if (mg_wait(host, ATA_DRQ, 501 if (mg_wait(host, ATA_DRQ,
488 MG_TMAX_WAIT_RD_DRQ) != MG_ERR_NONE) { 502 MG_TMAX_WAIT_RD_DRQ) != MG_ERR_NONE) {
489 mg_bad_rw_intr(host); 503 mg_bad_rw_intr(host);
490 return; 504 return;
491 } 505 }
492 for (j = 0; j < MG_SECTOR_SIZE >> 1; j++) 506
493 *buff++ = inw((unsigned long)host->dev_base + 507 mg_read_one(host, req);
494 MG_BUFF_OFFSET + (j << 1));
495 508
496 outb(MG_CMD_RD_CONF, (unsigned long)host->dev_base + 509 outb(MG_CMD_RD_CONF, (unsigned long)host->dev_base +
497 MG_REG_COMMAND); 510 MG_REG_COMMAND);
498 } while (mg_end_request(host, 0, MG_SECTOR_SIZE)); 511 } while (mg_end_request(host, 0, MG_SECTOR_SIZE));
499} 512}
500 513
514static void mg_write_one(struct mg_host *host, struct request *req)
515{
516 u16 *buff = (u16 *)req->buffer;
517 u32 i;
518
519 for (i = 0; i < MG_SECTOR_SIZE >> 1; i++)
520 outw(*buff++, (unsigned long)host->dev_base + MG_BUFF_OFFSET +
521 (i << 1));
522}
523
501static void mg_write(struct request *req) 524static void mg_write(struct request *req)
502{ 525{
503 u32 j;
504 struct mg_host *host = req->rq_disk->private_data; 526 struct mg_host *host = req->rq_disk->private_data;
527 unsigned int rem = blk_rq_sectors(req);
505 528
506 if (mg_out(host, blk_rq_pos(req), blk_rq_sectors(req), 529 if (mg_out(host, blk_rq_pos(req), rem,
507 MG_CMD_WR, NULL) != MG_ERR_NONE) { 530 MG_CMD_WR, NULL) != MG_ERR_NONE) {
508 mg_bad_rw_intr(host); 531 mg_bad_rw_intr(host);
509 return; 532 return;
510 } 533 }
511 534
512 MG_DBG("requested %d sects (from %ld), buffer=0x%p\n", 535 MG_DBG("requested %d sects (from %ld), buffer=0x%p\n",
513 blk_rq_sectors(req), blk_rq_pos(req), req->buffer); 536 rem, blk_rq_pos(req), req->buffer);
537
538 if (mg_wait(host, ATA_DRQ,
539 MG_TMAX_WAIT_WR_DRQ) != MG_ERR_NONE) {
540 mg_bad_rw_intr(host);
541 return;
542 }
514 543
515 do { 544 do {
516 u16 *buff = (u16 *)req->buffer; 545 mg_write_one(host, req);
517 546
518 if (mg_wait(host, ATA_DRQ, MG_TMAX_WAIT_WR_DRQ) != MG_ERR_NONE) { 547 outb(MG_CMD_WR_CONF, (unsigned long)host->dev_base +
548 MG_REG_COMMAND);
549
550 rem--;
551 if (rem > 1 && mg_wait(host, ATA_DRQ,
552 MG_TMAX_WAIT_WR_DRQ) != MG_ERR_NONE) {
553 mg_bad_rw_intr(host);
554 return;
555 } else if (mg_wait(host, MG_STAT_READY,
556 MG_TMAX_WAIT_WR_DRQ) != MG_ERR_NONE) {
519 mg_bad_rw_intr(host); 557 mg_bad_rw_intr(host);
520 return; 558 return;
521 } 559 }
522 for (j = 0; j < MG_SECTOR_SIZE >> 1; j++)
523 outw(*buff++, (unsigned long)host->dev_base +
524 MG_BUFF_OFFSET + (j << 1));
525
526 outb(MG_CMD_WR_CONF, (unsigned long)host->dev_base +
527 MG_REG_COMMAND);
528 } while (mg_end_request(host, 0, MG_SECTOR_SIZE)); 560 } while (mg_end_request(host, 0, MG_SECTOR_SIZE));
529} 561}
530 562
@@ -532,7 +564,6 @@ static void mg_read_intr(struct mg_host *host)
532{ 564{
533 struct request *req = host->req; 565 struct request *req = host->req;
534 u32 i; 566 u32 i;
535 u16 *buff;
536 567
537 /* check status */ 568 /* check status */
538 do { 569 do {
@@ -550,13 +581,7 @@ static void mg_read_intr(struct mg_host *host)
550 return; 581 return;
551 582
552ok_to_read: 583ok_to_read:
553 /* get current segment of request */ 584 mg_read_one(host, req);
554 buff = (u16 *)req->buffer;
555
556 /* read 1 sector */
557 for (i = 0; i < MG_SECTOR_SIZE >> 1; i++)
558 *buff++ = inw((unsigned long)host->dev_base + MG_BUFF_OFFSET +
559 (i << 1));
560 585
561 MG_DBG("sector %ld, remaining=%ld, buffer=0x%p\n", 586 MG_DBG("sector %ld, remaining=%ld, buffer=0x%p\n",
562 blk_rq_pos(req), blk_rq_sectors(req) - 1, req->buffer); 587 blk_rq_pos(req), blk_rq_sectors(req) - 1, req->buffer);
@@ -575,8 +600,7 @@ ok_to_read:
575static void mg_write_intr(struct mg_host *host) 600static void mg_write_intr(struct mg_host *host)
576{ 601{
577 struct request *req = host->req; 602 struct request *req = host->req;
578 u32 i, j; 603 u32 i;
579 u16 *buff;
580 bool rem; 604 bool rem;
581 605
582 /* check status */ 606 /* check status */
@@ -597,12 +621,7 @@ static void mg_write_intr(struct mg_host *host)
597ok_to_write: 621ok_to_write:
598 if ((rem = mg_end_request(host, 0, MG_SECTOR_SIZE))) { 622 if ((rem = mg_end_request(host, 0, MG_SECTOR_SIZE))) {
599 /* write 1 sector and set handler if remains */ 623 /* write 1 sector and set handler if remains */
600 buff = (u16 *)req->buffer; 624 mg_write_one(host, req);
601 for (j = 0; j < MG_STORAGE_BUFFER_SIZE >> 1; j++) {
602 outw(*buff, (unsigned long)host->dev_base +
603 MG_BUFF_OFFSET + (j << 1));
604 buff++;
605 }
606 MG_DBG("sector %ld, remaining=%ld, buffer=0x%p\n", 625 MG_DBG("sector %ld, remaining=%ld, buffer=0x%p\n",
607 blk_rq_pos(req), blk_rq_sectors(req), req->buffer); 626 blk_rq_pos(req), blk_rq_sectors(req), req->buffer);
608 host->mg_do_intr = mg_write_intr; 627 host->mg_do_intr = mg_write_intr;
@@ -667,9 +686,6 @@ static unsigned int mg_issue_req(struct request *req,
667 unsigned int sect_num, 686 unsigned int sect_num,
668 unsigned int sect_cnt) 687 unsigned int sect_cnt)
669{ 688{
670 u16 *buff;
671 u32 i;
672
673 switch (rq_data_dir(req)) { 689 switch (rq_data_dir(req)) {
674 case READ: 690 case READ:
675 if (mg_out(host, sect_num, sect_cnt, MG_CMD_RD, &mg_read_intr) 691 if (mg_out(host, sect_num, sect_cnt, MG_CMD_RD, &mg_read_intr)
@@ -693,12 +709,7 @@ static unsigned int mg_issue_req(struct request *req,
693 mg_bad_rw_intr(host); 709 mg_bad_rw_intr(host);
694 return host->error; 710 return host->error;
695 } 711 }
696 buff = (u16 *)req->buffer; 712 mg_write_one(host, req);
697 for (i = 0; i < MG_SECTOR_SIZE >> 1; i++) {
698 outw(*buff, (unsigned long)host->dev_base +
699 MG_BUFF_OFFSET + (i << 1));
700 buff++;
701 }
702 mod_timer(&host->timer, jiffies + 3 * HZ); 713 mod_timer(&host->timer, jiffies + 3 * HZ);
703 outb(MG_CMD_WR_CONF, (unsigned long)host->dev_base + 714 outb(MG_CMD_WR_CONF, (unsigned long)host->dev_base +
704 MG_REG_COMMAND); 715 MG_REG_COMMAND);
diff --git a/drivers/block/osdblk.c b/drivers/block/osdblk.c
new file mode 100644
index 000000000000..13c1aee6aa3f
--- /dev/null
+++ b/drivers/block/osdblk.c
@@ -0,0 +1,701 @@
1
2/*
3 osdblk.c -- Export a single SCSI OSD object as a Linux block device
4
5
6 Copyright 2009 Red Hat, Inc.
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 as published by
10 the Free Software Foundation.
11
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
16
17 You should have received a copy of the GNU General Public License
18 along with this program; see the file COPYING. If not, write to
19 the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
20
21
22 Instructions for use
23 --------------------
24
25 1) Map a Linux block device to an existing OSD object.
26
27 In this example, we will use partition id 1234, object id 5678,
28 OSD device /dev/osd1.
29
30 $ echo "1234 5678 /dev/osd1" > /sys/class/osdblk/add
31
32
33 2) List all active blkdev<->object mappings.
34
35 In this example, we have performed step #1 twice, creating two blkdevs,
36 mapped to two separate OSD objects.
37
38 $ cat /sys/class/osdblk/list
39 0 174 1234 5678 /dev/osd1
40 1 179 1994 897123 /dev/osd0
41
42 The columns, in order, are:
43 - blkdev unique id
44 - blkdev assigned major
45 - OSD object partition id
46 - OSD object id
47 - OSD device
48
49
50 3) Remove an active blkdev<->object mapping.
51
52 In this example, we remove the mapping with blkdev unique id 1.
53
54 $ echo 1 > /sys/class/osdblk/remove
55
56
57 NOTE: The actual creation and deletion of OSD objects is outside the scope
58 of this driver.
59
60 */
61
62#include <linux/kernel.h>
63#include <linux/device.h>
64#include <linux/module.h>
65#include <linux/fs.h>
66#include <scsi/osd_initiator.h>
67#include <scsi/osd_attributes.h>
68#include <scsi/osd_sec.h>
69#include <scsi/scsi_device.h>
70
71#define DRV_NAME "osdblk"
72#define PFX DRV_NAME ": "
73
74/* #define _OSDBLK_DEBUG */
75#ifdef _OSDBLK_DEBUG
76#define OSDBLK_DEBUG(fmt, a...) \
77 printk(KERN_NOTICE "osdblk @%s:%d: " fmt, __func__, __LINE__, ##a)
78#else
79#define OSDBLK_DEBUG(fmt, a...) \
80 do { if (0) printk(fmt, ##a); } while (0)
81#endif
82
83MODULE_AUTHOR("Jeff Garzik <jeff@garzik.org>");
84MODULE_DESCRIPTION("block device inside an OSD object osdblk.ko");
85MODULE_LICENSE("GPL");
86
87struct osdblk_device;
88
89enum {
90 OSDBLK_MINORS_PER_MAJOR = 256, /* max minors per blkdev */
91 OSDBLK_MAX_REQ = 32, /* max parallel requests */
92 OSDBLK_OP_TIMEOUT = 4 * 60, /* sync OSD req timeout */
93};
94
95struct osdblk_request {
96 struct request *rq; /* blk layer request */
97 struct bio *bio; /* cloned bio */
98 struct osdblk_device *osdev; /* associated blkdev */
99};
100
101struct osdblk_device {
102 int id; /* blkdev unique id */
103
104 int major; /* blkdev assigned major */
105 struct gendisk *disk; /* blkdev's gendisk and rq */
106 struct request_queue *q;
107
108 struct osd_dev *osd; /* associated OSD */
109
110 char name[32]; /* blkdev name, e.g. osdblk34 */
111
112 spinlock_t lock; /* queue lock */
113
114 struct osd_obj_id obj; /* OSD partition, obj id */
115 uint8_t obj_cred[OSD_CAP_LEN]; /* OSD cred */
116
117 struct osdblk_request req[OSDBLK_MAX_REQ]; /* request table */
118
119 struct list_head node;
120
121 char osd_path[0]; /* OSD device path */
122};
123
124static struct class *class_osdblk; /* /sys/class/osdblk */
125static DEFINE_MUTEX(ctl_mutex); /* Serialize open/close/setup/teardown */
126static LIST_HEAD(osdblkdev_list);
127
128static struct block_device_operations osdblk_bd_ops = {
129 .owner = THIS_MODULE,
130};
131
132static const struct osd_attr g_attr_logical_length = ATTR_DEF(
133 OSD_APAGE_OBJECT_INFORMATION, OSD_ATTR_OI_LOGICAL_LENGTH, 8);
134
135static void osdblk_make_credential(u8 cred_a[OSD_CAP_LEN],
136 const struct osd_obj_id *obj)
137{
138 osd_sec_init_nosec_doall_caps(cred_a, obj, false, true);
139}
140
141/* copied from exofs; move to libosd? */
142/*
143 * Perform a synchronous OSD operation. copied from exofs; move to libosd?
144 */
145static int osd_sync_op(struct osd_request *or, int timeout, uint8_t *credential)
146{
147 int ret;
148
149 or->timeout = timeout;
150 ret = osd_finalize_request(or, 0, credential, NULL);
151 if (ret)
152 return ret;
153
154 ret = osd_execute_request(or);
155
156 /* osd_req_decode_sense(or, ret); */
157 return ret;
158}
159
160/*
161 * Perform an asynchronous OSD operation. copied from exofs; move to libosd?
162 */
163static int osd_async_op(struct osd_request *or, osd_req_done_fn *async_done,
164 void *caller_context, u8 *cred)
165{
166 int ret;
167
168 ret = osd_finalize_request(or, 0, cred, NULL);
169 if (ret)
170 return ret;
171
172 ret = osd_execute_request_async(or, async_done, caller_context);
173
174 return ret;
175}
176
177/* copied from exofs; move to libosd? */
178static int extract_attr_from_req(struct osd_request *or, struct osd_attr *attr)
179{
180 struct osd_attr cur_attr = {.attr_page = 0}; /* start with zeros */
181 void *iter = NULL;
182 int nelem;
183
184 do {
185 nelem = 1;
186 osd_req_decode_get_attr_list(or, &cur_attr, &nelem, &iter);
187 if ((cur_attr.attr_page == attr->attr_page) &&
188 (cur_attr.attr_id == attr->attr_id)) {
189 attr->len = cur_attr.len;
190 attr->val_ptr = cur_attr.val_ptr;
191 return 0;
192 }
193 } while (iter);
194
195 return -EIO;
196}
197
198static int osdblk_get_obj_size(struct osdblk_device *osdev, u64 *size_out)
199{
200 struct osd_request *or;
201 struct osd_attr attr;
202 int ret;
203
204 /* start request */
205 or = osd_start_request(osdev->osd, GFP_KERNEL);
206 if (!or)
207 return -ENOMEM;
208
209 /* create a get-attributes(length) request */
210 osd_req_get_attributes(or, &osdev->obj);
211
212 osd_req_add_get_attr_list(or, &g_attr_logical_length, 1);
213
214 /* execute op synchronously */
215 ret = osd_sync_op(or, OSDBLK_OP_TIMEOUT, osdev->obj_cred);
216 if (ret)
217 goto out;
218
219 /* extract length from returned attribute info */
220 attr = g_attr_logical_length;
221 ret = extract_attr_from_req(or, &attr);
222 if (ret)
223 goto out;
224
225 *size_out = get_unaligned_be64(attr.val_ptr);
226
227out:
228 osd_end_request(or);
229 return ret;
230
231}
232
233static void osdblk_osd_complete(struct osd_request *or, void *private)
234{
235 struct osdblk_request *orq = private;
236 struct osd_sense_info osi;
237 int ret = osd_req_decode_sense(or, &osi);
238
239 if (ret) {
240 ret = -EIO;
241 OSDBLK_DEBUG("osdblk_osd_complete with err=%d\n", ret);
242 }
243
244 /* complete OSD request */
245 osd_end_request(or);
246
247 /* complete request passed to osdblk by block layer */
248 __blk_end_request_all(orq->rq, ret);
249}
250
251static void bio_chain_put(struct bio *chain)
252{
253 struct bio *tmp;
254
255 while (chain) {
256 tmp = chain;
257 chain = chain->bi_next;
258
259 bio_put(tmp);
260 }
261}
262
263static struct bio *bio_chain_clone(struct bio *old_chain, gfp_t gfpmask)
264{
265 struct bio *tmp, *new_chain = NULL, *tail = NULL;
266
267 while (old_chain) {
268 tmp = bio_kmalloc(gfpmask, old_chain->bi_max_vecs);
269 if (!tmp)
270 goto err_out;
271
272 __bio_clone(tmp, old_chain);
273 tmp->bi_bdev = NULL;
274 gfpmask &= ~__GFP_WAIT;
275 tmp->bi_next = NULL;
276
277 if (!new_chain)
278 new_chain = tail = tmp;
279 else {
280 tail->bi_next = tmp;
281 tail = tmp;
282 }
283
284 old_chain = old_chain->bi_next;
285 }
286
287 return new_chain;
288
289err_out:
290 OSDBLK_DEBUG("bio_chain_clone with err\n");
291 bio_chain_put(new_chain);
292 return NULL;
293}
294
295static void osdblk_rq_fn(struct request_queue *q)
296{
297 struct osdblk_device *osdev = q->queuedata;
298
299 while (1) {
300 struct request *rq;
301 struct osdblk_request *orq;
302 struct osd_request *or;
303 struct bio *bio;
304 bool do_write, do_flush;
305
306 /* peek at request from block layer */
307 rq = blk_fetch_request(q);
308 if (!rq)
309 break;
310
311 /* filter out block requests we don't understand */
312 if (!blk_fs_request(rq) && !blk_barrier_rq(rq)) {
313 blk_end_request_all(rq, 0);
314 continue;
315 }
316
317 /* deduce our operation (read, write, flush) */
318 /* I wish the block layer simplified cmd_type/cmd_flags/cmd[]
319 * into a clearly defined set of RPC commands:
320 * read, write, flush, scsi command, power mgmt req,
321 * driver-specific, etc.
322 */
323
324 do_flush = (rq->special == (void *) 0xdeadbeefUL);
325 do_write = (rq_data_dir(rq) == WRITE);
326
327 if (!do_flush) { /* osd_flush does not use a bio */
328 /* a bio clone to be passed down to OSD request */
329 bio = bio_chain_clone(rq->bio, GFP_ATOMIC);
330 if (!bio)
331 break;
332 } else
333 bio = NULL;
334
335 /* alloc internal OSD request, for OSD command execution */
336 or = osd_start_request(osdev->osd, GFP_ATOMIC);
337 if (!or) {
338 bio_chain_put(bio);
339 OSDBLK_DEBUG("osd_start_request with err\n");
340 break;
341 }
342
343 orq = &osdev->req[rq->tag];
344 orq->rq = rq;
345 orq->bio = bio;
346 orq->osdev = osdev;
347
348 /* init OSD command: flush, write or read */
349 if (do_flush)
350 osd_req_flush_object(or, &osdev->obj,
351 OSD_CDB_FLUSH_ALL, 0, 0);
352 else if (do_write)
353 osd_req_write(or, &osdev->obj, blk_rq_pos(rq) * 512ULL,
354 bio, blk_rq_bytes(rq));
355 else
356 osd_req_read(or, &osdev->obj, blk_rq_pos(rq) * 512ULL,
357 bio, blk_rq_bytes(rq));
358
359 OSDBLK_DEBUG("%s 0x%x bytes at 0x%llx\n",
360 do_flush ? "flush" : do_write ?
361 "write" : "read", blk_rq_bytes(rq),
362 blk_rq_pos(rq) * 512ULL);
363
364 /* begin OSD command execution */
365 if (osd_async_op(or, osdblk_osd_complete, orq,
366 osdev->obj_cred)) {
367 osd_end_request(or);
368 blk_requeue_request(q, rq);
369 bio_chain_put(bio);
370 OSDBLK_DEBUG("osd_execute_request_async with err\n");
371 break;
372 }
373
374 /* remove the special 'flush' marker, now that the command
375 * is executing
376 */
377 rq->special = NULL;
378 }
379}
380
381static void osdblk_prepare_flush(struct request_queue *q, struct request *rq)
382{
383 /* add driver-specific marker, to indicate that this request
384 * is a flush command
385 */
386 rq->special = (void *) 0xdeadbeefUL;
387}
388
389static void osdblk_free_disk(struct osdblk_device *osdev)
390{
391 struct gendisk *disk = osdev->disk;
392
393 if (!disk)
394 return;
395
396 if (disk->flags & GENHD_FL_UP)
397 del_gendisk(disk);
398 if (disk->queue)
399 blk_cleanup_queue(disk->queue);
400 put_disk(disk);
401}
402
403static int osdblk_init_disk(struct osdblk_device *osdev)
404{
405 struct gendisk *disk;
406 struct request_queue *q;
407 int rc;
408 u64 obj_size = 0;
409
410 /* contact OSD, request size info about the object being mapped */
411 rc = osdblk_get_obj_size(osdev, &obj_size);
412 if (rc)
413 return rc;
414
415 /* create gendisk info */
416 disk = alloc_disk(OSDBLK_MINORS_PER_MAJOR);
417 if (!disk)
418 return -ENOMEM;
419
420 sprintf(disk->disk_name, DRV_NAME "%d", osdev->id);
421 disk->major = osdev->major;
422 disk->first_minor = 0;
423 disk->fops = &osdblk_bd_ops;
424 disk->private_data = osdev;
425
426 /* init rq */
427 q = blk_init_queue(osdblk_rq_fn, &osdev->lock);
428 if (!q) {
429 put_disk(disk);
430 return -ENOMEM;
431 }
432
433 /* switch queue to TCQ mode; allocate tag map */
434 rc = blk_queue_init_tags(q, OSDBLK_MAX_REQ, NULL);
435 if (rc) {
436 blk_cleanup_queue(q);
437 put_disk(disk);
438 return rc;
439 }
440
441 /* Set our limits to the lower device limits, because osdblk cannot
442 * sleep when allocating a lower-request and therefore cannot be
443 * bouncing.
444 */
445 blk_queue_stack_limits(q, osd_request_queue(osdev->osd));
446
447 blk_queue_prep_rq(q, blk_queue_start_tag);
448 blk_queue_ordered(q, QUEUE_ORDERED_DRAIN_FLUSH, osdblk_prepare_flush);
449
450 disk->queue = q;
451
452 q->queuedata = osdev;
453
454 osdev->disk = disk;
455 osdev->q = q;
456
457 /* finally, announce the disk to the world */
458 set_capacity(disk, obj_size / 512ULL);
459 add_disk(disk);
460
461 printk(KERN_INFO "%s: Added of size 0x%llx\n",
462 disk->disk_name, (unsigned long long)obj_size);
463
464 return 0;
465}
466
467/********************************************************************
468 * /sys/class/osdblk/
469 * add map OSD object to blkdev
470 * remove unmap OSD object
471 * list show mappings
472 *******************************************************************/
473
474static void class_osdblk_release(struct class *cls)
475{
476 kfree(cls);
477}
478
479static ssize_t class_osdblk_list(struct class *c, char *data)
480{
481 int n = 0;
482 struct list_head *tmp;
483
484 mutex_lock_nested(&ctl_mutex, SINGLE_DEPTH_NESTING);
485
486 list_for_each(tmp, &osdblkdev_list) {
487 struct osdblk_device *osdev;
488
489 osdev = list_entry(tmp, struct osdblk_device, node);
490
491 n += sprintf(data+n, "%d %d %llu %llu %s\n",
492 osdev->id,
493 osdev->major,
494 osdev->obj.partition,
495 osdev->obj.id,
496 osdev->osd_path);
497 }
498
499 mutex_unlock(&ctl_mutex);
500 return n;
501}
502
503static ssize_t class_osdblk_add(struct class *c, const char *buf, size_t count)
504{
505 struct osdblk_device *osdev;
506 ssize_t rc;
507 int irc, new_id = 0;
508 struct list_head *tmp;
509
510 if (!try_module_get(THIS_MODULE))
511 return -ENODEV;
512
513 /* new osdblk_device object */
514 osdev = kzalloc(sizeof(*osdev) + strlen(buf) + 1, GFP_KERNEL);
515 if (!osdev) {
516 rc = -ENOMEM;
517 goto err_out_mod;
518 }
519
520 /* static osdblk_device initialization */
521 spin_lock_init(&osdev->lock);
522 INIT_LIST_HEAD(&osdev->node);
523
524 /* generate unique id: find highest unique id, add one */
525
526 mutex_lock_nested(&ctl_mutex, SINGLE_DEPTH_NESTING);
527
528 list_for_each(tmp, &osdblkdev_list) {
529 struct osdblk_device *osdev;
530
531 osdev = list_entry(tmp, struct osdblk_device, node);
532 if (osdev->id > new_id)
533 new_id = osdev->id + 1;
534 }
535
536 osdev->id = new_id;
537
538 /* add to global list */
539 list_add_tail(&osdev->node, &osdblkdev_list);
540
541 mutex_unlock(&ctl_mutex);
542
543 /* parse add command */
544 if (sscanf(buf, "%llu %llu %s", &osdev->obj.partition, &osdev->obj.id,
545 osdev->osd_path) != 3) {
546 rc = -EINVAL;
547 goto err_out_slot;
548 }
549
550 /* initialize rest of new object */
551 sprintf(osdev->name, DRV_NAME "%d", osdev->id);
552
553 /* contact requested OSD */
554 osdev->osd = osduld_path_lookup(osdev->osd_path);
555 if (IS_ERR(osdev->osd)) {
556 rc = PTR_ERR(osdev->osd);
557 goto err_out_slot;
558 }
559
560 /* build OSD credential */
561 osdblk_make_credential(osdev->obj_cred, &osdev->obj);
562
563 /* register our block device */
564 irc = register_blkdev(0, osdev->name);
565 if (irc < 0) {
566 rc = irc;
567 goto err_out_osd;
568 }
569
570 osdev->major = irc;
571
572 /* set up and announce blkdev mapping */
573 rc = osdblk_init_disk(osdev);
574 if (rc)
575 goto err_out_blkdev;
576
577 return count;
578
579err_out_blkdev:
580 unregister_blkdev(osdev->major, osdev->name);
581err_out_osd:
582 osduld_put_device(osdev->osd);
583err_out_slot:
584 mutex_lock_nested(&ctl_mutex, SINGLE_DEPTH_NESTING);
585 list_del_init(&osdev->node);
586 mutex_unlock(&ctl_mutex);
587
588 kfree(osdev);
589err_out_mod:
590 OSDBLK_DEBUG("Error adding device %s\n", buf);
591 module_put(THIS_MODULE);
592 return rc;
593}
594
595static ssize_t class_osdblk_remove(struct class *c, const char *buf,
596 size_t count)
597{
598 struct osdblk_device *osdev = NULL;
599 int target_id, rc;
600 unsigned long ul;
601 struct list_head *tmp;
602
603 rc = strict_strtoul(buf, 10, &ul);
604 if (rc)
605 return rc;
606
607 /* convert to int; abort if we lost anything in the conversion */
608 target_id = (int) ul;
609 if (target_id != ul)
610 return -EINVAL;
611
612 /* remove object from list immediately */
613 mutex_lock_nested(&ctl_mutex, SINGLE_DEPTH_NESTING);
614
615 list_for_each(tmp, &osdblkdev_list) {
616 osdev = list_entry(tmp, struct osdblk_device, node);
617 if (osdev->id == target_id) {
618 list_del_init(&osdev->node);
619 break;
620 }
621 osdev = NULL;
622 }
623
624 mutex_unlock(&ctl_mutex);
625
626 if (!osdev)
627 return -ENOENT;
628
629 /* clean up and free blkdev and associated OSD connection */
630 osdblk_free_disk(osdev);
631 unregister_blkdev(osdev->major, osdev->name);
632 osduld_put_device(osdev->osd);
633 kfree(osdev);
634
635 /* release module ref */
636 module_put(THIS_MODULE);
637
638 return count;
639}
640
641static struct class_attribute class_osdblk_attrs[] = {
642 __ATTR(add, 0200, NULL, class_osdblk_add),
643 __ATTR(remove, 0200, NULL, class_osdblk_remove),
644 __ATTR(list, 0444, class_osdblk_list, NULL),
645 __ATTR_NULL
646};
647
648static int osdblk_sysfs_init(void)
649{
650 int ret = 0;
651
652 /*
653 * create control files in sysfs
654 * /sys/class/osdblk/...
655 */
656 class_osdblk = kzalloc(sizeof(*class_osdblk), GFP_KERNEL);
657 if (!class_osdblk)
658 return -ENOMEM;
659
660 class_osdblk->name = DRV_NAME;
661 class_osdblk->owner = THIS_MODULE;
662 class_osdblk->class_release = class_osdblk_release;
663 class_osdblk->class_attrs = class_osdblk_attrs;
664
665 ret = class_register(class_osdblk);
666 if (ret) {
667 kfree(class_osdblk);
668 class_osdblk = NULL;
669 printk(PFX "failed to create class osdblk\n");
670 return ret;
671 }
672
673 return 0;
674}
675
676static void osdblk_sysfs_cleanup(void)
677{
678 if (class_osdblk)
679 class_destroy(class_osdblk);
680 class_osdblk = NULL;
681}
682
683static int __init osdblk_init(void)
684{
685 int rc;
686
687 rc = osdblk_sysfs_init();
688 if (rc)
689 return rc;
690
691 return 0;
692}
693
694static void __exit osdblk_exit(void)
695{
696 osdblk_sysfs_cleanup();
697}
698
699module_init(osdblk_init);
700module_exit(osdblk_exit);
701
diff --git a/drivers/block/pktcdvd.c b/drivers/block/pktcdvd.c
index 83650e00632d..99a506f619b7 100644
--- a/drivers/block/pktcdvd.c
+++ b/drivers/block/pktcdvd.c
@@ -1372,8 +1372,10 @@ try_next_bio:
1372 wakeup = (pd->write_congestion_on > 0 1372 wakeup = (pd->write_congestion_on > 0
1373 && pd->bio_queue_size <= pd->write_congestion_off); 1373 && pd->bio_queue_size <= pd->write_congestion_off);
1374 spin_unlock(&pd->lock); 1374 spin_unlock(&pd->lock);
1375 if (wakeup) 1375 if (wakeup) {
1376 clear_bdi_congested(&pd->disk->queue->backing_dev_info, WRITE); 1376 clear_bdi_congested(&pd->disk->queue->backing_dev_info,
1377 BLK_RW_ASYNC);
1378 }
1377 1379
1378 pkt->sleep_time = max(PACKET_WAIT_TIME, 1); 1380 pkt->sleep_time = max(PACKET_WAIT_TIME, 1);
1379 pkt_set_state(pkt, PACKET_WAITING_STATE); 1381 pkt_set_state(pkt, PACKET_WAITING_STATE);
@@ -2592,10 +2594,10 @@ static int pkt_make_request(struct request_queue *q, struct bio *bio)
2592 spin_lock(&pd->lock); 2594 spin_lock(&pd->lock);
2593 if (pd->write_congestion_on > 0 2595 if (pd->write_congestion_on > 0
2594 && pd->bio_queue_size >= pd->write_congestion_on) { 2596 && pd->bio_queue_size >= pd->write_congestion_on) {
2595 set_bdi_congested(&q->backing_dev_info, WRITE); 2597 set_bdi_congested(&q->backing_dev_info, BLK_RW_ASYNC);
2596 do { 2598 do {
2597 spin_unlock(&pd->lock); 2599 spin_unlock(&pd->lock);
2598 congestion_wait(WRITE, HZ); 2600 congestion_wait(BLK_RW_ASYNC, HZ);
2599 spin_lock(&pd->lock); 2601 spin_lock(&pd->lock);
2600 } while(pd->bio_queue_size > pd->write_congestion_off); 2602 } while(pd->bio_queue_size > pd->write_congestion_off);
2601 } 2603 }
diff --git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c
index 43db3ea15b54..aa1a3d5a3e2b 100644
--- a/drivers/block/virtio_blk.c
+++ b/drivers/block/virtio_blk.c
@@ -213,7 +213,7 @@ static int virtblk_ioctl(struct block_device *bdev, fmode_t mode,
213 * Only allow the generic SCSI ioctls if the host can support it. 213 * Only allow the generic SCSI ioctls if the host can support it.
214 */ 214 */
215 if (!virtio_has_feature(vblk->vdev, VIRTIO_BLK_F_SCSI)) 215 if (!virtio_has_feature(vblk->vdev, VIRTIO_BLK_F_SCSI))
216 return -ENOIOCTLCMD; 216 return -ENOTTY;
217 217
218 return scsi_cmd_ioctl(disk->queue, disk, mode, cmd, argp); 218 return scsi_cmd_ioctl(disk->queue, disk, mode, cmd, argp);
219} 219}
@@ -360,6 +360,9 @@ static int __devinit virtblk_probe(struct virtio_device *vdev)
360 blk_queue_max_phys_segments(vblk->disk->queue, vblk->sg_elems-2); 360 blk_queue_max_phys_segments(vblk->disk->queue, vblk->sg_elems-2);
361 blk_queue_max_hw_segments(vblk->disk->queue, vblk->sg_elems-2); 361 blk_queue_max_hw_segments(vblk->disk->queue, vblk->sg_elems-2);
362 362
363 /* No need to bounce any requests */
364 blk_queue_bounce_limit(vblk->disk->queue, BLK_BOUNCE_ANY);
365
363 /* No real sector limit. */ 366 /* No real sector limit. */
364 blk_queue_max_sectors(vblk->disk->queue, -1U); 367 blk_queue_max_sectors(vblk->disk->queue, -1U);
365 368
@@ -424,7 +427,12 @@ static unsigned int features[] = {
424 VIRTIO_BLK_F_SCSI, VIRTIO_BLK_F_IDENTIFY 427 VIRTIO_BLK_F_SCSI, VIRTIO_BLK_F_IDENTIFY
425}; 428};
426 429
427static struct virtio_driver virtio_blk = { 430/*
431 * virtio_blk causes spurious section mismatch warning by
432 * simultaneously referring to a __devinit and a __devexit function.
433 * Use __refdata to avoid this warning.
434 */
435static struct virtio_driver __refdata virtio_blk = {
428 .feature_table = features, 436 .feature_table = features,
429 .feature_table_size = ARRAY_SIZE(features), 437 .feature_table_size = ARRAY_SIZE(features),
430 .driver.name = KBUILD_MODNAME, 438 .driver.name = KBUILD_MODNAME,
diff --git a/drivers/block/xsysace.c b/drivers/block/xsysace.c
index f08491a3a813..b20abe102a2b 100644
--- a/drivers/block/xsysace.c
+++ b/drivers/block/xsysace.c
@@ -390,9 +390,10 @@ static inline void ace_dump_mem(void *base, int len)
390 390
391static void ace_dump_regs(struct ace_device *ace) 391static void ace_dump_regs(struct ace_device *ace)
392{ 392{
393 dev_info(ace->dev, " ctrl: %.8x seccnt/cmd: %.4x ver:%.4x\n" 393 dev_info(ace->dev,
394 KERN_INFO " status:%.8x mpu_lba:%.8x busmode:%4x\n" 394 " ctrl: %.8x seccnt/cmd: %.4x ver:%.4x\n"
395 KERN_INFO " error: %.8x cfg_lba:%.8x fatstat:%.4x\n", 395 " status:%.8x mpu_lba:%.8x busmode:%4x\n"
396 " error: %.8x cfg_lba:%.8x fatstat:%.4x\n",
396 ace_in32(ace, ACE_CTRL), 397 ace_in32(ace, ACE_CTRL),
397 ace_in(ace, ACE_SECCNTCMD), 398 ace_in(ace, ACE_SECCNTCMD),
398 ace_in(ace, ACE_VERSION), 399 ace_in(ace, ACE_VERSION),
diff --git a/drivers/block/z2ram.c b/drivers/block/z2ram.c
index 4575171e5beb..b2590409f25e 100644
--- a/drivers/block/z2ram.c
+++ b/drivers/block/z2ram.c
@@ -374,7 +374,7 @@ err:
374static void __exit z2_exit(void) 374static void __exit z2_exit(void)
375{ 375{
376 int i, j; 376 int i, j;
377 blk_unregister_region(MKDEV(Z2RAM_MAJOR, 0), 256); 377 blk_unregister_region(MKDEV(Z2RAM_MAJOR, 0), Z2MINOR_COUNT);
378 unregister_blkdev(Z2RAM_MAJOR, DEVICE_NAME); 378 unregister_blkdev(Z2RAM_MAJOR, DEVICE_NAME);
379 del_gendisk(z2ram_gendisk); 379 del_gendisk(z2ram_gendisk);
380 put_disk(z2ram_gendisk); 380 put_disk(z2ram_gendisk);
diff --git a/drivers/bluetooth/hci_vhci.c b/drivers/bluetooth/hci_vhci.c
index 1df9dda2e377..d5cde6d86f89 100644
--- a/drivers/bluetooth/hci_vhci.c
+++ b/drivers/bluetooth/hci_vhci.c
@@ -28,7 +28,6 @@
28#include <linux/kernel.h> 28#include <linux/kernel.h>
29#include <linux/init.h> 29#include <linux/init.h>
30#include <linux/slab.h> 30#include <linux/slab.h>
31#include <linux/smp_lock.h>
32#include <linux/types.h> 31#include <linux/types.h>
33#include <linux/errno.h> 32#include <linux/errno.h>
34#include <linux/sched.h> 33#include <linux/sched.h>
diff --git a/drivers/char/Kconfig b/drivers/char/Kconfig
index 0bd01f49cfd8..6a06913b01d3 100644
--- a/drivers/char/Kconfig
+++ b/drivers/char/Kconfig
@@ -1029,10 +1029,6 @@ config CS5535_GPIO
1029 1029
1030 If compiled as a module, it will be called cs5535_gpio. 1030 If compiled as a module, it will be called cs5535_gpio.
1031 1031
1032config GPIO_VR41XX
1033 tristate "NEC VR4100 series General-purpose I/O Unit support"
1034 depends on CPU_VR41XX
1035
1036config RAW_DRIVER 1032config RAW_DRIVER
1037 tristate "RAW driver (/dev/raw/rawN)" 1033 tristate "RAW driver (/dev/raw/rawN)"
1038 depends on BLOCK 1034 depends on BLOCK
diff --git a/drivers/char/Makefile b/drivers/char/Makefile
index 189efcff08ce..66f779ad4f4c 100644
--- a/drivers/char/Makefile
+++ b/drivers/char/Makefile
@@ -95,7 +95,6 @@ obj-$(CONFIG_SCx200_GPIO) += scx200_gpio.o
95obj-$(CONFIG_PC8736x_GPIO) += pc8736x_gpio.o 95obj-$(CONFIG_PC8736x_GPIO) += pc8736x_gpio.o
96obj-$(CONFIG_NSC_GPIO) += nsc_gpio.o 96obj-$(CONFIG_NSC_GPIO) += nsc_gpio.o
97obj-$(CONFIG_CS5535_GPIO) += cs5535_gpio.o 97obj-$(CONFIG_CS5535_GPIO) += cs5535_gpio.o
98obj-$(CONFIG_GPIO_VR41XX) += vr41xx_giu.o
99obj-$(CONFIG_GPIO_TB0219) += tb0219.o 98obj-$(CONFIG_GPIO_TB0219) += tb0219.o
100obj-$(CONFIG_TELCLOCK) += tlclk.o 99obj-$(CONFIG_TELCLOCK) += tlclk.o
101 100
diff --git a/drivers/char/agp/parisc-agp.c b/drivers/char/agp/parisc-agp.c
index f4bb43fb8016..e077701ae3d9 100644
--- a/drivers/char/agp/parisc-agp.c
+++ b/drivers/char/agp/parisc-agp.c
@@ -225,7 +225,7 @@ static const struct agp_bridge_driver parisc_agp_driver = {
225 .configure = parisc_agp_configure, 225 .configure = parisc_agp_configure,
226 .fetch_size = parisc_agp_fetch_size, 226 .fetch_size = parisc_agp_fetch_size,
227 .tlb_flush = parisc_agp_tlbflush, 227 .tlb_flush = parisc_agp_tlbflush,
228 .mask_memory = parisc_agp_mask_memory, 228 .mask_memory = parisc_agp_page_mask_memory,
229 .masks = parisc_agp_masks, 229 .masks = parisc_agp_masks,
230 .agp_enable = parisc_agp_enable, 230 .agp_enable = parisc_agp_enable,
231 .cache_flush = global_cache_flush, 231 .cache_flush = global_cache_flush,
diff --git a/drivers/char/amiserial.c b/drivers/char/amiserial.c
index 72429b6b2fa8..6c32fbf07164 100644
--- a/drivers/char/amiserial.c
+++ b/drivers/char/amiserial.c
@@ -81,6 +81,7 @@ static char *serial_version = "4.30";
81#include <linux/mm.h> 81#include <linux/mm.h>
82#include <linux/seq_file.h> 82#include <linux/seq_file.h>
83#include <linux/slab.h> 83#include <linux/slab.h>
84#include <linux/smp_lock.h>
84#include <linux/init.h> 85#include <linux/init.h>
85#include <linux/bitops.h> 86#include <linux/bitops.h>
86 87
diff --git a/drivers/char/bsr.c b/drivers/char/bsr.c
index 140ea10ecb88..c02db01f736e 100644
--- a/drivers/char/bsr.c
+++ b/drivers/char/bsr.c
@@ -27,6 +27,7 @@
27#include <linux/cdev.h> 27#include <linux/cdev.h>
28#include <linux/list.h> 28#include <linux/list.h>
29#include <linux/mm.h> 29#include <linux/mm.h>
30#include <asm/pgtable.h>
30#include <asm/io.h> 31#include <asm/io.h>
31 32
32/* 33/*
@@ -75,12 +76,13 @@ static struct class *bsr_class;
75static int bsr_major; 76static int bsr_major;
76 77
77enum { 78enum {
78 BSR_8 = 0, 79 BSR_8 = 0,
79 BSR_16 = 1, 80 BSR_16 = 1,
80 BSR_64 = 2, 81 BSR_64 = 2,
81 BSR_128 = 3, 82 BSR_128 = 3,
82 BSR_UNKNOWN = 4, 83 BSR_4096 = 4,
83 BSR_MAX = 5, 84 BSR_UNKNOWN = 5,
85 BSR_MAX = 6,
84}; 86};
85 87
86static unsigned bsr_types[BSR_MAX]; 88static unsigned bsr_types[BSR_MAX];
@@ -117,15 +119,22 @@ static int bsr_mmap(struct file *filp, struct vm_area_struct *vma)
117{ 119{
118 unsigned long size = vma->vm_end - vma->vm_start; 120 unsigned long size = vma->vm_end - vma->vm_start;
119 struct bsr_dev *dev = filp->private_data; 121 struct bsr_dev *dev = filp->private_data;
122 int ret;
120 123
121 if (size > dev->bsr_len || (size & (PAGE_SIZE-1)))
122 return -EINVAL;
123
124 vma->vm_flags |= (VM_IO | VM_DONTEXPAND);
125 vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot); 124 vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);
126 125
127 if (io_remap_pfn_range(vma, vma->vm_start, dev->bsr_addr >> PAGE_SHIFT, 126 /* check for the case of a small BSR device and map one 4k page for it*/
128 size, vma->vm_page_prot)) 127 if (dev->bsr_len < PAGE_SIZE && size == PAGE_SIZE)
128 ret = remap_4k_pfn(vma, vma->vm_start, dev->bsr_addr >> 12,
129 vma->vm_page_prot);
130 else if (size <= dev->bsr_len)
131 ret = io_remap_pfn_range(vma, vma->vm_start,
132 dev->bsr_addr >> PAGE_SHIFT,
133 size, vma->vm_page_prot);
134 else
135 return -EINVAL;
136
137 if (ret)
129 return -EAGAIN; 138 return -EAGAIN;
130 139
131 return 0; 140 return 0;
@@ -205,6 +214,11 @@ static int bsr_add_node(struct device_node *bn)
205 cur->bsr_stride = bsr_stride[i]; 214 cur->bsr_stride = bsr_stride[i];
206 cur->bsr_dev = MKDEV(bsr_major, i + total_bsr_devs); 215 cur->bsr_dev = MKDEV(bsr_major, i + total_bsr_devs);
207 216
217 /* if we have a bsr_len of > 4k and less then PAGE_SIZE (64k pages) */
218 /* we can only map 4k of it, so only advertise the 4k in sysfs */
219 if (cur->bsr_len > 4096 && cur->bsr_len < PAGE_SIZE)
220 cur->bsr_len = 4096;
221
208 switch(cur->bsr_bytes) { 222 switch(cur->bsr_bytes) {
209 case 8: 223 case 8:
210 cur->bsr_type = BSR_8; 224 cur->bsr_type = BSR_8;
@@ -218,9 +232,11 @@ static int bsr_add_node(struct device_node *bn)
218 case 128: 232 case 128:
219 cur->bsr_type = BSR_128; 233 cur->bsr_type = BSR_128;
220 break; 234 break;
235 case 4096:
236 cur->bsr_type = BSR_4096;
237 break;
221 default: 238 default:
222 cur->bsr_type = BSR_UNKNOWN; 239 cur->bsr_type = BSR_UNKNOWN;
223 printk(KERN_INFO "unknown BSR size %d\n",cur->bsr_bytes);
224 } 240 }
225 241
226 cur->bsr_num = bsr_types[cur->bsr_type]; 242 cur->bsr_num = bsr_types[cur->bsr_type];
diff --git a/drivers/char/cyclades.c b/drivers/char/cyclades.c
index f3366d3f06cf..2dafc2da0648 100644
--- a/drivers/char/cyclades.c
+++ b/drivers/char/cyclades.c
@@ -633,6 +633,7 @@
633#include <linux/tty.h> 633#include <linux/tty.h>
634#include <linux/tty_flip.h> 634#include <linux/tty_flip.h>
635#include <linux/serial.h> 635#include <linux/serial.h>
636#include <linux/smp_lock.h>
636#include <linux/major.h> 637#include <linux/major.h>
637#include <linux/string.h> 638#include <linux/string.h>
638#include <linux/fcntl.h> 639#include <linux/fcntl.h>
diff --git a/drivers/char/epca.c b/drivers/char/epca.c
index abef1f7d84fe..ff647ca1c489 100644
--- a/drivers/char/epca.c
+++ b/drivers/char/epca.c
@@ -36,6 +36,7 @@
36#include <linux/tty.h> 36#include <linux/tty.h>
37#include <linux/tty_flip.h> 37#include <linux/tty_flip.h>
38#include <linux/slab.h> 38#include <linux/slab.h>
39#include <linux/smp_lock.h>
39#include <linux/ioport.h> 40#include <linux/ioport.h>
40#include <linux/interrupt.h> 41#include <linux/interrupt.h>
41#include <linux/uaccess.h> 42#include <linux/uaccess.h>
diff --git a/drivers/char/hvc_console.c b/drivers/char/hvc_console.c
index 94e7e3c8c05a..d97779ef72cb 100644
--- a/drivers/char/hvc_console.c
+++ b/drivers/char/hvc_console.c
@@ -552,7 +552,7 @@ static int hvc_chars_in_buffer(struct tty_struct *tty)
552 struct hvc_struct *hp = tty->driver_data; 552 struct hvc_struct *hp = tty->driver_data;
553 553
554 if (!hp) 554 if (!hp)
555 return -1; 555 return 0;
556 return hp->n_outbuf; 556 return hp->n_outbuf;
557} 557}
558 558
diff --git a/drivers/char/hw_random/intel-rng.c b/drivers/char/hw_random/intel-rng.c
index 5dcbe603eca2..91b53eb1c053 100644
--- a/drivers/char/hw_random/intel-rng.c
+++ b/drivers/char/hw_random/intel-rng.c
@@ -305,10 +305,11 @@ static int __init intel_init_hw_struct(struct intel_rng_hw *intel_rng_hw,
305 (BIOS_CNTL_LOCK_ENABLE_MASK|BIOS_CNTL_WRITE_ENABLE_MASK)) 305 (BIOS_CNTL_LOCK_ENABLE_MASK|BIOS_CNTL_WRITE_ENABLE_MASK))
306 == BIOS_CNTL_LOCK_ENABLE_MASK) { 306 == BIOS_CNTL_LOCK_ENABLE_MASK) {
307 static __initdata /*const*/ char warning[] = 307 static __initdata /*const*/ char warning[] =
308 KERN_WARNING PFX "Firmware space is locked read-only. If you can't or\n" 308 KERN_WARNING
309 KERN_WARNING PFX "don't want to disable this in firmware setup, and if\n" 309PFX "Firmware space is locked read-only. If you can't or\n"
310 KERN_WARNING PFX "you are certain that your system has a functional\n" 310PFX "don't want to disable this in firmware setup, and if\n"
311 KERN_WARNING PFX "RNG, try using the 'no_fwh_detect' option.\n"; 311PFX "you are certain that your system has a functional\n"
312PFX "RNG, try using the 'no_fwh_detect' option.\n";
312 313
313 if (no_fwh_detect) 314 if (no_fwh_detect)
314 return -ENODEV; 315 return -ENODEV;
diff --git a/drivers/char/isicom.c b/drivers/char/isicom.c
index 4159292e35cf..4f1f4cd670da 100644
--- a/drivers/char/isicom.c
+++ b/drivers/char/isicom.c
@@ -122,6 +122,7 @@
122#include <linux/fs.h> 122#include <linux/fs.h>
123#include <linux/sched.h> 123#include <linux/sched.h>
124#include <linux/serial.h> 124#include <linux/serial.h>
125#include <linux/smp_lock.h>
125#include <linux/mm.h> 126#include <linux/mm.h>
126#include <linux/interrupt.h> 127#include <linux/interrupt.h>
127#include <linux/timer.h> 128#include <linux/timer.h>
@@ -1478,10 +1479,10 @@ static int __devinit load_firmware(struct pci_dev *pdev,
1478 status = inw(base + 0x4); 1479 status = inw(base + 0x4);
1479 if (status != 0) { 1480 if (status != 0) {
1480 dev_warn(&pdev->dev, "Card%d rejected load header:\n" 1481 dev_warn(&pdev->dev, "Card%d rejected load header:\n"
1481 KERN_WARNING "Address:0x%x\n" 1482 "Address:0x%x\n"
1482 KERN_WARNING "Count:0x%x\n" 1483 "Count:0x%x\n"
1483 KERN_WARNING "Status:0x%x\n", 1484 "Status:0x%x\n",
1484 index + 1, frame->addr, frame->count, status); 1485 index + 1, frame->addr, frame->count, status);
1485 goto errrelfw; 1486 goto errrelfw;
1486 } 1487 }
1487 outsw(base, frame->data, word_count); 1488 outsw(base, frame->data, word_count);
@@ -1526,10 +1527,10 @@ static int __devinit load_firmware(struct pci_dev *pdev,
1526 status = inw(base + 0x4); 1527 status = inw(base + 0x4);
1527 if (status != 0) { 1528 if (status != 0) {
1528 dev_warn(&pdev->dev, "Card%d rejected verify header:\n" 1529 dev_warn(&pdev->dev, "Card%d rejected verify header:\n"
1529 KERN_WARNING "Address:0x%x\n" 1530 "Address:0x%x\n"
1530 KERN_WARNING "Count:0x%x\n" 1531 "Count:0x%x\n"
1531 KERN_WARNING "Status: 0x%x\n", 1532 "Status: 0x%x\n",
1532 index + 1, frame->addr, frame->count, status); 1533 index + 1, frame->addr, frame->count, status);
1533 goto errrelfw; 1534 goto errrelfw;
1534 } 1535 }
1535 1536
diff --git a/drivers/char/istallion.c b/drivers/char/istallion.c
index 0c999f5bb3db..ab2f3349c5c4 100644
--- a/drivers/char/istallion.c
+++ b/drivers/char/istallion.c
@@ -20,6 +20,7 @@
20 20
21#include <linux/module.h> 21#include <linux/module.h>
22#include <linux/slab.h> 22#include <linux/slab.h>
23#include <linux/smp_lock.h>
23#include <linux/interrupt.h> 24#include <linux/interrupt.h>
24#include <linux/tty.h> 25#include <linux/tty.h>
25#include <linux/tty_flip.h> 26#include <linux/tty_flip.h>
diff --git a/drivers/char/moxa.c b/drivers/char/moxa.c
index 65b6ff2442c6..dd0083bbb64a 100644
--- a/drivers/char/moxa.c
+++ b/drivers/char/moxa.c
@@ -34,6 +34,7 @@
34#include <linux/tty.h> 34#include <linux/tty.h>
35#include <linux/tty_flip.h> 35#include <linux/tty_flip.h>
36#include <linux/major.h> 36#include <linux/major.h>
37#include <linux/smp_lock.h>
37#include <linux/string.h> 38#include <linux/string.h>
38#include <linux/fcntl.h> 39#include <linux/fcntl.h>
39#include <linux/ptrace.h> 40#include <linux/ptrace.h>
diff --git a/drivers/char/mxser.c b/drivers/char/mxser.c
index 52d953eb30c3..dbf8d52f31d0 100644
--- a/drivers/char/mxser.c
+++ b/drivers/char/mxser.c
@@ -23,6 +23,7 @@
23#include <linux/errno.h> 23#include <linux/errno.h>
24#include <linux/signal.h> 24#include <linux/signal.h>
25#include <linux/sched.h> 25#include <linux/sched.h>
26#include <linux/smp_lock.h>
26#include <linux/timer.h> 27#include <linux/timer.h>
27#include <linux/interrupt.h> 28#include <linux/interrupt.h>
28#include <linux/tty.h> 29#include <linux/tty.h>
diff --git a/drivers/char/n_hdlc.c b/drivers/char/n_hdlc.c
index 1c43c8cdee25..c68118efad84 100644
--- a/drivers/char/n_hdlc.c
+++ b/drivers/char/n_hdlc.c
@@ -97,6 +97,7 @@
97#include <linux/slab.h> 97#include <linux/slab.h>
98#include <linux/tty.h> 98#include <linux/tty.h>
99#include <linux/errno.h> 99#include <linux/errno.h>
100#include <linux/smp_lock.h>
100#include <linux/string.h> /* used in new tty drivers */ 101#include <linux/string.h> /* used in new tty drivers */
101#include <linux/signal.h> /* used in new tty drivers */ 102#include <linux/signal.h> /* used in new tty drivers */
102#include <linux/if.h> 103#include <linux/if.h>
diff --git a/drivers/char/n_r3964.c b/drivers/char/n_r3964.c
index 2e99158ebb8a..6934025a1ac1 100644
--- a/drivers/char/n_r3964.c
+++ b/drivers/char/n_r3964.c
@@ -58,6 +58,7 @@
58#include <linux/ioport.h> 58#include <linux/ioport.h>
59#include <linux/in.h> 59#include <linux/in.h>
60#include <linux/slab.h> 60#include <linux/slab.h>
61#include <linux/smp_lock.h>
61#include <linux/tty.h> 62#include <linux/tty.h>
62#include <linux/errno.h> 63#include <linux/errno.h>
63#include <linux/string.h> /* used in new tty drivers */ 64#include <linux/string.h> /* used in new tty drivers */
diff --git a/drivers/char/n_tty.c b/drivers/char/n_tty.c
index 94a5d5020abc..973be2f44195 100644
--- a/drivers/char/n_tty.c
+++ b/drivers/char/n_tty.c
@@ -1331,9 +1331,6 @@ handle_newline:
1331 1331
1332static void n_tty_write_wakeup(struct tty_struct *tty) 1332static void n_tty_write_wakeup(struct tty_struct *tty)
1333{ 1333{
1334 /* Write out any echoed characters that are still pending */
1335 process_echoes(tty);
1336
1337 if (tty->fasync && test_and_clear_bit(TTY_DO_WRITE_WAKEUP, &tty->flags)) 1334 if (tty->fasync && test_and_clear_bit(TTY_DO_WRITE_WAKEUP, &tty->flags))
1338 kill_fasync(&tty->fasync, SIGIO, POLL_OUT); 1335 kill_fasync(&tty->fasync, SIGIO, POLL_OUT);
1339} 1336}
@@ -1586,6 +1583,7 @@ static int n_tty_open(struct tty_struct *tty)
1586 1583
1587static inline int input_available_p(struct tty_struct *tty, int amt) 1584static inline int input_available_p(struct tty_struct *tty, int amt)
1588{ 1585{
1586 tty_flush_to_ldisc(tty);
1589 if (tty->icanon) { 1587 if (tty->icanon) {
1590 if (tty->canon_data) 1588 if (tty->canon_data)
1591 return 1; 1589 return 1;
diff --git a/drivers/char/nozomi.c b/drivers/char/nozomi.c
index 574f1c79b6e6..ec58d8c387ff 100644
--- a/drivers/char/nozomi.c
+++ b/drivers/char/nozomi.c
@@ -828,7 +828,7 @@ static int receive_data(enum port_type index, struct nozomi *dc)
828 struct port *port = &dc->port[index]; 828 struct port *port = &dc->port[index];
829 void __iomem *addr = port->dl_addr[port->toggle_dl]; 829 void __iomem *addr = port->dl_addr[port->toggle_dl];
830 struct tty_struct *tty = tty_port_tty_get(&port->port); 830 struct tty_struct *tty = tty_port_tty_get(&port->port);
831 int i; 831 int i, ret;
832 832
833 if (unlikely(!tty)) { 833 if (unlikely(!tty)) {
834 DBG1("tty not open for port: %d?", index); 834 DBG1("tty not open for port: %d?", index);
@@ -844,12 +844,14 @@ static int receive_data(enum port_type index, struct nozomi *dc)
844 844
845 /* disable interrupt in downlink... */ 845 /* disable interrupt in downlink... */
846 disable_transmit_dl(index, dc); 846 disable_transmit_dl(index, dc);
847 return 0; 847 ret = 0;
848 goto put;
848 } 849 }
849 850
850 if (unlikely(size == 0)) { 851 if (unlikely(size == 0)) {
851 dev_err(&dc->pdev->dev, "size == 0?\n"); 852 dev_err(&dc->pdev->dev, "size == 0?\n");
852 return 1; 853 ret = 1;
854 goto put;
853 } 855 }
854 856
855 tty_buffer_request_room(tty, size); 857 tty_buffer_request_room(tty, size);
@@ -871,8 +873,10 @@ static int receive_data(enum port_type index, struct nozomi *dc)
871 } 873 }
872 874
873 set_bit(index, &dc->flip); 875 set_bit(index, &dc->flip);
876 ret = 1;
877put:
874 tty_kref_put(tty); 878 tty_kref_put(tty);
875 return 1; 879 return ret;
876} 880}
877 881
878/* Debug for interrupts */ 882/* Debug for interrupts */
@@ -1862,16 +1866,14 @@ static s32 ntty_chars_in_buffer(struct tty_struct *tty)
1862{ 1866{
1863 struct port *port = tty->driver_data; 1867 struct port *port = tty->driver_data;
1864 struct nozomi *dc = get_dc_by_tty(tty); 1868 struct nozomi *dc = get_dc_by_tty(tty);
1865 s32 rval; 1869 s32 rval = 0;
1866 1870
1867 if (unlikely(!dc || !port)) { 1871 if (unlikely(!dc || !port)) {
1868 rval = -ENODEV;
1869 goto exit_in_buffer; 1872 goto exit_in_buffer;
1870 } 1873 }
1871 1874
1872 if (unlikely(!port->port.count)) { 1875 if (unlikely(!port->port.count)) {
1873 dev_err(&dc->pdev->dev, "No tty open?\n"); 1876 dev_err(&dc->pdev->dev, "No tty open?\n");
1874 rval = -ENODEV;
1875 goto exit_in_buffer; 1877 goto exit_in_buffer;
1876 } 1878 }
1877 1879
diff --git a/drivers/char/pcmcia/ipwireless/tty.c b/drivers/char/pcmcia/ipwireless/tty.c
index 569f2f7743a7..674b3ab3587d 100644
--- a/drivers/char/pcmcia/ipwireless/tty.c
+++ b/drivers/char/pcmcia/ipwireless/tty.c
@@ -320,10 +320,10 @@ static int ipw_chars_in_buffer(struct tty_struct *linux_tty)
320 struct ipw_tty *tty = linux_tty->driver_data; 320 struct ipw_tty *tty = linux_tty->driver_data;
321 321
322 if (!tty) 322 if (!tty)
323 return -ENODEV; 323 return 0;
324 324
325 if (!tty->open_count) 325 if (!tty->open_count)
326 return -EINVAL; 326 return 0;
327 327
328 return tty->tx_bytes_queued; 328 return tty->tx_bytes_queued;
329} 329}
diff --git a/drivers/char/pty.c b/drivers/char/pty.c
index daebe1ba43d4..6e6942c45f5b 100644
--- a/drivers/char/pty.c
+++ b/drivers/char/pty.c
@@ -22,6 +22,7 @@
22#include <linux/major.h> 22#include <linux/major.h>
23#include <linux/mm.h> 23#include <linux/mm.h>
24#include <linux/init.h> 24#include <linux/init.h>
25#include <linux/smp_lock.h>
25#include <linux/sysctl.h> 26#include <linux/sysctl.h>
26#include <linux/device.h> 27#include <linux/device.h>
27#include <linux/uaccess.h> 28#include <linux/uaccess.h>
@@ -75,114 +76,88 @@ static void pty_close(struct tty_struct *tty, struct file *filp)
75 */ 76 */
76static void pty_unthrottle(struct tty_struct *tty) 77static void pty_unthrottle(struct tty_struct *tty)
77{ 78{
78 struct tty_struct *o_tty = tty->link; 79 tty_wakeup(tty->link);
79
80 if (!o_tty)
81 return;
82
83 tty_wakeup(o_tty);
84 set_bit(TTY_THROTTLED, &tty->flags); 80 set_bit(TTY_THROTTLED, &tty->flags);
85} 81}
86 82
87/* 83/**
88 * WSH 05/24/97: modified to 84 * pty_space - report space left for writing
89 * (1) use space in tty->flip instead of a shared temp buffer 85 * @to: tty we are writing into
90 * The flip buffers aren't being used for a pty, so there's lots
91 * of space available. The buffer is protected by a per-pty
92 * semaphore that should almost never come under contention.
93 * (2) avoid redundant copying for cases where count >> receive_room
94 * N.B. Calls from user space may now return an error code instead of
95 * a count.
96 * 86 *
97 * FIXME: Our pty_write method is called with our ldisc lock held but 87 * The tty buffers allow 64K but we sneak a peak and clip at 8K this
98 * not our partners. We can't just wait on the other one blindly without 88 * allows a lot of overspill room for echo and other fun messes to
99 * risking deadlocks. At some point when everything has settled down we need 89 * be handled properly
100 * to look into making pty_write at least able to sleep over an ldisc change. 90 */
91
92static int pty_space(struct tty_struct *to)
93{
94 int n = 8192 - to->buf.memory_used;
95 if (n < 0)
96 return 0;
97 return n;
98}
99
100/**
101 * pty_write - write to a pty
102 * @tty: the tty we write from
103 * @buf: kernel buffer of data
104 * @count: bytes to write
101 * 105 *
102 * The return on no ldisc is a bit counter intuitive but the logic works 106 * Our "hardware" write method. Data is coming from the ldisc which
103 * like this. During an ldisc change the other end will flush its buffers. We 107 * may be in a non sleeping state. We simply throw this at the other
104 * thus return the full length which is identical to the case where we had 108 * end of the link as if we were an IRQ handler receiving stuff for
105 * proper locking and happened to queue the bytes just before the flush during 109 * the other side of the pty/tty pair.
106 * the ldisc change.
107 */ 110 */
111
108static int pty_write(struct tty_struct *tty, const unsigned char *buf, 112static int pty_write(struct tty_struct *tty, const unsigned char *buf,
109 int count) 113 int count)
110{ 114{
111 struct tty_struct *to = tty->link; 115 struct tty_struct *to = tty->link;
112 struct tty_ldisc *ld; 116 int c;
113 int c = count;
114 117
115 if (!to || tty->stopped) 118 if (tty->stopped)
116 return 0; 119 return 0;
117 ld = tty_ldisc_ref(to); 120
118 121 /* This isn't locked but our 8K is quite sloppy so no
119 if (ld) { 122 big deal */
120 c = to->receive_room; 123
121 if (c > count) 124 c = pty_space(to);
122 c = count; 125 if (c > count)
123 ld->ops->receive_buf(to, buf, NULL, c); 126 c = count;
124 tty_ldisc_deref(ld); 127 if (c > 0) {
128 /* Stuff the data into the input queue of the other end */
129 c = tty_insert_flip_string(to, buf, c);
130 /* And shovel */
131 tty_flip_buffer_push(to);
132 tty_wakeup(tty);
125 } 133 }
126 return c; 134 return c;
127} 135}
128 136
137/**
138 * pty_write_room - write space
139 * @tty: tty we are writing from
140 *
141 * Report how many bytes the ldisc can send into the queue for
142 * the other device.
143 */
144
129static int pty_write_room(struct tty_struct *tty) 145static int pty_write_room(struct tty_struct *tty)
130{ 146{
131 struct tty_struct *to = tty->link; 147 return pty_space(tty->link);
132
133 if (!to || tty->stopped)
134 return 0;
135
136 return to->receive_room;
137} 148}
138 149
139/* 150/**
140 * WSH 05/24/97: Modified for asymmetric MASTER/SLAVE behavior 151 * pty_chars_in_buffer - characters currently in our tx queue
141 * The chars_in_buffer() value is used by the ldisc select() function 152 * @tty: our tty
142 * to hold off writing when chars_in_buffer > WAKEUP_CHARS (== 256).
143 * The pty driver chars_in_buffer() Master/Slave must behave differently:
144 *
145 * The Master side needs to allow typed-ahead commands to accumulate
146 * while being canonicalized, so we report "our buffer" as empty until
147 * some threshold is reached, and then report the count. (Any count >
148 * WAKEUP_CHARS is regarded by select() as "full".) To avoid deadlock
149 * the count returned must be 0 if no canonical data is available to be
150 * read. (The N_TTY ldisc.chars_in_buffer now knows this.)
151 * 153 *
152 * The Slave side passes all characters in raw mode to the Master side's 154 * Report how much we have in the transmit queue. As everything is
153 * buffer where they can be read immediately, so in this case we can 155 * instantly at the other end this is easy to implement.
154 * return the true count in the buffer.
155 */ 156 */
157
156static int pty_chars_in_buffer(struct tty_struct *tty) 158static int pty_chars_in_buffer(struct tty_struct *tty)
157{ 159{
158 struct tty_struct *to = tty->link; 160 return 0;
159 struct tty_ldisc *ld;
160 int count = 0;
161
162 /* We should get the line discipline lock for "tty->link" */
163 if (!to)
164 return 0;
165 /* We cannot take a sleeping reference here without deadlocking with
166 an ldisc change - but it doesn't really matter */
167 ld = tty_ldisc_ref(to);
168 if (ld == NULL)
169 return 0;
170
171 /* The ldisc must report 0 if no characters available to be read */
172 if (ld->ops->chars_in_buffer)
173 count = ld->ops->chars_in_buffer(to);
174
175 tty_ldisc_deref(ld);
176
177 if (tty->driver->subtype == PTY_TYPE_SLAVE)
178 return count;
179
180 /* Master side driver ... if the other side's read buffer is less than
181 * half full, return 0 to allow writers to proceed; otherwise return
182 * the count. This leaves a comfortable margin to avoid overflow,
183 * and still allows half a buffer's worth of typed-ahead commands.
184 */
185 return (count < N_TTY_BUF_SIZE/2) ? 0 : count;
186} 161}
187 162
188/* Set the lock flag on a pty */ 163/* Set the lock flag on a pty */
@@ -202,20 +177,10 @@ static void pty_flush_buffer(struct tty_struct *tty)
202{ 177{
203 struct tty_struct *to = tty->link; 178 struct tty_struct *to = tty->link;
204 unsigned long flags; 179 unsigned long flags;
205 struct tty_ldisc *ld;
206 180
207 if (!to) 181 if (!to)
208 return; 182 return;
209 ld = tty_ldisc_ref(to); 183 /* tty_buffer_flush(to); FIXME */
210
211 /* The other end is changing discipline */
212 if (!ld)
213 return;
214
215 if (ld->ops->flush_buffer)
216 to->ldisc->ops->flush_buffer(to);
217 tty_ldisc_deref(ld);
218
219 if (to->packet) { 184 if (to->packet) {
220 spin_lock_irqsave(&tty->ctrl_lock, flags); 185 spin_lock_irqsave(&tty->ctrl_lock, flags);
221 tty->ctrl_status |= TIOCPKT_FLUSHWRITE; 186 tty->ctrl_status |= TIOCPKT_FLUSHWRITE;
diff --git a/drivers/char/rio/rio_linux.c b/drivers/char/rio/rio_linux.c
index ce81da5b2da9..d58c2eb07f07 100644
--- a/drivers/char/rio/rio_linux.c
+++ b/drivers/char/rio/rio_linux.c
@@ -44,6 +44,7 @@
44#include <linux/delay.h> 44#include <linux/delay.h>
45#include <linux/pci.h> 45#include <linux/pci.h>
46#include <linux/slab.h> 46#include <linux/slab.h>
47#include <linux/smp_lock.h>
47#include <linux/miscdevice.h> 48#include <linux/miscdevice.h>
48#include <linux/init.h> 49#include <linux/init.h>
49 50
diff --git a/drivers/char/riscom8.c b/drivers/char/riscom8.c
index 217660451237..171711acf5cd 100644
--- a/drivers/char/riscom8.c
+++ b/drivers/char/riscom8.c
@@ -47,6 +47,7 @@
47#include <linux/init.h> 47#include <linux/init.h>
48#include <linux/delay.h> 48#include <linux/delay.h>
49#include <linux/tty_flip.h> 49#include <linux/tty_flip.h>
50#include <linux/smp_lock.h>
50#include <linux/spinlock.h> 51#include <linux/spinlock.h>
51#include <linux/device.h> 52#include <linux/device.h>
52 53
diff --git a/drivers/char/rocket.c b/drivers/char/rocket.c
index 63d5b628477a..0e29a23ec4c5 100644
--- a/drivers/char/rocket.c
+++ b/drivers/char/rocket.c
@@ -73,6 +73,7 @@
73#include <linux/tty_driver.h> 73#include <linux/tty_driver.h>
74#include <linux/tty_flip.h> 74#include <linux/tty_flip.h>
75#include <linux/serial.h> 75#include <linux/serial.h>
76#include <linux/smp_lock.h>
76#include <linux/string.h> 77#include <linux/string.h>
77#include <linux/fcntl.h> 78#include <linux/fcntl.h>
78#include <linux/ptrace.h> 79#include <linux/ptrace.h>
diff --git a/drivers/char/serial167.c b/drivers/char/serial167.c
index f1f24f0ee26f..51e7a46787be 100644
--- a/drivers/char/serial167.c
+++ b/drivers/char/serial167.c
@@ -52,6 +52,7 @@
52#include <linux/interrupt.h> 52#include <linux/interrupt.h>
53#include <linux/serial.h> 53#include <linux/serial.h>
54#include <linux/serialP.h> 54#include <linux/serialP.h>
55#include <linux/smp_lock.h>
55#include <linux/string.h> 56#include <linux/string.h>
56#include <linux/fcntl.h> 57#include <linux/fcntl.h>
57#include <linux/ptrace.h> 58#include <linux/ptrace.h>
diff --git a/drivers/char/specialix.c b/drivers/char/specialix.c
index e72be4190a44..268e17f9ec3f 100644
--- a/drivers/char/specialix.c
+++ b/drivers/char/specialix.c
@@ -87,6 +87,7 @@
87#include <linux/tty_flip.h> 87#include <linux/tty_flip.h>
88#include <linux/mm.h> 88#include <linux/mm.h>
89#include <linux/serial.h> 89#include <linux/serial.h>
90#include <linux/smp_lock.h>
90#include <linux/fcntl.h> 91#include <linux/fcntl.h>
91#include <linux/major.h> 92#include <linux/major.h>
92#include <linux/delay.h> 93#include <linux/delay.h>
@@ -1808,10 +1809,10 @@ static int sx_tiocmset(struct tty_struct *tty, struct file *file,
1808 if (clear & TIOCM_DTR) 1809 if (clear & TIOCM_DTR)
1809 port->MSVR &= ~MSVR_DTR; 1810 port->MSVR &= ~MSVR_DTR;
1810 } 1811 }
1811 spin_lock_irqsave(&bp->lock, flags); 1812 spin_lock(&bp->lock);
1812 sx_out(bp, CD186x_CAR, port_No(port)); 1813 sx_out(bp, CD186x_CAR, port_No(port));
1813 sx_out(bp, CD186x_MSVR, port->MSVR); 1814 sx_out(bp, CD186x_MSVR, port->MSVR);
1814 spin_unlock_irqrestore(&bp->lock, flags); 1815 spin_unlock(&bp->lock);
1815 spin_unlock_irqrestore(&port->lock, flags); 1816 spin_unlock_irqrestore(&port->lock, flags);
1816 func_exit(); 1817 func_exit();
1817 return 0; 1818 return 0;
@@ -1832,11 +1833,11 @@ static int sx_send_break(struct tty_struct *tty, int length)
1832 port->break_length = SPECIALIX_TPS / HZ * length; 1833 port->break_length = SPECIALIX_TPS / HZ * length;
1833 port->COR2 |= COR2_ETC; 1834 port->COR2 |= COR2_ETC;
1834 port->IER |= IER_TXRDY; 1835 port->IER |= IER_TXRDY;
1835 spin_lock_irqsave(&bp->lock, flags); 1836 spin_lock(&bp->lock);
1836 sx_out(bp, CD186x_CAR, port_No(port)); 1837 sx_out(bp, CD186x_CAR, port_No(port));
1837 sx_out(bp, CD186x_COR2, port->COR2); 1838 sx_out(bp, CD186x_COR2, port->COR2);
1838 sx_out(bp, CD186x_IER, port->IER); 1839 sx_out(bp, CD186x_IER, port->IER);
1839 spin_unlock_irqrestore(&bp->lock, flags); 1840 spin_unlock(&bp->lock);
1840 spin_unlock_irqrestore(&port->lock, flags); 1841 spin_unlock_irqrestore(&port->lock, flags);
1841 sx_wait_CCR(bp); 1842 sx_wait_CCR(bp);
1842 spin_lock_irqsave(&bp->lock, flags); 1843 spin_lock_irqsave(&bp->lock, flags);
@@ -2022,9 +2023,9 @@ static void sx_unthrottle(struct tty_struct *tty)
2022 if (sx_crtscts(tty)) 2023 if (sx_crtscts(tty))
2023 port->MSVR |= MSVR_DTR; 2024 port->MSVR |= MSVR_DTR;
2024 /* Else clause: see remark in "sx_throttle"... */ 2025 /* Else clause: see remark in "sx_throttle"... */
2025 spin_lock_irqsave(&bp->lock, flags); 2026 spin_lock(&bp->lock);
2026 sx_out(bp, CD186x_CAR, port_No(port)); 2027 sx_out(bp, CD186x_CAR, port_No(port));
2027 spin_unlock_irqrestore(&bp->lock, flags); 2028 spin_unlock(&bp->lock);
2028 if (I_IXOFF(tty)) { 2029 if (I_IXOFF(tty)) {
2029 spin_unlock_irqrestore(&port->lock, flags); 2030 spin_unlock_irqrestore(&port->lock, flags);
2030 sx_wait_CCR(bp); 2031 sx_wait_CCR(bp);
@@ -2034,9 +2035,9 @@ static void sx_unthrottle(struct tty_struct *tty)
2034 sx_wait_CCR(bp); 2035 sx_wait_CCR(bp);
2035 spin_lock_irqsave(&port->lock, flags); 2036 spin_lock_irqsave(&port->lock, flags);
2036 } 2037 }
2037 spin_lock_irqsave(&bp->lock, flags); 2038 spin_lock(&bp->lock);
2038 sx_out(bp, CD186x_MSVR, port->MSVR); 2039 sx_out(bp, CD186x_MSVR, port->MSVR);
2039 spin_unlock_irqrestore(&bp->lock, flags); 2040 spin_unlock(&bp->lock);
2040 spin_unlock_irqrestore(&port->lock, flags); 2041 spin_unlock_irqrestore(&port->lock, flags);
2041 2042
2042 func_exit(); 2043 func_exit();
@@ -2060,10 +2061,10 @@ static void sx_stop(struct tty_struct *tty)
2060 2061
2061 spin_lock_irqsave(&port->lock, flags); 2062 spin_lock_irqsave(&port->lock, flags);
2062 port->IER &= ~IER_TXRDY; 2063 port->IER &= ~IER_TXRDY;
2063 spin_lock_irqsave(&bp->lock, flags); 2064 spin_lock(&bp->lock);
2064 sx_out(bp, CD186x_CAR, port_No(port)); 2065 sx_out(bp, CD186x_CAR, port_No(port));
2065 sx_out(bp, CD186x_IER, port->IER); 2066 sx_out(bp, CD186x_IER, port->IER);
2066 spin_unlock_irqrestore(&bp->lock, flags); 2067 spin_unlock(&bp->lock);
2067 spin_unlock_irqrestore(&port->lock, flags); 2068 spin_unlock_irqrestore(&port->lock, flags);
2068 2069
2069 func_exit(); 2070 func_exit();
@@ -2088,10 +2089,10 @@ static void sx_start(struct tty_struct *tty)
2088 spin_lock_irqsave(&port->lock, flags); 2089 spin_lock_irqsave(&port->lock, flags);
2089 if (port->xmit_cnt && port->xmit_buf && !(port->IER & IER_TXRDY)) { 2090 if (port->xmit_cnt && port->xmit_buf && !(port->IER & IER_TXRDY)) {
2090 port->IER |= IER_TXRDY; 2091 port->IER |= IER_TXRDY;
2091 spin_lock_irqsave(&bp->lock, flags); 2092 spin_lock(&bp->lock);
2092 sx_out(bp, CD186x_CAR, port_No(port)); 2093 sx_out(bp, CD186x_CAR, port_No(port));
2093 sx_out(bp, CD186x_IER, port->IER); 2094 sx_out(bp, CD186x_IER, port->IER);
2094 spin_unlock_irqrestore(&bp->lock, flags); 2095 spin_unlock(&bp->lock);
2095 } 2096 }
2096 spin_unlock_irqrestore(&port->lock, flags); 2097 spin_unlock_irqrestore(&port->lock, flags);
2097 2098
diff --git a/drivers/char/sx.c b/drivers/char/sx.c
index 518f2a25d91e..a81ec4fcf6ff 100644
--- a/drivers/char/sx.c
+++ b/drivers/char/sx.c
@@ -216,6 +216,7 @@
216#include <linux/eisa.h> 216#include <linux/eisa.h>
217#include <linux/pci.h> 217#include <linux/pci.h>
218#include <linux/slab.h> 218#include <linux/slab.h>
219#include <linux/smp_lock.h>
219#include <linux/init.h> 220#include <linux/init.h>
220#include <linux/miscdevice.h> 221#include <linux/miscdevice.h>
221#include <linux/bitops.h> 222#include <linux/bitops.h>
diff --git a/drivers/char/synclink.c b/drivers/char/synclink.c
index afded3a2379c..813552f14884 100644
--- a/drivers/char/synclink.c
+++ b/drivers/char/synclink.c
@@ -81,6 +81,7 @@
81#include <linux/mm.h> 81#include <linux/mm.h>
82#include <linux/seq_file.h> 82#include <linux/seq_file.h>
83#include <linux/slab.h> 83#include <linux/slab.h>
84#include <linux/smp_lock.h>
84#include <linux/delay.h> 85#include <linux/delay.h>
85#include <linux/netdevice.h> 86#include <linux/netdevice.h>
86#include <linux/vmalloc.h> 87#include <linux/vmalloc.h>
diff --git a/drivers/char/synclink_gt.c b/drivers/char/synclink_gt.c
index a2e67e6df3a1..91f20a92fddf 100644
--- a/drivers/char/synclink_gt.c
+++ b/drivers/char/synclink_gt.c
@@ -62,6 +62,7 @@
62#include <linux/mm.h> 62#include <linux/mm.h>
63#include <linux/seq_file.h> 63#include <linux/seq_file.h>
64#include <linux/slab.h> 64#include <linux/slab.h>
65#include <linux/smp_lock.h>
65#include <linux/netdevice.h> 66#include <linux/netdevice.h>
66#include <linux/vmalloc.h> 67#include <linux/vmalloc.h>
67#include <linux/init.h> 68#include <linux/init.h>
diff --git a/drivers/char/synclinkmp.c b/drivers/char/synclinkmp.c
index 6f727e3c53ad..8d4a2a8a0a70 100644
--- a/drivers/char/synclinkmp.c
+++ b/drivers/char/synclinkmp.c
@@ -52,6 +52,7 @@
52#include <linux/mm.h> 52#include <linux/mm.h>
53#include <linux/seq_file.h> 53#include <linux/seq_file.h>
54#include <linux/slab.h> 54#include <linux/slab.h>
55#include <linux/smp_lock.h>
55#include <linux/netdevice.h> 56#include <linux/netdevice.h>
56#include <linux/vmalloc.h> 57#include <linux/vmalloc.h>
57#include <linux/init.h> 58#include <linux/init.h>
diff --git a/drivers/char/sysrq.c b/drivers/char/sysrq.c
index 0db35857e4d8..5d7a02f63e1c 100644
--- a/drivers/char/sysrq.c
+++ b/drivers/char/sysrq.c
@@ -35,7 +35,6 @@
35#include <linux/spinlock.h> 35#include <linux/spinlock.h>
36#include <linux/vt_kern.h> 36#include <linux/vt_kern.h>
37#include <linux/workqueue.h> 37#include <linux/workqueue.h>
38#include <linux/kexec.h>
39#include <linux/hrtimer.h> 38#include <linux/hrtimer.h>
40#include <linux/oom.h> 39#include <linux/oom.h>
41 40
@@ -124,9 +123,12 @@ static struct sysrq_key_op sysrq_unraw_op = {
124static void sysrq_handle_crash(int key, struct tty_struct *tty) 123static void sysrq_handle_crash(int key, struct tty_struct *tty)
125{ 124{
126 char *killer = NULL; 125 char *killer = NULL;
126
127 panic_on_oops = 1; /* force panic */
128 wmb();
127 *killer = 1; 129 *killer = 1;
128} 130}
129static struct sysrq_key_op sysrq_crashdump_op = { 131static struct sysrq_key_op sysrq_crash_op = {
130 .handler = sysrq_handle_crash, 132 .handler = sysrq_handle_crash,
131 .help_msg = "Crash", 133 .help_msg = "Crash",
132 .action_msg = "Trigger a crash", 134 .action_msg = "Trigger a crash",
@@ -401,7 +403,7 @@ static struct sysrq_key_op *sysrq_key_table[36] = {
401 */ 403 */
402 NULL, /* a */ 404 NULL, /* a */
403 &sysrq_reboot_op, /* b */ 405 &sysrq_reboot_op, /* b */
404 &sysrq_crashdump_op, /* c & ibm_emac driver debug */ 406 &sysrq_crash_op, /* c & ibm_emac driver debug */
405 &sysrq_showlocks_op, /* d */ 407 &sysrq_showlocks_op, /* d */
406 &sysrq_term_op, /* e */ 408 &sysrq_term_op, /* e */
407 &sysrq_moom_op, /* f */ 409 &sysrq_moom_op, /* f */
diff --git a/drivers/char/tb0219.c b/drivers/char/tb0219.c
index 6062b62800fd..b3ec9b10e292 100644
--- a/drivers/char/tb0219.c
+++ b/drivers/char/tb0219.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * Driver for TANBAC TB0219 base board. 2 * Driver for TANBAC TB0219 base board.
3 * 3 *
4 * Copyright (C) 2005 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> 4 * Copyright (C) 2005 Yoichi Yuasa <yuasa@linux-mips.org>
5 * 5 *
6 * This program is free software; you can redistribute it and/or modify 6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by 7 * it under the terms of the GNU General Public License as published by
@@ -28,7 +28,7 @@
28#include <asm/vr41xx/giu.h> 28#include <asm/vr41xx/giu.h>
29#include <asm/vr41xx/tb0219.h> 29#include <asm/vr41xx/tb0219.h>
30 30
31MODULE_AUTHOR("Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>"); 31MODULE_AUTHOR("Yoichi Yuasa <yuasa@linux-mips.org>");
32MODULE_DESCRIPTION("TANBAC TB0219 base board driver"); 32MODULE_DESCRIPTION("TANBAC TB0219 base board driver");
33MODULE_LICENSE("GPL"); 33MODULE_LICENSE("GPL");
34 34
diff --git a/drivers/char/tpm/tpm.c b/drivers/char/tpm/tpm.c
index ccdd828adcef..b0603b2e5684 100644
--- a/drivers/char/tpm/tpm.c
+++ b/drivers/char/tpm/tpm.c
@@ -26,7 +26,6 @@
26#include <linux/poll.h> 26#include <linux/poll.h>
27#include <linux/mutex.h> 27#include <linux/mutex.h>
28#include <linux/spinlock.h> 28#include <linux/spinlock.h>
29#include <linux/smp_lock.h>
30 29
31#include "tpm.h" 30#include "tpm.h"
32 31
diff --git a/drivers/char/tty_buffer.c b/drivers/char/tty_buffer.c
index 810ee25d66a4..3108991c5c8b 100644
--- a/drivers/char/tty_buffer.c
+++ b/drivers/char/tty_buffer.c
@@ -462,6 +462,19 @@ static void flush_to_ldisc(struct work_struct *work)
462} 462}
463 463
464/** 464/**
465 * tty_flush_to_ldisc
466 * @tty: tty to push
467 *
468 * Push the terminal flip buffers to the line discipline.
469 *
470 * Must not be called from IRQ context.
471 */
472void tty_flush_to_ldisc(struct tty_struct *tty)
473{
474 flush_to_ldisc(&tty->buf.work.work);
475}
476
477/**
465 * tty_flip_buffer_push - terminal 478 * tty_flip_buffer_push - terminal
466 * @tty: tty to push 479 * @tty: tty to push
467 * 480 *
diff --git a/drivers/char/tty_ioctl.c b/drivers/char/tty_ioctl.c
index b24f6c6a1ea3..ad6ba4ed2808 100644
--- a/drivers/char/tty_ioctl.c
+++ b/drivers/char/tty_ioctl.c
@@ -21,7 +21,6 @@
21#include <linux/module.h> 21#include <linux/module.h>
22#include <linux/bitops.h> 22#include <linux/bitops.h>
23#include <linux/mutex.h> 23#include <linux/mutex.h>
24#include <linux/smp_lock.h>
25 24
26#include <asm/io.h> 25#include <asm/io.h>
27#include <asm/uaccess.h> 26#include <asm/uaccess.h>
diff --git a/drivers/char/tty_ldisc.c b/drivers/char/tty_ldisc.c
index a19e935847b0..1733d3439ad2 100644
--- a/drivers/char/tty_ldisc.c
+++ b/drivers/char/tty_ldisc.c
@@ -21,7 +21,6 @@
21#include <linux/proc_fs.h> 21#include <linux/proc_fs.h>
22#include <linux/init.h> 22#include <linux/init.h>
23#include <linux/module.h> 23#include <linux/module.h>
24#include <linux/smp_lock.h>
25#include <linux/device.h> 24#include <linux/device.h>
26#include <linux/wait.h> 25#include <linux/wait.h>
27#include <linux/bitops.h> 26#include <linux/bitops.h>
@@ -49,6 +48,41 @@ static DECLARE_WAIT_QUEUE_HEAD(tty_ldisc_wait);
49/* Line disc dispatch table */ 48/* Line disc dispatch table */
50static struct tty_ldisc_ops *tty_ldiscs[NR_LDISCS]; 49static struct tty_ldisc_ops *tty_ldiscs[NR_LDISCS];
51 50
51static inline struct tty_ldisc *get_ldisc(struct tty_ldisc *ld)
52{
53 if (ld)
54 atomic_inc(&ld->users);
55 return ld;
56}
57
58static void put_ldisc(struct tty_ldisc *ld)
59{
60 unsigned long flags;
61
62 if (WARN_ON_ONCE(!ld))
63 return;
64
65 /*
66 * If this is the last user, free the ldisc, and
67 * release the ldisc ops.
68 *
69 * We really want an "atomic_dec_and_lock_irqsave()",
70 * but we don't have it, so this does it by hand.
71 */
72 local_irq_save(flags);
73 if (atomic_dec_and_lock(&ld->users, &tty_ldisc_lock)) {
74 struct tty_ldisc_ops *ldo = ld->ops;
75
76 ldo->refcount--;
77 module_put(ldo->owner);
78 spin_unlock_irqrestore(&tty_ldisc_lock, flags);
79
80 kfree(ld);
81 return;
82 }
83 local_irq_restore(flags);
84}
85
52/** 86/**
53 * tty_register_ldisc - install a line discipline 87 * tty_register_ldisc - install a line discipline
54 * @disc: ldisc number 88 * @disc: ldisc number
@@ -143,7 +177,7 @@ static struct tty_ldisc *tty_ldisc_try_get(int disc)
143 /* lock it */ 177 /* lock it */
144 ldops->refcount++; 178 ldops->refcount++;
145 ld->ops = ldops; 179 ld->ops = ldops;
146 ld->refcount = 0; 180 atomic_set(&ld->users, 1);
147 err = 0; 181 err = 0;
148 } 182 }
149 } 183 }
@@ -182,35 +216,6 @@ static struct tty_ldisc *tty_ldisc_get(int disc)
182 return ld; 216 return ld;
183} 217}
184 218
185/**
186 * tty_ldisc_put - drop ldisc reference
187 * @ld: ldisc
188 *
189 * Drop a reference to a line discipline. Manage refcounts and
190 * module usage counts. Free the ldisc once the recount hits zero.
191 *
192 * Locking:
193 * takes tty_ldisc_lock to guard against ldisc races
194 */
195
196static void tty_ldisc_put(struct tty_ldisc *ld)
197{
198 unsigned long flags;
199 int disc = ld->ops->num;
200 struct tty_ldisc_ops *ldo;
201
202 BUG_ON(disc < N_TTY || disc >= NR_LDISCS);
203
204 spin_lock_irqsave(&tty_ldisc_lock, flags);
205 ldo = tty_ldiscs[disc];
206 BUG_ON(ldo->refcount == 0);
207 ldo->refcount--;
208 module_put(ldo->owner);
209 spin_unlock_irqrestore(&tty_ldisc_lock, flags);
210 WARN_ON(ld->refcount);
211 kfree(ld);
212}
213
214static void *tty_ldiscs_seq_start(struct seq_file *m, loff_t *pos) 219static void *tty_ldiscs_seq_start(struct seq_file *m, loff_t *pos)
215{ 220{
216 return (*pos < NR_LDISCS) ? pos : NULL; 221 return (*pos < NR_LDISCS) ? pos : NULL;
@@ -235,7 +240,7 @@ static int tty_ldiscs_seq_show(struct seq_file *m, void *v)
235 if (IS_ERR(ld)) 240 if (IS_ERR(ld))
236 return 0; 241 return 0;
237 seq_printf(m, "%-10s %2d\n", ld->ops->name ? ld->ops->name : "???", i); 242 seq_printf(m, "%-10s %2d\n", ld->ops->name ? ld->ops->name : "???", i);
238 tty_ldisc_put(ld); 243 put_ldisc(ld);
239 return 0; 244 return 0;
240} 245}
241 246
@@ -289,20 +294,17 @@ static void tty_ldisc_assign(struct tty_struct *tty, struct tty_ldisc *ld)
289 * Locking: takes tty_ldisc_lock 294 * Locking: takes tty_ldisc_lock
290 */ 295 */
291 296
292static int tty_ldisc_try(struct tty_struct *tty) 297static struct tty_ldisc *tty_ldisc_try(struct tty_struct *tty)
293{ 298{
294 unsigned long flags; 299 unsigned long flags;
295 struct tty_ldisc *ld; 300 struct tty_ldisc *ld;
296 int ret = 0;
297 301
298 spin_lock_irqsave(&tty_ldisc_lock, flags); 302 spin_lock_irqsave(&tty_ldisc_lock, flags);
299 ld = tty->ldisc; 303 ld = NULL;
300 if (test_bit(TTY_LDISC, &tty->flags)) { 304 if (test_bit(TTY_LDISC, &tty->flags))
301 ld->refcount++; 305 ld = get_ldisc(tty->ldisc);
302 ret = 1;
303 }
304 spin_unlock_irqrestore(&tty_ldisc_lock, flags); 306 spin_unlock_irqrestore(&tty_ldisc_lock, flags);
305 return ret; 307 return ld;
306} 308}
307 309
308/** 310/**
@@ -323,10 +325,11 @@ static int tty_ldisc_try(struct tty_struct *tty)
323 325
324struct tty_ldisc *tty_ldisc_ref_wait(struct tty_struct *tty) 326struct tty_ldisc *tty_ldisc_ref_wait(struct tty_struct *tty)
325{ 327{
328 struct tty_ldisc *ld;
329
326 /* wait_event is a macro */ 330 /* wait_event is a macro */
327 wait_event(tty_ldisc_wait, tty_ldisc_try(tty)); 331 wait_event(tty_ldisc_wait, (ld = tty_ldisc_try(tty)) != NULL);
328 WARN_ON(tty->ldisc->refcount == 0); 332 return ld;
329 return tty->ldisc;
330} 333}
331EXPORT_SYMBOL_GPL(tty_ldisc_ref_wait); 334EXPORT_SYMBOL_GPL(tty_ldisc_ref_wait);
332 335
@@ -343,9 +346,7 @@ EXPORT_SYMBOL_GPL(tty_ldisc_ref_wait);
343 346
344struct tty_ldisc *tty_ldisc_ref(struct tty_struct *tty) 347struct tty_ldisc *tty_ldisc_ref(struct tty_struct *tty)
345{ 348{
346 if (tty_ldisc_try(tty)) 349 return tty_ldisc_try(tty);
347 return tty->ldisc;
348 return NULL;
349} 350}
350EXPORT_SYMBOL_GPL(tty_ldisc_ref); 351EXPORT_SYMBOL_GPL(tty_ldisc_ref);
351 352
@@ -361,21 +362,15 @@ EXPORT_SYMBOL_GPL(tty_ldisc_ref);
361 362
362void tty_ldisc_deref(struct tty_ldisc *ld) 363void tty_ldisc_deref(struct tty_ldisc *ld)
363{ 364{
364 unsigned long flags; 365 put_ldisc(ld);
365
366 BUG_ON(ld == NULL);
367
368 spin_lock_irqsave(&tty_ldisc_lock, flags);
369 if (ld->refcount == 0)
370 printk(KERN_ERR "tty_ldisc_deref: no references.\n");
371 else
372 ld->refcount--;
373 if (ld->refcount == 0)
374 wake_up(&tty_ldisc_wait);
375 spin_unlock_irqrestore(&tty_ldisc_lock, flags);
376} 366}
377EXPORT_SYMBOL_GPL(tty_ldisc_deref); 367EXPORT_SYMBOL_GPL(tty_ldisc_deref);
378 368
369static inline void tty_ldisc_put(struct tty_ldisc *ld)
370{
371 put_ldisc(ld);
372}
373
379/** 374/**
380 * tty_ldisc_enable - allow ldisc use 375 * tty_ldisc_enable - allow ldisc use
381 * @tty: terminal to activate ldisc on 376 * @tty: terminal to activate ldisc on
@@ -524,31 +519,6 @@ static int tty_ldisc_halt(struct tty_struct *tty)
524} 519}
525 520
526/** 521/**
527 * tty_ldisc_wait_idle - wait for the ldisc to become idle
528 * @tty: tty to wait for
529 *
530 * Wait for the line discipline to become idle. The discipline must
531 * have been halted for this to guarantee it remains idle.
532 *
533 * tty_ldisc_lock protects the ref counts currently.
534 */
535
536static int tty_ldisc_wait_idle(struct tty_struct *tty)
537{
538 unsigned long flags;
539 spin_lock_irqsave(&tty_ldisc_lock, flags);
540 while (tty->ldisc->refcount) {
541 spin_unlock_irqrestore(&tty_ldisc_lock, flags);
542 if (wait_event_timeout(tty_ldisc_wait,
543 tty->ldisc->refcount == 0, 5 * HZ) == 0)
544 return -EBUSY;
545 spin_lock_irqsave(&tty_ldisc_lock, flags);
546 }
547 spin_unlock_irqrestore(&tty_ldisc_lock, flags);
548 return 0;
549}
550
551/**
552 * tty_set_ldisc - set line discipline 522 * tty_set_ldisc - set line discipline
553 * @tty: the terminal to set 523 * @tty: the terminal to set
554 * @ldisc: the line discipline 524 * @ldisc: the line discipline
@@ -643,14 +613,6 @@ int tty_set_ldisc(struct tty_struct *tty, int ldisc)
643 613
644 flush_scheduled_work(); 614 flush_scheduled_work();
645 615
646 /* Let any existing reference holders finish */
647 retval = tty_ldisc_wait_idle(tty);
648 if (retval < 0) {
649 clear_bit(TTY_LDISC_CHANGING, &tty->flags);
650 tty_ldisc_put(new_ldisc);
651 return retval;
652 }
653
654 mutex_lock(&tty->ldisc_mutex); 616 mutex_lock(&tty->ldisc_mutex);
655 if (test_bit(TTY_HUPPED, &tty->flags)) { 617 if (test_bit(TTY_HUPPED, &tty->flags)) {
656 /* We were raced by the hangup method. It will have stomped 618 /* We were raced by the hangup method. It will have stomped
@@ -791,17 +753,19 @@ void tty_ldisc_hangup(struct tty_struct *tty)
791 * N_TTY. 753 * N_TTY.
792 */ 754 */
793 if (tty->driver->flags & TTY_DRIVER_RESET_TERMIOS) { 755 if (tty->driver->flags & TTY_DRIVER_RESET_TERMIOS) {
794 /* Avoid racing set_ldisc */ 756 /* Avoid racing set_ldisc or tty_ldisc_release */
795 mutex_lock(&tty->ldisc_mutex); 757 mutex_lock(&tty->ldisc_mutex);
796 /* Switch back to N_TTY */ 758 if (tty->ldisc) { /* Not yet closed */
797 tty_ldisc_halt(tty); 759 /* Switch back to N_TTY */
798 tty_ldisc_wait_idle(tty); 760 tty_ldisc_halt(tty);
799 tty_ldisc_reinit(tty); 761 tty_ldisc_reinit(tty);
800 /* At this point we have a closed ldisc and we want to 762 /* At this point we have a closed ldisc and we want to
801 reopen it. We could defer this to the next open but 763 reopen it. We could defer this to the next open but
802 it means auditing a lot of other paths so this is a FIXME */ 764 it means auditing a lot of other paths so this is
803 WARN_ON(tty_ldisc_open(tty, tty->ldisc)); 765 a FIXME */
804 tty_ldisc_enable(tty); 766 WARN_ON(tty_ldisc_open(tty, tty->ldisc));
767 tty_ldisc_enable(tty);
768 }
805 mutex_unlock(&tty->ldisc_mutex); 769 mutex_unlock(&tty->ldisc_mutex);
806 tty_reset_termios(tty); 770 tty_reset_termios(tty);
807 } 771 }
@@ -858,24 +822,25 @@ void tty_ldisc_release(struct tty_struct *tty, struct tty_struct *o_tty)
858 tty_ldisc_halt(tty); 822 tty_ldisc_halt(tty);
859 flush_scheduled_work(); 823 flush_scheduled_work();
860 824
825 mutex_lock(&tty->ldisc_mutex);
861 /* 826 /*
862 * Wait for any short term users (we know they are just driver 827 * Now kill off the ldisc
863 * side waiters as the file is closing so user count on the file
864 * side is zero.
865 */ 828 */
829 tty_ldisc_close(tty, tty->ldisc);
830 tty_ldisc_put(tty->ldisc);
831 /* Force an oops if we mess this up */
832 tty->ldisc = NULL;
866 833
867 tty_ldisc_wait_idle(tty); 834 /* Ensure the next open requests the N_TTY ldisc */
868 835 tty_set_termios_ldisc(tty, N_TTY);
869 /* 836 mutex_unlock(&tty->ldisc_mutex);
870 * Shutdown the current line discipline, and reset it to N_TTY.
871 *
872 * FIXME: this MUST get fixed for the new reflocking
873 */
874 837
875 tty_ldisc_reinit(tty);
876 /* This will need doing differently if we need to lock */ 838 /* This will need doing differently if we need to lock */
877 if (o_tty) 839 if (o_tty)
878 tty_ldisc_release(o_tty, NULL); 840 tty_ldisc_release(o_tty, NULL);
841
842 /* And the memory resources remaining (buffers, termios) will be
843 disposed of when the kref hits zero */
879} 844}
880 845
881/** 846/**
diff --git a/drivers/char/tty_port.c b/drivers/char/tty_port.c
index 4e862a75f7ff..9769b1149f76 100644
--- a/drivers/char/tty_port.c
+++ b/drivers/char/tty_port.c
@@ -267,7 +267,7 @@ int tty_port_block_til_ready(struct tty_port *port,
267 if (retval == 0) 267 if (retval == 0)
268 port->flags |= ASYNC_NORMAL_ACTIVE; 268 port->flags |= ASYNC_NORMAL_ACTIVE;
269 spin_unlock_irqrestore(&port->lock, flags); 269 spin_unlock_irqrestore(&port->lock, flags);
270 return 0; 270 return retval;
271 271
272} 272}
273EXPORT_SYMBOL(tty_port_block_til_ready); 273EXPORT_SYMBOL(tty_port_block_til_ready);
diff --git a/drivers/char/vc_screen.c b/drivers/char/vc_screen.c
index d94d25c12aa8..c1791a63d99d 100644
--- a/drivers/char/vc_screen.c
+++ b/drivers/char/vc_screen.c
@@ -495,11 +495,15 @@ void vcs_remove_sysfs(int index)
495 495
496int __init vcs_init(void) 496int __init vcs_init(void)
497{ 497{
498 unsigned int i;
499
498 if (register_chrdev(VCS_MAJOR, "vcs", &vcs_fops)) 500 if (register_chrdev(VCS_MAJOR, "vcs", &vcs_fops))
499 panic("unable to get major %d for vcs device", VCS_MAJOR); 501 panic("unable to get major %d for vcs device", VCS_MAJOR);
500 vc_class = class_create(THIS_MODULE, "vc"); 502 vc_class = class_create(THIS_MODULE, "vc");
501 503
502 device_create(vc_class, NULL, MKDEV(VCS_MAJOR, 0), NULL, "vcs"); 504 device_create(vc_class, NULL, MKDEV(VCS_MAJOR, 0), NULL, "vcs");
503 device_create(vc_class, NULL, MKDEV(VCS_MAJOR, 128), NULL, "vcsa"); 505 device_create(vc_class, NULL, MKDEV(VCS_MAJOR, 128), NULL, "vcsa");
506 for (i = 0; i < MIN_NR_CONSOLES; i++)
507 vcs_make_sysfs(i);
504 return 0; 508 return 0;
505} 509}
diff --git a/drivers/char/vt.c b/drivers/char/vt.c
index d9113b4c76e3..404f4c1ee431 100644
--- a/drivers/char/vt.c
+++ b/drivers/char/vt.c
@@ -89,6 +89,7 @@
89#include <linux/mutex.h> 89#include <linux/mutex.h>
90#include <linux/vt_kern.h> 90#include <linux/vt_kern.h>
91#include <linux/selection.h> 91#include <linux/selection.h>
92#include <linux/smp_lock.h>
92#include <linux/tiocl.h> 93#include <linux/tiocl.h>
93#include <linux/kbd_kern.h> 94#include <linux/kbd_kern.h>
94#include <linux/consolemap.h> 95#include <linux/consolemap.h>
@@ -769,14 +770,12 @@ int vc_allocate(unsigned int currcons) /* return 0 on success */
769 visual_init(vc, currcons, 1); 770 visual_init(vc, currcons, 1);
770 if (!*vc->vc_uni_pagedir_loc) 771 if (!*vc->vc_uni_pagedir_loc)
771 con_set_default_unimap(vc); 772 con_set_default_unimap(vc);
772 if (!vc->vc_kmalloced) 773 vc->vc_screenbuf = kmalloc(vc->vc_screenbuf_size, GFP_KERNEL);
773 vc->vc_screenbuf = kmalloc(vc->vc_screenbuf_size, GFP_KERNEL);
774 if (!vc->vc_screenbuf) { 774 if (!vc->vc_screenbuf) {
775 kfree(vc); 775 kfree(vc);
776 vc_cons[currcons].d = NULL; 776 vc_cons[currcons].d = NULL;
777 return -ENOMEM; 777 return -ENOMEM;
778 } 778 }
779 vc->vc_kmalloced = 1;
780 vc_init(vc, vc->vc_rows, vc->vc_cols, 1); 779 vc_init(vc, vc->vc_rows, vc->vc_cols, 1);
781 vcs_make_sysfs(currcons); 780 vcs_make_sysfs(currcons);
782 atomic_notifier_call_chain(&vt_notifier_list, VT_ALLOCATE, &param); 781 atomic_notifier_call_chain(&vt_notifier_list, VT_ALLOCATE, &param);
@@ -912,10 +911,8 @@ static int vc_do_resize(struct tty_struct *tty, struct vc_data *vc,
912 if (new_scr_end > new_origin) 911 if (new_scr_end > new_origin)
913 scr_memsetw((void *)new_origin, vc->vc_video_erase_char, 912 scr_memsetw((void *)new_origin, vc->vc_video_erase_char,
914 new_scr_end - new_origin); 913 new_scr_end - new_origin);
915 if (vc->vc_kmalloced) 914 kfree(vc->vc_screenbuf);
916 kfree(vc->vc_screenbuf);
917 vc->vc_screenbuf = newscreen; 915 vc->vc_screenbuf = newscreen;
918 vc->vc_kmalloced = 1;
919 vc->vc_screenbuf_size = new_screen_size; 916 vc->vc_screenbuf_size = new_screen_size;
920 set_origin(vc); 917 set_origin(vc);
921 918
@@ -994,8 +991,7 @@ void vc_deallocate(unsigned int currcons)
994 vc->vc_sw->con_deinit(vc); 991 vc->vc_sw->con_deinit(vc);
995 put_pid(vc->vt_pid); 992 put_pid(vc->vt_pid);
996 module_put(vc->vc_sw->owner); 993 module_put(vc->vc_sw->owner);
997 if (vc->vc_kmalloced) 994 kfree(vc->vc_screenbuf);
998 kfree(vc->vc_screenbuf);
999 if (currcons >= MIN_NR_CONSOLES) 995 if (currcons >= MIN_NR_CONSOLES)
1000 kfree(vc); 996 kfree(vc);
1001 vc_cons[currcons].d = NULL; 997 vc_cons[currcons].d = NULL;
@@ -2880,7 +2876,6 @@ static int __init con_init(void)
2880 INIT_WORK(&vc_cons[currcons].SAK_work, vc_SAK); 2876 INIT_WORK(&vc_cons[currcons].SAK_work, vc_SAK);
2881 visual_init(vc, currcons, 1); 2877 visual_init(vc, currcons, 1);
2882 vc->vc_screenbuf = kzalloc(vc->vc_screenbuf_size, GFP_NOWAIT); 2878 vc->vc_screenbuf = kzalloc(vc->vc_screenbuf_size, GFP_NOWAIT);
2883 vc->vc_kmalloced = 0;
2884 vc_init(vc, vc->vc_rows, vc->vc_cols, 2879 vc_init(vc, vc->vc_rows, vc->vc_cols,
2885 currcons || !vc->vc_sw->con_save_screen); 2880 currcons || !vc->vc_sw->con_save_screen);
2886 } 2881 }
diff --git a/drivers/char/vt_ioctl.c b/drivers/char/vt_ioctl.c
index 7539bed0f7e0..95189f288f8c 100644
--- a/drivers/char/vt_ioctl.c
+++ b/drivers/char/vt_ioctl.c
@@ -25,6 +25,7 @@
25#include <linux/console.h> 25#include <linux/console.h>
26#include <linux/consolemap.h> 26#include <linux/consolemap.h>
27#include <linux/signal.h> 27#include <linux/signal.h>
28#include <linux/smp_lock.h>
28#include <linux/timex.h> 29#include <linux/timex.h>
29 30
30#include <asm/io.h> 31#include <asm/io.h>
diff --git a/drivers/clocksource/sh_tmu.c b/drivers/clocksource/sh_tmu.c
index 9ffb05f4095d..93c2322feab7 100644
--- a/drivers/clocksource/sh_tmu.c
+++ b/drivers/clocksource/sh_tmu.c
@@ -161,7 +161,7 @@ static void sh_tmu_set_next(struct sh_tmu_priv *p, unsigned long delta,
161 if (periodic) 161 if (periodic)
162 sh_tmu_write(p, TCOR, delta); 162 sh_tmu_write(p, TCOR, delta);
163 else 163 else
164 sh_tmu_write(p, TCOR, 0); 164 sh_tmu_write(p, TCOR, 0xffffffff);
165 165
166 sh_tmu_write(p, TCNT, delta); 166 sh_tmu_write(p, TCNT, delta);
167 167
diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
index 6e2ec0b18948..fd69086d08d5 100644
--- a/drivers/cpufreq/cpufreq.c
+++ b/drivers/cpufreq/cpufreq.c
@@ -761,6 +761,10 @@ static struct kobj_type ktype_cpufreq = {
761 * cpufreq_add_dev - add a CPU device 761 * cpufreq_add_dev - add a CPU device
762 * 762 *
763 * Adds the cpufreq interface for a CPU device. 763 * Adds the cpufreq interface for a CPU device.
764 *
765 * The Oracle says: try running cpufreq registration/unregistration concurrently
766 * with with cpu hotplugging and all hell will break loose. Tried to clean this
767 * mess up, but more thorough testing is needed. - Mathieu
764 */ 768 */
765static int cpufreq_add_dev(struct sys_device *sys_dev) 769static int cpufreq_add_dev(struct sys_device *sys_dev)
766{ 770{
@@ -772,9 +776,6 @@ static int cpufreq_add_dev(struct sys_device *sys_dev)
772 struct sys_device *cpu_sys_dev; 776 struct sys_device *cpu_sys_dev;
773 unsigned long flags; 777 unsigned long flags;
774 unsigned int j; 778 unsigned int j;
775#ifdef CONFIG_SMP
776 struct cpufreq_policy *managed_policy;
777#endif
778 779
779 if (cpu_is_offline(cpu)) 780 if (cpu_is_offline(cpu))
780 return 0; 781 return 0;
@@ -804,15 +805,12 @@ static int cpufreq_add_dev(struct sys_device *sys_dev)
804 goto nomem_out; 805 goto nomem_out;
805 } 806 }
806 if (!alloc_cpumask_var(&policy->cpus, GFP_KERNEL)) { 807 if (!alloc_cpumask_var(&policy->cpus, GFP_KERNEL)) {
807 kfree(policy);
808 ret = -ENOMEM; 808 ret = -ENOMEM;
809 goto nomem_out; 809 goto err_free_policy;
810 } 810 }
811 if (!zalloc_cpumask_var(&policy->related_cpus, GFP_KERNEL)) { 811 if (!zalloc_cpumask_var(&policy->related_cpus, GFP_KERNEL)) {
812 free_cpumask_var(policy->cpus);
813 kfree(policy);
814 ret = -ENOMEM; 812 ret = -ENOMEM;
815 goto nomem_out; 813 goto err_free_cpumask;
816 } 814 }
817 815
818 policy->cpu = cpu; 816 policy->cpu = cpu;
@@ -820,7 +818,8 @@ static int cpufreq_add_dev(struct sys_device *sys_dev)
820 818
821 /* Initially set CPU itself as the policy_cpu */ 819 /* Initially set CPU itself as the policy_cpu */
822 per_cpu(policy_cpu, cpu) = cpu; 820 per_cpu(policy_cpu, cpu) = cpu;
823 lock_policy_rwsem_write(cpu); 821 ret = (lock_policy_rwsem_write(cpu) < 0);
822 WARN_ON(ret);
824 823
825 init_completion(&policy->kobj_unregister); 824 init_completion(&policy->kobj_unregister);
826 INIT_WORK(&policy->update, handle_update); 825 INIT_WORK(&policy->update, handle_update);
@@ -833,7 +832,7 @@ static int cpufreq_add_dev(struct sys_device *sys_dev)
833 ret = cpufreq_driver->init(policy); 832 ret = cpufreq_driver->init(policy);
834 if (ret) { 833 if (ret) {
835 dprintk("initialization failed\n"); 834 dprintk("initialization failed\n");
836 goto err_out; 835 goto err_unlock_policy;
837 } 836 }
838 policy->user_policy.min = policy->min; 837 policy->user_policy.min = policy->min;
839 policy->user_policy.max = policy->max; 838 policy->user_policy.max = policy->max;
@@ -852,21 +851,31 @@ static int cpufreq_add_dev(struct sys_device *sys_dev)
852#endif 851#endif
853 852
854 for_each_cpu(j, policy->cpus) { 853 for_each_cpu(j, policy->cpus) {
854 struct cpufreq_policy *managed_policy;
855
855 if (cpu == j) 856 if (cpu == j)
856 continue; 857 continue;
857 858
858 /* Check for existing affected CPUs. 859 /* Check for existing affected CPUs.
859 * They may not be aware of it due to CPU Hotplug. 860 * They may not be aware of it due to CPU Hotplug.
861 * cpufreq_cpu_put is called when the device is removed
862 * in __cpufreq_remove_dev()
860 */ 863 */
861 managed_policy = cpufreq_cpu_get(j); /* FIXME: Where is this released? What about error paths? */ 864 managed_policy = cpufreq_cpu_get(j);
862 if (unlikely(managed_policy)) { 865 if (unlikely(managed_policy)) {
863 866
864 /* Set proper policy_cpu */ 867 /* Set proper policy_cpu */
865 unlock_policy_rwsem_write(cpu); 868 unlock_policy_rwsem_write(cpu);
866 per_cpu(policy_cpu, cpu) = managed_policy->cpu; 869 per_cpu(policy_cpu, cpu) = managed_policy->cpu;
867 870
868 if (lock_policy_rwsem_write(cpu) < 0) 871 if (lock_policy_rwsem_write(cpu) < 0) {
869 goto err_out_driver_exit; 872 /* Should not go through policy unlock path */
873 if (cpufreq_driver->exit)
874 cpufreq_driver->exit(policy);
875 ret = -EBUSY;
876 cpufreq_cpu_put(managed_policy);
877 goto err_free_cpumask;
878 }
870 879
871 spin_lock_irqsave(&cpufreq_driver_lock, flags); 880 spin_lock_irqsave(&cpufreq_driver_lock, flags);
872 cpumask_copy(managed_policy->cpus, policy->cpus); 881 cpumask_copy(managed_policy->cpus, policy->cpus);
@@ -878,11 +887,13 @@ static int cpufreq_add_dev(struct sys_device *sys_dev)
878 &managed_policy->kobj, 887 &managed_policy->kobj,
879 "cpufreq"); 888 "cpufreq");
880 if (ret) 889 if (ret)
881 goto err_out_driver_exit; 890 cpufreq_cpu_put(managed_policy);
882 891 /*
883 cpufreq_debug_enable_ratelimit(); 892 * Success. We only needed to be added to the mask.
884 ret = 0; 893 * Call driver->exit() because only the cpu parent of
885 goto err_out_driver_exit; /* call driver->exit() */ 894 * the kobj needed to call init().
895 */
896 goto out_driver_exit; /* call driver->exit() */
886 } 897 }
887 } 898 }
888#endif 899#endif
@@ -892,29 +903,31 @@ static int cpufreq_add_dev(struct sys_device *sys_dev)
892 ret = kobject_init_and_add(&policy->kobj, &ktype_cpufreq, &sys_dev->kobj, 903 ret = kobject_init_and_add(&policy->kobj, &ktype_cpufreq, &sys_dev->kobj,
893 "cpufreq"); 904 "cpufreq");
894 if (ret) 905 if (ret)
895 goto err_out_driver_exit; 906 goto out_driver_exit;
896 907
897 /* set up files for this cpu device */ 908 /* set up files for this cpu device */
898 drv_attr = cpufreq_driver->attr; 909 drv_attr = cpufreq_driver->attr;
899 while ((drv_attr) && (*drv_attr)) { 910 while ((drv_attr) && (*drv_attr)) {
900 ret = sysfs_create_file(&policy->kobj, &((*drv_attr)->attr)); 911 ret = sysfs_create_file(&policy->kobj, &((*drv_attr)->attr));
901 if (ret) 912 if (ret)
902 goto err_out_driver_exit; 913 goto err_out_kobj_put;
903 drv_attr++; 914 drv_attr++;
904 } 915 }
905 if (cpufreq_driver->get) { 916 if (cpufreq_driver->get) {
906 ret = sysfs_create_file(&policy->kobj, &cpuinfo_cur_freq.attr); 917 ret = sysfs_create_file(&policy->kobj, &cpuinfo_cur_freq.attr);
907 if (ret) 918 if (ret)
908 goto err_out_driver_exit; 919 goto err_out_kobj_put;
909 } 920 }
910 if (cpufreq_driver->target) { 921 if (cpufreq_driver->target) {
911 ret = sysfs_create_file(&policy->kobj, &scaling_cur_freq.attr); 922 ret = sysfs_create_file(&policy->kobj, &scaling_cur_freq.attr);
912 if (ret) 923 if (ret)
913 goto err_out_driver_exit; 924 goto err_out_kobj_put;
914 } 925 }
915 926
916 spin_lock_irqsave(&cpufreq_driver_lock, flags); 927 spin_lock_irqsave(&cpufreq_driver_lock, flags);
917 for_each_cpu(j, policy->cpus) { 928 for_each_cpu(j, policy->cpus) {
929 if (!cpu_online(j))
930 continue;
918 per_cpu(cpufreq_cpu_data, j) = policy; 931 per_cpu(cpufreq_cpu_data, j) = policy;
919 per_cpu(policy_cpu, j) = policy->cpu; 932 per_cpu(policy_cpu, j) = policy->cpu;
920 } 933 }
@@ -922,18 +935,22 @@ static int cpufreq_add_dev(struct sys_device *sys_dev)
922 935
923 /* symlink affected CPUs */ 936 /* symlink affected CPUs */
924 for_each_cpu(j, policy->cpus) { 937 for_each_cpu(j, policy->cpus) {
938 struct cpufreq_policy *managed_policy;
939
925 if (j == cpu) 940 if (j == cpu)
926 continue; 941 continue;
927 if (!cpu_online(j)) 942 if (!cpu_online(j))
928 continue; 943 continue;
929 944
930 dprintk("CPU %u already managed, adding link\n", j); 945 dprintk("CPU %u already managed, adding link\n", j);
931 cpufreq_cpu_get(cpu); 946 managed_policy = cpufreq_cpu_get(cpu);
932 cpu_sys_dev = get_cpu_sysdev(j); 947 cpu_sys_dev = get_cpu_sysdev(j);
933 ret = sysfs_create_link(&cpu_sys_dev->kobj, &policy->kobj, 948 ret = sysfs_create_link(&cpu_sys_dev->kobj, &policy->kobj,
934 "cpufreq"); 949 "cpufreq");
935 if (ret) 950 if (ret) {
951 cpufreq_cpu_put(managed_policy);
936 goto err_out_unregister; 952 goto err_out_unregister;
953 }
937 } 954 }
938 955
939 policy->governor = NULL; /* to assure that the starting sequence is 956 policy->governor = NULL; /* to assure that the starting sequence is
@@ -965,17 +982,20 @@ err_out_unregister:
965 per_cpu(cpufreq_cpu_data, j) = NULL; 982 per_cpu(cpufreq_cpu_data, j) = NULL;
966 spin_unlock_irqrestore(&cpufreq_driver_lock, flags); 983 spin_unlock_irqrestore(&cpufreq_driver_lock, flags);
967 984
985err_out_kobj_put:
968 kobject_put(&policy->kobj); 986 kobject_put(&policy->kobj);
969 wait_for_completion(&policy->kobj_unregister); 987 wait_for_completion(&policy->kobj_unregister);
970 988
971err_out_driver_exit: 989out_driver_exit:
972 if (cpufreq_driver->exit) 990 if (cpufreq_driver->exit)
973 cpufreq_driver->exit(policy); 991 cpufreq_driver->exit(policy);
974 992
975err_out: 993err_unlock_policy:
976 unlock_policy_rwsem_write(cpu); 994 unlock_policy_rwsem_write(cpu);
995err_free_cpumask:
996 free_cpumask_var(policy->cpus);
997err_free_policy:
977 kfree(policy); 998 kfree(policy);
978
979nomem_out: 999nomem_out:
980 module_put(cpufreq_driver->owner); 1000 module_put(cpufreq_driver->owner);
981module_out: 1001module_out:
@@ -1070,8 +1090,6 @@ static int __cpufreq_remove_dev(struct sys_device *sys_dev)
1070 spin_unlock_irqrestore(&cpufreq_driver_lock, flags); 1090 spin_unlock_irqrestore(&cpufreq_driver_lock, flags);
1071#endif 1091#endif
1072 1092
1073 unlock_policy_rwsem_write(cpu);
1074
1075 if (cpufreq_driver->target) 1093 if (cpufreq_driver->target)
1076 __cpufreq_governor(data, CPUFREQ_GOV_STOP); 1094 __cpufreq_governor(data, CPUFREQ_GOV_STOP);
1077 1095
@@ -1088,6 +1106,8 @@ static int __cpufreq_remove_dev(struct sys_device *sys_dev)
1088 if (cpufreq_driver->exit) 1106 if (cpufreq_driver->exit)
1089 cpufreq_driver->exit(data); 1107 cpufreq_driver->exit(data);
1090 1108
1109 unlock_policy_rwsem_write(cpu);
1110
1091 free_cpumask_var(data->related_cpus); 1111 free_cpumask_var(data->related_cpus);
1092 free_cpumask_var(data->cpus); 1112 free_cpumask_var(data->cpus);
1093 kfree(data); 1113 kfree(data);
@@ -1228,13 +1248,22 @@ EXPORT_SYMBOL(cpufreq_get);
1228 1248
1229static int cpufreq_suspend(struct sys_device *sysdev, pm_message_t pmsg) 1249static int cpufreq_suspend(struct sys_device *sysdev, pm_message_t pmsg)
1230{ 1250{
1231 int cpu = sysdev->id;
1232 int ret = 0; 1251 int ret = 0;
1252
1253#ifdef __powerpc__
1254 int cpu = sysdev->id;
1233 unsigned int cur_freq = 0; 1255 unsigned int cur_freq = 0;
1234 struct cpufreq_policy *cpu_policy; 1256 struct cpufreq_policy *cpu_policy;
1235 1257
1236 dprintk("suspending cpu %u\n", cpu); 1258 dprintk("suspending cpu %u\n", cpu);
1237 1259
1260 /*
1261 * This whole bogosity is here because Powerbooks are made of fail.
1262 * No sane platform should need any of the code below to be run.
1263 * (it's entirely the wrong thing to do, as driver->get may
1264 * reenable interrupts on some architectures).
1265 */
1266
1238 if (!cpu_online(cpu)) 1267 if (!cpu_online(cpu))
1239 return 0; 1268 return 0;
1240 1269
@@ -1293,6 +1322,7 @@ static int cpufreq_suspend(struct sys_device *sysdev, pm_message_t pmsg)
1293 1322
1294out: 1323out:
1295 cpufreq_cpu_put(cpu_policy); 1324 cpufreq_cpu_put(cpu_policy);
1325#endif /* __powerpc__ */
1296 return ret; 1326 return ret;
1297} 1327}
1298 1328
@@ -1306,12 +1336,18 @@ out:
1306 */ 1336 */
1307static int cpufreq_resume(struct sys_device *sysdev) 1337static int cpufreq_resume(struct sys_device *sysdev)
1308{ 1338{
1309 int cpu = sysdev->id;
1310 int ret = 0; 1339 int ret = 0;
1340
1341#ifdef __powerpc__
1342 int cpu = sysdev->id;
1311 struct cpufreq_policy *cpu_policy; 1343 struct cpufreq_policy *cpu_policy;
1312 1344
1313 dprintk("resuming cpu %u\n", cpu); 1345 dprintk("resuming cpu %u\n", cpu);
1314 1346
1347 /* As with the ->suspend method, all the code below is
1348 * only necessary because Powerbooks suck.
1349 * See commit 42d4dc3f4e1e for jokes. */
1350
1315 if (!cpu_online(cpu)) 1351 if (!cpu_online(cpu))
1316 return 0; 1352 return 0;
1317 1353
@@ -1375,6 +1411,7 @@ out:
1375 schedule_work(&cpu_policy->update); 1411 schedule_work(&cpu_policy->update);
1376fail: 1412fail:
1377 cpufreq_cpu_put(cpu_policy); 1413 cpufreq_cpu_put(cpu_policy);
1414#endif /* __powerpc__ */
1378 return ret; 1415 return ret;
1379} 1416}
1380 1417
diff --git a/drivers/cpufreq/cpufreq_conservative.c b/drivers/cpufreq/cpufreq_conservative.c
index 7fc58af748b4..bdea7e2f94ba 100644
--- a/drivers/cpufreq/cpufreq_conservative.c
+++ b/drivers/cpufreq/cpufreq_conservative.c
@@ -64,21 +64,20 @@ struct cpu_dbs_info_s {
64 unsigned int requested_freq; 64 unsigned int requested_freq;
65 int cpu; 65 int cpu;
66 unsigned int enable:1; 66 unsigned int enable:1;
67 /*
68 * percpu mutex that serializes governor limit change with
69 * do_dbs_timer invocation. We do not want do_dbs_timer to run
70 * when user is changing the governor or limits.
71 */
72 struct mutex timer_mutex;
67}; 73};
68static DEFINE_PER_CPU(struct cpu_dbs_info_s, cpu_dbs_info); 74static DEFINE_PER_CPU(struct cpu_dbs_info_s, cpu_dbs_info);
69 75
70static unsigned int dbs_enable; /* number of CPUs using this policy */ 76static unsigned int dbs_enable; /* number of CPUs using this policy */
71 77
72/* 78/*
73 * DEADLOCK ALERT! There is a ordering requirement between cpu_hotplug 79 * dbs_mutex protects data in dbs_tuners_ins from concurrent changes on
74 * lock and dbs_mutex. cpu_hotplug lock should always be held before 80 * different CPUs. It protects dbs_enable in governor start/stop.
75 * dbs_mutex. If any function that can potentially take cpu_hotplug lock
76 * (like __cpufreq_driver_target()) is being called with dbs_mutex taken, then
77 * cpu_hotplug lock should be taken before that. Note that cpu_hotplug lock
78 * is recursive for the same process. -Venki
79 * DEADLOCK ALERT! (2) : do_dbs_timer() must not take the dbs_mutex, because it
80 * would deadlock with cancel_delayed_work_sync(), which is needed for proper
81 * raceless workqueue teardown.
82 */ 81 */
83static DEFINE_MUTEX(dbs_mutex); 82static DEFINE_MUTEX(dbs_mutex);
84 83
@@ -488,18 +487,12 @@ static void do_dbs_timer(struct work_struct *work)
488 487
489 delay -= jiffies % delay; 488 delay -= jiffies % delay;
490 489
491 if (lock_policy_rwsem_write(cpu) < 0) 490 mutex_lock(&dbs_info->timer_mutex);
492 return;
493
494 if (!dbs_info->enable) {
495 unlock_policy_rwsem_write(cpu);
496 return;
497 }
498 491
499 dbs_check_cpu(dbs_info); 492 dbs_check_cpu(dbs_info);
500 493
501 queue_delayed_work_on(cpu, kconservative_wq, &dbs_info->work, delay); 494 queue_delayed_work_on(cpu, kconservative_wq, &dbs_info->work, delay);
502 unlock_policy_rwsem_write(cpu); 495 mutex_unlock(&dbs_info->timer_mutex);
503} 496}
504 497
505static inline void dbs_timer_init(struct cpu_dbs_info_s *dbs_info) 498static inline void dbs_timer_init(struct cpu_dbs_info_s *dbs_info)
@@ -535,9 +528,6 @@ static int cpufreq_governor_dbs(struct cpufreq_policy *policy,
535 if ((!cpu_online(cpu)) || (!policy->cur)) 528 if ((!cpu_online(cpu)) || (!policy->cur))
536 return -EINVAL; 529 return -EINVAL;
537 530
538 if (this_dbs_info->enable) /* Already enabled */
539 break;
540
541 mutex_lock(&dbs_mutex); 531 mutex_lock(&dbs_mutex);
542 532
543 rc = sysfs_create_group(&policy->kobj, &dbs_attr_group); 533 rc = sysfs_create_group(&policy->kobj, &dbs_attr_group);
@@ -561,6 +551,7 @@ static int cpufreq_governor_dbs(struct cpufreq_policy *policy,
561 this_dbs_info->down_skip = 0; 551 this_dbs_info->down_skip = 0;
562 this_dbs_info->requested_freq = policy->cur; 552 this_dbs_info->requested_freq = policy->cur;
563 553
554 mutex_init(&this_dbs_info->timer_mutex);
564 dbs_enable++; 555 dbs_enable++;
565 /* 556 /*
566 * Start the timerschedule work, when this governor 557 * Start the timerschedule work, when this governor
@@ -590,17 +581,19 @@ static int cpufreq_governor_dbs(struct cpufreq_policy *policy,
590 &dbs_cpufreq_notifier_block, 581 &dbs_cpufreq_notifier_block,
591 CPUFREQ_TRANSITION_NOTIFIER); 582 CPUFREQ_TRANSITION_NOTIFIER);
592 } 583 }
593 dbs_timer_init(this_dbs_info);
594
595 mutex_unlock(&dbs_mutex); 584 mutex_unlock(&dbs_mutex);
596 585
586 dbs_timer_init(this_dbs_info);
587
597 break; 588 break;
598 589
599 case CPUFREQ_GOV_STOP: 590 case CPUFREQ_GOV_STOP:
600 mutex_lock(&dbs_mutex);
601 dbs_timer_exit(this_dbs_info); 591 dbs_timer_exit(this_dbs_info);
592
593 mutex_lock(&dbs_mutex);
602 sysfs_remove_group(&policy->kobj, &dbs_attr_group); 594 sysfs_remove_group(&policy->kobj, &dbs_attr_group);
603 dbs_enable--; 595 dbs_enable--;
596 mutex_destroy(&this_dbs_info->timer_mutex);
604 597
605 /* 598 /*
606 * Stop the timerschedule work, when this governor 599 * Stop the timerschedule work, when this governor
@@ -616,7 +609,7 @@ static int cpufreq_governor_dbs(struct cpufreq_policy *policy,
616 break; 609 break;
617 610
618 case CPUFREQ_GOV_LIMITS: 611 case CPUFREQ_GOV_LIMITS:
619 mutex_lock(&dbs_mutex); 612 mutex_lock(&this_dbs_info->timer_mutex);
620 if (policy->max < this_dbs_info->cur_policy->cur) 613 if (policy->max < this_dbs_info->cur_policy->cur)
621 __cpufreq_driver_target( 614 __cpufreq_driver_target(
622 this_dbs_info->cur_policy, 615 this_dbs_info->cur_policy,
@@ -625,7 +618,7 @@ static int cpufreq_governor_dbs(struct cpufreq_policy *policy,
625 __cpufreq_driver_target( 618 __cpufreq_driver_target(
626 this_dbs_info->cur_policy, 619 this_dbs_info->cur_policy,
627 policy->min, CPUFREQ_RELATION_L); 620 policy->min, CPUFREQ_RELATION_L);
628 mutex_unlock(&dbs_mutex); 621 mutex_unlock(&this_dbs_info->timer_mutex);
629 622
630 break; 623 break;
631 } 624 }
diff --git a/drivers/cpufreq/cpufreq_ondemand.c b/drivers/cpufreq/cpufreq_ondemand.c
index 1911d1729353..d6ba14276bb1 100644
--- a/drivers/cpufreq/cpufreq_ondemand.c
+++ b/drivers/cpufreq/cpufreq_ondemand.c
@@ -70,23 +70,21 @@ struct cpu_dbs_info_s {
70 unsigned int freq_lo_jiffies; 70 unsigned int freq_lo_jiffies;
71 unsigned int freq_hi_jiffies; 71 unsigned int freq_hi_jiffies;
72 int cpu; 72 int cpu;
73 unsigned int enable:1, 73 unsigned int sample_type:1;
74 sample_type:1; 74 /*
75 * percpu mutex that serializes governor limit change with
76 * do_dbs_timer invocation. We do not want do_dbs_timer to run
77 * when user is changing the governor or limits.
78 */
79 struct mutex timer_mutex;
75}; 80};
76static DEFINE_PER_CPU(struct cpu_dbs_info_s, cpu_dbs_info); 81static DEFINE_PER_CPU(struct cpu_dbs_info_s, cpu_dbs_info);
77 82
78static unsigned int dbs_enable; /* number of CPUs using this policy */ 83static unsigned int dbs_enable; /* number of CPUs using this policy */
79 84
80/* 85/*
81 * DEADLOCK ALERT! There is a ordering requirement between cpu_hotplug 86 * dbs_mutex protects data in dbs_tuners_ins from concurrent changes on
82 * lock and dbs_mutex. cpu_hotplug lock should always be held before 87 * different CPUs. It protects dbs_enable in governor start/stop.
83 * dbs_mutex. If any function that can potentially take cpu_hotplug lock
84 * (like __cpufreq_driver_target()) is being called with dbs_mutex taken, then
85 * cpu_hotplug lock should be taken before that. Note that cpu_hotplug lock
86 * is recursive for the same process. -Venki
87 * DEADLOCK ALERT! (2) : do_dbs_timer() must not take the dbs_mutex, because it
88 * would deadlock with cancel_delayed_work_sync(), which is needed for proper
89 * raceless workqueue teardown.
90 */ 88 */
91static DEFINE_MUTEX(dbs_mutex); 89static DEFINE_MUTEX(dbs_mutex);
92 90
@@ -192,13 +190,18 @@ static unsigned int powersave_bias_target(struct cpufreq_policy *policy,
192 return freq_hi; 190 return freq_hi;
193} 191}
194 192
193static void ondemand_powersave_bias_init_cpu(int cpu)
194{
195 struct cpu_dbs_info_s *dbs_info = &per_cpu(cpu_dbs_info, cpu);
196 dbs_info->freq_table = cpufreq_frequency_get_table(cpu);
197 dbs_info->freq_lo = 0;
198}
199
195static void ondemand_powersave_bias_init(void) 200static void ondemand_powersave_bias_init(void)
196{ 201{
197 int i; 202 int i;
198 for_each_online_cpu(i) { 203 for_each_online_cpu(i) {
199 struct cpu_dbs_info_s *dbs_info = &per_cpu(cpu_dbs_info, i); 204 ondemand_powersave_bias_init_cpu(i);
200 dbs_info->freq_table = cpufreq_frequency_get_table(i);
201 dbs_info->freq_lo = 0;
202 } 205 }
203} 206}
204 207
@@ -240,12 +243,10 @@ static ssize_t store_sampling_rate(struct cpufreq_policy *unused,
240 unsigned int input; 243 unsigned int input;
241 int ret; 244 int ret;
242 ret = sscanf(buf, "%u", &input); 245 ret = sscanf(buf, "%u", &input);
246 if (ret != 1)
247 return -EINVAL;
243 248
244 mutex_lock(&dbs_mutex); 249 mutex_lock(&dbs_mutex);
245 if (ret != 1) {
246 mutex_unlock(&dbs_mutex);
247 return -EINVAL;
248 }
249 dbs_tuners_ins.sampling_rate = max(input, min_sampling_rate); 250 dbs_tuners_ins.sampling_rate = max(input, min_sampling_rate);
250 mutex_unlock(&dbs_mutex); 251 mutex_unlock(&dbs_mutex);
251 252
@@ -259,13 +260,12 @@ static ssize_t store_up_threshold(struct cpufreq_policy *unused,
259 int ret; 260 int ret;
260 ret = sscanf(buf, "%u", &input); 261 ret = sscanf(buf, "%u", &input);
261 262
262 mutex_lock(&dbs_mutex);
263 if (ret != 1 || input > MAX_FREQUENCY_UP_THRESHOLD || 263 if (ret != 1 || input > MAX_FREQUENCY_UP_THRESHOLD ||
264 input < MIN_FREQUENCY_UP_THRESHOLD) { 264 input < MIN_FREQUENCY_UP_THRESHOLD) {
265 mutex_unlock(&dbs_mutex);
266 return -EINVAL; 265 return -EINVAL;
267 } 266 }
268 267
268 mutex_lock(&dbs_mutex);
269 dbs_tuners_ins.up_threshold = input; 269 dbs_tuners_ins.up_threshold = input;
270 mutex_unlock(&dbs_mutex); 270 mutex_unlock(&dbs_mutex);
271 271
@@ -363,9 +363,6 @@ static void dbs_check_cpu(struct cpu_dbs_info_s *this_dbs_info)
363 struct cpufreq_policy *policy; 363 struct cpufreq_policy *policy;
364 unsigned int j; 364 unsigned int j;
365 365
366 if (!this_dbs_info->enable)
367 return;
368
369 this_dbs_info->freq_lo = 0; 366 this_dbs_info->freq_lo = 0;
370 policy = this_dbs_info->cur_policy; 367 policy = this_dbs_info->cur_policy;
371 368
@@ -493,14 +490,7 @@ static void do_dbs_timer(struct work_struct *work)
493 int delay = usecs_to_jiffies(dbs_tuners_ins.sampling_rate); 490 int delay = usecs_to_jiffies(dbs_tuners_ins.sampling_rate);
494 491
495 delay -= jiffies % delay; 492 delay -= jiffies % delay;
496 493 mutex_lock(&dbs_info->timer_mutex);
497 if (lock_policy_rwsem_write(cpu) < 0)
498 return;
499
500 if (!dbs_info->enable) {
501 unlock_policy_rwsem_write(cpu);
502 return;
503 }
504 494
505 /* Common NORMAL_SAMPLE setup */ 495 /* Common NORMAL_SAMPLE setup */
506 dbs_info->sample_type = DBS_NORMAL_SAMPLE; 496 dbs_info->sample_type = DBS_NORMAL_SAMPLE;
@@ -517,7 +507,7 @@ static void do_dbs_timer(struct work_struct *work)
517 dbs_info->freq_lo, CPUFREQ_RELATION_H); 507 dbs_info->freq_lo, CPUFREQ_RELATION_H);
518 } 508 }
519 queue_delayed_work_on(cpu, kondemand_wq, &dbs_info->work, delay); 509 queue_delayed_work_on(cpu, kondemand_wq, &dbs_info->work, delay);
520 unlock_policy_rwsem_write(cpu); 510 mutex_unlock(&dbs_info->timer_mutex);
521} 511}
522 512
523static inline void dbs_timer_init(struct cpu_dbs_info_s *dbs_info) 513static inline void dbs_timer_init(struct cpu_dbs_info_s *dbs_info)
@@ -526,8 +516,6 @@ static inline void dbs_timer_init(struct cpu_dbs_info_s *dbs_info)
526 int delay = usecs_to_jiffies(dbs_tuners_ins.sampling_rate); 516 int delay = usecs_to_jiffies(dbs_tuners_ins.sampling_rate);
527 delay -= jiffies % delay; 517 delay -= jiffies % delay;
528 518
529 dbs_info->enable = 1;
530 ondemand_powersave_bias_init();
531 dbs_info->sample_type = DBS_NORMAL_SAMPLE; 519 dbs_info->sample_type = DBS_NORMAL_SAMPLE;
532 INIT_DELAYED_WORK_DEFERRABLE(&dbs_info->work, do_dbs_timer); 520 INIT_DELAYED_WORK_DEFERRABLE(&dbs_info->work, do_dbs_timer);
533 queue_delayed_work_on(dbs_info->cpu, kondemand_wq, &dbs_info->work, 521 queue_delayed_work_on(dbs_info->cpu, kondemand_wq, &dbs_info->work,
@@ -536,7 +524,6 @@ static inline void dbs_timer_init(struct cpu_dbs_info_s *dbs_info)
536 524
537static inline void dbs_timer_exit(struct cpu_dbs_info_s *dbs_info) 525static inline void dbs_timer_exit(struct cpu_dbs_info_s *dbs_info)
538{ 526{
539 dbs_info->enable = 0;
540 cancel_delayed_work_sync(&dbs_info->work); 527 cancel_delayed_work_sync(&dbs_info->work);
541} 528}
542 529
@@ -555,19 +542,15 @@ static int cpufreq_governor_dbs(struct cpufreq_policy *policy,
555 if ((!cpu_online(cpu)) || (!policy->cur)) 542 if ((!cpu_online(cpu)) || (!policy->cur))
556 return -EINVAL; 543 return -EINVAL;
557 544
558 if (this_dbs_info->enable) /* Already enabled */
559 break;
560
561 mutex_lock(&dbs_mutex); 545 mutex_lock(&dbs_mutex);
562 dbs_enable++;
563 546
564 rc = sysfs_create_group(&policy->kobj, &dbs_attr_group); 547 rc = sysfs_create_group(&policy->kobj, &dbs_attr_group);
565 if (rc) { 548 if (rc) {
566 dbs_enable--;
567 mutex_unlock(&dbs_mutex); 549 mutex_unlock(&dbs_mutex);
568 return rc; 550 return rc;
569 } 551 }
570 552
553 dbs_enable++;
571 for_each_cpu(j, policy->cpus) { 554 for_each_cpu(j, policy->cpus) {
572 struct cpu_dbs_info_s *j_dbs_info; 555 struct cpu_dbs_info_s *j_dbs_info;
573 j_dbs_info = &per_cpu(cpu_dbs_info, j); 556 j_dbs_info = &per_cpu(cpu_dbs_info, j);
@@ -581,6 +564,8 @@ static int cpufreq_governor_dbs(struct cpufreq_policy *policy,
581 } 564 }
582 } 565 }
583 this_dbs_info->cpu = cpu; 566 this_dbs_info->cpu = cpu;
567 ondemand_powersave_bias_init_cpu(cpu);
568 mutex_init(&this_dbs_info->timer_mutex);
584 /* 569 /*
585 * Start the timerschedule work, when this governor 570 * Start the timerschedule work, when this governor
586 * is used for first time 571 * is used for first time
@@ -598,29 +583,31 @@ static int cpufreq_governor_dbs(struct cpufreq_policy *policy,
598 max(min_sampling_rate, 583 max(min_sampling_rate,
599 latency * LATENCY_MULTIPLIER); 584 latency * LATENCY_MULTIPLIER);
600 } 585 }
601 dbs_timer_init(this_dbs_info);
602
603 mutex_unlock(&dbs_mutex); 586 mutex_unlock(&dbs_mutex);
587
588 dbs_timer_init(this_dbs_info);
604 break; 589 break;
605 590
606 case CPUFREQ_GOV_STOP: 591 case CPUFREQ_GOV_STOP:
607 mutex_lock(&dbs_mutex);
608 dbs_timer_exit(this_dbs_info); 592 dbs_timer_exit(this_dbs_info);
593
594 mutex_lock(&dbs_mutex);
609 sysfs_remove_group(&policy->kobj, &dbs_attr_group); 595 sysfs_remove_group(&policy->kobj, &dbs_attr_group);
596 mutex_destroy(&this_dbs_info->timer_mutex);
610 dbs_enable--; 597 dbs_enable--;
611 mutex_unlock(&dbs_mutex); 598 mutex_unlock(&dbs_mutex);
612 599
613 break; 600 break;
614 601
615 case CPUFREQ_GOV_LIMITS: 602 case CPUFREQ_GOV_LIMITS:
616 mutex_lock(&dbs_mutex); 603 mutex_lock(&this_dbs_info->timer_mutex);
617 if (policy->max < this_dbs_info->cur_policy->cur) 604 if (policy->max < this_dbs_info->cur_policy->cur)
618 __cpufreq_driver_target(this_dbs_info->cur_policy, 605 __cpufreq_driver_target(this_dbs_info->cur_policy,
619 policy->max, CPUFREQ_RELATION_H); 606 policy->max, CPUFREQ_RELATION_H);
620 else if (policy->min > this_dbs_info->cur_policy->cur) 607 else if (policy->min > this_dbs_info->cur_policy->cur)
621 __cpufreq_driver_target(this_dbs_info->cur_policy, 608 __cpufreq_driver_target(this_dbs_info->cur_policy,
622 policy->min, CPUFREQ_RELATION_L); 609 policy->min, CPUFREQ_RELATION_L);
623 mutex_unlock(&dbs_mutex); 610 mutex_unlock(&this_dbs_info->timer_mutex);
624 break; 611 break;
625 } 612 }
626 return 0; 613 return 0;
diff --git a/drivers/dma/Kconfig b/drivers/dma/Kconfig
index 070357aaedbc..81e1020fb514 100644
--- a/drivers/dma/Kconfig
+++ b/drivers/dma/Kconfig
@@ -4,7 +4,7 @@
4 4
5menuconfig DMADEVICES 5menuconfig DMADEVICES
6 bool "DMA Engine support" 6 bool "DMA Engine support"
7 depends on !HIGHMEM64G && HAS_DMA 7 depends on HAS_DMA
8 help 8 help
9 DMA engines can do asynchronous data transfers without 9 DMA engines can do asynchronous data transfers without
10 involving the host CPU. Currently, this framework can be 10 involving the host CPU. Currently, this framework can be
@@ -46,6 +46,14 @@ config DW_DMAC
46 Support the Synopsys DesignWare AHB DMA controller. This 46 Support the Synopsys DesignWare AHB DMA controller. This
47 can be integrated in chips such as the Atmel AT32ap7000. 47 can be integrated in chips such as the Atmel AT32ap7000.
48 48
49config AT_HDMAC
50 tristate "Atmel AHB DMA support"
51 depends on ARCH_AT91SAM9RL
52 select DMA_ENGINE
53 help
54 Support the Atmel AHB DMA controller. This can be integrated in
55 chips such as the Atmel AT91SAM9RL.
56
49config FSL_DMA 57config FSL_DMA
50 tristate "Freescale Elo and Elo Plus DMA support" 58 tristate "Freescale Elo and Elo Plus DMA support"
51 depends on FSL_SOC 59 depends on FSL_SOC
@@ -108,7 +116,7 @@ config NET_DMA
108 116
109config ASYNC_TX_DMA 117config ASYNC_TX_DMA
110 bool "Async_tx: Offload support for the async_tx api" 118 bool "Async_tx: Offload support for the async_tx api"
111 depends on DMA_ENGINE 119 depends on DMA_ENGINE && !HIGHMEM64G
112 help 120 help
113 This allows the async_tx api to take advantage of offload engines for 121 This allows the async_tx api to take advantage of offload engines for
114 memcpy, memset, xor, and raid6 p+q operations. If your platform has 122 memcpy, memset, xor, and raid6 p+q operations. If your platform has
diff --git a/drivers/dma/Makefile b/drivers/dma/Makefile
index a0b6564800c4..40e1e0083571 100644
--- a/drivers/dma/Makefile
+++ b/drivers/dma/Makefile
@@ -7,5 +7,6 @@ obj-$(CONFIG_INTEL_IOP_ADMA) += iop-adma.o
7obj-$(CONFIG_FSL_DMA) += fsldma.o 7obj-$(CONFIG_FSL_DMA) += fsldma.o
8obj-$(CONFIG_MV_XOR) += mv_xor.o 8obj-$(CONFIG_MV_XOR) += mv_xor.o
9obj-$(CONFIG_DW_DMAC) += dw_dmac.o 9obj-$(CONFIG_DW_DMAC) += dw_dmac.o
10obj-$(CONFIG_AT_HDMAC) += at_hdmac.o
10obj-$(CONFIG_MX3_IPU) += ipu/ 11obj-$(CONFIG_MX3_IPU) += ipu/
11obj-$(CONFIG_TXX9_DMAC) += txx9dmac.o 12obj-$(CONFIG_TXX9_DMAC) += txx9dmac.o
diff --git a/drivers/dma/at_hdmac.c b/drivers/dma/at_hdmac.c
new file mode 100644
index 000000000000..9a1e5fb412ed
--- /dev/null
+++ b/drivers/dma/at_hdmac.c
@@ -0,0 +1,1213 @@
1/*
2 * Driver for the Atmel AHB DMA Controller (aka HDMA or DMAC on AT91 systems)
3 *
4 * Copyright (C) 2008 Atmel Corporation
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 *
12 * This supports the Atmel AHB DMA Controller,
13 *
14 * The driver has currently been tested with the Atmel AT91SAM9RL
15 * and AT91SAM9G45 series.
16 */
17
18#include <linux/clk.h>
19#include <linux/dmaengine.h>
20#include <linux/dma-mapping.h>
21#include <linux/dmapool.h>
22#include <linux/interrupt.h>
23#include <linux/module.h>
24#include <linux/platform_device.h>
25
26#include "at_hdmac_regs.h"
27
28/*
29 * Glossary
30 * --------
31 *
32 * at_hdmac : Name of the ATmel AHB DMA Controller
33 * at_dma_ / atdma : ATmel DMA controller entity related
34 * atc_ / atchan : ATmel DMA Channel entity related
35 */
36
37#define ATC_DEFAULT_CFG (ATC_FIFOCFG_HALFFIFO)
38#define ATC_DEFAULT_CTRLA (0)
39#define ATC_DEFAULT_CTRLB (ATC_SIF(0) \
40 |ATC_DIF(1))
41
42/*
43 * Initial number of descriptors to allocate for each channel. This could
44 * be increased during dma usage.
45 */
46static unsigned int init_nr_desc_per_channel = 64;
47module_param(init_nr_desc_per_channel, uint, 0644);
48MODULE_PARM_DESC(init_nr_desc_per_channel,
49 "initial descriptors per channel (default: 64)");
50
51
52/* prototypes */
53static dma_cookie_t atc_tx_submit(struct dma_async_tx_descriptor *tx);
54
55
56/*----------------------------------------------------------------------*/
57
58static struct at_desc *atc_first_active(struct at_dma_chan *atchan)
59{
60 return list_first_entry(&atchan->active_list,
61 struct at_desc, desc_node);
62}
63
64static struct at_desc *atc_first_queued(struct at_dma_chan *atchan)
65{
66 return list_first_entry(&atchan->queue,
67 struct at_desc, desc_node);
68}
69
70/**
71 * atc_alloc_descriptor - allocate and return an initilized descriptor
72 * @chan: the channel to allocate descriptors for
73 * @gfp_flags: GFP allocation flags
74 *
75 * Note: The ack-bit is positioned in the descriptor flag at creation time
76 * to make initial allocation more convenient. This bit will be cleared
77 * and control will be given to client at usage time (during
78 * preparation functions).
79 */
80static struct at_desc *atc_alloc_descriptor(struct dma_chan *chan,
81 gfp_t gfp_flags)
82{
83 struct at_desc *desc = NULL;
84 struct at_dma *atdma = to_at_dma(chan->device);
85 dma_addr_t phys;
86
87 desc = dma_pool_alloc(atdma->dma_desc_pool, gfp_flags, &phys);
88 if (desc) {
89 memset(desc, 0, sizeof(struct at_desc));
90 dma_async_tx_descriptor_init(&desc->txd, chan);
91 /* txd.flags will be overwritten in prep functions */
92 desc->txd.flags = DMA_CTRL_ACK;
93 desc->txd.tx_submit = atc_tx_submit;
94 desc->txd.phys = phys;
95 }
96
97 return desc;
98}
99
100/**
101 * atc_desc_get - get a unsused descriptor from free_list
102 * @atchan: channel we want a new descriptor for
103 */
104static struct at_desc *atc_desc_get(struct at_dma_chan *atchan)
105{
106 struct at_desc *desc, *_desc;
107 struct at_desc *ret = NULL;
108 unsigned int i = 0;
109 LIST_HEAD(tmp_list);
110
111 spin_lock_bh(&atchan->lock);
112 list_for_each_entry_safe(desc, _desc, &atchan->free_list, desc_node) {
113 i++;
114 if (async_tx_test_ack(&desc->txd)) {
115 list_del(&desc->desc_node);
116 ret = desc;
117 break;
118 }
119 dev_dbg(chan2dev(&atchan->chan_common),
120 "desc %p not ACKed\n", desc);
121 }
122 spin_unlock_bh(&atchan->lock);
123 dev_vdbg(chan2dev(&atchan->chan_common),
124 "scanned %u descriptors on freelist\n", i);
125
126 /* no more descriptor available in initial pool: create one more */
127 if (!ret) {
128 ret = atc_alloc_descriptor(&atchan->chan_common, GFP_ATOMIC);
129 if (ret) {
130 spin_lock_bh(&atchan->lock);
131 atchan->descs_allocated++;
132 spin_unlock_bh(&atchan->lock);
133 } else {
134 dev_err(chan2dev(&atchan->chan_common),
135 "not enough descriptors available\n");
136 }
137 }
138
139 return ret;
140}
141
142/**
143 * atc_desc_put - move a descriptor, including any children, to the free list
144 * @atchan: channel we work on
145 * @desc: descriptor, at the head of a chain, to move to free list
146 */
147static void atc_desc_put(struct at_dma_chan *atchan, struct at_desc *desc)
148{
149 if (desc) {
150 struct at_desc *child;
151
152 spin_lock_bh(&atchan->lock);
153 list_for_each_entry(child, &desc->txd.tx_list, desc_node)
154 dev_vdbg(chan2dev(&atchan->chan_common),
155 "moving child desc %p to freelist\n",
156 child);
157 list_splice_init(&desc->txd.tx_list, &atchan->free_list);
158 dev_vdbg(chan2dev(&atchan->chan_common),
159 "moving desc %p to freelist\n", desc);
160 list_add(&desc->desc_node, &atchan->free_list);
161 spin_unlock_bh(&atchan->lock);
162 }
163}
164
165/**
166 * atc_assign_cookie - compute and assign new cookie
167 * @atchan: channel we work on
168 * @desc: descriptor to asign cookie for
169 *
170 * Called with atchan->lock held and bh disabled
171 */
172static dma_cookie_t
173atc_assign_cookie(struct at_dma_chan *atchan, struct at_desc *desc)
174{
175 dma_cookie_t cookie = atchan->chan_common.cookie;
176
177 if (++cookie < 0)
178 cookie = 1;
179
180 atchan->chan_common.cookie = cookie;
181 desc->txd.cookie = cookie;
182
183 return cookie;
184}
185
186/**
187 * atc_dostart - starts the DMA engine for real
188 * @atchan: the channel we want to start
189 * @first: first descriptor in the list we want to begin with
190 *
191 * Called with atchan->lock held and bh disabled
192 */
193static void atc_dostart(struct at_dma_chan *atchan, struct at_desc *first)
194{
195 struct at_dma *atdma = to_at_dma(atchan->chan_common.device);
196
197 /* ASSERT: channel is idle */
198 if (atc_chan_is_enabled(atchan)) {
199 dev_err(chan2dev(&atchan->chan_common),
200 "BUG: Attempted to start non-idle channel\n");
201 dev_err(chan2dev(&atchan->chan_common),
202 " channel: s0x%x d0x%x ctrl0x%x:0x%x l0x%x\n",
203 channel_readl(atchan, SADDR),
204 channel_readl(atchan, DADDR),
205 channel_readl(atchan, CTRLA),
206 channel_readl(atchan, CTRLB),
207 channel_readl(atchan, DSCR));
208
209 /* The tasklet will hopefully advance the queue... */
210 return;
211 }
212
213 vdbg_dump_regs(atchan);
214
215 /* clear any pending interrupt */
216 while (dma_readl(atdma, EBCISR))
217 cpu_relax();
218
219 channel_writel(atchan, SADDR, 0);
220 channel_writel(atchan, DADDR, 0);
221 channel_writel(atchan, CTRLA, 0);
222 channel_writel(atchan, CTRLB, 0);
223 channel_writel(atchan, DSCR, first->txd.phys);
224 dma_writel(atdma, CHER, atchan->mask);
225
226 vdbg_dump_regs(atchan);
227}
228
229/**
230 * atc_chain_complete - finish work for one transaction chain
231 * @atchan: channel we work on
232 * @desc: descriptor at the head of the chain we want do complete
233 *
234 * Called with atchan->lock held and bh disabled */
235static void
236atc_chain_complete(struct at_dma_chan *atchan, struct at_desc *desc)
237{
238 dma_async_tx_callback callback;
239 void *param;
240 struct dma_async_tx_descriptor *txd = &desc->txd;
241
242 dev_vdbg(chan2dev(&atchan->chan_common),
243 "descriptor %u complete\n", txd->cookie);
244
245 atchan->completed_cookie = txd->cookie;
246 callback = txd->callback;
247 param = txd->callback_param;
248
249 /* move children to free_list */
250 list_splice_init(&txd->tx_list, &atchan->free_list);
251 /* move myself to free_list */
252 list_move(&desc->desc_node, &atchan->free_list);
253
254 /* unmap dma addresses */
255 if (!(txd->flags & DMA_COMPL_SKIP_DEST_UNMAP)) {
256 if (txd->flags & DMA_COMPL_DEST_UNMAP_SINGLE)
257 dma_unmap_single(chan2parent(&atchan->chan_common),
258 desc->lli.daddr,
259 desc->len, DMA_FROM_DEVICE);
260 else
261 dma_unmap_page(chan2parent(&atchan->chan_common),
262 desc->lli.daddr,
263 desc->len, DMA_FROM_DEVICE);
264 }
265 if (!(txd->flags & DMA_COMPL_SKIP_SRC_UNMAP)) {
266 if (txd->flags & DMA_COMPL_SRC_UNMAP_SINGLE)
267 dma_unmap_single(chan2parent(&atchan->chan_common),
268 desc->lli.saddr,
269 desc->len, DMA_TO_DEVICE);
270 else
271 dma_unmap_page(chan2parent(&atchan->chan_common),
272 desc->lli.saddr,
273 desc->len, DMA_TO_DEVICE);
274 }
275
276 /*
277 * The API requires that no submissions are done from a
278 * callback, so we don't need to drop the lock here
279 */
280 if (callback)
281 callback(param);
282
283 dma_run_dependencies(txd);
284}
285
286/**
287 * atc_complete_all - finish work for all transactions
288 * @atchan: channel to complete transactions for
289 *
290 * Eventually submit queued descriptors if any
291 *
292 * Assume channel is idle while calling this function
293 * Called with atchan->lock held and bh disabled
294 */
295static void atc_complete_all(struct at_dma_chan *atchan)
296{
297 struct at_desc *desc, *_desc;
298 LIST_HEAD(list);
299
300 dev_vdbg(chan2dev(&atchan->chan_common), "complete all\n");
301
302 BUG_ON(atc_chan_is_enabled(atchan));
303
304 /*
305 * Submit queued descriptors ASAP, i.e. before we go through
306 * the completed ones.
307 */
308 if (!list_empty(&atchan->queue))
309 atc_dostart(atchan, atc_first_queued(atchan));
310 /* empty active_list now it is completed */
311 list_splice_init(&atchan->active_list, &list);
312 /* empty queue list by moving descriptors (if any) to active_list */
313 list_splice_init(&atchan->queue, &atchan->active_list);
314
315 list_for_each_entry_safe(desc, _desc, &list, desc_node)
316 atc_chain_complete(atchan, desc);
317}
318
319/**
320 * atc_cleanup_descriptors - cleanup up finished descriptors in active_list
321 * @atchan: channel to be cleaned up
322 *
323 * Called with atchan->lock held and bh disabled
324 */
325static void atc_cleanup_descriptors(struct at_dma_chan *atchan)
326{
327 struct at_desc *desc, *_desc;
328 struct at_desc *child;
329
330 dev_vdbg(chan2dev(&atchan->chan_common), "cleanup descriptors\n");
331
332 list_for_each_entry_safe(desc, _desc, &atchan->active_list, desc_node) {
333 if (!(desc->lli.ctrla & ATC_DONE))
334 /* This one is currently in progress */
335 return;
336
337 list_for_each_entry(child, &desc->txd.tx_list, desc_node)
338 if (!(child->lli.ctrla & ATC_DONE))
339 /* Currently in progress */
340 return;
341
342 /*
343 * No descriptors so far seem to be in progress, i.e.
344 * this chain must be done.
345 */
346 atc_chain_complete(atchan, desc);
347 }
348}
349
350/**
351 * atc_advance_work - at the end of a transaction, move forward
352 * @atchan: channel where the transaction ended
353 *
354 * Called with atchan->lock held and bh disabled
355 */
356static void atc_advance_work(struct at_dma_chan *atchan)
357{
358 dev_vdbg(chan2dev(&atchan->chan_common), "advance_work\n");
359
360 if (list_empty(&atchan->active_list) ||
361 list_is_singular(&atchan->active_list)) {
362 atc_complete_all(atchan);
363 } else {
364 atc_chain_complete(atchan, atc_first_active(atchan));
365 /* advance work */
366 atc_dostart(atchan, atc_first_active(atchan));
367 }
368}
369
370
371/**
372 * atc_handle_error - handle errors reported by DMA controller
373 * @atchan: channel where error occurs
374 *
375 * Called with atchan->lock held and bh disabled
376 */
377static void atc_handle_error(struct at_dma_chan *atchan)
378{
379 struct at_desc *bad_desc;
380 struct at_desc *child;
381
382 /*
383 * The descriptor currently at the head of the active list is
384 * broked. Since we don't have any way to report errors, we'll
385 * just have to scream loudly and try to carry on.
386 */
387 bad_desc = atc_first_active(atchan);
388 list_del_init(&bad_desc->desc_node);
389
390 /* As we are stopped, take advantage to push queued descriptors
391 * in active_list */
392 list_splice_init(&atchan->queue, atchan->active_list.prev);
393
394 /* Try to restart the controller */
395 if (!list_empty(&atchan->active_list))
396 atc_dostart(atchan, atc_first_active(atchan));
397
398 /*
399 * KERN_CRITICAL may seem harsh, but since this only happens
400 * when someone submits a bad physical address in a
401 * descriptor, we should consider ourselves lucky that the
402 * controller flagged an error instead of scribbling over
403 * random memory locations.
404 */
405 dev_crit(chan2dev(&atchan->chan_common),
406 "Bad descriptor submitted for DMA!\n");
407 dev_crit(chan2dev(&atchan->chan_common),
408 " cookie: %d\n", bad_desc->txd.cookie);
409 atc_dump_lli(atchan, &bad_desc->lli);
410 list_for_each_entry(child, &bad_desc->txd.tx_list, desc_node)
411 atc_dump_lli(atchan, &child->lli);
412
413 /* Pretend the descriptor completed successfully */
414 atc_chain_complete(atchan, bad_desc);
415}
416
417
418/*-- IRQ & Tasklet ---------------------------------------------------*/
419
420static void atc_tasklet(unsigned long data)
421{
422 struct at_dma_chan *atchan = (struct at_dma_chan *)data;
423
424 /* Channel cannot be enabled here */
425 if (atc_chan_is_enabled(atchan)) {
426 dev_err(chan2dev(&atchan->chan_common),
427 "BUG: channel enabled in tasklet\n");
428 return;
429 }
430
431 spin_lock(&atchan->lock);
432 if (test_and_clear_bit(0, &atchan->error_status))
433 atc_handle_error(atchan);
434 else
435 atc_advance_work(atchan);
436
437 spin_unlock(&atchan->lock);
438}
439
440static irqreturn_t at_dma_interrupt(int irq, void *dev_id)
441{
442 struct at_dma *atdma = (struct at_dma *)dev_id;
443 struct at_dma_chan *atchan;
444 int i;
445 u32 status, pending, imr;
446 int ret = IRQ_NONE;
447
448 do {
449 imr = dma_readl(atdma, EBCIMR);
450 status = dma_readl(atdma, EBCISR);
451 pending = status & imr;
452
453 if (!pending)
454 break;
455
456 dev_vdbg(atdma->dma_common.dev,
457 "interrupt: status = 0x%08x, 0x%08x, 0x%08x\n",
458 status, imr, pending);
459
460 for (i = 0; i < atdma->dma_common.chancnt; i++) {
461 atchan = &atdma->chan[i];
462 if (pending & (AT_DMA_CBTC(i) | AT_DMA_ERR(i))) {
463 if (pending & AT_DMA_ERR(i)) {
464 /* Disable channel on AHB error */
465 dma_writel(atdma, CHDR, atchan->mask);
466 /* Give information to tasklet */
467 set_bit(0, &atchan->error_status);
468 }
469 tasklet_schedule(&atchan->tasklet);
470 ret = IRQ_HANDLED;
471 }
472 }
473
474 } while (pending);
475
476 return ret;
477}
478
479
480/*-- DMA Engine API --------------------------------------------------*/
481
482/**
483 * atc_tx_submit - set the prepared descriptor(s) to be executed by the engine
484 * @desc: descriptor at the head of the transaction chain
485 *
486 * Queue chain if DMA engine is working already
487 *
488 * Cookie increment and adding to active_list or queue must be atomic
489 */
490static dma_cookie_t atc_tx_submit(struct dma_async_tx_descriptor *tx)
491{
492 struct at_desc *desc = txd_to_at_desc(tx);
493 struct at_dma_chan *atchan = to_at_dma_chan(tx->chan);
494 dma_cookie_t cookie;
495
496 spin_lock_bh(&atchan->lock);
497 cookie = atc_assign_cookie(atchan, desc);
498
499 if (list_empty(&atchan->active_list)) {
500 dev_vdbg(chan2dev(tx->chan), "tx_submit: started %u\n",
501 desc->txd.cookie);
502 atc_dostart(atchan, desc);
503 list_add_tail(&desc->desc_node, &atchan->active_list);
504 } else {
505 dev_vdbg(chan2dev(tx->chan), "tx_submit: queued %u\n",
506 desc->txd.cookie);
507 list_add_tail(&desc->desc_node, &atchan->queue);
508 }
509
510 spin_unlock_bh(&atchan->lock);
511
512 return cookie;
513}
514
515/**
516 * atc_prep_dma_memcpy - prepare a memcpy operation
517 * @chan: the channel to prepare operation on
518 * @dest: operation virtual destination address
519 * @src: operation virtual source address
520 * @len: operation length
521 * @flags: tx descriptor status flags
522 */
523static struct dma_async_tx_descriptor *
524atc_prep_dma_memcpy(struct dma_chan *chan, dma_addr_t dest, dma_addr_t src,
525 size_t len, unsigned long flags)
526{
527 struct at_dma_chan *atchan = to_at_dma_chan(chan);
528 struct at_desc *desc = NULL;
529 struct at_desc *first = NULL;
530 struct at_desc *prev = NULL;
531 size_t xfer_count;
532 size_t offset;
533 unsigned int src_width;
534 unsigned int dst_width;
535 u32 ctrla;
536 u32 ctrlb;
537
538 dev_vdbg(chan2dev(chan), "prep_dma_memcpy: d0x%x s0x%x l0x%zx f0x%lx\n",
539 dest, src, len, flags);
540
541 if (unlikely(!len)) {
542 dev_dbg(chan2dev(chan), "prep_dma_memcpy: length is zero!\n");
543 return NULL;
544 }
545
546 ctrla = ATC_DEFAULT_CTRLA;
547 ctrlb = ATC_DEFAULT_CTRLB
548 | ATC_SRC_ADDR_MODE_INCR
549 | ATC_DST_ADDR_MODE_INCR
550 | ATC_FC_MEM2MEM;
551
552 /*
553 * We can be a lot more clever here, but this should take care
554 * of the most common optimization.
555 */
556 if (!((src | dest | len) & 3)) {
557 ctrla |= ATC_SRC_WIDTH_WORD | ATC_DST_WIDTH_WORD;
558 src_width = dst_width = 2;
559 } else if (!((src | dest | len) & 1)) {
560 ctrla |= ATC_SRC_WIDTH_HALFWORD | ATC_DST_WIDTH_HALFWORD;
561 src_width = dst_width = 1;
562 } else {
563 ctrla |= ATC_SRC_WIDTH_BYTE | ATC_DST_WIDTH_BYTE;
564 src_width = dst_width = 0;
565 }
566
567 for (offset = 0; offset < len; offset += xfer_count << src_width) {
568 xfer_count = min_t(size_t, (len - offset) >> src_width,
569 ATC_BTSIZE_MAX);
570
571 desc = atc_desc_get(atchan);
572 if (!desc)
573 goto err_desc_get;
574
575 desc->lli.saddr = src + offset;
576 desc->lli.daddr = dest + offset;
577 desc->lli.ctrla = ctrla | xfer_count;
578 desc->lli.ctrlb = ctrlb;
579
580 desc->txd.cookie = 0;
581 async_tx_ack(&desc->txd);
582
583 if (!first) {
584 first = desc;
585 } else {
586 /* inform the HW lli about chaining */
587 prev->lli.dscr = desc->txd.phys;
588 /* insert the link descriptor to the LD ring */
589 list_add_tail(&desc->desc_node,
590 &first->txd.tx_list);
591 }
592 prev = desc;
593 }
594
595 /* First descriptor of the chain embedds additional information */
596 first->txd.cookie = -EBUSY;
597 first->len = len;
598
599 /* set end-of-link to the last link descriptor of list*/
600 set_desc_eol(desc);
601
602 desc->txd.flags = flags; /* client is in control of this ack */
603
604 return &first->txd;
605
606err_desc_get:
607 atc_desc_put(atchan, first);
608 return NULL;
609}
610
611
612/**
613 * atc_prep_slave_sg - prepare descriptors for a DMA_SLAVE transaction
614 * @chan: DMA channel
615 * @sgl: scatterlist to transfer to/from
616 * @sg_len: number of entries in @scatterlist
617 * @direction: DMA direction
618 * @flags: tx descriptor status flags
619 */
620static struct dma_async_tx_descriptor *
621atc_prep_slave_sg(struct dma_chan *chan, struct scatterlist *sgl,
622 unsigned int sg_len, enum dma_data_direction direction,
623 unsigned long flags)
624{
625 struct at_dma_chan *atchan = to_at_dma_chan(chan);
626 struct at_dma_slave *atslave = chan->private;
627 struct at_desc *first = NULL;
628 struct at_desc *prev = NULL;
629 u32 ctrla;
630 u32 ctrlb;
631 dma_addr_t reg;
632 unsigned int reg_width;
633 unsigned int mem_width;
634 unsigned int i;
635 struct scatterlist *sg;
636 size_t total_len = 0;
637
638 dev_vdbg(chan2dev(chan), "prep_slave_sg: %s f0x%lx\n",
639 direction == DMA_TO_DEVICE ? "TO DEVICE" : "FROM DEVICE",
640 flags);
641
642 if (unlikely(!atslave || !sg_len)) {
643 dev_dbg(chan2dev(chan), "prep_dma_memcpy: length is zero!\n");
644 return NULL;
645 }
646
647 reg_width = atslave->reg_width;
648
649 sg_len = dma_map_sg(chan2parent(chan), sgl, sg_len, direction);
650
651 ctrla = ATC_DEFAULT_CTRLA | atslave->ctrla;
652 ctrlb = ATC_DEFAULT_CTRLB | ATC_IEN;
653
654 switch (direction) {
655 case DMA_TO_DEVICE:
656 ctrla |= ATC_DST_WIDTH(reg_width);
657 ctrlb |= ATC_DST_ADDR_MODE_FIXED
658 | ATC_SRC_ADDR_MODE_INCR
659 | ATC_FC_MEM2PER;
660 reg = atslave->tx_reg;
661 for_each_sg(sgl, sg, sg_len, i) {
662 struct at_desc *desc;
663 u32 len;
664 u32 mem;
665
666 desc = atc_desc_get(atchan);
667 if (!desc)
668 goto err_desc_get;
669
670 mem = sg_phys(sg);
671 len = sg_dma_len(sg);
672 mem_width = 2;
673 if (unlikely(mem & 3 || len & 3))
674 mem_width = 0;
675
676 desc->lli.saddr = mem;
677 desc->lli.daddr = reg;
678 desc->lli.ctrla = ctrla
679 | ATC_SRC_WIDTH(mem_width)
680 | len >> mem_width;
681 desc->lli.ctrlb = ctrlb;
682
683 if (!first) {
684 first = desc;
685 } else {
686 /* inform the HW lli about chaining */
687 prev->lli.dscr = desc->txd.phys;
688 /* insert the link descriptor to the LD ring */
689 list_add_tail(&desc->desc_node,
690 &first->txd.tx_list);
691 }
692 prev = desc;
693 total_len += len;
694 }
695 break;
696 case DMA_FROM_DEVICE:
697 ctrla |= ATC_SRC_WIDTH(reg_width);
698 ctrlb |= ATC_DST_ADDR_MODE_INCR
699 | ATC_SRC_ADDR_MODE_FIXED
700 | ATC_FC_PER2MEM;
701
702 reg = atslave->rx_reg;
703 for_each_sg(sgl, sg, sg_len, i) {
704 struct at_desc *desc;
705 u32 len;
706 u32 mem;
707
708 desc = atc_desc_get(atchan);
709 if (!desc)
710 goto err_desc_get;
711
712 mem = sg_phys(sg);
713 len = sg_dma_len(sg);
714 mem_width = 2;
715 if (unlikely(mem & 3 || len & 3))
716 mem_width = 0;
717
718 desc->lli.saddr = reg;
719 desc->lli.daddr = mem;
720 desc->lli.ctrla = ctrla
721 | ATC_DST_WIDTH(mem_width)
722 | len >> mem_width;
723 desc->lli.ctrlb = ctrlb;
724
725 if (!first) {
726 first = desc;
727 } else {
728 /* inform the HW lli about chaining */
729 prev->lli.dscr = desc->txd.phys;
730 /* insert the link descriptor to the LD ring */
731 list_add_tail(&desc->desc_node,
732 &first->txd.tx_list);
733 }
734 prev = desc;
735 total_len += len;
736 }
737 break;
738 default:
739 return NULL;
740 }
741
742 /* set end-of-link to the last link descriptor of list*/
743 set_desc_eol(prev);
744
745 /* First descriptor of the chain embedds additional information */
746 first->txd.cookie = -EBUSY;
747 first->len = total_len;
748
749 /* last link descriptor of list is responsible of flags */
750 prev->txd.flags = flags; /* client is in control of this ack */
751
752 return &first->txd;
753
754err_desc_get:
755 dev_err(chan2dev(chan), "not enough descriptors available\n");
756 atc_desc_put(atchan, first);
757 return NULL;
758}
759
760static void atc_terminate_all(struct dma_chan *chan)
761{
762 struct at_dma_chan *atchan = to_at_dma_chan(chan);
763 struct at_dma *atdma = to_at_dma(chan->device);
764 struct at_desc *desc, *_desc;
765 LIST_HEAD(list);
766
767 /*
768 * This is only called when something went wrong elsewhere, so
769 * we don't really care about the data. Just disable the
770 * channel. We still have to poll the channel enable bit due
771 * to AHB/HSB limitations.
772 */
773 spin_lock_bh(&atchan->lock);
774
775 dma_writel(atdma, CHDR, atchan->mask);
776
777 /* confirm that this channel is disabled */
778 while (dma_readl(atdma, CHSR) & atchan->mask)
779 cpu_relax();
780
781 /* active_list entries will end up before queued entries */
782 list_splice_init(&atchan->queue, &list);
783 list_splice_init(&atchan->active_list, &list);
784
785 spin_unlock_bh(&atchan->lock);
786
787 /* Flush all pending and queued descriptors */
788 list_for_each_entry_safe(desc, _desc, &list, desc_node)
789 atc_chain_complete(atchan, desc);
790}
791
792/**
793 * atc_is_tx_complete - poll for transaction completion
794 * @chan: DMA channel
795 * @cookie: transaction identifier to check status of
796 * @done: if not %NULL, updated with last completed transaction
797 * @used: if not %NULL, updated with last used transaction
798 *
799 * If @done and @used are passed in, upon return they reflect the driver
800 * internal state and can be used with dma_async_is_complete() to check
801 * the status of multiple cookies without re-checking hardware state.
802 */
803static enum dma_status
804atc_is_tx_complete(struct dma_chan *chan,
805 dma_cookie_t cookie,
806 dma_cookie_t *done, dma_cookie_t *used)
807{
808 struct at_dma_chan *atchan = to_at_dma_chan(chan);
809 dma_cookie_t last_used;
810 dma_cookie_t last_complete;
811 enum dma_status ret;
812
813 dev_vdbg(chan2dev(chan), "is_tx_complete: %d (d%d, u%d)\n",
814 cookie, done ? *done : 0, used ? *used : 0);
815
816 spin_lock_bh(atchan->lock);
817
818 last_complete = atchan->completed_cookie;
819 last_used = chan->cookie;
820
821 ret = dma_async_is_complete(cookie, last_complete, last_used);
822 if (ret != DMA_SUCCESS) {
823 atc_cleanup_descriptors(atchan);
824
825 last_complete = atchan->completed_cookie;
826 last_used = chan->cookie;
827
828 ret = dma_async_is_complete(cookie, last_complete, last_used);
829 }
830
831 spin_unlock_bh(atchan->lock);
832
833 if (done)
834 *done = last_complete;
835 if (used)
836 *used = last_used;
837
838 return ret;
839}
840
841/**
842 * atc_issue_pending - try to finish work
843 * @chan: target DMA channel
844 */
845static void atc_issue_pending(struct dma_chan *chan)
846{
847 struct at_dma_chan *atchan = to_at_dma_chan(chan);
848
849 dev_vdbg(chan2dev(chan), "issue_pending\n");
850
851 if (!atc_chan_is_enabled(atchan)) {
852 spin_lock_bh(&atchan->lock);
853 atc_advance_work(atchan);
854 spin_unlock_bh(&atchan->lock);
855 }
856}
857
858/**
859 * atc_alloc_chan_resources - allocate resources for DMA channel
860 * @chan: allocate descriptor resources for this channel
861 * @client: current client requesting the channel be ready for requests
862 *
863 * return - the number of allocated descriptors
864 */
865static int atc_alloc_chan_resources(struct dma_chan *chan)
866{
867 struct at_dma_chan *atchan = to_at_dma_chan(chan);
868 struct at_dma *atdma = to_at_dma(chan->device);
869 struct at_desc *desc;
870 struct at_dma_slave *atslave;
871 int i;
872 u32 cfg;
873 LIST_HEAD(tmp_list);
874
875 dev_vdbg(chan2dev(chan), "alloc_chan_resources\n");
876
877 /* ASSERT: channel is idle */
878 if (atc_chan_is_enabled(atchan)) {
879 dev_dbg(chan2dev(chan), "DMA channel not idle ?\n");
880 return -EIO;
881 }
882
883 cfg = ATC_DEFAULT_CFG;
884
885 atslave = chan->private;
886 if (atslave) {
887 /*
888 * We need controller-specific data to set up slave
889 * transfers.
890 */
891 BUG_ON(!atslave->dma_dev || atslave->dma_dev != atdma->dma_common.dev);
892
893 /* if cfg configuration specified take it instad of default */
894 if (atslave->cfg)
895 cfg = atslave->cfg;
896 }
897
898 /* have we already been set up?
899 * reconfigure channel but no need to reallocate descriptors */
900 if (!list_empty(&atchan->free_list))
901 return atchan->descs_allocated;
902
903 /* Allocate initial pool of descriptors */
904 for (i = 0; i < init_nr_desc_per_channel; i++) {
905 desc = atc_alloc_descriptor(chan, GFP_KERNEL);
906 if (!desc) {
907 dev_err(atdma->dma_common.dev,
908 "Only %d initial descriptors\n", i);
909 break;
910 }
911 list_add_tail(&desc->desc_node, &tmp_list);
912 }
913
914 spin_lock_bh(&atchan->lock);
915 atchan->descs_allocated = i;
916 list_splice(&tmp_list, &atchan->free_list);
917 atchan->completed_cookie = chan->cookie = 1;
918 spin_unlock_bh(&atchan->lock);
919
920 /* channel parameters */
921 channel_writel(atchan, CFG, cfg);
922
923 dev_dbg(chan2dev(chan),
924 "alloc_chan_resources: allocated %d descriptors\n",
925 atchan->descs_allocated);
926
927 return atchan->descs_allocated;
928}
929
930/**
931 * atc_free_chan_resources - free all channel resources
932 * @chan: DMA channel
933 */
934static void atc_free_chan_resources(struct dma_chan *chan)
935{
936 struct at_dma_chan *atchan = to_at_dma_chan(chan);
937 struct at_dma *atdma = to_at_dma(chan->device);
938 struct at_desc *desc, *_desc;
939 LIST_HEAD(list);
940
941 dev_dbg(chan2dev(chan), "free_chan_resources: (descs allocated=%u)\n",
942 atchan->descs_allocated);
943
944 /* ASSERT: channel is idle */
945 BUG_ON(!list_empty(&atchan->active_list));
946 BUG_ON(!list_empty(&atchan->queue));
947 BUG_ON(atc_chan_is_enabled(atchan));
948
949 list_for_each_entry_safe(desc, _desc, &atchan->free_list, desc_node) {
950 dev_vdbg(chan2dev(chan), " freeing descriptor %p\n", desc);
951 list_del(&desc->desc_node);
952 /* free link descriptor */
953 dma_pool_free(atdma->dma_desc_pool, desc, desc->txd.phys);
954 }
955 list_splice_init(&atchan->free_list, &list);
956 atchan->descs_allocated = 0;
957
958 dev_vdbg(chan2dev(chan), "free_chan_resources: done\n");
959}
960
961
962/*-- Module Management -----------------------------------------------*/
963
964/**
965 * at_dma_off - disable DMA controller
966 * @atdma: the Atmel HDAMC device
967 */
968static void at_dma_off(struct at_dma *atdma)
969{
970 dma_writel(atdma, EN, 0);
971
972 /* disable all interrupts */
973 dma_writel(atdma, EBCIDR, -1L);
974
975 /* confirm that all channels are disabled */
976 while (dma_readl(atdma, CHSR) & atdma->all_chan_mask)
977 cpu_relax();
978}
979
980static int __init at_dma_probe(struct platform_device *pdev)
981{
982 struct at_dma_platform_data *pdata;
983 struct resource *io;
984 struct at_dma *atdma;
985 size_t size;
986 int irq;
987 int err;
988 int i;
989
990 /* get DMA Controller parameters from platform */
991 pdata = pdev->dev.platform_data;
992 if (!pdata || pdata->nr_channels > AT_DMA_MAX_NR_CHANNELS)
993 return -EINVAL;
994
995 io = platform_get_resource(pdev, IORESOURCE_MEM, 0);
996 if (!io)
997 return -EINVAL;
998
999 irq = platform_get_irq(pdev, 0);
1000 if (irq < 0)
1001 return irq;
1002
1003 size = sizeof(struct at_dma);
1004 size += pdata->nr_channels * sizeof(struct at_dma_chan);
1005 atdma = kzalloc(size, GFP_KERNEL);
1006 if (!atdma)
1007 return -ENOMEM;
1008
1009 /* discover transaction capabilites from the platform data */
1010 atdma->dma_common.cap_mask = pdata->cap_mask;
1011 atdma->all_chan_mask = (1 << pdata->nr_channels) - 1;
1012
1013 size = io->end - io->start + 1;
1014 if (!request_mem_region(io->start, size, pdev->dev.driver->name)) {
1015 err = -EBUSY;
1016 goto err_kfree;
1017 }
1018
1019 atdma->regs = ioremap(io->start, size);
1020 if (!atdma->regs) {
1021 err = -ENOMEM;
1022 goto err_release_r;
1023 }
1024
1025 atdma->clk = clk_get(&pdev->dev, "dma_clk");
1026 if (IS_ERR(atdma->clk)) {
1027 err = PTR_ERR(atdma->clk);
1028 goto err_clk;
1029 }
1030 clk_enable(atdma->clk);
1031
1032 /* force dma off, just in case */
1033 at_dma_off(atdma);
1034
1035 err = request_irq(irq, at_dma_interrupt, 0, "at_hdmac", atdma);
1036 if (err)
1037 goto err_irq;
1038
1039 platform_set_drvdata(pdev, atdma);
1040
1041 /* create a pool of consistent memory blocks for hardware descriptors */
1042 atdma->dma_desc_pool = dma_pool_create("at_hdmac_desc_pool",
1043 &pdev->dev, sizeof(struct at_desc),
1044 4 /* word alignment */, 0);
1045 if (!atdma->dma_desc_pool) {
1046 dev_err(&pdev->dev, "No memory for descriptors dma pool\n");
1047 err = -ENOMEM;
1048 goto err_pool_create;
1049 }
1050
1051 /* clear any pending interrupt */
1052 while (dma_readl(atdma, EBCISR))
1053 cpu_relax();
1054
1055 /* initialize channels related values */
1056 INIT_LIST_HEAD(&atdma->dma_common.channels);
1057 for (i = 0; i < pdata->nr_channels; i++, atdma->dma_common.chancnt++) {
1058 struct at_dma_chan *atchan = &atdma->chan[i];
1059
1060 atchan->chan_common.device = &atdma->dma_common;
1061 atchan->chan_common.cookie = atchan->completed_cookie = 1;
1062 atchan->chan_common.chan_id = i;
1063 list_add_tail(&atchan->chan_common.device_node,
1064 &atdma->dma_common.channels);
1065
1066 atchan->ch_regs = atdma->regs + ch_regs(i);
1067 spin_lock_init(&atchan->lock);
1068 atchan->mask = 1 << i;
1069
1070 INIT_LIST_HEAD(&atchan->active_list);
1071 INIT_LIST_HEAD(&atchan->queue);
1072 INIT_LIST_HEAD(&atchan->free_list);
1073
1074 tasklet_init(&atchan->tasklet, atc_tasklet,
1075 (unsigned long)atchan);
1076 atc_enable_irq(atchan);
1077 }
1078
1079 /* set base routines */
1080 atdma->dma_common.device_alloc_chan_resources = atc_alloc_chan_resources;
1081 atdma->dma_common.device_free_chan_resources = atc_free_chan_resources;
1082 atdma->dma_common.device_is_tx_complete = atc_is_tx_complete;
1083 atdma->dma_common.device_issue_pending = atc_issue_pending;
1084 atdma->dma_common.dev = &pdev->dev;
1085
1086 /* set prep routines based on capability */
1087 if (dma_has_cap(DMA_MEMCPY, atdma->dma_common.cap_mask))
1088 atdma->dma_common.device_prep_dma_memcpy = atc_prep_dma_memcpy;
1089
1090 if (dma_has_cap(DMA_SLAVE, atdma->dma_common.cap_mask)) {
1091 atdma->dma_common.device_prep_slave_sg = atc_prep_slave_sg;
1092 atdma->dma_common.device_terminate_all = atc_terminate_all;
1093 }
1094
1095 dma_writel(atdma, EN, AT_DMA_ENABLE);
1096
1097 dev_info(&pdev->dev, "Atmel AHB DMA Controller ( %s%s), %d channels\n",
1098 dma_has_cap(DMA_MEMCPY, atdma->dma_common.cap_mask) ? "cpy " : "",
1099 dma_has_cap(DMA_SLAVE, atdma->dma_common.cap_mask) ? "slave " : "",
1100 atdma->dma_common.chancnt);
1101
1102 dma_async_device_register(&atdma->dma_common);
1103
1104 return 0;
1105
1106err_pool_create:
1107 platform_set_drvdata(pdev, NULL);
1108 free_irq(platform_get_irq(pdev, 0), atdma);
1109err_irq:
1110 clk_disable(atdma->clk);
1111 clk_put(atdma->clk);
1112err_clk:
1113 iounmap(atdma->regs);
1114 atdma->regs = NULL;
1115err_release_r:
1116 release_mem_region(io->start, size);
1117err_kfree:
1118 kfree(atdma);
1119 return err;
1120}
1121
1122static int __exit at_dma_remove(struct platform_device *pdev)
1123{
1124 struct at_dma *atdma = platform_get_drvdata(pdev);
1125 struct dma_chan *chan, *_chan;
1126 struct resource *io;
1127
1128 at_dma_off(atdma);
1129 dma_async_device_unregister(&atdma->dma_common);
1130
1131 dma_pool_destroy(atdma->dma_desc_pool);
1132 platform_set_drvdata(pdev, NULL);
1133 free_irq(platform_get_irq(pdev, 0), atdma);
1134
1135 list_for_each_entry_safe(chan, _chan, &atdma->dma_common.channels,
1136 device_node) {
1137 struct at_dma_chan *atchan = to_at_dma_chan(chan);
1138
1139 /* Disable interrupts */
1140 atc_disable_irq(atchan);
1141 tasklet_disable(&atchan->tasklet);
1142
1143 tasklet_kill(&atchan->tasklet);
1144 list_del(&chan->device_node);
1145 }
1146
1147 clk_disable(atdma->clk);
1148 clk_put(atdma->clk);
1149
1150 iounmap(atdma->regs);
1151 atdma->regs = NULL;
1152
1153 io = platform_get_resource(pdev, IORESOURCE_MEM, 0);
1154 release_mem_region(io->start, io->end - io->start + 1);
1155
1156 kfree(atdma);
1157
1158 return 0;
1159}
1160
1161static void at_dma_shutdown(struct platform_device *pdev)
1162{
1163 struct at_dma *atdma = platform_get_drvdata(pdev);
1164
1165 at_dma_off(platform_get_drvdata(pdev));
1166 clk_disable(atdma->clk);
1167}
1168
1169static int at_dma_suspend_late(struct platform_device *pdev, pm_message_t mesg)
1170{
1171 struct at_dma *atdma = platform_get_drvdata(pdev);
1172
1173 at_dma_off(platform_get_drvdata(pdev));
1174 clk_disable(atdma->clk);
1175 return 0;
1176}
1177
1178static int at_dma_resume_early(struct platform_device *pdev)
1179{
1180 struct at_dma *atdma = platform_get_drvdata(pdev);
1181
1182 clk_enable(atdma->clk);
1183 dma_writel(atdma, EN, AT_DMA_ENABLE);
1184 return 0;
1185
1186}
1187
1188static struct platform_driver at_dma_driver = {
1189 .remove = __exit_p(at_dma_remove),
1190 .shutdown = at_dma_shutdown,
1191 .suspend_late = at_dma_suspend_late,
1192 .resume_early = at_dma_resume_early,
1193 .driver = {
1194 .name = "at_hdmac",
1195 },
1196};
1197
1198static int __init at_dma_init(void)
1199{
1200 return platform_driver_probe(&at_dma_driver, at_dma_probe);
1201}
1202module_init(at_dma_init);
1203
1204static void __exit at_dma_exit(void)
1205{
1206 platform_driver_unregister(&at_dma_driver);
1207}
1208module_exit(at_dma_exit);
1209
1210MODULE_DESCRIPTION("Atmel AHB DMA Controller driver");
1211MODULE_AUTHOR("Nicolas Ferre <nicolas.ferre@atmel.com>");
1212MODULE_LICENSE("GPL");
1213MODULE_ALIAS("platform:at_hdmac");
diff --git a/drivers/dma/at_hdmac_regs.h b/drivers/dma/at_hdmac_regs.h
new file mode 100644
index 000000000000..4c972afc49ec
--- /dev/null
+++ b/drivers/dma/at_hdmac_regs.h
@@ -0,0 +1,353 @@
1/*
2 * Header file for the Atmel AHB DMA Controller driver
3 *
4 * Copyright (C) 2008 Atmel Corporation
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 */
11#ifndef AT_HDMAC_REGS_H
12#define AT_HDMAC_REGS_H
13
14#include <mach/at_hdmac.h>
15
16#define AT_DMA_MAX_NR_CHANNELS 8
17
18
19#define AT_DMA_GCFG 0x00 /* Global Configuration Register */
20#define AT_DMA_IF_BIGEND(i) (0x1 << (i)) /* AHB-Lite Interface i in Big-endian mode */
21#define AT_DMA_ARB_CFG (0x1 << 4) /* Arbiter mode. */
22#define AT_DMA_ARB_CFG_FIXED (0x0 << 4)
23#define AT_DMA_ARB_CFG_ROUND_ROBIN (0x1 << 4)
24
25#define AT_DMA_EN 0x04 /* Controller Enable Register */
26#define AT_DMA_ENABLE (0x1 << 0)
27
28#define AT_DMA_SREQ 0x08 /* Software Single Request Register */
29#define AT_DMA_SSREQ(x) (0x1 << ((x) << 1)) /* Request a source single transfer on channel x */
30#define AT_DMA_DSREQ(x) (0x1 << (1 + ((x) << 1))) /* Request a destination single transfer on channel x */
31
32#define AT_DMA_CREQ 0x0C /* Software Chunk Transfer Request Register */
33#define AT_DMA_SCREQ(x) (0x1 << ((x) << 1)) /* Request a source chunk transfer on channel x */
34#define AT_DMA_DCREQ(x) (0x1 << (1 + ((x) << 1))) /* Request a destination chunk transfer on channel x */
35
36#define AT_DMA_LAST 0x10 /* Software Last Transfer Flag Register */
37#define AT_DMA_SLAST(x) (0x1 << ((x) << 1)) /* This src rq is last tx of buffer on channel x */
38#define AT_DMA_DLAST(x) (0x1 << (1 + ((x) << 1))) /* This dst rq is last tx of buffer on channel x */
39
40#define AT_DMA_SYNC 0x14 /* Request Synchronization Register */
41#define AT_DMA_SYR(h) (0x1 << (h)) /* Synchronize handshake line h */
42
43/* Error, Chained Buffer transfer completed and Buffer transfer completed Interrupt registers */
44#define AT_DMA_EBCIER 0x18 /* Enable register */
45#define AT_DMA_EBCIDR 0x1C /* Disable register */
46#define AT_DMA_EBCIMR 0x20 /* Mask Register */
47#define AT_DMA_EBCISR 0x24 /* Status Register */
48#define AT_DMA_CBTC_OFFSET 8
49#define AT_DMA_ERR_OFFSET 16
50#define AT_DMA_BTC(x) (0x1 << (x))
51#define AT_DMA_CBTC(x) (0x1 << (AT_DMA_CBTC_OFFSET + (x)))
52#define AT_DMA_ERR(x) (0x1 << (AT_DMA_ERR_OFFSET + (x)))
53
54#define AT_DMA_CHER 0x28 /* Channel Handler Enable Register */
55#define AT_DMA_ENA(x) (0x1 << (x))
56#define AT_DMA_SUSP(x) (0x1 << ( 8 + (x)))
57#define AT_DMA_KEEP(x) (0x1 << (24 + (x)))
58
59#define AT_DMA_CHDR 0x2C /* Channel Handler Disable Register */
60#define AT_DMA_DIS(x) (0x1 << (x))
61#define AT_DMA_RES(x) (0x1 << ( 8 + (x)))
62
63#define AT_DMA_CHSR 0x30 /* Channel Handler Status Register */
64#define AT_DMA_EMPT(x) (0x1 << (16 + (x)))
65#define AT_DMA_STAL(x) (0x1 << (24 + (x)))
66
67
68#define AT_DMA_CH_REGS_BASE 0x3C /* Channel registers base address */
69#define ch_regs(x) (AT_DMA_CH_REGS_BASE + (x) * 0x28) /* Channel x base addr */
70
71/* Hardware register offset for each channel */
72#define ATC_SADDR_OFFSET 0x00 /* Source Address Register */
73#define ATC_DADDR_OFFSET 0x04 /* Destination Address Register */
74#define ATC_DSCR_OFFSET 0x08 /* Descriptor Address Register */
75#define ATC_CTRLA_OFFSET 0x0C /* Control A Register */
76#define ATC_CTRLB_OFFSET 0x10 /* Control B Register */
77#define ATC_CFG_OFFSET 0x14 /* Configuration Register */
78#define ATC_SPIP_OFFSET 0x18 /* Src PIP Configuration Register */
79#define ATC_DPIP_OFFSET 0x1C /* Dst PIP Configuration Register */
80
81
82/* Bitfield definitions */
83
84/* Bitfields in DSCR */
85#define ATC_DSCR_IF(i) (0x3 & (i)) /* Dsc feched via AHB-Lite Interface i */
86
87/* Bitfields in CTRLA */
88#define ATC_BTSIZE_MAX 0xFFFFUL /* Maximum Buffer Transfer Size */
89#define ATC_BTSIZE(x) (ATC_BTSIZE_MAX & (x)) /* Buffer Transfer Size */
90/* Chunck Tranfer size definitions are in at_hdmac.h */
91#define ATC_SRC_WIDTH_MASK (0x3 << 24) /* Source Single Transfer Size */
92#define ATC_SRC_WIDTH(x) ((x) << 24)
93#define ATC_SRC_WIDTH_BYTE (0x0 << 24)
94#define ATC_SRC_WIDTH_HALFWORD (0x1 << 24)
95#define ATC_SRC_WIDTH_WORD (0x2 << 24)
96#define ATC_DST_WIDTH_MASK (0x3 << 28) /* Destination Single Transfer Size */
97#define ATC_DST_WIDTH(x) ((x) << 28)
98#define ATC_DST_WIDTH_BYTE (0x0 << 28)
99#define ATC_DST_WIDTH_HALFWORD (0x1 << 28)
100#define ATC_DST_WIDTH_WORD (0x2 << 28)
101#define ATC_DONE (0x1 << 31) /* Tx Done (only written back in descriptor) */
102
103/* Bitfields in CTRLB */
104#define ATC_SIF(i) (0x3 & (i)) /* Src tx done via AHB-Lite Interface i */
105#define ATC_DIF(i) ((0x3 & (i)) << 4) /* Dst tx done via AHB-Lite Interface i */
106#define ATC_SRC_PIP (0x1 << 8) /* Source Picture-in-Picture enabled */
107#define ATC_DST_PIP (0x1 << 12) /* Destination Picture-in-Picture enabled */
108#define ATC_SRC_DSCR_DIS (0x1 << 16) /* Src Descriptor fetch disable */
109#define ATC_DST_DSCR_DIS (0x1 << 20) /* Dst Descriptor fetch disable */
110#define ATC_FC_MASK (0x7 << 21) /* Choose Flow Controller */
111#define ATC_FC_MEM2MEM (0x0 << 21) /* Mem-to-Mem (DMA) */
112#define ATC_FC_MEM2PER (0x1 << 21) /* Mem-to-Periph (DMA) */
113#define ATC_FC_PER2MEM (0x2 << 21) /* Periph-to-Mem (DMA) */
114#define ATC_FC_PER2PER (0x3 << 21) /* Periph-to-Periph (DMA) */
115#define ATC_FC_PER2MEM_PER (0x4 << 21) /* Periph-to-Mem (Peripheral) */
116#define ATC_FC_MEM2PER_PER (0x5 << 21) /* Mem-to-Periph (Peripheral) */
117#define ATC_FC_PER2PER_SRCPER (0x6 << 21) /* Periph-to-Periph (Src Peripheral) */
118#define ATC_FC_PER2PER_DSTPER (0x7 << 21) /* Periph-to-Periph (Dst Peripheral) */
119#define ATC_SRC_ADDR_MODE_MASK (0x3 << 24)
120#define ATC_SRC_ADDR_MODE_INCR (0x0 << 24) /* Incrementing Mode */
121#define ATC_SRC_ADDR_MODE_DECR (0x1 << 24) /* Decrementing Mode */
122#define ATC_SRC_ADDR_MODE_FIXED (0x2 << 24) /* Fixed Mode */
123#define ATC_DST_ADDR_MODE_MASK (0x3 << 28)
124#define ATC_DST_ADDR_MODE_INCR (0x0 << 28) /* Incrementing Mode */
125#define ATC_DST_ADDR_MODE_DECR (0x1 << 28) /* Decrementing Mode */
126#define ATC_DST_ADDR_MODE_FIXED (0x2 << 28) /* Fixed Mode */
127#define ATC_IEN (0x1 << 30) /* BTC interrupt enable (active low) */
128#define ATC_AUTO (0x1 << 31) /* Auto multiple buffer tx enable */
129
130/* Bitfields in CFG */
131/* are in at_hdmac.h */
132
133/* Bitfields in SPIP */
134#define ATC_SPIP_HOLE(x) (0xFFFFU & (x))
135#define ATC_SPIP_BOUNDARY(x) ((0x3FF & (x)) << 16)
136
137/* Bitfields in DPIP */
138#define ATC_DPIP_HOLE(x) (0xFFFFU & (x))
139#define ATC_DPIP_BOUNDARY(x) ((0x3FF & (x)) << 16)
140
141
142/*-- descriptors -----------------------------------------------------*/
143
144/* LLI == Linked List Item; aka DMA buffer descriptor */
145struct at_lli {
146 /* values that are not changed by hardware */
147 dma_addr_t saddr;
148 dma_addr_t daddr;
149 /* value that may get written back: */
150 u32 ctrla;
151 /* more values that are not changed by hardware */
152 u32 ctrlb;
153 dma_addr_t dscr; /* chain to next lli */
154};
155
156/**
157 * struct at_desc - software descriptor
158 * @at_lli: hardware lli structure
159 * @txd: support for the async_tx api
160 * @desc_node: node on the channed descriptors list
161 * @len: total transaction bytecount
162 */
163struct at_desc {
164 /* FIRST values the hardware uses */
165 struct at_lli lli;
166
167 /* THEN values for driver housekeeping */
168 struct dma_async_tx_descriptor txd;
169 struct list_head desc_node;
170 size_t len;
171};
172
173static inline struct at_desc *
174txd_to_at_desc(struct dma_async_tx_descriptor *txd)
175{
176 return container_of(txd, struct at_desc, txd);
177}
178
179
180/*-- Channels --------------------------------------------------------*/
181
182/**
183 * struct at_dma_chan - internal representation of an Atmel HDMAC channel
184 * @chan_common: common dmaengine channel object members
185 * @device: parent device
186 * @ch_regs: memory mapped register base
187 * @mask: channel index in a mask
188 * @error_status: transmit error status information from irq handler
189 * to tasklet (use atomic operations)
190 * @tasklet: bottom half to finish transaction work
191 * @lock: serializes enqueue/dequeue operations to descriptors lists
192 * @completed_cookie: identifier for the most recently completed operation
193 * @active_list: list of descriptors dmaengine is being running on
194 * @queue: list of descriptors ready to be submitted to engine
195 * @free_list: list of descriptors usable by the channel
196 * @descs_allocated: records the actual size of the descriptor pool
197 */
198struct at_dma_chan {
199 struct dma_chan chan_common;
200 struct at_dma *device;
201 void __iomem *ch_regs;
202 u8 mask;
203 unsigned long error_status;
204 struct tasklet_struct tasklet;
205
206 spinlock_t lock;
207
208 /* these other elements are all protected by lock */
209 dma_cookie_t completed_cookie;
210 struct list_head active_list;
211 struct list_head queue;
212 struct list_head free_list;
213 unsigned int descs_allocated;
214};
215
216#define channel_readl(atchan, name) \
217 __raw_readl((atchan)->ch_regs + ATC_##name##_OFFSET)
218
219#define channel_writel(atchan, name, val) \
220 __raw_writel((val), (atchan)->ch_regs + ATC_##name##_OFFSET)
221
222static inline struct at_dma_chan *to_at_dma_chan(struct dma_chan *dchan)
223{
224 return container_of(dchan, struct at_dma_chan, chan_common);
225}
226
227
228/*-- Controller ------------------------------------------------------*/
229
230/**
231 * struct at_dma - internal representation of an Atmel HDMA Controller
232 * @chan_common: common dmaengine dma_device object members
233 * @ch_regs: memory mapped register base
234 * @clk: dma controller clock
235 * @all_chan_mask: all channels availlable in a mask
236 * @dma_desc_pool: base of DMA descriptor region (DMA address)
237 * @chan: channels table to store at_dma_chan structures
238 */
239struct at_dma {
240 struct dma_device dma_common;
241 void __iomem *regs;
242 struct clk *clk;
243
244 u8 all_chan_mask;
245
246 struct dma_pool *dma_desc_pool;
247 /* AT THE END channels table */
248 struct at_dma_chan chan[0];
249};
250
251#define dma_readl(atdma, name) \
252 __raw_readl((atdma)->regs + AT_DMA_##name)
253#define dma_writel(atdma, name, val) \
254 __raw_writel((val), (atdma)->regs + AT_DMA_##name)
255
256static inline struct at_dma *to_at_dma(struct dma_device *ddev)
257{
258 return container_of(ddev, struct at_dma, dma_common);
259}
260
261
262/*-- Helper functions ------------------------------------------------*/
263
264static struct device *chan2dev(struct dma_chan *chan)
265{
266 return &chan->dev->device;
267}
268static struct device *chan2parent(struct dma_chan *chan)
269{
270 return chan->dev->device.parent;
271}
272
273#if defined(VERBOSE_DEBUG)
274static void vdbg_dump_regs(struct at_dma_chan *atchan)
275{
276 struct at_dma *atdma = to_at_dma(atchan->chan_common.device);
277
278 dev_err(chan2dev(&atchan->chan_common),
279 " channel %d : imr = 0x%x, chsr = 0x%x\n",
280 atchan->chan_common.chan_id,
281 dma_readl(atdma, EBCIMR),
282 dma_readl(atdma, CHSR));
283
284 dev_err(chan2dev(&atchan->chan_common),
285 " channel: s0x%x d0x%x ctrl0x%x:0x%x cfg0x%x l0x%x\n",
286 channel_readl(atchan, SADDR),
287 channel_readl(atchan, DADDR),
288 channel_readl(atchan, CTRLA),
289 channel_readl(atchan, CTRLB),
290 channel_readl(atchan, CFG),
291 channel_readl(atchan, DSCR));
292}
293#else
294static void vdbg_dump_regs(struct at_dma_chan *atchan) {}
295#endif
296
297static void atc_dump_lli(struct at_dma_chan *atchan, struct at_lli *lli)
298{
299 dev_printk(KERN_CRIT, chan2dev(&atchan->chan_common),
300 " desc: s0x%x d0x%x ctrl0x%x:0x%x l0x%x\n",
301 lli->saddr, lli->daddr,
302 lli->ctrla, lli->ctrlb, lli->dscr);
303}
304
305
306static void atc_setup_irq(struct at_dma_chan *atchan, int on)
307{
308 struct at_dma *atdma = to_at_dma(atchan->chan_common.device);
309 u32 ebci;
310
311 /* enable interrupts on buffer chain completion & error */
312 ebci = AT_DMA_CBTC(atchan->chan_common.chan_id)
313 | AT_DMA_ERR(atchan->chan_common.chan_id);
314 if (on)
315 dma_writel(atdma, EBCIER, ebci);
316 else
317 dma_writel(atdma, EBCIDR, ebci);
318}
319
320static inline void atc_enable_irq(struct at_dma_chan *atchan)
321{
322 atc_setup_irq(atchan, 1);
323}
324
325static inline void atc_disable_irq(struct at_dma_chan *atchan)
326{
327 atc_setup_irq(atchan, 0);
328}
329
330
331/**
332 * atc_chan_is_enabled - test if given channel is enabled
333 * @atchan: channel we want to test status
334 */
335static inline int atc_chan_is_enabled(struct at_dma_chan *atchan)
336{
337 struct at_dma *atdma = to_at_dma(atchan->chan_common.device);
338
339 return !!(dma_readl(atdma, CHSR) & atchan->mask);
340}
341
342
343/**
344 * set_desc_eol - set end-of-link to descriptor so it will end transfer
345 * @desc: descriptor, signle or at the end of a chain, to end chain on
346 */
347static void set_desc_eol(struct at_desc *desc)
348{
349 desc->lli.ctrlb |= ATC_SRC_DSCR_DIS | ATC_DST_DSCR_DIS;
350 desc->lli.dscr = 0;
351}
352
353#endif /* AT_HDMAC_REGS_H */
diff --git a/drivers/dma/dmatest.c b/drivers/dma/dmatest.c
index fb7da5141e96..d93017fc7872 100644
--- a/drivers/dma/dmatest.c
+++ b/drivers/dma/dmatest.c
@@ -38,6 +38,11 @@ module_param(max_channels, uint, S_IRUGO);
38MODULE_PARM_DESC(max_channels, 38MODULE_PARM_DESC(max_channels,
39 "Maximum number of channels to use (default: all)"); 39 "Maximum number of channels to use (default: all)");
40 40
41static unsigned int iterations;
42module_param(iterations, uint, S_IRUGO);
43MODULE_PARM_DESC(iterations,
44 "Iterations before stopping test (default: infinite)");
45
41static unsigned int xor_sources = 3; 46static unsigned int xor_sources = 3;
42module_param(xor_sources, uint, S_IRUGO); 47module_param(xor_sources, uint, S_IRUGO);
43MODULE_PARM_DESC(xor_sources, 48MODULE_PARM_DESC(xor_sources,
@@ -114,7 +119,7 @@ static void dmatest_init_srcs(u8 **bufs, unsigned int start, unsigned int len)
114 buf[i] = PATTERN_SRC | (~i & PATTERN_COUNT_MASK); 119 buf[i] = PATTERN_SRC | (~i & PATTERN_COUNT_MASK);
115 for ( ; i < start + len; i++) 120 for ( ; i < start + len; i++)
116 buf[i] = PATTERN_SRC | PATTERN_COPY 121 buf[i] = PATTERN_SRC | PATTERN_COPY
117 | (~i & PATTERN_COUNT_MASK);; 122 | (~i & PATTERN_COUNT_MASK);
118 for ( ; i < test_buf_size; i++) 123 for ( ; i < test_buf_size; i++)
119 buf[i] = PATTERN_SRC | (~i & PATTERN_COUNT_MASK); 124 buf[i] = PATTERN_SRC | (~i & PATTERN_COUNT_MASK);
120 buf++; 125 buf++;
@@ -270,7 +275,8 @@ static int dmatest_func(void *data)
270 275
271 flags = DMA_CTRL_ACK | DMA_COMPL_SKIP_DEST_UNMAP | DMA_PREP_INTERRUPT; 276 flags = DMA_CTRL_ACK | DMA_COMPL_SKIP_DEST_UNMAP | DMA_PREP_INTERRUPT;
272 277
273 while (!kthread_should_stop()) { 278 while (!kthread_should_stop()
279 && !(iterations && total_tests >= iterations)) {
274 struct dma_device *dev = chan->device; 280 struct dma_device *dev = chan->device;
275 struct dma_async_tx_descriptor *tx = NULL; 281 struct dma_async_tx_descriptor *tx = NULL;
276 dma_addr_t dma_srcs[src_cnt]; 282 dma_addr_t dma_srcs[src_cnt];
@@ -416,6 +422,13 @@ err_srcbuf:
416err_srcs: 422err_srcs:
417 pr_notice("%s: terminating after %u tests, %u failures (status %d)\n", 423 pr_notice("%s: terminating after %u tests, %u failures (status %d)\n",
418 thread_name, total_tests, failed_tests, ret); 424 thread_name, total_tests, failed_tests, ret);
425
426 if (iterations > 0)
427 while (!kthread_should_stop()) {
428 DECLARE_WAIT_QUEUE_HEAD(wait_dmatest_exit);
429 interruptible_sleep_on(&wait_dmatest_exit);
430 }
431
419 return ret; 432 return ret;
420} 433}
421 434
@@ -495,11 +508,11 @@ static int dmatest_add_channel(struct dma_chan *chan)
495 508
496 if (dma_has_cap(DMA_MEMCPY, dma_dev->cap_mask)) { 509 if (dma_has_cap(DMA_MEMCPY, dma_dev->cap_mask)) {
497 cnt = dmatest_add_threads(dtc, DMA_MEMCPY); 510 cnt = dmatest_add_threads(dtc, DMA_MEMCPY);
498 thread_count += cnt > 0 ?: 0; 511 thread_count += cnt > 0 ? cnt : 0;
499 } 512 }
500 if (dma_has_cap(DMA_XOR, dma_dev->cap_mask)) { 513 if (dma_has_cap(DMA_XOR, dma_dev->cap_mask)) {
501 cnt = dmatest_add_threads(dtc, DMA_XOR); 514 cnt = dmatest_add_threads(dtc, DMA_XOR);
502 thread_count += cnt > 0 ?: 0; 515 thread_count += cnt > 0 ? cnt : 0;
503 } 516 }
504 517
505 pr_info("dmatest: Started %u threads using %s\n", 518 pr_info("dmatest: Started %u threads using %s\n",
diff --git a/drivers/dma/fsldma.c b/drivers/dma/fsldma.c
index f18d1bde0439..ef87a8984145 100644
--- a/drivers/dma/fsldma.c
+++ b/drivers/dma/fsldma.c
@@ -12,6 +12,11 @@
12 * also fit for MPC8560, MPC8555, MPC8548, MPC8641, and etc. 12 * also fit for MPC8560, MPC8555, MPC8548, MPC8641, and etc.
13 * The support for MPC8349 DMA contorller is also added. 13 * The support for MPC8349 DMA contorller is also added.
14 * 14 *
15 * This driver instructs the DMA controller to issue the PCI Read Multiple
16 * command for PCI read operations, instead of using the default PCI Read Line
17 * command. Please be aware that this setting may result in read pre-fetching
18 * on some platforms.
19 *
15 * This is free software; you can redistribute it and/or modify 20 * This is free software; you can redistribute it and/or modify
16 * it under the terms of the GNU General Public License as published by 21 * it under the terms of the GNU General Public License as published by
17 * the Free Software Foundation; either version 2 of the License, or 22 * the Free Software Foundation; either version 2 of the License, or
@@ -49,9 +54,10 @@ static void dma_init(struct fsl_dma_chan *fsl_chan)
49 case FSL_DMA_IP_83XX: 54 case FSL_DMA_IP_83XX:
50 /* Set the channel to below modes: 55 /* Set the channel to below modes:
51 * EOTIE - End-of-transfer interrupt enable 56 * EOTIE - End-of-transfer interrupt enable
57 * PRC_RM - PCI read multiple
52 */ 58 */
53 DMA_OUT(fsl_chan, &fsl_chan->reg_base->mr, FSL_DMA_MR_EOTIE, 59 DMA_OUT(fsl_chan, &fsl_chan->reg_base->mr, FSL_DMA_MR_EOTIE
54 32); 60 | FSL_DMA_MR_PRC_RM, 32);
55 break; 61 break;
56 } 62 }
57 63
@@ -136,15 +142,16 @@ static int dma_is_idle(struct fsl_dma_chan *fsl_chan)
136 142
137static void dma_start(struct fsl_dma_chan *fsl_chan) 143static void dma_start(struct fsl_dma_chan *fsl_chan)
138{ 144{
139 u32 mr_set = 0;; 145 u32 mr_set = 0;
140 146
141 if (fsl_chan->feature & FSL_DMA_CHAN_PAUSE_EXT) { 147 if (fsl_chan->feature & FSL_DMA_CHAN_PAUSE_EXT) {
142 DMA_OUT(fsl_chan, &fsl_chan->reg_base->bcr, 0, 32); 148 DMA_OUT(fsl_chan, &fsl_chan->reg_base->bcr, 0, 32);
143 mr_set |= FSL_DMA_MR_EMP_EN; 149 mr_set |= FSL_DMA_MR_EMP_EN;
144 } else 150 } else if ((fsl_chan->feature & FSL_DMA_IP_MASK) == FSL_DMA_IP_85XX) {
145 DMA_OUT(fsl_chan, &fsl_chan->reg_base->mr, 151 DMA_OUT(fsl_chan, &fsl_chan->reg_base->mr,
146 DMA_IN(fsl_chan, &fsl_chan->reg_base->mr, 32) 152 DMA_IN(fsl_chan, &fsl_chan->reg_base->mr, 32)
147 & ~FSL_DMA_MR_EMP_EN, 32); 153 & ~FSL_DMA_MR_EMP_EN, 32);
154 }
148 155
149 if (fsl_chan->feature & FSL_DMA_CHAN_START_EXT) 156 if (fsl_chan->feature & FSL_DMA_CHAN_START_EXT)
150 mr_set |= FSL_DMA_MR_EMS_EN; 157 mr_set |= FSL_DMA_MR_EMS_EN;
@@ -871,9 +878,9 @@ static int __devinit fsl_dma_chan_probe(struct fsl_dma_device *fdev,
871 878
872 switch (new_fsl_chan->feature & FSL_DMA_IP_MASK) { 879 switch (new_fsl_chan->feature & FSL_DMA_IP_MASK) {
873 case FSL_DMA_IP_85XX: 880 case FSL_DMA_IP_85XX:
874 new_fsl_chan->toggle_ext_start = fsl_chan_toggle_ext_start;
875 new_fsl_chan->toggle_ext_pause = fsl_chan_toggle_ext_pause; 881 new_fsl_chan->toggle_ext_pause = fsl_chan_toggle_ext_pause;
876 case FSL_DMA_IP_83XX: 882 case FSL_DMA_IP_83XX:
883 new_fsl_chan->toggle_ext_start = fsl_chan_toggle_ext_start;
877 new_fsl_chan->set_src_loop_size = fsl_chan_set_src_loop_size; 884 new_fsl_chan->set_src_loop_size = fsl_chan_set_src_loop_size;
878 new_fsl_chan->set_dest_loop_size = fsl_chan_set_dest_loop_size; 885 new_fsl_chan->set_dest_loop_size = fsl_chan_set_dest_loop_size;
879 } 886 }
diff --git a/drivers/dma/fsldma.h b/drivers/dma/fsldma.h
index 4f21a512d848..dc7f26865797 100644
--- a/drivers/dma/fsldma.h
+++ b/drivers/dma/fsldma.h
@@ -38,6 +38,7 @@
38 38
39/* Special MR definition for MPC8349 */ 39/* Special MR definition for MPC8349 */
40#define FSL_DMA_MR_EOTIE 0x00000080 40#define FSL_DMA_MR_EOTIE 0x00000080
41#define FSL_DMA_MR_PRC_RM 0x00000800
41 42
42#define FSL_DMA_SR_CH 0x00000020 43#define FSL_DMA_SR_CH 0x00000020
43#define FSL_DMA_SR_PE 0x00000010 44#define FSL_DMA_SR_PE 0x00000010
diff --git a/drivers/dma/mv_xor.c b/drivers/dma/mv_xor.c
index ddab94f51224..3f23eabe09f2 100644
--- a/drivers/dma/mv_xor.c
+++ b/drivers/dma/mv_xor.c
@@ -1176,7 +1176,7 @@ static int __devinit mv_xor_probe(struct platform_device *pdev)
1176 if (dma_has_cap(DMA_MEMSET, dma_dev->cap_mask)) 1176 if (dma_has_cap(DMA_MEMSET, dma_dev->cap_mask))
1177 dma_dev->device_prep_dma_memset = mv_xor_prep_dma_memset; 1177 dma_dev->device_prep_dma_memset = mv_xor_prep_dma_memset;
1178 if (dma_has_cap(DMA_XOR, dma_dev->cap_mask)) { 1178 if (dma_has_cap(DMA_XOR, dma_dev->cap_mask)) {
1179 dma_dev->max_xor = 8; ; 1179 dma_dev->max_xor = 8;
1180 dma_dev->device_prep_dma_xor = mv_xor_prep_dma_xor; 1180 dma_dev->device_prep_dma_xor = mv_xor_prep_dma_xor;
1181 } 1181 }
1182 1182
diff --git a/drivers/edac/amd64_edac.c b/drivers/edac/amd64_edac.c
index c36bf40568cf..e2a10bcba7a1 100644
--- a/drivers/edac/amd64_edac.c
+++ b/drivers/edac/amd64_edac.c
@@ -754,13 +754,13 @@ static void amd64_cpu_display_info(struct amd64_pvt *pvt)
754static enum edac_type amd64_determine_edac_cap(struct amd64_pvt *pvt) 754static enum edac_type amd64_determine_edac_cap(struct amd64_pvt *pvt)
755{ 755{
756 int bit; 756 int bit;
757 enum dev_type edac_cap = EDAC_NONE; 757 enum dev_type edac_cap = EDAC_FLAG_NONE;
758 758
759 bit = (boot_cpu_data.x86 > 0xf || pvt->ext_model >= OPTERON_CPU_REV_F) 759 bit = (boot_cpu_data.x86 > 0xf || pvt->ext_model >= OPTERON_CPU_REV_F)
760 ? 19 760 ? 19
761 : 17; 761 : 17;
762 762
763 if (pvt->dclr0 >> BIT(bit)) 763 if (pvt->dclr0 & BIT(bit))
764 edac_cap = EDAC_FLAG_SECDED; 764 edac_cap = EDAC_FLAG_SECDED;
765 765
766 return edac_cap; 766 return edac_cap;
@@ -868,6 +868,8 @@ static void amd64_read_dbam_reg(struct amd64_pvt *pvt)
868 goto err_reg; 868 goto err_reg;
869 } 869 }
870 870
871 return;
872
871err_reg: 873err_reg:
872 debugf0("Error reading F2x%03x.\n", reg); 874 debugf0("Error reading F2x%03x.\n", reg);
873} 875}
@@ -970,7 +972,7 @@ static void amd64_read_dct_base_mask(struct amd64_pvt *pvt)
970 } 972 }
971 973
972 for (cs = 0; cs < pvt->num_dcsm; cs++) { 974 for (cs = 0; cs < pvt->num_dcsm; cs++) {
973 reg = K8_DCSB0 + (cs * 4); 975 reg = K8_DCSM0 + (cs * 4);
974 err = pci_read_config_dword(pvt->dram_f2_ctl, reg, 976 err = pci_read_config_dword(pvt->dram_f2_ctl, reg,
975 &pvt->dcsm0[cs]); 977 &pvt->dcsm0[cs]);
976 if (unlikely(err)) 978 if (unlikely(err))
@@ -1269,7 +1271,7 @@ static int f10_early_channel_count(struct amd64_pvt *pvt)
1269 if (channels == 0) 1271 if (channels == 0)
1270 channels = 1; 1272 channels = 1;
1271 1273
1272 debugf0("DIMM count= %d\n", channels); 1274 debugf0("MCT channel count: %d\n", channels);
1273 1275
1274 return channels; 1276 return channels;
1275 1277
@@ -2634,6 +2636,8 @@ static void amd64_read_mc_registers(struct amd64_pvt *pvt)
2634 2636
2635 amd64_dump_misc_regs(pvt); 2637 amd64_dump_misc_regs(pvt);
2636 2638
2639 return;
2640
2637err_reg: 2641err_reg:
2638 debugf0("Reading an MC register failed\n"); 2642 debugf0("Reading an MC register failed\n");
2639 2643
@@ -2966,12 +2970,20 @@ static int amd64_check_ecc_enabled(struct amd64_pvt *pvt)
2966 " Use of the override can cause " 2970 " Use of the override can cause "
2967 "unknown side effects.\n"); 2971 "unknown side effects.\n");
2968 ret = -ENODEV; 2972 ret = -ENODEV;
2969 } 2973 } else
2974 /*
2975 * enable further driver loading if ECC enable is
2976 * overridden.
2977 */
2978 ret = 0;
2970 } else { 2979 } else {
2971 amd64_printk(KERN_INFO, 2980 amd64_printk(KERN_INFO,
2972 "ECC is enabled by BIOS, Proceeding " 2981 "ECC is enabled by BIOS, Proceeding "
2973 "with EDAC module initialization\n"); 2982 "with EDAC module initialization\n");
2974 2983
2984 /* Signal good ECC status */
2985 ret = 0;
2986
2975 /* CLEAR the override, since BIOS controlled it */ 2987 /* CLEAR the override, since BIOS controlled it */
2976 ecc_enable_override = 0; 2988 ecc_enable_override = 0;
2977 } 2989 }
@@ -3006,7 +3018,6 @@ static void amd64_setup_mci_misc_attributes(struct mem_ctl_info *mci)
3006 3018
3007 mci->mtype_cap = MEM_FLAG_DDR2 | MEM_FLAG_RDDR2; 3019 mci->mtype_cap = MEM_FLAG_DDR2 | MEM_FLAG_RDDR2;
3008 mci->edac_ctl_cap = EDAC_FLAG_NONE; 3020 mci->edac_ctl_cap = EDAC_FLAG_NONE;
3009 mci->edac_cap = EDAC_FLAG_NONE;
3010 3021
3011 if (pvt->nbcap & K8_NBCAP_SECDED) 3022 if (pvt->nbcap & K8_NBCAP_SECDED)
3012 mci->edac_ctl_cap |= EDAC_FLAG_SECDED; 3023 mci->edac_ctl_cap |= EDAC_FLAG_SECDED;
@@ -3052,7 +3063,7 @@ static int amd64_probe_one_instance(struct pci_dev *dram_f2_ctl,
3052 if (!pvt) 3063 if (!pvt)
3053 goto err_exit; 3064 goto err_exit;
3054 3065
3055 pvt->mc_node_id = get_mc_node_id_from_pdev(dram_f2_ctl); 3066 pvt->mc_node_id = get_node_id(dram_f2_ctl);
3056 3067
3057 pvt->dram_f2_ctl = dram_f2_ctl; 3068 pvt->dram_f2_ctl = dram_f2_ctl;
3058 pvt->ext_model = boot_cpu_data.x86_model >> 4; 3069 pvt->ext_model = boot_cpu_data.x86_model >> 4;
@@ -3179,8 +3190,7 @@ static int __devinit amd64_init_one_instance(struct pci_dev *pdev,
3179{ 3190{
3180 int ret = 0; 3191 int ret = 0;
3181 3192
3182 debugf0("(MC node=%d,mc_type='%s')\n", 3193 debugf0("(MC node=%d,mc_type='%s')\n", get_node_id(pdev),
3183 get_mc_node_id_from_pdev(pdev),
3184 get_amd_family_name(mc_type->driver_data)); 3194 get_amd_family_name(mc_type->driver_data));
3185 3195
3186 ret = pci_enable_device(pdev); 3196 ret = pci_enable_device(pdev);
@@ -3319,15 +3329,17 @@ static int __init amd64_edac_init(void)
3319 3329
3320 err = amd64_init_2nd_stage(pvt_lookup[nb]); 3330 err = amd64_init_2nd_stage(pvt_lookup[nb]);
3321 if (err) 3331 if (err)
3322 goto err_exit; 3332 goto err_2nd_stage;
3323 } 3333 }
3324 3334
3325 amd64_setup_pci_device(); 3335 amd64_setup_pci_device();
3326 3336
3327 return 0; 3337 return 0;
3328 3338
3339err_2nd_stage:
3340 debugf0("2nd stage failed\n");
3341
3329err_exit: 3342err_exit:
3330 debugf0("'finish_setup' stage failed\n");
3331 pci_unregister_driver(&amd64_pci_driver); 3343 pci_unregister_driver(&amd64_pci_driver);
3332 3344
3333 return err; 3345 return err;
diff --git a/drivers/edac/amd64_edac.h b/drivers/edac/amd64_edac.h
index a159957e167b..ba73015af8e4 100644
--- a/drivers/edac/amd64_edac.h
+++ b/drivers/edac/amd64_edac.h
@@ -444,7 +444,7 @@ enum {
444#define K8_MSR_MC4ADDR 0x0412 444#define K8_MSR_MC4ADDR 0x0412
445 445
446/* AMD sets the first MC device at device ID 0x18. */ 446/* AMD sets the first MC device at device ID 0x18. */
447static inline int get_mc_node_id_from_pdev(struct pci_dev *pdev) 447static inline int get_node_id(struct pci_dev *pdev)
448{ 448{
449 return PCI_SLOT(pdev->devfn) - 0x18; 449 return PCI_SLOT(pdev->devfn) - 0x18;
450} 450}
diff --git a/drivers/edac/edac_core.h b/drivers/edac/edac_core.h
index 3493c6bdb820..871c13b4c148 100644
--- a/drivers/edac/edac_core.h
+++ b/drivers/edac/edac_core.h
@@ -150,6 +150,8 @@ enum mem_type {
150 MEM_FB_DDR2, /* fully buffered DDR2 */ 150 MEM_FB_DDR2, /* fully buffered DDR2 */
151 MEM_RDDR2, /* Registered DDR2 RAM */ 151 MEM_RDDR2, /* Registered DDR2 RAM */
152 MEM_XDR, /* Rambus XDR */ 152 MEM_XDR, /* Rambus XDR */
153 MEM_DDR3, /* DDR3 RAM */
154 MEM_RDDR3, /* Registered DDR3 RAM */
153}; 155};
154 156
155#define MEM_FLAG_EMPTY BIT(MEM_EMPTY) 157#define MEM_FLAG_EMPTY BIT(MEM_EMPTY)
@@ -167,6 +169,8 @@ enum mem_type {
167#define MEM_FLAG_FB_DDR2 BIT(MEM_FB_DDR2) 169#define MEM_FLAG_FB_DDR2 BIT(MEM_FB_DDR2)
168#define MEM_FLAG_RDDR2 BIT(MEM_RDDR2) 170#define MEM_FLAG_RDDR2 BIT(MEM_RDDR2)
169#define MEM_FLAG_XDR BIT(MEM_XDR) 171#define MEM_FLAG_XDR BIT(MEM_XDR)
172#define MEM_FLAG_DDR3 BIT(MEM_DDR3)
173#define MEM_FLAG_RDDR3 BIT(MEM_RDDR3)
170 174
171/* chipset Error Detection and Correction capabilities and mode */ 175/* chipset Error Detection and Correction capabilities and mode */
172enum edac_type { 176enum edac_type {
diff --git a/drivers/edac/edac_mc_sysfs.c b/drivers/edac/edac_mc_sysfs.c
index ad218fe4942d..e1d4ce083481 100644
--- a/drivers/edac/edac_mc_sysfs.c
+++ b/drivers/edac/edac_mc_sysfs.c
@@ -94,7 +94,9 @@ static const char *mem_types[] = {
94 [MEM_DDR2] = "Unbuffered-DDR2", 94 [MEM_DDR2] = "Unbuffered-DDR2",
95 [MEM_FB_DDR2] = "FullyBuffered-DDR2", 95 [MEM_FB_DDR2] = "FullyBuffered-DDR2",
96 [MEM_RDDR2] = "Registered-DDR2", 96 [MEM_RDDR2] = "Registered-DDR2",
97 [MEM_XDR] = "XDR" 97 [MEM_XDR] = "XDR",
98 [MEM_DDR3] = "Unbuffered-DDR3",
99 [MEM_RDDR3] = "Registered-DDR3"
98}; 100};
99 101
100static const char *dev_types[] = { 102static const char *dev_types[] = {
diff --git a/drivers/edac/mpc85xx_edac.c b/drivers/edac/mpc85xx_edac.c
index 7c8c2d72916f..3f2ccfc6407c 100644
--- a/drivers/edac/mpc85xx_edac.c
+++ b/drivers/edac/mpc85xx_edac.c
@@ -757,6 +757,9 @@ static void __devinit mpc85xx_init_csrows(struct mem_ctl_info *mci)
757 case DSC_SDTYPE_DDR2: 757 case DSC_SDTYPE_DDR2:
758 mtype = MEM_RDDR2; 758 mtype = MEM_RDDR2;
759 break; 759 break;
760 case DSC_SDTYPE_DDR3:
761 mtype = MEM_RDDR3;
762 break;
760 default: 763 default:
761 mtype = MEM_UNKNOWN; 764 mtype = MEM_UNKNOWN;
762 break; 765 break;
@@ -769,6 +772,9 @@ static void __devinit mpc85xx_init_csrows(struct mem_ctl_info *mci)
769 case DSC_SDTYPE_DDR2: 772 case DSC_SDTYPE_DDR2:
770 mtype = MEM_DDR2; 773 mtype = MEM_DDR2;
771 break; 774 break;
775 case DSC_SDTYPE_DDR3:
776 mtype = MEM_DDR3;
777 break;
772 default: 778 default:
773 mtype = MEM_UNKNOWN; 779 mtype = MEM_UNKNOWN;
774 break; 780 break;
diff --git a/drivers/edac/mpc85xx_edac.h b/drivers/edac/mpc85xx_edac.h
index 135b3539a030..52432ee7c4b9 100644
--- a/drivers/edac/mpc85xx_edac.h
+++ b/drivers/edac/mpc85xx_edac.h
@@ -53,6 +53,7 @@
53 53
54#define DSC_SDTYPE_DDR 0x02000000 54#define DSC_SDTYPE_DDR 0x02000000
55#define DSC_SDTYPE_DDR2 0x03000000 55#define DSC_SDTYPE_DDR2 0x03000000
56#define DSC_SDTYPE_DDR3 0x07000000
56#define DSC_X32_EN 0x00000020 57#define DSC_X32_EN 0x00000020
57 58
58/* Err_Int_En */ 59/* Err_Int_En */
diff --git a/drivers/edac/x38_edac.c b/drivers/edac/x38_edac.c
index 2406c2ce2844..d4ec60593176 100644
--- a/drivers/edac/x38_edac.c
+++ b/drivers/edac/x38_edac.c
@@ -30,7 +30,7 @@
30/* Intel X38 register addresses - device 0 function 0 - DRAM Controller */ 30/* Intel X38 register addresses - device 0 function 0 - DRAM Controller */
31 31
32#define X38_MCHBAR_LOW 0x48 /* MCH Memory Mapped Register BAR */ 32#define X38_MCHBAR_LOW 0x48 /* MCH Memory Mapped Register BAR */
33#define X38_MCHBAR_HIGH 0x4b 33#define X38_MCHBAR_HIGH 0x4c
34#define X38_MCHBAR_MASK 0xfffffc000ULL /* bits 35:14 */ 34#define X38_MCHBAR_MASK 0xfffffc000ULL /* bits 35:14 */
35#define X38_MMR_WINDOW_SIZE 16384 35#define X38_MMR_WINDOW_SIZE 16384
36 36
diff --git a/drivers/firewire/core-card.c b/drivers/firewire/core-card.c
index 543fccac81bb..f74edae5cb4c 100644
--- a/drivers/firewire/core-card.c
+++ b/drivers/firewire/core-card.c
@@ -196,8 +196,8 @@ static void allocate_broadcast_channel(struct fw_card *card, int generation)
196{ 196{
197 int channel, bandwidth = 0; 197 int channel, bandwidth = 0;
198 198
199 fw_iso_resource_manage(card, generation, 1ULL << 31, 199 fw_iso_resource_manage(card, generation, 1ULL << 31, &channel,
200 &channel, &bandwidth, true); 200 &bandwidth, true, card->bm_transaction_data);
201 if (channel == 31) { 201 if (channel == 31) {
202 card->broadcast_channel_allocated = true; 202 card->broadcast_channel_allocated = true;
203 device_for_each_child(card->device, (void *)(long)generation, 203 device_for_each_child(card->device, (void *)(long)generation,
@@ -230,7 +230,6 @@ static void fw_card_bm_work(struct work_struct *work)
230 bool do_reset = false; 230 bool do_reset = false;
231 bool root_device_is_running; 231 bool root_device_is_running;
232 bool root_device_is_cmc; 232 bool root_device_is_cmc;
233 __be32 lock_data[2];
234 233
235 spin_lock_irqsave(&card->lock, flags); 234 spin_lock_irqsave(&card->lock, flags);
236 235
@@ -273,22 +272,23 @@ static void fw_card_bm_work(struct work_struct *work)
273 goto pick_me; 272 goto pick_me;
274 } 273 }
275 274
276 lock_data[0] = cpu_to_be32(0x3f); 275 card->bm_transaction_data[0] = cpu_to_be32(0x3f);
277 lock_data[1] = cpu_to_be32(local_id); 276 card->bm_transaction_data[1] = cpu_to_be32(local_id);
278 277
279 spin_unlock_irqrestore(&card->lock, flags); 278 spin_unlock_irqrestore(&card->lock, flags);
280 279
281 rcode = fw_run_transaction(card, TCODE_LOCK_COMPARE_SWAP, 280 rcode = fw_run_transaction(card, TCODE_LOCK_COMPARE_SWAP,
282 irm_id, generation, SCODE_100, 281 irm_id, generation, SCODE_100,
283 CSR_REGISTER_BASE + CSR_BUS_MANAGER_ID, 282 CSR_REGISTER_BASE + CSR_BUS_MANAGER_ID,
284 lock_data, sizeof(lock_data)); 283 card->bm_transaction_data,
284 sizeof(card->bm_transaction_data));
285 285
286 if (rcode == RCODE_GENERATION) 286 if (rcode == RCODE_GENERATION)
287 /* Another bus reset, BM work has been rescheduled. */ 287 /* Another bus reset, BM work has been rescheduled. */
288 goto out; 288 goto out;
289 289
290 if (rcode == RCODE_COMPLETE && 290 if (rcode == RCODE_COMPLETE &&
291 lock_data[0] != cpu_to_be32(0x3f)) { 291 card->bm_transaction_data[0] != cpu_to_be32(0x3f)) {
292 292
293 /* Somebody else is BM. Only act as IRM. */ 293 /* Somebody else is BM. Only act as IRM. */
294 if (local_id == irm_id) 294 if (local_id == irm_id)
diff --git a/drivers/firewire/core-cdev.c b/drivers/firewire/core-cdev.c
index d1d30c615b0f..ced186d7e9a9 100644
--- a/drivers/firewire/core-cdev.c
+++ b/drivers/firewire/core-cdev.c
@@ -125,6 +125,7 @@ struct iso_resource {
125 int generation; 125 int generation;
126 u64 channels; 126 u64 channels;
127 s32 bandwidth; 127 s32 bandwidth;
128 __be32 transaction_data[2];
128 struct iso_resource_event *e_alloc, *e_dealloc; 129 struct iso_resource_event *e_alloc, *e_dealloc;
129}; 130};
130 131
@@ -1049,7 +1050,8 @@ static void iso_resource_work(struct work_struct *work)
1049 r->channels, &channel, &bandwidth, 1050 r->channels, &channel, &bandwidth,
1050 todo == ISO_RES_ALLOC || 1051 todo == ISO_RES_ALLOC ||
1051 todo == ISO_RES_REALLOC || 1052 todo == ISO_RES_REALLOC ||
1052 todo == ISO_RES_ALLOC_ONCE); 1053 todo == ISO_RES_ALLOC_ONCE,
1054 r->transaction_data);
1053 /* 1055 /*
1054 * Is this generation outdated already? As long as this resource sticks 1056 * Is this generation outdated already? As long as this resource sticks
1055 * in the idr, it will be scheduled again for a newer generation or at 1057 * in the idr, it will be scheduled again for a newer generation or at
diff --git a/drivers/firewire/core-iso.c b/drivers/firewire/core-iso.c
index 166f19c6d38d..110e731f5574 100644
--- a/drivers/firewire/core-iso.c
+++ b/drivers/firewire/core-iso.c
@@ -177,9 +177,8 @@ EXPORT_SYMBOL(fw_iso_context_stop);
177 */ 177 */
178 178
179static int manage_bandwidth(struct fw_card *card, int irm_id, int generation, 179static int manage_bandwidth(struct fw_card *card, int irm_id, int generation,
180 int bandwidth, bool allocate) 180 int bandwidth, bool allocate, __be32 data[2])
181{ 181{
182 __be32 data[2];
183 int try, new, old = allocate ? BANDWIDTH_AVAILABLE_INITIAL : 0; 182 int try, new, old = allocate ? BANDWIDTH_AVAILABLE_INITIAL : 0;
184 183
185 /* 184 /*
@@ -215,9 +214,9 @@ static int manage_bandwidth(struct fw_card *card, int irm_id, int generation,
215} 214}
216 215
217static int manage_channel(struct fw_card *card, int irm_id, int generation, 216static int manage_channel(struct fw_card *card, int irm_id, int generation,
218 u32 channels_mask, u64 offset, bool allocate) 217 u32 channels_mask, u64 offset, bool allocate, __be32 data[2])
219{ 218{
220 __be32 data[2], c, all, old; 219 __be32 c, all, old;
221 int i, retry = 5; 220 int i, retry = 5;
222 221
223 old = all = allocate ? cpu_to_be32(~0) : 0; 222 old = all = allocate ? cpu_to_be32(~0) : 0;
@@ -260,7 +259,7 @@ static int manage_channel(struct fw_card *card, int irm_id, int generation,
260} 259}
261 260
262static void deallocate_channel(struct fw_card *card, int irm_id, 261static void deallocate_channel(struct fw_card *card, int irm_id,
263 int generation, int channel) 262 int generation, int channel, __be32 buffer[2])
264{ 263{
265 u32 mask; 264 u32 mask;
266 u64 offset; 265 u64 offset;
@@ -269,7 +268,7 @@ static void deallocate_channel(struct fw_card *card, int irm_id,
269 offset = channel < 32 ? CSR_REGISTER_BASE + CSR_CHANNELS_AVAILABLE_HI : 268 offset = channel < 32 ? CSR_REGISTER_BASE + CSR_CHANNELS_AVAILABLE_HI :
270 CSR_REGISTER_BASE + CSR_CHANNELS_AVAILABLE_LO; 269 CSR_REGISTER_BASE + CSR_CHANNELS_AVAILABLE_LO;
271 270
272 manage_channel(card, irm_id, generation, mask, offset, false); 271 manage_channel(card, irm_id, generation, mask, offset, false, buffer);
273} 272}
274 273
275/** 274/**
@@ -298,7 +297,7 @@ static void deallocate_channel(struct fw_card *card, int irm_id,
298 */ 297 */
299void fw_iso_resource_manage(struct fw_card *card, int generation, 298void fw_iso_resource_manage(struct fw_card *card, int generation,
300 u64 channels_mask, int *channel, int *bandwidth, 299 u64 channels_mask, int *channel, int *bandwidth,
301 bool allocate) 300 bool allocate, __be32 buffer[2])
302{ 301{
303 u32 channels_hi = channels_mask; /* channels 31...0 */ 302 u32 channels_hi = channels_mask; /* channels 31...0 */
304 u32 channels_lo = channels_mask >> 32; /* channels 63...32 */ 303 u32 channels_lo = channels_mask >> 32; /* channels 63...32 */
@@ -310,10 +309,12 @@ void fw_iso_resource_manage(struct fw_card *card, int generation,
310 309
311 if (channels_hi) 310 if (channels_hi)
312 c = manage_channel(card, irm_id, generation, channels_hi, 311 c = manage_channel(card, irm_id, generation, channels_hi,
313 CSR_REGISTER_BASE + CSR_CHANNELS_AVAILABLE_HI, allocate); 312 CSR_REGISTER_BASE + CSR_CHANNELS_AVAILABLE_HI,
313 allocate, buffer);
314 if (channels_lo && c < 0) { 314 if (channels_lo && c < 0) {
315 c = manage_channel(card, irm_id, generation, channels_lo, 315 c = manage_channel(card, irm_id, generation, channels_lo,
316 CSR_REGISTER_BASE + CSR_CHANNELS_AVAILABLE_LO, allocate); 316 CSR_REGISTER_BASE + CSR_CHANNELS_AVAILABLE_LO,
317 allocate, buffer);
317 if (c >= 0) 318 if (c >= 0)
318 c += 32; 319 c += 32;
319 } 320 }
@@ -325,12 +326,13 @@ void fw_iso_resource_manage(struct fw_card *card, int generation,
325 if (*bandwidth == 0) 326 if (*bandwidth == 0)
326 return; 327 return;
327 328
328 ret = manage_bandwidth(card, irm_id, generation, *bandwidth, allocate); 329 ret = manage_bandwidth(card, irm_id, generation, *bandwidth,
330 allocate, buffer);
329 if (ret < 0) 331 if (ret < 0)
330 *bandwidth = 0; 332 *bandwidth = 0;
331 333
332 if (allocate && ret < 0 && c >= 0) { 334 if (allocate && ret < 0 && c >= 0) {
333 deallocate_channel(card, irm_id, generation, c); 335 deallocate_channel(card, irm_id, generation, c, buffer);
334 *channel = ret; 336 *channel = ret;
335 } 337 }
336} 338}
diff --git a/drivers/firewire/core.h b/drivers/firewire/core.h
index c3cfc647e5e3..6052816be353 100644
--- a/drivers/firewire/core.h
+++ b/drivers/firewire/core.h
@@ -120,7 +120,8 @@ void fw_node_event(struct fw_card *card, struct fw_node *node, int event);
120 120
121int fw_iso_buffer_map(struct fw_iso_buffer *buffer, struct vm_area_struct *vma); 121int fw_iso_buffer_map(struct fw_iso_buffer *buffer, struct vm_area_struct *vma);
122void fw_iso_resource_manage(struct fw_card *card, int generation, 122void fw_iso_resource_manage(struct fw_card *card, int generation,
123 u64 channels_mask, int *channel, int *bandwidth, bool allocate); 123 u64 channels_mask, int *channel, int *bandwidth,
124 bool allocate, __be32 buffer[2]);
124 125
125 126
126/* -topology */ 127/* -topology */
diff --git a/drivers/firewire/sbp2.c b/drivers/firewire/sbp2.c
index 24c45635376a..8d51568ee143 100644
--- a/drivers/firewire/sbp2.c
+++ b/drivers/firewire/sbp2.c
@@ -201,6 +201,12 @@ static struct fw_device *target_device(struct sbp2_target *tgt)
201#define SBP2_CYCLE_LIMIT (0xc8 << 12) /* 200 125us cycles */ 201#define SBP2_CYCLE_LIMIT (0xc8 << 12) /* 200 125us cycles */
202 202
203/* 203/*
204 * There is no transport protocol limit to the CDB length, but we implement
205 * a fixed length only. 16 bytes is enough for disks larger than 2 TB.
206 */
207#define SBP2_MAX_CDB_SIZE 16
208
209/*
204 * The default maximum s/g segment size of a FireWire controller is 210 * The default maximum s/g segment size of a FireWire controller is
205 * usually 0x10000, but SBP-2 only allows 0xffff. Since buffers have to 211 * usually 0x10000, but SBP-2 only allows 0xffff. Since buffers have to
206 * be quadlet-aligned, we set the length limit to 0xffff & ~3. 212 * be quadlet-aligned, we set the length limit to 0xffff & ~3.
@@ -312,7 +318,7 @@ struct sbp2_command_orb {
312 struct sbp2_pointer next; 318 struct sbp2_pointer next;
313 struct sbp2_pointer data_descriptor; 319 struct sbp2_pointer data_descriptor;
314 __be32 misc; 320 __be32 misc;
315 u8 command_block[12]; 321 u8 command_block[SBP2_MAX_CDB_SIZE];
316 } request; 322 } request;
317 struct scsi_cmnd *cmd; 323 struct scsi_cmnd *cmd;
318 scsi_done_fn_t done; 324 scsi_done_fn_t done;
@@ -1146,6 +1152,8 @@ static int sbp2_probe(struct device *dev)
1146 if (fw_device_enable_phys_dma(device) < 0) 1152 if (fw_device_enable_phys_dma(device) < 0)
1147 goto fail_shost_put; 1153 goto fail_shost_put;
1148 1154
1155 shost->max_cmd_len = SBP2_MAX_CDB_SIZE;
1156
1149 if (scsi_add_host(shost, &unit->device) < 0) 1157 if (scsi_add_host(shost, &unit->device) < 0)
1150 goto fail_shost_put; 1158 goto fail_shost_put;
1151 1159
diff --git a/drivers/gpio/Kconfig b/drivers/gpio/Kconfig
index 3582c39f9725..96dda81c9228 100644
--- a/drivers/gpio/Kconfig
+++ b/drivers/gpio/Kconfig
@@ -79,6 +79,12 @@ config GPIO_XILINX
79 help 79 help
80 Say yes here to support the Xilinx FPGA GPIO device 80 Say yes here to support the Xilinx FPGA GPIO device
81 81
82config GPIO_VR41XX
83 tristate "NEC VR4100 series General-purpose I/O Uint support"
84 depends on CPU_VR41XX
85 help
86 Say yes here to support the NEC VR4100 series General-purpose I/O Uint
87
82comment "I2C GPIO expanders:" 88comment "I2C GPIO expanders:"
83 89
84config GPIO_MAX732X 90config GPIO_MAX732X
diff --git a/drivers/gpio/Makefile b/drivers/gpio/Makefile
index ef90203e8f3c..9244c6fcd8be 100644
--- a/drivers/gpio/Makefile
+++ b/drivers/gpio/Makefile
@@ -13,3 +13,4 @@ obj-$(CONFIG_GPIO_PL061) += pl061.o
13obj-$(CONFIG_GPIO_TWL4030) += twl4030-gpio.o 13obj-$(CONFIG_GPIO_TWL4030) += twl4030-gpio.o
14obj-$(CONFIG_GPIO_XILINX) += xilinx_gpio.o 14obj-$(CONFIG_GPIO_XILINX) += xilinx_gpio.o
15obj-$(CONFIG_GPIO_BT8XX) += bt8xxgpio.o 15obj-$(CONFIG_GPIO_BT8XX) += bt8xxgpio.o
16obj-$(CONFIG_GPIO_VR41XX) += vr41xx_giu.o
diff --git a/drivers/gpio/pl061.c b/drivers/gpio/pl061.c
index aa8e7cb020d9..4ee4c8367a3f 100644
--- a/drivers/gpio/pl061.c
+++ b/drivers/gpio/pl061.c
@@ -109,6 +109,16 @@ static void pl061_set_value(struct gpio_chip *gc, unsigned offset, int value)
109 writeb(!!value << offset, chip->base + (1 << (offset + 2))); 109 writeb(!!value << offset, chip->base + (1 << (offset + 2)));
110} 110}
111 111
112static int pl061_to_irq(struct gpio_chip *gc, unsigned offset)
113{
114 struct pl061_gpio *chip = container_of(gc, struct pl061_gpio, gc);
115
116 if (chip->irq_base == (unsigned) -1)
117 return -EINVAL;
118
119 return chip->irq_base + offset;
120}
121
112/* 122/*
113 * PL061 GPIO IRQ 123 * PL061 GPIO IRQ
114 */ 124 */
@@ -200,7 +210,7 @@ static void pl061_irq_handler(unsigned irq, struct irq_desc *desc)
200 desc->chip->ack(irq); 210 desc->chip->ack(irq);
201 list_for_each(ptr, chip_list) { 211 list_for_each(ptr, chip_list) {
202 unsigned long pending; 212 unsigned long pending;
203 int gpio; 213 int offset;
204 214
205 chip = list_entry(ptr, struct pl061_gpio, list); 215 chip = list_entry(ptr, struct pl061_gpio, list);
206 pending = readb(chip->base + GPIOMIS); 216 pending = readb(chip->base + GPIOMIS);
@@ -209,8 +219,8 @@ static void pl061_irq_handler(unsigned irq, struct irq_desc *desc)
209 if (pending == 0) 219 if (pending == 0)
210 continue; 220 continue;
211 221
212 for_each_bit(gpio, &pending, PL061_GPIO_NR) 222 for_each_bit(offset, &pending, PL061_GPIO_NR)
213 generic_handle_irq(gpio_to_irq(gpio)); 223 generic_handle_irq(pl061_to_irq(&chip->gc, offset));
214 } 224 }
215 desc->chip->unmask(irq); 225 desc->chip->unmask(irq);
216} 226}
@@ -221,7 +231,7 @@ static int __init pl061_probe(struct amba_device *dev, struct amba_id *id)
221 struct pl061_gpio *chip; 231 struct pl061_gpio *chip;
222 struct list_head *chip_list; 232 struct list_head *chip_list;
223 int ret, irq, i; 233 int ret, irq, i;
224 static unsigned long init_irq[BITS_TO_LONGS(NR_IRQS)]; 234 static DECLARE_BITMAP(init_irq, NR_IRQS);
225 235
226 pdata = dev->dev.platform_data; 236 pdata = dev->dev.platform_data;
227 if (pdata == NULL) 237 if (pdata == NULL)
@@ -251,6 +261,7 @@ static int __init pl061_probe(struct amba_device *dev, struct amba_id *id)
251 chip->gc.direction_output = pl061_direction_output; 261 chip->gc.direction_output = pl061_direction_output;
252 chip->gc.get = pl061_get_value; 262 chip->gc.get = pl061_get_value;
253 chip->gc.set = pl061_set_value; 263 chip->gc.set = pl061_set_value;
264 chip->gc.to_irq = pl061_to_irq;
254 chip->gc.base = pdata->gpio_base; 265 chip->gc.base = pdata->gpio_base;
255 chip->gc.ngpio = PL061_GPIO_NR; 266 chip->gc.ngpio = PL061_GPIO_NR;
256 chip->gc.label = dev_name(&dev->dev); 267 chip->gc.label = dev_name(&dev->dev);
@@ -280,6 +291,7 @@ static int __init pl061_probe(struct amba_device *dev, struct amba_id *id)
280 if (!test_and_set_bit(irq, init_irq)) { /* list initialized? */ 291 if (!test_and_set_bit(irq, init_irq)) { /* list initialized? */
281 chip_list = kmalloc(sizeof(*chip_list), GFP_KERNEL); 292 chip_list = kmalloc(sizeof(*chip_list), GFP_KERNEL);
282 if (chip_list == NULL) { 293 if (chip_list == NULL) {
294 clear_bit(irq, init_irq);
283 ret = -ENOMEM; 295 ret = -ENOMEM;
284 goto iounmap; 296 goto iounmap;
285 } 297 }
diff --git a/drivers/char/vr41xx_giu.c b/drivers/gpio/vr41xx_giu.c
index 54c837288d19..b16c9a8c03f5 100644
--- a/drivers/char/vr41xx_giu.c
+++ b/drivers/gpio/vr41xx_giu.c
@@ -2,8 +2,8 @@
2 * Driver for NEC VR4100 series General-purpose I/O Unit. 2 * Driver for NEC VR4100 series General-purpose I/O Unit.
3 * 3 *
4 * Copyright (C) 2002 MontaVista Software Inc. 4 * Copyright (C) 2002 MontaVista Software Inc.
5 * Author: Yoichi Yuasa <yyuasa@mvista.com or source@mvista.com> 5 * Author: Yoichi Yuasa <source@mvista.com>
6 * Copyright (C) 2003-2007 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> 6 * Copyright (C) 2003-2009 Yoichi Yuasa <yuasa@linux-mips.org>
7 * 7 *
8 * This program is free software; you can redistribute it and/or modify 8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by 9 * it under the terms of the GNU General Public License as published by
@@ -21,29 +21,25 @@
21 */ 21 */
22#include <linux/errno.h> 22#include <linux/errno.h>
23#include <linux/fs.h> 23#include <linux/fs.h>
24#include <linux/gpio.h>
24#include <linux/init.h> 25#include <linux/init.h>
25#include <linux/interrupt.h> 26#include <linux/interrupt.h>
27#include <linux/io.h>
26#include <linux/irq.h> 28#include <linux/irq.h>
27#include <linux/kernel.h> 29#include <linux/kernel.h>
28#include <linux/module.h> 30#include <linux/module.h>
29#include <linux/platform_device.h> 31#include <linux/platform_device.h>
30#include <linux/smp_lock.h>
31#include <linux/spinlock.h> 32#include <linux/spinlock.h>
32#include <linux/types.h> 33#include <linux/types.h>
33 34
34#include <asm/io.h>
35#include <asm/vr41xx/giu.h> 35#include <asm/vr41xx/giu.h>
36#include <asm/vr41xx/irq.h> 36#include <asm/vr41xx/irq.h>
37#include <asm/vr41xx/vr41xx.h> 37#include <asm/vr41xx/vr41xx.h>
38 38
39MODULE_AUTHOR("Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>"); 39MODULE_AUTHOR("Yoichi Yuasa <yuasa@linux-mips.org>");
40MODULE_DESCRIPTION("NEC VR4100 series General-purpose I/O Unit driver"); 40MODULE_DESCRIPTION("NEC VR4100 series General-purpose I/O Unit driver");
41MODULE_LICENSE("GPL"); 41MODULE_LICENSE("GPL");
42 42
43static int major; /* default is dynamic major device number */
44module_param(major, int, 0);
45MODULE_PARM_DESC(major, "Major device number");
46
47#define GIUIOSELL 0x00 43#define GIUIOSELL 0x00
48#define GIUIOSELH 0x02 44#define GIUIOSELH 0x02
49#define GIUPIODL 0x04 45#define GIUPIODL 0x04
@@ -76,9 +72,13 @@ MODULE_PARM_DESC(major, "Major device number");
76#define GPIO_HAS_OUTPUT_ENABLE 0x0002 72#define GPIO_HAS_OUTPUT_ENABLE 0x0002
77#define GPIO_HAS_INTERRUPT_EDGE_SELECT 0x0100 73#define GPIO_HAS_INTERRUPT_EDGE_SELECT 0x0100
78 74
79static spinlock_t giu_lock; 75enum {
76 GPIO_INPUT,
77 GPIO_OUTPUT,
78};
79
80static DEFINE_SPINLOCK(giu_lock);
80static unsigned long giu_flags; 81static unsigned long giu_flags;
81static unsigned int giu_nr_pins;
82 82
83static void __iomem *giu_base; 83static void __iomem *giu_base;
84 84
@@ -89,9 +89,9 @@ static void __iomem *giu_base;
89#define GIUINT_HIGH_OFFSET 16 89#define GIUINT_HIGH_OFFSET 16
90#define GIUINT_HIGH_MAX 32 90#define GIUINT_HIGH_MAX 32
91 91
92static inline uint16_t giu_set(uint16_t offset, uint16_t set) 92static inline u16 giu_set(u16 offset, u16 set)
93{ 93{
94 uint16_t data; 94 u16 data;
95 95
96 data = giu_read(offset); 96 data = giu_read(offset);
97 data |= set; 97 data |= set;
@@ -100,9 +100,9 @@ static inline uint16_t giu_set(uint16_t offset, uint16_t set)
100 return data; 100 return data;
101} 101}
102 102
103static inline uint16_t giu_clear(uint16_t offset, uint16_t clear) 103static inline u16 giu_clear(u16 offset, u16 clear)
104{ 104{
105 uint16_t data; 105 u16 data;
106 106
107 data = giu_read(offset); 107 data = giu_read(offset);
108 data &= ~clear; 108 data &= ~clear;
@@ -145,7 +145,8 @@ static struct irq_chip giuint_low_irq_chip = {
145 145
146static void ack_giuint_high(unsigned int irq) 146static void ack_giuint_high(unsigned int irq)
147{ 147{
148 giu_write(GIUINTSTATH, 1 << (GPIO_PIN_OF_IRQ(irq) - GIUINT_HIGH_OFFSET)); 148 giu_write(GIUINTSTATH,
149 1 << (GPIO_PIN_OF_IRQ(irq) - GIUINT_HIGH_OFFSET));
149} 150}
150 151
151static void mask_giuint_high(unsigned int irq) 152static void mask_giuint_high(unsigned int irq)
@@ -177,7 +178,7 @@ static struct irq_chip giuint_high_irq_chip = {
177 178
178static int giu_get_irq(unsigned int irq) 179static int giu_get_irq(unsigned int irq)
179{ 180{
180 uint16_t pendl, pendh, maskl, maskh; 181 u16 pendl, pendh, maskl, maskh;
181 int i; 182 int i;
182 183
183 pendl = giu_read(GIUINTSTATL); 184 pendl = giu_read(GIUINTSTATL);
@@ -208,14 +209,15 @@ static int giu_get_irq(unsigned int irq)
208 return -EINVAL; 209 return -EINVAL;
209} 210}
210 211
211void vr41xx_set_irq_trigger(unsigned int pin, irq_trigger_t trigger, irq_signal_t signal) 212void vr41xx_set_irq_trigger(unsigned int pin, irq_trigger_t trigger,
213 irq_signal_t signal)
212{ 214{
213 uint16_t mask; 215 u16 mask;
214 216
215 if (pin < GIUINT_HIGH_OFFSET) { 217 if (pin < GIUINT_HIGH_OFFSET) {
216 mask = 1 << pin; 218 mask = 1 << pin;
217 if (trigger != IRQ_TRIGGER_LEVEL) { 219 if (trigger != IRQ_TRIGGER_LEVEL) {
218 giu_set(GIUINTTYPL, mask); 220 giu_set(GIUINTTYPL, mask);
219 if (signal == IRQ_SIGNAL_HOLD) 221 if (signal == IRQ_SIGNAL_HOLD)
220 giu_set(GIUINTHTSELL, mask); 222 giu_set(GIUINTHTSELL, mask);
221 else 223 else
@@ -237,14 +239,14 @@ void vr41xx_set_irq_trigger(unsigned int pin, irq_trigger_t trigger, irq_signal_
237 } 239 }
238 } 240 }
239 set_irq_chip_and_handler(GIU_IRQ(pin), 241 set_irq_chip_and_handler(GIU_IRQ(pin),
240 &giuint_low_irq_chip, 242 &giuint_low_irq_chip,
241 handle_edge_irq); 243 handle_edge_irq);
242 } else { 244 } else {
243 giu_clear(GIUINTTYPL, mask); 245 giu_clear(GIUINTTYPL, mask);
244 giu_clear(GIUINTHTSELL, mask); 246 giu_clear(GIUINTHTSELL, mask);
245 set_irq_chip_and_handler(GIU_IRQ(pin), 247 set_irq_chip_and_handler(GIU_IRQ(pin),
246 &giuint_low_irq_chip, 248 &giuint_low_irq_chip,
247 handle_level_irq); 249 handle_level_irq);
248 } 250 }
249 giu_write(GIUINTSTATL, mask); 251 giu_write(GIUINTSTATL, mask);
250 } else if (pin < GIUINT_HIGH_MAX) { 252 } else if (pin < GIUINT_HIGH_MAX) {
@@ -272,14 +274,14 @@ void vr41xx_set_irq_trigger(unsigned int pin, irq_trigger_t trigger, irq_signal_
272 } 274 }
273 } 275 }
274 set_irq_chip_and_handler(GIU_IRQ(pin), 276 set_irq_chip_and_handler(GIU_IRQ(pin),
275 &giuint_high_irq_chip, 277 &giuint_high_irq_chip,
276 handle_edge_irq); 278 handle_edge_irq);
277 } else { 279 } else {
278 giu_clear(GIUINTTYPH, mask); 280 giu_clear(GIUINTTYPH, mask);
279 giu_clear(GIUINTHTSELH, mask); 281 giu_clear(GIUINTHTSELH, mask);
280 set_irq_chip_and_handler(GIU_IRQ(pin), 282 set_irq_chip_and_handler(GIU_IRQ(pin),
281 &giuint_high_irq_chip, 283 &giuint_high_irq_chip,
282 handle_level_irq); 284 handle_level_irq);
283 } 285 }
284 giu_write(GIUINTSTATH, mask); 286 giu_write(GIUINTSTATH, mask);
285 } 287 }
@@ -288,7 +290,7 @@ EXPORT_SYMBOL_GPL(vr41xx_set_irq_trigger);
288 290
289void vr41xx_set_irq_level(unsigned int pin, irq_level_t level) 291void vr41xx_set_irq_level(unsigned int pin, irq_level_t level)
290{ 292{
291 uint16_t mask; 293 u16 mask;
292 294
293 if (pin < GIUINT_HIGH_OFFSET) { 295 if (pin < GIUINT_HIGH_OFFSET) {
294 mask = 1 << pin; 296 mask = 1 << pin;
@@ -308,89 +310,24 @@ void vr41xx_set_irq_level(unsigned int pin, irq_level_t level)
308} 310}
309EXPORT_SYMBOL_GPL(vr41xx_set_irq_level); 311EXPORT_SYMBOL_GPL(vr41xx_set_irq_level);
310 312
311gpio_data_t vr41xx_gpio_get_pin(unsigned int pin) 313static int giu_set_direction(struct gpio_chip *chip, unsigned pin, int dir)
312{
313 uint16_t reg, mask;
314
315 if (pin >= giu_nr_pins)
316 return GPIO_DATA_INVAL;
317
318 if (pin < 16) {
319 reg = giu_read(GIUPIODL);
320 mask = (uint16_t)1 << pin;
321 } else if (pin < 32) {
322 reg = giu_read(GIUPIODH);
323 mask = (uint16_t)1 << (pin - 16);
324 } else if (pin < 48) {
325 reg = giu_read(GIUPODATL);
326 mask = (uint16_t)1 << (pin - 32);
327 } else {
328 reg = giu_read(GIUPODATH);
329 mask = (uint16_t)1 << (pin - 48);
330 }
331
332 if (reg & mask)
333 return GPIO_DATA_HIGH;
334
335 return GPIO_DATA_LOW;
336}
337EXPORT_SYMBOL_GPL(vr41xx_gpio_get_pin);
338
339int vr41xx_gpio_set_pin(unsigned int pin, gpio_data_t data)
340{
341 uint16_t offset, mask, reg;
342 unsigned long flags;
343
344 if (pin >= giu_nr_pins)
345 return -EINVAL;
346
347 if (pin < 16) {
348 offset = GIUPIODL;
349 mask = (uint16_t)1 << pin;
350 } else if (pin < 32) {
351 offset = GIUPIODH;
352 mask = (uint16_t)1 << (pin - 16);
353 } else if (pin < 48) {
354 offset = GIUPODATL;
355 mask = (uint16_t)1 << (pin - 32);
356 } else {
357 offset = GIUPODATH;
358 mask = (uint16_t)1 << (pin - 48);
359 }
360
361 spin_lock_irqsave(&giu_lock, flags);
362
363 reg = giu_read(offset);
364 if (data == GPIO_DATA_HIGH)
365 reg |= mask;
366 else
367 reg &= ~mask;
368 giu_write(offset, reg);
369
370 spin_unlock_irqrestore(&giu_lock, flags);
371
372 return 0;
373}
374EXPORT_SYMBOL_GPL(vr41xx_gpio_set_pin);
375
376int vr41xx_gpio_set_direction(unsigned int pin, gpio_direction_t dir)
377{ 314{
378 uint16_t offset, mask, reg; 315 u16 offset, mask, reg;
379 unsigned long flags; 316 unsigned long flags;
380 317
381 if (pin >= giu_nr_pins) 318 if (pin >= chip->ngpio)
382 return -EINVAL; 319 return -EINVAL;
383 320
384 if (pin < 16) { 321 if (pin < 16) {
385 offset = GIUIOSELL; 322 offset = GIUIOSELL;
386 mask = (uint16_t)1 << pin; 323 mask = 1 << pin;
387 } else if (pin < 32) { 324 } else if (pin < 32) {
388 offset = GIUIOSELH; 325 offset = GIUIOSELH;
389 mask = (uint16_t)1 << (pin - 16); 326 mask = 1 << (pin - 16);
390 } else { 327 } else {
391 if (giu_flags & GPIO_HAS_OUTPUT_ENABLE) { 328 if (giu_flags & GPIO_HAS_OUTPUT_ENABLE) {
392 offset = GIUPODATEN; 329 offset = GIUPODATEN;
393 mask = (uint16_t)1 << (pin - 32); 330 mask = 1 << (pin - 32);
394 } else { 331 } else {
395 switch (pin) { 332 switch (pin) {
396 case 48: 333 case 48:
@@ -420,11 +357,10 @@ int vr41xx_gpio_set_direction(unsigned int pin, gpio_direction_t dir)
420 357
421 return 0; 358 return 0;
422} 359}
423EXPORT_SYMBOL_GPL(vr41xx_gpio_set_direction);
424 360
425int vr41xx_gpio_pullupdown(unsigned int pin, gpio_pull_t pull) 361int vr41xx_gpio_pullupdown(unsigned int pin, gpio_pull_t pull)
426{ 362{
427 uint16_t reg, mask; 363 u16 reg, mask;
428 unsigned long flags; 364 unsigned long flags;
429 365
430 if ((giu_flags & GPIO_HAS_PULLUPDOWN_IO) != GPIO_HAS_PULLUPDOWN_IO) 366 if ((giu_flags & GPIO_HAS_PULLUPDOWN_IO) != GPIO_HAS_PULLUPDOWN_IO)
@@ -433,7 +369,7 @@ int vr41xx_gpio_pullupdown(unsigned int pin, gpio_pull_t pull)
433 if (pin >= 15) 369 if (pin >= 15)
434 return -EINVAL; 370 return -EINVAL;
435 371
436 mask = (uint16_t)1 << pin; 372 mask = 1 << pin;
437 373
438 spin_lock_irqsave(&giu_lock, flags); 374 spin_lock_irqsave(&giu_lock, flags);
439 375
@@ -460,146 +396,125 @@ int vr41xx_gpio_pullupdown(unsigned int pin, gpio_pull_t pull)
460} 396}
461EXPORT_SYMBOL_GPL(vr41xx_gpio_pullupdown); 397EXPORT_SYMBOL_GPL(vr41xx_gpio_pullupdown);
462 398
463static ssize_t gpio_read(struct file *file, char __user *buf, size_t len, 399static int vr41xx_gpio_get(struct gpio_chip *chip, unsigned pin)
464 loff_t *ppos)
465{ 400{
466 unsigned int pin; 401 u16 reg, mask;
467 char value = '0';
468 402
469 pin = iminor(file->f_path.dentry->d_inode); 403 if (pin >= chip->ngpio)
470 if (pin >= giu_nr_pins) 404 return -EINVAL;
471 return -EBADF;
472
473 if (vr41xx_gpio_get_pin(pin) == GPIO_DATA_HIGH)
474 value = '1';
475 405
476 if (len <= 0) 406 if (pin < 16) {
477 return -EFAULT; 407 reg = giu_read(GIUPIODL);
408 mask = 1 << pin;
409 } else if (pin < 32) {
410 reg = giu_read(GIUPIODH);
411 mask = 1 << (pin - 16);
412 } else if (pin < 48) {
413 reg = giu_read(GIUPODATL);
414 mask = 1 << (pin - 32);
415 } else {
416 reg = giu_read(GIUPODATH);
417 mask = 1 << (pin - 48);
418 }
478 419
479 if (put_user(value, buf)) 420 if (reg & mask)
480 return -EFAULT; 421 return 1;
481 422
482 return 1; 423 return 0;
483} 424}
484 425
485static ssize_t gpio_write(struct file *file, const char __user *data, 426static void vr41xx_gpio_set(struct gpio_chip *chip, unsigned pin,
486 size_t len, loff_t *ppos) 427 int value)
487{ 428{
488 unsigned int pin; 429 u16 offset, mask, reg;
489 size_t i; 430 unsigned long flags;
490 char c; 431
491 int retval = 0; 432 if (pin >= chip->ngpio)
492 433 return;
493 pin = iminor(file->f_path.dentry->d_inode);
494 if (pin >= giu_nr_pins)
495 return -EBADF;
496
497 for (i = 0; i < len; i++) {
498 if (get_user(c, data + i))
499 return -EFAULT;
500
501 switch (c) {
502 case '0':
503 retval = vr41xx_gpio_set_pin(pin, GPIO_DATA_LOW);
504 break;
505 case '1':
506 retval = vr41xx_gpio_set_pin(pin, GPIO_DATA_HIGH);
507 break;
508 case 'D':
509 printk(KERN_INFO "GPIO%d: pull down\n", pin);
510 retval = vr41xx_gpio_pullupdown(pin, GPIO_PULL_DOWN);
511 break;
512 case 'd':
513 printk(KERN_INFO "GPIO%d: pull up/down disable\n", pin);
514 retval = vr41xx_gpio_pullupdown(pin, GPIO_PULL_DISABLE);
515 break;
516 case 'I':
517 printk(KERN_INFO "GPIO%d: input\n", pin);
518 retval = vr41xx_gpio_set_direction(pin, GPIO_INPUT);
519 break;
520 case 'O':
521 printk(KERN_INFO "GPIO%d: output\n", pin);
522 retval = vr41xx_gpio_set_direction(pin, GPIO_OUTPUT);
523 break;
524 case 'o':
525 printk(KERN_INFO "GPIO%d: output disable\n", pin);
526 retval = vr41xx_gpio_set_direction(pin, GPIO_OUTPUT_DISABLE);
527 break;
528 case 'P':
529 printk(KERN_INFO "GPIO%d: pull up\n", pin);
530 retval = vr41xx_gpio_pullupdown(pin, GPIO_PULL_UP);
531 break;
532 case 'p':
533 printk(KERN_INFO "GPIO%d: pull up/down disable\n", pin);
534 retval = vr41xx_gpio_pullupdown(pin, GPIO_PULL_DISABLE);
535 break;
536 default:
537 break;
538 }
539 434
540 if (retval < 0) 435 if (pin < 16) {
541 break; 436 offset = GIUPIODL;
437 mask = 1 << pin;
438 } else if (pin < 32) {
439 offset = GIUPIODH;
440 mask = 1 << (pin - 16);
441 } else if (pin < 48) {
442 offset = GIUPODATL;
443 mask = 1 << (pin - 32);
444 } else {
445 offset = GIUPODATH;
446 mask = 1 << (pin - 48);
542 } 447 }
543 448
544 return i; 449 spin_lock_irqsave(&giu_lock, flags);
450
451 reg = giu_read(offset);
452 if (value)
453 reg |= mask;
454 else
455 reg &= ~mask;
456 giu_write(offset, reg);
457
458 spin_unlock_irqrestore(&giu_lock, flags);
545} 459}
546 460
547static int gpio_open(struct inode *inode, struct file *file) 461
462static int vr41xx_gpio_direction_input(struct gpio_chip *chip, unsigned offset)
548{ 463{
549 unsigned int pin; 464 return giu_set_direction(chip, offset, GPIO_INPUT);
465}
550 466
551 cycle_kernel_lock(); 467static int vr41xx_gpio_direction_output(struct gpio_chip *chip, unsigned offset,
552 pin = iminor(inode); 468 int value)
553 if (pin >= giu_nr_pins) 469{
554 return -EBADF; 470 vr41xx_gpio_set(chip, offset, value);
555 471
556 return nonseekable_open(inode, file); 472 return giu_set_direction(chip, offset, GPIO_OUTPUT);
557} 473}
558 474
559static int gpio_release(struct inode *inode, struct file *file) 475static int vr41xx_gpio_to_irq(struct gpio_chip *chip, unsigned offset)
560{ 476{
561 unsigned int pin; 477 if (offset >= chip->ngpio)
562 478 return -EINVAL;
563 pin = iminor(inode);
564 if (pin >= giu_nr_pins)
565 return -EBADF;
566 479
567 return 0; 480 return GIU_IRQ_BASE + offset;
568} 481}
569 482
570static const struct file_operations gpio_fops = { 483static struct gpio_chip vr41xx_gpio_chip = {
571 .owner = THIS_MODULE, 484 .label = "vr41xx",
572 .read = gpio_read, 485 .owner = THIS_MODULE,
573 .write = gpio_write, 486 .direction_input = vr41xx_gpio_direction_input,
574 .open = gpio_open, 487 .get = vr41xx_gpio_get,
575 .release = gpio_release, 488 .direction_output = vr41xx_gpio_direction_output,
489 .set = vr41xx_gpio_set,
490 .to_irq = vr41xx_gpio_to_irq,
576}; 491};
577 492
578static int __devinit giu_probe(struct platform_device *dev) 493static int __devinit giu_probe(struct platform_device *pdev)
579{ 494{
580 struct resource *res; 495 struct resource *res;
581 unsigned int trigger, i, pin; 496 unsigned int trigger, i, pin;
582 struct irq_chip *chip; 497 struct irq_chip *chip;
583 int irq, retval; 498 int irq, retval;
584 499
585 switch (dev->id) { 500 switch (pdev->id) {
586 case GPIO_50PINS_PULLUPDOWN: 501 case GPIO_50PINS_PULLUPDOWN:
587 giu_flags = GPIO_HAS_PULLUPDOWN_IO; 502 giu_flags = GPIO_HAS_PULLUPDOWN_IO;
588 giu_nr_pins = 50; 503 vr41xx_gpio_chip.ngpio = 50;
589 break; 504 break;
590 case GPIO_36PINS: 505 case GPIO_36PINS:
591 giu_nr_pins = 36; 506 vr41xx_gpio_chip.ngpio = 36;
592 break; 507 break;
593 case GPIO_48PINS_EDGE_SELECT: 508 case GPIO_48PINS_EDGE_SELECT:
594 giu_flags = GPIO_HAS_INTERRUPT_EDGE_SELECT; 509 giu_flags = GPIO_HAS_INTERRUPT_EDGE_SELECT;
595 giu_nr_pins = 48; 510 vr41xx_gpio_chip.ngpio = 48;
596 break; 511 break;
597 default: 512 default:
598 printk(KERN_ERR "GIU: unknown ID %d\n", dev->id); 513 dev_err(&pdev->dev, "GIU: unknown ID %d\n", pdev->id);
599 return -ENODEV; 514 return -ENODEV;
600 } 515 }
601 516
602 res = platform_get_resource(dev, IORESOURCE_MEM, 0); 517 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
603 if (!res) 518 if (!res)
604 return -EBUSY; 519 return -EBUSY;
605 520
@@ -607,19 +522,9 @@ static int __devinit giu_probe(struct platform_device *dev)
607 if (!giu_base) 522 if (!giu_base)
608 return -ENOMEM; 523 return -ENOMEM;
609 524
610 retval = register_chrdev(major, "GIU", &gpio_fops); 525 vr41xx_gpio_chip.dev = &pdev->dev;
611 if (retval < 0) {
612 iounmap(giu_base);
613 giu_base = NULL;
614 return retval;
615 }
616
617 if (major == 0) {
618 major = retval;
619 printk(KERN_INFO "GIU: major number %d\n", major);
620 }
621 526
622 spin_lock_init(&giu_lock); 527 retval = gpiochip_add(&vr41xx_gpio_chip);
623 528
624 giu_write(GIUINTENL, 0); 529 giu_write(GIUINTENL, 0);
625 giu_write(GIUINTENH, 0); 530 giu_write(GIUINTENH, 0);
@@ -640,14 +545,14 @@ static int __devinit giu_probe(struct platform_device *dev)
640 545
641 } 546 }
642 547
643 irq = platform_get_irq(dev, 0); 548 irq = platform_get_irq(pdev, 0);
644 if (irq < 0 || irq >= nr_irqs) 549 if (irq < 0 || irq >= nr_irqs)
645 return -EBUSY; 550 return -EBUSY;
646 551
647 return cascade_irq(irq, giu_get_irq); 552 return cascade_irq(irq, giu_get_irq);
648} 553}
649 554
650static int __devexit giu_remove(struct platform_device *dev) 555static int __devexit giu_remove(struct platform_device *pdev)
651{ 556{
652 if (giu_base) { 557 if (giu_base) {
653 iounmap(giu_base); 558 iounmap(giu_base);
diff --git a/drivers/gpu/drm/Kconfig b/drivers/gpu/drm/Kconfig
index c961fe415aef..39b393d38bb3 100644
--- a/drivers/gpu/drm/Kconfig
+++ b/drivers/gpu/drm/Kconfig
@@ -81,6 +81,7 @@ config DRM_I830
81 81
82config DRM_I915 82config DRM_I915
83 tristate "i915 driver" 83 tristate "i915 driver"
84 depends on AGP_INTEL
84 select FB_CFB_FILLRECT 85 select FB_CFB_FILLRECT
85 select FB_CFB_COPYAREA 86 select FB_CFB_COPYAREA
86 select FB_CFB_IMAGEBLIT 87 select FB_CFB_IMAGEBLIT
diff --git a/drivers/gpu/drm/Makefile b/drivers/gpu/drm/Makefile
index 4e89ab08b7b8..fe23f29f7cba 100644
--- a/drivers/gpu/drm/Makefile
+++ b/drivers/gpu/drm/Makefile
@@ -16,6 +16,7 @@ drm-y := drm_auth.o drm_bufs.o drm_cache.o \
16drm-$(CONFIG_COMPAT) += drm_ioc32.o 16drm-$(CONFIG_COMPAT) += drm_ioc32.o
17 17
18obj-$(CONFIG_DRM) += drm.o 18obj-$(CONFIG_DRM) += drm.o
19obj-$(CONFIG_DRM_TTM) += ttm/
19obj-$(CONFIG_DRM_TDFX) += tdfx/ 20obj-$(CONFIG_DRM_TDFX) += tdfx/
20obj-$(CONFIG_DRM_R128) += r128/ 21obj-$(CONFIG_DRM_R128) += r128/
21obj-$(CONFIG_DRM_RADEON)+= radeon/ 22obj-$(CONFIG_DRM_RADEON)+= radeon/
@@ -26,4 +27,3 @@ obj-$(CONFIG_DRM_I915) += i915/
26obj-$(CONFIG_DRM_SIS) += sis/ 27obj-$(CONFIG_DRM_SIS) += sis/
27obj-$(CONFIG_DRM_SAVAGE)+= savage/ 28obj-$(CONFIG_DRM_SAVAGE)+= savage/
28obj-$(CONFIG_DRM_VIA) +=via/ 29obj-$(CONFIG_DRM_VIA) +=via/
29obj-$(CONFIG_DRM_TTM) += ttm/
diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c
index 8fab7890a363..33be210d6723 100644
--- a/drivers/gpu/drm/drm_crtc.c
+++ b/drivers/gpu/drm/drm_crtc.c
@@ -1461,7 +1461,7 @@ int drm_mode_setcrtc(struct drm_device *dev, void *data,
1461 goto out; 1461 goto out;
1462 } 1462 }
1463 1463
1464 if (crtc_req->count_connectors > 0 && !mode && !fb) { 1464 if (crtc_req->count_connectors > 0 && (!mode || !fb)) {
1465 DRM_DEBUG("Count connectors is %d but no mode or fb set\n", 1465 DRM_DEBUG("Count connectors is %d but no mode or fb set\n",
1466 crtc_req->count_connectors); 1466 crtc_req->count_connectors);
1467 ret = -EINVAL; 1467 ret = -EINVAL;
diff --git a/drivers/gpu/drm/drm_crtc_helper.c b/drivers/gpu/drm/drm_crtc_helper.c
index a6f73f1e99d9..6aaa2cb23365 100644
--- a/drivers/gpu/drm/drm_crtc_helper.c
+++ b/drivers/gpu/drm/drm_crtc_helper.c
@@ -706,8 +706,8 @@ int drm_crtc_helper_set_config(struct drm_mode_set *set)
706 struct drm_encoder **save_encoders, *new_encoder; 706 struct drm_encoder **save_encoders, *new_encoder;
707 struct drm_framebuffer *old_fb = NULL; 707 struct drm_framebuffer *old_fb = NULL;
708 bool save_enabled; 708 bool save_enabled;
709 bool mode_changed = false; 709 bool mode_changed = false; /* if true do a full mode set */
710 bool fb_changed = false; 710 bool fb_changed = false; /* if true and !mode_changed just do a flip */
711 struct drm_connector *connector; 711 struct drm_connector *connector;
712 int count = 0, ro, fail = 0; 712 int count = 0, ro, fail = 0;
713 struct drm_crtc_helper_funcs *crtc_funcs; 713 struct drm_crtc_helper_funcs *crtc_funcs;
@@ -758,6 +758,8 @@ int drm_crtc_helper_set_config(struct drm_mode_set *set)
758 if (set->crtc->fb == NULL) { 758 if (set->crtc->fb == NULL) {
759 DRM_DEBUG("crtc has no fb, full mode set\n"); 759 DRM_DEBUG("crtc has no fb, full mode set\n");
760 mode_changed = true; 760 mode_changed = true;
761 } else if (set->fb == NULL) {
762 mode_changed = true;
761 } else if ((set->fb->bits_per_pixel != 763 } else if ((set->fb->bits_per_pixel !=
762 set->crtc->fb->bits_per_pixel) || 764 set->crtc->fb->bits_per_pixel) ||
763 set->fb->depth != set->crtc->fb->depth) 765 set->fb->depth != set->crtc->fb->depth)
@@ -1090,6 +1092,8 @@ int drm_helper_resume_force_mode(struct drm_device *dev)
1090 if (ret == false) 1092 if (ret == false)
1091 DRM_ERROR("failed to set mode on crtc %p\n", crtc); 1093 DRM_ERROR("failed to set mode on crtc %p\n", crtc);
1092 } 1094 }
1095 /* disable the unused connectors while restoring the modesetting */
1096 drm_helper_disable_unused_functions(dev);
1093 return 0; 1097 return 0;
1094} 1098}
1095EXPORT_SYMBOL(drm_helper_resume_force_mode); 1099EXPORT_SYMBOL(drm_helper_resume_force_mode);
diff --git a/drivers/gpu/drm/drm_debugfs.c b/drivers/gpu/drm/drm_debugfs.c
index 2960b6d73456..9903f270e440 100644
--- a/drivers/gpu/drm/drm_debugfs.c
+++ b/drivers/gpu/drm/drm_debugfs.c
@@ -101,6 +101,10 @@ int drm_debugfs_create_files(struct drm_info_list *files, int count,
101 continue; 101 continue;
102 102
103 tmp = kmalloc(sizeof(struct drm_info_node), GFP_KERNEL); 103 tmp = kmalloc(sizeof(struct drm_info_node), GFP_KERNEL);
104 if (tmp == NULL) {
105 ret = -1;
106 goto fail;
107 }
104 ent = debugfs_create_file(files[i].name, S_IFREG | S_IRUGO, 108 ent = debugfs_create_file(files[i].name, S_IFREG | S_IRUGO,
105 root, tmp, &drm_debugfs_fops); 109 root, tmp, &drm_debugfs_fops);
106 if (!ent) { 110 if (!ent) {
diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
index 7d0835226f6e..80cc6d06d61b 100644
--- a/drivers/gpu/drm/drm_edid.c
+++ b/drivers/gpu/drm/drm_edid.c
@@ -294,10 +294,10 @@ static struct drm_display_mode *drm_mode_detailed(struct drm_device *dev,
294 unsigned vactive = (pt->vactive_vblank_hi & 0xf0) << 4 | pt->vactive_lo; 294 unsigned vactive = (pt->vactive_vblank_hi & 0xf0) << 4 | pt->vactive_lo;
295 unsigned hblank = (pt->hactive_hblank_hi & 0xf) << 8 | pt->hblank_lo; 295 unsigned hblank = (pt->hactive_hblank_hi & 0xf) << 8 | pt->hblank_lo;
296 unsigned vblank = (pt->vactive_vblank_hi & 0xf) << 8 | pt->vblank_lo; 296 unsigned vblank = (pt->vactive_vblank_hi & 0xf) << 8 | pt->vblank_lo;
297 unsigned hsync_offset = (pt->hsync_vsync_offset_pulse_width_hi & 0x3) << 8 | pt->hsync_offset_lo; 297 unsigned hsync_offset = (pt->hsync_vsync_offset_pulse_width_hi & 0xc0) << 2 | pt->hsync_offset_lo;
298 unsigned hsync_pulse_width = (pt->hsync_vsync_offset_pulse_width_hi & 0xc) << 6 | pt->hsync_pulse_width_lo; 298 unsigned hsync_pulse_width = (pt->hsync_vsync_offset_pulse_width_hi & 0x30) << 4 | pt->hsync_pulse_width_lo;
299 unsigned vsync_offset = (pt->hsync_vsync_offset_pulse_width_hi & 0x30) | (pt->vsync_offset_pulse_width_lo & 0xf); 299 unsigned vsync_offset = (pt->hsync_vsync_offset_pulse_width_hi & 0xc) >> 2 | pt->vsync_offset_pulse_width_lo >> 4;
300 unsigned vsync_pulse_width = (pt->hsync_vsync_offset_pulse_width_hi & 0xc0) >> 2 | pt->vsync_offset_pulse_width_lo >> 4; 300 unsigned vsync_pulse_width = (pt->hsync_vsync_offset_pulse_width_hi & 0x3) << 4 | (pt->vsync_offset_pulse_width_lo & 0xf);
301 301
302 /* ignore tiny modes */ 302 /* ignore tiny modes */
303 if (hactive < 64 || vactive < 64) 303 if (hactive < 64 || vactive < 64)
@@ -347,8 +347,8 @@ static struct drm_display_mode *drm_mode_detailed(struct drm_device *dev,
347 mode->flags |= (pt->misc & DRM_EDID_PT_VSYNC_POSITIVE) ? 347 mode->flags |= (pt->misc & DRM_EDID_PT_VSYNC_POSITIVE) ?
348 DRM_MODE_FLAG_PVSYNC : DRM_MODE_FLAG_NVSYNC; 348 DRM_MODE_FLAG_PVSYNC : DRM_MODE_FLAG_NVSYNC;
349 349
350 mode->width_mm = pt->width_mm_lo | (pt->width_height_mm_hi & 0xf) << 8; 350 mode->width_mm = pt->width_mm_lo | (pt->width_height_mm_hi & 0xf0) << 4;
351 mode->height_mm = pt->height_mm_lo | (pt->width_height_mm_hi & 0xf0) << 4; 351 mode->height_mm = pt->height_mm_lo | (pt->width_height_mm_hi & 0xf) << 8;
352 352
353 if (quirks & EDID_QUIRK_DETAILED_IN_CM) { 353 if (quirks & EDID_QUIRK_DETAILED_IN_CM) {
354 mode->width_mm *= 10; 354 mode->width_mm *= 10;
diff --git a/drivers/gpu/drm/drm_gem.c b/drivers/gpu/drm/drm_gem.c
index 8104ecaea26f..ffe8f4394d50 100644
--- a/drivers/gpu/drm/drm_gem.c
+++ b/drivers/gpu/drm/drm_gem.c
@@ -134,26 +134,29 @@ drm_gem_object_alloc(struct drm_device *dev, size_t size)
134 BUG_ON((size & (PAGE_SIZE - 1)) != 0); 134 BUG_ON((size & (PAGE_SIZE - 1)) != 0);
135 135
136 obj = kzalloc(sizeof(*obj), GFP_KERNEL); 136 obj = kzalloc(sizeof(*obj), GFP_KERNEL);
137 if (!obj)
138 goto free;
137 139
138 obj->dev = dev; 140 obj->dev = dev;
139 obj->filp = shmem_file_setup("drm mm object", size, VM_NORESERVE); 141 obj->filp = shmem_file_setup("drm mm object", size, VM_NORESERVE);
140 if (IS_ERR(obj->filp)) { 142 if (IS_ERR(obj->filp))
141 kfree(obj); 143 goto free;
142 return NULL;
143 }
144 144
145 kref_init(&obj->refcount); 145 kref_init(&obj->refcount);
146 kref_init(&obj->handlecount); 146 kref_init(&obj->handlecount);
147 obj->size = size; 147 obj->size = size;
148 if (dev->driver->gem_init_object != NULL && 148 if (dev->driver->gem_init_object != NULL &&
149 dev->driver->gem_init_object(obj) != 0) { 149 dev->driver->gem_init_object(obj) != 0) {
150 fput(obj->filp); 150 goto fput;
151 kfree(obj);
152 return NULL;
153 } 151 }
154 atomic_inc(&dev->object_count); 152 atomic_inc(&dev->object_count);
155 atomic_add(obj->size, &dev->object_memory); 153 atomic_add(obj->size, &dev->object_memory);
156 return obj; 154 return obj;
155fput:
156 fput(obj->filp);
157free:
158 kfree(obj);
159 return NULL;
157} 160}
158EXPORT_SYMBOL(drm_gem_object_alloc); 161EXPORT_SYMBOL(drm_gem_object_alloc);
159 162
diff --git a/drivers/gpu/drm/drm_irq.c b/drivers/gpu/drm/drm_irq.c
index b4a3dbcebe9b..f85aaf21e783 100644
--- a/drivers/gpu/drm/drm_irq.c
+++ b/drivers/gpu/drm/drm_irq.c
@@ -566,7 +566,7 @@ int drm_wait_vblank(struct drm_device *dev, void *data,
566 566
567 ret = drm_vblank_get(dev, crtc); 567 ret = drm_vblank_get(dev, crtc);
568 if (ret) { 568 if (ret) {
569 DRM_ERROR("failed to acquire vblank counter, %d\n", ret); 569 DRM_DEBUG("failed to acquire vblank counter, %d\n", ret);
570 return ret; 570 return ret;
571 } 571 }
572 seq = drm_vblank_count(dev, crtc); 572 seq = drm_vblank_count(dev, crtc);
diff --git a/drivers/gpu/drm/drm_modes.c b/drivers/gpu/drm/drm_modes.c
index 54f492a488a9..7914097b09c6 100644
--- a/drivers/gpu/drm/drm_modes.c
+++ b/drivers/gpu/drm/drm_modes.c
@@ -566,6 +566,8 @@ void drm_mode_connector_list_update(struct drm_connector *connector)
566 found_it = 1; 566 found_it = 1;
567 /* if equal delete the probed mode */ 567 /* if equal delete the probed mode */
568 mode->status = pmode->status; 568 mode->status = pmode->status;
569 /* Merge type bits together */
570 mode->type |= pmode->type;
569 list_del(&pmode->head); 571 list_del(&pmode->head);
570 drm_mode_destroy(connector->dev, pmode); 572 drm_mode_destroy(connector->dev, pmode);
571 break; 573 break;
diff --git a/drivers/gpu/drm/drm_stub.c b/drivers/gpu/drm/drm_stub.c
index 155a5bbce680..55bb8a82d612 100644
--- a/drivers/gpu/drm/drm_stub.c
+++ b/drivers/gpu/drm/drm_stub.c
@@ -489,7 +489,7 @@ int drm_put_minor(struct drm_minor **minor_p)
489 */ 489 */
490void drm_put_dev(struct drm_device *dev) 490void drm_put_dev(struct drm_device *dev)
491{ 491{
492 struct drm_driver *driver = dev->driver; 492 struct drm_driver *driver;
493 struct drm_map_list *r_list, *list_temp; 493 struct drm_map_list *r_list, *list_temp;
494 494
495 DRM_DEBUG("\n"); 495 DRM_DEBUG("\n");
@@ -498,6 +498,7 @@ void drm_put_dev(struct drm_device *dev)
498 DRM_ERROR("cleanup called no dev\n"); 498 DRM_ERROR("cleanup called no dev\n");
499 return; 499 return;
500 } 500 }
501 driver = dev->driver;
501 502
502 drm_vblank_cleanup(dev); 503 drm_vblank_cleanup(dev);
503 504
diff --git a/drivers/gpu/drm/i915/Makefile b/drivers/gpu/drm/i915/Makefile
index 51c5a050aa73..30d6b99fb302 100644
--- a/drivers/gpu/drm/i915/Makefile
+++ b/drivers/gpu/drm/i915/Makefile
@@ -13,6 +13,8 @@ i915-y := i915_drv.o i915_dma.o i915_irq.o i915_mem.o \
13 intel_crt.o \ 13 intel_crt.o \
14 intel_lvds.o \ 14 intel_lvds.o \
15 intel_bios.o \ 15 intel_bios.o \
16 intel_dp.o \
17 intel_dp_i2c.o \
16 intel_hdmi.o \ 18 intel_hdmi.o \
17 intel_sdvo.o \ 19 intel_sdvo.o \
18 intel_modes.o \ 20 intel_modes.o \
diff --git a/drivers/gpu/drm/i915/dvo.h b/drivers/gpu/drm/i915/dvo.h
index e747ac42fe3a..288fc50627e2 100644
--- a/drivers/gpu/drm/i915/dvo.h
+++ b/drivers/gpu/drm/i915/dvo.h
@@ -37,7 +37,7 @@ struct intel_dvo_device {
37 /* GPIO register used for i2c bus to control this device */ 37 /* GPIO register used for i2c bus to control this device */
38 u32 gpio; 38 u32 gpio;
39 int slave_addr; 39 int slave_addr;
40 struct intel_i2c_chan *i2c_bus; 40 struct i2c_adapter *i2c_bus;
41 41
42 const struct intel_dvo_dev_ops *dev_ops; 42 const struct intel_dvo_dev_ops *dev_ops;
43 void *dev_priv; 43 void *dev_priv;
@@ -52,7 +52,7 @@ struct intel_dvo_dev_ops {
52 * Returns NULL if the device does not exist. 52 * Returns NULL if the device does not exist.
53 */ 53 */
54 bool (*init)(struct intel_dvo_device *dvo, 54 bool (*init)(struct intel_dvo_device *dvo,
55 struct intel_i2c_chan *i2cbus); 55 struct i2c_adapter *i2cbus);
56 56
57 /* 57 /*
58 * Called to allow the output a chance to create properties after the 58 * Called to allow the output a chance to create properties after the
diff --git a/drivers/gpu/drm/i915/dvo_ch7017.c b/drivers/gpu/drm/i915/dvo_ch7017.c
index 03d4b4973b02..621815b531db 100644
--- a/drivers/gpu/drm/i915/dvo_ch7017.c
+++ b/drivers/gpu/drm/i915/dvo_ch7017.c
@@ -176,19 +176,20 @@ static void ch7017_dpms(struct intel_dvo_device *dvo, int mode);
176 176
177static bool ch7017_read(struct intel_dvo_device *dvo, int addr, uint8_t *val) 177static bool ch7017_read(struct intel_dvo_device *dvo, int addr, uint8_t *val)
178{ 178{
179 struct intel_i2c_chan *i2cbus = dvo->i2c_bus; 179 struct i2c_adapter *adapter = dvo->i2c_bus;
180 struct intel_i2c_chan *i2cbus = container_of(adapter, struct intel_i2c_chan, adapter);
180 u8 out_buf[2]; 181 u8 out_buf[2];
181 u8 in_buf[2]; 182 u8 in_buf[2];
182 183
183 struct i2c_msg msgs[] = { 184 struct i2c_msg msgs[] = {
184 { 185 {
185 .addr = i2cbus->slave_addr, 186 .addr = dvo->slave_addr,
186 .flags = 0, 187 .flags = 0,
187 .len = 1, 188 .len = 1,
188 .buf = out_buf, 189 .buf = out_buf,
189 }, 190 },
190 { 191 {
191 .addr = i2cbus->slave_addr, 192 .addr = dvo->slave_addr,
192 .flags = I2C_M_RD, 193 .flags = I2C_M_RD,
193 .len = 1, 194 .len = 1,
194 .buf = in_buf, 195 .buf = in_buf,
@@ -208,10 +209,11 @@ static bool ch7017_read(struct intel_dvo_device *dvo, int addr, uint8_t *val)
208 209
209static bool ch7017_write(struct intel_dvo_device *dvo, int addr, uint8_t val) 210static bool ch7017_write(struct intel_dvo_device *dvo, int addr, uint8_t val)
210{ 211{
211 struct intel_i2c_chan *i2cbus = dvo->i2c_bus; 212 struct i2c_adapter *adapter = dvo->i2c_bus;
213 struct intel_i2c_chan *i2cbus = container_of(adapter, struct intel_i2c_chan, adapter);
212 uint8_t out_buf[2]; 214 uint8_t out_buf[2];
213 struct i2c_msg msg = { 215 struct i2c_msg msg = {
214 .addr = i2cbus->slave_addr, 216 .addr = dvo->slave_addr,
215 .flags = 0, 217 .flags = 0,
216 .len = 2, 218 .len = 2,
217 .buf = out_buf, 219 .buf = out_buf,
@@ -228,8 +230,9 @@ static bool ch7017_write(struct intel_dvo_device *dvo, int addr, uint8_t val)
228 230
229/** Probes for a CH7017 on the given bus and slave address. */ 231/** Probes for a CH7017 on the given bus and slave address. */
230static bool ch7017_init(struct intel_dvo_device *dvo, 232static bool ch7017_init(struct intel_dvo_device *dvo,
231 struct intel_i2c_chan *i2cbus) 233 struct i2c_adapter *adapter)
232{ 234{
235 struct intel_i2c_chan *i2cbus = container_of(adapter, struct intel_i2c_chan, adapter);
233 struct ch7017_priv *priv; 236 struct ch7017_priv *priv;
234 uint8_t val; 237 uint8_t val;
235 238
@@ -237,8 +240,7 @@ static bool ch7017_init(struct intel_dvo_device *dvo,
237 if (priv == NULL) 240 if (priv == NULL)
238 return false; 241 return false;
239 242
240 dvo->i2c_bus = i2cbus; 243 dvo->i2c_bus = adapter;
241 dvo->i2c_bus->slave_addr = dvo->slave_addr;
242 dvo->dev_priv = priv; 244 dvo->dev_priv = priv;
243 245
244 if (!ch7017_read(dvo, CH7017_DEVICE_ID, &val)) 246 if (!ch7017_read(dvo, CH7017_DEVICE_ID, &val))
@@ -248,7 +250,7 @@ static bool ch7017_init(struct intel_dvo_device *dvo,
248 val != CH7018_DEVICE_ID_VALUE && 250 val != CH7018_DEVICE_ID_VALUE &&
249 val != CH7019_DEVICE_ID_VALUE) { 251 val != CH7019_DEVICE_ID_VALUE) {
250 DRM_DEBUG("ch701x not detected, got %d: from %s Slave %d.\n", 252 DRM_DEBUG("ch701x not detected, got %d: from %s Slave %d.\n",
251 val, i2cbus->adapter.name,i2cbus->slave_addr); 253 val, i2cbus->adapter.name,dvo->slave_addr);
252 goto fail; 254 goto fail;
253 } 255 }
254 256
diff --git a/drivers/gpu/drm/i915/dvo_ch7xxx.c b/drivers/gpu/drm/i915/dvo_ch7xxx.c
index d2fd95dbd034..a9b896289680 100644
--- a/drivers/gpu/drm/i915/dvo_ch7xxx.c
+++ b/drivers/gpu/drm/i915/dvo_ch7xxx.c
@@ -123,19 +123,20 @@ static char *ch7xxx_get_id(uint8_t vid)
123static bool ch7xxx_readb(struct intel_dvo_device *dvo, int addr, uint8_t *ch) 123static bool ch7xxx_readb(struct intel_dvo_device *dvo, int addr, uint8_t *ch)
124{ 124{
125 struct ch7xxx_priv *ch7xxx= dvo->dev_priv; 125 struct ch7xxx_priv *ch7xxx= dvo->dev_priv;
126 struct intel_i2c_chan *i2cbus = dvo->i2c_bus; 126 struct i2c_adapter *adapter = dvo->i2c_bus;
127 struct intel_i2c_chan *i2cbus = container_of(adapter, struct intel_i2c_chan, adapter);
127 u8 out_buf[2]; 128 u8 out_buf[2];
128 u8 in_buf[2]; 129 u8 in_buf[2];
129 130
130 struct i2c_msg msgs[] = { 131 struct i2c_msg msgs[] = {
131 { 132 {
132 .addr = i2cbus->slave_addr, 133 .addr = dvo->slave_addr,
133 .flags = 0, 134 .flags = 0,
134 .len = 1, 135 .len = 1,
135 .buf = out_buf, 136 .buf = out_buf,
136 }, 137 },
137 { 138 {
138 .addr = i2cbus->slave_addr, 139 .addr = dvo->slave_addr,
139 .flags = I2C_M_RD, 140 .flags = I2C_M_RD,
140 .len = 1, 141 .len = 1,
141 .buf = in_buf, 142 .buf = in_buf,
@@ -152,7 +153,7 @@ static bool ch7xxx_readb(struct intel_dvo_device *dvo, int addr, uint8_t *ch)
152 153
153 if (!ch7xxx->quiet) { 154 if (!ch7xxx->quiet) {
154 DRM_DEBUG("Unable to read register 0x%02x from %s:%02x.\n", 155 DRM_DEBUG("Unable to read register 0x%02x from %s:%02x.\n",
155 addr, i2cbus->adapter.name, i2cbus->slave_addr); 156 addr, i2cbus->adapter.name, dvo->slave_addr);
156 } 157 }
157 return false; 158 return false;
158} 159}
@@ -161,10 +162,11 @@ static bool ch7xxx_readb(struct intel_dvo_device *dvo, int addr, uint8_t *ch)
161static bool ch7xxx_writeb(struct intel_dvo_device *dvo, int addr, uint8_t ch) 162static bool ch7xxx_writeb(struct intel_dvo_device *dvo, int addr, uint8_t ch)
162{ 163{
163 struct ch7xxx_priv *ch7xxx = dvo->dev_priv; 164 struct ch7xxx_priv *ch7xxx = dvo->dev_priv;
164 struct intel_i2c_chan *i2cbus = dvo->i2c_bus; 165 struct i2c_adapter *adapter = dvo->i2c_bus;
166 struct intel_i2c_chan *i2cbus = container_of(adapter, struct intel_i2c_chan, adapter);
165 uint8_t out_buf[2]; 167 uint8_t out_buf[2];
166 struct i2c_msg msg = { 168 struct i2c_msg msg = {
167 .addr = i2cbus->slave_addr, 169 .addr = dvo->slave_addr,
168 .flags = 0, 170 .flags = 0,
169 .len = 2, 171 .len = 2,
170 .buf = out_buf, 172 .buf = out_buf,
@@ -178,14 +180,14 @@ static bool ch7xxx_writeb(struct intel_dvo_device *dvo, int addr, uint8_t ch)
178 180
179 if (!ch7xxx->quiet) { 181 if (!ch7xxx->quiet) {
180 DRM_DEBUG("Unable to write register 0x%02x to %s:%d.\n", 182 DRM_DEBUG("Unable to write register 0x%02x to %s:%d.\n",
181 addr, i2cbus->adapter.name, i2cbus->slave_addr); 183 addr, i2cbus->adapter.name, dvo->slave_addr);
182 } 184 }
183 185
184 return false; 186 return false;
185} 187}
186 188
187static bool ch7xxx_init(struct intel_dvo_device *dvo, 189static bool ch7xxx_init(struct intel_dvo_device *dvo,
188 struct intel_i2c_chan *i2cbus) 190 struct i2c_adapter *adapter)
189{ 191{
190 /* this will detect the CH7xxx chip on the specified i2c bus */ 192 /* this will detect the CH7xxx chip on the specified i2c bus */
191 struct ch7xxx_priv *ch7xxx; 193 struct ch7xxx_priv *ch7xxx;
@@ -196,8 +198,7 @@ static bool ch7xxx_init(struct intel_dvo_device *dvo,
196 if (ch7xxx == NULL) 198 if (ch7xxx == NULL)
197 return false; 199 return false;
198 200
199 dvo->i2c_bus = i2cbus; 201 dvo->i2c_bus = adapter;
200 dvo->i2c_bus->slave_addr = dvo->slave_addr;
201 dvo->dev_priv = ch7xxx; 202 dvo->dev_priv = ch7xxx;
202 ch7xxx->quiet = true; 203 ch7xxx->quiet = true;
203 204
@@ -207,7 +208,7 @@ static bool ch7xxx_init(struct intel_dvo_device *dvo,
207 name = ch7xxx_get_id(vendor); 208 name = ch7xxx_get_id(vendor);
208 if (!name) { 209 if (!name) {
209 DRM_DEBUG("ch7xxx not detected; got 0x%02x from %s slave %d.\n", 210 DRM_DEBUG("ch7xxx not detected; got 0x%02x from %s slave %d.\n",
210 vendor, i2cbus->adapter.name, i2cbus->slave_addr); 211 vendor, adapter->name, dvo->slave_addr);
211 goto out; 212 goto out;
212 } 213 }
213 214
@@ -217,7 +218,7 @@ static bool ch7xxx_init(struct intel_dvo_device *dvo,
217 218
218 if (device != CH7xxx_DID) { 219 if (device != CH7xxx_DID) {
219 DRM_DEBUG("ch7xxx not detected; got 0x%02x from %s slave %d.\n", 220 DRM_DEBUG("ch7xxx not detected; got 0x%02x from %s slave %d.\n",
220 vendor, i2cbus->adapter.name, i2cbus->slave_addr); 221 vendor, adapter->name, dvo->slave_addr);
221 goto out; 222 goto out;
222 } 223 }
223 224
diff --git a/drivers/gpu/drm/i915/dvo_ivch.c b/drivers/gpu/drm/i915/dvo_ivch.c
index 0c8d375e8e37..aa176f9921fe 100644
--- a/drivers/gpu/drm/i915/dvo_ivch.c
+++ b/drivers/gpu/drm/i915/dvo_ivch.c
@@ -169,13 +169,14 @@ static void ivch_dump_regs(struct intel_dvo_device *dvo);
169static bool ivch_read(struct intel_dvo_device *dvo, int addr, uint16_t *data) 169static bool ivch_read(struct intel_dvo_device *dvo, int addr, uint16_t *data)
170{ 170{
171 struct ivch_priv *priv = dvo->dev_priv; 171 struct ivch_priv *priv = dvo->dev_priv;
172 struct intel_i2c_chan *i2cbus = dvo->i2c_bus; 172 struct i2c_adapter *adapter = dvo->i2c_bus;
173 struct intel_i2c_chan *i2cbus = container_of(adapter, struct intel_i2c_chan, adapter);
173 u8 out_buf[1]; 174 u8 out_buf[1];
174 u8 in_buf[2]; 175 u8 in_buf[2];
175 176
176 struct i2c_msg msgs[] = { 177 struct i2c_msg msgs[] = {
177 { 178 {
178 .addr = i2cbus->slave_addr, 179 .addr = dvo->slave_addr,
179 .flags = I2C_M_RD, 180 .flags = I2C_M_RD,
180 .len = 0, 181 .len = 0,
181 }, 182 },
@@ -186,7 +187,7 @@ static bool ivch_read(struct intel_dvo_device *dvo, int addr, uint16_t *data)
186 .buf = out_buf, 187 .buf = out_buf,
187 }, 188 },
188 { 189 {
189 .addr = i2cbus->slave_addr, 190 .addr = dvo->slave_addr,
190 .flags = I2C_M_RD | I2C_M_NOSTART, 191 .flags = I2C_M_RD | I2C_M_NOSTART,
191 .len = 2, 192 .len = 2,
192 .buf = in_buf, 193 .buf = in_buf,
@@ -202,7 +203,7 @@ static bool ivch_read(struct intel_dvo_device *dvo, int addr, uint16_t *data)
202 203
203 if (!priv->quiet) { 204 if (!priv->quiet) {
204 DRM_DEBUG("Unable to read register 0x%02x from %s:%02x.\n", 205 DRM_DEBUG("Unable to read register 0x%02x from %s:%02x.\n",
205 addr, i2cbus->adapter.name, i2cbus->slave_addr); 206 addr, i2cbus->adapter.name, dvo->slave_addr);
206 } 207 }
207 return false; 208 return false;
208} 209}
@@ -211,10 +212,11 @@ static bool ivch_read(struct intel_dvo_device *dvo, int addr, uint16_t *data)
211static bool ivch_write(struct intel_dvo_device *dvo, int addr, uint16_t data) 212static bool ivch_write(struct intel_dvo_device *dvo, int addr, uint16_t data)
212{ 213{
213 struct ivch_priv *priv = dvo->dev_priv; 214 struct ivch_priv *priv = dvo->dev_priv;
214 struct intel_i2c_chan *i2cbus = dvo->i2c_bus; 215 struct i2c_adapter *adapter = dvo->i2c_bus;
216 struct intel_i2c_chan *i2cbus = container_of(adapter, struct intel_i2c_chan, adapter);
215 u8 out_buf[3]; 217 u8 out_buf[3];
216 struct i2c_msg msg = { 218 struct i2c_msg msg = {
217 .addr = i2cbus->slave_addr, 219 .addr = dvo->slave_addr,
218 .flags = 0, 220 .flags = 0,
219 .len = 3, 221 .len = 3,
220 .buf = out_buf, 222 .buf = out_buf,
@@ -229,7 +231,7 @@ static bool ivch_write(struct intel_dvo_device *dvo, int addr, uint16_t data)
229 231
230 if (!priv->quiet) { 232 if (!priv->quiet) {
231 DRM_DEBUG("Unable to write register 0x%02x to %s:%d.\n", 233 DRM_DEBUG("Unable to write register 0x%02x to %s:%d.\n",
232 addr, i2cbus->adapter.name, i2cbus->slave_addr); 234 addr, i2cbus->adapter.name, dvo->slave_addr);
233 } 235 }
234 236
235 return false; 237 return false;
@@ -237,7 +239,7 @@ static bool ivch_write(struct intel_dvo_device *dvo, int addr, uint16_t data)
237 239
238/** Probes the given bus and slave address for an ivch */ 240/** Probes the given bus and slave address for an ivch */
239static bool ivch_init(struct intel_dvo_device *dvo, 241static bool ivch_init(struct intel_dvo_device *dvo,
240 struct intel_i2c_chan *i2cbus) 242 struct i2c_adapter *adapter)
241{ 243{
242 struct ivch_priv *priv; 244 struct ivch_priv *priv;
243 uint16_t temp; 245 uint16_t temp;
@@ -246,8 +248,7 @@ static bool ivch_init(struct intel_dvo_device *dvo,
246 if (priv == NULL) 248 if (priv == NULL)
247 return false; 249 return false;
248 250
249 dvo->i2c_bus = i2cbus; 251 dvo->i2c_bus = adapter;
250 dvo->i2c_bus->slave_addr = dvo->slave_addr;
251 dvo->dev_priv = priv; 252 dvo->dev_priv = priv;
252 priv->quiet = true; 253 priv->quiet = true;
253 254
diff --git a/drivers/gpu/drm/i915/dvo_sil164.c b/drivers/gpu/drm/i915/dvo_sil164.c
index 033a4bb070b2..e1c1f7341e5c 100644
--- a/drivers/gpu/drm/i915/dvo_sil164.c
+++ b/drivers/gpu/drm/i915/dvo_sil164.c
@@ -76,19 +76,20 @@ struct sil164_priv {
76static bool sil164_readb(struct intel_dvo_device *dvo, int addr, uint8_t *ch) 76static bool sil164_readb(struct intel_dvo_device *dvo, int addr, uint8_t *ch)
77{ 77{
78 struct sil164_priv *sil = dvo->dev_priv; 78 struct sil164_priv *sil = dvo->dev_priv;
79 struct intel_i2c_chan *i2cbus = dvo->i2c_bus; 79 struct i2c_adapter *adapter = dvo->i2c_bus;
80 struct intel_i2c_chan *i2cbus = container_of(adapter, struct intel_i2c_chan, adapter);
80 u8 out_buf[2]; 81 u8 out_buf[2];
81 u8 in_buf[2]; 82 u8 in_buf[2];
82 83
83 struct i2c_msg msgs[] = { 84 struct i2c_msg msgs[] = {
84 { 85 {
85 .addr = i2cbus->slave_addr, 86 .addr = dvo->slave_addr,
86 .flags = 0, 87 .flags = 0,
87 .len = 1, 88 .len = 1,
88 .buf = out_buf, 89 .buf = out_buf,
89 }, 90 },
90 { 91 {
91 .addr = i2cbus->slave_addr, 92 .addr = dvo->slave_addr,
92 .flags = I2C_M_RD, 93 .flags = I2C_M_RD,
93 .len = 1, 94 .len = 1,
94 .buf = in_buf, 95 .buf = in_buf,
@@ -105,7 +106,7 @@ static bool sil164_readb(struct intel_dvo_device *dvo, int addr, uint8_t *ch)
105 106
106 if (!sil->quiet) { 107 if (!sil->quiet) {
107 DRM_DEBUG("Unable to read register 0x%02x from %s:%02x.\n", 108 DRM_DEBUG("Unable to read register 0x%02x from %s:%02x.\n",
108 addr, i2cbus->adapter.name, i2cbus->slave_addr); 109 addr, i2cbus->adapter.name, dvo->slave_addr);
109 } 110 }
110 return false; 111 return false;
111} 112}
@@ -113,10 +114,11 @@ static bool sil164_readb(struct intel_dvo_device *dvo, int addr, uint8_t *ch)
113static bool sil164_writeb(struct intel_dvo_device *dvo, int addr, uint8_t ch) 114static bool sil164_writeb(struct intel_dvo_device *dvo, int addr, uint8_t ch)
114{ 115{
115 struct sil164_priv *sil= dvo->dev_priv; 116 struct sil164_priv *sil= dvo->dev_priv;
116 struct intel_i2c_chan *i2cbus = dvo->i2c_bus; 117 struct i2c_adapter *adapter = dvo->i2c_bus;
118 struct intel_i2c_chan *i2cbus = container_of(adapter, struct intel_i2c_chan, adapter);
117 uint8_t out_buf[2]; 119 uint8_t out_buf[2];
118 struct i2c_msg msg = { 120 struct i2c_msg msg = {
119 .addr = i2cbus->slave_addr, 121 .addr = dvo->slave_addr,
120 .flags = 0, 122 .flags = 0,
121 .len = 2, 123 .len = 2,
122 .buf = out_buf, 124 .buf = out_buf,
@@ -130,7 +132,7 @@ static bool sil164_writeb(struct intel_dvo_device *dvo, int addr, uint8_t ch)
130 132
131 if (!sil->quiet) { 133 if (!sil->quiet) {
132 DRM_DEBUG("Unable to write register 0x%02x to %s:%d.\n", 134 DRM_DEBUG("Unable to write register 0x%02x to %s:%d.\n",
133 addr, i2cbus->adapter.name, i2cbus->slave_addr); 135 addr, i2cbus->adapter.name, dvo->slave_addr);
134 } 136 }
135 137
136 return false; 138 return false;
@@ -138,7 +140,7 @@ static bool sil164_writeb(struct intel_dvo_device *dvo, int addr, uint8_t ch)
138 140
139/* Silicon Image 164 driver for chip on i2c bus */ 141/* Silicon Image 164 driver for chip on i2c bus */
140static bool sil164_init(struct intel_dvo_device *dvo, 142static bool sil164_init(struct intel_dvo_device *dvo,
141 struct intel_i2c_chan *i2cbus) 143 struct i2c_adapter *adapter)
142{ 144{
143 /* this will detect the SIL164 chip on the specified i2c bus */ 145 /* this will detect the SIL164 chip on the specified i2c bus */
144 struct sil164_priv *sil; 146 struct sil164_priv *sil;
@@ -148,8 +150,7 @@ static bool sil164_init(struct intel_dvo_device *dvo,
148 if (sil == NULL) 150 if (sil == NULL)
149 return false; 151 return false;
150 152
151 dvo->i2c_bus = i2cbus; 153 dvo->i2c_bus = adapter;
152 dvo->i2c_bus->slave_addr = dvo->slave_addr;
153 dvo->dev_priv = sil; 154 dvo->dev_priv = sil;
154 sil->quiet = true; 155 sil->quiet = true;
155 156
@@ -158,7 +159,7 @@ static bool sil164_init(struct intel_dvo_device *dvo,
158 159
159 if (ch != (SIL164_VID & 0xff)) { 160 if (ch != (SIL164_VID & 0xff)) {
160 DRM_DEBUG("sil164 not detected got %d: from %s Slave %d.\n", 161 DRM_DEBUG("sil164 not detected got %d: from %s Slave %d.\n",
161 ch, i2cbus->adapter.name, i2cbus->slave_addr); 162 ch, adapter->name, dvo->slave_addr);
162 goto out; 163 goto out;
163 } 164 }
164 165
@@ -167,7 +168,7 @@ static bool sil164_init(struct intel_dvo_device *dvo,
167 168
168 if (ch != (SIL164_DID & 0xff)) { 169 if (ch != (SIL164_DID & 0xff)) {
169 DRM_DEBUG("sil164 not detected got %d: from %s Slave %d.\n", 170 DRM_DEBUG("sil164 not detected got %d: from %s Slave %d.\n",
170 ch, i2cbus->adapter.name, i2cbus->slave_addr); 171 ch, adapter->name, dvo->slave_addr);
171 goto out; 172 goto out;
172 } 173 }
173 sil->quiet = false; 174 sil->quiet = false;
diff --git a/drivers/gpu/drm/i915/dvo_tfp410.c b/drivers/gpu/drm/i915/dvo_tfp410.c
index 207fda806ebf..9ecc907384ec 100644
--- a/drivers/gpu/drm/i915/dvo_tfp410.c
+++ b/drivers/gpu/drm/i915/dvo_tfp410.c
@@ -101,19 +101,20 @@ struct tfp410_priv {
101static bool tfp410_readb(struct intel_dvo_device *dvo, int addr, uint8_t *ch) 101static bool tfp410_readb(struct intel_dvo_device *dvo, int addr, uint8_t *ch)
102{ 102{
103 struct tfp410_priv *tfp = dvo->dev_priv; 103 struct tfp410_priv *tfp = dvo->dev_priv;
104 struct intel_i2c_chan *i2cbus = dvo->i2c_bus; 104 struct i2c_adapter *adapter = dvo->i2c_bus;
105 struct intel_i2c_chan *i2cbus = container_of(adapter, struct intel_i2c_chan, adapter);
105 u8 out_buf[2]; 106 u8 out_buf[2];
106 u8 in_buf[2]; 107 u8 in_buf[2];
107 108
108 struct i2c_msg msgs[] = { 109 struct i2c_msg msgs[] = {
109 { 110 {
110 .addr = i2cbus->slave_addr, 111 .addr = dvo->slave_addr,
111 .flags = 0, 112 .flags = 0,
112 .len = 1, 113 .len = 1,
113 .buf = out_buf, 114 .buf = out_buf,
114 }, 115 },
115 { 116 {
116 .addr = i2cbus->slave_addr, 117 .addr = dvo->slave_addr,
117 .flags = I2C_M_RD, 118 .flags = I2C_M_RD,
118 .len = 1, 119 .len = 1,
119 .buf = in_buf, 120 .buf = in_buf,
@@ -130,7 +131,7 @@ static bool tfp410_readb(struct intel_dvo_device *dvo, int addr, uint8_t *ch)
130 131
131 if (!tfp->quiet) { 132 if (!tfp->quiet) {
132 DRM_DEBUG("Unable to read register 0x%02x from %s:%02x.\n", 133 DRM_DEBUG("Unable to read register 0x%02x from %s:%02x.\n",
133 addr, i2cbus->adapter.name, i2cbus->slave_addr); 134 addr, i2cbus->adapter.name, dvo->slave_addr);
134 } 135 }
135 return false; 136 return false;
136} 137}
@@ -138,10 +139,11 @@ static bool tfp410_readb(struct intel_dvo_device *dvo, int addr, uint8_t *ch)
138static bool tfp410_writeb(struct intel_dvo_device *dvo, int addr, uint8_t ch) 139static bool tfp410_writeb(struct intel_dvo_device *dvo, int addr, uint8_t ch)
139{ 140{
140 struct tfp410_priv *tfp = dvo->dev_priv; 141 struct tfp410_priv *tfp = dvo->dev_priv;
141 struct intel_i2c_chan *i2cbus = dvo->i2c_bus; 142 struct i2c_adapter *adapter = dvo->i2c_bus;
143 struct intel_i2c_chan *i2cbus = container_of(adapter, struct intel_i2c_chan, adapter);
142 uint8_t out_buf[2]; 144 uint8_t out_buf[2];
143 struct i2c_msg msg = { 145 struct i2c_msg msg = {
144 .addr = i2cbus->slave_addr, 146 .addr = dvo->slave_addr,
145 .flags = 0, 147 .flags = 0,
146 .len = 2, 148 .len = 2,
147 .buf = out_buf, 149 .buf = out_buf,
@@ -155,7 +157,7 @@ static bool tfp410_writeb(struct intel_dvo_device *dvo, int addr, uint8_t ch)
155 157
156 if (!tfp->quiet) { 158 if (!tfp->quiet) {
157 DRM_DEBUG("Unable to write register 0x%02x to %s:%d.\n", 159 DRM_DEBUG("Unable to write register 0x%02x to %s:%d.\n",
158 addr, i2cbus->adapter.name, i2cbus->slave_addr); 160 addr, i2cbus->adapter.name, dvo->slave_addr);
159 } 161 }
160 162
161 return false; 163 return false;
@@ -174,7 +176,7 @@ static int tfp410_getid(struct intel_dvo_device *dvo, int addr)
174 176
175/* Ti TFP410 driver for chip on i2c bus */ 177/* Ti TFP410 driver for chip on i2c bus */
176static bool tfp410_init(struct intel_dvo_device *dvo, 178static bool tfp410_init(struct intel_dvo_device *dvo,
177 struct intel_i2c_chan *i2cbus) 179 struct i2c_adapter *adapter)
178{ 180{
179 /* this will detect the tfp410 chip on the specified i2c bus */ 181 /* this will detect the tfp410 chip on the specified i2c bus */
180 struct tfp410_priv *tfp; 182 struct tfp410_priv *tfp;
@@ -184,20 +186,19 @@ static bool tfp410_init(struct intel_dvo_device *dvo,
184 if (tfp == NULL) 186 if (tfp == NULL)
185 return false; 187 return false;
186 188
187 dvo->i2c_bus = i2cbus; 189 dvo->i2c_bus = adapter;
188 dvo->i2c_bus->slave_addr = dvo->slave_addr;
189 dvo->dev_priv = tfp; 190 dvo->dev_priv = tfp;
190 tfp->quiet = true; 191 tfp->quiet = true;
191 192
192 if ((id = tfp410_getid(dvo, TFP410_VID_LO)) != TFP410_VID) { 193 if ((id = tfp410_getid(dvo, TFP410_VID_LO)) != TFP410_VID) {
193 DRM_DEBUG("tfp410 not detected got VID %X: from %s Slave %d.\n", 194 DRM_DEBUG("tfp410 not detected got VID %X: from %s Slave %d.\n",
194 id, i2cbus->adapter.name, i2cbus->slave_addr); 195 id, adapter->name, dvo->slave_addr);
195 goto out; 196 goto out;
196 } 197 }
197 198
198 if ((id = tfp410_getid(dvo, TFP410_DID_LO)) != TFP410_DID) { 199 if ((id = tfp410_getid(dvo, TFP410_DID_LO)) != TFP410_DID) {
199 DRM_DEBUG("tfp410 not detected got DID %X: from %s Slave %d.\n", 200 DRM_DEBUG("tfp410 not detected got DID %X: from %s Slave %d.\n",
200 id, i2cbus->adapter.name, i2cbus->slave_addr); 201 id, adapter->name, dvo->slave_addr);
201 goto out; 202 goto out;
202 } 203 }
203 tfp->quiet = false; 204 tfp->quiet = false;
diff --git a/drivers/gpu/drm/i915/i915_dma.c b/drivers/gpu/drm/i915/i915_dma.c
index f112c769d533..50d1f782768c 100644
--- a/drivers/gpu/drm/i915/i915_dma.c
+++ b/drivers/gpu/drm/i915/i915_dma.c
@@ -846,7 +846,7 @@ static int i915_set_status_page(struct drm_device *dev, void *data,
846 return 0; 846 return 0;
847 } 847 }
848 848
849 printk(KERN_DEBUG "set status page addr 0x%08x\n", (u32)hws->addr); 849 DRM_DEBUG("set status page addr 0x%08x\n", (u32)hws->addr);
850 850
851 dev_priv->status_gfx_addr = hws->addr & (0x1ffff<<12); 851 dev_priv->status_gfx_addr = hws->addr & (0x1ffff<<12);
852 852
@@ -885,8 +885,8 @@ static int i915_set_status_page(struct drm_device *dev, void *data,
885 * some RAM for the framebuffer at early boot. This code figures out 885 * some RAM for the framebuffer at early boot. This code figures out
886 * how much was set aside so we can use it for our own purposes. 886 * how much was set aside so we can use it for our own purposes.
887 */ 887 */
888static int i915_probe_agp(struct drm_device *dev, unsigned long *aperture_size, 888static int i915_probe_agp(struct drm_device *dev, uint32_t *aperture_size,
889 unsigned long *preallocated_size) 889 uint32_t *preallocated_size)
890{ 890{
891 struct pci_dev *bridge_dev; 891 struct pci_dev *bridge_dev;
892 u16 tmp = 0; 892 u16 tmp = 0;
@@ -984,10 +984,11 @@ static int i915_probe_agp(struct drm_device *dev, unsigned long *aperture_size,
984 return 0; 984 return 0;
985} 985}
986 986
987static int i915_load_modeset_init(struct drm_device *dev) 987static int i915_load_modeset_init(struct drm_device *dev,
988 unsigned long prealloc_size,
989 unsigned long agp_size)
988{ 990{
989 struct drm_i915_private *dev_priv = dev->dev_private; 991 struct drm_i915_private *dev_priv = dev->dev_private;
990 unsigned long agp_size, prealloc_size;
991 int fb_bar = IS_I9XX(dev) ? 2 : 0; 992 int fb_bar = IS_I9XX(dev) ? 2 : 0;
992 int ret = 0; 993 int ret = 0;
993 994
@@ -1002,10 +1003,6 @@ static int i915_load_modeset_init(struct drm_device *dev)
1002 if (IS_I965G(dev) || IS_G33(dev)) 1003 if (IS_I965G(dev) || IS_G33(dev))
1003 dev_priv->cursor_needs_physical = false; 1004 dev_priv->cursor_needs_physical = false;
1004 1005
1005 ret = i915_probe_agp(dev, &agp_size, &prealloc_size);
1006 if (ret)
1007 goto out;
1008
1009 /* Basic memrange allocator for stolen space (aka vram) */ 1006 /* Basic memrange allocator for stolen space (aka vram) */
1010 drm_mm_init(&dev_priv->vram, 0, prealloc_size); 1007 drm_mm_init(&dev_priv->vram, 0, prealloc_size);
1011 1008
@@ -1082,6 +1079,44 @@ void i915_master_destroy(struct drm_device *dev, struct drm_master *master)
1082 master->driver_priv = NULL; 1079 master->driver_priv = NULL;
1083} 1080}
1084 1081
1082static void i915_get_mem_freq(struct drm_device *dev)
1083{
1084 drm_i915_private_t *dev_priv = dev->dev_private;
1085 u32 tmp;
1086
1087 if (!IS_IGD(dev))
1088 return;
1089
1090 tmp = I915_READ(CLKCFG);
1091
1092 switch (tmp & CLKCFG_FSB_MASK) {
1093 case CLKCFG_FSB_533:
1094 dev_priv->fsb_freq = 533; /* 133*4 */
1095 break;
1096 case CLKCFG_FSB_800:
1097 dev_priv->fsb_freq = 800; /* 200*4 */
1098 break;
1099 case CLKCFG_FSB_667:
1100 dev_priv->fsb_freq = 667; /* 167*4 */
1101 break;
1102 case CLKCFG_FSB_400:
1103 dev_priv->fsb_freq = 400; /* 100*4 */
1104 break;
1105 }
1106
1107 switch (tmp & CLKCFG_MEM_MASK) {
1108 case CLKCFG_MEM_533:
1109 dev_priv->mem_freq = 533;
1110 break;
1111 case CLKCFG_MEM_667:
1112 dev_priv->mem_freq = 667;
1113 break;
1114 case CLKCFG_MEM_800:
1115 dev_priv->mem_freq = 800;
1116 break;
1117 }
1118}
1119
1085/** 1120/**
1086 * i915_driver_load - setup chip and create an initial config 1121 * i915_driver_load - setup chip and create an initial config
1087 * @dev: DRM device 1122 * @dev: DRM device
@@ -1098,6 +1133,7 @@ int i915_driver_load(struct drm_device *dev, unsigned long flags)
1098 struct drm_i915_private *dev_priv = dev->dev_private; 1133 struct drm_i915_private *dev_priv = dev->dev_private;
1099 resource_size_t base, size; 1134 resource_size_t base, size;
1100 int ret = 0, mmio_bar = IS_I9XX(dev) ? 0 : 1; 1135 int ret = 0, mmio_bar = IS_I9XX(dev) ? 0 : 1;
1136 uint32_t agp_size, prealloc_size;
1101 1137
1102 /* i915 has 4 more counters */ 1138 /* i915 has 4 more counters */
1103 dev->counters += 4; 1139 dev->counters += 4;
@@ -1146,9 +1182,29 @@ int i915_driver_load(struct drm_device *dev, unsigned long flags)
1146 "performance may suffer.\n"); 1182 "performance may suffer.\n");
1147 } 1183 }
1148 1184
1185 ret = i915_probe_agp(dev, &agp_size, &prealloc_size);
1186 if (ret)
1187 goto out_iomapfree;
1188
1189 dev_priv->wq = create_workqueue("i915");
1190 if (dev_priv->wq == NULL) {
1191 DRM_ERROR("Failed to create our workqueue.\n");
1192 ret = -ENOMEM;
1193 goto out_iomapfree;
1194 }
1195
1149 /* enable GEM by default */ 1196 /* enable GEM by default */
1150 dev_priv->has_gem = 1; 1197 dev_priv->has_gem = 1;
1151 1198
1199 if (prealloc_size > agp_size * 3 / 4) {
1200 DRM_ERROR("Detected broken video BIOS with %d/%dkB of video "
1201 "memory stolen.\n",
1202 prealloc_size / 1024, agp_size / 1024);
1203 DRM_ERROR("Disabling GEM. (try reducing stolen memory or "
1204 "updating the BIOS to fix).\n");
1205 dev_priv->has_gem = 0;
1206 }
1207
1152 dev->driver->get_vblank_counter = i915_get_vblank_counter; 1208 dev->driver->get_vblank_counter = i915_get_vblank_counter;
1153 dev->max_vblank_count = 0xffffff; /* only 24 bits of frame count */ 1209 dev->max_vblank_count = 0xffffff; /* only 24 bits of frame count */
1154 if (IS_G4X(dev) || IS_IGDNG(dev)) { 1210 if (IS_G4X(dev) || IS_IGDNG(dev)) {
@@ -1162,9 +1218,11 @@ int i915_driver_load(struct drm_device *dev, unsigned long flags)
1162 if (!I915_NEED_GFX_HWS(dev)) { 1218 if (!I915_NEED_GFX_HWS(dev)) {
1163 ret = i915_init_phys_hws(dev); 1219 ret = i915_init_phys_hws(dev);
1164 if (ret != 0) 1220 if (ret != 0)
1165 goto out_iomapfree; 1221 goto out_workqueue_free;
1166 } 1222 }
1167 1223
1224 i915_get_mem_freq(dev);
1225
1168 /* On the 945G/GM, the chipset reports the MSI capability on the 1226 /* On the 945G/GM, the chipset reports the MSI capability on the
1169 * integrated graphics even though the support isn't actually there 1227 * integrated graphics even though the support isn't actually there
1170 * according to the published specs. It doesn't appear to function 1228 * according to the published specs. It doesn't appear to function
@@ -1180,6 +1238,7 @@ int i915_driver_load(struct drm_device *dev, unsigned long flags)
1180 pci_enable_msi(dev->pdev); 1238 pci_enable_msi(dev->pdev);
1181 1239
1182 spin_lock_init(&dev_priv->user_irq_lock); 1240 spin_lock_init(&dev_priv->user_irq_lock);
1241 spin_lock_init(&dev_priv->error_lock);
1183 dev_priv->user_irq_refcount = 0; 1242 dev_priv->user_irq_refcount = 0;
1184 1243
1185 ret = drm_vblank_init(dev, I915_NUM_PIPE); 1244 ret = drm_vblank_init(dev, I915_NUM_PIPE);
@@ -1190,10 +1249,10 @@ int i915_driver_load(struct drm_device *dev, unsigned long flags)
1190 } 1249 }
1191 1250
1192 if (drm_core_check_feature(dev, DRIVER_MODESET)) { 1251 if (drm_core_check_feature(dev, DRIVER_MODESET)) {
1193 ret = i915_load_modeset_init(dev); 1252 ret = i915_load_modeset_init(dev, prealloc_size, agp_size);
1194 if (ret < 0) { 1253 if (ret < 0) {
1195 DRM_ERROR("failed to init modeset\n"); 1254 DRM_ERROR("failed to init modeset\n");
1196 goto out_rmmap; 1255 goto out_workqueue_free;
1197 } 1256 }
1198 } 1257 }
1199 1258
@@ -1204,6 +1263,8 @@ int i915_driver_load(struct drm_device *dev, unsigned long flags)
1204 1263
1205 return 0; 1264 return 0;
1206 1265
1266out_workqueue_free:
1267 destroy_workqueue(dev_priv->wq);
1207out_iomapfree: 1268out_iomapfree:
1208 io_mapping_free(dev_priv->mm.gtt_mapping); 1269 io_mapping_free(dev_priv->mm.gtt_mapping);
1209out_rmmap: 1270out_rmmap:
@@ -1217,6 +1278,8 @@ int i915_driver_unload(struct drm_device *dev)
1217{ 1278{
1218 struct drm_i915_private *dev_priv = dev->dev_private; 1279 struct drm_i915_private *dev_priv = dev->dev_private;
1219 1280
1281 destroy_workqueue(dev_priv->wq);
1282
1220 io_mapping_free(dev_priv->mm.gtt_mapping); 1283 io_mapping_free(dev_priv->mm.gtt_mapping);
1221 if (dev_priv->mm.gtt_mtrr >= 0) { 1284 if (dev_priv->mm.gtt_mtrr >= 0) {
1222 mtrr_del(dev_priv->mm.gtt_mtrr, dev->agp->base, 1285 mtrr_del(dev_priv->mm.gtt_mtrr, dev->agp->base,
diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
index 98560e1e899a..fc4b68aa2d05 100644
--- a/drivers/gpu/drm/i915/i915_drv.c
+++ b/drivers/gpu/drm/i915/i915_drv.c
@@ -35,6 +35,7 @@
35 35
36#include "drm_pciids.h" 36#include "drm_pciids.h"
37#include <linux/console.h> 37#include <linux/console.h>
38#include "drm_crtc_helper.h"
38 39
39static unsigned int i915_modeset = -1; 40static unsigned int i915_modeset = -1;
40module_param_named(modeset, i915_modeset, int, 0400); 41module_param_named(modeset, i915_modeset, int, 0400);
@@ -57,8 +58,8 @@ static int i915_suspend(struct drm_device *dev, pm_message_t state)
57 struct drm_i915_private *dev_priv = dev->dev_private; 58 struct drm_i915_private *dev_priv = dev->dev_private;
58 59
59 if (!dev || !dev_priv) { 60 if (!dev || !dev_priv) {
60 printk(KERN_ERR "dev: %p, dev_priv: %p\n", dev, dev_priv); 61 DRM_ERROR("dev: %p, dev_priv: %p\n", dev, dev_priv);
61 printk(KERN_ERR "DRM not initialized, aborting suspend.\n"); 62 DRM_ERROR("DRM not initialized, aborting suspend.\n");
62 return -ENODEV; 63 return -ENODEV;
63 } 64 }
64 65
@@ -67,8 +68,6 @@ static int i915_suspend(struct drm_device *dev, pm_message_t state)
67 68
68 pci_save_state(dev->pdev); 69 pci_save_state(dev->pdev);
69 70
70 i915_save_state(dev);
71
72 /* If KMS is active, we do the leavevt stuff here */ 71 /* If KMS is active, we do the leavevt stuff here */
73 if (drm_core_check_feature(dev, DRIVER_MODESET)) { 72 if (drm_core_check_feature(dev, DRIVER_MODESET)) {
74 if (i915_gem_idle(dev)) 73 if (i915_gem_idle(dev))
@@ -77,6 +76,8 @@ static int i915_suspend(struct drm_device *dev, pm_message_t state)
77 drm_irq_uninstall(dev); 76 drm_irq_uninstall(dev);
78 } 77 }
79 78
79 i915_save_state(dev);
80
80 intel_opregion_free(dev, 1); 81 intel_opregion_free(dev, 1);
81 82
82 if (state.event == PM_EVENT_SUSPEND) { 83 if (state.event == PM_EVENT_SUSPEND) {
@@ -115,6 +116,10 @@ static int i915_resume(struct drm_device *dev)
115 116
116 drm_irq_install(dev); 117 drm_irq_install(dev);
117 } 118 }
119 if (drm_core_check_feature(dev, DRIVER_MODESET)) {
120 /* Resume the modeset for every activated CRTC */
121 drm_helper_resume_force_mode(dev);
122 }
118 123
119 return ret; 124 return ret;
120} 125}
diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index 7a84f04e8439..7537f57d8a87 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -133,6 +133,22 @@ struct sdvo_device_mapping {
133 u8 initialized; 133 u8 initialized;
134}; 134};
135 135
136struct drm_i915_error_state {
137 u32 eir;
138 u32 pgtbl_er;
139 u32 pipeastat;
140 u32 pipebstat;
141 u32 ipeir;
142 u32 ipehr;
143 u32 instdone;
144 u32 acthd;
145 u32 instpm;
146 u32 instps;
147 u32 instdone1;
148 u32 seqno;
149 struct timeval time;
150};
151
136typedef struct drm_i915_private { 152typedef struct drm_i915_private {
137 struct drm_device *dev; 153 struct drm_device *dev;
138 154
@@ -203,12 +219,20 @@ typedef struct drm_i915_private {
203 unsigned int lvds_vbt:1; 219 unsigned int lvds_vbt:1;
204 unsigned int int_crt_support:1; 220 unsigned int int_crt_support:1;
205 unsigned int lvds_use_ssc:1; 221 unsigned int lvds_use_ssc:1;
222 unsigned int edp_support:1;
206 int lvds_ssc_freq; 223 int lvds_ssc_freq;
207 224
208 struct drm_i915_fence_reg fence_regs[16]; /* assume 965 */ 225 struct drm_i915_fence_reg fence_regs[16]; /* assume 965 */
209 int fence_reg_start; /* 4 if userland hasn't ioctl'd us yet */ 226 int fence_reg_start; /* 4 if userland hasn't ioctl'd us yet */
210 int num_fence_regs; /* 8 on pre-965, 16 otherwise */ 227 int num_fence_regs; /* 8 on pre-965, 16 otherwise */
211 228
229 unsigned int fsb_freq, mem_freq;
230
231 spinlock_t error_lock;
232 struct drm_i915_error_state *first_error;
233 struct work_struct error_work;
234 struct workqueue_struct *wq;
235
212 /* Register state */ 236 /* Register state */
213 u8 saveLBB; 237 u8 saveLBB;
214 u32 saveDSPACNTR; 238 u32 saveDSPACNTR;
@@ -306,6 +330,17 @@ typedef struct drm_i915_private {
306 u32 saveCURBPOS; 330 u32 saveCURBPOS;
307 u32 saveCURBBASE; 331 u32 saveCURBBASE;
308 u32 saveCURSIZE; 332 u32 saveCURSIZE;
333 u32 saveDP_B;
334 u32 saveDP_C;
335 u32 saveDP_D;
336 u32 savePIPEA_GMCH_DATA_M;
337 u32 savePIPEB_GMCH_DATA_M;
338 u32 savePIPEA_GMCH_DATA_N;
339 u32 savePIPEB_GMCH_DATA_N;
340 u32 savePIPEA_DP_LINK_M;
341 u32 savePIPEB_DP_LINK_M;
342 u32 savePIPEA_DP_LINK_N;
343 u32 savePIPEB_DP_LINK_N;
309 344
310 struct { 345 struct {
311 struct drm_mm gtt_space; 346 struct drm_mm gtt_space;
@@ -457,9 +492,6 @@ struct drm_i915_gem_object {
457 */ 492 */
458 int fence_reg; 493 int fence_reg;
459 494
460 /** Boolean whether this object has a valid gtt offset. */
461 int gtt_bound;
462
463 /** How many users have pinned this object in GTT space */ 495 /** How many users have pinned this object in GTT space */
464 int pin_count; 496 int pin_count;
465 497
@@ -644,6 +676,7 @@ void i915_gem_free_object(struct drm_gem_object *obj);
644int i915_gem_object_pin(struct drm_gem_object *obj, uint32_t alignment); 676int i915_gem_object_pin(struct drm_gem_object *obj, uint32_t alignment);
645void i915_gem_object_unpin(struct drm_gem_object *obj); 677void i915_gem_object_unpin(struct drm_gem_object *obj);
646int i915_gem_object_unbind(struct drm_gem_object *obj); 678int i915_gem_object_unbind(struct drm_gem_object *obj);
679void i915_gem_release_mmap(struct drm_gem_object *obj);
647void i915_gem_lastclose(struct drm_device *dev); 680void i915_gem_lastclose(struct drm_device *dev);
648uint32_t i915_get_gem_seqno(struct drm_device *dev); 681uint32_t i915_get_gem_seqno(struct drm_device *dev);
649int i915_gem_object_get_fence_reg(struct drm_gem_object *obj); 682int i915_gem_object_get_fence_reg(struct drm_gem_object *obj);
@@ -857,7 +890,11 @@ extern int i915_wait_ring(struct drm_device * dev, int n, const char *caller);
857#define HAS_128_BYTE_Y_TILING(dev) (IS_I9XX(dev) && !(IS_I915G(dev) || \ 890#define HAS_128_BYTE_Y_TILING(dev) (IS_I9XX(dev) && !(IS_I915G(dev) || \
858 IS_I915GM(dev))) 891 IS_I915GM(dev)))
859#define SUPPORTS_INTEGRATED_HDMI(dev) (IS_G4X(dev) || IS_IGDNG(dev)) 892#define SUPPORTS_INTEGRATED_HDMI(dev) (IS_G4X(dev) || IS_IGDNG(dev))
893#define SUPPORTS_INTEGRATED_DP(dev) (IS_G4X(dev) || IS_IGDNG(dev))
894#define SUPPORTS_EDP(dev) (IS_IGDNG_M(dev))
860#define I915_HAS_HOTPLUG(dev) (IS_I945G(dev) || IS_I945GM(dev) || IS_I965G(dev)) 895#define I915_HAS_HOTPLUG(dev) (IS_I945G(dev) || IS_I945GM(dev) || IS_I965G(dev))
896/* dsparb controlled by hw only */
897#define DSPARB_HWCONTROL(dev) (IS_G4X(dev) || IS_IGDNG(dev))
861 898
862#define PRIMARY_RINGBUFFER_SIZE (128*1024) 899#define PRIMARY_RINGBUFFER_SIZE (128*1024)
863 900
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index fd2b8bdffe3f..140bee142fc2 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -1006,7 +1006,7 @@ i915_gem_set_domain_ioctl(struct drm_device *dev, void *data,
1006 1006
1007 mutex_lock(&dev->struct_mutex); 1007 mutex_lock(&dev->struct_mutex);
1008#if WATCH_BUF 1008#if WATCH_BUF
1009 DRM_INFO("set_domain_ioctl %p(%d), %08x %08x\n", 1009 DRM_INFO("set_domain_ioctl %p(%zd), %08x %08x\n",
1010 obj, obj->size, read_domains, write_domain); 1010 obj, obj->size, read_domains, write_domain);
1011#endif 1011#endif
1012 if (read_domains & I915_GEM_DOMAIN_GTT) { 1012 if (read_domains & I915_GEM_DOMAIN_GTT) {
@@ -1050,7 +1050,7 @@ i915_gem_sw_finish_ioctl(struct drm_device *dev, void *data,
1050 } 1050 }
1051 1051
1052#if WATCH_BUF 1052#if WATCH_BUF
1053 DRM_INFO("%s: sw_finish %d (%p %d)\n", 1053 DRM_INFO("%s: sw_finish %d (%p %zd)\n",
1054 __func__, args->handle, obj, obj->size); 1054 __func__, args->handle, obj, obj->size);
1055#endif 1055#endif
1056 obj_priv = obj->driver_private; 1056 obj_priv = obj->driver_private;
@@ -1252,6 +1252,31 @@ out_free_list:
1252 return ret; 1252 return ret;
1253} 1253}
1254 1254
1255/**
1256 * i915_gem_release_mmap - remove physical page mappings
1257 * @obj: obj in question
1258 *
1259 * Preserve the reservation of the mmaping with the DRM core code, but
1260 * relinquish ownership of the pages back to the system.
1261 *
1262 * It is vital that we remove the page mapping if we have mapped a tiled
1263 * object through the GTT and then lose the fence register due to
1264 * resource pressure. Similarly if the object has been moved out of the
1265 * aperture, than pages mapped into userspace must be revoked. Removing the
1266 * mapping will then trigger a page fault on the next user access, allowing
1267 * fixup by i915_gem_fault().
1268 */
1269void
1270i915_gem_release_mmap(struct drm_gem_object *obj)
1271{
1272 struct drm_device *dev = obj->dev;
1273 struct drm_i915_gem_object *obj_priv = obj->driver_private;
1274
1275 if (dev->dev_mapping)
1276 unmap_mapping_range(dev->dev_mapping,
1277 obj_priv->mmap_offset, obj->size, 1);
1278}
1279
1255static void 1280static void
1256i915_gem_free_mmap_offset(struct drm_gem_object *obj) 1281i915_gem_free_mmap_offset(struct drm_gem_object *obj)
1257{ 1282{
@@ -1545,7 +1570,7 @@ i915_add_request(struct drm_device *dev, struct drm_file *file_priv,
1545 } 1570 }
1546 1571
1547 if (was_empty && !dev_priv->mm.suspended) 1572 if (was_empty && !dev_priv->mm.suspended)
1548 schedule_delayed_work(&dev_priv->mm.retire_work, HZ); 1573 queue_delayed_work(dev_priv->wq, &dev_priv->mm.retire_work, HZ);
1549 return seqno; 1574 return seqno;
1550} 1575}
1551 1576
@@ -1694,7 +1719,7 @@ i915_gem_retire_work_handler(struct work_struct *work)
1694 i915_gem_retire_requests(dev); 1719 i915_gem_retire_requests(dev);
1695 if (!dev_priv->mm.suspended && 1720 if (!dev_priv->mm.suspended &&
1696 !list_empty(&dev_priv->mm.request_list)) 1721 !list_empty(&dev_priv->mm.request_list))
1697 schedule_delayed_work(&dev_priv->mm.retire_work, HZ); 1722 queue_delayed_work(dev_priv->wq, &dev_priv->mm.retire_work, HZ);
1698 mutex_unlock(&dev->struct_mutex); 1723 mutex_unlock(&dev->struct_mutex);
1699} 1724}
1700 1725
@@ -1861,7 +1886,6 @@ i915_gem_object_unbind(struct drm_gem_object *obj)
1861{ 1886{
1862 struct drm_device *dev = obj->dev; 1887 struct drm_device *dev = obj->dev;
1863 struct drm_i915_gem_object *obj_priv = obj->driver_private; 1888 struct drm_i915_gem_object *obj_priv = obj->driver_private;
1864 loff_t offset;
1865 int ret = 0; 1889 int ret = 0;
1866 1890
1867#if WATCH_BUF 1891#if WATCH_BUF
@@ -1898,9 +1922,7 @@ i915_gem_object_unbind(struct drm_gem_object *obj)
1898 BUG_ON(obj_priv->active); 1922 BUG_ON(obj_priv->active);
1899 1923
1900 /* blow away mappings if mapped through GTT */ 1924 /* blow away mappings if mapped through GTT */
1901 offset = ((loff_t) obj->map_list.hash.key) << PAGE_SHIFT; 1925 i915_gem_release_mmap(obj);
1902 if (dev->dev_mapping)
1903 unmap_mapping_range(dev->dev_mapping, offset, obj->size, 1);
1904 1926
1905 if (obj_priv->fence_reg != I915_FENCE_REG_NONE) 1927 if (obj_priv->fence_reg != I915_FENCE_REG_NONE)
1906 i915_gem_clear_fence_reg(obj); 1928 i915_gem_clear_fence_reg(obj);
@@ -2222,7 +2244,6 @@ try_again:
2222 /* None available, try to steal one or wait for a user to finish */ 2244 /* None available, try to steal one or wait for a user to finish */
2223 if (i == dev_priv->num_fence_regs) { 2245 if (i == dev_priv->num_fence_regs) {
2224 uint32_t seqno = dev_priv->mm.next_gem_seqno; 2246 uint32_t seqno = dev_priv->mm.next_gem_seqno;
2225 loff_t offset;
2226 2247
2227 if (avail == 0) 2248 if (avail == 0)
2228 return -ENOSPC; 2249 return -ENOSPC;
@@ -2274,10 +2295,7 @@ try_again:
2274 * Zap this virtual mapping so we can set up a fence again 2295 * Zap this virtual mapping so we can set up a fence again
2275 * for this object next time we need it. 2296 * for this object next time we need it.
2276 */ 2297 */
2277 offset = ((loff_t) reg->obj->map_list.hash.key) << PAGE_SHIFT; 2298 i915_gem_release_mmap(reg->obj);
2278 if (dev->dev_mapping)
2279 unmap_mapping_range(dev->dev_mapping, offset,
2280 reg->obj->size, 1);
2281 old_obj_priv->fence_reg = I915_FENCE_REG_NONE; 2299 old_obj_priv->fence_reg = I915_FENCE_REG_NONE;
2282 } 2300 }
2283 2301
@@ -2423,7 +2441,7 @@ i915_gem_object_bind_to_gtt(struct drm_gem_object *obj, unsigned alignment)
2423 } 2441 }
2424 2442
2425#if WATCH_BUF 2443#if WATCH_BUF
2426 DRM_INFO("Binding object of size %d at 0x%08x\n", 2444 DRM_INFO("Binding object of size %zd at 0x%08x\n",
2427 obj->size, obj_priv->gtt_offset); 2445 obj->size, obj_priv->gtt_offset);
2428#endif 2446#endif
2429 ret = i915_gem_object_get_pages(obj); 2447 ret = i915_gem_object_get_pages(obj);
@@ -4227,6 +4245,7 @@ i915_gem_lastclose(struct drm_device *dev)
4227void 4245void
4228i915_gem_load(struct drm_device *dev) 4246i915_gem_load(struct drm_device *dev)
4229{ 4247{
4248 int i;
4230 drm_i915_private_t *dev_priv = dev->dev_private; 4249 drm_i915_private_t *dev_priv = dev->dev_private;
4231 4250
4232 spin_lock_init(&dev_priv->mm.active_list_lock); 4251 spin_lock_init(&dev_priv->mm.active_list_lock);
@@ -4246,6 +4265,18 @@ i915_gem_load(struct drm_device *dev)
4246 else 4265 else
4247 dev_priv->num_fence_regs = 8; 4266 dev_priv->num_fence_regs = 8;
4248 4267
4268 /* Initialize fence registers to zero */
4269 if (IS_I965G(dev)) {
4270 for (i = 0; i < 16; i++)
4271 I915_WRITE64(FENCE_REG_965_0 + (i * 8), 0);
4272 } else {
4273 for (i = 0; i < 8; i++)
4274 I915_WRITE(FENCE_REG_830_0 + (i * 4), 0);
4275 if (IS_I945G(dev) || IS_I945GM(dev) || IS_G33(dev))
4276 for (i = 0; i < 8; i++)
4277 I915_WRITE(FENCE_REG_945_8 + (i * 4), 0);
4278 }
4279
4249 i915_gem_detect_bit_6_swizzle(dev); 4280 i915_gem_detect_bit_6_swizzle(dev);
4250} 4281}
4251 4282
diff --git a/drivers/gpu/drm/i915/i915_gem_debug.c b/drivers/gpu/drm/i915/i915_gem_debug.c
index 8d0b943e2c5a..e602614bd3f8 100644
--- a/drivers/gpu/drm/i915/i915_gem_debug.c
+++ b/drivers/gpu/drm/i915/i915_gem_debug.c
@@ -87,7 +87,7 @@ i915_gem_dump_object(struct drm_gem_object *obj, int len,
87 chunk_len = page_len - chunk; 87 chunk_len = page_len - chunk;
88 if (chunk_len > 128) 88 if (chunk_len > 128)
89 chunk_len = 128; 89 chunk_len = 128;
90 i915_gem_dump_page(obj_priv->page_list[page], 90 i915_gem_dump_page(obj_priv->pages[page],
91 chunk, chunk + chunk_len, 91 chunk, chunk + chunk_len,
92 obj_priv->gtt_offset + 92 obj_priv->gtt_offset +
93 page * PAGE_SIZE, 93 page * PAGE_SIZE,
@@ -143,7 +143,7 @@ i915_gem_object_check_coherency(struct drm_gem_object *obj, int handle)
143 uint32_t *backing_map = NULL; 143 uint32_t *backing_map = NULL;
144 int bad_count = 0; 144 int bad_count = 0;
145 145
146 DRM_INFO("%s: checking coherency of object %p@0x%08x (%d, %dkb):\n", 146 DRM_INFO("%s: checking coherency of object %p@0x%08x (%d, %zdkb):\n",
147 __func__, obj, obj_priv->gtt_offset, handle, 147 __func__, obj, obj_priv->gtt_offset, handle,
148 obj->size / 1024); 148 obj->size / 1024);
149 149
@@ -157,7 +157,7 @@ i915_gem_object_check_coherency(struct drm_gem_object *obj, int handle)
157 for (page = 0; page < obj->size / PAGE_SIZE; page++) { 157 for (page = 0; page < obj->size / PAGE_SIZE; page++) {
158 int i; 158 int i;
159 159
160 backing_map = kmap_atomic(obj_priv->page_list[page], KM_USER0); 160 backing_map = kmap_atomic(obj_priv->pages[page], KM_USER0);
161 161
162 if (backing_map == NULL) { 162 if (backing_map == NULL) {
163 DRM_ERROR("failed to map backing page\n"); 163 DRM_ERROR("failed to map backing page\n");
diff --git a/drivers/gpu/drm/i915/i915_gem_debugfs.c b/drivers/gpu/drm/i915/i915_gem_debugfs.c
index 28146e405e87..cb3b97405fbf 100644
--- a/drivers/gpu/drm/i915/i915_gem_debugfs.c
+++ b/drivers/gpu/drm/i915/i915_gem_debugfs.c
@@ -75,11 +75,10 @@ static int i915_gem_object_list_info(struct seq_file *m, void *data)
75 case ACTIVE_LIST: 75 case ACTIVE_LIST:
76 seq_printf(m, "Active:\n"); 76 seq_printf(m, "Active:\n");
77 lock = &dev_priv->mm.active_list_lock; 77 lock = &dev_priv->mm.active_list_lock;
78 spin_lock(lock);
79 head = &dev_priv->mm.active_list; 78 head = &dev_priv->mm.active_list;
80 break; 79 break;
81 case INACTIVE_LIST: 80 case INACTIVE_LIST:
82 seq_printf(m, "Inctive:\n"); 81 seq_printf(m, "Inactive:\n");
83 head = &dev_priv->mm.inactive_list; 82 head = &dev_priv->mm.inactive_list;
84 break; 83 break;
85 case FLUSHING_LIST: 84 case FLUSHING_LIST:
@@ -91,6 +90,8 @@ static int i915_gem_object_list_info(struct seq_file *m, void *data)
91 return 0; 90 return 0;
92 } 91 }
93 92
93 if (lock)
94 spin_lock(lock);
94 list_for_each_entry(obj_priv, head, list) 95 list_for_each_entry(obj_priv, head, list)
95 { 96 {
96 struct drm_gem_object *obj = obj_priv->obj; 97 struct drm_gem_object *obj = obj_priv->obj;
@@ -104,7 +105,10 @@ static int i915_gem_object_list_info(struct seq_file *m, void *data)
104 if (obj->name) 105 if (obj->name)
105 seq_printf(m, " (name: %d)", obj->name); 106 seq_printf(m, " (name: %d)", obj->name);
106 if (obj_priv->fence_reg != I915_FENCE_REG_NONE) 107 if (obj_priv->fence_reg != I915_FENCE_REG_NONE)
107 seq_printf(m, " (fence: %d)\n", obj_priv->fence_reg); 108 seq_printf(m, " (fence: %d)", obj_priv->fence_reg);
109 if (obj_priv->gtt_space != NULL)
110 seq_printf(m, " (gtt_offset: %08x)", obj_priv->gtt_offset);
111
108 seq_printf(m, "\n"); 112 seq_printf(m, "\n");
109 } 113 }
110 114
@@ -323,6 +327,41 @@ static int i915_ringbuffer_info(struct seq_file *m, void *data)
323 return 0; 327 return 0;
324} 328}
325 329
330static int i915_error_state(struct seq_file *m, void *unused)
331{
332 struct drm_info_node *node = (struct drm_info_node *) m->private;
333 struct drm_device *dev = node->minor->dev;
334 drm_i915_private_t *dev_priv = dev->dev_private;
335 struct drm_i915_error_state *error;
336 unsigned long flags;
337
338 spin_lock_irqsave(&dev_priv->error_lock, flags);
339 if (!dev_priv->first_error) {
340 seq_printf(m, "no error state collected\n");
341 goto out;
342 }
343
344 error = dev_priv->first_error;
345
346 seq_printf(m, "Time: %ld s %ld us\n", error->time.tv_sec,
347 error->time.tv_usec);
348 seq_printf(m, "EIR: 0x%08x\n", error->eir);
349 seq_printf(m, " PGTBL_ER: 0x%08x\n", error->pgtbl_er);
350 seq_printf(m, " INSTPM: 0x%08x\n", error->instpm);
351 seq_printf(m, " IPEIR: 0x%08x\n", error->ipeir);
352 seq_printf(m, " IPEHR: 0x%08x\n", error->ipehr);
353 seq_printf(m, " INSTDONE: 0x%08x\n", error->instdone);
354 seq_printf(m, " ACTHD: 0x%08x\n", error->acthd);
355 if (IS_I965G(dev)) {
356 seq_printf(m, " INSTPS: 0x%08x\n", error->instps);
357 seq_printf(m, " INSTDONE1: 0x%08x\n", error->instdone1);
358 }
359
360out:
361 spin_unlock_irqrestore(&dev_priv->error_lock, flags);
362
363 return 0;
364}
326 365
327static struct drm_info_list i915_gem_debugfs_list[] = { 366static struct drm_info_list i915_gem_debugfs_list[] = {
328 {"i915_gem_active", i915_gem_object_list_info, 0, (void *) ACTIVE_LIST}, 367 {"i915_gem_active", i915_gem_object_list_info, 0, (void *) ACTIVE_LIST},
@@ -336,6 +375,7 @@ static struct drm_info_list i915_gem_debugfs_list[] = {
336 {"i915_ringbuffer_data", i915_ringbuffer_data, 0}, 375 {"i915_ringbuffer_data", i915_ringbuffer_data, 0},
337 {"i915_ringbuffer_info", i915_ringbuffer_info, 0}, 376 {"i915_ringbuffer_info", i915_ringbuffer_info, 0},
338 {"i915_batchbuffers", i915_batchbuffer_info, 0}, 377 {"i915_batchbuffers", i915_batchbuffer_info, 0},
378 {"i915_error_state", i915_error_state, 0},
339}; 379};
340#define I915_GEM_DEBUGFS_ENTRIES ARRAY_SIZE(i915_gem_debugfs_list) 380#define I915_GEM_DEBUGFS_ENTRIES ARRAY_SIZE(i915_gem_debugfs_list)
341 381
diff --git a/drivers/gpu/drm/i915/i915_gem_tiling.c b/drivers/gpu/drm/i915/i915_gem_tiling.c
index 5c1ceec49f5b..a2d527b22ec4 100644
--- a/drivers/gpu/drm/i915/i915_gem_tiling.c
+++ b/drivers/gpu/drm/i915/i915_gem_tiling.c
@@ -114,11 +114,13 @@ intel_alloc_mchbar_resource(struct drm_device *dev)
114 mchbar_addr = ((u64)temp_hi << 32) | temp_lo; 114 mchbar_addr = ((u64)temp_hi << 32) | temp_lo;
115 115
116 /* If ACPI doesn't have it, assume we need to allocate it ourselves */ 116 /* If ACPI doesn't have it, assume we need to allocate it ourselves */
117#ifdef CONFIG_PNP
117 if (mchbar_addr && 118 if (mchbar_addr &&
118 pnp_range_reserved(mchbar_addr, mchbar_addr + MCHBAR_SIZE)) { 119 pnp_range_reserved(mchbar_addr, mchbar_addr + MCHBAR_SIZE)) {
119 ret = 0; 120 ret = 0;
120 goto out_put; 121 goto out_put;
121 } 122 }
123#endif
122 124
123 /* Get some space for it */ 125 /* Get some space for it */
124 ret = pci_bus_alloc_resource(bridge_dev->bus, &dev_priv->mch_res, 126 ret = pci_bus_alloc_resource(bridge_dev->bus, &dev_priv->mch_res,
@@ -519,6 +521,12 @@ i915_gem_set_tiling(struct drm_device *dev, void *data,
519 goto err; 521 goto err;
520 } 522 }
521 523
524 /* If we've changed tiling, GTT-mappings of the object
525 * need to re-fault to ensure that the correct fence register
526 * setup is in place.
527 */
528 i915_gem_release_mmap(obj);
529
522 obj_priv->tiling_mode = args->tiling_mode; 530 obj_priv->tiling_mode = args->tiling_mode;
523 obj_priv->stride = args->stride; 531 obj_priv->stride = args->stride;
524 } 532 }
diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c
index b86b7b7130c6..7ebc84c2881e 100644
--- a/drivers/gpu/drm/i915/i915_irq.c
+++ b/drivers/gpu/drm/i915/i915_irq.c
@@ -26,6 +26,7 @@
26 * 26 *
27 */ 27 */
28 28
29#include <linux/sysrq.h>
29#include "drmP.h" 30#include "drmP.h"
30#include "drm.h" 31#include "drm.h"
31#include "i915_drm.h" 32#include "i915_drm.h"
@@ -41,9 +42,10 @@
41 * we leave them always unmasked in IMR and then control enabling them through 42 * we leave them always unmasked in IMR and then control enabling them through
42 * PIPESTAT alone. 43 * PIPESTAT alone.
43 */ 44 */
44#define I915_INTERRUPT_ENABLE_FIX (I915_ASLE_INTERRUPT | \ 45#define I915_INTERRUPT_ENABLE_FIX (I915_ASLE_INTERRUPT | \
45 I915_DISPLAY_PIPE_A_EVENT_INTERRUPT | \ 46 I915_DISPLAY_PIPE_A_EVENT_INTERRUPT | \
46 I915_DISPLAY_PIPE_B_EVENT_INTERRUPT) 47 I915_DISPLAY_PIPE_B_EVENT_INTERRUPT | \
48 I915_RENDER_COMMAND_PARSER_ERROR_INTERRUPT)
47 49
48/** Interrupts that we mask and unmask at runtime. */ 50/** Interrupts that we mask and unmask at runtime. */
49#define I915_INTERRUPT_ENABLE_VAR (I915_USER_INTERRUPT) 51#define I915_INTERRUPT_ENABLE_VAR (I915_USER_INTERRUPT)
@@ -188,7 +190,7 @@ u32 i915_get_vblank_counter(struct drm_device *dev, int pipe)
188 low_frame = pipe ? PIPEBFRAMEPIXEL : PIPEAFRAMEPIXEL; 190 low_frame = pipe ? PIPEBFRAMEPIXEL : PIPEAFRAMEPIXEL;
189 191
190 if (!i915_pipe_enabled(dev, pipe)) { 192 if (!i915_pipe_enabled(dev, pipe)) {
191 DRM_ERROR("trying to get vblank count for disabled pipe %d\n", pipe); 193 DRM_DEBUG("trying to get vblank count for disabled pipe %d\n", pipe);
192 return 0; 194 return 0;
193 } 195 }
194 196
@@ -217,7 +219,7 @@ u32 gm45_get_vblank_counter(struct drm_device *dev, int pipe)
217 int reg = pipe ? PIPEB_FRMCOUNT_GM45 : PIPEA_FRMCOUNT_GM45; 219 int reg = pipe ? PIPEB_FRMCOUNT_GM45 : PIPEA_FRMCOUNT_GM45;
218 220
219 if (!i915_pipe_enabled(dev, pipe)) { 221 if (!i915_pipe_enabled(dev, pipe)) {
220 DRM_ERROR("trying to get vblank count for disabled pipe %d\n", pipe); 222 DRM_DEBUG("trying to get vblank count for disabled pipe %d\n", pipe);
221 return 0; 223 return 0;
222 } 224 }
223 225
@@ -232,7 +234,17 @@ static void i915_hotplug_work_func(struct work_struct *work)
232 drm_i915_private_t *dev_priv = container_of(work, drm_i915_private_t, 234 drm_i915_private_t *dev_priv = container_of(work, drm_i915_private_t,
233 hotplug_work); 235 hotplug_work);
234 struct drm_device *dev = dev_priv->dev; 236 struct drm_device *dev = dev_priv->dev;
235 237 struct drm_mode_config *mode_config = &dev->mode_config;
238 struct drm_connector *connector;
239
240 if (mode_config->num_connector) {
241 list_for_each_entry(connector, &mode_config->connector_list, head) {
242 struct intel_output *intel_output = to_intel_output(connector);
243
244 if (intel_output->hot_plug)
245 (*intel_output->hot_plug) (intel_output);
246 }
247 }
236 /* Just fire off a uevent and let userspace tell us what to do */ 248 /* Just fire off a uevent and let userspace tell us what to do */
237 drm_sysfs_hotplug_event(dev); 249 drm_sysfs_hotplug_event(dev);
238} 250}
@@ -278,6 +290,201 @@ irqreturn_t igdng_irq_handler(struct drm_device *dev)
278 return ret; 290 return ret;
279} 291}
280 292
293/**
294 * i915_error_work_func - do process context error handling work
295 * @work: work struct
296 *
297 * Fire an error uevent so userspace can see that a hang or error
298 * was detected.
299 */
300static void i915_error_work_func(struct work_struct *work)
301{
302 drm_i915_private_t *dev_priv = container_of(work, drm_i915_private_t,
303 error_work);
304 struct drm_device *dev = dev_priv->dev;
305 char *event_string = "ERROR=1";
306 char *envp[] = { event_string, NULL };
307
308 DRM_DEBUG("generating error event\n");
309
310 kobject_uevent_env(&dev->primary->kdev.kobj, KOBJ_CHANGE, envp);
311}
312
313/**
314 * i915_capture_error_state - capture an error record for later analysis
315 * @dev: drm device
316 *
317 * Should be called when an error is detected (either a hang or an error
318 * interrupt) to capture error state from the time of the error. Fills
319 * out a structure which becomes available in debugfs for user level tools
320 * to pick up.
321 */
322static void i915_capture_error_state(struct drm_device *dev)
323{
324 struct drm_i915_private *dev_priv = dev->dev_private;
325 struct drm_i915_error_state *error;
326 unsigned long flags;
327
328 spin_lock_irqsave(&dev_priv->error_lock, flags);
329 if (dev_priv->first_error)
330 goto out;
331
332 error = kmalloc(sizeof(*error), GFP_ATOMIC);
333 if (!error) {
334 DRM_DEBUG("out ot memory, not capturing error state\n");
335 goto out;
336 }
337
338 error->eir = I915_READ(EIR);
339 error->pgtbl_er = I915_READ(PGTBL_ER);
340 error->pipeastat = I915_READ(PIPEASTAT);
341 error->pipebstat = I915_READ(PIPEBSTAT);
342 error->instpm = I915_READ(INSTPM);
343 if (!IS_I965G(dev)) {
344 error->ipeir = I915_READ(IPEIR);
345 error->ipehr = I915_READ(IPEHR);
346 error->instdone = I915_READ(INSTDONE);
347 error->acthd = I915_READ(ACTHD);
348 } else {
349 error->ipeir = I915_READ(IPEIR_I965);
350 error->ipehr = I915_READ(IPEHR_I965);
351 error->instdone = I915_READ(INSTDONE_I965);
352 error->instps = I915_READ(INSTPS);
353 error->instdone1 = I915_READ(INSTDONE1);
354 error->acthd = I915_READ(ACTHD_I965);
355 }
356
357 do_gettimeofday(&error->time);
358
359 dev_priv->first_error = error;
360
361out:
362 spin_unlock_irqrestore(&dev_priv->error_lock, flags);
363}
364
365/**
366 * i915_handle_error - handle an error interrupt
367 * @dev: drm device
368 *
369 * Do some basic checking of regsiter state at error interrupt time and
370 * dump it to the syslog. Also call i915_capture_error_state() to make
371 * sure we get a record and make it available in debugfs. Fire a uevent
372 * so userspace knows something bad happened (should trigger collection
373 * of a ring dump etc.).
374 */
375static void i915_handle_error(struct drm_device *dev)
376{
377 struct drm_i915_private *dev_priv = dev->dev_private;
378 u32 eir = I915_READ(EIR);
379 u32 pipea_stats = I915_READ(PIPEASTAT);
380 u32 pipeb_stats = I915_READ(PIPEBSTAT);
381
382 i915_capture_error_state(dev);
383
384 printk(KERN_ERR "render error detected, EIR: 0x%08x\n",
385 eir);
386
387 if (IS_G4X(dev)) {
388 if (eir & (GM45_ERROR_MEM_PRIV | GM45_ERROR_CP_PRIV)) {
389 u32 ipeir = I915_READ(IPEIR_I965);
390
391 printk(KERN_ERR " IPEIR: 0x%08x\n",
392 I915_READ(IPEIR_I965));
393 printk(KERN_ERR " IPEHR: 0x%08x\n",
394 I915_READ(IPEHR_I965));
395 printk(KERN_ERR " INSTDONE: 0x%08x\n",
396 I915_READ(INSTDONE_I965));
397 printk(KERN_ERR " INSTPS: 0x%08x\n",
398 I915_READ(INSTPS));
399 printk(KERN_ERR " INSTDONE1: 0x%08x\n",
400 I915_READ(INSTDONE1));
401 printk(KERN_ERR " ACTHD: 0x%08x\n",
402 I915_READ(ACTHD_I965));
403 I915_WRITE(IPEIR_I965, ipeir);
404 (void)I915_READ(IPEIR_I965);
405 }
406 if (eir & GM45_ERROR_PAGE_TABLE) {
407 u32 pgtbl_err = I915_READ(PGTBL_ER);
408 printk(KERN_ERR "page table error\n");
409 printk(KERN_ERR " PGTBL_ER: 0x%08x\n",
410 pgtbl_err);
411 I915_WRITE(PGTBL_ER, pgtbl_err);
412 (void)I915_READ(PGTBL_ER);
413 }
414 }
415
416 if (IS_I9XX(dev)) {
417 if (eir & I915_ERROR_PAGE_TABLE) {
418 u32 pgtbl_err = I915_READ(PGTBL_ER);
419 printk(KERN_ERR "page table error\n");
420 printk(KERN_ERR " PGTBL_ER: 0x%08x\n",
421 pgtbl_err);
422 I915_WRITE(PGTBL_ER, pgtbl_err);
423 (void)I915_READ(PGTBL_ER);
424 }
425 }
426
427 if (eir & I915_ERROR_MEMORY_REFRESH) {
428 printk(KERN_ERR "memory refresh error\n");
429 printk(KERN_ERR "PIPEASTAT: 0x%08x\n",
430 pipea_stats);
431 printk(KERN_ERR "PIPEBSTAT: 0x%08x\n",
432 pipeb_stats);
433 /* pipestat has already been acked */
434 }
435 if (eir & I915_ERROR_INSTRUCTION) {
436 printk(KERN_ERR "instruction error\n");
437 printk(KERN_ERR " INSTPM: 0x%08x\n",
438 I915_READ(INSTPM));
439 if (!IS_I965G(dev)) {
440 u32 ipeir = I915_READ(IPEIR);
441
442 printk(KERN_ERR " IPEIR: 0x%08x\n",
443 I915_READ(IPEIR));
444 printk(KERN_ERR " IPEHR: 0x%08x\n",
445 I915_READ(IPEHR));
446 printk(KERN_ERR " INSTDONE: 0x%08x\n",
447 I915_READ(INSTDONE));
448 printk(KERN_ERR " ACTHD: 0x%08x\n",
449 I915_READ(ACTHD));
450 I915_WRITE(IPEIR, ipeir);
451 (void)I915_READ(IPEIR);
452 } else {
453 u32 ipeir = I915_READ(IPEIR_I965);
454
455 printk(KERN_ERR " IPEIR: 0x%08x\n",
456 I915_READ(IPEIR_I965));
457 printk(KERN_ERR " IPEHR: 0x%08x\n",
458 I915_READ(IPEHR_I965));
459 printk(KERN_ERR " INSTDONE: 0x%08x\n",
460 I915_READ(INSTDONE_I965));
461 printk(KERN_ERR " INSTPS: 0x%08x\n",
462 I915_READ(INSTPS));
463 printk(KERN_ERR " INSTDONE1: 0x%08x\n",
464 I915_READ(INSTDONE1));
465 printk(KERN_ERR " ACTHD: 0x%08x\n",
466 I915_READ(ACTHD_I965));
467 I915_WRITE(IPEIR_I965, ipeir);
468 (void)I915_READ(IPEIR_I965);
469 }
470 }
471
472 I915_WRITE(EIR, eir);
473 (void)I915_READ(EIR);
474 eir = I915_READ(EIR);
475 if (eir) {
476 /*
477 * some errors might have become stuck,
478 * mask them.
479 */
480 DRM_ERROR("EIR stuck: 0x%08x, masking\n", eir);
481 I915_WRITE(EMR, I915_READ(EMR) | eir);
482 I915_WRITE(IIR, I915_RENDER_COMMAND_PARSER_ERROR_INTERRUPT);
483 }
484
485 queue_work(dev_priv->wq, &dev_priv->error_work);
486}
487
281irqreturn_t i915_driver_irq_handler(DRM_IRQ_ARGS) 488irqreturn_t i915_driver_irq_handler(DRM_IRQ_ARGS)
282{ 489{
283 struct drm_device *dev = (struct drm_device *) arg; 490 struct drm_device *dev = (struct drm_device *) arg;
@@ -319,15 +526,22 @@ irqreturn_t i915_driver_irq_handler(DRM_IRQ_ARGS)
319 pipea_stats = I915_READ(PIPEASTAT); 526 pipea_stats = I915_READ(PIPEASTAT);
320 pipeb_stats = I915_READ(PIPEBSTAT); 527 pipeb_stats = I915_READ(PIPEBSTAT);
321 528
529 if (iir & I915_RENDER_COMMAND_PARSER_ERROR_INTERRUPT)
530 i915_handle_error(dev);
531
322 /* 532 /*
323 * Clear the PIPE(A|B)STAT regs before the IIR 533 * Clear the PIPE(A|B)STAT regs before the IIR
324 */ 534 */
325 if (pipea_stats & 0x8000ffff) { 535 if (pipea_stats & 0x8000ffff) {
536 if (pipea_stats & PIPE_FIFO_UNDERRUN_STATUS)
537 DRM_DEBUG("pipe a underrun\n");
326 I915_WRITE(PIPEASTAT, pipea_stats); 538 I915_WRITE(PIPEASTAT, pipea_stats);
327 irq_received = 1; 539 irq_received = 1;
328 } 540 }
329 541
330 if (pipeb_stats & 0x8000ffff) { 542 if (pipeb_stats & 0x8000ffff) {
543 if (pipeb_stats & PIPE_FIFO_UNDERRUN_STATUS)
544 DRM_DEBUG("pipe b underrun\n");
331 I915_WRITE(PIPEBSTAT, pipeb_stats); 545 I915_WRITE(PIPEBSTAT, pipeb_stats);
332 irq_received = 1; 546 irq_received = 1;
333 } 547 }
@@ -346,7 +560,8 @@ irqreturn_t i915_driver_irq_handler(DRM_IRQ_ARGS)
346 DRM_DEBUG("hotplug event received, stat 0x%08x\n", 560 DRM_DEBUG("hotplug event received, stat 0x%08x\n",
347 hotplug_status); 561 hotplug_status);
348 if (hotplug_status & dev_priv->hotplug_supported_mask) 562 if (hotplug_status & dev_priv->hotplug_supported_mask)
349 schedule_work(&dev_priv->hotplug_work); 563 queue_work(dev_priv->wq,
564 &dev_priv->hotplug_work);
350 565
351 I915_WRITE(PORT_HOTPLUG_STAT, hotplug_status); 566 I915_WRITE(PORT_HOTPLUG_STAT, hotplug_status);
352 I915_READ(PORT_HOTPLUG_STAT); 567 I915_READ(PORT_HOTPLUG_STAT);
@@ -699,6 +914,7 @@ void i915_driver_irq_preinstall(struct drm_device * dev)
699 atomic_set(&dev_priv->irq_received, 0); 914 atomic_set(&dev_priv->irq_received, 0);
700 915
701 INIT_WORK(&dev_priv->hotplug_work, i915_hotplug_work_func); 916 INIT_WORK(&dev_priv->hotplug_work, i915_hotplug_work_func);
917 INIT_WORK(&dev_priv->error_work, i915_error_work_func);
702 918
703 if (IS_IGDNG(dev)) { 919 if (IS_IGDNG(dev)) {
704 igdng_irq_preinstall(dev); 920 igdng_irq_preinstall(dev);
@@ -722,6 +938,7 @@ int i915_driver_irq_postinstall(struct drm_device *dev)
722{ 938{
723 drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private; 939 drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private;
724 u32 enable_mask = I915_INTERRUPT_ENABLE_FIX | I915_INTERRUPT_ENABLE_VAR; 940 u32 enable_mask = I915_INTERRUPT_ENABLE_FIX | I915_INTERRUPT_ENABLE_VAR;
941 u32 error_mask;
725 942
726 DRM_INIT_WAITQUEUE(&dev_priv->irq_queue); 943 DRM_INIT_WAITQUEUE(&dev_priv->irq_queue);
727 944
@@ -758,6 +975,21 @@ int i915_driver_irq_postinstall(struct drm_device *dev)
758 i915_enable_irq(dev_priv, I915_DISPLAY_PORT_INTERRUPT); 975 i915_enable_irq(dev_priv, I915_DISPLAY_PORT_INTERRUPT);
759 } 976 }
760 977
978 /*
979 * Enable some error detection, note the instruction error mask
980 * bit is reserved, so we leave it masked.
981 */
982 if (IS_G4X(dev)) {
983 error_mask = ~(GM45_ERROR_PAGE_TABLE |
984 GM45_ERROR_MEM_PRIV |
985 GM45_ERROR_CP_PRIV |
986 I915_ERROR_MEMORY_REFRESH);
987 } else {
988 error_mask = ~(I915_ERROR_PAGE_TABLE |
989 I915_ERROR_MEMORY_REFRESH);
990 }
991 I915_WRITE(EMR, error_mask);
992
761 /* Disable pipe interrupt enables, clear pending pipe status */ 993 /* Disable pipe interrupt enables, clear pending pipe status */
762 I915_WRITE(PIPEASTAT, I915_READ(PIPEASTAT) & 0x8000ffff); 994 I915_WRITE(PIPEASTAT, I915_READ(PIPEASTAT) & 0x8000ffff);
763 I915_WRITE(PIPEBSTAT, I915_READ(PIPEBSTAT) & 0x8000ffff); 995 I915_WRITE(PIPEBSTAT, I915_READ(PIPEBSTAT) & 0x8000ffff);
diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h
index f6237a0b1133..2955083aa471 100644
--- a/drivers/gpu/drm/i915/i915_reg.h
+++ b/drivers/gpu/drm/i915/i915_reg.h
@@ -206,6 +206,7 @@
206/* 206/*
207 * Instruction and interrupt control regs 207 * Instruction and interrupt control regs
208 */ 208 */
209#define PGTBL_ER 0x02024
209#define PRB0_TAIL 0x02030 210#define PRB0_TAIL 0x02030
210#define PRB0_HEAD 0x02034 211#define PRB0_HEAD 0x02034
211#define PRB0_START 0x02038 212#define PRB0_START 0x02038
@@ -226,11 +227,18 @@
226#define PRB1_HEAD 0x02044 /* 915+ only */ 227#define PRB1_HEAD 0x02044 /* 915+ only */
227#define PRB1_START 0x02048 /* 915+ only */ 228#define PRB1_START 0x02048 /* 915+ only */
228#define PRB1_CTL 0x0204c /* 915+ only */ 229#define PRB1_CTL 0x0204c /* 915+ only */
230#define IPEIR_I965 0x02064
231#define IPEHR_I965 0x02068
232#define INSTDONE_I965 0x0206c
233#define INSTPS 0x02070 /* 965+ only */
234#define INSTDONE1 0x0207c /* 965+ only */
229#define ACTHD_I965 0x02074 235#define ACTHD_I965 0x02074
230#define HWS_PGA 0x02080 236#define HWS_PGA 0x02080
231#define HWS_ADDRESS_MASK 0xfffff000 237#define HWS_ADDRESS_MASK 0xfffff000
232#define HWS_START_ADDRESS_SHIFT 4 238#define HWS_START_ADDRESS_SHIFT 4
233#define IPEIR 0x02088 239#define IPEIR 0x02088
240#define IPEHR 0x0208c
241#define INSTDONE 0x02090
234#define NOPID 0x02094 242#define NOPID 0x02094
235#define HWSTAM 0x02098 243#define HWSTAM 0x02098
236#define SCPD0 0x0209c /* 915+ only */ 244#define SCPD0 0x0209c /* 915+ only */
@@ -258,10 +266,22 @@
258#define EIR 0x020b0 266#define EIR 0x020b0
259#define EMR 0x020b4 267#define EMR 0x020b4
260#define ESR 0x020b8 268#define ESR 0x020b8
269#define GM45_ERROR_PAGE_TABLE (1<<5)
270#define GM45_ERROR_MEM_PRIV (1<<4)
271#define I915_ERROR_PAGE_TABLE (1<<4)
272#define GM45_ERROR_CP_PRIV (1<<3)
273#define I915_ERROR_MEMORY_REFRESH (1<<1)
274#define I915_ERROR_INSTRUCTION (1<<0)
261#define INSTPM 0x020c0 275#define INSTPM 0x020c0
262#define ACTHD 0x020c8 276#define ACTHD 0x020c8
263#define FW_BLC 0x020d8 277#define FW_BLC 0x020d8
278#define FW_BLC2 0x020dc
264#define FW_BLC_SELF 0x020e0 /* 915+ only */ 279#define FW_BLC_SELF 0x020e0 /* 915+ only */
280#define FW_BLC_SELF_EN (1<<15)
281#define MM_BURST_LENGTH 0x00700000
282#define MM_FIFO_WATERMARK 0x0001F000
283#define LM_BURST_LENGTH 0x00000700
284#define LM_FIFO_WATERMARK 0x0000001F
265#define MI_ARB_STATE 0x020e4 /* 915+ only */ 285#define MI_ARB_STATE 0x020e4 /* 915+ only */
266#define CACHE_MODE_0 0x02120 /* 915+ only */ 286#define CACHE_MODE_0 0x02120 /* 915+ only */
267#define CM0_MASK_SHIFT 16 287#define CM0_MASK_SHIFT 16
@@ -569,6 +589,23 @@
569#define C0DRB3 0x10206 589#define C0DRB3 0x10206
570#define C1DRB3 0x10606 590#define C1DRB3 0x10606
571 591
592/* Clocking configuration register */
593#define CLKCFG 0x10c00
594#define CLKCFG_FSB_400 (5 << 0) /* hrawclk 100 */
595#define CLKCFG_FSB_533 (1 << 0) /* hrawclk 133 */
596#define CLKCFG_FSB_667 (3 << 0) /* hrawclk 166 */
597#define CLKCFG_FSB_800 (2 << 0) /* hrawclk 200 */
598#define CLKCFG_FSB_1067 (6 << 0) /* hrawclk 266 */
599#define CLKCFG_FSB_1333 (7 << 0) /* hrawclk 333 */
600/* Note, below two are guess */
601#define CLKCFG_FSB_1600 (4 << 0) /* hrawclk 400 */
602#define CLKCFG_FSB_1600_ALT (0 << 0) /* hrawclk 400 */
603#define CLKCFG_FSB_MASK (7 << 0)
604#define CLKCFG_MEM_533 (1 << 4)
605#define CLKCFG_MEM_667 (2 << 4)
606#define CLKCFG_MEM_800 (3 << 4)
607#define CLKCFG_MEM_MASK (7 << 4)
608
572/** GM965 GM45 render standby register */ 609/** GM965 GM45 render standby register */
573#define MCHBAR_RENDER_STANDBY 0x111B8 610#define MCHBAR_RENDER_STANDBY 0x111B8
574 611
@@ -834,9 +871,25 @@
834#define HORIZ_INTERP_MASK (3 << 6) 871#define HORIZ_INTERP_MASK (3 << 6)
835#define HORIZ_AUTO_SCALE (1 << 5) 872#define HORIZ_AUTO_SCALE (1 << 5)
836#define PANEL_8TO6_DITHER_ENABLE (1 << 3) 873#define PANEL_8TO6_DITHER_ENABLE (1 << 3)
874#define PFIT_FILTER_FUZZY (0 << 24)
875#define PFIT_SCALING_AUTO (0 << 26)
876#define PFIT_SCALING_PROGRAMMED (1 << 26)
877#define PFIT_SCALING_PILLAR (2 << 26)
878#define PFIT_SCALING_LETTER (3 << 26)
837#define PFIT_PGM_RATIOS 0x61234 879#define PFIT_PGM_RATIOS 0x61234
838#define PFIT_VERT_SCALE_MASK 0xfff00000 880#define PFIT_VERT_SCALE_MASK 0xfff00000
839#define PFIT_HORIZ_SCALE_MASK 0x0000fff0 881#define PFIT_HORIZ_SCALE_MASK 0x0000fff0
882/* Pre-965 */
883#define PFIT_VERT_SCALE_SHIFT 20
884#define PFIT_VERT_SCALE_MASK 0xfff00000
885#define PFIT_HORIZ_SCALE_SHIFT 4
886#define PFIT_HORIZ_SCALE_MASK 0x0000fff0
887/* 965+ */
888#define PFIT_VERT_SCALE_SHIFT_965 16
889#define PFIT_VERT_SCALE_MASK_965 0x1fff0000
890#define PFIT_HORIZ_SCALE_SHIFT_965 0
891#define PFIT_HORIZ_SCALE_MASK_965 0x00001fff
892
840#define PFIT_AUTO_RATIOS 0x61238 893#define PFIT_AUTO_RATIOS 0x61238
841 894
842/* Backlight control */ 895/* Backlight control */
@@ -1342,6 +1395,7 @@
1342#define TV_V_CHROMA_42 0x684a8 1395#define TV_V_CHROMA_42 0x684a8
1343 1396
1344/* Display Port */ 1397/* Display Port */
1398#define DP_A 0x64000 /* eDP */
1345#define DP_B 0x64100 1399#define DP_B 0x64100
1346#define DP_C 0x64200 1400#define DP_C 0x64200
1347#define DP_D 0x64300 1401#define DP_D 0x64300
@@ -1384,13 +1438,22 @@
1384/* Mystic DPCD version 1.1 special mode */ 1438/* Mystic DPCD version 1.1 special mode */
1385#define DP_ENHANCED_FRAMING (1 << 18) 1439#define DP_ENHANCED_FRAMING (1 << 18)
1386 1440
1441/* eDP */
1442#define DP_PLL_FREQ_270MHZ (0 << 16)
1443#define DP_PLL_FREQ_160MHZ (1 << 16)
1444#define DP_PLL_FREQ_MASK (3 << 16)
1445
1387/** locked once port is enabled */ 1446/** locked once port is enabled */
1388#define DP_PORT_REVERSAL (1 << 15) 1447#define DP_PORT_REVERSAL (1 << 15)
1389 1448
1449/* eDP */
1450#define DP_PLL_ENABLE (1 << 14)
1451
1390/** sends the clock on lane 15 of the PEG for debug */ 1452/** sends the clock on lane 15 of the PEG for debug */
1391#define DP_CLOCK_OUTPUT_ENABLE (1 << 13) 1453#define DP_CLOCK_OUTPUT_ENABLE (1 << 13)
1392 1454
1393#define DP_SCRAMBLING_DISABLE (1 << 12) 1455#define DP_SCRAMBLING_DISABLE (1 << 12)
1456#define DP_SCRAMBLING_DISABLE_IGDNG (1 << 7)
1394 1457
1395/** limit RGB values to avoid confusing TVs */ 1458/** limit RGB values to avoid confusing TVs */
1396#define DP_COLOR_RANGE_16_235 (1 << 8) 1459#define DP_COLOR_RANGE_16_235 (1 << 8)
@@ -1410,6 +1473,13 @@
1410 * is 20 bytes in each direction, hence the 5 fixed 1473 * is 20 bytes in each direction, hence the 5 fixed
1411 * data registers 1474 * data registers
1412 */ 1475 */
1476#define DPA_AUX_CH_CTL 0x64010
1477#define DPA_AUX_CH_DATA1 0x64014
1478#define DPA_AUX_CH_DATA2 0x64018
1479#define DPA_AUX_CH_DATA3 0x6401c
1480#define DPA_AUX_CH_DATA4 0x64020
1481#define DPA_AUX_CH_DATA5 0x64024
1482
1413#define DPB_AUX_CH_CTL 0x64110 1483#define DPB_AUX_CH_CTL 0x64110
1414#define DPB_AUX_CH_DATA1 0x64114 1484#define DPB_AUX_CH_DATA1 0x64114
1415#define DPB_AUX_CH_DATA2 0x64118 1485#define DPB_AUX_CH_DATA2 0x64118
@@ -1552,6 +1622,34 @@
1552#define DSPARB_CSTART_SHIFT 7 1622#define DSPARB_CSTART_SHIFT 7
1553#define DSPARB_BSTART_MASK (0x7f) 1623#define DSPARB_BSTART_MASK (0x7f)
1554#define DSPARB_BSTART_SHIFT 0 1624#define DSPARB_BSTART_SHIFT 0
1625#define DSPARB_BEND_SHIFT 9 /* on 855 */
1626#define DSPARB_AEND_SHIFT 0
1627
1628#define DSPFW1 0x70034
1629#define DSPFW2 0x70038
1630#define DSPFW3 0x7003c
1631#define IGD_SELF_REFRESH_EN (1<<30)
1632
1633/* FIFO watermark sizes etc */
1634#define I915_FIFO_LINE_SIZE 64
1635#define I830_FIFO_LINE_SIZE 32
1636#define I945_FIFO_SIZE 127 /* 945 & 965 */
1637#define I915_FIFO_SIZE 95
1638#define I855GM_FIFO_SIZE 127 /* In cachelines */
1639#define I830_FIFO_SIZE 95
1640#define I915_MAX_WM 0x3f
1641
1642#define IGD_DISPLAY_FIFO 512 /* in 64byte unit */
1643#define IGD_FIFO_LINE_SIZE 64
1644#define IGD_MAX_WM 0x1ff
1645#define IGD_DFT_WM 0x3f
1646#define IGD_DFT_HPLLOFF_WM 0
1647#define IGD_GUARD_WM 10
1648#define IGD_CURSOR_FIFO 64
1649#define IGD_CURSOR_MAX_WM 0x3f
1650#define IGD_CURSOR_DFT_WM 0
1651#define IGD_CURSOR_GUARD_WM 5
1652
1555/* 1653/*
1556 * The two pipe frame counter registers are not synchronized, so 1654 * The two pipe frame counter registers are not synchronized, so
1557 * reading a stable value is somewhat tricky. The following code 1655 * reading a stable value is somewhat tricky. The following code
@@ -1767,6 +1865,8 @@
1767#define PFA_CTL_1 0x68080 1865#define PFA_CTL_1 0x68080
1768#define PFB_CTL_1 0x68880 1866#define PFB_CTL_1 0x68880
1769#define PF_ENABLE (1<<31) 1867#define PF_ENABLE (1<<31)
1868#define PFA_WIN_SZ 0x68074
1869#define PFB_WIN_SZ 0x68874
1770 1870
1771/* legacy palette */ 1871/* legacy palette */
1772#define LGC_PALETTE_A 0x4a000 1872#define LGC_PALETTE_A 0x4a000
@@ -2127,4 +2227,28 @@
2127#define PCH_PP_OFF_DELAYS 0xc720c 2227#define PCH_PP_OFF_DELAYS 0xc720c
2128#define PCH_PP_DIVISOR 0xc7210 2228#define PCH_PP_DIVISOR 0xc7210
2129 2229
2230#define PCH_DP_B 0xe4100
2231#define PCH_DPB_AUX_CH_CTL 0xe4110
2232#define PCH_DPB_AUX_CH_DATA1 0xe4114
2233#define PCH_DPB_AUX_CH_DATA2 0xe4118
2234#define PCH_DPB_AUX_CH_DATA3 0xe411c
2235#define PCH_DPB_AUX_CH_DATA4 0xe4120
2236#define PCH_DPB_AUX_CH_DATA5 0xe4124
2237
2238#define PCH_DP_C 0xe4200
2239#define PCH_DPC_AUX_CH_CTL 0xe4210
2240#define PCH_DPC_AUX_CH_DATA1 0xe4214
2241#define PCH_DPC_AUX_CH_DATA2 0xe4218
2242#define PCH_DPC_AUX_CH_DATA3 0xe421c
2243#define PCH_DPC_AUX_CH_DATA4 0xe4220
2244#define PCH_DPC_AUX_CH_DATA5 0xe4224
2245
2246#define PCH_DP_D 0xe4300
2247#define PCH_DPD_AUX_CH_CTL 0xe4310
2248#define PCH_DPD_AUX_CH_DATA1 0xe4314
2249#define PCH_DPD_AUX_CH_DATA2 0xe4318
2250#define PCH_DPD_AUX_CH_DATA3 0xe431c
2251#define PCH_DPD_AUX_CH_DATA4 0xe4320
2252#define PCH_DPD_AUX_CH_DATA5 0xe4324
2253
2130#endif /* _I915_REG_H_ */ 2254#endif /* _I915_REG_H_ */
diff --git a/drivers/gpu/drm/i915/i915_suspend.c b/drivers/gpu/drm/i915/i915_suspend.c
index a98e2831ed31..1d04e1904ac6 100644
--- a/drivers/gpu/drm/i915/i915_suspend.c
+++ b/drivers/gpu/drm/i915/i915_suspend.c
@@ -222,23 +222,12 @@ static void i915_restore_vga(struct drm_device *dev)
222 I915_WRITE8(VGA_DACMASK, dev_priv->saveDACMASK); 222 I915_WRITE8(VGA_DACMASK, dev_priv->saveDACMASK);
223} 223}
224 224
225int i915_save_state(struct drm_device *dev) 225static void i915_save_modeset_reg(struct drm_device *dev)
226{ 226{
227 struct drm_i915_private *dev_priv = dev->dev_private; 227 struct drm_i915_private *dev_priv = dev->dev_private;
228 int i;
229
230 pci_read_config_byte(dev->pdev, LBB, &dev_priv->saveLBB);
231
232 /* Render Standby */
233 if (IS_I965G(dev) && IS_MOBILE(dev))
234 dev_priv->saveRENDERSTANDBY = I915_READ(MCHBAR_RENDER_STANDBY);
235
236 /* Hardware status page */
237 dev_priv->saveHWS = I915_READ(HWS_PGA);
238
239 /* Display arbitration control */
240 dev_priv->saveDSPARB = I915_READ(DSPARB);
241 228
229 if (drm_core_check_feature(dev, DRIVER_MODESET))
230 return;
242 /* Pipe & plane A info */ 231 /* Pipe & plane A info */
243 dev_priv->savePIPEACONF = I915_READ(PIPEACONF); 232 dev_priv->savePIPEACONF = I915_READ(PIPEACONF);
244 dev_priv->savePIPEASRC = I915_READ(PIPEASRC); 233 dev_priv->savePIPEASRC = I915_READ(PIPEASRC);
@@ -294,7 +283,122 @@ int i915_save_state(struct drm_device *dev)
294 } 283 }
295 i915_save_palette(dev, PIPE_B); 284 i915_save_palette(dev, PIPE_B);
296 dev_priv->savePIPEBSTAT = I915_READ(PIPEBSTAT); 285 dev_priv->savePIPEBSTAT = I915_READ(PIPEBSTAT);
286 return;
287}
288static void i915_restore_modeset_reg(struct drm_device *dev)
289{
290 struct drm_i915_private *dev_priv = dev->dev_private;
291
292 if (drm_core_check_feature(dev, DRIVER_MODESET))
293 return;
294
295 /* Pipe & plane A info */
296 /* Prime the clock */
297 if (dev_priv->saveDPLL_A & DPLL_VCO_ENABLE) {
298 I915_WRITE(DPLL_A, dev_priv->saveDPLL_A &
299 ~DPLL_VCO_ENABLE);
300 DRM_UDELAY(150);
301 }
302 I915_WRITE(FPA0, dev_priv->saveFPA0);
303 I915_WRITE(FPA1, dev_priv->saveFPA1);
304 /* Actually enable it */
305 I915_WRITE(DPLL_A, dev_priv->saveDPLL_A);
306 DRM_UDELAY(150);
307 if (IS_I965G(dev))
308 I915_WRITE(DPLL_A_MD, dev_priv->saveDPLL_A_MD);
309 DRM_UDELAY(150);
310
311 /* Restore mode */
312 I915_WRITE(HTOTAL_A, dev_priv->saveHTOTAL_A);
313 I915_WRITE(HBLANK_A, dev_priv->saveHBLANK_A);
314 I915_WRITE(HSYNC_A, dev_priv->saveHSYNC_A);
315 I915_WRITE(VTOTAL_A, dev_priv->saveVTOTAL_A);
316 I915_WRITE(VBLANK_A, dev_priv->saveVBLANK_A);
317 I915_WRITE(VSYNC_A, dev_priv->saveVSYNC_A);
318 I915_WRITE(BCLRPAT_A, dev_priv->saveBCLRPAT_A);
319
320 /* Restore plane info */
321 I915_WRITE(DSPASIZE, dev_priv->saveDSPASIZE);
322 I915_WRITE(DSPAPOS, dev_priv->saveDSPAPOS);
323 I915_WRITE(PIPEASRC, dev_priv->savePIPEASRC);
324 I915_WRITE(DSPAADDR, dev_priv->saveDSPAADDR);
325 I915_WRITE(DSPASTRIDE, dev_priv->saveDSPASTRIDE);
326 if (IS_I965G(dev)) {
327 I915_WRITE(DSPASURF, dev_priv->saveDSPASURF);
328 I915_WRITE(DSPATILEOFF, dev_priv->saveDSPATILEOFF);
329 }
330
331 I915_WRITE(PIPEACONF, dev_priv->savePIPEACONF);
332
333 i915_restore_palette(dev, PIPE_A);
334 /* Enable the plane */
335 I915_WRITE(DSPACNTR, dev_priv->saveDSPACNTR);
336 I915_WRITE(DSPAADDR, I915_READ(DSPAADDR));
337
338 /* Pipe & plane B info */
339 if (dev_priv->saveDPLL_B & DPLL_VCO_ENABLE) {
340 I915_WRITE(DPLL_B, dev_priv->saveDPLL_B &
341 ~DPLL_VCO_ENABLE);
342 DRM_UDELAY(150);
343 }
344 I915_WRITE(FPB0, dev_priv->saveFPB0);
345 I915_WRITE(FPB1, dev_priv->saveFPB1);
346 /* Actually enable it */
347 I915_WRITE(DPLL_B, dev_priv->saveDPLL_B);
348 DRM_UDELAY(150);
349 if (IS_I965G(dev))
350 I915_WRITE(DPLL_B_MD, dev_priv->saveDPLL_B_MD);
351 DRM_UDELAY(150);
352
353 /* Restore mode */
354 I915_WRITE(HTOTAL_B, dev_priv->saveHTOTAL_B);
355 I915_WRITE(HBLANK_B, dev_priv->saveHBLANK_B);
356 I915_WRITE(HSYNC_B, dev_priv->saveHSYNC_B);
357 I915_WRITE(VTOTAL_B, dev_priv->saveVTOTAL_B);
358 I915_WRITE(VBLANK_B, dev_priv->saveVBLANK_B);
359 I915_WRITE(VSYNC_B, dev_priv->saveVSYNC_B);
360 I915_WRITE(BCLRPAT_B, dev_priv->saveBCLRPAT_B);
361
362 /* Restore plane info */
363 I915_WRITE(DSPBSIZE, dev_priv->saveDSPBSIZE);
364 I915_WRITE(DSPBPOS, dev_priv->saveDSPBPOS);
365 I915_WRITE(PIPEBSRC, dev_priv->savePIPEBSRC);
366 I915_WRITE(DSPBADDR, dev_priv->saveDSPBADDR);
367 I915_WRITE(DSPBSTRIDE, dev_priv->saveDSPBSTRIDE);
368 if (IS_I965G(dev)) {
369 I915_WRITE(DSPBSURF, dev_priv->saveDSPBSURF);
370 I915_WRITE(DSPBTILEOFF, dev_priv->saveDSPBTILEOFF);
371 }
372
373 I915_WRITE(PIPEBCONF, dev_priv->savePIPEBCONF);
374
375 i915_restore_palette(dev, PIPE_B);
376 /* Enable the plane */
377 I915_WRITE(DSPBCNTR, dev_priv->saveDSPBCNTR);
378 I915_WRITE(DSPBADDR, I915_READ(DSPBADDR));
297 379
380 return;
381}
382int i915_save_state(struct drm_device *dev)
383{
384 struct drm_i915_private *dev_priv = dev->dev_private;
385 int i;
386
387 pci_read_config_byte(dev->pdev, LBB, &dev_priv->saveLBB);
388
389 /* Render Standby */
390 if (IS_I965G(dev) && IS_MOBILE(dev))
391 dev_priv->saveRENDERSTANDBY = I915_READ(MCHBAR_RENDER_STANDBY);
392
393 /* Hardware status page */
394 dev_priv->saveHWS = I915_READ(HWS_PGA);
395
396 /* Display arbitration control */
397 dev_priv->saveDSPARB = I915_READ(DSPARB);
398
399 /* This is only meaningful in non-KMS mode */
400 /* Don't save them in KMS mode */
401 i915_save_modeset_reg(dev);
298 /* Cursor state */ 402 /* Cursor state */
299 dev_priv->saveCURACNTR = I915_READ(CURACNTR); 403 dev_priv->saveCURACNTR = I915_READ(CURACNTR);
300 dev_priv->saveCURAPOS = I915_READ(CURAPOS); 404 dev_priv->saveCURAPOS = I915_READ(CURAPOS);
@@ -322,6 +426,20 @@ int i915_save_state(struct drm_device *dev)
322 dev_priv->savePP_OFF_DELAYS = I915_READ(PP_OFF_DELAYS); 426 dev_priv->savePP_OFF_DELAYS = I915_READ(PP_OFF_DELAYS);
323 dev_priv->savePP_DIVISOR = I915_READ(PP_DIVISOR); 427 dev_priv->savePP_DIVISOR = I915_READ(PP_DIVISOR);
324 428
429 /* Display Port state */
430 if (SUPPORTS_INTEGRATED_DP(dev)) {
431 dev_priv->saveDP_B = I915_READ(DP_B);
432 dev_priv->saveDP_C = I915_READ(DP_C);
433 dev_priv->saveDP_D = I915_READ(DP_D);
434 dev_priv->savePIPEA_GMCH_DATA_M = I915_READ(PIPEA_GMCH_DATA_M);
435 dev_priv->savePIPEB_GMCH_DATA_M = I915_READ(PIPEB_GMCH_DATA_M);
436 dev_priv->savePIPEA_GMCH_DATA_N = I915_READ(PIPEA_GMCH_DATA_N);
437 dev_priv->savePIPEB_GMCH_DATA_N = I915_READ(PIPEB_GMCH_DATA_N);
438 dev_priv->savePIPEA_DP_LINK_M = I915_READ(PIPEA_DP_LINK_M);
439 dev_priv->savePIPEB_DP_LINK_M = I915_READ(PIPEB_DP_LINK_M);
440 dev_priv->savePIPEA_DP_LINK_N = I915_READ(PIPEA_DP_LINK_N);
441 dev_priv->savePIPEB_DP_LINK_N = I915_READ(PIPEB_DP_LINK_N);
442 }
325 /* FIXME: save TV & SDVO state */ 443 /* FIXME: save TV & SDVO state */
326 444
327 /* FBC state */ 445 /* FBC state */
@@ -404,92 +522,21 @@ int i915_restore_state(struct drm_device *dev)
404 for (i = 0; i < 8; i++) 522 for (i = 0; i < 8; i++)
405 I915_WRITE(FENCE_REG_945_8 + (i * 4), dev_priv->saveFENCE[i+8]); 523 I915_WRITE(FENCE_REG_945_8 + (i * 4), dev_priv->saveFENCE[i+8]);
406 } 524 }
407 525
408 /* Pipe & plane A info */ 526 /* Display port ratios (must be done before clock is set) */
409 /* Prime the clock */ 527 if (SUPPORTS_INTEGRATED_DP(dev)) {
410 if (dev_priv->saveDPLL_A & DPLL_VCO_ENABLE) { 528 I915_WRITE(PIPEA_GMCH_DATA_M, dev_priv->savePIPEA_GMCH_DATA_M);
411 I915_WRITE(DPLL_A, dev_priv->saveDPLL_A & 529 I915_WRITE(PIPEB_GMCH_DATA_M, dev_priv->savePIPEB_GMCH_DATA_M);
412 ~DPLL_VCO_ENABLE); 530 I915_WRITE(PIPEA_GMCH_DATA_N, dev_priv->savePIPEA_GMCH_DATA_N);
413 DRM_UDELAY(150); 531 I915_WRITE(PIPEB_GMCH_DATA_N, dev_priv->savePIPEB_GMCH_DATA_N);
532 I915_WRITE(PIPEA_DP_LINK_M, dev_priv->savePIPEA_DP_LINK_M);
533 I915_WRITE(PIPEB_DP_LINK_M, dev_priv->savePIPEB_DP_LINK_M);
534 I915_WRITE(PIPEA_DP_LINK_N, dev_priv->savePIPEA_DP_LINK_N);
535 I915_WRITE(PIPEB_DP_LINK_N, dev_priv->savePIPEB_DP_LINK_N);
414 } 536 }
415 I915_WRITE(FPA0, dev_priv->saveFPA0); 537 /* This is only meaningful in non-KMS mode */
416 I915_WRITE(FPA1, dev_priv->saveFPA1); 538 /* Don't restore them in KMS mode */
417 /* Actually enable it */ 539 i915_restore_modeset_reg(dev);
418 I915_WRITE(DPLL_A, dev_priv->saveDPLL_A);
419 DRM_UDELAY(150);
420 if (IS_I965G(dev))
421 I915_WRITE(DPLL_A_MD, dev_priv->saveDPLL_A_MD);
422 DRM_UDELAY(150);
423
424 /* Restore mode */
425 I915_WRITE(HTOTAL_A, dev_priv->saveHTOTAL_A);
426 I915_WRITE(HBLANK_A, dev_priv->saveHBLANK_A);
427 I915_WRITE(HSYNC_A, dev_priv->saveHSYNC_A);
428 I915_WRITE(VTOTAL_A, dev_priv->saveVTOTAL_A);
429 I915_WRITE(VBLANK_A, dev_priv->saveVBLANK_A);
430 I915_WRITE(VSYNC_A, dev_priv->saveVSYNC_A);
431 I915_WRITE(BCLRPAT_A, dev_priv->saveBCLRPAT_A);
432
433 /* Restore plane info */
434 I915_WRITE(DSPASIZE, dev_priv->saveDSPASIZE);
435 I915_WRITE(DSPAPOS, dev_priv->saveDSPAPOS);
436 I915_WRITE(PIPEASRC, dev_priv->savePIPEASRC);
437 I915_WRITE(DSPAADDR, dev_priv->saveDSPAADDR);
438 I915_WRITE(DSPASTRIDE, dev_priv->saveDSPASTRIDE);
439 if (IS_I965G(dev)) {
440 I915_WRITE(DSPASURF, dev_priv->saveDSPASURF);
441 I915_WRITE(DSPATILEOFF, dev_priv->saveDSPATILEOFF);
442 }
443
444 I915_WRITE(PIPEACONF, dev_priv->savePIPEACONF);
445
446 i915_restore_palette(dev, PIPE_A);
447 /* Enable the plane */
448 I915_WRITE(DSPACNTR, dev_priv->saveDSPACNTR);
449 I915_WRITE(DSPAADDR, I915_READ(DSPAADDR));
450
451 /* Pipe & plane B info */
452 if (dev_priv->saveDPLL_B & DPLL_VCO_ENABLE) {
453 I915_WRITE(DPLL_B, dev_priv->saveDPLL_B &
454 ~DPLL_VCO_ENABLE);
455 DRM_UDELAY(150);
456 }
457 I915_WRITE(FPB0, dev_priv->saveFPB0);
458 I915_WRITE(FPB1, dev_priv->saveFPB1);
459 /* Actually enable it */
460 I915_WRITE(DPLL_B, dev_priv->saveDPLL_B);
461 DRM_UDELAY(150);
462 if (IS_I965G(dev))
463 I915_WRITE(DPLL_B_MD, dev_priv->saveDPLL_B_MD);
464 DRM_UDELAY(150);
465
466 /* Restore mode */
467 I915_WRITE(HTOTAL_B, dev_priv->saveHTOTAL_B);
468 I915_WRITE(HBLANK_B, dev_priv->saveHBLANK_B);
469 I915_WRITE(HSYNC_B, dev_priv->saveHSYNC_B);
470 I915_WRITE(VTOTAL_B, dev_priv->saveVTOTAL_B);
471 I915_WRITE(VBLANK_B, dev_priv->saveVBLANK_B);
472 I915_WRITE(VSYNC_B, dev_priv->saveVSYNC_B);
473 I915_WRITE(BCLRPAT_B, dev_priv->saveBCLRPAT_B);
474
475 /* Restore plane info */
476 I915_WRITE(DSPBSIZE, dev_priv->saveDSPBSIZE);
477 I915_WRITE(DSPBPOS, dev_priv->saveDSPBPOS);
478 I915_WRITE(PIPEBSRC, dev_priv->savePIPEBSRC);
479 I915_WRITE(DSPBADDR, dev_priv->saveDSPBADDR);
480 I915_WRITE(DSPBSTRIDE, dev_priv->saveDSPBSTRIDE);
481 if (IS_I965G(dev)) {
482 I915_WRITE(DSPBSURF, dev_priv->saveDSPBSURF);
483 I915_WRITE(DSPBTILEOFF, dev_priv->saveDSPBTILEOFF);
484 }
485
486 I915_WRITE(PIPEBCONF, dev_priv->savePIPEBCONF);
487
488 i915_restore_palette(dev, PIPE_B);
489 /* Enable the plane */
490 I915_WRITE(DSPBCNTR, dev_priv->saveDSPBCNTR);
491 I915_WRITE(DSPBADDR, I915_READ(DSPBADDR));
492
493 /* Cursor state */ 540 /* Cursor state */
494 I915_WRITE(CURAPOS, dev_priv->saveCURAPOS); 541 I915_WRITE(CURAPOS, dev_priv->saveCURAPOS);
495 I915_WRITE(CURACNTR, dev_priv->saveCURACNTR); 542 I915_WRITE(CURACNTR, dev_priv->saveCURACNTR);
@@ -518,6 +565,12 @@ int i915_restore_state(struct drm_device *dev)
518 I915_WRITE(PP_DIVISOR, dev_priv->savePP_DIVISOR); 565 I915_WRITE(PP_DIVISOR, dev_priv->savePP_DIVISOR);
519 I915_WRITE(PP_CONTROL, dev_priv->savePP_CONTROL); 566 I915_WRITE(PP_CONTROL, dev_priv->savePP_CONTROL);
520 567
568 /* Display Port state */
569 if (SUPPORTS_INTEGRATED_DP(dev)) {
570 I915_WRITE(DP_B, dev_priv->saveDP_B);
571 I915_WRITE(DP_C, dev_priv->saveDP_C);
572 I915_WRITE(DP_D, dev_priv->saveDP_D);
573 }
521 /* FIXME: restore TV & SDVO state */ 574 /* FIXME: restore TV & SDVO state */
522 575
523 /* FBC info */ 576 /* FBC info */
@@ -545,7 +598,7 @@ int i915_restore_state(struct drm_device *dev)
545 598
546 for (i = 0; i < 16; i++) { 599 for (i = 0; i < 16; i++) {
547 I915_WRITE(SWF00 + (i << 2), dev_priv->saveSWF0[i]); 600 I915_WRITE(SWF00 + (i << 2), dev_priv->saveSWF0[i]);
548 I915_WRITE(SWF10 + (i << 2), dev_priv->saveSWF1[i+7]); 601 I915_WRITE(SWF10 + (i << 2), dev_priv->saveSWF1[i]);
549 } 602 }
550 for (i = 0; i < 3; i++) 603 for (i = 0; i < 3; i++)
551 I915_WRITE(SWF30 + (i << 2), dev_priv->saveSWF2[i]); 604 I915_WRITE(SWF30 + (i << 2), dev_priv->saveSWF2[i]);
diff --git a/drivers/gpu/drm/i915/intel_bios.c b/drivers/gpu/drm/i915/intel_bios.c
index cdd126d068a7..300aee3296c2 100644
--- a/drivers/gpu/drm/i915/intel_bios.c
+++ b/drivers/gpu/drm/i915/intel_bios.c
@@ -99,9 +99,11 @@ parse_lfp_panel_data(struct drm_i915_private *dev_priv,
99{ 99{
100 struct bdb_lvds_options *lvds_options; 100 struct bdb_lvds_options *lvds_options;
101 struct bdb_lvds_lfp_data *lvds_lfp_data; 101 struct bdb_lvds_lfp_data *lvds_lfp_data;
102 struct bdb_lvds_lfp_data_ptrs *lvds_lfp_data_ptrs;
102 struct bdb_lvds_lfp_data_entry *entry; 103 struct bdb_lvds_lfp_data_entry *entry;
103 struct lvds_dvo_timing *dvo_timing; 104 struct lvds_dvo_timing *dvo_timing;
104 struct drm_display_mode *panel_fixed_mode; 105 struct drm_display_mode *panel_fixed_mode;
106 int lfp_data_size, dvo_timing_offset;
105 107
106 /* Defaults if we can't find VBT info */ 108 /* Defaults if we can't find VBT info */
107 dev_priv->lvds_dither = 0; 109 dev_priv->lvds_dither = 0;
@@ -119,10 +121,27 @@ parse_lfp_panel_data(struct drm_i915_private *dev_priv,
119 if (!lvds_lfp_data) 121 if (!lvds_lfp_data)
120 return; 122 return;
121 123
124 lvds_lfp_data_ptrs = find_section(bdb, BDB_LVDS_LFP_DATA_PTRS);
125 if (!lvds_lfp_data_ptrs)
126 return;
127
122 dev_priv->lvds_vbt = 1; 128 dev_priv->lvds_vbt = 1;
123 129
124 entry = &lvds_lfp_data->data[lvds_options->panel_type]; 130 lfp_data_size = lvds_lfp_data_ptrs->ptr[1].dvo_timing_offset -
125 dvo_timing = &entry->dvo_timing; 131 lvds_lfp_data_ptrs->ptr[0].dvo_timing_offset;
132 entry = (struct bdb_lvds_lfp_data_entry *)
133 ((uint8_t *)lvds_lfp_data->data + (lfp_data_size *
134 lvds_options->panel_type));
135 dvo_timing_offset = lvds_lfp_data_ptrs->ptr[0].dvo_timing_offset -
136 lvds_lfp_data_ptrs->ptr[0].fp_timing_offset;
137
138 /*
139 * the size of fp_timing varies on the different platform.
140 * So calculate the DVO timing relative offset in LVDS data
141 * entry to get the DVO timing entry
142 */
143 dvo_timing = (struct lvds_dvo_timing *)
144 ((unsigned char *)entry + dvo_timing_offset);
126 145
127 panel_fixed_mode = kzalloc(sizeof(*panel_fixed_mode), GFP_KERNEL); 146 panel_fixed_mode = kzalloc(sizeof(*panel_fixed_mode), GFP_KERNEL);
128 147
@@ -185,10 +204,12 @@ parse_general_features(struct drm_i915_private *dev_priv,
185 dev_priv->lvds_use_ssc = general->enable_ssc; 204 dev_priv->lvds_use_ssc = general->enable_ssc;
186 205
187 if (dev_priv->lvds_use_ssc) { 206 if (dev_priv->lvds_use_ssc) {
188 if (IS_I855(dev_priv->dev)) 207 if (IS_I85X(dev_priv->dev))
189 dev_priv->lvds_ssc_freq = general->ssc_freq ? 66 : 48; 208 dev_priv->lvds_ssc_freq =
190 else 209 general->ssc_freq ? 66 : 48;
191 dev_priv->lvds_ssc_freq = general->ssc_freq ? 100 : 96; 210 else
211 dev_priv->lvds_ssc_freq =
212 general->ssc_freq ? 100 : 96;
192 } 213 }
193 } 214 }
194} 215}
@@ -275,6 +296,25 @@ parse_sdvo_device_mapping(struct drm_i915_private *dev_priv,
275 } 296 }
276 return; 297 return;
277} 298}
299
300static void
301parse_driver_features(struct drm_i915_private *dev_priv,
302 struct bdb_header *bdb)
303{
304 struct drm_device *dev = dev_priv->dev;
305 struct bdb_driver_features *driver;
306
307 /* set default for chips without eDP */
308 if (!SUPPORTS_EDP(dev)) {
309 dev_priv->edp_support = 0;
310 return;
311 }
312
313 driver = find_section(bdb, BDB_DRIVER_FEATURES);
314 if (driver && driver->lvds_config == BDB_DRIVER_FEATURE_EDP)
315 dev_priv->edp_support = 1;
316}
317
278/** 318/**
279 * intel_init_bios - initialize VBIOS settings & find VBT 319 * intel_init_bios - initialize VBIOS settings & find VBT
280 * @dev: DRM device 320 * @dev: DRM device
@@ -325,6 +365,8 @@ intel_init_bios(struct drm_device *dev)
325 parse_lfp_panel_data(dev_priv, bdb); 365 parse_lfp_panel_data(dev_priv, bdb);
326 parse_sdvo_panel_data(dev_priv, bdb); 366 parse_sdvo_panel_data(dev_priv, bdb);
327 parse_sdvo_device_mapping(dev_priv, bdb); 367 parse_sdvo_device_mapping(dev_priv, bdb);
368 parse_driver_features(dev_priv, bdb);
369
328 pci_unmap_rom(pdev, bios); 370 pci_unmap_rom(pdev, bios);
329 371
330 return 0; 372 return 0;
diff --git a/drivers/gpu/drm/i915/intel_bios.h b/drivers/gpu/drm/i915/intel_bios.h
index fe72e1c225d8..0f8e5f69ac7a 100644
--- a/drivers/gpu/drm/i915/intel_bios.h
+++ b/drivers/gpu/drm/i915/intel_bios.h
@@ -381,6 +381,51 @@ struct bdb_sdvo_lvds_options {
381} __attribute__((packed)); 381} __attribute__((packed));
382 382
383 383
384#define BDB_DRIVER_FEATURE_NO_LVDS 0
385#define BDB_DRIVER_FEATURE_INT_LVDS 1
386#define BDB_DRIVER_FEATURE_SDVO_LVDS 2
387#define BDB_DRIVER_FEATURE_EDP 3
388
389struct bdb_driver_features {
390 u8 boot_dev_algorithm:1;
391 u8 block_display_switch:1;
392 u8 allow_display_switch:1;
393 u8 hotplug_dvo:1;
394 u8 dual_view_zoom:1;
395 u8 int15h_hook:1;
396 u8 sprite_in_clone:1;
397 u8 primary_lfp_id:1;
398
399 u16 boot_mode_x;
400 u16 boot_mode_y;
401 u8 boot_mode_bpp;
402 u8 boot_mode_refresh;
403
404 u16 enable_lfp_primary:1;
405 u16 selective_mode_pruning:1;
406 u16 dual_frequency:1;
407 u16 render_clock_freq:1; /* 0: high freq; 1: low freq */
408 u16 nt_clone_support:1;
409 u16 power_scheme_ui:1; /* 0: CUI; 1: 3rd party */
410 u16 sprite_display_assign:1; /* 0: secondary; 1: primary */
411 u16 cui_aspect_scaling:1;
412 u16 preserve_aspect_ratio:1;
413 u16 sdvo_device_power_down:1;
414 u16 crt_hotplug:1;
415 u16 lvds_config:2;
416 u16 tv_hotplug:1;
417 u16 hdmi_config:2;
418
419 u8 static_display:1;
420 u8 reserved2:7;
421 u16 legacy_crt_max_x;
422 u16 legacy_crt_max_y;
423 u8 legacy_crt_max_refresh;
424
425 u8 hdmi_termination;
426 u8 custom_vbt_version;
427} __attribute__((packed));
428
384bool intel_init_bios(struct drm_device *dev); 429bool intel_init_bios(struct drm_device *dev);
385 430
386/* 431/*
diff --git a/drivers/gpu/drm/i915/intel_crt.c b/drivers/gpu/drm/i915/intel_crt.c
index 6de97fc66029..4cf8e2e88a40 100644
--- a/drivers/gpu/drm/i915/intel_crt.c
+++ b/drivers/gpu/drm/i915/intel_crt.c
@@ -46,7 +46,7 @@ static void intel_crt_dpms(struct drm_encoder *encoder, int mode)
46 46
47 temp = I915_READ(reg); 47 temp = I915_READ(reg);
48 temp &= ~(ADPA_HSYNC_CNTL_DISABLE | ADPA_VSYNC_CNTL_DISABLE); 48 temp &= ~(ADPA_HSYNC_CNTL_DISABLE | ADPA_VSYNC_CNTL_DISABLE);
49 temp |= ADPA_DAC_ENABLE; 49 temp &= ~ADPA_DAC_ENABLE;
50 50
51 switch(mode) { 51 switch(mode) {
52 case DRM_MODE_DPMS_ON: 52 case DRM_MODE_DPMS_ON:
@@ -156,6 +156,9 @@ static bool intel_igdng_crt_detect_hotplug(struct drm_connector *connector)
156 156
157 temp = adpa = I915_READ(PCH_ADPA); 157 temp = adpa = I915_READ(PCH_ADPA);
158 158
159 adpa &= ~ADPA_DAC_ENABLE;
160 I915_WRITE(PCH_ADPA, adpa);
161
159 adpa &= ~ADPA_CRT_HOTPLUG_MASK; 162 adpa &= ~ADPA_CRT_HOTPLUG_MASK;
160 163
161 adpa |= (ADPA_CRT_HOTPLUG_PERIOD_128 | 164 adpa |= (ADPA_CRT_HOTPLUG_PERIOD_128 |
@@ -169,13 +172,14 @@ static bool intel_igdng_crt_detect_hotplug(struct drm_connector *connector)
169 DRM_DEBUG("pch crt adpa 0x%x", adpa); 172 DRM_DEBUG("pch crt adpa 0x%x", adpa);
170 I915_WRITE(PCH_ADPA, adpa); 173 I915_WRITE(PCH_ADPA, adpa);
171 174
172 /* This might not be needed as not specified in spec...*/ 175 while ((I915_READ(PCH_ADPA) & ADPA_CRT_HOTPLUG_FORCE_TRIGGER) != 0)
173 udelay(1000); 176 ;
174 177
175 /* Check the status to see if both blue and green are on now */ 178 /* Check the status to see if both blue and green are on now */
176 adpa = I915_READ(PCH_ADPA); 179 adpa = I915_READ(PCH_ADPA);
177 if ((adpa & ADPA_CRT_HOTPLUG_MONITOR_MASK) == 180 adpa &= ADPA_CRT_HOTPLUG_MONITOR_MASK;
178 ADPA_CRT_HOTPLUG_MONITOR_COLOR) 181 if ((adpa == ADPA_CRT_HOTPLUG_MONITOR_COLOR) ||
182 (adpa == ADPA_CRT_HOTPLUG_MONITOR_MONO))
179 ret = true; 183 ret = true;
180 else 184 else
181 ret = false; 185 ret = false;
@@ -428,8 +432,34 @@ static void intel_crt_destroy(struct drm_connector *connector)
428 432
429static int intel_crt_get_modes(struct drm_connector *connector) 433static int intel_crt_get_modes(struct drm_connector *connector)
430{ 434{
435 int ret;
431 struct intel_output *intel_output = to_intel_output(connector); 436 struct intel_output *intel_output = to_intel_output(connector);
432 return intel_ddc_get_modes(intel_output); 437 struct i2c_adapter *ddcbus;
438 struct drm_device *dev = connector->dev;
439
440
441 ret = intel_ddc_get_modes(intel_output);
442 if (ret || !IS_G4X(dev))
443 goto end;
444
445 ddcbus = intel_output->ddc_bus;
446 /* Try to probe digital port for output in DVI-I -> VGA mode. */
447 intel_output->ddc_bus =
448 intel_i2c_create(connector->dev, GPIOD, "CRTDDC_D");
449
450 if (!intel_output->ddc_bus) {
451 intel_output->ddc_bus = ddcbus;
452 dev_printk(KERN_ERR, &connector->dev->pdev->dev,
453 "DDC bus registration failed for CRTDDC_D.\n");
454 goto end;
455 }
456 /* Try to get modes by GPIOD port */
457 ret = intel_ddc_get_modes(intel_output);
458 intel_i2c_destroy(ddcbus);
459
460end:
461 return ret;
462
433} 463}
434 464
435static int intel_crt_set_property(struct drm_connector *connector, 465static int intel_crt_set_property(struct drm_connector *connector,
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 3e1c78162119..d6fce2133413 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -25,14 +25,19 @@
25 */ 25 */
26 26
27#include <linux/i2c.h> 27#include <linux/i2c.h>
28#include <linux/kernel.h>
28#include "drmP.h" 29#include "drmP.h"
29#include "intel_drv.h" 30#include "intel_drv.h"
30#include "i915_drm.h" 31#include "i915_drm.h"
31#include "i915_drv.h" 32#include "i915_drv.h"
33#include "intel_dp.h"
32 34
33#include "drm_crtc_helper.h" 35#include "drm_crtc_helper.h"
34 36
37#define HAS_eDP (intel_pipe_has_type(crtc, INTEL_OUTPUT_EDP))
38
35bool intel_pipe_has_type (struct drm_crtc *crtc, int type); 39bool intel_pipe_has_type (struct drm_crtc *crtc, int type);
40static void intel_update_watermarks(struct drm_device *dev);
36 41
37typedef struct { 42typedef struct {
38 /* given values */ 43 /* given values */
@@ -85,7 +90,7 @@ struct intel_limit {
85#define I8XX_P2_SLOW 4 90#define I8XX_P2_SLOW 4
86#define I8XX_P2_FAST 2 91#define I8XX_P2_FAST 2
87#define I8XX_P2_LVDS_SLOW 14 92#define I8XX_P2_LVDS_SLOW 14
88#define I8XX_P2_LVDS_FAST 14 /* No fast option */ 93#define I8XX_P2_LVDS_FAST 7
89#define I8XX_P2_SLOW_LIMIT 165000 94#define I8XX_P2_SLOW_LIMIT 165000
90 95
91#define I9XX_DOT_MIN 20000 96#define I9XX_DOT_MIN 20000
@@ -127,19 +132,6 @@ struct intel_limit {
127#define I9XX_P2_LVDS_FAST 7 132#define I9XX_P2_LVDS_FAST 7
128#define I9XX_P2_LVDS_SLOW_LIMIT 112000 133#define I9XX_P2_LVDS_SLOW_LIMIT 112000
129 134
130#define INTEL_LIMIT_I8XX_DVO_DAC 0
131#define INTEL_LIMIT_I8XX_LVDS 1
132#define INTEL_LIMIT_I9XX_SDVO_DAC 2
133#define INTEL_LIMIT_I9XX_LVDS 3
134#define INTEL_LIMIT_G4X_SDVO 4
135#define INTEL_LIMIT_G4X_HDMI_DAC 5
136#define INTEL_LIMIT_G4X_SINGLE_CHANNEL_LVDS 6
137#define INTEL_LIMIT_G4X_DUAL_CHANNEL_LVDS 7
138#define INTEL_LIMIT_IGD_SDVO_DAC 8
139#define INTEL_LIMIT_IGD_LVDS 9
140#define INTEL_LIMIT_IGDNG_SDVO_DAC 10
141#define INTEL_LIMIT_IGDNG_LVDS 11
142
143/*The parameter is for SDVO on G4x platform*/ 135/*The parameter is for SDVO on G4x platform*/
144#define G4X_DOT_SDVO_MIN 25000 136#define G4X_DOT_SDVO_MIN 25000
145#define G4X_DOT_SDVO_MAX 270000 137#define G4X_DOT_SDVO_MAX 270000
@@ -218,6 +210,25 @@ struct intel_limit {
218#define G4X_P2_DUAL_CHANNEL_LVDS_FAST 7 210#define G4X_P2_DUAL_CHANNEL_LVDS_FAST 7
219#define G4X_P2_DUAL_CHANNEL_LVDS_LIMIT 0 211#define G4X_P2_DUAL_CHANNEL_LVDS_LIMIT 0
220 212
213/*The parameter is for DISPLAY PORT on G4x platform*/
214#define G4X_DOT_DISPLAY_PORT_MIN 161670
215#define G4X_DOT_DISPLAY_PORT_MAX 227000
216#define G4X_N_DISPLAY_PORT_MIN 1
217#define G4X_N_DISPLAY_PORT_MAX 2
218#define G4X_M_DISPLAY_PORT_MIN 97
219#define G4X_M_DISPLAY_PORT_MAX 108
220#define G4X_M1_DISPLAY_PORT_MIN 0x10
221#define G4X_M1_DISPLAY_PORT_MAX 0x12
222#define G4X_M2_DISPLAY_PORT_MIN 0x05
223#define G4X_M2_DISPLAY_PORT_MAX 0x06
224#define G4X_P_DISPLAY_PORT_MIN 10
225#define G4X_P_DISPLAY_PORT_MAX 20
226#define G4X_P1_DISPLAY_PORT_MIN 1
227#define G4X_P1_DISPLAY_PORT_MAX 2
228#define G4X_P2_DISPLAY_PORT_SLOW 10
229#define G4X_P2_DISPLAY_PORT_FAST 10
230#define G4X_P2_DISPLAY_PORT_LIMIT 0
231
221/* IGDNG */ 232/* IGDNG */
222/* as we calculate clock using (register_value + 2) for 233/* as we calculate clock using (register_value + 2) for
223 N/M1/M2, so here the range value for them is (actual_value-2). 234 N/M1/M2, so here the range value for them is (actual_value-2).
@@ -256,8 +267,14 @@ static bool
256intel_igdng_find_best_PLL(const intel_limit_t *limit, struct drm_crtc *crtc, 267intel_igdng_find_best_PLL(const intel_limit_t *limit, struct drm_crtc *crtc,
257 int target, int refclk, intel_clock_t *best_clock); 268 int target, int refclk, intel_clock_t *best_clock);
258 269
259static const intel_limit_t intel_limits[] = { 270static bool
260 { /* INTEL_LIMIT_I8XX_DVO_DAC */ 271intel_find_pll_g4x_dp(const intel_limit_t *, struct drm_crtc *crtc,
272 int target, int refclk, intel_clock_t *best_clock);
273static bool
274intel_find_pll_igdng_dp(const intel_limit_t *, struct drm_crtc *crtc,
275 int target, int refclk, intel_clock_t *best_clock);
276
277static const intel_limit_t intel_limits_i8xx_dvo = {
261 .dot = { .min = I8XX_DOT_MIN, .max = I8XX_DOT_MAX }, 278 .dot = { .min = I8XX_DOT_MIN, .max = I8XX_DOT_MAX },
262 .vco = { .min = I8XX_VCO_MIN, .max = I8XX_VCO_MAX }, 279 .vco = { .min = I8XX_VCO_MIN, .max = I8XX_VCO_MAX },
263 .n = { .min = I8XX_N_MIN, .max = I8XX_N_MAX }, 280 .n = { .min = I8XX_N_MIN, .max = I8XX_N_MAX },
@@ -269,8 +286,9 @@ static const intel_limit_t intel_limits[] = {
269 .p2 = { .dot_limit = I8XX_P2_SLOW_LIMIT, 286 .p2 = { .dot_limit = I8XX_P2_SLOW_LIMIT,
270 .p2_slow = I8XX_P2_SLOW, .p2_fast = I8XX_P2_FAST }, 287 .p2_slow = I8XX_P2_SLOW, .p2_fast = I8XX_P2_FAST },
271 .find_pll = intel_find_best_PLL, 288 .find_pll = intel_find_best_PLL,
272 }, 289};
273 { /* INTEL_LIMIT_I8XX_LVDS */ 290
291static const intel_limit_t intel_limits_i8xx_lvds = {
274 .dot = { .min = I8XX_DOT_MIN, .max = I8XX_DOT_MAX }, 292 .dot = { .min = I8XX_DOT_MIN, .max = I8XX_DOT_MAX },
275 .vco = { .min = I8XX_VCO_MIN, .max = I8XX_VCO_MAX }, 293 .vco = { .min = I8XX_VCO_MIN, .max = I8XX_VCO_MAX },
276 .n = { .min = I8XX_N_MIN, .max = I8XX_N_MAX }, 294 .n = { .min = I8XX_N_MIN, .max = I8XX_N_MAX },
@@ -282,8 +300,9 @@ static const intel_limit_t intel_limits[] = {
282 .p2 = { .dot_limit = I8XX_P2_SLOW_LIMIT, 300 .p2 = { .dot_limit = I8XX_P2_SLOW_LIMIT,
283 .p2_slow = I8XX_P2_LVDS_SLOW, .p2_fast = I8XX_P2_LVDS_FAST }, 301 .p2_slow = I8XX_P2_LVDS_SLOW, .p2_fast = I8XX_P2_LVDS_FAST },
284 .find_pll = intel_find_best_PLL, 302 .find_pll = intel_find_best_PLL,
285 }, 303};
286 { /* INTEL_LIMIT_I9XX_SDVO_DAC */ 304
305static const intel_limit_t intel_limits_i9xx_sdvo = {
287 .dot = { .min = I9XX_DOT_MIN, .max = I9XX_DOT_MAX }, 306 .dot = { .min = I9XX_DOT_MIN, .max = I9XX_DOT_MAX },
288 .vco = { .min = I9XX_VCO_MIN, .max = I9XX_VCO_MAX }, 307 .vco = { .min = I9XX_VCO_MIN, .max = I9XX_VCO_MAX },
289 .n = { .min = I9XX_N_MIN, .max = I9XX_N_MAX }, 308 .n = { .min = I9XX_N_MIN, .max = I9XX_N_MAX },
@@ -295,8 +314,9 @@ static const intel_limit_t intel_limits[] = {
295 .p2 = { .dot_limit = I9XX_P2_SDVO_DAC_SLOW_LIMIT, 314 .p2 = { .dot_limit = I9XX_P2_SDVO_DAC_SLOW_LIMIT,
296 .p2_slow = I9XX_P2_SDVO_DAC_SLOW, .p2_fast = I9XX_P2_SDVO_DAC_FAST }, 315 .p2_slow = I9XX_P2_SDVO_DAC_SLOW, .p2_fast = I9XX_P2_SDVO_DAC_FAST },
297 .find_pll = intel_find_best_PLL, 316 .find_pll = intel_find_best_PLL,
298 }, 317};
299 { /* INTEL_LIMIT_I9XX_LVDS */ 318
319static const intel_limit_t intel_limits_i9xx_lvds = {
300 .dot = { .min = I9XX_DOT_MIN, .max = I9XX_DOT_MAX }, 320 .dot = { .min = I9XX_DOT_MIN, .max = I9XX_DOT_MAX },
301 .vco = { .min = I9XX_VCO_MIN, .max = I9XX_VCO_MAX }, 321 .vco = { .min = I9XX_VCO_MIN, .max = I9XX_VCO_MAX },
302 .n = { .min = I9XX_N_MIN, .max = I9XX_N_MAX }, 322 .n = { .min = I9XX_N_MIN, .max = I9XX_N_MAX },
@@ -311,9 +331,10 @@ static const intel_limit_t intel_limits[] = {
311 .p2 = { .dot_limit = I9XX_P2_LVDS_SLOW_LIMIT, 331 .p2 = { .dot_limit = I9XX_P2_LVDS_SLOW_LIMIT,
312 .p2_slow = I9XX_P2_LVDS_SLOW, .p2_fast = I9XX_P2_LVDS_FAST }, 332 .p2_slow = I9XX_P2_LVDS_SLOW, .p2_fast = I9XX_P2_LVDS_FAST },
313 .find_pll = intel_find_best_PLL, 333 .find_pll = intel_find_best_PLL,
314 }, 334};
335
315 /* below parameter and function is for G4X Chipset Family*/ 336 /* below parameter and function is for G4X Chipset Family*/
316 { /* INTEL_LIMIT_G4X_SDVO */ 337static const intel_limit_t intel_limits_g4x_sdvo = {
317 .dot = { .min = G4X_DOT_SDVO_MIN, .max = G4X_DOT_SDVO_MAX }, 338 .dot = { .min = G4X_DOT_SDVO_MIN, .max = G4X_DOT_SDVO_MAX },
318 .vco = { .min = G4X_VCO_MIN, .max = G4X_VCO_MAX}, 339 .vco = { .min = G4X_VCO_MIN, .max = G4X_VCO_MAX},
319 .n = { .min = G4X_N_SDVO_MIN, .max = G4X_N_SDVO_MAX }, 340 .n = { .min = G4X_N_SDVO_MIN, .max = G4X_N_SDVO_MAX },
@@ -327,8 +348,9 @@ static const intel_limit_t intel_limits[] = {
327 .p2_fast = G4X_P2_SDVO_FAST 348 .p2_fast = G4X_P2_SDVO_FAST
328 }, 349 },
329 .find_pll = intel_g4x_find_best_PLL, 350 .find_pll = intel_g4x_find_best_PLL,
330 }, 351};
331 { /* INTEL_LIMIT_G4X_HDMI_DAC */ 352
353static const intel_limit_t intel_limits_g4x_hdmi = {
332 .dot = { .min = G4X_DOT_HDMI_DAC_MIN, .max = G4X_DOT_HDMI_DAC_MAX }, 354 .dot = { .min = G4X_DOT_HDMI_DAC_MIN, .max = G4X_DOT_HDMI_DAC_MAX },
333 .vco = { .min = G4X_VCO_MIN, .max = G4X_VCO_MAX}, 355 .vco = { .min = G4X_VCO_MIN, .max = G4X_VCO_MAX},
334 .n = { .min = G4X_N_HDMI_DAC_MIN, .max = G4X_N_HDMI_DAC_MAX }, 356 .n = { .min = G4X_N_HDMI_DAC_MIN, .max = G4X_N_HDMI_DAC_MAX },
@@ -342,8 +364,9 @@ static const intel_limit_t intel_limits[] = {
342 .p2_fast = G4X_P2_HDMI_DAC_FAST 364 .p2_fast = G4X_P2_HDMI_DAC_FAST
343 }, 365 },
344 .find_pll = intel_g4x_find_best_PLL, 366 .find_pll = intel_g4x_find_best_PLL,
345 }, 367};
346 { /* INTEL_LIMIT_G4X_SINGLE_CHANNEL_LVDS */ 368
369static const intel_limit_t intel_limits_g4x_single_channel_lvds = {
347 .dot = { .min = G4X_DOT_SINGLE_CHANNEL_LVDS_MIN, 370 .dot = { .min = G4X_DOT_SINGLE_CHANNEL_LVDS_MIN,
348 .max = G4X_DOT_SINGLE_CHANNEL_LVDS_MAX }, 371 .max = G4X_DOT_SINGLE_CHANNEL_LVDS_MAX },
349 .vco = { .min = G4X_VCO_MIN, 372 .vco = { .min = G4X_VCO_MIN,
@@ -365,8 +388,9 @@ static const intel_limit_t intel_limits[] = {
365 .p2_fast = G4X_P2_SINGLE_CHANNEL_LVDS_FAST 388 .p2_fast = G4X_P2_SINGLE_CHANNEL_LVDS_FAST
366 }, 389 },
367 .find_pll = intel_g4x_find_best_PLL, 390 .find_pll = intel_g4x_find_best_PLL,
368 }, 391};
369 { /* INTEL_LIMIT_G4X_DUAL_CHANNEL_LVDS */ 392
393static const intel_limit_t intel_limits_g4x_dual_channel_lvds = {
370 .dot = { .min = G4X_DOT_DUAL_CHANNEL_LVDS_MIN, 394 .dot = { .min = G4X_DOT_DUAL_CHANNEL_LVDS_MIN,
371 .max = G4X_DOT_DUAL_CHANNEL_LVDS_MAX }, 395 .max = G4X_DOT_DUAL_CHANNEL_LVDS_MAX },
372 .vco = { .min = G4X_VCO_MIN, 396 .vco = { .min = G4X_VCO_MIN,
@@ -388,8 +412,32 @@ static const intel_limit_t intel_limits[] = {
388 .p2_fast = G4X_P2_DUAL_CHANNEL_LVDS_FAST 412 .p2_fast = G4X_P2_DUAL_CHANNEL_LVDS_FAST
389 }, 413 },
390 .find_pll = intel_g4x_find_best_PLL, 414 .find_pll = intel_g4x_find_best_PLL,
391 }, 415};
392 { /* INTEL_LIMIT_IGD_SDVO */ 416
417static const intel_limit_t intel_limits_g4x_display_port = {
418 .dot = { .min = G4X_DOT_DISPLAY_PORT_MIN,
419 .max = G4X_DOT_DISPLAY_PORT_MAX },
420 .vco = { .min = G4X_VCO_MIN,
421 .max = G4X_VCO_MAX},
422 .n = { .min = G4X_N_DISPLAY_PORT_MIN,
423 .max = G4X_N_DISPLAY_PORT_MAX },
424 .m = { .min = G4X_M_DISPLAY_PORT_MIN,
425 .max = G4X_M_DISPLAY_PORT_MAX },
426 .m1 = { .min = G4X_M1_DISPLAY_PORT_MIN,
427 .max = G4X_M1_DISPLAY_PORT_MAX },
428 .m2 = { .min = G4X_M2_DISPLAY_PORT_MIN,
429 .max = G4X_M2_DISPLAY_PORT_MAX },
430 .p = { .min = G4X_P_DISPLAY_PORT_MIN,
431 .max = G4X_P_DISPLAY_PORT_MAX },
432 .p1 = { .min = G4X_P1_DISPLAY_PORT_MIN,
433 .max = G4X_P1_DISPLAY_PORT_MAX},
434 .p2 = { .dot_limit = G4X_P2_DISPLAY_PORT_LIMIT,
435 .p2_slow = G4X_P2_DISPLAY_PORT_SLOW,
436 .p2_fast = G4X_P2_DISPLAY_PORT_FAST },
437 .find_pll = intel_find_pll_g4x_dp,
438};
439
440static const intel_limit_t intel_limits_igd_sdvo = {
393 .dot = { .min = I9XX_DOT_MIN, .max = I9XX_DOT_MAX}, 441 .dot = { .min = I9XX_DOT_MIN, .max = I9XX_DOT_MAX},
394 .vco = { .min = IGD_VCO_MIN, .max = IGD_VCO_MAX }, 442 .vco = { .min = IGD_VCO_MIN, .max = IGD_VCO_MAX },
395 .n = { .min = IGD_N_MIN, .max = IGD_N_MAX }, 443 .n = { .min = IGD_N_MIN, .max = IGD_N_MAX },
@@ -401,8 +449,9 @@ static const intel_limit_t intel_limits[] = {
401 .p2 = { .dot_limit = I9XX_P2_SDVO_DAC_SLOW_LIMIT, 449 .p2 = { .dot_limit = I9XX_P2_SDVO_DAC_SLOW_LIMIT,
402 .p2_slow = I9XX_P2_SDVO_DAC_SLOW, .p2_fast = I9XX_P2_SDVO_DAC_FAST }, 450 .p2_slow = I9XX_P2_SDVO_DAC_SLOW, .p2_fast = I9XX_P2_SDVO_DAC_FAST },
403 .find_pll = intel_find_best_PLL, 451 .find_pll = intel_find_best_PLL,
404 }, 452};
405 { /* INTEL_LIMIT_IGD_LVDS */ 453
454static const intel_limit_t intel_limits_igd_lvds = {
406 .dot = { .min = I9XX_DOT_MIN, .max = I9XX_DOT_MAX }, 455 .dot = { .min = I9XX_DOT_MIN, .max = I9XX_DOT_MAX },
407 .vco = { .min = IGD_VCO_MIN, .max = IGD_VCO_MAX }, 456 .vco = { .min = IGD_VCO_MIN, .max = IGD_VCO_MAX },
408 .n = { .min = IGD_N_MIN, .max = IGD_N_MAX }, 457 .n = { .min = IGD_N_MIN, .max = IGD_N_MAX },
@@ -415,8 +464,9 @@ static const intel_limit_t intel_limits[] = {
415 .p2 = { .dot_limit = I9XX_P2_LVDS_SLOW_LIMIT, 464 .p2 = { .dot_limit = I9XX_P2_LVDS_SLOW_LIMIT,
416 .p2_slow = I9XX_P2_LVDS_SLOW, .p2_fast = I9XX_P2_LVDS_SLOW }, 465 .p2_slow = I9XX_P2_LVDS_SLOW, .p2_fast = I9XX_P2_LVDS_SLOW },
417 .find_pll = intel_find_best_PLL, 466 .find_pll = intel_find_best_PLL,
418 }, 467};
419 { /* INTEL_LIMIT_IGDNG_SDVO_DAC */ 468
469static const intel_limit_t intel_limits_igdng_sdvo = {
420 .dot = { .min = IGDNG_DOT_MIN, .max = IGDNG_DOT_MAX }, 470 .dot = { .min = IGDNG_DOT_MIN, .max = IGDNG_DOT_MAX },
421 .vco = { .min = IGDNG_VCO_MIN, .max = IGDNG_VCO_MAX }, 471 .vco = { .min = IGDNG_VCO_MIN, .max = IGDNG_VCO_MAX },
422 .n = { .min = IGDNG_N_MIN, .max = IGDNG_N_MAX }, 472 .n = { .min = IGDNG_N_MIN, .max = IGDNG_N_MAX },
@@ -429,8 +479,9 @@ static const intel_limit_t intel_limits[] = {
429 .p2_slow = IGDNG_P2_SDVO_DAC_SLOW, 479 .p2_slow = IGDNG_P2_SDVO_DAC_SLOW,
430 .p2_fast = IGDNG_P2_SDVO_DAC_FAST }, 480 .p2_fast = IGDNG_P2_SDVO_DAC_FAST },
431 .find_pll = intel_igdng_find_best_PLL, 481 .find_pll = intel_igdng_find_best_PLL,
432 }, 482};
433 { /* INTEL_LIMIT_IGDNG_LVDS */ 483
484static const intel_limit_t intel_limits_igdng_lvds = {
434 .dot = { .min = IGDNG_DOT_MIN, .max = IGDNG_DOT_MAX }, 485 .dot = { .min = IGDNG_DOT_MIN, .max = IGDNG_DOT_MAX },
435 .vco = { .min = IGDNG_VCO_MIN, .max = IGDNG_VCO_MAX }, 486 .vco = { .min = IGDNG_VCO_MIN, .max = IGDNG_VCO_MAX },
436 .n = { .min = IGDNG_N_MIN, .max = IGDNG_N_MAX }, 487 .n = { .min = IGDNG_N_MIN, .max = IGDNG_N_MAX },
@@ -443,16 +494,15 @@ static const intel_limit_t intel_limits[] = {
443 .p2_slow = IGDNG_P2_LVDS_SLOW, 494 .p2_slow = IGDNG_P2_LVDS_SLOW,
444 .p2_fast = IGDNG_P2_LVDS_FAST }, 495 .p2_fast = IGDNG_P2_LVDS_FAST },
445 .find_pll = intel_igdng_find_best_PLL, 496 .find_pll = intel_igdng_find_best_PLL,
446 },
447}; 497};
448 498
449static const intel_limit_t *intel_igdng_limit(struct drm_crtc *crtc) 499static const intel_limit_t *intel_igdng_limit(struct drm_crtc *crtc)
450{ 500{
451 const intel_limit_t *limit; 501 const intel_limit_t *limit;
452 if (intel_pipe_has_type(crtc, INTEL_OUTPUT_LVDS)) 502 if (intel_pipe_has_type(crtc, INTEL_OUTPUT_LVDS))
453 limit = &intel_limits[INTEL_LIMIT_IGDNG_LVDS]; 503 limit = &intel_limits_igdng_lvds;
454 else 504 else
455 limit = &intel_limits[INTEL_LIMIT_IGDNG_SDVO_DAC]; 505 limit = &intel_limits_igdng_sdvo;
456 506
457 return limit; 507 return limit;
458} 508}
@@ -467,19 +517,19 @@ static const intel_limit_t *intel_g4x_limit(struct drm_crtc *crtc)
467 if ((I915_READ(LVDS) & LVDS_CLKB_POWER_MASK) == 517 if ((I915_READ(LVDS) & LVDS_CLKB_POWER_MASK) ==
468 LVDS_CLKB_POWER_UP) 518 LVDS_CLKB_POWER_UP)
469 /* LVDS with dual channel */ 519 /* LVDS with dual channel */
470 limit = &intel_limits 520 limit = &intel_limits_g4x_dual_channel_lvds;
471 [INTEL_LIMIT_G4X_DUAL_CHANNEL_LVDS];
472 else 521 else
473 /* LVDS with dual channel */ 522 /* LVDS with dual channel */
474 limit = &intel_limits 523 limit = &intel_limits_g4x_single_channel_lvds;
475 [INTEL_LIMIT_G4X_SINGLE_CHANNEL_LVDS];
476 } else if (intel_pipe_has_type(crtc, INTEL_OUTPUT_HDMI) || 524 } else if (intel_pipe_has_type(crtc, INTEL_OUTPUT_HDMI) ||
477 intel_pipe_has_type(crtc, INTEL_OUTPUT_ANALOG)) { 525 intel_pipe_has_type(crtc, INTEL_OUTPUT_ANALOG)) {
478 limit = &intel_limits[INTEL_LIMIT_G4X_HDMI_DAC]; 526 limit = &intel_limits_g4x_hdmi;
479 } else if (intel_pipe_has_type(crtc, INTEL_OUTPUT_SDVO)) { 527 } else if (intel_pipe_has_type(crtc, INTEL_OUTPUT_SDVO)) {
480 limit = &intel_limits[INTEL_LIMIT_G4X_SDVO]; 528 limit = &intel_limits_g4x_sdvo;
529 } else if (intel_pipe_has_type (crtc, INTEL_OUTPUT_DISPLAYPORT)) {
530 limit = &intel_limits_g4x_display_port;
481 } else /* The option is for other outputs */ 531 } else /* The option is for other outputs */
482 limit = &intel_limits[INTEL_LIMIT_I9XX_SDVO_DAC]; 532 limit = &intel_limits_i9xx_sdvo;
483 533
484 return limit; 534 return limit;
485} 535}
@@ -495,19 +545,19 @@ static const intel_limit_t *intel_limit(struct drm_crtc *crtc)
495 limit = intel_g4x_limit(crtc); 545 limit = intel_g4x_limit(crtc);
496 } else if (IS_I9XX(dev) && !IS_IGD(dev)) { 546 } else if (IS_I9XX(dev) && !IS_IGD(dev)) {
497 if (intel_pipe_has_type(crtc, INTEL_OUTPUT_LVDS)) 547 if (intel_pipe_has_type(crtc, INTEL_OUTPUT_LVDS))
498 limit = &intel_limits[INTEL_LIMIT_I9XX_LVDS]; 548 limit = &intel_limits_i9xx_lvds;
499 else 549 else
500 limit = &intel_limits[INTEL_LIMIT_I9XX_SDVO_DAC]; 550 limit = &intel_limits_i9xx_sdvo;
501 } else if (IS_IGD(dev)) { 551 } else if (IS_IGD(dev)) {
502 if (intel_pipe_has_type(crtc, INTEL_OUTPUT_LVDS)) 552 if (intel_pipe_has_type(crtc, INTEL_OUTPUT_LVDS))
503 limit = &intel_limits[INTEL_LIMIT_IGD_LVDS]; 553 limit = &intel_limits_igd_lvds;
504 else 554 else
505 limit = &intel_limits[INTEL_LIMIT_IGD_SDVO_DAC]; 555 limit = &intel_limits_igd_sdvo;
506 } else { 556 } else {
507 if (intel_pipe_has_type(crtc, INTEL_OUTPUT_LVDS)) 557 if (intel_pipe_has_type(crtc, INTEL_OUTPUT_LVDS))
508 limit = &intel_limits[INTEL_LIMIT_I8XX_LVDS]; 558 limit = &intel_limits_i8xx_lvds;
509 else 559 else
510 limit = &intel_limits[INTEL_LIMIT_I8XX_DVO_DAC]; 560 limit = &intel_limits_i8xx_dvo;
511 } 561 }
512 return limit; 562 return limit;
513} 563}
@@ -553,6 +603,23 @@ bool intel_pipe_has_type (struct drm_crtc *crtc, int type)
553 return false; 603 return false;
554} 604}
555 605
606struct drm_connector *
607intel_pipe_get_output (struct drm_crtc *crtc)
608{
609 struct drm_device *dev = crtc->dev;
610 struct drm_mode_config *mode_config = &dev->mode_config;
611 struct drm_connector *l_entry, *ret = NULL;
612
613 list_for_each_entry(l_entry, &mode_config->connector_list, head) {
614 if (l_entry->encoder &&
615 l_entry->encoder->crtc == crtc) {
616 ret = l_entry;
617 break;
618 }
619 }
620 return ret;
621}
622
556#define INTELPllInvalid(s) do { /* DRM_DEBUG(s); */ return false; } while (0) 623#define INTELPllInvalid(s) do { /* DRM_DEBUG(s); */ return false; } while (0)
557/** 624/**
558 * Returns whether the given set of divisors are valid for a given refclk with 625 * Returns whether the given set of divisors are valid for a given refclk with
@@ -600,7 +667,7 @@ intel_find_best_PLL(const intel_limit_t *limit, struct drm_crtc *crtc,
600 int err = target; 667 int err = target;
601 668
602 if (IS_I9XX(dev) && intel_pipe_has_type(crtc, INTEL_OUTPUT_LVDS) && 669 if (IS_I9XX(dev) && intel_pipe_has_type(crtc, INTEL_OUTPUT_LVDS) &&
603 (I915_READ(LVDS) & LVDS_PORT_EN) != 0) { 670 (I915_READ(LVDS)) != 0) {
604 /* 671 /*
605 * For LVDS, if the panel is on, just rely on its current 672 * For LVDS, if the panel is on, just rely on its current
606 * settings for dual-channel. We haven't figured out how to 673 * settings for dual-channel. We haven't figured out how to
@@ -707,6 +774,30 @@ intel_g4x_find_best_PLL(const intel_limit_t *limit, struct drm_crtc *crtc,
707} 774}
708 775
709static bool 776static bool
777intel_find_pll_igdng_dp(const intel_limit_t *limit, struct drm_crtc *crtc,
778 int target, int refclk, intel_clock_t *best_clock)
779{
780 struct drm_device *dev = crtc->dev;
781 intel_clock_t clock;
782 if (target < 200000) {
783 clock.n = 1;
784 clock.p1 = 2;
785 clock.p2 = 10;
786 clock.m1 = 12;
787 clock.m2 = 9;
788 } else {
789 clock.n = 2;
790 clock.p1 = 1;
791 clock.p2 = 10;
792 clock.m1 = 14;
793 clock.m2 = 8;
794 }
795 intel_clock(dev, refclk, &clock);
796 memcpy(best_clock, &clock, sizeof(intel_clock_t));
797 return true;
798}
799
800static bool
710intel_igdng_find_best_PLL(const intel_limit_t *limit, struct drm_crtc *crtc, 801intel_igdng_find_best_PLL(const intel_limit_t *limit, struct drm_crtc *crtc,
711 int target, int refclk, intel_clock_t *best_clock) 802 int target, int refclk, intel_clock_t *best_clock)
712{ 803{
@@ -718,6 +809,14 @@ intel_igdng_find_best_PLL(const intel_limit_t *limit, struct drm_crtc *crtc,
718 int err_most = 47; 809 int err_most = 47;
719 found = false; 810 found = false;
720 811
812 /* eDP has only 2 clock choice, no n/m/p setting */
813 if (HAS_eDP)
814 return true;
815
816 if (intel_pipe_has_type(crtc, INTEL_OUTPUT_DISPLAYPORT))
817 return intel_find_pll_igdng_dp(limit, crtc, target,
818 refclk, best_clock);
819
721 if (intel_pipe_has_type(crtc, INTEL_OUTPUT_LVDS)) { 820 if (intel_pipe_has_type(crtc, INTEL_OUTPUT_LVDS)) {
722 if ((I915_READ(LVDS) & LVDS_CLKB_POWER_MASK) == 821 if ((I915_READ(LVDS) & LVDS_CLKB_POWER_MASK) ==
723 LVDS_CLKB_POWER_UP) 822 LVDS_CLKB_POWER_UP)
@@ -764,6 +863,32 @@ out:
764 return found; 863 return found;
765} 864}
766 865
866/* DisplayPort has only two frequencies, 162MHz and 270MHz */
867static bool
868intel_find_pll_g4x_dp(const intel_limit_t *limit, struct drm_crtc *crtc,
869 int target, int refclk, intel_clock_t *best_clock)
870{
871 intel_clock_t clock;
872 if (target < 200000) {
873 clock.p1 = 2;
874 clock.p2 = 10;
875 clock.n = 2;
876 clock.m1 = 23;
877 clock.m2 = 8;
878 } else {
879 clock.p1 = 1;
880 clock.p2 = 10;
881 clock.n = 1;
882 clock.m1 = 14;
883 clock.m2 = 2;
884 }
885 clock.m = 5 * (clock.m1 + 2) + (clock.m2 + 2);
886 clock.p = (clock.p1 * clock.p2);
887 clock.dot = 96000 * clock.m / (clock.n + 2) / clock.p;
888 memcpy(best_clock, &clock, sizeof(intel_clock_t));
889 return true;
890}
891
767void 892void
768intel_wait_for_vblank(struct drm_device *dev) 893intel_wait_for_vblank(struct drm_device *dev)
769{ 894{
@@ -927,13 +1052,97 @@ intel_pipe_set_base(struct drm_crtc *crtc, int x, int y,
927 return 0; 1052 return 0;
928} 1053}
929 1054
1055/* Disable the VGA plane that we never use */
1056static void i915_disable_vga (struct drm_device *dev)
1057{
1058 struct drm_i915_private *dev_priv = dev->dev_private;
1059 u8 sr1;
1060 u32 vga_reg;
1061
1062 if (IS_IGDNG(dev))
1063 vga_reg = CPU_VGACNTRL;
1064 else
1065 vga_reg = VGACNTRL;
1066
1067 if (I915_READ(vga_reg) & VGA_DISP_DISABLE)
1068 return;
1069
1070 I915_WRITE8(VGA_SR_INDEX, 1);
1071 sr1 = I915_READ8(VGA_SR_DATA);
1072 I915_WRITE8(VGA_SR_DATA, sr1 | (1 << 5));
1073 udelay(100);
1074
1075 I915_WRITE(vga_reg, VGA_DISP_DISABLE);
1076}
1077
1078static void igdng_disable_pll_edp (struct drm_crtc *crtc)
1079{
1080 struct drm_device *dev = crtc->dev;
1081 struct drm_i915_private *dev_priv = dev->dev_private;
1082 u32 dpa_ctl;
1083
1084 DRM_DEBUG("\n");
1085 dpa_ctl = I915_READ(DP_A);
1086 dpa_ctl &= ~DP_PLL_ENABLE;
1087 I915_WRITE(DP_A, dpa_ctl);
1088}
1089
1090static void igdng_enable_pll_edp (struct drm_crtc *crtc)
1091{
1092 struct drm_device *dev = crtc->dev;
1093 struct drm_i915_private *dev_priv = dev->dev_private;
1094 u32 dpa_ctl;
1095
1096 dpa_ctl = I915_READ(DP_A);
1097 dpa_ctl |= DP_PLL_ENABLE;
1098 I915_WRITE(DP_A, dpa_ctl);
1099 udelay(200);
1100}
1101
1102
1103static void igdng_set_pll_edp (struct drm_crtc *crtc, int clock)
1104{
1105 struct drm_device *dev = crtc->dev;
1106 struct drm_i915_private *dev_priv = dev->dev_private;
1107 u32 dpa_ctl;
1108
1109 DRM_DEBUG("eDP PLL enable for clock %d\n", clock);
1110 dpa_ctl = I915_READ(DP_A);
1111 dpa_ctl &= ~DP_PLL_FREQ_MASK;
1112
1113 if (clock < 200000) {
1114 u32 temp;
1115 dpa_ctl |= DP_PLL_FREQ_160MHZ;
1116 /* workaround for 160Mhz:
1117 1) program 0x4600c bits 15:0 = 0x8124
1118 2) program 0x46010 bit 0 = 1
1119 3) program 0x46034 bit 24 = 1
1120 4) program 0x64000 bit 14 = 1
1121 */
1122 temp = I915_READ(0x4600c);
1123 temp &= 0xffff0000;
1124 I915_WRITE(0x4600c, temp | 0x8124);
1125
1126 temp = I915_READ(0x46010);
1127 I915_WRITE(0x46010, temp | 1);
1128
1129 temp = I915_READ(0x46034);
1130 I915_WRITE(0x46034, temp | (1 << 24));
1131 } else {
1132 dpa_ctl |= DP_PLL_FREQ_270MHZ;
1133 }
1134 I915_WRITE(DP_A, dpa_ctl);
1135
1136 udelay(500);
1137}
1138
930static void igdng_crtc_dpms(struct drm_crtc *crtc, int mode) 1139static void igdng_crtc_dpms(struct drm_crtc *crtc, int mode)
931{ 1140{
932 struct drm_device *dev = crtc->dev; 1141 struct drm_device *dev = crtc->dev;
933 struct drm_i915_private *dev_priv = dev->dev_private; 1142 struct drm_i915_private *dev_priv = dev->dev_private;
934 struct intel_crtc *intel_crtc = to_intel_crtc(crtc); 1143 struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
935 int pipe = intel_crtc->pipe; 1144 int pipe = intel_crtc->pipe;
936 int plane = intel_crtc->pipe; 1145 int plane = intel_crtc->plane;
937 int pch_dpll_reg = (pipe == 0) ? PCH_DPLL_A : PCH_DPLL_B; 1146 int pch_dpll_reg = (pipe == 0) ? PCH_DPLL_A : PCH_DPLL_B;
938 int pipeconf_reg = (pipe == 0) ? PIPEACONF : PIPEBCONF; 1147 int pipeconf_reg = (pipe == 0) ? PIPEACONF : PIPEBCONF;
939 int dspcntr_reg = (plane == 0) ? DSPACNTR : DSPBCNTR; 1148 int dspcntr_reg = (plane == 0) ? DSPACNTR : DSPBCNTR;
@@ -944,6 +1153,7 @@ static void igdng_crtc_dpms(struct drm_crtc *crtc, int mode)
944 int fdi_rx_imr_reg = (pipe == 0) ? FDI_RXA_IMR : FDI_RXB_IMR; 1153 int fdi_rx_imr_reg = (pipe == 0) ? FDI_RXA_IMR : FDI_RXB_IMR;
945 int transconf_reg = (pipe == 0) ? TRANSACONF : TRANSBCONF; 1154 int transconf_reg = (pipe == 0) ? TRANSACONF : TRANSBCONF;
946 int pf_ctl_reg = (pipe == 0) ? PFA_CTL_1 : PFB_CTL_1; 1155 int pf_ctl_reg = (pipe == 0) ? PFA_CTL_1 : PFB_CTL_1;
1156 int pf_win_size = (pipe == 0) ? PFA_WIN_SZ : PFB_WIN_SZ;
947 int cpu_htot_reg = (pipe == 0) ? HTOTAL_A : HTOTAL_B; 1157 int cpu_htot_reg = (pipe == 0) ? HTOTAL_A : HTOTAL_B;
948 int cpu_hblank_reg = (pipe == 0) ? HBLANK_A : HBLANK_B; 1158 int cpu_hblank_reg = (pipe == 0) ? HBLANK_A : HBLANK_B;
949 int cpu_hsync_reg = (pipe == 0) ? HSYNC_A : HSYNC_B; 1159 int cpu_hsync_reg = (pipe == 0) ? HSYNC_A : HSYNC_B;
@@ -957,7 +1167,7 @@ static void igdng_crtc_dpms(struct drm_crtc *crtc, int mode)
957 int trans_vblank_reg = (pipe == 0) ? TRANS_VBLANK_A : TRANS_VBLANK_B; 1167 int trans_vblank_reg = (pipe == 0) ? TRANS_VBLANK_A : TRANS_VBLANK_B;
958 int trans_vsync_reg = (pipe == 0) ? TRANS_VSYNC_A : TRANS_VSYNC_B; 1168 int trans_vsync_reg = (pipe == 0) ? TRANS_VSYNC_A : TRANS_VSYNC_B;
959 u32 temp; 1169 u32 temp;
960 int tries = 5, j; 1170 int tries = 5, j, n;
961 1171
962 /* XXX: When our outputs are all unaware of DPMS modes other than off 1172 /* XXX: When our outputs are all unaware of DPMS modes other than off
963 * and on, we should map those modes to DRM_MODE_DPMS_OFF in the CRTC. 1173 * and on, we should map those modes to DRM_MODE_DPMS_OFF in the CRTC.
@@ -967,27 +1177,32 @@ static void igdng_crtc_dpms(struct drm_crtc *crtc, int mode)
967 case DRM_MODE_DPMS_STANDBY: 1177 case DRM_MODE_DPMS_STANDBY:
968 case DRM_MODE_DPMS_SUSPEND: 1178 case DRM_MODE_DPMS_SUSPEND:
969 DRM_DEBUG("crtc %d dpms on\n", pipe); 1179 DRM_DEBUG("crtc %d dpms on\n", pipe);
970 /* enable PCH DPLL */ 1180 if (HAS_eDP) {
971 temp = I915_READ(pch_dpll_reg); 1181 /* enable eDP PLL */
972 if ((temp & DPLL_VCO_ENABLE) == 0) { 1182 igdng_enable_pll_edp(crtc);
973 I915_WRITE(pch_dpll_reg, temp | DPLL_VCO_ENABLE); 1183 } else {
974 I915_READ(pch_dpll_reg); 1184 /* enable PCH DPLL */
975 } 1185 temp = I915_READ(pch_dpll_reg);
976 1186 if ((temp & DPLL_VCO_ENABLE) == 0) {
977 /* enable PCH FDI RX PLL, wait warmup plus DMI latency */ 1187 I915_WRITE(pch_dpll_reg, temp | DPLL_VCO_ENABLE);
978 temp = I915_READ(fdi_rx_reg); 1188 I915_READ(pch_dpll_reg);
979 I915_WRITE(fdi_rx_reg, temp | FDI_RX_PLL_ENABLE | 1189 }
980 FDI_SEL_PCDCLK |
981 FDI_DP_PORT_WIDTH_X4); /* default 4 lanes */
982 I915_READ(fdi_rx_reg);
983 udelay(200);
984 1190
985 /* Enable CPU FDI TX PLL, always on for IGDNG */ 1191 /* enable PCH FDI RX PLL, wait warmup plus DMI latency */
986 temp = I915_READ(fdi_tx_reg); 1192 temp = I915_READ(fdi_rx_reg);
987 if ((temp & FDI_TX_PLL_ENABLE) == 0) { 1193 I915_WRITE(fdi_rx_reg, temp | FDI_RX_PLL_ENABLE |
988 I915_WRITE(fdi_tx_reg, temp | FDI_TX_PLL_ENABLE); 1194 FDI_SEL_PCDCLK |
989 I915_READ(fdi_tx_reg); 1195 FDI_DP_PORT_WIDTH_X4); /* default 4 lanes */
990 udelay(100); 1196 I915_READ(fdi_rx_reg);
1197 udelay(200);
1198
1199 /* Enable CPU FDI TX PLL, always on for IGDNG */
1200 temp = I915_READ(fdi_tx_reg);
1201 if ((temp & FDI_TX_PLL_ENABLE) == 0) {
1202 I915_WRITE(fdi_tx_reg, temp | FDI_TX_PLL_ENABLE);
1203 I915_READ(fdi_tx_reg);
1204 udelay(100);
1205 }
991 } 1206 }
992 1207
993 /* Enable CPU pipe */ 1208 /* Enable CPU pipe */
@@ -1006,122 +1221,126 @@ static void igdng_crtc_dpms(struct drm_crtc *crtc, int mode)
1006 I915_WRITE(dspbase_reg, I915_READ(dspbase_reg)); 1221 I915_WRITE(dspbase_reg, I915_READ(dspbase_reg));
1007 } 1222 }
1008 1223
1009 /* enable CPU FDI TX and PCH FDI RX */ 1224 if (!HAS_eDP) {
1010 temp = I915_READ(fdi_tx_reg); 1225 /* enable CPU FDI TX and PCH FDI RX */
1011 temp |= FDI_TX_ENABLE; 1226 temp = I915_READ(fdi_tx_reg);
1012 temp |= FDI_DP_PORT_WIDTH_X4; /* default */ 1227 temp |= FDI_TX_ENABLE;
1013 temp &= ~FDI_LINK_TRAIN_NONE; 1228 temp |= FDI_DP_PORT_WIDTH_X4; /* default */
1014 temp |= FDI_LINK_TRAIN_PATTERN_1; 1229 temp &= ~FDI_LINK_TRAIN_NONE;
1015 I915_WRITE(fdi_tx_reg, temp); 1230 temp |= FDI_LINK_TRAIN_PATTERN_1;
1016 I915_READ(fdi_tx_reg); 1231 I915_WRITE(fdi_tx_reg, temp);
1232 I915_READ(fdi_tx_reg);
1017 1233
1018 temp = I915_READ(fdi_rx_reg); 1234 temp = I915_READ(fdi_rx_reg);
1019 temp &= ~FDI_LINK_TRAIN_NONE; 1235 temp &= ~FDI_LINK_TRAIN_NONE;
1020 temp |= FDI_LINK_TRAIN_PATTERN_1; 1236 temp |= FDI_LINK_TRAIN_PATTERN_1;
1021 I915_WRITE(fdi_rx_reg, temp | FDI_RX_ENABLE); 1237 I915_WRITE(fdi_rx_reg, temp | FDI_RX_ENABLE);
1022 I915_READ(fdi_rx_reg); 1238 I915_READ(fdi_rx_reg);
1023 1239
1024 udelay(150); 1240 udelay(150);
1025 1241
1026 /* Train FDI. */ 1242 /* Train FDI. */
1027 /* umask FDI RX Interrupt symbol_lock and bit_lock bit 1243 /* umask FDI RX Interrupt symbol_lock and bit_lock bit
1028 for train result */ 1244 for train result */
1029 temp = I915_READ(fdi_rx_imr_reg); 1245 temp = I915_READ(fdi_rx_imr_reg);
1030 temp &= ~FDI_RX_SYMBOL_LOCK; 1246 temp &= ~FDI_RX_SYMBOL_LOCK;
1031 temp &= ~FDI_RX_BIT_LOCK; 1247 temp &= ~FDI_RX_BIT_LOCK;
1032 I915_WRITE(fdi_rx_imr_reg, temp); 1248 I915_WRITE(fdi_rx_imr_reg, temp);
1033 I915_READ(fdi_rx_imr_reg); 1249 I915_READ(fdi_rx_imr_reg);
1034 udelay(150); 1250 udelay(150);
1035 1251
1036 temp = I915_READ(fdi_rx_iir_reg); 1252 temp = I915_READ(fdi_rx_iir_reg);
1037 DRM_DEBUG("FDI_RX_IIR 0x%x\n", temp); 1253 DRM_DEBUG("FDI_RX_IIR 0x%x\n", temp);
1038 1254
1039 if ((temp & FDI_RX_BIT_LOCK) == 0) { 1255 if ((temp & FDI_RX_BIT_LOCK) == 0) {
1040 for (j = 0; j < tries; j++) { 1256 for (j = 0; j < tries; j++) {
1041 temp = I915_READ(fdi_rx_iir_reg); 1257 temp = I915_READ(fdi_rx_iir_reg);
1042 DRM_DEBUG("FDI_RX_IIR 0x%x\n", temp); 1258 DRM_DEBUG("FDI_RX_IIR 0x%x\n", temp);
1043 if (temp & FDI_RX_BIT_LOCK) 1259 if (temp & FDI_RX_BIT_LOCK)
1044 break; 1260 break;
1045 udelay(200); 1261 udelay(200);
1046 } 1262 }
1047 if (j != tries) 1263 if (j != tries)
1264 I915_WRITE(fdi_rx_iir_reg,
1265 temp | FDI_RX_BIT_LOCK);
1266 else
1267 DRM_DEBUG("train 1 fail\n");
1268 } else {
1048 I915_WRITE(fdi_rx_iir_reg, 1269 I915_WRITE(fdi_rx_iir_reg,
1049 temp | FDI_RX_BIT_LOCK); 1270 temp | FDI_RX_BIT_LOCK);
1050 else 1271 DRM_DEBUG("train 1 ok 2!\n");
1051 DRM_DEBUG("train 1 fail\n"); 1272 }
1052 } else { 1273 temp = I915_READ(fdi_tx_reg);
1053 I915_WRITE(fdi_rx_iir_reg, 1274 temp &= ~FDI_LINK_TRAIN_NONE;
1054 temp | FDI_RX_BIT_LOCK); 1275 temp |= FDI_LINK_TRAIN_PATTERN_2;
1055 DRM_DEBUG("train 1 ok 2!\n"); 1276 I915_WRITE(fdi_tx_reg, temp);
1056 } 1277
1057 temp = I915_READ(fdi_tx_reg); 1278 temp = I915_READ(fdi_rx_reg);
1058 temp &= ~FDI_LINK_TRAIN_NONE; 1279 temp &= ~FDI_LINK_TRAIN_NONE;
1059 temp |= FDI_LINK_TRAIN_PATTERN_2; 1280 temp |= FDI_LINK_TRAIN_PATTERN_2;
1060 I915_WRITE(fdi_tx_reg, temp); 1281 I915_WRITE(fdi_rx_reg, temp);
1061
1062 temp = I915_READ(fdi_rx_reg);
1063 temp &= ~FDI_LINK_TRAIN_NONE;
1064 temp |= FDI_LINK_TRAIN_PATTERN_2;
1065 I915_WRITE(fdi_rx_reg, temp);
1066 1282
1067 udelay(150); 1283 udelay(150);
1068 1284
1069 temp = I915_READ(fdi_rx_iir_reg); 1285 temp = I915_READ(fdi_rx_iir_reg);
1070 DRM_DEBUG("FDI_RX_IIR 0x%x\n", temp); 1286 DRM_DEBUG("FDI_RX_IIR 0x%x\n", temp);
1071 1287
1072 if ((temp & FDI_RX_SYMBOL_LOCK) == 0) { 1288 if ((temp & FDI_RX_SYMBOL_LOCK) == 0) {
1073 for (j = 0; j < tries; j++) { 1289 for (j = 0; j < tries; j++) {
1074 temp = I915_READ(fdi_rx_iir_reg); 1290 temp = I915_READ(fdi_rx_iir_reg);
1075 DRM_DEBUG("FDI_RX_IIR 0x%x\n", temp); 1291 DRM_DEBUG("FDI_RX_IIR 0x%x\n", temp);
1076 if (temp & FDI_RX_SYMBOL_LOCK) 1292 if (temp & FDI_RX_SYMBOL_LOCK)
1077 break; 1293 break;
1078 udelay(200); 1294 udelay(200);
1079 } 1295 }
1080 if (j != tries) { 1296 if (j != tries) {
1297 I915_WRITE(fdi_rx_iir_reg,
1298 temp | FDI_RX_SYMBOL_LOCK);
1299 DRM_DEBUG("train 2 ok 1!\n");
1300 } else
1301 DRM_DEBUG("train 2 fail\n");
1302 } else {
1081 I915_WRITE(fdi_rx_iir_reg, 1303 I915_WRITE(fdi_rx_iir_reg,
1082 temp | FDI_RX_SYMBOL_LOCK); 1304 temp | FDI_RX_SYMBOL_LOCK);
1083 DRM_DEBUG("train 2 ok 1!\n"); 1305 DRM_DEBUG("train 2 ok 2!\n");
1084 } else 1306 }
1085 DRM_DEBUG("train 2 fail\n"); 1307 DRM_DEBUG("train done\n");
1086 } else {
1087 I915_WRITE(fdi_rx_iir_reg, temp | FDI_RX_SYMBOL_LOCK);
1088 DRM_DEBUG("train 2 ok 2!\n");
1089 }
1090 DRM_DEBUG("train done\n");
1091 1308
1092 /* set transcoder timing */ 1309 /* set transcoder timing */
1093 I915_WRITE(trans_htot_reg, I915_READ(cpu_htot_reg)); 1310 I915_WRITE(trans_htot_reg, I915_READ(cpu_htot_reg));
1094 I915_WRITE(trans_hblank_reg, I915_READ(cpu_hblank_reg)); 1311 I915_WRITE(trans_hblank_reg, I915_READ(cpu_hblank_reg));
1095 I915_WRITE(trans_hsync_reg, I915_READ(cpu_hsync_reg)); 1312 I915_WRITE(trans_hsync_reg, I915_READ(cpu_hsync_reg));
1096 1313
1097 I915_WRITE(trans_vtot_reg, I915_READ(cpu_vtot_reg)); 1314 I915_WRITE(trans_vtot_reg, I915_READ(cpu_vtot_reg));
1098 I915_WRITE(trans_vblank_reg, I915_READ(cpu_vblank_reg)); 1315 I915_WRITE(trans_vblank_reg, I915_READ(cpu_vblank_reg));
1099 I915_WRITE(trans_vsync_reg, I915_READ(cpu_vsync_reg)); 1316 I915_WRITE(trans_vsync_reg, I915_READ(cpu_vsync_reg));
1100 1317
1101 /* enable PCH transcoder */ 1318 /* enable PCH transcoder */
1102 temp = I915_READ(transconf_reg); 1319 temp = I915_READ(transconf_reg);
1103 I915_WRITE(transconf_reg, temp | TRANS_ENABLE); 1320 I915_WRITE(transconf_reg, temp | TRANS_ENABLE);
1104 I915_READ(transconf_reg); 1321 I915_READ(transconf_reg);
1105 1322
1106 while ((I915_READ(transconf_reg) & TRANS_STATE_ENABLE) == 0) 1323 while ((I915_READ(transconf_reg) & TRANS_STATE_ENABLE) == 0)
1107 ; 1324 ;
1108 1325
1109 /* enable normal */ 1326 /* enable normal */
1110 1327
1111 temp = I915_READ(fdi_tx_reg); 1328 temp = I915_READ(fdi_tx_reg);
1112 temp &= ~FDI_LINK_TRAIN_NONE; 1329 temp &= ~FDI_LINK_TRAIN_NONE;
1113 I915_WRITE(fdi_tx_reg, temp | FDI_LINK_TRAIN_NONE | 1330 I915_WRITE(fdi_tx_reg, temp | FDI_LINK_TRAIN_NONE |
1114 FDI_TX_ENHANCE_FRAME_ENABLE); 1331 FDI_TX_ENHANCE_FRAME_ENABLE);
1115 I915_READ(fdi_tx_reg); 1332 I915_READ(fdi_tx_reg);
1116 1333
1117 temp = I915_READ(fdi_rx_reg); 1334 temp = I915_READ(fdi_rx_reg);
1118 temp &= ~FDI_LINK_TRAIN_NONE; 1335 temp &= ~FDI_LINK_TRAIN_NONE;
1119 I915_WRITE(fdi_rx_reg, temp | FDI_LINK_TRAIN_NONE | 1336 I915_WRITE(fdi_rx_reg, temp | FDI_LINK_TRAIN_NONE |
1120 FDI_RX_ENHANCE_FRAME_ENABLE); 1337 FDI_RX_ENHANCE_FRAME_ENABLE);
1121 I915_READ(fdi_rx_reg); 1338 I915_READ(fdi_rx_reg);
1122 1339
1123 /* wait one idle pattern time */ 1340 /* wait one idle pattern time */
1124 udelay(100); 1341 udelay(100);
1342
1343 }
1125 1344
1126 intel_crtc_load_lut(crtc); 1345 intel_crtc_load_lut(crtc);
1127 1346
@@ -1129,8 +1348,7 @@ static void igdng_crtc_dpms(struct drm_crtc *crtc, int mode)
1129 case DRM_MODE_DPMS_OFF: 1348 case DRM_MODE_DPMS_OFF:
1130 DRM_DEBUG("crtc %d dpms off\n", pipe); 1349 DRM_DEBUG("crtc %d dpms off\n", pipe);
1131 1350
1132 /* Disable the VGA plane that we never use */ 1351 i915_disable_vga(dev);
1133 I915_WRITE(CPU_VGACNTRL, VGA_DISP_DISABLE);
1134 1352
1135 /* Disable display plane */ 1353 /* Disable display plane */
1136 temp = I915_READ(dspcntr_reg); 1354 temp = I915_READ(dspcntr_reg);
@@ -1146,17 +1364,23 @@ static void igdng_crtc_dpms(struct drm_crtc *crtc, int mode)
1146 if ((temp & PIPEACONF_ENABLE) != 0) { 1364 if ((temp & PIPEACONF_ENABLE) != 0) {
1147 I915_WRITE(pipeconf_reg, temp & ~PIPEACONF_ENABLE); 1365 I915_WRITE(pipeconf_reg, temp & ~PIPEACONF_ENABLE);
1148 I915_READ(pipeconf_reg); 1366 I915_READ(pipeconf_reg);
1367 n = 0;
1149 /* wait for cpu pipe off, pipe state */ 1368 /* wait for cpu pipe off, pipe state */
1150 while ((I915_READ(pipeconf_reg) & I965_PIPECONF_ACTIVE) != 0) 1369 while ((I915_READ(pipeconf_reg) & I965_PIPECONF_ACTIVE) != 0) {
1151 ; 1370 n++;
1371 if (n < 60) {
1372 udelay(500);
1373 continue;
1374 } else {
1375 DRM_DEBUG("pipe %d off delay\n", pipe);
1376 break;
1377 }
1378 }
1152 } else 1379 } else
1153 DRM_DEBUG("crtc %d is disabled\n", pipe); 1380 DRM_DEBUG("crtc %d is disabled\n", pipe);
1154 1381
1155 /* IGDNG-A : disable cpu panel fitter ? */ 1382 if (HAS_eDP) {
1156 temp = I915_READ(pf_ctl_reg); 1383 igdng_disable_pll_edp(crtc);
1157 if ((temp & PF_ENABLE) != 0) {
1158 I915_WRITE(pf_ctl_reg, temp & ~PF_ENABLE);
1159 I915_READ(pf_ctl_reg);
1160 } 1384 }
1161 1385
1162 /* disable CPU FDI tx and PCH FDI rx */ 1386 /* disable CPU FDI tx and PCH FDI rx */
@@ -1168,6 +1392,8 @@ static void igdng_crtc_dpms(struct drm_crtc *crtc, int mode)
1168 I915_WRITE(fdi_rx_reg, temp & ~FDI_RX_ENABLE); 1392 I915_WRITE(fdi_rx_reg, temp & ~FDI_RX_ENABLE);
1169 I915_READ(fdi_rx_reg); 1393 I915_READ(fdi_rx_reg);
1170 1394
1395 udelay(100);
1396
1171 /* still set train pattern 1 */ 1397 /* still set train pattern 1 */
1172 temp = I915_READ(fdi_tx_reg); 1398 temp = I915_READ(fdi_tx_reg);
1173 temp &= ~FDI_LINK_TRAIN_NONE; 1399 temp &= ~FDI_LINK_TRAIN_NONE;
@@ -1179,14 +1405,25 @@ static void igdng_crtc_dpms(struct drm_crtc *crtc, int mode)
1179 temp |= FDI_LINK_TRAIN_PATTERN_1; 1405 temp |= FDI_LINK_TRAIN_PATTERN_1;
1180 I915_WRITE(fdi_rx_reg, temp); 1406 I915_WRITE(fdi_rx_reg, temp);
1181 1407
1408 udelay(100);
1409
1182 /* disable PCH transcoder */ 1410 /* disable PCH transcoder */
1183 temp = I915_READ(transconf_reg); 1411 temp = I915_READ(transconf_reg);
1184 if ((temp & TRANS_ENABLE) != 0) { 1412 if ((temp & TRANS_ENABLE) != 0) {
1185 I915_WRITE(transconf_reg, temp & ~TRANS_ENABLE); 1413 I915_WRITE(transconf_reg, temp & ~TRANS_ENABLE);
1186 I915_READ(transconf_reg); 1414 I915_READ(transconf_reg);
1415 n = 0;
1187 /* wait for PCH transcoder off, transcoder state */ 1416 /* wait for PCH transcoder off, transcoder state */
1188 while ((I915_READ(transconf_reg) & TRANS_STATE_ENABLE) != 0) 1417 while ((I915_READ(transconf_reg) & TRANS_STATE_ENABLE) != 0) {
1189 ; 1418 n++;
1419 if (n < 60) {
1420 udelay(500);
1421 continue;
1422 } else {
1423 DRM_DEBUG("transcoder %d off delay\n", pipe);
1424 break;
1425 }
1426 }
1190 } 1427 }
1191 1428
1192 /* disable PCH DPLL */ 1429 /* disable PCH DPLL */
@@ -1204,6 +1441,22 @@ static void igdng_crtc_dpms(struct drm_crtc *crtc, int mode)
1204 I915_READ(fdi_rx_reg); 1441 I915_READ(fdi_rx_reg);
1205 } 1442 }
1206 1443
1444 /* Disable CPU FDI TX PLL */
1445 temp = I915_READ(fdi_tx_reg);
1446 if ((temp & FDI_TX_PLL_ENABLE) != 0) {
1447 I915_WRITE(fdi_tx_reg, temp & ~FDI_TX_PLL_ENABLE);
1448 I915_READ(fdi_tx_reg);
1449 udelay(100);
1450 }
1451
1452 /* Disable PF */
1453 temp = I915_READ(pf_ctl_reg);
1454 if ((temp & PF_ENABLE) != 0) {
1455 I915_WRITE(pf_ctl_reg, temp & ~PF_ENABLE);
1456 I915_READ(pf_ctl_reg);
1457 }
1458 I915_WRITE(pf_win_size, 0);
1459
1207 /* Wait for the clocks to turn off. */ 1460 /* Wait for the clocks to turn off. */
1208 udelay(150); 1461 udelay(150);
1209 break; 1462 break;
@@ -1263,13 +1516,15 @@ static void i9xx_crtc_dpms(struct drm_crtc *crtc, int mode)
1263 1516
1264 /* Give the overlay scaler a chance to enable if it's on this pipe */ 1517 /* Give the overlay scaler a chance to enable if it's on this pipe */
1265 //intel_crtc_dpms_video(crtc, true); TODO 1518 //intel_crtc_dpms_video(crtc, true); TODO
1519 intel_update_watermarks(dev);
1266 break; 1520 break;
1267 case DRM_MODE_DPMS_OFF: 1521 case DRM_MODE_DPMS_OFF:
1522 intel_update_watermarks(dev);
1268 /* Give the overlay scaler a chance to disable if it's on this pipe */ 1523 /* Give the overlay scaler a chance to disable if it's on this pipe */
1269 //intel_crtc_dpms_video(crtc, FALSE); TODO 1524 //intel_crtc_dpms_video(crtc, FALSE); TODO
1270 1525
1271 /* Disable the VGA plane that we never use */ 1526 /* Disable the VGA plane that we never use */
1272 I915_WRITE(VGACNTRL, VGA_DISP_DISABLE); 1527 i915_disable_vga(dev);
1273 1528
1274 /* Disable display plane */ 1529 /* Disable display plane */
1275 temp = I915_READ(dspcntr_reg); 1530 temp = I915_READ(dspcntr_reg);
@@ -1443,7 +1698,6 @@ static int intel_get_core_clock_speed(struct drm_device *dev)
1443 return 0; /* Silence gcc warning */ 1698 return 0; /* Silence gcc warning */
1444} 1699}
1445 1700
1446
1447/** 1701/**
1448 * Return the pipe currently connected to the panel fitter, 1702 * Return the pipe currently connected to the panel fitter,
1449 * or -1 if the panel fitter is not present or not in use 1703 * or -1 if the panel fitter is not present or not in use
@@ -1502,7 +1756,7 @@ igdng_compute_m_n(int bytes_per_pixel, int nlanes,
1502 1756
1503 temp = (u64) DATA_N * pixel_clock; 1757 temp = (u64) DATA_N * pixel_clock;
1504 temp = div_u64(temp, link_clock); 1758 temp = div_u64(temp, link_clock);
1505 m_n->gmch_m = (temp * bytes_per_pixel) / nlanes; 1759 m_n->gmch_m = div_u64(temp * bytes_per_pixel, nlanes);
1506 m_n->gmch_n = DATA_N; 1760 m_n->gmch_n = DATA_N;
1507 fdi_reduce_ratio(&m_n->gmch_m, &m_n->gmch_n); 1761 fdi_reduce_ratio(&m_n->gmch_m, &m_n->gmch_n);
1508 1762
@@ -1513,6 +1767,464 @@ igdng_compute_m_n(int bytes_per_pixel, int nlanes,
1513} 1767}
1514 1768
1515 1769
1770struct intel_watermark_params {
1771 unsigned long fifo_size;
1772 unsigned long max_wm;
1773 unsigned long default_wm;
1774 unsigned long guard_size;
1775 unsigned long cacheline_size;
1776};
1777
1778/* IGD has different values for various configs */
1779static struct intel_watermark_params igd_display_wm = {
1780 IGD_DISPLAY_FIFO,
1781 IGD_MAX_WM,
1782 IGD_DFT_WM,
1783 IGD_GUARD_WM,
1784 IGD_FIFO_LINE_SIZE
1785};
1786static struct intel_watermark_params igd_display_hplloff_wm = {
1787 IGD_DISPLAY_FIFO,
1788 IGD_MAX_WM,
1789 IGD_DFT_HPLLOFF_WM,
1790 IGD_GUARD_WM,
1791 IGD_FIFO_LINE_SIZE
1792};
1793static struct intel_watermark_params igd_cursor_wm = {
1794 IGD_CURSOR_FIFO,
1795 IGD_CURSOR_MAX_WM,
1796 IGD_CURSOR_DFT_WM,
1797 IGD_CURSOR_GUARD_WM,
1798 IGD_FIFO_LINE_SIZE,
1799};
1800static struct intel_watermark_params igd_cursor_hplloff_wm = {
1801 IGD_CURSOR_FIFO,
1802 IGD_CURSOR_MAX_WM,
1803 IGD_CURSOR_DFT_WM,
1804 IGD_CURSOR_GUARD_WM,
1805 IGD_FIFO_LINE_SIZE
1806};
1807static struct intel_watermark_params i945_wm_info = {
1808 I945_FIFO_SIZE,
1809 I915_MAX_WM,
1810 1,
1811 2,
1812 I915_FIFO_LINE_SIZE
1813};
1814static struct intel_watermark_params i915_wm_info = {
1815 I915_FIFO_SIZE,
1816 I915_MAX_WM,
1817 1,
1818 2,
1819 I915_FIFO_LINE_SIZE
1820};
1821static struct intel_watermark_params i855_wm_info = {
1822 I855GM_FIFO_SIZE,
1823 I915_MAX_WM,
1824 1,
1825 2,
1826 I830_FIFO_LINE_SIZE
1827};
1828static struct intel_watermark_params i830_wm_info = {
1829 I830_FIFO_SIZE,
1830 I915_MAX_WM,
1831 1,
1832 2,
1833 I830_FIFO_LINE_SIZE
1834};
1835
1836/**
1837 * intel_calculate_wm - calculate watermark level
1838 * @clock_in_khz: pixel clock
1839 * @wm: chip FIFO params
1840 * @pixel_size: display pixel size
1841 * @latency_ns: memory latency for the platform
1842 *
1843 * Calculate the watermark level (the level at which the display plane will
1844 * start fetching from memory again). Each chip has a different display
1845 * FIFO size and allocation, so the caller needs to figure that out and pass
1846 * in the correct intel_watermark_params structure.
1847 *
1848 * As the pixel clock runs, the FIFO will be drained at a rate that depends
1849 * on the pixel size. When it reaches the watermark level, it'll start
1850 * fetching FIFO line sized based chunks from memory until the FIFO fills
1851 * past the watermark point. If the FIFO drains completely, a FIFO underrun
1852 * will occur, and a display engine hang could result.
1853 */
1854static unsigned long intel_calculate_wm(unsigned long clock_in_khz,
1855 struct intel_watermark_params *wm,
1856 int pixel_size,
1857 unsigned long latency_ns)
1858{
1859 long entries_required, wm_size;
1860
1861 entries_required = (clock_in_khz * pixel_size * latency_ns) / 1000000;
1862 entries_required /= wm->cacheline_size;
1863
1864 DRM_DEBUG("FIFO entries required for mode: %d\n", entries_required);
1865
1866 wm_size = wm->fifo_size - (entries_required + wm->guard_size);
1867
1868 DRM_DEBUG("FIFO watermark level: %d\n", wm_size);
1869
1870 /* Don't promote wm_size to unsigned... */
1871 if (wm_size > (long)wm->max_wm)
1872 wm_size = wm->max_wm;
1873 if (wm_size <= 0)
1874 wm_size = wm->default_wm;
1875 return wm_size;
1876}
1877
1878struct cxsr_latency {
1879 int is_desktop;
1880 unsigned long fsb_freq;
1881 unsigned long mem_freq;
1882 unsigned long display_sr;
1883 unsigned long display_hpll_disable;
1884 unsigned long cursor_sr;
1885 unsigned long cursor_hpll_disable;
1886};
1887
1888static struct cxsr_latency cxsr_latency_table[] = {
1889 {1, 800, 400, 3382, 33382, 3983, 33983}, /* DDR2-400 SC */
1890 {1, 800, 667, 3354, 33354, 3807, 33807}, /* DDR2-667 SC */
1891 {1, 800, 800, 3347, 33347, 3763, 33763}, /* DDR2-800 SC */
1892
1893 {1, 667, 400, 3400, 33400, 4021, 34021}, /* DDR2-400 SC */
1894 {1, 667, 667, 3372, 33372, 3845, 33845}, /* DDR2-667 SC */
1895 {1, 667, 800, 3386, 33386, 3822, 33822}, /* DDR2-800 SC */
1896
1897 {1, 400, 400, 3472, 33472, 4173, 34173}, /* DDR2-400 SC */
1898 {1, 400, 667, 3443, 33443, 3996, 33996}, /* DDR2-667 SC */
1899 {1, 400, 800, 3430, 33430, 3946, 33946}, /* DDR2-800 SC */
1900
1901 {0, 800, 400, 3438, 33438, 4065, 34065}, /* DDR2-400 SC */
1902 {0, 800, 667, 3410, 33410, 3889, 33889}, /* DDR2-667 SC */
1903 {0, 800, 800, 3403, 33403, 3845, 33845}, /* DDR2-800 SC */
1904
1905 {0, 667, 400, 3456, 33456, 4103, 34106}, /* DDR2-400 SC */
1906 {0, 667, 667, 3428, 33428, 3927, 33927}, /* DDR2-667 SC */
1907 {0, 667, 800, 3443, 33443, 3905, 33905}, /* DDR2-800 SC */
1908
1909 {0, 400, 400, 3528, 33528, 4255, 34255}, /* DDR2-400 SC */
1910 {0, 400, 667, 3500, 33500, 4079, 34079}, /* DDR2-667 SC */
1911 {0, 400, 800, 3487, 33487, 4029, 34029}, /* DDR2-800 SC */
1912};
1913
1914static struct cxsr_latency *intel_get_cxsr_latency(int is_desktop, int fsb,
1915 int mem)
1916{
1917 int i;
1918 struct cxsr_latency *latency;
1919
1920 if (fsb == 0 || mem == 0)
1921 return NULL;
1922
1923 for (i = 0; i < ARRAY_SIZE(cxsr_latency_table); i++) {
1924 latency = &cxsr_latency_table[i];
1925 if (is_desktop == latency->is_desktop &&
1926 fsb == latency->fsb_freq && mem == latency->mem_freq)
1927 break;
1928 }
1929 if (i >= ARRAY_SIZE(cxsr_latency_table)) {
1930 DRM_DEBUG("Unknown FSB/MEM found, disable CxSR\n");
1931 return NULL;
1932 }
1933 return latency;
1934}
1935
1936static void igd_disable_cxsr(struct drm_device *dev)
1937{
1938 struct drm_i915_private *dev_priv = dev->dev_private;
1939 u32 reg;
1940
1941 /* deactivate cxsr */
1942 reg = I915_READ(DSPFW3);
1943 reg &= ~(IGD_SELF_REFRESH_EN);
1944 I915_WRITE(DSPFW3, reg);
1945 DRM_INFO("Big FIFO is disabled\n");
1946}
1947
1948static void igd_enable_cxsr(struct drm_device *dev, unsigned long clock,
1949 int pixel_size)
1950{
1951 struct drm_i915_private *dev_priv = dev->dev_private;
1952 u32 reg;
1953 unsigned long wm;
1954 struct cxsr_latency *latency;
1955
1956 latency = intel_get_cxsr_latency(IS_IGDG(dev), dev_priv->fsb_freq,
1957 dev_priv->mem_freq);
1958 if (!latency) {
1959 DRM_DEBUG("Unknown FSB/MEM found, disable CxSR\n");
1960 igd_disable_cxsr(dev);
1961 return;
1962 }
1963
1964 /* Display SR */
1965 wm = intel_calculate_wm(clock, &igd_display_wm, pixel_size,
1966 latency->display_sr);
1967 reg = I915_READ(DSPFW1);
1968 reg &= 0x7fffff;
1969 reg |= wm << 23;
1970 I915_WRITE(DSPFW1, reg);
1971 DRM_DEBUG("DSPFW1 register is %x\n", reg);
1972
1973 /* cursor SR */
1974 wm = intel_calculate_wm(clock, &igd_cursor_wm, pixel_size,
1975 latency->cursor_sr);
1976 reg = I915_READ(DSPFW3);
1977 reg &= ~(0x3f << 24);
1978 reg |= (wm & 0x3f) << 24;
1979 I915_WRITE(DSPFW3, reg);
1980
1981 /* Display HPLL off SR */
1982 wm = intel_calculate_wm(clock, &igd_display_hplloff_wm,
1983 latency->display_hpll_disable, I915_FIFO_LINE_SIZE);
1984 reg = I915_READ(DSPFW3);
1985 reg &= 0xfffffe00;
1986 reg |= wm & 0x1ff;
1987 I915_WRITE(DSPFW3, reg);
1988
1989 /* cursor HPLL off SR */
1990 wm = intel_calculate_wm(clock, &igd_cursor_hplloff_wm, pixel_size,
1991 latency->cursor_hpll_disable);
1992 reg = I915_READ(DSPFW3);
1993 reg &= ~(0x3f << 16);
1994 reg |= (wm & 0x3f) << 16;
1995 I915_WRITE(DSPFW3, reg);
1996 DRM_DEBUG("DSPFW3 register is %x\n", reg);
1997
1998 /* activate cxsr */
1999 reg = I915_READ(DSPFW3);
2000 reg |= IGD_SELF_REFRESH_EN;
2001 I915_WRITE(DSPFW3, reg);
2002
2003 DRM_INFO("Big FIFO is enabled\n");
2004
2005 return;
2006}
2007
2008const static int latency_ns = 3000; /* default for non-igd platforms */
2009
2010static int intel_get_fifo_size(struct drm_device *dev, int plane)
2011{
2012 struct drm_i915_private *dev_priv = dev->dev_private;
2013 uint32_t dsparb = I915_READ(DSPARB);
2014 int size;
2015
2016 if (IS_I9XX(dev)) {
2017 if (plane == 0)
2018 size = dsparb & 0x7f;
2019 else
2020 size = ((dsparb >> DSPARB_CSTART_SHIFT) & 0x7f) -
2021 (dsparb & 0x7f);
2022 } else if (IS_I85X(dev)) {
2023 if (plane == 0)
2024 size = dsparb & 0x1ff;
2025 else
2026 size = ((dsparb >> DSPARB_BEND_SHIFT) & 0x1ff) -
2027 (dsparb & 0x1ff);
2028 size >>= 1; /* Convert to cachelines */
2029 } else if (IS_845G(dev)) {
2030 size = dsparb & 0x7f;
2031 size >>= 2; /* Convert to cachelines */
2032 } else {
2033 size = dsparb & 0x7f;
2034 size >>= 1; /* Convert to cachelines */
2035 }
2036
2037 DRM_DEBUG("FIFO size - (0x%08x) %s: %d\n", dsparb, plane ? "B" : "A",
2038 size);
2039
2040 return size;
2041}
2042
2043static void i965_update_wm(struct drm_device *dev)
2044{
2045 struct drm_i915_private *dev_priv = dev->dev_private;
2046
2047 DRM_DEBUG("Setting FIFO watermarks - A: 8, B: 8, C: 8, SR 8\n");
2048
2049 /* 965 has limitations... */
2050 I915_WRITE(DSPFW1, (8 << 16) | (8 << 8) | (8 << 0));
2051 I915_WRITE(DSPFW2, (8 << 8) | (8 << 0));
2052}
2053
2054static void i9xx_update_wm(struct drm_device *dev, int planea_clock,
2055 int planeb_clock, int sr_hdisplay, int pixel_size)
2056{
2057 struct drm_i915_private *dev_priv = dev->dev_private;
2058 uint32_t fwater_lo;
2059 uint32_t fwater_hi;
2060 int total_size, cacheline_size, cwm, srwm = 1;
2061 int planea_wm, planeb_wm;
2062 struct intel_watermark_params planea_params, planeb_params;
2063 unsigned long line_time_us;
2064 int sr_clock, sr_entries = 0;
2065
2066 /* Create copies of the base settings for each pipe */
2067 if (IS_I965GM(dev) || IS_I945GM(dev))
2068 planea_params = planeb_params = i945_wm_info;
2069 else if (IS_I9XX(dev))
2070 planea_params = planeb_params = i915_wm_info;
2071 else
2072 planea_params = planeb_params = i855_wm_info;
2073
2074 /* Grab a couple of global values before we overwrite them */
2075 total_size = planea_params.fifo_size;
2076 cacheline_size = planea_params.cacheline_size;
2077
2078 /* Update per-plane FIFO sizes */
2079 planea_params.fifo_size = intel_get_fifo_size(dev, 0);
2080 planeb_params.fifo_size = intel_get_fifo_size(dev, 1);
2081
2082 planea_wm = intel_calculate_wm(planea_clock, &planea_params,
2083 pixel_size, latency_ns);
2084 planeb_wm = intel_calculate_wm(planeb_clock, &planeb_params,
2085 pixel_size, latency_ns);
2086 DRM_DEBUG("FIFO watermarks - A: %d, B: %d\n", planea_wm, planeb_wm);
2087
2088 /*
2089 * Overlay gets an aggressive default since video jitter is bad.
2090 */
2091 cwm = 2;
2092
2093 /* Calc sr entries for one plane configs */
2094 if (sr_hdisplay && (!planea_clock || !planeb_clock)) {
2095 /* self-refresh has much higher latency */
2096 const static int sr_latency_ns = 6000;
2097
2098 sr_clock = planea_clock ? planea_clock : planeb_clock;
2099 line_time_us = ((sr_hdisplay * 1000) / sr_clock);
2100
2101 /* Use ns/us then divide to preserve precision */
2102 sr_entries = (((sr_latency_ns / line_time_us) + 1) *
2103 pixel_size * sr_hdisplay) / 1000;
2104 sr_entries = roundup(sr_entries / cacheline_size, 1);
2105 DRM_DEBUG("self-refresh entries: %d\n", sr_entries);
2106 srwm = total_size - sr_entries;
2107 if (srwm < 0)
2108 srwm = 1;
2109 if (IS_I9XX(dev))
2110 I915_WRITE(FW_BLC_SELF, (srwm & 0x3f));
2111 }
2112
2113 DRM_DEBUG("Setting FIFO watermarks - A: %d, B: %d, C: %d, SR %d\n",
2114 planea_wm, planeb_wm, cwm, srwm);
2115
2116 fwater_lo = ((planeb_wm & 0x3f) << 16) | (planea_wm & 0x3f);
2117 fwater_hi = (cwm & 0x1f);
2118
2119 /* Set request length to 8 cachelines per fetch */
2120 fwater_lo = fwater_lo | (1 << 24) | (1 << 8);
2121 fwater_hi = fwater_hi | (1 << 8);
2122
2123 I915_WRITE(FW_BLC, fwater_lo);
2124 I915_WRITE(FW_BLC2, fwater_hi);
2125}
2126
2127static void i830_update_wm(struct drm_device *dev, int planea_clock,
2128 int pixel_size)
2129{
2130 struct drm_i915_private *dev_priv = dev->dev_private;
2131 uint32_t fwater_lo = I915_READ(FW_BLC) & ~0xfff;
2132 int planea_wm;
2133
2134 i830_wm_info.fifo_size = intel_get_fifo_size(dev, 0);
2135
2136 planea_wm = intel_calculate_wm(planea_clock, &i830_wm_info,
2137 pixel_size, latency_ns);
2138 fwater_lo |= (3<<8) | planea_wm;
2139
2140 DRM_DEBUG("Setting FIFO watermarks - A: %d\n", planea_wm);
2141
2142 I915_WRITE(FW_BLC, fwater_lo);
2143}
2144
2145/**
2146 * intel_update_watermarks - update FIFO watermark values based on current modes
2147 *
2148 * Calculate watermark values for the various WM regs based on current mode
2149 * and plane configuration.
2150 *
2151 * There are several cases to deal with here:
2152 * - normal (i.e. non-self-refresh)
2153 * - self-refresh (SR) mode
2154 * - lines are large relative to FIFO size (buffer can hold up to 2)
2155 * - lines are small relative to FIFO size (buffer can hold more than 2
2156 * lines), so need to account for TLB latency
2157 *
2158 * The normal calculation is:
2159 * watermark = dotclock * bytes per pixel * latency
2160 * where latency is platform & configuration dependent (we assume pessimal
2161 * values here).
2162 *
2163 * The SR calculation is:
2164 * watermark = (trunc(latency/line time)+1) * surface width *
2165 * bytes per pixel
2166 * where
2167 * line time = htotal / dotclock
2168 * and latency is assumed to be high, as above.
2169 *
2170 * The final value programmed to the register should always be rounded up,
2171 * and include an extra 2 entries to account for clock crossings.
2172 *
2173 * We don't use the sprite, so we can ignore that. And on Crestline we have
2174 * to set the non-SR watermarks to 8.
2175 */
2176static void intel_update_watermarks(struct drm_device *dev)
2177{
2178 struct drm_crtc *crtc;
2179 struct intel_crtc *intel_crtc;
2180 int sr_hdisplay = 0;
2181 unsigned long planea_clock = 0, planeb_clock = 0, sr_clock = 0;
2182 int enabled = 0, pixel_size = 0;
2183
2184 if (DSPARB_HWCONTROL(dev))
2185 return;
2186
2187 /* Get the clock config from both planes */
2188 list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) {
2189 intel_crtc = to_intel_crtc(crtc);
2190 if (crtc->enabled) {
2191 enabled++;
2192 if (intel_crtc->plane == 0) {
2193 DRM_DEBUG("plane A (pipe %d) clock: %d\n",
2194 intel_crtc->pipe, crtc->mode.clock);
2195 planea_clock = crtc->mode.clock;
2196 } else {
2197 DRM_DEBUG("plane B (pipe %d) clock: %d\n",
2198 intel_crtc->pipe, crtc->mode.clock);
2199 planeb_clock = crtc->mode.clock;
2200 }
2201 sr_hdisplay = crtc->mode.hdisplay;
2202 sr_clock = crtc->mode.clock;
2203 if (crtc->fb)
2204 pixel_size = crtc->fb->bits_per_pixel / 8;
2205 else
2206 pixel_size = 4; /* by default */
2207 }
2208 }
2209
2210 if (enabled <= 0)
2211 return;
2212
2213 /* Single plane configs can enable self refresh */
2214 if (enabled == 1 && IS_IGD(dev))
2215 igd_enable_cxsr(dev, sr_clock, pixel_size);
2216 else if (IS_IGD(dev))
2217 igd_disable_cxsr(dev);
2218
2219 if (IS_I965G(dev))
2220 i965_update_wm(dev);
2221 else if (IS_I9XX(dev) || IS_MOBILE(dev))
2222 i9xx_update_wm(dev, planea_clock, planeb_clock, sr_hdisplay,
2223 pixel_size);
2224 else
2225 i830_update_wm(dev, planea_clock, pixel_size);
2226}
2227
1516static int intel_crtc_mode_set(struct drm_crtc *crtc, 2228static int intel_crtc_mode_set(struct drm_crtc *crtc,
1517 struct drm_display_mode *mode, 2229 struct drm_display_mode *mode,
1518 struct drm_display_mode *adjusted_mode, 2230 struct drm_display_mode *adjusted_mode,
@@ -1541,7 +2253,8 @@ static int intel_crtc_mode_set(struct drm_crtc *crtc,
1541 intel_clock_t clock; 2253 intel_clock_t clock;
1542 u32 dpll = 0, fp = 0, dspcntr, pipeconf; 2254 u32 dpll = 0, fp = 0, dspcntr, pipeconf;
1543 bool ok, is_sdvo = false, is_dvo = false; 2255 bool ok, is_sdvo = false, is_dvo = false;
1544 bool is_crt = false, is_lvds = false, is_tv = false; 2256 bool is_crt = false, is_lvds = false, is_tv = false, is_dp = false;
2257 bool is_edp = false;
1545 struct drm_mode_config *mode_config = &dev->mode_config; 2258 struct drm_mode_config *mode_config = &dev->mode_config;
1546 struct drm_connector *connector; 2259 struct drm_connector *connector;
1547 const intel_limit_t *limit; 2260 const intel_limit_t *limit;
@@ -1557,6 +2270,7 @@ static int intel_crtc_mode_set(struct drm_crtc *crtc,
1557 int lvds_reg = LVDS; 2270 int lvds_reg = LVDS;
1558 u32 temp; 2271 u32 temp;
1559 int sdvo_pixel_multiply; 2272 int sdvo_pixel_multiply;
2273 int target_clock;
1560 2274
1561 drm_vblank_pre_modeset(dev, pipe); 2275 drm_vblank_pre_modeset(dev, pipe);
1562 2276
@@ -1585,6 +2299,12 @@ static int intel_crtc_mode_set(struct drm_crtc *crtc,
1585 case INTEL_OUTPUT_ANALOG: 2299 case INTEL_OUTPUT_ANALOG:
1586 is_crt = true; 2300 is_crt = true;
1587 break; 2301 break;
2302 case INTEL_OUTPUT_DISPLAYPORT:
2303 is_dp = true;
2304 break;
2305 case INTEL_OUTPUT_EDP:
2306 is_edp = true;
2307 break;
1588 } 2308 }
1589 2309
1590 num_outputs++; 2310 num_outputs++;
@@ -1600,6 +2320,7 @@ static int intel_crtc_mode_set(struct drm_crtc *crtc,
1600 } else { 2320 } else {
1601 refclk = 48000; 2321 refclk = 48000;
1602 } 2322 }
2323
1603 2324
1604 /* 2325 /*
1605 * Returns a set of divisors for the desired target clock with the given 2326 * Returns a set of divisors for the desired target clock with the given
@@ -1635,11 +2356,29 @@ static int intel_crtc_mode_set(struct drm_crtc *crtc,
1635 } 2356 }
1636 2357
1637 /* FDI link */ 2358 /* FDI link */
1638 if (IS_IGDNG(dev)) 2359 if (IS_IGDNG(dev)) {
1639 igdng_compute_m_n(3, 4, /* lane num 4 */ 2360 int lane, link_bw;
1640 adjusted_mode->clock, 2361 /* eDP doesn't require FDI link, so just set DP M/N
1641 270000, /* lane clock */ 2362 according to current link config */
1642 &m_n); 2363 if (is_edp) {
2364 struct drm_connector *edp;
2365 target_clock = mode->clock;
2366 edp = intel_pipe_get_output(crtc);
2367 intel_edp_link_config(to_intel_output(edp),
2368 &lane, &link_bw);
2369 } else {
2370 /* DP over FDI requires target mode clock
2371 instead of link clock */
2372 if (is_dp)
2373 target_clock = mode->clock;
2374 else
2375 target_clock = adjusted_mode->clock;
2376 lane = 4;
2377 link_bw = 270000;
2378 }
2379 igdng_compute_m_n(3, lane, target_clock,
2380 link_bw, &m_n);
2381 }
1643 2382
1644 if (IS_IGD(dev)) 2383 if (IS_IGD(dev))
1645 fp = (1 << clock.n) << 16 | clock.m1 << 8 | clock.m2; 2384 fp = (1 << clock.n) << 16 | clock.m1 << 8 | clock.m2;
@@ -1662,6 +2401,8 @@ static int intel_crtc_mode_set(struct drm_crtc *crtc,
1662 else if (IS_IGDNG(dev)) 2401 else if (IS_IGDNG(dev))
1663 dpll |= (sdvo_pixel_multiply - 1) << PLL_REF_SDVO_HDMI_MULTIPLIER_SHIFT; 2402 dpll |= (sdvo_pixel_multiply - 1) << PLL_REF_SDVO_HDMI_MULTIPLIER_SHIFT;
1664 } 2403 }
2404 if (is_dp)
2405 dpll |= DPLL_DVO_HIGH_SPEED;
1665 2406
1666 /* compute bitmask from p1 value */ 2407 /* compute bitmask from p1 value */
1667 if (IS_IGD(dev)) 2408 if (IS_IGD(dev))
@@ -1758,29 +2499,15 @@ static int intel_crtc_mode_set(struct drm_crtc *crtc,
1758 dpll_reg = pch_dpll_reg; 2499 dpll_reg = pch_dpll_reg;
1759 } 2500 }
1760 2501
1761 if (dpll & DPLL_VCO_ENABLE) { 2502 if (is_edp) {
2503 igdng_disable_pll_edp(crtc);
2504 } else if ((dpll & DPLL_VCO_ENABLE)) {
1762 I915_WRITE(fp_reg, fp); 2505 I915_WRITE(fp_reg, fp);
1763 I915_WRITE(dpll_reg, dpll & ~DPLL_VCO_ENABLE); 2506 I915_WRITE(dpll_reg, dpll & ~DPLL_VCO_ENABLE);
1764 I915_READ(dpll_reg); 2507 I915_READ(dpll_reg);
1765 udelay(150); 2508 udelay(150);
1766 } 2509 }
1767 2510
1768 if (IS_IGDNG(dev)) {
1769 /* enable PCH clock reference source */
1770 /* XXX need to change the setting for other outputs */
1771 u32 temp;
1772 temp = I915_READ(PCH_DREF_CONTROL);
1773 temp &= ~DREF_NONSPREAD_SOURCE_MASK;
1774 temp |= DREF_NONSPREAD_CK505_ENABLE;
1775 temp &= ~DREF_SSC_SOURCE_MASK;
1776 temp |= DREF_SSC_SOURCE_ENABLE;
1777 temp &= ~DREF_SSC1_ENABLE;
1778 /* if no eDP, disable source output to CPU */
1779 temp &= ~DREF_CPU_SOURCE_OUTPUT_MASK;
1780 temp |= DREF_CPU_SOURCE_OUTPUT_DISABLE;
1781 I915_WRITE(PCH_DREF_CONTROL, temp);
1782 }
1783
1784 /* The LVDS pin pair needs to be on before the DPLLs are enabled. 2511 /* The LVDS pin pair needs to be on before the DPLLs are enabled.
1785 * This is an exception to the general rule that mode_set doesn't turn 2512 * This is an exception to the general rule that mode_set doesn't turn
1786 * things on. 2513 * things on.
@@ -1809,24 +2536,28 @@ static int intel_crtc_mode_set(struct drm_crtc *crtc,
1809 I915_WRITE(lvds_reg, lvds); 2536 I915_WRITE(lvds_reg, lvds);
1810 I915_READ(lvds_reg); 2537 I915_READ(lvds_reg);
1811 } 2538 }
2539 if (is_dp)
2540 intel_dp_set_m_n(crtc, mode, adjusted_mode);
1812 2541
1813 I915_WRITE(fp_reg, fp); 2542 if (!is_edp) {
1814 I915_WRITE(dpll_reg, dpll); 2543 I915_WRITE(fp_reg, fp);
1815 I915_READ(dpll_reg);
1816 /* Wait for the clocks to stabilize. */
1817 udelay(150);
1818
1819 if (IS_I965G(dev) && !IS_IGDNG(dev)) {
1820 sdvo_pixel_multiply = adjusted_mode->clock / mode->clock;
1821 I915_WRITE(dpll_md_reg, (0 << DPLL_MD_UDI_DIVIDER_SHIFT) |
1822 ((sdvo_pixel_multiply - 1) << DPLL_MD_UDI_MULTIPLIER_SHIFT));
1823 } else {
1824 /* write it again -- the BIOS does, after all */
1825 I915_WRITE(dpll_reg, dpll); 2544 I915_WRITE(dpll_reg, dpll);
2545 I915_READ(dpll_reg);
2546 /* Wait for the clocks to stabilize. */
2547 udelay(150);
2548
2549 if (IS_I965G(dev) && !IS_IGDNG(dev)) {
2550 sdvo_pixel_multiply = adjusted_mode->clock / mode->clock;
2551 I915_WRITE(dpll_md_reg, (0 << DPLL_MD_UDI_DIVIDER_SHIFT) |
2552 ((sdvo_pixel_multiply - 1) << DPLL_MD_UDI_MULTIPLIER_SHIFT));
2553 } else {
2554 /* write it again -- the BIOS does, after all */
2555 I915_WRITE(dpll_reg, dpll);
2556 }
2557 I915_READ(dpll_reg);
2558 /* Wait for the clocks to stabilize. */
2559 udelay(150);
1826 } 2560 }
1827 I915_READ(dpll_reg);
1828 /* Wait for the clocks to stabilize. */
1829 udelay(150);
1830 2561
1831 I915_WRITE(htot_reg, (adjusted_mode->crtc_hdisplay - 1) | 2562 I915_WRITE(htot_reg, (adjusted_mode->crtc_hdisplay - 1) |
1832 ((adjusted_mode->crtc_htotal - 1) << 16)); 2563 ((adjusted_mode->crtc_htotal - 1) << 16));
@@ -1856,10 +2587,14 @@ static int intel_crtc_mode_set(struct drm_crtc *crtc,
1856 I915_WRITE(link_m1_reg, m_n.link_m); 2587 I915_WRITE(link_m1_reg, m_n.link_m);
1857 I915_WRITE(link_n1_reg, m_n.link_n); 2588 I915_WRITE(link_n1_reg, m_n.link_n);
1858 2589
1859 /* enable FDI RX PLL too */ 2590 if (is_edp) {
1860 temp = I915_READ(fdi_rx_reg); 2591 igdng_set_pll_edp(crtc, adjusted_mode->clock);
1861 I915_WRITE(fdi_rx_reg, temp | FDI_RX_PLL_ENABLE); 2592 } else {
1862 udelay(200); 2593 /* enable FDI RX PLL too */
2594 temp = I915_READ(fdi_rx_reg);
2595 I915_WRITE(fdi_rx_reg, temp | FDI_RX_PLL_ENABLE);
2596 udelay(200);
2597 }
1863 } 2598 }
1864 2599
1865 I915_WRITE(pipeconf_reg, pipeconf); 2600 I915_WRITE(pipeconf_reg, pipeconf);
@@ -1871,6 +2606,9 @@ static int intel_crtc_mode_set(struct drm_crtc *crtc,
1871 2606
1872 /* Flush the plane changes */ 2607 /* Flush the plane changes */
1873 ret = intel_pipe_set_base(crtc, x, y, old_fb); 2608 ret = intel_pipe_set_base(crtc, x, y, old_fb);
2609
2610 intel_update_watermarks(dev);
2611
1874 drm_vblank_post_modeset(dev, pipe); 2612 drm_vblank_post_modeset(dev, pipe);
1875 2613
1876 return ret; 2614 return ret;
@@ -2359,6 +3097,7 @@ static void intel_crtc_init(struct drm_device *dev, int pipe)
2359 3097
2360 drm_mode_crtc_set_gamma_size(&intel_crtc->base, 256); 3098 drm_mode_crtc_set_gamma_size(&intel_crtc->base, 256);
2361 intel_crtc->pipe = pipe; 3099 intel_crtc->pipe = pipe;
3100 intel_crtc->plane = pipe;
2362 for (i = 0; i < 256; i++) { 3101 for (i = 0; i < 256; i++) {
2363 intel_crtc->lut_r[i] = i; 3102 intel_crtc->lut_r[i] = i;
2364 intel_crtc->lut_g[i] = i; 3103 intel_crtc->lut_g[i] = i;
@@ -2453,12 +3192,17 @@ static void intel_setup_outputs(struct drm_device *dev)
2453 if (IS_IGDNG(dev)) { 3192 if (IS_IGDNG(dev)) {
2454 int found; 3193 int found;
2455 3194
3195 if (IS_MOBILE(dev) && (I915_READ(DP_A) & DP_DETECTED))
3196 intel_dp_init(dev, DP_A);
3197
2456 if (I915_READ(HDMIB) & PORT_DETECTED) { 3198 if (I915_READ(HDMIB) & PORT_DETECTED) {
2457 /* check SDVOB */ 3199 /* check SDVOB */
2458 /* found = intel_sdvo_init(dev, HDMIB); */ 3200 /* found = intel_sdvo_init(dev, HDMIB); */
2459 found = 0; 3201 found = 0;
2460 if (!found) 3202 if (!found)
2461 intel_hdmi_init(dev, HDMIB); 3203 intel_hdmi_init(dev, HDMIB);
3204 if (!found && (I915_READ(PCH_DP_B) & DP_DETECTED))
3205 intel_dp_init(dev, PCH_DP_B);
2462 } 3206 }
2463 3207
2464 if (I915_READ(HDMIC) & PORT_DETECTED) 3208 if (I915_READ(HDMIC) & PORT_DETECTED)
@@ -2467,6 +3211,12 @@ static void intel_setup_outputs(struct drm_device *dev)
2467 if (I915_READ(HDMID) & PORT_DETECTED) 3211 if (I915_READ(HDMID) & PORT_DETECTED)
2468 intel_hdmi_init(dev, HDMID); 3212 intel_hdmi_init(dev, HDMID);
2469 3213
3214 if (I915_READ(PCH_DP_C) & DP_DETECTED)
3215 intel_dp_init(dev, PCH_DP_C);
3216
3217 if (I915_READ(PCH_DP_D) & DP_DETECTED)
3218 intel_dp_init(dev, PCH_DP_D);
3219
2470 } else if (IS_I9XX(dev)) { 3220 } else if (IS_I9XX(dev)) {
2471 int found; 3221 int found;
2472 u32 reg; 3222 u32 reg;
@@ -2475,6 +3225,8 @@ static void intel_setup_outputs(struct drm_device *dev)
2475 found = intel_sdvo_init(dev, SDVOB); 3225 found = intel_sdvo_init(dev, SDVOB);
2476 if (!found && SUPPORTS_INTEGRATED_HDMI(dev)) 3226 if (!found && SUPPORTS_INTEGRATED_HDMI(dev))
2477 intel_hdmi_init(dev, SDVOB); 3227 intel_hdmi_init(dev, SDVOB);
3228 if (!found && SUPPORTS_INTEGRATED_DP(dev))
3229 intel_dp_init(dev, DP_B);
2478 } 3230 }
2479 3231
2480 /* Before G4X SDVOC doesn't have its own detect register */ 3232 /* Before G4X SDVOC doesn't have its own detect register */
@@ -2487,7 +3239,11 @@ static void intel_setup_outputs(struct drm_device *dev)
2487 found = intel_sdvo_init(dev, SDVOC); 3239 found = intel_sdvo_init(dev, SDVOC);
2488 if (!found && SUPPORTS_INTEGRATED_HDMI(dev)) 3240 if (!found && SUPPORTS_INTEGRATED_HDMI(dev))
2489 intel_hdmi_init(dev, SDVOC); 3241 intel_hdmi_init(dev, SDVOC);
3242 if (!found && SUPPORTS_INTEGRATED_DP(dev))
3243 intel_dp_init(dev, DP_C);
2490 } 3244 }
3245 if (SUPPORTS_INTEGRATED_DP(dev) && (I915_READ(DP_D) & DP_DETECTED))
3246 intel_dp_init(dev, DP_D);
2491 } else 3247 } else
2492 intel_dvo_init(dev); 3248 intel_dvo_init(dev);
2493 3249
@@ -2530,6 +3286,15 @@ static void intel_setup_outputs(struct drm_device *dev)
2530 (1 << 1)); 3286 (1 << 1));
2531 clone_mask = (1 << INTEL_OUTPUT_TVOUT); 3287 clone_mask = (1 << INTEL_OUTPUT_TVOUT);
2532 break; 3288 break;
3289 case INTEL_OUTPUT_DISPLAYPORT:
3290 crtc_mask = ((1 << 0) |
3291 (1 << 1));
3292 clone_mask = (1 << INTEL_OUTPUT_DISPLAYPORT);
3293 break;
3294 case INTEL_OUTPUT_EDP:
3295 crtc_mask = (1 << 1);
3296 clone_mask = (1 << INTEL_OUTPUT_EDP);
3297 break;
2533 } 3298 }
2534 encoder->possible_crtcs = crtc_mask; 3299 encoder->possible_crtcs = crtc_mask;
2535 encoder->possible_clones = intel_connector_clones(dev, clone_mask); 3300 encoder->possible_clones = intel_connector_clones(dev, clone_mask);
@@ -2639,6 +3404,9 @@ void intel_modeset_init(struct drm_device *dev)
2639 if (IS_I965G(dev)) { 3404 if (IS_I965G(dev)) {
2640 dev->mode_config.max_width = 8192; 3405 dev->mode_config.max_width = 8192;
2641 dev->mode_config.max_height = 8192; 3406 dev->mode_config.max_height = 8192;
3407 } else if (IS_I9XX(dev)) {
3408 dev->mode_config.max_width = 4096;
3409 dev->mode_config.max_height = 4096;
2642 } else { 3410 } else {
2643 dev->mode_config.max_width = 2048; 3411 dev->mode_config.max_width = 2048;
2644 dev->mode_config.max_height = 2048; 3412 dev->mode_config.max_height = 2048;
diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
new file mode 100644
index 000000000000..a6ff15ac548a
--- /dev/null
+++ b/drivers/gpu/drm/i915/intel_dp.c
@@ -0,0 +1,1318 @@
1/*
2 * Copyright © 2008 Intel Corporation
3 *
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
10 *
11 * The above copyright notice and this permission notice (including the next
12 * paragraph) shall be included in all copies or substantial portions of the
13 * Software.
14 *
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
18 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
20 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
21 * IN THE SOFTWARE.
22 *
23 * Authors:
24 * Keith Packard <keithp@keithp.com>
25 *
26 */
27
28#include <linux/i2c.h>
29#include "drmP.h"
30#include "drm.h"
31#include "drm_crtc.h"
32#include "drm_crtc_helper.h"
33#include "intel_drv.h"
34#include "i915_drm.h"
35#include "i915_drv.h"
36#include "intel_dp.h"
37
38#define DP_LINK_STATUS_SIZE 6
39#define DP_LINK_CHECK_TIMEOUT (10 * 1000)
40
41#define DP_LINK_CONFIGURATION_SIZE 9
42
43#define IS_eDP(i) ((i)->type == INTEL_OUTPUT_EDP)
44
45struct intel_dp_priv {
46 uint32_t output_reg;
47 uint32_t DP;
48 uint8_t link_configuration[DP_LINK_CONFIGURATION_SIZE];
49 uint32_t save_DP;
50 uint8_t save_link_configuration[DP_LINK_CONFIGURATION_SIZE];
51 bool has_audio;
52 int dpms_mode;
53 uint8_t link_bw;
54 uint8_t lane_count;
55 uint8_t dpcd[4];
56 struct intel_output *intel_output;
57 struct i2c_adapter adapter;
58 struct i2c_algo_dp_aux_data algo;
59};
60
61static void
62intel_dp_link_train(struct intel_output *intel_output, uint32_t DP,
63 uint8_t link_configuration[DP_LINK_CONFIGURATION_SIZE]);
64
65static void
66intel_dp_link_down(struct intel_output *intel_output, uint32_t DP);
67
68void
69intel_edp_link_config (struct intel_output *intel_output,
70 int *lane_num, int *link_bw)
71{
72 struct intel_dp_priv *dp_priv = intel_output->dev_priv;
73
74 *lane_num = dp_priv->lane_count;
75 if (dp_priv->link_bw == DP_LINK_BW_1_62)
76 *link_bw = 162000;
77 else if (dp_priv->link_bw == DP_LINK_BW_2_7)
78 *link_bw = 270000;
79}
80
81static int
82intel_dp_max_lane_count(struct intel_output *intel_output)
83{
84 struct intel_dp_priv *dp_priv = intel_output->dev_priv;
85 int max_lane_count = 4;
86
87 if (dp_priv->dpcd[0] >= 0x11) {
88 max_lane_count = dp_priv->dpcd[2] & 0x1f;
89 switch (max_lane_count) {
90 case 1: case 2: case 4:
91 break;
92 default:
93 max_lane_count = 4;
94 }
95 }
96 return max_lane_count;
97}
98
99static int
100intel_dp_max_link_bw(struct intel_output *intel_output)
101{
102 struct intel_dp_priv *dp_priv = intel_output->dev_priv;
103 int max_link_bw = dp_priv->dpcd[1];
104
105 switch (max_link_bw) {
106 case DP_LINK_BW_1_62:
107 case DP_LINK_BW_2_7:
108 break;
109 default:
110 max_link_bw = DP_LINK_BW_1_62;
111 break;
112 }
113 return max_link_bw;
114}
115
116static int
117intel_dp_link_clock(uint8_t link_bw)
118{
119 if (link_bw == DP_LINK_BW_2_7)
120 return 270000;
121 else
122 return 162000;
123}
124
125/* I think this is a fiction */
126static int
127intel_dp_link_required(int pixel_clock)
128{
129 return pixel_clock * 3;
130}
131
132static int
133intel_dp_mode_valid(struct drm_connector *connector,
134 struct drm_display_mode *mode)
135{
136 struct intel_output *intel_output = to_intel_output(connector);
137 int max_link_clock = intel_dp_link_clock(intel_dp_max_link_bw(intel_output));
138 int max_lanes = intel_dp_max_lane_count(intel_output);
139
140 if (intel_dp_link_required(mode->clock) > max_link_clock * max_lanes)
141 return MODE_CLOCK_HIGH;
142
143 if (mode->clock < 10000)
144 return MODE_CLOCK_LOW;
145
146 return MODE_OK;
147}
148
149static uint32_t
150pack_aux(uint8_t *src, int src_bytes)
151{
152 int i;
153 uint32_t v = 0;
154
155 if (src_bytes > 4)
156 src_bytes = 4;
157 for (i = 0; i < src_bytes; i++)
158 v |= ((uint32_t) src[i]) << ((3-i) * 8);
159 return v;
160}
161
162static void
163unpack_aux(uint32_t src, uint8_t *dst, int dst_bytes)
164{
165 int i;
166 if (dst_bytes > 4)
167 dst_bytes = 4;
168 for (i = 0; i < dst_bytes; i++)
169 dst[i] = src >> ((3-i) * 8);
170}
171
172/* hrawclock is 1/4 the FSB frequency */
173static int
174intel_hrawclk(struct drm_device *dev)
175{
176 struct drm_i915_private *dev_priv = dev->dev_private;
177 uint32_t clkcfg;
178
179 clkcfg = I915_READ(CLKCFG);
180 switch (clkcfg & CLKCFG_FSB_MASK) {
181 case CLKCFG_FSB_400:
182 return 100;
183 case CLKCFG_FSB_533:
184 return 133;
185 case CLKCFG_FSB_667:
186 return 166;
187 case CLKCFG_FSB_800:
188 return 200;
189 case CLKCFG_FSB_1067:
190 return 266;
191 case CLKCFG_FSB_1333:
192 return 333;
193 /* these two are just a guess; one of them might be right */
194 case CLKCFG_FSB_1600:
195 case CLKCFG_FSB_1600_ALT:
196 return 400;
197 default:
198 return 133;
199 }
200}
201
202static int
203intel_dp_aux_ch(struct intel_output *intel_output,
204 uint8_t *send, int send_bytes,
205 uint8_t *recv, int recv_size)
206{
207 struct intel_dp_priv *dp_priv = intel_output->dev_priv;
208 uint32_t output_reg = dp_priv->output_reg;
209 struct drm_device *dev = intel_output->base.dev;
210 struct drm_i915_private *dev_priv = dev->dev_private;
211 uint32_t ch_ctl = output_reg + 0x10;
212 uint32_t ch_data = ch_ctl + 4;
213 int i;
214 int recv_bytes;
215 uint32_t ctl;
216 uint32_t status;
217 uint32_t aux_clock_divider;
218 int try;
219
220 /* The clock divider is based off the hrawclk,
221 * and would like to run at 2MHz. So, take the
222 * hrawclk value and divide by 2 and use that
223 */
224 if (IS_eDP(intel_output))
225 aux_clock_divider = 225; /* eDP input clock at 450Mhz */
226 else if (IS_IGDNG(dev))
227 aux_clock_divider = 62; /* IGDNG: input clock fixed at 125Mhz */
228 else
229 aux_clock_divider = intel_hrawclk(dev) / 2;
230
231 /* Must try at least 3 times according to DP spec */
232 for (try = 0; try < 5; try++) {
233 /* Load the send data into the aux channel data registers */
234 for (i = 0; i < send_bytes; i += 4) {
235 uint32_t d = pack_aux(send + i, send_bytes - i);;
236
237 I915_WRITE(ch_data + i, d);
238 }
239
240 ctl = (DP_AUX_CH_CTL_SEND_BUSY |
241 DP_AUX_CH_CTL_TIME_OUT_400us |
242 (send_bytes << DP_AUX_CH_CTL_MESSAGE_SIZE_SHIFT) |
243 (5 << DP_AUX_CH_CTL_PRECHARGE_2US_SHIFT) |
244 (aux_clock_divider << DP_AUX_CH_CTL_BIT_CLOCK_2X_SHIFT) |
245 DP_AUX_CH_CTL_DONE |
246 DP_AUX_CH_CTL_TIME_OUT_ERROR |
247 DP_AUX_CH_CTL_RECEIVE_ERROR);
248
249 /* Send the command and wait for it to complete */
250 I915_WRITE(ch_ctl, ctl);
251 (void) I915_READ(ch_ctl);
252 for (;;) {
253 udelay(100);
254 status = I915_READ(ch_ctl);
255 if ((status & DP_AUX_CH_CTL_SEND_BUSY) == 0)
256 break;
257 }
258
259 /* Clear done status and any errors */
260 I915_WRITE(ch_ctl, (status |
261 DP_AUX_CH_CTL_DONE |
262 DP_AUX_CH_CTL_TIME_OUT_ERROR |
263 DP_AUX_CH_CTL_RECEIVE_ERROR));
264 (void) I915_READ(ch_ctl);
265 if ((status & DP_AUX_CH_CTL_TIME_OUT_ERROR) == 0)
266 break;
267 }
268
269 if ((status & DP_AUX_CH_CTL_DONE) == 0) {
270 DRM_ERROR("dp_aux_ch not done status 0x%08x\n", status);
271 return -EBUSY;
272 }
273
274 /* Check for timeout or receive error.
275 * Timeouts occur when the sink is not connected
276 */
277 if (status & DP_AUX_CH_CTL_RECEIVE_ERROR) {
278 DRM_ERROR("dp_aux_ch receive error status 0x%08x\n", status);
279 return -EIO;
280 }
281
282 /* Timeouts occur when the device isn't connected, so they're
283 * "normal" -- don't fill the kernel log with these */
284 if (status & DP_AUX_CH_CTL_TIME_OUT_ERROR) {
285 DRM_DEBUG("dp_aux_ch timeout status 0x%08x\n", status);
286 return -ETIMEDOUT;
287 }
288
289 /* Unload any bytes sent back from the other side */
290 recv_bytes = ((status & DP_AUX_CH_CTL_MESSAGE_SIZE_MASK) >>
291 DP_AUX_CH_CTL_MESSAGE_SIZE_SHIFT);
292
293 if (recv_bytes > recv_size)
294 recv_bytes = recv_size;
295
296 for (i = 0; i < recv_bytes; i += 4) {
297 uint32_t d = I915_READ(ch_data + i);
298
299 unpack_aux(d, recv + i, recv_bytes - i);
300 }
301
302 return recv_bytes;
303}
304
305/* Write data to the aux channel in native mode */
306static int
307intel_dp_aux_native_write(struct intel_output *intel_output,
308 uint16_t address, uint8_t *send, int send_bytes)
309{
310 int ret;
311 uint8_t msg[20];
312 int msg_bytes;
313 uint8_t ack;
314
315 if (send_bytes > 16)
316 return -1;
317 msg[0] = AUX_NATIVE_WRITE << 4;
318 msg[1] = address >> 8;
319 msg[2] = address & 0xff;
320 msg[3] = send_bytes - 1;
321 memcpy(&msg[4], send, send_bytes);
322 msg_bytes = send_bytes + 4;
323 for (;;) {
324 ret = intel_dp_aux_ch(intel_output, msg, msg_bytes, &ack, 1);
325 if (ret < 0)
326 return ret;
327 if ((ack & AUX_NATIVE_REPLY_MASK) == AUX_NATIVE_REPLY_ACK)
328 break;
329 else if ((ack & AUX_NATIVE_REPLY_MASK) == AUX_NATIVE_REPLY_DEFER)
330 udelay(100);
331 else
332 return -EIO;
333 }
334 return send_bytes;
335}
336
337/* Write a single byte to the aux channel in native mode */
338static int
339intel_dp_aux_native_write_1(struct intel_output *intel_output,
340 uint16_t address, uint8_t byte)
341{
342 return intel_dp_aux_native_write(intel_output, address, &byte, 1);
343}
344
345/* read bytes from a native aux channel */
346static int
347intel_dp_aux_native_read(struct intel_output *intel_output,
348 uint16_t address, uint8_t *recv, int recv_bytes)
349{
350 uint8_t msg[4];
351 int msg_bytes;
352 uint8_t reply[20];
353 int reply_bytes;
354 uint8_t ack;
355 int ret;
356
357 msg[0] = AUX_NATIVE_READ << 4;
358 msg[1] = address >> 8;
359 msg[2] = address & 0xff;
360 msg[3] = recv_bytes - 1;
361
362 msg_bytes = 4;
363 reply_bytes = recv_bytes + 1;
364
365 for (;;) {
366 ret = intel_dp_aux_ch(intel_output, msg, msg_bytes,
367 reply, reply_bytes);
368 if (ret == 0)
369 return -EPROTO;
370 if (ret < 0)
371 return ret;
372 ack = reply[0];
373 if ((ack & AUX_NATIVE_REPLY_MASK) == AUX_NATIVE_REPLY_ACK) {
374 memcpy(recv, reply + 1, ret - 1);
375 return ret - 1;
376 }
377 else if ((ack & AUX_NATIVE_REPLY_MASK) == AUX_NATIVE_REPLY_DEFER)
378 udelay(100);
379 else
380 return -EIO;
381 }
382}
383
384static int
385intel_dp_i2c_aux_ch(struct i2c_adapter *adapter,
386 uint8_t *send, int send_bytes,
387 uint8_t *recv, int recv_bytes)
388{
389 struct intel_dp_priv *dp_priv = container_of(adapter,
390 struct intel_dp_priv,
391 adapter);
392 struct intel_output *intel_output = dp_priv->intel_output;
393
394 return intel_dp_aux_ch(intel_output,
395 send, send_bytes, recv, recv_bytes);
396}
397
398static int
399intel_dp_i2c_init(struct intel_output *intel_output, const char *name)
400{
401 struct intel_dp_priv *dp_priv = intel_output->dev_priv;
402
403 DRM_ERROR("i2c_init %s\n", name);
404 dp_priv->algo.running = false;
405 dp_priv->algo.address = 0;
406 dp_priv->algo.aux_ch = intel_dp_i2c_aux_ch;
407
408 memset(&dp_priv->adapter, '\0', sizeof (dp_priv->adapter));
409 dp_priv->adapter.owner = THIS_MODULE;
410 dp_priv->adapter.class = I2C_CLASS_DDC;
411 strncpy (dp_priv->adapter.name, name, sizeof(dp_priv->adapter.name) - 1);
412 dp_priv->adapter.name[sizeof(dp_priv->adapter.name) - 1] = '\0';
413 dp_priv->adapter.algo_data = &dp_priv->algo;
414 dp_priv->adapter.dev.parent = &intel_output->base.kdev;
415
416 return i2c_dp_aux_add_bus(&dp_priv->adapter);
417}
418
419static bool
420intel_dp_mode_fixup(struct drm_encoder *encoder, struct drm_display_mode *mode,
421 struct drm_display_mode *adjusted_mode)
422{
423 struct intel_output *intel_output = enc_to_intel_output(encoder);
424 struct intel_dp_priv *dp_priv = intel_output->dev_priv;
425 int lane_count, clock;
426 int max_lane_count = intel_dp_max_lane_count(intel_output);
427 int max_clock = intel_dp_max_link_bw(intel_output) == DP_LINK_BW_2_7 ? 1 : 0;
428 static int bws[2] = { DP_LINK_BW_1_62, DP_LINK_BW_2_7 };
429
430 for (lane_count = 1; lane_count <= max_lane_count; lane_count <<= 1) {
431 for (clock = 0; clock <= max_clock; clock++) {
432 int link_avail = intel_dp_link_clock(bws[clock]) * lane_count;
433
434 if (intel_dp_link_required(mode->clock) <= link_avail) {
435 dp_priv->link_bw = bws[clock];
436 dp_priv->lane_count = lane_count;
437 adjusted_mode->clock = intel_dp_link_clock(dp_priv->link_bw);
438 DRM_DEBUG("Display port link bw %02x lane count %d clock %d\n",
439 dp_priv->link_bw, dp_priv->lane_count,
440 adjusted_mode->clock);
441 return true;
442 }
443 }
444 }
445 return false;
446}
447
448struct intel_dp_m_n {
449 uint32_t tu;
450 uint32_t gmch_m;
451 uint32_t gmch_n;
452 uint32_t link_m;
453 uint32_t link_n;
454};
455
456static void
457intel_reduce_ratio(uint32_t *num, uint32_t *den)
458{
459 while (*num > 0xffffff || *den > 0xffffff) {
460 *num >>= 1;
461 *den >>= 1;
462 }
463}
464
465static void
466intel_dp_compute_m_n(int bytes_per_pixel,
467 int nlanes,
468 int pixel_clock,
469 int link_clock,
470 struct intel_dp_m_n *m_n)
471{
472 m_n->tu = 64;
473 m_n->gmch_m = pixel_clock * bytes_per_pixel;
474 m_n->gmch_n = link_clock * nlanes;
475 intel_reduce_ratio(&m_n->gmch_m, &m_n->gmch_n);
476 m_n->link_m = pixel_clock;
477 m_n->link_n = link_clock;
478 intel_reduce_ratio(&m_n->link_m, &m_n->link_n);
479}
480
481void
482intel_dp_set_m_n(struct drm_crtc *crtc, struct drm_display_mode *mode,
483 struct drm_display_mode *adjusted_mode)
484{
485 struct drm_device *dev = crtc->dev;
486 struct drm_mode_config *mode_config = &dev->mode_config;
487 struct drm_connector *connector;
488 struct drm_i915_private *dev_priv = dev->dev_private;
489 struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
490 int lane_count = 4;
491 struct intel_dp_m_n m_n;
492
493 /*
494 * Find the lane count in the intel_output private
495 */
496 list_for_each_entry(connector, &mode_config->connector_list, head) {
497 struct intel_output *intel_output = to_intel_output(connector);
498 struct intel_dp_priv *dp_priv = intel_output->dev_priv;
499
500 if (!connector->encoder || connector->encoder->crtc != crtc)
501 continue;
502
503 if (intel_output->type == INTEL_OUTPUT_DISPLAYPORT) {
504 lane_count = dp_priv->lane_count;
505 break;
506 }
507 }
508
509 /*
510 * Compute the GMCH and Link ratios. The '3' here is
511 * the number of bytes_per_pixel post-LUT, which we always
512 * set up for 8-bits of R/G/B, or 3 bytes total.
513 */
514 intel_dp_compute_m_n(3, lane_count,
515 mode->clock, adjusted_mode->clock, &m_n);
516
517 if (IS_IGDNG(dev)) {
518 if (intel_crtc->pipe == 0) {
519 I915_WRITE(TRANSA_DATA_M1,
520 ((m_n.tu - 1) << PIPE_GMCH_DATA_M_TU_SIZE_SHIFT) |
521 m_n.gmch_m);
522 I915_WRITE(TRANSA_DATA_N1, m_n.gmch_n);
523 I915_WRITE(TRANSA_DP_LINK_M1, m_n.link_m);
524 I915_WRITE(TRANSA_DP_LINK_N1, m_n.link_n);
525 } else {
526 I915_WRITE(TRANSB_DATA_M1,
527 ((m_n.tu - 1) << PIPE_GMCH_DATA_M_TU_SIZE_SHIFT) |
528 m_n.gmch_m);
529 I915_WRITE(TRANSB_DATA_N1, m_n.gmch_n);
530 I915_WRITE(TRANSB_DP_LINK_M1, m_n.link_m);
531 I915_WRITE(TRANSB_DP_LINK_N1, m_n.link_n);
532 }
533 } else {
534 if (intel_crtc->pipe == 0) {
535 I915_WRITE(PIPEA_GMCH_DATA_M,
536 ((m_n.tu - 1) << PIPE_GMCH_DATA_M_TU_SIZE_SHIFT) |
537 m_n.gmch_m);
538 I915_WRITE(PIPEA_GMCH_DATA_N,
539 m_n.gmch_n);
540 I915_WRITE(PIPEA_DP_LINK_M, m_n.link_m);
541 I915_WRITE(PIPEA_DP_LINK_N, m_n.link_n);
542 } else {
543 I915_WRITE(PIPEB_GMCH_DATA_M,
544 ((m_n.tu - 1) << PIPE_GMCH_DATA_M_TU_SIZE_SHIFT) |
545 m_n.gmch_m);
546 I915_WRITE(PIPEB_GMCH_DATA_N,
547 m_n.gmch_n);
548 I915_WRITE(PIPEB_DP_LINK_M, m_n.link_m);
549 I915_WRITE(PIPEB_DP_LINK_N, m_n.link_n);
550 }
551 }
552}
553
554static void
555intel_dp_mode_set(struct drm_encoder *encoder, struct drm_display_mode *mode,
556 struct drm_display_mode *adjusted_mode)
557{
558 struct intel_output *intel_output = enc_to_intel_output(encoder);
559 struct intel_dp_priv *dp_priv = intel_output->dev_priv;
560 struct drm_crtc *crtc = intel_output->enc.crtc;
561 struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
562
563 dp_priv->DP = (DP_LINK_TRAIN_OFF |
564 DP_VOLTAGE_0_4 |
565 DP_PRE_EMPHASIS_0 |
566 DP_SYNC_VS_HIGH |
567 DP_SYNC_HS_HIGH);
568
569 switch (dp_priv->lane_count) {
570 case 1:
571 dp_priv->DP |= DP_PORT_WIDTH_1;
572 break;
573 case 2:
574 dp_priv->DP |= DP_PORT_WIDTH_2;
575 break;
576 case 4:
577 dp_priv->DP |= DP_PORT_WIDTH_4;
578 break;
579 }
580 if (dp_priv->has_audio)
581 dp_priv->DP |= DP_AUDIO_OUTPUT_ENABLE;
582
583 memset(dp_priv->link_configuration, 0, DP_LINK_CONFIGURATION_SIZE);
584 dp_priv->link_configuration[0] = dp_priv->link_bw;
585 dp_priv->link_configuration[1] = dp_priv->lane_count;
586
587 /*
588 * Check for DPCD version > 1.1,
589 * enable enahanced frame stuff in that case
590 */
591 if (dp_priv->dpcd[0] >= 0x11) {
592 dp_priv->link_configuration[1] |= DP_LANE_COUNT_ENHANCED_FRAME_EN;
593 dp_priv->DP |= DP_ENHANCED_FRAMING;
594 }
595
596 if (intel_crtc->pipe == 1)
597 dp_priv->DP |= DP_PIPEB_SELECT;
598
599 if (IS_eDP(intel_output)) {
600 /* don't miss out required setting for eDP */
601 dp_priv->DP |= DP_PLL_ENABLE;
602 if (adjusted_mode->clock < 200000)
603 dp_priv->DP |= DP_PLL_FREQ_160MHZ;
604 else
605 dp_priv->DP |= DP_PLL_FREQ_270MHZ;
606 }
607}
608
609static void igdng_edp_backlight_on (struct drm_device *dev)
610{
611 struct drm_i915_private *dev_priv = dev->dev_private;
612 u32 pp;
613
614 DRM_DEBUG("\n");
615 pp = I915_READ(PCH_PP_CONTROL);
616 pp |= EDP_BLC_ENABLE;
617 I915_WRITE(PCH_PP_CONTROL, pp);
618}
619
620static void igdng_edp_backlight_off (struct drm_device *dev)
621{
622 struct drm_i915_private *dev_priv = dev->dev_private;
623 u32 pp;
624
625 DRM_DEBUG("\n");
626 pp = I915_READ(PCH_PP_CONTROL);
627 pp &= ~EDP_BLC_ENABLE;
628 I915_WRITE(PCH_PP_CONTROL, pp);
629}
630
631static void
632intel_dp_dpms(struct drm_encoder *encoder, int mode)
633{
634 struct intel_output *intel_output = enc_to_intel_output(encoder);
635 struct intel_dp_priv *dp_priv = intel_output->dev_priv;
636 struct drm_device *dev = intel_output->base.dev;
637 struct drm_i915_private *dev_priv = dev->dev_private;
638 uint32_t dp_reg = I915_READ(dp_priv->output_reg);
639
640 if (mode != DRM_MODE_DPMS_ON) {
641 if (dp_reg & DP_PORT_EN) {
642 intel_dp_link_down(intel_output, dp_priv->DP);
643 if (IS_eDP(intel_output))
644 igdng_edp_backlight_off(dev);
645 }
646 } else {
647 if (!(dp_reg & DP_PORT_EN)) {
648 intel_dp_link_train(intel_output, dp_priv->DP, dp_priv->link_configuration);
649 if (IS_eDP(intel_output))
650 igdng_edp_backlight_on(dev);
651 }
652 }
653 dp_priv->dpms_mode = mode;
654}
655
656/*
657 * Fetch AUX CH registers 0x202 - 0x207 which contain
658 * link status information
659 */
660static bool
661intel_dp_get_link_status(struct intel_output *intel_output,
662 uint8_t link_status[DP_LINK_STATUS_SIZE])
663{
664 int ret;
665
666 ret = intel_dp_aux_native_read(intel_output,
667 DP_LANE0_1_STATUS,
668 link_status, DP_LINK_STATUS_SIZE);
669 if (ret != DP_LINK_STATUS_SIZE)
670 return false;
671 return true;
672}
673
674static uint8_t
675intel_dp_link_status(uint8_t link_status[DP_LINK_STATUS_SIZE],
676 int r)
677{
678 return link_status[r - DP_LANE0_1_STATUS];
679}
680
681static void
682intel_dp_save(struct drm_connector *connector)
683{
684 struct intel_output *intel_output = to_intel_output(connector);
685 struct drm_device *dev = intel_output->base.dev;
686 struct drm_i915_private *dev_priv = dev->dev_private;
687 struct intel_dp_priv *dp_priv = intel_output->dev_priv;
688
689 dp_priv->save_DP = I915_READ(dp_priv->output_reg);
690 intel_dp_aux_native_read(intel_output, DP_LINK_BW_SET,
691 dp_priv->save_link_configuration,
692 sizeof (dp_priv->save_link_configuration));
693}
694
695static uint8_t
696intel_get_adjust_request_voltage(uint8_t link_status[DP_LINK_STATUS_SIZE],
697 int lane)
698{
699 int i = DP_ADJUST_REQUEST_LANE0_1 + (lane >> 1);
700 int s = ((lane & 1) ?
701 DP_ADJUST_VOLTAGE_SWING_LANE1_SHIFT :
702 DP_ADJUST_VOLTAGE_SWING_LANE0_SHIFT);
703 uint8_t l = intel_dp_link_status(link_status, i);
704
705 return ((l >> s) & 3) << DP_TRAIN_VOLTAGE_SWING_SHIFT;
706}
707
708static uint8_t
709intel_get_adjust_request_pre_emphasis(uint8_t link_status[DP_LINK_STATUS_SIZE],
710 int lane)
711{
712 int i = DP_ADJUST_REQUEST_LANE0_1 + (lane >> 1);
713 int s = ((lane & 1) ?
714 DP_ADJUST_PRE_EMPHASIS_LANE1_SHIFT :
715 DP_ADJUST_PRE_EMPHASIS_LANE0_SHIFT);
716 uint8_t l = intel_dp_link_status(link_status, i);
717
718 return ((l >> s) & 3) << DP_TRAIN_PRE_EMPHASIS_SHIFT;
719}
720
721
722#if 0
723static char *voltage_names[] = {
724 "0.4V", "0.6V", "0.8V", "1.2V"
725};
726static char *pre_emph_names[] = {
727 "0dB", "3.5dB", "6dB", "9.5dB"
728};
729static char *link_train_names[] = {
730 "pattern 1", "pattern 2", "idle", "off"
731};
732#endif
733
734/*
735 * These are source-specific values; current Intel hardware supports
736 * a maximum voltage of 800mV and a maximum pre-emphasis of 6dB
737 */
738#define I830_DP_VOLTAGE_MAX DP_TRAIN_VOLTAGE_SWING_800
739
740static uint8_t
741intel_dp_pre_emphasis_max(uint8_t voltage_swing)
742{
743 switch (voltage_swing & DP_TRAIN_VOLTAGE_SWING_MASK) {
744 case DP_TRAIN_VOLTAGE_SWING_400:
745 return DP_TRAIN_PRE_EMPHASIS_6;
746 case DP_TRAIN_VOLTAGE_SWING_600:
747 return DP_TRAIN_PRE_EMPHASIS_6;
748 case DP_TRAIN_VOLTAGE_SWING_800:
749 return DP_TRAIN_PRE_EMPHASIS_3_5;
750 case DP_TRAIN_VOLTAGE_SWING_1200:
751 default:
752 return DP_TRAIN_PRE_EMPHASIS_0;
753 }
754}
755
756static void
757intel_get_adjust_train(struct intel_output *intel_output,
758 uint8_t link_status[DP_LINK_STATUS_SIZE],
759 int lane_count,
760 uint8_t train_set[4])
761{
762 uint8_t v = 0;
763 uint8_t p = 0;
764 int lane;
765
766 for (lane = 0; lane < lane_count; lane++) {
767 uint8_t this_v = intel_get_adjust_request_voltage(link_status, lane);
768 uint8_t this_p = intel_get_adjust_request_pre_emphasis(link_status, lane);
769
770 if (this_v > v)
771 v = this_v;
772 if (this_p > p)
773 p = this_p;
774 }
775
776 if (v >= I830_DP_VOLTAGE_MAX)
777 v = I830_DP_VOLTAGE_MAX | DP_TRAIN_MAX_SWING_REACHED;
778
779 if (p >= intel_dp_pre_emphasis_max(v))
780 p = intel_dp_pre_emphasis_max(v) | DP_TRAIN_MAX_PRE_EMPHASIS_REACHED;
781
782 for (lane = 0; lane < 4; lane++)
783 train_set[lane] = v | p;
784}
785
786static uint32_t
787intel_dp_signal_levels(uint8_t train_set, int lane_count)
788{
789 uint32_t signal_levels = 0;
790
791 switch (train_set & DP_TRAIN_VOLTAGE_SWING_MASK) {
792 case DP_TRAIN_VOLTAGE_SWING_400:
793 default:
794 signal_levels |= DP_VOLTAGE_0_4;
795 break;
796 case DP_TRAIN_VOLTAGE_SWING_600:
797 signal_levels |= DP_VOLTAGE_0_6;
798 break;
799 case DP_TRAIN_VOLTAGE_SWING_800:
800 signal_levels |= DP_VOLTAGE_0_8;
801 break;
802 case DP_TRAIN_VOLTAGE_SWING_1200:
803 signal_levels |= DP_VOLTAGE_1_2;
804 break;
805 }
806 switch (train_set & DP_TRAIN_PRE_EMPHASIS_MASK) {
807 case DP_TRAIN_PRE_EMPHASIS_0:
808 default:
809 signal_levels |= DP_PRE_EMPHASIS_0;
810 break;
811 case DP_TRAIN_PRE_EMPHASIS_3_5:
812 signal_levels |= DP_PRE_EMPHASIS_3_5;
813 break;
814 case DP_TRAIN_PRE_EMPHASIS_6:
815 signal_levels |= DP_PRE_EMPHASIS_6;
816 break;
817 case DP_TRAIN_PRE_EMPHASIS_9_5:
818 signal_levels |= DP_PRE_EMPHASIS_9_5;
819 break;
820 }
821 return signal_levels;
822}
823
824static uint8_t
825intel_get_lane_status(uint8_t link_status[DP_LINK_STATUS_SIZE],
826 int lane)
827{
828 int i = DP_LANE0_1_STATUS + (lane >> 1);
829 int s = (lane & 1) * 4;
830 uint8_t l = intel_dp_link_status(link_status, i);
831
832 return (l >> s) & 0xf;
833}
834
835/* Check for clock recovery is done on all channels */
836static bool
837intel_clock_recovery_ok(uint8_t link_status[DP_LINK_STATUS_SIZE], int lane_count)
838{
839 int lane;
840 uint8_t lane_status;
841
842 for (lane = 0; lane < lane_count; lane++) {
843 lane_status = intel_get_lane_status(link_status, lane);
844 if ((lane_status & DP_LANE_CR_DONE) == 0)
845 return false;
846 }
847 return true;
848}
849
850/* Check to see if channel eq is done on all channels */
851#define CHANNEL_EQ_BITS (DP_LANE_CR_DONE|\
852 DP_LANE_CHANNEL_EQ_DONE|\
853 DP_LANE_SYMBOL_LOCKED)
854static bool
855intel_channel_eq_ok(uint8_t link_status[DP_LINK_STATUS_SIZE], int lane_count)
856{
857 uint8_t lane_align;
858 uint8_t lane_status;
859 int lane;
860
861 lane_align = intel_dp_link_status(link_status,
862 DP_LANE_ALIGN_STATUS_UPDATED);
863 if ((lane_align & DP_INTERLANE_ALIGN_DONE) == 0)
864 return false;
865 for (lane = 0; lane < lane_count; lane++) {
866 lane_status = intel_get_lane_status(link_status, lane);
867 if ((lane_status & CHANNEL_EQ_BITS) != CHANNEL_EQ_BITS)
868 return false;
869 }
870 return true;
871}
872
873static bool
874intel_dp_set_link_train(struct intel_output *intel_output,
875 uint32_t dp_reg_value,
876 uint8_t dp_train_pat,
877 uint8_t train_set[4],
878 bool first)
879{
880 struct drm_device *dev = intel_output->base.dev;
881 struct drm_i915_private *dev_priv = dev->dev_private;
882 struct intel_dp_priv *dp_priv = intel_output->dev_priv;
883 int ret;
884
885 I915_WRITE(dp_priv->output_reg, dp_reg_value);
886 POSTING_READ(dp_priv->output_reg);
887 if (first)
888 intel_wait_for_vblank(dev);
889
890 intel_dp_aux_native_write_1(intel_output,
891 DP_TRAINING_PATTERN_SET,
892 dp_train_pat);
893
894 ret = intel_dp_aux_native_write(intel_output,
895 DP_TRAINING_LANE0_SET, train_set, 4);
896 if (ret != 4)
897 return false;
898
899 return true;
900}
901
902static void
903intel_dp_link_train(struct intel_output *intel_output, uint32_t DP,
904 uint8_t link_configuration[DP_LINK_CONFIGURATION_SIZE])
905{
906 struct drm_device *dev = intel_output->base.dev;
907 struct drm_i915_private *dev_priv = dev->dev_private;
908 struct intel_dp_priv *dp_priv = intel_output->dev_priv;
909 uint8_t train_set[4];
910 uint8_t link_status[DP_LINK_STATUS_SIZE];
911 int i;
912 uint8_t voltage;
913 bool clock_recovery = false;
914 bool channel_eq = false;
915 bool first = true;
916 int tries;
917
918 /* Write the link configuration data */
919 intel_dp_aux_native_write(intel_output, 0x100,
920 link_configuration, DP_LINK_CONFIGURATION_SIZE);
921
922 DP |= DP_PORT_EN;
923 DP &= ~DP_LINK_TRAIN_MASK;
924 memset(train_set, 0, 4);
925 voltage = 0xff;
926 tries = 0;
927 clock_recovery = false;
928 for (;;) {
929 /* Use train_set[0] to set the voltage and pre emphasis values */
930 uint32_t signal_levels = intel_dp_signal_levels(train_set[0], dp_priv->lane_count);
931 DP = (DP & ~(DP_VOLTAGE_MASK|DP_PRE_EMPHASIS_MASK)) | signal_levels;
932
933 if (!intel_dp_set_link_train(intel_output, DP | DP_LINK_TRAIN_PAT_1,
934 DP_TRAINING_PATTERN_1, train_set, first))
935 break;
936 first = false;
937 /* Set training pattern 1 */
938
939 udelay(100);
940 if (!intel_dp_get_link_status(intel_output, link_status))
941 break;
942
943 if (intel_clock_recovery_ok(link_status, dp_priv->lane_count)) {
944 clock_recovery = true;
945 break;
946 }
947
948 /* Check to see if we've tried the max voltage */
949 for (i = 0; i < dp_priv->lane_count; i++)
950 if ((train_set[i] & DP_TRAIN_MAX_SWING_REACHED) == 0)
951 break;
952 if (i == dp_priv->lane_count)
953 break;
954
955 /* Check to see if we've tried the same voltage 5 times */
956 if ((train_set[0] & DP_TRAIN_VOLTAGE_SWING_MASK) == voltage) {
957 ++tries;
958 if (tries == 5)
959 break;
960 } else
961 tries = 0;
962 voltage = train_set[0] & DP_TRAIN_VOLTAGE_SWING_MASK;
963
964 /* Compute new train_set as requested by target */
965 intel_get_adjust_train(intel_output, link_status, dp_priv->lane_count, train_set);
966 }
967
968 /* channel equalization */
969 tries = 0;
970 channel_eq = false;
971 for (;;) {
972 /* Use train_set[0] to set the voltage and pre emphasis values */
973 uint32_t signal_levels = intel_dp_signal_levels(train_set[0], dp_priv->lane_count);
974 DP = (DP & ~(DP_VOLTAGE_MASK|DP_PRE_EMPHASIS_MASK)) | signal_levels;
975
976 /* channel eq pattern */
977 if (!intel_dp_set_link_train(intel_output, DP | DP_LINK_TRAIN_PAT_2,
978 DP_TRAINING_PATTERN_2, train_set,
979 false))
980 break;
981
982 udelay(400);
983 if (!intel_dp_get_link_status(intel_output, link_status))
984 break;
985
986 if (intel_channel_eq_ok(link_status, dp_priv->lane_count)) {
987 channel_eq = true;
988 break;
989 }
990
991 /* Try 5 times */
992 if (tries > 5)
993 break;
994
995 /* Compute new train_set as requested by target */
996 intel_get_adjust_train(intel_output, link_status, dp_priv->lane_count, train_set);
997 ++tries;
998 }
999
1000 I915_WRITE(dp_priv->output_reg, DP | DP_LINK_TRAIN_OFF);
1001 POSTING_READ(dp_priv->output_reg);
1002 intel_dp_aux_native_write_1(intel_output,
1003 DP_TRAINING_PATTERN_SET, DP_TRAINING_PATTERN_DISABLE);
1004}
1005
1006static void
1007intel_dp_link_down(struct intel_output *intel_output, uint32_t DP)
1008{
1009 struct drm_device *dev = intel_output->base.dev;
1010 struct drm_i915_private *dev_priv = dev->dev_private;
1011 struct intel_dp_priv *dp_priv = intel_output->dev_priv;
1012
1013 DRM_DEBUG("\n");
1014
1015 if (IS_eDP(intel_output)) {
1016 DP &= ~DP_PLL_ENABLE;
1017 I915_WRITE(dp_priv->output_reg, DP);
1018 POSTING_READ(dp_priv->output_reg);
1019 udelay(100);
1020 }
1021
1022 DP &= ~DP_LINK_TRAIN_MASK;
1023 I915_WRITE(dp_priv->output_reg, DP | DP_LINK_TRAIN_PAT_IDLE);
1024 POSTING_READ(dp_priv->output_reg);
1025
1026 udelay(17000);
1027
1028 if (IS_eDP(intel_output))
1029 DP |= DP_LINK_TRAIN_OFF;
1030 I915_WRITE(dp_priv->output_reg, DP & ~DP_PORT_EN);
1031 POSTING_READ(dp_priv->output_reg);
1032}
1033
1034static void
1035intel_dp_restore(struct drm_connector *connector)
1036{
1037 struct intel_output *intel_output = to_intel_output(connector);
1038 struct intel_dp_priv *dp_priv = intel_output->dev_priv;
1039
1040 if (dp_priv->save_DP & DP_PORT_EN)
1041 intel_dp_link_train(intel_output, dp_priv->save_DP, dp_priv->save_link_configuration);
1042 else
1043 intel_dp_link_down(intel_output, dp_priv->save_DP);
1044}
1045
1046/*
1047 * According to DP spec
1048 * 5.1.2:
1049 * 1. Read DPCD
1050 * 2. Configure link according to Receiver Capabilities
1051 * 3. Use Link Training from 2.5.3.3 and 3.5.1.3
1052 * 4. Check link status on receipt of hot-plug interrupt
1053 */
1054
1055static void
1056intel_dp_check_link_status(struct intel_output *intel_output)
1057{
1058 struct intel_dp_priv *dp_priv = intel_output->dev_priv;
1059 uint8_t link_status[DP_LINK_STATUS_SIZE];
1060
1061 if (!intel_output->enc.crtc)
1062 return;
1063
1064 if (!intel_dp_get_link_status(intel_output, link_status)) {
1065 intel_dp_link_down(intel_output, dp_priv->DP);
1066 return;
1067 }
1068
1069 if (!intel_channel_eq_ok(link_status, dp_priv->lane_count))
1070 intel_dp_link_train(intel_output, dp_priv->DP, dp_priv->link_configuration);
1071}
1072
1073static enum drm_connector_status
1074igdng_dp_detect(struct drm_connector *connector)
1075{
1076 struct intel_output *intel_output = to_intel_output(connector);
1077 struct intel_dp_priv *dp_priv = intel_output->dev_priv;
1078 enum drm_connector_status status;
1079
1080 status = connector_status_disconnected;
1081 if (intel_dp_aux_native_read(intel_output,
1082 0x000, dp_priv->dpcd,
1083 sizeof (dp_priv->dpcd)) == sizeof (dp_priv->dpcd))
1084 {
1085 if (dp_priv->dpcd[0] != 0)
1086 status = connector_status_connected;
1087 }
1088 return status;
1089}
1090
1091/**
1092 * Uses CRT_HOTPLUG_EN and CRT_HOTPLUG_STAT to detect DP connection.
1093 *
1094 * \return true if DP port is connected.
1095 * \return false if DP port is disconnected.
1096 */
1097static enum drm_connector_status
1098intel_dp_detect(struct drm_connector *connector)
1099{
1100 struct intel_output *intel_output = to_intel_output(connector);
1101 struct drm_device *dev = intel_output->base.dev;
1102 struct drm_i915_private *dev_priv = dev->dev_private;
1103 struct intel_dp_priv *dp_priv = intel_output->dev_priv;
1104 uint32_t temp, bit;
1105 enum drm_connector_status status;
1106
1107 dp_priv->has_audio = false;
1108
1109 if (IS_IGDNG(dev))
1110 return igdng_dp_detect(connector);
1111
1112 temp = I915_READ(PORT_HOTPLUG_EN);
1113
1114 I915_WRITE(PORT_HOTPLUG_EN,
1115 temp |
1116 DPB_HOTPLUG_INT_EN |
1117 DPC_HOTPLUG_INT_EN |
1118 DPD_HOTPLUG_INT_EN);
1119
1120 POSTING_READ(PORT_HOTPLUG_EN);
1121
1122 switch (dp_priv->output_reg) {
1123 case DP_B:
1124 bit = DPB_HOTPLUG_INT_STATUS;
1125 break;
1126 case DP_C:
1127 bit = DPC_HOTPLUG_INT_STATUS;
1128 break;
1129 case DP_D:
1130 bit = DPD_HOTPLUG_INT_STATUS;
1131 break;
1132 default:
1133 return connector_status_unknown;
1134 }
1135
1136 temp = I915_READ(PORT_HOTPLUG_STAT);
1137
1138 if ((temp & bit) == 0)
1139 return connector_status_disconnected;
1140
1141 status = connector_status_disconnected;
1142 if (intel_dp_aux_native_read(intel_output,
1143 0x000, dp_priv->dpcd,
1144 sizeof (dp_priv->dpcd)) == sizeof (dp_priv->dpcd))
1145 {
1146 if (dp_priv->dpcd[0] != 0)
1147 status = connector_status_connected;
1148 }
1149 return status;
1150}
1151
1152static int intel_dp_get_modes(struct drm_connector *connector)
1153{
1154 struct intel_output *intel_output = to_intel_output(connector);
1155 struct drm_device *dev = intel_output->base.dev;
1156 struct drm_i915_private *dev_priv = dev->dev_private;
1157 int ret;
1158
1159 /* We should parse the EDID data and find out if it has an audio sink
1160 */
1161
1162 ret = intel_ddc_get_modes(intel_output);
1163 if (ret)
1164 return ret;
1165
1166 /* if eDP has no EDID, try to use fixed panel mode from VBT */
1167 if (IS_eDP(intel_output)) {
1168 if (dev_priv->panel_fixed_mode != NULL) {
1169 struct drm_display_mode *mode;
1170 mode = drm_mode_duplicate(dev, dev_priv->panel_fixed_mode);
1171 drm_mode_probed_add(connector, mode);
1172 return 1;
1173 }
1174 }
1175 return 0;
1176}
1177
1178static void
1179intel_dp_destroy (struct drm_connector *connector)
1180{
1181 struct intel_output *intel_output = to_intel_output(connector);
1182
1183 if (intel_output->i2c_bus)
1184 intel_i2c_destroy(intel_output->i2c_bus);
1185 drm_sysfs_connector_remove(connector);
1186 drm_connector_cleanup(connector);
1187 kfree(intel_output);
1188}
1189
1190static const struct drm_encoder_helper_funcs intel_dp_helper_funcs = {
1191 .dpms = intel_dp_dpms,
1192 .mode_fixup = intel_dp_mode_fixup,
1193 .prepare = intel_encoder_prepare,
1194 .mode_set = intel_dp_mode_set,
1195 .commit = intel_encoder_commit,
1196};
1197
1198static const struct drm_connector_funcs intel_dp_connector_funcs = {
1199 .dpms = drm_helper_connector_dpms,
1200 .save = intel_dp_save,
1201 .restore = intel_dp_restore,
1202 .detect = intel_dp_detect,
1203 .fill_modes = drm_helper_probe_single_connector_modes,
1204 .destroy = intel_dp_destroy,
1205};
1206
1207static const struct drm_connector_helper_funcs intel_dp_connector_helper_funcs = {
1208 .get_modes = intel_dp_get_modes,
1209 .mode_valid = intel_dp_mode_valid,
1210 .best_encoder = intel_best_encoder,
1211};
1212
1213static void intel_dp_enc_destroy(struct drm_encoder *encoder)
1214{
1215 drm_encoder_cleanup(encoder);
1216}
1217
1218static const struct drm_encoder_funcs intel_dp_enc_funcs = {
1219 .destroy = intel_dp_enc_destroy,
1220};
1221
1222void
1223intel_dp_hot_plug(struct intel_output *intel_output)
1224{
1225 struct intel_dp_priv *dp_priv = intel_output->dev_priv;
1226
1227 if (dp_priv->dpms_mode == DRM_MODE_DPMS_ON)
1228 intel_dp_check_link_status(intel_output);
1229}
1230
1231void
1232intel_dp_init(struct drm_device *dev, int output_reg)
1233{
1234 struct drm_i915_private *dev_priv = dev->dev_private;
1235 struct drm_connector *connector;
1236 struct intel_output *intel_output;
1237 struct intel_dp_priv *dp_priv;
1238 const char *name = NULL;
1239
1240 intel_output = kcalloc(sizeof(struct intel_output) +
1241 sizeof(struct intel_dp_priv), 1, GFP_KERNEL);
1242 if (!intel_output)
1243 return;
1244
1245 dp_priv = (struct intel_dp_priv *)(intel_output + 1);
1246
1247 connector = &intel_output->base;
1248 drm_connector_init(dev, connector, &intel_dp_connector_funcs,
1249 DRM_MODE_CONNECTOR_DisplayPort);
1250 drm_connector_helper_add(connector, &intel_dp_connector_helper_funcs);
1251
1252 if (output_reg == DP_A)
1253 intel_output->type = INTEL_OUTPUT_EDP;
1254 else
1255 intel_output->type = INTEL_OUTPUT_DISPLAYPORT;
1256
1257 connector->interlace_allowed = true;
1258 connector->doublescan_allowed = 0;
1259
1260 dp_priv->intel_output = intel_output;
1261 dp_priv->output_reg = output_reg;
1262 dp_priv->has_audio = false;
1263 dp_priv->dpms_mode = DRM_MODE_DPMS_ON;
1264 intel_output->dev_priv = dp_priv;
1265
1266 drm_encoder_init(dev, &intel_output->enc, &intel_dp_enc_funcs,
1267 DRM_MODE_ENCODER_TMDS);
1268 drm_encoder_helper_add(&intel_output->enc, &intel_dp_helper_funcs);
1269
1270 drm_mode_connector_attach_encoder(&intel_output->base,
1271 &intel_output->enc);
1272 drm_sysfs_connector_add(connector);
1273
1274 /* Set up the DDC bus. */
1275 switch (output_reg) {
1276 case DP_A:
1277 name = "DPDDC-A";
1278 break;
1279 case DP_B:
1280 case PCH_DP_B:
1281 name = "DPDDC-B";
1282 break;
1283 case DP_C:
1284 case PCH_DP_C:
1285 name = "DPDDC-C";
1286 break;
1287 case DP_D:
1288 case PCH_DP_D:
1289 name = "DPDDC-D";
1290 break;
1291 }
1292
1293 intel_dp_i2c_init(intel_output, name);
1294
1295 intel_output->ddc_bus = &dp_priv->adapter;
1296 intel_output->hot_plug = intel_dp_hot_plug;
1297
1298 if (output_reg == DP_A) {
1299 /* initialize panel mode from VBT if available for eDP */
1300 if (dev_priv->lfp_lvds_vbt_mode) {
1301 dev_priv->panel_fixed_mode =
1302 drm_mode_duplicate(dev, dev_priv->lfp_lvds_vbt_mode);
1303 if (dev_priv->panel_fixed_mode) {
1304 dev_priv->panel_fixed_mode->type |=
1305 DRM_MODE_TYPE_PREFERRED;
1306 }
1307 }
1308 }
1309
1310 /* For G4X desktop chip, PEG_BAND_GAP_DATA 3:0 must first be written
1311 * 0xd. Failure to do so will result in spurious interrupts being
1312 * generated on the port when a cable is not attached.
1313 */
1314 if (IS_G4X(dev) && !IS_GM45(dev)) {
1315 u32 temp = I915_READ(PEG_BAND_GAP_DATA);
1316 I915_WRITE(PEG_BAND_GAP_DATA, (temp & ~0xf) | 0xd);
1317 }
1318}
diff --git a/drivers/gpu/drm/i915/intel_dp.h b/drivers/gpu/drm/i915/intel_dp.h
new file mode 100644
index 000000000000..2b38054d3b6d
--- /dev/null
+++ b/drivers/gpu/drm/i915/intel_dp.h
@@ -0,0 +1,144 @@
1/*
2 * Copyright © 2008 Keith Packard
3 *
4 * Permission to use, copy, modify, distribute, and sell this software and its
5 * documentation for any purpose is hereby granted without fee, provided that
6 * the above copyright notice appear in all copies and that both that copyright
7 * notice and this permission notice appear in supporting documentation, and
8 * that the name of the copyright holders not be used in advertising or
9 * publicity pertaining to distribution of the software without specific,
10 * written prior permission. The copyright holders make no representations
11 * about the suitability of this software for any purpose. It is provided "as
12 * is" without express or implied warranty.
13 *
14 * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
15 * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
16 * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
17 * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
18 * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
19 * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
20 * OF THIS SOFTWARE.
21 */
22
23#ifndef _INTEL_DP_H_
24#define _INTEL_DP_H_
25
26/* From the VESA DisplayPort spec */
27
28#define AUX_NATIVE_WRITE 0x8
29#define AUX_NATIVE_READ 0x9
30#define AUX_I2C_WRITE 0x0
31#define AUX_I2C_READ 0x1
32#define AUX_I2C_STATUS 0x2
33#define AUX_I2C_MOT 0x4
34
35#define AUX_NATIVE_REPLY_ACK (0x0 << 4)
36#define AUX_NATIVE_REPLY_NACK (0x1 << 4)
37#define AUX_NATIVE_REPLY_DEFER (0x2 << 4)
38#define AUX_NATIVE_REPLY_MASK (0x3 << 4)
39
40#define AUX_I2C_REPLY_ACK (0x0 << 6)
41#define AUX_I2C_REPLY_NACK (0x1 << 6)
42#define AUX_I2C_REPLY_DEFER (0x2 << 6)
43#define AUX_I2C_REPLY_MASK (0x3 << 6)
44
45/* AUX CH addresses */
46#define DP_LINK_BW_SET 0x100
47# define DP_LINK_BW_1_62 0x06
48# define DP_LINK_BW_2_7 0x0a
49
50#define DP_LANE_COUNT_SET 0x101
51# define DP_LANE_COUNT_MASK 0x0f
52# define DP_LANE_COUNT_ENHANCED_FRAME_EN (1 << 7)
53
54#define DP_TRAINING_PATTERN_SET 0x102
55
56# define DP_TRAINING_PATTERN_DISABLE 0
57# define DP_TRAINING_PATTERN_1 1
58# define DP_TRAINING_PATTERN_2 2
59# define DP_TRAINING_PATTERN_MASK 0x3
60
61# define DP_LINK_QUAL_PATTERN_DISABLE (0 << 2)
62# define DP_LINK_QUAL_PATTERN_D10_2 (1 << 2)
63# define DP_LINK_QUAL_PATTERN_ERROR_RATE (2 << 2)
64# define DP_LINK_QUAL_PATTERN_PRBS7 (3 << 2)
65# define DP_LINK_QUAL_PATTERN_MASK (3 << 2)
66
67# define DP_RECOVERED_CLOCK_OUT_EN (1 << 4)
68# define DP_LINK_SCRAMBLING_DISABLE (1 << 5)
69
70# define DP_SYMBOL_ERROR_COUNT_BOTH (0 << 6)
71# define DP_SYMBOL_ERROR_COUNT_DISPARITY (1 << 6)
72# define DP_SYMBOL_ERROR_COUNT_SYMBOL (2 << 6)
73# define DP_SYMBOL_ERROR_COUNT_MASK (3 << 6)
74
75#define DP_TRAINING_LANE0_SET 0x103
76#define DP_TRAINING_LANE1_SET 0x104
77#define DP_TRAINING_LANE2_SET 0x105
78#define DP_TRAINING_LANE3_SET 0x106
79
80# define DP_TRAIN_VOLTAGE_SWING_MASK 0x3
81# define DP_TRAIN_VOLTAGE_SWING_SHIFT 0
82# define DP_TRAIN_MAX_SWING_REACHED (1 << 2)
83# define DP_TRAIN_VOLTAGE_SWING_400 (0 << 0)
84# define DP_TRAIN_VOLTAGE_SWING_600 (1 << 0)
85# define DP_TRAIN_VOLTAGE_SWING_800 (2 << 0)
86# define DP_TRAIN_VOLTAGE_SWING_1200 (3 << 0)
87
88# define DP_TRAIN_PRE_EMPHASIS_MASK (3 << 3)
89# define DP_TRAIN_PRE_EMPHASIS_0 (0 << 3)
90# define DP_TRAIN_PRE_EMPHASIS_3_5 (1 << 3)
91# define DP_TRAIN_PRE_EMPHASIS_6 (2 << 3)
92# define DP_TRAIN_PRE_EMPHASIS_9_5 (3 << 3)
93
94# define DP_TRAIN_PRE_EMPHASIS_SHIFT 3
95# define DP_TRAIN_MAX_PRE_EMPHASIS_REACHED (1 << 5)
96
97#define DP_DOWNSPREAD_CTRL 0x107
98# define DP_SPREAD_AMP_0_5 (1 << 4)
99
100#define DP_MAIN_LINK_CHANNEL_CODING_SET 0x108
101# define DP_SET_ANSI_8B10B (1 << 0)
102
103#define DP_LANE0_1_STATUS 0x202
104#define DP_LANE2_3_STATUS 0x203
105
106# define DP_LANE_CR_DONE (1 << 0)
107# define DP_LANE_CHANNEL_EQ_DONE (1 << 1)
108# define DP_LANE_SYMBOL_LOCKED (1 << 2)
109
110#define DP_LANE_ALIGN_STATUS_UPDATED 0x204
111
112#define DP_INTERLANE_ALIGN_DONE (1 << 0)
113#define DP_DOWNSTREAM_PORT_STATUS_CHANGED (1 << 6)
114#define DP_LINK_STATUS_UPDATED (1 << 7)
115
116#define DP_SINK_STATUS 0x205
117
118#define DP_RECEIVE_PORT_0_STATUS (1 << 0)
119#define DP_RECEIVE_PORT_1_STATUS (1 << 1)
120
121#define DP_ADJUST_REQUEST_LANE0_1 0x206
122#define DP_ADJUST_REQUEST_LANE2_3 0x207
123
124#define DP_ADJUST_VOLTAGE_SWING_LANE0_MASK 0x03
125#define DP_ADJUST_VOLTAGE_SWING_LANE0_SHIFT 0
126#define DP_ADJUST_PRE_EMPHASIS_LANE0_MASK 0x0c
127#define DP_ADJUST_PRE_EMPHASIS_LANE0_SHIFT 2
128#define DP_ADJUST_VOLTAGE_SWING_LANE1_MASK 0x30
129#define DP_ADJUST_VOLTAGE_SWING_LANE1_SHIFT 4
130#define DP_ADJUST_PRE_EMPHASIS_LANE1_MASK 0xc0
131#define DP_ADJUST_PRE_EMPHASIS_LANE1_SHIFT 6
132
133struct i2c_algo_dp_aux_data {
134 bool running;
135 u16 address;
136 int (*aux_ch) (struct i2c_adapter *adapter,
137 uint8_t *send, int send_bytes,
138 uint8_t *recv, int recv_bytes);
139};
140
141int
142i2c_dp_aux_add_bus(struct i2c_adapter *adapter);
143
144#endif /* _INTEL_DP_H_ */
diff --git a/drivers/gpu/drm/i915/intel_dp_i2c.c b/drivers/gpu/drm/i915/intel_dp_i2c.c
new file mode 100644
index 000000000000..a63b6f57d2d4
--- /dev/null
+++ b/drivers/gpu/drm/i915/intel_dp_i2c.c
@@ -0,0 +1,273 @@
1/*
2 * Copyright © 2009 Keith Packard
3 *
4 * Permission to use, copy, modify, distribute, and sell this software and its
5 * documentation for any purpose is hereby granted without fee, provided that
6 * the above copyright notice appear in all copies and that both that copyright
7 * notice and this permission notice appear in supporting documentation, and
8 * that the name of the copyright holders not be used in advertising or
9 * publicity pertaining to distribution of the software without specific,
10 * written prior permission. The copyright holders make no representations
11 * about the suitability of this software for any purpose. It is provided "as
12 * is" without express or implied warranty.
13 *
14 * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
15 * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
16 * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
17 * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
18 * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
19 * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
20 * OF THIS SOFTWARE.
21 */
22
23#include <linux/kernel.h>
24#include <linux/module.h>
25#include <linux/delay.h>
26#include <linux/slab.h>
27#include <linux/init.h>
28#include <linux/errno.h>
29#include <linux/sched.h>
30#include <linux/i2c.h>
31#include "intel_dp.h"
32#include "drmP.h"
33
34/* Run a single AUX_CH I2C transaction, writing/reading data as necessary */
35
36#define MODE_I2C_START 1
37#define MODE_I2C_WRITE 2
38#define MODE_I2C_READ 4
39#define MODE_I2C_STOP 8
40
41static int
42i2c_algo_dp_aux_transaction(struct i2c_adapter *adapter, int mode,
43 uint8_t write_byte, uint8_t *read_byte)
44{
45 struct i2c_algo_dp_aux_data *algo_data = adapter->algo_data;
46 uint16_t address = algo_data->address;
47 uint8_t msg[5];
48 uint8_t reply[2];
49 int msg_bytes;
50 int reply_bytes;
51 int ret;
52
53 /* Set up the command byte */
54 if (mode & MODE_I2C_READ)
55 msg[0] = AUX_I2C_READ << 4;
56 else
57 msg[0] = AUX_I2C_WRITE << 4;
58
59 if (!(mode & MODE_I2C_STOP))
60 msg[0] |= AUX_I2C_MOT << 4;
61
62 msg[1] = address >> 8;
63 msg[2] = address;
64
65 switch (mode) {
66 case MODE_I2C_WRITE:
67 msg[3] = 0;
68 msg[4] = write_byte;
69 msg_bytes = 5;
70 reply_bytes = 1;
71 break;
72 case MODE_I2C_READ:
73 msg[3] = 0;
74 msg_bytes = 4;
75 reply_bytes = 2;
76 break;
77 default:
78 msg_bytes = 3;
79 reply_bytes = 1;
80 break;
81 }
82
83 for (;;) {
84 ret = (*algo_data->aux_ch)(adapter,
85 msg, msg_bytes,
86 reply, reply_bytes);
87 if (ret < 0) {
88 DRM_DEBUG("aux_ch failed %d\n", ret);
89 return ret;
90 }
91 switch (reply[0] & AUX_I2C_REPLY_MASK) {
92 case AUX_I2C_REPLY_ACK:
93 if (mode == MODE_I2C_READ) {
94 *read_byte = reply[1];
95 }
96 return reply_bytes - 1;
97 case AUX_I2C_REPLY_NACK:
98 DRM_DEBUG("aux_ch nack\n");
99 return -EREMOTEIO;
100 case AUX_I2C_REPLY_DEFER:
101 DRM_DEBUG("aux_ch defer\n");
102 udelay(100);
103 break;
104 default:
105 DRM_ERROR("aux_ch invalid reply 0x%02x\n", reply[0]);
106 return -EREMOTEIO;
107 }
108 }
109}
110
111/*
112 * I2C over AUX CH
113 */
114
115/*
116 * Send the address. If the I2C link is running, this 'restarts'
117 * the connection with the new address, this is used for doing
118 * a write followed by a read (as needed for DDC)
119 */
120static int
121i2c_algo_dp_aux_address(struct i2c_adapter *adapter, u16 address, bool reading)
122{
123 struct i2c_algo_dp_aux_data *algo_data = adapter->algo_data;
124 int mode = MODE_I2C_START;
125 int ret;
126
127 if (reading)
128 mode |= MODE_I2C_READ;
129 else
130 mode |= MODE_I2C_WRITE;
131 algo_data->address = address;
132 algo_data->running = true;
133 ret = i2c_algo_dp_aux_transaction(adapter, mode, 0, NULL);
134 return ret;
135}
136
137/*
138 * Stop the I2C transaction. This closes out the link, sending
139 * a bare address packet with the MOT bit turned off
140 */
141static void
142i2c_algo_dp_aux_stop(struct i2c_adapter *adapter, bool reading)
143{
144 struct i2c_algo_dp_aux_data *algo_data = adapter->algo_data;
145 int mode = MODE_I2C_STOP;
146
147 if (reading)
148 mode |= MODE_I2C_READ;
149 else
150 mode |= MODE_I2C_WRITE;
151 if (algo_data->running) {
152 (void) i2c_algo_dp_aux_transaction(adapter, mode, 0, NULL);
153 algo_data->running = false;
154 }
155}
156
157/*
158 * Write a single byte to the current I2C address, the
159 * the I2C link must be running or this returns -EIO
160 */
161static int
162i2c_algo_dp_aux_put_byte(struct i2c_adapter *adapter, u8 byte)
163{
164 struct i2c_algo_dp_aux_data *algo_data = adapter->algo_data;
165 int ret;
166
167 if (!algo_data->running)
168 return -EIO;
169
170 ret = i2c_algo_dp_aux_transaction(adapter, MODE_I2C_WRITE, byte, NULL);
171 return ret;
172}
173
174/*
175 * Read a single byte from the current I2C address, the
176 * I2C link must be running or this returns -EIO
177 */
178static int
179i2c_algo_dp_aux_get_byte(struct i2c_adapter *adapter, u8 *byte_ret)
180{
181 struct i2c_algo_dp_aux_data *algo_data = adapter->algo_data;
182 int ret;
183
184 if (!algo_data->running)
185 return -EIO;
186
187 ret = i2c_algo_dp_aux_transaction(adapter, MODE_I2C_READ, 0, byte_ret);
188 return ret;
189}
190
191static int
192i2c_algo_dp_aux_xfer(struct i2c_adapter *adapter,
193 struct i2c_msg *msgs,
194 int num)
195{
196 int ret = 0;
197 bool reading = false;
198 int m;
199 int b;
200
201 for (m = 0; m < num; m++) {
202 u16 len = msgs[m].len;
203 u8 *buf = msgs[m].buf;
204 reading = (msgs[m].flags & I2C_M_RD) != 0;
205 ret = i2c_algo_dp_aux_address(adapter, msgs[m].addr, reading);
206 if (ret < 0)
207 break;
208 if (reading) {
209 for (b = 0; b < len; b++) {
210 ret = i2c_algo_dp_aux_get_byte(adapter, &buf[b]);
211 if (ret < 0)
212 break;
213 }
214 } else {
215 for (b = 0; b < len; b++) {
216 ret = i2c_algo_dp_aux_put_byte(adapter, buf[b]);
217 if (ret < 0)
218 break;
219 }
220 }
221 if (ret < 0)
222 break;
223 }
224 if (ret >= 0)
225 ret = num;
226 i2c_algo_dp_aux_stop(adapter, reading);
227 DRM_DEBUG("dp_aux_xfer return %d\n", ret);
228 return ret;
229}
230
231static u32
232i2c_algo_dp_aux_functionality(struct i2c_adapter *adapter)
233{
234 return I2C_FUNC_I2C | I2C_FUNC_SMBUS_EMUL |
235 I2C_FUNC_SMBUS_READ_BLOCK_DATA |
236 I2C_FUNC_SMBUS_BLOCK_PROC_CALL |
237 I2C_FUNC_10BIT_ADDR;
238}
239
240static const struct i2c_algorithm i2c_dp_aux_algo = {
241 .master_xfer = i2c_algo_dp_aux_xfer,
242 .functionality = i2c_algo_dp_aux_functionality,
243};
244
245static void
246i2c_dp_aux_reset_bus(struct i2c_adapter *adapter)
247{
248 (void) i2c_algo_dp_aux_address(adapter, 0, false);
249 (void) i2c_algo_dp_aux_stop(adapter, false);
250
251}
252
253static int
254i2c_dp_aux_prepare_bus(struct i2c_adapter *adapter)
255{
256 adapter->algo = &i2c_dp_aux_algo;
257 adapter->retries = 3;
258 i2c_dp_aux_reset_bus(adapter);
259 return 0;
260}
261
262int
263i2c_dp_aux_add_bus(struct i2c_adapter *adapter)
264{
265 int error;
266
267 error = i2c_dp_aux_prepare_bus(adapter);
268 if (error)
269 return error;
270 error = i2c_add_adapter(adapter);
271 return error;
272}
273EXPORT_SYMBOL(i2c_dp_aux_add_bus);
diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
index cd4b9c5f715e..d6f92ea1b553 100644
--- a/drivers/gpu/drm/i915/intel_drv.h
+++ b/drivers/gpu/drm/i915/intel_drv.h
@@ -54,6 +54,8 @@
54#define INTEL_OUTPUT_LVDS 4 54#define INTEL_OUTPUT_LVDS 4
55#define INTEL_OUTPUT_TVOUT 5 55#define INTEL_OUTPUT_TVOUT 5
56#define INTEL_OUTPUT_HDMI 6 56#define INTEL_OUTPUT_HDMI 6
57#define INTEL_OUTPUT_DISPLAYPORT 7
58#define INTEL_OUTPUT_EDP 8
57 59
58#define INTEL_DVO_CHIP_NONE 0 60#define INTEL_DVO_CHIP_NONE 0
59#define INTEL_DVO_CHIP_LVDS 1 61#define INTEL_DVO_CHIP_LVDS 1
@@ -65,7 +67,6 @@ struct intel_i2c_chan {
65 u32 reg; /* GPIO reg */ 67 u32 reg; /* GPIO reg */
66 struct i2c_adapter adapter; 68 struct i2c_adapter adapter;
67 struct i2c_algo_bit_data algo; 69 struct i2c_algo_bit_data algo;
68 u8 slave_addr;
69}; 70};
70 71
71struct intel_framebuffer { 72struct intel_framebuffer {
@@ -79,11 +80,12 @@ struct intel_output {
79 80
80 struct drm_encoder enc; 81 struct drm_encoder enc;
81 int type; 82 int type;
82 struct intel_i2c_chan *i2c_bus; /* for control functions */ 83 struct i2c_adapter *i2c_bus;
83 struct intel_i2c_chan *ddc_bus; /* for DDC only stuff */ 84 struct i2c_adapter *ddc_bus;
84 bool load_detect_temp; 85 bool load_detect_temp;
85 bool needs_tv_clock; 86 bool needs_tv_clock;
86 void *dev_priv; 87 void *dev_priv;
88 void (*hot_plug)(struct intel_output *);
87}; 89};
88 90
89struct intel_crtc { 91struct intel_crtc {
@@ -104,9 +106,9 @@ struct intel_crtc {
104#define enc_to_intel_output(x) container_of(x, struct intel_output, enc) 106#define enc_to_intel_output(x) container_of(x, struct intel_output, enc)
105#define to_intel_framebuffer(x) container_of(x, struct intel_framebuffer, base) 107#define to_intel_framebuffer(x) container_of(x, struct intel_framebuffer, base)
106 108
107struct intel_i2c_chan *intel_i2c_create(struct drm_device *dev, const u32 reg, 109struct i2c_adapter *intel_i2c_create(struct drm_device *dev, const u32 reg,
108 const char *name); 110 const char *name);
109void intel_i2c_destroy(struct intel_i2c_chan *chan); 111void intel_i2c_destroy(struct i2c_adapter *adapter);
110int intel_ddc_get_modes(struct intel_output *intel_output); 112int intel_ddc_get_modes(struct intel_output *intel_output);
111extern bool intel_ddc_probe(struct intel_output *intel_output); 113extern bool intel_ddc_probe(struct intel_output *intel_output);
112void intel_i2c_quirk_set(struct drm_device *dev, bool enable); 114void intel_i2c_quirk_set(struct drm_device *dev, bool enable);
@@ -116,6 +118,12 @@ extern bool intel_sdvo_init(struct drm_device *dev, int output_device);
116extern void intel_dvo_init(struct drm_device *dev); 118extern void intel_dvo_init(struct drm_device *dev);
117extern void intel_tv_init(struct drm_device *dev); 119extern void intel_tv_init(struct drm_device *dev);
118extern void intel_lvds_init(struct drm_device *dev); 120extern void intel_lvds_init(struct drm_device *dev);
121extern void intel_dp_init(struct drm_device *dev, int dp_reg);
122void
123intel_dp_set_m_n(struct drm_crtc *crtc, struct drm_display_mode *mode,
124 struct drm_display_mode *adjusted_mode);
125extern void intel_edp_link_config (struct intel_output *, int *, int *);
126
119 127
120extern void intel_crtc_load_lut(struct drm_crtc *crtc); 128extern void intel_crtc_load_lut(struct drm_crtc *crtc);
121extern void intel_encoder_prepare (struct drm_encoder *encoder); 129extern void intel_encoder_prepare (struct drm_encoder *encoder);
diff --git a/drivers/gpu/drm/i915/intel_dvo.c b/drivers/gpu/drm/i915/intel_dvo.c
index 1ee3007d6ec0..13bff20930e8 100644
--- a/drivers/gpu/drm/i915/intel_dvo.c
+++ b/drivers/gpu/drm/i915/intel_dvo.c
@@ -384,10 +384,9 @@ void intel_dvo_init(struct drm_device *dev)
384{ 384{
385 struct intel_output *intel_output; 385 struct intel_output *intel_output;
386 struct intel_dvo_device *dvo; 386 struct intel_dvo_device *dvo;
387 struct intel_i2c_chan *i2cbus = NULL; 387 struct i2c_adapter *i2cbus = NULL;
388 int ret = 0; 388 int ret = 0;
389 int i; 389 int i;
390 int gpio_inited = 0;
391 int encoder_type = DRM_MODE_ENCODER_NONE; 390 int encoder_type = DRM_MODE_ENCODER_NONE;
392 intel_output = kzalloc (sizeof(struct intel_output), GFP_KERNEL); 391 intel_output = kzalloc (sizeof(struct intel_output), GFP_KERNEL);
393 if (!intel_output) 392 if (!intel_output)
@@ -420,14 +419,11 @@ void intel_dvo_init(struct drm_device *dev)
420 * It appears that everything is on GPIOE except for panels 419 * It appears that everything is on GPIOE except for panels
421 * on i830 laptops, which are on GPIOB (DVOA). 420 * on i830 laptops, which are on GPIOB (DVOA).
422 */ 421 */
423 if (gpio_inited != gpio) { 422 if (i2cbus != NULL)
424 if (i2cbus != NULL) 423 intel_i2c_destroy(i2cbus);
425 intel_i2c_destroy(i2cbus); 424 if (!(i2cbus = intel_i2c_create(dev, gpio,
426 if (!(i2cbus = intel_i2c_create(dev, gpio, 425 gpio == GPIOB ? "DVOI2C_B" : "DVOI2C_E"))) {
427 gpio == GPIOB ? "DVOI2C_B" : "DVOI2C_E"))) { 426 continue;
428 continue;
429 }
430 gpio_inited = gpio;
431 } 427 }
432 428
433 if (dvo->dev_ops!= NULL) 429 if (dvo->dev_ops!= NULL)
diff --git a/drivers/gpu/drm/i915/intel_fb.c b/drivers/gpu/drm/i915/intel_fb.c
index 1af7d68e3807..1d30802e773e 100644
--- a/drivers/gpu/drm/i915/intel_fb.c
+++ b/drivers/gpu/drm/i915/intel_fb.c
@@ -453,7 +453,7 @@ static int intelfb_create(struct drm_device *dev, uint32_t fb_width,
453 size = ALIGN(size, PAGE_SIZE); 453 size = ALIGN(size, PAGE_SIZE);
454 fbo = drm_gem_object_alloc(dev, size); 454 fbo = drm_gem_object_alloc(dev, size);
455 if (!fbo) { 455 if (!fbo) {
456 printk(KERN_ERR "failed to allocate framebuffer\n"); 456 DRM_ERROR("failed to allocate framebuffer\n");
457 ret = -ENOMEM; 457 ret = -ENOMEM;
458 goto out; 458 goto out;
459 } 459 }
@@ -610,8 +610,8 @@ static int intelfb_create(struct drm_device *dev, uint32_t fb_width,
610 par->dev = dev; 610 par->dev = dev;
611 611
612 /* To allow resizeing without swapping buffers */ 612 /* To allow resizeing without swapping buffers */
613 printk("allocated %dx%d fb: 0x%08x, bo %p\n", intel_fb->base.width, 613 DRM_DEBUG("allocated %dx%d fb: 0x%08x, bo %p\n", intel_fb->base.width,
614 intel_fb->base.height, obj_priv->gtt_offset, fbo); 614 intel_fb->base.height, obj_priv->gtt_offset, fbo);
615 615
616 mutex_unlock(&dev->struct_mutex); 616 mutex_unlock(&dev->struct_mutex);
617 return 0; 617 return 0;
@@ -698,13 +698,13 @@ static int intelfb_multi_fb_probe_crtc(struct drm_device *dev, struct drm_crtc *
698 } else 698 } else
699 intelfb_set_par(info); 699 intelfb_set_par(info);
700 700
701 printk(KERN_INFO "fb%d: %s frame buffer device\n", info->node, 701 DRM_INFO("fb%d: %s frame buffer device\n", info->node,
702 info->fix.id); 702 info->fix.id);
703 703
704 /* Switch back to kernel console on panic */ 704 /* Switch back to kernel console on panic */
705 kernelfb_mode = *modeset; 705 kernelfb_mode = *modeset;
706 atomic_notifier_chain_register(&panic_notifier_list, &paniced); 706 atomic_notifier_chain_register(&panic_notifier_list, &paniced);
707 printk(KERN_INFO "registered panic notifier\n"); 707 DRM_DEBUG("registered panic notifier\n");
708 708
709 return 0; 709 return 0;
710} 710}
@@ -852,13 +852,13 @@ static int intelfb_single_fb_probe(struct drm_device *dev)
852 } else 852 } else
853 intelfb_set_par(info); 853 intelfb_set_par(info);
854 854
855 printk(KERN_INFO "fb%d: %s frame buffer device\n", info->node, 855 DRM_INFO("fb%d: %s frame buffer device\n", info->node,
856 info->fix.id); 856 info->fix.id);
857 857
858 /* Switch back to kernel console on panic */ 858 /* Switch back to kernel console on panic */
859 kernelfb_mode = *modeset; 859 kernelfb_mode = *modeset;
860 atomic_notifier_chain_register(&panic_notifier_list, &paniced); 860 atomic_notifier_chain_register(&panic_notifier_list, &paniced);
861 printk(KERN_INFO "registered panic notifier\n"); 861 DRM_DEBUG("registered panic notifier\n");
862 862
863 return 0; 863 return 0;
864} 864}
@@ -872,8 +872,8 @@ void intelfb_restore(void)
872{ 872{
873 int ret; 873 int ret;
874 if ((ret = drm_crtc_helper_set_config(&kernelfb_mode)) != 0) { 874 if ((ret = drm_crtc_helper_set_config(&kernelfb_mode)) != 0) {
875 printk(KERN_ERR "Failed to restore crtc configuration: %d\n", 875 DRM_ERROR("Failed to restore crtc configuration: %d\n",
876 ret); 876 ret);
877 } 877 }
878} 878}
879 879
diff --git a/drivers/gpu/drm/i915/intel_hdmi.c b/drivers/gpu/drm/i915/intel_hdmi.c
index 4ea2a651b92c..1842290cded3 100644
--- a/drivers/gpu/drm/i915/intel_hdmi.c
+++ b/drivers/gpu/drm/i915/intel_hdmi.c
@@ -31,6 +31,7 @@
31#include "drmP.h" 31#include "drmP.h"
32#include "drm.h" 32#include "drm.h"
33#include "drm_crtc.h" 33#include "drm_crtc.h"
34#include "drm_edid.h"
34#include "intel_drv.h" 35#include "intel_drv.h"
35#include "i915_drm.h" 36#include "i915_drm.h"
36#include "i915_drv.h" 37#include "i915_drv.h"
@@ -56,8 +57,7 @@ static void intel_hdmi_mode_set(struct drm_encoder *encoder,
56 sdvox = SDVO_ENCODING_HDMI | 57 sdvox = SDVO_ENCODING_HDMI |
57 SDVO_BORDER_ENABLE | 58 SDVO_BORDER_ENABLE |
58 SDVO_VSYNC_ACTIVE_HIGH | 59 SDVO_VSYNC_ACTIVE_HIGH |
59 SDVO_HSYNC_ACTIVE_HIGH | 60 SDVO_HSYNC_ACTIVE_HIGH;
60 SDVO_NULL_PACKETS_DURING_VSYNC;
61 61
62 if (hdmi_priv->has_hdmi_sink) 62 if (hdmi_priv->has_hdmi_sink)
63 sdvox |= SDVO_AUDIO_ENABLE; 63 sdvox |= SDVO_AUDIO_ENABLE;
@@ -129,83 +129,28 @@ static bool intel_hdmi_mode_fixup(struct drm_encoder *encoder,
129 return true; 129 return true;
130} 130}
131 131
132static void
133intel_hdmi_sink_detect(struct drm_connector *connector)
134{
135 struct intel_output *intel_output = to_intel_output(connector);
136 struct intel_hdmi_priv *hdmi_priv = intel_output->dev_priv;
137 struct edid *edid = NULL;
138
139 edid = drm_get_edid(&intel_output->base,
140 &intel_output->ddc_bus->adapter);
141 if (edid != NULL) {
142 hdmi_priv->has_hdmi_sink = drm_detect_hdmi_monitor(edid);
143 kfree(edid);
144 intel_output->base.display_info.raw_edid = NULL;
145 }
146}
147
148static enum drm_connector_status
149igdng_hdmi_detect(struct drm_connector *connector)
150{
151 struct intel_output *intel_output = to_intel_output(connector);
152 struct intel_hdmi_priv *hdmi_priv = intel_output->dev_priv;
153
154 /* FIXME hotplug detect */
155
156 hdmi_priv->has_hdmi_sink = false;
157 intel_hdmi_sink_detect(connector);
158 if (hdmi_priv->has_hdmi_sink)
159 return connector_status_connected;
160 else
161 return connector_status_disconnected;
162}
163
164static enum drm_connector_status 132static enum drm_connector_status
165intel_hdmi_detect(struct drm_connector *connector) 133intel_hdmi_detect(struct drm_connector *connector)
166{ 134{
167 struct drm_device *dev = connector->dev;
168 struct drm_i915_private *dev_priv = dev->dev_private;
169 struct intel_output *intel_output = to_intel_output(connector); 135 struct intel_output *intel_output = to_intel_output(connector);
170 struct intel_hdmi_priv *hdmi_priv = intel_output->dev_priv; 136 struct intel_hdmi_priv *hdmi_priv = intel_output->dev_priv;
171 u32 temp, bit; 137 struct edid *edid = NULL;
172 138 enum drm_connector_status status = connector_status_disconnected;
173 if (IS_IGDNG(dev))
174 return igdng_hdmi_detect(connector);
175
176 temp = I915_READ(PORT_HOTPLUG_EN);
177
178 switch (hdmi_priv->sdvox_reg) {
179 case SDVOB:
180 temp |= HDMIB_HOTPLUG_INT_EN;
181 break;
182 case SDVOC:
183 temp |= HDMIC_HOTPLUG_INT_EN;
184 break;
185 default:
186 return connector_status_unknown;
187 }
188
189 I915_WRITE(PORT_HOTPLUG_EN, temp);
190 139
191 POSTING_READ(PORT_HOTPLUG_EN); 140 hdmi_priv->has_hdmi_sink = false;
141 edid = drm_get_edid(&intel_output->base,
142 intel_output->ddc_bus);
192 143
193 switch (hdmi_priv->sdvox_reg) { 144 if (edid) {
194 case SDVOB: 145 if (edid->input & DRM_EDID_INPUT_DIGITAL) {
195 bit = HDMIB_HOTPLUG_INT_STATUS; 146 status = connector_status_connected;
196 break; 147 hdmi_priv->has_hdmi_sink = drm_detect_hdmi_monitor(edid);
197 case SDVOC: 148 }
198 bit = HDMIC_HOTPLUG_INT_STATUS; 149 intel_output->base.display_info.raw_edid = NULL;
199 break; 150 kfree(edid);
200 default:
201 return connector_status_unknown;
202 } 151 }
203 152
204 if ((I915_READ(PORT_HOTPLUG_STAT) & bit) != 0) { 153 return status;
205 intel_hdmi_sink_detect(connector);
206 return connector_status_connected;
207 } else
208 return connector_status_disconnected;
209} 154}
210 155
211static int intel_hdmi_get_modes(struct drm_connector *connector) 156static int intel_hdmi_get_modes(struct drm_connector *connector)
diff --git a/drivers/gpu/drm/i915/intel_i2c.c b/drivers/gpu/drm/i915/intel_i2c.c
index f7061f68d050..62b8bead7652 100644
--- a/drivers/gpu/drm/i915/intel_i2c.c
+++ b/drivers/gpu/drm/i915/intel_i2c.c
@@ -124,6 +124,7 @@ static void set_data(void *data, int state_high)
124 * @output: driver specific output device 124 * @output: driver specific output device
125 * @reg: GPIO reg to use 125 * @reg: GPIO reg to use
126 * @name: name for this bus 126 * @name: name for this bus
127 * @slave_addr: slave address (if fixed)
127 * 128 *
128 * Creates and registers a new i2c bus with the Linux i2c layer, for use 129 * Creates and registers a new i2c bus with the Linux i2c layer, for use
129 * in output probing and control (e.g. DDC or SDVO control functions). 130 * in output probing and control (e.g. DDC or SDVO control functions).
@@ -139,8 +140,8 @@ static void set_data(void *data, int state_high)
139 * %GPIOH 140 * %GPIOH
140 * see PRM for details on how these different busses are used. 141 * see PRM for details on how these different busses are used.
141 */ 142 */
142struct intel_i2c_chan *intel_i2c_create(struct drm_device *dev, const u32 reg, 143struct i2c_adapter *intel_i2c_create(struct drm_device *dev, const u32 reg,
143 const char *name) 144 const char *name)
144{ 145{
145 struct intel_i2c_chan *chan; 146 struct intel_i2c_chan *chan;
146 147
@@ -174,7 +175,7 @@ struct intel_i2c_chan *intel_i2c_create(struct drm_device *dev, const u32 reg,
174 intel_i2c_quirk_set(dev, false); 175 intel_i2c_quirk_set(dev, false);
175 udelay(20); 176 udelay(20);
176 177
177 return chan; 178 return &chan->adapter;
178 179
179out_free: 180out_free:
180 kfree(chan); 181 kfree(chan);
@@ -187,11 +188,16 @@ out_free:
187 * 188 *
188 * Unregister the adapter from the i2c layer, then free the structure. 189 * Unregister the adapter from the i2c layer, then free the structure.
189 */ 190 */
190void intel_i2c_destroy(struct intel_i2c_chan *chan) 191void intel_i2c_destroy(struct i2c_adapter *adapter)
191{ 192{
192 if (!chan) 193 struct intel_i2c_chan *chan;
194
195 if (!adapter)
193 return; 196 return;
194 197
198 chan = container_of(adapter,
199 struct intel_i2c_chan,
200 adapter);
195 i2c_del_adapter(&chan->adapter); 201 i2c_del_adapter(&chan->adapter);
196 kfree(chan); 202 kfree(chan);
197} 203}
diff --git a/drivers/gpu/drm/i915/intel_lvds.c b/drivers/gpu/drm/i915/intel_lvds.c
index f073ed8432e8..3f445a80c552 100644
--- a/drivers/gpu/drm/i915/intel_lvds.c
+++ b/drivers/gpu/drm/i915/intel_lvds.c
@@ -36,9 +36,25 @@
36#include "intel_drv.h" 36#include "intel_drv.h"
37#include "i915_drm.h" 37#include "i915_drm.h"
38#include "i915_drv.h" 38#include "i915_drv.h"
39#include <linux/acpi.h>
39 40
40#define I915_LVDS "i915_lvds" 41#define I915_LVDS "i915_lvds"
41 42
43/*
44 * the following four scaling options are defined.
45 * #define DRM_MODE_SCALE_NON_GPU 0
46 * #define DRM_MODE_SCALE_FULLSCREEN 1
47 * #define DRM_MODE_SCALE_NO_SCALE 2
48 * #define DRM_MODE_SCALE_ASPECT 3
49 */
50
51/* Private structure for the integrated LVDS support */
52struct intel_lvds_priv {
53 int fitting_mode;
54 u32 pfit_control;
55 u32 pfit_pgm_ratios;
56};
57
42/** 58/**
43 * Sets the backlight level. 59 * Sets the backlight level.
44 * 60 *
@@ -213,26 +229,45 @@ static bool intel_lvds_mode_fixup(struct drm_encoder *encoder,
213 struct drm_display_mode *mode, 229 struct drm_display_mode *mode,
214 struct drm_display_mode *adjusted_mode) 230 struct drm_display_mode *adjusted_mode)
215{ 231{
232 /*
233 * float point operation is not supported . So the PANEL_RATIO_FACTOR
234 * is defined, which can avoid the float point computation when
235 * calculating the panel ratio.
236 */
237#define PANEL_RATIO_FACTOR 8192
216 struct drm_device *dev = encoder->dev; 238 struct drm_device *dev = encoder->dev;
217 struct drm_i915_private *dev_priv = dev->dev_private; 239 struct drm_i915_private *dev_priv = dev->dev_private;
218 struct intel_crtc *intel_crtc = to_intel_crtc(encoder->crtc); 240 struct intel_crtc *intel_crtc = to_intel_crtc(encoder->crtc);
219 struct drm_encoder *tmp_encoder; 241 struct drm_encoder *tmp_encoder;
242 struct intel_output *intel_output = enc_to_intel_output(encoder);
243 struct intel_lvds_priv *lvds_priv = intel_output->dev_priv;
244 u32 pfit_control = 0, pfit_pgm_ratios = 0;
245 int left_border = 0, right_border = 0, top_border = 0;
246 int bottom_border = 0;
247 bool border = 0;
248 int panel_ratio, desired_ratio, vert_scale, horiz_scale;
249 int horiz_ratio, vert_ratio;
250 u32 hsync_width, vsync_width;
251 u32 hblank_width, vblank_width;
252 u32 hsync_pos, vsync_pos;
220 253
221 /* Should never happen!! */ 254 /* Should never happen!! */
222 if (!IS_I965G(dev) && intel_crtc->pipe == 0) { 255 if (!IS_I965G(dev) && intel_crtc->pipe == 0) {
223 printk(KERN_ERR "Can't support LVDS on pipe A\n"); 256 DRM_ERROR("Can't support LVDS on pipe A\n");
224 return false; 257 return false;
225 } 258 }
226 259
227 /* Should never happen!! */ 260 /* Should never happen!! */
228 list_for_each_entry(tmp_encoder, &dev->mode_config.encoder_list, head) { 261 list_for_each_entry(tmp_encoder, &dev->mode_config.encoder_list, head) {
229 if (tmp_encoder != encoder && tmp_encoder->crtc == encoder->crtc) { 262 if (tmp_encoder != encoder && tmp_encoder->crtc == encoder->crtc) {
230 printk(KERN_ERR "Can't enable LVDS and another " 263 DRM_ERROR("Can't enable LVDS and another "
231 "encoder on the same pipe\n"); 264 "encoder on the same pipe\n");
232 return false; 265 return false;
233 } 266 }
234 } 267 }
235 268 /* If we don't have a panel mode, there is nothing we can do */
269 if (dev_priv->panel_fixed_mode == NULL)
270 return true;
236 /* 271 /*
237 * If we have timings from the BIOS for the panel, put them in 272 * If we have timings from the BIOS for the panel, put them in
238 * to the adjusted mode. The CRTC will be set up for this mode, 273 * to the adjusted mode. The CRTC will be set up for this mode,
@@ -256,6 +291,243 @@ static bool intel_lvds_mode_fixup(struct drm_encoder *encoder,
256 drm_mode_set_crtcinfo(adjusted_mode, CRTC_INTERLACE_HALVE_V); 291 drm_mode_set_crtcinfo(adjusted_mode, CRTC_INTERLACE_HALVE_V);
257 } 292 }
258 293
294 /* Make sure pre-965s set dither correctly */
295 if (!IS_I965G(dev)) {
296 if (dev_priv->panel_wants_dither || dev_priv->lvds_dither)
297 pfit_control |= PANEL_8TO6_DITHER_ENABLE;
298 }
299
300 /* Native modes don't need fitting */
301 if (adjusted_mode->hdisplay == mode->hdisplay &&
302 adjusted_mode->vdisplay == mode->vdisplay) {
303 pfit_pgm_ratios = 0;
304 border = 0;
305 goto out;
306 }
307
308 /* 965+ wants fuzzy fitting */
309 if (IS_I965G(dev))
310 pfit_control |= (intel_crtc->pipe << PFIT_PIPE_SHIFT) |
311 PFIT_FILTER_FUZZY;
312
313 hsync_width = adjusted_mode->crtc_hsync_end -
314 adjusted_mode->crtc_hsync_start;
315 vsync_width = adjusted_mode->crtc_vsync_end -
316 adjusted_mode->crtc_vsync_start;
317 hblank_width = adjusted_mode->crtc_hblank_end -
318 adjusted_mode->crtc_hblank_start;
319 vblank_width = adjusted_mode->crtc_vblank_end -
320 adjusted_mode->crtc_vblank_start;
321 /*
322 * Deal with panel fitting options. Figure out how to stretch the
323 * image based on its aspect ratio & the current panel fitting mode.
324 */
325 panel_ratio = adjusted_mode->hdisplay * PANEL_RATIO_FACTOR /
326 adjusted_mode->vdisplay;
327 desired_ratio = mode->hdisplay * PANEL_RATIO_FACTOR /
328 mode->vdisplay;
329 /*
330 * Enable automatic panel scaling for non-native modes so that they fill
331 * the screen. Should be enabled before the pipe is enabled, according
332 * to register description and PRM.
333 * Change the value here to see the borders for debugging
334 */
335 I915_WRITE(BCLRPAT_A, 0);
336 I915_WRITE(BCLRPAT_B, 0);
337
338 switch (lvds_priv->fitting_mode) {
339 case DRM_MODE_SCALE_NO_SCALE:
340 /*
341 * For centered modes, we have to calculate border widths &
342 * heights and modify the values programmed into the CRTC.
343 */
344 left_border = (adjusted_mode->hdisplay - mode->hdisplay) / 2;
345 right_border = left_border;
346 if (mode->hdisplay & 1)
347 right_border++;
348 top_border = (adjusted_mode->vdisplay - mode->vdisplay) / 2;
349 bottom_border = top_border;
350 if (mode->vdisplay & 1)
351 bottom_border++;
352 /* Set active & border values */
353 adjusted_mode->crtc_hdisplay = mode->hdisplay;
354 /* Keep the boder be even */
355 if (right_border & 1)
356 right_border++;
357 /* use the border directly instead of border minuse one */
358 adjusted_mode->crtc_hblank_start = mode->hdisplay +
359 right_border;
360 /* keep the blank width constant */
361 adjusted_mode->crtc_hblank_end =
362 adjusted_mode->crtc_hblank_start + hblank_width;
363 /* get the hsync pos relative to hblank start */
364 hsync_pos = (hblank_width - hsync_width) / 2;
365 /* keep the hsync pos be even */
366 if (hsync_pos & 1)
367 hsync_pos++;
368 adjusted_mode->crtc_hsync_start =
369 adjusted_mode->crtc_hblank_start + hsync_pos;
370 /* keep the hsync width constant */
371 adjusted_mode->crtc_hsync_end =
372 adjusted_mode->crtc_hsync_start + hsync_width;
373 adjusted_mode->crtc_vdisplay = mode->vdisplay;
374 /* use the border instead of border minus one */
375 adjusted_mode->crtc_vblank_start = mode->vdisplay +
376 bottom_border;
377 /* keep the vblank width constant */
378 adjusted_mode->crtc_vblank_end =
379 adjusted_mode->crtc_vblank_start + vblank_width;
380 /* get the vsync start postion relative to vblank start */
381 vsync_pos = (vblank_width - vsync_width) / 2;
382 adjusted_mode->crtc_vsync_start =
383 adjusted_mode->crtc_vblank_start + vsync_pos;
384 /* keep the vsync width constant */
385 adjusted_mode->crtc_vsync_end =
386 adjusted_mode->crtc_vblank_start + vsync_width;
387 border = 1;
388 break;
389 case DRM_MODE_SCALE_ASPECT:
390 /* Scale but preserve the spect ratio */
391 pfit_control |= PFIT_ENABLE;
392 if (IS_I965G(dev)) {
393 /* 965+ is easy, it does everything in hw */
394 if (panel_ratio > desired_ratio)
395 pfit_control |= PFIT_SCALING_PILLAR;
396 else if (panel_ratio < desired_ratio)
397 pfit_control |= PFIT_SCALING_LETTER;
398 else
399 pfit_control |= PFIT_SCALING_AUTO;
400 } else {
401 /*
402 * For earlier chips we have to calculate the scaling
403 * ratio by hand and program it into the
404 * PFIT_PGM_RATIO register
405 */
406 u32 horiz_bits, vert_bits, bits = 12;
407 horiz_ratio = mode->hdisplay * PANEL_RATIO_FACTOR/
408 adjusted_mode->hdisplay;
409 vert_ratio = mode->vdisplay * PANEL_RATIO_FACTOR/
410 adjusted_mode->vdisplay;
411 horiz_scale = adjusted_mode->hdisplay *
412 PANEL_RATIO_FACTOR / mode->hdisplay;
413 vert_scale = adjusted_mode->vdisplay *
414 PANEL_RATIO_FACTOR / mode->vdisplay;
415
416 /* retain aspect ratio */
417 if (panel_ratio > desired_ratio) { /* Pillar */
418 u32 scaled_width;
419 scaled_width = mode->hdisplay * vert_scale /
420 PANEL_RATIO_FACTOR;
421 horiz_ratio = vert_ratio;
422 pfit_control |= (VERT_AUTO_SCALE |
423 VERT_INTERP_BILINEAR |
424 HORIZ_INTERP_BILINEAR);
425 /* Pillar will have left/right borders */
426 left_border = (adjusted_mode->hdisplay -
427 scaled_width) / 2;
428 right_border = left_border;
429 if (mode->hdisplay & 1) /* odd resolutions */
430 right_border++;
431 /* keep the border be even */
432 if (right_border & 1)
433 right_border++;
434 adjusted_mode->crtc_hdisplay = scaled_width;
435 /* use border instead of border minus one */
436 adjusted_mode->crtc_hblank_start =
437 scaled_width + right_border;
438 /* keep the hblank width constant */
439 adjusted_mode->crtc_hblank_end =
440 adjusted_mode->crtc_hblank_start +
441 hblank_width;
442 /*
443 * get the hsync start pos relative to
444 * hblank start
445 */
446 hsync_pos = (hblank_width - hsync_width) / 2;
447 /* keep the hsync_pos be even */
448 if (hsync_pos & 1)
449 hsync_pos++;
450 adjusted_mode->crtc_hsync_start =
451 adjusted_mode->crtc_hblank_start +
452 hsync_pos;
453 /* keept hsync width constant */
454 adjusted_mode->crtc_hsync_end =
455 adjusted_mode->crtc_hsync_start +
456 hsync_width;
457 border = 1;
458 } else if (panel_ratio < desired_ratio) { /* letter */
459 u32 scaled_height = mode->vdisplay *
460 horiz_scale / PANEL_RATIO_FACTOR;
461 vert_ratio = horiz_ratio;
462 pfit_control |= (HORIZ_AUTO_SCALE |
463 VERT_INTERP_BILINEAR |
464 HORIZ_INTERP_BILINEAR);
465 /* Letterbox will have top/bottom border */
466 top_border = (adjusted_mode->vdisplay -
467 scaled_height) / 2;
468 bottom_border = top_border;
469 if (mode->vdisplay & 1)
470 bottom_border++;
471 adjusted_mode->crtc_vdisplay = scaled_height;
472 /* use border instead of border minus one */
473 adjusted_mode->crtc_vblank_start =
474 scaled_height + bottom_border;
475 /* keep the vblank width constant */
476 adjusted_mode->crtc_vblank_end =
477 adjusted_mode->crtc_vblank_start +
478 vblank_width;
479 /*
480 * get the vsync start pos relative to
481 * vblank start
482 */
483 vsync_pos = (vblank_width - vsync_width) / 2;
484 adjusted_mode->crtc_vsync_start =
485 adjusted_mode->crtc_vblank_start +
486 vsync_pos;
487 /* keep the vsync width constant */
488 adjusted_mode->crtc_vsync_end =
489 adjusted_mode->crtc_vsync_start +
490 vsync_width;
491 border = 1;
492 } else {
493 /* Aspects match, Let hw scale both directions */
494 pfit_control |= (VERT_AUTO_SCALE |
495 HORIZ_AUTO_SCALE |
496 VERT_INTERP_BILINEAR |
497 HORIZ_INTERP_BILINEAR);
498 }
499 horiz_bits = (1 << bits) * horiz_ratio /
500 PANEL_RATIO_FACTOR;
501 vert_bits = (1 << bits) * vert_ratio /
502 PANEL_RATIO_FACTOR;
503 pfit_pgm_ratios =
504 ((vert_bits << PFIT_VERT_SCALE_SHIFT) &
505 PFIT_VERT_SCALE_MASK) |
506 ((horiz_bits << PFIT_HORIZ_SCALE_SHIFT) &
507 PFIT_HORIZ_SCALE_MASK);
508 }
509 break;
510
511 case DRM_MODE_SCALE_FULLSCREEN:
512 /*
513 * Full scaling, even if it changes the aspect ratio.
514 * Fortunately this is all done for us in hw.
515 */
516 pfit_control |= PFIT_ENABLE;
517 if (IS_I965G(dev))
518 pfit_control |= PFIT_SCALING_AUTO;
519 else
520 pfit_control |= (VERT_AUTO_SCALE | HORIZ_AUTO_SCALE |
521 VERT_INTERP_BILINEAR |
522 HORIZ_INTERP_BILINEAR);
523 break;
524 default:
525 break;
526 }
527
528out:
529 lvds_priv->pfit_control = pfit_control;
530 lvds_priv->pfit_pgm_ratios = pfit_pgm_ratios;
259 /* 531 /*
260 * XXX: It would be nice to support lower refresh rates on the 532 * XXX: It would be nice to support lower refresh rates on the
261 * panels to reduce power consumption, and perhaps match the 533 * panels to reduce power consumption, and perhaps match the
@@ -301,8 +573,8 @@ static void intel_lvds_mode_set(struct drm_encoder *encoder,
301{ 573{
302 struct drm_device *dev = encoder->dev; 574 struct drm_device *dev = encoder->dev;
303 struct drm_i915_private *dev_priv = dev->dev_private; 575 struct drm_i915_private *dev_priv = dev->dev_private;
304 struct intel_crtc *intel_crtc = to_intel_crtc(encoder->crtc); 576 struct intel_output *intel_output = enc_to_intel_output(encoder);
305 u32 pfit_control; 577 struct intel_lvds_priv *lvds_priv = intel_output->dev_priv;
306 578
307 /* 579 /*
308 * The LVDS pin pair will already have been turned on in the 580 * The LVDS pin pair will already have been turned on in the
@@ -319,22 +591,8 @@ static void intel_lvds_mode_set(struct drm_encoder *encoder,
319 * screen. Should be enabled before the pipe is enabled, according to 591 * screen. Should be enabled before the pipe is enabled, according to
320 * register description and PRM. 592 * register description and PRM.
321 */ 593 */
322 if (mode->hdisplay != adjusted_mode->hdisplay || 594 I915_WRITE(PFIT_PGM_RATIOS, lvds_priv->pfit_pgm_ratios);
323 mode->vdisplay != adjusted_mode->vdisplay) 595 I915_WRITE(PFIT_CONTROL, lvds_priv->pfit_control);
324 pfit_control = (PFIT_ENABLE | VERT_AUTO_SCALE |
325 HORIZ_AUTO_SCALE | VERT_INTERP_BILINEAR |
326 HORIZ_INTERP_BILINEAR);
327 else
328 pfit_control = 0;
329
330 if (!IS_I965G(dev)) {
331 if (dev_priv->panel_wants_dither || dev_priv->lvds_dither)
332 pfit_control |= PANEL_8TO6_DITHER_ENABLE;
333 }
334 else
335 pfit_control |= intel_crtc->pipe << PFIT_PIPE_SHIFT;
336
337 I915_WRITE(PFIT_CONTROL, pfit_control);
338} 596}
339 597
340/** 598/**
@@ -406,6 +664,34 @@ static int intel_lvds_set_property(struct drm_connector *connector,
406 struct drm_property *property, 664 struct drm_property *property,
407 uint64_t value) 665 uint64_t value)
408{ 666{
667 struct drm_device *dev = connector->dev;
668 struct intel_output *intel_output =
669 to_intel_output(connector);
670
671 if (property == dev->mode_config.scaling_mode_property &&
672 connector->encoder) {
673 struct drm_crtc *crtc = connector->encoder->crtc;
674 struct intel_lvds_priv *lvds_priv = intel_output->dev_priv;
675 if (value == DRM_MODE_SCALE_NON_GPU) {
676 DRM_DEBUG_KMS(I915_LVDS,
677 "non_GPU property is unsupported\n");
678 return 0;
679 }
680 if (lvds_priv->fitting_mode == value) {
681 /* the LVDS scaling property is not changed */
682 return 0;
683 }
684 lvds_priv->fitting_mode = value;
685 if (crtc && crtc->enabled) {
686 /*
687 * If the CRTC is enabled, the display will be changed
688 * according to the new panel fitting mode.
689 */
690 drm_crtc_helper_set_mode(crtc, &crtc->mode,
691 crtc->x, crtc->y, crtc->fb);
692 }
693 }
694
409 return 0; 695 return 0;
410} 696}
411 697
@@ -456,7 +742,7 @@ static const struct dmi_system_id intel_no_lvds[] = {
456 .callback = intel_no_lvds_dmi_callback, 742 .callback = intel_no_lvds_dmi_callback,
457 .ident = "Apple Mac Mini (Core series)", 743 .ident = "Apple Mac Mini (Core series)",
458 .matches = { 744 .matches = {
459 DMI_MATCH(DMI_SYS_VENDOR, "Apple Inc."), 745 DMI_MATCH(DMI_SYS_VENDOR, "Apple"),
460 DMI_MATCH(DMI_PRODUCT_NAME, "Macmini1,1"), 746 DMI_MATCH(DMI_PRODUCT_NAME, "Macmini1,1"),
461 }, 747 },
462 }, 748 },
@@ -464,7 +750,7 @@ static const struct dmi_system_id intel_no_lvds[] = {
464 .callback = intel_no_lvds_dmi_callback, 750 .callback = intel_no_lvds_dmi_callback,
465 .ident = "Apple Mac Mini (Core 2 series)", 751 .ident = "Apple Mac Mini (Core 2 series)",
466 .matches = { 752 .matches = {
467 DMI_MATCH(DMI_SYS_VENDOR, "Apple Inc."), 753 DMI_MATCH(DMI_SYS_VENDOR, "Apple"),
468 DMI_MATCH(DMI_PRODUCT_NAME, "Macmini2,1"), 754 DMI_MATCH(DMI_PRODUCT_NAME, "Macmini2,1"),
469 }, 755 },
470 }, 756 },
@@ -494,6 +780,14 @@ static const struct dmi_system_id intel_no_lvds[] = {
494 }, 780 },
495 { 781 {
496 .callback = intel_no_lvds_dmi_callback, 782 .callback = intel_no_lvds_dmi_callback,
783 .ident = "AOpen Mini PC MP915",
784 .matches = {
785 DMI_MATCH(DMI_BOARD_VENDOR, "AOpen"),
786 DMI_MATCH(DMI_BOARD_NAME, "i915GMx-F"),
787 },
788 },
789 {
790 .callback = intel_no_lvds_dmi_callback,
497 .ident = "Aopen i945GTt-VFA", 791 .ident = "Aopen i945GTt-VFA",
498 .matches = { 792 .matches = {
499 DMI_MATCH(DMI_PRODUCT_VERSION, "AO00001JW"), 793 DMI_MATCH(DMI_PRODUCT_VERSION, "AO00001JW"),
@@ -503,6 +797,65 @@ static const struct dmi_system_id intel_no_lvds[] = {
503 { } /* terminating entry */ 797 { } /* terminating entry */
504}; 798};
505 799
800#ifdef CONFIG_ACPI
801/*
802 * check_lid_device -- check whether @handle is an ACPI LID device.
803 * @handle: ACPI device handle
804 * @level : depth in the ACPI namespace tree
805 * @context: the number of LID device when we find the device
806 * @rv: a return value to fill if desired (Not use)
807 */
808static acpi_status
809check_lid_device(acpi_handle handle, u32 level, void *context,
810 void **return_value)
811{
812 struct acpi_device *acpi_dev;
813 int *lid_present = context;
814
815 acpi_dev = NULL;
816 /* Get the acpi device for device handle */
817 if (acpi_bus_get_device(handle, &acpi_dev) || !acpi_dev) {
818 /* If there is no ACPI device for handle, return */
819 return AE_OK;
820 }
821
822 if (!strncmp(acpi_device_hid(acpi_dev), "PNP0C0D", 7))
823 *lid_present = 1;
824
825 return AE_OK;
826}
827
828/**
829 * check whether there exists the ACPI LID device by enumerating the ACPI
830 * device tree.
831 */
832static int intel_lid_present(void)
833{
834 int lid_present = 0;
835
836 if (acpi_disabled) {
837 /* If ACPI is disabled, there is no ACPI device tree to
838 * check, so assume the LID device would have been present.
839 */
840 return 1;
841 }
842
843 acpi_walk_namespace(ACPI_TYPE_DEVICE, ACPI_ROOT_OBJECT,
844 ACPI_UINT32_MAX,
845 check_lid_device, &lid_present, NULL);
846
847 return lid_present;
848}
849#else
850static int intel_lid_present(void)
851{
852 /* In the absence of ACPI built in, assume that the LID device would
853 * have been present.
854 */
855 return 1;
856}
857#endif
858
506/** 859/**
507 * intel_lvds_init - setup LVDS connectors on this device 860 * intel_lvds_init - setup LVDS connectors on this device
508 * @dev: drm device 861 * @dev: drm device
@@ -518,6 +871,7 @@ void intel_lvds_init(struct drm_device *dev)
518 struct drm_encoder *encoder; 871 struct drm_encoder *encoder;
519 struct drm_display_mode *scan; /* *modes, *bios_mode; */ 872 struct drm_display_mode *scan; /* *modes, *bios_mode; */
520 struct drm_crtc *crtc; 873 struct drm_crtc *crtc;
874 struct intel_lvds_priv *lvds_priv;
521 u32 lvds; 875 u32 lvds;
522 int pipe, gpio = GPIOC; 876 int pipe, gpio = GPIOC;
523 877
@@ -525,13 +879,28 @@ void intel_lvds_init(struct drm_device *dev)
525 if (dmi_check_system(intel_no_lvds)) 879 if (dmi_check_system(intel_no_lvds))
526 return; 880 return;
527 881
882 /* Assume that any device without an ACPI LID device also doesn't
883 * have an integrated LVDS. We would be better off parsing the BIOS
884 * to get a reliable indicator, but that code isn't written yet.
885 *
886 * In the case of all-in-one desktops using LVDS that we've seen,
887 * they're using SDVO LVDS.
888 */
889 if (!intel_lid_present())
890 return;
891
528 if (IS_IGDNG(dev)) { 892 if (IS_IGDNG(dev)) {
529 if ((I915_READ(PCH_LVDS) & LVDS_DETECTED) == 0) 893 if ((I915_READ(PCH_LVDS) & LVDS_DETECTED) == 0)
530 return; 894 return;
895 if (dev_priv->edp_support) {
896 DRM_DEBUG("disable LVDS for eDP support\n");
897 return;
898 }
531 gpio = PCH_GPIOC; 899 gpio = PCH_GPIOC;
532 } 900 }
533 901
534 intel_output = kzalloc(sizeof(struct intel_output), GFP_KERNEL); 902 intel_output = kzalloc(sizeof(struct intel_output) +
903 sizeof(struct intel_lvds_priv), GFP_KERNEL);
535 if (!intel_output) { 904 if (!intel_output) {
536 return; 905 return;
537 } 906 }
@@ -553,7 +922,18 @@ void intel_lvds_init(struct drm_device *dev)
553 connector->interlace_allowed = false; 922 connector->interlace_allowed = false;
554 connector->doublescan_allowed = false; 923 connector->doublescan_allowed = false;
555 924
925 lvds_priv = (struct intel_lvds_priv *)(intel_output + 1);
926 intel_output->dev_priv = lvds_priv;
927 /* create the scaling mode property */
928 drm_mode_create_scaling_mode_property(dev);
929 /*
930 * the initial panel fitting mode will be FULL_SCREEN.
931 */
556 932
933 drm_connector_attach_property(&intel_output->base,
934 dev->mode_config.scaling_mode_property,
935 DRM_MODE_SCALE_FULLSCREEN);
936 lvds_priv->fitting_mode = DRM_MODE_SCALE_FULLSCREEN;
557 /* 937 /*
558 * LVDS discovery: 938 * LVDS discovery:
559 * 1) check for EDID on DDC 939 * 1) check for EDID on DDC
@@ -649,5 +1029,5 @@ failed:
649 if (intel_output->ddc_bus) 1029 if (intel_output->ddc_bus)
650 intel_i2c_destroy(intel_output->ddc_bus); 1030 intel_i2c_destroy(intel_output->ddc_bus);
651 drm_connector_cleanup(connector); 1031 drm_connector_cleanup(connector);
652 kfree(connector); 1032 kfree(intel_output);
653} 1033}
diff --git a/drivers/gpu/drm/i915/intel_modes.c b/drivers/gpu/drm/i915/intel_modes.c
index e0910fefce87..67e2f4632a24 100644
--- a/drivers/gpu/drm/i915/intel_modes.c
+++ b/drivers/gpu/drm/i915/intel_modes.c
@@ -53,10 +53,9 @@ bool intel_ddc_probe(struct intel_output *intel_output)
53 } 53 }
54 }; 54 };
55 55
56 intel_i2c_quirk_set(intel_output->ddc_bus->drm_dev, true); 56 intel_i2c_quirk_set(intel_output->base.dev, true);
57 ret = i2c_transfer(&intel_output->ddc_bus->adapter, msgs, 2); 57 ret = i2c_transfer(intel_output->ddc_bus, msgs, 2);
58 intel_i2c_quirk_set(intel_output->ddc_bus->drm_dev, false); 58 intel_i2c_quirk_set(intel_output->base.dev, false);
59
60 if (ret == 2) 59 if (ret == 2)
61 return true; 60 return true;
62 61
@@ -74,10 +73,9 @@ int intel_ddc_get_modes(struct intel_output *intel_output)
74 struct edid *edid; 73 struct edid *edid;
75 int ret = 0; 74 int ret = 0;
76 75
77 intel_i2c_quirk_set(intel_output->ddc_bus->drm_dev, true); 76 intel_i2c_quirk_set(intel_output->base.dev, true);
78 edid = drm_get_edid(&intel_output->base, 77 edid = drm_get_edid(&intel_output->base, intel_output->ddc_bus);
79 &intel_output->ddc_bus->adapter); 78 intel_i2c_quirk_set(intel_output->base.dev, false);
80 intel_i2c_quirk_set(intel_output->ddc_bus->drm_dev, false);
81 if (edid) { 79 if (edid) {
82 drm_mode_connector_update_edid_property(&intel_output->base, 80 drm_mode_connector_update_edid_property(&intel_output->base,
83 edid); 81 edid);
diff --git a/drivers/gpu/drm/i915/intel_sdvo.c b/drivers/gpu/drm/i915/intel_sdvo.c
index 9a00adb3a508..5371d9332554 100644
--- a/drivers/gpu/drm/i915/intel_sdvo.c
+++ b/drivers/gpu/drm/i915/intel_sdvo.c
@@ -31,6 +31,7 @@
31#include "drm.h" 31#include "drm.h"
32#include "drm_crtc.h" 32#include "drm_crtc.h"
33#include "intel_drv.h" 33#include "intel_drv.h"
34#include "drm_edid.h"
34#include "i915_drm.h" 35#include "i915_drm.h"
35#include "i915_drv.h" 36#include "i915_drv.h"
36#include "intel_sdvo_regs.h" 37#include "intel_sdvo_regs.h"
@@ -38,8 +39,7 @@
38#undef SDVO_DEBUG 39#undef SDVO_DEBUG
39#define I915_SDVO "i915_sdvo" 40#define I915_SDVO "i915_sdvo"
40struct intel_sdvo_priv { 41struct intel_sdvo_priv {
41 struct intel_i2c_chan *i2c_bus; 42 u8 slave_addr;
42 int slaveaddr;
43 43
44 /* Register for the SDVO device: SDVOB or SDVOC */ 44 /* Register for the SDVO device: SDVOB or SDVOC */
45 int output_device; 45 int output_device;
@@ -56,6 +56,12 @@ struct intel_sdvo_priv {
56 /* Pixel clock limitations reported by the SDVO device, in kHz */ 56 /* Pixel clock limitations reported by the SDVO device, in kHz */
57 int pixel_clock_min, pixel_clock_max; 57 int pixel_clock_min, pixel_clock_max;
58 58
59 /*
60 * For multiple function SDVO device,
61 * this is for current attached outputs.
62 */
63 uint16_t attached_output;
64
59 /** 65 /**
60 * This is set if we're going to treat the device as TV-out. 66 * This is set if we're going to treat the device as TV-out.
61 * 67 *
@@ -69,12 +75,23 @@ struct intel_sdvo_priv {
69 * This is set if we treat the device as HDMI, instead of DVI. 75 * This is set if we treat the device as HDMI, instead of DVI.
70 */ 76 */
71 bool is_hdmi; 77 bool is_hdmi;
78
72 /** 79 /**
73 * This is set if we detect output of sdvo device as LVDS. 80 * This is set if we detect output of sdvo device as LVDS.
74 */ 81 */
75 bool is_lvds; 82 bool is_lvds;
76 83
77 /** 84 /**
85 * This is sdvo flags for input timing.
86 */
87 uint8_t sdvo_flags;
88
89 /**
90 * This is sdvo fixed pannel mode pointer
91 */
92 struct drm_display_mode *sdvo_lvds_fixed_mode;
93
94 /**
78 * Returned SDTV resolutions allowed for the current format, if the 95 * Returned SDTV resolutions allowed for the current format, if the
79 * device reported it. 96 * device reported it.
80 */ 97 */
@@ -104,6 +121,9 @@ struct intel_sdvo_priv {
104 u32 save_SDVOX; 121 u32 save_SDVOX;
105}; 122};
106 123
124static bool
125intel_sdvo_output_setup(struct intel_output *intel_output, uint16_t flags);
126
107/** 127/**
108 * Writes the SDVOB or SDVOC with the given value, but always writes both 128 * Writes the SDVOB or SDVOC with the given value, but always writes both
109 * SDVOB and SDVOC to work around apparent hardware issues (according to 129 * SDVOB and SDVOC to work around apparent hardware issues (according to
@@ -146,13 +166,13 @@ static bool intel_sdvo_read_byte(struct intel_output *intel_output, u8 addr,
146 166
147 struct i2c_msg msgs[] = { 167 struct i2c_msg msgs[] = {
148 { 168 {
149 .addr = sdvo_priv->i2c_bus->slave_addr, 169 .addr = sdvo_priv->slave_addr >> 1,
150 .flags = 0, 170 .flags = 0,
151 .len = 1, 171 .len = 1,
152 .buf = out_buf, 172 .buf = out_buf,
153 }, 173 },
154 { 174 {
155 .addr = sdvo_priv->i2c_bus->slave_addr, 175 .addr = sdvo_priv->slave_addr >> 1,
156 .flags = I2C_M_RD, 176 .flags = I2C_M_RD,
157 .len = 1, 177 .len = 1,
158 .buf = buf, 178 .buf = buf,
@@ -162,7 +182,7 @@ static bool intel_sdvo_read_byte(struct intel_output *intel_output, u8 addr,
162 out_buf[0] = addr; 182 out_buf[0] = addr;
163 out_buf[1] = 0; 183 out_buf[1] = 0;
164 184
165 if ((ret = i2c_transfer(&sdvo_priv->i2c_bus->adapter, msgs, 2)) == 2) 185 if ((ret = i2c_transfer(intel_output->i2c_bus, msgs, 2)) == 2)
166 { 186 {
167 *ch = buf[0]; 187 *ch = buf[0];
168 return true; 188 return true;
@@ -175,10 +195,11 @@ static bool intel_sdvo_read_byte(struct intel_output *intel_output, u8 addr,
175static bool intel_sdvo_write_byte(struct intel_output *intel_output, int addr, 195static bool intel_sdvo_write_byte(struct intel_output *intel_output, int addr,
176 u8 ch) 196 u8 ch)
177{ 197{
198 struct intel_sdvo_priv *sdvo_priv = intel_output->dev_priv;
178 u8 out_buf[2]; 199 u8 out_buf[2];
179 struct i2c_msg msgs[] = { 200 struct i2c_msg msgs[] = {
180 { 201 {
181 .addr = intel_output->i2c_bus->slave_addr, 202 .addr = sdvo_priv->slave_addr >> 1,
182 .flags = 0, 203 .flags = 0,
183 .len = 2, 204 .len = 2,
184 .buf = out_buf, 205 .buf = out_buf,
@@ -188,7 +209,7 @@ static bool intel_sdvo_write_byte(struct intel_output *intel_output, int addr,
188 out_buf[0] = addr; 209 out_buf[0] = addr;
189 out_buf[1] = ch; 210 out_buf[1] = ch;
190 211
191 if (i2c_transfer(&intel_output->i2c_bus->adapter, msgs, 1) == 1) 212 if (i2c_transfer(intel_output->i2c_bus, msgs, 1) == 1)
192 { 213 {
193 return true; 214 return true;
194 } 215 }
@@ -592,6 +613,7 @@ intel_sdvo_create_preferred_input_timing(struct intel_output *output,
592 uint16_t height) 613 uint16_t height)
593{ 614{
594 struct intel_sdvo_preferred_input_timing_args args; 615 struct intel_sdvo_preferred_input_timing_args args;
616 struct intel_sdvo_priv *sdvo_priv = output->dev_priv;
595 uint8_t status; 617 uint8_t status;
596 618
597 memset(&args, 0, sizeof(args)); 619 memset(&args, 0, sizeof(args));
@@ -599,7 +621,12 @@ intel_sdvo_create_preferred_input_timing(struct intel_output *output,
599 args.width = width; 621 args.width = width;
600 args.height = height; 622 args.height = height;
601 args.interlace = 0; 623 args.interlace = 0;
602 args.scaled = 0; 624
625 if (sdvo_priv->is_lvds &&
626 (sdvo_priv->sdvo_lvds_fixed_mode->hdisplay != width ||
627 sdvo_priv->sdvo_lvds_fixed_mode->vdisplay != height))
628 args.scaled = 1;
629
603 intel_sdvo_write_cmd(output, SDVO_CMD_CREATE_PREFERRED_INPUT_TIMING, 630 intel_sdvo_write_cmd(output, SDVO_CMD_CREATE_PREFERRED_INPUT_TIMING,
604 &args, sizeof(args)); 631 &args, sizeof(args));
605 status = intel_sdvo_read_response(output, NULL, 0); 632 status = intel_sdvo_read_response(output, NULL, 0);
@@ -944,12 +971,7 @@ static bool intel_sdvo_mode_fixup(struct drm_encoder *encoder,
944 struct intel_output *output = enc_to_intel_output(encoder); 971 struct intel_output *output = enc_to_intel_output(encoder);
945 struct intel_sdvo_priv *dev_priv = output->dev_priv; 972 struct intel_sdvo_priv *dev_priv = output->dev_priv;
946 973
947 if (!dev_priv->is_tv) { 974 if (dev_priv->is_tv) {
948 /* Make the CRTC code factor in the SDVO pixel multiplier. The
949 * SDVO device will be told of the multiplier during mode_set.
950 */
951 adjusted_mode->clock *= intel_sdvo_get_pixel_multiplier(mode);
952 } else {
953 struct intel_sdvo_dtd output_dtd; 975 struct intel_sdvo_dtd output_dtd;
954 bool success; 976 bool success;
955 977
@@ -980,6 +1002,47 @@ static bool intel_sdvo_mode_fixup(struct drm_encoder *encoder,
980 intel_sdvo_get_preferred_input_timing(output, 1002 intel_sdvo_get_preferred_input_timing(output,
981 &input_dtd); 1003 &input_dtd);
982 intel_sdvo_get_mode_from_dtd(adjusted_mode, &input_dtd); 1004 intel_sdvo_get_mode_from_dtd(adjusted_mode, &input_dtd);
1005 dev_priv->sdvo_flags = input_dtd.part2.sdvo_flags;
1006
1007 drm_mode_set_crtcinfo(adjusted_mode, 0);
1008
1009 mode->clock = adjusted_mode->clock;
1010
1011 adjusted_mode->clock *=
1012 intel_sdvo_get_pixel_multiplier(mode);
1013 } else {
1014 return false;
1015 }
1016 } else if (dev_priv->is_lvds) {
1017 struct intel_sdvo_dtd output_dtd;
1018 bool success;
1019
1020 drm_mode_set_crtcinfo(dev_priv->sdvo_lvds_fixed_mode, 0);
1021 /* Set output timings */
1022 intel_sdvo_get_dtd_from_mode(&output_dtd,
1023 dev_priv->sdvo_lvds_fixed_mode);
1024
1025 intel_sdvo_set_target_output(output,
1026 dev_priv->controlled_output);
1027 intel_sdvo_set_output_timing(output, &output_dtd);
1028
1029 /* Set the input timing to the screen. Assume always input 0. */
1030 intel_sdvo_set_target_input(output, true, false);
1031
1032
1033 success = intel_sdvo_create_preferred_input_timing(
1034 output,
1035 mode->clock / 10,
1036 mode->hdisplay,
1037 mode->vdisplay);
1038
1039 if (success) {
1040 struct intel_sdvo_dtd input_dtd;
1041
1042 intel_sdvo_get_preferred_input_timing(output,
1043 &input_dtd);
1044 intel_sdvo_get_mode_from_dtd(adjusted_mode, &input_dtd);
1045 dev_priv->sdvo_flags = input_dtd.part2.sdvo_flags;
983 1046
984 drm_mode_set_crtcinfo(adjusted_mode, 0); 1047 drm_mode_set_crtcinfo(adjusted_mode, 0);
985 1048
@@ -990,6 +1053,12 @@ static bool intel_sdvo_mode_fixup(struct drm_encoder *encoder,
990 } else { 1053 } else {
991 return false; 1054 return false;
992 } 1055 }
1056
1057 } else {
1058 /* Make the CRTC code factor in the SDVO pixel multiplier. The
1059 * SDVO device will be told of the multiplier during mode_set.
1060 */
1061 adjusted_mode->clock *= intel_sdvo_get_pixel_multiplier(mode);
993 } 1062 }
994 return true; 1063 return true;
995} 1064}
@@ -1033,15 +1102,16 @@ static void intel_sdvo_mode_set(struct drm_encoder *encoder,
1033 1102
1034 /* We have tried to get input timing in mode_fixup, and filled into 1103 /* We have tried to get input timing in mode_fixup, and filled into
1035 adjusted_mode */ 1104 adjusted_mode */
1036 if (sdvo_priv->is_tv) 1105 if (sdvo_priv->is_tv || sdvo_priv->is_lvds) {
1037 intel_sdvo_get_dtd_from_mode(&input_dtd, adjusted_mode); 1106 intel_sdvo_get_dtd_from_mode(&input_dtd, adjusted_mode);
1038 else 1107 input_dtd.part2.sdvo_flags = sdvo_priv->sdvo_flags;
1108 } else
1039 intel_sdvo_get_dtd_from_mode(&input_dtd, mode); 1109 intel_sdvo_get_dtd_from_mode(&input_dtd, mode);
1040 1110
1041 /* If it's a TV, we already set the output timing in mode_fixup. 1111 /* If it's a TV, we already set the output timing in mode_fixup.
1042 * Otherwise, the output timing is equal to the input timing. 1112 * Otherwise, the output timing is equal to the input timing.
1043 */ 1113 */
1044 if (!sdvo_priv->is_tv) { 1114 if (!sdvo_priv->is_tv && !sdvo_priv->is_lvds) {
1045 /* Set the output timing to the screen */ 1115 /* Set the output timing to the screen */
1046 intel_sdvo_set_target_output(output, 1116 intel_sdvo_set_target_output(output,
1047 sdvo_priv->controlled_output); 1117 sdvo_priv->controlled_output);
@@ -1116,6 +1186,8 @@ static void intel_sdvo_mode_set(struct drm_encoder *encoder,
1116 sdvox |= (sdvo_pixel_multiply - 1) << SDVO_PORT_MULTIPLY_SHIFT; 1186 sdvox |= (sdvo_pixel_multiply - 1) << SDVO_PORT_MULTIPLY_SHIFT;
1117 } 1187 }
1118 1188
1189 if (sdvo_priv->sdvo_flags & SDVO_NEED_TO_STALL)
1190 sdvox |= SDVO_STALL_SELECT;
1119 intel_sdvo_write_sdvox(output, sdvox); 1191 intel_sdvo_write_sdvox(output, sdvox);
1120} 1192}
1121 1193
@@ -1276,6 +1348,17 @@ static int intel_sdvo_mode_valid(struct drm_connector *connector,
1276 if (sdvo_priv->pixel_clock_max < mode->clock) 1348 if (sdvo_priv->pixel_clock_max < mode->clock)
1277 return MODE_CLOCK_HIGH; 1349 return MODE_CLOCK_HIGH;
1278 1350
1351 if (sdvo_priv->is_lvds == true) {
1352 if (sdvo_priv->sdvo_lvds_fixed_mode == NULL)
1353 return MODE_PANEL;
1354
1355 if (mode->hdisplay > sdvo_priv->sdvo_lvds_fixed_mode->hdisplay)
1356 return MODE_PANEL;
1357
1358 if (mode->vdisplay > sdvo_priv->sdvo_lvds_fixed_mode->vdisplay)
1359 return MODE_PANEL;
1360 }
1361
1279 return MODE_OK; 1362 return MODE_OK;
1280} 1363}
1281 1364
@@ -1362,42 +1445,96 @@ void intel_sdvo_set_hotplug(struct drm_connector *connector, int on)
1362 intel_sdvo_read_response(intel_output, &response, 2); 1445 intel_sdvo_read_response(intel_output, &response, 2);
1363} 1446}
1364 1447
1365static void 1448static bool
1366intel_sdvo_hdmi_sink_detect(struct drm_connector *connector) 1449intel_sdvo_multifunc_encoder(struct intel_output *intel_output)
1450{
1451 struct intel_sdvo_priv *sdvo_priv = intel_output->dev_priv;
1452 int caps = 0;
1453
1454 if (sdvo_priv->caps.output_flags &
1455 (SDVO_OUTPUT_TMDS0 | SDVO_OUTPUT_TMDS1))
1456 caps++;
1457 if (sdvo_priv->caps.output_flags &
1458 (SDVO_OUTPUT_RGB0 | SDVO_OUTPUT_RGB1))
1459 caps++;
1460 if (sdvo_priv->caps.output_flags &
1461 (SDVO_OUTPUT_SVID0 | SDVO_OUTPUT_SVID0))
1462 caps++;
1463 if (sdvo_priv->caps.output_flags &
1464 (SDVO_OUTPUT_CVBS0 | SDVO_OUTPUT_CVBS1))
1465 caps++;
1466 if (sdvo_priv->caps.output_flags &
1467 (SDVO_OUTPUT_YPRPB0 | SDVO_OUTPUT_YPRPB1))
1468 caps++;
1469
1470 if (sdvo_priv->caps.output_flags &
1471 (SDVO_OUTPUT_SCART0 | SDVO_OUTPUT_SCART1))
1472 caps++;
1473
1474 if (sdvo_priv->caps.output_flags &
1475 (SDVO_OUTPUT_LVDS0 | SDVO_OUTPUT_LVDS1))
1476 caps++;
1477
1478 return (caps > 1);
1479}
1480
1481enum drm_connector_status
1482intel_sdvo_hdmi_sink_detect(struct drm_connector *connector, u16 response)
1367{ 1483{
1368 struct intel_output *intel_output = to_intel_output(connector); 1484 struct intel_output *intel_output = to_intel_output(connector);
1369 struct intel_sdvo_priv *sdvo_priv = intel_output->dev_priv; 1485 struct intel_sdvo_priv *sdvo_priv = intel_output->dev_priv;
1486 enum drm_connector_status status = connector_status_connected;
1370 struct edid *edid = NULL; 1487 struct edid *edid = NULL;
1371 1488
1372 intel_sdvo_set_control_bus_switch(intel_output, sdvo_priv->ddc_bus);
1373 edid = drm_get_edid(&intel_output->base, 1489 edid = drm_get_edid(&intel_output->base,
1374 &intel_output->ddc_bus->adapter); 1490 intel_output->ddc_bus);
1375 if (edid != NULL) { 1491 if (edid != NULL) {
1376 sdvo_priv->is_hdmi = drm_detect_hdmi_monitor(edid); 1492 /* Don't report the output as connected if it's a DVI-I
1493 * connector with a non-digital EDID coming out.
1494 */
1495 if (response & (SDVO_OUTPUT_TMDS0 | SDVO_OUTPUT_TMDS1)) {
1496 if (edid->input & DRM_EDID_INPUT_DIGITAL)
1497 sdvo_priv->is_hdmi =
1498 drm_detect_hdmi_monitor(edid);
1499 else
1500 status = connector_status_disconnected;
1501 }
1502
1377 kfree(edid); 1503 kfree(edid);
1378 intel_output->base.display_info.raw_edid = NULL; 1504 intel_output->base.display_info.raw_edid = NULL;
1379 } 1505
1506 } else if (response & (SDVO_OUTPUT_TMDS0 | SDVO_OUTPUT_TMDS1))
1507 status = connector_status_disconnected;
1508
1509 return status;
1380} 1510}
1381 1511
1382static enum drm_connector_status intel_sdvo_detect(struct drm_connector *connector) 1512static enum drm_connector_status intel_sdvo_detect(struct drm_connector *connector)
1383{ 1513{
1384 u8 response[2]; 1514 uint16_t response;
1385 u8 status; 1515 u8 status;
1386 struct intel_output *intel_output = to_intel_output(connector); 1516 struct intel_output *intel_output = to_intel_output(connector);
1517 struct intel_sdvo_priv *sdvo_priv = intel_output->dev_priv;
1387 1518
1388 intel_sdvo_write_cmd(intel_output, SDVO_CMD_GET_ATTACHED_DISPLAYS, NULL, 0); 1519 intel_sdvo_write_cmd(intel_output, SDVO_CMD_GET_ATTACHED_DISPLAYS, NULL, 0);
1389 status = intel_sdvo_read_response(intel_output, &response, 2); 1520 status = intel_sdvo_read_response(intel_output, &response, 2);
1390 1521
1391 DRM_DEBUG("SDVO response %d %d\n", response[0], response[1]); 1522 DRM_DEBUG("SDVO response %d %d\n", response & 0xff, response >> 8);
1392 1523
1393 if (status != SDVO_CMD_STATUS_SUCCESS) 1524 if (status != SDVO_CMD_STATUS_SUCCESS)
1394 return connector_status_unknown; 1525 return connector_status_unknown;
1395 1526
1396 if ((response[0] != 0) || (response[1] != 0)) { 1527 if (response == 0)
1397 intel_sdvo_hdmi_sink_detect(connector);
1398 return connector_status_connected;
1399 } else
1400 return connector_status_disconnected; 1528 return connector_status_disconnected;
1529
1530 if (intel_sdvo_multifunc_encoder(intel_output) &&
1531 sdvo_priv->attached_output != response) {
1532 if (sdvo_priv->controlled_output != response &&
1533 intel_sdvo_output_setup(intel_output, response) != true)
1534 return connector_status_unknown;
1535 sdvo_priv->attached_output = response;
1536 }
1537 return intel_sdvo_hdmi_sink_detect(connector, response);
1401} 1538}
1402 1539
1403static void intel_sdvo_get_ddc_modes(struct drm_connector *connector) 1540static void intel_sdvo_get_ddc_modes(struct drm_connector *connector)
@@ -1549,23 +1686,21 @@ static void intel_sdvo_get_tv_modes(struct drm_connector *connector)
1549static void intel_sdvo_get_lvds_modes(struct drm_connector *connector) 1686static void intel_sdvo_get_lvds_modes(struct drm_connector *connector)
1550{ 1687{
1551 struct intel_output *intel_output = to_intel_output(connector); 1688 struct intel_output *intel_output = to_intel_output(connector);
1552 struct intel_sdvo_priv *sdvo_priv = intel_output->dev_priv;
1553 struct drm_i915_private *dev_priv = connector->dev->dev_private; 1689 struct drm_i915_private *dev_priv = connector->dev->dev_private;
1690 struct intel_sdvo_priv *sdvo_priv = intel_output->dev_priv;
1691 struct drm_display_mode *newmode;
1554 1692
1555 /* 1693 /*
1556 * Attempt to get the mode list from DDC. 1694 * Attempt to get the mode list from DDC.
1557 * Assume that the preferred modes are 1695 * Assume that the preferred modes are
1558 * arranged in priority order. 1696 * arranged in priority order.
1559 */ 1697 */
1560 /* set the bus switch and get the modes */
1561 intel_sdvo_set_control_bus_switch(intel_output, sdvo_priv->ddc_bus);
1562 intel_ddc_get_modes(intel_output); 1698 intel_ddc_get_modes(intel_output);
1563 if (list_empty(&connector->probed_modes) == false) 1699 if (list_empty(&connector->probed_modes) == false)
1564 return; 1700 goto end;
1565 1701
1566 /* Fetch modes from VBT */ 1702 /* Fetch modes from VBT */
1567 if (dev_priv->sdvo_lvds_vbt_mode != NULL) { 1703 if (dev_priv->sdvo_lvds_vbt_mode != NULL) {
1568 struct drm_display_mode *newmode;
1569 newmode = drm_mode_duplicate(connector->dev, 1704 newmode = drm_mode_duplicate(connector->dev,
1570 dev_priv->sdvo_lvds_vbt_mode); 1705 dev_priv->sdvo_lvds_vbt_mode);
1571 if (newmode != NULL) { 1706 if (newmode != NULL) {
@@ -1575,6 +1710,16 @@ static void intel_sdvo_get_lvds_modes(struct drm_connector *connector)
1575 drm_mode_probed_add(connector, newmode); 1710 drm_mode_probed_add(connector, newmode);
1576 } 1711 }
1577 } 1712 }
1713
1714end:
1715 list_for_each_entry(newmode, &connector->probed_modes, head) {
1716 if (newmode->type & DRM_MODE_TYPE_PREFERRED) {
1717 sdvo_priv->sdvo_lvds_fixed_mode =
1718 drm_mode_duplicate(connector->dev, newmode);
1719 break;
1720 }
1721 }
1722
1578} 1723}
1579 1724
1580static int intel_sdvo_get_modes(struct drm_connector *connector) 1725static int intel_sdvo_get_modes(struct drm_connector *connector)
@@ -1597,14 +1742,20 @@ static int intel_sdvo_get_modes(struct drm_connector *connector)
1597static void intel_sdvo_destroy(struct drm_connector *connector) 1742static void intel_sdvo_destroy(struct drm_connector *connector)
1598{ 1743{
1599 struct intel_output *intel_output = to_intel_output(connector); 1744 struct intel_output *intel_output = to_intel_output(connector);
1745 struct intel_sdvo_priv *sdvo_priv = intel_output->dev_priv;
1600 1746
1601 if (intel_output->i2c_bus) 1747 if (intel_output->i2c_bus)
1602 intel_i2c_destroy(intel_output->i2c_bus); 1748 intel_i2c_destroy(intel_output->i2c_bus);
1603 if (intel_output->ddc_bus) 1749 if (intel_output->ddc_bus)
1604 intel_i2c_destroy(intel_output->ddc_bus); 1750 intel_i2c_destroy(intel_output->ddc_bus);
1605 1751
1752 if (sdvo_priv->sdvo_lvds_fixed_mode != NULL)
1753 drm_mode_destroy(connector->dev,
1754 sdvo_priv->sdvo_lvds_fixed_mode);
1755
1606 drm_sysfs_connector_remove(connector); 1756 drm_sysfs_connector_remove(connector);
1607 drm_connector_cleanup(connector); 1757 drm_connector_cleanup(connector);
1758
1608 kfree(intel_output); 1759 kfree(intel_output);
1609} 1760}
1610 1761
@@ -1709,7 +1860,7 @@ intel_sdvo_chan_to_intel_output(struct intel_i2c_chan *chan)
1709 1860
1710 list_for_each_entry(connector, 1861 list_for_each_entry(connector,
1711 &dev->mode_config.connector_list, head) { 1862 &dev->mode_config.connector_list, head) {
1712 if (to_intel_output(connector)->ddc_bus == chan) { 1863 if (to_intel_output(connector)->ddc_bus == &chan->adapter) {
1713 intel_output = to_intel_output(connector); 1864 intel_output = to_intel_output(connector);
1714 break; 1865 break;
1715 } 1866 }
@@ -1723,7 +1874,7 @@ static int intel_sdvo_master_xfer(struct i2c_adapter *i2c_adap,
1723 struct intel_output *intel_output; 1874 struct intel_output *intel_output;
1724 struct intel_sdvo_priv *sdvo_priv; 1875 struct intel_sdvo_priv *sdvo_priv;
1725 struct i2c_algo_bit_data *algo_data; 1876 struct i2c_algo_bit_data *algo_data;
1726 struct i2c_algorithm *algo; 1877 const struct i2c_algorithm *algo;
1727 1878
1728 algo_data = (struct i2c_algo_bit_data *)i2c_adap->algo_data; 1879 algo_data = (struct i2c_algo_bit_data *)i2c_adap->algo_data;
1729 intel_output = 1880 intel_output =
@@ -1733,7 +1884,7 @@ static int intel_sdvo_master_xfer(struct i2c_adapter *i2c_adap,
1733 return -EINVAL; 1884 return -EINVAL;
1734 1885
1735 sdvo_priv = intel_output->dev_priv; 1886 sdvo_priv = intel_output->dev_priv;
1736 algo = (struct i2c_algorithm *)intel_output->i2c_bus->adapter.algo; 1887 algo = intel_output->i2c_bus->algo;
1737 1888
1738 intel_sdvo_set_control_bus_switch(intel_output, sdvo_priv->ddc_bus); 1889 intel_sdvo_set_control_bus_switch(intel_output, sdvo_priv->ddc_bus);
1739 return algo->master_xfer(i2c_adap, msgs, num); 1890 return algo->master_xfer(i2c_adap, msgs, num);
@@ -1780,18 +1931,101 @@ intel_sdvo_get_slave_addr(struct drm_device *dev, int output_device)
1780 return 0x72; 1931 return 0x72;
1781} 1932}
1782 1933
1934static bool
1935intel_sdvo_output_setup(struct intel_output *intel_output, uint16_t flags)
1936{
1937 struct drm_connector *connector = &intel_output->base;
1938 struct drm_encoder *encoder = &intel_output->enc;
1939 struct intel_sdvo_priv *sdvo_priv = intel_output->dev_priv;
1940 bool ret = true, registered = false;
1941
1942 sdvo_priv->is_tv = false;
1943 intel_output->needs_tv_clock = false;
1944 sdvo_priv->is_lvds = false;
1945
1946 if (device_is_registered(&connector->kdev)) {
1947 drm_sysfs_connector_remove(connector);
1948 registered = true;
1949 }
1950
1951 if (flags &
1952 (SDVO_OUTPUT_TMDS0 | SDVO_OUTPUT_TMDS1)) {
1953 if (sdvo_priv->caps.output_flags & SDVO_OUTPUT_TMDS0)
1954 sdvo_priv->controlled_output = SDVO_OUTPUT_TMDS0;
1955 else
1956 sdvo_priv->controlled_output = SDVO_OUTPUT_TMDS1;
1957
1958 encoder->encoder_type = DRM_MODE_ENCODER_TMDS;
1959 connector->connector_type = DRM_MODE_CONNECTOR_DVID;
1960
1961 if (intel_sdvo_get_supp_encode(intel_output,
1962 &sdvo_priv->encode) &&
1963 intel_sdvo_get_digital_encoding_mode(intel_output) &&
1964 sdvo_priv->is_hdmi) {
1965 /* enable hdmi encoding mode if supported */
1966 intel_sdvo_set_encode(intel_output, SDVO_ENCODE_HDMI);
1967 intel_sdvo_set_colorimetry(intel_output,
1968 SDVO_COLORIMETRY_RGB256);
1969 connector->connector_type = DRM_MODE_CONNECTOR_HDMIA;
1970 }
1971 } else if (flags & SDVO_OUTPUT_SVID0) {
1972
1973 sdvo_priv->controlled_output = SDVO_OUTPUT_SVID0;
1974 encoder->encoder_type = DRM_MODE_ENCODER_TVDAC;
1975 connector->connector_type = DRM_MODE_CONNECTOR_SVIDEO;
1976 sdvo_priv->is_tv = true;
1977 intel_output->needs_tv_clock = true;
1978 } else if (flags & SDVO_OUTPUT_RGB0) {
1979
1980 sdvo_priv->controlled_output = SDVO_OUTPUT_RGB0;
1981 encoder->encoder_type = DRM_MODE_ENCODER_DAC;
1982 connector->connector_type = DRM_MODE_CONNECTOR_VGA;
1983 } else if (flags & SDVO_OUTPUT_RGB1) {
1984
1985 sdvo_priv->controlled_output = SDVO_OUTPUT_RGB1;
1986 encoder->encoder_type = DRM_MODE_ENCODER_DAC;
1987 connector->connector_type = DRM_MODE_CONNECTOR_VGA;
1988 } else if (flags & SDVO_OUTPUT_LVDS0) {
1989
1990 sdvo_priv->controlled_output = SDVO_OUTPUT_LVDS0;
1991 encoder->encoder_type = DRM_MODE_ENCODER_LVDS;
1992 connector->connector_type = DRM_MODE_CONNECTOR_LVDS;
1993 sdvo_priv->is_lvds = true;
1994 } else if (flags & SDVO_OUTPUT_LVDS1) {
1995
1996 sdvo_priv->controlled_output = SDVO_OUTPUT_LVDS1;
1997 encoder->encoder_type = DRM_MODE_ENCODER_LVDS;
1998 connector->connector_type = DRM_MODE_CONNECTOR_LVDS;
1999 sdvo_priv->is_lvds = true;
2000 } else {
2001
2002 unsigned char bytes[2];
2003
2004 sdvo_priv->controlled_output = 0;
2005 memcpy(bytes, &sdvo_priv->caps.output_flags, 2);
2006 DRM_DEBUG_KMS(I915_SDVO,
2007 "%s: Unknown SDVO output type (0x%02x%02x)\n",
2008 SDVO_NAME(sdvo_priv),
2009 bytes[0], bytes[1]);
2010 ret = false;
2011 }
2012
2013 if (ret && registered)
2014 ret = drm_sysfs_connector_add(connector) == 0 ? true : false;
2015
2016
2017 return ret;
2018
2019}
2020
1783bool intel_sdvo_init(struct drm_device *dev, int output_device) 2021bool intel_sdvo_init(struct drm_device *dev, int output_device)
1784{ 2022{
1785 struct drm_connector *connector; 2023 struct drm_connector *connector;
1786 struct intel_output *intel_output; 2024 struct intel_output *intel_output;
1787 struct intel_sdvo_priv *sdvo_priv; 2025 struct intel_sdvo_priv *sdvo_priv;
1788 struct intel_i2c_chan *i2cbus = NULL; 2026
1789 struct intel_i2c_chan *ddcbus = NULL;
1790 int connector_type;
1791 u8 ch[0x40]; 2027 u8 ch[0x40];
1792 int i; 2028 int i;
1793 int encoder_type, output_id;
1794 u8 slave_addr;
1795 2029
1796 intel_output = kcalloc(sizeof(struct intel_output)+sizeof(struct intel_sdvo_priv), 1, GFP_KERNEL); 2030 intel_output = kcalloc(sizeof(struct intel_output)+sizeof(struct intel_sdvo_priv), 1, GFP_KERNEL);
1797 if (!intel_output) { 2031 if (!intel_output) {
@@ -1799,29 +2033,24 @@ bool intel_sdvo_init(struct drm_device *dev, int output_device)
1799 } 2033 }
1800 2034
1801 sdvo_priv = (struct intel_sdvo_priv *)(intel_output + 1); 2035 sdvo_priv = (struct intel_sdvo_priv *)(intel_output + 1);
2036 sdvo_priv->output_device = output_device;
2037
2038 intel_output->dev_priv = sdvo_priv;
1802 intel_output->type = INTEL_OUTPUT_SDVO; 2039 intel_output->type = INTEL_OUTPUT_SDVO;
1803 2040
1804 /* setup the DDC bus. */ 2041 /* setup the DDC bus. */
1805 if (output_device == SDVOB) 2042 if (output_device == SDVOB)
1806 i2cbus = intel_i2c_create(dev, GPIOE, "SDVOCTRL_E for SDVOB"); 2043 intel_output->i2c_bus = intel_i2c_create(dev, GPIOE, "SDVOCTRL_E for SDVOB");
1807 else 2044 else
1808 i2cbus = intel_i2c_create(dev, GPIOE, "SDVOCTRL_E for SDVOC"); 2045 intel_output->i2c_bus = intel_i2c_create(dev, GPIOE, "SDVOCTRL_E for SDVOC");
1809 2046
1810 if (!i2cbus) 2047 if (!intel_output->i2c_bus)
1811 goto err_inteloutput; 2048 goto err_inteloutput;
1812 2049
1813 slave_addr = intel_sdvo_get_slave_addr(dev, output_device); 2050 sdvo_priv->slave_addr = intel_sdvo_get_slave_addr(dev, output_device);
1814 sdvo_priv->i2c_bus = i2cbus;
1815 2051
1816 if (output_device == SDVOB) { 2052 /* Save the bit-banging i2c functionality for use by the DDC wrapper */
1817 output_id = 1; 2053 intel_sdvo_i2c_bit_algo.functionality = intel_output->i2c_bus->algo->functionality;
1818 } else {
1819 output_id = 2;
1820 }
1821 sdvo_priv->i2c_bus->slave_addr = slave_addr >> 1;
1822 sdvo_priv->output_device = output_device;
1823 intel_output->i2c_bus = i2cbus;
1824 intel_output->dev_priv = sdvo_priv;
1825 2054
1826 /* Read the regs to test if we can talk to the device */ 2055 /* Read the regs to test if we can talk to the device */
1827 for (i = 0; i < 0x40; i++) { 2056 for (i = 0; i < 0x40; i++) {
@@ -1835,101 +2064,39 @@ bool intel_sdvo_init(struct drm_device *dev, int output_device)
1835 2064
1836 /* setup the DDC bus. */ 2065 /* setup the DDC bus. */
1837 if (output_device == SDVOB) 2066 if (output_device == SDVOB)
1838 ddcbus = intel_i2c_create(dev, GPIOE, "SDVOB DDC BUS"); 2067 intel_output->ddc_bus = intel_i2c_create(dev, GPIOE, "SDVOB DDC BUS");
1839 else 2068 else
1840 ddcbus = intel_i2c_create(dev, GPIOE, "SDVOC DDC BUS"); 2069 intel_output->ddc_bus = intel_i2c_create(dev, GPIOE, "SDVOC DDC BUS");
1841 2070
1842 if (ddcbus == NULL) 2071 if (intel_output->ddc_bus == NULL)
1843 goto err_i2c; 2072 goto err_i2c;
1844 2073
1845 intel_sdvo_i2c_bit_algo.functionality = 2074 /* Wrap with our custom algo which switches to DDC mode */
1846 intel_output->i2c_bus->adapter.algo->functionality; 2075 intel_output->ddc_bus->algo = &intel_sdvo_i2c_bit_algo;
1847 ddcbus->adapter.algo = &intel_sdvo_i2c_bit_algo;
1848 intel_output->ddc_bus = ddcbus;
1849 2076
1850 /* In defaut case sdvo lvds is false */ 2077 /* In defaut case sdvo lvds is false */
1851 sdvo_priv->is_lvds = false;
1852 intel_sdvo_get_capabilities(intel_output, &sdvo_priv->caps); 2078 intel_sdvo_get_capabilities(intel_output, &sdvo_priv->caps);
1853 2079
1854 if (sdvo_priv->caps.output_flags & 2080 if (intel_sdvo_output_setup(intel_output,
1855 (SDVO_OUTPUT_TMDS0 | SDVO_OUTPUT_TMDS1)) { 2081 sdvo_priv->caps.output_flags) != true) {
1856 if (sdvo_priv->caps.output_flags & SDVO_OUTPUT_TMDS0) 2082 DRM_DEBUG("SDVO output failed to setup on SDVO%c\n",
1857 sdvo_priv->controlled_output = SDVO_OUTPUT_TMDS0; 2083 output_device == SDVOB ? 'B' : 'C');
1858 else
1859 sdvo_priv->controlled_output = SDVO_OUTPUT_TMDS1;
1860
1861 encoder_type = DRM_MODE_ENCODER_TMDS;
1862 connector_type = DRM_MODE_CONNECTOR_DVID;
1863
1864 if (intel_sdvo_get_supp_encode(intel_output,
1865 &sdvo_priv->encode) &&
1866 intel_sdvo_get_digital_encoding_mode(intel_output) &&
1867 sdvo_priv->is_hdmi) {
1868 /* enable hdmi encoding mode if supported */
1869 intel_sdvo_set_encode(intel_output, SDVO_ENCODE_HDMI);
1870 intel_sdvo_set_colorimetry(intel_output,
1871 SDVO_COLORIMETRY_RGB256);
1872 connector_type = DRM_MODE_CONNECTOR_HDMIA;
1873 }
1874 }
1875 else if (sdvo_priv->caps.output_flags & SDVO_OUTPUT_SVID0)
1876 {
1877 sdvo_priv->controlled_output = SDVO_OUTPUT_SVID0;
1878 encoder_type = DRM_MODE_ENCODER_TVDAC;
1879 connector_type = DRM_MODE_CONNECTOR_SVIDEO;
1880 sdvo_priv->is_tv = true;
1881 intel_output->needs_tv_clock = true;
1882 }
1883 else if (sdvo_priv->caps.output_flags & SDVO_OUTPUT_RGB0)
1884 {
1885 sdvo_priv->controlled_output = SDVO_OUTPUT_RGB0;
1886 encoder_type = DRM_MODE_ENCODER_DAC;
1887 connector_type = DRM_MODE_CONNECTOR_VGA;
1888 }
1889 else if (sdvo_priv->caps.output_flags & SDVO_OUTPUT_RGB1)
1890 {
1891 sdvo_priv->controlled_output = SDVO_OUTPUT_RGB1;
1892 encoder_type = DRM_MODE_ENCODER_DAC;
1893 connector_type = DRM_MODE_CONNECTOR_VGA;
1894 }
1895 else if (sdvo_priv->caps.output_flags & SDVO_OUTPUT_LVDS0)
1896 {
1897 sdvo_priv->controlled_output = SDVO_OUTPUT_LVDS0;
1898 encoder_type = DRM_MODE_ENCODER_LVDS;
1899 connector_type = DRM_MODE_CONNECTOR_LVDS;
1900 sdvo_priv->is_lvds = true;
1901 }
1902 else if (sdvo_priv->caps.output_flags & SDVO_OUTPUT_LVDS1)
1903 {
1904 sdvo_priv->controlled_output = SDVO_OUTPUT_LVDS1;
1905 encoder_type = DRM_MODE_ENCODER_LVDS;
1906 connector_type = DRM_MODE_CONNECTOR_LVDS;
1907 sdvo_priv->is_lvds = true;
1908 }
1909 else
1910 {
1911 unsigned char bytes[2];
1912
1913 sdvo_priv->controlled_output = 0;
1914 memcpy (bytes, &sdvo_priv->caps.output_flags, 2);
1915 DRM_DEBUG_KMS(I915_SDVO,
1916 "%s: Unknown SDVO output type (0x%02x%02x)\n",
1917 SDVO_NAME(sdvo_priv),
1918 bytes[0], bytes[1]);
1919 encoder_type = DRM_MODE_ENCODER_NONE;
1920 connector_type = DRM_MODE_CONNECTOR_Unknown;
1921 goto err_i2c; 2084 goto err_i2c;
1922 } 2085 }
1923 2086
2087
1924 connector = &intel_output->base; 2088 connector = &intel_output->base;
1925 drm_connector_init(dev, connector, &intel_sdvo_connector_funcs, 2089 drm_connector_init(dev, connector, &intel_sdvo_connector_funcs,
1926 connector_type); 2090 connector->connector_type);
2091
1927 drm_connector_helper_add(connector, &intel_sdvo_connector_helper_funcs); 2092 drm_connector_helper_add(connector, &intel_sdvo_connector_helper_funcs);
1928 connector->interlace_allowed = 0; 2093 connector->interlace_allowed = 0;
1929 connector->doublescan_allowed = 0; 2094 connector->doublescan_allowed = 0;
1930 connector->display_info.subpixel_order = SubPixelHorizontalRGB; 2095 connector->display_info.subpixel_order = SubPixelHorizontalRGB;
1931 2096
1932 drm_encoder_init(dev, &intel_output->enc, &intel_sdvo_enc_funcs, encoder_type); 2097 drm_encoder_init(dev, &intel_output->enc,
2098 &intel_sdvo_enc_funcs, intel_output->enc.encoder_type);
2099
1933 drm_encoder_helper_add(&intel_output->enc, &intel_sdvo_helper_funcs); 2100 drm_encoder_helper_add(&intel_output->enc, &intel_sdvo_helper_funcs);
1934 2101
1935 drm_mode_connector_attach_encoder(&intel_output->base, &intel_output->enc); 2102 drm_mode_connector_attach_encoder(&intel_output->base, &intel_output->enc);
@@ -1965,9 +2132,10 @@ bool intel_sdvo_init(struct drm_device *dev, int output_device)
1965 return true; 2132 return true;
1966 2133
1967err_i2c: 2134err_i2c:
1968 if (ddcbus != NULL) 2135 if (intel_output->ddc_bus != NULL)
1969 intel_i2c_destroy(intel_output->ddc_bus); 2136 intel_i2c_destroy(intel_output->ddc_bus);
1970 intel_i2c_destroy(intel_output->i2c_bus); 2137 if (intel_output->i2c_bus != NULL)
2138 intel_i2c_destroy(intel_output->i2c_bus);
1971err_inteloutput: 2139err_inteloutput:
1972 kfree(intel_output); 2140 kfree(intel_output);
1973 2141
diff --git a/drivers/gpu/drm/i915/intel_sdvo_regs.h b/drivers/gpu/drm/i915/intel_sdvo_regs.h
index 193938b7d7f9..ba5cdf8ae40b 100644
--- a/drivers/gpu/drm/i915/intel_sdvo_regs.h
+++ b/drivers/gpu/drm/i915/intel_sdvo_regs.h
@@ -715,6 +715,7 @@ struct intel_sdvo_enhancements_arg {
715 #define SDVO_HBUF_TX_ONCE (2 << 6) 715 #define SDVO_HBUF_TX_ONCE (2 << 6)
716 #define SDVO_HBUF_TX_VSYNC (3 << 6) 716 #define SDVO_HBUF_TX_VSYNC (3 << 6)
717#define SDVO_CMD_GET_AUDIO_TX_INFO 0x9c 717#define SDVO_CMD_GET_AUDIO_TX_INFO 0x9c
718#define SDVO_NEED_TO_STALL (1 << 7)
718 719
719struct intel_sdvo_encode{ 720struct intel_sdvo_encode{
720 u8 dvi_rev; 721 u8 dvi_rev;
diff --git a/drivers/gpu/drm/i915/intel_tv.c b/drivers/gpu/drm/i915/intel_tv.c
index ea68992e4416..da4ab4dc1630 100644
--- a/drivers/gpu/drm/i915/intel_tv.c
+++ b/drivers/gpu/drm/i915/intel_tv.c
@@ -1383,34 +1383,31 @@ intel_tv_detect_type (struct drm_crtc *crtc, struct intel_output *intel_output)
1383 /* 1383 /*
1384 * Detect TV by polling) 1384 * Detect TV by polling)
1385 */ 1385 */
1386 if (intel_output->load_detect_temp) { 1386 save_tv_dac = tv_dac;
1387 /* TV not currently running, prod it with destructive detect */ 1387 tv_ctl = I915_READ(TV_CTL);
1388 save_tv_dac = tv_dac; 1388 save_tv_ctl = tv_ctl;
1389 tv_ctl = I915_READ(TV_CTL); 1389 tv_ctl &= ~TV_ENC_ENABLE;
1390 save_tv_ctl = tv_ctl; 1390 tv_ctl &= ~TV_TEST_MODE_MASK;
1391 tv_ctl &= ~TV_ENC_ENABLE; 1391 tv_ctl |= TV_TEST_MODE_MONITOR_DETECT;
1392 tv_ctl &= ~TV_TEST_MODE_MASK; 1392 tv_dac &= ~TVDAC_SENSE_MASK;
1393 tv_ctl |= TV_TEST_MODE_MONITOR_DETECT; 1393 tv_dac &= ~DAC_A_MASK;
1394 tv_dac &= ~TVDAC_SENSE_MASK; 1394 tv_dac &= ~DAC_B_MASK;
1395 tv_dac &= ~DAC_A_MASK; 1395 tv_dac &= ~DAC_C_MASK;
1396 tv_dac &= ~DAC_B_MASK; 1396 tv_dac |= (TVDAC_STATE_CHG_EN |
1397 tv_dac &= ~DAC_C_MASK; 1397 TVDAC_A_SENSE_CTL |
1398 tv_dac |= (TVDAC_STATE_CHG_EN | 1398 TVDAC_B_SENSE_CTL |
1399 TVDAC_A_SENSE_CTL | 1399 TVDAC_C_SENSE_CTL |
1400 TVDAC_B_SENSE_CTL | 1400 DAC_CTL_OVERRIDE |
1401 TVDAC_C_SENSE_CTL | 1401 DAC_A_0_7_V |
1402 DAC_CTL_OVERRIDE | 1402 DAC_B_0_7_V |
1403 DAC_A_0_7_V | 1403 DAC_C_0_7_V);
1404 DAC_B_0_7_V | 1404 I915_WRITE(TV_CTL, tv_ctl);
1405 DAC_C_0_7_V); 1405 I915_WRITE(TV_DAC, tv_dac);
1406 I915_WRITE(TV_CTL, tv_ctl); 1406 intel_wait_for_vblank(dev);
1407 I915_WRITE(TV_DAC, tv_dac); 1407 tv_dac = I915_READ(TV_DAC);
1408 intel_wait_for_vblank(dev); 1408 I915_WRITE(TV_DAC, save_tv_dac);
1409 tv_dac = I915_READ(TV_DAC); 1409 I915_WRITE(TV_CTL, save_tv_ctl);
1410 I915_WRITE(TV_DAC, save_tv_dac); 1410 intel_wait_for_vblank(dev);
1411 I915_WRITE(TV_CTL, save_tv_ctl);
1412 intel_wait_for_vblank(dev);
1413 }
1414 /* 1411 /*
1415 * A B C 1412 * A B C
1416 * 0 1 1 Composite 1413 * 0 1 1 Composite
@@ -1493,6 +1490,27 @@ static struct input_res {
1493 {"1920x1080", 1920, 1080}, 1490 {"1920x1080", 1920, 1080},
1494}; 1491};
1495 1492
1493/*
1494 * Chose preferred mode according to line number of TV format
1495 */
1496static void
1497intel_tv_chose_preferred_modes(struct drm_connector *connector,
1498 struct drm_display_mode *mode_ptr)
1499{
1500 struct intel_output *intel_output = to_intel_output(connector);
1501 const struct tv_mode *tv_mode = intel_tv_mode_find(intel_output);
1502
1503 if (tv_mode->nbr_end < 480 && mode_ptr->vdisplay == 480)
1504 mode_ptr->type |= DRM_MODE_TYPE_PREFERRED;
1505 else if (tv_mode->nbr_end > 480) {
1506 if (tv_mode->progressive == true && tv_mode->nbr_end < 720) {
1507 if (mode_ptr->vdisplay == 720)
1508 mode_ptr->type |= DRM_MODE_TYPE_PREFERRED;
1509 } else if (mode_ptr->vdisplay == 1080)
1510 mode_ptr->type |= DRM_MODE_TYPE_PREFERRED;
1511 }
1512}
1513
1496/** 1514/**
1497 * Stub get_modes function. 1515 * Stub get_modes function.
1498 * 1516 *
@@ -1547,6 +1565,7 @@ intel_tv_get_modes(struct drm_connector *connector)
1547 mode_ptr->clock = (int) tmp; 1565 mode_ptr->clock = (int) tmp;
1548 1566
1549 mode_ptr->type = DRM_MODE_TYPE_DRIVER; 1567 mode_ptr->type = DRM_MODE_TYPE_DRIVER;
1568 intel_tv_chose_preferred_modes(connector, mode_ptr);
1550 drm_mode_probed_add(connector, mode_ptr); 1569 drm_mode_probed_add(connector, mode_ptr);
1551 count++; 1570 count++;
1552 } 1571 }
diff --git a/drivers/gpu/drm/radeon/Makefile b/drivers/gpu/drm/radeon/Makefile
index 5fae1e074b4b..013d38059943 100644
--- a/drivers/gpu/drm/radeon/Makefile
+++ b/drivers/gpu/drm/radeon/Makefile
@@ -13,7 +13,8 @@ radeon-$(CONFIG_DRM_RADEON_KMS) += radeon_device.o radeon_kms.o \
13 radeon_encoders.o radeon_display.o radeon_cursor.o radeon_i2c.o \ 13 radeon_encoders.o radeon_display.o radeon_cursor.o radeon_i2c.o \
14 radeon_clocks.o radeon_fb.o radeon_gem.o radeon_ring.o radeon_irq_kms.o \ 14 radeon_clocks.o radeon_fb.o radeon_gem.o radeon_ring.o radeon_irq_kms.o \
15 radeon_cs.o radeon_bios.o radeon_benchmark.o r100.o r300.o r420.o \ 15 radeon_cs.o radeon_bios.o radeon_benchmark.o r100.o r300.o r420.o \
16 rs400.o rs600.o rs690.o rv515.o r520.o r600.o rs780.o rv770.o 16 rs400.o rs600.o rs690.o rv515.o r520.o r600.o rs780.o rv770.o \
17 radeon_test.o
17 18
18radeon-$(CONFIG_COMPAT) += radeon_ioc32.o 19radeon-$(CONFIG_COMPAT) += radeon_ioc32.o
19 20
diff --git a/drivers/gpu/drm/radeon/atombios_crtc.c b/drivers/gpu/drm/radeon/atombios_crtc.c
index c0080cc9bf8d..74d034f77c6b 100644
--- a/drivers/gpu/drm/radeon/atombios_crtc.c
+++ b/drivers/gpu/drm/radeon/atombios_crtc.c
@@ -31,6 +31,132 @@
31#include "atom.h" 31#include "atom.h"
32#include "atom-bits.h" 32#include "atom-bits.h"
33 33
34static void atombios_overscan_setup(struct drm_crtc *crtc,
35 struct drm_display_mode *mode,
36 struct drm_display_mode *adjusted_mode)
37{
38 struct drm_device *dev = crtc->dev;
39 struct radeon_device *rdev = dev->dev_private;
40 struct radeon_crtc *radeon_crtc = to_radeon_crtc(crtc);
41 SET_CRTC_OVERSCAN_PS_ALLOCATION args;
42 int index = GetIndexIntoMasterTable(COMMAND, SetCRTC_OverScan);
43 int a1, a2;
44
45 memset(&args, 0, sizeof(args));
46
47 args.usOverscanRight = 0;
48 args.usOverscanLeft = 0;
49 args.usOverscanBottom = 0;
50 args.usOverscanTop = 0;
51 args.ucCRTC = radeon_crtc->crtc_id;
52
53 switch (radeon_crtc->rmx_type) {
54 case RMX_CENTER:
55 args.usOverscanTop = (adjusted_mode->crtc_vdisplay - mode->crtc_vdisplay) / 2;
56 args.usOverscanBottom = (adjusted_mode->crtc_vdisplay - mode->crtc_vdisplay) / 2;
57 args.usOverscanLeft = (adjusted_mode->crtc_hdisplay - mode->crtc_hdisplay) / 2;
58 args.usOverscanRight = (adjusted_mode->crtc_hdisplay - mode->crtc_hdisplay) / 2;
59 atom_execute_table(rdev->mode_info.atom_context, index, (uint32_t *)&args);
60 break;
61 case RMX_ASPECT:
62 a1 = mode->crtc_vdisplay * adjusted_mode->crtc_hdisplay;
63 a2 = adjusted_mode->crtc_vdisplay * mode->crtc_hdisplay;
64
65 if (a1 > a2) {
66 args.usOverscanLeft = (adjusted_mode->crtc_hdisplay - (a2 / mode->crtc_vdisplay)) / 2;
67 args.usOverscanRight = (adjusted_mode->crtc_hdisplay - (a2 / mode->crtc_vdisplay)) / 2;
68 } else if (a2 > a1) {
69 args.usOverscanLeft = (adjusted_mode->crtc_vdisplay - (a1 / mode->crtc_hdisplay)) / 2;
70 args.usOverscanRight = (adjusted_mode->crtc_vdisplay - (a1 / mode->crtc_hdisplay)) / 2;
71 }
72 atom_execute_table(rdev->mode_info.atom_context, index, (uint32_t *)&args);
73 break;
74 case RMX_FULL:
75 default:
76 args.usOverscanRight = 0;
77 args.usOverscanLeft = 0;
78 args.usOverscanBottom = 0;
79 args.usOverscanTop = 0;
80 atom_execute_table(rdev->mode_info.atom_context, index, (uint32_t *)&args);
81 break;
82 }
83}
84
85static void atombios_scaler_setup(struct drm_crtc *crtc)
86{
87 struct drm_device *dev = crtc->dev;
88 struct radeon_device *rdev = dev->dev_private;
89 struct radeon_crtc *radeon_crtc = to_radeon_crtc(crtc);
90 ENABLE_SCALER_PS_ALLOCATION args;
91 int index = GetIndexIntoMasterTable(COMMAND, EnableScaler);
92 /* fixme - fill in enc_priv for atom dac */
93 enum radeon_tv_std tv_std = TV_STD_NTSC;
94
95 if (!ASIC_IS_AVIVO(rdev) && radeon_crtc->crtc_id)
96 return;
97
98 memset(&args, 0, sizeof(args));
99
100 args.ucScaler = radeon_crtc->crtc_id;
101
102 if (radeon_crtc->devices & (ATOM_DEVICE_TV_SUPPORT)) {
103 switch (tv_std) {
104 case TV_STD_NTSC:
105 default:
106 args.ucTVStandard = ATOM_TV_NTSC;
107 break;
108 case TV_STD_PAL:
109 args.ucTVStandard = ATOM_TV_PAL;
110 break;
111 case TV_STD_PAL_M:
112 args.ucTVStandard = ATOM_TV_PALM;
113 break;
114 case TV_STD_PAL_60:
115 args.ucTVStandard = ATOM_TV_PAL60;
116 break;
117 case TV_STD_NTSC_J:
118 args.ucTVStandard = ATOM_TV_NTSCJ;
119 break;
120 case TV_STD_SCART_PAL:
121 args.ucTVStandard = ATOM_TV_PAL; /* ??? */
122 break;
123 case TV_STD_SECAM:
124 args.ucTVStandard = ATOM_TV_SECAM;
125 break;
126 case TV_STD_PAL_CN:
127 args.ucTVStandard = ATOM_TV_PALCN;
128 break;
129 }
130 args.ucEnable = SCALER_ENABLE_MULTITAP_MODE;
131 } else if (radeon_crtc->devices & (ATOM_DEVICE_CV_SUPPORT)) {
132 args.ucTVStandard = ATOM_TV_CV;
133 args.ucEnable = SCALER_ENABLE_MULTITAP_MODE;
134 } else {
135 switch (radeon_crtc->rmx_type) {
136 case RMX_FULL:
137 args.ucEnable = ATOM_SCALER_EXPANSION;
138 break;
139 case RMX_CENTER:
140 args.ucEnable = ATOM_SCALER_CENTER;
141 break;
142 case RMX_ASPECT:
143 args.ucEnable = ATOM_SCALER_EXPANSION;
144 break;
145 default:
146 if (ASIC_IS_AVIVO(rdev))
147 args.ucEnable = ATOM_SCALER_DISABLE;
148 else
149 args.ucEnable = ATOM_SCALER_CENTER;
150 break;
151 }
152 }
153 atom_execute_table(rdev->mode_info.atom_context, index, (uint32_t *)&args);
154 if (radeon_crtc->devices & (ATOM_DEVICE_CV_SUPPORT | ATOM_DEVICE_TV_SUPPORT)
155 && rdev->family >= CHIP_RV515 && rdev->family <= CHIP_RV570) {
156 atom_rv515_force_tv_scaler(rdev);
157 }
158}
159
34static void atombios_lock_crtc(struct drm_crtc *crtc, int lock) 160static void atombios_lock_crtc(struct drm_crtc *crtc, int lock)
35{ 161{
36 struct radeon_crtc *radeon_crtc = to_radeon_crtc(crtc); 162 struct radeon_crtc *radeon_crtc = to_radeon_crtc(crtc);
@@ -203,6 +329,12 @@ void atombios_crtc_set_pll(struct drm_crtc *crtc, struct drm_display_mode *mode)
203 if (ASIC_IS_AVIVO(rdev)) { 329 if (ASIC_IS_AVIVO(rdev)) {
204 uint32_t ss_cntl; 330 uint32_t ss_cntl;
205 331
332 if ((rdev->family == CHIP_RS600) ||
333 (rdev->family == CHIP_RS690) ||
334 (rdev->family == CHIP_RS740))
335 pll_flags |= (RADEON_PLL_USE_FRAC_FB_DIV |
336 RADEON_PLL_PREFER_CLOSEST_LOWER);
337
206 if (ASIC_IS_DCE32(rdev) && mode->clock > 200000) /* range limits??? */ 338 if (ASIC_IS_DCE32(rdev) && mode->clock > 200000) /* range limits??? */
207 pll_flags |= RADEON_PLL_PREFER_HIGH_FB_DIV; 339 pll_flags |= RADEON_PLL_PREFER_HIGH_FB_DIV;
208 else 340 else
@@ -321,7 +453,7 @@ int atombios_crtc_set_base(struct drm_crtc *crtc, int x, int y,
321 struct drm_gem_object *obj; 453 struct drm_gem_object *obj;
322 struct drm_radeon_gem_object *obj_priv; 454 struct drm_radeon_gem_object *obj_priv;
323 uint64_t fb_location; 455 uint64_t fb_location;
324 uint32_t fb_format, fb_pitch_pixels; 456 uint32_t fb_format, fb_pitch_pixels, tiling_flags;
325 457
326 if (!crtc->fb) 458 if (!crtc->fb)
327 return -EINVAL; 459 return -EINVAL;
@@ -358,7 +490,14 @@ int atombios_crtc_set_base(struct drm_crtc *crtc, int x, int y,
358 return -EINVAL; 490 return -EINVAL;
359 } 491 }
360 492
361 /* TODO tiling */ 493 radeon_object_get_tiling_flags(obj->driver_private,
494 &tiling_flags, NULL);
495 if (tiling_flags & RADEON_TILING_MACRO)
496 fb_format |= AVIVO_D1GRPH_MACRO_ADDRESS_MODE;
497
498 if (tiling_flags & RADEON_TILING_MICRO)
499 fb_format |= AVIVO_D1GRPH_TILED;
500
362 if (radeon_crtc->crtc_id == 0) 501 if (radeon_crtc->crtc_id == 0)
363 WREG32(AVIVO_D1VGA_CONTROL, 0); 502 WREG32(AVIVO_D1VGA_CONTROL, 0);
364 else 503 else
@@ -509,6 +648,9 @@ int atombios_crtc_mode_set(struct drm_crtc *crtc,
509 radeon_crtc_set_base(crtc, x, y, old_fb); 648 radeon_crtc_set_base(crtc, x, y, old_fb);
510 radeon_legacy_atom_set_surface(crtc); 649 radeon_legacy_atom_set_surface(crtc);
511 } 650 }
651 atombios_overscan_setup(crtc, mode, adjusted_mode);
652 atombios_scaler_setup(crtc);
653 radeon_bandwidth_update(rdev);
512 return 0; 654 return 0;
513} 655}
514 656
@@ -516,6 +658,8 @@ static bool atombios_crtc_mode_fixup(struct drm_crtc *crtc,
516 struct drm_display_mode *mode, 658 struct drm_display_mode *mode,
517 struct drm_display_mode *adjusted_mode) 659 struct drm_display_mode *adjusted_mode)
518{ 660{
661 if (!radeon_crtc_scaling_mode_fixup(crtc, mode, adjusted_mode))
662 return false;
519 return true; 663 return true;
520} 664}
521 665
@@ -548,148 +692,3 @@ void radeon_atombios_init_crtc(struct drm_device *dev,
548 AVIVO_D2CRTC_H_TOTAL - AVIVO_D1CRTC_H_TOTAL; 692 AVIVO_D2CRTC_H_TOTAL - AVIVO_D1CRTC_H_TOTAL;
549 drm_crtc_helper_add(&radeon_crtc->base, &atombios_helper_funcs); 693 drm_crtc_helper_add(&radeon_crtc->base, &atombios_helper_funcs);
550} 694}
551
552void radeon_init_disp_bw_avivo(struct drm_device *dev,
553 struct drm_display_mode *mode1,
554 uint32_t pixel_bytes1,
555 struct drm_display_mode *mode2,
556 uint32_t pixel_bytes2)
557{
558 struct radeon_device *rdev = dev->dev_private;
559 fixed20_12 min_mem_eff;
560 fixed20_12 peak_disp_bw, mem_bw, pix_clk, pix_clk2, temp_ff;
561 fixed20_12 sclk_ff, mclk_ff;
562 uint32_t dc_lb_memory_split, temp;
563
564 min_mem_eff.full = rfixed_const_8(0);
565 if (rdev->disp_priority == 2) {
566 uint32_t mc_init_misc_lat_timer = 0;
567 if (rdev->family == CHIP_RV515)
568 mc_init_misc_lat_timer =
569 RREG32_MC(RV515_MC_INIT_MISC_LAT_TIMER);
570 else if (rdev->family == CHIP_RS690)
571 mc_init_misc_lat_timer =
572 RREG32_MC(RS690_MC_INIT_MISC_LAT_TIMER);
573
574 mc_init_misc_lat_timer &=
575 ~(R300_MC_DISP1R_INIT_LAT_MASK <<
576 R300_MC_DISP1R_INIT_LAT_SHIFT);
577 mc_init_misc_lat_timer &=
578 ~(R300_MC_DISP0R_INIT_LAT_MASK <<
579 R300_MC_DISP0R_INIT_LAT_SHIFT);
580
581 if (mode2)
582 mc_init_misc_lat_timer |=
583 (1 << R300_MC_DISP1R_INIT_LAT_SHIFT);
584 if (mode1)
585 mc_init_misc_lat_timer |=
586 (1 << R300_MC_DISP0R_INIT_LAT_SHIFT);
587
588 if (rdev->family == CHIP_RV515)
589 WREG32_MC(RV515_MC_INIT_MISC_LAT_TIMER,
590 mc_init_misc_lat_timer);
591 else if (rdev->family == CHIP_RS690)
592 WREG32_MC(RS690_MC_INIT_MISC_LAT_TIMER,
593 mc_init_misc_lat_timer);
594 }
595
596 /*
597 * determine is there is enough bw for current mode
598 */
599 temp_ff.full = rfixed_const(100);
600 mclk_ff.full = rfixed_const(rdev->clock.default_mclk);
601 mclk_ff.full = rfixed_div(mclk_ff, temp_ff);
602 sclk_ff.full = rfixed_const(rdev->clock.default_sclk);
603 sclk_ff.full = rfixed_div(sclk_ff, temp_ff);
604
605 temp = (rdev->mc.vram_width / 8) * (rdev->mc.vram_is_ddr ? 2 : 1);
606 temp_ff.full = rfixed_const(temp);
607 mem_bw.full = rfixed_mul(mclk_ff, temp_ff);
608 mem_bw.full = rfixed_mul(mem_bw, min_mem_eff);
609
610 pix_clk.full = 0;
611 pix_clk2.full = 0;
612 peak_disp_bw.full = 0;
613 if (mode1) {
614 temp_ff.full = rfixed_const(1000);
615 pix_clk.full = rfixed_const(mode1->clock); /* convert to fixed point */
616 pix_clk.full = rfixed_div(pix_clk, temp_ff);
617 temp_ff.full = rfixed_const(pixel_bytes1);
618 peak_disp_bw.full += rfixed_mul(pix_clk, temp_ff);
619 }
620 if (mode2) {
621 temp_ff.full = rfixed_const(1000);
622 pix_clk2.full = rfixed_const(mode2->clock); /* convert to fixed point */
623 pix_clk2.full = rfixed_div(pix_clk2, temp_ff);
624 temp_ff.full = rfixed_const(pixel_bytes2);
625 peak_disp_bw.full += rfixed_mul(pix_clk2, temp_ff);
626 }
627
628 if (peak_disp_bw.full >= mem_bw.full) {
629 DRM_ERROR
630 ("You may not have enough display bandwidth for current mode\n"
631 "If you have flickering problem, try to lower resolution, refresh rate, or color depth\n");
632 printk("peak disp bw %d, mem_bw %d\n",
633 rfixed_trunc(peak_disp_bw), rfixed_trunc(mem_bw));
634 }
635
636 /*
637 * Line Buffer Setup
638 * There is a single line buffer shared by both display controllers.
639 * DC_LB_MEMORY_SPLIT controls how that line buffer is shared between the display
640 * controllers. The paritioning can either be done manually or via one of four
641 * preset allocations specified in bits 1:0:
642 * 0 - line buffer is divided in half and shared between each display controller
643 * 1 - D1 gets 3/4 of the line buffer, D2 gets 1/4
644 * 2 - D1 gets the whole buffer
645 * 3 - D1 gets 1/4 of the line buffer, D2 gets 3/4
646 * Setting bit 2 of DC_LB_MEMORY_SPLIT controls switches to manual allocation mode.
647 * In manual allocation mode, D1 always starts at 0, D1 end/2 is specified in bits
648 * 14:4; D2 allocation follows D1.
649 */
650
651 /* is auto or manual better ? */
652 dc_lb_memory_split =
653 RREG32(AVIVO_DC_LB_MEMORY_SPLIT) & ~AVIVO_DC_LB_MEMORY_SPLIT_MASK;
654 dc_lb_memory_split &= ~AVIVO_DC_LB_MEMORY_SPLIT_SHIFT_MODE;
655#if 1
656 /* auto */
657 if (mode1 && mode2) {
658 if (mode1->hdisplay > mode2->hdisplay) {
659 if (mode1->hdisplay > 2560)
660 dc_lb_memory_split |=
661 AVIVO_DC_LB_MEMORY_SPLIT_D1_3Q_D2_1Q;
662 else
663 dc_lb_memory_split |=
664 AVIVO_DC_LB_MEMORY_SPLIT_D1HALF_D2HALF;
665 } else if (mode2->hdisplay > mode1->hdisplay) {
666 if (mode2->hdisplay > 2560)
667 dc_lb_memory_split |=
668 AVIVO_DC_LB_MEMORY_SPLIT_D1_1Q_D2_3Q;
669 else
670 dc_lb_memory_split |=
671 AVIVO_DC_LB_MEMORY_SPLIT_D1HALF_D2HALF;
672 } else
673 dc_lb_memory_split |=
674 AVIVO_DC_LB_MEMORY_SPLIT_D1HALF_D2HALF;
675 } else if (mode1) {
676 dc_lb_memory_split |= AVIVO_DC_LB_MEMORY_SPLIT_D1_ONLY;
677 } else if (mode2) {
678 dc_lb_memory_split |= AVIVO_DC_LB_MEMORY_SPLIT_D1_1Q_D2_3Q;
679 }
680#else
681 /* manual */
682 dc_lb_memory_split |= AVIVO_DC_LB_MEMORY_SPLIT_SHIFT_MODE;
683 dc_lb_memory_split &=
684 ~(AVIVO_DC_LB_DISP1_END_ADR_MASK <<
685 AVIVO_DC_LB_DISP1_END_ADR_SHIFT);
686 if (mode1) {
687 dc_lb_memory_split |=
688 ((((mode1->hdisplay / 2) + 64) & AVIVO_DC_LB_DISP1_END_ADR_MASK)
689 << AVIVO_DC_LB_DISP1_END_ADR_SHIFT);
690 } else if (mode2) {
691 dc_lb_memory_split |= (0 << AVIVO_DC_LB_DISP1_END_ADR_SHIFT);
692 }
693#endif
694 WREG32(AVIVO_DC_LB_MEMORY_SPLIT, dc_lb_memory_split);
695}
diff --git a/drivers/gpu/drm/radeon/r100.c b/drivers/gpu/drm/radeon/r100.c
index c550932a108f..f1ba8ff41130 100644
--- a/drivers/gpu/drm/radeon/r100.c
+++ b/drivers/gpu/drm/radeon/r100.c
@@ -110,7 +110,7 @@ int r100_pci_gart_set_page(struct radeon_device *rdev, int i, uint64_t addr)
110 if (i < 0 || i > rdev->gart.num_gpu_pages) { 110 if (i < 0 || i > rdev->gart.num_gpu_pages) {
111 return -EINVAL; 111 return -EINVAL;
112 } 112 }
113 rdev->gart.table.ram.ptr[i] = cpu_to_le32((uint32_t)addr); 113 rdev->gart.table.ram.ptr[i] = cpu_to_le32(lower_32_bits(addr));
114 return 0; 114 return 0;
115} 115}
116 116
@@ -173,8 +173,12 @@ void r100_mc_setup(struct radeon_device *rdev)
173 DRM_ERROR("Failed to register debugfs file for R100 MC !\n"); 173 DRM_ERROR("Failed to register debugfs file for R100 MC !\n");
174 } 174 }
175 /* Write VRAM size in case we are limiting it */ 175 /* Write VRAM size in case we are limiting it */
176 WREG32(RADEON_CONFIG_MEMSIZE, rdev->mc.vram_size); 176 WREG32(RADEON_CONFIG_MEMSIZE, rdev->mc.real_vram_size);
177 tmp = rdev->mc.vram_location + rdev->mc.vram_size - 1; 177 /* Novell bug 204882 for RN50/M6/M7 with 8/16/32MB VRAM,
178 * if the aperture is 64MB but we have 32MB VRAM
179 * we report only 32MB VRAM but we have to set MC_FB_LOCATION
180 * to 64MB, otherwise the gpu accidentially dies */
181 tmp = rdev->mc.vram_location + rdev->mc.mc_vram_size - 1;
178 tmp = REG_SET(RADEON_MC_FB_TOP, tmp >> 16); 182 tmp = REG_SET(RADEON_MC_FB_TOP, tmp >> 16);
179 tmp |= REG_SET(RADEON_MC_FB_START, rdev->mc.vram_location >> 16); 183 tmp |= REG_SET(RADEON_MC_FB_START, rdev->mc.vram_location >> 16);
180 WREG32(RADEON_MC_FB_LOCATION, tmp); 184 WREG32(RADEON_MC_FB_LOCATION, tmp);
@@ -215,7 +219,6 @@ int r100_mc_init(struct radeon_device *rdev)
215 r100_pci_gart_disable(rdev); 219 r100_pci_gart_disable(rdev);
216 220
217 /* Setup GPU memory space */ 221 /* Setup GPU memory space */
218 rdev->mc.vram_location = 0xFFFFFFFFUL;
219 rdev->mc.gtt_location = 0xFFFFFFFFUL; 222 rdev->mc.gtt_location = 0xFFFFFFFFUL;
220 if (rdev->flags & RADEON_IS_AGP) { 223 if (rdev->flags & RADEON_IS_AGP) {
221 r = radeon_agp_init(rdev); 224 r = radeon_agp_init(rdev);
@@ -719,13 +722,14 @@ int r100_cs_packet_parse(struct radeon_cs_parser *p,
719 unsigned idx) 722 unsigned idx)
720{ 723{
721 struct radeon_cs_chunk *ib_chunk = &p->chunks[p->chunk_ib_idx]; 724 struct radeon_cs_chunk *ib_chunk = &p->chunks[p->chunk_ib_idx];
722 uint32_t header = ib_chunk->kdata[idx]; 725 uint32_t header;
723 726
724 if (idx >= ib_chunk->length_dw) { 727 if (idx >= ib_chunk->length_dw) {
725 DRM_ERROR("Can not parse packet at %d after CS end %d !\n", 728 DRM_ERROR("Can not parse packet at %d after CS end %d !\n",
726 idx, ib_chunk->length_dw); 729 idx, ib_chunk->length_dw);
727 return -EINVAL; 730 return -EINVAL;
728 } 731 }
732 header = ib_chunk->kdata[idx];
729 pkt->idx = idx; 733 pkt->idx = idx;
730 pkt->type = CP_PACKET_GET_TYPE(header); 734 pkt->type = CP_PACKET_GET_TYPE(header);
731 pkt->count = CP_PACKET_GET_COUNT(header); 735 pkt->count = CP_PACKET_GET_COUNT(header);
@@ -753,6 +757,102 @@ int r100_cs_packet_parse(struct radeon_cs_parser *p,
753} 757}
754 758
755/** 759/**
760 * r100_cs_packet_next_vline() - parse userspace VLINE packet
761 * @parser: parser structure holding parsing context.
762 *
763 * Userspace sends a special sequence for VLINE waits.
764 * PACKET0 - VLINE_START_END + value
765 * PACKET0 - WAIT_UNTIL +_value
766 * RELOC (P3) - crtc_id in reloc.
767 *
768 * This function parses this and relocates the VLINE START END
769 * and WAIT UNTIL packets to the correct crtc.
770 * It also detects a switched off crtc and nulls out the
771 * wait in that case.
772 */
773int r100_cs_packet_parse_vline(struct radeon_cs_parser *p)
774{
775 struct radeon_cs_chunk *ib_chunk;
776 struct drm_mode_object *obj;
777 struct drm_crtc *crtc;
778 struct radeon_crtc *radeon_crtc;
779 struct radeon_cs_packet p3reloc, waitreloc;
780 int crtc_id;
781 int r;
782 uint32_t header, h_idx, reg;
783
784 ib_chunk = &p->chunks[p->chunk_ib_idx];
785
786 /* parse the wait until */
787 r = r100_cs_packet_parse(p, &waitreloc, p->idx);
788 if (r)
789 return r;
790
791 /* check its a wait until and only 1 count */
792 if (waitreloc.reg != RADEON_WAIT_UNTIL ||
793 waitreloc.count != 0) {
794 DRM_ERROR("vline wait had illegal wait until segment\n");
795 r = -EINVAL;
796 return r;
797 }
798
799 if (ib_chunk->kdata[waitreloc.idx + 1] != RADEON_WAIT_CRTC_VLINE) {
800 DRM_ERROR("vline wait had illegal wait until\n");
801 r = -EINVAL;
802 return r;
803 }
804
805 /* jump over the NOP */
806 r = r100_cs_packet_parse(p, &p3reloc, p->idx);
807 if (r)
808 return r;
809
810 h_idx = p->idx - 2;
811 p->idx += waitreloc.count;
812 p->idx += p3reloc.count;
813
814 header = ib_chunk->kdata[h_idx];
815 crtc_id = ib_chunk->kdata[h_idx + 5];
816 reg = ib_chunk->kdata[h_idx] >> 2;
817 mutex_lock(&p->rdev->ddev->mode_config.mutex);
818 obj = drm_mode_object_find(p->rdev->ddev, crtc_id, DRM_MODE_OBJECT_CRTC);
819 if (!obj) {
820 DRM_ERROR("cannot find crtc %d\n", crtc_id);
821 r = -EINVAL;
822 goto out;
823 }
824 crtc = obj_to_crtc(obj);
825 radeon_crtc = to_radeon_crtc(crtc);
826 crtc_id = radeon_crtc->crtc_id;
827
828 if (!crtc->enabled) {
829 /* if the CRTC isn't enabled - we need to nop out the wait until */
830 ib_chunk->kdata[h_idx + 2] = PACKET2(0);
831 ib_chunk->kdata[h_idx + 3] = PACKET2(0);
832 } else if (crtc_id == 1) {
833 switch (reg) {
834 case AVIVO_D1MODE_VLINE_START_END:
835 header &= R300_CP_PACKET0_REG_MASK;
836 header |= AVIVO_D2MODE_VLINE_START_END >> 2;
837 break;
838 case RADEON_CRTC_GUI_TRIG_VLINE:
839 header &= R300_CP_PACKET0_REG_MASK;
840 header |= RADEON_CRTC2_GUI_TRIG_VLINE >> 2;
841 break;
842 default:
843 DRM_ERROR("unknown crtc reloc\n");
844 r = -EINVAL;
845 goto out;
846 }
847 ib_chunk->kdata[h_idx] = header;
848 ib_chunk->kdata[h_idx + 3] |= RADEON_ENG_DISPLAY_SELECT_CRTC1;
849 }
850out:
851 mutex_unlock(&p->rdev->ddev->mode_config.mutex);
852 return r;
853}
854
855/**
756 * r100_cs_packet_next_reloc() - parse next packet which should be reloc packet3 856 * r100_cs_packet_next_reloc() - parse next packet which should be reloc packet3
757 * @parser: parser structure holding parsing context. 857 * @parser: parser structure holding parsing context.
758 * @data: pointer to relocation data 858 * @data: pointer to relocation data
@@ -814,6 +914,7 @@ static int r100_packet0_check(struct radeon_cs_parser *p,
814 unsigned idx; 914 unsigned idx;
815 bool onereg; 915 bool onereg;
816 int r; 916 int r;
917 u32 tile_flags = 0;
817 918
818 ib = p->ib->ptr; 919 ib = p->ib->ptr;
819 ib_chunk = &p->chunks[p->chunk_ib_idx]; 920 ib_chunk = &p->chunks[p->chunk_ib_idx];
@@ -825,6 +926,15 @@ static int r100_packet0_check(struct radeon_cs_parser *p,
825 } 926 }
826 for (i = 0; i <= pkt->count; i++, idx++, reg += 4) { 927 for (i = 0; i <= pkt->count; i++, idx++, reg += 4) {
827 switch (reg) { 928 switch (reg) {
929 case RADEON_CRTC_GUI_TRIG_VLINE:
930 r = r100_cs_packet_parse_vline(p);
931 if (r) {
932 DRM_ERROR("No reloc for ib[%d]=0x%04X\n",
933 idx, reg);
934 r100_cs_dump_packet(p, pkt);
935 return r;
936 }
937 break;
828 /* FIXME: only allow PACKET3 blit? easier to check for out of 938 /* FIXME: only allow PACKET3 blit? easier to check for out of
829 * range access */ 939 * range access */
830 case RADEON_DST_PITCH_OFFSET: 940 case RADEON_DST_PITCH_OFFSET:
@@ -838,7 +948,20 @@ static int r100_packet0_check(struct radeon_cs_parser *p,
838 } 948 }
839 tmp = ib_chunk->kdata[idx] & 0x003fffff; 949 tmp = ib_chunk->kdata[idx] & 0x003fffff;
840 tmp += (((u32)reloc->lobj.gpu_offset) >> 10); 950 tmp += (((u32)reloc->lobj.gpu_offset) >> 10);
841 ib[idx] = (ib_chunk->kdata[idx] & 0xffc00000) | tmp; 951
952 if (reloc->lobj.tiling_flags & RADEON_TILING_MACRO)
953 tile_flags |= RADEON_DST_TILE_MACRO;
954 if (reloc->lobj.tiling_flags & RADEON_TILING_MICRO) {
955 if (reg == RADEON_SRC_PITCH_OFFSET) {
956 DRM_ERROR("Cannot src blit from microtiled surface\n");
957 r100_cs_dump_packet(p, pkt);
958 return -EINVAL;
959 }
960 tile_flags |= RADEON_DST_TILE_MICRO;
961 }
962
963 tmp |= tile_flags;
964 ib[idx] = (ib_chunk->kdata[idx] & 0x3fc00000) | tmp;
842 break; 965 break;
843 case RADEON_RB3D_DEPTHOFFSET: 966 case RADEON_RB3D_DEPTHOFFSET:
844 case RADEON_RB3D_COLOROFFSET: 967 case RADEON_RB3D_COLOROFFSET:
@@ -869,6 +992,11 @@ static int r100_packet0_check(struct radeon_cs_parser *p,
869 case R300_TX_OFFSET_0+52: 992 case R300_TX_OFFSET_0+52:
870 case R300_TX_OFFSET_0+56: 993 case R300_TX_OFFSET_0+56:
871 case R300_TX_OFFSET_0+60: 994 case R300_TX_OFFSET_0+60:
995 /* rn50 has no 3D engine so fail on any 3d setup */
996 if (ASIC_IS_RN50(p->rdev)) {
997 DRM_ERROR("attempt to use RN50 3D engine failed\n");
998 return -EINVAL;
999 }
872 r = r100_cs_packet_next_reloc(p, &reloc); 1000 r = r100_cs_packet_next_reloc(p, &reloc);
873 if (r) { 1001 if (r) {
874 DRM_ERROR("No reloc for ib[%d]=0x%04X\n", 1002 DRM_ERROR("No reloc for ib[%d]=0x%04X\n",
@@ -878,6 +1006,25 @@ static int r100_packet0_check(struct radeon_cs_parser *p,
878 } 1006 }
879 ib[idx] = ib_chunk->kdata[idx] + ((u32)reloc->lobj.gpu_offset); 1007 ib[idx] = ib_chunk->kdata[idx] + ((u32)reloc->lobj.gpu_offset);
880 break; 1008 break;
1009 case R300_RB3D_COLORPITCH0:
1010 case RADEON_RB3D_COLORPITCH:
1011 r = r100_cs_packet_next_reloc(p, &reloc);
1012 if (r) {
1013 DRM_ERROR("No reloc for ib[%d]=0x%04X\n",
1014 idx, reg);
1015 r100_cs_dump_packet(p, pkt);
1016 return r;
1017 }
1018
1019 if (reloc->lobj.tiling_flags & RADEON_TILING_MACRO)
1020 tile_flags |= RADEON_COLOR_TILE_ENABLE;
1021 if (reloc->lobj.tiling_flags & RADEON_TILING_MICRO)
1022 tile_flags |= RADEON_COLOR_MICROTILE_ENABLE;
1023
1024 tmp = ib_chunk->kdata[idx] & ~(0x7 << 16);
1025 tmp |= tile_flags;
1026 ib[idx] = tmp;
1027 break;
881 default: 1028 default:
882 /* FIXME: we don't want to allow anyothers packet */ 1029 /* FIXME: we don't want to allow anyothers packet */
883 break; 1030 break;
@@ -1256,29 +1403,100 @@ static void r100_vram_get_type(struct radeon_device *rdev)
1256 } 1403 }
1257} 1404}
1258 1405
1259void r100_vram_info(struct radeon_device *rdev) 1406static u32 r100_get_accessible_vram(struct radeon_device *rdev)
1260{ 1407{
1261 r100_vram_get_type(rdev); 1408 u32 aper_size;
1409 u8 byte;
1410
1411 aper_size = RREG32(RADEON_CONFIG_APER_SIZE);
1412
1413 /* Set HDP_APER_CNTL only on cards that are known not to be broken,
1414 * that is has the 2nd generation multifunction PCI interface
1415 */
1416 if (rdev->family == CHIP_RV280 ||
1417 rdev->family >= CHIP_RV350) {
1418 WREG32_P(RADEON_HOST_PATH_CNTL, RADEON_HDP_APER_CNTL,
1419 ~RADEON_HDP_APER_CNTL);
1420 DRM_INFO("Generation 2 PCI interface, using max accessible memory\n");
1421 return aper_size * 2;
1422 }
1423
1424 /* Older cards have all sorts of funny issues to deal with. First
1425 * check if it's a multifunction card by reading the PCI config
1426 * header type... Limit those to one aperture size
1427 */
1428 pci_read_config_byte(rdev->pdev, 0xe, &byte);
1429 if (byte & 0x80) {
1430 DRM_INFO("Generation 1 PCI interface in multifunction mode\n");
1431 DRM_INFO("Limiting VRAM to one aperture\n");
1432 return aper_size;
1433 }
1434
1435 /* Single function older card. We read HDP_APER_CNTL to see how the BIOS
1436 * have set it up. We don't write this as it's broken on some ASICs but
1437 * we expect the BIOS to have done the right thing (might be too optimistic...)
1438 */
1439 if (RREG32(RADEON_HOST_PATH_CNTL) & RADEON_HDP_APER_CNTL)
1440 return aper_size * 2;
1441 return aper_size;
1442}
1443
1444void r100_vram_init_sizes(struct radeon_device *rdev)
1445{
1446 u64 config_aper_size;
1447 u32 accessible;
1448
1449 config_aper_size = RREG32(RADEON_CONFIG_APER_SIZE);
1262 1450
1263 if (rdev->flags & RADEON_IS_IGP) { 1451 if (rdev->flags & RADEON_IS_IGP) {
1264 uint32_t tom; 1452 uint32_t tom;
1265 /* read NB_TOM to get the amount of ram stolen for the GPU */ 1453 /* read NB_TOM to get the amount of ram stolen for the GPU */
1266 tom = RREG32(RADEON_NB_TOM); 1454 tom = RREG32(RADEON_NB_TOM);
1267 rdev->mc.vram_size = (((tom >> 16) - (tom & 0xffff) + 1) << 16); 1455 rdev->mc.real_vram_size = (((tom >> 16) - (tom & 0xffff) + 1) << 16);
1268 WREG32(RADEON_CONFIG_MEMSIZE, rdev->mc.vram_size); 1456 /* for IGPs we need to keep VRAM where it was put by the BIOS */
1457 rdev->mc.vram_location = (tom & 0xffff) << 16;
1458 WREG32(RADEON_CONFIG_MEMSIZE, rdev->mc.real_vram_size);
1459 rdev->mc.mc_vram_size = rdev->mc.real_vram_size;
1269 } else { 1460 } else {
1270 rdev->mc.vram_size = RREG32(RADEON_CONFIG_MEMSIZE); 1461 rdev->mc.real_vram_size = RREG32(RADEON_CONFIG_MEMSIZE);
1271 /* Some production boards of m6 will report 0 1462 /* Some production boards of m6 will report 0
1272 * if it's 8 MB 1463 * if it's 8 MB
1273 */ 1464 */
1274 if (rdev->mc.vram_size == 0) { 1465 if (rdev->mc.real_vram_size == 0) {
1275 rdev->mc.vram_size = 8192 * 1024; 1466 rdev->mc.real_vram_size = 8192 * 1024;
1276 WREG32(RADEON_CONFIG_MEMSIZE, rdev->mc.vram_size); 1467 WREG32(RADEON_CONFIG_MEMSIZE, rdev->mc.real_vram_size);
1277 } 1468 }
1469 /* let driver place VRAM */
1470 rdev->mc.vram_location = 0xFFFFFFFFUL;
1471 /* Fix for RN50, M6, M7 with 8/16/32(??) MBs of VRAM -
1472 * Novell bug 204882 + along with lots of ubuntu ones */
1473 if (config_aper_size > rdev->mc.real_vram_size)
1474 rdev->mc.mc_vram_size = config_aper_size;
1475 else
1476 rdev->mc.mc_vram_size = rdev->mc.real_vram_size;
1278 } 1477 }
1279 1478
1479 /* work out accessible VRAM */
1480 accessible = r100_get_accessible_vram(rdev);
1481
1280 rdev->mc.aper_base = drm_get_resource_start(rdev->ddev, 0); 1482 rdev->mc.aper_base = drm_get_resource_start(rdev->ddev, 0);
1281 rdev->mc.aper_size = drm_get_resource_len(rdev->ddev, 0); 1483 rdev->mc.aper_size = drm_get_resource_len(rdev->ddev, 0);
1484
1485 if (accessible > rdev->mc.aper_size)
1486 accessible = rdev->mc.aper_size;
1487
1488 if (rdev->mc.mc_vram_size > rdev->mc.aper_size)
1489 rdev->mc.mc_vram_size = rdev->mc.aper_size;
1490
1491 if (rdev->mc.real_vram_size > rdev->mc.aper_size)
1492 rdev->mc.real_vram_size = rdev->mc.aper_size;
1493}
1494
1495void r100_vram_info(struct radeon_device *rdev)
1496{
1497 r100_vram_get_type(rdev);
1498
1499 r100_vram_init_sizes(rdev);
1282} 1500}
1283 1501
1284 1502
@@ -1533,3 +1751,530 @@ int r100_debugfs_mc_info_init(struct radeon_device *rdev)
1533 return 0; 1751 return 0;
1534#endif 1752#endif
1535} 1753}
1754
1755int r100_set_surface_reg(struct radeon_device *rdev, int reg,
1756 uint32_t tiling_flags, uint32_t pitch,
1757 uint32_t offset, uint32_t obj_size)
1758{
1759 int surf_index = reg * 16;
1760 int flags = 0;
1761
1762 /* r100/r200 divide by 16 */
1763 if (rdev->family < CHIP_R300)
1764 flags = pitch / 16;
1765 else
1766 flags = pitch / 8;
1767
1768 if (rdev->family <= CHIP_RS200) {
1769 if ((tiling_flags & (RADEON_TILING_MACRO|RADEON_TILING_MICRO))
1770 == (RADEON_TILING_MACRO|RADEON_TILING_MICRO))
1771 flags |= RADEON_SURF_TILE_COLOR_BOTH;
1772 if (tiling_flags & RADEON_TILING_MACRO)
1773 flags |= RADEON_SURF_TILE_COLOR_MACRO;
1774 } else if (rdev->family <= CHIP_RV280) {
1775 if (tiling_flags & (RADEON_TILING_MACRO))
1776 flags |= R200_SURF_TILE_COLOR_MACRO;
1777 if (tiling_flags & RADEON_TILING_MICRO)
1778 flags |= R200_SURF_TILE_COLOR_MICRO;
1779 } else {
1780 if (tiling_flags & RADEON_TILING_MACRO)
1781 flags |= R300_SURF_TILE_MACRO;
1782 if (tiling_flags & RADEON_TILING_MICRO)
1783 flags |= R300_SURF_TILE_MICRO;
1784 }
1785
1786 DRM_DEBUG("writing surface %d %d %x %x\n", reg, flags, offset, offset+obj_size-1);
1787 WREG32(RADEON_SURFACE0_INFO + surf_index, flags);
1788 WREG32(RADEON_SURFACE0_LOWER_BOUND + surf_index, offset);
1789 WREG32(RADEON_SURFACE0_UPPER_BOUND + surf_index, offset + obj_size - 1);
1790 return 0;
1791}
1792
1793void r100_clear_surface_reg(struct radeon_device *rdev, int reg)
1794{
1795 int surf_index = reg * 16;
1796 WREG32(RADEON_SURFACE0_INFO + surf_index, 0);
1797}
1798
1799void r100_bandwidth_update(struct radeon_device *rdev)
1800{
1801 fixed20_12 trcd_ff, trp_ff, tras_ff, trbs_ff, tcas_ff;
1802 fixed20_12 sclk_ff, mclk_ff, sclk_eff_ff, sclk_delay_ff;
1803 fixed20_12 peak_disp_bw, mem_bw, pix_clk, pix_clk2, temp_ff, crit_point_ff;
1804 uint32_t temp, data, mem_trcd, mem_trp, mem_tras;
1805 fixed20_12 memtcas_ff[8] = {
1806 fixed_init(1),
1807 fixed_init(2),
1808 fixed_init(3),
1809 fixed_init(0),
1810 fixed_init_half(1),
1811 fixed_init_half(2),
1812 fixed_init(0),
1813 };
1814 fixed20_12 memtcas_rs480_ff[8] = {
1815 fixed_init(0),
1816 fixed_init(1),
1817 fixed_init(2),
1818 fixed_init(3),
1819 fixed_init(0),
1820 fixed_init_half(1),
1821 fixed_init_half(2),
1822 fixed_init_half(3),
1823 };
1824 fixed20_12 memtcas2_ff[8] = {
1825 fixed_init(0),
1826 fixed_init(1),
1827 fixed_init(2),
1828 fixed_init(3),
1829 fixed_init(4),
1830 fixed_init(5),
1831 fixed_init(6),
1832 fixed_init(7),
1833 };
1834 fixed20_12 memtrbs[8] = {
1835 fixed_init(1),
1836 fixed_init_half(1),
1837 fixed_init(2),
1838 fixed_init_half(2),
1839 fixed_init(3),
1840 fixed_init_half(3),
1841 fixed_init(4),
1842 fixed_init_half(4)
1843 };
1844 fixed20_12 memtrbs_r4xx[8] = {
1845 fixed_init(4),
1846 fixed_init(5),
1847 fixed_init(6),
1848 fixed_init(7),
1849 fixed_init(8),
1850 fixed_init(9),
1851 fixed_init(10),
1852 fixed_init(11)
1853 };
1854 fixed20_12 min_mem_eff;
1855 fixed20_12 mc_latency_sclk, mc_latency_mclk, k1;
1856 fixed20_12 cur_latency_mclk, cur_latency_sclk;
1857 fixed20_12 disp_latency, disp_latency_overhead, disp_drain_rate,
1858 disp_drain_rate2, read_return_rate;
1859 fixed20_12 time_disp1_drop_priority;
1860 int c;
1861 int cur_size = 16; /* in octawords */
1862 int critical_point = 0, critical_point2;
1863/* uint32_t read_return_rate, time_disp1_drop_priority; */
1864 int stop_req, max_stop_req;
1865 struct drm_display_mode *mode1 = NULL;
1866 struct drm_display_mode *mode2 = NULL;
1867 uint32_t pixel_bytes1 = 0;
1868 uint32_t pixel_bytes2 = 0;
1869
1870 if (rdev->mode_info.crtcs[0]->base.enabled) {
1871 mode1 = &rdev->mode_info.crtcs[0]->base.mode;
1872 pixel_bytes1 = rdev->mode_info.crtcs[0]->base.fb->bits_per_pixel / 8;
1873 }
1874 if (rdev->mode_info.crtcs[1]->base.enabled) {
1875 mode2 = &rdev->mode_info.crtcs[1]->base.mode;
1876 pixel_bytes2 = rdev->mode_info.crtcs[1]->base.fb->bits_per_pixel / 8;
1877 }
1878
1879 min_mem_eff.full = rfixed_const_8(0);
1880 /* get modes */
1881 if ((rdev->disp_priority == 2) && ASIC_IS_R300(rdev)) {
1882 uint32_t mc_init_misc_lat_timer = RREG32(R300_MC_INIT_MISC_LAT_TIMER);
1883 mc_init_misc_lat_timer &= ~(R300_MC_DISP1R_INIT_LAT_MASK << R300_MC_DISP1R_INIT_LAT_SHIFT);
1884 mc_init_misc_lat_timer &= ~(R300_MC_DISP0R_INIT_LAT_MASK << R300_MC_DISP0R_INIT_LAT_SHIFT);
1885 /* check crtc enables */
1886 if (mode2)
1887 mc_init_misc_lat_timer |= (1 << R300_MC_DISP1R_INIT_LAT_SHIFT);
1888 if (mode1)
1889 mc_init_misc_lat_timer |= (1 << R300_MC_DISP0R_INIT_LAT_SHIFT);
1890 WREG32(R300_MC_INIT_MISC_LAT_TIMER, mc_init_misc_lat_timer);
1891 }
1892
1893 /*
1894 * determine is there is enough bw for current mode
1895 */
1896 mclk_ff.full = rfixed_const(rdev->clock.default_mclk);
1897 temp_ff.full = rfixed_const(100);
1898 mclk_ff.full = rfixed_div(mclk_ff, temp_ff);
1899 sclk_ff.full = rfixed_const(rdev->clock.default_sclk);
1900 sclk_ff.full = rfixed_div(sclk_ff, temp_ff);
1901
1902 temp = (rdev->mc.vram_width / 8) * (rdev->mc.vram_is_ddr ? 2 : 1);
1903 temp_ff.full = rfixed_const(temp);
1904 mem_bw.full = rfixed_mul(mclk_ff, temp_ff);
1905
1906 pix_clk.full = 0;
1907 pix_clk2.full = 0;
1908 peak_disp_bw.full = 0;
1909 if (mode1) {
1910 temp_ff.full = rfixed_const(1000);
1911 pix_clk.full = rfixed_const(mode1->clock); /* convert to fixed point */
1912 pix_clk.full = rfixed_div(pix_clk, temp_ff);
1913 temp_ff.full = rfixed_const(pixel_bytes1);
1914 peak_disp_bw.full += rfixed_mul(pix_clk, temp_ff);
1915 }
1916 if (mode2) {
1917 temp_ff.full = rfixed_const(1000);
1918 pix_clk2.full = rfixed_const(mode2->clock); /* convert to fixed point */
1919 pix_clk2.full = rfixed_div(pix_clk2, temp_ff);
1920 temp_ff.full = rfixed_const(pixel_bytes2);
1921 peak_disp_bw.full += rfixed_mul(pix_clk2, temp_ff);
1922 }
1923
1924 mem_bw.full = rfixed_mul(mem_bw, min_mem_eff);
1925 if (peak_disp_bw.full >= mem_bw.full) {
1926 DRM_ERROR("You may not have enough display bandwidth for current mode\n"
1927 "If you have flickering problem, try to lower resolution, refresh rate, or color depth\n");
1928 }
1929
1930 /* Get values from the EXT_MEM_CNTL register...converting its contents. */
1931 temp = RREG32(RADEON_MEM_TIMING_CNTL);
1932 if ((rdev->family == CHIP_RV100) || (rdev->flags & RADEON_IS_IGP)) { /* RV100, M6, IGPs */
1933 mem_trcd = ((temp >> 2) & 0x3) + 1;
1934 mem_trp = ((temp & 0x3)) + 1;
1935 mem_tras = ((temp & 0x70) >> 4) + 1;
1936 } else if (rdev->family == CHIP_R300 ||
1937 rdev->family == CHIP_R350) { /* r300, r350 */
1938 mem_trcd = (temp & 0x7) + 1;
1939 mem_trp = ((temp >> 8) & 0x7) + 1;
1940 mem_tras = ((temp >> 11) & 0xf) + 4;
1941 } else if (rdev->family == CHIP_RV350 ||
1942 rdev->family <= CHIP_RV380) {
1943 /* rv3x0 */
1944 mem_trcd = (temp & 0x7) + 3;
1945 mem_trp = ((temp >> 8) & 0x7) + 3;
1946 mem_tras = ((temp >> 11) & 0xf) + 6;
1947 } else if (rdev->family == CHIP_R420 ||
1948 rdev->family == CHIP_R423 ||
1949 rdev->family == CHIP_RV410) {
1950 /* r4xx */
1951 mem_trcd = (temp & 0xf) + 3;
1952 if (mem_trcd > 15)
1953 mem_trcd = 15;
1954 mem_trp = ((temp >> 8) & 0xf) + 3;
1955 if (mem_trp > 15)
1956 mem_trp = 15;
1957 mem_tras = ((temp >> 12) & 0x1f) + 6;
1958 if (mem_tras > 31)
1959 mem_tras = 31;
1960 } else { /* RV200, R200 */
1961 mem_trcd = (temp & 0x7) + 1;
1962 mem_trp = ((temp >> 8) & 0x7) + 1;
1963 mem_tras = ((temp >> 12) & 0xf) + 4;
1964 }
1965 /* convert to FF */
1966 trcd_ff.full = rfixed_const(mem_trcd);
1967 trp_ff.full = rfixed_const(mem_trp);
1968 tras_ff.full = rfixed_const(mem_tras);
1969
1970 /* Get values from the MEM_SDRAM_MODE_REG register...converting its */
1971 temp = RREG32(RADEON_MEM_SDRAM_MODE_REG);
1972 data = (temp & (7 << 20)) >> 20;
1973 if ((rdev->family == CHIP_RV100) || rdev->flags & RADEON_IS_IGP) {
1974 if (rdev->family == CHIP_RS480) /* don't think rs400 */
1975 tcas_ff = memtcas_rs480_ff[data];
1976 else
1977 tcas_ff = memtcas_ff[data];
1978 } else
1979 tcas_ff = memtcas2_ff[data];
1980
1981 if (rdev->family == CHIP_RS400 ||
1982 rdev->family == CHIP_RS480) {
1983 /* extra cas latency stored in bits 23-25 0-4 clocks */
1984 data = (temp >> 23) & 0x7;
1985 if (data < 5)
1986 tcas_ff.full += rfixed_const(data);
1987 }
1988
1989 if (ASIC_IS_R300(rdev) && !(rdev->flags & RADEON_IS_IGP)) {
1990 /* on the R300, Tcas is included in Trbs.
1991 */
1992 temp = RREG32(RADEON_MEM_CNTL);
1993 data = (R300_MEM_NUM_CHANNELS_MASK & temp);
1994 if (data == 1) {
1995 if (R300_MEM_USE_CD_CH_ONLY & temp) {
1996 temp = RREG32(R300_MC_IND_INDEX);
1997 temp &= ~R300_MC_IND_ADDR_MASK;
1998 temp |= R300_MC_READ_CNTL_CD_mcind;
1999 WREG32(R300_MC_IND_INDEX, temp);
2000 temp = RREG32(R300_MC_IND_DATA);
2001 data = (R300_MEM_RBS_POSITION_C_MASK & temp);
2002 } else {
2003 temp = RREG32(R300_MC_READ_CNTL_AB);
2004 data = (R300_MEM_RBS_POSITION_A_MASK & temp);
2005 }
2006 } else {
2007 temp = RREG32(R300_MC_READ_CNTL_AB);
2008 data = (R300_MEM_RBS_POSITION_A_MASK & temp);
2009 }
2010 if (rdev->family == CHIP_RV410 ||
2011 rdev->family == CHIP_R420 ||
2012 rdev->family == CHIP_R423)
2013 trbs_ff = memtrbs_r4xx[data];
2014 else
2015 trbs_ff = memtrbs[data];
2016 tcas_ff.full += trbs_ff.full;
2017 }
2018
2019 sclk_eff_ff.full = sclk_ff.full;
2020
2021 if (rdev->flags & RADEON_IS_AGP) {
2022 fixed20_12 agpmode_ff;
2023 agpmode_ff.full = rfixed_const(radeon_agpmode);
2024 temp_ff.full = rfixed_const_666(16);
2025 sclk_eff_ff.full -= rfixed_mul(agpmode_ff, temp_ff);
2026 }
2027 /* TODO PCIE lanes may affect this - agpmode == 16?? */
2028
2029 if (ASIC_IS_R300(rdev)) {
2030 sclk_delay_ff.full = rfixed_const(250);
2031 } else {
2032 if ((rdev->family == CHIP_RV100) ||
2033 rdev->flags & RADEON_IS_IGP) {
2034 if (rdev->mc.vram_is_ddr)
2035 sclk_delay_ff.full = rfixed_const(41);
2036 else
2037 sclk_delay_ff.full = rfixed_const(33);
2038 } else {
2039 if (rdev->mc.vram_width == 128)
2040 sclk_delay_ff.full = rfixed_const(57);
2041 else
2042 sclk_delay_ff.full = rfixed_const(41);
2043 }
2044 }
2045
2046 mc_latency_sclk.full = rfixed_div(sclk_delay_ff, sclk_eff_ff);
2047
2048 if (rdev->mc.vram_is_ddr) {
2049 if (rdev->mc.vram_width == 32) {
2050 k1.full = rfixed_const(40);
2051 c = 3;
2052 } else {
2053 k1.full = rfixed_const(20);
2054 c = 1;
2055 }
2056 } else {
2057 k1.full = rfixed_const(40);
2058 c = 3;
2059 }
2060
2061 temp_ff.full = rfixed_const(2);
2062 mc_latency_mclk.full = rfixed_mul(trcd_ff, temp_ff);
2063 temp_ff.full = rfixed_const(c);
2064 mc_latency_mclk.full += rfixed_mul(tcas_ff, temp_ff);
2065 temp_ff.full = rfixed_const(4);
2066 mc_latency_mclk.full += rfixed_mul(tras_ff, temp_ff);
2067 mc_latency_mclk.full += rfixed_mul(trp_ff, temp_ff);
2068 mc_latency_mclk.full += k1.full;
2069
2070 mc_latency_mclk.full = rfixed_div(mc_latency_mclk, mclk_ff);
2071 mc_latency_mclk.full += rfixed_div(temp_ff, sclk_eff_ff);
2072
2073 /*
2074 HW cursor time assuming worst case of full size colour cursor.
2075 */
2076 temp_ff.full = rfixed_const((2 * (cur_size - (rdev->mc.vram_is_ddr + 1))));
2077 temp_ff.full += trcd_ff.full;
2078 if (temp_ff.full < tras_ff.full)
2079 temp_ff.full = tras_ff.full;
2080 cur_latency_mclk.full = rfixed_div(temp_ff, mclk_ff);
2081
2082 temp_ff.full = rfixed_const(cur_size);
2083 cur_latency_sclk.full = rfixed_div(temp_ff, sclk_eff_ff);
2084 /*
2085 Find the total latency for the display data.
2086 */
2087 disp_latency_overhead.full = rfixed_const(80);
2088 disp_latency_overhead.full = rfixed_div(disp_latency_overhead, sclk_ff);
2089 mc_latency_mclk.full += disp_latency_overhead.full + cur_latency_mclk.full;
2090 mc_latency_sclk.full += disp_latency_overhead.full + cur_latency_sclk.full;
2091
2092 if (mc_latency_mclk.full > mc_latency_sclk.full)
2093 disp_latency.full = mc_latency_mclk.full;
2094 else
2095 disp_latency.full = mc_latency_sclk.full;
2096
2097 /* setup Max GRPH_STOP_REQ default value */
2098 if (ASIC_IS_RV100(rdev))
2099 max_stop_req = 0x5c;
2100 else
2101 max_stop_req = 0x7c;
2102
2103 if (mode1) {
2104 /* CRTC1
2105 Set GRPH_BUFFER_CNTL register using h/w defined optimal values.
2106 GRPH_STOP_REQ <= MIN[ 0x7C, (CRTC_H_DISP + 1) * (bit depth) / 0x10 ]
2107 */
2108 stop_req = mode1->hdisplay * pixel_bytes1 / 16;
2109
2110 if (stop_req > max_stop_req)
2111 stop_req = max_stop_req;
2112
2113 /*
2114 Find the drain rate of the display buffer.
2115 */
2116 temp_ff.full = rfixed_const((16/pixel_bytes1));
2117 disp_drain_rate.full = rfixed_div(pix_clk, temp_ff);
2118
2119 /*
2120 Find the critical point of the display buffer.
2121 */
2122 crit_point_ff.full = rfixed_mul(disp_drain_rate, disp_latency);
2123 crit_point_ff.full += rfixed_const_half(0);
2124
2125 critical_point = rfixed_trunc(crit_point_ff);
2126
2127 if (rdev->disp_priority == 2) {
2128 critical_point = 0;
2129 }
2130
2131 /*
2132 The critical point should never be above max_stop_req-4. Setting
2133 GRPH_CRITICAL_CNTL = 0 will thus force high priority all the time.
2134 */
2135 if (max_stop_req - critical_point < 4)
2136 critical_point = 0;
2137
2138 if (critical_point == 0 && mode2 && rdev->family == CHIP_R300) {
2139 /* some R300 cards have problem with this set to 0, when CRTC2 is enabled.*/
2140 critical_point = 0x10;
2141 }
2142
2143 temp = RREG32(RADEON_GRPH_BUFFER_CNTL);
2144 temp &= ~(RADEON_GRPH_STOP_REQ_MASK);
2145 temp |= (stop_req << RADEON_GRPH_STOP_REQ_SHIFT);
2146 temp &= ~(RADEON_GRPH_START_REQ_MASK);
2147 if ((rdev->family == CHIP_R350) &&
2148 (stop_req > 0x15)) {
2149 stop_req -= 0x10;
2150 }
2151 temp |= (stop_req << RADEON_GRPH_START_REQ_SHIFT);
2152 temp |= RADEON_GRPH_BUFFER_SIZE;
2153 temp &= ~(RADEON_GRPH_CRITICAL_CNTL |
2154 RADEON_GRPH_CRITICAL_AT_SOF |
2155 RADEON_GRPH_STOP_CNTL);
2156 /*
2157 Write the result into the register.
2158 */
2159 WREG32(RADEON_GRPH_BUFFER_CNTL, ((temp & ~RADEON_GRPH_CRITICAL_POINT_MASK) |
2160 (critical_point << RADEON_GRPH_CRITICAL_POINT_SHIFT)));
2161
2162#if 0
2163 if ((rdev->family == CHIP_RS400) ||
2164 (rdev->family == CHIP_RS480)) {
2165 /* attempt to program RS400 disp regs correctly ??? */
2166 temp = RREG32(RS400_DISP1_REG_CNTL);
2167 temp &= ~(RS400_DISP1_START_REQ_LEVEL_MASK |
2168 RS400_DISP1_STOP_REQ_LEVEL_MASK);
2169 WREG32(RS400_DISP1_REQ_CNTL1, (temp |
2170 (critical_point << RS400_DISP1_START_REQ_LEVEL_SHIFT) |
2171 (critical_point << RS400_DISP1_STOP_REQ_LEVEL_SHIFT)));
2172 temp = RREG32(RS400_DMIF_MEM_CNTL1);
2173 temp &= ~(RS400_DISP1_CRITICAL_POINT_START_MASK |
2174 RS400_DISP1_CRITICAL_POINT_STOP_MASK);
2175 WREG32(RS400_DMIF_MEM_CNTL1, (temp |
2176 (critical_point << RS400_DISP1_CRITICAL_POINT_START_SHIFT) |
2177 (critical_point << RS400_DISP1_CRITICAL_POINT_STOP_SHIFT)));
2178 }
2179#endif
2180
2181 DRM_DEBUG("GRPH_BUFFER_CNTL from to %x\n",
2182 /* (unsigned int)info->SavedReg->grph_buffer_cntl, */
2183 (unsigned int)RREG32(RADEON_GRPH_BUFFER_CNTL));
2184 }
2185
2186 if (mode2) {
2187 u32 grph2_cntl;
2188 stop_req = mode2->hdisplay * pixel_bytes2 / 16;
2189
2190 if (stop_req > max_stop_req)
2191 stop_req = max_stop_req;
2192
2193 /*
2194 Find the drain rate of the display buffer.
2195 */
2196 temp_ff.full = rfixed_const((16/pixel_bytes2));
2197 disp_drain_rate2.full = rfixed_div(pix_clk2, temp_ff);
2198
2199 grph2_cntl = RREG32(RADEON_GRPH2_BUFFER_CNTL);
2200 grph2_cntl &= ~(RADEON_GRPH_STOP_REQ_MASK);
2201 grph2_cntl |= (stop_req << RADEON_GRPH_STOP_REQ_SHIFT);
2202 grph2_cntl &= ~(RADEON_GRPH_START_REQ_MASK);
2203 if ((rdev->family == CHIP_R350) &&
2204 (stop_req > 0x15)) {
2205 stop_req -= 0x10;
2206 }
2207 grph2_cntl |= (stop_req << RADEON_GRPH_START_REQ_SHIFT);
2208 grph2_cntl |= RADEON_GRPH_BUFFER_SIZE;
2209 grph2_cntl &= ~(RADEON_GRPH_CRITICAL_CNTL |
2210 RADEON_GRPH_CRITICAL_AT_SOF |
2211 RADEON_GRPH_STOP_CNTL);
2212
2213 if ((rdev->family == CHIP_RS100) ||
2214 (rdev->family == CHIP_RS200))
2215 critical_point2 = 0;
2216 else {
2217 temp = (rdev->mc.vram_width * rdev->mc.vram_is_ddr + 1)/128;
2218 temp_ff.full = rfixed_const(temp);
2219 temp_ff.full = rfixed_mul(mclk_ff, temp_ff);
2220 if (sclk_ff.full < temp_ff.full)
2221 temp_ff.full = sclk_ff.full;
2222
2223 read_return_rate.full = temp_ff.full;
2224
2225 if (mode1) {
2226 temp_ff.full = read_return_rate.full - disp_drain_rate.full;
2227 time_disp1_drop_priority.full = rfixed_div(crit_point_ff, temp_ff);
2228 } else {
2229 time_disp1_drop_priority.full = 0;
2230 }
2231 crit_point_ff.full = disp_latency.full + time_disp1_drop_priority.full + disp_latency.full;
2232 crit_point_ff.full = rfixed_mul(crit_point_ff, disp_drain_rate2);
2233 crit_point_ff.full += rfixed_const_half(0);
2234
2235 critical_point2 = rfixed_trunc(crit_point_ff);
2236
2237 if (rdev->disp_priority == 2) {
2238 critical_point2 = 0;
2239 }
2240
2241 if (max_stop_req - critical_point2 < 4)
2242 critical_point2 = 0;
2243
2244 }
2245
2246 if (critical_point2 == 0 && rdev->family == CHIP_R300) {
2247 /* some R300 cards have problem with this set to 0 */
2248 critical_point2 = 0x10;
2249 }
2250
2251 WREG32(RADEON_GRPH2_BUFFER_CNTL, ((grph2_cntl & ~RADEON_GRPH_CRITICAL_POINT_MASK) |
2252 (critical_point2 << RADEON_GRPH_CRITICAL_POINT_SHIFT)));
2253
2254 if ((rdev->family == CHIP_RS400) ||
2255 (rdev->family == CHIP_RS480)) {
2256#if 0
2257 /* attempt to program RS400 disp2 regs correctly ??? */
2258 temp = RREG32(RS400_DISP2_REQ_CNTL1);
2259 temp &= ~(RS400_DISP2_START_REQ_LEVEL_MASK |
2260 RS400_DISP2_STOP_REQ_LEVEL_MASK);
2261 WREG32(RS400_DISP2_REQ_CNTL1, (temp |
2262 (critical_point2 << RS400_DISP1_START_REQ_LEVEL_SHIFT) |
2263 (critical_point2 << RS400_DISP1_STOP_REQ_LEVEL_SHIFT)));
2264 temp = RREG32(RS400_DISP2_REQ_CNTL2);
2265 temp &= ~(RS400_DISP2_CRITICAL_POINT_START_MASK |
2266 RS400_DISP2_CRITICAL_POINT_STOP_MASK);
2267 WREG32(RS400_DISP2_REQ_CNTL2, (temp |
2268 (critical_point2 << RS400_DISP2_CRITICAL_POINT_START_SHIFT) |
2269 (critical_point2 << RS400_DISP2_CRITICAL_POINT_STOP_SHIFT)));
2270#endif
2271 WREG32(RS400_DISP2_REQ_CNTL1, 0x105DC1CC);
2272 WREG32(RS400_DISP2_REQ_CNTL2, 0x2749D000);
2273 WREG32(RS400_DMIF_MEM_CNTL1, 0x29CA71DC);
2274 WREG32(RS400_DISP1_REQ_CNTL1, 0x28FBC3AC);
2275 }
2276
2277 DRM_DEBUG("GRPH2_BUFFER_CNTL from to %x\n",
2278 (unsigned int)RREG32(RADEON_GRPH2_BUFFER_CNTL));
2279 }
2280}
diff --git a/drivers/gpu/drm/radeon/r300.c b/drivers/gpu/drm/radeon/r300.c
index e2ed5bc08170..9c8d41534a5d 100644
--- a/drivers/gpu/drm/radeon/r300.c
+++ b/drivers/gpu/drm/radeon/r300.c
@@ -30,6 +30,8 @@
30#include "drm.h" 30#include "drm.h"
31#include "radeon_reg.h" 31#include "radeon_reg.h"
32#include "radeon.h" 32#include "radeon.h"
33#include "radeon_drm.h"
34#include "radeon_share.h"
33 35
34/* r300,r350,rv350,rv370,rv380 depends on : */ 36/* r300,r350,rv350,rv370,rv380 depends on : */
35void r100_hdp_reset(struct radeon_device *rdev); 37void r100_hdp_reset(struct radeon_device *rdev);
@@ -44,6 +46,7 @@ int r100_gui_wait_for_idle(struct radeon_device *rdev);
44int r100_cs_packet_parse(struct radeon_cs_parser *p, 46int r100_cs_packet_parse(struct radeon_cs_parser *p,
45 struct radeon_cs_packet *pkt, 47 struct radeon_cs_packet *pkt,
46 unsigned idx); 48 unsigned idx);
49int r100_cs_packet_parse_vline(struct radeon_cs_parser *p);
47int r100_cs_packet_next_reloc(struct radeon_cs_parser *p, 50int r100_cs_packet_next_reloc(struct radeon_cs_parser *p,
48 struct radeon_cs_reloc **cs_reloc); 51 struct radeon_cs_reloc **cs_reloc);
49int r100_cs_parse_packet0(struct radeon_cs_parser *p, 52int r100_cs_parse_packet0(struct radeon_cs_parser *p,
@@ -150,8 +153,13 @@ int rv370_pcie_gart_set_page(struct radeon_device *rdev, int i, uint64_t addr)
150 if (i < 0 || i > rdev->gart.num_gpu_pages) { 153 if (i < 0 || i > rdev->gart.num_gpu_pages) {
151 return -EINVAL; 154 return -EINVAL;
152 } 155 }
153 addr = (((u32)addr) >> 8) | ((upper_32_bits(addr) & 0xff) << 4) | 0xC; 156 addr = (lower_32_bits(addr) >> 8) |
154 writel(cpu_to_le32(addr), ((void __iomem *)ptr) + (i * 4)); 157 ((upper_32_bits(addr) & 0xff) << 24) |
158 0xc;
159 /* on x86 we want this to be CPU endian, on powerpc
160 * on powerpc without HW swappers, it'll get swapped on way
161 * into VRAM - so no need for cpu_to_le32 on VRAM tables */
162 writel(addr, ((void __iomem *)ptr) + (i * 4));
155 return 0; 163 return 0;
156} 164}
157 165
@@ -579,10 +587,8 @@ void r300_vram_info(struct radeon_device *rdev)
579 } else { 587 } else {
580 rdev->mc.vram_width = 64; 588 rdev->mc.vram_width = 64;
581 } 589 }
582 rdev->mc.vram_size = RREG32(RADEON_CONFIG_MEMSIZE);
583 590
584 rdev->mc.aper_base = drm_get_resource_start(rdev->ddev, 0); 591 r100_vram_init_sizes(rdev);
585 rdev->mc.aper_size = drm_get_resource_len(rdev->ddev, 0);
586} 592}
587 593
588 594
@@ -970,7 +976,7 @@ static inline void r300_cs_track_clear(struct r300_cs_track *track)
970 976
971static const unsigned r300_reg_safe_bm[159] = { 977static const unsigned r300_reg_safe_bm[159] = {
972 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 978 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF,
973 0xFFFFFFBF, 0xFFFFFFFF, 0xFFFFFFBF, 0xFFFFFFFF, 979 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF,
974 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 980 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF,
975 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 981 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF,
976 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 982 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF,
@@ -1019,7 +1025,7 @@ static int r300_packet0_check(struct radeon_cs_parser *p,
1019 struct radeon_cs_reloc *reloc; 1025 struct radeon_cs_reloc *reloc;
1020 struct r300_cs_track *track; 1026 struct r300_cs_track *track;
1021 volatile uint32_t *ib; 1027 volatile uint32_t *ib;
1022 uint32_t tmp; 1028 uint32_t tmp, tile_flags = 0;
1023 unsigned i; 1029 unsigned i;
1024 int r; 1030 int r;
1025 1031
@@ -1027,6 +1033,16 @@ static int r300_packet0_check(struct radeon_cs_parser *p,
1027 ib_chunk = &p->chunks[p->chunk_ib_idx]; 1033 ib_chunk = &p->chunks[p->chunk_ib_idx];
1028 track = (struct r300_cs_track*)p->track; 1034 track = (struct r300_cs_track*)p->track;
1029 switch(reg) { 1035 switch(reg) {
1036 case AVIVO_D1MODE_VLINE_START_END:
1037 case RADEON_CRTC_GUI_TRIG_VLINE:
1038 r = r100_cs_packet_parse_vline(p);
1039 if (r) {
1040 DRM_ERROR("No reloc for ib[%d]=0x%04X\n",
1041 idx, reg);
1042 r100_cs_dump_packet(p, pkt);
1043 return r;
1044 }
1045 break;
1030 case RADEON_DST_PITCH_OFFSET: 1046 case RADEON_DST_PITCH_OFFSET:
1031 case RADEON_SRC_PITCH_OFFSET: 1047 case RADEON_SRC_PITCH_OFFSET:
1032 r = r100_cs_packet_next_reloc(p, &reloc); 1048 r = r100_cs_packet_next_reloc(p, &reloc);
@@ -1038,7 +1054,19 @@ static int r300_packet0_check(struct radeon_cs_parser *p,
1038 } 1054 }
1039 tmp = ib_chunk->kdata[idx] & 0x003fffff; 1055 tmp = ib_chunk->kdata[idx] & 0x003fffff;
1040 tmp += (((u32)reloc->lobj.gpu_offset) >> 10); 1056 tmp += (((u32)reloc->lobj.gpu_offset) >> 10);
1041 ib[idx] = (ib_chunk->kdata[idx] & 0xffc00000) | tmp; 1057
1058 if (reloc->lobj.tiling_flags & RADEON_TILING_MACRO)
1059 tile_flags |= RADEON_DST_TILE_MACRO;
1060 if (reloc->lobj.tiling_flags & RADEON_TILING_MICRO) {
1061 if (reg == RADEON_SRC_PITCH_OFFSET) {
1062 DRM_ERROR("Cannot src blit from microtiled surface\n");
1063 r100_cs_dump_packet(p, pkt);
1064 return -EINVAL;
1065 }
1066 tile_flags |= RADEON_DST_TILE_MICRO;
1067 }
1068 tmp |= tile_flags;
1069 ib[idx] = (ib_chunk->kdata[idx] & 0x3fc00000) | tmp;
1042 break; 1070 break;
1043 case R300_RB3D_COLOROFFSET0: 1071 case R300_RB3D_COLOROFFSET0:
1044 case R300_RB3D_COLOROFFSET1: 1072 case R300_RB3D_COLOROFFSET1:
@@ -1127,6 +1155,23 @@ static int r300_packet0_check(struct radeon_cs_parser *p,
1127 /* RB3D_COLORPITCH1 */ 1155 /* RB3D_COLORPITCH1 */
1128 /* RB3D_COLORPITCH2 */ 1156 /* RB3D_COLORPITCH2 */
1129 /* RB3D_COLORPITCH3 */ 1157 /* RB3D_COLORPITCH3 */
1158 r = r100_cs_packet_next_reloc(p, &reloc);
1159 if (r) {
1160 DRM_ERROR("No reloc for ib[%d]=0x%04X\n",
1161 idx, reg);
1162 r100_cs_dump_packet(p, pkt);
1163 return r;
1164 }
1165
1166 if (reloc->lobj.tiling_flags & RADEON_TILING_MACRO)
1167 tile_flags |= R300_COLOR_TILE_ENABLE;
1168 if (reloc->lobj.tiling_flags & RADEON_TILING_MICRO)
1169 tile_flags |= R300_COLOR_MICROTILE_ENABLE;
1170
1171 tmp = ib_chunk->kdata[idx] & ~(0x7 << 16);
1172 tmp |= tile_flags;
1173 ib[idx] = tmp;
1174
1130 i = (reg - 0x4E38) >> 2; 1175 i = (reg - 0x4E38) >> 2;
1131 track->cb[i].pitch = ib_chunk->kdata[idx] & 0x3FFE; 1176 track->cb[i].pitch = ib_chunk->kdata[idx] & 0x3FFE;
1132 switch (((ib_chunk->kdata[idx] >> 21) & 0xF)) { 1177 switch (((ib_chunk->kdata[idx] >> 21) & 0xF)) {
@@ -1182,6 +1227,23 @@ static int r300_packet0_check(struct radeon_cs_parser *p,
1182 break; 1227 break;
1183 case 0x4F24: 1228 case 0x4F24:
1184 /* ZB_DEPTHPITCH */ 1229 /* ZB_DEPTHPITCH */
1230 r = r100_cs_packet_next_reloc(p, &reloc);
1231 if (r) {
1232 DRM_ERROR("No reloc for ib[%d]=0x%04X\n",
1233 idx, reg);
1234 r100_cs_dump_packet(p, pkt);
1235 return r;
1236 }
1237
1238 if (reloc->lobj.tiling_flags & RADEON_TILING_MACRO)
1239 tile_flags |= R300_DEPTHMACROTILE_ENABLE;
1240 if (reloc->lobj.tiling_flags & RADEON_TILING_MICRO)
1241 tile_flags |= R300_DEPTHMICROTILE_TILED;;
1242
1243 tmp = ib_chunk->kdata[idx] & ~(0x7 << 16);
1244 tmp |= tile_flags;
1245 ib[idx] = tmp;
1246
1185 track->zb.pitch = ib_chunk->kdata[idx] & 0x3FFC; 1247 track->zb.pitch = ib_chunk->kdata[idx] & 0x3FFC;
1186 break; 1248 break;
1187 case 0x4104: 1249 case 0x4104:
diff --git a/drivers/gpu/drm/radeon/r300_reg.h b/drivers/gpu/drm/radeon/r300_reg.h
index 70f48609515e..4b7afef35a65 100644
--- a/drivers/gpu/drm/radeon/r300_reg.h
+++ b/drivers/gpu/drm/radeon/r300_reg.h
@@ -27,7 +27,9 @@
27#ifndef _R300_REG_H_ 27#ifndef _R300_REG_H_
28#define _R300_REG_H_ 28#define _R300_REG_H_
29 29
30 30#define R300_SURF_TILE_MACRO (1<<16)
31#define R300_SURF_TILE_MICRO (2<<16)
32#define R300_SURF_TILE_BOTH (3<<16)
31 33
32 34
33#define R300_MC_INIT_MISC_LAT_TIMER 0x180 35#define R300_MC_INIT_MISC_LAT_TIMER 0x180
diff --git a/drivers/gpu/drm/radeon/r500_reg.h b/drivers/gpu/drm/radeon/r500_reg.h
index 9070a1c2ce23..036691b38cb7 100644
--- a/drivers/gpu/drm/radeon/r500_reg.h
+++ b/drivers/gpu/drm/radeon/r500_reg.h
@@ -445,6 +445,7 @@
445#define AVIVO_D1MODE_DATA_FORMAT 0x6528 445#define AVIVO_D1MODE_DATA_FORMAT 0x6528
446# define AVIVO_D1MODE_INTERLEAVE_EN (1 << 0) 446# define AVIVO_D1MODE_INTERLEAVE_EN (1 << 0)
447#define AVIVO_D1MODE_DESKTOP_HEIGHT 0x652C 447#define AVIVO_D1MODE_DESKTOP_HEIGHT 0x652C
448#define AVIVO_D1MODE_VLINE_START_END 0x6538
448#define AVIVO_D1MODE_VIEWPORT_START 0x6580 449#define AVIVO_D1MODE_VIEWPORT_START 0x6580
449#define AVIVO_D1MODE_VIEWPORT_SIZE 0x6584 450#define AVIVO_D1MODE_VIEWPORT_SIZE 0x6584
450#define AVIVO_D1MODE_EXT_OVERSCAN_LEFT_RIGHT 0x6588 451#define AVIVO_D1MODE_EXT_OVERSCAN_LEFT_RIGHT 0x6588
@@ -496,6 +497,7 @@
496#define AVIVO_D2CUR_SIZE 0x6c10 497#define AVIVO_D2CUR_SIZE 0x6c10
497#define AVIVO_D2CUR_POSITION 0x6c14 498#define AVIVO_D2CUR_POSITION 0x6c14
498 499
500#define AVIVO_D2MODE_VLINE_START_END 0x6d38
499#define AVIVO_D2MODE_VIEWPORT_START 0x6d80 501#define AVIVO_D2MODE_VIEWPORT_START 0x6d80
500#define AVIVO_D2MODE_VIEWPORT_SIZE 0x6d84 502#define AVIVO_D2MODE_VIEWPORT_SIZE 0x6d84
501#define AVIVO_D2MODE_EXT_OVERSCAN_LEFT_RIGHT 0x6d88 503#define AVIVO_D2MODE_EXT_OVERSCAN_LEFT_RIGHT 0x6d88
diff --git a/drivers/gpu/drm/radeon/r520.c b/drivers/gpu/drm/radeon/r520.c
index 570a244bd88b..09fb0b6ec7dd 100644
--- a/drivers/gpu/drm/radeon/r520.c
+++ b/drivers/gpu/drm/radeon/r520.c
@@ -28,6 +28,7 @@
28#include "drmP.h" 28#include "drmP.h"
29#include "radeon_reg.h" 29#include "radeon_reg.h"
30#include "radeon.h" 30#include "radeon.h"
31#include "radeon_share.h"
31 32
32/* r520,rv530,rv560,rv570,r580 depends on : */ 33/* r520,rv530,rv560,rv570,r580 depends on : */
33void r100_hdp_reset(struct radeon_device *rdev); 34void r100_hdp_reset(struct radeon_device *rdev);
@@ -94,8 +95,8 @@ int r520_mc_init(struct radeon_device *rdev)
94 "programming pipes. Bad things might happen.\n"); 95 "programming pipes. Bad things might happen.\n");
95 } 96 }
96 /* Write VRAM size in case we are limiting it */ 97 /* Write VRAM size in case we are limiting it */
97 WREG32(RADEON_CONFIG_MEMSIZE, rdev->mc.vram_size); 98 WREG32(RADEON_CONFIG_MEMSIZE, rdev->mc.real_vram_size);
98 tmp = rdev->mc.vram_location + rdev->mc.vram_size - 1; 99 tmp = rdev->mc.vram_location + rdev->mc.mc_vram_size - 1;
99 tmp = REG_SET(R520_MC_FB_TOP, tmp >> 16); 100 tmp = REG_SET(R520_MC_FB_TOP, tmp >> 16);
100 tmp |= REG_SET(R520_MC_FB_START, rdev->mc.vram_location >> 16); 101 tmp |= REG_SET(R520_MC_FB_START, rdev->mc.vram_location >> 16);
101 WREG32_MC(R520_MC_FB_LOCATION, tmp); 102 WREG32_MC(R520_MC_FB_LOCATION, tmp);
@@ -226,9 +227,20 @@ static void r520_vram_get_type(struct radeon_device *rdev)
226 227
227void r520_vram_info(struct radeon_device *rdev) 228void r520_vram_info(struct radeon_device *rdev)
228{ 229{
230 fixed20_12 a;
231
229 r520_vram_get_type(rdev); 232 r520_vram_get_type(rdev);
230 rdev->mc.vram_size = RREG32(RADEON_CONFIG_MEMSIZE);
231 233
232 rdev->mc.aper_base = drm_get_resource_start(rdev->ddev, 0); 234 r100_vram_init_sizes(rdev);
233 rdev->mc.aper_size = drm_get_resource_len(rdev->ddev, 0); 235 /* FIXME: we should enforce default clock in case GPU is not in
236 * default setup
237 */
238 a.full = rfixed_const(100);
239 rdev->pm.sclk.full = rfixed_const(rdev->clock.default_sclk);
240 rdev->pm.sclk.full = rfixed_div(rdev->pm.sclk, a);
241}
242
243void r520_bandwidth_update(struct radeon_device *rdev)
244{
245 rv515_bandwidth_avivo_update(rdev);
234} 246}
diff --git a/drivers/gpu/drm/radeon/r600.c b/drivers/gpu/drm/radeon/r600.c
index c45559fc97fd..538cd907df69 100644
--- a/drivers/gpu/drm/radeon/r600.c
+++ b/drivers/gpu/drm/radeon/r600.c
@@ -67,7 +67,7 @@ int r600_mc_init(struct radeon_device *rdev)
67 "programming pipes. Bad things might happen.\n"); 67 "programming pipes. Bad things might happen.\n");
68 } 68 }
69 69
70 tmp = rdev->mc.vram_location + rdev->mc.vram_size - 1; 70 tmp = rdev->mc.vram_location + rdev->mc.mc_vram_size - 1;
71 tmp = REG_SET(R600_MC_FB_TOP, tmp >> 24); 71 tmp = REG_SET(R600_MC_FB_TOP, tmp >> 24);
72 tmp |= REG_SET(R600_MC_FB_BASE, rdev->mc.vram_location >> 24); 72 tmp |= REG_SET(R600_MC_FB_BASE, rdev->mc.vram_location >> 24);
73 WREG32(R600_MC_VM_FB_LOCATION, tmp); 73 WREG32(R600_MC_VM_FB_LOCATION, tmp);
@@ -140,7 +140,8 @@ void r600_vram_get_type(struct radeon_device *rdev)
140void r600_vram_info(struct radeon_device *rdev) 140void r600_vram_info(struct radeon_device *rdev)
141{ 141{
142 r600_vram_get_type(rdev); 142 r600_vram_get_type(rdev);
143 rdev->mc.vram_size = RREG32(R600_CONFIG_MEMSIZE); 143 rdev->mc.real_vram_size = RREG32(R600_CONFIG_MEMSIZE);
144 rdev->mc.mc_vram_size = rdev->mc.real_vram_size;
144 145
145 /* Could aper size report 0 ? */ 146 /* Could aper size report 0 ? */
146 rdev->mc.aper_base = drm_get_resource_start(rdev->ddev, 0); 147 rdev->mc.aper_base = drm_get_resource_start(rdev->ddev, 0);
diff --git a/drivers/gpu/drm/radeon/r600_cp.c b/drivers/gpu/drm/radeon/r600_cp.c
index 146f3570af8e..20f17908b036 100644
--- a/drivers/gpu/drm/radeon/r600_cp.c
+++ b/drivers/gpu/drm/radeon/r600_cp.c
@@ -384,8 +384,9 @@ static void r600_cp_load_microcode(drm_radeon_private_t *dev_priv)
384 DRM_INFO("Loading RV670 PFP Microcode\n"); 384 DRM_INFO("Loading RV670 PFP Microcode\n");
385 for (i = 0; i < PFP_UCODE_SIZE; i++) 385 for (i = 0; i < PFP_UCODE_SIZE; i++)
386 RADEON_WRITE(R600_CP_PFP_UCODE_DATA, RV670_pfp_microcode[i]); 386 RADEON_WRITE(R600_CP_PFP_UCODE_DATA, RV670_pfp_microcode[i]);
387 } else if (((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_RS780)) { 387 } else if (((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_RS780) ||
388 DRM_INFO("Loading RS780 CP Microcode\n"); 388 ((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_RS880)) {
389 DRM_INFO("Loading RS780/RS880 CP Microcode\n");
389 for (i = 0; i < PM4_UCODE_SIZE; i++) { 390 for (i = 0; i < PM4_UCODE_SIZE; i++) {
390 RADEON_WRITE(R600_CP_ME_RAM_DATA, 391 RADEON_WRITE(R600_CP_ME_RAM_DATA,
391 RS780_cp_microcode[i][0]); 392 RS780_cp_microcode[i][0]);
@@ -396,7 +397,7 @@ static void r600_cp_load_microcode(drm_radeon_private_t *dev_priv)
396 } 397 }
397 398
398 RADEON_WRITE(R600_CP_PFP_UCODE_ADDR, 0); 399 RADEON_WRITE(R600_CP_PFP_UCODE_ADDR, 0);
399 DRM_INFO("Loading RS780 PFP Microcode\n"); 400 DRM_INFO("Loading RS780/RS880 PFP Microcode\n");
400 for (i = 0; i < PFP_UCODE_SIZE; i++) 401 for (i = 0; i < PFP_UCODE_SIZE; i++)
401 RADEON_WRITE(R600_CP_PFP_UCODE_DATA, RS780_pfp_microcode[i]); 402 RADEON_WRITE(R600_CP_PFP_UCODE_DATA, RS780_pfp_microcode[i]);
402 } 403 }
@@ -783,6 +784,7 @@ static void r600_gfx_init(struct drm_device *dev,
783 break; 784 break;
784 case CHIP_RV610: 785 case CHIP_RV610:
785 case CHIP_RS780: 786 case CHIP_RS780:
787 case CHIP_RS880:
786 case CHIP_RV620: 788 case CHIP_RV620:
787 dev_priv->r600_max_pipes = 1; 789 dev_priv->r600_max_pipes = 1;
788 dev_priv->r600_max_tile_pipes = 1; 790 dev_priv->r600_max_tile_pipes = 1;
@@ -917,7 +919,8 @@ static void r600_gfx_init(struct drm_device *dev,
917 ((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_RV630) || 919 ((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_RV630) ||
918 ((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_RV610) || 920 ((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_RV610) ||
919 ((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_RV620) || 921 ((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_RV620) ||
920 ((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_RS780)) 922 ((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_RS780) ||
923 ((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_RS880))
921 RADEON_WRITE(R600_DB_DEBUG, R600_PREZ_MUST_WAIT_FOR_POSTZ_DONE); 924 RADEON_WRITE(R600_DB_DEBUG, R600_PREZ_MUST_WAIT_FOR_POSTZ_DONE);
922 else 925 else
923 RADEON_WRITE(R600_DB_DEBUG, 0); 926 RADEON_WRITE(R600_DB_DEBUG, 0);
@@ -935,7 +938,8 @@ static void r600_gfx_init(struct drm_device *dev,
935 sq_ms_fifo_sizes = RADEON_READ(R600_SQ_MS_FIFO_SIZES); 938 sq_ms_fifo_sizes = RADEON_READ(R600_SQ_MS_FIFO_SIZES);
936 if (((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_RV610) || 939 if (((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_RV610) ||
937 ((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_RV620) || 940 ((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_RV620) ||
938 ((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_RS780)) { 941 ((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_RS780) ||
942 ((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_RS880)) {
939 sq_ms_fifo_sizes = (R600_CACHE_FIFO_SIZE(0xa) | 943 sq_ms_fifo_sizes = (R600_CACHE_FIFO_SIZE(0xa) |
940 R600_FETCH_FIFO_HIWATER(0xa) | 944 R600_FETCH_FIFO_HIWATER(0xa) |
941 R600_DONE_FIFO_HIWATER(0xe0) | 945 R600_DONE_FIFO_HIWATER(0xe0) |
@@ -978,7 +982,8 @@ static void r600_gfx_init(struct drm_device *dev,
978 R600_NUM_ES_STACK_ENTRIES(0)); 982 R600_NUM_ES_STACK_ENTRIES(0));
979 } else if (((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_RV610) || 983 } else if (((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_RV610) ||
980 ((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_RV620) || 984 ((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_RV620) ||
981 ((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_RS780)) { 985 ((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_RS780) ||
986 ((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_RS880)) {
982 /* no vertex cache */ 987 /* no vertex cache */
983 sq_config &= ~R600_VC_ENABLE; 988 sq_config &= ~R600_VC_ENABLE;
984 989
@@ -1035,7 +1040,8 @@ static void r600_gfx_init(struct drm_device *dev,
1035 1040
1036 if (((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_RV610) || 1041 if (((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_RV610) ||
1037 ((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_RV620) || 1042 ((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_RV620) ||
1038 ((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_RS780)) 1043 ((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_RS780) ||
1044 ((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_RS880))
1039 RADEON_WRITE(R600_VGT_CACHE_INVALIDATION, R600_CACHE_INVALIDATION(R600_TC_ONLY)); 1045 RADEON_WRITE(R600_VGT_CACHE_INVALIDATION, R600_CACHE_INVALIDATION(R600_TC_ONLY));
1040 else 1046 else
1041 RADEON_WRITE(R600_VGT_CACHE_INVALIDATION, R600_CACHE_INVALIDATION(R600_VC_AND_TC)); 1047 RADEON_WRITE(R600_VGT_CACHE_INVALIDATION, R600_CACHE_INVALIDATION(R600_VC_AND_TC));
@@ -1078,6 +1084,7 @@ static void r600_gfx_init(struct drm_device *dev,
1078 break; 1084 break;
1079 case CHIP_RV610: 1085 case CHIP_RV610:
1080 case CHIP_RS780: 1086 case CHIP_RS780:
1087 case CHIP_RS880:
1081 case CHIP_RV620: 1088 case CHIP_RV620:
1082 gs_prim_buffer_depth = 32; 1089 gs_prim_buffer_depth = 32;
1083 break; 1090 break;
@@ -1123,6 +1130,7 @@ static void r600_gfx_init(struct drm_device *dev,
1123 switch (dev_priv->flags & RADEON_FAMILY_MASK) { 1130 switch (dev_priv->flags & RADEON_FAMILY_MASK) {
1124 case CHIP_RV610: 1131 case CHIP_RV610:
1125 case CHIP_RS780: 1132 case CHIP_RS780:
1133 case CHIP_RS880:
1126 case CHIP_RV620: 1134 case CHIP_RV620:
1127 tc_cntl = R600_TC_L2_SIZE(8); 1135 tc_cntl = R600_TC_L2_SIZE(8);
1128 break; 1136 break;
diff --git a/drivers/gpu/drm/radeon/radeon.h b/drivers/gpu/drm/radeon/radeon.h
index d61f2fc61df5..b1d945b8ed6c 100644
--- a/drivers/gpu/drm/radeon/radeon.h
+++ b/drivers/gpu/drm/radeon/radeon.h
@@ -64,6 +64,7 @@ extern int radeon_agpmode;
64extern int radeon_vram_limit; 64extern int radeon_vram_limit;
65extern int radeon_gart_size; 65extern int radeon_gart_size;
66extern int radeon_benchmarking; 66extern int radeon_benchmarking;
67extern int radeon_testing;
67extern int radeon_connector_table; 68extern int radeon_connector_table;
68 69
69/* 70/*
@@ -113,6 +114,7 @@ enum radeon_family {
113 CHIP_RV770, 114 CHIP_RV770,
114 CHIP_RV730, 115 CHIP_RV730,
115 CHIP_RV710, 116 CHIP_RV710,
117 CHIP_RS880,
116 CHIP_LAST, 118 CHIP_LAST,
117}; 119};
118 120
@@ -201,6 +203,14 @@ int radeon_fence_wait_last(struct radeon_device *rdev);
201struct radeon_fence *radeon_fence_ref(struct radeon_fence *fence); 203struct radeon_fence *radeon_fence_ref(struct radeon_fence *fence);
202void radeon_fence_unref(struct radeon_fence **fence); 204void radeon_fence_unref(struct radeon_fence **fence);
203 205
206/*
207 * Tiling registers
208 */
209struct radeon_surface_reg {
210 struct radeon_object *robj;
211};
212
213#define RADEON_GEM_MAX_SURFACES 8
204 214
205/* 215/*
206 * Radeon buffer. 216 * Radeon buffer.
@@ -213,6 +223,7 @@ struct radeon_object_list {
213 uint64_t gpu_offset; 223 uint64_t gpu_offset;
214 unsigned rdomain; 224 unsigned rdomain;
215 unsigned wdomain; 225 unsigned wdomain;
226 uint32_t tiling_flags;
216}; 227};
217 228
218int radeon_object_init(struct radeon_device *rdev); 229int radeon_object_init(struct radeon_device *rdev);
@@ -242,8 +253,15 @@ void radeon_object_list_clean(struct list_head *head);
242int radeon_object_fbdev_mmap(struct radeon_object *robj, 253int radeon_object_fbdev_mmap(struct radeon_object *robj,
243 struct vm_area_struct *vma); 254 struct vm_area_struct *vma);
244unsigned long radeon_object_size(struct radeon_object *robj); 255unsigned long radeon_object_size(struct radeon_object *robj);
245 256void radeon_object_clear_surface_reg(struct radeon_object *robj);
246 257int radeon_object_check_tiling(struct radeon_object *robj, bool has_moved,
258 bool force_drop);
259void radeon_object_set_tiling_flags(struct radeon_object *robj,
260 uint32_t tiling_flags, uint32_t pitch);
261void radeon_object_get_tiling_flags(struct radeon_object *robj, uint32_t *tiling_flags, uint32_t *pitch);
262void radeon_bo_move_notify(struct ttm_buffer_object *bo,
263 struct ttm_mem_reg *mem);
264void radeon_bo_fault_reserve_notify(struct ttm_buffer_object *bo);
247/* 265/*
248 * GEM objects. 266 * GEM objects.
249 */ 267 */
@@ -315,8 +333,11 @@ struct radeon_mc {
315 unsigned gtt_location; 333 unsigned gtt_location;
316 unsigned gtt_size; 334 unsigned gtt_size;
317 unsigned vram_location; 335 unsigned vram_location;
318 unsigned vram_size; 336 /* for some chips with <= 32MB we need to lie
337 * about vram size near mc fb location */
338 unsigned mc_vram_size;
319 unsigned vram_width; 339 unsigned vram_width;
340 unsigned real_vram_size;
320 int vram_mtrr; 341 int vram_mtrr;
321 bool vram_is_ddr; 342 bool vram_is_ddr;
322}; 343};
@@ -474,6 +495,39 @@ struct radeon_wb {
474 uint64_t gpu_addr; 495 uint64_t gpu_addr;
475}; 496};
476 497
498/**
499 * struct radeon_pm - power management datas
500 * @max_bandwidth: maximum bandwidth the gpu has (MByte/s)
501 * @igp_sideport_mclk: sideport memory clock Mhz (rs690,rs740,rs780,rs880)
502 * @igp_system_mclk: system clock Mhz (rs690,rs740,rs780,rs880)
503 * @igp_ht_link_clk: ht link clock Mhz (rs690,rs740,rs780,rs880)
504 * @igp_ht_link_width: ht link width in bits (rs690,rs740,rs780,rs880)
505 * @k8_bandwidth: k8 bandwidth the gpu has (MByte/s) (IGP)
506 * @sideport_bandwidth: sideport bandwidth the gpu has (MByte/s) (IGP)
507 * @ht_bandwidth: ht bandwidth the gpu has (MByte/s) (IGP)
508 * @core_bandwidth: core GPU bandwidth the gpu has (MByte/s) (IGP)
509 * @sclk: GPU clock Mhz (core bandwith depends of this clock)
510 * @needed_bandwidth: current bandwidth needs
511 *
512 * It keeps track of various data needed to take powermanagement decision.
513 * Bandwith need is used to determine minimun clock of the GPU and memory.
514 * Equation between gpu/memory clock and available bandwidth is hw dependent
515 * (type of memory, bus size, efficiency, ...)
516 */
517struct radeon_pm {
518 fixed20_12 max_bandwidth;
519 fixed20_12 igp_sideport_mclk;
520 fixed20_12 igp_system_mclk;
521 fixed20_12 igp_ht_link_clk;
522 fixed20_12 igp_ht_link_width;
523 fixed20_12 k8_bandwidth;
524 fixed20_12 sideport_bandwidth;
525 fixed20_12 ht_bandwidth;
526 fixed20_12 core_bandwidth;
527 fixed20_12 sclk;
528 fixed20_12 needed_bandwidth;
529};
530
477 531
478/* 532/*
479 * Benchmarking 533 * Benchmarking
@@ -482,6 +536,12 @@ void radeon_benchmark(struct radeon_device *rdev);
482 536
483 537
484/* 538/*
539 * Testing
540 */
541void radeon_test_moves(struct radeon_device *rdev);
542
543
544/*
485 * Debugfs 545 * Debugfs
486 */ 546 */
487int radeon_debugfs_add_files(struct radeon_device *rdev, 547int radeon_debugfs_add_files(struct radeon_device *rdev,
@@ -535,6 +595,11 @@ struct radeon_asic {
535 void (*set_memory_clock)(struct radeon_device *rdev, uint32_t mem_clock); 595 void (*set_memory_clock)(struct radeon_device *rdev, uint32_t mem_clock);
536 void (*set_pcie_lanes)(struct radeon_device *rdev, int lanes); 596 void (*set_pcie_lanes)(struct radeon_device *rdev, int lanes);
537 void (*set_clock_gating)(struct radeon_device *rdev, int enable); 597 void (*set_clock_gating)(struct radeon_device *rdev, int enable);
598 int (*set_surface_reg)(struct radeon_device *rdev, int reg,
599 uint32_t tiling_flags, uint32_t pitch,
600 uint32_t offset, uint32_t obj_size);
601 int (*clear_surface_reg)(struct radeon_device *rdev, int reg);
602 void (*bandwidth_update)(struct radeon_device *rdev);
538}; 603};
539 604
540union radeon_asic_config { 605union radeon_asic_config {
@@ -566,6 +631,10 @@ int radeon_gem_busy_ioctl(struct drm_device *dev, void *data,
566int radeon_gem_wait_idle_ioctl(struct drm_device *dev, void *data, 631int radeon_gem_wait_idle_ioctl(struct drm_device *dev, void *data,
567 struct drm_file *filp); 632 struct drm_file *filp);
568int radeon_cs_ioctl(struct drm_device *dev, void *data, struct drm_file *filp); 633int radeon_cs_ioctl(struct drm_device *dev, void *data, struct drm_file *filp);
634int radeon_gem_set_tiling_ioctl(struct drm_device *dev, void *data,
635 struct drm_file *filp);
636int radeon_gem_get_tiling_ioctl(struct drm_device *dev, void *data,
637 struct drm_file *filp);
569 638
570 639
571/* 640/*
@@ -594,8 +663,8 @@ struct radeon_device {
594 struct radeon_object *fbdev_robj; 663 struct radeon_object *fbdev_robj;
595 struct radeon_framebuffer *fbdev_rfb; 664 struct radeon_framebuffer *fbdev_rfb;
596 /* Register mmio */ 665 /* Register mmio */
597 unsigned long rmmio_base; 666 resource_size_t rmmio_base;
598 unsigned long rmmio_size; 667 resource_size_t rmmio_size;
599 void *rmmio; 668 void *rmmio;
600 radeon_rreg_t mm_rreg; 669 radeon_rreg_t mm_rreg;
601 radeon_wreg_t mm_wreg; 670 radeon_wreg_t mm_wreg;
@@ -619,11 +688,14 @@ struct radeon_device {
619 struct radeon_irq irq; 688 struct radeon_irq irq;
620 struct radeon_asic *asic; 689 struct radeon_asic *asic;
621 struct radeon_gem gem; 690 struct radeon_gem gem;
691 struct radeon_pm pm;
622 struct mutex cs_mutex; 692 struct mutex cs_mutex;
623 struct radeon_wb wb; 693 struct radeon_wb wb;
624 bool gpu_lockup; 694 bool gpu_lockup;
625 bool shutdown; 695 bool shutdown;
626 bool suspend; 696 bool suspend;
697 bool need_dma32;
698 struct radeon_surface_reg surface_regs[RADEON_GEM_MAX_SURFACES];
627}; 699};
628 700
629int radeon_device_init(struct radeon_device *rdev, 701int radeon_device_init(struct radeon_device *rdev,
@@ -670,6 +742,8 @@ void r100_pll_errata_after_index(struct radeon_device *rdev);
670/* 742/*
671 * ASICs helpers. 743 * ASICs helpers.
672 */ 744 */
745#define ASIC_IS_RN50(rdev) ((rdev->pdev->device == 0x515e) || \
746 (rdev->pdev->device == 0x5969))
673#define ASIC_IS_RV100(rdev) ((rdev->family == CHIP_RV100) || \ 747#define ASIC_IS_RV100(rdev) ((rdev->family == CHIP_RV100) || \
674 (rdev->family == CHIP_RV200) || \ 748 (rdev->family == CHIP_RV200) || \
675 (rdev->family == CHIP_RS100) || \ 749 (rdev->family == CHIP_RS100) || \
@@ -796,5 +870,8 @@ static inline void radeon_ring_write(struct radeon_device *rdev, uint32_t v)
796#define radeon_set_memory_clock(rdev, e) (rdev)->asic->set_engine_clock((rdev), (e)) 870#define radeon_set_memory_clock(rdev, e) (rdev)->asic->set_engine_clock((rdev), (e))
797#define radeon_set_pcie_lanes(rdev, l) (rdev)->asic->set_pcie_lanes((rdev), (l)) 871#define radeon_set_pcie_lanes(rdev, l) (rdev)->asic->set_pcie_lanes((rdev), (l))
798#define radeon_set_clock_gating(rdev, e) (rdev)->asic->set_clock_gating((rdev), (e)) 872#define radeon_set_clock_gating(rdev, e) (rdev)->asic->set_clock_gating((rdev), (e))
873#define radeon_set_surface_reg(rdev, r, f, p, o, s) ((rdev)->asic->set_surface_reg((rdev), (r), (f), (p), (o), (s)))
874#define radeon_clear_surface_reg(rdev, r) ((rdev)->asic->clear_surface_reg((rdev), (r)))
875#define radeon_bandwidth_update(rdev) (rdev)->asic->bandwidth_update((rdev))
799 876
800#endif 877#endif
diff --git a/drivers/gpu/drm/radeon/radeon_asic.h b/drivers/gpu/drm/radeon/radeon_asic.h
index e2e567395df8..9a75876e0c3b 100644
--- a/drivers/gpu/drm/radeon/radeon_asic.h
+++ b/drivers/gpu/drm/radeon/radeon_asic.h
@@ -71,6 +71,11 @@ int r100_copy_blit(struct radeon_device *rdev,
71 uint64_t dst_offset, 71 uint64_t dst_offset,
72 unsigned num_pages, 72 unsigned num_pages,
73 struct radeon_fence *fence); 73 struct radeon_fence *fence);
74int r100_set_surface_reg(struct radeon_device *rdev, int reg,
75 uint32_t tiling_flags, uint32_t pitch,
76 uint32_t offset, uint32_t obj_size);
77int r100_clear_surface_reg(struct radeon_device *rdev, int reg);
78void r100_bandwidth_update(struct radeon_device *rdev);
74 79
75static struct radeon_asic r100_asic = { 80static struct radeon_asic r100_asic = {
76 .init = &r100_init, 81 .init = &r100_init,
@@ -100,6 +105,9 @@ static struct radeon_asic r100_asic = {
100 .set_memory_clock = NULL, 105 .set_memory_clock = NULL,
101 .set_pcie_lanes = NULL, 106 .set_pcie_lanes = NULL,
102 .set_clock_gating = &radeon_legacy_set_clock_gating, 107 .set_clock_gating = &radeon_legacy_set_clock_gating,
108 .set_surface_reg = r100_set_surface_reg,
109 .clear_surface_reg = r100_clear_surface_reg,
110 .bandwidth_update = &r100_bandwidth_update,
103}; 111};
104 112
105 113
@@ -128,6 +136,7 @@ int r300_copy_dma(struct radeon_device *rdev,
128 uint64_t dst_offset, 136 uint64_t dst_offset,
129 unsigned num_pages, 137 unsigned num_pages,
130 struct radeon_fence *fence); 138 struct radeon_fence *fence);
139
131static struct radeon_asic r300_asic = { 140static struct radeon_asic r300_asic = {
132 .init = &r300_init, 141 .init = &r300_init,
133 .errata = &r300_errata, 142 .errata = &r300_errata,
@@ -156,6 +165,9 @@ static struct radeon_asic r300_asic = {
156 .set_memory_clock = NULL, 165 .set_memory_clock = NULL,
157 .set_pcie_lanes = &rv370_set_pcie_lanes, 166 .set_pcie_lanes = &rv370_set_pcie_lanes,
158 .set_clock_gating = &radeon_legacy_set_clock_gating, 167 .set_clock_gating = &radeon_legacy_set_clock_gating,
168 .set_surface_reg = r100_set_surface_reg,
169 .clear_surface_reg = r100_clear_surface_reg,
170 .bandwidth_update = &r100_bandwidth_update,
159}; 171};
160 172
161/* 173/*
@@ -193,6 +205,9 @@ static struct radeon_asic r420_asic = {
193 .set_memory_clock = &radeon_atom_set_memory_clock, 205 .set_memory_clock = &radeon_atom_set_memory_clock,
194 .set_pcie_lanes = &rv370_set_pcie_lanes, 206 .set_pcie_lanes = &rv370_set_pcie_lanes,
195 .set_clock_gating = &radeon_atom_set_clock_gating, 207 .set_clock_gating = &radeon_atom_set_clock_gating,
208 .set_surface_reg = r100_set_surface_reg,
209 .clear_surface_reg = r100_clear_surface_reg,
210 .bandwidth_update = &r100_bandwidth_update,
196}; 211};
197 212
198 213
@@ -237,6 +252,9 @@ static struct radeon_asic rs400_asic = {
237 .set_memory_clock = NULL, 252 .set_memory_clock = NULL,
238 .set_pcie_lanes = NULL, 253 .set_pcie_lanes = NULL,
239 .set_clock_gating = &radeon_legacy_set_clock_gating, 254 .set_clock_gating = &radeon_legacy_set_clock_gating,
255 .set_surface_reg = r100_set_surface_reg,
256 .clear_surface_reg = r100_clear_surface_reg,
257 .bandwidth_update = &r100_bandwidth_update,
240}; 258};
241 259
242 260
@@ -254,6 +272,7 @@ void rs600_gart_tlb_flush(struct radeon_device *rdev);
254int rs600_gart_set_page(struct radeon_device *rdev, int i, uint64_t addr); 272int rs600_gart_set_page(struct radeon_device *rdev, int i, uint64_t addr);
255uint32_t rs600_mc_rreg(struct radeon_device *rdev, uint32_t reg); 273uint32_t rs600_mc_rreg(struct radeon_device *rdev, uint32_t reg);
256void rs600_mc_wreg(struct radeon_device *rdev, uint32_t reg, uint32_t v); 274void rs600_mc_wreg(struct radeon_device *rdev, uint32_t reg, uint32_t v);
275void rs600_bandwidth_update(struct radeon_device *rdev);
257static struct radeon_asic rs600_asic = { 276static struct radeon_asic rs600_asic = {
258 .init = &r300_init, 277 .init = &r300_init,
259 .errata = &rs600_errata, 278 .errata = &rs600_errata,
@@ -282,6 +301,7 @@ static struct radeon_asic rs600_asic = {
282 .set_memory_clock = &radeon_atom_set_memory_clock, 301 .set_memory_clock = &radeon_atom_set_memory_clock,
283 .set_pcie_lanes = NULL, 302 .set_pcie_lanes = NULL,
284 .set_clock_gating = &radeon_atom_set_clock_gating, 303 .set_clock_gating = &radeon_atom_set_clock_gating,
304 .bandwidth_update = &rs600_bandwidth_update,
285}; 305};
286 306
287 307
@@ -294,6 +314,7 @@ int rs690_mc_init(struct radeon_device *rdev);
294void rs690_mc_fini(struct radeon_device *rdev); 314void rs690_mc_fini(struct radeon_device *rdev);
295uint32_t rs690_mc_rreg(struct radeon_device *rdev, uint32_t reg); 315uint32_t rs690_mc_rreg(struct radeon_device *rdev, uint32_t reg);
296void rs690_mc_wreg(struct radeon_device *rdev, uint32_t reg, uint32_t v); 316void rs690_mc_wreg(struct radeon_device *rdev, uint32_t reg, uint32_t v);
317void rs690_bandwidth_update(struct radeon_device *rdev);
297static struct radeon_asic rs690_asic = { 318static struct radeon_asic rs690_asic = {
298 .init = &r300_init, 319 .init = &r300_init,
299 .errata = &rs690_errata, 320 .errata = &rs690_errata,
@@ -322,6 +343,9 @@ static struct radeon_asic rs690_asic = {
322 .set_memory_clock = &radeon_atom_set_memory_clock, 343 .set_memory_clock = &radeon_atom_set_memory_clock,
323 .set_pcie_lanes = NULL, 344 .set_pcie_lanes = NULL,
324 .set_clock_gating = &radeon_atom_set_clock_gating, 345 .set_clock_gating = &radeon_atom_set_clock_gating,
346 .set_surface_reg = r100_set_surface_reg,
347 .clear_surface_reg = r100_clear_surface_reg,
348 .bandwidth_update = &rs690_bandwidth_update,
325}; 349};
326 350
327 351
@@ -339,6 +363,7 @@ void rv515_mc_wreg(struct radeon_device *rdev, uint32_t reg, uint32_t v);
339void rv515_ring_start(struct radeon_device *rdev); 363void rv515_ring_start(struct radeon_device *rdev);
340uint32_t rv515_pcie_rreg(struct radeon_device *rdev, uint32_t reg); 364uint32_t rv515_pcie_rreg(struct radeon_device *rdev, uint32_t reg);
341void rv515_pcie_wreg(struct radeon_device *rdev, uint32_t reg, uint32_t v); 365void rv515_pcie_wreg(struct radeon_device *rdev, uint32_t reg, uint32_t v);
366void rv515_bandwidth_update(struct radeon_device *rdev);
342static struct radeon_asic rv515_asic = { 367static struct radeon_asic rv515_asic = {
343 .init = &rv515_init, 368 .init = &rv515_init,
344 .errata = &rv515_errata, 369 .errata = &rv515_errata,
@@ -367,6 +392,9 @@ static struct radeon_asic rv515_asic = {
367 .set_memory_clock = &radeon_atom_set_memory_clock, 392 .set_memory_clock = &radeon_atom_set_memory_clock,
368 .set_pcie_lanes = &rv370_set_pcie_lanes, 393 .set_pcie_lanes = &rv370_set_pcie_lanes,
369 .set_clock_gating = &radeon_atom_set_clock_gating, 394 .set_clock_gating = &radeon_atom_set_clock_gating,
395 .set_surface_reg = r100_set_surface_reg,
396 .clear_surface_reg = r100_clear_surface_reg,
397 .bandwidth_update = &rv515_bandwidth_update,
370}; 398};
371 399
372 400
@@ -377,6 +405,7 @@ void r520_errata(struct radeon_device *rdev);
377void r520_vram_info(struct radeon_device *rdev); 405void r520_vram_info(struct radeon_device *rdev);
378int r520_mc_init(struct radeon_device *rdev); 406int r520_mc_init(struct radeon_device *rdev);
379void r520_mc_fini(struct radeon_device *rdev); 407void r520_mc_fini(struct radeon_device *rdev);
408void r520_bandwidth_update(struct radeon_device *rdev);
380static struct radeon_asic r520_asic = { 409static struct radeon_asic r520_asic = {
381 .init = &rv515_init, 410 .init = &rv515_init,
382 .errata = &r520_errata, 411 .errata = &r520_errata,
@@ -405,6 +434,9 @@ static struct radeon_asic r520_asic = {
405 .set_memory_clock = &radeon_atom_set_memory_clock, 434 .set_memory_clock = &radeon_atom_set_memory_clock,
406 .set_pcie_lanes = &rv370_set_pcie_lanes, 435 .set_pcie_lanes = &rv370_set_pcie_lanes,
407 .set_clock_gating = &radeon_atom_set_clock_gating, 436 .set_clock_gating = &radeon_atom_set_clock_gating,
437 .set_surface_reg = r100_set_surface_reg,
438 .clear_surface_reg = r100_clear_surface_reg,
439 .bandwidth_update = &r520_bandwidth_update,
408}; 440};
409 441
410/* 442/*
diff --git a/drivers/gpu/drm/radeon/radeon_atombios.c b/drivers/gpu/drm/radeon/radeon_atombios.c
index 1f5a1a490984..fcfe5c02d744 100644
--- a/drivers/gpu/drm/radeon/radeon_atombios.c
+++ b/drivers/gpu/drm/radeon/radeon_atombios.c
@@ -103,7 +103,8 @@ static inline struct radeon_i2c_bus_rec radeon_lookup_gpio(struct drm_device
103static bool radeon_atom_apply_quirks(struct drm_device *dev, 103static bool radeon_atom_apply_quirks(struct drm_device *dev,
104 uint32_t supported_device, 104 uint32_t supported_device,
105 int *connector_type, 105 int *connector_type,
106 struct radeon_i2c_bus_rec *i2c_bus) 106 struct radeon_i2c_bus_rec *i2c_bus,
107 uint8_t *line_mux)
107{ 108{
108 109
109 /* Asus M2A-VM HDMI board lists the DVI port as HDMI */ 110 /* Asus M2A-VM HDMI board lists the DVI port as HDMI */
@@ -127,8 +128,10 @@ static bool radeon_atom_apply_quirks(struct drm_device *dev,
127 if ((dev->pdev->device == 0x5653) && 128 if ((dev->pdev->device == 0x5653) &&
128 (dev->pdev->subsystem_vendor == 0x1462) && 129 (dev->pdev->subsystem_vendor == 0x1462) &&
129 (dev->pdev->subsystem_device == 0x0291)) { 130 (dev->pdev->subsystem_device == 0x0291)) {
130 if (*connector_type == DRM_MODE_CONNECTOR_LVDS) 131 if (*connector_type == DRM_MODE_CONNECTOR_LVDS) {
131 i2c_bus->valid = false; 132 i2c_bus->valid = false;
133 *line_mux = 53;
134 }
132 } 135 }
133 136
134 /* Funky macbooks */ 137 /* Funky macbooks */
@@ -526,7 +529,7 @@ bool radeon_get_atom_connector_info_from_supported_devices_table(struct
526 529
527 if (!radeon_atom_apply_quirks 530 if (!radeon_atom_apply_quirks
528 (dev, (1 << i), &bios_connectors[i].connector_type, 531 (dev, (1 << i), &bios_connectors[i].connector_type,
529 &bios_connectors[i].ddc_bus)) 532 &bios_connectors[i].ddc_bus, &bios_connectors[i].line_mux))
530 continue; 533 continue;
531 534
532 bios_connectors[i].valid = true; 535 bios_connectors[i].valid = true;
diff --git a/drivers/gpu/drm/radeon/radeon_benchmark.c b/drivers/gpu/drm/radeon/radeon_benchmark.c
index c44403a2ca76..2e938f7496fb 100644
--- a/drivers/gpu/drm/radeon/radeon_benchmark.c
+++ b/drivers/gpu/drm/radeon/radeon_benchmark.c
@@ -63,7 +63,7 @@ void radeon_benchmark_move(struct radeon_device *rdev, unsigned bsize,
63 if (r) { 63 if (r) {
64 goto out_cleanup; 64 goto out_cleanup;
65 } 65 }
66 r = radeon_copy_dma(rdev, saddr, daddr, size >> 14, fence); 66 r = radeon_copy_dma(rdev, saddr, daddr, size / 4096, fence);
67 if (r) { 67 if (r) {
68 goto out_cleanup; 68 goto out_cleanup;
69 } 69 }
@@ -88,7 +88,7 @@ void radeon_benchmark_move(struct radeon_device *rdev, unsigned bsize,
88 if (r) { 88 if (r) {
89 goto out_cleanup; 89 goto out_cleanup;
90 } 90 }
91 r = radeon_copy_blit(rdev, saddr, daddr, size >> 14, fence); 91 r = radeon_copy_blit(rdev, saddr, daddr, size / 4096, fence);
92 if (r) { 92 if (r) {
93 goto out_cleanup; 93 goto out_cleanup;
94 } 94 }
diff --git a/drivers/gpu/drm/radeon/radeon_cs.c b/drivers/gpu/drm/radeon/radeon_cs.c
index b843f9bdfb14..a169067efc4e 100644
--- a/drivers/gpu/drm/radeon/radeon_cs.c
+++ b/drivers/gpu/drm/radeon/radeon_cs.c
@@ -127,17 +127,23 @@ int radeon_cs_parser_init(struct radeon_cs_parser *p, void *data)
127 sizeof(struct drm_radeon_cs_chunk))) { 127 sizeof(struct drm_radeon_cs_chunk))) {
128 return -EFAULT; 128 return -EFAULT;
129 } 129 }
130 p->chunks[i].length_dw = user_chunk.length_dw;
131 p->chunks[i].kdata = NULL;
130 p->chunks[i].chunk_id = user_chunk.chunk_id; 132 p->chunks[i].chunk_id = user_chunk.chunk_id;
133
131 if (p->chunks[i].chunk_id == RADEON_CHUNK_ID_RELOCS) { 134 if (p->chunks[i].chunk_id == RADEON_CHUNK_ID_RELOCS) {
132 p->chunk_relocs_idx = i; 135 p->chunk_relocs_idx = i;
133 } 136 }
134 if (p->chunks[i].chunk_id == RADEON_CHUNK_ID_IB) { 137 if (p->chunks[i].chunk_id == RADEON_CHUNK_ID_IB) {
135 p->chunk_ib_idx = i; 138 p->chunk_ib_idx = i;
139 /* zero length IB isn't useful */
140 if (p->chunks[i].length_dw == 0)
141 return -EINVAL;
136 } 142 }
143
137 p->chunks[i].length_dw = user_chunk.length_dw; 144 p->chunks[i].length_dw = user_chunk.length_dw;
138 cdata = (uint32_t *)(unsigned long)user_chunk.chunk_data; 145 cdata = (uint32_t *)(unsigned long)user_chunk.chunk_data;
139 146
140 p->chunks[i].kdata = NULL;
141 size = p->chunks[i].length_dw * sizeof(uint32_t); 147 size = p->chunks[i].length_dw * sizeof(uint32_t);
142 p->chunks[i].kdata = kzalloc(size, GFP_KERNEL); 148 p->chunks[i].kdata = kzalloc(size, GFP_KERNEL);
143 if (p->chunks[i].kdata == NULL) { 149 if (p->chunks[i].kdata == NULL) {
diff --git a/drivers/gpu/drm/radeon/radeon_cursor.c b/drivers/gpu/drm/radeon/radeon_cursor.c
index 5232441f119b..b13c79e38bc0 100644
--- a/drivers/gpu/drm/radeon/radeon_cursor.c
+++ b/drivers/gpu/drm/radeon/radeon_cursor.c
@@ -111,9 +111,11 @@ static void radeon_set_cursor(struct drm_crtc *crtc, struct drm_gem_object *obj,
111 111
112 if (ASIC_IS_AVIVO(rdev)) 112 if (ASIC_IS_AVIVO(rdev))
113 WREG32(AVIVO_D1CUR_SURFACE_ADDRESS + radeon_crtc->crtc_offset, gpu_addr); 113 WREG32(AVIVO_D1CUR_SURFACE_ADDRESS + radeon_crtc->crtc_offset, gpu_addr);
114 else 114 else {
115 radeon_crtc->legacy_cursor_offset = gpu_addr - radeon_crtc->legacy_display_base_addr;
115 /* offset is from DISP(2)_BASE_ADDRESS */ 116 /* offset is from DISP(2)_BASE_ADDRESS */
116 WREG32(RADEON_CUR_OFFSET + radeon_crtc->crtc_offset, gpu_addr); 117 WREG32(RADEON_CUR_OFFSET + radeon_crtc->crtc_offset, radeon_crtc->legacy_cursor_offset);
118 }
117} 119}
118 120
119int radeon_crtc_cursor_set(struct drm_crtc *crtc, 121int radeon_crtc_cursor_set(struct drm_crtc *crtc,
@@ -245,6 +247,9 @@ int radeon_crtc_cursor_move(struct drm_crtc *crtc,
245 (RADEON_CUR_LOCK 247 (RADEON_CUR_LOCK
246 | ((xorigin ? 0 : x) << 16) 248 | ((xorigin ? 0 : x) << 16)
247 | (yorigin ? 0 : y))); 249 | (yorigin ? 0 : y)));
250 /* offset is from DISP(2)_BASE_ADDRESS */
251 WREG32(RADEON_CUR_OFFSET + radeon_crtc->crtc_offset, (radeon_crtc->legacy_cursor_offset +
252 (yorigin * 256)));
248 } 253 }
249 radeon_lock_cursor(crtc, false); 254 radeon_lock_cursor(crtc, false);
250 255
diff --git a/drivers/gpu/drm/radeon/radeon_device.c b/drivers/gpu/drm/radeon/radeon_device.c
index f30aa7274a54..9ff6dcb97f9d 100644
--- a/drivers/gpu/drm/radeon/radeon_device.c
+++ b/drivers/gpu/drm/radeon/radeon_device.c
@@ -35,6 +35,25 @@
35#include "atom.h" 35#include "atom.h"
36 36
37/* 37/*
38 * Clear GPU surface registers.
39 */
40static void radeon_surface_init(struct radeon_device *rdev)
41{
42 /* FIXME: check this out */
43 if (rdev->family < CHIP_R600) {
44 int i;
45
46 for (i = 0; i < 8; i++) {
47 WREG32(RADEON_SURFACE0_INFO +
48 i * (RADEON_SURFACE1_INFO - RADEON_SURFACE0_INFO),
49 0);
50 }
51 /* enable surfaces */
52 WREG32(RADEON_SURFACE_CNTL, 0);
53 }
54}
55
56/*
38 * GPU scratch registers helpers function. 57 * GPU scratch registers helpers function.
39 */ 58 */
40static void radeon_scratch_init(struct radeon_device *rdev) 59static void radeon_scratch_init(struct radeon_device *rdev)
@@ -102,7 +121,7 @@ int radeon_mc_setup(struct radeon_device *rdev)
102 if (rdev->mc.vram_location != 0xFFFFFFFFUL) { 121 if (rdev->mc.vram_location != 0xFFFFFFFFUL) {
103 /* vram location was already setup try to put gtt after 122 /* vram location was already setup try to put gtt after
104 * if it fits */ 123 * if it fits */
105 tmp = rdev->mc.vram_location + rdev->mc.vram_size; 124 tmp = rdev->mc.vram_location + rdev->mc.mc_vram_size;
106 tmp = (tmp + rdev->mc.gtt_size - 1) & ~(rdev->mc.gtt_size - 1); 125 tmp = (tmp + rdev->mc.gtt_size - 1) & ~(rdev->mc.gtt_size - 1);
107 if ((0xFFFFFFFFUL - tmp) >= rdev->mc.gtt_size) { 126 if ((0xFFFFFFFFUL - tmp) >= rdev->mc.gtt_size) {
108 rdev->mc.gtt_location = tmp; 127 rdev->mc.gtt_location = tmp;
@@ -117,13 +136,13 @@ int radeon_mc_setup(struct radeon_device *rdev)
117 } else if (rdev->mc.gtt_location != 0xFFFFFFFFUL) { 136 } else if (rdev->mc.gtt_location != 0xFFFFFFFFUL) {
118 /* gtt location was already setup try to put vram before 137 /* gtt location was already setup try to put vram before
119 * if it fits */ 138 * if it fits */
120 if (rdev->mc.vram_size < rdev->mc.gtt_location) { 139 if (rdev->mc.mc_vram_size < rdev->mc.gtt_location) {
121 rdev->mc.vram_location = 0; 140 rdev->mc.vram_location = 0;
122 } else { 141 } else {
123 tmp = rdev->mc.gtt_location + rdev->mc.gtt_size; 142 tmp = rdev->mc.gtt_location + rdev->mc.gtt_size;
124 tmp += (rdev->mc.vram_size - 1); 143 tmp += (rdev->mc.mc_vram_size - 1);
125 tmp &= ~(rdev->mc.vram_size - 1); 144 tmp &= ~(rdev->mc.mc_vram_size - 1);
126 if ((0xFFFFFFFFUL - tmp) >= rdev->mc.vram_size) { 145 if ((0xFFFFFFFFUL - tmp) >= rdev->mc.mc_vram_size) {
127 rdev->mc.vram_location = tmp; 146 rdev->mc.vram_location = tmp;
128 } else { 147 } else {
129 printk(KERN_ERR "[drm] vram too big to fit " 148 printk(KERN_ERR "[drm] vram too big to fit "
@@ -133,12 +152,16 @@ int radeon_mc_setup(struct radeon_device *rdev)
133 } 152 }
134 } else { 153 } else {
135 rdev->mc.vram_location = 0; 154 rdev->mc.vram_location = 0;
136 rdev->mc.gtt_location = rdev->mc.vram_size; 155 tmp = rdev->mc.mc_vram_size;
156 tmp = (tmp + rdev->mc.gtt_size - 1) & ~(rdev->mc.gtt_size - 1);
157 rdev->mc.gtt_location = tmp;
137 } 158 }
138 DRM_INFO("radeon: VRAM %uM\n", rdev->mc.vram_size >> 20); 159 DRM_INFO("radeon: VRAM %uM\n", rdev->mc.real_vram_size >> 20);
139 DRM_INFO("radeon: VRAM from 0x%08X to 0x%08X\n", 160 DRM_INFO("radeon: VRAM from 0x%08X to 0x%08X\n",
140 rdev->mc.vram_location, 161 rdev->mc.vram_location,
141 rdev->mc.vram_location + rdev->mc.vram_size - 1); 162 rdev->mc.vram_location + rdev->mc.mc_vram_size - 1);
163 if (rdev->mc.real_vram_size != rdev->mc.mc_vram_size)
164 DRM_INFO("radeon: VRAM less than aperture workaround enabled\n");
142 DRM_INFO("radeon: GTT %uM\n", rdev->mc.gtt_size >> 20); 165 DRM_INFO("radeon: GTT %uM\n", rdev->mc.gtt_size >> 20);
143 DRM_INFO("radeon: GTT from 0x%08X to 0x%08X\n", 166 DRM_INFO("radeon: GTT from 0x%08X to 0x%08X\n",
144 rdev->mc.gtt_location, 167 rdev->mc.gtt_location,
@@ -433,6 +456,7 @@ int radeon_device_init(struct radeon_device *rdev,
433 uint32_t flags) 456 uint32_t flags)
434{ 457{
435 int r, ret; 458 int r, ret;
459 int dma_bits;
436 460
437 DRM_INFO("radeon: Initializing kernel modesetting.\n"); 461 DRM_INFO("radeon: Initializing kernel modesetting.\n");
438 rdev->shutdown = false; 462 rdev->shutdown = false;
@@ -475,8 +499,20 @@ int radeon_device_init(struct radeon_device *rdev,
475 return r; 499 return r;
476 } 500 }
477 501
478 /* Report DMA addressing limitation */ 502 /* set DMA mask + need_dma32 flags.
479 r = pci_set_dma_mask(rdev->pdev, DMA_BIT_MASK(32)); 503 * PCIE - can handle 40-bits.
504 * IGP - can handle 40-bits (in theory)
505 * AGP - generally dma32 is safest
506 * PCI - only dma32
507 */
508 rdev->need_dma32 = false;
509 if (rdev->flags & RADEON_IS_AGP)
510 rdev->need_dma32 = true;
511 if (rdev->flags & RADEON_IS_PCI)
512 rdev->need_dma32 = true;
513
514 dma_bits = rdev->need_dma32 ? 32 : 40;
515 r = pci_set_dma_mask(rdev->pdev, DMA_BIT_MASK(dma_bits));
480 if (r) { 516 if (r) {
481 printk(KERN_WARNING "radeon: No suitable DMA available.\n"); 517 printk(KERN_WARNING "radeon: No suitable DMA available.\n");
482 } 518 }
@@ -496,6 +532,8 @@ int radeon_device_init(struct radeon_device *rdev,
496 radeon_errata(rdev); 532 radeon_errata(rdev);
497 /* Initialize scratch registers */ 533 /* Initialize scratch registers */
498 radeon_scratch_init(rdev); 534 radeon_scratch_init(rdev);
535 /* Initialize surface registers */
536 radeon_surface_init(rdev);
499 537
500 /* TODO: disable VGA need to use VGA request */ 538 /* TODO: disable VGA need to use VGA request */
501 /* BIOS*/ 539 /* BIOS*/
@@ -527,27 +565,22 @@ int radeon_device_init(struct radeon_device *rdev,
527 radeon_combios_asic_init(rdev->ddev); 565 radeon_combios_asic_init(rdev->ddev);
528 } 566 }
529 } 567 }
568 /* Initialize clocks */
569 r = radeon_clocks_init(rdev);
570 if (r) {
571 return r;
572 }
530 /* Get vram informations */ 573 /* Get vram informations */
531 radeon_vram_info(rdev); 574 radeon_vram_info(rdev);
532 /* Device is severly broken if aper size > vram size. 575
533 * for RN50/M6/M7 - Novell bug 204882 ?
534 */
535 if (rdev->mc.vram_size < rdev->mc.aper_size) {
536 rdev->mc.aper_size = rdev->mc.vram_size;
537 }
538 /* Add an MTRR for the VRAM */ 576 /* Add an MTRR for the VRAM */
539 rdev->mc.vram_mtrr = mtrr_add(rdev->mc.aper_base, rdev->mc.aper_size, 577 rdev->mc.vram_mtrr = mtrr_add(rdev->mc.aper_base, rdev->mc.aper_size,
540 MTRR_TYPE_WRCOMB, 1); 578 MTRR_TYPE_WRCOMB, 1);
541 DRM_INFO("Detected VRAM RAM=%uM, BAR=%uM\n", 579 DRM_INFO("Detected VRAM RAM=%uM, BAR=%uM\n",
542 rdev->mc.vram_size >> 20, 580 rdev->mc.real_vram_size >> 20,
543 (unsigned)rdev->mc.aper_size >> 20); 581 (unsigned)rdev->mc.aper_size >> 20);
544 DRM_INFO("RAM width %dbits %cDR\n", 582 DRM_INFO("RAM width %dbits %cDR\n",
545 rdev->mc.vram_width, rdev->mc.vram_is_ddr ? 'D' : 'S'); 583 rdev->mc.vram_width, rdev->mc.vram_is_ddr ? 'D' : 'S');
546 /* Initialize clocks */
547 r = radeon_clocks_init(rdev);
548 if (r) {
549 return r;
550 }
551 /* Initialize memory controller (also test AGP) */ 584 /* Initialize memory controller (also test AGP) */
552 r = radeon_mc_init(rdev); 585 r = radeon_mc_init(rdev);
553 if (r) { 586 if (r) {
@@ -604,12 +637,12 @@ int radeon_device_init(struct radeon_device *rdev,
604 if (r) { 637 if (r) {
605 return r; 638 return r;
606 } 639 }
607 if (rdev->fbdev_rfb && rdev->fbdev_rfb->obj) {
608 rdev->fbdev_robj = rdev->fbdev_rfb->obj->driver_private;
609 }
610 if (!ret) { 640 if (!ret) {
611 DRM_INFO("radeon: kernel modesetting successfully initialized.\n"); 641 DRM_INFO("radeon: kernel modesetting successfully initialized.\n");
612 } 642 }
643 if (radeon_testing) {
644 radeon_test_moves(rdev);
645 }
613 if (radeon_benchmarking) { 646 if (radeon_benchmarking) {
614 radeon_benchmark(rdev); 647 radeon_benchmark(rdev);
615 } 648 }
diff --git a/drivers/gpu/drm/radeon/radeon_display.c b/drivers/gpu/drm/radeon/radeon_display.c
index 3efcf1a526be..a8fa1bb84cf7 100644
--- a/drivers/gpu/drm/radeon/radeon_display.c
+++ b/drivers/gpu/drm/radeon/radeon_display.c
@@ -187,6 +187,7 @@ static void radeon_crtc_init(struct drm_device *dev, int index)
187 187
188 drm_mode_crtc_set_gamma_size(&radeon_crtc->base, 256); 188 drm_mode_crtc_set_gamma_size(&radeon_crtc->base, 256);
189 radeon_crtc->crtc_id = index; 189 radeon_crtc->crtc_id = index;
190 rdev->mode_info.crtcs[index] = radeon_crtc;
190 191
191 radeon_crtc->mode_set.crtc = &radeon_crtc->base; 192 radeon_crtc->mode_set.crtc = &radeon_crtc->base;
192 radeon_crtc->mode_set.connectors = (struct drm_connector **)(radeon_crtc + 1); 193 radeon_crtc->mode_set.connectors = (struct drm_connector **)(radeon_crtc + 1);
@@ -491,7 +492,11 @@ void radeon_compute_pll(struct radeon_pll *pll,
491 tmp += (uint64_t)pll->reference_freq * 1000 * frac_feedback_div; 492 tmp += (uint64_t)pll->reference_freq * 1000 * frac_feedback_div;
492 current_freq = radeon_div(tmp, ref_div * post_div); 493 current_freq = radeon_div(tmp, ref_div * post_div);
493 494
494 error = abs(current_freq - freq); 495 if (flags & RADEON_PLL_PREFER_CLOSEST_LOWER) {
496 error = freq - current_freq;
497 error = error < 0 ? 0xffffffff : error;
498 } else
499 error = abs(current_freq - freq);
495 vco_diff = abs(vco - best_vco); 500 vco_diff = abs(vco - best_vco);
496 501
497 if ((best_vco == 0 && error < best_error) || 502 if ((best_vco == 0 && error < best_error) ||
@@ -657,36 +662,51 @@ void radeon_modeset_fini(struct radeon_device *rdev)
657 } 662 }
658} 663}
659 664
660void radeon_init_disp_bandwidth(struct drm_device *dev) 665bool radeon_crtc_scaling_mode_fixup(struct drm_crtc *crtc,
666 struct drm_display_mode *mode,
667 struct drm_display_mode *adjusted_mode)
661{ 668{
662 struct radeon_device *rdev = dev->dev_private; 669 struct drm_device *dev = crtc->dev;
663 struct drm_display_mode *modes[2]; 670 struct drm_encoder *encoder;
664 int pixel_bytes[2]; 671 struct radeon_crtc *radeon_crtc = to_radeon_crtc(crtc);
665 struct drm_crtc *crtc; 672 struct radeon_encoder *radeon_encoder;
666 673 bool first = true;
667 pixel_bytes[0] = pixel_bytes[1] = 0;
668 modes[0] = modes[1] = NULL;
669
670 list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) {
671 struct radeon_crtc *radeon_crtc = to_radeon_crtc(crtc);
672 674
673 if (crtc->enabled && crtc->fb) { 675 list_for_each_entry(encoder, &dev->mode_config.encoder_list, head) {
674 modes[radeon_crtc->crtc_id] = &crtc->mode; 676 radeon_encoder = to_radeon_encoder(encoder);
675 pixel_bytes[radeon_crtc->crtc_id] = crtc->fb->bits_per_pixel / 8; 677 if (encoder->crtc != crtc)
678 continue;
679 if (first) {
680 radeon_crtc->rmx_type = radeon_encoder->rmx_type;
681 radeon_crtc->devices = radeon_encoder->devices;
682 memcpy(&radeon_crtc->native_mode,
683 &radeon_encoder->native_mode,
684 sizeof(struct radeon_native_mode));
685 first = false;
686 } else {
687 if (radeon_crtc->rmx_type != radeon_encoder->rmx_type) {
688 /* WARNING: Right now this can't happen but
689 * in the future we need to check that scaling
690 * are consistent accross different encoder
691 * (ie all encoder can work with the same
692 * scaling).
693 */
694 DRM_ERROR("Scaling not consistent accross encoder.\n");
695 return false;
696 }
676 } 697 }
677 } 698 }
678 699 if (radeon_crtc->rmx_type != RMX_OFF) {
679 if (ASIC_IS_AVIVO(rdev)) { 700 fixed20_12 a, b;
680 radeon_init_disp_bw_avivo(dev, 701 a.full = rfixed_const(crtc->mode.vdisplay);
681 modes[0], 702 b.full = rfixed_const(radeon_crtc->native_mode.panel_xres);
682 pixel_bytes[0], 703 radeon_crtc->vsc.full = rfixed_div(a, b);
683 modes[1], 704 a.full = rfixed_const(crtc->mode.hdisplay);
684 pixel_bytes[1]); 705 b.full = rfixed_const(radeon_crtc->native_mode.panel_yres);
706 radeon_crtc->hsc.full = rfixed_div(a, b);
685 } else { 707 } else {
686 radeon_init_disp_bw_legacy(dev, 708 radeon_crtc->vsc.full = rfixed_const(1);
687 modes[0], 709 radeon_crtc->hsc.full = rfixed_const(1);
688 pixel_bytes[0],
689 modes[1],
690 pixel_bytes[1]);
691 } 710 }
711 return true;
692} 712}
diff --git a/drivers/gpu/drm/radeon/radeon_drv.c b/drivers/gpu/drm/radeon/radeon_drv.c
index 09c9fb9f6210..0bd5879a4957 100644
--- a/drivers/gpu/drm/radeon/radeon_drv.c
+++ b/drivers/gpu/drm/radeon/radeon_drv.c
@@ -89,6 +89,7 @@ int radeon_agpmode = 0;
89int radeon_vram_limit = 0; 89int radeon_vram_limit = 0;
90int radeon_gart_size = 512; /* default gart size */ 90int radeon_gart_size = 512; /* default gart size */
91int radeon_benchmarking = 0; 91int radeon_benchmarking = 0;
92int radeon_testing = 0;
92int radeon_connector_table = 0; 93int radeon_connector_table = 0;
93#endif 94#endif
94 95
@@ -117,6 +118,9 @@ module_param_named(gartsize, radeon_gart_size, int, 0600);
117MODULE_PARM_DESC(benchmark, "Run benchmark"); 118MODULE_PARM_DESC(benchmark, "Run benchmark");
118module_param_named(benchmark, radeon_benchmarking, int, 0444); 119module_param_named(benchmark, radeon_benchmarking, int, 0444);
119 120
121MODULE_PARM_DESC(test, "Run tests");
122module_param_named(test, radeon_testing, int, 0444);
123
120MODULE_PARM_DESC(connector_table, "Force connector table"); 124MODULE_PARM_DESC(connector_table, "Force connector table");
121module_param_named(connector_table, radeon_connector_table, int, 0444); 125module_param_named(connector_table, radeon_connector_table, int, 0444);
122#endif 126#endif
@@ -314,6 +318,14 @@ static int __init radeon_init(void)
314 driver = &driver_old; 318 driver = &driver_old;
315 driver->num_ioctls = radeon_max_ioctl; 319 driver->num_ioctls = radeon_max_ioctl;
316#if defined(CONFIG_DRM_RADEON_KMS) 320#if defined(CONFIG_DRM_RADEON_KMS)
321#ifdef CONFIG_VGA_CONSOLE
322 if (vgacon_text_force() && radeon_modeset == -1) {
323 DRM_INFO("VGACON disable radeon kernel modesetting.\n");
324 driver = &driver_old;
325 driver->driver_features &= ~DRIVER_MODESET;
326 radeon_modeset = 0;
327 }
328#endif
317 /* if enabled by default */ 329 /* if enabled by default */
318 if (radeon_modeset == -1) { 330 if (radeon_modeset == -1) {
319 DRM_INFO("radeon default to kernel modesetting.\n"); 331 DRM_INFO("radeon default to kernel modesetting.\n");
@@ -325,17 +337,8 @@ static int __init radeon_init(void)
325 driver->driver_features |= DRIVER_MODESET; 337 driver->driver_features |= DRIVER_MODESET;
326 driver->num_ioctls = radeon_max_kms_ioctl; 338 driver->num_ioctls = radeon_max_kms_ioctl;
327 } 339 }
328
329 /* if the vga console setting is enabled still 340 /* if the vga console setting is enabled still
330 * let modprobe override it */ 341 * let modprobe override it */
331#ifdef CONFIG_VGA_CONSOLE
332 if (vgacon_text_force() && radeon_modeset == -1) {
333 DRM_INFO("VGACON disable radeon kernel modesetting.\n");
334 driver = &driver_old;
335 driver->driver_features &= ~DRIVER_MODESET;
336 radeon_modeset = 0;
337 }
338#endif
339#endif 342#endif
340 return drm_init(driver); 343 return drm_init(driver);
341} 344}
@@ -345,7 +348,7 @@ static void __exit radeon_exit(void)
345 drm_exit(driver); 348 drm_exit(driver);
346} 349}
347 350
348late_initcall(radeon_init); 351module_init(radeon_init);
349module_exit(radeon_exit); 352module_exit(radeon_exit);
350 353
351MODULE_AUTHOR(DRIVER_AUTHOR); 354MODULE_AUTHOR(DRIVER_AUTHOR);
diff --git a/drivers/gpu/drm/radeon/radeon_drv.h b/drivers/gpu/drm/radeon/radeon_drv.h
index 127d0456f628..3933f8216a34 100644
--- a/drivers/gpu/drm/radeon/radeon_drv.h
+++ b/drivers/gpu/drm/radeon/radeon_drv.h
@@ -143,6 +143,7 @@ enum radeon_family {
143 CHIP_RV635, 143 CHIP_RV635,
144 CHIP_RV670, 144 CHIP_RV670,
145 CHIP_RS780, 145 CHIP_RS780,
146 CHIP_RS880,
146 CHIP_RV770, 147 CHIP_RV770,
147 CHIP_RV730, 148 CHIP_RV730,
148 CHIP_RV710, 149 CHIP_RV710,
diff --git a/drivers/gpu/drm/radeon/radeon_encoders.c b/drivers/gpu/drm/radeon/radeon_encoders.c
index c8ef0d14ffab..0a92706eac19 100644
--- a/drivers/gpu/drm/radeon/radeon_encoders.c
+++ b/drivers/gpu/drm/radeon/radeon_encoders.c
@@ -154,7 +154,6 @@ void radeon_rmx_mode_fixup(struct drm_encoder *encoder,
154 154
155 if (mode->hdisplay < native_mode->panel_xres || 155 if (mode->hdisplay < native_mode->panel_xres ||
156 mode->vdisplay < native_mode->panel_yres) { 156 mode->vdisplay < native_mode->panel_yres) {
157 radeon_encoder->flags |= RADEON_USE_RMX;
158 if (ASIC_IS_AVIVO(rdev)) { 157 if (ASIC_IS_AVIVO(rdev)) {
159 adjusted_mode->hdisplay = native_mode->panel_xres; 158 adjusted_mode->hdisplay = native_mode->panel_xres;
160 adjusted_mode->vdisplay = native_mode->panel_yres; 159 adjusted_mode->vdisplay = native_mode->panel_yres;
@@ -197,15 +196,13 @@ void radeon_rmx_mode_fixup(struct drm_encoder *encoder,
197 } 196 }
198} 197}
199 198
199
200static bool radeon_atom_mode_fixup(struct drm_encoder *encoder, 200static bool radeon_atom_mode_fixup(struct drm_encoder *encoder,
201 struct drm_display_mode *mode, 201 struct drm_display_mode *mode,
202 struct drm_display_mode *adjusted_mode) 202 struct drm_display_mode *adjusted_mode)
203{ 203{
204
205 struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder); 204 struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder);
206 205
207 radeon_encoder->flags &= ~RADEON_USE_RMX;
208
209 drm_mode_set_crtcinfo(adjusted_mode, 0); 206 drm_mode_set_crtcinfo(adjusted_mode, 0);
210 207
211 if (radeon_encoder->rmx_type != RMX_OFF) 208 if (radeon_encoder->rmx_type != RMX_OFF)
@@ -808,234 +805,6 @@ atombios_dig_transmitter_setup(struct drm_encoder *encoder, int action)
808 805
809} 806}
810 807
811static void atom_rv515_force_tv_scaler(struct radeon_device *rdev)
812{
813
814 WREG32(0x659C, 0x0);
815 WREG32(0x6594, 0x705);
816 WREG32(0x65A4, 0x10001);
817 WREG32(0x65D8, 0x0);
818 WREG32(0x65B0, 0x0);
819 WREG32(0x65C0, 0x0);
820 WREG32(0x65D4, 0x0);
821 WREG32(0x6578, 0x0);
822 WREG32(0x657C, 0x841880A8);
823 WREG32(0x6578, 0x1);
824 WREG32(0x657C, 0x84208680);
825 WREG32(0x6578, 0x2);
826 WREG32(0x657C, 0xBFF880B0);
827 WREG32(0x6578, 0x100);
828 WREG32(0x657C, 0x83D88088);
829 WREG32(0x6578, 0x101);
830 WREG32(0x657C, 0x84608680);
831 WREG32(0x6578, 0x102);
832 WREG32(0x657C, 0xBFF080D0);
833 WREG32(0x6578, 0x200);
834 WREG32(0x657C, 0x83988068);
835 WREG32(0x6578, 0x201);
836 WREG32(0x657C, 0x84A08680);
837 WREG32(0x6578, 0x202);
838 WREG32(0x657C, 0xBFF080F8);
839 WREG32(0x6578, 0x300);
840 WREG32(0x657C, 0x83588058);
841 WREG32(0x6578, 0x301);
842 WREG32(0x657C, 0x84E08660);
843 WREG32(0x6578, 0x302);
844 WREG32(0x657C, 0xBFF88120);
845 WREG32(0x6578, 0x400);
846 WREG32(0x657C, 0x83188040);
847 WREG32(0x6578, 0x401);
848 WREG32(0x657C, 0x85008660);
849 WREG32(0x6578, 0x402);
850 WREG32(0x657C, 0xBFF88150);
851 WREG32(0x6578, 0x500);
852 WREG32(0x657C, 0x82D88030);
853 WREG32(0x6578, 0x501);
854 WREG32(0x657C, 0x85408640);
855 WREG32(0x6578, 0x502);
856 WREG32(0x657C, 0xBFF88180);
857 WREG32(0x6578, 0x600);
858 WREG32(0x657C, 0x82A08018);
859 WREG32(0x6578, 0x601);
860 WREG32(0x657C, 0x85808620);
861 WREG32(0x6578, 0x602);
862 WREG32(0x657C, 0xBFF081B8);
863 WREG32(0x6578, 0x700);
864 WREG32(0x657C, 0x82608010);
865 WREG32(0x6578, 0x701);
866 WREG32(0x657C, 0x85A08600);
867 WREG32(0x6578, 0x702);
868 WREG32(0x657C, 0x800081F0);
869 WREG32(0x6578, 0x800);
870 WREG32(0x657C, 0x8228BFF8);
871 WREG32(0x6578, 0x801);
872 WREG32(0x657C, 0x85E085E0);
873 WREG32(0x6578, 0x802);
874 WREG32(0x657C, 0xBFF88228);
875 WREG32(0x6578, 0x10000);
876 WREG32(0x657C, 0x82A8BF00);
877 WREG32(0x6578, 0x10001);
878 WREG32(0x657C, 0x82A08CC0);
879 WREG32(0x6578, 0x10002);
880 WREG32(0x657C, 0x8008BEF8);
881 WREG32(0x6578, 0x10100);
882 WREG32(0x657C, 0x81F0BF28);
883 WREG32(0x6578, 0x10101);
884 WREG32(0x657C, 0x83608CA0);
885 WREG32(0x6578, 0x10102);
886 WREG32(0x657C, 0x8018BED0);
887 WREG32(0x6578, 0x10200);
888 WREG32(0x657C, 0x8148BF38);
889 WREG32(0x6578, 0x10201);
890 WREG32(0x657C, 0x84408C80);
891 WREG32(0x6578, 0x10202);
892 WREG32(0x657C, 0x8008BEB8);
893 WREG32(0x6578, 0x10300);
894 WREG32(0x657C, 0x80B0BF78);
895 WREG32(0x6578, 0x10301);
896 WREG32(0x657C, 0x85008C20);
897 WREG32(0x6578, 0x10302);
898 WREG32(0x657C, 0x8020BEA0);
899 WREG32(0x6578, 0x10400);
900 WREG32(0x657C, 0x8028BF90);
901 WREG32(0x6578, 0x10401);
902 WREG32(0x657C, 0x85E08BC0);
903 WREG32(0x6578, 0x10402);
904 WREG32(0x657C, 0x8018BE90);
905 WREG32(0x6578, 0x10500);
906 WREG32(0x657C, 0xBFB8BFB0);
907 WREG32(0x6578, 0x10501);
908 WREG32(0x657C, 0x86C08B40);
909 WREG32(0x6578, 0x10502);
910 WREG32(0x657C, 0x8010BE90);
911 WREG32(0x6578, 0x10600);
912 WREG32(0x657C, 0xBF58BFC8);
913 WREG32(0x6578, 0x10601);
914 WREG32(0x657C, 0x87A08AA0);
915 WREG32(0x6578, 0x10602);
916 WREG32(0x657C, 0x8010BE98);
917 WREG32(0x6578, 0x10700);
918 WREG32(0x657C, 0xBF10BFF0);
919 WREG32(0x6578, 0x10701);
920 WREG32(0x657C, 0x886089E0);
921 WREG32(0x6578, 0x10702);
922 WREG32(0x657C, 0x8018BEB0);
923 WREG32(0x6578, 0x10800);
924 WREG32(0x657C, 0xBED8BFE8);
925 WREG32(0x6578, 0x10801);
926 WREG32(0x657C, 0x89408940);
927 WREG32(0x6578, 0x10802);
928 WREG32(0x657C, 0xBFE8BED8);
929 WREG32(0x6578, 0x20000);
930 WREG32(0x657C, 0x80008000);
931 WREG32(0x6578, 0x20001);
932 WREG32(0x657C, 0x90008000);
933 WREG32(0x6578, 0x20002);
934 WREG32(0x657C, 0x80008000);
935 WREG32(0x6578, 0x20003);
936 WREG32(0x657C, 0x80008000);
937 WREG32(0x6578, 0x20100);
938 WREG32(0x657C, 0x80108000);
939 WREG32(0x6578, 0x20101);
940 WREG32(0x657C, 0x8FE0BF70);
941 WREG32(0x6578, 0x20102);
942 WREG32(0x657C, 0xBFE880C0);
943 WREG32(0x6578, 0x20103);
944 WREG32(0x657C, 0x80008000);
945 WREG32(0x6578, 0x20200);
946 WREG32(0x657C, 0x8018BFF8);
947 WREG32(0x6578, 0x20201);
948 WREG32(0x657C, 0x8F80BF08);
949 WREG32(0x6578, 0x20202);
950 WREG32(0x657C, 0xBFD081A0);
951 WREG32(0x6578, 0x20203);
952 WREG32(0x657C, 0xBFF88000);
953 WREG32(0x6578, 0x20300);
954 WREG32(0x657C, 0x80188000);
955 WREG32(0x6578, 0x20301);
956 WREG32(0x657C, 0x8EE0BEC0);
957 WREG32(0x6578, 0x20302);
958 WREG32(0x657C, 0xBFB082A0);
959 WREG32(0x6578, 0x20303);
960 WREG32(0x657C, 0x80008000);
961 WREG32(0x6578, 0x20400);
962 WREG32(0x657C, 0x80188000);
963 WREG32(0x6578, 0x20401);
964 WREG32(0x657C, 0x8E00BEA0);
965 WREG32(0x6578, 0x20402);
966 WREG32(0x657C, 0xBF8883C0);
967 WREG32(0x6578, 0x20403);
968 WREG32(0x657C, 0x80008000);
969 WREG32(0x6578, 0x20500);
970 WREG32(0x657C, 0x80188000);
971 WREG32(0x6578, 0x20501);
972 WREG32(0x657C, 0x8D00BE90);
973 WREG32(0x6578, 0x20502);
974 WREG32(0x657C, 0xBF588500);
975 WREG32(0x6578, 0x20503);
976 WREG32(0x657C, 0x80008008);
977 WREG32(0x6578, 0x20600);
978 WREG32(0x657C, 0x80188000);
979 WREG32(0x6578, 0x20601);
980 WREG32(0x657C, 0x8BC0BE98);
981 WREG32(0x6578, 0x20602);
982 WREG32(0x657C, 0xBF308660);
983 WREG32(0x6578, 0x20603);
984 WREG32(0x657C, 0x80008008);
985 WREG32(0x6578, 0x20700);
986 WREG32(0x657C, 0x80108000);
987 WREG32(0x6578, 0x20701);
988 WREG32(0x657C, 0x8A80BEB0);
989 WREG32(0x6578, 0x20702);
990 WREG32(0x657C, 0xBF0087C0);
991 WREG32(0x6578, 0x20703);
992 WREG32(0x657C, 0x80008008);
993 WREG32(0x6578, 0x20800);
994 WREG32(0x657C, 0x80108000);
995 WREG32(0x6578, 0x20801);
996 WREG32(0x657C, 0x8920BED0);
997 WREG32(0x6578, 0x20802);
998 WREG32(0x657C, 0xBED08920);
999 WREG32(0x6578, 0x20803);
1000 WREG32(0x657C, 0x80008010);
1001 WREG32(0x6578, 0x30000);
1002 WREG32(0x657C, 0x90008000);
1003 WREG32(0x6578, 0x30001);
1004 WREG32(0x657C, 0x80008000);
1005 WREG32(0x6578, 0x30100);
1006 WREG32(0x657C, 0x8FE0BF90);
1007 WREG32(0x6578, 0x30101);
1008 WREG32(0x657C, 0xBFF880A0);
1009 WREG32(0x6578, 0x30200);
1010 WREG32(0x657C, 0x8F60BF40);
1011 WREG32(0x6578, 0x30201);
1012 WREG32(0x657C, 0xBFE88180);
1013 WREG32(0x6578, 0x30300);
1014 WREG32(0x657C, 0x8EC0BF00);
1015 WREG32(0x6578, 0x30301);
1016 WREG32(0x657C, 0xBFC88280);
1017 WREG32(0x6578, 0x30400);
1018 WREG32(0x657C, 0x8DE0BEE0);
1019 WREG32(0x6578, 0x30401);
1020 WREG32(0x657C, 0xBFA083A0);
1021 WREG32(0x6578, 0x30500);
1022 WREG32(0x657C, 0x8CE0BED0);
1023 WREG32(0x6578, 0x30501);
1024 WREG32(0x657C, 0xBF7884E0);
1025 WREG32(0x6578, 0x30600);
1026 WREG32(0x657C, 0x8BA0BED8);
1027 WREG32(0x6578, 0x30601);
1028 WREG32(0x657C, 0xBF508640);
1029 WREG32(0x6578, 0x30700);
1030 WREG32(0x657C, 0x8A60BEE8);
1031 WREG32(0x6578, 0x30701);
1032 WREG32(0x657C, 0xBF2087A0);
1033 WREG32(0x6578, 0x30800);
1034 WREG32(0x657C, 0x8900BF00);
1035 WREG32(0x6578, 0x30801);
1036 WREG32(0x657C, 0xBF008900);
1037}
1038
1039static void 808static void
1040atombios_yuv_setup(struct drm_encoder *encoder, bool enable) 809atombios_yuv_setup(struct drm_encoder *encoder, bool enable)
1041{ 810{
@@ -1074,129 +843,6 @@ atombios_yuv_setup(struct drm_encoder *encoder, bool enable)
1074} 843}
1075 844
1076static void 845static void
1077atombios_overscan_setup(struct drm_encoder *encoder,
1078 struct drm_display_mode *mode,
1079 struct drm_display_mode *adjusted_mode)
1080{
1081 struct drm_device *dev = encoder->dev;
1082 struct radeon_device *rdev = dev->dev_private;
1083 struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder);
1084 struct radeon_crtc *radeon_crtc = to_radeon_crtc(encoder->crtc);
1085 SET_CRTC_OVERSCAN_PS_ALLOCATION args;
1086 int index = GetIndexIntoMasterTable(COMMAND, SetCRTC_OverScan);
1087
1088 memset(&args, 0, sizeof(args));
1089
1090 args.usOverscanRight = 0;
1091 args.usOverscanLeft = 0;
1092 args.usOverscanBottom = 0;
1093 args.usOverscanTop = 0;
1094 args.ucCRTC = radeon_crtc->crtc_id;
1095
1096 if (radeon_encoder->flags & RADEON_USE_RMX) {
1097 if (radeon_encoder->rmx_type == RMX_FULL) {
1098 args.usOverscanRight = 0;
1099 args.usOverscanLeft = 0;
1100 args.usOverscanBottom = 0;
1101 args.usOverscanTop = 0;
1102 } else if (radeon_encoder->rmx_type == RMX_CENTER) {
1103 args.usOverscanTop = (adjusted_mode->crtc_vdisplay - mode->crtc_vdisplay) / 2;
1104 args.usOverscanBottom = (adjusted_mode->crtc_vdisplay - mode->crtc_vdisplay) / 2;
1105 args.usOverscanLeft = (adjusted_mode->crtc_hdisplay - mode->crtc_hdisplay) / 2;
1106 args.usOverscanRight = (adjusted_mode->crtc_hdisplay - mode->crtc_hdisplay) / 2;
1107 } else if (radeon_encoder->rmx_type == RMX_ASPECT) {
1108 int a1 = mode->crtc_vdisplay * adjusted_mode->crtc_hdisplay;
1109 int a2 = adjusted_mode->crtc_vdisplay * mode->crtc_hdisplay;
1110
1111 if (a1 > a2) {
1112 args.usOverscanLeft = (adjusted_mode->crtc_hdisplay - (a2 / mode->crtc_vdisplay)) / 2;
1113 args.usOverscanRight = (adjusted_mode->crtc_hdisplay - (a2 / mode->crtc_vdisplay)) / 2;
1114 } else if (a2 > a1) {
1115 args.usOverscanLeft = (adjusted_mode->crtc_vdisplay - (a1 / mode->crtc_hdisplay)) / 2;
1116 args.usOverscanRight = (adjusted_mode->crtc_vdisplay - (a1 / mode->crtc_hdisplay)) / 2;
1117 }
1118 }
1119 }
1120
1121 atom_execute_table(rdev->mode_info.atom_context, index, (uint32_t *)&args);
1122
1123}
1124
1125static void
1126atombios_scaler_setup(struct drm_encoder *encoder)
1127{
1128 struct drm_device *dev = encoder->dev;
1129 struct radeon_device *rdev = dev->dev_private;
1130 struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder);
1131 struct radeon_crtc *radeon_crtc = to_radeon_crtc(encoder->crtc);
1132 ENABLE_SCALER_PS_ALLOCATION args;
1133 int index = GetIndexIntoMasterTable(COMMAND, EnableScaler);
1134 /* fixme - fill in enc_priv for atom dac */
1135 enum radeon_tv_std tv_std = TV_STD_NTSC;
1136
1137 if (!ASIC_IS_AVIVO(rdev) && radeon_crtc->crtc_id)
1138 return;
1139
1140 memset(&args, 0, sizeof(args));
1141
1142 args.ucScaler = radeon_crtc->crtc_id;
1143
1144 if (radeon_encoder->devices & (ATOM_DEVICE_TV_SUPPORT)) {
1145 switch (tv_std) {
1146 case TV_STD_NTSC:
1147 default:
1148 args.ucTVStandard = ATOM_TV_NTSC;
1149 break;
1150 case TV_STD_PAL:
1151 args.ucTVStandard = ATOM_TV_PAL;
1152 break;
1153 case TV_STD_PAL_M:
1154 args.ucTVStandard = ATOM_TV_PALM;
1155 break;
1156 case TV_STD_PAL_60:
1157 args.ucTVStandard = ATOM_TV_PAL60;
1158 break;
1159 case TV_STD_NTSC_J:
1160 args.ucTVStandard = ATOM_TV_NTSCJ;
1161 break;
1162 case TV_STD_SCART_PAL:
1163 args.ucTVStandard = ATOM_TV_PAL; /* ??? */
1164 break;
1165 case TV_STD_SECAM:
1166 args.ucTVStandard = ATOM_TV_SECAM;
1167 break;
1168 case TV_STD_PAL_CN:
1169 args.ucTVStandard = ATOM_TV_PALCN;
1170 break;
1171 }
1172 args.ucEnable = SCALER_ENABLE_MULTITAP_MODE;
1173 } else if (radeon_encoder->devices & (ATOM_DEVICE_CV_SUPPORT)) {
1174 args.ucTVStandard = ATOM_TV_CV;
1175 args.ucEnable = SCALER_ENABLE_MULTITAP_MODE;
1176 } else if (radeon_encoder->flags & RADEON_USE_RMX) {
1177 if (radeon_encoder->rmx_type == RMX_FULL)
1178 args.ucEnable = ATOM_SCALER_EXPANSION;
1179 else if (radeon_encoder->rmx_type == RMX_CENTER)
1180 args.ucEnable = ATOM_SCALER_CENTER;
1181 else if (radeon_encoder->rmx_type == RMX_ASPECT)
1182 args.ucEnable = ATOM_SCALER_EXPANSION;
1183 } else {
1184 if (ASIC_IS_AVIVO(rdev))
1185 args.ucEnable = ATOM_SCALER_DISABLE;
1186 else
1187 args.ucEnable = ATOM_SCALER_CENTER;
1188 }
1189
1190 atom_execute_table(rdev->mode_info.atom_context, index, (uint32_t *)&args);
1191
1192 if (radeon_encoder->devices & (ATOM_DEVICE_CV_SUPPORT | ATOM_DEVICE_TV_SUPPORT)
1193 && rdev->family >= CHIP_RV515 && rdev->family <= CHIP_RV570) {
1194 atom_rv515_force_tv_scaler(rdev);
1195 }
1196
1197}
1198
1199static void
1200radeon_atom_encoder_dpms(struct drm_encoder *encoder, int mode) 846radeon_atom_encoder_dpms(struct drm_encoder *encoder, int mode)
1201{ 847{
1202 struct drm_device *dev = encoder->dev; 848 struct drm_device *dev = encoder->dev;
@@ -1448,8 +1094,6 @@ radeon_atom_encoder_mode_set(struct drm_encoder *encoder,
1448 radeon_encoder->pixel_clock = adjusted_mode->clock; 1094 radeon_encoder->pixel_clock = adjusted_mode->clock;
1449 1095
1450 radeon_atombios_encoder_crtc_scratch_regs(encoder, radeon_crtc->crtc_id); 1096 radeon_atombios_encoder_crtc_scratch_regs(encoder, radeon_crtc->crtc_id);
1451 atombios_overscan_setup(encoder, mode, adjusted_mode);
1452 atombios_scaler_setup(encoder);
1453 atombios_set_encoder_crtc_source(encoder); 1097 atombios_set_encoder_crtc_source(encoder);
1454 1098
1455 if (ASIC_IS_AVIVO(rdev)) { 1099 if (ASIC_IS_AVIVO(rdev)) {
@@ -1667,6 +1311,7 @@ radeon_add_atom_encoder(struct drm_device *dev, uint32_t encoder_id, uint32_t su
1667 1311
1668 radeon_encoder->encoder_id = encoder_id; 1312 radeon_encoder->encoder_id = encoder_id;
1669 radeon_encoder->devices = supported_device; 1313 radeon_encoder->devices = supported_device;
1314 radeon_encoder->rmx_type = RMX_OFF;
1670 1315
1671 switch (radeon_encoder->encoder_id) { 1316 switch (radeon_encoder->encoder_id) {
1672 case ENCODER_OBJECT_ID_INTERNAL_LVDS: 1317 case ENCODER_OBJECT_ID_INTERNAL_LVDS:
diff --git a/drivers/gpu/drm/radeon/radeon_fb.c b/drivers/gpu/drm/radeon/radeon_fb.c
index fa86d398945e..3206c0ad7b6c 100644
--- a/drivers/gpu/drm/radeon/radeon_fb.c
+++ b/drivers/gpu/drm/radeon/radeon_fb.c
@@ -101,9 +101,10 @@ static int radeonfb_setcolreg(unsigned regno,
101 break; 101 break;
102 case 24: 102 case 24:
103 case 32: 103 case 32:
104 fb->pseudo_palette[regno] = ((red & 0xff00) << 8) | 104 fb->pseudo_palette[regno] =
105 (green & 0xff00) | 105 (((red >> 8) & 0xff) << info->var.red.offset) |
106 ((blue & 0xff00) >> 8); 106 (((green >> 8) & 0xff) << info->var.green.offset) |
107 (((blue >> 8) & 0xff) << info->var.blue.offset);
107 break; 108 break;
108 } 109 }
109 } 110 }
@@ -154,6 +155,7 @@ static int radeonfb_check_var(struct fb_var_screeninfo *var,
154 var->transp.length = 0; 155 var->transp.length = 0;
155 var->transp.offset = 0; 156 var->transp.offset = 0;
156 break; 157 break;
158#ifdef __LITTLE_ENDIAN
157 case 15: 159 case 15:
158 var->red.offset = 10; 160 var->red.offset = 10;
159 var->green.offset = 5; 161 var->green.offset = 5;
@@ -194,6 +196,28 @@ static int radeonfb_check_var(struct fb_var_screeninfo *var,
194 var->transp.length = 8; 196 var->transp.length = 8;
195 var->transp.offset = 24; 197 var->transp.offset = 24;
196 break; 198 break;
199#else
200 case 24:
201 var->red.offset = 8;
202 var->green.offset = 16;
203 var->blue.offset = 24;
204 var->red.length = 8;
205 var->green.length = 8;
206 var->blue.length = 8;
207 var->transp.length = 0;
208 var->transp.offset = 0;
209 break;
210 case 32:
211 var->red.offset = 8;
212 var->green.offset = 16;
213 var->blue.offset = 24;
214 var->red.length = 8;
215 var->green.length = 8;
216 var->blue.length = 8;
217 var->transp.length = 8;
218 var->transp.offset = 0;
219 break;
220#endif
197 default: 221 default:
198 return -EINVAL; 222 return -EINVAL;
199 } 223 }
@@ -447,10 +471,10 @@ static struct notifier_block paniced = {
447 .notifier_call = radeonfb_panic, 471 .notifier_call = radeonfb_panic,
448}; 472};
449 473
450static int radeon_align_pitch(struct radeon_device *rdev, int width, int bpp) 474static int radeon_align_pitch(struct radeon_device *rdev, int width, int bpp, bool tiled)
451{ 475{
452 int aligned = width; 476 int aligned = width;
453 int align_large = (ASIC_IS_AVIVO(rdev)); 477 int align_large = (ASIC_IS_AVIVO(rdev)) || tiled;
454 int pitch_mask = 0; 478 int pitch_mask = 0;
455 479
456 switch (bpp / 8) { 480 switch (bpp / 8) {
@@ -478,36 +502,42 @@ int radeonfb_create(struct radeon_device *rdev,
478{ 502{
479 struct fb_info *info; 503 struct fb_info *info;
480 struct radeon_fb_device *rfbdev; 504 struct radeon_fb_device *rfbdev;
481 struct drm_framebuffer *fb; 505 struct drm_framebuffer *fb = NULL;
482 struct radeon_framebuffer *rfb; 506 struct radeon_framebuffer *rfb;
483 struct drm_mode_fb_cmd mode_cmd; 507 struct drm_mode_fb_cmd mode_cmd;
484 struct drm_gem_object *gobj = NULL; 508 struct drm_gem_object *gobj = NULL;
485 struct radeon_object *robj = NULL; 509 struct radeon_object *robj = NULL;
486 struct device *device = &rdev->pdev->dev; 510 struct device *device = &rdev->pdev->dev;
487 int size, aligned_size, ret; 511 int size, aligned_size, ret;
512 u64 fb_gpuaddr;
488 void *fbptr = NULL; 513 void *fbptr = NULL;
514 unsigned long tmp;
515 bool fb_tiled = false; /* useful for testing */
489 516
490 mode_cmd.width = surface_width; 517 mode_cmd.width = surface_width;
491 mode_cmd.height = surface_height; 518 mode_cmd.height = surface_height;
492 mode_cmd.bpp = 32; 519 mode_cmd.bpp = 32;
493 /* need to align pitch with crtc limits */ 520 /* need to align pitch with crtc limits */
494 mode_cmd.pitch = radeon_align_pitch(rdev, mode_cmd.width, mode_cmd.bpp) * ((mode_cmd.bpp + 1) / 8); 521 mode_cmd.pitch = radeon_align_pitch(rdev, mode_cmd.width, mode_cmd.bpp, fb_tiled) * ((mode_cmd.bpp + 1) / 8);
495 mode_cmd.depth = 24; 522 mode_cmd.depth = 24;
496 523
497 size = mode_cmd.pitch * mode_cmd.height; 524 size = mode_cmd.pitch * mode_cmd.height;
498 aligned_size = ALIGN(size, PAGE_SIZE); 525 aligned_size = ALIGN(size, PAGE_SIZE);
499 526
500 ret = radeon_gem_object_create(rdev, aligned_size, 0, 527 ret = radeon_gem_object_create(rdev, aligned_size, 0,
501 RADEON_GEM_DOMAIN_VRAM, 528 RADEON_GEM_DOMAIN_VRAM,
502 false, ttm_bo_type_kernel, 529 false, ttm_bo_type_kernel,
503 false, &gobj); 530 false, &gobj);
504 if (ret) { 531 if (ret) {
505 printk(KERN_ERR "failed to allocate framebuffer\n"); 532 printk(KERN_ERR "failed to allocate framebuffer (%d %d)\n",
533 surface_width, surface_height);
506 ret = -ENOMEM; 534 ret = -ENOMEM;
507 goto out; 535 goto out;
508 } 536 }
509 robj = gobj->driver_private; 537 robj = gobj->driver_private;
510 538
539 if (fb_tiled)
540 radeon_object_set_tiling_flags(robj, RADEON_TILING_MACRO|RADEON_TILING_SURFACE, mode_cmd.pitch);
511 mutex_lock(&rdev->ddev->struct_mutex); 541 mutex_lock(&rdev->ddev->struct_mutex);
512 fb = radeon_framebuffer_create(rdev->ddev, &mode_cmd, gobj); 542 fb = radeon_framebuffer_create(rdev->ddev, &mode_cmd, gobj);
513 if (fb == NULL) { 543 if (fb == NULL) {
@@ -515,12 +545,19 @@ int radeonfb_create(struct radeon_device *rdev,
515 ret = -ENOMEM; 545 ret = -ENOMEM;
516 goto out_unref; 546 goto out_unref;
517 } 547 }
548 ret = radeon_object_pin(robj, RADEON_GEM_DOMAIN_VRAM, &fb_gpuaddr);
549 if (ret) {
550 printk(KERN_ERR "failed to pin framebuffer\n");
551 ret = -ENOMEM;
552 goto out_unref;
553 }
518 554
519 list_add(&fb->filp_head, &rdev->ddev->mode_config.fb_kernel_list); 555 list_add(&fb->filp_head, &rdev->ddev->mode_config.fb_kernel_list);
520 556
521 rfb = to_radeon_framebuffer(fb); 557 rfb = to_radeon_framebuffer(fb);
522 *rfb_p = rfb; 558 *rfb_p = rfb;
523 rdev->fbdev_rfb = rfb; 559 rdev->fbdev_rfb = rfb;
560 rdev->fbdev_robj = robj;
524 561
525 info = framebuffer_alloc(sizeof(struct radeon_fb_device), device); 562 info = framebuffer_alloc(sizeof(struct radeon_fb_device), device);
526 if (info == NULL) { 563 if (info == NULL) {
@@ -529,6 +566,9 @@ int radeonfb_create(struct radeon_device *rdev,
529 } 566 }
530 rfbdev = info->par; 567 rfbdev = info->par;
531 568
569 if (fb_tiled)
570 radeon_object_check_tiling(robj, 0, 0);
571
532 ret = radeon_object_kmap(robj, &fbptr); 572 ret = radeon_object_kmap(robj, &fbptr);
533 if (ret) { 573 if (ret) {
534 goto out_unref; 574 goto out_unref;
@@ -541,13 +581,13 @@ int radeonfb_create(struct radeon_device *rdev,
541 info->fix.xpanstep = 1; /* doing it in hw */ 581 info->fix.xpanstep = 1; /* doing it in hw */
542 info->fix.ypanstep = 1; /* doing it in hw */ 582 info->fix.ypanstep = 1; /* doing it in hw */
543 info->fix.ywrapstep = 0; 583 info->fix.ywrapstep = 0;
544 info->fix.accel = FB_ACCEL_I830; 584 info->fix.accel = FB_ACCEL_NONE;
545 info->fix.type_aux = 0; 585 info->fix.type_aux = 0;
546 info->flags = FBINFO_DEFAULT; 586 info->flags = FBINFO_DEFAULT;
547 info->fbops = &radeonfb_ops; 587 info->fbops = &radeonfb_ops;
548 info->fix.line_length = fb->pitch; 588 info->fix.line_length = fb->pitch;
549 info->screen_base = fbptr; 589 tmp = fb_gpuaddr - rdev->mc.vram_location;
550 info->fix.smem_start = (unsigned long)fbptr; 590 info->fix.smem_start = rdev->mc.aper_base + tmp;
551 info->fix.smem_len = size; 591 info->fix.smem_len = size;
552 info->screen_base = fbptr; 592 info->screen_base = fbptr;
553 info->screen_size = size; 593 info->screen_size = size;
@@ -562,8 +602,13 @@ int radeonfb_create(struct radeon_device *rdev,
562 info->var.width = -1; 602 info->var.width = -1;
563 info->var.xres = fb_width; 603 info->var.xres = fb_width;
564 info->var.yres = fb_height; 604 info->var.yres = fb_height;
565 info->fix.mmio_start = pci_resource_start(rdev->pdev, 2); 605
566 info->fix.mmio_len = pci_resource_len(rdev->pdev, 2); 606 /* setup aperture base/size for vesafb takeover */
607 info->aperture_base = rdev->ddev->mode_config.fb_base;
608 info->aperture_size = rdev->mc.real_vram_size;
609
610 info->fix.mmio_start = 0;
611 info->fix.mmio_len = 0;
567 info->pixmap.size = 64*1024; 612 info->pixmap.size = 64*1024;
568 info->pixmap.buf_align = 8; 613 info->pixmap.buf_align = 8;
569 info->pixmap.access_align = 32; 614 info->pixmap.access_align = 32;
@@ -590,6 +635,7 @@ int radeonfb_create(struct radeon_device *rdev,
590 info->var.transp.offset = 0; 635 info->var.transp.offset = 0;
591 info->var.transp.length = 0; 636 info->var.transp.length = 0;
592 break; 637 break;
638#ifdef __LITTLE_ENDIAN
593 case 15: 639 case 15:
594 info->var.red.offset = 10; 640 info->var.red.offset = 10;
595 info->var.green.offset = 5; 641 info->var.green.offset = 5;
@@ -629,7 +675,29 @@ int radeonfb_create(struct radeon_device *rdev,
629 info->var.transp.offset = 24; 675 info->var.transp.offset = 24;
630 info->var.transp.length = 8; 676 info->var.transp.length = 8;
631 break; 677 break;
678#else
679 case 24:
680 info->var.red.offset = 8;
681 info->var.green.offset = 16;
682 info->var.blue.offset = 24;
683 info->var.red.length = 8;
684 info->var.green.length = 8;
685 info->var.blue.length = 8;
686 info->var.transp.offset = 0;
687 info->var.transp.length = 0;
688 break;
689 case 32:
690 info->var.red.offset = 8;
691 info->var.green.offset = 16;
692 info->var.blue.offset = 24;
693 info->var.red.length = 8;
694 info->var.green.length = 8;
695 info->var.blue.length = 8;
696 info->var.transp.offset = 0;
697 info->var.transp.length = 8;
698 break;
632 default: 699 default:
700#endif
633 break; 701 break;
634 } 702 }
635 703
@@ -644,7 +712,7 @@ out_unref:
644 if (robj) { 712 if (robj) {
645 radeon_object_kunmap(robj); 713 radeon_object_kunmap(robj);
646 } 714 }
647 if (ret) { 715 if (fb && ret) {
648 list_del(&fb->filp_head); 716 list_del(&fb->filp_head);
649 drm_gem_object_unreference(gobj); 717 drm_gem_object_unreference(gobj);
650 drm_framebuffer_cleanup(fb); 718 drm_framebuffer_cleanup(fb);
@@ -813,6 +881,7 @@ int radeonfb_remove(struct drm_device *dev, struct drm_framebuffer *fb)
813 robj = rfb->obj->driver_private; 881 robj = rfb->obj->driver_private;
814 unregister_framebuffer(info); 882 unregister_framebuffer(info);
815 radeon_object_kunmap(robj); 883 radeon_object_kunmap(robj);
884 radeon_object_unpin(robj);
816 framebuffer_release(info); 885 framebuffer_release(info);
817 } 886 }
818 887
diff --git a/drivers/gpu/drm/radeon/radeon_fence.c b/drivers/gpu/drm/radeon/radeon_fence.c
index 96afbf5ae2ad..b4e48dd2e859 100644
--- a/drivers/gpu/drm/radeon/radeon_fence.c
+++ b/drivers/gpu/drm/radeon/radeon_fence.c
@@ -195,7 +195,7 @@ retry:
195 r = wait_event_interruptible_timeout(rdev->fence_drv.queue, 195 r = wait_event_interruptible_timeout(rdev->fence_drv.queue,
196 radeon_fence_signaled(fence), timeout); 196 radeon_fence_signaled(fence), timeout);
197 if (unlikely(r == -ERESTARTSYS)) { 197 if (unlikely(r == -ERESTARTSYS)) {
198 return -ERESTART; 198 return -EBUSY;
199 } 199 }
200 } else { 200 } else {
201 r = wait_event_timeout(rdev->fence_drv.queue, 201 r = wait_event_timeout(rdev->fence_drv.queue,
diff --git a/drivers/gpu/drm/radeon/radeon_gart.c b/drivers/gpu/drm/radeon/radeon_gart.c
index d343a15316ec..2977539880fb 100644
--- a/drivers/gpu/drm/radeon/radeon_gart.c
+++ b/drivers/gpu/drm/radeon/radeon_gart.c
@@ -177,7 +177,7 @@ int radeon_gart_bind(struct radeon_device *rdev, unsigned offset,
177 return -ENOMEM; 177 return -ENOMEM;
178 } 178 }
179 rdev->gart.pages[p] = pagelist[i]; 179 rdev->gart.pages[p] = pagelist[i];
180 page_base = (uint32_t)rdev->gart.pages_addr[p]; 180 page_base = rdev->gart.pages_addr[p];
181 for (j = 0; j < (PAGE_SIZE / 4096); j++, t++) { 181 for (j = 0; j < (PAGE_SIZE / 4096); j++, t++) {
182 radeon_gart_set_page(rdev, t, page_base); 182 radeon_gart_set_page(rdev, t, page_base);
183 page_base += 4096; 183 page_base += 4096;
diff --git a/drivers/gpu/drm/radeon/radeon_gem.c b/drivers/gpu/drm/radeon/radeon_gem.c
index eb516034235d..cded5180c752 100644
--- a/drivers/gpu/drm/radeon/radeon_gem.c
+++ b/drivers/gpu/drm/radeon/radeon_gem.c
@@ -157,9 +157,9 @@ int radeon_gem_info_ioctl(struct drm_device *dev, void *data,
157 struct radeon_device *rdev = dev->dev_private; 157 struct radeon_device *rdev = dev->dev_private;
158 struct drm_radeon_gem_info *args = data; 158 struct drm_radeon_gem_info *args = data;
159 159
160 args->vram_size = rdev->mc.vram_size; 160 args->vram_size = rdev->mc.real_vram_size;
161 /* FIXME: report somethings that makes sense */ 161 /* FIXME: report somethings that makes sense */
162 args->vram_visible = rdev->mc.vram_size - (4 * 1024 * 1024); 162 args->vram_visible = rdev->mc.real_vram_size - (4 * 1024 * 1024);
163 args->gart_size = rdev->mc.gtt_size; 163 args->gart_size = rdev->mc.gtt_size;
164 return 0; 164 return 0;
165} 165}
@@ -285,3 +285,44 @@ int radeon_gem_wait_idle_ioctl(struct drm_device *dev, void *data,
285 mutex_unlock(&dev->struct_mutex); 285 mutex_unlock(&dev->struct_mutex);
286 return r; 286 return r;
287} 287}
288
289int radeon_gem_set_tiling_ioctl(struct drm_device *dev, void *data,
290 struct drm_file *filp)
291{
292 struct drm_radeon_gem_set_tiling *args = data;
293 struct drm_gem_object *gobj;
294 struct radeon_object *robj;
295 int r = 0;
296
297 DRM_DEBUG("%d \n", args->handle);
298 gobj = drm_gem_object_lookup(dev, filp, args->handle);
299 if (gobj == NULL)
300 return -EINVAL;
301 robj = gobj->driver_private;
302 radeon_object_set_tiling_flags(robj, args->tiling_flags, args->pitch);
303 mutex_lock(&dev->struct_mutex);
304 drm_gem_object_unreference(gobj);
305 mutex_unlock(&dev->struct_mutex);
306 return r;
307}
308
309int radeon_gem_get_tiling_ioctl(struct drm_device *dev, void *data,
310 struct drm_file *filp)
311{
312 struct drm_radeon_gem_get_tiling *args = data;
313 struct drm_gem_object *gobj;
314 struct radeon_object *robj;
315 int r = 0;
316
317 DRM_DEBUG("\n");
318 gobj = drm_gem_object_lookup(dev, filp, args->handle);
319 if (gobj == NULL)
320 return -EINVAL;
321 robj = gobj->driver_private;
322 radeon_object_get_tiling_flags(robj, &args->tiling_flags,
323 &args->pitch);
324 mutex_lock(&dev->struct_mutex);
325 drm_gem_object_unreference(gobj);
326 mutex_unlock(&dev->struct_mutex);
327 return r;
328}
diff --git a/drivers/gpu/drm/radeon/radeon_kms.c b/drivers/gpu/drm/radeon/radeon_kms.c
index 4612a7c146d1..3357110e30ce 100644
--- a/drivers/gpu/drm/radeon/radeon_kms.c
+++ b/drivers/gpu/drm/radeon/radeon_kms.c
@@ -58,6 +58,8 @@ int radeon_driver_load_kms(struct drm_device *dev, unsigned long flags)
58 if (r) { 58 if (r) {
59 DRM_ERROR("Failed to initialize radeon, disabling IOCTL\n"); 59 DRM_ERROR("Failed to initialize radeon, disabling IOCTL\n");
60 radeon_device_fini(rdev); 60 radeon_device_fini(rdev);
61 kfree(rdev);
62 dev->dev_private = NULL;
61 return r; 63 return r;
62 } 64 }
63 return 0; 65 return 0;
@@ -291,5 +293,7 @@ struct drm_ioctl_desc radeon_ioctls_kms[] = {
291 DRM_IOCTL_DEF(DRM_RADEON_GEM_WAIT_IDLE, radeon_gem_wait_idle_ioctl, DRM_AUTH), 293 DRM_IOCTL_DEF(DRM_RADEON_GEM_WAIT_IDLE, radeon_gem_wait_idle_ioctl, DRM_AUTH),
292 DRM_IOCTL_DEF(DRM_RADEON_CS, radeon_cs_ioctl, DRM_AUTH), 294 DRM_IOCTL_DEF(DRM_RADEON_CS, radeon_cs_ioctl, DRM_AUTH),
293 DRM_IOCTL_DEF(DRM_RADEON_INFO, radeon_info_ioctl, DRM_AUTH), 295 DRM_IOCTL_DEF(DRM_RADEON_INFO, radeon_info_ioctl, DRM_AUTH),
296 DRM_IOCTL_DEF(DRM_RADEON_GEM_SET_TILING, radeon_gem_set_tiling_ioctl, DRM_AUTH),
297 DRM_IOCTL_DEF(DRM_RADEON_GEM_GET_TILING, radeon_gem_get_tiling_ioctl, DRM_AUTH),
294}; 298};
295int radeon_max_kms_ioctl = DRM_ARRAY_SIZE(radeon_ioctls_kms); 299int radeon_max_kms_ioctl = DRM_ARRAY_SIZE(radeon_ioctls_kms);
diff --git a/drivers/gpu/drm/radeon/radeon_legacy_crtc.c b/drivers/gpu/drm/radeon/radeon_legacy_crtc.c
index 8086ecf7f03d..7d06dc98a42a 100644
--- a/drivers/gpu/drm/radeon/radeon_legacy_crtc.c
+++ b/drivers/gpu/drm/radeon/radeon_legacy_crtc.c
@@ -29,6 +29,171 @@
29#include "radeon_fixed.h" 29#include "radeon_fixed.h"
30#include "radeon.h" 30#include "radeon.h"
31 31
32static void radeon_legacy_rmx_mode_set(struct drm_crtc *crtc,
33 struct drm_display_mode *mode,
34 struct drm_display_mode *adjusted_mode)
35{
36 struct drm_device *dev = crtc->dev;
37 struct radeon_device *rdev = dev->dev_private;
38 struct radeon_crtc *radeon_crtc = to_radeon_crtc(crtc);
39 int xres = mode->hdisplay;
40 int yres = mode->vdisplay;
41 bool hscale = true, vscale = true;
42 int hsync_wid;
43 int vsync_wid;
44 int hsync_start;
45 int blank_width;
46 u32 scale, inc, crtc_more_cntl;
47 u32 fp_horz_stretch, fp_vert_stretch, fp_horz_vert_active;
48 u32 fp_h_sync_strt_wid, fp_crtc_h_total_disp;
49 u32 fp_v_sync_strt_wid, fp_crtc_v_total_disp;
50 struct radeon_native_mode *native_mode = &radeon_crtc->native_mode;
51
52 fp_vert_stretch = RREG32(RADEON_FP_VERT_STRETCH) &
53 (RADEON_VERT_STRETCH_RESERVED |
54 RADEON_VERT_AUTO_RATIO_INC);
55 fp_horz_stretch = RREG32(RADEON_FP_HORZ_STRETCH) &
56 (RADEON_HORZ_FP_LOOP_STRETCH |
57 RADEON_HORZ_AUTO_RATIO_INC);
58
59 crtc_more_cntl = 0;
60 if ((rdev->family == CHIP_RS100) ||
61 (rdev->family == CHIP_RS200)) {
62 /* This is to workaround the asic bug for RMX, some versions
63 of BIOS dosen't have this register initialized correctly. */
64 crtc_more_cntl |= RADEON_CRTC_H_CUTOFF_ACTIVE_EN;
65 }
66
67
68 fp_crtc_h_total_disp = ((((mode->crtc_htotal / 8) - 1) & 0x3ff)
69 | ((((mode->crtc_hdisplay / 8) - 1) & 0x1ff) << 16));
70
71 hsync_wid = (mode->crtc_hsync_end - mode->crtc_hsync_start) / 8;
72 if (!hsync_wid)
73 hsync_wid = 1;
74 hsync_start = mode->crtc_hsync_start - 8;
75
76 fp_h_sync_strt_wid = ((hsync_start & 0x1fff)
77 | ((hsync_wid & 0x3f) << 16)
78 | ((mode->flags & DRM_MODE_FLAG_NHSYNC)
79 ? RADEON_CRTC_H_SYNC_POL
80 : 0));
81
82 fp_crtc_v_total_disp = (((mode->crtc_vtotal - 1) & 0xffff)
83 | ((mode->crtc_vdisplay - 1) << 16));
84
85 vsync_wid = mode->crtc_vsync_end - mode->crtc_vsync_start;
86 if (!vsync_wid)
87 vsync_wid = 1;
88
89 fp_v_sync_strt_wid = (((mode->crtc_vsync_start - 1) & 0xfff)
90 | ((vsync_wid & 0x1f) << 16)
91 | ((mode->flags & DRM_MODE_FLAG_NVSYNC)
92 ? RADEON_CRTC_V_SYNC_POL
93 : 0));
94
95 fp_horz_vert_active = 0;
96
97 if (native_mode->panel_xres == 0 ||
98 native_mode->panel_yres == 0) {
99 hscale = false;
100 vscale = false;
101 } else {
102 if (xres > native_mode->panel_xres)
103 xres = native_mode->panel_xres;
104 if (yres > native_mode->panel_yres)
105 yres = native_mode->panel_yres;
106
107 if (xres == native_mode->panel_xres)
108 hscale = false;
109 if (yres == native_mode->panel_yres)
110 vscale = false;
111 }
112
113 switch (radeon_crtc->rmx_type) {
114 case RMX_FULL:
115 case RMX_ASPECT:
116 if (!hscale)
117 fp_horz_stretch |= ((xres/8-1) << 16);
118 else {
119 inc = (fp_horz_stretch & RADEON_HORZ_AUTO_RATIO_INC) ? 1 : 0;
120 scale = ((xres + inc) * RADEON_HORZ_STRETCH_RATIO_MAX)
121 / native_mode->panel_xres + 1;
122 fp_horz_stretch |= (((scale) & RADEON_HORZ_STRETCH_RATIO_MASK) |
123 RADEON_HORZ_STRETCH_BLEND |
124 RADEON_HORZ_STRETCH_ENABLE |
125 ((native_mode->panel_xres/8-1) << 16));
126 }
127
128 if (!vscale)
129 fp_vert_stretch |= ((yres-1) << 12);
130 else {
131 inc = (fp_vert_stretch & RADEON_VERT_AUTO_RATIO_INC) ? 1 : 0;
132 scale = ((yres + inc) * RADEON_VERT_STRETCH_RATIO_MAX)
133 / native_mode->panel_yres + 1;
134 fp_vert_stretch |= (((scale) & RADEON_VERT_STRETCH_RATIO_MASK) |
135 RADEON_VERT_STRETCH_ENABLE |
136 RADEON_VERT_STRETCH_BLEND |
137 ((native_mode->panel_yres-1) << 12));
138 }
139 break;
140 case RMX_CENTER:
141 fp_horz_stretch |= ((xres/8-1) << 16);
142 fp_vert_stretch |= ((yres-1) << 12);
143
144 crtc_more_cntl |= (RADEON_CRTC_AUTO_HORZ_CENTER_EN |
145 RADEON_CRTC_AUTO_VERT_CENTER_EN);
146
147 blank_width = (mode->crtc_hblank_end - mode->crtc_hblank_start) / 8;
148 if (blank_width > 110)
149 blank_width = 110;
150
151 fp_crtc_h_total_disp = (((blank_width) & 0x3ff)
152 | ((((mode->crtc_hdisplay / 8) - 1) & 0x1ff) << 16));
153
154 hsync_wid = (mode->crtc_hsync_end - mode->crtc_hsync_start) / 8;
155 if (!hsync_wid)
156 hsync_wid = 1;
157
158 fp_h_sync_strt_wid = ((((mode->crtc_hsync_start - mode->crtc_hblank_start) / 8) & 0x1fff)
159 | ((hsync_wid & 0x3f) << 16)
160 | ((mode->flags & DRM_MODE_FLAG_NHSYNC)
161 ? RADEON_CRTC_H_SYNC_POL
162 : 0));
163
164 fp_crtc_v_total_disp = (((mode->crtc_vblank_end - mode->crtc_vblank_start) & 0xffff)
165 | ((mode->crtc_vdisplay - 1) << 16));
166
167 vsync_wid = mode->crtc_vsync_end - mode->crtc_vsync_start;
168 if (!vsync_wid)
169 vsync_wid = 1;
170
171 fp_v_sync_strt_wid = ((((mode->crtc_vsync_start - mode->crtc_vblank_start) & 0xfff)
172 | ((vsync_wid & 0x1f) << 16)
173 | ((mode->flags & DRM_MODE_FLAG_NVSYNC)
174 ? RADEON_CRTC_V_SYNC_POL
175 : 0)));
176
177 fp_horz_vert_active = (((native_mode->panel_yres) & 0xfff) |
178 (((native_mode->panel_xres / 8) & 0x1ff) << 16));
179 break;
180 case RMX_OFF:
181 default:
182 fp_horz_stretch |= ((xres/8-1) << 16);
183 fp_vert_stretch |= ((yres-1) << 12);
184 break;
185 }
186
187 WREG32(RADEON_FP_HORZ_STRETCH, fp_horz_stretch);
188 WREG32(RADEON_FP_VERT_STRETCH, fp_vert_stretch);
189 WREG32(RADEON_CRTC_MORE_CNTL, crtc_more_cntl);
190 WREG32(RADEON_FP_HORZ_VERT_ACTIVE, fp_horz_vert_active);
191 WREG32(RADEON_FP_H_SYNC_STRT_WID, fp_h_sync_strt_wid);
192 WREG32(RADEON_FP_V_SYNC_STRT_WID, fp_v_sync_strt_wid);
193 WREG32(RADEON_FP_CRTC_H_TOTAL_DISP, fp_crtc_h_total_disp);
194 WREG32(RADEON_FP_CRTC_V_TOTAL_DISP, fp_crtc_v_total_disp);
195}
196
32void radeon_restore_common_regs(struct drm_device *dev) 197void radeon_restore_common_regs(struct drm_device *dev)
33{ 198{
34 /* don't need this yet */ 199 /* don't need this yet */
@@ -235,6 +400,7 @@ int radeon_crtc_set_base(struct drm_crtc *crtc, int x, int y,
235 uint64_t base; 400 uint64_t base;
236 uint32_t crtc_offset, crtc_offset_cntl, crtc_tile_x0_y0 = 0; 401 uint32_t crtc_offset, crtc_offset_cntl, crtc_tile_x0_y0 = 0;
237 uint32_t crtc_pitch, pitch_pixels; 402 uint32_t crtc_pitch, pitch_pixels;
403 uint32_t tiling_flags;
238 404
239 DRM_DEBUG("\n"); 405 DRM_DEBUG("\n");
240 406
@@ -244,7 +410,12 @@ int radeon_crtc_set_base(struct drm_crtc *crtc, int x, int y,
244 if (radeon_gem_object_pin(obj, RADEON_GEM_DOMAIN_VRAM, &base)) { 410 if (radeon_gem_object_pin(obj, RADEON_GEM_DOMAIN_VRAM, &base)) {
245 return -EINVAL; 411 return -EINVAL;
246 } 412 }
247 crtc_offset = (u32)base; 413 /* if scanout was in GTT this really wouldn't work */
414 /* crtc offset is from display base addr not FB location */
415 radeon_crtc->legacy_display_base_addr = rdev->mc.vram_location;
416
417 base -= radeon_crtc->legacy_display_base_addr;
418
248 crtc_offset_cntl = 0; 419 crtc_offset_cntl = 0;
249 420
250 pitch_pixels = crtc->fb->pitch / (crtc->fb->bits_per_pixel / 8); 421 pitch_pixels = crtc->fb->pitch / (crtc->fb->bits_per_pixel / 8);
@@ -253,8 +424,12 @@ int radeon_crtc_set_base(struct drm_crtc *crtc, int x, int y,
253 (crtc->fb->bits_per_pixel * 8)); 424 (crtc->fb->bits_per_pixel * 8));
254 crtc_pitch |= crtc_pitch << 16; 425 crtc_pitch |= crtc_pitch << 16;
255 426
256 /* TODO tiling */ 427 radeon_object_get_tiling_flags(obj->driver_private,
257 if (0) { 428 &tiling_flags, NULL);
429 if (tiling_flags & RADEON_TILING_MICRO)
430 DRM_ERROR("trying to scanout microtiled buffer\n");
431
432 if (tiling_flags & RADEON_TILING_MACRO) {
258 if (ASIC_IS_R300(rdev)) 433 if (ASIC_IS_R300(rdev))
259 crtc_offset_cntl |= (R300_CRTC_X_Y_MODE_EN | 434 crtc_offset_cntl |= (R300_CRTC_X_Y_MODE_EN |
260 R300_CRTC_MICRO_TILE_BUFFER_DIS | 435 R300_CRTC_MICRO_TILE_BUFFER_DIS |
@@ -270,15 +445,13 @@ int radeon_crtc_set_base(struct drm_crtc *crtc, int x, int y,
270 crtc_offset_cntl &= ~RADEON_CRTC_TILE_EN; 445 crtc_offset_cntl &= ~RADEON_CRTC_TILE_EN;
271 } 446 }
272 447
273 448 if (tiling_flags & RADEON_TILING_MACRO) {
274 /* TODO more tiling */
275 if (0) {
276 if (ASIC_IS_R300(rdev)) { 449 if (ASIC_IS_R300(rdev)) {
277 crtc_tile_x0_y0 = x | (y << 16); 450 crtc_tile_x0_y0 = x | (y << 16);
278 base &= ~0x7ff; 451 base &= ~0x7ff;
279 } else { 452 } else {
280 int byteshift = crtc->fb->bits_per_pixel >> 4; 453 int byteshift = crtc->fb->bits_per_pixel >> 4;
281 int tile_addr = (((y >> 3) * crtc->fb->width + x) >> (8 - byteshift)) << 11; 454 int tile_addr = (((y >> 3) * pitch_pixels + x) >> (8 - byteshift)) << 11;
282 base += tile_addr + ((x << byteshift) % 256) + ((y % 8) << 8); 455 base += tile_addr + ((x << byteshift) % 256) + ((y % 8) << 8);
283 crtc_offset_cntl |= (y % 16); 456 crtc_offset_cntl |= (y % 16);
284 } 457 }
@@ -303,11 +476,9 @@ int radeon_crtc_set_base(struct drm_crtc *crtc, int x, int y,
303 476
304 base &= ~7; 477 base &= ~7;
305 478
306 /* update sarea TODO */
307
308 crtc_offset = (u32)base; 479 crtc_offset = (u32)base;
309 480
310 WREG32(RADEON_DISPLAY_BASE_ADDR + radeon_crtc->crtc_offset, rdev->mc.vram_location); 481 WREG32(RADEON_DISPLAY_BASE_ADDR + radeon_crtc->crtc_offset, radeon_crtc->legacy_display_base_addr);
311 482
312 if (ASIC_IS_R300(rdev)) { 483 if (ASIC_IS_R300(rdev)) {
313 if (radeon_crtc->crtc_id) 484 if (radeon_crtc->crtc_id)
@@ -751,6 +922,8 @@ static bool radeon_crtc_mode_fixup(struct drm_crtc *crtc,
751 struct drm_display_mode *mode, 922 struct drm_display_mode *mode,
752 struct drm_display_mode *adjusted_mode) 923 struct drm_display_mode *adjusted_mode)
753{ 924{
925 if (!radeon_crtc_scaling_mode_fixup(crtc, mode, adjusted_mode))
926 return false;
754 return true; 927 return true;
755} 928}
756 929
@@ -759,16 +932,25 @@ static int radeon_crtc_mode_set(struct drm_crtc *crtc,
759 struct drm_display_mode *adjusted_mode, 932 struct drm_display_mode *adjusted_mode,
760 int x, int y, struct drm_framebuffer *old_fb) 933 int x, int y, struct drm_framebuffer *old_fb)
761{ 934{
762 935 struct radeon_crtc *radeon_crtc = to_radeon_crtc(crtc);
763 DRM_DEBUG("\n"); 936 struct drm_device *dev = crtc->dev;
937 struct radeon_device *rdev = dev->dev_private;
764 938
765 /* TODO TV */ 939 /* TODO TV */
766
767 radeon_crtc_set_base(crtc, x, y, old_fb); 940 radeon_crtc_set_base(crtc, x, y, old_fb);
768 radeon_set_crtc_timing(crtc, adjusted_mode); 941 radeon_set_crtc_timing(crtc, adjusted_mode);
769 radeon_set_pll(crtc, adjusted_mode); 942 radeon_set_pll(crtc, adjusted_mode);
770 radeon_init_disp_bandwidth(crtc->dev); 943 radeon_bandwidth_update(rdev);
771 944 if (radeon_crtc->crtc_id == 0) {
945 radeon_legacy_rmx_mode_set(crtc, mode, adjusted_mode);
946 } else {
947 if (radeon_crtc->rmx_type != RMX_OFF) {
948 /* FIXME: only first crtc has rmx what should we
949 * do ?
950 */
951 DRM_ERROR("Mode need scaling but only first crtc can do that.\n");
952 }
953 }
772 return 0; 954 return 0;
773} 955}
774 956
@@ -799,478 +981,3 @@ void radeon_legacy_init_crtc(struct drm_device *dev,
799 radeon_crtc->crtc_offset = RADEON_CRTC2_H_TOTAL_DISP - RADEON_CRTC_H_TOTAL_DISP; 981 radeon_crtc->crtc_offset = RADEON_CRTC2_H_TOTAL_DISP - RADEON_CRTC_H_TOTAL_DISP;
800 drm_crtc_helper_add(&radeon_crtc->base, &legacy_helper_funcs); 982 drm_crtc_helper_add(&radeon_crtc->base, &legacy_helper_funcs);
801} 983}
802
803void radeon_init_disp_bw_legacy(struct drm_device *dev,
804 struct drm_display_mode *mode1,
805 uint32_t pixel_bytes1,
806 struct drm_display_mode *mode2,
807 uint32_t pixel_bytes2)
808{
809 struct radeon_device *rdev = dev->dev_private;
810 fixed20_12 trcd_ff, trp_ff, tras_ff, trbs_ff, tcas_ff;
811 fixed20_12 sclk_ff, mclk_ff, sclk_eff_ff, sclk_delay_ff;
812 fixed20_12 peak_disp_bw, mem_bw, pix_clk, pix_clk2, temp_ff, crit_point_ff;
813 uint32_t temp, data, mem_trcd, mem_trp, mem_tras;
814 fixed20_12 memtcas_ff[8] = {
815 fixed_init(1),
816 fixed_init(2),
817 fixed_init(3),
818 fixed_init(0),
819 fixed_init_half(1),
820 fixed_init_half(2),
821 fixed_init(0),
822 };
823 fixed20_12 memtcas_rs480_ff[8] = {
824 fixed_init(0),
825 fixed_init(1),
826 fixed_init(2),
827 fixed_init(3),
828 fixed_init(0),
829 fixed_init_half(1),
830 fixed_init_half(2),
831 fixed_init_half(3),
832 };
833 fixed20_12 memtcas2_ff[8] = {
834 fixed_init(0),
835 fixed_init(1),
836 fixed_init(2),
837 fixed_init(3),
838 fixed_init(4),
839 fixed_init(5),
840 fixed_init(6),
841 fixed_init(7),
842 };
843 fixed20_12 memtrbs[8] = {
844 fixed_init(1),
845 fixed_init_half(1),
846 fixed_init(2),
847 fixed_init_half(2),
848 fixed_init(3),
849 fixed_init_half(3),
850 fixed_init(4),
851 fixed_init_half(4)
852 };
853 fixed20_12 memtrbs_r4xx[8] = {
854 fixed_init(4),
855 fixed_init(5),
856 fixed_init(6),
857 fixed_init(7),
858 fixed_init(8),
859 fixed_init(9),
860 fixed_init(10),
861 fixed_init(11)
862 };
863 fixed20_12 min_mem_eff;
864 fixed20_12 mc_latency_sclk, mc_latency_mclk, k1;
865 fixed20_12 cur_latency_mclk, cur_latency_sclk;
866 fixed20_12 disp_latency, disp_latency_overhead, disp_drain_rate,
867 disp_drain_rate2, read_return_rate;
868 fixed20_12 time_disp1_drop_priority;
869 int c;
870 int cur_size = 16; /* in octawords */
871 int critical_point = 0, critical_point2;
872/* uint32_t read_return_rate, time_disp1_drop_priority; */
873 int stop_req, max_stop_req;
874
875 min_mem_eff.full = rfixed_const_8(0);
876 /* get modes */
877 if ((rdev->disp_priority == 2) && ASIC_IS_R300(rdev)) {
878 uint32_t mc_init_misc_lat_timer = RREG32(R300_MC_INIT_MISC_LAT_TIMER);
879 mc_init_misc_lat_timer &= ~(R300_MC_DISP1R_INIT_LAT_MASK << R300_MC_DISP1R_INIT_LAT_SHIFT);
880 mc_init_misc_lat_timer &= ~(R300_MC_DISP0R_INIT_LAT_MASK << R300_MC_DISP0R_INIT_LAT_SHIFT);
881 /* check crtc enables */
882 if (mode2)
883 mc_init_misc_lat_timer |= (1 << R300_MC_DISP1R_INIT_LAT_SHIFT);
884 if (mode1)
885 mc_init_misc_lat_timer |= (1 << R300_MC_DISP0R_INIT_LAT_SHIFT);
886 WREG32(R300_MC_INIT_MISC_LAT_TIMER, mc_init_misc_lat_timer);
887 }
888
889 /*
890 * determine is there is enough bw for current mode
891 */
892 mclk_ff.full = rfixed_const(rdev->clock.default_mclk);
893 temp_ff.full = rfixed_const(100);
894 mclk_ff.full = rfixed_div(mclk_ff, temp_ff);
895 sclk_ff.full = rfixed_const(rdev->clock.default_sclk);
896 sclk_ff.full = rfixed_div(sclk_ff, temp_ff);
897
898 temp = (rdev->mc.vram_width / 8) * (rdev->mc.vram_is_ddr ? 2 : 1);
899 temp_ff.full = rfixed_const(temp);
900 mem_bw.full = rfixed_mul(mclk_ff, temp_ff);
901
902 pix_clk.full = 0;
903 pix_clk2.full = 0;
904 peak_disp_bw.full = 0;
905 if (mode1) {
906 temp_ff.full = rfixed_const(1000);
907 pix_clk.full = rfixed_const(mode1->clock); /* convert to fixed point */
908 pix_clk.full = rfixed_div(pix_clk, temp_ff);
909 temp_ff.full = rfixed_const(pixel_bytes1);
910 peak_disp_bw.full += rfixed_mul(pix_clk, temp_ff);
911 }
912 if (mode2) {
913 temp_ff.full = rfixed_const(1000);
914 pix_clk2.full = rfixed_const(mode2->clock); /* convert to fixed point */
915 pix_clk2.full = rfixed_div(pix_clk2, temp_ff);
916 temp_ff.full = rfixed_const(pixel_bytes2);
917 peak_disp_bw.full += rfixed_mul(pix_clk2, temp_ff);
918 }
919
920 mem_bw.full = rfixed_mul(mem_bw, min_mem_eff);
921 if (peak_disp_bw.full >= mem_bw.full) {
922 DRM_ERROR("You may not have enough display bandwidth for current mode\n"
923 "If you have flickering problem, try to lower resolution, refresh rate, or color depth\n");
924 }
925
926 /* Get values from the EXT_MEM_CNTL register...converting its contents. */
927 temp = RREG32(RADEON_MEM_TIMING_CNTL);
928 if ((rdev->family == CHIP_RV100) || (rdev->flags & RADEON_IS_IGP)) { /* RV100, M6, IGPs */
929 mem_trcd = ((temp >> 2) & 0x3) + 1;
930 mem_trp = ((temp & 0x3)) + 1;
931 mem_tras = ((temp & 0x70) >> 4) + 1;
932 } else if (rdev->family == CHIP_R300 ||
933 rdev->family == CHIP_R350) { /* r300, r350 */
934 mem_trcd = (temp & 0x7) + 1;
935 mem_trp = ((temp >> 8) & 0x7) + 1;
936 mem_tras = ((temp >> 11) & 0xf) + 4;
937 } else if (rdev->family == CHIP_RV350 ||
938 rdev->family <= CHIP_RV380) {
939 /* rv3x0 */
940 mem_trcd = (temp & 0x7) + 3;
941 mem_trp = ((temp >> 8) & 0x7) + 3;
942 mem_tras = ((temp >> 11) & 0xf) + 6;
943 } else if (rdev->family == CHIP_R420 ||
944 rdev->family == CHIP_R423 ||
945 rdev->family == CHIP_RV410) {
946 /* r4xx */
947 mem_trcd = (temp & 0xf) + 3;
948 if (mem_trcd > 15)
949 mem_trcd = 15;
950 mem_trp = ((temp >> 8) & 0xf) + 3;
951 if (mem_trp > 15)
952 mem_trp = 15;
953 mem_tras = ((temp >> 12) & 0x1f) + 6;
954 if (mem_tras > 31)
955 mem_tras = 31;
956 } else { /* RV200, R200 */
957 mem_trcd = (temp & 0x7) + 1;
958 mem_trp = ((temp >> 8) & 0x7) + 1;
959 mem_tras = ((temp >> 12) & 0xf) + 4;
960 }
961 /* convert to FF */
962 trcd_ff.full = rfixed_const(mem_trcd);
963 trp_ff.full = rfixed_const(mem_trp);
964 tras_ff.full = rfixed_const(mem_tras);
965
966 /* Get values from the MEM_SDRAM_MODE_REG register...converting its */
967 temp = RREG32(RADEON_MEM_SDRAM_MODE_REG);
968 data = (temp & (7 << 20)) >> 20;
969 if ((rdev->family == CHIP_RV100) || rdev->flags & RADEON_IS_IGP) {
970 if (rdev->family == CHIP_RS480) /* don't think rs400 */
971 tcas_ff = memtcas_rs480_ff[data];
972 else
973 tcas_ff = memtcas_ff[data];
974 } else
975 tcas_ff = memtcas2_ff[data];
976
977 if (rdev->family == CHIP_RS400 ||
978 rdev->family == CHIP_RS480) {
979 /* extra cas latency stored in bits 23-25 0-4 clocks */
980 data = (temp >> 23) & 0x7;
981 if (data < 5)
982 tcas_ff.full += rfixed_const(data);
983 }
984
985 if (ASIC_IS_R300(rdev) && !(rdev->flags & RADEON_IS_IGP)) {
986 /* on the R300, Tcas is included in Trbs.
987 */
988 temp = RREG32(RADEON_MEM_CNTL);
989 data = (R300_MEM_NUM_CHANNELS_MASK & temp);
990 if (data == 1) {
991 if (R300_MEM_USE_CD_CH_ONLY & temp) {
992 temp = RREG32(R300_MC_IND_INDEX);
993 temp &= ~R300_MC_IND_ADDR_MASK;
994 temp |= R300_MC_READ_CNTL_CD_mcind;
995 WREG32(R300_MC_IND_INDEX, temp);
996 temp = RREG32(R300_MC_IND_DATA);
997 data = (R300_MEM_RBS_POSITION_C_MASK & temp);
998 } else {
999 temp = RREG32(R300_MC_READ_CNTL_AB);
1000 data = (R300_MEM_RBS_POSITION_A_MASK & temp);
1001 }
1002 } else {
1003 temp = RREG32(R300_MC_READ_CNTL_AB);
1004 data = (R300_MEM_RBS_POSITION_A_MASK & temp);
1005 }
1006 if (rdev->family == CHIP_RV410 ||
1007 rdev->family == CHIP_R420 ||
1008 rdev->family == CHIP_R423)
1009 trbs_ff = memtrbs_r4xx[data];
1010 else
1011 trbs_ff = memtrbs[data];
1012 tcas_ff.full += trbs_ff.full;
1013 }
1014
1015 sclk_eff_ff.full = sclk_ff.full;
1016
1017 if (rdev->flags & RADEON_IS_AGP) {
1018 fixed20_12 agpmode_ff;
1019 agpmode_ff.full = rfixed_const(radeon_agpmode);
1020 temp_ff.full = rfixed_const_666(16);
1021 sclk_eff_ff.full -= rfixed_mul(agpmode_ff, temp_ff);
1022 }
1023 /* TODO PCIE lanes may affect this - agpmode == 16?? */
1024
1025 if (ASIC_IS_R300(rdev)) {
1026 sclk_delay_ff.full = rfixed_const(250);
1027 } else {
1028 if ((rdev->family == CHIP_RV100) ||
1029 rdev->flags & RADEON_IS_IGP) {
1030 if (rdev->mc.vram_is_ddr)
1031 sclk_delay_ff.full = rfixed_const(41);
1032 else
1033 sclk_delay_ff.full = rfixed_const(33);
1034 } else {
1035 if (rdev->mc.vram_width == 128)
1036 sclk_delay_ff.full = rfixed_const(57);
1037 else
1038 sclk_delay_ff.full = rfixed_const(41);
1039 }
1040 }
1041
1042 mc_latency_sclk.full = rfixed_div(sclk_delay_ff, sclk_eff_ff);
1043
1044 if (rdev->mc.vram_is_ddr) {
1045 if (rdev->mc.vram_width == 32) {
1046 k1.full = rfixed_const(40);
1047 c = 3;
1048 } else {
1049 k1.full = rfixed_const(20);
1050 c = 1;
1051 }
1052 } else {
1053 k1.full = rfixed_const(40);
1054 c = 3;
1055 }
1056
1057 temp_ff.full = rfixed_const(2);
1058 mc_latency_mclk.full = rfixed_mul(trcd_ff, temp_ff);
1059 temp_ff.full = rfixed_const(c);
1060 mc_latency_mclk.full += rfixed_mul(tcas_ff, temp_ff);
1061 temp_ff.full = rfixed_const(4);
1062 mc_latency_mclk.full += rfixed_mul(tras_ff, temp_ff);
1063 mc_latency_mclk.full += rfixed_mul(trp_ff, temp_ff);
1064 mc_latency_mclk.full += k1.full;
1065
1066 mc_latency_mclk.full = rfixed_div(mc_latency_mclk, mclk_ff);
1067 mc_latency_mclk.full += rfixed_div(temp_ff, sclk_eff_ff);
1068
1069 /*
1070 HW cursor time assuming worst case of full size colour cursor.
1071 */
1072 temp_ff.full = rfixed_const((2 * (cur_size - (rdev->mc.vram_is_ddr + 1))));
1073 temp_ff.full += trcd_ff.full;
1074 if (temp_ff.full < tras_ff.full)
1075 temp_ff.full = tras_ff.full;
1076 cur_latency_mclk.full = rfixed_div(temp_ff, mclk_ff);
1077
1078 temp_ff.full = rfixed_const(cur_size);
1079 cur_latency_sclk.full = rfixed_div(temp_ff, sclk_eff_ff);
1080 /*
1081 Find the total latency for the display data.
1082 */
1083 disp_latency_overhead.full = rfixed_const(80);
1084 disp_latency_overhead.full = rfixed_div(disp_latency_overhead, sclk_ff);
1085 mc_latency_mclk.full += disp_latency_overhead.full + cur_latency_mclk.full;
1086 mc_latency_sclk.full += disp_latency_overhead.full + cur_latency_sclk.full;
1087
1088 if (mc_latency_mclk.full > mc_latency_sclk.full)
1089 disp_latency.full = mc_latency_mclk.full;
1090 else
1091 disp_latency.full = mc_latency_sclk.full;
1092
1093 /* setup Max GRPH_STOP_REQ default value */
1094 if (ASIC_IS_RV100(rdev))
1095 max_stop_req = 0x5c;
1096 else
1097 max_stop_req = 0x7c;
1098
1099 if (mode1) {
1100 /* CRTC1
1101 Set GRPH_BUFFER_CNTL register using h/w defined optimal values.
1102 GRPH_STOP_REQ <= MIN[ 0x7C, (CRTC_H_DISP + 1) * (bit depth) / 0x10 ]
1103 */
1104 stop_req = mode1->hdisplay * pixel_bytes1 / 16;
1105
1106 if (stop_req > max_stop_req)
1107 stop_req = max_stop_req;
1108
1109 /*
1110 Find the drain rate of the display buffer.
1111 */
1112 temp_ff.full = rfixed_const((16/pixel_bytes1));
1113 disp_drain_rate.full = rfixed_div(pix_clk, temp_ff);
1114
1115 /*
1116 Find the critical point of the display buffer.
1117 */
1118 crit_point_ff.full = rfixed_mul(disp_drain_rate, disp_latency);
1119 crit_point_ff.full += rfixed_const_half(0);
1120
1121 critical_point = rfixed_trunc(crit_point_ff);
1122
1123 if (rdev->disp_priority == 2) {
1124 critical_point = 0;
1125 }
1126
1127 /*
1128 The critical point should never be above max_stop_req-4. Setting
1129 GRPH_CRITICAL_CNTL = 0 will thus force high priority all the time.
1130 */
1131 if (max_stop_req - critical_point < 4)
1132 critical_point = 0;
1133
1134 if (critical_point == 0 && mode2 && rdev->family == CHIP_R300) {
1135 /* some R300 cards have problem with this set to 0, when CRTC2 is enabled.*/
1136 critical_point = 0x10;
1137 }
1138
1139 temp = RREG32(RADEON_GRPH_BUFFER_CNTL);
1140 temp &= ~(RADEON_GRPH_STOP_REQ_MASK);
1141 temp |= (stop_req << RADEON_GRPH_STOP_REQ_SHIFT);
1142 temp &= ~(RADEON_GRPH_START_REQ_MASK);
1143 if ((rdev->family == CHIP_R350) &&
1144 (stop_req > 0x15)) {
1145 stop_req -= 0x10;
1146 }
1147 temp |= (stop_req << RADEON_GRPH_START_REQ_SHIFT);
1148 temp |= RADEON_GRPH_BUFFER_SIZE;
1149 temp &= ~(RADEON_GRPH_CRITICAL_CNTL |
1150 RADEON_GRPH_CRITICAL_AT_SOF |
1151 RADEON_GRPH_STOP_CNTL);
1152 /*
1153 Write the result into the register.
1154 */
1155 WREG32(RADEON_GRPH_BUFFER_CNTL, ((temp & ~RADEON_GRPH_CRITICAL_POINT_MASK) |
1156 (critical_point << RADEON_GRPH_CRITICAL_POINT_SHIFT)));
1157
1158#if 0
1159 if ((rdev->family == CHIP_RS400) ||
1160 (rdev->family == CHIP_RS480)) {
1161 /* attempt to program RS400 disp regs correctly ??? */
1162 temp = RREG32(RS400_DISP1_REG_CNTL);
1163 temp &= ~(RS400_DISP1_START_REQ_LEVEL_MASK |
1164 RS400_DISP1_STOP_REQ_LEVEL_MASK);
1165 WREG32(RS400_DISP1_REQ_CNTL1, (temp |
1166 (critical_point << RS400_DISP1_START_REQ_LEVEL_SHIFT) |
1167 (critical_point << RS400_DISP1_STOP_REQ_LEVEL_SHIFT)));
1168 temp = RREG32(RS400_DMIF_MEM_CNTL1);
1169 temp &= ~(RS400_DISP1_CRITICAL_POINT_START_MASK |
1170 RS400_DISP1_CRITICAL_POINT_STOP_MASK);
1171 WREG32(RS400_DMIF_MEM_CNTL1, (temp |
1172 (critical_point << RS400_DISP1_CRITICAL_POINT_START_SHIFT) |
1173 (critical_point << RS400_DISP1_CRITICAL_POINT_STOP_SHIFT)));
1174 }
1175#endif
1176
1177 DRM_DEBUG("GRPH_BUFFER_CNTL from to %x\n",
1178 /* (unsigned int)info->SavedReg->grph_buffer_cntl, */
1179 (unsigned int)RREG32(RADEON_GRPH_BUFFER_CNTL));
1180 }
1181
1182 if (mode2) {
1183 u32 grph2_cntl;
1184 stop_req = mode2->hdisplay * pixel_bytes2 / 16;
1185
1186 if (stop_req > max_stop_req)
1187 stop_req = max_stop_req;
1188
1189 /*
1190 Find the drain rate of the display buffer.
1191 */
1192 temp_ff.full = rfixed_const((16/pixel_bytes2));
1193 disp_drain_rate2.full = rfixed_div(pix_clk2, temp_ff);
1194
1195 grph2_cntl = RREG32(RADEON_GRPH2_BUFFER_CNTL);
1196 grph2_cntl &= ~(RADEON_GRPH_STOP_REQ_MASK);
1197 grph2_cntl |= (stop_req << RADEON_GRPH_STOP_REQ_SHIFT);
1198 grph2_cntl &= ~(RADEON_GRPH_START_REQ_MASK);
1199 if ((rdev->family == CHIP_R350) &&
1200 (stop_req > 0x15)) {
1201 stop_req -= 0x10;
1202 }
1203 grph2_cntl |= (stop_req << RADEON_GRPH_START_REQ_SHIFT);
1204 grph2_cntl |= RADEON_GRPH_BUFFER_SIZE;
1205 grph2_cntl &= ~(RADEON_GRPH_CRITICAL_CNTL |
1206 RADEON_GRPH_CRITICAL_AT_SOF |
1207 RADEON_GRPH_STOP_CNTL);
1208
1209 if ((rdev->family == CHIP_RS100) ||
1210 (rdev->family == CHIP_RS200))
1211 critical_point2 = 0;
1212 else {
1213 temp = (rdev->mc.vram_width * rdev->mc.vram_is_ddr + 1)/128;
1214 temp_ff.full = rfixed_const(temp);
1215 temp_ff.full = rfixed_mul(mclk_ff, temp_ff);
1216 if (sclk_ff.full < temp_ff.full)
1217 temp_ff.full = sclk_ff.full;
1218
1219 read_return_rate.full = temp_ff.full;
1220
1221 if (mode1) {
1222 temp_ff.full = read_return_rate.full - disp_drain_rate.full;
1223 time_disp1_drop_priority.full = rfixed_div(crit_point_ff, temp_ff);
1224 } else {
1225 time_disp1_drop_priority.full = 0;
1226 }
1227 crit_point_ff.full = disp_latency.full + time_disp1_drop_priority.full + disp_latency.full;
1228 crit_point_ff.full = rfixed_mul(crit_point_ff, disp_drain_rate2);
1229 crit_point_ff.full += rfixed_const_half(0);
1230
1231 critical_point2 = rfixed_trunc(crit_point_ff);
1232
1233 if (rdev->disp_priority == 2) {
1234 critical_point2 = 0;
1235 }
1236
1237 if (max_stop_req - critical_point2 < 4)
1238 critical_point2 = 0;
1239
1240 }
1241
1242 if (critical_point2 == 0 && rdev->family == CHIP_R300) {
1243 /* some R300 cards have problem with this set to 0 */
1244 critical_point2 = 0x10;
1245 }
1246
1247 WREG32(RADEON_GRPH2_BUFFER_CNTL, ((grph2_cntl & ~RADEON_GRPH_CRITICAL_POINT_MASK) |
1248 (critical_point2 << RADEON_GRPH_CRITICAL_POINT_SHIFT)));
1249
1250 if ((rdev->family == CHIP_RS400) ||
1251 (rdev->family == CHIP_RS480)) {
1252#if 0
1253 /* attempt to program RS400 disp2 regs correctly ??? */
1254 temp = RREG32(RS400_DISP2_REQ_CNTL1);
1255 temp &= ~(RS400_DISP2_START_REQ_LEVEL_MASK |
1256 RS400_DISP2_STOP_REQ_LEVEL_MASK);
1257 WREG32(RS400_DISP2_REQ_CNTL1, (temp |
1258 (critical_point2 << RS400_DISP1_START_REQ_LEVEL_SHIFT) |
1259 (critical_point2 << RS400_DISP1_STOP_REQ_LEVEL_SHIFT)));
1260 temp = RREG32(RS400_DISP2_REQ_CNTL2);
1261 temp &= ~(RS400_DISP2_CRITICAL_POINT_START_MASK |
1262 RS400_DISP2_CRITICAL_POINT_STOP_MASK);
1263 WREG32(RS400_DISP2_REQ_CNTL2, (temp |
1264 (critical_point2 << RS400_DISP2_CRITICAL_POINT_START_SHIFT) |
1265 (critical_point2 << RS400_DISP2_CRITICAL_POINT_STOP_SHIFT)));
1266#endif
1267 WREG32(RS400_DISP2_REQ_CNTL1, 0x105DC1CC);
1268 WREG32(RS400_DISP2_REQ_CNTL2, 0x2749D000);
1269 WREG32(RS400_DMIF_MEM_CNTL1, 0x29CA71DC);
1270 WREG32(RS400_DISP1_REQ_CNTL1, 0x28FBC3AC);
1271 }
1272
1273 DRM_DEBUG("GRPH2_BUFFER_CNTL from to %x\n",
1274 (unsigned int)RREG32(RADEON_GRPH2_BUFFER_CNTL));
1275 }
1276}
diff --git a/drivers/gpu/drm/radeon/radeon_legacy_encoders.c b/drivers/gpu/drm/radeon/radeon_legacy_encoders.c
index 2c2f42de1d4c..34d0f58eb944 100644
--- a/drivers/gpu/drm/radeon/radeon_legacy_encoders.c
+++ b/drivers/gpu/drm/radeon/radeon_legacy_encoders.c
@@ -30,170 +30,6 @@
30#include "atom.h" 30#include "atom.h"
31 31
32 32
33static void radeon_legacy_rmx_mode_set(struct drm_encoder *encoder,
34 struct drm_display_mode *mode,
35 struct drm_display_mode *adjusted_mode)
36{
37 struct drm_device *dev = encoder->dev;
38 struct radeon_device *rdev = dev->dev_private;
39 struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder);
40 int xres = mode->hdisplay;
41 int yres = mode->vdisplay;
42 bool hscale = true, vscale = true;
43 int hsync_wid;
44 int vsync_wid;
45 int hsync_start;
46 uint32_t scale, inc;
47 uint32_t fp_horz_stretch, fp_vert_stretch, crtc_more_cntl, fp_horz_vert_active;
48 uint32_t fp_h_sync_strt_wid, fp_v_sync_strt_wid, fp_crtc_h_total_disp, fp_crtc_v_total_disp;
49 struct radeon_native_mode *native_mode = &radeon_encoder->native_mode;
50
51 DRM_DEBUG("\n");
52
53 fp_vert_stretch = RREG32(RADEON_FP_VERT_STRETCH) &
54 (RADEON_VERT_STRETCH_RESERVED |
55 RADEON_VERT_AUTO_RATIO_INC);
56 fp_horz_stretch = RREG32(RADEON_FP_HORZ_STRETCH) &
57 (RADEON_HORZ_FP_LOOP_STRETCH |
58 RADEON_HORZ_AUTO_RATIO_INC);
59
60 crtc_more_cntl = 0;
61 if ((rdev->family == CHIP_RS100) ||
62 (rdev->family == CHIP_RS200)) {
63 /* This is to workaround the asic bug for RMX, some versions
64 of BIOS dosen't have this register initialized correctly. */
65 crtc_more_cntl |= RADEON_CRTC_H_CUTOFF_ACTIVE_EN;
66 }
67
68
69 fp_crtc_h_total_disp = ((((mode->crtc_htotal / 8) - 1) & 0x3ff)
70 | ((((mode->crtc_hdisplay / 8) - 1) & 0x1ff) << 16));
71
72 hsync_wid = (mode->crtc_hsync_end - mode->crtc_hsync_start) / 8;
73 if (!hsync_wid)
74 hsync_wid = 1;
75 hsync_start = mode->crtc_hsync_start - 8;
76
77 fp_h_sync_strt_wid = ((hsync_start & 0x1fff)
78 | ((hsync_wid & 0x3f) << 16)
79 | ((mode->flags & DRM_MODE_FLAG_NHSYNC)
80 ? RADEON_CRTC_H_SYNC_POL
81 : 0));
82
83 fp_crtc_v_total_disp = (((mode->crtc_vtotal - 1) & 0xffff)
84 | ((mode->crtc_vdisplay - 1) << 16));
85
86 vsync_wid = mode->crtc_vsync_end - mode->crtc_vsync_start;
87 if (!vsync_wid)
88 vsync_wid = 1;
89
90 fp_v_sync_strt_wid = (((mode->crtc_vsync_start - 1) & 0xfff)
91 | ((vsync_wid & 0x1f) << 16)
92 | ((mode->flags & DRM_MODE_FLAG_NVSYNC)
93 ? RADEON_CRTC_V_SYNC_POL
94 : 0));
95
96 fp_horz_vert_active = 0;
97
98 if (native_mode->panel_xres == 0 ||
99 native_mode->panel_yres == 0) {
100 hscale = false;
101 vscale = false;
102 } else {
103 if (xres > native_mode->panel_xres)
104 xres = native_mode->panel_xres;
105 if (yres > native_mode->panel_yres)
106 yres = native_mode->panel_yres;
107
108 if (xres == native_mode->panel_xres)
109 hscale = false;
110 if (yres == native_mode->panel_yres)
111 vscale = false;
112 }
113
114 if (radeon_encoder->flags & RADEON_USE_RMX) {
115 if (radeon_encoder->rmx_type != RMX_CENTER) {
116 if (!hscale)
117 fp_horz_stretch |= ((xres/8-1) << 16);
118 else {
119 inc = (fp_horz_stretch & RADEON_HORZ_AUTO_RATIO_INC) ? 1 : 0;
120 scale = ((xres + inc) * RADEON_HORZ_STRETCH_RATIO_MAX)
121 / native_mode->panel_xres + 1;
122 fp_horz_stretch |= (((scale) & RADEON_HORZ_STRETCH_RATIO_MASK) |
123 RADEON_HORZ_STRETCH_BLEND |
124 RADEON_HORZ_STRETCH_ENABLE |
125 ((native_mode->panel_xres/8-1) << 16));
126 }
127
128 if (!vscale)
129 fp_vert_stretch |= ((yres-1) << 12);
130 else {
131 inc = (fp_vert_stretch & RADEON_VERT_AUTO_RATIO_INC) ? 1 : 0;
132 scale = ((yres + inc) * RADEON_VERT_STRETCH_RATIO_MAX)
133 / native_mode->panel_yres + 1;
134 fp_vert_stretch |= (((scale) & RADEON_VERT_STRETCH_RATIO_MASK) |
135 RADEON_VERT_STRETCH_ENABLE |
136 RADEON_VERT_STRETCH_BLEND |
137 ((native_mode->panel_yres-1) << 12));
138 }
139 } else if (radeon_encoder->rmx_type == RMX_CENTER) {
140 int blank_width;
141
142 fp_horz_stretch |= ((xres/8-1) << 16);
143 fp_vert_stretch |= ((yres-1) << 12);
144
145 crtc_more_cntl |= (RADEON_CRTC_AUTO_HORZ_CENTER_EN |
146 RADEON_CRTC_AUTO_VERT_CENTER_EN);
147
148 blank_width = (mode->crtc_hblank_end - mode->crtc_hblank_start) / 8;
149 if (blank_width > 110)
150 blank_width = 110;
151
152 fp_crtc_h_total_disp = (((blank_width) & 0x3ff)
153 | ((((mode->crtc_hdisplay / 8) - 1) & 0x1ff) << 16));
154
155 hsync_wid = (mode->crtc_hsync_end - mode->crtc_hsync_start) / 8;
156 if (!hsync_wid)
157 hsync_wid = 1;
158
159 fp_h_sync_strt_wid = ((((mode->crtc_hsync_start - mode->crtc_hblank_start) / 8) & 0x1fff)
160 | ((hsync_wid & 0x3f) << 16)
161 | ((mode->flags & DRM_MODE_FLAG_NHSYNC)
162 ? RADEON_CRTC_H_SYNC_POL
163 : 0));
164
165 fp_crtc_v_total_disp = (((mode->crtc_vblank_end - mode->crtc_vblank_start) & 0xffff)
166 | ((mode->crtc_vdisplay - 1) << 16));
167
168 vsync_wid = mode->crtc_vsync_end - mode->crtc_vsync_start;
169 if (!vsync_wid)
170 vsync_wid = 1;
171
172 fp_v_sync_strt_wid = ((((mode->crtc_vsync_start - mode->crtc_vblank_start) & 0xfff)
173 | ((vsync_wid & 0x1f) << 16)
174 | ((mode->flags & DRM_MODE_FLAG_NVSYNC)
175 ? RADEON_CRTC_V_SYNC_POL
176 : 0)));
177
178 fp_horz_vert_active = (((native_mode->panel_yres) & 0xfff) |
179 (((native_mode->panel_xres / 8) & 0x1ff) << 16));
180 }
181 } else {
182 fp_horz_stretch |= ((xres/8-1) << 16);
183 fp_vert_stretch |= ((yres-1) << 12);
184 }
185
186 WREG32(RADEON_FP_HORZ_STRETCH, fp_horz_stretch);
187 WREG32(RADEON_FP_VERT_STRETCH, fp_vert_stretch);
188 WREG32(RADEON_CRTC_MORE_CNTL, crtc_more_cntl);
189 WREG32(RADEON_FP_HORZ_VERT_ACTIVE, fp_horz_vert_active);
190 WREG32(RADEON_FP_H_SYNC_STRT_WID, fp_h_sync_strt_wid);
191 WREG32(RADEON_FP_V_SYNC_STRT_WID, fp_v_sync_strt_wid);
192 WREG32(RADEON_FP_CRTC_H_TOTAL_DISP, fp_crtc_h_total_disp);
193 WREG32(RADEON_FP_CRTC_V_TOTAL_DISP, fp_crtc_v_total_disp);
194
195}
196
197static void radeon_legacy_lvds_dpms(struct drm_encoder *encoder, int mode) 33static void radeon_legacy_lvds_dpms(struct drm_encoder *encoder, int mode)
198{ 34{
199 struct drm_device *dev = encoder->dev; 35 struct drm_device *dev = encoder->dev;
@@ -287,9 +123,6 @@ static void radeon_legacy_lvds_mode_set(struct drm_encoder *encoder,
287 123
288 DRM_DEBUG("\n"); 124 DRM_DEBUG("\n");
289 125
290 if (radeon_crtc->crtc_id == 0)
291 radeon_legacy_rmx_mode_set(encoder, mode, adjusted_mode);
292
293 lvds_pll_cntl = RREG32(RADEON_LVDS_PLL_CNTL); 126 lvds_pll_cntl = RREG32(RADEON_LVDS_PLL_CNTL);
294 lvds_pll_cntl &= ~RADEON_LVDS_PLL_EN; 127 lvds_pll_cntl &= ~RADEON_LVDS_PLL_EN;
295 128
@@ -318,7 +151,7 @@ static void radeon_legacy_lvds_mode_set(struct drm_encoder *encoder,
318 151
319 if (radeon_crtc->crtc_id == 0) { 152 if (radeon_crtc->crtc_id == 0) {
320 if (ASIC_IS_R300(rdev)) { 153 if (ASIC_IS_R300(rdev)) {
321 if (radeon_encoder->flags & RADEON_USE_RMX) 154 if (radeon_encoder->rmx_type != RMX_OFF)
322 lvds_pll_cntl |= R300_LVDS_SRC_SEL_RMX; 155 lvds_pll_cntl |= R300_LVDS_SRC_SEL_RMX;
323 } else 156 } else
324 lvds_gen_cntl &= ~RADEON_LVDS_SEL_CRTC2; 157 lvds_gen_cntl &= ~RADEON_LVDS_SEL_CRTC2;
@@ -350,8 +183,6 @@ static bool radeon_legacy_lvds_mode_fixup(struct drm_encoder *encoder,
350 183
351 drm_mode_set_crtcinfo(adjusted_mode, 0); 184 drm_mode_set_crtcinfo(adjusted_mode, 0);
352 185
353 radeon_encoder->flags &= ~RADEON_USE_RMX;
354
355 if (radeon_encoder->rmx_type != RMX_OFF) 186 if (radeon_encoder->rmx_type != RMX_OFF)
356 radeon_rmx_mode_fixup(encoder, mode, adjusted_mode); 187 radeon_rmx_mode_fixup(encoder, mode, adjusted_mode);
357 188
@@ -455,9 +286,6 @@ static void radeon_legacy_primary_dac_mode_set(struct drm_encoder *encoder,
455 286
456 DRM_DEBUG("\n"); 287 DRM_DEBUG("\n");
457 288
458 if (radeon_crtc->crtc_id == 0)
459 radeon_legacy_rmx_mode_set(encoder, mode, adjusted_mode);
460
461 if (radeon_crtc->crtc_id == 0) { 289 if (radeon_crtc->crtc_id == 0) {
462 if (rdev->family == CHIP_R200 || ASIC_IS_R300(rdev)) { 290 if (rdev->family == CHIP_R200 || ASIC_IS_R300(rdev)) {
463 disp_output_cntl = RREG32(RADEON_DISP_OUTPUT_CNTL) & 291 disp_output_cntl = RREG32(RADEON_DISP_OUTPUT_CNTL) &
@@ -653,9 +481,6 @@ static void radeon_legacy_tmds_int_mode_set(struct drm_encoder *encoder,
653 481
654 DRM_DEBUG("\n"); 482 DRM_DEBUG("\n");
655 483
656 if (radeon_crtc->crtc_id == 0)
657 radeon_legacy_rmx_mode_set(encoder, mode, adjusted_mode);
658
659 tmp = tmds_pll_cntl = RREG32(RADEON_TMDS_PLL_CNTL); 484 tmp = tmds_pll_cntl = RREG32(RADEON_TMDS_PLL_CNTL);
660 tmp &= 0xfffff; 485 tmp &= 0xfffff;
661 if (rdev->family == CHIP_RV280) { 486 if (rdev->family == CHIP_RV280) {
@@ -711,7 +536,7 @@ static void radeon_legacy_tmds_int_mode_set(struct drm_encoder *encoder,
711 if (radeon_crtc->crtc_id == 0) { 536 if (radeon_crtc->crtc_id == 0) {
712 if (ASIC_IS_R300(rdev) || rdev->family == CHIP_R200) { 537 if (ASIC_IS_R300(rdev) || rdev->family == CHIP_R200) {
713 fp_gen_cntl &= ~R200_FP_SOURCE_SEL_MASK; 538 fp_gen_cntl &= ~R200_FP_SOURCE_SEL_MASK;
714 if (radeon_encoder->flags & RADEON_USE_RMX) 539 if (radeon_encoder->rmx_type != RMX_OFF)
715 fp_gen_cntl |= R200_FP_SOURCE_SEL_RMX; 540 fp_gen_cntl |= R200_FP_SOURCE_SEL_RMX;
716 else 541 else
717 fp_gen_cntl |= R200_FP_SOURCE_SEL_CRTC1; 542 fp_gen_cntl |= R200_FP_SOURCE_SEL_CRTC1;
@@ -820,9 +645,6 @@ static void radeon_legacy_tmds_ext_mode_set(struct drm_encoder *encoder,
820 645
821 DRM_DEBUG("\n"); 646 DRM_DEBUG("\n");
822 647
823 if (radeon_crtc->crtc_id == 0)
824 radeon_legacy_rmx_mode_set(encoder, mode, adjusted_mode);
825
826 if (rdev->is_atom_bios) { 648 if (rdev->is_atom_bios) {
827 radeon_encoder->pixel_clock = adjusted_mode->clock; 649 radeon_encoder->pixel_clock = adjusted_mode->clock;
828 atombios_external_tmds_setup(encoder, ATOM_ENABLE); 650 atombios_external_tmds_setup(encoder, ATOM_ENABLE);
@@ -856,7 +678,7 @@ static void radeon_legacy_tmds_ext_mode_set(struct drm_encoder *encoder,
856 if (radeon_crtc->crtc_id == 0) { 678 if (radeon_crtc->crtc_id == 0) {
857 if ((rdev->family == CHIP_R200) || ASIC_IS_R300(rdev)) { 679 if ((rdev->family == CHIP_R200) || ASIC_IS_R300(rdev)) {
858 fp2_gen_cntl &= ~R200_FP2_SOURCE_SEL_MASK; 680 fp2_gen_cntl &= ~R200_FP2_SOURCE_SEL_MASK;
859 if (radeon_encoder->flags & RADEON_USE_RMX) 681 if (radeon_encoder->rmx_type != RMX_OFF)
860 fp2_gen_cntl |= R200_FP2_SOURCE_SEL_RMX; 682 fp2_gen_cntl |= R200_FP2_SOURCE_SEL_RMX;
861 else 683 else
862 fp2_gen_cntl |= R200_FP2_SOURCE_SEL_CRTC1; 684 fp2_gen_cntl |= R200_FP2_SOURCE_SEL_CRTC1;
@@ -1014,9 +836,6 @@ static void radeon_legacy_tv_dac_mode_set(struct drm_encoder *encoder,
1014 836
1015 DRM_DEBUG("\n"); 837 DRM_DEBUG("\n");
1016 838
1017 if (radeon_crtc->crtc_id == 0)
1018 radeon_legacy_rmx_mode_set(encoder, mode, adjusted_mode);
1019
1020 if (rdev->family != CHIP_R200) { 839 if (rdev->family != CHIP_R200) {
1021 tv_dac_cntl = RREG32(RADEON_TV_DAC_CNTL); 840 tv_dac_cntl = RREG32(RADEON_TV_DAC_CNTL);
1022 if (rdev->family == CHIP_R420 || 841 if (rdev->family == CHIP_R420 ||
@@ -1243,6 +1062,7 @@ radeon_add_legacy_encoder(struct drm_device *dev, uint32_t encoder_id, uint32_t
1243 1062
1244 radeon_encoder->encoder_id = encoder_id; 1063 radeon_encoder->encoder_id = encoder_id;
1245 radeon_encoder->devices = supported_device; 1064 radeon_encoder->devices = supported_device;
1065 radeon_encoder->rmx_type = RMX_OFF;
1246 1066
1247 switch (radeon_encoder->encoder_id) { 1067 switch (radeon_encoder->encoder_id) {
1248 case ENCODER_OBJECT_ID_INTERNAL_LVDS: 1068 case ENCODER_OBJECT_ID_INTERNAL_LVDS:
diff --git a/drivers/gpu/drm/radeon/radeon_mode.h b/drivers/gpu/drm/radeon/radeon_mode.h
index 9173b687462b..3b09a1f2d8f9 100644
--- a/drivers/gpu/drm/radeon/radeon_mode.h
+++ b/drivers/gpu/drm/radeon/radeon_mode.h
@@ -36,6 +36,9 @@
36#include <linux/i2c.h> 36#include <linux/i2c.h>
37#include <linux/i2c-id.h> 37#include <linux/i2c-id.h>
38#include <linux/i2c-algo-bit.h> 38#include <linux/i2c-algo-bit.h>
39#include "radeon_fixed.h"
40
41struct radeon_device;
39 42
40#define to_radeon_crtc(x) container_of(x, struct radeon_crtc, base) 43#define to_radeon_crtc(x) container_of(x, struct radeon_crtc, base)
41#define to_radeon_connector(x) container_of(x, struct radeon_connector, base) 44#define to_radeon_connector(x) container_of(x, struct radeon_connector, base)
@@ -124,6 +127,7 @@ struct radeon_tmds_pll {
124#define RADEON_PLL_PREFER_LOW_POST_DIV (1 << 8) 127#define RADEON_PLL_PREFER_LOW_POST_DIV (1 << 8)
125#define RADEON_PLL_PREFER_HIGH_POST_DIV (1 << 9) 128#define RADEON_PLL_PREFER_HIGH_POST_DIV (1 << 9)
126#define RADEON_PLL_USE_FRAC_FB_DIV (1 << 10) 129#define RADEON_PLL_USE_FRAC_FB_DIV (1 << 10)
130#define RADEON_PLL_PREFER_CLOSEST_LOWER (1 << 11)
127 131
128struct radeon_pll { 132struct radeon_pll {
129 uint16_t reference_freq; 133 uint16_t reference_freq;
@@ -170,6 +174,18 @@ struct radeon_mode_info {
170 struct atom_context *atom_context; 174 struct atom_context *atom_context;
171 enum radeon_connector_table connector_table; 175 enum radeon_connector_table connector_table;
172 bool mode_config_initialized; 176 bool mode_config_initialized;
177 struct radeon_crtc *crtcs[2];
178};
179
180struct radeon_native_mode {
181 /* preferred mode */
182 uint32_t panel_xres, panel_yres;
183 uint32_t hoverplus, hsync_width;
184 uint32_t hblank;
185 uint32_t voverplus, vsync_width;
186 uint32_t vblank;
187 uint32_t dotclock;
188 uint32_t flags;
173}; 189};
174 190
175struct radeon_crtc { 191struct radeon_crtc {
@@ -185,19 +201,13 @@ struct radeon_crtc {
185 uint64_t cursor_addr; 201 uint64_t cursor_addr;
186 int cursor_width; 202 int cursor_width;
187 int cursor_height; 203 int cursor_height;
188}; 204 uint32_t legacy_display_base_addr;
189 205 uint32_t legacy_cursor_offset;
190#define RADEON_USE_RMX 1 206 enum radeon_rmx_type rmx_type;
191 207 uint32_t devices;
192struct radeon_native_mode { 208 fixed20_12 vsc;
193 /* preferred mode */ 209 fixed20_12 hsc;
194 uint32_t panel_xres, panel_yres; 210 struct radeon_native_mode native_mode;
195 uint32_t hoverplus, hsync_width;
196 uint32_t hblank;
197 uint32_t voverplus, vsync_width;
198 uint32_t vblank;
199 uint32_t dotclock;
200 uint32_t flags;
201}; 211};
202 212
203struct radeon_encoder_primary_dac { 213struct radeon_encoder_primary_dac {
@@ -383,16 +393,9 @@ void radeon_enc_destroy(struct drm_encoder *encoder);
383void radeon_copy_fb(struct drm_device *dev, struct drm_gem_object *dst_obj); 393void radeon_copy_fb(struct drm_device *dev, struct drm_gem_object *dst_obj);
384void radeon_combios_asic_init(struct drm_device *dev); 394void radeon_combios_asic_init(struct drm_device *dev);
385extern int radeon_static_clocks_init(struct drm_device *dev); 395extern int radeon_static_clocks_init(struct drm_device *dev);
386void radeon_init_disp_bw_legacy(struct drm_device *dev, 396bool radeon_crtc_scaling_mode_fixup(struct drm_crtc *crtc,
387 struct drm_display_mode *mode1, 397 struct drm_display_mode *mode,
388 uint32_t pixel_bytes1, 398 struct drm_display_mode *adjusted_mode);
389 struct drm_display_mode *mode2, 399void atom_rv515_force_tv_scaler(struct radeon_device *rdev);
390 uint32_t pixel_bytes2);
391void radeon_init_disp_bw_avivo(struct drm_device *dev,
392 struct drm_display_mode *mode1,
393 uint32_t pixel_bytes1,
394 struct drm_display_mode *mode2,
395 uint32_t pixel_bytes2);
396void radeon_init_disp_bandwidth(struct drm_device *dev);
397 400
398#endif 401#endif
diff --git a/drivers/gpu/drm/radeon/radeon_object.c b/drivers/gpu/drm/radeon/radeon_object.c
index 983e8df5e000..e98cae3bf4a6 100644
--- a/drivers/gpu/drm/radeon/radeon_object.c
+++ b/drivers/gpu/drm/radeon/radeon_object.c
@@ -44,6 +44,9 @@ struct radeon_object {
44 uint64_t gpu_addr; 44 uint64_t gpu_addr;
45 void *kptr; 45 void *kptr;
46 bool is_iomem; 46 bool is_iomem;
47 uint32_t tiling_flags;
48 uint32_t pitch;
49 int surface_reg;
47}; 50};
48 51
49int radeon_ttm_init(struct radeon_device *rdev); 52int radeon_ttm_init(struct radeon_device *rdev);
@@ -70,6 +73,7 @@ static void radeon_ttm_object_object_destroy(struct ttm_buffer_object *tobj)
70 73
71 robj = container_of(tobj, struct radeon_object, tobj); 74 robj = container_of(tobj, struct radeon_object, tobj);
72 list_del_init(&robj->list); 75 list_del_init(&robj->list);
76 radeon_object_clear_surface_reg(robj);
73 kfree(robj); 77 kfree(robj);
74} 78}
75 79
@@ -99,16 +103,16 @@ static inline uint32_t radeon_object_flags_from_domain(uint32_t domain)
99{ 103{
100 uint32_t flags = 0; 104 uint32_t flags = 0;
101 if (domain & RADEON_GEM_DOMAIN_VRAM) { 105 if (domain & RADEON_GEM_DOMAIN_VRAM) {
102 flags |= TTM_PL_FLAG_VRAM; 106 flags |= TTM_PL_FLAG_VRAM | TTM_PL_FLAG_WC | TTM_PL_FLAG_UNCACHED;
103 } 107 }
104 if (domain & RADEON_GEM_DOMAIN_GTT) { 108 if (domain & RADEON_GEM_DOMAIN_GTT) {
105 flags |= TTM_PL_FLAG_TT; 109 flags |= TTM_PL_FLAG_TT | TTM_PL_MASK_CACHING;
106 } 110 }
107 if (domain & RADEON_GEM_DOMAIN_CPU) { 111 if (domain & RADEON_GEM_DOMAIN_CPU) {
108 flags |= TTM_PL_FLAG_SYSTEM; 112 flags |= TTM_PL_FLAG_SYSTEM | TTM_PL_MASK_CACHING;
109 } 113 }
110 if (!flags) { 114 if (!flags) {
111 flags |= TTM_PL_FLAG_SYSTEM; 115 flags |= TTM_PL_FLAG_SYSTEM | TTM_PL_MASK_CACHING;
112 } 116 }
113 return flags; 117 return flags;
114} 118}
@@ -141,6 +145,7 @@ int radeon_object_create(struct radeon_device *rdev,
141 } 145 }
142 robj->rdev = rdev; 146 robj->rdev = rdev;
143 robj->gobj = gobj; 147 robj->gobj = gobj;
148 robj->surface_reg = -1;
144 INIT_LIST_HEAD(&robj->list); 149 INIT_LIST_HEAD(&robj->list);
145 150
146 flags = radeon_object_flags_from_domain(domain); 151 flags = radeon_object_flags_from_domain(domain);
@@ -223,7 +228,6 @@ int radeon_object_pin(struct radeon_object *robj, uint32_t domain,
223{ 228{
224 uint32_t flags; 229 uint32_t flags;
225 uint32_t tmp; 230 uint32_t tmp;
226 void *fbptr;
227 int r; 231 int r;
228 232
229 flags = radeon_object_flags_from_domain(domain); 233 flags = radeon_object_flags_from_domain(domain);
@@ -242,10 +246,6 @@ int radeon_object_pin(struct radeon_object *robj, uint32_t domain,
242 DRM_ERROR("radeon: failed to reserve object for pinning it.\n"); 246 DRM_ERROR("radeon: failed to reserve object for pinning it.\n");
243 return r; 247 return r;
244 } 248 }
245 if (robj->rdev->fbdev_robj == robj) {
246 mutex_lock(&robj->rdev->fbdev_info->lock);
247 radeon_object_kunmap(robj);
248 }
249 tmp = robj->tobj.mem.placement; 249 tmp = robj->tobj.mem.placement;
250 ttm_flag_masked(&tmp, flags, TTM_PL_MASK_MEM); 250 ttm_flag_masked(&tmp, flags, TTM_PL_MASK_MEM);
251 robj->tobj.proposed_placement = tmp | TTM_PL_FLAG_NO_EVICT | TTM_PL_MASK_CACHING; 251 robj->tobj.proposed_placement = tmp | TTM_PL_FLAG_NO_EVICT | TTM_PL_MASK_CACHING;
@@ -261,23 +261,12 @@ int radeon_object_pin(struct radeon_object *robj, uint32_t domain,
261 DRM_ERROR("radeon: failed to pin object.\n"); 261 DRM_ERROR("radeon: failed to pin object.\n");
262 } 262 }
263 radeon_object_unreserve(robj); 263 radeon_object_unreserve(robj);
264 if (robj->rdev->fbdev_robj == robj) {
265 if (!r) {
266 r = radeon_object_kmap(robj, &fbptr);
267 }
268 if (!r) {
269 robj->rdev->fbdev_info->screen_base = fbptr;
270 robj->rdev->fbdev_info->fix.smem_start = (unsigned long)fbptr;
271 }
272 mutex_unlock(&robj->rdev->fbdev_info->lock);
273 }
274 return r; 264 return r;
275} 265}
276 266
277void radeon_object_unpin(struct radeon_object *robj) 267void radeon_object_unpin(struct radeon_object *robj)
278{ 268{
279 uint32_t flags; 269 uint32_t flags;
280 void *fbptr;
281 int r; 270 int r;
282 271
283 spin_lock(&robj->tobj.lock); 272 spin_lock(&robj->tobj.lock);
@@ -297,10 +286,6 @@ void radeon_object_unpin(struct radeon_object *robj)
297 DRM_ERROR("radeon: failed to reserve object for unpinning it.\n"); 286 DRM_ERROR("radeon: failed to reserve object for unpinning it.\n");
298 return; 287 return;
299 } 288 }
300 if (robj->rdev->fbdev_robj == robj) {
301 mutex_lock(&robj->rdev->fbdev_info->lock);
302 radeon_object_kunmap(robj);
303 }
304 flags = robj->tobj.mem.placement; 289 flags = robj->tobj.mem.placement;
305 robj->tobj.proposed_placement = flags & ~TTM_PL_FLAG_NO_EVICT; 290 robj->tobj.proposed_placement = flags & ~TTM_PL_FLAG_NO_EVICT;
306 r = ttm_buffer_object_validate(&robj->tobj, 291 r = ttm_buffer_object_validate(&robj->tobj,
@@ -310,16 +295,6 @@ void radeon_object_unpin(struct radeon_object *robj)
310 DRM_ERROR("radeon: failed to unpin buffer.\n"); 295 DRM_ERROR("radeon: failed to unpin buffer.\n");
311 } 296 }
312 radeon_object_unreserve(robj); 297 radeon_object_unreserve(robj);
313 if (robj->rdev->fbdev_robj == robj) {
314 if (!r) {
315 r = radeon_object_kmap(robj, &fbptr);
316 }
317 if (!r) {
318 robj->rdev->fbdev_info->screen_base = fbptr;
319 robj->rdev->fbdev_info->fix.smem_start = (unsigned long)fbptr;
320 }
321 mutex_unlock(&robj->rdev->fbdev_info->lock);
322 }
323} 298}
324 299
325int radeon_object_wait(struct radeon_object *robj) 300int radeon_object_wait(struct radeon_object *robj)
@@ -334,7 +309,7 @@ int radeon_object_wait(struct radeon_object *robj)
334 } 309 }
335 spin_lock(&robj->tobj.lock); 310 spin_lock(&robj->tobj.lock);
336 if (robj->tobj.sync_obj) { 311 if (robj->tobj.sync_obj) {
337 r = ttm_bo_wait(&robj->tobj, true, false, false); 312 r = ttm_bo_wait(&robj->tobj, true, true, false);
338 } 313 }
339 spin_unlock(&robj->tobj.lock); 314 spin_unlock(&robj->tobj.lock);
340 radeon_object_unreserve(robj); 315 radeon_object_unreserve(robj);
@@ -433,7 +408,6 @@ int radeon_object_list_validate(struct list_head *head, void *fence)
433 struct radeon_object *robj; 408 struct radeon_object *robj;
434 struct radeon_fence *old_fence = NULL; 409 struct radeon_fence *old_fence = NULL;
435 struct list_head *i; 410 struct list_head *i;
436 uint32_t flags;
437 int r; 411 int r;
438 412
439 r = radeon_object_list_reserve(head); 413 r = radeon_object_list_reserve(head);
@@ -444,27 +418,25 @@ int radeon_object_list_validate(struct list_head *head, void *fence)
444 list_for_each(i, head) { 418 list_for_each(i, head) {
445 lobj = list_entry(i, struct radeon_object_list, list); 419 lobj = list_entry(i, struct radeon_object_list, list);
446 robj = lobj->robj; 420 robj = lobj->robj;
447 if (lobj->wdomain) {
448 flags = radeon_object_flags_from_domain(lobj->wdomain);
449 flags |= TTM_PL_FLAG_TT;
450 } else {
451 flags = radeon_object_flags_from_domain(lobj->rdomain);
452 flags |= TTM_PL_FLAG_TT;
453 flags |= TTM_PL_FLAG_VRAM;
454 }
455 if (!robj->pin_count) { 421 if (!robj->pin_count) {
456 robj->tobj.proposed_placement = flags | TTM_PL_MASK_CACHING; 422 if (lobj->wdomain) {
423 robj->tobj.proposed_placement =
424 radeon_object_flags_from_domain(lobj->wdomain);
425 } else {
426 robj->tobj.proposed_placement =
427 radeon_object_flags_from_domain(lobj->rdomain);
428 }
457 r = ttm_buffer_object_validate(&robj->tobj, 429 r = ttm_buffer_object_validate(&robj->tobj,
458 robj->tobj.proposed_placement, 430 robj->tobj.proposed_placement,
459 true, false); 431 true, false);
460 if (unlikely(r)) { 432 if (unlikely(r)) {
461 radeon_object_list_unreserve(head);
462 DRM_ERROR("radeon: failed to validate.\n"); 433 DRM_ERROR("radeon: failed to validate.\n");
463 return r; 434 return r;
464 } 435 }
465 radeon_object_gpu_addr(robj); 436 radeon_object_gpu_addr(robj);
466 } 437 }
467 lobj->gpu_offset = robj->gpu_addr; 438 lobj->gpu_offset = robj->gpu_addr;
439 lobj->tiling_flags = robj->tiling_flags;
468 if (fence) { 440 if (fence) {
469 old_fence = (struct radeon_fence *)robj->tobj.sync_obj; 441 old_fence = (struct radeon_fence *)robj->tobj.sync_obj;
470 robj->tobj.sync_obj = radeon_fence_ref(fence); 442 robj->tobj.sync_obj = radeon_fence_ref(fence);
@@ -509,3 +481,127 @@ unsigned long radeon_object_size(struct radeon_object *robj)
509{ 481{
510 return robj->tobj.num_pages << PAGE_SHIFT; 482 return robj->tobj.num_pages << PAGE_SHIFT;
511} 483}
484
485int radeon_object_get_surface_reg(struct radeon_object *robj)
486{
487 struct radeon_device *rdev = robj->rdev;
488 struct radeon_surface_reg *reg;
489 struct radeon_object *old_object;
490 int steal;
491 int i;
492
493 if (!robj->tiling_flags)
494 return 0;
495
496 if (robj->surface_reg >= 0) {
497 reg = &rdev->surface_regs[robj->surface_reg];
498 i = robj->surface_reg;
499 goto out;
500 }
501
502 steal = -1;
503 for (i = 0; i < RADEON_GEM_MAX_SURFACES; i++) {
504
505 reg = &rdev->surface_regs[i];
506 if (!reg->robj)
507 break;
508
509 old_object = reg->robj;
510 if (old_object->pin_count == 0)
511 steal = i;
512 }
513
514 /* if we are all out */
515 if (i == RADEON_GEM_MAX_SURFACES) {
516 if (steal == -1)
517 return -ENOMEM;
518 /* find someone with a surface reg and nuke their BO */
519 reg = &rdev->surface_regs[steal];
520 old_object = reg->robj;
521 /* blow away the mapping */
522 DRM_DEBUG("stealing surface reg %d from %p\n", steal, old_object);
523 ttm_bo_unmap_virtual(&old_object->tobj);
524 old_object->surface_reg = -1;
525 i = steal;
526 }
527
528 robj->surface_reg = i;
529 reg->robj = robj;
530
531out:
532 radeon_set_surface_reg(rdev, i, robj->tiling_flags, robj->pitch,
533 robj->tobj.mem.mm_node->start << PAGE_SHIFT,
534 robj->tobj.num_pages << PAGE_SHIFT);
535 return 0;
536}
537
538void radeon_object_clear_surface_reg(struct radeon_object *robj)
539{
540 struct radeon_device *rdev = robj->rdev;
541 struct radeon_surface_reg *reg;
542
543 if (robj->surface_reg == -1)
544 return;
545
546 reg = &rdev->surface_regs[robj->surface_reg];
547 radeon_clear_surface_reg(rdev, robj->surface_reg);
548
549 reg->robj = NULL;
550 robj->surface_reg = -1;
551}
552
553void radeon_object_set_tiling_flags(struct radeon_object *robj,
554 uint32_t tiling_flags, uint32_t pitch)
555{
556 robj->tiling_flags = tiling_flags;
557 robj->pitch = pitch;
558}
559
560void radeon_object_get_tiling_flags(struct radeon_object *robj,
561 uint32_t *tiling_flags,
562 uint32_t *pitch)
563{
564 if (tiling_flags)
565 *tiling_flags = robj->tiling_flags;
566 if (pitch)
567 *pitch = robj->pitch;
568}
569
570int radeon_object_check_tiling(struct radeon_object *robj, bool has_moved,
571 bool force_drop)
572{
573 if (!(robj->tiling_flags & RADEON_TILING_SURFACE))
574 return 0;
575
576 if (force_drop) {
577 radeon_object_clear_surface_reg(robj);
578 return 0;
579 }
580
581 if (robj->tobj.mem.mem_type != TTM_PL_VRAM) {
582 if (!has_moved)
583 return 0;
584
585 if (robj->surface_reg >= 0)
586 radeon_object_clear_surface_reg(robj);
587 return 0;
588 }
589
590 if ((robj->surface_reg >= 0) && !has_moved)
591 return 0;
592
593 return radeon_object_get_surface_reg(robj);
594}
595
596void radeon_bo_move_notify(struct ttm_buffer_object *bo,
597 struct ttm_mem_reg *mem)
598{
599 struct radeon_object *robj = container_of(bo, struct radeon_object, tobj);
600 radeon_object_check_tiling(robj, 0, 1);
601}
602
603void radeon_bo_fault_reserve_notify(struct ttm_buffer_object *bo)
604{
605 struct radeon_object *robj = container_of(bo, struct radeon_object, tobj);
606 radeon_object_check_tiling(robj, 0, 0);
607}
diff --git a/drivers/gpu/drm/radeon/radeon_ring.c b/drivers/gpu/drm/radeon/radeon_ring.c
index a853261d1881..60d159308b88 100644
--- a/drivers/gpu/drm/radeon/radeon_ring.c
+++ b/drivers/gpu/drm/radeon/radeon_ring.c
@@ -126,32 +126,19 @@ static void radeon_ib_align(struct radeon_device *rdev, struct radeon_ib *ib)
126 } 126 }
127} 127}
128 128
129static void radeon_ib_cpu_flush(struct radeon_device *rdev,
130 struct radeon_ib *ib)
131{
132 unsigned long tmp;
133 unsigned i;
134
135 /* To force CPU cache flush ugly but seems reliable */
136 for (i = 0; i < ib->length_dw; i += (rdev->cp.align_mask + 1)) {
137 tmp = readl(&ib->ptr[i]);
138 }
139}
140
141int radeon_ib_schedule(struct radeon_device *rdev, struct radeon_ib *ib) 129int radeon_ib_schedule(struct radeon_device *rdev, struct radeon_ib *ib)
142{ 130{
143 int r = 0; 131 int r = 0;
144 132
145 mutex_lock(&rdev->ib_pool.mutex); 133 mutex_lock(&rdev->ib_pool.mutex);
146 radeon_ib_align(rdev, ib); 134 radeon_ib_align(rdev, ib);
147 radeon_ib_cpu_flush(rdev, ib);
148 if (!ib->length_dw || !rdev->cp.ready) { 135 if (!ib->length_dw || !rdev->cp.ready) {
149 /* TODO: Nothings in the ib we should report. */ 136 /* TODO: Nothings in the ib we should report. */
150 mutex_unlock(&rdev->ib_pool.mutex); 137 mutex_unlock(&rdev->ib_pool.mutex);
151 DRM_ERROR("radeon: couldn't schedule IB(%lu).\n", ib->idx); 138 DRM_ERROR("radeon: couldn't schedule IB(%lu).\n", ib->idx);
152 return -EINVAL; 139 return -EINVAL;
153 } 140 }
154 /* 64 dwords should be enought for fence too */ 141 /* 64 dwords should be enough for fence too */
155 r = radeon_ring_lock(rdev, 64); 142 r = radeon_ring_lock(rdev, 64);
156 if (r) { 143 if (r) {
157 DRM_ERROR("radeon: scheduling IB failled (%d).\n", r); 144 DRM_ERROR("radeon: scheduling IB failled (%d).\n", r);
diff --git a/drivers/gpu/drm/radeon/radeon_share.h b/drivers/gpu/drm/radeon/radeon_share.h
new file mode 100644
index 000000000000..63a773578f17
--- /dev/null
+++ b/drivers/gpu/drm/radeon/radeon_share.h
@@ -0,0 +1,39 @@
1/*
2 * Copyright 2008 Advanced Micro Devices, Inc.
3 * Copyright 2008 Red Hat Inc.
4 * Copyright 2009 Jerome Glisse.
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * copy of this software and associated documentation files (the "Software"),
8 * to deal in the Software without restriction, including without limitation
9 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
10 * and/or sell copies of the Software, and to permit persons to whom the
11 * Software is furnished to do so, subject to the following conditions:
12 *
13 * The above copyright notice and this permission notice shall be included in
14 * all copies or substantial portions of the Software.
15 *
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19 * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
20 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
21 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22 * OTHER DEALINGS IN THE SOFTWARE.
23 *
24 * Authors: Dave Airlie
25 * Alex Deucher
26 * Jerome Glisse
27 */
28#ifndef __RADEON_SHARE_H__
29#define __RADEON_SHARE_H__
30
31void r100_vram_init_sizes(struct radeon_device *rdev);
32
33void rs690_line_buffer_adjust(struct radeon_device *rdev,
34 struct drm_display_mode *mode1,
35 struct drm_display_mode *mode2);
36
37void rv515_bandwidth_avivo_update(struct radeon_device *rdev);
38
39#endif
diff --git a/drivers/gpu/drm/radeon/radeon_test.c b/drivers/gpu/drm/radeon/radeon_test.c
new file mode 100644
index 000000000000..03c33cf4e14c
--- /dev/null
+++ b/drivers/gpu/drm/radeon/radeon_test.c
@@ -0,0 +1,209 @@
1/*
2 * Copyright 2009 VMware, Inc.
3 *
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
10 *
11 * The above copyright notice and this permission notice shall be included in
12 * all copies or substantial portions of the Software.
13 *
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17 * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
18 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
19 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
20 * OTHER DEALINGS IN THE SOFTWARE.
21 *
22 * Authors: Michel Dänzer
23 */
24#include <drm/drmP.h>
25#include <drm/radeon_drm.h>
26#include "radeon_reg.h"
27#include "radeon.h"
28
29
30/* Test BO GTT->VRAM and VRAM->GTT GPU copies across the whole GTT aperture */
31void radeon_test_moves(struct radeon_device *rdev)
32{
33 struct radeon_object *vram_obj = NULL;
34 struct radeon_object **gtt_obj = NULL;
35 struct radeon_fence *fence = NULL;
36 uint64_t gtt_addr, vram_addr;
37 unsigned i, n, size;
38 int r;
39
40 size = 1024 * 1024;
41
42 /* Number of tests =
43 * (Total GTT - IB pool - writeback page - ring buffer) / test size
44 */
45 n = (rdev->mc.gtt_size - RADEON_IB_POOL_SIZE*64*1024 - 4096 -
46 rdev->cp.ring_size) / size;
47
48 gtt_obj = kzalloc(n * sizeof(*gtt_obj), GFP_KERNEL);
49 if (!gtt_obj) {
50 DRM_ERROR("Failed to allocate %d pointers\n", n);
51 r = 1;
52 goto out_cleanup;
53 }
54
55 r = radeon_object_create(rdev, NULL, size, true, RADEON_GEM_DOMAIN_VRAM,
56 false, &vram_obj);
57 if (r) {
58 DRM_ERROR("Failed to create VRAM object\n");
59 goto out_cleanup;
60 }
61
62 r = radeon_object_pin(vram_obj, RADEON_GEM_DOMAIN_VRAM, &vram_addr);
63 if (r) {
64 DRM_ERROR("Failed to pin VRAM object\n");
65 goto out_cleanup;
66 }
67
68 for (i = 0; i < n; i++) {
69 void *gtt_map, *vram_map;
70 void **gtt_start, **gtt_end;
71 void **vram_start, **vram_end;
72
73 r = radeon_object_create(rdev, NULL, size, true,
74 RADEON_GEM_DOMAIN_GTT, false, gtt_obj + i);
75 if (r) {
76 DRM_ERROR("Failed to create GTT object %d\n", i);
77 goto out_cleanup;
78 }
79
80 r = radeon_object_pin(gtt_obj[i], RADEON_GEM_DOMAIN_GTT, &gtt_addr);
81 if (r) {
82 DRM_ERROR("Failed to pin GTT object %d\n", i);
83 goto out_cleanup;
84 }
85
86 r = radeon_object_kmap(gtt_obj[i], &gtt_map);
87 if (r) {
88 DRM_ERROR("Failed to map GTT object %d\n", i);
89 goto out_cleanup;
90 }
91
92 for (gtt_start = gtt_map, gtt_end = gtt_map + size;
93 gtt_start < gtt_end;
94 gtt_start++)
95 *gtt_start = gtt_start;
96
97 radeon_object_kunmap(gtt_obj[i]);
98
99 r = radeon_fence_create(rdev, &fence);
100 if (r) {
101 DRM_ERROR("Failed to create GTT->VRAM fence %d\n", i);
102 goto out_cleanup;
103 }
104
105 r = radeon_copy(rdev, gtt_addr, vram_addr, size / 4096, fence);
106 if (r) {
107 DRM_ERROR("Failed GTT->VRAM copy %d\n", i);
108 goto out_cleanup;
109 }
110
111 r = radeon_fence_wait(fence, false);
112 if (r) {
113 DRM_ERROR("Failed to wait for GTT->VRAM fence %d\n", i);
114 goto out_cleanup;
115 }
116
117 radeon_fence_unref(&fence);
118
119 r = radeon_object_kmap(vram_obj, &vram_map);
120 if (r) {
121 DRM_ERROR("Failed to map VRAM object after copy %d\n", i);
122 goto out_cleanup;
123 }
124
125 for (gtt_start = gtt_map, gtt_end = gtt_map + size,
126 vram_start = vram_map, vram_end = vram_map + size;
127 vram_start < vram_end;
128 gtt_start++, vram_start++) {
129 if (*vram_start != gtt_start) {
130 DRM_ERROR("Incorrect GTT->VRAM copy %d: Got 0x%p, "
131 "expected 0x%p (GTT map 0x%p-0x%p)\n",
132 i, *vram_start, gtt_start, gtt_map,
133 gtt_end);
134 radeon_object_kunmap(vram_obj);
135 goto out_cleanup;
136 }
137 *vram_start = vram_start;
138 }
139
140 radeon_object_kunmap(vram_obj);
141
142 r = radeon_fence_create(rdev, &fence);
143 if (r) {
144 DRM_ERROR("Failed to create VRAM->GTT fence %d\n", i);
145 goto out_cleanup;
146 }
147
148 r = radeon_copy(rdev, vram_addr, gtt_addr, size / 4096, fence);
149 if (r) {
150 DRM_ERROR("Failed VRAM->GTT copy %d\n", i);
151 goto out_cleanup;
152 }
153
154 r = radeon_fence_wait(fence, false);
155 if (r) {
156 DRM_ERROR("Failed to wait for VRAM->GTT fence %d\n", i);
157 goto out_cleanup;
158 }
159
160 radeon_fence_unref(&fence);
161
162 r = radeon_object_kmap(gtt_obj[i], &gtt_map);
163 if (r) {
164 DRM_ERROR("Failed to map GTT object after copy %d\n", i);
165 goto out_cleanup;
166 }
167
168 for (gtt_start = gtt_map, gtt_end = gtt_map + size,
169 vram_start = vram_map, vram_end = vram_map + size;
170 gtt_start < gtt_end;
171 gtt_start++, vram_start++) {
172 if (*gtt_start != vram_start) {
173 DRM_ERROR("Incorrect VRAM->GTT copy %d: Got 0x%p, "
174 "expected 0x%p (VRAM map 0x%p-0x%p)\n",
175 i, *gtt_start, vram_start, vram_map,
176 vram_end);
177 radeon_object_kunmap(gtt_obj[i]);
178 goto out_cleanup;
179 }
180 }
181
182 radeon_object_kunmap(gtt_obj[i]);
183
184 DRM_INFO("Tested GTT->VRAM and VRAM->GTT copy for GTT offset 0x%llx\n",
185 gtt_addr - rdev->mc.gtt_location);
186 }
187
188out_cleanup:
189 if (vram_obj) {
190 radeon_object_unpin(vram_obj);
191 radeon_object_unref(&vram_obj);
192 }
193 if (gtt_obj) {
194 for (i = 0; i < n; i++) {
195 if (gtt_obj[i]) {
196 radeon_object_unpin(gtt_obj[i]);
197 radeon_object_unref(&gtt_obj[i]);
198 }
199 }
200 kfree(gtt_obj);
201 }
202 if (fence) {
203 radeon_fence_unref(&fence);
204 }
205 if (r) {
206 printk(KERN_WARNING "Error while testing BO move.\n");
207 }
208}
209
diff --git a/drivers/gpu/drm/radeon/radeon_ttm.c b/drivers/gpu/drm/radeon/radeon_ttm.c
index 1227a97f5169..15c3531377ed 100644
--- a/drivers/gpu/drm/radeon/radeon_ttm.c
+++ b/drivers/gpu/drm/radeon/radeon_ttm.c
@@ -355,23 +355,26 @@ static int radeon_bo_move(struct ttm_buffer_object *bo,
355 if (!rdev->cp.ready) { 355 if (!rdev->cp.ready) {
356 /* use memcpy */ 356 /* use memcpy */
357 DRM_ERROR("CP is not ready use memcpy.\n"); 357 DRM_ERROR("CP is not ready use memcpy.\n");
358 return ttm_bo_move_memcpy(bo, evict, no_wait, new_mem); 358 goto memcpy;
359 } 359 }
360 360
361 if (old_mem->mem_type == TTM_PL_VRAM && 361 if (old_mem->mem_type == TTM_PL_VRAM &&
362 new_mem->mem_type == TTM_PL_SYSTEM) { 362 new_mem->mem_type == TTM_PL_SYSTEM) {
363 return radeon_move_vram_ram(bo, evict, interruptible, 363 r = radeon_move_vram_ram(bo, evict, interruptible,
364 no_wait, new_mem); 364 no_wait, new_mem);
365 } else if (old_mem->mem_type == TTM_PL_SYSTEM && 365 } else if (old_mem->mem_type == TTM_PL_SYSTEM &&
366 new_mem->mem_type == TTM_PL_VRAM) { 366 new_mem->mem_type == TTM_PL_VRAM) {
367 return radeon_move_ram_vram(bo, evict, interruptible, 367 r = radeon_move_ram_vram(bo, evict, interruptible,
368 no_wait, new_mem); 368 no_wait, new_mem);
369 } else { 369 } else {
370 r = radeon_move_blit(bo, evict, no_wait, new_mem, old_mem); 370 r = radeon_move_blit(bo, evict, no_wait, new_mem, old_mem);
371 if (unlikely(r)) {
372 return r;
373 }
374 } 371 }
372
373 if (r) {
374memcpy:
375 r = ttm_bo_move_memcpy(bo, evict, no_wait, new_mem);
376 }
377
375 return r; 378 return r;
376} 379}
377 380
@@ -429,6 +432,8 @@ static struct ttm_bo_driver radeon_bo_driver = {
429 .sync_obj_flush = &radeon_sync_obj_flush, 432 .sync_obj_flush = &radeon_sync_obj_flush,
430 .sync_obj_unref = &radeon_sync_obj_unref, 433 .sync_obj_unref = &radeon_sync_obj_unref,
431 .sync_obj_ref = &radeon_sync_obj_ref, 434 .sync_obj_ref = &radeon_sync_obj_ref,
435 .move_notify = &radeon_bo_move_notify,
436 .fault_reserve_notify = &radeon_bo_fault_reserve_notify,
432}; 437};
433 438
434int radeon_ttm_init(struct radeon_device *rdev) 439int radeon_ttm_init(struct radeon_device *rdev)
@@ -442,13 +447,14 @@ int radeon_ttm_init(struct radeon_device *rdev)
442 /* No others user of address space so set it to 0 */ 447 /* No others user of address space so set it to 0 */
443 r = ttm_bo_device_init(&rdev->mman.bdev, 448 r = ttm_bo_device_init(&rdev->mman.bdev,
444 rdev->mman.mem_global_ref.object, 449 rdev->mman.mem_global_ref.object,
445 &radeon_bo_driver, DRM_FILE_PAGE_OFFSET); 450 &radeon_bo_driver, DRM_FILE_PAGE_OFFSET,
451 rdev->need_dma32);
446 if (r) { 452 if (r) {
447 DRM_ERROR("failed initializing buffer object driver(%d).\n", r); 453 DRM_ERROR("failed initializing buffer object driver(%d).\n", r);
448 return r; 454 return r;
449 } 455 }
450 r = ttm_bo_init_mm(&rdev->mman.bdev, TTM_PL_VRAM, 0, 456 r = ttm_bo_init_mm(&rdev->mman.bdev, TTM_PL_VRAM, 0,
451 ((rdev->mc.aper_size) >> PAGE_SHIFT)); 457 ((rdev->mc.real_vram_size) >> PAGE_SHIFT));
452 if (r) { 458 if (r) {
453 DRM_ERROR("Failed initializing VRAM heap.\n"); 459 DRM_ERROR("Failed initializing VRAM heap.\n");
454 return r; 460 return r;
@@ -465,7 +471,7 @@ int radeon_ttm_init(struct radeon_device *rdev)
465 return r; 471 return r;
466 } 472 }
467 DRM_INFO("radeon: %uM of VRAM memory ready\n", 473 DRM_INFO("radeon: %uM of VRAM memory ready\n",
468 rdev->mc.vram_size / (1024 * 1024)); 474 rdev->mc.real_vram_size / (1024 * 1024));
469 r = ttm_bo_init_mm(&rdev->mman.bdev, TTM_PL_TT, 0, 475 r = ttm_bo_init_mm(&rdev->mman.bdev, TTM_PL_TT, 0,
470 ((rdev->mc.gtt_size) >> PAGE_SHIFT)); 476 ((rdev->mc.gtt_size) >> PAGE_SHIFT));
471 if (r) { 477 if (r) {
diff --git a/drivers/gpu/drm/radeon/rs400.c b/drivers/gpu/drm/radeon/rs400.c
index cc074b5a8f74..b29affd9c5d8 100644
--- a/drivers/gpu/drm/radeon/rs400.c
+++ b/drivers/gpu/drm/radeon/rs400.c
@@ -29,6 +29,7 @@
29#include <drm/drmP.h> 29#include <drm/drmP.h>
30#include "radeon_reg.h" 30#include "radeon_reg.h"
31#include "radeon.h" 31#include "radeon.h"
32#include "radeon_share.h"
32 33
33/* rs400,rs480 depends on : */ 34/* rs400,rs480 depends on : */
34void r100_hdp_reset(struct radeon_device *rdev); 35void r100_hdp_reset(struct radeon_device *rdev);
@@ -164,7 +165,9 @@ int rs400_gart_enable(struct radeon_device *rdev)
164 WREG32(RADEON_BUS_CNTL, tmp); 165 WREG32(RADEON_BUS_CNTL, tmp);
165 } 166 }
166 /* Table should be in 32bits address space so ignore bits above. */ 167 /* Table should be in 32bits address space so ignore bits above. */
167 tmp = rdev->gart.table_addr & 0xfffff000; 168 tmp = (u32)rdev->gart.table_addr & 0xfffff000;
169 tmp |= (upper_32_bits(rdev->gart.table_addr) & 0xff) << 4;
170
168 WREG32_MC(RS480_GART_BASE, tmp); 171 WREG32_MC(RS480_GART_BASE, tmp);
169 /* TODO: more tweaking here */ 172 /* TODO: more tweaking here */
170 WREG32_MC(RS480_GART_FEATURE_ID, 173 WREG32_MC(RS480_GART_FEATURE_ID,
@@ -201,10 +204,17 @@ void rs400_gart_disable(struct radeon_device *rdev)
201 204
202int rs400_gart_set_page(struct radeon_device *rdev, int i, uint64_t addr) 205int rs400_gart_set_page(struct radeon_device *rdev, int i, uint64_t addr)
203{ 206{
207 uint32_t entry;
208
204 if (i < 0 || i > rdev->gart.num_gpu_pages) { 209 if (i < 0 || i > rdev->gart.num_gpu_pages) {
205 return -EINVAL; 210 return -EINVAL;
206 } 211 }
207 rdev->gart.table.ram.ptr[i] = cpu_to_le32(((uint32_t)addr) | 0xC); 212
213 entry = (lower_32_bits(addr) & PAGE_MASK) |
214 ((upper_32_bits(addr) & 0xff) << 4) |
215 0xc;
216 entry = cpu_to_le32(entry);
217 rdev->gart.table.ram.ptr[i] = entry;
208 return 0; 218 return 0;
209} 219}
210 220
@@ -223,10 +233,9 @@ int rs400_mc_init(struct radeon_device *rdev)
223 233
224 rs400_gpu_init(rdev); 234 rs400_gpu_init(rdev);
225 rs400_gart_disable(rdev); 235 rs400_gart_disable(rdev);
226 rdev->mc.gtt_location = rdev->mc.vram_size; 236 rdev->mc.gtt_location = rdev->mc.mc_vram_size;
227 rdev->mc.gtt_location += (rdev->mc.gtt_size - 1); 237 rdev->mc.gtt_location += (rdev->mc.gtt_size - 1);
228 rdev->mc.gtt_location &= ~(rdev->mc.gtt_size - 1); 238 rdev->mc.gtt_location &= ~(rdev->mc.gtt_size - 1);
229 rdev->mc.vram_location = 0xFFFFFFFFUL;
230 r = radeon_mc_setup(rdev); 239 r = radeon_mc_setup(rdev);
231 if (r) { 240 if (r) {
232 return r; 241 return r;
@@ -238,7 +247,7 @@ int rs400_mc_init(struct radeon_device *rdev)
238 "programming pipes. Bad things might happen.\n"); 247 "programming pipes. Bad things might happen.\n");
239 } 248 }
240 249
241 tmp = rdev->mc.vram_location + rdev->mc.vram_size - 1; 250 tmp = rdev->mc.vram_location + rdev->mc.mc_vram_size - 1;
242 tmp = REG_SET(RADEON_MC_FB_TOP, tmp >> 16); 251 tmp = REG_SET(RADEON_MC_FB_TOP, tmp >> 16);
243 tmp |= REG_SET(RADEON_MC_FB_START, rdev->mc.vram_location >> 16); 252 tmp |= REG_SET(RADEON_MC_FB_START, rdev->mc.vram_location >> 16);
244 WREG32(RADEON_MC_FB_LOCATION, tmp); 253 WREG32(RADEON_MC_FB_LOCATION, tmp);
@@ -284,21 +293,12 @@ void rs400_gpu_init(struct radeon_device *rdev)
284 */ 293 */
285void rs400_vram_info(struct radeon_device *rdev) 294void rs400_vram_info(struct radeon_device *rdev)
286{ 295{
287 uint32_t tom;
288
289 rs400_gart_adjust_size(rdev); 296 rs400_gart_adjust_size(rdev);
290 /* DDR for all card after R300 & IGP */ 297 /* DDR for all card after R300 & IGP */
291 rdev->mc.vram_is_ddr = true; 298 rdev->mc.vram_is_ddr = true;
292 rdev->mc.vram_width = 128; 299 rdev->mc.vram_width = 128;
293 300
294 /* read NB_TOM to get the amount of ram stolen for the GPU */ 301 r100_vram_init_sizes(rdev);
295 tom = RREG32(RADEON_NB_TOM);
296 rdev->mc.vram_size = (((tom >> 16) - (tom & 0xffff) + 1) << 16);
297 WREG32(RADEON_CONFIG_MEMSIZE, rdev->mc.vram_size);
298
299 /* Could aper size report 0 ? */
300 rdev->mc.aper_base = drm_get_resource_start(rdev->ddev, 0);
301 rdev->mc.aper_size = drm_get_resource_len(rdev->ddev, 0);
302} 302}
303 303
304 304
diff --git a/drivers/gpu/drm/radeon/rs600.c b/drivers/gpu/drm/radeon/rs600.c
index ab0c967553e6..bbea6dee4a94 100644
--- a/drivers/gpu/drm/radeon/rs600.c
+++ b/drivers/gpu/drm/radeon/rs600.c
@@ -223,7 +223,7 @@ int rs600_mc_init(struct radeon_device *rdev)
223 printk(KERN_WARNING "Failed to wait MC idle while " 223 printk(KERN_WARNING "Failed to wait MC idle while "
224 "programming pipes. Bad things might happen.\n"); 224 "programming pipes. Bad things might happen.\n");
225 } 225 }
226 tmp = rdev->mc.vram_location + rdev->mc.vram_size - 1; 226 tmp = rdev->mc.vram_location + rdev->mc.mc_vram_size - 1;
227 tmp = REG_SET(RS600_MC_FB_TOP, tmp >> 16); 227 tmp = REG_SET(RS600_MC_FB_TOP, tmp >> 16);
228 tmp |= REG_SET(RS600_MC_FB_START, rdev->mc.vram_location >> 16); 228 tmp |= REG_SET(RS600_MC_FB_START, rdev->mc.vram_location >> 16);
229 WREG32_MC(RS600_MC_FB_LOCATION, tmp); 229 WREG32_MC(RS600_MC_FB_LOCATION, tmp);
@@ -301,6 +301,11 @@ void rs600_vram_info(struct radeon_device *rdev)
301 rdev->mc.vram_width = 128; 301 rdev->mc.vram_width = 128;
302} 302}
303 303
304void rs600_bandwidth_update(struct radeon_device *rdev)
305{
306 /* FIXME: implement, should this be like rs690 ? */
307}
308
304 309
305/* 310/*
306 * Indirect registers accessor 311 * Indirect registers accessor
diff --git a/drivers/gpu/drm/radeon/rs690.c b/drivers/gpu/drm/radeon/rs690.c
index 79ba85042b5f..839595b00728 100644
--- a/drivers/gpu/drm/radeon/rs690.c
+++ b/drivers/gpu/drm/radeon/rs690.c
@@ -28,6 +28,9 @@
28#include "drmP.h" 28#include "drmP.h"
29#include "radeon_reg.h" 29#include "radeon_reg.h"
30#include "radeon.h" 30#include "radeon.h"
31#include "rs690r.h"
32#include "atom.h"
33#include "atom-bits.h"
31 34
32/* rs690,rs740 depends on : */ 35/* rs690,rs740 depends on : */
33void r100_hdp_reset(struct radeon_device *rdev); 36void r100_hdp_reset(struct radeon_device *rdev);
@@ -64,7 +67,7 @@ int rs690_mc_init(struct radeon_device *rdev)
64 rs400_gart_disable(rdev); 67 rs400_gart_disable(rdev);
65 68
66 /* Setup GPU memory space */ 69 /* Setup GPU memory space */
67 rdev->mc.gtt_location = rdev->mc.vram_size; 70 rdev->mc.gtt_location = rdev->mc.mc_vram_size;
68 rdev->mc.gtt_location += (rdev->mc.gtt_size - 1); 71 rdev->mc.gtt_location += (rdev->mc.gtt_size - 1);
69 rdev->mc.gtt_location &= ~(rdev->mc.gtt_size - 1); 72 rdev->mc.gtt_location &= ~(rdev->mc.gtt_size - 1);
70 rdev->mc.vram_location = 0xFFFFFFFFUL; 73 rdev->mc.vram_location = 0xFFFFFFFFUL;
@@ -79,7 +82,7 @@ int rs690_mc_init(struct radeon_device *rdev)
79 printk(KERN_WARNING "Failed to wait MC idle while " 82 printk(KERN_WARNING "Failed to wait MC idle while "
80 "programming pipes. Bad things might happen.\n"); 83 "programming pipes. Bad things might happen.\n");
81 } 84 }
82 tmp = rdev->mc.vram_location + rdev->mc.vram_size - 1; 85 tmp = rdev->mc.vram_location + rdev->mc.mc_vram_size - 1;
83 tmp = REG_SET(RS690_MC_FB_TOP, tmp >> 16); 86 tmp = REG_SET(RS690_MC_FB_TOP, tmp >> 16);
84 tmp |= REG_SET(RS690_MC_FB_START, rdev->mc.vram_location >> 16); 87 tmp |= REG_SET(RS690_MC_FB_START, rdev->mc.vram_location >> 16);
85 WREG32_MC(RS690_MCCFG_FB_LOCATION, tmp); 88 WREG32_MC(RS690_MCCFG_FB_LOCATION, tmp);
@@ -138,9 +141,82 @@ void rs690_gpu_init(struct radeon_device *rdev)
138/* 141/*
139 * VRAM info. 142 * VRAM info.
140 */ 143 */
144void rs690_pm_info(struct radeon_device *rdev)
145{
146 int index = GetIndexIntoMasterTable(DATA, IntegratedSystemInfo);
147 struct _ATOM_INTEGRATED_SYSTEM_INFO *info;
148 struct _ATOM_INTEGRATED_SYSTEM_INFO_V2 *info_v2;
149 void *ptr;
150 uint16_t data_offset;
151 uint8_t frev, crev;
152 fixed20_12 tmp;
153
154 atom_parse_data_header(rdev->mode_info.atom_context, index, NULL,
155 &frev, &crev, &data_offset);
156 ptr = rdev->mode_info.atom_context->bios + data_offset;
157 info = (struct _ATOM_INTEGRATED_SYSTEM_INFO *)ptr;
158 info_v2 = (struct _ATOM_INTEGRATED_SYSTEM_INFO_V2 *)ptr;
159 /* Get various system informations from bios */
160 switch (crev) {
161 case 1:
162 tmp.full = rfixed_const(100);
163 rdev->pm.igp_sideport_mclk.full = rfixed_const(info->ulBootUpMemoryClock);
164 rdev->pm.igp_sideport_mclk.full = rfixed_div(rdev->pm.igp_sideport_mclk, tmp);
165 rdev->pm.igp_system_mclk.full = rfixed_const(le16_to_cpu(info->usK8MemoryClock));
166 rdev->pm.igp_ht_link_clk.full = rfixed_const(le16_to_cpu(info->usFSBClock));
167 rdev->pm.igp_ht_link_width.full = rfixed_const(info->ucHTLinkWidth);
168 break;
169 case 2:
170 tmp.full = rfixed_const(100);
171 rdev->pm.igp_sideport_mclk.full = rfixed_const(info_v2->ulBootUpSidePortClock);
172 rdev->pm.igp_sideport_mclk.full = rfixed_div(rdev->pm.igp_sideport_mclk, tmp);
173 rdev->pm.igp_system_mclk.full = rfixed_const(info_v2->ulBootUpUMAClock);
174 rdev->pm.igp_system_mclk.full = rfixed_div(rdev->pm.igp_system_mclk, tmp);
175 rdev->pm.igp_ht_link_clk.full = rfixed_const(info_v2->ulHTLinkFreq);
176 rdev->pm.igp_ht_link_clk.full = rfixed_div(rdev->pm.igp_ht_link_clk, tmp);
177 rdev->pm.igp_ht_link_width.full = rfixed_const(le16_to_cpu(info_v2->usMinHTLinkWidth));
178 break;
179 default:
180 tmp.full = rfixed_const(100);
181 /* We assume the slower possible clock ie worst case */
182 /* DDR 333Mhz */
183 rdev->pm.igp_sideport_mclk.full = rfixed_const(333);
184 /* FIXME: system clock ? */
185 rdev->pm.igp_system_mclk.full = rfixed_const(100);
186 rdev->pm.igp_system_mclk.full = rfixed_div(rdev->pm.igp_system_mclk, tmp);
187 rdev->pm.igp_ht_link_clk.full = rfixed_const(200);
188 rdev->pm.igp_ht_link_width.full = rfixed_const(8);
189 DRM_ERROR("No integrated system info for your GPU, using safe default\n");
190 break;
191 }
192 /* Compute various bandwidth */
193 /* k8_bandwidth = (memory_clk / 2) * 2 * 8 * 0.5 = memory_clk * 4 */
194 tmp.full = rfixed_const(4);
195 rdev->pm.k8_bandwidth.full = rfixed_mul(rdev->pm.igp_system_mclk, tmp);
196 /* ht_bandwidth = ht_clk * 2 * ht_width / 8 * 0.8
197 * = ht_clk * ht_width / 5
198 */
199 tmp.full = rfixed_const(5);
200 rdev->pm.ht_bandwidth.full = rfixed_mul(rdev->pm.igp_ht_link_clk,
201 rdev->pm.igp_ht_link_width);
202 rdev->pm.ht_bandwidth.full = rfixed_div(rdev->pm.ht_bandwidth, tmp);
203 if (tmp.full < rdev->pm.max_bandwidth.full) {
204 /* HT link is a limiting factor */
205 rdev->pm.max_bandwidth.full = tmp.full;
206 }
207 /* sideport_bandwidth = (sideport_clk / 2) * 2 * 2 * 0.7
208 * = (sideport_clk * 14) / 10
209 */
210 tmp.full = rfixed_const(14);
211 rdev->pm.sideport_bandwidth.full = rfixed_mul(rdev->pm.igp_sideport_mclk, tmp);
212 tmp.full = rfixed_const(10);
213 rdev->pm.sideport_bandwidth.full = rfixed_div(rdev->pm.sideport_bandwidth, tmp);
214}
215
141void rs690_vram_info(struct radeon_device *rdev) 216void rs690_vram_info(struct radeon_device *rdev)
142{ 217{
143 uint32_t tmp; 218 uint32_t tmp;
219 fixed20_12 a;
144 220
145 rs400_gart_adjust_size(rdev); 221 rs400_gart_adjust_size(rdev);
146 /* DDR for all card after R300 & IGP */ 222 /* DDR for all card after R300 & IGP */
@@ -152,12 +228,409 @@ void rs690_vram_info(struct radeon_device *rdev)
152 } else { 228 } else {
153 rdev->mc.vram_width = 64; 229 rdev->mc.vram_width = 64;
154 } 230 }
155 rdev->mc.vram_size = RREG32(RADEON_CONFIG_MEMSIZE); 231 rdev->mc.real_vram_size = RREG32(RADEON_CONFIG_MEMSIZE);
232 rdev->mc.mc_vram_size = rdev->mc.real_vram_size;
156 233
157 rdev->mc.aper_base = drm_get_resource_start(rdev->ddev, 0); 234 rdev->mc.aper_base = drm_get_resource_start(rdev->ddev, 0);
158 rdev->mc.aper_size = drm_get_resource_len(rdev->ddev, 0); 235 rdev->mc.aper_size = drm_get_resource_len(rdev->ddev, 0);
236 rs690_pm_info(rdev);
237 /* FIXME: we should enforce default clock in case GPU is not in
238 * default setup
239 */
240 a.full = rfixed_const(100);
241 rdev->pm.sclk.full = rfixed_const(rdev->clock.default_sclk);
242 rdev->pm.sclk.full = rfixed_div(rdev->pm.sclk, a);
243 a.full = rfixed_const(16);
244 /* core_bandwidth = sclk(Mhz) * 16 */
245 rdev->pm.core_bandwidth.full = rfixed_div(rdev->pm.sclk, a);
246}
247
248void rs690_line_buffer_adjust(struct radeon_device *rdev,
249 struct drm_display_mode *mode1,
250 struct drm_display_mode *mode2)
251{
252 u32 tmp;
253
254 /*
255 * Line Buffer Setup
256 * There is a single line buffer shared by both display controllers.
257 * DC_LB_MEMORY_SPLIT controls how that line buffer is shared between
258 * the display controllers. The paritioning can either be done
259 * manually or via one of four preset allocations specified in bits 1:0:
260 * 0 - line buffer is divided in half and shared between crtc
261 * 1 - D1 gets 3/4 of the line buffer, D2 gets 1/4
262 * 2 - D1 gets the whole buffer
263 * 3 - D1 gets 1/4 of the line buffer, D2 gets 3/4
264 * Setting bit 2 of DC_LB_MEMORY_SPLIT controls switches to manual
265 * allocation mode. In manual allocation mode, D1 always starts at 0,
266 * D1 end/2 is specified in bits 14:4; D2 allocation follows D1.
267 */
268 tmp = RREG32(DC_LB_MEMORY_SPLIT) & ~DC_LB_MEMORY_SPLIT_MASK;
269 tmp &= ~DC_LB_MEMORY_SPLIT_SHIFT_MODE;
270 /* auto */
271 if (mode1 && mode2) {
272 if (mode1->hdisplay > mode2->hdisplay) {
273 if (mode1->hdisplay > 2560)
274 tmp |= DC_LB_MEMORY_SPLIT_D1_3Q_D2_1Q;
275 else
276 tmp |= DC_LB_MEMORY_SPLIT_D1HALF_D2HALF;
277 } else if (mode2->hdisplay > mode1->hdisplay) {
278 if (mode2->hdisplay > 2560)
279 tmp |= DC_LB_MEMORY_SPLIT_D1_1Q_D2_3Q;
280 else
281 tmp |= DC_LB_MEMORY_SPLIT_D1HALF_D2HALF;
282 } else
283 tmp |= AVIVO_DC_LB_MEMORY_SPLIT_D1HALF_D2HALF;
284 } else if (mode1) {
285 tmp |= DC_LB_MEMORY_SPLIT_D1_ONLY;
286 } else if (mode2) {
287 tmp |= DC_LB_MEMORY_SPLIT_D1_1Q_D2_3Q;
288 }
289 WREG32(DC_LB_MEMORY_SPLIT, tmp);
159} 290}
160 291
292struct rs690_watermark {
293 u32 lb_request_fifo_depth;
294 fixed20_12 num_line_pair;
295 fixed20_12 estimated_width;
296 fixed20_12 worst_case_latency;
297 fixed20_12 consumption_rate;
298 fixed20_12 active_time;
299 fixed20_12 dbpp;
300 fixed20_12 priority_mark_max;
301 fixed20_12 priority_mark;
302 fixed20_12 sclk;
303};
304
305void rs690_crtc_bandwidth_compute(struct radeon_device *rdev,
306 struct radeon_crtc *crtc,
307 struct rs690_watermark *wm)
308{
309 struct drm_display_mode *mode = &crtc->base.mode;
310 fixed20_12 a, b, c;
311 fixed20_12 pclk, request_fifo_depth, tolerable_latency, estimated_width;
312 fixed20_12 consumption_time, line_time, chunk_time, read_delay_latency;
313 /* FIXME: detect IGP with sideport memory, i don't think there is any
314 * such product available
315 */
316 bool sideport = false;
317
318 if (!crtc->base.enabled) {
319 /* FIXME: wouldn't it better to set priority mark to maximum */
320 wm->lb_request_fifo_depth = 4;
321 return;
322 }
323
324 if (crtc->vsc.full > rfixed_const(2))
325 wm->num_line_pair.full = rfixed_const(2);
326 else
327 wm->num_line_pair.full = rfixed_const(1);
328
329 b.full = rfixed_const(mode->crtc_hdisplay);
330 c.full = rfixed_const(256);
331 a.full = rfixed_mul(wm->num_line_pair, b);
332 request_fifo_depth.full = rfixed_div(a, c);
333 if (a.full < rfixed_const(4)) {
334 wm->lb_request_fifo_depth = 4;
335 } else {
336 wm->lb_request_fifo_depth = rfixed_trunc(request_fifo_depth);
337 }
338
339 /* Determine consumption rate
340 * pclk = pixel clock period(ns) = 1000 / (mode.clock / 1000)
341 * vtaps = number of vertical taps,
342 * vsc = vertical scaling ratio, defined as source/destination
343 * hsc = horizontal scaling ration, defined as source/destination
344 */
345 a.full = rfixed_const(mode->clock);
346 b.full = rfixed_const(1000);
347 a.full = rfixed_div(a, b);
348 pclk.full = rfixed_div(b, a);
349 if (crtc->rmx_type != RMX_OFF) {
350 b.full = rfixed_const(2);
351 if (crtc->vsc.full > b.full)
352 b.full = crtc->vsc.full;
353 b.full = rfixed_mul(b, crtc->hsc);
354 c.full = rfixed_const(2);
355 b.full = rfixed_div(b, c);
356 consumption_time.full = rfixed_div(pclk, b);
357 } else {
358 consumption_time.full = pclk.full;
359 }
360 a.full = rfixed_const(1);
361 wm->consumption_rate.full = rfixed_div(a, consumption_time);
362
363
364 /* Determine line time
365 * LineTime = total time for one line of displayhtotal
366 * LineTime = total number of horizontal pixels
367 * pclk = pixel clock period(ns)
368 */
369 a.full = rfixed_const(crtc->base.mode.crtc_htotal);
370 line_time.full = rfixed_mul(a, pclk);
371
372 /* Determine active time
373 * ActiveTime = time of active region of display within one line,
374 * hactive = total number of horizontal active pixels
375 * htotal = total number of horizontal pixels
376 */
377 a.full = rfixed_const(crtc->base.mode.crtc_htotal);
378 b.full = rfixed_const(crtc->base.mode.crtc_hdisplay);
379 wm->active_time.full = rfixed_mul(line_time, b);
380 wm->active_time.full = rfixed_div(wm->active_time, a);
381
382 /* Maximun bandwidth is the minimun bandwidth of all component */
383 rdev->pm.max_bandwidth = rdev->pm.core_bandwidth;
384 if (sideport) {
385 if (rdev->pm.max_bandwidth.full > rdev->pm.sideport_bandwidth.full &&
386 rdev->pm.sideport_bandwidth.full)
387 rdev->pm.max_bandwidth = rdev->pm.sideport_bandwidth;
388 read_delay_latency.full = rfixed_const(370 * 800 * 1000);
389 read_delay_latency.full = rfixed_div(read_delay_latency,
390 rdev->pm.igp_sideport_mclk);
391 } else {
392 if (rdev->pm.max_bandwidth.full > rdev->pm.k8_bandwidth.full &&
393 rdev->pm.k8_bandwidth.full)
394 rdev->pm.max_bandwidth = rdev->pm.k8_bandwidth;
395 if (rdev->pm.max_bandwidth.full > rdev->pm.ht_bandwidth.full &&
396 rdev->pm.ht_bandwidth.full)
397 rdev->pm.max_bandwidth = rdev->pm.ht_bandwidth;
398 read_delay_latency.full = rfixed_const(5000);
399 }
400
401 /* sclk = system clocks(ns) = 1000 / max_bandwidth / 16 */
402 a.full = rfixed_const(16);
403 rdev->pm.sclk.full = rfixed_mul(rdev->pm.max_bandwidth, a);
404 a.full = rfixed_const(1000);
405 rdev->pm.sclk.full = rfixed_div(a, rdev->pm.sclk);
406 /* Determine chunk time
407 * ChunkTime = the time it takes the DCP to send one chunk of data
408 * to the LB which consists of pipeline delay and inter chunk gap
409 * sclk = system clock(ns)
410 */
411 a.full = rfixed_const(256 * 13);
412 chunk_time.full = rfixed_mul(rdev->pm.sclk, a);
413 a.full = rfixed_const(10);
414 chunk_time.full = rfixed_div(chunk_time, a);
415
416 /* Determine the worst case latency
417 * NumLinePair = Number of line pairs to request(1=2 lines, 2=4 lines)
418 * WorstCaseLatency = worst case time from urgent to when the MC starts
419 * to return data
420 * READ_DELAY_IDLE_MAX = constant of 1us
421 * ChunkTime = time it takes the DCP to send one chunk of data to the LB
422 * which consists of pipeline delay and inter chunk gap
423 */
424 if (rfixed_trunc(wm->num_line_pair) > 1) {
425 a.full = rfixed_const(3);
426 wm->worst_case_latency.full = rfixed_mul(a, chunk_time);
427 wm->worst_case_latency.full += read_delay_latency.full;
428 } else {
429 a.full = rfixed_const(2);
430 wm->worst_case_latency.full = rfixed_mul(a, chunk_time);
431 wm->worst_case_latency.full += read_delay_latency.full;
432 }
433
434 /* Determine the tolerable latency
435 * TolerableLatency = Any given request has only 1 line time
436 * for the data to be returned
437 * LBRequestFifoDepth = Number of chunk requests the LB can
438 * put into the request FIFO for a display
439 * LineTime = total time for one line of display
440 * ChunkTime = the time it takes the DCP to send one chunk
441 * of data to the LB which consists of
442 * pipeline delay and inter chunk gap
443 */
444 if ((2+wm->lb_request_fifo_depth) >= rfixed_trunc(request_fifo_depth)) {
445 tolerable_latency.full = line_time.full;
446 } else {
447 tolerable_latency.full = rfixed_const(wm->lb_request_fifo_depth - 2);
448 tolerable_latency.full = request_fifo_depth.full - tolerable_latency.full;
449 tolerable_latency.full = rfixed_mul(tolerable_latency, chunk_time);
450 tolerable_latency.full = line_time.full - tolerable_latency.full;
451 }
452 /* We assume worst case 32bits (4 bytes) */
453 wm->dbpp.full = rfixed_const(4 * 8);
454
455 /* Determine the maximum priority mark
456 * width = viewport width in pixels
457 */
458 a.full = rfixed_const(16);
459 wm->priority_mark_max.full = rfixed_const(crtc->base.mode.crtc_hdisplay);
460 wm->priority_mark_max.full = rfixed_div(wm->priority_mark_max, a);
461
462 /* Determine estimated width */
463 estimated_width.full = tolerable_latency.full - wm->worst_case_latency.full;
464 estimated_width.full = rfixed_div(estimated_width, consumption_time);
465 if (rfixed_trunc(estimated_width) > crtc->base.mode.crtc_hdisplay) {
466 wm->priority_mark.full = rfixed_const(10);
467 } else {
468 a.full = rfixed_const(16);
469 wm->priority_mark.full = rfixed_div(estimated_width, a);
470 wm->priority_mark.full = wm->priority_mark_max.full - wm->priority_mark.full;
471 }
472}
473
474void rs690_bandwidth_update(struct radeon_device *rdev)
475{
476 struct drm_display_mode *mode0 = NULL;
477 struct drm_display_mode *mode1 = NULL;
478 struct rs690_watermark wm0;
479 struct rs690_watermark wm1;
480 u32 tmp;
481 fixed20_12 priority_mark02, priority_mark12, fill_rate;
482 fixed20_12 a, b;
483
484 if (rdev->mode_info.crtcs[0]->base.enabled)
485 mode0 = &rdev->mode_info.crtcs[0]->base.mode;
486 if (rdev->mode_info.crtcs[1]->base.enabled)
487 mode1 = &rdev->mode_info.crtcs[1]->base.mode;
488 /*
489 * Set display0/1 priority up in the memory controller for
490 * modes if the user specifies HIGH for displaypriority
491 * option.
492 */
493 if (rdev->disp_priority == 2) {
494 tmp = RREG32_MC(MC_INIT_MISC_LAT_TIMER);
495 tmp &= ~MC_DISP1R_INIT_LAT_MASK;
496 tmp &= ~MC_DISP0R_INIT_LAT_MASK;
497 if (mode1)
498 tmp |= (1 << MC_DISP1R_INIT_LAT_SHIFT);
499 if (mode0)
500 tmp |= (1 << MC_DISP0R_INIT_LAT_SHIFT);
501 WREG32_MC(MC_INIT_MISC_LAT_TIMER, tmp);
502 }
503 rs690_line_buffer_adjust(rdev, mode0, mode1);
504
505 if ((rdev->family == CHIP_RS690) || (rdev->family == CHIP_RS740))
506 WREG32(DCP_CONTROL, 0);
507 if ((rdev->family == CHIP_RS780) || (rdev->family == CHIP_RS880))
508 WREG32(DCP_CONTROL, 2);
509
510 rs690_crtc_bandwidth_compute(rdev, rdev->mode_info.crtcs[0], &wm0);
511 rs690_crtc_bandwidth_compute(rdev, rdev->mode_info.crtcs[1], &wm1);
512
513 tmp = (wm0.lb_request_fifo_depth - 1);
514 tmp |= (wm1.lb_request_fifo_depth - 1) << 16;
515 WREG32(LB_MAX_REQ_OUTSTANDING, tmp);
516
517 if (mode0 && mode1) {
518 if (rfixed_trunc(wm0.dbpp) > 64)
519 a.full = rfixed_mul(wm0.dbpp, wm0.num_line_pair);
520 else
521 a.full = wm0.num_line_pair.full;
522 if (rfixed_trunc(wm1.dbpp) > 64)
523 b.full = rfixed_mul(wm1.dbpp, wm1.num_line_pair);
524 else
525 b.full = wm1.num_line_pair.full;
526 a.full += b.full;
527 fill_rate.full = rfixed_div(wm0.sclk, a);
528 if (wm0.consumption_rate.full > fill_rate.full) {
529 b.full = wm0.consumption_rate.full - fill_rate.full;
530 b.full = rfixed_mul(b, wm0.active_time);
531 a.full = rfixed_mul(wm0.worst_case_latency,
532 wm0.consumption_rate);
533 a.full = a.full + b.full;
534 b.full = rfixed_const(16 * 1000);
535 priority_mark02.full = rfixed_div(a, b);
536 } else {
537 a.full = rfixed_mul(wm0.worst_case_latency,
538 wm0.consumption_rate);
539 b.full = rfixed_const(16 * 1000);
540 priority_mark02.full = rfixed_div(a, b);
541 }
542 if (wm1.consumption_rate.full > fill_rate.full) {
543 b.full = wm1.consumption_rate.full - fill_rate.full;
544 b.full = rfixed_mul(b, wm1.active_time);
545 a.full = rfixed_mul(wm1.worst_case_latency,
546 wm1.consumption_rate);
547 a.full = a.full + b.full;
548 b.full = rfixed_const(16 * 1000);
549 priority_mark12.full = rfixed_div(a, b);
550 } else {
551 a.full = rfixed_mul(wm1.worst_case_latency,
552 wm1.consumption_rate);
553 b.full = rfixed_const(16 * 1000);
554 priority_mark12.full = rfixed_div(a, b);
555 }
556 if (wm0.priority_mark.full > priority_mark02.full)
557 priority_mark02.full = wm0.priority_mark.full;
558 if (rfixed_trunc(priority_mark02) < 0)
559 priority_mark02.full = 0;
560 if (wm0.priority_mark_max.full > priority_mark02.full)
561 priority_mark02.full = wm0.priority_mark_max.full;
562 if (wm1.priority_mark.full > priority_mark12.full)
563 priority_mark12.full = wm1.priority_mark.full;
564 if (rfixed_trunc(priority_mark12) < 0)
565 priority_mark12.full = 0;
566 if (wm1.priority_mark_max.full > priority_mark12.full)
567 priority_mark12.full = wm1.priority_mark_max.full;
568 WREG32(D1MODE_PRIORITY_A_CNT, rfixed_trunc(priority_mark02));
569 WREG32(D1MODE_PRIORITY_B_CNT, rfixed_trunc(priority_mark02));
570 WREG32(D2MODE_PRIORITY_A_CNT, rfixed_trunc(priority_mark12));
571 WREG32(D2MODE_PRIORITY_B_CNT, rfixed_trunc(priority_mark12));
572 } else if (mode0) {
573 if (rfixed_trunc(wm0.dbpp) > 64)
574 a.full = rfixed_mul(wm0.dbpp, wm0.num_line_pair);
575 else
576 a.full = wm0.num_line_pair.full;
577 fill_rate.full = rfixed_div(wm0.sclk, a);
578 if (wm0.consumption_rate.full > fill_rate.full) {
579 b.full = wm0.consumption_rate.full - fill_rate.full;
580 b.full = rfixed_mul(b, wm0.active_time);
581 a.full = rfixed_mul(wm0.worst_case_latency,
582 wm0.consumption_rate);
583 a.full = a.full + b.full;
584 b.full = rfixed_const(16 * 1000);
585 priority_mark02.full = rfixed_div(a, b);
586 } else {
587 a.full = rfixed_mul(wm0.worst_case_latency,
588 wm0.consumption_rate);
589 b.full = rfixed_const(16 * 1000);
590 priority_mark02.full = rfixed_div(a, b);
591 }
592 if (wm0.priority_mark.full > priority_mark02.full)
593 priority_mark02.full = wm0.priority_mark.full;
594 if (rfixed_trunc(priority_mark02) < 0)
595 priority_mark02.full = 0;
596 if (wm0.priority_mark_max.full > priority_mark02.full)
597 priority_mark02.full = wm0.priority_mark_max.full;
598 WREG32(D1MODE_PRIORITY_A_CNT, rfixed_trunc(priority_mark02));
599 WREG32(D1MODE_PRIORITY_B_CNT, rfixed_trunc(priority_mark02));
600 WREG32(D2MODE_PRIORITY_A_CNT, MODE_PRIORITY_OFF);
601 WREG32(D2MODE_PRIORITY_B_CNT, MODE_PRIORITY_OFF);
602 } else {
603 if (rfixed_trunc(wm1.dbpp) > 64)
604 a.full = rfixed_mul(wm1.dbpp, wm1.num_line_pair);
605 else
606 a.full = wm1.num_line_pair.full;
607 fill_rate.full = rfixed_div(wm1.sclk, a);
608 if (wm1.consumption_rate.full > fill_rate.full) {
609 b.full = wm1.consumption_rate.full - fill_rate.full;
610 b.full = rfixed_mul(b, wm1.active_time);
611 a.full = rfixed_mul(wm1.worst_case_latency,
612 wm1.consumption_rate);
613 a.full = a.full + b.full;
614 b.full = rfixed_const(16 * 1000);
615 priority_mark12.full = rfixed_div(a, b);
616 } else {
617 a.full = rfixed_mul(wm1.worst_case_latency,
618 wm1.consumption_rate);
619 b.full = rfixed_const(16 * 1000);
620 priority_mark12.full = rfixed_div(a, b);
621 }
622 if (wm1.priority_mark.full > priority_mark12.full)
623 priority_mark12.full = wm1.priority_mark.full;
624 if (rfixed_trunc(priority_mark12) < 0)
625 priority_mark12.full = 0;
626 if (wm1.priority_mark_max.full > priority_mark12.full)
627 priority_mark12.full = wm1.priority_mark_max.full;
628 WREG32(D1MODE_PRIORITY_A_CNT, MODE_PRIORITY_OFF);
629 WREG32(D1MODE_PRIORITY_B_CNT, MODE_PRIORITY_OFF);
630 WREG32(D2MODE_PRIORITY_A_CNT, rfixed_trunc(priority_mark12));
631 WREG32(D2MODE_PRIORITY_B_CNT, rfixed_trunc(priority_mark12));
632 }
633}
161 634
162/* 635/*
163 * Indirect registers accessor 636 * Indirect registers accessor
diff --git a/drivers/gpu/drm/radeon/rs690r.h b/drivers/gpu/drm/radeon/rs690r.h
new file mode 100644
index 000000000000..c0d9faa2175b
--- /dev/null
+++ b/drivers/gpu/drm/radeon/rs690r.h
@@ -0,0 +1,99 @@
1/*
2 * Copyright 2008 Advanced Micro Devices, Inc.
3 * Copyright 2008 Red Hat Inc.
4 * Copyright 2009 Jerome Glisse.
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * copy of this software and associated documentation files (the "Software"),
8 * to deal in the Software without restriction, including without limitation
9 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
10 * and/or sell copies of the Software, and to permit persons to whom the
11 * Software is furnished to do so, subject to the following conditions:
12 *
13 * The above copyright notice and this permission notice shall be included in
14 * all copies or substantial portions of the Software.
15 *
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19 * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
20 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
21 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22 * OTHER DEALINGS IN THE SOFTWARE.
23 *
24 * Authors: Dave Airlie
25 * Alex Deucher
26 * Jerome Glisse
27 */
28#ifndef RS690R_H
29#define RS690R_H
30
31/* RS690/RS740 registers */
32#define MC_INDEX 0x0078
33# define MC_INDEX_MASK 0x1FF
34# define MC_INDEX_WR_EN (1 << 9)
35# define MC_INDEX_WR_ACK 0x7F
36#define MC_DATA 0x007C
37#define HDP_FB_LOCATION 0x0134
38#define DC_LB_MEMORY_SPLIT 0x6520
39#define DC_LB_MEMORY_SPLIT_MASK 0x00000003
40#define DC_LB_MEMORY_SPLIT_SHIFT 0
41#define DC_LB_MEMORY_SPLIT_D1HALF_D2HALF 0
42#define DC_LB_MEMORY_SPLIT_D1_3Q_D2_1Q 1
43#define DC_LB_MEMORY_SPLIT_D1_ONLY 2
44#define DC_LB_MEMORY_SPLIT_D1_1Q_D2_3Q 3
45#define DC_LB_MEMORY_SPLIT_SHIFT_MODE (1 << 2)
46#define DC_LB_DISP1_END_ADR_SHIFT 4
47#define DC_LB_DISP1_END_ADR_MASK 0x00007FF0
48#define D1MODE_PRIORITY_A_CNT 0x6548
49#define MODE_PRIORITY_MARK_MASK 0x00007FFF
50#define MODE_PRIORITY_OFF (1 << 16)
51#define MODE_PRIORITY_ALWAYS_ON (1 << 20)
52#define MODE_PRIORITY_FORCE_MASK (1 << 24)
53#define D1MODE_PRIORITY_B_CNT 0x654C
54#define LB_MAX_REQ_OUTSTANDING 0x6D58
55#define LB_D1_MAX_REQ_OUTSTANDING_MASK 0x0000000F
56#define LB_D1_MAX_REQ_OUTSTANDING_SHIFT 0
57#define LB_D2_MAX_REQ_OUTSTANDING_MASK 0x000F0000
58#define LB_D2_MAX_REQ_OUTSTANDING_SHIFT 16
59#define DCP_CONTROL 0x6C9C
60#define D2MODE_PRIORITY_A_CNT 0x6D48
61#define D2MODE_PRIORITY_B_CNT 0x6D4C
62
63/* MC indirect registers */
64#define MC_STATUS_IDLE (1 << 0)
65#define MC_MISC_CNTL 0x18
66#define DISABLE_GTW (1 << 1)
67#define GART_INDEX_REG_EN (1 << 12)
68#define BLOCK_GFX_D3_EN (1 << 14)
69#define GART_FEATURE_ID 0x2B
70#define HANG_EN (1 << 11)
71#define TLB_ENABLE (1 << 18)
72#define P2P_ENABLE (1 << 19)
73#define GTW_LAC_EN (1 << 25)
74#define LEVEL2_GART (0 << 30)
75#define LEVEL1_GART (1 << 30)
76#define PDC_EN (1 << 31)
77#define GART_BASE 0x2C
78#define GART_CACHE_CNTRL 0x2E
79# define GART_CACHE_INVALIDATE (1 << 0)
80#define MC_STATUS 0x90
81#define MCCFG_FB_LOCATION 0x100
82#define MC_FB_START_MASK 0x0000FFFF
83#define MC_FB_START_SHIFT 0
84#define MC_FB_TOP_MASK 0xFFFF0000
85#define MC_FB_TOP_SHIFT 16
86#define MCCFG_AGP_LOCATION 0x101
87#define MC_AGP_START_MASK 0x0000FFFF
88#define MC_AGP_START_SHIFT 0
89#define MC_AGP_TOP_MASK 0xFFFF0000
90#define MC_AGP_TOP_SHIFT 16
91#define MCCFG_AGP_BASE 0x102
92#define MCCFG_AGP_BASE_2 0x103
93#define MC_INIT_MISC_LAT_TIMER 0x104
94#define MC_DISP0R_INIT_LAT_SHIFT 8
95#define MC_DISP0R_INIT_LAT_MASK 0x00000F00
96#define MC_DISP1R_INIT_LAT_SHIFT 12
97#define MC_DISP1R_INIT_LAT_MASK 0x0000F000
98
99#endif
diff --git a/drivers/gpu/drm/radeon/rv515.c b/drivers/gpu/drm/radeon/rv515.c
index ffea37b1b3e2..fd8f3ca716ea 100644
--- a/drivers/gpu/drm/radeon/rv515.c
+++ b/drivers/gpu/drm/radeon/rv515.c
@@ -27,8 +27,9 @@
27 */ 27 */
28#include <linux/seq_file.h> 28#include <linux/seq_file.h>
29#include "drmP.h" 29#include "drmP.h"
30#include "radeon_reg.h" 30#include "rv515r.h"
31#include "radeon.h" 31#include "radeon.h"
32#include "radeon_share.h"
32 33
33/* rv515 depends on : */ 34/* rv515 depends on : */
34void r100_hdp_reset(struct radeon_device *rdev); 35void r100_hdp_reset(struct radeon_device *rdev);
@@ -99,26 +100,26 @@ int rv515_mc_init(struct radeon_device *rdev)
99 "programming pipes. Bad things might happen.\n"); 100 "programming pipes. Bad things might happen.\n");
100 } 101 }
101 /* Write VRAM size in case we are limiting it */ 102 /* Write VRAM size in case we are limiting it */
102 WREG32(RADEON_CONFIG_MEMSIZE, rdev->mc.vram_size); 103 WREG32(RADEON_CONFIG_MEMSIZE, rdev->mc.real_vram_size);
103 tmp = REG_SET(RV515_MC_FB_START, rdev->mc.vram_location >> 16); 104 tmp = REG_SET(MC_FB_START, rdev->mc.vram_location >> 16);
104 WREG32(0x134, tmp); 105 WREG32(0x134, tmp);
105 tmp = rdev->mc.vram_location + rdev->mc.vram_size - 1; 106 tmp = rdev->mc.vram_location + rdev->mc.mc_vram_size - 1;
106 tmp = REG_SET(RV515_MC_FB_TOP, tmp >> 16); 107 tmp = REG_SET(MC_FB_TOP, tmp >> 16);
107 tmp |= REG_SET(RV515_MC_FB_START, rdev->mc.vram_location >> 16); 108 tmp |= REG_SET(MC_FB_START, rdev->mc.vram_location >> 16);
108 WREG32_MC(RV515_MC_FB_LOCATION, tmp); 109 WREG32_MC(MC_FB_LOCATION, tmp);
109 WREG32(RS690_HDP_FB_LOCATION, rdev->mc.vram_location >> 16); 110 WREG32(HDP_FB_LOCATION, rdev->mc.vram_location >> 16);
110 WREG32(0x310, rdev->mc.vram_location); 111 WREG32(0x310, rdev->mc.vram_location);
111 if (rdev->flags & RADEON_IS_AGP) { 112 if (rdev->flags & RADEON_IS_AGP) {
112 tmp = rdev->mc.gtt_location + rdev->mc.gtt_size - 1; 113 tmp = rdev->mc.gtt_location + rdev->mc.gtt_size - 1;
113 tmp = REG_SET(RV515_MC_AGP_TOP, tmp >> 16); 114 tmp = REG_SET(MC_AGP_TOP, tmp >> 16);
114 tmp |= REG_SET(RV515_MC_AGP_START, rdev->mc.gtt_location >> 16); 115 tmp |= REG_SET(MC_AGP_START, rdev->mc.gtt_location >> 16);
115 WREG32_MC(RV515_MC_AGP_LOCATION, tmp); 116 WREG32_MC(MC_AGP_LOCATION, tmp);
116 WREG32_MC(RV515_MC_AGP_BASE, rdev->mc.agp_base); 117 WREG32_MC(MC_AGP_BASE, rdev->mc.agp_base);
117 WREG32_MC(RV515_MC_AGP_BASE_2, 0); 118 WREG32_MC(MC_AGP_BASE_2, 0);
118 } else { 119 } else {
119 WREG32_MC(RV515_MC_AGP_LOCATION, 0x0FFFFFFF); 120 WREG32_MC(MC_AGP_LOCATION, 0x0FFFFFFF);
120 WREG32_MC(RV515_MC_AGP_BASE, 0); 121 WREG32_MC(MC_AGP_BASE, 0);
121 WREG32_MC(RV515_MC_AGP_BASE_2, 0); 122 WREG32_MC(MC_AGP_BASE_2, 0);
122 } 123 }
123 return 0; 124 return 0;
124} 125}
@@ -136,95 +137,67 @@ void rv515_mc_fini(struct radeon_device *rdev)
136 */ 137 */
137void rv515_ring_start(struct radeon_device *rdev) 138void rv515_ring_start(struct radeon_device *rdev)
138{ 139{
139 unsigned gb_tile_config;
140 int r; 140 int r;
141 141
142 /* Sub pixel 1/12 so we can have 4K rendering according to doc */
143 gb_tile_config = R300_ENABLE_TILING | R300_TILE_SIZE_16;
144 switch (rdev->num_gb_pipes) {
145 case 2:
146 gb_tile_config |= R300_PIPE_COUNT_R300;
147 break;
148 case 3:
149 gb_tile_config |= R300_PIPE_COUNT_R420_3P;
150 break;
151 case 4:
152 gb_tile_config |= R300_PIPE_COUNT_R420;
153 break;
154 case 1:
155 default:
156 gb_tile_config |= R300_PIPE_COUNT_RV350;
157 break;
158 }
159
160 r = radeon_ring_lock(rdev, 64); 142 r = radeon_ring_lock(rdev, 64);
161 if (r) { 143 if (r) {
162 return; 144 return;
163 } 145 }
164 radeon_ring_write(rdev, PACKET0(RADEON_ISYNC_CNTL, 0)); 146 radeon_ring_write(rdev, PACKET0(ISYNC_CNTL, 0));
165 radeon_ring_write(rdev,
166 RADEON_ISYNC_ANY2D_IDLE3D |
167 RADEON_ISYNC_ANY3D_IDLE2D |
168 RADEON_ISYNC_WAIT_IDLEGUI |
169 RADEON_ISYNC_CPSCRATCH_IDLEGUI);
170 radeon_ring_write(rdev, PACKET0(R300_GB_TILE_CONFIG, 0));
171 radeon_ring_write(rdev, gb_tile_config);
172 radeon_ring_write(rdev, PACKET0(RADEON_WAIT_UNTIL, 0));
173 radeon_ring_write(rdev, 147 radeon_ring_write(rdev,
174 RADEON_WAIT_2D_IDLECLEAN | 148 ISYNC_ANY2D_IDLE3D |
175 RADEON_WAIT_3D_IDLECLEAN); 149 ISYNC_ANY3D_IDLE2D |
150 ISYNC_WAIT_IDLEGUI |
151 ISYNC_CPSCRATCH_IDLEGUI);
152 radeon_ring_write(rdev, PACKET0(WAIT_UNTIL, 0));
153 radeon_ring_write(rdev, WAIT_2D_IDLECLEAN | WAIT_3D_IDLECLEAN);
176 radeon_ring_write(rdev, PACKET0(0x170C, 0)); 154 radeon_ring_write(rdev, PACKET0(0x170C, 0));
177 radeon_ring_write(rdev, 1 << 31); 155 radeon_ring_write(rdev, 1 << 31);
178 radeon_ring_write(rdev, PACKET0(R300_GB_SELECT, 0)); 156 radeon_ring_write(rdev, PACKET0(GB_SELECT, 0));
179 radeon_ring_write(rdev, 0); 157 radeon_ring_write(rdev, 0);
180 radeon_ring_write(rdev, PACKET0(R300_GB_ENABLE, 0)); 158 radeon_ring_write(rdev, PACKET0(GB_ENABLE, 0));
181 radeon_ring_write(rdev, 0); 159 radeon_ring_write(rdev, 0);
182 radeon_ring_write(rdev, PACKET0(0x42C8, 0)); 160 radeon_ring_write(rdev, PACKET0(0x42C8, 0));
183 radeon_ring_write(rdev, (1 << rdev->num_gb_pipes) - 1); 161 radeon_ring_write(rdev, (1 << rdev->num_gb_pipes) - 1);
184 radeon_ring_write(rdev, PACKET0(R500_VAP_INDEX_OFFSET, 0)); 162 radeon_ring_write(rdev, PACKET0(VAP_INDEX_OFFSET, 0));
185 radeon_ring_write(rdev, 0); 163 radeon_ring_write(rdev, 0);
186 radeon_ring_write(rdev, PACKET0(R300_RB3D_DSTCACHE_CTLSTAT, 0)); 164 radeon_ring_write(rdev, PACKET0(RB3D_DSTCACHE_CTLSTAT, 0));
187 radeon_ring_write(rdev, R300_RB3D_DC_FLUSH | R300_RB3D_DC_FREE); 165 radeon_ring_write(rdev, RB3D_DC_FLUSH | RB3D_DC_FREE);
188 radeon_ring_write(rdev, PACKET0(R300_RB3D_ZCACHE_CTLSTAT, 0)); 166 radeon_ring_write(rdev, PACKET0(ZB_ZCACHE_CTLSTAT, 0));
189 radeon_ring_write(rdev, R300_ZC_FLUSH | R300_ZC_FREE); 167 radeon_ring_write(rdev, ZC_FLUSH | ZC_FREE);
190 radeon_ring_write(rdev, PACKET0(RADEON_WAIT_UNTIL, 0)); 168 radeon_ring_write(rdev, PACKET0(WAIT_UNTIL, 0));
191 radeon_ring_write(rdev, 169 radeon_ring_write(rdev, WAIT_2D_IDLECLEAN | WAIT_3D_IDLECLEAN);
192 RADEON_WAIT_2D_IDLECLEAN | 170 radeon_ring_write(rdev, PACKET0(GB_AA_CONFIG, 0));
193 RADEON_WAIT_3D_IDLECLEAN);
194 radeon_ring_write(rdev, PACKET0(R300_GB_AA_CONFIG, 0));
195 radeon_ring_write(rdev, 0); 171 radeon_ring_write(rdev, 0);
196 radeon_ring_write(rdev, PACKET0(R300_RB3D_DSTCACHE_CTLSTAT, 0)); 172 radeon_ring_write(rdev, PACKET0(RB3D_DSTCACHE_CTLSTAT, 0));
197 radeon_ring_write(rdev, R300_RB3D_DC_FLUSH | R300_RB3D_DC_FREE); 173 radeon_ring_write(rdev, RB3D_DC_FLUSH | RB3D_DC_FREE);
198 radeon_ring_write(rdev, PACKET0(R300_RB3D_ZCACHE_CTLSTAT, 0)); 174 radeon_ring_write(rdev, PACKET0(ZB_ZCACHE_CTLSTAT, 0));
199 radeon_ring_write(rdev, R300_ZC_FLUSH | R300_ZC_FREE); 175 radeon_ring_write(rdev, ZC_FLUSH | ZC_FREE);
200 radeon_ring_write(rdev, PACKET0(R300_GB_MSPOS0, 0)); 176 radeon_ring_write(rdev, PACKET0(GB_MSPOS0, 0));
201 radeon_ring_write(rdev,
202 ((6 << R300_MS_X0_SHIFT) |
203 (6 << R300_MS_Y0_SHIFT) |
204 (6 << R300_MS_X1_SHIFT) |
205 (6 << R300_MS_Y1_SHIFT) |
206 (6 << R300_MS_X2_SHIFT) |
207 (6 << R300_MS_Y2_SHIFT) |
208 (6 << R300_MSBD0_Y_SHIFT) |
209 (6 << R300_MSBD0_X_SHIFT)));
210 radeon_ring_write(rdev, PACKET0(R300_GB_MSPOS1, 0));
211 radeon_ring_write(rdev, 177 radeon_ring_write(rdev,
212 ((6 << R300_MS_X3_SHIFT) | 178 ((6 << MS_X0_SHIFT) |
213 (6 << R300_MS_Y3_SHIFT) | 179 (6 << MS_Y0_SHIFT) |
214 (6 << R300_MS_X4_SHIFT) | 180 (6 << MS_X1_SHIFT) |
215 (6 << R300_MS_Y4_SHIFT) | 181 (6 << MS_Y1_SHIFT) |
216 (6 << R300_MS_X5_SHIFT) | 182 (6 << MS_X2_SHIFT) |
217 (6 << R300_MS_Y5_SHIFT) | 183 (6 << MS_Y2_SHIFT) |
218 (6 << R300_MSBD1_SHIFT))); 184 (6 << MSBD0_Y_SHIFT) |
219 radeon_ring_write(rdev, PACKET0(R300_GA_ENHANCE, 0)); 185 (6 << MSBD0_X_SHIFT)));
220 radeon_ring_write(rdev, R300_GA_DEADLOCK_CNTL | R300_GA_FASTSYNC_CNTL); 186 radeon_ring_write(rdev, PACKET0(GB_MSPOS1, 0));
221 radeon_ring_write(rdev, PACKET0(R300_GA_POLY_MODE, 0));
222 radeon_ring_write(rdev, 187 radeon_ring_write(rdev,
223 R300_FRONT_PTYPE_TRIANGE | R300_BACK_PTYPE_TRIANGE); 188 ((6 << MS_X3_SHIFT) |
224 radeon_ring_write(rdev, PACKET0(R300_GA_ROUND_MODE, 0)); 189 (6 << MS_Y3_SHIFT) |
225 radeon_ring_write(rdev, 190 (6 << MS_X4_SHIFT) |
226 R300_GEOMETRY_ROUND_NEAREST | 191 (6 << MS_Y4_SHIFT) |
227 R300_COLOR_ROUND_NEAREST); 192 (6 << MS_X5_SHIFT) |
193 (6 << MS_Y5_SHIFT) |
194 (6 << MSBD1_SHIFT)));
195 radeon_ring_write(rdev, PACKET0(GA_ENHANCE, 0));
196 radeon_ring_write(rdev, GA_DEADLOCK_CNTL | GA_FASTSYNC_CNTL);
197 radeon_ring_write(rdev, PACKET0(GA_POLY_MODE, 0));
198 radeon_ring_write(rdev, FRONT_PTYPE_TRIANGE | BACK_PTYPE_TRIANGE);
199 radeon_ring_write(rdev, PACKET0(GA_ROUND_MODE, 0));
200 radeon_ring_write(rdev, GEOMETRY_ROUND_NEAREST | COLOR_ROUND_NEAREST);
228 radeon_ring_write(rdev, PACKET0(0x20C8, 0)); 201 radeon_ring_write(rdev, PACKET0(0x20C8, 0));
229 radeon_ring_write(rdev, 0); 202 radeon_ring_write(rdev, 0);
230 radeon_ring_unlock_commit(rdev); 203 radeon_ring_unlock_commit(rdev);
@@ -242,8 +215,8 @@ int rv515_mc_wait_for_idle(struct radeon_device *rdev)
242 215
243 for (i = 0; i < rdev->usec_timeout; i++) { 216 for (i = 0; i < rdev->usec_timeout; i++) {
244 /* read MC_STATUS */ 217 /* read MC_STATUS */
245 tmp = RREG32_MC(RV515_MC_STATUS); 218 tmp = RREG32_MC(MC_STATUS);
246 if (tmp & RV515_MC_STATUS_IDLE) { 219 if (tmp & MC_STATUS_IDLE) {
247 return 0; 220 return 0;
248 } 221 }
249 DRM_UDELAY(1); 222 DRM_UDELAY(1);
@@ -291,33 +264,33 @@ int rv515_ga_reset(struct radeon_device *rdev)
291 reinit_cp = rdev->cp.ready; 264 reinit_cp = rdev->cp.ready;
292 rdev->cp.ready = false; 265 rdev->cp.ready = false;
293 for (i = 0; i < rdev->usec_timeout; i++) { 266 for (i = 0; i < rdev->usec_timeout; i++) {
294 WREG32(RADEON_CP_CSQ_MODE, 0); 267 WREG32(CP_CSQ_MODE, 0);
295 WREG32(RADEON_CP_CSQ_CNTL, 0); 268 WREG32(CP_CSQ_CNTL, 0);
296 WREG32(RADEON_RBBM_SOFT_RESET, 0x32005); 269 WREG32(RBBM_SOFT_RESET, 0x32005);
297 (void)RREG32(RADEON_RBBM_SOFT_RESET); 270 (void)RREG32(RBBM_SOFT_RESET);
298 udelay(200); 271 udelay(200);
299 WREG32(RADEON_RBBM_SOFT_RESET, 0); 272 WREG32(RBBM_SOFT_RESET, 0);
300 /* Wait to prevent race in RBBM_STATUS */ 273 /* Wait to prevent race in RBBM_STATUS */
301 mdelay(1); 274 mdelay(1);
302 tmp = RREG32(RADEON_RBBM_STATUS); 275 tmp = RREG32(RBBM_STATUS);
303 if (tmp & ((1 << 20) | (1 << 26))) { 276 if (tmp & ((1 << 20) | (1 << 26))) {
304 DRM_ERROR("VAP & CP still busy (RBBM_STATUS=0x%08X)\n", tmp); 277 DRM_ERROR("VAP & CP still busy (RBBM_STATUS=0x%08X)\n", tmp);
305 /* GA still busy soft reset it */ 278 /* GA still busy soft reset it */
306 WREG32(0x429C, 0x200); 279 WREG32(0x429C, 0x200);
307 WREG32(R300_VAP_PVS_STATE_FLUSH_REG, 0); 280 WREG32(VAP_PVS_STATE_FLUSH_REG, 0);
308 WREG32(0x43E0, 0); 281 WREG32(0x43E0, 0);
309 WREG32(0x43E4, 0); 282 WREG32(0x43E4, 0);
310 WREG32(0x24AC, 0); 283 WREG32(0x24AC, 0);
311 } 284 }
312 /* Wait to prevent race in RBBM_STATUS */ 285 /* Wait to prevent race in RBBM_STATUS */
313 mdelay(1); 286 mdelay(1);
314 tmp = RREG32(RADEON_RBBM_STATUS); 287 tmp = RREG32(RBBM_STATUS);
315 if (!(tmp & ((1 << 20) | (1 << 26)))) { 288 if (!(tmp & ((1 << 20) | (1 << 26)))) {
316 break; 289 break;
317 } 290 }
318 } 291 }
319 for (i = 0; i < rdev->usec_timeout; i++) { 292 for (i = 0; i < rdev->usec_timeout; i++) {
320 tmp = RREG32(RADEON_RBBM_STATUS); 293 tmp = RREG32(RBBM_STATUS);
321 if (!(tmp & ((1 << 20) | (1 << 26)))) { 294 if (!(tmp & ((1 << 20) | (1 << 26)))) {
322 DRM_INFO("GA reset succeed (RBBM_STATUS=0x%08X)\n", 295 DRM_INFO("GA reset succeed (RBBM_STATUS=0x%08X)\n",
323 tmp); 296 tmp);
@@ -331,7 +304,7 @@ int rv515_ga_reset(struct radeon_device *rdev)
331 } 304 }
332 DRM_UDELAY(1); 305 DRM_UDELAY(1);
333 } 306 }
334 tmp = RREG32(RADEON_RBBM_STATUS); 307 tmp = RREG32(RBBM_STATUS);
335 DRM_ERROR("Failed to reset GA ! (RBBM_STATUS=0x%08X)\n", tmp); 308 DRM_ERROR("Failed to reset GA ! (RBBM_STATUS=0x%08X)\n", tmp);
336 return -1; 309 return -1;
337} 310}
@@ -341,7 +314,7 @@ int rv515_gpu_reset(struct radeon_device *rdev)
341 uint32_t status; 314 uint32_t status;
342 315
343 /* reset order likely matter */ 316 /* reset order likely matter */
344 status = RREG32(RADEON_RBBM_STATUS); 317 status = RREG32(RBBM_STATUS);
345 /* reset HDP */ 318 /* reset HDP */
346 r100_hdp_reset(rdev); 319 r100_hdp_reset(rdev);
347 /* reset rb2d */ 320 /* reset rb2d */
@@ -353,12 +326,12 @@ int rv515_gpu_reset(struct radeon_device *rdev)
353 rv515_ga_reset(rdev); 326 rv515_ga_reset(rdev);
354 } 327 }
355 /* reset CP */ 328 /* reset CP */
356 status = RREG32(RADEON_RBBM_STATUS); 329 status = RREG32(RBBM_STATUS);
357 if (status & (1 << 16)) { 330 if (status & (1 << 16)) {
358 r100_cp_reset(rdev); 331 r100_cp_reset(rdev);
359 } 332 }
360 /* Check if GPU is idle */ 333 /* Check if GPU is idle */
361 status = RREG32(RADEON_RBBM_STATUS); 334 status = RREG32(RBBM_STATUS);
362 if (status & (1 << 31)) { 335 if (status & (1 << 31)) {
363 DRM_ERROR("Failed to reset GPU (RBBM_STATUS=0x%08X)\n", status); 336 DRM_ERROR("Failed to reset GPU (RBBM_STATUS=0x%08X)\n", status);
364 return -1; 337 return -1;
@@ -377,8 +350,7 @@ static void rv515_vram_get_type(struct radeon_device *rdev)
377 350
378 rdev->mc.vram_width = 128; 351 rdev->mc.vram_width = 128;
379 rdev->mc.vram_is_ddr = true; 352 rdev->mc.vram_is_ddr = true;
380 tmp = RREG32_MC(RV515_MC_CNTL); 353 tmp = RREG32_MC(RV515_MC_CNTL) & MEM_NUM_CHANNELS_MASK;
381 tmp &= RV515_MEM_NUM_CHANNELS_MASK;
382 switch (tmp) { 354 switch (tmp) {
383 case 0: 355 case 0:
384 rdev->mc.vram_width = 64; 356 rdev->mc.vram_width = 64;
@@ -394,11 +366,17 @@ static void rv515_vram_get_type(struct radeon_device *rdev)
394 366
395void rv515_vram_info(struct radeon_device *rdev) 367void rv515_vram_info(struct radeon_device *rdev)
396{ 368{
369 fixed20_12 a;
370
397 rv515_vram_get_type(rdev); 371 rv515_vram_get_type(rdev);
398 rdev->mc.vram_size = RREG32(RADEON_CONFIG_MEMSIZE);
399 372
400 rdev->mc.aper_base = drm_get_resource_start(rdev->ddev, 0); 373 r100_vram_init_sizes(rdev);
401 rdev->mc.aper_size = drm_get_resource_len(rdev->ddev, 0); 374 /* FIXME: we should enforce default clock in case GPU is not in
375 * default setup
376 */
377 a.full = rfixed_const(100);
378 rdev->pm.sclk.full = rfixed_const(rdev->clock.default_sclk);
379 rdev->pm.sclk.full = rfixed_div(rdev->pm.sclk, a);
402} 380}
403 381
404 382
@@ -409,35 +387,35 @@ uint32_t rv515_mc_rreg(struct radeon_device *rdev, uint32_t reg)
409{ 387{
410 uint32_t r; 388 uint32_t r;
411 389
412 WREG32(R520_MC_IND_INDEX, 0x7f0000 | (reg & 0xffff)); 390 WREG32(MC_IND_INDEX, 0x7f0000 | (reg & 0xffff));
413 r = RREG32(R520_MC_IND_DATA); 391 r = RREG32(MC_IND_DATA);
414 WREG32(R520_MC_IND_INDEX, 0); 392 WREG32(MC_IND_INDEX, 0);
415 return r; 393 return r;
416} 394}
417 395
418void rv515_mc_wreg(struct radeon_device *rdev, uint32_t reg, uint32_t v) 396void rv515_mc_wreg(struct radeon_device *rdev, uint32_t reg, uint32_t v)
419{ 397{
420 WREG32(R520_MC_IND_INDEX, 0xff0000 | ((reg) & 0xffff)); 398 WREG32(MC_IND_INDEX, 0xff0000 | ((reg) & 0xffff));
421 WREG32(R520_MC_IND_DATA, (v)); 399 WREG32(MC_IND_DATA, (v));
422 WREG32(R520_MC_IND_INDEX, 0); 400 WREG32(MC_IND_INDEX, 0);
423} 401}
424 402
425uint32_t rv515_pcie_rreg(struct radeon_device *rdev, uint32_t reg) 403uint32_t rv515_pcie_rreg(struct radeon_device *rdev, uint32_t reg)
426{ 404{
427 uint32_t r; 405 uint32_t r;
428 406
429 WREG32(RADEON_PCIE_INDEX, ((reg) & 0x7ff)); 407 WREG32(PCIE_INDEX, ((reg) & 0x7ff));
430 (void)RREG32(RADEON_PCIE_INDEX); 408 (void)RREG32(PCIE_INDEX);
431 r = RREG32(RADEON_PCIE_DATA); 409 r = RREG32(PCIE_DATA);
432 return r; 410 return r;
433} 411}
434 412
435void rv515_pcie_wreg(struct radeon_device *rdev, uint32_t reg, uint32_t v) 413void rv515_pcie_wreg(struct radeon_device *rdev, uint32_t reg, uint32_t v)
436{ 414{
437 WREG32(RADEON_PCIE_INDEX, ((reg) & 0x7ff)); 415 WREG32(PCIE_INDEX, ((reg) & 0x7ff));
438 (void)RREG32(RADEON_PCIE_INDEX); 416 (void)RREG32(PCIE_INDEX);
439 WREG32(RADEON_PCIE_DATA, (v)); 417 WREG32(PCIE_DATA, (v));
440 (void)RREG32(RADEON_PCIE_DATA); 418 (void)RREG32(PCIE_DATA);
441} 419}
442 420
443 421
@@ -452,13 +430,13 @@ static int rv515_debugfs_pipes_info(struct seq_file *m, void *data)
452 struct radeon_device *rdev = dev->dev_private; 430 struct radeon_device *rdev = dev->dev_private;
453 uint32_t tmp; 431 uint32_t tmp;
454 432
455 tmp = RREG32(R400_GB_PIPE_SELECT); 433 tmp = RREG32(GB_PIPE_SELECT);
456 seq_printf(m, "GB_PIPE_SELECT 0x%08x\n", tmp); 434 seq_printf(m, "GB_PIPE_SELECT 0x%08x\n", tmp);
457 tmp = RREG32(R500_SU_REG_DEST); 435 tmp = RREG32(SU_REG_DEST);
458 seq_printf(m, "SU_REG_DEST 0x%08x\n", tmp); 436 seq_printf(m, "SU_REG_DEST 0x%08x\n", tmp);
459 tmp = RREG32(R300_GB_TILE_CONFIG); 437 tmp = RREG32(GB_TILE_CONFIG);
460 seq_printf(m, "GB_TILE_CONFIG 0x%08x\n", tmp); 438 seq_printf(m, "GB_TILE_CONFIG 0x%08x\n", tmp);
461 tmp = RREG32(R300_DST_PIPE_CONFIG); 439 tmp = RREG32(DST_PIPE_CONFIG);
462 seq_printf(m, "DST_PIPE_CONFIG 0x%08x\n", tmp); 440 seq_printf(m, "DST_PIPE_CONFIG 0x%08x\n", tmp);
463 return 0; 441 return 0;
464} 442}
@@ -509,9 +487,9 @@ int rv515_debugfs_ga_info_init(struct radeon_device *rdev)
509/* 487/*
510 * Asic initialization 488 * Asic initialization
511 */ 489 */
512static const unsigned r500_reg_safe_bm[159] = { 490static const unsigned r500_reg_safe_bm[219] = {
491 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF,
513 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 492 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF,
514 0xFFFFFFBF, 0xFFFFFFFF, 0xFFFFFFBF, 0xFFFFFFFF,
515 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 493 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF,
516 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 494 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF,
517 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 495 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF,
@@ -549,14 +527,575 @@ static const unsigned r500_reg_safe_bm[159] = {
549 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 527 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF,
550 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFF80FFFF, 528 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFF80FFFF,
551 0x00000000, 0x00000000, 0x00000000, 0x00000000, 529 0x00000000, 0x00000000, 0x00000000, 0x00000000,
552 0x0003FC01, 0x3FFFFCF8, 0xFE800B19, 530 0x0003FC01, 0x3FFFFCF8, 0xFE800B19, 0xFFFFFFFF,
531 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF,
532 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF,
533 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF,
534 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF,
535 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF,
536 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF,
537 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF,
538 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF,
539 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF,
540 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF,
541 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF,
542 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF,
543 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF,
544 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF,
545 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF,
553}; 546};
554 547
555
556
557int rv515_init(struct radeon_device *rdev) 548int rv515_init(struct radeon_device *rdev)
558{ 549{
559 rdev->config.r300.reg_safe_bm = r500_reg_safe_bm; 550 rdev->config.r300.reg_safe_bm = r500_reg_safe_bm;
560 rdev->config.r300.reg_safe_bm_size = ARRAY_SIZE(r500_reg_safe_bm); 551 rdev->config.r300.reg_safe_bm_size = ARRAY_SIZE(r500_reg_safe_bm);
561 return 0; 552 return 0;
562} 553}
554
555void atom_rv515_force_tv_scaler(struct radeon_device *rdev)
556{
557
558 WREG32(0x659C, 0x0);
559 WREG32(0x6594, 0x705);
560 WREG32(0x65A4, 0x10001);
561 WREG32(0x65D8, 0x0);
562 WREG32(0x65B0, 0x0);
563 WREG32(0x65C0, 0x0);
564 WREG32(0x65D4, 0x0);
565 WREG32(0x6578, 0x0);
566 WREG32(0x657C, 0x841880A8);
567 WREG32(0x6578, 0x1);
568 WREG32(0x657C, 0x84208680);
569 WREG32(0x6578, 0x2);
570 WREG32(0x657C, 0xBFF880B0);
571 WREG32(0x6578, 0x100);
572 WREG32(0x657C, 0x83D88088);
573 WREG32(0x6578, 0x101);
574 WREG32(0x657C, 0x84608680);
575 WREG32(0x6578, 0x102);
576 WREG32(0x657C, 0xBFF080D0);
577 WREG32(0x6578, 0x200);
578 WREG32(0x657C, 0x83988068);
579 WREG32(0x6578, 0x201);
580 WREG32(0x657C, 0x84A08680);
581 WREG32(0x6578, 0x202);
582 WREG32(0x657C, 0xBFF080F8);
583 WREG32(0x6578, 0x300);
584 WREG32(0x657C, 0x83588058);
585 WREG32(0x6578, 0x301);
586 WREG32(0x657C, 0x84E08660);
587 WREG32(0x6578, 0x302);
588 WREG32(0x657C, 0xBFF88120);
589 WREG32(0x6578, 0x400);
590 WREG32(0x657C, 0x83188040);
591 WREG32(0x6578, 0x401);
592 WREG32(0x657C, 0x85008660);
593 WREG32(0x6578, 0x402);
594 WREG32(0x657C, 0xBFF88150);
595 WREG32(0x6578, 0x500);
596 WREG32(0x657C, 0x82D88030);
597 WREG32(0x6578, 0x501);
598 WREG32(0x657C, 0x85408640);
599 WREG32(0x6578, 0x502);
600 WREG32(0x657C, 0xBFF88180);
601 WREG32(0x6578, 0x600);
602 WREG32(0x657C, 0x82A08018);
603 WREG32(0x6578, 0x601);
604 WREG32(0x657C, 0x85808620);
605 WREG32(0x6578, 0x602);
606 WREG32(0x657C, 0xBFF081B8);
607 WREG32(0x6578, 0x700);
608 WREG32(0x657C, 0x82608010);
609 WREG32(0x6578, 0x701);
610 WREG32(0x657C, 0x85A08600);
611 WREG32(0x6578, 0x702);
612 WREG32(0x657C, 0x800081F0);
613 WREG32(0x6578, 0x800);
614 WREG32(0x657C, 0x8228BFF8);
615 WREG32(0x6578, 0x801);
616 WREG32(0x657C, 0x85E085E0);
617 WREG32(0x6578, 0x802);
618 WREG32(0x657C, 0xBFF88228);
619 WREG32(0x6578, 0x10000);
620 WREG32(0x657C, 0x82A8BF00);
621 WREG32(0x6578, 0x10001);
622 WREG32(0x657C, 0x82A08CC0);
623 WREG32(0x6578, 0x10002);
624 WREG32(0x657C, 0x8008BEF8);
625 WREG32(0x6578, 0x10100);
626 WREG32(0x657C, 0x81F0BF28);
627 WREG32(0x6578, 0x10101);
628 WREG32(0x657C, 0x83608CA0);
629 WREG32(0x6578, 0x10102);
630 WREG32(0x657C, 0x8018BED0);
631 WREG32(0x6578, 0x10200);
632 WREG32(0x657C, 0x8148BF38);
633 WREG32(0x6578, 0x10201);
634 WREG32(0x657C, 0x84408C80);
635 WREG32(0x6578, 0x10202);
636 WREG32(0x657C, 0x8008BEB8);
637 WREG32(0x6578, 0x10300);
638 WREG32(0x657C, 0x80B0BF78);
639 WREG32(0x6578, 0x10301);
640 WREG32(0x657C, 0x85008C20);
641 WREG32(0x6578, 0x10302);
642 WREG32(0x657C, 0x8020BEA0);
643 WREG32(0x6578, 0x10400);
644 WREG32(0x657C, 0x8028BF90);
645 WREG32(0x6578, 0x10401);
646 WREG32(0x657C, 0x85E08BC0);
647 WREG32(0x6578, 0x10402);
648 WREG32(0x657C, 0x8018BE90);
649 WREG32(0x6578, 0x10500);
650 WREG32(0x657C, 0xBFB8BFB0);
651 WREG32(0x6578, 0x10501);
652 WREG32(0x657C, 0x86C08B40);
653 WREG32(0x6578, 0x10502);
654 WREG32(0x657C, 0x8010BE90);
655 WREG32(0x6578, 0x10600);
656 WREG32(0x657C, 0xBF58BFC8);
657 WREG32(0x6578, 0x10601);
658 WREG32(0x657C, 0x87A08AA0);
659 WREG32(0x6578, 0x10602);
660 WREG32(0x657C, 0x8010BE98);
661 WREG32(0x6578, 0x10700);
662 WREG32(0x657C, 0xBF10BFF0);
663 WREG32(0x6578, 0x10701);
664 WREG32(0x657C, 0x886089E0);
665 WREG32(0x6578, 0x10702);
666 WREG32(0x657C, 0x8018BEB0);
667 WREG32(0x6578, 0x10800);
668 WREG32(0x657C, 0xBED8BFE8);
669 WREG32(0x6578, 0x10801);
670 WREG32(0x657C, 0x89408940);
671 WREG32(0x6578, 0x10802);
672 WREG32(0x657C, 0xBFE8BED8);
673 WREG32(0x6578, 0x20000);
674 WREG32(0x657C, 0x80008000);
675 WREG32(0x6578, 0x20001);
676 WREG32(0x657C, 0x90008000);
677 WREG32(0x6578, 0x20002);
678 WREG32(0x657C, 0x80008000);
679 WREG32(0x6578, 0x20003);
680 WREG32(0x657C, 0x80008000);
681 WREG32(0x6578, 0x20100);
682 WREG32(0x657C, 0x80108000);
683 WREG32(0x6578, 0x20101);
684 WREG32(0x657C, 0x8FE0BF70);
685 WREG32(0x6578, 0x20102);
686 WREG32(0x657C, 0xBFE880C0);
687 WREG32(0x6578, 0x20103);
688 WREG32(0x657C, 0x80008000);
689 WREG32(0x6578, 0x20200);
690 WREG32(0x657C, 0x8018BFF8);
691 WREG32(0x6578, 0x20201);
692 WREG32(0x657C, 0x8F80BF08);
693 WREG32(0x6578, 0x20202);
694 WREG32(0x657C, 0xBFD081A0);
695 WREG32(0x6578, 0x20203);
696 WREG32(0x657C, 0xBFF88000);
697 WREG32(0x6578, 0x20300);
698 WREG32(0x657C, 0x80188000);
699 WREG32(0x6578, 0x20301);
700 WREG32(0x657C, 0x8EE0BEC0);
701 WREG32(0x6578, 0x20302);
702 WREG32(0x657C, 0xBFB082A0);
703 WREG32(0x6578, 0x20303);
704 WREG32(0x657C, 0x80008000);
705 WREG32(0x6578, 0x20400);
706 WREG32(0x657C, 0x80188000);
707 WREG32(0x6578, 0x20401);
708 WREG32(0x657C, 0x8E00BEA0);
709 WREG32(0x6578, 0x20402);
710 WREG32(0x657C, 0xBF8883C0);
711 WREG32(0x6578, 0x20403);
712 WREG32(0x657C, 0x80008000);
713 WREG32(0x6578, 0x20500);
714 WREG32(0x657C, 0x80188000);
715 WREG32(0x6578, 0x20501);
716 WREG32(0x657C, 0x8D00BE90);
717 WREG32(0x6578, 0x20502);
718 WREG32(0x657C, 0xBF588500);
719 WREG32(0x6578, 0x20503);
720 WREG32(0x657C, 0x80008008);
721 WREG32(0x6578, 0x20600);
722 WREG32(0x657C, 0x80188000);
723 WREG32(0x6578, 0x20601);
724 WREG32(0x657C, 0x8BC0BE98);
725 WREG32(0x6578, 0x20602);
726 WREG32(0x657C, 0xBF308660);
727 WREG32(0x6578, 0x20603);
728 WREG32(0x657C, 0x80008008);
729 WREG32(0x6578, 0x20700);
730 WREG32(0x657C, 0x80108000);
731 WREG32(0x6578, 0x20701);
732 WREG32(0x657C, 0x8A80BEB0);
733 WREG32(0x6578, 0x20702);
734 WREG32(0x657C, 0xBF0087C0);
735 WREG32(0x6578, 0x20703);
736 WREG32(0x657C, 0x80008008);
737 WREG32(0x6578, 0x20800);
738 WREG32(0x657C, 0x80108000);
739 WREG32(0x6578, 0x20801);
740 WREG32(0x657C, 0x8920BED0);
741 WREG32(0x6578, 0x20802);
742 WREG32(0x657C, 0xBED08920);
743 WREG32(0x6578, 0x20803);
744 WREG32(0x657C, 0x80008010);
745 WREG32(0x6578, 0x30000);
746 WREG32(0x657C, 0x90008000);
747 WREG32(0x6578, 0x30001);
748 WREG32(0x657C, 0x80008000);
749 WREG32(0x6578, 0x30100);
750 WREG32(0x657C, 0x8FE0BF90);
751 WREG32(0x6578, 0x30101);
752 WREG32(0x657C, 0xBFF880A0);
753 WREG32(0x6578, 0x30200);
754 WREG32(0x657C, 0x8F60BF40);
755 WREG32(0x6578, 0x30201);
756 WREG32(0x657C, 0xBFE88180);
757 WREG32(0x6578, 0x30300);
758 WREG32(0x657C, 0x8EC0BF00);
759 WREG32(0x6578, 0x30301);
760 WREG32(0x657C, 0xBFC88280);
761 WREG32(0x6578, 0x30400);
762 WREG32(0x657C, 0x8DE0BEE0);
763 WREG32(0x6578, 0x30401);
764 WREG32(0x657C, 0xBFA083A0);
765 WREG32(0x6578, 0x30500);
766 WREG32(0x657C, 0x8CE0BED0);
767 WREG32(0x6578, 0x30501);
768 WREG32(0x657C, 0xBF7884E0);
769 WREG32(0x6578, 0x30600);
770 WREG32(0x657C, 0x8BA0BED8);
771 WREG32(0x6578, 0x30601);
772 WREG32(0x657C, 0xBF508640);
773 WREG32(0x6578, 0x30700);
774 WREG32(0x657C, 0x8A60BEE8);
775 WREG32(0x6578, 0x30701);
776 WREG32(0x657C, 0xBF2087A0);
777 WREG32(0x6578, 0x30800);
778 WREG32(0x657C, 0x8900BF00);
779 WREG32(0x6578, 0x30801);
780 WREG32(0x657C, 0xBF008900);
781}
782
783struct rv515_watermark {
784 u32 lb_request_fifo_depth;
785 fixed20_12 num_line_pair;
786 fixed20_12 estimated_width;
787 fixed20_12 worst_case_latency;
788 fixed20_12 consumption_rate;
789 fixed20_12 active_time;
790 fixed20_12 dbpp;
791 fixed20_12 priority_mark_max;
792 fixed20_12 priority_mark;
793 fixed20_12 sclk;
794};
795
796void rv515_crtc_bandwidth_compute(struct radeon_device *rdev,
797 struct radeon_crtc *crtc,
798 struct rv515_watermark *wm)
799{
800 struct drm_display_mode *mode = &crtc->base.mode;
801 fixed20_12 a, b, c;
802 fixed20_12 pclk, request_fifo_depth, tolerable_latency, estimated_width;
803 fixed20_12 consumption_time, line_time, chunk_time, read_delay_latency;
804
805 if (!crtc->base.enabled) {
806 /* FIXME: wouldn't it better to set priority mark to maximum */
807 wm->lb_request_fifo_depth = 4;
808 return;
809 }
810
811 if (crtc->vsc.full > rfixed_const(2))
812 wm->num_line_pair.full = rfixed_const(2);
813 else
814 wm->num_line_pair.full = rfixed_const(1);
815
816 b.full = rfixed_const(mode->crtc_hdisplay);
817 c.full = rfixed_const(256);
818 a.full = rfixed_mul(wm->num_line_pair, b);
819 request_fifo_depth.full = rfixed_div(a, c);
820 if (a.full < rfixed_const(4)) {
821 wm->lb_request_fifo_depth = 4;
822 } else {
823 wm->lb_request_fifo_depth = rfixed_trunc(request_fifo_depth);
824 }
825
826 /* Determine consumption rate
827 * pclk = pixel clock period(ns) = 1000 / (mode.clock / 1000)
828 * vtaps = number of vertical taps,
829 * vsc = vertical scaling ratio, defined as source/destination
830 * hsc = horizontal scaling ration, defined as source/destination
831 */
832 a.full = rfixed_const(mode->clock);
833 b.full = rfixed_const(1000);
834 a.full = rfixed_div(a, b);
835 pclk.full = rfixed_div(b, a);
836 if (crtc->rmx_type != RMX_OFF) {
837 b.full = rfixed_const(2);
838 if (crtc->vsc.full > b.full)
839 b.full = crtc->vsc.full;
840 b.full = rfixed_mul(b, crtc->hsc);
841 c.full = rfixed_const(2);
842 b.full = rfixed_div(b, c);
843 consumption_time.full = rfixed_div(pclk, b);
844 } else {
845 consumption_time.full = pclk.full;
846 }
847 a.full = rfixed_const(1);
848 wm->consumption_rate.full = rfixed_div(a, consumption_time);
849
850
851 /* Determine line time
852 * LineTime = total time for one line of displayhtotal
853 * LineTime = total number of horizontal pixels
854 * pclk = pixel clock period(ns)
855 */
856 a.full = rfixed_const(crtc->base.mode.crtc_htotal);
857 line_time.full = rfixed_mul(a, pclk);
858
859 /* Determine active time
860 * ActiveTime = time of active region of display within one line,
861 * hactive = total number of horizontal active pixels
862 * htotal = total number of horizontal pixels
863 */
864 a.full = rfixed_const(crtc->base.mode.crtc_htotal);
865 b.full = rfixed_const(crtc->base.mode.crtc_hdisplay);
866 wm->active_time.full = rfixed_mul(line_time, b);
867 wm->active_time.full = rfixed_div(wm->active_time, a);
868
869 /* Determine chunk time
870 * ChunkTime = the time it takes the DCP to send one chunk of data
871 * to the LB which consists of pipeline delay and inter chunk gap
872 * sclk = system clock(Mhz)
873 */
874 a.full = rfixed_const(600 * 1000);
875 chunk_time.full = rfixed_div(a, rdev->pm.sclk);
876 read_delay_latency.full = rfixed_const(1000);
877
878 /* Determine the worst case latency
879 * NumLinePair = Number of line pairs to request(1=2 lines, 2=4 lines)
880 * WorstCaseLatency = worst case time from urgent to when the MC starts
881 * to return data
882 * READ_DELAY_IDLE_MAX = constant of 1us
883 * ChunkTime = time it takes the DCP to send one chunk of data to the LB
884 * which consists of pipeline delay and inter chunk gap
885 */
886 if (rfixed_trunc(wm->num_line_pair) > 1) {
887 a.full = rfixed_const(3);
888 wm->worst_case_latency.full = rfixed_mul(a, chunk_time);
889 wm->worst_case_latency.full += read_delay_latency.full;
890 } else {
891 wm->worst_case_latency.full = chunk_time.full + read_delay_latency.full;
892 }
893
894 /* Determine the tolerable latency
895 * TolerableLatency = Any given request has only 1 line time
896 * for the data to be returned
897 * LBRequestFifoDepth = Number of chunk requests the LB can
898 * put into the request FIFO for a display
899 * LineTime = total time for one line of display
900 * ChunkTime = the time it takes the DCP to send one chunk
901 * of data to the LB which consists of
902 * pipeline delay and inter chunk gap
903 */
904 if ((2+wm->lb_request_fifo_depth) >= rfixed_trunc(request_fifo_depth)) {
905 tolerable_latency.full = line_time.full;
906 } else {
907 tolerable_latency.full = rfixed_const(wm->lb_request_fifo_depth - 2);
908 tolerable_latency.full = request_fifo_depth.full - tolerable_latency.full;
909 tolerable_latency.full = rfixed_mul(tolerable_latency, chunk_time);
910 tolerable_latency.full = line_time.full - tolerable_latency.full;
911 }
912 /* We assume worst case 32bits (4 bytes) */
913 wm->dbpp.full = rfixed_const(2 * 16);
914
915 /* Determine the maximum priority mark
916 * width = viewport width in pixels
917 */
918 a.full = rfixed_const(16);
919 wm->priority_mark_max.full = rfixed_const(crtc->base.mode.crtc_hdisplay);
920 wm->priority_mark_max.full = rfixed_div(wm->priority_mark_max, a);
921
922 /* Determine estimated width */
923 estimated_width.full = tolerable_latency.full - wm->worst_case_latency.full;
924 estimated_width.full = rfixed_div(estimated_width, consumption_time);
925 if (rfixed_trunc(estimated_width) > crtc->base.mode.crtc_hdisplay) {
926 wm->priority_mark.full = rfixed_const(10);
927 } else {
928 a.full = rfixed_const(16);
929 wm->priority_mark.full = rfixed_div(estimated_width, a);
930 wm->priority_mark.full = wm->priority_mark_max.full - wm->priority_mark.full;
931 }
932}
933
934void rv515_bandwidth_avivo_update(struct radeon_device *rdev)
935{
936 struct drm_display_mode *mode0 = NULL;
937 struct drm_display_mode *mode1 = NULL;
938 struct rv515_watermark wm0;
939 struct rv515_watermark wm1;
940 u32 tmp;
941 fixed20_12 priority_mark02, priority_mark12, fill_rate;
942 fixed20_12 a, b;
943
944 if (rdev->mode_info.crtcs[0]->base.enabled)
945 mode0 = &rdev->mode_info.crtcs[0]->base.mode;
946 if (rdev->mode_info.crtcs[1]->base.enabled)
947 mode1 = &rdev->mode_info.crtcs[1]->base.mode;
948 rs690_line_buffer_adjust(rdev, mode0, mode1);
949
950 rv515_crtc_bandwidth_compute(rdev, rdev->mode_info.crtcs[0], &wm0);
951 rv515_crtc_bandwidth_compute(rdev, rdev->mode_info.crtcs[1], &wm1);
952
953 tmp = wm0.lb_request_fifo_depth;
954 tmp |= wm1.lb_request_fifo_depth << 16;
955 WREG32(LB_MAX_REQ_OUTSTANDING, tmp);
956
957 if (mode0 && mode1) {
958 if (rfixed_trunc(wm0.dbpp) > 64)
959 a.full = rfixed_div(wm0.dbpp, wm0.num_line_pair);
960 else
961 a.full = wm0.num_line_pair.full;
962 if (rfixed_trunc(wm1.dbpp) > 64)
963 b.full = rfixed_div(wm1.dbpp, wm1.num_line_pair);
964 else
965 b.full = wm1.num_line_pair.full;
966 a.full += b.full;
967 fill_rate.full = rfixed_div(wm0.sclk, a);
968 if (wm0.consumption_rate.full > fill_rate.full) {
969 b.full = wm0.consumption_rate.full - fill_rate.full;
970 b.full = rfixed_mul(b, wm0.active_time);
971 a.full = rfixed_const(16);
972 b.full = rfixed_div(b, a);
973 a.full = rfixed_mul(wm0.worst_case_latency,
974 wm0.consumption_rate);
975 priority_mark02.full = a.full + b.full;
976 } else {
977 a.full = rfixed_mul(wm0.worst_case_latency,
978 wm0.consumption_rate);
979 b.full = rfixed_const(16 * 1000);
980 priority_mark02.full = rfixed_div(a, b);
981 }
982 if (wm1.consumption_rate.full > fill_rate.full) {
983 b.full = wm1.consumption_rate.full - fill_rate.full;
984 b.full = rfixed_mul(b, wm1.active_time);
985 a.full = rfixed_const(16);
986 b.full = rfixed_div(b, a);
987 a.full = rfixed_mul(wm1.worst_case_latency,
988 wm1.consumption_rate);
989 priority_mark12.full = a.full + b.full;
990 } else {
991 a.full = rfixed_mul(wm1.worst_case_latency,
992 wm1.consumption_rate);
993 b.full = rfixed_const(16 * 1000);
994 priority_mark12.full = rfixed_div(a, b);
995 }
996 if (wm0.priority_mark.full > priority_mark02.full)
997 priority_mark02.full = wm0.priority_mark.full;
998 if (rfixed_trunc(priority_mark02) < 0)
999 priority_mark02.full = 0;
1000 if (wm0.priority_mark_max.full > priority_mark02.full)
1001 priority_mark02.full = wm0.priority_mark_max.full;
1002 if (wm1.priority_mark.full > priority_mark12.full)
1003 priority_mark12.full = wm1.priority_mark.full;
1004 if (rfixed_trunc(priority_mark12) < 0)
1005 priority_mark12.full = 0;
1006 if (wm1.priority_mark_max.full > priority_mark12.full)
1007 priority_mark12.full = wm1.priority_mark_max.full;
1008 WREG32(D1MODE_PRIORITY_A_CNT, rfixed_trunc(priority_mark02));
1009 WREG32(D1MODE_PRIORITY_B_CNT, rfixed_trunc(priority_mark02));
1010 WREG32(D2MODE_PRIORITY_A_CNT, rfixed_trunc(priority_mark12));
1011 WREG32(D2MODE_PRIORITY_B_CNT, rfixed_trunc(priority_mark12));
1012 } else if (mode0) {
1013 if (rfixed_trunc(wm0.dbpp) > 64)
1014 a.full = rfixed_div(wm0.dbpp, wm0.num_line_pair);
1015 else
1016 a.full = wm0.num_line_pair.full;
1017 fill_rate.full = rfixed_div(wm0.sclk, a);
1018 if (wm0.consumption_rate.full > fill_rate.full) {
1019 b.full = wm0.consumption_rate.full - fill_rate.full;
1020 b.full = rfixed_mul(b, wm0.active_time);
1021 a.full = rfixed_const(16);
1022 b.full = rfixed_div(b, a);
1023 a.full = rfixed_mul(wm0.worst_case_latency,
1024 wm0.consumption_rate);
1025 priority_mark02.full = a.full + b.full;
1026 } else {
1027 a.full = rfixed_mul(wm0.worst_case_latency,
1028 wm0.consumption_rate);
1029 b.full = rfixed_const(16);
1030 priority_mark02.full = rfixed_div(a, b);
1031 }
1032 if (wm0.priority_mark.full > priority_mark02.full)
1033 priority_mark02.full = wm0.priority_mark.full;
1034 if (rfixed_trunc(priority_mark02) < 0)
1035 priority_mark02.full = 0;
1036 if (wm0.priority_mark_max.full > priority_mark02.full)
1037 priority_mark02.full = wm0.priority_mark_max.full;
1038 WREG32(D1MODE_PRIORITY_A_CNT, rfixed_trunc(priority_mark02));
1039 WREG32(D1MODE_PRIORITY_B_CNT, rfixed_trunc(priority_mark02));
1040 WREG32(D2MODE_PRIORITY_A_CNT, MODE_PRIORITY_OFF);
1041 WREG32(D2MODE_PRIORITY_B_CNT, MODE_PRIORITY_OFF);
1042 } else {
1043 if (rfixed_trunc(wm1.dbpp) > 64)
1044 a.full = rfixed_div(wm1.dbpp, wm1.num_line_pair);
1045 else
1046 a.full = wm1.num_line_pair.full;
1047 fill_rate.full = rfixed_div(wm1.sclk, a);
1048 if (wm1.consumption_rate.full > fill_rate.full) {
1049 b.full = wm1.consumption_rate.full - fill_rate.full;
1050 b.full = rfixed_mul(b, wm1.active_time);
1051 a.full = rfixed_const(16);
1052 b.full = rfixed_div(b, a);
1053 a.full = rfixed_mul(wm1.worst_case_latency,
1054 wm1.consumption_rate);
1055 priority_mark12.full = a.full + b.full;
1056 } else {
1057 a.full = rfixed_mul(wm1.worst_case_latency,
1058 wm1.consumption_rate);
1059 b.full = rfixed_const(16 * 1000);
1060 priority_mark12.full = rfixed_div(a, b);
1061 }
1062 if (wm1.priority_mark.full > priority_mark12.full)
1063 priority_mark12.full = wm1.priority_mark.full;
1064 if (rfixed_trunc(priority_mark12) < 0)
1065 priority_mark12.full = 0;
1066 if (wm1.priority_mark_max.full > priority_mark12.full)
1067 priority_mark12.full = wm1.priority_mark_max.full;
1068 WREG32(D1MODE_PRIORITY_A_CNT, MODE_PRIORITY_OFF);
1069 WREG32(D1MODE_PRIORITY_B_CNT, MODE_PRIORITY_OFF);
1070 WREG32(D2MODE_PRIORITY_A_CNT, rfixed_trunc(priority_mark12));
1071 WREG32(D2MODE_PRIORITY_B_CNT, rfixed_trunc(priority_mark12));
1072 }
1073}
1074
1075void rv515_bandwidth_update(struct radeon_device *rdev)
1076{
1077 uint32_t tmp;
1078 struct drm_display_mode *mode0 = NULL;
1079 struct drm_display_mode *mode1 = NULL;
1080
1081 if (rdev->mode_info.crtcs[0]->base.enabled)
1082 mode0 = &rdev->mode_info.crtcs[0]->base.mode;
1083 if (rdev->mode_info.crtcs[1]->base.enabled)
1084 mode1 = &rdev->mode_info.crtcs[1]->base.mode;
1085 /*
1086 * Set display0/1 priority up in the memory controller for
1087 * modes if the user specifies HIGH for displaypriority
1088 * option.
1089 */
1090 if (rdev->disp_priority == 2) {
1091 tmp = RREG32_MC(MC_MISC_LAT_TIMER);
1092 tmp &= ~MC_DISP1R_INIT_LAT_MASK;
1093 tmp &= ~MC_DISP0R_INIT_LAT_MASK;
1094 if (mode1)
1095 tmp |= (1 << MC_DISP1R_INIT_LAT_SHIFT);
1096 if (mode0)
1097 tmp |= (1 << MC_DISP0R_INIT_LAT_SHIFT);
1098 WREG32_MC(MC_MISC_LAT_TIMER, tmp);
1099 }
1100 rv515_bandwidth_avivo_update(rdev);
1101}
diff --git a/drivers/gpu/drm/radeon/rv515r.h b/drivers/gpu/drm/radeon/rv515r.h
new file mode 100644
index 000000000000..f3cf84039906
--- /dev/null
+++ b/drivers/gpu/drm/radeon/rv515r.h
@@ -0,0 +1,170 @@
1/*
2 * Copyright 2008 Advanced Micro Devices, Inc.
3 * Copyright 2008 Red Hat Inc.
4 * Copyright 2009 Jerome Glisse.
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * copy of this software and associated documentation files (the "Software"),
8 * to deal in the Software without restriction, including without limitation
9 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
10 * and/or sell copies of the Software, and to permit persons to whom the
11 * Software is furnished to do so, subject to the following conditions:
12 *
13 * The above copyright notice and this permission notice shall be included in
14 * all copies or substantial portions of the Software.
15 *
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19 * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
20 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
21 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22 * OTHER DEALINGS IN THE SOFTWARE.
23 *
24 * Authors: Dave Airlie
25 * Alex Deucher
26 * Jerome Glisse
27 */
28#ifndef RV515R_H
29#define RV515R_H
30
31/* RV515 registers */
32#define PCIE_INDEX 0x0030
33#define PCIE_DATA 0x0034
34#define MC_IND_INDEX 0x0070
35#define MC_IND_WR_EN (1 << 24)
36#define MC_IND_DATA 0x0074
37#define RBBM_SOFT_RESET 0x00F0
38#define CONFIG_MEMSIZE 0x00F8
39#define HDP_FB_LOCATION 0x0134
40#define CP_CSQ_CNTL 0x0740
41#define CP_CSQ_MODE 0x0744
42#define CP_CSQ_ADDR 0x07F0
43#define CP_CSQ_DATA 0x07F4
44#define CP_CSQ_STAT 0x07F8
45#define CP_CSQ2_STAT 0x07FC
46#define RBBM_STATUS 0x0E40
47#define DST_PIPE_CONFIG 0x170C
48#define WAIT_UNTIL 0x1720
49#define WAIT_2D_IDLE (1 << 14)
50#define WAIT_3D_IDLE (1 << 15)
51#define WAIT_2D_IDLECLEAN (1 << 16)
52#define WAIT_3D_IDLECLEAN (1 << 17)
53#define ISYNC_CNTL 0x1724
54#define ISYNC_ANY2D_IDLE3D (1 << 0)
55#define ISYNC_ANY3D_IDLE2D (1 << 1)
56#define ISYNC_TRIG2D_IDLE3D (1 << 2)
57#define ISYNC_TRIG3D_IDLE2D (1 << 3)
58#define ISYNC_WAIT_IDLEGUI (1 << 4)
59#define ISYNC_CPSCRATCH_IDLEGUI (1 << 5)
60#define VAP_INDEX_OFFSET 0x208C
61#define VAP_PVS_STATE_FLUSH_REG 0x2284
62#define GB_ENABLE 0x4008
63#define GB_MSPOS0 0x4010
64#define MS_X0_SHIFT 0
65#define MS_Y0_SHIFT 4
66#define MS_X1_SHIFT 8
67#define MS_Y1_SHIFT 12
68#define MS_X2_SHIFT 16
69#define MS_Y2_SHIFT 20
70#define MSBD0_Y_SHIFT 24
71#define MSBD0_X_SHIFT 28
72#define GB_MSPOS1 0x4014
73#define MS_X3_SHIFT 0
74#define MS_Y3_SHIFT 4
75#define MS_X4_SHIFT 8
76#define MS_Y4_SHIFT 12
77#define MS_X5_SHIFT 16
78#define MS_Y5_SHIFT 20
79#define MSBD1_SHIFT 24
80#define GB_TILE_CONFIG 0x4018
81#define ENABLE_TILING (1 << 0)
82#define PIPE_COUNT_MASK 0x0000000E
83#define PIPE_COUNT_SHIFT 1
84#define TILE_SIZE_8 (0 << 4)
85#define TILE_SIZE_16 (1 << 4)
86#define TILE_SIZE_32 (2 << 4)
87#define SUBPIXEL_1_12 (0 << 16)
88#define SUBPIXEL_1_16 (1 << 16)
89#define GB_SELECT 0x401C
90#define GB_AA_CONFIG 0x4020
91#define GB_PIPE_SELECT 0x402C
92#define GA_ENHANCE 0x4274
93#define GA_DEADLOCK_CNTL (1 << 0)
94#define GA_FASTSYNC_CNTL (1 << 1)
95#define GA_POLY_MODE 0x4288
96#define FRONT_PTYPE_POINT (0 << 4)
97#define FRONT_PTYPE_LINE (1 << 4)
98#define FRONT_PTYPE_TRIANGE (2 << 4)
99#define BACK_PTYPE_POINT (0 << 7)
100#define BACK_PTYPE_LINE (1 << 7)
101#define BACK_PTYPE_TRIANGE (2 << 7)
102#define GA_ROUND_MODE 0x428C
103#define GEOMETRY_ROUND_TRUNC (0 << 0)
104#define GEOMETRY_ROUND_NEAREST (1 << 0)
105#define COLOR_ROUND_TRUNC (0 << 2)
106#define COLOR_ROUND_NEAREST (1 << 2)
107#define SU_REG_DEST 0x42C8
108#define RB3D_DSTCACHE_CTLSTAT 0x4E4C
109#define RB3D_DC_FLUSH (2 << 0)
110#define RB3D_DC_FREE (2 << 2)
111#define RB3D_DC_FINISH (1 << 4)
112#define ZB_ZCACHE_CTLSTAT 0x4F18
113#define ZC_FLUSH (1 << 0)
114#define ZC_FREE (1 << 1)
115#define DC_LB_MEMORY_SPLIT 0x6520
116#define DC_LB_MEMORY_SPLIT_MASK 0x00000003
117#define DC_LB_MEMORY_SPLIT_SHIFT 0
118#define DC_LB_MEMORY_SPLIT_D1HALF_D2HALF 0
119#define DC_LB_MEMORY_SPLIT_D1_3Q_D2_1Q 1
120#define DC_LB_MEMORY_SPLIT_D1_ONLY 2
121#define DC_LB_MEMORY_SPLIT_D1_1Q_D2_3Q 3
122#define DC_LB_MEMORY_SPLIT_SHIFT_MODE (1 << 2)
123#define DC_LB_DISP1_END_ADR_SHIFT 4
124#define DC_LB_DISP1_END_ADR_MASK 0x00007FF0
125#define D1MODE_PRIORITY_A_CNT 0x6548
126#define MODE_PRIORITY_MARK_MASK 0x00007FFF
127#define MODE_PRIORITY_OFF (1 << 16)
128#define MODE_PRIORITY_ALWAYS_ON (1 << 20)
129#define MODE_PRIORITY_FORCE_MASK (1 << 24)
130#define D1MODE_PRIORITY_B_CNT 0x654C
131#define LB_MAX_REQ_OUTSTANDING 0x6D58
132#define LB_D1_MAX_REQ_OUTSTANDING_MASK 0x0000000F
133#define LB_D1_MAX_REQ_OUTSTANDING_SHIFT 0
134#define LB_D2_MAX_REQ_OUTSTANDING_MASK 0x000F0000
135#define LB_D2_MAX_REQ_OUTSTANDING_SHIFT 16
136#define D2MODE_PRIORITY_A_CNT 0x6D48
137#define D2MODE_PRIORITY_B_CNT 0x6D4C
138
139/* ix[MC] registers */
140#define MC_FB_LOCATION 0x01
141#define MC_FB_START_MASK 0x0000FFFF
142#define MC_FB_START_SHIFT 0
143#define MC_FB_TOP_MASK 0xFFFF0000
144#define MC_FB_TOP_SHIFT 16
145#define MC_AGP_LOCATION 0x02
146#define MC_AGP_START_MASK 0x0000FFFF
147#define MC_AGP_START_SHIFT 0
148#define MC_AGP_TOP_MASK 0xFFFF0000
149#define MC_AGP_TOP_SHIFT 16
150#define MC_AGP_BASE 0x03
151#define MC_AGP_BASE_2 0x04
152#define MC_CNTL 0x5
153#define MEM_NUM_CHANNELS_MASK 0x00000003
154#define MC_STATUS 0x08
155#define MC_STATUS_IDLE (1 << 4)
156#define MC_MISC_LAT_TIMER 0x09
157#define MC_CPR_INIT_LAT_MASK 0x0000000F
158#define MC_VF_INIT_LAT_MASK 0x000000F0
159#define MC_DISP0R_INIT_LAT_MASK 0x00000F00
160#define MC_DISP0R_INIT_LAT_SHIFT 8
161#define MC_DISP1R_INIT_LAT_MASK 0x0000F000
162#define MC_DISP1R_INIT_LAT_SHIFT 12
163#define MC_FIXED_INIT_LAT_MASK 0x000F0000
164#define MC_E2R_INIT_LAT_MASK 0x00F00000
165#define SAME_PAGE_PRIO_MASK 0x0F000000
166#define MC_GLOBW_INIT_LAT_MASK 0xF0000000
167
168
169#endif
170
diff --git a/drivers/gpu/drm/radeon/rv770.c b/drivers/gpu/drm/radeon/rv770.c
index da50cc51ede3..21d8ffd57308 100644
--- a/drivers/gpu/drm/radeon/rv770.c
+++ b/drivers/gpu/drm/radeon/rv770.c
@@ -67,7 +67,7 @@ int rv770_mc_init(struct radeon_device *rdev)
67 "programming pipes. Bad things might happen.\n"); 67 "programming pipes. Bad things might happen.\n");
68 } 68 }
69 69
70 tmp = rdev->mc.vram_location + rdev->mc.vram_size - 1; 70 tmp = rdev->mc.vram_location + rdev->mc.mc_vram_size - 1;
71 tmp = REG_SET(R700_MC_FB_TOP, tmp >> 24); 71 tmp = REG_SET(R700_MC_FB_TOP, tmp >> 24);
72 tmp |= REG_SET(R700_MC_FB_BASE, rdev->mc.vram_location >> 24); 72 tmp |= REG_SET(R700_MC_FB_BASE, rdev->mc.vram_location >> 24);
73 WREG32(R700_MC_VM_FB_LOCATION, tmp); 73 WREG32(R700_MC_VM_FB_LOCATION, tmp);
diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c
index c1c407f7cca3..c2b0d710d10f 100644
--- a/drivers/gpu/drm/ttm/ttm_bo.c
+++ b/drivers/gpu/drm/ttm/ttm_bo.c
@@ -43,7 +43,6 @@
43#define TTM_BO_HASH_ORDER 13 43#define TTM_BO_HASH_ORDER 13
44 44
45static int ttm_bo_setup_vm(struct ttm_buffer_object *bo); 45static int ttm_bo_setup_vm(struct ttm_buffer_object *bo);
46static void ttm_bo_unmap_virtual(struct ttm_buffer_object *bo);
47static int ttm_bo_swapout(struct ttm_mem_shrink *shrink); 46static int ttm_bo_swapout(struct ttm_mem_shrink *shrink);
48 47
49static inline uint32_t ttm_bo_type_flags(unsigned type) 48static inline uint32_t ttm_bo_type_flags(unsigned type)
@@ -224,6 +223,9 @@ static int ttm_bo_add_ttm(struct ttm_buffer_object *bo, bool zero_alloc)
224 TTM_ASSERT_LOCKED(&bo->mutex); 223 TTM_ASSERT_LOCKED(&bo->mutex);
225 bo->ttm = NULL; 224 bo->ttm = NULL;
226 225
226 if (bdev->need_dma32)
227 page_flags |= TTM_PAGE_FLAG_DMA32;
228
227 switch (bo->type) { 229 switch (bo->type) {
228 case ttm_bo_type_device: 230 case ttm_bo_type_device:
229 if (zero_alloc) 231 if (zero_alloc)
@@ -304,6 +306,9 @@ static int ttm_bo_handle_move_mem(struct ttm_buffer_object *bo,
304 306
305 } 307 }
306 308
309 if (bdev->driver->move_notify)
310 bdev->driver->move_notify(bo, mem);
311
307 if (!(old_man->flags & TTM_MEMTYPE_FLAG_FIXED) && 312 if (!(old_man->flags & TTM_MEMTYPE_FLAG_FIXED) &&
308 !(new_man->flags & TTM_MEMTYPE_FLAG_FIXED)) 313 !(new_man->flags & TTM_MEMTYPE_FLAG_FIXED))
309 ret = ttm_bo_move_ttm(bo, evict, no_wait, mem); 314 ret = ttm_bo_move_ttm(bo, evict, no_wait, mem);
@@ -655,31 +660,52 @@ retry_pre_get:
655 return 0; 660 return 0;
656} 661}
657 662
663static uint32_t ttm_bo_select_caching(struct ttm_mem_type_manager *man,
664 uint32_t cur_placement,
665 uint32_t proposed_placement)
666{
667 uint32_t caching = proposed_placement & TTM_PL_MASK_CACHING;
668 uint32_t result = proposed_placement & ~TTM_PL_MASK_CACHING;
669
670 /**
671 * Keep current caching if possible.
672 */
673
674 if ((cur_placement & caching) != 0)
675 result |= (cur_placement & caching);
676 else if ((man->default_caching & caching) != 0)
677 result |= man->default_caching;
678 else if ((TTM_PL_FLAG_CACHED & caching) != 0)
679 result |= TTM_PL_FLAG_CACHED;
680 else if ((TTM_PL_FLAG_WC & caching) != 0)
681 result |= TTM_PL_FLAG_WC;
682 else if ((TTM_PL_FLAG_UNCACHED & caching) != 0)
683 result |= TTM_PL_FLAG_UNCACHED;
684
685 return result;
686}
687
688
658static bool ttm_bo_mt_compatible(struct ttm_mem_type_manager *man, 689static bool ttm_bo_mt_compatible(struct ttm_mem_type_manager *man,
659 bool disallow_fixed, 690 bool disallow_fixed,
660 uint32_t mem_type, 691 uint32_t mem_type,
661 uint32_t mask, uint32_t *res_mask) 692 uint32_t proposed_placement,
693 uint32_t *masked_placement)
662{ 694{
663 uint32_t cur_flags = ttm_bo_type_flags(mem_type); 695 uint32_t cur_flags = ttm_bo_type_flags(mem_type);
664 696
665 if ((man->flags & TTM_MEMTYPE_FLAG_FIXED) && disallow_fixed) 697 if ((man->flags & TTM_MEMTYPE_FLAG_FIXED) && disallow_fixed)
666 return false; 698 return false;
667 699
668 if ((cur_flags & mask & TTM_PL_MASK_MEM) == 0) 700 if ((cur_flags & proposed_placement & TTM_PL_MASK_MEM) == 0)
669 return false; 701 return false;
670 702
671 if ((mask & man->available_caching) == 0) 703 if ((proposed_placement & man->available_caching) == 0)
672 return false; 704 return false;
673 if (mask & man->default_caching)
674 cur_flags |= man->default_caching;
675 else if (mask & TTM_PL_FLAG_CACHED)
676 cur_flags |= TTM_PL_FLAG_CACHED;
677 else if (mask & TTM_PL_FLAG_WC)
678 cur_flags |= TTM_PL_FLAG_WC;
679 else
680 cur_flags |= TTM_PL_FLAG_UNCACHED;
681 705
682 *res_mask = cur_flags; 706 cur_flags |= (proposed_placement & man->available_caching);
707
708 *masked_placement = cur_flags;
683 return true; 709 return true;
684} 710}
685 711
@@ -723,6 +749,9 @@ int ttm_bo_mem_space(struct ttm_buffer_object *bo,
723 if (!type_ok) 749 if (!type_ok)
724 continue; 750 continue;
725 751
752 cur_flags = ttm_bo_select_caching(man, bo->mem.placement,
753 cur_flags);
754
726 if (mem_type == TTM_PL_SYSTEM) 755 if (mem_type == TTM_PL_SYSTEM)
727 break; 756 break;
728 757
@@ -779,6 +808,9 @@ int ttm_bo_mem_space(struct ttm_buffer_object *bo,
779 proposed_placement, &cur_flags)) 808 proposed_placement, &cur_flags))
780 continue; 809 continue;
781 810
811 cur_flags = ttm_bo_select_caching(man, bo->mem.placement,
812 cur_flags);
813
782 ret = ttm_bo_mem_force_space(bdev, mem, mem_type, 814 ret = ttm_bo_mem_force_space(bdev, mem, mem_type,
783 interruptible, no_wait); 815 interruptible, no_wait);
784 816
@@ -1150,13 +1182,14 @@ static int ttm_bo_force_list_clean(struct ttm_bo_device *bdev,
1150 1182
1151int ttm_bo_clean_mm(struct ttm_bo_device *bdev, unsigned mem_type) 1183int ttm_bo_clean_mm(struct ttm_bo_device *bdev, unsigned mem_type)
1152{ 1184{
1153 struct ttm_mem_type_manager *man = &bdev->man[mem_type]; 1185 struct ttm_mem_type_manager *man;
1154 int ret = -EINVAL; 1186 int ret = -EINVAL;
1155 1187
1156 if (mem_type >= TTM_NUM_MEM_TYPES) { 1188 if (mem_type >= TTM_NUM_MEM_TYPES) {
1157 printk(KERN_ERR TTM_PFX "Illegal memory type %d\n", mem_type); 1189 printk(KERN_ERR TTM_PFX "Illegal memory type %d\n", mem_type);
1158 return ret; 1190 return ret;
1159 } 1191 }
1192 man = &bdev->man[mem_type];
1160 1193
1161 if (!man->has_type) { 1194 if (!man->has_type) {
1162 printk(KERN_ERR TTM_PFX "Trying to take down uninitialized " 1195 printk(KERN_ERR TTM_PFX "Trying to take down uninitialized "
@@ -1305,7 +1338,8 @@ EXPORT_SYMBOL(ttm_bo_device_release);
1305 1338
1306int ttm_bo_device_init(struct ttm_bo_device *bdev, 1339int ttm_bo_device_init(struct ttm_bo_device *bdev,
1307 struct ttm_mem_global *mem_glob, 1340 struct ttm_mem_global *mem_glob,
1308 struct ttm_bo_driver *driver, uint64_t file_page_offset) 1341 struct ttm_bo_driver *driver, uint64_t file_page_offset,
1342 bool need_dma32)
1309{ 1343{
1310 int ret = -EINVAL; 1344 int ret = -EINVAL;
1311 1345
@@ -1342,6 +1376,7 @@ int ttm_bo_device_init(struct ttm_bo_device *bdev,
1342 INIT_LIST_HEAD(&bdev->ddestroy); 1376 INIT_LIST_HEAD(&bdev->ddestroy);
1343 INIT_LIST_HEAD(&bdev->swap_lru); 1377 INIT_LIST_HEAD(&bdev->swap_lru);
1344 bdev->dev_mapping = NULL; 1378 bdev->dev_mapping = NULL;
1379 bdev->need_dma32 = need_dma32;
1345 ttm_mem_init_shrink(&bdev->shrink, ttm_bo_swapout); 1380 ttm_mem_init_shrink(&bdev->shrink, ttm_bo_swapout);
1346 ret = ttm_mem_register_shrink(mem_glob, &bdev->shrink); 1381 ret = ttm_mem_register_shrink(mem_glob, &bdev->shrink);
1347 if (unlikely(ret != 0)) { 1382 if (unlikely(ret != 0)) {
@@ -1419,6 +1454,7 @@ void ttm_bo_unmap_virtual(struct ttm_buffer_object *bo)
1419 1454
1420 unmap_mapping_range(bdev->dev_mapping, offset, holelen, 1); 1455 unmap_mapping_range(bdev->dev_mapping, offset, holelen, 1);
1421} 1456}
1457EXPORT_SYMBOL(ttm_bo_unmap_virtual);
1422 1458
1423static void ttm_bo_vm_insert_rb(struct ttm_buffer_object *bo) 1459static void ttm_bo_vm_insert_rb(struct ttm_buffer_object *bo)
1424{ 1460{
@@ -1540,6 +1576,10 @@ int ttm_bo_wait(struct ttm_buffer_object *bo,
1540 driver->sync_obj_unref(&sync_obj); 1576 driver->sync_obj_unref(&sync_obj);
1541 driver->sync_obj_unref(&tmp_obj); 1577 driver->sync_obj_unref(&tmp_obj);
1542 spin_lock(&bo->lock); 1578 spin_lock(&bo->lock);
1579 } else {
1580 spin_unlock(&bo->lock);
1581 driver->sync_obj_unref(&sync_obj);
1582 spin_lock(&bo->lock);
1543 } 1583 }
1544 } 1584 }
1545 return 0; 1585 return 0;
diff --git a/drivers/gpu/drm/ttm/ttm_bo_util.c b/drivers/gpu/drm/ttm/ttm_bo_util.c
index 517c84559633..ad4ada07c6cf 100644
--- a/drivers/gpu/drm/ttm/ttm_bo_util.c
+++ b/drivers/gpu/drm/ttm/ttm_bo_util.c
@@ -34,7 +34,6 @@
34#include <linux/highmem.h> 34#include <linux/highmem.h>
35#include <linux/wait.h> 35#include <linux/wait.h>
36#include <linux/vmalloc.h> 36#include <linux/vmalloc.h>
37#include <linux/version.h>
38#include <linux/module.h> 37#include <linux/module.h>
39 38
40void ttm_bo_free_old_node(struct ttm_buffer_object *bo) 39void ttm_bo_free_old_node(struct ttm_buffer_object *bo)
@@ -137,7 +136,8 @@ static int ttm_copy_io_page(void *dst, void *src, unsigned long page)
137} 136}
138 137
139static int ttm_copy_io_ttm_page(struct ttm_tt *ttm, void *src, 138static int ttm_copy_io_ttm_page(struct ttm_tt *ttm, void *src,
140 unsigned long page) 139 unsigned long page,
140 pgprot_t prot)
141{ 141{
142 struct page *d = ttm_tt_get_page(ttm, page); 142 struct page *d = ttm_tt_get_page(ttm, page);
143 void *dst; 143 void *dst;
@@ -146,17 +146,35 @@ static int ttm_copy_io_ttm_page(struct ttm_tt *ttm, void *src,
146 return -ENOMEM; 146 return -ENOMEM;
147 147
148 src = (void *)((unsigned long)src + (page << PAGE_SHIFT)); 148 src = (void *)((unsigned long)src + (page << PAGE_SHIFT));
149 dst = kmap(d); 149
150#ifdef CONFIG_X86
151 dst = kmap_atomic_prot(d, KM_USER0, prot);
152#else
153 if (pgprot_val(prot) != pgprot_val(PAGE_KERNEL))
154 dst = vmap(&d, 1, 0, prot);
155 else
156 dst = kmap(d);
157#endif
150 if (!dst) 158 if (!dst)
151 return -ENOMEM; 159 return -ENOMEM;
152 160
153 memcpy_fromio(dst, src, PAGE_SIZE); 161 memcpy_fromio(dst, src, PAGE_SIZE);
154 kunmap(d); 162
163#ifdef CONFIG_X86
164 kunmap_atomic(dst, KM_USER0);
165#else
166 if (pgprot_val(prot) != pgprot_val(PAGE_KERNEL))
167 vunmap(dst);
168 else
169 kunmap(d);
170#endif
171
155 return 0; 172 return 0;
156} 173}
157 174
158static int ttm_copy_ttm_io_page(struct ttm_tt *ttm, void *dst, 175static int ttm_copy_ttm_io_page(struct ttm_tt *ttm, void *dst,
159 unsigned long page) 176 unsigned long page,
177 pgprot_t prot)
160{ 178{
161 struct page *s = ttm_tt_get_page(ttm, page); 179 struct page *s = ttm_tt_get_page(ttm, page);
162 void *src; 180 void *src;
@@ -165,12 +183,28 @@ static int ttm_copy_ttm_io_page(struct ttm_tt *ttm, void *dst,
165 return -ENOMEM; 183 return -ENOMEM;
166 184
167 dst = (void *)((unsigned long)dst + (page << PAGE_SHIFT)); 185 dst = (void *)((unsigned long)dst + (page << PAGE_SHIFT));
168 src = kmap(s); 186#ifdef CONFIG_X86
187 src = kmap_atomic_prot(s, KM_USER0, prot);
188#else
189 if (pgprot_val(prot) != pgprot_val(PAGE_KERNEL))
190 src = vmap(&s, 1, 0, prot);
191 else
192 src = kmap(s);
193#endif
169 if (!src) 194 if (!src)
170 return -ENOMEM; 195 return -ENOMEM;
171 196
172 memcpy_toio(dst, src, PAGE_SIZE); 197 memcpy_toio(dst, src, PAGE_SIZE);
173 kunmap(s); 198
199#ifdef CONFIG_X86
200 kunmap_atomic(src, KM_USER0);
201#else
202 if (pgprot_val(prot) != pgprot_val(PAGE_KERNEL))
203 vunmap(src);
204 else
205 kunmap(s);
206#endif
207
174 return 0; 208 return 0;
175} 209}
176 210
@@ -215,11 +249,17 @@ int ttm_bo_move_memcpy(struct ttm_buffer_object *bo,
215 249
216 for (i = 0; i < new_mem->num_pages; ++i) { 250 for (i = 0; i < new_mem->num_pages; ++i) {
217 page = i * dir + add; 251 page = i * dir + add;
218 if (old_iomap == NULL) 252 if (old_iomap == NULL) {
219 ret = ttm_copy_ttm_io_page(ttm, new_iomap, page); 253 pgprot_t prot = ttm_io_prot(old_mem->placement,
220 else if (new_iomap == NULL) 254 PAGE_KERNEL);
221 ret = ttm_copy_io_ttm_page(ttm, old_iomap, page); 255 ret = ttm_copy_ttm_io_page(ttm, new_iomap, page,
222 else 256 prot);
257 } else if (new_iomap == NULL) {
258 pgprot_t prot = ttm_io_prot(new_mem->placement,
259 PAGE_KERNEL);
260 ret = ttm_copy_io_ttm_page(ttm, old_iomap, page,
261 prot);
262 } else
223 ret = ttm_copy_io_page(new_iomap, old_iomap, page); 263 ret = ttm_copy_io_page(new_iomap, old_iomap, page);
224 if (ret) 264 if (ret)
225 goto out1; 265 goto out1;
@@ -510,8 +550,8 @@ int ttm_bo_move_accel_cleanup(struct ttm_buffer_object *bo,
510 if (evict) { 550 if (evict) {
511 ret = ttm_bo_wait(bo, false, false, false); 551 ret = ttm_bo_wait(bo, false, false, false);
512 spin_unlock(&bo->lock); 552 spin_unlock(&bo->lock);
513 driver->sync_obj_unref(&bo->sync_obj); 553 if (tmp_obj)
514 554 driver->sync_obj_unref(&tmp_obj);
515 if (ret) 555 if (ret)
516 return ret; 556 return ret;
517 557
@@ -533,6 +573,8 @@ int ttm_bo_move_accel_cleanup(struct ttm_buffer_object *bo,
533 573
534 set_bit(TTM_BO_PRIV_FLAG_MOVING, &bo->priv_flags); 574 set_bit(TTM_BO_PRIV_FLAG_MOVING, &bo->priv_flags);
535 spin_unlock(&bo->lock); 575 spin_unlock(&bo->lock);
576 if (tmp_obj)
577 driver->sync_obj_unref(&tmp_obj);
536 578
537 ret = ttm_buffer_object_transfer(bo, &ghost_obj); 579 ret = ttm_buffer_object_transfer(bo, &ghost_obj);
538 if (ret) 580 if (ret)
diff --git a/drivers/gpu/drm/ttm/ttm_bo_vm.c b/drivers/gpu/drm/ttm/ttm_bo_vm.c
index 27b146c54fbc..33de7637c0c6 100644
--- a/drivers/gpu/drm/ttm/ttm_bo_vm.c
+++ b/drivers/gpu/drm/ttm/ttm_bo_vm.c
@@ -32,7 +32,6 @@
32#include <ttm/ttm_bo_driver.h> 32#include <ttm/ttm_bo_driver.h>
33#include <ttm/ttm_placement.h> 33#include <ttm/ttm_placement.h>
34#include <linux/mm.h> 34#include <linux/mm.h>
35#include <linux/version.h>
36#include <linux/rbtree.h> 35#include <linux/rbtree.h>
37#include <linux/module.h> 36#include <linux/module.h>
38#include <linux/uaccess.h> 37#include <linux/uaccess.h>
@@ -102,6 +101,9 @@ static int ttm_bo_vm_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
102 return VM_FAULT_NOPAGE; 101 return VM_FAULT_NOPAGE;
103 } 102 }
104 103
104 if (bdev->driver->fault_reserve_notify)
105 bdev->driver->fault_reserve_notify(bo);
106
105 /* 107 /*
106 * Wait for buffer data in transit, due to a pipelined 108 * Wait for buffer data in transit, due to a pipelined
107 * move. 109 * move.
@@ -328,7 +330,7 @@ ssize_t ttm_bo_io(struct ttm_bo_device *bdev, struct file *filp,
328 goto out_unref; 330 goto out_unref;
329 331
330 kmap_offset = dev_offset - bo->vm_node->start; 332 kmap_offset = dev_offset - bo->vm_node->start;
331 if (unlikely(kmap_offset) >= bo->num_pages) { 333 if (unlikely(kmap_offset >= bo->num_pages)) {
332 ret = -EFBIG; 334 ret = -EFBIG;
333 goto out_unref; 335 goto out_unref;
334 } 336 }
@@ -402,7 +404,7 @@ ssize_t ttm_bo_fbdev_io(struct ttm_buffer_object *bo, const char __user *wbuf,
402 bool dummy; 404 bool dummy;
403 405
404 kmap_offset = (*f_pos >> PAGE_SHIFT); 406 kmap_offset = (*f_pos >> PAGE_SHIFT);
405 if (unlikely(kmap_offset) >= bo->num_pages) 407 if (unlikely(kmap_offset >= bo->num_pages))
406 return -EFBIG; 408 return -EFBIG;
407 409
408 page_offset = *f_pos & ~PAGE_MASK; 410 page_offset = *f_pos & ~PAGE_MASK;
diff --git a/drivers/gpu/drm/ttm/ttm_tt.c b/drivers/gpu/drm/ttm/ttm_tt.c
index 0331fa74cd3f..b8b6c4a5f983 100644
--- a/drivers/gpu/drm/ttm/ttm_tt.c
+++ b/drivers/gpu/drm/ttm/ttm_tt.c
@@ -28,7 +28,6 @@
28 * Authors: Thomas Hellstrom <thellstrom-at-vmware-dot-com> 28 * Authors: Thomas Hellstrom <thellstrom-at-vmware-dot-com>
29 */ 29 */
30 30
31#include <linux/version.h>
32#include <linux/vmalloc.h> 31#include <linux/vmalloc.h>
33#include <linux/sched.h> 32#include <linux/sched.h>
34#include <linux/highmem.h> 33#include <linux/highmem.h>
@@ -87,10 +86,16 @@ void ttm_tt_cache_flush(struct page *pages[], unsigned long num_pages)
87 unsigned long i; 86 unsigned long i;
88 87
89 for (i = 0; i < num_pages; ++i) { 88 for (i = 0; i < num_pages; ++i) {
90 if (pages[i]) { 89 struct page *page = pages[i];
91 unsigned long start = (unsigned long)page_address(pages[i]); 90 void *page_virtual;
92 flush_dcache_range(start, start + PAGE_SIZE); 91
93 } 92 if (unlikely(page == NULL))
93 continue;
94
95 page_virtual = kmap_atomic(page, KM_USER0);
96 flush_dcache_range((unsigned long) page_virtual,
97 (unsigned long) page_virtual + PAGE_SIZE);
98 kunmap_atomic(page_virtual, KM_USER0);
94 } 99 }
95#else 100#else
96 if (on_each_cpu(ttm_tt_ipi_handler, NULL, 1) != 0) 101 if (on_each_cpu(ttm_tt_ipi_handler, NULL, 1) != 0)
@@ -132,10 +137,17 @@ static void ttm_tt_free_page_directory(struct ttm_tt *ttm)
132 137
133static struct page *ttm_tt_alloc_page(unsigned page_flags) 138static struct page *ttm_tt_alloc_page(unsigned page_flags)
134{ 139{
140 gfp_t gfp_flags = GFP_USER;
141
135 if (page_flags & TTM_PAGE_FLAG_ZERO_ALLOC) 142 if (page_flags & TTM_PAGE_FLAG_ZERO_ALLOC)
136 return alloc_page(GFP_HIGHUSER | __GFP_ZERO); 143 gfp_flags |= __GFP_ZERO;
144
145 if (page_flags & TTM_PAGE_FLAG_DMA32)
146 gfp_flags |= __GFP_DMA32;
147 else
148 gfp_flags |= __GFP_HIGHMEM;
137 149
138 return alloc_page(GFP_HIGHUSER); 150 return alloc_page(gfp_flags);
139} 151}
140 152
141static void ttm_tt_free_user_pages(struct ttm_tt *ttm) 153static void ttm_tt_free_user_pages(struct ttm_tt *ttm)
diff --git a/drivers/gpu/drm/via/via_irq.c b/drivers/gpu/drm/via/via_irq.c
index c248c1d37268..5935b8842e86 100644
--- a/drivers/gpu/drm/via/via_irq.c
+++ b/drivers/gpu/drm/via/via_irq.c
@@ -183,7 +183,7 @@ int via_enable_vblank(struct drm_device *dev, int crtc)
183 } 183 }
184 184
185 status = VIA_READ(VIA_REG_INTERRUPT); 185 status = VIA_READ(VIA_REG_INTERRUPT);
186 VIA_WRITE(VIA_REG_INTERRUPT, status & VIA_IRQ_VBLANK_ENABLE); 186 VIA_WRITE(VIA_REG_INTERRUPT, status | VIA_IRQ_VBLANK_ENABLE);
187 187
188 VIA_WRITE8(0x83d4, 0x11); 188 VIA_WRITE8(0x83d4, 0x11);
189 VIA_WRITE8(0x83d5, VIA_READ8(0x83d5) | 0x30); 189 VIA_WRITE8(0x83d5, VIA_READ8(0x83d5) | 0x30);
@@ -194,6 +194,10 @@ int via_enable_vblank(struct drm_device *dev, int crtc)
194void via_disable_vblank(struct drm_device *dev, int crtc) 194void via_disable_vblank(struct drm_device *dev, int crtc)
195{ 195{
196 drm_via_private_t *dev_priv = dev->dev_private; 196 drm_via_private_t *dev_priv = dev->dev_private;
197 u32 status;
198
199 status = VIA_READ(VIA_REG_INTERRUPT);
200 VIA_WRITE(VIA_REG_INTERRUPT, status & ~VIA_IRQ_VBLANK_ENABLE);
197 201
198 VIA_WRITE8(0x83d4, 0x11); 202 VIA_WRITE8(0x83d4, 0x11);
199 VIA_WRITE8(0x83d5, VIA_READ8(0x83d5) & ~0x30); 203 VIA_WRITE8(0x83d5, VIA_READ8(0x83d5) & ~0x30);
diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c
index f2c21d5d24e8..5eb10c2ce665 100644
--- a/drivers/hid/hid-core.c
+++ b/drivers/hid/hid-core.c
@@ -1075,14 +1075,16 @@ EXPORT_SYMBOL_GPL(hid_report_raw_event);
1075 */ 1075 */
1076int hid_input_report(struct hid_device *hid, int type, u8 *data, int size, int interrupt) 1076int hid_input_report(struct hid_device *hid, int type, u8 *data, int size, int interrupt)
1077{ 1077{
1078 struct hid_report_enum *report_enum = hid->report_enum + type; 1078 struct hid_report_enum *report_enum;
1079 struct hid_driver *hdrv = hid->driver; 1079 struct hid_driver *hdrv;
1080 struct hid_report *report; 1080 struct hid_report *report;
1081 unsigned int i; 1081 unsigned int i;
1082 int ret; 1082 int ret;
1083 1083
1084 if (!hid || !hid->driver) 1084 if (!hid || !hid->driver)
1085 return -ENODEV; 1085 return -ENODEV;
1086 report_enum = hid->report_enum + type;
1087 hdrv = hid->driver;
1086 1088
1087 if (!size) { 1089 if (!size) {
1088 dbg_hid("empty report\n"); 1090 dbg_hid("empty report\n");
diff --git a/drivers/hid/usbhid/hid-core.c b/drivers/hid/usbhid/hid-core.c
index 76c4bbe9dccb..3c1fcb7640ab 100644
--- a/drivers/hid/usbhid/hid-core.c
+++ b/drivers/hid/usbhid/hid-core.c
@@ -22,7 +22,6 @@
22#include <linux/list.h> 22#include <linux/list.h>
23#include <linux/mm.h> 23#include <linux/mm.h>
24#include <linux/mutex.h> 24#include <linux/mutex.h>
25#include <linux/smp_lock.h>
26#include <linux/spinlock.h> 25#include <linux/spinlock.h>
27#include <asm/unaligned.h> 26#include <asm/unaligned.h>
28#include <asm/byteorder.h> 27#include <asm/byteorder.h>
diff --git a/drivers/hid/usbhid/hiddev.c b/drivers/hid/usbhid/hiddev.c
index 9e9421525fb9..215b2addddbb 100644
--- a/drivers/hid/usbhid/hiddev.c
+++ b/drivers/hid/usbhid/hiddev.c
@@ -527,8 +527,10 @@ static noinline int hiddev_ioctl_usage(struct hiddev *hiddev, unsigned int cmd,
527 goto goodreturn; 527 goto goodreturn;
528 528
529 case HIDIOCGCOLLECTIONINDEX: 529 case HIDIOCGCOLLECTIONINDEX:
530 i = field->usage[uref->usage_index].collection_index;
531 unlock_kernel();
530 kfree(uref_multi); 532 kfree(uref_multi);
531 return field->usage[uref->usage_index].collection_index; 533 return i;
532 case HIDIOCGUSAGES: 534 case HIDIOCGUSAGES:
533 for (i = 0; i < uref_multi->num_values; i++) 535 for (i = 0; i < uref_multi->num_values; i++)
534 uref_multi->values[i] = 536 uref_multi->values[i] =
diff --git a/drivers/hwmon/abituguru3.c b/drivers/hwmon/abituguru3.c
index ad2b3431b725..7d3f15d32fdf 100644
--- a/drivers/hwmon/abituguru3.c
+++ b/drivers/hwmon/abituguru3.c
@@ -357,7 +357,7 @@ static const struct abituguru3_motherboard_info abituguru3_motherboards[] = {
357 { "AUX5 Fan", 39, 2, 60, 1, 0 }, 357 { "AUX5 Fan", 39, 2, 60, 1, 0 },
358 { NULL, 0, 0, 0, 0, 0 } } 358 { NULL, 0, 0, 0, 0, 0 } }
359 }, 359 },
360 { 0x0014, NULL /* Abit AB9 Pro, need DMI string */, { 360 { 0x0014, "AB9", /* + AB9 Pro */ {
361 { "CPU Core", 0, 0, 10, 1, 0 }, 361 { "CPU Core", 0, 0, 10, 1, 0 },
362 { "DDR", 1, 0, 10, 1, 0 }, 362 { "DDR", 1, 0, 10, 1, 0 },
363 { "DDR VTT", 2, 0, 10, 1, 0 }, 363 { "DDR VTT", 2, 0, 10, 1, 0 },
@@ -455,7 +455,7 @@ static const struct abituguru3_motherboard_info abituguru3_motherboards[] = {
455 { "AUX3 FAN", 37, 2, 60, 1, 0 }, 455 { "AUX3 FAN", 37, 2, 60, 1, 0 },
456 { NULL, 0, 0, 0, 0, 0 } } 456 { NULL, 0, 0, 0, 0, 0 } }
457 }, 457 },
458 { 0x0018, NULL /* Unknown, need DMI string */, { 458 { 0x0018, "AB9 QuadGT", {
459 { "CPU Core", 0, 0, 10, 1, 0 }, 459 { "CPU Core", 0, 0, 10, 1, 0 },
460 { "DDR2", 1, 0, 20, 1, 0 }, 460 { "DDR2", 1, 0, 20, 1, 0 },
461 { "DDR2 VTT", 2, 0, 10, 1, 0 }, 461 { "DDR2 VTT", 2, 0, 10, 1, 0 },
@@ -564,7 +564,7 @@ static const struct abituguru3_motherboard_info abituguru3_motherboards[] = {
564 { "AUX3 Fan", 36, 2, 60, 1, 0 }, 564 { "AUX3 Fan", 36, 2, 60, 1, 0 },
565 { NULL, 0, 0, 0, 0, 0 } } 565 { NULL, 0, 0, 0, 0, 0 } }
566 }, 566 },
567 { 0x001C, NULL /* Unknown, need DMI string */, { 567 { 0x001C, "IX38 QuadGT", {
568 { "CPU Core", 0, 0, 10, 1, 0 }, 568 { "CPU Core", 0, 0, 10, 1, 0 },
569 { "DDR2", 1, 0, 20, 1, 0 }, 569 { "DDR2", 1, 0, 20, 1, 0 },
570 { "DDR2 VTT", 2, 0, 10, 1, 0 }, 570 { "DDR2 VTT", 2, 0, 10, 1, 0 },
diff --git a/drivers/hwmon/asus_atk0110.c b/drivers/hwmon/asus_atk0110.c
index bff0103610c1..fe4fa29c9219 100644
--- a/drivers/hwmon/asus_atk0110.c
+++ b/drivers/hwmon/asus_atk0110.c
@@ -593,7 +593,11 @@ static int atk_add_sensor(struct atk_data *data, union acpi_object *obj)
593 sensor->data = data; 593 sensor->data = data;
594 sensor->id = flags->integer.value; 594 sensor->id = flags->integer.value;
595 sensor->limit1 = limit1->integer.value; 595 sensor->limit1 = limit1->integer.value;
596 sensor->limit2 = limit2->integer.value; 596 if (data->old_interface)
597 sensor->limit2 = limit2->integer.value;
598 else
599 /* The upper limit is expressed as delta from lower limit */
600 sensor->limit2 = sensor->limit1 + limit2->integer.value;
597 601
598 snprintf(sensor->input_attr_name, ATTR_NAME_SIZE, 602 snprintf(sensor->input_attr_name, ATTR_NAME_SIZE,
599 "%s%d_input", base_name, start + *num); 603 "%s%d_input", base_name, start + *num);
diff --git a/drivers/hwmon/max6650.c b/drivers/hwmon/max6650.c
index 86142a858238..58f66be61b1f 100644
--- a/drivers/hwmon/max6650.c
+++ b/drivers/hwmon/max6650.c
@@ -418,6 +418,7 @@ static ssize_t set_div(struct device *dev, struct device_attribute *devattr,
418 data->count = 3; 418 data->count = 3;
419 break; 419 break;
420 default: 420 default:
421 mutex_unlock(&data->update_lock);
421 dev_err(&client->dev, 422 dev_err(&client->dev,
422 "illegal value for fan divider (%d)\n", div); 423 "illegal value for fan divider (%d)\n", div);
423 return -EINVAL; 424 return -EINVAL;
diff --git a/drivers/hwmon/sht15.c b/drivers/hwmon/sht15.c
index 56cd6004da36..6290a259456e 100644
--- a/drivers/hwmon/sht15.c
+++ b/drivers/hwmon/sht15.c
@@ -257,7 +257,7 @@ static inline int sht15_update_single_val(struct sht15_data *data,
257 (data->flag == SHT15_READING_NOTHING), 257 (data->flag == SHT15_READING_NOTHING),
258 msecs_to_jiffies(timeout_msecs)); 258 msecs_to_jiffies(timeout_msecs));
259 if (ret == 0) {/* timeout occurred */ 259 if (ret == 0) {/* timeout occurred */
260 disable_irq_nosync(gpio_to_irq(data->pdata->gpio_data));; 260 disable_irq_nosync(gpio_to_irq(data->pdata->gpio_data));
261 sht15_connection_reset(data); 261 sht15_connection_reset(data);
262 return -ETIME; 262 return -ETIME;
263 } 263 }
diff --git a/drivers/hwmon/smsc47m1.c b/drivers/hwmon/smsc47m1.c
index a92dbb97ee99..ba75bfcf14ce 100644
--- a/drivers/hwmon/smsc47m1.c
+++ b/drivers/hwmon/smsc47m1.c
@@ -86,6 +86,7 @@ superio_exit(void)
86#define SUPERIO_REG_ACT 0x30 86#define SUPERIO_REG_ACT 0x30
87#define SUPERIO_REG_BASE 0x60 87#define SUPERIO_REG_BASE 0x60
88#define SUPERIO_REG_DEVID 0x20 88#define SUPERIO_REG_DEVID 0x20
89#define SUPERIO_REG_DEVREV 0x21
89 90
90/* Logical device registers */ 91/* Logical device registers */
91 92
@@ -429,6 +430,9 @@ static int __init smsc47m1_find(unsigned short *addr,
429 * The LPC47M292 (device id 0x6B) is somewhat compatible, but it 430 * The LPC47M292 (device id 0x6B) is somewhat compatible, but it
430 * supports a 3rd fan, and the pin configuration registers are 431 * supports a 3rd fan, and the pin configuration registers are
431 * unfortunately different. 432 * unfortunately different.
433 * The LPC47M233 has the same device id (0x6B) but is not compatible.
434 * We check the high bit of the device revision register to
435 * differentiate them.
432 */ 436 */
433 switch (val) { 437 switch (val) {
434 case 0x51: 438 case 0x51:
@@ -448,6 +452,13 @@ static int __init smsc47m1_find(unsigned short *addr,
448 sio_data->type = smsc47m1; 452 sio_data->type = smsc47m1;
449 break; 453 break;
450 case 0x6B: 454 case 0x6B:
455 if (superio_inb(SUPERIO_REG_DEVREV) & 0x80) {
456 pr_debug(DRVNAME ": "
457 "Found SMSC LPC47M233, unsupported\n");
458 superio_exit();
459 return -ENODEV;
460 }
461
451 pr_info(DRVNAME ": Found SMSC LPC47M292\n"); 462 pr_info(DRVNAME ": Found SMSC LPC47M292\n");
452 sio_data->type = smsc47m2; 463 sio_data->type = smsc47m2;
453 break; 464 break;
diff --git a/drivers/i2c/busses/Kconfig b/drivers/i2c/busses/Kconfig
index aa87b6a3bbef..8206442fbabd 100644
--- a/drivers/i2c/busses/Kconfig
+++ b/drivers/i2c/busses/Kconfig
@@ -328,6 +328,7 @@ config I2C_DAVINCI
328 328
329config I2C_DESIGNWARE 329config I2C_DESIGNWARE
330 tristate "Synopsys DesignWare" 330 tristate "Synopsys DesignWare"
331 depends on HAVE_CLK
331 help 332 help
332 If you say yes to this option, support will be included for the 333 If you say yes to this option, support will be included for the
333 Synopsys DesignWare I2C adapter. Only master mode is supported. 334 Synopsys DesignWare I2C adapter. Only master mode is supported.
diff --git a/drivers/i2c/busses/i2c-davinci.c b/drivers/i2c/busses/i2c-davinci.c
index 3fae3a91ce5b..c89687a10835 100644
--- a/drivers/i2c/busses/i2c-davinci.c
+++ b/drivers/i2c/busses/i2c-davinci.c
@@ -187,6 +187,11 @@ static int i2c_davinci_init(struct davinci_i2c_dev *dev)
187 davinci_i2c_write_reg(dev, DAVINCI_I2C_CLKH_REG, clkh); 187 davinci_i2c_write_reg(dev, DAVINCI_I2C_CLKH_REG, clkh);
188 davinci_i2c_write_reg(dev, DAVINCI_I2C_CLKL_REG, clkl); 188 davinci_i2c_write_reg(dev, DAVINCI_I2C_CLKL_REG, clkl);
189 189
190 /* Respond at reserved "SMBus Host" slave address" (and zero);
191 * we seem to have no option to not respond...
192 */
193 davinci_i2c_write_reg(dev, DAVINCI_I2C_OAR_REG, 0x08);
194
190 dev_dbg(dev->dev, "input_clock = %d, CLK = %d\n", input_clock, clk); 195 dev_dbg(dev->dev, "input_clock = %d, CLK = %d\n", input_clock, clk);
191 dev_dbg(dev->dev, "PSC = %d\n", 196 dev_dbg(dev->dev, "PSC = %d\n",
192 davinci_i2c_read_reg(dev, DAVINCI_I2C_PSC_REG)); 197 davinci_i2c_read_reg(dev, DAVINCI_I2C_PSC_REG));
@@ -387,7 +392,7 @@ static void terminate_write(struct davinci_i2c_dev *dev)
387 davinci_i2c_write_reg(dev, DAVINCI_I2C_MDR_REG, w); 392 davinci_i2c_write_reg(dev, DAVINCI_I2C_MDR_REG, w);
388 393
389 if (!dev->terminate) 394 if (!dev->terminate)
390 dev_err(dev->dev, "TDR IRQ while no data to send\n"); 395 dev_dbg(dev->dev, "TDR IRQ while no data to send\n");
391} 396}
392 397
393/* 398/*
@@ -473,9 +478,14 @@ static irqreturn_t i2c_davinci_isr(int this_irq, void *dev_id)
473 break; 478 break;
474 479
475 case DAVINCI_I2C_IVR_AAS: 480 case DAVINCI_I2C_IVR_AAS:
476 dev_warn(dev->dev, "Address as slave interrupt\n"); 481 dev_dbg(dev->dev, "Address as slave interrupt\n");
477 }/* switch */ 482 break;
478 }/* while */ 483
484 default:
485 dev_warn(dev->dev, "Unrecognized irq stat %d\n", stat);
486 break;
487 }
488 }
479 489
480 return count ? IRQ_HANDLED : IRQ_NONE; 490 return count ? IRQ_HANDLED : IRQ_NONE;
481} 491}
@@ -505,7 +515,7 @@ static int davinci_i2c_probe(struct platform_device *pdev)
505 return -ENODEV; 515 return -ENODEV;
506 } 516 }
507 517
508 ioarea = request_mem_region(mem->start, (mem->end - mem->start) + 1, 518 ioarea = request_mem_region(mem->start, resource_size(mem),
509 pdev->name); 519 pdev->name);
510 if (!ioarea) { 520 if (!ioarea) {
511 dev_err(&pdev->dev, "I2C region already claimed\n"); 521 dev_err(&pdev->dev, "I2C region already claimed\n");
@@ -523,7 +533,7 @@ static int davinci_i2c_probe(struct platform_device *pdev)
523 dev->irq = irq->start; 533 dev->irq = irq->start;
524 platform_set_drvdata(pdev, dev); 534 platform_set_drvdata(pdev, dev);
525 535
526 dev->clk = clk_get(&pdev->dev, "I2CCLK"); 536 dev->clk = clk_get(&pdev->dev, NULL);
527 if (IS_ERR(dev->clk)) { 537 if (IS_ERR(dev->clk)) {
528 r = -ENODEV; 538 r = -ENODEV;
529 goto err_free_mem; 539 goto err_free_mem;
@@ -568,7 +578,7 @@ err_free_mem:
568 put_device(&pdev->dev); 578 put_device(&pdev->dev);
569 kfree(dev); 579 kfree(dev);
570err_release_region: 580err_release_region:
571 release_mem_region(mem->start, (mem->end - mem->start) + 1); 581 release_mem_region(mem->start, resource_size(mem));
572 582
573 return r; 583 return r;
574} 584}
@@ -591,7 +601,7 @@ static int davinci_i2c_remove(struct platform_device *pdev)
591 kfree(dev); 601 kfree(dev);
592 602
593 mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); 603 mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
594 release_mem_region(mem->start, (mem->end - mem->start) + 1); 604 release_mem_region(mem->start, resource_size(mem));
595 return 0; 605 return 0;
596} 606}
597 607
diff --git a/drivers/i2c/busses/i2c-ibm_iic.c b/drivers/i2c/busses/i2c-ibm_iic.c
index e4476743f203..b1bc6e277d2a 100644
--- a/drivers/i2c/busses/i2c-ibm_iic.c
+++ b/drivers/i2c/busses/i2c-ibm_iic.c
@@ -85,10 +85,11 @@ static void dump_iic_regs(const char* header, struct ibm_iic_private* dev)
85{ 85{
86 volatile struct iic_regs __iomem *iic = dev->vaddr; 86 volatile struct iic_regs __iomem *iic = dev->vaddr;
87 printk(KERN_DEBUG "ibm-iic%d: %s\n", dev->idx, header); 87 printk(KERN_DEBUG "ibm-iic%d: %s\n", dev->idx, header);
88 printk(KERN_DEBUG " cntl = 0x%02x, mdcntl = 0x%02x\n" 88 printk(KERN_DEBUG
89 KERN_DEBUG " sts = 0x%02x, extsts = 0x%02x\n" 89 " cntl = 0x%02x, mdcntl = 0x%02x\n"
90 KERN_DEBUG " clkdiv = 0x%02x, xfrcnt = 0x%02x\n" 90 " sts = 0x%02x, extsts = 0x%02x\n"
91 KERN_DEBUG " xtcntlss = 0x%02x, directcntl = 0x%02x\n", 91 " clkdiv = 0x%02x, xfrcnt = 0x%02x\n"
92 " xtcntlss = 0x%02x, directcntl = 0x%02x\n",
92 in_8(&iic->cntl), in_8(&iic->mdcntl), in_8(&iic->sts), 93 in_8(&iic->cntl), in_8(&iic->mdcntl), in_8(&iic->sts),
93 in_8(&iic->extsts), in_8(&iic->clkdiv), in_8(&iic->xfrcnt), 94 in_8(&iic->extsts), in_8(&iic->clkdiv), in_8(&iic->xfrcnt),
94 in_8(&iic->xtcntlss), in_8(&iic->directcntl)); 95 in_8(&iic->xtcntlss), in_8(&iic->directcntl));
diff --git a/drivers/i2c/busses/i2c-omap.c b/drivers/i2c/busses/i2c-omap.c
index ad8d2010c921..d258b02aef44 100644
--- a/drivers/i2c/busses/i2c-omap.c
+++ b/drivers/i2c/busses/i2c-omap.c
@@ -672,9 +672,10 @@ omap_i2c_isr(int this_irq, void *dev_id)
672 break; 672 break;
673 } 673 }
674 674
675 err = 0;
676complete:
675 omap_i2c_write_reg(dev, OMAP_I2C_STAT_REG, stat); 677 omap_i2c_write_reg(dev, OMAP_I2C_STAT_REG, stat);
676 678
677 err = 0;
678 if (stat & OMAP_I2C_STAT_NACK) { 679 if (stat & OMAP_I2C_STAT_NACK) {
679 err |= OMAP_I2C_STAT_NACK; 680 err |= OMAP_I2C_STAT_NACK;
680 omap_i2c_write_reg(dev, OMAP_I2C_CON_REG, 681 omap_i2c_write_reg(dev, OMAP_I2C_CON_REG,
@@ -685,16 +686,19 @@ omap_i2c_isr(int this_irq, void *dev_id)
685 err |= OMAP_I2C_STAT_AL; 686 err |= OMAP_I2C_STAT_AL;
686 } 687 }
687 if (stat & (OMAP_I2C_STAT_ARDY | OMAP_I2C_STAT_NACK | 688 if (stat & (OMAP_I2C_STAT_ARDY | OMAP_I2C_STAT_NACK |
688 OMAP_I2C_STAT_AL)) 689 OMAP_I2C_STAT_AL)) {
689 omap_i2c_complete_cmd(dev, err); 690 omap_i2c_complete_cmd(dev, err);
691 return IRQ_HANDLED;
692 }
690 if (stat & (OMAP_I2C_STAT_RRDY | OMAP_I2C_STAT_RDR)) { 693 if (stat & (OMAP_I2C_STAT_RRDY | OMAP_I2C_STAT_RDR)) {
691 u8 num_bytes = 1; 694 u8 num_bytes = 1;
692 if (dev->fifo_size) { 695 if (dev->fifo_size) {
693 if (stat & OMAP_I2C_STAT_RRDY) 696 if (stat & OMAP_I2C_STAT_RRDY)
694 num_bytes = dev->fifo_size; 697 num_bytes = dev->fifo_size;
695 else 698 else /* read RXSTAT on RDR interrupt */
696 num_bytes = omap_i2c_read_reg(dev, 699 num_bytes = (omap_i2c_read_reg(dev,
697 OMAP_I2C_BUFSTAT_REG); 700 OMAP_I2C_BUFSTAT_REG)
701 >> 8) & 0x3F;
698 } 702 }
699 while (num_bytes) { 703 while (num_bytes) {
700 num_bytes--; 704 num_bytes--;
@@ -731,9 +735,10 @@ omap_i2c_isr(int this_irq, void *dev_id)
731 if (dev->fifo_size) { 735 if (dev->fifo_size) {
732 if (stat & OMAP_I2C_STAT_XRDY) 736 if (stat & OMAP_I2C_STAT_XRDY)
733 num_bytes = dev->fifo_size; 737 num_bytes = dev->fifo_size;
734 else 738 else /* read TXSTAT on XDR interrupt */
735 num_bytes = omap_i2c_read_reg(dev, 739 num_bytes = omap_i2c_read_reg(dev,
736 OMAP_I2C_BUFSTAT_REG); 740 OMAP_I2C_BUFSTAT_REG)
741 & 0x3F;
737 } 742 }
738 while (num_bytes) { 743 while (num_bytes) {
739 num_bytes--; 744 num_bytes--;
@@ -760,6 +765,27 @@ omap_i2c_isr(int this_irq, void *dev_id)
760 "data to send\n"); 765 "data to send\n");
761 break; 766 break;
762 } 767 }
768
769 /*
770 * OMAP3430 Errata 1.153: When an XRDY/XDR
771 * is hit, wait for XUDF before writing data
772 * to DATA_REG. Otherwise some data bytes can
773 * be lost while transferring them from the
774 * memory to the I2C interface.
775 */
776
777 if (cpu_is_omap34xx()) {
778 while (!(stat & OMAP_I2C_STAT_XUDF)) {
779 if (stat & (OMAP_I2C_STAT_NACK | OMAP_I2C_STAT_AL)) {
780 omap_i2c_ack_stat(dev, stat & (OMAP_I2C_STAT_XRDY | OMAP_I2C_STAT_XDR));
781 err |= OMAP_I2C_STAT_XUDF;
782 goto complete;
783 }
784 cpu_relax();
785 stat = omap_i2c_read_reg(dev, OMAP_I2C_STAT_REG);
786 }
787 }
788
763 omap_i2c_write_reg(dev, OMAP_I2C_DATA_REG, w); 789 omap_i2c_write_reg(dev, OMAP_I2C_DATA_REG, w);
764 } 790 }
765 omap_i2c_ack_stat(dev, 791 omap_i2c_ack_stat(dev,
@@ -806,7 +832,7 @@ omap_i2c_probe(struct platform_device *pdev)
806 return -ENODEV; 832 return -ENODEV;
807 } 833 }
808 834
809 ioarea = request_mem_region(mem->start, (mem->end - mem->start) + 1, 835 ioarea = request_mem_region(mem->start, resource_size(mem),
810 pdev->name); 836 pdev->name);
811 if (!ioarea) { 837 if (!ioarea) {
812 dev_err(&pdev->dev, "I2C region already claimed\n"); 838 dev_err(&pdev->dev, "I2C region already claimed\n");
@@ -879,7 +905,7 @@ omap_i2c_probe(struct platform_device *pdev)
879 i2c_set_adapdata(adap, dev); 905 i2c_set_adapdata(adap, dev);
880 adap->owner = THIS_MODULE; 906 adap->owner = THIS_MODULE;
881 adap->class = I2C_CLASS_HWMON; 907 adap->class = I2C_CLASS_HWMON;
882 strncpy(adap->name, "OMAP I2C adapter", sizeof(adap->name)); 908 strlcpy(adap->name, "OMAP I2C adapter", sizeof(adap->name));
883 adap->algo = &omap_i2c_algo; 909 adap->algo = &omap_i2c_algo;
884 adap->dev.parent = &pdev->dev; 910 adap->dev.parent = &pdev->dev;
885 911
@@ -905,7 +931,7 @@ err_free_mem:
905 platform_set_drvdata(pdev, NULL); 931 platform_set_drvdata(pdev, NULL);
906 kfree(dev); 932 kfree(dev);
907err_release_region: 933err_release_region:
908 release_mem_region(mem->start, (mem->end - mem->start) + 1); 934 release_mem_region(mem->start, resource_size(mem));
909 935
910 return r; 936 return r;
911} 937}
@@ -925,7 +951,7 @@ omap_i2c_remove(struct platform_device *pdev)
925 iounmap(dev->base); 951 iounmap(dev->base);
926 kfree(dev); 952 kfree(dev);
927 mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); 953 mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
928 release_mem_region(mem->start, (mem->end - mem->start) + 1); 954 release_mem_region(mem->start, resource_size(mem));
929 return 0; 955 return 0;
930} 956}
931 957
diff --git a/drivers/i2c/busses/i2c-s3c2410.c b/drivers/i2c/busses/i2c-s3c2410.c
index 8f42a4536cdf..20bb0ceb027b 100644
--- a/drivers/i2c/busses/i2c-s3c2410.c
+++ b/drivers/i2c/busses/i2c-s3c2410.c
@@ -763,11 +763,6 @@ static int s3c24xx_i2c_init(struct s3c24xx_i2c *i2c)
763 dev_info(i2c->dev, "bus frequency set to %d KHz\n", freq); 763 dev_info(i2c->dev, "bus frequency set to %d KHz\n", freq);
764 dev_dbg(i2c->dev, "S3C2410_IICCON=0x%02lx\n", iicon); 764 dev_dbg(i2c->dev, "S3C2410_IICCON=0x%02lx\n", iicon);
765 765
766 /* check for s3c2440 i2c controller */
767
768 if (s3c24xx_i2c_is2440(i2c))
769 writel(0x0, i2c->regs + S3C2440_IICLC);
770
771 return 0; 766 return 0;
772} 767}
773 768
diff --git a/drivers/i2c/busses/i2c-sh_mobile.c b/drivers/i2c/busses/i2c-sh_mobile.c
index 1c01083b01b5..820487d0d5c7 100644
--- a/drivers/i2c/busses/i2c-sh_mobile.c
+++ b/drivers/i2c/busses/i2c-sh_mobile.c
@@ -563,7 +563,7 @@ static int sh_mobile_i2c_probe(struct platform_device *dev)
563 goto err_irq; 563 goto err_irq;
564 } 564 }
565 565
566 size = (res->end - res->start) + 1; 566 size = resource_size(res);
567 567
568 pd->reg = ioremap(res->start, size); 568 pd->reg = ioremap(res->start, size);
569 if (pd->reg == NULL) { 569 if (pd->reg == NULL) {
@@ -637,7 +637,7 @@ static void __exit sh_mobile_i2c_adap_exit(void)
637 platform_driver_unregister(&sh_mobile_i2c_driver); 637 platform_driver_unregister(&sh_mobile_i2c_driver);
638} 638}
639 639
640module_init(sh_mobile_i2c_adap_init); 640subsys_initcall(sh_mobile_i2c_adap_init);
641module_exit(sh_mobile_i2c_adap_exit); 641module_exit(sh_mobile_i2c_adap_exit);
642 642
643MODULE_DESCRIPTION("SuperH Mobile I2C Bus Controller driver"); 643MODULE_DESCRIPTION("SuperH Mobile I2C Bus Controller driver");
diff --git a/drivers/i2c/busses/i2c-simtec.c b/drivers/i2c/busses/i2c-simtec.c
index 042fda295f3a..6407f47bda82 100644
--- a/drivers/i2c/busses/i2c-simtec.c
+++ b/drivers/i2c/busses/i2c-simtec.c
@@ -92,7 +92,7 @@ static int simtec_i2c_probe(struct platform_device *dev)
92 goto err; 92 goto err;
93 } 93 }
94 94
95 size = (res->end-res->start)+1; 95 size = resource_size(res);
96 96
97 pd->ioarea = request_mem_region(res->start, size, dev->name); 97 pd->ioarea = request_mem_region(res->start, size, dev->name);
98 if (pd->ioarea == NULL) { 98 if (pd->ioarea == NULL) {
diff --git a/drivers/i2c/chips/tsl2550.c b/drivers/i2c/chips/tsl2550.c
index 1a9cc135219f..b96f3025e588 100644
--- a/drivers/i2c/chips/tsl2550.c
+++ b/drivers/i2c/chips/tsl2550.c
@@ -27,7 +27,7 @@
27#include <linux/delay.h> 27#include <linux/delay.h>
28 28
29#define TSL2550_DRV_NAME "tsl2550" 29#define TSL2550_DRV_NAME "tsl2550"
30#define DRIVER_VERSION "1.1.1" 30#define DRIVER_VERSION "1.1.2"
31 31
32/* 32/*
33 * Defines 33 * Defines
@@ -189,13 +189,16 @@ static int tsl2550_calculate_lux(u8 ch0, u8 ch1)
189 u8 r = 128; 189 u8 r = 128;
190 190
191 /* Avoid division by 0 and count 1 cannot be greater than count 0 */ 191 /* Avoid division by 0 and count 1 cannot be greater than count 0 */
192 if (c0 && (c1 <= c0)) 192 if (c1 <= c0)
193 r = c1 * 128 / c0; 193 if (c0) {
194 r = c1 * 128 / c0;
195
196 /* Calculate LUX */
197 lux = ((c0 - c1) * ratio_lut[r]) / 256;
198 } else
199 lux = 0;
194 else 200 else
195 return -1; 201 return -EAGAIN;
196
197 /* Calculate LUX */
198 lux = ((c0 - c1) * ratio_lut[r]) / 256;
199 202
200 /* LUX range check */ 203 /* LUX range check */
201 return lux > TSL2550_MAX_LUX ? TSL2550_MAX_LUX : lux; 204 return lux > TSL2550_MAX_LUX ? TSL2550_MAX_LUX : lux;
diff --git a/drivers/ide/cs5520.c b/drivers/ide/cs5520.c
index bd066bb9d611..09f98ed0731f 100644
--- a/drivers/ide/cs5520.c
+++ b/drivers/ide/cs5520.c
@@ -135,6 +135,7 @@ static int __devinit cs5520_init_one(struct pci_dev *dev, const struct pci_devic
135 135
136 ide_pci_setup_ports(dev, d, &hw[0], &hws[0]); 136 ide_pci_setup_ports(dev, d, &hw[0], &hws[0]);
137 hw[0].irq = 14; 137 hw[0].irq = 14;
138 hw[1].irq = 15;
138 139
139 return ide_host_add(d, hws, 2, NULL); 140 return ide_host_add(d, hws, 2, NULL);
140} 141}
diff --git a/drivers/ide/ide-acpi.c b/drivers/ide/ide-acpi.c
index 77f79d26b264..c509c9916464 100644
--- a/drivers/ide/ide-acpi.c
+++ b/drivers/ide/ide-acpi.c
@@ -92,6 +92,11 @@ int ide_acpi_init(void)
92 return 0; 92 return 0;
93} 93}
94 94
95bool ide_port_acpi(ide_hwif_t *hwif)
96{
97 return ide_noacpi == 0 && hwif->acpidata;
98}
99
95/** 100/**
96 * ide_get_dev_handle - finds acpi_handle and PCI device.function 101 * ide_get_dev_handle - finds acpi_handle and PCI device.function
97 * @dev: device to locate 102 * @dev: device to locate
@@ -352,9 +357,6 @@ int ide_acpi_exec_tfs(ide_drive_t *drive)
352 unsigned long gtf_address; 357 unsigned long gtf_address;
353 unsigned long obj_loc; 358 unsigned long obj_loc;
354 359
355 if (ide_noacpi)
356 return 0;
357
358 DEBPRINT("call get_GTF, drive=%s port=%d\n", drive->name, drive->dn); 360 DEBPRINT("call get_GTF, drive=%s port=%d\n", drive->name, drive->dn);
359 361
360 ret = do_drive_get_GTF(drive, &gtf_length, &gtf_address, &obj_loc); 362 ret = do_drive_get_GTF(drive, &gtf_length, &gtf_address, &obj_loc);
@@ -389,16 +391,6 @@ void ide_acpi_get_timing(ide_hwif_t *hwif)
389 struct acpi_buffer output; 391 struct acpi_buffer output;
390 union acpi_object *out_obj; 392 union acpi_object *out_obj;
391 393
392 if (ide_noacpi)
393 return;
394
395 DEBPRINT("ENTER:\n");
396
397 if (!hwif->acpidata) {
398 DEBPRINT("no ACPI data for %s\n", hwif->name);
399 return;
400 }
401
402 /* Setting up output buffer for _GTM */ 394 /* Setting up output buffer for _GTM */
403 output.length = ACPI_ALLOCATE_BUFFER; 395 output.length = ACPI_ALLOCATE_BUFFER;
404 output.pointer = NULL; /* ACPI-CA sets this; save/free it later */ 396 output.pointer = NULL; /* ACPI-CA sets this; save/free it later */
@@ -479,16 +471,6 @@ void ide_acpi_push_timing(ide_hwif_t *hwif)
479 struct ide_acpi_drive_link *master = &hwif->acpidata->master; 471 struct ide_acpi_drive_link *master = &hwif->acpidata->master;
480 struct ide_acpi_drive_link *slave = &hwif->acpidata->slave; 472 struct ide_acpi_drive_link *slave = &hwif->acpidata->slave;
481 473
482 if (ide_noacpi)
483 return;
484
485 DEBPRINT("ENTER:\n");
486
487 if (!hwif->acpidata) {
488 DEBPRINT("no ACPI data for %s\n", hwif->name);
489 return;
490 }
491
492 /* Give the GTM buffer + drive Identify data to the channel via the 474 /* Give the GTM buffer + drive Identify data to the channel via the
493 * _STM method: */ 475 * _STM method: */
494 /* setup input parameters buffer for _STM */ 476 /* setup input parameters buffer for _STM */
@@ -527,16 +509,11 @@ void ide_acpi_set_state(ide_hwif_t *hwif, int on)
527 ide_drive_t *drive; 509 ide_drive_t *drive;
528 int i; 510 int i;
529 511
530 if (ide_noacpi || ide_noacpi_psx) 512 if (ide_noacpi_psx)
531 return; 513 return;
532 514
533 DEBPRINT("ENTER:\n"); 515 DEBPRINT("ENTER:\n");
534 516
535 if (!hwif->acpidata) {
536 DEBPRINT("no ACPI data for %s\n", hwif->name);
537 return;
538 }
539
540 /* channel first and then drives for power on and verse versa for power off */ 517 /* channel first and then drives for power on and verse versa for power off */
541 if (on) 518 if (on)
542 acpi_bus_set_power(hwif->acpidata->obj_handle, ACPI_STATE_D0); 519 acpi_bus_set_power(hwif->acpidata->obj_handle, ACPI_STATE_D0);
@@ -616,7 +593,7 @@ void ide_acpi_port_init_devices(ide_hwif_t *hwif)
616 drive->name, err); 593 drive->name, err);
617 } 594 }
618 595
619 if (!ide_acpionboot) { 596 if (ide_noacpi || ide_acpionboot == 0) {
620 DEBPRINT("ACPI methods disabled on boot\n"); 597 DEBPRINT("ACPI methods disabled on boot\n");
621 return; 598 return;
622 } 599 }
diff --git a/drivers/ide/ide-cd.c b/drivers/ide/ide-cd.c
index 4a19686fcfe9..6a9a769bffc1 100644
--- a/drivers/ide/ide-cd.c
+++ b/drivers/ide/ide-cd.c
@@ -592,9 +592,19 @@ static ide_startstop_t cdrom_newpc_intr(ide_drive_t *drive)
592 } 592 }
593 } else if (!blk_pc_request(rq)) { 593 } else if (!blk_pc_request(rq)) {
594 ide_cd_request_sense_fixup(drive, cmd); 594 ide_cd_request_sense_fixup(drive, cmd);
595 /* complain if we still have data left to transfer */ 595
596 uptodate = cmd->nleft ? 0 : 1; 596 uptodate = cmd->nleft ? 0 : 1;
597 if (uptodate == 0) 597
598 /*
599 * suck out the remaining bytes from the drive in an
600 * attempt to complete the data xfer. (see BZ#13399)
601 */
602 if (!(stat & ATA_ERR) && !uptodate && thislen) {
603 ide_pio_bytes(drive, cmd, write, thislen);
604 uptodate = cmd->nleft ? 0 : 1;
605 }
606
607 if (!uptodate)
598 rq->cmd_flags |= REQ_FAILED; 608 rq->cmd_flags |= REQ_FAILED;
599 } 609 }
600 goto out_end; 610 goto out_end;
@@ -876,9 +886,12 @@ static int cdrom_read_capacity(ide_drive_t *drive, unsigned long *capacity,
876 return stat; 886 return stat;
877 887
878 /* 888 /*
879 * Sanity check the given block size 889 * Sanity check the given block size, in so far as making
890 * sure the sectors_per_frame we give to the caller won't
891 * end up being bogus.
880 */ 892 */
881 blocklen = be32_to_cpu(capbuf.blocklen); 893 blocklen = be32_to_cpu(capbuf.blocklen);
894 blocklen = (blocklen >> SECTOR_BITS) << SECTOR_BITS;
882 switch (blocklen) { 895 switch (blocklen) {
883 case 512: 896 case 512:
884 case 1024: 897 case 1024:
@@ -886,10 +899,9 @@ static int cdrom_read_capacity(ide_drive_t *drive, unsigned long *capacity,
886 case 4096: 899 case 4096:
887 break; 900 break;
888 default: 901 default:
889 printk(KERN_ERR PFX "%s: weird block size %u\n", 902 printk_once(KERN_ERR PFX "%s: weird block size %u; "
903 "setting default block size to 2048\n",
890 drive->name, blocklen); 904 drive->name, blocklen);
891 printk(KERN_ERR PFX "%s: default to 2kb block size\n",
892 drive->name);
893 blocklen = 2048; 905 blocklen = 2048;
894 break; 906 break;
895 } 907 }
diff --git a/drivers/ide/ide-devsets.c b/drivers/ide/ide-devsets.c
index 5bf958e5b1d5..1099bf7cf968 100644
--- a/drivers/ide/ide-devsets.c
+++ b/drivers/ide/ide-devsets.c
@@ -183,6 +183,6 @@ ide_startstop_t ide_do_devset(ide_drive_t *drive, struct request *rq)
183 err = setfunc(drive, *(int *)&rq->cmd[1]); 183 err = setfunc(drive, *(int *)&rq->cmd[1]);
184 if (err) 184 if (err)
185 rq->errors = err; 185 rq->errors = err;
186 ide_complete_rq(drive, err, ide_rq_bytes(rq)); 186 ide_complete_rq(drive, err, blk_rq_bytes(rq));
187 return ide_stopped; 187 return ide_stopped;
188} 188}
diff --git a/drivers/ide/ide-disk.c b/drivers/ide/ide-disk.c
index 695181120cdb..7f878017b736 100644
--- a/drivers/ide/ide-disk.c
+++ b/drivers/ide/ide-disk.c
@@ -455,6 +455,7 @@ static void idedisk_prepare_flush(struct request_queue *q, struct request *rq)
455 455
456 rq->cmd_type = REQ_TYPE_ATA_TASKFILE; 456 rq->cmd_type = REQ_TYPE_ATA_TASKFILE;
457 rq->special = cmd; 457 rq->special = cmd;
458 cmd->rq = rq;
458} 459}
459 460
460ide_devset_get(multcount, mult_count); 461ide_devset_get(multcount, mult_count);
diff --git a/drivers/ide/ide-dma.c b/drivers/ide/ide-dma.c
index 219e6fb78dc6..ee58c88dee5a 100644
--- a/drivers/ide/ide-dma.c
+++ b/drivers/ide/ide-dma.c
@@ -361,9 +361,6 @@ static int ide_tune_dma(ide_drive_t *drive)
361 if (__ide_dma_bad_drive(drive)) 361 if (__ide_dma_bad_drive(drive))
362 return 0; 362 return 0;
363 363
364 if (ide_id_dma_bug(drive))
365 return 0;
366
367 if (hwif->host_flags & IDE_HFLAG_TRUST_BIOS_FOR_DMA) 364 if (hwif->host_flags & IDE_HFLAG_TRUST_BIOS_FOR_DMA)
368 return config_drive_for_dma(drive); 365 return config_drive_for_dma(drive);
369 366
@@ -394,24 +391,6 @@ static int ide_dma_check(ide_drive_t *drive)
394 return -1; 391 return -1;
395} 392}
396 393
397int ide_id_dma_bug(ide_drive_t *drive)
398{
399 u16 *id = drive->id;
400
401 if (id[ATA_ID_FIELD_VALID] & 4) {
402 if ((id[ATA_ID_UDMA_MODES] >> 8) &&
403 (id[ATA_ID_MWDMA_MODES] >> 8))
404 goto err_out;
405 } else if ((id[ATA_ID_MWDMA_MODES] >> 8) &&
406 (id[ATA_ID_SWDMA_MODES] >> 8))
407 goto err_out;
408
409 return 0;
410err_out:
411 printk(KERN_ERR "%s: bad DMA info in identify block\n", drive->name);
412 return 1;
413}
414
415int ide_set_dma(ide_drive_t *drive) 394int ide_set_dma(ide_drive_t *drive)
416{ 395{
417 int rc; 396 int rc;
diff --git a/drivers/ide/ide-eh.c b/drivers/ide/ide-eh.c
index 2b9141979613..e9abf2c3c335 100644
--- a/drivers/ide/ide-eh.c
+++ b/drivers/ide/ide-eh.c
@@ -149,7 +149,7 @@ static inline void ide_complete_drive_reset(ide_drive_t *drive, int err)
149 if (rq && blk_special_request(rq) && rq->cmd[0] == REQ_DRIVE_RESET) { 149 if (rq && blk_special_request(rq) && rq->cmd[0] == REQ_DRIVE_RESET) {
150 if (err <= 0 && rq->errors == 0) 150 if (err <= 0 && rq->errors == 0)
151 rq->errors = -EIO; 151 rq->errors = -EIO;
152 ide_complete_rq(drive, err ? err : 0, ide_rq_bytes(rq)); 152 ide_complete_rq(drive, err ? err : 0, blk_rq_bytes(rq));
153 } 153 }
154} 154}
155 155
diff --git a/drivers/ide/ide-floppy.c b/drivers/ide/ide-floppy.c
index 8b3f204f7d73..fefbdfc8db06 100644
--- a/drivers/ide/ide-floppy.c
+++ b/drivers/ide/ide-floppy.c
@@ -293,7 +293,7 @@ out_end:
293 drive->failed_pc = NULL; 293 drive->failed_pc = NULL;
294 if (blk_fs_request(rq) == 0 && rq->errors == 0) 294 if (blk_fs_request(rq) == 0 && rq->errors == 0)
295 rq->errors = -EIO; 295 rq->errors = -EIO;
296 ide_complete_rq(drive, -EIO, ide_rq_bytes(rq)); 296 ide_complete_rq(drive, -EIO, blk_rq_bytes(rq));
297 return ide_stopped; 297 return ide_stopped;
298} 298}
299 299
diff --git a/drivers/ide/ide-io.c b/drivers/ide/ide-io.c
index 1059f809b809..db96138fefcd 100644
--- a/drivers/ide/ide-io.c
+++ b/drivers/ide/ide-io.c
@@ -112,16 +112,6 @@ void ide_complete_cmd(ide_drive_t *drive, struct ide_cmd *cmd, u8 stat, u8 err)
112 } 112 }
113} 113}
114 114
115/* obsolete, blk_rq_bytes() should be used instead */
116unsigned int ide_rq_bytes(struct request *rq)
117{
118 if (blk_pc_request(rq))
119 return blk_rq_bytes(rq);
120 else
121 return blk_rq_cur_sectors(rq) << 9;
122}
123EXPORT_SYMBOL_GPL(ide_rq_bytes);
124
125int ide_complete_rq(ide_drive_t *drive, int error, unsigned int nr_bytes) 115int ide_complete_rq(ide_drive_t *drive, int error, unsigned int nr_bytes)
126{ 116{
127 ide_hwif_t *hwif = drive->hwif; 117 ide_hwif_t *hwif = drive->hwif;
@@ -152,14 +142,14 @@ void ide_kill_rq(ide_drive_t *drive, struct request *rq)
152 142
153 if ((media == ide_floppy || media == ide_tape) && drv_req) { 143 if ((media == ide_floppy || media == ide_tape) && drv_req) {
154 rq->errors = 0; 144 rq->errors = 0;
155 ide_complete_rq(drive, 0, blk_rq_bytes(rq));
156 } else { 145 } else {
157 if (media == ide_tape) 146 if (media == ide_tape)
158 rq->errors = IDE_DRV_ERROR_GENERAL; 147 rq->errors = IDE_DRV_ERROR_GENERAL;
159 else if (blk_fs_request(rq) == 0 && rq->errors == 0) 148 else if (blk_fs_request(rq) == 0 && rq->errors == 0)
160 rq->errors = -EIO; 149 rq->errors = -EIO;
161 ide_complete_rq(drive, -EIO, ide_rq_bytes(rq));
162 } 150 }
151
152 ide_complete_rq(drive, -EIO, blk_rq_bytes(rq));
163} 153}
164 154
165static void ide_tf_set_specify_cmd(ide_drive_t *drive, struct ide_taskfile *tf) 155static void ide_tf_set_specify_cmd(ide_drive_t *drive, struct ide_taskfile *tf)
diff --git a/drivers/ide/ide-ioctls.c b/drivers/ide/ide-ioctls.c
index 82f252c3ee6e..e246d3d3fbcc 100644
--- a/drivers/ide/ide-ioctls.c
+++ b/drivers/ide/ide-ioctls.c
@@ -64,7 +64,8 @@ static int ide_get_identity_ioctl(ide_drive_t *drive, unsigned int cmd,
64 goto out; 64 goto out;
65 } 65 }
66 66
67 id = kmalloc(size, GFP_KERNEL); 67 /* ata_id_to_hd_driveid() relies on 'id' to be fully allocated. */
68 id = kmalloc(ATA_ID_WORDS * 2, GFP_KERNEL);
68 if (id == NULL) { 69 if (id == NULL) {
69 rc = -ENOMEM; 70 rc = -ENOMEM;
70 goto out; 71 goto out;
diff --git a/drivers/ide/ide-iops.c b/drivers/ide/ide-iops.c
index fa047150a1c6..2892b242bbe1 100644
--- a/drivers/ide/ide-iops.c
+++ b/drivers/ide/ide-iops.c
@@ -210,6 +210,7 @@ EXPORT_SYMBOL_GPL(ide_in_drive_list);
210 */ 210 */
211static const struct drive_list_entry ivb_list[] = { 211static const struct drive_list_entry ivb_list[] = {
212 { "QUANTUM FIREBALLlct10 05" , "A03.0900" }, 212 { "QUANTUM FIREBALLlct10 05" , "A03.0900" },
213 { "QUANTUM FIREBALLlct20 30" , "APL.0900" },
213 { "TSSTcorp CDDVDW SH-S202J" , "SB00" }, 214 { "TSSTcorp CDDVDW SH-S202J" , "SB00" },
214 { "TSSTcorp CDDVDW SH-S202J" , "SB01" }, 215 { "TSSTcorp CDDVDW SH-S202J" , "SB01" },
215 { "TSSTcorp CDDVDW SH-S202N" , "SB00" }, 216 { "TSSTcorp CDDVDW SH-S202N" , "SB00" },
@@ -329,9 +330,6 @@ int ide_driveid_update(ide_drive_t *drive)
329 330
330 kfree(id); 331 kfree(id);
331 332
332 if ((drive->dev_flags & IDE_DFLAG_USING_DMA) && ide_id_dma_bug(drive))
333 ide_dma_off(drive);
334
335 return 1; 333 return 1;
336out_err: 334out_err:
337 if (rc == 2) 335 if (rc == 2)
diff --git a/drivers/ide/ide-pm.c b/drivers/ide/ide-pm.c
index c14ca144cffe..ad7be2669dcb 100644
--- a/drivers/ide/ide-pm.c
+++ b/drivers/ide/ide-pm.c
@@ -10,9 +10,11 @@ int generic_ide_suspend(struct device *dev, pm_message_t mesg)
10 struct request_pm_state rqpm; 10 struct request_pm_state rqpm;
11 int ret; 11 int ret;
12 12
13 /* call ACPI _GTM only once */ 13 if (ide_port_acpi(hwif)) {
14 if ((drive->dn & 1) == 0 || pair == NULL) 14 /* call ACPI _GTM only once */
15 ide_acpi_get_timing(hwif); 15 if ((drive->dn & 1) == 0 || pair == NULL)
16 ide_acpi_get_timing(hwif);
17 }
16 18
17 memset(&rqpm, 0, sizeof(rqpm)); 19 memset(&rqpm, 0, sizeof(rqpm));
18 rq = blk_get_request(drive->queue, READ, __GFP_WAIT); 20 rq = blk_get_request(drive->queue, READ, __GFP_WAIT);
@@ -26,9 +28,11 @@ int generic_ide_suspend(struct device *dev, pm_message_t mesg)
26 ret = blk_execute_rq(drive->queue, NULL, rq, 0); 28 ret = blk_execute_rq(drive->queue, NULL, rq, 0);
27 blk_put_request(rq); 29 blk_put_request(rq);
28 30
29 /* call ACPI _PS3 only after both devices are suspended */ 31 if (ret == 0 && ide_port_acpi(hwif)) {
30 if (ret == 0 && ((drive->dn & 1) || pair == NULL)) 32 /* call ACPI _PS3 only after both devices are suspended */
31 ide_acpi_set_state(hwif, 0); 33 if ((drive->dn & 1) || pair == NULL)
34 ide_acpi_set_state(hwif, 0);
35 }
32 36
33 return ret; 37 return ret;
34} 38}
@@ -42,13 +46,15 @@ int generic_ide_resume(struct device *dev)
42 struct request_pm_state rqpm; 46 struct request_pm_state rqpm;
43 int err; 47 int err;
44 48
45 /* call ACPI _PS0 / _STM only once */ 49 if (ide_port_acpi(hwif)) {
46 if ((drive->dn & 1) == 0 || pair == NULL) { 50 /* call ACPI _PS0 / _STM only once */
47 ide_acpi_set_state(hwif, 1); 51 if ((drive->dn & 1) == 0 || pair == NULL) {
48 ide_acpi_push_timing(hwif); 52 ide_acpi_set_state(hwif, 1);
49 } 53 ide_acpi_push_timing(hwif);
54 }
50 55
51 ide_acpi_exec_tfs(drive); 56 ide_acpi_exec_tfs(drive);
57 }
52 58
53 memset(&rqpm, 0, sizeof(rqpm)); 59 memset(&rqpm, 0, sizeof(rqpm));
54 rq = blk_get_request(drive->queue, READ, __GFP_WAIT); 60 rq = blk_get_request(drive->queue, READ, __GFP_WAIT);
diff --git a/drivers/ide/ide-probe.c b/drivers/ide/ide-probe.c
index 51af4eea0d36..1bb106f6221a 100644
--- a/drivers/ide/ide-probe.c
+++ b/drivers/ide/ide-probe.c
@@ -818,6 +818,24 @@ static int ide_port_setup_devices(ide_hwif_t *hwif)
818 return j; 818 return j;
819} 819}
820 820
821static void ide_host_enable_irqs(struct ide_host *host)
822{
823 ide_hwif_t *hwif;
824 int i;
825
826 ide_host_for_each_port(i, hwif, host) {
827 if (hwif == NULL)
828 continue;
829
830 /* clear any pending IRQs */
831 hwif->tp_ops->read_status(hwif);
832
833 /* unmask IRQs */
834 if (hwif->io_ports.ctl_addr)
835 hwif->tp_ops->write_devctl(hwif, ATA_DEVCTL_OBS);
836 }
837}
838
821/* 839/*
822 * This routine sets up the IRQ for an IDE interface. 840 * This routine sets up the IRQ for an IDE interface.
823 */ 841 */
@@ -831,9 +849,6 @@ static int init_irq (ide_hwif_t *hwif)
831 if (irq_handler == NULL) 849 if (irq_handler == NULL)
832 irq_handler = ide_intr; 850 irq_handler = ide_intr;
833 851
834 if (io_ports->ctl_addr)
835 hwif->tp_ops->write_devctl(hwif, ATA_DEVCTL_OBS);
836
837 if (request_irq(hwif->irq, irq_handler, sa, hwif->name, hwif)) 852 if (request_irq(hwif->irq, irq_handler, sa, hwif->name, hwif))
838 goto out_up; 853 goto out_up;
839 854
@@ -1404,6 +1419,8 @@ int ide_host_register(struct ide_host *host, const struct ide_port_info *d,
1404 ide_port_tune_devices(hwif); 1419 ide_port_tune_devices(hwif);
1405 } 1420 }
1406 1421
1422 ide_host_enable_irqs(host);
1423
1407 ide_host_for_each_port(i, hwif, host) { 1424 ide_host_for_each_port(i, hwif, host) {
1408 if (hwif == NULL) 1425 if (hwif == NULL)
1409 continue; 1426 continue;
diff --git a/drivers/ide/ide-tape.c b/drivers/ide/ide-tape.c
index 013dc595fab6..bc5fb12b913c 100644
--- a/drivers/ide/ide-tape.c
+++ b/drivers/ide/ide-tape.c
@@ -1064,6 +1064,7 @@ static int idetape_blkdev_ioctl(ide_drive_t *drive, unsigned int cmd,
1064 tape->best_dsc_rw_freq = config.dsc_rw_frequency; 1064 tape->best_dsc_rw_freq = config.dsc_rw_frequency;
1065 break; 1065 break;
1066 case 0x0350: 1066 case 0x0350:
1067 memset(&config, 0, sizeof(config));
1067 config.dsc_rw_frequency = (int) tape->best_dsc_rw_freq; 1068 config.dsc_rw_frequency = (int) tape->best_dsc_rw_freq;
1068 config.nr_stages = 1; 1069 config.nr_stages = 1;
1069 if (copy_to_user(argp, &config, sizeof(config))) 1070 if (copy_to_user(argp, &config, sizeof(config)))
diff --git a/drivers/ieee1394/sbp2.c b/drivers/ieee1394/sbp2.c
index 83b734aec923..52b25f8b111d 100644
--- a/drivers/ieee1394/sbp2.c
+++ b/drivers/ieee1394/sbp2.c
@@ -880,6 +880,7 @@ static struct sbp2_lu *sbp2_alloc_device(struct unit_directory *ud)
880 } 880 }
881 881
882 shost->hostdata[0] = (unsigned long)lu; 882 shost->hostdata[0] = (unsigned long)lu;
883 shost->max_cmd_len = SBP2_MAX_CDB_SIZE;
883 884
884 if (!scsi_add_host(shost, &ud->device)) { 885 if (!scsi_add_host(shost, &ud->device)) {
885 lu->shost = shost; 886 lu->shost = shost;
diff --git a/drivers/ieee1394/sbp2.h b/drivers/ieee1394/sbp2.h
index c5036f1cc5b0..64a3a66a8a39 100644
--- a/drivers/ieee1394/sbp2.h
+++ b/drivers/ieee1394/sbp2.h
@@ -25,6 +25,12 @@
25#define SBP2_DEVICE_NAME "sbp2" 25#define SBP2_DEVICE_NAME "sbp2"
26 26
27/* 27/*
28 * There is no transport protocol limit to the CDB length, but we implement
29 * a fixed length only. 16 bytes is enough for disks larger than 2 TB.
30 */
31#define SBP2_MAX_CDB_SIZE 16
32
33/*
28 * SBP-2 specific definitions 34 * SBP-2 specific definitions
29 */ 35 */
30 36
@@ -51,7 +57,7 @@ struct sbp2_command_orb {
51 u32 data_descriptor_hi; 57 u32 data_descriptor_hi;
52 u32 data_descriptor_lo; 58 u32 data_descriptor_lo;
53 u32 misc; 59 u32 misc;
54 u8 cdb[12]; 60 u8 cdb[SBP2_MAX_CDB_SIZE];
55} __attribute__((packed)); 61} __attribute__((packed));
56 62
57#define SBP2_LOGIN_REQUEST 0x0 63#define SBP2_LOGIN_REQUEST 0x0
diff --git a/drivers/input/evdev.c b/drivers/input/evdev.c
index 114efd8dc8f5..1148140d08a1 100644
--- a/drivers/input/evdev.c
+++ b/drivers/input/evdev.c
@@ -608,8 +608,7 @@ static long evdev_do_ioctl(struct file *file, unsigned int cmd,
608 p, compat_mode); 608 p, compat_mode);
609 609
610 if (_IOC_NR(cmd) == _IOC_NR(EVIOCGNAME(0))) 610 if (_IOC_NR(cmd) == _IOC_NR(EVIOCGNAME(0)))
611 return str_to_user(dev_name(&evdev->dev), 611 return str_to_user(dev->name, _IOC_SIZE(cmd), p);
612 _IOC_SIZE(cmd), p);
613 612
614 if (_IOC_NR(cmd) == _IOC_NR(EVIOCGPHYS(0))) 613 if (_IOC_NR(cmd) == _IOC_NR(EVIOCGPHYS(0)))
615 return str_to_user(dev->phys, _IOC_SIZE(cmd), p); 614 return str_to_user(dev->phys, _IOC_SIZE(cmd), p);
diff --git a/drivers/input/joydev.c b/drivers/input/joydev.c
index 0e12f89276a3..4cfd084fa897 100644
--- a/drivers/input/joydev.c
+++ b/drivers/input/joydev.c
@@ -536,7 +536,7 @@ static int joydev_ioctl_common(struct joydev *joydev,
536 default: 536 default:
537 if ((cmd & ~IOCSIZE_MASK) == JSIOCGNAME(0)) { 537 if ((cmd & ~IOCSIZE_MASK) == JSIOCGNAME(0)) {
538 int len; 538 int len;
539 const char *name = dev_name(&dev->dev); 539 const char *name = dev->name;
540 540
541 if (!name) 541 if (!name)
542 return 0; 542 return 0;
diff --git a/drivers/input/joystick/xpad.c b/drivers/input/joystick/xpad.c
index b868b8d5fbb3..f155ad8cdae7 100644
--- a/drivers/input/joystick/xpad.c
+++ b/drivers/input/joystick/xpad.c
@@ -470,20 +470,20 @@ static void xpad_irq_out(struct urb *urb)
470 status = urb->status; 470 status = urb->status;
471 471
472 switch (status) { 472 switch (status) {
473 case 0: 473 case 0:
474 /* success */ 474 /* success */
475 break; 475 return;
476 case -ECONNRESET: 476
477 case -ENOENT: 477 case -ECONNRESET:
478 case -ESHUTDOWN: 478 case -ENOENT:
479 /* this urb is terminated, clean up */ 479 case -ESHUTDOWN:
480 dbg("%s - urb shutting down with status: %d", 480 /* this urb is terminated, clean up */
481 __func__, status); 481 dbg("%s - urb shutting down with status: %d", __func__, status);
482 return; 482 return;
483 default: 483
484 dbg("%s - nonzero urb status received: %d", 484 default:
485 __func__, status); 485 dbg("%s - nonzero urb status received: %d", __func__, status);
486 goto exit; 486 goto exit;
487 } 487 }
488 488
489exit: 489exit:
diff --git a/drivers/input/keyboard/Kconfig b/drivers/input/keyboard/Kconfig
index 9d8f796c6745..a6b989a9dc07 100644
--- a/drivers/input/keyboard/Kconfig
+++ b/drivers/input/keyboard/Kconfig
@@ -12,6 +12,42 @@ menuconfig INPUT_KEYBOARD
12 12
13if INPUT_KEYBOARD 13if INPUT_KEYBOARD
14 14
15config KEYBOARD_AAED2000
16 tristate "AAED-2000 keyboard"
17 depends on MACH_AAED2000
18 select INPUT_POLLDEV
19 default y
20 help
21 Say Y here to enable the keyboard on the Agilent AAED-2000
22 development board.
23
24 To compile this driver as a module, choose M here: the
25 module will be called aaed2000_kbd.
26
27config KEYBOARD_AMIGA
28 tristate "Amiga keyboard"
29 depends on AMIGA
30 help
31 Say Y here if you are running Linux on any AMIGA and have a keyboard
32 attached.
33
34 To compile this driver as a module, choose M here: the
35 module will be called amikbd.
36
37config ATARI_KBD_CORE
38 bool
39
40config KEYBOARD_ATARI
41 tristate "Atari keyboard"
42 depends on ATARI
43 select ATARI_KBD_CORE
44 help
45 Say Y here if you are running Linux on any Atari and have a keyboard
46 attached.
47
48 To compile this driver as a module, choose M here: the
49 module will be called atakbd.
50
15config KEYBOARD_ATKBD 51config KEYBOARD_ATKBD
16 tristate "AT keyboard" if EMBEDDED || !X86 52 tristate "AT keyboard" if EMBEDDED || !X86
17 default y 53 default y
@@ -68,69 +104,14 @@ config KEYBOARD_ATKBD_RDI_KEYCODES
68 right-hand column will be interpreted as the key shown in the 104 right-hand column will be interpreted as the key shown in the
69 left-hand column. 105 left-hand column.
70 106
71config KEYBOARD_SUNKBD 107config KEYBOARD_BFIN
72 tristate "Sun Type 4 and Type 5 keyboard" 108 tristate "Blackfin BF54x keypad support"
73 select SERIO 109 depends on (BF54x && !BF544)
74 help
75 Say Y here if you want to use a Sun Type 4 or Type 5 keyboard,
76 connected either to the Sun keyboard connector or to an serial
77 (RS-232) port via a simple adapter.
78
79 To compile this driver as a module, choose M here: the
80 module will be called sunkbd.
81
82config KEYBOARD_LKKBD
83 tristate "DECstation/VAXstation LK201/LK401 keyboard"
84 select SERIO
85 help
86 Say Y here if you want to use a LK201 or LK401 style serial
87 keyboard. This keyboard is also useable on PCs if you attach
88 it with the inputattach program. The connector pinout is
89 described within lkkbd.c.
90
91 To compile this driver as a module, choose M here: the
92 module will be called lkkbd.
93
94config KEYBOARD_LOCOMO
95 tristate "LoCoMo Keyboard Support"
96 depends on SHARP_LOCOMO && INPUT_KEYBOARD
97 help
98 Say Y here if you are running Linux on a Sharp Zaurus Collie or Poodle based PDA
99
100 To compile this driver as a module, choose M here: the
101 module will be called locomokbd.
102
103config KEYBOARD_XTKBD
104 tristate "XT keyboard"
105 select SERIO
106 help
107 Say Y here if you want to use the old IBM PC/XT keyboard (or
108 compatible) on your system. This is only possible with a
109 parallel port keyboard adapter, you cannot connect it to the
110 keyboard port on a PC that runs Linux.
111
112 To compile this driver as a module, choose M here: the
113 module will be called xtkbd.
114
115config KEYBOARD_NEWTON
116 tristate "Newton keyboard"
117 select SERIO
118 help
119 Say Y here if you have a Newton keyboard on a serial port.
120
121 To compile this driver as a module, choose M here: the
122 module will be called newtonkbd.
123
124config KEYBOARD_STOWAWAY
125 tristate "Stowaway keyboard"
126 select SERIO
127 help 110 help
128 Say Y here if you have a Stowaway keyboard on a serial port. 111 Say Y here if you want to use the BF54x keypad.
129 Stowaway compatible keyboards like Dicota Input-PDA keyboard
130 are also supported by this driver.
131 112
132 To compile this driver as a module, choose M here: the 113 To compile this driver as a module, choose M here: the
133 module will be called stowaway. 114 module will be called bf54x-keys.
134 115
135config KEYBOARD_CORGI 116config KEYBOARD_CORGI
136 tristate "Corgi keyboard" 117 tristate "Corgi keyboard"
@@ -143,61 +124,50 @@ config KEYBOARD_CORGI
143 To compile this driver as a module, choose M here: the 124 To compile this driver as a module, choose M here: the
144 module will be called corgikbd. 125 module will be called corgikbd.
145 126
146config KEYBOARD_SPITZ 127config KEYBOARD_LKKBD
147 tristate "Spitz keyboard" 128 tristate "DECstation/VAXstation LK201/LK401 keyboard"
148 depends on PXA_SHARPSL 129 select SERIO
149 default y
150 help 130 help
151 Say Y here to enable the keyboard on the Sharp Zaurus SL-C1000, 131 Say Y here if you want to use a LK201 or LK401 style serial
152 SL-C3000 and Sl-C3100 series of PDAs. 132 keyboard. This keyboard is also useable on PCs if you attach
133 it with the inputattach program. The connector pinout is
134 described within lkkbd.c.
153 135
154 To compile this driver as a module, choose M here: the 136 To compile this driver as a module, choose M here: the
155 module will be called spitzkbd. 137 module will be called lkkbd.
156 138
157config KEYBOARD_TOSA 139config KEYBOARD_EP93XX
158 tristate "Tosa keyboard" 140 tristate "EP93xx Matrix Keypad support"
159 depends on MACH_TOSA 141 depends on ARCH_EP93XX
160 default y
161 help 142 help
162 Say Y here to enable the keyboard on the Sharp Zaurus SL-6000x (Tosa) 143 Say Y here to enable the matrix keypad on the Cirrus EP93XX.
163 144
164 To compile this driver as a module, choose M here: the 145 To compile this driver as a module, choose M here: the
165 module will be called tosakbd. 146 module will be called ep93xx_keypad.
166 147
167config KEYBOARD_TOSA_USE_EXT_KEYCODES 148config KEYBOARD_GPIO
168 bool "Tosa keyboard: use extended keycodes" 149 tristate "GPIO Buttons"
169 depends on KEYBOARD_TOSA 150 depends on GENERIC_GPIO
170 default n
171 help 151 help
172 Say Y here to enable the tosa keyboard driver to generate extended 152 This driver implements support for buttons connected
173 (>= 127) keycodes. Be aware, that they can't be correctly interpreted 153 to GPIO pins of various CPUs (and some other chips).
174 by either console keyboard driver or by Kdrive keybd driver.
175
176 Say Y only if you know, what you are doing!
177 154
178config KEYBOARD_AMIGA 155 Say Y here if your device has buttons connected
179 tristate "Amiga keyboard" 156 directly to such GPIO pins. Your board-specific
180 depends on AMIGA 157 setup logic must also provide a platform device,
181 help 158 with configuration data saying which GPIOs are used.
182 Say Y here if you are running Linux on any AMIGA and have a keyboard
183 attached.
184 159
185 To compile this driver as a module, choose M here: the 160 To compile this driver as a module, choose M here: the
186 module will be called amikbd. 161 module will be called gpio_keys.
187 162
188config ATARI_KBD_CORE 163config KEYBOARD_MATRIX
189 bool 164 tristate "GPIO driven matrix keypad support"
190 165 depends on GENERIC_GPIO
191config KEYBOARD_ATARI
192 tristate "Atari keyboard"
193 depends on ATARI
194 select ATARI_KBD_CORE
195 help 166 help
196 Say Y here if you are running Linux on any Atari and have a keyboard 167 Enable support for GPIO driven matrix keypad.
197 attached.
198 168
199 To compile this driver as a module, choose M here: the 169 To compile this driver as a module, choose M here: the
200 module will be called atakbd. 170 module will be called matrix_keypad.
201 171
202config KEYBOARD_HIL_OLD 172config KEYBOARD_HIL_OLD
203 tristate "HP HIL keyboard support (simple driver)" 173 tristate "HP HIL keyboard support (simple driver)"
@@ -261,20 +231,39 @@ config KEYBOARD_LM8323
261 To compile this driver as a module, choose M here: the 231 To compile this driver as a module, choose M here: the
262 module will be called lm8323. 232 module will be called lm8323.
263 233
264config KEYBOARD_OMAP 234config KEYBOARD_LOCOMO
265 tristate "TI OMAP keypad support" 235 tristate "LoCoMo Keyboard Support"
266 depends on (ARCH_OMAP1 || ARCH_OMAP2) 236 depends on SHARP_LOCOMO
267 help 237 help
268 Say Y here if you want to use the OMAP keypad. 238 Say Y here if you are running Linux on a Sharp Zaurus Collie or Poodle based PDA
269 239
270 To compile this driver as a module, choose M here: the 240 To compile this driver as a module, choose M here: the
271 module will be called omap-keypad. 241 module will be called locomokbd.
242
243config KEYBOARD_MAPLE
244 tristate "Maple bus keyboard"
245 depends on SH_DREAMCAST && MAPLE
246 help
247 Say Y here if you have a Dreamcast console running Linux and have
248 a keyboard attached to its Maple bus.
249
250 To compile this driver as a module, choose M here: the
251 module will be called maple_keyb.
252
253config KEYBOARD_NEWTON
254 tristate "Newton keyboard"
255 select SERIO
256 help
257 Say Y here if you have a Newton keyboard on a serial port.
258
259 To compile this driver as a module, choose M here: the
260 module will be called newtonkbd.
272 261
273config KEYBOARD_PXA27x 262config KEYBOARD_PXA27x
274 tristate "PXA27x/PXA3xx keypad support" 263 tristate "PXA27x/PXA3xx keypad support"
275 depends on PXA27x || PXA3xx 264 depends on PXA27x || PXA3xx
276 help 265 help
277 Enable support for PXA27x/PXA3xx keypad controller 266 Enable support for PXA27x/PXA3xx keypad controller.
278 267
279 To compile this driver as a module, choose M here: the 268 To compile this driver as a module, choose M here: the
280 module will be called pxa27x_keypad. 269 module will be called pxa27x_keypad.
@@ -288,51 +277,38 @@ config KEYBOARD_PXA930_ROTARY
288 To compile this driver as a module, choose M here: the 277 To compile this driver as a module, choose M here: the
289 module will be called pxa930_rotary. 278 module will be called pxa930_rotary.
290 279
291config KEYBOARD_AAED2000 280config KEYBOARD_SPITZ
292 tristate "AAED-2000 keyboard" 281 tristate "Spitz keyboard"
293 depends on MACH_AAED2000 282 depends on PXA_SHARPSL
294 select INPUT_POLLDEV
295 default y 283 default y
296 help 284 help
297 Say Y here to enable the keyboard on the Agilent AAED-2000 285 Say Y here to enable the keyboard on the Sharp Zaurus SL-C1000,
298 development board. 286 SL-C3000 and Sl-C3100 series of PDAs.
299
300 To compile this driver as a module, choose M here: the
301 module will be called aaed2000_kbd.
302
303config KEYBOARD_GPIO
304 tristate "GPIO Buttons"
305 depends on GENERIC_GPIO
306 help
307 This driver implements support for buttons connected
308 to GPIO pins of various CPUs (and some other chips).
309
310 Say Y here if your device has buttons connected
311 directly to such GPIO pins. Your board-specific
312 setup logic must also provide a platform device,
313 with configuration data saying which GPIOs are used.
314 287
315 To compile this driver as a module, choose M here: the 288 To compile this driver as a module, choose M here: the
316 module will be called gpio-keys. 289 module will be called spitzkbd.
317 290
318config KEYBOARD_MAPLE 291config KEYBOARD_STOWAWAY
319 tristate "Maple bus keyboard" 292 tristate "Stowaway keyboard"
320 depends on SH_DREAMCAST && MAPLE 293 select SERIO
321 help 294 help
322 Say Y here if you have a Dreamcast console running Linux and have 295 Say Y here if you have a Stowaway keyboard on a serial port.
323 a keyboard attached to its Maple bus. 296 Stowaway compatible keyboards like Dicota Input-PDA keyboard
297 are also supported by this driver.
324 298
325 To compile this driver as a module, choose M here: the 299 To compile this driver as a module, choose M here: the
326 module will be called maple_keyb. 300 module will be called stowaway.
327 301
328config KEYBOARD_BFIN 302config KEYBOARD_SUNKBD
329 tristate "Blackfin BF54x keypad support" 303 tristate "Sun Type 4 and Type 5 keyboard"
330 depends on (BF54x && !BF544) 304 select SERIO
331 help 305 help
332 Say Y here if you want to use the BF54x keypad. 306 Say Y here if you want to use a Sun Type 4 or Type 5 keyboard,
307 connected either to the Sun keyboard connector or to an serial
308 (RS-232) port via a simple adapter.
333 309
334 To compile this driver as a module, choose M here: the 310 To compile this driver as a module, choose M here: the
335 module will be called bf54x-keys. 311 module will be called sunkbd.
336 312
337config KEYBOARD_SH_KEYSC 313config KEYBOARD_SH_KEYSC
338 tristate "SuperH KEYSC keypad support" 314 tristate "SuperH KEYSC keypad support"
@@ -344,13 +320,45 @@ config KEYBOARD_SH_KEYSC
344 To compile this driver as a module, choose M here: the 320 To compile this driver as a module, choose M here: the
345 module will be called sh_keysc. 321 module will be called sh_keysc.
346 322
347config KEYBOARD_EP93XX 323config KEYBOARD_OMAP
348 tristate "EP93xx Matrix Keypad support" 324 tristate "TI OMAP keypad support"
349 depends on ARCH_EP93XX 325 depends on (ARCH_OMAP1 || ARCH_OMAP2)
350 help 326 help
351 Say Y here to enable the matrix keypad on the Cirrus EP93XX. 327 Say Y here if you want to use the OMAP keypad.
352 328
353 To compile this driver as a module, choose M here: the 329 To compile this driver as a module, choose M here: the
354 module will be called ep93xx_keypad. 330 module will be called omap-keypad.
331
332config KEYBOARD_TOSA
333 tristate "Tosa keyboard"
334 depends on MACH_TOSA
335 default y
336 help
337 Say Y here to enable the keyboard on the Sharp Zaurus SL-6000x (Tosa)
338
339 To compile this driver as a module, choose M here: the
340 module will be called tosakbd.
341
342config KEYBOARD_TOSA_USE_EXT_KEYCODES
343 bool "Tosa keyboard: use extended keycodes"
344 depends on KEYBOARD_TOSA
345 help
346 Say Y here to enable the tosa keyboard driver to generate extended
347 (>= 127) keycodes. Be aware, that they can't be correctly interpreted
348 by either console keyboard driver or by Kdrive keybd driver.
349
350 Say Y only if you know, what you are doing!
351
352config KEYBOARD_XTKBD
353 tristate "XT keyboard"
354 select SERIO
355 help
356 Say Y here if you want to use the old IBM PC/XT keyboard (or
357 compatible) on your system. This is only possible with a
358 parallel port keyboard adapter, you cannot connect it to the
359 keyboard port on a PC that runs Linux.
360
361 To compile this driver as a module, choose M here: the
362 module will be called xtkbd.
355 363
356endif 364endif
diff --git a/drivers/input/keyboard/Makefile b/drivers/input/keyboard/Makefile
index 156b647a259b..b5b5eae9724f 100644
--- a/drivers/input/keyboard/Makefile
+++ b/drivers/input/keyboard/Makefile
@@ -4,29 +4,30 @@
4 4
5# Each configuration option enables a list of files. 5# Each configuration option enables a list of files.
6 6
7obj-$(CONFIG_KEYBOARD_ATKBD) += atkbd.o 7obj-$(CONFIG_KEYBOARD_AAED2000) += aaed2000_kbd.o
8obj-$(CONFIG_KEYBOARD_SUNKBD) += sunkbd.o
9obj-$(CONFIG_KEYBOARD_LKKBD) += lkkbd.o
10obj-$(CONFIG_KEYBOARD_XTKBD) += xtkbd.o
11obj-$(CONFIG_KEYBOARD_AMIGA) += amikbd.o 8obj-$(CONFIG_KEYBOARD_AMIGA) += amikbd.o
12obj-$(CONFIG_KEYBOARD_ATARI) += atakbd.o 9obj-$(CONFIG_KEYBOARD_ATARI) += atakbd.o
13obj-$(CONFIG_KEYBOARD_LOCOMO) += locomokbd.o 10obj-$(CONFIG_KEYBOARD_ATKBD) += atkbd.o
14obj-$(CONFIG_KEYBOARD_NEWTON) += newtonkbd.o 11obj-$(CONFIG_KEYBOARD_BFIN) += bf54x-keys.o
15obj-$(CONFIG_KEYBOARD_STOWAWAY) += stowaway.o
16obj-$(CONFIG_KEYBOARD_CORGI) += corgikbd.o 12obj-$(CONFIG_KEYBOARD_CORGI) += corgikbd.o
17obj-$(CONFIG_KEYBOARD_SPITZ) += spitzkbd.o 13obj-$(CONFIG_KEYBOARD_EP93XX) += ep93xx_keypad.o
18obj-$(CONFIG_KEYBOARD_TOSA) += tosakbd.o 14obj-$(CONFIG_KEYBOARD_GPIO) += gpio_keys.o
19obj-$(CONFIG_KEYBOARD_HIL) += hil_kbd.o 15obj-$(CONFIG_KEYBOARD_HIL) += hil_kbd.o
20obj-$(CONFIG_KEYBOARD_HIL_OLD) += hilkbd.o 16obj-$(CONFIG_KEYBOARD_HIL_OLD) += hilkbd.o
17obj-$(CONFIG_KEYBOARD_HP6XX) += jornada680_kbd.o
18obj-$(CONFIG_KEYBOARD_HP7XX) += jornada720_kbd.o
19obj-$(CONFIG_KEYBOARD_LKKBD) += lkkbd.o
21obj-$(CONFIG_KEYBOARD_LM8323) += lm8323.o 20obj-$(CONFIG_KEYBOARD_LM8323) += lm8323.o
21obj-$(CONFIG_KEYBOARD_LOCOMO) += locomokbd.o
22obj-$(CONFIG_KEYBOARD_MAPLE) += maple_keyb.o
23obj-$(CONFIG_KEYBOARD_MATRIX) += matrix_keypad.o
24obj-$(CONFIG_KEYBOARD_NEWTON) += newtonkbd.o
22obj-$(CONFIG_KEYBOARD_OMAP) += omap-keypad.o 25obj-$(CONFIG_KEYBOARD_OMAP) += omap-keypad.o
23obj-$(CONFIG_KEYBOARD_PXA27x) += pxa27x_keypad.o 26obj-$(CONFIG_KEYBOARD_PXA27x) += pxa27x_keypad.o
24obj-$(CONFIG_KEYBOARD_PXA930_ROTARY) += pxa930_rotary.o 27obj-$(CONFIG_KEYBOARD_PXA930_ROTARY) += pxa930_rotary.o
25obj-$(CONFIG_KEYBOARD_AAED2000) += aaed2000_kbd.o
26obj-$(CONFIG_KEYBOARD_GPIO) += gpio_keys.o
27obj-$(CONFIG_KEYBOARD_HP6XX) += jornada680_kbd.o
28obj-$(CONFIG_KEYBOARD_HP7XX) += jornada720_kbd.o
29obj-$(CONFIG_KEYBOARD_MAPLE) += maple_keyb.o
30obj-$(CONFIG_KEYBOARD_BFIN) += bf54x-keys.o
31obj-$(CONFIG_KEYBOARD_SH_KEYSC) += sh_keysc.o 28obj-$(CONFIG_KEYBOARD_SH_KEYSC) += sh_keysc.o
32obj-$(CONFIG_KEYBOARD_EP93XX) += ep93xx_keypad.o 29obj-$(CONFIG_KEYBOARD_SPITZ) += spitzkbd.o
30obj-$(CONFIG_KEYBOARD_STOWAWAY) += stowaway.o
31obj-$(CONFIG_KEYBOARD_SUNKBD) += sunkbd.o
32obj-$(CONFIG_KEYBOARD_TOSA) += tosakbd.o
33obj-$(CONFIG_KEYBOARD_XTKBD) += xtkbd.o
diff --git a/drivers/input/keyboard/atkbd.c b/drivers/input/keyboard/atkbd.c
index df3f8aa68115..95fe0452dae4 100644
--- a/drivers/input/keyboard/atkbd.c
+++ b/drivers/input/keyboard/atkbd.c
@@ -895,6 +895,13 @@ static unsigned int atkbd_amilo_pa1510_forced_release_keys[] = {
895}; 895};
896 896
897/* 897/*
898 * Amilo Pi 3525 key release for Fn+Volume keys not working
899 */
900static unsigned int atkbd_amilo_pi3525_forced_release_keys[] = {
901 0x20, 0xa0, 0x2e, 0xae, 0x30, 0xb0, -1U
902};
903
904/*
898 * Amilo Xi 3650 key release for light touch bar not working 905 * Amilo Xi 3650 key release for light touch bar not working
899 */ 906 */
900static unsigned int atkbd_amilo_xi3650_forced_release_keys[] = { 907static unsigned int atkbd_amilo_xi3650_forced_release_keys[] = {
@@ -902,6 +909,13 @@ static unsigned int atkbd_amilo_xi3650_forced_release_keys[] = {
902}; 909};
903 910
904/* 911/*
912 * Soltech TA12 system with broken key release on volume keys and mute key
913 */
914static unsigned int atkdb_soltech_ta12_forced_release_keys[] = {
915 0xa0, 0xae, 0xb0, -1U
916};
917
918/*
905 * atkbd_set_keycode_table() initializes keyboard's keycode table 919 * atkbd_set_keycode_table() initializes keyboard's keycode table
906 * according to the selected scancode set 920 * according to the selected scancode set
907 */ 921 */
@@ -1568,6 +1582,15 @@ static struct dmi_system_id atkbd_dmi_quirk_table[] __initdata = {
1568 .driver_data = atkbd_amilo_pa1510_forced_release_keys, 1582 .driver_data = atkbd_amilo_pa1510_forced_release_keys,
1569 }, 1583 },
1570 { 1584 {
1585 .ident = "Fujitsu Amilo Pi 3525",
1586 .matches = {
1587 DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"),
1588 DMI_MATCH(DMI_PRODUCT_NAME, "AMILO Pi 3525"),
1589 },
1590 .callback = atkbd_setup_forced_release,
1591 .driver_data = atkbd_amilo_pi3525_forced_release_keys,
1592 },
1593 {
1571 .ident = "Fujitsu Amilo Xi 3650", 1594 .ident = "Fujitsu Amilo Xi 3650",
1572 .matches = { 1595 .matches = {
1573 DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"), 1596 DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"),
@@ -1576,6 +1599,15 @@ static struct dmi_system_id atkbd_dmi_quirk_table[] __initdata = {
1576 .callback = atkbd_setup_forced_release, 1599 .callback = atkbd_setup_forced_release,
1577 .driver_data = atkbd_amilo_xi3650_forced_release_keys, 1600 .driver_data = atkbd_amilo_xi3650_forced_release_keys,
1578 }, 1601 },
1602 {
1603 .ident = "Soltech Corporation TA12",
1604 .matches = {
1605 DMI_MATCH(DMI_SYS_VENDOR, "Soltech Corporation"),
1606 DMI_MATCH(DMI_PRODUCT_NAME, "TA12"),
1607 },
1608 .callback = atkbd_setup_forced_release,
1609 .driver_data = atkdb_soltech_ta12_forced_release_keys,
1610 },
1579 { } 1611 { }
1580}; 1612};
1581 1613
diff --git a/drivers/input/keyboard/gpio_keys.c b/drivers/input/keyboard/gpio_keys.c
index 2157cd7de00c..efed0c9e242e 100644
--- a/drivers/input/keyboard/gpio_keys.c
+++ b/drivers/input/keyboard/gpio_keys.c
@@ -29,7 +29,8 @@
29struct gpio_button_data { 29struct gpio_button_data {
30 struct gpio_keys_button *button; 30 struct gpio_keys_button *button;
31 struct input_dev *input; 31 struct input_dev *input;
32 struct delayed_work work; 32 struct timer_list timer;
33 struct work_struct work;
33}; 34};
34 35
35struct gpio_keys_drvdata { 36struct gpio_keys_drvdata {
@@ -40,7 +41,7 @@ struct gpio_keys_drvdata {
40static void gpio_keys_report_event(struct work_struct *work) 41static void gpio_keys_report_event(struct work_struct *work)
41{ 42{
42 struct gpio_button_data *bdata = 43 struct gpio_button_data *bdata =
43 container_of(work, struct gpio_button_data, work.work); 44 container_of(work, struct gpio_button_data, work);
44 struct gpio_keys_button *button = bdata->button; 45 struct gpio_keys_button *button = bdata->button;
45 struct input_dev *input = bdata->input; 46 struct input_dev *input = bdata->input;
46 unsigned int type = button->type ?: EV_KEY; 47 unsigned int type = button->type ?: EV_KEY;
@@ -50,17 +51,25 @@ static void gpio_keys_report_event(struct work_struct *work)
50 input_sync(input); 51 input_sync(input);
51} 52}
52 53
54static void gpio_keys_timer(unsigned long _data)
55{
56 struct gpio_button_data *data = (struct gpio_button_data *)_data;
57
58 schedule_work(&data->work);
59}
60
53static irqreturn_t gpio_keys_isr(int irq, void *dev_id) 61static irqreturn_t gpio_keys_isr(int irq, void *dev_id)
54{ 62{
55 struct gpio_button_data *bdata = dev_id; 63 struct gpio_button_data *bdata = dev_id;
56 struct gpio_keys_button *button = bdata->button; 64 struct gpio_keys_button *button = bdata->button;
57 unsigned long delay;
58 65
59 BUG_ON(irq != gpio_to_irq(button->gpio)); 66 BUG_ON(irq != gpio_to_irq(button->gpio));
60 67
61 delay = button->debounce_interval ? 68 if (button->debounce_interval)
62 msecs_to_jiffies(button->debounce_interval) : 0; 69 mod_timer(&bdata->timer,
63 schedule_delayed_work(&bdata->work, delay); 70 jiffies + msecs_to_jiffies(button->debounce_interval));
71 else
72 schedule_work(&bdata->work);
64 73
65 return IRQ_HANDLED; 74 return IRQ_HANDLED;
66} 75}
@@ -107,7 +116,9 @@ static int __devinit gpio_keys_probe(struct platform_device *pdev)
107 116
108 bdata->input = input; 117 bdata->input = input;
109 bdata->button = button; 118 bdata->button = button;
110 INIT_DELAYED_WORK(&bdata->work, gpio_keys_report_event); 119 setup_timer(&bdata->timer,
120 gpio_keys_timer, (unsigned long)bdata);
121 INIT_WORK(&bdata->work, gpio_keys_report_event);
111 122
112 error = gpio_request(button->gpio, button->desc ?: "gpio_keys"); 123 error = gpio_request(button->gpio, button->desc ?: "gpio_keys");
113 if (error < 0) { 124 if (error < 0) {
@@ -166,7 +177,9 @@ static int __devinit gpio_keys_probe(struct platform_device *pdev)
166 fail2: 177 fail2:
167 while (--i >= 0) { 178 while (--i >= 0) {
168 free_irq(gpio_to_irq(pdata->buttons[i].gpio), &ddata->data[i]); 179 free_irq(gpio_to_irq(pdata->buttons[i].gpio), &ddata->data[i]);
169 cancel_delayed_work_sync(&ddata->data[i].work); 180 if (pdata->buttons[i].debounce_interval)
181 del_timer_sync(&ddata->data[i].timer);
182 cancel_work_sync(&ddata->data[i].work);
170 gpio_free(pdata->buttons[i].gpio); 183 gpio_free(pdata->buttons[i].gpio);
171 } 184 }
172 185
@@ -190,7 +203,9 @@ static int __devexit gpio_keys_remove(struct platform_device *pdev)
190 for (i = 0; i < pdata->nbuttons; i++) { 203 for (i = 0; i < pdata->nbuttons; i++) {
191 int irq = gpio_to_irq(pdata->buttons[i].gpio); 204 int irq = gpio_to_irq(pdata->buttons[i].gpio);
192 free_irq(irq, &ddata->data[i]); 205 free_irq(irq, &ddata->data[i]);
193 cancel_delayed_work_sync(&ddata->data[i].work); 206 if (pdata->buttons[i].debounce_interval)
207 del_timer_sync(&ddata->data[i].timer);
208 cancel_work_sync(&ddata->data[i].work);
194 gpio_free(pdata->buttons[i].gpio); 209 gpio_free(pdata->buttons[i].gpio);
195 } 210 }
196 211
diff --git a/drivers/input/keyboard/matrix_keypad.c b/drivers/input/keyboard/matrix_keypad.c
new file mode 100644
index 000000000000..541b981ff075
--- /dev/null
+++ b/drivers/input/keyboard/matrix_keypad.c
@@ -0,0 +1,453 @@
1/*
2 * GPIO driven matrix keyboard driver
3 *
4 * Copyright (c) 2008 Marek Vasut <marek.vasut@gmail.com>
5 *
6 * Based on corgikbd.c
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/types.h>
15#include <linux/delay.h>
16#include <linux/platform_device.h>
17#include <linux/init.h>
18#include <linux/input.h>
19#include <linux/irq.h>
20#include <linux/interrupt.h>
21#include <linux/jiffies.h>
22#include <linux/module.h>
23#include <linux/gpio.h>
24#include <linux/input/matrix_keypad.h>
25
26struct matrix_keypad {
27 const struct matrix_keypad_platform_data *pdata;
28 struct input_dev *input_dev;
29 unsigned short *keycodes;
30 unsigned int row_shift;
31
32 uint32_t last_key_state[MATRIX_MAX_COLS];
33 struct delayed_work work;
34 bool scan_pending;
35 bool stopped;
36 spinlock_t lock;
37};
38
39/*
40 * NOTE: normally the GPIO has to be put into HiZ when de-activated to cause
41 * minmal side effect when scanning other columns, here it is configured to
42 * be input, and it should work on most platforms.
43 */
44static void __activate_col(const struct matrix_keypad_platform_data *pdata,
45 int col, bool on)
46{
47 bool level_on = !pdata->active_low;
48
49 if (on) {
50 gpio_direction_output(pdata->col_gpios[col], level_on);
51 } else {
52 gpio_set_value_cansleep(pdata->col_gpios[col], !level_on);
53 gpio_direction_input(pdata->col_gpios[col]);
54 }
55}
56
57static void activate_col(const struct matrix_keypad_platform_data *pdata,
58 int col, bool on)
59{
60 __activate_col(pdata, col, on);
61
62 if (on && pdata->col_scan_delay_us)
63 udelay(pdata->col_scan_delay_us);
64}
65
66static void activate_all_cols(const struct matrix_keypad_platform_data *pdata,
67 bool on)
68{
69 int col;
70
71 for (col = 0; col < pdata->num_col_gpios; col++)
72 __activate_col(pdata, col, on);
73}
74
75static bool row_asserted(const struct matrix_keypad_platform_data *pdata,
76 int row)
77{
78 return gpio_get_value_cansleep(pdata->row_gpios[row]) ?
79 !pdata->active_low : pdata->active_low;
80}
81
82static void enable_row_irqs(struct matrix_keypad *keypad)
83{
84 const struct matrix_keypad_platform_data *pdata = keypad->pdata;
85 int i;
86
87 for (i = 0; i < pdata->num_row_gpios; i++)
88 enable_irq(gpio_to_irq(pdata->row_gpios[i]));
89}
90
91static void disable_row_irqs(struct matrix_keypad *keypad)
92{
93 const struct matrix_keypad_platform_data *pdata = keypad->pdata;
94 int i;
95
96 for (i = 0; i < pdata->num_row_gpios; i++)
97 disable_irq_nosync(gpio_to_irq(pdata->row_gpios[i]));
98}
99
100/*
101 * This gets the keys from keyboard and reports it to input subsystem
102 */
103static void matrix_keypad_scan(struct work_struct *work)
104{
105 struct matrix_keypad *keypad =
106 container_of(work, struct matrix_keypad, work.work);
107 struct input_dev *input_dev = keypad->input_dev;
108 const struct matrix_keypad_platform_data *pdata = keypad->pdata;
109 uint32_t new_state[MATRIX_MAX_COLS];
110 int row, col, code;
111
112 /* de-activate all columns for scanning */
113 activate_all_cols(pdata, false);
114
115 memset(new_state, 0, sizeof(new_state));
116
117 /* assert each column and read the row status out */
118 for (col = 0; col < pdata->num_col_gpios; col++) {
119
120 activate_col(pdata, col, true);
121
122 for (row = 0; row < pdata->num_row_gpios; row++)
123 new_state[col] |=
124 row_asserted(pdata, row) ? (1 << row) : 0;
125
126 activate_col(pdata, col, false);
127 }
128
129 for (col = 0; col < pdata->num_col_gpios; col++) {
130 uint32_t bits_changed;
131
132 bits_changed = keypad->last_key_state[col] ^ new_state[col];
133 if (bits_changed == 0)
134 continue;
135
136 for (row = 0; row < pdata->num_row_gpios; row++) {
137 if ((bits_changed & (1 << row)) == 0)
138 continue;
139
140 code = MATRIX_SCAN_CODE(row, col, keypad->row_shift);
141 input_event(input_dev, EV_MSC, MSC_SCAN, code);
142 input_report_key(input_dev,
143 keypad->keycodes[code],
144 new_state[col] & (1 << row));
145 }
146 }
147 input_sync(input_dev);
148
149 memcpy(keypad->last_key_state, new_state, sizeof(new_state));
150
151 activate_all_cols(pdata, true);
152
153 /* Enable IRQs again */
154 spin_lock_irq(&keypad->lock);
155 keypad->scan_pending = false;
156 enable_row_irqs(keypad);
157 spin_unlock_irq(&keypad->lock);
158}
159
160static irqreturn_t matrix_keypad_interrupt(int irq, void *id)
161{
162 struct matrix_keypad *keypad = id;
163 unsigned long flags;
164
165 spin_lock_irqsave(&keypad->lock, flags);
166
167 /*
168 * See if another IRQ beaten us to it and scheduled the
169 * scan already. In that case we should not try to
170 * disable IRQs again.
171 */
172 if (unlikely(keypad->scan_pending || keypad->stopped))
173 goto out;
174
175 disable_row_irqs(keypad);
176 keypad->scan_pending = true;
177 schedule_delayed_work(&keypad->work,
178 msecs_to_jiffies(keypad->pdata->debounce_ms));
179
180out:
181 spin_unlock_irqrestore(&keypad->lock, flags);
182 return IRQ_HANDLED;
183}
184
185static int matrix_keypad_start(struct input_dev *dev)
186{
187 struct matrix_keypad *keypad = input_get_drvdata(dev);
188
189 keypad->stopped = false;
190 mb();
191
192 /*
193 * Schedule an immediate key scan to capture current key state;
194 * columns will be activated and IRQs be enabled after the scan.
195 */
196 schedule_delayed_work(&keypad->work, 0);
197
198 return 0;
199}
200
201static void matrix_keypad_stop(struct input_dev *dev)
202{
203 struct matrix_keypad *keypad = input_get_drvdata(dev);
204
205 keypad->stopped = true;
206 mb();
207 flush_work(&keypad->work.work);
208 /*
209 * matrix_keypad_scan() will leave IRQs enabled;
210 * we should disable them now.
211 */
212 disable_row_irqs(keypad);
213}
214
215#ifdef CONFIG_PM
216static int matrix_keypad_suspend(struct platform_device *pdev, pm_message_t state)
217{
218 struct matrix_keypad *keypad = platform_get_drvdata(pdev);
219 const struct matrix_keypad_platform_data *pdata = keypad->pdata;
220 int i;
221
222 matrix_keypad_stop(keypad->input_dev);
223
224 if (device_may_wakeup(&pdev->dev))
225 for (i = 0; i < pdata->num_row_gpios; i++)
226 enable_irq_wake(gpio_to_irq(pdata->row_gpios[i]));
227
228 return 0;
229}
230
231static int matrix_keypad_resume(struct platform_device *pdev)
232{
233 struct matrix_keypad *keypad = platform_get_drvdata(pdev);
234 const struct matrix_keypad_platform_data *pdata = keypad->pdata;
235 int i;
236
237 if (device_may_wakeup(&pdev->dev))
238 for (i = 0; i < pdata->num_row_gpios; i++)
239 disable_irq_wake(gpio_to_irq(pdata->row_gpios[i]));
240
241 matrix_keypad_start(keypad->input_dev);
242
243 return 0;
244}
245#else
246#define matrix_keypad_suspend NULL
247#define matrix_keypad_resume NULL
248#endif
249
250static int __devinit init_matrix_gpio(struct platform_device *pdev,
251 struct matrix_keypad *keypad)
252{
253 const struct matrix_keypad_platform_data *pdata = keypad->pdata;
254 int i, err = -EINVAL;
255
256 /* initialized strobe lines as outputs, activated */
257 for (i = 0; i < pdata->num_col_gpios; i++) {
258 err = gpio_request(pdata->col_gpios[i], "matrix_kbd_col");
259 if (err) {
260 dev_err(&pdev->dev,
261 "failed to request GPIO%d for COL%d\n",
262 pdata->col_gpios[i], i);
263 goto err_free_cols;
264 }
265
266 gpio_direction_output(pdata->col_gpios[i], !pdata->active_low);
267 }
268
269 for (i = 0; i < pdata->num_row_gpios; i++) {
270 err = gpio_request(pdata->row_gpios[i], "matrix_kbd_row");
271 if (err) {
272 dev_err(&pdev->dev,
273 "failed to request GPIO%d for ROW%d\n",
274 pdata->row_gpios[i], i);
275 goto err_free_rows;
276 }
277
278 gpio_direction_input(pdata->row_gpios[i]);
279 }
280
281 for (i = 0; i < pdata->num_row_gpios; i++) {
282 err = request_irq(gpio_to_irq(pdata->row_gpios[i]),
283 matrix_keypad_interrupt,
284 IRQF_DISABLED |
285 IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING,
286 "matrix-keypad", keypad);
287 if (err) {
288 dev_err(&pdev->dev,
289 "Unable to acquire interrupt for GPIO line %i\n",
290 pdata->row_gpios[i]);
291 goto err_free_irqs;
292 }
293 }
294
295 /* initialized as disabled - enabled by input->open */
296 disable_row_irqs(keypad);
297 return 0;
298
299err_free_irqs:
300 while (--i >= 0)
301 free_irq(gpio_to_irq(pdata->row_gpios[i]), keypad);
302 i = pdata->num_row_gpios;
303err_free_rows:
304 while (--i >= 0)
305 gpio_free(pdata->row_gpios[i]);
306 i = pdata->num_col_gpios;
307err_free_cols:
308 while (--i >= 0)
309 gpio_free(pdata->col_gpios[i]);
310
311 return err;
312}
313
314static int __devinit matrix_keypad_probe(struct platform_device *pdev)
315{
316 const struct matrix_keypad_platform_data *pdata;
317 const struct matrix_keymap_data *keymap_data;
318 struct matrix_keypad *keypad;
319 struct input_dev *input_dev;
320 unsigned short *keycodes;
321 unsigned int row_shift;
322 int i;
323 int err;
324
325 pdata = pdev->dev.platform_data;
326 if (!pdata) {
327 dev_err(&pdev->dev, "no platform data defined\n");
328 return -EINVAL;
329 }
330
331 keymap_data = pdata->keymap_data;
332 if (!keymap_data) {
333 dev_err(&pdev->dev, "no keymap data defined\n");
334 return -EINVAL;
335 }
336
337 row_shift = get_count_order(pdata->num_col_gpios);
338
339 keypad = kzalloc(sizeof(struct matrix_keypad), GFP_KERNEL);
340 keycodes = kzalloc((pdata->num_row_gpios << row_shift) *
341 sizeof(*keycodes),
342 GFP_KERNEL);
343 input_dev = input_allocate_device();
344 if (!keypad || !keycodes || !input_dev) {
345 err = -ENOMEM;
346 goto err_free_mem;
347 }
348
349 keypad->input_dev = input_dev;
350 keypad->pdata = pdata;
351 keypad->keycodes = keycodes;
352 keypad->row_shift = row_shift;
353 keypad->stopped = true;
354 INIT_DELAYED_WORK(&keypad->work, matrix_keypad_scan);
355 spin_lock_init(&keypad->lock);
356
357 input_dev->name = pdev->name;
358 input_dev->id.bustype = BUS_HOST;
359 input_dev->dev.parent = &pdev->dev;
360 input_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_REP);
361 input_dev->open = matrix_keypad_start;
362 input_dev->close = matrix_keypad_stop;
363
364 input_dev->keycode = keycodes;
365 input_dev->keycodesize = sizeof(*keycodes);
366 input_dev->keycodemax = pdata->num_row_gpios << keypad->row_shift;
367
368 for (i = 0; i < keymap_data->keymap_size; i++) {
369 unsigned int key = keymap_data->keymap[i];
370 unsigned int row = KEY_ROW(key);
371 unsigned int col = KEY_COL(key);
372 unsigned short code = KEY_VAL(key);
373
374 keycodes[MATRIX_SCAN_CODE(row, col, row_shift)] = code;
375 __set_bit(code, input_dev->keybit);
376 }
377 __clear_bit(KEY_RESERVED, input_dev->keybit);
378
379 input_set_capability(input_dev, EV_MSC, MSC_SCAN);
380 input_set_drvdata(input_dev, keypad);
381
382 err = init_matrix_gpio(pdev, keypad);
383 if (err)
384 goto err_free_mem;
385
386 err = input_register_device(keypad->input_dev);
387 if (err)
388 goto err_free_mem;
389
390 device_init_wakeup(&pdev->dev, pdata->wakeup);
391 platform_set_drvdata(pdev, keypad);
392
393 return 0;
394
395err_free_mem:
396 input_free_device(input_dev);
397 kfree(keycodes);
398 kfree(keypad);
399 return err;
400}
401
402static int __devexit matrix_keypad_remove(struct platform_device *pdev)
403{
404 struct matrix_keypad *keypad = platform_get_drvdata(pdev);
405 const struct matrix_keypad_platform_data *pdata = keypad->pdata;
406 int i;
407
408 device_init_wakeup(&pdev->dev, 0);
409
410 for (i = 0; i < pdata->num_row_gpios; i++) {
411 free_irq(gpio_to_irq(pdata->row_gpios[i]), keypad);
412 gpio_free(pdata->row_gpios[i]);
413 }
414
415 for (i = 0; i < pdata->num_col_gpios; i++)
416 gpio_free(pdata->col_gpios[i]);
417
418 input_unregister_device(keypad->input_dev);
419 platform_set_drvdata(pdev, NULL);
420 kfree(keypad->keycodes);
421 kfree(keypad);
422
423 return 0;
424}
425
426static struct platform_driver matrix_keypad_driver = {
427 .probe = matrix_keypad_probe,
428 .remove = __devexit_p(matrix_keypad_remove),
429 .suspend = matrix_keypad_suspend,
430 .resume = matrix_keypad_resume,
431 .driver = {
432 .name = "matrix-keypad",
433 .owner = THIS_MODULE,
434 },
435};
436
437static int __init matrix_keypad_init(void)
438{
439 return platform_driver_register(&matrix_keypad_driver);
440}
441
442static void __exit matrix_keypad_exit(void)
443{
444 platform_driver_unregister(&matrix_keypad_driver);
445}
446
447module_init(matrix_keypad_init);
448module_exit(matrix_keypad_exit);
449
450MODULE_AUTHOR("Marek Vasut <marek.vasut@gmail.com>");
451MODULE_DESCRIPTION("GPIO Driven Matrix Keypad Driver");
452MODULE_LICENSE("GPL v2");
453MODULE_ALIAS("platform:matrix-keypad");
diff --git a/drivers/input/misc/cobalt_btns.c b/drivers/input/misc/cobalt_btns.c
index 2adf9cb265da..d114d3a9e1e9 100644
--- a/drivers/input/misc/cobalt_btns.c
+++ b/drivers/input/misc/cobalt_btns.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * Cobalt button interface driver. 2 * Cobalt button interface driver.
3 * 3 *
4 * Copyright (C) 2007-2008 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> 4 * Copyright (C) 2007-2008 Yoichi Yuasa <yuasa@linux-mips.org>
5 * 5 *
6 * This program is free software; you can redistribute it and/or modify 6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by 7 * it under the terms of the GNU General Public License as published by
@@ -148,7 +148,7 @@ static int __devexit cobalt_buttons_remove(struct platform_device *pdev)
148 return 0; 148 return 0;
149} 149}
150 150
151MODULE_AUTHOR("Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>"); 151MODULE_AUTHOR("Yoichi Yuasa <yuasa@linux-mips.org>");
152MODULE_DESCRIPTION("Cobalt button interface driver"); 152MODULE_DESCRIPTION("Cobalt button interface driver");
153MODULE_LICENSE("GPL"); 153MODULE_LICENSE("GPL");
154/* work with hotplug and coldplug */ 154/* work with hotplug and coldplug */
diff --git a/drivers/input/misc/pcspkr.c b/drivers/input/misc/pcspkr.c
index 6d67af5387ad..21cb755a54fb 100644
--- a/drivers/input/misc/pcspkr.c
+++ b/drivers/input/misc/pcspkr.c
@@ -114,7 +114,7 @@ static int __devexit pcspkr_remove(struct platform_device *dev)
114 return 0; 114 return 0;
115} 115}
116 116
117static int pcspkr_suspend(struct platform_device *dev, pm_message_t state) 117static int pcspkr_suspend(struct device *dev)
118{ 118{
119 pcspkr_event(NULL, EV_SND, SND_BELL, 0); 119 pcspkr_event(NULL, EV_SND, SND_BELL, 0);
120 120
@@ -127,14 +127,18 @@ static void pcspkr_shutdown(struct platform_device *dev)
127 pcspkr_event(NULL, EV_SND, SND_BELL, 0); 127 pcspkr_event(NULL, EV_SND, SND_BELL, 0);
128} 128}
129 129
130static struct dev_pm_ops pcspkr_pm_ops = {
131 .suspend = pcspkr_suspend,
132};
133
130static struct platform_driver pcspkr_platform_driver = { 134static struct platform_driver pcspkr_platform_driver = {
131 .driver = { 135 .driver = {
132 .name = "pcspkr", 136 .name = "pcspkr",
133 .owner = THIS_MODULE, 137 .owner = THIS_MODULE,
138 .pm = &pcspkr_pm_ops,
134 }, 139 },
135 .probe = pcspkr_probe, 140 .probe = pcspkr_probe,
136 .remove = __devexit_p(pcspkr_remove), 141 .remove = __devexit_p(pcspkr_remove),
137 .suspend = pcspkr_suspend,
138 .shutdown = pcspkr_shutdown, 142 .shutdown = pcspkr_shutdown,
139}; 143};
140 144
diff --git a/drivers/input/misc/wistron_btns.c b/drivers/input/misc/wistron_btns.c
index 7c8957dd22c0..27ee976eb54c 100644
--- a/drivers/input/misc/wistron_btns.c
+++ b/drivers/input/misc/wistron_btns.c
@@ -611,6 +611,20 @@ static struct key_entry keymap_wistron_generic[] __initdata = {
611 { KE_END, 0 } 611 { KE_END, 0 }
612}; 612};
613 613
614static struct key_entry keymap_prestigio[] __initdata = {
615 { KE_KEY, 0x11, {KEY_PROG1} },
616 { KE_KEY, 0x12, {KEY_PROG2} },
617 { KE_WIFI, 0x30 },
618 { KE_KEY, 0x22, {KEY_REWIND} },
619 { KE_KEY, 0x23, {KEY_FORWARD} },
620 { KE_KEY, 0x24, {KEY_PLAYPAUSE} },
621 { KE_KEY, 0x25, {KEY_STOPCD} },
622 { KE_KEY, 0x31, {KEY_MAIL} },
623 { KE_KEY, 0x36, {KEY_WWW} },
624 { KE_END, 0 }
625};
626
627
614/* 628/*
615 * If your machine is not here (which is currently rather likely), please send 629 * If your machine is not here (which is currently rather likely), please send
616 * a list of buttons and their key codes (reported when loading this module 630 * a list of buttons and their key codes (reported when loading this module
@@ -646,6 +660,15 @@ static struct dmi_system_id dmi_ids[] __initdata = {
646 }, 660 },
647 { 661 {
648 .callback = dmi_matched, 662 .callback = dmi_matched,
663 .ident = "Maxdata Pro 7000 DX",
664 .matches = {
665 DMI_MATCH(DMI_SYS_VENDOR, "MAXDATA"),
666 DMI_MATCH(DMI_PRODUCT_NAME, "Pro 7000"),
667 },
668 .driver_data = keymap_fs_amilo_pro_v2000
669 },
670 {
671 .callback = dmi_matched,
649 .ident = "Fujitsu N3510", 672 .ident = "Fujitsu N3510",
650 .matches = { 673 .matches = {
651 DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"), 674 DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
@@ -962,6 +985,8 @@ static int __init select_keymap(void)
962 if (keymap_name != NULL) { 985 if (keymap_name != NULL) {
963 if (strcmp (keymap_name, "1557/MS2141") == 0) 986 if (strcmp (keymap_name, "1557/MS2141") == 0)
964 keymap = keymap_wistron_ms2141; 987 keymap = keymap_wistron_ms2141;
988 else if (strcmp (keymap_name, "prestigio") == 0)
989 keymap = keymap_prestigio;
965 else if (strcmp (keymap_name, "generic") == 0) 990 else if (strcmp (keymap_name, "generic") == 0)
966 keymap = keymap_wistron_generic; 991 keymap = keymap_wistron_generic;
967 else { 992 else {
diff --git a/drivers/input/mouse/gpio_mouse.c b/drivers/input/mouse/gpio_mouse.c
index 5e5eb88d8d1e..7b6ce178f1b6 100644
--- a/drivers/input/mouse/gpio_mouse.c
+++ b/drivers/input/mouse/gpio_mouse.c
@@ -46,7 +46,7 @@ static void gpio_mouse_scan(struct input_polled_dev *dev)
46 input_sync(input); 46 input_sync(input);
47} 47}
48 48
49static int __init gpio_mouse_probe(struct platform_device *pdev) 49static int __devinit gpio_mouse_probe(struct platform_device *pdev)
50{ 50{
51 struct gpio_mouse_platform_data *pdata = pdev->dev.platform_data; 51 struct gpio_mouse_platform_data *pdata = pdev->dev.platform_data;
52 struct input_polled_dev *input_poll; 52 struct input_polled_dev *input_poll;
@@ -170,10 +170,8 @@ static int __devexit gpio_mouse_remove(struct platform_device *pdev)
170 return 0; 170 return 0;
171} 171}
172 172
173/* work with hotplug and coldplug */
174MODULE_ALIAS("platform:gpio_mouse");
175
176static struct platform_driver gpio_mouse_device_driver = { 173static struct platform_driver gpio_mouse_device_driver = {
174 .probe = gpio_mouse_probe,
177 .remove = __devexit_p(gpio_mouse_remove), 175 .remove = __devexit_p(gpio_mouse_remove),
178 .driver = { 176 .driver = {
179 .name = "gpio_mouse", 177 .name = "gpio_mouse",
@@ -183,8 +181,7 @@ static struct platform_driver gpio_mouse_device_driver = {
183 181
184static int __init gpio_mouse_init(void) 182static int __init gpio_mouse_init(void)
185{ 183{
186 return platform_driver_probe(&gpio_mouse_device_driver, 184 return platform_driver_register(&gpio_mouse_device_driver);
187 gpio_mouse_probe);
188} 185}
189module_init(gpio_mouse_init); 186module_init(gpio_mouse_init);
190 187
@@ -197,3 +194,5 @@ module_exit(gpio_mouse_exit);
197MODULE_AUTHOR("Hans-Christian Egtvedt <hcegtvedt@atmel.com>"); 194MODULE_AUTHOR("Hans-Christian Egtvedt <hcegtvedt@atmel.com>");
198MODULE_DESCRIPTION("GPIO mouse driver"); 195MODULE_DESCRIPTION("GPIO mouse driver");
199MODULE_LICENSE("GPL"); 196MODULE_LICENSE("GPL");
197MODULE_ALIAS("platform:gpio_mouse"); /* work with hotplug and coldplug */
198
diff --git a/drivers/input/serio/hp_sdc_mlc.c b/drivers/input/serio/hp_sdc_mlc.c
index b587e2d576ac..820e51673b26 100644
--- a/drivers/input/serio/hp_sdc_mlc.c
+++ b/drivers/input/serio/hp_sdc_mlc.c
@@ -296,7 +296,7 @@ static void hp_sdc_mlc_out(hil_mlc *mlc)
296 priv->tseq[3] = 0; 296 priv->tseq[3] = 0;
297 if (mlc->opacket & HIL_CTRL_APE) { 297 if (mlc->opacket & HIL_CTRL_APE) {
298 priv->tseq[3] |= HP_SDC_LPC_APE_IPF; 298 priv->tseq[3] |= HP_SDC_LPC_APE_IPF;
299 down_trylock(&mlc->csem); 299 BUG_ON(down_trylock(&mlc->csem));
300 } 300 }
301 enqueue: 301 enqueue:
302 hp_sdc_enqueue_transaction(&priv->trans); 302 hp_sdc_enqueue_transaction(&priv->trans);
diff --git a/drivers/input/serio/i8042-x86ia64io.h b/drivers/input/serio/i8042-x86ia64io.h
index fb8a3cd3ffd0..ae04d8a494e5 100644
--- a/drivers/input/serio/i8042-x86ia64io.h
+++ b/drivers/input/serio/i8042-x86ia64io.h
@@ -78,6 +78,14 @@ static struct dmi_system_id __initdata i8042_dmi_noloop_table[] = {
78 }, 78 },
79 }, 79 },
80 { 80 {
81 .ident = "ASUS G1S",
82 .matches = {
83 DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK Computer Inc."),
84 DMI_MATCH(DMI_BOARD_NAME, "G1S"),
85 DMI_MATCH(DMI_BOARD_VERSION, "1.0"),
86 },
87 },
88 {
81 /* AUX LOOP command does not raise AUX IRQ */ 89 /* AUX LOOP command does not raise AUX IRQ */
82 .ident = "ASUS P65UP5", 90 .ident = "ASUS P65UP5",
83 .matches = { 91 .matches = {
@@ -392,6 +400,34 @@ static struct dmi_system_id __initdata i8042_dmi_reset_table[] = {
392 DMI_MATCH(DMI_BOARD_VENDOR, "LG Electronics Inc."), 400 DMI_MATCH(DMI_BOARD_VENDOR, "LG Electronics Inc."),
393 }, 401 },
394 }, 402 },
403 {
404 .ident = "Acer Aspire One 150",
405 .matches = {
406 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
407 DMI_MATCH(DMI_PRODUCT_NAME, "AOA150"),
408 },
409 },
410 {
411 .ident = "Advent 4211",
412 .matches = {
413 DMI_MATCH(DMI_SYS_VENDOR, "DIXONSXP"),
414 DMI_MATCH(DMI_PRODUCT_NAME, "Advent 4211"),
415 },
416 },
417 {
418 .ident = "Medion Akoya Mini E1210",
419 .matches = {
420 DMI_MATCH(DMI_SYS_VENDOR, "MEDION"),
421 DMI_MATCH(DMI_PRODUCT_NAME, "E1210"),
422 },
423 },
424 {
425 .ident = "Mivvy M310",
426 .matches = {
427 DMI_MATCH(DMI_SYS_VENDOR, "VIOOO"),
428 DMI_MATCH(DMI_PRODUCT_NAME, "N10"),
429 },
430 },
395 { } 431 { }
396}; 432};
397 433
diff --git a/drivers/input/serio/i8042.c b/drivers/input/serio/i8042.c
index f919bf57293c..582245c497eb 100644
--- a/drivers/input/serio/i8042.c
+++ b/drivers/input/serio/i8042.c
@@ -934,10 +934,11 @@ static bool i8042_suspended;
934 934
935static int i8042_suspend(struct platform_device *dev, pm_message_t state) 935static int i8042_suspend(struct platform_device *dev, pm_message_t state)
936{ 936{
937 if (!i8042_suspended && state.event == PM_EVENT_SUSPEND) { 937 if (!i8042_suspended && state.event == PM_EVENT_SUSPEND)
938 i8042_controller_reset(); 938 i8042_controller_reset();
939 i8042_suspended = true; 939
940 } 940 i8042_suspended = state.event == PM_EVENT_SUSPEND ||
941 state.event == PM_EVENT_FREEZE;
941 942
942 return 0; 943 return 0;
943} 944}
diff --git a/drivers/input/serio/serio.c b/drivers/input/serio/serio.c
index fb17573f8f2d..d66f4944f2a0 100644
--- a/drivers/input/serio/serio.c
+++ b/drivers/input/serio/serio.c
@@ -935,10 +935,11 @@ static int serio_suspend(struct device *dev, pm_message_t state)
935{ 935{
936 struct serio *serio = to_serio_port(dev); 936 struct serio *serio = to_serio_port(dev);
937 937
938 if (!serio->suspended && state.event == PM_EVENT_SUSPEND) { 938 if (!serio->suspended && state.event == PM_EVENT_SUSPEND)
939 serio_cleanup(serio); 939 serio_cleanup(serio);
940 serio->suspended = true; 940
941 } 941 serio->suspended = state.event == PM_EVENT_SUSPEND ||
942 state.event == PM_EVENT_FREEZE;
942 943
943 return 0; 944 return 0;
944} 945}
diff --git a/drivers/input/tablet/wacom_wac.c b/drivers/input/tablet/wacom_wac.c
index 38bf86384aeb..c896d6a21b7e 100644
--- a/drivers/input/tablet/wacom_wac.c
+++ b/drivers/input/tablet/wacom_wac.c
@@ -384,6 +384,8 @@ static int wacom_intuos_inout(struct wacom_wac *wacom, void *wcombo)
384 wacom_report_key(wcombo, BTN_STYLUS2, 0); 384 wacom_report_key(wcombo, BTN_STYLUS2, 0);
385 wacom_report_key(wcombo, BTN_TOUCH, 0); 385 wacom_report_key(wcombo, BTN_TOUCH, 0);
386 wacom_report_abs(wcombo, ABS_WHEEL, 0); 386 wacom_report_abs(wcombo, ABS_WHEEL, 0);
387 if (wacom->features->type >= INTUOS3S)
388 wacom_report_abs(wcombo, ABS_Z, 0);
387 } 389 }
388 wacom_report_key(wcombo, wacom->tool[idx], 0); 390 wacom_report_key(wcombo, wacom->tool[idx], 0);
389 wacom_report_abs(wcombo, ABS_MISC, 0); /* reset tool id */ 391 wacom_report_abs(wcombo, ABS_MISC, 0); /* reset tool id */
@@ -836,6 +838,7 @@ static struct wacom_features wacom_features[] = {
836 { "Wacom DTU710", 8, 34080, 27660, 511, 0, PL }, 838 { "Wacom DTU710", 8, 34080, 27660, 511, 0, PL },
837 { "Wacom DTF521", 8, 6282, 4762, 511, 0, PL }, 839 { "Wacom DTF521", 8, 6282, 4762, 511, 0, PL },
838 { "Wacom DTF720", 8, 6858, 5506, 511, 0, PL }, 840 { "Wacom DTF720", 8, 6858, 5506, 511, 0, PL },
841 { "Wacom DTF720a", 8, 6858, 5506, 511, 0, PL },
839 { "Wacom Cintiq Partner",8, 20480, 15360, 511, 0, PTU }, 842 { "Wacom Cintiq Partner",8, 20480, 15360, 511, 0, PTU },
840 { "Wacom Intuos2 4x5", 10, 12700, 10600, 1023, 31, INTUOS }, 843 { "Wacom Intuos2 4x5", 10, 12700, 10600, 1023, 31, INTUOS },
841 { "Wacom Intuos2 6x8", 10, 20320, 16240, 1023, 31, INTUOS }, 844 { "Wacom Intuos2 6x8", 10, 20320, 16240, 1023, 31, INTUOS },
@@ -897,8 +900,9 @@ static struct usb_device_id wacom_ids[] = {
897 { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x37) }, 900 { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x37) },
898 { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x38) }, 901 { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x38) },
899 { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x39) }, 902 { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x39) },
900 { USB_DEVICE(USB_VENDOR_ID_WACOM, 0xC0) },
901 { USB_DEVICE(USB_VENDOR_ID_WACOM, 0xC4) }, 903 { USB_DEVICE(USB_VENDOR_ID_WACOM, 0xC4) },
904 { USB_DEVICE(USB_VENDOR_ID_WACOM, 0xC0) },
905 { USB_DEVICE(USB_VENDOR_ID_WACOM, 0xC2) },
902 { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x03) }, 906 { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x03) },
903 { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x41) }, 907 { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x41) },
904 { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x42) }, 908 { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x42) },
diff --git a/drivers/isdn/gigaset/interface.c b/drivers/isdn/gigaset/interface.c
index 1ebfcab74662..8ff7e35c7069 100644
--- a/drivers/isdn/gigaset/interface.c
+++ b/drivers/isdn/gigaset/interface.c
@@ -408,6 +408,8 @@ static int if_write_room(struct tty_struct *tty)
408 return retval; 408 return retval;
409} 409}
410 410
411/* FIXME: This function does not have error returns */
412
411static int if_chars_in_buffer(struct tty_struct *tty) 413static int if_chars_in_buffer(struct tty_struct *tty)
412{ 414{
413 struct cardstate *cs; 415 struct cardstate *cs;
diff --git a/drivers/isdn/hisax/hfc_usb.c b/drivers/isdn/hisax/hfc_usb.c
index 8df889b0c1a9..9de54202c90c 100644
--- a/drivers/isdn/hisax/hfc_usb.c
+++ b/drivers/isdn/hisax/hfc_usb.c
@@ -37,7 +37,6 @@
37#include <linux/kernel_stat.h> 37#include <linux/kernel_stat.h>
38#include <linux/usb.h> 38#include <linux/usb.h>
39#include <linux/kernel.h> 39#include <linux/kernel.h>
40#include <linux/smp_lock.h>
41#include <linux/sched.h> 40#include <linux/sched.h>
42#include <linux/moduleparam.h> 41#include <linux/moduleparam.h>
43#include "hisax.h" 42#include "hisax.h"
diff --git a/drivers/isdn/i4l/isdn_tty.c b/drivers/isdn/i4l/isdn_tty.c
index b4d4522e5071..2881a66c1aa9 100644
--- a/drivers/isdn/i4l/isdn_tty.c
+++ b/drivers/isdn/i4l/isdn_tty.c
@@ -13,6 +13,7 @@
13 13
14#include <linux/isdn.h> 14#include <linux/isdn.h>
15#include <linux/delay.h> 15#include <linux/delay.h>
16#include <linux/smp_lock.h>
16#include "isdn_common.h" 17#include "isdn_common.h"
17#include "isdn_tty.h" 18#include "isdn_tty.h"
18#ifdef CONFIG_ISDN_AUDIO 19#ifdef CONFIG_ISDN_AUDIO
diff --git a/drivers/isdn/mISDN/stack.c b/drivers/isdn/mISDN/stack.c
index e2f45019ebf0..3e1532a180ff 100644
--- a/drivers/isdn/mISDN/stack.c
+++ b/drivers/isdn/mISDN/stack.c
@@ -17,6 +17,7 @@
17 17
18#include <linux/mISDNif.h> 18#include <linux/mISDNif.h>
19#include <linux/kthread.h> 19#include <linux/kthread.h>
20#include <linux/smp_lock.h>
20#include "core.h" 21#include "core.h"
21 22
22static u_int *debug; 23static u_int *debug;
diff --git a/drivers/leds/Kconfig b/drivers/leds/Kconfig
index 9b60b6b684d9..7c8e7122aaa9 100644
--- a/drivers/leds/Kconfig
+++ b/drivers/leds/Kconfig
@@ -75,6 +75,7 @@ config LEDS_ALIX2
75 depends on LEDS_CLASS && X86 && EXPERIMENTAL 75 depends on LEDS_CLASS && X86 && EXPERIMENTAL
76 help 76 help
77 This option enables support for the PCEngines ALIX.2 and ALIX.3 LEDs. 77 This option enables support for the PCEngines ALIX.2 and ALIX.3 LEDs.
78 You have to set leds-alix2.force=1 for boards with Award BIOS.
78 79
79config LEDS_H1940 80config LEDS_H1940
80 tristate "LED Support for iPAQ H1940 device" 81 tristate "LED Support for iPAQ H1940 device"
@@ -145,15 +146,16 @@ config LEDS_GPIO_OF
145 of_platform devices. For instance, LEDs which are listed in a "dts" 146 of_platform devices. For instance, LEDs which are listed in a "dts"
146 file. 147 file.
147 148
148config LEDS_LP5521 149config LEDS_LP3944
149 tristate "LED Support for the LP5521 LEDs" 150 tristate "LED Support for N.S. LP3944 (Fun Light) I2C chip"
150 depends on LEDS_CLASS && I2C 151 depends on LEDS_CLASS && I2C
151 help 152 help
152 If you say 'Y' here you get support for the National Semiconductor 153 This option enables support for LEDs connected to the National
153 LP5521 LED driver used in n8x0 boards. 154 Semiconductor LP3944 Lighting Management Unit (LMU) also known as
155 Fun Light Chip.
154 156
155 This driver can be built as a module by choosing 'M'. The module 157 To compile this driver as a module, choose M here: the
156 will be called leds-lp5521. 158 module will be called leds-lp3944.
157 159
158config LEDS_CLEVO_MAIL 160config LEDS_CLEVO_MAIL
159 tristate "Mail LED on Clevo notebook" 161 tristate "Mail LED on Clevo notebook"
diff --git a/drivers/leds/Makefile b/drivers/leds/Makefile
index 2d41c4dcf92f..e8cdcf77a4c3 100644
--- a/drivers/leds/Makefile
+++ b/drivers/leds/Makefile
@@ -20,6 +20,7 @@ obj-$(CONFIG_LEDS_COBALT_RAQ) += leds-cobalt-raq.o
20obj-$(CONFIG_LEDS_SUNFIRE) += leds-sunfire.o 20obj-$(CONFIG_LEDS_SUNFIRE) += leds-sunfire.o
21obj-$(CONFIG_LEDS_PCA9532) += leds-pca9532.o 21obj-$(CONFIG_LEDS_PCA9532) += leds-pca9532.o
22obj-$(CONFIG_LEDS_GPIO) += leds-gpio.o 22obj-$(CONFIG_LEDS_GPIO) += leds-gpio.o
23obj-$(CONFIG_LEDS_LP3944) += leds-lp3944.o
23obj-$(CONFIG_LEDS_CLEVO_MAIL) += leds-clevo-mail.o 24obj-$(CONFIG_LEDS_CLEVO_MAIL) += leds-clevo-mail.o
24obj-$(CONFIG_LEDS_HP6XX) += leds-hp6xx.o 25obj-$(CONFIG_LEDS_HP6XX) += leds-hp6xx.o
25obj-$(CONFIG_LEDS_FSG) += leds-fsg.o 26obj-$(CONFIG_LEDS_FSG) += leds-fsg.o
diff --git a/drivers/leds/leds-alix2.c b/drivers/leds/leds-alix2.c
index ddbd7730dfc8..731d4eef3425 100644
--- a/drivers/leds/leds-alix2.c
+++ b/drivers/leds/leds-alix2.c
@@ -14,7 +14,7 @@
14 14
15static int force = 0; 15static int force = 0;
16module_param(force, bool, 0444); 16module_param(force, bool, 0444);
17MODULE_PARM_DESC(force, "Assume system has ALIX.2 style LEDs"); 17MODULE_PARM_DESC(force, "Assume system has ALIX.2/ALIX.3 style LEDs");
18 18
19struct alix_led { 19struct alix_led {
20 struct led_classdev cdev; 20 struct led_classdev cdev;
@@ -155,6 +155,11 @@ static int __init alix_led_init(void)
155 goto out; 155 goto out;
156 } 156 }
157 157
158 /* enable output on GPIO for LED 1,2,3 */
159 outl(1 << 6, 0x6104);
160 outl(1 << 9, 0x6184);
161 outl(1 << 11, 0x6184);
162
158 pdev = platform_device_register_simple(KBUILD_MODNAME, -1, NULL, 0); 163 pdev = platform_device_register_simple(KBUILD_MODNAME, -1, NULL, 0);
159 if (!IS_ERR(pdev)) { 164 if (!IS_ERR(pdev)) {
160 ret = platform_driver_probe(&alix_led_driver, alix_led_probe); 165 ret = platform_driver_probe(&alix_led_driver, alix_led_probe);
diff --git a/drivers/leds/leds-bd2802.c b/drivers/leds/leds-bd2802.c
index 4149ecb3a9b2..779d7f262c04 100644
--- a/drivers/leds/leds-bd2802.c
+++ b/drivers/leds/leds-bd2802.c
@@ -97,6 +97,10 @@ struct bd2802_led {
97 enum led_ids led_id; 97 enum led_ids led_id;
98 enum led_colors color; 98 enum led_colors color;
99 enum led_bits state; 99 enum led_bits state;
100
101 /* General attributes of RGB LEDs */
102 int wave_pattern;
103 int rgb_current;
100}; 104};
101 105
102 106
@@ -254,7 +258,7 @@ static void bd2802_set_on(struct bd2802_led *led, enum led_ids id,
254 bd2802_reset_cancel(led); 258 bd2802_reset_cancel(led);
255 259
256 reg = bd2802_get_reg_addr(id, color, BD2802_REG_CURRENT1SETUP); 260 reg = bd2802_get_reg_addr(id, color, BD2802_REG_CURRENT1SETUP);
257 bd2802_write_byte(led->client, reg, BD2802_CURRENT_032); 261 bd2802_write_byte(led->client, reg, led->rgb_current);
258 reg = bd2802_get_reg_addr(id, color, BD2802_REG_CURRENT2SETUP); 262 reg = bd2802_get_reg_addr(id, color, BD2802_REG_CURRENT2SETUP);
259 bd2802_write_byte(led->client, reg, BD2802_CURRENT_000); 263 bd2802_write_byte(led->client, reg, BD2802_CURRENT_000);
260 reg = bd2802_get_reg_addr(id, color, BD2802_REG_WAVEPATTERN); 264 reg = bd2802_get_reg_addr(id, color, BD2802_REG_WAVEPATTERN);
@@ -275,9 +279,9 @@ static void bd2802_set_blink(struct bd2802_led *led, enum led_ids id,
275 reg = bd2802_get_reg_addr(id, color, BD2802_REG_CURRENT1SETUP); 279 reg = bd2802_get_reg_addr(id, color, BD2802_REG_CURRENT1SETUP);
276 bd2802_write_byte(led->client, reg, BD2802_CURRENT_000); 280 bd2802_write_byte(led->client, reg, BD2802_CURRENT_000);
277 reg = bd2802_get_reg_addr(id, color, BD2802_REG_CURRENT2SETUP); 281 reg = bd2802_get_reg_addr(id, color, BD2802_REG_CURRENT2SETUP);
278 bd2802_write_byte(led->client, reg, BD2802_CURRENT_032); 282 bd2802_write_byte(led->client, reg, led->rgb_current);
279 reg = bd2802_get_reg_addr(id, color, BD2802_REG_WAVEPATTERN); 283 reg = bd2802_get_reg_addr(id, color, BD2802_REG_WAVEPATTERN);
280 bd2802_write_byte(led->client, reg, BD2802_PATTERN_HALF); 284 bd2802_write_byte(led->client, reg, led->wave_pattern);
281 285
282 bd2802_enable(led, id); 286 bd2802_enable(led, id);
283 bd2802_update_state(led, id, color, BD2802_BLINK); 287 bd2802_update_state(led, id, color, BD2802_BLINK);
@@ -406,7 +410,7 @@ static void bd2802_enable_adv_conf(struct bd2802_led *led)
406 ret = device_create_file(&led->client->dev, 410 ret = device_create_file(&led->client->dev,
407 bd2802_addr_attributes[i]); 411 bd2802_addr_attributes[i]);
408 if (ret) { 412 if (ret) {
409 dev_err(&led->client->dev, "failed to sysfs file %s\n", 413 dev_err(&led->client->dev, "failed: sysfs file %s\n",
410 bd2802_addr_attributes[i]->attr.name); 414 bd2802_addr_attributes[i]->attr.name);
411 goto failed_remove_files; 415 goto failed_remove_files;
412 } 416 }
@@ -483,6 +487,52 @@ static struct device_attribute bd2802_adv_conf_attr = {
483 .store = bd2802_store_adv_conf, 487 .store = bd2802_store_adv_conf,
484}; 488};
485 489
490#define BD2802_CONTROL_ATTR(attr_name, name_str) \
491static ssize_t bd2802_show_##attr_name(struct device *dev, \
492 struct device_attribute *attr, char *buf) \
493{ \
494 struct bd2802_led *led = i2c_get_clientdata(to_i2c_client(dev));\
495 ssize_t ret; \
496 down_read(&led->rwsem); \
497 ret = sprintf(buf, "0x%02x\n", led->attr_name); \
498 up_read(&led->rwsem); \
499 return ret; \
500} \
501static ssize_t bd2802_store_##attr_name(struct device *dev, \
502 struct device_attribute *attr, const char *buf, size_t count) \
503{ \
504 struct bd2802_led *led = i2c_get_clientdata(to_i2c_client(dev));\
505 unsigned long val; \
506 int ret; \
507 if (!count) \
508 return -EINVAL; \
509 ret = strict_strtoul(buf, 16, &val); \
510 if (ret) \
511 return ret; \
512 down_write(&led->rwsem); \
513 led->attr_name = val; \
514 up_write(&led->rwsem); \
515 return count; \
516} \
517static struct device_attribute bd2802_##attr_name##_attr = { \
518 .attr = { \
519 .name = name_str, \
520 .mode = 0644, \
521 .owner = THIS_MODULE \
522 }, \
523 .show = bd2802_show_##attr_name, \
524 .store = bd2802_store_##attr_name, \
525};
526
527BD2802_CONTROL_ATTR(wave_pattern, "wave_pattern");
528BD2802_CONTROL_ATTR(rgb_current, "rgb_current");
529
530static struct device_attribute *bd2802_attributes[] = {
531 &bd2802_adv_conf_attr,
532 &bd2802_wave_pattern_attr,
533 &bd2802_rgb_current_attr,
534};
535
486static void bd2802_led_work(struct work_struct *work) 536static void bd2802_led_work(struct work_struct *work)
487{ 537{
488 struct bd2802_led *led = container_of(work, struct bd2802_led, work); 538 struct bd2802_led *led = container_of(work, struct bd2802_led, work);
@@ -538,7 +588,6 @@ static int bd2802_register_led_classdev(struct bd2802_led *led)
538 led->cdev_led1r.brightness = LED_OFF; 588 led->cdev_led1r.brightness = LED_OFF;
539 led->cdev_led1r.brightness_set = bd2802_set_led1r_brightness; 589 led->cdev_led1r.brightness_set = bd2802_set_led1r_brightness;
540 led->cdev_led1r.blink_set = bd2802_set_led1r_blink; 590 led->cdev_led1r.blink_set = bd2802_set_led1r_blink;
541 led->cdev_led1r.flags |= LED_CORE_SUSPENDRESUME;
542 591
543 ret = led_classdev_register(&led->client->dev, &led->cdev_led1r); 592 ret = led_classdev_register(&led->client->dev, &led->cdev_led1r);
544 if (ret < 0) { 593 if (ret < 0) {
@@ -551,7 +600,6 @@ static int bd2802_register_led_classdev(struct bd2802_led *led)
551 led->cdev_led1g.brightness = LED_OFF; 600 led->cdev_led1g.brightness = LED_OFF;
552 led->cdev_led1g.brightness_set = bd2802_set_led1g_brightness; 601 led->cdev_led1g.brightness_set = bd2802_set_led1g_brightness;
553 led->cdev_led1g.blink_set = bd2802_set_led1g_blink; 602 led->cdev_led1g.blink_set = bd2802_set_led1g_blink;
554 led->cdev_led1g.flags |= LED_CORE_SUSPENDRESUME;
555 603
556 ret = led_classdev_register(&led->client->dev, &led->cdev_led1g); 604 ret = led_classdev_register(&led->client->dev, &led->cdev_led1g);
557 if (ret < 0) { 605 if (ret < 0) {
@@ -564,7 +612,6 @@ static int bd2802_register_led_classdev(struct bd2802_led *led)
564 led->cdev_led1b.brightness = LED_OFF; 612 led->cdev_led1b.brightness = LED_OFF;
565 led->cdev_led1b.brightness_set = bd2802_set_led1b_brightness; 613 led->cdev_led1b.brightness_set = bd2802_set_led1b_brightness;
566 led->cdev_led1b.blink_set = bd2802_set_led1b_blink; 614 led->cdev_led1b.blink_set = bd2802_set_led1b_blink;
567 led->cdev_led1b.flags |= LED_CORE_SUSPENDRESUME;
568 615
569 ret = led_classdev_register(&led->client->dev, &led->cdev_led1b); 616 ret = led_classdev_register(&led->client->dev, &led->cdev_led1b);
570 if (ret < 0) { 617 if (ret < 0) {
@@ -577,7 +624,6 @@ static int bd2802_register_led_classdev(struct bd2802_led *led)
577 led->cdev_led2r.brightness = LED_OFF; 624 led->cdev_led2r.brightness = LED_OFF;
578 led->cdev_led2r.brightness_set = bd2802_set_led2r_brightness; 625 led->cdev_led2r.brightness_set = bd2802_set_led2r_brightness;
579 led->cdev_led2r.blink_set = bd2802_set_led2r_blink; 626 led->cdev_led2r.blink_set = bd2802_set_led2r_blink;
580 led->cdev_led2r.flags |= LED_CORE_SUSPENDRESUME;
581 627
582 ret = led_classdev_register(&led->client->dev, &led->cdev_led2r); 628 ret = led_classdev_register(&led->client->dev, &led->cdev_led2r);
583 if (ret < 0) { 629 if (ret < 0) {
@@ -590,7 +636,6 @@ static int bd2802_register_led_classdev(struct bd2802_led *led)
590 led->cdev_led2g.brightness = LED_OFF; 636 led->cdev_led2g.brightness = LED_OFF;
591 led->cdev_led2g.brightness_set = bd2802_set_led2g_brightness; 637 led->cdev_led2g.brightness_set = bd2802_set_led2g_brightness;
592 led->cdev_led2g.blink_set = bd2802_set_led2g_blink; 638 led->cdev_led2g.blink_set = bd2802_set_led2g_blink;
593 led->cdev_led2g.flags |= LED_CORE_SUSPENDRESUME;
594 639
595 ret = led_classdev_register(&led->client->dev, &led->cdev_led2g); 640 ret = led_classdev_register(&led->client->dev, &led->cdev_led2g);
596 if (ret < 0) { 641 if (ret < 0) {
@@ -640,7 +685,7 @@ static int __devinit bd2802_probe(struct i2c_client *client,
640{ 685{
641 struct bd2802_led *led; 686 struct bd2802_led *led;
642 struct bd2802_led_platform_data *pdata; 687 struct bd2802_led_platform_data *pdata;
643 int ret; 688 int ret, i;
644 689
645 led = kzalloc(sizeof(struct bd2802_led), GFP_KERNEL); 690 led = kzalloc(sizeof(struct bd2802_led), GFP_KERNEL);
646 if (!led) { 691 if (!led) {
@@ -670,13 +715,20 @@ static int __devinit bd2802_probe(struct i2c_client *client,
670 /* To save the power, reset BD2802 after detecting */ 715 /* To save the power, reset BD2802 after detecting */
671 gpio_set_value(led->pdata->reset_gpio, 0); 716 gpio_set_value(led->pdata->reset_gpio, 0);
672 717
718 /* Default attributes */
719 led->wave_pattern = BD2802_PATTERN_HALF;
720 led->rgb_current = BD2802_CURRENT_032;
721
673 init_rwsem(&led->rwsem); 722 init_rwsem(&led->rwsem);
674 723
675 ret = device_create_file(&client->dev, &bd2802_adv_conf_attr); 724 for (i = 0; i < ARRAY_SIZE(bd2802_attributes); i++) {
676 if (ret) { 725 ret = device_create_file(&led->client->dev,
677 dev_err(&client->dev, "failed to create sysfs file %s\n", 726 bd2802_attributes[i]);
678 bd2802_adv_conf_attr.attr.name); 727 if (ret) {
679 goto failed_free; 728 dev_err(&led->client->dev, "failed: sysfs file %s\n",
729 bd2802_attributes[i]->attr.name);
730 goto failed_unregister_dev_file;
731 }
680 } 732 }
681 733
682 ret = bd2802_register_led_classdev(led); 734 ret = bd2802_register_led_classdev(led);
@@ -686,7 +738,8 @@ static int __devinit bd2802_probe(struct i2c_client *client,
686 return 0; 738 return 0;
687 739
688failed_unregister_dev_file: 740failed_unregister_dev_file:
689 device_remove_file(&client->dev, &bd2802_adv_conf_attr); 741 for (i--; i >= 0; i--)
742 device_remove_file(&led->client->dev, bd2802_attributes[i]);
690failed_free: 743failed_free:
691 i2c_set_clientdata(client, NULL); 744 i2c_set_clientdata(client, NULL);
692 kfree(led); 745 kfree(led);
@@ -697,12 +750,14 @@ failed_free:
697static int __exit bd2802_remove(struct i2c_client *client) 750static int __exit bd2802_remove(struct i2c_client *client)
698{ 751{
699 struct bd2802_led *led = i2c_get_clientdata(client); 752 struct bd2802_led *led = i2c_get_clientdata(client);
753 int i;
700 754
701 bd2802_unregister_led_classdev(led);
702 gpio_set_value(led->pdata->reset_gpio, 0); 755 gpio_set_value(led->pdata->reset_gpio, 0);
756 bd2802_unregister_led_classdev(led);
703 if (led->adf_on) 757 if (led->adf_on)
704 bd2802_disable_adv_conf(led); 758 bd2802_disable_adv_conf(led);
705 device_remove_file(&client->dev, &bd2802_adv_conf_attr); 759 for (i = 0; i < ARRAY_SIZE(bd2802_attributes); i++)
760 device_remove_file(&led->client->dev, bd2802_attributes[i]);
706 i2c_set_clientdata(client, NULL); 761 i2c_set_clientdata(client, NULL);
707 kfree(led); 762 kfree(led);
708 763
@@ -723,8 +778,7 @@ static int bd2802_resume(struct i2c_client *client)
723 struct bd2802_led *led = i2c_get_clientdata(client); 778 struct bd2802_led *led = i2c_get_clientdata(client);
724 779
725 if (!bd2802_is_all_off(led) || led->adf_on) { 780 if (!bd2802_is_all_off(led) || led->adf_on) {
726 gpio_set_value(led->pdata->reset_gpio, 1); 781 bd2802_reset_cancel(led);
727 udelay(100);
728 bd2802_restore_state(led); 782 bd2802_restore_state(led);
729 } 783 }
730 784
@@ -762,4 +816,4 @@ module_exit(bd2802_exit);
762 816
763MODULE_AUTHOR("Kim Kyuwon <q1.kim@samsung.com>"); 817MODULE_AUTHOR("Kim Kyuwon <q1.kim@samsung.com>");
764MODULE_DESCRIPTION("BD2802 LED driver"); 818MODULE_DESCRIPTION("BD2802 LED driver");
765MODULE_LICENSE("GPL"); 819MODULE_LICENSE("GPL v2");
diff --git a/drivers/leds/leds-cobalt-raq.c b/drivers/leds/leds-cobalt-raq.c
index ff0e8c3fbf9b..5f1ce810815f 100644
--- a/drivers/leds/leds-cobalt-raq.c
+++ b/drivers/leds/leds-cobalt-raq.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * LEDs driver for the Cobalt Raq series. 2 * LEDs driver for the Cobalt Raq series.
3 * 3 *
4 * Copyright (C) 2007 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> 4 * Copyright (C) 2007 Yoichi Yuasa <yuasa@linux-mips.org>
5 * 5 *
6 * This program is free software; you can redistribute it and/or modify 6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by 7 * it under the terms of the GNU General Public License as published by
diff --git a/drivers/leds/leds-gpio.c b/drivers/leds/leds-gpio.c
index d2109054de85..6b06638eb5b4 100644
--- a/drivers/leds/leds-gpio.c
+++ b/drivers/leds/leds-gpio.c
@@ -76,7 +76,7 @@ static int __devinit create_gpio_led(const struct gpio_led *template,
76 struct gpio_led_data *led_dat, struct device *parent, 76 struct gpio_led_data *led_dat, struct device *parent,
77 int (*blink_set)(unsigned, unsigned long *, unsigned long *)) 77 int (*blink_set)(unsigned, unsigned long *, unsigned long *))
78{ 78{
79 int ret; 79 int ret, state;
80 80
81 /* skip leds that aren't available */ 81 /* skip leds that aren't available */
82 if (!gpio_is_valid(template->gpio)) { 82 if (!gpio_is_valid(template->gpio)) {
@@ -99,11 +99,15 @@ static int __devinit create_gpio_led(const struct gpio_led *template,
99 led_dat->cdev.blink_set = gpio_blink_set; 99 led_dat->cdev.blink_set = gpio_blink_set;
100 } 100 }
101 led_dat->cdev.brightness_set = gpio_led_set; 101 led_dat->cdev.brightness_set = gpio_led_set;
102 led_dat->cdev.brightness = LED_OFF; 102 if (template->default_state == LEDS_GPIO_DEFSTATE_KEEP)
103 state = !!gpio_get_value(led_dat->gpio) ^ led_dat->active_low;
104 else
105 state = (template->default_state == LEDS_GPIO_DEFSTATE_ON);
106 led_dat->cdev.brightness = state ? LED_FULL : LED_OFF;
103 if (!template->retain_state_suspended) 107 if (!template->retain_state_suspended)
104 led_dat->cdev.flags |= LED_CORE_SUSPENDRESUME; 108 led_dat->cdev.flags |= LED_CORE_SUSPENDRESUME;
105 109
106 ret = gpio_direction_output(led_dat->gpio, led_dat->active_low); 110 ret = gpio_direction_output(led_dat->gpio, led_dat->active_low ^ state);
107 if (ret < 0) 111 if (ret < 0)
108 goto err; 112 goto err;
109 113
@@ -129,7 +133,7 @@ static void delete_gpio_led(struct gpio_led_data *led)
129} 133}
130 134
131#ifdef CONFIG_LEDS_GPIO_PLATFORM 135#ifdef CONFIG_LEDS_GPIO_PLATFORM
132static int gpio_led_probe(struct platform_device *pdev) 136static int __devinit gpio_led_probe(struct platform_device *pdev)
133{ 137{
134 struct gpio_led_platform_data *pdata = pdev->dev.platform_data; 138 struct gpio_led_platform_data *pdata = pdev->dev.platform_data;
135 struct gpio_led_data *leds_data; 139 struct gpio_led_data *leds_data;
@@ -223,12 +227,22 @@ static int __devinit of_gpio_leds_probe(struct of_device *ofdev,
223 memset(&led, 0, sizeof(led)); 227 memset(&led, 0, sizeof(led));
224 for_each_child_of_node(np, child) { 228 for_each_child_of_node(np, child) {
225 enum of_gpio_flags flags; 229 enum of_gpio_flags flags;
230 const char *state;
226 231
227 led.gpio = of_get_gpio_flags(child, 0, &flags); 232 led.gpio = of_get_gpio_flags(child, 0, &flags);
228 led.active_low = flags & OF_GPIO_ACTIVE_LOW; 233 led.active_low = flags & OF_GPIO_ACTIVE_LOW;
229 led.name = of_get_property(child, "label", NULL) ? : child->name; 234 led.name = of_get_property(child, "label", NULL) ? : child->name;
230 led.default_trigger = 235 led.default_trigger =
231 of_get_property(child, "linux,default-trigger", NULL); 236 of_get_property(child, "linux,default-trigger", NULL);
237 state = of_get_property(child, "default-state", NULL);
238 if (state) {
239 if (!strcmp(state, "keep"))
240 led.default_state = LEDS_GPIO_DEFSTATE_KEEP;
241 else if(!strcmp(state, "on"))
242 led.default_state = LEDS_GPIO_DEFSTATE_ON;
243 else
244 led.default_state = LEDS_GPIO_DEFSTATE_OFF;
245 }
232 246
233 ret = create_gpio_led(&led, &pdata->led_data[pdata->num_leds++], 247 ret = create_gpio_led(&led, &pdata->led_data[pdata->num_leds++],
234 &ofdev->dev, NULL); 248 &ofdev->dev, NULL);
diff --git a/drivers/leds/leds-lp3944.c b/drivers/leds/leds-lp3944.c
new file mode 100644
index 000000000000..5946208ba26e
--- /dev/null
+++ b/drivers/leds/leds-lp3944.c
@@ -0,0 +1,466 @@
1/*
2 * leds-lp3944.c - driver for National Semiconductor LP3944 Funlight Chip
3 *
4 * Copyright (C) 2009 Antonio Ospite <ospite@studenti.unina.it>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 *
10 */
11
12/*
13 * I2C driver for National Semiconductor LP3944 Funlight Chip
14 * http://www.national.com/pf/LP/LP3944.html
15 *
16 * This helper chip can drive up to 8 leds, with two programmable DIM modes;
17 * it could even be used as a gpio expander but this driver assumes it is used
18 * as a led controller.
19 *
20 * The DIM modes are used to set _blink_ patterns for leds, the pattern is
21 * specified supplying two parameters:
22 * - period: from 0s to 1.6s
23 * - duty cycle: percentage of the period the led is on, from 0 to 100
24 *
25 * LP3944 can be found on Motorola A910 smartphone, where it drives the rgb
26 * leds, the camera flash light and the displays backlights.
27 */
28
29#include <linux/module.h>
30#include <linux/i2c.h>
31#include <linux/leds.h>
32#include <linux/mutex.h>
33#include <linux/workqueue.h>
34#include <linux/leds-lp3944.h>
35
36/* Read Only Registers */
37#define LP3944_REG_INPUT1 0x00 /* LEDs 0-7 InputRegister (Read Only) */
38#define LP3944_REG_REGISTER1 0x01 /* None (Read Only) */
39
40#define LP3944_REG_PSC0 0x02 /* Frequency Prescaler 0 (R/W) */
41#define LP3944_REG_PWM0 0x03 /* PWM Register 0 (R/W) */
42#define LP3944_REG_PSC1 0x04 /* Frequency Prescaler 1 (R/W) */
43#define LP3944_REG_PWM1 0x05 /* PWM Register 1 (R/W) */
44#define LP3944_REG_LS0 0x06 /* LEDs 0-3 Selector (R/W) */
45#define LP3944_REG_LS1 0x07 /* LEDs 4-7 Selector (R/W) */
46
47/* These registers are not used to control leds in LP3944, they can store
48 * arbitrary values which the chip will ignore.
49 */
50#define LP3944_REG_REGISTER8 0x08
51#define LP3944_REG_REGISTER9 0x09
52
53#define LP3944_DIM0 0
54#define LP3944_DIM1 1
55
56/* period in ms */
57#define LP3944_PERIOD_MIN 0
58#define LP3944_PERIOD_MAX 1600
59
60/* duty cycle is a percentage */
61#define LP3944_DUTY_CYCLE_MIN 0
62#define LP3944_DUTY_CYCLE_MAX 100
63
64#define ldev_to_led(c) container_of(c, struct lp3944_led_data, ldev)
65
66/* Saved data */
67struct lp3944_led_data {
68 u8 id;
69 enum lp3944_type type;
70 enum lp3944_status status;
71 struct led_classdev ldev;
72 struct i2c_client *client;
73 struct work_struct work;
74};
75
76struct lp3944_data {
77 struct mutex lock;
78 struct i2c_client *client;
79 struct lp3944_led_data leds[LP3944_LEDS_MAX];
80};
81
82static int lp3944_reg_read(struct i2c_client *client, u8 reg, u8 *value)
83{
84 int tmp;
85
86 tmp = i2c_smbus_read_byte_data(client, reg);
87 if (tmp < 0)
88 return -EINVAL;
89
90 *value = tmp;
91
92 return 0;
93}
94
95static int lp3944_reg_write(struct i2c_client *client, u8 reg, u8 value)
96{
97 return i2c_smbus_write_byte_data(client, reg, value);
98}
99
100/**
101 * Set the period for DIM status
102 *
103 * @client: the i2c client
104 * @dim: either LP3944_DIM0 or LP3944_DIM1
105 * @period: period of a blink, that is a on/off cycle, expressed in ms.
106 */
107static int lp3944_dim_set_period(struct i2c_client *client, u8 dim, u16 period)
108{
109 u8 psc_reg;
110 u8 psc_value;
111 int err;
112
113 if (dim == LP3944_DIM0)
114 psc_reg = LP3944_REG_PSC0;
115 else if (dim == LP3944_DIM1)
116 psc_reg = LP3944_REG_PSC1;
117 else
118 return -EINVAL;
119
120 /* Convert period to Prescaler value */
121 if (period > LP3944_PERIOD_MAX)
122 return -EINVAL;
123
124 psc_value = (period * 255) / LP3944_PERIOD_MAX;
125
126 err = lp3944_reg_write(client, psc_reg, psc_value);
127
128 return err;
129}
130
131/**
132 * Set the duty cycle for DIM status
133 *
134 * @client: the i2c client
135 * @dim: either LP3944_DIM0 or LP3944_DIM1
136 * @duty_cycle: percentage of a period during which a led is ON
137 */
138static int lp3944_dim_set_dutycycle(struct i2c_client *client, u8 dim,
139 u8 duty_cycle)
140{
141 u8 pwm_reg;
142 u8 pwm_value;
143 int err;
144
145 if (dim == LP3944_DIM0)
146 pwm_reg = LP3944_REG_PWM0;
147 else if (dim == LP3944_DIM1)
148 pwm_reg = LP3944_REG_PWM1;
149 else
150 return -EINVAL;
151
152 /* Convert duty cycle to PWM value */
153 if (duty_cycle > LP3944_DUTY_CYCLE_MAX)
154 return -EINVAL;
155
156 pwm_value = (duty_cycle * 255) / LP3944_DUTY_CYCLE_MAX;
157
158 err = lp3944_reg_write(client, pwm_reg, pwm_value);
159
160 return err;
161}
162
163/**
164 * Set the led status
165 *
166 * @led: a lp3944_led_data structure
167 * @status: one of LP3944_LED_STATUS_OFF
168 * LP3944_LED_STATUS_ON
169 * LP3944_LED_STATUS_DIM0
170 * LP3944_LED_STATUS_DIM1
171 */
172static int lp3944_led_set(struct lp3944_led_data *led, u8 status)
173{
174 struct lp3944_data *data = i2c_get_clientdata(led->client);
175 u8 id = led->id;
176 u8 reg;
177 u8 val = 0;
178 int err;
179
180 dev_dbg(&led->client->dev, "%s: %s, status before normalization:%d\n",
181 __func__, led->ldev.name, status);
182
183 switch (id) {
184 case LP3944_LED0:
185 case LP3944_LED1:
186 case LP3944_LED2:
187 case LP3944_LED3:
188 reg = LP3944_REG_LS0;
189 break;
190 case LP3944_LED4:
191 case LP3944_LED5:
192 case LP3944_LED6:
193 case LP3944_LED7:
194 id -= LP3944_LED4;
195 reg = LP3944_REG_LS1;
196 break;
197 default:
198 return -EINVAL;
199 }
200
201 if (status > LP3944_LED_STATUS_DIM1)
202 return -EINVAL;
203
204 /* invert only 0 and 1, leave unchanged the other values,
205 * remember we are abusing status to set blink patterns
206 */
207 if (led->type == LP3944_LED_TYPE_LED_INVERTED && status < 2)
208 status = 1 - status;
209
210 mutex_lock(&data->lock);
211 lp3944_reg_read(led->client, reg, &val);
212
213 val &= ~(LP3944_LED_STATUS_MASK << (id << 1));
214 val |= (status << (id << 1));
215
216 dev_dbg(&led->client->dev, "%s: %s, reg:%d id:%d status:%d val:%#x\n",
217 __func__, led->ldev.name, reg, id, status, val);
218
219 /* set led status */
220 err = lp3944_reg_write(led->client, reg, val);
221 mutex_unlock(&data->lock);
222
223 return err;
224}
225
226static int lp3944_led_set_blink(struct led_classdev *led_cdev,
227 unsigned long *delay_on,
228 unsigned long *delay_off)
229{
230 struct lp3944_led_data *led = ldev_to_led(led_cdev);
231 u16 period;
232 u8 duty_cycle;
233 int err;
234
235 /* units are in ms */
236 if (*delay_on + *delay_off > LP3944_PERIOD_MAX)
237 return -EINVAL;
238
239 if (*delay_on == 0 && *delay_off == 0) {
240 /* Special case: the leds subsystem requires a default user
241 * friendly blink pattern for the LED. Let's blink the led
242 * slowly (1Hz).
243 */
244 *delay_on = 500;
245 *delay_off = 500;
246 }
247
248 period = (*delay_on) + (*delay_off);
249
250 /* duty_cycle is the percentage of period during which the led is ON */
251 duty_cycle = 100 * (*delay_on) / period;
252
253 /* invert duty cycle for inverted leds, this has the same effect of
254 * swapping delay_on and delay_off
255 */
256 if (led->type == LP3944_LED_TYPE_LED_INVERTED)
257 duty_cycle = 100 - duty_cycle;
258
259 /* NOTE: using always the first DIM mode, this means that all leds
260 * will have the same blinking pattern.
261 *
262 * We could find a way later to have two leds blinking in hardware
263 * with different patterns at the same time, falling back to software
264 * control for the other ones.
265 */
266 err = lp3944_dim_set_period(led->client, LP3944_DIM0, period);
267 if (err)
268 return err;
269
270 err = lp3944_dim_set_dutycycle(led->client, LP3944_DIM0, duty_cycle);
271 if (err)
272 return err;
273
274 dev_dbg(&led->client->dev, "%s: OK hardware accelerated blink!\n",
275 __func__);
276
277 led->status = LP3944_LED_STATUS_DIM0;
278 schedule_work(&led->work);
279
280 return 0;
281}
282
283static void lp3944_led_set_brightness(struct led_classdev *led_cdev,
284 enum led_brightness brightness)
285{
286 struct lp3944_led_data *led = ldev_to_led(led_cdev);
287
288 dev_dbg(&led->client->dev, "%s: %s, %d\n",
289 __func__, led_cdev->name, brightness);
290
291 led->status = brightness;
292 schedule_work(&led->work);
293}
294
295static void lp3944_led_work(struct work_struct *work)
296{
297 struct lp3944_led_data *led;
298
299 led = container_of(work, struct lp3944_led_data, work);
300 lp3944_led_set(led, led->status);
301}
302
303static int lp3944_configure(struct i2c_client *client,
304 struct lp3944_data *data,
305 struct lp3944_platform_data *pdata)
306{
307 int i, err = 0;
308
309 for (i = 0; i < pdata->leds_size; i++) {
310 struct lp3944_led *pled = &pdata->leds[i];
311 struct lp3944_led_data *led = &data->leds[i];
312 led->client = client;
313 led->id = i;
314
315 switch (pled->type) {
316
317 case LP3944_LED_TYPE_LED:
318 case LP3944_LED_TYPE_LED_INVERTED:
319 led->type = pled->type;
320 led->status = pled->status;
321 led->ldev.name = pled->name;
322 led->ldev.max_brightness = 1;
323 led->ldev.brightness_set = lp3944_led_set_brightness;
324 led->ldev.blink_set = lp3944_led_set_blink;
325 led->ldev.flags = LED_CORE_SUSPENDRESUME;
326
327 INIT_WORK(&led->work, lp3944_led_work);
328 err = led_classdev_register(&client->dev, &led->ldev);
329 if (err < 0) {
330 dev_err(&client->dev,
331 "couldn't register LED %s\n",
332 led->ldev.name);
333 goto exit;
334 }
335
336 /* to expose the default value to userspace */
337 led->ldev.brightness = led->status;
338
339 /* Set the default led status */
340 err = lp3944_led_set(led, led->status);
341 if (err < 0) {
342 dev_err(&client->dev,
343 "%s couldn't set STATUS %d\n",
344 led->ldev.name, led->status);
345 goto exit;
346 }
347 break;
348
349 case LP3944_LED_TYPE_NONE:
350 default:
351 break;
352
353 }
354 }
355 return 0;
356
357exit:
358 if (i > 0)
359 for (i = i - 1; i >= 0; i--)
360 switch (pdata->leds[i].type) {
361
362 case LP3944_LED_TYPE_LED:
363 case LP3944_LED_TYPE_LED_INVERTED:
364 led_classdev_unregister(&data->leds[i].ldev);
365 cancel_work_sync(&data->leds[i].work);
366 break;
367
368 case LP3944_LED_TYPE_NONE:
369 default:
370 break;
371 }
372
373 return err;
374}
375
376static int __devinit lp3944_probe(struct i2c_client *client,
377 const struct i2c_device_id *id)
378{
379 struct lp3944_platform_data *lp3944_pdata = client->dev.platform_data;
380 struct lp3944_data *data;
381
382 if (lp3944_pdata == NULL) {
383 dev_err(&client->dev, "no platform data\n");
384 return -EINVAL;
385 }
386
387 /* Let's see whether this adapter can support what we need. */
388 if (!i2c_check_functionality(client->adapter,
389 I2C_FUNC_SMBUS_BYTE_DATA)) {
390 dev_err(&client->dev, "insufficient functionality!\n");
391 return -ENODEV;
392 }
393
394 data = kzalloc(sizeof(struct lp3944_data), GFP_KERNEL);
395 if (!data)
396 return -ENOMEM;
397
398 data->client = client;
399 i2c_set_clientdata(client, data);
400
401 mutex_init(&data->lock);
402
403 dev_info(&client->dev, "lp3944 enabled\n");
404
405 lp3944_configure(client, data, lp3944_pdata);
406 return 0;
407}
408
409static int __devexit lp3944_remove(struct i2c_client *client)
410{
411 struct lp3944_platform_data *pdata = client->dev.platform_data;
412 struct lp3944_data *data = i2c_get_clientdata(client);
413 int i;
414
415 for (i = 0; i < pdata->leds_size; i++)
416 switch (data->leds[i].type) {
417 case LP3944_LED_TYPE_LED:
418 case LP3944_LED_TYPE_LED_INVERTED:
419 led_classdev_unregister(&data->leds[i].ldev);
420 cancel_work_sync(&data->leds[i].work);
421 break;
422
423 case LP3944_LED_TYPE_NONE:
424 default:
425 break;
426 }
427
428 kfree(data);
429 i2c_set_clientdata(client, NULL);
430
431 return 0;
432}
433
434/* lp3944 i2c driver struct */
435static const struct i2c_device_id lp3944_id[] = {
436 {"lp3944", 0},
437 {}
438};
439
440MODULE_DEVICE_TABLE(i2c, lp3944_id);
441
442static struct i2c_driver lp3944_driver = {
443 .driver = {
444 .name = "lp3944",
445 },
446 .probe = lp3944_probe,
447 .remove = __devexit_p(lp3944_remove),
448 .id_table = lp3944_id,
449};
450
451static int __init lp3944_module_init(void)
452{
453 return i2c_add_driver(&lp3944_driver);
454}
455
456static void __exit lp3944_module_exit(void)
457{
458 i2c_del_driver(&lp3944_driver);
459}
460
461module_init(lp3944_module_init);
462module_exit(lp3944_module_exit);
463
464MODULE_AUTHOR("Antonio Ospite <ospite@studenti.unina.it>");
465MODULE_DESCRIPTION("LP3944 Fun Light Chip");
466MODULE_LICENSE("GPL");
diff --git a/drivers/leds/leds-pca9532.c b/drivers/leds/leds-pca9532.c
index 3937244fdcab..dba8921240f2 100644
--- a/drivers/leds/leds-pca9532.c
+++ b/drivers/leds/leds-pca9532.c
@@ -35,7 +35,7 @@ struct pca9532_data {
35 struct pca9532_led leds[16]; 35 struct pca9532_led leds[16];
36 struct mutex update_lock; 36 struct mutex update_lock;
37 struct input_dev *idev; 37 struct input_dev *idev;
38 struct work_struct work; 38 struct work_struct work;
39 u8 pwm[2]; 39 u8 pwm[2];
40 u8 psc[2]; 40 u8 psc[2];
41}; 41};
@@ -87,14 +87,14 @@ static int pca9532_calcpwm(struct i2c_client *client, int pwm, int blink,
87 if (b > 0xFF) 87 if (b > 0xFF)
88 return -EINVAL; 88 return -EINVAL;
89 data->pwm[pwm] = b; 89 data->pwm[pwm] = b;
90 data->psc[pwm] = blink; 90 data->psc[pwm] = blink;
91 return 0; 91 return 0;
92} 92}
93 93
94static int pca9532_setpwm(struct i2c_client *client, int pwm) 94static int pca9532_setpwm(struct i2c_client *client, int pwm)
95{ 95{
96 struct pca9532_data *data = i2c_get_clientdata(client); 96 struct pca9532_data *data = i2c_get_clientdata(client);
97 mutex_lock(&data->update_lock); 97 mutex_lock(&data->update_lock);
98 i2c_smbus_write_byte_data(client, PCA9532_REG_PWM(pwm), 98 i2c_smbus_write_byte_data(client, PCA9532_REG_PWM(pwm),
99 data->pwm[pwm]); 99 data->pwm[pwm]);
100 i2c_smbus_write_byte_data(client, PCA9532_REG_PSC(pwm), 100 i2c_smbus_write_byte_data(client, PCA9532_REG_PSC(pwm),
@@ -132,11 +132,11 @@ static void pca9532_set_brightness(struct led_classdev *led_cdev,
132 led->state = PCA9532_ON; 132 led->state = PCA9532_ON;
133 else { 133 else {
134 led->state = PCA9532_PWM0; /* Thecus: hardcode one pwm */ 134 led->state = PCA9532_PWM0; /* Thecus: hardcode one pwm */
135 err = pca9532_calcpwm(led->client, 0, 0, value); 135 err = pca9532_calcpwm(led->client, 0, 0, value);
136 if (err) 136 if (err)
137 return; /* XXX: led api doesn't allow error code? */ 137 return; /* XXX: led api doesn't allow error code? */
138 } 138 }
139 schedule_work(&led->work); 139 schedule_work(&led->work);
140} 140}
141 141
142static int pca9532_set_blink(struct led_classdev *led_cdev, 142static int pca9532_set_blink(struct led_classdev *led_cdev,
@@ -145,7 +145,7 @@ static int pca9532_set_blink(struct led_classdev *led_cdev,
145 struct pca9532_led *led = ldev_to_led(led_cdev); 145 struct pca9532_led *led = ldev_to_led(led_cdev);
146 struct i2c_client *client = led->client; 146 struct i2c_client *client = led->client;
147 int psc; 147 int psc;
148 int err = 0; 148 int err = 0;
149 149
150 if (*delay_on == 0 && *delay_off == 0) { 150 if (*delay_on == 0 && *delay_off == 0) {
151 /* led subsystem ask us for a blink rate */ 151 /* led subsystem ask us for a blink rate */
@@ -157,11 +157,11 @@ static int pca9532_set_blink(struct led_classdev *led_cdev,
157 157
158 /* Thecus specific: only use PSC/PWM 0 */ 158 /* Thecus specific: only use PSC/PWM 0 */
159 psc = (*delay_on * 152-1)/1000; 159 psc = (*delay_on * 152-1)/1000;
160 err = pca9532_calcpwm(client, 0, psc, led_cdev->brightness); 160 err = pca9532_calcpwm(client, 0, psc, led_cdev->brightness);
161 if (err) 161 if (err)
162 return err; 162 return err;
163 schedule_work(&led->work); 163 schedule_work(&led->work);
164 return 0; 164 return 0;
165} 165}
166 166
167static int pca9532_event(struct input_dev *dev, unsigned int type, 167static int pca9532_event(struct input_dev *dev, unsigned int type,
@@ -178,15 +178,15 @@ static int pca9532_event(struct input_dev *dev, unsigned int type,
178 else 178 else
179 data->pwm[1] = 0; 179 data->pwm[1] = 0;
180 180
181 schedule_work(&data->work); 181 schedule_work(&data->work);
182 182
183 return 0; 183 return 0;
184} 184}
185 185
186static void pca9532_input_work(struct work_struct *work) 186static void pca9532_input_work(struct work_struct *work)
187{ 187{
188 struct pca9532_data *data; 188 struct pca9532_data *data;
189 data = container_of(work, struct pca9532_data, work); 189 data = container_of(work, struct pca9532_data, work);
190 mutex_lock(&data->update_lock); 190 mutex_lock(&data->update_lock);
191 i2c_smbus_write_byte_data(data->client, PCA9532_REG_PWM(1), 191 i2c_smbus_write_byte_data(data->client, PCA9532_REG_PWM(1),
192 data->pwm[1]); 192 data->pwm[1]);
@@ -195,11 +195,11 @@ static void pca9532_input_work(struct work_struct *work)
195 195
196static void pca9532_led_work(struct work_struct *work) 196static void pca9532_led_work(struct work_struct *work)
197{ 197{
198 struct pca9532_led *led; 198 struct pca9532_led *led;
199 led = container_of(work, struct pca9532_led, work); 199 led = container_of(work, struct pca9532_led, work);
200 if (led->state == PCA9532_PWM0) 200 if (led->state == PCA9532_PWM0)
201 pca9532_setpwm(led->client, 0); 201 pca9532_setpwm(led->client, 0);
202 pca9532_setled(led); 202 pca9532_setled(led);
203} 203}
204 204
205static int pca9532_configure(struct i2c_client *client, 205static int pca9532_configure(struct i2c_client *client,
@@ -232,7 +232,7 @@ static int pca9532_configure(struct i2c_client *client,
232 led->ldev.brightness = LED_OFF; 232 led->ldev.brightness = LED_OFF;
233 led->ldev.brightness_set = pca9532_set_brightness; 233 led->ldev.brightness_set = pca9532_set_brightness;
234 led->ldev.blink_set = pca9532_set_blink; 234 led->ldev.blink_set = pca9532_set_blink;
235 INIT_WORK(&led->work, pca9532_led_work); 235 INIT_WORK(&led->work, pca9532_led_work);
236 err = led_classdev_register(&client->dev, &led->ldev); 236 err = led_classdev_register(&client->dev, &led->ldev);
237 if (err < 0) { 237 if (err < 0) {
238 dev_err(&client->dev, 238 dev_err(&client->dev,
@@ -262,11 +262,11 @@ static int pca9532_configure(struct i2c_client *client,
262 BIT_MASK(SND_TONE); 262 BIT_MASK(SND_TONE);
263 data->idev->event = pca9532_event; 263 data->idev->event = pca9532_event;
264 input_set_drvdata(data->idev, data); 264 input_set_drvdata(data->idev, data);
265 INIT_WORK(&data->work, pca9532_input_work); 265 INIT_WORK(&data->work, pca9532_input_work);
266 err = input_register_device(data->idev); 266 err = input_register_device(data->idev);
267 if (err) { 267 if (err) {
268 input_free_device(data->idev); 268 input_free_device(data->idev);
269 cancel_work_sync(&data->work); 269 cancel_work_sync(&data->work);
270 data->idev = NULL; 270 data->idev = NULL;
271 goto exit; 271 goto exit;
272 } 272 }
@@ -283,13 +283,13 @@ exit:
283 break; 283 break;
284 case PCA9532_TYPE_LED: 284 case PCA9532_TYPE_LED:
285 led_classdev_unregister(&data->leds[i].ldev); 285 led_classdev_unregister(&data->leds[i].ldev);
286 cancel_work_sync(&data->leds[i].work); 286 cancel_work_sync(&data->leds[i].work);
287 break; 287 break;
288 case PCA9532_TYPE_N2100_BEEP: 288 case PCA9532_TYPE_N2100_BEEP:
289 if (data->idev != NULL) { 289 if (data->idev != NULL) {
290 input_unregister_device(data->idev); 290 input_unregister_device(data->idev);
291 input_free_device(data->idev); 291 input_free_device(data->idev);
292 cancel_work_sync(&data->work); 292 cancel_work_sync(&data->work);
293 data->idev = NULL; 293 data->idev = NULL;
294 } 294 }
295 break; 295 break;
@@ -340,13 +340,13 @@ static int pca9532_remove(struct i2c_client *client)
340 break; 340 break;
341 case PCA9532_TYPE_LED: 341 case PCA9532_TYPE_LED:
342 led_classdev_unregister(&data->leds[i].ldev); 342 led_classdev_unregister(&data->leds[i].ldev);
343 cancel_work_sync(&data->leds[i].work); 343 cancel_work_sync(&data->leds[i].work);
344 break; 344 break;
345 case PCA9532_TYPE_N2100_BEEP: 345 case PCA9532_TYPE_N2100_BEEP:
346 if (data->idev != NULL) { 346 if (data->idev != NULL) {
347 input_unregister_device(data->idev); 347 input_unregister_device(data->idev);
348 input_free_device(data->idev); 348 input_free_device(data->idev);
349 cancel_work_sync(&data->work); 349 cancel_work_sync(&data->work);
350 data->idev = NULL; 350 data->idev = NULL;
351 } 351 }
352 break; 352 break;
diff --git a/drivers/lguest/core.c b/drivers/lguest/core.c
index a6974e9b8ebf..1e2cb846b3c9 100644
--- a/drivers/lguest/core.c
+++ b/drivers/lguest/core.c
@@ -1,6 +1,8 @@
1/*P:400 This contains run_guest() which actually calls into the Host<->Guest 1/*P:400
2 * This contains run_guest() which actually calls into the Host<->Guest
2 * Switcher and analyzes the return, such as determining if the Guest wants the 3 * Switcher and analyzes the return, such as determining if the Guest wants the
3 * Host to do something. This file also contains useful helper routines. :*/ 4 * Host to do something. This file also contains useful helper routines.
5:*/
4#include <linux/module.h> 6#include <linux/module.h>
5#include <linux/stringify.h> 7#include <linux/stringify.h>
6#include <linux/stddef.h> 8#include <linux/stddef.h>
@@ -24,7 +26,8 @@ static struct page **switcher_page;
24/* This One Big lock protects all inter-guest data structures. */ 26/* This One Big lock protects all inter-guest data structures. */
25DEFINE_MUTEX(lguest_lock); 27DEFINE_MUTEX(lguest_lock);
26 28
27/*H:010 We need to set up the Switcher at a high virtual address. Remember the 29/*H:010
30 * We need to set up the Switcher at a high virtual address. Remember the
28 * Switcher is a few hundred bytes of assembler code which actually changes the 31 * Switcher is a few hundred bytes of assembler code which actually changes the
29 * CPU to run the Guest, and then changes back to the Host when a trap or 32 * CPU to run the Guest, and then changes back to the Host when a trap or
30 * interrupt happens. 33 * interrupt happens.
@@ -33,7 +36,8 @@ DEFINE_MUTEX(lguest_lock);
33 * Host since it will be running as the switchover occurs. 36 * Host since it will be running as the switchover occurs.
34 * 37 *
35 * Trying to map memory at a particular address is an unusual thing to do, so 38 * Trying to map memory at a particular address is an unusual thing to do, so
36 * it's not a simple one-liner. */ 39 * it's not a simple one-liner.
40 */
37static __init int map_switcher(void) 41static __init int map_switcher(void)
38{ 42{
39 int i, err; 43 int i, err;
@@ -47,8 +51,10 @@ static __init int map_switcher(void)
47 * easy. 51 * easy.
48 */ 52 */
49 53
50 /* We allocate an array of struct page pointers. map_vm_area() wants 54 /*
51 * this, rather than just an array of pages. */ 55 * We allocate an array of struct page pointers. map_vm_area() wants
56 * this, rather than just an array of pages.
57 */
52 switcher_page = kmalloc(sizeof(switcher_page[0])*TOTAL_SWITCHER_PAGES, 58 switcher_page = kmalloc(sizeof(switcher_page[0])*TOTAL_SWITCHER_PAGES,
53 GFP_KERNEL); 59 GFP_KERNEL);
54 if (!switcher_page) { 60 if (!switcher_page) {
@@ -56,8 +62,10 @@ static __init int map_switcher(void)
56 goto out; 62 goto out;
57 } 63 }
58 64
59 /* Now we actually allocate the pages. The Guest will see these pages, 65 /*
60 * so we make sure they're zeroed. */ 66 * Now we actually allocate the pages. The Guest will see these pages,
67 * so we make sure they're zeroed.
68 */
61 for (i = 0; i < TOTAL_SWITCHER_PAGES; i++) { 69 for (i = 0; i < TOTAL_SWITCHER_PAGES; i++) {
62 unsigned long addr = get_zeroed_page(GFP_KERNEL); 70 unsigned long addr = get_zeroed_page(GFP_KERNEL);
63 if (!addr) { 71 if (!addr) {
@@ -67,19 +75,23 @@ static __init int map_switcher(void)
67 switcher_page[i] = virt_to_page(addr); 75 switcher_page[i] = virt_to_page(addr);
68 } 76 }
69 77
70 /* First we check that the Switcher won't overlap the fixmap area at 78 /*
79 * First we check that the Switcher won't overlap the fixmap area at
71 * the top of memory. It's currently nowhere near, but it could have 80 * the top of memory. It's currently nowhere near, but it could have
72 * very strange effects if it ever happened. */ 81 * very strange effects if it ever happened.
82 */
73 if (SWITCHER_ADDR + (TOTAL_SWITCHER_PAGES+1)*PAGE_SIZE > FIXADDR_START){ 83 if (SWITCHER_ADDR + (TOTAL_SWITCHER_PAGES+1)*PAGE_SIZE > FIXADDR_START){
74 err = -ENOMEM; 84 err = -ENOMEM;
75 printk("lguest: mapping switcher would thwack fixmap\n"); 85 printk("lguest: mapping switcher would thwack fixmap\n");
76 goto free_pages; 86 goto free_pages;
77 } 87 }
78 88
79 /* Now we reserve the "virtual memory area" we want: 0xFFC00000 89 /*
90 * Now we reserve the "virtual memory area" we want: 0xFFC00000
80 * (SWITCHER_ADDR). We might not get it in theory, but in practice 91 * (SWITCHER_ADDR). We might not get it in theory, but in practice
81 * it's worked so far. The end address needs +1 because __get_vm_area 92 * it's worked so far. The end address needs +1 because __get_vm_area
82 * allocates an extra guard page, so we need space for that. */ 93 * allocates an extra guard page, so we need space for that.
94 */
83 switcher_vma = __get_vm_area(TOTAL_SWITCHER_PAGES * PAGE_SIZE, 95 switcher_vma = __get_vm_area(TOTAL_SWITCHER_PAGES * PAGE_SIZE,
84 VM_ALLOC, SWITCHER_ADDR, SWITCHER_ADDR 96 VM_ALLOC, SWITCHER_ADDR, SWITCHER_ADDR
85 + (TOTAL_SWITCHER_PAGES+1) * PAGE_SIZE); 97 + (TOTAL_SWITCHER_PAGES+1) * PAGE_SIZE);
@@ -89,11 +101,13 @@ static __init int map_switcher(void)
89 goto free_pages; 101 goto free_pages;
90 } 102 }
91 103
92 /* This code actually sets up the pages we've allocated to appear at 104 /*
105 * This code actually sets up the pages we've allocated to appear at
93 * SWITCHER_ADDR. map_vm_area() takes the vma we allocated above, the 106 * SWITCHER_ADDR. map_vm_area() takes the vma we allocated above, the
94 * kind of pages we're mapping (kernel pages), and a pointer to our 107 * kind of pages we're mapping (kernel pages), and a pointer to our
95 * array of struct pages. It increments that pointer, but we don't 108 * array of struct pages. It increments that pointer, but we don't
96 * care. */ 109 * care.
110 */
97 pagep = switcher_page; 111 pagep = switcher_page;
98 err = map_vm_area(switcher_vma, PAGE_KERNEL_EXEC, &pagep); 112 err = map_vm_area(switcher_vma, PAGE_KERNEL_EXEC, &pagep);
99 if (err) { 113 if (err) {
@@ -101,8 +115,10 @@ static __init int map_switcher(void)
101 goto free_vma; 115 goto free_vma;
102 } 116 }
103 117
104 /* Now the Switcher is mapped at the right address, we can't fail! 118 /*
105 * Copy in the compiled-in Switcher code (from <arch>_switcher.S). */ 119 * Now the Switcher is mapped at the right address, we can't fail!
120 * Copy in the compiled-in Switcher code (from <arch>_switcher.S).
121 */
106 memcpy(switcher_vma->addr, start_switcher_text, 122 memcpy(switcher_vma->addr, start_switcher_text,
107 end_switcher_text - start_switcher_text); 123 end_switcher_text - start_switcher_text);
108 124
@@ -124,8 +140,7 @@ out:
124} 140}
125/*:*/ 141/*:*/
126 142
127/* Cleaning up the mapping when the module is unloaded is almost... 143/* Cleaning up the mapping when the module is unloaded is almost... too easy. */
128 * too easy. */
129static void unmap_switcher(void) 144static void unmap_switcher(void)
130{ 145{
131 unsigned int i; 146 unsigned int i;
@@ -151,16 +166,19 @@ static void unmap_switcher(void)
151 * But we can't trust the Guest: it might be trying to access the Launcher 166 * But we can't trust the Guest: it might be trying to access the Launcher
152 * code. We have to check that the range is below the pfn_limit the Launcher 167 * code. We have to check that the range is below the pfn_limit the Launcher
153 * gave us. We have to make sure that addr + len doesn't give us a false 168 * gave us. We have to make sure that addr + len doesn't give us a false
154 * positive by overflowing, too. */ 169 * positive by overflowing, too.
170 */
155bool lguest_address_ok(const struct lguest *lg, 171bool lguest_address_ok(const struct lguest *lg,
156 unsigned long addr, unsigned long len) 172 unsigned long addr, unsigned long len)
157{ 173{
158 return (addr+len) / PAGE_SIZE < lg->pfn_limit && (addr+len >= addr); 174 return (addr+len) / PAGE_SIZE < lg->pfn_limit && (addr+len >= addr);
159} 175}
160 176
161/* This routine copies memory from the Guest. Here we can see how useful the 177/*
178 * This routine copies memory from the Guest. Here we can see how useful the
162 * kill_lguest() routine we met in the Launcher can be: we return a random 179 * kill_lguest() routine we met in the Launcher can be: we return a random
163 * value (all zeroes) instead of needing to return an error. */ 180 * value (all zeroes) instead of needing to return an error.
181 */
164void __lgread(struct lg_cpu *cpu, void *b, unsigned long addr, unsigned bytes) 182void __lgread(struct lg_cpu *cpu, void *b, unsigned long addr, unsigned bytes)
165{ 183{
166 if (!lguest_address_ok(cpu->lg, addr, bytes) 184 if (!lguest_address_ok(cpu->lg, addr, bytes)
@@ -181,9 +199,11 @@ void __lgwrite(struct lg_cpu *cpu, unsigned long addr, const void *b,
181} 199}
182/*:*/ 200/*:*/
183 201
184/*H:030 Let's jump straight to the the main loop which runs the Guest. 202/*H:030
203 * Let's jump straight to the the main loop which runs the Guest.
185 * Remember, this is called by the Launcher reading /dev/lguest, and we keep 204 * Remember, this is called by the Launcher reading /dev/lguest, and we keep
186 * going around and around until something interesting happens. */ 205 * going around and around until something interesting happens.
206 */
187int run_guest(struct lg_cpu *cpu, unsigned long __user *user) 207int run_guest(struct lg_cpu *cpu, unsigned long __user *user)
188{ 208{
189 /* We stop running once the Guest is dead. */ 209 /* We stop running once the Guest is dead. */
@@ -195,10 +215,17 @@ int run_guest(struct lg_cpu *cpu, unsigned long __user *user)
195 if (cpu->hcall) 215 if (cpu->hcall)
196 do_hypercalls(cpu); 216 do_hypercalls(cpu);
197 217
198 /* It's possible the Guest did a NOTIFY hypercall to the 218 /*
199 * Launcher, in which case we return from the read() now. */ 219 * It's possible the Guest did a NOTIFY hypercall to the
220 * Launcher.
221 */
200 if (cpu->pending_notify) { 222 if (cpu->pending_notify) {
223 /*
224 * Does it just needs to write to a registered
225 * eventfd (ie. the appropriate virtqueue thread)?
226 */
201 if (!send_notify_to_eventfd(cpu)) { 227 if (!send_notify_to_eventfd(cpu)) {
228 /* OK, we tell the main Laucher. */
202 if (put_user(cpu->pending_notify, user)) 229 if (put_user(cpu->pending_notify, user))
203 return -EFAULT; 230 return -EFAULT;
204 return sizeof(cpu->pending_notify); 231 return sizeof(cpu->pending_notify);
@@ -209,29 +236,39 @@ int run_guest(struct lg_cpu *cpu, unsigned long __user *user)
209 if (signal_pending(current)) 236 if (signal_pending(current))
210 return -ERESTARTSYS; 237 return -ERESTARTSYS;
211 238
212 /* Check if there are any interrupts which can be delivered now: 239 /*
240 * Check if there are any interrupts which can be delivered now:
213 * if so, this sets up the hander to be executed when we next 241 * if so, this sets up the hander to be executed when we next
214 * run the Guest. */ 242 * run the Guest.
243 */
215 irq = interrupt_pending(cpu, &more); 244 irq = interrupt_pending(cpu, &more);
216 if (irq < LGUEST_IRQS) 245 if (irq < LGUEST_IRQS)
217 try_deliver_interrupt(cpu, irq, more); 246 try_deliver_interrupt(cpu, irq, more);
218 247
219 /* All long-lived kernel loops need to check with this horrible 248 /*
249 * All long-lived kernel loops need to check with this horrible
220 * thing called the freezer. If the Host is trying to suspend, 250 * thing called the freezer. If the Host is trying to suspend,
221 * it stops us. */ 251 * it stops us.
252 */
222 try_to_freeze(); 253 try_to_freeze();
223 254
224 /* Just make absolutely sure the Guest is still alive. One of 255 /*
225 * those hypercalls could have been fatal, for example. */ 256 * Just make absolutely sure the Guest is still alive. One of
257 * those hypercalls could have been fatal, for example.
258 */
226 if (cpu->lg->dead) 259 if (cpu->lg->dead)
227 break; 260 break;
228 261
229 /* If the Guest asked to be stopped, we sleep. The Guest's 262 /*
230 * clock timer will wake us. */ 263 * If the Guest asked to be stopped, we sleep. The Guest's
264 * clock timer will wake us.
265 */
231 if (cpu->halted) { 266 if (cpu->halted) {
232 set_current_state(TASK_INTERRUPTIBLE); 267 set_current_state(TASK_INTERRUPTIBLE);
233 /* Just before we sleep, make sure no interrupt snuck in 268 /*
234 * which we should be doing. */ 269 * Just before we sleep, make sure no interrupt snuck in
270 * which we should be doing.
271 */
235 if (interrupt_pending(cpu, &more) < LGUEST_IRQS) 272 if (interrupt_pending(cpu, &more) < LGUEST_IRQS)
236 set_current_state(TASK_RUNNING); 273 set_current_state(TASK_RUNNING);
237 else 274 else
@@ -239,8 +276,10 @@ int run_guest(struct lg_cpu *cpu, unsigned long __user *user)
239 continue; 276 continue;
240 } 277 }
241 278
242 /* OK, now we're ready to jump into the Guest. First we put up 279 /*
243 * the "Do Not Disturb" sign: */ 280 * OK, now we're ready to jump into the Guest. First we put up
281 * the "Do Not Disturb" sign:
282 */
244 local_irq_disable(); 283 local_irq_disable();
245 284
246 /* Actually run the Guest until something happens. */ 285 /* Actually run the Guest until something happens. */
@@ -327,8 +366,10 @@ static void __exit fini(void)
327} 366}
328/*:*/ 367/*:*/
329 368
330/* The Host side of lguest can be a module. This is a nice way for people to 369/*
331 * play with it. */ 370 * The Host side of lguest can be a module. This is a nice way for people to
371 * play with it.
372 */
332module_init(init); 373module_init(init);
333module_exit(fini); 374module_exit(fini);
334MODULE_LICENSE("GPL"); 375MODULE_LICENSE("GPL");
diff --git a/drivers/lguest/hypercalls.c b/drivers/lguest/hypercalls.c
index c29ffa19cb74..83511eb0923d 100644
--- a/drivers/lguest/hypercalls.c
+++ b/drivers/lguest/hypercalls.c
@@ -1,8 +1,10 @@
1/*P:500 Just as userspace programs request kernel operations through a system 1/*P:500
2 * Just as userspace programs request kernel operations through a system
2 * call, the Guest requests Host operations through a "hypercall". You might 3 * call, the Guest requests Host operations through a "hypercall". You might
3 * notice this nomenclature doesn't really follow any logic, but the name has 4 * notice this nomenclature doesn't really follow any logic, but the name has
4 * been around for long enough that we're stuck with it. As you'd expect, this 5 * been around for long enough that we're stuck with it. As you'd expect, this
5 * code is basically a one big switch statement. :*/ 6 * code is basically a one big switch statement.
7:*/
6 8
7/* Copyright (C) 2006 Rusty Russell IBM Corporation 9/* Copyright (C) 2006 Rusty Russell IBM Corporation
8 10
@@ -28,30 +30,41 @@
28#include <asm/pgtable.h> 30#include <asm/pgtable.h>
29#include "lg.h" 31#include "lg.h"
30 32
31/*H:120 This is the core hypercall routine: where the Guest gets what it wants. 33/*H:120
32 * Or gets killed. Or, in the case of LHCALL_SHUTDOWN, both. */ 34 * This is the core hypercall routine: where the Guest gets what it wants.
35 * Or gets killed. Or, in the case of LHCALL_SHUTDOWN, both.
36 */
33static void do_hcall(struct lg_cpu *cpu, struct hcall_args *args) 37static void do_hcall(struct lg_cpu *cpu, struct hcall_args *args)
34{ 38{
35 switch (args->arg0) { 39 switch (args->arg0) {
36 case LHCALL_FLUSH_ASYNC: 40 case LHCALL_FLUSH_ASYNC:
37 /* This call does nothing, except by breaking out of the Guest 41 /*
38 * it makes us process all the asynchronous hypercalls. */ 42 * This call does nothing, except by breaking out of the Guest
43 * it makes us process all the asynchronous hypercalls.
44 */
39 break; 45 break;
40 case LHCALL_SEND_INTERRUPTS: 46 case LHCALL_SEND_INTERRUPTS:
41 /* This call does nothing too, but by breaking out of the Guest 47 /*
42 * it makes us process any pending interrupts. */ 48 * This call does nothing too, but by breaking out of the Guest
49 * it makes us process any pending interrupts.
50 */
43 break; 51 break;
44 case LHCALL_LGUEST_INIT: 52 case LHCALL_LGUEST_INIT:
45 /* You can't get here unless you're already initialized. Don't 53 /*
46 * do that. */ 54 * You can't get here unless you're already initialized. Don't
55 * do that.
56 */
47 kill_guest(cpu, "already have lguest_data"); 57 kill_guest(cpu, "already have lguest_data");
48 break; 58 break;
49 case LHCALL_SHUTDOWN: { 59 case LHCALL_SHUTDOWN: {
50 /* Shutdown is such a trivial hypercall that we do it in four
51 * lines right here. */
52 char msg[128]; 60 char msg[128];
53 /* If the lgread fails, it will call kill_guest() itself; the 61 /*
54 * kill_guest() with the message will be ignored. */ 62 * Shutdown is such a trivial hypercall that we do it in five
63 * lines right here.
64 *
65 * If the lgread fails, it will call kill_guest() itself; the
66 * kill_guest() with the message will be ignored.
67 */
55 __lgread(cpu, msg, args->arg1, sizeof(msg)); 68 __lgread(cpu, msg, args->arg1, sizeof(msg));
56 msg[sizeof(msg)-1] = '\0'; 69 msg[sizeof(msg)-1] = '\0';
57 kill_guest(cpu, "CRASH: %s", msg); 70 kill_guest(cpu, "CRASH: %s", msg);
@@ -60,16 +73,17 @@ static void do_hcall(struct lg_cpu *cpu, struct hcall_args *args)
60 break; 73 break;
61 } 74 }
62 case LHCALL_FLUSH_TLB: 75 case LHCALL_FLUSH_TLB:
63 /* FLUSH_TLB comes in two flavors, depending on the 76 /* FLUSH_TLB comes in two flavors, depending on the argument: */
64 * argument: */
65 if (args->arg1) 77 if (args->arg1)
66 guest_pagetable_clear_all(cpu); 78 guest_pagetable_clear_all(cpu);
67 else 79 else
68 guest_pagetable_flush_user(cpu); 80 guest_pagetable_flush_user(cpu);
69 break; 81 break;
70 82
71 /* All these calls simply pass the arguments through to the right 83 /*
72 * routines. */ 84 * All these calls simply pass the arguments through to the right
85 * routines.
86 */
73 case LHCALL_NEW_PGTABLE: 87 case LHCALL_NEW_PGTABLE:
74 guest_new_pagetable(cpu, args->arg1); 88 guest_new_pagetable(cpu, args->arg1);
75 break; 89 break;
@@ -112,15 +126,16 @@ static void do_hcall(struct lg_cpu *cpu, struct hcall_args *args)
112 kill_guest(cpu, "Bad hypercall %li\n", args->arg0); 126 kill_guest(cpu, "Bad hypercall %li\n", args->arg0);
113 } 127 }
114} 128}
115/*:*/
116 129
117/*H:124 Asynchronous hypercalls are easy: we just look in the array in the 130/*H:124
131 * Asynchronous hypercalls are easy: we just look in the array in the
118 * Guest's "struct lguest_data" to see if any new ones are marked "ready". 132 * Guest's "struct lguest_data" to see if any new ones are marked "ready".
119 * 133 *
120 * We are careful to do these in order: obviously we respect the order the 134 * We are careful to do these in order: obviously we respect the order the
121 * Guest put them in the ring, but we also promise the Guest that they will 135 * Guest put them in the ring, but we also promise the Guest that they will
122 * happen before any normal hypercall (which is why we check this before 136 * happen before any normal hypercall (which is why we check this before
123 * checking for a normal hcall). */ 137 * checking for a normal hcall).
138 */
124static void do_async_hcalls(struct lg_cpu *cpu) 139static void do_async_hcalls(struct lg_cpu *cpu)
125{ 140{
126 unsigned int i; 141 unsigned int i;
@@ -133,22 +148,28 @@ static void do_async_hcalls(struct lg_cpu *cpu)
133 /* We process "struct lguest_data"s hcalls[] ring once. */ 148 /* We process "struct lguest_data"s hcalls[] ring once. */
134 for (i = 0; i < ARRAY_SIZE(st); i++) { 149 for (i = 0; i < ARRAY_SIZE(st); i++) {
135 struct hcall_args args; 150 struct hcall_args args;
136 /* We remember where we were up to from last time. This makes 151 /*
152 * We remember where we were up to from last time. This makes
137 * sure that the hypercalls are done in the order the Guest 153 * sure that the hypercalls are done in the order the Guest
138 * places them in the ring. */ 154 * places them in the ring.
155 */
139 unsigned int n = cpu->next_hcall; 156 unsigned int n = cpu->next_hcall;
140 157
141 /* 0xFF means there's no call here (yet). */ 158 /* 0xFF means there's no call here (yet). */
142 if (st[n] == 0xFF) 159 if (st[n] == 0xFF)
143 break; 160 break;
144 161
145 /* OK, we have hypercall. Increment the "next_hcall" cursor, 162 /*
146 * and wrap back to 0 if we reach the end. */ 163 * OK, we have hypercall. Increment the "next_hcall" cursor,
164 * and wrap back to 0 if we reach the end.
165 */
147 if (++cpu->next_hcall == LHCALL_RING_SIZE) 166 if (++cpu->next_hcall == LHCALL_RING_SIZE)
148 cpu->next_hcall = 0; 167 cpu->next_hcall = 0;
149 168
150 /* Copy the hypercall arguments into a local copy of 169 /*
151 * the hcall_args struct. */ 170 * Copy the hypercall arguments into a local copy of the
171 * hcall_args struct.
172 */
152 if (copy_from_user(&args, &cpu->lg->lguest_data->hcalls[n], 173 if (copy_from_user(&args, &cpu->lg->lguest_data->hcalls[n],
153 sizeof(struct hcall_args))) { 174 sizeof(struct hcall_args))) {
154 kill_guest(cpu, "Fetching async hypercalls"); 175 kill_guest(cpu, "Fetching async hypercalls");
@@ -164,19 +185,25 @@ static void do_async_hcalls(struct lg_cpu *cpu)
164 break; 185 break;
165 } 186 }
166 187
167 /* Stop doing hypercalls if they want to notify the Launcher: 188 /*
168 * it needs to service this first. */ 189 * Stop doing hypercalls if they want to notify the Launcher:
190 * it needs to service this first.
191 */
169 if (cpu->pending_notify) 192 if (cpu->pending_notify)
170 break; 193 break;
171 } 194 }
172} 195}
173 196
174/* Last of all, we look at what happens first of all. The very first time the 197/*
175 * Guest makes a hypercall, we end up here to set things up: */ 198 * Last of all, we look at what happens first of all. The very first time the
199 * Guest makes a hypercall, we end up here to set things up:
200 */
176static void initialize(struct lg_cpu *cpu) 201static void initialize(struct lg_cpu *cpu)
177{ 202{
178 /* You can't do anything until you're initialized. The Guest knows the 203 /*
179 * rules, so we're unforgiving here. */ 204 * You can't do anything until you're initialized. The Guest knows the
205 * rules, so we're unforgiving here.
206 */
180 if (cpu->hcall->arg0 != LHCALL_LGUEST_INIT) { 207 if (cpu->hcall->arg0 != LHCALL_LGUEST_INIT) {
181 kill_guest(cpu, "hypercall %li before INIT", cpu->hcall->arg0); 208 kill_guest(cpu, "hypercall %li before INIT", cpu->hcall->arg0);
182 return; 209 return;
@@ -185,32 +212,44 @@ static void initialize(struct lg_cpu *cpu)
185 if (lguest_arch_init_hypercalls(cpu)) 212 if (lguest_arch_init_hypercalls(cpu))
186 kill_guest(cpu, "bad guest page %p", cpu->lg->lguest_data); 213 kill_guest(cpu, "bad guest page %p", cpu->lg->lguest_data);
187 214
188 /* The Guest tells us where we're not to deliver interrupts by putting 215 /*
189 * the range of addresses into "struct lguest_data". */ 216 * The Guest tells us where we're not to deliver interrupts by putting
217 * the range of addresses into "struct lguest_data".
218 */
190 if (get_user(cpu->lg->noirq_start, &cpu->lg->lguest_data->noirq_start) 219 if (get_user(cpu->lg->noirq_start, &cpu->lg->lguest_data->noirq_start)
191 || get_user(cpu->lg->noirq_end, &cpu->lg->lguest_data->noirq_end)) 220 || get_user(cpu->lg->noirq_end, &cpu->lg->lguest_data->noirq_end))
192 kill_guest(cpu, "bad guest page %p", cpu->lg->lguest_data); 221 kill_guest(cpu, "bad guest page %p", cpu->lg->lguest_data);
193 222
194 /* We write the current time into the Guest's data page once so it can 223 /*
195 * set its clock. */ 224 * We write the current time into the Guest's data page once so it can
225 * set its clock.
226 */
196 write_timestamp(cpu); 227 write_timestamp(cpu);
197 228
198 /* page_tables.c will also do some setup. */ 229 /* page_tables.c will also do some setup. */
199 page_table_guest_data_init(cpu); 230 page_table_guest_data_init(cpu);
200 231
201 /* This is the one case where the above accesses might have been the 232 /*
233 * This is the one case where the above accesses might have been the
202 * first write to a Guest page. This may have caused a copy-on-write 234 * first write to a Guest page. This may have caused a copy-on-write
203 * fault, but the old page might be (read-only) in the Guest 235 * fault, but the old page might be (read-only) in the Guest
204 * pagetable. */ 236 * pagetable.
237 */
205 guest_pagetable_clear_all(cpu); 238 guest_pagetable_clear_all(cpu);
206} 239}
207/*:*/ 240/*:*/
208 241
209/*M:013 If a Guest reads from a page (so creates a mapping) that it has never 242/*M:013
243 * If a Guest reads from a page (so creates a mapping) that it has never
210 * written to, and then the Launcher writes to it (ie. the output of a virtual 244 * written to, and then the Launcher writes to it (ie. the output of a virtual
211 * device), the Guest will still see the old page. In practice, this never 245 * device), the Guest will still see the old page. In practice, this never
212 * happens: why would the Guest read a page which it has never written to? But 246 * happens: why would the Guest read a page which it has never written to? But
213 * a similar scenario might one day bite us, so it's worth mentioning. :*/ 247 * a similar scenario might one day bite us, so it's worth mentioning.
248 *
249 * Note that if we used a shared anonymous mapping in the Launcher instead of
250 * mapping /dev/zero private, we wouldn't worry about cop-on-write. And we
251 * need that to switch the Launcher to processes (away from threads) anyway.
252:*/
214 253
215/*H:100 254/*H:100
216 * Hypercalls 255 * Hypercalls
@@ -229,17 +268,22 @@ void do_hypercalls(struct lg_cpu *cpu)
229 return; 268 return;
230 } 269 }
231 270
232 /* The Guest has initialized. 271 /*
272 * The Guest has initialized.
233 * 273 *
234 * Look in the hypercall ring for the async hypercalls: */ 274 * Look in the hypercall ring for the async hypercalls:
275 */
235 do_async_hcalls(cpu); 276 do_async_hcalls(cpu);
236 277
237 /* If we stopped reading the hypercall ring because the Guest did a 278 /*
279 * If we stopped reading the hypercall ring because the Guest did a
238 * NOTIFY to the Launcher, we want to return now. Otherwise we do 280 * NOTIFY to the Launcher, we want to return now. Otherwise we do
239 * the hypercall. */ 281 * the hypercall.
282 */
240 if (!cpu->pending_notify) { 283 if (!cpu->pending_notify) {
241 do_hcall(cpu, cpu->hcall); 284 do_hcall(cpu, cpu->hcall);
242 /* Tricky point: we reset the hcall pointer to mark the 285 /*
286 * Tricky point: we reset the hcall pointer to mark the
243 * hypercall as "done". We use the hcall pointer rather than 287 * hypercall as "done". We use the hcall pointer rather than
244 * the trap number to indicate a hypercall is pending. 288 * the trap number to indicate a hypercall is pending.
245 * Normally it doesn't matter: the Guest will run again and 289 * Normally it doesn't matter: the Guest will run again and
@@ -248,13 +292,16 @@ void do_hypercalls(struct lg_cpu *cpu)
248 * However, if we are signalled or the Guest sends I/O to the 292 * However, if we are signalled or the Guest sends I/O to the
249 * Launcher, the run_guest() loop will exit without running the 293 * Launcher, the run_guest() loop will exit without running the
250 * Guest. When it comes back it would try to re-run the 294 * Guest. When it comes back it would try to re-run the
251 * hypercall. Finding that bug sucked. */ 295 * hypercall. Finding that bug sucked.
296 */
252 cpu->hcall = NULL; 297 cpu->hcall = NULL;
253 } 298 }
254} 299}
255 300
256/* This routine supplies the Guest with time: it's used for wallclock time at 301/*
257 * initial boot and as a rough time source if the TSC isn't available. */ 302 * This routine supplies the Guest with time: it's used for wallclock time at
303 * initial boot and as a rough time source if the TSC isn't available.
304 */
258void write_timestamp(struct lg_cpu *cpu) 305void write_timestamp(struct lg_cpu *cpu)
259{ 306{
260 struct timespec now; 307 struct timespec now;
diff --git a/drivers/lguest/interrupts_and_traps.c b/drivers/lguest/interrupts_and_traps.c
index 0e9067b0d507..18648180db02 100644
--- a/drivers/lguest/interrupts_and_traps.c
+++ b/drivers/lguest/interrupts_and_traps.c
@@ -1,4 +1,5 @@
1/*P:800 Interrupts (traps) are complicated enough to earn their own file. 1/*P:800
2 * Interrupts (traps) are complicated enough to earn their own file.
2 * There are three classes of interrupts: 3 * There are three classes of interrupts:
3 * 4 *
4 * 1) Real hardware interrupts which occur while we're running the Guest, 5 * 1) Real hardware interrupts which occur while we're running the Guest,
@@ -10,7 +11,8 @@
10 * just like real hardware would deliver them. Traps from the Guest can be set 11 * just like real hardware would deliver them. Traps from the Guest can be set
11 * up to go directly back into the Guest, but sometimes the Host wants to see 12 * up to go directly back into the Guest, but sometimes the Host wants to see
12 * them first, so we also have a way of "reflecting" them into the Guest as if 13 * them first, so we also have a way of "reflecting" them into the Guest as if
13 * they had been delivered to it directly. :*/ 14 * they had been delivered to it directly.
15:*/
14#include <linux/uaccess.h> 16#include <linux/uaccess.h>
15#include <linux/interrupt.h> 17#include <linux/interrupt.h>
16#include <linux/module.h> 18#include <linux/module.h>
@@ -26,8 +28,10 @@ static unsigned long idt_address(u32 lo, u32 hi)
26 return (lo & 0x0000FFFF) | (hi & 0xFFFF0000); 28 return (lo & 0x0000FFFF) | (hi & 0xFFFF0000);
27} 29}
28 30
29/* The "type" of the interrupt handler is a 4 bit field: we only support a 31/*
30 * couple of types. */ 32 * The "type" of the interrupt handler is a 4 bit field: we only support a
33 * couple of types.
34 */
31static int idt_type(u32 lo, u32 hi) 35static int idt_type(u32 lo, u32 hi)
32{ 36{
33 return (hi >> 8) & 0xF; 37 return (hi >> 8) & 0xF;
@@ -39,8 +43,10 @@ static bool idt_present(u32 lo, u32 hi)
39 return (hi & 0x8000); 43 return (hi & 0x8000);
40} 44}
41 45
42/* We need a helper to "push" a value onto the Guest's stack, since that's a 46/*
43 * big part of what delivering an interrupt does. */ 47 * We need a helper to "push" a value onto the Guest's stack, since that's a
48 * big part of what delivering an interrupt does.
49 */
44static void push_guest_stack(struct lg_cpu *cpu, unsigned long *gstack, u32 val) 50static void push_guest_stack(struct lg_cpu *cpu, unsigned long *gstack, u32 val)
45{ 51{
46 /* Stack grows upwards: move stack then write value. */ 52 /* Stack grows upwards: move stack then write value. */
@@ -48,7 +54,8 @@ static void push_guest_stack(struct lg_cpu *cpu, unsigned long *gstack, u32 val)
48 lgwrite(cpu, *gstack, u32, val); 54 lgwrite(cpu, *gstack, u32, val);
49} 55}
50 56
51/*H:210 The set_guest_interrupt() routine actually delivers the interrupt or 57/*H:210
58 * The set_guest_interrupt() routine actually delivers the interrupt or
52 * trap. The mechanics of delivering traps and interrupts to the Guest are the 59 * trap. The mechanics of delivering traps and interrupts to the Guest are the
53 * same, except some traps have an "error code" which gets pushed onto the 60 * same, except some traps have an "error code" which gets pushed onto the
54 * stack as well: the caller tells us if this is one. 61 * stack as well: the caller tells us if this is one.
@@ -59,7 +66,8 @@ static void push_guest_stack(struct lg_cpu *cpu, unsigned long *gstack, u32 val)
59 * 66 *
60 * We set up the stack just like the CPU does for a real interrupt, so it's 67 * We set up the stack just like the CPU does for a real interrupt, so it's
61 * identical for the Guest (and the standard "iret" instruction will undo 68 * identical for the Guest (and the standard "iret" instruction will undo
62 * it). */ 69 * it).
70 */
63static void set_guest_interrupt(struct lg_cpu *cpu, u32 lo, u32 hi, 71static void set_guest_interrupt(struct lg_cpu *cpu, u32 lo, u32 hi,
64 bool has_err) 72 bool has_err)
65{ 73{
@@ -67,20 +75,26 @@ static void set_guest_interrupt(struct lg_cpu *cpu, u32 lo, u32 hi,
67 u32 eflags, ss, irq_enable; 75 u32 eflags, ss, irq_enable;
68 unsigned long virtstack; 76 unsigned long virtstack;
69 77
70 /* There are two cases for interrupts: one where the Guest is already 78 /*
79 * There are two cases for interrupts: one where the Guest is already
71 * in the kernel, and a more complex one where the Guest is in 80 * in the kernel, and a more complex one where the Guest is in
72 * userspace. We check the privilege level to find out. */ 81 * userspace. We check the privilege level to find out.
82 */
73 if ((cpu->regs->ss&0x3) != GUEST_PL) { 83 if ((cpu->regs->ss&0x3) != GUEST_PL) {
74 /* The Guest told us their kernel stack with the SET_STACK 84 /*
75 * hypercall: both the virtual address and the segment */ 85 * The Guest told us their kernel stack with the SET_STACK
86 * hypercall: both the virtual address and the segment.
87 */
76 virtstack = cpu->esp1; 88 virtstack = cpu->esp1;
77 ss = cpu->ss1; 89 ss = cpu->ss1;
78 90
79 origstack = gstack = guest_pa(cpu, virtstack); 91 origstack = gstack = guest_pa(cpu, virtstack);
80 /* We push the old stack segment and pointer onto the new 92 /*
93 * We push the old stack segment and pointer onto the new
81 * stack: when the Guest does an "iret" back from the interrupt 94 * stack: when the Guest does an "iret" back from the interrupt
82 * handler the CPU will notice they're dropping privilege 95 * handler the CPU will notice they're dropping privilege
83 * levels and expect these here. */ 96 * levels and expect these here.
97 */
84 push_guest_stack(cpu, &gstack, cpu->regs->ss); 98 push_guest_stack(cpu, &gstack, cpu->regs->ss);
85 push_guest_stack(cpu, &gstack, cpu->regs->esp); 99 push_guest_stack(cpu, &gstack, cpu->regs->esp);
86 } else { 100 } else {
@@ -91,18 +105,22 @@ static void set_guest_interrupt(struct lg_cpu *cpu, u32 lo, u32 hi,
91 origstack = gstack = guest_pa(cpu, virtstack); 105 origstack = gstack = guest_pa(cpu, virtstack);
92 } 106 }
93 107
94 /* Remember that we never let the Guest actually disable interrupts, so 108 /*
109 * Remember that we never let the Guest actually disable interrupts, so
95 * the "Interrupt Flag" bit is always set. We copy that bit from the 110 * the "Interrupt Flag" bit is always set. We copy that bit from the
96 * Guest's "irq_enabled" field into the eflags word: we saw the Guest 111 * Guest's "irq_enabled" field into the eflags word: we saw the Guest
97 * copy it back in "lguest_iret". */ 112 * copy it back in "lguest_iret".
113 */
98 eflags = cpu->regs->eflags; 114 eflags = cpu->regs->eflags;
99 if (get_user(irq_enable, &cpu->lg->lguest_data->irq_enabled) == 0 115 if (get_user(irq_enable, &cpu->lg->lguest_data->irq_enabled) == 0
100 && !(irq_enable & X86_EFLAGS_IF)) 116 && !(irq_enable & X86_EFLAGS_IF))
101 eflags &= ~X86_EFLAGS_IF; 117 eflags &= ~X86_EFLAGS_IF;
102 118
103 /* An interrupt is expected to push three things on the stack: the old 119 /*
120 * An interrupt is expected to push three things on the stack: the old
104 * "eflags" word, the old code segment, and the old instruction 121 * "eflags" word, the old code segment, and the old instruction
105 * pointer. */ 122 * pointer.
123 */
106 push_guest_stack(cpu, &gstack, eflags); 124 push_guest_stack(cpu, &gstack, eflags);
107 push_guest_stack(cpu, &gstack, cpu->regs->cs); 125 push_guest_stack(cpu, &gstack, cpu->regs->cs);
108 push_guest_stack(cpu, &gstack, cpu->regs->eip); 126 push_guest_stack(cpu, &gstack, cpu->regs->eip);
@@ -111,15 +129,19 @@ static void set_guest_interrupt(struct lg_cpu *cpu, u32 lo, u32 hi,
111 if (has_err) 129 if (has_err)
112 push_guest_stack(cpu, &gstack, cpu->regs->errcode); 130 push_guest_stack(cpu, &gstack, cpu->regs->errcode);
113 131
114 /* Now we've pushed all the old state, we change the stack, the code 132 /*
115 * segment and the address to execute. */ 133 * Now we've pushed all the old state, we change the stack, the code
134 * segment and the address to execute.
135 */
116 cpu->regs->ss = ss; 136 cpu->regs->ss = ss;
117 cpu->regs->esp = virtstack + (gstack - origstack); 137 cpu->regs->esp = virtstack + (gstack - origstack);
118 cpu->regs->cs = (__KERNEL_CS|GUEST_PL); 138 cpu->regs->cs = (__KERNEL_CS|GUEST_PL);
119 cpu->regs->eip = idt_address(lo, hi); 139 cpu->regs->eip = idt_address(lo, hi);
120 140
121 /* There are two kinds of interrupt handlers: 0xE is an "interrupt 141 /*
122 * gate" which expects interrupts to be disabled on entry. */ 142 * There are two kinds of interrupt handlers: 0xE is an "interrupt
143 * gate" which expects interrupts to be disabled on entry.
144 */
123 if (idt_type(lo, hi) == 0xE) 145 if (idt_type(lo, hi) == 0xE)
124 if (put_user(0, &cpu->lg->lguest_data->irq_enabled)) 146 if (put_user(0, &cpu->lg->lguest_data->irq_enabled))
125 kill_guest(cpu, "Disabling interrupts"); 147 kill_guest(cpu, "Disabling interrupts");
@@ -130,7 +152,8 @@ static void set_guest_interrupt(struct lg_cpu *cpu, u32 lo, u32 hi,
130 * 152 *
131 * interrupt_pending() returns the first pending interrupt which isn't blocked 153 * interrupt_pending() returns the first pending interrupt which isn't blocked
132 * by the Guest. It is called before every entry to the Guest, and just before 154 * by the Guest. It is called before every entry to the Guest, and just before
133 * we go to sleep when the Guest has halted itself. */ 155 * we go to sleep when the Guest has halted itself.
156 */
134unsigned int interrupt_pending(struct lg_cpu *cpu, bool *more) 157unsigned int interrupt_pending(struct lg_cpu *cpu, bool *more)
135{ 158{
136 unsigned int irq; 159 unsigned int irq;
@@ -140,8 +163,10 @@ unsigned int interrupt_pending(struct lg_cpu *cpu, bool *more)
140 if (!cpu->lg->lguest_data) 163 if (!cpu->lg->lguest_data)
141 return LGUEST_IRQS; 164 return LGUEST_IRQS;
142 165
143 /* Take our "irqs_pending" array and remove any interrupts the Guest 166 /*
144 * wants blocked: the result ends up in "blk". */ 167 * Take our "irqs_pending" array and remove any interrupts the Guest
168 * wants blocked: the result ends up in "blk".
169 */
145 if (copy_from_user(&blk, cpu->lg->lguest_data->blocked_interrupts, 170 if (copy_from_user(&blk, cpu->lg->lguest_data->blocked_interrupts,
146 sizeof(blk))) 171 sizeof(blk)))
147 return LGUEST_IRQS; 172 return LGUEST_IRQS;
@@ -154,16 +179,20 @@ unsigned int interrupt_pending(struct lg_cpu *cpu, bool *more)
154 return irq; 179 return irq;
155} 180}
156 181
157/* This actually diverts the Guest to running an interrupt handler, once an 182/*
158 * interrupt has been identified by interrupt_pending(). */ 183 * This actually diverts the Guest to running an interrupt handler, once an
184 * interrupt has been identified by interrupt_pending().
185 */
159void try_deliver_interrupt(struct lg_cpu *cpu, unsigned int irq, bool more) 186void try_deliver_interrupt(struct lg_cpu *cpu, unsigned int irq, bool more)
160{ 187{
161 struct desc_struct *idt; 188 struct desc_struct *idt;
162 189
163 BUG_ON(irq >= LGUEST_IRQS); 190 BUG_ON(irq >= LGUEST_IRQS);
164 191
165 /* They may be in the middle of an iret, where they asked us never to 192 /*
166 * deliver interrupts. */ 193 * They may be in the middle of an iret, where they asked us never to
194 * deliver interrupts.
195 */
167 if (cpu->regs->eip >= cpu->lg->noirq_start && 196 if (cpu->regs->eip >= cpu->lg->noirq_start &&
168 (cpu->regs->eip < cpu->lg->noirq_end)) 197 (cpu->regs->eip < cpu->lg->noirq_end))
169 return; 198 return;
@@ -187,29 +216,37 @@ void try_deliver_interrupt(struct lg_cpu *cpu, unsigned int irq, bool more)
187 } 216 }
188 } 217 }
189 218
190 /* Look at the IDT entry the Guest gave us for this interrupt. The 219 /*
220 * Look at the IDT entry the Guest gave us for this interrupt. The
191 * first 32 (FIRST_EXTERNAL_VECTOR) entries are for traps, so we skip 221 * first 32 (FIRST_EXTERNAL_VECTOR) entries are for traps, so we skip
192 * over them. */ 222 * over them.
223 */
193 idt = &cpu->arch.idt[FIRST_EXTERNAL_VECTOR+irq]; 224 idt = &cpu->arch.idt[FIRST_EXTERNAL_VECTOR+irq];
194 /* If they don't have a handler (yet?), we just ignore it */ 225 /* If they don't have a handler (yet?), we just ignore it */
195 if (idt_present(idt->a, idt->b)) { 226 if (idt_present(idt->a, idt->b)) {
196 /* OK, mark it no longer pending and deliver it. */ 227 /* OK, mark it no longer pending and deliver it. */
197 clear_bit(irq, cpu->irqs_pending); 228 clear_bit(irq, cpu->irqs_pending);
198 /* set_guest_interrupt() takes the interrupt descriptor and a 229 /*
230 * set_guest_interrupt() takes the interrupt descriptor and a
199 * flag to say whether this interrupt pushes an error code onto 231 * flag to say whether this interrupt pushes an error code onto
200 * the stack as well: virtual interrupts never do. */ 232 * the stack as well: virtual interrupts never do.
233 */
201 set_guest_interrupt(cpu, idt->a, idt->b, false); 234 set_guest_interrupt(cpu, idt->a, idt->b, false);
202 } 235 }
203 236
204 /* Every time we deliver an interrupt, we update the timestamp in the 237 /*
238 * Every time we deliver an interrupt, we update the timestamp in the
205 * Guest's lguest_data struct. It would be better for the Guest if we 239 * Guest's lguest_data struct. It would be better for the Guest if we
206 * did this more often, but it can actually be quite slow: doing it 240 * did this more often, but it can actually be quite slow: doing it
207 * here is a compromise which means at least it gets updated every 241 * here is a compromise which means at least it gets updated every
208 * timer interrupt. */ 242 * timer interrupt.
243 */
209 write_timestamp(cpu); 244 write_timestamp(cpu);
210 245
211 /* If there are no other interrupts we want to deliver, clear 246 /*
212 * the pending flag. */ 247 * If there are no other interrupts we want to deliver, clear
248 * the pending flag.
249 */
213 if (!more) 250 if (!more)
214 put_user(0, &cpu->lg->lguest_data->irq_pending); 251 put_user(0, &cpu->lg->lguest_data->irq_pending);
215} 252}
@@ -217,24 +254,29 @@ void try_deliver_interrupt(struct lg_cpu *cpu, unsigned int irq, bool more)
217/* And this is the routine when we want to set an interrupt for the Guest. */ 254/* And this is the routine when we want to set an interrupt for the Guest. */
218void set_interrupt(struct lg_cpu *cpu, unsigned int irq) 255void set_interrupt(struct lg_cpu *cpu, unsigned int irq)
219{ 256{
220 /* Next time the Guest runs, the core code will see if it can deliver 257 /*
221 * this interrupt. */ 258 * Next time the Guest runs, the core code will see if it can deliver
259 * this interrupt.
260 */
222 set_bit(irq, cpu->irqs_pending); 261 set_bit(irq, cpu->irqs_pending);
223 262
224 /* Make sure it sees it; it might be asleep (eg. halted), or 263 /*
225 * running the Guest right now, in which case kick_process() 264 * Make sure it sees it; it might be asleep (eg. halted), or running
226 * will knock it out. */ 265 * the Guest right now, in which case kick_process() will knock it out.
266 */
227 if (!wake_up_process(cpu->tsk)) 267 if (!wake_up_process(cpu->tsk))
228 kick_process(cpu->tsk); 268 kick_process(cpu->tsk);
229} 269}
230/*:*/ 270/*:*/
231 271
232/* Linux uses trap 128 for system calls. Plan9 uses 64, and Ron Minnich sent 272/*
273 * Linux uses trap 128 for system calls. Plan9 uses 64, and Ron Minnich sent
233 * me a patch, so we support that too. It'd be a big step for lguest if half 274 * me a patch, so we support that too. It'd be a big step for lguest if half
234 * the Plan 9 user base were to start using it. 275 * the Plan 9 user base were to start using it.
235 * 276 *
236 * Actually now I think of it, it's possible that Ron *is* half the Plan 9 277 * Actually now I think of it, it's possible that Ron *is* half the Plan 9
237 * userbase. Oh well. */ 278 * userbase. Oh well.
279 */
238static bool could_be_syscall(unsigned int num) 280static bool could_be_syscall(unsigned int num)
239{ 281{
240 /* Normal Linux SYSCALL_VECTOR or reserved vector? */ 282 /* Normal Linux SYSCALL_VECTOR or reserved vector? */
@@ -274,9 +316,11 @@ void free_interrupts(void)
274 clear_bit(syscall_vector, used_vectors); 316 clear_bit(syscall_vector, used_vectors);
275} 317}
276 318
277/*H:220 Now we've got the routines to deliver interrupts, delivering traps like 319/*H:220
320 * Now we've got the routines to deliver interrupts, delivering traps like
278 * page fault is easy. The only trick is that Intel decided that some traps 321 * page fault is easy. The only trick is that Intel decided that some traps
279 * should have error codes: */ 322 * should have error codes:
323 */
280static bool has_err(unsigned int trap) 324static bool has_err(unsigned int trap)
281{ 325{
282 return (trap == 8 || (trap >= 10 && trap <= 14) || trap == 17); 326 return (trap == 8 || (trap >= 10 && trap <= 14) || trap == 17);
@@ -285,13 +329,17 @@ static bool has_err(unsigned int trap)
285/* deliver_trap() returns true if it could deliver the trap. */ 329/* deliver_trap() returns true if it could deliver the trap. */
286bool deliver_trap(struct lg_cpu *cpu, unsigned int num) 330bool deliver_trap(struct lg_cpu *cpu, unsigned int num)
287{ 331{
288 /* Trap numbers are always 8 bit, but we set an impossible trap number 332 /*
289 * for traps inside the Switcher, so check that here. */ 333 * Trap numbers are always 8 bit, but we set an impossible trap number
334 * for traps inside the Switcher, so check that here.
335 */
290 if (num >= ARRAY_SIZE(cpu->arch.idt)) 336 if (num >= ARRAY_SIZE(cpu->arch.idt))
291 return false; 337 return false;
292 338
293 /* Early on the Guest hasn't set the IDT entries (or maybe it put a 339 /*
294 * bogus one in): if we fail here, the Guest will be killed. */ 340 * Early on the Guest hasn't set the IDT entries (or maybe it put a
341 * bogus one in): if we fail here, the Guest will be killed.
342 */
295 if (!idt_present(cpu->arch.idt[num].a, cpu->arch.idt[num].b)) 343 if (!idt_present(cpu->arch.idt[num].a, cpu->arch.idt[num].b))
296 return false; 344 return false;
297 set_guest_interrupt(cpu, cpu->arch.idt[num].a, 345 set_guest_interrupt(cpu, cpu->arch.idt[num].a,
@@ -299,7 +347,8 @@ bool deliver_trap(struct lg_cpu *cpu, unsigned int num)
299 return true; 347 return true;
300} 348}
301 349
302/*H:250 Here's the hard part: returning to the Host every time a trap happens 350/*H:250
351 * Here's the hard part: returning to the Host every time a trap happens
303 * and then calling deliver_trap() and re-entering the Guest is slow. 352 * and then calling deliver_trap() and re-entering the Guest is slow.
304 * Particularly because Guest userspace system calls are traps (usually trap 353 * Particularly because Guest userspace system calls are traps (usually trap
305 * 128). 354 * 128).
@@ -311,69 +360,87 @@ bool deliver_trap(struct lg_cpu *cpu, unsigned int num)
311 * the other hypervisors would beat it up at lunchtime. 360 * the other hypervisors would beat it up at lunchtime.
312 * 361 *
313 * This routine indicates if a particular trap number could be delivered 362 * This routine indicates if a particular trap number could be delivered
314 * directly. */ 363 * directly.
364 */
315static bool direct_trap(unsigned int num) 365static bool direct_trap(unsigned int num)
316{ 366{
317 /* Hardware interrupts don't go to the Guest at all (except system 367 /*
318 * call). */ 368 * Hardware interrupts don't go to the Guest at all (except system
369 * call).
370 */
319 if (num >= FIRST_EXTERNAL_VECTOR && !could_be_syscall(num)) 371 if (num >= FIRST_EXTERNAL_VECTOR && !could_be_syscall(num))
320 return false; 372 return false;
321 373
322 /* The Host needs to see page faults (for shadow paging and to save the 374 /*
375 * The Host needs to see page faults (for shadow paging and to save the
323 * fault address), general protection faults (in/out emulation) and 376 * fault address), general protection faults (in/out emulation) and
324 * device not available (TS handling), invalid opcode fault (kvm hcall), 377 * device not available (TS handling), invalid opcode fault (kvm hcall),
325 * and of course, the hypercall trap. */ 378 * and of course, the hypercall trap.
379 */
326 return num != 14 && num != 13 && num != 7 && 380 return num != 14 && num != 13 && num != 7 &&
327 num != 6 && num != LGUEST_TRAP_ENTRY; 381 num != 6 && num != LGUEST_TRAP_ENTRY;
328} 382}
329/*:*/ 383/*:*/
330 384
331/*M:005 The Guest has the ability to turn its interrupt gates into trap gates, 385/*M:005
386 * The Guest has the ability to turn its interrupt gates into trap gates,
332 * if it is careful. The Host will let trap gates can go directly to the 387 * if it is careful. The Host will let trap gates can go directly to the
333 * Guest, but the Guest needs the interrupts atomically disabled for an 388 * Guest, but the Guest needs the interrupts atomically disabled for an
334 * interrupt gate. It can do this by pointing the trap gate at instructions 389 * interrupt gate. It can do this by pointing the trap gate at instructions
335 * within noirq_start and noirq_end, where it can safely disable interrupts. */ 390 * within noirq_start and noirq_end, where it can safely disable interrupts.
391 */
336 392
337/*M:006 The Guests do not use the sysenter (fast system call) instruction, 393/*M:006
394 * The Guests do not use the sysenter (fast system call) instruction,
338 * because it's hardcoded to enter privilege level 0 and so can't go direct. 395 * because it's hardcoded to enter privilege level 0 and so can't go direct.
339 * It's about twice as fast as the older "int 0x80" system call, so it might 396 * It's about twice as fast as the older "int 0x80" system call, so it might
340 * still be worthwhile to handle it in the Switcher and lcall down to the 397 * still be worthwhile to handle it in the Switcher and lcall down to the
341 * Guest. The sysenter semantics are hairy tho: search for that keyword in 398 * Guest. The sysenter semantics are hairy tho: search for that keyword in
342 * entry.S :*/ 399 * entry.S
400:*/
343 401
344/*H:260 When we make traps go directly into the Guest, we need to make sure 402/*H:260
403 * When we make traps go directly into the Guest, we need to make sure
345 * the kernel stack is valid (ie. mapped in the page tables). Otherwise, the 404 * the kernel stack is valid (ie. mapped in the page tables). Otherwise, the
346 * CPU trying to deliver the trap will fault while trying to push the interrupt 405 * CPU trying to deliver the trap will fault while trying to push the interrupt
347 * words on the stack: this is called a double fault, and it forces us to kill 406 * words on the stack: this is called a double fault, and it forces us to kill
348 * the Guest. 407 * the Guest.
349 * 408 *
350 * Which is deeply unfair, because (literally!) it wasn't the Guests' fault. */ 409 * Which is deeply unfair, because (literally!) it wasn't the Guests' fault.
410 */
351void pin_stack_pages(struct lg_cpu *cpu) 411void pin_stack_pages(struct lg_cpu *cpu)
352{ 412{
353 unsigned int i; 413 unsigned int i;
354 414
355 /* Depending on the CONFIG_4KSTACKS option, the Guest can have one or 415 /*
356 * two pages of stack space. */ 416 * Depending on the CONFIG_4KSTACKS option, the Guest can have one or
417 * two pages of stack space.
418 */
357 for (i = 0; i < cpu->lg->stack_pages; i++) 419 for (i = 0; i < cpu->lg->stack_pages; i++)
358 /* The stack grows *upwards*, so the address we're given is the 420 /*
421 * The stack grows *upwards*, so the address we're given is the
359 * start of the page after the kernel stack. Subtract one to 422 * start of the page after the kernel stack. Subtract one to
360 * get back onto the first stack page, and keep subtracting to 423 * get back onto the first stack page, and keep subtracting to
361 * get to the rest of the stack pages. */ 424 * get to the rest of the stack pages.
425 */
362 pin_page(cpu, cpu->esp1 - 1 - i * PAGE_SIZE); 426 pin_page(cpu, cpu->esp1 - 1 - i * PAGE_SIZE);
363} 427}
364 428
365/* Direct traps also mean that we need to know whenever the Guest wants to use 429/*
430 * Direct traps also mean that we need to know whenever the Guest wants to use
366 * a different kernel stack, so we can change the IDT entries to use that 431 * a different kernel stack, so we can change the IDT entries to use that
367 * stack. The IDT entries expect a virtual address, so unlike most addresses 432 * stack. The IDT entries expect a virtual address, so unlike most addresses
368 * the Guest gives us, the "esp" (stack pointer) value here is virtual, not 433 * the Guest gives us, the "esp" (stack pointer) value here is virtual, not
369 * physical. 434 * physical.
370 * 435 *
371 * In Linux each process has its own kernel stack, so this happens a lot: we 436 * In Linux each process has its own kernel stack, so this happens a lot: we
372 * change stacks on each context switch. */ 437 * change stacks on each context switch.
438 */
373void guest_set_stack(struct lg_cpu *cpu, u32 seg, u32 esp, unsigned int pages) 439void guest_set_stack(struct lg_cpu *cpu, u32 seg, u32 esp, unsigned int pages)
374{ 440{
375 /* You are not allowed have a stack segment with privilege level 0: bad 441 /*
376 * Guest! */ 442 * You're not allowed a stack segment with privilege level 0: bad Guest!
443 */
377 if ((seg & 0x3) != GUEST_PL) 444 if ((seg & 0x3) != GUEST_PL)
378 kill_guest(cpu, "bad stack segment %i", seg); 445 kill_guest(cpu, "bad stack segment %i", seg);
379 /* We only expect one or two stack pages. */ 446 /* We only expect one or two stack pages. */
@@ -387,11 +454,15 @@ void guest_set_stack(struct lg_cpu *cpu, u32 seg, u32 esp, unsigned int pages)
387 pin_stack_pages(cpu); 454 pin_stack_pages(cpu);
388} 455}
389 456
390/* All this reference to mapping stacks leads us neatly into the other complex 457/*
391 * part of the Host: page table handling. */ 458 * All this reference to mapping stacks leads us neatly into the other complex
459 * part of the Host: page table handling.
460 */
392 461
393/*H:235 This is the routine which actually checks the Guest's IDT entry and 462/*H:235
394 * transfers it into the entry in "struct lguest": */ 463 * This is the routine which actually checks the Guest's IDT entry and
464 * transfers it into the entry in "struct lguest":
465 */
395static void set_trap(struct lg_cpu *cpu, struct desc_struct *trap, 466static void set_trap(struct lg_cpu *cpu, struct desc_struct *trap,
396 unsigned int num, u32 lo, u32 hi) 467 unsigned int num, u32 lo, u32 hi)
397{ 468{
@@ -407,30 +478,38 @@ static void set_trap(struct lg_cpu *cpu, struct desc_struct *trap,
407 if (type != 0xE && type != 0xF) 478 if (type != 0xE && type != 0xF)
408 kill_guest(cpu, "bad IDT type %i", type); 479 kill_guest(cpu, "bad IDT type %i", type);
409 480
410 /* We only copy the handler address, present bit, privilege level and 481 /*
482 * We only copy the handler address, present bit, privilege level and
411 * type. The privilege level controls where the trap can be triggered 483 * type. The privilege level controls where the trap can be triggered
412 * manually with an "int" instruction. This is usually GUEST_PL, 484 * manually with an "int" instruction. This is usually GUEST_PL,
413 * except for system calls which userspace can use. */ 485 * except for system calls which userspace can use.
486 */
414 trap->a = ((__KERNEL_CS|GUEST_PL)<<16) | (lo&0x0000FFFF); 487 trap->a = ((__KERNEL_CS|GUEST_PL)<<16) | (lo&0x0000FFFF);
415 trap->b = (hi&0xFFFFEF00); 488 trap->b = (hi&0xFFFFEF00);
416} 489}
417 490
418/*H:230 While we're here, dealing with delivering traps and interrupts to the 491/*H:230
492 * While we're here, dealing with delivering traps and interrupts to the
419 * Guest, we might as well complete the picture: how the Guest tells us where 493 * Guest, we might as well complete the picture: how the Guest tells us where
420 * it wants them to go. This would be simple, except making traps fast 494 * it wants them to go. This would be simple, except making traps fast
421 * requires some tricks. 495 * requires some tricks.
422 * 496 *
423 * We saw the Guest setting Interrupt Descriptor Table (IDT) entries with the 497 * We saw the Guest setting Interrupt Descriptor Table (IDT) entries with the
424 * LHCALL_LOAD_IDT_ENTRY hypercall before: that comes here. */ 498 * LHCALL_LOAD_IDT_ENTRY hypercall before: that comes here.
499 */
425void load_guest_idt_entry(struct lg_cpu *cpu, unsigned int num, u32 lo, u32 hi) 500void load_guest_idt_entry(struct lg_cpu *cpu, unsigned int num, u32 lo, u32 hi)
426{ 501{
427 /* Guest never handles: NMI, doublefault, spurious interrupt or 502 /*
428 * hypercall. We ignore when it tries to set them. */ 503 * Guest never handles: NMI, doublefault, spurious interrupt or
504 * hypercall. We ignore when it tries to set them.
505 */
429 if (num == 2 || num == 8 || num == 15 || num == LGUEST_TRAP_ENTRY) 506 if (num == 2 || num == 8 || num == 15 || num == LGUEST_TRAP_ENTRY)
430 return; 507 return;
431 508
432 /* Mark the IDT as changed: next time the Guest runs we'll know we have 509 /*
433 * to copy this again. */ 510 * Mark the IDT as changed: next time the Guest runs we'll know we have
511 * to copy this again.
512 */
434 cpu->changed |= CHANGED_IDT; 513 cpu->changed |= CHANGED_IDT;
435 514
436 /* Check that the Guest doesn't try to step outside the bounds. */ 515 /* Check that the Guest doesn't try to step outside the bounds. */
@@ -440,9 +519,11 @@ void load_guest_idt_entry(struct lg_cpu *cpu, unsigned int num, u32 lo, u32 hi)
440 set_trap(cpu, &cpu->arch.idt[num], num, lo, hi); 519 set_trap(cpu, &cpu->arch.idt[num], num, lo, hi);
441} 520}
442 521
443/* The default entry for each interrupt points into the Switcher routines which 522/*
523 * The default entry for each interrupt points into the Switcher routines which
444 * simply return to the Host. The run_guest() loop will then call 524 * simply return to the Host. The run_guest() loop will then call
445 * deliver_trap() to bounce it back into the Guest. */ 525 * deliver_trap() to bounce it back into the Guest.
526 */
446static void default_idt_entry(struct desc_struct *idt, 527static void default_idt_entry(struct desc_struct *idt,
447 int trap, 528 int trap,
448 const unsigned long handler, 529 const unsigned long handler,
@@ -451,13 +532,17 @@ static void default_idt_entry(struct desc_struct *idt,
451 /* A present interrupt gate. */ 532 /* A present interrupt gate. */
452 u32 flags = 0x8e00; 533 u32 flags = 0x8e00;
453 534
454 /* Set the privilege level on the entry for the hypercall: this allows 535 /*
455 * the Guest to use the "int" instruction to trigger it. */ 536 * Set the privilege level on the entry for the hypercall: this allows
537 * the Guest to use the "int" instruction to trigger it.
538 */
456 if (trap == LGUEST_TRAP_ENTRY) 539 if (trap == LGUEST_TRAP_ENTRY)
457 flags |= (GUEST_PL << 13); 540 flags |= (GUEST_PL << 13);
458 else if (base) 541 else if (base)
459 /* Copy priv. level from what Guest asked for. This allows 542 /*
460 * debug (int 3) traps from Guest userspace, for example. */ 543 * Copy privilege level from what Guest asked for. This allows
544 * debug (int 3) traps from Guest userspace, for example.
545 */
461 flags |= (base->b & 0x6000); 546 flags |= (base->b & 0x6000);
462 547
463 /* Now pack it into the IDT entry in its weird format. */ 548 /* Now pack it into the IDT entry in its weird format. */
@@ -475,16 +560,20 @@ void setup_default_idt_entries(struct lguest_ro_state *state,
475 default_idt_entry(&state->guest_idt[i], i, def[i], NULL); 560 default_idt_entry(&state->guest_idt[i], i, def[i], NULL);
476} 561}
477 562
478/*H:240 We don't use the IDT entries in the "struct lguest" directly, instead 563/*H:240
564 * We don't use the IDT entries in the "struct lguest" directly, instead
479 * we copy them into the IDT which we've set up for Guests on this CPU, just 565 * we copy them into the IDT which we've set up for Guests on this CPU, just
480 * before we run the Guest. This routine does that copy. */ 566 * before we run the Guest. This routine does that copy.
567 */
481void copy_traps(const struct lg_cpu *cpu, struct desc_struct *idt, 568void copy_traps(const struct lg_cpu *cpu, struct desc_struct *idt,
482 const unsigned long *def) 569 const unsigned long *def)
483{ 570{
484 unsigned int i; 571 unsigned int i;
485 572
486 /* We can simply copy the direct traps, otherwise we use the default 573 /*
487 * ones in the Switcher: they will return to the Host. */ 574 * We can simply copy the direct traps, otherwise we use the default
575 * ones in the Switcher: they will return to the Host.
576 */
488 for (i = 0; i < ARRAY_SIZE(cpu->arch.idt); i++) { 577 for (i = 0; i < ARRAY_SIZE(cpu->arch.idt); i++) {
489 const struct desc_struct *gidt = &cpu->arch.idt[i]; 578 const struct desc_struct *gidt = &cpu->arch.idt[i];
490 579
@@ -492,14 +581,16 @@ void copy_traps(const struct lg_cpu *cpu, struct desc_struct *idt,
492 if (!direct_trap(i)) 581 if (!direct_trap(i))
493 continue; 582 continue;
494 583
495 /* Only trap gates (type 15) can go direct to the Guest. 584 /*
585 * Only trap gates (type 15) can go direct to the Guest.
496 * Interrupt gates (type 14) disable interrupts as they are 586 * Interrupt gates (type 14) disable interrupts as they are
497 * entered, which we never let the Guest do. Not present 587 * entered, which we never let the Guest do. Not present
498 * entries (type 0x0) also can't go direct, of course. 588 * entries (type 0x0) also can't go direct, of course.
499 * 589 *
500 * If it can't go direct, we still need to copy the priv. level: 590 * If it can't go direct, we still need to copy the priv. level:
501 * they might want to give userspace access to a software 591 * they might want to give userspace access to a software
502 * interrupt. */ 592 * interrupt.
593 */
503 if (idt_type(gidt->a, gidt->b) == 0xF) 594 if (idt_type(gidt->a, gidt->b) == 0xF)
504 idt[i] = *gidt; 595 idt[i] = *gidt;
505 else 596 else
@@ -518,7 +609,8 @@ void copy_traps(const struct lg_cpu *cpu, struct desc_struct *idt,
518 * the next timer interrupt (in nanoseconds). We use the high-resolution timer 609 * the next timer interrupt (in nanoseconds). We use the high-resolution timer
519 * infrastructure to set a callback at that time. 610 * infrastructure to set a callback at that time.
520 * 611 *
521 * 0 means "turn off the clock". */ 612 * 0 means "turn off the clock".
613 */
522void guest_set_clockevent(struct lg_cpu *cpu, unsigned long delta) 614void guest_set_clockevent(struct lg_cpu *cpu, unsigned long delta)
523{ 615{
524 ktime_t expires; 616 ktime_t expires;
@@ -529,9 +621,11 @@ void guest_set_clockevent(struct lg_cpu *cpu, unsigned long delta)
529 return; 621 return;
530 } 622 }
531 623
532 /* We use wallclock time here, so the Guest might not be running for 624 /*
625 * We use wallclock time here, so the Guest might not be running for
533 * all the time between now and the timer interrupt it asked for. This 626 * all the time between now and the timer interrupt it asked for. This
534 * is almost always the right thing to do. */ 627 * is almost always the right thing to do.
628 */
535 expires = ktime_add_ns(ktime_get_real(), delta); 629 expires = ktime_add_ns(ktime_get_real(), delta);
536 hrtimer_start(&cpu->hrt, expires, HRTIMER_MODE_ABS); 630 hrtimer_start(&cpu->hrt, expires, HRTIMER_MODE_ABS);
537} 631}
diff --git a/drivers/lguest/lg.h b/drivers/lguest/lg.h
index d4e8979735cb..bc28745d05af 100644
--- a/drivers/lguest/lg.h
+++ b/drivers/lguest/lg.h
@@ -16,15 +16,13 @@
16void free_pagetables(void); 16void free_pagetables(void);
17int init_pagetables(struct page **switcher_page, unsigned int pages); 17int init_pagetables(struct page **switcher_page, unsigned int pages);
18 18
19struct pgdir 19struct pgdir {
20{
21 unsigned long gpgdir; 20 unsigned long gpgdir;
22 pgd_t *pgdir; 21 pgd_t *pgdir;
23}; 22};
24 23
25/* We have two pages shared with guests, per cpu. */ 24/* We have two pages shared with guests, per cpu. */
26struct lguest_pages 25struct lguest_pages {
27{
28 /* This is the stack page mapped rw in guest */ 26 /* This is the stack page mapped rw in guest */
29 char spare[PAGE_SIZE - sizeof(struct lguest_regs)]; 27 char spare[PAGE_SIZE - sizeof(struct lguest_regs)];
30 struct lguest_regs regs; 28 struct lguest_regs regs;
@@ -38,8 +36,6 @@ struct lguest_pages
38#define CHANGED_GDT_TLS 4 /* Actually a subset of CHANGED_GDT */ 36#define CHANGED_GDT_TLS 4 /* Actually a subset of CHANGED_GDT */
39#define CHANGED_ALL 3 37#define CHANGED_ALL 3
40 38
41struct lguest;
42
43struct lg_cpu { 39struct lg_cpu {
44 unsigned int id; 40 unsigned int id;
45 struct lguest *lg; 41 struct lguest *lg;
@@ -56,13 +52,13 @@ struct lg_cpu {
56 52
57 unsigned long pending_notify; /* pfn from LHCALL_NOTIFY */ 53 unsigned long pending_notify; /* pfn from LHCALL_NOTIFY */
58 54
59 /* At end of a page shared mapped over lguest_pages in guest. */ 55 /* At end of a page shared mapped over lguest_pages in guest. */
60 unsigned long regs_page; 56 unsigned long regs_page;
61 struct lguest_regs *regs; 57 struct lguest_regs *regs;
62 58
63 struct lguest_pages *last_pages; 59 struct lguest_pages *last_pages;
64 60
65 int cpu_pgd; /* which pgd this cpu is currently using */ 61 int cpu_pgd; /* Which pgd this cpu is currently using */
66 62
67 /* If a hypercall was asked for, this points to the arguments. */ 63 /* If a hypercall was asked for, this points to the arguments. */
68 struct hcall_args *hcall; 64 struct hcall_args *hcall;
@@ -82,7 +78,7 @@ struct lg_cpu {
82 78
83struct lg_eventfd { 79struct lg_eventfd {
84 unsigned long addr; 80 unsigned long addr;
85 struct file *event; 81 struct eventfd_ctx *event;
86}; 82};
87 83
88struct lg_eventfd_map { 84struct lg_eventfd_map {
@@ -91,15 +87,17 @@ struct lg_eventfd_map {
91}; 87};
92 88
93/* The private info the thread maintains about the guest. */ 89/* The private info the thread maintains about the guest. */
94struct lguest 90struct lguest {
95{
96 struct lguest_data __user *lguest_data; 91 struct lguest_data __user *lguest_data;
97 struct lg_cpu cpus[NR_CPUS]; 92 struct lg_cpu cpus[NR_CPUS];
98 unsigned int nr_cpus; 93 unsigned int nr_cpus;
99 94
100 u32 pfn_limit; 95 u32 pfn_limit;
101 /* This provides the offset to the base of guest-physical 96
102 * memory in the Launcher. */ 97 /*
98 * This provides the offset to the base of guest-physical memory in the
99 * Launcher.
100 */
103 void __user *mem_base; 101 void __user *mem_base;
104 unsigned long kernel_address; 102 unsigned long kernel_address;
105 103
@@ -124,11 +122,13 @@ bool lguest_address_ok(const struct lguest *lg,
124void __lgread(struct lg_cpu *, void *, unsigned long, unsigned); 122void __lgread(struct lg_cpu *, void *, unsigned long, unsigned);
125void __lgwrite(struct lg_cpu *, unsigned long, const void *, unsigned); 123void __lgwrite(struct lg_cpu *, unsigned long, const void *, unsigned);
126 124
127/*H:035 Using memory-copy operations like that is usually inconvient, so we 125/*H:035
126 * Using memory-copy operations like that is usually inconvient, so we
128 * have the following helper macros which read and write a specific type (often 127 * have the following helper macros which read and write a specific type (often
129 * an unsigned long). 128 * an unsigned long).
130 * 129 *
131 * This reads into a variable of the given type then returns that. */ 130 * This reads into a variable of the given type then returns that.
131 */
132#define lgread(cpu, addr, type) \ 132#define lgread(cpu, addr, type) \
133 ({ type _v; __lgread((cpu), &_v, (addr), sizeof(_v)); _v; }) 133 ({ type _v; __lgread((cpu), &_v, (addr), sizeof(_v)); _v; })
134 134
@@ -142,9 +142,11 @@ void __lgwrite(struct lg_cpu *, unsigned long, const void *, unsigned);
142 142
143int run_guest(struct lg_cpu *cpu, unsigned long __user *user); 143int run_guest(struct lg_cpu *cpu, unsigned long __user *user);
144 144
145/* Helper macros to obtain the first 12 or the last 20 bits, this is only the 145/*
146 * Helper macros to obtain the first 12 or the last 20 bits, this is only the
146 * first step in the migration to the kernel types. pte_pfn is already defined 147 * first step in the migration to the kernel types. pte_pfn is already defined
147 * in the kernel. */ 148 * in the kernel.
149 */
148#define pgd_flags(x) (pgd_val(x) & ~PAGE_MASK) 150#define pgd_flags(x) (pgd_val(x) & ~PAGE_MASK)
149#define pgd_pfn(x) (pgd_val(x) >> PAGE_SHIFT) 151#define pgd_pfn(x) (pgd_val(x) >> PAGE_SHIFT)
150#define pmd_flags(x) (pmd_val(x) & ~PAGE_MASK) 152#define pmd_flags(x) (pmd_val(x) & ~PAGE_MASK)
diff --git a/drivers/lguest/lguest_device.c b/drivers/lguest/lguest_device.c
index e082cdac88b4..b6200bc39b58 100644
--- a/drivers/lguest/lguest_device.c
+++ b/drivers/lguest/lguest_device.c
@@ -1,10 +1,12 @@
1/*P:050 Lguest guests use a very simple method to describe devices. It's a 1/*P:050
2 * Lguest guests use a very simple method to describe devices. It's a
2 * series of device descriptors contained just above the top of normal Guest 3 * series of device descriptors contained just above the top of normal Guest
3 * memory. 4 * memory.
4 * 5 *
5 * We use the standard "virtio" device infrastructure, which provides us with a 6 * We use the standard "virtio" device infrastructure, which provides us with a
6 * console, a network and a block driver. Each one expects some configuration 7 * console, a network and a block driver. Each one expects some configuration
7 * information and a "virtqueue" or two to send and receive data. :*/ 8 * information and a "virtqueue" or two to send and receive data.
9:*/
8#include <linux/init.h> 10#include <linux/init.h>
9#include <linux/bootmem.h> 11#include <linux/bootmem.h>
10#include <linux/lguest_launcher.h> 12#include <linux/lguest_launcher.h>
@@ -20,8 +22,10 @@
20/* The pointer to our (page) of device descriptions. */ 22/* The pointer to our (page) of device descriptions. */
21static void *lguest_devices; 23static void *lguest_devices;
22 24
23/* For Guests, device memory can be used as normal memory, so we cast away the 25/*
24 * __iomem to quieten sparse. */ 26 * For Guests, device memory can be used as normal memory, so we cast away the
27 * __iomem to quieten sparse.
28 */
25static inline void *lguest_map(unsigned long phys_addr, unsigned long pages) 29static inline void *lguest_map(unsigned long phys_addr, unsigned long pages)
26{ 30{
27 return (__force void *)ioremap_cache(phys_addr, PAGE_SIZE*pages); 31 return (__force void *)ioremap_cache(phys_addr, PAGE_SIZE*pages);
@@ -32,8 +36,10 @@ static inline void lguest_unmap(void *addr)
32 iounmap((__force void __iomem *)addr); 36 iounmap((__force void __iomem *)addr);
33} 37}
34 38
35/*D:100 Each lguest device is just a virtio device plus a pointer to its entry 39/*D:100
36 * in the lguest_devices page. */ 40 * Each lguest device is just a virtio device plus a pointer to its entry
41 * in the lguest_devices page.
42 */
37struct lguest_device { 43struct lguest_device {
38 struct virtio_device vdev; 44 struct virtio_device vdev;
39 45
@@ -41,9 +47,11 @@ struct lguest_device {
41 struct lguest_device_desc *desc; 47 struct lguest_device_desc *desc;
42}; 48};
43 49
44/* Since the virtio infrastructure hands us a pointer to the virtio_device all 50/*
51 * Since the virtio infrastructure hands us a pointer to the virtio_device all
45 * the time, it helps to have a curt macro to get a pointer to the struct 52 * the time, it helps to have a curt macro to get a pointer to the struct
46 * lguest_device it's enclosed in. */ 53 * lguest_device it's enclosed in.
54 */
47#define to_lgdev(vd) container_of(vd, struct lguest_device, vdev) 55#define to_lgdev(vd) container_of(vd, struct lguest_device, vdev)
48 56
49/*D:130 57/*D:130
@@ -55,7 +63,8 @@ struct lguest_device {
55 * the driver will look at them during setup. 63 * the driver will look at them during setup.
56 * 64 *
57 * A convenient routine to return the device's virtqueue config array: 65 * A convenient routine to return the device's virtqueue config array:
58 * immediately after the descriptor. */ 66 * immediately after the descriptor.
67 */
59static struct lguest_vqconfig *lg_vq(const struct lguest_device_desc *desc) 68static struct lguest_vqconfig *lg_vq(const struct lguest_device_desc *desc)
60{ 69{
61 return (void *)(desc + 1); 70 return (void *)(desc + 1);
@@ -98,10 +107,12 @@ static u32 lg_get_features(struct virtio_device *vdev)
98 return features; 107 return features;
99} 108}
100 109
101/* The virtio core takes the features the Host offers, and copies the 110/*
102 * ones supported by the driver into the vdev->features array. Once 111 * The virtio core takes the features the Host offers, and copies the ones
103 * that's all sorted out, this routine is called so we can tell the 112 * supported by the driver into the vdev->features array. Once that's all
104 * Host which features we understand and accept. */ 113 * sorted out, this routine is called so we can tell the Host which features we
114 * understand and accept.
115 */
105static void lg_finalize_features(struct virtio_device *vdev) 116static void lg_finalize_features(struct virtio_device *vdev)
106{ 117{
107 unsigned int i, bits; 118 unsigned int i, bits;
@@ -112,10 +123,11 @@ static void lg_finalize_features(struct virtio_device *vdev)
112 /* Give virtio_ring a chance to accept features. */ 123 /* Give virtio_ring a chance to accept features. */
113 vring_transport_features(vdev); 124 vring_transport_features(vdev);
114 125
115 /* The vdev->feature array is a Linux bitmask: this isn't the 126 /*
116 * same as a the simple array of bits used by lguest devices 127 * The vdev->feature array is a Linux bitmask: this isn't the same as a
117 * for features. So we do this slow, manual conversion which is 128 * the simple array of bits used by lguest devices for features. So we
118 * completely general. */ 129 * do this slow, manual conversion which is completely general.
130 */
119 memset(out_features, 0, desc->feature_len); 131 memset(out_features, 0, desc->feature_len);
120 bits = min_t(unsigned, desc->feature_len, sizeof(vdev->features)) * 8; 132 bits = min_t(unsigned, desc->feature_len, sizeof(vdev->features)) * 8;
121 for (i = 0; i < bits; i++) { 133 for (i = 0; i < bits; i++) {
@@ -146,15 +158,19 @@ static void lg_set(struct virtio_device *vdev, unsigned int offset,
146 memcpy(lg_config(desc) + offset, buf, len); 158 memcpy(lg_config(desc) + offset, buf, len);
147} 159}
148 160
149/* The operations to get and set the status word just access the status field 161/*
150 * of the device descriptor. */ 162 * The operations to get and set the status word just access the status field
163 * of the device descriptor.
164 */
151static u8 lg_get_status(struct virtio_device *vdev) 165static u8 lg_get_status(struct virtio_device *vdev)
152{ 166{
153 return to_lgdev(vdev)->desc->status; 167 return to_lgdev(vdev)->desc->status;
154} 168}
155 169
156/* To notify on status updates, we (ab)use the NOTIFY hypercall, with the 170/*
157 * descriptor address of the device. A zero status means "reset". */ 171 * To notify on status updates, we (ab)use the NOTIFY hypercall, with the
172 * descriptor address of the device. A zero status means "reset".
173 */
158static void set_status(struct virtio_device *vdev, u8 status) 174static void set_status(struct virtio_device *vdev, u8 status)
159{ 175{
160 unsigned long offset = (void *)to_lgdev(vdev)->desc - lguest_devices; 176 unsigned long offset = (void *)to_lgdev(vdev)->desc - lguest_devices;
@@ -191,8 +207,7 @@ static void lg_reset(struct virtio_device *vdev)
191 */ 207 */
192 208
193/*D:140 This is the information we remember about each virtqueue. */ 209/*D:140 This is the information we remember about each virtqueue. */
194struct lguest_vq_info 210struct lguest_vq_info {
195{
196 /* A copy of the information contained in the device config. */ 211 /* A copy of the information contained in the device config. */
197 struct lguest_vqconfig config; 212 struct lguest_vqconfig config;
198 213
@@ -200,13 +215,17 @@ struct lguest_vq_info
200 void *pages; 215 void *pages;
201}; 216};
202 217
203/* When the virtio_ring code wants to prod the Host, it calls us here and we 218/*
219 * When the virtio_ring code wants to prod the Host, it calls us here and we
204 * make a hypercall. We hand the physical address of the virtqueue so the Host 220 * make a hypercall. We hand the physical address of the virtqueue so the Host
205 * knows which virtqueue we're talking about. */ 221 * knows which virtqueue we're talking about.
222 */
206static void lg_notify(struct virtqueue *vq) 223static void lg_notify(struct virtqueue *vq)
207{ 224{
208 /* We store our virtqueue information in the "priv" pointer of the 225 /*
209 * virtqueue structure. */ 226 * We store our virtqueue information in the "priv" pointer of the
227 * virtqueue structure.
228 */
210 struct lguest_vq_info *lvq = vq->priv; 229 struct lguest_vq_info *lvq = vq->priv;
211 230
212 kvm_hypercall1(LHCALL_NOTIFY, lvq->config.pfn << PAGE_SHIFT); 231 kvm_hypercall1(LHCALL_NOTIFY, lvq->config.pfn << PAGE_SHIFT);
@@ -215,7 +234,8 @@ static void lg_notify(struct virtqueue *vq)
215/* An extern declaration inside a C file is bad form. Don't do it. */ 234/* An extern declaration inside a C file is bad form. Don't do it. */
216extern void lguest_setup_irq(unsigned int irq); 235extern void lguest_setup_irq(unsigned int irq);
217 236
218/* This routine finds the first virtqueue described in the configuration of 237/*
238 * This routine finds the Nth virtqueue described in the configuration of
219 * this device and sets it up. 239 * this device and sets it up.
220 * 240 *
221 * This is kind of an ugly duckling. It'd be nicer to have a standard 241 * This is kind of an ugly duckling. It'd be nicer to have a standard
@@ -223,9 +243,7 @@ extern void lguest_setup_irq(unsigned int irq);
223 * everyone wants to do it differently. The KVM coders want the Guest to 243 * everyone wants to do it differently. The KVM coders want the Guest to
224 * allocate its own pages and tell the Host where they are, but for lguest it's 244 * allocate its own pages and tell the Host where they are, but for lguest it's
225 * simpler for the Host to simply tell us where the pages are. 245 * simpler for the Host to simply tell us where the pages are.
226 * 246 */
227 * So we provide drivers with a "find the Nth virtqueue and set it up"
228 * function. */
229static struct virtqueue *lg_find_vq(struct virtio_device *vdev, 247static struct virtqueue *lg_find_vq(struct virtio_device *vdev,
230 unsigned index, 248 unsigned index,
231 void (*callback)(struct virtqueue *vq), 249 void (*callback)(struct virtqueue *vq),
@@ -244,9 +262,11 @@ static struct virtqueue *lg_find_vq(struct virtio_device *vdev,
244 if (!lvq) 262 if (!lvq)
245 return ERR_PTR(-ENOMEM); 263 return ERR_PTR(-ENOMEM);
246 264
247 /* Make a copy of the "struct lguest_vqconfig" entry, which sits after 265 /*
266 * Make a copy of the "struct lguest_vqconfig" entry, which sits after
248 * the descriptor. We need a copy because the config space might not 267 * the descriptor. We need a copy because the config space might not
249 * be aligned correctly. */ 268 * be aligned correctly.
269 */
250 memcpy(&lvq->config, lg_vq(ldev->desc)+index, sizeof(lvq->config)); 270 memcpy(&lvq->config, lg_vq(ldev->desc)+index, sizeof(lvq->config));
251 271
252 printk("Mapping virtqueue %i addr %lx\n", index, 272 printk("Mapping virtqueue %i addr %lx\n", index,
@@ -261,8 +281,10 @@ static struct virtqueue *lg_find_vq(struct virtio_device *vdev,
261 goto free_lvq; 281 goto free_lvq;
262 } 282 }
263 283
264 /* OK, tell virtio_ring.c to set up a virtqueue now we know its size 284 /*
265 * and we've got a pointer to its pages. */ 285 * OK, tell virtio_ring.c to set up a virtqueue now we know its size
286 * and we've got a pointer to its pages.
287 */
266 vq = vring_new_virtqueue(lvq->config.num, LGUEST_VRING_ALIGN, 288 vq = vring_new_virtqueue(lvq->config.num, LGUEST_VRING_ALIGN,
267 vdev, lvq->pages, lg_notify, callback, name); 289 vdev, lvq->pages, lg_notify, callback, name);
268 if (!vq) { 290 if (!vq) {
@@ -273,18 +295,23 @@ static struct virtqueue *lg_find_vq(struct virtio_device *vdev,
273 /* Make sure the interrupt is allocated. */ 295 /* Make sure the interrupt is allocated. */
274 lguest_setup_irq(lvq->config.irq); 296 lguest_setup_irq(lvq->config.irq);
275 297
276 /* Tell the interrupt for this virtqueue to go to the virtio_ring 298 /*
277 * interrupt handler. */ 299 * Tell the interrupt for this virtqueue to go to the virtio_ring
278 /* FIXME: We used to have a flag for the Host to tell us we could use 300 * interrupt handler.
301 *
302 * FIXME: We used to have a flag for the Host to tell us we could use
279 * the interrupt as a source of randomness: it'd be nice to have that 303 * the interrupt as a source of randomness: it'd be nice to have that
280 * back.. */ 304 * back.
305 */
281 err = request_irq(lvq->config.irq, vring_interrupt, IRQF_SHARED, 306 err = request_irq(lvq->config.irq, vring_interrupt, IRQF_SHARED,
282 dev_name(&vdev->dev), vq); 307 dev_name(&vdev->dev), vq);
283 if (err) 308 if (err)
284 goto destroy_vring; 309 goto destroy_vring;
285 310
286 /* Last of all we hook up our 'struct lguest_vq_info" to the 311 /*
287 * virtqueue's priv pointer. */ 312 * Last of all we hook up our 'struct lguest_vq_info" to the
313 * virtqueue's priv pointer.
314 */
288 vq->priv = lvq; 315 vq->priv = lvq;
289 return vq; 316 return vq;
290 317
@@ -358,11 +385,14 @@ static struct virtio_config_ops lguest_config_ops = {
358 .del_vqs = lg_del_vqs, 385 .del_vqs = lg_del_vqs,
359}; 386};
360 387
361/* The root device for the lguest virtio devices. This makes them appear as 388/*
362 * /sys/devices/lguest/0,1,2 not /sys/devices/0,1,2. */ 389 * The root device for the lguest virtio devices. This makes them appear as
390 * /sys/devices/lguest/0,1,2 not /sys/devices/0,1,2.
391 */
363static struct device *lguest_root; 392static struct device *lguest_root;
364 393
365/*D:120 This is the core of the lguest bus: actually adding a new device. 394/*D:120
395 * This is the core of the lguest bus: actually adding a new device.
366 * It's a separate function because it's neater that way, and because an 396 * It's a separate function because it's neater that way, and because an
367 * earlier version of the code supported hotplug and unplug. They were removed 397 * earlier version of the code supported hotplug and unplug. They were removed
368 * early on because they were never used. 398 * early on because they were never used.
@@ -371,14 +401,14 @@ static struct device *lguest_root;
371 * 401 *
372 * It's worth reading this carefully: we start with a pointer to the new device 402 * It's worth reading this carefully: we start with a pointer to the new device
373 * descriptor in the "lguest_devices" page, and the offset into the device 403 * descriptor in the "lguest_devices" page, and the offset into the device
374 * descriptor page so we can uniquely identify it if things go badly wrong. */ 404 * descriptor page so we can uniquely identify it if things go badly wrong.
405 */
375static void add_lguest_device(struct lguest_device_desc *d, 406static void add_lguest_device(struct lguest_device_desc *d,
376 unsigned int offset) 407 unsigned int offset)
377{ 408{
378 struct lguest_device *ldev; 409 struct lguest_device *ldev;
379 410
380 /* Start with zeroed memory; Linux's device layer seems to count on 411 /* Start with zeroed memory; Linux's device layer counts on it. */
381 * it. */
382 ldev = kzalloc(sizeof(*ldev), GFP_KERNEL); 412 ldev = kzalloc(sizeof(*ldev), GFP_KERNEL);
383 if (!ldev) { 413 if (!ldev) {
384 printk(KERN_EMERG "Cannot allocate lguest dev %u type %u\n", 414 printk(KERN_EMERG "Cannot allocate lguest dev %u type %u\n",
@@ -388,17 +418,25 @@ static void add_lguest_device(struct lguest_device_desc *d,
388 418
389 /* This devices' parent is the lguest/ dir. */ 419 /* This devices' parent is the lguest/ dir. */
390 ldev->vdev.dev.parent = lguest_root; 420 ldev->vdev.dev.parent = lguest_root;
391 /* We have a unique device index thanks to the dev_index counter. */ 421 /*
422 * The device type comes straight from the descriptor. There's also a
423 * device vendor field in the virtio_device struct, which we leave as
424 * 0.
425 */
392 ldev->vdev.id.device = d->type; 426 ldev->vdev.id.device = d->type;
393 /* We have a simple set of routines for querying the device's 427 /*
394 * configuration information and setting its status. */ 428 * We have a simple set of routines for querying the device's
429 * configuration information and setting its status.
430 */
395 ldev->vdev.config = &lguest_config_ops; 431 ldev->vdev.config = &lguest_config_ops;
396 /* And we remember the device's descriptor for lguest_config_ops. */ 432 /* And we remember the device's descriptor for lguest_config_ops. */
397 ldev->desc = d; 433 ldev->desc = d;
398 434
399 /* register_virtio_device() sets up the generic fields for the struct 435 /*
436 * register_virtio_device() sets up the generic fields for the struct
400 * virtio_device and calls device_register(). This makes the bus 437 * virtio_device and calls device_register(). This makes the bus
401 * infrastructure look for a matching driver. */ 438 * infrastructure look for a matching driver.
439 */
402 if (register_virtio_device(&ldev->vdev) != 0) { 440 if (register_virtio_device(&ldev->vdev) != 0) {
403 printk(KERN_ERR "Failed to register lguest dev %u type %u\n", 441 printk(KERN_ERR "Failed to register lguest dev %u type %u\n",
404 offset, d->type); 442 offset, d->type);
@@ -406,8 +444,10 @@ static void add_lguest_device(struct lguest_device_desc *d,
406 } 444 }
407} 445}
408 446
409/*D:110 scan_devices() simply iterates through the device page. The type 0 is 447/*D:110
410 * reserved to mean "end of devices". */ 448 * scan_devices() simply iterates through the device page. The type 0 is
449 * reserved to mean "end of devices".
450 */
411static void scan_devices(void) 451static void scan_devices(void)
412{ 452{
413 unsigned int i; 453 unsigned int i;
@@ -426,7 +466,8 @@ static void scan_devices(void)
426 } 466 }
427} 467}
428 468
429/*D:105 Fairly early in boot, lguest_devices_init() is called to set up the 469/*D:105
470 * Fairly early in boot, lguest_devices_init() is called to set up the
430 * lguest device infrastructure. We check that we are a Guest by checking 471 * lguest device infrastructure. We check that we are a Guest by checking
431 * pv_info.name: there are other ways of checking, but this seems most 472 * pv_info.name: there are other ways of checking, but this seems most
432 * obvious to me. 473 * obvious to me.
@@ -437,7 +478,8 @@ static void scan_devices(void)
437 * correct sysfs incantation). 478 * correct sysfs incantation).
438 * 479 *
439 * Finally we call scan_devices() which adds all the devices found in the 480 * Finally we call scan_devices() which adds all the devices found in the
440 * lguest_devices page. */ 481 * lguest_devices page.
482 */
441static int __init lguest_devices_init(void) 483static int __init lguest_devices_init(void)
442{ 484{
443 if (strcmp(pv_info.name, "lguest") != 0) 485 if (strcmp(pv_info.name, "lguest") != 0)
@@ -456,11 +498,13 @@ static int __init lguest_devices_init(void)
456/* We do this after core stuff, but before the drivers. */ 498/* We do this after core stuff, but before the drivers. */
457postcore_initcall(lguest_devices_init); 499postcore_initcall(lguest_devices_init);
458 500
459/*D:150 At this point in the journey we used to now wade through the lguest 501/*D:150
502 * At this point in the journey we used to now wade through the lguest
460 * devices themselves: net, block and console. Since they're all now virtio 503 * devices themselves: net, block and console. Since they're all now virtio
461 * devices rather than lguest-specific, I've decided to ignore them. Mostly, 504 * devices rather than lguest-specific, I've decided to ignore them. Mostly,
462 * they're kind of boring. But this does mean you'll never experience the 505 * they're kind of boring. But this does mean you'll never experience the
463 * thrill of reading the forbidden love scene buried deep in the block driver. 506 * thrill of reading the forbidden love scene buried deep in the block driver.
464 * 507 *
465 * "make Launcher" beckons, where we answer questions like "Where do Guests 508 * "make Launcher" beckons, where we answer questions like "Where do Guests
466 * come from?", and "What do you do when someone asks for optimization?". */ 509 * come from?", and "What do you do when someone asks for optimization?".
510 */
diff --git a/drivers/lguest/lguest_user.c b/drivers/lguest/lguest_user.c
index 32e297121058..b4d3f7ca554f 100644
--- a/drivers/lguest/lguest_user.c
+++ b/drivers/lguest/lguest_user.c
@@ -1,8 +1,9 @@
1/*P:200 This contains all the /dev/lguest code, whereby the userspace launcher 1/*P:200 This contains all the /dev/lguest code, whereby the userspace launcher
2 * controls and communicates with the Guest. For example, the first write will 2 * controls and communicates with the Guest. For example, the first write will
3 * tell us the Guest's memory layout, pagetable, entry point and kernel address 3 * tell us the Guest's memory layout and entry point. A read will run the
4 * offset. A read will run the Guest until something happens, such as a signal 4 * Guest until something happens, such as a signal or the Guest doing a NOTIFY
5 * or the Guest doing a NOTIFY out to the Launcher. :*/ 5 * out to the Launcher.
6:*/
6#include <linux/uaccess.h> 7#include <linux/uaccess.h>
7#include <linux/miscdevice.h> 8#include <linux/miscdevice.h>
8#include <linux/fs.h> 9#include <linux/fs.h>
@@ -11,14 +12,41 @@
11#include <linux/file.h> 12#include <linux/file.h>
12#include "lg.h" 13#include "lg.h"
13 14
15/*L:056
16 * Before we move on, let's jump ahead and look at what the kernel does when
17 * it needs to look up the eventfds. That will complete our picture of how we
18 * use RCU.
19 *
20 * The notification value is in cpu->pending_notify: we return true if it went
21 * to an eventfd.
22 */
14bool send_notify_to_eventfd(struct lg_cpu *cpu) 23bool send_notify_to_eventfd(struct lg_cpu *cpu)
15{ 24{
16 unsigned int i; 25 unsigned int i;
17 struct lg_eventfd_map *map; 26 struct lg_eventfd_map *map;
18 27
19 /* lg->eventfds is RCU-protected */ 28 /*
29 * This "rcu_read_lock()" helps track when someone is still looking at
30 * the (RCU-using) eventfds array. It's not actually a lock at all;
31 * indeed it's a noop in many configurations. (You didn't expect me to
32 * explain all the RCU secrets here, did you?)
33 */
20 rcu_read_lock(); 34 rcu_read_lock();
35 /*
36 * rcu_dereference is the counter-side of rcu_assign_pointer(); it
37 * makes sure we don't access the memory pointed to by
38 * cpu->lg->eventfds before cpu->lg->eventfds is set. Sounds crazy,
39 * but Alpha allows this! Paul McKenney points out that a really
40 * aggressive compiler could have the same effect:
41 * http://lists.ozlabs.org/pipermail/lguest/2009-July/001560.html
42 *
43 * So play safe, use rcu_dereference to get the rcu-protected pointer:
44 */
21 map = rcu_dereference(cpu->lg->eventfds); 45 map = rcu_dereference(cpu->lg->eventfds);
46 /*
47 * Simple array search: even if they add an eventfd while we do this,
48 * we'll continue to use the old array and just won't see the new one.
49 */
22 for (i = 0; i < map->num; i++) { 50 for (i = 0; i < map->num; i++) {
23 if (map->map[i].addr == cpu->pending_notify) { 51 if (map->map[i].addr == cpu->pending_notify) {
24 eventfd_signal(map->map[i].event, 1); 52 eventfd_signal(map->map[i].event, 1);
@@ -26,19 +54,50 @@ bool send_notify_to_eventfd(struct lg_cpu *cpu)
26 break; 54 break;
27 } 55 }
28 } 56 }
57 /* We're done with the rcu-protected variable cpu->lg->eventfds. */
29 rcu_read_unlock(); 58 rcu_read_unlock();
59
60 /* If we cleared the notification, it's because we found a match. */
30 return cpu->pending_notify == 0; 61 return cpu->pending_notify == 0;
31} 62}
32 63
64/*L:055
65 * One of the more tricksy tricks in the Linux Kernel is a technique called
66 * Read Copy Update. Since one point of lguest is to teach lguest journeyers
67 * about kernel coding, I use it here. (In case you're curious, other purposes
68 * include learning about virtualization and instilling a deep appreciation for
69 * simplicity and puppies).
70 *
71 * We keep a simple array which maps LHCALL_NOTIFY values to eventfds, but we
72 * add new eventfds without ever blocking readers from accessing the array.
73 * The current Launcher only does this during boot, so that never happens. But
74 * Read Copy Update is cool, and adding a lock risks damaging even more puppies
75 * than this code does.
76 *
77 * We allocate a brand new one-larger array, copy the old one and add our new
78 * element. Then we make the lg eventfd pointer point to the new array.
79 * That's the easy part: now we need to free the old one, but we need to make
80 * sure no slow CPU somewhere is still looking at it. That's what
81 * synchronize_rcu does for us: waits until every CPU has indicated that it has
82 * moved on to know it's no longer using the old one.
83 *
84 * If that's unclear, see http://en.wikipedia.org/wiki/Read-copy-update.
85 */
33static int add_eventfd(struct lguest *lg, unsigned long addr, int fd) 86static int add_eventfd(struct lguest *lg, unsigned long addr, int fd)
34{ 87{
35 struct lg_eventfd_map *new, *old = lg->eventfds; 88 struct lg_eventfd_map *new, *old = lg->eventfds;
36 89
90 /*
91 * We don't allow notifications on value 0 anyway (pending_notify of
92 * 0 means "nothing pending").
93 */
37 if (!addr) 94 if (!addr)
38 return -EINVAL; 95 return -EINVAL;
39 96
40 /* Replace the old array with the new one, carefully: others can 97 /*
41 * be accessing it at the same time */ 98 * Replace the old array with the new one, carefully: others can
99 * be accessing it at the same time.
100 */
42 new = kmalloc(sizeof(*new) + sizeof(new->map[0]) * (old->num + 1), 101 new = kmalloc(sizeof(*new) + sizeof(new->map[0]) * (old->num + 1),
43 GFP_KERNEL); 102 GFP_KERNEL);
44 if (!new) 103 if (!new)
@@ -50,24 +109,43 @@ static int add_eventfd(struct lguest *lg, unsigned long addr, int fd)
50 109
51 /* Now append new entry. */ 110 /* Now append new entry. */
52 new->map[new->num].addr = addr; 111 new->map[new->num].addr = addr;
53 new->map[new->num].event = eventfd_fget(fd); 112 new->map[new->num].event = eventfd_ctx_fdget(fd);
54 if (IS_ERR(new->map[new->num].event)) { 113 if (IS_ERR(new->map[new->num].event)) {
114 int err = PTR_ERR(new->map[new->num].event);
55 kfree(new); 115 kfree(new);
56 return PTR_ERR(new->map[new->num].event); 116 return err;
57 } 117 }
58 new->num++; 118 new->num++;
59 119
60 /* Now put new one in place. */ 120 /*
121 * Now put new one in place: rcu_assign_pointer() is a fancy way of
122 * doing "lg->eventfds = new", but it uses memory barriers to make
123 * absolutely sure that the contents of "new" written above is nailed
124 * down before we actually do the assignment.
125 *
126 * We have to think about these kinds of things when we're operating on
127 * live data without locks.
128 */
61 rcu_assign_pointer(lg->eventfds, new); 129 rcu_assign_pointer(lg->eventfds, new);
62 130
63 /* We're not in a big hurry. Wait until noone's looking at old 131 /*
64 * version, then delete it. */ 132 * We're not in a big hurry. Wait until noone's looking at old
133 * version, then free it.
134 */
65 synchronize_rcu(); 135 synchronize_rcu();
66 kfree(old); 136 kfree(old);
67 137
68 return 0; 138 return 0;
69} 139}
70 140
141/*L:052
142 * Receiving notifications from the Guest is usually done by attaching a
143 * particular LHCALL_NOTIFY value to an event filedescriptor. The eventfd will
144 * become readable when the Guest does an LHCALL_NOTIFY with that value.
145 *
146 * This is really convenient for processing each virtqueue in a separate
147 * thread.
148 */
71static int attach_eventfd(struct lguest *lg, const unsigned long __user *input) 149static int attach_eventfd(struct lguest *lg, const unsigned long __user *input)
72{ 150{
73 unsigned long addr, fd; 151 unsigned long addr, fd;
@@ -79,15 +157,22 @@ static int attach_eventfd(struct lguest *lg, const unsigned long __user *input)
79 if (get_user(fd, input) != 0) 157 if (get_user(fd, input) != 0)
80 return -EFAULT; 158 return -EFAULT;
81 159
160 /*
161 * Just make sure two callers don't add eventfds at once. We really
162 * only need to lock against callers adding to the same Guest, so using
163 * the Big Lguest Lock is overkill. But this is setup, not a fast path.
164 */
82 mutex_lock(&lguest_lock); 165 mutex_lock(&lguest_lock);
83 err = add_eventfd(lg, addr, fd); 166 err = add_eventfd(lg, addr, fd);
84 mutex_unlock(&lguest_lock); 167 mutex_unlock(&lguest_lock);
85 168
86 return 0; 169 return err;
87} 170}
88 171
89/*L:050 Sending an interrupt is done by writing LHREQ_IRQ and an interrupt 172/*L:050
90 * number to /dev/lguest. */ 173 * Sending an interrupt is done by writing LHREQ_IRQ and an interrupt
174 * number to /dev/lguest.
175 */
91static int user_send_irq(struct lg_cpu *cpu, const unsigned long __user *input) 176static int user_send_irq(struct lg_cpu *cpu, const unsigned long __user *input)
92{ 177{
93 unsigned long irq; 178 unsigned long irq;
@@ -97,12 +182,18 @@ static int user_send_irq(struct lg_cpu *cpu, const unsigned long __user *input)
97 if (irq >= LGUEST_IRQS) 182 if (irq >= LGUEST_IRQS)
98 return -EINVAL; 183 return -EINVAL;
99 184
185 /*
186 * Next time the Guest runs, the core code will see if it can deliver
187 * this interrupt.
188 */
100 set_interrupt(cpu, irq); 189 set_interrupt(cpu, irq);
101 return 0; 190 return 0;
102} 191}
103 192
104/*L:040 Once our Guest is initialized, the Launcher makes it run by reading 193/*L:040
105 * from /dev/lguest. */ 194 * Once our Guest is initialized, the Launcher makes it run by reading
195 * from /dev/lguest.
196 */
106static ssize_t read(struct file *file, char __user *user, size_t size,loff_t*o) 197static ssize_t read(struct file *file, char __user *user, size_t size,loff_t*o)
107{ 198{
108 struct lguest *lg = file->private_data; 199 struct lguest *lg = file->private_data;
@@ -138,8 +229,10 @@ static ssize_t read(struct file *file, char __user *user, size_t size,loff_t*o)
138 return len; 229 return len;
139 } 230 }
140 231
141 /* If we returned from read() last time because the Guest sent I/O, 232 /*
142 * clear the flag. */ 233 * If we returned from read() last time because the Guest sent I/O,
234 * clear the flag.
235 */
143 if (cpu->pending_notify) 236 if (cpu->pending_notify)
144 cpu->pending_notify = 0; 237 cpu->pending_notify = 0;
145 238
@@ -147,8 +240,10 @@ static ssize_t read(struct file *file, char __user *user, size_t size,loff_t*o)
147 return run_guest(cpu, (unsigned long __user *)user); 240 return run_guest(cpu, (unsigned long __user *)user);
148} 241}
149 242
150/*L:025 This actually initializes a CPU. For the moment, a Guest is only 243/*L:025
151 * uniprocessor, so "id" is always 0. */ 244 * This actually initializes a CPU. For the moment, a Guest is only
245 * uniprocessor, so "id" is always 0.
246 */
152static int lg_cpu_start(struct lg_cpu *cpu, unsigned id, unsigned long start_ip) 247static int lg_cpu_start(struct lg_cpu *cpu, unsigned id, unsigned long start_ip)
153{ 248{
154 /* We have a limited number the number of CPUs in the lguest struct. */ 249 /* We have a limited number the number of CPUs in the lguest struct. */
@@ -163,8 +258,10 @@ static int lg_cpu_start(struct lg_cpu *cpu, unsigned id, unsigned long start_ip)
163 /* Each CPU has a timer it can set. */ 258 /* Each CPU has a timer it can set. */
164 init_clockdev(cpu); 259 init_clockdev(cpu);
165 260
166 /* We need a complete page for the Guest registers: they are accessible 261 /*
167 * to the Guest and we can only grant it access to whole pages. */ 262 * We need a complete page for the Guest registers: they are accessible
263 * to the Guest and we can only grant it access to whole pages.
264 */
168 cpu->regs_page = get_zeroed_page(GFP_KERNEL); 265 cpu->regs_page = get_zeroed_page(GFP_KERNEL);
169 if (!cpu->regs_page) 266 if (!cpu->regs_page)
170 return -ENOMEM; 267 return -ENOMEM;
@@ -172,29 +269,38 @@ static int lg_cpu_start(struct lg_cpu *cpu, unsigned id, unsigned long start_ip)
172 /* We actually put the registers at the bottom of the page. */ 269 /* We actually put the registers at the bottom of the page. */
173 cpu->regs = (void *)cpu->regs_page + PAGE_SIZE - sizeof(*cpu->regs); 270 cpu->regs = (void *)cpu->regs_page + PAGE_SIZE - sizeof(*cpu->regs);
174 271
175 /* Now we initialize the Guest's registers, handing it the start 272 /*
176 * address. */ 273 * Now we initialize the Guest's registers, handing it the start
274 * address.
275 */
177 lguest_arch_setup_regs(cpu, start_ip); 276 lguest_arch_setup_regs(cpu, start_ip);
178 277
179 /* We keep a pointer to the Launcher task (ie. current task) for when 278 /*
180 * other Guests want to wake this one (eg. console input). */ 279 * We keep a pointer to the Launcher task (ie. current task) for when
280 * other Guests want to wake this one (eg. console input).
281 */
181 cpu->tsk = current; 282 cpu->tsk = current;
182 283
183 /* We need to keep a pointer to the Launcher's memory map, because if 284 /*
285 * We need to keep a pointer to the Launcher's memory map, because if
184 * the Launcher dies we need to clean it up. If we don't keep a 286 * the Launcher dies we need to clean it up. If we don't keep a
185 * reference, it is destroyed before close() is called. */ 287 * reference, it is destroyed before close() is called.
288 */
186 cpu->mm = get_task_mm(cpu->tsk); 289 cpu->mm = get_task_mm(cpu->tsk);
187 290
188 /* We remember which CPU's pages this Guest used last, for optimization 291 /*
189 * when the same Guest runs on the same CPU twice. */ 292 * We remember which CPU's pages this Guest used last, for optimization
293 * when the same Guest runs on the same CPU twice.
294 */
190 cpu->last_pages = NULL; 295 cpu->last_pages = NULL;
191 296
192 /* No error == success. */ 297 /* No error == success. */
193 return 0; 298 return 0;
194} 299}
195 300
196/*L:020 The initialization write supplies 3 pointer sized (32 or 64 bit) 301/*L:020
197 * values (in addition to the LHREQ_INITIALIZE value). These are: 302 * The initialization write supplies 3 pointer sized (32 or 64 bit) values (in
303 * addition to the LHREQ_INITIALIZE value). These are:
198 * 304 *
199 * base: The start of the Guest-physical memory inside the Launcher memory. 305 * base: The start of the Guest-physical memory inside the Launcher memory.
200 * 306 *
@@ -206,14 +312,15 @@ static int lg_cpu_start(struct lg_cpu *cpu, unsigned id, unsigned long start_ip)
206 */ 312 */
207static int initialize(struct file *file, const unsigned long __user *input) 313static int initialize(struct file *file, const unsigned long __user *input)
208{ 314{
209 /* "struct lguest" contains everything we (the Host) know about a 315 /* "struct lguest" contains all we (the Host) know about a Guest. */
210 * Guest. */
211 struct lguest *lg; 316 struct lguest *lg;
212 int err; 317 int err;
213 unsigned long args[3]; 318 unsigned long args[3];
214 319
215 /* We grab the Big Lguest lock, which protects against multiple 320 /*
216 * simultaneous initializations. */ 321 * We grab the Big Lguest lock, which protects against multiple
322 * simultaneous initializations.
323 */
217 mutex_lock(&lguest_lock); 324 mutex_lock(&lguest_lock);
218 /* You can't initialize twice! Close the device and start again... */ 325 /* You can't initialize twice! Close the device and start again... */
219 if (file->private_data) { 326 if (file->private_data) {
@@ -248,8 +355,10 @@ static int initialize(struct file *file, const unsigned long __user *input)
248 if (err) 355 if (err)
249 goto free_eventfds; 356 goto free_eventfds;
250 357
251 /* Initialize the Guest's shadow page tables, using the toplevel 358 /*
252 * address the Launcher gave us. This allocates memory, so can fail. */ 359 * Initialize the Guest's shadow page tables, using the toplevel
360 * address the Launcher gave us. This allocates memory, so can fail.
361 */
253 err = init_guest_pagetable(lg); 362 err = init_guest_pagetable(lg);
254 if (err) 363 if (err)
255 goto free_regs; 364 goto free_regs;
@@ -274,20 +383,24 @@ unlock:
274 return err; 383 return err;
275} 384}
276 385
277/*L:010 The first operation the Launcher does must be a write. All writes 386/*L:010
387 * The first operation the Launcher does must be a write. All writes
278 * start with an unsigned long number: for the first write this must be 388 * start with an unsigned long number: for the first write this must be
279 * LHREQ_INITIALIZE to set up the Guest. After that the Launcher can use 389 * LHREQ_INITIALIZE to set up the Guest. After that the Launcher can use
280 * writes of other values to send interrupts. 390 * writes of other values to send interrupts or set up receipt of notifications.
281 * 391 *
282 * Note that we overload the "offset" in the /dev/lguest file to indicate what 392 * Note that we overload the "offset" in the /dev/lguest file to indicate what
283 * CPU number we're dealing with. Currently this is always 0, since we only 393 * CPU number we're dealing with. Currently this is always 0 since we only
284 * support uniprocessor Guests, but you can see the beginnings of SMP support 394 * support uniprocessor Guests, but you can see the beginnings of SMP support
285 * here. */ 395 * here.
396 */
286static ssize_t write(struct file *file, const char __user *in, 397static ssize_t write(struct file *file, const char __user *in,
287 size_t size, loff_t *off) 398 size_t size, loff_t *off)
288{ 399{
289 /* Once the Guest is initialized, we hold the "struct lguest" in the 400 /*
290 * file private data. */ 401 * Once the Guest is initialized, we hold the "struct lguest" in the
402 * file private data.
403 */
291 struct lguest *lg = file->private_data; 404 struct lguest *lg = file->private_data;
292 const unsigned long __user *input = (const unsigned long __user *)in; 405 const unsigned long __user *input = (const unsigned long __user *)in;
293 unsigned long req; 406 unsigned long req;
@@ -322,13 +435,15 @@ static ssize_t write(struct file *file, const char __user *in,
322 } 435 }
323} 436}
324 437
325/*L:060 The final piece of interface code is the close() routine. It reverses 438/*L:060
439 * The final piece of interface code is the close() routine. It reverses
326 * everything done in initialize(). This is usually called because the 440 * everything done in initialize(). This is usually called because the
327 * Launcher exited. 441 * Launcher exited.
328 * 442 *
329 * Note that the close routine returns 0 or a negative error number: it can't 443 * Note that the close routine returns 0 or a negative error number: it can't
330 * really fail, but it can whine. I blame Sun for this wart, and K&R C for 444 * really fail, but it can whine. I blame Sun for this wart, and K&R C for
331 * letting them do it. :*/ 445 * letting them do it.
446:*/
332static int close(struct inode *inode, struct file *file) 447static int close(struct inode *inode, struct file *file)
333{ 448{
334 struct lguest *lg = file->private_data; 449 struct lguest *lg = file->private_data;
@@ -338,8 +453,10 @@ static int close(struct inode *inode, struct file *file)
338 if (!lg) 453 if (!lg)
339 return 0; 454 return 0;
340 455
341 /* We need the big lock, to protect from inter-guest I/O and other 456 /*
342 * Launchers initializing guests. */ 457 * We need the big lock, to protect from inter-guest I/O and other
458 * Launchers initializing guests.
459 */
343 mutex_lock(&lguest_lock); 460 mutex_lock(&lguest_lock);
344 461
345 /* Free up the shadow page tables for the Guest. */ 462 /* Free up the shadow page tables for the Guest. */
@@ -350,18 +467,22 @@ static int close(struct inode *inode, struct file *file)
350 hrtimer_cancel(&lg->cpus[i].hrt); 467 hrtimer_cancel(&lg->cpus[i].hrt);
351 /* We can free up the register page we allocated. */ 468 /* We can free up the register page we allocated. */
352 free_page(lg->cpus[i].regs_page); 469 free_page(lg->cpus[i].regs_page);
353 /* Now all the memory cleanups are done, it's safe to release 470 /*
354 * the Launcher's memory management structure. */ 471 * Now all the memory cleanups are done, it's safe to release
472 * the Launcher's memory management structure.
473 */
355 mmput(lg->cpus[i].mm); 474 mmput(lg->cpus[i].mm);
356 } 475 }
357 476
358 /* Release any eventfds they registered. */ 477 /* Release any eventfds they registered. */
359 for (i = 0; i < lg->eventfds->num; i++) 478 for (i = 0; i < lg->eventfds->num; i++)
360 fput(lg->eventfds->map[i].event); 479 eventfd_ctx_put(lg->eventfds->map[i].event);
361 kfree(lg->eventfds); 480 kfree(lg->eventfds);
362 481
363 /* If lg->dead doesn't contain an error code it will be NULL or a 482 /*
364 * kmalloc()ed string, either of which is ok to hand to kfree(). */ 483 * If lg->dead doesn't contain an error code it will be NULL or a
484 * kmalloc()ed string, either of which is ok to hand to kfree().
485 */
365 if (!IS_ERR(lg->dead)) 486 if (!IS_ERR(lg->dead))
366 kfree(lg->dead); 487 kfree(lg->dead);
367 /* Free the memory allocated to the lguest_struct */ 488 /* Free the memory allocated to the lguest_struct */
@@ -385,7 +506,8 @@ static int close(struct inode *inode, struct file *file)
385 * 506 *
386 * We begin our understanding with the Host kernel interface which the Launcher 507 * We begin our understanding with the Host kernel interface which the Launcher
387 * uses: reading and writing a character device called /dev/lguest. All the 508 * uses: reading and writing a character device called /dev/lguest. All the
388 * work happens in the read(), write() and close() routines: */ 509 * work happens in the read(), write() and close() routines:
510 */
389static struct file_operations lguest_fops = { 511static struct file_operations lguest_fops = {
390 .owner = THIS_MODULE, 512 .owner = THIS_MODULE,
391 .release = close, 513 .release = close,
@@ -393,8 +515,10 @@ static struct file_operations lguest_fops = {
393 .read = read, 515 .read = read,
394}; 516};
395 517
396/* This is a textbook example of a "misc" character device. Populate a "struct 518/*
397 * miscdevice" and register it with misc_register(). */ 519 * This is a textbook example of a "misc" character device. Populate a "struct
520 * miscdevice" and register it with misc_register().
521 */
398static struct miscdevice lguest_dev = { 522static struct miscdevice lguest_dev = {
399 .minor = MISC_DYNAMIC_MINOR, 523 .minor = MISC_DYNAMIC_MINOR,
400 .name = "lguest", 524 .name = "lguest",
diff --git a/drivers/lguest/page_tables.c b/drivers/lguest/page_tables.c
index a6fe1abda240..a8d0aee3bc0e 100644
--- a/drivers/lguest/page_tables.c
+++ b/drivers/lguest/page_tables.c
@@ -1,9 +1,11 @@
1/*P:700 The pagetable code, on the other hand, still shows the scars of 1/*P:700
2 * The pagetable code, on the other hand, still shows the scars of
2 * previous encounters. It's functional, and as neat as it can be in the 3 * previous encounters. It's functional, and as neat as it can be in the
3 * circumstances, but be wary, for these things are subtle and break easily. 4 * circumstances, but be wary, for these things are subtle and break easily.
4 * The Guest provides a virtual to physical mapping, but we can neither trust 5 * The Guest provides a virtual to physical mapping, but we can neither trust
5 * it nor use it: we verify and convert it here then point the CPU to the 6 * it nor use it: we verify and convert it here then point the CPU to the
6 * converted Guest pages when running the Guest. :*/ 7 * converted Guest pages when running the Guest.
8:*/
7 9
8/* Copyright (C) Rusty Russell IBM Corporation 2006. 10/* Copyright (C) Rusty Russell IBM Corporation 2006.
9 * GPL v2 and any later version */ 11 * GPL v2 and any later version */
@@ -17,18 +19,20 @@
17#include <asm/bootparam.h> 19#include <asm/bootparam.h>
18#include "lg.h" 20#include "lg.h"
19 21
20/*M:008 We hold reference to pages, which prevents them from being swapped. 22/*M:008
23 * We hold reference to pages, which prevents them from being swapped.
21 * It'd be nice to have a callback in the "struct mm_struct" when Linux wants 24 * It'd be nice to have a callback in the "struct mm_struct" when Linux wants
22 * to swap out. If we had this, and a shrinker callback to trim PTE pages, we 25 * to swap out. If we had this, and a shrinker callback to trim PTE pages, we
23 * could probably consider launching Guests as non-root. :*/ 26 * could probably consider launching Guests as non-root.
27:*/
24 28
25/*H:300 29/*H:300
26 * The Page Table Code 30 * The Page Table Code
27 * 31 *
28 * We use two-level page tables for the Guest. If you're not entirely 32 * We use two-level page tables for the Guest, or three-level with PAE. If
29 * comfortable with virtual addresses, physical addresses and page tables then 33 * you're not entirely comfortable with virtual addresses, physical addresses
30 * I recommend you review arch/x86/lguest/boot.c's "Page Table Handling" (with 34 * and page tables then I recommend you review arch/x86/lguest/boot.c's "Page
31 * diagrams!). 35 * Table Handling" (with diagrams!).
32 * 36 *
33 * The Guest keeps page tables, but we maintain the actual ones here: these are 37 * The Guest keeps page tables, but we maintain the actual ones here: these are
34 * called "shadow" page tables. Which is a very Guest-centric name: these are 38 * called "shadow" page tables. Which is a very Guest-centric name: these are
@@ -45,16 +49,18 @@
45 * (v) Flushing (throwing away) page tables, 49 * (v) Flushing (throwing away) page tables,
46 * (vi) Mapping the Switcher when the Guest is about to run, 50 * (vi) Mapping the Switcher when the Guest is about to run,
47 * (vii) Setting up the page tables initially. 51 * (vii) Setting up the page tables initially.
48 :*/ 52:*/
49 53
50 54/*
51/* 1024 entries in a page table page maps 1024 pages: 4MB. The Switcher is 55 * The Switcher uses the complete top PTE page. That's 1024 PTE entries (4MB)
52 * conveniently placed at the top 4MB, so it uses a separate, complete PTE 56 * or 512 PTE entries with PAE (2MB).
53 * page. */ 57 */
54#define SWITCHER_PGD_INDEX (PTRS_PER_PGD - 1) 58#define SWITCHER_PGD_INDEX (PTRS_PER_PGD - 1)
55 59
56/* For PAE we need the PMD index as well. We use the last 2MB, so we 60/*
57 * will need the last pmd entry of the last pmd page. */ 61 * For PAE we need the PMD index as well. We use the last 2MB, so we
62 * will need the last pmd entry of the last pmd page.
63 */
58#ifdef CONFIG_X86_PAE 64#ifdef CONFIG_X86_PAE
59#define SWITCHER_PMD_INDEX (PTRS_PER_PMD - 1) 65#define SWITCHER_PMD_INDEX (PTRS_PER_PMD - 1)
60#define RESERVE_MEM 2U 66#define RESERVE_MEM 2U
@@ -64,14 +70,18 @@
64#define CHECK_GPGD_MASK _PAGE_TABLE 70#define CHECK_GPGD_MASK _PAGE_TABLE
65#endif 71#endif
66 72
67/* We actually need a separate PTE page for each CPU. Remember that after the 73/*
74 * We actually need a separate PTE page for each CPU. Remember that after the
68 * Switcher code itself comes two pages for each CPU, and we don't want this 75 * Switcher code itself comes two pages for each CPU, and we don't want this
69 * CPU's guest to see the pages of any other CPU. */ 76 * CPU's guest to see the pages of any other CPU.
77 */
70static DEFINE_PER_CPU(pte_t *, switcher_pte_pages); 78static DEFINE_PER_CPU(pte_t *, switcher_pte_pages);
71#define switcher_pte_page(cpu) per_cpu(switcher_pte_pages, cpu) 79#define switcher_pte_page(cpu) per_cpu(switcher_pte_pages, cpu)
72 80
73/*H:320 The page table code is curly enough to need helper functions to keep it 81/*H:320
74 * clear and clean. 82 * The page table code is curly enough to need helper functions to keep it
83 * clear and clean. The kernel itself provides many of them; one advantage
84 * of insisting that the Guest and Host use the same CONFIG_PAE setting.
75 * 85 *
76 * There are two functions which return pointers to the shadow (aka "real") 86 * There are two functions which return pointers to the shadow (aka "real")
77 * page tables. 87 * page tables.
@@ -79,7 +89,8 @@ static DEFINE_PER_CPU(pte_t *, switcher_pte_pages);
79 * spgd_addr() takes the virtual address and returns a pointer to the top-level 89 * spgd_addr() takes the virtual address and returns a pointer to the top-level
80 * page directory entry (PGD) for that address. Since we keep track of several 90 * page directory entry (PGD) for that address. Since we keep track of several
81 * page tables, the "i" argument tells us which one we're interested in (it's 91 * page tables, the "i" argument tells us which one we're interested in (it's
82 * usually the current one). */ 92 * usually the current one).
93 */
83static pgd_t *spgd_addr(struct lg_cpu *cpu, u32 i, unsigned long vaddr) 94static pgd_t *spgd_addr(struct lg_cpu *cpu, u32 i, unsigned long vaddr)
84{ 95{
85 unsigned int index = pgd_index(vaddr); 96 unsigned int index = pgd_index(vaddr);
@@ -96,9 +107,11 @@ static pgd_t *spgd_addr(struct lg_cpu *cpu, u32 i, unsigned long vaddr)
96} 107}
97 108
98#ifdef CONFIG_X86_PAE 109#ifdef CONFIG_X86_PAE
99/* This routine then takes the PGD entry given above, which contains the 110/*
111 * This routine then takes the PGD entry given above, which contains the
100 * address of the PMD page. It then returns a pointer to the PMD entry for the 112 * address of the PMD page. It then returns a pointer to the PMD entry for the
101 * given address. */ 113 * given address.
114 */
102static pmd_t *spmd_addr(struct lg_cpu *cpu, pgd_t spgd, unsigned long vaddr) 115static pmd_t *spmd_addr(struct lg_cpu *cpu, pgd_t spgd, unsigned long vaddr)
103{ 116{
104 unsigned int index = pmd_index(vaddr); 117 unsigned int index = pmd_index(vaddr);
@@ -119,9 +132,11 @@ static pmd_t *spmd_addr(struct lg_cpu *cpu, pgd_t spgd, unsigned long vaddr)
119} 132}
120#endif 133#endif
121 134
122/* This routine then takes the page directory entry returned above, which 135/*
136 * This routine then takes the page directory entry returned above, which
123 * contains the address of the page table entry (PTE) page. It then returns a 137 * contains the address of the page table entry (PTE) page. It then returns a
124 * pointer to the PTE entry for the given address. */ 138 * pointer to the PTE entry for the given address.
139 */
125static pte_t *spte_addr(struct lg_cpu *cpu, pgd_t spgd, unsigned long vaddr) 140static pte_t *spte_addr(struct lg_cpu *cpu, pgd_t spgd, unsigned long vaddr)
126{ 141{
127#ifdef CONFIG_X86_PAE 142#ifdef CONFIG_X86_PAE
@@ -139,8 +154,10 @@ static pte_t *spte_addr(struct lg_cpu *cpu, pgd_t spgd, unsigned long vaddr)
139 return &page[pte_index(vaddr)]; 154 return &page[pte_index(vaddr)];
140} 155}
141 156
142/* These two functions just like the above two, except they access the Guest 157/*
143 * page tables. Hence they return a Guest address. */ 158 * These functions are just like the above two, except they access the Guest
159 * page tables. Hence they return a Guest address.
160 */
144static unsigned long gpgd_addr(struct lg_cpu *cpu, unsigned long vaddr) 161static unsigned long gpgd_addr(struct lg_cpu *cpu, unsigned long vaddr)
145{ 162{
146 unsigned int index = vaddr >> (PGDIR_SHIFT); 163 unsigned int index = vaddr >> (PGDIR_SHIFT);
@@ -148,6 +165,7 @@ static unsigned long gpgd_addr(struct lg_cpu *cpu, unsigned long vaddr)
148} 165}
149 166
150#ifdef CONFIG_X86_PAE 167#ifdef CONFIG_X86_PAE
168/* Follow the PGD to the PMD. */
151static unsigned long gpmd_addr(pgd_t gpgd, unsigned long vaddr) 169static unsigned long gpmd_addr(pgd_t gpgd, unsigned long vaddr)
152{ 170{
153 unsigned long gpage = pgd_pfn(gpgd) << PAGE_SHIFT; 171 unsigned long gpage = pgd_pfn(gpgd) << PAGE_SHIFT;
@@ -155,6 +173,7 @@ static unsigned long gpmd_addr(pgd_t gpgd, unsigned long vaddr)
155 return gpage + pmd_index(vaddr) * sizeof(pmd_t); 173 return gpage + pmd_index(vaddr) * sizeof(pmd_t);
156} 174}
157 175
176/* Follow the PMD to the PTE. */
158static unsigned long gpte_addr(struct lg_cpu *cpu, 177static unsigned long gpte_addr(struct lg_cpu *cpu,
159 pmd_t gpmd, unsigned long vaddr) 178 pmd_t gpmd, unsigned long vaddr)
160{ 179{
@@ -164,6 +183,7 @@ static unsigned long gpte_addr(struct lg_cpu *cpu,
164 return gpage + pte_index(vaddr) * sizeof(pte_t); 183 return gpage + pte_index(vaddr) * sizeof(pte_t);
165} 184}
166#else 185#else
186/* Follow the PGD to the PTE (no mid-level for !PAE). */
167static unsigned long gpte_addr(struct lg_cpu *cpu, 187static unsigned long gpte_addr(struct lg_cpu *cpu,
168 pgd_t gpgd, unsigned long vaddr) 188 pgd_t gpgd, unsigned long vaddr)
169{ 189{
@@ -175,17 +195,21 @@ static unsigned long gpte_addr(struct lg_cpu *cpu,
175#endif 195#endif
176/*:*/ 196/*:*/
177 197
178/*M:014 get_pfn is slow: we could probably try to grab batches of pages here as 198/*M:014
179 * an optimization (ie. pre-faulting). :*/ 199 * get_pfn is slow: we could probably try to grab batches of pages here as
200 * an optimization (ie. pre-faulting).
201:*/
180 202
181/*H:350 This routine takes a page number given by the Guest and converts it to 203/*H:350
204 * This routine takes a page number given by the Guest and converts it to
182 * an actual, physical page number. It can fail for several reasons: the 205 * an actual, physical page number. It can fail for several reasons: the
183 * virtual address might not be mapped by the Launcher, the write flag is set 206 * virtual address might not be mapped by the Launcher, the write flag is set
184 * and the page is read-only, or the write flag was set and the page was 207 * and the page is read-only, or the write flag was set and the page was
185 * shared so had to be copied, but we ran out of memory. 208 * shared so had to be copied, but we ran out of memory.
186 * 209 *
187 * This holds a reference to the page, so release_pte() is careful to put that 210 * This holds a reference to the page, so release_pte() is careful to put that
188 * back. */ 211 * back.
212 */
189static unsigned long get_pfn(unsigned long virtpfn, int write) 213static unsigned long get_pfn(unsigned long virtpfn, int write)
190{ 214{
191 struct page *page; 215 struct page *page;
@@ -198,33 +222,41 @@ static unsigned long get_pfn(unsigned long virtpfn, int write)
198 return -1UL; 222 return -1UL;
199} 223}
200 224
201/*H:340 Converting a Guest page table entry to a shadow (ie. real) page table 225/*H:340
226 * Converting a Guest page table entry to a shadow (ie. real) page table
202 * entry can be a little tricky. The flags are (almost) the same, but the 227 * entry can be a little tricky. The flags are (almost) the same, but the
203 * Guest PTE contains a virtual page number: the CPU needs the real page 228 * Guest PTE contains a virtual page number: the CPU needs the real page
204 * number. */ 229 * number.
230 */
205static pte_t gpte_to_spte(struct lg_cpu *cpu, pte_t gpte, int write) 231static pte_t gpte_to_spte(struct lg_cpu *cpu, pte_t gpte, int write)
206{ 232{
207 unsigned long pfn, base, flags; 233 unsigned long pfn, base, flags;
208 234
209 /* The Guest sets the global flag, because it thinks that it is using 235 /*
236 * The Guest sets the global flag, because it thinks that it is using
210 * PGE. We only told it to use PGE so it would tell us whether it was 237 * PGE. We only told it to use PGE so it would tell us whether it was
211 * flushing a kernel mapping or a userspace mapping. We don't actually 238 * flushing a kernel mapping or a userspace mapping. We don't actually
212 * use the global bit, so throw it away. */ 239 * use the global bit, so throw it away.
240 */
213 flags = (pte_flags(gpte) & ~_PAGE_GLOBAL); 241 flags = (pte_flags(gpte) & ~_PAGE_GLOBAL);
214 242
215 /* The Guest's pages are offset inside the Launcher. */ 243 /* The Guest's pages are offset inside the Launcher. */
216 base = (unsigned long)cpu->lg->mem_base / PAGE_SIZE; 244 base = (unsigned long)cpu->lg->mem_base / PAGE_SIZE;
217 245
218 /* We need a temporary "unsigned long" variable to hold the answer from 246 /*
247 * We need a temporary "unsigned long" variable to hold the answer from
219 * get_pfn(), because it returns 0xFFFFFFFF on failure, which wouldn't 248 * get_pfn(), because it returns 0xFFFFFFFF on failure, which wouldn't
220 * fit in spte.pfn. get_pfn() finds the real physical number of the 249 * fit in spte.pfn. get_pfn() finds the real physical number of the
221 * page, given the virtual number. */ 250 * page, given the virtual number.
251 */
222 pfn = get_pfn(base + pte_pfn(gpte), write); 252 pfn = get_pfn(base + pte_pfn(gpte), write);
223 if (pfn == -1UL) { 253 if (pfn == -1UL) {
224 kill_guest(cpu, "failed to get page %lu", pte_pfn(gpte)); 254 kill_guest(cpu, "failed to get page %lu", pte_pfn(gpte));
225 /* When we destroy the Guest, we'll go through the shadow page 255 /*
256 * When we destroy the Guest, we'll go through the shadow page
226 * tables and release_pte() them. Make sure we don't think 257 * tables and release_pte() them. Make sure we don't think
227 * this one is valid! */ 258 * this one is valid!
259 */
228 flags = 0; 260 flags = 0;
229 } 261 }
230 /* Now we assemble our shadow PTE from the page number and flags. */ 262 /* Now we assemble our shadow PTE from the page number and flags. */
@@ -234,8 +266,10 @@ static pte_t gpte_to_spte(struct lg_cpu *cpu, pte_t gpte, int write)
234/*H:460 And to complete the chain, release_pte() looks like this: */ 266/*H:460 And to complete the chain, release_pte() looks like this: */
235static void release_pte(pte_t pte) 267static void release_pte(pte_t pte)
236{ 268{
237 /* Remember that get_user_pages_fast() took a reference to the page, in 269 /*
238 * get_pfn()? We have to put it back now. */ 270 * Remember that get_user_pages_fast() took a reference to the page, in
271 * get_pfn()? We have to put it back now.
272 */
239 if (pte_flags(pte) & _PAGE_PRESENT) 273 if (pte_flags(pte) & _PAGE_PRESENT)
240 put_page(pte_page(pte)); 274 put_page(pte_page(pte));
241} 275}
@@ -273,7 +307,8 @@ static void check_gpmd(struct lg_cpu *cpu, pmd_t gpmd)
273 * and return to the Guest without it knowing. 307 * and return to the Guest without it knowing.
274 * 308 *
275 * If we fixed up the fault (ie. we mapped the address), this routine returns 309 * If we fixed up the fault (ie. we mapped the address), this routine returns
276 * true. Otherwise, it was a real fault and we need to tell the Guest. */ 310 * true. Otherwise, it was a real fault and we need to tell the Guest.
311 */
277bool demand_page(struct lg_cpu *cpu, unsigned long vaddr, int errcode) 312bool demand_page(struct lg_cpu *cpu, unsigned long vaddr, int errcode)
278{ 313{
279 pgd_t gpgd; 314 pgd_t gpgd;
@@ -282,6 +317,7 @@ bool demand_page(struct lg_cpu *cpu, unsigned long vaddr, int errcode)
282 pte_t gpte; 317 pte_t gpte;
283 pte_t *spte; 318 pte_t *spte;
284 319
320 /* Mid level for PAE. */
285#ifdef CONFIG_X86_PAE 321#ifdef CONFIG_X86_PAE
286 pmd_t *spmd; 322 pmd_t *spmd;
287 pmd_t gpmd; 323 pmd_t gpmd;
@@ -298,22 +334,26 @@ bool demand_page(struct lg_cpu *cpu, unsigned long vaddr, int errcode)
298 if (!(pgd_flags(*spgd) & _PAGE_PRESENT)) { 334 if (!(pgd_flags(*spgd) & _PAGE_PRESENT)) {
299 /* No shadow entry: allocate a new shadow PTE page. */ 335 /* No shadow entry: allocate a new shadow PTE page. */
300 unsigned long ptepage = get_zeroed_page(GFP_KERNEL); 336 unsigned long ptepage = get_zeroed_page(GFP_KERNEL);
301 /* This is not really the Guest's fault, but killing it is 337 /*
302 * simple for this corner case. */ 338 * This is not really the Guest's fault, but killing it is
339 * simple for this corner case.
340 */
303 if (!ptepage) { 341 if (!ptepage) {
304 kill_guest(cpu, "out of memory allocating pte page"); 342 kill_guest(cpu, "out of memory allocating pte page");
305 return false; 343 return false;
306 } 344 }
307 /* We check that the Guest pgd is OK. */ 345 /* We check that the Guest pgd is OK. */
308 check_gpgd(cpu, gpgd); 346 check_gpgd(cpu, gpgd);
309 /* And we copy the flags to the shadow PGD entry. The page 347 /*
310 * number in the shadow PGD is the page we just allocated. */ 348 * And we copy the flags to the shadow PGD entry. The page
349 * number in the shadow PGD is the page we just allocated.
350 */
311 set_pgd(spgd, __pgd(__pa(ptepage) | pgd_flags(gpgd))); 351 set_pgd(spgd, __pgd(__pa(ptepage) | pgd_flags(gpgd)));
312 } 352 }
313 353
314#ifdef CONFIG_X86_PAE 354#ifdef CONFIG_X86_PAE
315 gpmd = lgread(cpu, gpmd_addr(gpgd, vaddr), pmd_t); 355 gpmd = lgread(cpu, gpmd_addr(gpgd, vaddr), pmd_t);
316 /* middle level not present? We can't map it in. */ 356 /* Middle level not present? We can't map it in. */
317 if (!(pmd_flags(gpmd) & _PAGE_PRESENT)) 357 if (!(pmd_flags(gpmd) & _PAGE_PRESENT))
318 return false; 358 return false;
319 359
@@ -324,8 +364,10 @@ bool demand_page(struct lg_cpu *cpu, unsigned long vaddr, int errcode)
324 /* No shadow entry: allocate a new shadow PTE page. */ 364 /* No shadow entry: allocate a new shadow PTE page. */
325 unsigned long ptepage = get_zeroed_page(GFP_KERNEL); 365 unsigned long ptepage = get_zeroed_page(GFP_KERNEL);
326 366
327 /* This is not really the Guest's fault, but killing it is 367 /*
328 * simple for this corner case. */ 368 * This is not really the Guest's fault, but killing it is
369 * simple for this corner case.
370 */
329 if (!ptepage) { 371 if (!ptepage) {
330 kill_guest(cpu, "out of memory allocating pte page"); 372 kill_guest(cpu, "out of memory allocating pte page");
331 return false; 373 return false;
@@ -334,27 +376,37 @@ bool demand_page(struct lg_cpu *cpu, unsigned long vaddr, int errcode)
334 /* We check that the Guest pmd is OK. */ 376 /* We check that the Guest pmd is OK. */
335 check_gpmd(cpu, gpmd); 377 check_gpmd(cpu, gpmd);
336 378
337 /* And we copy the flags to the shadow PMD entry. The page 379 /*
338 * number in the shadow PMD is the page we just allocated. */ 380 * And we copy the flags to the shadow PMD entry. The page
381 * number in the shadow PMD is the page we just allocated.
382 */
339 native_set_pmd(spmd, __pmd(__pa(ptepage) | pmd_flags(gpmd))); 383 native_set_pmd(spmd, __pmd(__pa(ptepage) | pmd_flags(gpmd)));
340 } 384 }
341 385
342 /* OK, now we look at the lower level in the Guest page table: keep its 386 /*
343 * address, because we might update it later. */ 387 * OK, now we look at the lower level in the Guest page table: keep its
388 * address, because we might update it later.
389 */
344 gpte_ptr = gpte_addr(cpu, gpmd, vaddr); 390 gpte_ptr = gpte_addr(cpu, gpmd, vaddr);
345#else 391#else
346 /* OK, now we look at the lower level in the Guest page table: keep its 392 /*
347 * address, because we might update it later. */ 393 * OK, now we look at the lower level in the Guest page table: keep its
394 * address, because we might update it later.
395 */
348 gpte_ptr = gpte_addr(cpu, gpgd, vaddr); 396 gpte_ptr = gpte_addr(cpu, gpgd, vaddr);
349#endif 397#endif
398
399 /* Read the actual PTE value. */
350 gpte = lgread(cpu, gpte_ptr, pte_t); 400 gpte = lgread(cpu, gpte_ptr, pte_t);
351 401
352 /* If this page isn't in the Guest page tables, we can't page it in. */ 402 /* If this page isn't in the Guest page tables, we can't page it in. */
353 if (!(pte_flags(gpte) & _PAGE_PRESENT)) 403 if (!(pte_flags(gpte) & _PAGE_PRESENT))
354 return false; 404 return false;
355 405
356 /* Check they're not trying to write to a page the Guest wants 406 /*
357 * read-only (bit 2 of errcode == write). */ 407 * Check they're not trying to write to a page the Guest wants
408 * read-only (bit 2 of errcode == write).
409 */
358 if ((errcode & 2) && !(pte_flags(gpte) & _PAGE_RW)) 410 if ((errcode & 2) && !(pte_flags(gpte) & _PAGE_RW))
359 return false; 411 return false;
360 412
@@ -362,8 +414,10 @@ bool demand_page(struct lg_cpu *cpu, unsigned long vaddr, int errcode)
362 if ((errcode & 4) && !(pte_flags(gpte) & _PAGE_USER)) 414 if ((errcode & 4) && !(pte_flags(gpte) & _PAGE_USER))
363 return false; 415 return false;
364 416
365 /* Check that the Guest PTE flags are OK, and the page number is below 417 /*
366 * the pfn_limit (ie. not mapping the Launcher binary). */ 418 * Check that the Guest PTE flags are OK, and the page number is below
419 * the pfn_limit (ie. not mapping the Launcher binary).
420 */
367 check_gpte(cpu, gpte); 421 check_gpte(cpu, gpte);
368 422
369 /* Add the _PAGE_ACCESSED and (for a write) _PAGE_DIRTY flag */ 423 /* Add the _PAGE_ACCESSED and (for a write) _PAGE_DIRTY flag */
@@ -373,29 +427,40 @@ bool demand_page(struct lg_cpu *cpu, unsigned long vaddr, int errcode)
373 427
374 /* Get the pointer to the shadow PTE entry we're going to set. */ 428 /* Get the pointer to the shadow PTE entry we're going to set. */
375 spte = spte_addr(cpu, *spgd, vaddr); 429 spte = spte_addr(cpu, *spgd, vaddr);
376 /* If there was a valid shadow PTE entry here before, we release it. 430
377 * This can happen with a write to a previously read-only entry. */ 431 /*
432 * If there was a valid shadow PTE entry here before, we release it.
433 * This can happen with a write to a previously read-only entry.
434 */
378 release_pte(*spte); 435 release_pte(*spte);
379 436
380 /* If this is a write, we insist that the Guest page is writable (the 437 /*
381 * final arg to gpte_to_spte()). */ 438 * If this is a write, we insist that the Guest page is writable (the
439 * final arg to gpte_to_spte()).
440 */
382 if (pte_dirty(gpte)) 441 if (pte_dirty(gpte))
383 *spte = gpte_to_spte(cpu, gpte, 1); 442 *spte = gpte_to_spte(cpu, gpte, 1);
384 else 443 else
385 /* If this is a read, don't set the "writable" bit in the page 444 /*
445 * If this is a read, don't set the "writable" bit in the page
386 * table entry, even if the Guest says it's writable. That way 446 * table entry, even if the Guest says it's writable. That way
387 * we will come back here when a write does actually occur, so 447 * we will come back here when a write does actually occur, so
388 * we can update the Guest's _PAGE_DIRTY flag. */ 448 * we can update the Guest's _PAGE_DIRTY flag.
449 */
389 native_set_pte(spte, gpte_to_spte(cpu, pte_wrprotect(gpte), 0)); 450 native_set_pte(spte, gpte_to_spte(cpu, pte_wrprotect(gpte), 0));
390 451
391 /* Finally, we write the Guest PTE entry back: we've set the 452 /*
392 * _PAGE_ACCESSED and maybe the _PAGE_DIRTY flags. */ 453 * Finally, we write the Guest PTE entry back: we've set the
454 * _PAGE_ACCESSED and maybe the _PAGE_DIRTY flags.
455 */
393 lgwrite(cpu, gpte_ptr, pte_t, gpte); 456 lgwrite(cpu, gpte_ptr, pte_t, gpte);
394 457
395 /* The fault is fixed, the page table is populated, the mapping 458 /*
459 * The fault is fixed, the page table is populated, the mapping
396 * manipulated, the result returned and the code complete. A small 460 * manipulated, the result returned and the code complete. A small
397 * delay and a trace of alliteration are the only indications the Guest 461 * delay and a trace of alliteration are the only indications the Guest
398 * has that a page fault occurred at all. */ 462 * has that a page fault occurred at all.
463 */
399 return true; 464 return true;
400} 465}
401 466
@@ -408,7 +473,8 @@ bool demand_page(struct lg_cpu *cpu, unsigned long vaddr, int errcode)
408 * mapped, so it's overkill. 473 * mapped, so it's overkill.
409 * 474 *
410 * This is a quick version which answers the question: is this virtual address 475 * This is a quick version which answers the question: is this virtual address
411 * mapped by the shadow page tables, and is it writable? */ 476 * mapped by the shadow page tables, and is it writable?
477 */
412static bool page_writable(struct lg_cpu *cpu, unsigned long vaddr) 478static bool page_writable(struct lg_cpu *cpu, unsigned long vaddr)
413{ 479{
414 pgd_t *spgd; 480 pgd_t *spgd;
@@ -428,21 +494,26 @@ static bool page_writable(struct lg_cpu *cpu, unsigned long vaddr)
428 return false; 494 return false;
429#endif 495#endif
430 496
431 /* Check the flags on the pte entry itself: it must be present and 497 /*
432 * writable. */ 498 * Check the flags on the pte entry itself: it must be present and
499 * writable.
500 */
433 flags = pte_flags(*(spte_addr(cpu, *spgd, vaddr))); 501 flags = pte_flags(*(spte_addr(cpu, *spgd, vaddr)));
434 502
435 return (flags & (_PAGE_PRESENT|_PAGE_RW)) == (_PAGE_PRESENT|_PAGE_RW); 503 return (flags & (_PAGE_PRESENT|_PAGE_RW)) == (_PAGE_PRESENT|_PAGE_RW);
436} 504}
437 505
438/* So, when pin_stack_pages() asks us to pin a page, we check if it's already 506/*
507 * So, when pin_stack_pages() asks us to pin a page, we check if it's already
439 * in the page tables, and if not, we call demand_page() with error code 2 508 * in the page tables, and if not, we call demand_page() with error code 2
440 * (meaning "write"). */ 509 * (meaning "write").
510 */
441void pin_page(struct lg_cpu *cpu, unsigned long vaddr) 511void pin_page(struct lg_cpu *cpu, unsigned long vaddr)
442{ 512{
443 if (!page_writable(cpu, vaddr) && !demand_page(cpu, vaddr, 2)) 513 if (!page_writable(cpu, vaddr) && !demand_page(cpu, vaddr, 2))
444 kill_guest(cpu, "bad stack page %#lx", vaddr); 514 kill_guest(cpu, "bad stack page %#lx", vaddr);
445} 515}
516/*:*/
446 517
447#ifdef CONFIG_X86_PAE 518#ifdef CONFIG_X86_PAE
448static void release_pmd(pmd_t *spmd) 519static void release_pmd(pmd_t *spmd)
@@ -479,15 +550,21 @@ static void release_pgd(pgd_t *spgd)
479} 550}
480 551
481#else /* !CONFIG_X86_PAE */ 552#else /* !CONFIG_X86_PAE */
482/*H:450 If we chase down the release_pgd() code, it looks like this: */ 553/*H:450
554 * If we chase down the release_pgd() code, the non-PAE version looks like
555 * this. The PAE version is almost identical, but instead of calling
556 * release_pte it calls release_pmd(), which looks much like this.
557 */
483static void release_pgd(pgd_t *spgd) 558static void release_pgd(pgd_t *spgd)
484{ 559{
485 /* If the entry's not present, there's nothing to release. */ 560 /* If the entry's not present, there's nothing to release. */
486 if (pgd_flags(*spgd) & _PAGE_PRESENT) { 561 if (pgd_flags(*spgd) & _PAGE_PRESENT) {
487 unsigned int i; 562 unsigned int i;
488 /* Converting the pfn to find the actual PTE page is easy: turn 563 /*
564 * Converting the pfn to find the actual PTE page is easy: turn
489 * the page number into a physical address, then convert to a 565 * the page number into a physical address, then convert to a
490 * virtual address (easy for kernel pages like this one). */ 566 * virtual address (easy for kernel pages like this one).
567 */
491 pte_t *ptepage = __va(pgd_pfn(*spgd) << PAGE_SHIFT); 568 pte_t *ptepage = __va(pgd_pfn(*spgd) << PAGE_SHIFT);
492 /* For each entry in the page, we might need to release it. */ 569 /* For each entry in the page, we might need to release it. */
493 for (i = 0; i < PTRS_PER_PTE; i++) 570 for (i = 0; i < PTRS_PER_PTE; i++)
@@ -499,9 +576,12 @@ static void release_pgd(pgd_t *spgd)
499 } 576 }
500} 577}
501#endif 578#endif
502/*H:445 We saw flush_user_mappings() twice: once from the flush_user_mappings() 579
580/*H:445
581 * We saw flush_user_mappings() twice: once from the flush_user_mappings()
503 * hypercall and once in new_pgdir() when we re-used a top-level pgdir page. 582 * hypercall and once in new_pgdir() when we re-used a top-level pgdir page.
504 * It simply releases every PTE page from 0 up to the Guest's kernel address. */ 583 * It simply releases every PTE page from 0 up to the Guest's kernel address.
584 */
505static void flush_user_mappings(struct lguest *lg, int idx) 585static void flush_user_mappings(struct lguest *lg, int idx)
506{ 586{
507 unsigned int i; 587 unsigned int i;
@@ -510,10 +590,12 @@ static void flush_user_mappings(struct lguest *lg, int idx)
510 release_pgd(lg->pgdirs[idx].pgdir + i); 590 release_pgd(lg->pgdirs[idx].pgdir + i);
511} 591}
512 592
513/*H:440 (v) Flushing (throwing away) page tables, 593/*H:440
594 * (v) Flushing (throwing away) page tables,
514 * 595 *
515 * The Guest has a hypercall to throw away the page tables: it's used when a 596 * The Guest has a hypercall to throw away the page tables: it's used when a
516 * large number of mappings have been changed. */ 597 * large number of mappings have been changed.
598 */
517void guest_pagetable_flush_user(struct lg_cpu *cpu) 599void guest_pagetable_flush_user(struct lg_cpu *cpu)
518{ 600{
519 /* Drop the userspace part of the current page table. */ 601 /* Drop the userspace part of the current page table. */
@@ -551,9 +633,11 @@ unsigned long guest_pa(struct lg_cpu *cpu, unsigned long vaddr)
551 return pte_pfn(gpte) * PAGE_SIZE | (vaddr & ~PAGE_MASK); 633 return pte_pfn(gpte) * PAGE_SIZE | (vaddr & ~PAGE_MASK);
552} 634}
553 635
554/* We keep several page tables. This is a simple routine to find the page 636/*
637 * We keep several page tables. This is a simple routine to find the page
555 * table (if any) corresponding to this top-level address the Guest has given 638 * table (if any) corresponding to this top-level address the Guest has given
556 * us. */ 639 * us.
640 */
557static unsigned int find_pgdir(struct lguest *lg, unsigned long pgtable) 641static unsigned int find_pgdir(struct lguest *lg, unsigned long pgtable)
558{ 642{
559 unsigned int i; 643 unsigned int i;
@@ -563,9 +647,11 @@ static unsigned int find_pgdir(struct lguest *lg, unsigned long pgtable)
563 return i; 647 return i;
564} 648}
565 649
566/*H:435 And this is us, creating the new page directory. If we really do 650/*H:435
651 * And this is us, creating the new page directory. If we really do
567 * allocate a new one (and so the kernel parts are not there), we set 652 * allocate a new one (and so the kernel parts are not there), we set
568 * blank_pgdir. */ 653 * blank_pgdir.
654 */
569static unsigned int new_pgdir(struct lg_cpu *cpu, 655static unsigned int new_pgdir(struct lg_cpu *cpu,
570 unsigned long gpgdir, 656 unsigned long gpgdir,
571 int *blank_pgdir) 657 int *blank_pgdir)
@@ -575,8 +661,10 @@ static unsigned int new_pgdir(struct lg_cpu *cpu,
575 pmd_t *pmd_table; 661 pmd_t *pmd_table;
576#endif 662#endif
577 663
578 /* We pick one entry at random to throw out. Choosing the Least 664 /*
579 * Recently Used might be better, but this is easy. */ 665 * We pick one entry at random to throw out. Choosing the Least
666 * Recently Used might be better, but this is easy.
667 */
580 next = random32() % ARRAY_SIZE(cpu->lg->pgdirs); 668 next = random32() % ARRAY_SIZE(cpu->lg->pgdirs);
581 /* If it's never been allocated at all before, try now. */ 669 /* If it's never been allocated at all before, try now. */
582 if (!cpu->lg->pgdirs[next].pgdir) { 670 if (!cpu->lg->pgdirs[next].pgdir) {
@@ -587,8 +675,10 @@ static unsigned int new_pgdir(struct lg_cpu *cpu,
587 next = cpu->cpu_pgd; 675 next = cpu->cpu_pgd;
588 else { 676 else {
589#ifdef CONFIG_X86_PAE 677#ifdef CONFIG_X86_PAE
590 /* In PAE mode, allocate a pmd page and populate the 678 /*
591 * last pgd entry. */ 679 * In PAE mode, allocate a pmd page and populate the
680 * last pgd entry.
681 */
592 pmd_table = (pmd_t *)get_zeroed_page(GFP_KERNEL); 682 pmd_table = (pmd_t *)get_zeroed_page(GFP_KERNEL);
593 if (!pmd_table) { 683 if (!pmd_table) {
594 free_page((long)cpu->lg->pgdirs[next].pgdir); 684 free_page((long)cpu->lg->pgdirs[next].pgdir);
@@ -598,8 +688,10 @@ static unsigned int new_pgdir(struct lg_cpu *cpu,
598 set_pgd(cpu->lg->pgdirs[next].pgdir + 688 set_pgd(cpu->lg->pgdirs[next].pgdir +
599 SWITCHER_PGD_INDEX, 689 SWITCHER_PGD_INDEX,
600 __pgd(__pa(pmd_table) | _PAGE_PRESENT)); 690 __pgd(__pa(pmd_table) | _PAGE_PRESENT));
601 /* This is a blank page, so there are no kernel 691 /*
602 * mappings: caller must map the stack! */ 692 * This is a blank page, so there are no kernel
693 * mappings: caller must map the stack!
694 */
603 *blank_pgdir = 1; 695 *blank_pgdir = 1;
604 } 696 }
605#else 697#else
@@ -615,19 +707,23 @@ static unsigned int new_pgdir(struct lg_cpu *cpu,
615 return next; 707 return next;
616} 708}
617 709
618/*H:430 (iv) Switching page tables 710/*H:430
711 * (iv) Switching page tables
619 * 712 *
620 * Now we've seen all the page table setting and manipulation, let's see 713 * Now we've seen all the page table setting and manipulation, let's see
621 * what happens when the Guest changes page tables (ie. changes the top-level 714 * what happens when the Guest changes page tables (ie. changes the top-level
622 * pgdir). This occurs on almost every context switch. */ 715 * pgdir). This occurs on almost every context switch.
716 */
623void guest_new_pagetable(struct lg_cpu *cpu, unsigned long pgtable) 717void guest_new_pagetable(struct lg_cpu *cpu, unsigned long pgtable)
624{ 718{
625 int newpgdir, repin = 0; 719 int newpgdir, repin = 0;
626 720
627 /* Look to see if we have this one already. */ 721 /* Look to see if we have this one already. */
628 newpgdir = find_pgdir(cpu->lg, pgtable); 722 newpgdir = find_pgdir(cpu->lg, pgtable);
629 /* If not, we allocate or mug an existing one: if it's a fresh one, 723 /*
630 * repin gets set to 1. */ 724 * If not, we allocate or mug an existing one: if it's a fresh one,
725 * repin gets set to 1.
726 */
631 if (newpgdir == ARRAY_SIZE(cpu->lg->pgdirs)) 727 if (newpgdir == ARRAY_SIZE(cpu->lg->pgdirs))
632 newpgdir = new_pgdir(cpu, pgtable, &repin); 728 newpgdir = new_pgdir(cpu, pgtable, &repin);
633 /* Change the current pgd index to the new one. */ 729 /* Change the current pgd index to the new one. */
@@ -637,9 +733,11 @@ void guest_new_pagetable(struct lg_cpu *cpu, unsigned long pgtable)
637 pin_stack_pages(cpu); 733 pin_stack_pages(cpu);
638} 734}
639 735
640/*H:470 Finally, a routine which throws away everything: all PGD entries in all 736/*H:470
737 * Finally, a routine which throws away everything: all PGD entries in all
641 * the shadow page tables, including the Guest's kernel mappings. This is used 738 * the shadow page tables, including the Guest's kernel mappings. This is used
642 * when we destroy the Guest. */ 739 * when we destroy the Guest.
740 */
643static void release_all_pagetables(struct lguest *lg) 741static void release_all_pagetables(struct lguest *lg)
644{ 742{
645 unsigned int i, j; 743 unsigned int i, j;
@@ -656,8 +754,10 @@ static void release_all_pagetables(struct lguest *lg)
656 spgd = lg->pgdirs[i].pgdir + SWITCHER_PGD_INDEX; 754 spgd = lg->pgdirs[i].pgdir + SWITCHER_PGD_INDEX;
657 pmdpage = __va(pgd_pfn(*spgd) << PAGE_SHIFT); 755 pmdpage = __va(pgd_pfn(*spgd) << PAGE_SHIFT);
658 756
659 /* And release the pmd entries of that pmd page, 757 /*
660 * except for the switcher pmd. */ 758 * And release the pmd entries of that pmd page,
759 * except for the switcher pmd.
760 */
661 for (k = 0; k < SWITCHER_PMD_INDEX; k++) 761 for (k = 0; k < SWITCHER_PMD_INDEX; k++)
662 release_pmd(&pmdpage[k]); 762 release_pmd(&pmdpage[k]);
663#endif 763#endif
@@ -667,10 +767,12 @@ static void release_all_pagetables(struct lguest *lg)
667 } 767 }
668} 768}
669 769
670/* We also throw away everything when a Guest tells us it's changed a kernel 770/*
771 * We also throw away everything when a Guest tells us it's changed a kernel
671 * mapping. Since kernel mappings are in every page table, it's easiest to 772 * mapping. Since kernel mappings are in every page table, it's easiest to
672 * throw them all away. This traps the Guest in amber for a while as 773 * throw them all away. This traps the Guest in amber for a while as
673 * everything faults back in, but it's rare. */ 774 * everything faults back in, but it's rare.
775 */
674void guest_pagetable_clear_all(struct lg_cpu *cpu) 776void guest_pagetable_clear_all(struct lg_cpu *cpu)
675{ 777{
676 release_all_pagetables(cpu->lg); 778 release_all_pagetables(cpu->lg);
@@ -678,15 +780,19 @@ void guest_pagetable_clear_all(struct lg_cpu *cpu)
678 pin_stack_pages(cpu); 780 pin_stack_pages(cpu);
679} 781}
680/*:*/ 782/*:*/
681/*M:009 Since we throw away all mappings when a kernel mapping changes, our 783
784/*M:009
785 * Since we throw away all mappings when a kernel mapping changes, our
682 * performance sucks for guests using highmem. In fact, a guest with 786 * performance sucks for guests using highmem. In fact, a guest with
683 * PAGE_OFFSET 0xc0000000 (the default) and more than about 700MB of RAM is 787 * PAGE_OFFSET 0xc0000000 (the default) and more than about 700MB of RAM is
684 * usually slower than a Guest with less memory. 788 * usually slower than a Guest with less memory.
685 * 789 *
686 * This, of course, cannot be fixed. It would take some kind of... well, I 790 * This, of course, cannot be fixed. It would take some kind of... well, I
687 * don't know, but the term "puissant code-fu" comes to mind. :*/ 791 * don't know, but the term "puissant code-fu" comes to mind.
792:*/
688 793
689/*H:420 This is the routine which actually sets the page table entry for then 794/*H:420
795 * This is the routine which actually sets the page table entry for then
690 * "idx"'th shadow page table. 796 * "idx"'th shadow page table.
691 * 797 *
692 * Normally, we can just throw out the old entry and replace it with 0: if they 798 * Normally, we can just throw out the old entry and replace it with 0: if they
@@ -715,31 +821,36 @@ static void do_set_pte(struct lg_cpu *cpu, int idx,
715 spmd = spmd_addr(cpu, *spgd, vaddr); 821 spmd = spmd_addr(cpu, *spgd, vaddr);
716 if (pmd_flags(*spmd) & _PAGE_PRESENT) { 822 if (pmd_flags(*spmd) & _PAGE_PRESENT) {
717#endif 823#endif
718 /* Otherwise, we start by releasing 824 /* Otherwise, start by releasing the existing entry. */
719 * the existing entry. */
720 pte_t *spte = spte_addr(cpu, *spgd, vaddr); 825 pte_t *spte = spte_addr(cpu, *spgd, vaddr);
721 release_pte(*spte); 826 release_pte(*spte);
722 827
723 /* If they're setting this entry as dirty or accessed, 828 /*
724 * we might as well put that entry they've given us 829 * If they're setting this entry as dirty or accessed,
725 * in now. This shaves 10% off a 830 * we might as well put that entry they've given us in
726 * copy-on-write micro-benchmark. */ 831 * now. This shaves 10% off a copy-on-write
832 * micro-benchmark.
833 */
727 if (pte_flags(gpte) & (_PAGE_DIRTY | _PAGE_ACCESSED)) { 834 if (pte_flags(gpte) & (_PAGE_DIRTY | _PAGE_ACCESSED)) {
728 check_gpte(cpu, gpte); 835 check_gpte(cpu, gpte);
729 native_set_pte(spte, 836 native_set_pte(spte,
730 gpte_to_spte(cpu, gpte, 837 gpte_to_spte(cpu, gpte,
731 pte_flags(gpte) & _PAGE_DIRTY)); 838 pte_flags(gpte) & _PAGE_DIRTY));
732 } else 839 } else {
733 /* Otherwise kill it and we can demand_page() 840 /*
734 * it in later. */ 841 * Otherwise kill it and we can demand_page()
842 * it in later.
843 */
735 native_set_pte(spte, __pte(0)); 844 native_set_pte(spte, __pte(0));
845 }
736#ifdef CONFIG_X86_PAE 846#ifdef CONFIG_X86_PAE
737 } 847 }
738#endif 848#endif
739 } 849 }
740} 850}
741 851
742/*H:410 Updating a PTE entry is a little trickier. 852/*H:410
853 * Updating a PTE entry is a little trickier.
743 * 854 *
744 * We keep track of several different page tables (the Guest uses one for each 855 * We keep track of several different page tables (the Guest uses one for each
745 * process, so it makes sense to cache at least a few). Each of these have 856 * process, so it makes sense to cache at least a few). Each of these have
@@ -748,12 +859,15 @@ static void do_set_pte(struct lg_cpu *cpu, int idx,
748 * all the page tables, not just the current one. This is rare. 859 * all the page tables, not just the current one. This is rare.
749 * 860 *
750 * The benefit is that when we have to track a new page table, we can keep all 861 * The benefit is that when we have to track a new page table, we can keep all
751 * the kernel mappings. This speeds up context switch immensely. */ 862 * the kernel mappings. This speeds up context switch immensely.
863 */
752void guest_set_pte(struct lg_cpu *cpu, 864void guest_set_pte(struct lg_cpu *cpu,
753 unsigned long gpgdir, unsigned long vaddr, pte_t gpte) 865 unsigned long gpgdir, unsigned long vaddr, pte_t gpte)
754{ 866{
755 /* Kernel mappings must be changed on all top levels. Slow, but doesn't 867 /*
756 * happen often. */ 868 * Kernel mappings must be changed on all top levels. Slow, but doesn't
869 * happen often.
870 */
757 if (vaddr >= cpu->lg->kernel_address) { 871 if (vaddr >= cpu->lg->kernel_address) {
758 unsigned int i; 872 unsigned int i;
759 for (i = 0; i < ARRAY_SIZE(cpu->lg->pgdirs); i++) 873 for (i = 0; i < ARRAY_SIZE(cpu->lg->pgdirs); i++)
@@ -795,19 +909,25 @@ void guest_set_pgd(struct lguest *lg, unsigned long gpgdir, u32 idx)
795 /* ... throw it away. */ 909 /* ... throw it away. */
796 release_pgd(lg->pgdirs[pgdir].pgdir + idx); 910 release_pgd(lg->pgdirs[pgdir].pgdir + idx);
797} 911}
912
798#ifdef CONFIG_X86_PAE 913#ifdef CONFIG_X86_PAE
914/* For setting a mid-level, we just throw everything away. It's easy. */
799void guest_set_pmd(struct lguest *lg, unsigned long pmdp, u32 idx) 915void guest_set_pmd(struct lguest *lg, unsigned long pmdp, u32 idx)
800{ 916{
801 guest_pagetable_clear_all(&lg->cpus[0]); 917 guest_pagetable_clear_all(&lg->cpus[0]);
802} 918}
803#endif 919#endif
804 920
805/* Once we know how much memory we have we can construct simple identity 921/*H:505
806 * (which set virtual == physical) and linear mappings 922 * To get through boot, we construct simple identity page mappings (which
807 * which will get the Guest far enough into the boot to create its own. 923 * set virtual == physical) and linear mappings which will get the Guest far
924 * enough into the boot to create its own. The linear mapping means we
925 * simplify the Guest boot, but it makes assumptions about their PAGE_OFFSET,
926 * as you'll see.
808 * 927 *
809 * We lay them out of the way, just below the initrd (which is why we need to 928 * We lay them out of the way, just below the initrd (which is why we need to
810 * know its size here). */ 929 * know its size here).
930 */
811static unsigned long setup_pagetables(struct lguest *lg, 931static unsigned long setup_pagetables(struct lguest *lg,
812 unsigned long mem, 932 unsigned long mem,
813 unsigned long initrd_size) 933 unsigned long initrd_size)
@@ -825,8 +945,10 @@ static unsigned long setup_pagetables(struct lguest *lg,
825 unsigned int phys_linear; 945 unsigned int phys_linear;
826#endif 946#endif
827 947
828 /* We have mapped_pages frames to map, so we need 948 /*
829 * linear_pages page tables to map them. */ 949 * We have mapped_pages frames to map, so we need linear_pages page
950 * tables to map them.
951 */
830 mapped_pages = mem / PAGE_SIZE; 952 mapped_pages = mem / PAGE_SIZE;
831 linear_pages = (mapped_pages + PTRS_PER_PTE - 1) / PTRS_PER_PTE; 953 linear_pages = (mapped_pages + PTRS_PER_PTE - 1) / PTRS_PER_PTE;
832 954
@@ -837,10 +959,16 @@ static unsigned long setup_pagetables(struct lguest *lg,
837 linear = (void *)pgdir - linear_pages * PAGE_SIZE; 959 linear = (void *)pgdir - linear_pages * PAGE_SIZE;
838 960
839#ifdef CONFIG_X86_PAE 961#ifdef CONFIG_X86_PAE
962 /*
963 * And the single mid page goes below that. We only use one, but
964 * that's enough to map 1G, which definitely gets us through boot.
965 */
840 pmds = (void *)linear - PAGE_SIZE; 966 pmds = (void *)linear - PAGE_SIZE;
841#endif 967#endif
842 /* Linear mapping is easy: put every page's address into the 968 /*
843 * mapping in order. */ 969 * Linear mapping is easy: put every page's address into the
970 * mapping in order.
971 */
844 for (i = 0; i < mapped_pages; i++) { 972 for (i = 0; i < mapped_pages; i++) {
845 pte_t pte; 973 pte_t pte;
846 pte = pfn_pte(i, __pgprot(_PAGE_PRESENT|_PAGE_RW|_PAGE_USER)); 974 pte = pfn_pte(i, __pgprot(_PAGE_PRESENT|_PAGE_RW|_PAGE_USER));
@@ -848,11 +976,14 @@ static unsigned long setup_pagetables(struct lguest *lg,
848 return -EFAULT; 976 return -EFAULT;
849 } 977 }
850 978
851 /* The top level points to the linear page table pages above.
852 * We setup the identity and linear mappings here. */
853#ifdef CONFIG_X86_PAE 979#ifdef CONFIG_X86_PAE
980 /*
981 * Make the Guest PMD entries point to the corresponding place in the
982 * linear mapping (up to one page worth of PMD).
983 */
854 for (i = j = 0; i < mapped_pages && j < PTRS_PER_PMD; 984 for (i = j = 0; i < mapped_pages && j < PTRS_PER_PMD;
855 i += PTRS_PER_PTE, j++) { 985 i += PTRS_PER_PTE, j++) {
986 /* FIXME: native_set_pmd is overkill here. */
856 native_set_pmd(&pmd, __pmd(((unsigned long)(linear + i) 987 native_set_pmd(&pmd, __pmd(((unsigned long)(linear + i)
857 - mem_base) | _PAGE_PRESENT | _PAGE_RW | _PAGE_USER)); 988 - mem_base) | _PAGE_PRESENT | _PAGE_RW | _PAGE_USER));
858 989
@@ -860,18 +991,36 @@ static unsigned long setup_pagetables(struct lguest *lg,
860 return -EFAULT; 991 return -EFAULT;
861 } 992 }
862 993
994 /* One PGD entry, pointing to that PMD page. */
863 set_pgd(&pgd, __pgd(((u32)pmds - mem_base) | _PAGE_PRESENT)); 995 set_pgd(&pgd, __pgd(((u32)pmds - mem_base) | _PAGE_PRESENT));
996 /* Copy it in as the first PGD entry (ie. addresses 0-1G). */
864 if (copy_to_user(&pgdir[0], &pgd, sizeof(pgd)) != 0) 997 if (copy_to_user(&pgdir[0], &pgd, sizeof(pgd)) != 0)
865 return -EFAULT; 998 return -EFAULT;
999 /*
1000 * And the third PGD entry (ie. addresses 3G-4G).
1001 *
1002 * FIXME: This assumes that PAGE_OFFSET for the Guest is 0xC0000000.
1003 */
866 if (copy_to_user(&pgdir[3], &pgd, sizeof(pgd)) != 0) 1004 if (copy_to_user(&pgdir[3], &pgd, sizeof(pgd)) != 0)
867 return -EFAULT; 1005 return -EFAULT;
868#else 1006#else
1007 /*
1008 * The top level points to the linear page table pages above.
1009 * We setup the identity and linear mappings here.
1010 */
869 phys_linear = (unsigned long)linear - mem_base; 1011 phys_linear = (unsigned long)linear - mem_base;
870 for (i = 0; i < mapped_pages; i += PTRS_PER_PTE) { 1012 for (i = 0; i < mapped_pages; i += PTRS_PER_PTE) {
871 pgd_t pgd; 1013 pgd_t pgd;
1014 /*
1015 * Create a PGD entry which points to the right part of the
1016 * linear PTE pages.
1017 */
872 pgd = __pgd((phys_linear + i * sizeof(pte_t)) | 1018 pgd = __pgd((phys_linear + i * sizeof(pte_t)) |
873 (_PAGE_PRESENT | _PAGE_RW | _PAGE_USER)); 1019 (_PAGE_PRESENT | _PAGE_RW | _PAGE_USER));
874 1020
1021 /*
1022 * Copy it into the PGD page at 0 and PAGE_OFFSET.
1023 */
875 if (copy_to_user(&pgdir[i / PTRS_PER_PTE], &pgd, sizeof(pgd)) 1024 if (copy_to_user(&pgdir[i / PTRS_PER_PTE], &pgd, sizeof(pgd))
876 || copy_to_user(&pgdir[pgd_index(PAGE_OFFSET) 1025 || copy_to_user(&pgdir[pgd_index(PAGE_OFFSET)
877 + i / PTRS_PER_PTE], 1026 + i / PTRS_PER_PTE],
@@ -880,15 +1029,19 @@ static unsigned long setup_pagetables(struct lguest *lg,
880 } 1029 }
881#endif 1030#endif
882 1031
883 /* We return the top level (guest-physical) address: remember where 1032 /*
884 * this is. */ 1033 * We return the top level (guest-physical) address: we remember where
1034 * this is to write it into lguest_data when the Guest initializes.
1035 */
885 return (unsigned long)pgdir - mem_base; 1036 return (unsigned long)pgdir - mem_base;
886} 1037}
887 1038
888/*H:500 (vii) Setting up the page tables initially. 1039/*H:500
1040 * (vii) Setting up the page tables initially.
889 * 1041 *
890 * When a Guest is first created, the Launcher tells us where the toplevel of 1042 * When a Guest is first created, the Launcher tells us where the toplevel of
891 * its first page table is. We set some things up here: */ 1043 * its first page table is. We set some things up here:
1044 */
892int init_guest_pagetable(struct lguest *lg) 1045int init_guest_pagetable(struct lguest *lg)
893{ 1046{
894 u64 mem; 1047 u64 mem;
@@ -898,21 +1051,27 @@ int init_guest_pagetable(struct lguest *lg)
898 pgd_t *pgd; 1051 pgd_t *pgd;
899 pmd_t *pmd_table; 1052 pmd_t *pmd_table;
900#endif 1053#endif
901 /* Get the Guest memory size and the ramdisk size from the boot header 1054 /*
902 * located at lg->mem_base (Guest address 0). */ 1055 * Get the Guest memory size and the ramdisk size from the boot header
1056 * located at lg->mem_base (Guest address 0).
1057 */
903 if (copy_from_user(&mem, &boot->e820_map[0].size, sizeof(mem)) 1058 if (copy_from_user(&mem, &boot->e820_map[0].size, sizeof(mem))
904 || get_user(initrd_size, &boot->hdr.ramdisk_size)) 1059 || get_user(initrd_size, &boot->hdr.ramdisk_size))
905 return -EFAULT; 1060 return -EFAULT;
906 1061
907 /* We start on the first shadow page table, and give it a blank PGD 1062 /*
908 * page. */ 1063 * We start on the first shadow page table, and give it a blank PGD
1064 * page.
1065 */
909 lg->pgdirs[0].gpgdir = setup_pagetables(lg, mem, initrd_size); 1066 lg->pgdirs[0].gpgdir = setup_pagetables(lg, mem, initrd_size);
910 if (IS_ERR_VALUE(lg->pgdirs[0].gpgdir)) 1067 if (IS_ERR_VALUE(lg->pgdirs[0].gpgdir))
911 return lg->pgdirs[0].gpgdir; 1068 return lg->pgdirs[0].gpgdir;
912 lg->pgdirs[0].pgdir = (pgd_t *)get_zeroed_page(GFP_KERNEL); 1069 lg->pgdirs[0].pgdir = (pgd_t *)get_zeroed_page(GFP_KERNEL);
913 if (!lg->pgdirs[0].pgdir) 1070 if (!lg->pgdirs[0].pgdir)
914 return -ENOMEM; 1071 return -ENOMEM;
1072
915#ifdef CONFIG_X86_PAE 1073#ifdef CONFIG_X86_PAE
1074 /* For PAE, we also create the initial mid-level. */
916 pgd = lg->pgdirs[0].pgdir; 1075 pgd = lg->pgdirs[0].pgdir;
917 pmd_table = (pmd_t *) get_zeroed_page(GFP_KERNEL); 1076 pmd_table = (pmd_t *) get_zeroed_page(GFP_KERNEL);
918 if (!pmd_table) 1077 if (!pmd_table)
@@ -921,27 +1080,33 @@ int init_guest_pagetable(struct lguest *lg)
921 set_pgd(pgd + SWITCHER_PGD_INDEX, 1080 set_pgd(pgd + SWITCHER_PGD_INDEX,
922 __pgd(__pa(pmd_table) | _PAGE_PRESENT)); 1081 __pgd(__pa(pmd_table) | _PAGE_PRESENT));
923#endif 1082#endif
1083
1084 /* This is the current page table. */
924 lg->cpus[0].cpu_pgd = 0; 1085 lg->cpus[0].cpu_pgd = 0;
925 return 0; 1086 return 0;
926} 1087}
927 1088
928/* When the Guest calls LHCALL_LGUEST_INIT we do more setup. */ 1089/*H:508 When the Guest calls LHCALL_LGUEST_INIT we do more setup. */
929void page_table_guest_data_init(struct lg_cpu *cpu) 1090void page_table_guest_data_init(struct lg_cpu *cpu)
930{ 1091{
931 /* We get the kernel address: above this is all kernel memory. */ 1092 /* We get the kernel address: above this is all kernel memory. */
932 if (get_user(cpu->lg->kernel_address, 1093 if (get_user(cpu->lg->kernel_address,
933 &cpu->lg->lguest_data->kernel_address) 1094 &cpu->lg->lguest_data->kernel_address)
934 /* We tell the Guest that it can't use the top 2 or 4 MB 1095 /*
935 * of virtual addresses used by the Switcher. */ 1096 * We tell the Guest that it can't use the top 2 or 4 MB
1097 * of virtual addresses used by the Switcher.
1098 */
936 || put_user(RESERVE_MEM * 1024 * 1024, 1099 || put_user(RESERVE_MEM * 1024 * 1024,
937 &cpu->lg->lguest_data->reserve_mem) 1100 &cpu->lg->lguest_data->reserve_mem)
938 || put_user(cpu->lg->pgdirs[0].gpgdir, 1101 || put_user(cpu->lg->pgdirs[0].gpgdir,
939 &cpu->lg->lguest_data->pgdir)) 1102 &cpu->lg->lguest_data->pgdir))
940 kill_guest(cpu, "bad guest page %p", cpu->lg->lguest_data); 1103 kill_guest(cpu, "bad guest page %p", cpu->lg->lguest_data);
941 1104
942 /* In flush_user_mappings() we loop from 0 to 1105 /*
1106 * In flush_user_mappings() we loop from 0 to
943 * "pgd_index(lg->kernel_address)". This assumes it won't hit the 1107 * "pgd_index(lg->kernel_address)". This assumes it won't hit the
944 * Switcher mappings, so check that now. */ 1108 * Switcher mappings, so check that now.
1109 */
945#ifdef CONFIG_X86_PAE 1110#ifdef CONFIG_X86_PAE
946 if (pgd_index(cpu->lg->kernel_address) == SWITCHER_PGD_INDEX && 1111 if (pgd_index(cpu->lg->kernel_address) == SWITCHER_PGD_INDEX &&
947 pmd_index(cpu->lg->kernel_address) == SWITCHER_PMD_INDEX) 1112 pmd_index(cpu->lg->kernel_address) == SWITCHER_PMD_INDEX)
@@ -964,12 +1129,14 @@ void free_guest_pagetable(struct lguest *lg)
964 free_page((long)lg->pgdirs[i].pgdir); 1129 free_page((long)lg->pgdirs[i].pgdir);
965} 1130}
966 1131
967/*H:480 (vi) Mapping the Switcher when the Guest is about to run. 1132/*H:480
1133 * (vi) Mapping the Switcher when the Guest is about to run.
968 * 1134 *
969 * The Switcher and the two pages for this CPU need to be visible in the 1135 * The Switcher and the two pages for this CPU need to be visible in the
970 * Guest (and not the pages for other CPUs). We have the appropriate PTE pages 1136 * Guest (and not the pages for other CPUs). We have the appropriate PTE pages
971 * for each CPU already set up, we just need to hook them in now we know which 1137 * for each CPU already set up, we just need to hook them in now we know which
972 * Guest is about to run on this CPU. */ 1138 * Guest is about to run on this CPU.
1139 */
973void map_switcher_in_guest(struct lg_cpu *cpu, struct lguest_pages *pages) 1140void map_switcher_in_guest(struct lg_cpu *cpu, struct lguest_pages *pages)
974{ 1141{
975 pte_t *switcher_pte_page = __get_cpu_var(switcher_pte_pages); 1142 pte_t *switcher_pte_page = __get_cpu_var(switcher_pte_pages);
@@ -980,30 +1147,38 @@ void map_switcher_in_guest(struct lg_cpu *cpu, struct lguest_pages *pages)
980 pmd_t switcher_pmd; 1147 pmd_t switcher_pmd;
981 pmd_t *pmd_table; 1148 pmd_t *pmd_table;
982 1149
1150 /* FIXME: native_set_pmd is overkill here. */
983 native_set_pmd(&switcher_pmd, pfn_pmd(__pa(switcher_pte_page) >> 1151 native_set_pmd(&switcher_pmd, pfn_pmd(__pa(switcher_pte_page) >>
984 PAGE_SHIFT, PAGE_KERNEL_EXEC)); 1152 PAGE_SHIFT, PAGE_KERNEL_EXEC));
985 1153
1154 /* Figure out where the pmd page is, by reading the PGD, and converting
1155 * it to a virtual address. */
986 pmd_table = __va(pgd_pfn(cpu->lg-> 1156 pmd_table = __va(pgd_pfn(cpu->lg->
987 pgdirs[cpu->cpu_pgd].pgdir[SWITCHER_PGD_INDEX]) 1157 pgdirs[cpu->cpu_pgd].pgdir[SWITCHER_PGD_INDEX])
988 << PAGE_SHIFT); 1158 << PAGE_SHIFT);
1159 /* Now write it into the shadow page table. */
989 native_set_pmd(&pmd_table[SWITCHER_PMD_INDEX], switcher_pmd); 1160 native_set_pmd(&pmd_table[SWITCHER_PMD_INDEX], switcher_pmd);
990#else 1161#else
991 pgd_t switcher_pgd; 1162 pgd_t switcher_pgd;
992 1163
993 /* Make the last PGD entry for this Guest point to the Switcher's PTE 1164 /*
994 * page for this CPU (with appropriate flags). */ 1165 * Make the last PGD entry for this Guest point to the Switcher's PTE
1166 * page for this CPU (with appropriate flags).
1167 */
995 switcher_pgd = __pgd(__pa(switcher_pte_page) | __PAGE_KERNEL_EXEC); 1168 switcher_pgd = __pgd(__pa(switcher_pte_page) | __PAGE_KERNEL_EXEC);
996 1169
997 cpu->lg->pgdirs[cpu->cpu_pgd].pgdir[SWITCHER_PGD_INDEX] = switcher_pgd; 1170 cpu->lg->pgdirs[cpu->cpu_pgd].pgdir[SWITCHER_PGD_INDEX] = switcher_pgd;
998 1171
999#endif 1172#endif
1000 /* We also change the Switcher PTE page. When we're running the Guest, 1173 /*
1174 * We also change the Switcher PTE page. When we're running the Guest,
1001 * we want the Guest's "regs" page to appear where the first Switcher 1175 * we want the Guest's "regs" page to appear where the first Switcher
1002 * page for this CPU is. This is an optimization: when the Switcher 1176 * page for this CPU is. This is an optimization: when the Switcher
1003 * saves the Guest registers, it saves them into the first page of this 1177 * saves the Guest registers, it saves them into the first page of this
1004 * CPU's "struct lguest_pages": if we make sure the Guest's register 1178 * CPU's "struct lguest_pages": if we make sure the Guest's register
1005 * page is already mapped there, we don't have to copy them out 1179 * page is already mapped there, we don't have to copy them out
1006 * again. */ 1180 * again.
1181 */
1007 pfn = __pa(cpu->regs_page) >> PAGE_SHIFT; 1182 pfn = __pa(cpu->regs_page) >> PAGE_SHIFT;
1008 native_set_pte(&regs_pte, pfn_pte(pfn, PAGE_KERNEL)); 1183 native_set_pte(&regs_pte, pfn_pte(pfn, PAGE_KERNEL));
1009 native_set_pte(&switcher_pte_page[pte_index((unsigned long)pages)], 1184 native_set_pte(&switcher_pte_page[pte_index((unsigned long)pages)],
@@ -1019,10 +1194,12 @@ static void free_switcher_pte_pages(void)
1019 free_page((long)switcher_pte_page(i)); 1194 free_page((long)switcher_pte_page(i));
1020} 1195}
1021 1196
1022/*H:520 Setting up the Switcher PTE page for given CPU is fairly easy, given 1197/*H:520
1198 * Setting up the Switcher PTE page for given CPU is fairly easy, given
1023 * the CPU number and the "struct page"s for the Switcher code itself. 1199 * the CPU number and the "struct page"s for the Switcher code itself.
1024 * 1200 *
1025 * Currently the Switcher is less than a page long, so "pages" is always 1. */ 1201 * Currently the Switcher is less than a page long, so "pages" is always 1.
1202 */
1026static __init void populate_switcher_pte_page(unsigned int cpu, 1203static __init void populate_switcher_pte_page(unsigned int cpu,
1027 struct page *switcher_page[], 1204 struct page *switcher_page[],
1028 unsigned int pages) 1205 unsigned int pages)
@@ -1043,13 +1220,16 @@ static __init void populate_switcher_pte_page(unsigned int cpu,
1043 native_set_pte(&pte[i], pfn_pte(page_to_pfn(switcher_page[i]), 1220 native_set_pte(&pte[i], pfn_pte(page_to_pfn(switcher_page[i]),
1044 __pgprot(_PAGE_PRESENT|_PAGE_ACCESSED|_PAGE_RW))); 1221 __pgprot(_PAGE_PRESENT|_PAGE_ACCESSED|_PAGE_RW)));
1045 1222
1046 /* The second page contains the "struct lguest_ro_state", and is 1223 /*
1047 * read-only. */ 1224 * The second page contains the "struct lguest_ro_state", and is
1225 * read-only.
1226 */
1048 native_set_pte(&pte[i+1], pfn_pte(page_to_pfn(switcher_page[i+1]), 1227 native_set_pte(&pte[i+1], pfn_pte(page_to_pfn(switcher_page[i+1]),
1049 __pgprot(_PAGE_PRESENT|_PAGE_ACCESSED))); 1228 __pgprot(_PAGE_PRESENT|_PAGE_ACCESSED)));
1050} 1229}
1051 1230
1052/* We've made it through the page table code. Perhaps our tired brains are 1231/*
1232 * We've made it through the page table code. Perhaps our tired brains are
1053 * still processing the details, or perhaps we're simply glad it's over. 1233 * still processing the details, or perhaps we're simply glad it's over.
1054 * 1234 *
1055 * If nothing else, note that all this complexity in juggling shadow page tables 1235 * If nothing else, note that all this complexity in juggling shadow page tables
@@ -1058,10 +1238,13 @@ static __init void populate_switcher_pte_page(unsigned int cpu,
1058 * uses exotic direct Guest pagetable manipulation, and why both Intel and AMD 1238 * uses exotic direct Guest pagetable manipulation, and why both Intel and AMD
1059 * have implemented shadow page table support directly into hardware. 1239 * have implemented shadow page table support directly into hardware.
1060 * 1240 *
1061 * There is just one file remaining in the Host. */ 1241 * There is just one file remaining in the Host.
1242 */
1062 1243
1063/*H:510 At boot or module load time, init_pagetables() allocates and populates 1244/*H:510
1064 * the Switcher PTE page for each CPU. */ 1245 * At boot or module load time, init_pagetables() allocates and populates
1246 * the Switcher PTE page for each CPU.
1247 */
1065__init int init_pagetables(struct page **switcher_page, unsigned int pages) 1248__init int init_pagetables(struct page **switcher_page, unsigned int pages)
1066{ 1249{
1067 unsigned int i; 1250 unsigned int i;
diff --git a/drivers/lguest/segments.c b/drivers/lguest/segments.c
index 482ed5a18750..951c57b0a7e0 100644
--- a/drivers/lguest/segments.c
+++ b/drivers/lguest/segments.c
@@ -1,4 +1,5 @@
1/*P:600 The x86 architecture has segments, which involve a table of descriptors 1/*P:600
2 * The x86 architecture has segments, which involve a table of descriptors
2 * which can be used to do funky things with virtual address interpretation. 3 * which can be used to do funky things with virtual address interpretation.
3 * We originally used to use segments so the Guest couldn't alter the 4 * We originally used to use segments so the Guest couldn't alter the
4 * Guest<->Host Switcher, and then we had to trim Guest segments, and restore 5 * Guest<->Host Switcher, and then we had to trim Guest segments, and restore
@@ -8,7 +9,8 @@
8 * 9 *
9 * In these modern times, the segment handling code consists of simple sanity 10 * In these modern times, the segment handling code consists of simple sanity
10 * checks, and the worst you'll experience reading this code is butterfly-rash 11 * checks, and the worst you'll experience reading this code is butterfly-rash
11 * from frolicking through its parklike serenity. :*/ 12 * from frolicking through its parklike serenity.
13:*/
12#include "lg.h" 14#include "lg.h"
13 15
14/*H:600 16/*H:600
@@ -41,10 +43,12 @@
41 * begin. 43 * begin.
42 */ 44 */
43 45
44/* There are several entries we don't let the Guest set. The TSS entry is the 46/*
47 * There are several entries we don't let the Guest set. The TSS entry is the
45 * "Task State Segment" which controls all kinds of delicate things. The 48 * "Task State Segment" which controls all kinds of delicate things. The
46 * LGUEST_CS and LGUEST_DS entries are reserved for the Switcher, and the 49 * LGUEST_CS and LGUEST_DS entries are reserved for the Switcher, and the
47 * the Guest can't be trusted to deal with double faults. */ 50 * the Guest can't be trusted to deal with double faults.
51 */
48static bool ignored_gdt(unsigned int num) 52static bool ignored_gdt(unsigned int num)
49{ 53{
50 return (num == GDT_ENTRY_TSS 54 return (num == GDT_ENTRY_TSS
@@ -53,42 +57,52 @@ static bool ignored_gdt(unsigned int num)
53 || num == GDT_ENTRY_DOUBLEFAULT_TSS); 57 || num == GDT_ENTRY_DOUBLEFAULT_TSS);
54} 58}
55 59
56/*H:630 Once the Guest gave us new GDT entries, we fix them up a little. We 60/*H:630
61 * Once the Guest gave us new GDT entries, we fix them up a little. We
57 * don't care if they're invalid: the worst that can happen is a General 62 * don't care if they're invalid: the worst that can happen is a General
58 * Protection Fault in the Switcher when it restores a Guest segment register 63 * Protection Fault in the Switcher when it restores a Guest segment register
59 * which tries to use that entry. Then we kill the Guest for causing such a 64 * which tries to use that entry. Then we kill the Guest for causing such a
60 * mess: the message will be "unhandled trap 256". */ 65 * mess: the message will be "unhandled trap 256".
66 */
61static void fixup_gdt_table(struct lg_cpu *cpu, unsigned start, unsigned end) 67static void fixup_gdt_table(struct lg_cpu *cpu, unsigned start, unsigned end)
62{ 68{
63 unsigned int i; 69 unsigned int i;
64 70
65 for (i = start; i < end; i++) { 71 for (i = start; i < end; i++) {
66 /* We never copy these ones to real GDT, so we don't care what 72 /*
67 * they say */ 73 * We never copy these ones to real GDT, so we don't care what
74 * they say
75 */
68 if (ignored_gdt(i)) 76 if (ignored_gdt(i))
69 continue; 77 continue;
70 78
71 /* Segment descriptors contain a privilege level: the Guest is 79 /*
80 * Segment descriptors contain a privilege level: the Guest is
72 * sometimes careless and leaves this as 0, even though it's 81 * sometimes careless and leaves this as 0, even though it's
73 * running at privilege level 1. If so, we fix it here. */ 82 * running at privilege level 1. If so, we fix it here.
83 */
74 if ((cpu->arch.gdt[i].b & 0x00006000) == 0) 84 if ((cpu->arch.gdt[i].b & 0x00006000) == 0)
75 cpu->arch.gdt[i].b |= (GUEST_PL << 13); 85 cpu->arch.gdt[i].b |= (GUEST_PL << 13);
76 86
77 /* Each descriptor has an "accessed" bit. If we don't set it 87 /*
88 * Each descriptor has an "accessed" bit. If we don't set it
78 * now, the CPU will try to set it when the Guest first loads 89 * now, the CPU will try to set it when the Guest first loads
79 * that entry into a segment register. But the GDT isn't 90 * that entry into a segment register. But the GDT isn't
80 * writable by the Guest, so bad things can happen. */ 91 * writable by the Guest, so bad things can happen.
92 */
81 cpu->arch.gdt[i].b |= 0x00000100; 93 cpu->arch.gdt[i].b |= 0x00000100;
82 } 94 }
83} 95}
84 96
85/*H:610 Like the IDT, we never simply use the GDT the Guest gives us. We keep 97/*H:610
98 * Like the IDT, we never simply use the GDT the Guest gives us. We keep
86 * a GDT for each CPU, and copy across the Guest's entries each time we want to 99 * a GDT for each CPU, and copy across the Guest's entries each time we want to
87 * run the Guest on that CPU. 100 * run the Guest on that CPU.
88 * 101 *
89 * This routine is called at boot or modprobe time for each CPU to set up the 102 * This routine is called at boot or modprobe time for each CPU to set up the
90 * constant GDT entries: the ones which are the same no matter what Guest we're 103 * constant GDT entries: the ones which are the same no matter what Guest we're
91 * running. */ 104 * running.
105 */
92void setup_default_gdt_entries(struct lguest_ro_state *state) 106void setup_default_gdt_entries(struct lguest_ro_state *state)
93{ 107{
94 struct desc_struct *gdt = state->guest_gdt; 108 struct desc_struct *gdt = state->guest_gdt;
@@ -98,30 +112,37 @@ void setup_default_gdt_entries(struct lguest_ro_state *state)
98 gdt[GDT_ENTRY_LGUEST_CS] = FULL_EXEC_SEGMENT; 112 gdt[GDT_ENTRY_LGUEST_CS] = FULL_EXEC_SEGMENT;
99 gdt[GDT_ENTRY_LGUEST_DS] = FULL_SEGMENT; 113 gdt[GDT_ENTRY_LGUEST_DS] = FULL_SEGMENT;
100 114
101 /* The TSS segment refers to the TSS entry for this particular CPU. 115 /*
116 * The TSS segment refers to the TSS entry for this particular CPU.
102 * Forgive the magic flags: the 0x8900 means the entry is Present, it's 117 * Forgive the magic flags: the 0x8900 means the entry is Present, it's
103 * privilege level 0 Available 386 TSS system segment, and the 0x67 118 * privilege level 0 Available 386 TSS system segment, and the 0x67
104 * means Saturn is eclipsed by Mercury in the twelfth house. */ 119 * means Saturn is eclipsed by Mercury in the twelfth house.
120 */
105 gdt[GDT_ENTRY_TSS].a = 0x00000067 | (tss << 16); 121 gdt[GDT_ENTRY_TSS].a = 0x00000067 | (tss << 16);
106 gdt[GDT_ENTRY_TSS].b = 0x00008900 | (tss & 0xFF000000) 122 gdt[GDT_ENTRY_TSS].b = 0x00008900 | (tss & 0xFF000000)
107 | ((tss >> 16) & 0x000000FF); 123 | ((tss >> 16) & 0x000000FF);
108} 124}
109 125
110/* This routine sets up the initial Guest GDT for booting. All entries start 126/*
111 * as 0 (unusable). */ 127 * This routine sets up the initial Guest GDT for booting. All entries start
128 * as 0 (unusable).
129 */
112void setup_guest_gdt(struct lg_cpu *cpu) 130void setup_guest_gdt(struct lg_cpu *cpu)
113{ 131{
114 /* Start with full 0-4G segments... */ 132 /*
133 * Start with full 0-4G segments...except the Guest is allowed to use
134 * them, so set the privilege level appropriately in the flags.
135 */
115 cpu->arch.gdt[GDT_ENTRY_KERNEL_CS] = FULL_EXEC_SEGMENT; 136 cpu->arch.gdt[GDT_ENTRY_KERNEL_CS] = FULL_EXEC_SEGMENT;
116 cpu->arch.gdt[GDT_ENTRY_KERNEL_DS] = FULL_SEGMENT; 137 cpu->arch.gdt[GDT_ENTRY_KERNEL_DS] = FULL_SEGMENT;
117 /* ...except the Guest is allowed to use them, so set the privilege
118 * level appropriately in the flags. */
119 cpu->arch.gdt[GDT_ENTRY_KERNEL_CS].b |= (GUEST_PL << 13); 138 cpu->arch.gdt[GDT_ENTRY_KERNEL_CS].b |= (GUEST_PL << 13);
120 cpu->arch.gdt[GDT_ENTRY_KERNEL_DS].b |= (GUEST_PL << 13); 139 cpu->arch.gdt[GDT_ENTRY_KERNEL_DS].b |= (GUEST_PL << 13);
121} 140}
122 141
123/*H:650 An optimization of copy_gdt(), for just the three "thead-local storage" 142/*H:650
124 * entries. */ 143 * An optimization of copy_gdt(), for just the three "thead-local storage"
144 * entries.
145 */
125void copy_gdt_tls(const struct lg_cpu *cpu, struct desc_struct *gdt) 146void copy_gdt_tls(const struct lg_cpu *cpu, struct desc_struct *gdt)
126{ 147{
127 unsigned int i; 148 unsigned int i;
@@ -130,26 +151,34 @@ void copy_gdt_tls(const struct lg_cpu *cpu, struct desc_struct *gdt)
130 gdt[i] = cpu->arch.gdt[i]; 151 gdt[i] = cpu->arch.gdt[i];
131} 152}
132 153
133/*H:640 When the Guest is run on a different CPU, or the GDT entries have 154/*H:640
134 * changed, copy_gdt() is called to copy the Guest's GDT entries across to this 155 * When the Guest is run on a different CPU, or the GDT entries have changed,
135 * CPU's GDT. */ 156 * copy_gdt() is called to copy the Guest's GDT entries across to this CPU's
157 * GDT.
158 */
136void copy_gdt(const struct lg_cpu *cpu, struct desc_struct *gdt) 159void copy_gdt(const struct lg_cpu *cpu, struct desc_struct *gdt)
137{ 160{
138 unsigned int i; 161 unsigned int i;
139 162
140 /* The default entries from setup_default_gdt_entries() are not 163 /*
141 * replaced. See ignored_gdt() above. */ 164 * The default entries from setup_default_gdt_entries() are not
165 * replaced. See ignored_gdt() above.
166 */
142 for (i = 0; i < GDT_ENTRIES; i++) 167 for (i = 0; i < GDT_ENTRIES; i++)
143 if (!ignored_gdt(i)) 168 if (!ignored_gdt(i))
144 gdt[i] = cpu->arch.gdt[i]; 169 gdt[i] = cpu->arch.gdt[i];
145} 170}
146 171
147/*H:620 This is where the Guest asks us to load a new GDT entry 172/*H:620
148 * (LHCALL_LOAD_GDT_ENTRY). We tweak the entry and copy it in. */ 173 * This is where the Guest asks us to load a new GDT entry
174 * (LHCALL_LOAD_GDT_ENTRY). We tweak the entry and copy it in.
175 */
149void load_guest_gdt_entry(struct lg_cpu *cpu, u32 num, u32 lo, u32 hi) 176void load_guest_gdt_entry(struct lg_cpu *cpu, u32 num, u32 lo, u32 hi)
150{ 177{
151 /* We assume the Guest has the same number of GDT entries as the 178 /*
152 * Host, otherwise we'd have to dynamically allocate the Guest GDT. */ 179 * We assume the Guest has the same number of GDT entries as the
180 * Host, otherwise we'd have to dynamically allocate the Guest GDT.
181 */
153 if (num >= ARRAY_SIZE(cpu->arch.gdt)) 182 if (num >= ARRAY_SIZE(cpu->arch.gdt))
154 kill_guest(cpu, "too many gdt entries %i", num); 183 kill_guest(cpu, "too many gdt entries %i", num);
155 184
@@ -157,15 +186,19 @@ void load_guest_gdt_entry(struct lg_cpu *cpu, u32 num, u32 lo, u32 hi)
157 cpu->arch.gdt[num].a = lo; 186 cpu->arch.gdt[num].a = lo;
158 cpu->arch.gdt[num].b = hi; 187 cpu->arch.gdt[num].b = hi;
159 fixup_gdt_table(cpu, num, num+1); 188 fixup_gdt_table(cpu, num, num+1);
160 /* Mark that the GDT changed so the core knows it has to copy it again, 189 /*
161 * even if the Guest is run on the same CPU. */ 190 * Mark that the GDT changed so the core knows it has to copy it again,
191 * even if the Guest is run on the same CPU.
192 */
162 cpu->changed |= CHANGED_GDT; 193 cpu->changed |= CHANGED_GDT;
163} 194}
164 195
165/* This is the fast-track version for just changing the three TLS entries. 196/*
197 * This is the fast-track version for just changing the three TLS entries.
166 * Remember that this happens on every context switch, so it's worth 198 * Remember that this happens on every context switch, so it's worth
167 * optimizing. But wouldn't it be neater to have a single hypercall to cover 199 * optimizing. But wouldn't it be neater to have a single hypercall to cover
168 * both cases? */ 200 * both cases?
201 */
169void guest_load_tls(struct lg_cpu *cpu, unsigned long gtls) 202void guest_load_tls(struct lg_cpu *cpu, unsigned long gtls)
170{ 203{
171 struct desc_struct *tls = &cpu->arch.gdt[GDT_ENTRY_TLS_MIN]; 204 struct desc_struct *tls = &cpu->arch.gdt[GDT_ENTRY_TLS_MIN];
@@ -175,7 +208,6 @@ void guest_load_tls(struct lg_cpu *cpu, unsigned long gtls)
175 /* Note that just the TLS entries have changed. */ 208 /* Note that just the TLS entries have changed. */
176 cpu->changed |= CHANGED_GDT_TLS; 209 cpu->changed |= CHANGED_GDT_TLS;
177} 210}
178/*:*/
179 211
180/*H:660 212/*H:660
181 * With this, we have finished the Host. 213 * With this, we have finished the Host.
diff --git a/drivers/lguest/x86/core.c b/drivers/lguest/x86/core.c
index eaf722fe309a..6ae388849a3b 100644
--- a/drivers/lguest/x86/core.c
+++ b/drivers/lguest/x86/core.c
@@ -17,13 +17,15 @@
17 * along with this program; if not, write to the Free Software 17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 18 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19 */ 19 */
20/*P:450 This file contains the x86-specific lguest code. It used to be all 20/*P:450
21 * This file contains the x86-specific lguest code. It used to be all
21 * mixed in with drivers/lguest/core.c but several foolhardy code slashers 22 * mixed in with drivers/lguest/core.c but several foolhardy code slashers
22 * wrestled most of the dependencies out to here in preparation for porting 23 * wrestled most of the dependencies out to here in preparation for porting
23 * lguest to other architectures (see what I mean by foolhardy?). 24 * lguest to other architectures (see what I mean by foolhardy?).
24 * 25 *
25 * This also contains a couple of non-obvious setup and teardown pieces which 26 * This also contains a couple of non-obvious setup and teardown pieces which
26 * were implemented after days of debugging pain. :*/ 27 * were implemented after days of debugging pain.
28:*/
27#include <linux/kernel.h> 29#include <linux/kernel.h>
28#include <linux/start_kernel.h> 30#include <linux/start_kernel.h>
29#include <linux/string.h> 31#include <linux/string.h>
@@ -82,25 +84,33 @@ static DEFINE_PER_CPU(struct lg_cpu *, last_cpu);
82 */ 84 */
83static void copy_in_guest_info(struct lg_cpu *cpu, struct lguest_pages *pages) 85static void copy_in_guest_info(struct lg_cpu *cpu, struct lguest_pages *pages)
84{ 86{
85 /* Copying all this data can be quite expensive. We usually run the 87 /*
88 * Copying all this data can be quite expensive. We usually run the
86 * same Guest we ran last time (and that Guest hasn't run anywhere else 89 * same Guest we ran last time (and that Guest hasn't run anywhere else
87 * meanwhile). If that's not the case, we pretend everything in the 90 * meanwhile). If that's not the case, we pretend everything in the
88 * Guest has changed. */ 91 * Guest has changed.
92 */
89 if (__get_cpu_var(last_cpu) != cpu || cpu->last_pages != pages) { 93 if (__get_cpu_var(last_cpu) != cpu || cpu->last_pages != pages) {
90 __get_cpu_var(last_cpu) = cpu; 94 __get_cpu_var(last_cpu) = cpu;
91 cpu->last_pages = pages; 95 cpu->last_pages = pages;
92 cpu->changed = CHANGED_ALL; 96 cpu->changed = CHANGED_ALL;
93 } 97 }
94 98
95 /* These copies are pretty cheap, so we do them unconditionally: */ 99 /*
96 /* Save the current Host top-level page directory. */ 100 * These copies are pretty cheap, so we do them unconditionally: */
101 /* Save the current Host top-level page directory.
102 */
97 pages->state.host_cr3 = __pa(current->mm->pgd); 103 pages->state.host_cr3 = __pa(current->mm->pgd);
98 /* Set up the Guest's page tables to see this CPU's pages (and no 104 /*
99 * other CPU's pages). */ 105 * Set up the Guest's page tables to see this CPU's pages (and no
106 * other CPU's pages).
107 */
100 map_switcher_in_guest(cpu, pages); 108 map_switcher_in_guest(cpu, pages);
101 /* Set up the two "TSS" members which tell the CPU what stack to use 109 /*
110 * Set up the two "TSS" members which tell the CPU what stack to use
102 * for traps which do directly into the Guest (ie. traps at privilege 111 * for traps which do directly into the Guest (ie. traps at privilege
103 * level 1). */ 112 * level 1).
113 */
104 pages->state.guest_tss.sp1 = cpu->esp1; 114 pages->state.guest_tss.sp1 = cpu->esp1;
105 pages->state.guest_tss.ss1 = cpu->ss1; 115 pages->state.guest_tss.ss1 = cpu->ss1;
106 116
@@ -125,97 +135,126 @@ static void run_guest_once(struct lg_cpu *cpu, struct lguest_pages *pages)
125 /* This is a dummy value we need for GCC's sake. */ 135 /* This is a dummy value we need for GCC's sake. */
126 unsigned int clobber; 136 unsigned int clobber;
127 137
128 /* Copy the guest-specific information into this CPU's "struct 138 /*
129 * lguest_pages". */ 139 * Copy the guest-specific information into this CPU's "struct
140 * lguest_pages".
141 */
130 copy_in_guest_info(cpu, pages); 142 copy_in_guest_info(cpu, pages);
131 143
132 /* Set the trap number to 256 (impossible value). If we fault while 144 /*
145 * Set the trap number to 256 (impossible value). If we fault while
133 * switching to the Guest (bad segment registers or bug), this will 146 * switching to the Guest (bad segment registers or bug), this will
134 * cause us to abort the Guest. */ 147 * cause us to abort the Guest.
148 */
135 cpu->regs->trapnum = 256; 149 cpu->regs->trapnum = 256;
136 150
137 /* Now: we push the "eflags" register on the stack, then do an "lcall". 151 /*
152 * Now: we push the "eflags" register on the stack, then do an "lcall".
138 * This is how we change from using the kernel code segment to using 153 * This is how we change from using the kernel code segment to using
139 * the dedicated lguest code segment, as well as jumping into the 154 * the dedicated lguest code segment, as well as jumping into the
140 * Switcher. 155 * Switcher.
141 * 156 *
142 * The lcall also pushes the old code segment (KERNEL_CS) onto the 157 * The lcall also pushes the old code segment (KERNEL_CS) onto the
143 * stack, then the address of this call. This stack layout happens to 158 * stack, then the address of this call. This stack layout happens to
144 * exactly match the stack layout created by an interrupt... */ 159 * exactly match the stack layout created by an interrupt...
160 */
145 asm volatile("pushf; lcall *lguest_entry" 161 asm volatile("pushf; lcall *lguest_entry"
146 /* This is how we tell GCC that %eax ("a") and %ebx ("b") 162 /*
147 * are changed by this routine. The "=" means output. */ 163 * This is how we tell GCC that %eax ("a") and %ebx ("b")
164 * are changed by this routine. The "=" means output.
165 */
148 : "=a"(clobber), "=b"(clobber) 166 : "=a"(clobber), "=b"(clobber)
149 /* %eax contains the pages pointer. ("0" refers to the 167 /*
168 * %eax contains the pages pointer. ("0" refers to the
150 * 0-th argument above, ie "a"). %ebx contains the 169 * 0-th argument above, ie "a"). %ebx contains the
151 * physical address of the Guest's top-level page 170 * physical address of the Guest's top-level page
152 * directory. */ 171 * directory.
172 */
153 : "0"(pages), "1"(__pa(cpu->lg->pgdirs[cpu->cpu_pgd].pgdir)) 173 : "0"(pages), "1"(__pa(cpu->lg->pgdirs[cpu->cpu_pgd].pgdir))
154 /* We tell gcc that all these registers could change, 174 /*
175 * We tell gcc that all these registers could change,
155 * which means we don't have to save and restore them in 176 * which means we don't have to save and restore them in
156 * the Switcher. */ 177 * the Switcher.
178 */
157 : "memory", "%edx", "%ecx", "%edi", "%esi"); 179 : "memory", "%edx", "%ecx", "%edi", "%esi");
158} 180}
159/*:*/ 181/*:*/
160 182
161/*M:002 There are hooks in the scheduler which we can register to tell when we 183/*M:002
184 * There are hooks in the scheduler which we can register to tell when we
162 * get kicked off the CPU (preempt_notifier_register()). This would allow us 185 * get kicked off the CPU (preempt_notifier_register()). This would allow us
163 * to lazily disable SYSENTER which would regain some performance, and should 186 * to lazily disable SYSENTER which would regain some performance, and should
164 * also simplify copy_in_guest_info(). Note that we'd still need to restore 187 * also simplify copy_in_guest_info(). Note that we'd still need to restore
165 * things when we exit to Launcher userspace, but that's fairly easy. 188 * things when we exit to Launcher userspace, but that's fairly easy.
166 * 189 *
167 * We could also try using this hooks for PGE, but that might be too expensive. 190 * We could also try using these hooks for PGE, but that might be too expensive.
168 * 191 *
169 * The hooks were designed for KVM, but we can also put them to good use. :*/ 192 * The hooks were designed for KVM, but we can also put them to good use.
193:*/
170 194
171/*H:040 This is the i386-specific code to setup and run the Guest. Interrupts 195/*H:040
172 * are disabled: we own the CPU. */ 196 * This is the i386-specific code to setup and run the Guest. Interrupts
197 * are disabled: we own the CPU.
198 */
173void lguest_arch_run_guest(struct lg_cpu *cpu) 199void lguest_arch_run_guest(struct lg_cpu *cpu)
174{ 200{
175 /* Remember the awfully-named TS bit? If the Guest has asked to set it 201 /*
202 * Remember the awfully-named TS bit? If the Guest has asked to set it
176 * we set it now, so we can trap and pass that trap to the Guest if it 203 * we set it now, so we can trap and pass that trap to the Guest if it
177 * uses the FPU. */ 204 * uses the FPU.
205 */
178 if (cpu->ts) 206 if (cpu->ts)
179 unlazy_fpu(current); 207 unlazy_fpu(current);
180 208
181 /* SYSENTER is an optimized way of doing system calls. We can't allow 209 /*
210 * SYSENTER is an optimized way of doing system calls. We can't allow
182 * it because it always jumps to privilege level 0. A normal Guest 211 * it because it always jumps to privilege level 0. A normal Guest
183 * won't try it because we don't advertise it in CPUID, but a malicious 212 * won't try it because we don't advertise it in CPUID, but a malicious
184 * Guest (or malicious Guest userspace program) could, so we tell the 213 * Guest (or malicious Guest userspace program) could, so we tell the
185 * CPU to disable it before running the Guest. */ 214 * CPU to disable it before running the Guest.
215 */
186 if (boot_cpu_has(X86_FEATURE_SEP)) 216 if (boot_cpu_has(X86_FEATURE_SEP))
187 wrmsr(MSR_IA32_SYSENTER_CS, 0, 0); 217 wrmsr(MSR_IA32_SYSENTER_CS, 0, 0);
188 218
189 /* Now we actually run the Guest. It will return when something 219 /*
220 * Now we actually run the Guest. It will return when something
190 * interesting happens, and we can examine its registers to see what it 221 * interesting happens, and we can examine its registers to see what it
191 * was doing. */ 222 * was doing.
223 */
192 run_guest_once(cpu, lguest_pages(raw_smp_processor_id())); 224 run_guest_once(cpu, lguest_pages(raw_smp_processor_id()));
193 225
194 /* Note that the "regs" structure contains two extra entries which are 226 /*
227 * Note that the "regs" structure contains two extra entries which are
195 * not really registers: a trap number which says what interrupt or 228 * not really registers: a trap number which says what interrupt or
196 * trap made the switcher code come back, and an error code which some 229 * trap made the switcher code come back, and an error code which some
197 * traps set. */ 230 * traps set.
231 */
198 232
199 /* Restore SYSENTER if it's supposed to be on. */ 233 /* Restore SYSENTER if it's supposed to be on. */
200 if (boot_cpu_has(X86_FEATURE_SEP)) 234 if (boot_cpu_has(X86_FEATURE_SEP))
201 wrmsr(MSR_IA32_SYSENTER_CS, __KERNEL_CS, 0); 235 wrmsr(MSR_IA32_SYSENTER_CS, __KERNEL_CS, 0);
202 236
203 /* If the Guest page faulted, then the cr2 register will tell us the 237 /*
238 * If the Guest page faulted, then the cr2 register will tell us the
204 * bad virtual address. We have to grab this now, because once we 239 * bad virtual address. We have to grab this now, because once we
205 * re-enable interrupts an interrupt could fault and thus overwrite 240 * re-enable interrupts an interrupt could fault and thus overwrite
206 * cr2, or we could even move off to a different CPU. */ 241 * cr2, or we could even move off to a different CPU.
242 */
207 if (cpu->regs->trapnum == 14) 243 if (cpu->regs->trapnum == 14)
208 cpu->arch.last_pagefault = read_cr2(); 244 cpu->arch.last_pagefault = read_cr2();
209 /* Similarly, if we took a trap because the Guest used the FPU, 245 /*
246 * Similarly, if we took a trap because the Guest used the FPU,
210 * we have to restore the FPU it expects to see. 247 * we have to restore the FPU it expects to see.
211 * math_state_restore() may sleep and we may even move off to 248 * math_state_restore() may sleep and we may even move off to
212 * a different CPU. So all the critical stuff should be done 249 * a different CPU. So all the critical stuff should be done
213 * before this. */ 250 * before this.
251 */
214 else if (cpu->regs->trapnum == 7) 252 else if (cpu->regs->trapnum == 7)
215 math_state_restore(); 253 math_state_restore();
216} 254}
217 255
218/*H:130 Now we've examined the hypercall code; our Guest can make requests. 256/*H:130
257 * Now we've examined the hypercall code; our Guest can make requests.
219 * Our Guest is usually so well behaved; it never tries to do things it isn't 258 * Our Guest is usually so well behaved; it never tries to do things it isn't
220 * allowed to, and uses hypercalls instead. Unfortunately, Linux's paravirtual 259 * allowed to, and uses hypercalls instead. Unfortunately, Linux's paravirtual
221 * infrastructure isn't quite complete, because it doesn't contain replacements 260 * infrastructure isn't quite complete, because it doesn't contain replacements
@@ -225,26 +264,33 @@ void lguest_arch_run_guest(struct lg_cpu *cpu)
225 * 264 *
226 * When the Guest uses one of these instructions, we get a trap (General 265 * When the Guest uses one of these instructions, we get a trap (General
227 * Protection Fault) and come here. We see if it's one of those troublesome 266 * Protection Fault) and come here. We see if it's one of those troublesome
228 * instructions and skip over it. We return true if we did. */ 267 * instructions and skip over it. We return true if we did.
268 */
229static int emulate_insn(struct lg_cpu *cpu) 269static int emulate_insn(struct lg_cpu *cpu)
230{ 270{
231 u8 insn; 271 u8 insn;
232 unsigned int insnlen = 0, in = 0, shift = 0; 272 unsigned int insnlen = 0, in = 0, shift = 0;
233 /* The eip contains the *virtual* address of the Guest's instruction: 273 /*
234 * guest_pa just subtracts the Guest's page_offset. */ 274 * The eip contains the *virtual* address of the Guest's instruction:
275 * guest_pa just subtracts the Guest's page_offset.
276 */
235 unsigned long physaddr = guest_pa(cpu, cpu->regs->eip); 277 unsigned long physaddr = guest_pa(cpu, cpu->regs->eip);
236 278
237 /* This must be the Guest kernel trying to do something, not userspace! 279 /*
280 * This must be the Guest kernel trying to do something, not userspace!
238 * The bottom two bits of the CS segment register are the privilege 281 * The bottom two bits of the CS segment register are the privilege
239 * level. */ 282 * level.
283 */
240 if ((cpu->regs->cs & 3) != GUEST_PL) 284 if ((cpu->regs->cs & 3) != GUEST_PL)
241 return 0; 285 return 0;
242 286
243 /* Decoding x86 instructions is icky. */ 287 /* Decoding x86 instructions is icky. */
244 insn = lgread(cpu, physaddr, u8); 288 insn = lgread(cpu, physaddr, u8);
245 289
246 /* 0x66 is an "operand prefix". It means it's using the upper 16 bits 290 /*
247 of the eax register. */ 291 * 0x66 is an "operand prefix". It means it's using the upper 16 bits
292 * of the eax register.
293 */
248 if (insn == 0x66) { 294 if (insn == 0x66) {
249 shift = 16; 295 shift = 16;
250 /* The instruction is 1 byte so far, read the next byte. */ 296 /* The instruction is 1 byte so far, read the next byte. */
@@ -252,8 +298,10 @@ static int emulate_insn(struct lg_cpu *cpu)
252 insn = lgread(cpu, physaddr + insnlen, u8); 298 insn = lgread(cpu, physaddr + insnlen, u8);
253 } 299 }
254 300
255 /* We can ignore the lower bit for the moment and decode the 4 opcodes 301 /*
256 * we need to emulate. */ 302 * We can ignore the lower bit for the moment and decode the 4 opcodes
303 * we need to emulate.
304 */
257 switch (insn & 0xFE) { 305 switch (insn & 0xFE) {
258 case 0xE4: /* in <next byte>,%al */ 306 case 0xE4: /* in <next byte>,%al */
259 insnlen += 2; 307 insnlen += 2;
@@ -274,9 +322,11 @@ static int emulate_insn(struct lg_cpu *cpu)
274 return 0; 322 return 0;
275 } 323 }
276 324
277 /* If it was an "IN" instruction, they expect the result to be read 325 /*
326 * If it was an "IN" instruction, they expect the result to be read
278 * into %eax, so we change %eax. We always return all-ones, which 327 * into %eax, so we change %eax. We always return all-ones, which
279 * traditionally means "there's nothing there". */ 328 * traditionally means "there's nothing there".
329 */
280 if (in) { 330 if (in) {
281 /* Lower bit tells is whether it's a 16 or 32 bit access */ 331 /* Lower bit tells is whether it's a 16 or 32 bit access */
282 if (insn & 0x1) 332 if (insn & 0x1)
@@ -290,7 +340,8 @@ static int emulate_insn(struct lg_cpu *cpu)
290 return 1; 340 return 1;
291} 341}
292 342
293/* Our hypercalls mechanism used to be based on direct software interrupts. 343/*
344 * Our hypercalls mechanism used to be based on direct software interrupts.
294 * After Anthony's "Refactor hypercall infrastructure" kvm patch, we decided to 345 * After Anthony's "Refactor hypercall infrastructure" kvm patch, we decided to
295 * change over to using kvm hypercalls. 346 * change over to using kvm hypercalls.
296 * 347 *
@@ -318,16 +369,20 @@ static int emulate_insn(struct lg_cpu *cpu)
318 */ 369 */
319static void rewrite_hypercall(struct lg_cpu *cpu) 370static void rewrite_hypercall(struct lg_cpu *cpu)
320{ 371{
321 /* This are the opcodes we use to patch the Guest. The opcode for "int 372 /*
373 * This are the opcodes we use to patch the Guest. The opcode for "int
322 * $0x1f" is "0xcd 0x1f" but vmcall instruction is 3 bytes long, so we 374 * $0x1f" is "0xcd 0x1f" but vmcall instruction is 3 bytes long, so we
323 * complete the sequence with a NOP (0x90). */ 375 * complete the sequence with a NOP (0x90).
376 */
324 u8 insn[3] = {0xcd, 0x1f, 0x90}; 377 u8 insn[3] = {0xcd, 0x1f, 0x90};
325 378
326 __lgwrite(cpu, guest_pa(cpu, cpu->regs->eip), insn, sizeof(insn)); 379 __lgwrite(cpu, guest_pa(cpu, cpu->regs->eip), insn, sizeof(insn));
327 /* The above write might have caused a copy of that page to be made 380 /*
381 * The above write might have caused a copy of that page to be made
328 * (if it was read-only). We need to make sure the Guest has 382 * (if it was read-only). We need to make sure the Guest has
329 * up-to-date pagetables. As this doesn't happen often, we can just 383 * up-to-date pagetables. As this doesn't happen often, we can just
330 * drop them all. */ 384 * drop them all.
385 */
331 guest_pagetable_clear_all(cpu); 386 guest_pagetable_clear_all(cpu);
332} 387}
333 388
@@ -335,9 +390,11 @@ static bool is_hypercall(struct lg_cpu *cpu)
335{ 390{
336 u8 insn[3]; 391 u8 insn[3];
337 392
338 /* This must be the Guest kernel trying to do something. 393 /*
394 * This must be the Guest kernel trying to do something.
339 * The bottom two bits of the CS segment register are the privilege 395 * The bottom two bits of the CS segment register are the privilege
340 * level. */ 396 * level.
397 */
341 if ((cpu->regs->cs & 3) != GUEST_PL) 398 if ((cpu->regs->cs & 3) != GUEST_PL)
342 return false; 399 return false;
343 400
@@ -351,86 +408,105 @@ void lguest_arch_handle_trap(struct lg_cpu *cpu)
351{ 408{
352 switch (cpu->regs->trapnum) { 409 switch (cpu->regs->trapnum) {
353 case 13: /* We've intercepted a General Protection Fault. */ 410 case 13: /* We've intercepted a General Protection Fault. */
354 /* Check if this was one of those annoying IN or OUT 411 /*
412 * Check if this was one of those annoying IN or OUT
355 * instructions which we need to emulate. If so, we just go 413 * instructions which we need to emulate. If so, we just go
356 * back into the Guest after we've done it. */ 414 * back into the Guest after we've done it.
415 */
357 if (cpu->regs->errcode == 0) { 416 if (cpu->regs->errcode == 0) {
358 if (emulate_insn(cpu)) 417 if (emulate_insn(cpu))
359 return; 418 return;
360 } 419 }
361 /* If KVM is active, the vmcall instruction triggers a 420 /*
362 * General Protection Fault. Normally it triggers an 421 * If KVM is active, the vmcall instruction triggers a General
363 * invalid opcode fault (6): */ 422 * Protection Fault. Normally it triggers an invalid opcode
423 * fault (6):
424 */
364 case 6: 425 case 6:
365 /* We need to check if ring == GUEST_PL and 426 /*
366 * faulting instruction == vmcall. */ 427 * We need to check if ring == GUEST_PL and faulting
428 * instruction == vmcall.
429 */
367 if (is_hypercall(cpu)) { 430 if (is_hypercall(cpu)) {
368 rewrite_hypercall(cpu); 431 rewrite_hypercall(cpu);
369 return; 432 return;
370 } 433 }
371 break; 434 break;
372 case 14: /* We've intercepted a Page Fault. */ 435 case 14: /* We've intercepted a Page Fault. */
373 /* The Guest accessed a virtual address that wasn't mapped. 436 /*
437 * The Guest accessed a virtual address that wasn't mapped.
374 * This happens a lot: we don't actually set up most of the page 438 * This happens a lot: we don't actually set up most of the page
375 * tables for the Guest at all when we start: as it runs it asks 439 * tables for the Guest at all when we start: as it runs it asks
376 * for more and more, and we set them up as required. In this 440 * for more and more, and we set them up as required. In this
377 * case, we don't even tell the Guest that the fault happened. 441 * case, we don't even tell the Guest that the fault happened.
378 * 442 *
379 * The errcode tells whether this was a read or a write, and 443 * The errcode tells whether this was a read or a write, and
380 * whether kernel or userspace code. */ 444 * whether kernel or userspace code.
445 */
381 if (demand_page(cpu, cpu->arch.last_pagefault, 446 if (demand_page(cpu, cpu->arch.last_pagefault,
382 cpu->regs->errcode)) 447 cpu->regs->errcode))
383 return; 448 return;
384 449
385 /* OK, it's really not there (or not OK): the Guest needs to 450 /*
451 * OK, it's really not there (or not OK): the Guest needs to
386 * know. We write out the cr2 value so it knows where the 452 * know. We write out the cr2 value so it knows where the
387 * fault occurred. 453 * fault occurred.
388 * 454 *
389 * Note that if the Guest were really messed up, this could 455 * Note that if the Guest were really messed up, this could
390 * happen before it's done the LHCALL_LGUEST_INIT hypercall, so 456 * happen before it's done the LHCALL_LGUEST_INIT hypercall, so
391 * lg->lguest_data could be NULL */ 457 * lg->lguest_data could be NULL
458 */
392 if (cpu->lg->lguest_data && 459 if (cpu->lg->lguest_data &&
393 put_user(cpu->arch.last_pagefault, 460 put_user(cpu->arch.last_pagefault,
394 &cpu->lg->lguest_data->cr2)) 461 &cpu->lg->lguest_data->cr2))
395 kill_guest(cpu, "Writing cr2"); 462 kill_guest(cpu, "Writing cr2");
396 break; 463 break;
397 case 7: /* We've intercepted a Device Not Available fault. */ 464 case 7: /* We've intercepted a Device Not Available fault. */
398 /* If the Guest doesn't want to know, we already restored the 465 /*
399 * Floating Point Unit, so we just continue without telling 466 * If the Guest doesn't want to know, we already restored the
400 * it. */ 467 * Floating Point Unit, so we just continue without telling it.
468 */
401 if (!cpu->ts) 469 if (!cpu->ts)
402 return; 470 return;
403 break; 471 break;
404 case 32 ... 255: 472 case 32 ... 255:
405 /* These values mean a real interrupt occurred, in which case 473 /*
474 * These values mean a real interrupt occurred, in which case
406 * the Host handler has already been run. We just do a 475 * the Host handler has already been run. We just do a
407 * friendly check if another process should now be run, then 476 * friendly check if another process should now be run, then
408 * return to run the Guest again */ 477 * return to run the Guest again
478 */
409 cond_resched(); 479 cond_resched();
410 return; 480 return;
411 case LGUEST_TRAP_ENTRY: 481 case LGUEST_TRAP_ENTRY:
412 /* Our 'struct hcall_args' maps directly over our regs: we set 482 /*
413 * up the pointer now to indicate a hypercall is pending. */ 483 * Our 'struct hcall_args' maps directly over our regs: we set
484 * up the pointer now to indicate a hypercall is pending.
485 */
414 cpu->hcall = (struct hcall_args *)cpu->regs; 486 cpu->hcall = (struct hcall_args *)cpu->regs;
415 return; 487 return;
416 } 488 }
417 489
418 /* We didn't handle the trap, so it needs to go to the Guest. */ 490 /* We didn't handle the trap, so it needs to go to the Guest. */
419 if (!deliver_trap(cpu, cpu->regs->trapnum)) 491 if (!deliver_trap(cpu, cpu->regs->trapnum))
420 /* If the Guest doesn't have a handler (either it hasn't 492 /*
493 * If the Guest doesn't have a handler (either it hasn't
421 * registered any yet, or it's one of the faults we don't let 494 * registered any yet, or it's one of the faults we don't let
422 * it handle), it dies with this cryptic error message. */ 495 * it handle), it dies with this cryptic error message.
496 */
423 kill_guest(cpu, "unhandled trap %li at %#lx (%#lx)", 497 kill_guest(cpu, "unhandled trap %li at %#lx (%#lx)",
424 cpu->regs->trapnum, cpu->regs->eip, 498 cpu->regs->trapnum, cpu->regs->eip,
425 cpu->regs->trapnum == 14 ? cpu->arch.last_pagefault 499 cpu->regs->trapnum == 14 ? cpu->arch.last_pagefault
426 : cpu->regs->errcode); 500 : cpu->regs->errcode);
427} 501}
428 502
429/* Now we can look at each of the routines this calls, in increasing order of 503/*
504 * Now we can look at each of the routines this calls, in increasing order of
430 * complexity: do_hypercalls(), emulate_insn(), maybe_do_interrupt(), 505 * complexity: do_hypercalls(), emulate_insn(), maybe_do_interrupt(),
431 * deliver_trap() and demand_page(). After all those, we'll be ready to 506 * deliver_trap() and demand_page(). After all those, we'll be ready to
432 * examine the Switcher, and our philosophical understanding of the Host/Guest 507 * examine the Switcher, and our philosophical understanding of the Host/Guest
433 * duality will be complete. :*/ 508 * duality will be complete.
509:*/
434static void adjust_pge(void *on) 510static void adjust_pge(void *on)
435{ 511{
436 if (on) 512 if (on)
@@ -439,13 +515,16 @@ static void adjust_pge(void *on)
439 write_cr4(read_cr4() & ~X86_CR4_PGE); 515 write_cr4(read_cr4() & ~X86_CR4_PGE);
440} 516}
441 517
442/*H:020 Now the Switcher is mapped and every thing else is ready, we need to do 518/*H:020
443 * some more i386-specific initialization. */ 519 * Now the Switcher is mapped and every thing else is ready, we need to do
520 * some more i386-specific initialization.
521 */
444void __init lguest_arch_host_init(void) 522void __init lguest_arch_host_init(void)
445{ 523{
446 int i; 524 int i;
447 525
448 /* Most of the i386/switcher.S doesn't care that it's been moved; on 526 /*
527 * Most of the i386/switcher.S doesn't care that it's been moved; on
449 * Intel, jumps are relative, and it doesn't access any references to 528 * Intel, jumps are relative, and it doesn't access any references to
450 * external code or data. 529 * external code or data.
451 * 530 *
@@ -453,7 +532,8 @@ void __init lguest_arch_host_init(void)
453 * addresses are placed in a table (default_idt_entries), so we need to 532 * addresses are placed in a table (default_idt_entries), so we need to
454 * update the table with the new addresses. switcher_offset() is a 533 * update the table with the new addresses. switcher_offset() is a
455 * convenience function which returns the distance between the 534 * convenience function which returns the distance between the
456 * compiled-in switcher code and the high-mapped copy we just made. */ 535 * compiled-in switcher code and the high-mapped copy we just made.
536 */
457 for (i = 0; i < IDT_ENTRIES; i++) 537 for (i = 0; i < IDT_ENTRIES; i++)
458 default_idt_entries[i] += switcher_offset(); 538 default_idt_entries[i] += switcher_offset();
459 539
@@ -468,63 +548,81 @@ void __init lguest_arch_host_init(void)
468 for_each_possible_cpu(i) { 548 for_each_possible_cpu(i) {
469 /* lguest_pages() returns this CPU's two pages. */ 549 /* lguest_pages() returns this CPU's two pages. */
470 struct lguest_pages *pages = lguest_pages(i); 550 struct lguest_pages *pages = lguest_pages(i);
471 /* This is a convenience pointer to make the code fit one 551 /* This is a convenience pointer to make the code neater. */
472 * statement to a line. */
473 struct lguest_ro_state *state = &pages->state; 552 struct lguest_ro_state *state = &pages->state;
474 553
475 /* The Global Descriptor Table: the Host has a different one 554 /*
555 * The Global Descriptor Table: the Host has a different one
476 * for each CPU. We keep a descriptor for the GDT which says 556 * for each CPU. We keep a descriptor for the GDT which says
477 * where it is and how big it is (the size is actually the last 557 * where it is and how big it is (the size is actually the last
478 * byte, not the size, hence the "-1"). */ 558 * byte, not the size, hence the "-1").
559 */
479 state->host_gdt_desc.size = GDT_SIZE-1; 560 state->host_gdt_desc.size = GDT_SIZE-1;
480 state->host_gdt_desc.address = (long)get_cpu_gdt_table(i); 561 state->host_gdt_desc.address = (long)get_cpu_gdt_table(i);
481 562
482 /* All CPUs on the Host use the same Interrupt Descriptor 563 /*
564 * All CPUs on the Host use the same Interrupt Descriptor
483 * Table, so we just use store_idt(), which gets this CPU's IDT 565 * Table, so we just use store_idt(), which gets this CPU's IDT
484 * descriptor. */ 566 * descriptor.
567 */
485 store_idt(&state->host_idt_desc); 568 store_idt(&state->host_idt_desc);
486 569
487 /* The descriptors for the Guest's GDT and IDT can be filled 570 /*
571 * The descriptors for the Guest's GDT and IDT can be filled
488 * out now, too. We copy the GDT & IDT into ->guest_gdt and 572 * out now, too. We copy the GDT & IDT into ->guest_gdt and
489 * ->guest_idt before actually running the Guest. */ 573 * ->guest_idt before actually running the Guest.
574 */
490 state->guest_idt_desc.size = sizeof(state->guest_idt)-1; 575 state->guest_idt_desc.size = sizeof(state->guest_idt)-1;
491 state->guest_idt_desc.address = (long)&state->guest_idt; 576 state->guest_idt_desc.address = (long)&state->guest_idt;
492 state->guest_gdt_desc.size = sizeof(state->guest_gdt)-1; 577 state->guest_gdt_desc.size = sizeof(state->guest_gdt)-1;
493 state->guest_gdt_desc.address = (long)&state->guest_gdt; 578 state->guest_gdt_desc.address = (long)&state->guest_gdt;
494 579
495 /* We know where we want the stack to be when the Guest enters 580 /*
581 * We know where we want the stack to be when the Guest enters
496 * the Switcher: in pages->regs. The stack grows upwards, so 582 * the Switcher: in pages->regs. The stack grows upwards, so
497 * we start it at the end of that structure. */ 583 * we start it at the end of that structure.
584 */
498 state->guest_tss.sp0 = (long)(&pages->regs + 1); 585 state->guest_tss.sp0 = (long)(&pages->regs + 1);
499 /* And this is the GDT entry to use for the stack: we keep a 586 /*
500 * couple of special LGUEST entries. */ 587 * And this is the GDT entry to use for the stack: we keep a
588 * couple of special LGUEST entries.
589 */
501 state->guest_tss.ss0 = LGUEST_DS; 590 state->guest_tss.ss0 = LGUEST_DS;
502 591
503 /* x86 can have a finegrained bitmap which indicates what I/O 592 /*
593 * x86 can have a finegrained bitmap which indicates what I/O
504 * ports the process can use. We set it to the end of our 594 * ports the process can use. We set it to the end of our
505 * structure, meaning "none". */ 595 * structure, meaning "none".
596 */
506 state->guest_tss.io_bitmap_base = sizeof(state->guest_tss); 597 state->guest_tss.io_bitmap_base = sizeof(state->guest_tss);
507 598
508 /* Some GDT entries are the same across all Guests, so we can 599 /*
509 * set them up now. */ 600 * Some GDT entries are the same across all Guests, so we can
601 * set them up now.
602 */
510 setup_default_gdt_entries(state); 603 setup_default_gdt_entries(state);
511 /* Most IDT entries are the same for all Guests, too.*/ 604 /* Most IDT entries are the same for all Guests, too.*/
512 setup_default_idt_entries(state, default_idt_entries); 605 setup_default_idt_entries(state, default_idt_entries);
513 606
514 /* The Host needs to be able to use the LGUEST segments on this 607 /*
515 * CPU, too, so put them in the Host GDT. */ 608 * The Host needs to be able to use the LGUEST segments on this
609 * CPU, too, so put them in the Host GDT.
610 */
516 get_cpu_gdt_table(i)[GDT_ENTRY_LGUEST_CS] = FULL_EXEC_SEGMENT; 611 get_cpu_gdt_table(i)[GDT_ENTRY_LGUEST_CS] = FULL_EXEC_SEGMENT;
517 get_cpu_gdt_table(i)[GDT_ENTRY_LGUEST_DS] = FULL_SEGMENT; 612 get_cpu_gdt_table(i)[GDT_ENTRY_LGUEST_DS] = FULL_SEGMENT;
518 } 613 }
519 614
520 /* In the Switcher, we want the %cs segment register to use the 615 /*
616 * In the Switcher, we want the %cs segment register to use the
521 * LGUEST_CS GDT entry: we've put that in the Host and Guest GDTs, so 617 * LGUEST_CS GDT entry: we've put that in the Host and Guest GDTs, so
522 * it will be undisturbed when we switch. To change %cs and jump we 618 * it will be undisturbed when we switch. To change %cs and jump we
523 * need this structure to feed to Intel's "lcall" instruction. */ 619 * need this structure to feed to Intel's "lcall" instruction.
620 */
524 lguest_entry.offset = (long)switch_to_guest + switcher_offset(); 621 lguest_entry.offset = (long)switch_to_guest + switcher_offset();
525 lguest_entry.segment = LGUEST_CS; 622 lguest_entry.segment = LGUEST_CS;
526 623
527 /* Finally, we need to turn off "Page Global Enable". PGE is an 624 /*
625 * Finally, we need to turn off "Page Global Enable". PGE is an
528 * optimization where page table entries are specially marked to show 626 * optimization where page table entries are specially marked to show
529 * they never change. The Host kernel marks all the kernel pages this 627 * they never change. The Host kernel marks all the kernel pages this
530 * way because it's always present, even when userspace is running. 628 * way because it's always present, even when userspace is running.
@@ -534,16 +632,21 @@ void __init lguest_arch_host_init(void)
534 * you'll get really weird bugs that you'll chase for two days. 632 * you'll get really weird bugs that you'll chase for two days.
535 * 633 *
536 * I used to turn PGE off every time we switched to the Guest and back 634 * I used to turn PGE off every time we switched to the Guest and back
537 * on when we return, but that slowed the Switcher down noticibly. */ 635 * on when we return, but that slowed the Switcher down noticibly.
636 */
538 637
539 /* We don't need the complexity of CPUs coming and going while we're 638 /*
540 * doing this. */ 639 * We don't need the complexity of CPUs coming and going while we're
640 * doing this.
641 */
541 get_online_cpus(); 642 get_online_cpus();
542 if (cpu_has_pge) { /* We have a broader idea of "global". */ 643 if (cpu_has_pge) { /* We have a broader idea of "global". */
543 /* Remember that this was originally set (for cleanup). */ 644 /* Remember that this was originally set (for cleanup). */
544 cpu_had_pge = 1; 645 cpu_had_pge = 1;
545 /* adjust_pge is a helper function which sets or unsets the PGE 646 /*
546 * bit on its CPU, depending on the argument (0 == unset). */ 647 * adjust_pge is a helper function which sets or unsets the PGE
648 * bit on its CPU, depending on the argument (0 == unset).
649 */
547 on_each_cpu(adjust_pge, (void *)0, 1); 650 on_each_cpu(adjust_pge, (void *)0, 1);
548 /* Turn off the feature in the global feature set. */ 651 /* Turn off the feature in the global feature set. */
549 clear_cpu_cap(&boot_cpu_data, X86_FEATURE_PGE); 652 clear_cpu_cap(&boot_cpu_data, X86_FEATURE_PGE);
@@ -590,26 +693,32 @@ int lguest_arch_init_hypercalls(struct lg_cpu *cpu)
590{ 693{
591 u32 tsc_speed; 694 u32 tsc_speed;
592 695
593 /* The pointer to the Guest's "struct lguest_data" is the only argument. 696 /*
594 * We check that address now. */ 697 * The pointer to the Guest's "struct lguest_data" is the only argument.
698 * We check that address now.
699 */
595 if (!lguest_address_ok(cpu->lg, cpu->hcall->arg1, 700 if (!lguest_address_ok(cpu->lg, cpu->hcall->arg1,
596 sizeof(*cpu->lg->lguest_data))) 701 sizeof(*cpu->lg->lguest_data)))
597 return -EFAULT; 702 return -EFAULT;
598 703
599 /* Having checked it, we simply set lg->lguest_data to point straight 704 /*
705 * Having checked it, we simply set lg->lguest_data to point straight
600 * into the Launcher's memory at the right place and then use 706 * into the Launcher's memory at the right place and then use
601 * copy_to_user/from_user from now on, instead of lgread/write. I put 707 * copy_to_user/from_user from now on, instead of lgread/write. I put
602 * this in to show that I'm not immune to writing stupid 708 * this in to show that I'm not immune to writing stupid
603 * optimizations. */ 709 * optimizations.
710 */
604 cpu->lg->lguest_data = cpu->lg->mem_base + cpu->hcall->arg1; 711 cpu->lg->lguest_data = cpu->lg->mem_base + cpu->hcall->arg1;
605 712
606 /* We insist that the Time Stamp Counter exist and doesn't change with 713 /*
714 * We insist that the Time Stamp Counter exist and doesn't change with
607 * cpu frequency. Some devious chip manufacturers decided that TSC 715 * cpu frequency. Some devious chip manufacturers decided that TSC
608 * changes could be handled in software. I decided that time going 716 * changes could be handled in software. I decided that time going
609 * backwards might be good for benchmarks, but it's bad for users. 717 * backwards might be good for benchmarks, but it's bad for users.
610 * 718 *
611 * We also insist that the TSC be stable: the kernel detects unreliable 719 * We also insist that the TSC be stable: the kernel detects unreliable
612 * TSCs for its own purposes, and we use that here. */ 720 * TSCs for its own purposes, and we use that here.
721 */
613 if (boot_cpu_has(X86_FEATURE_CONSTANT_TSC) && !check_tsc_unstable()) 722 if (boot_cpu_has(X86_FEATURE_CONSTANT_TSC) && !check_tsc_unstable())
614 tsc_speed = tsc_khz; 723 tsc_speed = tsc_khz;
615 else 724 else
@@ -625,38 +734,47 @@ int lguest_arch_init_hypercalls(struct lg_cpu *cpu)
625} 734}
626/*:*/ 735/*:*/
627 736
628/*L:030 lguest_arch_setup_regs() 737/*L:030
738 * lguest_arch_setup_regs()
629 * 739 *
630 * Most of the Guest's registers are left alone: we used get_zeroed_page() to 740 * Most of the Guest's registers are left alone: we used get_zeroed_page() to
631 * allocate the structure, so they will be 0. */ 741 * allocate the structure, so they will be 0.
742 */
632void lguest_arch_setup_regs(struct lg_cpu *cpu, unsigned long start) 743void lguest_arch_setup_regs(struct lg_cpu *cpu, unsigned long start)
633{ 744{
634 struct lguest_regs *regs = cpu->regs; 745 struct lguest_regs *regs = cpu->regs;
635 746
636 /* There are four "segment" registers which the Guest needs to boot: 747 /*
748 * There are four "segment" registers which the Guest needs to boot:
637 * The "code segment" register (cs) refers to the kernel code segment 749 * The "code segment" register (cs) refers to the kernel code segment
638 * __KERNEL_CS, and the "data", "extra" and "stack" segment registers 750 * __KERNEL_CS, and the "data", "extra" and "stack" segment registers
639 * refer to the kernel data segment __KERNEL_DS. 751 * refer to the kernel data segment __KERNEL_DS.
640 * 752 *
641 * The privilege level is packed into the lower bits. The Guest runs 753 * The privilege level is packed into the lower bits. The Guest runs
642 * at privilege level 1 (GUEST_PL).*/ 754 * at privilege level 1 (GUEST_PL).
755 */
643 regs->ds = regs->es = regs->ss = __KERNEL_DS|GUEST_PL; 756 regs->ds = regs->es = regs->ss = __KERNEL_DS|GUEST_PL;
644 regs->cs = __KERNEL_CS|GUEST_PL; 757 regs->cs = __KERNEL_CS|GUEST_PL;
645 758
646 /* The "eflags" register contains miscellaneous flags. Bit 1 (0x002) 759 /*
760 * The "eflags" register contains miscellaneous flags. Bit 1 (0x002)
647 * is supposed to always be "1". Bit 9 (0x200) controls whether 761 * is supposed to always be "1". Bit 9 (0x200) controls whether
648 * interrupts are enabled. We always leave interrupts enabled while 762 * interrupts are enabled. We always leave interrupts enabled while
649 * running the Guest. */ 763 * running the Guest.
764 */
650 regs->eflags = X86_EFLAGS_IF | 0x2; 765 regs->eflags = X86_EFLAGS_IF | 0x2;
651 766
652 /* The "Extended Instruction Pointer" register says where the Guest is 767 /*
653 * running. */ 768 * The "Extended Instruction Pointer" register says where the Guest is
769 * running.
770 */
654 regs->eip = start; 771 regs->eip = start;
655 772
656 /* %esi points to our boot information, at physical address 0, so don't 773 /*
657 * touch it. */ 774 * %esi points to our boot information, at physical address 0, so don't
775 * touch it.
776 */
658 777
659 /* There are a couple of GDT entries the Guest expects when first 778 /* There are a couple of GDT entries the Guest expects at boot. */
660 * booting. */
661 setup_guest_gdt(cpu); 779 setup_guest_gdt(cpu);
662} 780}
diff --git a/drivers/lguest/x86/switcher_32.S b/drivers/lguest/x86/switcher_32.S
index 3fc15318a80f..40634b0db9f7 100644
--- a/drivers/lguest/x86/switcher_32.S
+++ b/drivers/lguest/x86/switcher_32.S
@@ -1,12 +1,15 @@
1/*P:900 This is the Switcher: code which sits at 0xFFC00000 astride both the 1/*P:900
2 * Host and Guest to do the low-level Guest<->Host switch. It is as simple as 2 * This is the Switcher: code which sits at 0xFFC00000 (or 0xFFE00000) astride
3 * it can be made, but it's naturally very specific to x86. 3 * both the Host and Guest to do the low-level Guest<->Host switch. It is as
4 * simple as it can be made, but it's naturally very specific to x86.
4 * 5 *
5 * You have now completed Preparation. If this has whet your appetite; if you 6 * You have now completed Preparation. If this has whet your appetite; if you
6 * are feeling invigorated and refreshed then the next, more challenging stage 7 * are feeling invigorated and refreshed then the next, more challenging stage
7 * can be found in "make Guest". :*/ 8 * can be found in "make Guest".
9 :*/
8 10
9/*M:012 Lguest is meant to be simple: my rule of thumb is that 1% more LOC must 11/*M:012
12 * Lguest is meant to be simple: my rule of thumb is that 1% more LOC must
10 * gain at least 1% more performance. Since neither LOC nor performance can be 13 * gain at least 1% more performance. Since neither LOC nor performance can be
11 * measured beforehand, it generally means implementing a feature then deciding 14 * measured beforehand, it generally means implementing a feature then deciding
12 * if it's worth it. And once it's implemented, who can say no? 15 * if it's worth it. And once it's implemented, who can say no?
@@ -31,11 +34,14 @@
31 * Host (which is actually really easy). 34 * Host (which is actually really easy).
32 * 35 *
33 * Two questions remain. Would the performance gain outweigh the complexity? 36 * Two questions remain. Would the performance gain outweigh the complexity?
34 * And who would write the verse documenting it? :*/ 37 * And who would write the verse documenting it?
38:*/
35 39
36/*M:011 Lguest64 handles NMI. This gave me NMI envy (until I looked at their 40/*M:011
41 * Lguest64 handles NMI. This gave me NMI envy (until I looked at their
37 * code). It's worth doing though, since it would let us use oprofile in the 42 * code). It's worth doing though, since it would let us use oprofile in the
38 * Host when a Guest is running. :*/ 43 * Host when a Guest is running.
44:*/
39 45
40/*S:100 46/*S:100
41 * Welcome to the Switcher itself! 47 * Welcome to the Switcher itself!
diff --git a/drivers/macintosh/macio_asic.c b/drivers/macintosh/macio_asic.c
index 6e149f4a1fff..a0f68386c12f 100644
--- a/drivers/macintosh/macio_asic.c
+++ b/drivers/macintosh/macio_asic.c
@@ -378,6 +378,17 @@ static struct macio_dev * macio_add_one_device(struct macio_chip *chip,
378 dev->ofdev.dev.bus = &macio_bus_type; 378 dev->ofdev.dev.bus = &macio_bus_type;
379 dev->ofdev.dev.release = macio_release_dev; 379 dev->ofdev.dev.release = macio_release_dev;
380 380
381#ifdef CONFIG_PCI
382 /* Set the DMA ops to the ones from the PCI device, this could be
383 * fishy if we didn't know that on PowerMac it's always direct ops
384 * or iommu ops that will work fine
385 */
386 dev->ofdev.dev.archdata.dma_ops =
387 chip->lbus.pdev->dev.archdata.dma_ops;
388 dev->ofdev.dev.archdata.dma_data =
389 chip->lbus.pdev->dev.archdata.dma_data;
390#endif /* CONFIG_PCI */
391
381#ifdef DEBUG 392#ifdef DEBUG
382 printk("preparing mdev @%p, ofdev @%p, dev @%p, kobj @%p\n", 393 printk("preparing mdev @%p, ofdev @%p, dev @%p, kobj @%p\n",
383 dev, &dev->ofdev, &dev->ofdev.dev, &dev->ofdev.dev.kobj); 394 dev, &dev->ofdev, &dev->ofdev.dev, &dev->ofdev.dev.kobj);
diff --git a/drivers/md/dm-crypt.c b/drivers/md/dm-crypt.c
index 9933eb861c71..ed1038164019 100644
--- a/drivers/md/dm-crypt.c
+++ b/drivers/md/dm-crypt.c
@@ -776,7 +776,7 @@ static void kcryptd_crypt_write_convert(struct dm_crypt_io *io)
776 * But don't wait if split was due to the io size restriction 776 * But don't wait if split was due to the io size restriction
777 */ 777 */
778 if (unlikely(out_of_pages)) 778 if (unlikely(out_of_pages))
779 congestion_wait(WRITE, HZ/100); 779 congestion_wait(BLK_RW_ASYNC, HZ/100);
780 780
781 /* 781 /*
782 * With async crypto it is unsafe to share the crypto context 782 * With async crypto it is unsafe to share the crypto context
@@ -1318,7 +1318,7 @@ static int crypt_iterate_devices(struct dm_target *ti,
1318{ 1318{
1319 struct crypt_config *cc = ti->private; 1319 struct crypt_config *cc = ti->private;
1320 1320
1321 return fn(ti, cc->dev, cc->start, data); 1321 return fn(ti, cc->dev, cc->start, ti->len, data);
1322} 1322}
1323 1323
1324static struct target_type crypt_target = { 1324static struct target_type crypt_target = {
diff --git a/drivers/md/dm-delay.c b/drivers/md/dm-delay.c
index 4e5b843cd4d7..ebe7381f47c8 100644
--- a/drivers/md/dm-delay.c
+++ b/drivers/md/dm-delay.c
@@ -324,12 +324,12 @@ static int delay_iterate_devices(struct dm_target *ti,
324 struct delay_c *dc = ti->private; 324 struct delay_c *dc = ti->private;
325 int ret = 0; 325 int ret = 0;
326 326
327 ret = fn(ti, dc->dev_read, dc->start_read, data); 327 ret = fn(ti, dc->dev_read, dc->start_read, ti->len, data);
328 if (ret) 328 if (ret)
329 goto out; 329 goto out;
330 330
331 if (dc->dev_write) 331 if (dc->dev_write)
332 ret = fn(ti, dc->dev_write, dc->start_write, data); 332 ret = fn(ti, dc->dev_write, dc->start_write, ti->len, data);
333 333
334out: 334out:
335 return ret; 335 return ret;
diff --git a/drivers/md/dm-exception-store.c b/drivers/md/dm-exception-store.c
index c3ae51584b12..3710ff88fc10 100644
--- a/drivers/md/dm-exception-store.c
+++ b/drivers/md/dm-exception-store.c
@@ -195,7 +195,7 @@ int dm_exception_store_create(struct dm_target *ti, int argc, char **argv,
195 struct dm_exception_store **store) 195 struct dm_exception_store **store)
196{ 196{
197 int r = 0; 197 int r = 0;
198 struct dm_exception_store_type *type; 198 struct dm_exception_store_type *type = NULL;
199 struct dm_exception_store *tmp_store; 199 struct dm_exception_store *tmp_store;
200 char persistent; 200 char persistent;
201 201
@@ -211,12 +211,15 @@ int dm_exception_store_create(struct dm_target *ti, int argc, char **argv,
211 } 211 }
212 212
213 persistent = toupper(*argv[1]); 213 persistent = toupper(*argv[1]);
214 if (persistent != 'P' && persistent != 'N') { 214 if (persistent == 'P')
215 type = get_type("P");
216 else if (persistent == 'N')
217 type = get_type("N");
218 else {
215 ti->error = "Persistent flag is not P or N"; 219 ti->error = "Persistent flag is not P or N";
216 return -EINVAL; 220 return -EINVAL;
217 } 221 }
218 222
219 type = get_type(&persistent);
220 if (!type) { 223 if (!type) {
221 ti->error = "Exception store type not recognised"; 224 ti->error = "Exception store type not recognised";
222 r = -EINVAL; 225 r = -EINVAL;
diff --git a/drivers/md/dm-linear.c b/drivers/md/dm-linear.c
index 9184b6deb868..82f7d6e6b1ea 100644
--- a/drivers/md/dm-linear.c
+++ b/drivers/md/dm-linear.c
@@ -139,7 +139,7 @@ static int linear_iterate_devices(struct dm_target *ti,
139{ 139{
140 struct linear_c *lc = ti->private; 140 struct linear_c *lc = ti->private;
141 141
142 return fn(ti, lc->dev, lc->start, data); 142 return fn(ti, lc->dev, lc->start, ti->len, data);
143} 143}
144 144
145static struct target_type linear_target = { 145static struct target_type linear_target = {
diff --git a/drivers/md/dm-mpath.c b/drivers/md/dm-mpath.c
index c70604a20897..6f0d90d4a541 100644
--- a/drivers/md/dm-mpath.c
+++ b/drivers/md/dm-mpath.c
@@ -1453,7 +1453,7 @@ static int multipath_iterate_devices(struct dm_target *ti,
1453 1453
1454 list_for_each_entry(pg, &m->priority_groups, list) { 1454 list_for_each_entry(pg, &m->priority_groups, list) {
1455 list_for_each_entry(p, &pg->pgpaths, list) { 1455 list_for_each_entry(p, &pg->pgpaths, list) {
1456 ret = fn(ti, p->path.dev, ti->begin, data); 1456 ret = fn(ti, p->path.dev, ti->begin, ti->len, data);
1457 if (ret) 1457 if (ret)
1458 goto out; 1458 goto out;
1459 } 1459 }
diff --git a/drivers/md/dm-raid1.c b/drivers/md/dm-raid1.c
index ce8868c768cc..9726577cde49 100644
--- a/drivers/md/dm-raid1.c
+++ b/drivers/md/dm-raid1.c
@@ -638,6 +638,7 @@ static void do_writes(struct mirror_set *ms, struct bio_list *writes)
638 spin_lock_irq(&ms->lock); 638 spin_lock_irq(&ms->lock);
639 bio_list_merge(&ms->writes, &requeue); 639 bio_list_merge(&ms->writes, &requeue);
640 spin_unlock_irq(&ms->lock); 640 spin_unlock_irq(&ms->lock);
641 delayed_wake(ms);
641 } 642 }
642 643
643 /* 644 /*
@@ -1292,7 +1293,7 @@ static int mirror_iterate_devices(struct dm_target *ti,
1292 1293
1293 for (i = 0; !ret && i < ms->nr_mirrors; i++) 1294 for (i = 0; !ret && i < ms->nr_mirrors; i++)
1294 ret = fn(ti, ms->mirror[i].dev, 1295 ret = fn(ti, ms->mirror[i].dev,
1295 ms->mirror[i].offset, data); 1296 ms->mirror[i].offset, ti->len, data);
1296 1297
1297 return ret; 1298 return ret;
1298} 1299}
diff --git a/drivers/md/dm-stripe.c b/drivers/md/dm-stripe.c
index b240e85ae39a..4e0e5937e42a 100644
--- a/drivers/md/dm-stripe.c
+++ b/drivers/md/dm-stripe.c
@@ -320,10 +320,11 @@ static int stripe_iterate_devices(struct dm_target *ti,
320 int ret = 0; 320 int ret = 0;
321 unsigned i = 0; 321 unsigned i = 0;
322 322
323 do 323 do {
324 ret = fn(ti, sc->stripe[i].dev, 324 ret = fn(ti, sc->stripe[i].dev,
325 sc->stripe[i].physical_start, data); 325 sc->stripe[i].physical_start,
326 while (!ret && ++i < sc->stripes); 326 sc->stripe_width, data);
327 } while (!ret && ++i < sc->stripes);
327 328
328 return ret; 329 return ret;
329} 330}
diff --git a/drivers/md/dm-table.c b/drivers/md/dm-table.c
index 4899ebe767c8..d952b3441913 100644
--- a/drivers/md/dm-table.c
+++ b/drivers/md/dm-table.c
@@ -346,7 +346,7 @@ static void close_dev(struct dm_dev_internal *d, struct mapped_device *md)
346 * If possible, this checks an area of a destination device is valid. 346 * If possible, this checks an area of a destination device is valid.
347 */ 347 */
348static int device_area_is_valid(struct dm_target *ti, struct dm_dev *dev, 348static int device_area_is_valid(struct dm_target *ti, struct dm_dev *dev,
349 sector_t start, void *data) 349 sector_t start, sector_t len, void *data)
350{ 350{
351 struct queue_limits *limits = data; 351 struct queue_limits *limits = data;
352 struct block_device *bdev = dev->bdev; 352 struct block_device *bdev = dev->bdev;
@@ -359,7 +359,7 @@ static int device_area_is_valid(struct dm_target *ti, struct dm_dev *dev,
359 if (!dev_size) 359 if (!dev_size)
360 return 1; 360 return 1;
361 361
362 if ((start >= dev_size) || (start + ti->len > dev_size)) { 362 if ((start >= dev_size) || (start + len > dev_size)) {
363 DMWARN("%s: %s too small for target", 363 DMWARN("%s: %s too small for target",
364 dm_device_name(ti->table->md), bdevname(bdev, b)); 364 dm_device_name(ti->table->md), bdevname(bdev, b));
365 return 0; 365 return 0;
@@ -377,11 +377,11 @@ static int device_area_is_valid(struct dm_target *ti, struct dm_dev *dev,
377 return 0; 377 return 0;
378 } 378 }
379 379
380 if (ti->len & (logical_block_size_sectors - 1)) { 380 if (len & (logical_block_size_sectors - 1)) {
381 DMWARN("%s: len=%llu not aligned to h/w " 381 DMWARN("%s: len=%llu not aligned to h/w "
382 "logical block size %hu of %s", 382 "logical block size %hu of %s",
383 dm_device_name(ti->table->md), 383 dm_device_name(ti->table->md),
384 (unsigned long long)ti->len, 384 (unsigned long long)len,
385 limits->logical_block_size, bdevname(bdev, b)); 385 limits->logical_block_size, bdevname(bdev, b));
386 return 0; 386 return 0;
387 } 387 }
@@ -482,7 +482,7 @@ static int __table_get_device(struct dm_table *t, struct dm_target *ti,
482#define min_not_zero(l, r) (l == 0) ? r : ((r == 0) ? l : min(l, r)) 482#define min_not_zero(l, r) (l == 0) ? r : ((r == 0) ? l : min(l, r))
483 483
484int dm_set_device_limits(struct dm_target *ti, struct dm_dev *dev, 484int dm_set_device_limits(struct dm_target *ti, struct dm_dev *dev,
485 sector_t start, void *data) 485 sector_t start, sector_t len, void *data)
486{ 486{
487 struct queue_limits *limits = data; 487 struct queue_limits *limits = data;
488 struct block_device *bdev = dev->bdev; 488 struct block_device *bdev = dev->bdev;
@@ -495,7 +495,7 @@ int dm_set_device_limits(struct dm_target *ti, struct dm_dev *dev,
495 return 0; 495 return 0;
496 } 496 }
497 497
498 if (blk_stack_limits(limits, &q->limits, start) < 0) 498 if (blk_stack_limits(limits, &q->limits, start << 9) < 0)
499 DMWARN("%s: target device %s is misaligned", 499 DMWARN("%s: target device %s is misaligned",
500 dm_device_name(ti->table->md), bdevname(bdev, b)); 500 dm_device_name(ti->table->md), bdevname(bdev, b));
501 501
@@ -830,11 +830,6 @@ unsigned dm_table_get_type(struct dm_table *t)
830 return t->type; 830 return t->type;
831} 831}
832 832
833bool dm_table_bio_based(struct dm_table *t)
834{
835 return dm_table_get_type(t) == DM_TYPE_BIO_BASED;
836}
837
838bool dm_table_request_based(struct dm_table *t) 833bool dm_table_request_based(struct dm_table *t)
839{ 834{
840 return dm_table_get_type(t) == DM_TYPE_REQUEST_BASED; 835 return dm_table_get_type(t) == DM_TYPE_REQUEST_BASED;
diff --git a/drivers/md/dm.c b/drivers/md/dm.c
index 3c6d4ee8921d..8a311ea0d441 100644
--- a/drivers/md/dm.c
+++ b/drivers/md/dm.c
@@ -1017,7 +1017,7 @@ static struct bio *split_bvec(struct bio *bio, sector_t sector,
1017 clone->bi_flags |= 1 << BIO_CLONED; 1017 clone->bi_flags |= 1 << BIO_CLONED;
1018 1018
1019 if (bio_integrity(bio)) { 1019 if (bio_integrity(bio)) {
1020 bio_integrity_clone(clone, bio, GFP_NOIO); 1020 bio_integrity_clone(clone, bio, GFP_NOIO, bs);
1021 bio_integrity_trim(clone, 1021 bio_integrity_trim(clone,
1022 bio_sector_offset(bio, idx, offset), len); 1022 bio_sector_offset(bio, idx, offset), len);
1023 } 1023 }
@@ -1045,7 +1045,7 @@ static struct bio *clone_bio(struct bio *bio, sector_t sector,
1045 clone->bi_flags &= ~(1 << BIO_SEG_VALID); 1045 clone->bi_flags &= ~(1 << BIO_SEG_VALID);
1046 1046
1047 if (bio_integrity(bio)) { 1047 if (bio_integrity(bio)) {
1048 bio_integrity_clone(clone, bio, GFP_NOIO); 1048 bio_integrity_clone(clone, bio, GFP_NOIO, bs);
1049 1049
1050 if (idx != bio->bi_idx || clone->bi_size < bio->bi_size) 1050 if (idx != bio->bi_idx || clone->bi_size < bio->bi_size)
1051 bio_integrity_trim(clone, 1051 bio_integrity_trim(clone,
@@ -2203,16 +2203,6 @@ int dm_swap_table(struct mapped_device *md, struct dm_table *table)
2203 goto out; 2203 goto out;
2204 } 2204 }
2205 2205
2206 /*
2207 * It is enought that blk_queue_ordered() is called only once when
2208 * the first bio-based table is bound.
2209 *
2210 * This setting should be moved to alloc_dev() when request-based dm
2211 * supports barrier.
2212 */
2213 if (!md->map && dm_table_bio_based(table))
2214 blk_queue_ordered(md->queue, QUEUE_ORDERED_DRAIN, NULL);
2215
2216 __unbind(md); 2206 __unbind(md);
2217 r = __bind(md, table, &limits); 2207 r = __bind(md, table, &limits);
2218 2208
diff --git a/drivers/md/dm.h b/drivers/md/dm.h
index 23278ae80f08..a7663eba17e2 100644
--- a/drivers/md/dm.h
+++ b/drivers/md/dm.h
@@ -61,7 +61,6 @@ int dm_table_any_congested(struct dm_table *t, int bdi_bits);
61int dm_table_any_busy_target(struct dm_table *t); 61int dm_table_any_busy_target(struct dm_table *t);
62int dm_table_set_type(struct dm_table *t); 62int dm_table_set_type(struct dm_table *t);
63unsigned dm_table_get_type(struct dm_table *t); 63unsigned dm_table_get_type(struct dm_table *t);
64bool dm_table_bio_based(struct dm_table *t);
65bool dm_table_request_based(struct dm_table *t); 64bool dm_table_request_based(struct dm_table *t);
66int dm_table_alloc_md_mempools(struct dm_table *t); 65int dm_table_alloc_md_mempools(struct dm_table *t);
67void dm_table_free_md_mempools(struct dm_table *t); 66void dm_table_free_md_mempools(struct dm_table *t);
diff --git a/drivers/md/linear.c b/drivers/md/linear.c
index 15c8b7b25a9b..5fe39c2a3d2b 100644
--- a/drivers/md/linear.c
+++ b/drivers/md/linear.c
@@ -166,8 +166,8 @@ static linear_conf_t *linear_conf(mddev_t *mddev, int raid_disks)
166 rdev->sectors = sectors * mddev->chunk_sectors; 166 rdev->sectors = sectors * mddev->chunk_sectors;
167 } 167 }
168 168
169 blk_queue_stack_limits(mddev->queue, 169 disk_stack_limits(mddev->gendisk, rdev->bdev,
170 rdev->bdev->bd_disk->queue); 170 rdev->data_offset << 9);
171 /* as we don't honour merge_bvec_fn, we must never risk 171 /* as we don't honour merge_bvec_fn, we must never risk
172 * violating it, so limit ->max_sector to one PAGE, as 172 * violating it, so limit ->max_sector to one PAGE, as
173 * a one page request is never in violation. 173 * a one page request is never in violation.
@@ -220,6 +220,7 @@ static int linear_run (mddev_t *mddev)
220 mddev->queue->unplug_fn = linear_unplug; 220 mddev->queue->unplug_fn = linear_unplug;
221 mddev->queue->backing_dev_info.congested_fn = linear_congested; 221 mddev->queue->backing_dev_info.congested_fn = linear_congested;
222 mddev->queue->backing_dev_info.congested_data = mddev; 222 mddev->queue->backing_dev_info.congested_data = mddev;
223 md_integrity_register(mddev);
223 return 0; 224 return 0;
224} 225}
225 226
@@ -256,6 +257,7 @@ static int linear_add(mddev_t *mddev, mdk_rdev_t *rdev)
256 rcu_assign_pointer(mddev->private, newconf); 257 rcu_assign_pointer(mddev->private, newconf);
257 md_set_array_sectors(mddev, linear_size(mddev, 0, 0)); 258 md_set_array_sectors(mddev, linear_size(mddev, 0, 0));
258 set_capacity(mddev->gendisk, mddev->array_sectors); 259 set_capacity(mddev->gendisk, mddev->array_sectors);
260 revalidate_disk(mddev->gendisk);
259 call_rcu(&oldconf->rcu, free_conf); 261 call_rcu(&oldconf->rcu, free_conf);
260 return 0; 262 return 0;
261} 263}
diff --git a/drivers/md/md.c b/drivers/md/md.c
index 09be637d52cb..5b98bea4ff9b 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -1308,7 +1308,12 @@ static int super_1_validate(mddev_t *mddev, mdk_rdev_t *rdev)
1308 } 1308 }
1309 if (mddev->level != LEVEL_MULTIPATH) { 1309 if (mddev->level != LEVEL_MULTIPATH) {
1310 int role; 1310 int role;
1311 role = le16_to_cpu(sb->dev_roles[rdev->desc_nr]); 1311 if (rdev->desc_nr < 0 ||
1312 rdev->desc_nr >= le32_to_cpu(sb->max_dev)) {
1313 role = 0xffff;
1314 rdev->desc_nr = -1;
1315 } else
1316 role = le16_to_cpu(sb->dev_roles[rdev->desc_nr]);
1312 switch(role) { 1317 switch(role) {
1313 case 0xffff: /* spare */ 1318 case 0xffff: /* spare */
1314 break; 1319 break;
@@ -1394,8 +1399,14 @@ static void super_1_sync(mddev_t *mddev, mdk_rdev_t *rdev)
1394 if (rdev2->desc_nr+1 > max_dev) 1399 if (rdev2->desc_nr+1 > max_dev)
1395 max_dev = rdev2->desc_nr+1; 1400 max_dev = rdev2->desc_nr+1;
1396 1401
1397 if (max_dev > le32_to_cpu(sb->max_dev)) 1402 if (max_dev > le32_to_cpu(sb->max_dev)) {
1403 int bmask;
1398 sb->max_dev = cpu_to_le32(max_dev); 1404 sb->max_dev = cpu_to_le32(max_dev);
1405 rdev->sb_size = max_dev * 2 + 256;
1406 bmask = queue_logical_block_size(rdev->bdev->bd_disk->queue)-1;
1407 if (rdev->sb_size & bmask)
1408 rdev->sb_size = (rdev->sb_size | bmask) + 1;
1409 }
1399 for (i=0; i<max_dev;i++) 1410 for (i=0; i<max_dev;i++)
1400 sb->dev_roles[i] = cpu_to_le16(0xfffe); 1411 sb->dev_roles[i] = cpu_to_le16(0xfffe);
1401 1412
@@ -1487,37 +1498,76 @@ static int match_mddev_units(mddev_t *mddev1, mddev_t *mddev2)
1487 1498
1488static LIST_HEAD(pending_raid_disks); 1499static LIST_HEAD(pending_raid_disks);
1489 1500
1490static void md_integrity_check(mdk_rdev_t *rdev, mddev_t *mddev) 1501/*
1502 * Try to register data integrity profile for an mddev
1503 *
1504 * This is called when an array is started and after a disk has been kicked
1505 * from the array. It only succeeds if all working and active component devices
1506 * are integrity capable with matching profiles.
1507 */
1508int md_integrity_register(mddev_t *mddev)
1509{
1510 mdk_rdev_t *rdev, *reference = NULL;
1511
1512 if (list_empty(&mddev->disks))
1513 return 0; /* nothing to do */
1514 if (blk_get_integrity(mddev->gendisk))
1515 return 0; /* already registered */
1516 list_for_each_entry(rdev, &mddev->disks, same_set) {
1517 /* skip spares and non-functional disks */
1518 if (test_bit(Faulty, &rdev->flags))
1519 continue;
1520 if (rdev->raid_disk < 0)
1521 continue;
1522 /*
1523 * If at least one rdev is not integrity capable, we can not
1524 * enable data integrity for the md device.
1525 */
1526 if (!bdev_get_integrity(rdev->bdev))
1527 return -EINVAL;
1528 if (!reference) {
1529 /* Use the first rdev as the reference */
1530 reference = rdev;
1531 continue;
1532 }
1533 /* does this rdev's profile match the reference profile? */
1534 if (blk_integrity_compare(reference->bdev->bd_disk,
1535 rdev->bdev->bd_disk) < 0)
1536 return -EINVAL;
1537 }
1538 /*
1539 * All component devices are integrity capable and have matching
1540 * profiles, register the common profile for the md device.
1541 */
1542 if (blk_integrity_register(mddev->gendisk,
1543 bdev_get_integrity(reference->bdev)) != 0) {
1544 printk(KERN_ERR "md: failed to register integrity for %s\n",
1545 mdname(mddev));
1546 return -EINVAL;
1547 }
1548 printk(KERN_NOTICE "md: data integrity on %s enabled\n",
1549 mdname(mddev));
1550 return 0;
1551}
1552EXPORT_SYMBOL(md_integrity_register);
1553
1554/* Disable data integrity if non-capable/non-matching disk is being added */
1555void md_integrity_add_rdev(mdk_rdev_t *rdev, mddev_t *mddev)
1491{ 1556{
1492 struct mdk_personality *pers = mddev->pers;
1493 struct gendisk *disk = mddev->gendisk;
1494 struct blk_integrity *bi_rdev = bdev_get_integrity(rdev->bdev); 1557 struct blk_integrity *bi_rdev = bdev_get_integrity(rdev->bdev);
1495 struct blk_integrity *bi_mddev = blk_get_integrity(disk); 1558 struct blk_integrity *bi_mddev = blk_get_integrity(mddev->gendisk);
1496 1559
1497 /* Data integrity passthrough not supported on RAID 4, 5 and 6 */ 1560 if (!bi_mddev) /* nothing to do */
1498 if (pers && pers->level >= 4 && pers->level <= 6)
1499 return; 1561 return;
1500 1562 if (rdev->raid_disk < 0) /* skip spares */
1501 /* If rdev is integrity capable, register profile for mddev */
1502 if (!bi_mddev && bi_rdev) {
1503 if (blk_integrity_register(disk, bi_rdev))
1504 printk(KERN_ERR "%s: %s Could not register integrity!\n",
1505 __func__, disk->disk_name);
1506 else
1507 printk(KERN_NOTICE "Enabling data integrity on %s\n",
1508 disk->disk_name);
1509 return; 1563 return;
1510 } 1564 if (bi_rdev && blk_integrity_compare(mddev->gendisk,
1511 1565 rdev->bdev->bd_disk) >= 0)
1512 /* Check that mddev and rdev have matching profiles */ 1566 return;
1513 if (blk_integrity_compare(disk, rdev->bdev->bd_disk) < 0) { 1567 printk(KERN_NOTICE "disabling data integrity on %s\n", mdname(mddev));
1514 printk(KERN_ERR "%s: %s/%s integrity mismatch!\n", __func__, 1568 blk_integrity_unregister(mddev->gendisk);
1515 disk->disk_name, rdev->bdev->bd_disk->disk_name);
1516 printk(KERN_NOTICE "Disabling data integrity on %s\n",
1517 disk->disk_name);
1518 blk_integrity_unregister(disk);
1519 }
1520} 1569}
1570EXPORT_SYMBOL(md_integrity_add_rdev);
1521 1571
1522static int bind_rdev_to_array(mdk_rdev_t * rdev, mddev_t * mddev) 1572static int bind_rdev_to_array(mdk_rdev_t * rdev, mddev_t * mddev)
1523{ 1573{
@@ -1591,7 +1641,6 @@ static int bind_rdev_to_array(mdk_rdev_t * rdev, mddev_t * mddev)
1591 /* May as well allow recovery to be retried once */ 1641 /* May as well allow recovery to be retried once */
1592 mddev->recovery_disabled = 0; 1642 mddev->recovery_disabled = 0;
1593 1643
1594 md_integrity_check(rdev, mddev);
1595 return 0; 1644 return 0;
1596 1645
1597 fail: 1646 fail:
@@ -1756,9 +1805,10 @@ static void print_sb_1(struct mdp_superblock_1 *sb)
1756 __u8 *uuid; 1805 __u8 *uuid;
1757 1806
1758 uuid = sb->set_uuid; 1807 uuid = sb->set_uuid;
1759 printk(KERN_INFO "md: SB: (V:%u) (F:0x%08x) Array-ID:<%02x%02x%02x%02x" 1808 printk(KERN_INFO
1760 ":%02x%02x:%02x%02x:%02x%02x:%02x%02x%02x%02x%02x%02x>\n" 1809 "md: SB: (V:%u) (F:0x%08x) Array-ID:<%02x%02x%02x%02x"
1761 KERN_INFO "md: Name: \"%s\" CT:%llu\n", 1810 ":%02x%02x:%02x%02x:%02x%02x:%02x%02x%02x%02x%02x%02x>\n"
1811 "md: Name: \"%s\" CT:%llu\n",
1762 le32_to_cpu(sb->major_version), 1812 le32_to_cpu(sb->major_version),
1763 le32_to_cpu(sb->feature_map), 1813 le32_to_cpu(sb->feature_map),
1764 uuid[0], uuid[1], uuid[2], uuid[3], 1814 uuid[0], uuid[1], uuid[2], uuid[3],
@@ -1770,12 +1820,13 @@ static void print_sb_1(struct mdp_superblock_1 *sb)
1770 & MD_SUPERBLOCK_1_TIME_SEC_MASK); 1820 & MD_SUPERBLOCK_1_TIME_SEC_MASK);
1771 1821
1772 uuid = sb->device_uuid; 1822 uuid = sb->device_uuid;
1773 printk(KERN_INFO "md: L%u SZ%llu RD:%u LO:%u CS:%u DO:%llu DS:%llu SO:%llu" 1823 printk(KERN_INFO
1824 "md: L%u SZ%llu RD:%u LO:%u CS:%u DO:%llu DS:%llu SO:%llu"
1774 " RO:%llu\n" 1825 " RO:%llu\n"
1775 KERN_INFO "md: Dev:%08x UUID: %02x%02x%02x%02x:%02x%02x:%02x%02x:%02x%02x" 1826 "md: Dev:%08x UUID: %02x%02x%02x%02x:%02x%02x:%02x%02x:%02x%02x"
1776 ":%02x%02x%02x%02x%02x%02x\n" 1827 ":%02x%02x%02x%02x%02x%02x\n"
1777 KERN_INFO "md: (F:0x%08x) UT:%llu Events:%llu ResyncOffset:%llu CSUM:0x%08x\n" 1828 "md: (F:0x%08x) UT:%llu Events:%llu ResyncOffset:%llu CSUM:0x%08x\n"
1778 KERN_INFO "md: (MaxDev:%u) \n", 1829 "md: (MaxDev:%u) \n",
1779 le32_to_cpu(sb->level), 1830 le32_to_cpu(sb->level),
1780 (unsigned long long)le64_to_cpu(sb->size), 1831 (unsigned long long)le64_to_cpu(sb->size),
1781 le32_to_cpu(sb->raid_disks), 1832 le32_to_cpu(sb->raid_disks),
@@ -2655,6 +2706,7 @@ level_store(mddev_t *mddev, const char *buf, size_t len)
2655 ssize_t rv = len; 2706 ssize_t rv = len;
2656 struct mdk_personality *pers; 2707 struct mdk_personality *pers;
2657 void *priv; 2708 void *priv;
2709 mdk_rdev_t *rdev;
2658 2710
2659 if (mddev->pers == NULL) { 2711 if (mddev->pers == NULL) {
2660 if (len == 0) 2712 if (len == 0)
@@ -2734,6 +2786,12 @@ level_store(mddev_t *mddev, const char *buf, size_t len)
2734 mddev_suspend(mddev); 2786 mddev_suspend(mddev);
2735 mddev->pers->stop(mddev); 2787 mddev->pers->stop(mddev);
2736 module_put(mddev->pers->owner); 2788 module_put(mddev->pers->owner);
2789 /* Invalidate devices that are now superfluous */
2790 list_for_each_entry(rdev, &mddev->disks, same_set)
2791 if (rdev->raid_disk >= mddev->raid_disks) {
2792 rdev->raid_disk = -1;
2793 clear_bit(In_sync, &rdev->flags);
2794 }
2737 mddev->pers = pers; 2795 mddev->pers = pers;
2738 mddev->private = priv; 2796 mddev->private = priv;
2739 strlcpy(mddev->clevel, pers->name, sizeof(mddev->clevel)); 2797 strlcpy(mddev->clevel, pers->name, sizeof(mddev->clevel));
@@ -3573,7 +3631,8 @@ suspend_lo_store(mddev_t *mddev, const char *buf, size_t len)
3573 char *e; 3631 char *e;
3574 unsigned long long new = simple_strtoull(buf, &e, 10); 3632 unsigned long long new = simple_strtoull(buf, &e, 10);
3575 3633
3576 if (mddev->pers->quiesce == NULL) 3634 if (mddev->pers == NULL ||
3635 mddev->pers->quiesce == NULL)
3577 return -EINVAL; 3636 return -EINVAL;
3578 if (buf == e || (*e && *e != '\n')) 3637 if (buf == e || (*e && *e != '\n'))
3579 return -EINVAL; 3638 return -EINVAL;
@@ -3601,7 +3660,8 @@ suspend_hi_store(mddev_t *mddev, const char *buf, size_t len)
3601 char *e; 3660 char *e;
3602 unsigned long long new = simple_strtoull(buf, &e, 10); 3661 unsigned long long new = simple_strtoull(buf, &e, 10);
3603 3662
3604 if (mddev->pers->quiesce == NULL) 3663 if (mddev->pers == NULL ||
3664 mddev->pers->quiesce == NULL)
3605 return -EINVAL; 3665 return -EINVAL;
3606 if (buf == e || (*e && *e != '\n')) 3666 if (buf == e || (*e && *e != '\n'))
3607 return -EINVAL; 3667 return -EINVAL;
@@ -3681,17 +3741,8 @@ array_size_store(mddev_t *mddev, const char *buf, size_t len)
3681 3741
3682 mddev->array_sectors = sectors; 3742 mddev->array_sectors = sectors;
3683 set_capacity(mddev->gendisk, mddev->array_sectors); 3743 set_capacity(mddev->gendisk, mddev->array_sectors);
3684 if (mddev->pers) { 3744 if (mddev->pers)
3685 struct block_device *bdev = bdget_disk(mddev->gendisk, 0); 3745 revalidate_disk(mddev->gendisk);
3686
3687 if (bdev) {
3688 mutex_lock(&bdev->bd_inode->i_mutex);
3689 i_size_write(bdev->bd_inode,
3690 (loff_t)mddev->array_sectors << 9);
3691 mutex_unlock(&bdev->bd_inode->i_mutex);
3692 bdput(bdev);
3693 }
3694 }
3695 3746
3696 return len; 3747 return len;
3697} 3748}
@@ -3844,11 +3895,9 @@ static int md_alloc(dev_t dev, char *name)
3844 flush_scheduled_work(); 3895 flush_scheduled_work();
3845 3896
3846 mutex_lock(&disks_mutex); 3897 mutex_lock(&disks_mutex);
3847 if (mddev->gendisk) { 3898 error = -EEXIST;
3848 mutex_unlock(&disks_mutex); 3899 if (mddev->gendisk)
3849 mddev_put(mddev); 3900 goto abort;
3850 return -EEXIST;
3851 }
3852 3901
3853 if (name) { 3902 if (name) {
3854 /* Need to ensure that 'name' is not a duplicate. 3903 /* Need to ensure that 'name' is not a duplicate.
@@ -3860,17 +3909,15 @@ static int md_alloc(dev_t dev, char *name)
3860 if (mddev2->gendisk && 3909 if (mddev2->gendisk &&
3861 strcmp(mddev2->gendisk->disk_name, name) == 0) { 3910 strcmp(mddev2->gendisk->disk_name, name) == 0) {
3862 spin_unlock(&all_mddevs_lock); 3911 spin_unlock(&all_mddevs_lock);
3863 return -EEXIST; 3912 goto abort;
3864 } 3913 }
3865 spin_unlock(&all_mddevs_lock); 3914 spin_unlock(&all_mddevs_lock);
3866 } 3915 }
3867 3916
3917 error = -ENOMEM;
3868 mddev->queue = blk_alloc_queue(GFP_KERNEL); 3918 mddev->queue = blk_alloc_queue(GFP_KERNEL);
3869 if (!mddev->queue) { 3919 if (!mddev->queue)
3870 mutex_unlock(&disks_mutex); 3920 goto abort;
3871 mddev_put(mddev);
3872 return -ENOMEM;
3873 }
3874 mddev->queue->queuedata = mddev; 3921 mddev->queue->queuedata = mddev;
3875 3922
3876 /* Can be unlocked because the queue is new: no concurrency */ 3923 /* Can be unlocked because the queue is new: no concurrency */
@@ -3880,11 +3927,9 @@ static int md_alloc(dev_t dev, char *name)
3880 3927
3881 disk = alloc_disk(1 << shift); 3928 disk = alloc_disk(1 << shift);
3882 if (!disk) { 3929 if (!disk) {
3883 mutex_unlock(&disks_mutex);
3884 blk_cleanup_queue(mddev->queue); 3930 blk_cleanup_queue(mddev->queue);
3885 mddev->queue = NULL; 3931 mddev->queue = NULL;
3886 mddev_put(mddev); 3932 goto abort;
3887 return -ENOMEM;
3888 } 3933 }
3889 disk->major = MAJOR(mddev->unit); 3934 disk->major = MAJOR(mddev->unit);
3890 disk->first_minor = unit << shift; 3935 disk->first_minor = unit << shift;
@@ -3906,16 +3951,22 @@ static int md_alloc(dev_t dev, char *name)
3906 mddev->gendisk = disk; 3951 mddev->gendisk = disk;
3907 error = kobject_init_and_add(&mddev->kobj, &md_ktype, 3952 error = kobject_init_and_add(&mddev->kobj, &md_ktype,
3908 &disk_to_dev(disk)->kobj, "%s", "md"); 3953 &disk_to_dev(disk)->kobj, "%s", "md");
3909 mutex_unlock(&disks_mutex); 3954 if (error) {
3910 if (error) 3955 /* This isn't possible, but as kobject_init_and_add is marked
3956 * __must_check, we must do something with the result
3957 */
3911 printk(KERN_WARNING "md: cannot register %s/md - name in use\n", 3958 printk(KERN_WARNING "md: cannot register %s/md - name in use\n",
3912 disk->disk_name); 3959 disk->disk_name);
3913 else { 3960 error = 0;
3961 }
3962 abort:
3963 mutex_unlock(&disks_mutex);
3964 if (!error) {
3914 kobject_uevent(&mddev->kobj, KOBJ_ADD); 3965 kobject_uevent(&mddev->kobj, KOBJ_ADD);
3915 mddev->sysfs_state = sysfs_get_dirent(mddev->kobj.sd, "array_state"); 3966 mddev->sysfs_state = sysfs_get_dirent(mddev->kobj.sd, "array_state");
3916 } 3967 }
3917 mddev_put(mddev); 3968 mddev_put(mddev);
3918 return 0; 3969 return error;
3919} 3970}
3920 3971
3921static struct kobject *md_probe(dev_t dev, int *part, void *data) 3972static struct kobject *md_probe(dev_t dev, int *part, void *data)
@@ -4044,10 +4095,6 @@ static int do_md_run(mddev_t * mddev)
4044 } 4095 }
4045 strlcpy(mddev->clevel, pers->name, sizeof(mddev->clevel)); 4096 strlcpy(mddev->clevel, pers->name, sizeof(mddev->clevel));
4046 4097
4047 if (pers->level >= 4 && pers->level <= 6)
4048 /* Cannot support integrity (yet) */
4049 blk_integrity_unregister(mddev->gendisk);
4050
4051 if (mddev->reshape_position != MaxSector && 4098 if (mddev->reshape_position != MaxSector &&
4052 pers->start_reshape == NULL) { 4099 pers->start_reshape == NULL) {
4053 /* This personality cannot handle reshaping... */ 4100 /* This personality cannot handle reshaping... */
@@ -4185,6 +4232,7 @@ static int do_md_run(mddev_t * mddev)
4185 md_wakeup_thread(mddev->thread); 4232 md_wakeup_thread(mddev->thread);
4186 md_wakeup_thread(mddev->sync_thread); /* possibly kick off a reshape */ 4233 md_wakeup_thread(mddev->sync_thread); /* possibly kick off a reshape */
4187 4234
4235 revalidate_disk(mddev->gendisk);
4188 mddev->changed = 1; 4236 mddev->changed = 1;
4189 md_new_event(mddev); 4237 md_new_event(mddev);
4190 sysfs_notify_dirent(mddev->sysfs_state); 4238 sysfs_notify_dirent(mddev->sysfs_state);
@@ -5083,18 +5131,8 @@ static int update_size(mddev_t *mddev, sector_t num_sectors)
5083 return -ENOSPC; 5131 return -ENOSPC;
5084 } 5132 }
5085 rv = mddev->pers->resize(mddev, num_sectors); 5133 rv = mddev->pers->resize(mddev, num_sectors);
5086 if (!rv) { 5134 if (!rv)
5087 struct block_device *bdev; 5135 revalidate_disk(mddev->gendisk);
5088
5089 bdev = bdget_disk(mddev->gendisk, 0);
5090 if (bdev) {
5091 mutex_lock(&bdev->bd_inode->i_mutex);
5092 i_size_write(bdev->bd_inode,
5093 (loff_t)mddev->array_sectors << 9);
5094 mutex_unlock(&bdev->bd_inode->i_mutex);
5095 bdput(bdev);
5096 }
5097 }
5098 return rv; 5136 return rv;
5099} 5137}
5100 5138
@@ -6334,10 +6372,16 @@ void md_do_sync(mddev_t *mddev)
6334 sysfs_notify(&mddev->kobj, NULL, "sync_completed"); 6372 sysfs_notify(&mddev->kobj, NULL, "sync_completed");
6335 } 6373 }
6336 6374
6337 if (j >= mddev->resync_max) 6375 while (j >= mddev->resync_max && !kthread_should_stop()) {
6338 wait_event(mddev->recovery_wait, 6376 /* As this condition is controlled by user-space,
6339 mddev->resync_max > j 6377 * we can block indefinitely, so use '_interruptible'
6340 || kthread_should_stop()); 6378 * to avoid triggering warnings.
6379 */
6380 flush_signals(current); /* just in case */
6381 wait_event_interruptible(mddev->recovery_wait,
6382 mddev->resync_max > j
6383 || kthread_should_stop());
6384 }
6341 6385
6342 if (kthread_should_stop()) 6386 if (kthread_should_stop())
6343 goto interrupted; 6387 goto interrupted;
diff --git a/drivers/md/md.h b/drivers/md/md.h
index 9430a110db93..78f03168baf9 100644
--- a/drivers/md/md.h
+++ b/drivers/md/md.h
@@ -431,5 +431,7 @@ extern int md_allow_write(mddev_t *mddev);
431extern void md_wait_for_blocked_rdev(mdk_rdev_t *rdev, mddev_t *mddev); 431extern void md_wait_for_blocked_rdev(mdk_rdev_t *rdev, mddev_t *mddev);
432extern void md_set_array_sectors(mddev_t *mddev, sector_t array_sectors); 432extern void md_set_array_sectors(mddev_t *mddev, sector_t array_sectors);
433extern int md_check_no_bitmap(mddev_t *mddev); 433extern int md_check_no_bitmap(mddev_t *mddev);
434extern int md_integrity_register(mddev_t *mddev);
435void md_integrity_add_rdev(mdk_rdev_t *rdev, mddev_t *mddev);
434 436
435#endif /* _MD_MD_H */ 437#endif /* _MD_MD_H */
diff --git a/drivers/md/multipath.c b/drivers/md/multipath.c
index cbe368fa6598..7140909f6662 100644
--- a/drivers/md/multipath.c
+++ b/drivers/md/multipath.c
@@ -294,7 +294,8 @@ static int multipath_add_disk(mddev_t *mddev, mdk_rdev_t *rdev)
294 for (path = first; path <= last; path++) 294 for (path = first; path <= last; path++)
295 if ((p=conf->multipaths+path)->rdev == NULL) { 295 if ((p=conf->multipaths+path)->rdev == NULL) {
296 q = rdev->bdev->bd_disk->queue; 296 q = rdev->bdev->bd_disk->queue;
297 blk_queue_stack_limits(mddev->queue, q); 297 disk_stack_limits(mddev->gendisk, rdev->bdev,
298 rdev->data_offset << 9);
298 299
299 /* as we don't honour merge_bvec_fn, we must never risk 300 /* as we don't honour merge_bvec_fn, we must never risk
300 * violating it, so limit ->max_sector to one PAGE, as 301 * violating it, so limit ->max_sector to one PAGE, as
@@ -312,6 +313,7 @@ static int multipath_add_disk(mddev_t *mddev, mdk_rdev_t *rdev)
312 set_bit(In_sync, &rdev->flags); 313 set_bit(In_sync, &rdev->flags);
313 rcu_assign_pointer(p->rdev, rdev); 314 rcu_assign_pointer(p->rdev, rdev);
314 err = 0; 315 err = 0;
316 md_integrity_add_rdev(rdev, mddev);
315 break; 317 break;
316 } 318 }
317 319
@@ -344,7 +346,9 @@ static int multipath_remove_disk(mddev_t *mddev, int number)
344 /* lost the race, try later */ 346 /* lost the race, try later */
345 err = -EBUSY; 347 err = -EBUSY;
346 p->rdev = rdev; 348 p->rdev = rdev;
349 goto abort;
347 } 350 }
351 md_integrity_register(mddev);
348 } 352 }
349abort: 353abort:
350 354
@@ -463,9 +467,9 @@ static int multipath_run (mddev_t *mddev)
463 467
464 disk = conf->multipaths + disk_idx; 468 disk = conf->multipaths + disk_idx;
465 disk->rdev = rdev; 469 disk->rdev = rdev;
470 disk_stack_limits(mddev->gendisk, rdev->bdev,
471 rdev->data_offset << 9);
466 472
467 blk_queue_stack_limits(mddev->queue,
468 rdev->bdev->bd_disk->queue);
469 /* as we don't honour merge_bvec_fn, we must never risk 473 /* as we don't honour merge_bvec_fn, we must never risk
470 * violating it, not that we ever expect a device with 474 * violating it, not that we ever expect a device with
471 * a merge_bvec_fn to be involved in multipath */ 475 * a merge_bvec_fn to be involved in multipath */
@@ -518,7 +522,7 @@ static int multipath_run (mddev_t *mddev)
518 mddev->queue->unplug_fn = multipath_unplug; 522 mddev->queue->unplug_fn = multipath_unplug;
519 mddev->queue->backing_dev_info.congested_fn = multipath_congested; 523 mddev->queue->backing_dev_info.congested_fn = multipath_congested;
520 mddev->queue->backing_dev_info.congested_data = mddev; 524 mddev->queue->backing_dev_info.congested_data = mddev;
521 525 md_integrity_register(mddev);
522 return 0; 526 return 0;
523 527
524out_free_conf: 528out_free_conf:
diff --git a/drivers/md/raid0.c b/drivers/md/raid0.c
index ab4a489d8695..898e2bdfee47 100644
--- a/drivers/md/raid0.c
+++ b/drivers/md/raid0.c
@@ -170,8 +170,8 @@ static int create_strip_zones(mddev_t *mddev)
170 } 170 }
171 dev[j] = rdev1; 171 dev[j] = rdev1;
172 172
173 blk_queue_stack_limits(mddev->queue, 173 disk_stack_limits(mddev->gendisk, rdev1->bdev,
174 rdev1->bdev->bd_disk->queue); 174 rdev1->data_offset << 9);
175 /* as we don't honour merge_bvec_fn, we must never risk 175 /* as we don't honour merge_bvec_fn, we must never risk
176 * violating it, so limit ->max_sector to one PAGE, as 176 * violating it, so limit ->max_sector to one PAGE, as
177 * a one page request is never in violation. 177 * a one page request is never in violation.
@@ -250,6 +250,11 @@ static int create_strip_zones(mddev_t *mddev)
250 mddev->chunk_sectors << 9); 250 mddev->chunk_sectors << 9);
251 goto abort; 251 goto abort;
252 } 252 }
253
254 blk_queue_io_min(mddev->queue, mddev->chunk_sectors << 9);
255 blk_queue_io_opt(mddev->queue,
256 (mddev->chunk_sectors << 9) * mddev->raid_disks);
257
253 printk(KERN_INFO "raid0: done.\n"); 258 printk(KERN_INFO "raid0: done.\n");
254 mddev->private = conf; 259 mddev->private = conf;
255 return 0; 260 return 0;
@@ -346,6 +351,7 @@ static int raid0_run(mddev_t *mddev)
346 351
347 blk_queue_merge_bvec(mddev->queue, raid0_mergeable_bvec); 352 blk_queue_merge_bvec(mddev->queue, raid0_mergeable_bvec);
348 dump_zones(mddev); 353 dump_zones(mddev);
354 md_integrity_register(mddev);
349 return 0; 355 return 0;
350} 356}
351 357
diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c
index 89939a7aef57..8726fd7ebce5 100644
--- a/drivers/md/raid1.c
+++ b/drivers/md/raid1.c
@@ -1123,8 +1123,8 @@ static int raid1_add_disk(mddev_t *mddev, mdk_rdev_t *rdev)
1123 for (mirror = first; mirror <= last; mirror++) 1123 for (mirror = first; mirror <= last; mirror++)
1124 if ( !(p=conf->mirrors+mirror)->rdev) { 1124 if ( !(p=conf->mirrors+mirror)->rdev) {
1125 1125
1126 blk_queue_stack_limits(mddev->queue, 1126 disk_stack_limits(mddev->gendisk, rdev->bdev,
1127 rdev->bdev->bd_disk->queue); 1127 rdev->data_offset << 9);
1128 /* as we don't honour merge_bvec_fn, we must never risk 1128 /* as we don't honour merge_bvec_fn, we must never risk
1129 * violating it, so limit ->max_sector to one PAGE, as 1129 * violating it, so limit ->max_sector to one PAGE, as
1130 * a one page request is never in violation. 1130 * a one page request is never in violation.
@@ -1144,7 +1144,7 @@ static int raid1_add_disk(mddev_t *mddev, mdk_rdev_t *rdev)
1144 rcu_assign_pointer(p->rdev, rdev); 1144 rcu_assign_pointer(p->rdev, rdev);
1145 break; 1145 break;
1146 } 1146 }
1147 1147 md_integrity_add_rdev(rdev, mddev);
1148 print_conf(conf); 1148 print_conf(conf);
1149 return err; 1149 return err;
1150} 1150}
@@ -1178,7 +1178,9 @@ static int raid1_remove_disk(mddev_t *mddev, int number)
1178 /* lost the race, try later */ 1178 /* lost the race, try later */
1179 err = -EBUSY; 1179 err = -EBUSY;
1180 p->rdev = rdev; 1180 p->rdev = rdev;
1181 goto abort;
1181 } 1182 }
1183 md_integrity_register(mddev);
1182 } 1184 }
1183abort: 1185abort:
1184 1186
@@ -1988,9 +1990,8 @@ static int run(mddev_t *mddev)
1988 disk = conf->mirrors + disk_idx; 1990 disk = conf->mirrors + disk_idx;
1989 1991
1990 disk->rdev = rdev; 1992 disk->rdev = rdev;
1991 1993 disk_stack_limits(mddev->gendisk, rdev->bdev,
1992 blk_queue_stack_limits(mddev->queue, 1994 rdev->data_offset << 9);
1993 rdev->bdev->bd_disk->queue);
1994 /* as we don't honour merge_bvec_fn, we must never risk 1995 /* as we don't honour merge_bvec_fn, we must never risk
1995 * violating it, so limit ->max_sector to one PAGE, as 1996 * violating it, so limit ->max_sector to one PAGE, as
1996 * a one page request is never in violation. 1997 * a one page request is never in violation.
@@ -2068,7 +2069,7 @@ static int run(mddev_t *mddev)
2068 mddev->queue->unplug_fn = raid1_unplug; 2069 mddev->queue->unplug_fn = raid1_unplug;
2069 mddev->queue->backing_dev_info.congested_fn = raid1_congested; 2070 mddev->queue->backing_dev_info.congested_fn = raid1_congested;
2070 mddev->queue->backing_dev_info.congested_data = mddev; 2071 mddev->queue->backing_dev_info.congested_data = mddev;
2071 2072 md_integrity_register(mddev);
2072 return 0; 2073 return 0;
2073 2074
2074out_no_mem: 2075out_no_mem:
@@ -2133,6 +2134,7 @@ static int raid1_resize(mddev_t *mddev, sector_t sectors)
2133 return -EINVAL; 2134 return -EINVAL;
2134 set_capacity(mddev->gendisk, mddev->array_sectors); 2135 set_capacity(mddev->gendisk, mddev->array_sectors);
2135 mddev->changed = 1; 2136 mddev->changed = 1;
2137 revalidate_disk(mddev->gendisk);
2136 if (sectors > mddev->dev_sectors && 2138 if (sectors > mddev->dev_sectors &&
2137 mddev->recovery_cp == MaxSector) { 2139 mddev->recovery_cp == MaxSector) {
2138 mddev->recovery_cp = mddev->dev_sectors; 2140 mddev->recovery_cp = mddev->dev_sectors;
diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c
index ae12ceafe10c..3d9020cf6f6e 100644
--- a/drivers/md/raid10.c
+++ b/drivers/md/raid10.c
@@ -1151,8 +1151,8 @@ static int raid10_add_disk(mddev_t *mddev, mdk_rdev_t *rdev)
1151 for ( ; mirror <= last ; mirror++) 1151 for ( ; mirror <= last ; mirror++)
1152 if ( !(p=conf->mirrors+mirror)->rdev) { 1152 if ( !(p=conf->mirrors+mirror)->rdev) {
1153 1153
1154 blk_queue_stack_limits(mddev->queue, 1154 disk_stack_limits(mddev->gendisk, rdev->bdev,
1155 rdev->bdev->bd_disk->queue); 1155 rdev->data_offset << 9);
1156 /* as we don't honour merge_bvec_fn, we must never risk 1156 /* as we don't honour merge_bvec_fn, we must never risk
1157 * violating it, so limit ->max_sector to one PAGE, as 1157 * violating it, so limit ->max_sector to one PAGE, as
1158 * a one page request is never in violation. 1158 * a one page request is never in violation.
@@ -1170,6 +1170,7 @@ static int raid10_add_disk(mddev_t *mddev, mdk_rdev_t *rdev)
1170 break; 1170 break;
1171 } 1171 }
1172 1172
1173 md_integrity_add_rdev(rdev, mddev);
1173 print_conf(conf); 1174 print_conf(conf);
1174 return err; 1175 return err;
1175} 1176}
@@ -1203,7 +1204,9 @@ static int raid10_remove_disk(mddev_t *mddev, int number)
1203 /* lost the race, try later */ 1204 /* lost the race, try later */
1204 err = -EBUSY; 1205 err = -EBUSY;
1205 p->rdev = rdev; 1206 p->rdev = rdev;
1207 goto abort;
1206 } 1208 }
1209 md_integrity_register(mddev);
1207 } 1210 }
1208abort: 1211abort:
1209 1212
@@ -2044,7 +2047,7 @@ raid10_size(mddev_t *mddev, sector_t sectors, int raid_disks)
2044static int run(mddev_t *mddev) 2047static int run(mddev_t *mddev)
2045{ 2048{
2046 conf_t *conf; 2049 conf_t *conf;
2047 int i, disk_idx; 2050 int i, disk_idx, chunk_size;
2048 mirror_info_t *disk; 2051 mirror_info_t *disk;
2049 mdk_rdev_t *rdev; 2052 mdk_rdev_t *rdev;
2050 int nc, fc, fo; 2053 int nc, fc, fo;
@@ -2130,6 +2133,14 @@ static int run(mddev_t *mddev)
2130 spin_lock_init(&conf->device_lock); 2133 spin_lock_init(&conf->device_lock);
2131 mddev->queue->queue_lock = &conf->device_lock; 2134 mddev->queue->queue_lock = &conf->device_lock;
2132 2135
2136 chunk_size = mddev->chunk_sectors << 9;
2137 blk_queue_io_min(mddev->queue, chunk_size);
2138 if (conf->raid_disks % conf->near_copies)
2139 blk_queue_io_opt(mddev->queue, chunk_size * conf->raid_disks);
2140 else
2141 blk_queue_io_opt(mddev->queue, chunk_size *
2142 (conf->raid_disks / conf->near_copies));
2143
2133 list_for_each_entry(rdev, &mddev->disks, same_set) { 2144 list_for_each_entry(rdev, &mddev->disks, same_set) {
2134 disk_idx = rdev->raid_disk; 2145 disk_idx = rdev->raid_disk;
2135 if (disk_idx >= mddev->raid_disks 2146 if (disk_idx >= mddev->raid_disks
@@ -2138,9 +2149,8 @@ static int run(mddev_t *mddev)
2138 disk = conf->mirrors + disk_idx; 2149 disk = conf->mirrors + disk_idx;
2139 2150
2140 disk->rdev = rdev; 2151 disk->rdev = rdev;
2141 2152 disk_stack_limits(mddev->gendisk, rdev->bdev,
2142 blk_queue_stack_limits(mddev->queue, 2153 rdev->data_offset << 9);
2143 rdev->bdev->bd_disk->queue);
2144 /* as we don't honour merge_bvec_fn, we must never risk 2154 /* as we don't honour merge_bvec_fn, we must never risk
2145 * violating it, so limit ->max_sector to one PAGE, as 2155 * violating it, so limit ->max_sector to one PAGE, as
2146 * a one page request is never in violation. 2156 * a one page request is never in violation.
@@ -2218,6 +2228,7 @@ static int run(mddev_t *mddev)
2218 2228
2219 if (conf->near_copies < mddev->raid_disks) 2229 if (conf->near_copies < mddev->raid_disks)
2220 blk_queue_merge_bvec(mddev->queue, raid10_mergeable_bvec); 2230 blk_queue_merge_bvec(mddev->queue, raid10_mergeable_bvec);
2231 md_integrity_register(mddev);
2221 return 0; 2232 return 0;
2222 2233
2223out_free_conf: 2234out_free_conf:
diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c
index f9f991e6e138..2b521ee67dfa 100644
--- a/drivers/md/raid5.c
+++ b/drivers/md/raid5.c
@@ -3699,13 +3699,21 @@ static int make_request(struct request_queue *q, struct bio * bi)
3699 goto retry; 3699 goto retry;
3700 } 3700 }
3701 } 3701 }
3702 /* FIXME what if we get a false positive because these 3702
3703 * are being updated. 3703 if (bio_data_dir(bi) == WRITE &&
3704 */ 3704 logical_sector >= mddev->suspend_lo &&
3705 if (logical_sector >= mddev->suspend_lo &&
3706 logical_sector < mddev->suspend_hi) { 3705 logical_sector < mddev->suspend_hi) {
3707 release_stripe(sh); 3706 release_stripe(sh);
3708 schedule(); 3707 /* As the suspend_* range is controlled by
3708 * userspace, we want an interruptible
3709 * wait.
3710 */
3711 flush_signals(current);
3712 prepare_to_wait(&conf->wait_for_overlap,
3713 &w, TASK_INTERRUPTIBLE);
3714 if (logical_sector >= mddev->suspend_lo &&
3715 logical_sector < mddev->suspend_hi)
3716 schedule();
3709 goto retry; 3717 goto retry;
3710 } 3718 }
3711 3719
@@ -3991,6 +3999,9 @@ static inline sector_t sync_request(mddev_t *mddev, sector_t sector_nr, int *ski
3991 return 0; 3999 return 0;
3992 } 4000 }
3993 4001
4002 /* Allow raid5_quiesce to complete */
4003 wait_event(conf->wait_for_overlap, conf->quiesce != 2);
4004
3994 if (test_bit(MD_RECOVERY_RESHAPE, &mddev->recovery)) 4005 if (test_bit(MD_RECOVERY_RESHAPE, &mddev->recovery))
3995 return reshape_request(mddev, sector_nr, skipped); 4006 return reshape_request(mddev, sector_nr, skipped);
3996 4007
@@ -4308,6 +4319,15 @@ raid5_size(mddev_t *mddev, sector_t sectors, int raid_disks)
4308 return sectors * (raid_disks - conf->max_degraded); 4319 return sectors * (raid_disks - conf->max_degraded);
4309} 4320}
4310 4321
4322static void free_conf(raid5_conf_t *conf)
4323{
4324 shrink_stripes(conf);
4325 safe_put_page(conf->spare_page);
4326 kfree(conf->disks);
4327 kfree(conf->stripe_hashtbl);
4328 kfree(conf);
4329}
4330
4311static raid5_conf_t *setup_conf(mddev_t *mddev) 4331static raid5_conf_t *setup_conf(mddev_t *mddev)
4312{ 4332{
4313 raid5_conf_t *conf; 4333 raid5_conf_t *conf;
@@ -4439,11 +4459,7 @@ static raid5_conf_t *setup_conf(mddev_t *mddev)
4439 4459
4440 abort: 4460 abort:
4441 if (conf) { 4461 if (conf) {
4442 shrink_stripes(conf); 4462 free_conf(conf);
4443 safe_put_page(conf->spare_page);
4444 kfree(conf->disks);
4445 kfree(conf->stripe_hashtbl);
4446 kfree(conf);
4447 return ERR_PTR(-EIO); 4463 return ERR_PTR(-EIO);
4448 } else 4464 } else
4449 return ERR_PTR(-ENOMEM); 4465 return ERR_PTR(-ENOMEM);
@@ -4452,7 +4468,7 @@ static raid5_conf_t *setup_conf(mddev_t *mddev)
4452static int run(mddev_t *mddev) 4468static int run(mddev_t *mddev)
4453{ 4469{
4454 raid5_conf_t *conf; 4470 raid5_conf_t *conf;
4455 int working_disks = 0; 4471 int working_disks = 0, chunk_size;
4456 mdk_rdev_t *rdev; 4472 mdk_rdev_t *rdev;
4457 4473
4458 if (mddev->recovery_cp != MaxSector) 4474 if (mddev->recovery_cp != MaxSector)
@@ -4607,18 +4623,22 @@ static int run(mddev_t *mddev)
4607 md_set_array_sectors(mddev, raid5_size(mddev, 0, 0)); 4623 md_set_array_sectors(mddev, raid5_size(mddev, 0, 0));
4608 4624
4609 blk_queue_merge_bvec(mddev->queue, raid5_mergeable_bvec); 4625 blk_queue_merge_bvec(mddev->queue, raid5_mergeable_bvec);
4626 chunk_size = mddev->chunk_sectors << 9;
4627 blk_queue_io_min(mddev->queue, chunk_size);
4628 blk_queue_io_opt(mddev->queue, chunk_size *
4629 (conf->raid_disks - conf->max_degraded));
4630
4631 list_for_each_entry(rdev, &mddev->disks, same_set)
4632 disk_stack_limits(mddev->gendisk, rdev->bdev,
4633 rdev->data_offset << 9);
4610 4634
4611 return 0; 4635 return 0;
4612abort: 4636abort:
4613 md_unregister_thread(mddev->thread); 4637 md_unregister_thread(mddev->thread);
4614 mddev->thread = NULL; 4638 mddev->thread = NULL;
4615 if (conf) { 4639 if (conf) {
4616 shrink_stripes(conf);
4617 print_raid5_conf(conf); 4640 print_raid5_conf(conf);
4618 safe_put_page(conf->spare_page); 4641 free_conf(conf);
4619 kfree(conf->disks);
4620 kfree(conf->stripe_hashtbl);
4621 kfree(conf);
4622 } 4642 }
4623 mddev->private = NULL; 4643 mddev->private = NULL;
4624 printk(KERN_ALERT "raid5: failed to run raid set %s\n", mdname(mddev)); 4644 printk(KERN_ALERT "raid5: failed to run raid set %s\n", mdname(mddev));
@@ -4633,13 +4653,10 @@ static int stop(mddev_t *mddev)
4633 4653
4634 md_unregister_thread(mddev->thread); 4654 md_unregister_thread(mddev->thread);
4635 mddev->thread = NULL; 4655 mddev->thread = NULL;
4636 shrink_stripes(conf);
4637 kfree(conf->stripe_hashtbl);
4638 mddev->queue->backing_dev_info.congested_fn = NULL; 4656 mddev->queue->backing_dev_info.congested_fn = NULL;
4639 blk_sync_queue(mddev->queue); /* the unplug fn references 'conf'*/ 4657 blk_sync_queue(mddev->queue); /* the unplug fn references 'conf'*/
4640 sysfs_remove_group(&mddev->kobj, &raid5_attrs_group); 4658 sysfs_remove_group(&mddev->kobj, &raid5_attrs_group);
4641 kfree(conf->disks); 4659 free_conf(conf);
4642 kfree(conf);
4643 mddev->private = NULL; 4660 mddev->private = NULL;
4644 return 0; 4661 return 0;
4645} 4662}
@@ -4841,6 +4858,7 @@ static int raid5_resize(mddev_t *mddev, sector_t sectors)
4841 return -EINVAL; 4858 return -EINVAL;
4842 set_capacity(mddev->gendisk, mddev->array_sectors); 4859 set_capacity(mddev->gendisk, mddev->array_sectors);
4843 mddev->changed = 1; 4860 mddev->changed = 1;
4861 revalidate_disk(mddev->gendisk);
4844 if (sectors > mddev->dev_sectors && mddev->recovery_cp == MaxSector) { 4862 if (sectors > mddev->dev_sectors && mddev->recovery_cp == MaxSector) {
4845 mddev->recovery_cp = mddev->dev_sectors; 4863 mddev->recovery_cp = mddev->dev_sectors;
4846 set_bit(MD_RECOVERY_NEEDED, &mddev->recovery); 4864 set_bit(MD_RECOVERY_NEEDED, &mddev->recovery);
@@ -4986,7 +5004,7 @@ static int raid5_start_reshape(mddev_t *mddev)
4986 spin_unlock_irqrestore(&conf->device_lock, flags); 5004 spin_unlock_irqrestore(&conf->device_lock, flags);
4987 } 5005 }
4988 mddev->raid_disks = conf->raid_disks; 5006 mddev->raid_disks = conf->raid_disks;
4989 mddev->reshape_position = 0; 5007 mddev->reshape_position = conf->reshape_progress;
4990 set_bit(MD_CHANGE_DEVS, &mddev->flags); 5008 set_bit(MD_CHANGE_DEVS, &mddev->flags);
4991 5009
4992 clear_bit(MD_RECOVERY_SYNC, &mddev->recovery); 5010 clear_bit(MD_RECOVERY_SYNC, &mddev->recovery);
@@ -5041,7 +5059,6 @@ static void end_reshape(raid5_conf_t *conf)
5041 */ 5059 */
5042static void raid5_finish_reshape(mddev_t *mddev) 5060static void raid5_finish_reshape(mddev_t *mddev)
5043{ 5061{
5044 struct block_device *bdev;
5045 raid5_conf_t *conf = mddev->private; 5062 raid5_conf_t *conf = mddev->private;
5046 5063
5047 if (!test_bit(MD_RECOVERY_INTR, &mddev->recovery)) { 5064 if (!test_bit(MD_RECOVERY_INTR, &mddev->recovery)) {
@@ -5050,15 +5067,7 @@ static void raid5_finish_reshape(mddev_t *mddev)
5050 md_set_array_sectors(mddev, raid5_size(mddev, 0, 0)); 5067 md_set_array_sectors(mddev, raid5_size(mddev, 0, 0));
5051 set_capacity(mddev->gendisk, mddev->array_sectors); 5068 set_capacity(mddev->gendisk, mddev->array_sectors);
5052 mddev->changed = 1; 5069 mddev->changed = 1;
5053 5070 revalidate_disk(mddev->gendisk);
5054 bdev = bdget_disk(mddev->gendisk, 0);
5055 if (bdev) {
5056 mutex_lock(&bdev->bd_inode->i_mutex);
5057 i_size_write(bdev->bd_inode,
5058 (loff_t)mddev->array_sectors << 9);
5059 mutex_unlock(&bdev->bd_inode->i_mutex);
5060 bdput(bdev);
5061 }
5062 } else { 5071 } else {
5063 int d; 5072 int d;
5064 mddev->degraded = conf->raid_disks; 5073 mddev->degraded = conf->raid_disks;
@@ -5090,12 +5099,18 @@ static void raid5_quiesce(mddev_t *mddev, int state)
5090 5099
5091 case 1: /* stop all writes */ 5100 case 1: /* stop all writes */
5092 spin_lock_irq(&conf->device_lock); 5101 spin_lock_irq(&conf->device_lock);
5093 conf->quiesce = 1; 5102 /* '2' tells resync/reshape to pause so that all
5103 * active stripes can drain
5104 */
5105 conf->quiesce = 2;
5094 wait_event_lock_irq(conf->wait_for_stripe, 5106 wait_event_lock_irq(conf->wait_for_stripe,
5095 atomic_read(&conf->active_stripes) == 0 && 5107 atomic_read(&conf->active_stripes) == 0 &&
5096 atomic_read(&conf->active_aligned_reads) == 0, 5108 atomic_read(&conf->active_aligned_reads) == 0,
5097 conf->device_lock, /* nothing */); 5109 conf->device_lock, /* nothing */);
5110 conf->quiesce = 1;
5098 spin_unlock_irq(&conf->device_lock); 5111 spin_unlock_irq(&conf->device_lock);
5112 /* allow reshape to continue */
5113 wake_up(&conf->wait_for_overlap);
5099 break; 5114 break;
5100 5115
5101 case 0: /* re-enable writes */ 5116 case 0: /* re-enable writes */
diff --git a/drivers/media/common/tuners/tuner-xc2028.c b/drivers/media/common/tuners/tuner-xc2028.c
index b6da9c3873fe..aa20ce8cc668 100644
--- a/drivers/media/common/tuners/tuner-xc2028.c
+++ b/drivers/media/common/tuners/tuner-xc2028.c
@@ -1096,8 +1096,19 @@ static int xc2028_set_params(struct dvb_frontend *fe,
1096 } 1096 }
1097 1097
1098 /* All S-code tables need a 200kHz shift */ 1098 /* All S-code tables need a 200kHz shift */
1099 if (priv->ctrl.demod) 1099 if (priv->ctrl.demod) {
1100 demod = priv->ctrl.demod + 200; 1100 demod = priv->ctrl.demod + 200;
1101 /*
1102 * The DTV7 S-code table needs a 700 kHz shift.
1103 * Thanks to Terry Wu <terrywu2009@gmail.com> for reporting this
1104 *
1105 * DTV7 is only used in Australia. Germany or Italy may also
1106 * use this firmware after initialization, but a tune to a UHF
1107 * channel should then cause DTV78 to be used.
1108 */
1109 if (type & DTV7)
1110 demod += 500;
1111 }
1101 1112
1102 return generic_set_freq(fe, p->frequency, 1113 return generic_set_freq(fe, p->frequency,
1103 T_DIGITAL_TV, type, 0, demod); 1114 T_DIGITAL_TV, type, 0, demod);
diff --git a/drivers/media/dvb/b2c2/flexcop-fe-tuner.c b/drivers/media/dvb/b2c2/flexcop-fe-tuner.c
index efb4a6c2b57a..9a6307a347b2 100644
--- a/drivers/media/dvb/b2c2/flexcop-fe-tuner.c
+++ b/drivers/media/dvb/b2c2/flexcop-fe-tuner.c
@@ -20,8 +20,14 @@
20#include "tuner-simple.h" 20#include "tuner-simple.h"
21#include "stv0297.h" 21#include "stv0297.h"
22 22
23
24/* Can we use the specified front-end? Remember that if we are compiled
25 * into the kernel we can't call code that's in modules. */
26#define FE_SUPPORTED(fe) (defined(CONFIG_DVB_##fe) || \
27 (defined(CONFIG_DVB_##fe##_MODULE) && defined(MODULE)))
28
23/* lnb control */ 29/* lnb control */
24#if defined(CONFIG_DVB_MT312_MODULE) || defined(CONFIG_DVB_STV0299_MODULE) 30#if FE_SUPPORTED(MT312) || FE_SUPPORTED(STV0299)
25static int flexcop_set_voltage(struct dvb_frontend *fe, fe_sec_voltage_t voltage) 31static int flexcop_set_voltage(struct dvb_frontend *fe, fe_sec_voltage_t voltage)
26{ 32{
27 struct flexcop_device *fc = fe->dvb->priv; 33 struct flexcop_device *fc = fe->dvb->priv;
@@ -49,8 +55,7 @@ static int flexcop_set_voltage(struct dvb_frontend *fe, fe_sec_voltage_t voltage
49} 55}
50#endif 56#endif
51 57
52#if defined(CONFIG_DVB_S5H1420_MODULE) || defined(CONFIG_DVB_STV0299_MODULE) \ 58#if FE_SUPPORTED(S5H1420) || FE_SUPPORTED(STV0299) || FE_SUPPORTED(MT312)
53 || defined(CONFIG_DVB_MT312_MODULE)
54static int flexcop_sleep(struct dvb_frontend* fe) 59static int flexcop_sleep(struct dvb_frontend* fe)
55{ 60{
56 struct flexcop_device *fc = fe->dvb->priv; 61 struct flexcop_device *fc = fe->dvb->priv;
@@ -61,7 +66,7 @@ static int flexcop_sleep(struct dvb_frontend* fe)
61#endif 66#endif
62 67
63/* SkyStar2 DVB-S rev 2.3 */ 68/* SkyStar2 DVB-S rev 2.3 */
64#if defined(CONFIG_DVB_MT312_MODULE) 69#if FE_SUPPORTED(MT312)
65static int flexcop_set_tone(struct dvb_frontend *fe, fe_sec_tone_mode_t tone) 70static int flexcop_set_tone(struct dvb_frontend *fe, fe_sec_tone_mode_t tone)
66{ 71{
67/* u16 wz_half_period_for_45_mhz[] = { 0x01ff, 0x0154, 0x00ff, 0x00cc }; */ 72/* u16 wz_half_period_for_45_mhz[] = { 0x01ff, 0x0154, 0x00ff, 0x00cc }; */
@@ -193,10 +198,12 @@ static int skystar2_rev23_attach(struct flexcop_device *fc,
193 } 198 }
194 return 0; 199 return 0;
195} 200}
201#else
202#define skystar2_rev23_attach NULL
196#endif 203#endif
197 204
198/* SkyStar2 DVB-S rev 2.6 */ 205/* SkyStar2 DVB-S rev 2.6 */
199#if defined(CONFIG_DVB_STV0299_MODULE) 206#if FE_SUPPORTED(STV0299)
200static int samsung_tbmu24112_set_symbol_rate(struct dvb_frontend *fe, 207static int samsung_tbmu24112_set_symbol_rate(struct dvb_frontend *fe,
201 u32 srate, u32 ratio) 208 u32 srate, u32 ratio)
202{ 209{
@@ -321,10 +328,12 @@ static int skystar2_rev26_attach(struct flexcop_device *fc,
321 } 328 }
322 return 0; 329 return 0;
323} 330}
331#else
332#define skystar2_rev26_attach NULL
324#endif 333#endif
325 334
326/* SkyStar2 DVB-S rev 2.7 */ 335/* SkyStar2 DVB-S rev 2.7 */
327#if defined(CONFIG_DVB_S5H1420_MODULE) 336#if FE_SUPPORTED(S5H1420) && FE_SUPPORTED(ISL6421) && FE_SUPPORTED(TUNER_ITD1000)
328static struct s5h1420_config skystar2_rev2_7_s5h1420_config = { 337static struct s5h1420_config skystar2_rev2_7_s5h1420_config = {
329 .demod_address = 0x53, 338 .demod_address = 0x53,
330 .invert = 1, 339 .invert = 1,
@@ -385,10 +394,12 @@ fail:
385 fc->fc_i2c_adap[0].no_base_addr = 0; 394 fc->fc_i2c_adap[0].no_base_addr = 0;
386 return 0; 395 return 0;
387} 396}
397#else
398#define skystar2_rev27_attach NULL
388#endif 399#endif
389 400
390/* SkyStar2 rev 2.8 */ 401/* SkyStar2 rev 2.8 */
391#if defined(CONFIG_DVB_CX24123_MODULE) 402#if FE_SUPPORTED(CX24123) && FE_SUPPORTED(ISL6421) && FE_SUPPORTED(TUNER_CX24113)
392static struct cx24123_config skystar2_rev2_8_cx24123_config = { 403static struct cx24123_config skystar2_rev2_8_cx24123_config = {
393 .demod_address = 0x55, 404 .demod_address = 0x55,
394 .dont_use_pll = 1, 405 .dont_use_pll = 1,
@@ -433,10 +444,12 @@ static int skystar2_rev28_attach(struct flexcop_device *fc,
433 * IR-receiver (PIC16F818) - but the card has no input for that ??? */ 444 * IR-receiver (PIC16F818) - but the card has no input for that ??? */
434 return 1; 445 return 1;
435} 446}
447#else
448#define skystar2_rev28_attach NULL
436#endif 449#endif
437 450
438/* AirStar DVB-T */ 451/* AirStar DVB-T */
439#if defined(CONFIG_DVB_MT352_MODULE) 452#if FE_SUPPORTED(MT352)
440static int samsung_tdtc9251dh0_demod_init(struct dvb_frontend *fe) 453static int samsung_tdtc9251dh0_demod_init(struct dvb_frontend *fe)
441{ 454{
442 static u8 mt352_clock_config[] = { 0x89, 0x18, 0x2d }; 455 static u8 mt352_clock_config[] = { 0x89, 0x18, 0x2d };
@@ -495,10 +508,12 @@ static int airstar_dvbt_attach(struct flexcop_device *fc,
495 } 508 }
496 return 0; 509 return 0;
497} 510}
511#else
512#define airstar_dvbt_attach NULL
498#endif 513#endif
499 514
500/* AirStar ATSC 1st generation */ 515/* AirStar ATSC 1st generation */
501#if defined(CONFIG_DVB_BCM3510_MODULE) 516#if FE_SUPPORTED(BCM3510)
502static int flexcop_fe_request_firmware(struct dvb_frontend *fe, 517static int flexcop_fe_request_firmware(struct dvb_frontend *fe,
503 const struct firmware **fw, char* name) 518 const struct firmware **fw, char* name)
504{ 519{
@@ -517,10 +532,12 @@ static int airstar_atsc1_attach(struct flexcop_device *fc,
517 fc->fe = dvb_attach(bcm3510_attach, &air2pc_atsc_first_gen_config, i2c); 532 fc->fe = dvb_attach(bcm3510_attach, &air2pc_atsc_first_gen_config, i2c);
518 return fc->fe != NULL; 533 return fc->fe != NULL;
519} 534}
535#else
536#define airstar_atsc1_attach NULL
520#endif 537#endif
521 538
522/* AirStar ATSC 2nd generation */ 539/* AirStar ATSC 2nd generation */
523#if defined(CONFIG_DVB_NXT200X_MODULE) 540#if FE_SUPPORTED(NXT200X) && FE_SUPPORTED(PLL)
524static struct nxt200x_config samsung_tbmv_config = { 541static struct nxt200x_config samsung_tbmv_config = {
525 .demod_address = 0x0a, 542 .demod_address = 0x0a,
526}; 543};
@@ -535,10 +552,12 @@ static int airstar_atsc2_attach(struct flexcop_device *fc,
535 return !!dvb_attach(dvb_pll_attach, fc->fe, 0x61, NULL, 552 return !!dvb_attach(dvb_pll_attach, fc->fe, 0x61, NULL,
536 DVB_PLL_SAMSUNG_TBMV); 553 DVB_PLL_SAMSUNG_TBMV);
537} 554}
555#else
556#define airstar_atsc2_attach NULL
538#endif 557#endif
539 558
540/* AirStar ATSC 3rd generation */ 559/* AirStar ATSC 3rd generation */
541#if defined(CONFIG_DVB_LGDT330X_MODULE) 560#if FE_SUPPORTED(LGDT330X)
542static struct lgdt330x_config air2pc_atsc_hd5000_config = { 561static struct lgdt330x_config air2pc_atsc_hd5000_config = {
543 .demod_address = 0x59, 562 .demod_address = 0x59,
544 .demod_chip = LGDT3303, 563 .demod_chip = LGDT3303,
@@ -556,10 +575,12 @@ static int airstar_atsc3_attach(struct flexcop_device *fc,
556 return !!dvb_attach(simple_tuner_attach, fc->fe, i2c, 0x61, 575 return !!dvb_attach(simple_tuner_attach, fc->fe, i2c, 0x61,
557 TUNER_LG_TDVS_H06XF); 576 TUNER_LG_TDVS_H06XF);
558} 577}
578#else
579#define airstar_atsc3_attach NULL
559#endif 580#endif
560 581
561/* CableStar2 DVB-C */ 582/* CableStar2 DVB-C */
562#if defined(CONFIG_DVB_STV0297_MODULE) 583#if FE_SUPPORTED(STV0297)
563static int alps_tdee4_stv0297_tuner_set_params(struct dvb_frontend* fe, 584static int alps_tdee4_stv0297_tuner_set_params(struct dvb_frontend* fe,
564 struct dvb_frontend_parameters *fep) 585 struct dvb_frontend_parameters *fep)
565{ 586{
@@ -698,39 +719,23 @@ static int cablestar2_attach(struct flexcop_device *fc,
698 fc->fe->ops.tuner_ops.set_params = alps_tdee4_stv0297_tuner_set_params; 719 fc->fe->ops.tuner_ops.set_params = alps_tdee4_stv0297_tuner_set_params;
699 return 1; 720 return 1;
700} 721}
722#else
723#define cablestar2_attach NULL
701#endif 724#endif
702 725
703static struct { 726static struct {
704 flexcop_device_type_t type; 727 flexcop_device_type_t type;
705 int (*attach)(struct flexcop_device *, struct i2c_adapter *); 728 int (*attach)(struct flexcop_device *, struct i2c_adapter *);
706} flexcop_frontends[] = { 729} flexcop_frontends[] = {
707#if defined(CONFIG_DVB_S5H1420_MODULE)
708 { FC_SKY_REV27, skystar2_rev27_attach }, 730 { FC_SKY_REV27, skystar2_rev27_attach },
709#endif
710#if defined(CONFIG_DVB_CX24123_MODULE)
711 { FC_SKY_REV28, skystar2_rev28_attach }, 731 { FC_SKY_REV28, skystar2_rev28_attach },
712#endif
713#if defined(CONFIG_DVB_STV0299_MODULE)
714 { FC_SKY_REV26, skystar2_rev26_attach }, 732 { FC_SKY_REV26, skystar2_rev26_attach },
715#endif
716#if defined(CONFIG_DVB_MT352_MODULE)
717 { FC_AIR_DVBT, airstar_dvbt_attach }, 733 { FC_AIR_DVBT, airstar_dvbt_attach },
718#endif
719#if defined(CONFIG_DVB_NXT200X_MODULE)
720 { FC_AIR_ATSC2, airstar_atsc2_attach }, 734 { FC_AIR_ATSC2, airstar_atsc2_attach },
721#endif
722#if defined(CONFIG_DVB_LGDT330X_MODULE)
723 { FC_AIR_ATSC3, airstar_atsc3_attach }, 735 { FC_AIR_ATSC3, airstar_atsc3_attach },
724#endif
725#if defined(CONFIG_DVB_BCM3510_MODULE)
726 { FC_AIR_ATSC1, airstar_atsc1_attach }, 736 { FC_AIR_ATSC1, airstar_atsc1_attach },
727#endif
728#if defined(CONFIG_DVB_STV0297_MODULE)
729 { FC_CABLE, cablestar2_attach }, 737 { FC_CABLE, cablestar2_attach },
730#endif
731#if defined(CONFIG_DVB_MT312_MODULE)
732 { FC_SKY_REV23, skystar2_rev23_attach }, 738 { FC_SKY_REV23, skystar2_rev23_attach },
733#endif
734}; 739};
735 740
736/* try to figure out the frontend */ 741/* try to figure out the frontend */
@@ -738,6 +743,8 @@ int flexcop_frontend_init(struct flexcop_device *fc)
738{ 743{
739 int i; 744 int i;
740 for (i = 0; i < ARRAY_SIZE(flexcop_frontends); i++) { 745 for (i = 0; i < ARRAY_SIZE(flexcop_frontends); i++) {
746 if (!flexcop_frontends[i].attach)
747 continue;
741 /* type needs to be set before, because of some workarounds 748 /* type needs to be set before, because of some workarounds
742 * done based on the probed card type */ 749 * done based on the probed card type */
743 fc->dev_type = flexcop_frontends[i].type; 750 fc->dev_type = flexcop_frontends[i].type;
diff --git a/drivers/media/dvb/bt8xx/dst_ca.c b/drivers/media/dvb/bt8xx/dst_ca.c
index 4601b059b2b2..0e246eaad05a 100644
--- a/drivers/media/dvb/bt8xx/dst_ca.c
+++ b/drivers/media/dvb/bt8xx/dst_ca.c
@@ -21,6 +21,7 @@
21#include <linux/kernel.h> 21#include <linux/kernel.h>
22#include <linux/module.h> 22#include <linux/module.h>
23#include <linux/init.h> 23#include <linux/init.h>
24#include <linux/smp_lock.h>
24#include <linux/string.h> 25#include <linux/string.h>
25#include <linux/dvb/ca.h> 26#include <linux/dvb/ca.h>
26#include "dvbdev.h" 27#include "dvbdev.h"
diff --git a/drivers/media/dvb/dvb-core/dvbdev.h b/drivers/media/dvb/dvb-core/dvbdev.h
index 79927305e84d..487919bea7ae 100644
--- a/drivers/media/dvb/dvb-core/dvbdev.h
+++ b/drivers/media/dvb/dvb-core/dvbdev.h
@@ -27,7 +27,6 @@
27#include <linux/poll.h> 27#include <linux/poll.h>
28#include <linux/fs.h> 28#include <linux/fs.h>
29#include <linux/list.h> 29#include <linux/list.h>
30#include <linux/smp_lock.h>
31 30
32#define DVB_MAJOR 212 31#define DVB_MAJOR 212
33 32
diff --git a/drivers/media/dvb/frontends/af9013.c b/drivers/media/dvb/frontends/af9013.c
index 136c5863d81b..12e018b4107d 100644
--- a/drivers/media/dvb/frontends/af9013.c
+++ b/drivers/media/dvb/frontends/af9013.c
@@ -527,6 +527,10 @@ static int af9013_set_ofdm_params(struct af9013_state *state,
527 u8 i, buf[3] = {0, 0, 0}; 527 u8 i, buf[3] = {0, 0, 0};
528 *auto_mode = 0; /* set if parameters are requested to auto set */ 528 *auto_mode = 0; /* set if parameters are requested to auto set */
529 529
530 /* Try auto-detect transmission parameters in case of AUTO requested or
531 garbage parameters given by application for compatibility.
532 MPlayer seems to provide garbage parameters currently. */
533
530 switch (params->transmission_mode) { 534 switch (params->transmission_mode) {
531 case TRANSMISSION_MODE_AUTO: 535 case TRANSMISSION_MODE_AUTO:
532 *auto_mode = 1; 536 *auto_mode = 1;
@@ -536,7 +540,8 @@ static int af9013_set_ofdm_params(struct af9013_state *state,
536 buf[0] |= (1 << 0); 540 buf[0] |= (1 << 0);
537 break; 541 break;
538 default: 542 default:
539 return -EINVAL; 543 deb_info("%s: invalid transmission_mode\n", __func__);
544 *auto_mode = 1;
540 } 545 }
541 546
542 switch (params->guard_interval) { 547 switch (params->guard_interval) {
@@ -554,7 +559,8 @@ static int af9013_set_ofdm_params(struct af9013_state *state,
554 buf[0] |= (3 << 2); 559 buf[0] |= (3 << 2);
555 break; 560 break;
556 default: 561 default:
557 return -EINVAL; 562 deb_info("%s: invalid guard_interval\n", __func__);
563 *auto_mode = 1;
558 } 564 }
559 565
560 switch (params->hierarchy_information) { 566 switch (params->hierarchy_information) {
@@ -572,7 +578,8 @@ static int af9013_set_ofdm_params(struct af9013_state *state,
572 buf[0] |= (3 << 4); 578 buf[0] |= (3 << 4);
573 break; 579 break;
574 default: 580 default:
575 return -EINVAL; 581 deb_info("%s: invalid hierarchy_information\n", __func__);
582 *auto_mode = 1;
576 }; 583 };
577 584
578 switch (params->constellation) { 585 switch (params->constellation) {
@@ -587,7 +594,8 @@ static int af9013_set_ofdm_params(struct af9013_state *state,
587 buf[1] |= (2 << 6); 594 buf[1] |= (2 << 6);
588 break; 595 break;
589 default: 596 default:
590 return -EINVAL; 597 deb_info("%s: invalid constellation\n", __func__);
598 *auto_mode = 1;
591 } 599 }
592 600
593 /* Use HP. How and which case we can switch to LP? */ 601 /* Use HP. How and which case we can switch to LP? */
@@ -611,7 +619,8 @@ static int af9013_set_ofdm_params(struct af9013_state *state,
611 buf[2] |= (4 << 0); 619 buf[2] |= (4 << 0);
612 break; 620 break;
613 default: 621 default:
614 return -EINVAL; 622 deb_info("%s: invalid code_rate_HP\n", __func__);
623 *auto_mode = 1;
615 } 624 }
616 625
617 switch (params->code_rate_LP) { 626 switch (params->code_rate_LP) {
@@ -638,7 +647,8 @@ static int af9013_set_ofdm_params(struct af9013_state *state,
638 if (params->hierarchy_information == HIERARCHY_AUTO) 647 if (params->hierarchy_information == HIERARCHY_AUTO)
639 break; 648 break;
640 default: 649 default:
641 return -EINVAL; 650 deb_info("%s: invalid code_rate_LP\n", __func__);
651 *auto_mode = 1;
642 } 652 }
643 653
644 switch (params->bandwidth) { 654 switch (params->bandwidth) {
@@ -651,7 +661,8 @@ static int af9013_set_ofdm_params(struct af9013_state *state,
651 buf[1] |= (2 << 2); 661 buf[1] |= (2 << 2);
652 break; 662 break;
653 default: 663 default:
654 return -EINVAL; 664 deb_info("%s: invalid bandwidth\n", __func__);
665 buf[1] |= (2 << 2); /* cannot auto-detect BW, try 8 MHz */
655 } 666 }
656 667
657 /* program */ 668 /* program */
diff --git a/drivers/media/dvb/ttpci/Kconfig b/drivers/media/dvb/ttpci/Kconfig
index 68eb4493f991..d8d4214fd65f 100644
--- a/drivers/media/dvb/ttpci/Kconfig
+++ b/drivers/media/dvb/ttpci/Kconfig
@@ -1,5 +1,6 @@
1config TTPCI_EEPROM 1config TTPCI_EEPROM
2 tristate 2 tristate
3 depends on I2C
3 default n 4 default n
4 5
5config DVB_AV7110 6config DVB_AV7110
diff --git a/drivers/media/dvb/ttpci/av7110.c b/drivers/media/dvb/ttpci/av7110.c
index d1d959ed37b7..8d65c652ba50 100644
--- a/drivers/media/dvb/ttpci/av7110.c
+++ b/drivers/media/dvb/ttpci/av7110.c
@@ -36,7 +36,6 @@
36#include <linux/fs.h> 36#include <linux/fs.h>
37#include <linux/timer.h> 37#include <linux/timer.h>
38#include <linux/poll.h> 38#include <linux/poll.h>
39#include <linux/smp_lock.h>
40 39
41#include <linux/kernel.h> 40#include <linux/kernel.h>
42#include <linux/sched.h> 41#include <linux/sched.h>
diff --git a/drivers/media/radio/radio-mr800.c b/drivers/media/radio/radio-mr800.c
index 837467f93805..575bf9d89419 100644
--- a/drivers/media/radio/radio-mr800.c
+++ b/drivers/media/radio/radio-mr800.c
@@ -58,6 +58,7 @@
58#include <linux/module.h> 58#include <linux/module.h>
59#include <linux/init.h> 59#include <linux/init.h>
60#include <linux/slab.h> 60#include <linux/slab.h>
61#include <linux/smp_lock.h>
61#include <linux/input.h> 62#include <linux/input.h>
62#include <linux/videodev2.h> 63#include <linux/videodev2.h>
63#include <media/v4l2-device.h> 64#include <media/v4l2-device.h>
diff --git a/drivers/media/radio/radio-si470x.c b/drivers/media/radio/radio-si470x.c
index 640421ceb24a..e85f318b4d2b 100644
--- a/drivers/media/radio/radio-si470x.c
+++ b/drivers/media/radio/radio-si470x.c
@@ -127,6 +127,7 @@
127#include <linux/module.h> 127#include <linux/module.h>
128#include <linux/init.h> 128#include <linux/init.h>
129#include <linux/slab.h> 129#include <linux/slab.h>
130#include <linux/smp_lock.h>
130#include <linux/input.h> 131#include <linux/input.h>
131#include <linux/usb.h> 132#include <linux/usb.h>
132#include <linux/hid.h> 133#include <linux/hid.h>
@@ -1200,7 +1201,7 @@ static int si470x_fops_release(struct file *file)
1200 video_unregister_device(radio->videodev); 1201 video_unregister_device(radio->videodev);
1201 kfree(radio->buffer); 1202 kfree(radio->buffer);
1202 kfree(radio); 1203 kfree(radio);
1203 goto done; 1204 goto unlock;
1204 } 1205 }
1205 1206
1206 /* stop rds reception */ 1207 /* stop rds reception */
@@ -1213,9 +1214,8 @@ static int si470x_fops_release(struct file *file)
1213 retval = si470x_stop(radio); 1214 retval = si470x_stop(radio);
1214 usb_autopm_put_interface(radio->intf); 1215 usb_autopm_put_interface(radio->intf);
1215 } 1216 }
1216 1217unlock:
1217 mutex_unlock(&radio->disconnect_lock); 1218 mutex_unlock(&radio->disconnect_lock);
1218
1219done: 1219done:
1220 return retval; 1220 return retval;
1221} 1221}
diff --git a/drivers/media/video/Kconfig b/drivers/media/video/Kconfig
index 061e147f6f26..84b6fc15519d 100644
--- a/drivers/media/video/Kconfig
+++ b/drivers/media/video/Kconfig
@@ -312,6 +312,14 @@ config VIDEO_OV7670
312 OV7670 VGA camera. It currently only works with the M88ALP01 312 OV7670 VGA camera. It currently only works with the M88ALP01
313 controller. 313 controller.
314 314
315config VIDEO_MT9V011
316 tristate "Micron mt9v011 sensor support"
317 depends on I2C && VIDEO_V4L2
318 ---help---
319 This is a Video4Linux2 sensor-level driver for the Micron
320 mt0v011 1.3 Mpixel camera. It currently only works with the
321 em28xx driver.
322
315config VIDEO_TCM825X 323config VIDEO_TCM825X
316 tristate "TCM825x camera sensor support" 324 tristate "TCM825x camera sensor support"
317 depends on I2C && VIDEO_V4L2 325 depends on I2C && VIDEO_V4L2
diff --git a/drivers/media/video/Makefile b/drivers/media/video/Makefile
index 7fb3add1b387..9f2e3214a482 100644
--- a/drivers/media/video/Makefile
+++ b/drivers/media/video/Makefile
@@ -69,6 +69,7 @@ obj-$(CONFIG_VIDEO_UPD64083) += upd64083.o
69obj-$(CONFIG_VIDEO_OV7670) += ov7670.o 69obj-$(CONFIG_VIDEO_OV7670) += ov7670.o
70obj-$(CONFIG_VIDEO_TCM825X) += tcm825x.o 70obj-$(CONFIG_VIDEO_TCM825X) += tcm825x.o
71obj-$(CONFIG_VIDEO_TVEEPROM) += tveeprom.o 71obj-$(CONFIG_VIDEO_TVEEPROM) += tveeprom.o
72obj-$(CONFIG_VIDEO_MT9V011) += mt9v011.o
72 73
73obj-$(CONFIG_SOC_CAMERA_MT9M001) += mt9m001.o 74obj-$(CONFIG_SOC_CAMERA_MT9M001) += mt9m001.o
74obj-$(CONFIG_SOC_CAMERA_MT9M111) += mt9m111.o 75obj-$(CONFIG_SOC_CAMERA_MT9M111) += mt9m111.o
diff --git a/drivers/media/video/bt8xx/bttv-cards.c b/drivers/media/video/bt8xx/bttv-cards.c
index fdb4adff3d28..ca6558c394be 100644
--- a/drivers/media/video/bt8xx/bttv-cards.c
+++ b/drivers/media/video/bt8xx/bttv-cards.c
@@ -3324,8 +3324,6 @@ void __devinit bttv_init_card1(struct bttv *btv)
3324/* initialization part two -- after registering i2c bus */ 3324/* initialization part two -- after registering i2c bus */
3325void __devinit bttv_init_card2(struct bttv *btv) 3325void __devinit bttv_init_card2(struct bttv *btv)
3326{ 3326{
3327 int addr=ADDR_UNSET;
3328
3329 btv->tuner_type = UNSET; 3327 btv->tuner_type = UNSET;
3330 3328
3331 if (BTTV_BOARD_UNKNOWN == btv->c.type) { 3329 if (BTTV_BOARD_UNKNOWN == btv->c.type) {
@@ -3470,9 +3468,6 @@ void __devinit bttv_init_card2(struct bttv *btv)
3470 btv->pll.pll_current = -1; 3468 btv->pll.pll_current = -1;
3471 3469
3472 /* tuner configuration (from card list / autodetect / insmod option) */ 3470 /* tuner configuration (from card list / autodetect / insmod option) */
3473 if (ADDR_UNSET != bttv_tvcards[btv->c.type].tuner_addr)
3474 addr = bttv_tvcards[btv->c.type].tuner_addr;
3475
3476 if (UNSET != bttv_tvcards[btv->c.type].tuner_type) 3471 if (UNSET != bttv_tvcards[btv->c.type].tuner_type)
3477 if (UNSET == btv->tuner_type) 3472 if (UNSET == btv->tuner_type)
3478 btv->tuner_type = bttv_tvcards[btv->c.type].tuner_type; 3473 btv->tuner_type = bttv_tvcards[btv->c.type].tuner_type;
@@ -3496,40 +3491,6 @@ void __devinit bttv_init_card2(struct bttv *btv)
3496 if (UNSET == btv->tuner_type) 3491 if (UNSET == btv->tuner_type)
3497 btv->tuner_type = TUNER_ABSENT; 3492 btv->tuner_type = TUNER_ABSENT;
3498 3493
3499 if (btv->tuner_type != TUNER_ABSENT) {
3500 struct tuner_setup tun_setup;
3501
3502 /* Load tuner module before issuing tuner config call! */
3503 if (bttv_tvcards[btv->c.type].has_radio)
3504 v4l2_i2c_new_probed_subdev(&btv->c.v4l2_dev,
3505 &btv->c.i2c_adap, "tuner", "tuner",
3506 v4l2_i2c_tuner_addrs(ADDRS_RADIO));
3507 v4l2_i2c_new_probed_subdev(&btv->c.v4l2_dev,
3508 &btv->c.i2c_adap, "tuner", "tuner",
3509 v4l2_i2c_tuner_addrs(ADDRS_DEMOD));
3510 v4l2_i2c_new_probed_subdev(&btv->c.v4l2_dev,
3511 &btv->c.i2c_adap, "tuner", "tuner",
3512 v4l2_i2c_tuner_addrs(ADDRS_TV_WITH_DEMOD));
3513
3514 tun_setup.mode_mask = T_ANALOG_TV | T_DIGITAL_TV;
3515 tun_setup.type = btv->tuner_type;
3516 tun_setup.addr = addr;
3517
3518 if (bttv_tvcards[btv->c.type].has_radio)
3519 tun_setup.mode_mask |= T_RADIO;
3520
3521 bttv_call_all(btv, tuner, s_type_addr, &tun_setup);
3522 }
3523
3524 if (btv->tda9887_conf) {
3525 struct v4l2_priv_tun_config tda9887_cfg;
3526
3527 tda9887_cfg.tuner = TUNER_TDA9887;
3528 tda9887_cfg.priv = &btv->tda9887_conf;
3529
3530 bttv_call_all(btv, tuner, s_config, &tda9887_cfg);
3531 }
3532
3533 btv->dig = bttv_tvcards[btv->c.type].has_dig_in ? 3494 btv->dig = bttv_tvcards[btv->c.type].has_dig_in ?
3534 bttv_tvcards[btv->c.type].video_inputs - 1 : UNSET; 3495 bttv_tvcards[btv->c.type].video_inputs - 1 : UNSET;
3535 btv->svhs = bttv_tvcards[btv->c.type].svhs == NO_SVHS ? 3496 btv->svhs = bttv_tvcards[btv->c.type].svhs == NO_SVHS ?
@@ -3540,15 +3501,15 @@ void __devinit bttv_init_card2(struct bttv *btv)
3540 btv->has_remote = remote[btv->c.nr]; 3501 btv->has_remote = remote[btv->c.nr];
3541 3502
3542 if (bttv_tvcards[btv->c.type].has_radio) 3503 if (bttv_tvcards[btv->c.type].has_radio)
3543 btv->has_radio=1; 3504 btv->has_radio = 1;
3544 if (bttv_tvcards[btv->c.type].has_remote) 3505 if (bttv_tvcards[btv->c.type].has_remote)
3545 btv->has_remote=1; 3506 btv->has_remote = 1;
3546 if (!bttv_tvcards[btv->c.type].no_gpioirq) 3507 if (!bttv_tvcards[btv->c.type].no_gpioirq)
3547 btv->gpioirq=1; 3508 btv->gpioirq = 1;
3548 if (bttv_tvcards[btv->c.type].volume_gpio) 3509 if (bttv_tvcards[btv->c.type].volume_gpio)
3549 btv->volume_gpio=bttv_tvcards[btv->c.type].volume_gpio; 3510 btv->volume_gpio = bttv_tvcards[btv->c.type].volume_gpio;
3550 if (bttv_tvcards[btv->c.type].audio_mode_gpio) 3511 if (bttv_tvcards[btv->c.type].audio_mode_gpio)
3551 btv->audio_mode_gpio=bttv_tvcards[btv->c.type].audio_mode_gpio; 3512 btv->audio_mode_gpio = bttv_tvcards[btv->c.type].audio_mode_gpio;
3552 3513
3553 if (btv->tuner_type == TUNER_ABSENT) 3514 if (btv->tuner_type == TUNER_ABSENT)
3554 return; /* no tuner or related drivers to load */ 3515 return; /* no tuner or related drivers to load */
@@ -3666,6 +3627,49 @@ no_audio:
3666} 3627}
3667 3628
3668 3629
3630/* initialize the tuner */
3631void __devinit bttv_init_tuner(struct bttv *btv)
3632{
3633 int addr = ADDR_UNSET;
3634
3635 if (ADDR_UNSET != bttv_tvcards[btv->c.type].tuner_addr)
3636 addr = bttv_tvcards[btv->c.type].tuner_addr;
3637
3638 if (btv->tuner_type != TUNER_ABSENT) {
3639 struct tuner_setup tun_setup;
3640
3641 /* Load tuner module before issuing tuner config call! */
3642 if (bttv_tvcards[btv->c.type].has_radio)
3643 v4l2_i2c_new_probed_subdev(&btv->c.v4l2_dev,
3644 &btv->c.i2c_adap, "tuner", "tuner",
3645 v4l2_i2c_tuner_addrs(ADDRS_RADIO));
3646 v4l2_i2c_new_probed_subdev(&btv->c.v4l2_dev,
3647 &btv->c.i2c_adap, "tuner", "tuner",
3648 v4l2_i2c_tuner_addrs(ADDRS_DEMOD));
3649 v4l2_i2c_new_probed_subdev(&btv->c.v4l2_dev,
3650 &btv->c.i2c_adap, "tuner", "tuner",
3651 v4l2_i2c_tuner_addrs(ADDRS_TV_WITH_DEMOD));
3652
3653 tun_setup.mode_mask = T_ANALOG_TV | T_DIGITAL_TV;
3654 tun_setup.type = btv->tuner_type;
3655 tun_setup.addr = addr;
3656
3657 if (bttv_tvcards[btv->c.type].has_radio)
3658 tun_setup.mode_mask |= T_RADIO;
3659
3660 bttv_call_all(btv, tuner, s_type_addr, &tun_setup);
3661 }
3662
3663 if (btv->tda9887_conf) {
3664 struct v4l2_priv_tun_config tda9887_cfg;
3665
3666 tda9887_cfg.tuner = TUNER_TDA9887;
3667 tda9887_cfg.priv = &btv->tda9887_conf;
3668
3669 bttv_call_all(btv, tuner, s_config, &tda9887_cfg);
3670 }
3671}
3672
3669/* ----------------------------------------------------------------------- */ 3673/* ----------------------------------------------------------------------- */
3670 3674
3671static void modtec_eeprom(struct bttv *btv) 3675static void modtec_eeprom(struct bttv *btv)
diff --git a/drivers/media/video/bt8xx/bttv-driver.c b/drivers/media/video/bt8xx/bttv-driver.c
index 5eb1464af670..8cc6dd28d6a7 100644
--- a/drivers/media/video/bt8xx/bttv-driver.c
+++ b/drivers/media/video/bt8xx/bttv-driver.c
@@ -41,6 +41,7 @@
41#include <linux/fs.h> 41#include <linux/fs.h>
42#include <linux/kernel.h> 42#include <linux/kernel.h>
43#include <linux/sched.h> 43#include <linux/sched.h>
44#include <linux/smp_lock.h>
44#include <linux/interrupt.h> 45#include <linux/interrupt.h>
45#include <linux/kdev_t.h> 46#include <linux/kdev_t.h>
46#include "bttvp.h" 47#include "bttvp.h"
@@ -4418,6 +4419,7 @@ static int __devinit bttv_probe(struct pci_dev *dev,
4418 4419
4419 /* some card-specific stuff (needs working i2c) */ 4420 /* some card-specific stuff (needs working i2c) */
4420 bttv_init_card2(btv); 4421 bttv_init_card2(btv);
4422 bttv_init_tuner(btv);
4421 init_irqreg(btv); 4423 init_irqreg(btv);
4422 4424
4423 /* register video4linux + input */ 4425 /* register video4linux + input */
diff --git a/drivers/media/video/bt8xx/bttv.h b/drivers/media/video/bt8xx/bttv.h
index 3d36daf206f3..3ec2402c6b4a 100644
--- a/drivers/media/video/bt8xx/bttv.h
+++ b/drivers/media/video/bt8xx/bttv.h
@@ -283,6 +283,7 @@ extern struct tvcard bttv_tvcards[];
283extern void bttv_idcard(struct bttv *btv); 283extern void bttv_idcard(struct bttv *btv);
284extern void bttv_init_card1(struct bttv *btv); 284extern void bttv_init_card1(struct bttv *btv);
285extern void bttv_init_card2(struct bttv *btv); 285extern void bttv_init_card2(struct bttv *btv);
286extern void bttv_init_tuner(struct bttv *btv);
286 287
287/* card-specific funtions */ 288/* card-specific funtions */
288extern void tea5757_set_freq(struct bttv *btv, unsigned short freq); 289extern void tea5757_set_freq(struct bttv *btv, unsigned short freq);
diff --git a/drivers/media/video/cx18/cx18-cards.c b/drivers/media/video/cx18/cx18-cards.c
index c92a25036f0e..36f2d76006fd 100644
--- a/drivers/media/video/cx18/cx18-cards.c
+++ b/drivers/media/video/cx18/cx18-cards.c
@@ -198,11 +198,14 @@ static const struct cx18_card_pci_info cx18_pci_mpc718[] = {
198 198
199static const struct cx18_card cx18_card_mpc718 = { 199static const struct cx18_card cx18_card_mpc718 = {
200 .type = CX18_CARD_YUAN_MPC718, 200 .type = CX18_CARD_YUAN_MPC718,
201 .name = "Yuan MPC718", 201 .name = "Yuan MPC718 MiniPCI DVB-T/Analog",
202 .comment = "Analog video capture works; some audio line in may not.\n", 202 .comment = "Experimenters needed for device to work well.\n"
203 "\tTo help, mail the ivtv-devel list (www.ivtvdriver.org).\n",
203 .v4l2_capabilities = CX18_CAP_ENCODER, 204 .v4l2_capabilities = CX18_CAP_ENCODER,
204 .hw_audio_ctrl = CX18_HW_418_AV, 205 .hw_audio_ctrl = CX18_HW_418_AV,
205 .hw_all = CX18_HW_418_AV | CX18_HW_TUNER | CX18_HW_GPIO_RESET_CTRL, 206 .hw_muxer = CX18_HW_GPIO_MUX,
207 .hw_all = CX18_HW_418_AV | CX18_HW_TUNER |
208 CX18_HW_GPIO_MUX | CX18_HW_DVB | CX18_HW_GPIO_RESET_CTRL,
206 .video_inputs = { 209 .video_inputs = {
207 { CX18_CARD_INPUT_VID_TUNER, 0, CX18_AV_COMPOSITE2 }, 210 { CX18_CARD_INPUT_VID_TUNER, 0, CX18_AV_COMPOSITE2 },
208 { CX18_CARD_INPUT_SVIDEO1, 1, 211 { CX18_CARD_INPUT_SVIDEO1, 1,
@@ -211,27 +214,34 @@ static const struct cx18_card cx18_card_mpc718 = {
211 { CX18_CARD_INPUT_SVIDEO2, 2, 214 { CX18_CARD_INPUT_SVIDEO2, 2,
212 CX18_AV_SVIDEO_LUMA7 | CX18_AV_SVIDEO_CHROMA8 }, 215 CX18_AV_SVIDEO_LUMA7 | CX18_AV_SVIDEO_CHROMA8 },
213 { CX18_CARD_INPUT_COMPOSITE2, 2, CX18_AV_COMPOSITE6 }, 216 { CX18_CARD_INPUT_COMPOSITE2, 2, CX18_AV_COMPOSITE6 },
214 { CX18_CARD_INPUT_COMPOSITE3, 2, CX18_AV_COMPOSITE3 },
215 }, 217 },
216 .audio_inputs = { 218 .audio_inputs = {
217 { CX18_CARD_INPUT_AUD_TUNER, CX18_AV_AUDIO5, 0 }, 219 { CX18_CARD_INPUT_AUD_TUNER, CX18_AV_AUDIO5, 0 },
218 { CX18_CARD_INPUT_LINE_IN1, CX18_AV_AUDIO_SERIAL1, 0 }, 220 { CX18_CARD_INPUT_LINE_IN1, CX18_AV_AUDIO_SERIAL1, 1 },
219 { CX18_CARD_INPUT_LINE_IN2, CX18_AV_AUDIO_SERIAL1, 0 }, 221 { CX18_CARD_INPUT_LINE_IN2, CX18_AV_AUDIO_SERIAL2, 1 },
220 }, 222 },
221 .radio_input = { CX18_CARD_INPUT_AUD_TUNER, CX18_AV_AUDIO_SERIAL1, 0 },
222 .tuners = { 223 .tuners = {
223 /* XC3028 tuner */ 224 /* XC3028 tuner */
224 { .std = V4L2_STD_ALL, .tuner = TUNER_XC2028 }, 225 { .std = V4L2_STD_ALL, .tuner = TUNER_XC2028 },
225 }, 226 },
227 /* FIXME - the FM radio is just a guess and driver doesn't use SIF */
228 .radio_input = { CX18_CARD_INPUT_AUD_TUNER, CX18_AV_AUDIO5, 2 },
226 .ddr = { 229 .ddr = {
227 /* Probably Samsung K4D263238G-VC33 memory */ 230 /* Hynix HY5DU283222B DDR RAM */
228 .chip_config = 0x003, 231 .chip_config = 0x303,
229 .refresh = 0x30c, 232 .refresh = 0x3bd,
230 .timing1 = 0x23230b73, 233 .timing1 = 0x36320966,
231 .timing2 = 0x08, 234 .timing2 = 0x1f,
232 .tune_lane = 0, 235 .tune_lane = 0,
233 .initial_emrs = 2, 236 .initial_emrs = 2,
234 }, 237 },
238 .gpio_init.initial_value = 0x1,
239 .gpio_init.direction = 0x3,
240 /* FIXME - these GPIO's are just guesses */
241 .gpio_audio_input = { .mask = 0x3,
242 .tuner = 0x1,
243 .linein = 0x3,
244 .radio = 0x1 },
235 .xceive_pin = 0, 245 .xceive_pin = 0,
236 .pci_list = cx18_pci_mpc718, 246 .pci_list = cx18_pci_mpc718,
237 .i2c = &cx18_i2c_std, 247 .i2c = &cx18_i2c_std,
diff --git a/drivers/media/video/cx18/cx18-dvb.c b/drivers/media/video/cx18/cx18-dvb.c
index 6ea3fe623ef4..51a0c33b25b7 100644
--- a/drivers/media/video/cx18/cx18-dvb.c
+++ b/drivers/media/video/cx18/cx18-dvb.c
@@ -30,6 +30,10 @@
30#include "s5h1409.h" 30#include "s5h1409.h"
31#include "mxl5005s.h" 31#include "mxl5005s.h"
32#include "zl10353.h" 32#include "zl10353.h"
33
34#include <linux/firmware.h>
35#include "mt352.h"
36#include "mt352_priv.h"
33#include "tuner-xc2028.h" 37#include "tuner-xc2028.h"
34 38
35DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr); 39DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr);
@@ -38,6 +42,11 @@ DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr);
38#define CX18_CLOCK_ENABLE2 0xc71024 42#define CX18_CLOCK_ENABLE2 0xc71024
39#define CX18_DMUX_CLK_MASK 0x0080 43#define CX18_DMUX_CLK_MASK 0x0080
40 44
45/*
46 * CX18_CARD_HVR_1600_ESMT
47 * CX18_CARD_HVR_1600_SAMSUNG
48 */
49
41static struct mxl5005s_config hauppauge_hvr1600_tuner = { 50static struct mxl5005s_config hauppauge_hvr1600_tuner = {
42 .i2c_address = 0xC6 >> 1, 51 .i2c_address = 0xC6 >> 1,
43 .if_freq = IF_FREQ_5380000HZ, 52 .if_freq = IF_FREQ_5380000HZ,
@@ -65,6 +74,9 @@ static struct s5h1409_config hauppauge_hvr1600_config = {
65 .mpeg_timing = S5H1409_MPEGTIMING_CONTINOUS_NONINVERTING_CLOCK 74 .mpeg_timing = S5H1409_MPEGTIMING_CONTINOUS_NONINVERTING_CLOCK
66}; 75};
67 76
77/*
78 * CX18_CARD_LEADTEK_DVR3100H
79 */
68/* Information/confirmation of proper config values provided by Terry Wu */ 80/* Information/confirmation of proper config values provided by Terry Wu */
69static struct zl10353_config leadtek_dvr3100h_demod = { 81static struct zl10353_config leadtek_dvr3100h_demod = {
70 .demod_address = 0x1e >> 1, /* Datasheet suggested straps */ 82 .demod_address = 0x1e >> 1, /* Datasheet suggested straps */
@@ -74,6 +86,121 @@ static struct zl10353_config leadtek_dvr3100h_demod = {
74 .disable_i2c_gate_ctrl = 1, /* Disable the I2C gate */ 86 .disable_i2c_gate_ctrl = 1, /* Disable the I2C gate */
75}; 87};
76 88
89/*
90 * CX18_CARD_YUAN_MPC718
91 */
92/*
93 * Due to
94 *
95 * 1. an absence of information on how to prgram the MT352
96 * 2. the Linux mt352 module pushing MT352 initialzation off onto us here
97 *
98 * We have to use an init sequence that *you* must extract from the Windows
99 * driver (yuanrap.sys) and which we load as a firmware.
100 *
101 * If someone can provide me with a Zarlink MT352 (Intel CE6352?) Design Manual
102 * with chip programming details, then I can remove this annoyance.
103 */
104static int yuan_mpc718_mt352_reqfw(struct cx18_stream *stream,
105 const struct firmware **fw)
106{
107 struct cx18 *cx = stream->cx;
108 const char *fn = "dvb-cx18-mpc718-mt352.fw";
109 int ret;
110
111 ret = request_firmware(fw, fn, &cx->pci_dev->dev);
112 if (ret)
113 CX18_ERR("Unable to open firmware file %s\n", fn);
114 else {
115 size_t sz = (*fw)->size;
116 if (sz < 2 || sz > 64 || (sz % 2) != 0) {
117 CX18_ERR("Firmware %s has a bad size: %lu bytes\n",
118 fn, (unsigned long) sz);
119 ret = -EILSEQ;
120 release_firmware(*fw);
121 *fw = NULL;
122 }
123 }
124
125 if (ret) {
126 CX18_ERR("The MPC718 board variant with the MT352 DVB-T"
127 "demodualtor will not work without it\n");
128 CX18_ERR("Run 'linux/Documentation/dvb/get_dvb_firmware "
129 "mpc718' if you need the firmware\n");
130 }
131 return ret;
132}
133
134static int yuan_mpc718_mt352_init(struct dvb_frontend *fe)
135{
136 struct cx18_dvb *dvb = container_of(fe->dvb,
137 struct cx18_dvb, dvb_adapter);
138 struct cx18_stream *stream = container_of(dvb, struct cx18_stream, dvb);
139 const struct firmware *fw = NULL;
140 int ret;
141 int i;
142 u8 buf[3];
143
144 ret = yuan_mpc718_mt352_reqfw(stream, &fw);
145 if (ret)
146 return ret;
147
148 /* Loop through all the register-value pairs in the firmware file */
149 for (i = 0; i < fw->size; i += 2) {
150 buf[0] = fw->data[i];
151 /* Intercept a few registers we want to set ourselves */
152 switch (buf[0]) {
153 case TRL_NOMINAL_RATE_0:
154 /* Set our custom OFDM bandwidth in the case below */
155 break;
156 case TRL_NOMINAL_RATE_1:
157 /* 6 MHz: 64/7 * 6/8 / 20.48 * 2^16 = 0x55b6.db6 */
158 /* 7 MHz: 64/7 * 7/8 / 20.48 * 2^16 = 0x6400 */
159 /* 8 MHz: 64/7 * 8/8 / 20.48 * 2^16 = 0x7249.249 */
160 buf[1] = 0x72;
161 buf[2] = 0x49;
162 mt352_write(fe, buf, 3);
163 break;
164 case INPUT_FREQ_0:
165 /* Set our custom IF in the case below */
166 break;
167 case INPUT_FREQ_1:
168 /* 4.56 MHz IF: (20.48 - 4.56)/20.48 * 2^14 = 0x31c0 */
169 buf[1] = 0x31;
170 buf[2] = 0xc0;
171 mt352_write(fe, buf, 3);
172 break;
173 default:
174 /* Pass through the register-value pair from the fw */
175 buf[1] = fw->data[i+1];
176 mt352_write(fe, buf, 2);
177 break;
178 }
179 }
180
181 buf[0] = (u8) TUNER_GO;
182 buf[1] = 0x01; /* Go */
183 mt352_write(fe, buf, 2);
184 release_firmware(fw);
185 return 0;
186}
187
188static struct mt352_config yuan_mpc718_mt352_demod = {
189 .demod_address = 0x1e >> 1,
190 .adc_clock = 20480, /* 20.480 MHz */
191 .if2 = 4560, /* 4.560 MHz */
192 .no_tuner = 1, /* XC3028 is not behind the gate */
193 .demod_init = yuan_mpc718_mt352_init,
194};
195
196static struct zl10353_config yuan_mpc718_zl10353_demod = {
197 .demod_address = 0x1e >> 1, /* Datasheet suggested straps */
198 .if2 = 45600, /* 4.560 MHz IF from the XC3028 */
199 .parallel_ts = 1, /* Not a serial TS */
200 .no_tuner = 1, /* XC3028 is not behind the gate */
201 .disable_i2c_gate_ctrl = 1, /* Disable the I2C gate */
202};
203
77static int dvb_register(struct cx18_stream *stream); 204static int dvb_register(struct cx18_stream *stream);
78 205
79/* Kernel DVB framework calls this when the feed needs to start. 206/* Kernel DVB framework calls this when the feed needs to start.
@@ -113,6 +240,7 @@ static int cx18_dvb_start_feed(struct dvb_demux_feed *feed)
113 break; 240 break;
114 241
115 case CX18_CARD_LEADTEK_DVR3100H: 242 case CX18_CARD_LEADTEK_DVR3100H:
243 case CX18_CARD_YUAN_MPC718:
116 default: 244 default:
117 /* Assumption - Parallel transport - Signalling 245 /* Assumption - Parallel transport - Signalling
118 * undefined or default. 246 * undefined or default.
@@ -326,6 +454,38 @@ static int dvb_register(struct cx18_stream *stream)
326 fe->ops.tuner_ops.set_config(fe, &ctrl); 454 fe->ops.tuner_ops.set_config(fe, &ctrl);
327 } 455 }
328 break; 456 break;
457 case CX18_CARD_YUAN_MPC718:
458 /*
459 * TODO
460 * Apparently, these cards also could instead have a
461 * DiBcom demod supported by one of the db7000 drivers
462 */
463 dvb->fe = dvb_attach(mt352_attach,
464 &yuan_mpc718_mt352_demod,
465 &cx->i2c_adap[1]);
466 if (dvb->fe == NULL)
467 dvb->fe = dvb_attach(zl10353_attach,
468 &yuan_mpc718_zl10353_demod,
469 &cx->i2c_adap[1]);
470 if (dvb->fe != NULL) {
471 struct dvb_frontend *fe;
472 struct xc2028_config cfg = {
473 .i2c_adap = &cx->i2c_adap[1],
474 .i2c_addr = 0xc2 >> 1,
475 .ctrl = NULL,
476 };
477 static struct xc2028_ctrl ctrl = {
478 .fname = XC2028_DEFAULT_FIRMWARE,
479 .max_len = 64,
480 .demod = XC3028_FE_ZARLINK456,
481 .type = XC2028_AUTO,
482 };
483
484 fe = dvb_attach(xc2028_attach, dvb->fe, &cfg);
485 if (fe != NULL && fe->ops.tuner_ops.set_config != NULL)
486 fe->ops.tuner_ops.set_config(fe, &ctrl);
487 }
488 break;
329 default: 489 default:
330 /* No Digital Tv Support */ 490 /* No Digital Tv Support */
331 break; 491 break;
diff --git a/drivers/media/video/cx23885/cx23885-417.c b/drivers/media/video/cx23885/cx23885-417.c
index 2943bfd32a94..e0cf21e0b1bf 100644
--- a/drivers/media/video/cx23885/cx23885-417.c
+++ b/drivers/media/video/cx23885/cx23885-417.c
@@ -31,6 +31,7 @@
31#include <linux/delay.h> 31#include <linux/delay.h>
32#include <linux/device.h> 32#include <linux/device.h>
33#include <linux/firmware.h> 33#include <linux/firmware.h>
34#include <linux/smp_lock.h>
34#include <media/v4l2-common.h> 35#include <media/v4l2-common.h>
35#include <media/v4l2-ioctl.h> 36#include <media/v4l2-ioctl.h>
36#include <media/cx2341x.h> 37#include <media/cx2341x.h>
@@ -57,7 +58,8 @@ MODULE_PARM_DESC(v4l_debug, "enable V4L debug messages");
57 58
58#define dprintk(level, fmt, arg...)\ 59#define dprintk(level, fmt, arg...)\
59 do { if (v4l_debug >= level) \ 60 do { if (v4l_debug >= level) \
60 printk(KERN_DEBUG "%s: " fmt, dev->name , ## arg);\ 61 printk(KERN_DEBUG "%s: " fmt, \
62 (dev) ? dev->name : "cx23885[?]", ## arg); \
61 } while (0) 63 } while (0)
62 64
63static struct cx23885_tvnorm cx23885_tvnorms[] = { 65static struct cx23885_tvnorm cx23885_tvnorms[] = {
@@ -1676,6 +1678,7 @@ static struct v4l2_file_operations mpeg_fops = {
1676 .read = mpeg_read, 1678 .read = mpeg_read,
1677 .poll = mpeg_poll, 1679 .poll = mpeg_poll,
1678 .mmap = mpeg_mmap, 1680 .mmap = mpeg_mmap,
1681 .ioctl = video_ioctl2,
1679}; 1682};
1680 1683
1681static const struct v4l2_ioctl_ops mpeg_ioctl_ops = { 1684static const struct v4l2_ioctl_ops mpeg_ioctl_ops = {
diff --git a/drivers/media/video/cx23885/cx23885-dvb.c b/drivers/media/video/cx23885/cx23885-dvb.c
index 48a975134ac5..86ac529e62be 100644
--- a/drivers/media/video/cx23885/cx23885-dvb.c
+++ b/drivers/media/video/cx23885/cx23885-dvb.c
@@ -463,6 +463,30 @@ static struct xc5000_config mygica_x8506_xc5000_config = {
463 .if_khz = 5380, 463 .if_khz = 5380,
464}; 464};
465 465
466static int cx23885_dvb_set_frontend(struct dvb_frontend *fe,
467 struct dvb_frontend_parameters *param)
468{
469 struct cx23885_tsport *port = fe->dvb->priv;
470 struct cx23885_dev *dev = port->dev;
471
472 switch (dev->board) {
473 case CX23885_BOARD_HAUPPAUGE_HVR1275:
474 switch (param->u.vsb.modulation) {
475 case VSB_8:
476 cx23885_gpio_clear(dev, GPIO_5);
477 break;
478 case QAM_64:
479 case QAM_256:
480 default:
481 cx23885_gpio_set(dev, GPIO_5);
482 break;
483 }
484 break;
485 }
486 return (port->set_frontend_save) ?
487 port->set_frontend_save(fe, param) : -ENODEV;
488}
489
466static int dvb_register(struct cx23885_tsport *port) 490static int dvb_register(struct cx23885_tsport *port)
467{ 491{
468 struct cx23885_dev *dev = port->dev; 492 struct cx23885_dev *dev = port->dev;
@@ -502,6 +526,12 @@ static int dvb_register(struct cx23885_tsport *port)
502 0x60, &dev->i2c_bus[1].i2c_adap, 526 0x60, &dev->i2c_bus[1].i2c_adap,
503 &hauppauge_hvr127x_config); 527 &hauppauge_hvr127x_config);
504 } 528 }
529
530 /* FIXME: temporary hack */
531 /* define bridge override to set_frontend */
532 port->set_frontend_save = fe0->dvb.frontend->ops.set_frontend;
533 fe0->dvb.frontend->ops.set_frontend = cx23885_dvb_set_frontend;
534
505 break; 535 break;
506 case CX23885_BOARD_HAUPPAUGE_HVR1255: 536 case CX23885_BOARD_HAUPPAUGE_HVR1255:
507 i2c_bus = &dev->i2c_bus[0]; 537 i2c_bus = &dev->i2c_bus[0];
diff --git a/drivers/media/video/cx23885/cx23885-video.c b/drivers/media/video/cx23885/cx23885-video.c
index 70836af3ab48..5d6093336300 100644
--- a/drivers/media/video/cx23885/cx23885-video.c
+++ b/drivers/media/video/cx23885/cx23885-video.c
@@ -26,6 +26,7 @@
26#include <linux/kmod.h> 26#include <linux/kmod.h>
27#include <linux/kernel.h> 27#include <linux/kernel.h>
28#include <linux/slab.h> 28#include <linux/slab.h>
29#include <linux/smp_lock.h>
29#include <linux/interrupt.h> 30#include <linux/interrupt.h>
30#include <linux/delay.h> 31#include <linux/delay.h>
31#include <linux/kthread.h> 32#include <linux/kthread.h>
diff --git a/drivers/media/video/cx23885/cx23885.h b/drivers/media/video/cx23885/cx23885.h
index 1a2ac518a3f1..214a55e943b7 100644
--- a/drivers/media/video/cx23885/cx23885.h
+++ b/drivers/media/video/cx23885/cx23885.h
@@ -288,6 +288,10 @@ struct cx23885_tsport {
288 /* Allow a single tsport to have multiple frontends */ 288 /* Allow a single tsport to have multiple frontends */
289 u32 num_frontends; 289 u32 num_frontends;
290 void *port_priv; 290 void *port_priv;
291
292 /* FIXME: temporary hack */
293 int (*set_frontend_save) (struct dvb_frontend *,
294 struct dvb_frontend_parameters *);
291}; 295};
292 296
293struct cx23885_dev { 297struct cx23885_dev {
diff --git a/drivers/media/video/cx88/cx88-blackbird.c b/drivers/media/video/cx88/cx88-blackbird.c
index 44eacfb0d0d6..356d6896da3f 100644
--- a/drivers/media/video/cx88/cx88-blackbird.c
+++ b/drivers/media/video/cx88/cx88-blackbird.c
@@ -32,6 +32,7 @@
32#include <linux/delay.h> 32#include <linux/delay.h>
33#include <linux/device.h> 33#include <linux/device.h>
34#include <linux/firmware.h> 34#include <linux/firmware.h>
35#include <linux/smp_lock.h>
35#include <media/v4l2-common.h> 36#include <media/v4l2-common.h>
36#include <media/v4l2-ioctl.h> 37#include <media/v4l2-ioctl.h>
37#include <media/cx2341x.h> 38#include <media/cx2341x.h>
diff --git a/drivers/media/video/cx88/cx88-video.c b/drivers/media/video/cx88/cx88-video.c
index b12770848c00..2bb54c3ef5cd 100644
--- a/drivers/media/video/cx88/cx88-video.c
+++ b/drivers/media/video/cx88/cx88-video.c
@@ -31,6 +31,7 @@
31#include <linux/kmod.h> 31#include <linux/kmod.h>
32#include <linux/kernel.h> 32#include <linux/kernel.h>
33#include <linux/slab.h> 33#include <linux/slab.h>
34#include <linux/smp_lock.h>
34#include <linux/interrupt.h> 35#include <linux/interrupt.h>
35#include <linux/dma-mapping.h> 36#include <linux/dma-mapping.h>
36#include <linux/delay.h> 37#include <linux/delay.h>
diff --git a/drivers/media/video/dabusb.c b/drivers/media/video/dabusb.c
index ec2f45dde164..0664d111085f 100644
--- a/drivers/media/video/dabusb.c
+++ b/drivers/media/video/dabusb.c
@@ -32,6 +32,7 @@
32#include <linux/list.h> 32#include <linux/list.h>
33#include <linux/vmalloc.h> 33#include <linux/vmalloc.h>
34#include <linux/slab.h> 34#include <linux/slab.h>
35#include <linux/smp_lock.h>
35#include <linux/init.h> 36#include <linux/init.h>
36#include <asm/uaccess.h> 37#include <asm/uaccess.h>
37#include <asm/atomic.h> 38#include <asm/atomic.h>
diff --git a/drivers/media/video/em28xx/Kconfig b/drivers/media/video/em28xx/Kconfig
index 16a5af30e9d1..6524b493e033 100644
--- a/drivers/media/video/em28xx/Kconfig
+++ b/drivers/media/video/em28xx/Kconfig
@@ -8,6 +8,8 @@ config VIDEO_EM28XX
8 select VIDEO_SAA711X if VIDEO_HELPER_CHIPS_AUTO 8 select VIDEO_SAA711X if VIDEO_HELPER_CHIPS_AUTO
9 select VIDEO_TVP5150 if VIDEO_HELPER_CHIPS_AUTO 9 select VIDEO_TVP5150 if VIDEO_HELPER_CHIPS_AUTO
10 select VIDEO_MSP3400 if VIDEO_HELPER_CHIPS_AUTO 10 select VIDEO_MSP3400 if VIDEO_HELPER_CHIPS_AUTO
11 select VIDEO_MT9V011 if VIDEO_HELPER_CHIPS_AUTO
12
11 ---help--- 13 ---help---
12 This is a video4linux driver for Empia 28xx based TV cards. 14 This is a video4linux driver for Empia 28xx based TV cards.
13 15
diff --git a/drivers/media/video/em28xx/em28xx-cards.c b/drivers/media/video/em28xx/em28xx-cards.c
index c43fdb9bc888..320f1f60276e 100644
--- a/drivers/media/video/em28xx/em28xx-cards.c
+++ b/drivers/media/video/em28xx/em28xx-cards.c
@@ -157,6 +157,20 @@ static struct em28xx_reg_seq evga_indtube_digital[] = {
157 { -1, -1, -1, -1}, 157 { -1, -1, -1, -1},
158}; 158};
159 159
160/* Pinnacle Hybrid Pro eb1a:2881 */
161static struct em28xx_reg_seq pinnacle_hybrid_pro_analog[] = {
162 {EM28XX_R08_GPIO, 0xfd, ~EM_GPIO_4, 10},
163 { -1, -1, -1, -1},
164};
165
166static struct em28xx_reg_seq pinnacle_hybrid_pro_digital[] = {
167 {EM28XX_R08_GPIO, 0x6e, ~EM_GPIO_4, 10},
168 {EM2880_R04_GPO, 0x04, 0xff, 100},/* zl10353 reset */
169 {EM2880_R04_GPO, 0x0c, 0xff, 1},
170 { -1, -1, -1, -1},
171};
172
173
160/* Callback for the most boards */ 174/* Callback for the most boards */
161static struct em28xx_reg_seq default_tuner_gpio[] = { 175static struct em28xx_reg_seq default_tuner_gpio[] = {
162 {EM28XX_R08_GPIO, EM_GPIO_4, EM_GPIO_4, 10}, 176 {EM28XX_R08_GPIO, EM_GPIO_4, EM_GPIO_4, 10},
@@ -191,18 +205,27 @@ static struct em28xx_reg_seq terratec_av350_unmute_gpio[] = {
191 {EM28XX_R08_GPIO, 0xff, 0xff, 10}, 205 {EM28XX_R08_GPIO, 0xff, 0xff, 10},
192 { -1, -1, -1, -1}, 206 { -1, -1, -1, -1},
193}; 207};
208
209static struct em28xx_reg_seq silvercrest_reg_seq[] = {
210 {EM28XX_R08_GPIO, 0xff, 0xff, 10},
211 {EM28XX_R08_GPIO, 0x01, 0xf7, 10},
212 { -1, -1, -1, -1},
213};
214
194/* 215/*
195 * Board definitions 216 * Board definitions
196 */ 217 */
197struct em28xx_board em28xx_boards[] = { 218struct em28xx_board em28xx_boards[] = {
198 [EM2750_BOARD_UNKNOWN] = { 219 [EM2750_BOARD_UNKNOWN] = {
199 .name = "Unknown EM2750/EM2751 webcam grabber", 220 .name = "EM2710/EM2750/EM2751 webcam grabber",
200 .xclk = EM28XX_XCLK_FREQUENCY_48MHZ, 221 .xclk = EM28XX_XCLK_FREQUENCY_48MHZ,
201 .tuner_type = TUNER_ABSENT, /* This is a webcam */ 222 .tuner_type = TUNER_ABSENT,
223 .is_webcam = 1,
202 .input = { { 224 .input = { {
203 .type = EM28XX_VMUX_COMPOSITE1, 225 .type = EM28XX_VMUX_COMPOSITE1,
204 .vmux = 0, 226 .vmux = 0,
205 .amux = EM28XX_AMUX_VIDEO, 227 .amux = EM28XX_AMUX_VIDEO,
228 .gpio = silvercrest_reg_seq,
206 } }, 229 } },
207 }, 230 },
208 [EM2800_BOARD_UNKNOWN] = { 231 [EM2800_BOARD_UNKNOWN] = {
@@ -224,13 +247,15 @@ struct em28xx_board em28xx_boards[] = {
224 [EM2820_BOARD_UNKNOWN] = { 247 [EM2820_BOARD_UNKNOWN] = {
225 .name = "Unknown EM2750/28xx video grabber", 248 .name = "Unknown EM2750/28xx video grabber",
226 .tuner_type = TUNER_ABSENT, 249 .tuner_type = TUNER_ABSENT,
250 .is_webcam = 1, /* To enable sensor probe */
227 }, 251 },
228 [EM2750_BOARD_DLCW_130] = { 252 [EM2750_BOARD_DLCW_130] = {
229 /* Beijing Huaqi Information Digital Technology Co., Ltd */ 253 /* Beijing Huaqi Information Digital Technology Co., Ltd */
230 .name = "Huaqi DLCW-130", 254 .name = "Huaqi DLCW-130",
231 .valid = EM28XX_BOARD_NOT_VALIDATED, 255 .valid = EM28XX_BOARD_NOT_VALIDATED,
232 .xclk = EM28XX_XCLK_FREQUENCY_48MHZ, 256 .xclk = EM28XX_XCLK_FREQUENCY_48MHZ,
233 .tuner_type = TUNER_ABSENT, /* This is a webcam */ 257 .tuner_type = TUNER_ABSENT,
258 .is_webcam = 1,
234 .input = { { 259 .input = { {
235 .type = EM28XX_VMUX_COMPOSITE1, 260 .type = EM28XX_VMUX_COMPOSITE1,
236 .vmux = 0, 261 .vmux = 0,
@@ -431,13 +456,25 @@ struct em28xx_board em28xx_boards[] = {
431 [EM2820_BOARD_VIDEOLOGY_20K14XUSB] = { 456 [EM2820_BOARD_VIDEOLOGY_20K14XUSB] = {
432 .name = "Videology 20K14XUSB USB2.0", 457 .name = "Videology 20K14XUSB USB2.0",
433 .valid = EM28XX_BOARD_NOT_VALIDATED, 458 .valid = EM28XX_BOARD_NOT_VALIDATED,
434 .tuner_type = TUNER_ABSENT, /* This is a webcam */ 459 .tuner_type = TUNER_ABSENT,
460 .is_webcam = 1,
435 .input = { { 461 .input = { {
436 .type = EM28XX_VMUX_COMPOSITE1, 462 .type = EM28XX_VMUX_COMPOSITE1,
437 .vmux = 0, 463 .vmux = 0,
438 .amux = EM28XX_AMUX_VIDEO, 464 .amux = EM28XX_AMUX_VIDEO,
439 } }, 465 } },
440 }, 466 },
467 [EM2820_BOARD_SILVERCREST_WEBCAM] = {
468 .name = "Silvercrest Webcam 1.3mpix",
469 .tuner_type = TUNER_ABSENT,
470 .is_webcam = 1,
471 .input = { {
472 .type = EM28XX_VMUX_COMPOSITE1,
473 .vmux = 0,
474 .amux = EM28XX_AMUX_VIDEO,
475 .gpio = silvercrest_reg_seq,
476 } },
477 },
441 [EM2821_BOARD_SUPERCOMP_USB_2] = { 478 [EM2821_BOARD_SUPERCOMP_USB_2] = {
442 .name = "Supercomp USB 2.0 TV", 479 .name = "Supercomp USB 2.0 TV",
443 .valid = EM28XX_BOARD_NOT_VALIDATED, 480 .valid = EM28XX_BOARD_NOT_VALIDATED,
@@ -479,7 +516,8 @@ struct em28xx_board em28xx_boards[] = {
479 /* Beijing Huaqi Information Digital Technology Co., Ltd */ 516 /* Beijing Huaqi Information Digital Technology Co., Ltd */
480 .name = "NetGMBH Cam", 517 .name = "NetGMBH Cam",
481 .valid = EM28XX_BOARD_NOT_VALIDATED, 518 .valid = EM28XX_BOARD_NOT_VALIDATED,
482 .tuner_type = TUNER_ABSENT, /* This is a webcam */ 519 .tuner_type = TUNER_ABSENT,
520 .is_webcam = 1,
483 .input = { { 521 .input = { {
484 .type = EM28XX_VMUX_COMPOSITE1, 522 .type = EM28XX_VMUX_COMPOSITE1,
485 .vmux = 0, 523 .vmux = 0,
@@ -826,7 +864,7 @@ struct em28xx_board em28xx_boards[] = {
826 .tuner_gpio = default_tuner_gpio, 864 .tuner_gpio = default_tuner_gpio,
827 .decoder = EM28XX_TVP5150, 865 .decoder = EM28XX_TVP5150,
828 .has_dvb = 1, 866 .has_dvb = 1,
829 .dvb_gpio = default_analog, 867 .dvb_gpio = default_digital,
830 .input = { { 868 .input = { {
831 .type = EM28XX_VMUX_TELEVISION, 869 .type = EM28XX_VMUX_TELEVISION,
832 .vmux = TVP5150_COMPOSITE0, 870 .vmux = TVP5150_COMPOSITE0,
@@ -1229,25 +1267,26 @@ struct em28xx_board em28xx_boards[] = {
1229 }, 1267 },
1230 [EM2881_BOARD_PINNACLE_HYBRID_PRO] = { 1268 [EM2881_BOARD_PINNACLE_HYBRID_PRO] = {
1231 .name = "Pinnacle Hybrid Pro", 1269 .name = "Pinnacle Hybrid Pro",
1232 .valid = EM28XX_BOARD_NOT_VALIDATED,
1233 .tuner_type = TUNER_XC2028, 1270 .tuner_type = TUNER_XC2028,
1234 .tuner_gpio = default_tuner_gpio, 1271 .tuner_gpio = default_tuner_gpio,
1235 .decoder = EM28XX_TVP5150, 1272 .decoder = EM28XX_TVP5150,
1273 .has_dvb = 1,
1274 .dvb_gpio = pinnacle_hybrid_pro_digital,
1236 .input = { { 1275 .input = { {
1237 .type = EM28XX_VMUX_TELEVISION, 1276 .type = EM28XX_VMUX_TELEVISION,
1238 .vmux = TVP5150_COMPOSITE0, 1277 .vmux = TVP5150_COMPOSITE0,
1239 .amux = EM28XX_AMUX_VIDEO, 1278 .amux = EM28XX_AMUX_VIDEO,
1240 .gpio = default_analog, 1279 .gpio = pinnacle_hybrid_pro_analog,
1241 }, { 1280 }, {
1242 .type = EM28XX_VMUX_COMPOSITE1, 1281 .type = EM28XX_VMUX_COMPOSITE1,
1243 .vmux = TVP5150_COMPOSITE1, 1282 .vmux = TVP5150_COMPOSITE1,
1244 .amux = EM28XX_AMUX_LINE_IN, 1283 .amux = EM28XX_AMUX_LINE_IN,
1245 .gpio = default_analog, 1284 .gpio = pinnacle_hybrid_pro_analog,
1246 }, { 1285 }, {
1247 .type = EM28XX_VMUX_SVIDEO, 1286 .type = EM28XX_VMUX_SVIDEO,
1248 .vmux = TVP5150_SVIDEO, 1287 .vmux = TVP5150_SVIDEO,
1249 .amux = EM28XX_AMUX_LINE_IN, 1288 .amux = EM28XX_AMUX_LINE_IN,
1250 .gpio = default_analog, 1289 .gpio = pinnacle_hybrid_pro_analog,
1251 } }, 1290 } },
1252 }, 1291 },
1253 [EM2882_BOARD_PINNACLE_HYBRID_PRO] = { 1292 [EM2882_BOARD_PINNACLE_HYBRID_PRO] = {
@@ -1617,6 +1656,7 @@ static struct em28xx_hash_table em28xx_eeprom_hash[] = {
1617 {0x966a0441, EM2880_BOARD_KWORLD_DVB_310U, TUNER_XC2028}, 1656 {0x966a0441, EM2880_BOARD_KWORLD_DVB_310U, TUNER_XC2028},
1618 {0x9567eb1a, EM2880_BOARD_EMPIRE_DUAL_TV, TUNER_XC2028}, 1657 {0x9567eb1a, EM2880_BOARD_EMPIRE_DUAL_TV, TUNER_XC2028},
1619 {0xcee44a99, EM2882_BOARD_EVGA_INDTUBE, TUNER_XC2028}, 1658 {0xcee44a99, EM2882_BOARD_EVGA_INDTUBE, TUNER_XC2028},
1659 {0xb8846b20, EM2881_BOARD_PINNACLE_HYBRID_PRO, TUNER_XC2028},
1620}; 1660};
1621 1661
1622/* I2C devicelist hash table for devices with generic USB IDs */ 1662/* I2C devicelist hash table for devices with generic USB IDs */
@@ -1639,6 +1679,11 @@ static unsigned short tvp5150_addrs[] = {
1639 I2C_CLIENT_END 1679 I2C_CLIENT_END
1640}; 1680};
1641 1681
1682static unsigned short mt9v011_addrs[] = {
1683 0xba >> 1,
1684 I2C_CLIENT_END
1685};
1686
1642static unsigned short msp3400_addrs[] = { 1687static unsigned short msp3400_addrs[] = {
1643 0x80 >> 1, 1688 0x80 >> 1,
1644 0x88 >> 1, 1689 0x88 >> 1,
@@ -1678,6 +1723,91 @@ static inline void em28xx_set_model(struct em28xx *dev)
1678 EM28XX_I2C_FREQ_100_KHZ; 1723 EM28XX_I2C_FREQ_100_KHZ;
1679} 1724}
1680 1725
1726/* FIXME: Should be replaced by a proper mt9m001 driver */
1727static int em28xx_initialize_mt9m001(struct em28xx *dev)
1728{
1729 int i;
1730 unsigned char regs[][3] = {
1731 { 0x0d, 0x00, 0x01, },
1732 { 0x0d, 0x00, 0x00, },
1733 { 0x04, 0x05, 0x00, }, /* hres = 1280 */
1734 { 0x03, 0x04, 0x00, }, /* vres = 1024 */
1735 { 0x20, 0x11, 0x00, },
1736 { 0x06, 0x00, 0x10, },
1737 { 0x2b, 0x00, 0x24, },
1738 { 0x2e, 0x00, 0x24, },
1739 { 0x35, 0x00, 0x24, },
1740 { 0x2d, 0x00, 0x20, },
1741 { 0x2c, 0x00, 0x20, },
1742 { 0x09, 0x0a, 0xd4, },
1743 { 0x35, 0x00, 0x57, },
1744 };
1745
1746 for (i = 0; i < ARRAY_SIZE(regs); i++)
1747 i2c_master_send(&dev->i2c_client, &regs[i][0], 3);
1748
1749 return 0;
1750}
1751
1752/* HINT method: webcam I2C chips
1753 *
1754 * This method work for webcams with Micron sensors
1755 */
1756static int em28xx_hint_sensor(struct em28xx *dev)
1757{
1758 int rc;
1759 char *sensor_name;
1760 unsigned char cmd;
1761 __be16 version_be;
1762 u16 version;
1763
1764 dev->i2c_client.addr = 0xba >> 1;
1765 cmd = 0;
1766 i2c_master_send(&dev->i2c_client, &cmd, 1);
1767 rc = i2c_master_recv(&dev->i2c_client, (char *)&version_be, 2);
1768 if (rc != 2)
1769 return -EINVAL;
1770
1771 version = be16_to_cpu(version_be);
1772
1773 switch (version) {
1774 case 0x8243: /* mt9v011 640x480 1.3 Mpix sensor */
1775 dev->model = EM2820_BOARD_SILVERCREST_WEBCAM;
1776 sensor_name = "mt9v011";
1777 dev->em28xx_sensor = EM28XX_MT9V011;
1778 dev->sensor_xres = 640;
1779 dev->sensor_yres = 480;
1780 dev->sensor_xtal = 6300000;
1781
1782 /* probably means GRGB 16 bit bayer */
1783 dev->vinmode = 0x0d;
1784 dev->vinctl = 0x00;
1785
1786 break;
1787 case 0x8431:
1788 dev->model = EM2750_BOARD_UNKNOWN;
1789 sensor_name = "mt9m001";
1790 dev->em28xx_sensor = EM28XX_MT9M001;
1791 em28xx_initialize_mt9m001(dev);
1792 dev->sensor_xres = 1280;
1793 dev->sensor_yres = 1024;
1794
1795 /* probably means BGGR 16 bit bayer */
1796 dev->vinmode = 0x0c;
1797 dev->vinctl = 0x00;
1798
1799 break;
1800 default:
1801 printk("Unknown Micron Sensor 0x%04x\n", be16_to_cpu(version));
1802 return -EINVAL;
1803 }
1804
1805 em28xx_errdev("Sensor is %s, using model %s entry.\n",
1806 sensor_name, em28xx_boards[dev->model].name);
1807
1808 return 0;
1809}
1810
1681/* Since em28xx_pre_card_setup() requires a proper dev->model, 1811/* Since em28xx_pre_card_setup() requires a proper dev->model,
1682 * this won't work for boards with generic PCI IDs 1812 * this won't work for boards with generic PCI IDs
1683 */ 1813 */
@@ -1706,7 +1836,7 @@ void em28xx_pre_card_setup(struct em28xx *dev)
1706 em28xx_info("chip ID is em2750\n"); 1836 em28xx_info("chip ID is em2750\n");
1707 break; 1837 break;
1708 case CHIP_ID_EM2820: 1838 case CHIP_ID_EM2820:
1709 em28xx_info("chip ID is em2820\n"); 1839 em28xx_info("chip ID is em2710 or em2820\n");
1710 break; 1840 break;
1711 case CHIP_ID_EM2840: 1841 case CHIP_ID_EM2840:
1712 em28xx_info("chip ID is em2840\n"); 1842 em28xx_info("chip ID is em2840\n");
@@ -1860,6 +1990,7 @@ static void em28xx_setup_xc3028(struct em28xx *dev, struct xc2028_ctrl *ctl)
1860 ctl->demod = XC3028_FE_ZARLINK456; 1990 ctl->demod = XC3028_FE_ZARLINK456;
1861 break; 1991 break;
1862 case EM2880_BOARD_TERRATEC_HYBRID_XS: 1992 case EM2880_BOARD_TERRATEC_HYBRID_XS:
1993 case EM2881_BOARD_PINNACLE_HYBRID_PRO:
1863 ctl->demod = XC3028_FE_ZARLINK456; 1994 ctl->demod = XC3028_FE_ZARLINK456;
1864 break; 1995 break;
1865 case EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900_R2: 1996 case EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900_R2:
@@ -2156,8 +2287,13 @@ void em28xx_card_setup(struct em28xx *dev)
2156 em28xx_set_mode() in em28xx_pre_card_setup() was a no-op, 2287 em28xx_set_mode() in em28xx_pre_card_setup() was a no-op,
2157 so make the call now so the analog GPIOs are set properly 2288 so make the call now so the analog GPIOs are set properly
2158 before probing the i2c bus. */ 2289 before probing the i2c bus. */
2290 em28xx_gpio_set(dev, dev->board.tuner_gpio);
2159 em28xx_set_mode(dev, EM28XX_ANALOG_MODE); 2291 em28xx_set_mode(dev, EM28XX_ANALOG_MODE);
2160 break; 2292 break;
2293 case EM2820_BOARD_SILVERCREST_WEBCAM:
2294 /* FIXME: need to document the registers bellow */
2295 em28xx_write_reg(dev, 0x0d, 0x42);
2296 em28xx_write_reg(dev, 0x13, 0x08);
2161 } 2297 }
2162 2298
2163 if (dev->board.has_snapshot_button) 2299 if (dev->board.has_snapshot_button)
@@ -2189,6 +2325,15 @@ void em28xx_card_setup(struct em28xx *dev)
2189 v4l2_i2c_new_probed_subdev(&dev->v4l2_dev, &dev->i2c_adap, 2325 v4l2_i2c_new_probed_subdev(&dev->v4l2_dev, &dev->i2c_adap,
2190 "tvp5150", "tvp5150", tvp5150_addrs); 2326 "tvp5150", "tvp5150", tvp5150_addrs);
2191 2327
2328 if (dev->em28xx_sensor == EM28XX_MT9V011) {
2329 struct v4l2_subdev *sd;
2330
2331 sd = v4l2_i2c_new_probed_subdev(&dev->v4l2_dev,
2332 &dev->i2c_adap, "mt9v011", "mt9v011", mt9v011_addrs);
2333 v4l2_subdev_call(sd, core, s_config, 0, &dev->sensor_xtal);
2334 }
2335
2336
2192 if (dev->board.adecoder == EM28XX_TVAUDIO) 2337 if (dev->board.adecoder == EM28XX_TVAUDIO)
2193 v4l2_i2c_new_subdev(&dev->v4l2_dev, &dev->i2c_adap, 2338 v4l2_i2c_new_subdev(&dev->v4l2_dev, &dev->i2c_adap,
2194 "tvaudio", "tvaudio", dev->board.tvaudio_addr); 2339 "tvaudio", "tvaudio", dev->board.tvaudio_addr);
@@ -2333,6 +2478,20 @@ static int em28xx_init_dev(struct em28xx **devhandle, struct usb_device *udev,
2333 return errCode; 2478 return errCode;
2334 } 2479 }
2335 2480
2481 /*
2482 * Default format, used for tvp5150 or saa711x output formats
2483 */
2484 dev->vinmode = 0x10;
2485 dev->vinctl = 0x11;
2486
2487 /*
2488 * If the device can be a webcam, seek for a sensor.
2489 * If sensor is not found, then it isn't a webcam.
2490 */
2491 if (dev->board.is_webcam)
2492 if (em28xx_hint_sensor(dev) < 0)
2493 dev->board.is_webcam = 0;
2494
2336 /* Do board specific init and eeprom reading */ 2495 /* Do board specific init and eeprom reading */
2337 em28xx_card_setup(dev); 2496 em28xx_card_setup(dev);
2338 2497
@@ -2573,6 +2732,7 @@ static int em28xx_usb_probe(struct usb_interface *interface,
2573 retval = em28xx_init_dev(&dev, udev, interface, nr); 2732 retval = em28xx_init_dev(&dev, udev, interface, nr);
2574 if (retval) { 2733 if (retval) {
2575 em28xx_devused &= ~(1<<dev->devno); 2734 em28xx_devused &= ~(1<<dev->devno);
2735 mutex_unlock(&dev->lock);
2576 kfree(dev); 2736 kfree(dev);
2577 goto err; 2737 goto err;
2578 } 2738 }
diff --git a/drivers/media/video/em28xx/em28xx-core.c b/drivers/media/video/em28xx/em28xx-core.c
index c8d7ce8fbd36..5b78e199abd1 100644
--- a/drivers/media/video/em28xx/em28xx-core.c
+++ b/drivers/media/video/em28xx/em28xx-core.c
@@ -650,15 +650,15 @@ int em28xx_set_outfmt(struct em28xx *dev)
650 int ret; 650 int ret;
651 651
652 ret = em28xx_write_reg_bits(dev, EM28XX_R27_OUTFMT, 652 ret = em28xx_write_reg_bits(dev, EM28XX_R27_OUTFMT,
653 dev->format->reg | 0x20, 0x3f); 653 dev->format->reg | 0x20, 0xff);
654 if (ret < 0) 654 if (ret < 0)
655 return ret; 655 return ret;
656 656
657 ret = em28xx_write_reg(dev, EM28XX_R10_VINMODE, 0x10); 657 ret = em28xx_write_reg(dev, EM28XX_R10_VINMODE, dev->vinmode);
658 if (ret < 0) 658 if (ret < 0)
659 return ret; 659 return ret;
660 660
661 return em28xx_write_reg(dev, EM28XX_R11_VINCTRL, 0x11); 661 return em28xx_write_reg(dev, EM28XX_R11_VINCTRL, dev->vinctl);
662} 662}
663 663
664static int em28xx_accumulator_set(struct em28xx *dev, u8 xmin, u8 xmax, 664static int em28xx_accumulator_set(struct em28xx *dev, u8 xmin, u8 xmax,
@@ -695,13 +695,16 @@ static int em28xx_scaler_set(struct em28xx *dev, u16 h, u16 v)
695{ 695{
696 u8 mode; 696 u8 mode;
697 /* the em2800 scaler only supports scaling down to 50% */ 697 /* the em2800 scaler only supports scaling down to 50% */
698 if (dev->board.is_em2800) 698
699 if (dev->board.is_em2800) {
699 mode = (v ? 0x20 : 0x00) | (h ? 0x10 : 0x00); 700 mode = (v ? 0x20 : 0x00) | (h ? 0x10 : 0x00);
700 else { 701 } else {
701 u8 buf[2]; 702 u8 buf[2];
703
702 buf[0] = h; 704 buf[0] = h;
703 buf[1] = h >> 8; 705 buf[1] = h >> 8;
704 em28xx_write_regs(dev, EM28XX_R30_HSCALELOW, (char *)buf, 2); 706 em28xx_write_regs(dev, EM28XX_R30_HSCALELOW, (char *)buf, 2);
707
705 buf[0] = v; 708 buf[0] = v;
706 buf[1] = v >> 8; 709 buf[1] = v >> 8;
707 em28xx_write_regs(dev, EM28XX_R32_VSCALELOW, (char *)buf, 2); 710 em28xx_write_regs(dev, EM28XX_R32_VSCALELOW, (char *)buf, 2);
@@ -720,8 +723,11 @@ int em28xx_resolution_set(struct em28xx *dev)
720 height = norm_maxh(dev) >> 1; 723 height = norm_maxh(dev) >> 1;
721 724
722 em28xx_set_outfmt(dev); 725 em28xx_set_outfmt(dev);
726
727
723 em28xx_accumulator_set(dev, 1, (width - 4) >> 2, 1, (height - 4) >> 2); 728 em28xx_accumulator_set(dev, 1, (width - 4) >> 2, 1, (height - 4) >> 2);
724 em28xx_capture_area_set(dev, 0, 0, width >> 2, height >> 2); 729 em28xx_capture_area_set(dev, 0, 0, width >> 2, height >> 2);
730
725 return em28xx_scaler_set(dev, dev->hscale, dev->vscale); 731 return em28xx_scaler_set(dev, dev->hscale, dev->vscale);
726} 732}
727 733
diff --git a/drivers/media/video/em28xx/em28xx-dvb.c b/drivers/media/video/em28xx/em28xx-dvb.c
index e7b47c8da8f3..cf0ac7f2a30d 100644
--- a/drivers/media/video/em28xx/em28xx-dvb.c
+++ b/drivers/media/video/em28xx/em28xx-dvb.c
@@ -31,6 +31,8 @@
31#include "lgdt330x.h" 31#include "lgdt330x.h"
32#include "zl10353.h" 32#include "zl10353.h"
33#include "s5h1409.h" 33#include "s5h1409.h"
34#include "mt352.h"
35#include "mt352_priv.h" /* FIXME */
34 36
35MODULE_DESCRIPTION("driver for em28xx based DVB cards"); 37MODULE_DESCRIPTION("driver for em28xx based DVB cards");
36MODULE_AUTHOR("Mauro Carvalho Chehab <mchehab@infradead.org>"); 38MODULE_AUTHOR("Mauro Carvalho Chehab <mchehab@infradead.org>");
@@ -243,6 +245,14 @@ static struct s5h1409_config em28xx_s5h1409_with_xc3028 = {
243 .mpeg_timing = S5H1409_MPEGTIMING_CONTINOUS_NONINVERTING_CLOCK 245 .mpeg_timing = S5H1409_MPEGTIMING_CONTINOUS_NONINVERTING_CLOCK
244}; 246};
245 247
248static struct zl10353_config em28xx_zl10353_xc3028_no_i2c_gate = {
249 .demod_address = (0x1e >> 1),
250 .no_tuner = 1,
251 .disable_i2c_gate_ctrl = 1,
252 .parallel_ts = 1,
253 .if2 = 45600,
254};
255
246#ifdef EM28XX_DRX397XD_SUPPORT 256#ifdef EM28XX_DRX397XD_SUPPORT
247/* [TODO] djh - not sure yet what the device config needs to contain */ 257/* [TODO] djh - not sure yet what the device config needs to contain */
248static struct drx397xD_config em28xx_drx397xD_with_xc3028 = { 258static struct drx397xD_config em28xx_drx397xD_with_xc3028 = {
@@ -250,6 +260,41 @@ static struct drx397xD_config em28xx_drx397xD_with_xc3028 = {
250}; 260};
251#endif 261#endif
252 262
263static int mt352_terratec_xs_init(struct dvb_frontend *fe)
264{
265 /* Values extracted from a USB trace of the Terratec Windows driver */
266 static u8 clock_config[] = { CLOCK_CTL, 0x38, 0x2c };
267 static u8 reset[] = { RESET, 0x80 };
268 static u8 adc_ctl_1_cfg[] = { ADC_CTL_1, 0x40 };
269 static u8 agc_cfg[] = { AGC_TARGET, 0x28, 0xa0 };
270 static u8 input_freq_cfg[] = { INPUT_FREQ_1, 0x31, 0xb8 };
271 static u8 rs_err_cfg[] = { RS_ERR_PER_1, 0x00, 0x4d };
272 static u8 capt_range_cfg[] = { CAPT_RANGE, 0x32 };
273 static u8 trl_nom_cfg[] = { TRL_NOMINAL_RATE_1, 0x64, 0x00 };
274 static u8 tps_given_cfg[] = { TPS_GIVEN_1, 0x40, 0x80, 0x50 };
275 static u8 tuner_go[] = { TUNER_GO, 0x01};
276
277 mt352_write(fe, clock_config, sizeof(clock_config));
278 udelay(200);
279 mt352_write(fe, reset, sizeof(reset));
280 mt352_write(fe, adc_ctl_1_cfg, sizeof(adc_ctl_1_cfg));
281 mt352_write(fe, agc_cfg, sizeof(agc_cfg));
282 mt352_write(fe, input_freq_cfg, sizeof(input_freq_cfg));
283 mt352_write(fe, rs_err_cfg, sizeof(rs_err_cfg));
284 mt352_write(fe, capt_range_cfg, sizeof(capt_range_cfg));
285 mt352_write(fe, trl_nom_cfg, sizeof(trl_nom_cfg));
286 mt352_write(fe, tps_given_cfg, sizeof(tps_given_cfg));
287 mt352_write(fe, tuner_go, sizeof(tuner_go));
288 return 0;
289}
290
291static struct mt352_config terratec_xs_mt352_cfg = {
292 .demod_address = (0x1e >> 1),
293 .no_tuner = 1,
294 .if2 = 45600,
295 .demod_init = mt352_terratec_xs_init,
296};
297
253/* ------------------------------------------------------------------ */ 298/* ------------------------------------------------------------------ */
254 299
255static int attach_xc3028(u8 addr, struct em28xx *dev) 300static int attach_xc3028(u8 addr, struct em28xx *dev)
@@ -432,8 +477,6 @@ static int dvb_init(struct em28xx *dev)
432 goto out_free; 477 goto out_free;
433 } 478 }
434 break; 479 break;
435 case EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900:
436 case EM2880_BOARD_TERRATEC_HYBRID_XS:
437 case EM2880_BOARD_KWORLD_DVB_310U: 480 case EM2880_BOARD_KWORLD_DVB_310U:
438 case EM2880_BOARD_EMPIRE_DUAL_TV: 481 case EM2880_BOARD_EMPIRE_DUAL_TV:
439 dvb->frontend = dvb_attach(zl10353_attach, 482 dvb->frontend = dvb_attach(zl10353_attach,
@@ -444,6 +487,33 @@ static int dvb_init(struct em28xx *dev)
444 goto out_free; 487 goto out_free;
445 } 488 }
446 break; 489 break;
490 case EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900:
491 dvb->frontend = dvb_attach(zl10353_attach,
492 &em28xx_zl10353_xc3028_no_i2c_gate,
493 &dev->i2c_adap);
494 if (attach_xc3028(0x61, dev) < 0) {
495 result = -EINVAL;
496 goto out_free;
497 }
498 break;
499 case EM2880_BOARD_TERRATEC_HYBRID_XS:
500 case EM2881_BOARD_PINNACLE_HYBRID_PRO:
501 dvb->frontend = dvb_attach(zl10353_attach,
502 &em28xx_zl10353_xc3028_no_i2c_gate,
503 &dev->i2c_adap);
504 if (dvb->frontend == NULL) {
505 /* This board could have either a zl10353 or a mt352.
506 If the chip id isn't for zl10353, try mt352 */
507 dvb->frontend = dvb_attach(mt352_attach,
508 &terratec_xs_mt352_cfg,
509 &dev->i2c_adap);
510 }
511
512 if (attach_xc3028(0x61, dev) < 0) {
513 result = -EINVAL;
514 goto out_free;
515 }
516 break;
447 case EM2883_BOARD_KWORLD_HYBRID_330U: 517 case EM2883_BOARD_KWORLD_HYBRID_330U:
448 case EM2882_BOARD_EVGA_INDTUBE: 518 case EM2882_BOARD_EVGA_INDTUBE:
449 dvb->frontend = dvb_attach(s5h1409_attach, 519 dvb->frontend = dvb_attach(s5h1409_attach,
diff --git a/drivers/media/video/em28xx/em28xx-i2c.c b/drivers/media/video/em28xx/em28xx-i2c.c
index 2c86fcf089f5..27e33a287dfc 100644
--- a/drivers/media/video/em28xx/em28xx-i2c.c
+++ b/drivers/media/video/em28xx/em28xx-i2c.c
@@ -483,7 +483,7 @@ static char *i2c_devs[128] = {
483 [0xa0 >> 1] = "eeprom", 483 [0xa0 >> 1] = "eeprom",
484 [0xb0 >> 1] = "tda9874", 484 [0xb0 >> 1] = "tda9874",
485 [0xb8 >> 1] = "tvp5150a", 485 [0xb8 >> 1] = "tvp5150a",
486 [0xba >> 1] = "tvp5150a", 486 [0xba >> 1] = "webcam sensor or tvp5150a",
487 [0xc0 >> 1] = "tuner (analog)", 487 [0xc0 >> 1] = "tuner (analog)",
488 [0xc2 >> 1] = "tuner (analog)", 488 [0xc2 >> 1] = "tuner (analog)",
489 [0xc4 >> 1] = "tuner (analog)", 489 [0xc4 >> 1] = "tuner (analog)",
diff --git a/drivers/media/video/em28xx/em28xx-video.c b/drivers/media/video/em28xx/em28xx-video.c
index 8fe1beecfffa..ff37b4c15f44 100644
--- a/drivers/media/video/em28xx/em28xx-video.c
+++ b/drivers/media/video/em28xx/em28xx-video.c
@@ -90,10 +90,35 @@ MODULE_PARM_DESC(video_debug, "enable debug messages [video]");
90/* supported video standards */ 90/* supported video standards */
91static struct em28xx_fmt format[] = { 91static struct em28xx_fmt format[] = {
92 { 92 {
93 .name = "16bpp YUY2, 4:2:2, packed", 93 .name = "16 bpp YUY2, 4:2:2, packed",
94 .fourcc = V4L2_PIX_FMT_YUYV, 94 .fourcc = V4L2_PIX_FMT_YUYV,
95 .depth = 16, 95 .depth = 16,
96 .reg = EM28XX_OUTFMT_YUV422_Y0UY1V, 96 .reg = EM28XX_OUTFMT_YUV422_Y0UY1V,
97 }, {
98 .name = "16 bpp RGB 565, LE",
99 .fourcc = V4L2_PIX_FMT_RGB565,
100 .depth = 16,
101 .reg = EM28XX_OUTFMT_RGB_16_656,
102 }, {
103 .name = "8 bpp Bayer BGBG..GRGR",
104 .fourcc = V4L2_PIX_FMT_SBGGR8,
105 .depth = 8,
106 .reg = EM28XX_OUTFMT_RGB_8_BGBG,
107 }, {
108 .name = "8 bpp Bayer GRGR..BGBG",
109 .fourcc = V4L2_PIX_FMT_SGRBG8,
110 .depth = 8,
111 .reg = EM28XX_OUTFMT_RGB_8_GRGR,
112 }, {
113 .name = "8 bpp Bayer GBGB..RGRG",
114 .fourcc = V4L2_PIX_FMT_SGBRG8,
115 .depth = 8,
116 .reg = EM28XX_OUTFMT_RGB_8_GBGB,
117 }, {
118 .name = "12 bpp YUV411",
119 .fourcc = V4L2_PIX_FMT_YUV411P,
120 .depth = 12,
121 .reg = EM28XX_OUTFMT_YUV411,
97 }, 122 },
98}; 123};
99 124
@@ -632,8 +657,8 @@ static void get_scale(struct em28xx *dev,
632 unsigned int width, unsigned int height, 657 unsigned int width, unsigned int height,
633 unsigned int *hscale, unsigned int *vscale) 658 unsigned int *hscale, unsigned int *vscale)
634{ 659{
635 unsigned int maxw = norm_maxw(dev); 660 unsigned int maxw = norm_maxw(dev);
636 unsigned int maxh = norm_maxh(dev); 661 unsigned int maxh = norm_maxh(dev);
637 662
638 *hscale = (((unsigned long)maxw) << 12) / width - 4096L; 663 *hscale = (((unsigned long)maxw) << 12) / width - 4096L;
639 if (*hscale >= 0x4000) 664 if (*hscale >= 0x4000)
@@ -733,13 +758,34 @@ static int vidioc_try_fmt_vid_cap(struct file *file, void *priv,
733 return 0; 758 return 0;
734} 759}
735 760
761static int em28xx_set_video_format(struct em28xx *dev, unsigned int fourcc,
762 unsigned width, unsigned height)
763{
764 struct em28xx_fmt *fmt;
765
766 fmt = format_by_fourcc(fourcc);
767 if (!fmt)
768 return -EINVAL;
769
770 dev->format = fmt;
771 dev->width = width;
772 dev->height = height;
773
774 /* set new image size */
775 get_scale(dev, dev->width, dev->height, &dev->hscale, &dev->vscale);
776
777 em28xx_set_alternate(dev);
778 em28xx_resolution_set(dev);
779
780 return 0;
781}
782
736static int vidioc_s_fmt_vid_cap(struct file *file, void *priv, 783static int vidioc_s_fmt_vid_cap(struct file *file, void *priv,
737 struct v4l2_format *f) 784 struct v4l2_format *f)
738{ 785{
739 struct em28xx_fh *fh = priv; 786 struct em28xx_fh *fh = priv;
740 struct em28xx *dev = fh->dev; 787 struct em28xx *dev = fh->dev;
741 int rc; 788 int rc;
742 struct em28xx_fmt *fmt;
743 789
744 rc = check_dev(dev); 790 rc = check_dev(dev);
745 if (rc < 0) 791 if (rc < 0)
@@ -749,12 +795,6 @@ static int vidioc_s_fmt_vid_cap(struct file *file, void *priv,
749 795
750 vidioc_try_fmt_vid_cap(file, priv, f); 796 vidioc_try_fmt_vid_cap(file, priv, f);
751 797
752 fmt = format_by_fourcc(f->fmt.pix.pixelformat);
753 if (!fmt) {
754 rc = -EINVAL;
755 goto out;
756 }
757
758 if (videobuf_queue_is_busy(&fh->vb_vidq)) { 798 if (videobuf_queue_is_busy(&fh->vb_vidq)) {
759 em28xx_errdev("%s queue busy\n", __func__); 799 em28xx_errdev("%s queue busy\n", __func__);
760 rc = -EBUSY; 800 rc = -EBUSY;
@@ -767,16 +807,8 @@ static int vidioc_s_fmt_vid_cap(struct file *file, void *priv,
767 goto out; 807 goto out;
768 } 808 }
769 809
770 /* set new image size */ 810 rc = em28xx_set_video_format(dev, f->fmt.pix.pixelformat,
771 dev->width = f->fmt.pix.width; 811 f->fmt.pix.width, f->fmt.pix.height);
772 dev->height = f->fmt.pix.height;
773 dev->format = fmt;
774 get_scale(dev, dev->width, dev->height, &dev->hscale, &dev->vscale);
775
776 em28xx_set_alternate(dev);
777 em28xx_resolution_set(dev);
778
779 rc = 0;
780 812
781out: 813out:
782 mutex_unlock(&dev->lock); 814 mutex_unlock(&dev->lock);
@@ -1616,11 +1648,6 @@ static int em28xx_v4l2_open(struct file *filp)
1616 filp->private_data = fh; 1648 filp->private_data = fh;
1617 1649
1618 if (fh->type == V4L2_BUF_TYPE_VIDEO_CAPTURE && dev->users == 0) { 1650 if (fh->type == V4L2_BUF_TYPE_VIDEO_CAPTURE && dev->users == 0) {
1619 dev->width = norm_maxw(dev);
1620 dev->height = norm_maxh(dev);
1621 dev->hscale = 0;
1622 dev->vscale = 0;
1623
1624 em28xx_set_mode(dev, EM28XX_ANALOG_MODE); 1651 em28xx_set_mode(dev, EM28XX_ANALOG_MODE);
1625 em28xx_set_alternate(dev); 1652 em28xx_set_alternate(dev);
1626 em28xx_resolution_set(dev); 1653 em28xx_resolution_set(dev);
@@ -1962,15 +1989,14 @@ int em28xx_register_analog_devices(struct em28xx *dev)
1962 1989
1963 /* set default norm */ 1990 /* set default norm */
1964 dev->norm = em28xx_video_template.current_norm; 1991 dev->norm = em28xx_video_template.current_norm;
1965 dev->width = norm_maxw(dev);
1966 dev->height = norm_maxh(dev);
1967 dev->interlaced = EM28XX_INTERLACED_DEFAULT; 1992 dev->interlaced = EM28XX_INTERLACED_DEFAULT;
1968 dev->hscale = 0;
1969 dev->vscale = 0;
1970 dev->ctl_input = 0; 1993 dev->ctl_input = 0;
1971 1994
1972 /* Analog specific initialization */ 1995 /* Analog specific initialization */
1973 dev->format = &format[0]; 1996 dev->format = &format[0];
1997 em28xx_set_video_format(dev, format[0].fourcc,
1998 norm_maxw(dev), norm_maxh(dev));
1999
1974 video_mux(dev, dev->ctl_input); 2000 video_mux(dev, dev->ctl_input);
1975 2001
1976 /* Audio defaults */ 2002 /* Audio defaults */
diff --git a/drivers/media/video/em28xx/em28xx.h b/drivers/media/video/em28xx/em28xx.h
index 813ce45c2f99..45bd513f62dc 100644
--- a/drivers/media/video/em28xx/em28xx.h
+++ b/drivers/media/video/em28xx/em28xx.h
@@ -107,6 +107,7 @@
107#define EM2860_BOARD_TERRATEC_AV350 68 107#define EM2860_BOARD_TERRATEC_AV350 68
108#define EM2882_BOARD_KWORLD_ATSC_315U 69 108#define EM2882_BOARD_KWORLD_ATSC_315U 69
109#define EM2882_BOARD_EVGA_INDTUBE 70 109#define EM2882_BOARD_EVGA_INDTUBE 70
110#define EM2820_BOARD_SILVERCREST_WEBCAM 71
110 111
111/* Limits minimum and default number of buffers */ 112/* Limits minimum and default number of buffers */
112#define EM28XX_MIN_BUF 4 113#define EM28XX_MIN_BUF 4
@@ -357,11 +358,17 @@ struct em28xx_input {
357#define INPUT(nr) (&em28xx_boards[dev->model].input[nr]) 358#define INPUT(nr) (&em28xx_boards[dev->model].input[nr])
358 359
359enum em28xx_decoder { 360enum em28xx_decoder {
360 EM28XX_NODECODER, 361 EM28XX_NODECODER = 0,
361 EM28XX_TVP5150, 362 EM28XX_TVP5150,
362 EM28XX_SAA711X, 363 EM28XX_SAA711X,
363}; 364};
364 365
366enum em28xx_sensor {
367 EM28XX_NOSENSOR = 0,
368 EM28XX_MT9V011,
369 EM28XX_MT9M001,
370};
371
365enum em28xx_adecoder { 372enum em28xx_adecoder {
366 EM28XX_NOADECODER = 0, 373 EM28XX_NOADECODER = 0,
367 EM28XX_TVAUDIO, 374 EM28XX_TVAUDIO,
@@ -388,6 +395,7 @@ struct em28xx_board {
388 unsigned int max_range_640_480:1; 395 unsigned int max_range_640_480:1;
389 unsigned int has_dvb:1; 396 unsigned int has_dvb:1;
390 unsigned int has_snapshot_button:1; 397 unsigned int has_snapshot_button:1;
398 unsigned int is_webcam:1;
391 unsigned int valid:1; 399 unsigned int valid:1;
392 400
393 unsigned char xclk, i2c_speed; 401 unsigned char xclk, i2c_speed;
@@ -471,6 +479,14 @@ struct em28xx {
471 struct v4l2_device v4l2_dev; 479 struct v4l2_device v4l2_dev;
472 struct em28xx_board board; 480 struct em28xx_board board;
473 481
482 /* Webcam specific fields */
483 enum em28xx_sensor em28xx_sensor;
484 int sensor_xres, sensor_yres;
485 int sensor_xtal;
486
487 /* Vinmode/Vinctl used at the driver */
488 int vinmode, vinctl;
489
474 unsigned int stream_on:1; /* Locks streams */ 490 unsigned int stream_on:1; /* Locks streams */
475 unsigned int has_audio_class:1; 491 unsigned int has_audio_class:1;
476 unsigned int has_alsa_audio:1; 492 unsigned int has_alsa_audio:1;
@@ -751,17 +767,23 @@ static inline int em28xx_gamma_set(struct em28xx *dev, s32 val)
751/*FIXME: maxw should be dependent of alt mode */ 767/*FIXME: maxw should be dependent of alt mode */
752static inline unsigned int norm_maxw(struct em28xx *dev) 768static inline unsigned int norm_maxw(struct em28xx *dev)
753{ 769{
770 if (dev->board.is_webcam)
771 return dev->sensor_xres;
772
754 if (dev->board.max_range_640_480) 773 if (dev->board.max_range_640_480)
755 return 640; 774 return 640;
756 else 775
757 return 720; 776 return 720;
758} 777}
759 778
760static inline unsigned int norm_maxh(struct em28xx *dev) 779static inline unsigned int norm_maxh(struct em28xx *dev)
761{ 780{
781 if (dev->board.is_webcam)
782 return dev->sensor_yres;
783
762 if (dev->board.max_range_640_480) 784 if (dev->board.max_range_640_480)
763 return 480; 785 return 480;
764 else 786
765 return (dev->norm & V4L2_STD_625_50) ? 576 : 480; 787 return (dev->norm & V4L2_STD_625_50) ? 576 : 480;
766} 788}
767#endif 789#endif
diff --git a/drivers/media/video/gspca/Kconfig b/drivers/media/video/gspca/Kconfig
index 578dc4ffc965..34f46f2bc040 100644
--- a/drivers/media/video/gspca/Kconfig
+++ b/drivers/media/video/gspca/Kconfig
@@ -102,6 +102,22 @@ config USB_GSPCA_PAC7311
102 To compile this driver as a module, choose M here: the 102 To compile this driver as a module, choose M here: the
103 module will be called gspca_pac7311. 103 module will be called gspca_pac7311.
104 104
105config USB_GSPCA_SN9C20X
106 tristate "SN9C20X USB Camera Driver"
107 depends on VIDEO_V4L2 && USB_GSPCA
108 help
109 Say Y here if you want support for cameras based on the
110 sn9c20x chips (SN9C201 and SN9C202).
111
112 To compile this driver as a module, choose M here: the
113 module will be called gspca_sn9c20x.
114
115config USB_GSPCA_SN9C20X_EVDEV
116 bool "Enable evdev support"
117 depends on USB_GSPCA_SN9C20X
118 ---help---
119 Say Y here in order to enable evdev support for sn9c20x webcam button.
120
105config USB_GSPCA_SONIXB 121config USB_GSPCA_SONIXB
106 tristate "SONIX Bayer USB Camera Driver" 122 tristate "SONIX Bayer USB Camera Driver"
107 depends on VIDEO_V4L2 && USB_GSPCA 123 depends on VIDEO_V4L2 && USB_GSPCA
diff --git a/drivers/media/video/gspca/Makefile b/drivers/media/video/gspca/Makefile
index 8a6643e8eb96..f6d3b86e9ad5 100644
--- a/drivers/media/video/gspca/Makefile
+++ b/drivers/media/video/gspca/Makefile
@@ -8,6 +8,7 @@ obj-$(CONFIG_USB_GSPCA_OV519) += gspca_ov519.o
8obj-$(CONFIG_USB_GSPCA_OV534) += gspca_ov534.o 8obj-$(CONFIG_USB_GSPCA_OV534) += gspca_ov534.o
9obj-$(CONFIG_USB_GSPCA_PAC207) += gspca_pac207.o 9obj-$(CONFIG_USB_GSPCA_PAC207) += gspca_pac207.o
10obj-$(CONFIG_USB_GSPCA_PAC7311) += gspca_pac7311.o 10obj-$(CONFIG_USB_GSPCA_PAC7311) += gspca_pac7311.o
11obj-$(CONFIG_USB_GSPCA_SN9C20X) += gspca_sn9c20x.o
11obj-$(CONFIG_USB_GSPCA_SONIXB) += gspca_sonixb.o 12obj-$(CONFIG_USB_GSPCA_SONIXB) += gspca_sonixb.o
12obj-$(CONFIG_USB_GSPCA_SONIXJ) += gspca_sonixj.o 13obj-$(CONFIG_USB_GSPCA_SONIXJ) += gspca_sonixj.o
13obj-$(CONFIG_USB_GSPCA_SPCA500) += gspca_spca500.o 14obj-$(CONFIG_USB_GSPCA_SPCA500) += gspca_spca500.o
@@ -35,6 +36,7 @@ gspca_ov519-objs := ov519.o
35gspca_ov534-objs := ov534.o 36gspca_ov534-objs := ov534.o
36gspca_pac207-objs := pac207.o 37gspca_pac207-objs := pac207.o
37gspca_pac7311-objs := pac7311.o 38gspca_pac7311-objs := pac7311.o
39gspca_sn9c20x-objs := sn9c20x.o
38gspca_sonixb-objs := sonixb.o 40gspca_sonixb-objs := sonixb.o
39gspca_sonixj-objs := sonixj.o 41gspca_sonixj-objs := sonixj.o
40gspca_spca500-objs := spca500.o 42gspca_spca500-objs := spca500.o
diff --git a/drivers/media/video/gspca/conex.c b/drivers/media/video/gspca/conex.c
index 219cfa6fb877..8d48ea1742c2 100644
--- a/drivers/media/video/gspca/conex.c
+++ b/drivers/media/video/gspca/conex.c
@@ -846,6 +846,8 @@ static int sd_start(struct gspca_dev *gspca_dev)
846 846
847 /* create the JPEG header */ 847 /* create the JPEG header */
848 sd->jpeg_hdr = kmalloc(JPEG_HDR_SZ, GFP_KERNEL); 848 sd->jpeg_hdr = kmalloc(JPEG_HDR_SZ, GFP_KERNEL);
849 if (!sd->jpeg_hdr)
850 return -ENOMEM;
849 jpeg_define(sd->jpeg_hdr, gspca_dev->height, gspca_dev->width, 851 jpeg_define(sd->jpeg_hdr, gspca_dev->height, gspca_dev->width,
850 0x22); /* JPEG 411 */ 852 0x22); /* JPEG 411 */
851 jpeg_set_qual(sd->jpeg_hdr, sd->quality); 853 jpeg_set_qual(sd->jpeg_hdr, sd->quality);
diff --git a/drivers/media/video/gspca/gspca.c b/drivers/media/video/gspca/gspca.c
index 1e89600986c8..b8561dfb6c8c 100644
--- a/drivers/media/video/gspca/gspca.c
+++ b/drivers/media/video/gspca/gspca.c
@@ -727,6 +727,74 @@ static int gspca_get_mode(struct gspca_dev *gspca_dev,
727 return -EINVAL; 727 return -EINVAL;
728} 728}
729 729
730#ifdef CONFIG_VIDEO_ADV_DEBUG
731static int vidioc_g_register(struct file *file, void *priv,
732 struct v4l2_dbg_register *reg)
733{
734 int ret;
735 struct gspca_dev *gspca_dev = priv;
736
737 if (!gspca_dev->sd_desc->get_chip_ident)
738 return -EINVAL;
739
740 if (!gspca_dev->sd_desc->get_register)
741 return -EINVAL;
742
743 if (mutex_lock_interruptible(&gspca_dev->usb_lock))
744 return -ERESTARTSYS;
745 if (gspca_dev->present)
746 ret = gspca_dev->sd_desc->get_register(gspca_dev, reg);
747 else
748 ret = -ENODEV;
749 mutex_unlock(&gspca_dev->usb_lock);
750
751 return ret;
752}
753
754static int vidioc_s_register(struct file *file, void *priv,
755 struct v4l2_dbg_register *reg)
756{
757 int ret;
758 struct gspca_dev *gspca_dev = priv;
759
760 if (!gspca_dev->sd_desc->get_chip_ident)
761 return -EINVAL;
762
763 if (!gspca_dev->sd_desc->set_register)
764 return -EINVAL;
765
766 if (mutex_lock_interruptible(&gspca_dev->usb_lock))
767 return -ERESTARTSYS;
768 if (gspca_dev->present)
769 ret = gspca_dev->sd_desc->set_register(gspca_dev, reg);
770 else
771 ret = -ENODEV;
772 mutex_unlock(&gspca_dev->usb_lock);
773
774 return ret;
775}
776#endif
777
778static int vidioc_g_chip_ident(struct file *file, void *priv,
779 struct v4l2_dbg_chip_ident *chip)
780{
781 int ret;
782 struct gspca_dev *gspca_dev = priv;
783
784 if (!gspca_dev->sd_desc->get_chip_ident)
785 return -EINVAL;
786
787 if (mutex_lock_interruptible(&gspca_dev->usb_lock))
788 return -ERESTARTSYS;
789 if (gspca_dev->present)
790 ret = gspca_dev->sd_desc->get_chip_ident(gspca_dev, chip);
791 else
792 ret = -ENODEV;
793 mutex_unlock(&gspca_dev->usb_lock);
794
795 return ret;
796}
797
730static int vidioc_enum_fmt_vid_cap(struct file *file, void *priv, 798static int vidioc_enum_fmt_vid_cap(struct file *file, void *priv,
731 struct v4l2_fmtdesc *fmtdesc) 799 struct v4l2_fmtdesc *fmtdesc)
732{ 800{
@@ -1883,6 +1951,11 @@ static const struct v4l2_ioctl_ops dev_ioctl_ops = {
1883 .vidioc_s_parm = vidioc_s_parm, 1951 .vidioc_s_parm = vidioc_s_parm,
1884 .vidioc_s_std = vidioc_s_std, 1952 .vidioc_s_std = vidioc_s_std,
1885 .vidioc_enum_framesizes = vidioc_enum_framesizes, 1953 .vidioc_enum_framesizes = vidioc_enum_framesizes,
1954#ifdef CONFIG_VIDEO_ADV_DEBUG
1955 .vidioc_g_register = vidioc_g_register,
1956 .vidioc_s_register = vidioc_s_register,
1957#endif
1958 .vidioc_g_chip_ident = vidioc_g_chip_ident,
1886#ifdef CONFIG_VIDEO_V4L1_COMPAT 1959#ifdef CONFIG_VIDEO_V4L1_COMPAT
1887 .vidiocgmbuf = vidiocgmbuf, 1960 .vidiocgmbuf = vidiocgmbuf,
1888#endif 1961#endif
diff --git a/drivers/media/video/gspca/gspca.h b/drivers/media/video/gspca/gspca.h
index bd1faff88644..46c4effdfcd5 100644
--- a/drivers/media/video/gspca/gspca.h
+++ b/drivers/media/video/gspca/gspca.h
@@ -69,6 +69,10 @@ typedef void (*cam_v_op) (struct gspca_dev *);
69typedef int (*cam_cf_op) (struct gspca_dev *, const struct usb_device_id *); 69typedef int (*cam_cf_op) (struct gspca_dev *, const struct usb_device_id *);
70typedef int (*cam_jpg_op) (struct gspca_dev *, 70typedef int (*cam_jpg_op) (struct gspca_dev *,
71 struct v4l2_jpegcompression *); 71 struct v4l2_jpegcompression *);
72typedef int (*cam_reg_op) (struct gspca_dev *,
73 struct v4l2_dbg_register *);
74typedef int (*cam_ident_op) (struct gspca_dev *,
75 struct v4l2_dbg_chip_ident *);
72typedef int (*cam_streamparm_op) (struct gspca_dev *, 76typedef int (*cam_streamparm_op) (struct gspca_dev *,
73 struct v4l2_streamparm *); 77 struct v4l2_streamparm *);
74typedef int (*cam_qmnu_op) (struct gspca_dev *, 78typedef int (*cam_qmnu_op) (struct gspca_dev *,
@@ -105,6 +109,11 @@ struct sd_desc {
105 cam_qmnu_op querymenu; 109 cam_qmnu_op querymenu;
106 cam_streamparm_op get_streamparm; 110 cam_streamparm_op get_streamparm;
107 cam_streamparm_op set_streamparm; 111 cam_streamparm_op set_streamparm;
112#ifdef CONFIG_VIDEO_ADV_DEBUG
113 cam_reg_op set_register;
114 cam_reg_op get_register;
115#endif
116 cam_ident_op get_chip_ident;
108}; 117};
109 118
110/* packet types when moving from iso buf to frame buf */ 119/* packet types when moving from iso buf to frame buf */
diff --git a/drivers/media/video/gspca/m5602/m5602_s5k4aa.c b/drivers/media/video/gspca/m5602/m5602_s5k4aa.c
index 191bcd718979..0163903d1c0f 100644
--- a/drivers/media/video/gspca/m5602/m5602_s5k4aa.c
+++ b/drivers/media/video/gspca/m5602/m5602_s5k4aa.c
@@ -476,9 +476,6 @@ static int s5k4aa_set_vflip(struct gspca_dev *gspca_dev, __s32 val)
476 err = m5602_write_sensor(sd, S5K4AA_PAGE_MAP, &data, 1); 476 err = m5602_write_sensor(sd, S5K4AA_PAGE_MAP, &data, 1);
477 if (err < 0) 477 if (err < 0)
478 return err; 478 return err;
479 err = m5602_write_sensor(sd, S5K4AA_READ_MODE, &data, 1);
480 if (err < 0)
481 return err;
482 479
483 err = m5602_read_sensor(sd, S5K4AA_READ_MODE, &data, 1); 480 err = m5602_read_sensor(sd, S5K4AA_READ_MODE, &data, 1);
484 if (err < 0) 481 if (err < 0)
@@ -524,9 +521,6 @@ static int s5k4aa_set_hflip(struct gspca_dev *gspca_dev, __s32 val)
524 err = m5602_write_sensor(sd, S5K4AA_PAGE_MAP, &data, 1); 521 err = m5602_write_sensor(sd, S5K4AA_PAGE_MAP, &data, 1);
525 if (err < 0) 522 if (err < 0)
526 return err; 523 return err;
527 err = m5602_write_sensor(sd, S5K4AA_READ_MODE, &data, 1);
528 if (err < 0)
529 return err;
530 524
531 err = m5602_read_sensor(sd, S5K4AA_READ_MODE, &data, 1); 525 err = m5602_read_sensor(sd, S5K4AA_READ_MODE, &data, 1);
532 if (err < 0) 526 if (err < 0)
diff --git a/drivers/media/video/gspca/mars.c b/drivers/media/video/gspca/mars.c
index 75e8d14e4ac7..de769caf013d 100644
--- a/drivers/media/video/gspca/mars.c
+++ b/drivers/media/video/gspca/mars.c
@@ -201,6 +201,8 @@ static int sd_start(struct gspca_dev *gspca_dev)
201 201
202 /* create the JPEG header */ 202 /* create the JPEG header */
203 sd->jpeg_hdr = kmalloc(JPEG_HDR_SZ, GFP_KERNEL); 203 sd->jpeg_hdr = kmalloc(JPEG_HDR_SZ, GFP_KERNEL);
204 if (!sd->jpeg_hdr)
205 return -ENOMEM;
204 jpeg_define(sd->jpeg_hdr, gspca_dev->height, gspca_dev->width, 206 jpeg_define(sd->jpeg_hdr, gspca_dev->height, gspca_dev->width,
205 0x21); /* JPEG 422 */ 207 0x21); /* JPEG 422 */
206 jpeg_set_qual(sd->jpeg_hdr, sd->quality); 208 jpeg_set_qual(sd->jpeg_hdr, sd->quality);
diff --git a/drivers/media/video/gspca/sn9c20x.c b/drivers/media/video/gspca/sn9c20x.c
new file mode 100644
index 000000000000..fcfbbd329b4c
--- /dev/null
+++ b/drivers/media/video/gspca/sn9c20x.c
@@ -0,0 +1,2434 @@
1/*
2 * Sonix sn9c201 sn9c202 library
3 * Copyright (C) 2008-2009 microdia project <microdia@googlegroups.com>
4 * Copyright (C) 2009 Brian Johnson <brijohn@gmail.com>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */
20
21#ifdef CONFIG_USB_GSPCA_SN9C20X_EVDEV
22#include <linux/kthread.h>
23#include <linux/freezer.h>
24#include <linux/usb/input.h>
25#include <linux/input.h>
26#endif
27
28#include "gspca.h"
29#include "jpeg.h"
30
31#include <media/v4l2-chip-ident.h>
32
33MODULE_AUTHOR("Brian Johnson <brijohn@gmail.com>, "
34 "microdia project <microdia@googlegroups.com>");
35MODULE_DESCRIPTION("GSPCA/SN9C20X USB Camera Driver");
36MODULE_LICENSE("GPL");
37
38#define MODULE_NAME "sn9c20x"
39
40#define MODE_RAW 0x10
41#define MODE_JPEG 0x20
42#define MODE_SXGA 0x80
43
44#define SENSOR_OV9650 0
45#define SENSOR_OV9655 1
46#define SENSOR_SOI968 2
47#define SENSOR_OV7660 3
48#define SENSOR_OV7670 4
49#define SENSOR_MT9V011 5
50#define SENSOR_MT9V111 6
51#define SENSOR_MT9V112 7
52#define SENSOR_MT9M001 8
53#define SENSOR_MT9M111 9
54#define SENSOR_HV7131R 10
55#define SENSOR_MT9VPRB 20
56
57/* specific webcam descriptor */
58struct sd {
59 struct gspca_dev gspca_dev;
60
61#define MIN_AVG_LUM 80
62#define MAX_AVG_LUM 130
63 atomic_t avg_lum;
64 u8 old_step;
65 u8 older_step;
66 u8 exposure_step;
67
68 u8 brightness;
69 u8 contrast;
70 u8 saturation;
71 s16 hue;
72 u8 gamma;
73 u8 red;
74 u8 blue;
75
76 u8 hflip;
77 u8 vflip;
78 u8 gain;
79 u16 exposure;
80 u8 auto_exposure;
81
82 u8 i2c_addr;
83 u8 sensor;
84 u8 hstart;
85 u8 vstart;
86
87 u8 *jpeg_hdr;
88 u8 quality;
89
90#ifdef CONFIG_USB_GSPCA_SN9C20X_EVDEV
91 struct input_dev *input_dev;
92 u8 input_gpio;
93 struct task_struct *input_task;
94#endif
95};
96
97static int sd_setbrightness(struct gspca_dev *gspca_dev, s32 val);
98static int sd_getbrightness(struct gspca_dev *gspca_dev, s32 *val);
99static int sd_setcontrast(struct gspca_dev *gspca_dev, s32 val);
100static int sd_getcontrast(struct gspca_dev *gspca_dev, s32 *val);
101static int sd_setsaturation(struct gspca_dev *gspca_dev, s32 val);
102static int sd_getsaturation(struct gspca_dev *gspca_dev, s32 *val);
103static int sd_sethue(struct gspca_dev *gspca_dev, s32 val);
104static int sd_gethue(struct gspca_dev *gspca_dev, s32 *val);
105static int sd_setgamma(struct gspca_dev *gspca_dev, s32 val);
106static int sd_getgamma(struct gspca_dev *gspca_dev, s32 *val);
107static int sd_setredbalance(struct gspca_dev *gspca_dev, s32 val);
108static int sd_getredbalance(struct gspca_dev *gspca_dev, s32 *val);
109static int sd_setbluebalance(struct gspca_dev *gspca_dev, s32 val);
110static int sd_getbluebalance(struct gspca_dev *gspca_dev, s32 *val);
111static int sd_setvflip(struct gspca_dev *gspca_dev, s32 val);
112static int sd_getvflip(struct gspca_dev *gspca_dev, s32 *val);
113static int sd_sethflip(struct gspca_dev *gspca_dev, s32 val);
114static int sd_gethflip(struct gspca_dev *gspca_dev, s32 *val);
115static int sd_setgain(struct gspca_dev *gspca_dev, s32 val);
116static int sd_getgain(struct gspca_dev *gspca_dev, s32 *val);
117static int sd_setexposure(struct gspca_dev *gspca_dev, s32 val);
118static int sd_getexposure(struct gspca_dev *gspca_dev, s32 *val);
119static int sd_setautoexposure(struct gspca_dev *gspca_dev, s32 val);
120static int sd_getautoexposure(struct gspca_dev *gspca_dev, s32 *val);
121
122static struct ctrl sd_ctrls[] = {
123 {
124#define BRIGHTNESS_IDX 0
125 {
126 .id = V4L2_CID_BRIGHTNESS,
127 .type = V4L2_CTRL_TYPE_INTEGER,
128 .name = "Brightness",
129 .minimum = 0,
130 .maximum = 0xff,
131 .step = 1,
132#define BRIGHTNESS_DEFAULT 0x7f
133 .default_value = BRIGHTNESS_DEFAULT,
134 },
135 .set = sd_setbrightness,
136 .get = sd_getbrightness,
137 },
138 {
139#define CONTRAST_IDX 1
140 {
141 .id = V4L2_CID_CONTRAST,
142 .type = V4L2_CTRL_TYPE_INTEGER,
143 .name = "Contrast",
144 .minimum = 0,
145 .maximum = 0xff,
146 .step = 1,
147#define CONTRAST_DEFAULT 0x7f
148 .default_value = CONTRAST_DEFAULT,
149 },
150 .set = sd_setcontrast,
151 .get = sd_getcontrast,
152 },
153 {
154#define SATURATION_IDX 2
155 {
156 .id = V4L2_CID_SATURATION,
157 .type = V4L2_CTRL_TYPE_INTEGER,
158 .name = "Saturation",
159 .minimum = 0,
160 .maximum = 0xff,
161 .step = 1,
162#define SATURATION_DEFAULT 0x7f
163 .default_value = SATURATION_DEFAULT,
164 },
165 .set = sd_setsaturation,
166 .get = sd_getsaturation,
167 },
168 {
169#define HUE_IDX 3
170 {
171 .id = V4L2_CID_HUE,
172 .type = V4L2_CTRL_TYPE_INTEGER,
173 .name = "Hue",
174 .minimum = -180,
175 .maximum = 180,
176 .step = 1,
177#define HUE_DEFAULT 0
178 .default_value = HUE_DEFAULT,
179 },
180 .set = sd_sethue,
181 .get = sd_gethue,
182 },
183 {
184#define GAMMA_IDX 4
185 {
186 .id = V4L2_CID_GAMMA,
187 .type = V4L2_CTRL_TYPE_INTEGER,
188 .name = "Gamma",
189 .minimum = 0,
190 .maximum = 0xff,
191 .step = 1,
192#define GAMMA_DEFAULT 0x10
193 .default_value = GAMMA_DEFAULT,
194 },
195 .set = sd_setgamma,
196 .get = sd_getgamma,
197 },
198 {
199#define BLUE_IDX 5
200 {
201 .id = V4L2_CID_BLUE_BALANCE,
202 .type = V4L2_CTRL_TYPE_INTEGER,
203 .name = "Blue Balance",
204 .minimum = 0,
205 .maximum = 0x7f,
206 .step = 1,
207#define BLUE_DEFAULT 0x28
208 .default_value = BLUE_DEFAULT,
209 },
210 .set = sd_setbluebalance,
211 .get = sd_getbluebalance,
212 },
213 {
214#define RED_IDX 6
215 {
216 .id = V4L2_CID_RED_BALANCE,
217 .type = V4L2_CTRL_TYPE_INTEGER,
218 .name = "Red Balance",
219 .minimum = 0,
220 .maximum = 0x7f,
221 .step = 1,
222#define RED_DEFAULT 0x28
223 .default_value = RED_DEFAULT,
224 },
225 .set = sd_setredbalance,
226 .get = sd_getredbalance,
227 },
228 {
229#define HFLIP_IDX 7
230 {
231 .id = V4L2_CID_HFLIP,
232 .type = V4L2_CTRL_TYPE_BOOLEAN,
233 .name = "Horizontal Flip",
234 .minimum = 0,
235 .maximum = 1,
236 .step = 1,
237#define HFLIP_DEFAULT 0
238 .default_value = HFLIP_DEFAULT,
239 },
240 .set = sd_sethflip,
241 .get = sd_gethflip,
242 },
243 {
244#define VFLIP_IDX 8
245 {
246 .id = V4L2_CID_VFLIP,
247 .type = V4L2_CTRL_TYPE_BOOLEAN,
248 .name = "Vertical Flip",
249 .minimum = 0,
250 .maximum = 1,
251 .step = 1,
252#define VFLIP_DEFAULT 0
253 .default_value = VFLIP_DEFAULT,
254 },
255 .set = sd_setvflip,
256 .get = sd_getvflip,
257 },
258 {
259#define EXPOSURE_IDX 9
260 {
261 .id = V4L2_CID_EXPOSURE,
262 .type = V4L2_CTRL_TYPE_INTEGER,
263 .name = "Exposure",
264 .minimum = 0,
265 .maximum = 0x1780,
266 .step = 1,
267#define EXPOSURE_DEFAULT 0x33
268 .default_value = EXPOSURE_DEFAULT,
269 },
270 .set = sd_setexposure,
271 .get = sd_getexposure,
272 },
273 {
274#define GAIN_IDX 10
275 {
276 .id = V4L2_CID_GAIN,
277 .type = V4L2_CTRL_TYPE_INTEGER,
278 .name = "Gain",
279 .minimum = 0,
280 .maximum = 28,
281 .step = 1,
282#define GAIN_DEFAULT 0x00
283 .default_value = GAIN_DEFAULT,
284 },
285 .set = sd_setgain,
286 .get = sd_getgain,
287 },
288 {
289#define AUTOGAIN_IDX 11
290 {
291 .id = V4L2_CID_AUTOGAIN,
292 .type = V4L2_CTRL_TYPE_BOOLEAN,
293 .name = "Auto Exposure",
294 .minimum = 0,
295 .maximum = 1,
296 .step = 1,
297#define AUTO_EXPOSURE_DEFAULT 1
298 .default_value = AUTO_EXPOSURE_DEFAULT,
299 },
300 .set = sd_setautoexposure,
301 .get = sd_getautoexposure,
302 },
303};
304
305static const struct v4l2_pix_format vga_mode[] = {
306 {160, 120, V4L2_PIX_FMT_JPEG, V4L2_FIELD_NONE,
307 .bytesperline = 240,
308 .sizeimage = 240 * 120,
309 .colorspace = V4L2_COLORSPACE_JPEG,
310 .priv = 0 | MODE_JPEG},
311 {160, 120, V4L2_PIX_FMT_SBGGR8, V4L2_FIELD_NONE,
312 .bytesperline = 160,
313 .sizeimage = 160 * 120,
314 .colorspace = V4L2_COLORSPACE_SRGB,
315 .priv = 0 | MODE_RAW},
316 {160, 120, V4L2_PIX_FMT_SN9C20X_I420, V4L2_FIELD_NONE,
317 .bytesperline = 240,
318 .sizeimage = 240 * 120,
319 .colorspace = V4L2_COLORSPACE_SRGB,
320 .priv = 0},
321 {320, 240, V4L2_PIX_FMT_JPEG, V4L2_FIELD_NONE,
322 .bytesperline = 480,
323 .sizeimage = 480 * 240 ,
324 .colorspace = V4L2_COLORSPACE_JPEG,
325 .priv = 1 | MODE_JPEG},
326 {320, 240, V4L2_PIX_FMT_SBGGR8, V4L2_FIELD_NONE,
327 .bytesperline = 320,
328 .sizeimage = 320 * 240 ,
329 .colorspace = V4L2_COLORSPACE_SRGB,
330 .priv = 1 | MODE_RAW},
331 {320, 240, V4L2_PIX_FMT_SN9C20X_I420, V4L2_FIELD_NONE,
332 .bytesperline = 480,
333 .sizeimage = 480 * 240 ,
334 .colorspace = V4L2_COLORSPACE_SRGB,
335 .priv = 1},
336 {640, 480, V4L2_PIX_FMT_JPEG, V4L2_FIELD_NONE,
337 .bytesperline = 960,
338 .sizeimage = 960 * 480,
339 .colorspace = V4L2_COLORSPACE_JPEG,
340 .priv = 2 | MODE_JPEG},
341 {640, 480, V4L2_PIX_FMT_SBGGR8, V4L2_FIELD_NONE,
342 .bytesperline = 640,
343 .sizeimage = 640 * 480,
344 .colorspace = V4L2_COLORSPACE_SRGB,
345 .priv = 2 | MODE_RAW},
346 {640, 480, V4L2_PIX_FMT_SN9C20X_I420, V4L2_FIELD_NONE,
347 .bytesperline = 960,
348 .sizeimage = 960 * 480,
349 .colorspace = V4L2_COLORSPACE_SRGB,
350 .priv = 2},
351};
352
353static const struct v4l2_pix_format sxga_mode[] = {
354 {160, 120, V4L2_PIX_FMT_JPEG, V4L2_FIELD_NONE,
355 .bytesperline = 240,
356 .sizeimage = 240 * 120,
357 .colorspace = V4L2_COLORSPACE_JPEG,
358 .priv = 0 | MODE_JPEG},
359 {160, 120, V4L2_PIX_FMT_SBGGR8, V4L2_FIELD_NONE,
360 .bytesperline = 160,
361 .sizeimage = 160 * 120,
362 .colorspace = V4L2_COLORSPACE_SRGB,
363 .priv = 0 | MODE_RAW},
364 {160, 120, V4L2_PIX_FMT_SN9C20X_I420, V4L2_FIELD_NONE,
365 .bytesperline = 240,
366 .sizeimage = 240 * 120,
367 .colorspace = V4L2_COLORSPACE_SRGB,
368 .priv = 0},
369 {320, 240, V4L2_PIX_FMT_JPEG, V4L2_FIELD_NONE,
370 .bytesperline = 480,
371 .sizeimage = 480 * 240 ,
372 .colorspace = V4L2_COLORSPACE_JPEG,
373 .priv = 1 | MODE_JPEG},
374 {320, 240, V4L2_PIX_FMT_SBGGR8, V4L2_FIELD_NONE,
375 .bytesperline = 320,
376 .sizeimage = 320 * 240 ,
377 .colorspace = V4L2_COLORSPACE_SRGB,
378 .priv = 1 | MODE_RAW},
379 {320, 240, V4L2_PIX_FMT_SN9C20X_I420, V4L2_FIELD_NONE,
380 .bytesperline = 480,
381 .sizeimage = 480 * 240 ,
382 .colorspace = V4L2_COLORSPACE_SRGB,
383 .priv = 1},
384 {640, 480, V4L2_PIX_FMT_JPEG, V4L2_FIELD_NONE,
385 .bytesperline = 960,
386 .sizeimage = 960 * 480,
387 .colorspace = V4L2_COLORSPACE_JPEG,
388 .priv = 2 | MODE_JPEG},
389 {640, 480, V4L2_PIX_FMT_SBGGR8, V4L2_FIELD_NONE,
390 .bytesperline = 640,
391 .sizeimage = 640 * 480,
392 .colorspace = V4L2_COLORSPACE_SRGB,
393 .priv = 2 | MODE_RAW},
394 {640, 480, V4L2_PIX_FMT_SN9C20X_I420, V4L2_FIELD_NONE,
395 .bytesperline = 960,
396 .sizeimage = 960 * 480,
397 .colorspace = V4L2_COLORSPACE_SRGB,
398 .priv = 2},
399 {1280, 1024, V4L2_PIX_FMT_SBGGR8, V4L2_FIELD_NONE,
400 .bytesperline = 1280,
401 .sizeimage = (1280 * 1024) + 64,
402 .colorspace = V4L2_COLORSPACE_SRGB,
403 .priv = 3 | MODE_RAW | MODE_SXGA},
404};
405
406static const int hsv_red_x[] = {
407 41, 44, 46, 48, 50, 52, 54, 56,
408 58, 60, 62, 64, 66, 68, 70, 72,
409 74, 76, 78, 80, 81, 83, 85, 87,
410 88, 90, 92, 93, 95, 97, 98, 100,
411 101, 102, 104, 105, 107, 108, 109, 110,
412 112, 113, 114, 115, 116, 117, 118, 119,
413 120, 121, 122, 123, 123, 124, 125, 125,
414 126, 127, 127, 128, 128, 129, 129, 129,
415 130, 130, 130, 130, 131, 131, 131, 131,
416 131, 131, 131, 131, 130, 130, 130, 130,
417 129, 129, 129, 128, 128, 127, 127, 126,
418 125, 125, 124, 123, 122, 122, 121, 120,
419 119, 118, 117, 116, 115, 114, 112, 111,
420 110, 109, 107, 106, 105, 103, 102, 101,
421 99, 98, 96, 94, 93, 91, 90, 88,
422 86, 84, 83, 81, 79, 77, 75, 74,
423 72, 70, 68, 66, 64, 62, 60, 58,
424 56, 54, 52, 49, 47, 45, 43, 41,
425 39, 36, 34, 32, 30, 28, 25, 23,
426 21, 19, 16, 14, 12, 9, 7, 5,
427 3, 0, -1, -3, -6, -8, -10, -12,
428 -15, -17, -19, -22, -24, -26, -28, -30,
429 -33, -35, -37, -39, -41, -44, -46, -48,
430 -50, -52, -54, -56, -58, -60, -62, -64,
431 -66, -68, -70, -72, -74, -76, -78, -80,
432 -81, -83, -85, -87, -88, -90, -92, -93,
433 -95, -97, -98, -100, -101, -102, -104, -105,
434 -107, -108, -109, -110, -112, -113, -114, -115,
435 -116, -117, -118, -119, -120, -121, -122, -123,
436 -123, -124, -125, -125, -126, -127, -127, -128,
437 -128, -128, -128, -128, -128, -128, -128, -128,
438 -128, -128, -128, -128, -128, -128, -128, -128,
439 -128, -128, -128, -128, -128, -128, -128, -128,
440 -128, -127, -127, -126, -125, -125, -124, -123,
441 -122, -122, -121, -120, -119, -118, -117, -116,
442 -115, -114, -112, -111, -110, -109, -107, -106,
443 -105, -103, -102, -101, -99, -98, -96, -94,
444 -93, -91, -90, -88, -86, -84, -83, -81,
445 -79, -77, -75, -74, -72, -70, -68, -66,
446 -64, -62, -60, -58, -56, -54, -52, -49,
447 -47, -45, -43, -41, -39, -36, -34, -32,
448 -30, -28, -25, -23, -21, -19, -16, -14,
449 -12, -9, -7, -5, -3, 0, 1, 3,
450 6, 8, 10, 12, 15, 17, 19, 22,
451 24, 26, 28, 30, 33, 35, 37, 39, 41
452};
453
454static const int hsv_red_y[] = {
455 82, 80, 78, 76, 74, 73, 71, 69,
456 67, 65, 63, 61, 58, 56, 54, 52,
457 50, 48, 46, 44, 41, 39, 37, 35,
458 32, 30, 28, 26, 23, 21, 19, 16,
459 14, 12, 10, 7, 5, 3, 0, -1,
460 -3, -6, -8, -10, -13, -15, -17, -19,
461 -22, -24, -26, -29, -31, -33, -35, -38,
462 -40, -42, -44, -46, -48, -51, -53, -55,
463 -57, -59, -61, -63, -65, -67, -69, -71,
464 -73, -75, -77, -79, -81, -82, -84, -86,
465 -88, -89, -91, -93, -94, -96, -98, -99,
466 -101, -102, -104, -105, -106, -108, -109, -110,
467 -112, -113, -114, -115, -116, -117, -119, -120,
468 -120, -121, -122, -123, -124, -125, -126, -126,
469 -127, -128, -128, -128, -128, -128, -128, -128,
470 -128, -128, -128, -128, -128, -128, -128, -128,
471 -128, -128, -128, -128, -128, -128, -128, -128,
472 -128, -128, -128, -128, -128, -128, -128, -128,
473 -127, -127, -126, -125, -125, -124, -123, -122,
474 -121, -120, -119, -118, -117, -116, -115, -114,
475 -113, -111, -110, -109, -107, -106, -105, -103,
476 -102, -100, -99, -97, -96, -94, -92, -91,
477 -89, -87, -85, -84, -82, -80, -78, -76,
478 -74, -73, -71, -69, -67, -65, -63, -61,
479 -58, -56, -54, -52, -50, -48, -46, -44,
480 -41, -39, -37, -35, -32, -30, -28, -26,
481 -23, -21, -19, -16, -14, -12, -10, -7,
482 -5, -3, 0, 1, 3, 6, 8, 10,
483 13, 15, 17, 19, 22, 24, 26, 29,
484 31, 33, 35, 38, 40, 42, 44, 46,
485 48, 51, 53, 55, 57, 59, 61, 63,
486 65, 67, 69, 71, 73, 75, 77, 79,
487 81, 82, 84, 86, 88, 89, 91, 93,
488 94, 96, 98, 99, 101, 102, 104, 105,
489 106, 108, 109, 110, 112, 113, 114, 115,
490 116, 117, 119, 120, 120, 121, 122, 123,
491 124, 125, 126, 126, 127, 128, 128, 129,
492 129, 130, 130, 131, 131, 131, 131, 132,
493 132, 132, 132, 132, 132, 132, 132, 132,
494 132, 132, 132, 131, 131, 131, 130, 130,
495 130, 129, 129, 128, 127, 127, 126, 125,
496 125, 124, 123, 122, 121, 120, 119, 118,
497 117, 116, 115, 114, 113, 111, 110, 109,
498 107, 106, 105, 103, 102, 100, 99, 97,
499 96, 94, 92, 91, 89, 87, 85, 84, 82
500};
501
502static const int hsv_green_x[] = {
503 -124, -124, -125, -125, -125, -125, -125, -125,
504 -125, -126, -126, -125, -125, -125, -125, -125,
505 -125, -124, -124, -124, -123, -123, -122, -122,
506 -121, -121, -120, -120, -119, -118, -117, -117,
507 -116, -115, -114, -113, -112, -111, -110, -109,
508 -108, -107, -105, -104, -103, -102, -100, -99,
509 -98, -96, -95, -93, -92, -91, -89, -87,
510 -86, -84, -83, -81, -79, -77, -76, -74,
511 -72, -70, -69, -67, -65, -63, -61, -59,
512 -57, -55, -53, -51, -49, -47, -45, -43,
513 -41, -39, -37, -35, -33, -30, -28, -26,
514 -24, -22, -20, -18, -15, -13, -11, -9,
515 -7, -4, -2, 0, 1, 3, 6, 8,
516 10, 12, 14, 17, 19, 21, 23, 25,
517 27, 29, 32, 34, 36, 38, 40, 42,
518 44, 46, 48, 50, 52, 54, 56, 58,
519 60, 62, 64, 66, 68, 70, 71, 73,
520 75, 77, 78, 80, 82, 83, 85, 87,
521 88, 90, 91, 93, 94, 96, 97, 98,
522 100, 101, 102, 104, 105, 106, 107, 108,
523 109, 111, 112, 113, 113, 114, 115, 116,
524 117, 118, 118, 119, 120, 120, 121, 122,
525 122, 123, 123, 124, 124, 124, 125, 125,
526 125, 125, 125, 125, 125, 126, 126, 125,
527 125, 125, 125, 125, 125, 124, 124, 124,
528 123, 123, 122, 122, 121, 121, 120, 120,
529 119, 118, 117, 117, 116, 115, 114, 113,
530 112, 111, 110, 109, 108, 107, 105, 104,
531 103, 102, 100, 99, 98, 96, 95, 93,
532 92, 91, 89, 87, 86, 84, 83, 81,
533 79, 77, 76, 74, 72, 70, 69, 67,
534 65, 63, 61, 59, 57, 55, 53, 51,
535 49, 47, 45, 43, 41, 39, 37, 35,
536 33, 30, 28, 26, 24, 22, 20, 18,
537 15, 13, 11, 9, 7, 4, 2, 0,
538 -1, -3, -6, -8, -10, -12, -14, -17,
539 -19, -21, -23, -25, -27, -29, -32, -34,
540 -36, -38, -40, -42, -44, -46, -48, -50,
541 -52, -54, -56, -58, -60, -62, -64, -66,
542 -68, -70, -71, -73, -75, -77, -78, -80,
543 -82, -83, -85, -87, -88, -90, -91, -93,
544 -94, -96, -97, -98, -100, -101, -102, -104,
545 -105, -106, -107, -108, -109, -111, -112, -113,
546 -113, -114, -115, -116, -117, -118, -118, -119,
547 -120, -120, -121, -122, -122, -123, -123, -124, -124
548};
549
550static const int hsv_green_y[] = {
551 -100, -99, -98, -97, -95, -94, -93, -91,
552 -90, -89, -87, -86, -84, -83, -81, -80,
553 -78, -76, -75, -73, -71, -70, -68, -66,
554 -64, -63, -61, -59, -57, -55, -53, -51,
555 -49, -48, -46, -44, -42, -40, -38, -36,
556 -34, -32, -30, -27, -25, -23, -21, -19,
557 -17, -15, -13, -11, -9, -7, -4, -2,
558 0, 1, 3, 5, 7, 9, 11, 14,
559 16, 18, 20, 22, 24, 26, 28, 30,
560 32, 34, 36, 38, 40, 42, 44, 46,
561 48, 50, 52, 54, 56, 58, 59, 61,
562 63, 65, 67, 68, 70, 72, 74, 75,
563 77, 78, 80, 82, 83, 85, 86, 88,
564 89, 90, 92, 93, 95, 96, 97, 98,
565 100, 101, 102, 103, 104, 105, 106, 107,
566 108, 109, 110, 111, 112, 112, 113, 114,
567 115, 115, 116, 116, 117, 117, 118, 118,
568 119, 119, 119, 120, 120, 120, 120, 120,
569 121, 121, 121, 121, 121, 121, 120, 120,
570 120, 120, 120, 119, 119, 119, 118, 118,
571 117, 117, 116, 116, 115, 114, 114, 113,
572 112, 111, 111, 110, 109, 108, 107, 106,
573 105, 104, 103, 102, 100, 99, 98, 97,
574 95, 94, 93, 91, 90, 89, 87, 86,
575 84, 83, 81, 80, 78, 76, 75, 73,
576 71, 70, 68, 66, 64, 63, 61, 59,
577 57, 55, 53, 51, 49, 48, 46, 44,
578 42, 40, 38, 36, 34, 32, 30, 27,
579 25, 23, 21, 19, 17, 15, 13, 11,
580 9, 7, 4, 2, 0, -1, -3, -5,
581 -7, -9, -11, -14, -16, -18, -20, -22,
582 -24, -26, -28, -30, -32, -34, -36, -38,
583 -40, -42, -44, -46, -48, -50, -52, -54,
584 -56, -58, -59, -61, -63, -65, -67, -68,
585 -70, -72, -74, -75, -77, -78, -80, -82,
586 -83, -85, -86, -88, -89, -90, -92, -93,
587 -95, -96, -97, -98, -100, -101, -102, -103,
588 -104, -105, -106, -107, -108, -109, -110, -111,
589 -112, -112, -113, -114, -115, -115, -116, -116,
590 -117, -117, -118, -118, -119, -119, -119, -120,
591 -120, -120, -120, -120, -121, -121, -121, -121,
592 -121, -121, -120, -120, -120, -120, -120, -119,
593 -119, -119, -118, -118, -117, -117, -116, -116,
594 -115, -114, -114, -113, -112, -111, -111, -110,
595 -109, -108, -107, -106, -105, -104, -103, -102, -100
596};
597
598static const int hsv_blue_x[] = {
599 112, 113, 114, 114, 115, 116, 117, 117,
600 118, 118, 119, 119, 120, 120, 120, 121,
601 121, 121, 122, 122, 122, 122, 122, 122,
602 122, 122, 122, 122, 122, 122, 121, 121,
603 121, 120, 120, 120, 119, 119, 118, 118,
604 117, 116, 116, 115, 114, 113, 113, 112,
605 111, 110, 109, 108, 107, 106, 105, 104,
606 103, 102, 100, 99, 98, 97, 95, 94,
607 93, 91, 90, 88, 87, 85, 84, 82,
608 80, 79, 77, 76, 74, 72, 70, 69,
609 67, 65, 63, 61, 60, 58, 56, 54,
610 52, 50, 48, 46, 44, 42, 40, 38,
611 36, 34, 32, 30, 28, 26, 24, 22,
612 19, 17, 15, 13, 11, 9, 7, 5,
613 2, 0, -1, -3, -5, -7, -9, -12,
614 -14, -16, -18, -20, -22, -24, -26, -28,
615 -31, -33, -35, -37, -39, -41, -43, -45,
616 -47, -49, -51, -53, -54, -56, -58, -60,
617 -62, -64, -66, -67, -69, -71, -73, -74,
618 -76, -78, -79, -81, -83, -84, -86, -87,
619 -89, -90, -92, -93, -94, -96, -97, -98,
620 -99, -101, -102, -103, -104, -105, -106, -107,
621 -108, -109, -110, -111, -112, -113, -114, -114,
622 -115, -116, -117, -117, -118, -118, -119, -119,
623 -120, -120, -120, -121, -121, -121, -122, -122,
624 -122, -122, -122, -122, -122, -122, -122, -122,
625 -122, -122, -121, -121, -121, -120, -120, -120,
626 -119, -119, -118, -118, -117, -116, -116, -115,
627 -114, -113, -113, -112, -111, -110, -109, -108,
628 -107, -106, -105, -104, -103, -102, -100, -99,
629 -98, -97, -95, -94, -93, -91, -90, -88,
630 -87, -85, -84, -82, -80, -79, -77, -76,
631 -74, -72, -70, -69, -67, -65, -63, -61,
632 -60, -58, -56, -54, -52, -50, -48, -46,
633 -44, -42, -40, -38, -36, -34, -32, -30,
634 -28, -26, -24, -22, -19, -17, -15, -13,
635 -11, -9, -7, -5, -2, 0, 1, 3,
636 5, 7, 9, 12, 14, 16, 18, 20,
637 22, 24, 26, 28, 31, 33, 35, 37,
638 39, 41, 43, 45, 47, 49, 51, 53,
639 54, 56, 58, 60, 62, 64, 66, 67,
640 69, 71, 73, 74, 76, 78, 79, 81,
641 83, 84, 86, 87, 89, 90, 92, 93,
642 94, 96, 97, 98, 99, 101, 102, 103,
643 104, 105, 106, 107, 108, 109, 110, 111, 112
644};
645
646static const int hsv_blue_y[] = {
647 -11, -13, -15, -17, -19, -21, -23, -25,
648 -27, -29, -31, -33, -35, -37, -39, -41,
649 -43, -45, -46, -48, -50, -52, -54, -55,
650 -57, -59, -61, -62, -64, -66, -67, -69,
651 -71, -72, -74, -75, -77, -78, -80, -81,
652 -83, -84, -86, -87, -88, -90, -91, -92,
653 -93, -95, -96, -97, -98, -99, -100, -101,
654 -102, -103, -104, -105, -106, -106, -107, -108,
655 -109, -109, -110, -111, -111, -112, -112, -113,
656 -113, -114, -114, -114, -115, -115, -115, -115,
657 -116, -116, -116, -116, -116, -116, -116, -116,
658 -116, -115, -115, -115, -115, -114, -114, -114,
659 -113, -113, -112, -112, -111, -111, -110, -110,
660 -109, -108, -108, -107, -106, -105, -104, -103,
661 -102, -101, -100, -99, -98, -97, -96, -95,
662 -94, -93, -91, -90, -89, -88, -86, -85,
663 -84, -82, -81, -79, -78, -76, -75, -73,
664 -71, -70, -68, -67, -65, -63, -62, -60,
665 -58, -56, -55, -53, -51, -49, -47, -45,
666 -44, -42, -40, -38, -36, -34, -32, -30,
667 -28, -26, -24, -22, -20, -18, -16, -14,
668 -12, -10, -8, -6, -4, -2, 0, 1,
669 3, 5, 7, 9, 11, 13, 15, 17,
670 19, 21, 23, 25, 27, 29, 31, 33,
671 35, 37, 39, 41, 43, 45, 46, 48,
672 50, 52, 54, 55, 57, 59, 61, 62,
673 64, 66, 67, 69, 71, 72, 74, 75,
674 77, 78, 80, 81, 83, 84, 86, 87,
675 88, 90, 91, 92, 93, 95, 96, 97,
676 98, 99, 100, 101, 102, 103, 104, 105,
677 106, 106, 107, 108, 109, 109, 110, 111,
678 111, 112, 112, 113, 113, 114, 114, 114,
679 115, 115, 115, 115, 116, 116, 116, 116,
680 116, 116, 116, 116, 116, 115, 115, 115,
681 115, 114, 114, 114, 113, 113, 112, 112,
682 111, 111, 110, 110, 109, 108, 108, 107,
683 106, 105, 104, 103, 102, 101, 100, 99,
684 98, 97, 96, 95, 94, 93, 91, 90,
685 89, 88, 86, 85, 84, 82, 81, 79,
686 78, 76, 75, 73, 71, 70, 68, 67,
687 65, 63, 62, 60, 58, 56, 55, 53,
688 51, 49, 47, 45, 44, 42, 40, 38,
689 36, 34, 32, 30, 28, 26, 24, 22,
690 20, 18, 16, 14, 12, 10, 8, 6,
691 4, 2, 0, -1, -3, -5, -7, -9, -11
692};
693
694static u16 i2c_ident[] = {
695 V4L2_IDENT_OV9650,
696 V4L2_IDENT_OV9655,
697 V4L2_IDENT_SOI968,
698 V4L2_IDENT_OV7660,
699 V4L2_IDENT_OV7670,
700 V4L2_IDENT_MT9V011,
701 V4L2_IDENT_MT9V111,
702 V4L2_IDENT_MT9V112,
703 V4L2_IDENT_MT9M001C12ST,
704 V4L2_IDENT_MT9M111,
705 V4L2_IDENT_HV7131R,
706};
707
708static u16 bridge_init[][2] = {
709 {0x1000, 0x78}, {0x1001, 0x40}, {0x1002, 0x1c},
710 {0x1020, 0x80}, {0x1061, 0x01}, {0x1067, 0x40},
711 {0x1068, 0x30}, {0x1069, 0x20}, {0x106a, 0x10},
712 {0x106b, 0x08}, {0x1188, 0x87}, {0x11a1, 0x00},
713 {0x11a2, 0x00}, {0x11a3, 0x6a}, {0x11a4, 0x50},
714 {0x11ab, 0x00}, {0x11ac, 0x00}, {0x11ad, 0x50},
715 {0x11ae, 0x3c}, {0x118a, 0x04}, {0x0395, 0x04},
716 {0x11b8, 0x3a}, {0x118b, 0x0e}, {0x10f7, 0x05},
717 {0x10f8, 0x14}, {0x10fa, 0xff}, {0x10f9, 0x00},
718 {0x11ba, 0x0a}, {0x11a5, 0x2d}, {0x11a6, 0x2d},
719 {0x11a7, 0x3a}, {0x11a8, 0x05}, {0x11a9, 0x04},
720 {0x11aa, 0x3f}, {0x11af, 0x28}, {0x11b0, 0xd8},
721 {0x11b1, 0x14}, {0x11b2, 0xec}, {0x11b3, 0x32},
722 {0x11b4, 0xdd}, {0x11b5, 0x32}, {0x11b6, 0xdd},
723 {0x10e0, 0x2c}, {0x11bc, 0x40}, {0x11bd, 0x01},
724 {0x11be, 0xf0}, {0x11bf, 0x00}, {0x118c, 0x1f},
725 {0x118d, 0x1f}, {0x118e, 0x1f}, {0x118f, 0x1f},
726 {0x1180, 0x01}, {0x1181, 0x00}, {0x1182, 0x01},
727 {0x1183, 0x00}, {0x1184, 0x50}, {0x1185, 0x80}
728};
729
730/* Gain = (bit[3:0] / 16 + 1) * (bit[4] + 1) * (bit[5] + 1) * (bit[6] + 1) */
731static u8 ov_gain[] = {
732 0x00 /* 1x */, 0x04 /* 1.25x */, 0x08 /* 1.5x */, 0x0c /* 1.75x */,
733 0x10 /* 2x */, 0x12 /* 2.25x */, 0x14 /* 2.5x */, 0x16 /* 2.75x */,
734 0x18 /* 3x */, 0x1a /* 3.25x */, 0x1c /* 3.5x */, 0x1e /* 3.75x */,
735 0x30 /* 4x */, 0x31 /* 4.25x */, 0x32 /* 4.5x */, 0x33 /* 4.75x */,
736 0x34 /* 5x */, 0x35 /* 5.25x */, 0x36 /* 5.5x */, 0x37 /* 5.75x */,
737 0x38 /* 6x */, 0x39 /* 6.25x */, 0x3a /* 6.5x */, 0x3b /* 6.75x */,
738 0x3c /* 7x */, 0x3d /* 7.25x */, 0x3e /* 7.5x */, 0x3f /* 7.75x */,
739 0x70 /* 8x */
740};
741
742/* Gain = (bit[8] + 1) * (bit[7] + 1) * (bit[6:0] * 0.03125) */
743static u16 micron1_gain[] = {
744 /* 1x 1.25x 1.5x 1.75x */
745 0x0020, 0x0028, 0x0030, 0x0038,
746 /* 2x 2.25x 2.5x 2.75x */
747 0x00a0, 0x00a4, 0x00a8, 0x00ac,
748 /* 3x 3.25x 3.5x 3.75x */
749 0x00b0, 0x00b4, 0x00b8, 0x00bc,
750 /* 4x 4.25x 4.5x 4.75x */
751 0x00c0, 0x00c4, 0x00c8, 0x00cc,
752 /* 5x 5.25x 5.5x 5.75x */
753 0x00d0, 0x00d4, 0x00d8, 0x00dc,
754 /* 6x 6.25x 6.5x 6.75x */
755 0x00e0, 0x00e4, 0x00e8, 0x00ec,
756 /* 7x 7.25x 7.5x 7.75x */
757 0x00f0, 0x00f4, 0x00f8, 0x00fc,
758 /* 8x */
759 0x01c0
760};
761
762/* mt9m001 sensor uses a different gain formula then other micron sensors */
763/* Gain = (bit[6] + 1) * (bit[5-0] * 0.125) */
764static u16 micron2_gain[] = {
765 /* 1x 1.25x 1.5x 1.75x */
766 0x0008, 0x000a, 0x000c, 0x000e,
767 /* 2x 2.25x 2.5x 2.75x */
768 0x0010, 0x0012, 0x0014, 0x0016,
769 /* 3x 3.25x 3.5x 3.75x */
770 0x0018, 0x001a, 0x001c, 0x001e,
771 /* 4x 4.25x 4.5x 4.75x */
772 0x0020, 0x0051, 0x0052, 0x0053,
773 /* 5x 5.25x 5.5x 5.75x */
774 0x0054, 0x0055, 0x0056, 0x0057,
775 /* 6x 6.25x 6.5x 6.75x */
776 0x0058, 0x0059, 0x005a, 0x005b,
777 /* 7x 7.25x 7.5x 7.75x */
778 0x005c, 0x005d, 0x005e, 0x005f,
779 /* 8x */
780 0x0060
781};
782
783/* Gain = .5 + bit[7:0] / 16 */
784static u8 hv7131r_gain[] = {
785 0x08 /* 1x */, 0x0c /* 1.25x */, 0x10 /* 1.5x */, 0x14 /* 1.75x */,
786 0x18 /* 2x */, 0x1c /* 2.25x */, 0x20 /* 2.5x */, 0x24 /* 2.75x */,
787 0x28 /* 3x */, 0x2c /* 3.25x */, 0x30 /* 3.5x */, 0x34 /* 3.75x */,
788 0x38 /* 4x */, 0x3c /* 4.25x */, 0x40 /* 4.5x */, 0x44 /* 4.75x */,
789 0x48 /* 5x */, 0x4c /* 5.25x */, 0x50 /* 5.5x */, 0x54 /* 5.75x */,
790 0x58 /* 6x */, 0x5c /* 6.25x */, 0x60 /* 6.5x */, 0x64 /* 6.75x */,
791 0x68 /* 7x */, 0x6c /* 7.25x */, 0x70 /* 7.5x */, 0x74 /* 7.75x */,
792 0x78 /* 8x */
793};
794
795static u8 soi968_init[][2] = {
796 {0x12, 0x80}, {0x0c, 0x00}, {0x0f, 0x1f},
797 {0x11, 0x80}, {0x38, 0x52}, {0x1e, 0x00},
798 {0x33, 0x08}, {0x35, 0x8c}, {0x36, 0x0c},
799 {0x37, 0x04}, {0x45, 0x04}, {0x47, 0xff},
800 {0x3e, 0x00}, {0x3f, 0x00}, {0x3b, 0x20},
801 {0x3a, 0x96}, {0x3d, 0x0a}, {0x14, 0x8e},
802 {0x13, 0x8a}, {0x12, 0x40}, {0x17, 0x13},
803 {0x18, 0x63}, {0x19, 0x01}, {0x1a, 0x79},
804 {0x32, 0x24}, {0x03, 0x00}, {0x11, 0x40},
805 {0x2a, 0x10}, {0x2b, 0xe0}, {0x10, 0x32},
806 {0x00, 0x00}, {0x01, 0x80}, {0x02, 0x80},
807};
808
809static u8 ov7660_init[][2] = {
810 {0x0e, 0x80}, {0x0d, 0x08}, {0x0f, 0xc3},
811 {0x04, 0xc3}, {0x10, 0x40}, {0x11, 0x40},
812 {0x12, 0x05}, {0x13, 0xba}, {0x14, 0x2a},
813 {0x37, 0x0f}, {0x38, 0x02}, {0x39, 0x43},
814 {0x3a, 0x00}, {0x69, 0x90}, {0x2d, 0xf6},
815 {0x2e, 0x0b}, {0x01, 0x78}, {0x02, 0x50},
816};
817
818static u8 ov7670_init[][2] = {
819 {0x12, 0x80}, {0x11, 0x80}, {0x3a, 0x04}, {0x12, 0x01},
820 {0x32, 0xb6}, {0x03, 0x0a}, {0x0c, 0x00}, {0x3e, 0x00},
821 {0x70, 0x3a}, {0x71, 0x35}, {0x72, 0x11}, {0x73, 0xf0},
822 {0xa2, 0x02}, {0x13, 0xe0}, {0x00, 0x00}, {0x10, 0x00},
823 {0x0d, 0x40}, {0x14, 0x28}, {0xa5, 0x05}, {0xab, 0x07},
824 {0x24, 0x95}, {0x25, 0x33}, {0x26, 0xe3}, {0x9f, 0x75},
825 {0xa0, 0x65}, {0xa1, 0x0b}, {0xa6, 0xd8}, {0xa7, 0xd8},
826 {0xa8, 0xf0}, {0xa9, 0x90}, {0xaa, 0x94}, {0x13, 0xe5},
827 {0x0e, 0x61}, {0x0f, 0x4b}, {0x16, 0x02}, {0x1e, 0x27},
828 {0x21, 0x02}, {0x22, 0x91}, {0x29, 0x07}, {0x33, 0x0b},
829 {0x35, 0x0b}, {0x37, 0x1d}, {0x38, 0x71}, {0x39, 0x2a},
830 {0x3c, 0x78}, {0x4d, 0x40}, {0x4e, 0x20}, {0x69, 0x00},
831 {0x74, 0x19}, {0x8d, 0x4f}, {0x8e, 0x00}, {0x8f, 0x00},
832 {0x90, 0x00}, {0x91, 0x00}, {0x96, 0x00}, {0x9a, 0x80},
833 {0xb0, 0x84}, {0xb1, 0x0c}, {0xb2, 0x0e}, {0xb3, 0x82},
834 {0xb8, 0x0a}, {0x43, 0x0a}, {0x44, 0xf0}, {0x45, 0x20},
835 {0x46, 0x7d}, {0x47, 0x29}, {0x48, 0x4a}, {0x59, 0x8c},
836 {0x5a, 0xa5}, {0x5b, 0xde}, {0x5c, 0x96}, {0x5d, 0x66},
837 {0x5e, 0x10}, {0x6c, 0x0a}, {0x6d, 0x55}, {0x6e, 0x11},
838 {0x6f, 0x9e}, {0x6a, 0x40}, {0x01, 0x40}, {0x02, 0x40},
839 {0x13, 0xe7}, {0x4f, 0x6e}, {0x50, 0x70}, {0x51, 0x02},
840 {0x52, 0x1d}, {0x53, 0x56}, {0x54, 0x73}, {0x55, 0x0a},
841 {0x56, 0x55}, {0x57, 0x80}, {0x58, 0x9e}, {0x41, 0x08},
842 {0x3f, 0x02}, {0x75, 0x03}, {0x76, 0x63}, {0x4c, 0x04},
843 {0x77, 0x06}, {0x3d, 0x02}, {0x4b, 0x09}, {0xc9, 0x30},
844 {0x41, 0x08}, {0x56, 0x48}, {0x34, 0x11}, {0xa4, 0x88},
845 {0x96, 0x00}, {0x97, 0x30}, {0x98, 0x20}, {0x99, 0x30},
846 {0x9a, 0x84}, {0x9b, 0x29}, {0x9c, 0x03}, {0x9d, 0x99},
847 {0x9e, 0x7f}, {0x78, 0x04}, {0x79, 0x01}, {0xc8, 0xf0},
848 {0x79, 0x0f}, {0xc8, 0x00}, {0x79, 0x10}, {0xc8, 0x7e},
849 {0x79, 0x0a}, {0xc8, 0x80}, {0x79, 0x0b}, {0xc8, 0x01},
850 {0x79, 0x0c}, {0xc8, 0x0f}, {0x79, 0x0d}, {0xc8, 0x20},
851 {0x79, 0x09}, {0xc8, 0x80}, {0x79, 0x02}, {0xc8, 0xc0},
852 {0x79, 0x03}, {0xc8, 0x40}, {0x79, 0x05}, {0xc8, 0x30},
853 {0x79, 0x26}, {0x62, 0x20}, {0x63, 0x00}, {0x64, 0x06},
854 {0x65, 0x00}, {0x66, 0x05}, {0x94, 0x05}, {0x95, 0x0a},
855 {0x17, 0x13}, {0x18, 0x01}, {0x19, 0x02}, {0x1a, 0x7a},
856 {0x46, 0x59}, {0x47, 0x30}, {0x58, 0x9a}, {0x59, 0x84},
857 {0x5a, 0x91}, {0x5b, 0x57}, {0x5c, 0x75}, {0x5d, 0x6d},
858 {0x5e, 0x13}, {0x64, 0x07}, {0x94, 0x07}, {0x95, 0x0d},
859 {0xa6, 0xdf}, {0xa7, 0xdf}, {0x48, 0x4d}, {0x51, 0x00},
860 {0x6b, 0x0a}, {0x11, 0x80}, {0x2a, 0x00}, {0x2b, 0x00},
861 {0x92, 0x00}, {0x93, 0x00}, {0x55, 0x0a}, {0x56, 0x60},
862 {0x4f, 0x6e}, {0x50, 0x70}, {0x51, 0x00}, {0x52, 0x1d},
863 {0x53, 0x56}, {0x54, 0x73}, {0x58, 0x9a}, {0x4f, 0x6e},
864 {0x50, 0x70}, {0x51, 0x00}, {0x52, 0x1d}, {0x53, 0x56},
865 {0x54, 0x73}, {0x58, 0x9a}, {0x3f, 0x01}, {0x7b, 0x03},
866 {0x7c, 0x09}, {0x7d, 0x16}, {0x7e, 0x38}, {0x7f, 0x47},
867 {0x80, 0x53}, {0x81, 0x5e}, {0x82, 0x6a}, {0x83, 0x74},
868 {0x84, 0x80}, {0x85, 0x8c}, {0x86, 0x9b}, {0x87, 0xb2},
869 {0x88, 0xcc}, {0x89, 0xe5}, {0x7a, 0x24}, {0x3b, 0x00},
870 {0x9f, 0x76}, {0xa0, 0x65}, {0x13, 0xe2}, {0x6b, 0x0a},
871 {0x11, 0x80}, {0x2a, 0x00}, {0x2b, 0x00}, {0x92, 0x00},
872 {0x93, 0x00},
873};
874
875static u8 ov9650_init[][2] = {
876 {0x12, 0x80}, {0x00, 0x00}, {0x01, 0x78},
877 {0x02, 0x78}, {0x03, 0x36}, {0x04, 0x03},
878 {0x05, 0x00}, {0x06, 0x00}, {0x08, 0x00},
879 {0x09, 0x01}, {0x0c, 0x00}, {0x0d, 0x00},
880 {0x0e, 0xa0}, {0x0f, 0x52}, {0x10, 0x7c},
881 {0x11, 0x80}, {0x12, 0x45}, {0x13, 0xc2},
882 {0x14, 0x2e}, {0x15, 0x00}, {0x16, 0x07},
883 {0x17, 0x24}, {0x18, 0xc5}, {0x19, 0x00},
884 {0x1a, 0x3c}, {0x1b, 0x00}, {0x1e, 0x04},
885 {0x1f, 0x00}, {0x24, 0x78}, {0x25, 0x68},
886 {0x26, 0xd4}, {0x27, 0x80}, {0x28, 0x80},
887 {0x29, 0x30}, {0x2a, 0x00}, {0x2b, 0x00},
888 {0x2c, 0x80}, {0x2d, 0x00}, {0x2e, 0x00},
889 {0x2f, 0x00}, {0x30, 0x08}, {0x31, 0x30},
890 {0x32, 0x84}, {0x33, 0xe2}, {0x34, 0xbf},
891 {0x35, 0x81}, {0x36, 0xf9}, {0x37, 0x00},
892 {0x38, 0x93}, {0x39, 0x50}, {0x3a, 0x01},
893 {0x3b, 0x01}, {0x3c, 0x73}, {0x3d, 0x19},
894 {0x3e, 0x0b}, {0x3f, 0x80}, {0x40, 0xc1},
895 {0x41, 0x00}, {0x42, 0x08}, {0x67, 0x80},
896 {0x68, 0x80}, {0x69, 0x40}, {0x6a, 0x00},
897 {0x6b, 0x0a}, {0x8b, 0x06}, {0x8c, 0x20},
898 {0x8d, 0x00}, {0x8e, 0x00}, {0x8f, 0xdf},
899 {0x92, 0x00}, {0x93, 0x00}, {0x94, 0x88},
900 {0x95, 0x88}, {0x96, 0x04}, {0xa1, 0x00},
901 {0xa5, 0x80}, {0xa8, 0x80}, {0xa9, 0xb8},
902 {0xaa, 0x92}, {0xab, 0x0a},
903};
904
905static u8 ov9655_init[][2] = {
906 {0x12, 0x80}, {0x12, 0x01}, {0x0d, 0x00}, {0x0e, 0x61},
907 {0x11, 0x80}, {0x13, 0xba}, {0x14, 0x2e}, {0x16, 0x24},
908 {0x1e, 0x04}, {0x1e, 0x04}, {0x1e, 0x04}, {0x27, 0x08},
909 {0x28, 0x08}, {0x29, 0x15}, {0x2c, 0x08}, {0x32, 0xbf},
910 {0x34, 0x3d}, {0x35, 0x00}, {0x36, 0xf8}, {0x38, 0x12},
911 {0x39, 0x57}, {0x3a, 0x00}, {0x3b, 0xcc}, {0x3c, 0x0c},
912 {0x3d, 0x19}, {0x3e, 0x0c}, {0x3f, 0x01}, {0x41, 0x40},
913 {0x42, 0x80}, {0x45, 0x46}, {0x46, 0x62}, {0x47, 0x2a},
914 {0x48, 0x3c}, {0x4a, 0xf0}, {0x4b, 0xdc}, {0x4c, 0xdc},
915 {0x4d, 0xdc}, {0x4e, 0xdc}, {0x69, 0x02}, {0x6c, 0x04},
916 {0x6f, 0x9e}, {0x70, 0x05}, {0x71, 0x78}, {0x77, 0x02},
917 {0x8a, 0x23}, {0x8c, 0x0d}, {0x90, 0x7e}, {0x91, 0x7c},
918 {0x9f, 0x6e}, {0xa0, 0x6e}, {0xa5, 0x68}, {0xa6, 0x60},
919 {0xa8, 0xc1}, {0xa9, 0xfa}, {0xaa, 0x92}, {0xab, 0x04},
920 {0xac, 0x80}, {0xad, 0x80}, {0xae, 0x80}, {0xaf, 0x80},
921 {0xb2, 0xf2}, {0xb3, 0x20}, {0xb5, 0x00}, {0xb6, 0xaf},
922 {0xbb, 0xae}, {0xbc, 0x44}, {0xbd, 0x44}, {0xbe, 0x3b},
923 {0xbf, 0x3a}, {0xc0, 0xe2}, {0xc1, 0xc8}, {0xc2, 0x01},
924 {0xc4, 0x00}, {0xc6, 0x85}, {0xc7, 0x81}, {0xc9, 0xe0},
925 {0xca, 0xe8}, {0xcc, 0xd8}, {0xcd, 0x93}, {0x12, 0x61},
926 {0x36, 0xfa}, {0x8c, 0x8d}, {0xc0, 0xaa}, {0x69, 0x0a},
927 {0x03, 0x12}, {0x17, 0x14}, {0x18, 0x00}, {0x19, 0x01},
928 {0x1a, 0x3d}, {0x32, 0xbf}, {0x11, 0x80}, {0x2a, 0x10},
929 {0x2b, 0x0a}, {0x92, 0x00}, {0x93, 0x00}, {0x1e, 0x04},
930 {0x1e, 0x04}, {0x10, 0x7c}, {0x04, 0x03}, {0xa1, 0x00},
931 {0x2d, 0x00}, {0x2e, 0x00}, {0x00, 0x00}, {0x01, 0x80},
932 {0x02, 0x80}, {0x12, 0x61}, {0x36, 0xfa}, {0x8c, 0x8d},
933 {0xc0, 0xaa}, {0x69, 0x0a}, {0x03, 0x12}, {0x17, 0x14},
934 {0x18, 0x00}, {0x19, 0x01}, {0x1a, 0x3d}, {0x32, 0xbf},
935 {0x11, 0x80}, {0x2a, 0x10}, {0x2b, 0x0a}, {0x92, 0x00},
936 {0x93, 0x00}, {0x04, 0x01}, {0x10, 0x1f}, {0xa1, 0x00},
937 {0x00, 0x0a}, {0xa1, 0x00}, {0x10, 0x5d}, {0x04, 0x03},
938 {0x00, 0x01}, {0xa1, 0x00}, {0x10, 0x7c}, {0x04, 0x03},
939 {0x00, 0x03}, {0x00, 0x0a}, {0x00, 0x10}, {0x00, 0x13},
940};
941
942static u16 mt9v112_init[][2] = {
943 {0xf0, 0x0000}, {0x0d, 0x0021}, {0x0d, 0x0020},
944 {0x34, 0xc019}, {0x0a, 0x0011}, {0x0b, 0x000b},
945 {0x20, 0x0703}, {0x35, 0x2022}, {0xf0, 0x0001},
946 {0x05, 0x0000}, {0x06, 0x340c}, {0x3b, 0x042a},
947 {0x3c, 0x0400}, {0xf0, 0x0002}, {0x2e, 0x0c58},
948 {0x5b, 0x0001}, {0xc8, 0x9f0b}, {0xf0, 0x0001},
949 {0x9b, 0x5300}, {0xf0, 0x0000}, {0x2b, 0x0020},
950 {0x2c, 0x002a}, {0x2d, 0x0032}, {0x2e, 0x0020},
951 {0x09, 0x01dc}, {0x01, 0x000c}, {0x02, 0x0020},
952 {0x03, 0x01e0}, {0x04, 0x0280}, {0x06, 0x000c},
953 {0x05, 0x0098}, {0x20, 0x0703}, {0x09, 0x01f2},
954 {0x2b, 0x00a0}, {0x2c, 0x00a0}, {0x2d, 0x00a0},
955 {0x2e, 0x00a0}, {0x01, 0x000c}, {0x02, 0x0020},
956 {0x03, 0x01e0}, {0x04, 0x0280}, {0x06, 0x000c},
957 {0x05, 0x0098}, {0x09, 0x01c1}, {0x2b, 0x00ae},
958 {0x2c, 0x00ae}, {0x2d, 0x00ae}, {0x2e, 0x00ae},
959};
960
961static u16 mt9v111_init[][2] = {
962 {0x01, 0x0004}, {0x0d, 0x0001}, {0x0d, 0x0000},
963 {0x01, 0x0001}, {0x02, 0x0016}, {0x03, 0x01e1},
964 {0x04, 0x0281}, {0x05, 0x0004}, {0x07, 0x3002},
965 {0x21, 0x0000}, {0x25, 0x4024}, {0x26, 0xff03},
966 {0x27, 0xff10}, {0x2b, 0x7828}, {0x2c, 0xb43c},
967 {0x2d, 0xf0a0}, {0x2e, 0x0c64}, {0x2f, 0x0064},
968 {0x67, 0x4010}, {0x06, 0x301e}, {0x08, 0x0480},
969 {0x01, 0x0004}, {0x02, 0x0016}, {0x03, 0x01e6},
970 {0x04, 0x0286}, {0x05, 0x0004}, {0x06, 0x0000},
971 {0x07, 0x3002}, {0x08, 0x0008}, {0x0c, 0x0000},
972 {0x0d, 0x0000}, {0x0e, 0x0000}, {0x0f, 0x0000},
973 {0x10, 0x0000}, {0x11, 0x0000}, {0x12, 0x00b0},
974 {0x13, 0x007c}, {0x14, 0x0000}, {0x15, 0x0000},
975 {0x16, 0x0000}, {0x17, 0x0000}, {0x18, 0x0000},
976 {0x19, 0x0000}, {0x1a, 0x0000}, {0x1b, 0x0000},
977 {0x1c, 0x0000}, {0x1d, 0x0000}, {0x30, 0x0000},
978 {0x30, 0x0005}, {0x31, 0x0000}, {0x02, 0x0016},
979 {0x03, 0x01e1}, {0x04, 0x0281}, {0x05, 0x0004},
980 {0x06, 0x0000}, {0x07, 0x3002}, {0x06, 0x002d},
981 {0x05, 0x0004}, {0x09, 0x0064}, {0x2b, 0x00a0},
982 {0x2c, 0x00a0}, {0x2d, 0x00a0}, {0x2e, 0x00a0},
983 {0x02, 0x0016}, {0x03, 0x01e1}, {0x04, 0x0281},
984 {0x05, 0x0004}, {0x06, 0x002d}, {0x07, 0x3002},
985 {0x0e, 0x0008}, {0x06, 0x002d}, {0x05, 0x0004},
986};
987
988static u16 mt9v011_init[][2] = {
989 {0x07, 0x0002}, {0x0d, 0x0001}, {0x0d, 0x0000},
990 {0x01, 0x0008}, {0x02, 0x0016}, {0x03, 0x01e1},
991 {0x04, 0x0281}, {0x05, 0x0083}, {0x06, 0x0006},
992 {0x0d, 0x0002}, {0x0a, 0x0000}, {0x0b, 0x0000},
993 {0x0c, 0x0000}, {0x0d, 0x0000}, {0x0e, 0x0000},
994 {0x0f, 0x0000}, {0x10, 0x0000}, {0x11, 0x0000},
995 {0x12, 0x0000}, {0x13, 0x0000}, {0x14, 0x0000},
996 {0x15, 0x0000}, {0x16, 0x0000}, {0x17, 0x0000},
997 {0x18, 0x0000}, {0x19, 0x0000}, {0x1a, 0x0000},
998 {0x1b, 0x0000}, {0x1c, 0x0000}, {0x1d, 0x0000},
999 {0x32, 0x0000}, {0x20, 0x1101}, {0x21, 0x0000},
1000 {0x22, 0x0000}, {0x23, 0x0000}, {0x24, 0x0000},
1001 {0x25, 0x0000}, {0x26, 0x0000}, {0x27, 0x0024},
1002 {0x2f, 0xf7b0}, {0x30, 0x0005}, {0x31, 0x0000},
1003 {0x32, 0x0000}, {0x33, 0x0000}, {0x34, 0x0100},
1004 {0x3d, 0x068f}, {0x40, 0x01e0}, {0x41, 0x00d1},
1005 {0x44, 0x0082}, {0x5a, 0x0000}, {0x5b, 0x0000},
1006 {0x5c, 0x0000}, {0x5d, 0x0000}, {0x5e, 0x0000},
1007 {0x5f, 0xa31d}, {0x62, 0x0611}, {0x0a, 0x0000},
1008 {0x06, 0x0029}, {0x05, 0x0009}, {0x20, 0x1101},
1009 {0x20, 0x1101}, {0x09, 0x0064}, {0x07, 0x0003},
1010 {0x2b, 0x0033}, {0x2c, 0x00a0}, {0x2d, 0x00a0},
1011 {0x2e, 0x0033}, {0x07, 0x0002}, {0x06, 0x0000},
1012 {0x06, 0x0029}, {0x05, 0x0009},
1013};
1014
1015static u16 mt9m001_init[][2] = {
1016 {0x0d, 0x0001}, {0x0d, 0x0000}, {0x01, 0x000e},
1017 {0x02, 0x0014}, {0x03, 0x03c1}, {0x04, 0x0501},
1018 {0x05, 0x0083}, {0x06, 0x0006}, {0x0d, 0x0002},
1019 {0x0a, 0x0000}, {0x0c, 0x0000}, {0x11, 0x0000},
1020 {0x1e, 0x8000}, {0x5f, 0x8904}, {0x60, 0x0000},
1021 {0x61, 0x0000}, {0x62, 0x0498}, {0x63, 0x0000},
1022 {0x64, 0x0000}, {0x20, 0x111d}, {0x06, 0x00f2},
1023 {0x05, 0x0013}, {0x09, 0x10f2}, {0x07, 0x0003},
1024 {0x2b, 0x002a}, {0x2d, 0x002a}, {0x2c, 0x002a},
1025 {0x2e, 0x0029}, {0x07, 0x0002},
1026};
1027
1028static u16 mt9m111_init[][2] = {
1029 {0xf0, 0x0000}, {0x0d, 0x0008}, {0x0d, 0x0009},
1030 {0x0d, 0x0008}, {0xf0, 0x0001}, {0x3a, 0x4300},
1031 {0x9b, 0x4300}, {0xa1, 0x0280}, {0xa4, 0x0200},
1032 {0x06, 0x308e}, {0xf0, 0x0000},
1033};
1034
1035static u8 hv7131r_init[][2] = {
1036 {0x02, 0x08}, {0x02, 0x00}, {0x01, 0x08},
1037 {0x02, 0x00}, {0x20, 0x00}, {0x21, 0xd0},
1038 {0x22, 0x00}, {0x23, 0x09}, {0x01, 0x08},
1039 {0x01, 0x08}, {0x01, 0x08}, {0x25, 0x07},
1040 {0x26, 0xc3}, {0x27, 0x50}, {0x30, 0x62},
1041 {0x31, 0x10}, {0x32, 0x06}, {0x33, 0x10},
1042 {0x20, 0x00}, {0x21, 0xd0}, {0x22, 0x00},
1043 {0x23, 0x09}, {0x01, 0x08},
1044};
1045
1046int reg_r(struct gspca_dev *gspca_dev, u16 reg, u16 length)
1047{
1048 struct usb_device *dev = gspca_dev->dev;
1049 int result;
1050 result = usb_control_msg(dev, usb_rcvctrlpipe(dev, 0),
1051 0x00,
1052 USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_INTERFACE,
1053 reg,
1054 0x00,
1055 gspca_dev->usb_buf,
1056 length,
1057 500);
1058 if (unlikely(result < 0 || result != length)) {
1059 err("Read register failed 0x%02X", reg);
1060 return -EIO;
1061 }
1062 return 0;
1063}
1064
1065int reg_w(struct gspca_dev *gspca_dev, u16 reg, const u8 *buffer, int length)
1066{
1067 struct usb_device *dev = gspca_dev->dev;
1068 int result;
1069 memcpy(gspca_dev->usb_buf, buffer, length);
1070 result = usb_control_msg(dev, usb_sndctrlpipe(dev, 0),
1071 0x08,
1072 USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_INTERFACE,
1073 reg,
1074 0x00,
1075 gspca_dev->usb_buf,
1076 length,
1077 500);
1078 if (unlikely(result < 0 || result != length)) {
1079 err("Write register failed index 0x%02X", reg);
1080 return -EIO;
1081 }
1082 return 0;
1083}
1084
1085int reg_w1(struct gspca_dev *gspca_dev, u16 reg, const u8 value)
1086{
1087 u8 data[1] = {value};
1088 return reg_w(gspca_dev, reg, data, 1);
1089}
1090
1091int i2c_w(struct gspca_dev *gspca_dev, const u8 *buffer)
1092{
1093 int i;
1094 reg_w(gspca_dev, 0x10c0, buffer, 8);
1095 for (i = 0; i < 5; i++) {
1096 reg_r(gspca_dev, 0x10c0, 1);
1097 if (gspca_dev->usb_buf[0] & 0x04) {
1098 if (gspca_dev->usb_buf[0] & 0x08)
1099 return -1;
1100 return 0;
1101 }
1102 msleep(1);
1103 }
1104 return -1;
1105}
1106
1107int i2c_w1(struct gspca_dev *gspca_dev, u8 reg, u8 val)
1108{
1109 struct sd *sd = (struct sd *) gspca_dev;
1110
1111 u8 row[8];
1112
1113 /*
1114 * from the point of view of the bridge, the length
1115 * includes the address
1116 */
1117 row[0] = 0x81 | (2 << 4);
1118 row[1] = sd->i2c_addr;
1119 row[2] = reg;
1120 row[3] = val;
1121 row[4] = 0x00;
1122 row[5] = 0x00;
1123 row[6] = 0x00;
1124 row[7] = 0x10;
1125
1126 return i2c_w(gspca_dev, row);
1127}
1128
1129int i2c_w2(struct gspca_dev *gspca_dev, u8 reg, u16 val)
1130{
1131 struct sd *sd = (struct sd *) gspca_dev;
1132 u8 row[8];
1133
1134 /*
1135 * from the point of view of the bridge, the length
1136 * includes the address
1137 */
1138 row[0] = 0x81 | (3 << 4);
1139 row[1] = sd->i2c_addr;
1140 row[2] = reg;
1141 row[3] = (val >> 8) & 0xff;
1142 row[4] = val & 0xff;
1143 row[5] = 0x00;
1144 row[6] = 0x00;
1145 row[7] = 0x10;
1146
1147 return i2c_w(gspca_dev, row);
1148}
1149
1150int i2c_r1(struct gspca_dev *gspca_dev, u8 reg, u8 *val)
1151{
1152 struct sd *sd = (struct sd *) gspca_dev;
1153 u8 row[8];
1154
1155 row[0] = 0x81 | 0x10;
1156 row[1] = sd->i2c_addr;
1157 row[2] = reg;
1158 row[3] = 0;
1159 row[4] = 0;
1160 row[5] = 0;
1161 row[6] = 0;
1162 row[7] = 0x10;
1163 reg_w(gspca_dev, 0x10c0, row, 8);
1164 msleep(1);
1165 row[0] = 0x81 | (2 << 4) | 0x02;
1166 row[2] = 0;
1167 reg_w(gspca_dev, 0x10c0, row, 8);
1168 msleep(1);
1169 reg_r(gspca_dev, 0x10c2, 5);
1170 *val = gspca_dev->usb_buf[3];
1171 return 0;
1172}
1173
1174int i2c_r2(struct gspca_dev *gspca_dev, u8 reg, u16 *val)
1175{
1176 struct sd *sd = (struct sd *) gspca_dev;
1177 u8 row[8];
1178
1179 row[0] = 0x81 | 0x10;
1180 row[1] = sd->i2c_addr;
1181 row[2] = reg;
1182 row[3] = 0;
1183 row[4] = 0;
1184 row[5] = 0;
1185 row[6] = 0;
1186 row[7] = 0x10;
1187 reg_w(gspca_dev, 0x10c0, row, 8);
1188 msleep(1);
1189 row[0] = 0x81 | (3 << 4) | 0x02;
1190 row[2] = 0;
1191 reg_w(gspca_dev, 0x10c0, row, 8);
1192 msleep(1);
1193 reg_r(gspca_dev, 0x10c2, 5);
1194 *val = (gspca_dev->usb_buf[2] << 8) | gspca_dev->usb_buf[3];
1195 return 0;
1196}
1197
1198static int ov9650_init_sensor(struct gspca_dev *gspca_dev)
1199{
1200 int i;
1201 struct sd *sd = (struct sd *) gspca_dev;
1202
1203 for (i = 0; i < ARRAY_SIZE(ov9650_init); i++) {
1204 if (i2c_w1(gspca_dev, ov9650_init[i][0],
1205 ov9650_init[i][1]) < 0) {
1206 err("OV9650 sensor initialization failed");
1207 return -ENODEV;
1208 }
1209 }
1210 sd->hstart = 1;
1211 sd->vstart = 7;
1212 return 0;
1213}
1214
1215static int ov9655_init_sensor(struct gspca_dev *gspca_dev)
1216{
1217 int i;
1218 struct sd *sd = (struct sd *) gspca_dev;
1219
1220 for (i = 0; i < ARRAY_SIZE(ov9655_init); i++) {
1221 if (i2c_w1(gspca_dev, ov9655_init[i][0],
1222 ov9655_init[i][1]) < 0) {
1223 err("OV9655 sensor initialization failed");
1224 return -ENODEV;
1225 }
1226 }
1227 /* disable hflip and vflip */
1228 gspca_dev->ctrl_dis = (1 << HFLIP_IDX) | (1 << VFLIP_IDX);
1229 sd->hstart = 0;
1230 sd->vstart = 7;
1231 return 0;
1232}
1233
1234static int soi968_init_sensor(struct gspca_dev *gspca_dev)
1235{
1236 int i;
1237 struct sd *sd = (struct sd *) gspca_dev;
1238
1239 for (i = 0; i < ARRAY_SIZE(soi968_init); i++) {
1240 if (i2c_w1(gspca_dev, soi968_init[i][0],
1241 soi968_init[i][1]) < 0) {
1242 err("SOI968 sensor initialization failed");
1243 return -ENODEV;
1244 }
1245 }
1246 /* disable hflip and vflip */
1247 gspca_dev->ctrl_dis = (1 << HFLIP_IDX) | (1 << VFLIP_IDX);
1248 sd->hstart = 60;
1249 sd->vstart = 11;
1250 return 0;
1251}
1252
1253static int ov7660_init_sensor(struct gspca_dev *gspca_dev)
1254{
1255 int i;
1256 struct sd *sd = (struct sd *) gspca_dev;
1257
1258 for (i = 0; i < ARRAY_SIZE(ov7660_init); i++) {
1259 if (i2c_w1(gspca_dev, ov7660_init[i][0],
1260 ov7660_init[i][1]) < 0) {
1261 err("OV7660 sensor initialization failed");
1262 return -ENODEV;
1263 }
1264 }
1265 /* disable hflip and vflip */
1266 gspca_dev->ctrl_dis = (1 << HFLIP_IDX) | (1 << VFLIP_IDX);
1267 sd->hstart = 1;
1268 sd->vstart = 1;
1269 return 0;
1270}
1271
1272static int ov7670_init_sensor(struct gspca_dev *gspca_dev)
1273{
1274 int i;
1275 struct sd *sd = (struct sd *) gspca_dev;
1276
1277 for (i = 0; i < ARRAY_SIZE(ov7670_init); i++) {
1278 if (i2c_w1(gspca_dev, ov7670_init[i][0],
1279 ov7670_init[i][1]) < 0) {
1280 err("OV7670 sensor initialization failed");
1281 return -ENODEV;
1282 }
1283 }
1284 /* disable hflip and vflip */
1285 gspca_dev->ctrl_dis = (1 << HFLIP_IDX) | (1 << VFLIP_IDX);
1286 sd->hstart = 0;
1287 sd->vstart = 1;
1288 return 0;
1289}
1290
1291static int mt9v_init_sensor(struct gspca_dev *gspca_dev)
1292{
1293 struct sd *sd = (struct sd *) gspca_dev;
1294 int i;
1295 u16 value;
1296 int ret;
1297
1298 sd->i2c_addr = 0x5d;
1299 ret = i2c_r2(gspca_dev, 0xff, &value);
1300 if ((ret == 0) && (value == 0x8243)) {
1301 for (i = 0; i < ARRAY_SIZE(mt9v011_init); i++) {
1302 if (i2c_w2(gspca_dev, mt9v011_init[i][0],
1303 mt9v011_init[i][1]) < 0) {
1304 err("MT9V011 sensor initialization failed");
1305 return -ENODEV;
1306 }
1307 }
1308 sd->hstart = 2;
1309 sd->vstart = 2;
1310 sd->sensor = SENSOR_MT9V011;
1311 info("MT9V011 sensor detected");
1312 return 0;
1313 }
1314
1315 sd->i2c_addr = 0x5c;
1316 i2c_w2(gspca_dev, 0x01, 0x0004);
1317 ret = i2c_r2(gspca_dev, 0xff, &value);
1318 if ((ret == 0) && (value == 0x823a)) {
1319 for (i = 0; i < ARRAY_SIZE(mt9v111_init); i++) {
1320 if (i2c_w2(gspca_dev, mt9v111_init[i][0],
1321 mt9v111_init[i][1]) < 0) {
1322 err("MT9V111 sensor initialization failed");
1323 return -ENODEV;
1324 }
1325 }
1326 sd->hstart = 2;
1327 sd->vstart = 2;
1328 sd->sensor = SENSOR_MT9V111;
1329 info("MT9V111 sensor detected");
1330 return 0;
1331 }
1332
1333 sd->i2c_addr = 0x5d;
1334 ret = i2c_w2(gspca_dev, 0xf0, 0x0000);
1335 if (ret < 0) {
1336 sd->i2c_addr = 0x48;
1337 i2c_w2(gspca_dev, 0xf0, 0x0000);
1338 }
1339 ret = i2c_r2(gspca_dev, 0x00, &value);
1340 if ((ret == 0) && (value == 0x1229)) {
1341 for (i = 0; i < ARRAY_SIZE(mt9v112_init); i++) {
1342 if (i2c_w2(gspca_dev, mt9v112_init[i][0],
1343 mt9v112_init[i][1]) < 0) {
1344 err("MT9V112 sensor initialization failed");
1345 return -ENODEV;
1346 }
1347 }
1348 sd->hstart = 6;
1349 sd->vstart = 2;
1350 sd->sensor = SENSOR_MT9V112;
1351 info("MT9V112 sensor detected");
1352 return 0;
1353 }
1354
1355 return -ENODEV;
1356}
1357
1358static int mt9m111_init_sensor(struct gspca_dev *gspca_dev)
1359{
1360 struct sd *sd = (struct sd *) gspca_dev;
1361 int i;
1362 for (i = 0; i < ARRAY_SIZE(mt9m111_init); i++) {
1363 if (i2c_w2(gspca_dev, mt9m111_init[i][0],
1364 mt9m111_init[i][1]) < 0) {
1365 err("MT9M111 sensor initialization failed");
1366 return -ENODEV;
1367 }
1368 }
1369 sd->hstart = 0;
1370 sd->vstart = 2;
1371 return 0;
1372}
1373
1374static int mt9m001_init_sensor(struct gspca_dev *gspca_dev)
1375{
1376 struct sd *sd = (struct sd *) gspca_dev;
1377 int i;
1378 for (i = 0; i < ARRAY_SIZE(mt9m001_init); i++) {
1379 if (i2c_w2(gspca_dev, mt9m001_init[i][0],
1380 mt9m001_init[i][1]) < 0) {
1381 err("MT9M001 sensor initialization failed");
1382 return -ENODEV;
1383 }
1384 }
1385 /* disable hflip and vflip */
1386 gspca_dev->ctrl_dis = (1 << HFLIP_IDX) | (1 << VFLIP_IDX);
1387 sd->hstart = 2;
1388 sd->vstart = 2;
1389 return 0;
1390}
1391
1392static int hv7131r_init_sensor(struct gspca_dev *gspca_dev)
1393{
1394 int i;
1395 struct sd *sd = (struct sd *) gspca_dev;
1396
1397 for (i = 0; i < ARRAY_SIZE(hv7131r_init); i++) {
1398 if (i2c_w1(gspca_dev, hv7131r_init[i][0],
1399 hv7131r_init[i][1]) < 0) {
1400 err("HV7131R Sensor initialization failed");
1401 return -ENODEV;
1402 }
1403 }
1404 sd->hstart = 0;
1405 sd->vstart = 1;
1406 return 0;
1407}
1408
1409#ifdef CONFIG_USB_GSPCA_SN9C20X_EVDEV
1410static int input_kthread(void *data)
1411{
1412 struct gspca_dev *gspca_dev = (struct gspca_dev *)data;
1413 struct sd *sd = (struct sd *) gspca_dev;
1414
1415 DECLARE_WAIT_QUEUE_HEAD(wait);
1416 set_freezable();
1417 for (;;) {
1418 if (kthread_should_stop())
1419 break;
1420
1421 if (reg_r(gspca_dev, 0x1005, 1) < 0)
1422 continue;
1423
1424 input_report_key(sd->input_dev,
1425 KEY_CAMERA,
1426 gspca_dev->usb_buf[0] & sd->input_gpio);
1427 input_sync(sd->input_dev);
1428
1429 wait_event_freezable_timeout(wait,
1430 kthread_should_stop(),
1431 msecs_to_jiffies(100));
1432 }
1433 return 0;
1434}
1435
1436
1437static int sn9c20x_input_init(struct gspca_dev *gspca_dev)
1438{
1439 struct sd *sd = (struct sd *) gspca_dev;
1440 if (sd->input_gpio == 0)
1441 return 0;
1442
1443 sd->input_dev = input_allocate_device();
1444 if (!sd->input_dev)
1445 return -ENOMEM;
1446
1447 sd->input_dev->name = "SN9C20X Webcam";
1448
1449 sd->input_dev->phys = kasprintf(GFP_KERNEL, "usb-%s-%s",
1450 gspca_dev->dev->bus->bus_name,
1451 gspca_dev->dev->devpath);
1452
1453 if (!sd->input_dev->phys)
1454 return -ENOMEM;
1455
1456 usb_to_input_id(gspca_dev->dev, &sd->input_dev->id);
1457 sd->input_dev->dev.parent = &gspca_dev->dev->dev;
1458
1459 set_bit(EV_KEY, sd->input_dev->evbit);
1460 set_bit(KEY_CAMERA, sd->input_dev->keybit);
1461
1462 if (input_register_device(sd->input_dev))
1463 return -EINVAL;
1464
1465 sd->input_task = kthread_run(input_kthread, gspca_dev, "sn9c20x/%d",
1466 gspca_dev->vdev.minor);
1467
1468 if (IS_ERR(sd->input_task))
1469 return -EINVAL;
1470
1471 return 0;
1472}
1473
1474static void sn9c20x_input_cleanup(struct gspca_dev *gspca_dev)
1475{
1476 struct sd *sd = (struct sd *) gspca_dev;
1477 if (sd->input_task != NULL && !IS_ERR(sd->input_task))
1478 kthread_stop(sd->input_task);
1479
1480 if (sd->input_dev != NULL) {
1481 input_unregister_device(sd->input_dev);
1482 kfree(sd->input_dev->phys);
1483 input_free_device(sd->input_dev);
1484 sd->input_dev = NULL;
1485 }
1486}
1487#endif
1488
1489static int set_cmatrix(struct gspca_dev *gspca_dev)
1490{
1491 struct sd *sd = (struct sd *) gspca_dev;
1492 s32 hue_coord, hue_index = 180 + sd->hue;
1493 u8 cmatrix[21];
1494 memset(cmatrix, 0, 21);
1495
1496 cmatrix[2] = (sd->contrast * 0x25 / 0x100) + 0x26;
1497 cmatrix[0] = 0x13 + (cmatrix[2] - 0x26) * 0x13 / 0x25;
1498 cmatrix[4] = 0x07 + (cmatrix[2] - 0x26) * 0x07 / 0x25;
1499 cmatrix[18] = sd->brightness - 0x80;
1500
1501 hue_coord = (hsv_red_x[hue_index] * sd->saturation) >> 8;
1502 cmatrix[6] = (unsigned char)(hue_coord & 0xff);
1503 cmatrix[7] = (unsigned char)((hue_coord >> 8) & 0x0f);
1504
1505 hue_coord = (hsv_red_y[hue_index] * sd->saturation) >> 8;
1506 cmatrix[8] = (unsigned char)(hue_coord & 0xff);
1507 cmatrix[9] = (unsigned char)((hue_coord >> 8) & 0x0f);
1508
1509 hue_coord = (hsv_green_x[hue_index] * sd->saturation) >> 8;
1510 cmatrix[10] = (unsigned char)(hue_coord & 0xff);
1511 cmatrix[11] = (unsigned char)((hue_coord >> 8) & 0x0f);
1512
1513 hue_coord = (hsv_green_y[hue_index] * sd->saturation) >> 8;
1514 cmatrix[12] = (unsigned char)(hue_coord & 0xff);
1515 cmatrix[13] = (unsigned char)((hue_coord >> 8) & 0x0f);
1516
1517 hue_coord = (hsv_blue_x[hue_index] * sd->saturation) >> 8;
1518 cmatrix[14] = (unsigned char)(hue_coord & 0xff);
1519 cmatrix[15] = (unsigned char)((hue_coord >> 8) & 0x0f);
1520
1521 hue_coord = (hsv_blue_y[hue_index] * sd->saturation) >> 8;
1522 cmatrix[16] = (unsigned char)(hue_coord & 0xff);
1523 cmatrix[17] = (unsigned char)((hue_coord >> 8) & 0x0f);
1524
1525 return reg_w(gspca_dev, 0x10e1, cmatrix, 21);
1526}
1527
1528static int set_gamma(struct gspca_dev *gspca_dev)
1529{
1530 struct sd *sd = (struct sd *) gspca_dev;
1531 u8 gamma[17];
1532 u8 gval = sd->gamma * 0xb8 / 0x100;
1533
1534
1535 gamma[0] = 0x0a;
1536 gamma[1] = 0x13 + (gval * (0xcb - 0x13) / 0xb8);
1537 gamma[2] = 0x25 + (gval * (0xee - 0x25) / 0xb8);
1538 gamma[3] = 0x37 + (gval * (0xfa - 0x37) / 0xb8);
1539 gamma[4] = 0x45 + (gval * (0xfc - 0x45) / 0xb8);
1540 gamma[5] = 0x55 + (gval * (0xfb - 0x55) / 0xb8);
1541 gamma[6] = 0x65 + (gval * (0xfc - 0x65) / 0xb8);
1542 gamma[7] = 0x74 + (gval * (0xfd - 0x74) / 0xb8);
1543 gamma[8] = 0x83 + (gval * (0xfe - 0x83) / 0xb8);
1544 gamma[9] = 0x92 + (gval * (0xfc - 0x92) / 0xb8);
1545 gamma[10] = 0xa1 + (gval * (0xfc - 0xa1) / 0xb8);
1546 gamma[11] = 0xb0 + (gval * (0xfc - 0xb0) / 0xb8);
1547 gamma[12] = 0xbf + (gval * (0xfb - 0xbf) / 0xb8);
1548 gamma[13] = 0xce + (gval * (0xfb - 0xce) / 0xb8);
1549 gamma[14] = 0xdf + (gval * (0xfd - 0xdf) / 0xb8);
1550 gamma[15] = 0xea + (gval * (0xf9 - 0xea) / 0xb8);
1551 gamma[16] = 0xf5;
1552
1553 return reg_w(gspca_dev, 0x1190, gamma, 17);
1554}
1555
1556static int set_redblue(struct gspca_dev *gspca_dev)
1557{
1558 struct sd *sd = (struct sd *) gspca_dev;
1559 reg_w1(gspca_dev, 0x118c, sd->red);
1560 reg_w1(gspca_dev, 0x118f, sd->blue);
1561 return 0;
1562}
1563
1564static int set_hvflip(struct gspca_dev *gspca_dev)
1565{
1566 u8 value, tslb;
1567 u16 value2;
1568 struct sd *sd = (struct sd *) gspca_dev;
1569 switch (sd->sensor) {
1570 case SENSOR_OV9650:
1571 i2c_r1(gspca_dev, 0x1e, &value);
1572 value &= ~0x30;
1573 tslb = 0x01;
1574 if (sd->hflip)
1575 value |= 0x20;
1576 if (sd->vflip) {
1577 value |= 0x10;
1578 tslb = 0x49;
1579 }
1580 i2c_w1(gspca_dev, 0x1e, value);
1581 i2c_w1(gspca_dev, 0x3a, tslb);
1582 break;
1583 case SENSOR_MT9V111:
1584 case SENSOR_MT9V011:
1585 i2c_r2(gspca_dev, 0x20, &value2);
1586 value2 &= ~0xc0a0;
1587 if (sd->hflip)
1588 value2 |= 0x8080;
1589 if (sd->vflip)
1590 value2 |= 0x4020;
1591 i2c_w2(gspca_dev, 0x20, value2);
1592 break;
1593 case SENSOR_MT9M111:
1594 case SENSOR_MT9V112:
1595 i2c_r2(gspca_dev, 0x20, &value2);
1596 value2 &= ~0x0003;
1597 if (sd->hflip)
1598 value2 |= 0x0002;
1599 if (sd->vflip)
1600 value2 |= 0x0001;
1601 i2c_w2(gspca_dev, 0x20, value2);
1602 break;
1603 case SENSOR_HV7131R:
1604 i2c_r1(gspca_dev, 0x01, &value);
1605 value &= ~0x03;
1606 if (sd->vflip)
1607 value |= 0x01;
1608 if (sd->hflip)
1609 value |= 0x02;
1610 i2c_w1(gspca_dev, 0x01, value);
1611 break;
1612 }
1613 return 0;
1614}
1615
1616static int set_exposure(struct gspca_dev *gspca_dev)
1617{
1618 struct sd *sd = (struct sd *) gspca_dev;
1619 u8 exp[8] = {0x81, sd->i2c_addr, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1e};
1620 switch (sd->sensor) {
1621 case SENSOR_OV7660:
1622 case SENSOR_OV7670:
1623 case SENSOR_SOI968:
1624 case SENSOR_OV9655:
1625 case SENSOR_OV9650:
1626 exp[0] |= (3 << 4);
1627 exp[2] = 0x2d;
1628 exp[3] = sd->exposure & 0xff;
1629 exp[4] = sd->exposure >> 8;
1630 break;
1631 case SENSOR_MT9M001:
1632 case SENSOR_MT9M111:
1633 case SENSOR_MT9V112:
1634 case SENSOR_MT9V111:
1635 case SENSOR_MT9V011:
1636 exp[0] |= (3 << 4);
1637 exp[2] = 0x09;
1638 exp[3] = sd->exposure >> 8;
1639 exp[4] = sd->exposure & 0xff;
1640 break;
1641 case SENSOR_HV7131R:
1642 exp[0] |= (4 << 4);
1643 exp[2] = 0x25;
1644 exp[3] = ((sd->exposure * 0xffffff) / 0xffff) >> 16;
1645 exp[4] = ((sd->exposure * 0xffffff) / 0xffff) >> 8;
1646 exp[5] = ((sd->exposure * 0xffffff) / 0xffff) & 0xff;
1647 break;
1648 }
1649 i2c_w(gspca_dev, exp);
1650 return 0;
1651}
1652
1653static int set_gain(struct gspca_dev *gspca_dev)
1654{
1655 struct sd *sd = (struct sd *) gspca_dev;
1656 u8 gain[8] = {0x81, sd->i2c_addr, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1d};
1657 switch (sd->sensor) {
1658 case SENSOR_OV7660:
1659 case SENSOR_OV7670:
1660 case SENSOR_SOI968:
1661 case SENSOR_OV9655:
1662 case SENSOR_OV9650:
1663 gain[0] |= (2 << 4);
1664 gain[3] = ov_gain[sd->gain];
1665 break;
1666 case SENSOR_MT9V011:
1667 case SENSOR_MT9V111:
1668 gain[0] |= (3 << 4);
1669 gain[2] = 0x35;
1670 gain[3] = micron1_gain[sd->gain] >> 8;
1671 gain[4] = micron1_gain[sd->gain] & 0xff;
1672 break;
1673 case SENSOR_MT9V112:
1674 case SENSOR_MT9M111:
1675 gain[0] |= (3 << 4);
1676 gain[2] = 0x2f;
1677 gain[3] = micron1_gain[sd->gain] >> 8;
1678 gain[4] = micron1_gain[sd->gain] & 0xff;
1679 break;
1680 case SENSOR_MT9M001:
1681 gain[0] |= (3 << 4);
1682 gain[2] = 0x2f;
1683 gain[3] = micron2_gain[sd->gain] >> 8;
1684 gain[4] = micron2_gain[sd->gain] & 0xff;
1685 break;
1686 case SENSOR_HV7131R:
1687 gain[0] |= (2 << 4);
1688 gain[2] = 0x30;
1689 gain[3] = hv7131r_gain[sd->gain];
1690 break;
1691 }
1692 i2c_w(gspca_dev, gain);
1693 return 0;
1694}
1695
1696static int sd_setbrightness(struct gspca_dev *gspca_dev, s32 val)
1697{
1698 struct sd *sd = (struct sd *) gspca_dev;
1699
1700 sd->brightness = val;
1701 if (gspca_dev->streaming)
1702 return set_cmatrix(gspca_dev);
1703 return 0;
1704}
1705
1706static int sd_getbrightness(struct gspca_dev *gspca_dev, s32 *val)
1707{
1708 struct sd *sd = (struct sd *) gspca_dev;
1709 *val = sd->brightness;
1710 return 0;
1711}
1712
1713
1714static int sd_setcontrast(struct gspca_dev *gspca_dev, s32 val)
1715{
1716 struct sd *sd = (struct sd *) gspca_dev;
1717
1718 sd->contrast = val;
1719 if (gspca_dev->streaming)
1720 return set_cmatrix(gspca_dev);
1721 return 0;
1722}
1723
1724static int sd_getcontrast(struct gspca_dev *gspca_dev, s32 *val)
1725{
1726 struct sd *sd = (struct sd *) gspca_dev;
1727 *val = sd->contrast;
1728 return 0;
1729}
1730
1731static int sd_setsaturation(struct gspca_dev *gspca_dev, s32 val)
1732{
1733 struct sd *sd = (struct sd *) gspca_dev;
1734
1735 sd->saturation = val;
1736 if (gspca_dev->streaming)
1737 return set_cmatrix(gspca_dev);
1738 return 0;
1739}
1740
1741static int sd_getsaturation(struct gspca_dev *gspca_dev, s32 *val)
1742{
1743 struct sd *sd = (struct sd *) gspca_dev;
1744 *val = sd->saturation;
1745 return 0;
1746}
1747
1748static int sd_sethue(struct gspca_dev *gspca_dev, s32 val)
1749{
1750 struct sd *sd = (struct sd *) gspca_dev;
1751
1752 sd->hue = val;
1753 if (gspca_dev->streaming)
1754 return set_cmatrix(gspca_dev);
1755 return 0;
1756}
1757
1758static int sd_gethue(struct gspca_dev *gspca_dev, s32 *val)
1759{
1760 struct sd *sd = (struct sd *) gspca_dev;
1761 *val = sd->hue;
1762 return 0;
1763}
1764
1765static int sd_setgamma(struct gspca_dev *gspca_dev, s32 val)
1766{
1767 struct sd *sd = (struct sd *) gspca_dev;
1768
1769 sd->gamma = val;
1770 if (gspca_dev->streaming)
1771 return set_gamma(gspca_dev);
1772 return 0;
1773}
1774
1775static int sd_getgamma(struct gspca_dev *gspca_dev, s32 *val)
1776{
1777 struct sd *sd = (struct sd *) gspca_dev;
1778 *val = sd->gamma;
1779 return 0;
1780}
1781
1782static int sd_setredbalance(struct gspca_dev *gspca_dev, s32 val)
1783{
1784 struct sd *sd = (struct sd *) gspca_dev;
1785
1786 sd->red = val;
1787 if (gspca_dev->streaming)
1788 return set_redblue(gspca_dev);
1789 return 0;
1790}
1791
1792static int sd_getredbalance(struct gspca_dev *gspca_dev, s32 *val)
1793{
1794 struct sd *sd = (struct sd *) gspca_dev;
1795 *val = sd->red;
1796 return 0;
1797}
1798
1799static int sd_setbluebalance(struct gspca_dev *gspca_dev, s32 val)
1800{
1801 struct sd *sd = (struct sd *) gspca_dev;
1802
1803 sd->blue = val;
1804 if (gspca_dev->streaming)
1805 return set_redblue(gspca_dev);
1806 return 0;
1807}
1808
1809static int sd_getbluebalance(struct gspca_dev *gspca_dev, s32 *val)
1810{
1811 struct sd *sd = (struct sd *) gspca_dev;
1812 *val = sd->blue;
1813 return 0;
1814}
1815
1816static int sd_sethflip(struct gspca_dev *gspca_dev, s32 val)
1817{
1818 struct sd *sd = (struct sd *) gspca_dev;
1819
1820 sd->hflip = val;
1821 if (gspca_dev->streaming)
1822 return set_hvflip(gspca_dev);
1823 return 0;
1824}
1825
1826static int sd_gethflip(struct gspca_dev *gspca_dev, s32 *val)
1827{
1828 struct sd *sd = (struct sd *) gspca_dev;
1829 *val = sd->hflip;
1830 return 0;
1831}
1832
1833static int sd_setvflip(struct gspca_dev *gspca_dev, s32 val)
1834{
1835 struct sd *sd = (struct sd *) gspca_dev;
1836
1837 sd->vflip = val;
1838 if (gspca_dev->streaming)
1839 return set_hvflip(gspca_dev);
1840 return 0;
1841}
1842
1843static int sd_getvflip(struct gspca_dev *gspca_dev, s32 *val)
1844{
1845 struct sd *sd = (struct sd *) gspca_dev;
1846 *val = sd->vflip;
1847 return 0;
1848}
1849
1850static int sd_setexposure(struct gspca_dev *gspca_dev, s32 val)
1851{
1852 struct sd *sd = (struct sd *) gspca_dev;
1853
1854 sd->exposure = val;
1855 if (gspca_dev->streaming)
1856 return set_exposure(gspca_dev);
1857 return 0;
1858}
1859
1860static int sd_getexposure(struct gspca_dev *gspca_dev, s32 *val)
1861{
1862 struct sd *sd = (struct sd *) gspca_dev;
1863 *val = sd->exposure;
1864 return 0;
1865}
1866
1867static int sd_setgain(struct gspca_dev *gspca_dev, s32 val)
1868{
1869 struct sd *sd = (struct sd *) gspca_dev;
1870
1871 sd->gain = val;
1872 if (gspca_dev->streaming)
1873 return set_gain(gspca_dev);
1874 return 0;
1875}
1876
1877static int sd_getgain(struct gspca_dev *gspca_dev, s32 *val)
1878{
1879 struct sd *sd = (struct sd *) gspca_dev;
1880 *val = sd->gain;
1881 return 0;
1882}
1883
1884static int sd_setautoexposure(struct gspca_dev *gspca_dev, s32 val)
1885{
1886 struct sd *sd = (struct sd *) gspca_dev;
1887 sd->auto_exposure = val;
1888 return 0;
1889}
1890
1891static int sd_getautoexposure(struct gspca_dev *gspca_dev, s32 *val)
1892{
1893 struct sd *sd = (struct sd *) gspca_dev;
1894 *val = sd->auto_exposure;
1895 return 0;
1896}
1897
1898#ifdef CONFIG_VIDEO_ADV_DEBUG
1899static int sd_dbg_g_register(struct gspca_dev *gspca_dev,
1900 struct v4l2_dbg_register *reg)
1901{
1902 struct sd *sd = (struct sd *) gspca_dev;
1903 switch (reg->match.type) {
1904 case V4L2_CHIP_MATCH_HOST:
1905 if (reg->match.addr != 0)
1906 return -EINVAL;
1907 if (reg->reg < 0x1000 || reg->reg > 0x11ff)
1908 return -EINVAL;
1909 if (reg_r(gspca_dev, reg->reg, 1) < 0)
1910 return -EINVAL;
1911 reg->val = gspca_dev->usb_buf[0];
1912 return 0;
1913 case V4L2_CHIP_MATCH_I2C_ADDR:
1914 if (reg->match.addr != sd->i2c_addr)
1915 return -EINVAL;
1916 if (sd->sensor >= SENSOR_MT9V011 &&
1917 sd->sensor <= SENSOR_MT9M111) {
1918 if (i2c_r2(gspca_dev, reg->reg, (u16 *)&reg->val) < 0)
1919 return -EINVAL;
1920 } else {
1921 if (i2c_r1(gspca_dev, reg->reg, (u8 *)&reg->val) < 0)
1922 return -EINVAL;
1923 }
1924 return 0;
1925 }
1926 return -EINVAL;
1927}
1928
1929static int sd_dbg_s_register(struct gspca_dev *gspca_dev,
1930 struct v4l2_dbg_register *reg)
1931{
1932 struct sd *sd = (struct sd *) gspca_dev;
1933 switch (reg->match.type) {
1934 case V4L2_CHIP_MATCH_HOST:
1935 if (reg->match.addr != 0)
1936 return -EINVAL;
1937 if (reg->reg < 0x1000 || reg->reg > 0x11ff)
1938 return -EINVAL;
1939 if (reg_w1(gspca_dev, reg->reg, reg->val) < 0)
1940 return -EINVAL;
1941 return 0;
1942 case V4L2_CHIP_MATCH_I2C_ADDR:
1943 if (reg->match.addr != sd->i2c_addr)
1944 return -EINVAL;
1945 if (sd->sensor >= SENSOR_MT9V011 &&
1946 sd->sensor <= SENSOR_MT9M111) {
1947 if (i2c_w2(gspca_dev, reg->reg, reg->val) < 0)
1948 return -EINVAL;
1949 } else {
1950 if (i2c_w1(gspca_dev, reg->reg, reg->val) < 0)
1951 return -EINVAL;
1952 }
1953 return 0;
1954 }
1955 return -EINVAL;
1956}
1957#endif
1958
1959static int sd_chip_ident(struct gspca_dev *gspca_dev,
1960 struct v4l2_dbg_chip_ident *chip)
1961{
1962 struct sd *sd = (struct sd *) gspca_dev;
1963
1964 switch (chip->match.type) {
1965 case V4L2_CHIP_MATCH_HOST:
1966 if (chip->match.addr != 0)
1967 return -EINVAL;
1968 chip->revision = 0;
1969 chip->ident = V4L2_IDENT_SN9C20X;
1970 return 0;
1971 case V4L2_CHIP_MATCH_I2C_ADDR:
1972 if (chip->match.addr != sd->i2c_addr)
1973 return -EINVAL;
1974 chip->revision = 0;
1975 chip->ident = i2c_ident[sd->sensor];
1976 return 0;
1977 }
1978 return -EINVAL;
1979}
1980
1981static int sd_config(struct gspca_dev *gspca_dev,
1982 const struct usb_device_id *id)
1983{
1984 struct sd *sd = (struct sd *) gspca_dev;
1985 struct cam *cam;
1986
1987 cam = &gspca_dev->cam;
1988
1989 sd->sensor = (id->driver_info >> 8) & 0xff;
1990 sd->i2c_addr = id->driver_info & 0xff;
1991
1992 switch (sd->sensor) {
1993 case SENSOR_OV9650:
1994 cam->cam_mode = sxga_mode;
1995 cam->nmodes = ARRAY_SIZE(sxga_mode);
1996 break;
1997 default:
1998 cam->cam_mode = vga_mode;
1999 cam->nmodes = ARRAY_SIZE(vga_mode);
2000 }
2001
2002 sd->old_step = 0;
2003 sd->older_step = 0;
2004 sd->exposure_step = 16;
2005
2006 sd->brightness = BRIGHTNESS_DEFAULT;
2007 sd->contrast = CONTRAST_DEFAULT;
2008 sd->saturation = SATURATION_DEFAULT;
2009 sd->hue = HUE_DEFAULT;
2010 sd->gamma = GAMMA_DEFAULT;
2011 sd->red = RED_DEFAULT;
2012 sd->blue = BLUE_DEFAULT;
2013
2014 sd->hflip = HFLIP_DEFAULT;
2015 sd->vflip = VFLIP_DEFAULT;
2016 sd->exposure = EXPOSURE_DEFAULT;
2017 sd->gain = GAIN_DEFAULT;
2018 sd->auto_exposure = AUTO_EXPOSURE_DEFAULT;
2019
2020 sd->quality = 95;
2021
2022#ifdef CONFIG_USB_GSPCA_SN9C20X_EVDEV
2023 sd->input_gpio = (id->driver_info >> 16) & 0xff;
2024 if (sn9c20x_input_init(gspca_dev) < 0)
2025 return -ENODEV;
2026#endif
2027 return 0;
2028}
2029
2030static int sd_init(struct gspca_dev *gspca_dev)
2031{
2032 struct sd *sd = (struct sd *) gspca_dev;
2033 int i;
2034 u8 value;
2035 u8 i2c_init[9] =
2036 {0x80, sd->i2c_addr, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03};
2037
2038 for (i = 0; i < ARRAY_SIZE(bridge_init); i++) {
2039 value = bridge_init[i][1];
2040 if (reg_w(gspca_dev, bridge_init[i][0], &value, 1) < 0) {
2041 err("Device initialization failed");
2042 return -ENODEV;
2043 }
2044 }
2045
2046 if (reg_w(gspca_dev, 0x10c0, i2c_init, 9) < 0) {
2047 err("Device initialization failed");
2048 return -ENODEV;
2049 }
2050
2051 switch (sd->sensor) {
2052 case SENSOR_OV9650:
2053 if (ov9650_init_sensor(gspca_dev) < 0)
2054 return -ENODEV;
2055 info("OV9650 sensor detected");
2056 break;
2057 case SENSOR_OV9655:
2058 if (ov9655_init_sensor(gspca_dev) < 0)
2059 return -ENODEV;
2060 info("OV9655 sensor detected");
2061 break;
2062 case SENSOR_SOI968:
2063 if (soi968_init_sensor(gspca_dev) < 0)
2064 return -ENODEV;
2065 info("SOI968 sensor detected");
2066 break;
2067 case SENSOR_OV7660:
2068 if (ov7660_init_sensor(gspca_dev) < 0)
2069 return -ENODEV;
2070 info("OV7660 sensor detected");
2071 break;
2072 case SENSOR_OV7670:
2073 if (ov7670_init_sensor(gspca_dev) < 0)
2074 return -ENODEV;
2075 info("OV7670 sensor detected");
2076 break;
2077 case SENSOR_MT9VPRB:
2078 if (mt9v_init_sensor(gspca_dev) < 0)
2079 return -ENODEV;
2080 break;
2081 case SENSOR_MT9M111:
2082 if (mt9m111_init_sensor(gspca_dev) < 0)
2083 return -ENODEV;
2084 info("MT9M111 sensor detected");
2085 break;
2086 case SENSOR_MT9M001:
2087 if (mt9m001_init_sensor(gspca_dev) < 0)
2088 return -ENODEV;
2089 info("MT9M001 sensor detected");
2090 break;
2091 case SENSOR_HV7131R:
2092 if (hv7131r_init_sensor(gspca_dev) < 0)
2093 return -ENODEV;
2094 info("HV7131R sensor detected");
2095 break;
2096 default:
2097 info("Unsupported Sensor");
2098 return -ENODEV;
2099 }
2100
2101 return 0;
2102}
2103
2104static void configure_sensor_output(struct gspca_dev *gspca_dev, int mode)
2105{
2106 struct sd *sd = (struct sd *) gspca_dev;
2107 u8 value;
2108 switch (sd->sensor) {
2109 case SENSOR_OV9650:
2110 if (mode & MODE_SXGA) {
2111 i2c_w1(gspca_dev, 0x17, 0x1b);
2112 i2c_w1(gspca_dev, 0x18, 0xbc);
2113 i2c_w1(gspca_dev, 0x19, 0x01);
2114 i2c_w1(gspca_dev, 0x1a, 0x82);
2115 i2c_r1(gspca_dev, 0x12, &value);
2116 i2c_w1(gspca_dev, 0x12, value & 0x07);
2117 } else {
2118 i2c_w1(gspca_dev, 0x17, 0x24);
2119 i2c_w1(gspca_dev, 0x18, 0xc5);
2120 i2c_w1(gspca_dev, 0x19, 0x00);
2121 i2c_w1(gspca_dev, 0x1a, 0x3c);
2122 i2c_r1(gspca_dev, 0x12, &value);
2123 i2c_w1(gspca_dev, 0x12, (value & 0x7) | 0x40);
2124 }
2125 break;
2126 }
2127}
2128
2129#define HW_WIN(mode, hstart, vstart) \
2130((const u8 []){hstart & 0xff, hstart >> 8, \
2131vstart & 0xff, vstart >> 8, \
2132(mode & MODE_SXGA ? 1280 >> 4 : 640 >> 4), \
2133(mode & MODE_SXGA ? 1024 >> 3 : 480 >> 3)})
2134
2135#define CLR_WIN(width, height) \
2136((const u8 [])\
2137{0, width >> 2, 0, height >> 1,\
2138((width >> 10) & 0x01) | ((height >> 8) & 0x6)})
2139
2140static int sd_start(struct gspca_dev *gspca_dev)
2141{
2142 struct sd *sd = (struct sd *) gspca_dev;
2143 int mode = gspca_dev->cam.cam_mode[(int) gspca_dev->curr_mode].priv;
2144 int width = gspca_dev->width;
2145 int height = gspca_dev->height;
2146 u8 fmt, scale = 0;
2147
2148 sd->jpeg_hdr = kmalloc(JPEG_HDR_SZ, GFP_KERNEL);
2149 if (sd->jpeg_hdr == NULL)
2150 return -ENOMEM;
2151
2152 jpeg_define(sd->jpeg_hdr, height, width,
2153 0x21);
2154 jpeg_set_qual(sd->jpeg_hdr, sd->quality);
2155
2156 if (mode & MODE_RAW)
2157 fmt = 0x2d;
2158 else if (mode & MODE_JPEG)
2159 fmt = 0x2c;
2160 else
2161 fmt = 0x2f;
2162
2163 switch (mode & 0x0f) {
2164 case 3:
2165 scale = 0xc0;
2166 info("Set 1280x1024");
2167 break;
2168 case 2:
2169 scale = 0x80;
2170 info("Set 640x480");
2171 break;
2172 case 1:
2173 scale = 0x90;
2174 info("Set 320x240");
2175 break;
2176 case 0:
2177 scale = 0xa0;
2178 info("Set 160x120");
2179 break;
2180 }
2181
2182 configure_sensor_output(gspca_dev, mode);
2183 reg_w(gspca_dev, 0x1100, sd->jpeg_hdr + JPEG_QT0_OFFSET, 64);
2184 reg_w(gspca_dev, 0x1140, sd->jpeg_hdr + JPEG_QT1_OFFSET, 64);
2185 reg_w(gspca_dev, 0x10fb, CLR_WIN(width, height), 5);
2186 reg_w(gspca_dev, 0x1180, HW_WIN(mode, sd->hstart, sd->vstart), 6);
2187 reg_w1(gspca_dev, 0x1189, scale);
2188 reg_w1(gspca_dev, 0x10e0, fmt);
2189
2190 set_cmatrix(gspca_dev);
2191 set_gamma(gspca_dev);
2192 set_redblue(gspca_dev);
2193 set_gain(gspca_dev);
2194 set_exposure(gspca_dev);
2195 set_hvflip(gspca_dev);
2196
2197 reg_r(gspca_dev, 0x1061, 1);
2198 reg_w1(gspca_dev, 0x1061, gspca_dev->usb_buf[0] | 0x02);
2199 return 0;
2200}
2201
2202static void sd_stopN(struct gspca_dev *gspca_dev)
2203{
2204 reg_r(gspca_dev, 0x1061, 1);
2205 reg_w1(gspca_dev, 0x1061, gspca_dev->usb_buf[0] & ~0x02);
2206}
2207
2208static void sd_stop0(struct gspca_dev *gspca_dev)
2209{
2210 struct sd *sd = (struct sd *) gspca_dev;
2211 kfree(sd->jpeg_hdr);
2212}
2213
2214static void do_autoexposure(struct gspca_dev *gspca_dev)
2215{
2216 struct sd *sd = (struct sd *) gspca_dev;
2217 int avg_lum, new_exp;
2218
2219 if (!sd->auto_exposure)
2220 return;
2221
2222 avg_lum = atomic_read(&sd->avg_lum);
2223
2224 /*
2225 * some hardcoded values are present
2226 * like those for maximal/minimal exposure
2227 * and exposure steps
2228 */
2229 if (avg_lum < MIN_AVG_LUM) {
2230 if (sd->exposure > 0x1770)
2231 return;
2232
2233 new_exp = sd->exposure + sd->exposure_step;
2234 if (new_exp > 0x1770)
2235 new_exp = 0x1770;
2236 if (new_exp < 0x10)
2237 new_exp = 0x10;
2238 sd->exposure = new_exp;
2239 set_exposure(gspca_dev);
2240
2241 sd->older_step = sd->old_step;
2242 sd->old_step = 1;
2243
2244 if (sd->old_step ^ sd->older_step)
2245 sd->exposure_step /= 2;
2246 else
2247 sd->exposure_step += 2;
2248 }
2249 if (avg_lum > MAX_AVG_LUM) {
2250 if (sd->exposure < 0x10)
2251 return;
2252 new_exp = sd->exposure - sd->exposure_step;
2253 if (new_exp > 0x1700)
2254 new_exp = 0x1770;
2255 if (new_exp < 0x10)
2256 new_exp = 0x10;
2257 sd->exposure = new_exp;
2258 set_exposure(gspca_dev);
2259 sd->older_step = sd->old_step;
2260 sd->old_step = 0;
2261
2262 if (sd->old_step ^ sd->older_step)
2263 sd->exposure_step /= 2;
2264 else
2265 sd->exposure_step += 2;
2266 }
2267}
2268
2269static void sd_pkt_scan(struct gspca_dev *gspca_dev,
2270 struct gspca_frame *frame, /* target */
2271 u8 *data, /* isoc packet */
2272 int len) /* iso packet length */
2273{
2274 struct sd *sd = (struct sd *) gspca_dev;
2275 int avg_lum;
2276 static unsigned char frame_header[] =
2277 {0xff, 0xff, 0x00, 0xc4, 0xc4, 0x96};
2278 if (len == 64 && memcmp(data, frame_header, 6) == 0) {
2279 avg_lum = ((data[35] >> 2) & 3) |
2280 (data[20] << 2) |
2281 (data[19] << 10);
2282 avg_lum += ((data[35] >> 4) & 3) |
2283 (data[22] << 2) |
2284 (data[21] << 10);
2285 avg_lum += ((data[35] >> 6) & 3) |
2286 (data[24] << 2) |
2287 (data[23] << 10);
2288 avg_lum += (data[36] & 3) |
2289 (data[26] << 2) |
2290 (data[25] << 10);
2291 avg_lum += ((data[36] >> 2) & 3) |
2292 (data[28] << 2) |
2293 (data[27] << 10);
2294 avg_lum += ((data[36] >> 4) & 3) |
2295 (data[30] << 2) |
2296 (data[29] << 10);
2297 avg_lum += ((data[36] >> 6) & 3) |
2298 (data[32] << 2) |
2299 (data[31] << 10);
2300 avg_lum += ((data[44] >> 4) & 3) |
2301 (data[34] << 2) |
2302 (data[33] << 10);
2303 avg_lum >>= 9;
2304 atomic_set(&sd->avg_lum, avg_lum);
2305 gspca_frame_add(gspca_dev, LAST_PACKET,
2306 frame, data, len);
2307 return;
2308 }
2309 if (gspca_dev->last_packet_type == LAST_PACKET) {
2310 if (gspca_dev->cam.cam_mode[(int) gspca_dev->curr_mode].priv
2311 & MODE_JPEG) {
2312 gspca_frame_add(gspca_dev, FIRST_PACKET, frame,
2313 sd->jpeg_hdr, JPEG_HDR_SZ);
2314 gspca_frame_add(gspca_dev, INTER_PACKET, frame,
2315 data, len);
2316 } else {
2317 gspca_frame_add(gspca_dev, FIRST_PACKET, frame,
2318 data, len);
2319 }
2320 } else {
2321 gspca_frame_add(gspca_dev, INTER_PACKET, frame, data, len);
2322 }
2323}
2324
2325/* sub-driver description */
2326static const struct sd_desc sd_desc = {
2327 .name = MODULE_NAME,
2328 .ctrls = sd_ctrls,
2329 .nctrls = ARRAY_SIZE(sd_ctrls),
2330 .config = sd_config,
2331 .init = sd_init,
2332 .start = sd_start,
2333 .stopN = sd_stopN,
2334 .stop0 = sd_stop0,
2335 .pkt_scan = sd_pkt_scan,
2336 .dq_callback = do_autoexposure,
2337#ifdef CONFIG_VIDEO_ADV_DEBUG
2338 .set_register = sd_dbg_s_register,
2339 .get_register = sd_dbg_g_register,
2340#endif
2341 .get_chip_ident = sd_chip_ident,
2342};
2343
2344#define SN9C20X(sensor, i2c_addr, button_mask) \
2345 .driver_info = (button_mask << 16) \
2346 | (SENSOR_ ## sensor << 8) \
2347 | (i2c_addr)
2348
2349static const __devinitdata struct usb_device_id device_table[] = {
2350 {USB_DEVICE(0x0c45, 0x6240), SN9C20X(MT9M001, 0x5d, 0)},
2351 {USB_DEVICE(0x0c45, 0x6242), SN9C20X(MT9M111, 0x5d, 0)},
2352 {USB_DEVICE(0x0c45, 0x6248), SN9C20X(OV9655, 0x30, 0)},
2353 {USB_DEVICE(0x0c45, 0x624e), SN9C20X(SOI968, 0x30, 0x10)},
2354 {USB_DEVICE(0x0c45, 0x624f), SN9C20X(OV9650, 0x30, 0)},
2355 {USB_DEVICE(0x0c45, 0x6251), SN9C20X(OV9650, 0x30, 0)},
2356 {USB_DEVICE(0x0c45, 0x6253), SN9C20X(OV9650, 0x30, 0)},
2357 {USB_DEVICE(0x0c45, 0x6260), SN9C20X(OV7670, 0x21, 0)},
2358 {USB_DEVICE(0x0c45, 0x6270), SN9C20X(MT9VPRB, 0x00, 0)},
2359 {USB_DEVICE(0x0c45, 0x627b), SN9C20X(OV7660, 0x21, 0)},
2360 {USB_DEVICE(0x0c45, 0x627c), SN9C20X(HV7131R, 0x11, 0)},
2361 {USB_DEVICE(0x0c45, 0x627f), SN9C20X(OV9650, 0x30, 0)},
2362 {USB_DEVICE(0x0c45, 0x6280), SN9C20X(MT9M001, 0x5d, 0)},
2363 {USB_DEVICE(0x0c45, 0x6282), SN9C20X(MT9M111, 0x5d, 0)},
2364 {USB_DEVICE(0x0c45, 0x6288), SN9C20X(OV9655, 0x30, 0)},
2365 {USB_DEVICE(0x0c45, 0x628e), SN9C20X(SOI968, 0x30, 0)},
2366 {USB_DEVICE(0x0c45, 0x628f), SN9C20X(OV9650, 0x30, 0)},
2367 {USB_DEVICE(0x0c45, 0x62a0), SN9C20X(OV7670, 0x21, 0)},
2368 {USB_DEVICE(0x0c45, 0x62b0), SN9C20X(MT9VPRB, 0x00, 0)},
2369 {USB_DEVICE(0x0c45, 0x62b3), SN9C20X(OV9655, 0x30, 0)},
2370 {USB_DEVICE(0x0c45, 0x62bb), SN9C20X(OV7660, 0x21, 0)},
2371 {USB_DEVICE(0x0c45, 0x62bc), SN9C20X(HV7131R, 0x11, 0)},
2372 {USB_DEVICE(0x045e, 0x00f4), SN9C20X(OV9650, 0x30, 0)},
2373 {USB_DEVICE(0x145f, 0x013d), SN9C20X(OV7660, 0x21, 0)},
2374 {USB_DEVICE(0x0458, 0x7029), SN9C20X(HV7131R, 0x11, 0)},
2375 {USB_DEVICE(0xa168, 0x0610), SN9C20X(HV7131R, 0x11, 0)},
2376 {USB_DEVICE(0xa168, 0x0611), SN9C20X(HV7131R, 0x11, 0)},
2377 {USB_DEVICE(0xa168, 0x0613), SN9C20X(HV7131R, 0x11, 0)},
2378 {USB_DEVICE(0xa168, 0x0618), SN9C20X(HV7131R, 0x11, 0)},
2379 {USB_DEVICE(0xa168, 0x0614), SN9C20X(MT9M111, 0x5d, 0)},
2380 {USB_DEVICE(0xa168, 0x0615), SN9C20X(MT9M111, 0x5d, 0)},
2381 {USB_DEVICE(0xa168, 0x0617), SN9C20X(MT9M111, 0x5d, 0)},
2382 {}
2383};
2384MODULE_DEVICE_TABLE(usb, device_table);
2385
2386/* -- device connect -- */
2387static int sd_probe(struct usb_interface *intf,
2388 const struct usb_device_id *id)
2389{
2390 return gspca_dev_probe(intf, id, &sd_desc, sizeof(struct sd),
2391 THIS_MODULE);
2392}
2393
2394static void sd_disconnect(struct usb_interface *intf)
2395{
2396#ifdef CONFIG_USB_GSPCA_SN9C20X_EVDEV
2397 struct gspca_dev *gspca_dev = usb_get_intfdata(intf);
2398
2399 sn9c20x_input_cleanup(gspca_dev);
2400#endif
2401
2402 gspca_disconnect(intf);
2403}
2404
2405static struct usb_driver sd_driver = {
2406 .name = MODULE_NAME,
2407 .id_table = device_table,
2408 .probe = sd_probe,
2409 .disconnect = sd_disconnect,
2410#ifdef CONFIG_PM
2411 .suspend = gspca_suspend,
2412 .resume = gspca_resume,
2413 .reset_resume = gspca_resume,
2414#endif
2415};
2416
2417/* -- module insert / remove -- */
2418static int __init sd_mod_init(void)
2419{
2420 int ret;
2421 ret = usb_register(&sd_driver);
2422 if (ret < 0)
2423 return ret;
2424 info("registered");
2425 return 0;
2426}
2427static void __exit sd_mod_exit(void)
2428{
2429 usb_deregister(&sd_driver);
2430 info("deregistered");
2431}
2432
2433module_init(sd_mod_init);
2434module_exit(sd_mod_exit);
diff --git a/drivers/media/video/gspca/sonixj.c b/drivers/media/video/gspca/sonixj.c
index 0d02f41fa7d0..d6332ab80669 100644
--- a/drivers/media/video/gspca/sonixj.c
+++ b/drivers/media/video/gspca/sonixj.c
@@ -1634,6 +1634,8 @@ static void setfreq(struct gspca_dev *gspca_dev)
1634{ 1634{
1635 struct sd *sd = (struct sd *) gspca_dev; 1635 struct sd *sd = (struct sd *) gspca_dev;
1636 1636
1637 if (gspca_dev->ctrl_dis & (1 << FREQ_IDX))
1638 return;
1637 if (sd->sensor == SENSOR_OV7660) { 1639 if (sd->sensor == SENSOR_OV7660) {
1638 switch (sd->freq) { 1640 switch (sd->freq) {
1639 case 0: /* Banding filter disabled */ 1641 case 0: /* Banding filter disabled */
@@ -1735,6 +1737,8 @@ static int sd_start(struct gspca_dev *gspca_dev)
1735 1737
1736 /* create the JPEG header */ 1738 /* create the JPEG header */
1737 sd->jpeg_hdr = kmalloc(JPEG_HDR_SZ, GFP_KERNEL); 1739 sd->jpeg_hdr = kmalloc(JPEG_HDR_SZ, GFP_KERNEL);
1740 if (!sd->jpeg_hdr)
1741 return -ENOMEM;
1738 jpeg_define(sd->jpeg_hdr, gspca_dev->height, gspca_dev->width, 1742 jpeg_define(sd->jpeg_hdr, gspca_dev->height, gspca_dev->width,
1739 0x21); /* JPEG 422 */ 1743 0x21); /* JPEG 422 */
1740 jpeg_set_qual(sd->jpeg_hdr, sd->quality); 1744 jpeg_set_qual(sd->jpeg_hdr, sd->quality);
diff --git a/drivers/media/video/gspca/spca500.c b/drivers/media/video/gspca/spca500.c
index 8806b2ff82be..fab7ef85a6c1 100644
--- a/drivers/media/video/gspca/spca500.c
+++ b/drivers/media/video/gspca/spca500.c
@@ -670,6 +670,8 @@ static int sd_start(struct gspca_dev *gspca_dev)
670 670
671 /* create the JPEG header */ 671 /* create the JPEG header */
672 sd->jpeg_hdr = kmalloc(JPEG_HDR_SZ, GFP_KERNEL); 672 sd->jpeg_hdr = kmalloc(JPEG_HDR_SZ, GFP_KERNEL);
673 if (!sd->jpeg_hdr)
674 return -ENOMEM;
673 jpeg_define(sd->jpeg_hdr, gspca_dev->height, gspca_dev->width, 675 jpeg_define(sd->jpeg_hdr, gspca_dev->height, gspca_dev->width,
674 0x22); /* JPEG 411 */ 676 0x22); /* JPEG 411 */
675 jpeg_set_qual(sd->jpeg_hdr, sd->quality); 677 jpeg_set_qual(sd->jpeg_hdr, sd->quality);
diff --git a/drivers/media/video/gspca/stk014.c b/drivers/media/video/gspca/stk014.c
index f25be20cf1a6..47628964801e 100644
--- a/drivers/media/video/gspca/stk014.c
+++ b/drivers/media/video/gspca/stk014.c
@@ -333,6 +333,8 @@ static int sd_start(struct gspca_dev *gspca_dev)
333 333
334 /* create the JPEG header */ 334 /* create the JPEG header */
335 sd->jpeg_hdr = kmalloc(JPEG_HDR_SZ, GFP_KERNEL); 335 sd->jpeg_hdr = kmalloc(JPEG_HDR_SZ, GFP_KERNEL);
336 if (!sd->jpeg_hdr)
337 return -ENOMEM;
336 jpeg_define(sd->jpeg_hdr, gspca_dev->height, gspca_dev->width, 338 jpeg_define(sd->jpeg_hdr, gspca_dev->height, gspca_dev->width,
337 0x22); /* JPEG 411 */ 339 0x22); /* JPEG 411 */
338 jpeg_set_qual(sd->jpeg_hdr, sd->quality); 340 jpeg_set_qual(sd->jpeg_hdr, sd->quality);
diff --git a/drivers/media/video/gspca/stv06xx/stv06xx.h b/drivers/media/video/gspca/stv06xx/stv06xx.h
index 9df7137fe67e..992ce530f138 100644
--- a/drivers/media/video/gspca/stv06xx/stv06xx.h
+++ b/drivers/media/video/gspca/stv06xx/stv06xx.h
@@ -36,10 +36,6 @@
36 36
37#define STV_ISOC_ENDPOINT_ADDR 0x81 37#define STV_ISOC_ENDPOINT_ADDR 0x81
38 38
39#ifndef V4L2_PIX_FMT_SGRBG8
40#define V4L2_PIX_FMT_SGRBG8 v4l2_fourcc('G', 'R', 'B', 'G')
41#endif
42
43#define STV_REG23 0x0423 39#define STV_REG23 0x0423
44 40
45/* Control registers of the STV0600 ASIC */ 41/* Control registers of the STV0600 ASIC */
diff --git a/drivers/media/video/gspca/stv06xx/stv06xx_hdcs.c b/drivers/media/video/gspca/stv06xx/stv06xx_hdcs.c
index 3039ec208f3a..e5024c8496ef 100644
--- a/drivers/media/video/gspca/stv06xx/stv06xx_hdcs.c
+++ b/drivers/media/video/gspca/stv06xx/stv06xx_hdcs.c
@@ -64,7 +64,7 @@ static struct v4l2_pix_format hdcs1x00_mode[] = {
64 { 64 {
65 HDCS_1X00_DEF_WIDTH, 65 HDCS_1X00_DEF_WIDTH,
66 HDCS_1X00_DEF_HEIGHT, 66 HDCS_1X00_DEF_HEIGHT,
67 V4L2_PIX_FMT_SBGGR8, 67 V4L2_PIX_FMT_SGRBG8,
68 V4L2_FIELD_NONE, 68 V4L2_FIELD_NONE,
69 .sizeimage = 69 .sizeimage =
70 HDCS_1X00_DEF_WIDTH * HDCS_1X00_DEF_HEIGHT, 70 HDCS_1X00_DEF_WIDTH * HDCS_1X00_DEF_HEIGHT,
@@ -80,7 +80,7 @@ static struct v4l2_pix_format hdcs1020_mode[] = {
80 { 80 {
81 HDCS_1020_DEF_WIDTH, 81 HDCS_1020_DEF_WIDTH,
82 HDCS_1020_DEF_HEIGHT, 82 HDCS_1020_DEF_HEIGHT,
83 V4L2_PIX_FMT_SBGGR8, 83 V4L2_PIX_FMT_SGRBG8,
84 V4L2_FIELD_NONE, 84 V4L2_FIELD_NONE,
85 .sizeimage = 85 .sizeimage =
86 HDCS_1020_DEF_WIDTH * HDCS_1020_DEF_HEIGHT, 86 HDCS_1020_DEF_WIDTH * HDCS_1020_DEF_HEIGHT,
@@ -131,9 +131,11 @@ static int hdcs_reg_write_seq(struct sd *sd, u8 reg, u8 *vals, u8 len)
131 (reg + len > 0xff))) 131 (reg + len > 0xff)))
132 return -EINVAL; 132 return -EINVAL;
133 133
134 for (i = 0; i < len; i++, reg++) { 134 for (i = 0; i < len; i++) {
135 regs[2*i] = reg; 135 regs[2 * i] = reg;
136 regs[2*i+1] = vals[i]; 136 regs[2 * i + 1] = vals[i];
137 /* All addresses are shifted left one bit as bit 0 toggles r/w */
138 reg += 2;
137 } 139 }
138 140
139 return stv06xx_write_sensor_bytes(sd, regs, len); 141 return stv06xx_write_sensor_bytes(sd, regs, len);
@@ -174,7 +176,9 @@ static int hdcs_set_state(struct sd *sd, enum hdcs_power_state state)
174 } 176 }
175 177
176 ret = stv06xx_write_sensor(sd, HDCS_REG_CONTROL(sd), val); 178 ret = stv06xx_write_sensor(sd, HDCS_REG_CONTROL(sd), val);
177 if (ret < 0) 179
180 /* Update the state if the write succeeded */
181 if (!ret)
178 hdcs->state = state; 182 hdcs->state = state;
179 183
180 return ret; 184 return ret;
diff --git a/drivers/media/video/gspca/sunplus.c b/drivers/media/video/gspca/sunplus.c
index 9623f294bdac..5127bbf9dd26 100644
--- a/drivers/media/video/gspca/sunplus.c
+++ b/drivers/media/video/gspca/sunplus.c
@@ -973,6 +973,8 @@ static int sd_start(struct gspca_dev *gspca_dev)
973 973
974 /* create the JPEG header */ 974 /* create the JPEG header */
975 sd->jpeg_hdr = kmalloc(JPEG_HDR_SZ, GFP_KERNEL); 975 sd->jpeg_hdr = kmalloc(JPEG_HDR_SZ, GFP_KERNEL);
976 if (!sd->jpeg_hdr)
977 return -ENOMEM;
976 jpeg_define(sd->jpeg_hdr, gspca_dev->height, gspca_dev->width, 978 jpeg_define(sd->jpeg_hdr, gspca_dev->height, gspca_dev->width,
977 0x22); /* JPEG 411 */ 979 0x22); /* JPEG 411 */
978 jpeg_set_qual(sd->jpeg_hdr, sd->quality); 980 jpeg_set_qual(sd->jpeg_hdr, sd->quality);
diff --git a/drivers/media/video/gspca/zc3xx.c b/drivers/media/video/gspca/zc3xx.c
index 08422d315e68..3d2756f7874a 100644
--- a/drivers/media/video/gspca/zc3xx.c
+++ b/drivers/media/video/gspca/zc3xx.c
@@ -7243,6 +7243,8 @@ static int sd_start(struct gspca_dev *gspca_dev)
7243 7243
7244 /* create the JPEG header */ 7244 /* create the JPEG header */
7245 sd->jpeg_hdr = kmalloc(JPEG_HDR_SZ, GFP_KERNEL); 7245 sd->jpeg_hdr = kmalloc(JPEG_HDR_SZ, GFP_KERNEL);
7246 if (!sd->jpeg_hdr)
7247 return -ENOMEM;
7246 jpeg_define(sd->jpeg_hdr, gspca_dev->height, gspca_dev->width, 7248 jpeg_define(sd->jpeg_hdr, gspca_dev->height, gspca_dev->width,
7247 0x21); /* JPEG 422 */ 7249 0x21); /* JPEG 422 */
7248 jpeg_set_qual(sd->jpeg_hdr, sd->quality); 7250 jpeg_set_qual(sd->jpeg_hdr, sd->quality);
diff --git a/drivers/media/video/mt9v011.c b/drivers/media/video/mt9v011.c
new file mode 100644
index 000000000000..b2260de645f0
--- /dev/null
+++ b/drivers/media/video/mt9v011.c
@@ -0,0 +1,496 @@
1/*
2 * mt9v011 -Micron 1/4-Inch VGA Digital Image Sensor
3 *
4 * Copyright (c) 2009 Mauro Carvalho Chehab (mchehab@redhat.com)
5 * This code is placed under the terms of the GNU General Public License v2
6 */
7
8#include <linux/i2c.h>
9#include <linux/videodev2.h>
10#include <linux/delay.h>
11#include <asm/div64.h>
12#include <media/v4l2-device.h>
13#include "mt9v011.h"
14#include <media/v4l2-i2c-drv.h>
15#include <media/v4l2-chip-ident.h>
16
17MODULE_DESCRIPTION("Micron mt9v011 sensor driver");
18MODULE_AUTHOR("Mauro Carvalho Chehab <mchehab@redhat.com>");
19MODULE_LICENSE("GPL");
20
21
22static int debug;
23module_param(debug, int, 0);
24MODULE_PARM_DESC(debug, "Debug level (0-2)");
25
26/* supported controls */
27static struct v4l2_queryctrl mt9v011_qctrl[] = {
28 {
29 .id = V4L2_CID_GAIN,
30 .type = V4L2_CTRL_TYPE_INTEGER,
31 .name = "Gain",
32 .minimum = 0,
33 .maximum = (1 << 10) - 1,
34 .step = 1,
35 .default_value = 0x0020,
36 .flags = 0,
37 }, {
38 .id = V4L2_CID_RED_BALANCE,
39 .type = V4L2_CTRL_TYPE_INTEGER,
40 .name = "Red Balance",
41 .minimum = -1 << 9,
42 .maximum = (1 << 9) - 1,
43 .step = 1,
44 .default_value = 0,
45 .flags = 0,
46 }, {
47 .id = V4L2_CID_BLUE_BALANCE,
48 .type = V4L2_CTRL_TYPE_INTEGER,
49 .name = "Blue Balance",
50 .minimum = -1 << 9,
51 .maximum = (1 << 9) - 1,
52 .step = 1,
53 .default_value = 0,
54 .flags = 0,
55 },
56};
57
58struct mt9v011 {
59 struct v4l2_subdev sd;
60 unsigned width, height;
61 unsigned xtal;
62
63 u16 global_gain, red_bal, blue_bal;
64};
65
66static inline struct mt9v011 *to_mt9v011(struct v4l2_subdev *sd)
67{
68 return container_of(sd, struct mt9v011, sd);
69}
70
71static int mt9v011_read(struct v4l2_subdev *sd, unsigned char addr)
72{
73 struct i2c_client *c = v4l2_get_subdevdata(sd);
74 __be16 buffer;
75 int rc, val;
76
77 rc = i2c_master_send(c, &addr, 1);
78 if (rc != 1)
79 v4l2_dbg(0, debug, sd,
80 "i2c i/o error: rc == %d (should be 1)\n", rc);
81
82 msleep(10);
83
84 rc = i2c_master_recv(c, (char *)&buffer, 2);
85 if (rc != 2)
86 v4l2_dbg(0, debug, sd,
87 "i2c i/o error: rc == %d (should be 2)\n", rc);
88
89 val = be16_to_cpu(buffer);
90
91 v4l2_dbg(2, debug, sd, "mt9v011: read 0x%02x = 0x%04x\n", addr, val);
92
93 return val;
94}
95
96static void mt9v011_write(struct v4l2_subdev *sd, unsigned char addr,
97 u16 value)
98{
99 struct i2c_client *c = v4l2_get_subdevdata(sd);
100 unsigned char buffer[3];
101 int rc;
102
103 buffer[0] = addr;
104 buffer[1] = value >> 8;
105 buffer[2] = value & 0xff;
106
107 v4l2_dbg(2, debug, sd,
108 "mt9v011: writing 0x%02x 0x%04x\n", buffer[0], value);
109 rc = i2c_master_send(c, buffer, 3);
110 if (rc != 3)
111 v4l2_dbg(0, debug, sd,
112 "i2c i/o error: rc == %d (should be 3)\n", rc);
113}
114
115
116struct i2c_reg_value {
117 unsigned char reg;
118 u16 value;
119};
120
121/*
122 * Values used at the original driver
123 * Some values are marked as Reserved at the datasheet
124 */
125static const struct i2c_reg_value mt9v011_init_default[] = {
126 { R0D_MT9V011_RESET, 0x0001 },
127 { R0D_MT9V011_RESET, 0x0000 },
128
129 { R0C_MT9V011_SHUTTER_DELAY, 0x0000 },
130 { R09_MT9V011_SHUTTER_WIDTH, 0x1fc },
131
132 { R0A_MT9V011_CLK_SPEED, 0x0000 },
133 { R1E_MT9V011_DIGITAL_ZOOM, 0x0000 },
134 { R20_MT9V011_READ_MODE, 0x1000 },
135
136 { R07_MT9V011_OUT_CTRL, 0x0002 }, /* chip enable */
137};
138
139static void set_balance(struct v4l2_subdev *sd)
140{
141 struct mt9v011 *core = to_mt9v011(sd);
142 u16 green1_gain, green2_gain, blue_gain, red_gain;
143
144 green1_gain = core->global_gain;
145 green2_gain = core->global_gain;
146
147 blue_gain = core->global_gain +
148 core->global_gain * core->blue_bal / (1 << 9);
149
150 red_gain = core->global_gain +
151 core->global_gain * core->blue_bal / (1 << 9);
152
153 mt9v011_write(sd, R2B_MT9V011_GREEN_1_GAIN, green1_gain);
154 mt9v011_write(sd, R2E_MT9V011_GREEN_2_GAIN, green1_gain);
155 mt9v011_write(sd, R2C_MT9V011_BLUE_GAIN, blue_gain);
156 mt9v011_write(sd, R2D_MT9V011_RED_GAIN, red_gain);
157}
158
159static void calc_fps(struct v4l2_subdev *sd)
160{
161 struct mt9v011 *core = to_mt9v011(sd);
162 unsigned height, width, hblank, vblank, speed;
163 unsigned row_time, t_time;
164 u64 frames_per_ms;
165 unsigned tmp;
166
167 height = mt9v011_read(sd, R03_MT9V011_HEIGHT);
168 width = mt9v011_read(sd, R04_MT9V011_WIDTH);
169 hblank = mt9v011_read(sd, R05_MT9V011_HBLANK);
170 vblank = mt9v011_read(sd, R06_MT9V011_VBLANK);
171 speed = mt9v011_read(sd, R0A_MT9V011_CLK_SPEED);
172
173 row_time = (width + 113 + hblank) * (speed + 2);
174 t_time = row_time * (height + vblank + 1);
175
176 frames_per_ms = core->xtal * 1000l;
177 do_div(frames_per_ms, t_time);
178 tmp = frames_per_ms;
179
180 v4l2_dbg(1, debug, sd, "Programmed to %u.%03u fps (%d pixel clcks)\n",
181 tmp / 1000, tmp % 1000, t_time);
182}
183
184static void set_res(struct v4l2_subdev *sd)
185{
186 struct mt9v011 *core = to_mt9v011(sd);
187 unsigned vstart, hstart;
188
189 /*
190 * The mt9v011 doesn't have scaling. So, in order to select the desired
191 * resolution, we're cropping at the middle of the sensor.
192 * hblank and vblank should be adjusted, in order to warrant that
193 * we'll preserve the line timings for 30 fps, no matter what resolution
194 * is selected.
195 * NOTE: datasheet says that width (and height) should be filled with
196 * width-1. However, this doesn't work, since one pixel per line will
197 * be missing.
198 */
199
200 hstart = 14 + (640 - core->width) / 2;
201 mt9v011_write(sd, R02_MT9V011_COLSTART, hstart);
202 mt9v011_write(sd, R04_MT9V011_WIDTH, core->width);
203 mt9v011_write(sd, R05_MT9V011_HBLANK, 771 - core->width);
204
205 vstart = 8 + (480 - core->height) / 2;
206 mt9v011_write(sd, R01_MT9V011_ROWSTART, vstart);
207 mt9v011_write(sd, R03_MT9V011_HEIGHT, core->height);
208 mt9v011_write(sd, R06_MT9V011_VBLANK, 508 - core->height);
209
210 calc_fps(sd);
211};
212
213static int mt9v011_reset(struct v4l2_subdev *sd, u32 val)
214{
215 int i;
216
217 for (i = 0; i < ARRAY_SIZE(mt9v011_init_default); i++)
218 mt9v011_write(sd, mt9v011_init_default[i].reg,
219 mt9v011_init_default[i].value);
220
221 set_balance(sd);
222 set_res(sd);
223
224 return 0;
225};
226
227static int mt9v011_g_ctrl(struct v4l2_subdev *sd, struct v4l2_control *ctrl)
228{
229 struct mt9v011 *core = to_mt9v011(sd);
230
231 v4l2_dbg(1, debug, sd, "g_ctrl called\n");
232
233 switch (ctrl->id) {
234 case V4L2_CID_GAIN:
235 ctrl->value = core->global_gain;
236 return 0;
237 case V4L2_CID_RED_BALANCE:
238 ctrl->value = core->red_bal;
239 return 0;
240 case V4L2_CID_BLUE_BALANCE:
241 ctrl->value = core->blue_bal;
242 return 0;
243 }
244 return -EINVAL;
245}
246
247static int mt9v011_queryctrl(struct v4l2_subdev *sd, struct v4l2_queryctrl *qc)
248{
249 int i;
250
251 v4l2_dbg(1, debug, sd, "queryctrl called\n");
252
253 for (i = 0; i < ARRAY_SIZE(mt9v011_qctrl); i++)
254 if (qc->id && qc->id == mt9v011_qctrl[i].id) {
255 memcpy(qc, &(mt9v011_qctrl[i]),
256 sizeof(*qc));
257 return 0;
258 }
259
260 return -EINVAL;
261}
262
263
264static int mt9v011_s_ctrl(struct v4l2_subdev *sd, struct v4l2_control *ctrl)
265{
266 struct mt9v011 *core = to_mt9v011(sd);
267 u8 i, n;
268 n = ARRAY_SIZE(mt9v011_qctrl);
269
270 for (i = 0; i < n; i++) {
271 if (ctrl->id != mt9v011_qctrl[i].id)
272 continue;
273 if (ctrl->value < mt9v011_qctrl[i].minimum ||
274 ctrl->value > mt9v011_qctrl[i].maximum)
275 return -ERANGE;
276 v4l2_dbg(1, debug, sd, "s_ctrl: id=%d, value=%d\n",
277 ctrl->id, ctrl->value);
278 break;
279 }
280
281 switch (ctrl->id) {
282 case V4L2_CID_GAIN:
283 core->global_gain = ctrl->value;
284 break;
285 case V4L2_CID_RED_BALANCE:
286 core->red_bal = ctrl->value;
287 break;
288 case V4L2_CID_BLUE_BALANCE:
289 core->blue_bal = ctrl->value;
290 break;
291 default:
292 return -EINVAL;
293 }
294
295 set_balance(sd);
296
297 return 0;
298}
299
300static int mt9v011_enum_fmt(struct v4l2_subdev *sd, struct v4l2_fmtdesc *fmt)
301{
302 if (fmt->index > 0)
303 return -EINVAL;
304
305 fmt->flags = 0;
306 strcpy(fmt->description, "8 bpp Bayer GRGR..BGBG");
307 fmt->pixelformat = V4L2_PIX_FMT_SGRBG8;
308
309 return 0;
310}
311
312static int mt9v011_try_fmt(struct v4l2_subdev *sd, struct v4l2_format *fmt)
313{
314 struct v4l2_pix_format *pix = &fmt->fmt.pix;
315
316 if (pix->pixelformat != V4L2_PIX_FMT_SGRBG8)
317 return -EINVAL;
318
319 v4l_bound_align_image(&pix->width, 48, 639, 1,
320 &pix->height, 32, 480, 1, 0);
321
322 return 0;
323}
324
325static int mt9v011_s_fmt(struct v4l2_subdev *sd, struct v4l2_format *fmt)
326{
327 struct v4l2_pix_format *pix = &fmt->fmt.pix;
328 struct mt9v011 *core = to_mt9v011(sd);
329 int rc;
330
331 rc = mt9v011_try_fmt(sd, fmt);
332 if (rc < 0)
333 return -EINVAL;
334
335 core->width = pix->width;
336 core->height = pix->height;
337
338 set_res(sd);
339
340 return 0;
341}
342
343static int mt9v011_s_config(struct v4l2_subdev *sd, int dumb, void *data)
344{
345 struct mt9v011 *core = to_mt9v011(sd);
346 unsigned *xtal = data;
347
348 v4l2_dbg(1, debug, sd, "s_config called\n");
349
350 if (xtal) {
351 core->xtal = *xtal;
352 v4l2_dbg(1, debug, sd, "xtal set to %d.%03d MHz\n",
353 *xtal / 1000000, (*xtal / 1000) % 1000);
354 }
355
356 return 0;
357}
358
359
360#ifdef CONFIG_VIDEO_ADV_DEBUG
361static int mt9v011_g_register(struct v4l2_subdev *sd,
362 struct v4l2_dbg_register *reg)
363{
364 struct i2c_client *client = v4l2_get_subdevdata(sd);
365
366 if (!v4l2_chip_match_i2c_client(client, &reg->match))
367 return -EINVAL;
368 if (!capable(CAP_SYS_ADMIN))
369 return -EPERM;
370
371 reg->val = mt9v011_read(sd, reg->reg & 0xff);
372 reg->size = 2;
373
374 return 0;
375}
376
377static int mt9v011_s_register(struct v4l2_subdev *sd,
378 struct v4l2_dbg_register *reg)
379{
380 struct i2c_client *client = v4l2_get_subdevdata(sd);
381
382 if (!v4l2_chip_match_i2c_client(client, &reg->match))
383 return -EINVAL;
384 if (!capable(CAP_SYS_ADMIN))
385 return -EPERM;
386
387 mt9v011_write(sd, reg->reg & 0xff, reg->val & 0xffff);
388
389 return 0;
390}
391#endif
392
393static int mt9v011_g_chip_ident(struct v4l2_subdev *sd,
394 struct v4l2_dbg_chip_ident *chip)
395{
396 struct i2c_client *client = v4l2_get_subdevdata(sd);
397
398 return v4l2_chip_ident_i2c_client(client, chip, V4L2_IDENT_MT9V011,
399 MT9V011_VERSION);
400}
401
402static const struct v4l2_subdev_core_ops mt9v011_core_ops = {
403 .queryctrl = mt9v011_queryctrl,
404 .g_ctrl = mt9v011_g_ctrl,
405 .s_ctrl = mt9v011_s_ctrl,
406 .reset = mt9v011_reset,
407 .s_config = mt9v011_s_config,
408 .g_chip_ident = mt9v011_g_chip_ident,
409#ifdef CONFIG_VIDEO_ADV_DEBUG
410 .g_register = mt9v011_g_register,
411 .s_register = mt9v011_s_register,
412#endif
413};
414
415static const struct v4l2_subdev_video_ops mt9v011_video_ops = {
416 .enum_fmt = mt9v011_enum_fmt,
417 .try_fmt = mt9v011_try_fmt,
418 .s_fmt = mt9v011_s_fmt,
419};
420
421static const struct v4l2_subdev_ops mt9v011_ops = {
422 .core = &mt9v011_core_ops,
423 .video = &mt9v011_video_ops,
424};
425
426
427/****************************************************************************
428 I2C Client & Driver
429 ****************************************************************************/
430
431static int mt9v011_probe(struct i2c_client *c,
432 const struct i2c_device_id *id)
433{
434 u16 version;
435 struct mt9v011 *core;
436 struct v4l2_subdev *sd;
437
438 /* Check if the adapter supports the needed features */
439 if (!i2c_check_functionality(c->adapter,
440 I2C_FUNC_SMBUS_READ_BYTE | I2C_FUNC_SMBUS_WRITE_BYTE_DATA))
441 return -EIO;
442
443 core = kzalloc(sizeof(struct mt9v011), GFP_KERNEL);
444 if (!core)
445 return -ENOMEM;
446
447 sd = &core->sd;
448 v4l2_i2c_subdev_init(sd, c, &mt9v011_ops);
449
450 /* Check if the sensor is really a MT9V011 */
451 version = mt9v011_read(sd, R00_MT9V011_CHIP_VERSION);
452 if (version != MT9V011_VERSION) {
453 v4l2_info(sd, "*** unknown micron chip detected (0x%04x.\n",
454 version);
455 kfree(core);
456 return -EINVAL;
457 }
458
459 core->global_gain = 0x0024;
460 core->width = 640;
461 core->height = 480;
462 core->xtal = 27000000; /* Hz */
463
464 v4l_info(c, "chip found @ 0x%02x (%s)\n",
465 c->addr << 1, c->adapter->name);
466
467 return 0;
468}
469
470static int mt9v011_remove(struct i2c_client *c)
471{
472 struct v4l2_subdev *sd = i2c_get_clientdata(c);
473
474 v4l2_dbg(1, debug, sd,
475 "mt9v011.c: removing mt9v011 adapter on address 0x%x\n",
476 c->addr << 1);
477
478 v4l2_device_unregister_subdev(sd);
479 kfree(to_mt9v011(sd));
480 return 0;
481}
482
483/* ----------------------------------------------------------------------- */
484
485static const struct i2c_device_id mt9v011_id[] = {
486 { "mt9v011", 0 },
487 { }
488};
489MODULE_DEVICE_TABLE(i2c, mt9v011_id);
490
491static struct v4l2_i2c_driver_data v4l2_i2c_data = {
492 .name = "mt9v011",
493 .probe = mt9v011_probe,
494 .remove = mt9v011_remove,
495 .id_table = mt9v011_id,
496};
diff --git a/drivers/media/video/mt9v011.h b/drivers/media/video/mt9v011.h
new file mode 100644
index 000000000000..9e443ee30558
--- /dev/null
+++ b/drivers/media/video/mt9v011.h
@@ -0,0 +1,35 @@
1/*
2 * mt9v011 -Micron 1/4-Inch VGA Digital Image Sensor
3 *
4 * Copyright (c) 2009 Mauro Carvalho Chehab (mchehab@redhat.com)
5 * This code is placed under the terms of the GNU General Public License v2
6 */
7
8#ifndef MT9V011_H_
9#define MT9V011_H_
10
11#define R00_MT9V011_CHIP_VERSION 0x00
12#define R01_MT9V011_ROWSTART 0x01
13#define R02_MT9V011_COLSTART 0x02
14#define R03_MT9V011_HEIGHT 0x03
15#define R04_MT9V011_WIDTH 0x04
16#define R05_MT9V011_HBLANK 0x05
17#define R06_MT9V011_VBLANK 0x06
18#define R07_MT9V011_OUT_CTRL 0x07
19#define R09_MT9V011_SHUTTER_WIDTH 0x09
20#define R0A_MT9V011_CLK_SPEED 0x0a
21#define R0B_MT9V011_RESTART 0x0b
22#define R0C_MT9V011_SHUTTER_DELAY 0x0c
23#define R0D_MT9V011_RESET 0x0d
24#define R1E_MT9V011_DIGITAL_ZOOM 0x1e
25#define R20_MT9V011_READ_MODE 0x20
26#define R2B_MT9V011_GREEN_1_GAIN 0x2b
27#define R2C_MT9V011_BLUE_GAIN 0x2c
28#define R2D_MT9V011_RED_GAIN 0x2d
29#define R2E_MT9V011_GREEN_2_GAIN 0x2e
30#define R35_MT9V011_GLOBAL_GAIN 0x35
31#define RF1_MT9V011_CHIP_ENABLE 0xf1
32
33#define MT9V011_VERSION 0x8243
34
35#endif
diff --git a/drivers/media/video/pwc/pwc-if.c b/drivers/media/video/pwc/pwc-if.c
index db25c3034c11..8d17cf613306 100644
--- a/drivers/media/video/pwc/pwc-if.c
+++ b/drivers/media/video/pwc/pwc-if.c
@@ -62,6 +62,7 @@
62#include <linux/module.h> 62#include <linux/module.h>
63#include <linux/poll.h> 63#include <linux/poll.h>
64#include <linux/slab.h> 64#include <linux/slab.h>
65#include <linux/smp_lock.h>
65#ifdef CONFIG_USB_PWC_INPUT_EVDEV 66#ifdef CONFIG_USB_PWC_INPUT_EVDEV
66#include <linux/usb/input.h> 67#include <linux/usb/input.h>
67#endif 68#endif
diff --git a/drivers/media/video/pwc/pwc.h b/drivers/media/video/pwc/pwc.h
index 0be6f814f539..0b658dee05a4 100644
--- a/drivers/media/video/pwc/pwc.h
+++ b/drivers/media/video/pwc/pwc.h
@@ -29,7 +29,6 @@
29#include <linux/usb.h> 29#include <linux/usb.h>
30#include <linux/spinlock.h> 30#include <linux/spinlock.h>
31#include <linux/wait.h> 31#include <linux/wait.h>
32#include <linux/smp_lock.h>
33#include <linux/version.h> 32#include <linux/version.h>
34#include <linux/mutex.h> 33#include <linux/mutex.h>
35#include <linux/mm.h> 34#include <linux/mm.h>
diff --git a/drivers/media/video/s2255drv.c b/drivers/media/video/s2255drv.c
index 6be845ccc7d7..9e3262c0ba37 100644
--- a/drivers/media/video/s2255drv.c
+++ b/drivers/media/video/s2255drv.c
@@ -48,6 +48,7 @@
48#include <linux/videodev2.h> 48#include <linux/videodev2.h>
49#include <linux/version.h> 49#include <linux/version.h>
50#include <linux/mm.h> 50#include <linux/mm.h>
51#include <linux/smp_lock.h>
51#include <media/videobuf-vmalloc.h> 52#include <media/videobuf-vmalloc.h>
52#include <media/v4l2-common.h> 53#include <media/v4l2-common.h>
53#include <media/v4l2-ioctl.h> 54#include <media/v4l2-ioctl.h>
diff --git a/drivers/media/video/saa5246a.c b/drivers/media/video/saa5246a.c
index 155804b061e9..b624a4c01fdc 100644
--- a/drivers/media/video/saa5246a.c
+++ b/drivers/media/video/saa5246a.c
@@ -43,7 +43,6 @@
43#include <linux/mm.h> 43#include <linux/mm.h>
44#include <linux/init.h> 44#include <linux/init.h>
45#include <linux/i2c.h> 45#include <linux/i2c.h>
46#include <linux/smp_lock.h>
47#include <linux/mutex.h> 46#include <linux/mutex.h>
48#include <linux/videotext.h> 47#include <linux/videotext.h>
49#include <linux/videodev2.h> 48#include <linux/videodev2.h>
diff --git a/drivers/media/video/saa5249.c b/drivers/media/video/saa5249.c
index 271d6e931b75..12835fb82c95 100644
--- a/drivers/media/video/saa5249.c
+++ b/drivers/media/video/saa5249.c
@@ -46,7 +46,6 @@
46#include <linux/mm.h> 46#include <linux/mm.h>
47#include <linux/init.h> 47#include <linux/init.h>
48#include <linux/i2c.h> 48#include <linux/i2c.h>
49#include <linux/smp_lock.h>
50#include <linux/mutex.h> 49#include <linux/mutex.h>
51#include <linux/delay.h> 50#include <linux/delay.h>
52#include <linux/videotext.h> 51#include <linux/videotext.h>
diff --git a/drivers/media/video/saa7134/saa7134-empress.c b/drivers/media/video/saa7134/saa7134-empress.c
index add1757f8930..296788c3bf0e 100644
--- a/drivers/media/video/saa7134/saa7134-empress.c
+++ b/drivers/media/video/saa7134/saa7134-empress.c
@@ -22,6 +22,7 @@
22#include <linux/module.h> 22#include <linux/module.h>
23#include <linux/kernel.h> 23#include <linux/kernel.h>
24#include <linux/slab.h> 24#include <linux/slab.h>
25#include <linux/smp_lock.h>
25#include <linux/delay.h> 26#include <linux/delay.h>
26 27
27#include "saa7134-reg.h" 28#include "saa7134-reg.h"
diff --git a/drivers/media/video/se401.c b/drivers/media/video/se401.c
index c8f05297d0f0..85ffc2cba039 100644
--- a/drivers/media/video/se401.c
+++ b/drivers/media/video/se401.c
@@ -31,6 +31,7 @@ static const char version[] = "0.24";
31#include <linux/init.h> 31#include <linux/init.h>
32#include <linux/vmalloc.h> 32#include <linux/vmalloc.h>
33#include <linux/slab.h> 33#include <linux/slab.h>
34#include <linux/smp_lock.h>
34#include <linux/pagemap.h> 35#include <linux/pagemap.h>
35#include <linux/usb.h> 36#include <linux/usb.h>
36#include "se401.h" 37#include "se401.h"
diff --git a/drivers/media/video/soc_camera.c b/drivers/media/video/soc_camera.c
index 16f595d4337a..9f5ae8167855 100644
--- a/drivers/media/video/soc_camera.c
+++ b/drivers/media/video/soc_camera.c
@@ -237,11 +237,11 @@ static int soc_camera_init_user_formats(struct soc_camera_device *icd)
237 return -ENOMEM; 237 return -ENOMEM;
238 238
239 icd->num_user_formats = fmts; 239 icd->num_user_formats = fmts;
240 fmts = 0;
241 240
242 dev_dbg(&icd->dev, "Found %d supported formats.\n", fmts); 241 dev_dbg(&icd->dev, "Found %d supported formats.\n", fmts);
243 242
244 /* Second pass - actually fill data formats */ 243 /* Second pass - actually fill data formats */
244 fmts = 0;
245 for (i = 0; i < icd->num_formats; i++) 245 for (i = 0; i < icd->num_formats; i++)
246 if (!ici->ops->get_formats) { 246 if (!ici->ops->get_formats) {
247 icd->user_formats[i].host_fmt = icd->formats + i; 247 icd->user_formats[i].host_fmt = icd->formats + i;
@@ -877,8 +877,11 @@ static int soc_camera_probe(struct device *dev)
877 (unsigned short)~0; 877 (unsigned short)~0;
878 878
879 ret = soc_camera_init_user_formats(icd); 879 ret = soc_camera_init_user_formats(icd);
880 if (ret < 0) 880 if (ret < 0) {
881 if (icd->ops->remove)
882 icd->ops->remove(icd);
881 goto eiufmt; 883 goto eiufmt;
884 }
882 885
883 icd->height = DEFAULT_HEIGHT; 886 icd->height = DEFAULT_HEIGHT;
884 icd->width = DEFAULT_WIDTH; 887 icd->width = DEFAULT_WIDTH;
@@ -902,8 +905,10 @@ static int soc_camera_remove(struct device *dev)
902{ 905{
903 struct soc_camera_device *icd = to_soc_camera_dev(dev); 906 struct soc_camera_device *icd = to_soc_camera_dev(dev);
904 907
908 mutex_lock(&icd->video_lock);
905 if (icd->ops->remove) 909 if (icd->ops->remove)
906 icd->ops->remove(icd); 910 icd->ops->remove(icd);
911 mutex_unlock(&icd->video_lock);
907 912
908 soc_camera_free_user_formats(icd); 913 soc_camera_free_user_formats(icd);
909 914
@@ -1145,6 +1150,7 @@ evidallocd:
1145} 1150}
1146EXPORT_SYMBOL(soc_camera_video_start); 1151EXPORT_SYMBOL(soc_camera_video_start);
1147 1152
1153/* Called from client .remove() methods with .video_lock held */
1148void soc_camera_video_stop(struct soc_camera_device *icd) 1154void soc_camera_video_stop(struct soc_camera_device *icd)
1149{ 1155{
1150 struct video_device *vdev = icd->vdev; 1156 struct video_device *vdev = icd->vdev;
@@ -1154,10 +1160,8 @@ void soc_camera_video_stop(struct soc_camera_device *icd)
1154 if (!icd->dev.parent || !vdev) 1160 if (!icd->dev.parent || !vdev)
1155 return; 1161 return;
1156 1162
1157 mutex_lock(&icd->video_lock);
1158 video_unregister_device(vdev); 1163 video_unregister_device(vdev);
1159 icd->vdev = NULL; 1164 icd->vdev = NULL;
1160 mutex_unlock(&icd->video_lock);
1161} 1165}
1162EXPORT_SYMBOL(soc_camera_video_stop); 1166EXPORT_SYMBOL(soc_camera_video_stop);
1163 1167
diff --git a/drivers/media/video/stk-webcam.c b/drivers/media/video/stk-webcam.c
index 2e5937047278..4d6785e63455 100644
--- a/drivers/media/video/stk-webcam.c
+++ b/drivers/media/video/stk-webcam.c
@@ -27,6 +27,7 @@
27#include <linux/kernel.h> 27#include <linux/kernel.h>
28#include <linux/errno.h> 28#include <linux/errno.h>
29#include <linux/slab.h> 29#include <linux/slab.h>
30#include <linux/smp_lock.h>
30 31
31#include <linux/usb.h> 32#include <linux/usb.h>
32#include <linux/mm.h> 33#include <linux/mm.h>
diff --git a/drivers/media/video/stradis.c b/drivers/media/video/stradis.c
index 0eb313082c97..eaada39c76fd 100644
--- a/drivers/media/video/stradis.c
+++ b/drivers/media/video/stradis.c
@@ -26,6 +26,7 @@
26#include <linux/kernel.h> 26#include <linux/kernel.h>
27#include <linux/major.h> 27#include <linux/major.h>
28#include <linux/slab.h> 28#include <linux/slab.h>
29#include <linux/smp_lock.h>
29#include <linux/mm.h> 30#include <linux/mm.h>
30#include <linux/init.h> 31#include <linux/init.h>
31#include <linux/poll.h> 32#include <linux/poll.h>
diff --git a/drivers/media/video/stv680.c b/drivers/media/video/stv680.c
index 75f286f7a2e9..8b4e7dafce7b 100644
--- a/drivers/media/video/stv680.c
+++ b/drivers/media/video/stv680.c
@@ -62,6 +62,7 @@
62#include <linux/init.h> 62#include <linux/init.h>
63#include <linux/vmalloc.h> 63#include <linux/vmalloc.h>
64#include <linux/slab.h> 64#include <linux/slab.h>
65#include <linux/smp_lock.h>
65#include <linux/pagemap.h> 66#include <linux/pagemap.h>
66#include <linux/errno.h> 67#include <linux/errno.h>
67#include <linux/videodev.h> 68#include <linux/videodev.h>
diff --git a/drivers/media/video/usbvideo/vicam.c b/drivers/media/video/usbvideo/vicam.c
index 8d73979596f9..45fce39ec9ad 100644
--- a/drivers/media/video/usbvideo/vicam.c
+++ b/drivers/media/video/usbvideo/vicam.c
@@ -43,6 +43,7 @@
43#include <linux/vmalloc.h> 43#include <linux/vmalloc.h>
44#include <linux/mm.h> 44#include <linux/mm.h>
45#include <linux/slab.h> 45#include <linux/slab.h>
46#include <linux/smp_lock.h>
46#include <linux/mutex.h> 47#include <linux/mutex.h>
47#include <linux/firmware.h> 48#include <linux/firmware.h>
48#include <linux/ihex.h> 49#include <linux/ihex.h>
diff --git a/drivers/media/video/usbvision/usbvision-video.c b/drivers/media/video/usbvision/usbvision-video.c
index 90b58914f984..90d9b5c0e9a7 100644
--- a/drivers/media/video/usbvision/usbvision-video.c
+++ b/drivers/media/video/usbvision/usbvision-video.c
@@ -50,6 +50,7 @@
50#include <linux/list.h> 50#include <linux/list.h>
51#include <linux/timer.h> 51#include <linux/timer.h>
52#include <linux/slab.h> 52#include <linux/slab.h>
53#include <linux/smp_lock.h>
53#include <linux/mm.h> 54#include <linux/mm.h>
54#include <linux/utsname.h> 55#include <linux/utsname.h>
55#include <linux/highmem.h> 56#include <linux/highmem.h>
diff --git a/drivers/media/video/v4l2-dev.c b/drivers/media/video/v4l2-dev.c
index 31eac66411d7..a7f1b69a7dab 100644
--- a/drivers/media/video/v4l2-dev.c
+++ b/drivers/media/video/v4l2-dev.c
@@ -25,7 +25,6 @@
25#include <linux/init.h> 25#include <linux/init.h>
26#include <linux/kmod.h> 26#include <linux/kmod.h>
27#include <linux/slab.h> 27#include <linux/slab.h>
28#include <linux/smp_lock.h>
29#include <asm/uaccess.h> 28#include <asm/uaccess.h>
30#include <asm/system.h> 29#include <asm/system.h>
31 30
diff --git a/drivers/media/video/vivi.c b/drivers/media/video/vivi.c
index cd7266858462..7705fc6baf00 100644
--- a/drivers/media/video/vivi.c
+++ b/drivers/media/video/vivi.c
@@ -343,6 +343,53 @@ static struct bar_std bars[] = {
343#define TO_U(r, g, b) \ 343#define TO_U(r, g, b) \
344 (((-9714 * r - 19070 * g + 28784 * b + 32768) >> 16) + 128) 344 (((-9714 * r - 19070 * g + 28784 * b + 32768) >> 16) + 128)
345 345
346/* precalculate color bar values to speed up rendering */
347static void precalculate_bars(struct vivi_fh *fh)
348{
349 struct vivi_dev *dev = fh->dev;
350 unsigned char r, g, b;
351 int k, is_yuv;
352
353 fh->input = dev->input;
354
355 for (k = 0; k < 8; k++) {
356 r = bars[fh->input].bar[k][0];
357 g = bars[fh->input].bar[k][1];
358 b = bars[fh->input].bar[k][2];
359 is_yuv = 0;
360
361 switch (fh->fmt->fourcc) {
362 case V4L2_PIX_FMT_YUYV:
363 case V4L2_PIX_FMT_UYVY:
364 is_yuv = 1;
365 break;
366 case V4L2_PIX_FMT_RGB565:
367 case V4L2_PIX_FMT_RGB565X:
368 r >>= 3;
369 g >>= 2;
370 b >>= 3;
371 break;
372 case V4L2_PIX_FMT_RGB555:
373 case V4L2_PIX_FMT_RGB555X:
374 r >>= 3;
375 g >>= 3;
376 b >>= 3;
377 break;
378 }
379
380 if (is_yuv) {
381 fh->bars[k][0] = TO_Y(r, g, b); /* Luma */
382 fh->bars[k][1] = TO_U(r, g, b); /* Cb */
383 fh->bars[k][2] = TO_V(r, g, b); /* Cr */
384 } else {
385 fh->bars[k][0] = r;
386 fh->bars[k][1] = g;
387 fh->bars[k][2] = b;
388 }
389 }
390
391}
392
346#define TSTAMP_MIN_Y 24 393#define TSTAMP_MIN_Y 24
347#define TSTAMP_MAX_Y (TSTAMP_MIN_Y + 15) 394#define TSTAMP_MAX_Y (TSTAMP_MIN_Y + 15)
348#define TSTAMP_INPUT_X 10 395#define TSTAMP_INPUT_X 10
@@ -755,6 +802,8 @@ buffer_prepare(struct videobuf_queue *vq, struct videobuf_buffer *vb,
755 buf->vb.height = fh->height; 802 buf->vb.height = fh->height;
756 buf->vb.field = field; 803 buf->vb.field = field;
757 804
805 precalculate_bars(fh);
806
758 if (VIDEOBUF_NEEDS_INIT == buf->vb.state) { 807 if (VIDEOBUF_NEEDS_INIT == buf->vb.state) {
759 rc = videobuf_iolock(vq, &buf->vb, NULL); 808 rc = videobuf_iolock(vq, &buf->vb, NULL);
760 if (rc < 0) 809 if (rc < 0)
@@ -893,53 +942,6 @@ static int vidioc_try_fmt_vid_cap(struct file *file, void *priv,
893 return 0; 942 return 0;
894} 943}
895 944
896/* precalculate color bar values to speed up rendering */
897static void precalculate_bars(struct vivi_fh *fh)
898{
899 struct vivi_dev *dev = fh->dev;
900 unsigned char r, g, b;
901 int k, is_yuv;
902
903 fh->input = dev->input;
904
905 for (k = 0; k < 8; k++) {
906 r = bars[fh->input].bar[k][0];
907 g = bars[fh->input].bar[k][1];
908 b = bars[fh->input].bar[k][2];
909 is_yuv = 0;
910
911 switch (fh->fmt->fourcc) {
912 case V4L2_PIX_FMT_YUYV:
913 case V4L2_PIX_FMT_UYVY:
914 is_yuv = 1;
915 break;
916 case V4L2_PIX_FMT_RGB565:
917 case V4L2_PIX_FMT_RGB565X:
918 r >>= 3;
919 g >>= 2;
920 b >>= 3;
921 break;
922 case V4L2_PIX_FMT_RGB555:
923 case V4L2_PIX_FMT_RGB555X:
924 r >>= 3;
925 g >>= 3;
926 b >>= 3;
927 break;
928 }
929
930 if (is_yuv) {
931 fh->bars[k][0] = TO_Y(r, g, b); /* Luma */
932 fh->bars[k][1] = TO_U(r, g, b); /* Cb */
933 fh->bars[k][2] = TO_V(r, g, b); /* Cr */
934 } else {
935 fh->bars[k][0] = r;
936 fh->bars[k][1] = g;
937 fh->bars[k][2] = b;
938 }
939 }
940
941}
942
943/*FIXME: This seems to be generic enough to be at videodev2 */ 945/*FIXME: This seems to be generic enough to be at videodev2 */
944static int vidioc_s_fmt_vid_cap(struct file *file, void *priv, 946static int vidioc_s_fmt_vid_cap(struct file *file, void *priv,
945 struct v4l2_format *f) 947 struct v4l2_format *f)
@@ -965,8 +967,6 @@ static int vidioc_s_fmt_vid_cap(struct file *file, void *priv,
965 fh->vb_vidq.field = f->fmt.pix.field; 967 fh->vb_vidq.field = f->fmt.pix.field;
966 fh->type = f->type; 968 fh->type = f->type;
967 969
968 precalculate_bars(fh);
969
970 ret = 0; 970 ret = 0;
971out: 971out:
972 mutex_unlock(&q->vb_lock); 972 mutex_unlock(&q->vb_lock);
@@ -1357,6 +1357,7 @@ static int __init vivi_create_instance(int inst)
1357 goto unreg_dev; 1357 goto unreg_dev;
1358 1358
1359 *vfd = vivi_template; 1359 *vfd = vivi_template;
1360 vfd->debug = debug;
1360 1361
1361 ret = video_register_device(vfd, VFL_TYPE_GRABBER, video_nr); 1362 ret = video_register_device(vfd, VFL_TYPE_GRABBER, video_nr);
1362 if (ret < 0) 1363 if (ret < 0)
diff --git a/drivers/media/video/zoran/zoran_driver.c b/drivers/media/video/zoran/zoran_driver.c
index 3d7df32a3d87..bcdefb1bcb3d 100644
--- a/drivers/media/video/zoran/zoran_driver.c
+++ b/drivers/media/video/zoran/zoran_driver.c
@@ -49,6 +49,7 @@
49#include <linux/module.h> 49#include <linux/module.h>
50#include <linux/delay.h> 50#include <linux/delay.h>
51#include <linux/slab.h> 51#include <linux/slab.h>
52#include <linux/smp_lock.h>
52#include <linux/pci.h> 53#include <linux/pci.h>
53#include <linux/vmalloc.h> 54#include <linux/vmalloc.h>
54#include <linux/wait.h> 55#include <linux/wait.h>
diff --git a/drivers/mfd/dm355evm_msp.c b/drivers/mfd/dm355evm_msp.c
index 7ac12cb0be4a..5b6e58a3ba46 100644
--- a/drivers/mfd/dm355evm_msp.c
+++ b/drivers/mfd/dm355evm_msp.c
@@ -32,8 +32,7 @@
32 * This driver was tested with firmware revision A4. 32 * This driver was tested with firmware revision A4.
33 */ 33 */
34 34
35#if defined(CONFIG_KEYBOARD_DM355EVM) \ 35#if defined(CONFIG_INPUT_DM355EVM) || defined(CONFIG_INPUT_DM355EVM_MODULE)
36 || defined(CONFIG_KEYBOARD_DM355EVM_MODULE)
37#define msp_has_keyboard() true 36#define msp_has_keyboard() true
38#else 37#else
39#define msp_has_keyboard() false 38#define msp_has_keyboard() false
diff --git a/drivers/mfd/ezx-pcap.c b/drivers/mfd/ezx-pcap.c
index 671a7efe86a8..c1de4afa89a6 100644
--- a/drivers/mfd/ezx-pcap.c
+++ b/drivers/mfd/ezx-pcap.c
@@ -238,8 +238,10 @@ static irqreturn_t pcap_adc_irq(int irq, void *_pcap)
238 mutex_lock(&pcap->adc_mutex); 238 mutex_lock(&pcap->adc_mutex);
239 req = pcap->adc_queue[pcap->adc_head]; 239 req = pcap->adc_queue[pcap->adc_head];
240 240
241 if (WARN(!req, KERN_WARNING "adc irq without pending request\n")) 241 if (WARN(!req, KERN_WARNING "adc irq without pending request\n")) {
242 mutex_unlock(&pcap->adc_mutex);
242 return IRQ_HANDLED; 243 return IRQ_HANDLED;
244 }
243 245
244 /* read requested channels results */ 246 /* read requested channels results */
245 ezx_pcap_read(pcap, PCAP_REG_ADC, &tmp); 247 ezx_pcap_read(pcap, PCAP_REG_ADC, &tmp);
diff --git a/drivers/mfd/sm501.c b/drivers/mfd/sm501.c
index 4c7b7962f6b8..0cc5eeff5ee8 100644
--- a/drivers/mfd/sm501.c
+++ b/drivers/mfd/sm501.c
@@ -367,7 +367,8 @@ int sm501_unit_power(struct device *dev, unsigned int unit, unsigned int to)
367 break; 367 break;
368 368
369 default: 369 default:
370 return -1; 370 gate = -1;
371 goto already;
371 } 372 }
372 373
373 writel(mode, sm->regs + SM501_POWER_MODE_CONTROL); 374 writel(mode, sm->regs + SM501_POWER_MODE_CONTROL);
diff --git a/drivers/mfd/twl4030-irq.c b/drivers/mfd/twl4030-irq.c
index bae61b22501c..7d430835655f 100644
--- a/drivers/mfd/twl4030-irq.c
+++ b/drivers/mfd/twl4030-irq.c
@@ -180,14 +180,9 @@ static struct completion irq_event;
180static int twl4030_irq_thread(void *data) 180static int twl4030_irq_thread(void *data)
181{ 181{
182 long irq = (long)data; 182 long irq = (long)data;
183 struct irq_desc *desc = irq_to_desc(irq);
184 static unsigned i2c_errors; 183 static unsigned i2c_errors;
185 static const unsigned max_i2c_errors = 100; 184 static const unsigned max_i2c_errors = 100;
186 185
187 if (!desc) {
188 pr_err("twl4030: Invalid IRQ: %ld\n", irq);
189 return -EINVAL;
190 }
191 186
192 current->flags |= PF_NOFREEZE; 187 current->flags |= PF_NOFREEZE;
193 188
@@ -240,7 +235,7 @@ static int twl4030_irq_thread(void *data)
240 } 235 }
241 local_irq_enable(); 236 local_irq_enable();
242 237
243 desc->chip->unmask(irq); 238 enable_irq(irq);
244 } 239 }
245 240
246 return 0; 241 return 0;
@@ -255,25 +250,13 @@ static int twl4030_irq_thread(void *data)
255 * thread. All we do here is acknowledge and mask the interrupt and wakeup 250 * thread. All we do here is acknowledge and mask the interrupt and wakeup
256 * the kernel thread. 251 * the kernel thread.
257 */ 252 */
258static void handle_twl4030_pih(unsigned int irq, struct irq_desc *desc) 253static irqreturn_t handle_twl4030_pih(int irq, void *devid)
259{ 254{
260 /* Acknowledge, clear *AND* mask the interrupt... */ 255 /* Acknowledge, clear *AND* mask the interrupt... */
261 desc->chip->ack(irq); 256 disable_irq_nosync(irq);
262 complete(&irq_event); 257 complete(devid);
263} 258 return IRQ_HANDLED;
264
265static struct task_struct *start_twl4030_irq_thread(long irq)
266{
267 struct task_struct *thread;
268
269 init_completion(&irq_event);
270 thread = kthread_run(twl4030_irq_thread, (void *)irq, "twl4030-irq");
271 if (!thread)
272 pr_err("twl4030: could not create irq %ld thread!\n", irq);
273
274 return thread;
275} 259}
276
277/*----------------------------------------------------------------------*/ 260/*----------------------------------------------------------------------*/
278 261
279/* 262/*
@@ -734,18 +717,28 @@ int twl_init_irq(int irq_num, unsigned irq_base, unsigned irq_end)
734 } 717 }
735 718
736 /* install an irq handler to demultiplex the TWL4030 interrupt */ 719 /* install an irq handler to demultiplex the TWL4030 interrupt */
737 task = start_twl4030_irq_thread(irq_num);
738 if (!task) {
739 pr_err("twl4030: irq thread FAIL\n");
740 status = -ESRCH;
741 goto fail;
742 }
743 720
744 set_irq_data(irq_num, task);
745 set_irq_chained_handler(irq_num, handle_twl4030_pih);
746 721
747 return status; 722 init_completion(&irq_event);
748 723
724 status = request_irq(irq_num, handle_twl4030_pih, IRQF_DISABLED,
725 "TWL4030-PIH", &irq_event);
726 if (status < 0) {
727 pr_err("twl4030: could not claim irq%d: %d\n", irq_num, status);
728 goto fail_rqirq;
729 }
730
731 task = kthread_run(twl4030_irq_thread, (void *)irq_num, "twl4030-irq");
732 if (IS_ERR(task)) {
733 pr_err("twl4030: could not create irq %d thread!\n", irq_num);
734 status = PTR_ERR(task);
735 goto fail_kthread;
736 }
737 return status;
738fail_kthread:
739 free_irq(irq_num, &irq_event);
740fail_rqirq:
741 /* clean up twl4030_sih_setup */
749fail: 742fail:
750 for (i = irq_base; i < irq_end; i++) 743 for (i = irq_base; i < irq_end; i++)
751 set_irq_chip_and_handler(i, NULL, NULL); 744 set_irq_chip_and_handler(i, NULL, NULL);
diff --git a/drivers/misc/cb710/sgbuf2.c b/drivers/misc/cb710/sgbuf2.c
index d38a7acdb6ec..d019746551f3 100644
--- a/drivers/misc/cb710/sgbuf2.c
+++ b/drivers/misc/cb710/sgbuf2.c
@@ -114,7 +114,6 @@ static void sg_dwiter_write_slow(struct sg_mapping_iter *miter, uint32_t data)
114 if (!left) 114 if (!left)
115 return; 115 return;
116 addr += len; 116 addr += len;
117 flush_kernel_dcache_page(miter->page);
118 } while (sg_dwiter_next(miter)); 117 } while (sg_dwiter_next(miter));
119} 118}
120 119
@@ -142,9 +141,6 @@ void cb710_sg_dwiter_write_next_block(struct sg_mapping_iter *miter, uint32_t da
142 return; 141 return;
143 } else 142 } else
144 sg_dwiter_write_slow(miter, data); 143 sg_dwiter_write_slow(miter, data);
145
146 if (miter->length == miter->consumed)
147 flush_kernel_dcache_page(miter->page);
148} 144}
149EXPORT_SYMBOL_GPL(cb710_sg_dwiter_write_next_block); 145EXPORT_SYMBOL_GPL(cb710_sg_dwiter_write_next_block);
150 146
diff --git a/drivers/misc/eeprom/at25.c b/drivers/misc/eeprom/at25.c
index b34cb5f79eea..2e535a0ccd5e 100644
--- a/drivers/misc/eeprom/at25.c
+++ b/drivers/misc/eeprom/at25.c
@@ -173,6 +173,7 @@ at25_ee_write(struct at25_data *at25, const char *buf, loff_t off,
173 unsigned segment; 173 unsigned segment;
174 unsigned offset = (unsigned) off; 174 unsigned offset = (unsigned) off;
175 u8 *cp = bounce + 1; 175 u8 *cp = bounce + 1;
176 int sr;
176 177
177 *cp = AT25_WREN; 178 *cp = AT25_WREN;
178 status = spi_write(at25->spi, cp, 1); 179 status = spi_write(at25->spi, cp, 1);
@@ -214,7 +215,6 @@ at25_ee_write(struct at25_data *at25, const char *buf, loff_t off,
214 timeout = jiffies + msecs_to_jiffies(EE_TIMEOUT); 215 timeout = jiffies + msecs_to_jiffies(EE_TIMEOUT);
215 retries = 0; 216 retries = 0;
216 do { 217 do {
217 int sr;
218 218
219 sr = spi_w8r8(at25->spi, AT25_RDSR); 219 sr = spi_w8r8(at25->spi, AT25_RDSR);
220 if (sr < 0 || (sr & AT25_SR_nRDY)) { 220 if (sr < 0 || (sr & AT25_SR_nRDY)) {
@@ -228,7 +228,7 @@ at25_ee_write(struct at25_data *at25, const char *buf, loff_t off,
228 break; 228 break;
229 } while (retries++ < 3 || time_before_eq(jiffies, timeout)); 229 } while (retries++ < 3 || time_before_eq(jiffies, timeout));
230 230
231 if (time_after(jiffies, timeout)) { 231 if ((sr < 0) || (sr & AT25_SR_nRDY)) {
232 dev_err(&at25->spi->dev, 232 dev_err(&at25->spi->dev,
233 "write %d bytes offset %d, " 233 "write %d bytes offset %d, "
234 "timeout after %u msecs\n", 234 "timeout after %u msecs\n",
diff --git a/drivers/misc/sgi-gru/grufile.c b/drivers/misc/sgi-gru/grufile.c
index fa2d93a9fb8d..aed609832bc2 100644
--- a/drivers/misc/sgi-gru/grufile.c
+++ b/drivers/misc/sgi-gru/grufile.c
@@ -29,7 +29,6 @@
29#include <linux/slab.h> 29#include <linux/slab.h>
30#include <linux/mm.h> 30#include <linux/mm.h>
31#include <linux/io.h> 31#include <linux/io.h>
32#include <linux/smp_lock.h>
33#include <linux/spinlock.h> 32#include <linux/spinlock.h>
34#include <linux/device.h> 33#include <linux/device.h>
35#include <linux/miscdevice.h> 34#include <linux/miscdevice.h>
diff --git a/drivers/misc/sgi-gru/grukservices.c b/drivers/misc/sgi-gru/grukservices.c
index eedbf9c32760..79689b10f937 100644
--- a/drivers/misc/sgi-gru/grukservices.c
+++ b/drivers/misc/sgi-gru/grukservices.c
@@ -24,7 +24,6 @@
24#include <linux/errno.h> 24#include <linux/errno.h>
25#include <linux/slab.h> 25#include <linux/slab.h>
26#include <linux/mm.h> 26#include <linux/mm.h>
27#include <linux/smp_lock.h>
28#include <linux/spinlock.h> 27#include <linux/spinlock.h>
29#include <linux/device.h> 28#include <linux/device.h>
30#include <linux/miscdevice.h> 29#include <linux/miscdevice.h>
diff --git a/drivers/misc/sgi-xp/xpnet.c b/drivers/misc/sgi-xp/xpnet.c
index 8d1c60a3f0df..5d778ec8cdb2 100644
--- a/drivers/misc/sgi-xp/xpnet.c
+++ b/drivers/misc/sgi-xp/xpnet.c
@@ -235,7 +235,7 @@ xpnet_receive(short partid, int channel, struct xpnet_message *msg)
235 skb->ip_summed = CHECKSUM_UNNECESSARY; 235 skb->ip_summed = CHECKSUM_UNNECESSARY;
236 236
237 dev_dbg(xpnet, "passing skb to network layer\n" 237 dev_dbg(xpnet, "passing skb to network layer\n"
238 KERN_DEBUG "\tskb->head=0x%p skb->data=0x%p skb->tail=0x%p " 238 "\tskb->head=0x%p skb->data=0x%p skb->tail=0x%p "
239 "skb->end=0x%p skb->len=%d\n", 239 "skb->end=0x%p skb->len=%d\n",
240 (void *)skb->head, (void *)skb->data, skb_tail_pointer(skb), 240 (void *)skb->head, (void *)skb->data, skb_tail_pointer(skb),
241 skb_end_pointer(skb), skb->len); 241 skb_end_pointer(skb), skb->len);
@@ -399,7 +399,7 @@ xpnet_send(struct sk_buff *skb, struct xpnet_pending_msg *queued_msg,
399 msg->buf_pa = xp_pa((void *)start_addr); 399 msg->buf_pa = xp_pa((void *)start_addr);
400 400
401 dev_dbg(xpnet, "sending XPC message to %d:%d\n" 401 dev_dbg(xpnet, "sending XPC message to %d:%d\n"
402 KERN_DEBUG "msg->buf_pa=0x%lx, msg->size=%u, " 402 "msg->buf_pa=0x%lx, msg->size=%u, "
403 "msg->leadin_ignore=%u, msg->tailout_ignore=%u\n", 403 "msg->leadin_ignore=%u, msg->tailout_ignore=%u\n",
404 dest_partid, XPC_NET_CHANNEL, msg->buf_pa, msg->size, 404 dest_partid, XPC_NET_CHANNEL, msg->buf_pa, msg->size,
405 msg->leadin_ignore, msg->tailout_ignore); 405 msg->leadin_ignore, msg->tailout_ignore);
diff --git a/drivers/mmc/host/cb710-mmc.c b/drivers/mmc/host/cb710-mmc.c
index 11efefb1af51..4e72964a7b43 100644
--- a/drivers/mmc/host/cb710-mmc.c
+++ b/drivers/mmc/host/cb710-mmc.c
@@ -278,7 +278,7 @@ static int cb710_mmc_receive(struct cb710_slot *slot, struct mmc_data *data)
278 if (unlikely(data->blksz & 15 && (data->blocks != 1 || data->blksz != 8))) 278 if (unlikely(data->blksz & 15 && (data->blocks != 1 || data->blksz != 8)))
279 return -EINVAL; 279 return -EINVAL;
280 280
281 sg_miter_start(&miter, data->sg, data->sg_len, 0); 281 sg_miter_start(&miter, data->sg, data->sg_len, SG_MITER_TO_SG);
282 282
283 cb710_modify_port_8(slot, CB710_MMC_CONFIG2_PORT, 283 cb710_modify_port_8(slot, CB710_MMC_CONFIG2_PORT,
284 15, CB710_MMC_C2_READ_PIO_SIZE_MASK); 284 15, CB710_MMC_C2_READ_PIO_SIZE_MASK);
@@ -307,7 +307,7 @@ static int cb710_mmc_receive(struct cb710_slot *slot, struct mmc_data *data)
307 goto out; 307 goto out;
308 } 308 }
309out: 309out:
310 cb710_sg_miter_stop_writing(&miter); 310 sg_miter_stop(&miter);
311 return err; 311 return err;
312} 312}
313 313
@@ -322,7 +322,7 @@ static int cb710_mmc_send(struct cb710_slot *slot, struct mmc_data *data)
322 if (unlikely(data->blocks > 1 && data->blksz & 15)) 322 if (unlikely(data->blocks > 1 && data->blksz & 15))
323 return -EINVAL; 323 return -EINVAL;
324 324
325 sg_miter_start(&miter, data->sg, data->sg_len, 0); 325 sg_miter_start(&miter, data->sg, data->sg_len, SG_MITER_FROM_SG);
326 326
327 cb710_modify_port_8(slot, CB710_MMC_CONFIG2_PORT, 327 cb710_modify_port_8(slot, CB710_MMC_CONFIG2_PORT,
328 0, CB710_MMC_C2_READ_PIO_SIZE_MASK); 328 0, CB710_MMC_C2_READ_PIO_SIZE_MASK);
diff --git a/drivers/mmc/host/imxmmc.c b/drivers/mmc/host/imxmmc.c
index e0be21a4a696..bf98d7cc928a 100644
--- a/drivers/mmc/host/imxmmc.c
+++ b/drivers/mmc/host/imxmmc.c
@@ -652,7 +652,7 @@ static irqreturn_t imxmci_irq(int irq, void *devid)
652 set_bit(IMXMCI_PEND_STARTED_b, &host->pending_events); 652 set_bit(IMXMCI_PEND_STARTED_b, &host->pending_events);
653 tasklet_schedule(&host->tasklet); 653 tasklet_schedule(&host->tasklet);
654 654
655 return IRQ_RETVAL(handled);; 655 return IRQ_RETVAL(handled);
656} 656}
657 657
658static void imxmci_tasklet_fnc(unsigned long data) 658static void imxmci_tasklet_fnc(unsigned long data)
diff --git a/drivers/mmc/host/mmc_spi.c b/drivers/mmc/host/mmc_spi.c
index 240608cc7ae9..a461017ce5ce 100644
--- a/drivers/mmc/host/mmc_spi.c
+++ b/drivers/mmc/host/mmc_spi.c
@@ -1313,6 +1313,12 @@ static int mmc_spi_probe(struct spi_device *spi)
1313 struct mmc_spi_host *host; 1313 struct mmc_spi_host *host;
1314 int status; 1314 int status;
1315 1315
1316 /* We rely on full duplex transfers, mostly to reduce
1317 * per-transfer overheads (by making fewer transfers).
1318 */
1319 if (spi->master->flags & SPI_MASTER_HALF_DUPLEX)
1320 return -EINVAL;
1321
1316 /* MMC and SD specs only seem to care that sampling is on the 1322 /* MMC and SD specs only seem to care that sampling is on the
1317 * rising edge ... meaning SPI modes 0 or 3. So either SPI mode 1323 * rising edge ... meaning SPI modes 0 or 3. So either SPI mode
1318 * should be legit. We'll use mode 0 since the steady state is 0, 1324 * should be legit. We'll use mode 0 since the steady state is 0,
diff --git a/drivers/mmc/host/mvsdio.c b/drivers/mmc/host/mvsdio.c
index b56d72ff06e9..34e23489811a 100644
--- a/drivers/mmc/host/mvsdio.c
+++ b/drivers/mmc/host/mvsdio.c
@@ -384,7 +384,7 @@ static irqreturn_t mvsd_irq(int irq, void *dev)
384 u16 val[2] = {0, 0}; 384 u16 val[2] = {0, 0};
385 val[0] = mvsd_read(MVSD_FIFO); 385 val[0] = mvsd_read(MVSD_FIFO);
386 val[1] = mvsd_read(MVSD_FIFO); 386 val[1] = mvsd_read(MVSD_FIFO);
387 memcpy(p, &val, s); 387 memcpy(p, ((void *)&val) + 4 - s, s);
388 s = 0; 388 s = 0;
389 intr_status = mvsd_read(MVSD_NOR_INTR_STATUS); 389 intr_status = mvsd_read(MVSD_NOR_INTR_STATUS);
390 } 390 }
@@ -423,7 +423,7 @@ static irqreturn_t mvsd_irq(int irq, void *dev)
423 if (s < 4) { 423 if (s < 4) {
424 if (s && (intr_status & MVSD_NOR_TX_AVAIL)) { 424 if (s && (intr_status & MVSD_NOR_TX_AVAIL)) {
425 u16 val[2] = {0, 0}; 425 u16 val[2] = {0, 0};
426 memcpy(&val, p, s); 426 memcpy(((void *)&val) + 4 - s, p, s);
427 mvsd_write(MVSD_FIFO, val[0]); 427 mvsd_write(MVSD_FIFO, val[0]);
428 mvsd_write(MVSD_FIFO, val[1]); 428 mvsd_write(MVSD_FIFO, val[1]);
429 s = 0; 429 s = 0;
diff --git a/drivers/mmc/host/pxamci.c b/drivers/mmc/host/pxamci.c
index d7d7109ef47e..e55ac792d68c 100644
--- a/drivers/mmc/host/pxamci.c
+++ b/drivers/mmc/host/pxamci.c
@@ -168,12 +168,12 @@ static void pxamci_setup_data(struct pxamci_host *host, struct mmc_data *data)
168 168
169 if (data->flags & MMC_DATA_READ) { 169 if (data->flags & MMC_DATA_READ) {
170 host->dma_dir = DMA_FROM_DEVICE; 170 host->dma_dir = DMA_FROM_DEVICE;
171 dcmd = DCMD_INCTRGADDR | DCMD_FLOWTRG; 171 dcmd = DCMD_INCTRGADDR | DCMD_FLOWSRC;
172 DRCMR(host->dma_drcmrtx) = 0; 172 DRCMR(host->dma_drcmrtx) = 0;
173 DRCMR(host->dma_drcmrrx) = host->dma | DRCMR_MAPVLD; 173 DRCMR(host->dma_drcmrrx) = host->dma | DRCMR_MAPVLD;
174 } else { 174 } else {
175 host->dma_dir = DMA_TO_DEVICE; 175 host->dma_dir = DMA_TO_DEVICE;
176 dcmd = DCMD_INCSRCADDR | DCMD_FLOWSRC; 176 dcmd = DCMD_INCSRCADDR | DCMD_FLOWTRG;
177 DRCMR(host->dma_drcmrrx) = 0; 177 DRCMR(host->dma_drcmrrx) = 0;
178 DRCMR(host->dma_drcmrtx) = host->dma | DRCMR_MAPVLD; 178 DRCMR(host->dma_drcmrtx) = host->dma | DRCMR_MAPVLD;
179 } 179 }
diff --git a/drivers/mmc/host/sdhci-of.c b/drivers/mmc/host/sdhci-of.c
index d79fa55c3b89..1e8aa590bb39 100644
--- a/drivers/mmc/host/sdhci-of.c
+++ b/drivers/mmc/host/sdhci-of.c
@@ -158,6 +158,13 @@ static unsigned int esdhc_get_max_clock(struct sdhci_host *host)
158 return of_host->clock; 158 return of_host->clock;
159} 159}
160 160
161static unsigned int esdhc_get_min_clock(struct sdhci_host *host)
162{
163 struct sdhci_of_host *of_host = sdhci_priv(host);
164
165 return of_host->clock / 256 / 16;
166}
167
161static unsigned int esdhc_get_timeout_clock(struct sdhci_host *host) 168static unsigned int esdhc_get_timeout_clock(struct sdhci_host *host)
162{ 169{
163 struct sdhci_of_host *of_host = sdhci_priv(host); 170 struct sdhci_of_host *of_host = sdhci_priv(host);
@@ -184,6 +191,7 @@ static struct sdhci_of_data sdhci_esdhc = {
184 .set_clock = esdhc_set_clock, 191 .set_clock = esdhc_set_clock,
185 .enable_dma = esdhc_enable_dma, 192 .enable_dma = esdhc_enable_dma,
186 .get_max_clock = esdhc_get_max_clock, 193 .get_max_clock = esdhc_get_max_clock,
194 .get_min_clock = esdhc_get_min_clock,
187 .get_timeout_clock = esdhc_get_timeout_clock, 195 .get_timeout_clock = esdhc_get_timeout_clock,
188 }, 196 },
189}; 197};
@@ -226,7 +234,7 @@ static int __devinit sdhci_of_probe(struct of_device *ofdev,
226 return -ENODEV; 234 return -ENODEV;
227 235
228 host = sdhci_alloc_host(&ofdev->dev, sizeof(*of_host)); 236 host = sdhci_alloc_host(&ofdev->dev, sizeof(*of_host));
229 if (!host) 237 if (IS_ERR(host))
230 return -ENOMEM; 238 return -ENOMEM;
231 239
232 of_host = sdhci_priv(host); 240 of_host = sdhci_priv(host);
diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
index 6779b4ecab18..fc96f8cb9c0b 100644
--- a/drivers/mmc/host/sdhci.c
+++ b/drivers/mmc/host/sdhci.c
@@ -773,8 +773,14 @@ static void sdhci_prepare_data(struct sdhci_host *host, struct mmc_data *data)
773 } 773 }
774 774
775 if (!(host->flags & SDHCI_REQ_USE_DMA)) { 775 if (!(host->flags & SDHCI_REQ_USE_DMA)) {
776 sg_miter_start(&host->sg_miter, 776 int flags;
777 data->sg, data->sg_len, SG_MITER_ATOMIC); 777
778 flags = SG_MITER_ATOMIC;
779 if (host->data->flags & MMC_DATA_READ)
780 flags |= SG_MITER_TO_SG;
781 else
782 flags |= SG_MITER_FROM_SG;
783 sg_miter_start(&host->sg_miter, data->sg, data->sg_len, flags);
778 host->blocks = data->blocks; 784 host->blocks = data->blocks;
779 } 785 }
780 786
@@ -1766,7 +1772,10 @@ int sdhci_add_host(struct sdhci_host *host)
1766 * Set host parameters. 1772 * Set host parameters.
1767 */ 1773 */
1768 mmc->ops = &sdhci_ops; 1774 mmc->ops = &sdhci_ops;
1769 mmc->f_min = host->max_clk / 256; 1775 if (host->ops->get_min_clock)
1776 mmc->f_min = host->ops->get_min_clock(host);
1777 else
1778 mmc->f_min = host->max_clk / 256;
1770 mmc->f_max = host->max_clk; 1779 mmc->f_max = host->max_clk;
1771 mmc->caps = MMC_CAP_SDIO_IRQ; 1780 mmc->caps = MMC_CAP_SDIO_IRQ;
1772 1781
diff --git a/drivers/mmc/host/sdhci.h b/drivers/mmc/host/sdhci.h
index 831ddf7dcb49..c77e9ff30223 100644
--- a/drivers/mmc/host/sdhci.h
+++ b/drivers/mmc/host/sdhci.h
@@ -302,6 +302,7 @@ struct sdhci_ops {
302 302
303 int (*enable_dma)(struct sdhci_host *host); 303 int (*enable_dma)(struct sdhci_host *host);
304 unsigned int (*get_max_clock)(struct sdhci_host *host); 304 unsigned int (*get_max_clock)(struct sdhci_host *host);
305 unsigned int (*get_min_clock)(struct sdhci_host *host);
305 unsigned int (*get_timeout_clock)(struct sdhci_host *host); 306 unsigned int (*get_timeout_clock)(struct sdhci_host *host);
306}; 307};
307 308
diff --git a/drivers/mtd/cmdlinepart.c b/drivers/mtd/cmdlinepart.c
index 5011fa73f918..1479da6d3aa6 100644
--- a/drivers/mtd/cmdlinepart.c
+++ b/drivers/mtd/cmdlinepart.c
@@ -194,7 +194,7 @@ static struct mtd_partition * newpart(char *s,
194 parts[this_part].name = extra_mem; 194 parts[this_part].name = extra_mem;
195 extra_mem += name_len + 1; 195 extra_mem += name_len + 1;
196 196
197 dbg(("partition %d: name <%s>, offset %x, size %x, mask flags %x\n", 197 dbg(("partition %d: name <%s>, offset %llx, size %llx, mask flags %x\n",
198 this_part, 198 this_part,
199 parts[this_part].name, 199 parts[this_part].name,
200 parts[this_part].offset, 200 parts[this_part].offset,
diff --git a/drivers/mtd/devices/m25p80.c b/drivers/mtd/devices/m25p80.c
index 59c46126a5ce..ae5fe91867e1 100644
--- a/drivers/mtd/devices/m25p80.c
+++ b/drivers/mtd/devices/m25p80.c
@@ -54,7 +54,7 @@
54#define SR_SRWD 0x80 /* SR write protect */ 54#define SR_SRWD 0x80 /* SR write protect */
55 55
56/* Define max times to check status register before we give up. */ 56/* Define max times to check status register before we give up. */
57#define MAX_READY_WAIT_JIFFIES (10 * HZ) /* eg. M25P128 specs 6s max sector erase */ 57#define MAX_READY_WAIT_JIFFIES (40 * HZ) /* M25P16 specs 40s max chip erase */
58#define CMD_SIZE 4 58#define CMD_SIZE 4
59 59
60#ifdef CONFIG_M25PXX_USE_FAST_READ 60#ifdef CONFIG_M25PXX_USE_FAST_READ
diff --git a/drivers/mtd/inftlcore.c b/drivers/mtd/inftlcore.c
index 73f05227dc8c..d8cf29c01cc4 100644
--- a/drivers/mtd/inftlcore.c
+++ b/drivers/mtd/inftlcore.c
@@ -226,7 +226,7 @@ static u16 INFTL_findfreeblock(struct INFTLrecord *inftl, int desperate)
226 if (!desperate && inftl->numfreeEUNs < 2) { 226 if (!desperate && inftl->numfreeEUNs < 2) {
227 DEBUG(MTD_DEBUG_LEVEL1, "INFTL: there are too few free " 227 DEBUG(MTD_DEBUG_LEVEL1, "INFTL: there are too few free "
228 "EUNs (%d)\n", inftl->numfreeEUNs); 228 "EUNs (%d)\n", inftl->numfreeEUNs);
229 return 0xffff; 229 return BLOCK_NIL;
230 } 230 }
231 231
232 /* Scan for a free block */ 232 /* Scan for a free block */
@@ -281,7 +281,8 @@ static u16 INFTL_foldchain(struct INFTLrecord *inftl, unsigned thisVUC, unsigned
281 silly = MAX_LOOPS; 281 silly = MAX_LOOPS;
282 while (thisEUN < inftl->nb_blocks) { 282 while (thisEUN < inftl->nb_blocks) {
283 for (block = 0; block < inftl->EraseSize/SECTORSIZE; block ++) { 283 for (block = 0; block < inftl->EraseSize/SECTORSIZE; block ++) {
284 if ((BlockMap[block] != 0xffff) || BlockDeleted[block]) 284 if ((BlockMap[block] != BLOCK_NIL) ||
285 BlockDeleted[block])
285 continue; 286 continue;
286 287
287 if (inftl_read_oob(mtd, (thisEUN * inftl->EraseSize) 288 if (inftl_read_oob(mtd, (thisEUN * inftl->EraseSize)
@@ -525,7 +526,7 @@ static inline u16 INFTL_findwriteunit(struct INFTLrecord *inftl, unsigned block)
525 if (!silly--) { 526 if (!silly--) {
526 printk(KERN_WARNING "INFTL: infinite loop in " 527 printk(KERN_WARNING "INFTL: infinite loop in "
527 "Virtual Unit Chain 0x%x\n", thisVUC); 528 "Virtual Unit Chain 0x%x\n", thisVUC);
528 return 0xffff; 529 return BLOCK_NIL;
529 } 530 }
530 531
531 /* Skip to next block in chain */ 532 /* Skip to next block in chain */
@@ -549,7 +550,7 @@ hitused:
549 * waiting to be picked up. We're going to have to fold 550 * waiting to be picked up. We're going to have to fold
550 * a chain to make room. 551 * a chain to make room.
551 */ 552 */
552 thisEUN = INFTL_makefreeblock(inftl, 0xffff); 553 thisEUN = INFTL_makefreeblock(inftl, BLOCK_NIL);
553 554
554 /* 555 /*
555 * Hopefully we free something, lets try again. 556 * Hopefully we free something, lets try again.
@@ -631,7 +632,7 @@ hitused:
631 632
632 printk(KERN_WARNING "INFTL: error folding to make room for Virtual " 633 printk(KERN_WARNING "INFTL: error folding to make room for Virtual "
633 "Unit Chain 0x%x\n", thisVUC); 634 "Unit Chain 0x%x\n", thisVUC);
634 return 0xffff; 635 return BLOCK_NIL;
635} 636}
636 637
637/* 638/*
diff --git a/drivers/mtd/maps/Kconfig b/drivers/mtd/maps/Kconfig
index 0b98654d8eed..7a58bd5522fd 100644
--- a/drivers/mtd/maps/Kconfig
+++ b/drivers/mtd/maps/Kconfig
@@ -284,13 +284,6 @@ config MTD_L440GX
284 284
285 BE VERY CAREFUL. 285 BE VERY CAREFUL.
286 286
287config MTD_SBC8240
288 tristate "Flash device on SBC8240"
289 depends on MTD_JEDECPROBE && 8260
290 help
291 Flash access on the SBC8240 board from Wind River. See
292 <http://www.windriver.com/products/sbc8240/>
293
294config MTD_TQM8XXL 287config MTD_TQM8XXL
295 tristate "CFI Flash device mapped on TQM8XXL" 288 tristate "CFI Flash device mapped on TQM8XXL"
296 depends on MTD_CFI && TQM8xxL 289 depends on MTD_CFI && TQM8xxL
diff --git a/drivers/mtd/maps/Makefile b/drivers/mtd/maps/Makefile
index 8bae7f9850c0..5beb0662d724 100644
--- a/drivers/mtd/maps/Makefile
+++ b/drivers/mtd/maps/Makefile
@@ -50,7 +50,6 @@ obj-$(CONFIG_MTD_UCLINUX) += uclinux.o
50obj-$(CONFIG_MTD_NETtel) += nettel.o 50obj-$(CONFIG_MTD_NETtel) += nettel.o
51obj-$(CONFIG_MTD_SCB2_FLASH) += scb2_flash.o 51obj-$(CONFIG_MTD_SCB2_FLASH) += scb2_flash.o
52obj-$(CONFIG_MTD_H720X) += h720x-flash.o 52obj-$(CONFIG_MTD_H720X) += h720x-flash.o
53obj-$(CONFIG_MTD_SBC8240) += sbc8240.o
54obj-$(CONFIG_MTD_IXP4XX) += ixp4xx.o 53obj-$(CONFIG_MTD_IXP4XX) += ixp4xx.o
55obj-$(CONFIG_MTD_IXP2000) += ixp2000.o 54obj-$(CONFIG_MTD_IXP2000) += ixp2000.o
56obj-$(CONFIG_MTD_WRSBC8260) += wr_sbc82xx_flash.o 55obj-$(CONFIG_MTD_WRSBC8260) += wr_sbc82xx_flash.o
diff --git a/drivers/mtd/maps/integrator-flash.c b/drivers/mtd/maps/integrator-flash.c
index b08a798ee254..2aac41bde8b3 100644
--- a/drivers/mtd/maps/integrator-flash.c
+++ b/drivers/mtd/maps/integrator-flash.c
@@ -42,10 +42,8 @@
42#include <mach/hardware.h> 42#include <mach/hardware.h>
43#include <asm/system.h> 43#include <asm/system.h>
44 44
45#define SUBDEV_NAME_SIZE (BUS_ID_SIZE + 2)
46
47struct armflash_subdev_info { 45struct armflash_subdev_info {
48 char name[SUBDEV_NAME_SIZE]; 46 char *name;
49 struct mtd_info *mtd; 47 struct mtd_info *mtd;
50 struct map_info map; 48 struct map_info map;
51 struct flash_platform_data *plat; 49 struct flash_platform_data *plat;
@@ -134,6 +132,8 @@ static void armflash_subdev_remove(struct armflash_subdev_info *subdev)
134 map_destroy(subdev->mtd); 132 map_destroy(subdev->mtd);
135 if (subdev->map.virt) 133 if (subdev->map.virt)
136 iounmap(subdev->map.virt); 134 iounmap(subdev->map.virt);
135 kfree(subdev->name);
136 subdev->name = NULL;
137 release_mem_region(subdev->map.phys, subdev->map.size); 137 release_mem_region(subdev->map.phys, subdev->map.size);
138} 138}
139 139
@@ -177,16 +177,22 @@ static int armflash_probe(struct platform_device *dev)
177 177
178 if (nr == 1) 178 if (nr == 1)
179 /* No MTD concatenation, just use the default name */ 179 /* No MTD concatenation, just use the default name */
180 snprintf(subdev->name, SUBDEV_NAME_SIZE, "%s", 180 subdev->name = kstrdup(dev_name(&dev->dev), GFP_KERNEL);
181 dev_name(&dev->dev));
182 else 181 else
183 snprintf(subdev->name, SUBDEV_NAME_SIZE, "%s-%d", 182 subdev->name = kasprintf(GFP_KERNEL, "%s-%d",
184 dev_name(&dev->dev), i); 183 dev_name(&dev->dev), i);
184 if (!subdev->name) {
185 err = -ENOMEM;
186 break;
187 }
185 subdev->plat = plat; 188 subdev->plat = plat;
186 189
187 err = armflash_subdev_probe(subdev, res); 190 err = armflash_subdev_probe(subdev, res);
188 if (err) 191 if (err) {
192 kfree(subdev->name);
193 subdev->name = NULL;
189 break; 194 break;
195 }
190 } 196 }
191 info->nr_subdev = i; 197 info->nr_subdev = i;
192 198
diff --git a/drivers/mtd/maps/sbc8240.c b/drivers/mtd/maps/sbc8240.c
index d5374cdcb163..e69de29bb2d1 100644
--- a/drivers/mtd/maps/sbc8240.c
+++ b/drivers/mtd/maps/sbc8240.c
@@ -1,250 +0,0 @@
1/*
2 * Handle mapping of the flash memory access routines on the SBC8240 board.
3 *
4 * Carolyn Smith, Tektronix, Inc.
5 *
6 * This code is GPLed
7 */
8
9/*
10 * The SBC8240 has 2 flash banks.
11 * Bank 0 is a 512 KiB AMD AM29F040B; 8 x 64 KiB sectors.
12 * It contains the U-Boot code (7 sectors) and the environment (1 sector).
13 * Bank 1 is 4 x 1 MiB AMD AM29LV800BT; 15 x 64 KiB sectors, 1 x 32 KiB sector,
14 * 2 x 8 KiB sectors, 1 x 16 KiB sectors.
15 * Both parts are JEDEC compatible.
16 */
17
18#include <linux/module.h>
19#include <linux/types.h>
20#include <linux/kernel.h>
21#include <asm/io.h>
22
23#include <linux/mtd/mtd.h>
24#include <linux/mtd/map.h>
25#include <linux/mtd/cfi.h>
26
27#ifdef CONFIG_MTD_PARTITIONS
28#include <linux/mtd/partitions.h>
29#endif
30
31#define DEBUG
32
33#ifdef DEBUG
34# define debugk(fmt,args...) printk(fmt ,##args)
35#else
36# define debugk(fmt,args...)
37#endif
38
39
40#define WINDOW_ADDR0 0xFFF00000 /* 512 KiB */
41#define WINDOW_SIZE0 0x00080000
42#define BUSWIDTH0 1
43
44#define WINDOW_ADDR1 0xFF000000 /* 4 MiB */
45#define WINDOW_SIZE1 0x00400000
46#define BUSWIDTH1 8
47
48#define MSG_PREFIX "sbc8240:" /* prefix for our printk()'s */
49#define MTDID "sbc8240-%d" /* for mtdparts= partitioning */
50
51
52static struct map_info sbc8240_map[2] = {
53 {
54 .name = "sbc8240 Flash Bank #0",
55 .size = WINDOW_SIZE0,
56 .bankwidth = BUSWIDTH0,
57 },
58 {
59 .name = "sbc8240 Flash Bank #1",
60 .size = WINDOW_SIZE1,
61 .bankwidth = BUSWIDTH1,
62 }
63};
64
65#define NUM_FLASH_BANKS ARRAY_SIZE(sbc8240_map)
66
67/*
68 * The following defines the partition layout of SBC8240 boards.
69 *
70 * See include/linux/mtd/partitions.h for definition of the
71 * mtd_partition structure.
72 *
73 * The *_max_flash_size is the maximum possible mapped flash size
74 * which is not necessarily the actual flash size. It must correspond
75 * to the value specified in the mapping definition defined by the
76 * "struct map_desc *_io_desc" for the corresponding machine.
77 */
78
79#ifdef CONFIG_MTD_PARTITIONS
80
81static struct mtd_partition sbc8240_uboot_partitions [] = {
82 /* Bank 0 */
83 {
84 .name = "U-boot", /* U-Boot Firmware */
85 .offset = 0,
86 .size = 0x00070000, /* 7 x 64 KiB sectors */
87 .mask_flags = MTD_WRITEABLE, /* force read-only */
88 },
89 {
90 .name = "environment", /* U-Boot environment */
91 .offset = 0x00070000,
92 .size = 0x00010000, /* 1 x 64 KiB sector */
93 },
94};
95
96static struct mtd_partition sbc8240_fs_partitions [] = {
97 {
98 .name = "jffs", /* JFFS filesystem */
99 .offset = 0,
100 .size = 0x003C0000, /* 4 * 15 * 64KiB */
101 },
102 {
103 .name = "tmp32",
104 .offset = 0x003C0000,
105 .size = 0x00020000, /* 4 * 32KiB */
106 },
107 {
108 .name = "tmp8a",
109 .offset = 0x003E0000,
110 .size = 0x00008000, /* 4 * 8KiB */
111 },
112 {
113 .name = "tmp8b",
114 .offset = 0x003E8000,
115 .size = 0x00008000, /* 4 * 8KiB */
116 },
117 {
118 .name = "tmp16",
119 .offset = 0x003F0000,
120 .size = 0x00010000, /* 4 * 16KiB */
121 }
122};
123
124/* trivial struct to describe partition information */
125struct mtd_part_def
126{
127 int nums;
128 unsigned char *type;
129 struct mtd_partition* mtd_part;
130};
131
132static struct mtd_info *sbc8240_mtd[NUM_FLASH_BANKS];
133static struct mtd_part_def sbc8240_part_banks[NUM_FLASH_BANKS];
134
135
136#endif /* CONFIG_MTD_PARTITIONS */
137
138
139static int __init init_sbc8240_mtd (void)
140{
141 static struct _cjs {
142 u_long addr;
143 u_long size;
144 } pt[NUM_FLASH_BANKS] = {
145 {
146 .addr = WINDOW_ADDR0,
147 .size = WINDOW_SIZE0
148 },
149 {
150 .addr = WINDOW_ADDR1,
151 .size = WINDOW_SIZE1
152 },
153 };
154
155 int devicesfound = 0;
156 int i,j;
157
158 for (i = 0; i < NUM_FLASH_BANKS; i++) {
159 printk (KERN_NOTICE MSG_PREFIX
160 "Probing 0x%08lx at 0x%08lx\n", pt[i].size, pt[i].addr);
161
162 sbc8240_map[i].map_priv_1 =
163 (unsigned long) ioremap (pt[i].addr, pt[i].size);
164 if (!sbc8240_map[i].map_priv_1) {
165 printk (MSG_PREFIX "failed to ioremap\n");
166 for (j = 0; j < i; j++) {
167 iounmap((void *) sbc8240_map[j].map_priv_1);
168 sbc8240_map[j].map_priv_1 = 0;
169 }
170 return -EIO;
171 }
172 simple_map_init(&sbc8240_mtd[i]);
173
174 sbc8240_mtd[i] = do_map_probe("jedec_probe", &sbc8240_map[i]);
175
176 if (sbc8240_mtd[i]) {
177 sbc8240_mtd[i]->module = THIS_MODULE;
178 devicesfound++;
179 } else {
180 if (sbc8240_map[i].map_priv_1) {
181 iounmap((void *) sbc8240_map[i].map_priv_1);
182 sbc8240_map[i].map_priv_1 = 0;
183 }
184 }
185 }
186
187 if (!devicesfound) {
188 printk(KERN_NOTICE MSG_PREFIX
189 "No suppported flash chips found!\n");
190 return -ENXIO;
191 }
192
193#ifdef CONFIG_MTD_PARTITIONS
194 sbc8240_part_banks[0].mtd_part = sbc8240_uboot_partitions;
195 sbc8240_part_banks[0].type = "static image";
196 sbc8240_part_banks[0].nums = ARRAY_SIZE(sbc8240_uboot_partitions);
197 sbc8240_part_banks[1].mtd_part = sbc8240_fs_partitions;
198 sbc8240_part_banks[1].type = "static file system";
199 sbc8240_part_banks[1].nums = ARRAY_SIZE(sbc8240_fs_partitions);
200
201 for (i = 0; i < NUM_FLASH_BANKS; i++) {
202
203 if (!sbc8240_mtd[i]) continue;
204 if (sbc8240_part_banks[i].nums == 0) {
205 printk (KERN_NOTICE MSG_PREFIX
206 "No partition info available, registering whole device\n");
207 add_mtd_device(sbc8240_mtd[i]);
208 } else {
209 printk (KERN_NOTICE MSG_PREFIX
210 "Using %s partition definition\n", sbc8240_part_banks[i].mtd_part->name);
211 add_mtd_partitions (sbc8240_mtd[i],
212 sbc8240_part_banks[i].mtd_part,
213 sbc8240_part_banks[i].nums);
214 }
215 }
216#else
217 printk(KERN_NOTICE MSG_PREFIX
218 "Registering %d flash banks at once\n", devicesfound);
219
220 for (i = 0; i < devicesfound; i++) {
221 add_mtd_device(sbc8240_mtd[i]);
222 }
223#endif /* CONFIG_MTD_PARTITIONS */
224
225 return devicesfound == 0 ? -ENXIO : 0;
226}
227
228static void __exit cleanup_sbc8240_mtd (void)
229{
230 int i;
231
232 for (i = 0; i < NUM_FLASH_BANKS; i++) {
233 if (sbc8240_mtd[i]) {
234 del_mtd_device (sbc8240_mtd[i]);
235 map_destroy (sbc8240_mtd[i]);
236 }
237 if (sbc8240_map[i].map_priv_1) {
238 iounmap ((void *) sbc8240_map[i].map_priv_1);
239 sbc8240_map[i].map_priv_1 = 0;
240 }
241 }
242}
243
244module_init (init_sbc8240_mtd);
245module_exit (cleanup_sbc8240_mtd);
246
247MODULE_LICENSE ("GPL");
248MODULE_AUTHOR ("Carolyn Smith <carolyn.smith@tektronix.com>");
249MODULE_DESCRIPTION ("MTD map driver for SBC8240 boards");
250
diff --git a/drivers/mtd/mtd_blkdevs.c b/drivers/mtd/mtd_blkdevs.c
index c3f62654b6df..7baba40c1ed2 100644
--- a/drivers/mtd/mtd_blkdevs.c
+++ b/drivers/mtd/mtd_blkdevs.c
@@ -144,7 +144,7 @@ static int blktrans_open(struct block_device *bdev, fmode_t mode)
144 struct mtd_blktrans_ops *tr = dev->tr; 144 struct mtd_blktrans_ops *tr = dev->tr;
145 int ret = -ENODEV; 145 int ret = -ENODEV;
146 146
147 if (!try_module_get(dev->mtd->owner)) 147 if (!get_mtd_device(NULL, dev->mtd->index))
148 goto out; 148 goto out;
149 149
150 if (!try_module_get(tr->owner)) 150 if (!try_module_get(tr->owner))
@@ -158,7 +158,7 @@ static int blktrans_open(struct block_device *bdev, fmode_t mode)
158 ret = 0; 158 ret = 0;
159 if (tr->open && (ret = tr->open(dev))) { 159 if (tr->open && (ret = tr->open(dev))) {
160 dev->mtd->usecount--; 160 dev->mtd->usecount--;
161 module_put(dev->mtd->owner); 161 put_mtd_device(dev->mtd);
162 out_tr: 162 out_tr:
163 module_put(tr->owner); 163 module_put(tr->owner);
164 } 164 }
@@ -177,7 +177,7 @@ static int blktrans_release(struct gendisk *disk, fmode_t mode)
177 177
178 if (!ret) { 178 if (!ret) {
179 dev->mtd->usecount--; 179 dev->mtd->usecount--;
180 module_put(dev->mtd->owner); 180 put_mtd_device(dev->mtd);
181 module_put(tr->owner); 181 module_put(tr->owner);
182 } 182 }
183 183
diff --git a/drivers/mtd/mtdblock.c b/drivers/mtd/mtdblock.c
index 208c6faa0358..77db5ce24d92 100644
--- a/drivers/mtd/mtdblock.c
+++ b/drivers/mtd/mtdblock.c
@@ -29,6 +29,8 @@ static struct mtdblk_dev {
29 enum { STATE_EMPTY, STATE_CLEAN, STATE_DIRTY } cache_state; 29 enum { STATE_EMPTY, STATE_CLEAN, STATE_DIRTY } cache_state;
30} *mtdblks[MAX_MTD_DEVICES]; 30} *mtdblks[MAX_MTD_DEVICES];
31 31
32static struct mutex mtdblks_lock;
33
32/* 34/*
33 * Cache stuff... 35 * Cache stuff...
34 * 36 *
@@ -270,15 +272,19 @@ static int mtdblock_open(struct mtd_blktrans_dev *mbd)
270 272
271 DEBUG(MTD_DEBUG_LEVEL1,"mtdblock_open\n"); 273 DEBUG(MTD_DEBUG_LEVEL1,"mtdblock_open\n");
272 274
275 mutex_lock(&mtdblks_lock);
273 if (mtdblks[dev]) { 276 if (mtdblks[dev]) {
274 mtdblks[dev]->count++; 277 mtdblks[dev]->count++;
278 mutex_unlock(&mtdblks_lock);
275 return 0; 279 return 0;
276 } 280 }
277 281
278 /* OK, it's not open. Create cache info for it */ 282 /* OK, it's not open. Create cache info for it */
279 mtdblk = kzalloc(sizeof(struct mtdblk_dev), GFP_KERNEL); 283 mtdblk = kzalloc(sizeof(struct mtdblk_dev), GFP_KERNEL);
280 if (!mtdblk) 284 if (!mtdblk) {
285 mutex_unlock(&mtdblks_lock);
281 return -ENOMEM; 286 return -ENOMEM;
287 }
282 288
283 mtdblk->count = 1; 289 mtdblk->count = 1;
284 mtdblk->mtd = mtd; 290 mtdblk->mtd = mtd;
@@ -291,6 +297,7 @@ static int mtdblock_open(struct mtd_blktrans_dev *mbd)
291 } 297 }
292 298
293 mtdblks[dev] = mtdblk; 299 mtdblks[dev] = mtdblk;
300 mutex_unlock(&mtdblks_lock);
294 301
295 DEBUG(MTD_DEBUG_LEVEL1, "ok\n"); 302 DEBUG(MTD_DEBUG_LEVEL1, "ok\n");
296 303
@@ -304,6 +311,8 @@ static int mtdblock_release(struct mtd_blktrans_dev *mbd)
304 311
305 DEBUG(MTD_DEBUG_LEVEL1, "mtdblock_release\n"); 312 DEBUG(MTD_DEBUG_LEVEL1, "mtdblock_release\n");
306 313
314 mutex_lock(&mtdblks_lock);
315
307 mutex_lock(&mtdblk->cache_mutex); 316 mutex_lock(&mtdblk->cache_mutex);
308 write_cached_data(mtdblk); 317 write_cached_data(mtdblk);
309 mutex_unlock(&mtdblk->cache_mutex); 318 mutex_unlock(&mtdblk->cache_mutex);
@@ -316,6 +325,9 @@ static int mtdblock_release(struct mtd_blktrans_dev *mbd)
316 vfree(mtdblk->cache_data); 325 vfree(mtdblk->cache_data);
317 kfree(mtdblk); 326 kfree(mtdblk);
318 } 327 }
328
329 mutex_unlock(&mtdblks_lock);
330
319 DEBUG(MTD_DEBUG_LEVEL1, "ok\n"); 331 DEBUG(MTD_DEBUG_LEVEL1, "ok\n");
320 332
321 return 0; 333 return 0;
@@ -376,6 +388,8 @@ static struct mtd_blktrans_ops mtdblock_tr = {
376 388
377static int __init init_mtdblock(void) 389static int __init init_mtdblock(void)
378{ 390{
391 mutex_init(&mtdblks_lock);
392
379 return register_mtd_blktrans(&mtdblock_tr); 393 return register_mtd_blktrans(&mtdblock_tr);
380} 394}
381 395
diff --git a/drivers/mtd/mtdcore.c b/drivers/mtd/mtdcore.c
index fac54a3fa3f1..00ebf7af7467 100644
--- a/drivers/mtd/mtdcore.c
+++ b/drivers/mtd/mtdcore.c
@@ -65,8 +65,8 @@ static void mtd_release(struct device *dev)
65static int mtd_cls_suspend(struct device *dev, pm_message_t state) 65static int mtd_cls_suspend(struct device *dev, pm_message_t state)
66{ 66{
67 struct mtd_info *mtd = dev_to_mtd(dev); 67 struct mtd_info *mtd = dev_to_mtd(dev);
68 68
69 if (mtd->suspend) 69 if (mtd && mtd->suspend)
70 return mtd->suspend(mtd); 70 return mtd->suspend(mtd);
71 else 71 else
72 return 0; 72 return 0;
@@ -76,7 +76,7 @@ static int mtd_cls_resume(struct device *dev)
76{ 76{
77 struct mtd_info *mtd = dev_to_mtd(dev); 77 struct mtd_info *mtd = dev_to_mtd(dev);
78 78
79 if (mtd->resume) 79 if (mtd && mtd->resume)
80 mtd->resume(mtd); 80 mtd->resume(mtd);
81 return 0; 81 return 0;
82} 82}
@@ -298,6 +298,7 @@ int add_mtd_device(struct mtd_info *mtd)
298 mtd->dev.class = &mtd_class; 298 mtd->dev.class = &mtd_class;
299 mtd->dev.devt = MTD_DEVT(i); 299 mtd->dev.devt = MTD_DEVT(i);
300 dev_set_name(&mtd->dev, "mtd%d", i); 300 dev_set_name(&mtd->dev, "mtd%d", i);
301 dev_set_drvdata(&mtd->dev, mtd);
301 if (device_register(&mtd->dev) != 0) { 302 if (device_register(&mtd->dev) != 0) {
302 mtd_table[i] = NULL; 303 mtd_table[i] = NULL;
303 break; 304 break;
diff --git a/drivers/mtd/nand/atmel_nand.c b/drivers/mtd/nand/atmel_nand.c
index 2802992b39da..20c828ba9405 100644
--- a/drivers/mtd/nand/atmel_nand.c
+++ b/drivers/mtd/nand/atmel_nand.c
@@ -534,7 +534,7 @@ static int __init atmel_nand_probe(struct platform_device *pdev)
534 &num_partitions); 534 &num_partitions);
535 535
536 if ((!partitions) || (num_partitions == 0)) { 536 if ((!partitions) || (num_partitions == 0)) {
537 printk(KERN_ERR "atmel_nand: No parititions defined, or unsupported device.\n"); 537 printk(KERN_ERR "atmel_nand: No partitions defined, or unsupported device.\n");
538 res = ENXIO; 538 res = ENXIO;
539 goto err_no_partitions; 539 goto err_no_partitions;
540 } 540 }
diff --git a/drivers/mtd/nand/omap2.c b/drivers/mtd/nand/omap2.c
index 0cd76f89f4b0..ebd07e95b814 100644
--- a/drivers/mtd/nand/omap2.c
+++ b/drivers/mtd/nand/omap2.c
@@ -11,6 +11,8 @@
11#include <linux/platform_device.h> 11#include <linux/platform_device.h>
12#include <linux/dma-mapping.h> 12#include <linux/dma-mapping.h>
13#include <linux/delay.h> 13#include <linux/delay.h>
14#include <linux/jiffies.h>
15#include <linux/sched.h>
14#include <linux/mtd/mtd.h> 16#include <linux/mtd/mtd.h>
15#include <linux/mtd/nand.h> 17#include <linux/mtd/nand.h>
16#include <linux/mtd/partitions.h> 18#include <linux/mtd/partitions.h>
@@ -541,7 +543,7 @@ static int omap_wait(struct mtd_info *mtd, struct nand_chip *chip)
541 struct omap_nand_info *info = container_of(mtd, struct omap_nand_info, 543 struct omap_nand_info *info = container_of(mtd, struct omap_nand_info,
542 mtd); 544 mtd);
543 unsigned long timeo = jiffies; 545 unsigned long timeo = jiffies;
544 int status, state = this->state; 546 int status = NAND_STATUS_FAIL, state = this->state;
545 547
546 if (state == FL_ERASING) 548 if (state == FL_ERASING)
547 timeo += (HZ * 400) / 1000; 549 timeo += (HZ * 400) / 1000;
@@ -556,8 +558,9 @@ static int omap_wait(struct mtd_info *mtd, struct nand_chip *chip)
556 558
557 while (time_before(jiffies, timeo)) { 559 while (time_before(jiffies, timeo)) {
558 status = __raw_readb(this->IO_ADDR_R); 560 status = __raw_readb(this->IO_ADDR_R);
559 if (!(status & 0x40)) 561 if (status & NAND_STATUS_READY)
560 break; 562 break;
563 cond_resched();
561 } 564 }
562 return status; 565 return status;
563} 566}
diff --git a/drivers/mtd/nftlcore.c b/drivers/mtd/nftlcore.c
index e3f8495a94c2..fb86cacd5bdb 100644
--- a/drivers/mtd/nftlcore.c
+++ b/drivers/mtd/nftlcore.c
@@ -208,7 +208,7 @@ static u16 NFTL_findfreeblock(struct NFTLrecord *nftl, int desperate )
208 /* Normally, we force a fold to happen before we run out of free blocks completely */ 208 /* Normally, we force a fold to happen before we run out of free blocks completely */
209 if (!desperate && nftl->numfreeEUNs < 2) { 209 if (!desperate && nftl->numfreeEUNs < 2) {
210 DEBUG(MTD_DEBUG_LEVEL1, "NFTL_findfreeblock: there are too few free EUNs\n"); 210 DEBUG(MTD_DEBUG_LEVEL1, "NFTL_findfreeblock: there are too few free EUNs\n");
211 return 0xffff; 211 return BLOCK_NIL;
212 } 212 }
213 213
214 /* Scan for a free block */ 214 /* Scan for a free block */
@@ -230,11 +230,11 @@ static u16 NFTL_findfreeblock(struct NFTLrecord *nftl, int desperate )
230 printk("Argh! No free blocks found! LastFreeEUN = %d, " 230 printk("Argh! No free blocks found! LastFreeEUN = %d, "
231 "FirstEUN = %d\n", nftl->LastFreeEUN, 231 "FirstEUN = %d\n", nftl->LastFreeEUN,
232 le16_to_cpu(nftl->MediaHdr.FirstPhysicalEUN)); 232 le16_to_cpu(nftl->MediaHdr.FirstPhysicalEUN));
233 return 0xffff; 233 return BLOCK_NIL;
234 } 234 }
235 } while (pot != nftl->LastFreeEUN); 235 } while (pot != nftl->LastFreeEUN);
236 236
237 return 0xffff; 237 return BLOCK_NIL;
238} 238}
239 239
240static u16 NFTL_foldchain (struct NFTLrecord *nftl, unsigned thisVUC, unsigned pendingblock ) 240static u16 NFTL_foldchain (struct NFTLrecord *nftl, unsigned thisVUC, unsigned pendingblock )
@@ -431,7 +431,7 @@ static u16 NFTL_foldchain (struct NFTLrecord *nftl, unsigned thisVUC, unsigned p
431 431
432 /* add the header so that it is now a valid chain */ 432 /* add the header so that it is now a valid chain */
433 oob.u.a.VirtUnitNum = oob.u.a.SpareVirtUnitNum = cpu_to_le16(thisVUC); 433 oob.u.a.VirtUnitNum = oob.u.a.SpareVirtUnitNum = cpu_to_le16(thisVUC);
434 oob.u.a.ReplUnitNum = oob.u.a.SpareReplUnitNum = 0xffff; 434 oob.u.a.ReplUnitNum = oob.u.a.SpareReplUnitNum = BLOCK_NIL;
435 435
436 nftl_write_oob(mtd, (nftl->EraseSize * targetEUN) + 8, 436 nftl_write_oob(mtd, (nftl->EraseSize * targetEUN) + 8,
437 8, &retlen, (char *)&oob.u); 437 8, &retlen, (char *)&oob.u);
@@ -515,7 +515,7 @@ static u16 NFTL_makefreeblock( struct NFTLrecord *nftl , unsigned pendingblock)
515 if (ChainLength < 2) { 515 if (ChainLength < 2) {
516 printk(KERN_WARNING "No Virtual Unit Chains available for folding. " 516 printk(KERN_WARNING "No Virtual Unit Chains available for folding. "
517 "Failing request\n"); 517 "Failing request\n");
518 return 0xffff; 518 return BLOCK_NIL;
519 } 519 }
520 520
521 return NFTL_foldchain (nftl, LongestChain, pendingblock); 521 return NFTL_foldchain (nftl, LongestChain, pendingblock);
@@ -578,7 +578,7 @@ static inline u16 NFTL_findwriteunit(struct NFTLrecord *nftl, unsigned block)
578 printk(KERN_WARNING 578 printk(KERN_WARNING
579 "Infinite loop in Virtual Unit Chain 0x%x\n", 579 "Infinite loop in Virtual Unit Chain 0x%x\n",
580 thisVUC); 580 thisVUC);
581 return 0xffff; 581 return BLOCK_NIL;
582 } 582 }
583 583
584 /* Skip to next block in chain */ 584 /* Skip to next block in chain */
@@ -601,7 +601,7 @@ static inline u16 NFTL_findwriteunit(struct NFTLrecord *nftl, unsigned block)
601 //u16 startEUN = nftl->EUNtable[thisVUC]; 601 //u16 startEUN = nftl->EUNtable[thisVUC];
602 602
603 //printk("Write to VirtualUnitChain %d, calling makefreeblock()\n", thisVUC); 603 //printk("Write to VirtualUnitChain %d, calling makefreeblock()\n", thisVUC);
604 writeEUN = NFTL_makefreeblock(nftl, 0xffff); 604 writeEUN = NFTL_makefreeblock(nftl, BLOCK_NIL);
605 605
606 if (writeEUN == BLOCK_NIL) { 606 if (writeEUN == BLOCK_NIL) {
607 /* OK, we accept that the above comment is 607 /* OK, we accept that the above comment is
@@ -673,7 +673,7 @@ static inline u16 NFTL_findwriteunit(struct NFTLrecord *nftl, unsigned block)
673 673
674 printk(KERN_WARNING "Error folding to make room for Virtual Unit Chain 0x%x\n", 674 printk(KERN_WARNING "Error folding to make room for Virtual Unit Chain 0x%x\n",
675 thisVUC); 675 thisVUC);
676 return 0xffff; 676 return BLOCK_NIL;
677} 677}
678 678
679static int nftl_writeblock(struct mtd_blktrans_dev *mbd, unsigned long block, 679static int nftl_writeblock(struct mtd_blktrans_dev *mbd, unsigned long block,
diff --git a/drivers/mtd/onenand/omap2.c b/drivers/mtd/onenand/omap2.c
index 38d656b9b2ee..0108ed42e877 100644
--- a/drivers/mtd/onenand/omap2.c
+++ b/drivers/mtd/onenand/omap2.c
@@ -266,7 +266,7 @@ static inline int omap2_onenand_bufferram_offset(struct mtd_info *mtd, int area)
266 266
267 if (ONENAND_CURRENT_BUFFERRAM(this)) { 267 if (ONENAND_CURRENT_BUFFERRAM(this)) {
268 if (area == ONENAND_DATARAM) 268 if (area == ONENAND_DATARAM)
269 return mtd->writesize; 269 return this->writesize;
270 if (area == ONENAND_SPARERAM) 270 if (area == ONENAND_SPARERAM)
271 return mtd->oobsize; 271 return mtd->oobsize;
272 } 272 }
@@ -770,6 +770,7 @@ static int __devexit omap2_onenand_remove(struct platform_device *pdev)
770 } 770 }
771 iounmap(c->onenand.base); 771 iounmap(c->onenand.base);
772 release_mem_region(c->phys_base, ONENAND_IO_SIZE); 772 release_mem_region(c->phys_base, ONENAND_IO_SIZE);
773 gpmc_cs_free(c->gpmc_cs);
773 kfree(c); 774 kfree(c);
774 775
775 return 0; 776 return 0;
diff --git a/drivers/mtd/ubi/build.c b/drivers/mtd/ubi/build.c
index 286ed594e5a0..e1f7d0a78b9d 100644
--- a/drivers/mtd/ubi/build.c
+++ b/drivers/mtd/ubi/build.c
@@ -657,6 +657,11 @@ static int io_init(struct ubi_device *ubi)
657 if (ubi->mtd->block_isbad && ubi->mtd->block_markbad) 657 if (ubi->mtd->block_isbad && ubi->mtd->block_markbad)
658 ubi->bad_allowed = 1; 658 ubi->bad_allowed = 1;
659 659
660 if (ubi->mtd->type == MTD_NORFLASH) {
661 ubi_assert(ubi->mtd->writesize == 1);
662 ubi->nor_flash = 1;
663 }
664
660 ubi->min_io_size = ubi->mtd->writesize; 665 ubi->min_io_size = ubi->mtd->writesize;
661 ubi->hdrs_min_io_size = ubi->mtd->writesize >> ubi->mtd->subpage_sft; 666 ubi->hdrs_min_io_size = ubi->mtd->writesize >> ubi->mtd->subpage_sft;
662 667
@@ -996,6 +1001,7 @@ int ubi_attach_mtd_dev(struct mtd_info *mtd, int ubi_num, int vid_hdr_offset)
996 ubi_msg("number of PEBs reserved for bad PEB handling: %d", 1001 ubi_msg("number of PEBs reserved for bad PEB handling: %d",
997 ubi->beb_rsvd_pebs); 1002 ubi->beb_rsvd_pebs);
998 ubi_msg("max/mean erase counter: %d/%d", ubi->max_ec, ubi->mean_ec); 1003 ubi_msg("max/mean erase counter: %d/%d", ubi->max_ec, ubi->mean_ec);
1004 ubi_msg("image sequence number: %d", ubi->image_seq);
999 1005
1000 /* 1006 /*
1001 * The below lock makes sure we do not race with 'ubi_thread()' which 1007 * The below lock makes sure we do not race with 'ubi_thread()' which
diff --git a/drivers/mtd/ubi/debug.c b/drivers/mtd/ubi/debug.c
index c0ed60e8ade9..54b0186915fb 100644
--- a/drivers/mtd/ubi/debug.c
+++ b/drivers/mtd/ubi/debug.c
@@ -44,6 +44,8 @@ void ubi_dbg_dump_ec_hdr(const struct ubi_ec_hdr *ec_hdr)
44 be32_to_cpu(ec_hdr->vid_hdr_offset)); 44 be32_to_cpu(ec_hdr->vid_hdr_offset));
45 printk(KERN_DEBUG "\tdata_offset %d\n", 45 printk(KERN_DEBUG "\tdata_offset %d\n",
46 be32_to_cpu(ec_hdr->data_offset)); 46 be32_to_cpu(ec_hdr->data_offset));
47 printk(KERN_DEBUG "\timage_seq %d\n",
48 be32_to_cpu(ec_hdr->image_seq));
47 printk(KERN_DEBUG "\thdr_crc %#08x\n", 49 printk(KERN_DEBUG "\thdr_crc %#08x\n",
48 be32_to_cpu(ec_hdr->hdr_crc)); 50 be32_to_cpu(ec_hdr->hdr_crc));
49 printk(KERN_DEBUG "erase counter header hexdump:\n"); 51 printk(KERN_DEBUG "erase counter header hexdump:\n");
diff --git a/drivers/mtd/ubi/debug.h b/drivers/mtd/ubi/debug.h
index 13777e5beac9..a4da7a09b949 100644
--- a/drivers/mtd/ubi/debug.h
+++ b/drivers/mtd/ubi/debug.h
@@ -93,6 +93,12 @@ void ubi_dbg_dump_mkvol_req(const struct ubi_mkvol_req *req);
93#define UBI_IO_DEBUG 0 93#define UBI_IO_DEBUG 0
94#endif 94#endif
95 95
96#ifdef CONFIG_MTD_UBI_DEBUG_PARANOID
97int ubi_dbg_check_all_ff(struct ubi_device *ubi, int pnum, int offset, int len);
98#else
99#define ubi_dbg_check_all_ff(ubi, pnum, offset, len) 0
100#endif
101
96#ifdef CONFIG_MTD_UBI_DEBUG_DISABLE_BGT 102#ifdef CONFIG_MTD_UBI_DEBUG_DISABLE_BGT
97#define DBG_DISABLE_BGT 1 103#define DBG_DISABLE_BGT 1
98#else 104#else
@@ -167,6 +173,7 @@ static inline int ubi_dbg_is_erase_failure(void)
167#define ubi_dbg_is_bitflip() 0 173#define ubi_dbg_is_bitflip() 0
168#define ubi_dbg_is_write_failure() 0 174#define ubi_dbg_is_write_failure() 0
169#define ubi_dbg_is_erase_failure() 0 175#define ubi_dbg_is_erase_failure() 0
176#define ubi_dbg_check_all_ff(ubi, pnum, offset, len) 0
170 177
171#endif /* !CONFIG_MTD_UBI_DEBUG */ 178#endif /* !CONFIG_MTD_UBI_DEBUG */
172#endif /* !__UBI_DEBUG_H__ */ 179#endif /* !__UBI_DEBUG_H__ */
diff --git a/drivers/mtd/ubi/eba.c b/drivers/mtd/ubi/eba.c
index 0f2034c3ed2f..e4d9ef0c965a 100644
--- a/drivers/mtd/ubi/eba.c
+++ b/drivers/mtd/ubi/eba.c
@@ -1254,6 +1254,7 @@ out_free:
1254 if (!ubi->volumes[i]) 1254 if (!ubi->volumes[i])
1255 continue; 1255 continue;
1256 kfree(ubi->volumes[i]->eba_tbl); 1256 kfree(ubi->volumes[i]->eba_tbl);
1257 ubi->volumes[i]->eba_tbl = NULL;
1257 } 1258 }
1258 return err; 1259 return err;
1259} 1260}
diff --git a/drivers/mtd/ubi/gluebi.c b/drivers/mtd/ubi/gluebi.c
index 95aaac03f938..b5e478fa2661 100644
--- a/drivers/mtd/ubi/gluebi.c
+++ b/drivers/mtd/ubi/gluebi.c
@@ -332,6 +332,7 @@ static int gluebi_create(struct ubi_device_info *di,
332 } 332 }
333 333
334 gluebi->vol_id = vi->vol_id; 334 gluebi->vol_id = vi->vol_id;
335 gluebi->ubi_num = vi->ubi_num;
335 mtd->type = MTD_UBIVOLUME; 336 mtd->type = MTD_UBIVOLUME;
336 if (!di->ro_mode) 337 if (!di->ro_mode)
337 mtd->flags = MTD_WRITEABLE; 338 mtd->flags = MTD_WRITEABLE;
diff --git a/drivers/mtd/ubi/io.c b/drivers/mtd/ubi/io.c
index effaff28bab1..4cb69925d8d9 100644
--- a/drivers/mtd/ubi/io.c
+++ b/drivers/mtd/ubi/io.c
@@ -98,17 +98,12 @@ static int paranoid_check_ec_hdr(const struct ubi_device *ubi, int pnum,
98static int paranoid_check_peb_vid_hdr(const struct ubi_device *ubi, int pnum); 98static int paranoid_check_peb_vid_hdr(const struct ubi_device *ubi, int pnum);
99static int paranoid_check_vid_hdr(const struct ubi_device *ubi, int pnum, 99static int paranoid_check_vid_hdr(const struct ubi_device *ubi, int pnum,
100 const struct ubi_vid_hdr *vid_hdr); 100 const struct ubi_vid_hdr *vid_hdr);
101static int paranoid_check_all_ff(struct ubi_device *ubi, int pnum, int offset,
102 int len);
103static int paranoid_check_empty(struct ubi_device *ubi, int pnum);
104#else 101#else
105#define paranoid_check_not_bad(ubi, pnum) 0 102#define paranoid_check_not_bad(ubi, pnum) 0
106#define paranoid_check_peb_ec_hdr(ubi, pnum) 0 103#define paranoid_check_peb_ec_hdr(ubi, pnum) 0
107#define paranoid_check_ec_hdr(ubi, pnum, ec_hdr) 0 104#define paranoid_check_ec_hdr(ubi, pnum, ec_hdr) 0
108#define paranoid_check_peb_vid_hdr(ubi, pnum) 0 105#define paranoid_check_peb_vid_hdr(ubi, pnum) 0
109#define paranoid_check_vid_hdr(ubi, pnum, vid_hdr) 0 106#define paranoid_check_vid_hdr(ubi, pnum, vid_hdr) 0
110#define paranoid_check_all_ff(ubi, pnum, offset, len) 0
111#define paranoid_check_empty(ubi, pnum) 0
112#endif 107#endif
113 108
114/** 109/**
@@ -244,7 +239,7 @@ int ubi_io_write(struct ubi_device *ubi, const void *buf, int pnum, int offset,
244 return err > 0 ? -EINVAL : err; 239 return err > 0 ? -EINVAL : err;
245 240
246 /* The area we are writing to has to contain all 0xFF bytes */ 241 /* The area we are writing to has to contain all 0xFF bytes */
247 err = paranoid_check_all_ff(ubi, pnum, offset, len); 242 err = ubi_dbg_check_all_ff(ubi, pnum, offset, len);
248 if (err) 243 if (err)
249 return err > 0 ? -EINVAL : err; 244 return err > 0 ? -EINVAL : err;
250 245
@@ -271,8 +266,8 @@ int ubi_io_write(struct ubi_device *ubi, const void *buf, int pnum, int offset,
271 addr = (loff_t)pnum * ubi->peb_size + offset; 266 addr = (loff_t)pnum * ubi->peb_size + offset;
272 err = ubi->mtd->write(ubi->mtd, addr, len, &written, buf); 267 err = ubi->mtd->write(ubi->mtd, addr, len, &written, buf);
273 if (err) { 268 if (err) {
274 ubi_err("error %d while writing %d bytes to PEB %d:%d, written" 269 ubi_err("error %d while writing %d bytes to PEB %d:%d, written "
275 " %zd bytes", err, len, pnum, offset, written); 270 "%zd bytes", err, len, pnum, offset, written);
276 ubi_dbg_dump_stack(); 271 ubi_dbg_dump_stack();
277 } else 272 } else
278 ubi_assert(written == len); 273 ubi_assert(written == len);
@@ -350,7 +345,7 @@ retry:
350 return -EIO; 345 return -EIO;
351 } 346 }
352 347
353 err = paranoid_check_all_ff(ubi, pnum, 0, ubi->peb_size); 348 err = ubi_dbg_check_all_ff(ubi, pnum, 0, ubi->peb_size);
354 if (err) 349 if (err)
355 return err > 0 ? -EINVAL : err; 350 return err > 0 ? -EINVAL : err;
356 351
@@ -459,6 +454,54 @@ out:
459} 454}
460 455
461/** 456/**
457 * nor_erase_prepare - prepare a NOR flash PEB for erasure.
458 * @ubi: UBI device description object
459 * @pnum: physical eraseblock number to prepare
460 *
461 * NOR flash, or at least some of them, have peculiar embedded PEB erasure
462 * algorithm: the PEB is first filled with zeroes, then it is erased. And
463 * filling with zeroes starts from the end of the PEB. This was observed with
464 * Spansion S29GL512N NOR flash.
465 *
466 * This means that in case of a power cut we may end up with intact data at the
467 * beginning of the PEB, and all zeroes at the end of PEB. In other words, the
468 * EC and VID headers are OK, but a large chunk of data at the end of PEB is
469 * zeroed. This makes UBI mistakenly treat this PEB as used and associate it
470 * with an LEB, which leads to subsequent failures (e.g., UBIFS fails).
471 *
472 * This function is called before erasing NOR PEBs and it zeroes out EC and VID
473 * magic numbers in order to invalidate them and prevent the failures. Returns
474 * zero in case of success and a negative error code in case of failure.
475 */
476static int nor_erase_prepare(struct ubi_device *ubi, int pnum)
477{
478 int err;
479 size_t written;
480 loff_t addr;
481 uint32_t data = 0;
482
483 addr = (loff_t)pnum * ubi->peb_size;
484 err = ubi->mtd->write(ubi->mtd, addr, 4, &written, (void *)&data);
485 if (err) {
486 ubi_err("error %d while writing 4 bytes to PEB %d:%d, written "
487 "%zd bytes", err, pnum, 0, written);
488 ubi_dbg_dump_stack();
489 return err;
490 }
491
492 addr += ubi->vid_hdr_aloffset;
493 err = ubi->mtd->write(ubi->mtd, addr, 4, &written, (void *)&data);
494 if (err) {
495 ubi_err("error %d while writing 4 bytes to PEB %d:%d, written "
496 "%zd bytes", err, pnum, ubi->vid_hdr_aloffset, written);
497 ubi_dbg_dump_stack();
498 return err;
499 }
500
501 return 0;
502}
503
504/**
462 * ubi_io_sync_erase - synchronously erase a physical eraseblock. 505 * ubi_io_sync_erase - synchronously erase a physical eraseblock.
463 * @ubi: UBI device description object 506 * @ubi: UBI device description object
464 * @pnum: physical eraseblock number to erase 507 * @pnum: physical eraseblock number to erase
@@ -489,6 +532,12 @@ int ubi_io_sync_erase(struct ubi_device *ubi, int pnum, int torture)
489 return -EROFS; 532 return -EROFS;
490 } 533 }
491 534
535 if (ubi->nor_flash) {
536 err = nor_erase_prepare(ubi, pnum);
537 if (err)
538 return err;
539 }
540
492 if (torture) { 541 if (torture) {
493 ret = torture_peb(ubi, pnum); 542 ret = torture_peb(ubi, pnum);
494 if (ret < 0) 543 if (ret < 0)
@@ -672,11 +721,6 @@ int ubi_io_read_ec_hdr(struct ubi_device *ubi, int pnum,
672 if (read_err != -EBADMSG && 721 if (read_err != -EBADMSG &&
673 check_pattern(ec_hdr, 0xFF, UBI_EC_HDR_SIZE)) { 722 check_pattern(ec_hdr, 0xFF, UBI_EC_HDR_SIZE)) {
674 /* The physical eraseblock is supposedly empty */ 723 /* The physical eraseblock is supposedly empty */
675 err = paranoid_check_all_ff(ubi, pnum, 0,
676 ubi->peb_size);
677 if (err)
678 return err > 0 ? UBI_IO_BAD_EC_HDR : err;
679
680 if (verbose) 724 if (verbose)
681 ubi_warn("no EC header found at PEB %d, " 725 ubi_warn("no EC header found at PEB %d, "
682 "only 0xFF bytes", pnum); 726 "only 0xFF bytes", pnum);
@@ -752,6 +796,7 @@ int ubi_io_write_ec_hdr(struct ubi_device *ubi, int pnum,
752 ec_hdr->version = UBI_VERSION; 796 ec_hdr->version = UBI_VERSION;
753 ec_hdr->vid_hdr_offset = cpu_to_be32(ubi->vid_hdr_offset); 797 ec_hdr->vid_hdr_offset = cpu_to_be32(ubi->vid_hdr_offset);
754 ec_hdr->data_offset = cpu_to_be32(ubi->leb_start); 798 ec_hdr->data_offset = cpu_to_be32(ubi->leb_start);
799 ec_hdr->image_seq = cpu_to_be32(ubi->image_seq);
755 crc = crc32(UBI_CRC32_INIT, ec_hdr, UBI_EC_HDR_SIZE_CRC); 800 crc = crc32(UBI_CRC32_INIT, ec_hdr, UBI_EC_HDR_SIZE_CRC);
756 ec_hdr->hdr_crc = cpu_to_be32(crc); 801 ec_hdr->hdr_crc = cpu_to_be32(crc);
757 802
@@ -947,15 +992,6 @@ int ubi_io_read_vid_hdr(struct ubi_device *ubi, int pnum,
947 if (read_err != -EBADMSG && 992 if (read_err != -EBADMSG &&
948 check_pattern(vid_hdr, 0xFF, UBI_VID_HDR_SIZE)) { 993 check_pattern(vid_hdr, 0xFF, UBI_VID_HDR_SIZE)) {
949 /* The physical eraseblock is supposedly free */ 994 /* The physical eraseblock is supposedly free */
950
951 /*
952 * The below is just a paranoid check, it has to be
953 * compiled out if paranoid checks are disabled.
954 */
955 err = paranoid_check_empty(ubi, pnum);
956 if (err)
957 return err > 0 ? UBI_IO_BAD_VID_HDR : err;
958
959 if (verbose) 995 if (verbose)
960 ubi_warn("no VID header found at PEB %d, " 996 ubi_warn("no VID header found at PEB %d, "
961 "only 0xFF bytes", pnum); 997 "only 0xFF bytes", pnum);
@@ -1229,7 +1265,7 @@ exit:
1229} 1265}
1230 1266
1231/** 1267/**
1232 * paranoid_check_all_ff - check that a region of flash is empty. 1268 * ubi_dbg_check_all_ff - check that a region of flash is empty.
1233 * @ubi: UBI device description object 1269 * @ubi: UBI device description object
1234 * @pnum: the physical eraseblock number to check 1270 * @pnum: the physical eraseblock number to check
1235 * @offset: the starting offset within the physical eraseblock to check 1271 * @offset: the starting offset within the physical eraseblock to check
@@ -1239,8 +1275,7 @@ exit:
1239 * @offset of the physical eraseblock @pnum, %1 if not, and a negative error 1275 * @offset of the physical eraseblock @pnum, %1 if not, and a negative error
1240 * code if an error occurred. 1276 * code if an error occurred.
1241 */ 1277 */
1242static int paranoid_check_all_ff(struct ubi_device *ubi, int pnum, int offset, 1278int ubi_dbg_check_all_ff(struct ubi_device *ubi, int pnum, int offset, int len)
1243 int len)
1244{ 1279{
1245 size_t read; 1280 size_t read;
1246 int err; 1281 int err;
@@ -1276,74 +1311,4 @@ error:
1276 return err; 1311 return err;
1277} 1312}
1278 1313
1279/**
1280 * paranoid_check_empty - whether a PEB is empty.
1281 * @ubi: UBI device description object
1282 * @pnum: the physical eraseblock number to check
1283 *
1284 * This function makes sure PEB @pnum is empty, which means it contains only
1285 * %0xFF data bytes. Returns zero if the PEB is empty, %1 if not, and a
1286 * negative error code in case of failure.
1287 *
1288 * Empty PEBs have the EC header, and do not have the VID header. The caller of
1289 * this function should have already made sure the PEB does not have the VID
1290 * header. However, this function re-checks that, because it is possible that
1291 * the header and data has already been written to the PEB.
1292 *
1293 * Let's consider a possible scenario. Suppose there are 2 tasks - A and B.
1294 * Task A is in 'wear_leveling_worker()'. It is reading VID header of PEB X to
1295 * find which LEB it corresponds to. PEB X is currently unmapped, and has no
1296 * VID header. Task B is trying to write to PEB X.
1297 *
1298 * Task A: in 'ubi_io_read_vid_hdr()': reads the VID header from PEB X. The
1299 * read data contain all 0xFF bytes;
1300 * Task B: writes VID header and some data to PEB X;
1301 * Task A: assumes PEB X is empty, calls 'paranoid_check_empty()'. And if we
1302 * do not re-read the VID header, and do not cancel the checking if it
1303 * is there, we fail.
1304 */
1305static int paranoid_check_empty(struct ubi_device *ubi, int pnum)
1306{
1307 int err, offs = ubi->vid_hdr_aloffset, len = ubi->vid_hdr_alsize;
1308 size_t read;
1309 uint32_t magic;
1310 const struct ubi_vid_hdr *vid_hdr;
1311
1312 mutex_lock(&ubi->dbg_buf_mutex);
1313 err = ubi->mtd->read(ubi->mtd, offs, len, &read, ubi->dbg_peb_buf);
1314 if (err && err != -EUCLEAN) {
1315 ubi_err("error %d while reading %d bytes from PEB %d:%d, "
1316 "read %zd bytes", err, len, pnum, offs, read);
1317 goto error;
1318 }
1319
1320 vid_hdr = ubi->dbg_peb_buf;
1321 magic = be32_to_cpu(vid_hdr->magic);
1322 if (magic == UBI_VID_HDR_MAGIC)
1323 /* The PEB contains VID header, so it is not empty */
1324 goto out;
1325
1326 err = check_pattern(ubi->dbg_peb_buf, 0xFF, len);
1327 if (err == 0) {
1328 ubi_err("flash region at PEB %d:%d, length %d does not "
1329 "contain all 0xFF bytes", pnum, offs, len);
1330 goto fail;
1331 }
1332
1333out:
1334 mutex_unlock(&ubi->dbg_buf_mutex);
1335 return 0;
1336
1337fail:
1338 ubi_err("paranoid check failed for PEB %d", pnum);
1339 ubi_msg("hex dump of the %d-%d region", offs, offs + len);
1340 print_hex_dump(KERN_DEBUG, "", DUMP_PREFIX_OFFSET, 32, 1,
1341 ubi->dbg_peb_buf, len, 1);
1342 err = 1;
1343error:
1344 ubi_dbg_dump_stack();
1345 mutex_unlock(&ubi->dbg_buf_mutex);
1346 return err;
1347}
1348
1349#endif /* CONFIG_MTD_UBI_DEBUG_PARANOID */ 1314#endif /* CONFIG_MTD_UBI_DEBUG_PARANOID */
diff --git a/drivers/mtd/ubi/scan.c b/drivers/mtd/ubi/scan.c
index c3d653ba5ca0..b847745394b4 100644
--- a/drivers/mtd/ubi/scan.c
+++ b/drivers/mtd/ubi/scan.c
@@ -757,6 +757,8 @@ static int process_eb(struct ubi_device *ubi, struct ubi_scan_info *si,
757 si->is_empty = 0; 757 si->is_empty = 0;
758 758
759 if (!ec_corr) { 759 if (!ec_corr) {
760 int image_seq;
761
760 /* Make sure UBI version is OK */ 762 /* Make sure UBI version is OK */
761 if (ech->version != UBI_VERSION) { 763 if (ech->version != UBI_VERSION) {
762 ubi_err("this UBI version is %d, image version is %d", 764 ubi_err("this UBI version is %d, image version is %d",
@@ -778,6 +780,29 @@ static int process_eb(struct ubi_device *ubi, struct ubi_scan_info *si,
778 ubi_dbg_dump_ec_hdr(ech); 780 ubi_dbg_dump_ec_hdr(ech);
779 return -EINVAL; 781 return -EINVAL;
780 } 782 }
783
784 /*
785 * Make sure that all PEBs have the same image sequence number.
786 * This allows us to detect situations when users flash UBI
787 * images incorrectly, so that the flash has the new UBI image
788 * and leftovers from the old one. This feature was added
789 * relatively recently, and the sequence number was always
790 * zero, because old UBI implementations always set it to zero.
791 * For this reasons, we do not panic if some PEBs have zero
792 * sequence number, while other PEBs have non-zero sequence
793 * number.
794 */
795 image_seq = be32_to_cpu(ech->image_seq);
796 if (!si->image_seq_set) {
797 ubi->image_seq = image_seq;
798 si->image_seq_set = 1;
799 } else if (ubi->image_seq && ubi->image_seq != image_seq) {
800 ubi_err("bad image sequence number %d in PEB %d, "
801 "expected %d", image_seq, pnum, ubi->image_seq);
802 ubi_dbg_dump_ec_hdr(ech);
803 return -EINVAL;
804 }
805
781 } 806 }
782 807
783 /* OK, we've done with the EC header, let's look at the VID header */ 808 /* OK, we've done with the EC header, let's look at the VID header */
diff --git a/drivers/mtd/ubi/scan.h b/drivers/mtd/ubi/scan.h
index 61df208e2f20..1017cf12def5 100644
--- a/drivers/mtd/ubi/scan.h
+++ b/drivers/mtd/ubi/scan.h
@@ -102,6 +102,7 @@ struct ubi_scan_volume {
102 * @mean_ec: mean erase counter value 102 * @mean_ec: mean erase counter value
103 * @ec_sum: a temporary variable used when calculating @mean_ec 103 * @ec_sum: a temporary variable used when calculating @mean_ec
104 * @ec_count: a temporary variable used when calculating @mean_ec 104 * @ec_count: a temporary variable used when calculating @mean_ec
105 * @image_seq_set: indicates @ubi->image_seq is known
105 * 106 *
106 * This data structure contains the result of scanning and may be used by other 107 * This data structure contains the result of scanning and may be used by other
107 * UBI sub-systems to build final UBI data structures, further error-recovery 108 * UBI sub-systems to build final UBI data structures, further error-recovery
@@ -124,6 +125,7 @@ struct ubi_scan_info {
124 int mean_ec; 125 int mean_ec;
125 uint64_t ec_sum; 126 uint64_t ec_sum;
126 int ec_count; 127 int ec_count;
128 int image_seq_set;
127}; 129};
128 130
129struct ubi_device; 131struct ubi_device;
diff --git a/drivers/mtd/ubi/ubi-media.h b/drivers/mtd/ubi/ubi-media.h
index 8419fdccc79c..503ea9b27309 100644
--- a/drivers/mtd/ubi/ubi-media.h
+++ b/drivers/mtd/ubi/ubi-media.h
@@ -129,6 +129,7 @@ enum {
129 * @ec: the erase counter 129 * @ec: the erase counter
130 * @vid_hdr_offset: where the VID header starts 130 * @vid_hdr_offset: where the VID header starts
131 * @data_offset: where the user data start 131 * @data_offset: where the user data start
132 * @image_seq: image sequence number
132 * @padding2: reserved for future, zeroes 133 * @padding2: reserved for future, zeroes
133 * @hdr_crc: erase counter header CRC checksum 134 * @hdr_crc: erase counter header CRC checksum
134 * 135 *
@@ -144,6 +145,14 @@ enum {
144 * volume identifier header and user data, relative to the beginning of the 145 * volume identifier header and user data, relative to the beginning of the
145 * physical eraseblock. These values have to be the same for all physical 146 * physical eraseblock. These values have to be the same for all physical
146 * eraseblocks. 147 * eraseblocks.
148 *
149 * The @image_seq field is used to validate a UBI image that has been prepared
150 * for a UBI device. The @image_seq value can be any value, but it must be the
151 * same on all eraseblocks. UBI will ensure that all new erase counter headers
152 * also contain this value, and will check the value when scanning at start-up.
153 * One way to make use of @image_seq is to increase its value by one every time
154 * an image is flashed over an existing image, then, if the flashing does not
155 * complete, UBI will detect the error when scanning.
147 */ 156 */
148struct ubi_ec_hdr { 157struct ubi_ec_hdr {
149 __be32 magic; 158 __be32 magic;
@@ -152,7 +161,8 @@ struct ubi_ec_hdr {
152 __be64 ec; /* Warning: the current limit is 31-bit anyway! */ 161 __be64 ec; /* Warning: the current limit is 31-bit anyway! */
153 __be32 vid_hdr_offset; 162 __be32 vid_hdr_offset;
154 __be32 data_offset; 163 __be32 data_offset;
155 __u8 padding2[36]; 164 __be32 image_seq;
165 __u8 padding2[32];
156 __be32 hdr_crc; 166 __be32 hdr_crc;
157} __attribute__ ((packed)); 167} __attribute__ ((packed));
158 168
diff --git a/drivers/mtd/ubi/ubi.h b/drivers/mtd/ubi/ubi.h
index 28acd133c997..6a5fe9633783 100644
--- a/drivers/mtd/ubi/ubi.h
+++ b/drivers/mtd/ubi/ubi.h
@@ -301,6 +301,7 @@ struct ubi_wl_entry;
301 * @vol->readers, @vol->writers, @vol->exclusive, 301 * @vol->readers, @vol->writers, @vol->exclusive,
302 * @vol->ref_count, @vol->mapping and @vol->eba_tbl. 302 * @vol->ref_count, @vol->mapping and @vol->eba_tbl.
303 * @ref_count: count of references on the UBI device 303 * @ref_count: count of references on the UBI device
304 * @image_seq: image sequence number recorded on EC headers
304 * 305 *
305 * @rsvd_pebs: count of reserved physical eraseblocks 306 * @rsvd_pebs: count of reserved physical eraseblocks
306 * @avail_pebs: count of available physical eraseblocks 307 * @avail_pebs: count of available physical eraseblocks
@@ -372,6 +373,7 @@ struct ubi_wl_entry;
372 * @vid_hdr_shift: contains @vid_hdr_offset - @vid_hdr_aloffset 373 * @vid_hdr_shift: contains @vid_hdr_offset - @vid_hdr_aloffset
373 * @bad_allowed: whether the MTD device admits of bad physical eraseblocks or 374 * @bad_allowed: whether the MTD device admits of bad physical eraseblocks or
374 * not 375 * not
376 * @nor_flash: non-zero if working on top of NOR flash
375 * @mtd: MTD device descriptor 377 * @mtd: MTD device descriptor
376 * 378 *
377 * @peb_buf1: a buffer of PEB size used for different purposes 379 * @peb_buf1: a buffer of PEB size used for different purposes
@@ -390,6 +392,7 @@ struct ubi_device {
390 struct ubi_volume *volumes[UBI_MAX_VOLUMES+UBI_INT_VOL_COUNT]; 392 struct ubi_volume *volumes[UBI_MAX_VOLUMES+UBI_INT_VOL_COUNT];
391 spinlock_t volumes_lock; 393 spinlock_t volumes_lock;
392 int ref_count; 394 int ref_count;
395 int image_seq;
393 396
394 int rsvd_pebs; 397 int rsvd_pebs;
395 int avail_pebs; 398 int avail_pebs;
@@ -452,7 +455,8 @@ struct ubi_device {
452 int vid_hdr_offset; 455 int vid_hdr_offset;
453 int vid_hdr_aloffset; 456 int vid_hdr_aloffset;
454 int vid_hdr_shift; 457 int vid_hdr_shift;
455 int bad_allowed; 458 unsigned int bad_allowed:1;
459 unsigned int nor_flash:1;
456 struct mtd_info *mtd; 460 struct mtd_info *mtd;
457 461
458 void *peb_buf1; 462 void *peb_buf1;
diff --git a/drivers/mtd/ubi/wl.c b/drivers/mtd/ubi/wl.c
index 2b2472300610..600c7229d5cf 100644
--- a/drivers/mtd/ubi/wl.c
+++ b/drivers/mtd/ubi/wl.c
@@ -459,6 +459,14 @@ retry:
459 dbg_wl("PEB %d EC %d", e->pnum, e->ec); 459 dbg_wl("PEB %d EC %d", e->pnum, e->ec);
460 prot_queue_add(ubi, e); 460 prot_queue_add(ubi, e);
461 spin_unlock(&ubi->wl_lock); 461 spin_unlock(&ubi->wl_lock);
462
463 err = ubi_dbg_check_all_ff(ubi, e->pnum, ubi->vid_hdr_aloffset,
464 ubi->peb_size - ubi->vid_hdr_aloffset);
465 if (err) {
466 ubi_err("new PEB %d does not contain all 0xFF bytes", e->pnum);
467 return err > 0 ? -EINVAL : err;
468 }
469
462 return e->pnum; 470 return e->pnum;
463} 471}
464 472
diff --git a/drivers/net/a2065.c b/drivers/net/a2065.c
index 85a18175730b..08787f5a22a3 100644
--- a/drivers/net/a2065.c
+++ b/drivers/net/a2065.c
@@ -569,16 +569,8 @@ static int lance_start_xmit (struct sk_buff *skb, struct net_device *dev)
569 569
570#ifdef DEBUG_DRIVER 570#ifdef DEBUG_DRIVER
571 /* dump the packet */ 571 /* dump the packet */
572 { 572 print_hex_dump(KERN_DEBUG, "skb->data: ", DUMP_PREFIX_NONE,
573 int i; 573 16, 1, skb->data, 64, true);
574
575 for (i = 0; i < 64; i++) {
576 if ((i % 16) == 0)
577 printk("\n" KERN_DEBUG);
578 printk ("%2.2x ", skb->data [i]);
579 }
580 printk("\n");
581 }
582#endif 574#endif
583 entry = lp->tx_new & lp->tx_ring_mod_mask; 575 entry = lp->tx_new & lp->tx_ring_mod_mask;
584 ib->btx_ring [entry].length = (-skblen) | 0xf000; 576 ib->btx_ring [entry].length = (-skblen) | 0xf000;
diff --git a/drivers/net/arcnet/arcnet.c b/drivers/net/arcnet/arcnet.c
index d6d4ab3b430c..7d227cdab9f8 100644
--- a/drivers/net/arcnet/arcnet.c
+++ b/drivers/net/arcnet/arcnet.c
@@ -158,15 +158,12 @@ module_exit(arcnet_exit);
158void arcnet_dump_skb(struct net_device *dev, 158void arcnet_dump_skb(struct net_device *dev,
159 struct sk_buff *skb, char *desc) 159 struct sk_buff *skb, char *desc)
160{ 160{
161 int i; 161 char hdr[32];
162 162
163 printk(KERN_DEBUG "%6s: skb dump (%s) follows:", dev->name, desc); 163 /* dump the packet */
164 for (i = 0; i < skb->len; i++) { 164 snprintf(hdr, sizeof(hdr), "%6s:%s skb->data:", dev->name, desc);
165 if (i % 16 == 0) 165 print_hex_dump(KERN_DEBUG, hdr, DUMP_PREFIX_OFFSET,
166 printk("\n" KERN_DEBUG "[%04X] ", i); 166 16, 1, skb->data, skb->len, true);
167 printk("%02X ", ((u_char *) skb->data)[i]);
168 }
169 printk("\n");
170} 167}
171 168
172EXPORT_SYMBOL(arcnet_dump_skb); 169EXPORT_SYMBOL(arcnet_dump_skb);
@@ -184,6 +181,7 @@ static void arcnet_dump_packet(struct net_device *dev, int bufnum,
184 int i, length; 181 int i, length;
185 unsigned long flags = 0; 182 unsigned long flags = 0;
186 static uint8_t buf[512]; 183 static uint8_t buf[512];
184 char hdr[32];
187 185
188 /* hw.copy_from_card expects IRQ context so take the IRQ lock 186 /* hw.copy_from_card expects IRQ context so take the IRQ lock
189 to keep it single threaded */ 187 to keep it single threaded */
@@ -197,14 +195,10 @@ static void arcnet_dump_packet(struct net_device *dev, int bufnum,
197 /* if the offset[0] byte is nonzero, this is a 256-byte packet */ 195 /* if the offset[0] byte is nonzero, this is a 256-byte packet */
198 length = (buf[2] ? 256 : 512); 196 length = (buf[2] ? 256 : 512);
199 197
200 printk(KERN_DEBUG "%6s: packet dump (%s) follows:", dev->name, desc); 198 /* dump the packet */
201 for (i = 0; i < length; i++) { 199 snprintf(hdr, sizeof(hdr), "%6s:%s packet dump:", dev->name, desc);
202 if (i % 16 == 0) 200 print_hex_dump(KERN_DEBUG, hdr, DUMP_PREFIX_OFFSET,
203 printk("\n" KERN_DEBUG "[%04X] ", i); 201 16, 1, buf, length, true);
204 printk("%02X ", buf[i]);
205 }
206 printk("\n");
207
208} 202}
209 203
210#else 204#else
diff --git a/drivers/net/bmac.c b/drivers/net/bmac.c
index 9578a3dfac01..206144f2470f 100644
--- a/drivers/net/bmac.c
+++ b/drivers/net/bmac.c
@@ -428,10 +428,11 @@ bmac_init_phy(struct net_device *dev)
428 printk(KERN_DEBUG "phy registers:"); 428 printk(KERN_DEBUG "phy registers:");
429 for (addr = 0; addr < 32; ++addr) { 429 for (addr = 0; addr < 32; ++addr) {
430 if ((addr & 7) == 0) 430 if ((addr & 7) == 0)
431 printk("\n" KERN_DEBUG); 431 printk(KERN_DEBUG);
432 printk(" %.4x", bmac_mif_read(dev, addr)); 432 printk(KERN_CONT " %.4x", bmac_mif_read(dev, addr));
433 } 433 }
434 printk("\n"); 434 printk(KERN_CONT "\n");
435
435 if (bp->is_bmac_plus) { 436 if (bp->is_bmac_plus) {
436 unsigned int capable, ctrl; 437 unsigned int capable, ctrl;
437 438
diff --git a/drivers/net/bnx2x_main.c b/drivers/net/bnx2x_main.c
index 6c67be679764..c36a5f33739f 100644
--- a/drivers/net/bnx2x_main.c
+++ b/drivers/net/bnx2x_main.c
@@ -484,8 +484,9 @@ static void bnx2x_fw_dump(struct bnx2x *bp)
484 484
485 mark = REG_RD(bp, MCP_REG_MCPR_SCRATCH + 0xf104); 485 mark = REG_RD(bp, MCP_REG_MCPR_SCRATCH + 0xf104);
486 mark = ((mark + 0x3) & ~0x3); 486 mark = ((mark + 0x3) & ~0x3);
487 printk(KERN_ERR PFX "begin fw dump (mark 0x%x)\n" KERN_ERR, mark); 487 printk(KERN_ERR PFX "begin fw dump (mark 0x%x)\n", mark);
488 488
489 printk(KERN_ERR PFX);
489 for (offset = mark - 0x08000000; offset <= 0xF900; offset += 0x8*4) { 490 for (offset = mark - 0x08000000; offset <= 0xF900; offset += 0x8*4) {
490 for (word = 0; word < 8; word++) 491 for (word = 0; word < 8; word++)
491 data[word] = htonl(REG_RD(bp, MCP_REG_MCPR_SCRATCH + 492 data[word] = htonl(REG_RD(bp, MCP_REG_MCPR_SCRATCH +
@@ -500,7 +501,7 @@ static void bnx2x_fw_dump(struct bnx2x *bp)
500 data[8] = 0x0; 501 data[8] = 0x0;
501 printk(KERN_CONT "%s", (char *)data); 502 printk(KERN_CONT "%s", (char *)data);
502 } 503 }
503 printk("\n" KERN_ERR PFX "end of fw dump\n"); 504 printk(KERN_ERR PFX "end of fw dump\n");
504} 505}
505 506
506static void bnx2x_panic_dump(struct bnx2x *bp) 507static void bnx2x_panic_dump(struct bnx2x *bp)
@@ -7354,7 +7355,7 @@ static void bnx2x_reset_task(struct work_struct *work)
7354#ifdef BNX2X_STOP_ON_ERROR 7355#ifdef BNX2X_STOP_ON_ERROR
7355 BNX2X_ERR("reset task called but STOP_ON_ERROR defined" 7356 BNX2X_ERR("reset task called but STOP_ON_ERROR defined"
7356 " so reset not done to allow debug dump,\n" 7357 " so reset not done to allow debug dump,\n"
7357 KERN_ERR " you will need to reboot when done\n"); 7358 " you will need to reboot when done\n");
7358 return; 7359 return;
7359#endif 7360#endif
7360 7361
diff --git a/drivers/net/dl2k.c b/drivers/net/dl2k.c
index 895d72143ee0..4b6a219fecea 100644
--- a/drivers/net/dl2k.c
+++ b/drivers/net/dl2k.c
@@ -268,8 +268,9 @@ rio_probe1 (struct pci_dev *pdev, const struct pci_device_id *ent)
268 printk(KERN_INFO "tx_coalesce:\t%d packets\n", 268 printk(KERN_INFO "tx_coalesce:\t%d packets\n",
269 tx_coalesce); 269 tx_coalesce);
270 if (np->coalesce) 270 if (np->coalesce)
271 printk(KERN_INFO "rx_coalesce:\t%d packets\n" 271 printk(KERN_INFO
272 KERN_INFO "rx_timeout: \t%d ns\n", 272 "rx_coalesce:\t%d packets\n"
273 "rx_timeout: \t%d ns\n",
273 np->rx_coalesce, np->rx_timeout*640); 274 np->rx_coalesce, np->rx_timeout*640);
274 if (np->vlan) 275 if (np->vlan)
275 printk(KERN_INFO "vlan(id):\t%d\n", np->vlan); 276 printk(KERN_INFO "vlan(id):\t%d\n", np->vlan);
@@ -1522,9 +1523,9 @@ mii_get_media (struct net_device *dev)
1522 printk (KERN_INFO "Operating at 10 Mbps, "); 1523 printk (KERN_INFO "Operating at 10 Mbps, ");
1523 } 1524 }
1524 if (bmcr & MII_BMCR_DUPLEX_MODE) { 1525 if (bmcr & MII_BMCR_DUPLEX_MODE) {
1525 printk ("Full duplex\n"); 1526 printk (KERN_CONT "Full duplex\n");
1526 } else { 1527 } else {
1527 printk ("Half duplex\n"); 1528 printk (KERN_CONT "Half duplex\n");
1528 } 1529 }
1529 } 1530 }
1530 if (np->tx_flow) 1531 if (np->tx_flow)
@@ -1614,9 +1615,9 @@ mii_set_media (struct net_device *dev)
1614 } 1615 }
1615 if (np->full_duplex) { 1616 if (np->full_duplex) {
1616 bmcr |= MII_BMCR_DUPLEX_MODE; 1617 bmcr |= MII_BMCR_DUPLEX_MODE;
1617 printk ("Full duplex\n"); 1618 printk (KERN_CONT "Full duplex\n");
1618 } else { 1619 } else {
1619 printk ("Half duplex\n"); 1620 printk (KERN_CONT "Half duplex\n");
1620 } 1621 }
1621#if 0 1622#if 0
1622 /* Set 1000BaseT Master/Slave setting */ 1623 /* Set 1000BaseT Master/Slave setting */
@@ -1669,9 +1670,9 @@ mii_get_media_pcs (struct net_device *dev)
1669 __u16 bmcr = mii_read (dev, phy_addr, PCS_BMCR); 1670 __u16 bmcr = mii_read (dev, phy_addr, PCS_BMCR);
1670 printk (KERN_INFO "Operating at 1000 Mbps, "); 1671 printk (KERN_INFO "Operating at 1000 Mbps, ");
1671 if (bmcr & MII_BMCR_DUPLEX_MODE) { 1672 if (bmcr & MII_BMCR_DUPLEX_MODE) {
1672 printk ("Full duplex\n"); 1673 printk (KERN_CONT "Full duplex\n");
1673 } else { 1674 } else {
1674 printk ("Half duplex\n"); 1675 printk (KERN_CONT "Half duplex\n");
1675 } 1676 }
1676 } 1677 }
1677 if (np->tx_flow) 1678 if (np->tx_flow)
diff --git a/drivers/net/epic100.c b/drivers/net/epic100.c
index b60e27dfcfa7..88d7ebf31220 100644
--- a/drivers/net/epic100.c
+++ b/drivers/net/epic100.c
@@ -338,8 +338,7 @@ static int __devinit epic_init_one (struct pci_dev *pdev,
338#ifndef MODULE 338#ifndef MODULE
339 static int printed_version; 339 static int printed_version;
340 if (!printed_version++) 340 if (!printed_version++)
341 printk (KERN_INFO "%s" KERN_INFO "%s", 341 printk(KERN_INFO "%s%s", version, version2);
342 version, version2);
343#endif 342#endif
344 343
345 card_idx++; 344 card_idx++;
@@ -1600,7 +1599,7 @@ static int __init epic_init (void)
1600{ 1599{
1601/* when a module, this is printed whether or not devices are found in probe */ 1600/* when a module, this is printed whether or not devices are found in probe */
1602#ifdef MODULE 1601#ifdef MODULE
1603 printk (KERN_INFO "%s" KERN_INFO "%s", 1602 printk (KERN_INFO "%s%s",
1604 version, version2); 1603 version, version2);
1605#endif 1604#endif
1606 1605
diff --git a/drivers/net/fealnx.c b/drivers/net/fealnx.c
index ee51557e942b..160655d24581 100644
--- a/drivers/net/fealnx.c
+++ b/drivers/net/fealnx.c
@@ -1210,17 +1210,20 @@ static void fealnx_tx_timeout(struct net_device *dev)
1210 unsigned long flags; 1210 unsigned long flags;
1211 int i; 1211 int i;
1212 1212
1213 printk(KERN_WARNING "%s: Transmit timed out, status %8.8x," 1213 printk(KERN_WARNING
1214 " resetting...\n", dev->name, ioread32(ioaddr + ISR)); 1214 "%s: Transmit timed out, status %8.8x, resetting...\n",
1215 dev->name, ioread32(ioaddr + ISR));
1215 1216
1216 { 1217 {
1217 printk(KERN_DEBUG " Rx ring %p: ", np->rx_ring); 1218 printk(KERN_DEBUG " Rx ring %p: ", np->rx_ring);
1218 for (i = 0; i < RX_RING_SIZE; i++) 1219 for (i = 0; i < RX_RING_SIZE; i++)
1219 printk(" %8.8x", (unsigned int) np->rx_ring[i].status); 1220 printk(KERN_CONT " %8.8x",
1220 printk("\n" KERN_DEBUG " Tx ring %p: ", np->tx_ring); 1221 (unsigned int) np->rx_ring[i].status);
1222 printk(KERN_CONT "\n");
1223 printk(KERN_DEBUG " Tx ring %p: ", np->tx_ring);
1221 for (i = 0; i < TX_RING_SIZE; i++) 1224 for (i = 0; i < TX_RING_SIZE; i++)
1222 printk(" %4.4x", np->tx_ring[i].status); 1225 printk(KERN_CONT " %4.4x", np->tx_ring[i].status);
1223 printk("\n"); 1226 printk(KERN_CONT "\n");
1224 } 1227 }
1225 1228
1226 spin_lock_irqsave(&np->lock, flags); 1229 spin_lock_irqsave(&np->lock, flags);
diff --git a/drivers/net/hamachi.c b/drivers/net/hamachi.c
index 9d5b62cb30f7..d62378cbc149 100644
--- a/drivers/net/hamachi.c
+++ b/drivers/net/hamachi.c
@@ -173,8 +173,8 @@ static int tx_params[MAX_UNITS] = {-1, -1, -1, -1, -1, -1, -1, -1};
173 173
174static const char version[] __devinitconst = 174static const char version[] __devinitconst =
175KERN_INFO DRV_NAME ".c:v" DRV_VERSION " " DRV_RELDATE " Written by Donald Becker\n" 175KERN_INFO DRV_NAME ".c:v" DRV_VERSION " " DRV_RELDATE " Written by Donald Becker\n"
176KERN_INFO " Some modifications by Eric kasten <kasten@nscl.msu.edu>\n" 176" Some modifications by Eric kasten <kasten@nscl.msu.edu>\n"
177KERN_INFO " Further modifications by Keith Underwood <keithu@parl.clemson.edu>\n"; 177" Further modifications by Keith Underwood <keithu@parl.clemson.edu>\n";
178 178
179 179
180/* IP_MF appears to be only defined in <netinet/ip.h>, however, 180/* IP_MF appears to be only defined in <netinet/ip.h>, however,
@@ -1080,11 +1080,14 @@ static void hamachi_tx_timeout(struct net_device *dev)
1080 { 1080 {
1081 printk(KERN_DEBUG " Rx ring %p: ", hmp->rx_ring); 1081 printk(KERN_DEBUG " Rx ring %p: ", hmp->rx_ring);
1082 for (i = 0; i < RX_RING_SIZE; i++) 1082 for (i = 0; i < RX_RING_SIZE; i++)
1083 printk(" %8.8x", le32_to_cpu(hmp->rx_ring[i].status_n_length)); 1083 printk(KERN_CONT " %8.8x",
1084 printk("\n"KERN_DEBUG" Tx ring %p: ", hmp->tx_ring); 1084 le32_to_cpu(hmp->rx_ring[i].status_n_length));
1085 printk(KERN_CONT "\n");
1086 printk(KERN_DEBUG" Tx ring %p: ", hmp->tx_ring);
1085 for (i = 0; i < TX_RING_SIZE; i++) 1087 for (i = 0; i < TX_RING_SIZE; i++)
1086 printk(" %4.4x", le32_to_cpu(hmp->tx_ring[i].status_n_length)); 1088 printk(KERN_CONT " %4.4x",
1087 printk("\n"); 1089 le32_to_cpu(hmp->tx_ring[i].status_n_length));
1090 printk(KERN_CONT "\n");
1088 } 1091 }
1089 1092
1090 /* Reinit the hardware and make sure the Rx and Tx processes 1093 /* Reinit the hardware and make sure the Rx and Tx processes
@@ -1753,13 +1756,13 @@ static int hamachi_close(struct net_device *dev)
1753 1756
1754#ifdef __i386__ 1757#ifdef __i386__
1755 if (hamachi_debug > 2) { 1758 if (hamachi_debug > 2) {
1756 printk("\n"KERN_DEBUG" Tx ring at %8.8x:\n", 1759 printk(KERN_DEBUG " Tx ring at %8.8x:\n",
1757 (int)hmp->tx_ring_dma); 1760 (int)hmp->tx_ring_dma);
1758 for (i = 0; i < TX_RING_SIZE; i++) 1761 for (i = 0; i < TX_RING_SIZE; i++)
1759 printk(" %c #%d desc. %8.8x %8.8x.\n", 1762 printk(KERN_DEBUG " %c #%d desc. %8.8x %8.8x.\n",
1760 readl(ioaddr + TxCurPtr) == (long)&hmp->tx_ring[i] ? '>' : ' ', 1763 readl(ioaddr + TxCurPtr) == (long)&hmp->tx_ring[i] ? '>' : ' ',
1761 i, hmp->tx_ring[i].status_n_length, hmp->tx_ring[i].addr); 1764 i, hmp->tx_ring[i].status_n_length, hmp->tx_ring[i].addr);
1762 printk("\n"KERN_DEBUG " Rx ring %8.8x:\n", 1765 printk(KERN_DEBUG " Rx ring %8.8x:\n",
1763 (int)hmp->rx_ring_dma); 1766 (int)hmp->rx_ring_dma);
1764 for (i = 0; i < RX_RING_SIZE; i++) { 1767 for (i = 0; i < RX_RING_SIZE; i++) {
1765 printk(KERN_DEBUG " %c #%d desc. %4.4x %8.8x\n", 1768 printk(KERN_DEBUG " %c #%d desc. %4.4x %8.8x\n",
@@ -1770,7 +1773,7 @@ static int hamachi_close(struct net_device *dev)
1770 u16 *addr = (u16 *) 1773 u16 *addr = (u16 *)
1771 hmp->rx_skbuff[i]->data; 1774 hmp->rx_skbuff[i]->data;
1772 int j; 1775 int j;
1773 1776 printk(KERN_DEBUG "Addr: ");
1774 for (j = 0; j < 0x50; j++) 1777 for (j = 0; j < 0x50; j++)
1775 printk(" %4.4x", addr[j]); 1778 printk(" %4.4x", addr[j]);
1776 printk("\n"); 1779 printk("\n");
diff --git a/drivers/net/hamradio/baycom_epp.c b/drivers/net/hamradio/baycom_epp.c
index 5e4b7afd0683..352703255bba 100644
--- a/drivers/net/hamradio/baycom_epp.c
+++ b/drivers/net/hamradio/baycom_epp.c
@@ -68,7 +68,7 @@ static const char paranoia_str[] = KERN_ERR
68 68
69static const char bc_drvname[] = "baycom_epp"; 69static const char bc_drvname[] = "baycom_epp";
70static const char bc_drvinfo[] = KERN_INFO "baycom_epp: (C) 1998-2000 Thomas Sailer, HB9JNX/AE4WA\n" 70static const char bc_drvinfo[] = KERN_INFO "baycom_epp: (C) 1998-2000 Thomas Sailer, HB9JNX/AE4WA\n"
71KERN_INFO "baycom_epp: version 0.7 compiled " __TIME__ " " __DATE__ "\n"; 71"baycom_epp: version 0.7 compiled " __TIME__ " " __DATE__ "\n";
72 72
73/* --------------------------------------------------------------------- */ 73/* --------------------------------------------------------------------- */
74 74
diff --git a/drivers/net/hamradio/baycom_par.c b/drivers/net/hamradio/baycom_par.c
index 2e6fc4dc74b1..5f5af9a606f8 100644
--- a/drivers/net/hamradio/baycom_par.c
+++ b/drivers/net/hamradio/baycom_par.c
@@ -102,7 +102,7 @@
102 102
103static const char bc_drvname[] = "baycom_par"; 103static const char bc_drvname[] = "baycom_par";
104static const char bc_drvinfo[] = KERN_INFO "baycom_par: (C) 1996-2000 Thomas Sailer, HB9JNX/AE4WA\n" 104static const char bc_drvinfo[] = KERN_INFO "baycom_par: (C) 1996-2000 Thomas Sailer, HB9JNX/AE4WA\n"
105KERN_INFO "baycom_par: version 0.9 compiled " __TIME__ " " __DATE__ "\n"; 105"baycom_par: version 0.9 compiled " __TIME__ " " __DATE__ "\n";
106 106
107/* --------------------------------------------------------------------- */ 107/* --------------------------------------------------------------------- */
108 108
diff --git a/drivers/net/hamradio/baycom_ser_fdx.c b/drivers/net/hamradio/baycom_ser_fdx.c
index b6a816e60c0f..aa4488e871b2 100644
--- a/drivers/net/hamradio/baycom_ser_fdx.c
+++ b/drivers/net/hamradio/baycom_ser_fdx.c
@@ -91,7 +91,7 @@
91 91
92static const char bc_drvname[] = "baycom_ser_fdx"; 92static const char bc_drvname[] = "baycom_ser_fdx";
93static const char bc_drvinfo[] = KERN_INFO "baycom_ser_fdx: (C) 1996-2000 Thomas Sailer, HB9JNX/AE4WA\n" 93static const char bc_drvinfo[] = KERN_INFO "baycom_ser_fdx: (C) 1996-2000 Thomas Sailer, HB9JNX/AE4WA\n"
94KERN_INFO "baycom_ser_fdx: version 0.10 compiled " __TIME__ " " __DATE__ "\n"; 94"baycom_ser_fdx: version 0.10 compiled " __TIME__ " " __DATE__ "\n";
95 95
96/* --------------------------------------------------------------------- */ 96/* --------------------------------------------------------------------- */
97 97
diff --git a/drivers/net/hamradio/baycom_ser_hdx.c b/drivers/net/hamradio/baycom_ser_hdx.c
index 3bcc57acbe6d..88c593596020 100644
--- a/drivers/net/hamradio/baycom_ser_hdx.c
+++ b/drivers/net/hamradio/baycom_ser_hdx.c
@@ -79,7 +79,7 @@
79 79
80static const char bc_drvname[] = "baycom_ser_hdx"; 80static const char bc_drvname[] = "baycom_ser_hdx";
81static const char bc_drvinfo[] = KERN_INFO "baycom_ser_hdx: (C) 1996-2000 Thomas Sailer, HB9JNX/AE4WA\n" 81static const char bc_drvinfo[] = KERN_INFO "baycom_ser_hdx: (C) 1996-2000 Thomas Sailer, HB9JNX/AE4WA\n"
82KERN_INFO "baycom_ser_hdx: version 0.10 compiled " __TIME__ " " __DATE__ "\n"; 82"baycom_ser_hdx: version 0.10 compiled " __TIME__ " " __DATE__ "\n";
83 83
84/* --------------------------------------------------------------------- */ 84/* --------------------------------------------------------------------- */
85 85
diff --git a/drivers/net/irda/irtty-sir.c b/drivers/net/irda/irtty-sir.c
index d53aa9582137..20f9bc626688 100644
--- a/drivers/net/irda/irtty-sir.c
+++ b/drivers/net/irda/irtty-sir.c
@@ -31,7 +31,6 @@
31#include <linux/tty.h> 31#include <linux/tty.h>
32#include <linux/init.h> 32#include <linux/init.h>
33#include <asm/uaccess.h> 33#include <asm/uaccess.h>
34#include <linux/smp_lock.h>
35#include <linux/delay.h> 34#include <linux/delay.h>
36#include <linux/mutex.h> 35#include <linux/mutex.h>
37 36
diff --git a/drivers/net/mlx4/cmd.c b/drivers/net/mlx4/cmd.c
index 2845a0560b84..65ec77dc31f5 100644
--- a/drivers/net/mlx4/cmd.c
+++ b/drivers/net/mlx4/cmd.c
@@ -80,7 +80,9 @@ enum {
80 /* Bad management packet (silently discarded): */ 80 /* Bad management packet (silently discarded): */
81 CMD_STAT_BAD_PKT = 0x30, 81 CMD_STAT_BAD_PKT = 0x30,
82 /* More outstanding CQEs in CQ than new CQ size: */ 82 /* More outstanding CQEs in CQ than new CQ size: */
83 CMD_STAT_BAD_SIZE = 0x40 83 CMD_STAT_BAD_SIZE = 0x40,
84 /* Multi Function device support required: */
85 CMD_STAT_MULTI_FUNC_REQ = 0x50,
84}; 86};
85 87
86enum { 88enum {
@@ -128,6 +130,7 @@ static int mlx4_status_to_errno(u8 status)
128 [CMD_STAT_LAM_NOT_PRE] = -EAGAIN, 130 [CMD_STAT_LAM_NOT_PRE] = -EAGAIN,
129 [CMD_STAT_BAD_PKT] = -EINVAL, 131 [CMD_STAT_BAD_PKT] = -EINVAL,
130 [CMD_STAT_BAD_SIZE] = -ENOMEM, 132 [CMD_STAT_BAD_SIZE] = -ENOMEM,
133 [CMD_STAT_MULTI_FUNC_REQ] = -EACCES,
131 }; 134 };
132 135
133 if (status >= ARRAY_SIZE(trans_table) || 136 if (status >= ARRAY_SIZE(trans_table) ||
diff --git a/drivers/net/mlx4/main.c b/drivers/net/mlx4/main.c
index 018348c01193..dac621b1e9fc 100644
--- a/drivers/net/mlx4/main.c
+++ b/drivers/net/mlx4/main.c
@@ -729,7 +729,10 @@ static int mlx4_init_hca(struct mlx4_dev *dev)
729 729
730 err = mlx4_QUERY_FW(dev); 730 err = mlx4_QUERY_FW(dev);
731 if (err) { 731 if (err) {
732 mlx4_err(dev, "QUERY_FW command failed, aborting.\n"); 732 if (err == -EACCES)
733 mlx4_info(dev, "non-primary physical function, skipping.\n");
734 else
735 mlx4_err(dev, "QUERY_FW command failed, aborting.\n");
733 return err; 736 return err;
734 } 737 }
735 738
@@ -1285,6 +1288,7 @@ static struct pci_device_id mlx4_pci_table[] = {
1285 { PCI_VDEVICE(MELLANOX, 0x6750) }, /* MT25408 "Hermon" EN 10GigE PCIe gen2 */ 1288 { PCI_VDEVICE(MELLANOX, 0x6750) }, /* MT25408 "Hermon" EN 10GigE PCIe gen2 */
1286 { PCI_VDEVICE(MELLANOX, 0x6372) }, /* MT25458 ConnectX EN 10GBASE-T 10GigE */ 1289 { PCI_VDEVICE(MELLANOX, 0x6372) }, /* MT25458 ConnectX EN 10GBASE-T 10GigE */
1287 { PCI_VDEVICE(MELLANOX, 0x675a) }, /* MT25458 ConnectX EN 10GBASE-T+Gen2 10GigE */ 1290 { PCI_VDEVICE(MELLANOX, 0x675a) }, /* MT25458 ConnectX EN 10GBASE-T+Gen2 10GigE */
1291 { PCI_VDEVICE(MELLANOX, 0x6764) }, /* MT26468 ConnectX EN 10GigE PCIe gen2*/
1288 { 0, } 1292 { 0, }
1289}; 1293};
1290 1294
diff --git a/drivers/net/natsemi.c b/drivers/net/natsemi.c
index c9bfe4eea189..78c088331f57 100644
--- a/drivers/net/natsemi.c
+++ b/drivers/net/natsemi.c
@@ -130,8 +130,8 @@ static int full_duplex[MAX_UNITS];
130static const char version[] __devinitconst = 130static const char version[] __devinitconst =
131 KERN_INFO DRV_NAME " dp8381x driver, version " 131 KERN_INFO DRV_NAME " dp8381x driver, version "
132 DRV_VERSION ", " DRV_RELDATE "\n" 132 DRV_VERSION ", " DRV_RELDATE "\n"
133 KERN_INFO " originally by Donald Becker <becker@scyld.com>\n" 133 " originally by Donald Becker <becker@scyld.com>\n"
134 KERN_INFO " 2.4.x kernel port by Jeff Garzik, Tjeerd Mulder\n"; 134 " 2.4.x kernel port by Jeff Garzik, Tjeerd Mulder\n";
135 135
136MODULE_AUTHOR("Donald Becker <becker@scyld.com>"); 136MODULE_AUTHOR("Donald Becker <becker@scyld.com>");
137MODULE_DESCRIPTION("National Semiconductor DP8381x series PCI Ethernet driver"); 137MODULE_DESCRIPTION("National Semiconductor DP8381x series PCI Ethernet driver");
diff --git a/drivers/net/ne.c b/drivers/net/ne.c
index 5c3e242428f1..992dbfffdb05 100644
--- a/drivers/net/ne.c
+++ b/drivers/net/ne.c
@@ -321,7 +321,7 @@ static int __init ne_probe1(struct net_device *dev, unsigned long ioaddr)
321 } 321 }
322 322
323 if (ei_debug && version_printed++ == 0) 323 if (ei_debug && version_printed++ == 0)
324 printk(KERN_INFO "%s" KERN_INFO "%s", version1, version2); 324 printk(KERN_INFO "%s%s", version1, version2);
325 325
326 printk(KERN_INFO "NE*000 ethercard probe at %#3lx:", ioaddr); 326 printk(KERN_INFO "NE*000 ethercard probe at %#3lx:", ioaddr);
327 327
diff --git a/drivers/net/pci-skeleton.c b/drivers/net/pci-skeleton.c
index 8c1f6988f398..89f7b2ad5231 100644
--- a/drivers/net/pci-skeleton.c
+++ b/drivers/net/pci-skeleton.c
@@ -105,7 +105,7 @@ IVc. Errata
105 105
106static char version[] __devinitdata = 106static char version[] __devinitdata =
107KERN_INFO NETDRV_DRIVER_LOAD_MSG "\n" 107KERN_INFO NETDRV_DRIVER_LOAD_MSG "\n"
108KERN_INFO " Support available from http://foo.com/bar/baz.html\n"; 108" Support available from http://foo.com/bar/baz.html\n";
109 109
110/* define to 1 to enable PIO instead of MMIO */ 110/* define to 1 to enable PIO instead of MMIO */
111#undef USE_IO_OPS 111#undef USE_IO_OPS
diff --git a/drivers/net/pcmcia/ibmtr_cs.c b/drivers/net/pcmcia/ibmtr_cs.c
index f51944b28cfa..06618af1a468 100644
--- a/drivers/net/pcmcia/ibmtr_cs.c
+++ b/drivers/net/pcmcia/ibmtr_cs.c
@@ -298,14 +298,11 @@ static int __devinit ibmtr_config(struct pcmcia_device *link)
298 298
299 strcpy(info->node.dev_name, dev->name); 299 strcpy(info->node.dev_name, dev->name);
300 300
301 printk(KERN_INFO "%s: port %#3lx, irq %d,", 301 printk(KERN_INFO
302 dev->name, dev->base_addr, dev->irq); 302 "%s: port %#3lx, irq %d, mmio %#5lx, sram %#5lx, hwaddr=%pM\n",
303 printk (" mmio %#5lx,", (u_long)ti->mmio); 303 dev->name, dev->base_addr, dev->irq,
304 printk (" sram %#5lx,", (u_long)ti->sram_base << 12); 304 (u_long)ti->mmio, (u_long)(ti->sram_base << 12),
305 printk ("\n" KERN_INFO " hwaddr="); 305 dev->dev_addr);
306 for (i = 0; i < TR_ALEN; i++)
307 printk("%02X", dev->dev_addr[i]);
308 printk("\n");
309 return 0; 306 return 0;
310 307
311cs_failed: 308cs_failed:
diff --git a/drivers/net/pcmcia/nmclan_cs.c b/drivers/net/pcmcia/nmclan_cs.c
index 02ef63ed1f99..36de91baf238 100644
--- a/drivers/net/pcmcia/nmclan_cs.c
+++ b/drivers/net/pcmcia/nmclan_cs.c
@@ -1425,15 +1425,12 @@ static void BuildLAF(int *ladrf, int *adr)
1425 ladrf[byte] |= (1 << (hashcode & 7)); 1425 ladrf[byte] |= (1 << (hashcode & 7));
1426 1426
1427#ifdef PCMCIA_DEBUG 1427#ifdef PCMCIA_DEBUG
1428 if (pc_debug > 2) { 1428 if (pc_debug > 2)
1429 printk(KERN_DEBUG " adr ="); 1429 printk(KERN_DEBUG " adr =%pM\n", adr);
1430 for (i = 0; i < 6; i++) 1430 printk(KERN_DEBUG " hashcode = %d(decimal), ladrf[0:63] =", hashcode);
1431 printk(" %02X", adr[i]); 1431 for (i = 0; i < 8; i++)
1432 printk("\n" KERN_DEBUG " hashcode = %d(decimal), ladrf[0:63]" 1432 printk(KERN_CONT " %02X", ladrf[i]);
1433 " =", hashcode); 1433 printk(KERN_CONT "\n");
1434 for (i = 0; i < 8; i++)
1435 printk(" %02X", ladrf[i]);
1436 printk("\n");
1437 } 1434 }
1438#endif 1435#endif
1439} /* BuildLAF */ 1436} /* BuildLAF */
diff --git a/drivers/net/pcnet32.c b/drivers/net/pcnet32.c
index 16964ec73e67..a646a445fda9 100644
--- a/drivers/net/pcnet32.c
+++ b/drivers/net/pcnet32.c
@@ -485,7 +485,7 @@ static void pcnet32_realloc_tx_ring(struct net_device *dev,
485 &new_ring_dma_addr); 485 &new_ring_dma_addr);
486 if (new_tx_ring == NULL) { 486 if (new_tx_ring == NULL) {
487 if (netif_msg_drv(lp)) 487 if (netif_msg_drv(lp))
488 printk("\n" KERN_ERR 488 printk(KERN_ERR
489 "%s: Consistent memory allocation failed.\n", 489 "%s: Consistent memory allocation failed.\n",
490 dev->name); 490 dev->name);
491 return; 491 return;
@@ -496,7 +496,7 @@ static void pcnet32_realloc_tx_ring(struct net_device *dev,
496 GFP_ATOMIC); 496 GFP_ATOMIC);
497 if (!new_dma_addr_list) { 497 if (!new_dma_addr_list) {
498 if (netif_msg_drv(lp)) 498 if (netif_msg_drv(lp))
499 printk("\n" KERN_ERR 499 printk(KERN_ERR
500 "%s: Memory allocation failed.\n", dev->name); 500 "%s: Memory allocation failed.\n", dev->name);
501 goto free_new_tx_ring; 501 goto free_new_tx_ring;
502 } 502 }
@@ -505,7 +505,7 @@ static void pcnet32_realloc_tx_ring(struct net_device *dev,
505 GFP_ATOMIC); 505 GFP_ATOMIC);
506 if (!new_skb_list) { 506 if (!new_skb_list) {
507 if (netif_msg_drv(lp)) 507 if (netif_msg_drv(lp))
508 printk("\n" KERN_ERR 508 printk(KERN_ERR
509 "%s: Memory allocation failed.\n", dev->name); 509 "%s: Memory allocation failed.\n", dev->name);
510 goto free_new_lists; 510 goto free_new_lists;
511 } 511 }
@@ -563,7 +563,7 @@ static void pcnet32_realloc_rx_ring(struct net_device *dev,
563 &new_ring_dma_addr); 563 &new_ring_dma_addr);
564 if (new_rx_ring == NULL) { 564 if (new_rx_ring == NULL) {
565 if (netif_msg_drv(lp)) 565 if (netif_msg_drv(lp))
566 printk("\n" KERN_ERR 566 printk(KERN_ERR
567 "%s: Consistent memory allocation failed.\n", 567 "%s: Consistent memory allocation failed.\n",
568 dev->name); 568 dev->name);
569 return; 569 return;
@@ -574,7 +574,7 @@ static void pcnet32_realloc_rx_ring(struct net_device *dev,
574 GFP_ATOMIC); 574 GFP_ATOMIC);
575 if (!new_dma_addr_list) { 575 if (!new_dma_addr_list) {
576 if (netif_msg_drv(lp)) 576 if (netif_msg_drv(lp))
577 printk("\n" KERN_ERR 577 printk(KERN_ERR
578 "%s: Memory allocation failed.\n", dev->name); 578 "%s: Memory allocation failed.\n", dev->name);
579 goto free_new_rx_ring; 579 goto free_new_rx_ring;
580 } 580 }
@@ -583,7 +583,7 @@ static void pcnet32_realloc_rx_ring(struct net_device *dev,
583 GFP_ATOMIC); 583 GFP_ATOMIC);
584 if (!new_skb_list) { 584 if (!new_skb_list) {
585 if (netif_msg_drv(lp)) 585 if (netif_msg_drv(lp))
586 printk("\n" KERN_ERR 586 printk(KERN_ERR
587 "%s: Memory allocation failed.\n", dev->name); 587 "%s: Memory allocation failed.\n", dev->name);
588 goto free_new_lists; 588 goto free_new_lists;
589 } 589 }
@@ -1771,38 +1771,38 @@ pcnet32_probe1(unsigned long ioaddr, int shared, struct pci_dev *pdev)
1771 /* Version 0x2623 and 0x2624 */ 1771 /* Version 0x2623 and 0x2624 */
1772 if (((chip_version + 1) & 0xfffe) == 0x2624) { 1772 if (((chip_version + 1) & 0xfffe) == 0x2624) {
1773 i = a->read_csr(ioaddr, 80) & 0x0C00; /* Check tx_start_pt */ 1773 i = a->read_csr(ioaddr, 80) & 0x0C00; /* Check tx_start_pt */
1774 printk("\n" KERN_INFO " tx_start_pt(0x%04x):", i); 1774 printk(KERN_INFO " tx_start_pt(0x%04x):", i);
1775 switch (i >> 10) { 1775 switch (i >> 10) {
1776 case 0: 1776 case 0:
1777 printk(" 20 bytes,"); 1777 printk(KERN_CONT " 20 bytes,");
1778 break; 1778 break;
1779 case 1: 1779 case 1:
1780 printk(" 64 bytes,"); 1780 printk(KERN_CONT " 64 bytes,");
1781 break; 1781 break;
1782 case 2: 1782 case 2:
1783 printk(" 128 bytes,"); 1783 printk(KERN_CONT " 128 bytes,");
1784 break; 1784 break;
1785 case 3: 1785 case 3:
1786 printk("~220 bytes,"); 1786 printk(KERN_CONT "~220 bytes,");
1787 break; 1787 break;
1788 } 1788 }
1789 i = a->read_bcr(ioaddr, 18); /* Check Burst/Bus control */ 1789 i = a->read_bcr(ioaddr, 18); /* Check Burst/Bus control */
1790 printk(" BCR18(%x):", i & 0xffff); 1790 printk(KERN_CONT " BCR18(%x):", i & 0xffff);
1791 if (i & (1 << 5)) 1791 if (i & (1 << 5))
1792 printk("BurstWrEn "); 1792 printk(KERN_CONT "BurstWrEn ");
1793 if (i & (1 << 6)) 1793 if (i & (1 << 6))
1794 printk("BurstRdEn "); 1794 printk(KERN_CONT "BurstRdEn ");
1795 if (i & (1 << 7)) 1795 if (i & (1 << 7))
1796 printk("DWordIO "); 1796 printk(KERN_CONT "DWordIO ");
1797 if (i & (1 << 11)) 1797 if (i & (1 << 11))
1798 printk("NoUFlow "); 1798 printk(KERN_CONT "NoUFlow ");
1799 i = a->read_bcr(ioaddr, 25); 1799 i = a->read_bcr(ioaddr, 25);
1800 printk("\n" KERN_INFO " SRAMSIZE=0x%04x,", i << 8); 1800 printk(KERN_INFO " SRAMSIZE=0x%04x,", i << 8);
1801 i = a->read_bcr(ioaddr, 26); 1801 i = a->read_bcr(ioaddr, 26);
1802 printk(" SRAM_BND=0x%04x,", i << 8); 1802 printk(KERN_CONT " SRAM_BND=0x%04x,", i << 8);
1803 i = a->read_bcr(ioaddr, 27); 1803 i = a->read_bcr(ioaddr, 27);
1804 if (i & (1 << 14)) 1804 if (i & (1 << 14))
1805 printk("LowLatRx"); 1805 printk(KERN_CONT "LowLatRx");
1806 } 1806 }
1807 } 1807 }
1808 1808
@@ -1993,7 +1993,7 @@ static int pcnet32_alloc_ring(struct net_device *dev, const char *name)
1993 &lp->tx_ring_dma_addr); 1993 &lp->tx_ring_dma_addr);
1994 if (lp->tx_ring == NULL) { 1994 if (lp->tx_ring == NULL) {
1995 if (netif_msg_drv(lp)) 1995 if (netif_msg_drv(lp))
1996 printk("\n" KERN_ERR PFX 1996 printk(KERN_ERR PFX
1997 "%s: Consistent memory allocation failed.\n", 1997 "%s: Consistent memory allocation failed.\n",
1998 name); 1998 name);
1999 return -ENOMEM; 1999 return -ENOMEM;
@@ -2005,7 +2005,7 @@ static int pcnet32_alloc_ring(struct net_device *dev, const char *name)
2005 &lp->rx_ring_dma_addr); 2005 &lp->rx_ring_dma_addr);
2006 if (lp->rx_ring == NULL) { 2006 if (lp->rx_ring == NULL) {
2007 if (netif_msg_drv(lp)) 2007 if (netif_msg_drv(lp))
2008 printk("\n" KERN_ERR PFX 2008 printk(KERN_ERR PFX
2009 "%s: Consistent memory allocation failed.\n", 2009 "%s: Consistent memory allocation failed.\n",
2010 name); 2010 name);
2011 return -ENOMEM; 2011 return -ENOMEM;
@@ -2015,7 +2015,7 @@ static int pcnet32_alloc_ring(struct net_device *dev, const char *name)
2015 GFP_ATOMIC); 2015 GFP_ATOMIC);
2016 if (!lp->tx_dma_addr) { 2016 if (!lp->tx_dma_addr) {
2017 if (netif_msg_drv(lp)) 2017 if (netif_msg_drv(lp))
2018 printk("\n" KERN_ERR PFX 2018 printk(KERN_ERR PFX
2019 "%s: Memory allocation failed.\n", name); 2019 "%s: Memory allocation failed.\n", name);
2020 return -ENOMEM; 2020 return -ENOMEM;
2021 } 2021 }
@@ -2024,7 +2024,7 @@ static int pcnet32_alloc_ring(struct net_device *dev, const char *name)
2024 GFP_ATOMIC); 2024 GFP_ATOMIC);
2025 if (!lp->rx_dma_addr) { 2025 if (!lp->rx_dma_addr) {
2026 if (netif_msg_drv(lp)) 2026 if (netif_msg_drv(lp))
2027 printk("\n" KERN_ERR PFX 2027 printk(KERN_ERR PFX
2028 "%s: Memory allocation failed.\n", name); 2028 "%s: Memory allocation failed.\n", name);
2029 return -ENOMEM; 2029 return -ENOMEM;
2030 } 2030 }
@@ -2033,7 +2033,7 @@ static int pcnet32_alloc_ring(struct net_device *dev, const char *name)
2033 GFP_ATOMIC); 2033 GFP_ATOMIC);
2034 if (!lp->tx_skbuff) { 2034 if (!lp->tx_skbuff) {
2035 if (netif_msg_drv(lp)) 2035 if (netif_msg_drv(lp))
2036 printk("\n" KERN_ERR PFX 2036 printk(KERN_ERR PFX
2037 "%s: Memory allocation failed.\n", name); 2037 "%s: Memory allocation failed.\n", name);
2038 return -ENOMEM; 2038 return -ENOMEM;
2039 } 2039 }
@@ -2042,7 +2042,7 @@ static int pcnet32_alloc_ring(struct net_device *dev, const char *name)
2042 GFP_ATOMIC); 2042 GFP_ATOMIC);
2043 if (!lp->rx_skbuff) { 2043 if (!lp->rx_skbuff) {
2044 if (netif_msg_drv(lp)) 2044 if (netif_msg_drv(lp))
2045 printk("\n" KERN_ERR PFX 2045 printk(KERN_ERR PFX
2046 "%s: Memory allocation failed.\n", name); 2046 "%s: Memory allocation failed.\n", name);
2047 return -ENOMEM; 2047 return -ENOMEM;
2048 } 2048 }
diff --git a/drivers/net/ppp_async.c b/drivers/net/ppp_async.c
index 17c116bb332c..6de8399d6dd9 100644
--- a/drivers/net/ppp_async.c
+++ b/drivers/net/ppp_async.c
@@ -356,6 +356,7 @@ ppp_asynctty_receive(struct tty_struct *tty, const unsigned char *buf,
356 if (!skb_queue_empty(&ap->rqueue)) 356 if (!skb_queue_empty(&ap->rqueue))
357 tasklet_schedule(&ap->tsk); 357 tasklet_schedule(&ap->tsk);
358 ap_put(ap); 358 ap_put(ap);
359 tty_unthrottle(tty);
359} 360}
360 361
361static void 362static void
diff --git a/drivers/net/ppp_synctty.c b/drivers/net/ppp_synctty.c
index aa3d39f38e22..d2fa2db13586 100644
--- a/drivers/net/ppp_synctty.c
+++ b/drivers/net/ppp_synctty.c
@@ -397,6 +397,7 @@ ppp_sync_receive(struct tty_struct *tty, const unsigned char *buf,
397 if (!skb_queue_empty(&ap->rqueue)) 397 if (!skb_queue_empty(&ap->rqueue))
398 tasklet_schedule(&ap->tsk); 398 tasklet_schedule(&ap->tsk);
399 sp_put(ap); 399 sp_put(ap);
400 tty_unthrottle(tty);
400} 401}
401 402
402static void 403static void
diff --git a/drivers/net/starfire.c b/drivers/net/starfire.c
index 838cce8b8fff..669253c7bd41 100644
--- a/drivers/net/starfire.c
+++ b/drivers/net/starfire.c
@@ -180,7 +180,7 @@ static int full_duplex[MAX_UNITS] = {0, };
180/* These identify the driver base version and may not be removed. */ 180/* These identify the driver base version and may not be removed. */
181static const char version[] __devinitconst = 181static const char version[] __devinitconst =
182KERN_INFO "starfire.c:v1.03 7/26/2000 Written by Donald Becker <becker@scyld.com>\n" 182KERN_INFO "starfire.c:v1.03 7/26/2000 Written by Donald Becker <becker@scyld.com>\n"
183KERN_INFO " (unofficial 2.2/2.4 kernel port, version " DRV_VERSION ", " DRV_RELDATE ")\n"; 183" (unofficial 2.2/2.4 kernel port, version " DRV_VERSION ", " DRV_RELDATE ")\n";
184 184
185MODULE_AUTHOR("Donald Becker <becker@scyld.com>"); 185MODULE_AUTHOR("Donald Becker <becker@scyld.com>");
186MODULE_DESCRIPTION("Adaptec Starfire Ethernet driver"); 186MODULE_DESCRIPTION("Adaptec Starfire Ethernet driver");
diff --git a/drivers/net/sundance.c b/drivers/net/sundance.c
index 545f81b34ad7..d1521c3875b2 100644
--- a/drivers/net/sundance.c
+++ b/drivers/net/sundance.c
@@ -1698,13 +1698,13 @@ static int netdev_close(struct net_device *dev)
1698 1698
1699#ifdef __i386__ 1699#ifdef __i386__
1700 if (netif_msg_hw(np)) { 1700 if (netif_msg_hw(np)) {
1701 printk("\n"KERN_DEBUG" Tx ring at %8.8x:\n", 1701 printk(KERN_DEBUG " Tx ring at %8.8x:\n",
1702 (int)(np->tx_ring_dma)); 1702 (int)(np->tx_ring_dma));
1703 for (i = 0; i < TX_RING_SIZE; i++) 1703 for (i = 0; i < TX_RING_SIZE; i++)
1704 printk(" #%d desc. %4.4x %8.8x %8.8x.\n", 1704 printk(KERN_DEBUG " #%d desc. %4.4x %8.8x %8.8x.\n",
1705 i, np->tx_ring[i].status, np->tx_ring[i].frag[0].addr, 1705 i, np->tx_ring[i].status, np->tx_ring[i].frag[0].addr,
1706 np->tx_ring[i].frag[0].length); 1706 np->tx_ring[i].frag[0].length);
1707 printk("\n"KERN_DEBUG " Rx ring %8.8x:\n", 1707 printk(KERN_DEBUG " Rx ring %8.8x:\n",
1708 (int)(np->rx_ring_dma)); 1708 (int)(np->rx_ring_dma));
1709 for (i = 0; i < /*RX_RING_SIZE*/4 ; i++) { 1709 for (i = 0; i < /*RX_RING_SIZE*/4 ; i++) {
1710 printk(KERN_DEBUG " #%d desc. %4.4x %4.4x %8.8x\n", 1710 printk(KERN_DEBUG " #%d desc. %4.4x %4.4x %8.8x\n",
diff --git a/drivers/net/tsi108_eth.c b/drivers/net/tsi108_eth.c
index 0f78f99f9b20..7030bd5e9848 100644
--- a/drivers/net/tsi108_eth.c
+++ b/drivers/net/tsi108_eth.c
@@ -1132,7 +1132,9 @@ static int tsi108_get_mac(struct net_device *dev)
1132 } 1132 }
1133 1133
1134 if (!is_valid_ether_addr(dev->dev_addr)) { 1134 if (!is_valid_ether_addr(dev->dev_addr)) {
1135 printk("KERN_ERR: word1: %08x, word2: %08x\n", word1, word2); 1135 printk(KERN_ERR
1136 "%s: Invalid MAC address. word1: %08x, word2: %08x\n",
1137 dev->name, word1, word2);
1136 return -EINVAL; 1138 return -EINVAL;
1137 } 1139 }
1138 1140
@@ -1201,8 +1203,8 @@ static void tsi108_set_rx_mode(struct net_device *dev)
1201 __set_bit(hash, &data->mc_hash[0]); 1203 __set_bit(hash, &data->mc_hash[0]);
1202 } else { 1204 } else {
1203 printk(KERN_ERR 1205 printk(KERN_ERR
1204 "%s: got multicast address of length %d " 1206 "%s: got multicast address of length %d instead of 6.\n",
1205 "instead of 6.\n", dev->name, 1207 dev->name,
1206 mc->dmi_addrlen); 1208 mc->dmi_addrlen);
1207 } 1209 }
1208 1210
diff --git a/drivers/net/tulip/de2104x.c b/drivers/net/tulip/de2104x.c
index 81f054dbb88d..ef49744a5085 100644
--- a/drivers/net/tulip/de2104x.c
+++ b/drivers/net/tulip/de2104x.c
@@ -944,9 +944,10 @@ static void de_set_media (struct de_private *de)
944 macmode &= ~FullDuplex; 944 macmode &= ~FullDuplex;
945 945
946 if (netif_msg_link(de)) { 946 if (netif_msg_link(de)) {
947 printk(KERN_INFO "%s: set link %s\n" 947 printk(KERN_INFO
948 KERN_INFO "%s: mode 0x%x, sia 0x%x,0x%x,0x%x,0x%x\n" 948 "%s: set link %s\n"
949 KERN_INFO "%s: set mode 0x%x, set sia 0x%x,0x%x,0x%x\n", 949 "%s: mode 0x%x, sia 0x%x,0x%x,0x%x,0x%x\n"
950 "%s: set mode 0x%x, set sia 0x%x,0x%x,0x%x\n",
950 de->dev->name, media_name[media], 951 de->dev->name, media_name[media],
951 de->dev->name, dr32(MacMode), dr32(SIAStatus), 952 de->dev->name, dr32(MacMode), dr32(SIAStatus),
952 dr32(CSR13), dr32(CSR14), dr32(CSR15), 953 dr32(CSR13), dr32(CSR14), dr32(CSR15),
diff --git a/drivers/net/tulip/tulip_core.c b/drivers/net/tulip/tulip_core.c
index 2abb5d3becc6..99a63649f4fc 100644
--- a/drivers/net/tulip/tulip_core.c
+++ b/drivers/net/tulip/tulip_core.c
@@ -570,16 +570,18 @@ static void tulip_tx_timeout(struct net_device *dev)
570 (unsigned int)tp->rx_ring[i].buffer2, 570 (unsigned int)tp->rx_ring[i].buffer2,
571 buf[0], buf[1], buf[2]); 571 buf[0], buf[1], buf[2]);
572 for (j = 0; buf[j] != 0xee && j < 1600; j++) 572 for (j = 0; buf[j] != 0xee && j < 1600; j++)
573 if (j < 100) printk(" %2.2x", buf[j]); 573 if (j < 100)
574 printk(" j=%d.\n", j); 574 printk(KERN_CONT " %2.2x", buf[j]);
575 printk(KERN_CONT " j=%d.\n", j);
575 } 576 }
576 printk(KERN_DEBUG " Rx ring %8.8x: ", (int)tp->rx_ring); 577 printk(KERN_DEBUG " Rx ring %8.8x: ", (int)tp->rx_ring);
577 for (i = 0; i < RX_RING_SIZE; i++) 578 for (i = 0; i < RX_RING_SIZE; i++)
578 printk(" %8.8x", (unsigned int)tp->rx_ring[i].status); 579 printk(KERN_CONT " %8.8x",
579 printk("\n" KERN_DEBUG " Tx ring %8.8x: ", (int)tp->tx_ring); 580 (unsigned int)tp->rx_ring[i].status);
581 printk(KERN_DEBUG " Tx ring %8.8x: ", (int)tp->tx_ring);
580 for (i = 0; i < TX_RING_SIZE; i++) 582 for (i = 0; i < TX_RING_SIZE; i++)
581 printk(" %8.8x", (unsigned int)tp->tx_ring[i].status); 583 printk(KERN_CONT " %8.8x", (unsigned int)tp->tx_ring[i].status);
582 printk("\n"); 584 printk(KERN_CONT "\n");
583 } 585 }
584#endif 586#endif
585 587
diff --git a/drivers/net/tulip/winbond-840.c b/drivers/net/tulip/winbond-840.c
index 842b1a2c40d4..0f15773dae52 100644
--- a/drivers/net/tulip/winbond-840.c
+++ b/drivers/net/tulip/winbond-840.c
@@ -142,7 +142,7 @@ static int full_duplex[MAX_UNITS] = {-1, -1, -1, -1, -1, -1, -1, -1};
142static const char version[] __initconst = 142static const char version[] __initconst =
143 KERN_INFO DRV_NAME ".c:v" DRV_VERSION " (2.4 port) " 143 KERN_INFO DRV_NAME ".c:v" DRV_VERSION " (2.4 port) "
144 DRV_RELDATE " Donald Becker <becker@scyld.com>\n" 144 DRV_RELDATE " Donald Becker <becker@scyld.com>\n"
145 KERN_INFO " http://www.scyld.com/network/drivers.html\n"; 145 " http://www.scyld.com/network/drivers.html\n";
146 146
147MODULE_AUTHOR("Donald Becker <becker@scyld.com>"); 147MODULE_AUTHOR("Donald Becker <becker@scyld.com>");
148MODULE_DESCRIPTION("Winbond W89c840 Ethernet driver"); 148MODULE_DESCRIPTION("Winbond W89c840 Ethernet driver");
@@ -939,7 +939,7 @@ static void tx_timeout(struct net_device *dev)
939 printk(KERN_DEBUG " Rx ring %p: ", np->rx_ring); 939 printk(KERN_DEBUG " Rx ring %p: ", np->rx_ring);
940 for (i = 0; i < RX_RING_SIZE; i++) 940 for (i = 0; i < RX_RING_SIZE; i++)
941 printk(" %8.8x", (unsigned int)np->rx_ring[i].status); 941 printk(" %8.8x", (unsigned int)np->rx_ring[i].status);
942 printk("\n"KERN_DEBUG" Tx ring %p: ", np->tx_ring); 942 printk(KERN_DEBUG" Tx ring %p: ", np->tx_ring);
943 for (i = 0; i < TX_RING_SIZE; i++) 943 for (i = 0; i < TX_RING_SIZE; i++)
944 printk(" %8.8x", np->tx_ring[i].status); 944 printk(" %8.8x", np->tx_ring[i].status);
945 printk("\n"); 945 printk("\n");
@@ -1520,7 +1520,7 @@ static int netdev_close(struct net_device *dev)
1520 printk(KERN_DEBUG " #%d desc. %4.4x %4.4x %8.8x.\n", 1520 printk(KERN_DEBUG " #%d desc. %4.4x %4.4x %8.8x.\n",
1521 i, np->tx_ring[i].length, 1521 i, np->tx_ring[i].length,
1522 np->tx_ring[i].status, np->tx_ring[i].buffer1); 1522 np->tx_ring[i].status, np->tx_ring[i].buffer1);
1523 printk("\n"KERN_DEBUG " Rx ring %8.8x:\n", 1523 printk(KERN_DEBUG " Rx ring %8.8x:\n",
1524 (int)np->rx_ring); 1524 (int)np->rx_ring);
1525 for (i = 0; i < RX_RING_SIZE; i++) { 1525 for (i = 0; i < RX_RING_SIZE; i++) {
1526 printk(KERN_DEBUG " #%d desc. %4.4x %4.4x %8.8x\n", 1526 printk(KERN_DEBUG " #%d desc. %4.4x %4.4x %8.8x\n",
diff --git a/drivers/net/wan/hd64570.c b/drivers/net/wan/hd64570.c
index 223238de475c..1ea1ef6c3b96 100644
--- a/drivers/net/wan/hd64570.c
+++ b/drivers/net/wan/hd64570.c
@@ -584,8 +584,9 @@ static void sca_dump_rings(struct net_device *dev)
584 sca_in(DSR_RX(phy_node(port)), card) & DSR_DE ? "" : "in"); 584 sca_in(DSR_RX(phy_node(port)), card) & DSR_DE ? "" : "in");
585 for (cnt = 0; cnt < port_to_card(port)->rx_ring_buffers; cnt++) 585 for (cnt = 0; cnt < port_to_card(port)->rx_ring_buffers; cnt++)
586 printk(" %02X", readb(&(desc_address(port, cnt, 0)->stat))); 586 printk(" %02X", readb(&(desc_address(port, cnt, 0)->stat)));
587 printk(KERN_CONT "\n");
587 588
588 printk("\n" KERN_DEBUG "TX ring: CDA=%u EDA=%u DSR=%02X in=%u " 589 printk(KERN_DEBUG "TX ring: CDA=%u EDA=%u DSR=%02X in=%u "
589 "last=%u %sactive", 590 "last=%u %sactive",
590 sca_inw(get_dmac_tx(port) + CDAL, card), 591 sca_inw(get_dmac_tx(port) + CDAL, card),
591 sca_inw(get_dmac_tx(port) + EDAL, card), 592 sca_inw(get_dmac_tx(port) + EDAL, card),
diff --git a/drivers/net/wan/hd64572.c b/drivers/net/wan/hd64572.c
index 497b003d7239..f099c34a3ae2 100644
--- a/drivers/net/wan/hd64572.c
+++ b/drivers/net/wan/hd64572.c
@@ -529,8 +529,9 @@ static void sca_dump_rings(struct net_device *dev)
529 sca_in(DSR_RX(port->chan), card) & DSR_DE ? "" : "in"); 529 sca_in(DSR_RX(port->chan), card) & DSR_DE ? "" : "in");
530 for (cnt = 0; cnt < port->card->rx_ring_buffers; cnt++) 530 for (cnt = 0; cnt < port->card->rx_ring_buffers; cnt++)
531 printk(" %02X", readb(&(desc_address(port, cnt, 0)->stat))); 531 printk(" %02X", readb(&(desc_address(port, cnt, 0)->stat)));
532 printk(KERN_CONT "\n");
532 533
533 printk("\n" KERN_DEBUG "TX ring: CDA=%u EDA=%u DSR=%02X in=%u " 534 printk(KERN_DEBUG "TX ring: CDA=%u EDA=%u DSR=%02X in=%u "
534 "last=%u %sactive", 535 "last=%u %sactive",
535 sca_inl(get_dmac_tx(port) + CDAL, card), 536 sca_inl(get_dmac_tx(port) + CDAL, card),
536 sca_inl(get_dmac_tx(port) + EDAL, card), 537 sca_inl(get_dmac_tx(port) + EDAL, card),
diff --git a/drivers/net/wan/sbni.c b/drivers/net/wan/sbni.c
index 3fb9dbc88a1a..d14e95a08d66 100644
--- a/drivers/net/wan/sbni.c
+++ b/drivers/net/wan/sbni.c
@@ -326,11 +326,9 @@ sbni_pci_probe( struct net_device *dev )
326 } 326 }
327 327
328 if (pci_irq_line <= 0 || pci_irq_line >= nr_irqs) 328 if (pci_irq_line <= 0 || pci_irq_line >= nr_irqs)
329 printk( KERN_WARNING " WARNING: The PCI BIOS assigned " 329 printk( KERN_WARNING
330 "this PCI card to IRQ %d, which is unlikely " 330 " WARNING: The PCI BIOS assigned this PCI card to IRQ %d, which is unlikely to work!.\n"
331 "to work!.\n" 331 " You should use the PCI BIOS setup to assign a valid IRQ line.\n",
332 KERN_WARNING " You should use the PCI BIOS "
333 "setup to assign a valid IRQ line.\n",
334 pci_irq_line ); 332 pci_irq_line );
335 333
336 /* avoiding re-enable dual adapters */ 334 /* avoiding re-enable dual adapters */
diff --git a/drivers/net/wireless/ray_cs.c b/drivers/net/wireless/ray_cs.c
index b10b0383dfa5..698b11b1cadb 100644
--- a/drivers/net/wireless/ray_cs.c
+++ b/drivers/net/wireless/ray_cs.c
@@ -2427,11 +2427,10 @@ static void untranslate(ray_dev_t *local, struct sk_buff *skb, int len)
2427 2427
2428#ifdef PCMCIA_DEBUG 2428#ifdef PCMCIA_DEBUG
2429 if (pc_debug > 3) { 2429 if (pc_debug > 3) {
2430 int i; 2430 print_hex_dump(KERN_DEBUG, "skb->data before untranslate: ",
2431 printk(KERN_DEBUG "skb->data before untranslate"); 2431 DUMP_PREFIX_NONE, 16, 1,
2432 for (i = 0; i < 64; i++) 2432 skb->data, 64, true);
2433 printk("%02x ", skb->data[i]); 2433 printk(KERN_DEBUG
2434 printk("\n" KERN_DEBUG
2435 "type = %08x, xsap = %02x%02x%02x, org = %02x02x02x\n", 2434 "type = %08x, xsap = %02x%02x%02x, org = %02x02x02x\n",
2436 ntohs(type), psnap->dsap, psnap->ssap, psnap->ctrl, 2435 ntohs(type), psnap->dsap, psnap->ssap, psnap->ctrl,
2437 psnap->org[0], psnap->org[1], psnap->org[2]); 2436 psnap->org[0], psnap->org[1], psnap->org[2]);
diff --git a/drivers/net/wireless/wavelan_cs.c b/drivers/net/wireless/wavelan_cs.c
index 6af706408ac0..c6d300666ad8 100644
--- a/drivers/net/wireless/wavelan_cs.c
+++ b/drivers/net/wireless/wavelan_cs.c
@@ -3556,17 +3556,8 @@ wv_82593_config(struct net_device * dev)
3556 cfblk.rcvstop = TRUE; /* Enable Receive Stop Register */ 3556 cfblk.rcvstop = TRUE; /* Enable Receive Stop Register */
3557 3557
3558#ifdef DEBUG_I82593_SHOW 3558#ifdef DEBUG_I82593_SHOW
3559 { 3559 print_hex_dump(KERN_DEBUG, "wavelan_cs: config block: ", DUMP_PREFIX_NONE,
3560 u_char *c = (u_char *) &cfblk; 3560 16, 1, &cfblk, sizeof(struct i82593_conf_block), false);
3561 int i;
3562 printk(KERN_DEBUG "wavelan_cs: config block:");
3563 for(i = 0; i < sizeof(struct i82593_conf_block); i++,c++)
3564 {
3565 if((i % 16) == 0) printk("\n" KERN_DEBUG);
3566 printk("%02x ", *c);
3567 }
3568 printk("\n");
3569 }
3570#endif 3561#endif
3571 3562
3572 /* Copy the config block to the i82593 */ 3563 /* Copy the config block to the i82593 */
diff --git a/drivers/net/yellowfin.c b/drivers/net/yellowfin.c
index 3c7a5053f1da..a07580138e81 100644
--- a/drivers/net/yellowfin.c
+++ b/drivers/net/yellowfin.c
@@ -109,7 +109,7 @@ static int gx_fix;
109/* These identify the driver base version and may not be removed. */ 109/* These identify the driver base version and may not be removed. */
110static const char version[] __devinitconst = 110static const char version[] __devinitconst =
111 KERN_INFO DRV_NAME ".c:v1.05 1/09/2001 Written by Donald Becker <becker@scyld.com>\n" 111 KERN_INFO DRV_NAME ".c:v1.05 1/09/2001 Written by Donald Becker <becker@scyld.com>\n"
112 KERN_INFO " (unofficial 2.4.x port, " DRV_VERSION ", " DRV_RELDATE ")\n"; 112 " (unofficial 2.4.x port, " DRV_VERSION ", " DRV_RELDATE ")\n";
113 113
114MODULE_AUTHOR("Donald Becker <becker@scyld.com>"); 114MODULE_AUTHOR("Donald Becker <becker@scyld.com>");
115MODULE_DESCRIPTION("Packet Engines Yellowfin G-NIC Gigabit Ethernet driver"); 115MODULE_DESCRIPTION("Packet Engines Yellowfin G-NIC Gigabit Ethernet driver");
@@ -700,12 +700,15 @@ static void yellowfin_tx_timeout(struct net_device *dev)
700 int i; 700 int i;
701 printk(KERN_WARNING " Rx ring %p: ", yp->rx_ring); 701 printk(KERN_WARNING " Rx ring %p: ", yp->rx_ring);
702 for (i = 0; i < RX_RING_SIZE; i++) 702 for (i = 0; i < RX_RING_SIZE; i++)
703 printk(" %8.8x", yp->rx_ring[i].result_status); 703 printk(KERN_CONT " %8.8x",
704 printk("\n"KERN_WARNING" Tx ring %p: ", yp->tx_ring); 704 yp->rx_ring[i].result_status);
705 printk(KERN_CONT "\n");
706 printk(KERN_WARNING" Tx ring %p: ", yp->tx_ring);
705 for (i = 0; i < TX_RING_SIZE; i++) 707 for (i = 0; i < TX_RING_SIZE; i++)
706 printk(" %4.4x /%8.8x", yp->tx_status[i].tx_errs, 708 printk(KERN_CONT " %4.4x /%8.8x",
707 yp->tx_ring[i].result_status); 709 yp->tx_status[i].tx_errs,
708 printk("\n"); 710 yp->tx_ring[i].result_status);
711 printk(KERN_CONT "\n");
709 } 712 }
710 713
711 /* If the hardware is found to hang regularly, we will update the code 714 /* If the hardware is found to hang regularly, we will update the code
@@ -1216,20 +1219,20 @@ static int yellowfin_close(struct net_device *dev)
1216 1219
1217#if defined(__i386__) 1220#if defined(__i386__)
1218 if (yellowfin_debug > 2) { 1221 if (yellowfin_debug > 2) {
1219 printk("\n"KERN_DEBUG" Tx ring at %8.8llx:\n", 1222 printk(KERN_DEBUG" Tx ring at %8.8llx:\n",
1220 (unsigned long long)yp->tx_ring_dma); 1223 (unsigned long long)yp->tx_ring_dma);
1221 for (i = 0; i < TX_RING_SIZE*2; i++) 1224 for (i = 0; i < TX_RING_SIZE*2; i++)
1222 printk(" %c #%d desc. %8.8x %8.8x %8.8x %8.8x.\n", 1225 printk(KERN_DEBUG " %c #%d desc. %8.8x %8.8x %8.8x %8.8x.\n",
1223 ioread32(ioaddr + TxPtr) == (long)&yp->tx_ring[i] ? '>' : ' ', 1226 ioread32(ioaddr + TxPtr) == (long)&yp->tx_ring[i] ? '>' : ' ',
1224 i, yp->tx_ring[i].dbdma_cmd, yp->tx_ring[i].addr, 1227 i, yp->tx_ring[i].dbdma_cmd, yp->tx_ring[i].addr,
1225 yp->tx_ring[i].branch_addr, yp->tx_ring[i].result_status); 1228 yp->tx_ring[i].branch_addr, yp->tx_ring[i].result_status);
1226 printk(KERN_DEBUG " Tx status %p:\n", yp->tx_status); 1229 printk(KERN_DEBUG " Tx status %p:\n", yp->tx_status);
1227 for (i = 0; i < TX_RING_SIZE; i++) 1230 for (i = 0; i < TX_RING_SIZE; i++)
1228 printk(" #%d status %4.4x %4.4x %4.4x %4.4x.\n", 1231 printk(KERN_DEBUG " #%d status %4.4x %4.4x %4.4x %4.4x.\n",
1229 i, yp->tx_status[i].tx_cnt, yp->tx_status[i].tx_errs, 1232 i, yp->tx_status[i].tx_cnt, yp->tx_status[i].tx_errs,
1230 yp->tx_status[i].total_tx_cnt, yp->tx_status[i].paused); 1233 yp->tx_status[i].total_tx_cnt, yp->tx_status[i].paused);
1231 1234
1232 printk("\n"KERN_DEBUG " Rx ring %8.8llx:\n", 1235 printk(KERN_DEBUG " Rx ring %8.8llx:\n",
1233 (unsigned long long)yp->rx_ring_dma); 1236 (unsigned long long)yp->rx_ring_dma);
1234 for (i = 0; i < RX_RING_SIZE; i++) { 1237 for (i = 0; i < RX_RING_SIZE; i++) {
1235 printk(KERN_DEBUG " %c #%d desc. %8.8x %8.8x %8.8x\n", 1238 printk(KERN_DEBUG " %c #%d desc. %8.8x %8.8x %8.8x\n",
diff --git a/drivers/oprofile/oprofile_stats.c b/drivers/oprofile/oprofile_stats.c
index e1f6ce03705e..3c2270a8300c 100644
--- a/drivers/oprofile/oprofile_stats.c
+++ b/drivers/oprofile/oprofile_stats.c
@@ -33,6 +33,7 @@ void oprofile_reset_stats(void)
33 atomic_set(&oprofile_stats.sample_lost_no_mm, 0); 33 atomic_set(&oprofile_stats.sample_lost_no_mm, 0);
34 atomic_set(&oprofile_stats.sample_lost_no_mapping, 0); 34 atomic_set(&oprofile_stats.sample_lost_no_mapping, 0);
35 atomic_set(&oprofile_stats.event_lost_overflow, 0); 35 atomic_set(&oprofile_stats.event_lost_overflow, 0);
36 atomic_set(&oprofile_stats.bt_lost_no_mapping, 0);
36} 37}
37 38
38 39
diff --git a/drivers/parisc/ccio-dma.c b/drivers/parisc/ccio-dma.c
index 5d610cbcfe80..a45b0c0d574e 100644
--- a/drivers/parisc/ccio-dma.c
+++ b/drivers/parisc/ccio-dma.c
@@ -70,7 +70,6 @@
70#undef CCIO_COLLECT_STATS 70#undef CCIO_COLLECT_STATS
71#endif 71#endif
72 72
73#include <linux/proc_fs.h>
74#include <asm/runway.h> /* for proc_runway_root */ 73#include <asm/runway.h> /* for proc_runway_root */
75 74
76#ifdef DEBUG_CCIO_INIT 75#ifdef DEBUG_CCIO_INIT
@@ -1134,7 +1133,7 @@ static const struct file_operations ccio_proc_bitmap_fops = {
1134 .llseek = seq_lseek, 1133 .llseek = seq_lseek,
1135 .release = single_release, 1134 .release = single_release,
1136}; 1135};
1137#endif 1136#endif /* CONFIG_PROC_FS */
1138 1137
1139/** 1138/**
1140 * ccio_find_ioc - Find the ioc in the ioc_list 1139 * ccio_find_ioc - Find the ioc in the ioc_list
@@ -1568,14 +1567,15 @@ static int __init ccio_probe(struct parisc_device *dev)
1568 /* if this fails, no I/O cards will work, so may as well bug */ 1567 /* if this fails, no I/O cards will work, so may as well bug */
1569 BUG_ON(dev->dev.platform_data == NULL); 1568 BUG_ON(dev->dev.platform_data == NULL);
1570 HBA_DATA(dev->dev.platform_data)->iommu = ioc; 1569 HBA_DATA(dev->dev.platform_data)->iommu = ioc;
1571 1570
1571#ifdef CONFIG_PROC_FS
1572 if (ioc_count == 0) { 1572 if (ioc_count == 0) {
1573 proc_create(MODULE_NAME, 0, proc_runway_root, 1573 proc_create(MODULE_NAME, 0, proc_runway_root,
1574 &ccio_proc_info_fops); 1574 &ccio_proc_info_fops);
1575 proc_create(MODULE_NAME"-bitmap", 0, proc_runway_root, 1575 proc_create(MODULE_NAME"-bitmap", 0, proc_runway_root,
1576 &ccio_proc_bitmap_fops); 1576 &ccio_proc_bitmap_fops);
1577 } 1577 }
1578 1578#endif
1579 ioc_count++; 1579 ioc_count++;
1580 1580
1581 parisc_has_iommu(); 1581 parisc_has_iommu();
diff --git a/drivers/parisc/dino.c b/drivers/parisc/dino.c
index 52ae0b1d470c..d69bde6a2343 100644
--- a/drivers/parisc/dino.c
+++ b/drivers/parisc/dino.c
@@ -353,7 +353,7 @@ static unsigned int dino_startup_irq(unsigned int irq)
353 return 0; 353 return 0;
354} 354}
355 355
356static struct hw_interrupt_type dino_interrupt_type = { 356static struct irq_chip dino_interrupt_type = {
357 .typename = "GSC-PCI", 357 .typename = "GSC-PCI",
358 .startup = dino_startup_irq, 358 .startup = dino_startup_irq,
359 .shutdown = dino_disable_irq, 359 .shutdown = dino_disable_irq,
@@ -614,7 +614,7 @@ dino_fixup_bus(struct pci_bus *bus)
614 dev_name(&bus->self->dev), i, 614 dev_name(&bus->self->dev), i,
615 bus->self->resource[i].start, 615 bus->self->resource[i].start,
616 bus->self->resource[i].end); 616 bus->self->resource[i].end);
617 pci_assign_resource(bus->self, i); 617 WARN_ON(pci_assign_resource(bus->self, i));
618 DBG("DEBUG %s after assign %d [0x%lx,0x%lx]\n", 618 DBG("DEBUG %s after assign %d [0x%lx,0x%lx]\n",
619 dev_name(&bus->self->dev), i, 619 dev_name(&bus->self->dev), i,
620 bus->self->resource[i].start, 620 bus->self->resource[i].start,
@@ -1019,22 +1019,22 @@ static int __init dino_probe(struct parisc_device *dev)
1019 ** It's not used to avoid chicken/egg problems 1019 ** It's not used to avoid chicken/egg problems
1020 ** with configuration accessor functions. 1020 ** with configuration accessor functions.
1021 */ 1021 */
1022 bus = pci_scan_bus_parented(&dev->dev, dino_current_bus, 1022 dino_dev->hba.hba_bus = bus = pci_scan_bus_parented(&dev->dev,
1023 &dino_cfg_ops, NULL); 1023 dino_current_bus, &dino_cfg_ops, NULL);
1024
1024 if(bus) { 1025 if(bus) {
1025 pci_bus_add_devices(bus);
1026 /* This code *depends* on scanning being single threaded 1026 /* This code *depends* on scanning being single threaded
1027 * if it isn't, this global bus number count will fail 1027 * if it isn't, this global bus number count will fail
1028 */ 1028 */
1029 dino_current_bus = bus->subordinate + 1; 1029 dino_current_bus = bus->subordinate + 1;
1030 pci_bus_assign_resources(bus); 1030 pci_bus_assign_resources(bus);
1031 pci_bus_add_devices(bus);
1031 } else { 1032 } else {
1032 printk(KERN_ERR "ERROR: failed to scan PCI bus on %s (probably duplicate bus number %d)\n", 1033 printk(KERN_ERR "ERROR: failed to scan PCI bus on %s (duplicate bus number %d?)\n",
1033 dev_name(&dev->dev), dino_current_bus); 1034 dev_name(&dev->dev), dino_current_bus);
1034 /* increment the bus number in case of duplicates */ 1035 /* increment the bus number in case of duplicates */
1035 dino_current_bus++; 1036 dino_current_bus++;
1036 } 1037 }
1037 dino_dev->hba.hba_bus = bus;
1038 return 0; 1038 return 0;
1039} 1039}
1040 1040
diff --git a/drivers/parisc/eisa.c b/drivers/parisc/eisa.c
index 5b89f404e668..51220749cb65 100644
--- a/drivers/parisc/eisa.c
+++ b/drivers/parisc/eisa.c
@@ -188,7 +188,7 @@ static unsigned int eisa_startup_irq(unsigned int irq)
188 return 0; 188 return 0;
189} 189}
190 190
191static struct hw_interrupt_type eisa_interrupt_type = { 191static struct irq_chip eisa_interrupt_type = {
192 .typename = "EISA", 192 .typename = "EISA",
193 .startup = eisa_startup_irq, 193 .startup = eisa_startup_irq,
194 .shutdown = eisa_disable_irq, 194 .shutdown = eisa_disable_irq,
diff --git a/drivers/parisc/eisa_eeprom.c b/drivers/parisc/eisa_eeprom.c
index 685d94e69d44..8c0b26e9b98a 100644
--- a/drivers/parisc/eisa_eeprom.c
+++ b/drivers/parisc/eisa_eeprom.c
@@ -55,7 +55,7 @@ static ssize_t eisa_eeprom_read(struct file * file,
55 ssize_t ret; 55 ssize_t ret;
56 int i; 56 int i;
57 57
58 if (*ppos >= HPEE_MAX_LENGTH) 58 if (*ppos < 0 || *ppos >= HPEE_MAX_LENGTH)
59 return 0; 59 return 0;
60 60
61 count = *ppos + count < HPEE_MAX_LENGTH ? count : HPEE_MAX_LENGTH - *ppos; 61 count = *ppos + count < HPEE_MAX_LENGTH ? count : HPEE_MAX_LENGTH - *ppos;
diff --git a/drivers/parisc/eisa_enumerator.c b/drivers/parisc/eisa_enumerator.c
index c709ecc2b7f7..0be1d50645ab 100644
--- a/drivers/parisc/eisa_enumerator.c
+++ b/drivers/parisc/eisa_enumerator.c
@@ -101,7 +101,7 @@ static int configure_memory(const unsigned char *buf,
101 printk("memory %lx-%lx ", (unsigned long)res->start, (unsigned long)res->end); 101 printk("memory %lx-%lx ", (unsigned long)res->start, (unsigned long)res->end);
102 result = request_resource(mem_parent, res); 102 result = request_resource(mem_parent, res);
103 if (result < 0) { 103 if (result < 0) {
104 printk("\n" KERN_ERR "EISA Enumerator: failed to claim EISA Bus address space!\n"); 104 printk(KERN_ERR "EISA Enumerator: failed to claim EISA Bus address space!\n");
105 return result; 105 return result;
106 } 106 }
107 } 107 }
@@ -191,7 +191,7 @@ static int configure_port(const unsigned char *buf, struct resource *io_parent,
191 printk("ioports %lx-%lx ", (unsigned long)res->start, (unsigned long)res->end); 191 printk("ioports %lx-%lx ", (unsigned long)res->start, (unsigned long)res->end);
192 result = request_resource(io_parent, res); 192 result = request_resource(io_parent, res);
193 if (result < 0) { 193 if (result < 0) {
194 printk("\n" KERN_ERR "EISA Enumerator: failed to claim EISA Bus address space!\n"); 194 printk(KERN_ERR "EISA Enumerator: failed to claim EISA Bus address space!\n");
195 return result; 195 return result;
196 } 196 }
197 } 197 }
@@ -224,7 +224,7 @@ static int configure_port_init(const unsigned char *buf)
224 case HPEE_PORT_INIT_WIDTH_BYTE: 224 case HPEE_PORT_INIT_WIDTH_BYTE:
225 s=1; 225 s=1;
226 if (c & HPEE_PORT_INIT_MASK) { 226 if (c & HPEE_PORT_INIT_MASK) {
227 printk("\n" KERN_WARNING "port_init: unverified mask attribute\n"); 227 printk(KERN_WARNING "port_init: unverified mask attribute\n");
228 outb((inb(get_16(buf+len+1) & 228 outb((inb(get_16(buf+len+1) &
229 get_8(buf+len+3)) | 229 get_8(buf+len+3)) |
230 get_8(buf+len+4)), get_16(buf+len+1)); 230 get_8(buf+len+4)), get_16(buf+len+1));
@@ -249,7 +249,7 @@ static int configure_port_init(const unsigned char *buf)
249 case HPEE_PORT_INIT_WIDTH_DWORD: 249 case HPEE_PORT_INIT_WIDTH_DWORD:
250 s=4; 250 s=4;
251 if (c & HPEE_PORT_INIT_MASK) { 251 if (c & HPEE_PORT_INIT_MASK) {
252 printk("\n" KERN_WARNING "port_init: unverified mask attribute\n"); 252 printk(KERN_WARNING "port_init: unverified mask attribute\n");
253 outl((inl(get_16(buf+len+1) & 253 outl((inl(get_16(buf+len+1) &
254 get_32(buf+len+3)) | 254 get_32(buf+len+3)) |
255 get_32(buf+len+7)), get_16(buf+len+1)); 255 get_32(buf+len+7)), get_16(buf+len+1));
@@ -259,7 +259,7 @@ static int configure_port_init(const unsigned char *buf)
259 259
260 break; 260 break;
261 default: 261 default:
262 printk("\n" KERN_ERR "Invalid port init word %02x\n", c); 262 printk(KERN_ERR "Invalid port init word %02x\n", c);
263 return 0; 263 return 0;
264 } 264 }
265 265
@@ -297,7 +297,7 @@ static int configure_type_string(const unsigned char *buf)
297 /* just skip past the type field */ 297 /* just skip past the type field */
298 len = get_8(buf); 298 len = get_8(buf);
299 if (len > 80) { 299 if (len > 80) {
300 printk("\n" KERN_ERR "eisa_enumerator: type info field too long (%d, max is 80)\n", len); 300 printk(KERN_ERR "eisa_enumerator: type info field too long (%d, max is 80)\n", len);
301 } 301 }
302 302
303 return 1+len; 303 return 1+len;
@@ -398,7 +398,7 @@ static int parse_slot_config(int slot,
398 } 398 }
399 399
400 if (p0 + function_len < pos) { 400 if (p0 + function_len < pos) {
401 printk("\n" KERN_ERR "eisa_enumerator: function %d length mis-match " 401 printk(KERN_ERR "eisa_enumerator: function %d length mis-match "
402 "got %d, expected %d\n", 402 "got %d, expected %d\n",
403 num_func, pos-p0, function_len); 403 num_func, pos-p0, function_len);
404 res=-1; 404 res=-1;
diff --git a/drivers/parisc/gsc.c b/drivers/parisc/gsc.c
index d33632917696..647adc9f85ad 100644
--- a/drivers/parisc/gsc.c
+++ b/drivers/parisc/gsc.c
@@ -148,7 +148,7 @@ static unsigned int gsc_asic_startup_irq(unsigned int irq)
148 return 0; 148 return 0;
149} 149}
150 150
151static struct hw_interrupt_type gsc_asic_interrupt_type = { 151static struct irq_chip gsc_asic_interrupt_type = {
152 .typename = "GSC-ASIC", 152 .typename = "GSC-ASIC",
153 .startup = gsc_asic_startup_irq, 153 .startup = gsc_asic_startup_irq,
154 .shutdown = gsc_asic_disable_irq, 154 .shutdown = gsc_asic_disable_irq,
@@ -158,7 +158,7 @@ static struct hw_interrupt_type gsc_asic_interrupt_type = {
158 .end = no_end_irq, 158 .end = no_end_irq,
159}; 159};
160 160
161int gsc_assign_irq(struct hw_interrupt_type *type, void *data) 161int gsc_assign_irq(struct irq_chip *type, void *data)
162{ 162{
163 static int irq = GSC_IRQ_BASE; 163 static int irq = GSC_IRQ_BASE;
164 struct irq_desc *desc; 164 struct irq_desc *desc;
diff --git a/drivers/parisc/gsc.h b/drivers/parisc/gsc.h
index 762a1babad60..b9d7bfb68e24 100644
--- a/drivers/parisc/gsc.h
+++ b/drivers/parisc/gsc.h
@@ -38,7 +38,7 @@ struct gsc_asic {
38int gsc_common_setup(struct parisc_device *parent, struct gsc_asic *gsc_asic); 38int gsc_common_setup(struct parisc_device *parent, struct gsc_asic *gsc_asic);
39int gsc_alloc_irq(struct gsc_irq *dev); /* dev needs an irq */ 39int gsc_alloc_irq(struct gsc_irq *dev); /* dev needs an irq */
40int gsc_claim_irq(struct gsc_irq *dev, int irq); /* dev needs this irq */ 40int gsc_claim_irq(struct gsc_irq *dev, int irq); /* dev needs this irq */
41int gsc_assign_irq(struct hw_interrupt_type *type, void *data); 41int gsc_assign_irq(struct irq_chip *type, void *data);
42int gsc_find_local_irq(unsigned int irq, int *global_irq, int limit); 42int gsc_find_local_irq(unsigned int irq, int *global_irq, int limit);
43void gsc_fixup_irqs(struct parisc_device *parent, void *ctrl, 43void gsc_fixup_irqs(struct parisc_device *parent, void *ctrl,
44 void (*choose)(struct parisc_device *child, void *ctrl)); 44 void (*choose)(struct parisc_device *child, void *ctrl));
diff --git a/drivers/parisc/hppb.c b/drivers/parisc/hppb.c
index 13856415b432..815db175d427 100644
--- a/drivers/parisc/hppb.c
+++ b/drivers/parisc/hppb.c
@@ -62,7 +62,8 @@ static int hppb_probe(struct parisc_device *dev)
62 } 62 }
63 card = card->next; 63 card = card->next;
64 } 64 }
65 printk(KERN_INFO "Found GeckoBoa at 0x%x\n", dev->hpa.start); 65 printk(KERN_INFO "Found GeckoBoa at 0x%llx\n",
66 (unsigned long long) dev->hpa.start);
66 67
67 card->hpa = dev->hpa.start; 68 card->hpa = dev->hpa.start;
68 card->mmio_region.name = "HP-PB Bus"; 69 card->mmio_region.name = "HP-PB Bus";
@@ -73,8 +74,10 @@ static int hppb_probe(struct parisc_device *dev)
73 74
74 status = ccio_request_resource(dev, &card->mmio_region); 75 status = ccio_request_resource(dev, &card->mmio_region);
75 if(status < 0) { 76 if(status < 0) {
76 printk(KERN_ERR "%s: failed to claim HP-PB bus space (%08x, %08x)\n", 77 printk(KERN_ERR "%s: failed to claim HP-PB "
77 __FILE__, card->mmio_region.start, card->mmio_region.end); 78 "bus space (0x%08llx, 0x%08llx)\n",
79 __FILE__, (unsigned long long) card->mmio_region.start,
80 (unsigned long long) card->mmio_region.end);
78 } 81 }
79 82
80 return 0; 83 return 0;
diff --git a/drivers/parisc/iosapic.c b/drivers/parisc/iosapic.c
index 4a9cc92d4d18..88e333553212 100644
--- a/drivers/parisc/iosapic.c
+++ b/drivers/parisc/iosapic.c
@@ -729,7 +729,7 @@ static int iosapic_set_affinity_irq(unsigned int irq,
729} 729}
730#endif 730#endif
731 731
732static struct hw_interrupt_type iosapic_interrupt_type = { 732static struct irq_chip iosapic_interrupt_type = {
733 .typename = "IO-SAPIC-level", 733 .typename = "IO-SAPIC-level",
734 .startup = iosapic_startup_irq, 734 .startup = iosapic_startup_irq,
735 .shutdown = iosapic_disable_irq, 735 .shutdown = iosapic_disable_irq,
diff --git a/drivers/parisc/lba_pci.c b/drivers/parisc/lba_pci.c
index 59fbbf128365..3aeb3279c92a 100644
--- a/drivers/parisc/lba_pci.c
+++ b/drivers/parisc/lba_pci.c
@@ -980,28 +980,38 @@ static void
980lba_pat_resources(struct parisc_device *pa_dev, struct lba_device *lba_dev) 980lba_pat_resources(struct parisc_device *pa_dev, struct lba_device *lba_dev)
981{ 981{
982 unsigned long bytecnt; 982 unsigned long bytecnt;
983 pdc_pat_cell_mod_maddr_block_t pa_pdc_cell; /* PA_VIEW */
984 pdc_pat_cell_mod_maddr_block_t io_pdc_cell; /* IO_VIEW */
985 long io_count; 983 long io_count;
986 long status; /* PDC return status */ 984 long status; /* PDC return status */
987 long pa_count; 985 long pa_count;
986 pdc_pat_cell_mod_maddr_block_t *pa_pdc_cell; /* PA_VIEW */
987 pdc_pat_cell_mod_maddr_block_t *io_pdc_cell; /* IO_VIEW */
988 int i; 988 int i;
989 989
990 pa_pdc_cell = kzalloc(sizeof(pdc_pat_cell_mod_maddr_block_t), GFP_KERNEL);
991 if (!pa_pdc_cell)
992 return;
993
994 io_pdc_cell = kzalloc(sizeof(pdc_pat_cell_mod_maddr_block_t), GFP_KERNEL);
995 if (!io_pdc_cell) {
996 kfree(pa_pdc_cell);
997 return;
998 }
999
990 /* return cell module (IO view) */ 1000 /* return cell module (IO view) */
991 status = pdc_pat_cell_module(&bytecnt, pa_dev->pcell_loc, pa_dev->mod_index, 1001 status = pdc_pat_cell_module(&bytecnt, pa_dev->pcell_loc, pa_dev->mod_index,
992 PA_VIEW, & pa_pdc_cell); 1002 PA_VIEW, pa_pdc_cell);
993 pa_count = pa_pdc_cell.mod[1]; 1003 pa_count = pa_pdc_cell->mod[1];
994 1004
995 status |= pdc_pat_cell_module(&bytecnt, pa_dev->pcell_loc, pa_dev->mod_index, 1005 status |= pdc_pat_cell_module(&bytecnt, pa_dev->pcell_loc, pa_dev->mod_index,
996 IO_VIEW, &io_pdc_cell); 1006 IO_VIEW, io_pdc_cell);
997 io_count = io_pdc_cell.mod[1]; 1007 io_count = io_pdc_cell->mod[1];
998 1008
999 /* We've already done this once for device discovery...*/ 1009 /* We've already done this once for device discovery...*/
1000 if (status != PDC_OK) { 1010 if (status != PDC_OK) {
1001 panic("pdc_pat_cell_module() call failed for LBA!\n"); 1011 panic("pdc_pat_cell_module() call failed for LBA!\n");
1002 } 1012 }
1003 1013
1004 if (PAT_GET_ENTITY(pa_pdc_cell.mod_info) != PAT_ENTITY_LBA) { 1014 if (PAT_GET_ENTITY(pa_pdc_cell->mod_info) != PAT_ENTITY_LBA) {
1005 panic("pdc_pat_cell_module() entity returned != PAT_ENTITY_LBA!\n"); 1015 panic("pdc_pat_cell_module() entity returned != PAT_ENTITY_LBA!\n");
1006 } 1016 }
1007 1017
@@ -1016,8 +1026,8 @@ lba_pat_resources(struct parisc_device *pa_dev, struct lba_device *lba_dev)
1016 } *p, *io; 1026 } *p, *io;
1017 struct resource *r; 1027 struct resource *r;
1018 1028
1019 p = (void *) &(pa_pdc_cell.mod[2+i*3]); 1029 p = (void *) &(pa_pdc_cell->mod[2+i*3]);
1020 io = (void *) &(io_pdc_cell.mod[2+i*3]); 1030 io = (void *) &(io_pdc_cell->mod[2+i*3]);
1021 1031
1022 /* Convert the PAT range data to PCI "struct resource" */ 1032 /* Convert the PAT range data to PCI "struct resource" */
1023 switch(p->type & 0xff) { 1033 switch(p->type & 0xff) {
@@ -1096,6 +1106,9 @@ lba_pat_resources(struct parisc_device *pa_dev, struct lba_device *lba_dev)
1096 break; 1106 break;
1097 } 1107 }
1098 } 1108 }
1109
1110 kfree(pa_pdc_cell);
1111 kfree(io_pdc_cell);
1099} 1112}
1100#else 1113#else
1101/* keep compiler from complaining about missing declarations */ 1114/* keep compiler from complaining about missing declarations */
@@ -1509,10 +1522,6 @@ lba_driver_probe(struct parisc_device *dev)
1509 lba_bus = lba_dev->hba.hba_bus = 1522 lba_bus = lba_dev->hba.hba_bus =
1510 pci_scan_bus_parented(&dev->dev, lba_dev->hba.bus_num.start, 1523 pci_scan_bus_parented(&dev->dev, lba_dev->hba.bus_num.start,
1511 cfg_ops, NULL); 1524 cfg_ops, NULL);
1512 if (lba_bus) {
1513 lba_next_bus = lba_bus->subordinate + 1;
1514 pci_bus_add_devices(lba_bus);
1515 }
1516 1525
1517 /* This is in lieu of calling pci_assign_unassigned_resources() */ 1526 /* This is in lieu of calling pci_assign_unassigned_resources() */
1518 if (is_pdc_pat()) { 1527 if (is_pdc_pat()) {
@@ -1533,7 +1542,6 @@ lba_driver_probe(struct parisc_device *dev)
1533 } 1542 }
1534 pci_enable_bridges(lba_bus); 1543 pci_enable_bridges(lba_bus);
1535 1544
1536
1537 /* 1545 /*
1538 ** Once PCI register ops has walked the bus, access to config 1546 ** Once PCI register ops has walked the bus, access to config
1539 ** space is restricted. Avoids master aborts on config cycles. 1547 ** space is restricted. Avoids master aborts on config cycles.
@@ -1543,6 +1551,11 @@ lba_driver_probe(struct parisc_device *dev)
1543 lba_dev->flags |= LBA_FLAG_SKIP_PROBE; 1551 lba_dev->flags |= LBA_FLAG_SKIP_PROBE;
1544 } 1552 }
1545 1553
1554 if (lba_bus) {
1555 lba_next_bus = lba_bus->subordinate + 1;
1556 pci_bus_add_devices(lba_bus);
1557 }
1558
1546 /* Whew! Finally done! Tell services we got this one covered. */ 1559 /* Whew! Finally done! Tell services we got this one covered. */
1547 return 0; 1560 return 0;
1548} 1561}
diff --git a/drivers/parisc/pdc_stable.c b/drivers/parisc/pdc_stable.c
index f9f9a5f1bbd0..13a64bc081b6 100644
--- a/drivers/parisc/pdc_stable.c
+++ b/drivers/parisc/pdc_stable.c
@@ -370,7 +370,7 @@ pdcspath_layer_read(struct pdcspath_entry *entry, char *buf)
370 if (!i) /* entry is not ready */ 370 if (!i) /* entry is not ready */
371 return -ENODATA; 371 return -ENODATA;
372 372
373 for (i = 0; devpath->layers[i] && (likely(i < 6)); i++) 373 for (i = 0; i < 6 && devpath->layers[i]; i++)
374 out += sprintf(out, "%u ", devpath->layers[i]); 374 out += sprintf(out, "%u ", devpath->layers[i]);
375 375
376 out += sprintf(out, "\n"); 376 out += sprintf(out, "\n");
diff --git a/drivers/parisc/sba_iommu.c b/drivers/parisc/sba_iommu.c
index d46dd57450ac..123d8fe3427d 100644
--- a/drivers/parisc/sba_iommu.c
+++ b/drivers/parisc/sba_iommu.c
@@ -2057,6 +2057,7 @@ void sba_directed_lmmio(struct parisc_device *pci_hba, struct resource *r)
2057 r->start = (base & ~1UL) | PCI_F_EXTEND; 2057 r->start = (base & ~1UL) | PCI_F_EXTEND;
2058 size = ~ READ_REG32(reg + LMMIO_DIRECT0_MASK); 2058 size = ~ READ_REG32(reg + LMMIO_DIRECT0_MASK);
2059 r->end = r->start + size; 2059 r->end = r->start + size;
2060 r->flags = IORESOURCE_MEM;
2060 } 2061 }
2061} 2062}
2062 2063
@@ -2093,4 +2094,5 @@ void sba_distributed_lmmio(struct parisc_device *pci_hba, struct resource *r )
2093 size = (~READ_REG32(sba->sba_hpa + LMMIO_DIST_MASK)) / ROPES_PER_IOC; 2094 size = (~READ_REG32(sba->sba_hpa + LMMIO_DIST_MASK)) / ROPES_PER_IOC;
2094 r->start += rope * (size + 1); /* adjust base for this rope */ 2095 r->start += rope * (size + 1); /* adjust base for this rope */
2095 r->end = r->start + size; 2096 r->end = r->start + size;
2097 r->flags = IORESOURCE_MEM;
2096} 2098}
diff --git a/drivers/parisc/superio.c b/drivers/parisc/superio.c
index 33e5ade774ca..675f04e6597a 100644
--- a/drivers/parisc/superio.c
+++ b/drivers/parisc/superio.c
@@ -325,7 +325,7 @@ static unsigned int superio_startup_irq(unsigned int irq)
325 return 0; 325 return 0;
326} 326}
327 327
328static struct hw_interrupt_type superio_interrupt_type = { 328static struct irq_chip superio_interrupt_type = {
329 .typename = SUPERIO, 329 .typename = SUPERIO,
330 .startup = superio_startup_irq, 330 .startup = superio_startup_irq,
331 .shutdown = superio_disable_irq, 331 .shutdown = superio_disable_irq,
@@ -434,8 +434,8 @@ static void __init superio_parport_init(void)
434 0 /*base_hi*/, 434 0 /*base_hi*/,
435 PAR_IRQ, 435 PAR_IRQ,
436 PARPORT_DMA_NONE /* dma */, 436 PARPORT_DMA_NONE /* dma */,
437 NULL /*struct pci_dev* */), 437 NULL /*struct pci_dev* */,
438 0 /* shared irq flags */ ) 438 0 /* shared irq flags */))
439 439
440 printk(KERN_WARNING PFX "Probing parallel port failed.\n"); 440 printk(KERN_WARNING PFX "Probing parallel port failed.\n");
441#endif /* CONFIG_PARPORT_PC */ 441#endif /* CONFIG_PARPORT_PC */
diff --git a/drivers/parport/parport_pc.c b/drivers/parport/parport_pc.c
index 1032d5fdbd42..2597145a066e 100644
--- a/drivers/parport/parport_pc.c
+++ b/drivers/parport/parport_pc.c
@@ -2907,6 +2907,7 @@ enum parport_pc_pci_cards {
2907 netmos_9755, 2907 netmos_9755,
2908 netmos_9805, 2908 netmos_9805,
2909 netmos_9815, 2909 netmos_9815,
2910 netmos_9901,
2910 quatech_sppxp100, 2911 quatech_sppxp100,
2911}; 2912};
2912 2913
@@ -2987,7 +2988,7 @@ static struct parport_pc_pci {
2987 /* netmos_9755 */ { 2, { { 0, 1 }, { 2, 3 },} }, 2988 /* netmos_9755 */ { 2, { { 0, 1 }, { 2, 3 },} },
2988 /* netmos_9805 */ { 1, { { 0, -1 }, } }, 2989 /* netmos_9805 */ { 1, { { 0, -1 }, } },
2989 /* netmos_9815 */ { 2, { { 0, -1 }, { 2, -1 }, } }, 2990 /* netmos_9815 */ { 2, { { 0, -1 }, { 2, -1 }, } },
2990 2991 /* netmos_9901 */ { 1, { { 0, -1 }, } },
2991 /* quatech_sppxp100 */ { 1, { { 0, 1 }, } }, 2992 /* quatech_sppxp100 */ { 1, { { 0, 1 }, } },
2992}; 2993};
2993 2994
@@ -3089,6 +3090,8 @@ static const struct pci_device_id parport_pc_pci_tbl[] = {
3089 PCI_ANY_ID, PCI_ANY_ID, 0, 0, netmos_9805 }, 3090 PCI_ANY_ID, PCI_ANY_ID, 0, 0, netmos_9805 },
3090 { PCI_VENDOR_ID_NETMOS, PCI_DEVICE_ID_NETMOS_9815, 3091 { PCI_VENDOR_ID_NETMOS, PCI_DEVICE_ID_NETMOS_9815,
3091 PCI_ANY_ID, PCI_ANY_ID, 0, 0, netmos_9815 }, 3092 PCI_ANY_ID, PCI_ANY_ID, 0, 0, netmos_9815 },
3093 { PCI_VENDOR_ID_NETMOS, PCI_DEVICE_ID_NETMOS_9901,
3094 0xA000, 0x2000, 0, 0, netmos_9901 },
3092 /* Quatech SPPXP-100 Parallel port PCI ExpressCard */ 3095 /* Quatech SPPXP-100 Parallel port PCI ExpressCard */
3093 { PCI_VENDOR_ID_QUATECH, PCI_DEVICE_ID_QUATECH_SPPXP_100, 3096 { PCI_VENDOR_ID_QUATECH, PCI_DEVICE_ID_QUATECH_SPPXP_100,
3094 PCI_ANY_ID, PCI_ANY_ID, 0, 0, quatech_sppxp100 }, 3097 PCI_ANY_ID, PCI_ANY_ID, 0, 0, quatech_sppxp100 },
diff --git a/drivers/pci/hotplug/cpci_hotplug_core.c b/drivers/pci/hotplug/cpci_hotplug_core.c
index a5b9f6ae507b..d703e73fffa7 100644
--- a/drivers/pci/hotplug/cpci_hotplug_core.c
+++ b/drivers/pci/hotplug/cpci_hotplug_core.c
@@ -32,7 +32,6 @@
32#include <linux/pci_hotplug.h> 32#include <linux/pci_hotplug.h>
33#include <linux/init.h> 33#include <linux/init.h>
34#include <linux/interrupt.h> 34#include <linux/interrupt.h>
35#include <linux/smp_lock.h>
36#include <asm/atomic.h> 35#include <asm/atomic.h>
37#include <linux/delay.h> 36#include <linux/delay.h>
38#include <linux/kthread.h> 37#include <linux/kthread.h>
diff --git a/drivers/pci/hotplug/cpqphp_ctrl.c b/drivers/pci/hotplug/cpqphp_ctrl.c
index 2fa47af992a8..0ff689afa757 100644
--- a/drivers/pci/hotplug/cpqphp_ctrl.c
+++ b/drivers/pci/hotplug/cpqphp_ctrl.c
@@ -34,7 +34,6 @@
34#include <linux/interrupt.h> 34#include <linux/interrupt.h>
35#include <linux/delay.h> 35#include <linux/delay.h>
36#include <linux/wait.h> 36#include <linux/wait.h>
37#include <linux/smp_lock.h>
38#include <linux/pci.h> 37#include <linux/pci.h>
39#include <linux/pci_hotplug.h> 38#include <linux/pci_hotplug.h>
40#include <linux/kthread.h> 39#include <linux/kthread.h>
diff --git a/drivers/pci/hotplug/cpqphp_sysfs.c b/drivers/pci/hotplug/cpqphp_sysfs.c
index 8450f4a6568a..e6089bdb6e5b 100644
--- a/drivers/pci/hotplug/cpqphp_sysfs.c
+++ b/drivers/pci/hotplug/cpqphp_sysfs.c
@@ -33,6 +33,7 @@
33#include <linux/workqueue.h> 33#include <linux/workqueue.h>
34#include <linux/pci.h> 34#include <linux/pci.h>
35#include <linux/pci_hotplug.h> 35#include <linux/pci_hotplug.h>
36#include <linux/smp_lock.h>
36#include <linux/debugfs.h> 37#include <linux/debugfs.h>
37#include "cpqphp.h" 38#include "cpqphp.h"
38 39
diff --git a/drivers/pci/hotplug/pci_hotplug_core.c b/drivers/pci/hotplug/pci_hotplug_core.c
index 844580489d4d..5c5043f239cf 100644
--- a/drivers/pci/hotplug/pci_hotplug_core.c
+++ b/drivers/pci/hotplug/pci_hotplug_core.c
@@ -555,6 +555,8 @@ static struct hotplug_slot *get_slot_from_name (const char *name)
555 * @slot: pointer to the &struct hotplug_slot to register 555 * @slot: pointer to the &struct hotplug_slot to register
556 * @devnr: device number 556 * @devnr: device number
557 * @name: name registered with kobject core 557 * @name: name registered with kobject core
558 * @owner: caller module owner
559 * @mod_name: caller module name
558 * 560 *
559 * Registers a hotplug slot with the pci hotplug subsystem, which will allow 561 * Registers a hotplug slot with the pci hotplug subsystem, which will allow
560 * userspace interaction to the slot. 562 * userspace interaction to the slot.
diff --git a/drivers/pci/hotplug/pciehp_ctrl.c b/drivers/pci/hotplug/pciehp_ctrl.c
index ff4034502d24..8aab8edf123e 100644
--- a/drivers/pci/hotplug/pciehp_ctrl.c
+++ b/drivers/pci/hotplug/pciehp_ctrl.c
@@ -30,7 +30,6 @@
30#include <linux/module.h> 30#include <linux/module.h>
31#include <linux/kernel.h> 31#include <linux/kernel.h>
32#include <linux/types.h> 32#include <linux/types.h>
33#include <linux/smp_lock.h>
34#include <linux/pci.h> 33#include <linux/pci.h>
35#include <linux/workqueue.h> 34#include <linux/workqueue.h>
36#include "../pci.h" 35#include "../pci.h"
diff --git a/drivers/pci/intel-iommu.c b/drivers/pci/intel-iommu.c
index e53eacd75c8d..2314ad7ee5fe 100644
--- a/drivers/pci/intel-iommu.c
+++ b/drivers/pci/intel-iommu.c
@@ -39,7 +39,6 @@
39#include <linux/sysdev.h> 39#include <linux/sysdev.h>
40#include <asm/cacheflush.h> 40#include <asm/cacheflush.h>
41#include <asm/iommu.h> 41#include <asm/iommu.h>
42#include <asm/e820.h>
43#include "pci.h" 42#include "pci.h"
44 43
45#define ROOT_SIZE VTD_PAGE_SIZE 44#define ROOT_SIZE VTD_PAGE_SIZE
@@ -57,14 +56,32 @@
57#define MAX_AGAW_WIDTH 64 56#define MAX_AGAW_WIDTH 64
58 57
59#define DOMAIN_MAX_ADDR(gaw) ((((u64)1) << gaw) - 1) 58#define DOMAIN_MAX_ADDR(gaw) ((((u64)1) << gaw) - 1)
59#define DOMAIN_MAX_PFN(gaw) ((((u64)1) << (gaw-VTD_PAGE_SHIFT)) - 1)
60 60
61#define IOVA_PFN(addr) ((addr) >> PAGE_SHIFT) 61#define IOVA_PFN(addr) ((addr) >> PAGE_SHIFT)
62#define DMA_32BIT_PFN IOVA_PFN(DMA_BIT_MASK(32)) 62#define DMA_32BIT_PFN IOVA_PFN(DMA_BIT_MASK(32))
63#define DMA_64BIT_PFN IOVA_PFN(DMA_BIT_MASK(64)) 63#define DMA_64BIT_PFN IOVA_PFN(DMA_BIT_MASK(64))
64 64
65#ifndef PHYSICAL_PAGE_MASK 65
66#define PHYSICAL_PAGE_MASK PAGE_MASK 66/* VT-d pages must always be _smaller_ than MM pages. Otherwise things
67#endif 67 are never going to work. */
68static inline unsigned long dma_to_mm_pfn(unsigned long dma_pfn)
69{
70 return dma_pfn >> (PAGE_SHIFT - VTD_PAGE_SHIFT);
71}
72
73static inline unsigned long mm_to_dma_pfn(unsigned long mm_pfn)
74{
75 return mm_pfn << (PAGE_SHIFT - VTD_PAGE_SHIFT);
76}
77static inline unsigned long page_to_dma_pfn(struct page *pg)
78{
79 return mm_to_dma_pfn(page_to_pfn(pg));
80}
81static inline unsigned long virt_to_dma_pfn(void *p)
82{
83 return page_to_dma_pfn(virt_to_page(p));
84}
68 85
69/* global iommu list, set NULL for ignored DMAR units */ 86/* global iommu list, set NULL for ignored DMAR units */
70static struct intel_iommu **g_iommus; 87static struct intel_iommu **g_iommus;
@@ -205,12 +222,17 @@ static inline void dma_set_pte_prot(struct dma_pte *pte, unsigned long prot)
205 222
206static inline u64 dma_pte_addr(struct dma_pte *pte) 223static inline u64 dma_pte_addr(struct dma_pte *pte)
207{ 224{
208 return (pte->val & VTD_PAGE_MASK); 225#ifdef CONFIG_64BIT
226 return pte->val & VTD_PAGE_MASK;
227#else
228 /* Must have a full atomic 64-bit read */
229 return __cmpxchg64(pte, 0ULL, 0ULL) & VTD_PAGE_MASK;
230#endif
209} 231}
210 232
211static inline void dma_set_pte_addr(struct dma_pte *pte, u64 addr) 233static inline void dma_set_pte_pfn(struct dma_pte *pte, unsigned long pfn)
212{ 234{
213 pte->val |= (addr & VTD_PAGE_MASK); 235 pte->val |= (uint64_t)pfn << VTD_PAGE_SHIFT;
214} 236}
215 237
216static inline bool dma_pte_present(struct dma_pte *pte) 238static inline bool dma_pte_present(struct dma_pte *pte)
@@ -218,6 +240,11 @@ static inline bool dma_pte_present(struct dma_pte *pte)
218 return (pte->val & 3) != 0; 240 return (pte->val & 3) != 0;
219} 241}
220 242
243static inline int first_pte_in_page(struct dma_pte *pte)
244{
245 return !((unsigned long)pte & ~VTD_PAGE_MASK);
246}
247
221/* 248/*
222 * This domain is a statically identity mapping domain. 249 * This domain is a statically identity mapping domain.
223 * 1. This domain creats a static 1:1 mapping to all usable memory. 250 * 1. This domain creats a static 1:1 mapping to all usable memory.
@@ -245,7 +272,6 @@ struct dmar_domain {
245 struct iova_domain iovad; /* iova's that belong to this domain */ 272 struct iova_domain iovad; /* iova's that belong to this domain */
246 273
247 struct dma_pte *pgd; /* virtual address */ 274 struct dma_pte *pgd; /* virtual address */
248 spinlock_t mapping_lock; /* page table lock */
249 int gaw; /* max guest address width */ 275 int gaw; /* max guest address width */
250 276
251 /* adjusted guest address width, 0 is level 2 30-bit */ 277 /* adjusted guest address width, 0 is level 2 30-bit */
@@ -649,80 +675,78 @@ static inline int width_to_agaw(int width)
649 675
650static inline unsigned int level_to_offset_bits(int level) 676static inline unsigned int level_to_offset_bits(int level)
651{ 677{
652 return (12 + (level - 1) * LEVEL_STRIDE); 678 return (level - 1) * LEVEL_STRIDE;
653} 679}
654 680
655static inline int address_level_offset(u64 addr, int level) 681static inline int pfn_level_offset(unsigned long pfn, int level)
656{ 682{
657 return ((addr >> level_to_offset_bits(level)) & LEVEL_MASK); 683 return (pfn >> level_to_offset_bits(level)) & LEVEL_MASK;
658} 684}
659 685
660static inline u64 level_mask(int level) 686static inline unsigned long level_mask(int level)
661{ 687{
662 return ((u64)-1 << level_to_offset_bits(level)); 688 return -1UL << level_to_offset_bits(level);
663} 689}
664 690
665static inline u64 level_size(int level) 691static inline unsigned long level_size(int level)
666{ 692{
667 return ((u64)1 << level_to_offset_bits(level)); 693 return 1UL << level_to_offset_bits(level);
668} 694}
669 695
670static inline u64 align_to_level(u64 addr, int level) 696static inline unsigned long align_to_level(unsigned long pfn, int level)
671{ 697{
672 return ((addr + level_size(level) - 1) & level_mask(level)); 698 return (pfn + level_size(level) - 1) & level_mask(level);
673} 699}
674 700
675static struct dma_pte * addr_to_dma_pte(struct dmar_domain *domain, u64 addr) 701static struct dma_pte *pfn_to_dma_pte(struct dmar_domain *domain,
702 unsigned long pfn)
676{ 703{
677 int addr_width = agaw_to_width(domain->agaw); 704 int addr_width = agaw_to_width(domain->agaw) - VTD_PAGE_SHIFT;
678 struct dma_pte *parent, *pte = NULL; 705 struct dma_pte *parent, *pte = NULL;
679 int level = agaw_to_level(domain->agaw); 706 int level = agaw_to_level(domain->agaw);
680 int offset; 707 int offset;
681 unsigned long flags;
682 708
683 BUG_ON(!domain->pgd); 709 BUG_ON(!domain->pgd);
684 710 BUG_ON(addr_width < BITS_PER_LONG && pfn >> addr_width);
685 addr &= (((u64)1) << addr_width) - 1;
686 parent = domain->pgd; 711 parent = domain->pgd;
687 712
688 spin_lock_irqsave(&domain->mapping_lock, flags);
689 while (level > 0) { 713 while (level > 0) {
690 void *tmp_page; 714 void *tmp_page;
691 715
692 offset = address_level_offset(addr, level); 716 offset = pfn_level_offset(pfn, level);
693 pte = &parent[offset]; 717 pte = &parent[offset];
694 if (level == 1) 718 if (level == 1)
695 break; 719 break;
696 720
697 if (!dma_pte_present(pte)) { 721 if (!dma_pte_present(pte)) {
722 uint64_t pteval;
723
698 tmp_page = alloc_pgtable_page(); 724 tmp_page = alloc_pgtable_page();
699 725
700 if (!tmp_page) { 726 if (!tmp_page)
701 spin_unlock_irqrestore(&domain->mapping_lock,
702 flags);
703 return NULL; 727 return NULL;
728
729 domain_flush_cache(domain, tmp_page, VTD_PAGE_SIZE);
730 pteval = (virt_to_dma_pfn(tmp_page) << VTD_PAGE_SHIFT) | DMA_PTE_READ | DMA_PTE_WRITE;
731 if (cmpxchg64(&pte->val, 0ULL, pteval)) {
732 /* Someone else set it while we were thinking; use theirs. */
733 free_pgtable_page(tmp_page);
734 } else {
735 dma_pte_addr(pte);
736 domain_flush_cache(domain, pte, sizeof(*pte));
704 } 737 }
705 domain_flush_cache(domain, tmp_page, PAGE_SIZE);
706 dma_set_pte_addr(pte, virt_to_phys(tmp_page));
707 /*
708 * high level table always sets r/w, last level page
709 * table control read/write
710 */
711 dma_set_pte_readable(pte);
712 dma_set_pte_writable(pte);
713 domain_flush_cache(domain, pte, sizeof(*pte));
714 } 738 }
715 parent = phys_to_virt(dma_pte_addr(pte)); 739 parent = phys_to_virt(dma_pte_addr(pte));
716 level--; 740 level--;
717 } 741 }
718 742
719 spin_unlock_irqrestore(&domain->mapping_lock, flags);
720 return pte; 743 return pte;
721} 744}
722 745
723/* return address's pte at specific level */ 746/* return address's pte at specific level */
724static struct dma_pte *dma_addr_level_pte(struct dmar_domain *domain, u64 addr, 747static struct dma_pte *dma_pfn_level_pte(struct dmar_domain *domain,
725 int level) 748 unsigned long pfn,
749 int level)
726{ 750{
727 struct dma_pte *parent, *pte = NULL; 751 struct dma_pte *parent, *pte = NULL;
728 int total = agaw_to_level(domain->agaw); 752 int total = agaw_to_level(domain->agaw);
@@ -730,7 +754,7 @@ static struct dma_pte *dma_addr_level_pte(struct dmar_domain *domain, u64 addr,
730 754
731 parent = domain->pgd; 755 parent = domain->pgd;
732 while (level <= total) { 756 while (level <= total) {
733 offset = address_level_offset(addr, total); 757 offset = pfn_level_offset(pfn, total);
734 pte = &parent[offset]; 758 pte = &parent[offset];
735 if (level == total) 759 if (level == total)
736 return pte; 760 return pte;
@@ -743,74 +767,82 @@ static struct dma_pte *dma_addr_level_pte(struct dmar_domain *domain, u64 addr,
743 return NULL; 767 return NULL;
744} 768}
745 769
746/* clear one page's page table */
747static void dma_pte_clear_one(struct dmar_domain *domain, u64 addr)
748{
749 struct dma_pte *pte = NULL;
750
751 /* get last level pte */
752 pte = dma_addr_level_pte(domain, addr, 1);
753
754 if (pte) {
755 dma_clear_pte(pte);
756 domain_flush_cache(domain, pte, sizeof(*pte));
757 }
758}
759
760/* clear last level pte, a tlb flush should be followed */ 770/* clear last level pte, a tlb flush should be followed */
761static void dma_pte_clear_range(struct dmar_domain *domain, u64 start, u64 end) 771static void dma_pte_clear_range(struct dmar_domain *domain,
772 unsigned long start_pfn,
773 unsigned long last_pfn)
762{ 774{
763 int addr_width = agaw_to_width(domain->agaw); 775 int addr_width = agaw_to_width(domain->agaw) - VTD_PAGE_SHIFT;
764 int npages; 776 struct dma_pte *first_pte, *pte;
765 777
766 start &= (((u64)1) << addr_width) - 1; 778 BUG_ON(addr_width < BITS_PER_LONG && start_pfn >> addr_width);
767 end &= (((u64)1) << addr_width) - 1; 779 BUG_ON(addr_width < BITS_PER_LONG && last_pfn >> addr_width);
768 /* in case it's partial page */
769 start &= PAGE_MASK;
770 end = PAGE_ALIGN(end);
771 npages = (end - start) / VTD_PAGE_SIZE;
772 780
773 /* we don't need lock here, nobody else touches the iova range */ 781 /* we don't need lock here; nobody else touches the iova range */
774 while (npages--) { 782 while (start_pfn <= last_pfn) {
775 dma_pte_clear_one(domain, start); 783 first_pte = pte = dma_pfn_level_pte(domain, start_pfn, 1);
776 start += VTD_PAGE_SIZE; 784 if (!pte) {
785 start_pfn = align_to_level(start_pfn + 1, 2);
786 continue;
787 }
788 do {
789 dma_clear_pte(pte);
790 start_pfn++;
791 pte++;
792 } while (start_pfn <= last_pfn && !first_pte_in_page(pte));
793
794 domain_flush_cache(domain, first_pte,
795 (void *)pte - (void *)first_pte);
777 } 796 }
778} 797}
779 798
780/* free page table pages. last level pte should already be cleared */ 799/* free page table pages. last level pte should already be cleared */
781static void dma_pte_free_pagetable(struct dmar_domain *domain, 800static void dma_pte_free_pagetable(struct dmar_domain *domain,
782 u64 start, u64 end) 801 unsigned long start_pfn,
802 unsigned long last_pfn)
783{ 803{
784 int addr_width = agaw_to_width(domain->agaw); 804 int addr_width = agaw_to_width(domain->agaw) - VTD_PAGE_SHIFT;
785 struct dma_pte *pte; 805 struct dma_pte *first_pte, *pte;
786 int total = agaw_to_level(domain->agaw); 806 int total = agaw_to_level(domain->agaw);
787 int level; 807 int level;
788 u64 tmp; 808 unsigned long tmp;
789 809
790 start &= (((u64)1) << addr_width) - 1; 810 BUG_ON(addr_width < BITS_PER_LONG && start_pfn >> addr_width);
791 end &= (((u64)1) << addr_width) - 1; 811 BUG_ON(addr_width < BITS_PER_LONG && last_pfn >> addr_width);
792 812
793 /* we don't need lock here, nobody else touches the iova range */ 813 /* We don't need lock here; nobody else touches the iova range */
794 level = 2; 814 level = 2;
795 while (level <= total) { 815 while (level <= total) {
796 tmp = align_to_level(start, level); 816 tmp = align_to_level(start_pfn, level);
797 if (tmp >= end || (tmp + level_size(level) > end)) 817
818 /* If we can't even clear one PTE at this level, we're done */
819 if (tmp + level_size(level) - 1 > last_pfn)
798 return; 820 return;
799 821
800 while (tmp < end) { 822 while (tmp + level_size(level) - 1 <= last_pfn) {
801 pte = dma_addr_level_pte(domain, tmp, level); 823 first_pte = pte = dma_pfn_level_pte(domain, tmp, level);
802 if (pte) { 824 if (!pte) {
803 free_pgtable_page( 825 tmp = align_to_level(tmp + 1, level + 1);
804 phys_to_virt(dma_pte_addr(pte))); 826 continue;
805 dma_clear_pte(pte);
806 domain_flush_cache(domain, pte, sizeof(*pte));
807 } 827 }
808 tmp += level_size(level); 828 do {
829 if (dma_pte_present(pte)) {
830 free_pgtable_page(phys_to_virt(dma_pte_addr(pte)));
831 dma_clear_pte(pte);
832 }
833 pte++;
834 tmp += level_size(level);
835 } while (!first_pte_in_page(pte) &&
836 tmp + level_size(level) - 1 <= last_pfn);
837
838 domain_flush_cache(domain, first_pte,
839 (void *)pte - (void *)first_pte);
840
809 } 841 }
810 level++; 842 level++;
811 } 843 }
812 /* free pgd */ 844 /* free pgd */
813 if (start == 0 && end >= ((((u64)1) << addr_width) - 1)) { 845 if (start_pfn == 0 && last_pfn == DOMAIN_MAX_PFN(domain->gaw)) {
814 free_pgtable_page(domain->pgd); 846 free_pgtable_page(domain->pgd);
815 domain->pgd = NULL; 847 domain->pgd = NULL;
816 } 848 }
@@ -1036,11 +1068,11 @@ static void iommu_flush_dev_iotlb(struct dmar_domain *domain,
1036} 1068}
1037 1069
1038static void iommu_flush_iotlb_psi(struct intel_iommu *iommu, u16 did, 1070static void iommu_flush_iotlb_psi(struct intel_iommu *iommu, u16 did,
1039 u64 addr, unsigned int pages) 1071 unsigned long pfn, unsigned int pages)
1040{ 1072{
1041 unsigned int mask = ilog2(__roundup_pow_of_two(pages)); 1073 unsigned int mask = ilog2(__roundup_pow_of_two(pages));
1074 uint64_t addr = (uint64_t)pfn << VTD_PAGE_SHIFT;
1042 1075
1043 BUG_ON(addr & (~VTD_PAGE_MASK));
1044 BUG_ON(pages == 0); 1076 BUG_ON(pages == 0);
1045 1077
1046 /* 1078 /*
@@ -1055,7 +1087,12 @@ static void iommu_flush_iotlb_psi(struct intel_iommu *iommu, u16 did,
1055 else 1087 else
1056 iommu->flush.flush_iotlb(iommu, did, addr, mask, 1088 iommu->flush.flush_iotlb(iommu, did, addr, mask,
1057 DMA_TLB_PSI_FLUSH); 1089 DMA_TLB_PSI_FLUSH);
1058 if (did) 1090
1091 /*
1092 * In caching mode, domain ID 0 is reserved for non-present to present
1093 * mapping flush. Device IOTLB doesn't need to be flushed in this case.
1094 */
1095 if (!cap_caching_mode(iommu->cap) || did)
1059 iommu_flush_dev_iotlb(iommu->domains[did], addr, mask); 1096 iommu_flush_dev_iotlb(iommu->domains[did], addr, mask);
1060} 1097}
1061 1098
@@ -1280,7 +1317,6 @@ static void dmar_init_reserved_ranges(void)
1280 struct pci_dev *pdev = NULL; 1317 struct pci_dev *pdev = NULL;
1281 struct iova *iova; 1318 struct iova *iova;
1282 int i; 1319 int i;
1283 u64 addr, size;
1284 1320
1285 init_iova_domain(&reserved_iova_list, DMA_32BIT_PFN); 1321 init_iova_domain(&reserved_iova_list, DMA_32BIT_PFN);
1286 1322
@@ -1303,12 +1339,9 @@ static void dmar_init_reserved_ranges(void)
1303 r = &pdev->resource[i]; 1339 r = &pdev->resource[i];
1304 if (!r->flags || !(r->flags & IORESOURCE_MEM)) 1340 if (!r->flags || !(r->flags & IORESOURCE_MEM))
1305 continue; 1341 continue;
1306 addr = r->start; 1342 iova = reserve_iova(&reserved_iova_list,
1307 addr &= PHYSICAL_PAGE_MASK; 1343 IOVA_PFN(r->start),
1308 size = r->end - addr; 1344 IOVA_PFN(r->end));
1309 size = PAGE_ALIGN(size);
1310 iova = reserve_iova(&reserved_iova_list, IOVA_PFN(addr),
1311 IOVA_PFN(size + addr) - 1);
1312 if (!iova) 1345 if (!iova)
1313 printk(KERN_ERR "Reserve iova failed\n"); 1346 printk(KERN_ERR "Reserve iova failed\n");
1314 } 1347 }
@@ -1342,7 +1375,6 @@ static int domain_init(struct dmar_domain *domain, int guest_width)
1342 unsigned long sagaw; 1375 unsigned long sagaw;
1343 1376
1344 init_iova_domain(&domain->iovad, DMA_32BIT_PFN); 1377 init_iova_domain(&domain->iovad, DMA_32BIT_PFN);
1345 spin_lock_init(&domain->mapping_lock);
1346 spin_lock_init(&domain->iommu_lock); 1378 spin_lock_init(&domain->iommu_lock);
1347 1379
1348 domain_reserve_special_ranges(domain); 1380 domain_reserve_special_ranges(domain);
@@ -1389,7 +1421,6 @@ static void domain_exit(struct dmar_domain *domain)
1389{ 1421{
1390 struct dmar_drhd_unit *drhd; 1422 struct dmar_drhd_unit *drhd;
1391 struct intel_iommu *iommu; 1423 struct intel_iommu *iommu;
1392 u64 end;
1393 1424
1394 /* Domain 0 is reserved, so dont process it */ 1425 /* Domain 0 is reserved, so dont process it */
1395 if (!domain) 1426 if (!domain)
@@ -1398,14 +1429,12 @@ static void domain_exit(struct dmar_domain *domain)
1398 domain_remove_dev_info(domain); 1429 domain_remove_dev_info(domain);
1399 /* destroy iovas */ 1430 /* destroy iovas */
1400 put_iova_domain(&domain->iovad); 1431 put_iova_domain(&domain->iovad);
1401 end = DOMAIN_MAX_ADDR(domain->gaw);
1402 end = end & (~PAGE_MASK);
1403 1432
1404 /* clear ptes */ 1433 /* clear ptes */
1405 dma_pte_clear_range(domain, 0, end); 1434 dma_pte_clear_range(domain, 0, DOMAIN_MAX_PFN(domain->gaw));
1406 1435
1407 /* free page tables */ 1436 /* free page tables */
1408 dma_pte_free_pagetable(domain, 0, end); 1437 dma_pte_free_pagetable(domain, 0, DOMAIN_MAX_PFN(domain->gaw));
1409 1438
1410 for_each_active_iommu(iommu, drhd) 1439 for_each_active_iommu(iommu, drhd)
1411 if (test_bit(iommu->seq_id, &domain->iommu_bmp)) 1440 if (test_bit(iommu->seq_id, &domain->iommu_bmp))
@@ -1476,7 +1505,6 @@ static int domain_context_mapping_one(struct dmar_domain *domain, int segment,
1476 } 1505 }
1477 1506
1478 set_bit(num, iommu->domain_ids); 1507 set_bit(num, iommu->domain_ids);
1479 set_bit(iommu->seq_id, &domain->iommu_bmp);
1480 iommu->domains[num] = domain; 1508 iommu->domains[num] = domain;
1481 id = num; 1509 id = num;
1482 } 1510 }
@@ -1619,42 +1647,94 @@ static int domain_context_mapped(struct pci_dev *pdev)
1619 tmp->devfn); 1647 tmp->devfn);
1620} 1648}
1621 1649
1622static int 1650/* Returns a number of VTD pages, but aligned to MM page size */
1623domain_page_mapping(struct dmar_domain *domain, dma_addr_t iova, 1651static inline unsigned long aligned_nrpages(unsigned long host_addr,
1624 u64 hpa, size_t size, int prot) 1652 size_t size)
1625{ 1653{
1626 u64 start_pfn, end_pfn; 1654 host_addr &= ~PAGE_MASK;
1627 struct dma_pte *pte; 1655 return PAGE_ALIGN(host_addr + size) >> VTD_PAGE_SHIFT;
1628 int index; 1656}
1629 int addr_width = agaw_to_width(domain->agaw);
1630 1657
1631 hpa &= (((u64)1) << addr_width) - 1; 1658static int __domain_mapping(struct dmar_domain *domain, unsigned long iov_pfn,
1659 struct scatterlist *sg, unsigned long phys_pfn,
1660 unsigned long nr_pages, int prot)
1661{
1662 struct dma_pte *first_pte = NULL, *pte = NULL;
1663 phys_addr_t uninitialized_var(pteval);
1664 int addr_width = agaw_to_width(domain->agaw) - VTD_PAGE_SHIFT;
1665 unsigned long sg_res;
1666
1667 BUG_ON(addr_width < BITS_PER_LONG && (iov_pfn + nr_pages - 1) >> addr_width);
1632 1668
1633 if ((prot & (DMA_PTE_READ|DMA_PTE_WRITE)) == 0) 1669 if ((prot & (DMA_PTE_READ|DMA_PTE_WRITE)) == 0)
1634 return -EINVAL; 1670 return -EINVAL;
1635 iova &= PAGE_MASK; 1671
1636 start_pfn = ((u64)hpa) >> VTD_PAGE_SHIFT; 1672 prot &= DMA_PTE_READ | DMA_PTE_WRITE | DMA_PTE_SNP;
1637 end_pfn = (VTD_PAGE_ALIGN(((u64)hpa) + size)) >> VTD_PAGE_SHIFT; 1673
1638 index = 0; 1674 if (sg)
1639 while (start_pfn < end_pfn) { 1675 sg_res = 0;
1640 pte = addr_to_dma_pte(domain, iova + VTD_PAGE_SIZE * index); 1676 else {
1641 if (!pte) 1677 sg_res = nr_pages + 1;
1642 return -ENOMEM; 1678 pteval = ((phys_addr_t)phys_pfn << VTD_PAGE_SHIFT) | prot;
1679 }
1680
1681 while (nr_pages--) {
1682 uint64_t tmp;
1683
1684 if (!sg_res) {
1685 sg_res = aligned_nrpages(sg->offset, sg->length);
1686 sg->dma_address = ((dma_addr_t)iov_pfn << VTD_PAGE_SHIFT) + sg->offset;
1687 sg->dma_length = sg->length;
1688 pteval = page_to_phys(sg_page(sg)) | prot;
1689 }
1690 if (!pte) {
1691 first_pte = pte = pfn_to_dma_pte(domain, iov_pfn);
1692 if (!pte)
1693 return -ENOMEM;
1694 }
1643 /* We don't need lock here, nobody else 1695 /* We don't need lock here, nobody else
1644 * touches the iova range 1696 * touches the iova range
1645 */ 1697 */
1646 BUG_ON(dma_pte_addr(pte)); 1698 tmp = cmpxchg64_local(&pte->val, 0ULL, pteval);
1647 dma_set_pte_addr(pte, start_pfn << VTD_PAGE_SHIFT); 1699 if (tmp) {
1648 dma_set_pte_prot(pte, prot); 1700 static int dumps = 5;
1649 if (prot & DMA_PTE_SNP) 1701 printk(KERN_CRIT "ERROR: DMA PTE for vPFN 0x%lx already set (to %llx not %llx)\n",
1650 dma_set_pte_snp(pte); 1702 iov_pfn, tmp, (unsigned long long)pteval);
1651 domain_flush_cache(domain, pte, sizeof(*pte)); 1703 if (dumps) {
1652 start_pfn++; 1704 dumps--;
1653 index++; 1705 debug_dma_dump_mappings(NULL);
1706 }
1707 WARN_ON(1);
1708 }
1709 pte++;
1710 if (!nr_pages || first_pte_in_page(pte)) {
1711 domain_flush_cache(domain, first_pte,
1712 (void *)pte - (void *)first_pte);
1713 pte = NULL;
1714 }
1715 iov_pfn++;
1716 pteval += VTD_PAGE_SIZE;
1717 sg_res--;
1718 if (!sg_res)
1719 sg = sg_next(sg);
1654 } 1720 }
1655 return 0; 1721 return 0;
1656} 1722}
1657 1723
1724static inline int domain_sg_mapping(struct dmar_domain *domain, unsigned long iov_pfn,
1725 struct scatterlist *sg, unsigned long nr_pages,
1726 int prot)
1727{
1728 return __domain_mapping(domain, iov_pfn, sg, 0, nr_pages, prot);
1729}
1730
1731static inline int domain_pfn_mapping(struct dmar_domain *domain, unsigned long iov_pfn,
1732 unsigned long phys_pfn, unsigned long nr_pages,
1733 int prot)
1734{
1735 return __domain_mapping(domain, iov_pfn, NULL, phys_pfn, nr_pages, prot);
1736}
1737
1658static void iommu_detach_dev(struct intel_iommu *iommu, u8 bus, u8 devfn) 1738static void iommu_detach_dev(struct intel_iommu *iommu, u8 bus, u8 devfn)
1659{ 1739{
1660 if (!iommu) 1740 if (!iommu)
@@ -1845,58 +1925,61 @@ error:
1845 1925
1846static int iommu_identity_mapping; 1926static int iommu_identity_mapping;
1847 1927
1928static int iommu_domain_identity_map(struct dmar_domain *domain,
1929 unsigned long long start,
1930 unsigned long long end)
1931{
1932 unsigned long first_vpfn = start >> VTD_PAGE_SHIFT;
1933 unsigned long last_vpfn = end >> VTD_PAGE_SHIFT;
1934
1935 if (!reserve_iova(&domain->iovad, dma_to_mm_pfn(first_vpfn),
1936 dma_to_mm_pfn(last_vpfn))) {
1937 printk(KERN_ERR "IOMMU: reserve iova failed\n");
1938 return -ENOMEM;
1939 }
1940
1941 pr_debug("Mapping reserved region %llx-%llx for domain %d\n",
1942 start, end, domain->id);
1943 /*
1944 * RMRR range might have overlap with physical memory range,
1945 * clear it first
1946 */
1947 dma_pte_clear_range(domain, first_vpfn, last_vpfn);
1948
1949 return domain_pfn_mapping(domain, first_vpfn, first_vpfn,
1950 last_vpfn - first_vpfn + 1,
1951 DMA_PTE_READ|DMA_PTE_WRITE);
1952}
1953
1848static int iommu_prepare_identity_map(struct pci_dev *pdev, 1954static int iommu_prepare_identity_map(struct pci_dev *pdev,
1849 unsigned long long start, 1955 unsigned long long start,
1850 unsigned long long end) 1956 unsigned long long end)
1851{ 1957{
1852 struct dmar_domain *domain; 1958 struct dmar_domain *domain;
1853 unsigned long size;
1854 unsigned long long base;
1855 int ret; 1959 int ret;
1856 1960
1857 printk(KERN_INFO 1961 printk(KERN_INFO
1858 "IOMMU: Setting identity map for device %s [0x%Lx - 0x%Lx]\n", 1962 "IOMMU: Setting identity map for device %s [0x%Lx - 0x%Lx]\n",
1859 pci_name(pdev), start, end); 1963 pci_name(pdev), start, end);
1860 if (iommu_identity_mapping) 1964
1861 domain = si_domain; 1965 domain = get_domain_for_dev(pdev, DEFAULT_DOMAIN_ADDRESS_WIDTH);
1862 else
1863 /* page table init */
1864 domain = get_domain_for_dev(pdev, DEFAULT_DOMAIN_ADDRESS_WIDTH);
1865 if (!domain) 1966 if (!domain)
1866 return -ENOMEM; 1967 return -ENOMEM;
1867 1968
1868 /* The address might not be aligned */ 1969 ret = iommu_domain_identity_map(domain, start, end);
1869 base = start & PAGE_MASK;
1870 size = end - base;
1871 size = PAGE_ALIGN(size);
1872 if (!reserve_iova(&domain->iovad, IOVA_PFN(base),
1873 IOVA_PFN(base + size) - 1)) {
1874 printk(KERN_ERR "IOMMU: reserve iova failed\n");
1875 ret = -ENOMEM;
1876 goto error;
1877 }
1878
1879 pr_debug("Mapping reserved region %lx@%llx for %s\n",
1880 size, base, pci_name(pdev));
1881 /*
1882 * RMRR range might have overlap with physical memory range,
1883 * clear it first
1884 */
1885 dma_pte_clear_range(domain, base, base + size);
1886
1887 ret = domain_page_mapping(domain, base, base, size,
1888 DMA_PTE_READ|DMA_PTE_WRITE);
1889 if (ret) 1970 if (ret)
1890 goto error; 1971 goto error;
1891 1972
1892 /* context entry init */ 1973 /* context entry init */
1893 ret = domain_context_mapping(domain, pdev, CONTEXT_TT_MULTI_LEVEL); 1974 ret = domain_context_mapping(domain, pdev, CONTEXT_TT_MULTI_LEVEL);
1894 if (!ret) 1975 if (ret)
1895 return 0; 1976 goto error;
1896error: 1977
1978 return 0;
1979
1980 error:
1897 domain_exit(domain); 1981 domain_exit(domain);
1898 return ret; 1982 return ret;
1899
1900} 1983}
1901 1984
1902static inline int iommu_prepare_rmrr_dev(struct dmar_rmrr_unit *rmrr, 1985static inline int iommu_prepare_rmrr_dev(struct dmar_rmrr_unit *rmrr,
@@ -1908,64 +1991,6 @@ static inline int iommu_prepare_rmrr_dev(struct dmar_rmrr_unit *rmrr,
1908 rmrr->end_address + 1); 1991 rmrr->end_address + 1);
1909} 1992}
1910 1993
1911#ifdef CONFIG_DMAR_GFX_WA
1912struct iommu_prepare_data {
1913 struct pci_dev *pdev;
1914 int ret;
1915};
1916
1917static int __init iommu_prepare_work_fn(unsigned long start_pfn,
1918 unsigned long end_pfn, void *datax)
1919{
1920 struct iommu_prepare_data *data;
1921
1922 data = (struct iommu_prepare_data *)datax;
1923
1924 data->ret = iommu_prepare_identity_map(data->pdev,
1925 start_pfn<<PAGE_SHIFT, end_pfn<<PAGE_SHIFT);
1926 return data->ret;
1927
1928}
1929
1930static int __init iommu_prepare_with_active_regions(struct pci_dev *pdev)
1931{
1932 int nid;
1933 struct iommu_prepare_data data;
1934
1935 data.pdev = pdev;
1936 data.ret = 0;
1937
1938 for_each_online_node(nid) {
1939 work_with_active_regions(nid, iommu_prepare_work_fn, &data);
1940 if (data.ret)
1941 return data.ret;
1942 }
1943 return data.ret;
1944}
1945
1946static void __init iommu_prepare_gfx_mapping(void)
1947{
1948 struct pci_dev *pdev = NULL;
1949 int ret;
1950
1951 for_each_pci_dev(pdev) {
1952 if (pdev->dev.archdata.iommu == DUMMY_DEVICE_DOMAIN_INFO ||
1953 !IS_GFX_DEVICE(pdev))
1954 continue;
1955 printk(KERN_INFO "IOMMU: gfx device %s 1-1 mapping\n",
1956 pci_name(pdev));
1957 ret = iommu_prepare_with_active_regions(pdev);
1958 if (ret)
1959 printk(KERN_ERR "IOMMU: mapping reserved region failed\n");
1960 }
1961}
1962#else /* !CONFIG_DMAR_GFX_WA */
1963static inline void iommu_prepare_gfx_mapping(void)
1964{
1965 return;
1966}
1967#endif
1968
1969#ifdef CONFIG_DMAR_FLOPPY_WA 1994#ifdef CONFIG_DMAR_FLOPPY_WA
1970static inline void iommu_prepare_isa(void) 1995static inline void iommu_prepare_isa(void)
1971{ 1996{
@@ -1976,12 +2001,12 @@ static inline void iommu_prepare_isa(void)
1976 if (!pdev) 2001 if (!pdev)
1977 return; 2002 return;
1978 2003
1979 printk(KERN_INFO "IOMMU: Prepare 0-16M unity mapping for LPC\n"); 2004 printk(KERN_INFO "IOMMU: Prepare 0-16MiB unity mapping for LPC\n");
1980 ret = iommu_prepare_identity_map(pdev, 0, 16*1024*1024); 2005 ret = iommu_prepare_identity_map(pdev, 0, 16*1024*1024);
1981 2006
1982 if (ret) 2007 if (ret)
1983 printk(KERN_ERR "IOMMU: Failed to create 0-64M identity map, " 2008 printk(KERN_ERR "IOMMU: Failed to create 0-16MiB identity map; "
1984 "floppy might not work\n"); 2009 "floppy might not work\n");
1985 2010
1986} 2011}
1987#else 2012#else
@@ -2009,16 +2034,30 @@ static int __init init_context_pass_through(void)
2009} 2034}
2010 2035
2011static int md_domain_init(struct dmar_domain *domain, int guest_width); 2036static int md_domain_init(struct dmar_domain *domain, int guest_width);
2037
2038static int __init si_domain_work_fn(unsigned long start_pfn,
2039 unsigned long end_pfn, void *datax)
2040{
2041 int *ret = datax;
2042
2043 *ret = iommu_domain_identity_map(si_domain,
2044 (uint64_t)start_pfn << PAGE_SHIFT,
2045 (uint64_t)end_pfn << PAGE_SHIFT);
2046 return *ret;
2047
2048}
2049
2012static int si_domain_init(void) 2050static int si_domain_init(void)
2013{ 2051{
2014 struct dmar_drhd_unit *drhd; 2052 struct dmar_drhd_unit *drhd;
2015 struct intel_iommu *iommu; 2053 struct intel_iommu *iommu;
2016 int ret = 0; 2054 int nid, ret = 0;
2017 2055
2018 si_domain = alloc_domain(); 2056 si_domain = alloc_domain();
2019 if (!si_domain) 2057 if (!si_domain)
2020 return -EFAULT; 2058 return -EFAULT;
2021 2059
2060 pr_debug("Identity mapping domain is domain %d\n", si_domain->id);
2022 2061
2023 for_each_active_iommu(iommu, drhd) { 2062 for_each_active_iommu(iommu, drhd) {
2024 ret = iommu_attach_domain(si_domain, iommu); 2063 ret = iommu_attach_domain(si_domain, iommu);
@@ -2035,6 +2074,12 @@ static int si_domain_init(void)
2035 2074
2036 si_domain->flags = DOMAIN_FLAG_STATIC_IDENTITY; 2075 si_domain->flags = DOMAIN_FLAG_STATIC_IDENTITY;
2037 2076
2077 for_each_online_node(nid) {
2078 work_with_active_regions(nid, si_domain_work_fn, &ret);
2079 if (ret)
2080 return ret;
2081 }
2082
2038 return 0; 2083 return 0;
2039} 2084}
2040 2085
@@ -2079,9 +2124,49 @@ static int domain_add_dev_info(struct dmar_domain *domain,
2079 return 0; 2124 return 0;
2080} 2125}
2081 2126
2127static int iommu_should_identity_map(struct pci_dev *pdev, int startup)
2128{
2129 if (iommu_identity_mapping == 2)
2130 return IS_GFX_DEVICE(pdev);
2131
2132 /*
2133 * We want to start off with all devices in the 1:1 domain, and
2134 * take them out later if we find they can't access all of memory.
2135 *
2136 * However, we can't do this for PCI devices behind bridges,
2137 * because all PCI devices behind the same bridge will end up
2138 * with the same source-id on their transactions.
2139 *
2140 * Practically speaking, we can't change things around for these
2141 * devices at run-time, because we can't be sure there'll be no
2142 * DMA transactions in flight for any of their siblings.
2143 *
2144 * So PCI devices (unless they're on the root bus) as well as
2145 * their parent PCI-PCI or PCIe-PCI bridges must be left _out_ of
2146 * the 1:1 domain, just in _case_ one of their siblings turns out
2147 * not to be able to map all of memory.
2148 */
2149 if (!pdev->is_pcie) {
2150 if (!pci_is_root_bus(pdev->bus))
2151 return 0;
2152 if (pdev->class >> 8 == PCI_CLASS_BRIDGE_PCI)
2153 return 0;
2154 } else if (pdev->pcie_type == PCI_EXP_TYPE_PCI_BRIDGE)
2155 return 0;
2156
2157 /*
2158 * At boot time, we don't yet know if devices will be 64-bit capable.
2159 * Assume that they will -- if they turn out not to be, then we can
2160 * take them out of the 1:1 domain later.
2161 */
2162 if (!startup)
2163 return pdev->dma_mask > DMA_BIT_MASK(32);
2164
2165 return 1;
2166}
2167
2082static int iommu_prepare_static_identity_mapping(void) 2168static int iommu_prepare_static_identity_mapping(void)
2083{ 2169{
2084 int i;
2085 struct pci_dev *pdev = NULL; 2170 struct pci_dev *pdev = NULL;
2086 int ret; 2171 int ret;
2087 2172
@@ -2089,23 +2174,19 @@ static int iommu_prepare_static_identity_mapping(void)
2089 if (ret) 2174 if (ret)
2090 return -EFAULT; 2175 return -EFAULT;
2091 2176
2092 printk(KERN_INFO "IOMMU: Setting identity map:\n");
2093 for_each_pci_dev(pdev) { 2177 for_each_pci_dev(pdev) {
2094 for (i = 0; i < e820.nr_map; i++) { 2178 if (iommu_should_identity_map(pdev, 1)) {
2095 struct e820entry *ei = &e820.map[i]; 2179 printk(KERN_INFO "IOMMU: identity mapping for device %s\n",
2096 2180 pci_name(pdev));
2097 if (ei->type == E820_RAM) { 2181
2098 ret = iommu_prepare_identity_map(pdev, 2182 ret = domain_context_mapping(si_domain, pdev,
2099 ei->addr, ei->addr + ei->size); 2183 CONTEXT_TT_MULTI_LEVEL);
2100 if (ret) { 2184 if (ret)
2101 printk(KERN_INFO "1:1 mapping to one domain failed.\n"); 2185 return ret;
2102 return -EFAULT; 2186 ret = domain_add_dev_info(si_domain, pdev);
2103 } 2187 if (ret)
2104 } 2188 return ret;
2105 } 2189 }
2106 ret = domain_add_dev_info(si_domain, pdev);
2107 if (ret)
2108 return ret;
2109 } 2190 }
2110 2191
2111 return 0; 2192 return 0;
@@ -2260,6 +2341,10 @@ int __init init_dmars(void)
2260 * identity mapping if iommu_identity_mapping is set. 2341 * identity mapping if iommu_identity_mapping is set.
2261 */ 2342 */
2262 if (!iommu_pass_through) { 2343 if (!iommu_pass_through) {
2344#ifdef CONFIG_DMAR_BROKEN_GFX_WA
2345 if (!iommu_identity_mapping)
2346 iommu_identity_mapping = 2;
2347#endif
2263 if (iommu_identity_mapping) 2348 if (iommu_identity_mapping)
2264 iommu_prepare_static_identity_mapping(); 2349 iommu_prepare_static_identity_mapping();
2265 /* 2350 /*
@@ -2293,8 +2378,6 @@ int __init init_dmars(void)
2293 } 2378 }
2294 } 2379 }
2295 2380
2296 iommu_prepare_gfx_mapping();
2297
2298 iommu_prepare_isa(); 2381 iommu_prepare_isa();
2299 } 2382 }
2300 2383
@@ -2339,50 +2422,32 @@ error:
2339 return ret; 2422 return ret;
2340} 2423}
2341 2424
2342static inline u64 aligned_size(u64 host_addr, size_t size) 2425/* This takes a number of _MM_ pages, not VTD pages */
2343{ 2426static struct iova *intel_alloc_iova(struct device *dev,
2344 u64 addr; 2427 struct dmar_domain *domain,
2345 addr = (host_addr & (~PAGE_MASK)) + size; 2428 unsigned long nrpages, uint64_t dma_mask)
2346 return PAGE_ALIGN(addr);
2347}
2348
2349struct iova *
2350iommu_alloc_iova(struct dmar_domain *domain, size_t size, u64 end)
2351{
2352 struct iova *piova;
2353
2354 /* Make sure it's in range */
2355 end = min_t(u64, DOMAIN_MAX_ADDR(domain->gaw), end);
2356 if (!size || (IOVA_START_ADDR + size > end))
2357 return NULL;
2358
2359 piova = alloc_iova(&domain->iovad,
2360 size >> PAGE_SHIFT, IOVA_PFN(end), 1);
2361 return piova;
2362}
2363
2364static struct iova *
2365__intel_alloc_iova(struct device *dev, struct dmar_domain *domain,
2366 size_t size, u64 dma_mask)
2367{ 2429{
2368 struct pci_dev *pdev = to_pci_dev(dev); 2430 struct pci_dev *pdev = to_pci_dev(dev);
2369 struct iova *iova = NULL; 2431 struct iova *iova = NULL;
2370 2432
2371 if (dma_mask <= DMA_BIT_MASK(32) || dmar_forcedac) 2433 /* Restrict dma_mask to the width that the iommu can handle */
2372 iova = iommu_alloc_iova(domain, size, dma_mask); 2434 dma_mask = min_t(uint64_t, DOMAIN_MAX_ADDR(domain->gaw), dma_mask);
2373 else { 2435
2436 if (!dmar_forcedac && dma_mask > DMA_BIT_MASK(32)) {
2374 /* 2437 /*
2375 * First try to allocate an io virtual address in 2438 * First try to allocate an io virtual address in
2376 * DMA_BIT_MASK(32) and if that fails then try allocating 2439 * DMA_BIT_MASK(32) and if that fails then try allocating
2377 * from higher range 2440 * from higher range
2378 */ 2441 */
2379 iova = iommu_alloc_iova(domain, size, DMA_BIT_MASK(32)); 2442 iova = alloc_iova(&domain->iovad, nrpages,
2380 if (!iova) 2443 IOVA_PFN(DMA_BIT_MASK(32)), 1);
2381 iova = iommu_alloc_iova(domain, size, dma_mask); 2444 if (iova)
2382 } 2445 return iova;
2383 2446 }
2384 if (!iova) { 2447 iova = alloc_iova(&domain->iovad, nrpages, IOVA_PFN(dma_mask), 1);
2385 printk(KERN_ERR"Allocating iova for %s failed", pci_name(pdev)); 2448 if (unlikely(!iova)) {
2449 printk(KERN_ERR "Allocating %ld-page iova for %s failed",
2450 nrpages, pci_name(pdev));
2386 return NULL; 2451 return NULL;
2387 } 2452 }
2388 2453
@@ -2424,16 +2489,24 @@ static int iommu_dummy(struct pci_dev *pdev)
2424} 2489}
2425 2490
2426/* Check if the pdev needs to go through non-identity map and unmap process.*/ 2491/* Check if the pdev needs to go through non-identity map and unmap process.*/
2427static int iommu_no_mapping(struct pci_dev *pdev) 2492static int iommu_no_mapping(struct device *dev)
2428{ 2493{
2494 struct pci_dev *pdev;
2429 int found; 2495 int found;
2430 2496
2497 if (unlikely(dev->bus != &pci_bus_type))
2498 return 1;
2499
2500 pdev = to_pci_dev(dev);
2501 if (iommu_dummy(pdev))
2502 return 1;
2503
2431 if (!iommu_identity_mapping) 2504 if (!iommu_identity_mapping)
2432 return iommu_dummy(pdev); 2505 return 0;
2433 2506
2434 found = identity_mapping(pdev); 2507 found = identity_mapping(pdev);
2435 if (found) { 2508 if (found) {
2436 if (pdev->dma_mask > DMA_BIT_MASK(32)) 2509 if (iommu_should_identity_map(pdev, 0))
2437 return 1; 2510 return 1;
2438 else { 2511 else {
2439 /* 2512 /*
@@ -2450,9 +2523,12 @@ static int iommu_no_mapping(struct pci_dev *pdev)
2450 * In case of a detached 64 bit DMA device from vm, the device 2523 * In case of a detached 64 bit DMA device from vm, the device
2451 * is put into si_domain for identity mapping. 2524 * is put into si_domain for identity mapping.
2452 */ 2525 */
2453 if (pdev->dma_mask > DMA_BIT_MASK(32)) { 2526 if (iommu_should_identity_map(pdev, 0)) {
2454 int ret; 2527 int ret;
2455 ret = domain_add_dev_info(si_domain, pdev); 2528 ret = domain_add_dev_info(si_domain, pdev);
2529 if (ret)
2530 return 0;
2531 ret = domain_context_mapping(si_domain, pdev, CONTEXT_TT_MULTI_LEVEL);
2456 if (!ret) { 2532 if (!ret) {
2457 printk(KERN_INFO "64bit %s uses identity mapping\n", 2533 printk(KERN_INFO "64bit %s uses identity mapping\n",
2458 pci_name(pdev)); 2534 pci_name(pdev));
@@ -2461,7 +2537,7 @@ static int iommu_no_mapping(struct pci_dev *pdev)
2461 } 2537 }
2462 } 2538 }
2463 2539
2464 return iommu_dummy(pdev); 2540 return 0;
2465} 2541}
2466 2542
2467static dma_addr_t __intel_map_single(struct device *hwdev, phys_addr_t paddr, 2543static dma_addr_t __intel_map_single(struct device *hwdev, phys_addr_t paddr,
@@ -2474,10 +2550,11 @@ static dma_addr_t __intel_map_single(struct device *hwdev, phys_addr_t paddr,
2474 int prot = 0; 2550 int prot = 0;
2475 int ret; 2551 int ret;
2476 struct intel_iommu *iommu; 2552 struct intel_iommu *iommu;
2553 unsigned long paddr_pfn = paddr >> PAGE_SHIFT;
2477 2554
2478 BUG_ON(dir == DMA_NONE); 2555 BUG_ON(dir == DMA_NONE);
2479 2556
2480 if (iommu_no_mapping(pdev)) 2557 if (iommu_no_mapping(hwdev))
2481 return paddr; 2558 return paddr;
2482 2559
2483 domain = get_valid_domain_for_dev(pdev); 2560 domain = get_valid_domain_for_dev(pdev);
@@ -2485,14 +2562,13 @@ static dma_addr_t __intel_map_single(struct device *hwdev, phys_addr_t paddr,
2485 return 0; 2562 return 0;
2486 2563
2487 iommu = domain_get_iommu(domain); 2564 iommu = domain_get_iommu(domain);
2488 size = aligned_size((u64)paddr, size); 2565 size = aligned_nrpages(paddr, size);
2489 2566
2490 iova = __intel_alloc_iova(hwdev, domain, size, pdev->dma_mask); 2567 iova = intel_alloc_iova(hwdev, domain, dma_to_mm_pfn(size),
2568 pdev->dma_mask);
2491 if (!iova) 2569 if (!iova)
2492 goto error; 2570 goto error;
2493 2571
2494 start_paddr = (phys_addr_t)iova->pfn_lo << PAGE_SHIFT;
2495
2496 /* 2572 /*
2497 * Check if DMAR supports zero-length reads on write only 2573 * Check if DMAR supports zero-length reads on write only
2498 * mappings.. 2574 * mappings..
@@ -2508,20 +2584,20 @@ static dma_addr_t __intel_map_single(struct device *hwdev, phys_addr_t paddr,
2508 * might have two guest_addr mapping to the same host paddr, but this 2584 * might have two guest_addr mapping to the same host paddr, but this
2509 * is not a big problem 2585 * is not a big problem
2510 */ 2586 */
2511 ret = domain_page_mapping(domain, start_paddr, 2587 ret = domain_pfn_mapping(domain, mm_to_dma_pfn(iova->pfn_lo),
2512 ((u64)paddr) & PHYSICAL_PAGE_MASK, 2588 mm_to_dma_pfn(paddr_pfn), size, prot);
2513 size, prot);
2514 if (ret) 2589 if (ret)
2515 goto error; 2590 goto error;
2516 2591
2517 /* it's a non-present to present mapping. Only flush if caching mode */ 2592 /* it's a non-present to present mapping. Only flush if caching mode */
2518 if (cap_caching_mode(iommu->cap)) 2593 if (cap_caching_mode(iommu->cap))
2519 iommu_flush_iotlb_psi(iommu, 0, start_paddr, 2594 iommu_flush_iotlb_psi(iommu, 0, mm_to_dma_pfn(iova->pfn_lo), size);
2520 size >> VTD_PAGE_SHIFT);
2521 else 2595 else
2522 iommu_flush_write_buffer(iommu); 2596 iommu_flush_write_buffer(iommu);
2523 2597
2524 return start_paddr + ((u64)paddr & (~PAGE_MASK)); 2598 start_paddr = (phys_addr_t)iova->pfn_lo << PAGE_SHIFT;
2599 start_paddr += paddr & ~PAGE_MASK;
2600 return start_paddr;
2525 2601
2526error: 2602error:
2527 if (iova) 2603 if (iova)
@@ -2614,11 +2690,11 @@ static void intel_unmap_page(struct device *dev, dma_addr_t dev_addr,
2614{ 2690{
2615 struct pci_dev *pdev = to_pci_dev(dev); 2691 struct pci_dev *pdev = to_pci_dev(dev);
2616 struct dmar_domain *domain; 2692 struct dmar_domain *domain;
2617 unsigned long start_addr; 2693 unsigned long start_pfn, last_pfn;
2618 struct iova *iova; 2694 struct iova *iova;
2619 struct intel_iommu *iommu; 2695 struct intel_iommu *iommu;
2620 2696
2621 if (iommu_no_mapping(pdev)) 2697 if (iommu_no_mapping(dev))
2622 return; 2698 return;
2623 2699
2624 domain = find_domain(pdev); 2700 domain = find_domain(pdev);
@@ -2627,22 +2703,25 @@ static void intel_unmap_page(struct device *dev, dma_addr_t dev_addr,
2627 iommu = domain_get_iommu(domain); 2703 iommu = domain_get_iommu(domain);
2628 2704
2629 iova = find_iova(&domain->iovad, IOVA_PFN(dev_addr)); 2705 iova = find_iova(&domain->iovad, IOVA_PFN(dev_addr));
2630 if (!iova) 2706 if (WARN_ONCE(!iova, "Driver unmaps unmatched page at PFN %llx\n",
2707 (unsigned long long)dev_addr))
2631 return; 2708 return;
2632 2709
2633 start_addr = iova->pfn_lo << PAGE_SHIFT; 2710 start_pfn = mm_to_dma_pfn(iova->pfn_lo);
2634 size = aligned_size((u64)dev_addr, size); 2711 last_pfn = mm_to_dma_pfn(iova->pfn_hi + 1) - 1;
2635 2712
2636 pr_debug("Device %s unmapping: %zx@%llx\n", 2713 pr_debug("Device %s unmapping: pfn %lx-%lx\n",
2637 pci_name(pdev), size, (unsigned long long)start_addr); 2714 pci_name(pdev), start_pfn, last_pfn);
2638 2715
2639 /* clear the whole page */ 2716 /* clear the whole page */
2640 dma_pte_clear_range(domain, start_addr, start_addr + size); 2717 dma_pte_clear_range(domain, start_pfn, last_pfn);
2718
2641 /* free page tables */ 2719 /* free page tables */
2642 dma_pte_free_pagetable(domain, start_addr, start_addr + size); 2720 dma_pte_free_pagetable(domain, start_pfn, last_pfn);
2721
2643 if (intel_iommu_strict) { 2722 if (intel_iommu_strict) {
2644 iommu_flush_iotlb_psi(iommu, domain->id, start_addr, 2723 iommu_flush_iotlb_psi(iommu, domain->id, start_pfn,
2645 size >> VTD_PAGE_SHIFT); 2724 last_pfn - start_pfn + 1);
2646 /* free iova */ 2725 /* free iova */
2647 __free_iova(&domain->iovad, iova); 2726 __free_iova(&domain->iovad, iova);
2648 } else { 2727 } else {
@@ -2700,17 +2779,13 @@ static void intel_unmap_sg(struct device *hwdev, struct scatterlist *sglist,
2700 int nelems, enum dma_data_direction dir, 2779 int nelems, enum dma_data_direction dir,
2701 struct dma_attrs *attrs) 2780 struct dma_attrs *attrs)
2702{ 2781{
2703 int i;
2704 struct pci_dev *pdev = to_pci_dev(hwdev); 2782 struct pci_dev *pdev = to_pci_dev(hwdev);
2705 struct dmar_domain *domain; 2783 struct dmar_domain *domain;
2706 unsigned long start_addr; 2784 unsigned long start_pfn, last_pfn;
2707 struct iova *iova; 2785 struct iova *iova;
2708 size_t size = 0;
2709 phys_addr_t addr;
2710 struct scatterlist *sg;
2711 struct intel_iommu *iommu; 2786 struct intel_iommu *iommu;
2712 2787
2713 if (iommu_no_mapping(pdev)) 2788 if (iommu_no_mapping(hwdev))
2714 return; 2789 return;
2715 2790
2716 domain = find_domain(pdev); 2791 domain = find_domain(pdev);
@@ -2719,22 +2794,21 @@ static void intel_unmap_sg(struct device *hwdev, struct scatterlist *sglist,
2719 iommu = domain_get_iommu(domain); 2794 iommu = domain_get_iommu(domain);
2720 2795
2721 iova = find_iova(&domain->iovad, IOVA_PFN(sglist[0].dma_address)); 2796 iova = find_iova(&domain->iovad, IOVA_PFN(sglist[0].dma_address));
2722 if (!iova) 2797 if (WARN_ONCE(!iova, "Driver unmaps unmatched sglist at PFN %llx\n",
2798 (unsigned long long)sglist[0].dma_address))
2723 return; 2799 return;
2724 for_each_sg(sglist, sg, nelems, i) {
2725 addr = page_to_phys(sg_page(sg)) + sg->offset;
2726 size += aligned_size((u64)addr, sg->length);
2727 }
2728 2800
2729 start_addr = iova->pfn_lo << PAGE_SHIFT; 2801 start_pfn = mm_to_dma_pfn(iova->pfn_lo);
2802 last_pfn = mm_to_dma_pfn(iova->pfn_hi + 1) - 1;
2730 2803
2731 /* clear the whole page */ 2804 /* clear the whole page */
2732 dma_pte_clear_range(domain, start_addr, start_addr + size); 2805 dma_pte_clear_range(domain, start_pfn, last_pfn);
2806
2733 /* free page tables */ 2807 /* free page tables */
2734 dma_pte_free_pagetable(domain, start_addr, start_addr + size); 2808 dma_pte_free_pagetable(domain, start_pfn, last_pfn);
2735 2809
2736 iommu_flush_iotlb_psi(iommu, domain->id, start_addr, 2810 iommu_flush_iotlb_psi(iommu, domain->id, start_pfn,
2737 size >> VTD_PAGE_SHIFT); 2811 (last_pfn - start_pfn + 1));
2738 2812
2739 /* free iova */ 2813 /* free iova */
2740 __free_iova(&domain->iovad, iova); 2814 __free_iova(&domain->iovad, iova);
@@ -2757,21 +2831,20 @@ static int intel_nontranslate_map_sg(struct device *hddev,
2757static int intel_map_sg(struct device *hwdev, struct scatterlist *sglist, int nelems, 2831static int intel_map_sg(struct device *hwdev, struct scatterlist *sglist, int nelems,
2758 enum dma_data_direction dir, struct dma_attrs *attrs) 2832 enum dma_data_direction dir, struct dma_attrs *attrs)
2759{ 2833{
2760 phys_addr_t addr;
2761 int i; 2834 int i;
2762 struct pci_dev *pdev = to_pci_dev(hwdev); 2835 struct pci_dev *pdev = to_pci_dev(hwdev);
2763 struct dmar_domain *domain; 2836 struct dmar_domain *domain;
2764 size_t size = 0; 2837 size_t size = 0;
2765 int prot = 0; 2838 int prot = 0;
2766 size_t offset = 0; 2839 size_t offset_pfn = 0;
2767 struct iova *iova = NULL; 2840 struct iova *iova = NULL;
2768 int ret; 2841 int ret;
2769 struct scatterlist *sg; 2842 struct scatterlist *sg;
2770 unsigned long start_addr; 2843 unsigned long start_vpfn;
2771 struct intel_iommu *iommu; 2844 struct intel_iommu *iommu;
2772 2845
2773 BUG_ON(dir == DMA_NONE); 2846 BUG_ON(dir == DMA_NONE);
2774 if (iommu_no_mapping(pdev)) 2847 if (iommu_no_mapping(hwdev))
2775 return intel_nontranslate_map_sg(hwdev, sglist, nelems, dir); 2848 return intel_nontranslate_map_sg(hwdev, sglist, nelems, dir);
2776 2849
2777 domain = get_valid_domain_for_dev(pdev); 2850 domain = get_valid_domain_for_dev(pdev);
@@ -2780,12 +2853,11 @@ static int intel_map_sg(struct device *hwdev, struct scatterlist *sglist, int ne
2780 2853
2781 iommu = domain_get_iommu(domain); 2854 iommu = domain_get_iommu(domain);
2782 2855
2783 for_each_sg(sglist, sg, nelems, i) { 2856 for_each_sg(sglist, sg, nelems, i)
2784 addr = page_to_phys(sg_page(sg)) + sg->offset; 2857 size += aligned_nrpages(sg->offset, sg->length);
2785 size += aligned_size((u64)addr, sg->length);
2786 }
2787 2858
2788 iova = __intel_alloc_iova(hwdev, domain, size, pdev->dma_mask); 2859 iova = intel_alloc_iova(hwdev, domain, dma_to_mm_pfn(size),
2860 pdev->dma_mask);
2789 if (!iova) { 2861 if (!iova) {
2790 sglist->dma_length = 0; 2862 sglist->dma_length = 0;
2791 return 0; 2863 return 0;
@@ -2801,35 +2873,24 @@ static int intel_map_sg(struct device *hwdev, struct scatterlist *sglist, int ne
2801 if (dir == DMA_FROM_DEVICE || dir == DMA_BIDIRECTIONAL) 2873 if (dir == DMA_FROM_DEVICE || dir == DMA_BIDIRECTIONAL)
2802 prot |= DMA_PTE_WRITE; 2874 prot |= DMA_PTE_WRITE;
2803 2875
2804 start_addr = iova->pfn_lo << PAGE_SHIFT; 2876 start_vpfn = mm_to_dma_pfn(iova->pfn_lo);
2805 offset = 0; 2877
2806 for_each_sg(sglist, sg, nelems, i) { 2878 ret = domain_sg_mapping(domain, start_vpfn, sglist, size, prot);
2807 addr = page_to_phys(sg_page(sg)) + sg->offset; 2879 if (unlikely(ret)) {
2808 size = aligned_size((u64)addr, sg->length); 2880 /* clear the page */
2809 ret = domain_page_mapping(domain, start_addr + offset, 2881 dma_pte_clear_range(domain, start_vpfn,
2810 ((u64)addr) & PHYSICAL_PAGE_MASK, 2882 start_vpfn + size - 1);
2811 size, prot); 2883 /* free page tables */
2812 if (ret) { 2884 dma_pte_free_pagetable(domain, start_vpfn,
2813 /* clear the page */ 2885 start_vpfn + size - 1);
2814 dma_pte_clear_range(domain, start_addr, 2886 /* free iova */
2815 start_addr + offset); 2887 __free_iova(&domain->iovad, iova);
2816 /* free page tables */ 2888 return 0;
2817 dma_pte_free_pagetable(domain, start_addr,
2818 start_addr + offset);
2819 /* free iova */
2820 __free_iova(&domain->iovad, iova);
2821 return 0;
2822 }
2823 sg->dma_address = start_addr + offset +
2824 ((u64)addr & (~PAGE_MASK));
2825 sg->dma_length = sg->length;
2826 offset += size;
2827 } 2889 }
2828 2890
2829 /* it's a non-present to present mapping. Only flush if caching mode */ 2891 /* it's a non-present to present mapping. Only flush if caching mode */
2830 if (cap_caching_mode(iommu->cap)) 2892 if (cap_caching_mode(iommu->cap))
2831 iommu_flush_iotlb_psi(iommu, 0, start_addr, 2893 iommu_flush_iotlb_psi(iommu, 0, start_vpfn, offset_pfn);
2832 offset >> VTD_PAGE_SHIFT);
2833 else 2894 else
2834 iommu_flush_write_buffer(iommu); 2895 iommu_flush_write_buffer(iommu);
2835 2896
@@ -3334,7 +3395,6 @@ static int md_domain_init(struct dmar_domain *domain, int guest_width)
3334 int adjust_width; 3395 int adjust_width;
3335 3396
3336 init_iova_domain(&domain->iovad, DMA_32BIT_PFN); 3397 init_iova_domain(&domain->iovad, DMA_32BIT_PFN);
3337 spin_lock_init(&domain->mapping_lock);
3338 spin_lock_init(&domain->iommu_lock); 3398 spin_lock_init(&domain->iommu_lock);
3339 3399
3340 domain_reserve_special_ranges(domain); 3400 domain_reserve_special_ranges(domain);
@@ -3348,6 +3408,7 @@ static int md_domain_init(struct dmar_domain *domain, int guest_width)
3348 3408
3349 domain->iommu_count = 0; 3409 domain->iommu_count = 0;
3350 domain->iommu_coherency = 0; 3410 domain->iommu_coherency = 0;
3411 domain->iommu_snooping = 0;
3351 domain->max_addr = 0; 3412 domain->max_addr = 0;
3352 3413
3353 /* always allocate the top pgd */ 3414 /* always allocate the top pgd */
@@ -3388,8 +3449,6 @@ static void iommu_free_vm_domain(struct dmar_domain *domain)
3388 3449
3389static void vm_domain_exit(struct dmar_domain *domain) 3450static void vm_domain_exit(struct dmar_domain *domain)
3390{ 3451{
3391 u64 end;
3392
3393 /* Domain 0 is reserved, so dont process it */ 3452 /* Domain 0 is reserved, so dont process it */
3394 if (!domain) 3453 if (!domain)
3395 return; 3454 return;
@@ -3397,14 +3456,12 @@ static void vm_domain_exit(struct dmar_domain *domain)
3397 vm_domain_remove_all_dev_info(domain); 3456 vm_domain_remove_all_dev_info(domain);
3398 /* destroy iovas */ 3457 /* destroy iovas */
3399 put_iova_domain(&domain->iovad); 3458 put_iova_domain(&domain->iovad);
3400 end = DOMAIN_MAX_ADDR(domain->gaw);
3401 end = end & (~VTD_PAGE_MASK);
3402 3459
3403 /* clear ptes */ 3460 /* clear ptes */
3404 dma_pte_clear_range(domain, 0, end); 3461 dma_pte_clear_range(domain, 0, DOMAIN_MAX_PFN(domain->gaw));
3405 3462
3406 /* free page tables */ 3463 /* free page tables */
3407 dma_pte_free_pagetable(domain, 0, end); 3464 dma_pte_free_pagetable(domain, 0, DOMAIN_MAX_PFN(domain->gaw));
3408 3465
3409 iommu_free_vm_domain(domain); 3466 iommu_free_vm_domain(domain);
3410 free_domain_mem(domain); 3467 free_domain_mem(domain);
@@ -3513,7 +3570,7 @@ static int intel_iommu_map_range(struct iommu_domain *domain,
3513 if ((iommu_prot & IOMMU_CACHE) && dmar_domain->iommu_snooping) 3570 if ((iommu_prot & IOMMU_CACHE) && dmar_domain->iommu_snooping)
3514 prot |= DMA_PTE_SNP; 3571 prot |= DMA_PTE_SNP;
3515 3572
3516 max_addr = (iova & VTD_PAGE_MASK) + VTD_PAGE_ALIGN(size); 3573 max_addr = iova + size;
3517 if (dmar_domain->max_addr < max_addr) { 3574 if (dmar_domain->max_addr < max_addr) {
3518 int min_agaw; 3575 int min_agaw;
3519 u64 end; 3576 u64 end;
@@ -3531,8 +3588,11 @@ static int intel_iommu_map_range(struct iommu_domain *domain,
3531 } 3588 }
3532 dmar_domain->max_addr = max_addr; 3589 dmar_domain->max_addr = max_addr;
3533 } 3590 }
3534 3591 /* Round up size to next multiple of PAGE_SIZE, if it and
3535 ret = domain_page_mapping(dmar_domain, iova, hpa, size, prot); 3592 the low bits of hpa would take us onto the next page */
3593 size = aligned_nrpages(hpa, size);
3594 ret = domain_pfn_mapping(dmar_domain, iova >> VTD_PAGE_SHIFT,
3595 hpa >> VTD_PAGE_SHIFT, size, prot);
3536 return ret; 3596 return ret;
3537} 3597}
3538 3598
@@ -3540,15 +3600,15 @@ static void intel_iommu_unmap_range(struct iommu_domain *domain,
3540 unsigned long iova, size_t size) 3600 unsigned long iova, size_t size)
3541{ 3601{
3542 struct dmar_domain *dmar_domain = domain->priv; 3602 struct dmar_domain *dmar_domain = domain->priv;
3543 dma_addr_t base;
3544 3603
3545 /* The address might not be aligned */ 3604 if (!size)
3546 base = iova & VTD_PAGE_MASK; 3605 return;
3547 size = VTD_PAGE_ALIGN(size); 3606
3548 dma_pte_clear_range(dmar_domain, base, base + size); 3607 dma_pte_clear_range(dmar_domain, iova >> VTD_PAGE_SHIFT,
3608 (iova + size - 1) >> VTD_PAGE_SHIFT);
3549 3609
3550 if (dmar_domain->max_addr == base + size) 3610 if (dmar_domain->max_addr == iova + size)
3551 dmar_domain->max_addr = base; 3611 dmar_domain->max_addr = iova;
3552} 3612}
3553 3613
3554static phys_addr_t intel_iommu_iova_to_phys(struct iommu_domain *domain, 3614static phys_addr_t intel_iommu_iova_to_phys(struct iommu_domain *domain,
@@ -3558,7 +3618,7 @@ static phys_addr_t intel_iommu_iova_to_phys(struct iommu_domain *domain,
3558 struct dma_pte *pte; 3618 struct dma_pte *pte;
3559 u64 phys = 0; 3619 u64 phys = 0;
3560 3620
3561 pte = addr_to_dma_pte(dmar_domain, iova); 3621 pte = pfn_to_dma_pte(dmar_domain, iova >> VTD_PAGE_SHIFT);
3562 if (pte) 3622 if (pte)
3563 phys = dma_pte_addr(pte); 3623 phys = dma_pte_addr(pte);
3564 3624
diff --git a/drivers/pci/iova.c b/drivers/pci/iova.c
index 2287116e9822..46dd440e2315 100644
--- a/drivers/pci/iova.c
+++ b/drivers/pci/iova.c
@@ -1,9 +1,19 @@
1/* 1/*
2 * Copyright (c) 2006, Intel Corporation. 2 * Copyright © 2006-2009, Intel Corporation.
3 * 3 *
4 * This file is released under the GPLv2. 4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms and conditions of the GNU General Public License,
6 * version 2, as 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 for
11 * more details.
12 *
13 * You should have received a copy of the GNU General Public License along with
14 * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
15 * Place - Suite 330, Boston, MA 02111-1307 USA.
5 * 16 *
6 * Copyright (C) 2006-2008 Intel Corporation
7 * Author: Anil S Keshavamurthy <anil.s.keshavamurthy@intel.com> 17 * Author: Anil S Keshavamurthy <anil.s.keshavamurthy@intel.com>
8 */ 18 */
9 19
@@ -123,7 +133,15 @@ move_left:
123 /* Insert the new_iova into domain rbtree by holding writer lock */ 133 /* Insert the new_iova into domain rbtree by holding writer lock */
124 /* Add new node and rebalance tree. */ 134 /* Add new node and rebalance tree. */
125 { 135 {
126 struct rb_node **entry = &((prev)), *parent = NULL; 136 struct rb_node **entry, *parent = NULL;
137
138 /* If we have 'prev', it's a valid place to start the
139 insertion. Otherwise, start from the root. */
140 if (prev)
141 entry = &prev;
142 else
143 entry = &iovad->rbroot.rb_node;
144
127 /* Figure out where to put new node */ 145 /* Figure out where to put new node */
128 while (*entry) { 146 while (*entry) {
129 struct iova *this = container_of(*entry, 147 struct iova *this = container_of(*entry,
diff --git a/drivers/pci/msi.c b/drivers/pci/msi.c
index d9f06fbfa0bf..d986afb7032b 100644
--- a/drivers/pci/msi.c
+++ b/drivers/pci/msi.c
@@ -127,17 +127,23 @@ static inline __attribute_const__ u32 msi_enabled_mask(u16 control)
127 * reliably as devices without an INTx disable bit will then generate a 127 * reliably as devices without an INTx disable bit will then generate a
128 * level IRQ which will never be cleared. 128 * level IRQ which will never be cleared.
129 */ 129 */
130static void msi_mask_irq(struct msi_desc *desc, u32 mask, u32 flag) 130static u32 __msi_mask_irq(struct msi_desc *desc, u32 mask, u32 flag)
131{ 131{
132 u32 mask_bits = desc->masked; 132 u32 mask_bits = desc->masked;
133 133
134 if (!desc->msi_attrib.maskbit) 134 if (!desc->msi_attrib.maskbit)
135 return; 135 return 0;
136 136
137 mask_bits &= ~mask; 137 mask_bits &= ~mask;
138 mask_bits |= flag; 138 mask_bits |= flag;
139 pci_write_config_dword(desc->dev, desc->mask_pos, mask_bits); 139 pci_write_config_dword(desc->dev, desc->mask_pos, mask_bits);
140 desc->masked = mask_bits; 140
141 return mask_bits;
142}
143
144static void msi_mask_irq(struct msi_desc *desc, u32 mask, u32 flag)
145{
146 desc->masked = __msi_mask_irq(desc, mask, flag);
141} 147}
142 148
143/* 149/*
@@ -147,15 +153,21 @@ static void msi_mask_irq(struct msi_desc *desc, u32 mask, u32 flag)
147 * file. This saves a few milliseconds when initialising devices with lots 153 * file. This saves a few milliseconds when initialising devices with lots
148 * of MSI-X interrupts. 154 * of MSI-X interrupts.
149 */ 155 */
150static void msix_mask_irq(struct msi_desc *desc, u32 flag) 156static u32 __msix_mask_irq(struct msi_desc *desc, u32 flag)
151{ 157{
152 u32 mask_bits = desc->masked; 158 u32 mask_bits = desc->masked;
153 unsigned offset = desc->msi_attrib.entry_nr * PCI_MSIX_ENTRY_SIZE + 159 unsigned offset = desc->msi_attrib.entry_nr * PCI_MSIX_ENTRY_SIZE +
154 PCI_MSIX_ENTRY_VECTOR_CTRL_OFFSET; 160 PCI_MSIX_ENTRY_VECTOR_CTRL;
155 mask_bits &= ~1; 161 mask_bits &= ~1;
156 mask_bits |= flag; 162 mask_bits |= flag;
157 writel(mask_bits, desc->mask_base + offset); 163 writel(mask_bits, desc->mask_base + offset);
158 desc->masked = mask_bits; 164
165 return mask_bits;
166}
167
168static void msix_mask_irq(struct msi_desc *desc, u32 flag)
169{
170 desc->masked = __msix_mask_irq(desc, flag);
159} 171}
160 172
161static void msi_set_mask_bit(unsigned irq, u32 flag) 173static void msi_set_mask_bit(unsigned irq, u32 flag)
@@ -188,9 +200,9 @@ void read_msi_msg_desc(struct irq_desc *desc, struct msi_msg *msg)
188 void __iomem *base = entry->mask_base + 200 void __iomem *base = entry->mask_base +
189 entry->msi_attrib.entry_nr * PCI_MSIX_ENTRY_SIZE; 201 entry->msi_attrib.entry_nr * PCI_MSIX_ENTRY_SIZE;
190 202
191 msg->address_lo = readl(base + PCI_MSIX_ENTRY_LOWER_ADDR_OFFSET); 203 msg->address_lo = readl(base + PCI_MSIX_ENTRY_LOWER_ADDR);
192 msg->address_hi = readl(base + PCI_MSIX_ENTRY_UPPER_ADDR_OFFSET); 204 msg->address_hi = readl(base + PCI_MSIX_ENTRY_UPPER_ADDR);
193 msg->data = readl(base + PCI_MSIX_ENTRY_DATA_OFFSET); 205 msg->data = readl(base + PCI_MSIX_ENTRY_DATA);
194 } else { 206 } else {
195 struct pci_dev *dev = entry->dev; 207 struct pci_dev *dev = entry->dev;
196 int pos = entry->msi_attrib.pos; 208 int pos = entry->msi_attrib.pos;
@@ -225,11 +237,9 @@ void write_msi_msg_desc(struct irq_desc *desc, struct msi_msg *msg)
225 base = entry->mask_base + 237 base = entry->mask_base +
226 entry->msi_attrib.entry_nr * PCI_MSIX_ENTRY_SIZE; 238 entry->msi_attrib.entry_nr * PCI_MSIX_ENTRY_SIZE;
227 239
228 writel(msg->address_lo, 240 writel(msg->address_lo, base + PCI_MSIX_ENTRY_LOWER_ADDR);
229 base + PCI_MSIX_ENTRY_LOWER_ADDR_OFFSET); 241 writel(msg->address_hi, base + PCI_MSIX_ENTRY_UPPER_ADDR);
230 writel(msg->address_hi, 242 writel(msg->data, base + PCI_MSIX_ENTRY_DATA);
231 base + PCI_MSIX_ENTRY_UPPER_ADDR_OFFSET);
232 writel(msg->data, base + PCI_MSIX_ENTRY_DATA_OFFSET);
233 } else { 243 } else {
234 struct pci_dev *dev = entry->dev; 244 struct pci_dev *dev = entry->dev;
235 int pos = entry->msi_attrib.pos; 245 int pos = entry->msi_attrib.pos;
@@ -385,6 +395,7 @@ static int msi_capability_init(struct pci_dev *dev, int nvec)
385 /* Configure MSI capability structure */ 395 /* Configure MSI capability structure */
386 ret = arch_setup_msi_irqs(dev, nvec, PCI_CAP_ID_MSI); 396 ret = arch_setup_msi_irqs(dev, nvec, PCI_CAP_ID_MSI);
387 if (ret) { 397 if (ret) {
398 msi_mask_irq(entry, mask, ~mask);
388 msi_free_irqs(dev); 399 msi_free_irqs(dev);
389 return ret; 400 return ret;
390 } 401 }
@@ -439,8 +450,14 @@ static int msix_capability_init(struct pci_dev *dev,
439 450
440 for (i = 0; i < nvec; i++) { 451 for (i = 0; i < nvec; i++) {
441 entry = alloc_msi_entry(dev); 452 entry = alloc_msi_entry(dev);
442 if (!entry) 453 if (!entry) {
443 break; 454 if (!i)
455 iounmap(base);
456 else
457 msi_free_irqs(dev);
458 /* No enough memory. Don't try again */
459 return -ENOMEM;
460 }
444 461
445 j = entries[i].entry; 462 j = entries[i].entry;
446 entry->msi_attrib.is_msix = 1; 463 entry->msi_attrib.is_msix = 1;
@@ -487,7 +504,7 @@ static int msix_capability_init(struct pci_dev *dev,
487 set_irq_msi(entry->irq, entry); 504 set_irq_msi(entry->irq, entry);
488 j = entries[i].entry; 505 j = entries[i].entry;
489 entry->masked = readl(base + j * PCI_MSIX_ENTRY_SIZE + 506 entry->masked = readl(base + j * PCI_MSIX_ENTRY_SIZE +
490 PCI_MSIX_ENTRY_VECTOR_CTRL_OFFSET); 507 PCI_MSIX_ENTRY_VECTOR_CTRL);
491 msix_mask_irq(entry, 1); 508 msix_mask_irq(entry, 1);
492 i++; 509 i++;
493 } 510 }
@@ -611,9 +628,11 @@ void pci_msi_shutdown(struct pci_dev *dev)
611 pci_intx_for_msi(dev, 1); 628 pci_intx_for_msi(dev, 1);
612 dev->msi_enabled = 0; 629 dev->msi_enabled = 0;
613 630
631 /* Return the device with MSI unmasked as initial states */
614 pci_read_config_word(dev, pos + PCI_MSI_FLAGS, &ctrl); 632 pci_read_config_word(dev, pos + PCI_MSI_FLAGS, &ctrl);
615 mask = msi_capable_mask(ctrl); 633 mask = msi_capable_mask(ctrl);
616 msi_mask_irq(desc, mask, ~mask); 634 /* Keep cached state to be restored */
635 __msi_mask_irq(desc, mask, ~mask);
617 636
618 /* Restore dev->irq to its default pin-assertion irq */ 637 /* Restore dev->irq to its default pin-assertion irq */
619 dev->irq = desc->msi_attrib.default_irq; 638 dev->irq = desc->msi_attrib.default_irq;
@@ -653,7 +672,6 @@ static int msi_free_irqs(struct pci_dev* dev)
653 672
654 list_for_each_entry_safe(entry, tmp, &dev->msi_list, list) { 673 list_for_each_entry_safe(entry, tmp, &dev->msi_list, list) {
655 if (entry->msi_attrib.is_msix) { 674 if (entry->msi_attrib.is_msix) {
656 msix_mask_irq(entry, 1);
657 if (list_is_last(&entry->list, &dev->msi_list)) 675 if (list_is_last(&entry->list, &dev->msi_list))
658 iounmap(entry->mask_base); 676 iounmap(entry->mask_base);
659 } 677 }
@@ -741,9 +759,17 @@ static void msix_free_all_irqs(struct pci_dev *dev)
741 759
742void pci_msix_shutdown(struct pci_dev* dev) 760void pci_msix_shutdown(struct pci_dev* dev)
743{ 761{
762 struct msi_desc *entry;
763
744 if (!pci_msi_enable || !dev || !dev->msix_enabled) 764 if (!pci_msi_enable || !dev || !dev->msix_enabled)
745 return; 765 return;
746 766
767 /* Return the device with MSI-X masked as initial states */
768 list_for_each_entry(entry, &dev->msi_list, list) {
769 /* Keep cached states to be restored */
770 __msix_mask_irq(entry, 1);
771 }
772
747 msix_set_enable(dev, 0); 773 msix_set_enable(dev, 0);
748 pci_intx_for_msi(dev, 1); 774 pci_intx_for_msi(dev, 1);
749 dev->msix_enabled = 0; 775 dev->msix_enabled = 0;
diff --git a/drivers/pci/msi.h b/drivers/pci/msi.h
index a0662842550b..de27c1cb5a2b 100644
--- a/drivers/pci/msi.h
+++ b/drivers/pci/msi.h
@@ -6,11 +6,11 @@
6#ifndef MSI_H 6#ifndef MSI_H
7#define MSI_H 7#define MSI_H
8 8
9#define PCI_MSIX_ENTRY_SIZE 16 9#define PCI_MSIX_ENTRY_SIZE 16
10#define PCI_MSIX_ENTRY_LOWER_ADDR_OFFSET 0 10#define PCI_MSIX_ENTRY_LOWER_ADDR 0
11#define PCI_MSIX_ENTRY_UPPER_ADDR_OFFSET 4 11#define PCI_MSIX_ENTRY_UPPER_ADDR 4
12#define PCI_MSIX_ENTRY_DATA_OFFSET 8 12#define PCI_MSIX_ENTRY_DATA 8
13#define PCI_MSIX_ENTRY_VECTOR_CTRL_OFFSET 12 13#define PCI_MSIX_ENTRY_VECTOR_CTRL 12
14 14
15#define msi_control_reg(base) (base + PCI_MSI_FLAGS) 15#define msi_control_reg(base) (base + PCI_MSI_FLAGS)
16#define msi_lower_address_reg(base) (base + PCI_MSI_ADDRESS_LO) 16#define msi_lower_address_reg(base) (base + PCI_MSI_ADDRESS_LO)
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
index 6c93af5ced18..dbd0f947f497 100644
--- a/drivers/pci/pci.c
+++ b/drivers/pci/pci.c
@@ -1517,11 +1517,20 @@ void pci_enable_ari(struct pci_dev *dev)
1517 * 1517 *
1518 * Perform INTx swizzling for a device behind one level of bridge. This is 1518 * Perform INTx swizzling for a device behind one level of bridge. This is
1519 * required by section 9.1 of the PCI-to-PCI bridge specification for devices 1519 * required by section 9.1 of the PCI-to-PCI bridge specification for devices
1520 * behind bridges on add-in cards. 1520 * behind bridges on add-in cards. For devices with ARI enabled, the slot
1521 * number is always 0 (see the Implementation Note in section 2.2.8.1 of
1522 * the PCI Express Base Specification, Revision 2.1)
1521 */ 1523 */
1522u8 pci_swizzle_interrupt_pin(struct pci_dev *dev, u8 pin) 1524u8 pci_swizzle_interrupt_pin(struct pci_dev *dev, u8 pin)
1523{ 1525{
1524 return (((pin - 1) + PCI_SLOT(dev->devfn)) % 4) + 1; 1526 int slot;
1527
1528 if (pci_ari_enabled(dev->bus))
1529 slot = 0;
1530 else
1531 slot = PCI_SLOT(dev->devfn);
1532
1533 return (((pin - 1) + slot) % 4) + 1;
1525} 1534}
1526 1535
1527int 1536int
@@ -2171,7 +2180,7 @@ static int pci_parent_bus_reset(struct pci_dev *dev, int probe)
2171 u16 ctrl; 2180 u16 ctrl;
2172 struct pci_dev *pdev; 2181 struct pci_dev *pdev;
2173 2182
2174 if (dev->subordinate) 2183 if (pci_is_root_bus(dev->bus) || dev->subordinate || !dev->bus->self)
2175 return -ENOTTY; 2184 return -ENOTTY;
2176 2185
2177 list_for_each_entry(pdev, &dev->bus->devices, bus_list) 2186 list_for_each_entry(pdev, &dev->bus->devices, bus_list)
diff --git a/drivers/pci/pcie/aer/ecrc.c b/drivers/pci/pcie/aer/ecrc.c
index ece97df4df6d..a928d8ab6bda 100644
--- a/drivers/pci/pcie/aer/ecrc.c
+++ b/drivers/pci/pcie/aer/ecrc.c
@@ -106,7 +106,7 @@ void pcie_set_ecrc_checking(struct pci_dev *dev)
106 disable_ecrc_checking(dev); 106 disable_ecrc_checking(dev);
107 break; 107 break;
108 case ECRC_POLICY_ON: 108 case ECRC_POLICY_ON:
109 enable_ecrc_checking(dev);; 109 enable_ecrc_checking(dev);
110 break; 110 break;
111 default: 111 default:
112 return; 112 return;
diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
index 56552d74abea..06b965623962 100644
--- a/drivers/pci/quirks.c
+++ b/drivers/pci/quirks.c
@@ -1058,6 +1058,11 @@ static void __devinit quirk_no_ata_d3(struct pci_dev *pdev)
1058} 1058}
1059DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_SERVERWORKS, PCI_ANY_ID, quirk_no_ata_d3); 1059DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_SERVERWORKS, PCI_ANY_ID, quirk_no_ata_d3);
1060DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_ATI, PCI_ANY_ID, quirk_no_ata_d3); 1060DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_ATI, PCI_ANY_ID, quirk_no_ata_d3);
1061/* ALi loses some register settings that we cannot then restore */
1062DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_AL, PCI_ANY_ID, quirk_no_ata_d3);
1063/* VIA comes back fine but we need to keep it alive or ACPI GTM failures
1064 occur when mode detecting */
1065DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_VIA, PCI_ANY_ID, quirk_no_ata_d3);
1061 1066
1062/* This was originally an Alpha specific thing, but it really fits here. 1067/* This was originally an Alpha specific thing, but it really fits here.
1063 * The i82375 PCI/EISA bridge appears as non-classified. Fix that. 1068 * The i82375 PCI/EISA bridge appears as non-classified. Fix that.
diff --git a/drivers/pci/setup-res.c b/drivers/pci/setup-res.c
index b711fb7181e2..1898c7b47907 100644
--- a/drivers/pci/setup-res.c
+++ b/drivers/pci/setup-res.c
@@ -100,16 +100,16 @@ int pci_claim_resource(struct pci_dev *dev, int resource)
100{ 100{
101 struct resource *res = &dev->resource[resource]; 101 struct resource *res = &dev->resource[resource];
102 struct resource *root; 102 struct resource *root;
103 char *dtype = resource < PCI_BRIDGE_RESOURCES ? "device" : "bridge";
104 int err; 103 int err;
105 104
106 root = pci_find_parent_resource(dev, res); 105 root = pci_find_parent_resource(dev, res);
107 106
108 err = -EINVAL; 107 err = -EINVAL;
109 if (root != NULL) 108 if (root != NULL)
110 err = insert_resource(root, res); 109 err = request_resource(root, res);
111 110
112 if (err) { 111 if (err) {
112 const char *dtype = resource < PCI_BRIDGE_RESOURCES ? "device" : "bridge";
113 dev_err(&dev->dev, "BAR %d: %s of %s %pR\n", 113 dev_err(&dev->dev, "BAR %d: %s of %s %pR\n",
114 resource, 114 resource,
115 root ? "address space collision on" : 115 root ? "address space collision on" :
diff --git a/drivers/pci/slot.c b/drivers/pci/slot.c
index eddb0748b0ea..8c02b6c53bdb 100644
--- a/drivers/pci/slot.c
+++ b/drivers/pci/slot.c
@@ -311,7 +311,7 @@ EXPORT_SYMBOL_GPL(pci_destroy_slot);
311#include <linux/pci_hotplug.h> 311#include <linux/pci_hotplug.h>
312/** 312/**
313 * pci_hp_create_link - create symbolic link to the hotplug driver module. 313 * pci_hp_create_link - create symbolic link to the hotplug driver module.
314 * @slot: struct pci_slot 314 * @pci_slot: struct pci_slot
315 * 315 *
316 * Helper function for pci_hotplug_core.c to create symbolic link to 316 * Helper function for pci_hotplug_core.c to create symbolic link to
317 * the hotplug driver module. 317 * the hotplug driver module.
@@ -334,7 +334,7 @@ EXPORT_SYMBOL_GPL(pci_hp_create_module_link);
334 334
335/** 335/**
336 * pci_hp_remove_link - remove symbolic link to the hotplug driver module. 336 * pci_hp_remove_link - remove symbolic link to the hotplug driver module.
337 * @slot: struct pci_slot 337 * @pci_slot: struct pci_slot
338 * 338 *
339 * Helper function for pci_hotplug_core.c to remove symbolic link to 339 * Helper function for pci_hotplug_core.c to remove symbolic link to
340 * the hotplug driver module. 340 * the hotplug driver module.
diff --git a/drivers/pci/syscall.c b/drivers/pci/syscall.c
index ec22284eed30..e1c1ec540893 100644
--- a/drivers/pci/syscall.c
+++ b/drivers/pci/syscall.c
@@ -9,7 +9,6 @@
9 9
10#include <linux/errno.h> 10#include <linux/errno.h>
11#include <linux/pci.h> 11#include <linux/pci.h>
12#include <linux/smp_lock.h>
13#include <linux/syscalls.h> 12#include <linux/syscalls.h>
14#include <asm/uaccess.h> 13#include <asm/uaccess.h>
15#include "pci.h" 14#include "pci.h"
diff --git a/drivers/pcmcia/tcic.c b/drivers/pcmcia/tcic.c
index 9ad97ea836e8..8eb04230fec7 100644
--- a/drivers/pcmcia/tcic.c
+++ b/drivers/pcmcia/tcic.c
@@ -472,7 +472,8 @@ static int __init init_tcic(void)
472 init_timer(&poll_timer); 472 init_timer(&poll_timer);
473 473
474 /* Build interrupt mask */ 474 /* Build interrupt mask */
475 printk(", %d sockets\n" KERN_INFO " irq list (", sockets); 475 printk(KERN_CONT ", %d sockets\n", sockets);
476 printk(KERN_INFO " irq list (");
476 if (irq_list_count == 0) 477 if (irq_list_count == 0)
477 mask = irq_mask; 478 mask = irq_mask;
478 else 479 else
diff --git a/drivers/pcmcia/vrc4171_card.c b/drivers/pcmcia/vrc4171_card.c
index 659421d0ca46..d4ad50d737b0 100644
--- a/drivers/pcmcia/vrc4171_card.c
+++ b/drivers/pcmcia/vrc4171_card.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * vrc4171_card.c, NEC VRC4171 Card Controller driver for Socket Services. 2 * vrc4171_card.c, NEC VRC4171 Card Controller driver for Socket Services.
3 * 3 *
4 * Copyright (C) 2003-2005 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> 4 * Copyright (C) 2003-2005 Yoichi Yuasa <yuasa@linux-mips.org>
5 * 5 *
6 * This program is free software; you can redistribute it and/or modify 6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by 7 * it under the terms of the GNU General Public License as published by
@@ -32,7 +32,7 @@
32#include "i82365.h" 32#include "i82365.h"
33 33
34MODULE_DESCRIPTION("NEC VRC4171 Card Controllers driver for Socket Services"); 34MODULE_DESCRIPTION("NEC VRC4171 Card Controllers driver for Socket Services");
35MODULE_AUTHOR("Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>"); 35MODULE_AUTHOR("Yoichi Yuasa <yuasa@linux-mips.org>");
36MODULE_LICENSE("GPL"); 36MODULE_LICENSE("GPL");
37 37
38#define CARD_MAX_SLOTS 2 38#define CARD_MAX_SLOTS 2
diff --git a/drivers/pcmcia/vrc4173_cardu.c b/drivers/pcmcia/vrc4173_cardu.c
index 812f038e9bda..9b3c15827e5c 100644
--- a/drivers/pcmcia/vrc4173_cardu.c
+++ b/drivers/pcmcia/vrc4173_cardu.c
@@ -6,7 +6,7 @@
6 * NEC VRC4173 CARDU driver for Socket Services 6 * NEC VRC4173 CARDU driver for Socket Services
7 * (This device doesn't support CardBus. it is supporting only 16bit PC Card.) 7 * (This device doesn't support CardBus. it is supporting only 16bit PC Card.)
8 * 8 *
9 * Copyright 2002,2003 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> 9 * Copyright 2002,2003 Yoichi Yuasa <yuasa@linux-mips.org>
10 * 10 *
11 * This program is free software; you can redistribute it and/or modify it 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 12 * under the terms of the GNU General Public License as published by the
@@ -41,7 +41,7 @@
41#include "vrc4173_cardu.h" 41#include "vrc4173_cardu.h"
42 42
43MODULE_DESCRIPTION("NEC VRC4173 CARDU driver for Socket Services"); 43MODULE_DESCRIPTION("NEC VRC4173 CARDU driver for Socket Services");
44MODULE_AUTHOR("Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>"); 44MODULE_AUTHOR("Yoichi Yuasa <yuasa@linux-mips.org>");
45MODULE_LICENSE("GPL"); 45MODULE_LICENSE("GPL");
46 46
47static int vrc4173_cardu_slots; 47static int vrc4173_cardu_slots;
diff --git a/drivers/pcmcia/vrc4173_cardu.h b/drivers/pcmcia/vrc4173_cardu.h
index 7d77c74120c1..a7d96018ed8d 100644
--- a/drivers/pcmcia/vrc4173_cardu.h
+++ b/drivers/pcmcia/vrc4173_cardu.h
@@ -5,7 +5,7 @@
5 * BRIEF MODULE DESCRIPTION 5 * BRIEF MODULE DESCRIPTION
6 * Include file for NEC VRC4173 CARDU. 6 * Include file for NEC VRC4173 CARDU.
7 * 7 *
8 * Copyright 2002 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> 8 * Copyright 2002 Yoichi Yuasa <yuasa@linux-mips.org>
9 * 9 *
10 * This program is free software; you can redistribute it and/or modify it 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 11 * under the terms of the GNU General Public License as published by the
diff --git a/drivers/platform/x86/Kconfig b/drivers/platform/x86/Kconfig
index 7232fe7104aa..77c6097ced80 100644
--- a/drivers/platform/x86/Kconfig
+++ b/drivers/platform/x86/Kconfig
@@ -277,31 +277,6 @@ config THINKPAD_ACPI_UNSAFE_LEDS
277 Say N here, unless you are building a kernel for your own 277 Say N here, unless you are building a kernel for your own
278 use, and need to control the important firmware LEDs. 278 use, and need to control the important firmware LEDs.
279 279
280config THINKPAD_ACPI_DOCK
281 bool "Legacy Docking Station Support"
282 depends on THINKPAD_ACPI
283 depends on ACPI_DOCK=n
284 default n
285 ---help---
286 Allows the thinkpad_acpi driver to handle docking station events.
287 This support was made obsolete by the generic ACPI docking station
288 support (CONFIG_ACPI_DOCK). It will allow locking and removing the
289 laptop from the docking station, but will not properly connect PCI
290 devices.
291
292 If you are not sure, say N here.
293
294config THINKPAD_ACPI_BAY
295 bool "Legacy Removable Bay Support"
296 depends on THINKPAD_ACPI
297 default y
298 ---help---
299 Allows the thinkpad_acpi driver to handle removable bays. It will
300 electrically disable the device in the bay, and also generate
301 notifications when the bay lever is ejected or inserted.
302
303 If you are not sure, say Y here.
304
305config THINKPAD_ACPI_VIDEO 280config THINKPAD_ACPI_VIDEO
306 bool "Video output control support" 281 bool "Video output control support"
307 depends on THINKPAD_ACPI 282 depends on THINKPAD_ACPI
@@ -355,6 +330,7 @@ config EEEPC_LAPTOP
355 depends on INPUT 330 depends on INPUT
356 depends on EXPERIMENTAL 331 depends on EXPERIMENTAL
357 depends on RFKILL || RFKILL = n 332 depends on RFKILL || RFKILL = n
333 depends on HOTPLUG_PCI
358 select BACKLIGHT_CLASS_DEVICE 334 select BACKLIGHT_CLASS_DEVICE
359 select HWMON 335 select HWMON
360 ---help--- 336 ---help---
diff --git a/drivers/platform/x86/eeepc-laptop.c b/drivers/platform/x86/eeepc-laptop.c
index 4207b26ff990..222ffb892f22 100644
--- a/drivers/platform/x86/eeepc-laptop.c
+++ b/drivers/platform/x86/eeepc-laptop.c
@@ -16,6 +16,8 @@
16 * GNU General Public License for more details. 16 * GNU General Public License for more details.
17 */ 17 */
18 18
19#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
20
19#include <linux/kernel.h> 21#include <linux/kernel.h>
20#include <linux/module.h> 22#include <linux/module.h>
21#include <linux/init.h> 23#include <linux/init.h>
@@ -31,6 +33,7 @@
31#include <linux/input.h> 33#include <linux/input.h>
32#include <linux/rfkill.h> 34#include <linux/rfkill.h>
33#include <linux/pci.h> 35#include <linux/pci.h>
36#include <linux/pci_hotplug.h>
34 37
35#define EEEPC_LAPTOP_VERSION "0.1" 38#define EEEPC_LAPTOP_VERSION "0.1"
36 39
@@ -40,11 +43,6 @@
40#define EEEPC_HOTK_DEVICE_NAME "Hotkey" 43#define EEEPC_HOTK_DEVICE_NAME "Hotkey"
41#define EEEPC_HOTK_HID "ASUS010" 44#define EEEPC_HOTK_HID "ASUS010"
42 45
43#define EEEPC_LOG EEEPC_HOTK_FILE ": "
44#define EEEPC_ERR KERN_ERR EEEPC_LOG
45#define EEEPC_WARNING KERN_WARNING EEEPC_LOG
46#define EEEPC_NOTICE KERN_NOTICE EEEPC_LOG
47#define EEEPC_INFO KERN_INFO EEEPC_LOG
48 46
49/* 47/*
50 * Definitions for Asus EeePC 48 * Definitions for Asus EeePC
@@ -141,8 +139,11 @@ struct eeepc_hotk {
141 u16 event_count[128]; /* count for each event */ 139 u16 event_count[128]; /* count for each event */
142 struct input_dev *inputdev; 140 struct input_dev *inputdev;
143 u16 *keycode_map; 141 u16 *keycode_map;
144 struct rfkill *eeepc_wlan_rfkill; 142 struct rfkill *wlan_rfkill;
145 struct rfkill *eeepc_bluetooth_rfkill; 143 struct rfkill *bluetooth_rfkill;
144 struct rfkill *wwan3g_rfkill;
145 struct hotplug_slot *hotplug_slot;
146 struct work_struct hotplug_work;
146}; 147};
147 148
148/* The actual device the driver binds to */ 149/* The actual device the driver binds to */
@@ -213,6 +214,15 @@ static struct acpi_driver eeepc_hotk_driver = {
213 }, 214 },
214}; 215};
215 216
217/* PCI hotplug ops */
218static int eeepc_get_adapter_status(struct hotplug_slot *slot, u8 *value);
219
220static struct hotplug_slot_ops eeepc_hotplug_slot_ops = {
221 .owner = THIS_MODULE,
222 .get_adapter_status = eeepc_get_adapter_status,
223 .get_power_status = eeepc_get_adapter_status,
224};
225
216/* The backlight device /sys/class/backlight */ 226/* The backlight device /sys/class/backlight */
217static struct backlight_device *eeepc_backlight_device; 227static struct backlight_device *eeepc_backlight_device;
218 228
@@ -274,20 +284,20 @@ static int set_acpi(int cm, int value)
274 if (method == NULL) 284 if (method == NULL)
275 return -ENODEV; 285 return -ENODEV;
276 if (write_acpi_int(ehotk->handle, method, value, NULL)) 286 if (write_acpi_int(ehotk->handle, method, value, NULL))
277 printk(EEEPC_WARNING "Error writing %s\n", method); 287 pr_warning("Error writing %s\n", method);
278 } 288 }
279 return 0; 289 return 0;
280} 290}
281 291
282static int get_acpi(int cm) 292static int get_acpi(int cm)
283{ 293{
284 int value = -1; 294 int value = -ENODEV;
285 if ((ehotk->cm_supported & (0x1 << cm))) { 295 if ((ehotk->cm_supported & (0x1 << cm))) {
286 const char *method = cm_getv[cm]; 296 const char *method = cm_getv[cm];
287 if (method == NULL) 297 if (method == NULL)
288 return -ENODEV; 298 return -ENODEV;
289 if (read_acpi_int(ehotk->handle, method, &value)) 299 if (read_acpi_int(ehotk->handle, method, &value))
290 printk(EEEPC_WARNING "Error reading %s\n", method); 300 pr_warning("Error reading %s\n", method);
291 } 301 }
292 return value; 302 return value;
293} 303}
@@ -359,13 +369,19 @@ static ssize_t store_sys_acpi(int cm, const char *buf, size_t count)
359 369
360 rv = parse_arg(buf, count, &value); 370 rv = parse_arg(buf, count, &value);
361 if (rv > 0) 371 if (rv > 0)
362 set_acpi(cm, value); 372 value = set_acpi(cm, value);
373 if (value < 0)
374 return value;
363 return rv; 375 return rv;
364} 376}
365 377
366static ssize_t show_sys_acpi(int cm, char *buf) 378static ssize_t show_sys_acpi(int cm, char *buf)
367{ 379{
368 return sprintf(buf, "%d\n", get_acpi(cm)); 380 int value = get_acpi(cm);
381
382 if (value < 0)
383 return value;
384 return sprintf(buf, "%d\n", value);
369} 385}
370 386
371#define EEEPC_CREATE_DEVICE_ATTR(_name, _cm) \ 387#define EEEPC_CREATE_DEVICE_ATTR(_name, _cm) \
@@ -539,6 +555,28 @@ static int eeepc_setkeycode(struct input_dev *dev, int scancode, int keycode)
539 return -EINVAL; 555 return -EINVAL;
540} 556}
541 557
558static void cmsg_quirk(int cm, const char *name)
559{
560 int dummy;
561
562 /* Some BIOSes do not report cm although it is avaliable.
563 Check if cm_getv[cm] works and, if yes, assume cm should be set. */
564 if (!(ehotk->cm_supported & (1 << cm))
565 && !read_acpi_int(ehotk->handle, cm_getv[cm], &dummy)) {
566 pr_info("%s (%x) not reported by BIOS,"
567 " enabling anyway\n", name, 1 << cm);
568 ehotk->cm_supported |= 1 << cm;
569 }
570}
571
572static void cmsg_quirks(void)
573{
574 cmsg_quirk(CM_ASL_LID, "LID");
575 cmsg_quirk(CM_ASL_TYPE, "TYPE");
576 cmsg_quirk(CM_ASL_PANELPOWER, "PANELPOWER");
577 cmsg_quirk(CM_ASL_TPD, "TPD");
578}
579
542static int eeepc_hotk_check(void) 580static int eeepc_hotk_check(void)
543{ 581{
544 const struct key_entry *key; 582 const struct key_entry *key;
@@ -551,26 +589,24 @@ static int eeepc_hotk_check(void)
551 if (ehotk->device->status.present) { 589 if (ehotk->device->status.present) {
552 if (write_acpi_int(ehotk->handle, "INIT", ehotk->init_flag, 590 if (write_acpi_int(ehotk->handle, "INIT", ehotk->init_flag,
553 &buffer)) { 591 &buffer)) {
554 printk(EEEPC_ERR "Hotkey initialization failed\n"); 592 pr_err("Hotkey initialization failed\n");
555 return -ENODEV; 593 return -ENODEV;
556 } else { 594 } else {
557 printk(EEEPC_NOTICE "Hotkey init flags 0x%x\n", 595 pr_notice("Hotkey init flags 0x%x\n", ehotk->init_flag);
558 ehotk->init_flag);
559 } 596 }
560 /* get control methods supported */ 597 /* get control methods supported */
561 if (read_acpi_int(ehotk->handle, "CMSG" 598 if (read_acpi_int(ehotk->handle, "CMSG"
562 , &ehotk->cm_supported)) { 599 , &ehotk->cm_supported)) {
563 printk(EEEPC_ERR 600 pr_err("Get control methods supported failed\n");
564 "Get control methods supported failed\n");
565 return -ENODEV; 601 return -ENODEV;
566 } else { 602 } else {
567 printk(EEEPC_INFO 603 cmsg_quirks();
568 "Get control methods supported: 0x%x\n", 604 pr_info("Get control methods supported: 0x%x\n",
569 ehotk->cm_supported); 605 ehotk->cm_supported);
570 } 606 }
571 ehotk->inputdev = input_allocate_device(); 607 ehotk->inputdev = input_allocate_device();
572 if (!ehotk->inputdev) { 608 if (!ehotk->inputdev) {
573 printk(EEEPC_INFO "Unable to allocate input device\n"); 609 pr_info("Unable to allocate input device\n");
574 return 0; 610 return 0;
575 } 611 }
576 ehotk->inputdev->name = "Asus EeePC extra buttons"; 612 ehotk->inputdev->name = "Asus EeePC extra buttons";
@@ -589,12 +625,12 @@ static int eeepc_hotk_check(void)
589 } 625 }
590 result = input_register_device(ehotk->inputdev); 626 result = input_register_device(ehotk->inputdev);
591 if (result) { 627 if (result) {
592 printk(EEEPC_INFO "Unable to register input device\n"); 628 pr_info("Unable to register input device\n");
593 input_free_device(ehotk->inputdev); 629 input_free_device(ehotk->inputdev);
594 return 0; 630 return 0;
595 } 631 }
596 } else { 632 } else {
597 printk(EEEPC_ERR "Hotkey device not present, aborting\n"); 633 pr_err("Hotkey device not present, aborting\n");
598 return -EINVAL; 634 return -EINVAL;
599 } 635 }
600 return 0; 636 return 0;
@@ -612,14 +648,27 @@ static int notify_brn(void)
612 return -1; 648 return -1;
613} 649}
614 650
615static void eeepc_rfkill_hotplug(void) 651static int eeepc_get_adapter_status(struct hotplug_slot *hotplug_slot,
652 u8 *value)
653{
654 int val = get_acpi(CM_ASL_WLAN);
655
656 if (val == 1 || val == 0)
657 *value = val;
658 else
659 return -EINVAL;
660
661 return 0;
662}
663
664static void eeepc_hotplug_work(struct work_struct *work)
616{ 665{
617 struct pci_dev *dev; 666 struct pci_dev *dev;
618 struct pci_bus *bus = pci_find_bus(0, 1); 667 struct pci_bus *bus = pci_find_bus(0, 1);
619 bool blocked; 668 bool blocked;
620 669
621 if (!bus) { 670 if (!bus) {
622 printk(EEEPC_WARNING "Unable to find PCI bus 1?\n"); 671 pr_warning("Unable to find PCI bus 1?\n");
623 return; 672 return;
624 } 673 }
625 674
@@ -635,7 +684,7 @@ static void eeepc_rfkill_hotplug(void)
635 if (dev) { 684 if (dev) {
636 pci_bus_assign_resources(bus); 685 pci_bus_assign_resources(bus);
637 if (pci_bus_add_device(dev)) 686 if (pci_bus_add_device(dev))
638 printk(EEEPC_ERR "Unable to hotplug wifi\n"); 687 pr_err("Unable to hotplug wifi\n");
639 } 688 }
640 } else { 689 } else {
641 dev = pci_get_slot(bus, 0); 690 dev = pci_get_slot(bus, 0);
@@ -645,7 +694,7 @@ static void eeepc_rfkill_hotplug(void)
645 } 694 }
646 } 695 }
647 696
648 rfkill_set_sw_state(ehotk->eeepc_wlan_rfkill, blocked); 697 rfkill_set_sw_state(ehotk->wlan_rfkill, blocked);
649} 698}
650 699
651static void eeepc_rfkill_notify(acpi_handle handle, u32 event, void *data) 700static void eeepc_rfkill_notify(acpi_handle handle, u32 event, void *data)
@@ -653,7 +702,7 @@ static void eeepc_rfkill_notify(acpi_handle handle, u32 event, void *data)
653 if (event != ACPI_NOTIFY_BUS_CHECK) 702 if (event != ACPI_NOTIFY_BUS_CHECK)
654 return; 703 return;
655 704
656 eeepc_rfkill_hotplug(); 705 schedule_work(&ehotk->hotplug_work);
657} 706}
658 707
659static void eeepc_hotk_notify(struct acpi_device *device, u32 event) 708static void eeepc_hotk_notify(struct acpi_device *device, u32 event)
@@ -718,8 +767,7 @@ static int eeepc_register_rfkill_notifier(char *node)
718 eeepc_rfkill_notify, 767 eeepc_rfkill_notify,
719 NULL); 768 NULL);
720 if (ACPI_FAILURE(status)) 769 if (ACPI_FAILURE(status))
721 printk(EEEPC_WARNING 770 pr_warning("Failed to register notify on %s\n", node);
722 "Failed to register notify on %s\n", node);
723 } else 771 } else
724 return -ENODEV; 772 return -ENODEV;
725 773
@@ -738,19 +786,66 @@ static void eeepc_unregister_rfkill_notifier(char *node)
738 ACPI_SYSTEM_NOTIFY, 786 ACPI_SYSTEM_NOTIFY,
739 eeepc_rfkill_notify); 787 eeepc_rfkill_notify);
740 if (ACPI_FAILURE(status)) 788 if (ACPI_FAILURE(status))
741 printk(EEEPC_ERR 789 pr_err("Error removing rfkill notify handler %s\n",
742 "Error removing rfkill notify handler %s\n",
743 node); 790 node);
744 } 791 }
745} 792}
746 793
794static void eeepc_cleanup_pci_hotplug(struct hotplug_slot *hotplug_slot)
795{
796 kfree(hotplug_slot->info);
797 kfree(hotplug_slot);
798}
799
800static int eeepc_setup_pci_hotplug(void)
801{
802 int ret = -ENOMEM;
803 struct pci_bus *bus = pci_find_bus(0, 1);
804
805 if (!bus) {
806 pr_err("Unable to find wifi PCI bus\n");
807 return -ENODEV;
808 }
809
810 ehotk->hotplug_slot = kzalloc(sizeof(struct hotplug_slot), GFP_KERNEL);
811 if (!ehotk->hotplug_slot)
812 goto error_slot;
813
814 ehotk->hotplug_slot->info = kzalloc(sizeof(struct hotplug_slot_info),
815 GFP_KERNEL);
816 if (!ehotk->hotplug_slot->info)
817 goto error_info;
818
819 ehotk->hotplug_slot->private = ehotk;
820 ehotk->hotplug_slot->release = &eeepc_cleanup_pci_hotplug;
821 ehotk->hotplug_slot->ops = &eeepc_hotplug_slot_ops;
822 eeepc_get_adapter_status(ehotk->hotplug_slot,
823 &ehotk->hotplug_slot->info->adapter_status);
824
825 ret = pci_hp_register(ehotk->hotplug_slot, bus, 0, "eeepc-wifi");
826 if (ret) {
827 pr_err("Unable to register hotplug slot - %d\n", ret);
828 goto error_register;
829 }
830
831 return 0;
832
833error_register:
834 kfree(ehotk->hotplug_slot->info);
835error_info:
836 kfree(ehotk->hotplug_slot);
837 ehotk->hotplug_slot = NULL;
838error_slot:
839 return ret;
840}
841
747static int eeepc_hotk_add(struct acpi_device *device) 842static int eeepc_hotk_add(struct acpi_device *device)
748{ 843{
749 int result; 844 int result;
750 845
751 if (!device) 846 if (!device)
752 return -EINVAL; 847 return -EINVAL;
753 printk(EEEPC_NOTICE EEEPC_HOTK_NAME "\n"); 848 pr_notice(EEEPC_HOTK_NAME "\n");
754 ehotk = kzalloc(sizeof(struct eeepc_hotk), GFP_KERNEL); 849 ehotk = kzalloc(sizeof(struct eeepc_hotk), GFP_KERNEL);
755 if (!ehotk) 850 if (!ehotk)
756 return -ENOMEM; 851 return -ENOMEM;
@@ -764,53 +859,8 @@ static int eeepc_hotk_add(struct acpi_device *device)
764 if (result) 859 if (result)
765 goto ehotk_fail; 860 goto ehotk_fail;
766 861
767 eeepc_register_rfkill_notifier("\\_SB.PCI0.P0P6");
768 eeepc_register_rfkill_notifier("\\_SB.PCI0.P0P7");
769
770 if (get_acpi(CM_ASL_WLAN) != -1) {
771 ehotk->eeepc_wlan_rfkill = rfkill_alloc("eeepc-wlan",
772 &device->dev,
773 RFKILL_TYPE_WLAN,
774 &eeepc_rfkill_ops,
775 (void *)CM_ASL_WLAN);
776
777 if (!ehotk->eeepc_wlan_rfkill)
778 goto wlan_fail;
779
780 rfkill_init_sw_state(ehotk->eeepc_wlan_rfkill,
781 get_acpi(CM_ASL_WLAN) != 1);
782 result = rfkill_register(ehotk->eeepc_wlan_rfkill);
783 if (result)
784 goto wlan_fail;
785 }
786
787 if (get_acpi(CM_ASL_BLUETOOTH) != -1) {
788 ehotk->eeepc_bluetooth_rfkill =
789 rfkill_alloc("eeepc-bluetooth",
790 &device->dev,
791 RFKILL_TYPE_BLUETOOTH,
792 &eeepc_rfkill_ops,
793 (void *)CM_ASL_BLUETOOTH);
794
795 if (!ehotk->eeepc_bluetooth_rfkill)
796 goto bluetooth_fail;
797
798 rfkill_init_sw_state(ehotk->eeepc_bluetooth_rfkill,
799 get_acpi(CM_ASL_BLUETOOTH) != 1);
800 result = rfkill_register(ehotk->eeepc_bluetooth_rfkill);
801 if (result)
802 goto bluetooth_fail;
803 }
804
805 return 0; 862 return 0;
806 863
807 bluetooth_fail:
808 rfkill_destroy(ehotk->eeepc_bluetooth_rfkill);
809 rfkill_unregister(ehotk->eeepc_wlan_rfkill);
810 wlan_fail:
811 rfkill_destroy(ehotk->eeepc_wlan_rfkill);
812 eeepc_unregister_rfkill_notifier("\\_SB.PCI0.P0P6");
813 eeepc_unregister_rfkill_notifier("\\_SB.PCI0.P0P7");
814 ehotk_fail: 864 ehotk_fail:
815 kfree(ehotk); 865 kfree(ehotk);
816 ehotk = NULL; 866 ehotk = NULL;
@@ -823,16 +873,13 @@ static int eeepc_hotk_remove(struct acpi_device *device, int type)
823 if (!device || !acpi_driver_data(device)) 873 if (!device || !acpi_driver_data(device))
824 return -EINVAL; 874 return -EINVAL;
825 875
826 eeepc_unregister_rfkill_notifier("\\_SB.PCI0.P0P6");
827 eeepc_unregister_rfkill_notifier("\\_SB.PCI0.P0P7");
828
829 kfree(ehotk); 876 kfree(ehotk);
830 return 0; 877 return 0;
831} 878}
832 879
833static int eeepc_hotk_resume(struct acpi_device *device) 880static int eeepc_hotk_resume(struct acpi_device *device)
834{ 881{
835 if (ehotk->eeepc_wlan_rfkill) { 882 if (ehotk->wlan_rfkill) {
836 bool wlan; 883 bool wlan;
837 884
838 /* Workaround - it seems that _PTS disables the wireless 885 /* Workaround - it seems that _PTS disables the wireless
@@ -844,14 +891,13 @@ static int eeepc_hotk_resume(struct acpi_device *device)
844 wlan = get_acpi(CM_ASL_WLAN); 891 wlan = get_acpi(CM_ASL_WLAN);
845 set_acpi(CM_ASL_WLAN, wlan); 892 set_acpi(CM_ASL_WLAN, wlan);
846 893
847 rfkill_set_sw_state(ehotk->eeepc_wlan_rfkill, 894 rfkill_set_sw_state(ehotk->wlan_rfkill, wlan != 1);
848 wlan != 1);
849 895
850 eeepc_rfkill_hotplug(); 896 schedule_work(&ehotk->hotplug_work);
851 } 897 }
852 898
853 if (ehotk->eeepc_bluetooth_rfkill) 899 if (ehotk->bluetooth_rfkill)
854 rfkill_set_sw_state(ehotk->eeepc_bluetooth_rfkill, 900 rfkill_set_sw_state(ehotk->bluetooth_rfkill,
855 get_acpi(CM_ASL_BLUETOOTH) != 1); 901 get_acpi(CM_ASL_BLUETOOTH) != 1);
856 902
857 return 0; 903 return 0;
@@ -973,10 +1019,16 @@ static void eeepc_backlight_exit(void)
973 1019
974static void eeepc_rfkill_exit(void) 1020static void eeepc_rfkill_exit(void)
975{ 1021{
976 if (ehotk->eeepc_wlan_rfkill) 1022 eeepc_unregister_rfkill_notifier("\\_SB.PCI0.P0P6");
977 rfkill_unregister(ehotk->eeepc_wlan_rfkill); 1023 eeepc_unregister_rfkill_notifier("\\_SB.PCI0.P0P7");
978 if (ehotk->eeepc_bluetooth_rfkill) 1024 if (ehotk->wlan_rfkill)
979 rfkill_unregister(ehotk->eeepc_bluetooth_rfkill); 1025 rfkill_unregister(ehotk->wlan_rfkill);
1026 if (ehotk->bluetooth_rfkill)
1027 rfkill_unregister(ehotk->bluetooth_rfkill);
1028 if (ehotk->wwan3g_rfkill)
1029 rfkill_unregister(ehotk->wwan3g_rfkill);
1030 if (ehotk->hotplug_slot)
1031 pci_hp_deregister(ehotk->hotplug_slot);
980} 1032}
981 1033
982static void eeepc_input_exit(void) 1034static void eeepc_input_exit(void)
@@ -1011,6 +1063,77 @@ static void __exit eeepc_laptop_exit(void)
1011 platform_driver_unregister(&platform_driver); 1063 platform_driver_unregister(&platform_driver);
1012} 1064}
1013 1065
1066static int eeepc_new_rfkill(struct rfkill **rfkill,
1067 const char *name, struct device *dev,
1068 enum rfkill_type type, int cm)
1069{
1070 int result;
1071
1072 result = get_acpi(cm);
1073 if (result < 0)
1074 return result;
1075
1076 *rfkill = rfkill_alloc(name, dev, type,
1077 &eeepc_rfkill_ops, (void *)(unsigned long)cm);
1078
1079 if (!*rfkill)
1080 return -EINVAL;
1081
1082 rfkill_init_sw_state(*rfkill, get_acpi(cm) != 1);
1083 result = rfkill_register(*rfkill);
1084 if (result) {
1085 rfkill_destroy(*rfkill);
1086 *rfkill = NULL;
1087 return result;
1088 }
1089 return 0;
1090}
1091
1092
1093static int eeepc_rfkill_init(struct device *dev)
1094{
1095 int result = 0;
1096
1097 INIT_WORK(&ehotk->hotplug_work, eeepc_hotplug_work);
1098
1099 eeepc_register_rfkill_notifier("\\_SB.PCI0.P0P6");
1100 eeepc_register_rfkill_notifier("\\_SB.PCI0.P0P7");
1101
1102 result = eeepc_new_rfkill(&ehotk->wlan_rfkill,
1103 "eeepc-wlan", dev,
1104 RFKILL_TYPE_WLAN, CM_ASL_WLAN);
1105
1106 if (result && result != -ENODEV)
1107 goto exit;
1108
1109 result = eeepc_new_rfkill(&ehotk->bluetooth_rfkill,
1110 "eeepc-bluetooth", dev,
1111 RFKILL_TYPE_BLUETOOTH, CM_ASL_BLUETOOTH);
1112
1113 if (result && result != -ENODEV)
1114 goto exit;
1115
1116 result = eeepc_new_rfkill(&ehotk->wwan3g_rfkill,
1117 "eeepc-wwan3g", dev,
1118 RFKILL_TYPE_WWAN, CM_ASL_3G);
1119
1120 if (result && result != -ENODEV)
1121 goto exit;
1122
1123 result = eeepc_setup_pci_hotplug();
1124 /*
1125 * If we get -EBUSY then something else is handling the PCI hotplug -
1126 * don't fail in this case
1127 */
1128 if (result == -EBUSY)
1129 result = 0;
1130
1131exit:
1132 if (result && result != -ENODEV)
1133 eeepc_rfkill_exit();
1134 return result;
1135}
1136
1014static int eeepc_backlight_init(struct device *dev) 1137static int eeepc_backlight_init(struct device *dev)
1015{ 1138{
1016 struct backlight_device *bd; 1139 struct backlight_device *bd;
@@ -1018,8 +1141,7 @@ static int eeepc_backlight_init(struct device *dev)
1018 bd = backlight_device_register(EEEPC_HOTK_FILE, dev, 1141 bd = backlight_device_register(EEEPC_HOTK_FILE, dev,
1019 NULL, &eeepcbl_ops); 1142 NULL, &eeepcbl_ops);
1020 if (IS_ERR(bd)) { 1143 if (IS_ERR(bd)) {
1021 printk(EEEPC_ERR 1144 pr_err("Could not register eeepc backlight device\n");
1022 "Could not register eeepc backlight device\n");
1023 eeepc_backlight_device = NULL; 1145 eeepc_backlight_device = NULL;
1024 return PTR_ERR(bd); 1146 return PTR_ERR(bd);
1025 } 1147 }
@@ -1038,8 +1160,7 @@ static int eeepc_hwmon_init(struct device *dev)
1038 1160
1039 hwmon = hwmon_device_register(dev); 1161 hwmon = hwmon_device_register(dev);
1040 if (IS_ERR(hwmon)) { 1162 if (IS_ERR(hwmon)) {
1041 printk(EEEPC_ERR 1163 pr_err("Could not register eeepc hwmon device\n");
1042 "Could not register eeepc hwmon device\n");
1043 eeepc_hwmon_device = NULL; 1164 eeepc_hwmon_device = NULL;
1044 return PTR_ERR(hwmon); 1165 return PTR_ERR(hwmon);
1045 } 1166 }
@@ -1065,19 +1186,6 @@ static int __init eeepc_laptop_init(void)
1065 acpi_bus_unregister_driver(&eeepc_hotk_driver); 1186 acpi_bus_unregister_driver(&eeepc_hotk_driver);
1066 return -ENODEV; 1187 return -ENODEV;
1067 } 1188 }
1068 dev = acpi_get_physical_device(ehotk->device->handle);
1069
1070 if (!acpi_video_backlight_support()) {
1071 result = eeepc_backlight_init(dev);
1072 if (result)
1073 goto fail_backlight;
1074 } else
1075 printk(EEEPC_INFO "Backlight controlled by ACPI video "
1076 "driver\n");
1077
1078 result = eeepc_hwmon_init(dev);
1079 if (result)
1080 goto fail_hwmon;
1081 1189
1082 eeepc_enable_camera(); 1190 eeepc_enable_camera();
1083 1191
@@ -1097,7 +1205,33 @@ static int __init eeepc_laptop_init(void)
1097 &platform_attribute_group); 1205 &platform_attribute_group);
1098 if (result) 1206 if (result)
1099 goto fail_sysfs; 1207 goto fail_sysfs;
1208
1209 dev = &platform_device->dev;
1210
1211 if (!acpi_video_backlight_support()) {
1212 result = eeepc_backlight_init(dev);
1213 if (result)
1214 goto fail_backlight;
1215 } else
1216 pr_info("Backlight controlled by ACPI video "
1217 "driver\n");
1218
1219 result = eeepc_hwmon_init(dev);
1220 if (result)
1221 goto fail_hwmon;
1222
1223 result = eeepc_rfkill_init(dev);
1224 if (result)
1225 goto fail_rfkill;
1226
1100 return 0; 1227 return 0;
1228fail_rfkill:
1229 eeepc_hwmon_exit();
1230fail_hwmon:
1231 eeepc_backlight_exit();
1232fail_backlight:
1233 sysfs_remove_group(&platform_device->dev.kobj,
1234 &platform_attribute_group);
1101fail_sysfs: 1235fail_sysfs:
1102 platform_device_del(platform_device); 1236 platform_device_del(platform_device);
1103fail_platform_device2: 1237fail_platform_device2:
@@ -1105,12 +1239,7 @@ fail_platform_device2:
1105fail_platform_device1: 1239fail_platform_device1:
1106 platform_driver_unregister(&platform_driver); 1240 platform_driver_unregister(&platform_driver);
1107fail_platform_driver: 1241fail_platform_driver:
1108 eeepc_hwmon_exit();
1109fail_hwmon:
1110 eeepc_backlight_exit();
1111fail_backlight:
1112 eeepc_input_exit(); 1242 eeepc_input_exit();
1113 eeepc_rfkill_exit();
1114 return result; 1243 return result;
1115} 1244}
1116 1245
diff --git a/drivers/platform/x86/hp-wmi.c b/drivers/platform/x86/hp-wmi.c
index ca508564a181..a2ad53e15874 100644
--- a/drivers/platform/x86/hp-wmi.c
+++ b/drivers/platform/x86/hp-wmi.c
@@ -520,11 +520,13 @@ static int hp_wmi_resume_handler(struct platform_device *device)
520 * the input layer will only actually pass it on if the state 520 * the input layer will only actually pass it on if the state
521 * changed. 521 * changed.
522 */ 522 */
523 523 if (hp_wmi_input_dev) {
524 input_report_switch(hp_wmi_input_dev, SW_DOCK, hp_wmi_dock_state()); 524 input_report_switch(hp_wmi_input_dev, SW_DOCK,
525 input_report_switch(hp_wmi_input_dev, SW_TABLET_MODE, 525 hp_wmi_dock_state());
526 hp_wmi_tablet_state()); 526 input_report_switch(hp_wmi_input_dev, SW_TABLET_MODE,
527 input_sync(hp_wmi_input_dev); 527 hp_wmi_tablet_state());
528 input_sync(hp_wmi_input_dev);
529 }
528 530
529 return 0; 531 return 0;
530} 532}
diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c
index a463fd72c495..e85600852502 100644
--- a/drivers/platform/x86/thinkpad_acpi.c
+++ b/drivers/platform/x86/thinkpad_acpi.c
@@ -239,12 +239,6 @@ struct ibm_init_struct {
239}; 239};
240 240
241static struct { 241static struct {
242#ifdef CONFIG_THINKPAD_ACPI_BAY
243 u32 bay_status:1;
244 u32 bay_eject:1;
245 u32 bay_status2:1;
246 u32 bay_eject2:1;
247#endif
248 u32 bluetooth:1; 242 u32 bluetooth:1;
249 u32 hotkey:1; 243 u32 hotkey:1;
250 u32 hotkey_mask:1; 244 u32 hotkey_mask:1;
@@ -589,18 +583,6 @@ static int acpi_ec_write(int i, u8 v)
589 return 1; 583 return 1;
590} 584}
591 585
592#if defined(CONFIG_THINKPAD_ACPI_DOCK) || defined(CONFIG_THINKPAD_ACPI_BAY)
593static int _sta(acpi_handle handle)
594{
595 int status;
596
597 if (!handle || !acpi_evalf(handle, &status, "_STA", "d"))
598 status = 0;
599
600 return status;
601}
602#endif
603
604static int issue_thinkpad_cmos_command(int cmos_cmd) 586static int issue_thinkpad_cmos_command(int cmos_cmd)
605{ 587{
606 if (!cmos_handle) 588 if (!cmos_handle)
@@ -784,6 +766,8 @@ static int dispatch_procfs_write(struct file *file,
784 766
785 if (!ibm || !ibm->write) 767 if (!ibm || !ibm->write)
786 return -EINVAL; 768 return -EINVAL;
769 if (count > PAGE_SIZE - 2)
770 return -EINVAL;
787 771
788 kernbuf = kmalloc(count + 2, GFP_KERNEL); 772 kernbuf = kmalloc(count + 2, GFP_KERNEL);
789 if (!kernbuf) 773 if (!kernbuf)
@@ -4442,293 +4426,6 @@ static struct ibm_struct light_driver_data = {
4442}; 4426};
4443 4427
4444/************************************************************************* 4428/*************************************************************************
4445 * Dock subdriver
4446 */
4447
4448#ifdef CONFIG_THINKPAD_ACPI_DOCK
4449
4450static void dock_notify(struct ibm_struct *ibm, u32 event);
4451static int dock_read(char *p);
4452static int dock_write(char *buf);
4453
4454TPACPI_HANDLE(dock, root, "\\_SB.GDCK", /* X30, X31, X40 */
4455 "\\_SB.PCI0.DOCK", /* 600e/x,770e,770x,A2xm/p,T20-22,X20-21 */
4456 "\\_SB.PCI0.PCI1.DOCK", /* all others */
4457 "\\_SB.PCI.ISA.SLCE", /* 570 */
4458 ); /* A21e,G4x,R30,R31,R32,R40,R40e,R50e */
4459
4460/* don't list other alternatives as we install a notify handler on the 570 */
4461TPACPI_HANDLE(pci, root, "\\_SB.PCI"); /* 570 */
4462
4463static const struct acpi_device_id ibm_pci_device_ids[] = {
4464 {PCI_ROOT_HID_STRING, 0},
4465 {"", 0},
4466};
4467
4468static struct tp_acpi_drv_struct ibm_dock_acpidriver[2] = {
4469 {
4470 .notify = dock_notify,
4471 .handle = &dock_handle,
4472 .type = ACPI_SYSTEM_NOTIFY,
4473 },
4474 {
4475 /* THIS ONE MUST NEVER BE USED FOR DRIVER AUTOLOADING.
4476 * We just use it to get notifications of dock hotplug
4477 * in very old thinkpads */
4478 .hid = ibm_pci_device_ids,
4479 .notify = dock_notify,
4480 .handle = &pci_handle,
4481 .type = ACPI_SYSTEM_NOTIFY,
4482 },
4483};
4484
4485static struct ibm_struct dock_driver_data[2] = {
4486 {
4487 .name = "dock",
4488 .read = dock_read,
4489 .write = dock_write,
4490 .acpi = &ibm_dock_acpidriver[0],
4491 },
4492 {
4493 .name = "dock",
4494 .acpi = &ibm_dock_acpidriver[1],
4495 },
4496};
4497
4498#define dock_docked() (_sta(dock_handle) & 1)
4499
4500static int __init dock_init(struct ibm_init_struct *iibm)
4501{
4502 vdbg_printk(TPACPI_DBG_INIT, "initializing dock subdriver\n");
4503
4504 TPACPI_ACPIHANDLE_INIT(dock);
4505
4506 vdbg_printk(TPACPI_DBG_INIT, "dock is %s\n",
4507 str_supported(dock_handle != NULL));
4508
4509 return (dock_handle)? 0 : 1;
4510}
4511
4512static int __init dock_init2(struct ibm_init_struct *iibm)
4513{
4514 int dock2_needed;
4515
4516 vdbg_printk(TPACPI_DBG_INIT, "initializing dock subdriver part 2\n");
4517
4518 if (dock_driver_data[0].flags.acpi_driver_registered &&
4519 dock_driver_data[0].flags.acpi_notify_installed) {
4520 TPACPI_ACPIHANDLE_INIT(pci);
4521 dock2_needed = (pci_handle != NULL);
4522 vdbg_printk(TPACPI_DBG_INIT,
4523 "dock PCI handler for the TP 570 is %s\n",
4524 str_supported(dock2_needed));
4525 } else {
4526 vdbg_printk(TPACPI_DBG_INIT,
4527 "dock subdriver part 2 not required\n");
4528 dock2_needed = 0;
4529 }
4530
4531 return (dock2_needed)? 0 : 1;
4532}
4533
4534static void dock_notify(struct ibm_struct *ibm, u32 event)
4535{
4536 int docked = dock_docked();
4537 int pci = ibm->acpi->hid && ibm->acpi->device &&
4538 acpi_match_device_ids(ibm->acpi->device, ibm_pci_device_ids);
4539 int data;
4540
4541 if (event == 1 && !pci) /* 570 */
4542 data = 1; /* button */
4543 else if (event == 1 && pci) /* 570 */
4544 data = 3; /* dock */
4545 else if (event == 3 && docked)
4546 data = 1; /* button */
4547 else if (event == 3 && !docked)
4548 data = 2; /* undock */
4549 else if (event == 0 && docked)
4550 data = 3; /* dock */
4551 else {
4552 printk(TPACPI_ERR "unknown dock event %d, status %d\n",
4553 event, _sta(dock_handle));
4554 data = 0; /* unknown */
4555 }
4556 acpi_bus_generate_proc_event(ibm->acpi->device, event, data);
4557 acpi_bus_generate_netlink_event(ibm->acpi->device->pnp.device_class,
4558 dev_name(&ibm->acpi->device->dev),
4559 event, data);
4560}
4561
4562static int dock_read(char *p)
4563{
4564 int len = 0;
4565 int docked = dock_docked();
4566
4567 if (!dock_handle)
4568 len += sprintf(p + len, "status:\t\tnot supported\n");
4569 else if (!docked)
4570 len += sprintf(p + len, "status:\t\tundocked\n");
4571 else {
4572 len += sprintf(p + len, "status:\t\tdocked\n");
4573 len += sprintf(p + len, "commands:\tdock, undock\n");
4574 }
4575
4576 return len;
4577}
4578
4579static int dock_write(char *buf)
4580{
4581 char *cmd;
4582
4583 if (!dock_docked())
4584 return -ENODEV;
4585
4586 while ((cmd = next_cmd(&buf))) {
4587 if (strlencmp(cmd, "undock") == 0) {
4588 if (!acpi_evalf(dock_handle, NULL, "_DCK", "vd", 0) ||
4589 !acpi_evalf(dock_handle, NULL, "_EJ0", "vd", 1))
4590 return -EIO;
4591 } else if (strlencmp(cmd, "dock") == 0) {
4592 if (!acpi_evalf(dock_handle, NULL, "_DCK", "vd", 1))
4593 return -EIO;
4594 } else
4595 return -EINVAL;
4596 }
4597
4598 return 0;
4599}
4600
4601#endif /* CONFIG_THINKPAD_ACPI_DOCK */
4602
4603/*************************************************************************
4604 * Bay subdriver
4605 */
4606
4607#ifdef CONFIG_THINKPAD_ACPI_BAY
4608
4609TPACPI_HANDLE(bay, root, "\\_SB.PCI.IDE.SECN.MAST", /* 570 */
4610 "\\_SB.PCI0.IDE0.IDES.IDSM", /* 600e/x, 770e, 770x */
4611 "\\_SB.PCI0.SATA.SCND.MSTR", /* T60, X60, Z60 */
4612 "\\_SB.PCI0.IDE0.SCND.MSTR", /* all others */
4613 ); /* A21e, R30, R31 */
4614TPACPI_HANDLE(bay_ej, bay, "_EJ3", /* 600e/x, A2xm/p, A3x */
4615 "_EJ0", /* all others */
4616 ); /* 570,A21e,G4x,R30,R31,R32,R40e,R50e */
4617TPACPI_HANDLE(bay2, root, "\\_SB.PCI0.IDE0.PRIM.SLAV", /* A3x, R32 */
4618 "\\_SB.PCI0.IDE0.IDEP.IDPS", /* 600e/x, 770e, 770x */
4619 ); /* all others */
4620TPACPI_HANDLE(bay2_ej, bay2, "_EJ3", /* 600e/x, 770e, A3x */
4621 "_EJ0", /* 770x */
4622 ); /* all others */
4623
4624static int __init bay_init(struct ibm_init_struct *iibm)
4625{
4626 vdbg_printk(TPACPI_DBG_INIT, "initializing bay subdriver\n");
4627
4628 TPACPI_ACPIHANDLE_INIT(bay);
4629 if (bay_handle)
4630 TPACPI_ACPIHANDLE_INIT(bay_ej);
4631 TPACPI_ACPIHANDLE_INIT(bay2);
4632 if (bay2_handle)
4633 TPACPI_ACPIHANDLE_INIT(bay2_ej);
4634
4635 tp_features.bay_status = bay_handle &&
4636 acpi_evalf(bay_handle, NULL, "_STA", "qv");
4637 tp_features.bay_status2 = bay2_handle &&
4638 acpi_evalf(bay2_handle, NULL, "_STA", "qv");
4639
4640 tp_features.bay_eject = bay_handle && bay_ej_handle &&
4641 (strlencmp(bay_ej_path, "_EJ0") == 0 || experimental);
4642 tp_features.bay_eject2 = bay2_handle && bay2_ej_handle &&
4643 (strlencmp(bay2_ej_path, "_EJ0") == 0 || experimental);
4644
4645 vdbg_printk(TPACPI_DBG_INIT,
4646 "bay 1: status %s, eject %s; bay 2: status %s, eject %s\n",
4647 str_supported(tp_features.bay_status),
4648 str_supported(tp_features.bay_eject),
4649 str_supported(tp_features.bay_status2),
4650 str_supported(tp_features.bay_eject2));
4651
4652 return (tp_features.bay_status || tp_features.bay_eject ||
4653 tp_features.bay_status2 || tp_features.bay_eject2)? 0 : 1;
4654}
4655
4656static void bay_notify(struct ibm_struct *ibm, u32 event)
4657{
4658 acpi_bus_generate_proc_event(ibm->acpi->device, event, 0);
4659 acpi_bus_generate_netlink_event(ibm->acpi->device->pnp.device_class,
4660 dev_name(&ibm->acpi->device->dev),
4661 event, 0);
4662}
4663
4664#define bay_occupied(b) (_sta(b##_handle) & 1)
4665
4666static int bay_read(char *p)
4667{
4668 int len = 0;
4669 int occupied = bay_occupied(bay);
4670 int occupied2 = bay_occupied(bay2);
4671 int eject, eject2;
4672
4673 len += sprintf(p + len, "status:\t\t%s\n",
4674 tp_features.bay_status ?
4675 (occupied ? "occupied" : "unoccupied") :
4676 "not supported");
4677 if (tp_features.bay_status2)
4678 len += sprintf(p + len, "status2:\t%s\n", occupied2 ?
4679 "occupied" : "unoccupied");
4680
4681 eject = tp_features.bay_eject && occupied;
4682 eject2 = tp_features.bay_eject2 && occupied2;
4683
4684 if (eject && eject2)
4685 len += sprintf(p + len, "commands:\teject, eject2\n");
4686 else if (eject)
4687 len += sprintf(p + len, "commands:\teject\n");
4688 else if (eject2)
4689 len += sprintf(p + len, "commands:\teject2\n");
4690
4691 return len;
4692}
4693
4694static int bay_write(char *buf)
4695{
4696 char *cmd;
4697
4698 if (!tp_features.bay_eject && !tp_features.bay_eject2)
4699 return -ENODEV;
4700
4701 while ((cmd = next_cmd(&buf))) {
4702 if (tp_features.bay_eject && strlencmp(cmd, "eject") == 0) {
4703 if (!acpi_evalf(bay_ej_handle, NULL, NULL, "vd", 1))
4704 return -EIO;
4705 } else if (tp_features.bay_eject2 &&
4706 strlencmp(cmd, "eject2") == 0) {
4707 if (!acpi_evalf(bay2_ej_handle, NULL, NULL, "vd", 1))
4708 return -EIO;
4709 } else
4710 return -EINVAL;
4711 }
4712
4713 return 0;
4714}
4715
4716static struct tp_acpi_drv_struct ibm_bay_acpidriver = {
4717 .notify = bay_notify,
4718 .handle = &bay_handle,
4719 .type = ACPI_SYSTEM_NOTIFY,
4720};
4721
4722static struct ibm_struct bay_driver_data = {
4723 .name = "bay",
4724 .read = bay_read,
4725 .write = bay_write,
4726 .acpi = &ibm_bay_acpidriver,
4727};
4728
4729#endif /* CONFIG_THINKPAD_ACPI_BAY */
4730
4731/*************************************************************************
4732 * CMOS subdriver 4429 * CMOS subdriver
4733 */ 4430 */
4734 4431
@@ -5945,14 +5642,48 @@ static struct backlight_ops ibm_backlight_data = {
5945 5642
5946/* --------------------------------------------------------------------- */ 5643/* --------------------------------------------------------------------- */
5947 5644
5645/*
5646 * These are only useful for models that have only one possibility
5647 * of GPU. If the BIOS model handles both ATI and Intel, don't use
5648 * these quirks.
5649 */
5650#define TPACPI_BRGHT_Q_NOEC 0x0001 /* Must NOT use EC HBRV */
5651#define TPACPI_BRGHT_Q_EC 0x0002 /* Should or must use EC HBRV */
5652#define TPACPI_BRGHT_Q_ASK 0x8000 /* Ask for user report */
5653
5654static const struct tpacpi_quirk brightness_quirk_table[] __initconst = {
5655 /* Models with ATI GPUs known to require ECNVRAM mode */
5656 TPACPI_Q_IBM('1', 'Y', TPACPI_BRGHT_Q_EC), /* T43/p ATI */
5657
5658 /* Models with ATI GPUs (waiting confirmation) */
5659 TPACPI_Q_IBM('1', 'R', TPACPI_BRGHT_Q_ASK|TPACPI_BRGHT_Q_EC),
5660 TPACPI_Q_IBM('1', 'Q', TPACPI_BRGHT_Q_ASK|TPACPI_BRGHT_Q_EC),
5661 TPACPI_Q_IBM('7', '6', TPACPI_BRGHT_Q_ASK|TPACPI_BRGHT_Q_EC),
5662 TPACPI_Q_IBM('7', '8', TPACPI_BRGHT_Q_ASK|TPACPI_BRGHT_Q_EC),
5663
5664 /* Models with Intel Extreme Graphics 2 (waiting confirmation) */
5665 TPACPI_Q_IBM('1', 'V', TPACPI_BRGHT_Q_ASK|TPACPI_BRGHT_Q_NOEC),
5666 TPACPI_Q_IBM('1', 'W', TPACPI_BRGHT_Q_ASK|TPACPI_BRGHT_Q_NOEC),
5667 TPACPI_Q_IBM('1', 'U', TPACPI_BRGHT_Q_ASK|TPACPI_BRGHT_Q_NOEC),
5668
5669 /* Models with Intel GMA900 */
5670 TPACPI_Q_IBM('7', '0', TPACPI_BRGHT_Q_NOEC), /* T43, R52 */
5671 TPACPI_Q_IBM('7', '4', TPACPI_BRGHT_Q_NOEC), /* X41 */
5672 TPACPI_Q_IBM('7', '5', TPACPI_BRGHT_Q_NOEC), /* X41 Tablet */
5673};
5674
5948static int __init brightness_init(struct ibm_init_struct *iibm) 5675static int __init brightness_init(struct ibm_init_struct *iibm)
5949{ 5676{
5950 int b; 5677 int b;
5678 unsigned long quirks;
5951 5679
5952 vdbg_printk(TPACPI_DBG_INIT, "initializing brightness subdriver\n"); 5680 vdbg_printk(TPACPI_DBG_INIT, "initializing brightness subdriver\n");
5953 5681
5954 mutex_init(&brightness_mutex); 5682 mutex_init(&brightness_mutex);
5955 5683
5684 quirks = tpacpi_check_quirks(brightness_quirk_table,
5685 ARRAY_SIZE(brightness_quirk_table));
5686
5956 /* 5687 /*
5957 * We always attempt to detect acpi support, so as to switch 5688 * We always attempt to detect acpi support, so as to switch
5958 * Lenovo Vista BIOS to ACPI brightness mode even if we are not 5689 * Lenovo Vista BIOS to ACPI brightness mode even if we are not
@@ -6009,23 +5740,13 @@ static int __init brightness_init(struct ibm_init_struct *iibm)
6009 /* TPACPI_BRGHT_MODE_AUTO not implemented yet, just use default */ 5740 /* TPACPI_BRGHT_MODE_AUTO not implemented yet, just use default */
6010 if (brightness_mode == TPACPI_BRGHT_MODE_AUTO || 5741 if (brightness_mode == TPACPI_BRGHT_MODE_AUTO ||
6011 brightness_mode == TPACPI_BRGHT_MODE_MAX) { 5742 brightness_mode == TPACPI_BRGHT_MODE_MAX) {
6012 if (thinkpad_id.vendor == PCI_VENDOR_ID_IBM) { 5743 if (quirks & TPACPI_BRGHT_Q_EC)
6013 /* 5744 brightness_mode = TPACPI_BRGHT_MODE_ECNVRAM;
6014 * IBM models that define HBRV probably have 5745 else
6015 * EC-based backlight level control
6016 */
6017 if (acpi_evalf(ec_handle, NULL, "HBRV", "qd"))
6018 /* T40-T43, R50-R52, R50e, R51e, X31-X41 */
6019 brightness_mode = TPACPI_BRGHT_MODE_ECNVRAM;
6020 else
6021 /* all other IBM ThinkPads */
6022 brightness_mode = TPACPI_BRGHT_MODE_UCMS_STEP;
6023 } else
6024 /* All Lenovo ThinkPads */
6025 brightness_mode = TPACPI_BRGHT_MODE_UCMS_STEP; 5746 brightness_mode = TPACPI_BRGHT_MODE_UCMS_STEP;
6026 5747
6027 dbg_printk(TPACPI_DBG_BRGHT, 5748 dbg_printk(TPACPI_DBG_BRGHT,
6028 "selected brightness_mode=%d\n", 5749 "driver auto-selected brightness_mode=%d\n",
6029 brightness_mode); 5750 brightness_mode);
6030 } 5751 }
6031 5752
@@ -6052,6 +5773,15 @@ static int __init brightness_init(struct ibm_init_struct *iibm)
6052 vdbg_printk(TPACPI_DBG_INIT | TPACPI_DBG_BRGHT, 5773 vdbg_printk(TPACPI_DBG_INIT | TPACPI_DBG_BRGHT,
6053 "brightness is supported\n"); 5774 "brightness is supported\n");
6054 5775
5776 if (quirks & TPACPI_BRGHT_Q_ASK) {
5777 printk(TPACPI_NOTICE
5778 "brightness: will use unverified default: "
5779 "brightness_mode=%d\n", brightness_mode);
5780 printk(TPACPI_NOTICE
5781 "brightness: please report to %s whether it works well "
5782 "or not on your ThinkPad\n", TPACPI_MAIL);
5783 }
5784
6055 ibm_backlight_device->props.max_brightness = 5785 ibm_backlight_device->props.max_brightness =
6056 (tp_features.bright_16levels)? 15 : 7; 5786 (tp_features.bright_16levels)? 15 : 7;
6057 ibm_backlight_device->props.brightness = b & TP_EC_BACKLIGHT_LVLMSK; 5787 ibm_backlight_device->props.brightness = b & TP_EC_BACKLIGHT_LVLMSK;
@@ -7854,22 +7584,6 @@ static struct ibm_init_struct ibms_init[] __initdata = {
7854 .init = light_init, 7584 .init = light_init,
7855 .data = &light_driver_data, 7585 .data = &light_driver_data,
7856 }, 7586 },
7857#ifdef CONFIG_THINKPAD_ACPI_DOCK
7858 {
7859 .init = dock_init,
7860 .data = &dock_driver_data[0],
7861 },
7862 {
7863 .init = dock_init2,
7864 .data = &dock_driver_data[1],
7865 },
7866#endif
7867#ifdef CONFIG_THINKPAD_ACPI_BAY
7868 {
7869 .init = bay_init,
7870 .data = &bay_driver_data,
7871 },
7872#endif
7873 { 7587 {
7874 .init = cmos_init, 7588 .init = cmos_init,
7875 .data = &cmos_driver_data, 7589 .data = &cmos_driver_data,
@@ -7968,12 +7682,6 @@ TPACPI_PARAM(hotkey);
7968TPACPI_PARAM(bluetooth); 7682TPACPI_PARAM(bluetooth);
7969TPACPI_PARAM(video); 7683TPACPI_PARAM(video);
7970TPACPI_PARAM(light); 7684TPACPI_PARAM(light);
7971#ifdef CONFIG_THINKPAD_ACPI_DOCK
7972TPACPI_PARAM(dock);
7973#endif
7974#ifdef CONFIG_THINKPAD_ACPI_BAY
7975TPACPI_PARAM(bay);
7976#endif /* CONFIG_THINKPAD_ACPI_BAY */
7977TPACPI_PARAM(cmos); 7685TPACPI_PARAM(cmos);
7978TPACPI_PARAM(led); 7686TPACPI_PARAM(led);
7979TPACPI_PARAM(beep); 7687TPACPI_PARAM(beep);
diff --git a/drivers/power/Kconfig b/drivers/power/Kconfig
index 7eda34838bfe..bdbc4f73fcdc 100644
--- a/drivers/power/Kconfig
+++ b/drivers/power/Kconfig
@@ -43,6 +43,13 @@ config BATTERY_DS2760
43 help 43 help
44 Say Y here to enable support for batteries with ds2760 chip. 44 Say Y here to enable support for batteries with ds2760 chip.
45 45
46config BATTERY_DS2782
47 tristate "DS2782 standalone gas-gauge"
48 depends on I2C
49 help
50 Say Y here to enable support for the DS2782 standalone battery
51 gas-gauge.
52
46config BATTERY_PMU 53config BATTERY_PMU
47 tristate "Apple PMU battery" 54 tristate "Apple PMU battery"
48 depends on PPC32 && ADB_PMU 55 depends on PPC32 && ADB_PMU
diff --git a/drivers/power/Makefile b/drivers/power/Makefile
index daf3179689aa..380d17c9ae29 100644
--- a/drivers/power/Makefile
+++ b/drivers/power/Makefile
@@ -19,6 +19,7 @@ obj-$(CONFIG_APM_POWER) += apm_power.o
19obj-$(CONFIG_WM8350_POWER) += wm8350_power.o 19obj-$(CONFIG_WM8350_POWER) += wm8350_power.o
20 20
21obj-$(CONFIG_BATTERY_DS2760) += ds2760_battery.o 21obj-$(CONFIG_BATTERY_DS2760) += ds2760_battery.o
22obj-$(CONFIG_BATTERY_DS2782) += ds2782_battery.o
22obj-$(CONFIG_BATTERY_PMU) += pmu_battery.o 23obj-$(CONFIG_BATTERY_PMU) += pmu_battery.o
23obj-$(CONFIG_BATTERY_OLPC) += olpc_battery.o 24obj-$(CONFIG_BATTERY_OLPC) += olpc_battery.o
24obj-$(CONFIG_BATTERY_TOSA) += tosa_battery.o 25obj-$(CONFIG_BATTERY_TOSA) += tosa_battery.o
diff --git a/drivers/power/ds2782_battery.c b/drivers/power/ds2782_battery.c
new file mode 100644
index 000000000000..da14f374cb60
--- /dev/null
+++ b/drivers/power/ds2782_battery.c
@@ -0,0 +1,330 @@
1/*
2 * I2C client/driver for the Maxim/Dallas DS2782 Stand-Alone Fuel Gauge IC
3 *
4 * Copyright (C) 2009 Bluewater Systems Ltd
5 *
6 * Author: Ryan Mallon <ryan@bluewatersys.com>
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/kernel.h>
15#include <linux/module.h>
16#include <linux/types.h>
17#include <linux/errno.h>
18#include <linux/swab.h>
19#include <linux/i2c.h>
20#include <linux/idr.h>
21#include <linux/power_supply.h>
22
23#define DS2782_REG_RARC 0x06 /* Remaining active relative capacity */
24
25#define DS2782_REG_VOLT_MSB 0x0c
26#define DS2782_REG_TEMP_MSB 0x0a
27#define DS2782_REG_CURRENT_MSB 0x0e
28
29/* EEPROM Block */
30#define DS2782_REG_RSNSP 0x69 /* Sense resistor value */
31
32/* Current unit measurement in uA for a 1 milli-ohm sense resistor */
33#define DS2782_CURRENT_UNITS 1563
34
35#define to_ds2782_info(x) container_of(x, struct ds2782_info, battery)
36
37struct ds2782_info {
38 struct i2c_client *client;
39 struct power_supply battery;
40 int id;
41};
42
43static DEFINE_IDR(battery_id);
44static DEFINE_MUTEX(battery_lock);
45
46static inline int ds2782_read_reg(struct ds2782_info *info, int reg, u8 *val)
47{
48 int ret;
49
50 ret = i2c_smbus_read_byte_data(info->client, reg);
51 if (ret < 0) {
52 dev_err(&info->client->dev, "register read failed\n");
53 return ret;
54 }
55
56 *val = ret;
57 return 0;
58}
59
60static inline int ds2782_read_reg16(struct ds2782_info *info, int reg_msb,
61 s16 *val)
62{
63 int ret;
64
65 ret = swab16(i2c_smbus_read_word_data(info->client, reg_msb));
66 if (ret < 0) {
67 dev_err(&info->client->dev, "register read failed\n");
68 return ret;
69 }
70
71 *val = ret;
72 return 0;
73}
74
75static int ds2782_get_temp(struct ds2782_info *info, int *temp)
76{
77 s16 raw;
78 int err;
79
80 /*
81 * Temperature is measured in units of 0.125 degrees celcius, the
82 * power_supply class measures temperature in tenths of degrees
83 * celsius. The temperature value is stored as a 10 bit number, plus
84 * sign in the upper bits of a 16 bit register.
85 */
86 err = ds2782_read_reg16(info, DS2782_REG_TEMP_MSB, &raw);
87 if (err)
88 return err;
89 *temp = ((raw / 32) * 125) / 100;
90 return 0;
91}
92
93static int ds2782_get_current(struct ds2782_info *info, int *current_uA)
94{
95 int sense_res;
96 int err;
97 u8 sense_res_raw;
98 s16 raw;
99
100 /*
101 * The units of measurement for current are dependent on the value of
102 * the sense resistor.
103 */
104 err = ds2782_read_reg(info, DS2782_REG_RSNSP, &sense_res_raw);
105 if (err)
106 return err;
107 if (sense_res_raw == 0) {
108 dev_err(&info->client->dev, "sense resistor value is 0\n");
109 return -ENXIO;
110 }
111 sense_res = 1000 / sense_res_raw;
112
113 dev_dbg(&info->client->dev, "sense resistor = %d milli-ohms\n",
114 sense_res);
115 err = ds2782_read_reg16(info, DS2782_REG_CURRENT_MSB, &raw);
116 if (err)
117 return err;
118 *current_uA = raw * (DS2782_CURRENT_UNITS / sense_res);
119 return 0;
120}
121
122static int ds2782_get_voltage(struct ds2782_info *info, int *voltage_uA)
123{
124 s16 raw;
125 int err;
126
127 /*
128 * Voltage is measured in units of 4.88mV. The voltage is stored as
129 * a 10-bit number plus sign, in the upper bits of a 16-bit register
130 */
131 err = ds2782_read_reg16(info, DS2782_REG_VOLT_MSB, &raw);
132 if (err)
133 return err;
134 *voltage_uA = (raw / 32) * 4800;
135 return 0;
136}
137
138static int ds2782_get_capacity(struct ds2782_info *info, int *capacity)
139{
140 int err;
141 u8 raw;
142
143 err = ds2782_read_reg(info, DS2782_REG_RARC, &raw);
144 if (err)
145 return err;
146 *capacity = raw;
147 return raw;
148}
149
150static int ds2782_get_status(struct ds2782_info *info, int *status)
151{
152 int err;
153 int current_uA;
154 int capacity;
155
156 err = ds2782_get_current(info, &current_uA);
157 if (err)
158 return err;
159
160 err = ds2782_get_capacity(info, &capacity);
161 if (err)
162 return err;
163
164 if (capacity == 100)
165 *status = POWER_SUPPLY_STATUS_FULL;
166 else if (current_uA == 0)
167 *status = POWER_SUPPLY_STATUS_NOT_CHARGING;
168 else if (current_uA < 0)
169 *status = POWER_SUPPLY_STATUS_DISCHARGING;
170 else
171 *status = POWER_SUPPLY_STATUS_CHARGING;
172
173 return 0;
174}
175
176static int ds2782_battery_get_property(struct power_supply *psy,
177 enum power_supply_property prop,
178 union power_supply_propval *val)
179{
180 struct ds2782_info *info = to_ds2782_info(psy);
181 int ret;
182
183 switch (prop) {
184 case POWER_SUPPLY_PROP_STATUS:
185 ret = ds2782_get_status(info, &val->intval);
186 break;
187
188 case POWER_SUPPLY_PROP_CAPACITY:
189 ret = ds2782_get_capacity(info, &val->intval);
190 break;
191
192 case POWER_SUPPLY_PROP_VOLTAGE_NOW:
193 ret = ds2782_get_voltage(info, &val->intval);
194 break;
195
196 case POWER_SUPPLY_PROP_CURRENT_NOW:
197 ret = ds2782_get_current(info, &val->intval);
198 break;
199
200 case POWER_SUPPLY_PROP_TEMP:
201 ret = ds2782_get_temp(info, &val->intval);
202 break;
203
204 default:
205 ret = -EINVAL;
206 }
207
208 return ret;
209}
210
211static enum power_supply_property ds2782_battery_props[] = {
212 POWER_SUPPLY_PROP_STATUS,
213 POWER_SUPPLY_PROP_CAPACITY,
214 POWER_SUPPLY_PROP_VOLTAGE_NOW,
215 POWER_SUPPLY_PROP_CURRENT_NOW,
216 POWER_SUPPLY_PROP_TEMP,
217};
218
219static void ds2782_power_supply_init(struct power_supply *battery)
220{
221 battery->type = POWER_SUPPLY_TYPE_BATTERY;
222 battery->properties = ds2782_battery_props;
223 battery->num_properties = ARRAY_SIZE(ds2782_battery_props);
224 battery->get_property = ds2782_battery_get_property;
225 battery->external_power_changed = NULL;
226}
227
228static int ds2782_battery_remove(struct i2c_client *client)
229{
230 struct ds2782_info *info = i2c_get_clientdata(client);
231
232 power_supply_unregister(&info->battery);
233 kfree(info->battery.name);
234
235 mutex_lock(&battery_lock);
236 idr_remove(&battery_id, info->id);
237 mutex_unlock(&battery_lock);
238
239 i2c_set_clientdata(client, info);
240
241 kfree(info);
242 return 0;
243}
244
245static int ds2782_battery_probe(struct i2c_client *client,
246 const struct i2c_device_id *id)
247{
248 struct ds2782_info *info;
249 int ret;
250 int num;
251
252 /* Get an ID for this battery */
253 ret = idr_pre_get(&battery_id, GFP_KERNEL);
254 if (ret == 0) {
255 ret = -ENOMEM;
256 goto fail_id;
257 }
258
259 mutex_lock(&battery_lock);
260 ret = idr_get_new(&battery_id, client, &num);
261 mutex_unlock(&battery_lock);
262 if (ret < 0)
263 goto fail_id;
264
265 info = kzalloc(sizeof(*info), GFP_KERNEL);
266 if (!info) {
267 ret = -ENOMEM;
268 goto fail_info;
269 }
270
271 info->battery.name = kasprintf(GFP_KERNEL, "ds2782-%d", num);
272 if (!info->battery.name) {
273 ret = -ENOMEM;
274 goto fail_name;
275 }
276
277 i2c_set_clientdata(client, info);
278 info->client = client;
279 ds2782_power_supply_init(&info->battery);
280
281 ret = power_supply_register(&client->dev, &info->battery);
282 if (ret) {
283 dev_err(&client->dev, "failed to register battery\n");
284 goto fail_register;
285 }
286
287 return 0;
288
289fail_register:
290 kfree(info->battery.name);
291fail_name:
292 i2c_set_clientdata(client, info);
293 kfree(info);
294fail_info:
295 mutex_lock(&battery_lock);
296 idr_remove(&battery_id, num);
297 mutex_unlock(&battery_lock);
298fail_id:
299 return ret;
300}
301
302static const struct i2c_device_id ds2782_id[] = {
303 {"ds2782", 0},
304 {},
305};
306
307static struct i2c_driver ds2782_battery_driver = {
308 .driver = {
309 .name = "ds2782-battery",
310 },
311 .probe = ds2782_battery_probe,
312 .remove = ds2782_battery_remove,
313 .id_table = ds2782_id,
314};
315
316static int __init ds2782_init(void)
317{
318 return i2c_add_driver(&ds2782_battery_driver);
319}
320module_init(ds2782_init);
321
322static void __exit ds2782_exit(void)
323{
324 i2c_del_driver(&ds2782_battery_driver);
325}
326module_exit(ds2782_exit);
327
328MODULE_AUTHOR("Ryan Mallon <ryan@bluewatersys.com>");
329MODULE_DESCRIPTION("Maxim/Dallas DS2782 Stand-Alone Fuel Gauage IC driver");
330MODULE_LICENSE("GPL");
diff --git a/drivers/power/olpc_battery.c b/drivers/power/olpc_battery.c
index 5fbca2681baa..58e419299cd6 100644
--- a/drivers/power/olpc_battery.c
+++ b/drivers/power/olpc_battery.c
@@ -8,6 +8,7 @@
8 * published by the Free Software Foundation. 8 * published by the Free Software Foundation.
9 */ 9 */
10 10
11#include <linux/kernel.h>
11#include <linux/module.h> 12#include <linux/module.h>
12#include <linux/err.h> 13#include <linux/err.h>
13#include <linux/platform_device.h> 14#include <linux/platform_device.h>
@@ -35,6 +36,7 @@
35#define BAT_STAT_AC 0x10 36#define BAT_STAT_AC 0x10
36#define BAT_STAT_CHARGING 0x20 37#define BAT_STAT_CHARGING 0x20
37#define BAT_STAT_DISCHARGING 0x40 38#define BAT_STAT_DISCHARGING 0x40
39#define BAT_STAT_TRICKLE 0x80
38 40
39#define BAT_ERR_INFOFAIL 0x02 41#define BAT_ERR_INFOFAIL 0x02
40#define BAT_ERR_OVERVOLTAGE 0x04 42#define BAT_ERR_OVERVOLTAGE 0x04
@@ -89,7 +91,7 @@ static char bat_serial[17]; /* Ick */
89static int olpc_bat_get_status(union power_supply_propval *val, uint8_t ec_byte) 91static int olpc_bat_get_status(union power_supply_propval *val, uint8_t ec_byte)
90{ 92{
91 if (olpc_platform_info.ecver > 0x44) { 93 if (olpc_platform_info.ecver > 0x44) {
92 if (ec_byte & BAT_STAT_CHARGING) 94 if (ec_byte & (BAT_STAT_CHARGING | BAT_STAT_TRICKLE))
93 val->intval = POWER_SUPPLY_STATUS_CHARGING; 95 val->intval = POWER_SUPPLY_STATUS_CHARGING;
94 else if (ec_byte & BAT_STAT_DISCHARGING) 96 else if (ec_byte & BAT_STAT_DISCHARGING)
95 val->intval = POWER_SUPPLY_STATUS_DISCHARGING; 97 val->intval = POWER_SUPPLY_STATUS_DISCHARGING;
@@ -219,7 +221,8 @@ static int olpc_bat_get_property(struct power_supply *psy,
219 It doesn't matter though -- the EC will return the last-known 221 It doesn't matter though -- the EC will return the last-known
220 information, and it's as if we just ran that _little_ bit faster 222 information, and it's as if we just ran that _little_ bit faster
221 and managed to read it out before the battery went away. */ 223 and managed to read it out before the battery went away. */
222 if (!(ec_byte & BAT_STAT_PRESENT) && psp != POWER_SUPPLY_PROP_PRESENT) 224 if (!(ec_byte & (BAT_STAT_PRESENT | BAT_STAT_TRICKLE)) &&
225 psp != POWER_SUPPLY_PROP_PRESENT)
223 return -ENODEV; 226 return -ENODEV;
224 227
225 switch (psp) { 228 switch (psp) {
@@ -229,7 +232,8 @@ static int olpc_bat_get_property(struct power_supply *psy,
229 return ret; 232 return ret;
230 break; 233 break;
231 case POWER_SUPPLY_PROP_PRESENT: 234 case POWER_SUPPLY_PROP_PRESENT:
232 val->intval = !!(ec_byte & BAT_STAT_PRESENT); 235 val->intval = !!(ec_byte & (BAT_STAT_PRESENT |
236 BAT_STAT_TRICKLE));
233 break; 237 break;
234 238
235 case POWER_SUPPLY_PROP_HEALTH: 239 case POWER_SUPPLY_PROP_HEALTH:
@@ -334,21 +338,21 @@ static ssize_t olpc_bat_eeprom_read(struct kobject *kobj,
334 struct bin_attribute *attr, char *buf, loff_t off, size_t count) 338 struct bin_attribute *attr, char *buf, loff_t off, size_t count)
335{ 339{
336 uint8_t ec_byte; 340 uint8_t ec_byte;
337 int ret, end; 341 int ret;
342 int i;
338 343
339 if (off >= EEPROM_SIZE) 344 if (off >= EEPROM_SIZE)
340 return 0; 345 return 0;
341 if (off + count > EEPROM_SIZE) 346 if (off + count > EEPROM_SIZE)
342 count = EEPROM_SIZE - off; 347 count = EEPROM_SIZE - off;
343 348
344 end = EEPROM_START + off + count; 349 for (i = 0; i < count; i++) {
345 for (ec_byte = EEPROM_START + off; ec_byte < end; ec_byte++) { 350 ec_byte = EEPROM_START + off + i;
346 ret = olpc_ec_cmd(EC_BAT_EEPROM, &ec_byte, 1, 351 ret = olpc_ec_cmd(EC_BAT_EEPROM, &ec_byte, 1, &buf[i], 1);
347 &buf[ec_byte - EEPROM_START], 1);
348 if (ret) { 352 if (ret) {
349 printk(KERN_ERR "olpc-battery: EC command " 353 pr_err("olpc-battery: "
350 "EC_BAT_EEPROM @ 0x%x failed -" 354 "EC_BAT_EEPROM cmd @ 0x%x failed - %d!\n",
351 " %d!\n", ec_byte, ret); 355 ec_byte, ret);
352 return -EIO; 356 return -EIO;
353 } 357 }
354 } 358 }
diff --git a/drivers/power/wm97xx_battery.c b/drivers/power/wm97xx_battery.c
index 8bde92126d34..b787335a8419 100644
--- a/drivers/power/wm97xx_battery.c
+++ b/drivers/power/wm97xx_battery.c
@@ -33,14 +33,14 @@ static enum power_supply_property *prop;
33 33
34static unsigned long wm97xx_read_bat(struct power_supply *bat_ps) 34static unsigned long wm97xx_read_bat(struct power_supply *bat_ps)
35{ 35{
36 return wm97xx_read_aux_adc(bat_ps->dev->parent->driver_data, 36 return wm97xx_read_aux_adc(dev_get_drvdata(bat_ps->dev->parent),
37 pdata->batt_aux) * pdata->batt_mult / 37 pdata->batt_aux) * pdata->batt_mult /
38 pdata->batt_div; 38 pdata->batt_div;
39} 39}
40 40
41static unsigned long wm97xx_read_temp(struct power_supply *bat_ps) 41static unsigned long wm97xx_read_temp(struct power_supply *bat_ps)
42{ 42{
43 return wm97xx_read_aux_adc(bat_ps->dev->parent->driver_data, 43 return wm97xx_read_aux_adc(dev_get_drvdata(bat_ps->dev->parent),
44 pdata->temp_aux) * pdata->temp_mult / 44 pdata->temp_aux) * pdata->temp_mult /
45 pdata->temp_div; 45 pdata->temp_div;
46} 46}
diff --git a/drivers/rtc/rtc-bfin.c b/drivers/rtc/rtc-bfin.c
index aafd3e6ebb0d..a118eb0f1e67 100644
--- a/drivers/rtc/rtc-bfin.c
+++ b/drivers/rtc/rtc-bfin.c
@@ -1,8 +1,8 @@
1/* 1/*
2 * Blackfin On-Chip Real Time Clock Driver 2 * Blackfin On-Chip Real Time Clock Driver
3 * Supports BF52[257]/BF53[123]/BF53[467]/BF54[24789] 3 * Supports BF51x/BF52x/BF53[123]/BF53[467]/BF54x
4 * 4 *
5 * Copyright 2004-2008 Analog Devices Inc. 5 * Copyright 2004-2009 Analog Devices Inc.
6 * 6 *
7 * Enter bugs at http://blackfin.uclinux.org/ 7 * Enter bugs at http://blackfin.uclinux.org/
8 * 8 *
@@ -363,7 +363,7 @@ static int __devinit bfin_rtc_probe(struct platform_device *pdev)
363 struct bfin_rtc *rtc; 363 struct bfin_rtc *rtc;
364 struct device *dev = &pdev->dev; 364 struct device *dev = &pdev->dev;
365 int ret = 0; 365 int ret = 0;
366 unsigned long timeout; 366 unsigned long timeout = jiffies + HZ;
367 367
368 dev_dbg_stamp(dev); 368 dev_dbg_stamp(dev);
369 369
@@ -374,32 +374,32 @@ static int __devinit bfin_rtc_probe(struct platform_device *pdev)
374 platform_set_drvdata(pdev, rtc); 374 platform_set_drvdata(pdev, rtc);
375 device_init_wakeup(dev, 1); 375 device_init_wakeup(dev, 1);
376 376
377 /* Register our RTC with the RTC framework */
378 rtc->rtc_dev = rtc_device_register(pdev->name, dev, &bfin_rtc_ops,
379 THIS_MODULE);
380 if (unlikely(IS_ERR(rtc->rtc_dev))) {
381 ret = PTR_ERR(rtc->rtc_dev);
382 goto err;
383 }
384
377 /* Grab the IRQ and init the hardware */ 385 /* Grab the IRQ and init the hardware */
378 ret = request_irq(IRQ_RTC, bfin_rtc_interrupt, IRQF_SHARED, pdev->name, dev); 386 ret = request_irq(IRQ_RTC, bfin_rtc_interrupt, IRQF_SHARED, pdev->name, dev);
379 if (unlikely(ret)) 387 if (unlikely(ret))
380 goto err; 388 goto err_reg;
381 /* sometimes the bootloader touched things, but the write complete was not 389 /* sometimes the bootloader touched things, but the write complete was not
382 * enabled, so let's just do a quick timeout here since the IRQ will not fire ... 390 * enabled, so let's just do a quick timeout here since the IRQ will not fire ...
383 */ 391 */
384 timeout = jiffies + HZ;
385 while (bfin_read_RTC_ISTAT() & RTC_ISTAT_WRITE_PENDING) 392 while (bfin_read_RTC_ISTAT() & RTC_ISTAT_WRITE_PENDING)
386 if (time_after(jiffies, timeout)) 393 if (time_after(jiffies, timeout))
387 break; 394 break;
388 bfin_rtc_reset(dev, RTC_ISTAT_WRITE_COMPLETE); 395 bfin_rtc_reset(dev, RTC_ISTAT_WRITE_COMPLETE);
389 bfin_write_RTC_SWCNT(0); 396 bfin_write_RTC_SWCNT(0);
390 397
391 /* Register our RTC with the RTC framework */
392 rtc->rtc_dev = rtc_device_register(pdev->name, dev, &bfin_rtc_ops, THIS_MODULE);
393 if (unlikely(IS_ERR(rtc->rtc_dev))) {
394 ret = PTR_ERR(rtc->rtc_dev);
395 goto err_irq;
396 }
397
398 return 0; 398 return 0;
399 399
400 err_irq: 400err_reg:
401 free_irq(IRQ_RTC, dev); 401 rtc_device_unregister(rtc->rtc_dev);
402 err: 402err:
403 kfree(rtc); 403 kfree(rtc);
404 return ret; 404 return ret;
405} 405}
diff --git a/drivers/rtc/rtc-cmos.c b/drivers/rtc/rtc-cmos.c
index 23e10b6263d6..f7a4701bf863 100644
--- a/drivers/rtc/rtc-cmos.c
+++ b/drivers/rtc/rtc-cmos.c
@@ -1174,23 +1174,34 @@ static struct platform_driver cmos_platform_driver = {
1174 } 1174 }
1175}; 1175};
1176 1176
1177#ifdef CONFIG_PNP
1178static bool pnp_driver_registered;
1179#endif
1180static bool platform_driver_registered;
1181
1177static int __init cmos_init(void) 1182static int __init cmos_init(void)
1178{ 1183{
1179 int retval = 0; 1184 int retval = 0;
1180 1185
1181#ifdef CONFIG_PNP 1186#ifdef CONFIG_PNP
1182 pnp_register_driver(&cmos_pnp_driver); 1187 retval = pnp_register_driver(&cmos_pnp_driver);
1188 if (retval == 0)
1189 pnp_driver_registered = true;
1183#endif 1190#endif
1184 1191
1185 if (!cmos_rtc.dev) 1192 if (!cmos_rtc.dev) {
1186 retval = platform_driver_probe(&cmos_platform_driver, 1193 retval = platform_driver_probe(&cmos_platform_driver,
1187 cmos_platform_probe); 1194 cmos_platform_probe);
1195 if (retval == 0)
1196 platform_driver_registered = true;
1197 }
1188 1198
1189 if (retval == 0) 1199 if (retval == 0)
1190 return 0; 1200 return 0;
1191 1201
1192#ifdef CONFIG_PNP 1202#ifdef CONFIG_PNP
1193 pnp_unregister_driver(&cmos_pnp_driver); 1203 if (pnp_driver_registered)
1204 pnp_unregister_driver(&cmos_pnp_driver);
1194#endif 1205#endif
1195 return retval; 1206 return retval;
1196} 1207}
@@ -1199,9 +1210,11 @@ module_init(cmos_init);
1199static void __exit cmos_exit(void) 1210static void __exit cmos_exit(void)
1200{ 1211{
1201#ifdef CONFIG_PNP 1212#ifdef CONFIG_PNP
1202 pnp_unregister_driver(&cmos_pnp_driver); 1213 if (pnp_driver_registered)
1214 pnp_unregister_driver(&cmos_pnp_driver);
1203#endif 1215#endif
1204 platform_driver_unregister(&cmos_platform_driver); 1216 if (platform_driver_registered)
1217 platform_driver_unregister(&cmos_platform_driver);
1205} 1218}
1206module_exit(cmos_exit); 1219module_exit(cmos_exit);
1207 1220
diff --git a/drivers/rtc/rtc-ds1374.c b/drivers/rtc/rtc-ds1374.c
index 32b27739ec2a..713f7bf5afb3 100644
--- a/drivers/rtc/rtc-ds1374.c
+++ b/drivers/rtc/rtc-ds1374.c
@@ -283,7 +283,7 @@ static void ds1374_work(struct work_struct *work)
283 283
284 stat = i2c_smbus_read_byte_data(client, DS1374_REG_SR); 284 stat = i2c_smbus_read_byte_data(client, DS1374_REG_SR);
285 if (stat < 0) 285 if (stat < 0)
286 return; 286 goto unlock;
287 287
288 if (stat & DS1374_REG_SR_AF) { 288 if (stat & DS1374_REG_SR_AF) {
289 stat &= ~DS1374_REG_SR_AF; 289 stat &= ~DS1374_REG_SR_AF;
@@ -302,7 +302,7 @@ static void ds1374_work(struct work_struct *work)
302out: 302out:
303 if (!ds1374->exiting) 303 if (!ds1374->exiting)
304 enable_irq(client->irq); 304 enable_irq(client->irq);
305 305unlock:
306 mutex_unlock(&ds1374->mutex); 306 mutex_unlock(&ds1374->mutex);
307} 307}
308 308
diff --git a/drivers/rtc/rtc-vr41xx.c b/drivers/rtc/rtc-vr41xx.c
index f11297aff854..2c839d0d21bd 100644
--- a/drivers/rtc/rtc-vr41xx.c
+++ b/drivers/rtc/rtc-vr41xx.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * Driver for NEC VR4100 series Real Time Clock unit. 2 * Driver for NEC VR4100 series Real Time Clock unit.
3 * 3 *
4 * Copyright (C) 2003-2008 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> 4 * Copyright (C) 2003-2008 Yoichi Yuasa <yuasa@linux-mips.org>
5 * 5 *
6 * This program is free software; you can redistribute it and/or modify 6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by 7 * it under the terms of the GNU General Public License as published by
@@ -33,7 +33,7 @@
33#include <asm/io.h> 33#include <asm/io.h>
34#include <asm/uaccess.h> 34#include <asm/uaccess.h>
35 35
36MODULE_AUTHOR("Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>"); 36MODULE_AUTHOR("Yoichi Yuasa <yuasa@linux-mips.org>");
37MODULE_DESCRIPTION("NEC VR4100 series RTC driver"); 37MODULE_DESCRIPTION("NEC VR4100 series RTC driver");
38MODULE_LICENSE("GPL v2"); 38MODULE_LICENSE("GPL v2");
39 39
diff --git a/drivers/s390/block/dasd_eckd.c b/drivers/s390/block/dasd_eckd.c
index f8b1f04f26b8..c11770f5b368 100644
--- a/drivers/s390/block/dasd_eckd.c
+++ b/drivers/s390/block/dasd_eckd.c
@@ -1696,8 +1696,7 @@ static void dasd_eckd_handle_unsolicited_interrupt(struct dasd_device *device,
1696 DBF_DEV_EVENT(DBF_ERR, device, "%s", 1696 DBF_DEV_EVENT(DBF_ERR, device, "%s",
1697 "unsolicited interrupt received " 1697 "unsolicited interrupt received "
1698 "(sense available)"); 1698 "(sense available)");
1699 device->discipline->dump_sense_dbf(device, NULL, irb, 1699 device->discipline->dump_sense_dbf(device, irb, "unsolicited");
1700 "unsolicited");
1701 } 1700 }
1702 1701
1703 dasd_schedule_device_bh(device); 1702 dasd_schedule_device_bh(device);
@@ -2941,42 +2940,20 @@ dasd_eckd_dump_ccw_range(struct ccw1 *from, struct ccw1 *to, char *page)
2941} 2940}
2942 2941
2943static void 2942static void
2944dasd_eckd_dump_sense_dbf(struct dasd_device *device, struct dasd_ccw_req *req, 2943dasd_eckd_dump_sense_dbf(struct dasd_device *device, struct irb *irb,
2945 struct irb *irb, char *reason) 2944 char *reason)
2946{ 2945{
2947 u64 *sense; 2946 u64 *sense;
2948 int sl;
2949 struct tsb *tsb;
2950 2947
2951 sense = NULL; 2948 sense = (u64 *) dasd_get_sense(irb);
2952 tsb = NULL;
2953 if (req && scsw_is_tm(&req->irb.scsw)) {
2954 if (irb->scsw.tm.tcw)
2955 tsb = tcw_get_tsb(
2956 (struct tcw *)(unsigned long)irb->scsw.tm.tcw);
2957 if (tsb && (irb->scsw.tm.fcxs == 0x01)) {
2958 switch (tsb->flags & 0x07) {
2959 case 1: /* tsa_iostat */
2960 sense = (u64 *)tsb->tsa.iostat.sense;
2961 break;
2962 case 2: /* ts_ddpc */
2963 sense = (u64 *)tsb->tsa.ddpc.sense;
2964 break;
2965 case 3: /* tsa_intrg */
2966 break;
2967 }
2968 }
2969 } else {
2970 if (irb->esw.esw0.erw.cons)
2971 sense = (u64 *)irb->ecw;
2972 }
2973 if (sense) { 2949 if (sense) {
2974 for (sl = 0; sl < 4; sl++) { 2950 DBF_DEV_EVENT(DBF_EMERG, device,
2975 DBF_DEV_EVENT(DBF_EMERG, device, 2951 "%s: %s %02x%02x%02x %016llx %016llx %016llx "
2976 "%s: %016llx %016llx %016llx %016llx", 2952 "%016llx", reason,
2977 reason, sense[0], sense[1], sense[2], 2953 scsw_is_tm(&irb->scsw) ? "t" : "c",
2978 sense[3]); 2954 scsw_cc(&irb->scsw), scsw_cstat(&irb->scsw),
2979 } 2955 scsw_dstat(&irb->scsw), sense[0], sense[1],
2956 sense[2], sense[3]);
2980 } else { 2957 } else {
2981 DBF_DEV_EVENT(DBF_EMERG, device, "%s", 2958 DBF_DEV_EVENT(DBF_EMERG, device, "%s",
2982 "SORRY - NO VALID SENSE AVAILABLE\n"); 2959 "SORRY - NO VALID SENSE AVAILABLE\n");
diff --git a/drivers/s390/block/dasd_erp.c b/drivers/s390/block/dasd_erp.c
index d970ce2814be..cb8f9cef7429 100644
--- a/drivers/s390/block/dasd_erp.c
+++ b/drivers/s390/block/dasd_erp.c
@@ -172,7 +172,7 @@ dasd_log_sense_dbf(struct dasd_ccw_req *cqr, struct irb *irb)
172 device = cqr->startdev; 172 device = cqr->startdev;
173 /* dump sense data to s390 debugfeature*/ 173 /* dump sense data to s390 debugfeature*/
174 if (device->discipline && device->discipline->dump_sense_dbf) 174 if (device->discipline && device->discipline->dump_sense_dbf)
175 device->discipline->dump_sense_dbf(device, cqr, irb, "log"); 175 device->discipline->dump_sense_dbf(device, irb, "log");
176} 176}
177EXPORT_SYMBOL(dasd_log_sense_dbf); 177EXPORT_SYMBOL(dasd_log_sense_dbf);
178 178
diff --git a/drivers/s390/block/dasd_fba.c b/drivers/s390/block/dasd_fba.c
index e21ee735f926..31849ad5e59f 100644
--- a/drivers/s390/block/dasd_fba.c
+++ b/drivers/s390/block/dasd_fba.c
@@ -241,7 +241,7 @@ static void dasd_fba_handle_unsolicited_interrupt(struct dasd_device *device,
241 /* check for unsolicited interrupts */ 241 /* check for unsolicited interrupts */
242 DBF_DEV_EVENT(DBF_WARNING, device, "%s", 242 DBF_DEV_EVENT(DBF_WARNING, device, "%s",
243 "unsolicited interrupt received"); 243 "unsolicited interrupt received");
244 device->discipline->dump_sense_dbf(device, NULL, irb, "unsolicited"); 244 device->discipline->dump_sense_dbf(device, irb, "unsolicited");
245 dasd_schedule_device_bh(device); 245 dasd_schedule_device_bh(device);
246 return; 246 return;
247}; 247};
@@ -444,17 +444,20 @@ dasd_fba_fill_info(struct dasd_device * device,
444} 444}
445 445
446static void 446static void
447dasd_fba_dump_sense_dbf(struct dasd_device *device, struct dasd_ccw_req *req, 447dasd_fba_dump_sense_dbf(struct dasd_device *device, struct irb *irb,
448 struct irb *irb, char *reason) 448 char *reason)
449{ 449{
450 int sl; 450 u64 *sense;
451 if (irb->esw.esw0.erw.cons) { 451
452 for (sl = 0; sl < 4; sl++) { 452 sense = (u64 *) dasd_get_sense(irb);
453 DBF_DEV_EVENT(DBF_EMERG, device, 453 if (sense) {
454 "%s: %08x %08x %08x %08x", 454 DBF_DEV_EVENT(DBF_EMERG, device,
455 reason, irb->ecw[8 * 0], irb->ecw[8 * 1], 455 "%s: %s %02x%02x%02x %016llx %016llx %016llx "
456 irb->ecw[8 * 2], irb->ecw[8 * 3]); 456 "%016llx", reason,
457 } 457 scsw_is_tm(&irb->scsw) ? "t" : "c",
458 scsw_cc(&irb->scsw), scsw_cstat(&irb->scsw),
459 scsw_dstat(&irb->scsw), sense[0], sense[1],
460 sense[2], sense[3]);
458 } else { 461 } else {
459 DBF_DEV_EVENT(DBF_EMERG, device, "%s", 462 DBF_DEV_EVENT(DBF_EMERG, device, "%s",
460 "SORRY - NO VALID SENSE AVAILABLE\n"); 463 "SORRY - NO VALID SENSE AVAILABLE\n");
diff --git a/drivers/s390/block/dasd_int.h b/drivers/s390/block/dasd_int.h
index fd63b2f2bda9..b699ca356ac5 100644
--- a/drivers/s390/block/dasd_int.h
+++ b/drivers/s390/block/dasd_int.h
@@ -284,8 +284,7 @@ struct dasd_discipline {
284 dasd_erp_fn_t(*erp_postaction) (struct dasd_ccw_req *); 284 dasd_erp_fn_t(*erp_postaction) (struct dasd_ccw_req *);
285 void (*dump_sense) (struct dasd_device *, struct dasd_ccw_req *, 285 void (*dump_sense) (struct dasd_device *, struct dasd_ccw_req *,
286 struct irb *); 286 struct irb *);
287 void (*dump_sense_dbf) (struct dasd_device *, struct dasd_ccw_req *, 287 void (*dump_sense_dbf) (struct dasd_device *, struct irb *, char *);
288 struct irb *, char *);
289 288
290 void (*handle_unsolicited_interrupt) (struct dasd_device *, 289 void (*handle_unsolicited_interrupt) (struct dasd_device *,
291 struct irb *); 290 struct irb *);
diff --git a/drivers/s390/block/dasd_ioctl.c b/drivers/s390/block/dasd_ioctl.c
index 4ce3f72ee1c1..df918ef27965 100644
--- a/drivers/s390/block/dasd_ioctl.c
+++ b/drivers/s390/block/dasd_ioctl.c
@@ -16,6 +16,7 @@
16#include <linux/major.h> 16#include <linux/major.h>
17#include <linux/fs.h> 17#include <linux/fs.h>
18#include <linux/blkpg.h> 18#include <linux/blkpg.h>
19#include <linux/smp_lock.h>
19 20
20#include <asm/ccwdev.h> 21#include <asm/ccwdev.h>
21#include <asm/cmb.h> 22#include <asm/cmb.h>
diff --git a/drivers/s390/block/dcssblk.c b/drivers/s390/block/dcssblk.c
index 016f9e9d2591..d34617682a62 100644
--- a/drivers/s390/block/dcssblk.c
+++ b/drivers/s390/block/dcssblk.c
@@ -964,7 +964,8 @@ static int dcssblk_freeze(struct device *dev)
964 break; 964 break;
965 } 965 }
966 if (rc) 966 if (rc)
967 pr_err("Suspend failed because device %s is writeable.\n", 967 pr_err("Suspending the system failed because DCSS device %s "
968 "is writable\n",
968 dev_info->segment_name); 969 dev_info->segment_name);
969 return rc; 970 return rc;
970} 971}
@@ -987,8 +988,8 @@ static int dcssblk_restore(struct device *dev)
987 goto out_panic; 988 goto out_panic;
988 } 989 }
989 if (start != entry->start || end != entry->end) { 990 if (start != entry->start || end != entry->end) {
990 pr_err("Mismatch of start / end address after " 991 pr_err("The address range of DCSS %s changed "
991 "resuming device %s\n", 992 "while the system was suspended\n",
992 entry->segment_name); 993 entry->segment_name);
993 goto out_panic; 994 goto out_panic;
994 } 995 }
diff --git a/drivers/s390/block/xpram.c b/drivers/s390/block/xpram.c
index 2e9e1ecd6d82..db442cd6621e 100644
--- a/drivers/s390/block/xpram.c
+++ b/drivers/s390/block/xpram.c
@@ -443,7 +443,7 @@ fail:
443 */ 443 */
444static void xpram_resume_error(const char *message) 444static void xpram_resume_error(const char *message)
445{ 445{
446 pr_err("Resume error: %s\n", message); 446 pr_err("Resuming the system failed: %s\n", message);
447 panic("xpram resume error\n"); 447 panic("xpram resume error\n");
448} 448}
449 449
diff --git a/drivers/s390/char/monreader.c b/drivers/s390/char/monreader.c
index 7892550d7932..3234e90bd7f9 100644
--- a/drivers/s390/char/monreader.c
+++ b/drivers/s390/char/monreader.c
@@ -320,7 +320,7 @@ static int mon_open(struct inode *inode, struct file *filp)
320 goto out_path; 320 goto out_path;
321 } 321 }
322 filp->private_data = monpriv; 322 filp->private_data = monpriv;
323 dev_set_drvdata(&monreader_device, monpriv); 323 dev_set_drvdata(monreader_device, monpriv);
324 unlock_kernel(); 324 unlock_kernel();
325 return nonseekable_open(inode, filp); 325 return nonseekable_open(inode, filp);
326 326
@@ -463,7 +463,7 @@ static struct miscdevice mon_dev = {
463 *****************************************************************************/ 463 *****************************************************************************/
464static int monreader_freeze(struct device *dev) 464static int monreader_freeze(struct device *dev)
465{ 465{
466 struct mon_private *monpriv = dev_get_drvdata(&dev); 466 struct mon_private *monpriv = dev_get_drvdata(dev);
467 int rc; 467 int rc;
468 468
469 if (!monpriv) 469 if (!monpriv)
diff --git a/drivers/s390/char/sclp_rw.h b/drivers/s390/char/sclp_rw.h
index 85f491ea929c..7a7bfc947d97 100644
--- a/drivers/s390/char/sclp_rw.h
+++ b/drivers/s390/char/sclp_rw.h
@@ -92,5 +92,10 @@ void sclp_set_columns(struct sclp_buffer *, unsigned short);
92void sclp_set_htab(struct sclp_buffer *, unsigned short); 92void sclp_set_htab(struct sclp_buffer *, unsigned short);
93int sclp_chars_in_buffer(struct sclp_buffer *); 93int sclp_chars_in_buffer(struct sclp_buffer *);
94 94
95#ifdef CONFIG_SCLP_CONSOLE
95void sclp_console_pm_event(enum sclp_pm_event sclp_pm_event); 96void sclp_console_pm_event(enum sclp_pm_event sclp_pm_event);
97#else
98static inline void sclp_console_pm_event(enum sclp_pm_event sclp_pm_event) { }
99#endif
100
96#endif /* __SCLP_RW_H__ */ 101#endif /* __SCLP_RW_H__ */
diff --git a/drivers/s390/char/vmwatchdog.c b/drivers/s390/char/vmwatchdog.c
index cb7854c10c04..f2bc287b69e4 100644
--- a/drivers/s390/char/vmwatchdog.c
+++ b/drivers/s390/char/vmwatchdog.c
@@ -250,14 +250,14 @@ static int vmwdt_resume(void)
250static int vmwdt_suspend(void) 250static int vmwdt_suspend(void)
251{ 251{
252 if (test_and_set_bit(VMWDT_OPEN, &vmwdt_is_open)) { 252 if (test_and_set_bit(VMWDT_OPEN, &vmwdt_is_open)) {
253 pr_err("The watchdog is in use. " 253 pr_err("The system cannot be suspended while the watchdog"
254 "This prevents hibernation or suspend.\n"); 254 " is in use\n");
255 return NOTIFY_BAD; 255 return NOTIFY_BAD;
256 } 256 }
257 if (test_bit(VMWDT_RUNNING, &vmwdt_is_open)) { 257 if (test_bit(VMWDT_RUNNING, &vmwdt_is_open)) {
258 clear_bit(VMWDT_OPEN, &vmwdt_is_open); 258 clear_bit(VMWDT_OPEN, &vmwdt_is_open);
259 pr_err("The watchdog is running. " 259 pr_err("The system cannot be suspended while the watchdog"
260 "This prevents hibernation or suspend.\n"); 260 " is running\n");
261 return NOTIFY_BAD; 261 return NOTIFY_BAD;
262 } 262 }
263 return NOTIFY_DONE; 263 return NOTIFY_DONE;
diff --git a/drivers/s390/crypto/ap_bus.c b/drivers/s390/crypto/ap_bus.c
index 727a809636d8..ed3dcdea7fe1 100644
--- a/drivers/s390/crypto/ap_bus.c
+++ b/drivers/s390/crypto/ap_bus.c
@@ -1145,12 +1145,17 @@ ap_config_timeout(unsigned long ptr)
1145 */ 1145 */
1146static inline void ap_schedule_poll_timer(void) 1146static inline void ap_schedule_poll_timer(void)
1147{ 1147{
1148 ktime_t hr_time;
1148 if (ap_using_interrupts() || ap_suspend_flag) 1149 if (ap_using_interrupts() || ap_suspend_flag)
1149 return; 1150 return;
1150 if (hrtimer_is_queued(&ap_poll_timer)) 1151 if (hrtimer_is_queued(&ap_poll_timer))
1151 return; 1152 return;
1152 hrtimer_start(&ap_poll_timer, ktime_set(0, poll_timeout), 1153 if (ktime_to_ns(hrtimer_expires_remaining(&ap_poll_timer)) <= 0) {
1153 HRTIMER_MODE_ABS); 1154 hr_time = ktime_set(0, poll_timeout);
1155 hrtimer_forward_now(&ap_poll_timer, hr_time);
1156 hrtimer_restart(&ap_poll_timer);
1157 }
1158 return;
1154} 1159}
1155 1160
1156/** 1161/**
diff --git a/drivers/s390/scsi/zfcp_erp.c b/drivers/s390/scsi/zfcp_erp.c
index 8030e25152fb..c75d6f35cb5f 100644
--- a/drivers/s390/scsi/zfcp_erp.c
+++ b/drivers/s390/scsi/zfcp_erp.c
@@ -553,40 +553,35 @@ static void _zfcp_erp_unit_reopen_all(struct zfcp_port *port, int clear,
553 _zfcp_erp_unit_reopen(unit, clear, id, ref); 553 _zfcp_erp_unit_reopen(unit, clear, id, ref);
554} 554}
555 555
556static void zfcp_erp_strategy_followup_actions(struct zfcp_erp_action *act) 556static void zfcp_erp_strategy_followup_failed(struct zfcp_erp_action *act)
557{ 557{
558 struct zfcp_adapter *adapter = act->adapter;
559 struct zfcp_port *port = act->port;
560 struct zfcp_unit *unit = act->unit;
561 u32 status = act->status;
562
563 /* initiate follow-up actions depending on success of finished action */
564 switch (act->action) { 558 switch (act->action) {
565
566 case ZFCP_ERP_ACTION_REOPEN_ADAPTER: 559 case ZFCP_ERP_ACTION_REOPEN_ADAPTER:
567 if (status == ZFCP_ERP_SUCCEEDED) 560 _zfcp_erp_adapter_reopen(act->adapter, 0, "ersff_1", NULL);
568 _zfcp_erp_port_reopen_all(adapter, 0, "ersfa_1", NULL);
569 else
570 _zfcp_erp_adapter_reopen(adapter, 0, "ersfa_2", NULL);
571 break; 561 break;
572
573 case ZFCP_ERP_ACTION_REOPEN_PORT_FORCED: 562 case ZFCP_ERP_ACTION_REOPEN_PORT_FORCED:
574 if (status == ZFCP_ERP_SUCCEEDED) 563 _zfcp_erp_port_forced_reopen(act->port, 0, "ersff_2", NULL);
575 _zfcp_erp_port_reopen(port, 0, "ersfa_3", NULL);
576 else
577 _zfcp_erp_adapter_reopen(adapter, 0, "ersfa_4", NULL);
578 break; 564 break;
579
580 case ZFCP_ERP_ACTION_REOPEN_PORT: 565 case ZFCP_ERP_ACTION_REOPEN_PORT:
581 if (status == ZFCP_ERP_SUCCEEDED) 566 _zfcp_erp_port_reopen(act->port, 0, "ersff_3", NULL);
582 _zfcp_erp_unit_reopen_all(port, 0, "ersfa_5", NULL);
583 else
584 _zfcp_erp_port_forced_reopen(port, 0, "ersfa_6", NULL);
585 break; 567 break;
586
587 case ZFCP_ERP_ACTION_REOPEN_UNIT: 568 case ZFCP_ERP_ACTION_REOPEN_UNIT:
588 if (status != ZFCP_ERP_SUCCEEDED) 569 _zfcp_erp_unit_reopen(act->unit, 0, "ersff_4", NULL);
589 _zfcp_erp_port_reopen(unit->port, 0, "ersfa_7", NULL); 570 break;
571 }
572}
573
574static void zfcp_erp_strategy_followup_success(struct zfcp_erp_action *act)
575{
576 switch (act->action) {
577 case ZFCP_ERP_ACTION_REOPEN_ADAPTER:
578 _zfcp_erp_port_reopen_all(act->adapter, 0, "ersfs_1", NULL);
579 break;
580 case ZFCP_ERP_ACTION_REOPEN_PORT_FORCED:
581 _zfcp_erp_port_reopen(act->port, 0, "ersfs_2", NULL);
582 break;
583 case ZFCP_ERP_ACTION_REOPEN_PORT:
584 _zfcp_erp_unit_reopen_all(act->port, 0, "ersfs_3", NULL);
590 break; 585 break;
591 } 586 }
592} 587}
@@ -801,7 +796,7 @@ static int zfcp_erp_port_forced_strategy(struct zfcp_erp_action *erp_action)
801 return ZFCP_ERP_FAILED; 796 return ZFCP_ERP_FAILED;
802 797
803 case ZFCP_ERP_STEP_PHYS_PORT_CLOSING: 798 case ZFCP_ERP_STEP_PHYS_PORT_CLOSING:
804 if (status & ZFCP_STATUS_PORT_PHYS_OPEN) 799 if (!(status & ZFCP_STATUS_PORT_PHYS_OPEN))
805 return ZFCP_ERP_SUCCEEDED; 800 return ZFCP_ERP_SUCCEEDED;
806 } 801 }
807 return ZFCP_ERP_FAILED; 802 return ZFCP_ERP_FAILED;
@@ -853,11 +848,17 @@ void zfcp_erp_port_strategy_open_lookup(struct work_struct *work)
853 gid_pn_work); 848 gid_pn_work);
854 849
855 retval = zfcp_fc_ns_gid_pn(&port->erp_action); 850 retval = zfcp_fc_ns_gid_pn(&port->erp_action);
856 if (retval == -ENOMEM) 851 if (!retval) {
857 zfcp_erp_notify(&port->erp_action, ZFCP_ERP_NOMEM); 852 port->erp_action.step = ZFCP_ERP_STEP_NAMESERVER_LOOKUP;
858 port->erp_action.step = ZFCP_ERP_STEP_NAMESERVER_LOOKUP; 853 goto out;
859 if (retval) 854 }
860 zfcp_erp_notify(&port->erp_action, ZFCP_ERP_FAILED); 855 if (retval == -ENOMEM) {
856 zfcp_erp_notify(&port->erp_action, ZFCP_STATUS_ERP_LOWMEM);
857 goto out;
858 }
859 /* all other error condtions */
860 zfcp_erp_notify(&port->erp_action, 0);
861out:
861 zfcp_port_put(port); 862 zfcp_port_put(port);
862} 863}
863 864
@@ -1289,7 +1290,10 @@ static int zfcp_erp_strategy(struct zfcp_erp_action *erp_action)
1289 retval = zfcp_erp_strategy_statechange(erp_action, retval); 1290 retval = zfcp_erp_strategy_statechange(erp_action, retval);
1290 if (retval == ZFCP_ERP_EXIT) 1291 if (retval == ZFCP_ERP_EXIT)
1291 goto unlock; 1292 goto unlock;
1292 zfcp_erp_strategy_followup_actions(erp_action); 1293 if (retval == ZFCP_ERP_SUCCEEDED)
1294 zfcp_erp_strategy_followup_success(erp_action);
1295 if (retval == ZFCP_ERP_FAILED)
1296 zfcp_erp_strategy_followup_failed(erp_action);
1293 1297
1294 unlock: 1298 unlock:
1295 write_unlock(&adapter->erp_lock); 1299 write_unlock(&adapter->erp_lock);
diff --git a/drivers/s390/scsi/zfcp_fc.c b/drivers/s390/scsi/zfcp_fc.c
index 2f0705d76b72..47daebfa7e59 100644
--- a/drivers/s390/scsi/zfcp_fc.c
+++ b/drivers/s390/scsi/zfcp_fc.c
@@ -79,11 +79,9 @@ static int zfcp_wka_port_get(struct zfcp_wka_port *wka_port)
79 79
80 mutex_unlock(&wka_port->mutex); 80 mutex_unlock(&wka_port->mutex);
81 81
82 wait_event_timeout( 82 wait_event(wka_port->completion_wq,
83 wka_port->completion_wq, 83 wka_port->status == ZFCP_WKA_PORT_ONLINE ||
84 wka_port->status == ZFCP_WKA_PORT_ONLINE || 84 wka_port->status == ZFCP_WKA_PORT_OFFLINE);
85 wka_port->status == ZFCP_WKA_PORT_OFFLINE,
86 HZ >> 1);
87 85
88 if (wka_port->status == ZFCP_WKA_PORT_ONLINE) { 86 if (wka_port->status == ZFCP_WKA_PORT_ONLINE) {
89 atomic_inc(&wka_port->refcount); 87 atomic_inc(&wka_port->refcount);
diff --git a/drivers/s390/scsi/zfcp_fsf.c b/drivers/s390/scsi/zfcp_fsf.c
index c57658f3d34f..47795fbf081f 100644
--- a/drivers/s390/scsi/zfcp_fsf.c
+++ b/drivers/s390/scsi/zfcp_fsf.c
@@ -670,8 +670,11 @@ static int zfcp_fsf_req_sbal_get(struct zfcp_adapter *adapter)
670 zfcp_fsf_sbal_check(adapter), 5 * HZ); 670 zfcp_fsf_sbal_check(adapter), 5 * HZ);
671 if (ret > 0) 671 if (ret > 0)
672 return 0; 672 return 0;
673 if (!ret) 673 if (!ret) {
674 atomic_inc(&adapter->qdio_outb_full); 674 atomic_inc(&adapter->qdio_outb_full);
675 /* assume hanging outbound queue, try queue recovery */
676 zfcp_erp_adapter_reopen(adapter, 0, "fsrsg_1", NULL);
677 }
675 678
676 spin_lock_bh(&adapter->req_q_lock); 679 spin_lock_bh(&adapter->req_q_lock);
677 return -EIO; 680 return -EIO;
@@ -722,7 +725,7 @@ static struct zfcp_fsf_req *zfcp_fsf_req_create(struct zfcp_adapter *adapter,
722 req = zfcp_fsf_alloc_qtcb(pool); 725 req = zfcp_fsf_alloc_qtcb(pool);
723 726
724 if (unlikely(!req)) 727 if (unlikely(!req))
725 return ERR_PTR(-EIO); 728 return ERR_PTR(-ENOMEM);
726 729
727 if (adapter->req_no == 0) 730 if (adapter->req_no == 0)
728 adapter->req_no++; 731 adapter->req_no++;
@@ -1010,6 +1013,23 @@ skip_fsfstatus:
1010 send_ct->handler(send_ct->handler_data); 1013 send_ct->handler(send_ct->handler_data);
1011} 1014}
1012 1015
1016static void zfcp_fsf_setup_ct_els_unchained(struct qdio_buffer_element *sbale,
1017 struct scatterlist *sg_req,
1018 struct scatterlist *sg_resp)
1019{
1020 sbale[0].flags |= SBAL_FLAGS0_TYPE_WRITE_READ;
1021 sbale[2].addr = sg_virt(sg_req);
1022 sbale[2].length = sg_req->length;
1023 sbale[3].addr = sg_virt(sg_resp);
1024 sbale[3].length = sg_resp->length;
1025 sbale[3].flags |= SBAL_FLAGS_LAST_ENTRY;
1026}
1027
1028static int zfcp_fsf_one_sbal(struct scatterlist *sg)
1029{
1030 return sg_is_last(sg) && sg->length <= PAGE_SIZE;
1031}
1032
1013static int zfcp_fsf_setup_ct_els_sbals(struct zfcp_fsf_req *req, 1033static int zfcp_fsf_setup_ct_els_sbals(struct zfcp_fsf_req *req,
1014 struct scatterlist *sg_req, 1034 struct scatterlist *sg_req,
1015 struct scatterlist *sg_resp, 1035 struct scatterlist *sg_resp,
@@ -1020,30 +1040,30 @@ static int zfcp_fsf_setup_ct_els_sbals(struct zfcp_fsf_req *req,
1020 int bytes; 1040 int bytes;
1021 1041
1022 if (!(feat & FSF_FEATURE_ELS_CT_CHAINED_SBALS)) { 1042 if (!(feat & FSF_FEATURE_ELS_CT_CHAINED_SBALS)) {
1023 if (sg_req->length > PAGE_SIZE || sg_resp->length > PAGE_SIZE || 1043 if (!zfcp_fsf_one_sbal(sg_req) || !zfcp_fsf_one_sbal(sg_resp))
1024 !sg_is_last(sg_req) || !sg_is_last(sg_resp))
1025 return -EOPNOTSUPP; 1044 return -EOPNOTSUPP;
1026 1045
1027 sbale[0].flags |= SBAL_FLAGS0_TYPE_WRITE_READ; 1046 zfcp_fsf_setup_ct_els_unchained(sbale, sg_req, sg_resp);
1028 sbale[2].addr = sg_virt(sg_req); 1047 return 0;
1029 sbale[2].length = sg_req->length; 1048 }
1030 sbale[3].addr = sg_virt(sg_resp); 1049
1031 sbale[3].length = sg_resp->length; 1050 /* use single, unchained SBAL if it can hold the request */
1032 sbale[3].flags |= SBAL_FLAGS_LAST_ENTRY; 1051 if (zfcp_fsf_one_sbal(sg_req) && zfcp_fsf_one_sbal(sg_resp)) {
1052 zfcp_fsf_setup_ct_els_unchained(sbale, sg_req, sg_resp);
1033 return 0; 1053 return 0;
1034 } 1054 }
1035 1055
1036 bytes = zfcp_qdio_sbals_from_sg(req, SBAL_FLAGS0_TYPE_WRITE_READ, 1056 bytes = zfcp_qdio_sbals_from_sg(req, SBAL_FLAGS0_TYPE_WRITE_READ,
1037 sg_req, max_sbals); 1057 sg_req, max_sbals);
1038 if (bytes <= 0) 1058 if (bytes <= 0)
1039 return -ENOMEM; 1059 return -EIO;
1040 req->qtcb->bottom.support.req_buf_length = bytes; 1060 req->qtcb->bottom.support.req_buf_length = bytes;
1041 req->sbale_curr = ZFCP_LAST_SBALE_PER_SBAL; 1061 req->sbale_curr = ZFCP_LAST_SBALE_PER_SBAL;
1042 1062
1043 bytes = zfcp_qdio_sbals_from_sg(req, SBAL_FLAGS0_TYPE_WRITE_READ, 1063 bytes = zfcp_qdio_sbals_from_sg(req, SBAL_FLAGS0_TYPE_WRITE_READ,
1044 sg_resp, max_sbals); 1064 sg_resp, max_sbals);
1045 if (bytes <= 0) 1065 if (bytes <= 0)
1046 return -ENOMEM; 1066 return -EIO;
1047 req->qtcb->bottom.support.resp_buf_length = bytes; 1067 req->qtcb->bottom.support.resp_buf_length = bytes;
1048 1068
1049 return 0; 1069 return 0;
@@ -1607,10 +1627,10 @@ static void zfcp_fsf_open_wka_port_handler(struct zfcp_fsf_req *req)
1607 case FSF_ACCESS_DENIED: 1627 case FSF_ACCESS_DENIED:
1608 wka_port->status = ZFCP_WKA_PORT_OFFLINE; 1628 wka_port->status = ZFCP_WKA_PORT_OFFLINE;
1609 break; 1629 break;
1610 case FSF_PORT_ALREADY_OPEN:
1611 break;
1612 case FSF_GOOD: 1630 case FSF_GOOD:
1613 wka_port->handle = header->port_handle; 1631 wka_port->handle = header->port_handle;
1632 /* fall through */
1633 case FSF_PORT_ALREADY_OPEN:
1614 wka_port->status = ZFCP_WKA_PORT_ONLINE; 1634 wka_port->status = ZFCP_WKA_PORT_ONLINE;
1615 } 1635 }
1616out: 1636out:
@@ -1731,15 +1751,16 @@ static void zfcp_fsf_close_physical_port_handler(struct zfcp_fsf_req *req)
1731 zfcp_fsf_access_denied_port(req, port); 1751 zfcp_fsf_access_denied_port(req, port);
1732 break; 1752 break;
1733 case FSF_PORT_BOXED: 1753 case FSF_PORT_BOXED:
1734 zfcp_erp_port_boxed(port, "fscpph2", req);
1735 req->status |= ZFCP_STATUS_FSFREQ_ERROR |
1736 ZFCP_STATUS_FSFREQ_RETRY;
1737 /* can't use generic zfcp_erp_modify_port_status because 1754 /* can't use generic zfcp_erp_modify_port_status because
1738 * ZFCP_STATUS_COMMON_OPEN must not be reset for the port */ 1755 * ZFCP_STATUS_COMMON_OPEN must not be reset for the port */
1739 atomic_clear_mask(ZFCP_STATUS_PORT_PHYS_OPEN, &port->status); 1756 atomic_clear_mask(ZFCP_STATUS_PORT_PHYS_OPEN, &port->status);
1740 list_for_each_entry(unit, &port->unit_list_head, list) 1757 list_for_each_entry(unit, &port->unit_list_head, list)
1741 atomic_clear_mask(ZFCP_STATUS_COMMON_OPEN, 1758 atomic_clear_mask(ZFCP_STATUS_COMMON_OPEN,
1742 &unit->status); 1759 &unit->status);
1760 zfcp_erp_port_boxed(port, "fscpph2", req);
1761 req->status |= ZFCP_STATUS_FSFREQ_ERROR |
1762 ZFCP_STATUS_FSFREQ_RETRY;
1763
1743 break; 1764 break;
1744 case FSF_ADAPTER_STATUS_AVAILABLE: 1765 case FSF_ADAPTER_STATUS_AVAILABLE:
1745 switch (header->fsf_status_qual.word[0]) { 1766 switch (header->fsf_status_qual.word[0]) {
@@ -2541,7 +2562,6 @@ struct zfcp_fsf_req *zfcp_fsf_control_file(struct zfcp_adapter *adapter,
2541 bytes = zfcp_qdio_sbals_from_sg(req, direction, fsf_cfdc->sg, 2562 bytes = zfcp_qdio_sbals_from_sg(req, direction, fsf_cfdc->sg,
2542 FSF_MAX_SBALS_PER_REQ); 2563 FSF_MAX_SBALS_PER_REQ);
2543 if (bytes != ZFCP_CFDC_MAX_SIZE) { 2564 if (bytes != ZFCP_CFDC_MAX_SIZE) {
2544 retval = -ENOMEM;
2545 zfcp_fsf_req_free(req); 2565 zfcp_fsf_req_free(req);
2546 goto out; 2566 goto out;
2547 } 2567 }
diff --git a/drivers/s390/scsi/zfcp_scsi.c b/drivers/s390/scsi/zfcp_scsi.c
index 967ede73f4c5..6925a1784682 100644
--- a/drivers/s390/scsi/zfcp_scsi.c
+++ b/drivers/s390/scsi/zfcp_scsi.c
@@ -167,20 +167,21 @@ static int zfcp_scsi_eh_abort_handler(struct scsi_cmnd *scpnt)
167 struct zfcp_unit *unit = scpnt->device->hostdata; 167 struct zfcp_unit *unit = scpnt->device->hostdata;
168 struct zfcp_fsf_req *old_req, *abrt_req; 168 struct zfcp_fsf_req *old_req, *abrt_req;
169 unsigned long flags; 169 unsigned long flags;
170 unsigned long old_req_id = (unsigned long) scpnt->host_scribble; 170 unsigned long old_reqid = (unsigned long) scpnt->host_scribble;
171 int retval = SUCCESS; 171 int retval = SUCCESS;
172 int retry = 3; 172 int retry = 3;
173 char *dbf_tag;
173 174
174 /* avoid race condition between late normal completion and abort */ 175 /* avoid race condition between late normal completion and abort */
175 write_lock_irqsave(&adapter->abort_lock, flags); 176 write_lock_irqsave(&adapter->abort_lock, flags);
176 177
177 spin_lock(&adapter->req_list_lock); 178 spin_lock(&adapter->req_list_lock);
178 old_req = zfcp_reqlist_find(adapter, old_req_id); 179 old_req = zfcp_reqlist_find(adapter, old_reqid);
179 spin_unlock(&adapter->req_list_lock); 180 spin_unlock(&adapter->req_list_lock);
180 if (!old_req) { 181 if (!old_req) {
181 write_unlock_irqrestore(&adapter->abort_lock, flags); 182 write_unlock_irqrestore(&adapter->abort_lock, flags);
182 zfcp_scsi_dbf_event_abort("lte1", adapter, scpnt, NULL, 183 zfcp_scsi_dbf_event_abort("lte1", adapter, scpnt, NULL,
183 old_req_id); 184 old_reqid);
184 return FAILED; /* completion could be in progress */ 185 return FAILED; /* completion could be in progress */
185 } 186 }
186 old_req->data = NULL; 187 old_req->data = NULL;
@@ -189,7 +190,7 @@ static int zfcp_scsi_eh_abort_handler(struct scsi_cmnd *scpnt)
189 write_unlock_irqrestore(&adapter->abort_lock, flags); 190 write_unlock_irqrestore(&adapter->abort_lock, flags);
190 191
191 while (retry--) { 192 while (retry--) {
192 abrt_req = zfcp_fsf_abort_fcp_command(old_req_id, unit); 193 abrt_req = zfcp_fsf_abort_fcp_command(old_reqid, unit);
193 if (abrt_req) 194 if (abrt_req)
194 break; 195 break;
195 196
@@ -197,7 +198,7 @@ static int zfcp_scsi_eh_abort_handler(struct scsi_cmnd *scpnt)
197 if (!(atomic_read(&adapter->status) & 198 if (!(atomic_read(&adapter->status) &
198 ZFCP_STATUS_COMMON_RUNNING)) { 199 ZFCP_STATUS_COMMON_RUNNING)) {
199 zfcp_scsi_dbf_event_abort("nres", adapter, scpnt, NULL, 200 zfcp_scsi_dbf_event_abort("nres", adapter, scpnt, NULL,
200 old_req_id); 201 old_reqid);
201 return SUCCESS; 202 return SUCCESS;
202 } 203 }
203 } 204 }
@@ -208,13 +209,14 @@ static int zfcp_scsi_eh_abort_handler(struct scsi_cmnd *scpnt)
208 abrt_req->status & ZFCP_STATUS_FSFREQ_COMPLETED); 209 abrt_req->status & ZFCP_STATUS_FSFREQ_COMPLETED);
209 210
210 if (abrt_req->status & ZFCP_STATUS_FSFREQ_ABORTSUCCEEDED) 211 if (abrt_req->status & ZFCP_STATUS_FSFREQ_ABORTSUCCEEDED)
211 zfcp_scsi_dbf_event_abort("okay", adapter, scpnt, abrt_req, 0); 212 dbf_tag = "okay";
212 else if (abrt_req->status & ZFCP_STATUS_FSFREQ_ABORTNOTNEEDED) 213 else if (abrt_req->status & ZFCP_STATUS_FSFREQ_ABORTNOTNEEDED)
213 zfcp_scsi_dbf_event_abort("lte2", adapter, scpnt, abrt_req, 0); 214 dbf_tag = "lte2";
214 else { 215 else {
215 zfcp_scsi_dbf_event_abort("fail", adapter, scpnt, abrt_req, 0); 216 dbf_tag = "fail";
216 retval = FAILED; 217 retval = FAILED;
217 } 218 }
219 zfcp_scsi_dbf_event_abort(dbf_tag, adapter, scpnt, abrt_req, old_reqid);
218 zfcp_fsf_req_free(abrt_req); 220 zfcp_fsf_req_free(abrt_req);
219 return retval; 221 return retval;
220} 222}
@@ -534,6 +536,9 @@ static void zfcp_scsi_rport_register(struct zfcp_port *port)
534 struct fc_rport_identifiers ids; 536 struct fc_rport_identifiers ids;
535 struct fc_rport *rport; 537 struct fc_rport *rport;
536 538
539 if (port->rport)
540 return;
541
537 ids.node_name = port->wwnn; 542 ids.node_name = port->wwnn;
538 ids.port_name = port->wwpn; 543 ids.port_name = port->wwpn;
539 ids.port_id = port->d_id; 544 ids.port_id = port->d_id;
@@ -557,8 +562,10 @@ static void zfcp_scsi_rport_block(struct zfcp_port *port)
557{ 562{
558 struct fc_rport *rport = port->rport; 563 struct fc_rport *rport = port->rport;
559 564
560 if (rport) 565 if (rport) {
561 fc_remote_port_delete(rport); 566 fc_remote_port_delete(rport);
567 port->rport = NULL;
568 }
562} 569}
563 570
564void zfcp_scsi_schedule_rport_register(struct zfcp_port *port) 571void zfcp_scsi_schedule_rport_register(struct zfcp_port *port)
diff --git a/drivers/s390/scsi/zfcp_sysfs.c b/drivers/s390/scsi/zfcp_sysfs.c
index 3e51e64d1108..0fe5cce818cb 100644
--- a/drivers/s390/scsi/zfcp_sysfs.c
+++ b/drivers/s390/scsi/zfcp_sysfs.c
@@ -494,9 +494,14 @@ static ssize_t zfcp_sysfs_adapter_q_full_show(struct device *dev,
494 struct Scsi_Host *scsi_host = class_to_shost(dev); 494 struct Scsi_Host *scsi_host = class_to_shost(dev);
495 struct zfcp_adapter *adapter = 495 struct zfcp_adapter *adapter =
496 (struct zfcp_adapter *) scsi_host->hostdata[0]; 496 (struct zfcp_adapter *) scsi_host->hostdata[0];
497 u64 util;
498
499 spin_lock_bh(&adapter->qdio_stat_lock);
500 util = adapter->req_q_util;
501 spin_unlock_bh(&adapter->qdio_stat_lock);
497 502
498 return sprintf(buf, "%d %llu\n", atomic_read(&adapter->qdio_outb_full), 503 return sprintf(buf, "%d %llu\n", atomic_read(&adapter->qdio_outb_full),
499 (unsigned long long)adapter->req_q_util); 504 (unsigned long long)util);
500} 505}
501static DEVICE_ATTR(queue_full, S_IRUGO, zfcp_sysfs_adapter_q_full_show, NULL); 506static DEVICE_ATTR(queue_full, S_IRUGO, zfcp_sysfs_adapter_q_full_show, NULL);
502 507
diff --git a/drivers/scsi/atari_NCR5380.c b/drivers/scsi/atari_NCR5380.c
index 0471f8800483..4240b05aef6d 100644
--- a/drivers/scsi/atari_NCR5380.c
+++ b/drivers/scsi/atari_NCR5380.c
@@ -2826,8 +2826,7 @@ int NCR5380_abort(Scsi_Cmnd *cmd)
2826 */ 2826 */
2827 2827
2828 local_irq_restore(flags); 2828 local_irq_restore(flags);
2829 printk(KERN_INFO "scsi%d: warning : SCSI command probably completed successfully\n" 2829 printk(KERN_INFO "scsi%d: warning : SCSI command probably completed successfully before abortion\n", HOSTNO);
2830 KERN_INFO " before abortion\n", HOSTNO);
2831 2830
2832 /* Maybe it is sufficient just to release the ST-DMA lock... (if 2831 /* Maybe it is sufficient just to release the ST-DMA lock... (if
2833 * possible at all) At least, we should check if the lock could be 2832 * possible at all) At least, we should check if the lock could be
diff --git a/drivers/scsi/cxgb3i/Kbuild b/drivers/scsi/cxgb3i/Kbuild
index 25a2032bfa26..70d060b7ff4f 100644
--- a/drivers/scsi/cxgb3i/Kbuild
+++ b/drivers/scsi/cxgb3i/Kbuild
@@ -1,4 +1,4 @@
1EXTRA_CFLAGS += -I$(TOPDIR)/drivers/net/cxgb3 1EXTRA_CFLAGS += -I$(srctree)/drivers/net/cxgb3
2 2
3cxgb3i-y := cxgb3i_init.o cxgb3i_iscsi.o cxgb3i_pdu.o cxgb3i_offload.o cxgb3i_ddp.o 3cxgb3i-y := cxgb3i_init.o cxgb3i_iscsi.o cxgb3i_pdu.o cxgb3i_offload.o cxgb3i_ddp.o
4obj-$(CONFIG_SCSI_CXGB3_ISCSI) += cxgb3i.o 4obj-$(CONFIG_SCSI_CXGB3_ISCSI) += cxgb3i.o
diff --git a/drivers/scsi/cxgb3i/cxgb3i_iscsi.c b/drivers/scsi/cxgb3i/cxgb3i_iscsi.c
index 74369a3f963b..c399f485aa7d 100644
--- a/drivers/scsi/cxgb3i/cxgb3i_iscsi.c
+++ b/drivers/scsi/cxgb3i/cxgb3i_iscsi.c
@@ -13,6 +13,7 @@
13 13
14#include <linux/inet.h> 14#include <linux/inet.h>
15#include <linux/crypto.h> 15#include <linux/crypto.h>
16#include <linux/if_vlan.h>
16#include <net/dst.h> 17#include <net/dst.h>
17#include <net/tcp.h> 18#include <net/tcp.h>
18#include <scsi/scsi_cmnd.h> 19#include <scsi/scsi_cmnd.h>
@@ -184,6 +185,9 @@ static struct cxgb3i_hba *cxgb3i_hba_find_by_netdev(struct net_device *ndev)
184 struct cxgb3i_adapter *snic; 185 struct cxgb3i_adapter *snic;
185 int i; 186 int i;
186 187
188 if (ndev->priv_flags & IFF_802_1Q_VLAN)
189 ndev = vlan_dev_real_dev(ndev);
190
187 read_lock(&cxgb3i_snic_rwlock); 191 read_lock(&cxgb3i_snic_rwlock);
188 list_for_each_entry(snic, &cxgb3i_snic_list, list_head) { 192 list_for_each_entry(snic, &cxgb3i_snic_list, list_head) {
189 for (i = 0; i < snic->hba_cnt; i++) { 193 for (i = 0; i < snic->hba_cnt; i++) {
diff --git a/drivers/scsi/fnic/fnic_main.c b/drivers/scsi/fnic/fnic_main.c
index a84072865fc2..2c266c01dc5a 100644
--- a/drivers/scsi/fnic/fnic_main.c
+++ b/drivers/scsi/fnic/fnic_main.c
@@ -473,16 +473,16 @@ static int __devinit fnic_probe(struct pci_dev *pdev,
473 * limitation for the device. Try 40-bit first, and 473 * limitation for the device. Try 40-bit first, and
474 * fail to 32-bit. 474 * fail to 32-bit.
475 */ 475 */
476 err = pci_set_dma_mask(pdev, DMA_40BIT_MASK); 476 err = pci_set_dma_mask(pdev, DMA_BIT_MASK(40));
477 if (err) { 477 if (err) {
478 err = pci_set_dma_mask(pdev, DMA_32BIT_MASK); 478 err = pci_set_dma_mask(pdev, DMA_BIT_MASK(32));
479 if (err) { 479 if (err) {
480 shost_printk(KERN_ERR, fnic->lport->host, 480 shost_printk(KERN_ERR, fnic->lport->host,
481 "No usable DMA configuration " 481 "No usable DMA configuration "
482 "aborting\n"); 482 "aborting\n");
483 goto err_out_release_regions; 483 goto err_out_release_regions;
484 } 484 }
485 err = pci_set_consistent_dma_mask(pdev, DMA_32BIT_MASK); 485 err = pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(32));
486 if (err) { 486 if (err) {
487 shost_printk(KERN_ERR, fnic->lport->host, 487 shost_printk(KERN_ERR, fnic->lport->host,
488 "Unable to obtain 32-bit DMA " 488 "Unable to obtain 32-bit DMA "
@@ -490,7 +490,7 @@ static int __devinit fnic_probe(struct pci_dev *pdev,
490 goto err_out_release_regions; 490 goto err_out_release_regions;
491 } 491 }
492 } else { 492 } else {
493 err = pci_set_consistent_dma_mask(pdev, DMA_40BIT_MASK); 493 err = pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(40));
494 if (err) { 494 if (err) {
495 shost_printk(KERN_ERR, fnic->lport->host, 495 shost_printk(KERN_ERR, fnic->lport->host,
496 "Unable to obtain 40-bit DMA " 496 "Unable to obtain 40-bit DMA "
diff --git a/drivers/scsi/fnic/fnic_scsi.c b/drivers/scsi/fnic/fnic_scsi.c
index eabf36502856..bfc996971b81 100644
--- a/drivers/scsi/fnic/fnic_scsi.c
+++ b/drivers/scsi/fnic/fnic_scsi.c
@@ -245,7 +245,7 @@ static inline int fnic_queue_wq_copy_desc(struct fnic *fnic,
245 struct vnic_wq_copy *wq, 245 struct vnic_wq_copy *wq,
246 struct fnic_io_req *io_req, 246 struct fnic_io_req *io_req,
247 struct scsi_cmnd *sc, 247 struct scsi_cmnd *sc,
248 u32 sg_count) 248 int sg_count)
249{ 249{
250 struct scatterlist *sg; 250 struct scatterlist *sg;
251 struct fc_rport *rport = starget_to_rport(scsi_target(sc->device)); 251 struct fc_rport *rport = starget_to_rport(scsi_target(sc->device));
@@ -260,9 +260,6 @@ static inline int fnic_queue_wq_copy_desc(struct fnic *fnic,
260 char msg[2]; 260 char msg[2];
261 261
262 if (sg_count) { 262 if (sg_count) {
263 BUG_ON(sg_count < 0);
264 BUG_ON(sg_count > FNIC_MAX_SG_DESC_CNT);
265
266 /* For each SGE, create a device desc entry */ 263 /* For each SGE, create a device desc entry */
267 desc = io_req->sgl_list; 264 desc = io_req->sgl_list;
268 for_each_sg(scsi_sglist(sc), sg, sg_count, i) { 265 for_each_sg(scsi_sglist(sc), sg, sg_count, i) {
@@ -344,7 +341,7 @@ int fnic_queuecommand(struct scsi_cmnd *sc, void (*done)(struct scsi_cmnd *))
344 struct fnic *fnic; 341 struct fnic *fnic;
345 struct vnic_wq_copy *wq; 342 struct vnic_wq_copy *wq;
346 int ret; 343 int ret;
347 u32 sg_count; 344 int sg_count;
348 unsigned long flags; 345 unsigned long flags;
349 unsigned long ptr; 346 unsigned long ptr;
350 347
diff --git a/drivers/scsi/ibmvscsi/ibmvscsi.c b/drivers/scsi/ibmvscsi/ibmvscsi.c
index 869a11bdccbd..9928704e235f 100644
--- a/drivers/scsi/ibmvscsi/ibmvscsi.c
+++ b/drivers/scsi/ibmvscsi/ibmvscsi.c
@@ -1095,9 +1095,14 @@ static void adapter_info_rsp(struct srp_event_struct *evt_struct)
1095 MAX_INDIRECT_BUFS); 1095 MAX_INDIRECT_BUFS);
1096 hostdata->host->sg_tablesize = MAX_INDIRECT_BUFS; 1096 hostdata->host->sg_tablesize = MAX_INDIRECT_BUFS;
1097 } 1097 }
1098
1099 if (hostdata->madapter_info.os_type == 3) {
1100 enable_fast_fail(hostdata);
1101 return;
1102 }
1098 } 1103 }
1099 1104
1100 enable_fast_fail(hostdata); 1105 send_srp_login(hostdata);
1101} 1106}
1102 1107
1103/** 1108/**
diff --git a/drivers/scsi/libfc/fc_exch.c b/drivers/scsi/libfc/fc_exch.c
index 2bc22be5f849..145ab9ba55ea 100644
--- a/drivers/scsi/libfc/fc_exch.c
+++ b/drivers/scsi/libfc/fc_exch.c
@@ -415,9 +415,9 @@ static void fc_exch_timeout(struct work_struct *work)
415 e_stat = ep->esb_stat; 415 e_stat = ep->esb_stat;
416 if (e_stat & ESB_ST_COMPLETE) { 416 if (e_stat & ESB_ST_COMPLETE) {
417 ep->esb_stat = e_stat & ~ESB_ST_REC_QUAL; 417 ep->esb_stat = e_stat & ~ESB_ST_REC_QUAL;
418 spin_unlock_bh(&ep->ex_lock);
418 if (e_stat & ESB_ST_REC_QUAL) 419 if (e_stat & ESB_ST_REC_QUAL)
419 fc_exch_rrq(ep); 420 fc_exch_rrq(ep);
420 spin_unlock_bh(&ep->ex_lock);
421 goto done; 421 goto done;
422 } else { 422 } else {
423 resp = ep->resp; 423 resp = ep->resp;
@@ -1624,14 +1624,14 @@ static void fc_exch_rrq(struct fc_exch *ep)
1624 struct fc_lport *lp; 1624 struct fc_lport *lp;
1625 struct fc_els_rrq *rrq; 1625 struct fc_els_rrq *rrq;
1626 struct fc_frame *fp; 1626 struct fc_frame *fp;
1627 struct fc_seq *rrq_sp;
1628 u32 did; 1627 u32 did;
1629 1628
1630 lp = ep->lp; 1629 lp = ep->lp;
1631 1630
1632 fp = fc_frame_alloc(lp, sizeof(*rrq)); 1631 fp = fc_frame_alloc(lp, sizeof(*rrq));
1633 if (!fp) 1632 if (!fp)
1634 return; 1633 goto retry;
1634
1635 rrq = fc_frame_payload_get(fp, sizeof(*rrq)); 1635 rrq = fc_frame_payload_get(fp, sizeof(*rrq));
1636 memset(rrq, 0, sizeof(*rrq)); 1636 memset(rrq, 0, sizeof(*rrq));
1637 rrq->rrq_cmd = ELS_RRQ; 1637 rrq->rrq_cmd = ELS_RRQ;
@@ -1647,13 +1647,20 @@ static void fc_exch_rrq(struct fc_exch *ep)
1647 fc_host_port_id(lp->host), FC_TYPE_ELS, 1647 fc_host_port_id(lp->host), FC_TYPE_ELS,
1648 FC_FC_FIRST_SEQ | FC_FC_END_SEQ | FC_FC_SEQ_INIT, 0); 1648 FC_FC_FIRST_SEQ | FC_FC_END_SEQ | FC_FC_SEQ_INIT, 0);
1649 1649
1650 rrq_sp = fc_exch_seq_send(lp, fp, fc_exch_rrq_resp, NULL, ep, 1650 if (fc_exch_seq_send(lp, fp, fc_exch_rrq_resp, NULL, ep, lp->e_d_tov))
1651 lp->e_d_tov); 1651 return;
1652 if (!rrq_sp) { 1652
1653 ep->esb_stat |= ESB_ST_REC_QUAL; 1653retry:
1654 fc_exch_timer_set_locked(ep, ep->r_a_tov); 1654 spin_lock_bh(&ep->ex_lock);
1655 if (ep->state & (FC_EX_RST_CLEANUP | FC_EX_DONE)) {
1656 spin_unlock_bh(&ep->ex_lock);
1657 /* drop hold for rec qual */
1658 fc_exch_release(ep);
1655 return; 1659 return;
1656 } 1660 }
1661 ep->esb_stat |= ESB_ST_REC_QUAL;
1662 fc_exch_timer_set_locked(ep, ep->r_a_tov);
1663 spin_unlock_bh(&ep->ex_lock);
1657} 1664}
1658 1665
1659 1666
diff --git a/drivers/scsi/libiscsi.c b/drivers/scsi/libiscsi.c
index 716cc344c5df..a751f6230c22 100644
--- a/drivers/scsi/libiscsi.c
+++ b/drivers/scsi/libiscsi.c
@@ -1974,10 +1974,10 @@ int iscsi_eh_abort(struct scsi_cmnd *sc)
1974 * good and have never sent us a successful tmf response 1974 * good and have never sent us a successful tmf response
1975 * then sent more data for the cmd. 1975 * then sent more data for the cmd.
1976 */ 1976 */
1977 spin_lock(&session->lock); 1977 spin_lock_bh(&session->lock);
1978 fail_scsi_task(task, DID_ABORT); 1978 fail_scsi_task(task, DID_ABORT);
1979 conn->tmf_state = TMF_INITIAL; 1979 conn->tmf_state = TMF_INITIAL;
1980 spin_unlock(&session->lock); 1980 spin_unlock_bh(&session->lock);
1981 iscsi_start_tx(conn); 1981 iscsi_start_tx(conn);
1982 goto success_unlocked; 1982 goto success_unlocked;
1983 case TMF_TIMEDOUT: 1983 case TMF_TIMEDOUT:
diff --git a/drivers/scsi/libsas/sas_expander.c b/drivers/scsi/libsas/sas_expander.c
index 54fa1e42dc4d..b3381959acce 100644
--- a/drivers/scsi/libsas/sas_expander.c
+++ b/drivers/scsi/libsas/sas_expander.c
@@ -766,6 +766,7 @@ static int sas_ex_join_wide_port(struct domain_device *parent, int phy_id)
766 if (!memcmp(phy->attached_sas_addr, ephy->attached_sas_addr, 766 if (!memcmp(phy->attached_sas_addr, ephy->attached_sas_addr,
767 SAS_ADDR_SIZE) && ephy->port) { 767 SAS_ADDR_SIZE) && ephy->port) {
768 sas_port_add_phy(ephy->port, phy->phy); 768 sas_port_add_phy(ephy->port, phy->phy);
769 phy->port = ephy->port;
769 phy->phy_state = PHY_DEVICE_DISCOVERED; 770 phy->phy_state = PHY_DEVICE_DISCOVERED;
770 return 0; 771 return 0;
771 } 772 }
@@ -945,11 +946,21 @@ static int sas_ex_discover_dev(struct domain_device *dev, int phy_id)
945 if (ex->ex_phy[i].phy_state == PHY_VACANT || 946 if (ex->ex_phy[i].phy_state == PHY_VACANT ||
946 ex->ex_phy[i].phy_state == PHY_NOT_PRESENT) 947 ex->ex_phy[i].phy_state == PHY_NOT_PRESENT)
947 continue; 948 continue;
948 949 /*
950 * Due to races, the phy might not get added to the
951 * wide port, so we add the phy to the wide port here.
952 */
949 if (SAS_ADDR(ex->ex_phy[i].attached_sas_addr) == 953 if (SAS_ADDR(ex->ex_phy[i].attached_sas_addr) ==
950 SAS_ADDR(child->sas_addr)) 954 SAS_ADDR(child->sas_addr)) {
951 ex->ex_phy[i].phy_state= PHY_DEVICE_DISCOVERED; 955 ex->ex_phy[i].phy_state= PHY_DEVICE_DISCOVERED;
956 res = sas_ex_join_wide_port(dev, i);
957 if (!res)
958 SAS_DPRINTK("Attaching ex phy%d to wide port %016llx\n",
959 i, SAS_ADDR(ex->ex_phy[i].attached_sas_addr));
960
961 }
952 } 962 }
963 res = 0;
953 } 964 }
954 965
955 return res; 966 return res;
@@ -1598,7 +1609,7 @@ static int sas_get_phy_attached_sas_addr(struct domain_device *dev,
1598} 1609}
1599 1610
1600static int sas_find_bcast_phy(struct domain_device *dev, int *phy_id, 1611static int sas_find_bcast_phy(struct domain_device *dev, int *phy_id,
1601 int from_phy) 1612 int from_phy, bool update)
1602{ 1613{
1603 struct expander_device *ex = &dev->ex_dev; 1614 struct expander_device *ex = &dev->ex_dev;
1604 int res = 0; 1615 int res = 0;
@@ -1611,7 +1622,9 @@ static int sas_find_bcast_phy(struct domain_device *dev, int *phy_id,
1611 if (res) 1622 if (res)
1612 goto out; 1623 goto out;
1613 else if (phy_change_count != ex->ex_phy[i].phy_change_count) { 1624 else if (phy_change_count != ex->ex_phy[i].phy_change_count) {
1614 ex->ex_phy[i].phy_change_count = phy_change_count; 1625 if (update)
1626 ex->ex_phy[i].phy_change_count =
1627 phy_change_count;
1615 *phy_id = i; 1628 *phy_id = i;
1616 return 0; 1629 return 0;
1617 } 1630 }
@@ -1653,31 +1666,52 @@ out:
1653 kfree(rg_req); 1666 kfree(rg_req);
1654 return res; 1667 return res;
1655} 1668}
1669/**
1670 * sas_find_bcast_dev - find the device issue BROADCAST(CHANGE).
1671 * @dev:domain device to be detect.
1672 * @src_dev: the device which originated BROADCAST(CHANGE).
1673 *
1674 * Add self-configuration expander suport. Suppose two expander cascading,
1675 * when the first level expander is self-configuring, hotplug the disks in
1676 * second level expander, BROADCAST(CHANGE) will not only be originated
1677 * in the second level expander, but also be originated in the first level
1678 * expander (see SAS protocol SAS 2r-14, 7.11 for detail), it is to say,
1679 * expander changed count in two level expanders will all increment at least
1680 * once, but the phy which chang count has changed is the source device which
1681 * we concerned.
1682 */
1656 1683
1657static int sas_find_bcast_dev(struct domain_device *dev, 1684static int sas_find_bcast_dev(struct domain_device *dev,
1658 struct domain_device **src_dev) 1685 struct domain_device **src_dev)
1659{ 1686{
1660 struct expander_device *ex = &dev->ex_dev; 1687 struct expander_device *ex = &dev->ex_dev;
1661 int ex_change_count = -1; 1688 int ex_change_count = -1;
1689 int phy_id = -1;
1662 int res; 1690 int res;
1691 struct domain_device *ch;
1663 1692
1664 res = sas_get_ex_change_count(dev, &ex_change_count); 1693 res = sas_get_ex_change_count(dev, &ex_change_count);
1665 if (res) 1694 if (res)
1666 goto out; 1695 goto out;
1667 if (ex_change_count != -1 && 1696 if (ex_change_count != -1 && ex_change_count != ex->ex_change_count) {
1668 ex_change_count != ex->ex_change_count) { 1697 /* Just detect if this expander phys phy change count changed,
1669 *src_dev = dev; 1698 * in order to determine if this expander originate BROADCAST,
1670 ex->ex_change_count = ex_change_count; 1699 * and do not update phy change count field in our structure.
1671 } else { 1700 */
1672 struct domain_device *ch; 1701 res = sas_find_bcast_phy(dev, &phy_id, 0, false);
1673 1702 if (phy_id != -1) {
1674 list_for_each_entry(ch, &ex->children, siblings) { 1703 *src_dev = dev;
1675 if (ch->dev_type == EDGE_DEV || 1704 ex->ex_change_count = ex_change_count;
1676 ch->dev_type == FANOUT_DEV) { 1705 SAS_DPRINTK("Expander phy change count has changed\n");
1677 res = sas_find_bcast_dev(ch, src_dev); 1706 return res;
1678 if (src_dev) 1707 } else
1679 return res; 1708 SAS_DPRINTK("Expander phys DID NOT change\n");
1680 } 1709 }
1710 list_for_each_entry(ch, &ex->children, siblings) {
1711 if (ch->dev_type == EDGE_DEV || ch->dev_type == FANOUT_DEV) {
1712 res = sas_find_bcast_dev(ch, src_dev);
1713 if (src_dev)
1714 return res;
1681 } 1715 }
1682 } 1716 }
1683out: 1717out:
@@ -1700,24 +1734,26 @@ static void sas_unregister_ex_tree(struct domain_device *dev)
1700} 1734}
1701 1735
1702static void sas_unregister_devs_sas_addr(struct domain_device *parent, 1736static void sas_unregister_devs_sas_addr(struct domain_device *parent,
1703 int phy_id) 1737 int phy_id, bool last)
1704{ 1738{
1705 struct expander_device *ex_dev = &parent->ex_dev; 1739 struct expander_device *ex_dev = &parent->ex_dev;
1706 struct ex_phy *phy = &ex_dev->ex_phy[phy_id]; 1740 struct ex_phy *phy = &ex_dev->ex_phy[phy_id];
1707 struct domain_device *child, *n; 1741 struct domain_device *child, *n;
1708 1742 if (last) {
1709 list_for_each_entry_safe(child, n, &ex_dev->children, siblings) { 1743 list_for_each_entry_safe(child, n,
1710 if (SAS_ADDR(child->sas_addr) == 1744 &ex_dev->children, siblings) {
1711 SAS_ADDR(phy->attached_sas_addr)) { 1745 if (SAS_ADDR(child->sas_addr) ==
1712 if (child->dev_type == EDGE_DEV || 1746 SAS_ADDR(phy->attached_sas_addr)) {
1713 child->dev_type == FANOUT_DEV) 1747 if (child->dev_type == EDGE_DEV ||
1714 sas_unregister_ex_tree(child); 1748 child->dev_type == FANOUT_DEV)
1715 else 1749 sas_unregister_ex_tree(child);
1716 sas_unregister_dev(child); 1750 else
1717 break; 1751 sas_unregister_dev(child);
1752 break;
1753 }
1718 } 1754 }
1755 sas_disable_routing(parent, phy->attached_sas_addr);
1719 } 1756 }
1720 sas_disable_routing(parent, phy->attached_sas_addr);
1721 memset(phy->attached_sas_addr, 0, SAS_ADDR_SIZE); 1757 memset(phy->attached_sas_addr, 0, SAS_ADDR_SIZE);
1722 sas_port_delete_phy(phy->port, phy->phy); 1758 sas_port_delete_phy(phy->port, phy->phy);
1723 if (phy->port->num_phys == 0) 1759 if (phy->port->num_phys == 0)
@@ -1770,15 +1806,31 @@ static int sas_discover_new(struct domain_device *dev, int phy_id)
1770{ 1806{
1771 struct ex_phy *ex_phy = &dev->ex_dev.ex_phy[phy_id]; 1807 struct ex_phy *ex_phy = &dev->ex_dev.ex_phy[phy_id];
1772 struct domain_device *child; 1808 struct domain_device *child;
1773 int res; 1809 bool found = false;
1810 int res, i;
1774 1811
1775 SAS_DPRINTK("ex %016llx phy%d new device attached\n", 1812 SAS_DPRINTK("ex %016llx phy%d new device attached\n",
1776 SAS_ADDR(dev->sas_addr), phy_id); 1813 SAS_ADDR(dev->sas_addr), phy_id);
1777 res = sas_ex_phy_discover(dev, phy_id); 1814 res = sas_ex_phy_discover(dev, phy_id);
1778 if (res) 1815 if (res)
1779 goto out; 1816 goto out;
1817 /* to support the wide port inserted */
1818 for (i = 0; i < dev->ex_dev.num_phys; i++) {
1819 struct ex_phy *ex_phy_temp = &dev->ex_dev.ex_phy[i];
1820 if (i == phy_id)
1821 continue;
1822 if (SAS_ADDR(ex_phy_temp->attached_sas_addr) ==
1823 SAS_ADDR(ex_phy->attached_sas_addr)) {
1824 found = true;
1825 break;
1826 }
1827 }
1828 if (found) {
1829 sas_ex_join_wide_port(dev, phy_id);
1830 return 0;
1831 }
1780 res = sas_ex_discover_devices(dev, phy_id); 1832 res = sas_ex_discover_devices(dev, phy_id);
1781 if (res) 1833 if (!res)
1782 goto out; 1834 goto out;
1783 list_for_each_entry(child, &dev->ex_dev.children, siblings) { 1835 list_for_each_entry(child, &dev->ex_dev.children, siblings) {
1784 if (SAS_ADDR(child->sas_addr) == 1836 if (SAS_ADDR(child->sas_addr) ==
@@ -1793,7 +1845,7 @@ out:
1793 return res; 1845 return res;
1794} 1846}
1795 1847
1796static int sas_rediscover_dev(struct domain_device *dev, int phy_id) 1848static int sas_rediscover_dev(struct domain_device *dev, int phy_id, bool last)
1797{ 1849{
1798 struct expander_device *ex = &dev->ex_dev; 1850 struct expander_device *ex = &dev->ex_dev;
1799 struct ex_phy *phy = &ex->ex_phy[phy_id]; 1851 struct ex_phy *phy = &ex->ex_phy[phy_id];
@@ -1804,11 +1856,11 @@ static int sas_rediscover_dev(struct domain_device *dev, int phy_id)
1804 switch (res) { 1856 switch (res) {
1805 case SMP_RESP_NO_PHY: 1857 case SMP_RESP_NO_PHY:
1806 phy->phy_state = PHY_NOT_PRESENT; 1858 phy->phy_state = PHY_NOT_PRESENT;
1807 sas_unregister_devs_sas_addr(dev, phy_id); 1859 sas_unregister_devs_sas_addr(dev, phy_id, last);
1808 goto out; break; 1860 goto out; break;
1809 case SMP_RESP_PHY_VACANT: 1861 case SMP_RESP_PHY_VACANT:
1810 phy->phy_state = PHY_VACANT; 1862 phy->phy_state = PHY_VACANT;
1811 sas_unregister_devs_sas_addr(dev, phy_id); 1863 sas_unregister_devs_sas_addr(dev, phy_id, last);
1812 goto out; break; 1864 goto out; break;
1813 case SMP_RESP_FUNC_ACC: 1865 case SMP_RESP_FUNC_ACC:
1814 break; 1866 break;
@@ -1816,7 +1868,7 @@ static int sas_rediscover_dev(struct domain_device *dev, int phy_id)
1816 1868
1817 if (SAS_ADDR(attached_sas_addr) == 0) { 1869 if (SAS_ADDR(attached_sas_addr) == 0) {
1818 phy->phy_state = PHY_EMPTY; 1870 phy->phy_state = PHY_EMPTY;
1819 sas_unregister_devs_sas_addr(dev, phy_id); 1871 sas_unregister_devs_sas_addr(dev, phy_id, last);
1820 } else if (SAS_ADDR(attached_sas_addr) == 1872 } else if (SAS_ADDR(attached_sas_addr) ==
1821 SAS_ADDR(phy->attached_sas_addr)) { 1873 SAS_ADDR(phy->attached_sas_addr)) {
1822 SAS_DPRINTK("ex %016llx phy 0x%x broadcast flutter\n", 1874 SAS_DPRINTK("ex %016llx phy 0x%x broadcast flutter\n",
@@ -1828,12 +1880,27 @@ out:
1828 return res; 1880 return res;
1829} 1881}
1830 1882
1883/**
1884 * sas_rediscover - revalidate the domain.
1885 * @dev:domain device to be detect.
1886 * @phy_id: the phy id will be detected.
1887 *
1888 * NOTE: this process _must_ quit (return) as soon as any connection
1889 * errors are encountered. Connection recovery is done elsewhere.
1890 * Discover process only interrogates devices in order to discover the
1891 * domain.For plugging out, we un-register the device only when it is
1892 * the last phy in the port, for other phys in this port, we just delete it
1893 * from the port.For inserting, we do discovery when it is the
1894 * first phy,for other phys in this port, we add it to the port to
1895 * forming the wide-port.
1896 */
1831static int sas_rediscover(struct domain_device *dev, const int phy_id) 1897static int sas_rediscover(struct domain_device *dev, const int phy_id)
1832{ 1898{
1833 struct expander_device *ex = &dev->ex_dev; 1899 struct expander_device *ex = &dev->ex_dev;
1834 struct ex_phy *changed_phy = &ex->ex_phy[phy_id]; 1900 struct ex_phy *changed_phy = &ex->ex_phy[phy_id];
1835 int res = 0; 1901 int res = 0;
1836 int i; 1902 int i;
1903 bool last = true; /* is this the last phy of the port */
1837 1904
1838 SAS_DPRINTK("ex %016llx phy%d originated BROADCAST(CHANGE)\n", 1905 SAS_DPRINTK("ex %016llx phy%d originated BROADCAST(CHANGE)\n",
1839 SAS_ADDR(dev->sas_addr), phy_id); 1906 SAS_ADDR(dev->sas_addr), phy_id);
@@ -1848,13 +1915,13 @@ static int sas_rediscover(struct domain_device *dev, const int phy_id)
1848 SAS_ADDR(changed_phy->attached_sas_addr)) { 1915 SAS_ADDR(changed_phy->attached_sas_addr)) {
1849 SAS_DPRINTK("phy%d part of wide port with " 1916 SAS_DPRINTK("phy%d part of wide port with "
1850 "phy%d\n", phy_id, i); 1917 "phy%d\n", phy_id, i);
1851 goto out; 1918 last = false;
1919 break;
1852 } 1920 }
1853 } 1921 }
1854 res = sas_rediscover_dev(dev, phy_id); 1922 res = sas_rediscover_dev(dev, phy_id, last);
1855 } else 1923 } else
1856 res = sas_discover_new(dev, phy_id); 1924 res = sas_discover_new(dev, phy_id);
1857out:
1858 return res; 1925 return res;
1859} 1926}
1860 1927
@@ -1881,7 +1948,7 @@ int sas_ex_revalidate_domain(struct domain_device *port_dev)
1881 1948
1882 do { 1949 do {
1883 phy_id = -1; 1950 phy_id = -1;
1884 res = sas_find_bcast_phy(dev, &phy_id, i); 1951 res = sas_find_bcast_phy(dev, &phy_id, i, true);
1885 if (phy_id == -1) 1952 if (phy_id == -1)
1886 break; 1953 break;
1887 res = sas_rediscover(dev, phy_id); 1954 res = sas_rediscover(dev, phy_id);
diff --git a/drivers/scsi/libsas/sas_port.c b/drivers/scsi/libsas/sas_port.c
index e6ac59c023f1..fe8b74c706d2 100644
--- a/drivers/scsi/libsas/sas_port.c
+++ b/drivers/scsi/libsas/sas_port.c
@@ -56,7 +56,7 @@ static void sas_form_port(struct asd_sas_phy *phy)
56 } 56 }
57 } 57 }
58 58
59 /* find a port */ 59 /* see if the phy should be part of a wide port */
60 spin_lock_irqsave(&sas_ha->phy_port_lock, flags); 60 spin_lock_irqsave(&sas_ha->phy_port_lock, flags);
61 for (i = 0; i < sas_ha->num_phys; i++) { 61 for (i = 0; i < sas_ha->num_phys; i++) {
62 port = sas_ha->sas_port[i]; 62 port = sas_ha->sas_port[i];
@@ -69,12 +69,23 @@ static void sas_form_port(struct asd_sas_phy *phy)
69 SAS_DPRINTK("phy%d matched wide port%d\n", phy->id, 69 SAS_DPRINTK("phy%d matched wide port%d\n", phy->id,
70 port->id); 70 port->id);
71 break; 71 break;
72 } else if (*(u64 *) port->sas_addr == 0 && port->num_phys==0) {
73 memcpy(port->sas_addr, phy->sas_addr, SAS_ADDR_SIZE);
74 break;
75 } 72 }
76 spin_unlock(&port->phy_list_lock); 73 spin_unlock(&port->phy_list_lock);
77 } 74 }
75 /* The phy does not match any existing port, create a new one */
76 if (i == sas_ha->num_phys) {
77 for (i = 0; i < sas_ha->num_phys; i++) {
78 port = sas_ha->sas_port[i];
79 spin_lock(&port->phy_list_lock);
80 if (*(u64 *)port->sas_addr == 0
81 && port->num_phys == 0) {
82 memcpy(port->sas_addr, phy->sas_addr,
83 SAS_ADDR_SIZE);
84 break;
85 }
86 spin_unlock(&port->phy_list_lock);
87 }
88 }
78 89
79 if (i >= sas_ha->num_phys) { 90 if (i >= sas_ha->num_phys) {
80 printk(KERN_NOTICE "%s: couldn't find a free port, bug?\n", 91 printk(KERN_NOTICE "%s: couldn't find a free port, bug?\n",
diff --git a/drivers/scsi/mac53c94.c b/drivers/scsi/mac53c94.c
index b12ad7c7c673..18735b39b3d3 100644
--- a/drivers/scsi/mac53c94.c
+++ b/drivers/scsi/mac53c94.c
@@ -75,8 +75,9 @@ static int mac53c94_queue(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *
75 int i; 75 int i;
76 printk(KERN_DEBUG "mac53c94_queue %p: command is", cmd); 76 printk(KERN_DEBUG "mac53c94_queue %p: command is", cmd);
77 for (i = 0; i < cmd->cmd_len; ++i) 77 for (i = 0; i < cmd->cmd_len; ++i)
78 printk(" %.2x", cmd->cmnd[i]); 78 printk(KERN_CONT " %.2x", cmd->cmnd[i]);
79 printk("\n" KERN_DEBUG "use_sg=%d request_bufflen=%d request_buffer=%p\n", 79 printk(KERN_CONT "\n");
80 printk(KERN_DEBUG "use_sg=%d request_bufflen=%d request_buffer=%p\n",
80 scsi_sg_count(cmd), scsi_bufflen(cmd), scsi_sglist(cmd)); 81 scsi_sg_count(cmd), scsi_bufflen(cmd), scsi_sglist(cmd));
81 } 82 }
82#endif 83#endif
diff --git a/drivers/scsi/qla2xxx/qla_mid.c b/drivers/scsi/qla2xxx/qla_mid.c
index 650bcef08f2a..cd78c501803a 100644
--- a/drivers/scsi/qla2xxx/qla_mid.c
+++ b/drivers/scsi/qla2xxx/qla_mid.c
@@ -9,7 +9,6 @@
9 9
10#include <linux/moduleparam.h> 10#include <linux/moduleparam.h>
11#include <linux/vmalloc.h> 11#include <linux/vmalloc.h>
12#include <linux/smp_lock.h>
13#include <linux/list.h> 12#include <linux/list.h>
14 13
15#include <scsi/scsi_tcq.h> 14#include <scsi/scsi_tcq.h>
diff --git a/drivers/scsi/qla4xxx/ql4_dbg.c b/drivers/scsi/qla4xxx/ql4_dbg.c
index fcc184cd066d..cbceb0ebabf7 100644
--- a/drivers/scsi/qla4xxx/ql4_dbg.c
+++ b/drivers/scsi/qla4xxx/ql4_dbg.c
@@ -15,19 +15,18 @@ void qla4xxx_dump_buffer(void *b, uint32_t size)
15 uint32_t cnt; 15 uint32_t cnt;
16 uint8_t *c = b; 16 uint8_t *c = b;
17 17
18 printk(" 0 1 2 3 4 5 6 7 8 9 Ah Bh Ch Dh Eh " 18 printk(" 0 1 2 3 4 5 6 7 8 9 Ah Bh Ch Dh Eh "
19 "Fh\n"); 19 "Fh\n");
20 printk("------------------------------------------------------------" 20 printk("------------------------------------------------------------"
21 "--\n"); 21 "--\n");
22 for (cnt = 0; cnt < size; cnt++, c++) { 22 for (cnt = 0; cnt < size; c++) {
23 printk(KERN_DEBUG "%02x", *c); 23 printk(KERN_INFO "%02x", *c);
24 if (!(cnt % 16)) 24 if (!(++cnt % 16))
25 printk(KERN_DEBUG "\n"); 25 printk(KERN_INFO "\n");
26 26
27 else 27 else
28 printk(KERN_DEBUG " "); 28 printk(KERN_INFO " ");
29 } 29 }
30 if (cnt % 16) 30 printk(KERN_INFO "\n");
31 printk(KERN_DEBUG "\n");
32} 31}
33 32
diff --git a/drivers/scsi/qla4xxx/ql4_def.h b/drivers/scsi/qla4xxx/ql4_def.h
index b586f27c3bd4..81b5f29254e2 100644
--- a/drivers/scsi/qla4xxx/ql4_def.h
+++ b/drivers/scsi/qla4xxx/ql4_def.h
@@ -100,7 +100,6 @@
100#define MAX_SRBS MAX_CMDS_TO_RISC 100#define MAX_SRBS MAX_CMDS_TO_RISC
101#define MBOX_AEN_REG_COUNT 5 101#define MBOX_AEN_REG_COUNT 5
102#define MAX_INIT_RETRIES 5 102#define MAX_INIT_RETRIES 5
103#define IOCB_HIWAT_CUSHION 16
104 103
105/* 104/*
106 * Buffer sizes 105 * Buffer sizes
@@ -184,6 +183,11 @@ struct srb {
184 uint16_t cc_stat; 183 uint16_t cc_stat;
185 u_long r_start; /* Time we recieve a cmd from OS */ 184 u_long r_start; /* Time we recieve a cmd from OS */
186 u_long u_start; /* Time when we handed the cmd to F/W */ 185 u_long u_start; /* Time when we handed the cmd to F/W */
186
187 /* Used for extended sense / status continuation */
188 uint8_t *req_sense_ptr;
189 uint16_t req_sense_len;
190 uint16_t reserved2;
187}; 191};
188 192
189/* 193/*
@@ -302,7 +306,6 @@ struct scsi_qla_host {
302 uint32_t tot_ddbs; 306 uint32_t tot_ddbs;
303 307
304 uint16_t iocb_cnt; 308 uint16_t iocb_cnt;
305 uint16_t iocb_hiwat;
306 309
307 /* SRB cache. */ 310 /* SRB cache. */
308#define SRB_MIN_REQ 128 311#define SRB_MIN_REQ 128
@@ -436,6 +439,8 @@ struct scsi_qla_host {
436 /* Map ddb_list entry by FW ddb index */ 439 /* Map ddb_list entry by FW ddb index */
437 struct ddb_entry *fw_ddb_index_map[MAX_DDB_ENTRIES]; 440 struct ddb_entry *fw_ddb_index_map[MAX_DDB_ENTRIES];
438 441
442 /* Saved srb for status continuation entry processing */
443 struct srb *status_srb;
439}; 444};
440 445
441static inline int is_qla4010(struct scsi_qla_host *ha) 446static inline int is_qla4010(struct scsi_qla_host *ha)
diff --git a/drivers/scsi/qla4xxx/ql4_fw.h b/drivers/scsi/qla4xxx/ql4_fw.h
index 1b667a70cffa..9cd7a608df38 100644
--- a/drivers/scsi/qla4xxx/ql4_fw.h
+++ b/drivers/scsi/qla4xxx/ql4_fw.h
@@ -572,6 +572,7 @@ struct conn_event_log_entry {
572 *************************************************************************/ 572 *************************************************************************/
573#define IOCB_MAX_CDB_LEN 16 /* Bytes in a CBD */ 573#define IOCB_MAX_CDB_LEN 16 /* Bytes in a CBD */
574#define IOCB_MAX_SENSEDATA_LEN 32 /* Bytes of sense data */ 574#define IOCB_MAX_SENSEDATA_LEN 32 /* Bytes of sense data */
575#define IOCB_MAX_EXT_SENSEDATA_LEN 60 /* Bytes of extended sense data */
575 576
576/* IOCB header structure */ 577/* IOCB header structure */
577struct qla4_header { 578struct qla4_header {
@@ -733,6 +734,12 @@ struct status_entry {
733 734
734}; 735};
735 736
737/* Status Continuation entry */
738struct status_cont_entry {
739 struct qla4_header hdr; /* 00-03 */
740 uint8_t ext_sense_data[IOCB_MAX_EXT_SENSEDATA_LEN]; /* 04-63 */
741};
742
736struct passthru0 { 743struct passthru0 {
737 struct qla4_header hdr; /* 00-03 */ 744 struct qla4_header hdr; /* 00-03 */
738 uint32_t handle; /* 04-07 */ 745 uint32_t handle; /* 04-07 */
diff --git a/drivers/scsi/qla4xxx/ql4_iocb.c b/drivers/scsi/qla4xxx/ql4_iocb.c
index 912a67494adf..e0c32159749c 100644
--- a/drivers/scsi/qla4xxx/ql4_iocb.c
+++ b/drivers/scsi/qla4xxx/ql4_iocb.c
@@ -10,9 +10,42 @@
10#include "ql4_dbg.h" 10#include "ql4_dbg.h"
11#include "ql4_inline.h" 11#include "ql4_inline.h"
12 12
13
14#include <scsi/scsi_tcq.h> 13#include <scsi/scsi_tcq.h>
15 14
15static int
16qla4xxx_space_in_req_ring(struct scsi_qla_host *ha, uint16_t req_cnt)
17{
18 uint16_t cnt;
19
20 /* Calculate number of free request entries. */
21 if ((req_cnt + 2) >= ha->req_q_count) {
22 cnt = (uint16_t) le32_to_cpu(ha->shadow_regs->req_q_out);
23 if (ha->request_in < cnt)
24 ha->req_q_count = cnt - ha->request_in;
25 else
26 ha->req_q_count = REQUEST_QUEUE_DEPTH -
27 (ha->request_in - cnt);
28 }
29
30 /* Check if room for request in request ring. */
31 if ((req_cnt + 2) < ha->req_q_count)
32 return 1;
33 else
34 return 0;
35}
36
37static void qla4xxx_advance_req_ring_ptr(struct scsi_qla_host *ha)
38{
39 /* Advance request queue pointer */
40 if (ha->request_in == (REQUEST_QUEUE_DEPTH - 1)) {
41 ha->request_in = 0;
42 ha->request_ptr = ha->request_ring;
43 } else {
44 ha->request_in++;
45 ha->request_ptr++;
46 }
47}
48
16/** 49/**
17 * qla4xxx_get_req_pkt - returns a valid entry in request queue. 50 * qla4xxx_get_req_pkt - returns a valid entry in request queue.
18 * @ha: Pointer to host adapter structure. 51 * @ha: Pointer to host adapter structure.
@@ -26,35 +59,18 @@
26static int qla4xxx_get_req_pkt(struct scsi_qla_host *ha, 59static int qla4xxx_get_req_pkt(struct scsi_qla_host *ha,
27 struct queue_entry **queue_entry) 60 struct queue_entry **queue_entry)
28{ 61{
29 uint16_t request_in; 62 uint16_t req_cnt = 1;
30 uint8_t status = QLA_SUCCESS;
31
32 *queue_entry = ha->request_ptr;
33 63
34 /* get the latest request_in and request_out index */ 64 if (qla4xxx_space_in_req_ring(ha, req_cnt)) {
35 request_in = ha->request_in; 65 *queue_entry = ha->request_ptr;
36 ha->request_out = (uint16_t) le32_to_cpu(ha->shadow_regs->req_q_out);
37
38 /* Advance request queue pointer and check for queue full */
39 if (request_in == (REQUEST_QUEUE_DEPTH - 1)) {
40 request_in = 0;
41 ha->request_ptr = ha->request_ring;
42 } else {
43 request_in++;
44 ha->request_ptr++;
45 }
46
47 /* request queue is full, try again later */
48 if ((ha->iocb_cnt + 1) >= ha->iocb_hiwat) {
49 /* restore request pointer */
50 ha->request_ptr = *queue_entry;
51 status = QLA_ERROR;
52 } else {
53 ha->request_in = request_in;
54 memset(*queue_entry, 0, sizeof(**queue_entry)); 66 memset(*queue_entry, 0, sizeof(**queue_entry));
67
68 qla4xxx_advance_req_ring_ptr(ha);
69 ha->req_q_count -= req_cnt;
70 return QLA_SUCCESS;
55 } 71 }
56 72
57 return status; 73 return QLA_ERROR;
58} 74}
59 75
60/** 76/**
@@ -100,21 +116,14 @@ exit_send_marker:
100 return status; 116 return status;
101} 117}
102 118
103static struct continuation_t1_entry* qla4xxx_alloc_cont_entry( 119static struct continuation_t1_entry *
104 struct scsi_qla_host *ha) 120qla4xxx_alloc_cont_entry(struct scsi_qla_host *ha)
105{ 121{
106 struct continuation_t1_entry *cont_entry; 122 struct continuation_t1_entry *cont_entry;
107 123
108 cont_entry = (struct continuation_t1_entry *)ha->request_ptr; 124 cont_entry = (struct continuation_t1_entry *)ha->request_ptr;
109 125
110 /* Advance request queue pointer */ 126 qla4xxx_advance_req_ring_ptr(ha);
111 if (ha->request_in == (REQUEST_QUEUE_DEPTH - 1)) {
112 ha->request_in = 0;
113 ha->request_ptr = ha->request_ring;
114 } else {
115 ha->request_in++;
116 ha->request_ptr++;
117 }
118 127
119 /* Load packet defaults */ 128 /* Load packet defaults */
120 cont_entry->hdr.entryType = ET_CONTINUE; 129 cont_entry->hdr.entryType = ET_CONTINUE;
@@ -197,13 +206,10 @@ int qla4xxx_send_command_to_isp(struct scsi_qla_host *ha, struct srb * srb)
197 struct scsi_cmnd *cmd = srb->cmd; 206 struct scsi_cmnd *cmd = srb->cmd;
198 struct ddb_entry *ddb_entry; 207 struct ddb_entry *ddb_entry;
199 struct command_t3_entry *cmd_entry; 208 struct command_t3_entry *cmd_entry;
200
201 int nseg; 209 int nseg;
202 uint16_t tot_dsds; 210 uint16_t tot_dsds;
203 uint16_t req_cnt; 211 uint16_t req_cnt;
204
205 unsigned long flags; 212 unsigned long flags;
206 uint16_t cnt;
207 uint32_t index; 213 uint32_t index;
208 char tag[2]; 214 char tag[2];
209 215
@@ -217,6 +223,19 @@ int qla4xxx_send_command_to_isp(struct scsi_qla_host *ha, struct srb * srb)
217 223
218 index = (uint32_t)cmd->request->tag; 224 index = (uint32_t)cmd->request->tag;
219 225
226 /*
227 * Check to see if adapter is online before placing request on
228 * request queue. If a reset occurs and a request is in the queue,
229 * the firmware will still attempt to process the request, retrieving
230 * garbage for pointers.
231 */
232 if (!test_bit(AF_ONLINE, &ha->flags)) {
233 DEBUG2(printk("scsi%ld: %s: Adapter OFFLINE! "
234 "Do not issue command.\n",
235 ha->host_no, __func__));
236 goto queuing_error;
237 }
238
220 /* Calculate the number of request entries needed. */ 239 /* Calculate the number of request entries needed. */
221 nseg = scsi_dma_map(cmd); 240 nseg = scsi_dma_map(cmd);
222 if (nseg < 0) 241 if (nseg < 0)
@@ -224,17 +243,7 @@ int qla4xxx_send_command_to_isp(struct scsi_qla_host *ha, struct srb * srb)
224 tot_dsds = nseg; 243 tot_dsds = nseg;
225 244
226 req_cnt = qla4xxx_calc_request_entries(tot_dsds); 245 req_cnt = qla4xxx_calc_request_entries(tot_dsds);
227 246 if (!qla4xxx_space_in_req_ring(ha, req_cnt))
228 if (ha->req_q_count < (req_cnt + 2)) {
229 cnt = (uint16_t) le32_to_cpu(ha->shadow_regs->req_q_out);
230 if (ha->request_in < cnt)
231 ha->req_q_count = cnt - ha->request_in;
232 else
233 ha->req_q_count = REQUEST_QUEUE_DEPTH -
234 (ha->request_in - cnt);
235 }
236
237 if (ha->req_q_count < (req_cnt + 2))
238 goto queuing_error; 247 goto queuing_error;
239 248
240 /* total iocbs active */ 249 /* total iocbs active */
@@ -286,32 +295,10 @@ int qla4xxx_send_command_to_isp(struct scsi_qla_host *ha, struct srb * srb)
286 break; 295 break;
287 } 296 }
288 297
289 298 qla4xxx_advance_req_ring_ptr(ha);
290 /* Advance request queue pointer */
291 ha->request_in++;
292 if (ha->request_in == REQUEST_QUEUE_DEPTH) {
293 ha->request_in = 0;
294 ha->request_ptr = ha->request_ring;
295 } else
296 ha->request_ptr++;
297
298
299 qla4xxx_build_scsi_iocbs(srb, cmd_entry, tot_dsds); 299 qla4xxx_build_scsi_iocbs(srb, cmd_entry, tot_dsds);
300 wmb(); 300 wmb();
301 301
302 /*
303 * Check to see if adapter is online before placing request on
304 * request queue. If a reset occurs and a request is in the queue,
305 * the firmware will still attempt to process the request, retrieving
306 * garbage for pointers.
307 */
308 if (!test_bit(AF_ONLINE, &ha->flags)) {
309 DEBUG2(printk("scsi%ld: %s: Adapter OFFLINE! "
310 "Do not issue command.\n",
311 ha->host_no, __func__));
312 goto queuing_error;
313 }
314
315 srb->cmd->host_scribble = (unsigned char *)srb; 302 srb->cmd->host_scribble = (unsigned char *)srb;
316 303
317 /* update counters */ 304 /* update counters */
diff --git a/drivers/scsi/qla4xxx/ql4_isr.c b/drivers/scsi/qla4xxx/ql4_isr.c
index 799120fcb9be..8025ee16588e 100644
--- a/drivers/scsi/qla4xxx/ql4_isr.c
+++ b/drivers/scsi/qla4xxx/ql4_isr.c
@@ -11,6 +11,98 @@
11#include "ql4_inline.h" 11#include "ql4_inline.h"
12 12
13/** 13/**
14 * qla4xxx_copy_sense - copy sense data into cmd sense buffer
15 * @ha: Pointer to host adapter structure.
16 * @sts_entry: Pointer to status entry structure.
17 * @srb: Pointer to srb structure.
18 **/
19static void qla4xxx_copy_sense(struct scsi_qla_host *ha,
20 struct status_entry *sts_entry,
21 struct srb *srb)
22{
23 struct scsi_cmnd *cmd = srb->cmd;
24 uint16_t sense_len;
25
26 memset(cmd->sense_buffer, 0, SCSI_SENSE_BUFFERSIZE);
27 sense_len = le16_to_cpu(sts_entry->senseDataByteCnt);
28 if (sense_len == 0)
29 return;
30
31 /* Save total available sense length,
32 * not to exceed cmd's sense buffer size */
33 sense_len = min_t(uint16_t, sense_len, SCSI_SENSE_BUFFERSIZE);
34 srb->req_sense_ptr = cmd->sense_buffer;
35 srb->req_sense_len = sense_len;
36
37 /* Copy sense from sts_entry pkt */
38 sense_len = min_t(uint16_t, sense_len, IOCB_MAX_SENSEDATA_LEN);
39 memcpy(cmd->sense_buffer, sts_entry->senseData, sense_len);
40
41 DEBUG2(printk(KERN_INFO "scsi%ld:%d:%d:%d: %s: sense key = %x, "
42 "ASL= %02x, ASC/ASCQ = %02x/%02x\n", ha->host_no,
43 cmd->device->channel, cmd->device->id,
44 cmd->device->lun, __func__,
45 sts_entry->senseData[2] & 0x0f,
46 sts_entry->senseData[7],
47 sts_entry->senseData[12],
48 sts_entry->senseData[13]));
49
50 DEBUG5(qla4xxx_dump_buffer(cmd->sense_buffer, sense_len));
51 srb->flags |= SRB_GOT_SENSE;
52
53 /* Update srb, in case a sts_cont pkt follows */
54 srb->req_sense_ptr += sense_len;
55 srb->req_sense_len -= sense_len;
56 if (srb->req_sense_len != 0)
57 ha->status_srb = srb;
58 else
59 ha->status_srb = NULL;
60}
61
62/**
63 * qla4xxx_status_cont_entry - Process a Status Continuations entry.
64 * @ha: SCSI driver HA context
65 * @sts_cont: Entry pointer
66 *
67 * Extended sense data.
68 */
69static void
70qla4xxx_status_cont_entry(struct scsi_qla_host *ha,
71 struct status_cont_entry *sts_cont)
72{
73 struct srb *srb = ha->status_srb;
74 struct scsi_cmnd *cmd;
75 uint8_t sense_len;
76
77 if (srb == NULL)
78 return;
79
80 cmd = srb->cmd;
81 if (cmd == NULL) {
82 DEBUG2(printk(KERN_INFO "scsi%ld: %s: Cmd already returned "
83 "back to OS srb=%p srb->state:%d\n", ha->host_no,
84 __func__, srb, srb->state));
85 ha->status_srb = NULL;
86 return;
87 }
88
89 /* Copy sense data. */
90 sense_len = min_t(uint16_t, srb->req_sense_len,
91 IOCB_MAX_EXT_SENSEDATA_LEN);
92 memcpy(srb->req_sense_ptr, sts_cont->ext_sense_data, sense_len);
93 DEBUG5(qla4xxx_dump_buffer(srb->req_sense_ptr, sense_len));
94
95 srb->req_sense_ptr += sense_len;
96 srb->req_sense_len -= sense_len;
97
98 /* Place command on done queue. */
99 if (srb->req_sense_len == 0) {
100 qla4xxx_srb_compl(ha, srb);
101 ha->status_srb = NULL;
102 }
103}
104
105/**
14 * qla4xxx_status_entry - processes status IOCBs 106 * qla4xxx_status_entry - processes status IOCBs
15 * @ha: Pointer to host adapter structure. 107 * @ha: Pointer to host adapter structure.
16 * @sts_entry: Pointer to status entry structure. 108 * @sts_entry: Pointer to status entry structure.
@@ -23,7 +115,6 @@ static void qla4xxx_status_entry(struct scsi_qla_host *ha,
23 struct srb *srb; 115 struct srb *srb;
24 struct ddb_entry *ddb_entry; 116 struct ddb_entry *ddb_entry;
25 uint32_t residual; 117 uint32_t residual;
26 uint16_t sensebytecnt;
27 118
28 srb = qla4xxx_del_from_active_array(ha, le32_to_cpu(sts_entry->handle)); 119 srb = qla4xxx_del_from_active_array(ha, le32_to_cpu(sts_entry->handle));
29 if (!srb) { 120 if (!srb) {
@@ -92,24 +183,7 @@ static void qla4xxx_status_entry(struct scsi_qla_host *ha,
92 break; 183 break;
93 184
94 /* Copy Sense Data into sense buffer. */ 185 /* Copy Sense Data into sense buffer. */
95 memset(cmd->sense_buffer, 0, SCSI_SENSE_BUFFERSIZE); 186 qla4xxx_copy_sense(ha, sts_entry, srb);
96
97 sensebytecnt = le16_to_cpu(sts_entry->senseDataByteCnt);
98 if (sensebytecnt == 0)
99 break;
100
101 memcpy(cmd->sense_buffer, sts_entry->senseData,
102 min_t(uint16_t, sensebytecnt, SCSI_SENSE_BUFFERSIZE));
103
104 DEBUG2(printk("scsi%ld:%d:%d:%d: %s: sense key = %x, "
105 "ASC/ASCQ = %02x/%02x\n", ha->host_no,
106 cmd->device->channel, cmd->device->id,
107 cmd->device->lun, __func__,
108 sts_entry->senseData[2] & 0x0f,
109 sts_entry->senseData[12],
110 sts_entry->senseData[13]));
111
112 srb->flags |= SRB_GOT_SENSE;
113 break; 187 break;
114 188
115 case SCS_INCOMPLETE: 189 case SCS_INCOMPLETE:
@@ -176,23 +250,7 @@ static void qla4xxx_status_entry(struct scsi_qla_host *ha,
176 break; 250 break;
177 251
178 /* Copy Sense Data into sense buffer. */ 252 /* Copy Sense Data into sense buffer. */
179 memset(cmd->sense_buffer, 0, SCSI_SENSE_BUFFERSIZE); 253 qla4xxx_copy_sense(ha, sts_entry, srb);
180
181 sensebytecnt =
182 le16_to_cpu(sts_entry->senseDataByteCnt);
183 if (sensebytecnt == 0)
184 break;
185
186 memcpy(cmd->sense_buffer, sts_entry->senseData,
187 min_t(uint16_t, sensebytecnt, SCSI_SENSE_BUFFERSIZE));
188
189 DEBUG2(printk("scsi%ld:%d:%d:%d: %s: sense key = %x, "
190 "ASC/ASCQ = %02x/%02x\n", ha->host_no,
191 cmd->device->channel, cmd->device->id,
192 cmd->device->lun, __func__,
193 sts_entry->senseData[2] & 0x0f,
194 sts_entry->senseData[12],
195 sts_entry->senseData[13]));
196 } else { 254 } else {
197 /* 255 /*
198 * If RISC reports underrun and target does not 256 * If RISC reports underrun and target does not
@@ -268,9 +326,10 @@ static void qla4xxx_status_entry(struct scsi_qla_host *ha,
268 326
269status_entry_exit: 327status_entry_exit:
270 328
271 /* complete the request */ 329 /* complete the request, if not waiting for status_continuation pkt */
272 srb->cc_stat = sts_entry->completionStatus; 330 srb->cc_stat = sts_entry->completionStatus;
273 qla4xxx_srb_compl(ha, srb); 331 if (ha->status_srb == NULL)
332 qla4xxx_srb_compl(ha, srb);
274} 333}
275 334
276/** 335/**
@@ -305,10 +364,7 @@ static void qla4xxx_process_response_queue(struct scsi_qla_host * ha)
305 /* process entry */ 364 /* process entry */
306 switch (sts_entry->hdr.entryType) { 365 switch (sts_entry->hdr.entryType) {
307 case ET_STATUS: 366 case ET_STATUS:
308 /* 367 /* Common status */
309 * Common status - Single completion posted in single
310 * IOSB.
311 */
312 qla4xxx_status_entry(ha, sts_entry); 368 qla4xxx_status_entry(ha, sts_entry);
313 break; 369 break;
314 370
@@ -316,9 +372,8 @@ static void qla4xxx_process_response_queue(struct scsi_qla_host * ha)
316 break; 372 break;
317 373
318 case ET_STATUS_CONTINUATION: 374 case ET_STATUS_CONTINUATION:
319 /* Just throw away the status continuation entries */ 375 qla4xxx_status_cont_entry(ha,
320 DEBUG2(printk("scsi%ld: %s: Status Continuation entry " 376 (struct status_cont_entry *) sts_entry);
321 "- ignoring\n", ha->host_no, __func__));
322 break; 377 break;
323 378
324 case ET_COMMAND: 379 case ET_COMMAND:
diff --git a/drivers/scsi/qla4xxx/ql4_mbx.c b/drivers/scsi/qla4xxx/ql4_mbx.c
index 051b0f5e8c8e..09d6d4b76f39 100644
--- a/drivers/scsi/qla4xxx/ql4_mbx.c
+++ b/drivers/scsi/qla4xxx/ql4_mbx.c
@@ -385,16 +385,6 @@ int qla4xxx_get_firmware_status(struct scsi_qla_host * ha)
385 mbox_sts[0])); 385 mbox_sts[0]));
386 return QLA_ERROR; 386 return QLA_ERROR;
387 } 387 }
388
389 /* High-water mark of IOCBs */
390 ha->iocb_hiwat = mbox_sts[2];
391 if (ha->iocb_hiwat > IOCB_HIWAT_CUSHION)
392 ha->iocb_hiwat -= IOCB_HIWAT_CUSHION;
393 else
394 dev_info(&ha->pdev->dev, "WARNING!!! You have less than %d "
395 "firmware IOCBs available (%d).\n",
396 IOCB_HIWAT_CUSHION, ha->iocb_hiwat);
397
398 return QLA_SUCCESS; 388 return QLA_SUCCESS;
399} 389}
400 390
diff --git a/drivers/scsi/qla4xxx/ql4_os.c b/drivers/scsi/qla4xxx/ql4_os.c
index ec9da6ce8489..40e3cafb3a9c 100644
--- a/drivers/scsi/qla4xxx/ql4_os.c
+++ b/drivers/scsi/qla4xxx/ql4_os.c
@@ -66,6 +66,7 @@ static int qla4xxx_sess_get_param(struct iscsi_cls_session *sess,
66static int qla4xxx_host_get_param(struct Scsi_Host *shost, 66static int qla4xxx_host_get_param(struct Scsi_Host *shost,
67 enum iscsi_host_param param, char *buf); 67 enum iscsi_host_param param, char *buf);
68static void qla4xxx_recovery_timedout(struct iscsi_cls_session *session); 68static void qla4xxx_recovery_timedout(struct iscsi_cls_session *session);
69static enum blk_eh_timer_return qla4xxx_eh_cmd_timed_out(struct scsi_cmnd *sc);
69 70
70/* 71/*
71 * SCSI host template entry points 72 * SCSI host template entry points
@@ -89,6 +90,7 @@ static struct scsi_host_template qla4xxx_driver_template = {
89 .eh_device_reset_handler = qla4xxx_eh_device_reset, 90 .eh_device_reset_handler = qla4xxx_eh_device_reset,
90 .eh_target_reset_handler = qla4xxx_eh_target_reset, 91 .eh_target_reset_handler = qla4xxx_eh_target_reset,
91 .eh_host_reset_handler = qla4xxx_eh_host_reset, 92 .eh_host_reset_handler = qla4xxx_eh_host_reset,
93 .eh_timed_out = qla4xxx_eh_cmd_timed_out,
92 94
93 .slave_configure = qla4xxx_slave_configure, 95 .slave_configure = qla4xxx_slave_configure,
94 .slave_alloc = qla4xxx_slave_alloc, 96 .slave_alloc = qla4xxx_slave_alloc,
@@ -124,6 +126,21 @@ static struct iscsi_transport qla4xxx_iscsi_transport = {
124 126
125static struct scsi_transport_template *qla4xxx_scsi_transport; 127static struct scsi_transport_template *qla4xxx_scsi_transport;
126 128
129static enum blk_eh_timer_return qla4xxx_eh_cmd_timed_out(struct scsi_cmnd *sc)
130{
131 struct iscsi_cls_session *session;
132 struct ddb_entry *ddb_entry;
133
134 session = starget_to_session(scsi_target(sc->device));
135 ddb_entry = session->dd_data;
136
137 /* if we are not logged in then the LLD is going to clean up the cmd */
138 if (atomic_read(&ddb_entry->state) != DDB_STATE_ONLINE)
139 return BLK_EH_RESET_TIMER;
140 else
141 return BLK_EH_NOT_HANDLED;
142}
143
127static void qla4xxx_recovery_timedout(struct iscsi_cls_session *session) 144static void qla4xxx_recovery_timedout(struct iscsi_cls_session *session)
128{ 145{
129 struct ddb_entry *ddb_entry = session->dd_data; 146 struct ddb_entry *ddb_entry = session->dd_data;
@@ -904,18 +921,17 @@ static int qla4xxx_recover_adapter(struct scsi_qla_host *ha,
904 /* Flush any pending ddb changed AENs */ 921 /* Flush any pending ddb changed AENs */
905 qla4xxx_process_aen(ha, FLUSH_DDB_CHANGED_AENS); 922 qla4xxx_process_aen(ha, FLUSH_DDB_CHANGED_AENS);
906 923
924 qla4xxx_flush_active_srbs(ha);
925
907 /* Reset the firmware. If successful, function 926 /* Reset the firmware. If successful, function
908 * returns with ISP interrupts enabled. 927 * returns with ISP interrupts enabled.
909 */ 928 */
910 if (status == QLA_SUCCESS) { 929 DEBUG2(printk("scsi%ld: %s - Performing soft reset..\n",
911 DEBUG2(printk("scsi%ld: %s - Performing soft reset..\n", 930 ha->host_no, __func__));
912 ha->host_no, __func__)); 931 if (ql4xxx_lock_drvr_wait(ha) == QLA_SUCCESS)
913 qla4xxx_flush_active_srbs(ha); 932 status = qla4xxx_soft_reset(ha);
914 if (ql4xxx_lock_drvr_wait(ha) == QLA_SUCCESS) 933 else
915 status = qla4xxx_soft_reset(ha); 934 status = QLA_ERROR;
916 else
917 status = QLA_ERROR;
918 }
919 935
920 /* Flush any pending ddb changed AENs */ 936 /* Flush any pending ddb changed AENs */
921 qla4xxx_process_aen(ha, FLUSH_DDB_CHANGED_AENS); 937 qla4xxx_process_aen(ha, FLUSH_DDB_CHANGED_AENS);
@@ -1527,11 +1543,9 @@ static int qla4xxx_eh_device_reset(struct scsi_cmnd *cmd)
1527{ 1543{
1528 struct scsi_qla_host *ha = to_qla_host(cmd->device->host); 1544 struct scsi_qla_host *ha = to_qla_host(cmd->device->host);
1529 struct ddb_entry *ddb_entry = cmd->device->hostdata; 1545 struct ddb_entry *ddb_entry = cmd->device->hostdata;
1530 struct srb *sp;
1531 int ret = FAILED, stat; 1546 int ret = FAILED, stat;
1532 1547
1533 sp = (struct srb *) cmd->SCp.ptr; 1548 if (!ddb_entry)
1534 if (!sp || !ddb_entry)
1535 return ret; 1549 return ret;
1536 1550
1537 dev_info(&ha->pdev->dev, 1551 dev_info(&ha->pdev->dev,
@@ -1644,7 +1658,7 @@ static int qla4xxx_eh_host_reset(struct scsi_cmnd *cmd)
1644 ha = (struct scsi_qla_host *) cmd->device->host->hostdata; 1658 ha = (struct scsi_qla_host *) cmd->device->host->hostdata;
1645 1659
1646 dev_info(&ha->pdev->dev, 1660 dev_info(&ha->pdev->dev,
1647 "scsi(%ld:%d:%d:%d): ADAPTER RESET ISSUED.\n", ha->host_no, 1661 "scsi(%ld:%d:%d:%d): HOST RESET ISSUED.\n", ha->host_no,
1648 cmd->device->channel, cmd->device->id, cmd->device->lun); 1662 cmd->device->channel, cmd->device->id, cmd->device->lun);
1649 1663
1650 if (qla4xxx_wait_for_hba_online(ha) != QLA_SUCCESS) { 1664 if (qla4xxx_wait_for_hba_online(ha) != QLA_SUCCESS) {
diff --git a/drivers/scsi/qla4xxx/ql4_version.h b/drivers/scsi/qla4xxx/ql4_version.h
index ab984cb89cea..6980cb279c81 100644
--- a/drivers/scsi/qla4xxx/ql4_version.h
+++ b/drivers/scsi/qla4xxx/ql4_version.h
@@ -5,5 +5,5 @@
5 * See LICENSE.qla4xxx for copyright and licensing details. 5 * See LICENSE.qla4xxx for copyright and licensing details.
6 */ 6 */
7 7
8#define QLA4XXX_DRIVER_VERSION "5.01.00-k8" 8#define QLA4XXX_DRIVER_VERSION "5.01.00-k9"
9 9
diff --git a/drivers/scsi/scsi_transport_fc.c b/drivers/scsi/scsi_transport_fc.c
index 2eee9e6e4fe8..292c02f810d0 100644
--- a/drivers/scsi/scsi_transport_fc.c
+++ b/drivers/scsi/scsi_transport_fc.c
@@ -3670,13 +3670,14 @@ static void
3670fc_bsg_goose_queue(struct fc_rport *rport) 3670fc_bsg_goose_queue(struct fc_rport *rport)
3671{ 3671{
3672 int flagset; 3672 int flagset;
3673 unsigned long flags;
3673 3674
3674 if (!rport->rqst_q) 3675 if (!rport->rqst_q)
3675 return; 3676 return;
3676 3677
3677 get_device(&rport->dev); 3678 get_device(&rport->dev);
3678 3679
3679 spin_lock(rport->rqst_q->queue_lock); 3680 spin_lock_irqsave(rport->rqst_q->queue_lock, flags);
3680 flagset = test_bit(QUEUE_FLAG_REENTER, &rport->rqst_q->queue_flags) && 3681 flagset = test_bit(QUEUE_FLAG_REENTER, &rport->rqst_q->queue_flags) &&
3681 !test_bit(QUEUE_FLAG_REENTER, &rport->rqst_q->queue_flags); 3682 !test_bit(QUEUE_FLAG_REENTER, &rport->rqst_q->queue_flags);
3682 if (flagset) 3683 if (flagset)
@@ -3684,7 +3685,7 @@ fc_bsg_goose_queue(struct fc_rport *rport)
3684 __blk_run_queue(rport->rqst_q); 3685 __blk_run_queue(rport->rqst_q);
3685 if (flagset) 3686 if (flagset)
3686 queue_flag_clear(QUEUE_FLAG_REENTER, rport->rqst_q); 3687 queue_flag_clear(QUEUE_FLAG_REENTER, rport->rqst_q);
3687 spin_unlock(rport->rqst_q->queue_lock); 3688 spin_unlock_irqrestore(rport->rqst_q->queue_lock, flags);
3688 3689
3689 put_device(&rport->dev); 3690 put_device(&rport->dev);
3690} 3691}
diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c
index 5616cd780ff3..b7b9fec67a98 100644
--- a/drivers/scsi/sd.c
+++ b/drivers/scsi/sd.c
@@ -1840,6 +1840,18 @@ static void sd_read_block_characteristics(struct scsi_disk *sdkp)
1840 kfree(buffer); 1840 kfree(buffer);
1841} 1841}
1842 1842
1843static int sd_try_extended_inquiry(struct scsi_device *sdp)
1844{
1845 /*
1846 * Although VPD inquiries can go to SCSI-2 type devices,
1847 * some USB ones crash on receiving them, and the pages
1848 * we currently ask for are for SPC-3 and beyond
1849 */
1850 if (sdp->scsi_level > SCSI_SPC_2)
1851 return 1;
1852 return 0;
1853}
1854
1843/** 1855/**
1844 * sd_revalidate_disk - called the first time a new disk is seen, 1856 * sd_revalidate_disk - called the first time a new disk is seen,
1845 * performs disk spin up, read_capacity, etc. 1857 * performs disk spin up, read_capacity, etc.
@@ -1877,8 +1889,12 @@ static int sd_revalidate_disk(struct gendisk *disk)
1877 */ 1889 */
1878 if (sdkp->media_present) { 1890 if (sdkp->media_present) {
1879 sd_read_capacity(sdkp, buffer); 1891 sd_read_capacity(sdkp, buffer);
1880 sd_read_block_limits(sdkp); 1892
1881 sd_read_block_characteristics(sdkp); 1893 if (sd_try_extended_inquiry(sdp)) {
1894 sd_read_block_limits(sdkp);
1895 sd_read_block_characteristics(sdkp);
1896 }
1897
1882 sd_read_write_protect_flag(sdkp, buffer); 1898 sd_read_write_protect_flag(sdkp, buffer);
1883 sd_read_cache_type(sdkp, buffer); 1899 sd_read_cache_type(sdkp, buffer);
1884 sd_read_app_tag_own(sdkp, buffer); 1900 sd_read_app_tag_own(sdkp, buffer);
diff --git a/drivers/scsi/sg.c b/drivers/scsi/sg.c
index 8201387b4daa..9230402c45af 100644
--- a/drivers/scsi/sg.c
+++ b/drivers/scsi/sg.c
@@ -210,13 +210,11 @@ static void sg_put_dev(Sg_device *sdp);
210static int sg_allow_access(struct file *filp, unsigned char *cmd) 210static int sg_allow_access(struct file *filp, unsigned char *cmd)
211{ 211{
212 struct sg_fd *sfp = (struct sg_fd *)filp->private_data; 212 struct sg_fd *sfp = (struct sg_fd *)filp->private_data;
213 struct request_queue *q = sfp->parentdp->device->request_queue;
214 213
215 if (sfp->parentdp->device->type == TYPE_SCANNER) 214 if (sfp->parentdp->device->type == TYPE_SCANNER)
216 return 0; 215 return 0;
217 216
218 return blk_verify_command(&q->cmd_filter, 217 return blk_verify_command(cmd, filp->f_mode & FMODE_WRITE);
219 cmd, filp->f_mode & FMODE_WRITE);
220} 218}
221 219
222static int 220static int
@@ -621,7 +619,7 @@ sg_write(struct file *filp, const char __user *buf, size_t count, loff_t * ppos)
621 if (strcmp(current->comm, cmd) && printk_ratelimit()) { 619 if (strcmp(current->comm, cmd) && printk_ratelimit()) {
622 printk(KERN_WARNING 620 printk(KERN_WARNING
623 "sg_write: data in/out %d/%d bytes for SCSI command 0x%x--" 621 "sg_write: data in/out %d/%d bytes for SCSI command 0x%x--"
624 "guessing data in;\n" KERN_WARNING " " 622 "guessing data in;\n "
625 "program %s not setting count and/or reply_len properly\n", 623 "program %s not setting count and/or reply_len properly\n",
626 old_hdr.reply_len - (int)SZ_SG_HEADER, 624 old_hdr.reply_len - (int)SZ_SG_HEADER,
627 input_size, (unsigned int) cmnd[0], 625 input_size, (unsigned int) cmnd[0],
@@ -1658,6 +1656,10 @@ static int sg_start_req(Sg_request *srp, unsigned char *cmd)
1658 md->nr_entries = req_schp->k_use_sg; 1656 md->nr_entries = req_schp->k_use_sg;
1659 md->offset = 0; 1657 md->offset = 0;
1660 md->null_mapped = hp->dxferp ? 0 : 1; 1658 md->null_mapped = hp->dxferp ? 0 : 1;
1659 if (dxfer_dir == SG_DXFER_TO_FROM_DEV)
1660 md->from_user = 1;
1661 else
1662 md->from_user = 0;
1661 } 1663 }
1662 1664
1663 if (iov_count) { 1665 if (iov_count) {
diff --git a/drivers/scsi/sun3_NCR5380.c b/drivers/scsi/sun3_NCR5380.c
index bcaba86060ab..75da6e58ce55 100644
--- a/drivers/scsi/sun3_NCR5380.c
+++ b/drivers/scsi/sun3_NCR5380.c
@@ -2860,8 +2860,7 @@ static int NCR5380_abort(struct scsi_cmnd *cmd)
2860 */ 2860 */
2861 2861
2862 local_irq_restore(flags); 2862 local_irq_restore(flags);
2863 printk(KERN_INFO "scsi%d: warning : SCSI command probably completed successfully\n" 2863 printk(KERN_INFO "scsi%d: warning : SCSI command probably completed successfully before abortion\n", HOSTNO);
2864 KERN_INFO " before abortion\n", HOSTNO);
2865 2864
2866 return SCSI_ABORT_NOT_RUNNING; 2865 return SCSI_ABORT_NOT_RUNNING;
2867} 2866}
diff --git a/drivers/scsi/zalon.c b/drivers/scsi/zalon.c
index 97f3158fa7b5..27e84e4b1fa9 100644
--- a/drivers/scsi/zalon.c
+++ b/drivers/scsi/zalon.c
@@ -134,7 +134,7 @@ zalon_probe(struct parisc_device *dev)
134 134
135 host = ncr_attach(&zalon7xx_template, unit, &device); 135 host = ncr_attach(&zalon7xx_template, unit, &device);
136 if (!host) 136 if (!host)
137 goto fail; 137 return -ENODEV;
138 138
139 if (request_irq(dev->irq, ncr53c8xx_intr, IRQF_SHARED, "zalon", host)) { 139 if (request_irq(dev->irq, ncr53c8xx_intr, IRQF_SHARED, "zalon", host)) {
140 dev_printk(KERN_ERR, &dev->dev, "irq problem with %d, detaching\n ", 140 dev_printk(KERN_ERR, &dev->dev, "irq problem with %d, detaching\n ",
diff --git a/drivers/serial/8250_pci.c b/drivers/serial/8250_pci.c
index a07015d646dd..e7108e75653d 100644
--- a/drivers/serial/8250_pci.c
+++ b/drivers/serial/8250_pci.c
@@ -60,11 +60,12 @@ struct serial_private {
60 60
61static void moan_device(const char *str, struct pci_dev *dev) 61static void moan_device(const char *str, struct pci_dev *dev)
62{ 62{
63 printk(KERN_WARNING "%s: %s\n" 63 printk(KERN_WARNING
64 KERN_WARNING "Please send the output of lspci -vv, this\n" 64 "%s: %s\n"
65 KERN_WARNING "message (0x%04x,0x%04x,0x%04x,0x%04x), the\n" 65 "Please send the output of lspci -vv, this\n"
66 KERN_WARNING "manufacturer and name of serial board or\n" 66 "message (0x%04x,0x%04x,0x%04x,0x%04x), the\n"
67 KERN_WARNING "modem board to rmk+serial@arm.linux.org.uk.\n", 67 "manufacturer and name of serial board or\n"
68 "modem board to rmk+serial@arm.linux.org.uk.\n",
68 pci_name(dev), str, dev->vendor, dev->device, 69 pci_name(dev), str, dev->vendor, dev->device,
69 dev->subsystem_vendor, dev->subsystem_device); 70 dev->subsystem_vendor, dev->subsystem_device);
70} 71}
@@ -759,6 +760,8 @@ static int pci_netmos_init(struct pci_dev *dev)
759 /* subdevice 0x00PS means <P> parallel, <S> serial */ 760 /* subdevice 0x00PS means <P> parallel, <S> serial */
760 unsigned int num_serial = dev->subsystem_device & 0xf; 761 unsigned int num_serial = dev->subsystem_device & 0xf;
761 762
763 if (dev->device == PCI_DEVICE_ID_NETMOS_9901)
764 return 0;
762 if (dev->subsystem_vendor == PCI_VENDOR_ID_IBM && 765 if (dev->subsystem_vendor == PCI_VENDOR_ID_IBM &&
763 dev->subsystem_device == 0x0299) 766 dev->subsystem_device == 0x0299)
764 return 0; 767 return 0;
@@ -3557,6 +3560,10 @@ static struct pci_device_id serial_pci_tbl[] = {
3557 PCI_VENDOR_ID_IBM, 0x0299, 3560 PCI_VENDOR_ID_IBM, 0x0299,
3558 0, 0, pbn_b0_bt_2_115200 }, 3561 0, 0, pbn_b0_bt_2_115200 },
3559 3562
3563 { PCI_VENDOR_ID_NETMOS, PCI_DEVICE_ID_NETMOS_9901,
3564 0xA000, 0x1000,
3565 0, 0, pbn_b0_1_115200 },
3566
3560 /* 3567 /*
3561 * These entries match devices with class COMMUNICATION_SERIAL, 3568 * These entries match devices with class COMMUNICATION_SERIAL,
3562 * COMMUNICATION_MODEM or COMMUNICATION_MULTISERIAL 3569 * COMMUNICATION_MODEM or COMMUNICATION_MULTISERIAL
diff --git a/drivers/serial/atmel_serial.c b/drivers/serial/atmel_serial.c
index 338b15c0a548..607d43a31048 100644
--- a/drivers/serial/atmel_serial.c
+++ b/drivers/serial/atmel_serial.c
@@ -1551,6 +1551,7 @@ static int __devinit atmel_serial_probe(struct platform_device *pdev)
1551 if (ret) 1551 if (ret)
1552 goto err_add_port; 1552 goto err_add_port;
1553 1553
1554#ifdef CONFIG_SERIAL_ATMEL_CONSOLE
1554 if (atmel_is_console_port(&port->uart) 1555 if (atmel_is_console_port(&port->uart)
1555 && ATMEL_CONSOLE_DEVICE->flags & CON_ENABLED) { 1556 && ATMEL_CONSOLE_DEVICE->flags & CON_ENABLED) {
1556 /* 1557 /*
@@ -1559,6 +1560,7 @@ static int __devinit atmel_serial_probe(struct platform_device *pdev)
1559 */ 1560 */
1560 clk_disable(port->clk); 1561 clk_disable(port->clk);
1561 } 1562 }
1563#endif
1562 1564
1563 device_init_wakeup(&pdev->dev, 1); 1565 device_init_wakeup(&pdev->dev, 1);
1564 platform_set_drvdata(pdev, port); 1566 platform_set_drvdata(pdev, port);
diff --git a/drivers/serial/bfin_sport_uart.c b/drivers/serial/bfin_sport_uart.c
index 34b4ae0fe760..c108b1a0ce98 100644
--- a/drivers/serial/bfin_sport_uart.c
+++ b/drivers/serial/bfin_sport_uart.c
@@ -236,7 +236,6 @@ static int sport_startup(struct uart_port *port)
236 int retval; 236 int retval;
237 237
238 pr_debug("%s enter\n", __func__); 238 pr_debug("%s enter\n", __func__);
239 memset(buffer, 20, '\0');
240 snprintf(buffer, 20, "%s rx", up->name); 239 snprintf(buffer, 20, "%s rx", up->name);
241 retval = request_irq(up->rx_irq, sport_uart_rx_irq, IRQF_SAMPLE_RANDOM, buffer, up); 240 retval = request_irq(up->rx_irq, sport_uart_rx_irq, IRQF_SAMPLE_RANDOM, buffer, up);
242 if (retval) { 241 if (retval) {
diff --git a/drivers/serial/cpm_uart/cpm_uart_cpm2.c b/drivers/serial/cpm_uart/cpm_uart_cpm2.c
index 141c0a3333ad..a9802e76b5fa 100644
--- a/drivers/serial/cpm_uart/cpm_uart_cpm2.c
+++ b/drivers/serial/cpm_uart/cpm_uart_cpm2.c
@@ -132,7 +132,7 @@ int cpm_uart_allocbuf(struct uart_cpm_port *pinfo, unsigned int is_con)
132 memsz = L1_CACHE_ALIGN(pinfo->rx_nrfifos * pinfo->rx_fifosize) + 132 memsz = L1_CACHE_ALIGN(pinfo->rx_nrfifos * pinfo->rx_fifosize) +
133 L1_CACHE_ALIGN(pinfo->tx_nrfifos * pinfo->tx_fifosize); 133 L1_CACHE_ALIGN(pinfo->tx_nrfifos * pinfo->tx_fifosize);
134 if (is_con) { 134 if (is_con) {
135 mem_addr = alloc_bootmem(memsz); 135 mem_addr = kzalloc(memsz, GFP_NOWAIT);
136 dma_addr = virt_to_bus(mem_addr); 136 dma_addr = virt_to_bus(mem_addr);
137 } 137 }
138 else 138 else
diff --git a/drivers/serial/msm_serial.c b/drivers/serial/msm_serial.c
index 698048f64f5e..f7c24baa1416 100644
--- a/drivers/serial/msm_serial.c
+++ b/drivers/serial/msm_serial.c
@@ -730,7 +730,6 @@ static int __devexit msm_serial_remove(struct platform_device *pdev)
730} 730}
731 731
732static struct platform_driver msm_platform_driver = { 732static struct platform_driver msm_platform_driver = {
733 .probe = msm_serial_probe,
734 .remove = msm_serial_remove, 733 .remove = msm_serial_remove,
735 .driver = { 734 .driver = {
736 .name = "msm_serial", 735 .name = "msm_serial",
diff --git a/drivers/serial/s3c2400.c b/drivers/serial/s3c2400.c
index fb00ed5296e6..fed1a9a1ffb4 100644
--- a/drivers/serial/s3c2400.c
+++ b/drivers/serial/s3c2400.c
@@ -76,7 +76,7 @@ static int s3c2400_serial_probe(struct platform_device *dev)
76 return s3c24xx_serial_probe(dev, &s3c2400_uart_inf); 76 return s3c24xx_serial_probe(dev, &s3c2400_uart_inf);
77} 77}
78 78
79static struct platform_driver s3c2400_serial_drv = { 79static struct platform_driver s3c2400_serial_driver = {
80 .probe = s3c2400_serial_probe, 80 .probe = s3c2400_serial_probe,
81 .remove = __devexit_p(s3c24xx_serial_remove), 81 .remove = __devexit_p(s3c24xx_serial_remove),
82 .driver = { 82 .driver = {
@@ -85,16 +85,16 @@ static struct platform_driver s3c2400_serial_drv = {
85 }, 85 },
86}; 86};
87 87
88s3c24xx_console_init(&s3c2400_serial_drv, &s3c2400_uart_inf); 88s3c24xx_console_init(&s3c2400_serial_driver, &s3c2400_uart_inf);
89 89
90static inline int s3c2400_serial_init(void) 90static inline int s3c2400_serial_init(void)
91{ 91{
92 return s3c24xx_serial_init(&s3c2400_serial_drv, &s3c2400_uart_inf); 92 return s3c24xx_serial_init(&s3c2400_serial_driver, &s3c2400_uart_inf);
93} 93}
94 94
95static inline void s3c2400_serial_exit(void) 95static inline void s3c2400_serial_exit(void)
96{ 96{
97 platform_driver_unregister(&s3c2400_serial_drv); 97 platform_driver_unregister(&s3c2400_serial_driver);
98} 98}
99 99
100module_init(s3c2400_serial_init); 100module_init(s3c2400_serial_init);
diff --git a/drivers/serial/s3c2410.c b/drivers/serial/s3c2410.c
index b5d7cbcba2ae..c99f0821cae3 100644
--- a/drivers/serial/s3c2410.c
+++ b/drivers/serial/s3c2410.c
@@ -88,7 +88,7 @@ static int s3c2410_serial_probe(struct platform_device *dev)
88 return s3c24xx_serial_probe(dev, &s3c2410_uart_inf); 88 return s3c24xx_serial_probe(dev, &s3c2410_uart_inf);
89} 89}
90 90
91static struct platform_driver s3c2410_serial_drv = { 91static struct platform_driver s3c2410_serial_driver = {
92 .probe = s3c2410_serial_probe, 92 .probe = s3c2410_serial_probe,
93 .remove = __devexit_p(s3c24xx_serial_remove), 93 .remove = __devexit_p(s3c24xx_serial_remove),
94 .driver = { 94 .driver = {
@@ -97,16 +97,16 @@ static struct platform_driver s3c2410_serial_drv = {
97 }, 97 },
98}; 98};
99 99
100s3c24xx_console_init(&s3c2410_serial_drv, &s3c2410_uart_inf); 100s3c24xx_console_init(&s3c2410_serial_driver, &s3c2410_uart_inf);
101 101
102static int __init s3c2410_serial_init(void) 102static int __init s3c2410_serial_init(void)
103{ 103{
104 return s3c24xx_serial_init(&s3c2410_serial_drv, &s3c2410_uart_inf); 104 return s3c24xx_serial_init(&s3c2410_serial_driver, &s3c2410_uart_inf);
105} 105}
106 106
107static void __exit s3c2410_serial_exit(void) 107static void __exit s3c2410_serial_exit(void)
108{ 108{
109 platform_driver_unregister(&s3c2410_serial_drv); 109 platform_driver_unregister(&s3c2410_serial_driver);
110} 110}
111 111
112module_init(s3c2410_serial_init); 112module_init(s3c2410_serial_init);
diff --git a/drivers/serial/s3c2412.c b/drivers/serial/s3c2412.c
index 11dcb90bdfef..6e057d8809d3 100644
--- a/drivers/serial/s3c2412.c
+++ b/drivers/serial/s3c2412.c
@@ -121,7 +121,7 @@ static int s3c2412_serial_probe(struct platform_device *dev)
121 return s3c24xx_serial_probe(dev, &s3c2412_uart_inf); 121 return s3c24xx_serial_probe(dev, &s3c2412_uart_inf);
122} 122}
123 123
124static struct platform_driver s3c2412_serial_drv = { 124static struct platform_driver s3c2412_serial_driver = {
125 .probe = s3c2412_serial_probe, 125 .probe = s3c2412_serial_probe,
126 .remove = __devexit_p(s3c24xx_serial_remove), 126 .remove = __devexit_p(s3c24xx_serial_remove),
127 .driver = { 127 .driver = {
@@ -130,16 +130,16 @@ static struct platform_driver s3c2412_serial_drv = {
130 }, 130 },
131}; 131};
132 132
133s3c24xx_console_init(&s3c2412_serial_drv, &s3c2412_uart_inf); 133s3c24xx_console_init(&s3c2412_serial_driver, &s3c2412_uart_inf);
134 134
135static inline int s3c2412_serial_init(void) 135static inline int s3c2412_serial_init(void)
136{ 136{
137 return s3c24xx_serial_init(&s3c2412_serial_drv, &s3c2412_uart_inf); 137 return s3c24xx_serial_init(&s3c2412_serial_driver, &s3c2412_uart_inf);
138} 138}
139 139
140static inline void s3c2412_serial_exit(void) 140static inline void s3c2412_serial_exit(void)
141{ 141{
142 platform_driver_unregister(&s3c2412_serial_drv); 142 platform_driver_unregister(&s3c2412_serial_driver);
143} 143}
144 144
145module_init(s3c2412_serial_init); 145module_init(s3c2412_serial_init);
diff --git a/drivers/serial/s3c2440.c b/drivers/serial/s3c2440.c
index 06c5b0cc47a3..69ff5d340f04 100644
--- a/drivers/serial/s3c2440.c
+++ b/drivers/serial/s3c2440.c
@@ -151,7 +151,7 @@ static int s3c2440_serial_probe(struct platform_device *dev)
151 return s3c24xx_serial_probe(dev, &s3c2440_uart_inf); 151 return s3c24xx_serial_probe(dev, &s3c2440_uart_inf);
152} 152}
153 153
154static struct platform_driver s3c2440_serial_drv = { 154static struct platform_driver s3c2440_serial_driver = {
155 .probe = s3c2440_serial_probe, 155 .probe = s3c2440_serial_probe,
156 .remove = __devexit_p(s3c24xx_serial_remove), 156 .remove = __devexit_p(s3c24xx_serial_remove),
157 .driver = { 157 .driver = {
@@ -160,16 +160,16 @@ static struct platform_driver s3c2440_serial_drv = {
160 }, 160 },
161}; 161};
162 162
163s3c24xx_console_init(&s3c2440_serial_drv, &s3c2440_uart_inf); 163s3c24xx_console_init(&s3c2440_serial_driver, &s3c2440_uart_inf);
164 164
165static int __init s3c2440_serial_init(void) 165static int __init s3c2440_serial_init(void)
166{ 166{
167 return s3c24xx_serial_init(&s3c2440_serial_drv, &s3c2440_uart_inf); 167 return s3c24xx_serial_init(&s3c2440_serial_driver, &s3c2440_uart_inf);
168} 168}
169 169
170static void __exit s3c2440_serial_exit(void) 170static void __exit s3c2440_serial_exit(void)
171{ 171{
172 platform_driver_unregister(&s3c2440_serial_drv); 172 platform_driver_unregister(&s3c2440_serial_driver);
173} 173}
174 174
175module_init(s3c2440_serial_init); 175module_init(s3c2440_serial_init);
diff --git a/drivers/serial/s3c24a0.c b/drivers/serial/s3c24a0.c
index 786a067d62ac..26c49e18bdd1 100644
--- a/drivers/serial/s3c24a0.c
+++ b/drivers/serial/s3c24a0.c
@@ -92,7 +92,7 @@ static int s3c24a0_serial_probe(struct platform_device *dev)
92 return s3c24xx_serial_probe(dev, &s3c24a0_uart_inf); 92 return s3c24xx_serial_probe(dev, &s3c24a0_uart_inf);
93} 93}
94 94
95static struct platform_driver s3c24a0_serial_drv = { 95static struct platform_driver s3c24a0_serial_driver = {
96 .probe = s3c24a0_serial_probe, 96 .probe = s3c24a0_serial_probe,
97 .remove = __devexit_p(s3c24xx_serial_remove), 97 .remove = __devexit_p(s3c24xx_serial_remove),
98 .driver = { 98 .driver = {
@@ -101,16 +101,16 @@ static struct platform_driver s3c24a0_serial_drv = {
101 }, 101 },
102}; 102};
103 103
104s3c24xx_console_init(&s3c24a0_serial_drv, &s3c24a0_uart_inf); 104s3c24xx_console_init(&s3c24a0_serial_driver, &s3c24a0_uart_inf);
105 105
106static int __init s3c24a0_serial_init(void) 106static int __init s3c24a0_serial_init(void)
107{ 107{
108 return s3c24xx_serial_init(&s3c24a0_serial_drv, &s3c24a0_uart_inf); 108 return s3c24xx_serial_init(&s3c24a0_serial_driver, &s3c24a0_uart_inf);
109} 109}
110 110
111static void __exit s3c24a0_serial_exit(void) 111static void __exit s3c24a0_serial_exit(void)
112{ 112{
113 platform_driver_unregister(&s3c24a0_serial_drv); 113 platform_driver_unregister(&s3c24a0_serial_driver);
114} 114}
115 115
116module_init(s3c24a0_serial_init); 116module_init(s3c24a0_serial_init);
diff --git a/drivers/serial/s3c6400.c b/drivers/serial/s3c6400.c
index 48f1a3781f0d..4be92ab50058 100644
--- a/drivers/serial/s3c6400.c
+++ b/drivers/serial/s3c6400.c
@@ -122,7 +122,7 @@ static int s3c6400_serial_probe(struct platform_device *dev)
122 return s3c24xx_serial_probe(dev, &s3c6400_uart_inf); 122 return s3c24xx_serial_probe(dev, &s3c6400_uart_inf);
123} 123}
124 124
125static struct platform_driver s3c6400_serial_drv = { 125static struct platform_driver s3c6400_serial_driver = {
126 .probe = s3c6400_serial_probe, 126 .probe = s3c6400_serial_probe,
127 .remove = __devexit_p(s3c24xx_serial_remove), 127 .remove = __devexit_p(s3c24xx_serial_remove),
128 .driver = { 128 .driver = {
@@ -131,16 +131,16 @@ static struct platform_driver s3c6400_serial_drv = {
131 }, 131 },
132}; 132};
133 133
134s3c24xx_console_init(&s3c6400_serial_drv, &s3c6400_uart_inf); 134s3c24xx_console_init(&s3c6400_serial_driver, &s3c6400_uart_inf);
135 135
136static int __init s3c6400_serial_init(void) 136static int __init s3c6400_serial_init(void)
137{ 137{
138 return s3c24xx_serial_init(&s3c6400_serial_drv, &s3c6400_uart_inf); 138 return s3c24xx_serial_init(&s3c6400_serial_driver, &s3c6400_uart_inf);
139} 139}
140 140
141static void __exit s3c6400_serial_exit(void) 141static void __exit s3c6400_serial_exit(void)
142{ 142{
143 platform_driver_unregister(&s3c6400_serial_drv); 143 platform_driver_unregister(&s3c6400_serial_driver);
144} 144}
145 145
146module_init(s3c6400_serial_init); 146module_init(s3c6400_serial_init);
diff --git a/drivers/serial/serial_ks8695.c b/drivers/serial/serial_ks8695.c
index 998e89dc5aaf..e0665630e4da 100644
--- a/drivers/serial/serial_ks8695.c
+++ b/drivers/serial/serial_ks8695.c
@@ -549,7 +549,7 @@ static struct uart_port ks8695uart_ports[SERIAL_KS8695_NR] = {
549 .mapbase = KS8695_UART_VA, 549 .mapbase = KS8695_UART_VA,
550 .iotype = SERIAL_IO_MEM, 550 .iotype = SERIAL_IO_MEM,
551 .irq = KS8695_IRQ_UART_TX, 551 .irq = KS8695_IRQ_UART_TX,
552 .uartclk = CLOCK_TICK_RATE * 16, 552 .uartclk = KS8695_CLOCK_RATE * 16,
553 .fifosize = 16, 553 .fifosize = 16,
554 .ops = &ks8695uart_pops, 554 .ops = &ks8695uart_pops,
555 .flags = ASYNC_BOOT_AUTOCONF, 555 .flags = ASYNC_BOOT_AUTOCONF,
diff --git a/drivers/serial/sh-sci.c b/drivers/serial/sh-sci.c
index 66f52674ca0c..8e2feb563347 100644
--- a/drivers/serial/sh-sci.c
+++ b/drivers/serial/sh-sci.c
@@ -707,24 +707,25 @@ static irqreturn_t sci_br_interrupt(int irq, void *ptr)
707 707
708static irqreturn_t sci_mpxed_interrupt(int irq, void *ptr) 708static irqreturn_t sci_mpxed_interrupt(int irq, void *ptr)
709{ 709{
710 unsigned short ssr_status, scr_status; 710 unsigned short ssr_status, scr_status, err_enabled;
711 struct uart_port *port = ptr; 711 struct uart_port *port = ptr;
712 irqreturn_t ret = IRQ_NONE; 712 irqreturn_t ret = IRQ_NONE;
713 713
714 ssr_status = sci_in(port, SCxSR); 714 ssr_status = sci_in(port, SCxSR);
715 scr_status = sci_in(port, SCSCR); 715 scr_status = sci_in(port, SCSCR);
716 err_enabled = scr_status & (SCI_CTRL_FLAGS_REIE | SCI_CTRL_FLAGS_RIE);
716 717
717 /* Tx Interrupt */ 718 /* Tx Interrupt */
718 if ((ssr_status & 0x0020) && (scr_status & SCI_CTRL_FLAGS_TIE)) 719 if ((ssr_status & SCxSR_TDxE(port)) && (scr_status & SCI_CTRL_FLAGS_TIE))
719 ret = sci_tx_interrupt(irq, ptr); 720 ret = sci_tx_interrupt(irq, ptr);
720 /* Rx Interrupt */ 721 /* Rx Interrupt */
721 if ((ssr_status & 0x0002) && (scr_status & SCI_CTRL_FLAGS_RIE)) 722 if ((ssr_status & SCxSR_RDxF(port)) && (scr_status & SCI_CTRL_FLAGS_RIE))
722 ret = sci_rx_interrupt(irq, ptr); 723 ret = sci_rx_interrupt(irq, ptr);
723 /* Error Interrupt */ 724 /* Error Interrupt */
724 if ((ssr_status & 0x0080) && (scr_status & SCI_CTRL_FLAGS_REIE)) 725 if ((ssr_status & SCxSR_ERRORS(port)) && err_enabled)
725 ret = sci_er_interrupt(irq, ptr); 726 ret = sci_er_interrupt(irq, ptr);
726 /* Break Interrupt */ 727 /* Break Interrupt */
727 if ((ssr_status & 0x0010) && (scr_status & SCI_CTRL_FLAGS_REIE)) 728 if ((ssr_status & SCxSR_BRK(port)) && err_enabled)
728 ret = sci_br_interrupt(irq, ptr); 729 ret = sci_br_interrupt(irq, ptr);
729 730
730 return ret; 731 return ret;
diff --git a/drivers/serial/vr41xx_siu.c b/drivers/serial/vr41xx_siu.c
index 0573f3b5175e..dac550e57c29 100644
--- a/drivers/serial/vr41xx_siu.c
+++ b/drivers/serial/vr41xx_siu.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * Driver for NEC VR4100 series Serial Interface Unit. 2 * Driver for NEC VR4100 series Serial Interface Unit.
3 * 3 *
4 * Copyright (C) 2004-2008 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> 4 * Copyright (C) 2004-2008 Yoichi Yuasa <yuasa@linux-mips.org>
5 * 5 *
6 * Based on drivers/serial/8250.c, by Russell King. 6 * Based on drivers/serial/8250.c, by Russell King.
7 * 7 *
diff --git a/drivers/spi/omap2_mcspi.c b/drivers/spi/omap2_mcspi.c
index eee4b6e0af2c..9b80ad36dbba 100644
--- a/drivers/spi/omap2_mcspi.c
+++ b/drivers/spi/omap2_mcspi.c
@@ -59,6 +59,8 @@
59 59
60/* per-register bitmasks: */ 60/* per-register bitmasks: */
61 61
62#define OMAP2_MCSPI_SYSCONFIG_SMARTIDLE (2 << 3)
63#define OMAP2_MCSPI_SYSCONFIG_ENAWAKEUP (1 << 2)
62#define OMAP2_MCSPI_SYSCONFIG_AUTOIDLE (1 << 0) 64#define OMAP2_MCSPI_SYSCONFIG_AUTOIDLE (1 << 0)
63#define OMAP2_MCSPI_SYSCONFIG_SOFTRESET (1 << 1) 65#define OMAP2_MCSPI_SYSCONFIG_SOFTRESET (1 << 1)
64 66
@@ -90,6 +92,7 @@
90 92
91#define OMAP2_MCSPI_CHCTRL_EN (1 << 0) 93#define OMAP2_MCSPI_CHCTRL_EN (1 << 0)
92 94
95#define OMAP2_MCSPI_WAKEUPENABLE_WKEN (1 << 0)
93 96
94/* We have 2 DMA channels per CS, one for RX and one for TX */ 97/* We have 2 DMA channels per CS, one for RX and one for TX */
95struct omap2_mcspi_dma { 98struct omap2_mcspi_dma {
@@ -269,7 +272,7 @@ omap2_mcspi_txrx_dma(struct spi_device *spi, struct spi_transfer *xfer)
269 272
270 if (rx != NULL) { 273 if (rx != NULL) {
271 omap_set_dma_transfer_params(mcspi_dma->dma_rx_channel, 274 omap_set_dma_transfer_params(mcspi_dma->dma_rx_channel,
272 data_type, element_count, 1, 275 data_type, element_count - 1, 1,
273 OMAP_DMA_SYNC_ELEMENT, 276 OMAP_DMA_SYNC_ELEMENT,
274 mcspi_dma->dma_rx_sync_dev, 1); 277 mcspi_dma->dma_rx_sync_dev, 1);
275 278
@@ -300,6 +303,25 @@ omap2_mcspi_txrx_dma(struct spi_device *spi, struct spi_transfer *xfer)
300 if (rx != NULL) { 303 if (rx != NULL) {
301 wait_for_completion(&mcspi_dma->dma_rx_completion); 304 wait_for_completion(&mcspi_dma->dma_rx_completion);
302 dma_unmap_single(NULL, xfer->rx_dma, count, DMA_FROM_DEVICE); 305 dma_unmap_single(NULL, xfer->rx_dma, count, DMA_FROM_DEVICE);
306 omap2_mcspi_set_enable(spi, 0);
307 if (likely(mcspi_read_cs_reg(spi, OMAP2_MCSPI_CHSTAT0)
308 & OMAP2_MCSPI_CHSTAT_RXS)) {
309 u32 w;
310
311 w = mcspi_read_cs_reg(spi, OMAP2_MCSPI_RX0);
312 if (word_len <= 8)
313 ((u8 *)xfer->rx_buf)[element_count - 1] = w;
314 else if (word_len <= 16)
315 ((u16 *)xfer->rx_buf)[element_count - 1] = w;
316 else /* word_len <= 32 */
317 ((u32 *)xfer->rx_buf)[element_count - 1] = w;
318 } else {
319 dev_err(&spi->dev, "DMA RX last word empty");
320 count -= (word_len <= 8) ? 1 :
321 (word_len <= 16) ? 2 :
322 /* word_len <= 32 */ 4;
323 }
324 omap2_mcspi_set_enable(spi, 1);
303 } 325 }
304 return count; 326 return count;
305} 327}
@@ -873,8 +895,12 @@ static int __init omap2_mcspi_reset(struct omap2_mcspi *mcspi)
873 } while (!(tmp & OMAP2_MCSPI_SYSSTATUS_RESETDONE)); 895 } while (!(tmp & OMAP2_MCSPI_SYSSTATUS_RESETDONE));
874 896
875 mcspi_write_reg(master, OMAP2_MCSPI_SYSCONFIG, 897 mcspi_write_reg(master, OMAP2_MCSPI_SYSCONFIG,
876 /* (3 << 8) | (2 << 3) | */ 898 OMAP2_MCSPI_SYSCONFIG_AUTOIDLE |
877 OMAP2_MCSPI_SYSCONFIG_AUTOIDLE); 899 OMAP2_MCSPI_SYSCONFIG_ENAWAKEUP |
900 OMAP2_MCSPI_SYSCONFIG_SMARTIDLE);
901
902 mcspi_write_reg(master, OMAP2_MCSPI_WAKEUPENABLE,
903 OMAP2_MCSPI_WAKEUPENABLE_WKEN);
878 904
879 omap2_mcspi_set_master_mode(master); 905 omap2_mcspi_set_master_mode(master);
880 906
diff --git a/drivers/spi/omap_uwire.c b/drivers/spi/omap_uwire.c
index aa90ddb37066..8980a5640bd9 100644
--- a/drivers/spi/omap_uwire.c
+++ b/drivers/spi/omap_uwire.c
@@ -514,6 +514,8 @@ static int __init uwire_probe(struct platform_device *pdev)
514 /* the spi->mode bits understood by this driver: */ 514 /* the spi->mode bits understood by this driver: */
515 master->mode_bits = SPI_CPOL | SPI_CPHA | SPI_CS_HIGH; 515 master->mode_bits = SPI_CPOL | SPI_CPHA | SPI_CS_HIGH;
516 516
517 master->flags = SPI_MASTER_HALF_DUPLEX;
518
517 master->bus_num = 2; /* "official" */ 519 master->bus_num = 2; /* "official" */
518 master->num_chipselect = 4; 520 master->num_chipselect = 4;
519 master->setup = uwire_setup; 521 master->setup = uwire_setup;
diff --git a/drivers/spi/spi_bitbang.c b/drivers/spi/spi_bitbang.c
index 2a5abc08e857..f1db395dd889 100644
--- a/drivers/spi/spi_bitbang.c
+++ b/drivers/spi/spi_bitbang.c
@@ -258,6 +258,11 @@ static void bitbang_work(struct work_struct *work)
258 struct spi_bitbang *bitbang = 258 struct spi_bitbang *bitbang =
259 container_of(work, struct spi_bitbang, work); 259 container_of(work, struct spi_bitbang, work);
260 unsigned long flags; 260 unsigned long flags;
261 int do_setup = -1;
262 int (*setup_transfer)(struct spi_device *,
263 struct spi_transfer *);
264
265 setup_transfer = bitbang->setup_transfer;
261 266
262 spin_lock_irqsave(&bitbang->lock, flags); 267 spin_lock_irqsave(&bitbang->lock, flags);
263 bitbang->busy = 1; 268 bitbang->busy = 1;
@@ -269,8 +274,6 @@ static void bitbang_work(struct work_struct *work)
269 unsigned tmp; 274 unsigned tmp;
270 unsigned cs_change; 275 unsigned cs_change;
271 int status; 276 int status;
272 int (*setup_transfer)(struct spi_device *,
273 struct spi_transfer *);
274 277
275 m = container_of(bitbang->queue.next, struct spi_message, 278 m = container_of(bitbang->queue.next, struct spi_message,
276 queue); 279 queue);
@@ -287,19 +290,19 @@ static void bitbang_work(struct work_struct *work)
287 tmp = 0; 290 tmp = 0;
288 cs_change = 1; 291 cs_change = 1;
289 status = 0; 292 status = 0;
290 setup_transfer = NULL;
291 293
292 list_for_each_entry (t, &m->transfers, transfer_list) { 294 list_for_each_entry (t, &m->transfers, transfer_list) {
293 295
294 /* override or restore speed and wordsize */ 296 /* override speed or wordsize? */
295 if (t->speed_hz || t->bits_per_word) { 297 if (t->speed_hz || t->bits_per_word)
296 setup_transfer = bitbang->setup_transfer; 298 do_setup = 1;
299
300 /* init (-1) or override (1) transfer params */
301 if (do_setup != 0) {
297 if (!setup_transfer) { 302 if (!setup_transfer) {
298 status = -ENOPROTOOPT; 303 status = -ENOPROTOOPT;
299 break; 304 break;
300 } 305 }
301 }
302 if (setup_transfer) {
303 status = setup_transfer(spi, t); 306 status = setup_transfer(spi, t);
304 if (status < 0) 307 if (status < 0)
305 break; 308 break;
@@ -363,9 +366,10 @@ static void bitbang_work(struct work_struct *work)
363 m->status = status; 366 m->status = status;
364 m->complete(m->context); 367 m->complete(m->context);
365 368
366 /* restore speed and wordsize */ 369 /* restore speed and wordsize if it was overridden */
367 if (setup_transfer) 370 if (do_setup == 1)
368 setup_transfer(spi, NULL); 371 setup_transfer(spi, NULL);
372 do_setup = 0;
369 373
370 /* normally deactivate chipselect ... unless no error and 374 /* normally deactivate chipselect ... unless no error and
371 * cs_change has hinted that the next message will probably 375 * cs_change has hinted that the next message will probably
diff --git a/drivers/spi/spidev.c b/drivers/spi/spidev.c
index 5d869c4d3eb2..606e7a40a8da 100644
--- a/drivers/spi/spidev.c
+++ b/drivers/spi/spidev.c
@@ -58,15 +58,20 @@ static unsigned long minors[N_SPI_MINORS / BITS_PER_LONG];
58 58
59 59
60/* Bit masks for spi_device.mode management. Note that incorrect 60/* Bit masks for spi_device.mode management. Note that incorrect
61 * settings for CS_HIGH and 3WIRE can cause *lots* of trouble for other 61 * settings for some settings can cause *lots* of trouble for other
62 * devices on a shared bus: CS_HIGH, because this device will be 62 * devices on a shared bus:
63 * active when it shouldn't be; 3WIRE, because when active it won't
64 * behave as it should.
65 * 63 *
66 * REVISIT should changing those two modes be privileged? 64 * - CS_HIGH ... this device will be active when it shouldn't be
65 * - 3WIRE ... when active, it won't behave as it should
66 * - NO_CS ... there will be no explicit message boundaries; this
67 * is completely incompatible with the shared bus model
68 * - READY ... transfers may proceed when they shouldn't.
69 *
70 * REVISIT should changing those flags be privileged?
67 */ 71 */
68#define SPI_MODE_MASK (SPI_CPHA | SPI_CPOL | SPI_CS_HIGH \ 72#define SPI_MODE_MASK (SPI_CPHA | SPI_CPOL | SPI_CS_HIGH \
69 | SPI_LSB_FIRST | SPI_3WIRE | SPI_LOOP) 73 | SPI_LSB_FIRST | SPI_3WIRE | SPI_LOOP \
74 | SPI_NO_CS | SPI_READY)
70 75
71struct spidev_data { 76struct spidev_data {
72 dev_t devt; 77 dev_t devt;
diff --git a/drivers/ssb/driver_mipscore.c b/drivers/ssb/driver_mipscore.c
index 3fd3e3b412b6..3c6feed46f6e 100644
--- a/drivers/ssb/driver_mipscore.c
+++ b/drivers/ssb/driver_mipscore.c
@@ -49,29 +49,54 @@ static const u32 ipsflag_irq_shift[] = {
49 49
50static inline u32 ssb_irqflag(struct ssb_device *dev) 50static inline u32 ssb_irqflag(struct ssb_device *dev)
51{ 51{
52 return ssb_read32(dev, SSB_TPSFLAG) & SSB_TPSFLAG_BPFLAG; 52 u32 tpsflag = ssb_read32(dev, SSB_TPSFLAG);
53 if (tpsflag)
54 return ssb_read32(dev, SSB_TPSFLAG) & SSB_TPSFLAG_BPFLAG;
55 else
56 /* not irq supported */
57 return 0x3f;
58}
59
60static struct ssb_device *find_device(struct ssb_device *rdev, int irqflag)
61{
62 struct ssb_bus *bus = rdev->bus;
63 int i;
64 for (i = 0; i < bus->nr_devices; i++) {
65 struct ssb_device *dev;
66 dev = &(bus->devices[i]);
67 if (ssb_irqflag(dev) == irqflag)
68 return dev;
69 }
70 return NULL;
53} 71}
54 72
55/* Get the MIPS IRQ assignment for a specified device. 73/* Get the MIPS IRQ assignment for a specified device.
56 * If unassigned, 0 is returned. 74 * If unassigned, 0 is returned.
75 * If disabled, 5 is returned.
76 * If not supported, 6 is returned.
57 */ 77 */
58unsigned int ssb_mips_irq(struct ssb_device *dev) 78unsigned int ssb_mips_irq(struct ssb_device *dev)
59{ 79{
60 struct ssb_bus *bus = dev->bus; 80 struct ssb_bus *bus = dev->bus;
81 struct ssb_device *mdev = bus->mipscore.dev;
61 u32 irqflag; 82 u32 irqflag;
62 u32 ipsflag; 83 u32 ipsflag;
63 u32 tmp; 84 u32 tmp;
64 unsigned int irq; 85 unsigned int irq;
65 86
66 irqflag = ssb_irqflag(dev); 87 irqflag = ssb_irqflag(dev);
88 if (irqflag == 0x3f)
89 return 6;
67 ipsflag = ssb_read32(bus->mipscore.dev, SSB_IPSFLAG); 90 ipsflag = ssb_read32(bus->mipscore.dev, SSB_IPSFLAG);
68 for (irq = 1; irq <= 4; irq++) { 91 for (irq = 1; irq <= 4; irq++) {
69 tmp = ((ipsflag & ipsflag_irq_mask[irq]) >> ipsflag_irq_shift[irq]); 92 tmp = ((ipsflag & ipsflag_irq_mask[irq]) >> ipsflag_irq_shift[irq]);
70 if (tmp == irqflag) 93 if (tmp == irqflag)
71 break; 94 break;
72 } 95 }
73 if (irq == 5) 96 if (irq == 5) {
74 irq = 0; 97 if ((1 << irqflag) & ssb_read32(mdev, SSB_INTVEC))
98 irq = 0;
99 }
75 100
76 return irq; 101 return irq;
77} 102}
@@ -97,25 +122,56 @@ static void set_irq(struct ssb_device *dev, unsigned int irq)
97 struct ssb_device *mdev = bus->mipscore.dev; 122 struct ssb_device *mdev = bus->mipscore.dev;
98 u32 irqflag = ssb_irqflag(dev); 123 u32 irqflag = ssb_irqflag(dev);
99 124
125 BUG_ON(oldirq == 6);
126
100 dev->irq = irq + 2; 127 dev->irq = irq + 2;
101 128
102 ssb_dprintk(KERN_INFO PFX
103 "set_irq: core 0x%04x, irq %d => %d\n",
104 dev->id.coreid, oldirq, irq);
105 /* clear the old irq */ 129 /* clear the old irq */
106 if (oldirq == 0) 130 if (oldirq == 0)
107 ssb_write32(mdev, SSB_INTVEC, (~(1 << irqflag) & ssb_read32(mdev, SSB_INTVEC))); 131 ssb_write32(mdev, SSB_INTVEC, (~(1 << irqflag) & ssb_read32(mdev, SSB_INTVEC)));
108 else 132 else if (oldirq != 5)
109 clear_irq(bus, oldirq); 133 clear_irq(bus, oldirq);
110 134
111 /* assign the new one */ 135 /* assign the new one */
112 if (irq == 0) { 136 if (irq == 0) {
113 ssb_write32(mdev, SSB_INTVEC, ((1 << irqflag) | ssb_read32(mdev, SSB_INTVEC))); 137 ssb_write32(mdev, SSB_INTVEC, ((1 << irqflag) | ssb_read32(mdev, SSB_INTVEC)));
114 } else { 138 } else {
139 u32 ipsflag = ssb_read32(mdev, SSB_IPSFLAG);
140 if ((ipsflag & ipsflag_irq_mask[irq]) != ipsflag_irq_mask[irq]) {
141 u32 oldipsflag = (ipsflag & ipsflag_irq_mask[irq]) >> ipsflag_irq_shift[irq];
142 struct ssb_device *olddev = find_device(dev, oldipsflag);
143 if (olddev)
144 set_irq(olddev, 0);
145 }
115 irqflag <<= ipsflag_irq_shift[irq]; 146 irqflag <<= ipsflag_irq_shift[irq];
116 irqflag |= (ssb_read32(mdev, SSB_IPSFLAG) & ~ipsflag_irq_mask[irq]); 147 irqflag |= (ipsflag & ~ipsflag_irq_mask[irq]);
117 ssb_write32(mdev, SSB_IPSFLAG, irqflag); 148 ssb_write32(mdev, SSB_IPSFLAG, irqflag);
118 } 149 }
150 ssb_dprintk(KERN_INFO PFX
151 "set_irq: core 0x%04x, irq %d => %d\n",
152 dev->id.coreid, oldirq+2, irq+2);
153}
154
155static void print_irq(struct ssb_device *dev, unsigned int irq)
156{
157 int i;
158 static const char *irq_name[] = {"2(S)", "3", "4", "5", "6", "D", "I"};
159 ssb_dprintk(KERN_INFO PFX
160 "core 0x%04x, irq :", dev->id.coreid);
161 for (i = 0; i <= 6; i++) {
162 ssb_dprintk(" %s%s", irq_name[i], i==irq?"*":" ");
163 }
164 ssb_dprintk("\n");
165}
166
167static void dump_irq(struct ssb_bus *bus)
168{
169 int i;
170 for (i = 0; i < bus->nr_devices; i++) {
171 struct ssb_device *dev;
172 dev = &(bus->devices[i]);
173 print_irq(dev, ssb_mips_irq(dev));
174 }
119} 175}
120 176
121static void ssb_mips_serial_init(struct ssb_mipscore *mcore) 177static void ssb_mips_serial_init(struct ssb_mipscore *mcore)
@@ -197,16 +253,23 @@ void ssb_mipscore_init(struct ssb_mipscore *mcore)
197 253
198 /* Assign IRQs to all cores on the bus, start with irq line 2, because serial usually takes 1 */ 254 /* Assign IRQs to all cores on the bus, start with irq line 2, because serial usually takes 1 */
199 for (irq = 2, i = 0; i < bus->nr_devices; i++) { 255 for (irq = 2, i = 0; i < bus->nr_devices; i++) {
256 int mips_irq;
200 dev = &(bus->devices[i]); 257 dev = &(bus->devices[i]);
201 dev->irq = ssb_mips_irq(dev) + 2; 258 mips_irq = ssb_mips_irq(dev);
259 if (mips_irq > 4)
260 dev->irq = 0;
261 else
262 dev->irq = mips_irq + 2;
263 if (dev->irq > 5)
264 continue;
202 switch (dev->id.coreid) { 265 switch (dev->id.coreid) {
203 case SSB_DEV_USB11_HOST: 266 case SSB_DEV_USB11_HOST:
204 /* shouldn't need a separate irq line for non-4710, most of them have a proper 267 /* shouldn't need a separate irq line for non-4710, most of them have a proper
205 * external usb controller on the pci */ 268 * external usb controller on the pci */
206 if ((bus->chip_id == 0x4710) && (irq <= 4)) { 269 if ((bus->chip_id == 0x4710) && (irq <= 4)) {
207 set_irq(dev, irq++); 270 set_irq(dev, irq++);
208 break;
209 } 271 }
272 break;
210 /* fallthrough */ 273 /* fallthrough */
211 case SSB_DEV_PCI: 274 case SSB_DEV_PCI:
212 case SSB_DEV_ETHERNET: 275 case SSB_DEV_ETHERNET:
@@ -220,6 +283,8 @@ void ssb_mipscore_init(struct ssb_mipscore *mcore)
220 } 283 }
221 } 284 }
222 } 285 }
286 ssb_dprintk(KERN_INFO PFX "after irq reconfiguration\n");
287 dump_irq(bus);
223 288
224 ssb_mips_serial_init(mcore); 289 ssb_mips_serial_init(mcore);
225 ssb_mips_flash_detect(mcore); 290 ssb_mips_flash_detect(mcore);
diff --git a/drivers/ssb/pcmcia.c b/drivers/ssb/pcmcia.c
index d288608d2206..100e7a5c5ea1 100644
--- a/drivers/ssb/pcmcia.c
+++ b/drivers/ssb/pcmcia.c
@@ -583,7 +583,7 @@ static int ssb_pcmcia_sprom_write_all(struct ssb_bus *bus, const u16 *sprom)
583 ssb_printk("."); 583 ssb_printk(".");
584 err = ssb_pcmcia_sprom_write(bus, i, sprom[i]); 584 err = ssb_pcmcia_sprom_write(bus, i, sprom[i]);
585 if (err) { 585 if (err) {
586 ssb_printk("\n" KERN_NOTICE PFX 586 ssb_printk(KERN_NOTICE PFX
587 "Failed to write to SPROM.\n"); 587 "Failed to write to SPROM.\n");
588 failed = 1; 588 failed = 1;
589 break; 589 break;
@@ -591,7 +591,7 @@ static int ssb_pcmcia_sprom_write_all(struct ssb_bus *bus, const u16 *sprom)
591 } 591 }
592 err = ssb_pcmcia_sprom_command(bus, SSB_PCMCIA_SPROMCTL_WRITEDIS); 592 err = ssb_pcmcia_sprom_command(bus, SSB_PCMCIA_SPROMCTL_WRITEDIS);
593 if (err) { 593 if (err) {
594 ssb_printk("\n" KERN_NOTICE PFX 594 ssb_printk(KERN_NOTICE PFX
595 "Could not disable SPROM write access.\n"); 595 "Could not disable SPROM write access.\n");
596 failed = 1; 596 failed = 1;
597 } 597 }
diff --git a/drivers/staging/Kconfig b/drivers/staging/Kconfig
index 348bf61a8fec..975ecddbce30 100644
--- a/drivers/staging/Kconfig
+++ b/drivers/staging/Kconfig
@@ -103,8 +103,6 @@ source "drivers/staging/pohmelfs/Kconfig"
103 103
104source "drivers/staging/stlc45xx/Kconfig" 104source "drivers/staging/stlc45xx/Kconfig"
105 105
106source "drivers/staging/uc2322/Kconfig"
107
108source "drivers/staging/b3dfg/Kconfig" 106source "drivers/staging/b3dfg/Kconfig"
109 107
110source "drivers/staging/phison/Kconfig" 108source "drivers/staging/phison/Kconfig"
diff --git a/drivers/staging/Makefile b/drivers/staging/Makefile
index 8d61d7b4debf..2241ae1b21ee 100644
--- a/drivers/staging/Makefile
+++ b/drivers/staging/Makefile
@@ -34,7 +34,6 @@ obj-$(CONFIG_ANDROID) += android/
34obj-$(CONFIG_DST) += dst/ 34obj-$(CONFIG_DST) += dst/
35obj-$(CONFIG_POHMELFS) += pohmelfs/ 35obj-$(CONFIG_POHMELFS) += pohmelfs/
36obj-$(CONFIG_STLC45XX) += stlc45xx/ 36obj-$(CONFIG_STLC45XX) += stlc45xx/
37obj-$(CONFIG_USB_SERIAL_ATEN2011) += uc2322/
38obj-$(CONFIG_B3DFG) += b3dfg/ 37obj-$(CONFIG_B3DFG) += b3dfg/
39obj-$(CONFIG_IDE_PHISON) += phison/ 38obj-$(CONFIG_IDE_PHISON) += phison/
40obj-$(CONFIG_PLAN9AUTH) += p9auth/ 39obj-$(CONFIG_PLAN9AUTH) += p9auth/
diff --git a/drivers/staging/android/lowmemorykiller.c b/drivers/staging/android/lowmemorykiller.c
index fe72240f5a9e..f934393f3959 100644
--- a/drivers/staging/android/lowmemorykiller.c
+++ b/drivers/staging/android/lowmemorykiller.c
@@ -96,19 +96,21 @@ static int lowmem_shrink(int nr_to_scan, gfp_t gfp_mask)
96 96
97 read_lock(&tasklist_lock); 97 read_lock(&tasklist_lock);
98 for_each_process(p) { 98 for_each_process(p) {
99 struct mm_struct *mm;
99 int oom_adj; 100 int oom_adj;
100 101
101 task_lock(p); 102 task_lock(p);
102 if (!p->mm) { 103 mm = p->mm;
104 if (!mm) {
103 task_unlock(p); 105 task_unlock(p);
104 continue; 106 continue;
105 } 107 }
106 oom_adj = p->oomkilladj; 108 oom_adj = mm->oom_adj;
107 if (oom_adj < min_adj) { 109 if (oom_adj < min_adj) {
108 task_unlock(p); 110 task_unlock(p);
109 continue; 111 continue;
110 } 112 }
111 tasksize = get_mm_rss(p->mm); 113 tasksize = get_mm_rss(mm);
112 task_unlock(p); 114 task_unlock(p);
113 if (tasksize <= 0) 115 if (tasksize <= 0)
114 continue; 116 continue;
diff --git a/drivers/staging/b3dfg/Kconfig b/drivers/staging/b3dfg/Kconfig
index 524231047de5..9e6573cf97d3 100644
--- a/drivers/staging/b3dfg/Kconfig
+++ b/drivers/staging/b3dfg/Kconfig
@@ -1,5 +1,6 @@
1config B3DFG 1config B3DFG
2 tristate "Brontes 3d Frame Framegrabber" 2 tristate "Brontes 3d Frame Framegrabber"
3 depends on PCI
3 default n 4 default n
4 ---help--- 5 ---help---
5 This driver provides support for the Brontes 3d Framegrabber 6 This driver provides support for the Brontes 3d Framegrabber
diff --git a/drivers/staging/comedi/drivers/jr3_pci.c b/drivers/staging/comedi/drivers/jr3_pci.c
index baf83c6a9412..e3c3adc282e2 100644
--- a/drivers/staging/comedi/drivers/jr3_pci.c
+++ b/drivers/staging/comedi/drivers/jr3_pci.c
@@ -45,6 +45,8 @@ Devices: [JR3] PCI force sensor board (jr3_pci)
45#include <linux/delay.h> 45#include <linux/delay.h>
46#include <linux/ctype.h> 46#include <linux/ctype.h>
47#include <linux/firmware.h> 47#include <linux/firmware.h>
48#include <linux/jiffies.h>
49#include <linux/timer.h>
48#include "comedi_pci.h" 50#include "comedi_pci.h"
49#include "jr3_pci.h" 51#include "jr3_pci.h"
50 52
diff --git a/drivers/staging/comedi/drivers/s626.c b/drivers/staging/comedi/drivers/s626.c
index 92121cf8c45c..5d9bab352c1d 100644
--- a/drivers/staging/comedi/drivers/s626.c
+++ b/drivers/staging/comedi/drivers/s626.c
@@ -111,9 +111,13 @@ static const struct s626_board s626_boards[] = {
111#define PCI_VENDOR_ID_S626 0x1131 111#define PCI_VENDOR_ID_S626 0x1131
112#define PCI_DEVICE_ID_S626 0x7146 112#define PCI_DEVICE_ID_S626 0x7146
113 113
114/*
115 * For devices with vendor:device id == 0x1131:0x7146 you must specify
116 * also subvendor:subdevice ids, because otherwise it will conflict with
117 * Philips SAA7146 media/dvb based cards.
118 */
114static DEFINE_PCI_DEVICE_TABLE(s626_pci_table) = { 119static DEFINE_PCI_DEVICE_TABLE(s626_pci_table) = {
115 {PCI_VENDOR_ID_S626, PCI_DEVICE_ID_S626, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 120 {PCI_VENDOR_ID_S626, PCI_DEVICE_ID_S626, 0x6000, 0x0272, 0, 0, 0},
116 0},
117 {0} 121 {0}
118}; 122};
119 123
@@ -499,25 +503,26 @@ static int s626_attach(struct comedi_device *dev, struct comedi_devconfig *it)
499 resource_size_t resourceStart; 503 resource_size_t resourceStart;
500 dma_addr_t appdma; 504 dma_addr_t appdma;
501 struct comedi_subdevice *s; 505 struct comedi_subdevice *s;
502 struct pci_dev *pdev; 506 const struct pci_device_id *ids;
507 struct pci_dev *pdev = NULL;
503 508
504 if (alloc_private(dev, sizeof(struct s626_private)) < 0) 509 if (alloc_private(dev, sizeof(struct s626_private)) < 0)
505 return -ENOMEM; 510 return -ENOMEM;
506 511
507 for (pdev = pci_get_device(PCI_VENDOR_ID_S626, PCI_DEVICE_ID_S626, 512 for (i = 0; i < (ARRAY_SIZE(s626_pci_table) - 1) && !pdev; i++) {
508 NULL); pdev != NULL; 513 ids = &s626_pci_table[i];
509 pdev = pci_get_device(PCI_VENDOR_ID_S626, 514 do {
510 PCI_DEVICE_ID_S626, pdev)) { 515 pdev = pci_get_subsys(ids->vendor, ids->device, ids->subvendor,
511 if (it->options[0] || it->options[1]) { 516 ids->subdevice, pdev);
512 if (pdev->bus->number == it->options[0] && 517
513 PCI_SLOT(pdev->devfn) == it->options[1]) { 518 if ((it->options[0] || it->options[1]) && pdev) {
514 /* matches requested bus/slot */ 519 /* matches requested bus/slot */
520 if (pdev->bus->number == it->options[0] &&
521 PCI_SLOT(pdev->devfn) == it->options[1])
522 break;
523 } else
515 break; 524 break;
516 } 525 } while (1);
517 } else {
518 /* no bus/slot specified */
519 break;
520 }
521 } 526 }
522 devpriv->pdev = pdev; 527 devpriv->pdev = pdev;
523 528
diff --git a/drivers/staging/go7007/s2250-loader.c b/drivers/staging/go7007/s2250-loader.c
index a5e4acab089e..bb22347af60e 100644
--- a/drivers/staging/go7007/s2250-loader.c
+++ b/drivers/staging/go7007/s2250-loader.c
@@ -17,6 +17,7 @@
17 17
18#include <linux/module.h> 18#include <linux/module.h>
19#include <linux/init.h> 19#include <linux/init.h>
20#include <linux/smp_lock.h>
20#include <linux/usb.h> 21#include <linux/usb.h>
21#include <dvb-usb.h> 22#include <dvb-usb.h>
22 23
diff --git a/drivers/staging/heci/Kconfig b/drivers/staging/heci/Kconfig
index ae8d588d3a27..c7206f8bcd93 100644
--- a/drivers/staging/heci/Kconfig
+++ b/drivers/staging/heci/Kconfig
@@ -1,5 +1,6 @@
1config HECI 1config HECI
2 tristate "Intel Management Engine Interface (MEI) Support" 2 tristate "Intel Management Engine Interface (MEI) Support"
3 depends on PCI
3 ---help--- 4 ---help---
4 The Intel Management Engine Interface (Intel MEI) driver allows 5 The Intel Management Engine Interface (Intel MEI) driver allows
5 applications to access the Active Management Technology 6 applications to access the Active Management Technology
diff --git a/drivers/staging/meilhaus/TODO b/drivers/staging/meilhaus/TODO
index 6ec25203089c..d6ce39823de6 100644
--- a/drivers/staging/meilhaus/TODO
+++ b/drivers/staging/meilhaus/TODO
@@ -7,4 +7,4 @@ TODO:
7 - possible comedi merge 7 - possible comedi merge
8 8
9Please send cleanup patches to Greg Kroah-Hartman <greg@kroah.com> 9Please send cleanup patches to Greg Kroah-Hartman <greg@kroah.com>
10and CC: David Kiliani <mail@davidkiliani.de> 10and CC: David Kiliani <mail@davidkiliani.de> and Meilhaus Support <support@meilhaus.de>
diff --git a/drivers/staging/rspiusb/rspiusb.c b/drivers/staging/rspiusb/rspiusb.c
index 1cdfe69585ea..04e2f92c0f62 100644
--- a/drivers/staging/rspiusb/rspiusb.c
+++ b/drivers/staging/rspiusb/rspiusb.c
@@ -444,8 +444,7 @@ static void piusb_write_bulk_callback(struct urb *urb)
444 __func__, status); 444 __func__, status);
445 445
446 pdx->pendingWrite = 0; 446 pdx->pendingWrite = 0;
447 usb_buffer_free(urb->dev, urb->transfer_buffer_length, 447 kfree(urb->transfer_buffer);
448 urb->transfer_buffer, urb->transfer_dma);
449} 448}
450 449
451int piusb_output(struct ioctl_struct *io, unsigned char *uBuf, int len, 450int piusb_output(struct ioctl_struct *io, unsigned char *uBuf, int len,
@@ -457,9 +456,7 @@ int piusb_output(struct ioctl_struct *io, unsigned char *uBuf, int len,
457 456
458 urb = usb_alloc_urb(0, GFP_KERNEL); 457 urb = usb_alloc_urb(0, GFP_KERNEL);
459 if (urb != NULL) { 458 if (urb != NULL) {
460 kbuf = 459 kbuf = kmalloc(len, GFP_KERNEL);
461 usb_buffer_alloc(pdx->udev, len, GFP_KERNEL,
462 &urb->transfer_dma);
463 if (!kbuf) { 460 if (!kbuf) {
464 dev_err(&pdx->udev->dev, "buffer_alloc failed\n"); 461 dev_err(&pdx->udev->dev, "buffer_alloc failed\n");
465 return -ENOMEM; 462 return -ENOMEM;
@@ -470,7 +467,6 @@ int piusb_output(struct ioctl_struct *io, unsigned char *uBuf, int len,
470 } 467 }
471 usb_fill_bulk_urb(urb, pdx->udev, pdx->hEP[io->endpoint], kbuf, 468 usb_fill_bulk_urb(urb, pdx->udev, pdx->hEP[io->endpoint], kbuf,
472 len, piusb_write_bulk_callback, pdx); 469 len, piusb_write_bulk_callback, pdx);
473 urb->transfer_flags |= URB_NO_TRANSFER_DMA_MAP;
474 err = usb_submit_urb(urb, GFP_KERNEL); 470 err = usb_submit_urb(urb, GFP_KERNEL);
475 if (err) { 471 if (err) {
476 dev_err(&pdx->udev->dev, 472 dev_err(&pdx->udev->dev,
@@ -641,7 +637,7 @@ static int MapUserBuffer(struct ioctl_struct *io, struct device_extension *pdx)
641 numPagesRequired = 637 numPagesRequired =
642 ((uaddr & ~PAGE_MASK) + count + ~PAGE_MASK) >> PAGE_SHIFT; 638 ((uaddr & ~PAGE_MASK) + count + ~PAGE_MASK) >> PAGE_SHIFT;
643 dbg("Number of pages needed = %d", numPagesRequired); 639 dbg("Number of pages needed = %d", numPagesRequired);
644 maplist_p = vmalloc(numPagesRequired * sizeof(struct page)); 640 maplist_p = vmalloc(numPagesRequired * sizeof(struct page *));
645 if (!maplist_p) { 641 if (!maplist_p) {
646 dbg("Can't Allocate Memory for maplist_p"); 642 dbg("Can't Allocate Memory for maplist_p");
647 return -ENOMEM; 643 return -ENOMEM;
@@ -712,9 +708,7 @@ static int MapUserBuffer(struct ioctl_struct *io, struct device_extension *pdx)
712 usb_fill_bulk_urb(pdx->PixelUrb[frameInfo][i], 708 usb_fill_bulk_urb(pdx->PixelUrb[frameInfo][i],
713 pdx->udev, 709 pdx->udev,
714 epAddr, 710 epAddr,
715 (dma_addr_t *) sg_dma_address(&pdx-> 711 NULL, // non-DMA HC? buy a better hardware
716 sgl[frameInfo]
717 [i]),
718 sg_dma_len(&pdx->sgl[frameInfo][i]), 712 sg_dma_len(&pdx->sgl[frameInfo][i]),
719 piusb_readPIXEL_callback, (void *)pdx); 713 piusb_readPIXEL_callback, (void *)pdx);
720 pdx->PixelUrb[frameInfo][i]->transfer_dma = 714 pdx->PixelUrb[frameInfo][i]->transfer_dma =
@@ -722,6 +716,8 @@ static int MapUserBuffer(struct ioctl_struct *io, struct device_extension *pdx)
722 pdx->PixelUrb[frameInfo][i]->transfer_flags = 716 pdx->PixelUrb[frameInfo][i]->transfer_flags =
723 URB_NO_TRANSFER_DMA_MAP | URB_NO_INTERRUPT; 717 URB_NO_TRANSFER_DMA_MAP | URB_NO_INTERRUPT;
724 } 718 }
719 if (i == 0)
720 return -EINVAL;
725 /* only interrupt when last URB completes */ 721 /* only interrupt when last URB completes */
726 pdx->PixelUrb[frameInfo][--i]->transfer_flags &= ~URB_NO_INTERRUPT; 722 pdx->PixelUrb[frameInfo][--i]->transfer_flags &= ~URB_NO_INTERRUPT;
727 pdx->pendedPixelUrbs[frameInfo] = 723 pdx->pendedPixelUrbs[frameInfo] =
diff --git a/drivers/staging/rt2860/rt_linux.h b/drivers/staging/rt2860/rt_linux.h
index 85175c182432..25b53ac3f820 100644
--- a/drivers/staging/rt2860/rt_linux.h
+++ b/drivers/staging/rt2860/rt_linux.h
@@ -43,9 +43,6 @@
43#include "rtmp_type.h" 43#include "rtmp_type.h"
44#include <linux/module.h> 44#include <linux/module.h>
45#include <linux/kernel.h> 45#include <linux/kernel.h>
46#if !defined(RT2860) && !defined(RT30xx)
47#include <linux/kthread.h>
48#endif
49 46
50#include <linux/spinlock.h> 47#include <linux/spinlock.h>
51#include <linux/init.h> 48#include <linux/init.h>
@@ -166,9 +163,7 @@ typedef int (*HARD_START_XMIT_FUNC)(struct sk_buff *skb, struct net_device *net_
166 163
167#ifndef RT30xx 164#ifndef RT30xx
168typedef struct pid * THREAD_PID; 165typedef struct pid * THREAD_PID;
169#ifdef RT2860
170#define THREAD_PID_INIT_VALUE NULL 166#define THREAD_PID_INIT_VALUE NULL
171#endif
172#define GET_PID(_v) find_get_pid(_v) 167#define GET_PID(_v) find_get_pid(_v)
173#define GET_PID_NUMBER(_v) pid_nr(_v) 168#define GET_PID_NUMBER(_v) pid_nr(_v)
174#define CHECK_PID_LEGALITY(_pid) if (pid_nr(_pid) >= 0) 169#define CHECK_PID_LEGALITY(_pid) if (pid_nr(_pid) >= 0)
@@ -188,12 +183,12 @@ struct os_cookie {
188 dma_addr_t pAd_pa; 183 dma_addr_t pAd_pa;
189#endif 184#endif
190#ifdef RT2870 185#ifdef RT2870
191 struct usb_device *pUsb_Dev; 186 struct usb_device *pUsb_Dev;
192 187
193#ifndef RT30xx 188#ifndef RT30xx
194 struct task_struct *MLMEThr_task; 189 THREAD_PID MLMEThr_pid;
195 struct task_struct *RTUSBCmdThr_task; 190 THREAD_PID RTUSBCmdThr_pid;
196 struct task_struct *TimerQThr_task; 191 THREAD_PID TimerQThr_pid;
197#endif 192#endif
198#ifdef RT30xx 193#ifdef RT30xx
199 struct pid *MLMEThr_pid; 194 struct pid *MLMEThr_pid;
diff --git a/drivers/staging/rt2870/2870_main_dev.c b/drivers/staging/rt2870/2870_main_dev.c
index dd01c64fbf61..a4e8696ca39c 100644
--- a/drivers/staging/rt2870/2870_main_dev.c
+++ b/drivers/staging/rt2870/2870_main_dev.c
@@ -235,7 +235,7 @@ INT MlmeThread(
235 DBGPRINT(RT_DEBUG_TRACE,( "<---%s\n",__func__)); 235 DBGPRINT(RT_DEBUG_TRACE,( "<---%s\n",__func__));
236 236
237#ifndef RT30xx 237#ifndef RT30xx
238 pObj->MLMEThr_task = NULL; 238 pObj->MLMEThr_pid = THREAD_PID_INIT_VALUE;
239#endif 239#endif
240#ifdef RT30xx 240#ifdef RT30xx
241 pObj->MLMEThr_pid = NULL; 241 pObj->MLMEThr_pid = NULL;
@@ -348,7 +348,7 @@ INT RTUSBCmdThread(
348 DBGPRINT(RT_DEBUG_TRACE,( "<---RTUSBCmdThread\n")); 348 DBGPRINT(RT_DEBUG_TRACE,( "<---RTUSBCmdThread\n"));
349 349
350#ifndef RT30xx 350#ifndef RT30xx
351 pObj->RTUSBCmdThr_task = NULL; 351 pObj->RTUSBCmdThr_pid = THREAD_PID_INIT_VALUE;
352#endif 352#endif
353#ifdef RT30xx 353#ifdef RT30xx
354 pObj->RTUSBCmdThr_pid = NULL; 354 pObj->RTUSBCmdThr_pid = NULL;
@@ -447,7 +447,7 @@ INT TimerQThread(
447 DBGPRINT(RT_DEBUG_TRACE,( "<---%s\n",__func__)); 447 DBGPRINT(RT_DEBUG_TRACE,( "<---%s\n",__func__));
448 448
449#ifndef RT30xx 449#ifndef RT30xx
450 pObj->TimerQThr_task = NULL; 450 pObj->TimerQThr_pid = THREAD_PID_INIT_VALUE;
451#endif 451#endif
452#ifdef RT30xx 452#ifdef RT30xx
453 pObj->TimerQThr_pid = NULL; 453 pObj->TimerQThr_pid = NULL;
@@ -883,46 +883,69 @@ VOID RT28xxThreadTerminate(
883 883
884 // Terminate Threads 884 // Terminate Threads
885#ifndef RT30xx 885#ifndef RT30xx
886 BUG_ON(pObj->TimerQThr_task == NULL); 886 CHECK_PID_LEGALITY(pObj->TimerQThr_pid)
887 CHECK_PID_LEGALITY(task_pid(pObj->TimerQThr_task))
888 { 887 {
889 POS_COOKIE pObj = (POS_COOKIE)pAd->OS_Cookie; 888 POS_COOKIE pObj = (POS_COOKIE)pAd->OS_Cookie;
890 889
891 printk(KERN_DEBUG "Terminate the TimerQThr pid=%d!\n", 890 printk("Terminate the TimerQThr_pid=%d!\n", GET_PID_NUMBER(pObj->TimerQThr_pid));
892 pid_nr(task_pid(pObj->TimerQThr_task)));
893 mb(); 891 mb();
894 pAd->TimerFunc_kill = 1; 892 pAd->TimerFunc_kill = 1;
895 mb(); 893 mb();
896 kthread_stop(pObj->TimerQThr_task); 894 ret = KILL_THREAD_PID(pObj->TimerQThr_pid, SIGTERM, 1);
897 pObj->TimerQThr_task = NULL; 895 if (ret)
896 {
897 printk(KERN_WARNING "%s: unable to stop TimerQThread, pid=%d, ret=%d!\n",
898 pAd->net_dev->name, GET_PID_NUMBER(pObj->TimerQThr_pid), ret);
899 }
900 else
901 {
902 wait_for_completion(&pAd->TimerQComplete);
903 pObj->TimerQThr_pid = THREAD_PID_INIT_VALUE;
904 }
898 } 905 }
899 906
900 BUG_ON(pObj->MLMEThr_task == NULL); 907 CHECK_PID_LEGALITY(pObj->MLMEThr_pid)
901 CHECK_PID_LEGALITY(task_pid(pObj->MLMEThr_task))
902 { 908 {
903 printk(KERN_DEBUG "Terminate the MLMEThr pid=%d!\n", 909 printk("Terminate the MLMEThr_pid=%d!\n", GET_PID_NUMBER(pObj->MLMEThr_pid));
904 pid_nr(task_pid(pObj->MLMEThr_task)));
905 mb(); 910 mb();
906 pAd->mlme_kill = 1; 911 pAd->mlme_kill = 1;
907 //RT28XX_MLME_HANDLER(pAd); 912 //RT28XX_MLME_HANDLER(pAd);
908 mb(); 913 mb();
909 kthread_stop(pObj->MLMEThr_task); 914 ret = KILL_THREAD_PID(pObj->MLMEThr_pid, SIGTERM, 1);
910 pObj->MLMEThr_task = NULL; 915 if (ret)
916 {
917 printk (KERN_WARNING "%s: unable to Mlme thread, pid=%d, ret=%d!\n",
918 pAd->net_dev->name, GET_PID_NUMBER(pObj->MLMEThr_pid), ret);
919 }
920 else
921 {
922 //wait_for_completion (&pAd->notify);
923 wait_for_completion (&pAd->mlmeComplete);
924 pObj->MLMEThr_pid = THREAD_PID_INIT_VALUE;
925 }
911 } 926 }
912 927
913 BUG_ON(pObj->RTUSBCmdThr_task == NULL); 928 CHECK_PID_LEGALITY(pObj->RTUSBCmdThr_pid)
914 CHECK_PID_LEGALITY(task_pid(pObj->RTUSBCmdThr_task))
915 { 929 {
916 printk(KERN_DEBUG "Terminate the RTUSBCmdThr pid=%d!\n", 930 printk("Terminate the RTUSBCmdThr_pid=%d!\n", GET_PID_NUMBER(pObj->RTUSBCmdThr_pid));
917 pid_nr(task_pid(pObj->RTUSBCmdThr_task)));
918 mb(); 931 mb();
919 NdisAcquireSpinLock(&pAd->CmdQLock); 932 NdisAcquireSpinLock(&pAd->CmdQLock);
920 pAd->CmdQ.CmdQState = RT2870_THREAD_STOPED; 933 pAd->CmdQ.CmdQState = RT2870_THREAD_STOPED;
921 NdisReleaseSpinLock(&pAd->CmdQLock); 934 NdisReleaseSpinLock(&pAd->CmdQLock);
922 mb(); 935 mb();
923 //RTUSBCMDUp(pAd); 936 //RTUSBCMDUp(pAd);
924 kthread_stop(pObj->RTUSBCmdThr_task); 937 ret = KILL_THREAD_PID(pObj->RTUSBCmdThr_pid, SIGTERM, 1);
925 pObj->RTUSBCmdThr_task = NULL; 938 if (ret)
939 {
940 printk(KERN_WARNING "%s: unable to RTUSBCmd thread, pid=%d, ret=%d!\n",
941 pAd->net_dev->name, GET_PID_NUMBER(pObj->RTUSBCmdThr_pid), ret);
942 }
943 else
944 {
945 //wait_for_completion (&pAd->notify);
946 wait_for_completion (&pAd->CmdQComplete);
947 pObj->RTUSBCmdThr_pid = THREAD_PID_INIT_VALUE;
948 }
926 } 949 }
927#endif 950#endif
928#ifdef RT30xx 951#ifdef RT30xx
@@ -1045,7 +1068,7 @@ BOOLEAN RT28XXChipsetCheck(
1045 dev_p->descriptor.idProduct == rtusb_usb_id[i].idProduct) 1068 dev_p->descriptor.idProduct == rtusb_usb_id[i].idProduct)
1046 { 1069 {
1047#ifndef RT30xx 1070#ifndef RT30xx
1048 printk(KERN_DEBUG "rt2870: idVendor = 0x%x, idProduct = 0x%x\n", 1071 printk("rt2870: idVendor = 0x%x, idProduct = 0x%x\n",
1049#endif 1072#endif
1050#ifdef RT30xx 1073#ifdef RT30xx
1051 printk("rt2870: idVendor = 0x%x, idProduct = 0x%x\n", 1074 printk("rt2870: idVendor = 0x%x, idProduct = 0x%x\n",
diff --git a/drivers/staging/rt2870/common/2870_rtmp_init.c b/drivers/staging/rt2870/common/2870_rtmp_init.c
index 0f4c8af97e47..80909e9ab5ae 100644
--- a/drivers/staging/rt2870/common/2870_rtmp_init.c
+++ b/drivers/staging/rt2870/common/2870_rtmp_init.c
@@ -700,8 +700,8 @@ NDIS_STATUS AdapterBlockAllocateMemory(
700 usb_dev = pObj->pUsb_Dev; 700 usb_dev = pObj->pUsb_Dev;
701 701
702#ifndef RT30xx 702#ifndef RT30xx
703 pObj->MLMEThr_task = NULL; 703 pObj->MLMEThr_pid = THREAD_PID_INIT_VALUE;
704 pObj->RTUSBCmdThr_task = NULL; 704 pObj->RTUSBCmdThr_pid = THREAD_PID_INIT_VALUE;
705#endif 705#endif
706#ifdef RT30xx 706#ifdef RT30xx
707 pObj->MLMEThr_pid = NULL; 707 pObj->MLMEThr_pid = NULL;
@@ -743,7 +743,7 @@ NDIS_STATUS CreateThreads(
743 PRTMP_ADAPTER pAd = net_dev->ml_priv; 743 PRTMP_ADAPTER pAd = net_dev->ml_priv;
744 POS_COOKIE pObj = (POS_COOKIE) pAd->OS_Cookie; 744 POS_COOKIE pObj = (POS_COOKIE) pAd->OS_Cookie;
745#ifndef RT30xx 745#ifndef RT30xx
746 struct task_struct *tsk; 746 pid_t pid_number = -1;
747#endif 747#endif
748#ifdef RT30xx 748#ifdef RT30xx
749 pid_t pid_number; 749 pid_t pid_number;
@@ -762,10 +762,10 @@ NDIS_STATUS CreateThreads(
762 762
763 // Creat MLME Thread 763 // Creat MLME Thread
764#ifndef RT30xx 764#ifndef RT30xx
765 pObj->MLMEThr_task = NULL; 765 pObj->MLMEThr_pid= THREAD_PID_INIT_VALUE;
766 tsk = kthread_run(MlmeThread, pAd, "%s", pAd->net_dev->name); 766 pid_number = kernel_thread(MlmeThread, pAd, CLONE_VM);
767 767 if (pid_number < 0)
768 if (IS_ERR(tsk)) { 768 {
769#endif 769#endif
770#ifdef RT30xx 770#ifdef RT30xx
771 pObj->MLMEThr_pid = NULL; 771 pObj->MLMEThr_pid = NULL;
@@ -778,7 +778,7 @@ NDIS_STATUS CreateThreads(
778 } 778 }
779 779
780#ifndef RT30xx 780#ifndef RT30xx
781 pObj->MLMEThr_task = tsk; 781 pObj->MLMEThr_pid = GET_PID(pid_number);
782#endif 782#endif
783#ifdef RT30xx 783#ifdef RT30xx
784 pObj->MLMEThr_pid = find_get_pid(pid_number); 784 pObj->MLMEThr_pid = find_get_pid(pid_number);
@@ -788,10 +788,9 @@ NDIS_STATUS CreateThreads(
788 788
789 // Creat Command Thread 789 // Creat Command Thread
790#ifndef RT30xx 790#ifndef RT30xx
791 pObj->RTUSBCmdThr_task = NULL; 791 pObj->RTUSBCmdThr_pid= THREAD_PID_INIT_VALUE;
792 tsk = kthread_run(RTUSBCmdThread, pAd, "%s", pAd->net_dev->name); 792 pid_number = kernel_thread(RTUSBCmdThread, pAd, CLONE_VM);
793 793 if (pid_number < 0)
794 if (IS_ERR(tsk) < 0)
795#endif 794#endif
796#ifdef RT30xx 795#ifdef RT30xx
797 pObj->RTUSBCmdThr_pid = NULL; 796 pObj->RTUSBCmdThr_pid = NULL;
@@ -804,7 +803,7 @@ NDIS_STATUS CreateThreads(
804 } 803 }
805 804
806#ifndef RT30xx 805#ifndef RT30xx
807 pObj->RTUSBCmdThr_task = tsk; 806 pObj->RTUSBCmdThr_pid = GET_PID(pid_number);
808#endif 807#endif
809#ifdef RT30xx 808#ifdef RT30xx
810 pObj->RTUSBCmdThr_pid = find_get_pid(pid_number); 809 pObj->RTUSBCmdThr_pid = find_get_pid(pid_number);
@@ -812,9 +811,9 @@ NDIS_STATUS CreateThreads(
812 wait_for_completion(&(pAd->CmdQComplete)); 811 wait_for_completion(&(pAd->CmdQComplete));
813 812
814#ifndef RT30xx 813#ifndef RT30xx
815 pObj->TimerQThr_task = NULL; 814 pObj->TimerQThr_pid= THREAD_PID_INIT_VALUE;
816 tsk = kthread_run(TimerQThread, pAd, "%s", pAd->net_dev->name); 815 pid_number = kernel_thread(TimerQThread, pAd, CLONE_VM);
817 if (IS_ERR(tsk) < 0) 816 if (pid_number < 0)
818#endif 817#endif
819#ifdef RT30xx 818#ifdef RT30xx
820 pObj->TimerQThr_pid = NULL; 819 pObj->TimerQThr_pid = NULL;
@@ -826,7 +825,7 @@ NDIS_STATUS CreateThreads(
826 return NDIS_STATUS_FAILURE; 825 return NDIS_STATUS_FAILURE;
827 } 826 }
828#ifndef RT30xx 827#ifndef RT30xx
829 pObj->TimerQThr_task = tsk; 828 pObj->TimerQThr_pid = GET_PID(pid_number);
830#endif 829#endif
831#ifdef RT30xx 830#ifdef RT30xx
832 pObj->TimerQThr_pid = find_get_pid(pid_number); 831 pObj->TimerQThr_pid = find_get_pid(pid_number);
diff --git a/drivers/staging/rt2870/common/rtusb_io.c b/drivers/staging/rt2870/common/rtusb_io.c
index fd1b0c18f2a0..704b5c2d5091 100644
--- a/drivers/staging/rt2870/common/rtusb_io.c
+++ b/drivers/staging/rt2870/common/rtusb_io.c
@@ -984,8 +984,7 @@ NDIS_STATUS RTUSBEnqueueCmdFromNdis(
984 POS_COOKIE pObj = (POS_COOKIE) pAd->OS_Cookie; 984 POS_COOKIE pObj = (POS_COOKIE) pAd->OS_Cookie;
985 985
986#ifndef RT30xx 986#ifndef RT30xx
987 BUG_ON(pObj->RTUSBCmdThr_task == NULL); 987 CHECK_PID_LEGALITY(pObj->RTUSBCmdThr_pid)
988 CHECK_PID_LEGALITY(task_pid(pObj->RTUSBCmdThr_task))
989#endif 988#endif
990#ifdef RT30xx 989#ifdef RT30xx
991 if (pObj->RTUSBCmdThr_pid < 0) 990 if (pObj->RTUSBCmdThr_pid < 0)
diff --git a/drivers/staging/rt2870/rt2870.h b/drivers/staging/rt2870/rt2870.h
index 5e5b3f2b7eb1..2b8872b2fd9d 100644
--- a/drivers/staging/rt2870/rt2870.h
+++ b/drivers/staging/rt2870/rt2870.h
@@ -79,6 +79,7 @@
79{ \ 79{ \
80 {USB_DEVICE(0x148F,0x2770)}, /* Ralink */ \ 80 {USB_DEVICE(0x148F,0x2770)}, /* Ralink */ \
81 {USB_DEVICE(0x1737,0x0071)}, /* Linksys WUSB600N */ \ 81 {USB_DEVICE(0x1737,0x0071)}, /* Linksys WUSB600N */ \
82 {USB_DEVICE(0x1737,0x0070)}, /* Linksys */ \
82 {USB_DEVICE(0x148F,0x2870)}, /* Ralink */ \ 83 {USB_DEVICE(0x148F,0x2870)}, /* Ralink */ \
83 {USB_DEVICE(0x148F,0x3070)}, /* Ralink */ \ 84 {USB_DEVICE(0x148F,0x3070)}, /* Ralink */ \
84 {USB_DEVICE(0x0B05,0x1731)}, /* Asus */ \ 85 {USB_DEVICE(0x0B05,0x1731)}, /* Asus */ \
@@ -89,15 +90,18 @@
89 {USB_DEVICE(0x0DF6,0x002C)}, /* Sitecom */ \ 90 {USB_DEVICE(0x0DF6,0x002C)}, /* Sitecom */ \
90 {USB_DEVICE(0x0DF6,0x002D)}, /* Sitecom */ \ 91 {USB_DEVICE(0x0DF6,0x002D)}, /* Sitecom */ \
91 {USB_DEVICE(0x0DF6,0x0039)}, /* Sitecom */ \ 92 {USB_DEVICE(0x0DF6,0x0039)}, /* Sitecom */ \
93 {USB_DEVICE(0x0DF6,0x003F)}, /* Sitecom WL-608 */ \
92 {USB_DEVICE(0x14B2,0x3C06)}, /* Conceptronic */ \ 94 {USB_DEVICE(0x14B2,0x3C06)}, /* Conceptronic */ \
93 {USB_DEVICE(0x14B2,0x3C28)}, /* Conceptronic */ \ 95 {USB_DEVICE(0x14B2,0x3C28)}, /* Conceptronic */ \
94 {USB_DEVICE(0x2019,0xED06)}, /* Planex Communications, Inc. */ \ 96 {USB_DEVICE(0x2019,0xED06)}, /* Planex Communications, Inc. */ \
97 {USB_DEVICE(0x2019,0xED14)}, /* Planex Communications, Inc. */ \
95 {USB_DEVICE(0x2019,0xAB25)}, /* Planex Communications, Inc. RT3070 */ \ 98 {USB_DEVICE(0x2019,0xAB25)}, /* Planex Communications, Inc. RT3070 */ \
96 {USB_DEVICE(0x07D1,0x3C09)}, /* D-Link */ \ 99 {USB_DEVICE(0x07D1,0x3C09)}, /* D-Link */ \
97 {USB_DEVICE(0x07D1,0x3C11)}, /* D-Link */ \ 100 {USB_DEVICE(0x07D1,0x3C11)}, /* D-Link */ \
98 {USB_DEVICE(0x14B2,0x3C07)}, /* AL */ \ 101 {USB_DEVICE(0x14B2,0x3C07)}, /* AL */ \
99 {USB_DEVICE(0x14B2,0x3C12)}, /* AL */ \ 102 {USB_DEVICE(0x14B2,0x3C12)}, /* AL */ \
100 {USB_DEVICE(0x050D,0x8053)}, /* Belkin */ \ 103 {USB_DEVICE(0x050D,0x8053)}, /* Belkin */ \
104 {USB_DEVICE(0x050D,0x815C)}, /* Belkin */ \
101 {USB_DEVICE(0x14B2,0x3C23)}, /* Airlink */ \ 105 {USB_DEVICE(0x14B2,0x3C23)}, /* Airlink */ \
102 {USB_DEVICE(0x14B2,0x3C27)}, /* Airlink */ \ 106 {USB_DEVICE(0x14B2,0x3C27)}, /* Airlink */ \
103 {USB_DEVICE(0x07AA,0x002F)}, /* Corega */ \ 107 {USB_DEVICE(0x07AA,0x002F)}, /* Corega */ \
@@ -586,16 +590,14 @@ VOID RTUSBBulkRxComplete(purbb_t pUrb, struct pt_regs *pt_regs);
586#define RTUSBMlmeUp(pAd) \ 590#define RTUSBMlmeUp(pAd) \
587{ \ 591{ \
588 POS_COOKIE pObj = (POS_COOKIE) pAd->OS_Cookie; \ 592 POS_COOKIE pObj = (POS_COOKIE) pAd->OS_Cookie; \
589 BUG_ON(pObj->MLMEThr_task == NULL); \ 593 CHECK_PID_LEGALITY(pObj->MLMEThr_pid) \
590 CHECK_PID_LEGALITY(task_pid(pObj->MLMEThr_task)) \
591 up(&(pAd->mlme_semaphore)); \ 594 up(&(pAd->mlme_semaphore)); \
592} 595}
593 596
594#define RTUSBCMDUp(pAd) \ 597#define RTUSBCMDUp(pAd) \
595{ \ 598{ \
596 POS_COOKIE pObj = (POS_COOKIE) pAd->OS_Cookie; \ 599 POS_COOKIE pObj = (POS_COOKIE) pAd->OS_Cookie; \
597 BUG_ON(pObj->RTUSBCmdThr_task == NULL); \ 600 CHECK_PID_LEGALITY(pObj->RTUSBCmdThr_pid) \
598 CHECK_PID_LEGALITY(task_pid(pObj->RTUSBCmdThr_task)) \
599 up(&(pAd->RTUSBCmd_semaphore)); \ 601 up(&(pAd->RTUSBCmd_semaphore)); \
600} 602}
601#endif 603#endif
diff --git a/drivers/staging/rtl8187se/ieee80211/ieee80211_softmac_wx.c b/drivers/staging/rtl8187se/ieee80211/ieee80211_softmac_wx.c
index 93af37e2d31a..54b4b718f84a 100644
--- a/drivers/staging/rtl8187se/ieee80211/ieee80211_softmac_wx.c
+++ b/drivers/staging/rtl8187se/ieee80211/ieee80211_softmac_wx.c
@@ -461,19 +461,19 @@ int ieee80211_wx_get_name(struct ieee80211_device *ieee,
461 struct iw_request_info *info, 461 struct iw_request_info *info,
462 union iwreq_data *wrqu, char *extra) 462 union iwreq_data *wrqu, char *extra)
463{ 463{
464 strcpy(wrqu->name, "802.11"); 464 strlcpy(wrqu->name, "802.11", IFNAMSIZ);
465 if(ieee->modulation & IEEE80211_CCK_MODULATION){ 465 if(ieee->modulation & IEEE80211_CCK_MODULATION){
466 strcat(wrqu->name, "b"); 466 strlcat(wrqu->name, "b", IFNAMSIZ);
467 if(ieee->modulation & IEEE80211_OFDM_MODULATION) 467 if(ieee->modulation & IEEE80211_OFDM_MODULATION)
468 strcat(wrqu->name, "/g"); 468 strlcat(wrqu->name, "/g", IFNAMSIZ);
469 }else if(ieee->modulation & IEEE80211_OFDM_MODULATION) 469 }else if(ieee->modulation & IEEE80211_OFDM_MODULATION)
470 strcat(wrqu->name, "g"); 470 strlcat(wrqu->name, "g", IFNAMSIZ);
471 471
472 if((ieee->state == IEEE80211_LINKED) || 472 if((ieee->state == IEEE80211_LINKED) ||
473 (ieee->state == IEEE80211_LINKED_SCANNING)) 473 (ieee->state == IEEE80211_LINKED_SCANNING))
474 strcat(wrqu->name," linked"); 474 strlcat(wrqu->name," link", IFNAMSIZ);
475 else if(ieee->state != IEEE80211_NOLINK) 475 else if(ieee->state != IEEE80211_NOLINK)
476 strcat(wrqu->name," link.."); 476 strlcat(wrqu->name," .....", IFNAMSIZ);
477 477
478 478
479 return 0; 479 return 0;
diff --git a/drivers/staging/rtl8192su/Kconfig b/drivers/staging/rtl8192su/Kconfig
index 4b5552c5926e..770f41280f21 100644
--- a/drivers/staging/rtl8192su/Kconfig
+++ b/drivers/staging/rtl8192su/Kconfig
@@ -1,6 +1,6 @@
1config RTL8192SU 1config RTL8192SU
2 tristate "RealTek RTL8192SU Wireless LAN NIC driver" 2 tristate "RealTek RTL8192SU Wireless LAN NIC driver"
3 depends on PCI 3 depends on PCI
4 depends on WIRELESS_EXT && COMPAT_NET_DEV_OPS 4 depends on WIRELESS_EXT
5 default N 5 default N
6 ---help--- 6 ---help---
diff --git a/drivers/staging/rtl8192su/ieee80211.h b/drivers/staging/rtl8192su/ieee80211.h
index 0edb09a536f9..ea9739318037 100644
--- a/drivers/staging/rtl8192su/ieee80211.h
+++ b/drivers/staging/rtl8192su/ieee80211.h
@@ -2645,7 +2645,7 @@ extern int ieee80211_encrypt_fragment(
2645 struct sk_buff *frag, 2645 struct sk_buff *frag,
2646 int hdr_len); 2646 int hdr_len);
2647 2647
2648extern int ieee80211_xmit(struct sk_buff *skb, 2648extern int rtl8192_ieee80211_xmit(struct sk_buff *skb,
2649 struct net_device *dev); 2649 struct net_device *dev);
2650extern void ieee80211_txb_free(struct ieee80211_txb *); 2650extern void ieee80211_txb_free(struct ieee80211_txb *);
2651 2651
diff --git a/drivers/staging/rtl8192su/ieee80211/ieee80211.h b/drivers/staging/rtl8192su/ieee80211/ieee80211.h
index 720bfcbfadc1..5e3a2cbed2b1 100644
--- a/drivers/staging/rtl8192su/ieee80211/ieee80211.h
+++ b/drivers/staging/rtl8192su/ieee80211/ieee80211.h
@@ -2645,7 +2645,7 @@ extern int ieee80211_encrypt_fragment(
2645 struct sk_buff *frag, 2645 struct sk_buff *frag,
2646 int hdr_len); 2646 int hdr_len);
2647 2647
2648extern int ieee80211_xmit(struct sk_buff *skb, 2648extern int rtl8192_ieee80211_xmit(struct sk_buff *skb,
2649 struct net_device *dev); 2649 struct net_device *dev);
2650extern void ieee80211_txb_free(struct ieee80211_txb *); 2650extern void ieee80211_txb_free(struct ieee80211_txb *);
2651 2651
diff --git a/drivers/staging/rtl8192su/ieee80211/ieee80211_module.c b/drivers/staging/rtl8192su/ieee80211/ieee80211_module.c
index f408b4583b82..759032db4a34 100644
--- a/drivers/staging/rtl8192su/ieee80211/ieee80211_module.c
+++ b/drivers/staging/rtl8192su/ieee80211/ieee80211_module.c
@@ -118,7 +118,6 @@ struct net_device *alloc_ieee80211(int sizeof_priv)
118#else 118#else
119 ieee = (struct ieee80211_device *)dev->priv; 119 ieee = (struct ieee80211_device *)dev->priv;
120#endif 120#endif
121 dev->hard_start_xmit = ieee80211_xmit;
122 121
123 memset(ieee, 0, sizeof(struct ieee80211_device)+sizeof_priv); 122 memset(ieee, 0, sizeof(struct ieee80211_device)+sizeof_priv);
124 ieee->dev = dev; 123 ieee->dev = dev;
diff --git a/drivers/staging/rtl8192su/ieee80211/ieee80211_softmac_wx.c b/drivers/staging/rtl8192su/ieee80211/ieee80211_softmac_wx.c
index 1f50c46dcb90..191dc3fbbe32 100644
--- a/drivers/staging/rtl8192su/ieee80211/ieee80211_softmac_wx.c
+++ b/drivers/staging/rtl8192su/ieee80211/ieee80211_softmac_wx.c
@@ -548,21 +548,21 @@ int ieee80211_wx_get_name(struct ieee80211_device *ieee,
548 struct iw_request_info *info, 548 struct iw_request_info *info,
549 union iwreq_data *wrqu, char *extra) 549 union iwreq_data *wrqu, char *extra)
550{ 550{
551 strcpy(wrqu->name, "802.11"); 551 strlcpy(wrqu->name, "802.11", IFNAMSIZ);
552 if(ieee->modulation & IEEE80211_CCK_MODULATION){ 552 if(ieee->modulation & IEEE80211_CCK_MODULATION){
553 strcat(wrqu->name, "b"); 553 strlcat(wrqu->name, "b", IFNAMSIZ);
554 if(ieee->modulation & IEEE80211_OFDM_MODULATION) 554 if(ieee->modulation & IEEE80211_OFDM_MODULATION)
555 strcat(wrqu->name, "/g"); 555 strlcat(wrqu->name, "/g", IFNAMSIZ);
556 }else if(ieee->modulation & IEEE80211_OFDM_MODULATION) 556 }else if(ieee->modulation & IEEE80211_OFDM_MODULATION)
557 strcat(wrqu->name, "g"); 557 strlcat(wrqu->name, "g", IFNAMSIZ);
558 if (ieee->mode & (IEEE_N_24G | IEEE_N_5G)) 558 if (ieee->mode & (IEEE_N_24G | IEEE_N_5G))
559 strcat(wrqu->name, "/n"); 559 strlcat(wrqu->name, "/n", IFNAMSIZ);
560 560
561 if((ieee->state == IEEE80211_LINKED) || 561 if((ieee->state == IEEE80211_LINKED) ||
562 (ieee->state == IEEE80211_LINKED_SCANNING)) 562 (ieee->state == IEEE80211_LINKED_SCANNING))
563 strcat(wrqu->name," linked"); 563 strlcat(wrqu->name, " link", IFNAMSIZ);
564 else if(ieee->state != IEEE80211_NOLINK) 564 else if(ieee->state != IEEE80211_NOLINK)
565 strcat(wrqu->name," link.."); 565 strlcat(wrqu->name, " .....", IFNAMSIZ);
566 566
567 567
568 return 0; 568 return 0;
diff --git a/drivers/staging/rtl8192su/ieee80211/ieee80211_tx.c b/drivers/staging/rtl8192su/ieee80211/ieee80211_tx.c
index 7294572b990f..cba12b84be5c 100644
--- a/drivers/staging/rtl8192su/ieee80211/ieee80211_tx.c
+++ b/drivers/staging/rtl8192su/ieee80211/ieee80211_tx.c
@@ -618,7 +618,7 @@ void ieee80211_query_seqnum(struct ieee80211_device*ieee, struct sk_buff* skb, u
618 } 618 }
619} 619}
620 620
621int ieee80211_xmit(struct sk_buff *skb, struct net_device *dev) 621int rtl8192_ieee80211_xmit(struct sk_buff *skb, struct net_device *dev)
622{ 622{
623#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)) 623#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0))
624 struct ieee80211_device *ieee = netdev_priv(dev); 624 struct ieee80211_device *ieee = netdev_priv(dev);
@@ -943,5 +943,6 @@ int ieee80211_xmit(struct sk_buff *skb, struct net_device *dev)
943 return 1; 943 return 1;
944 944
945} 945}
946EXPORT_SYMBOL(rtl8192_ieee80211_xmit);
946 947
947EXPORT_SYMBOL(ieee80211_txb_free); 948EXPORT_SYMBOL(ieee80211_txb_free);
diff --git a/drivers/staging/rtl8192su/r8192U_core.c b/drivers/staging/rtl8192su/r8192U_core.c
index f1423d714496..70f81a8f1291 100644
--- a/drivers/staging/rtl8192su/r8192U_core.c
+++ b/drivers/staging/rtl8192su/r8192U_core.c
@@ -12132,6 +12132,19 @@ static void HalUsbSetQueuePipeMapping8192SUsb(struct usb_interface *intf, struct
12132} 12132}
12133#endif 12133#endif
12134 12134
12135static const struct net_device_ops rtl8192_netdev_ops = {
12136 .ndo_open = rtl8192_open,
12137 .ndo_stop = rtl8192_close,
12138 .ndo_get_stats = rtl8192_stats,
12139 .ndo_tx_timeout = tx_timeout,
12140 .ndo_do_ioctl = rtl8192_ioctl,
12141 .ndo_set_multicast_list = r8192_set_multicast,
12142 .ndo_set_mac_address = r8192_set_mac_adr,
12143 .ndo_validate_addr = eth_validate_addr,
12144 .ndo_change_mtu = eth_change_mtu,
12145 .ndo_start_xmit = rtl8192_ieee80211_xmit,
12146};
12147
12135#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0) 12148#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0)
12136static int __devinit rtl8192_usb_probe(struct usb_interface *intf, 12149static int __devinit rtl8192_usb_probe(struct usb_interface *intf,
12137 const struct usb_device_id *id) 12150 const struct usb_device_id *id)
@@ -12186,15 +12199,7 @@ static void * __devinit rtl8192_usb_probe(struct usb_device *udev,
12186 priv->ops = &rtl8192u_ops; 12199 priv->ops = &rtl8192u_ops;
12187#endif 12200#endif
12188 12201
12189 dev->open = rtl8192_open; 12202 dev->netdev_ops = &rtl8192_netdev_ops;
12190 dev->stop = rtl8192_close;
12191 //dev->hard_start_xmit = rtl8192_8023_hard_start_xmit;
12192 dev->tx_timeout = tx_timeout;
12193 //dev->wireless_handlers = &r8192_wx_handlers_def;
12194 dev->do_ioctl = rtl8192_ioctl;
12195 dev->set_multicast_list = r8192_set_multicast;
12196 dev->set_mac_address = r8192_set_mac_adr;
12197 dev->get_stats = rtl8192_stats;
12198 12203
12199 //DMESG("Oops: i'm coming\n"); 12204 //DMESG("Oops: i'm coming\n");
12200#if WIRELESS_EXT >= 12 12205#if WIRELESS_EXT >= 12
diff --git a/drivers/staging/rtl8192su/r8192U_pm.c b/drivers/staging/rtl8192su/r8192U_pm.c
index 92c95aa36638..b1531a8d0cde 100644
--- a/drivers/staging/rtl8192su/r8192U_pm.c
+++ b/drivers/staging/rtl8192su/r8192U_pm.c
@@ -35,7 +35,9 @@ int rtl8192U_suspend(struct usb_interface *intf, pm_message_t state)
35 return 0; 35 return 0;
36 } 36 }
37 37
38 dev->stop(dev); 38 if (dev->netdev_ops->ndo_stop)
39 dev->netdev_ops->ndo_stop(dev);
40
39 mdelay(10); 41 mdelay(10);
40 42
41 netif_device_detach(dev); 43 netif_device_detach(dev);
@@ -61,7 +63,9 @@ int rtl8192U_resume (struct usb_interface *intf)
61 } 63 }
62 64
63 netif_device_attach(dev); 65 netif_device_attach(dev);
64 dev->open(dev); 66
67 if (dev->netdev_ops->ndo_open)
68 dev->netdev_ops->ndo_open(dev);
65 } 69 }
66 70
67 return 0; 71 return 0;
diff --git a/drivers/staging/serqt_usb2/serqt_usb2.c b/drivers/staging/serqt_usb2/serqt_usb2.c
index 90b29b564631..0fdf8c6dc648 100644
--- a/drivers/staging/serqt_usb2/serqt_usb2.c
+++ b/drivers/staging/serqt_usb2/serqt_usb2.c
@@ -360,18 +360,18 @@ static void qt_read_bulk_callback(struct urb *urb)
360 if (port_paranoia_check(port, __func__) != 0) { 360 if (port_paranoia_check(port, __func__) != 0) {
361 dbg("%s - port_paranoia_check, exiting\n", __func__); 361 dbg("%s - port_paranoia_check, exiting\n", __func__);
362 qt_port->ReadBulkStopped = 1; 362 qt_port->ReadBulkStopped = 1;
363 return; 363 goto exit;
364 } 364 }
365 365
366 if (!serial) { 366 if (!serial) {
367 dbg("%s - bad serial pointer, exiting\n", __func__); 367 dbg("%s - bad serial pointer, exiting\n", __func__);
368 return; 368 goto exit;
369 } 369 }
370 if (qt_port->closePending == 1) { 370 if (qt_port->closePending == 1) {
371 /* Were closing , stop reading */ 371 /* Were closing , stop reading */
372 dbg("%s - (qt_port->closepending == 1\n", __func__); 372 dbg("%s - (qt_port->closepending == 1\n", __func__);
373 qt_port->ReadBulkStopped = 1; 373 qt_port->ReadBulkStopped = 1;
374 return; 374 goto exit;
375 } 375 }
376 376
377 /* 377 /*
@@ -381,7 +381,7 @@ static void qt_read_bulk_callback(struct urb *urb)
381 */ 381 */
382 if (qt_port->RxHolding == 1) { 382 if (qt_port->RxHolding == 1) {
383 qt_port->ReadBulkStopped = 1; 383 qt_port->ReadBulkStopped = 1;
384 return; 384 goto exit;
385 } 385 }
386 386
387 if (urb->status) { 387 if (urb->status) {
@@ -389,7 +389,7 @@ static void qt_read_bulk_callback(struct urb *urb)
389 389
390 dbg("%s - nonzero read bulk status received: %d\n", 390 dbg("%s - nonzero read bulk status received: %d\n",
391 __func__, urb->status); 391 __func__, urb->status);
392 return; 392 goto exit;
393 } 393 }
394 394
395 if (tty && RxCount) { 395 if (tty && RxCount) {
@@ -463,6 +463,8 @@ static void qt_read_bulk_callback(struct urb *urb)
463 } 463 }
464 464
465 schedule_work(&port->work); 465 schedule_work(&port->work);
466exit:
467 tty_kref_put(tty);
466} 468}
467 469
468/* 470/*
@@ -736,6 +738,11 @@ static int qt_startup(struct usb_serial *serial)
736 if (!qt_port) { 738 if (!qt_port) {
737 dbg("%s: kmalloc for quatech_port (%d) failed!.", 739 dbg("%s: kmalloc for quatech_port (%d) failed!.",
738 __func__, i); 740 __func__, i);
741 for(--i; i >= 0; i--) {
742 port = serial->port[i];
743 kfree(usb_get_serial_port_data(port));
744 usb_set_serial_port_data(port, NULL);
745 }
739 return -ENOMEM; 746 return -ENOMEM;
740 } 747 }
741 spin_lock_init(&qt_port->lock); 748 spin_lock_init(&qt_port->lock);
@@ -866,7 +873,7 @@ static void qt_release(struct usb_serial *serial)
866 873
867} 874}
868 875
869int qt_open(struct tty_struct *tty, 876static int qt_open(struct tty_struct *tty,
870 struct usb_serial_port *port, struct file *filp) 877 struct usb_serial_port *port, struct file *filp)
871{ 878{
872 struct usb_serial *serial; 879 struct usb_serial *serial;
@@ -1041,17 +1048,19 @@ static void qt_block_until_empty(struct tty_struct *tty,
1041 } 1048 }
1042} 1049}
1043 1050
1044static void qt_close(struct tty_struct *tty, struct usb_serial_port *port, 1051static void qt_close(struct usb_serial_port *port)
1045 struct file *filp)
1046{ 1052{
1047 struct usb_serial *serial = port->serial; 1053 struct usb_serial *serial = port->serial;
1048 struct quatech_port *qt_port; 1054 struct quatech_port *qt_port;
1049 struct quatech_port *port0; 1055 struct quatech_port *port0;
1056 struct tty_struct *tty;
1050 int status; 1057 int status;
1051 unsigned int index; 1058 unsigned int index;
1052 status = 0; 1059 status = 0;
1053 1060
1054 dbg("%s - port %d\n", __func__, port->number); 1061 dbg("%s - port %d\n", __func__, port->number);
1062
1063 tty = tty_port_tty_get(&port->port);
1055 index = tty->index - serial->minor; 1064 index = tty->index - serial->minor;
1056 1065
1057 qt_port = qt_get_port_private(port); 1066 qt_port = qt_get_port_private(port);
@@ -1066,6 +1075,7 @@ static void qt_close(struct tty_struct *tty, struct usb_serial_port *port,
1066 /* wait up to for transmitter to empty */ 1075 /* wait up to for transmitter to empty */
1067 if (serial->dev) 1076 if (serial->dev)
1068 qt_block_until_empty(tty, qt_port); 1077 qt_block_until_empty(tty, qt_port);
1078 tty_kref_put(tty);
1069 1079
1070 /* Close uart channel */ 1080 /* Close uart channel */
1071 status = qt_close_channel(serial, index); 1081 status = qt_close_channel(serial, index);
diff --git a/drivers/staging/stlc45xx/stlc45xx.c b/drivers/staging/stlc45xx/stlc45xx.c
index cfdaac9b747e..a137c78fac09 100644
--- a/drivers/staging/stlc45xx/stlc45xx.c
+++ b/drivers/staging/stlc45xx/stlc45xx.c
@@ -2235,24 +2235,6 @@ static void stlc45xx_op_remove_interface(struct ieee80211_hw *hw,
2235 stlc45xx_debug(DEBUG_FUNC, "%s", __func__); 2235 stlc45xx_debug(DEBUG_FUNC, "%s", __func__);
2236} 2236}
2237 2237
2238static int stlc45xx_op_config_interface(struct ieee80211_hw *hw,
2239 struct ieee80211_vif *vif,
2240 struct ieee80211_if_conf *conf)
2241{
2242 struct stlc45xx *stlc = hw->priv;
2243
2244 stlc45xx_debug(DEBUG_FUNC, "%s", __func__);
2245
2246 mutex_lock(&stlc->mutex);
2247
2248 memcpy(stlc->bssid, conf->bssid, ETH_ALEN);
2249 stlc45xx_tx_setup(stlc);
2250
2251 mutex_unlock(&stlc->mutex);
2252
2253 return 0;
2254}
2255
2256static int stlc45xx_op_config(struct ieee80211_hw *hw, u32 changed) 2238static int stlc45xx_op_config(struct ieee80211_hw *hw, u32 changed)
2257{ 2239{
2258 struct stlc45xx *stlc = hw->priv; 2240 struct stlc45xx *stlc = hw->priv;
@@ -2295,6 +2277,14 @@ static void stlc45xx_op_bss_info_changed(struct ieee80211_hw *hw,
2295{ 2277{
2296 struct stlc45xx *stlc = hw->priv; 2278 struct stlc45xx *stlc = hw->priv;
2297 2279
2280 stlc45xx_debug(DEBUG_FUNC, "%s", __func__);
2281 mutex_lock(&stlc->mutex);
2282
2283 memcpy(stlc->bssid, info->bssid, ETH_ALEN);
2284 stlc45xx_tx_setup(stlc);
2285
2286 mutex_unlock(&stlc->mutex);
2287
2298 if (changed & BSS_CHANGED_ASSOC) { 2288 if (changed & BSS_CHANGED_ASSOC) {
2299 stlc->associated = info->assoc; 2289 stlc->associated = info->assoc;
2300 if (info->assoc) 2290 if (info->assoc)
@@ -2357,7 +2347,6 @@ static const struct ieee80211_ops stlc45xx_ops = {
2357 .add_interface = stlc45xx_op_add_interface, 2347 .add_interface = stlc45xx_op_add_interface,
2358 .remove_interface = stlc45xx_op_remove_interface, 2348 .remove_interface = stlc45xx_op_remove_interface,
2359 .config = stlc45xx_op_config, 2349 .config = stlc45xx_op_config,
2360 .config_interface = stlc45xx_op_config_interface,
2361 .configure_filter = stlc45xx_op_configure_filter, 2350 .configure_filter = stlc45xx_op_configure_filter,
2362 .tx = stlc45xx_op_tx, 2351 .tx = stlc45xx_op_tx,
2363 .bss_info_changed = stlc45xx_op_bss_info_changed, 2352 .bss_info_changed = stlc45xx_op_bss_info_changed,
diff --git a/drivers/staging/uc2322/Kconfig b/drivers/staging/uc2322/Kconfig
deleted file mode 100644
index 2e0c6e79df2b..000000000000
--- a/drivers/staging/uc2322/Kconfig
+++ /dev/null
@@ -1,10 +0,0 @@
1config USB_SERIAL_ATEN2011
2 tristate "ATEN 2011 USB to serial device support"
3 depends on USB_SERIAL
4 default N
5 ---help---
6 Say Y here if you want to use a ATEN 2011 dual port USB to serial
7 adapter.
8
9 To compile this driver as a module, choose M here: the module will be
10 called aten2011.
diff --git a/drivers/staging/uc2322/Makefile b/drivers/staging/uc2322/Makefile
deleted file mode 100644
index 49c18d6e579f..000000000000
--- a/drivers/staging/uc2322/Makefile
+++ /dev/null
@@ -1 +0,0 @@
1obj-$(CONFIG_USB_SERIAL_ATEN2011) += aten2011.o
diff --git a/drivers/staging/uc2322/TODO b/drivers/staging/uc2322/TODO
deleted file mode 100644
index c189a64c4185..000000000000
--- a/drivers/staging/uc2322/TODO
+++ /dev/null
@@ -1,7 +0,0 @@
1TODO:
2 - checkpatch.pl cleanups
3 - remove dead and useless code (auditing the tty ioctls to
4 verify that they really are correct and needed.)
5
6Please send any patches to Greg Kroah-Hartman <greg@kroah.com> and
7Russell Lang <gsview@ghostgum.com.au>.
diff --git a/drivers/staging/uc2322/aten2011.c b/drivers/staging/uc2322/aten2011.c
deleted file mode 100644
index 39d0926d1a90..000000000000
--- a/drivers/staging/uc2322/aten2011.c
+++ /dev/null
@@ -1,2430 +0,0 @@
1/*
2 * Aten 2011 USB serial driver for 4 port devices
3 *
4 * Copyright (C) 2000 Inside Out Networks
5 * Copyright (C) 2001-2002, 2009 Greg Kroah-Hartman <greg@kroah.com>
6 * Copyright (C) 2009 Novell Inc.
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 as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 */
14
15#include <linux/kernel.h>
16#include <linux/errno.h>
17#include <linux/init.h>
18#include <linux/slab.h>
19#include <linux/tty.h>
20#include <linux/tty_driver.h>
21#include <linux/tty_flip.h>
22#include <linux/module.h>
23#include <linux/serial.h>
24#include <linux/uaccess.h>
25#include <linux/usb.h>
26#include <linux/usb/serial.h>
27
28
29#define ZLP_REG1 0x3A /* Zero_Flag_Reg1 58 */
30#define ZLP_REG2 0x3B /* Zero_Flag_Reg2 59 */
31#define ZLP_REG3 0x3C /* Zero_Flag_Reg3 60 */
32#define ZLP_REG4 0x3D /* Zero_Flag_Reg4 61 */
33#define ZLP_REG5 0x3E /* Zero_Flag_Reg5 62 */
34
35/* Interrupt Rotinue Defines */
36#define SERIAL_IIR_RLS 0x06
37#define SERIAL_IIR_RDA 0x04
38#define SERIAL_IIR_CTI 0x0c
39#define SERIAL_IIR_THR 0x02
40#define SERIAL_IIR_MS 0x00
41
42/* Emulation of the bit mask on the LINE STATUS REGISTER. */
43#define SERIAL_LSR_DR 0x0001
44#define SERIAL_LSR_OE 0x0002
45#define SERIAL_LSR_PE 0x0004
46#define SERIAL_LSR_FE 0x0008
47#define SERIAL_LSR_BI 0x0010
48#define SERIAL_LSR_THRE 0x0020
49#define SERIAL_LSR_TEMT 0x0040
50#define SERIAL_LSR_FIFOERR 0x0080
51
52/* MSR bit defines(place holders) */
53#define ATEN_MSR_DELTA_CTS 0x10
54#define ATEN_MSR_DELTA_DSR 0x20
55#define ATEN_MSR_DELTA_RI 0x40
56#define ATEN_MSR_DELTA_CD 0x80
57
58/* Serial Port register Address */
59#define RECEIVE_BUFFER_REGISTER ((__u16)(0x00))
60#define TRANSMIT_HOLDING_REGISTER ((__u16)(0x00))
61#define INTERRUPT_ENABLE_REGISTER ((__u16)(0x01))
62#define INTERRUPT_IDENT_REGISTER ((__u16)(0x02))
63#define FIFO_CONTROL_REGISTER ((__u16)(0x02))
64#define LINE_CONTROL_REGISTER ((__u16)(0x03))
65#define MODEM_CONTROL_REGISTER ((__u16)(0x04))
66#define LINE_STATUS_REGISTER ((__u16)(0x05))
67#define MODEM_STATUS_REGISTER ((__u16)(0x06))
68#define SCRATCH_PAD_REGISTER ((__u16)(0x07))
69#define DIVISOR_LATCH_LSB ((__u16)(0x00))
70#define DIVISOR_LATCH_MSB ((__u16)(0x01))
71
72#define SP1_REGISTER ((__u16)(0x00))
73#define CONTROL1_REGISTER ((__u16)(0x01))
74#define CLK_MULTI_REGISTER ((__u16)(0x02))
75#define CLK_START_VALUE_REGISTER ((__u16)(0x03))
76#define DCR1_REGISTER ((__u16)(0x04))
77#define GPIO_REGISTER ((__u16)(0x07))
78
79#define SERIAL_LCR_DLAB ((__u16)(0x0080))
80
81/*
82 * URB POOL related defines
83 */
84#define NUM_URBS 16 /* URB Count */
85#define URB_TRANSFER_BUFFER_SIZE 32 /* URB Size */
86
87#define USB_VENDOR_ID_ATENINTL 0x0557
88#define ATENINTL_DEVICE_ID_2011 0x2011
89#define ATENINTL_DEVICE_ID_7820 0x7820
90
91static struct usb_device_id id_table[] = {
92 { USB_DEVICE(USB_VENDOR_ID_ATENINTL, ATENINTL_DEVICE_ID_2011) },
93 { USB_DEVICE(USB_VENDOR_ID_ATENINTL, ATENINTL_DEVICE_ID_7820) },
94 { } /* terminating entry */
95};
96MODULE_DEVICE_TABLE(usb, id_table);
97
98/* This structure holds all of the local port information */
99struct ATENINTL_port {
100 int port_num; /*Actual port number in the device(1,2,etc)*/
101 __u8 bulk_out_endpoint; /* the bulk out endpoint handle */
102 unsigned char *bulk_out_buffer; /* buffer used for the bulk out endpoint */
103 struct urb *write_urb; /* write URB for this port */
104 __u8 bulk_in_endpoint; /* the bulk in endpoint handle */
105 unsigned char *bulk_in_buffer; /* the buffer we use for the bulk in endpoint */
106 struct urb *read_urb; /* read URB for this port */
107 __u8 shadowLCR; /* last LCR value received */
108 __u8 shadowMCR; /* last MCR value received */
109 char open;
110 char chaseResponsePending;
111 wait_queue_head_t wait_chase; /* for handling sleeping while waiting for chase to finish */
112 wait_queue_head_t wait_command; /* for handling sleeping while waiting for command to finish */
113 struct async_icount icount;
114 struct usb_serial_port *port; /* loop back to the owner of this object */
115 /*Offsets*/
116 __u8 SpRegOffset;
117 __u8 ControlRegOffset;
118 __u8 DcrRegOffset;
119 /* for processing control URBS in interrupt context */
120 struct urb *control_urb;
121 char *ctrl_buf;
122 int MsrLsr;
123
124 struct urb *write_urb_pool[NUM_URBS];
125 /* we pass a pointer to this as the arguement sent to cypress_set_termios old_termios */
126 struct ktermios tmp_termios; /* stores the old termios settings */
127 spinlock_t lock; /* private lock */
128};
129
130/* This structure holds all of the individual serial device information */
131struct ATENINTL_serial {
132 __u8 interrupt_in_endpoint; /* the interrupt endpoint handle */
133 unsigned char *interrupt_in_buffer; /* the buffer we use for the interrupt endpoint */
134 struct urb *interrupt_read_urb; /* our interrupt urb */
135 __u8 bulk_in_endpoint; /* the bulk in endpoint handle */
136 unsigned char *bulk_in_buffer; /* the buffer we use for the bulk in endpoint */
137 struct urb *read_urb; /* our bulk read urb */
138 __u8 bulk_out_endpoint; /* the bulk out endpoint handle */
139 struct usb_serial *serial; /* loop back to the owner of this object */
140 int ATEN2011_spectrum_2or4ports; /* this says the number of ports in the device */
141 /* Indicates about the no.of opened ports of an individual USB-serial adapater. */
142 unsigned int NoOfOpenPorts;
143 /* a flag for Status endpoint polling */
144 unsigned char status_polling_started;
145};
146
147static void ATEN2011_set_termios(struct tty_struct *tty,
148 struct usb_serial_port *port,
149 struct ktermios *old_termios);
150static void ATEN2011_change_port_settings(struct tty_struct *tty,
151 struct ATENINTL_port *ATEN2011_port,
152 struct ktermios *old_termios);
153
154/*************************************
155 * Bit definitions for each register *
156 *************************************/
157#define LCR_BITS_5 0x00 /* 5 bits/char */
158#define LCR_BITS_6 0x01 /* 6 bits/char */
159#define LCR_BITS_7 0x02 /* 7 bits/char */
160#define LCR_BITS_8 0x03 /* 8 bits/char */
161#define LCR_BITS_MASK 0x03 /* Mask for bits/char field */
162
163#define LCR_STOP_1 0x00 /* 1 stop bit */
164#define LCR_STOP_1_5 0x04 /* 1.5 stop bits (if 5 bits/char) */
165#define LCR_STOP_2 0x04 /* 2 stop bits (if 6-8 bits/char) */
166#define LCR_STOP_MASK 0x04 /* Mask for stop bits field */
167
168#define LCR_PAR_NONE 0x00 /* No parity */
169#define LCR_PAR_ODD 0x08 /* Odd parity */
170#define LCR_PAR_EVEN 0x18 /* Even parity */
171#define LCR_PAR_MARK 0x28 /* Force parity bit to 1 */
172#define LCR_PAR_SPACE 0x38 /* Force parity bit to 0 */
173#define LCR_PAR_MASK 0x38 /* Mask for parity field */
174
175#define LCR_SET_BREAK 0x40 /* Set Break condition */
176#define LCR_DL_ENABLE 0x80 /* Enable access to divisor latch */
177
178#define MCR_DTR 0x01 /* Assert DTR */
179#define MCR_RTS 0x02 /* Assert RTS */
180#define MCR_OUT1 0x04 /* Loopback only: Sets state of RI */
181#define MCR_MASTER_IE 0x08 /* Enable interrupt outputs */
182#define MCR_LOOPBACK 0x10 /* Set internal (digital) loopback mode */
183#define MCR_XON_ANY 0x20 /* Enable any char to exit XOFF mode */
184
185#define ATEN2011_MSR_CTS 0x10 /* Current state of CTS */
186#define ATEN2011_MSR_DSR 0x20 /* Current state of DSR */
187#define ATEN2011_MSR_RI 0x40 /* Current state of RI */
188#define ATEN2011_MSR_CD 0x80 /* Current state of CD */
189
190
191static int debug;
192
193/*
194 * Version Information
195 */
196#define DRIVER_VERSION "2.0"
197#define DRIVER_DESC "ATENINTL 2011 USB Serial Adapter"
198
199/*
200 * Defines used for sending commands to port
201 */
202
203#define ATEN_WDR_TIMEOUT (50) /* default urb timeout */
204
205/* Requests */
206#define ATEN_RD_RTYPE 0xC0
207#define ATEN_WR_RTYPE 0x40
208#define ATEN_RDREQ 0x0D
209#define ATEN_WRREQ 0x0E
210#define ATEN_CTRL_TIMEOUT 500
211#define VENDOR_READ_LENGTH (0x01)
212
213/* set to 1 for RS485 mode and 0 for RS232 mode */
214/* FIXME make this somehow dynamic and not build time specific */
215static int RS485mode;
216
217static int set_reg_sync(struct usb_serial_port *port, __u16 reg, __u16 val)
218{
219 struct usb_device *dev = port->serial->dev;
220 val = val & 0x00ff;
221
222 dbg("%s: is %x, value %x", __func__, reg, val);
223
224 return usb_control_msg(dev, usb_sndctrlpipe(dev, 0), ATEN_WRREQ,
225 ATEN_WR_RTYPE, val, reg, NULL, 0,
226 ATEN_WDR_TIMEOUT);
227}
228
229static int get_reg_sync(struct usb_serial_port *port, __u16 reg, __u16 *val)
230{
231 struct usb_device *dev = port->serial->dev;
232 int ret;
233
234 ret = usb_control_msg(dev, usb_rcvctrlpipe(dev, 0), ATEN_RDREQ,
235 ATEN_RD_RTYPE, 0, reg, val, VENDOR_READ_LENGTH,
236 ATEN_WDR_TIMEOUT);
237 dbg("%s: offset is %x, return val %x", __func__, reg, *val);
238 *val = (*val) & 0x00ff;
239 return ret;
240}
241
242static int set_uart_reg(struct usb_serial_port *port, __u16 reg, __u16 val)
243{
244 struct usb_device *dev = port->serial->dev;
245 struct ATENINTL_serial *a_serial;
246 __u16 minor;
247
248 a_serial = usb_get_serial_data(port->serial);
249 minor = port->serial->minor;
250 if (minor == SERIAL_TTY_NO_MINOR)
251 minor = 0;
252 val = val & 0x00ff;
253
254 /*
255 * For the UART control registers,
256 * the application number need to be Or'ed
257 */
258 if (a_serial->ATEN2011_spectrum_2or4ports == 4)
259 val |= (((__u16)port->number - minor) + 1) << 8;
260 else {
261 if (((__u16) port->number - minor) == 0)
262 val |= (((__u16)port->number - minor) + 1) << 8;
263 else
264 val |= (((__u16)port->number - minor) + 2) << 8;
265 }
266 dbg("%s: application number is %x", __func__, val);
267
268 return usb_control_msg(dev, usb_sndctrlpipe(dev, 0), ATEN_WRREQ,
269 ATEN_WR_RTYPE, val, reg, NULL, 0,
270 ATEN_WDR_TIMEOUT);
271}
272
273static int get_uart_reg(struct usb_serial_port *port, __u16 reg, __u16 *val)
274{
275 struct usb_device *dev = port->serial->dev;
276 int ret = 0;
277 __u16 wval;
278 struct ATENINTL_serial *a_serial;
279 __u16 minor = port->serial->minor;
280
281 a_serial = usb_get_serial_data(port->serial);
282 if (minor == SERIAL_TTY_NO_MINOR)
283 minor = 0;
284
285 /* wval is same as application number */
286 if (a_serial->ATEN2011_spectrum_2or4ports == 4)
287 wval = (((__u16)port->number - minor) + 1) << 8;
288 else {
289 if (((__u16) port->number - minor) == 0)
290 wval = (((__u16) port->number - minor) + 1) << 8;
291 else
292 wval = (((__u16) port->number - minor) + 2) << 8;
293 }
294 dbg("%s: application number is %x", __func__, wval);
295 ret = usb_control_msg(dev, usb_rcvctrlpipe(dev, 0), ATEN_RDREQ,
296 ATEN_RD_RTYPE, wval, reg, val, VENDOR_READ_LENGTH,
297 ATEN_WDR_TIMEOUT);
298 *val = (*val) & 0x00ff;
299 return ret;
300}
301
302static int handle_newMsr(struct ATENINTL_port *port, __u8 newMsr)
303{
304 struct ATENINTL_port *ATEN2011_port;
305 struct async_icount *icount;
306 ATEN2011_port = port;
307 icount = &ATEN2011_port->icount;
308 if (newMsr &
309 (ATEN_MSR_DELTA_CTS | ATEN_MSR_DELTA_DSR | ATEN_MSR_DELTA_RI |
310 ATEN_MSR_DELTA_CD)) {
311 icount = &ATEN2011_port->icount;
312
313 /* update input line counters */
314 if (newMsr & ATEN_MSR_DELTA_CTS)
315 icount->cts++;
316 if (newMsr & ATEN_MSR_DELTA_DSR)
317 icount->dsr++;
318 if (newMsr & ATEN_MSR_DELTA_CD)
319 icount->dcd++;
320 if (newMsr & ATEN_MSR_DELTA_RI)
321 icount->rng++;
322 }
323
324 return 0;
325}
326
327static int handle_newLsr(struct ATENINTL_port *port, __u8 newLsr)
328{
329 struct async_icount *icount;
330
331 dbg("%s - %02x", __func__, newLsr);
332
333 if (newLsr & SERIAL_LSR_BI) {
334 /*
335 * Parity and Framing errors only count if they occur exclusive
336 * of a break being received.
337 */
338 newLsr &= (__u8) (SERIAL_LSR_OE | SERIAL_LSR_BI);
339 }
340
341 /* update input line counters */
342 icount = &port->icount;
343 if (newLsr & SERIAL_LSR_BI)
344 icount->brk++;
345 if (newLsr & SERIAL_LSR_OE)
346 icount->overrun++;
347 if (newLsr & SERIAL_LSR_PE)
348 icount->parity++;
349 if (newLsr & SERIAL_LSR_FE)
350 icount->frame++;
351
352 return 0;
353}
354
355static void ATEN2011_control_callback(struct urb *urb)
356{
357 unsigned char *data;
358 struct ATENINTL_port *ATEN2011_port;
359 __u8 regval = 0x0;
360
361 switch (urb->status) {
362 case 0:
363 /* success */
364 break;
365 case -ECONNRESET:
366 case -ENOENT:
367 case -ESHUTDOWN:
368 /* this urb is terminated, clean up */
369 dbg("%s - urb shutting down with status: %d", __func__,
370 urb->status);
371 return;
372 default:
373 dbg("%s - nonzero urb status received: %d", __func__,
374 urb->status);
375 goto exit;
376 }
377
378 ATEN2011_port = (struct ATENINTL_port *)urb->context;
379
380 dbg("%s urb buffer size is %d", __func__, urb->actual_length);
381 dbg("%s ATEN2011_port->MsrLsr is %d port %d", __func__,
382 ATEN2011_port->MsrLsr, ATEN2011_port->port_num);
383 data = urb->transfer_buffer;
384 regval = (__u8) data[0];
385 dbg("%s data is %x", __func__, regval);
386 if (ATEN2011_port->MsrLsr == 0)
387 handle_newMsr(ATEN2011_port, regval);
388 else if (ATEN2011_port->MsrLsr == 1)
389 handle_newLsr(ATEN2011_port, regval);
390
391exit:
392 return;
393}
394
395static int ATEN2011_get_reg(struct ATENINTL_port *ATEN, __u16 Wval, __u16 reg,
396 __u16 *val)
397{
398 struct usb_device *dev = ATEN->port->serial->dev;
399 struct usb_ctrlrequest *dr = NULL;
400 unsigned char *buffer = NULL;
401 int ret = 0;
402 buffer = (__u8 *) ATEN->ctrl_buf;
403
404 dr = (void *)(buffer + 2);
405 dr->bRequestType = ATEN_RD_RTYPE;
406 dr->bRequest = ATEN_RDREQ;
407 dr->wValue = cpu_to_le16(Wval);
408 dr->wIndex = cpu_to_le16(reg);
409 dr->wLength = cpu_to_le16(2);
410
411 usb_fill_control_urb(ATEN->control_urb, dev, usb_rcvctrlpipe(dev, 0),
412 (unsigned char *)dr, buffer, 2,
413 ATEN2011_control_callback, ATEN);
414 ATEN->control_urb->transfer_buffer_length = 2;
415 ret = usb_submit_urb(ATEN->control_urb, GFP_ATOMIC);
416 return ret;
417}
418
419static void ATEN2011_interrupt_callback(struct urb *urb)
420{
421 int result;
422 int length;
423 struct ATENINTL_port *ATEN2011_port;
424 struct ATENINTL_serial *ATEN2011_serial;
425 struct usb_serial *serial;
426 __u16 Data;
427 unsigned char *data;
428 __u8 sp[5], st;
429 int i;
430 __u16 wval;
431 int minor;
432
433 dbg("%s", " : Entering");
434
435 ATEN2011_serial = (struct ATENINTL_serial *)urb->context;
436
437 switch (urb->status) {
438 case 0:
439 /* success */
440 break;
441 case -ECONNRESET:
442 case -ENOENT:
443 case -ESHUTDOWN:
444 /* this urb is terminated, clean up */
445 dbg("%s - urb shutting down with status: %d", __func__,
446 urb->status);
447 return;
448 default:
449 dbg("%s - nonzero urb status received: %d", __func__,
450 urb->status);
451 goto exit;
452 }
453 length = urb->actual_length;
454 data = urb->transfer_buffer;
455
456 serial = ATEN2011_serial->serial;
457
458 /* ATENINTL get 5 bytes
459 * Byte 1 IIR Port 1 (port.number is 0)
460 * Byte 2 IIR Port 2 (port.number is 1)
461 * Byte 3 IIR Port 3 (port.number is 2)
462 * Byte 4 IIR Port 4 (port.number is 3)
463 * Byte 5 FIFO status for both */
464
465 if (length && length > 5) {
466 dbg("%s", "Wrong data !!!");
467 return;
468 }
469
470 /* MATRIX */
471 if (ATEN2011_serial->ATEN2011_spectrum_2or4ports == 4) {
472 sp[0] = (__u8) data[0];
473 sp[1] = (__u8) data[1];
474 sp[2] = (__u8) data[2];
475 sp[3] = (__u8) data[3];
476 st = (__u8) data[4];
477 } else {
478 sp[0] = (__u8) data[0];
479 sp[1] = (__u8) data[2];
480 /* sp[2]=(__u8)data[2]; */
481 /* sp[3]=(__u8)data[3]; */
482 st = (__u8) data[4];
483
484 }
485 for (i = 0; i < serial->num_ports; i++) {
486 ATEN2011_port = usb_get_serial_port_data(serial->port[i]);
487 minor = serial->minor;
488 if (minor == SERIAL_TTY_NO_MINOR)
489 minor = 0;
490 if ((ATEN2011_serial->ATEN2011_spectrum_2or4ports == 2)
491 && (i != 0))
492 wval =
493 (((__u16) serial->port[i]->number -
494 (__u16) (minor)) + 2) << 8;
495 else
496 wval =
497 (((__u16) serial->port[i]->number -
498 (__u16) (minor)) + 1) << 8;
499 if (ATEN2011_port->open != 0) {
500 if (sp[i] & 0x01) {
501 dbg("SP%d No Interrupt !!!", i);
502 } else {
503 switch (sp[i] & 0x0f) {
504 case SERIAL_IIR_RLS:
505 dbg("Serial Port %d: Receiver status error or address bit detected in 9-bit mode", i);
506 ATEN2011_port->MsrLsr = 1;
507 ATEN2011_get_reg(ATEN2011_port, wval,
508 LINE_STATUS_REGISTER,
509 &Data);
510 break;
511 case SERIAL_IIR_MS:
512 dbg("Serial Port %d: Modem status change", i);
513 ATEN2011_port->MsrLsr = 0;
514 ATEN2011_get_reg(ATEN2011_port, wval,
515 MODEM_STATUS_REGISTER,
516 &Data);
517 break;
518 }
519 }
520 }
521
522 }
523exit:
524 if (ATEN2011_serial->status_polling_started == 0)
525 return;
526
527 result = usb_submit_urb(urb, GFP_ATOMIC);
528 if (result) {
529 dev_err(&urb->dev->dev,
530 "%s - Error %d submitting interrupt urb\n",
531 __func__, result);
532 }
533
534 return;
535}
536
537static void ATEN2011_bulk_in_callback(struct urb *urb)
538{
539 int status;
540 unsigned char *data;
541 struct usb_serial *serial;
542 struct usb_serial_port *port;
543 struct ATENINTL_serial *ATEN2011_serial;
544 struct ATENINTL_port *ATEN2011_port;
545 struct tty_struct *tty;
546
547 if (urb->status) {
548 dbg("nonzero read bulk status received: %d", urb->status);
549 return;
550 }
551
552 ATEN2011_port = (struct ATENINTL_port *)urb->context;
553
554 port = (struct usb_serial_port *)ATEN2011_port->port;
555 serial = port->serial;
556
557 dbg("%s", "Entering...");
558
559 data = urb->transfer_buffer;
560 ATEN2011_serial = usb_get_serial_data(serial);
561
562 if (urb->actual_length) {
563 tty = tty_port_tty_get(&ATEN2011_port->port->port);
564 if (tty) {
565 tty_buffer_request_room(tty, urb->actual_length);
566 tty_insert_flip_string(tty, data, urb->actual_length);
567 tty_flip_buffer_push(tty);
568 tty_kref_put(tty);
569 }
570
571 ATEN2011_port->icount.rx += urb->actual_length;
572 dbg("ATEN2011_port->icount.rx is %d:",
573 ATEN2011_port->icount.rx);
574 }
575
576 if (!ATEN2011_port->read_urb) {
577 dbg("%s", "URB KILLED !!!");
578 return;
579 }
580
581 if (ATEN2011_port->read_urb->status != -EINPROGRESS) {
582 ATEN2011_port->read_urb->dev = serial->dev;
583
584 status = usb_submit_urb(ATEN2011_port->read_urb, GFP_ATOMIC);
585 if (status)
586 dbg("usb_submit_urb(read bulk) failed, status = %d", status);
587 }
588}
589
590static void ATEN2011_bulk_out_data_callback(struct urb *urb)
591{
592 struct ATENINTL_port *ATEN2011_port;
593 struct tty_struct *tty;
594
595 if (urb->status) {
596 dbg("nonzero write bulk status received:%d", urb->status);
597 return;
598 }
599
600 ATEN2011_port = (struct ATENINTL_port *)urb->context;
601
602 dbg("%s", "Entering .........");
603
604 tty = tty_port_tty_get(&ATEN2011_port->port->port);
605
606 if (tty && ATEN2011_port->open)
607 /* tell the tty driver that something has changed */
608 tty_wakeup(tty);
609
610 /* schedule_work(&ATEN2011_port->port->work); */
611 tty_kref_put(tty);
612
613}
614
615#ifdef ATENSerialProbe
616static int ATEN2011_serial_probe(struct usb_serial *serial,
617 const struct usb_device_id *id)
618{
619
620 /*need to implement the mode_reg reading and updating\
621 structures usb_serial_ device_type\
622 (i.e num_ports, num_bulkin,bulkout etc) */
623 /* Also we can update the changes attach */
624 return 1;
625}
626#endif
627
628static int ATEN2011_open(struct tty_struct *tty, struct usb_serial_port *port,
629 struct file *filp)
630{
631 int response;
632 int j;
633 struct usb_serial *serial;
634 struct urb *urb;
635 __u16 Data;
636 int status;
637 struct ATENINTL_serial *ATEN2011_serial;
638 struct ATENINTL_port *ATEN2011_port;
639 struct ktermios tmp_termios;
640 int minor;
641
642 serial = port->serial;
643
644 ATEN2011_port = usb_get_serial_port_data(port);
645
646 if (ATEN2011_port == NULL)
647 return -ENODEV;
648
649 ATEN2011_serial = usb_get_serial_data(serial);
650 if (ATEN2011_serial == NULL)
651 return -ENODEV;
652
653 /* increment the number of opened ports counter here */
654 ATEN2011_serial->NoOfOpenPorts++;
655
656 usb_clear_halt(serial->dev, port->write_urb->pipe);
657 usb_clear_halt(serial->dev, port->read_urb->pipe);
658
659 /* Initialising the write urb pool */
660 for (j = 0; j < NUM_URBS; ++j) {
661 urb = usb_alloc_urb(0, GFP_ATOMIC);
662 ATEN2011_port->write_urb_pool[j] = urb;
663
664 if (urb == NULL) {
665 err("No more urbs???");
666 continue;
667 }
668
669 urb->transfer_buffer = NULL;
670 urb->transfer_buffer =
671 kmalloc(URB_TRANSFER_BUFFER_SIZE, GFP_KERNEL);
672 if (!urb->transfer_buffer) {
673 err("%s-out of memory for urb buffers.", __func__);
674 continue;
675 }
676 }
677
678/*****************************************************************************
679 * Initialize ATEN2011 -- Write Init values to corresponding Registers
680 *
681 * Register Index
682 * 1 : IER
683 * 2 : FCR
684 * 3 : LCR
685 * 4 : MCR
686 *
687 * 0x08 : SP1/2 Control Reg
688 *****************************************************************************/
689
690/* NEED to check the fallowing Block */
691
692 Data = 0x0;
693 status = get_reg_sync(port, ATEN2011_port->SpRegOffset, &Data);
694 if (status < 0) {
695 dbg("Reading Spreg failed");
696 return -1;
697 }
698 Data |= 0x80;
699 status = set_reg_sync(port, ATEN2011_port->SpRegOffset, Data);
700 if (status < 0) {
701 dbg("writing Spreg failed");
702 return -1;
703 }
704
705 Data &= ~0x80;
706 status = set_reg_sync(port, ATEN2011_port->SpRegOffset, Data);
707 if (status < 0) {
708 dbg("writing Spreg failed");
709 return -1;
710 }
711
712/* End of block to be checked */
713/**************************CHECK***************************/
714
715 if (RS485mode == 0)
716 Data = 0xC0;
717 else
718 Data = 0x00;
719 status = set_uart_reg(port, SCRATCH_PAD_REGISTER, Data);
720 if (status < 0) {
721 dbg("Writing SCRATCH_PAD_REGISTER failed status-0x%x", status);
722 return -1;
723 } else
724 dbg("SCRATCH_PAD_REGISTER Writing success status%d", status);
725
726/**************************CHECK***************************/
727
728 Data = 0x0;
729 status = get_reg_sync(port, ATEN2011_port->ControlRegOffset, &Data);
730 if (status < 0) {
731 dbg("Reading Controlreg failed");
732 return -1;
733 }
734 Data |= 0x08; /* Driver done bit */
735 Data |= 0x20; /* rx_disable */
736 status = 0;
737 status =
738 set_reg_sync(port, ATEN2011_port->ControlRegOffset, Data);
739 if (status < 0) {
740 dbg("writing Controlreg failed");
741 return -1;
742 }
743 /*
744 * do register settings here
745 * Set all regs to the device default values.
746 * First Disable all interrupts.
747 */
748
749 Data = 0x00;
750 status = set_uart_reg(port, INTERRUPT_ENABLE_REGISTER, Data);
751 if (status < 0) {
752 dbg("disableing interrupts failed");
753 return -1;
754 }
755 /* Set FIFO_CONTROL_REGISTER to the default value */
756 Data = 0x00;
757 status = set_uart_reg(port, FIFO_CONTROL_REGISTER, Data);
758 if (status < 0) {
759 dbg("Writing FIFO_CONTROL_REGISTER failed");
760 return -1;
761 }
762
763 Data = 0xcf; /* chk */
764 status = set_uart_reg(port, FIFO_CONTROL_REGISTER, Data);
765 if (status < 0) {
766 dbg("Writing FIFO_CONTROL_REGISTER failed");
767 return -1;
768 }
769
770 Data = 0x03; /* LCR_BITS_8 */
771 status = set_uart_reg(port, LINE_CONTROL_REGISTER, Data);
772 ATEN2011_port->shadowLCR = Data;
773
774 Data = 0x0b; /* MCR_DTR|MCR_RTS|MCR_MASTER_IE */
775 status = set_uart_reg(port, MODEM_CONTROL_REGISTER, Data);
776 ATEN2011_port->shadowMCR = Data;
777
778#ifdef Check
779 Data = 0x00;
780 status = get_uart_reg(port, LINE_CONTROL_REGISTER, &Data);
781 ATEN2011_port->shadowLCR = Data;
782
783 Data |= SERIAL_LCR_DLAB; /* data latch enable in LCR 0x80 */
784 status = set_uart_reg(port, LINE_CONTROL_REGISTER, Data);
785
786 Data = 0x0c;
787 status = set_uart_reg(port, DIVISOR_LATCH_LSB, Data);
788
789 Data = 0x0;
790 status = set_uart_reg(port, DIVISOR_LATCH_MSB, Data);
791
792 Data = 0x00;
793 status = get_uart_reg(port, LINE_CONTROL_REGISTER, &Data);
794
795/* Data = ATEN2011_port->shadowLCR; */ /* data latch disable */
796 Data = Data & ~SERIAL_LCR_DLAB;
797 status = set_uart_reg(port, LINE_CONTROL_REGISTER, Data);
798 ATEN2011_port->shadowLCR = Data;
799#endif
800 /* clearing Bulkin and Bulkout Fifo */
801 Data = 0x0;
802 status = get_reg_sync(port, ATEN2011_port->SpRegOffset, &Data);
803
804 Data = Data | 0x0c;
805 status = set_reg_sync(port, ATEN2011_port->SpRegOffset, Data);
806
807 Data = Data & ~0x0c;
808 status = set_reg_sync(port, ATEN2011_port->SpRegOffset, Data);
809 /* Finally enable all interrupts */
810 Data = 0x0;
811 Data = 0x0c;
812 status = set_uart_reg(port, INTERRUPT_ENABLE_REGISTER, Data);
813
814 /* clearing rx_disable */
815 Data = 0x0;
816 status = get_reg_sync(port, ATEN2011_port->ControlRegOffset, &Data);
817 Data = Data & ~0x20;
818 status = set_reg_sync(port, ATEN2011_port->ControlRegOffset, Data);
819
820 /* rx_negate */
821 Data = 0x0;
822 status = get_reg_sync(port, ATEN2011_port->ControlRegOffset, &Data);
823 Data = Data | 0x10;
824 status = 0;
825 status = set_reg_sync(port, ATEN2011_port->ControlRegOffset, Data);
826
827 /*
828 * Check to see if we've set up our endpoint info yet
829 * (can't set it up in ATEN2011_startup as the structures
830 * were not set up at that time.)
831 */
832 if (ATEN2011_serial->NoOfOpenPorts == 1) {
833 /* start the status polling here */
834 ATEN2011_serial->status_polling_started = 1;
835 /* If not yet set, Set here */
836 ATEN2011_serial->interrupt_in_buffer =
837 serial->port[0]->interrupt_in_buffer;
838 ATEN2011_serial->interrupt_in_endpoint =
839 serial->port[0]->interrupt_in_endpointAddress;
840 ATEN2011_serial->interrupt_read_urb =
841 serial->port[0]->interrupt_in_urb;
842
843 /* set up interrupt urb */
844 usb_fill_int_urb(ATEN2011_serial->interrupt_read_urb,
845 serial->dev,
846 usb_rcvintpipe(serial->dev,
847 ATEN2011_serial->
848 interrupt_in_endpoint),
849 ATEN2011_serial->interrupt_in_buffer,
850 ATEN2011_serial->interrupt_read_urb->
851 transfer_buffer_length,
852 ATEN2011_interrupt_callback, ATEN2011_serial,
853 ATEN2011_serial->interrupt_read_urb->interval);
854
855 /* start interrupt read for ATEN2011 *
856 * will continue as long as ATEN2011 is connected */
857
858 response =
859 usb_submit_urb(ATEN2011_serial->interrupt_read_urb,
860 GFP_KERNEL);
861 if (response) {
862 dbg("%s - Error %d submitting interrupt urb",
863 __func__, response);
864 }
865
866 }
867
868 /*
869 * See if we've set up our endpoint info yet
870 * (can't set it up in ATEN2011_startup as the
871 * structures were not set up at that time.)
872 */
873
874 dbg("port number is %d", port->number);
875 dbg("serial number is %d", port->serial->minor);
876 dbg("Bulkin endpoint is %d", port->bulk_in_endpointAddress);
877 dbg("BulkOut endpoint is %d", port->bulk_out_endpointAddress);
878 dbg("Interrupt endpoint is %d",
879 port->interrupt_in_endpointAddress);
880 dbg("port's number in the device is %d", ATEN2011_port->port_num);
881 ATEN2011_port->bulk_in_buffer = port->bulk_in_buffer;
882 ATEN2011_port->bulk_in_endpoint = port->bulk_in_endpointAddress;
883 ATEN2011_port->read_urb = port->read_urb;
884 ATEN2011_port->bulk_out_endpoint = port->bulk_out_endpointAddress;
885
886 minor = port->serial->minor;
887 if (minor == SERIAL_TTY_NO_MINOR)
888 minor = 0;
889
890 /* set up our bulk in urb */
891 if ((ATEN2011_serial->ATEN2011_spectrum_2or4ports == 2)
892 && (((__u16) port->number - (__u16) (minor)) != 0)) {
893 usb_fill_bulk_urb(ATEN2011_port->read_urb, serial->dev,
894 usb_rcvbulkpipe(serial->dev,
895 (port->
896 bulk_in_endpointAddress +
897 2)), port->bulk_in_buffer,
898 ATEN2011_port->read_urb->
899 transfer_buffer_length,
900 ATEN2011_bulk_in_callback, ATEN2011_port);
901 } else
902 usb_fill_bulk_urb(ATEN2011_port->read_urb,
903 serial->dev,
904 usb_rcvbulkpipe(serial->dev,
905 port->
906 bulk_in_endpointAddress),
907 port->bulk_in_buffer,
908 ATEN2011_port->read_urb->
909 transfer_buffer_length,
910 ATEN2011_bulk_in_callback, ATEN2011_port);
911
912 dbg("ATEN2011_open: bulkin endpoint is %d",
913 port->bulk_in_endpointAddress);
914 response = usb_submit_urb(ATEN2011_port->read_urb, GFP_KERNEL);
915 if (response) {
916 err("%s - Error %d submitting control urb", __func__,
917 response);
918 }
919
920 /* initialize our wait queues */
921 init_waitqueue_head(&ATEN2011_port->wait_chase);
922 init_waitqueue_head(&ATEN2011_port->wait_command);
923
924 /* initialize our icount structure */
925 memset(&(ATEN2011_port->icount), 0x00, sizeof(ATEN2011_port->icount));
926
927 /* initialize our port settings */
928 ATEN2011_port->shadowMCR = MCR_MASTER_IE; /* Must set to enable ints! */
929 ATEN2011_port->chaseResponsePending = 0;
930 /* send a open port command */
931 ATEN2011_port->open = 1;
932 /* ATEN2011_change_port_settings(ATEN2011_port,old_termios); */
933 /* Setup termios */
934 ATEN2011_set_termios(tty, port, &tmp_termios);
935 ATEN2011_port->icount.tx = 0;
936 ATEN2011_port->icount.rx = 0;
937
938 dbg("usb_serial serial:%x ATEN2011_port:%x\nATEN2011_serial:%x usb_serial_port port:%x",
939 (unsigned int)serial, (unsigned int)ATEN2011_port,
940 (unsigned int)ATEN2011_serial, (unsigned int)port);
941
942 return 0;
943
944}
945
946static int ATEN2011_chars_in_buffer(struct tty_struct *tty)
947{
948 struct usb_serial_port *port = tty->driver_data;
949 int i;
950 int chars = 0;
951 struct ATENINTL_port *ATEN2011_port;
952
953 /* dbg("%s"," ATEN2011_chars_in_buffer:entering ..........."); */
954
955 ATEN2011_port = usb_get_serial_port_data(port);
956 if (ATEN2011_port == NULL) {
957 dbg("%s", "ATEN2011_break:leaving ...........");
958 return -1;
959 }
960
961 for (i = 0; i < NUM_URBS; ++i)
962 if (ATEN2011_port->write_urb_pool[i]->status == -EINPROGRESS)
963 chars += URB_TRANSFER_BUFFER_SIZE;
964
965 dbg("%s - returns %d", __func__, chars);
966 return chars;
967
968}
969
970static void ATEN2011_block_until_tx_empty(struct tty_struct *tty,
971 struct ATENINTL_port *ATEN2011_port)
972{
973 int timeout = HZ / 10;
974 int wait = 30;
975 int count;
976
977 while (1) {
978 count = ATEN2011_chars_in_buffer(tty);
979
980 /* Check for Buffer status */
981 if (count <= 0)
982 return;
983
984 /* Block the thread for a while */
985 interruptible_sleep_on_timeout(&ATEN2011_port->wait_chase,
986 timeout);
987
988 /* No activity.. count down section */
989 wait--;
990 if (wait == 0) {
991 dbg("%s - TIMEOUT", __func__);
992 return;
993 } else {
994 /* Reset timout value back to seconds */
995 wait = 30;
996 }
997 }
998}
999
1000static void ATEN2011_close(struct tty_struct *tty, struct usb_serial_port *port,
1001 struct file *filp)
1002{
1003 struct usb_serial *serial;
1004 struct ATENINTL_serial *ATEN2011_serial;
1005 struct ATENINTL_port *ATEN2011_port;
1006 int no_urbs;
1007 __u16 Data;
1008
1009 dbg("%s", "ATEN2011_close:entering...");
1010 serial = port->serial;
1011
1012 /* take the Adpater and port's private data */
1013 ATEN2011_serial = usb_get_serial_data(serial);
1014 ATEN2011_port = usb_get_serial_port_data(port);
1015 if ((ATEN2011_serial == NULL) || (ATEN2011_port == NULL))
1016 return;
1017
1018 if (serial->dev) {
1019 /* flush and block(wait) until tx is empty */
1020 ATEN2011_block_until_tx_empty(tty, ATEN2011_port);
1021 }
1022 /* kill the ports URB's */
1023 for (no_urbs = 0; no_urbs < NUM_URBS; no_urbs++)
1024 usb_kill_urb(ATEN2011_port->write_urb_pool[no_urbs]);
1025 /* Freeing Write URBs */
1026 for (no_urbs = 0; no_urbs < NUM_URBS; ++no_urbs) {
1027 kfree(ATEN2011_port->write_urb_pool[no_urbs]->transfer_buffer);
1028 usb_free_urb(ATEN2011_port->write_urb_pool[no_urbs]);
1029 }
1030 /* While closing port, shutdown all bulk read, write *
1031 * and interrupt read if they exists */
1032 if (serial->dev) {
1033 if (ATEN2011_port->write_urb) {
1034 dbg("%s", "Shutdown bulk write");
1035 usb_kill_urb(ATEN2011_port->write_urb);
1036 }
1037 if (ATEN2011_port->read_urb) {
1038 dbg("%s", "Shutdown bulk read");
1039 usb_kill_urb(ATEN2011_port->read_urb);
1040 }
1041 if ((&ATEN2011_port->control_urb)) {
1042 dbg("%s", "Shutdown control read");
1043 /* usb_kill_urb (ATEN2011_port->control_urb); */
1044
1045 }
1046 }
1047 /* if(ATEN2011_port->ctrl_buf != NULL) */
1048 /* kfree(ATEN2011_port->ctrl_buf); */
1049 /* decrement the no.of open ports counter of an individual USB-serial adapter. */
1050 ATEN2011_serial->NoOfOpenPorts--;
1051 dbg("NoOfOpenPorts in close%d:in port%d",
1052 ATEN2011_serial->NoOfOpenPorts, port->number);
1053 if (ATEN2011_serial->NoOfOpenPorts == 0) {
1054 /* stop the stus polling here */
1055 ATEN2011_serial->status_polling_started = 0;
1056 if (ATEN2011_serial->interrupt_read_urb) {
1057 dbg("%s", "Shutdown interrupt_read_urb");
1058 /* ATEN2011_serial->interrupt_in_buffer=NULL; */
1059 /* usb_kill_urb (ATEN2011_serial->interrupt_read_urb); */
1060 }
1061 }
1062 if (ATEN2011_port->write_urb) {
1063 /* if this urb had a transfer buffer already (old tx) free it */
1064 kfree(ATEN2011_port->write_urb->transfer_buffer);
1065 usb_free_urb(ATEN2011_port->write_urb);
1066 }
1067
1068 /* clear the MCR & IER */
1069 Data = 0x00;
1070 set_uart_reg(port, MODEM_CONTROL_REGISTER, Data);
1071 Data = 0x00;
1072 set_uart_reg(port, INTERRUPT_ENABLE_REGISTER, Data);
1073
1074 ATEN2011_port->open = 0;
1075 dbg("%s", "Leaving ............");
1076
1077}
1078
1079static void ATEN2011_block_until_chase_response(struct tty_struct *tty,
1080 struct ATENINTL_port
1081 *ATEN2011_port)
1082{
1083 int timeout = 1 * HZ;
1084 int wait = 10;
1085 int count;
1086
1087 while (1) {
1088 count = ATEN2011_chars_in_buffer(tty);
1089
1090 /* Check for Buffer status */
1091 if (count <= 0) {
1092 ATEN2011_port->chaseResponsePending = 0;
1093 return;
1094 }
1095
1096 /* Block the thread for a while */
1097 interruptible_sleep_on_timeout(&ATEN2011_port->wait_chase,
1098 timeout);
1099 /* No activity.. count down section */
1100 wait--;
1101 if (wait == 0) {
1102 dbg("%s - TIMEOUT", __func__);
1103 return;
1104 } else {
1105 /* Reset timout value back to seconds */
1106 wait = 10;
1107 }
1108 }
1109
1110}
1111
1112static void ATEN2011_break(struct tty_struct *tty, int break_state)
1113{
1114 struct usb_serial_port *port = tty->driver_data;
1115 unsigned char data;
1116 struct usb_serial *serial;
1117 struct ATENINTL_serial *ATEN2011_serial;
1118 struct ATENINTL_port *ATEN2011_port;
1119
1120 dbg("%s", "Entering ...........");
1121 dbg("ATEN2011_break: Start");
1122
1123 serial = port->serial;
1124
1125 ATEN2011_serial = usb_get_serial_data(serial);
1126 ATEN2011_port = usb_get_serial_port_data(port);
1127
1128 if ((ATEN2011_serial == NULL) || (ATEN2011_port == NULL))
1129 return;
1130
1131 /* flush and chase */
1132 ATEN2011_port->chaseResponsePending = 1;
1133
1134 if (serial->dev) {
1135 /* flush and block until tx is empty */
1136 ATEN2011_block_until_chase_response(tty, ATEN2011_port);
1137 }
1138
1139 if (break_state == -1)
1140 data = ATEN2011_port->shadowLCR | LCR_SET_BREAK;
1141 else
1142 data = ATEN2011_port->shadowLCR & ~LCR_SET_BREAK;
1143
1144 ATEN2011_port->shadowLCR = data;
1145 dbg("ATEN2011_break ATEN2011_port->shadowLCR is %x",
1146 ATEN2011_port->shadowLCR);
1147 set_uart_reg(port, LINE_CONTROL_REGISTER, ATEN2011_port->shadowLCR);
1148
1149 return;
1150}
1151
1152static int ATEN2011_write_room(struct tty_struct *tty)
1153{
1154 struct usb_serial_port *port = tty->driver_data;
1155 int i;
1156 int room = 0;
1157 struct ATENINTL_port *ATEN2011_port;
1158
1159 ATEN2011_port = usb_get_serial_port_data(port);
1160 if (ATEN2011_port == NULL) {
1161 dbg("%s", "ATEN2011_break:leaving ...........");
1162 return -1;
1163 }
1164
1165 for (i = 0; i < NUM_URBS; ++i)
1166 if (ATEN2011_port->write_urb_pool[i]->status != -EINPROGRESS)
1167 room += URB_TRANSFER_BUFFER_SIZE;
1168
1169 dbg("%s - returns %d", __func__, room);
1170 return room;
1171
1172}
1173
1174static int ATEN2011_write(struct tty_struct *tty, struct usb_serial_port *port,
1175 const unsigned char *data, int count)
1176{
1177 int status;
1178 int i;
1179 int bytes_sent = 0;
1180 int transfer_size;
1181 int minor;
1182
1183 struct ATENINTL_port *ATEN2011_port;
1184 struct usb_serial *serial;
1185 struct ATENINTL_serial *ATEN2011_serial;
1186 struct urb *urb;
1187 const unsigned char *current_position = data;
1188 unsigned char *data1;
1189 dbg("%s", "entering ...........");
1190
1191 serial = port->serial;
1192
1193 ATEN2011_port = usb_get_serial_port_data(port);
1194 if (ATEN2011_port == NULL) {
1195 dbg("%s", "ATEN2011_port is NULL");
1196 return -1;
1197 }
1198
1199 ATEN2011_serial = usb_get_serial_data(serial);
1200 if (ATEN2011_serial == NULL) {
1201 dbg("%s", "ATEN2011_serial is NULL");
1202 return -1;
1203 }
1204
1205 /* try to find a free urb in the list */
1206 urb = NULL;
1207
1208 for (i = 0; i < NUM_URBS; ++i) {
1209 if (ATEN2011_port->write_urb_pool[i]->status != -EINPROGRESS) {
1210 urb = ATEN2011_port->write_urb_pool[i];
1211 dbg("URB:%d", i);
1212 break;
1213 }
1214 }
1215
1216 if (urb == NULL) {
1217 dbg("%s - no more free urbs", __func__);
1218 goto exit;
1219 }
1220
1221 if (urb->transfer_buffer == NULL) {
1222 urb->transfer_buffer =
1223 kmalloc(URB_TRANSFER_BUFFER_SIZE, GFP_KERNEL);
1224
1225 if (urb->transfer_buffer == NULL) {
1226 err("%s no more kernel memory...", __func__);
1227 goto exit;
1228 }
1229 }
1230 transfer_size = min(count, URB_TRANSFER_BUFFER_SIZE);
1231
1232 memcpy(urb->transfer_buffer, current_position, transfer_size);
1233 /* usb_serial_debug_data (__FILE__, __func__, transfer_size, urb->transfer_buffer); */
1234
1235 /* fill urb with data and submit */
1236 minor = port->serial->minor;
1237 if (minor == SERIAL_TTY_NO_MINOR)
1238 minor = 0;
1239 if ((ATEN2011_serial->ATEN2011_spectrum_2or4ports == 2)
1240 && (((__u16) port->number - (__u16) (minor)) != 0)) {
1241 usb_fill_bulk_urb(urb, ATEN2011_serial->serial->dev,
1242 usb_sndbulkpipe(ATEN2011_serial->serial->dev,
1243 (port->
1244 bulk_out_endpointAddress) +
1245 2), urb->transfer_buffer,
1246 transfer_size,
1247 ATEN2011_bulk_out_data_callback,
1248 ATEN2011_port);
1249 } else
1250
1251 usb_fill_bulk_urb(urb,
1252 ATEN2011_serial->serial->dev,
1253 usb_sndbulkpipe(ATEN2011_serial->serial->dev,
1254 port->
1255 bulk_out_endpointAddress),
1256 urb->transfer_buffer, transfer_size,
1257 ATEN2011_bulk_out_data_callback,
1258 ATEN2011_port);
1259
1260 data1 = urb->transfer_buffer;
1261 dbg("bulkout endpoint is %d", port->bulk_out_endpointAddress);
1262 /* for(i=0;i < urb->actual_length;i++) */
1263 /* dbg("Data is %c ",data1[i]); */
1264
1265 /* send it down the pipe */
1266 status = usb_submit_urb(urb, GFP_ATOMIC);
1267
1268 if (status) {
1269 err("%s - usb_submit_urb(write bulk) failed with status = %d",
1270 __func__, status);
1271 bytes_sent = status;
1272 goto exit;
1273 }
1274 bytes_sent = transfer_size;
1275 ATEN2011_port->icount.tx += transfer_size;
1276 dbg("ATEN2011_port->icount.tx is %d:", ATEN2011_port->icount.tx);
1277
1278exit:
1279 return bytes_sent;
1280}
1281
1282static void ATEN2011_throttle(struct tty_struct *tty)
1283{
1284 struct usb_serial_port *port = tty->driver_data;
1285 struct ATENINTL_port *ATEN2011_port;
1286 int status;
1287
1288 dbg("- port %d", port->number);
1289
1290 ATEN2011_port = usb_get_serial_port_data(port);
1291
1292 if (ATEN2011_port == NULL)
1293 return;
1294
1295 if (!ATEN2011_port->open) {
1296 dbg("%s", "port not opened");
1297 return;
1298 }
1299
1300 dbg("%s", "Entering .......... ");
1301
1302 if (!tty) {
1303 dbg("%s - no tty available", __func__);
1304 return;
1305 }
1306
1307 /* if we are implementing XON/XOFF, send the stop character */
1308 if (I_IXOFF(tty)) {
1309 unsigned char stop_char = STOP_CHAR(tty);
1310 status = ATEN2011_write(tty, port, &stop_char, 1);
1311 if (status <= 0)
1312 return;
1313 }
1314
1315 /* if we are implementing RTS/CTS, toggle that line */
1316 if (tty->termios->c_cflag & CRTSCTS) {
1317 ATEN2011_port->shadowMCR &= ~MCR_RTS;
1318 status = set_uart_reg(port, MODEM_CONTROL_REGISTER,
1319 ATEN2011_port->shadowMCR);
1320 if (status < 0)
1321 return;
1322 }
1323
1324 return;
1325}
1326
1327static void ATEN2011_unthrottle(struct tty_struct *tty)
1328{
1329 struct usb_serial_port *port = tty->driver_data;
1330 int status;
1331 struct ATENINTL_port *ATEN2011_port = usb_get_serial_port_data(port);
1332
1333 if (ATEN2011_port == NULL)
1334 return;
1335
1336 if (!ATEN2011_port->open) {
1337 dbg("%s - port not opened", __func__);
1338 return;
1339 }
1340
1341 dbg("%s", "Entering .......... ");
1342
1343 if (!tty) {
1344 dbg("%s - no tty available", __func__);
1345 return;
1346 }
1347
1348 /* if we are implementing XON/XOFF, send the start character */
1349 if (I_IXOFF(tty)) {
1350 unsigned char start_char = START_CHAR(tty);
1351 status = ATEN2011_write(tty, port, &start_char, 1);
1352 if (status <= 0)
1353 return;
1354 }
1355
1356 /* if we are implementing RTS/CTS, toggle that line */
1357 if (tty->termios->c_cflag & CRTSCTS) {
1358 ATEN2011_port->shadowMCR |= MCR_RTS;
1359 status = set_uart_reg(port, MODEM_CONTROL_REGISTER,
1360 ATEN2011_port->shadowMCR);
1361 if (status < 0)
1362 return;
1363 }
1364
1365 return;
1366}
1367
1368static int ATEN2011_tiocmget(struct tty_struct *tty, struct file *file)
1369{
1370 struct usb_serial_port *port = tty->driver_data;
1371 struct ATENINTL_port *ATEN2011_port;
1372 unsigned int result;
1373 __u16 msr;
1374 __u16 mcr;
1375 /* unsigned int mcr; */
1376 int status = 0;
1377 ATEN2011_port = usb_get_serial_port_data(port);
1378
1379 dbg("%s - port %d", __func__, port->number);
1380
1381 if (ATEN2011_port == NULL)
1382 return -ENODEV;
1383
1384 status = get_uart_reg(port, MODEM_STATUS_REGISTER, &msr);
1385 status = get_uart_reg(port, MODEM_CONTROL_REGISTER, &mcr);
1386 /* mcr = ATEN2011_port->shadowMCR; */
1387 /* COMMENT2: the Fallowing three line are commented for updating only MSR values */
1388 result = ((mcr & MCR_DTR) ? TIOCM_DTR : 0)
1389 | ((mcr & MCR_RTS) ? TIOCM_RTS : 0)
1390 | ((mcr & MCR_LOOPBACK) ? TIOCM_LOOP : 0)
1391 | ((msr & ATEN2011_MSR_CTS) ? TIOCM_CTS : 0)
1392 | ((msr & ATEN2011_MSR_CD) ? TIOCM_CAR : 0)
1393 | ((msr & ATEN2011_MSR_RI) ? TIOCM_RI : 0)
1394 | ((msr & ATEN2011_MSR_DSR) ? TIOCM_DSR : 0);
1395
1396 dbg("%s - 0x%04X", __func__, result);
1397
1398 return result;
1399}
1400
1401static int ATEN2011_tiocmset(struct tty_struct *tty, struct file *file,
1402 unsigned int set, unsigned int clear)
1403{
1404 struct usb_serial_port *port = tty->driver_data;
1405 struct ATENINTL_port *ATEN2011_port;
1406 unsigned int mcr;
1407 unsigned int status;
1408
1409 dbg("%s - port %d", __func__, port->number);
1410
1411 ATEN2011_port = usb_get_serial_port_data(port);
1412
1413 if (ATEN2011_port == NULL)
1414 return -ENODEV;
1415
1416 mcr = ATEN2011_port->shadowMCR;
1417 if (clear & TIOCM_RTS)
1418 mcr &= ~MCR_RTS;
1419 if (clear & TIOCM_DTR)
1420 mcr &= ~MCR_DTR;
1421 if (clear & TIOCM_LOOP)
1422 mcr &= ~MCR_LOOPBACK;
1423
1424 if (set & TIOCM_RTS)
1425 mcr |= MCR_RTS;
1426 if (set & TIOCM_DTR)
1427 mcr |= MCR_DTR;
1428 if (set & TIOCM_LOOP)
1429 mcr |= MCR_LOOPBACK;
1430
1431 ATEN2011_port->shadowMCR = mcr;
1432
1433 status = set_uart_reg(port, MODEM_CONTROL_REGISTER, mcr);
1434 if (status < 0) {
1435 dbg("setting MODEM_CONTROL_REGISTER Failed");
1436 return -1;
1437 }
1438
1439 return 0;
1440}
1441
1442static void ATEN2011_set_termios(struct tty_struct *tty,
1443 struct usb_serial_port *port,
1444 struct ktermios *old_termios)
1445{
1446 int status;
1447 unsigned int cflag;
1448 struct usb_serial *serial;
1449 struct ATENINTL_port *ATEN2011_port;
1450
1451 dbg("ATEN2011_set_termios: START");
1452
1453 serial = port->serial;
1454
1455 ATEN2011_port = usb_get_serial_port_data(port);
1456
1457 if (ATEN2011_port == NULL)
1458 return;
1459
1460 if (!ATEN2011_port->open) {
1461 dbg("%s - port not opened", __func__);
1462 return;
1463 }
1464
1465 dbg("%s", "setting termios - ");
1466
1467 cflag = tty->termios->c_cflag;
1468
1469 dbg("%s - cflag %08x iflag %08x", __func__,
1470 tty->termios->c_cflag, RELEVANT_IFLAG(tty->termios->c_iflag));
1471
1472 if (old_termios) {
1473 dbg("%s - old clfag %08x old iflag %08x", __func__,
1474 old_termios->c_cflag, RELEVANT_IFLAG(old_termios->c_iflag));
1475 }
1476
1477 dbg("%s - port %d", __func__, port->number);
1478
1479 /* change the port settings to the new ones specified */
1480
1481 ATEN2011_change_port_settings(tty, ATEN2011_port, old_termios);
1482
1483 if (!ATEN2011_port->read_urb) {
1484 dbg("%s", "URB KILLED !!!!!");
1485 return;
1486 }
1487
1488 if (ATEN2011_port->read_urb->status != -EINPROGRESS) {
1489 ATEN2011_port->read_urb->dev = serial->dev;
1490 status = usb_submit_urb(ATEN2011_port->read_urb, GFP_ATOMIC);
1491 if (status) {
1492 dbg
1493 (" usb_submit_urb(read bulk) failed, status = %d",
1494 status);
1495 }
1496 }
1497 return;
1498}
1499
1500static int get_lsr_info(struct tty_struct *tty,
1501 struct ATENINTL_port *ATEN2011_port,
1502 unsigned int __user *value)
1503{
1504 int count;
1505 unsigned int result = 0;
1506
1507 count = ATEN2011_chars_in_buffer(tty);
1508 if (count == 0) {
1509 dbg("%s -- Empty", __func__);
1510 result = TIOCSER_TEMT;
1511 }
1512
1513 if (copy_to_user(value, &result, sizeof(int)))
1514 return -EFAULT;
1515 return 0;
1516}
1517
1518static int get_number_bytes_avail(struct tty_struct *tty,
1519 struct ATENINTL_port *ATEN2011_port,
1520 unsigned int __user *value)
1521{
1522 unsigned int result = 0;
1523
1524 if (!tty)
1525 return -ENOIOCTLCMD;
1526
1527 result = tty->read_cnt;
1528
1529 dbg("%s(%d) = %d", __func__, ATEN2011_port->port->number, result);
1530 if (copy_to_user(value, &result, sizeof(int)))
1531 return -EFAULT;
1532
1533 return -ENOIOCTLCMD;
1534}
1535
1536static int set_modem_info(struct ATENINTL_port *ATEN2011_port, unsigned int cmd,
1537 unsigned int __user *value)
1538{
1539 unsigned int mcr;
1540 unsigned int arg;
1541 __u16 Data;
1542 int status;
1543 struct usb_serial_port *port;
1544
1545 if (ATEN2011_port == NULL)
1546 return -1;
1547
1548 port = (struct usb_serial_port *)ATEN2011_port->port;
1549
1550 mcr = ATEN2011_port->shadowMCR;
1551
1552 if (copy_from_user(&arg, value, sizeof(int)))
1553 return -EFAULT;
1554
1555 switch (cmd) {
1556 case TIOCMBIS:
1557 if (arg & TIOCM_RTS)
1558 mcr |= MCR_RTS;
1559 if (arg & TIOCM_DTR)
1560 mcr |= MCR_RTS;
1561 if (arg & TIOCM_LOOP)
1562 mcr |= MCR_LOOPBACK;
1563 break;
1564
1565 case TIOCMBIC:
1566 if (arg & TIOCM_RTS)
1567 mcr &= ~MCR_RTS;
1568 if (arg & TIOCM_DTR)
1569 mcr &= ~MCR_RTS;
1570 if (arg & TIOCM_LOOP)
1571 mcr &= ~MCR_LOOPBACK;
1572 break;
1573
1574 case TIOCMSET:
1575 /* turn off the RTS and DTR and LOOPBACK
1576 * and then only turn on what was asked to */
1577 mcr &= ~(MCR_RTS | MCR_DTR | MCR_LOOPBACK);
1578 mcr |= ((arg & TIOCM_RTS) ? MCR_RTS : 0);
1579 mcr |= ((arg & TIOCM_DTR) ? MCR_DTR : 0);
1580 mcr |= ((arg & TIOCM_LOOP) ? MCR_LOOPBACK : 0);
1581 break;
1582 }
1583
1584 ATEN2011_port->shadowMCR = mcr;
1585
1586 Data = ATEN2011_port->shadowMCR;
1587 status = set_uart_reg(port, MODEM_CONTROL_REGISTER, Data);
1588 if (status < 0) {
1589 dbg("setting MODEM_CONTROL_REGISTER Failed");
1590 return -1;
1591 }
1592
1593 return 0;
1594}
1595
1596static int get_modem_info(struct ATENINTL_port *ATEN2011_port,
1597 unsigned int __user *value)
1598{
1599 unsigned int result = 0;
1600 __u16 msr;
1601 unsigned int mcr = ATEN2011_port->shadowMCR;
1602 int status;
1603
1604 status = get_uart_reg(ATEN2011_port->port, MODEM_STATUS_REGISTER, &msr);
1605 result = ((mcr & MCR_DTR) ? TIOCM_DTR : 0) /* 0x002 */
1606 |((mcr & MCR_RTS) ? TIOCM_RTS : 0) /* 0x004 */
1607 |((msr & ATEN2011_MSR_CTS) ? TIOCM_CTS : 0) /* 0x020 */
1608 |((msr & ATEN2011_MSR_CD) ? TIOCM_CAR : 0) /* 0x040 */
1609 |((msr & ATEN2011_MSR_RI) ? TIOCM_RI : 0) /* 0x080 */
1610 |((msr & ATEN2011_MSR_DSR) ? TIOCM_DSR : 0); /* 0x100 */
1611
1612 dbg("%s -- %x", __func__, result);
1613
1614 if (copy_to_user(value, &result, sizeof(int)))
1615 return -EFAULT;
1616 return 0;
1617}
1618
1619static int get_serial_info(struct ATENINTL_port *ATEN2011_port,
1620 struct serial_struct __user *retinfo)
1621{
1622 struct serial_struct tmp;
1623
1624 if (ATEN2011_port == NULL)
1625 return -1;
1626
1627 if (!retinfo)
1628 return -EFAULT;
1629
1630 memset(&tmp, 0, sizeof(tmp));
1631
1632 tmp.type = PORT_16550A;
1633 tmp.line = ATEN2011_port->port->serial->minor;
1634 if (tmp.line == SERIAL_TTY_NO_MINOR)
1635 tmp.line = 0;
1636 tmp.port = ATEN2011_port->port->number;
1637 tmp.irq = 0;
1638 tmp.flags = ASYNC_SKIP_TEST | ASYNC_AUTO_IRQ;
1639 tmp.xmit_fifo_size = NUM_URBS * URB_TRANSFER_BUFFER_SIZE;
1640 tmp.baud_base = 9600;
1641 tmp.close_delay = 5 * HZ;
1642 tmp.closing_wait = 30 * HZ;
1643
1644 if (copy_to_user(retinfo, &tmp, sizeof(*retinfo)))
1645 return -EFAULT;
1646 return 0;
1647}
1648
1649static int ATEN2011_ioctl(struct tty_struct *tty, struct file *file,
1650 unsigned int cmd, unsigned long arg)
1651{
1652 struct usb_serial_port *port = tty->driver_data;
1653 struct ATENINTL_port *ATEN2011_port;
1654 struct async_icount cnow;
1655 struct async_icount cprev;
1656 struct serial_icounter_struct icount;
1657 int ATENret = 0;
1658 unsigned int __user *user_arg = (unsigned int __user *)arg;
1659
1660 ATEN2011_port = usb_get_serial_port_data(port);
1661
1662 if (ATEN2011_port == NULL)
1663 return -1;
1664
1665 dbg("%s - port %d, cmd = 0x%x", __func__, port->number, cmd);
1666
1667 switch (cmd) {
1668 /* return number of bytes available */
1669
1670 case TIOCINQ:
1671 dbg("%s (%d) TIOCINQ", __func__, port->number);
1672 return get_number_bytes_avail(tty, ATEN2011_port, user_arg);
1673 break;
1674
1675 case TIOCOUTQ:
1676 dbg("%s (%d) TIOCOUTQ", __func__, port->number);
1677 return put_user(ATEN2011_chars_in_buffer(tty), user_arg);
1678 break;
1679
1680 case TIOCSERGETLSR:
1681 dbg("%s (%d) TIOCSERGETLSR", __func__, port->number);
1682 return get_lsr_info(tty, ATEN2011_port, user_arg);
1683 return 0;
1684
1685 case TIOCMBIS:
1686 case TIOCMBIC:
1687 case TIOCMSET:
1688 dbg("%s (%d) TIOCMSET/TIOCMBIC/TIOCMSET", __func__,
1689 port->number);
1690 ATENret = set_modem_info(ATEN2011_port, cmd, user_arg);
1691 return ATENret;
1692
1693 case TIOCMGET:
1694 dbg("%s (%d) TIOCMGET", __func__, port->number);
1695 return get_modem_info(ATEN2011_port, user_arg);
1696
1697 case TIOCGSERIAL:
1698 dbg("%s (%d) TIOCGSERIAL", __func__, port->number);
1699 return get_serial_info(ATEN2011_port,
1700 (struct serial_struct __user *)arg);
1701
1702 case TIOCSSERIAL:
1703 dbg("%s (%d) TIOCSSERIAL", __func__, port->number);
1704 break;
1705
1706 case TIOCMIWAIT:
1707 dbg("%s (%d) TIOCMIWAIT", __func__, port->number);
1708 cprev = ATEN2011_port->icount;
1709 while (1) {
1710 /* see if a signal did it */
1711 if (signal_pending(current))
1712 return -ERESTARTSYS;
1713 cnow = ATEN2011_port->icount;
1714 if (cnow.rng == cprev.rng && cnow.dsr == cprev.dsr &&
1715 cnow.dcd == cprev.dcd && cnow.cts == cprev.cts)
1716 return -EIO; /* no change => error */
1717 if (((arg & TIOCM_RNG) && (cnow.rng != cprev.rng)) ||
1718 ((arg & TIOCM_DSR) && (cnow.dsr != cprev.dsr)) ||
1719 ((arg & TIOCM_CD) && (cnow.dcd != cprev.dcd)) ||
1720 ((arg & TIOCM_CTS) && (cnow.cts != cprev.cts))) {
1721 return 0;
1722 }
1723 cprev = cnow;
1724 }
1725 /* NOTREACHED */
1726 break;
1727
1728 case TIOCGICOUNT:
1729 cnow = ATEN2011_port->icount;
1730 icount.cts = cnow.cts;
1731 icount.dsr = cnow.dsr;
1732 icount.rng = cnow.rng;
1733 icount.dcd = cnow.dcd;
1734 icount.rx = cnow.rx;
1735 icount.tx = cnow.tx;
1736 icount.frame = cnow.frame;
1737 icount.overrun = cnow.overrun;
1738 icount.parity = cnow.parity;
1739 icount.brk = cnow.brk;
1740 icount.buf_overrun = cnow.buf_overrun;
1741
1742 dbg("%s (%d) TIOCGICOUNT RX=%d, TX=%d", __func__,
1743 port->number, icount.rx, icount.tx);
1744 if (copy_to_user((void __user *)arg, &icount, sizeof(icount)))
1745 return -EFAULT;
1746 return 0;
1747
1748 default:
1749 break;
1750 }
1751
1752 return -ENOIOCTLCMD;
1753}
1754
1755static int ATEN2011_calc_baud_rate_divisor(int baudRate, int *divisor,
1756 __u16 *clk_sel_val)
1757{
1758 dbg("%s - %d", __func__, baudRate);
1759
1760 if (baudRate <= 115200) {
1761 *divisor = 115200 / baudRate;
1762 *clk_sel_val = 0x0;
1763 }
1764 if ((baudRate > 115200) && (baudRate <= 230400)) {
1765 *divisor = 230400 / baudRate;
1766 *clk_sel_val = 0x10;
1767 } else if ((baudRate > 230400) && (baudRate <= 403200)) {
1768 *divisor = 403200 / baudRate;
1769 *clk_sel_val = 0x20;
1770 } else if ((baudRate > 403200) && (baudRate <= 460800)) {
1771 *divisor = 460800 / baudRate;
1772 *clk_sel_val = 0x30;
1773 } else if ((baudRate > 460800) && (baudRate <= 806400)) {
1774 *divisor = 806400 / baudRate;
1775 *clk_sel_val = 0x40;
1776 } else if ((baudRate > 806400) && (baudRate <= 921600)) {
1777 *divisor = 921600 / baudRate;
1778 *clk_sel_val = 0x50;
1779 } else if ((baudRate > 921600) && (baudRate <= 1572864)) {
1780 *divisor = 1572864 / baudRate;
1781 *clk_sel_val = 0x60;
1782 } else if ((baudRate > 1572864) && (baudRate <= 3145728)) {
1783 *divisor = 3145728 / baudRate;
1784 *clk_sel_val = 0x70;
1785 }
1786 return 0;
1787}
1788
1789static int ATEN2011_send_cmd_write_baud_rate(struct ATENINTL_port
1790 *ATEN2011_port, int baudRate)
1791{
1792 int divisor = 0;
1793 int status;
1794 __u16 Data;
1795 unsigned char number;
1796 __u16 clk_sel_val;
1797 struct usb_serial_port *port;
1798 int minor;
1799
1800 if (ATEN2011_port == NULL)
1801 return -1;
1802
1803 port = (struct usb_serial_port *)ATEN2011_port->port;
1804
1805 dbg("%s", "Entering .......... ");
1806
1807 minor = ATEN2011_port->port->serial->minor;
1808 if (minor == SERIAL_TTY_NO_MINOR)
1809 minor = 0;
1810 number = ATEN2011_port->port->number - minor;
1811
1812 dbg("%s - port = %d, baud = %d", __func__,
1813 ATEN2011_port->port->number, baudRate);
1814 /* reset clk_uart_sel in spregOffset */
1815 if (baudRate > 115200) {
1816#ifdef HW_flow_control
1817 /*
1818 * NOTE: need to see the pther register to modify
1819 * setting h/w flow control bit to 1;
1820 */
1821 /* Data = ATEN2011_port->shadowMCR; */
1822 Data = 0x2b;
1823 ATEN2011_port->shadowMCR = Data;
1824 status = set_uart_reg(port, MODEM_CONTROL_REGISTER, Data);
1825 if (status < 0) {
1826 dbg("Writing spreg failed in set_serial_baud");
1827 return -1;
1828 }
1829#endif
1830
1831 } else {
1832#ifdef HW_flow_control
1833 /* setting h/w flow control bit to 0; */
1834 /* Data = ATEN2011_port->shadowMCR; */
1835 Data = 0xb;
1836 ATEN2011_port->shadowMCR = Data;
1837 status = set_uart_reg(port, MODEM_CONTROL_REGISTER, Data);
1838 if (status < 0) {
1839 dbg("Writing spreg failed in set_serial_baud");
1840 return -1;
1841 }
1842#endif
1843
1844 }
1845
1846 if (1) /* baudRate <= 115200) */ {
1847 clk_sel_val = 0x0;
1848 Data = 0x0;
1849 status =
1850 ATEN2011_calc_baud_rate_divisor(baudRate, &divisor,
1851 &clk_sel_val);
1852 status = get_reg_sync(port, ATEN2011_port->SpRegOffset, &Data);
1853 if (status < 0) {
1854 dbg("reading spreg failed in set_serial_baud");
1855 return -1;
1856 }
1857 Data = (Data & 0x8f) | clk_sel_val;
1858 status = set_reg_sync(port, ATEN2011_port->SpRegOffset, Data);
1859 if (status < 0) {
1860 dbg("Writing spreg failed in set_serial_baud");
1861 return -1;
1862 }
1863 /* Calculate the Divisor */
1864
1865 if (status) {
1866 err("%s - bad baud rate", __func__);
1867 dbg("%s", "bad baud rate");
1868 return status;
1869 }
1870 /* Enable access to divisor latch */
1871 Data = ATEN2011_port->shadowLCR | SERIAL_LCR_DLAB;
1872 ATEN2011_port->shadowLCR = Data;
1873 set_uart_reg(port, LINE_CONTROL_REGISTER, Data);
1874
1875 /* Write the divisor */
1876 Data = (unsigned char)(divisor & 0xff);
1877 dbg("set_serial_baud Value to write DLL is %x", Data);
1878 set_uart_reg(port, DIVISOR_LATCH_LSB, Data);
1879
1880 Data = (unsigned char)((divisor & 0xff00) >> 8);
1881 dbg("set_serial_baud Value to write DLM is %x", Data);
1882 set_uart_reg(port, DIVISOR_LATCH_MSB, Data);
1883
1884 /* Disable access to divisor latch */
1885 Data = ATEN2011_port->shadowLCR & ~SERIAL_LCR_DLAB;
1886 ATEN2011_port->shadowLCR = Data;
1887 set_uart_reg(port, LINE_CONTROL_REGISTER, Data);
1888
1889 }
1890
1891 return status;
1892}
1893
1894static void ATEN2011_change_port_settings(struct tty_struct *tty,
1895 struct ATENINTL_port *ATEN2011_port,
1896 struct ktermios *old_termios)
1897{
1898 int baud;
1899 unsigned cflag;
1900 unsigned iflag;
1901 __u8 lData;
1902 __u8 lParity;
1903 __u8 lStop;
1904 int status;
1905 __u16 Data;
1906 struct usb_serial_port *port;
1907 struct usb_serial *serial;
1908
1909 if (ATEN2011_port == NULL)
1910 return;
1911
1912 port = (struct usb_serial_port *)ATEN2011_port->port;
1913
1914 serial = port->serial;
1915
1916 dbg("%s - port %d", __func__, ATEN2011_port->port->number);
1917
1918 if (!ATEN2011_port->open) {
1919 dbg("%s - port not opened", __func__);
1920 return;
1921 }
1922
1923 if ((!tty) || (!tty->termios)) {
1924 dbg("%s - no tty structures", __func__);
1925 return;
1926 }
1927
1928 dbg("%s", "Entering .......... ");
1929
1930 lData = LCR_BITS_8;
1931 lStop = LCR_STOP_1;
1932 lParity = LCR_PAR_NONE;
1933
1934 cflag = tty->termios->c_cflag;
1935 iflag = tty->termios->c_iflag;
1936
1937 /* Change the number of bits */
1938
1939 /* COMMENT1: the below Line"if(cflag & CSIZE)" is added for the errors we get for serial loop data test i.e serial_loopback.pl -v */
1940 /* if(cflag & CSIZE) */
1941 {
1942 switch (cflag & CSIZE) {
1943 case CS5:
1944 lData = LCR_BITS_5;
1945 break;
1946
1947 case CS6:
1948 lData = LCR_BITS_6;
1949 break;
1950
1951 case CS7:
1952 lData = LCR_BITS_7;
1953 break;
1954 default:
1955 case CS8:
1956 lData = LCR_BITS_8;
1957 break;
1958 }
1959 }
1960 /* Change the Parity bit */
1961 if (cflag & PARENB) {
1962 if (cflag & PARODD) {
1963 lParity = LCR_PAR_ODD;
1964 dbg("%s - parity = odd", __func__);
1965 } else {
1966 lParity = LCR_PAR_EVEN;
1967 dbg("%s - parity = even", __func__);
1968 }
1969
1970 } else {
1971 dbg("%s - parity = none", __func__);
1972 }
1973
1974 if (cflag & CMSPAR)
1975 lParity = lParity | 0x20;
1976
1977 /* Change the Stop bit */
1978 if (cflag & CSTOPB) {
1979 lStop = LCR_STOP_2;
1980 dbg("%s - stop bits = 2", __func__);
1981 } else {
1982 lStop = LCR_STOP_1;
1983 dbg("%s - stop bits = 1", __func__);
1984 }
1985
1986 /* Update the LCR with the correct value */
1987 ATEN2011_port->shadowLCR &=
1988 ~(LCR_BITS_MASK | LCR_STOP_MASK | LCR_PAR_MASK);
1989 ATEN2011_port->shadowLCR |= (lData | lParity | lStop);
1990
1991 dbg
1992 ("ATEN2011_change_port_settings ATEN2011_port->shadowLCR is %x",
1993 ATEN2011_port->shadowLCR);
1994 /* Disable Interrupts */
1995 Data = 0x00;
1996 set_uart_reg(port, INTERRUPT_ENABLE_REGISTER, Data);
1997
1998 Data = 0x00;
1999 set_uart_reg(port, FIFO_CONTROL_REGISTER, Data);
2000
2001 Data = 0xcf;
2002 set_uart_reg(port, FIFO_CONTROL_REGISTER, Data);
2003
2004 /* Send the updated LCR value to the ATEN2011 */
2005 Data = ATEN2011_port->shadowLCR;
2006
2007 set_uart_reg(port, LINE_CONTROL_REGISTER, Data);
2008
2009 Data = 0x00b;
2010 ATEN2011_port->shadowMCR = Data;
2011 set_uart_reg(port, MODEM_CONTROL_REGISTER, Data);
2012 Data = 0x00b;
2013 set_uart_reg(port, MODEM_CONTROL_REGISTER, Data);
2014
2015 /* set up the MCR register and send it to the ATEN2011 */
2016
2017 ATEN2011_port->shadowMCR = MCR_MASTER_IE;
2018 if (cflag & CBAUD)
2019 ATEN2011_port->shadowMCR |= (MCR_DTR | MCR_RTS);
2020
2021 if (cflag & CRTSCTS)
2022 ATEN2011_port->shadowMCR |= (MCR_XON_ANY);
2023 else
2024 ATEN2011_port->shadowMCR &= ~(MCR_XON_ANY);
2025
2026 Data = ATEN2011_port->shadowMCR;
2027 set_uart_reg(port, MODEM_CONTROL_REGISTER, Data);
2028
2029 /* Determine divisor based on baud rate */
2030 baud = tty_get_baud_rate(tty);
2031
2032 if (!baud) {
2033 /* pick a default, any default... */
2034 dbg("%s", "Picked default baud...");
2035 baud = 9600;
2036 }
2037
2038 dbg("%s - baud rate = %d", __func__, baud);
2039 status = ATEN2011_send_cmd_write_baud_rate(ATEN2011_port, baud);
2040
2041 /* Enable Interrupts */
2042 Data = 0x0c;
2043 set_uart_reg(port, INTERRUPT_ENABLE_REGISTER, Data);
2044
2045 if (ATEN2011_port->read_urb->status != -EINPROGRESS) {
2046 ATEN2011_port->read_urb->dev = serial->dev;
2047
2048 status = usb_submit_urb(ATEN2011_port->read_urb, GFP_ATOMIC);
2049
2050 if (status) {
2051 dbg
2052 (" usb_submit_urb(read bulk) failed, status = %d",
2053 status);
2054 }
2055 }
2056 dbg
2057 ("ATEN2011_change_port_settings ATEN2011_port->shadowLCR is End %x",
2058 ATEN2011_port->shadowLCR);
2059
2060 return;
2061}
2062
2063static int ATEN2011_calc_num_ports(struct usb_serial *serial)
2064{
2065
2066 __u16 Data = 0x00;
2067 int ret = 0;
2068 int ATEN2011_2or4ports;
2069 ret = usb_control_msg(serial->dev, usb_rcvctrlpipe(serial->dev, 0),
2070 ATEN_RDREQ, ATEN_RD_RTYPE, 0, GPIO_REGISTER,
2071 &Data, VENDOR_READ_LENGTH, ATEN_WDR_TIMEOUT);
2072
2073/* ghostgum: here is where the problem appears to bet */
2074/* Which of the following are needed? */
2075/* Greg used the serial->type->num_ports=2 */
2076/* But the code in the ATEN2011_open relies on serial->num_ports=2 */
2077 if ((Data & 0x01) == 0) {
2078 ATEN2011_2or4ports = 2;
2079 serial->type->num_ports = 2;
2080 serial->num_ports = 2;
2081 }
2082 /* else if(serial->interface->cur_altsetting->desc.bNumEndpoints == 9) */
2083 else {
2084 ATEN2011_2or4ports = 4;
2085 serial->type->num_ports = 4;
2086 serial->num_ports = 4;
2087
2088 }
2089
2090 return ATEN2011_2or4ports;
2091}
2092
2093static int ATEN2011_startup(struct usb_serial *serial)
2094{
2095 struct ATENINTL_serial *ATEN2011_serial;
2096 struct ATENINTL_port *ATEN2011_port;
2097 struct usb_device *dev;
2098 int i, status;
2099 int minor;
2100
2101 __u16 Data;
2102 dbg("%s", " ATEN2011_startup :entering..........");
2103
2104 if (!serial) {
2105 dbg("%s", "Invalid Handler");
2106 return -1;
2107 }
2108
2109 dev = serial->dev;
2110
2111 dbg("%s", "Entering...");
2112
2113 /* create our private serial structure */
2114 ATEN2011_serial = kzalloc(sizeof(struct ATENINTL_serial), GFP_KERNEL);
2115 if (ATEN2011_serial == NULL) {
2116 err("%s - Out of memory", __func__);
2117 return -ENOMEM;
2118 }
2119
2120 /* resetting the private structure field values to zero */
2121 memset(ATEN2011_serial, 0, sizeof(struct ATENINTL_serial));
2122
2123 ATEN2011_serial->serial = serial;
2124 /* initilize status polling flag to 0 */
2125 ATEN2011_serial->status_polling_started = 0;
2126
2127 usb_set_serial_data(serial, ATEN2011_serial);
2128 ATEN2011_serial->ATEN2011_spectrum_2or4ports =
2129 ATEN2011_calc_num_ports(serial);
2130 /* we set up the pointers to the endpoints in the ATEN2011_open *
2131 * function, as the structures aren't created yet. */
2132
2133 /* set up port private structures */
2134 for (i = 0; i < serial->num_ports; ++i) {
2135 ATEN2011_port =
2136 kmalloc(sizeof(struct ATENINTL_port), GFP_KERNEL);
2137 if (ATEN2011_port == NULL) {
2138 err("%s - Out of memory", __func__);
2139 usb_set_serial_data(serial, NULL);
2140 kfree(ATEN2011_serial);
2141 return -ENOMEM;
2142 }
2143 memset(ATEN2011_port, 0, sizeof(struct ATENINTL_port));
2144
2145 /*
2146 * Initialize all port interrupt end point to port 0
2147 * int endpoint. Our device has only one interrupt end point
2148 * comman to all port
2149 */
2150 /* serial->port[i]->interrupt_in_endpointAddress = serial->port[0]->interrupt_in_endpointAddress; */
2151
2152 ATEN2011_port->port = serial->port[i];
2153 usb_set_serial_port_data(serial->port[i], ATEN2011_port);
2154
2155 minor = serial->port[i]->serial->minor;
2156 if (minor == SERIAL_TTY_NO_MINOR)
2157 minor = 0;
2158 ATEN2011_port->port_num =
2159 ((serial->port[i]->number - minor) + 1);
2160
2161 if (ATEN2011_port->port_num == 1) {
2162 ATEN2011_port->SpRegOffset = 0x0;
2163 ATEN2011_port->ControlRegOffset = 0x1;
2164 ATEN2011_port->DcrRegOffset = 0x4;
2165 } else if ((ATEN2011_port->port_num == 2)
2166 && (ATEN2011_serial->ATEN2011_spectrum_2or4ports ==
2167 4)) {
2168 ATEN2011_port->SpRegOffset = 0x8;
2169 ATEN2011_port->ControlRegOffset = 0x9;
2170 ATEN2011_port->DcrRegOffset = 0x16;
2171 } else if ((ATEN2011_port->port_num == 2)
2172 && (ATEN2011_serial->ATEN2011_spectrum_2or4ports ==
2173 2)) {
2174 ATEN2011_port->SpRegOffset = 0xa;
2175 ATEN2011_port->ControlRegOffset = 0xb;
2176 ATEN2011_port->DcrRegOffset = 0x19;
2177 } else if ((ATEN2011_port->port_num == 3)
2178 && (ATEN2011_serial->ATEN2011_spectrum_2or4ports ==
2179 4)) {
2180 ATEN2011_port->SpRegOffset = 0xa;
2181 ATEN2011_port->ControlRegOffset = 0xb;
2182 ATEN2011_port->DcrRegOffset = 0x19;
2183 } else if ((ATEN2011_port->port_num == 4)
2184 && (ATEN2011_serial->ATEN2011_spectrum_2or4ports ==
2185 4)) {
2186 ATEN2011_port->SpRegOffset = 0xc;
2187 ATEN2011_port->ControlRegOffset = 0xd;
2188 ATEN2011_port->DcrRegOffset = 0x1c;
2189 }
2190
2191 usb_set_serial_port_data(serial->port[i], ATEN2011_port);
2192
2193 /* enable rx_disable bit in control register */
2194
2195 status = get_reg_sync(serial->port[i],
2196 ATEN2011_port->ControlRegOffset, &Data);
2197 if (status < 0) {
2198 dbg("Reading ControlReg failed status-0x%x",
2199 status);
2200 break;
2201 } else
2202 dbg
2203 ("ControlReg Reading success val is %x, status%d",
2204 Data, status);
2205 Data |= 0x08; /* setting driver done bit */
2206 Data |= 0x04; /* sp1_bit to have cts change reflect in modem status reg */
2207
2208 /* Data |= 0x20; */ /* rx_disable bit */
2209 status = set_reg_sync(serial->port[i],
2210 ATEN2011_port->ControlRegOffset, Data);
2211 if (status < 0) {
2212 dbg
2213 ("Writing ControlReg failed(rx_disable) status-0x%x",
2214 status);
2215 break;
2216 } else
2217 dbg
2218 ("ControlReg Writing success(rx_disable) status%d",
2219 status);
2220
2221 /*
2222 * Write default values in DCR (i.e 0x01 in DCR0, 0x05 in DCR2
2223 * and 0x24 in DCR3
2224 */
2225 Data = 0x01;
2226 status = set_reg_sync(serial->port[i],
2227 (__u16)(ATEN2011_port->DcrRegOffset + 0),
2228 Data);
2229 if (status < 0) {
2230 dbg("Writing DCR0 failed status-0x%x", status);
2231 break;
2232 } else
2233 dbg("DCR0 Writing success status%d", status);
2234
2235 Data = 0x05;
2236 status = set_reg_sync(serial->port[i],
2237 (__u16)(ATEN2011_port->DcrRegOffset + 1),
2238 Data);
2239 if (status < 0) {
2240 dbg("Writing DCR1 failed status-0x%x", status);
2241 break;
2242 } else
2243 dbg("DCR1 Writing success status%d", status);
2244
2245 Data = 0x24;
2246 status = set_reg_sync(serial->port[i],
2247 (__u16)(ATEN2011_port->DcrRegOffset + 2),
2248 Data);
2249 if (status < 0) {
2250 dbg("Writing DCR2 failed status-0x%x", status);
2251 break;
2252 } else
2253 dbg("DCR2 Writing success status%d", status);
2254
2255 /* write values in clkstart0x0 and clkmulti 0x20 */
2256 Data = 0x0;
2257 status = set_reg_sync(serial->port[i], CLK_START_VALUE_REGISTER,
2258 Data);
2259 if (status < 0) {
2260 dbg
2261 ("Writing CLK_START_VALUE_REGISTER failed status-0x%x",
2262 status);
2263 break;
2264 } else
2265 dbg
2266 ("CLK_START_VALUE_REGISTER Writing success status%d",
2267 status);
2268
2269 Data = 0x20;
2270 status = set_reg_sync(serial->port[i], CLK_MULTI_REGISTER,
2271 Data);
2272 if (status < 0) {
2273 dbg
2274 ("Writing CLK_MULTI_REGISTER failed status-0x%x",
2275 status);
2276 break;
2277 } else
2278 dbg("CLK_MULTI_REGISTER Writing success status%d",
2279 status);
2280
2281 /* Zero Length flag register */
2282 if ((ATEN2011_port->port_num != 1)
2283 && (ATEN2011_serial->ATEN2011_spectrum_2or4ports == 2)) {
2284
2285 Data = 0xff;
2286 status = set_reg_sync(serial->port[i],
2287 (__u16)(ZLP_REG1 + ((__u16)ATEN2011_port->port_num)),
2288 Data);
2289 dbg("ZLIP offset%x",
2290 (__u16) (ZLP_REG1 +
2291 ((__u16) ATEN2011_port->port_num)));
2292 if (status < 0) {
2293 dbg
2294 ("Writing ZLP_REG%d failed status-0x%x",
2295 i + 2, status);
2296 break;
2297 } else
2298 dbg("ZLP_REG%d Writing success status%d",
2299 i + 2, status);
2300 } else {
2301 Data = 0xff;
2302 status = set_reg_sync(serial->port[i],
2303 (__u16)(ZLP_REG1 + ((__u16)ATEN2011_port->port_num) - 0x1),
2304 Data);
2305 dbg("ZLIP offset%x",
2306 (__u16) (ZLP_REG1 +
2307 ((__u16) ATEN2011_port->port_num) -
2308 0x1));
2309 if (status < 0) {
2310 dbg
2311 ("Writing ZLP_REG%d failed status-0x%x",
2312 i + 1, status);
2313 break;
2314 } else
2315 dbg("ZLP_REG%d Writing success status%d",
2316 i + 1, status);
2317
2318 }
2319 ATEN2011_port->control_urb = usb_alloc_urb(0, GFP_ATOMIC);
2320 ATEN2011_port->ctrl_buf = kmalloc(16, GFP_KERNEL);
2321
2322 }
2323
2324 /* Zero Length flag enable */
2325 Data = 0x0f;
2326 status = set_reg_sync(serial->port[0], ZLP_REG5, Data);
2327 if (status < 0) {
2328 dbg("Writing ZLP_REG5 failed status-0x%x", status);
2329 return -1;
2330 } else
2331 dbg("ZLP_REG5 Writing success status%d", status);
2332
2333 /* setting configuration feature to one */
2334 usb_control_msg(serial->dev, usb_sndctrlpipe(serial->dev, 0),
2335 (__u8) 0x03, 0x00, 0x01, 0x00, NULL, 0x00, 5 * HZ);
2336 return 0;
2337}
2338
2339static void ATEN2011_release(struct usb_serial *serial)
2340{
2341 int i;
2342 struct ATENINTL_port *ATEN2011_port;
2343
2344 /* check for the ports to be closed,close the ports and disconnect */
2345
2346 /* free private structure allocated for serial port *
2347 * stop reads and writes on all ports */
2348
2349 for (i = 0; i < serial->num_ports; ++i) {
2350 ATEN2011_port = usb_get_serial_port_data(serial->port[i]);
2351 kfree(ATEN2011_port->ctrl_buf);
2352 usb_kill_urb(ATEN2011_port->control_urb);
2353 kfree(ATEN2011_port);
2354 usb_set_serial_port_data(serial->port[i], NULL);
2355 }
2356
2357 /* free private structure allocated for serial device */
2358
2359 kfree(usb_get_serial_data(serial));
2360 usb_set_serial_data(serial, NULL);
2361}
2362
2363static struct usb_serial_driver aten_serial_driver = {
2364 .driver = {
2365 .owner = THIS_MODULE,
2366 .name = "aten2011",
2367 },
2368 .description = DRIVER_DESC,
2369 .id_table = id_table,
2370 .open = ATEN2011_open,
2371 .close = ATEN2011_close,
2372 .write = ATEN2011_write,
2373 .write_room = ATEN2011_write_room,
2374 .chars_in_buffer = ATEN2011_chars_in_buffer,
2375 .throttle = ATEN2011_throttle,
2376 .unthrottle = ATEN2011_unthrottle,
2377 .calc_num_ports = ATEN2011_calc_num_ports,
2378
2379 .ioctl = ATEN2011_ioctl,
2380 .set_termios = ATEN2011_set_termios,
2381 .break_ctl = ATEN2011_break,
2382 .tiocmget = ATEN2011_tiocmget,
2383 .tiocmset = ATEN2011_tiocmset,
2384 .attach = ATEN2011_startup,
2385 .release = ATEN2011_release,
2386 .read_bulk_callback = ATEN2011_bulk_in_callback,
2387 .read_int_callback = ATEN2011_interrupt_callback,
2388};
2389
2390static struct usb_driver aten_driver = {
2391 .name = "aten2011",
2392 .probe = usb_serial_probe,
2393 .disconnect = usb_serial_disconnect,
2394 .id_table = id_table,
2395};
2396
2397static int __init aten_init(void)
2398{
2399 int retval;
2400
2401 /* Register with the usb serial */
2402 retval = usb_serial_register(&aten_serial_driver);
2403 if (retval)
2404 return retval;
2405
2406 printk(KERN_INFO KBUILD_MODNAME ":"
2407 DRIVER_DESC " " DRIVER_VERSION "\n");
2408
2409 /* Register with the usb */
2410 retval = usb_register(&aten_driver);
2411 if (retval)
2412 usb_serial_deregister(&aten_serial_driver);
2413
2414 return retval;
2415}
2416
2417static void __exit aten_exit(void)
2418{
2419 usb_deregister(&aten_driver);
2420 usb_serial_deregister(&aten_serial_driver);
2421}
2422
2423module_init(aten_init);
2424module_exit(aten_exit);
2425
2426/* Module information */
2427MODULE_DESCRIPTION(DRIVER_DESC);
2428MODULE_LICENSE("GPL");
2429
2430MODULE_PARM_DESC(debug, "Debug enabled or not");
diff --git a/drivers/staging/udlfb/udlfb.c b/drivers/staging/udlfb/udlfb.c
index 0ab9d15f3439..f5416af1e902 100644
--- a/drivers/staging/udlfb/udlfb.c
+++ b/drivers/staging/udlfb/udlfb.c
@@ -21,6 +21,7 @@
21#include <linux/mm.h> 21#include <linux/mm.h>
22#include <linux/fb.h> 22#include <linux/fb.h>
23#include <linux/mutex.h> 23#include <linux/mutex.h>
24#include <linux/vmalloc.h>
24 25
25#include "udlfb.h" 26#include "udlfb.h"
26 27
diff --git a/drivers/staging/usbip/usbip_common.c b/drivers/staging/usbip/usbip_common.c
index 22f93dd0ba03..251220dc8851 100644
--- a/drivers/staging/usbip/usbip_common.c
+++ b/drivers/staging/usbip/usbip_common.c
@@ -18,6 +18,7 @@
18 */ 18 */
19 19
20#include <linux/kernel.h> 20#include <linux/kernel.h>
21#include <linux/smp_lock.h>
21#include <linux/file.h> 22#include <linux/file.h>
22#include <linux/tcp.h> 23#include <linux/tcp.h>
23#include <linux/in.h> 24#include <linux/in.h>
diff --git a/drivers/staging/vt6655/device_main.c b/drivers/staging/vt6655/device_main.c
index a10ed27acbc2..f43ca416e4a8 100644
--- a/drivers/staging/vt6655/device_main.c
+++ b/drivers/staging/vt6655/device_main.c
@@ -344,7 +344,7 @@ static CHIP_INFO chip_info_table[]= {
344}; 344};
345 345
346static struct pci_device_id device_id_table[] __devinitdata = { 346static struct pci_device_id device_id_table[] __devinitdata = {
347{ 0x1106, 0x3253, PCI_ANY_ID, PCI_ANY_ID, 0, 0, (int)&chip_info_table[0]}, 347{ 0x1106, 0x3253, PCI_ANY_ID, PCI_ANY_ID, 0, 0, (long)&chip_info_table[0]},
348{ 0, } 348{ 0, }
349}; 349};
350#endif 350#endif
@@ -369,7 +369,7 @@ static int device_ioctl(struct net_device *dev, struct ifreq *rq, int cmd);
369 369
370#ifdef CONFIG_PM 370#ifdef CONFIG_PM
371static int device_notify_reboot(struct notifier_block *, unsigned long event, void *ptr); 371static int device_notify_reboot(struct notifier_block *, unsigned long event, void *ptr);
372static int viawget_suspend(struct pci_dev *pcid, u32 state); 372static int viawget_suspend(struct pci_dev *pcid, pm_message_t state);
373static int viawget_resume(struct pci_dev *pcid); 373static int viawget_resume(struct pci_dev *pcid);
374struct notifier_block device_notifier = { 374struct notifier_block device_notifier = {
375 notifier_call: device_notify_reboot, 375 notifier_call: device_notify_reboot,
@@ -3941,7 +3941,7 @@ device_notify_reboot(struct notifier_block *nb, unsigned long event, void *p)
3941 while ((pdev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, pdev)) != NULL) { 3941 while ((pdev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, pdev)) != NULL) {
3942 if(pci_dev_driver(pdev) == &device_driver) { 3942 if(pci_dev_driver(pdev) == &device_driver) {
3943 if (pci_get_drvdata(pdev)) 3943 if (pci_get_drvdata(pdev))
3944 viawget_suspend(pdev, 3); 3944 viawget_suspend(pdev, PMSG_HIBERNATE);
3945 } 3945 }
3946 } 3946 }
3947 } 3947 }
@@ -3949,7 +3949,7 @@ device_notify_reboot(struct notifier_block *nb, unsigned long event, void *p)
3949} 3949}
3950 3950
3951static int 3951static int
3952viawget_suspend(struct pci_dev *pcid, u32 state) 3952viawget_suspend(struct pci_dev *pcid, pm_message_t state)
3953{ 3953{
3954 int power_status; // to silence the compiler 3954 int power_status; // to silence the compiler
3955 3955
@@ -3971,7 +3971,7 @@ viawget_suspend(struct pci_dev *pcid, u32 state)
3971 memset(pMgmt->abyCurrBSSID, 0, 6); 3971 memset(pMgmt->abyCurrBSSID, 0, 6);
3972 pMgmt->eCurrState = WMAC_STATE_IDLE; 3972 pMgmt->eCurrState = WMAC_STATE_IDLE;
3973 pci_disable_device(pcid); 3973 pci_disable_device(pcid);
3974 power_status = pci_set_power_state(pcid, state); 3974 power_status = pci_set_power_state(pcid, pci_choose_state(pcid, state));
3975 spin_unlock_irq(&pDevice->lock); 3975 spin_unlock_irq(&pDevice->lock);
3976 return 0; 3976 return 0;
3977} 3977}
diff --git a/drivers/telephony/ixj.c b/drivers/telephony/ixj.c
index a913efc69669..40de151f2789 100644
--- a/drivers/telephony/ixj.c
+++ b/drivers/telephony/ixj.c
@@ -257,6 +257,7 @@
257#include <linux/fs.h> /* everything... */ 257#include <linux/fs.h> /* everything... */
258#include <linux/errno.h> /* error codes */ 258#include <linux/errno.h> /* error codes */
259#include <linux/slab.h> 259#include <linux/slab.h>
260#include <linux/smp_lock.h>
260#include <linux/mm.h> 261#include <linux/mm.h>
261#include <linux/ioport.h> 262#include <linux/ioport.h>
262#include <linux/interrupt.h> 263#include <linux/interrupt.h>
diff --git a/drivers/telephony/phonedev.c b/drivers/telephony/phonedev.c
index b52cc830c0b4..f3873f650bb4 100644
--- a/drivers/telephony/phonedev.c
+++ b/drivers/telephony/phonedev.c
@@ -23,7 +23,6 @@
23#include <linux/errno.h> 23#include <linux/errno.h>
24#include <linux/phonedev.h> 24#include <linux/phonedev.h>
25#include <linux/init.h> 25#include <linux/init.h>
26#include <linux/smp_lock.h>
27#include <asm/uaccess.h> 26#include <asm/uaccess.h>
28#include <asm/system.h> 27#include <asm/system.h>
29 28
diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c
index 38bfdb0f6660..2bfc41ece0e1 100644
--- a/drivers/usb/class/cdc-acm.c
+++ b/drivers/usb/class/cdc-acm.c
@@ -462,11 +462,18 @@ urbs:
462 462
463 rcv->buffer = buf; 463 rcv->buffer = buf;
464 464
465 usb_fill_bulk_urb(rcv->urb, acm->dev, 465 if (acm->is_int_ep)
466 acm->rx_endpoint, 466 usb_fill_int_urb(rcv->urb, acm->dev,
467 buf->base, 467 acm->rx_endpoint,
468 acm->readsize, 468 buf->base,
469 acm_read_bulk, rcv); 469 acm->readsize,
470 acm_read_bulk, rcv, acm->bInterval);
471 else
472 usb_fill_bulk_urb(rcv->urb, acm->dev,
473 acm->rx_endpoint,
474 buf->base,
475 acm->readsize,
476 acm_read_bulk, rcv);
470 rcv->urb->transfer_dma = buf->dma; 477 rcv->urb->transfer_dma = buf->dma;
471 rcv->urb->transfer_flags |= URB_NO_TRANSFER_DMA_MAP; 478 rcv->urb->transfer_flags |= URB_NO_TRANSFER_DMA_MAP;
472 479
@@ -550,7 +557,7 @@ static void acm_waker(struct work_struct *waker)
550static int acm_tty_open(struct tty_struct *tty, struct file *filp) 557static int acm_tty_open(struct tty_struct *tty, struct file *filp)
551{ 558{
552 struct acm *acm; 559 struct acm *acm;
553 int rv = -EINVAL; 560 int rv = -ENODEV;
554 int i; 561 int i;
555 dbg("Entering acm_tty_open."); 562 dbg("Entering acm_tty_open.");
556 563
@@ -677,7 +684,7 @@ static void acm_tty_close(struct tty_struct *tty, struct file *filp)
677 684
678 /* Perform the closing process and see if we need to do the hardware 685 /* Perform the closing process and see if we need to do the hardware
679 shutdown */ 686 shutdown */
680 if (tty_port_close_start(&acm->port, tty, filp) == 0) 687 if (!acm || tty_port_close_start(&acm->port, tty, filp) == 0)
681 return; 688 return;
682 acm_port_down(acm, 0); 689 acm_port_down(acm, 0);
683 tty_port_close_end(&acm->port, tty); 690 tty_port_close_end(&acm->port, tty);
@@ -740,7 +747,7 @@ static int acm_tty_chars_in_buffer(struct tty_struct *tty)
740{ 747{
741 struct acm *acm = tty->driver_data; 748 struct acm *acm = tty->driver_data;
742 if (!ACM_READY(acm)) 749 if (!ACM_READY(acm))
743 return -EINVAL; 750 return 0;
744 /* 751 /*
745 * This is inaccurate (overcounts), but it works. 752 * This is inaccurate (overcounts), but it works.
746 */ 753 */
@@ -1173,6 +1180,9 @@ made_compressed_probe:
1173 spin_lock_init(&acm->read_lock); 1180 spin_lock_init(&acm->read_lock);
1174 mutex_init(&acm->mutex); 1181 mutex_init(&acm->mutex);
1175 acm->rx_endpoint = usb_rcvbulkpipe(usb_dev, epread->bEndpointAddress); 1182 acm->rx_endpoint = usb_rcvbulkpipe(usb_dev, epread->bEndpointAddress);
1183 acm->is_int_ep = usb_endpoint_xfer_int(epread);
1184 if (acm->is_int_ep)
1185 acm->bInterval = epread->bInterval;
1176 tty_port_init(&acm->port); 1186 tty_port_init(&acm->port);
1177 acm->port.ops = &acm_port_ops; 1187 acm->port.ops = &acm_port_ops;
1178 1188
@@ -1227,9 +1237,14 @@ made_compressed_probe:
1227 goto alloc_fail7; 1237 goto alloc_fail7;
1228 } 1238 }
1229 1239
1230 usb_fill_bulk_urb(snd->urb, usb_dev, 1240 if (usb_endpoint_xfer_int(epwrite))
1231 usb_sndbulkpipe(usb_dev, epwrite->bEndpointAddress), 1241 usb_fill_int_urb(snd->urb, usb_dev,
1232 NULL, acm->writesize, acm_write_bulk, snd); 1242 usb_sndbulkpipe(usb_dev, epwrite->bEndpointAddress),
1243 NULL, acm->writesize, acm_write_bulk, snd, epwrite->bInterval);
1244 else
1245 usb_fill_bulk_urb(snd->urb, usb_dev,
1246 usb_sndbulkpipe(usb_dev, epwrite->bEndpointAddress),
1247 NULL, acm->writesize, acm_write_bulk, snd);
1233 snd->urb->transfer_flags |= URB_NO_TRANSFER_DMA_MAP; 1248 snd->urb->transfer_flags |= URB_NO_TRANSFER_DMA_MAP;
1234 snd->instance = acm; 1249 snd->instance = acm;
1235 } 1250 }
diff --git a/drivers/usb/class/cdc-acm.h b/drivers/usb/class/cdc-acm.h
index 1602324808ba..c4a0ee8ffccf 100644
--- a/drivers/usb/class/cdc-acm.h
+++ b/drivers/usb/class/cdc-acm.h
@@ -126,6 +126,8 @@ struct acm {
126 unsigned int ctrl_caps; /* control capabilities from the class specific header */ 126 unsigned int ctrl_caps; /* control capabilities from the class specific header */
127 unsigned int susp_count; /* number of suspended interfaces */ 127 unsigned int susp_count; /* number of suspended interfaces */
128 int combined_interfaces:1; /* control and data collapsed */ 128 int combined_interfaces:1; /* control and data collapsed */
129 int is_int_ep:1; /* interrupt endpoints contrary to spec used */
130 u8 bInterval;
129 struct acm_wb *delayed_wb; /* write queued for a device about to be woken */ 131 struct acm_wb *delayed_wb; /* write queued for a device about to be woken */
130}; 132};
131 133
diff --git a/drivers/usb/class/cdc-wdm.c b/drivers/usb/class/cdc-wdm.c
index 0fe434505ac4..ba589d4ca8bc 100644
--- a/drivers/usb/class/cdc-wdm.c
+++ b/drivers/usb/class/cdc-wdm.c
@@ -15,7 +15,6 @@
15#include <linux/errno.h> 15#include <linux/errno.h>
16#include <linux/slab.h> 16#include <linux/slab.h>
17#include <linux/module.h> 17#include <linux/module.h>
18#include <linux/smp_lock.h>
19#include <linux/mutex.h> 18#include <linux/mutex.h>
20#include <linux/uaccess.h> 19#include <linux/uaccess.h>
21#include <linux/bitops.h> 20#include <linux/bitops.h>
diff --git a/drivers/usb/class/usbtmc.c b/drivers/usb/class/usbtmc.c
index 3703789d0d2a..b09a527f7341 100644
--- a/drivers/usb/class/usbtmc.c
+++ b/drivers/usb/class/usbtmc.c
@@ -751,7 +751,7 @@ static int get_capabilities(struct usbtmc_device_data *data)
751{ 751{
752 struct device *dev = &data->usb_dev->dev; 752 struct device *dev = &data->usb_dev->dev;
753 char *buffer; 753 char *buffer;
754 int rv; 754 int rv = 0;
755 755
756 buffer = kmalloc(0x18, GFP_KERNEL); 756 buffer = kmalloc(0x18, GFP_KERNEL);
757 if (!buffer) 757 if (!buffer)
@@ -763,7 +763,7 @@ static int get_capabilities(struct usbtmc_device_data *data)
763 0, 0, buffer, 0x18, USBTMC_TIMEOUT); 763 0, 0, buffer, 0x18, USBTMC_TIMEOUT);
764 if (rv < 0) { 764 if (rv < 0) {
765 dev_err(dev, "usb_control_msg returned %d\n", rv); 765 dev_err(dev, "usb_control_msg returned %d\n", rv);
766 return rv; 766 goto err_out;
767 } 767 }
768 768
769 dev_dbg(dev, "GET_CAPABILITIES returned %x\n", buffer[0]); 769 dev_dbg(dev, "GET_CAPABILITIES returned %x\n", buffer[0]);
@@ -773,7 +773,8 @@ static int get_capabilities(struct usbtmc_device_data *data)
773 dev_dbg(dev, "USB488 device capabilities are %x\n", buffer[15]); 773 dev_dbg(dev, "USB488 device capabilities are %x\n", buffer[15]);
774 if (buffer[0] != USBTMC_STATUS_SUCCESS) { 774 if (buffer[0] != USBTMC_STATUS_SUCCESS) {
775 dev_err(dev, "GET_CAPABILITIES returned %x\n", buffer[0]); 775 dev_err(dev, "GET_CAPABILITIES returned %x\n", buffer[0]);
776 return -EPERM; 776 rv = -EPERM;
777 goto err_out;
777 } 778 }
778 779
779 data->capabilities.interface_capabilities = buffer[4]; 780 data->capabilities.interface_capabilities = buffer[4];
@@ -781,8 +782,9 @@ static int get_capabilities(struct usbtmc_device_data *data)
781 data->capabilities.usb488_interface_capabilities = buffer[14]; 782 data->capabilities.usb488_interface_capabilities = buffer[14];
782 data->capabilities.usb488_device_capabilities = buffer[15]; 783 data->capabilities.usb488_device_capabilities = buffer[15];
783 784
785err_out:
784 kfree(buffer); 786 kfree(buffer);
785 return 0; 787 return rv;
786} 788}
787 789
788#define capability_attribute(name) \ 790#define capability_attribute(name) \
diff --git a/drivers/usb/core/Kconfig b/drivers/usb/core/Kconfig
index 69280c35b5cb..ad925946f869 100644
--- a/drivers/usb/core/Kconfig
+++ b/drivers/usb/core/Kconfig
@@ -28,7 +28,7 @@ comment "Miscellaneous USB options"
28 depends on USB 28 depends on USB
29 29
30config USB_DEVICEFS 30config USB_DEVICEFS
31 bool "USB device filesystem (DEPRECATED)" if EMBEDDED 31 bool "USB device filesystem (DEPRECATED)"
32 depends on USB 32 depends on USB
33 ---help--- 33 ---help---
34 If you say Y here (and to "/proc file system support" in the "File 34 If you say Y here (and to "/proc file system support" in the "File
diff --git a/drivers/usb/core/config.c b/drivers/usb/core/config.c
index 24dfb33f90cb..a16c538d0132 100644
--- a/drivers/usb/core/config.c
+++ b/drivers/usb/core/config.c
@@ -80,38 +80,18 @@ static int usb_parse_ss_endpoint_companion(struct device *ddev, int cfgno,
80 int max_tx; 80 int max_tx;
81 int i; 81 int i;
82 82
83 /* Allocate space for the SS endpoint companion descriptor */
84 ep->ss_ep_comp = kzalloc(sizeof(struct usb_host_ss_ep_comp),
85 GFP_KERNEL);
86 if (!ep->ss_ep_comp)
87 return -ENOMEM;
88 desc = (struct usb_ss_ep_comp_descriptor *) buffer; 83 desc = (struct usb_ss_ep_comp_descriptor *) buffer;
89 if (desc->bDescriptorType != USB_DT_SS_ENDPOINT_COMP) { 84 if (desc->bDescriptorType != USB_DT_SS_ENDPOINT_COMP) {
90 dev_warn(ddev, "No SuperSpeed endpoint companion for config %d " 85 dev_warn(ddev, "No SuperSpeed endpoint companion for config %d "
91 " interface %d altsetting %d ep %d: " 86 " interface %d altsetting %d ep %d: "
92 "using minimum values\n", 87 "using minimum values\n",
93 cfgno, inum, asnum, ep->desc.bEndpointAddress); 88 cfgno, inum, asnum, ep->desc.bEndpointAddress);
94 ep->ss_ep_comp->desc.bLength = USB_DT_SS_EP_COMP_SIZE;
95 ep->ss_ep_comp->desc.bDescriptorType = USB_DT_SS_ENDPOINT_COMP;
96 ep->ss_ep_comp->desc.bMaxBurst = 0;
97 /*
98 * Leave bmAttributes as zero, which will mean no streams for
99 * bulk, and isoc won't support multiple bursts of packets.
100 * With bursts of only one packet, and a Mult of 1, the max
101 * amount of data moved per endpoint service interval is one
102 * packet.
103 */
104 if (usb_endpoint_xfer_isoc(&ep->desc) ||
105 usb_endpoint_xfer_int(&ep->desc))
106 ep->ss_ep_comp->desc.wBytesPerInterval =
107 ep->desc.wMaxPacketSize;
108 /* 89 /*
109 * The next descriptor is for an Endpoint or Interface, 90 * The next descriptor is for an Endpoint or Interface,
110 * no extra descriptors to copy into the companion structure, 91 * no extra descriptors to copy into the companion structure,
111 * and we didn't eat up any of the buffer. 92 * and we didn't eat up any of the buffer.
112 */ 93 */
113 retval = 0; 94 return 0;
114 goto valid;
115 } 95 }
116 memcpy(&ep->ss_ep_comp->desc, desc, USB_DT_SS_EP_COMP_SIZE); 96 memcpy(&ep->ss_ep_comp->desc, desc, USB_DT_SS_EP_COMP_SIZE);
117 desc = &ep->ss_ep_comp->desc; 97 desc = &ep->ss_ep_comp->desc;
@@ -320,6 +300,28 @@ static int usb_parse_endpoint(struct device *ddev, int cfgno, int inum,
320 buffer += i; 300 buffer += i;
321 size -= i; 301 size -= i;
322 302
303 /* Allocate space for the SS endpoint companion descriptor */
304 endpoint->ss_ep_comp = kzalloc(sizeof(struct usb_host_ss_ep_comp),
305 GFP_KERNEL);
306 if (!endpoint->ss_ep_comp)
307 return -ENOMEM;
308
309 /* Fill in some default values (may be overwritten later) */
310 endpoint->ss_ep_comp->desc.bLength = USB_DT_SS_EP_COMP_SIZE;
311 endpoint->ss_ep_comp->desc.bDescriptorType = USB_DT_SS_ENDPOINT_COMP;
312 endpoint->ss_ep_comp->desc.bMaxBurst = 0;
313 /*
314 * Leave bmAttributes as zero, which will mean no streams for
315 * bulk, and isoc won't support multiple bursts of packets.
316 * With bursts of only one packet, and a Mult of 1, the max
317 * amount of data moved per endpoint service interval is one
318 * packet.
319 */
320 if (usb_endpoint_xfer_isoc(&endpoint->desc) ||
321 usb_endpoint_xfer_int(&endpoint->desc))
322 endpoint->ss_ep_comp->desc.wBytesPerInterval =
323 endpoint->desc.wMaxPacketSize;
324
323 if (size > 0) { 325 if (size > 0) {
324 retval = usb_parse_ss_endpoint_companion(ddev, cfgno, 326 retval = usb_parse_ss_endpoint_companion(ddev, cfgno,
325 inum, asnum, endpoint, num_ep, buffer, 327 inum, asnum, endpoint, num_ep, buffer,
@@ -329,6 +331,10 @@ static int usb_parse_endpoint(struct device *ddev, int cfgno, int inum,
329 retval = buffer - buffer0; 331 retval = buffer - buffer0;
330 } 332 }
331 } else { 333 } else {
334 dev_warn(ddev, "config %d interface %d altsetting %d "
335 "endpoint 0x%X has no "
336 "SuperSpeed companion descriptor\n",
337 cfgno, inum, asnum, d->bEndpointAddress);
332 retval = buffer - buffer0; 338 retval = buffer - buffer0;
333 } 339 }
334 } else { 340 } else {
diff --git a/drivers/usb/core/devices.c b/drivers/usb/core/devices.c
index 73c108d117b4..96f11715cd26 100644
--- a/drivers/usb/core/devices.c
+++ b/drivers/usb/core/devices.c
@@ -136,17 +136,19 @@ static const struct class_info clas_info[] =
136 {USB_CLASS_AUDIO, "audio"}, 136 {USB_CLASS_AUDIO, "audio"},
137 {USB_CLASS_COMM, "comm."}, 137 {USB_CLASS_COMM, "comm."},
138 {USB_CLASS_HID, "HID"}, 138 {USB_CLASS_HID, "HID"},
139 {USB_CLASS_HUB, "hub"},
140 {USB_CLASS_PHYSICAL, "PID"}, 139 {USB_CLASS_PHYSICAL, "PID"},
140 {USB_CLASS_STILL_IMAGE, "still"},
141 {USB_CLASS_PRINTER, "print"}, 141 {USB_CLASS_PRINTER, "print"},
142 {USB_CLASS_MASS_STORAGE, "stor."}, 142 {USB_CLASS_MASS_STORAGE, "stor."},
143 {USB_CLASS_HUB, "hub"},
143 {USB_CLASS_CDC_DATA, "data"}, 144 {USB_CLASS_CDC_DATA, "data"},
144 {USB_CLASS_APP_SPEC, "app."},
145 {USB_CLASS_VENDOR_SPEC, "vend."},
146 {USB_CLASS_STILL_IMAGE, "still"},
147 {USB_CLASS_CSCID, "scard"}, 145 {USB_CLASS_CSCID, "scard"},
148 {USB_CLASS_CONTENT_SEC, "c-sec"}, 146 {USB_CLASS_CONTENT_SEC, "c-sec"},
149 {USB_CLASS_VIDEO, "video"}, 147 {USB_CLASS_VIDEO, "video"},
148 {USB_CLASS_WIRELESS_CONTROLLER, "wlcon"},
149 {USB_CLASS_MISC, "misc"},
150 {USB_CLASS_APP_SPEC, "app."},
151 {USB_CLASS_VENDOR_SPEC, "vend."},
150 {-1, "unk."} /* leave as last */ 152 {-1, "unk."} /* leave as last */
151}; 153};
152 154
diff --git a/drivers/usb/core/devio.c b/drivers/usb/core/devio.c
index 308609039c73..4247eccf858c 100644
--- a/drivers/usb/core/devio.c
+++ b/drivers/usb/core/devio.c
@@ -325,21 +325,34 @@ static void async_completed(struct urb *urb)
325 struct async *as = urb->context; 325 struct async *as = urb->context;
326 struct dev_state *ps = as->ps; 326 struct dev_state *ps = as->ps;
327 struct siginfo sinfo; 327 struct siginfo sinfo;
328 struct pid *pid = NULL;
329 uid_t uid = 0;
330 uid_t euid = 0;
331 u32 secid = 0;
332 int signr;
328 333
329 spin_lock(&ps->lock); 334 spin_lock(&ps->lock);
330 list_move_tail(&as->asynclist, &ps->async_completed); 335 list_move_tail(&as->asynclist, &ps->async_completed);
331 spin_unlock(&ps->lock);
332 as->status = urb->status; 336 as->status = urb->status;
333 if (as->signr) { 337 signr = as->signr;
338 if (signr) {
334 sinfo.si_signo = as->signr; 339 sinfo.si_signo = as->signr;
335 sinfo.si_errno = as->status; 340 sinfo.si_errno = as->status;
336 sinfo.si_code = SI_ASYNCIO; 341 sinfo.si_code = SI_ASYNCIO;
337 sinfo.si_addr = as->userurb; 342 sinfo.si_addr = as->userurb;
338 kill_pid_info_as_uid(as->signr, &sinfo, as->pid, as->uid, 343 pid = as->pid;
339 as->euid, as->secid); 344 uid = as->uid;
345 euid = as->euid;
346 secid = as->secid;
340 } 347 }
341 snoop(&urb->dev->dev, "urb complete\n"); 348 snoop(&urb->dev->dev, "urb complete\n");
342 snoop_urb(urb, as->userurb); 349 snoop_urb(urb, as->userurb);
350 spin_unlock(&ps->lock);
351
352 if (signr)
353 kill_pid_info_as_uid(sinfo.si_signo, &sinfo, pid, uid,
354 euid, secid);
355
343 wake_up(&ps->wait); 356 wake_up(&ps->wait);
344} 357}
345 358
@@ -582,7 +595,7 @@ static int usbdev_open(struct inode *inode, struct file *file)
582 if (!ps) 595 if (!ps)
583 goto out; 596 goto out;
584 597
585 ret = -ENOENT; 598 ret = -ENODEV;
586 599
587 /* usbdev device-node */ 600 /* usbdev device-node */
588 if (imajor(inode) == USB_DEVICE_MAJOR) 601 if (imajor(inode) == USB_DEVICE_MAJOR)
@@ -982,7 +995,7 @@ static int proc_do_submiturb(struct dev_state *ps, struct usbdevfs_urb *uurb,
982 USBDEVFS_URB_ZERO_PACKET | 995 USBDEVFS_URB_ZERO_PACKET |
983 USBDEVFS_URB_NO_INTERRUPT)) 996 USBDEVFS_URB_NO_INTERRUPT))
984 return -EINVAL; 997 return -EINVAL;
985 if (!uurb->buffer) 998 if (uurb->buffer_length > 0 && !uurb->buffer)
986 return -EINVAL; 999 return -EINVAL;
987 if (!(uurb->type == USBDEVFS_URB_TYPE_CONTROL && 1000 if (!(uurb->type == USBDEVFS_URB_TYPE_CONTROL &&
988 (uurb->endpoint & ~USB_ENDPOINT_DIR_MASK) == 0)) { 1001 (uurb->endpoint & ~USB_ENDPOINT_DIR_MASK) == 0)) {
@@ -1038,11 +1051,6 @@ static int proc_do_submiturb(struct dev_state *ps, struct usbdevfs_urb *uurb,
1038 is_in = 0; 1051 is_in = 0;
1039 uurb->endpoint &= ~USB_DIR_IN; 1052 uurb->endpoint &= ~USB_DIR_IN;
1040 } 1053 }
1041 if (!access_ok(is_in ? VERIFY_WRITE : VERIFY_READ,
1042 uurb->buffer, uurb->buffer_length)) {
1043 kfree(dr);
1044 return -EFAULT;
1045 }
1046 snoop(&ps->dev->dev, "control urb: bRequest=%02x " 1054 snoop(&ps->dev->dev, "control urb: bRequest=%02x "
1047 "bRrequestType=%02x wValue=%04x " 1055 "bRrequestType=%02x wValue=%04x "
1048 "wIndex=%04x wLength=%04x\n", 1056 "wIndex=%04x wLength=%04x\n",
@@ -1062,9 +1070,6 @@ static int proc_do_submiturb(struct dev_state *ps, struct usbdevfs_urb *uurb,
1062 uurb->number_of_packets = 0; 1070 uurb->number_of_packets = 0;
1063 if (uurb->buffer_length > MAX_USBFS_BUFFER_SIZE) 1071 if (uurb->buffer_length > MAX_USBFS_BUFFER_SIZE)
1064 return -EINVAL; 1072 return -EINVAL;
1065 if (!access_ok(is_in ? VERIFY_WRITE : VERIFY_READ,
1066 uurb->buffer, uurb->buffer_length))
1067 return -EFAULT;
1068 snoop(&ps->dev->dev, "bulk urb\n"); 1073 snoop(&ps->dev->dev, "bulk urb\n");
1069 break; 1074 break;
1070 1075
@@ -1106,28 +1111,35 @@ static int proc_do_submiturb(struct dev_state *ps, struct usbdevfs_urb *uurb,
1106 return -EINVAL; 1111 return -EINVAL;
1107 if (uurb->buffer_length > MAX_USBFS_BUFFER_SIZE) 1112 if (uurb->buffer_length > MAX_USBFS_BUFFER_SIZE)
1108 return -EINVAL; 1113 return -EINVAL;
1109 if (!access_ok(is_in ? VERIFY_WRITE : VERIFY_READ,
1110 uurb->buffer, uurb->buffer_length))
1111 return -EFAULT;
1112 snoop(&ps->dev->dev, "interrupt urb\n"); 1114 snoop(&ps->dev->dev, "interrupt urb\n");
1113 break; 1115 break;
1114 1116
1115 default: 1117 default:
1116 return -EINVAL; 1118 return -EINVAL;
1117 } 1119 }
1118 as = alloc_async(uurb->number_of_packets); 1120 if (uurb->buffer_length > 0 &&
1119 if (!as) { 1121 !access_ok(is_in ? VERIFY_WRITE : VERIFY_READ,
1122 uurb->buffer, uurb->buffer_length)) {
1120 kfree(isopkt); 1123 kfree(isopkt);
1121 kfree(dr); 1124 kfree(dr);
1122 return -ENOMEM; 1125 return -EFAULT;
1123 } 1126 }
1124 as->urb->transfer_buffer = kmalloc(uurb->buffer_length, GFP_KERNEL); 1127 as = alloc_async(uurb->number_of_packets);
1125 if (!as->urb->transfer_buffer) { 1128 if (!as) {
1126 kfree(isopkt); 1129 kfree(isopkt);
1127 kfree(dr); 1130 kfree(dr);
1128 free_async(as);
1129 return -ENOMEM; 1131 return -ENOMEM;
1130 } 1132 }
1133 if (uurb->buffer_length > 0) {
1134 as->urb->transfer_buffer = kmalloc(uurb->buffer_length,
1135 GFP_KERNEL);
1136 if (!as->urb->transfer_buffer) {
1137 kfree(isopkt);
1138 kfree(dr);
1139 free_async(as);
1140 return -ENOMEM;
1141 }
1142 }
1131 as->urb->dev = ps->dev; 1143 as->urb->dev = ps->dev;
1132 as->urb->pipe = (uurb->type << 30) | 1144 as->urb->pipe = (uurb->type << 30) |
1133 __create_pipe(ps->dev, uurb->endpoint & 0xf) | 1145 __create_pipe(ps->dev, uurb->endpoint & 0xf) |
@@ -1169,7 +1181,7 @@ static int proc_do_submiturb(struct dev_state *ps, struct usbdevfs_urb *uurb,
1169 kfree(isopkt); 1181 kfree(isopkt);
1170 as->ps = ps; 1182 as->ps = ps;
1171 as->userurb = arg; 1183 as->userurb = arg;
1172 if (uurb->endpoint & USB_DIR_IN) 1184 if (is_in && uurb->buffer_length > 0)
1173 as->userbuffer = uurb->buffer; 1185 as->userbuffer = uurb->buffer;
1174 else 1186 else
1175 as->userbuffer = NULL; 1187 as->userbuffer = NULL;
@@ -1179,9 +1191,9 @@ static int proc_do_submiturb(struct dev_state *ps, struct usbdevfs_urb *uurb,
1179 as->uid = cred->uid; 1191 as->uid = cred->uid;
1180 as->euid = cred->euid; 1192 as->euid = cred->euid;
1181 security_task_getsecid(current, &as->secid); 1193 security_task_getsecid(current, &as->secid);
1182 if (!is_in) { 1194 if (!is_in && uurb->buffer_length > 0) {
1183 if (copy_from_user(as->urb->transfer_buffer, uurb->buffer, 1195 if (copy_from_user(as->urb->transfer_buffer, uurb->buffer,
1184 as->urb->transfer_buffer_length)) { 1196 uurb->buffer_length)) {
1185 free_async(as); 1197 free_async(as);
1186 return -EFAULT; 1198 return -EFAULT;
1187 } 1199 }
@@ -1231,22 +1243,22 @@ static int processcompl(struct async *as, void __user * __user *arg)
1231 if (as->userbuffer) 1243 if (as->userbuffer)
1232 if (copy_to_user(as->userbuffer, urb->transfer_buffer, 1244 if (copy_to_user(as->userbuffer, urb->transfer_buffer,
1233 urb->transfer_buffer_length)) 1245 urb->transfer_buffer_length))
1234 return -EFAULT; 1246 goto err_out;
1235 if (put_user(as->status, &userurb->status)) 1247 if (put_user(as->status, &userurb->status))
1236 return -EFAULT; 1248 goto err_out;
1237 if (put_user(urb->actual_length, &userurb->actual_length)) 1249 if (put_user(urb->actual_length, &userurb->actual_length))
1238 return -EFAULT; 1250 goto err_out;
1239 if (put_user(urb->error_count, &userurb->error_count)) 1251 if (put_user(urb->error_count, &userurb->error_count))
1240 return -EFAULT; 1252 goto err_out;
1241 1253
1242 if (usb_endpoint_xfer_isoc(&urb->ep->desc)) { 1254 if (usb_endpoint_xfer_isoc(&urb->ep->desc)) {
1243 for (i = 0; i < urb->number_of_packets; i++) { 1255 for (i = 0; i < urb->number_of_packets; i++) {
1244 if (put_user(urb->iso_frame_desc[i].actual_length, 1256 if (put_user(urb->iso_frame_desc[i].actual_length,
1245 &userurb->iso_frame_desc[i].actual_length)) 1257 &userurb->iso_frame_desc[i].actual_length))
1246 return -EFAULT; 1258 goto err_out;
1247 if (put_user(urb->iso_frame_desc[i].status, 1259 if (put_user(urb->iso_frame_desc[i].status,
1248 &userurb->iso_frame_desc[i].status)) 1260 &userurb->iso_frame_desc[i].status))
1249 return -EFAULT; 1261 goto err_out;
1250 } 1262 }
1251 } 1263 }
1252 1264
@@ -1255,6 +1267,10 @@ static int processcompl(struct async *as, void __user * __user *arg)
1255 if (put_user(addr, (void __user * __user *)arg)) 1267 if (put_user(addr, (void __user * __user *)arg))
1256 return -EFAULT; 1268 return -EFAULT;
1257 return 0; 1269 return 0;
1270
1271err_out:
1272 free_async(as);
1273 return -EFAULT;
1258} 1274}
1259 1275
1260static struct async *reap_as(struct dev_state *ps) 1276static struct async *reap_as(struct dev_state *ps)
@@ -1305,7 +1321,8 @@ static int get_urb32(struct usbdevfs_urb *kurb,
1305 struct usbdevfs_urb32 __user *uurb) 1321 struct usbdevfs_urb32 __user *uurb)
1306{ 1322{
1307 __u32 uptr; 1323 __u32 uptr;
1308 if (get_user(kurb->type, &uurb->type) || 1324 if (!access_ok(VERIFY_READ, uurb, sizeof(*uurb)) ||
1325 __get_user(kurb->type, &uurb->type) ||
1309 __get_user(kurb->endpoint, &uurb->endpoint) || 1326 __get_user(kurb->endpoint, &uurb->endpoint) ||
1310 __get_user(kurb->status, &uurb->status) || 1327 __get_user(kurb->status, &uurb->status) ||
1311 __get_user(kurb->flags, &uurb->flags) || 1328 __get_user(kurb->flags, &uurb->flags) ||
@@ -1520,8 +1537,9 @@ static int proc_ioctl_compat(struct dev_state *ps, compat_uptr_t arg)
1520 u32 udata; 1537 u32 udata;
1521 1538
1522 uioc = compat_ptr((long)arg); 1539 uioc = compat_ptr((long)arg);
1523 if (get_user(ctrl.ifno, &uioc->ifno) || 1540 if (!access_ok(VERIFY_READ, uioc, sizeof(*uioc)) ||
1524 get_user(ctrl.ioctl_code, &uioc->ioctl_code) || 1541 __get_user(ctrl.ifno, &uioc->ifno) ||
1542 __get_user(ctrl.ioctl_code, &uioc->ioctl_code) ||
1525 __get_user(udata, &uioc->data)) 1543 __get_user(udata, &uioc->data))
1526 return -EFAULT; 1544 return -EFAULT;
1527 ctrl.data = compat_ptr(udata); 1545 ctrl.data = compat_ptr(udata);
diff --git a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c
index ce3f453f02ef..95ccfa0b9fc5 100644
--- a/drivers/usb/core/hcd.c
+++ b/drivers/usb/core/hcd.c
@@ -648,7 +648,7 @@ void usb_hcd_poll_rh_status(struct usb_hcd *hcd)
648 struct urb *urb; 648 struct urb *urb;
649 int length; 649 int length;
650 unsigned long flags; 650 unsigned long flags;
651 char buffer[4]; /* Any root hubs with > 31 ports? */ 651 char buffer[6]; /* Any root hubs with > 31 ports? */
652 652
653 if (unlikely(!hcd->rh_registered)) 653 if (unlikely(!hcd->rh_registered))
654 return; 654 return;
diff --git a/drivers/usb/core/hcd.h b/drivers/usb/core/hcd.h
index d397ecfd5b17..ec5c67ea07b7 100644
--- a/drivers/usb/core/hcd.h
+++ b/drivers/usb/core/hcd.h
@@ -227,6 +227,10 @@ struct hc_driver {
227 /* has a port been handed over to a companion? */ 227 /* has a port been handed over to a companion? */
228 int (*port_handed_over)(struct usb_hcd *, int); 228 int (*port_handed_over)(struct usb_hcd *, int);
229 229
230 /* CLEAR_TT_BUFFER completion callback */
231 void (*clear_tt_buffer_complete)(struct usb_hcd *,
232 struct usb_host_endpoint *);
233
230 /* xHCI specific functions */ 234 /* xHCI specific functions */
231 /* Called by usb_alloc_dev to alloc HC device structures */ 235 /* Called by usb_alloc_dev to alloc HC device structures */
232 int (*alloc_dev)(struct usb_hcd *, struct usb_device *); 236 int (*alloc_dev)(struct usb_hcd *, struct usb_device *);
diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
index 2af3b4f06054..71f86c60d83c 100644
--- a/drivers/usb/core/hub.c
+++ b/drivers/usb/core/hub.c
@@ -450,10 +450,10 @@ hub_clear_tt_buffer (struct usb_device *hdev, u16 devinfo, u16 tt)
450 * talking to TTs must queue control transfers (not just bulk and iso), so 450 * talking to TTs must queue control transfers (not just bulk and iso), so
451 * both can talk to the same hub concurrently. 451 * both can talk to the same hub concurrently.
452 */ 452 */
453static void hub_tt_kevent (struct work_struct *work) 453static void hub_tt_work(struct work_struct *work)
454{ 454{
455 struct usb_hub *hub = 455 struct usb_hub *hub =
456 container_of(work, struct usb_hub, tt.kevent); 456 container_of(work, struct usb_hub, tt.clear_work);
457 unsigned long flags; 457 unsigned long flags;
458 int limit = 100; 458 int limit = 100;
459 459
@@ -462,6 +462,7 @@ static void hub_tt_kevent (struct work_struct *work)
462 struct list_head *next; 462 struct list_head *next;
463 struct usb_tt_clear *clear; 463 struct usb_tt_clear *clear;
464 struct usb_device *hdev = hub->hdev; 464 struct usb_device *hdev = hub->hdev;
465 const struct hc_driver *drv;
465 int status; 466 int status;
466 467
467 next = hub->tt.clear_list.next; 468 next = hub->tt.clear_list.next;
@@ -471,21 +472,25 @@ static void hub_tt_kevent (struct work_struct *work)
471 /* drop lock so HCD can concurrently report other TT errors */ 472 /* drop lock so HCD can concurrently report other TT errors */
472 spin_unlock_irqrestore (&hub->tt.lock, flags); 473 spin_unlock_irqrestore (&hub->tt.lock, flags);
473 status = hub_clear_tt_buffer (hdev, clear->devinfo, clear->tt); 474 status = hub_clear_tt_buffer (hdev, clear->devinfo, clear->tt);
474 spin_lock_irqsave (&hub->tt.lock, flags);
475
476 if (status) 475 if (status)
477 dev_err (&hdev->dev, 476 dev_err (&hdev->dev,
478 "clear tt %d (%04x) error %d\n", 477 "clear tt %d (%04x) error %d\n",
479 clear->tt, clear->devinfo, status); 478 clear->tt, clear->devinfo, status);
479
480 /* Tell the HCD, even if the operation failed */
481 drv = clear->hcd->driver;
482 if (drv->clear_tt_buffer_complete)
483 (drv->clear_tt_buffer_complete)(clear->hcd, clear->ep);
484
480 kfree(clear); 485 kfree(clear);
486 spin_lock_irqsave(&hub->tt.lock, flags);
481 } 487 }
482 spin_unlock_irqrestore (&hub->tt.lock, flags); 488 spin_unlock_irqrestore (&hub->tt.lock, flags);
483} 489}
484 490
485/** 491/**
486 * usb_hub_tt_clear_buffer - clear control/bulk TT state in high speed hub 492 * usb_hub_clear_tt_buffer - clear control/bulk TT state in high speed hub
487 * @udev: the device whose split transaction failed 493 * @urb: an URB associated with the failed or incomplete split transaction
488 * @pipe: identifies the endpoint of the failed transaction
489 * 494 *
490 * High speed HCDs use this to tell the hub driver that some split control or 495 * High speed HCDs use this to tell the hub driver that some split control or
491 * bulk transaction failed in a way that requires clearing internal state of 496 * bulk transaction failed in a way that requires clearing internal state of
@@ -495,8 +500,10 @@ static void hub_tt_kevent (struct work_struct *work)
495 * It may not be possible for that hub to handle additional full (or low) 500 * It may not be possible for that hub to handle additional full (or low)
496 * speed transactions until that state is fully cleared out. 501 * speed transactions until that state is fully cleared out.
497 */ 502 */
498void usb_hub_tt_clear_buffer (struct usb_device *udev, int pipe) 503int usb_hub_clear_tt_buffer(struct urb *urb)
499{ 504{
505 struct usb_device *udev = urb->dev;
506 int pipe = urb->pipe;
500 struct usb_tt *tt = udev->tt; 507 struct usb_tt *tt = udev->tt;
501 unsigned long flags; 508 unsigned long flags;
502 struct usb_tt_clear *clear; 509 struct usb_tt_clear *clear;
@@ -508,7 +515,7 @@ void usb_hub_tt_clear_buffer (struct usb_device *udev, int pipe)
508 if ((clear = kmalloc (sizeof *clear, GFP_ATOMIC)) == NULL) { 515 if ((clear = kmalloc (sizeof *clear, GFP_ATOMIC)) == NULL) {
509 dev_err (&udev->dev, "can't save CLEAR_TT_BUFFER state\n"); 516 dev_err (&udev->dev, "can't save CLEAR_TT_BUFFER state\n");
510 /* FIXME recover somehow ... RESET_TT? */ 517 /* FIXME recover somehow ... RESET_TT? */
511 return; 518 return -ENOMEM;
512 } 519 }
513 520
514 /* info that CLEAR_TT_BUFFER needs */ 521 /* info that CLEAR_TT_BUFFER needs */
@@ -520,14 +527,19 @@ void usb_hub_tt_clear_buffer (struct usb_device *udev, int pipe)
520 : (USB_ENDPOINT_XFER_BULK << 11); 527 : (USB_ENDPOINT_XFER_BULK << 11);
521 if (usb_pipein (pipe)) 528 if (usb_pipein (pipe))
522 clear->devinfo |= 1 << 15; 529 clear->devinfo |= 1 << 15;
523 530
531 /* info for completion callback */
532 clear->hcd = bus_to_hcd(udev->bus);
533 clear->ep = urb->ep;
534
524 /* tell keventd to clear state for this TT */ 535 /* tell keventd to clear state for this TT */
525 spin_lock_irqsave (&tt->lock, flags); 536 spin_lock_irqsave (&tt->lock, flags);
526 list_add_tail (&clear->clear_list, &tt->clear_list); 537 list_add_tail (&clear->clear_list, &tt->clear_list);
527 schedule_work (&tt->kevent); 538 schedule_work(&tt->clear_work);
528 spin_unlock_irqrestore (&tt->lock, flags); 539 spin_unlock_irqrestore (&tt->lock, flags);
540 return 0;
529} 541}
530EXPORT_SYMBOL_GPL(usb_hub_tt_clear_buffer); 542EXPORT_SYMBOL_GPL(usb_hub_clear_tt_buffer);
531 543
532/* If do_delay is false, return the number of milliseconds the caller 544/* If do_delay is false, return the number of milliseconds the caller
533 * needs to delay. 545 * needs to delay.
@@ -818,7 +830,7 @@ static void hub_quiesce(struct usb_hub *hub, enum hub_quiescing_type type)
818 if (hub->has_indicators) 830 if (hub->has_indicators)
819 cancel_delayed_work_sync(&hub->leds); 831 cancel_delayed_work_sync(&hub->leds);
820 if (hub->tt.hub) 832 if (hub->tt.hub)
821 cancel_work_sync(&hub->tt.kevent); 833 cancel_work_sync(&hub->tt.clear_work);
822} 834}
823 835
824/* caller has locked the hub device */ 836/* caller has locked the hub device */
@@ -935,7 +947,7 @@ static int hub_configure(struct usb_hub *hub,
935 947
936 spin_lock_init (&hub->tt.lock); 948 spin_lock_init (&hub->tt.lock);
937 INIT_LIST_HEAD (&hub->tt.clear_list); 949 INIT_LIST_HEAD (&hub->tt.clear_list);
938 INIT_WORK (&hub->tt.kevent, hub_tt_kevent); 950 INIT_WORK(&hub->tt.clear_work, hub_tt_work);
939 switch (hdev->descriptor.bDeviceProtocol) { 951 switch (hdev->descriptor.bDeviceProtocol) {
940 case 0: 952 case 0:
941 break; 953 break;
diff --git a/drivers/usb/core/hub.h b/drivers/usb/core/hub.h
index 889c0f32a40b..de8081f065ed 100644
--- a/drivers/usb/core/hub.h
+++ b/drivers/usb/core/hub.h
@@ -188,16 +188,18 @@ struct usb_tt {
188 /* for control/bulk error recovery (CLEAR_TT_BUFFER) */ 188 /* for control/bulk error recovery (CLEAR_TT_BUFFER) */
189 spinlock_t lock; 189 spinlock_t lock;
190 struct list_head clear_list; /* of usb_tt_clear */ 190 struct list_head clear_list; /* of usb_tt_clear */
191 struct work_struct kevent; 191 struct work_struct clear_work;
192}; 192};
193 193
194struct usb_tt_clear { 194struct usb_tt_clear {
195 struct list_head clear_list; 195 struct list_head clear_list;
196 unsigned tt; 196 unsigned tt;
197 u16 devinfo; 197 u16 devinfo;
198 struct usb_hcd *hcd;
199 struct usb_host_endpoint *ep;
198}; 200};
199 201
200extern void usb_hub_tt_clear_buffer(struct usb_device *dev, int pipe); 202extern int usb_hub_clear_tt_buffer(struct urb *urb);
201extern void usb_ep0_reinit(struct usb_device *); 203extern void usb_ep0_reinit(struct usb_device *);
202 204
203#endif /* __LINUX_HUB_H */ 205#endif /* __LINUX_HUB_H */
diff --git a/drivers/usb/core/message.c b/drivers/usb/core/message.c
index 2bed83caacb1..9720e699f472 100644
--- a/drivers/usb/core/message.c
+++ b/drivers/usb/core/message.c
@@ -806,6 +806,48 @@ static int usb_string_sub(struct usb_device *dev, unsigned int langid,
806 return rc; 806 return rc;
807} 807}
808 808
809static int usb_get_langid(struct usb_device *dev, unsigned char *tbuf)
810{
811 int err;
812
813 if (dev->have_langid)
814 return 0;
815
816 if (dev->string_langid < 0)
817 return -EPIPE;
818
819 err = usb_string_sub(dev, 0, 0, tbuf);
820
821 /* If the string was reported but is malformed, default to english
822 * (0x0409) */
823 if (err == -ENODATA || (err > 0 && err < 4)) {
824 dev->string_langid = 0x0409;
825 dev->have_langid = 1;
826 dev_err(&dev->dev,
827 "string descriptor 0 malformed (err = %d), "
828 "defaulting to 0x%04x\n",
829 err, dev->string_langid);
830 return 0;
831 }
832
833 /* In case of all other errors, we assume the device is not able to
834 * deal with strings at all. Set string_langid to -1 in order to
835 * prevent any string to be retrieved from the device */
836 if (err < 0) {
837 dev_err(&dev->dev, "string descriptor 0 read error: %d\n",
838 err);
839 dev->string_langid = -1;
840 return -EPIPE;
841 }
842
843 /* always use the first langid listed */
844 dev->string_langid = tbuf[2] | (tbuf[3] << 8);
845 dev->have_langid = 1;
846 dev_dbg(&dev->dev, "default language 0x%04x\n",
847 dev->string_langid);
848 return 0;
849}
850
809/** 851/**
810 * usb_string - returns UTF-8 version of a string descriptor 852 * usb_string - returns UTF-8 version of a string descriptor
811 * @dev: the device whose string descriptor is being retrieved 853 * @dev: the device whose string descriptor is being retrieved
@@ -837,24 +879,9 @@ int usb_string(struct usb_device *dev, int index, char *buf, size_t size)
837 if (!tbuf) 879 if (!tbuf)
838 return -ENOMEM; 880 return -ENOMEM;
839 881
840 /* get langid for strings if it's not yet known */ 882 err = usb_get_langid(dev, tbuf);
841 if (!dev->have_langid) { 883 if (err < 0)
842 err = usb_string_sub(dev, 0, 0, tbuf); 884 goto errout;
843 if (err < 0) {
844 dev_err(&dev->dev,
845 "string descriptor 0 read error: %d\n",
846 err);
847 } else if (err < 4) {
848 dev_err(&dev->dev, "string descriptor 0 too short\n");
849 } else {
850 dev->string_langid = tbuf[2] | (tbuf[3] << 8);
851 /* always use the first langid listed */
852 dev_dbg(&dev->dev, "default language 0x%04x\n",
853 dev->string_langid);
854 }
855
856 dev->have_langid = 1;
857 }
858 885
859 err = usb_string_sub(dev, dev->string_langid, index, tbuf); 886 err = usb_string_sub(dev, dev->string_langid, index, tbuf);
860 if (err < 0) 887 if (err < 0)
diff --git a/drivers/usb/gadget/Kconfig b/drivers/usb/gadget/Kconfig
index 5d1ddf485d1e..7f8e83a954ac 100644
--- a/drivers/usb/gadget/Kconfig
+++ b/drivers/usb/gadget/Kconfig
@@ -286,6 +286,27 @@ config USB_S3C_HSOTG
286 default USB_GADGET 286 default USB_GADGET
287 select USB_GADGET_SELECTED 287 select USB_GADGET_SELECTED
288 288
289config USB_GADGET_IMX
290 boolean "Freescale IMX USB Peripheral Controller"
291 depends on ARCH_MX1
292 help
293 Freescale's IMX series include an integrated full speed
294 USB 1.1 device controller. The controller in the IMX series
295 is register-compatible.
296
297 It has Six fixed-function endpoints, as well as endpoint
298 zero (for control transfers).
299
300 Say "y" to link the driver statically, or "m" to build a
301 dynamically linked module called "imx_udc" and force all
302 gadget drivers to also be dynamically linked.
303
304config USB_IMX
305 tristate
306 depends on USB_GADGET_IMX
307 default USB_GADGET
308 select USB_GADGET_SELECTED
309
289config USB_GADGET_S3C2410 310config USB_GADGET_S3C2410
290 boolean "S3C2410 USB Device Controller" 311 boolean "S3C2410 USB Device Controller"
291 depends on ARCH_S3C2410 312 depends on ARCH_S3C2410
@@ -321,27 +342,6 @@ config USB_GADGET_MUSB_HDRC
321 This OTG-capable silicon IP is used in dual designs including 342 This OTG-capable silicon IP is used in dual designs including
322 the TI DaVinci, OMAP 243x, OMAP 343x, TUSB 6010, and ADI Blackfin 343 the TI DaVinci, OMAP 243x, OMAP 343x, TUSB 6010, and ADI Blackfin
323 344
324config USB_GADGET_IMX
325 boolean "Freescale IMX USB Peripheral Controller"
326 depends on ARCH_MX1
327 help
328 Freescale's IMX series include an integrated full speed
329 USB 1.1 device controller. The controller in the IMX series
330 is register-compatible.
331
332 It has Six fixed-function endpoints, as well as endpoint
333 zero (for control transfers).
334
335 Say "y" to link the driver statically, or "m" to build a
336 dynamically linked module called "imx_udc" and force all
337 gadget drivers to also be dynamically linked.
338
339config USB_IMX
340 tristate
341 depends on USB_GADGET_IMX
342 default USB_GADGET
343 select USB_GADGET_SELECTED
344
345config USB_GADGET_M66592 345config USB_GADGET_M66592
346 boolean "Renesas M66592 USB Peripheral Controller" 346 boolean "Renesas M66592 USB Peripheral Controller"
347 select USB_GADGET_DUALSPEED 347 select USB_GADGET_DUALSPEED
@@ -604,6 +604,7 @@ config USB_ZERO_HNPTEST
604config USB_AUDIO 604config USB_AUDIO
605 tristate "Audio Gadget (EXPERIMENTAL)" 605 tristate "Audio Gadget (EXPERIMENTAL)"
606 depends on SND 606 depends on SND
607 select SND_PCM
607 help 608 help
608 Gadget Audio is compatible with USB Audio Class specification 1.0. 609 Gadget Audio is compatible with USB Audio Class specification 1.0.
609 It will include at least one AudioControl interface, zero or more 610 It will include at least one AudioControl interface, zero or more
diff --git a/drivers/usb/gadget/amd5536udc.c b/drivers/usb/gadget/amd5536udc.c
index 826f3adde5d8..77352ccc245e 100644
--- a/drivers/usb/gadget/amd5536udc.c
+++ b/drivers/usb/gadget/amd5536udc.c
@@ -48,7 +48,6 @@
48#include <linux/ioport.h> 48#include <linux/ioport.h>
49#include <linux/sched.h> 49#include <linux/sched.h>
50#include <linux/slab.h> 50#include <linux/slab.h>
51#include <linux/smp_lock.h>
52#include <linux/errno.h> 51#include <linux/errno.h>
53#include <linux/init.h> 52#include <linux/init.h>
54#include <linux/timer.h> 53#include <linux/timer.h>
diff --git a/drivers/usb/gadget/audio.c b/drivers/usb/gadget/audio.c
index 94de7e864614..9f80f4e970bd 100644
--- a/drivers/usb/gadget/audio.c
+++ b/drivers/usb/gadget/audio.c
@@ -42,9 +42,9 @@
42 * Instead: allocate your own, using normal USB-IF procedures. 42 * Instead: allocate your own, using normal USB-IF procedures.
43 */ 43 */
44 44
45/* Thanks to NetChip Technologies for donating this product ID. */ 45/* Thanks to Linux Foundation for donating this product ID. */
46#define AUDIO_VENDOR_NUM 0x0525 /* NetChip */ 46#define AUDIO_VENDOR_NUM 0x1d6b /* Linux Foundation */
47#define AUDIO_PRODUCT_NUM 0xa4a1 /* Linux-USB Audio Gadget */ 47#define AUDIO_PRODUCT_NUM 0x0101 /* Linux-USB Audio Gadget */
48 48
49/*-------------------------------------------------------------------------*/ 49/*-------------------------------------------------------------------------*/
50 50
diff --git a/drivers/usb/gadget/ether.c b/drivers/usb/gadget/ether.c
index d006dc652e02..bd102f5052ba 100644
--- a/drivers/usb/gadget/ether.c
+++ b/drivers/usb/gadget/ether.c
@@ -293,15 +293,16 @@ static int __init eth_bind(struct usb_composite_dev *cdev)
293 /* CDC Subset */ 293 /* CDC Subset */
294 eth_config_driver.label = "CDC Subset/SAFE"; 294 eth_config_driver.label = "CDC Subset/SAFE";
295 295
296 device_desc.idVendor = cpu_to_le16(SIMPLE_VENDOR_NUM), 296 device_desc.idVendor = cpu_to_le16(SIMPLE_VENDOR_NUM);
297 device_desc.idProduct = cpu_to_le16(SIMPLE_PRODUCT_NUM), 297 device_desc.idProduct = cpu_to_le16(SIMPLE_PRODUCT_NUM);
298 device_desc.bDeviceClass = USB_CLASS_VENDOR_SPEC; 298 if (!has_rndis())
299 device_desc.bDeviceClass = USB_CLASS_VENDOR_SPEC;
299 } 300 }
300 301
301 if (has_rndis()) { 302 if (has_rndis()) {
302 /* RNDIS plus ECM-or-Subset */ 303 /* RNDIS plus ECM-or-Subset */
303 device_desc.idVendor = cpu_to_le16(RNDIS_VENDOR_NUM), 304 device_desc.idVendor = cpu_to_le16(RNDIS_VENDOR_NUM);
304 device_desc.idProduct = cpu_to_le16(RNDIS_PRODUCT_NUM), 305 device_desc.idProduct = cpu_to_le16(RNDIS_PRODUCT_NUM);
305 device_desc.bNumConfigurations = 2; 306 device_desc.bNumConfigurations = 2;
306 } 307 }
307 308
diff --git a/drivers/usb/gadget/langwell_udc.c b/drivers/usb/gadget/langwell_udc.c
index 6829d5961359..a3913519fd58 100644
--- a/drivers/usb/gadget/langwell_udc.c
+++ b/drivers/usb/gadget/langwell_udc.c
@@ -34,7 +34,6 @@
34#include <linux/ioport.h> 34#include <linux/ioport.h>
35#include <linux/sched.h> 35#include <linux/sched.h>
36#include <linux/slab.h> 36#include <linux/slab.h>
37#include <linux/smp_lock.h>
38#include <linux/errno.h> 37#include <linux/errno.h>
39#include <linux/init.h> 38#include <linux/init.h>
40#include <linux/timer.h> 39#include <linux/timer.h>
diff --git a/drivers/usb/gadget/pxa25x_udc.c b/drivers/usb/gadget/pxa25x_udc.c
index 0ce4e2819847..ed21e263f832 100644
--- a/drivers/usb/gadget/pxa25x_udc.c
+++ b/drivers/usb/gadget/pxa25x_udc.c
@@ -139,7 +139,7 @@ static int is_vbus_present(void)
139{ 139{
140 struct pxa2xx_udc_mach_info *mach = the_controller->mach; 140 struct pxa2xx_udc_mach_info *mach = the_controller->mach;
141 141
142 if (mach->gpio_vbus) { 142 if (gpio_is_valid(mach->gpio_vbus)) {
143 int value = gpio_get_value(mach->gpio_vbus); 143 int value = gpio_get_value(mach->gpio_vbus);
144 144
145 if (mach->gpio_vbus_inverted) 145 if (mach->gpio_vbus_inverted)
@@ -158,7 +158,7 @@ static void pullup_off(void)
158 struct pxa2xx_udc_mach_info *mach = the_controller->mach; 158 struct pxa2xx_udc_mach_info *mach = the_controller->mach;
159 int off_level = mach->gpio_pullup_inverted; 159 int off_level = mach->gpio_pullup_inverted;
160 160
161 if (mach->gpio_pullup) 161 if (gpio_is_valid(mach->gpio_pullup))
162 gpio_set_value(mach->gpio_pullup, off_level); 162 gpio_set_value(mach->gpio_pullup, off_level);
163 else if (mach->udc_command) 163 else if (mach->udc_command)
164 mach->udc_command(PXA2XX_UDC_CMD_DISCONNECT); 164 mach->udc_command(PXA2XX_UDC_CMD_DISCONNECT);
@@ -169,7 +169,7 @@ static void pullup_on(void)
169 struct pxa2xx_udc_mach_info *mach = the_controller->mach; 169 struct pxa2xx_udc_mach_info *mach = the_controller->mach;
170 int on_level = !mach->gpio_pullup_inverted; 170 int on_level = !mach->gpio_pullup_inverted;
171 171
172 if (mach->gpio_pullup) 172 if (gpio_is_valid(mach->gpio_pullup))
173 gpio_set_value(mach->gpio_pullup, on_level); 173 gpio_set_value(mach->gpio_pullup, on_level);
174 else if (mach->udc_command) 174 else if (mach->udc_command)
175 mach->udc_command(PXA2XX_UDC_CMD_CONNECT); 175 mach->udc_command(PXA2XX_UDC_CMD_CONNECT);
@@ -1000,7 +1000,7 @@ static int pxa25x_udc_pullup(struct usb_gadget *_gadget, int is_active)
1000 udc = container_of(_gadget, struct pxa25x_udc, gadget); 1000 udc = container_of(_gadget, struct pxa25x_udc, gadget);
1001 1001
1002 /* not all boards support pullup control */ 1002 /* not all boards support pullup control */
1003 if (!udc->mach->gpio_pullup && !udc->mach->udc_command) 1003 if (!gpio_is_valid(udc->mach->gpio_pullup) && !udc->mach->udc_command)
1004 return -EOPNOTSUPP; 1004 return -EOPNOTSUPP;
1005 1005
1006 udc->pullup = (is_active != 0); 1006 udc->pullup = (is_active != 0);
@@ -1802,11 +1802,13 @@ pxa25x_udc_irq(int irq, void *_dev)
1802 USIR0 |= tmp; 1802 USIR0 |= tmp;
1803 handled = 1; 1803 handled = 1;
1804 } 1804 }
1805#ifndef CONFIG_USB_PXA25X_SMALL
1805 if (usir1 & tmp) { 1806 if (usir1 & tmp) {
1806 handle_ep(&dev->ep[i+8]); 1807 handle_ep(&dev->ep[i+8]);
1807 USIR1 |= tmp; 1808 USIR1 |= tmp;
1808 handled = 1; 1809 handled = 1;
1809 } 1810 }
1811#endif
1810 } 1812 }
1811 } 1813 }
1812 1814
@@ -2160,7 +2162,7 @@ static int __init pxa25x_udc_probe(struct platform_device *pdev)
2160 dev->dev = &pdev->dev; 2162 dev->dev = &pdev->dev;
2161 dev->mach = pdev->dev.platform_data; 2163 dev->mach = pdev->dev.platform_data;
2162 2164
2163 if (dev->mach->gpio_vbus) { 2165 if (gpio_is_valid(dev->mach->gpio_vbus)) {
2164 if ((retval = gpio_request(dev->mach->gpio_vbus, 2166 if ((retval = gpio_request(dev->mach->gpio_vbus,
2165 "pxa25x_udc GPIO VBUS"))) { 2167 "pxa25x_udc GPIO VBUS"))) {
2166 dev_dbg(&pdev->dev, 2168 dev_dbg(&pdev->dev,
@@ -2173,7 +2175,7 @@ static int __init pxa25x_udc_probe(struct platform_device *pdev)
2173 } else 2175 } else
2174 vbus_irq = 0; 2176 vbus_irq = 0;
2175 2177
2176 if (dev->mach->gpio_pullup) { 2178 if (gpio_is_valid(dev->mach->gpio_pullup)) {
2177 if ((retval = gpio_request(dev->mach->gpio_pullup, 2179 if ((retval = gpio_request(dev->mach->gpio_pullup,
2178 "pca25x_udc GPIO PULLUP"))) { 2180 "pca25x_udc GPIO PULLUP"))) {
2179 dev_dbg(&pdev->dev, 2181 dev_dbg(&pdev->dev,
@@ -2256,10 +2258,10 @@ lubbock_fail0:
2256#endif 2258#endif
2257 free_irq(irq, dev); 2259 free_irq(irq, dev);
2258 err_irq1: 2260 err_irq1:
2259 if (dev->mach->gpio_pullup) 2261 if (gpio_is_valid(dev->mach->gpio_pullup))
2260 gpio_free(dev->mach->gpio_pullup); 2262 gpio_free(dev->mach->gpio_pullup);
2261 err_gpio_pullup: 2263 err_gpio_pullup:
2262 if (dev->mach->gpio_vbus) 2264 if (gpio_is_valid(dev->mach->gpio_vbus))
2263 gpio_free(dev->mach->gpio_vbus); 2265 gpio_free(dev->mach->gpio_vbus);
2264 err_gpio_vbus: 2266 err_gpio_vbus:
2265 clk_put(dev->clk); 2267 clk_put(dev->clk);
@@ -2294,11 +2296,11 @@ static int __exit pxa25x_udc_remove(struct platform_device *pdev)
2294 free_irq(LUBBOCK_USB_IRQ, dev); 2296 free_irq(LUBBOCK_USB_IRQ, dev);
2295 } 2297 }
2296#endif 2298#endif
2297 if (dev->mach->gpio_vbus) { 2299 if (gpio_is_valid(dev->mach->gpio_vbus)) {
2298 free_irq(gpio_to_irq(dev->mach->gpio_vbus), dev); 2300 free_irq(gpio_to_irq(dev->mach->gpio_vbus), dev);
2299 gpio_free(dev->mach->gpio_vbus); 2301 gpio_free(dev->mach->gpio_vbus);
2300 } 2302 }
2301 if (dev->mach->gpio_pullup) 2303 if (gpio_is_valid(dev->mach->gpio_pullup))
2302 gpio_free(dev->mach->gpio_pullup); 2304 gpio_free(dev->mach->gpio_pullup);
2303 2305
2304 clk_put(dev->clk); 2306 clk_put(dev->clk);
@@ -2329,7 +2331,7 @@ static int pxa25x_udc_suspend(struct platform_device *dev, pm_message_t state)
2329 struct pxa25x_udc *udc = platform_get_drvdata(dev); 2331 struct pxa25x_udc *udc = platform_get_drvdata(dev);
2330 unsigned long flags; 2332 unsigned long flags;
2331 2333
2332 if (!udc->mach->gpio_pullup && !udc->mach->udc_command) 2334 if (!gpio_is_valid(udc->mach->gpio_pullup) && !udc->mach->udc_command)
2333 WARNING("USB host won't detect disconnect!\n"); 2335 WARNING("USB host won't detect disconnect!\n");
2334 udc->suspended = 1; 2336 udc->suspended = 1;
2335 2337
diff --git a/drivers/usb/gadget/rndis.c b/drivers/usb/gadget/rndis.c
index 2b4660e08c4d..ca41b0b5afb3 100644
--- a/drivers/usb/gadget/rndis.c
+++ b/drivers/usb/gadget/rndis.c
@@ -442,6 +442,8 @@ gen_ndis_query_resp (int configNr, u32 OID, u8 *buf, unsigned buf_len,
442 442
443 case OID_802_3_MAC_OPTIONS: 443 case OID_802_3_MAC_OPTIONS:
444 pr_debug("%s: OID_802_3_MAC_OPTIONS\n", __func__); 444 pr_debug("%s: OID_802_3_MAC_OPTIONS\n", __func__);
445 *outbuf = cpu_to_le32(0);
446 retval = 0;
445 break; 447 break;
446 448
447 /* ieee802.3 statistics OIDs (table 4-4) */ 449 /* ieee802.3 statistics OIDs (table 4-4) */
diff --git a/drivers/usb/gadget/s3c2410_udc.c b/drivers/usb/gadget/s3c2410_udc.c
index 9a2b8920532d..a9b452fe6221 100644
--- a/drivers/usb/gadget/s3c2410_udc.c
+++ b/drivers/usb/gadget/s3c2410_udc.c
@@ -28,7 +28,6 @@
28#include <linux/ioport.h> 28#include <linux/ioport.h>
29#include <linux/sched.h> 29#include <linux/sched.h>
30#include <linux/slab.h> 30#include <linux/slab.h>
31#include <linux/smp_lock.h>
32#include <linux/errno.h> 31#include <linux/errno.h>
33#include <linux/init.h> 32#include <linux/init.h>
34#include <linux/timer.h> 33#include <linux/timer.h>
diff --git a/drivers/usb/host/Kconfig b/drivers/usb/host/Kconfig
index 1576a0520adf..1a920c70b5a1 100644
--- a/drivers/usb/host/Kconfig
+++ b/drivers/usb/host/Kconfig
@@ -181,26 +181,27 @@ config USB_OHCI_HCD_PPC_SOC
181 Enables support for the USB controller on the MPC52xx or 181 Enables support for the USB controller on the MPC52xx or
182 STB03xxx processor chip. If unsure, say Y. 182 STB03xxx processor chip. If unsure, say Y.
183 183
184config USB_OHCI_HCD_PPC_OF
185 bool "OHCI support for PPC USB controller on OF platform bus"
186 depends on USB_OHCI_HCD && PPC_OF
187 default y
188 ---help---
189 Enables support for the USB controller PowerPC present on the
190 OpenFirmware platform bus.
191
192config USB_OHCI_HCD_PPC_OF_BE 184config USB_OHCI_HCD_PPC_OF_BE
193 bool "Support big endian HC" 185 bool "OHCI support for OF platform bus (big endian)"
194 depends on USB_OHCI_HCD_PPC_OF 186 depends on USB_OHCI_HCD && PPC_OF
195 default y
196 select USB_OHCI_BIG_ENDIAN_DESC 187 select USB_OHCI_BIG_ENDIAN_DESC
197 select USB_OHCI_BIG_ENDIAN_MMIO 188 select USB_OHCI_BIG_ENDIAN_MMIO
189 ---help---
190 Enables support for big-endian USB controllers present on the
191 OpenFirmware platform bus.
198 192
199config USB_OHCI_HCD_PPC_OF_LE 193config USB_OHCI_HCD_PPC_OF_LE
200 bool "Support little endian HC" 194 bool "OHCI support for OF platform bus (little endian)"
201 depends on USB_OHCI_HCD_PPC_OF 195 depends on USB_OHCI_HCD && PPC_OF
202 default n
203 select USB_OHCI_LITTLE_ENDIAN 196 select USB_OHCI_LITTLE_ENDIAN
197 ---help---
198 Enables support for little-endian USB controllers present on the
199 OpenFirmware platform bus.
200
201config USB_OHCI_HCD_PPC_OF
202 bool
203 depends on USB_OHCI_HCD && PPC_OF
204 default USB_OHCI_HCD_PPC_OF_BE || USB_OHCI_HCD_PPC_OF_LE
204 205
205config USB_OHCI_HCD_PCI 206config USB_OHCI_HCD_PCI
206 bool "OHCI support for PCI-bus USB controllers" 207 bool "OHCI support for PCI-bus USB controllers"
@@ -337,10 +338,10 @@ config USB_R8A66597_HCD
337 338
338config SUPERH_ON_CHIP_R8A66597 339config SUPERH_ON_CHIP_R8A66597
339 boolean "Enable SuperH on-chip R8A66597 USB" 340 boolean "Enable SuperH on-chip R8A66597 USB"
340 depends on USB_R8A66597_HCD && (CPU_SUBTYPE_SH7366 || CPU_SUBTYPE_SH7723) 341 depends on USB_R8A66597_HCD && (CPU_SUBTYPE_SH7366 || CPU_SUBTYPE_SH7723 || CPU_SUBTYPE_SH7724)
341 help 342 help
342 This driver enables support for the on-chip R8A66597 in the 343 This driver enables support for the on-chip R8A66597 in the
343 SH7366 and SH7723 processors. 344 SH7366, SH7723 and SH7724 processors.
344 345
345config USB_WHCI_HCD 346config USB_WHCI_HCD
346 tristate "Wireless USB Host Controller Interface (WHCI) driver (EXPERIMENTAL)" 347 tristate "Wireless USB Host Controller Interface (WHCI) driver (EXPERIMENTAL)"
diff --git a/drivers/usb/host/ehci-au1xxx.c b/drivers/usb/host/ehci-au1xxx.c
index c3a778bd359c..59d208d94d4e 100644
--- a/drivers/usb/host/ehci-au1xxx.c
+++ b/drivers/usb/host/ehci-au1xxx.c
@@ -113,6 +113,8 @@ static const struct hc_driver ehci_au1xxx_hc_driver = {
113 .bus_resume = ehci_bus_resume, 113 .bus_resume = ehci_bus_resume,
114 .relinquish_port = ehci_relinquish_port, 114 .relinquish_port = ehci_relinquish_port,
115 .port_handed_over = ehci_port_handed_over, 115 .port_handed_over = ehci_port_handed_over,
116
117 .clear_tt_buffer_complete = ehci_clear_tt_buffer_complete,
116}; 118};
117 119
118static int ehci_hcd_au1xxx_drv_probe(struct platform_device *pdev) 120static int ehci_hcd_au1xxx_drv_probe(struct platform_device *pdev)
diff --git a/drivers/usb/host/ehci-fsl.c b/drivers/usb/host/ehci-fsl.c
index bf86809c5120..991174937db3 100644
--- a/drivers/usb/host/ehci-fsl.c
+++ b/drivers/usb/host/ehci-fsl.c
@@ -325,6 +325,8 @@ static const struct hc_driver ehci_fsl_hc_driver = {
325 .bus_resume = ehci_bus_resume, 325 .bus_resume = ehci_bus_resume,
326 .relinquish_port = ehci_relinquish_port, 326 .relinquish_port = ehci_relinquish_port,
327 .port_handed_over = ehci_port_handed_over, 327 .port_handed_over = ehci_port_handed_over,
328
329 .clear_tt_buffer_complete = ehci_clear_tt_buffer_complete,
328}; 330};
329 331
330static int ehci_fsl_drv_probe(struct platform_device *pdev) 332static int ehci_fsl_drv_probe(struct platform_device *pdev)
diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c
index 2b72473544d3..11c627ce6022 100644
--- a/drivers/usb/host/ehci-hcd.c
+++ b/drivers/usb/host/ehci-hcd.c
@@ -903,7 +903,8 @@ static int ehci_urb_dequeue(struct usb_hcd *hcd, struct urb *urb, int status)
903 /* already started */ 903 /* already started */
904 break; 904 break;
905 case QH_STATE_IDLE: 905 case QH_STATE_IDLE:
906 WARN_ON(1); 906 /* QH might be waiting for a Clear-TT-Buffer */
907 qh_completions(ehci, qh);
907 break; 908 break;
908 } 909 }
909 break; 910 break;
@@ -1003,6 +1004,8 @@ idle_timeout:
1003 schedule_timeout_uninterruptible(1); 1004 schedule_timeout_uninterruptible(1);
1004 goto rescan; 1005 goto rescan;
1005 case QH_STATE_IDLE: /* fully unlinked */ 1006 case QH_STATE_IDLE: /* fully unlinked */
1007 if (qh->clearing_tt)
1008 goto idle_timeout;
1006 if (list_empty (&qh->qtd_list)) { 1009 if (list_empty (&qh->qtd_list)) {
1007 qh_put (qh); 1010 qh_put (qh);
1008 break; 1011 break;
@@ -1030,12 +1033,14 @@ ehci_endpoint_reset(struct usb_hcd *hcd, struct usb_host_endpoint *ep)
1030 struct ehci_hcd *ehci = hcd_to_ehci(hcd); 1033 struct ehci_hcd *ehci = hcd_to_ehci(hcd);
1031 struct ehci_qh *qh; 1034 struct ehci_qh *qh;
1032 int eptype = usb_endpoint_type(&ep->desc); 1035 int eptype = usb_endpoint_type(&ep->desc);
1036 int epnum = usb_endpoint_num(&ep->desc);
1037 int is_out = usb_endpoint_dir_out(&ep->desc);
1038 unsigned long flags;
1033 1039
1034 if (eptype != USB_ENDPOINT_XFER_BULK && eptype != USB_ENDPOINT_XFER_INT) 1040 if (eptype != USB_ENDPOINT_XFER_BULK && eptype != USB_ENDPOINT_XFER_INT)
1035 return; 1041 return;
1036 1042
1037 rescan: 1043 spin_lock_irqsave(&ehci->lock, flags);
1038 spin_lock_irq(&ehci->lock);
1039 qh = ep->hcpriv; 1044 qh = ep->hcpriv;
1040 1045
1041 /* For Bulk and Interrupt endpoints we maintain the toggle state 1046 /* For Bulk and Interrupt endpoints we maintain the toggle state
@@ -1044,29 +1049,24 @@ ehci_endpoint_reset(struct usb_hcd *hcd, struct usb_host_endpoint *ep)
1044 * the toggle bit in the QH. 1049 * the toggle bit in the QH.
1045 */ 1050 */
1046 if (qh) { 1051 if (qh) {
1052 usb_settoggle(qh->dev, epnum, is_out, 0);
1047 if (!list_empty(&qh->qtd_list)) { 1053 if (!list_empty(&qh->qtd_list)) {
1048 WARN_ONCE(1, "clear_halt for a busy endpoint\n"); 1054 WARN_ONCE(1, "clear_halt for a busy endpoint\n");
1049 } else if (qh->qh_state == QH_STATE_IDLE) { 1055 } else if (qh->qh_state == QH_STATE_LINKED) {
1050 qh->hw_token &= ~cpu_to_hc32(ehci, QTD_TOGGLE); 1056
1051 } else { 1057 /* The toggle value in the QH can't be updated
1052 /* It's not safe to write into the overlay area 1058 * while the QH is active. Unlink it now;
1053 * while the QH is active. Unlink it first and 1059 * re-linking will call qh_refresh().
1054 * wait for the unlink to complete.
1055 */ 1060 */
1056 if (qh->qh_state == QH_STATE_LINKED) { 1061 if (eptype == USB_ENDPOINT_XFER_BULK) {
1057 if (eptype == USB_ENDPOINT_XFER_BULK) { 1062 unlink_async(ehci, qh);
1058 unlink_async(ehci, qh); 1063 } else {
1059 } else { 1064 intr_deschedule(ehci, qh);
1060 intr_deschedule(ehci, qh); 1065 (void) qh_schedule(ehci, qh);
1061 (void) qh_schedule(ehci, qh);
1062 }
1063 } 1066 }
1064 spin_unlock_irq(&ehci->lock);
1065 schedule_timeout_uninterruptible(1);
1066 goto rescan;
1067 } 1067 }
1068 } 1068 }
1069 spin_unlock_irq(&ehci->lock); 1069 spin_unlock_irqrestore(&ehci->lock, flags);
1070} 1070}
1071 1071
1072static int ehci_get_frame (struct usb_hcd *hcd) 1072static int ehci_get_frame (struct usb_hcd *hcd)
diff --git a/drivers/usb/host/ehci-ixp4xx.c b/drivers/usb/host/ehci-ixp4xx.c
index a44bb4a94954..89b7c70c6ed6 100644
--- a/drivers/usb/host/ehci-ixp4xx.c
+++ b/drivers/usb/host/ehci-ixp4xx.c
@@ -61,6 +61,8 @@ static const struct hc_driver ixp4xx_ehci_hc_driver = {
61#endif 61#endif
62 .relinquish_port = ehci_relinquish_port, 62 .relinquish_port = ehci_relinquish_port,
63 .port_handed_over = ehci_port_handed_over, 63 .port_handed_over = ehci_port_handed_over,
64
65 .clear_tt_buffer_complete = ehci_clear_tt_buffer_complete,
64}; 66};
65 67
66static int ixp4xx_ehci_probe(struct platform_device *pdev) 68static int ixp4xx_ehci_probe(struct platform_device *pdev)
diff --git a/drivers/usb/host/ehci-orion.c b/drivers/usb/host/ehci-orion.c
index 770dd9aba62a..1d283e1b2b8d 100644
--- a/drivers/usb/host/ehci-orion.c
+++ b/drivers/usb/host/ehci-orion.c
@@ -105,6 +105,7 @@ static int ehci_orion_setup(struct usb_hcd *hcd)
105 struct ehci_hcd *ehci = hcd_to_ehci(hcd); 105 struct ehci_hcd *ehci = hcd_to_ehci(hcd);
106 int retval; 106 int retval;
107 107
108 ehci_reset(ehci);
108 retval = ehci_halt(ehci); 109 retval = ehci_halt(ehci);
109 if (retval) 110 if (retval)
110 return retval; 111 return retval;
@@ -118,7 +119,6 @@ static int ehci_orion_setup(struct usb_hcd *hcd)
118 119
119 hcd->has_tt = 1; 120 hcd->has_tt = 1;
120 121
121 ehci_reset(ehci);
122 ehci_port_power(ehci, 0); 122 ehci_port_power(ehci, 0);
123 123
124 return retval; 124 return retval;
@@ -165,6 +165,8 @@ static const struct hc_driver ehci_orion_hc_driver = {
165 .bus_resume = ehci_bus_resume, 165 .bus_resume = ehci_bus_resume,
166 .relinquish_port = ehci_relinquish_port, 166 .relinquish_port = ehci_relinquish_port,
167 .port_handed_over = ehci_port_handed_over, 167 .port_handed_over = ehci_port_handed_over,
168
169 .clear_tt_buffer_complete = ehci_clear_tt_buffer_complete,
168}; 170};
169 171
170static void __init 172static void __init
diff --git a/drivers/usb/host/ehci-pci.c b/drivers/usb/host/ehci-pci.c
index f3683e1da161..c2f1b7df918c 100644
--- a/drivers/usb/host/ehci-pci.c
+++ b/drivers/usb/host/ehci-pci.c
@@ -404,6 +404,8 @@ static const struct hc_driver ehci_pci_hc_driver = {
404 .bus_resume = ehci_bus_resume, 404 .bus_resume = ehci_bus_resume,
405 .relinquish_port = ehci_relinquish_port, 405 .relinquish_port = ehci_relinquish_port,
406 .port_handed_over = ehci_port_handed_over, 406 .port_handed_over = ehci_port_handed_over,
407
408 .clear_tt_buffer_complete = ehci_clear_tt_buffer_complete,
407}; 409};
408 410
409/*-------------------------------------------------------------------------*/ 411/*-------------------------------------------------------------------------*/
diff --git a/drivers/usb/host/ehci-ppc-of.c b/drivers/usb/host/ehci-ppc-of.c
index fbd272288fc2..36f96da129f5 100644
--- a/drivers/usb/host/ehci-ppc-of.c
+++ b/drivers/usb/host/ehci-ppc-of.c
@@ -79,6 +79,8 @@ static const struct hc_driver ehci_ppc_of_hc_driver = {
79#endif 79#endif
80 .relinquish_port = ehci_relinquish_port, 80 .relinquish_port = ehci_relinquish_port,
81 .port_handed_over = ehci_port_handed_over, 81 .port_handed_over = ehci_port_handed_over,
82
83 .clear_tt_buffer_complete = ehci_clear_tt_buffer_complete,
82}; 84};
83 85
84 86
diff --git a/drivers/usb/host/ehci-ps3.c b/drivers/usb/host/ehci-ps3.c
index 93f7035d00a1..1dee33b9139e 100644
--- a/drivers/usb/host/ehci-ps3.c
+++ b/drivers/usb/host/ehci-ps3.c
@@ -75,6 +75,8 @@ static const struct hc_driver ps3_ehci_hc_driver = {
75#endif 75#endif
76 .relinquish_port = ehci_relinquish_port, 76 .relinquish_port = ehci_relinquish_port,
77 .port_handed_over = ehci_port_handed_over, 77 .port_handed_over = ehci_port_handed_over,
78
79 .clear_tt_buffer_complete = ehci_clear_tt_buffer_complete,
78}; 80};
79 81
80static int __devinit ps3_ehci_probe(struct ps3_system_bus_device *dev) 82static int __devinit ps3_ehci_probe(struct ps3_system_bus_device *dev)
diff --git a/drivers/usb/host/ehci-q.c b/drivers/usb/host/ehci-q.c
index 3192f683f807..7673554fa64d 100644
--- a/drivers/usb/host/ehci-q.c
+++ b/drivers/usb/host/ehci-q.c
@@ -93,6 +93,22 @@ qh_update (struct ehci_hcd *ehci, struct ehci_qh *qh, struct ehci_qtd *qtd)
93 qh->hw_qtd_next = QTD_NEXT(ehci, qtd->qtd_dma); 93 qh->hw_qtd_next = QTD_NEXT(ehci, qtd->qtd_dma);
94 qh->hw_alt_next = EHCI_LIST_END(ehci); 94 qh->hw_alt_next = EHCI_LIST_END(ehci);
95 95
96 /* Except for control endpoints, we make hardware maintain data
97 * toggle (like OHCI) ... here (re)initialize the toggle in the QH,
98 * and set the pseudo-toggle in udev. Only usb_clear_halt() will
99 * ever clear it.
100 */
101 if (!(qh->hw_info1 & cpu_to_hc32(ehci, 1 << 14))) {
102 unsigned is_out, epnum;
103
104 is_out = !(qtd->hw_token & cpu_to_hc32(ehci, 1 << 8));
105 epnum = (hc32_to_cpup(ehci, &qh->hw_info1) >> 8) & 0x0f;
106 if (unlikely (!usb_gettoggle (qh->dev, epnum, is_out))) {
107 qh->hw_token &= ~cpu_to_hc32(ehci, QTD_TOGGLE);
108 usb_settoggle (qh->dev, epnum, is_out, 1);
109 }
110 }
111
96 /* HC must see latest qtd and qh data before we clear ACTIVE+HALT */ 112 /* HC must see latest qtd and qh data before we clear ACTIVE+HALT */
97 wmb (); 113 wmb ();
98 qh->hw_token &= cpu_to_hc32(ehci, QTD_TOGGLE | QTD_STS_PING); 114 qh->hw_token &= cpu_to_hc32(ehci, QTD_TOGGLE | QTD_STS_PING);
@@ -123,6 +139,55 @@ qh_refresh (struct ehci_hcd *ehci, struct ehci_qh *qh)
123 139
124/*-------------------------------------------------------------------------*/ 140/*-------------------------------------------------------------------------*/
125 141
142static void qh_link_async(struct ehci_hcd *ehci, struct ehci_qh *qh);
143
144static void ehci_clear_tt_buffer_complete(struct usb_hcd *hcd,
145 struct usb_host_endpoint *ep)
146{
147 struct ehci_hcd *ehci = hcd_to_ehci(hcd);
148 struct ehci_qh *qh = ep->hcpriv;
149 unsigned long flags;
150
151 spin_lock_irqsave(&ehci->lock, flags);
152 qh->clearing_tt = 0;
153 if (qh->qh_state == QH_STATE_IDLE && !list_empty(&qh->qtd_list)
154 && HC_IS_RUNNING(hcd->state))
155 qh_link_async(ehci, qh);
156 spin_unlock_irqrestore(&ehci->lock, flags);
157}
158
159static void ehci_clear_tt_buffer(struct ehci_hcd *ehci, struct ehci_qh *qh,
160 struct urb *urb, u32 token)
161{
162
163 /* If an async split transaction gets an error or is unlinked,
164 * the TT buffer may be left in an indeterminate state. We
165 * have to clear the TT buffer.
166 *
167 * Note: this routine is never called for Isochronous transfers.
168 */
169 if (urb->dev->tt && !usb_pipeint(urb->pipe) && !qh->clearing_tt) {
170#ifdef DEBUG
171 struct usb_device *tt = urb->dev->tt->hub;
172 dev_dbg(&tt->dev,
173 "clear tt buffer port %d, a%d ep%d t%08x\n",
174 urb->dev->ttport, urb->dev->devnum,
175 usb_pipeendpoint(urb->pipe), token);
176#endif /* DEBUG */
177 if (!ehci_is_TDI(ehci)
178 || urb->dev->tt->hub !=
179 ehci_to_hcd(ehci)->self.root_hub) {
180 if (usb_hub_clear_tt_buffer(urb) == 0)
181 qh->clearing_tt = 1;
182 } else {
183
184 /* REVISIT ARC-derived cores don't clear the root
185 * hub TT buffer in this way...
186 */
187 }
188 }
189}
190
126static int qtd_copy_status ( 191static int qtd_copy_status (
127 struct ehci_hcd *ehci, 192 struct ehci_hcd *ehci,
128 struct urb *urb, 193 struct urb *urb,
@@ -149,6 +214,14 @@ static int qtd_copy_status (
149 if (token & QTD_STS_BABBLE) { 214 if (token & QTD_STS_BABBLE) {
150 /* FIXME "must" disable babbling device's port too */ 215 /* FIXME "must" disable babbling device's port too */
151 status = -EOVERFLOW; 216 status = -EOVERFLOW;
217 /* CERR nonzero + halt --> stall */
218 } else if (QTD_CERR(token)) {
219 status = -EPIPE;
220
221 /* In theory, more than one of the following bits can be set
222 * since they are sticky and the transaction is retried.
223 * Which to test first is rather arbitrary.
224 */
152 } else if (token & QTD_STS_MMF) { 225 } else if (token & QTD_STS_MMF) {
153 /* fs/ls interrupt xfer missed the complete-split */ 226 /* fs/ls interrupt xfer missed the complete-split */
154 status = -EPROTO; 227 status = -EPROTO;
@@ -157,21 +230,15 @@ static int qtd_copy_status (
157 ? -ENOSR /* hc couldn't read data */ 230 ? -ENOSR /* hc couldn't read data */
158 : -ECOMM; /* hc couldn't write data */ 231 : -ECOMM; /* hc couldn't write data */
159 } else if (token & QTD_STS_XACT) { 232 } else if (token & QTD_STS_XACT) {
160 /* timeout, bad crc, wrong PID, etc; retried */ 233 /* timeout, bad CRC, wrong PID, etc */
161 if (QTD_CERR (token)) 234 ehci_dbg(ehci, "devpath %s ep%d%s 3strikes\n",
162 status = -EPIPE; 235 urb->dev->devpath,
163 else { 236 usb_pipeendpoint(urb->pipe),
164 ehci_dbg (ehci, "devpath %s ep%d%s 3strikes\n", 237 usb_pipein(urb->pipe) ? "in" : "out");
165 urb->dev->devpath,
166 usb_pipeendpoint (urb->pipe),
167 usb_pipein (urb->pipe) ? "in" : "out");
168 status = -EPROTO;
169 }
170 /* CERR nonzero + no errors + halt --> stall */
171 } else if (QTD_CERR (token))
172 status = -EPIPE;
173 else /* unknown */
174 status = -EPROTO; 238 status = -EPROTO;
239 } else { /* unknown */
240 status = -EPROTO;
241 }
175 242
176 ehci_vdbg (ehci, 243 ehci_vdbg (ehci,
177 "dev%d ep%d%s qtd token %08x --> status %d\n", 244 "dev%d ep%d%s qtd token %08x --> status %d\n",
@@ -179,28 +246,6 @@ static int qtd_copy_status (
179 usb_pipeendpoint (urb->pipe), 246 usb_pipeendpoint (urb->pipe),
180 usb_pipein (urb->pipe) ? "in" : "out", 247 usb_pipein (urb->pipe) ? "in" : "out",
181 token, status); 248 token, status);
182
183 /* if async CSPLIT failed, try cleaning out the TT buffer */
184 if (status != -EPIPE
185 && urb->dev->tt
186 && !usb_pipeint(urb->pipe)
187 && ((token & QTD_STS_MMF) != 0
188 || QTD_CERR(token) == 0)
189 && (!ehci_is_TDI(ehci)
190 || urb->dev->tt->hub !=
191 ehci_to_hcd(ehci)->self.root_hub)) {
192#ifdef DEBUG
193 struct usb_device *tt = urb->dev->tt->hub;
194 dev_dbg (&tt->dev,
195 "clear tt buffer port %d, a%d ep%d t%08x\n",
196 urb->dev->ttport, urb->dev->devnum,
197 usb_pipeendpoint (urb->pipe), token);
198#endif /* DEBUG */
199 /* REVISIT ARC-derived cores don't clear the root
200 * hub TT buffer in this way...
201 */
202 usb_hub_tt_clear_buffer (urb->dev, urb->pipe);
203 }
204 } 249 }
205 250
206 return status; 251 return status;
@@ -330,12 +375,11 @@ qh_completions (struct ehci_hcd *ehci, struct ehci_qh *qh)
330 */ 375 */
331 if ((token & QTD_STS_XACT) && 376 if ((token & QTD_STS_XACT) &&
332 QTD_CERR(token) == 0 && 377 QTD_CERR(token) == 0 &&
333 --qh->xacterrs > 0 && 378 ++qh->xacterrs < QH_XACTERR_MAX &&
334 !urb->unlinked) { 379 !urb->unlinked) {
335 ehci_dbg(ehci, 380 ehci_dbg(ehci,
336 "detected XactErr len %zu/%zu retry %d\n", 381 "detected XactErr len %zu/%zu retry %d\n",
337 qtd->length - QTD_LENGTH(token), qtd->length, 382 qtd->length - QTD_LENGTH(token), qtd->length, qh->xacterrs);
338 QH_XACTERR_MAX - qh->xacterrs);
339 383
340 /* reset the token in the qtd and the 384 /* reset the token in the qtd and the
341 * qh overlay (which still contains 385 * qh overlay (which still contains
@@ -391,9 +435,16 @@ qh_completions (struct ehci_hcd *ehci, struct ehci_qh *qh)
391 /* qh unlinked; token in overlay may be most current */ 435 /* qh unlinked; token in overlay may be most current */
392 if (state == QH_STATE_IDLE 436 if (state == QH_STATE_IDLE
393 && cpu_to_hc32(ehci, qtd->qtd_dma) 437 && cpu_to_hc32(ehci, qtd->qtd_dma)
394 == qh->hw_current) 438 == qh->hw_current) {
395 token = hc32_to_cpu(ehci, qh->hw_token); 439 token = hc32_to_cpu(ehci, qh->hw_token);
396 440
441 /* An unlink may leave an incomplete
442 * async transaction in the TT buffer.
443 * We have to clear it.
444 */
445 ehci_clear_tt_buffer(ehci, qh, urb, token);
446 }
447
397 /* force halt for unlinked or blocked qh, so we'll 448 /* force halt for unlinked or blocked qh, so we'll
398 * patch the qh later and so that completions can't 449 * patch the qh later and so that completions can't
399 * activate it while we "know" it's stopped. 450 * activate it while we "know" it's stopped.
@@ -419,6 +470,13 @@ halt:
419 && (qtd->hw_alt_next 470 && (qtd->hw_alt_next
420 & EHCI_LIST_END(ehci))) 471 & EHCI_LIST_END(ehci)))
421 last_status = -EINPROGRESS; 472 last_status = -EINPROGRESS;
473
474 /* As part of low/full-speed endpoint-halt processing
475 * we must clear the TT buffer (11.17.5).
476 */
477 if (unlikely(last_status != -EINPROGRESS &&
478 last_status != -EREMOTEIO))
479 ehci_clear_tt_buffer(ehci, qh, urb, token);
422 } 480 }
423 481
424 /* if we're removing something not at the queue head, 482 /* if we're removing something not at the queue head,
@@ -435,7 +493,7 @@ halt:
435 last = qtd; 493 last = qtd;
436 494
437 /* reinit the xacterr counter for the next qtd */ 495 /* reinit the xacterr counter for the next qtd */
438 qh->xacterrs = QH_XACTERR_MAX; 496 qh->xacterrs = 0;
439 } 497 }
440 498
441 /* last urb's completion might still need calling */ 499 /* last urb's completion might still need calling */
@@ -834,6 +892,7 @@ done:
834 qh->qh_state = QH_STATE_IDLE; 892 qh->qh_state = QH_STATE_IDLE;
835 qh->hw_info1 = cpu_to_hc32(ehci, info1); 893 qh->hw_info1 = cpu_to_hc32(ehci, info1);
836 qh->hw_info2 = cpu_to_hc32(ehci, info2); 894 qh->hw_info2 = cpu_to_hc32(ehci, info2);
895 usb_settoggle (urb->dev, usb_pipeendpoint (urb->pipe), !is_input, 1);
837 qh_refresh (ehci, qh); 896 qh_refresh (ehci, qh);
838 return qh; 897 return qh;
839} 898}
@@ -847,6 +906,10 @@ static void qh_link_async (struct ehci_hcd *ehci, struct ehci_qh *qh)
847 __hc32 dma = QH_NEXT(ehci, qh->qh_dma); 906 __hc32 dma = QH_NEXT(ehci, qh->qh_dma);
848 struct ehci_qh *head; 907 struct ehci_qh *head;
849 908
909 /* Don't link a QH if there's a Clear-TT-Buffer pending */
910 if (unlikely(qh->clearing_tt))
911 return;
912
850 /* (re)start the async schedule? */ 913 /* (re)start the async schedule? */
851 head = ehci->async; 914 head = ehci->async;
852 timer_action_done (ehci, TIMER_ASYNC_OFF); 915 timer_action_done (ehci, TIMER_ASYNC_OFF);
@@ -864,7 +927,7 @@ static void qh_link_async (struct ehci_hcd *ehci, struct ehci_qh *qh)
864 } 927 }
865 } 928 }
866 929
867 /* clear halt and maybe recover from silicon quirk */ 930 /* clear halt and/or toggle; and maybe recover from silicon quirk */
868 if (qh->qh_state == QH_STATE_IDLE) 931 if (qh->qh_state == QH_STATE_IDLE)
869 qh_refresh (ehci, qh); 932 qh_refresh (ehci, qh);
870 933
@@ -876,7 +939,8 @@ static void qh_link_async (struct ehci_hcd *ehci, struct ehci_qh *qh)
876 head->qh_next.qh = qh; 939 head->qh_next.qh = qh;
877 head->hw_next = dma; 940 head->hw_next = dma;
878 941
879 qh->xacterrs = QH_XACTERR_MAX; 942 qh_get(qh);
943 qh->xacterrs = 0;
880 qh->qh_state = QH_STATE_LINKED; 944 qh->qh_state = QH_STATE_LINKED;
881 /* qtd completions reported later by interrupt */ 945 /* qtd completions reported later by interrupt */
882} 946}
@@ -1016,7 +1080,7 @@ submit_async (
1016 * the HC and TT handle it when the TT has a buffer ready. 1080 * the HC and TT handle it when the TT has a buffer ready.
1017 */ 1081 */
1018 if (likely (qh->qh_state == QH_STATE_IDLE)) 1082 if (likely (qh->qh_state == QH_STATE_IDLE))
1019 qh_link_async (ehci, qh_get (qh)); 1083 qh_link_async(ehci, qh);
1020 done: 1084 done:
1021 spin_unlock_irqrestore (&ehci->lock, flags); 1085 spin_unlock_irqrestore (&ehci->lock, flags);
1022 if (unlikely (qh == NULL)) 1086 if (unlikely (qh == NULL))
@@ -1051,8 +1115,6 @@ static void end_unlink_async (struct ehci_hcd *ehci)
1051 && HC_IS_RUNNING (ehci_to_hcd(ehci)->state)) 1115 && HC_IS_RUNNING (ehci_to_hcd(ehci)->state))
1052 qh_link_async (ehci, qh); 1116 qh_link_async (ehci, qh);
1053 else { 1117 else {
1054 qh_put (qh); // refcount from async list
1055
1056 /* it's not free to turn the async schedule on/off; leave it 1118 /* it's not free to turn the async schedule on/off; leave it
1057 * active but idle for a while once it empties. 1119 * active but idle for a while once it empties.
1058 */ 1120 */
@@ -1060,6 +1122,7 @@ static void end_unlink_async (struct ehci_hcd *ehci)
1060 && ehci->async->qh_next.qh == NULL) 1122 && ehci->async->qh_next.qh == NULL)
1061 timer_action (ehci, TIMER_ASYNC_OFF); 1123 timer_action (ehci, TIMER_ASYNC_OFF);
1062 } 1124 }
1125 qh_put(qh); /* refcount from async list */
1063 1126
1064 if (next) { 1127 if (next) {
1065 ehci->reclaim = NULL; 1128 ehci->reclaim = NULL;
diff --git a/drivers/usb/host/ehci-sched.c b/drivers/usb/host/ehci-sched.c
index 9d1babc7ff65..edd61ee90323 100644
--- a/drivers/usb/host/ehci-sched.c
+++ b/drivers/usb/host/ehci-sched.c
@@ -542,6 +542,7 @@ static int qh_link_periodic (struct ehci_hcd *ehci, struct ehci_qh *qh)
542 } 542 }
543 } 543 }
544 qh->qh_state = QH_STATE_LINKED; 544 qh->qh_state = QH_STATE_LINKED;
545 qh->xacterrs = 0;
545 qh_get (qh); 546 qh_get (qh);
546 547
547 /* update per-qh bandwidth for usbfs */ 548 /* update per-qh bandwidth for usbfs */
@@ -1619,11 +1620,14 @@ itd_complete (
1619 desc->status = -EPROTO; 1620 desc->status = -EPROTO;
1620 1621
1621 /* HC need not update length with this error */ 1622 /* HC need not update length with this error */
1622 if (!(t & EHCI_ISOC_BABBLE)) 1623 if (!(t & EHCI_ISOC_BABBLE)) {
1623 desc->actual_length = EHCI_ITD_LENGTH (t); 1624 desc->actual_length = EHCI_ITD_LENGTH(t);
1625 urb->actual_length += desc->actual_length;
1626 }
1624 } else if (likely ((t & EHCI_ISOC_ACTIVE) == 0)) { 1627 } else if (likely ((t & EHCI_ISOC_ACTIVE) == 0)) {
1625 desc->status = 0; 1628 desc->status = 0;
1626 desc->actual_length = EHCI_ITD_LENGTH (t); 1629 desc->actual_length = EHCI_ITD_LENGTH(t);
1630 urb->actual_length += desc->actual_length;
1627 } else { 1631 } else {
1628 /* URB was too late */ 1632 /* URB was too late */
1629 desc->status = -EXDEV; 1633 desc->status = -EXDEV;
@@ -2014,7 +2018,8 @@ sitd_complete (
2014 desc->status = -EPROTO; 2018 desc->status = -EPROTO;
2015 } else { 2019 } else {
2016 desc->status = 0; 2020 desc->status = 0;
2017 desc->actual_length = desc->length - SITD_LENGTH (t); 2021 desc->actual_length = desc->length - SITD_LENGTH(t);
2022 urb->actual_length += desc->actual_length;
2018 } 2023 }
2019 stream->depth -= stream->interval << 3; 2024 stream->depth -= stream->interval << 3;
2020 2025
diff --git a/drivers/usb/host/ehci.h b/drivers/usb/host/ehci.h
index 90ad3395bb21..2bfff30f4704 100644
--- a/drivers/usb/host/ehci.h
+++ b/drivers/usb/host/ehci.h
@@ -354,7 +354,9 @@ struct ehci_qh {
354 unsigned short period; /* polling interval */ 354 unsigned short period; /* polling interval */
355 unsigned short start; /* where polling starts */ 355 unsigned short start; /* where polling starts */
356#define NO_FRAME ((unsigned short)~0) /* pick new start */ 356#define NO_FRAME ((unsigned short)~0) /* pick new start */
357
357 struct usb_device *dev; /* access to TT */ 358 struct usb_device *dev; /* access to TT */
359 unsigned clearing_tt:1; /* Clear-TT-Buf in progress */
358} __attribute__ ((aligned (32))); 360} __attribute__ ((aligned (32)));
359 361
360/*-------------------------------------------------------------------------*/ 362/*-------------------------------------------------------------------------*/
diff --git a/drivers/usb/host/fhci-sched.c b/drivers/usb/host/fhci-sched.c
index bb63b68ddb77..62a226b61670 100644
--- a/drivers/usb/host/fhci-sched.c
+++ b/drivers/usb/host/fhci-sched.c
@@ -576,9 +576,7 @@ irqreturn_t fhci_irq(struct usb_hcd *hcd)
576 out_be16(&usb->fhci->regs->usb_event, 576 out_be16(&usb->fhci->regs->usb_event,
577 usb->saved_msk); 577 usb->saved_msk);
578 } else if (usb->port_status == FHCI_PORT_DISABLED) { 578 } else if (usb->port_status == FHCI_PORT_DISABLED) {
579 if (fhci_ioports_check_bus_state(fhci) == 1 && 579 if (fhci_ioports_check_bus_state(fhci) == 1)
580 usb->port_status != FHCI_PORT_LOW &&
581 usb->port_status != FHCI_PORT_FULL)
582 fhci_device_connected_interrupt(fhci); 580 fhci_device_connected_interrupt(fhci);
583 } 581 }
584 usb_er &= ~USB_E_RESET_MASK; 582 usb_er &= ~USB_E_RESET_MASK;
@@ -605,9 +603,7 @@ irqreturn_t fhci_irq(struct usb_hcd *hcd)
605 } 603 }
606 604
607 if (usb_er & USB_E_IDLE_MASK) { 605 if (usb_er & USB_E_IDLE_MASK) {
608 if (usb->port_status == FHCI_PORT_DISABLED && 606 if (usb->port_status == FHCI_PORT_DISABLED) {
609 usb->port_status != FHCI_PORT_LOW &&
610 usb->port_status != FHCI_PORT_FULL) {
611 usb_er &= ~USB_E_RESET_MASK; 607 usb_er &= ~USB_E_RESET_MASK;
612 fhci_device_connected_interrupt(fhci); 608 fhci_device_connected_interrupt(fhci);
613 } else if (usb->port_status == 609 } else if (usb->port_status ==
diff --git a/drivers/usb/host/isp1760-if.c b/drivers/usb/host/isp1760-if.c
index 3fa3a1702796..d4feebfc63bd 100644
--- a/drivers/usb/host/isp1760-if.c
+++ b/drivers/usb/host/isp1760-if.c
@@ -361,7 +361,7 @@ static int __devexit isp1760_plat_remove(struct platform_device *pdev)
361 361
362static struct platform_driver isp1760_plat_driver = { 362static struct platform_driver isp1760_plat_driver = {
363 .probe = isp1760_plat_probe, 363 .probe = isp1760_plat_probe,
364 .remove = isp1760_plat_remove, 364 .remove = __devexit_p(isp1760_plat_remove),
365 .driver = { 365 .driver = {
366 .name = "isp1760", 366 .name = "isp1760",
367 }, 367 },
diff --git a/drivers/usb/host/ohci-omap.c b/drivers/usb/host/ohci-omap.c
index f3aaba35e912..83cbecd2a1ed 100644
--- a/drivers/usb/host/ohci-omap.c
+++ b/drivers/usb/host/ohci-omap.c
@@ -282,6 +282,7 @@ static int ohci_omap_init(struct usb_hcd *hcd)
282static void ohci_omap_stop(struct usb_hcd *hcd) 282static void ohci_omap_stop(struct usb_hcd *hcd)
283{ 283{
284 dev_dbg(hcd->self.controller, "stopping USB Controller\n"); 284 dev_dbg(hcd->self.controller, "stopping USB Controller\n");
285 ohci_stop(hcd);
285 omap_ohci_clock_power(0); 286 omap_ohci_clock_power(0);
286} 287}
287 288
diff --git a/drivers/usb/host/r8a66597-hcd.c b/drivers/usb/host/r8a66597-hcd.c
index 56976cc0352a..e18f74946e68 100644
--- a/drivers/usb/host/r8a66597-hcd.c
+++ b/drivers/usb/host/r8a66597-hcd.c
@@ -26,7 +26,6 @@
26#include <linux/module.h> 26#include <linux/module.h>
27#include <linux/kernel.h> 27#include <linux/kernel.h>
28#include <linux/sched.h> 28#include <linux/sched.h>
29#include <linux/smp_lock.h>
30#include <linux/errno.h> 29#include <linux/errno.h>
31#include <linux/init.h> 30#include <linux/init.h>
32#include <linux/timer.h> 31#include <linux/timer.h>
diff --git a/drivers/usb/host/xhci-dbg.c b/drivers/usb/host/xhci-dbg.c
index 2501c571f855..705e34324156 100644
--- a/drivers/usb/host/xhci-dbg.c
+++ b/drivers/usb/host/xhci-dbg.c
@@ -173,6 +173,7 @@ void xhci_print_ir_set(struct xhci_hcd *xhci, struct xhci_intr_reg *ir_set, int
173{ 173{
174 void *addr; 174 void *addr;
175 u32 temp; 175 u32 temp;
176 u64 temp_64;
176 177
177 addr = &ir_set->irq_pending; 178 addr = &ir_set->irq_pending;
178 temp = xhci_readl(xhci, addr); 179 temp = xhci_readl(xhci, addr);
@@ -200,25 +201,15 @@ void xhci_print_ir_set(struct xhci_hcd *xhci, struct xhci_intr_reg *ir_set, int
200 xhci_dbg(xhci, " WARN: %p: ir_set.rsvd = 0x%x\n", 201 xhci_dbg(xhci, " WARN: %p: ir_set.rsvd = 0x%x\n",
201 addr, (unsigned int)temp); 202 addr, (unsigned int)temp);
202 203
203 addr = &ir_set->erst_base[0]; 204 addr = &ir_set->erst_base;
204 temp = xhci_readl(xhci, addr); 205 temp_64 = xhci_read_64(xhci, addr);
205 xhci_dbg(xhci, " %p: ir_set.erst_base[0] = 0x%x\n", 206 xhci_dbg(xhci, " %p: ir_set.erst_base = @%08llx\n",
206 addr, (unsigned int) temp); 207 addr, temp_64);
207
208 addr = &ir_set->erst_base[1];
209 temp = xhci_readl(xhci, addr);
210 xhci_dbg(xhci, " %p: ir_set.erst_base[1] = 0x%x\n",
211 addr, (unsigned int) temp);
212 208
213 addr = &ir_set->erst_dequeue[0]; 209 addr = &ir_set->erst_dequeue;
214 temp = xhci_readl(xhci, addr); 210 temp_64 = xhci_read_64(xhci, addr);
215 xhci_dbg(xhci, " %p: ir_set.erst_dequeue[0] = 0x%x\n", 211 xhci_dbg(xhci, " %p: ir_set.erst_dequeue = @%08llx\n",
216 addr, (unsigned int) temp); 212 addr, temp_64);
217
218 addr = &ir_set->erst_dequeue[1];
219 temp = xhci_readl(xhci, addr);
220 xhci_dbg(xhci, " %p: ir_set.erst_dequeue[1] = 0x%x\n",
221 addr, (unsigned int) temp);
222} 213}
223 214
224void xhci_print_run_regs(struct xhci_hcd *xhci) 215void xhci_print_run_regs(struct xhci_hcd *xhci)
@@ -268,8 +259,7 @@ void xhci_debug_trb(struct xhci_hcd *xhci, union xhci_trb *trb)
268 xhci_dbg(xhci, "Link TRB:\n"); 259 xhci_dbg(xhci, "Link TRB:\n");
269 xhci_print_trb_offsets(xhci, trb); 260 xhci_print_trb_offsets(xhci, trb);
270 261
271 address = trb->link.segment_ptr[0] + 262 address = trb->link.segment_ptr;
272 (((u64) trb->link.segment_ptr[1]) << 32);
273 xhci_dbg(xhci, "Next ring segment DMA address = 0x%llx\n", address); 263 xhci_dbg(xhci, "Next ring segment DMA address = 0x%llx\n", address);
274 264
275 xhci_dbg(xhci, "Interrupter target = 0x%x\n", 265 xhci_dbg(xhci, "Interrupter target = 0x%x\n",
@@ -282,8 +272,7 @@ void xhci_debug_trb(struct xhci_hcd *xhci, union xhci_trb *trb)
282 (unsigned int) (trb->link.control & TRB_NO_SNOOP)); 272 (unsigned int) (trb->link.control & TRB_NO_SNOOP));
283 break; 273 break;
284 case TRB_TYPE(TRB_TRANSFER): 274 case TRB_TYPE(TRB_TRANSFER):
285 address = trb->trans_event.buffer[0] + 275 address = trb->trans_event.buffer;
286 (((u64) trb->trans_event.buffer[1]) << 32);
287 /* 276 /*
288 * FIXME: look at flags to figure out if it's an address or if 277 * FIXME: look at flags to figure out if it's an address or if
289 * the data is directly in the buffer field. 278 * the data is directly in the buffer field.
@@ -291,8 +280,7 @@ void xhci_debug_trb(struct xhci_hcd *xhci, union xhci_trb *trb)
291 xhci_dbg(xhci, "DMA address or buffer contents= %llu\n", address); 280 xhci_dbg(xhci, "DMA address or buffer contents= %llu\n", address);
292 break; 281 break;
293 case TRB_TYPE(TRB_COMPLETION): 282 case TRB_TYPE(TRB_COMPLETION):
294 address = trb->event_cmd.cmd_trb[0] + 283 address = trb->event_cmd.cmd_trb;
295 (((u64) trb->event_cmd.cmd_trb[1]) << 32);
296 xhci_dbg(xhci, "Command TRB pointer = %llu\n", address); 284 xhci_dbg(xhci, "Command TRB pointer = %llu\n", address);
297 xhci_dbg(xhci, "Completion status = %u\n", 285 xhci_dbg(xhci, "Completion status = %u\n",
298 (unsigned int) GET_COMP_CODE(trb->event_cmd.status)); 286 (unsigned int) GET_COMP_CODE(trb->event_cmd.status));
@@ -328,8 +316,8 @@ void xhci_debug_segment(struct xhci_hcd *xhci, struct xhci_segment *seg)
328 for (i = 0; i < TRBS_PER_SEGMENT; ++i) { 316 for (i = 0; i < TRBS_PER_SEGMENT; ++i) {
329 trb = &seg->trbs[i]; 317 trb = &seg->trbs[i];
330 xhci_dbg(xhci, "@%08x %08x %08x %08x %08x\n", addr, 318 xhci_dbg(xhci, "@%08x %08x %08x %08x %08x\n", addr,
331 (unsigned int) trb->link.segment_ptr[0], 319 lower_32_bits(trb->link.segment_ptr),
332 (unsigned int) trb->link.segment_ptr[1], 320 upper_32_bits(trb->link.segment_ptr),
333 (unsigned int) trb->link.intr_target, 321 (unsigned int) trb->link.intr_target,
334 (unsigned int) trb->link.control); 322 (unsigned int) trb->link.control);
335 addr += sizeof(*trb); 323 addr += sizeof(*trb);
@@ -386,8 +374,8 @@ void xhci_dbg_erst(struct xhci_hcd *xhci, struct xhci_erst *erst)
386 entry = &erst->entries[i]; 374 entry = &erst->entries[i];
387 xhci_dbg(xhci, "@%08x %08x %08x %08x %08x\n", 375 xhci_dbg(xhci, "@%08x %08x %08x %08x %08x\n",
388 (unsigned int) addr, 376 (unsigned int) addr,
389 (unsigned int) entry->seg_addr[0], 377 lower_32_bits(entry->seg_addr),
390 (unsigned int) entry->seg_addr[1], 378 upper_32_bits(entry->seg_addr),
391 (unsigned int) entry->seg_size, 379 (unsigned int) entry->seg_size,
392 (unsigned int) entry->rsvd); 380 (unsigned int) entry->rsvd);
393 addr += sizeof(*entry); 381 addr += sizeof(*entry);
@@ -396,90 +384,147 @@ void xhci_dbg_erst(struct xhci_hcd *xhci, struct xhci_erst *erst)
396 384
397void xhci_dbg_cmd_ptrs(struct xhci_hcd *xhci) 385void xhci_dbg_cmd_ptrs(struct xhci_hcd *xhci)
398{ 386{
399 u32 val; 387 u64 val;
400 388
401 val = xhci_readl(xhci, &xhci->op_regs->cmd_ring[0]); 389 val = xhci_read_64(xhci, &xhci->op_regs->cmd_ring);
402 xhci_dbg(xhci, "// xHC command ring deq ptr low bits + flags = 0x%x\n", val); 390 xhci_dbg(xhci, "// xHC command ring deq ptr low bits + flags = @%08x\n",
403 val = xhci_readl(xhci, &xhci->op_regs->cmd_ring[1]); 391 lower_32_bits(val));
404 xhci_dbg(xhci, "// xHC command ring deq ptr high bits = 0x%x\n", val); 392 xhci_dbg(xhci, "// xHC command ring deq ptr high bits = @%08x\n",
393 upper_32_bits(val));
405} 394}
406 395
407void xhci_dbg_ctx(struct xhci_hcd *xhci, struct xhci_device_control *ctx, dma_addr_t dma, unsigned int last_ep) 396/* Print the last 32 bytes for 64-byte contexts */
397static void dbg_rsvd64(struct xhci_hcd *xhci, u64 *ctx, dma_addr_t dma)
398{
399 int i;
400 for (i = 0; i < 4; ++i) {
401 xhci_dbg(xhci, "@%p (virt) @%08llx "
402 "(dma) %#08llx - rsvd64[%d]\n",
403 &ctx[4 + i], (unsigned long long)dma,
404 ctx[4 + i], i);
405 dma += 8;
406 }
407}
408
409void xhci_dbg_slot_ctx(struct xhci_hcd *xhci, struct xhci_container_ctx *ctx)
408{ 410{
409 int i, j;
410 int last_ep_ctx = 31;
411 /* Fields are 32 bits wide, DMA addresses are in bytes */ 411 /* Fields are 32 bits wide, DMA addresses are in bytes */
412 int field_size = 32 / 8; 412 int field_size = 32 / 8;
413 int i;
413 414
414 xhci_dbg(xhci, "@%p (virt) @%08llx (dma) %#08x - drop flags\n", 415 struct xhci_slot_ctx *slot_ctx = xhci_get_slot_ctx(xhci, ctx);
415 &ctx->drop_flags, (unsigned long long)dma, 416 dma_addr_t dma = ctx->dma + ((unsigned long)slot_ctx - (unsigned long)ctx);
416 ctx->drop_flags); 417 int csz = HCC_64BYTE_CONTEXT(xhci->hcc_params);
417 dma += field_size;
418 xhci_dbg(xhci, "@%p (virt) @%08llx (dma) %#08x - add flags\n",
419 &ctx->add_flags, (unsigned long long)dma,
420 ctx->add_flags);
421 dma += field_size;
422 for (i = 0; i > 6; ++i) {
423 xhci_dbg(xhci, "@%p (virt) @%08llx (dma) %#08x - rsvd[%d]\n",
424 &ctx->rsvd[i], (unsigned long long)dma,
425 ctx->rsvd[i], i);
426 dma += field_size;
427 }
428 418
429 xhci_dbg(xhci, "Slot Context:\n"); 419 xhci_dbg(xhci, "Slot Context:\n");
430 xhci_dbg(xhci, "@%p (virt) @%08llx (dma) %#08x - dev_info\n", 420 xhci_dbg(xhci, "@%p (virt) @%08llx (dma) %#08x - dev_info\n",
431 &ctx->slot.dev_info, 421 &slot_ctx->dev_info,
432 (unsigned long long)dma, ctx->slot.dev_info); 422 (unsigned long long)dma, slot_ctx->dev_info);
433 dma += field_size; 423 dma += field_size;
434 xhci_dbg(xhci, "@%p (virt) @%08llx (dma) %#08x - dev_info2\n", 424 xhci_dbg(xhci, "@%p (virt) @%08llx (dma) %#08x - dev_info2\n",
435 &ctx->slot.dev_info2, 425 &slot_ctx->dev_info2,
436 (unsigned long long)dma, ctx->slot.dev_info2); 426 (unsigned long long)dma, slot_ctx->dev_info2);
437 dma += field_size; 427 dma += field_size;
438 xhci_dbg(xhci, "@%p (virt) @%08llx (dma) %#08x - tt_info\n", 428 xhci_dbg(xhci, "@%p (virt) @%08llx (dma) %#08x - tt_info\n",
439 &ctx->slot.tt_info, 429 &slot_ctx->tt_info,
440 (unsigned long long)dma, ctx->slot.tt_info); 430 (unsigned long long)dma, slot_ctx->tt_info);
441 dma += field_size; 431 dma += field_size;
442 xhci_dbg(xhci, "@%p (virt) @%08llx (dma) %#08x - dev_state\n", 432 xhci_dbg(xhci, "@%p (virt) @%08llx (dma) %#08x - dev_state\n",
443 &ctx->slot.dev_state, 433 &slot_ctx->dev_state,
444 (unsigned long long)dma, ctx->slot.dev_state); 434 (unsigned long long)dma, slot_ctx->dev_state);
445 dma += field_size; 435 dma += field_size;
446 for (i = 0; i > 4; ++i) { 436 for (i = 0; i < 4; ++i) {
447 xhci_dbg(xhci, "@%p (virt) @%08llx (dma) %#08x - rsvd[%d]\n", 437 xhci_dbg(xhci, "@%p (virt) @%08llx (dma) %#08x - rsvd[%d]\n",
448 &ctx->slot.reserved[i], (unsigned long long)dma, 438 &slot_ctx->reserved[i], (unsigned long long)dma,
449 ctx->slot.reserved[i], i); 439 slot_ctx->reserved[i], i);
450 dma += field_size; 440 dma += field_size;
451 } 441 }
452 442
443 if (csz)
444 dbg_rsvd64(xhci, (u64 *)slot_ctx, dma);
445}
446
447void xhci_dbg_ep_ctx(struct xhci_hcd *xhci,
448 struct xhci_container_ctx *ctx,
449 unsigned int last_ep)
450{
451 int i, j;
452 int last_ep_ctx = 31;
453 /* Fields are 32 bits wide, DMA addresses are in bytes */
454 int field_size = 32 / 8;
455 int csz = HCC_64BYTE_CONTEXT(xhci->hcc_params);
456
453 if (last_ep < 31) 457 if (last_ep < 31)
454 last_ep_ctx = last_ep + 1; 458 last_ep_ctx = last_ep + 1;
455 for (i = 0; i < last_ep_ctx; ++i) { 459 for (i = 0; i < last_ep_ctx; ++i) {
460 struct xhci_ep_ctx *ep_ctx = xhci_get_ep_ctx(xhci, ctx, i);
461 dma_addr_t dma = ctx->dma +
462 ((unsigned long)ep_ctx - (unsigned long)ctx);
463
456 xhci_dbg(xhci, "Endpoint %02d Context:\n", i); 464 xhci_dbg(xhci, "Endpoint %02d Context:\n", i);
457 xhci_dbg(xhci, "@%p (virt) @%08llx (dma) %#08x - ep_info\n", 465 xhci_dbg(xhci, "@%p (virt) @%08llx (dma) %#08x - ep_info\n",
458 &ctx->ep[i].ep_info, 466 &ep_ctx->ep_info,
459 (unsigned long long)dma, ctx->ep[i].ep_info); 467 (unsigned long long)dma, ep_ctx->ep_info);
460 dma += field_size; 468 dma += field_size;
461 xhci_dbg(xhci, "@%p (virt) @%08llx (dma) %#08x - ep_info2\n", 469 xhci_dbg(xhci, "@%p (virt) @%08llx (dma) %#08x - ep_info2\n",
462 &ctx->ep[i].ep_info2, 470 &ep_ctx->ep_info2,
463 (unsigned long long)dma, ctx->ep[i].ep_info2); 471 (unsigned long long)dma, ep_ctx->ep_info2);
464 dma += field_size;
465 xhci_dbg(xhci, "@%p (virt) @%08llx (dma) %#08x - deq[0]\n",
466 &ctx->ep[i].deq[0],
467 (unsigned long long)dma, ctx->ep[i].deq[0]);
468 dma += field_size;
469 xhci_dbg(xhci, "@%p (virt) @%08llx (dma) %#08x - deq[1]\n",
470 &ctx->ep[i].deq[1],
471 (unsigned long long)dma, ctx->ep[i].deq[1]);
472 dma += field_size; 472 dma += field_size;
473 xhci_dbg(xhci, "@%p (virt) @%08llx (dma) %#08llx - deq\n",
474 &ep_ctx->deq,
475 (unsigned long long)dma, ep_ctx->deq);
476 dma += 2*field_size;
473 xhci_dbg(xhci, "@%p (virt) @%08llx (dma) %#08x - tx_info\n", 477 xhci_dbg(xhci, "@%p (virt) @%08llx (dma) %#08x - tx_info\n",
474 &ctx->ep[i].tx_info, 478 &ep_ctx->tx_info,
475 (unsigned long long)dma, ctx->ep[i].tx_info); 479 (unsigned long long)dma, ep_ctx->tx_info);
476 dma += field_size; 480 dma += field_size;
477 for (j = 0; j < 3; ++j) { 481 for (j = 0; j < 3; ++j) {
478 xhci_dbg(xhci, "@%p (virt) @%08llx (dma) %#08x - rsvd[%d]\n", 482 xhci_dbg(xhci, "@%p (virt) @%08llx (dma) %#08x - rsvd[%d]\n",
479 &ctx->ep[i].reserved[j], 483 &ep_ctx->reserved[j],
480 (unsigned long long)dma, 484 (unsigned long long)dma,
481 ctx->ep[i].reserved[j], j); 485 ep_ctx->reserved[j], j);
486 dma += field_size;
487 }
488
489 if (csz)
490 dbg_rsvd64(xhci, (u64 *)ep_ctx, dma);
491 }
492}
493
494void xhci_dbg_ctx(struct xhci_hcd *xhci,
495 struct xhci_container_ctx *ctx,
496 unsigned int last_ep)
497{
498 int i;
499 /* Fields are 32 bits wide, DMA addresses are in bytes */
500 int field_size = 32 / 8;
501 struct xhci_slot_ctx *slot_ctx;
502 dma_addr_t dma = ctx->dma;
503 int csz = HCC_64BYTE_CONTEXT(xhci->hcc_params);
504
505 if (ctx->type == XHCI_CTX_TYPE_INPUT) {
506 struct xhci_input_control_ctx *ctrl_ctx =
507 xhci_get_input_control_ctx(xhci, ctx);
508 xhci_dbg(xhci, "@%p (virt) @%08llx (dma) %#08x - drop flags\n",
509 &ctrl_ctx->drop_flags, (unsigned long long)dma,
510 ctrl_ctx->drop_flags);
511 dma += field_size;
512 xhci_dbg(xhci, "@%p (virt) @%08llx (dma) %#08x - add flags\n",
513 &ctrl_ctx->add_flags, (unsigned long long)dma,
514 ctrl_ctx->add_flags);
515 dma += field_size;
516 for (i = 0; i < 6; ++i) {
517 xhci_dbg(xhci, "@%p (virt) @%08llx (dma) %#08x - rsvd2[%d]\n",
518 &ctrl_ctx->rsvd2[i], (unsigned long long)dma,
519 ctrl_ctx->rsvd2[i], i);
482 dma += field_size; 520 dma += field_size;
483 } 521 }
522
523 if (csz)
524 dbg_rsvd64(xhci, (u64 *)ctrl_ctx, dma);
484 } 525 }
526
527 slot_ctx = xhci_get_slot_ctx(xhci, ctx);
528 xhci_dbg_slot_ctx(xhci, ctx);
529 xhci_dbg_ep_ctx(xhci, ctx, last_ep);
485} 530}
diff --git a/drivers/usb/host/xhci-hcd.c b/drivers/usb/host/xhci-hcd.c
index dba3e07ccd09..816c39caca1c 100644
--- a/drivers/usb/host/xhci-hcd.c
+++ b/drivers/usb/host/xhci-hcd.c
@@ -103,7 +103,10 @@ int xhci_reset(struct xhci_hcd *xhci)
103 u32 state; 103 u32 state;
104 104
105 state = xhci_readl(xhci, &xhci->op_regs->status); 105 state = xhci_readl(xhci, &xhci->op_regs->status);
106 BUG_ON((state & STS_HALT) == 0); 106 if ((state & STS_HALT) == 0) {
107 xhci_warn(xhci, "Host controller not halted, aborting reset.\n");
108 return 0;
109 }
107 110
108 xhci_dbg(xhci, "// Reset the HC\n"); 111 xhci_dbg(xhci, "// Reset the HC\n");
109 command = xhci_readl(xhci, &xhci->op_regs->command); 112 command = xhci_readl(xhci, &xhci->op_regs->command);
@@ -226,6 +229,7 @@ int xhci_init(struct usb_hcd *hcd)
226static void xhci_work(struct xhci_hcd *xhci) 229static void xhci_work(struct xhci_hcd *xhci)
227{ 230{
228 u32 temp; 231 u32 temp;
232 u64 temp_64;
229 233
230 /* 234 /*
231 * Clear the op reg interrupt status first, 235 * Clear the op reg interrupt status first,
@@ -248,9 +252,9 @@ static void xhci_work(struct xhci_hcd *xhci)
248 /* FIXME this should be a delayed service routine that clears the EHB */ 252 /* FIXME this should be a delayed service routine that clears the EHB */
249 xhci_handle_event(xhci); 253 xhci_handle_event(xhci);
250 254
251 /* Clear the event handler busy flag; the event ring should be empty. */ 255 /* Clear the event handler busy flag (RW1C); the event ring should be empty. */
252 temp = xhci_readl(xhci, &xhci->ir_set->erst_dequeue[0]); 256 temp_64 = xhci_read_64(xhci, &xhci->ir_set->erst_dequeue);
253 xhci_writel(xhci, temp & ~ERST_EHB, &xhci->ir_set->erst_dequeue[0]); 257 xhci_write_64(xhci, temp_64 | ERST_EHB, &xhci->ir_set->erst_dequeue);
254 /* Flush posted writes -- FIXME is this necessary? */ 258 /* Flush posted writes -- FIXME is this necessary? */
255 xhci_readl(xhci, &xhci->ir_set->irq_pending); 259 xhci_readl(xhci, &xhci->ir_set->irq_pending);
256} 260}
@@ -266,19 +270,34 @@ irqreturn_t xhci_irq(struct usb_hcd *hcd)
266{ 270{
267 struct xhci_hcd *xhci = hcd_to_xhci(hcd); 271 struct xhci_hcd *xhci = hcd_to_xhci(hcd);
268 u32 temp, temp2; 272 u32 temp, temp2;
273 union xhci_trb *trb;
269 274
270 spin_lock(&xhci->lock); 275 spin_lock(&xhci->lock);
276 trb = xhci->event_ring->dequeue;
271 /* Check if the xHC generated the interrupt, or the irq is shared */ 277 /* Check if the xHC generated the interrupt, or the irq is shared */
272 temp = xhci_readl(xhci, &xhci->op_regs->status); 278 temp = xhci_readl(xhci, &xhci->op_regs->status);
273 temp2 = xhci_readl(xhci, &xhci->ir_set->irq_pending); 279 temp2 = xhci_readl(xhci, &xhci->ir_set->irq_pending);
280 if (temp == 0xffffffff && temp2 == 0xffffffff)
281 goto hw_died;
282
274 if (!(temp & STS_EINT) && !ER_IRQ_PENDING(temp2)) { 283 if (!(temp & STS_EINT) && !ER_IRQ_PENDING(temp2)) {
275 spin_unlock(&xhci->lock); 284 spin_unlock(&xhci->lock);
276 return IRQ_NONE; 285 return IRQ_NONE;
277 } 286 }
287 xhci_dbg(xhci, "op reg status = %08x\n", temp);
288 xhci_dbg(xhci, "ir set irq_pending = %08x\n", temp2);
289 xhci_dbg(xhci, "Event ring dequeue ptr:\n");
290 xhci_dbg(xhci, "@%llx %08x %08x %08x %08x\n",
291 (unsigned long long)xhci_trb_virt_to_dma(xhci->event_ring->deq_seg, trb),
292 lower_32_bits(trb->link.segment_ptr),
293 upper_32_bits(trb->link.segment_ptr),
294 (unsigned int) trb->link.intr_target,
295 (unsigned int) trb->link.control);
278 296
279 if (temp & STS_FATAL) { 297 if (temp & STS_FATAL) {
280 xhci_warn(xhci, "WARNING: Host System Error\n"); 298 xhci_warn(xhci, "WARNING: Host System Error\n");
281 xhci_halt(xhci); 299 xhci_halt(xhci);
300hw_died:
282 xhci_to_hcd(xhci)->state = HC_STATE_HALT; 301 xhci_to_hcd(xhci)->state = HC_STATE_HALT;
283 spin_unlock(&xhci->lock); 302 spin_unlock(&xhci->lock);
284 return -ESHUTDOWN; 303 return -ESHUTDOWN;
@@ -295,6 +314,7 @@ void xhci_event_ring_work(unsigned long arg)
295{ 314{
296 unsigned long flags; 315 unsigned long flags;
297 int temp; 316 int temp;
317 u64 temp_64;
298 struct xhci_hcd *xhci = (struct xhci_hcd *) arg; 318 struct xhci_hcd *xhci = (struct xhci_hcd *) arg;
299 int i, j; 319 int i, j;
300 320
@@ -311,9 +331,9 @@ void xhci_event_ring_work(unsigned long arg)
311 xhci_dbg(xhci, "Event ring:\n"); 331 xhci_dbg(xhci, "Event ring:\n");
312 xhci_debug_segment(xhci, xhci->event_ring->deq_seg); 332 xhci_debug_segment(xhci, xhci->event_ring->deq_seg);
313 xhci_dbg_ring_ptrs(xhci, xhci->event_ring); 333 xhci_dbg_ring_ptrs(xhci, xhci->event_ring);
314 temp = xhci_readl(xhci, &xhci->ir_set->erst_dequeue[0]); 334 temp_64 = xhci_read_64(xhci, &xhci->ir_set->erst_dequeue);
315 temp &= ERST_PTR_MASK; 335 temp_64 &= ~ERST_PTR_MASK;
316 xhci_dbg(xhci, "ERST deq = 0x%x\n", temp); 336 xhci_dbg(xhci, "ERST deq = 64'h%0lx\n", (long unsigned int) temp_64);
317 xhci_dbg(xhci, "Command ring:\n"); 337 xhci_dbg(xhci, "Command ring:\n");
318 xhci_debug_segment(xhci, xhci->cmd_ring->deq_seg); 338 xhci_debug_segment(xhci, xhci->cmd_ring->deq_seg);
319 xhci_dbg_ring_ptrs(xhci, xhci->cmd_ring); 339 xhci_dbg_ring_ptrs(xhci, xhci->cmd_ring);
@@ -356,6 +376,7 @@ void xhci_event_ring_work(unsigned long arg)
356int xhci_run(struct usb_hcd *hcd) 376int xhci_run(struct usb_hcd *hcd)
357{ 377{
358 u32 temp; 378 u32 temp;
379 u64 temp_64;
359 struct xhci_hcd *xhci = hcd_to_xhci(hcd); 380 struct xhci_hcd *xhci = hcd_to_xhci(hcd);
360 void (*doorbell)(struct xhci_hcd *) = NULL; 381 void (*doorbell)(struct xhci_hcd *) = NULL;
361 382
@@ -382,6 +403,20 @@ int xhci_run(struct usb_hcd *hcd)
382 add_timer(&xhci->event_ring_timer); 403 add_timer(&xhci->event_ring_timer);
383#endif 404#endif
384 405
406 xhci_dbg(xhci, "Command ring memory map follows:\n");
407 xhci_debug_ring(xhci, xhci->cmd_ring);
408 xhci_dbg_ring_ptrs(xhci, xhci->cmd_ring);
409 xhci_dbg_cmd_ptrs(xhci);
410
411 xhci_dbg(xhci, "ERST memory map follows:\n");
412 xhci_dbg_erst(xhci, &xhci->erst);
413 xhci_dbg(xhci, "Event ring:\n");
414 xhci_debug_ring(xhci, xhci->event_ring);
415 xhci_dbg_ring_ptrs(xhci, xhci->event_ring);
416 temp_64 = xhci_read_64(xhci, &xhci->ir_set->erst_dequeue);
417 temp_64 &= ~ERST_PTR_MASK;
418 xhci_dbg(xhci, "ERST deq = 64'h%0lx\n", (long unsigned int) temp_64);
419
385 xhci_dbg(xhci, "// Set the interrupt modulation register\n"); 420 xhci_dbg(xhci, "// Set the interrupt modulation register\n");
386 temp = xhci_readl(xhci, &xhci->ir_set->irq_control); 421 temp = xhci_readl(xhci, &xhci->ir_set->irq_control);
387 temp &= ~ER_IRQ_INTERVAL_MASK; 422 temp &= ~ER_IRQ_INTERVAL_MASK;
@@ -406,22 +441,6 @@ int xhci_run(struct usb_hcd *hcd)
406 if (NUM_TEST_NOOPS > 0) 441 if (NUM_TEST_NOOPS > 0)
407 doorbell = xhci_setup_one_noop(xhci); 442 doorbell = xhci_setup_one_noop(xhci);
408 443
409 xhci_dbg(xhci, "Command ring memory map follows:\n");
410 xhci_debug_ring(xhci, xhci->cmd_ring);
411 xhci_dbg_ring_ptrs(xhci, xhci->cmd_ring);
412 xhci_dbg_cmd_ptrs(xhci);
413
414 xhci_dbg(xhci, "ERST memory map follows:\n");
415 xhci_dbg_erst(xhci, &xhci->erst);
416 xhci_dbg(xhci, "Event ring:\n");
417 xhci_debug_ring(xhci, xhci->event_ring);
418 xhci_dbg_ring_ptrs(xhci, xhci->event_ring);
419 temp = xhci_readl(xhci, &xhci->ir_set->erst_dequeue[0]);
420 temp &= ERST_PTR_MASK;
421 xhci_dbg(xhci, "ERST deq = 0x%x\n", temp);
422 temp = xhci_readl(xhci, &xhci->ir_set->erst_dequeue[1]);
423 xhci_dbg(xhci, "ERST deq upper = 0x%x\n", temp);
424
425 temp = xhci_readl(xhci, &xhci->op_regs->command); 444 temp = xhci_readl(xhci, &xhci->op_regs->command);
426 temp |= (CMD_RUN); 445 temp |= (CMD_RUN);
427 xhci_dbg(xhci, "// Turn on HC, cmd = 0x%x.\n", 446 xhci_dbg(xhci, "// Turn on HC, cmd = 0x%x.\n",
@@ -601,10 +620,13 @@ int xhci_urb_enqueue(struct usb_hcd *hcd, struct urb *urb, gfp_t mem_flags)
601 goto exit; 620 goto exit;
602 } 621 }
603 if (usb_endpoint_xfer_control(&urb->ep->desc)) 622 if (usb_endpoint_xfer_control(&urb->ep->desc))
604 ret = xhci_queue_ctrl_tx(xhci, mem_flags, urb, 623 /* We have a spinlock and interrupts disabled, so we must pass
624 * atomic context to this function, which may allocate memory.
625 */
626 ret = xhci_queue_ctrl_tx(xhci, GFP_ATOMIC, urb,
605 slot_id, ep_index); 627 slot_id, ep_index);
606 else if (usb_endpoint_xfer_bulk(&urb->ep->desc)) 628 else if (usb_endpoint_xfer_bulk(&urb->ep->desc))
607 ret = xhci_queue_bulk_tx(xhci, mem_flags, urb, 629 ret = xhci_queue_bulk_tx(xhci, GFP_ATOMIC, urb,
608 slot_id, ep_index); 630 slot_id, ep_index);
609 else 631 else
610 ret = -EINVAL; 632 ret = -EINVAL;
@@ -661,8 +683,12 @@ int xhci_urb_dequeue(struct usb_hcd *hcd, struct urb *urb, int status)
661 goto done; 683 goto done;
662 684
663 xhci_dbg(xhci, "Cancel URB %p\n", urb); 685 xhci_dbg(xhci, "Cancel URB %p\n", urb);
686 xhci_dbg(xhci, "Event ring:\n");
687 xhci_debug_ring(xhci, xhci->event_ring);
664 ep_index = xhci_get_endpoint_index(&urb->ep->desc); 688 ep_index = xhci_get_endpoint_index(&urb->ep->desc);
665 ep_ring = xhci->devs[urb->dev->slot_id]->ep_rings[ep_index]; 689 ep_ring = xhci->devs[urb->dev->slot_id]->ep_rings[ep_index];
690 xhci_dbg(xhci, "Endpoint ring:\n");
691 xhci_debug_ring(xhci, ep_ring);
666 td = (struct xhci_td *) urb->hcpriv; 692 td = (struct xhci_td *) urb->hcpriv;
667 693
668 ep_ring->cancels_pending++; 694 ep_ring->cancels_pending++;
@@ -696,7 +722,9 @@ int xhci_drop_endpoint(struct usb_hcd *hcd, struct usb_device *udev,
696 struct usb_host_endpoint *ep) 722 struct usb_host_endpoint *ep)
697{ 723{
698 struct xhci_hcd *xhci; 724 struct xhci_hcd *xhci;
699 struct xhci_device_control *in_ctx; 725 struct xhci_container_ctx *in_ctx, *out_ctx;
726 struct xhci_input_control_ctx *ctrl_ctx;
727 struct xhci_slot_ctx *slot_ctx;
700 unsigned int last_ctx; 728 unsigned int last_ctx;
701 unsigned int ep_index; 729 unsigned int ep_index;
702 struct xhci_ep_ctx *ep_ctx; 730 struct xhci_ep_ctx *ep_ctx;
@@ -724,31 +752,34 @@ int xhci_drop_endpoint(struct usb_hcd *hcd, struct usb_device *udev,
724 } 752 }
725 753
726 in_ctx = xhci->devs[udev->slot_id]->in_ctx; 754 in_ctx = xhci->devs[udev->slot_id]->in_ctx;
755 out_ctx = xhci->devs[udev->slot_id]->out_ctx;
756 ctrl_ctx = xhci_get_input_control_ctx(xhci, in_ctx);
727 ep_index = xhci_get_endpoint_index(&ep->desc); 757 ep_index = xhci_get_endpoint_index(&ep->desc);
728 ep_ctx = &xhci->devs[udev->slot_id]->out_ctx->ep[ep_index]; 758 ep_ctx = xhci_get_ep_ctx(xhci, out_ctx, ep_index);
729 /* If the HC already knows the endpoint is disabled, 759 /* If the HC already knows the endpoint is disabled,
730 * or the HCD has noted it is disabled, ignore this request 760 * or the HCD has noted it is disabled, ignore this request
731 */ 761 */
732 if ((ep_ctx->ep_info & EP_STATE_MASK) == EP_STATE_DISABLED || 762 if ((ep_ctx->ep_info & EP_STATE_MASK) == EP_STATE_DISABLED ||
733 in_ctx->drop_flags & xhci_get_endpoint_flag(&ep->desc)) { 763 ctrl_ctx->drop_flags & xhci_get_endpoint_flag(&ep->desc)) {
734 xhci_warn(xhci, "xHCI %s called with disabled ep %p\n", 764 xhci_warn(xhci, "xHCI %s called with disabled ep %p\n",
735 __func__, ep); 765 __func__, ep);
736 return 0; 766 return 0;
737 } 767 }
738 768
739 in_ctx->drop_flags |= drop_flag; 769 ctrl_ctx->drop_flags |= drop_flag;
740 new_drop_flags = in_ctx->drop_flags; 770 new_drop_flags = ctrl_ctx->drop_flags;
741 771
742 in_ctx->add_flags = ~drop_flag; 772 ctrl_ctx->add_flags = ~drop_flag;
743 new_add_flags = in_ctx->add_flags; 773 new_add_flags = ctrl_ctx->add_flags;
744 774
745 last_ctx = xhci_last_valid_endpoint(in_ctx->add_flags); 775 last_ctx = xhci_last_valid_endpoint(ctrl_ctx->add_flags);
776 slot_ctx = xhci_get_slot_ctx(xhci, in_ctx);
746 /* Update the last valid endpoint context, if we deleted the last one */ 777 /* Update the last valid endpoint context, if we deleted the last one */
747 if ((in_ctx->slot.dev_info & LAST_CTX_MASK) > LAST_CTX(last_ctx)) { 778 if ((slot_ctx->dev_info & LAST_CTX_MASK) > LAST_CTX(last_ctx)) {
748 in_ctx->slot.dev_info &= ~LAST_CTX_MASK; 779 slot_ctx->dev_info &= ~LAST_CTX_MASK;
749 in_ctx->slot.dev_info |= LAST_CTX(last_ctx); 780 slot_ctx->dev_info |= LAST_CTX(last_ctx);
750 } 781 }
751 new_slot_info = in_ctx->slot.dev_info; 782 new_slot_info = slot_ctx->dev_info;
752 783
753 xhci_endpoint_zero(xhci, xhci->devs[udev->slot_id], ep); 784 xhci_endpoint_zero(xhci, xhci->devs[udev->slot_id], ep);
754 785
@@ -778,17 +809,22 @@ int xhci_add_endpoint(struct usb_hcd *hcd, struct usb_device *udev,
778 struct usb_host_endpoint *ep) 809 struct usb_host_endpoint *ep)
779{ 810{
780 struct xhci_hcd *xhci; 811 struct xhci_hcd *xhci;
781 struct xhci_device_control *in_ctx; 812 struct xhci_container_ctx *in_ctx, *out_ctx;
782 unsigned int ep_index; 813 unsigned int ep_index;
783 struct xhci_ep_ctx *ep_ctx; 814 struct xhci_ep_ctx *ep_ctx;
815 struct xhci_slot_ctx *slot_ctx;
816 struct xhci_input_control_ctx *ctrl_ctx;
784 u32 added_ctxs; 817 u32 added_ctxs;
785 unsigned int last_ctx; 818 unsigned int last_ctx;
786 u32 new_add_flags, new_drop_flags, new_slot_info; 819 u32 new_add_flags, new_drop_flags, new_slot_info;
787 int ret = 0; 820 int ret = 0;
788 821
789 ret = xhci_check_args(hcd, udev, ep, 1, __func__); 822 ret = xhci_check_args(hcd, udev, ep, 1, __func__);
790 if (ret <= 0) 823 if (ret <= 0) {
824 /* So we won't queue a reset ep command for a root hub */
825 ep->hcpriv = NULL;
791 return ret; 826 return ret;
827 }
792 xhci = hcd_to_xhci(hcd); 828 xhci = hcd_to_xhci(hcd);
793 829
794 added_ctxs = xhci_get_endpoint_flag(&ep->desc); 830 added_ctxs = xhci_get_endpoint_flag(&ep->desc);
@@ -810,12 +846,14 @@ int xhci_add_endpoint(struct usb_hcd *hcd, struct usb_device *udev,
810 } 846 }
811 847
812 in_ctx = xhci->devs[udev->slot_id]->in_ctx; 848 in_ctx = xhci->devs[udev->slot_id]->in_ctx;
849 out_ctx = xhci->devs[udev->slot_id]->out_ctx;
850 ctrl_ctx = xhci_get_input_control_ctx(xhci, in_ctx);
813 ep_index = xhci_get_endpoint_index(&ep->desc); 851 ep_index = xhci_get_endpoint_index(&ep->desc);
814 ep_ctx = &xhci->devs[udev->slot_id]->out_ctx->ep[ep_index]; 852 ep_ctx = xhci_get_ep_ctx(xhci, out_ctx, ep_index);
815 /* If the HCD has already noted the endpoint is enabled, 853 /* If the HCD has already noted the endpoint is enabled,
816 * ignore this request. 854 * ignore this request.
817 */ 855 */
818 if (in_ctx->add_flags & xhci_get_endpoint_flag(&ep->desc)) { 856 if (ctrl_ctx->add_flags & xhci_get_endpoint_flag(&ep->desc)) {
819 xhci_warn(xhci, "xHCI %s called with enabled ep %p\n", 857 xhci_warn(xhci, "xHCI %s called with enabled ep %p\n",
820 __func__, ep); 858 __func__, ep);
821 return 0; 859 return 0;
@@ -833,8 +871,8 @@ int xhci_add_endpoint(struct usb_hcd *hcd, struct usb_device *udev,
833 return -ENOMEM; 871 return -ENOMEM;
834 } 872 }
835 873
836 in_ctx->add_flags |= added_ctxs; 874 ctrl_ctx->add_flags |= added_ctxs;
837 new_add_flags = in_ctx->add_flags; 875 new_add_flags = ctrl_ctx->add_flags;
838 876
839 /* If xhci_endpoint_disable() was called for this endpoint, but the 877 /* If xhci_endpoint_disable() was called for this endpoint, but the
840 * xHC hasn't been notified yet through the check_bandwidth() call, 878 * xHC hasn't been notified yet through the check_bandwidth() call,
@@ -842,14 +880,18 @@ int xhci_add_endpoint(struct usb_hcd *hcd, struct usb_device *udev,
842 * descriptors. We must drop and re-add this endpoint, so we leave the 880 * descriptors. We must drop and re-add this endpoint, so we leave the
843 * drop flags alone. 881 * drop flags alone.
844 */ 882 */
845 new_drop_flags = in_ctx->drop_flags; 883 new_drop_flags = ctrl_ctx->drop_flags;
846 884
885 slot_ctx = xhci_get_slot_ctx(xhci, in_ctx);
847 /* Update the last valid endpoint context, if we just added one past */ 886 /* Update the last valid endpoint context, if we just added one past */
848 if ((in_ctx->slot.dev_info & LAST_CTX_MASK) < LAST_CTX(last_ctx)) { 887 if ((slot_ctx->dev_info & LAST_CTX_MASK) < LAST_CTX(last_ctx)) {
849 in_ctx->slot.dev_info &= ~LAST_CTX_MASK; 888 slot_ctx->dev_info &= ~LAST_CTX_MASK;
850 in_ctx->slot.dev_info |= LAST_CTX(last_ctx); 889 slot_ctx->dev_info |= LAST_CTX(last_ctx);
851 } 890 }
852 new_slot_info = in_ctx->slot.dev_info; 891 new_slot_info = slot_ctx->dev_info;
892
893 /* Store the usb_device pointer for later use */
894 ep->hcpriv = udev;
853 895
854 xhci_dbg(xhci, "add ep 0x%x, slot id %d, new drop flags = %#x, new add flags = %#x, new slot info = %#x\n", 896 xhci_dbg(xhci, "add ep 0x%x, slot id %d, new drop flags = %#x, new add flags = %#x, new slot info = %#x\n",
855 (unsigned int) ep->desc.bEndpointAddress, 897 (unsigned int) ep->desc.bEndpointAddress,
@@ -860,9 +902,11 @@ int xhci_add_endpoint(struct usb_hcd *hcd, struct usb_device *udev,
860 return 0; 902 return 0;
861} 903}
862 904
863static void xhci_zero_in_ctx(struct xhci_virt_device *virt_dev) 905static void xhci_zero_in_ctx(struct xhci_hcd *xhci, struct xhci_virt_device *virt_dev)
864{ 906{
907 struct xhci_input_control_ctx *ctrl_ctx;
865 struct xhci_ep_ctx *ep_ctx; 908 struct xhci_ep_ctx *ep_ctx;
909 struct xhci_slot_ctx *slot_ctx;
866 int i; 910 int i;
867 911
868 /* When a device's add flag and drop flag are zero, any subsequent 912 /* When a device's add flag and drop flag are zero, any subsequent
@@ -870,17 +914,18 @@ static void xhci_zero_in_ctx(struct xhci_virt_device *virt_dev)
870 * untouched. Make sure we don't leave any old state in the input 914 * untouched. Make sure we don't leave any old state in the input
871 * endpoint contexts. 915 * endpoint contexts.
872 */ 916 */
873 virt_dev->in_ctx->drop_flags = 0; 917 ctrl_ctx = xhci_get_input_control_ctx(xhci, virt_dev->in_ctx);
874 virt_dev->in_ctx->add_flags = 0; 918 ctrl_ctx->drop_flags = 0;
875 virt_dev->in_ctx->slot.dev_info &= ~LAST_CTX_MASK; 919 ctrl_ctx->add_flags = 0;
920 slot_ctx = xhci_get_slot_ctx(xhci, virt_dev->in_ctx);
921 slot_ctx->dev_info &= ~LAST_CTX_MASK;
876 /* Endpoint 0 is always valid */ 922 /* Endpoint 0 is always valid */
877 virt_dev->in_ctx->slot.dev_info |= LAST_CTX(1); 923 slot_ctx->dev_info |= LAST_CTX(1);
878 for (i = 1; i < 31; ++i) { 924 for (i = 1; i < 31; ++i) {
879 ep_ctx = &virt_dev->in_ctx->ep[i]; 925 ep_ctx = xhci_get_ep_ctx(xhci, virt_dev->in_ctx, i);
880 ep_ctx->ep_info = 0; 926 ep_ctx->ep_info = 0;
881 ep_ctx->ep_info2 = 0; 927 ep_ctx->ep_info2 = 0;
882 ep_ctx->deq[0] = 0; 928 ep_ctx->deq = 0;
883 ep_ctx->deq[1] = 0;
884 ep_ctx->tx_info = 0; 929 ep_ctx->tx_info = 0;
885 } 930 }
886} 931}
@@ -903,6 +948,8 @@ int xhci_check_bandwidth(struct usb_hcd *hcd, struct usb_device *udev)
903 unsigned long flags; 948 unsigned long flags;
904 struct xhci_hcd *xhci; 949 struct xhci_hcd *xhci;
905 struct xhci_virt_device *virt_dev; 950 struct xhci_virt_device *virt_dev;
951 struct xhci_input_control_ctx *ctrl_ctx;
952 struct xhci_slot_ctx *slot_ctx;
906 953
907 ret = xhci_check_args(hcd, udev, NULL, 0, __func__); 954 ret = xhci_check_args(hcd, udev, NULL, 0, __func__);
908 if (ret <= 0) 955 if (ret <= 0)
@@ -918,16 +965,18 @@ int xhci_check_bandwidth(struct usb_hcd *hcd, struct usb_device *udev)
918 virt_dev = xhci->devs[udev->slot_id]; 965 virt_dev = xhci->devs[udev->slot_id];
919 966
920 /* See section 4.6.6 - A0 = 1; A1 = D0 = D1 = 0 */ 967 /* See section 4.6.6 - A0 = 1; A1 = D0 = D1 = 0 */
921 virt_dev->in_ctx->add_flags |= SLOT_FLAG; 968 ctrl_ctx = xhci_get_input_control_ctx(xhci, virt_dev->in_ctx);
922 virt_dev->in_ctx->add_flags &= ~EP0_FLAG; 969 ctrl_ctx->add_flags |= SLOT_FLAG;
923 virt_dev->in_ctx->drop_flags &= ~SLOT_FLAG; 970 ctrl_ctx->add_flags &= ~EP0_FLAG;
924 virt_dev->in_ctx->drop_flags &= ~EP0_FLAG; 971 ctrl_ctx->drop_flags &= ~SLOT_FLAG;
972 ctrl_ctx->drop_flags &= ~EP0_FLAG;
925 xhci_dbg(xhci, "New Input Control Context:\n"); 973 xhci_dbg(xhci, "New Input Control Context:\n");
926 xhci_dbg_ctx(xhci, virt_dev->in_ctx, virt_dev->in_ctx_dma, 974 slot_ctx = xhci_get_slot_ctx(xhci, virt_dev->in_ctx);
927 LAST_CTX_TO_EP_NUM(virt_dev->in_ctx->slot.dev_info)); 975 xhci_dbg_ctx(xhci, virt_dev->in_ctx,
976 LAST_CTX_TO_EP_NUM(slot_ctx->dev_info));
928 977
929 spin_lock_irqsave(&xhci->lock, flags); 978 spin_lock_irqsave(&xhci->lock, flags);
930 ret = xhci_queue_configure_endpoint(xhci, virt_dev->in_ctx_dma, 979 ret = xhci_queue_configure_endpoint(xhci, virt_dev->in_ctx->dma,
931 udev->slot_id); 980 udev->slot_id);
932 if (ret < 0) { 981 if (ret < 0) {
933 spin_unlock_irqrestore(&xhci->lock, flags); 982 spin_unlock_irqrestore(&xhci->lock, flags);
@@ -982,10 +1031,10 @@ int xhci_check_bandwidth(struct usb_hcd *hcd, struct usb_device *udev)
982 } 1031 }
983 1032
984 xhci_dbg(xhci, "Output context after successful config ep cmd:\n"); 1033 xhci_dbg(xhci, "Output context after successful config ep cmd:\n");
985 xhci_dbg_ctx(xhci, virt_dev->out_ctx, virt_dev->out_ctx_dma, 1034 xhci_dbg_ctx(xhci, virt_dev->out_ctx,
986 LAST_CTX_TO_EP_NUM(virt_dev->in_ctx->slot.dev_info)); 1035 LAST_CTX_TO_EP_NUM(slot_ctx->dev_info));
987 1036
988 xhci_zero_in_ctx(virt_dev); 1037 xhci_zero_in_ctx(xhci, virt_dev);
989 /* Free any old rings */ 1038 /* Free any old rings */
990 for (i = 1; i < 31; ++i) { 1039 for (i = 1; i < 31; ++i) {
991 if (virt_dev->new_ep_rings[i]) { 1040 if (virt_dev->new_ep_rings[i]) {
@@ -1023,7 +1072,67 @@ void xhci_reset_bandwidth(struct usb_hcd *hcd, struct usb_device *udev)
1023 virt_dev->new_ep_rings[i] = NULL; 1072 virt_dev->new_ep_rings[i] = NULL;
1024 } 1073 }
1025 } 1074 }
1026 xhci_zero_in_ctx(virt_dev); 1075 xhci_zero_in_ctx(xhci, virt_dev);
1076}
1077
1078/* Deal with stalled endpoints. The core should have sent the control message
1079 * to clear the halt condition. However, we need to make the xHCI hardware
1080 * reset its sequence number, since a device will expect a sequence number of
1081 * zero after the halt condition is cleared.
1082 * Context: in_interrupt
1083 */
1084void xhci_endpoint_reset(struct usb_hcd *hcd,
1085 struct usb_host_endpoint *ep)
1086{
1087 struct xhci_hcd *xhci;
1088 struct usb_device *udev;
1089 unsigned int ep_index;
1090 unsigned long flags;
1091 int ret;
1092 struct xhci_dequeue_state deq_state;
1093 struct xhci_ring *ep_ring;
1094
1095 xhci = hcd_to_xhci(hcd);
1096 udev = (struct usb_device *) ep->hcpriv;
1097 /* Called with a root hub endpoint (or an endpoint that wasn't added
1098 * with xhci_add_endpoint()
1099 */
1100 if (!ep->hcpriv)
1101 return;
1102 ep_index = xhci_get_endpoint_index(&ep->desc);
1103 ep_ring = xhci->devs[udev->slot_id]->ep_rings[ep_index];
1104 if (!ep_ring->stopped_td) {
1105 xhci_dbg(xhci, "Endpoint 0x%x not halted, refusing to reset.\n",
1106 ep->desc.bEndpointAddress);
1107 return;
1108 }
1109
1110 xhci_dbg(xhci, "Queueing reset endpoint command\n");
1111 spin_lock_irqsave(&xhci->lock, flags);
1112 ret = xhci_queue_reset_ep(xhci, udev->slot_id, ep_index);
1113 /*
1114 * Can't change the ring dequeue pointer until it's transitioned to the
1115 * stopped state, which is only upon a successful reset endpoint
1116 * command. Better hope that last command worked!
1117 */
1118 if (!ret) {
1119 xhci_dbg(xhci, "Cleaning up stalled endpoint ring\n");
1120 /* We need to move the HW's dequeue pointer past this TD,
1121 * or it will attempt to resend it on the next doorbell ring.
1122 */
1123 xhci_find_new_dequeue_state(xhci, udev->slot_id,
1124 ep_index, ep_ring->stopped_td, &deq_state);
1125 xhci_dbg(xhci, "Queueing new dequeue state\n");
1126 xhci_queue_new_dequeue_state(xhci, ep_ring,
1127 udev->slot_id,
1128 ep_index, &deq_state);
1129 kfree(ep_ring->stopped_td);
1130 xhci_ring_cmd_db(xhci);
1131 }
1132 spin_unlock_irqrestore(&xhci->lock, flags);
1133
1134 if (ret)
1135 xhci_warn(xhci, "FIXME allocate a new ring segment\n");
1027} 1136}
1028 1137
1029/* 1138/*
@@ -1120,7 +1229,9 @@ int xhci_address_device(struct usb_hcd *hcd, struct usb_device *udev)
1120 struct xhci_virt_device *virt_dev; 1229 struct xhci_virt_device *virt_dev;
1121 int ret = 0; 1230 int ret = 0;
1122 struct xhci_hcd *xhci = hcd_to_xhci(hcd); 1231 struct xhci_hcd *xhci = hcd_to_xhci(hcd);
1123 u32 temp; 1232 struct xhci_slot_ctx *slot_ctx;
1233 struct xhci_input_control_ctx *ctrl_ctx;
1234 u64 temp_64;
1124 1235
1125 if (!udev->slot_id) { 1236 if (!udev->slot_id) {
1126 xhci_dbg(xhci, "Bad Slot ID %d\n", udev->slot_id); 1237 xhci_dbg(xhci, "Bad Slot ID %d\n", udev->slot_id);
@@ -1133,10 +1244,12 @@ int xhci_address_device(struct usb_hcd *hcd, struct usb_device *udev)
1133 if (!udev->config) 1244 if (!udev->config)
1134 xhci_setup_addressable_virt_dev(xhci, udev); 1245 xhci_setup_addressable_virt_dev(xhci, udev);
1135 /* Otherwise, assume the core has the device configured how it wants */ 1246 /* Otherwise, assume the core has the device configured how it wants */
1247 xhci_dbg(xhci, "Slot ID %d Input Context:\n", udev->slot_id);
1248 xhci_dbg_ctx(xhci, virt_dev->in_ctx, 2);
1136 1249
1137 spin_lock_irqsave(&xhci->lock, flags); 1250 spin_lock_irqsave(&xhci->lock, flags);
1138 ret = xhci_queue_address_device(xhci, virt_dev->in_ctx_dma, 1251 ret = xhci_queue_address_device(xhci, virt_dev->in_ctx->dma,
1139 udev->slot_id); 1252 udev->slot_id);
1140 if (ret) { 1253 if (ret) {
1141 spin_unlock_irqrestore(&xhci->lock, flags); 1254 spin_unlock_irqrestore(&xhci->lock, flags);
1142 xhci_dbg(xhci, "FIXME: allocate a command ring segment\n"); 1255 xhci_dbg(xhci, "FIXME: allocate a command ring segment\n");
@@ -1176,41 +1289,37 @@ int xhci_address_device(struct usb_hcd *hcd, struct usb_device *udev)
1176 default: 1289 default:
1177 xhci_err(xhci, "ERROR: unexpected command completion " 1290 xhci_err(xhci, "ERROR: unexpected command completion "
1178 "code 0x%x.\n", virt_dev->cmd_status); 1291 "code 0x%x.\n", virt_dev->cmd_status);
1292 xhci_dbg(xhci, "Slot ID %d Output Context:\n", udev->slot_id);
1293 xhci_dbg_ctx(xhci, virt_dev->out_ctx, 2);
1179 ret = -EINVAL; 1294 ret = -EINVAL;
1180 break; 1295 break;
1181 } 1296 }
1182 if (ret) { 1297 if (ret) {
1183 return ret; 1298 return ret;
1184 } 1299 }
1185 temp = xhci_readl(xhci, &xhci->op_regs->dcbaa_ptr[0]); 1300 temp_64 = xhci_read_64(xhci, &xhci->op_regs->dcbaa_ptr);
1186 xhci_dbg(xhci, "Op regs DCBAA ptr[0] = %#08x\n", temp); 1301 xhci_dbg(xhci, "Op regs DCBAA ptr = %#016llx\n", temp_64);
1187 temp = xhci_readl(xhci, &xhci->op_regs->dcbaa_ptr[1]); 1302 xhci_dbg(xhci, "Slot ID %d dcbaa entry @%p = %#016llx\n",
1188 xhci_dbg(xhci, "Op regs DCBAA ptr[1] = %#08x\n", temp);
1189 xhci_dbg(xhci, "Slot ID %d dcbaa entry[0] @%p = %#08x\n",
1190 udev->slot_id,
1191 &xhci->dcbaa->dev_context_ptrs[2*udev->slot_id],
1192 xhci->dcbaa->dev_context_ptrs[2*udev->slot_id]);
1193 xhci_dbg(xhci, "Slot ID %d dcbaa entry[1] @%p = %#08x\n",
1194 udev->slot_id, 1303 udev->slot_id,
1195 &xhci->dcbaa->dev_context_ptrs[2*udev->slot_id+1], 1304 &xhci->dcbaa->dev_context_ptrs[udev->slot_id],
1196 xhci->dcbaa->dev_context_ptrs[2*udev->slot_id+1]); 1305 (unsigned long long)
1306 xhci->dcbaa->dev_context_ptrs[udev->slot_id]);
1197 xhci_dbg(xhci, "Output Context DMA address = %#08llx\n", 1307 xhci_dbg(xhci, "Output Context DMA address = %#08llx\n",
1198 (unsigned long long)virt_dev->out_ctx_dma); 1308 (unsigned long long)virt_dev->out_ctx->dma);
1199 xhci_dbg(xhci, "Slot ID %d Input Context:\n", udev->slot_id); 1309 xhci_dbg(xhci, "Slot ID %d Input Context:\n", udev->slot_id);
1200 xhci_dbg_ctx(xhci, virt_dev->in_ctx, virt_dev->in_ctx_dma, 2); 1310 xhci_dbg_ctx(xhci, virt_dev->in_ctx, 2);
1201 xhci_dbg(xhci, "Slot ID %d Output Context:\n", udev->slot_id); 1311 xhci_dbg(xhci, "Slot ID %d Output Context:\n", udev->slot_id);
1202 xhci_dbg_ctx(xhci, virt_dev->out_ctx, virt_dev->out_ctx_dma, 2); 1312 xhci_dbg_ctx(xhci, virt_dev->out_ctx, 2);
1203 /* 1313 /*
1204 * USB core uses address 1 for the roothubs, so we add one to the 1314 * USB core uses address 1 for the roothubs, so we add one to the
1205 * address given back to us by the HC. 1315 * address given back to us by the HC.
1206 */ 1316 */
1207 udev->devnum = (virt_dev->out_ctx->slot.dev_state & DEV_ADDR_MASK) + 1; 1317 slot_ctx = xhci_get_slot_ctx(xhci, virt_dev->out_ctx);
1318 udev->devnum = (slot_ctx->dev_state & DEV_ADDR_MASK) + 1;
1208 /* Zero the input context control for later use */ 1319 /* Zero the input context control for later use */
1209 virt_dev->in_ctx->add_flags = 0; 1320 ctrl_ctx = xhci_get_input_control_ctx(xhci, virt_dev->in_ctx);
1210 virt_dev->in_ctx->drop_flags = 0; 1321 ctrl_ctx->add_flags = 0;
1211 /* Mirror flags in the output context for future ep enable/disable */ 1322 ctrl_ctx->drop_flags = 0;
1212 virt_dev->out_ctx->add_flags = SLOT_FLAG | EP0_FLAG;
1213 virt_dev->out_ctx->drop_flags = 0;
1214 1323
1215 xhci_dbg(xhci, "Device address = %d\n", udev->devnum); 1324 xhci_dbg(xhci, "Device address = %d\n", udev->devnum);
1216 /* XXX Meh, not sure if anyone else but choose_address uses this. */ 1325 /* XXX Meh, not sure if anyone else but choose_address uses this. */
@@ -1252,7 +1361,6 @@ static int __init xhci_hcd_init(void)
1252 /* xhci_device_control has eight fields, and also 1361 /* xhci_device_control has eight fields, and also
1253 * embeds one xhci_slot_ctx and 31 xhci_ep_ctx 1362 * embeds one xhci_slot_ctx and 31 xhci_ep_ctx
1254 */ 1363 */
1255 BUILD_BUG_ON(sizeof(struct xhci_device_control) != (8+8+8*31)*32/8);
1256 BUILD_BUG_ON(sizeof(struct xhci_stream_ctx) != 4*32/8); 1364 BUILD_BUG_ON(sizeof(struct xhci_stream_ctx) != 4*32/8);
1257 BUILD_BUG_ON(sizeof(union xhci_trb) != 4*32/8); 1365 BUILD_BUG_ON(sizeof(union xhci_trb) != 4*32/8);
1258 BUILD_BUG_ON(sizeof(struct xhci_erst_entry) != 4*32/8); 1366 BUILD_BUG_ON(sizeof(struct xhci_erst_entry) != 4*32/8);
diff --git a/drivers/usb/host/xhci-mem.c b/drivers/usb/host/xhci-mem.c
index c8a72de1c508..e6b9a1c6002d 100644
--- a/drivers/usb/host/xhci-mem.c
+++ b/drivers/usb/host/xhci-mem.c
@@ -88,7 +88,7 @@ static void xhci_link_segments(struct xhci_hcd *xhci, struct xhci_segment *prev,
88 return; 88 return;
89 prev->next = next; 89 prev->next = next;
90 if (link_trbs) { 90 if (link_trbs) {
91 prev->trbs[TRBS_PER_SEGMENT-1].link.segment_ptr[0] = next->dma; 91 prev->trbs[TRBS_PER_SEGMENT-1].link.segment_ptr = next->dma;
92 92
93 /* Set the last TRB in the segment to have a TRB type ID of Link TRB */ 93 /* Set the last TRB in the segment to have a TRB type ID of Link TRB */
94 val = prev->trbs[TRBS_PER_SEGMENT-1].link.control; 94 val = prev->trbs[TRBS_PER_SEGMENT-1].link.control;
@@ -189,6 +189,63 @@ fail:
189 return 0; 189 return 0;
190} 190}
191 191
192#define CTX_SIZE(_hcc) (HCC_64BYTE_CONTEXT(_hcc) ? 64 : 32)
193
194struct xhci_container_ctx *xhci_alloc_container_ctx(struct xhci_hcd *xhci,
195 int type, gfp_t flags)
196{
197 struct xhci_container_ctx *ctx = kzalloc(sizeof(*ctx), flags);
198 if (!ctx)
199 return NULL;
200
201 BUG_ON((type != XHCI_CTX_TYPE_DEVICE) && (type != XHCI_CTX_TYPE_INPUT));
202 ctx->type = type;
203 ctx->size = HCC_64BYTE_CONTEXT(xhci->hcc_params) ? 2048 : 1024;
204 if (type == XHCI_CTX_TYPE_INPUT)
205 ctx->size += CTX_SIZE(xhci->hcc_params);
206
207 ctx->bytes = dma_pool_alloc(xhci->device_pool, flags, &ctx->dma);
208 memset(ctx->bytes, 0, ctx->size);
209 return ctx;
210}
211
212void xhci_free_container_ctx(struct xhci_hcd *xhci,
213 struct xhci_container_ctx *ctx)
214{
215 dma_pool_free(xhci->device_pool, ctx->bytes, ctx->dma);
216 kfree(ctx);
217}
218
219struct xhci_input_control_ctx *xhci_get_input_control_ctx(struct xhci_hcd *xhci,
220 struct xhci_container_ctx *ctx)
221{
222 BUG_ON(ctx->type != XHCI_CTX_TYPE_INPUT);
223 return (struct xhci_input_control_ctx *)ctx->bytes;
224}
225
226struct xhci_slot_ctx *xhci_get_slot_ctx(struct xhci_hcd *xhci,
227 struct xhci_container_ctx *ctx)
228{
229 if (ctx->type == XHCI_CTX_TYPE_DEVICE)
230 return (struct xhci_slot_ctx *)ctx->bytes;
231
232 return (struct xhci_slot_ctx *)
233 (ctx->bytes + CTX_SIZE(xhci->hcc_params));
234}
235
236struct xhci_ep_ctx *xhci_get_ep_ctx(struct xhci_hcd *xhci,
237 struct xhci_container_ctx *ctx,
238 unsigned int ep_index)
239{
240 /* increment ep index by offset of start of ep ctx array */
241 ep_index++;
242 if (ctx->type == XHCI_CTX_TYPE_INPUT)
243 ep_index++;
244
245 return (struct xhci_ep_ctx *)
246 (ctx->bytes + (ep_index * CTX_SIZE(xhci->hcc_params)));
247}
248
192/* All the xhci_tds in the ring's TD list should be freed at this point */ 249/* All the xhci_tds in the ring's TD list should be freed at this point */
193void xhci_free_virt_device(struct xhci_hcd *xhci, int slot_id) 250void xhci_free_virt_device(struct xhci_hcd *xhci, int slot_id)
194{ 251{
@@ -200,8 +257,7 @@ void xhci_free_virt_device(struct xhci_hcd *xhci, int slot_id)
200 return; 257 return;
201 258
202 dev = xhci->devs[slot_id]; 259 dev = xhci->devs[slot_id];
203 xhci->dcbaa->dev_context_ptrs[2*slot_id] = 0; 260 xhci->dcbaa->dev_context_ptrs[slot_id] = 0;
204 xhci->dcbaa->dev_context_ptrs[2*slot_id + 1] = 0;
205 if (!dev) 261 if (!dev)
206 return; 262 return;
207 263
@@ -210,11 +266,10 @@ void xhci_free_virt_device(struct xhci_hcd *xhci, int slot_id)
210 xhci_ring_free(xhci, dev->ep_rings[i]); 266 xhci_ring_free(xhci, dev->ep_rings[i]);
211 267
212 if (dev->in_ctx) 268 if (dev->in_ctx)
213 dma_pool_free(xhci->device_pool, 269 xhci_free_container_ctx(xhci, dev->in_ctx);
214 dev->in_ctx, dev->in_ctx_dma);
215 if (dev->out_ctx) 270 if (dev->out_ctx)
216 dma_pool_free(xhci->device_pool, 271 xhci_free_container_ctx(xhci, dev->out_ctx);
217 dev->out_ctx, dev->out_ctx_dma); 272
218 kfree(xhci->devs[slot_id]); 273 kfree(xhci->devs[slot_id]);
219 xhci->devs[slot_id] = 0; 274 xhci->devs[slot_id] = 0;
220} 275}
@@ -222,7 +277,6 @@ void xhci_free_virt_device(struct xhci_hcd *xhci, int slot_id)
222int xhci_alloc_virt_device(struct xhci_hcd *xhci, int slot_id, 277int xhci_alloc_virt_device(struct xhci_hcd *xhci, int slot_id,
223 struct usb_device *udev, gfp_t flags) 278 struct usb_device *udev, gfp_t flags)
224{ 279{
225 dma_addr_t dma;
226 struct xhci_virt_device *dev; 280 struct xhci_virt_device *dev;
227 281
228 /* Slot ID 0 is reserved */ 282 /* Slot ID 0 is reserved */
@@ -236,23 +290,21 @@ int xhci_alloc_virt_device(struct xhci_hcd *xhci, int slot_id,
236 return 0; 290 return 0;
237 dev = xhci->devs[slot_id]; 291 dev = xhci->devs[slot_id];
238 292
239 /* Allocate the (output) device context that will be used in the HC */ 293 /* Allocate the (output) device context that will be used in the HC. */
240 dev->out_ctx = dma_pool_alloc(xhci->device_pool, flags, &dma); 294 dev->out_ctx = xhci_alloc_container_ctx(xhci, XHCI_CTX_TYPE_DEVICE, flags);
241 if (!dev->out_ctx) 295 if (!dev->out_ctx)
242 goto fail; 296 goto fail;
243 dev->out_ctx_dma = dma; 297
244 xhci_dbg(xhci, "Slot %d output ctx = 0x%llx (dma)\n", slot_id, 298 xhci_dbg(xhci, "Slot %d output ctx = 0x%llx (dma)\n", slot_id,
245 (unsigned long long)dma); 299 (unsigned long long)dev->out_ctx->dma);
246 memset(dev->out_ctx, 0, sizeof(*dev->out_ctx));
247 300
248 /* Allocate the (input) device context for address device command */ 301 /* Allocate the (input) device context for address device command */
249 dev->in_ctx = dma_pool_alloc(xhci->device_pool, flags, &dma); 302 dev->in_ctx = xhci_alloc_container_ctx(xhci, XHCI_CTX_TYPE_INPUT, flags);
250 if (!dev->in_ctx) 303 if (!dev->in_ctx)
251 goto fail; 304 goto fail;
252 dev->in_ctx_dma = dma; 305
253 xhci_dbg(xhci, "Slot %d input ctx = 0x%llx (dma)\n", slot_id, 306 xhci_dbg(xhci, "Slot %d input ctx = 0x%llx (dma)\n", slot_id,
254 (unsigned long long)dma); 307 (unsigned long long)dev->in_ctx->dma);
255 memset(dev->in_ctx, 0, sizeof(*dev->in_ctx));
256 308
257 /* Allocate endpoint 0 ring */ 309 /* Allocate endpoint 0 ring */
258 dev->ep_rings[0] = xhci_ring_alloc(xhci, 1, true, flags); 310 dev->ep_rings[0] = xhci_ring_alloc(xhci, 1, true, flags);
@@ -261,17 +313,12 @@ int xhci_alloc_virt_device(struct xhci_hcd *xhci, int slot_id,
261 313
262 init_completion(&dev->cmd_completion); 314 init_completion(&dev->cmd_completion);
263 315
264 /* 316 /* Point to output device context in dcbaa. */
265 * Point to output device context in dcbaa; skip the output control 317 xhci->dcbaa->dev_context_ptrs[slot_id] = dev->out_ctx->dma;
266 * context, which is eight 32 bit fields (or 32 bytes long)
267 */
268 xhci->dcbaa->dev_context_ptrs[2*slot_id] =
269 (u32) dev->out_ctx_dma + (32);
270 xhci_dbg(xhci, "Set slot id %d dcbaa entry %p to 0x%llx\n", 318 xhci_dbg(xhci, "Set slot id %d dcbaa entry %p to 0x%llx\n",
271 slot_id, 319 slot_id,
272 &xhci->dcbaa->dev_context_ptrs[2*slot_id], 320 &xhci->dcbaa->dev_context_ptrs[slot_id],
273 (unsigned long long)dev->out_ctx_dma); 321 (unsigned long long) xhci->dcbaa->dev_context_ptrs[slot_id]);
274 xhci->dcbaa->dev_context_ptrs[2*slot_id + 1] = 0;
275 322
276 return 1; 323 return 1;
277fail: 324fail:
@@ -285,6 +332,8 @@ int xhci_setup_addressable_virt_dev(struct xhci_hcd *xhci, struct usb_device *ud
285 struct xhci_virt_device *dev; 332 struct xhci_virt_device *dev;
286 struct xhci_ep_ctx *ep0_ctx; 333 struct xhci_ep_ctx *ep0_ctx;
287 struct usb_device *top_dev; 334 struct usb_device *top_dev;
335 struct xhci_slot_ctx *slot_ctx;
336 struct xhci_input_control_ctx *ctrl_ctx;
288 337
289 dev = xhci->devs[udev->slot_id]; 338 dev = xhci->devs[udev->slot_id];
290 /* Slot ID 0 is reserved */ 339 /* Slot ID 0 is reserved */
@@ -293,27 +342,29 @@ int xhci_setup_addressable_virt_dev(struct xhci_hcd *xhci, struct usb_device *ud
293 udev->slot_id); 342 udev->slot_id);
294 return -EINVAL; 343 return -EINVAL;
295 } 344 }
296 ep0_ctx = &dev->in_ctx->ep[0]; 345 ep0_ctx = xhci_get_ep_ctx(xhci, dev->in_ctx, 0);
346 ctrl_ctx = xhci_get_input_control_ctx(xhci, dev->in_ctx);
347 slot_ctx = xhci_get_slot_ctx(xhci, dev->in_ctx);
297 348
298 /* 2) New slot context and endpoint 0 context are valid*/ 349 /* 2) New slot context and endpoint 0 context are valid*/
299 dev->in_ctx->add_flags = SLOT_FLAG | EP0_FLAG; 350 ctrl_ctx->add_flags = SLOT_FLAG | EP0_FLAG;
300 351
301 /* 3) Only the control endpoint is valid - one endpoint context */ 352 /* 3) Only the control endpoint is valid - one endpoint context */
302 dev->in_ctx->slot.dev_info |= LAST_CTX(1); 353 slot_ctx->dev_info |= LAST_CTX(1);
303 354
304 switch (udev->speed) { 355 switch (udev->speed) {
305 case USB_SPEED_SUPER: 356 case USB_SPEED_SUPER:
306 dev->in_ctx->slot.dev_info |= (u32) udev->route; 357 slot_ctx->dev_info |= (u32) udev->route;
307 dev->in_ctx->slot.dev_info |= (u32) SLOT_SPEED_SS; 358 slot_ctx->dev_info |= (u32) SLOT_SPEED_SS;
308 break; 359 break;
309 case USB_SPEED_HIGH: 360 case USB_SPEED_HIGH:
310 dev->in_ctx->slot.dev_info |= (u32) SLOT_SPEED_HS; 361 slot_ctx->dev_info |= (u32) SLOT_SPEED_HS;
311 break; 362 break;
312 case USB_SPEED_FULL: 363 case USB_SPEED_FULL:
313 dev->in_ctx->slot.dev_info |= (u32) SLOT_SPEED_FS; 364 slot_ctx->dev_info |= (u32) SLOT_SPEED_FS;
314 break; 365 break;
315 case USB_SPEED_LOW: 366 case USB_SPEED_LOW:
316 dev->in_ctx->slot.dev_info |= (u32) SLOT_SPEED_LS; 367 slot_ctx->dev_info |= (u32) SLOT_SPEED_LS;
317 break; 368 break;
318 case USB_SPEED_VARIABLE: 369 case USB_SPEED_VARIABLE:
319 xhci_dbg(xhci, "FIXME xHCI doesn't support wireless speeds\n"); 370 xhci_dbg(xhci, "FIXME xHCI doesn't support wireless speeds\n");
@@ -327,7 +378,7 @@ int xhci_setup_addressable_virt_dev(struct xhci_hcd *xhci, struct usb_device *ud
327 for (top_dev = udev; top_dev->parent && top_dev->parent->parent; 378 for (top_dev = udev; top_dev->parent && top_dev->parent->parent;
328 top_dev = top_dev->parent) 379 top_dev = top_dev->parent)
329 /* Found device below root hub */; 380 /* Found device below root hub */;
330 dev->in_ctx->slot.dev_info2 |= (u32) ROOT_HUB_PORT(top_dev->portnum); 381 slot_ctx->dev_info2 |= (u32) ROOT_HUB_PORT(top_dev->portnum);
331 xhci_dbg(xhci, "Set root hub portnum to %d\n", top_dev->portnum); 382 xhci_dbg(xhci, "Set root hub portnum to %d\n", top_dev->portnum);
332 383
333 /* Is this a LS/FS device under a HS hub? */ 384 /* Is this a LS/FS device under a HS hub? */
@@ -337,8 +388,8 @@ int xhci_setup_addressable_virt_dev(struct xhci_hcd *xhci, struct usb_device *ud
337 */ 388 */
338 if ((udev->speed == USB_SPEED_LOW || udev->speed == USB_SPEED_FULL) && 389 if ((udev->speed == USB_SPEED_LOW || udev->speed == USB_SPEED_FULL) &&
339 udev->tt) { 390 udev->tt) {
340 dev->in_ctx->slot.tt_info = udev->tt->hub->slot_id; 391 slot_ctx->tt_info = udev->tt->hub->slot_id;
341 dev->in_ctx->slot.tt_info |= udev->ttport << 8; 392 slot_ctx->tt_info |= udev->ttport << 8;
342 } 393 }
343 xhci_dbg(xhci, "udev->tt = %p\n", udev->tt); 394 xhci_dbg(xhci, "udev->tt = %p\n", udev->tt);
344 xhci_dbg(xhci, "udev->ttport = 0x%x\n", udev->ttport); 395 xhci_dbg(xhci, "udev->ttport = 0x%x\n", udev->ttport);
@@ -360,10 +411,9 @@ int xhci_setup_addressable_virt_dev(struct xhci_hcd *xhci, struct usb_device *ud
360 ep0_ctx->ep_info2 |= MAX_BURST(0); 411 ep0_ctx->ep_info2 |= MAX_BURST(0);
361 ep0_ctx->ep_info2 |= ERROR_COUNT(3); 412 ep0_ctx->ep_info2 |= ERROR_COUNT(3);
362 413
363 ep0_ctx->deq[0] = 414 ep0_ctx->deq =
364 dev->ep_rings[0]->first_seg->dma; 415 dev->ep_rings[0]->first_seg->dma;
365 ep0_ctx->deq[0] |= dev->ep_rings[0]->cycle_state; 416 ep0_ctx->deq |= dev->ep_rings[0]->cycle_state;
366 ep0_ctx->deq[1] = 0;
367 417
368 /* Steps 7 and 8 were done in xhci_alloc_virt_device() */ 418 /* Steps 7 and 8 were done in xhci_alloc_virt_device() */
369 419
@@ -470,25 +520,26 @@ int xhci_endpoint_init(struct xhci_hcd *xhci,
470 unsigned int max_burst; 520 unsigned int max_burst;
471 521
472 ep_index = xhci_get_endpoint_index(&ep->desc); 522 ep_index = xhci_get_endpoint_index(&ep->desc);
473 ep_ctx = &virt_dev->in_ctx->ep[ep_index]; 523 ep_ctx = xhci_get_ep_ctx(xhci, virt_dev->in_ctx, ep_index);
474 524
475 /* Set up the endpoint ring */ 525 /* Set up the endpoint ring */
476 virt_dev->new_ep_rings[ep_index] = xhci_ring_alloc(xhci, 1, true, mem_flags); 526 virt_dev->new_ep_rings[ep_index] = xhci_ring_alloc(xhci, 1, true, mem_flags);
477 if (!virt_dev->new_ep_rings[ep_index]) 527 if (!virt_dev->new_ep_rings[ep_index])
478 return -ENOMEM; 528 return -ENOMEM;
479 ep_ring = virt_dev->new_ep_rings[ep_index]; 529 ep_ring = virt_dev->new_ep_rings[ep_index];
480 ep_ctx->deq[0] = ep_ring->first_seg->dma | ep_ring->cycle_state; 530 ep_ctx->deq = ep_ring->first_seg->dma | ep_ring->cycle_state;
481 ep_ctx->deq[1] = 0;
482 531
483 ep_ctx->ep_info = xhci_get_endpoint_interval(udev, ep); 532 ep_ctx->ep_info = xhci_get_endpoint_interval(udev, ep);
484 533
485 /* FIXME dig Mult and streams info out of ep companion desc */ 534 /* FIXME dig Mult and streams info out of ep companion desc */
486 535
487 /* Allow 3 retries for everything but isoc */ 536 /* Allow 3 retries for everything but isoc;
537 * error count = 0 means infinite retries.
538 */
488 if (!usb_endpoint_xfer_isoc(&ep->desc)) 539 if (!usb_endpoint_xfer_isoc(&ep->desc))
489 ep_ctx->ep_info2 = ERROR_COUNT(3); 540 ep_ctx->ep_info2 = ERROR_COUNT(3);
490 else 541 else
491 ep_ctx->ep_info2 = ERROR_COUNT(0); 542 ep_ctx->ep_info2 = ERROR_COUNT(1);
492 543
493 ep_ctx->ep_info2 |= xhci_get_endpoint_type(udev, ep); 544 ep_ctx->ep_info2 |= xhci_get_endpoint_type(udev, ep);
494 545
@@ -498,7 +549,12 @@ int xhci_endpoint_init(struct xhci_hcd *xhci,
498 max_packet = ep->desc.wMaxPacketSize; 549 max_packet = ep->desc.wMaxPacketSize;
499 ep_ctx->ep_info2 |= MAX_PACKET(max_packet); 550 ep_ctx->ep_info2 |= MAX_PACKET(max_packet);
500 /* dig out max burst from ep companion desc */ 551 /* dig out max burst from ep companion desc */
501 max_packet = ep->ss_ep_comp->desc.bMaxBurst; 552 if (!ep->ss_ep_comp) {
553 xhci_warn(xhci, "WARN no SS endpoint companion descriptor.\n");
554 max_packet = 0;
555 } else {
556 max_packet = ep->ss_ep_comp->desc.bMaxBurst;
557 }
502 ep_ctx->ep_info2 |= MAX_BURST(max_packet); 558 ep_ctx->ep_info2 |= MAX_BURST(max_packet);
503 break; 559 break;
504 case USB_SPEED_HIGH: 560 case USB_SPEED_HIGH:
@@ -531,18 +587,114 @@ void xhci_endpoint_zero(struct xhci_hcd *xhci,
531 struct xhci_ep_ctx *ep_ctx; 587 struct xhci_ep_ctx *ep_ctx;
532 588
533 ep_index = xhci_get_endpoint_index(&ep->desc); 589 ep_index = xhci_get_endpoint_index(&ep->desc);
534 ep_ctx = &virt_dev->in_ctx->ep[ep_index]; 590 ep_ctx = xhci_get_ep_ctx(xhci, virt_dev->in_ctx, ep_index);
535 591
536 ep_ctx->ep_info = 0; 592 ep_ctx->ep_info = 0;
537 ep_ctx->ep_info2 = 0; 593 ep_ctx->ep_info2 = 0;
538 ep_ctx->deq[0] = 0; 594 ep_ctx->deq = 0;
539 ep_ctx->deq[1] = 0;
540 ep_ctx->tx_info = 0; 595 ep_ctx->tx_info = 0;
541 /* Don't free the endpoint ring until the set interface or configuration 596 /* Don't free the endpoint ring until the set interface or configuration
542 * request succeeds. 597 * request succeeds.
543 */ 598 */
544} 599}
545 600
601/* Set up the scratchpad buffer array and scratchpad buffers, if needed. */
602static int scratchpad_alloc(struct xhci_hcd *xhci, gfp_t flags)
603{
604 int i;
605 struct device *dev = xhci_to_hcd(xhci)->self.controller;
606 int num_sp = HCS_MAX_SCRATCHPAD(xhci->hcs_params2);
607
608 xhci_dbg(xhci, "Allocating %d scratchpad buffers\n", num_sp);
609
610 if (!num_sp)
611 return 0;
612
613 xhci->scratchpad = kzalloc(sizeof(*xhci->scratchpad), flags);
614 if (!xhci->scratchpad)
615 goto fail_sp;
616
617 xhci->scratchpad->sp_array =
618 pci_alloc_consistent(to_pci_dev(dev),
619 num_sp * sizeof(u64),
620 &xhci->scratchpad->sp_dma);
621 if (!xhci->scratchpad->sp_array)
622 goto fail_sp2;
623
624 xhci->scratchpad->sp_buffers = kzalloc(sizeof(void *) * num_sp, flags);
625 if (!xhci->scratchpad->sp_buffers)
626 goto fail_sp3;
627
628 xhci->scratchpad->sp_dma_buffers =
629 kzalloc(sizeof(dma_addr_t) * num_sp, flags);
630
631 if (!xhci->scratchpad->sp_dma_buffers)
632 goto fail_sp4;
633
634 xhci->dcbaa->dev_context_ptrs[0] = xhci->scratchpad->sp_dma;
635 for (i = 0; i < num_sp; i++) {
636 dma_addr_t dma;
637 void *buf = pci_alloc_consistent(to_pci_dev(dev),
638 xhci->page_size, &dma);
639 if (!buf)
640 goto fail_sp5;
641
642 xhci->scratchpad->sp_array[i] = dma;
643 xhci->scratchpad->sp_buffers[i] = buf;
644 xhci->scratchpad->sp_dma_buffers[i] = dma;
645 }
646
647 return 0;
648
649 fail_sp5:
650 for (i = i - 1; i >= 0; i--) {
651 pci_free_consistent(to_pci_dev(dev), xhci->page_size,
652 xhci->scratchpad->sp_buffers[i],
653 xhci->scratchpad->sp_dma_buffers[i]);
654 }
655 kfree(xhci->scratchpad->sp_dma_buffers);
656
657 fail_sp4:
658 kfree(xhci->scratchpad->sp_buffers);
659
660 fail_sp3:
661 pci_free_consistent(to_pci_dev(dev), num_sp * sizeof(u64),
662 xhci->scratchpad->sp_array,
663 xhci->scratchpad->sp_dma);
664
665 fail_sp2:
666 kfree(xhci->scratchpad);
667 xhci->scratchpad = NULL;
668
669 fail_sp:
670 return -ENOMEM;
671}
672
673static void scratchpad_free(struct xhci_hcd *xhci)
674{
675 int num_sp;
676 int i;
677 struct pci_dev *pdev = to_pci_dev(xhci_to_hcd(xhci)->self.controller);
678
679 if (!xhci->scratchpad)
680 return;
681
682 num_sp = HCS_MAX_SCRATCHPAD(xhci->hcs_params2);
683
684 for (i = 0; i < num_sp; i++) {
685 pci_free_consistent(pdev, xhci->page_size,
686 xhci->scratchpad->sp_buffers[i],
687 xhci->scratchpad->sp_dma_buffers[i]);
688 }
689 kfree(xhci->scratchpad->sp_dma_buffers);
690 kfree(xhci->scratchpad->sp_buffers);
691 pci_free_consistent(pdev, num_sp * sizeof(u64),
692 xhci->scratchpad->sp_array,
693 xhci->scratchpad->sp_dma);
694 kfree(xhci->scratchpad);
695 xhci->scratchpad = NULL;
696}
697
546void xhci_mem_cleanup(struct xhci_hcd *xhci) 698void xhci_mem_cleanup(struct xhci_hcd *xhci)
547{ 699{
548 struct pci_dev *pdev = to_pci_dev(xhci_to_hcd(xhci)->self.controller); 700 struct pci_dev *pdev = to_pci_dev(xhci_to_hcd(xhci)->self.controller);
@@ -551,10 +703,8 @@ void xhci_mem_cleanup(struct xhci_hcd *xhci)
551 703
552 /* Free the Event Ring Segment Table and the actual Event Ring */ 704 /* Free the Event Ring Segment Table and the actual Event Ring */
553 xhci_writel(xhci, 0, &xhci->ir_set->erst_size); 705 xhci_writel(xhci, 0, &xhci->ir_set->erst_size);
554 xhci_writel(xhci, 0, &xhci->ir_set->erst_base[0]); 706 xhci_write_64(xhci, 0, &xhci->ir_set->erst_base);
555 xhci_writel(xhci, 0, &xhci->ir_set->erst_base[1]); 707 xhci_write_64(xhci, 0, &xhci->ir_set->erst_dequeue);
556 xhci_writel(xhci, 0, &xhci->ir_set->erst_dequeue[0]);
557 xhci_writel(xhci, 0, &xhci->ir_set->erst_dequeue[1]);
558 size = sizeof(struct xhci_erst_entry)*(xhci->erst.num_entries); 708 size = sizeof(struct xhci_erst_entry)*(xhci->erst.num_entries);
559 if (xhci->erst.entries) 709 if (xhci->erst.entries)
560 pci_free_consistent(pdev, size, 710 pci_free_consistent(pdev, size,
@@ -566,8 +716,7 @@ void xhci_mem_cleanup(struct xhci_hcd *xhci)
566 xhci->event_ring = NULL; 716 xhci->event_ring = NULL;
567 xhci_dbg(xhci, "Freed event ring\n"); 717 xhci_dbg(xhci, "Freed event ring\n");
568 718
569 xhci_writel(xhci, 0, &xhci->op_regs->cmd_ring[0]); 719 xhci_write_64(xhci, 0, &xhci->op_regs->cmd_ring);
570 xhci_writel(xhci, 0, &xhci->op_regs->cmd_ring[1]);
571 if (xhci->cmd_ring) 720 if (xhci->cmd_ring)
572 xhci_ring_free(xhci, xhci->cmd_ring); 721 xhci_ring_free(xhci, xhci->cmd_ring);
573 xhci->cmd_ring = NULL; 722 xhci->cmd_ring = NULL;
@@ -586,8 +735,7 @@ void xhci_mem_cleanup(struct xhci_hcd *xhci)
586 xhci->device_pool = NULL; 735 xhci->device_pool = NULL;
587 xhci_dbg(xhci, "Freed device context pool\n"); 736 xhci_dbg(xhci, "Freed device context pool\n");
588 737
589 xhci_writel(xhci, 0, &xhci->op_regs->dcbaa_ptr[0]); 738 xhci_write_64(xhci, 0, &xhci->op_regs->dcbaa_ptr);
590 xhci_writel(xhci, 0, &xhci->op_regs->dcbaa_ptr[1]);
591 if (xhci->dcbaa) 739 if (xhci->dcbaa)
592 pci_free_consistent(pdev, sizeof(*xhci->dcbaa), 740 pci_free_consistent(pdev, sizeof(*xhci->dcbaa),
593 xhci->dcbaa, xhci->dcbaa->dma); 741 xhci->dcbaa, xhci->dcbaa->dma);
@@ -595,6 +743,7 @@ void xhci_mem_cleanup(struct xhci_hcd *xhci)
595 743
596 xhci->page_size = 0; 744 xhci->page_size = 0;
597 xhci->page_shift = 0; 745 xhci->page_shift = 0;
746 scratchpad_free(xhci);
598} 747}
599 748
600int xhci_mem_init(struct xhci_hcd *xhci, gfp_t flags) 749int xhci_mem_init(struct xhci_hcd *xhci, gfp_t flags)
@@ -602,6 +751,7 @@ int xhci_mem_init(struct xhci_hcd *xhci, gfp_t flags)
602 dma_addr_t dma; 751 dma_addr_t dma;
603 struct device *dev = xhci_to_hcd(xhci)->self.controller; 752 struct device *dev = xhci_to_hcd(xhci)->self.controller;
604 unsigned int val, val2; 753 unsigned int val, val2;
754 u64 val_64;
605 struct xhci_segment *seg; 755 struct xhci_segment *seg;
606 u32 page_size; 756 u32 page_size;
607 int i; 757 int i;
@@ -647,8 +797,7 @@ int xhci_mem_init(struct xhci_hcd *xhci, gfp_t flags)
647 xhci->dcbaa->dma = dma; 797 xhci->dcbaa->dma = dma;
648 xhci_dbg(xhci, "// Device context base array address = 0x%llx (DMA), %p (virt)\n", 798 xhci_dbg(xhci, "// Device context base array address = 0x%llx (DMA), %p (virt)\n",
649 (unsigned long long)xhci->dcbaa->dma, xhci->dcbaa); 799 (unsigned long long)xhci->dcbaa->dma, xhci->dcbaa);
650 xhci_writel(xhci, dma, &xhci->op_regs->dcbaa_ptr[0]); 800 xhci_write_64(xhci, dma, &xhci->op_regs->dcbaa_ptr);
651 xhci_writel(xhci, (u32) 0, &xhci->op_regs->dcbaa_ptr[1]);
652 801
653 /* 802 /*
654 * Initialize the ring segment pool. The ring must be a contiguous 803 * Initialize the ring segment pool. The ring must be a contiguous
@@ -658,11 +807,10 @@ int xhci_mem_init(struct xhci_hcd *xhci, gfp_t flags)
658 */ 807 */
659 xhci->segment_pool = dma_pool_create("xHCI ring segments", dev, 808 xhci->segment_pool = dma_pool_create("xHCI ring segments", dev,
660 SEGMENT_SIZE, 64, xhci->page_size); 809 SEGMENT_SIZE, 64, xhci->page_size);
810
661 /* See Table 46 and Note on Figure 55 */ 811 /* See Table 46 and Note on Figure 55 */
662 /* FIXME support 64-byte contexts */
663 xhci->device_pool = dma_pool_create("xHCI input/output contexts", dev, 812 xhci->device_pool = dma_pool_create("xHCI input/output contexts", dev,
664 sizeof(struct xhci_device_control), 813 2112, 64, xhci->page_size);
665 64, xhci->page_size);
666 if (!xhci->segment_pool || !xhci->device_pool) 814 if (!xhci->segment_pool || !xhci->device_pool)
667 goto fail; 815 goto fail;
668 816
@@ -675,14 +823,12 @@ int xhci_mem_init(struct xhci_hcd *xhci, gfp_t flags)
675 (unsigned long long)xhci->cmd_ring->first_seg->dma); 823 (unsigned long long)xhci->cmd_ring->first_seg->dma);
676 824
677 /* Set the address in the Command Ring Control register */ 825 /* Set the address in the Command Ring Control register */
678 val = xhci_readl(xhci, &xhci->op_regs->cmd_ring[0]); 826 val_64 = xhci_read_64(xhci, &xhci->op_regs->cmd_ring);
679 val = (val & ~CMD_RING_ADDR_MASK) | 827 val_64 = (val_64 & (u64) CMD_RING_RSVD_BITS) |
680 (xhci->cmd_ring->first_seg->dma & CMD_RING_ADDR_MASK) | 828 (xhci->cmd_ring->first_seg->dma & (u64) ~CMD_RING_RSVD_BITS) |
681 xhci->cmd_ring->cycle_state; 829 xhci->cmd_ring->cycle_state;
682 xhci_dbg(xhci, "// Setting command ring address low bits to 0x%x\n", val); 830 xhci_dbg(xhci, "// Setting command ring address to 0x%x\n", val);
683 xhci_writel(xhci, val, &xhci->op_regs->cmd_ring[0]); 831 xhci_write_64(xhci, val_64, &xhci->op_regs->cmd_ring);
684 xhci_dbg(xhci, "// Setting command ring address high bits to 0x0\n");
685 xhci_writel(xhci, (u32) 0, &xhci->op_regs->cmd_ring[1]);
686 xhci_dbg_cmd_ptrs(xhci); 832 xhci_dbg_cmd_ptrs(xhci);
687 833
688 val = xhci_readl(xhci, &xhci->cap_regs->db_off); 834 val = xhci_readl(xhci, &xhci->cap_regs->db_off);
@@ -722,8 +868,7 @@ int xhci_mem_init(struct xhci_hcd *xhci, gfp_t flags)
722 /* set ring base address and size for each segment table entry */ 868 /* set ring base address and size for each segment table entry */
723 for (val = 0, seg = xhci->event_ring->first_seg; val < ERST_NUM_SEGS; val++) { 869 for (val = 0, seg = xhci->event_ring->first_seg; val < ERST_NUM_SEGS; val++) {
724 struct xhci_erst_entry *entry = &xhci->erst.entries[val]; 870 struct xhci_erst_entry *entry = &xhci->erst.entries[val];
725 entry->seg_addr[0] = seg->dma; 871 entry->seg_addr = seg->dma;
726 entry->seg_addr[1] = 0;
727 entry->seg_size = TRBS_PER_SEGMENT; 872 entry->seg_size = TRBS_PER_SEGMENT;
728 entry->rsvd = 0; 873 entry->rsvd = 0;
729 seg = seg->next; 874 seg = seg->next;
@@ -741,11 +886,10 @@ int xhci_mem_init(struct xhci_hcd *xhci, gfp_t flags)
741 /* set the segment table base address */ 886 /* set the segment table base address */
742 xhci_dbg(xhci, "// Set ERST base address for ir_set 0 = 0x%llx\n", 887 xhci_dbg(xhci, "// Set ERST base address for ir_set 0 = 0x%llx\n",
743 (unsigned long long)xhci->erst.erst_dma_addr); 888 (unsigned long long)xhci->erst.erst_dma_addr);
744 val = xhci_readl(xhci, &xhci->ir_set->erst_base[0]); 889 val_64 = xhci_read_64(xhci, &xhci->ir_set->erst_base);
745 val &= ERST_PTR_MASK; 890 val_64 &= ERST_PTR_MASK;
746 val |= (xhci->erst.erst_dma_addr & ~ERST_PTR_MASK); 891 val_64 |= (xhci->erst.erst_dma_addr & (u64) ~ERST_PTR_MASK);
747 xhci_writel(xhci, val, &xhci->ir_set->erst_base[0]); 892 xhci_write_64(xhci, val_64, &xhci->ir_set->erst_base);
748 xhci_writel(xhci, 0, &xhci->ir_set->erst_base[1]);
749 893
750 /* Set the event ring dequeue address */ 894 /* Set the event ring dequeue address */
751 xhci_set_hc_event_deq(xhci); 895 xhci_set_hc_event_deq(xhci);
@@ -761,7 +905,11 @@ int xhci_mem_init(struct xhci_hcd *xhci, gfp_t flags)
761 for (i = 0; i < MAX_HC_SLOTS; ++i) 905 for (i = 0; i < MAX_HC_SLOTS; ++i)
762 xhci->devs[i] = 0; 906 xhci->devs[i] = 0;
763 907
908 if (scratchpad_alloc(xhci, flags))
909 goto fail;
910
764 return 0; 911 return 0;
912
765fail: 913fail:
766 xhci_warn(xhci, "Couldn't initialize memory\n"); 914 xhci_warn(xhci, "Couldn't initialize memory\n");
767 xhci_mem_cleanup(xhci); 915 xhci_mem_cleanup(xhci);
diff --git a/drivers/usb/host/xhci-pci.c b/drivers/usb/host/xhci-pci.c
index 1462709e26c0..592fe7e623f7 100644
--- a/drivers/usb/host/xhci-pci.c
+++ b/drivers/usb/host/xhci-pci.c
@@ -117,6 +117,7 @@ static const struct hc_driver xhci_pci_hc_driver = {
117 .free_dev = xhci_free_dev, 117 .free_dev = xhci_free_dev,
118 .add_endpoint = xhci_add_endpoint, 118 .add_endpoint = xhci_add_endpoint,
119 .drop_endpoint = xhci_drop_endpoint, 119 .drop_endpoint = xhci_drop_endpoint,
120 .endpoint_reset = xhci_endpoint_reset,
120 .check_bandwidth = xhci_check_bandwidth, 121 .check_bandwidth = xhci_check_bandwidth,
121 .reset_bandwidth = xhci_reset_bandwidth, 122 .reset_bandwidth = xhci_reset_bandwidth,
122 .address_device = xhci_address_device, 123 .address_device = xhci_address_device,
diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c
index 02d81985c454..aa88a067148b 100644
--- a/drivers/usb/host/xhci-ring.c
+++ b/drivers/usb/host/xhci-ring.c
@@ -135,6 +135,7 @@ static void next_trb(struct xhci_hcd *xhci,
135static void inc_deq(struct xhci_hcd *xhci, struct xhci_ring *ring, bool consumer) 135static void inc_deq(struct xhci_hcd *xhci, struct xhci_ring *ring, bool consumer)
136{ 136{
137 union xhci_trb *next = ++(ring->dequeue); 137 union xhci_trb *next = ++(ring->dequeue);
138 unsigned long long addr;
138 139
139 ring->deq_updates++; 140 ring->deq_updates++;
140 /* Update the dequeue pointer further if that was a link TRB or we're at 141 /* Update the dequeue pointer further if that was a link TRB or we're at
@@ -152,6 +153,13 @@ static void inc_deq(struct xhci_hcd *xhci, struct xhci_ring *ring, bool consumer
152 ring->dequeue = ring->deq_seg->trbs; 153 ring->dequeue = ring->deq_seg->trbs;
153 next = ring->dequeue; 154 next = ring->dequeue;
154 } 155 }
156 addr = (unsigned long long) xhci_trb_virt_to_dma(ring->deq_seg, ring->dequeue);
157 if (ring == xhci->event_ring)
158 xhci_dbg(xhci, "Event ring deq = 0x%llx (DMA)\n", addr);
159 else if (ring == xhci->cmd_ring)
160 xhci_dbg(xhci, "Command ring deq = 0x%llx (DMA)\n", addr);
161 else
162 xhci_dbg(xhci, "Ring deq = 0x%llx (DMA)\n", addr);
155} 163}
156 164
157/* 165/*
@@ -171,6 +179,7 @@ static void inc_enq(struct xhci_hcd *xhci, struct xhci_ring *ring, bool consumer
171{ 179{
172 u32 chain; 180 u32 chain;
173 union xhci_trb *next; 181 union xhci_trb *next;
182 unsigned long long addr;
174 183
175 chain = ring->enqueue->generic.field[3] & TRB_CHAIN; 184 chain = ring->enqueue->generic.field[3] & TRB_CHAIN;
176 next = ++(ring->enqueue); 185 next = ++(ring->enqueue);
@@ -204,6 +213,13 @@ static void inc_enq(struct xhci_hcd *xhci, struct xhci_ring *ring, bool consumer
204 ring->enqueue = ring->enq_seg->trbs; 213 ring->enqueue = ring->enq_seg->trbs;
205 next = ring->enqueue; 214 next = ring->enqueue;
206 } 215 }
216 addr = (unsigned long long) xhci_trb_virt_to_dma(ring->enq_seg, ring->enqueue);
217 if (ring == xhci->event_ring)
218 xhci_dbg(xhci, "Event ring enq = 0x%llx (DMA)\n", addr);
219 else if (ring == xhci->cmd_ring)
220 xhci_dbg(xhci, "Command ring enq = 0x%llx (DMA)\n", addr);
221 else
222 xhci_dbg(xhci, "Ring enq = 0x%llx (DMA)\n", addr);
207} 223}
208 224
209/* 225/*
@@ -237,7 +253,7 @@ static int room_on_ring(struct xhci_hcd *xhci, struct xhci_ring *ring,
237 253
238void xhci_set_hc_event_deq(struct xhci_hcd *xhci) 254void xhci_set_hc_event_deq(struct xhci_hcd *xhci)
239{ 255{
240 u32 temp; 256 u64 temp;
241 dma_addr_t deq; 257 dma_addr_t deq;
242 258
243 deq = xhci_trb_virt_to_dma(xhci->event_ring->deq_seg, 259 deq = xhci_trb_virt_to_dma(xhci->event_ring->deq_seg,
@@ -246,13 +262,15 @@ void xhci_set_hc_event_deq(struct xhci_hcd *xhci)
246 xhci_warn(xhci, "WARN something wrong with SW event ring " 262 xhci_warn(xhci, "WARN something wrong with SW event ring "
247 "dequeue ptr.\n"); 263 "dequeue ptr.\n");
248 /* Update HC event ring dequeue pointer */ 264 /* Update HC event ring dequeue pointer */
249 temp = xhci_readl(xhci, &xhci->ir_set->erst_dequeue[0]); 265 temp = xhci_read_64(xhci, &xhci->ir_set->erst_dequeue);
250 temp &= ERST_PTR_MASK; 266 temp &= ERST_PTR_MASK;
251 if (!in_interrupt()) 267 /* Don't clear the EHB bit (which is RW1C) because
252 xhci_dbg(xhci, "// Write event ring dequeue pointer\n"); 268 * there might be more events to service.
253 xhci_writel(xhci, 0, &xhci->ir_set->erst_dequeue[1]); 269 */
254 xhci_writel(xhci, (deq & ~ERST_PTR_MASK) | temp, 270 temp &= ~ERST_EHB;
255 &xhci->ir_set->erst_dequeue[0]); 271 xhci_dbg(xhci, "// Write event ring dequeue pointer, preserving EHB bit\n");
272 xhci_write_64(xhci, ((u64) deq & (u64) ~ERST_PTR_MASK) | temp,
273 &xhci->ir_set->erst_dequeue);
256} 274}
257 275
258/* Ring the host controller doorbell after placing a command on the ring */ 276/* Ring the host controller doorbell after placing a command on the ring */
@@ -279,7 +297,8 @@ static void ring_ep_doorbell(struct xhci_hcd *xhci,
279 /* Don't ring the doorbell for this endpoint if there are pending 297 /* Don't ring the doorbell for this endpoint if there are pending
280 * cancellations because the we don't want to interrupt processing. 298 * cancellations because the we don't want to interrupt processing.
281 */ 299 */
282 if (!ep_ring->cancels_pending && !(ep_ring->state & SET_DEQ_PENDING)) { 300 if (!ep_ring->cancels_pending && !(ep_ring->state & SET_DEQ_PENDING)
301 && !(ep_ring->state & EP_HALTED)) {
283 field = xhci_readl(xhci, db_addr) & DB_MASK; 302 field = xhci_readl(xhci, db_addr) & DB_MASK;
284 xhci_writel(xhci, field | EPI_TO_DB(ep_index), db_addr); 303 xhci_writel(xhci, field | EPI_TO_DB(ep_index), db_addr);
285 /* Flush PCI posted writes - FIXME Matthew Wilcox says this 304 /* Flush PCI posted writes - FIXME Matthew Wilcox says this
@@ -316,12 +335,6 @@ static struct xhci_segment *find_trb_seg(
316 return cur_seg; 335 return cur_seg;
317} 336}
318 337
319struct dequeue_state {
320 struct xhci_segment *new_deq_seg;
321 union xhci_trb *new_deq_ptr;
322 int new_cycle_state;
323};
324
325/* 338/*
326 * Move the xHC's endpoint ring dequeue pointer past cur_td. 339 * Move the xHC's endpoint ring dequeue pointer past cur_td.
327 * Record the new state of the xHC's endpoint ring dequeue segment, 340 * Record the new state of the xHC's endpoint ring dequeue segment,
@@ -336,24 +349,30 @@ struct dequeue_state {
336 * - Finally we move the dequeue state one TRB further, toggling the cycle bit 349 * - Finally we move the dequeue state one TRB further, toggling the cycle bit
337 * if we've moved it past a link TRB with the toggle cycle bit set. 350 * if we've moved it past a link TRB with the toggle cycle bit set.
338 */ 351 */
339static void find_new_dequeue_state(struct xhci_hcd *xhci, 352void xhci_find_new_dequeue_state(struct xhci_hcd *xhci,
340 unsigned int slot_id, unsigned int ep_index, 353 unsigned int slot_id, unsigned int ep_index,
341 struct xhci_td *cur_td, struct dequeue_state *state) 354 struct xhci_td *cur_td, struct xhci_dequeue_state *state)
342{ 355{
343 struct xhci_virt_device *dev = xhci->devs[slot_id]; 356 struct xhci_virt_device *dev = xhci->devs[slot_id];
344 struct xhci_ring *ep_ring = dev->ep_rings[ep_index]; 357 struct xhci_ring *ep_ring = dev->ep_rings[ep_index];
345 struct xhci_generic_trb *trb; 358 struct xhci_generic_trb *trb;
359 struct xhci_ep_ctx *ep_ctx;
360 dma_addr_t addr;
346 361
347 state->new_cycle_state = 0; 362 state->new_cycle_state = 0;
363 xhci_dbg(xhci, "Finding segment containing stopped TRB.\n");
348 state->new_deq_seg = find_trb_seg(cur_td->start_seg, 364 state->new_deq_seg = find_trb_seg(cur_td->start_seg,
349 ep_ring->stopped_trb, 365 ep_ring->stopped_trb,
350 &state->new_cycle_state); 366 &state->new_cycle_state);
351 if (!state->new_deq_seg) 367 if (!state->new_deq_seg)
352 BUG(); 368 BUG();
353 /* Dig out the cycle state saved by the xHC during the stop ep cmd */ 369 /* Dig out the cycle state saved by the xHC during the stop ep cmd */
354 state->new_cycle_state = 0x1 & dev->out_ctx->ep[ep_index].deq[0]; 370 xhci_dbg(xhci, "Finding endpoint context\n");
371 ep_ctx = xhci_get_ep_ctx(xhci, dev->out_ctx, ep_index);
372 state->new_cycle_state = 0x1 & ep_ctx->deq;
355 373
356 state->new_deq_ptr = cur_td->last_trb; 374 state->new_deq_ptr = cur_td->last_trb;
375 xhci_dbg(xhci, "Finding segment containing last TRB in TD.\n");
357 state->new_deq_seg = find_trb_seg(state->new_deq_seg, 376 state->new_deq_seg = find_trb_seg(state->new_deq_seg,
358 state->new_deq_ptr, 377 state->new_deq_ptr,
359 &state->new_cycle_state); 378 &state->new_cycle_state);
@@ -367,6 +386,12 @@ static void find_new_dequeue_state(struct xhci_hcd *xhci,
367 next_trb(xhci, ep_ring, &state->new_deq_seg, &state->new_deq_ptr); 386 next_trb(xhci, ep_ring, &state->new_deq_seg, &state->new_deq_ptr);
368 387
369 /* Don't update the ring cycle state for the producer (us). */ 388 /* Don't update the ring cycle state for the producer (us). */
389 xhci_dbg(xhci, "New dequeue segment = %p (virtual)\n",
390 state->new_deq_seg);
391 addr = xhci_trb_virt_to_dma(state->new_deq_seg, state->new_deq_ptr);
392 xhci_dbg(xhci, "New dequeue pointer = 0x%llx (DMA)\n",
393 (unsigned long long) addr);
394 xhci_dbg(xhci, "Setting dequeue pointer in internal ring state.\n");
370 ep_ring->dequeue = state->new_deq_ptr; 395 ep_ring->dequeue = state->new_deq_ptr;
371 ep_ring->deq_seg = state->new_deq_seg; 396 ep_ring->deq_seg = state->new_deq_seg;
372} 397}
@@ -416,6 +441,30 @@ static int queue_set_tr_deq(struct xhci_hcd *xhci, int slot_id,
416 unsigned int ep_index, struct xhci_segment *deq_seg, 441 unsigned int ep_index, struct xhci_segment *deq_seg,
417 union xhci_trb *deq_ptr, u32 cycle_state); 442 union xhci_trb *deq_ptr, u32 cycle_state);
418 443
444void xhci_queue_new_dequeue_state(struct xhci_hcd *xhci,
445 struct xhci_ring *ep_ring, unsigned int slot_id,
446 unsigned int ep_index, struct xhci_dequeue_state *deq_state)
447{
448 xhci_dbg(xhci, "Set TR Deq Ptr cmd, new deq seg = %p (0x%llx dma), "
449 "new deq ptr = %p (0x%llx dma), new cycle = %u\n",
450 deq_state->new_deq_seg,
451 (unsigned long long)deq_state->new_deq_seg->dma,
452 deq_state->new_deq_ptr,
453 (unsigned long long)xhci_trb_virt_to_dma(deq_state->new_deq_seg, deq_state->new_deq_ptr),
454 deq_state->new_cycle_state);
455 queue_set_tr_deq(xhci, slot_id, ep_index,
456 deq_state->new_deq_seg,
457 deq_state->new_deq_ptr,
458 (u32) deq_state->new_cycle_state);
459 /* Stop the TD queueing code from ringing the doorbell until
460 * this command completes. The HC won't set the dequeue pointer
461 * if the ring is running, and ringing the doorbell starts the
462 * ring running.
463 */
464 ep_ring->state |= SET_DEQ_PENDING;
465 xhci_ring_cmd_db(xhci);
466}
467
419/* 468/*
420 * When we get a command completion for a Stop Endpoint Command, we need to 469 * When we get a command completion for a Stop Endpoint Command, we need to
421 * unlink any cancelled TDs from the ring. There are two ways to do that: 470 * unlink any cancelled TDs from the ring. There are two ways to do that:
@@ -436,7 +485,7 @@ static void handle_stopped_endpoint(struct xhci_hcd *xhci,
436 struct xhci_td *cur_td = 0; 485 struct xhci_td *cur_td = 0;
437 struct xhci_td *last_unlinked_td; 486 struct xhci_td *last_unlinked_td;
438 487
439 struct dequeue_state deq_state; 488 struct xhci_dequeue_state deq_state;
440#ifdef CONFIG_USB_HCD_STAT 489#ifdef CONFIG_USB_HCD_STAT
441 ktime_t stop_time = ktime_get(); 490 ktime_t stop_time = ktime_get();
442#endif 491#endif
@@ -464,7 +513,7 @@ static void handle_stopped_endpoint(struct xhci_hcd *xhci,
464 * move the xHC endpoint ring dequeue pointer past this TD. 513 * move the xHC endpoint ring dequeue pointer past this TD.
465 */ 514 */
466 if (cur_td == ep_ring->stopped_td) 515 if (cur_td == ep_ring->stopped_td)
467 find_new_dequeue_state(xhci, slot_id, ep_index, cur_td, 516 xhci_find_new_dequeue_state(xhci, slot_id, ep_index, cur_td,
468 &deq_state); 517 &deq_state);
469 else 518 else
470 td_to_noop(xhci, ep_ring, cur_td); 519 td_to_noop(xhci, ep_ring, cur_td);
@@ -480,24 +529,8 @@ static void handle_stopped_endpoint(struct xhci_hcd *xhci,
480 529
481 /* If necessary, queue a Set Transfer Ring Dequeue Pointer command */ 530 /* If necessary, queue a Set Transfer Ring Dequeue Pointer command */
482 if (deq_state.new_deq_ptr && deq_state.new_deq_seg) { 531 if (deq_state.new_deq_ptr && deq_state.new_deq_seg) {
483 xhci_dbg(xhci, "Set TR Deq Ptr cmd, new deq seg = %p (0x%llx dma), " 532 xhci_queue_new_dequeue_state(xhci, ep_ring,
484 "new deq ptr = %p (0x%llx dma), new cycle = %u\n", 533 slot_id, ep_index, &deq_state);
485 deq_state.new_deq_seg,
486 (unsigned long long)deq_state.new_deq_seg->dma,
487 deq_state.new_deq_ptr,
488 (unsigned long long)xhci_trb_virt_to_dma(deq_state.new_deq_seg, deq_state.new_deq_ptr),
489 deq_state.new_cycle_state);
490 queue_set_tr_deq(xhci, slot_id, ep_index,
491 deq_state.new_deq_seg,
492 deq_state.new_deq_ptr,
493 (u32) deq_state.new_cycle_state);
494 /* Stop the TD queueing code from ringing the doorbell until
495 * this command completes. The HC won't set the dequeue pointer
496 * if the ring is running, and ringing the doorbell starts the
497 * ring running.
498 */
499 ep_ring->state |= SET_DEQ_PENDING;
500 xhci_ring_cmd_db(xhci);
501 } else { 534 } else {
502 /* Otherwise just ring the doorbell to restart the ring */ 535 /* Otherwise just ring the doorbell to restart the ring */
503 ring_ep_doorbell(xhci, slot_id, ep_index); 536 ring_ep_doorbell(xhci, slot_id, ep_index);
@@ -551,11 +584,15 @@ static void handle_set_deq_completion(struct xhci_hcd *xhci,
551 unsigned int ep_index; 584 unsigned int ep_index;
552 struct xhci_ring *ep_ring; 585 struct xhci_ring *ep_ring;
553 struct xhci_virt_device *dev; 586 struct xhci_virt_device *dev;
587 struct xhci_ep_ctx *ep_ctx;
588 struct xhci_slot_ctx *slot_ctx;
554 589
555 slot_id = TRB_TO_SLOT_ID(trb->generic.field[3]); 590 slot_id = TRB_TO_SLOT_ID(trb->generic.field[3]);
556 ep_index = TRB_TO_EP_INDEX(trb->generic.field[3]); 591 ep_index = TRB_TO_EP_INDEX(trb->generic.field[3]);
557 dev = xhci->devs[slot_id]; 592 dev = xhci->devs[slot_id];
558 ep_ring = dev->ep_rings[ep_index]; 593 ep_ring = dev->ep_rings[ep_index];
594 ep_ctx = xhci_get_ep_ctx(xhci, dev->out_ctx, ep_index);
595 slot_ctx = xhci_get_slot_ctx(xhci, dev->out_ctx);
559 596
560 if (GET_COMP_CODE(event->status) != COMP_SUCCESS) { 597 if (GET_COMP_CODE(event->status) != COMP_SUCCESS) {
561 unsigned int ep_state; 598 unsigned int ep_state;
@@ -569,9 +606,9 @@ static void handle_set_deq_completion(struct xhci_hcd *xhci,
569 case COMP_CTX_STATE: 606 case COMP_CTX_STATE:
570 xhci_warn(xhci, "WARN Set TR Deq Ptr cmd failed due " 607 xhci_warn(xhci, "WARN Set TR Deq Ptr cmd failed due "
571 "to incorrect slot or ep state.\n"); 608 "to incorrect slot or ep state.\n");
572 ep_state = dev->out_ctx->ep[ep_index].ep_info; 609 ep_state = ep_ctx->ep_info;
573 ep_state &= EP_STATE_MASK; 610 ep_state &= EP_STATE_MASK;
574 slot_state = dev->out_ctx->slot.dev_state; 611 slot_state = slot_ctx->dev_state;
575 slot_state = GET_SLOT_STATE(slot_state); 612 slot_state = GET_SLOT_STATE(slot_state);
576 xhci_dbg(xhci, "Slot state = %u, EP state = %u\n", 613 xhci_dbg(xhci, "Slot state = %u, EP state = %u\n",
577 slot_state, ep_state); 614 slot_state, ep_state);
@@ -593,16 +630,33 @@ static void handle_set_deq_completion(struct xhci_hcd *xhci,
593 * cancelling URBs, which might not be an error... 630 * cancelling URBs, which might not be an error...
594 */ 631 */
595 } else { 632 } else {
596 xhci_dbg(xhci, "Successful Set TR Deq Ptr cmd, deq[0] = 0x%x, " 633 xhci_dbg(xhci, "Successful Set TR Deq Ptr cmd, deq = @%08llx\n",
597 "deq[1] = 0x%x.\n", 634 ep_ctx->deq);
598 dev->out_ctx->ep[ep_index].deq[0],
599 dev->out_ctx->ep[ep_index].deq[1]);
600 } 635 }
601 636
602 ep_ring->state &= ~SET_DEQ_PENDING; 637 ep_ring->state &= ~SET_DEQ_PENDING;
603 ring_ep_doorbell(xhci, slot_id, ep_index); 638 ring_ep_doorbell(xhci, slot_id, ep_index);
604} 639}
605 640
641static void handle_reset_ep_completion(struct xhci_hcd *xhci,
642 struct xhci_event_cmd *event,
643 union xhci_trb *trb)
644{
645 int slot_id;
646 unsigned int ep_index;
647
648 slot_id = TRB_TO_SLOT_ID(trb->generic.field[3]);
649 ep_index = TRB_TO_EP_INDEX(trb->generic.field[3]);
650 /* This command will only fail if the endpoint wasn't halted,
651 * but we don't care.
652 */
653 xhci_dbg(xhci, "Ignoring reset ep completion code of %u\n",
654 (unsigned int) GET_COMP_CODE(event->status));
655
656 /* Clear our internal halted state and restart the ring */
657 xhci->devs[slot_id]->ep_rings[ep_index]->state &= ~EP_HALTED;
658 ring_ep_doorbell(xhci, slot_id, ep_index);
659}
606 660
607static void handle_cmd_completion(struct xhci_hcd *xhci, 661static void handle_cmd_completion(struct xhci_hcd *xhci,
608 struct xhci_event_cmd *event) 662 struct xhci_event_cmd *event)
@@ -611,7 +665,7 @@ static void handle_cmd_completion(struct xhci_hcd *xhci,
611 u64 cmd_dma; 665 u64 cmd_dma;
612 dma_addr_t cmd_dequeue_dma; 666 dma_addr_t cmd_dequeue_dma;
613 667
614 cmd_dma = (((u64) event->cmd_trb[1]) << 32) + event->cmd_trb[0]; 668 cmd_dma = event->cmd_trb;
615 cmd_dequeue_dma = xhci_trb_virt_to_dma(xhci->cmd_ring->deq_seg, 669 cmd_dequeue_dma = xhci_trb_virt_to_dma(xhci->cmd_ring->deq_seg,
616 xhci->cmd_ring->dequeue); 670 xhci->cmd_ring->dequeue);
617 /* Is the command ring deq ptr out of sync with the deq seg ptr? */ 671 /* Is the command ring deq ptr out of sync with the deq seg ptr? */
@@ -653,6 +707,9 @@ static void handle_cmd_completion(struct xhci_hcd *xhci,
653 case TRB_TYPE(TRB_CMD_NOOP): 707 case TRB_TYPE(TRB_CMD_NOOP):
654 ++xhci->noops_handled; 708 ++xhci->noops_handled;
655 break; 709 break;
710 case TRB_TYPE(TRB_RESET_EP):
711 handle_reset_ep_completion(xhci, event, xhci->cmd_ring->dequeue);
712 break;
656 default: 713 default:
657 /* Skip over unknown commands on the event ring */ 714 /* Skip over unknown commands on the event ring */
658 xhci->error_bitmask |= 1 << 6; 715 xhci->error_bitmask |= 1 << 6;
@@ -756,7 +813,9 @@ static int handle_tx_event(struct xhci_hcd *xhci,
756 union xhci_trb *event_trb; 813 union xhci_trb *event_trb;
757 struct urb *urb = 0; 814 struct urb *urb = 0;
758 int status = -EINPROGRESS; 815 int status = -EINPROGRESS;
816 struct xhci_ep_ctx *ep_ctx;
759 817
818 xhci_dbg(xhci, "In %s\n", __func__);
760 xdev = xhci->devs[TRB_TO_SLOT_ID(event->flags)]; 819 xdev = xhci->devs[TRB_TO_SLOT_ID(event->flags)];
761 if (!xdev) { 820 if (!xdev) {
762 xhci_err(xhci, "ERROR Transfer event pointed to bad slot\n"); 821 xhci_err(xhci, "ERROR Transfer event pointed to bad slot\n");
@@ -765,17 +824,17 @@ static int handle_tx_event(struct xhci_hcd *xhci,
765 824
766 /* Endpoint ID is 1 based, our index is zero based */ 825 /* Endpoint ID is 1 based, our index is zero based */
767 ep_index = TRB_TO_EP_ID(event->flags) - 1; 826 ep_index = TRB_TO_EP_ID(event->flags) - 1;
827 xhci_dbg(xhci, "%s - ep index = %d\n", __func__, ep_index);
768 ep_ring = xdev->ep_rings[ep_index]; 828 ep_ring = xdev->ep_rings[ep_index];
769 if (!ep_ring || (xdev->out_ctx->ep[ep_index].ep_info & EP_STATE_MASK) == EP_STATE_DISABLED) { 829 ep_ctx = xhci_get_ep_ctx(xhci, xdev->out_ctx, ep_index);
830 if (!ep_ring || (ep_ctx->ep_info & EP_STATE_MASK) == EP_STATE_DISABLED) {
770 xhci_err(xhci, "ERROR Transfer event pointed to disabled endpoint\n"); 831 xhci_err(xhci, "ERROR Transfer event pointed to disabled endpoint\n");
771 return -ENODEV; 832 return -ENODEV;
772 } 833 }
773 834
774 event_dma = event->buffer[0]; 835 event_dma = event->buffer;
775 if (event->buffer[1] != 0)
776 xhci_warn(xhci, "WARN ignoring upper 32-bits of 64-bit TRB dma address\n");
777
778 /* This TRB should be in the TD at the head of this ring's TD list */ 836 /* This TRB should be in the TD at the head of this ring's TD list */
837 xhci_dbg(xhci, "%s - checking for list empty\n", __func__);
779 if (list_empty(&ep_ring->td_list)) { 838 if (list_empty(&ep_ring->td_list)) {
780 xhci_warn(xhci, "WARN Event TRB for slot %d ep %d with no TDs queued?\n", 839 xhci_warn(xhci, "WARN Event TRB for slot %d ep %d with no TDs queued?\n",
781 TRB_TO_SLOT_ID(event->flags), ep_index); 840 TRB_TO_SLOT_ID(event->flags), ep_index);
@@ -785,11 +844,14 @@ static int handle_tx_event(struct xhci_hcd *xhci,
785 urb = NULL; 844 urb = NULL;
786 goto cleanup; 845 goto cleanup;
787 } 846 }
847 xhci_dbg(xhci, "%s - getting list entry\n", __func__);
788 td = list_entry(ep_ring->td_list.next, struct xhci_td, td_list); 848 td = list_entry(ep_ring->td_list.next, struct xhci_td, td_list);
789 849
790 /* Is this a TRB in the currently executing TD? */ 850 /* Is this a TRB in the currently executing TD? */
851 xhci_dbg(xhci, "%s - looking for TD\n", __func__);
791 event_seg = trb_in_td(ep_ring->deq_seg, ep_ring->dequeue, 852 event_seg = trb_in_td(ep_ring->deq_seg, ep_ring->dequeue,
792 td->last_trb, event_dma); 853 td->last_trb, event_dma);
854 xhci_dbg(xhci, "%s - found event_seg = %p\n", __func__, event_seg);
793 if (!event_seg) { 855 if (!event_seg) {
794 /* HC is busted, give up! */ 856 /* HC is busted, give up! */
795 xhci_err(xhci, "ERROR Transfer event TRB DMA ptr not part of current TD\n"); 857 xhci_err(xhci, "ERROR Transfer event TRB DMA ptr not part of current TD\n");
@@ -798,10 +860,10 @@ static int handle_tx_event(struct xhci_hcd *xhci,
798 event_trb = &event_seg->trbs[(event_dma - event_seg->dma) / sizeof(*event_trb)]; 860 event_trb = &event_seg->trbs[(event_dma - event_seg->dma) / sizeof(*event_trb)];
799 xhci_dbg(xhci, "Event TRB with TRB type ID %u\n", 861 xhci_dbg(xhci, "Event TRB with TRB type ID %u\n",
800 (unsigned int) (event->flags & TRB_TYPE_BITMASK)>>10); 862 (unsigned int) (event->flags & TRB_TYPE_BITMASK)>>10);
801 xhci_dbg(xhci, "Offset 0x00 (buffer[0]) = 0x%x\n", 863 xhci_dbg(xhci, "Offset 0x00 (buffer lo) = 0x%x\n",
802 (unsigned int) event->buffer[0]); 864 lower_32_bits(event->buffer));
803 xhci_dbg(xhci, "Offset 0x04 (buffer[0]) = 0x%x\n", 865 xhci_dbg(xhci, "Offset 0x04 (buffer hi) = 0x%x\n",
804 (unsigned int) event->buffer[1]); 866 upper_32_bits(event->buffer));
805 xhci_dbg(xhci, "Offset 0x08 (transfer length) = 0x%x\n", 867 xhci_dbg(xhci, "Offset 0x08 (transfer length) = 0x%x\n",
806 (unsigned int) event->transfer_len); 868 (unsigned int) event->transfer_len);
807 xhci_dbg(xhci, "Offset 0x0C (flags) = 0x%x\n", 869 xhci_dbg(xhci, "Offset 0x0C (flags) = 0x%x\n",
@@ -823,6 +885,7 @@ static int handle_tx_event(struct xhci_hcd *xhci,
823 break; 885 break;
824 case COMP_STALL: 886 case COMP_STALL:
825 xhci_warn(xhci, "WARN: Stalled endpoint\n"); 887 xhci_warn(xhci, "WARN: Stalled endpoint\n");
888 ep_ring->state |= EP_HALTED;
826 status = -EPIPE; 889 status = -EPIPE;
827 break; 890 break;
828 case COMP_TRB_ERR: 891 case COMP_TRB_ERR:
@@ -833,6 +896,10 @@ static int handle_tx_event(struct xhci_hcd *xhci,
833 xhci_warn(xhci, "WARN: transfer error on endpoint\n"); 896 xhci_warn(xhci, "WARN: transfer error on endpoint\n");
834 status = -EPROTO; 897 status = -EPROTO;
835 break; 898 break;
899 case COMP_BABBLE:
900 xhci_warn(xhci, "WARN: babble error on endpoint\n");
901 status = -EOVERFLOW;
902 break;
836 case COMP_DB_ERR: 903 case COMP_DB_ERR:
837 xhci_warn(xhci, "WARN: HC couldn't access mem fast enough\n"); 904 xhci_warn(xhci, "WARN: HC couldn't access mem fast enough\n");
838 status = -ENOSR; 905 status = -ENOSR;
@@ -874,15 +941,26 @@ static int handle_tx_event(struct xhci_hcd *xhci,
874 if (event_trb != ep_ring->dequeue) { 941 if (event_trb != ep_ring->dequeue) {
875 /* The event was for the status stage */ 942 /* The event was for the status stage */
876 if (event_trb == td->last_trb) { 943 if (event_trb == td->last_trb) {
877 td->urb->actual_length = 944 if (td->urb->actual_length != 0) {
878 td->urb->transfer_buffer_length; 945 /* Don't overwrite a previously set error code */
946 if (status == -EINPROGRESS || status == 0)
947 /* Did we already see a short data stage? */
948 status = -EREMOTEIO;
949 } else {
950 td->urb->actual_length =
951 td->urb->transfer_buffer_length;
952 }
879 } else { 953 } else {
880 /* Maybe the event was for the data stage? */ 954 /* Maybe the event was for the data stage? */
881 if (GET_COMP_CODE(event->transfer_len) != COMP_STOP_INVAL) 955 if (GET_COMP_CODE(event->transfer_len) != COMP_STOP_INVAL) {
882 /* We didn't stop on a link TRB in the middle */ 956 /* We didn't stop on a link TRB in the middle */
883 td->urb->actual_length = 957 td->urb->actual_length =
884 td->urb->transfer_buffer_length - 958 td->urb->transfer_buffer_length -
885 TRB_LEN(event->transfer_len); 959 TRB_LEN(event->transfer_len);
960 xhci_dbg(xhci, "Waiting for status stage event\n");
961 urb = NULL;
962 goto cleanup;
963 }
886 } 964 }
887 } 965 }
888 } else { 966 } else {
@@ -929,16 +1007,20 @@ static int handle_tx_event(struct xhci_hcd *xhci,
929 TRB_LEN(event->transfer_len)); 1007 TRB_LEN(event->transfer_len));
930 td->urb->actual_length = 0; 1008 td->urb->actual_length = 0;
931 } 1009 }
932 if (td->urb->transfer_flags & URB_SHORT_NOT_OK) 1010 /* Don't overwrite a previously set error code */
933 status = -EREMOTEIO; 1011 if (status == -EINPROGRESS) {
934 else 1012 if (td->urb->transfer_flags & URB_SHORT_NOT_OK)
935 status = 0; 1013 status = -EREMOTEIO;
1014 else
1015 status = 0;
1016 }
936 } else { 1017 } else {
937 td->urb->actual_length = td->urb->transfer_buffer_length; 1018 td->urb->actual_length = td->urb->transfer_buffer_length;
938 /* Ignore a short packet completion if the 1019 /* Ignore a short packet completion if the
939 * untransferred length was zero. 1020 * untransferred length was zero.
940 */ 1021 */
941 status = 0; 1022 if (status == -EREMOTEIO)
1023 status = 0;
942 } 1024 }
943 } else { 1025 } else {
944 /* Slow path - walk the list, starting from the dequeue 1026 /* Slow path - walk the list, starting from the dequeue
@@ -965,19 +1047,30 @@ static int handle_tx_event(struct xhci_hcd *xhci,
965 TRB_LEN(event->transfer_len); 1047 TRB_LEN(event->transfer_len);
966 } 1048 }
967 } 1049 }
968 /* The Endpoint Stop Command completion will take care of
969 * any stopped TDs. A stopped TD may be restarted, so don't update the
970 * ring dequeue pointer or take this TD off any lists yet.
971 */
972 if (GET_COMP_CODE(event->transfer_len) == COMP_STOP_INVAL || 1050 if (GET_COMP_CODE(event->transfer_len) == COMP_STOP_INVAL ||
973 GET_COMP_CODE(event->transfer_len) == COMP_STOP) { 1051 GET_COMP_CODE(event->transfer_len) == COMP_STOP) {
1052 /* The Endpoint Stop Command completion will take care of any
1053 * stopped TDs. A stopped TD may be restarted, so don't update
1054 * the ring dequeue pointer or take this TD off any lists yet.
1055 */
974 ep_ring->stopped_td = td; 1056 ep_ring->stopped_td = td;
975 ep_ring->stopped_trb = event_trb; 1057 ep_ring->stopped_trb = event_trb;
976 } else { 1058 } else {
977 /* Update ring dequeue pointer */ 1059 if (GET_COMP_CODE(event->transfer_len) == COMP_STALL) {
978 while (ep_ring->dequeue != td->last_trb) 1060 /* The transfer is completed from the driver's
1061 * perspective, but we need to issue a set dequeue
1062 * command for this stalled endpoint to move the dequeue
1063 * pointer past the TD. We can't do that here because
1064 * the halt condition must be cleared first.
1065 */
1066 ep_ring->stopped_td = td;
1067 ep_ring->stopped_trb = event_trb;
1068 } else {
1069 /* Update ring dequeue pointer */
1070 while (ep_ring->dequeue != td->last_trb)
1071 inc_deq(xhci, ep_ring, false);
979 inc_deq(xhci, ep_ring, false); 1072 inc_deq(xhci, ep_ring, false);
980 inc_deq(xhci, ep_ring, false); 1073 }
981 1074
982 /* Clean up the endpoint's TD list */ 1075 /* Clean up the endpoint's TD list */
983 urb = td->urb; 1076 urb = td->urb;
@@ -987,7 +1080,10 @@ static int handle_tx_event(struct xhci_hcd *xhci,
987 list_del(&td->cancelled_td_list); 1080 list_del(&td->cancelled_td_list);
988 ep_ring->cancels_pending--; 1081 ep_ring->cancels_pending--;
989 } 1082 }
990 kfree(td); 1083 /* Leave the TD around for the reset endpoint function to use */
1084 if (GET_COMP_CODE(event->transfer_len) != COMP_STALL) {
1085 kfree(td);
1086 }
991 urb->hcpriv = NULL; 1087 urb->hcpriv = NULL;
992 } 1088 }
993cleanup: 1089cleanup:
@@ -997,6 +1093,8 @@ cleanup:
997 /* FIXME for multi-TD URBs (who have buffers bigger than 64MB) */ 1093 /* FIXME for multi-TD URBs (who have buffers bigger than 64MB) */
998 if (urb) { 1094 if (urb) {
999 usb_hcd_unlink_urb_from_ep(xhci_to_hcd(xhci), urb); 1095 usb_hcd_unlink_urb_from_ep(xhci_to_hcd(xhci), urb);
1096 xhci_dbg(xhci, "Giveback URB %p, len = %d, status = %d\n",
1097 urb, td->urb->actual_length, status);
1000 spin_unlock(&xhci->lock); 1098 spin_unlock(&xhci->lock);
1001 usb_hcd_giveback_urb(xhci_to_hcd(xhci), urb, status); 1099 usb_hcd_giveback_urb(xhci_to_hcd(xhci), urb, status);
1002 spin_lock(&xhci->lock); 1100 spin_lock(&xhci->lock);
@@ -1014,6 +1112,7 @@ void xhci_handle_event(struct xhci_hcd *xhci)
1014 int update_ptrs = 1; 1112 int update_ptrs = 1;
1015 int ret; 1113 int ret;
1016 1114
1115 xhci_dbg(xhci, "In %s\n", __func__);
1017 if (!xhci->event_ring || !xhci->event_ring->dequeue) { 1116 if (!xhci->event_ring || !xhci->event_ring->dequeue) {
1018 xhci->error_bitmask |= 1 << 1; 1117 xhci->error_bitmask |= 1 << 1;
1019 return; 1118 return;
@@ -1026,18 +1125,25 @@ void xhci_handle_event(struct xhci_hcd *xhci)
1026 xhci->error_bitmask |= 1 << 2; 1125 xhci->error_bitmask |= 1 << 2;
1027 return; 1126 return;
1028 } 1127 }
1128 xhci_dbg(xhci, "%s - OS owns TRB\n", __func__);
1029 1129
1030 /* FIXME: Handle more event types. */ 1130 /* FIXME: Handle more event types. */
1031 switch ((event->event_cmd.flags & TRB_TYPE_BITMASK)) { 1131 switch ((event->event_cmd.flags & TRB_TYPE_BITMASK)) {
1032 case TRB_TYPE(TRB_COMPLETION): 1132 case TRB_TYPE(TRB_COMPLETION):
1133 xhci_dbg(xhci, "%s - calling handle_cmd_completion\n", __func__);
1033 handle_cmd_completion(xhci, &event->event_cmd); 1134 handle_cmd_completion(xhci, &event->event_cmd);
1135 xhci_dbg(xhci, "%s - returned from handle_cmd_completion\n", __func__);
1034 break; 1136 break;
1035 case TRB_TYPE(TRB_PORT_STATUS): 1137 case TRB_TYPE(TRB_PORT_STATUS):
1138 xhci_dbg(xhci, "%s - calling handle_port_status\n", __func__);
1036 handle_port_status(xhci, event); 1139 handle_port_status(xhci, event);
1140 xhci_dbg(xhci, "%s - returned from handle_port_status\n", __func__);
1037 update_ptrs = 0; 1141 update_ptrs = 0;
1038 break; 1142 break;
1039 case TRB_TYPE(TRB_TRANSFER): 1143 case TRB_TYPE(TRB_TRANSFER):
1144 xhci_dbg(xhci, "%s - calling handle_tx_event\n", __func__);
1040 ret = handle_tx_event(xhci, &event->trans_event); 1145 ret = handle_tx_event(xhci, &event->trans_event);
1146 xhci_dbg(xhci, "%s - returned from handle_tx_event\n", __func__);
1041 if (ret < 0) 1147 if (ret < 0)
1042 xhci->error_bitmask |= 1 << 9; 1148 xhci->error_bitmask |= 1 << 9;
1043 else 1149 else
@@ -1093,13 +1199,13 @@ static int prepare_ring(struct xhci_hcd *xhci, struct xhci_ring *ep_ring,
1093 */ 1199 */
1094 xhci_warn(xhci, "WARN urb submitted to disabled ep\n"); 1200 xhci_warn(xhci, "WARN urb submitted to disabled ep\n");
1095 return -ENOENT; 1201 return -ENOENT;
1096 case EP_STATE_HALTED:
1097 case EP_STATE_ERROR: 1202 case EP_STATE_ERROR:
1098 xhci_warn(xhci, "WARN waiting for halt or error on ep " 1203 xhci_warn(xhci, "WARN waiting for error on ep to be cleared\n");
1099 "to be cleared\n");
1100 /* FIXME event handling code for error needs to clear it */ 1204 /* FIXME event handling code for error needs to clear it */
1101 /* XXX not sure if this should be -ENOENT or not */ 1205 /* XXX not sure if this should be -ENOENT or not */
1102 return -EINVAL; 1206 return -EINVAL;
1207 case EP_STATE_HALTED:
1208 xhci_dbg(xhci, "WARN halted endpoint, queueing URB anyway.\n");
1103 case EP_STATE_STOPPED: 1209 case EP_STATE_STOPPED:
1104 case EP_STATE_RUNNING: 1210 case EP_STATE_RUNNING:
1105 break; 1211 break;
@@ -1128,9 +1234,9 @@ static int prepare_transfer(struct xhci_hcd *xhci,
1128 gfp_t mem_flags) 1234 gfp_t mem_flags)
1129{ 1235{
1130 int ret; 1236 int ret;
1131 1237 struct xhci_ep_ctx *ep_ctx = xhci_get_ep_ctx(xhci, xdev->out_ctx, ep_index);
1132 ret = prepare_ring(xhci, xdev->ep_rings[ep_index], 1238 ret = prepare_ring(xhci, xdev->ep_rings[ep_index],
1133 xdev->out_ctx->ep[ep_index].ep_info & EP_STATE_MASK, 1239 ep_ctx->ep_info & EP_STATE_MASK,
1134 num_trbs, mem_flags); 1240 num_trbs, mem_flags);
1135 if (ret) 1241 if (ret)
1136 return ret; 1242 return ret;
@@ -1285,6 +1391,7 @@ static int queue_bulk_sg_tx(struct xhci_hcd *xhci, gfp_t mem_flags,
1285 /* Queue the first TRB, even if it's zero-length */ 1391 /* Queue the first TRB, even if it's zero-length */
1286 do { 1392 do {
1287 u32 field = 0; 1393 u32 field = 0;
1394 u32 length_field = 0;
1288 1395
1289 /* Don't change the cycle bit of the first TRB until later */ 1396 /* Don't change the cycle bit of the first TRB until later */
1290 if (first_trb) 1397 if (first_trb)
@@ -1314,10 +1421,13 @@ static int queue_bulk_sg_tx(struct xhci_hcd *xhci, gfp_t mem_flags,
1314 (unsigned int) (addr + TRB_MAX_BUFF_SIZE) & ~(TRB_MAX_BUFF_SIZE - 1), 1421 (unsigned int) (addr + TRB_MAX_BUFF_SIZE) & ~(TRB_MAX_BUFF_SIZE - 1),
1315 (unsigned int) addr + trb_buff_len); 1422 (unsigned int) addr + trb_buff_len);
1316 } 1423 }
1424 length_field = TRB_LEN(trb_buff_len) |
1425 TD_REMAINDER(urb->transfer_buffer_length - running_total) |
1426 TRB_INTR_TARGET(0);
1317 queue_trb(xhci, ep_ring, false, 1427 queue_trb(xhci, ep_ring, false,
1318 (u32) addr, 1428 lower_32_bits(addr),
1319 (u32) ((u64) addr >> 32), 1429 upper_32_bits(addr),
1320 TRB_LEN(trb_buff_len) | TRB_INTR_TARGET(0), 1430 length_field,
1321 /* We always want to know if the TRB was short, 1431 /* We always want to know if the TRB was short,
1322 * or we won't get an event when it completes. 1432 * or we won't get an event when it completes.
1323 * (Unless we use event data TRBs, which are a 1433 * (Unless we use event data TRBs, which are a
@@ -1365,7 +1475,7 @@ int xhci_queue_bulk_tx(struct xhci_hcd *xhci, gfp_t mem_flags,
1365 struct xhci_generic_trb *start_trb; 1475 struct xhci_generic_trb *start_trb;
1366 bool first_trb; 1476 bool first_trb;
1367 int start_cycle; 1477 int start_cycle;
1368 u32 field; 1478 u32 field, length_field;
1369 1479
1370 int running_total, trb_buff_len, ret; 1480 int running_total, trb_buff_len, ret;
1371 u64 addr; 1481 u64 addr;
@@ -1443,10 +1553,13 @@ int xhci_queue_bulk_tx(struct xhci_hcd *xhci, gfp_t mem_flags,
1443 td->last_trb = ep_ring->enqueue; 1553 td->last_trb = ep_ring->enqueue;
1444 field |= TRB_IOC; 1554 field |= TRB_IOC;
1445 } 1555 }
1556 length_field = TRB_LEN(trb_buff_len) |
1557 TD_REMAINDER(urb->transfer_buffer_length - running_total) |
1558 TRB_INTR_TARGET(0);
1446 queue_trb(xhci, ep_ring, false, 1559 queue_trb(xhci, ep_ring, false,
1447 (u32) addr, 1560 lower_32_bits(addr),
1448 (u32) ((u64) addr >> 32), 1561 upper_32_bits(addr),
1449 TRB_LEN(trb_buff_len) | TRB_INTR_TARGET(0), 1562 length_field,
1450 /* We always want to know if the TRB was short, 1563 /* We always want to know if the TRB was short,
1451 * or we won't get an event when it completes. 1564 * or we won't get an event when it completes.
1452 * (Unless we use event data TRBs, which are a 1565 * (Unless we use event data TRBs, which are a
@@ -1478,7 +1591,7 @@ int xhci_queue_ctrl_tx(struct xhci_hcd *xhci, gfp_t mem_flags,
1478 struct usb_ctrlrequest *setup; 1591 struct usb_ctrlrequest *setup;
1479 struct xhci_generic_trb *start_trb; 1592 struct xhci_generic_trb *start_trb;
1480 int start_cycle; 1593 int start_cycle;
1481 u32 field; 1594 u32 field, length_field;
1482 struct xhci_td *td; 1595 struct xhci_td *td;
1483 1596
1484 ep_ring = xhci->devs[slot_id]->ep_rings[ep_index]; 1597 ep_ring = xhci->devs[slot_id]->ep_rings[ep_index];
@@ -1528,13 +1641,16 @@ int xhci_queue_ctrl_tx(struct xhci_hcd *xhci, gfp_t mem_flags,
1528 1641
1529 /* If there's data, queue data TRBs */ 1642 /* If there's data, queue data TRBs */
1530 field = 0; 1643 field = 0;
1644 length_field = TRB_LEN(urb->transfer_buffer_length) |
1645 TD_REMAINDER(urb->transfer_buffer_length) |
1646 TRB_INTR_TARGET(0);
1531 if (urb->transfer_buffer_length > 0) { 1647 if (urb->transfer_buffer_length > 0) {
1532 if (setup->bRequestType & USB_DIR_IN) 1648 if (setup->bRequestType & USB_DIR_IN)
1533 field |= TRB_DIR_IN; 1649 field |= TRB_DIR_IN;
1534 queue_trb(xhci, ep_ring, false, 1650 queue_trb(xhci, ep_ring, false,
1535 lower_32_bits(urb->transfer_dma), 1651 lower_32_bits(urb->transfer_dma),
1536 upper_32_bits(urb->transfer_dma), 1652 upper_32_bits(urb->transfer_dma),
1537 TRB_LEN(urb->transfer_buffer_length) | TRB_INTR_TARGET(0), 1653 length_field,
1538 /* Event on short tx */ 1654 /* Event on short tx */
1539 field | TRB_ISP | TRB_TYPE(TRB_DATA) | ep_ring->cycle_state); 1655 field | TRB_ISP | TRB_TYPE(TRB_DATA) | ep_ring->cycle_state);
1540 } 1656 }
@@ -1603,7 +1719,8 @@ int xhci_queue_slot_control(struct xhci_hcd *xhci, u32 trb_type, u32 slot_id)
1603int xhci_queue_address_device(struct xhci_hcd *xhci, dma_addr_t in_ctx_ptr, 1719int xhci_queue_address_device(struct xhci_hcd *xhci, dma_addr_t in_ctx_ptr,
1604 u32 slot_id) 1720 u32 slot_id)
1605{ 1721{
1606 return queue_command(xhci, in_ctx_ptr, 0, 0, 1722 return queue_command(xhci, lower_32_bits(in_ctx_ptr),
1723 upper_32_bits(in_ctx_ptr), 0,
1607 TRB_TYPE(TRB_ADDR_DEV) | SLOT_ID_FOR_TRB(slot_id)); 1724 TRB_TYPE(TRB_ADDR_DEV) | SLOT_ID_FOR_TRB(slot_id));
1608} 1725}
1609 1726
@@ -1611,7 +1728,8 @@ int xhci_queue_address_device(struct xhci_hcd *xhci, dma_addr_t in_ctx_ptr,
1611int xhci_queue_configure_endpoint(struct xhci_hcd *xhci, dma_addr_t in_ctx_ptr, 1728int xhci_queue_configure_endpoint(struct xhci_hcd *xhci, dma_addr_t in_ctx_ptr,
1612 u32 slot_id) 1729 u32 slot_id)
1613{ 1730{
1614 return queue_command(xhci, in_ctx_ptr, 0, 0, 1731 return queue_command(xhci, lower_32_bits(in_ctx_ptr),
1732 upper_32_bits(in_ctx_ptr), 0,
1615 TRB_TYPE(TRB_CONFIG_EP) | SLOT_ID_FOR_TRB(slot_id)); 1733 TRB_TYPE(TRB_CONFIG_EP) | SLOT_ID_FOR_TRB(slot_id));
1616} 1734}
1617 1735
@@ -1639,10 +1757,23 @@ static int queue_set_tr_deq(struct xhci_hcd *xhci, int slot_id,
1639 u32 type = TRB_TYPE(TRB_SET_DEQ); 1757 u32 type = TRB_TYPE(TRB_SET_DEQ);
1640 1758
1641 addr = xhci_trb_virt_to_dma(deq_seg, deq_ptr); 1759 addr = xhci_trb_virt_to_dma(deq_seg, deq_ptr);
1642 if (addr == 0) 1760 if (addr == 0) {
1643 xhci_warn(xhci, "WARN Cannot submit Set TR Deq Ptr\n"); 1761 xhci_warn(xhci, "WARN Cannot submit Set TR Deq Ptr\n");
1644 xhci_warn(xhci, "WARN deq seg = %p, deq pt = %p\n", 1762 xhci_warn(xhci, "WARN deq seg = %p, deq pt = %p\n",
1645 deq_seg, deq_ptr); 1763 deq_seg, deq_ptr);
1646 return queue_command(xhci, (u32) addr | cycle_state, 0, 0, 1764 return 0;
1765 }
1766 return queue_command(xhci, lower_32_bits(addr) | cycle_state,
1767 upper_32_bits(addr), 0,
1647 trb_slot_id | trb_ep_index | type); 1768 trb_slot_id | trb_ep_index | type);
1648} 1769}
1770
1771int xhci_queue_reset_ep(struct xhci_hcd *xhci, int slot_id,
1772 unsigned int ep_index)
1773{
1774 u32 trb_slot_id = SLOT_ID_FOR_TRB(slot_id);
1775 u32 trb_ep_index = EP_ID_FOR_TRB(ep_index);
1776 u32 type = TRB_TYPE(TRB_RESET_EP);
1777
1778 return queue_command(xhci, 0, 0, 0, trb_slot_id | trb_ep_index | type);
1779}
diff --git a/drivers/usb/host/xhci.h b/drivers/usb/host/xhci.h
index 8936eeb5588b..d31d32206ba3 100644
--- a/drivers/usb/host/xhci.h
+++ b/drivers/usb/host/xhci.h
@@ -25,6 +25,7 @@
25 25
26#include <linux/usb.h> 26#include <linux/usb.h>
27#include <linux/timer.h> 27#include <linux/timer.h>
28#include <linux/kernel.h>
28 29
29#include "../core/hcd.h" 30#include "../core/hcd.h"
30/* Code sharing between pci-quirks and xhci hcd */ 31/* Code sharing between pci-quirks and xhci hcd */
@@ -42,14 +43,6 @@
42 * xHCI register interface. 43 * xHCI register interface.
43 * This corresponds to the eXtensible Host Controller Interface (xHCI) 44 * This corresponds to the eXtensible Host Controller Interface (xHCI)
44 * Revision 0.95 specification 45 * Revision 0.95 specification
45 *
46 * Registers should always be accessed with double word or quad word accesses.
47 *
48 * Some xHCI implementations may support 64-bit address pointers. Registers
49 * with 64-bit address pointers should be written to with dword accesses by
50 * writing the low dword first (ptr[0]), then the high dword (ptr[1]) second.
51 * xHCI implementations that do not support 64-bit address pointers will ignore
52 * the high dword, and write order is irrelevant.
53 */ 46 */
54 47
55/** 48/**
@@ -96,6 +89,7 @@ struct xhci_cap_regs {
96#define HCS_ERST_MAX(p) (((p) >> 4) & 0xf) 89#define HCS_ERST_MAX(p) (((p) >> 4) & 0xf)
97/* bit 26 Scratchpad restore - for save/restore HW state - not used yet */ 90/* bit 26 Scratchpad restore - for save/restore HW state - not used yet */
98/* bits 27:31 number of Scratchpad buffers SW must allocate for the HW */ 91/* bits 27:31 number of Scratchpad buffers SW must allocate for the HW */
92#define HCS_MAX_SCRATCHPAD(p) (((p) >> 27) & 0x1f)
99 93
100/* HCSPARAMS3 - hcs_params3 - bitmasks */ 94/* HCSPARAMS3 - hcs_params3 - bitmasks */
101/* bits 0:7, Max U1 to U0 latency for the roothub ports */ 95/* bits 0:7, Max U1 to U0 latency for the roothub ports */
@@ -166,10 +160,10 @@ struct xhci_op_regs {
166 u32 reserved1; 160 u32 reserved1;
167 u32 reserved2; 161 u32 reserved2;
168 u32 dev_notification; 162 u32 dev_notification;
169 u32 cmd_ring[2]; 163 u64 cmd_ring;
170 /* rsvd: offset 0x20-2F */ 164 /* rsvd: offset 0x20-2F */
171 u32 reserved3[4]; 165 u32 reserved3[4];
172 u32 dcbaa_ptr[2]; 166 u64 dcbaa_ptr;
173 u32 config_reg; 167 u32 config_reg;
174 /* rsvd: offset 0x3C-3FF */ 168 /* rsvd: offset 0x3C-3FF */
175 u32 reserved4[241]; 169 u32 reserved4[241];
@@ -254,7 +248,7 @@ struct xhci_op_regs {
254#define CMD_RING_RUNNING (1 << 3) 248#define CMD_RING_RUNNING (1 << 3)
255/* bits 4:5 reserved and should be preserved */ 249/* bits 4:5 reserved and should be preserved */
256/* Command Ring pointer - bit mask for the lower 32 bits. */ 250/* Command Ring pointer - bit mask for the lower 32 bits. */
257#define CMD_RING_ADDR_MASK (0xffffffc0) 251#define CMD_RING_RSVD_BITS (0x3f)
258 252
259/* CONFIG - Configure Register - config_reg bitmasks */ 253/* CONFIG - Configure Register - config_reg bitmasks */
260/* bits 0:7 - maximum number of device slots enabled (NumSlotsEn) */ 254/* bits 0:7 - maximum number of device slots enabled (NumSlotsEn) */
@@ -382,8 +376,8 @@ struct xhci_intr_reg {
382 u32 irq_control; 376 u32 irq_control;
383 u32 erst_size; 377 u32 erst_size;
384 u32 rsvd; 378 u32 rsvd;
385 u32 erst_base[2]; 379 u64 erst_base;
386 u32 erst_dequeue[2]; 380 u64 erst_dequeue;
387}; 381};
388 382
389/* irq_pending bitmasks */ 383/* irq_pending bitmasks */
@@ -453,6 +447,27 @@ struct xhci_doorbell_array {
453 447
454 448
455/** 449/**
450 * struct xhci_container_ctx
451 * @type: Type of context. Used to calculated offsets to contained contexts.
452 * @size: Size of the context data
453 * @bytes: The raw context data given to HW
454 * @dma: dma address of the bytes
455 *
456 * Represents either a Device or Input context. Holds a pointer to the raw
457 * memory used for the context (bytes) and dma address of it (dma).
458 */
459struct xhci_container_ctx {
460 unsigned type;
461#define XHCI_CTX_TYPE_DEVICE 0x1
462#define XHCI_CTX_TYPE_INPUT 0x2
463
464 int size;
465
466 u8 *bytes;
467 dma_addr_t dma;
468};
469
470/**
456 * struct xhci_slot_ctx 471 * struct xhci_slot_ctx
457 * @dev_info: Route string, device speed, hub info, and last valid endpoint 472 * @dev_info: Route string, device speed, hub info, and last valid endpoint
458 * @dev_info2: Max exit latency for device number, root hub port number 473 * @dev_info2: Max exit latency for device number, root hub port number
@@ -538,7 +553,7 @@ struct xhci_slot_ctx {
538struct xhci_ep_ctx { 553struct xhci_ep_ctx {
539 u32 ep_info; 554 u32 ep_info;
540 u32 ep_info2; 555 u32 ep_info2;
541 u32 deq[2]; 556 u64 deq;
542 u32 tx_info; 557 u32 tx_info;
543 /* offset 0x14 - 0x1f reserved for HC internal use */ 558 /* offset 0x14 - 0x1f reserved for HC internal use */
544 u32 reserved[3]; 559 u32 reserved[3];
@@ -589,18 +604,16 @@ struct xhci_ep_ctx {
589 604
590 605
591/** 606/**
592 * struct xhci_device_control 607 * struct xhci_input_control_context
593 * Input/Output context; see section 6.2.5. 608 * Input control context; see section 6.2.5.
594 * 609 *
595 * @drop_context: set the bit of the endpoint context you want to disable 610 * @drop_context: set the bit of the endpoint context you want to disable
596 * @add_context: set the bit of the endpoint context you want to enable 611 * @add_context: set the bit of the endpoint context you want to enable
597 */ 612 */
598struct xhci_device_control { 613struct xhci_input_control_ctx {
599 u32 drop_flags; 614 u32 drop_flags;
600 u32 add_flags; 615 u32 add_flags;
601 u32 rsvd[6]; 616 u32 rsvd2[6];
602 struct xhci_slot_ctx slot;
603 struct xhci_ep_ctx ep[31];
604}; 617};
605 618
606/* drop context bitmasks */ 619/* drop context bitmasks */
@@ -608,7 +621,6 @@ struct xhci_device_control {
608/* add context bitmasks */ 621/* add context bitmasks */
609#define ADD_EP(x) (0x1 << x) 622#define ADD_EP(x) (0x1 << x)
610 623
611
612struct xhci_virt_device { 624struct xhci_virt_device {
613 /* 625 /*
614 * Commands to the hardware are passed an "input context" that 626 * Commands to the hardware are passed an "input context" that
@@ -618,11 +630,10 @@ struct xhci_virt_device {
618 * track of input and output contexts separately because 630 * track of input and output contexts separately because
619 * these commands might fail and we don't trust the hardware. 631 * these commands might fail and we don't trust the hardware.
620 */ 632 */
621 struct xhci_device_control *out_ctx; 633 struct xhci_container_ctx *out_ctx;
622 dma_addr_t out_ctx_dma;
623 /* Used for addressing devices and configuration changes */ 634 /* Used for addressing devices and configuration changes */
624 struct xhci_device_control *in_ctx; 635 struct xhci_container_ctx *in_ctx;
625 dma_addr_t in_ctx_dma; 636
626 /* FIXME when stream support is added */ 637 /* FIXME when stream support is added */
627 struct xhci_ring *ep_rings[31]; 638 struct xhci_ring *ep_rings[31];
628 /* Temporary storage in case the configure endpoint command fails and we 639 /* Temporary storage in case the configure endpoint command fails and we
@@ -641,7 +652,7 @@ struct xhci_virt_device {
641 */ 652 */
642struct xhci_device_context_array { 653struct xhci_device_context_array {
643 /* 64-bit device addresses; we only write 32-bit addresses */ 654 /* 64-bit device addresses; we only write 32-bit addresses */
644 u32 dev_context_ptrs[2*MAX_HC_SLOTS]; 655 u64 dev_context_ptrs[MAX_HC_SLOTS];
645 /* private xHCD pointers */ 656 /* private xHCD pointers */
646 dma_addr_t dma; 657 dma_addr_t dma;
647}; 658};
@@ -654,7 +665,7 @@ struct xhci_device_context_array {
654 665
655struct xhci_stream_ctx { 666struct xhci_stream_ctx {
656 /* 64-bit stream ring address, cycle state, and stream type */ 667 /* 64-bit stream ring address, cycle state, and stream type */
657 u32 stream_ring[2]; 668 u64 stream_ring;
658 /* offset 0x14 - 0x1f reserved for HC internal use */ 669 /* offset 0x14 - 0x1f reserved for HC internal use */
659 u32 reserved[2]; 670 u32 reserved[2];
660}; 671};
@@ -662,7 +673,7 @@ struct xhci_stream_ctx {
662 673
663struct xhci_transfer_event { 674struct xhci_transfer_event {
664 /* 64-bit buffer address, or immediate data */ 675 /* 64-bit buffer address, or immediate data */
665 u32 buffer[2]; 676 u64 buffer;
666 u32 transfer_len; 677 u32 transfer_len;
667 /* This field is interpreted differently based on the type of TRB */ 678 /* This field is interpreted differently based on the type of TRB */
668 u32 flags; 679 u32 flags;
@@ -744,7 +755,7 @@ struct xhci_transfer_event {
744 755
745struct xhci_link_trb { 756struct xhci_link_trb {
746 /* 64-bit segment pointer*/ 757 /* 64-bit segment pointer*/
747 u32 segment_ptr[2]; 758 u64 segment_ptr;
748 u32 intr_target; 759 u32 intr_target;
749 u32 control; 760 u32 control;
750}; 761};
@@ -755,7 +766,7 @@ struct xhci_link_trb {
755/* Command completion event TRB */ 766/* Command completion event TRB */
756struct xhci_event_cmd { 767struct xhci_event_cmd {
757 /* Pointer to command TRB, or the value passed by the event data trb */ 768 /* Pointer to command TRB, or the value passed by the event data trb */
758 u32 cmd_trb[2]; 769 u64 cmd_trb;
759 u32 status; 770 u32 status;
760 u32 flags; 771 u32 flags;
761}; 772};
@@ -848,8 +859,8 @@ union xhci_trb {
848#define TRB_CONFIG_EP 12 859#define TRB_CONFIG_EP 12
849/* Evaluate Context Command */ 860/* Evaluate Context Command */
850#define TRB_EVAL_CONTEXT 13 861#define TRB_EVAL_CONTEXT 13
851/* Reset Transfer Ring Command */ 862/* Reset Endpoint Command */
852#define TRB_RESET_RING 14 863#define TRB_RESET_EP 14
853/* Stop Transfer Ring Command */ 864/* Stop Transfer Ring Command */
854#define TRB_STOP_RING 15 865#define TRB_STOP_RING 15
855/* Set Transfer Ring Dequeue Pointer Command */ 866/* Set Transfer Ring Dequeue Pointer Command */
@@ -929,6 +940,7 @@ struct xhci_ring {
929 unsigned int cancels_pending; 940 unsigned int cancels_pending;
930 unsigned int state; 941 unsigned int state;
931#define SET_DEQ_PENDING (1 << 0) 942#define SET_DEQ_PENDING (1 << 0)
943#define EP_HALTED (1 << 1)
932 /* The TRB that was last reported in a stopped endpoint ring */ 944 /* The TRB that was last reported in a stopped endpoint ring */
933 union xhci_trb *stopped_trb; 945 union xhci_trb *stopped_trb;
934 struct xhci_td *stopped_td; 946 struct xhci_td *stopped_td;
@@ -940,9 +952,15 @@ struct xhci_ring {
940 u32 cycle_state; 952 u32 cycle_state;
941}; 953};
942 954
955struct xhci_dequeue_state {
956 struct xhci_segment *new_deq_seg;
957 union xhci_trb *new_deq_ptr;
958 int new_cycle_state;
959};
960
943struct xhci_erst_entry { 961struct xhci_erst_entry {
944 /* 64-bit event ring segment address */ 962 /* 64-bit event ring segment address */
945 u32 seg_addr[2]; 963 u64 seg_addr;
946 u32 seg_size; 964 u32 seg_size;
947 /* Set to zero */ 965 /* Set to zero */
948 u32 rsvd; 966 u32 rsvd;
@@ -957,6 +975,13 @@ struct xhci_erst {
957 unsigned int erst_size; 975 unsigned int erst_size;
958}; 976};
959 977
978struct xhci_scratchpad {
979 u64 *sp_array;
980 dma_addr_t sp_dma;
981 void **sp_buffers;
982 dma_addr_t *sp_dma_buffers;
983};
984
960/* 985/*
961 * Each segment table entry is 4*32bits long. 1K seems like an ok size: 986 * Each segment table entry is 4*32bits long. 1K seems like an ok size:
962 * (1K bytes * 8bytes/bit) / (4*32 bits) = 64 segment entries in the table, 987 * (1K bytes * 8bytes/bit) / (4*32 bits) = 64 segment entries in the table,
@@ -1011,6 +1036,9 @@ struct xhci_hcd {
1011 struct xhci_ring *cmd_ring; 1036 struct xhci_ring *cmd_ring;
1012 struct xhci_ring *event_ring; 1037 struct xhci_ring *event_ring;
1013 struct xhci_erst erst; 1038 struct xhci_erst erst;
1039 /* Scratchpad */
1040 struct xhci_scratchpad *scratchpad;
1041
1014 /* slot enabling and address device helpers */ 1042 /* slot enabling and address device helpers */
1015 struct completion addr_dev; 1043 struct completion addr_dev;
1016 int slot_id; 1044 int slot_id;
@@ -1071,13 +1099,43 @@ static inline unsigned int xhci_readl(const struct xhci_hcd *xhci,
1071static inline void xhci_writel(struct xhci_hcd *xhci, 1099static inline void xhci_writel(struct xhci_hcd *xhci,
1072 const unsigned int val, __u32 __iomem *regs) 1100 const unsigned int val, __u32 __iomem *regs)
1073{ 1101{
1074 if (!in_interrupt()) 1102 xhci_dbg(xhci,
1075 xhci_dbg(xhci, 1103 "`MEM_WRITE_DWORD(3'b000, 32'h%p, 32'h%0x, 4'hf);\n",
1076 "`MEM_WRITE_DWORD(3'b000, 32'h%p, 32'h%0x, 4'hf);\n", 1104 regs, val);
1077 regs, val);
1078 writel(val, regs); 1105 writel(val, regs);
1079} 1106}
1080 1107
1108/*
1109 * Registers should always be accessed with double word or quad word accesses.
1110 *
1111 * Some xHCI implementations may support 64-bit address pointers. Registers
1112 * with 64-bit address pointers should be written to with dword accesses by
1113 * writing the low dword first (ptr[0]), then the high dword (ptr[1]) second.
1114 * xHCI implementations that do not support 64-bit address pointers will ignore
1115 * the high dword, and write order is irrelevant.
1116 */
1117static inline u64 xhci_read_64(const struct xhci_hcd *xhci,
1118 __u64 __iomem *regs)
1119{
1120 __u32 __iomem *ptr = (__u32 __iomem *) regs;
1121 u64 val_lo = readl(ptr);
1122 u64 val_hi = readl(ptr + 1);
1123 return val_lo + (val_hi << 32);
1124}
1125static inline void xhci_write_64(struct xhci_hcd *xhci,
1126 const u64 val, __u64 __iomem *regs)
1127{
1128 __u32 __iomem *ptr = (__u32 __iomem *) regs;
1129 u32 val_lo = lower_32_bits(val);
1130 u32 val_hi = upper_32_bits(val);
1131
1132 xhci_dbg(xhci,
1133 "`MEM_WRITE_DWORD(3'b000, 64'h%p, 64'h%0lx, 4'hf);\n",
1134 regs, (long unsigned int) val);
1135 writel(val_lo, ptr);
1136 writel(val_hi, ptr + 1);
1137}
1138
1081/* xHCI debugging */ 1139/* xHCI debugging */
1082void xhci_print_ir_set(struct xhci_hcd *xhci, struct xhci_intr_reg *ir_set, int set_num); 1140void xhci_print_ir_set(struct xhci_hcd *xhci, struct xhci_intr_reg *ir_set, int set_num);
1083void xhci_print_registers(struct xhci_hcd *xhci); 1141void xhci_print_registers(struct xhci_hcd *xhci);
@@ -1090,7 +1148,7 @@ void xhci_debug_ring(struct xhci_hcd *xhci, struct xhci_ring *ring);
1090void xhci_dbg_erst(struct xhci_hcd *xhci, struct xhci_erst *erst); 1148void xhci_dbg_erst(struct xhci_hcd *xhci, struct xhci_erst *erst);
1091void xhci_dbg_cmd_ptrs(struct xhci_hcd *xhci); 1149void xhci_dbg_cmd_ptrs(struct xhci_hcd *xhci);
1092void xhci_dbg_ring_ptrs(struct xhci_hcd *xhci, struct xhci_ring *ring); 1150void xhci_dbg_ring_ptrs(struct xhci_hcd *xhci, struct xhci_ring *ring);
1093void xhci_dbg_ctx(struct xhci_hcd *xhci, struct xhci_device_control *ctx, dma_addr_t dma, unsigned int last_ep); 1151void xhci_dbg_ctx(struct xhci_hcd *xhci, struct xhci_container_ctx *ctx, unsigned int last_ep);
1094 1152
1095/* xHCI memory managment */ 1153/* xHCI memory managment */
1096void xhci_mem_cleanup(struct xhci_hcd *xhci); 1154void xhci_mem_cleanup(struct xhci_hcd *xhci);
@@ -1128,6 +1186,7 @@ int xhci_urb_enqueue(struct usb_hcd *hcd, struct urb *urb, gfp_t mem_flags);
1128int xhci_urb_dequeue(struct usb_hcd *hcd, struct urb *urb, int status); 1186int xhci_urb_dequeue(struct usb_hcd *hcd, struct urb *urb, int status);
1129int xhci_add_endpoint(struct usb_hcd *hcd, struct usb_device *udev, struct usb_host_endpoint *ep); 1187int xhci_add_endpoint(struct usb_hcd *hcd, struct usb_device *udev, struct usb_host_endpoint *ep);
1130int xhci_drop_endpoint(struct usb_hcd *hcd, struct usb_device *udev, struct usb_host_endpoint *ep); 1188int xhci_drop_endpoint(struct usb_hcd *hcd, struct usb_device *udev, struct usb_host_endpoint *ep);
1189void xhci_endpoint_reset(struct usb_hcd *hcd, struct usb_host_endpoint *ep);
1131int xhci_check_bandwidth(struct usb_hcd *hcd, struct usb_device *udev); 1190int xhci_check_bandwidth(struct usb_hcd *hcd, struct usb_device *udev);
1132void xhci_reset_bandwidth(struct usb_hcd *hcd, struct usb_device *udev); 1191void xhci_reset_bandwidth(struct usb_hcd *hcd, struct usb_device *udev);
1133 1192
@@ -1148,10 +1207,23 @@ int xhci_queue_bulk_tx(struct xhci_hcd *xhci, gfp_t mem_flags, struct urb *urb,
1148 int slot_id, unsigned int ep_index); 1207 int slot_id, unsigned int ep_index);
1149int xhci_queue_configure_endpoint(struct xhci_hcd *xhci, dma_addr_t in_ctx_ptr, 1208int xhci_queue_configure_endpoint(struct xhci_hcd *xhci, dma_addr_t in_ctx_ptr,
1150 u32 slot_id); 1209 u32 slot_id);
1210int xhci_queue_reset_ep(struct xhci_hcd *xhci, int slot_id,
1211 unsigned int ep_index);
1212void xhci_find_new_dequeue_state(struct xhci_hcd *xhci,
1213 unsigned int slot_id, unsigned int ep_index,
1214 struct xhci_td *cur_td, struct xhci_dequeue_state *state);
1215void xhci_queue_new_dequeue_state(struct xhci_hcd *xhci,
1216 struct xhci_ring *ep_ring, unsigned int slot_id,
1217 unsigned int ep_index, struct xhci_dequeue_state *deq_state);
1151 1218
1152/* xHCI roothub code */ 1219/* xHCI roothub code */
1153int xhci_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue, u16 wIndex, 1220int xhci_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue, u16 wIndex,
1154 char *buf, u16 wLength); 1221 char *buf, u16 wLength);
1155int xhci_hub_status_data(struct usb_hcd *hcd, char *buf); 1222int xhci_hub_status_data(struct usb_hcd *hcd, char *buf);
1156 1223
1224/* xHCI contexts */
1225struct xhci_input_control_ctx *xhci_get_input_control_ctx(struct xhci_hcd *xhci, struct xhci_container_ctx *ctx);
1226struct xhci_slot_ctx *xhci_get_slot_ctx(struct xhci_hcd *xhci, struct xhci_container_ctx *ctx);
1227struct xhci_ep_ctx *xhci_get_ep_ctx(struct xhci_hcd *xhci, struct xhci_container_ctx *ctx, unsigned int ep_index);
1228
1157#endif /* __LINUX_XHCI_HCD_H */ 1229#endif /* __LINUX_XHCI_HCD_H */
diff --git a/drivers/usb/misc/Kconfig b/drivers/usb/misc/Kconfig
index a68d91a11bee..abe3aa67ed00 100644
--- a/drivers/usb/misc/Kconfig
+++ b/drivers/usb/misc/Kconfig
@@ -220,7 +220,7 @@ config USB_IOWARRIOR
220 220
221config USB_TEST 221config USB_TEST
222 tristate "USB testing driver" 222 tristate "USB testing driver"
223 depends on USB && USB_DEVICEFS 223 depends on USB
224 help 224 help
225 This driver is for testing host controller software. It is used 225 This driver is for testing host controller software. It is used
226 with specialized device firmware for regression and stress testing, 226 with specialized device firmware for regression and stress testing,
diff --git a/drivers/usb/misc/iowarrior.c b/drivers/usb/misc/iowarrior.c
index 3c5fe5cee05a..90e1a8dedfa9 100644
--- a/drivers/usb/misc/iowarrior.c
+++ b/drivers/usb/misc/iowarrior.c
@@ -18,6 +18,7 @@
18#include <linux/init.h> 18#include <linux/init.h>
19#include <linux/slab.h> 19#include <linux/slab.h>
20#include <linux/sched.h> 20#include <linux/sched.h>
21#include <linux/smp_lock.h>
21#include <linux/poll.h> 22#include <linux/poll.h>
22#include <linux/usb/iowarrior.h> 23#include <linux/usb/iowarrior.h>
23 24
diff --git a/drivers/usb/misc/rio500.c b/drivers/usb/misc/rio500.c
index deb95bb49fd1..d645f3899fe1 100644
--- a/drivers/usb/misc/rio500.c
+++ b/drivers/usb/misc/rio500.c
@@ -32,6 +32,7 @@
32#include <linux/kernel.h> 32#include <linux/kernel.h>
33#include <linux/signal.h> 33#include <linux/signal.h>
34#include <linux/sched.h> 34#include <linux/sched.h>
35#include <linux/smp_lock.h>
35#include <linux/errno.h> 36#include <linux/errno.h>
36#include <linux/random.h> 37#include <linux/random.h>
37#include <linux/poll.h> 38#include <linux/poll.h>
diff --git a/drivers/usb/misc/usblcd.c b/drivers/usb/misc/usblcd.c
index e0ff9ccd866b..29092b8e59ce 100644
--- a/drivers/usb/misc/usblcd.c
+++ b/drivers/usb/misc/usblcd.c
@@ -16,6 +16,7 @@
16#include <linux/kernel.h> 16#include <linux/kernel.h>
17#include <linux/init.h> 17#include <linux/init.h>
18#include <linux/slab.h> 18#include <linux/slab.h>
19#include <linux/smp_lock.h>
19#include <linux/errno.h> 20#include <linux/errno.h>
20#include <linux/mutex.h> 21#include <linux/mutex.h>
21#include <asm/uaccess.h> 22#include <asm/uaccess.h>
diff --git a/drivers/usb/mon/mon_bin.c b/drivers/usb/mon/mon_bin.c
index f8d9045d668a..0f7a30b7d2d1 100644
--- a/drivers/usb/mon/mon_bin.c
+++ b/drivers/usb/mon/mon_bin.c
@@ -1261,7 +1261,7 @@ static int mon_alloc_buff(struct mon_pgmap *map, int npages)
1261 return -ENOMEM; 1261 return -ENOMEM;
1262 } 1262 }
1263 map[n].ptr = (unsigned char *) vaddr; 1263 map[n].ptr = (unsigned char *) vaddr;
1264 map[n].pg = virt_to_page(vaddr); 1264 map[n].pg = virt_to_page((void *) vaddr);
1265 } 1265 }
1266 return 0; 1266 return 0;
1267} 1267}
diff --git a/drivers/usb/musb/Kconfig b/drivers/usb/musb/Kconfig
index 70073b157f0a..803adcb5ac1d 100644
--- a/drivers/usb/musb/Kconfig
+++ b/drivers/usb/musb/Kconfig
@@ -12,6 +12,7 @@ config USB_MUSB_HDRC
12 depends on !SUPERH 12 depends on !SUPERH
13 select NOP_USB_XCEIV if ARCH_DAVINCI 13 select NOP_USB_XCEIV if ARCH_DAVINCI
14 select TWL4030_USB if MACH_OMAP_3430SDP 14 select TWL4030_USB if MACH_OMAP_3430SDP
15 select NOP_USB_XCEIV if MACH_OMAP3EVM
15 select USB_OTG_UTILS 16 select USB_OTG_UTILS
16 tristate 'Inventra Highspeed Dual Role Controller (TI, ADI, ...)' 17 tristate 'Inventra Highspeed Dual Role Controller (TI, ADI, ...)'
17 help 18 help
diff --git a/drivers/usb/musb/cppi_dma.h b/drivers/usb/musb/cppi_dma.h
index 8a39de3e6e47..59bf949e589b 100644
--- a/drivers/usb/musb/cppi_dma.h
+++ b/drivers/usb/musb/cppi_dma.h
@@ -5,7 +5,6 @@
5 5
6#include <linux/slab.h> 6#include <linux/slab.h>
7#include <linux/list.h> 7#include <linux/list.h>
8#include <linux/smp_lock.h>
9#include <linux/errno.h> 8#include <linux/errno.h>
10#include <linux/dmapool.h> 9#include <linux/dmapool.h>
11 10
diff --git a/drivers/usb/musb/davinci.c b/drivers/usb/musb/davinci.c
index 180d7daa4099..e16ff605c458 100644
--- a/drivers/usb/musb/davinci.c
+++ b/drivers/usb/musb/davinci.c
@@ -35,13 +35,14 @@
35#include <mach/hardware.h> 35#include <mach/hardware.h>
36#include <mach/memory.h> 36#include <mach/memory.h>
37#include <mach/gpio.h> 37#include <mach/gpio.h>
38#include <mach/cputype.h>
38 39
39#include <asm/mach-types.h> 40#include <asm/mach-types.h>
40 41
41#include "musb_core.h" 42#include "musb_core.h"
42 43
43#ifdef CONFIG_MACH_DAVINCI_EVM 44#ifdef CONFIG_MACH_DAVINCI_EVM
44#define GPIO_nVBUS_DRV 87 45#define GPIO_nVBUS_DRV 144
45#endif 46#endif
46 47
47#include "davinci.h" 48#include "davinci.h"
@@ -329,7 +330,6 @@ static irqreturn_t davinci_interrupt(int irq, void *__hci)
329 mod_timer(&otg_workaround, jiffies + POLL_SECONDS * HZ); 330 mod_timer(&otg_workaround, jiffies + POLL_SECONDS * HZ);
330 WARNING("VBUS error workaround (delay coming)\n"); 331 WARNING("VBUS error workaround (delay coming)\n");
331 } else if (is_host_enabled(musb) && drvvbus) { 332 } else if (is_host_enabled(musb) && drvvbus) {
332 musb->is_active = 1;
333 MUSB_HST_MODE(musb); 333 MUSB_HST_MODE(musb);
334 musb->xceiv->default_a = 1; 334 musb->xceiv->default_a = 1;
335 musb->xceiv->state = OTG_STATE_A_WAIT_VRISE; 335 musb->xceiv->state = OTG_STATE_A_WAIT_VRISE;
@@ -343,7 +343,9 @@ static irqreturn_t davinci_interrupt(int irq, void *__hci)
343 portstate(musb->port1_status &= ~USB_PORT_STAT_POWER); 343 portstate(musb->port1_status &= ~USB_PORT_STAT_POWER);
344 } 344 }
345 345
346 /* NOTE: this must complete poweron within 100 msec */ 346 /* NOTE: this must complete poweron within 100 msec
347 * (OTG_TIME_A_WAIT_VRISE) but we don't check for that.
348 */
347 davinci_source_power(musb, drvvbus, 0); 349 davinci_source_power(musb, drvvbus, 0);
348 DBG(2, "VBUS %s (%s)%s, devctl %02x\n", 350 DBG(2, "VBUS %s (%s)%s, devctl %02x\n",
349 drvvbus ? "on" : "off", 351 drvvbus ? "on" : "off",
@@ -411,6 +413,21 @@ int __init musb_platform_init(struct musb *musb)
411 __raw_writel(phy_ctrl, USB_PHY_CTRL); 413 __raw_writel(phy_ctrl, USB_PHY_CTRL);
412 } 414 }
413 415
416 /* On dm355, the default-A state machine needs DRVVBUS control.
417 * If we won't be a host, there's no need to turn it on.
418 */
419 if (cpu_is_davinci_dm355()) {
420 u32 deepsleep = __raw_readl(DM355_DEEPSLEEP);
421
422 if (is_host_enabled(musb)) {
423 deepsleep &= ~DRVVBUS_OVERRIDE;
424 } else {
425 deepsleep &= ~DRVVBUS_FORCE;
426 deepsleep |= DRVVBUS_OVERRIDE;
427 }
428 __raw_writel(deepsleep, DM355_DEEPSLEEP);
429 }
430
414 /* reset the controller */ 431 /* reset the controller */
415 musb_writel(tibase, DAVINCI_USB_CTRL_REG, 0x1); 432 musb_writel(tibase, DAVINCI_USB_CTRL_REG, 0x1);
416 433
@@ -437,6 +454,15 @@ int musb_platform_exit(struct musb *musb)
437 if (is_host_enabled(musb)) 454 if (is_host_enabled(musb))
438 del_timer_sync(&otg_workaround); 455 del_timer_sync(&otg_workaround);
439 456
457 /* force VBUS off */
458 if (cpu_is_davinci_dm355()) {
459 u32 deepsleep = __raw_readl(DM355_DEEPSLEEP);
460
461 deepsleep &= ~DRVVBUS_FORCE;
462 deepsleep |= DRVVBUS_OVERRIDE;
463 __raw_writel(deepsleep, DM355_DEEPSLEEP);
464 }
465
440 davinci_source_power(musb, 0 /*off*/, 1); 466 davinci_source_power(musb, 0 /*off*/, 1);
441 467
442 /* delay, to avoid problems with module reload */ 468 /* delay, to avoid problems with module reload */
diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c
index 554a414f65d1..c7c1ca0494cd 100644
--- a/drivers/usb/musb/musb_core.c
+++ b/drivers/usb/musb/musb_core.c
@@ -1326,7 +1326,6 @@ static int __init musb_core_init(u16 musb_type, struct musb *musb)
1326 int i; 1326 int i;
1327 1327
1328 /* log core options (read using indexed model) */ 1328 /* log core options (read using indexed model) */
1329 musb_ep_select(mbase, 0);
1330 reg = musb_read_configdata(mbase); 1329 reg = musb_read_configdata(mbase);
1331 1330
1332 strcpy(aInfo, (reg & MUSB_CONFIGDATA_UTMIDW) ? "UTMI-16" : "UTMI-8"); 1331 strcpy(aInfo, (reg & MUSB_CONFIGDATA_UTMIDW) ? "UTMI-16" : "UTMI-8");
@@ -1990,7 +1989,7 @@ bad_config:
1990 if (status < 0) 1989 if (status < 0)
1991 goto fail2; 1990 goto fail2;
1992 1991
1993#ifdef CONFIG_USB_OTG 1992#ifdef CONFIG_USB_MUSB_OTG
1994 setup_timer(&musb->otg_timer, musb_otg_timer_func, (unsigned long) musb); 1993 setup_timer(&musb->otg_timer, musb_otg_timer_func, (unsigned long) musb);
1995#endif 1994#endif
1996 1995
diff --git a/drivers/usb/musb/musb_core.h b/drivers/usb/musb/musb_core.h
index f3772ca3b2cf..381d648a36b8 100644
--- a/drivers/usb/musb/musb_core.h
+++ b/drivers/usb/musb/musb_core.h
@@ -38,7 +38,6 @@
38#include <linux/slab.h> 38#include <linux/slab.h>
39#include <linux/list.h> 39#include <linux/list.h>
40#include <linux/interrupt.h> 40#include <linux/interrupt.h>
41#include <linux/smp_lock.h>
42#include <linux/errno.h> 41#include <linux/errno.h>
43#include <linux/timer.h> 42#include <linux/timer.h>
44#include <linux/clk.h> 43#include <linux/clk.h>
diff --git a/drivers/usb/musb/musb_gadget_ep0.c b/drivers/usb/musb/musb_gadget_ep0.c
index 40ed50ecedff..7a6778675ad3 100644
--- a/drivers/usb/musb/musb_gadget_ep0.c
+++ b/drivers/usb/musb/musb_gadget_ep0.c
@@ -407,7 +407,7 @@ stall:
407 csr |= MUSB_RXCSR_P_SENDSTALL 407 csr |= MUSB_RXCSR_P_SENDSTALL
408 | MUSB_RXCSR_FLUSHFIFO 408 | MUSB_RXCSR_FLUSHFIFO
409 | MUSB_RXCSR_CLRDATATOG 409 | MUSB_RXCSR_CLRDATATOG
410 | MUSB_TXCSR_P_WZC_BITS; 410 | MUSB_RXCSR_P_WZC_BITS;
411 musb_writew(regs, MUSB_RXCSR, 411 musb_writew(regs, MUSB_RXCSR,
412 csr); 412 csr);
413 } 413 }
diff --git a/drivers/usb/musb/musb_host.c b/drivers/usb/musb/musb_host.c
index 94a2a350a414..cf94511485f2 100644
--- a/drivers/usb/musb/musb_host.c
+++ b/drivers/usb/musb/musb_host.c
@@ -373,7 +373,7 @@ static void musb_advance_schedule(struct musb *musb, struct urb *urb,
373 musb_save_toggle(qh, is_in, urb); 373 musb_save_toggle(qh, is_in, urb);
374 break; 374 break;
375 case USB_ENDPOINT_XFER_ISOC: 375 case USB_ENDPOINT_XFER_ISOC:
376 if (urb->error_count) 376 if (status == 0 && urb->error_count)
377 status = -EXDEV; 377 status = -EXDEV;
378 break; 378 break;
379 } 379 }
@@ -2235,13 +2235,30 @@ static void musb_h_stop(struct usb_hcd *hcd)
2235static int musb_bus_suspend(struct usb_hcd *hcd) 2235static int musb_bus_suspend(struct usb_hcd *hcd)
2236{ 2236{
2237 struct musb *musb = hcd_to_musb(hcd); 2237 struct musb *musb = hcd_to_musb(hcd);
2238 u8 devctl;
2238 2239
2239 if (musb->xceiv->state == OTG_STATE_A_SUSPEND) 2240 if (!is_host_active(musb))
2240 return 0; 2241 return 0;
2241 2242
2242 if (is_host_active(musb) && musb->is_active) { 2243 switch (musb->xceiv->state) {
2243 WARNING("trying to suspend as %s is_active=%i\n", 2244 case OTG_STATE_A_SUSPEND:
2244 otg_state_string(musb), musb->is_active); 2245 return 0;
2246 case OTG_STATE_A_WAIT_VRISE:
2247 /* ID could be grounded even if there's no device
2248 * on the other end of the cable. NOTE that the
2249 * A_WAIT_VRISE timers are messy with MUSB...
2250 */
2251 devctl = musb_readb(musb->mregs, MUSB_DEVCTL);
2252 if ((devctl & MUSB_DEVCTL_VBUS) == MUSB_DEVCTL_VBUS)
2253 musb->xceiv->state = OTG_STATE_A_WAIT_BCON;
2254 break;
2255 default:
2256 break;
2257 }
2258
2259 if (musb->is_active) {
2260 WARNING("trying to suspend as %s while active\n",
2261 otg_state_string(musb));
2245 return -EBUSY; 2262 return -EBUSY;
2246 } else 2263 } else
2247 return 0; 2264 return 0;
diff --git a/drivers/usb/musb/musb_regs.h b/drivers/usb/musb/musb_regs.h
index de3b2f18db44..fbfd3fd9ce1f 100644
--- a/drivers/usb/musb/musb_regs.h
+++ b/drivers/usb/musb/musb_regs.h
@@ -323,6 +323,7 @@ static inline void musb_write_rxfifoadd(void __iomem *mbase, u16 c_off)
323 323
324static inline u8 musb_read_configdata(void __iomem *mbase) 324static inline u8 musb_read_configdata(void __iomem *mbase)
325{ 325{
326 musb_writeb(mbase, MUSB_INDEX, 0);
326 return musb_readb(mbase, 0x10 + MUSB_CONFIGDATA); 327 return musb_readb(mbase, 0x10 + MUSB_CONFIGDATA);
327} 328}
328 329
diff --git a/drivers/usb/otg/Kconfig b/drivers/usb/otg/Kconfig
index 69feeec1628c..aa884d072f0b 100644
--- a/drivers/usb/otg/Kconfig
+++ b/drivers/usb/otg/Kconfig
@@ -59,18 +59,4 @@ config NOP_USB_XCEIV
59 built-in with usb ip or which are autonomous and doesn't require any 59 built-in with usb ip or which are autonomous and doesn't require any
60 phy programming such as ISP1x04 etc. 60 phy programming such as ISP1x04 etc.
61 61
62config USB_LANGWELL_OTG
63 tristate "Intel Langwell USB OTG dual-role support"
64 depends on USB && MRST
65 select USB_OTG
66 select USB_OTG_UTILS
67 help
68 Say Y here if you want to build Intel Langwell USB OTG
69 transciever driver in kernel. This driver implements role
70 switch between EHCI host driver and Langwell USB OTG
71 client driver.
72
73 To compile this driver as a module, choose M here: the
74 module will be called langwell_otg.
75
76endif # USB || OTG 62endif # USB || OTG
diff --git a/drivers/usb/otg/Makefile b/drivers/usb/otg/Makefile
index 6d1abdd3c0ac..208167856529 100644
--- a/drivers/usb/otg/Makefile
+++ b/drivers/usb/otg/Makefile
@@ -9,7 +9,6 @@ obj-$(CONFIG_USB_OTG_UTILS) += otg.o
9obj-$(CONFIG_USB_GPIO_VBUS) += gpio_vbus.o 9obj-$(CONFIG_USB_GPIO_VBUS) += gpio_vbus.o
10obj-$(CONFIG_ISP1301_OMAP) += isp1301_omap.o 10obj-$(CONFIG_ISP1301_OMAP) += isp1301_omap.o
11obj-$(CONFIG_TWL4030_USB) += twl4030-usb.o 11obj-$(CONFIG_TWL4030_USB) += twl4030-usb.o
12obj-$(CONFIG_USB_LANGWELL_OTG) += langwell_otg.o
13obj-$(CONFIG_NOP_USB_XCEIV) += nop-usb-xceiv.o 12obj-$(CONFIG_NOP_USB_XCEIV) += nop-usb-xceiv.o
14 13
15ccflags-$(CONFIG_USB_DEBUG) += -DDEBUG 14ccflags-$(CONFIG_USB_DEBUG) += -DDEBUG
diff --git a/drivers/usb/otg/langwell_otg.c b/drivers/usb/otg/langwell_otg.c
deleted file mode 100644
index 6f628d0e9f39..000000000000
--- a/drivers/usb/otg/langwell_otg.c
+++ /dev/null
@@ -1,1915 +0,0 @@
1/*
2 * Intel Langwell USB OTG transceiver driver
3 * Copyright (C) 2008 - 2009, Intel Corporation.
4 *
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms and conditions of the GNU General Public License,
7 * version 2, as 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 for
12 * more details.
13 *
14 * You should have received a copy of the GNU General Public License along with
15 * this program; if not, write to the Free Software Foundation, Inc.,
16 * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
17 *
18 */
19/* This driver helps to switch Langwell OTG controller function between host
20 * and peripheral. It works with EHCI driver and Langwell client controller
21 * driver together.
22 */
23#include <linux/module.h>
24#include <linux/init.h>
25#include <linux/pci.h>
26#include <linux/errno.h>
27#include <linux/interrupt.h>
28#include <linux/kernel.h>
29#include <linux/device.h>
30#include <linux/moduleparam.h>
31#include <linux/usb/ch9.h>
32#include <linux/usb/gadget.h>
33#include <linux/usb.h>
34#include <linux/usb/otg.h>
35#include <linux/notifier.h>
36#include <asm/ipc_defs.h>
37#include <linux/delay.h>
38#include "../core/hcd.h"
39
40#include <linux/usb/langwell_otg.h>
41
42#define DRIVER_DESC "Intel Langwell USB OTG transceiver driver"
43#define DRIVER_VERSION "3.0.0.32L.0002"
44
45MODULE_DESCRIPTION(DRIVER_DESC);
46MODULE_AUTHOR("Henry Yuan <hang.yuan@intel.com>, Hao Wu <hao.wu@intel.com>");
47MODULE_VERSION(DRIVER_VERSION);
48MODULE_LICENSE("GPL");
49
50static const char driver_name[] = "langwell_otg";
51
52static int langwell_otg_probe(struct pci_dev *pdev,
53 const struct pci_device_id *id);
54static void langwell_otg_remove(struct pci_dev *pdev);
55static int langwell_otg_suspend(struct pci_dev *pdev, pm_message_t message);
56static int langwell_otg_resume(struct pci_dev *pdev);
57
58static int langwell_otg_set_host(struct otg_transceiver *otg,
59 struct usb_bus *host);
60static int langwell_otg_set_peripheral(struct otg_transceiver *otg,
61 struct usb_gadget *gadget);
62static int langwell_otg_start_srp(struct otg_transceiver *otg);
63
64static const struct pci_device_id pci_ids[] = {{
65 .class = ((PCI_CLASS_SERIAL_USB << 8) | 0xfe),
66 .class_mask = ~0,
67 .vendor = 0x8086,
68 .device = 0x0811,
69 .subvendor = PCI_ANY_ID,
70 .subdevice = PCI_ANY_ID,
71}, { /* end: all zeroes */ }
72};
73
74static struct pci_driver otg_pci_driver = {
75 .name = (char *) driver_name,
76 .id_table = pci_ids,
77
78 .probe = langwell_otg_probe,
79 .remove = langwell_otg_remove,
80
81 .suspend = langwell_otg_suspend,
82 .resume = langwell_otg_resume,
83};
84
85static const char *state_string(enum usb_otg_state state)
86{
87 switch (state) {
88 case OTG_STATE_A_IDLE:
89 return "a_idle";
90 case OTG_STATE_A_WAIT_VRISE:
91 return "a_wait_vrise";
92 case OTG_STATE_A_WAIT_BCON:
93 return "a_wait_bcon";
94 case OTG_STATE_A_HOST:
95 return "a_host";
96 case OTG_STATE_A_SUSPEND:
97 return "a_suspend";
98 case OTG_STATE_A_PERIPHERAL:
99 return "a_peripheral";
100 case OTG_STATE_A_WAIT_VFALL:
101 return "a_wait_vfall";
102 case OTG_STATE_A_VBUS_ERR:
103 return "a_vbus_err";
104 case OTG_STATE_B_IDLE:
105 return "b_idle";
106 case OTG_STATE_B_SRP_INIT:
107 return "b_srp_init";
108 case OTG_STATE_B_PERIPHERAL:
109 return "b_peripheral";
110 case OTG_STATE_B_WAIT_ACON:
111 return "b_wait_acon";
112 case OTG_STATE_B_HOST:
113 return "b_host";
114 default:
115 return "UNDEFINED";
116 }
117}
118
119/* HSM timers */
120static inline struct langwell_otg_timer *otg_timer_initializer
121(void (*function)(unsigned long), unsigned long expires, unsigned long data)
122{
123 struct langwell_otg_timer *timer;
124 timer = kmalloc(sizeof(struct langwell_otg_timer), GFP_KERNEL);
125 timer->function = function;
126 timer->expires = expires;
127 timer->data = data;
128 return timer;
129}
130
131static struct langwell_otg_timer *a_wait_vrise_tmr, *a_wait_bcon_tmr,
132 *a_aidl_bdis_tmr, *b_ase0_brst_tmr, *b_se0_srp_tmr, *b_srp_res_tmr,
133 *b_bus_suspend_tmr;
134
135static struct list_head active_timers;
136
137static struct langwell_otg *the_transceiver;
138
139/* host/client notify transceiver when event affects HNP state */
140void langwell_update_transceiver()
141{
142 otg_dbg("transceiver driver is notified\n");
143 queue_work(the_transceiver->qwork, &the_transceiver->work);
144}
145EXPORT_SYMBOL(langwell_update_transceiver);
146
147static int langwell_otg_set_host(struct otg_transceiver *otg,
148 struct usb_bus *host)
149{
150 otg->host = host;
151
152 return 0;
153}
154
155static int langwell_otg_set_peripheral(struct otg_transceiver *otg,
156 struct usb_gadget *gadget)
157{
158 otg->gadget = gadget;
159
160 return 0;
161}
162
163static int langwell_otg_set_power(struct otg_transceiver *otg,
164 unsigned mA)
165{
166 return 0;
167}
168
169/* A-device drives vbus, controlled through PMIC CHRGCNTL register*/
170static void langwell_otg_drv_vbus(int on)
171{
172 struct ipc_pmic_reg_data pmic_data = {0};
173 struct ipc_pmic_reg_data battery_data;
174
175 /* Check if battery is attached or not */
176 battery_data.pmic_reg_data[0].register_address = 0xd2;
177 battery_data.ioc = 0;
178 battery_data.num_entries = 1;
179 if (ipc_pmic_register_read(&battery_data)) {
180 otg_dbg("Failed to read PMIC register 0xd2.\n");
181 return;
182 }
183
184 if ((battery_data.pmic_reg_data[0].value & 0x20) == 0) {
185 otg_dbg("no battery attached\n");
186 return;
187 }
188
189 /* Workaround for battery attachment issue */
190 if (battery_data.pmic_reg_data[0].value == 0x34) {
191 otg_dbg("battery \n");
192 return;
193 }
194
195 otg_dbg("battery attached\n");
196
197 pmic_data.ioc = 0;
198 pmic_data.pmic_reg_data[0].register_address = 0xD4;
199 pmic_data.num_entries = 1;
200 if (on)
201 pmic_data.pmic_reg_data[0].value = 0x20;
202 else
203 pmic_data.pmic_reg_data[0].value = 0xc0;
204
205 if (ipc_pmic_register_write(&pmic_data, TRUE))
206 otg_dbg("Failed to write PMIC.\n");
207
208}
209
210/* charge vbus or discharge vbus through a resistor to ground */
211static void langwell_otg_chrg_vbus(int on)
212{
213
214 u32 val;
215
216 val = readl(the_transceiver->regs + CI_OTGSC);
217
218 if (on)
219 writel((val & ~OTGSC_INTSTS_MASK) | OTGSC_VC,
220 the_transceiver->regs + CI_OTGSC);
221 else
222 writel((val & ~OTGSC_INTSTS_MASK) | OTGSC_VD,
223 the_transceiver->regs + CI_OTGSC);
224
225}
226
227/* Start SRP */
228static int langwell_otg_start_srp(struct otg_transceiver *otg)
229{
230 u32 val;
231
232 otg_dbg("Start SRP ->\n");
233
234 val = readl(the_transceiver->regs + CI_OTGSC);
235
236 writel((val & ~OTGSC_INTSTS_MASK) | OTGSC_HADP,
237 the_transceiver->regs + CI_OTGSC);
238
239 /* Check if the data plus is finished or not */
240 msleep(8);
241 val = readl(the_transceiver->regs + CI_OTGSC);
242 if (val & (OTGSC_HADP | OTGSC_DP))
243 otg_dbg("DataLine SRP Error\n");
244
245 /* FIXME: VBus SRP */
246
247 return 0;
248}
249
250
251/* stop SOF via bus_suspend */
252static void langwell_otg_loc_sof(int on)
253{
254 struct usb_hcd *hcd;
255 int err;
256
257 otg_dbg("loc_sof -> %d\n", on);
258
259 hcd = bus_to_hcd(the_transceiver->otg.host);
260 if (on)
261 err = hcd->driver->bus_resume(hcd);
262 else
263 err = hcd->driver->bus_suspend(hcd);
264
265 if (err)
266 otg_dbg("Failed to resume/suspend bus - %d\n", err);
267}
268
269static void langwell_otg_phy_low_power(int on)
270{
271 u32 val;
272
273 otg_dbg("phy low power mode-> %d\n", on);
274
275 val = readl(the_transceiver->regs + CI_HOSTPC1);
276 if (on)
277 writel(val | HOSTPC1_PHCD, the_transceiver->regs + CI_HOSTPC1);
278 else
279 writel(val & ~HOSTPC1_PHCD, the_transceiver->regs + CI_HOSTPC1);
280}
281
282/* Enable/Disable OTG interrupt */
283static void langwell_otg_intr(int on)
284{
285 u32 val;
286
287 otg_dbg("interrupt -> %d\n", on);
288
289 val = readl(the_transceiver->regs + CI_OTGSC);
290 if (on) {
291 val = val | (OTGSC_INTEN_MASK | OTGSC_IDPU);
292 writel(val, the_transceiver->regs + CI_OTGSC);
293 } else {
294 val = val & ~(OTGSC_INTEN_MASK | OTGSC_IDPU);
295 writel(val, the_transceiver->regs + CI_OTGSC);
296 }
297}
298
299/* set HAAR: Hardware Assist Auto-Reset */
300static void langwell_otg_HAAR(int on)
301{
302 u32 val;
303
304 otg_dbg("HAAR -> %d\n", on);
305
306 val = readl(the_transceiver->regs + CI_OTGSC);
307 if (on)
308 writel((val & ~OTGSC_INTSTS_MASK) | OTGSC_HAAR,
309 the_transceiver->regs + CI_OTGSC);
310 else
311 writel((val & ~OTGSC_INTSTS_MASK) & ~OTGSC_HAAR,
312 the_transceiver->regs + CI_OTGSC);
313}
314
315/* set HABA: Hardware Assist B-Disconnect to A-Connect */
316static void langwell_otg_HABA(int on)
317{
318 u32 val;
319
320 otg_dbg("HABA -> %d\n", on);
321
322 val = readl(the_transceiver->regs + CI_OTGSC);
323 if (on)
324 writel((val & ~OTGSC_INTSTS_MASK) | OTGSC_HABA,
325 the_transceiver->regs + CI_OTGSC);
326 else
327 writel((val & ~OTGSC_INTSTS_MASK) & ~OTGSC_HABA,
328 the_transceiver->regs + CI_OTGSC);
329}
330
331static int langwell_otg_check_se0_srp(int on)
332{
333 u32 val;
334
335 int delay_time = TB_SE0_SRP * 10; /* step is 100us */
336
337 otg_dbg("check_se0_srp -> \n");
338
339 do {
340 udelay(100);
341 if (!delay_time--)
342 break;
343 val = readl(the_transceiver->regs + CI_PORTSC1);
344 val &= PORTSC_LS;
345 } while (!val);
346
347 otg_dbg("check_se0_srp <- \n");
348 return val;
349}
350
351/* The timeout callback function to set time out bit */
352static void set_tmout(unsigned long indicator)
353{
354 *(int *)indicator = 1;
355}
356
357void langwell_otg_nsf_msg(unsigned long indicator)
358{
359 switch (indicator) {
360 case 2:
361 case 4:
362 case 6:
363 case 7:
364 printk(KERN_ERR "OTG:NSF-%lu - deivce not responding\n",
365 indicator);
366 break;
367 case 3:
368 printk(KERN_ERR "OTG:NSF-%lu - deivce not supported\n",
369 indicator);
370 break;
371 default:
372 printk(KERN_ERR "Do not have this kind of NSF\n");
373 break;
374 }
375}
376
377/* Initialize timers */
378static void langwell_otg_init_timers(struct otg_hsm *hsm)
379{
380 /* HSM used timers */
381 a_wait_vrise_tmr = otg_timer_initializer(&set_tmout, TA_WAIT_VRISE,
382 (unsigned long)&hsm->a_wait_vrise_tmout);
383 a_wait_bcon_tmr = otg_timer_initializer(&set_tmout, TA_WAIT_BCON,
384 (unsigned long)&hsm->a_wait_bcon_tmout);
385 a_aidl_bdis_tmr = otg_timer_initializer(&set_tmout, TA_AIDL_BDIS,
386 (unsigned long)&hsm->a_aidl_bdis_tmout);
387 b_ase0_brst_tmr = otg_timer_initializer(&set_tmout, TB_ASE0_BRST,
388 (unsigned long)&hsm->b_ase0_brst_tmout);
389 b_se0_srp_tmr = otg_timer_initializer(&set_tmout, TB_SE0_SRP,
390 (unsigned long)&hsm->b_se0_srp);
391 b_srp_res_tmr = otg_timer_initializer(&set_tmout, TB_SRP_RES,
392 (unsigned long)&hsm->b_srp_res_tmout);
393 b_bus_suspend_tmr = otg_timer_initializer(&set_tmout, TB_BUS_SUSPEND,
394 (unsigned long)&hsm->b_bus_suspend_tmout);
395}
396
397/* Free timers */
398static void langwell_otg_free_timers(void)
399{
400 kfree(a_wait_vrise_tmr);
401 kfree(a_wait_bcon_tmr);
402 kfree(a_aidl_bdis_tmr);
403 kfree(b_ase0_brst_tmr);
404 kfree(b_se0_srp_tmr);
405 kfree(b_srp_res_tmr);
406 kfree(b_bus_suspend_tmr);
407}
408
409/* Add timer to timer list */
410static void langwell_otg_add_timer(void *gtimer)
411{
412 struct langwell_otg_timer *timer = (struct langwell_otg_timer *)gtimer;
413 struct langwell_otg_timer *tmp_timer;
414 u32 val32;
415
416 /* Check if the timer is already in the active list,
417 * if so update timer count
418 */
419 list_for_each_entry(tmp_timer, &active_timers, list)
420 if (tmp_timer == timer) {
421 timer->count = timer->expires;
422 return;
423 }
424 timer->count = timer->expires;
425
426 if (list_empty(&active_timers)) {
427 val32 = readl(the_transceiver->regs + CI_OTGSC);
428 writel(val32 | OTGSC_1MSE, the_transceiver->regs + CI_OTGSC);
429 }
430
431 list_add_tail(&timer->list, &active_timers);
432}
433
434/* Remove timer from the timer list; clear timeout status */
435static void langwell_otg_del_timer(void *gtimer)
436{
437 struct langwell_otg_timer *timer = (struct langwell_otg_timer *)gtimer;
438 struct langwell_otg_timer *tmp_timer, *del_tmp;
439 u32 val32;
440
441 list_for_each_entry_safe(tmp_timer, del_tmp, &active_timers, list)
442 if (tmp_timer == timer)
443 list_del(&timer->list);
444
445 if (list_empty(&active_timers)) {
446 val32 = readl(the_transceiver->regs + CI_OTGSC);
447 writel(val32 & ~OTGSC_1MSE, the_transceiver->regs + CI_OTGSC);
448 }
449}
450
451/* Reduce timer count by 1, and find timeout conditions.*/
452static int langwell_otg_tick_timer(u32 *int_sts)
453{
454 struct langwell_otg_timer *tmp_timer, *del_tmp;
455 int expired = 0;
456
457 list_for_each_entry_safe(tmp_timer, del_tmp, &active_timers, list) {
458 tmp_timer->count--;
459 /* check if timer expires */
460 if (!tmp_timer->count) {
461 list_del(&tmp_timer->list);
462 tmp_timer->function(tmp_timer->data);
463 expired = 1;
464 }
465 }
466
467 if (list_empty(&active_timers)) {
468 otg_dbg("tick timer: disable 1ms int\n");
469 *int_sts = *int_sts & ~OTGSC_1MSE;
470 }
471 return expired;
472}
473
474static void reset_otg(void)
475{
476 u32 val;
477 int delay_time = 1000;
478
479 otg_dbg("reseting OTG controller ...\n");
480 val = readl(the_transceiver->regs + CI_USBCMD);
481 writel(val | USBCMD_RST, the_transceiver->regs + CI_USBCMD);
482 do {
483 udelay(100);
484 if (!delay_time--)
485 otg_dbg("reset timeout\n");
486 val = readl(the_transceiver->regs + CI_USBCMD);
487 val &= USBCMD_RST;
488 } while (val != 0);
489 otg_dbg("reset done.\n");
490}
491
492static void set_host_mode(void)
493{
494 u32 val;
495
496 reset_otg();
497 val = readl(the_transceiver->regs + CI_USBMODE);
498 val = (val & (~USBMODE_CM)) | USBMODE_HOST;
499 writel(val, the_transceiver->regs + CI_USBMODE);
500}
501
502static void set_client_mode(void)
503{
504 u32 val;
505
506 reset_otg();
507 val = readl(the_transceiver->regs + CI_USBMODE);
508 val = (val & (~USBMODE_CM)) | USBMODE_DEVICE;
509 writel(val, the_transceiver->regs + CI_USBMODE);
510}
511
512static void init_hsm(void)
513{
514 struct langwell_otg *langwell = the_transceiver;
515 u32 val32;
516
517 /* read OTGSC after reset */
518 val32 = readl(langwell->regs + CI_OTGSC);
519 otg_dbg("%s: OTGSC init value = 0x%x\n", __func__, val32);
520
521 /* set init state */
522 if (val32 & OTGSC_ID) {
523 langwell->hsm.id = 1;
524 langwell->otg.default_a = 0;
525 set_client_mode();
526 langwell->otg.state = OTG_STATE_B_IDLE;
527 langwell_otg_drv_vbus(0);
528 } else {
529 langwell->hsm.id = 0;
530 langwell->otg.default_a = 1;
531 set_host_mode();
532 langwell->otg.state = OTG_STATE_A_IDLE;
533 }
534
535 /* set session indicator */
536 if (val32 & OTGSC_BSE)
537 langwell->hsm.b_sess_end = 1;
538 if (val32 & OTGSC_BSV)
539 langwell->hsm.b_sess_vld = 1;
540 if (val32 & OTGSC_ASV)
541 langwell->hsm.a_sess_vld = 1;
542 if (val32 & OTGSC_AVV)
543 langwell->hsm.a_vbus_vld = 1;
544
545 /* defautly power the bus */
546 langwell->hsm.a_bus_req = 1;
547 langwell->hsm.a_bus_drop = 0;
548 /* defautly don't request bus as B device */
549 langwell->hsm.b_bus_req = 0;
550 /* no system error */
551 langwell->hsm.a_clr_err = 0;
552}
553
554static irqreturn_t otg_dummy_irq(int irq, void *_dev)
555{
556 void __iomem *reg_base = _dev;
557 u32 val;
558 u32 int_mask = 0;
559
560 val = readl(reg_base + CI_USBMODE);
561 if ((val & USBMODE_CM) != USBMODE_DEVICE)
562 return IRQ_NONE;
563
564 val = readl(reg_base + CI_USBSTS);
565 int_mask = val & INTR_DUMMY_MASK;
566
567 if (int_mask == 0)
568 return IRQ_NONE;
569
570 /* clear hsm.b_conn here since host driver can't detect it
571 * otg_dummy_irq called means B-disconnect happened.
572 */
573 if (the_transceiver->hsm.b_conn) {
574 the_transceiver->hsm.b_conn = 0;
575 if (spin_trylock(&the_transceiver->wq_lock)) {
576 queue_work(the_transceiver->qwork,
577 &the_transceiver->work);
578 spin_unlock(&the_transceiver->wq_lock);
579 }
580 }
581 /* Clear interrupts */
582 writel(int_mask, reg_base + CI_USBSTS);
583 return IRQ_HANDLED;
584}
585
586static irqreturn_t otg_irq(int irq, void *_dev)
587{
588 struct langwell_otg *langwell = _dev;
589 u32 int_sts, int_en;
590 u32 int_mask = 0;
591 int flag = 0;
592
593 int_sts = readl(langwell->regs + CI_OTGSC);
594 int_en = (int_sts & OTGSC_INTEN_MASK) >> 8;
595 int_mask = int_sts & int_en;
596 if (int_mask == 0)
597 return IRQ_NONE;
598
599 if (int_mask & OTGSC_IDIS) {
600 otg_dbg("%s: id change int\n", __func__);
601 langwell->hsm.id = (int_sts & OTGSC_ID) ? 1 : 0;
602 flag = 1;
603 }
604 if (int_mask & OTGSC_DPIS) {
605 otg_dbg("%s: data pulse int\n", __func__);
606 langwell->hsm.a_srp_det = (int_sts & OTGSC_DPS) ? 1 : 0;
607 flag = 1;
608 }
609 if (int_mask & OTGSC_BSEIS) {
610 otg_dbg("%s: b session end int\n", __func__);
611 langwell->hsm.b_sess_end = (int_sts & OTGSC_BSE) ? 1 : 0;
612 flag = 1;
613 }
614 if (int_mask & OTGSC_BSVIS) {
615 otg_dbg("%s: b session valid int\n", __func__);
616 langwell->hsm.b_sess_vld = (int_sts & OTGSC_BSV) ? 1 : 0;
617 flag = 1;
618 }
619 if (int_mask & OTGSC_ASVIS) {
620 otg_dbg("%s: a session valid int\n", __func__);
621 langwell->hsm.a_sess_vld = (int_sts & OTGSC_ASV) ? 1 : 0;
622 flag = 1;
623 }
624 if (int_mask & OTGSC_AVVIS) {
625 otg_dbg("%s: a vbus valid int\n", __func__);
626 langwell->hsm.a_vbus_vld = (int_sts & OTGSC_AVV) ? 1 : 0;
627 flag = 1;
628 }
629
630 if (int_mask & OTGSC_1MSS) {
631 /* need to schedule otg_work if any timer is expired */
632 if (langwell_otg_tick_timer(&int_sts))
633 flag = 1;
634 }
635
636 writel((int_sts & ~OTGSC_INTSTS_MASK) | int_mask,
637 langwell->regs + CI_OTGSC);
638 if (flag)
639 queue_work(langwell->qwork, &langwell->work);
640
641 return IRQ_HANDLED;
642}
643
644static void langwell_otg_work(struct work_struct *work)
645{
646 struct langwell_otg *langwell = container_of(work,
647 struct langwell_otg, work);
648 int retval;
649
650 otg_dbg("%s: old state = %s\n", __func__,
651 state_string(langwell->otg.state));
652
653 switch (langwell->otg.state) {
654 case OTG_STATE_UNDEFINED:
655 case OTG_STATE_B_IDLE:
656 if (!langwell->hsm.id) {
657 langwell_otg_del_timer(b_srp_res_tmr);
658 langwell->otg.default_a = 1;
659 langwell->hsm.a_srp_det = 0;
660
661 langwell_otg_chrg_vbus(0);
662 langwell_otg_drv_vbus(0);
663
664 set_host_mode();
665 langwell->otg.state = OTG_STATE_A_IDLE;
666 queue_work(langwell->qwork, &langwell->work);
667 } else if (langwell->hsm.b_srp_res_tmout) {
668 langwell->hsm.b_srp_res_tmout = 0;
669 langwell->hsm.b_bus_req = 0;
670 langwell_otg_nsf_msg(6);
671 } else if (langwell->hsm.b_sess_vld) {
672 langwell_otg_del_timer(b_srp_res_tmr);
673 langwell->hsm.b_sess_end = 0;
674 langwell->hsm.a_bus_suspend = 0;
675
676 langwell_otg_chrg_vbus(0);
677 if (langwell->client_ops) {
678 langwell->client_ops->resume(langwell->pdev);
679 langwell->otg.state = OTG_STATE_B_PERIPHERAL;
680 } else
681 otg_dbg("client driver not loaded.\n");
682
683 } else if (langwell->hsm.b_bus_req &&
684 (langwell->hsm.b_sess_end)) {
685 /* workaround for b_se0_srp detection */
686 retval = langwell_otg_check_se0_srp(0);
687 if (retval) {
688 langwell->hsm.b_bus_req = 0;
689 otg_dbg("LS is not SE0, try again later\n");
690 } else {
691 /* Start SRP */
692 langwell_otg_start_srp(&langwell->otg);
693 langwell_otg_add_timer(b_srp_res_tmr);
694 }
695 }
696 break;
697 case OTG_STATE_B_SRP_INIT:
698 if (!langwell->hsm.id) {
699 langwell->otg.default_a = 1;
700 langwell->hsm.a_srp_det = 0;
701
702 langwell_otg_drv_vbus(0);
703 langwell_otg_chrg_vbus(0);
704
705 langwell->otg.state = OTG_STATE_A_IDLE;
706 queue_work(langwell->qwork, &langwell->work);
707 } else if (langwell->hsm.b_sess_vld) {
708 langwell_otg_chrg_vbus(0);
709 if (langwell->client_ops) {
710 langwell->client_ops->resume(langwell->pdev);
711 langwell->otg.state = OTG_STATE_B_PERIPHERAL;
712 } else
713 otg_dbg("client driver not loaded.\n");
714 }
715 break;
716 case OTG_STATE_B_PERIPHERAL:
717 if (!langwell->hsm.id) {
718 langwell->otg.default_a = 1;
719 langwell->hsm.a_srp_det = 0;
720
721 langwell_otg_drv_vbus(0);
722 langwell_otg_chrg_vbus(0);
723 set_host_mode();
724
725 if (langwell->client_ops) {
726 langwell->client_ops->suspend(langwell->pdev,
727 PMSG_FREEZE);
728 } else
729 otg_dbg("client driver has been removed.\n");
730
731 langwell->otg.state = OTG_STATE_A_IDLE;
732 queue_work(langwell->qwork, &langwell->work);
733 } else if (!langwell->hsm.b_sess_vld) {
734 langwell->hsm.b_hnp_enable = 0;
735
736 if (langwell->client_ops) {
737 langwell->client_ops->suspend(langwell->pdev,
738 PMSG_FREEZE);
739 } else
740 otg_dbg("client driver has been removed.\n");
741
742 langwell->otg.state = OTG_STATE_B_IDLE;
743 } else if (langwell->hsm.b_bus_req && langwell->hsm.b_hnp_enable
744 && langwell->hsm.a_bus_suspend) {
745
746 if (langwell->client_ops) {
747 langwell->client_ops->suspend(langwell->pdev,
748 PMSG_FREEZE);
749 } else
750 otg_dbg("client driver has been removed.\n");
751
752 langwell_otg_HAAR(1);
753 langwell->hsm.a_conn = 0;
754
755 if (langwell->host_ops) {
756 langwell->host_ops->probe(langwell->pdev,
757 langwell->host_ops->id_table);
758 langwell->otg.state = OTG_STATE_B_WAIT_ACON;
759 } else
760 otg_dbg("host driver not loaded.\n");
761
762 langwell->hsm.a_bus_resume = 0;
763 langwell->hsm.b_ase0_brst_tmout = 0;
764 langwell_otg_add_timer(b_ase0_brst_tmr);
765 }
766 break;
767
768 case OTG_STATE_B_WAIT_ACON:
769 if (!langwell->hsm.id) {
770 langwell_otg_del_timer(b_ase0_brst_tmr);
771 langwell->otg.default_a = 1;
772 langwell->hsm.a_srp_det = 0;
773
774 langwell_otg_drv_vbus(0);
775 langwell_otg_chrg_vbus(0);
776 set_host_mode();
777
778 langwell_otg_HAAR(0);
779 if (langwell->host_ops)
780 langwell->host_ops->remove(langwell->pdev);
781 else
782 otg_dbg("host driver has been removed.\n");
783 langwell->otg.state = OTG_STATE_A_IDLE;
784 queue_work(langwell->qwork, &langwell->work);
785 } else if (!langwell->hsm.b_sess_vld) {
786 langwell_otg_del_timer(b_ase0_brst_tmr);
787 langwell->hsm.b_hnp_enable = 0;
788 langwell->hsm.b_bus_req = 0;
789 langwell_otg_chrg_vbus(0);
790 langwell_otg_HAAR(0);
791
792 if (langwell->host_ops)
793 langwell->host_ops->remove(langwell->pdev);
794 else
795 otg_dbg("host driver has been removed.\n");
796 langwell->otg.state = OTG_STATE_B_IDLE;
797 } else if (langwell->hsm.a_conn) {
798 langwell_otg_del_timer(b_ase0_brst_tmr);
799 langwell_otg_HAAR(0);
800 langwell->otg.state = OTG_STATE_B_HOST;
801 queue_work(langwell->qwork, &langwell->work);
802 } else if (langwell->hsm.a_bus_resume ||
803 langwell->hsm.b_ase0_brst_tmout) {
804 langwell_otg_del_timer(b_ase0_brst_tmr);
805 langwell_otg_HAAR(0);
806 langwell_otg_nsf_msg(7);
807
808 if (langwell->host_ops)
809 langwell->host_ops->remove(langwell->pdev);
810 else
811 otg_dbg("host driver has been removed.\n");
812
813 langwell->hsm.a_bus_suspend = 0;
814 langwell->hsm.b_bus_req = 0;
815
816 if (langwell->client_ops)
817 langwell->client_ops->resume(langwell->pdev);
818 else
819 otg_dbg("client driver not loaded.\n");
820
821 langwell->otg.state = OTG_STATE_B_PERIPHERAL;
822 }
823 break;
824
825 case OTG_STATE_B_HOST:
826 if (!langwell->hsm.id) {
827 langwell->otg.default_a = 1;
828 langwell->hsm.a_srp_det = 0;
829
830 langwell_otg_drv_vbus(0);
831 langwell_otg_chrg_vbus(0);
832 set_host_mode();
833 if (langwell->host_ops)
834 langwell->host_ops->remove(langwell->pdev);
835 else
836 otg_dbg("host driver has been removed.\n");
837 langwell->otg.state = OTG_STATE_A_IDLE;
838 queue_work(langwell->qwork, &langwell->work);
839 } else if (!langwell->hsm.b_sess_vld) {
840 langwell->hsm.b_hnp_enable = 0;
841 langwell->hsm.b_bus_req = 0;
842 langwell_otg_chrg_vbus(0);
843 if (langwell->host_ops)
844 langwell->host_ops->remove(langwell->pdev);
845 else
846 otg_dbg("host driver has been removed.\n");
847 langwell->otg.state = OTG_STATE_B_IDLE;
848 } else if ((!langwell->hsm.b_bus_req) ||
849 (!langwell->hsm.a_conn)) {
850 langwell->hsm.b_bus_req = 0;
851 langwell_otg_loc_sof(0);
852 if (langwell->host_ops)
853 langwell->host_ops->remove(langwell->pdev);
854 else
855 otg_dbg("host driver has been removed.\n");
856
857 langwell->hsm.a_bus_suspend = 0;
858
859 if (langwell->client_ops)
860 langwell->client_ops->resume(langwell->pdev);
861 else
862 otg_dbg("client driver not loaded.\n");
863
864 langwell->otg.state = OTG_STATE_B_PERIPHERAL;
865 }
866 break;
867
868 case OTG_STATE_A_IDLE:
869 langwell->otg.default_a = 1;
870 if (langwell->hsm.id) {
871 langwell->otg.default_a = 0;
872 langwell->hsm.b_bus_req = 0;
873 langwell_otg_drv_vbus(0);
874 langwell_otg_chrg_vbus(0);
875
876 langwell->otg.state = OTG_STATE_B_IDLE;
877 queue_work(langwell->qwork, &langwell->work);
878 } else if (langwell->hsm.a_sess_vld) {
879 langwell_otg_drv_vbus(1);
880 langwell->hsm.a_srp_det = 1;
881 langwell->hsm.a_wait_vrise_tmout = 0;
882 langwell_otg_add_timer(a_wait_vrise_tmr);
883 langwell->otg.state = OTG_STATE_A_WAIT_VRISE;
884 queue_work(langwell->qwork, &langwell->work);
885 } else if (!langwell->hsm.a_bus_drop &&
886 (langwell->hsm.a_srp_det || langwell->hsm.a_bus_req)) {
887 langwell_otg_drv_vbus(1);
888 langwell->hsm.a_wait_vrise_tmout = 0;
889 langwell_otg_add_timer(a_wait_vrise_tmr);
890 langwell->otg.state = OTG_STATE_A_WAIT_VRISE;
891 queue_work(langwell->qwork, &langwell->work);
892 }
893 break;
894 case OTG_STATE_A_WAIT_VRISE:
895 if (langwell->hsm.id) {
896 langwell_otg_del_timer(a_wait_vrise_tmr);
897 langwell->hsm.b_bus_req = 0;
898 langwell->otg.default_a = 0;
899 langwell_otg_drv_vbus(0);
900 langwell->otg.state = OTG_STATE_B_IDLE;
901 } else if (langwell->hsm.a_vbus_vld) {
902 langwell_otg_del_timer(a_wait_vrise_tmr);
903 if (langwell->host_ops)
904 langwell->host_ops->probe(langwell->pdev,
905 langwell->host_ops->id_table);
906 else
907 otg_dbg("host driver not loaded.\n");
908 langwell->hsm.b_conn = 0;
909 langwell->hsm.a_set_b_hnp_en = 0;
910 langwell->hsm.a_wait_bcon_tmout = 0;
911 langwell_otg_add_timer(a_wait_bcon_tmr);
912 langwell->otg.state = OTG_STATE_A_WAIT_BCON;
913 } else if (langwell->hsm.a_wait_vrise_tmout) {
914 if (langwell->hsm.a_vbus_vld) {
915 if (langwell->host_ops)
916 langwell->host_ops->probe(
917 langwell->pdev,
918 langwell->host_ops->id_table);
919 else
920 otg_dbg("host driver not loaded.\n");
921 langwell->hsm.b_conn = 0;
922 langwell->hsm.a_set_b_hnp_en = 0;
923 langwell->hsm.a_wait_bcon_tmout = 0;
924 langwell_otg_add_timer(a_wait_bcon_tmr);
925 langwell->otg.state = OTG_STATE_A_WAIT_BCON;
926 } else {
927 langwell_otg_drv_vbus(0);
928 langwell->otg.state = OTG_STATE_A_VBUS_ERR;
929 }
930 }
931 break;
932 case OTG_STATE_A_WAIT_BCON:
933 if (langwell->hsm.id) {
934 langwell_otg_del_timer(a_wait_bcon_tmr);
935
936 langwell->otg.default_a = 0;
937 langwell->hsm.b_bus_req = 0;
938 if (langwell->host_ops)
939 langwell->host_ops->remove(langwell->pdev);
940 else
941 otg_dbg("host driver has been removed.\n");
942 langwell_otg_drv_vbus(0);
943 langwell->otg.state = OTG_STATE_B_IDLE;
944 queue_work(langwell->qwork, &langwell->work);
945 } else if (!langwell->hsm.a_vbus_vld) {
946 langwell_otg_del_timer(a_wait_bcon_tmr);
947
948 if (langwell->host_ops)
949 langwell->host_ops->remove(langwell->pdev);
950 else
951 otg_dbg("host driver has been removed.\n");
952 langwell_otg_drv_vbus(0);
953 langwell->otg.state = OTG_STATE_A_VBUS_ERR;
954 } else if (langwell->hsm.a_bus_drop ||
955 (langwell->hsm.a_wait_bcon_tmout &&
956 !langwell->hsm.a_bus_req)) {
957 langwell_otg_del_timer(a_wait_bcon_tmr);
958
959 if (langwell->host_ops)
960 langwell->host_ops->remove(langwell->pdev);
961 else
962 otg_dbg("host driver has been removed.\n");
963 langwell_otg_drv_vbus(0);
964 langwell->otg.state = OTG_STATE_A_WAIT_VFALL;
965 } else if (langwell->hsm.b_conn) {
966 langwell_otg_del_timer(a_wait_bcon_tmr);
967
968 langwell->hsm.a_suspend_req = 0;
969 langwell->otg.state = OTG_STATE_A_HOST;
970 if (!langwell->hsm.a_bus_req &&
971 langwell->hsm.a_set_b_hnp_en) {
972 /* It is not safe enough to do a fast
973 * transistion from A_WAIT_BCON to
974 * A_SUSPEND */
975 msleep(10000);
976 if (langwell->hsm.a_bus_req)
977 break;
978
979 if (request_irq(langwell->pdev->irq,
980 otg_dummy_irq, IRQF_SHARED,
981 driver_name, langwell->regs) != 0) {
982 otg_dbg("request interrupt %d fail\n",
983 langwell->pdev->irq);
984 }
985
986 langwell_otg_HABA(1);
987 langwell->hsm.b_bus_resume = 0;
988 langwell->hsm.a_aidl_bdis_tmout = 0;
989 langwell_otg_add_timer(a_aidl_bdis_tmr);
990
991 langwell_otg_loc_sof(0);
992 langwell->otg.state = OTG_STATE_A_SUSPEND;
993 } else if (!langwell->hsm.a_bus_req &&
994 !langwell->hsm.a_set_b_hnp_en) {
995 struct pci_dev *pdev = langwell->pdev;
996 if (langwell->host_ops)
997 langwell->host_ops->remove(pdev);
998 else
999 otg_dbg("host driver removed.\n");
1000 langwell_otg_drv_vbus(0);
1001 langwell->otg.state = OTG_STATE_A_WAIT_VFALL;
1002 }
1003 }
1004 break;
1005 case OTG_STATE_A_HOST:
1006 if (langwell->hsm.id) {
1007 langwell->otg.default_a = 0;
1008 langwell->hsm.b_bus_req = 0;
1009 if (langwell->host_ops)
1010 langwell->host_ops->remove(langwell->pdev);
1011 else
1012 otg_dbg("host driver has been removed.\n");
1013 langwell_otg_drv_vbus(0);
1014 langwell->otg.state = OTG_STATE_B_IDLE;
1015 queue_work(langwell->qwork, &langwell->work);
1016 } else if (langwell->hsm.a_bus_drop ||
1017 (!langwell->hsm.a_set_b_hnp_en && !langwell->hsm.a_bus_req)) {
1018 if (langwell->host_ops)
1019 langwell->host_ops->remove(langwell->pdev);
1020 else
1021 otg_dbg("host driver has been removed.\n");
1022 langwell_otg_drv_vbus(0);
1023 langwell->otg.state = OTG_STATE_A_WAIT_VFALL;
1024 } else if (!langwell->hsm.a_vbus_vld) {
1025 if (langwell->host_ops)
1026 langwell->host_ops->remove(langwell->pdev);
1027 else
1028 otg_dbg("host driver has been removed.\n");
1029 langwell_otg_drv_vbus(0);
1030 langwell->otg.state = OTG_STATE_A_VBUS_ERR;
1031 } else if (langwell->hsm.a_set_b_hnp_en
1032 && !langwell->hsm.a_bus_req) {
1033 /* Set HABA to enable hardware assistance to signal
1034 * A-connect after receiver B-disconnect. Hardware
1035 * will then set client mode and enable URE, SLE and
1036 * PCE after the assistance. otg_dummy_irq is used to
1037 * clean these ints when client driver is not resumed.
1038 */
1039 if (request_irq(langwell->pdev->irq,
1040 otg_dummy_irq, IRQF_SHARED, driver_name,
1041 langwell->regs) != 0) {
1042 otg_dbg("request interrupt %d failed\n",
1043 langwell->pdev->irq);
1044 }
1045
1046 /* set HABA */
1047 langwell_otg_HABA(1);
1048 langwell->hsm.b_bus_resume = 0;
1049 langwell->hsm.a_aidl_bdis_tmout = 0;
1050 langwell_otg_add_timer(a_aidl_bdis_tmr);
1051 langwell_otg_loc_sof(0);
1052 langwell->otg.state = OTG_STATE_A_SUSPEND;
1053 } else if (!langwell->hsm.b_conn || !langwell->hsm.a_bus_req) {
1054 langwell->hsm.a_wait_bcon_tmout = 0;
1055 langwell->hsm.a_set_b_hnp_en = 0;
1056 langwell_otg_add_timer(a_wait_bcon_tmr);
1057 langwell->otg.state = OTG_STATE_A_WAIT_BCON;
1058 }
1059 break;
1060 case OTG_STATE_A_SUSPEND:
1061 if (langwell->hsm.id) {
1062 langwell_otg_del_timer(a_aidl_bdis_tmr);
1063 langwell_otg_HABA(0);
1064 free_irq(langwell->pdev->irq, langwell->regs);
1065 langwell->otg.default_a = 0;
1066 langwell->hsm.b_bus_req = 0;
1067 if (langwell->host_ops)
1068 langwell->host_ops->remove(langwell->pdev);
1069 else
1070 otg_dbg("host driver has been removed.\n");
1071 langwell_otg_drv_vbus(0);
1072 langwell->otg.state = OTG_STATE_B_IDLE;
1073 queue_work(langwell->qwork, &langwell->work);
1074 } else if (langwell->hsm.a_bus_req ||
1075 langwell->hsm.b_bus_resume) {
1076 langwell_otg_del_timer(a_aidl_bdis_tmr);
1077 langwell_otg_HABA(0);
1078 free_irq(langwell->pdev->irq, langwell->regs);
1079 langwell->hsm.a_suspend_req = 0;
1080 langwell_otg_loc_sof(1);
1081 langwell->otg.state = OTG_STATE_A_HOST;
1082 } else if (langwell->hsm.a_aidl_bdis_tmout ||
1083 langwell->hsm.a_bus_drop) {
1084 langwell_otg_del_timer(a_aidl_bdis_tmr);
1085 langwell_otg_HABA(0);
1086 free_irq(langwell->pdev->irq, langwell->regs);
1087 if (langwell->host_ops)
1088 langwell->host_ops->remove(langwell->pdev);
1089 else
1090 otg_dbg("host driver has been removed.\n");
1091 langwell_otg_drv_vbus(0);
1092 langwell->otg.state = OTG_STATE_A_WAIT_VFALL;
1093 } else if (!langwell->hsm.b_conn &&
1094 langwell->hsm.a_set_b_hnp_en) {
1095 langwell_otg_del_timer(a_aidl_bdis_tmr);
1096 langwell_otg_HABA(0);
1097 free_irq(langwell->pdev->irq, langwell->regs);
1098
1099 if (langwell->host_ops)
1100 langwell->host_ops->remove(langwell->pdev);
1101 else
1102 otg_dbg("host driver has been removed.\n");
1103
1104 langwell->hsm.b_bus_suspend = 0;
1105 langwell->hsm.b_bus_suspend_vld = 0;
1106 langwell->hsm.b_bus_suspend_tmout = 0;
1107
1108 /* msleep(200); */
1109 if (langwell->client_ops)
1110 langwell->client_ops->resume(langwell->pdev);
1111 else
1112 otg_dbg("client driver not loaded.\n");
1113
1114 langwell_otg_add_timer(b_bus_suspend_tmr);
1115 langwell->otg.state = OTG_STATE_A_PERIPHERAL;
1116 break;
1117 } else if (!langwell->hsm.a_vbus_vld) {
1118 langwell_otg_del_timer(a_aidl_bdis_tmr);
1119 langwell_otg_HABA(0);
1120 free_irq(langwell->pdev->irq, langwell->regs);
1121 if (langwell->host_ops)
1122 langwell->host_ops->remove(langwell->pdev);
1123 else
1124 otg_dbg("host driver has been removed.\n");
1125 langwell_otg_drv_vbus(0);
1126 langwell->otg.state = OTG_STATE_A_VBUS_ERR;
1127 }
1128 break;
1129 case OTG_STATE_A_PERIPHERAL:
1130 if (langwell->hsm.id) {
1131 langwell_otg_del_timer(b_bus_suspend_tmr);
1132 langwell->otg.default_a = 0;
1133 langwell->hsm.b_bus_req = 0;
1134 if (langwell->client_ops)
1135 langwell->client_ops->suspend(langwell->pdev,
1136 PMSG_FREEZE);
1137 else
1138 otg_dbg("client driver has been removed.\n");
1139 langwell_otg_drv_vbus(0);
1140 langwell->otg.state = OTG_STATE_B_IDLE;
1141 queue_work(langwell->qwork, &langwell->work);
1142 } else if (!langwell->hsm.a_vbus_vld) {
1143 langwell_otg_del_timer(b_bus_suspend_tmr);
1144 if (langwell->client_ops)
1145 langwell->client_ops->suspend(langwell->pdev,
1146 PMSG_FREEZE);
1147 else
1148 otg_dbg("client driver has been removed.\n");
1149 langwell_otg_drv_vbus(0);
1150 langwell->otg.state = OTG_STATE_A_VBUS_ERR;
1151 } else if (langwell->hsm.a_bus_drop) {
1152 langwell_otg_del_timer(b_bus_suspend_tmr);
1153 if (langwell->client_ops)
1154 langwell->client_ops->suspend(langwell->pdev,
1155 PMSG_FREEZE);
1156 else
1157 otg_dbg("client driver has been removed.\n");
1158 langwell_otg_drv_vbus(0);
1159 langwell->otg.state = OTG_STATE_A_WAIT_VFALL;
1160 } else if (langwell->hsm.b_bus_suspend) {
1161 langwell_otg_del_timer(b_bus_suspend_tmr);
1162 if (langwell->client_ops)
1163 langwell->client_ops->suspend(langwell->pdev,
1164 PMSG_FREEZE);
1165 else
1166 otg_dbg("client driver has been removed.\n");
1167
1168 if (langwell->host_ops)
1169 langwell->host_ops->probe(langwell->pdev,
1170 langwell->host_ops->id_table);
1171 else
1172 otg_dbg("host driver not loaded.\n");
1173 langwell->hsm.a_set_b_hnp_en = 0;
1174 langwell->hsm.a_wait_bcon_tmout = 0;
1175 langwell_otg_add_timer(a_wait_bcon_tmr);
1176 langwell->otg.state = OTG_STATE_A_WAIT_BCON;
1177 } else if (langwell->hsm.b_bus_suspend_tmout) {
1178 u32 val;
1179 val = readl(langwell->regs + CI_PORTSC1);
1180 if (!(val & PORTSC_SUSP))
1181 break;
1182 if (langwell->client_ops)
1183 langwell->client_ops->suspend(langwell->pdev,
1184 PMSG_FREEZE);
1185 else
1186 otg_dbg("client driver has been removed.\n");
1187 if (langwell->host_ops)
1188 langwell->host_ops->probe(langwell->pdev,
1189 langwell->host_ops->id_table);
1190 else
1191 otg_dbg("host driver not loaded.\n");
1192 langwell->hsm.a_set_b_hnp_en = 0;
1193 langwell->hsm.a_wait_bcon_tmout = 0;
1194 langwell_otg_add_timer(a_wait_bcon_tmr);
1195 langwell->otg.state = OTG_STATE_A_WAIT_BCON;
1196 }
1197 break;
1198 case OTG_STATE_A_VBUS_ERR:
1199 if (langwell->hsm.id) {
1200 langwell->otg.default_a = 0;
1201 langwell->hsm.a_clr_err = 0;
1202 langwell->hsm.a_srp_det = 0;
1203 langwell->otg.state = OTG_STATE_B_IDLE;
1204 queue_work(langwell->qwork, &langwell->work);
1205 } else if (langwell->hsm.a_clr_err) {
1206 langwell->hsm.a_clr_err = 0;
1207 langwell->hsm.a_srp_det = 0;
1208 reset_otg();
1209 init_hsm();
1210 if (langwell->otg.state == OTG_STATE_A_IDLE)
1211 queue_work(langwell->qwork, &langwell->work);
1212 }
1213 break;
1214 case OTG_STATE_A_WAIT_VFALL:
1215 if (langwell->hsm.id) {
1216 langwell->otg.default_a = 0;
1217 langwell->otg.state = OTG_STATE_B_IDLE;
1218 queue_work(langwell->qwork, &langwell->work);
1219 } else if (langwell->hsm.a_bus_req) {
1220 langwell_otg_drv_vbus(1);
1221 langwell->hsm.a_wait_vrise_tmout = 0;
1222 langwell_otg_add_timer(a_wait_vrise_tmr);
1223 langwell->otg.state = OTG_STATE_A_WAIT_VRISE;
1224 } else if (!langwell->hsm.a_sess_vld) {
1225 langwell->hsm.a_srp_det = 0;
1226 langwell_otg_drv_vbus(0);
1227 set_host_mode();
1228 langwell->otg.state = OTG_STATE_A_IDLE;
1229 }
1230 break;
1231 default:
1232 ;
1233 }
1234
1235 otg_dbg("%s: new state = %s\n", __func__,
1236 state_string(langwell->otg.state));
1237}
1238
1239 static ssize_t
1240show_registers(struct device *_dev, struct device_attribute *attr, char *buf)
1241{
1242 struct langwell_otg *langwell;
1243 char *next;
1244 unsigned size;
1245 unsigned t;
1246
1247 langwell = the_transceiver;
1248 next = buf;
1249 size = PAGE_SIZE;
1250
1251 t = scnprintf(next, size,
1252 "\n"
1253 "USBCMD = 0x%08x \n"
1254 "USBSTS = 0x%08x \n"
1255 "USBINTR = 0x%08x \n"
1256 "ASYNCLISTADDR = 0x%08x \n"
1257 "PORTSC1 = 0x%08x \n"
1258 "HOSTPC1 = 0x%08x \n"
1259 "OTGSC = 0x%08x \n"
1260 "USBMODE = 0x%08x \n",
1261 readl(langwell->regs + 0x30),
1262 readl(langwell->regs + 0x34),
1263 readl(langwell->regs + 0x38),
1264 readl(langwell->regs + 0x48),
1265 readl(langwell->regs + 0x74),
1266 readl(langwell->regs + 0xb4),
1267 readl(langwell->regs + 0xf4),
1268 readl(langwell->regs + 0xf8)
1269 );
1270 size -= t;
1271 next += t;
1272
1273 return PAGE_SIZE - size;
1274}
1275static DEVICE_ATTR(registers, S_IRUGO, show_registers, NULL);
1276
1277static ssize_t
1278show_hsm(struct device *_dev, struct device_attribute *attr, char *buf)
1279{
1280 struct langwell_otg *langwell;
1281 char *next;
1282 unsigned size;
1283 unsigned t;
1284
1285 langwell = the_transceiver;
1286 next = buf;
1287 size = PAGE_SIZE;
1288
1289 t = scnprintf(next, size,
1290 "\n"
1291 "current state = %s\n"
1292 "a_bus_resume = \t%d\n"
1293 "a_bus_suspend = \t%d\n"
1294 "a_conn = \t%d\n"
1295 "a_sess_vld = \t%d\n"
1296 "a_srp_det = \t%d\n"
1297 "a_vbus_vld = \t%d\n"
1298 "b_bus_resume = \t%d\n"
1299 "b_bus_suspend = \t%d\n"
1300 "b_conn = \t%d\n"
1301 "b_se0_srp = \t%d\n"
1302 "b_sess_end = \t%d\n"
1303 "b_sess_vld = \t%d\n"
1304 "id = \t%d\n"
1305 "a_set_b_hnp_en = \t%d\n"
1306 "b_srp_done = \t%d\n"
1307 "b_hnp_enable = \t%d\n"
1308 "a_wait_vrise_tmout = \t%d\n"
1309 "a_wait_bcon_tmout = \t%d\n"
1310 "a_aidl_bdis_tmout = \t%d\n"
1311 "b_ase0_brst_tmout = \t%d\n"
1312 "a_bus_drop = \t%d\n"
1313 "a_bus_req = \t%d\n"
1314 "a_clr_err = \t%d\n"
1315 "a_suspend_req = \t%d\n"
1316 "b_bus_req = \t%d\n"
1317 "b_bus_suspend_tmout = \t%d\n"
1318 "b_bus_suspend_vld = \t%d\n",
1319 state_string(langwell->otg.state),
1320 langwell->hsm.a_bus_resume,
1321 langwell->hsm.a_bus_suspend,
1322 langwell->hsm.a_conn,
1323 langwell->hsm.a_sess_vld,
1324 langwell->hsm.a_srp_det,
1325 langwell->hsm.a_vbus_vld,
1326 langwell->hsm.b_bus_resume,
1327 langwell->hsm.b_bus_suspend,
1328 langwell->hsm.b_conn,
1329 langwell->hsm.b_se0_srp,
1330 langwell->hsm.b_sess_end,
1331 langwell->hsm.b_sess_vld,
1332 langwell->hsm.id,
1333 langwell->hsm.a_set_b_hnp_en,
1334 langwell->hsm.b_srp_done,
1335 langwell->hsm.b_hnp_enable,
1336 langwell->hsm.a_wait_vrise_tmout,
1337 langwell->hsm.a_wait_bcon_tmout,
1338 langwell->hsm.a_aidl_bdis_tmout,
1339 langwell->hsm.b_ase0_brst_tmout,
1340 langwell->hsm.a_bus_drop,
1341 langwell->hsm.a_bus_req,
1342 langwell->hsm.a_clr_err,
1343 langwell->hsm.a_suspend_req,
1344 langwell->hsm.b_bus_req,
1345 langwell->hsm.b_bus_suspend_tmout,
1346 langwell->hsm.b_bus_suspend_vld
1347 );
1348 size -= t;
1349 next += t;
1350
1351 return PAGE_SIZE - size;
1352}
1353static DEVICE_ATTR(hsm, S_IRUGO, show_hsm, NULL);
1354
1355static ssize_t
1356get_a_bus_req(struct device *dev, struct device_attribute *attr, char *buf)
1357{
1358 struct langwell_otg *langwell;
1359 char *next;
1360 unsigned size;
1361 unsigned t;
1362
1363 langwell = the_transceiver;
1364 next = buf;
1365 size = PAGE_SIZE;
1366
1367 t = scnprintf(next, size, "%d", langwell->hsm.a_bus_req);
1368 size -= t;
1369 next += t;
1370
1371 return PAGE_SIZE - size;
1372}
1373
1374static ssize_t
1375set_a_bus_req(struct device *dev, struct device_attribute *attr,
1376 const char *buf, size_t count)
1377{
1378 struct langwell_otg *langwell;
1379 langwell = the_transceiver;
1380 if (!langwell->otg.default_a)
1381 return -1;
1382 if (count > 2)
1383 return -1;
1384
1385 if (buf[0] == '0') {
1386 langwell->hsm.a_bus_req = 0;
1387 otg_dbg("a_bus_req = 0\n");
1388 } else if (buf[0] == '1') {
1389 /* If a_bus_drop is TRUE, a_bus_req can't be set */
1390 if (langwell->hsm.a_bus_drop)
1391 return -1;
1392 langwell->hsm.a_bus_req = 1;
1393 otg_dbg("a_bus_req = 1\n");
1394 }
1395 if (spin_trylock(&langwell->wq_lock)) {
1396 queue_work(langwell->qwork, &langwell->work);
1397 spin_unlock(&langwell->wq_lock);
1398 }
1399 return count;
1400}
1401static DEVICE_ATTR(a_bus_req, S_IRUGO | S_IWUGO, get_a_bus_req, set_a_bus_req);
1402
1403static ssize_t
1404get_a_bus_drop(struct device *dev, struct device_attribute *attr, char *buf)
1405{
1406 struct langwell_otg *langwell;
1407 char *next;
1408 unsigned size;
1409 unsigned t;
1410
1411 langwell = the_transceiver;
1412 next = buf;
1413 size = PAGE_SIZE;
1414
1415 t = scnprintf(next, size, "%d", langwell->hsm.a_bus_drop);
1416 size -= t;
1417 next += t;
1418
1419 return PAGE_SIZE - size;
1420}
1421
1422static ssize_t
1423set_a_bus_drop(struct device *dev, struct device_attribute *attr,
1424 const char *buf, size_t count)
1425{
1426 struct langwell_otg *langwell;
1427 langwell = the_transceiver;
1428 if (!langwell->otg.default_a)
1429 return -1;
1430 if (count > 2)
1431 return -1;
1432
1433 if (buf[0] == '0') {
1434 langwell->hsm.a_bus_drop = 0;
1435 otg_dbg("a_bus_drop = 0\n");
1436 } else if (buf[0] == '1') {
1437 langwell->hsm.a_bus_drop = 1;
1438 langwell->hsm.a_bus_req = 0;
1439 otg_dbg("a_bus_drop = 1, then a_bus_req = 0\n");
1440 }
1441 if (spin_trylock(&langwell->wq_lock)) {
1442 queue_work(langwell->qwork, &langwell->work);
1443 spin_unlock(&langwell->wq_lock);
1444 }
1445 return count;
1446}
1447static DEVICE_ATTR(a_bus_drop, S_IRUGO | S_IWUGO,
1448 get_a_bus_drop, set_a_bus_drop);
1449
1450static ssize_t
1451get_b_bus_req(struct device *dev, struct device_attribute *attr, char *buf)
1452{
1453 struct langwell_otg *langwell;
1454 char *next;
1455 unsigned size;
1456 unsigned t;
1457
1458 langwell = the_transceiver;
1459 next = buf;
1460 size = PAGE_SIZE;
1461
1462 t = scnprintf(next, size, "%d", langwell->hsm.b_bus_req);
1463 size -= t;
1464 next += t;
1465
1466 return PAGE_SIZE - size;
1467}
1468
1469static ssize_t
1470set_b_bus_req(struct device *dev, struct device_attribute *attr,
1471 const char *buf, size_t count)
1472{
1473 struct langwell_otg *langwell;
1474 langwell = the_transceiver;
1475
1476 if (langwell->otg.default_a)
1477 return -1;
1478
1479 if (count > 2)
1480 return -1;
1481
1482 if (buf[0] == '0') {
1483 langwell->hsm.b_bus_req = 0;
1484 otg_dbg("b_bus_req = 0\n");
1485 } else if (buf[0] == '1') {
1486 langwell->hsm.b_bus_req = 1;
1487 otg_dbg("b_bus_req = 1\n");
1488 }
1489 if (spin_trylock(&langwell->wq_lock)) {
1490 queue_work(langwell->qwork, &langwell->work);
1491 spin_unlock(&langwell->wq_lock);
1492 }
1493 return count;
1494}
1495static DEVICE_ATTR(b_bus_req, S_IRUGO | S_IWUGO, get_b_bus_req, set_b_bus_req);
1496
1497static ssize_t
1498set_a_clr_err(struct device *dev, struct device_attribute *attr,
1499 const char *buf, size_t count)
1500{
1501 struct langwell_otg *langwell;
1502 langwell = the_transceiver;
1503
1504 if (!langwell->otg.default_a)
1505 return -1;
1506 if (count > 2)
1507 return -1;
1508
1509 if (buf[0] == '1') {
1510 langwell->hsm.a_clr_err = 1;
1511 otg_dbg("a_clr_err = 1\n");
1512 }
1513 if (spin_trylock(&langwell->wq_lock)) {
1514 queue_work(langwell->qwork, &langwell->work);
1515 spin_unlock(&langwell->wq_lock);
1516 }
1517 return count;
1518}
1519static DEVICE_ATTR(a_clr_err, S_IWUGO, NULL, set_a_clr_err);
1520
1521static struct attribute *inputs_attrs[] = {
1522 &dev_attr_a_bus_req.attr,
1523 &dev_attr_a_bus_drop.attr,
1524 &dev_attr_b_bus_req.attr,
1525 &dev_attr_a_clr_err.attr,
1526 NULL,
1527};
1528
1529static struct attribute_group debug_dev_attr_group = {
1530 .name = "inputs",
1531 .attrs = inputs_attrs,
1532};
1533
1534int langwell_register_host(struct pci_driver *host_driver)
1535{
1536 int ret = 0;
1537
1538 the_transceiver->host_ops = host_driver;
1539 queue_work(the_transceiver->qwork, &the_transceiver->work);
1540 otg_dbg("host controller driver is registered\n");
1541
1542 return ret;
1543}
1544EXPORT_SYMBOL(langwell_register_host);
1545
1546void langwell_unregister_host(struct pci_driver *host_driver)
1547{
1548 if (the_transceiver->host_ops)
1549 the_transceiver->host_ops->remove(the_transceiver->pdev);
1550 the_transceiver->host_ops = NULL;
1551 the_transceiver->hsm.a_bus_drop = 1;
1552 queue_work(the_transceiver->qwork, &the_transceiver->work);
1553 otg_dbg("host controller driver is unregistered\n");
1554}
1555EXPORT_SYMBOL(langwell_unregister_host);
1556
1557int langwell_register_peripheral(struct pci_driver *client_driver)
1558{
1559 int ret = 0;
1560
1561 if (client_driver)
1562 ret = client_driver->probe(the_transceiver->pdev,
1563 client_driver->id_table);
1564 if (!ret) {
1565 the_transceiver->client_ops = client_driver;
1566 queue_work(the_transceiver->qwork, &the_transceiver->work);
1567 otg_dbg("client controller driver is registered\n");
1568 }
1569
1570 return ret;
1571}
1572EXPORT_SYMBOL(langwell_register_peripheral);
1573
1574void langwell_unregister_peripheral(struct pci_driver *client_driver)
1575{
1576 if (the_transceiver->client_ops)
1577 the_transceiver->client_ops->remove(the_transceiver->pdev);
1578 the_transceiver->client_ops = NULL;
1579 the_transceiver->hsm.b_bus_req = 0;
1580 queue_work(the_transceiver->qwork, &the_transceiver->work);
1581 otg_dbg("client controller driver is unregistered\n");
1582}
1583EXPORT_SYMBOL(langwell_unregister_peripheral);
1584
1585static int langwell_otg_probe(struct pci_dev *pdev,
1586 const struct pci_device_id *id)
1587{
1588 unsigned long resource, len;
1589 void __iomem *base = NULL;
1590 int retval;
1591 u32 val32;
1592 struct langwell_otg *langwell;
1593 char qname[] = "langwell_otg_queue";
1594
1595 retval = 0;
1596 otg_dbg("\notg controller is detected.\n");
1597 if (pci_enable_device(pdev) < 0) {
1598 retval = -ENODEV;
1599 goto done;
1600 }
1601
1602 langwell = kzalloc(sizeof *langwell, GFP_KERNEL);
1603 if (langwell == NULL) {
1604 retval = -ENOMEM;
1605 goto done;
1606 }
1607 the_transceiver = langwell;
1608
1609 /* control register: BAR 0 */
1610 resource = pci_resource_start(pdev, 0);
1611 len = pci_resource_len(pdev, 0);
1612 if (!request_mem_region(resource, len, driver_name)) {
1613 retval = -EBUSY;
1614 goto err;
1615 }
1616 langwell->region = 1;
1617
1618 base = ioremap_nocache(resource, len);
1619 if (base == NULL) {
1620 retval = -EFAULT;
1621 goto err;
1622 }
1623 langwell->regs = base;
1624
1625 if (!pdev->irq) {
1626 otg_dbg("No IRQ.\n");
1627 retval = -ENODEV;
1628 goto err;
1629 }
1630
1631 langwell->qwork = create_workqueue(qname);
1632 if (!langwell->qwork) {
1633 otg_dbg("cannot create workqueue %s\n", qname);
1634 retval = -ENOMEM;
1635 goto err;
1636 }
1637 INIT_WORK(&langwell->work, langwell_otg_work);
1638
1639 /* OTG common part */
1640 langwell->pdev = pdev;
1641 langwell->otg.dev = &pdev->dev;
1642 langwell->otg.label = driver_name;
1643 langwell->otg.set_host = langwell_otg_set_host;
1644 langwell->otg.set_peripheral = langwell_otg_set_peripheral;
1645 langwell->otg.set_power = langwell_otg_set_power;
1646 langwell->otg.start_srp = langwell_otg_start_srp;
1647 langwell->otg.state = OTG_STATE_UNDEFINED;
1648 if (otg_set_transceiver(&langwell->otg)) {
1649 otg_dbg("can't set transceiver\n");
1650 retval = -EBUSY;
1651 goto err;
1652 }
1653
1654 reset_otg();
1655 init_hsm();
1656
1657 spin_lock_init(&langwell->lock);
1658 spin_lock_init(&langwell->wq_lock);
1659 INIT_LIST_HEAD(&active_timers);
1660 langwell_otg_init_timers(&langwell->hsm);
1661
1662 if (request_irq(pdev->irq, otg_irq, IRQF_SHARED,
1663 driver_name, langwell) != 0) {
1664 otg_dbg("request interrupt %d failed\n", pdev->irq);
1665 retval = -EBUSY;
1666 goto err;
1667 }
1668
1669 /* enable OTGSC int */
1670 val32 = OTGSC_DPIE | OTGSC_BSEIE | OTGSC_BSVIE |
1671 OTGSC_ASVIE | OTGSC_AVVIE | OTGSC_IDIE | OTGSC_IDPU;
1672 writel(val32, langwell->regs + CI_OTGSC);
1673
1674 retval = device_create_file(&pdev->dev, &dev_attr_registers);
1675 if (retval < 0) {
1676 otg_dbg("Can't register sysfs attribute: %d\n", retval);
1677 goto err;
1678 }
1679
1680 retval = device_create_file(&pdev->dev, &dev_attr_hsm);
1681 if (retval < 0) {
1682 otg_dbg("Can't hsm sysfs attribute: %d\n", retval);
1683 goto err;
1684 }
1685
1686 retval = sysfs_create_group(&pdev->dev.kobj, &debug_dev_attr_group);
1687 if (retval < 0) {
1688 otg_dbg("Can't register sysfs attr group: %d\n", retval);
1689 goto err;
1690 }
1691
1692 if (langwell->otg.state == OTG_STATE_A_IDLE)
1693 queue_work(langwell->qwork, &langwell->work);
1694
1695 return 0;
1696
1697err:
1698 if (the_transceiver)
1699 langwell_otg_remove(pdev);
1700done:
1701 return retval;
1702}
1703
1704static void langwell_otg_remove(struct pci_dev *pdev)
1705{
1706 struct langwell_otg *langwell;
1707
1708 langwell = the_transceiver;
1709
1710 if (langwell->qwork) {
1711 flush_workqueue(langwell->qwork);
1712 destroy_workqueue(langwell->qwork);
1713 }
1714 langwell_otg_free_timers();
1715
1716 /* disable OTGSC interrupt as OTGSC doesn't change in reset */
1717 writel(0, langwell->regs + CI_OTGSC);
1718
1719 if (pdev->irq)
1720 free_irq(pdev->irq, langwell);
1721 if (langwell->regs)
1722 iounmap(langwell->regs);
1723 if (langwell->region)
1724 release_mem_region(pci_resource_start(pdev, 0),
1725 pci_resource_len(pdev, 0));
1726
1727 otg_set_transceiver(NULL);
1728 pci_disable_device(pdev);
1729 sysfs_remove_group(&pdev->dev.kobj, &debug_dev_attr_group);
1730 device_remove_file(&pdev->dev, &dev_attr_hsm);
1731 device_remove_file(&pdev->dev, &dev_attr_registers);
1732 kfree(langwell);
1733 langwell = NULL;
1734}
1735
1736static void transceiver_suspend(struct pci_dev *pdev)
1737{
1738 pci_save_state(pdev);
1739 pci_set_power_state(pdev, PCI_D3hot);
1740 langwell_otg_phy_low_power(1);
1741}
1742
1743static int langwell_otg_suspend(struct pci_dev *pdev, pm_message_t message)
1744{
1745 int ret = 0;
1746 struct langwell_otg *langwell;
1747
1748 langwell = the_transceiver;
1749
1750 /* Disbale OTG interrupts */
1751 langwell_otg_intr(0);
1752
1753 if (pdev->irq)
1754 free_irq(pdev->irq, langwell);
1755
1756 /* Prevent more otg_work */
1757 flush_workqueue(langwell->qwork);
1758 spin_lock(&langwell->wq_lock);
1759
1760 /* start actions */
1761 switch (langwell->otg.state) {
1762 case OTG_STATE_A_IDLE:
1763 case OTG_STATE_B_IDLE:
1764 case OTG_STATE_A_WAIT_VFALL:
1765 case OTG_STATE_A_VBUS_ERR:
1766 transceiver_suspend(pdev);
1767 break;
1768 case OTG_STATE_A_WAIT_VRISE:
1769 langwell_otg_del_timer(a_wait_vrise_tmr);
1770 langwell->hsm.a_srp_det = 0;
1771 langwell_otg_drv_vbus(0);
1772 langwell->otg.state = OTG_STATE_A_IDLE;
1773 transceiver_suspend(pdev);
1774 break;
1775 case OTG_STATE_A_WAIT_BCON:
1776 langwell_otg_del_timer(a_wait_bcon_tmr);
1777 if (langwell->host_ops)
1778 ret = langwell->host_ops->suspend(pdev, message);
1779 langwell_otg_drv_vbus(0);
1780 break;
1781 case OTG_STATE_A_HOST:
1782 if (langwell->host_ops)
1783 ret = langwell->host_ops->suspend(pdev, message);
1784 langwell_otg_drv_vbus(0);
1785 langwell_otg_phy_low_power(1);
1786 break;
1787 case OTG_STATE_A_SUSPEND:
1788 langwell_otg_del_timer(a_aidl_bdis_tmr);
1789 langwell_otg_HABA(0);
1790 if (langwell->host_ops)
1791 langwell->host_ops->remove(pdev);
1792 else
1793 otg_dbg("host driver has been removed.\n");
1794 langwell_otg_drv_vbus(0);
1795 transceiver_suspend(pdev);
1796 langwell->otg.state = OTG_STATE_A_WAIT_VFALL;
1797 break;
1798 case OTG_STATE_A_PERIPHERAL:
1799 if (langwell->client_ops)
1800 ret = langwell->client_ops->suspend(pdev, message);
1801 else
1802 otg_dbg("client driver has been removed.\n");
1803 langwell_otg_drv_vbus(0);
1804 transceiver_suspend(pdev);
1805 langwell->otg.state = OTG_STATE_A_WAIT_VFALL;
1806 break;
1807 case OTG_STATE_B_HOST:
1808 if (langwell->host_ops)
1809 langwell->host_ops->remove(pdev);
1810 else
1811 otg_dbg("host driver has been removed.\n");
1812 langwell->hsm.b_bus_req = 0;
1813 transceiver_suspend(pdev);
1814 langwell->otg.state = OTG_STATE_B_IDLE;
1815 break;
1816 case OTG_STATE_B_PERIPHERAL:
1817 if (langwell->client_ops)
1818 ret = langwell->client_ops->suspend(pdev, message);
1819 else
1820 otg_dbg("client driver has been removed.\n");
1821 break;
1822 case OTG_STATE_B_WAIT_ACON:
1823 langwell_otg_del_timer(b_ase0_brst_tmr);
1824 langwell_otg_HAAR(0);
1825 if (langwell->host_ops)
1826 langwell->host_ops->remove(pdev);
1827 else
1828 otg_dbg("host driver has been removed.\n");
1829 langwell->hsm.b_bus_req = 0;
1830 langwell->otg.state = OTG_STATE_B_IDLE;
1831 transceiver_suspend(pdev);
1832 break;
1833 default:
1834 otg_dbg("error state before suspend\n ");
1835 break;
1836 }
1837 spin_unlock(&langwell->wq_lock);
1838
1839 return ret;
1840}
1841
1842static void transceiver_resume(struct pci_dev *pdev)
1843{
1844 pci_restore_state(pdev);
1845 pci_set_power_state(pdev, PCI_D0);
1846 langwell_otg_phy_low_power(0);
1847}
1848
1849static int langwell_otg_resume(struct pci_dev *pdev)
1850{
1851 int ret = 0;
1852 struct langwell_otg *langwell;
1853
1854 langwell = the_transceiver;
1855
1856 spin_lock(&langwell->wq_lock);
1857
1858 switch (langwell->otg.state) {
1859 case OTG_STATE_A_IDLE:
1860 case OTG_STATE_B_IDLE:
1861 case OTG_STATE_A_WAIT_VFALL:
1862 case OTG_STATE_A_VBUS_ERR:
1863 transceiver_resume(pdev);
1864 break;
1865 case OTG_STATE_A_WAIT_BCON:
1866 langwell_otg_add_timer(a_wait_bcon_tmr);
1867 langwell_otg_drv_vbus(1);
1868 if (langwell->host_ops)
1869 ret = langwell->host_ops->resume(pdev);
1870 break;
1871 case OTG_STATE_A_HOST:
1872 langwell_otg_drv_vbus(1);
1873 langwell_otg_phy_low_power(0);
1874 if (langwell->host_ops)
1875 ret = langwell->host_ops->resume(pdev);
1876 break;
1877 case OTG_STATE_B_PERIPHERAL:
1878 if (langwell->client_ops)
1879 ret = langwell->client_ops->resume(pdev);
1880 else
1881 otg_dbg("client driver not loaded.\n");
1882 break;
1883 default:
1884 otg_dbg("error state before suspend\n ");
1885 break;
1886 }
1887
1888 if (request_irq(pdev->irq, otg_irq, IRQF_SHARED,
1889 driver_name, the_transceiver) != 0) {
1890 otg_dbg("request interrupt %d failed\n", pdev->irq);
1891 ret = -EBUSY;
1892 }
1893
1894 /* enable OTG interrupts */
1895 langwell_otg_intr(1);
1896
1897 spin_unlock(&langwell->wq_lock);
1898
1899 queue_work(langwell->qwork, &langwell->work);
1900
1901
1902 return ret;
1903}
1904
1905static int __init langwell_otg_init(void)
1906{
1907 return pci_register_driver(&otg_pci_driver);
1908}
1909module_init(langwell_otg_init);
1910
1911static void __exit langwell_otg_cleanup(void)
1912{
1913 pci_unregister_driver(&otg_pci_driver);
1914}
1915module_exit(langwell_otg_cleanup);
diff --git a/drivers/usb/otg/nop-usb-xceiv.c b/drivers/usb/otg/nop-usb-xceiv.c
index 9ed5ea568679..af456b48985f 100644
--- a/drivers/usb/otg/nop-usb-xceiv.c
+++ b/drivers/usb/otg/nop-usb-xceiv.c
@@ -53,6 +53,7 @@ EXPORT_SYMBOL(usb_nop_xceiv_register);
53void usb_nop_xceiv_unregister(void) 53void usb_nop_xceiv_unregister(void)
54{ 54{
55 platform_device_unregister(pd); 55 platform_device_unregister(pd);
56 pd = NULL;
56} 57}
57EXPORT_SYMBOL(usb_nop_xceiv_unregister); 58EXPORT_SYMBOL(usb_nop_xceiv_unregister);
58 59
diff --git a/drivers/usb/serial/console.c b/drivers/usb/serial/console.c
index 247b61bfb7f4..0e4f2e41ace5 100644
--- a/drivers/usb/serial/console.c
+++ b/drivers/usb/serial/console.c
@@ -169,9 +169,11 @@ static int usb_console_setup(struct console *co, char *options)
169 kfree(tty); 169 kfree(tty);
170 } 170 }
171 } 171 }
172 /* So we know not to kill the hardware on a hangup on this 172 /* Now that any required fake tty operations are completed restore
173 port. We have also bumped the use count by one so it won't go 173 * the tty port count */
174 idle */ 174 --port->port.count;
175 /* The console is special in terms of closing the device so
176 * indicate this port is now acting as a system console. */
175 port->console = 1; 177 port->console = 1;
176 retval = 0; 178 retval = 0;
177 179
@@ -204,7 +206,7 @@ static void usb_console_write(struct console *co,
204 206
205 dbg("%s - port %d, %d byte(s)", __func__, port->number, count); 207 dbg("%s - port %d, %d byte(s)", __func__, port->number, count);
206 208
207 if (!port->port.count) { 209 if (!port->console) {
208 dbg("%s - port not opened", __func__); 210 dbg("%s - port not opened", __func__);
209 return; 211 return;
210 } 212 }
@@ -300,8 +302,7 @@ void usb_serial_console_exit(void)
300{ 302{
301 if (usbcons_info.port) { 303 if (usbcons_info.port) {
302 unregister_console(&usbcons); 304 unregister_console(&usbcons);
303 if (usbcons_info.port->port.count) 305 usbcons_info.port->console = 0;
304 usbcons_info.port->port.count--;
305 usbcons_info.port = NULL; 306 usbcons_info.port = NULL;
306 } 307 }
307} 308}
diff --git a/drivers/usb/serial/cp210x.c b/drivers/usb/serial/cp210x.c
index 2b9eeda62bfe..985cbcf48bda 100644
--- a/drivers/usb/serial/cp210x.c
+++ b/drivers/usb/serial/cp210x.c
@@ -67,6 +67,8 @@ static struct usb_device_id id_table [] = {
67 { USB_DEVICE(0x10AB, 0x10C5) }, /* Siemens MC60 Cable */ 67 { USB_DEVICE(0x10AB, 0x10C5) }, /* Siemens MC60 Cable */
68 { USB_DEVICE(0x10B5, 0xAC70) }, /* Nokia CA-42 USB */ 68 { USB_DEVICE(0x10B5, 0xAC70) }, /* Nokia CA-42 USB */
69 { USB_DEVICE(0x10C4, 0x0F91) }, /* Vstabi */ 69 { USB_DEVICE(0x10C4, 0x0F91) }, /* Vstabi */
70 { USB_DEVICE(0x10C4, 0x1101) }, /* Arkham Technology DS101 Bus Monitor */
71 { USB_DEVICE(0x10C4, 0x1601) }, /* Arkham Technology DS101 Adapter */
70 { USB_DEVICE(0x10C4, 0x800A) }, /* SPORTident BSM7-D-USB main station */ 72 { USB_DEVICE(0x10C4, 0x800A) }, /* SPORTident BSM7-D-USB main station */
71 { USB_DEVICE(0x10C4, 0x803B) }, /* Pololu USB-serial converter */ 73 { USB_DEVICE(0x10C4, 0x803B) }, /* Pololu USB-serial converter */
72 { USB_DEVICE(0x10C4, 0x8053) }, /* Enfora EDG1228 */ 74 { USB_DEVICE(0x10C4, 0x8053) }, /* Enfora EDG1228 */
@@ -78,6 +80,7 @@ static struct usb_device_id id_table [] = {
78 { USB_DEVICE(0x10C4, 0x80F6) }, /* Suunto sports instrument */ 80 { USB_DEVICE(0x10C4, 0x80F6) }, /* Suunto sports instrument */
79 { USB_DEVICE(0x10C4, 0x8115) }, /* Arygon NFC/Mifare Reader */ 81 { USB_DEVICE(0x10C4, 0x8115) }, /* Arygon NFC/Mifare Reader */
80 { USB_DEVICE(0x10C4, 0x813D) }, /* Burnside Telecom Deskmobile */ 82 { USB_DEVICE(0x10C4, 0x813D) }, /* Burnside Telecom Deskmobile */
83 { USB_DEVICE(0x10C4, 0x813F) }, /* Tams Master Easy Control */
81 { USB_DEVICE(0x10C4, 0x814A) }, /* West Mountain Radio RIGblaster P&P */ 84 { USB_DEVICE(0x10C4, 0x814A) }, /* West Mountain Radio RIGblaster P&P */
82 { USB_DEVICE(0x10C4, 0x814B) }, /* West Mountain Radio RIGtalk */ 85 { USB_DEVICE(0x10C4, 0x814B) }, /* West Mountain Radio RIGtalk */
83 { USB_DEVICE(0x10C4, 0x815E) }, /* Helicomm IP-Link 1220-DVM */ 86 { USB_DEVICE(0x10C4, 0x815E) }, /* Helicomm IP-Link 1220-DVM */
@@ -94,7 +97,9 @@ static struct usb_device_id id_table [] = {
94 { USB_DEVICE(0x10c4, 0x8293) }, /* Telegesys ETRX2USB */ 97 { USB_DEVICE(0x10c4, 0x8293) }, /* Telegesys ETRX2USB */
95 { USB_DEVICE(0x10C4, 0x82F9) }, /* Procyon AVS */ 98 { USB_DEVICE(0x10C4, 0x82F9) }, /* Procyon AVS */
96 { USB_DEVICE(0x10C4, 0x8341) }, /* Siemens MC35PU GPRS Modem */ 99 { USB_DEVICE(0x10C4, 0x8341) }, /* Siemens MC35PU GPRS Modem */
100 { USB_DEVICE(0x10C4, 0x8382) }, /* Cygnal Integrated Products, Inc. */
97 { USB_DEVICE(0x10C4, 0x83A8) }, /* Amber Wireless AMB2560 */ 101 { USB_DEVICE(0x10C4, 0x83A8) }, /* Amber Wireless AMB2560 */
102 { USB_DEVICE(0x10C4, 0x8411) }, /* Kyocera GPS Module */
98 { USB_DEVICE(0x10C4, 0x846E) }, /* BEI USB Sensor Interface (VCP) */ 103 { USB_DEVICE(0x10C4, 0x846E) }, /* BEI USB Sensor Interface (VCP) */
99 { USB_DEVICE(0x10C4, 0xEA60) }, /* Silicon Labs factory default */ 104 { USB_DEVICE(0x10C4, 0xEA60) }, /* Silicon Labs factory default */
100 { USB_DEVICE(0x10C4, 0xEA61) }, /* Silicon Labs factory default */ 105 { USB_DEVICE(0x10C4, 0xEA61) }, /* Silicon Labs factory default */
diff --git a/drivers/usb/serial/cypress_m8.c b/drivers/usb/serial/cypress_m8.c
index 9734085fd2fe..59adfe123110 100644
--- a/drivers/usb/serial/cypress_m8.c
+++ b/drivers/usb/serial/cypress_m8.c
@@ -1228,8 +1228,8 @@ static void cypress_read_int_callback(struct urb *urb)
1228 /* precursor to disconnect so just go away */ 1228 /* precursor to disconnect so just go away */
1229 return; 1229 return;
1230 case -EPIPE: 1230 case -EPIPE:
1231 usb_clear_halt(port->serial->dev, 0x81); 1231 /* Can't call usb_clear_halt while in_interrupt */
1232 break; 1232 /* FALLS THROUGH */
1233 default: 1233 default:
1234 /* something ugly is going on... */ 1234 /* something ugly is going on... */
1235 dev_err(&urb->dev->dev, 1235 dev_err(&urb->dev->dev,
diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c
index 3dc3768ca71c..8fec5d4455c9 100644
--- a/drivers/usb/serial/ftdi_sio.c
+++ b/drivers/usb/serial/ftdi_sio.c
@@ -33,6 +33,7 @@
33#include <linux/errno.h> 33#include <linux/errno.h>
34#include <linux/init.h> 34#include <linux/init.h>
35#include <linux/slab.h> 35#include <linux/slab.h>
36#include <linux/smp_lock.h>
36#include <linux/tty.h> 37#include <linux/tty.h>
37#include <linux/tty_driver.h> 38#include <linux/tty_driver.h>
38#include <linux/tty_flip.h> 39#include <linux/tty_flip.h>
@@ -107,6 +108,7 @@ struct ftdi_sio_quirk {
107 108
108static int ftdi_jtag_probe(struct usb_serial *serial); 109static int ftdi_jtag_probe(struct usb_serial *serial);
109static int ftdi_mtxorb_hack_setup(struct usb_serial *serial); 110static int ftdi_mtxorb_hack_setup(struct usb_serial *serial);
111static int ftdi_NDI_device_setup(struct usb_serial *serial);
110static void ftdi_USB_UIRT_setup(struct ftdi_private *priv); 112static void ftdi_USB_UIRT_setup(struct ftdi_private *priv);
111static void ftdi_HE_TIRA1_setup(struct ftdi_private *priv); 113static void ftdi_HE_TIRA1_setup(struct ftdi_private *priv);
112 114
@@ -118,6 +120,10 @@ static struct ftdi_sio_quirk ftdi_mtxorb_hack_quirk = {
118 .probe = ftdi_mtxorb_hack_setup, 120 .probe = ftdi_mtxorb_hack_setup,
119}; 121};
120 122
123static struct ftdi_sio_quirk ftdi_NDI_device_quirk = {
124 .probe = ftdi_NDI_device_setup,
125};
126
121static struct ftdi_sio_quirk ftdi_USB_UIRT_quirk = { 127static struct ftdi_sio_quirk ftdi_USB_UIRT_quirk = {
122 .port_probe = ftdi_USB_UIRT_setup, 128 .port_probe = ftdi_USB_UIRT_setup,
123}; 129};
@@ -191,6 +197,7 @@ static struct usb_device_id id_table_combined [] = {
191 { USB_DEVICE(FTDI_VID, FTDI_MTXORB_4_PID) }, 197 { USB_DEVICE(FTDI_VID, FTDI_MTXORB_4_PID) },
192 { USB_DEVICE(FTDI_VID, FTDI_MTXORB_5_PID) }, 198 { USB_DEVICE(FTDI_VID, FTDI_MTXORB_5_PID) },
193 { USB_DEVICE(FTDI_VID, FTDI_MTXORB_6_PID) }, 199 { USB_DEVICE(FTDI_VID, FTDI_MTXORB_6_PID) },
200 { USB_DEVICE(FTDI_VID, FTDI_R2000KU_TRUE_RNG) },
194 { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0100_PID) }, 201 { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0100_PID) },
195 { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0101_PID) }, 202 { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0101_PID) },
196 { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0102_PID) }, 203 { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0102_PID) },
@@ -579,6 +586,9 @@ static struct usb_device_id id_table_combined [] = {
579 { USB_DEVICE(FTDI_VID, FTDI_CCSICDU20_0_PID) }, 586 { USB_DEVICE(FTDI_VID, FTDI_CCSICDU20_0_PID) },
580 { USB_DEVICE(FTDI_VID, FTDI_CCSICDU40_1_PID) }, 587 { USB_DEVICE(FTDI_VID, FTDI_CCSICDU40_1_PID) },
581 { USB_DEVICE(FTDI_VID, FTDI_CCSMACHX_2_PID) }, 588 { USB_DEVICE(FTDI_VID, FTDI_CCSMACHX_2_PID) },
589 { USB_DEVICE(FTDI_VID, FTDI_CCSLOAD_N_GO_3_PID) },
590 { USB_DEVICE(FTDI_VID, FTDI_CCSICDU64_4_PID) },
591 { USB_DEVICE(FTDI_VID, FTDI_CCSPRIME8_5_PID) },
582 { USB_DEVICE(FTDI_VID, INSIDE_ACCESSO) }, 592 { USB_DEVICE(FTDI_VID, INSIDE_ACCESSO) },
583 { USB_DEVICE(INTREPID_VID, INTREPID_VALUECAN_PID) }, 593 { USB_DEVICE(INTREPID_VID, INTREPID_VALUECAN_PID) },
584 { USB_DEVICE(INTREPID_VID, INTREPID_NEOVI_PID) }, 594 { USB_DEVICE(INTREPID_VID, INTREPID_NEOVI_PID) },
@@ -644,6 +654,16 @@ static struct usb_device_id id_table_combined [] = {
644 { USB_DEVICE(FTDI_VID, FTDI_TACTRIX_OPENPORT_13S_PID) }, 654 { USB_DEVICE(FTDI_VID, FTDI_TACTRIX_OPENPORT_13S_PID) },
645 { USB_DEVICE(FTDI_VID, FTDI_TACTRIX_OPENPORT_13U_PID) }, 655 { USB_DEVICE(FTDI_VID, FTDI_TACTRIX_OPENPORT_13U_PID) },
646 { USB_DEVICE(ELEKTOR_VID, ELEKTOR_FT323R_PID) }, 656 { USB_DEVICE(ELEKTOR_VID, ELEKTOR_FT323R_PID) },
657 { USB_DEVICE(FTDI_VID, FTDI_NDI_HUC_PID),
658 .driver_info = (kernel_ulong_t)&ftdi_NDI_device_quirk },
659 { USB_DEVICE(FTDI_VID, FTDI_NDI_SPECTRA_SCU_PID),
660 .driver_info = (kernel_ulong_t)&ftdi_NDI_device_quirk },
661 { USB_DEVICE(FTDI_VID, FTDI_NDI_FUTURE_2_PID),
662 .driver_info = (kernel_ulong_t)&ftdi_NDI_device_quirk },
663 { USB_DEVICE(FTDI_VID, FTDI_NDI_FUTURE_3_PID),
664 .driver_info = (kernel_ulong_t)&ftdi_NDI_device_quirk },
665 { USB_DEVICE(FTDI_VID, FTDI_NDI_AURORA_SCU_PID),
666 .driver_info = (kernel_ulong_t)&ftdi_NDI_device_quirk },
647 { USB_DEVICE(TELLDUS_VID, TELLDUS_TELLSTICK_PID) }, 667 { USB_DEVICE(TELLDUS_VID, TELLDUS_TELLSTICK_PID) },
648 { USB_DEVICE(FTDI_VID, FTDI_MAXSTREAM_PID) }, 668 { USB_DEVICE(FTDI_VID, FTDI_MAXSTREAM_PID) },
649 { USB_DEVICE(FTDI_VID, FTDI_PHI_FISCO_PID) }, 669 { USB_DEVICE(FTDI_VID, FTDI_PHI_FISCO_PID) },
@@ -660,6 +680,8 @@ static struct usb_device_id id_table_combined [] = {
660 .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, 680 .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk },
661 { USB_DEVICE(FTDI_VID, LMI_LM3S_EVAL_BOARD_PID), 681 { USB_DEVICE(FTDI_VID, LMI_LM3S_EVAL_BOARD_PID),
662 .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, 682 .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk },
683 { USB_DEVICE(FTDI_VID, FTDI_TURTELIZER_PID),
684 .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk },
663 { USB_DEVICE(RATOC_VENDOR_ID, RATOC_PRODUCT_ID_USB60F) }, 685 { USB_DEVICE(RATOC_VENDOR_ID, RATOC_PRODUCT_ID_USB60F) },
664 { USB_DEVICE(FTDI_VID, FTDI_REU_TINY_PID) }, 686 { USB_DEVICE(FTDI_VID, FTDI_REU_TINY_PID) },
665 { USB_DEVICE(PAPOUCH_VID, PAPOUCH_QUIDO4x4_PID) }, 687 { USB_DEVICE(PAPOUCH_VID, PAPOUCH_QUIDO4x4_PID) },
@@ -667,7 +689,6 @@ static struct usb_device_id id_table_combined [] = {
667 { USB_DEVICE(FTDI_VID, FTDI_DOMINTELL_DUSB_PID) }, 689 { USB_DEVICE(FTDI_VID, FTDI_DOMINTELL_DUSB_PID) },
668 { USB_DEVICE(ALTI2_VID, ALTI2_N3_PID) }, 690 { USB_DEVICE(ALTI2_VID, ALTI2_N3_PID) },
669 { USB_DEVICE(FTDI_VID, DIEBOLD_BCS_SE923_PID) }, 691 { USB_DEVICE(FTDI_VID, DIEBOLD_BCS_SE923_PID) },
670 { USB_DEVICE(FTDI_VID, FTDI_NDI_HUC_PID) },
671 { USB_DEVICE(ATMEL_VID, STK541_PID) }, 692 { USB_DEVICE(ATMEL_VID, STK541_PID) },
672 { USB_DEVICE(DE_VID, STB_PID) }, 693 { USB_DEVICE(DE_VID, STB_PID) },
673 { USB_DEVICE(DE_VID, WHT_PID) }, 694 { USB_DEVICE(DE_VID, WHT_PID) },
@@ -677,6 +698,10 @@ static struct usb_device_id id_table_combined [] = {
677 { USB_DEVICE(MARVELL_VID, MARVELL_SHEEVAPLUG_PID), 698 { USB_DEVICE(MARVELL_VID, MARVELL_SHEEVAPLUG_PID),
678 .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, 699 .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk },
679 { USB_DEVICE(LARSENBRUSGAARD_VID, LB_ALTITRACK_PID) }, 700 { USB_DEVICE(LARSENBRUSGAARD_VID, LB_ALTITRACK_PID) },
701 { USB_DEVICE(GN_OTOMETRICS_VID, AURICAL_USB_PID) },
702 { USB_DEVICE(BAYER_VID, BAYER_CONTOUR_CABLE_PID) },
703 { USB_DEVICE(FTDI_VID, MARVELL_OPENRD_PID),
704 .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk },
680 { }, /* Optional parameter entry */ 705 { }, /* Optional parameter entry */
681 { } /* Terminating entry */ 706 { } /* Terminating entry */
682}; 707};
@@ -1023,6 +1048,16 @@ static __u32 get_ftdi_divisor(struct tty_struct *tty,
1023 case FT2232C: /* FT2232C chip */ 1048 case FT2232C: /* FT2232C chip */
1024 case FT232RL: 1049 case FT232RL:
1025 if (baud <= 3000000) { 1050 if (baud <= 3000000) {
1051 __u16 product_id = le16_to_cpu(
1052 port->serial->dev->descriptor.idProduct);
1053 if (((FTDI_NDI_HUC_PID == product_id) ||
1054 (FTDI_NDI_SPECTRA_SCU_PID == product_id) ||
1055 (FTDI_NDI_FUTURE_2_PID == product_id) ||
1056 (FTDI_NDI_FUTURE_3_PID == product_id) ||
1057 (FTDI_NDI_AURORA_SCU_PID == product_id)) &&
1058 (baud == 19200)) {
1059 baud = 1200000;
1060 }
1026 div_value = ftdi_232bm_baud_to_divisor(baud); 1061 div_value = ftdi_232bm_baud_to_divisor(baud);
1027 } else { 1062 } else {
1028 dbg("%s - Baud rate too high!", __func__); 1063 dbg("%s - Baud rate too high!", __func__);
@@ -1554,6 +1589,39 @@ static void ftdi_HE_TIRA1_setup(struct ftdi_private *priv)
1554} /* ftdi_HE_TIRA1_setup */ 1589} /* ftdi_HE_TIRA1_setup */
1555 1590
1556/* 1591/*
1592 * Module parameter to control latency timer for NDI FTDI-based USB devices.
1593 * If this value is not set in modprobe.conf.local its value will be set to 1ms.
1594 */
1595static int ndi_latency_timer = 1;
1596
1597/* Setup for the NDI FTDI-based USB devices, which requires hardwired
1598 * baudrate (19200 gets mapped to 1200000).
1599 *
1600 * Called from usbserial:serial_probe.
1601 */
1602static int ftdi_NDI_device_setup(struct usb_serial *serial)
1603{
1604 struct usb_device *udev = serial->dev;
1605 int latency = ndi_latency_timer;
1606 int rv = 0;
1607 char buf[1];
1608
1609 if (latency == 0)
1610 latency = 1;
1611 if (latency > 99)
1612 latency = 99;
1613
1614 dbg("%s setting NDI device latency to %d", __func__, latency);
1615 dev_info(&udev->dev, "NDI device with a latency value of %d", latency);
1616
1617 rv = usb_control_msg(udev, usb_sndctrlpipe(udev, 0),
1618 FTDI_SIO_SET_LATENCY_TIMER_REQUEST,
1619 FTDI_SIO_SET_LATENCY_TIMER_REQUEST_TYPE,
1620 latency, 0, buf, 0, WDR_TIMEOUT);
1621 return 0;
1622}
1623
1624/*
1557 * First port on JTAG adaptors such as Olimex arm-usb-ocd or the FIC/OpenMoko 1625 * First port on JTAG adaptors such as Olimex arm-usb-ocd or the FIC/OpenMoko
1558 * Neo1973 Debug Board is reserved for JTAG interface and can be accessed from 1626 * Neo1973 Debug Board is reserved for JTAG interface and can be accessed from
1559 * userspace using openocd. 1627 * userspace using openocd.
@@ -2121,7 +2189,7 @@ static void ftdi_process_read(struct work_struct *work)
2121 /* Note that the error flag is duplicated for 2189 /* Note that the error flag is duplicated for
2122 every character received since we don't know 2190 every character received since we don't know
2123 which character it applied to */ 2191 which character it applied to */
2124 if (!usb_serial_handle_sysrq_char(port, 2192 if (!usb_serial_handle_sysrq_char(tty, port,
2125 data[packet_offset + i])) 2193 data[packet_offset + i]))
2126 tty_insert_flip_char(tty, 2194 tty_insert_flip_char(tty,
2127 data[packet_offset + i], 2195 data[packet_offset + i],
@@ -2622,3 +2690,5 @@ MODULE_PARM_DESC(vendor, "User specified vendor ID (default="
2622module_param(product, ushort, 0); 2690module_param(product, ushort, 0);
2623MODULE_PARM_DESC(product, "User specified product ID"); 2691MODULE_PARM_DESC(product, "User specified product ID");
2624 2692
2693module_param(ndi_latency_timer, int, S_IRUGO | S_IWUSR);
2694MODULE_PARM_DESC(ndi_latency_timer, "NDI device latency timer override");
diff --git a/drivers/usb/serial/ftdi_sio.h b/drivers/usb/serial/ftdi_sio.h
index f1d440a728a3..8c92b88166ae 100644
--- a/drivers/usb/serial/ftdi_sio.h
+++ b/drivers/usb/serial/ftdi_sio.h
@@ -506,6 +506,7 @@
506 * 506 *
507 * Armin Laeuger originally sent the PID for the UM 100 module. 507 * Armin Laeuger originally sent the PID for the UM 100 module.
508 */ 508 */
509#define FTDI_R2000KU_TRUE_RNG 0xFB80 /* R2000KU TRUE RNG */
509#define FTDI_ELV_UR100_PID 0xFB58 /* USB-RS232-Umsetzer (UR 100) */ 510#define FTDI_ELV_UR100_PID 0xFB58 /* USB-RS232-Umsetzer (UR 100) */
510#define FTDI_ELV_UM100_PID 0xFB5A /* USB-Modul UM 100 */ 511#define FTDI_ELV_UM100_PID 0xFB5A /* USB-Modul UM 100 */
511#define FTDI_ELV_UO100_PID 0xFB5B /* USB-Modul UO 100 */ 512#define FTDI_ELV_UO100_PID 0xFB5B /* USB-Modul UO 100 */
@@ -614,6 +615,9 @@
614#define FTDI_CCSICDU20_0_PID 0xF9D0 615#define FTDI_CCSICDU20_0_PID 0xF9D0
615#define FTDI_CCSICDU40_1_PID 0xF9D1 616#define FTDI_CCSICDU40_1_PID 0xF9D1
616#define FTDI_CCSMACHX_2_PID 0xF9D2 617#define FTDI_CCSMACHX_2_PID 0xF9D2
618#define FTDI_CCSLOAD_N_GO_3_PID 0xF9D3
619#define FTDI_CCSICDU64_4_PID 0xF9D4
620#define FTDI_CCSPRIME8_5_PID 0xF9D5
617 621
618/* Inside Accesso contactless reader (http://www.insidefr.com) */ 622/* Inside Accesso contactless reader (http://www.insidefr.com) */
619#define INSIDE_ACCESSO 0xFAD0 623#define INSIDE_ACCESSO 0xFAD0
@@ -736,6 +740,15 @@
736#define FTDI_PYRAMID_PID 0xE6C8 /* Pyramid Appliance Display */ 740#define FTDI_PYRAMID_PID 0xE6C8 /* Pyramid Appliance Display */
737 741
738/* 742/*
743 * NDI (www.ndigital.com) product ids
744 */
745#define FTDI_NDI_HUC_PID 0xDA70 /* NDI Host USB Converter */
746#define FTDI_NDI_SPECTRA_SCU_PID 0xDA71 /* NDI Spectra SCU */
747#define FTDI_NDI_FUTURE_2_PID 0xDA72 /* NDI future device #2 */
748#define FTDI_NDI_FUTURE_3_PID 0xDA73 /* NDI future device #3 */
749#define FTDI_NDI_AURORA_SCU_PID 0xDA74 /* NDI Aurora SCU */
750
751/*
739 * Posiflex inc retail equipment (http://www.posiflex.com.tw) 752 * Posiflex inc retail equipment (http://www.posiflex.com.tw)
740 */ 753 */
741#define POSIFLEX_VID 0x0d3a /* Vendor ID */ 754#define POSIFLEX_VID 0x0d3a /* Vendor ID */
@@ -848,9 +861,6 @@
848#define TML_VID 0x1B91 /* Vendor ID */ 861#define TML_VID 0x1B91 /* Vendor ID */
849#define TML_USB_SERIAL_PID 0x0064 /* USB - Serial Converter */ 862#define TML_USB_SERIAL_PID 0x0064 /* USB - Serial Converter */
850 863
851/* NDI Polaris System */
852#define FTDI_NDI_HUC_PID 0xDA70
853
854/* Propox devices */ 864/* Propox devices */
855#define FTDI_PROPOX_JTAGCABLEII_PID 0xD738 865#define FTDI_PROPOX_JTAGCABLEII_PID 0xD738
856 866
@@ -934,6 +944,29 @@
934#define MARVELL_VID 0x9e88 944#define MARVELL_VID 0x9e88
935#define MARVELL_SHEEVAPLUG_PID 0x9e8f 945#define MARVELL_SHEEVAPLUG_PID 0x9e8f
936 946
947#define FTDI_TURTELIZER_PID 0xBDC8 /* JTAG/RS-232 adapter by egnite GmBH */
948
949/*
950 * GN Otometrics (http://www.otometrics.com)
951 * Submitted by Ville Sundberg.
952 */
953#define GN_OTOMETRICS_VID 0x0c33 /* Vendor ID */
954#define AURICAL_USB_PID 0x0010 /* Aurical USB Audiometer */
955
956/*
957 * Bayer Ascensia Contour blood glucose meter USB-converter cable.
958 * http://winglucofacts.com/cables/
959 */
960#define BAYER_VID 0x1A79
961#define BAYER_CONTOUR_CABLE_PID 0x6001
962
963/*
964 * Marvell OpenRD Base, Client
965 * http://www.open-rd.org
966 * OpenRD Base, Client use VID 0x0403
967 */
968#define MARVELL_OPENRD_PID 0x9e90
969
937/* 970/*
938 * BmRequestType: 1100 0000b 971 * BmRequestType: 1100 0000b
939 * bRequest: FTDI_E2_READ 972 * bRequest: FTDI_E2_READ
diff --git a/drivers/usb/serial/generic.c b/drivers/usb/serial/generic.c
index 932d6241b787..ce57f6a32bdf 100644
--- a/drivers/usb/serial/generic.c
+++ b/drivers/usb/serial/generic.c
@@ -424,10 +424,17 @@ static void flush_and_resubmit_read_urb(struct usb_serial_port *port)
424 if (!tty) 424 if (!tty)
425 goto done; 425 goto done;
426 426
427 /* Push data to tty */ 427 /* The per character mucking around with sysrq path it too slow for
428 for (i = 0; i < urb->actual_length; i++, ch++) { 428 stuff like 3G modems, so shortcircuit it in the 99.9999999% of cases
429 if (!usb_serial_handle_sysrq_char(port, *ch)) 429 where the USB serial is not a console anyway */
430 tty_insert_flip_char(tty, *ch, TTY_NORMAL); 430 if (!port->console || !port->sysrq)
431 tty_insert_flip_string(tty, ch, urb->actual_length);
432 else {
433 /* Push data to tty */
434 for (i = 0; i < urb->actual_length; i++, ch++) {
435 if (!usb_serial_handle_sysrq_char(tty, port, *ch))
436 tty_insert_flip_char(tty, *ch, TTY_NORMAL);
437 }
431 } 438 }
432 tty_flip_buffer_push(tty); 439 tty_flip_buffer_push(tty);
433 tty_kref_put(tty); 440 tty_kref_put(tty);
@@ -527,11 +534,12 @@ void usb_serial_generic_unthrottle(struct tty_struct *tty)
527 } 534 }
528} 535}
529 536
530int usb_serial_handle_sysrq_char(struct usb_serial_port *port, unsigned int ch) 537int usb_serial_handle_sysrq_char(struct tty_struct *tty,
538 struct usb_serial_port *port, unsigned int ch)
531{ 539{
532 if (port->sysrq && port->console) { 540 if (port->sysrq && port->console) {
533 if (ch && time_before(jiffies, port->sysrq)) { 541 if (ch && time_before(jiffies, port->sysrq)) {
534 handle_sysrq(ch, tty_port_tty_get(&port->port)); 542 handle_sysrq(ch, tty);
535 port->sysrq = 0; 543 port->sysrq = 0;
536 return 1; 544 return 1;
537 } 545 }
diff --git a/drivers/usb/serial/mos7720.c b/drivers/usb/serial/mos7720.c
index bfc5ce000ef9..ccd4dd340d2c 100644
--- a/drivers/usb/serial/mos7720.c
+++ b/drivers/usb/serial/mos7720.c
@@ -521,7 +521,7 @@ static int mos7720_chars_in_buffer(struct tty_struct *tty)
521 mos7720_port = usb_get_serial_port_data(port); 521 mos7720_port = usb_get_serial_port_data(port);
522 if (mos7720_port == NULL) { 522 if (mos7720_port == NULL) {
523 dbg("%s:leaving ...........", __func__); 523 dbg("%s:leaving ...........", __func__);
524 return -ENODEV; 524 return 0;
525 } 525 }
526 526
527 for (i = 0; i < NUM_URBS; ++i) { 527 for (i = 0; i < NUM_URBS; ++i) {
diff --git a/drivers/usb/serial/mos7840.c b/drivers/usb/serial/mos7840.c
index c40f95c1951c..270009afdf77 100644
--- a/drivers/usb/serial/mos7840.c
+++ b/drivers/usb/serial/mos7840.c
@@ -26,6 +26,7 @@
26#include <linux/errno.h> 26#include <linux/errno.h>
27#include <linux/init.h> 27#include <linux/init.h>
28#include <linux/slab.h> 28#include <linux/slab.h>
29#include <linux/smp_lock.h>
29#include <linux/tty.h> 30#include <linux/tty.h>
30#include <linux/tty_driver.h> 31#include <linux/tty_driver.h>
31#include <linux/tty_flip.h> 32#include <linux/tty_flip.h>
@@ -123,10 +124,13 @@
123#define BANDB_DEVICE_ID_USOPTL4_4 0xAC44 124#define BANDB_DEVICE_ID_USOPTL4_4 0xAC44
124#define BANDB_DEVICE_ID_USOPTL4_2 0xAC42 125#define BANDB_DEVICE_ID_USOPTL4_2 0xAC42
125 126
126/* This driver also supports the ATEN UC2324 device since it is mos7840 based 127/* This driver also supports
127 * - if I knew the device id it would also support the ATEN UC2322 */ 128 * ATEN UC2324 device using Moschip MCS7840
129 * ATEN UC2322 device using Moschip MCS7820
130 */
128#define USB_VENDOR_ID_ATENINTL 0x0557 131#define USB_VENDOR_ID_ATENINTL 0x0557
129#define ATENINTL_DEVICE_ID_UC2324 0x2011 132#define ATENINTL_DEVICE_ID_UC2324 0x2011
133#define ATENINTL_DEVICE_ID_UC2322 0x7820
130 134
131/* Interrupt Routine Defines */ 135/* Interrupt Routine Defines */
132 136
@@ -176,6 +180,7 @@ static struct usb_device_id moschip_port_id_table[] = {
176 {USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_USOPTL4_4)}, 180 {USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_USOPTL4_4)},
177 {USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_USOPTL4_2)}, 181 {USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_USOPTL4_2)},
178 {USB_DEVICE(USB_VENDOR_ID_ATENINTL, ATENINTL_DEVICE_ID_UC2324)}, 182 {USB_DEVICE(USB_VENDOR_ID_ATENINTL, ATENINTL_DEVICE_ID_UC2324)},
183 {USB_DEVICE(USB_VENDOR_ID_ATENINTL, ATENINTL_DEVICE_ID_UC2322)},
179 {} /* terminating entry */ 184 {} /* terminating entry */
180}; 185};
181 186
@@ -185,6 +190,7 @@ static __devinitdata struct usb_device_id moschip_id_table_combined[] = {
185 {USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_USOPTL4_4)}, 190 {USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_USOPTL4_4)},
186 {USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_USOPTL4_2)}, 191 {USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_USOPTL4_2)},
187 {USB_DEVICE(USB_VENDOR_ID_ATENINTL, ATENINTL_DEVICE_ID_UC2324)}, 192 {USB_DEVICE(USB_VENDOR_ID_ATENINTL, ATENINTL_DEVICE_ID_UC2324)},
193 {USB_DEVICE(USB_VENDOR_ID_ATENINTL, ATENINTL_DEVICE_ID_UC2322)},
188 {} /* terminating entry */ 194 {} /* terminating entry */
189}; 195};
190 196
diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c
index 575816e6ba37..c784ddbe7b61 100644
--- a/drivers/usb/serial/option.c
+++ b/drivers/usb/serial/option.c
@@ -66,8 +66,10 @@ static int option_tiocmget(struct tty_struct *tty, struct file *file);
66static int option_tiocmset(struct tty_struct *tty, struct file *file, 66static int option_tiocmset(struct tty_struct *tty, struct file *file,
67 unsigned int set, unsigned int clear); 67 unsigned int set, unsigned int clear);
68static int option_send_setup(struct usb_serial_port *port); 68static int option_send_setup(struct usb_serial_port *port);
69#ifdef CONFIG_PM
69static int option_suspend(struct usb_serial *serial, pm_message_t message); 70static int option_suspend(struct usb_serial *serial, pm_message_t message);
70static int option_resume(struct usb_serial *serial); 71static int option_resume(struct usb_serial *serial);
72#endif
71 73
72/* Vendor and product IDs */ 74/* Vendor and product IDs */
73#define OPTION_VENDOR_ID 0x0AF0 75#define OPTION_VENDOR_ID 0x0AF0
@@ -205,7 +207,9 @@ static int option_resume(struct usb_serial *serial);
205#define NOVATELWIRELESS_PRODUCT_MC727 0x4100 207#define NOVATELWIRELESS_PRODUCT_MC727 0x4100
206#define NOVATELWIRELESS_PRODUCT_MC950D 0x4400 208#define NOVATELWIRELESS_PRODUCT_MC950D 0x4400
207#define NOVATELWIRELESS_PRODUCT_U727 0x5010 209#define NOVATELWIRELESS_PRODUCT_U727 0x5010
210#define NOVATELWIRELESS_PRODUCT_MC727_NEW 0x5100
208#define NOVATELWIRELESS_PRODUCT_MC760 0x6000 211#define NOVATELWIRELESS_PRODUCT_MC760 0x6000
212#define NOVATELWIRELESS_PRODUCT_OVMC760 0x6002
209 213
210/* FUTURE NOVATEL PRODUCTS */ 214/* FUTURE NOVATEL PRODUCTS */
211#define NOVATELWIRELESS_PRODUCT_EVDO_HIGHSPEED 0X6001 215#define NOVATELWIRELESS_PRODUCT_EVDO_HIGHSPEED 0X6001
@@ -258,11 +262,6 @@ static int option_resume(struct usb_serial *serial);
258#define AXESSTEL_VENDOR_ID 0x1726 262#define AXESSTEL_VENDOR_ID 0x1726
259#define AXESSTEL_PRODUCT_MV110H 0x1000 263#define AXESSTEL_PRODUCT_MV110H 0x1000
260 264
261#define ONDA_VENDOR_ID 0x19d2
262#define ONDA_PRODUCT_MSA501HS 0x0001
263#define ONDA_PRODUCT_ET502HS 0x0002
264#define ONDA_PRODUCT_MT503HS 0x2000
265
266#define BANDRICH_VENDOR_ID 0x1A8D 265#define BANDRICH_VENDOR_ID 0x1A8D
267#define BANDRICH_PRODUCT_C100_1 0x1002 266#define BANDRICH_PRODUCT_C100_1 0x1002
268#define BANDRICH_PRODUCT_C100_2 0x1003 267#define BANDRICH_PRODUCT_C100_2 0x1003
@@ -300,6 +299,7 @@ static int option_resume(struct usb_serial *serial);
300#define ZTE_PRODUCT_MF628 0x0015 299#define ZTE_PRODUCT_MF628 0x0015
301#define ZTE_PRODUCT_MF626 0x0031 300#define ZTE_PRODUCT_MF626 0x0031
302#define ZTE_PRODUCT_CDMA_TECH 0xfffe 301#define ZTE_PRODUCT_CDMA_TECH 0xfffe
302#define ZTE_PRODUCT_AC8710 0xfff1
303 303
304#define BENQ_VENDOR_ID 0x04a5 304#define BENQ_VENDOR_ID 0x04a5
305#define BENQ_PRODUCT_H10 0x4068 305#define BENQ_PRODUCT_H10 0x4068
@@ -307,11 +307,25 @@ static int option_resume(struct usb_serial *serial);
307#define DLINK_VENDOR_ID 0x1186 307#define DLINK_VENDOR_ID 0x1186
308#define DLINK_PRODUCT_DWM_652 0x3e04 308#define DLINK_PRODUCT_DWM_652 0x3e04
309 309
310#define QISDA_VENDOR_ID 0x1da5
311#define QISDA_PRODUCT_H21_4512 0x4512
312#define QISDA_PRODUCT_H21_4523 0x4523
313#define QISDA_PRODUCT_H20_4515 0x4515
314#define QISDA_PRODUCT_H20_4519 0x4519
315
310 316
311/* TOSHIBA PRODUCTS */ 317/* TOSHIBA PRODUCTS */
312#define TOSHIBA_VENDOR_ID 0x0930 318#define TOSHIBA_VENDOR_ID 0x0930
313#define TOSHIBA_PRODUCT_HSDPA_MINICARD 0x1302 319#define TOSHIBA_PRODUCT_HSDPA_MINICARD 0x1302
314 320
321#define ALINK_VENDOR_ID 0x1e0e
322#define ALINK_PRODUCT_3GU 0x9200
323
324/* ALCATEL PRODUCTS */
325#define ALCATEL_VENDOR_ID 0x1bbb
326#define ALCATEL_PRODUCT_X060S 0x0000
327
328
315static struct usb_device_id option_ids[] = { 329static struct usb_device_id option_ids[] = {
316 { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_COLT) }, 330 { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_COLT) },
317 { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_RICOLA) }, 331 { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_RICOLA) },
@@ -428,8 +442,10 @@ static struct usb_device_id option_ids[] = {
428 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_EU870D) }, /* Novatel EU850D/EU860D/EU870D */ 442 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_EU870D) }, /* Novatel EU850D/EU860D/EU870D */
429 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_MC950D) }, /* Novatel MC930D/MC950D */ 443 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_MC950D) }, /* Novatel MC930D/MC950D */
430 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_MC727) }, /* Novatel MC727/U727/USB727 */ 444 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_MC727) }, /* Novatel MC727/U727/USB727 */
445 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_MC727_NEW) }, /* Novatel MC727/U727/USB727 refresh */
431 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_U727) }, /* Novatel MC727/U727/USB727 */ 446 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_U727) }, /* Novatel MC727/U727/USB727 */
432 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_MC760) }, /* Novatel MC760/U760/USB760 */ 447 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_MC760) }, /* Novatel MC760/U760/USB760 */
448 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_OVMC760) }, /* Novatel Ovation MC760 */
433 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_HSPA_FULLSPEED) }, /* Novatel HSPA product */ 449 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_HSPA_FULLSPEED) }, /* Novatel HSPA product */
434 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_EVDO_EMBEDDED_FULLSPEED) }, /* Novatel EVDO Embedded product */ 450 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_EVDO_EMBEDDED_FULLSPEED) }, /* Novatel EVDO Embedded product */
435 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_HSPA_EMBEDDED_FULLSPEED) }, /* Novatel HSPA Embedded product */ 451 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_HSPA_EMBEDDED_FULLSPEED) }, /* Novatel HSPA Embedded product */
@@ -463,42 +479,6 @@ static struct usb_device_id option_ids[] = {
463 { USB_DEVICE(ANYDATA_VENDOR_ID, ANYDATA_PRODUCT_ADU_500A) }, 479 { USB_DEVICE(ANYDATA_VENDOR_ID, ANYDATA_PRODUCT_ADU_500A) },
464 { USB_DEVICE(ANYDATA_VENDOR_ID, ANYDATA_PRODUCT_ADU_620UW) }, 480 { USB_DEVICE(ANYDATA_VENDOR_ID, ANYDATA_PRODUCT_ADU_620UW) },
465 { USB_DEVICE(AXESSTEL_VENDOR_ID, AXESSTEL_PRODUCT_MV110H) }, 481 { USB_DEVICE(AXESSTEL_VENDOR_ID, AXESSTEL_PRODUCT_MV110H) },
466 { USB_DEVICE(ONDA_VENDOR_ID, ONDA_PRODUCT_MSA501HS) },
467 { USB_DEVICE(ONDA_VENDOR_ID, ONDA_PRODUCT_ET502HS) },
468 { USB_DEVICE(ONDA_VENDOR_ID, 0x0003) },
469 { USB_DEVICE(ONDA_VENDOR_ID, 0x0004) },
470 { USB_DEVICE(ONDA_VENDOR_ID, 0x0005) },
471 { USB_DEVICE(ONDA_VENDOR_ID, 0x0006) },
472 { USB_DEVICE(ONDA_VENDOR_ID, 0x0007) },
473 { USB_DEVICE(ONDA_VENDOR_ID, 0x0008) },
474 { USB_DEVICE(ONDA_VENDOR_ID, 0x0009) },
475 { USB_DEVICE(ONDA_VENDOR_ID, 0x000a) },
476 { USB_DEVICE(ONDA_VENDOR_ID, 0x000b) },
477 { USB_DEVICE(ONDA_VENDOR_ID, 0x000c) },
478 { USB_DEVICE(ONDA_VENDOR_ID, 0x000d) },
479 { USB_DEVICE(ONDA_VENDOR_ID, 0x000e) },
480 { USB_DEVICE(ONDA_VENDOR_ID, 0x000f) },
481 { USB_DEVICE(ONDA_VENDOR_ID, 0x0010) },
482 { USB_DEVICE(ONDA_VENDOR_ID, 0x0011) },
483 { USB_DEVICE(ONDA_VENDOR_ID, 0x0012) },
484 { USB_DEVICE(ONDA_VENDOR_ID, 0x0013) },
485 { USB_DEVICE(ONDA_VENDOR_ID, 0x0014) },
486 { USB_DEVICE(ONDA_VENDOR_ID, 0x0015) },
487 { USB_DEVICE(ONDA_VENDOR_ID, 0x0016) },
488 { USB_DEVICE(ONDA_VENDOR_ID, 0x0017) },
489 { USB_DEVICE(ONDA_VENDOR_ID, 0x0018) },
490 { USB_DEVICE(ONDA_VENDOR_ID, 0x0019) },
491 { USB_DEVICE(ONDA_VENDOR_ID, 0x0020) },
492 { USB_DEVICE(ONDA_VENDOR_ID, 0x0021) },
493 { USB_DEVICE(ONDA_VENDOR_ID, 0x0022) },
494 { USB_DEVICE(ONDA_VENDOR_ID, 0x0023) },
495 { USB_DEVICE(ONDA_VENDOR_ID, 0x0024) },
496 { USB_DEVICE(ONDA_VENDOR_ID, 0x0025) },
497 { USB_DEVICE(ONDA_VENDOR_ID, 0x0026) },
498 { USB_DEVICE(ONDA_VENDOR_ID, 0x0027) },
499 { USB_DEVICE(ONDA_VENDOR_ID, 0x0028) },
500 { USB_DEVICE(ONDA_VENDOR_ID, 0x0029) },
501 { USB_DEVICE(ONDA_VENDOR_ID, ONDA_PRODUCT_MT503HS) },
502 { USB_DEVICE(YISO_VENDOR_ID, YISO_PRODUCT_U893) }, 482 { USB_DEVICE(YISO_VENDOR_ID, YISO_PRODUCT_U893) },
503 { USB_DEVICE(BANDRICH_VENDOR_ID, BANDRICH_PRODUCT_C100_1) }, 483 { USB_DEVICE(BANDRICH_VENDOR_ID, BANDRICH_PRODUCT_C100_1) },
504 { USB_DEVICE(BANDRICH_VENDOR_ID, BANDRICH_PRODUCT_C100_2) }, 484 { USB_DEVICE(BANDRICH_VENDOR_ID, BANDRICH_PRODUCT_C100_2) },
@@ -523,14 +503,85 @@ static struct usb_device_id option_ids[] = {
523 { USB_DEVICE(QUALCOMM_VENDOR_ID, 0x6613)}, /* Onda H600/ZTE MF330 */ 503 { USB_DEVICE(QUALCOMM_VENDOR_ID, 0x6613)}, /* Onda H600/ZTE MF330 */
524 { USB_DEVICE(MAXON_VENDOR_ID, 0x6280) }, /* BP3-USB & BP3-EXT HSDPA */ 504 { USB_DEVICE(MAXON_VENDOR_ID, 0x6280) }, /* BP3-USB & BP3-EXT HSDPA */
525 { USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_UC864E) }, 505 { USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_UC864E) },
526 { USB_DEVICE(ZTE_VENDOR_ID, ZTE_PRODUCT_MF622) }, 506 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, ZTE_PRODUCT_MF622, 0xff, 0xff, 0xff) }, /* ZTE WCDMA products */
527 { USB_DEVICE(ZTE_VENDOR_ID, ZTE_PRODUCT_MF626) }, 507 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0002, 0xff, 0xff, 0xff) },
528 { USB_DEVICE(ZTE_VENDOR_ID, ZTE_PRODUCT_MF628) }, 508 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0003, 0xff, 0xff, 0xff) },
529 { USB_DEVICE(ZTE_VENDOR_ID, ZTE_PRODUCT_CDMA_TECH) }, 509 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0004, 0xff, 0xff, 0xff) },
510 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0005, 0xff, 0xff, 0xff) },
511 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0006, 0xff, 0xff, 0xff) },
512 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0007, 0xff, 0xff, 0xff) },
513 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0008, 0xff, 0xff, 0xff) },
514 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0009, 0xff, 0xff, 0xff) },
515 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x000a, 0xff, 0xff, 0xff) },
516 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x000b, 0xff, 0xff, 0xff) },
517 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x000c, 0xff, 0xff, 0xff) },
518 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x000d, 0xff, 0xff, 0xff) },
519 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x000e, 0xff, 0xff, 0xff) },
520 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x000f, 0xff, 0xff, 0xff) },
521 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0010, 0xff, 0xff, 0xff) },
522 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0011, 0xff, 0xff, 0xff) },
523 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0012, 0xff, 0xff, 0xff) },
524 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0013, 0xff, 0xff, 0xff) },
525 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, ZTE_PRODUCT_MF628, 0xff, 0xff, 0xff) },
526 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0016, 0xff, 0xff, 0xff) },
527 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0017, 0xff, 0xff, 0xff) },
528 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0018, 0xff, 0xff, 0xff) },
529 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0019, 0xff, 0xff, 0xff) },
530 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0020, 0xff, 0xff, 0xff) },
531 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0021, 0xff, 0xff, 0xff) },
532 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0022, 0xff, 0xff, 0xff) },
533 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0023, 0xff, 0xff, 0xff) },
534 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0024, 0xff, 0xff, 0xff) },
535 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0025, 0xff, 0xff, 0xff) },
536 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0026, 0xff, 0xff, 0xff) },
537 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0028, 0xff, 0xff, 0xff) },
538 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0029, 0xff, 0xff, 0xff) },
539 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0030, 0xff, 0xff, 0xff) },
540 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, ZTE_PRODUCT_MF626, 0xff, 0xff, 0xff) },
541 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0032, 0xff, 0xff, 0xff) },
542 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0033, 0xff, 0xff, 0xff) },
543 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0037, 0xff, 0xff, 0xff) },
544 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0039, 0xff, 0xff, 0xff) },
545 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0042, 0xff, 0xff, 0xff) },
546 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0043, 0xff, 0xff, 0xff) },
547 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0048, 0xff, 0xff, 0xff) },
548 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0049, 0xff, 0xff, 0xff) },
549 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0051, 0xff, 0xff, 0xff) },
550 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0052, 0xff, 0xff, 0xff) },
551 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0054, 0xff, 0xff, 0xff) },
552 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0055, 0xff, 0xff, 0xff) },
553 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0057, 0xff, 0xff, 0xff) },
554 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0058, 0xff, 0xff, 0xff) },
555 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0061, 0xff, 0xff, 0xff) },
556 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0062, 0xff, 0xff, 0xff) },
557 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0063, 0xff, 0xff, 0xff) },
558 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0064, 0xff, 0xff, 0xff) },
559 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0066, 0xff, 0xff, 0xff) },
560 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0069, 0xff, 0xff, 0xff) },
561 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0076, 0xff, 0xff, 0xff) },
562 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0078, 0xff, 0xff, 0xff) },
563 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0082, 0xff, 0xff, 0xff) },
564 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0086, 0xff, 0xff, 0xff) },
565 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x2002, 0xff, 0xff, 0xff) },
566 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x2003, 0xff, 0xff, 0xff) },
567 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0014, 0xff, 0xff, 0xff) }, /* ZTE CDMA products */
568 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0027, 0xff, 0xff, 0xff) },
569 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0059, 0xff, 0xff, 0xff) },
570 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0060, 0xff, 0xff, 0xff) },
571 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0070, 0xff, 0xff, 0xff) },
572 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0073, 0xff, 0xff, 0xff) },
573 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, ZTE_PRODUCT_CDMA_TECH, 0xff, 0xff, 0xff) },
574 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, ZTE_PRODUCT_AC8710, 0xff, 0xff, 0xff) },
530 { USB_DEVICE(BENQ_VENDOR_ID, BENQ_PRODUCT_H10) }, 575 { USB_DEVICE(BENQ_VENDOR_ID, BENQ_PRODUCT_H10) },
531 { USB_DEVICE(DLINK_VENDOR_ID, DLINK_PRODUCT_DWM_652) }, 576 { USB_DEVICE(DLINK_VENDOR_ID, DLINK_PRODUCT_DWM_652) },
532 { USB_DEVICE(0x1da5, 0x4515) }, /* BenQ H20 */ 577 { USB_DEVICE(QISDA_VENDOR_ID, QISDA_PRODUCT_H21_4512) },
578 { USB_DEVICE(QISDA_VENDOR_ID, QISDA_PRODUCT_H21_4523) },
579 { USB_DEVICE(QISDA_VENDOR_ID, QISDA_PRODUCT_H20_4515) },
580 { USB_DEVICE(QISDA_VENDOR_ID, QISDA_PRODUCT_H20_4519) },
533 { USB_DEVICE(TOSHIBA_VENDOR_ID, TOSHIBA_PRODUCT_HSDPA_MINICARD ) }, /* Toshiba 3G HSDPA == Novatel Expedite EU870D MiniCard */ 581 { USB_DEVICE(TOSHIBA_VENDOR_ID, TOSHIBA_PRODUCT_HSDPA_MINICARD ) }, /* Toshiba 3G HSDPA == Novatel Expedite EU870D MiniCard */
582 { USB_DEVICE(ALINK_VENDOR_ID, 0x9000) },
583 { USB_DEVICE_AND_INTERFACE_INFO(ALINK_VENDOR_ID, ALINK_PRODUCT_3GU, 0xff, 0xff, 0xff) },
584 { USB_DEVICE(ALCATEL_VENDOR_ID, ALCATEL_PRODUCT_X060S) },
534 { } /* Terminating entry */ 585 { } /* Terminating entry */
535}; 586};
536MODULE_DEVICE_TABLE(usb, option_ids); 587MODULE_DEVICE_TABLE(usb, option_ids);
@@ -539,8 +590,10 @@ static struct usb_driver option_driver = {
539 .name = "option", 590 .name = "option",
540 .probe = usb_serial_probe, 591 .probe = usb_serial_probe,
541 .disconnect = usb_serial_disconnect, 592 .disconnect = usb_serial_disconnect,
593#ifdef CONFIG_PM
542 .suspend = usb_serial_suspend, 594 .suspend = usb_serial_suspend,
543 .resume = usb_serial_resume, 595 .resume = usb_serial_resume,
596#endif
544 .id_table = option_ids, 597 .id_table = option_ids,
545 .no_dynamic_id = 1, 598 .no_dynamic_id = 1,
546}; 599};
@@ -572,8 +625,10 @@ static struct usb_serial_driver option_1port_device = {
572 .disconnect = option_disconnect, 625 .disconnect = option_disconnect,
573 .release = option_release, 626 .release = option_release,
574 .read_int_callback = option_instat_callback, 627 .read_int_callback = option_instat_callback,
628#ifdef CONFIG_PM
575 .suspend = option_suspend, 629 .suspend = option_suspend,
576 .resume = option_resume, 630 .resume = option_resume,
631#endif
577}; 632};
578 633
579static int debug; 634static int debug;
@@ -732,7 +787,6 @@ static int option_write(struct tty_struct *tty, struct usb_serial_port *port,
732 memcpy(this_urb->transfer_buffer, buf, todo); 787 memcpy(this_urb->transfer_buffer, buf, todo);
733 this_urb->transfer_buffer_length = todo; 788 this_urb->transfer_buffer_length = todo;
734 789
735 this_urb->dev = port->serial->dev;
736 err = usb_submit_urb(this_urb, GFP_ATOMIC); 790 err = usb_submit_urb(this_urb, GFP_ATOMIC);
737 if (err) { 791 if (err) {
738 dbg("usb_submit_urb %p (write bulk) failed " 792 dbg("usb_submit_urb %p (write bulk) failed "
@@ -816,7 +870,6 @@ static void option_instat_callback(struct urb *urb)
816 int status = urb->status; 870 int status = urb->status;
817 struct usb_serial_port *port = urb->context; 871 struct usb_serial_port *port = urb->context;
818 struct option_port_private *portdata = usb_get_serial_port_data(port); 872 struct option_port_private *portdata = usb_get_serial_port_data(port);
819 struct usb_serial *serial = port->serial;
820 873
821 dbg("%s", __func__); 874 dbg("%s", __func__);
822 dbg("%s: urb %p port %p has data %p", __func__, urb, port, portdata); 875 dbg("%s: urb %p port %p has data %p", __func__, urb, port, portdata);
@@ -860,7 +913,6 @@ static void option_instat_callback(struct urb *urb)
860 913
861 /* Resubmit urb so we continue receiving IRQ data */ 914 /* Resubmit urb so we continue receiving IRQ data */
862 if (status != -ESHUTDOWN && status != -ENOENT) { 915 if (status != -ESHUTDOWN && status != -ENOENT) {
863 urb->dev = serial->dev;
864 err = usb_submit_urb(urb, GFP_ATOMIC); 916 err = usb_submit_urb(urb, GFP_ATOMIC);
865 if (err) 917 if (err)
866 dbg("%s: resubmit intr urb failed. (%d)", 918 dbg("%s: resubmit intr urb failed. (%d)",
@@ -913,7 +965,6 @@ static int option_open(struct tty_struct *tty,
913 struct usb_serial_port *port, struct file *filp) 965 struct usb_serial_port *port, struct file *filp)
914{ 966{
915 struct option_port_private *portdata; 967 struct option_port_private *portdata;
916 struct usb_serial *serial = port->serial;
917 int i, err; 968 int i, err;
918 struct urb *urb; 969 struct urb *urb;
919 970
@@ -921,23 +972,11 @@ static int option_open(struct tty_struct *tty,
921 972
922 dbg("%s", __func__); 973 dbg("%s", __func__);
923 974
924 /* Reset low level data toggle and start reading from endpoints */ 975 /* Start reading from the IN endpoint */
925 for (i = 0; i < N_IN_URB; i++) { 976 for (i = 0; i < N_IN_URB; i++) {
926 urb = portdata->in_urbs[i]; 977 urb = portdata->in_urbs[i];
927 if (!urb) 978 if (!urb)
928 continue; 979 continue;
929 if (urb->dev != serial->dev) {
930 dbg("%s: dev %p != %p", __func__,
931 urb->dev, serial->dev);
932 continue;
933 }
934
935 /*
936 * make sure endpoint data toggle is synchronized with the
937 * device
938 */
939 usb_clear_halt(urb->dev, urb->pipe);
940
941 err = usb_submit_urb(urb, GFP_KERNEL); 980 err = usb_submit_urb(urb, GFP_KERNEL);
942 if (err) { 981 if (err) {
943 dbg("%s: submit urb %d failed (%d) %d", 982 dbg("%s: submit urb %d failed (%d) %d",
@@ -946,16 +985,6 @@ static int option_open(struct tty_struct *tty,
946 } 985 }
947 } 986 }
948 987
949 /* Reset low level data toggle on out endpoints */
950 for (i = 0; i < N_OUT_URB; i++) {
951 urb = portdata->out_urbs[i];
952 if (!urb)
953 continue;
954 urb->dev = serial->dev;
955 /* usb_settoggle(urb->dev, usb_pipeendpoint(urb->pipe),
956 usb_pipeout(urb->pipe), 0); */
957 }
958
959 option_send_setup(port); 988 option_send_setup(port);
960 989
961 return 0; 990 return 0;
@@ -1195,6 +1224,7 @@ static void option_release(struct usb_serial *serial)
1195 } 1224 }
1196} 1225}
1197 1226
1227#ifdef CONFIG_PM
1198static int option_suspend(struct usb_serial *serial, pm_message_t message) 1228static int option_suspend(struct usb_serial *serial, pm_message_t message)
1199{ 1229{
1200 dbg("%s entered", __func__); 1230 dbg("%s entered", __func__);
@@ -1218,7 +1248,6 @@ static int option_resume(struct usb_serial *serial)
1218 dbg("%s: No interrupt URB for port %d\n", __func__, i); 1248 dbg("%s: No interrupt URB for port %d\n", __func__, i);
1219 continue; 1249 continue;
1220 } 1250 }
1221 port->interrupt_in_urb->dev = serial->dev;
1222 err = usb_submit_urb(port->interrupt_in_urb, GFP_NOIO); 1251 err = usb_submit_urb(port->interrupt_in_urb, GFP_NOIO);
1223 dbg("Submitted interrupt URB for port %d (result %d)", i, err); 1252 dbg("Submitted interrupt URB for port %d (result %d)", i, err);
1224 if (err < 0) { 1253 if (err < 0) {
@@ -1254,6 +1283,7 @@ static int option_resume(struct usb_serial *serial)
1254 } 1283 }
1255 return 0; 1284 return 0;
1256} 1285}
1286#endif
1257 1287
1258MODULE_AUTHOR(DRIVER_AUTHOR); 1288MODULE_AUTHOR(DRIVER_AUTHOR);
1259MODULE_DESCRIPTION(DRIVER_DESC); 1289MODULE_DESCRIPTION(DRIVER_DESC);
diff --git a/drivers/usb/serial/pl2303.c b/drivers/usb/serial/pl2303.c
index ec6c132a25b5..3e86815b2705 100644
--- a/drivers/usb/serial/pl2303.c
+++ b/drivers/usb/serial/pl2303.c
@@ -94,6 +94,8 @@ static struct usb_device_id id_table [] = {
94 { USB_DEVICE(YCCABLE_VENDOR_ID, YCCABLE_PRODUCT_ID) }, 94 { USB_DEVICE(YCCABLE_VENDOR_ID, YCCABLE_PRODUCT_ID) },
95 { USB_DEVICE(SUPERIAL_VENDOR_ID, SUPERIAL_PRODUCT_ID) }, 95 { USB_DEVICE(SUPERIAL_VENDOR_ID, SUPERIAL_PRODUCT_ID) },
96 { USB_DEVICE(HP_VENDOR_ID, HP_LD220_PRODUCT_ID) }, 96 { USB_DEVICE(HP_VENDOR_ID, HP_LD220_PRODUCT_ID) },
97 { USB_DEVICE(CRESSI_VENDOR_ID, CRESSI_EDY_PRODUCT_ID) },
98 { USB_DEVICE(SONY_VENDOR_ID, SONY_QN3USB_PRODUCT_ID) },
97 { } /* Terminating entry */ 99 { } /* Terminating entry */
98}; 100};
99 101
@@ -971,18 +973,46 @@ exit:
971 __func__, retval); 973 __func__, retval);
972} 974}
973 975
976static void pl2303_push_data(struct tty_struct *tty,
977 struct usb_serial_port *port, struct urb *urb,
978 u8 line_status)
979{
980 unsigned char *data = urb->transfer_buffer;
981 /* get tty_flag from status */
982 char tty_flag = TTY_NORMAL;
983 /* break takes precedence over parity, */
984 /* which takes precedence over framing errors */
985 if (line_status & UART_BREAK_ERROR)
986 tty_flag = TTY_BREAK;
987 else if (line_status & UART_PARITY_ERROR)
988 tty_flag = TTY_PARITY;
989 else if (line_status & UART_FRAME_ERROR)
990 tty_flag = TTY_FRAME;
991 dbg("%s - tty_flag = %d", __func__, tty_flag);
992
993 tty_buffer_request_room(tty, urb->actual_length + 1);
994 /* overrun is special, not associated with a char */
995 if (line_status & UART_OVERRUN_ERROR)
996 tty_insert_flip_char(tty, 0, TTY_OVERRUN);
997 if (port->console && port->sysrq) {
998 int i;
999 for (i = 0; i < urb->actual_length; ++i)
1000 if (!usb_serial_handle_sysrq_char(tty, port, data[i]))
1001 tty_insert_flip_char(tty, data[i], tty_flag);
1002 } else
1003 tty_insert_flip_string(tty, data, urb->actual_length);
1004 tty_flip_buffer_push(tty);
1005}
1006
974static void pl2303_read_bulk_callback(struct urb *urb) 1007static void pl2303_read_bulk_callback(struct urb *urb)
975{ 1008{
976 struct usb_serial_port *port = urb->context; 1009 struct usb_serial_port *port = urb->context;
977 struct pl2303_private *priv = usb_get_serial_port_data(port); 1010 struct pl2303_private *priv = usb_get_serial_port_data(port);
978 struct tty_struct *tty; 1011 struct tty_struct *tty;
979 unsigned char *data = urb->transfer_buffer;
980 unsigned long flags; 1012 unsigned long flags;
981 int i;
982 int result; 1013 int result;
983 int status = urb->status; 1014 int status = urb->status;
984 u8 line_status; 1015 u8 line_status;
985 char tty_flag;
986 1016
987 dbg("%s - port %d", __func__, port->number); 1017 dbg("%s - port %d", __func__, port->number);
988 1018
@@ -1010,10 +1040,7 @@ static void pl2303_read_bulk_callback(struct urb *urb)
1010 } 1040 }
1011 1041
1012 usb_serial_debug_data(debug, &port->dev, __func__, 1042 usb_serial_debug_data(debug, &port->dev, __func__,
1013 urb->actual_length, data); 1043 urb->actual_length, urb->transfer_buffer);
1014
1015 /* get tty_flag from status */
1016 tty_flag = TTY_NORMAL;
1017 1044
1018 spin_lock_irqsave(&priv->lock, flags); 1045 spin_lock_irqsave(&priv->lock, flags);
1019 line_status = priv->line_status; 1046 line_status = priv->line_status;
@@ -1021,26 +1048,9 @@ static void pl2303_read_bulk_callback(struct urb *urb)
1021 spin_unlock_irqrestore(&priv->lock, flags); 1048 spin_unlock_irqrestore(&priv->lock, flags);
1022 wake_up_interruptible(&priv->delta_msr_wait); 1049 wake_up_interruptible(&priv->delta_msr_wait);
1023 1050
1024 /* break takes precedence over parity, */
1025 /* which takes precedence over framing errors */
1026 if (line_status & UART_BREAK_ERROR)
1027 tty_flag = TTY_BREAK;
1028 else if (line_status & UART_PARITY_ERROR)
1029 tty_flag = TTY_PARITY;
1030 else if (line_status & UART_FRAME_ERROR)
1031 tty_flag = TTY_FRAME;
1032 dbg("%s - tty_flag = %d", __func__, tty_flag);
1033
1034 tty = tty_port_tty_get(&port->port); 1051 tty = tty_port_tty_get(&port->port);
1035 if (tty && urb->actual_length) { 1052 if (tty && urb->actual_length) {
1036 tty_buffer_request_room(tty, urb->actual_length + 1); 1053 pl2303_push_data(tty, port, urb, line_status);
1037 /* overrun is special, not associated with a char */
1038 if (line_status & UART_OVERRUN_ERROR)
1039 tty_insert_flip_char(tty, 0, TTY_OVERRUN);
1040 for (i = 0; i < urb->actual_length; ++i)
1041 if (!usb_serial_handle_sysrq_char(port, data[i]))
1042 tty_insert_flip_char(tty, data[i], tty_flag);
1043 tty_flip_buffer_push(tty);
1044 } 1054 }
1045 tty_kref_put(tty); 1055 tty_kref_put(tty);
1046 /* Schedule the next read _if_ we are still open */ 1056 /* Schedule the next read _if_ we are still open */
diff --git a/drivers/usb/serial/pl2303.h b/drivers/usb/serial/pl2303.h
index 1d7a22e3a9fd..ee9505e1dd92 100644
--- a/drivers/usb/serial/pl2303.h
+++ b/drivers/usb/serial/pl2303.h
@@ -122,3 +122,11 @@
122/* Hewlett-Packard LD220-HP POS Pole Display */ 122/* Hewlett-Packard LD220-HP POS Pole Display */
123#define HP_VENDOR_ID 0x03f0 123#define HP_VENDOR_ID 0x03f0
124#define HP_LD220_PRODUCT_ID 0x3524 124#define HP_LD220_PRODUCT_ID 0x3524
125
126/* Cressi Edy (diving computer) PC interface */
127#define CRESSI_VENDOR_ID 0x04b8
128#define CRESSI_EDY_PRODUCT_ID 0x0521
129
130/* Sony, USB data cable for CMD-Jxx mobile phones */
131#define SONY_VENDOR_ID 0x054c
132#define SONY_QN3USB_PRODUCT_ID 0x0437
diff --git a/drivers/usb/serial/sierra.c b/drivers/usb/serial/sierra.c
index 032f7aeb40a4..f48d05e0acc1 100644
--- a/drivers/usb/serial/sierra.c
+++ b/drivers/usb/serial/sierra.c
@@ -181,35 +181,50 @@ static const struct sierra_iface_info direct_ip_interface_blacklist = {
181}; 181};
182 182
183static struct usb_device_id id_table [] = { 183static struct usb_device_id id_table [] = {
184 { USB_DEVICE(0x0F3D, 0x0112) }, /* Airprime/Sierra PC 5220 */
185 { USB_DEVICE(0x03F0, 0x1B1D) }, /* HP ev2200 a.k.a MC5720 */
186 { USB_DEVICE(0x03F0, 0x1E1D) }, /* HP hs2300 a.k.a MC8775 */
187
184 { USB_DEVICE(0x1199, 0x0017) }, /* Sierra Wireless EM5625 */ 188 { USB_DEVICE(0x1199, 0x0017) }, /* Sierra Wireless EM5625 */
185 { USB_DEVICE(0x1199, 0x0018) }, /* Sierra Wireless MC5720 */ 189 { USB_DEVICE(0x1199, 0x0018) }, /* Sierra Wireless MC5720 */
186 { USB_DEVICE(0x1199, 0x0218) }, /* Sierra Wireless MC5720 */ 190 { USB_DEVICE(0x1199, 0x0218) }, /* Sierra Wireless MC5720 */
187 { USB_DEVICE(0x03f0, 0x1b1d) }, /* HP ev2200 a.k.a MC5720 */
188 { USB_DEVICE(0x1199, 0x0020) }, /* Sierra Wireless MC5725 */ 191 { USB_DEVICE(0x1199, 0x0020) }, /* Sierra Wireless MC5725 */
189 { USB_DEVICE(0x1199, 0x0024) }, /* Sierra Wireless MC5727 */
190 { USB_DEVICE(0x1199, 0x0220) }, /* Sierra Wireless MC5725 */ 192 { USB_DEVICE(0x1199, 0x0220) }, /* Sierra Wireless MC5725 */
193 { USB_DEVICE(0x1199, 0x0022) }, /* Sierra Wireless EM5725 */
194 { USB_DEVICE(0x1199, 0x0024) }, /* Sierra Wireless MC5727 */
195 { USB_DEVICE(0x1199, 0x0224) }, /* Sierra Wireless MC5727 */
191 { USB_DEVICE(0x1199, 0x0019) }, /* Sierra Wireless AirCard 595 */ 196 { USB_DEVICE(0x1199, 0x0019) }, /* Sierra Wireless AirCard 595 */
192 { USB_DEVICE(0x1199, 0x0021) }, /* Sierra Wireless AirCard 597E */ 197 { USB_DEVICE(0x1199, 0x0021) }, /* Sierra Wireless AirCard 597E */
198 { USB_DEVICE(0x1199, 0x0112) }, /* Sierra Wireless AirCard 580 */
193 { USB_DEVICE(0x1199, 0x0120) }, /* Sierra Wireless USB Dongle 595U */ 199 { USB_DEVICE(0x1199, 0x0120) }, /* Sierra Wireless USB Dongle 595U */
194 /* Sierra Wireless C597 */ 200 /* Sierra Wireless C597 */
195 { USB_DEVICE_AND_INTERFACE_INFO(0x1199, 0x0023, 0xFF, 0xFF, 0xFF) }, 201 { USB_DEVICE_AND_INTERFACE_INFO(0x1199, 0x0023, 0xFF, 0xFF, 0xFF) },
196 /* Sierra Wireless Device */ 202 /* Sierra Wireless T598 */
197 { USB_DEVICE_AND_INTERFACE_INFO(0x1199, 0x0025, 0xFF, 0xFF, 0xFF) }, 203 { USB_DEVICE_AND_INTERFACE_INFO(0x1199, 0x0025, 0xFF, 0xFF, 0xFF) },
198 { USB_DEVICE(0x1199, 0x0026) }, /* Sierra Wireless Device */ 204 { USB_DEVICE(0x1199, 0x0026) }, /* Sierra Wireless T11 */
199 { USB_DEVICE(0x1199, 0x0027) }, /* Sierra Wireless Device */ 205 { USB_DEVICE(0x1199, 0x0027) }, /* Sierra Wireless AC402 */
200 { USB_DEVICE(0x1199, 0x0028) }, /* Sierra Wireless Device */ 206 { USB_DEVICE(0x1199, 0x0028) }, /* Sierra Wireless MC5728 */
207 { USB_DEVICE(0x1199, 0x0029) }, /* Sierra Wireless Device */
201 208
202 { USB_DEVICE(0x1199, 0x6802) }, /* Sierra Wireless MC8755 */ 209 { USB_DEVICE(0x1199, 0x6802) }, /* Sierra Wireless MC8755 */
203 { USB_DEVICE(0x1199, 0x6804) }, /* Sierra Wireless MC8755 */
204 { USB_DEVICE(0x1199, 0x6803) }, /* Sierra Wireless MC8765 */ 210 { USB_DEVICE(0x1199, 0x6803) }, /* Sierra Wireless MC8765 */
211 { USB_DEVICE(0x1199, 0x6804) }, /* Sierra Wireless MC8755 */
212 { USB_DEVICE(0x1199, 0x6805) }, /* Sierra Wireless MC8765 */
213 { USB_DEVICE(0x1199, 0x6808) }, /* Sierra Wireless MC8755 */
214 { USB_DEVICE(0x1199, 0x6809) }, /* Sierra Wireless MC8765 */
205 { USB_DEVICE(0x1199, 0x6812) }, /* Sierra Wireless MC8775 & AC 875U */ 215 { USB_DEVICE(0x1199, 0x6812) }, /* Sierra Wireless MC8775 & AC 875U */
206 { USB_DEVICE(0x1199, 0x6813) }, /* Sierra Wireless MC8775 (Lenovo) */ 216 { USB_DEVICE(0x1199, 0x6813) }, /* Sierra Wireless MC8775 */
207 { USB_DEVICE(0x1199, 0x6815) }, /* Sierra Wireless MC8775 */ 217 { USB_DEVICE(0x1199, 0x6815) }, /* Sierra Wireless MC8775 */
208 { USB_DEVICE(0x03f0, 0x1e1d) }, /* HP hs2300 a.k.a MC8775 */ 218 { USB_DEVICE(0x1199, 0x6816) }, /* Sierra Wireless MC8775 */
209 { USB_DEVICE(0x1199, 0x6820) }, /* Sierra Wireless AirCard 875 */ 219 { USB_DEVICE(0x1199, 0x6820) }, /* Sierra Wireless AirCard 875 */
210 { USB_DEVICE(0x1199, 0x6821) }, /* Sierra Wireless AirCard 875U */ 220 { USB_DEVICE(0x1199, 0x6821) }, /* Sierra Wireless AirCard 875U */
221 { USB_DEVICE(0x1199, 0x6822) }, /* Sierra Wireless AirCard 875E */
211 { USB_DEVICE(0x1199, 0x6832) }, /* Sierra Wireless MC8780 */ 222 { USB_DEVICE(0x1199, 0x6832) }, /* Sierra Wireless MC8780 */
212 { USB_DEVICE(0x1199, 0x6833) }, /* Sierra Wireless MC8781 */ 223 { USB_DEVICE(0x1199, 0x6833) }, /* Sierra Wireless MC8781 */
224 { USB_DEVICE(0x1199, 0x6834) }, /* Sierra Wireless MC8780 */
225 { USB_DEVICE(0x1199, 0x6835) }, /* Sierra Wireless MC8781 */
226 { USB_DEVICE(0x1199, 0x6838) }, /* Sierra Wireless MC8780 */
227 { USB_DEVICE(0x1199, 0x6839) }, /* Sierra Wireless MC8781 */
213 { USB_DEVICE(0x1199, 0x683A) }, /* Sierra Wireless MC8785 */ 228 { USB_DEVICE(0x1199, 0x683A) }, /* Sierra Wireless MC8785 */
214 { USB_DEVICE(0x1199, 0x683B) }, /* Sierra Wireless MC8785 Composite */ 229 { USB_DEVICE(0x1199, 0x683B) }, /* Sierra Wireless MC8785 Composite */
215 /* Sierra Wireless MC8790, MC8791, MC8792 Composite */ 230 /* Sierra Wireless MC8790, MC8791, MC8792 Composite */
@@ -227,16 +242,13 @@ static struct usb_device_id id_table [] = {
227 { USB_DEVICE(0x1199, 0x685A) }, /* Sierra Wireless AirCard 885 E */ 242 { USB_DEVICE(0x1199, 0x685A) }, /* Sierra Wireless AirCard 885 E */
228 /* Sierra Wireless C885 */ 243 /* Sierra Wireless C885 */
229 { USB_DEVICE_AND_INTERFACE_INFO(0x1199, 0x6880, 0xFF, 0xFF, 0xFF)}, 244 { USB_DEVICE_AND_INTERFACE_INFO(0x1199, 0x6880, 0xFF, 0xFF, 0xFF)},
230 /* Sierra Wireless Device */ 245 /* Sierra Wireless C888, Air Card 501, USB 303, USB 304 */
231 { USB_DEVICE_AND_INTERFACE_INFO(0x1199, 0x6890, 0xFF, 0xFF, 0xFF)}, 246 { USB_DEVICE_AND_INTERFACE_INFO(0x1199, 0x6890, 0xFF, 0xFF, 0xFF)},
232 /* Sierra Wireless Device */ 247 /* Sierra Wireless C22/C33 */
233 { USB_DEVICE_AND_INTERFACE_INFO(0x1199, 0x6891, 0xFF, 0xFF, 0xFF)}, 248 { USB_DEVICE_AND_INTERFACE_INFO(0x1199, 0x6891, 0xFF, 0xFF, 0xFF)},
234 /* Sierra Wireless Device */ 249 /* Sierra Wireless HSPA Non-Composite Device */
235 { USB_DEVICE_AND_INTERFACE_INFO(0x1199, 0x6892, 0xFF, 0xFF, 0xFF)}, 250 { USB_DEVICE_AND_INTERFACE_INFO(0x1199, 0x6892, 0xFF, 0xFF, 0xFF)},
236 251 { USB_DEVICE(0x1199, 0x6893) }, /* Sierra Wireless Device */
237 { USB_DEVICE(0x1199, 0x0112) }, /* Sierra Wireless AirCard 580 */
238 { USB_DEVICE(0x0F3D, 0x0112) }, /* Airprime/Sierra PC 5220 */
239
240 { USB_DEVICE(0x1199, 0x68A3), /* Sierra Wireless Direct IP modems */ 252 { USB_DEVICE(0x1199, 0x68A3), /* Sierra Wireless Direct IP modems */
241 .driver_info = (kernel_ulong_t)&direct_ip_interface_blacklist 253 .driver_info = (kernel_ulong_t)&direct_ip_interface_blacklist
242 }, 254 },
@@ -814,7 +826,7 @@ static int sierra_startup(struct usb_serial *serial)
814 return 0; 826 return 0;
815} 827}
816 828
817static void sierra_disconnect(struct usb_serial *serial) 829static void sierra_release(struct usb_serial *serial)
818{ 830{
819 int i; 831 int i;
820 struct usb_serial_port *port; 832 struct usb_serial_port *port;
@@ -830,7 +842,6 @@ static void sierra_disconnect(struct usb_serial *serial)
830 if (!portdata) 842 if (!portdata)
831 continue; 843 continue;
832 kfree(portdata); 844 kfree(portdata);
833 usb_set_serial_port_data(port, NULL);
834 } 845 }
835} 846}
836 847
@@ -853,7 +864,7 @@ static struct usb_serial_driver sierra_device = {
853 .tiocmget = sierra_tiocmget, 864 .tiocmget = sierra_tiocmget,
854 .tiocmset = sierra_tiocmset, 865 .tiocmset = sierra_tiocmset,
855 .attach = sierra_startup, 866 .attach = sierra_startup,
856 .disconnect = sierra_disconnect, 867 .release = sierra_release,
857 .read_int_callback = sierra_instat_callback, 868 .read_int_callback = sierra_instat_callback,
858}; 869};
859 870
diff --git a/drivers/usb/serial/ti_usb_3410_5052.c b/drivers/usb/serial/ti_usb_3410_5052.c
index 991d8232e376..3bc609fe2242 100644
--- a/drivers/usb/serial/ti_usb_3410_5052.c
+++ b/drivers/usb/serial/ti_usb_3410_5052.c
@@ -191,7 +191,6 @@ static struct usb_device_id ti_id_table_5052[5+TI_EXTRA_VID_PID_COUNT+1] = {
191 { USB_DEVICE(TI_VENDOR_ID, TI_5152_BOOT_PRODUCT_ID) }, 191 { USB_DEVICE(TI_VENDOR_ID, TI_5152_BOOT_PRODUCT_ID) },
192 { USB_DEVICE(TI_VENDOR_ID, TI_5052_EEPROM_PRODUCT_ID) }, 192 { USB_DEVICE(TI_VENDOR_ID, TI_5052_EEPROM_PRODUCT_ID) },
193 { USB_DEVICE(TI_VENDOR_ID, TI_5052_FIRMWARE_PRODUCT_ID) }, 193 { USB_DEVICE(TI_VENDOR_ID, TI_5052_FIRMWARE_PRODUCT_ID) },
194 { USB_DEVICE(IBM_VENDOR_ID, IBM_4543_PRODUCT_ID) },
195}; 194};
196 195
197static struct usb_device_id ti_id_table_combined[14+2*TI_EXTRA_VID_PID_COUNT+1] = { 196static struct usb_device_id ti_id_table_combined[14+2*TI_EXTRA_VID_PID_COUNT+1] = {
@@ -728,7 +727,7 @@ static int ti_write_room(struct tty_struct *tty)
728 dbg("%s - port %d", __func__, port->number); 727 dbg("%s - port %d", __func__, port->number);
729 728
730 if (tport == NULL) 729 if (tport == NULL)
731 return -ENODEV; 730 return 0;
732 731
733 spin_lock_irqsave(&tport->tp_lock, flags); 732 spin_lock_irqsave(&tport->tp_lock, flags);
734 room = ti_buf_space_avail(tport->tp_write_buf); 733 room = ti_buf_space_avail(tport->tp_write_buf);
@@ -749,7 +748,7 @@ static int ti_chars_in_buffer(struct tty_struct *tty)
749 dbg("%s - port %d", __func__, port->number); 748 dbg("%s - port %d", __func__, port->number);
750 749
751 if (tport == NULL) 750 if (tport == NULL)
752 return -ENODEV; 751 return 0;
753 752
754 spin_lock_irqsave(&tport->tp_lock, flags); 753 spin_lock_irqsave(&tport->tp_lock, flags);
755 chars = ti_buf_data_avail(tport->tp_write_buf); 754 chars = ti_buf_data_avail(tport->tp_write_buf);
@@ -1658,7 +1657,7 @@ static int ti_do_download(struct usb_device *dev, int pipe,
1658 u8 cs = 0; 1657 u8 cs = 0;
1659 int done; 1658 int done;
1660 struct ti_firmware_header *header; 1659 struct ti_firmware_header *header;
1661 int status; 1660 int status = 0;
1662 int len; 1661 int len;
1663 1662
1664 for (pos = sizeof(struct ti_firmware_header); pos < size; pos++) 1663 for (pos = sizeof(struct ti_firmware_header); pos < size; pos++)
diff --git a/drivers/usb/serial/usb-serial.c b/drivers/usb/serial/usb-serial.c
index d595aa5586a7..99188c92068b 100644
--- a/drivers/usb/serial/usb-serial.c
+++ b/drivers/usb/serial/usb-serial.c
@@ -21,6 +21,7 @@
21#include <linux/errno.h> 21#include <linux/errno.h>
22#include <linux/init.h> 22#include <linux/init.h>
23#include <linux/slab.h> 23#include <linux/slab.h>
24#include <linux/smp_lock.h>
24#include <linux/tty.h> 25#include <linux/tty.h>
25#include <linux/tty_driver.h> 26#include <linux/tty_driver.h>
26#include <linux/tty_flip.h> 27#include <linux/tty_flip.h>
@@ -31,6 +32,7 @@
31#include <linux/mutex.h> 32#include <linux/mutex.h>
32#include <linux/list.h> 33#include <linux/list.h>
33#include <linux/uaccess.h> 34#include <linux/uaccess.h>
35#include <linux/serial.h>
34#include <linux/usb.h> 36#include <linux/usb.h>
35#include <linux/usb/serial.h> 37#include <linux/usb/serial.h>
36#include "pl2303.h" 38#include "pl2303.h"
@@ -183,6 +185,7 @@ static int serial_open (struct tty_struct *tty, struct file *filp)
183 struct usb_serial_port *port; 185 struct usb_serial_port *port;
184 unsigned int portNumber; 186 unsigned int portNumber;
185 int retval = 0; 187 int retval = 0;
188 int first = 0;
186 189
187 dbg("%s", __func__); 190 dbg("%s", __func__);
188 191
@@ -220,8 +223,9 @@ static int serial_open (struct tty_struct *tty, struct file *filp)
220 tty->driver_data = port; 223 tty->driver_data = port;
221 tty_port_tty_set(&port->port, tty); 224 tty_port_tty_set(&port->port, tty);
222 225
223 if (port->port.count == 1) { 226 /* If the console is attached, the device is already open */
224 227 if (port->port.count == 1 && !port->console) {
228 first = 1;
225 /* lock this module before we call it 229 /* lock this module before we call it
226 * this may fail, which means we must bail out, 230 * this may fail, which means we must bail out,
227 * safe because we are called with BKL held */ 231 * safe because we are called with BKL held */
@@ -244,13 +248,21 @@ static int serial_open (struct tty_struct *tty, struct file *filp)
244 if (retval) 248 if (retval)
245 goto bailout_interface_put; 249 goto bailout_interface_put;
246 mutex_unlock(&serial->disc_mutex); 250 mutex_unlock(&serial->disc_mutex);
251 set_bit(ASYNCB_INITIALIZED, &port->port.flags);
247 } 252 }
248 mutex_unlock(&port->mutex); 253 mutex_unlock(&port->mutex);
249 /* Now do the correct tty layer semantics */ 254 /* Now do the correct tty layer semantics */
250 retval = tty_port_block_til_ready(&port->port, tty, filp); 255 retval = tty_port_block_til_ready(&port->port, tty, filp);
251 if (retval == 0) 256 if (retval == 0) {
257 if (!first)
258 usb_serial_put(serial);
252 return 0; 259 return 0;
253 260 }
261 mutex_lock(&port->mutex);
262 if (first == 0)
263 goto bailout_mutex_unlock;
264 /* Undo the initial port actions */
265 mutex_lock(&serial->disc_mutex);
254bailout_interface_put: 266bailout_interface_put:
255 usb_autopm_put_interface(serial->interface); 267 usb_autopm_put_interface(serial->interface);
256bailout_module_put: 268bailout_module_put:
@@ -333,8 +345,27 @@ static void serial_close(struct tty_struct *tty, struct file *filp)
333{ 345{
334 struct usb_serial_port *port = tty->driver_data; 346 struct usb_serial_port *port = tty->driver_data;
335 347
348 if (!port)
349 return;
350
336 dbg("%s - port %d", __func__, port->number); 351 dbg("%s - port %d", __func__, port->number);
337 352
353 /* FIXME:
354 This leaves a very narrow race. Really we should do the
355 serial_do_free() on tty->shutdown(), but tty->shutdown can
356 be called from IRQ context and serial_do_free can sleep.
357
358 The right fix is probably to make the tty free (which is rare)
359 and thus tty->shutdown() occur via a work queue and simplify all
360 the drivers that use it.
361 */
362 if (tty_hung_up_p(filp)) {
363 /* serial_hangup already called serial_down at this point.
364 Another user may have already reopened the port but
365 serial_do_free is refcounted */
366 serial_do_free(port);
367 return;
368 }
338 369
339 if (tty_port_close_start(&port->port, tty, filp) == 0) 370 if (tty_port_close_start(&port->port, tty, filp) == 0)
340 return; 371 return;
@@ -350,7 +381,8 @@ static void serial_hangup(struct tty_struct *tty)
350 struct usb_serial_port *port = tty->driver_data; 381 struct usb_serial_port *port = tty->driver_data;
351 serial_do_down(port); 382 serial_do_down(port);
352 tty_port_hangup(&port->port); 383 tty_port_hangup(&port->port);
353 serial_do_free(port); 384 /* We must not free port yet - the USB serial layer depends on it's
385 continued existence */
354} 386}
355 387
356static int serial_write(struct tty_struct *tty, const unsigned char *buf, 388static int serial_write(struct tty_struct *tty, const unsigned char *buf,
@@ -389,7 +421,6 @@ static int serial_chars_in_buffer(struct tty_struct *tty)
389 struct usb_serial_port *port = tty->driver_data; 421 struct usb_serial_port *port = tty->driver_data;
390 dbg("%s = port %d", __func__, port->number); 422 dbg("%s = port %d", __func__, port->number);
391 423
392 WARN_ON(!port->port.count);
393 /* if the device was unplugged then any remaining characters 424 /* if the device was unplugged then any remaining characters
394 fell out of the connector ;) */ 425 fell out of the connector ;) */
395 if (port->serial->disconnected) 426 if (port->serial->disconnected)
diff --git a/drivers/usb/storage/option_ms.c b/drivers/usb/storage/option_ms.c
index d41cc0a970f7..773a5cd38c5a 100644
--- a/drivers/usb/storage/option_ms.c
+++ b/drivers/usb/storage/option_ms.c
@@ -118,6 +118,9 @@ static int option_inquiry(struct us_data *us)
118 118
119 result = memcmp(buffer+8, "Option", 6); 119 result = memcmp(buffer+8, "Option", 6);
120 120
121 if (result != 0)
122 result = memcmp(buffer+8, "ZCOPTION", 8);
123
121 /* Read the CSW */ 124 /* Read the CSW */
122 usb_stor_bulk_transfer_buf(us, 125 usb_stor_bulk_transfer_buf(us,
123 us->recv_bulk_pipe, 126 us->recv_bulk_pipe,
diff --git a/drivers/usb/storage/transport.c b/drivers/usb/storage/transport.c
index fcb320217218..e20dc525d177 100644
--- a/drivers/usb/storage/transport.c
+++ b/drivers/usb/storage/transport.c
@@ -961,7 +961,7 @@ int usb_stor_Bulk_max_lun(struct us_data *us)
961 US_BULK_GET_MAX_LUN, 961 US_BULK_GET_MAX_LUN,
962 USB_DIR_IN | USB_TYPE_CLASS | 962 USB_DIR_IN | USB_TYPE_CLASS |
963 USB_RECIP_INTERFACE, 963 USB_RECIP_INTERFACE,
964 0, us->ifnum, us->iobuf, 1, HZ); 964 0, us->ifnum, us->iobuf, 1, 10*HZ);
965 965
966 US_DEBUGP("GetMaxLUN command result is %d, data is %d\n", 966 US_DEBUGP("GetMaxLUN command result is %d, data is %d\n",
967 result, us->iobuf[0]); 967 result, us->iobuf[0]);
diff --git a/drivers/usb/storage/unusual_devs.h b/drivers/usb/storage/unusual_devs.h
index 1b9c5dd0fb27..7477d411959f 100644
--- a/drivers/usb/storage/unusual_devs.h
+++ b/drivers/usb/storage/unusual_devs.h
@@ -838,6 +838,13 @@ UNUSUAL_DEV( 0x066f, 0x8000, 0x0001, 0x0001,
838 US_SC_DEVICE, US_PR_DEVICE, NULL, 838 US_SC_DEVICE, US_PR_DEVICE, NULL,
839 US_FL_FIX_CAPACITY ), 839 US_FL_FIX_CAPACITY ),
840 840
841/* Reported by Rogerio Brito <rbrito@ime.usp.br> */
842UNUSUAL_DEV( 0x067b, 0x2317, 0x0001, 0x001,
843 "Prolific Technology, Inc.",
844 "Mass Storage Device",
845 US_SC_DEVICE, US_PR_DEVICE, NULL,
846 US_FL_NOT_LOCKABLE ),
847
841/* Reported by Richard -=[]=- <micro_flyer@hotmail.com> */ 848/* Reported by Richard -=[]=- <micro_flyer@hotmail.com> */
842/* Change to bcdDeviceMin (0x0100 to 0x0001) reported by 849/* Change to bcdDeviceMin (0x0100 to 0x0001) reported by
843 * Thomas Bartosik <tbartdev@gmx-topmail.de> */ 850 * Thomas Bartosik <tbartdev@gmx-topmail.de> */
diff --git a/drivers/video/Kconfig b/drivers/video/Kconfig
index d6d65ef85f54..3b54b3940178 100644
--- a/drivers/video/Kconfig
+++ b/drivers/video/Kconfig
@@ -616,6 +616,8 @@ config FB_STI
616 select FB_CFB_FILLRECT 616 select FB_CFB_FILLRECT
617 select FB_CFB_COPYAREA 617 select FB_CFB_COPYAREA
618 select FB_CFB_IMAGEBLIT 618 select FB_CFB_IMAGEBLIT
619 select STI_CONSOLE
620 select VT
619 default y 621 default y
620 ---help--- 622 ---help---
621 STI refers to the HP "Standard Text Interface" which is a set of 623 STI refers to the HP "Standard Text Interface" which is a set of
@@ -1117,12 +1119,13 @@ config FB_CARILLO_RANCH
1117 1119
1118config FB_INTEL 1120config FB_INTEL
1119 tristate "Intel 830M/845G/852GM/855GM/865G/915G/945G/945GM/965G/965GM support (EXPERIMENTAL)" 1121 tristate "Intel 830M/845G/852GM/855GM/865G/915G/945G/945GM/965G/965GM support (EXPERIMENTAL)"
1120 depends on EXPERIMENTAL && FB && PCI && X86 && AGP_INTEL 1122 depends on EXPERIMENTAL && FB && PCI && X86 && AGP_INTEL && EMBEDDED
1121 select FB_MODE_HELPERS 1123 select FB_MODE_HELPERS
1122 select FB_CFB_FILLRECT 1124 select FB_CFB_FILLRECT
1123 select FB_CFB_COPYAREA 1125 select FB_CFB_COPYAREA
1124 select FB_CFB_IMAGEBLIT 1126 select FB_CFB_IMAGEBLIT
1125 select FB_BOOT_VESA_SUPPORT if FB_INTEL = y 1127 select FB_BOOT_VESA_SUPPORT if FB_INTEL = y
1128 depends on !DRM_I915
1126 help 1129 help
1127 This driver supports the on-board graphics built in to the Intel 1130 This driver supports the on-board graphics built in to the Intel
1128 830M/845G/852GM/855GM/865G/915G/915GM/945G/945GM/965G/965GM chipsets. 1131 830M/845G/852GM/855GM/865G/915G/915GM/945G/945GM/965G/965GM chipsets.
diff --git a/drivers/video/amba-clcd.c b/drivers/video/amba-clcd.c
index fb8163d181ab..a21efcd10b78 100644
--- a/drivers/video/amba-clcd.c
+++ b/drivers/video/amba-clcd.c
@@ -226,9 +226,10 @@ static int clcdfb_set_par(struct fb_info *info)
226 clcdfb_enable(fb, regs.cntl); 226 clcdfb_enable(fb, regs.cntl);
227 227
228#ifdef DEBUG 228#ifdef DEBUG
229 printk(KERN_INFO "CLCD: Registers set to\n" 229 printk(KERN_INFO
230 KERN_INFO " %08x %08x %08x %08x\n" 230 "CLCD: Registers set to\n"
231 KERN_INFO " %08x %08x %08x %08x\n", 231 " %08x %08x %08x %08x\n"
232 " %08x %08x %08x %08x\n",
232 readl(fb->regs + CLCD_TIM0), readl(fb->regs + CLCD_TIM1), 233 readl(fb->regs + CLCD_TIM0), readl(fb->regs + CLCD_TIM1),
233 readl(fb->regs + CLCD_TIM2), readl(fb->regs + CLCD_TIM3), 234 readl(fb->regs + CLCD_TIM2), readl(fb->regs + CLCD_TIM3),
234 readl(fb->regs + CLCD_UBAS), readl(fb->regs + CLCD_LBAS), 235 readl(fb->regs + CLCD_UBAS), readl(fb->regs + CLCD_LBAS),
diff --git a/drivers/video/atafb.c b/drivers/video/atafb.c
index 018850c116c6..8cd279be74e5 100644
--- a/drivers/video/atafb.c
+++ b/drivers/video/atafb.c
@@ -2405,6 +2405,9 @@ static int do_fb_set_var(struct fb_var_screeninfo *var, int isactive)
2405 return 0; 2405 return 0;
2406} 2406}
2407 2407
2408/* fbhw->encode_fix() must be called with fb_info->mm_lock held
2409 * if it is called after the register_framebuffer() - not a case here
2410 */
2408static int atafb_get_fix(struct fb_fix_screeninfo *fix, struct fb_info *info) 2411static int atafb_get_fix(struct fb_fix_screeninfo *fix, struct fb_info *info)
2409{ 2412{
2410 struct atafb_par par; 2413 struct atafb_par par;
@@ -2414,7 +2417,8 @@ static int atafb_get_fix(struct fb_fix_screeninfo *fix, struct fb_info *info)
2414 if (err) 2417 if (err)
2415 return err; 2418 return err;
2416 memset(fix, 0, sizeof(struct fb_fix_screeninfo)); 2419 memset(fix, 0, sizeof(struct fb_fix_screeninfo));
2417 return fbhw->encode_fix(fix, &par); 2420 err = fbhw->encode_fix(fix, &par);
2421 return err;
2418} 2422}
2419 2423
2420static int atafb_get_var(struct fb_var_screeninfo *var, struct fb_info *info) 2424static int atafb_get_var(struct fb_var_screeninfo *var, struct fb_info *info)
@@ -2743,7 +2747,9 @@ static int atafb_set_par(struct fb_info *info)
2743 2747
2744 /* Decode wanted screen parameters */ 2748 /* Decode wanted screen parameters */
2745 fbhw->decode_var(&info->var, par); 2749 fbhw->decode_var(&info->var, par);
2750 mutex_lock(&info->mm_lock);
2746 fbhw->encode_fix(&info->fix, par); 2751 fbhw->encode_fix(&info->fix, par);
2752 mutex_unlock(&info->mm_lock);
2747 2753
2748 /* Set new videomode */ 2754 /* Set new videomode */
2749 ata_set_par(par); 2755 ata_set_par(par);
diff --git a/drivers/video/atmel_lcdfb.c b/drivers/video/atmel_lcdfb.c
index 5afd64482f55..da05f0801bb7 100644
--- a/drivers/video/atmel_lcdfb.c
+++ b/drivers/video/atmel_lcdfb.c
@@ -261,6 +261,9 @@ static inline void atmel_lcdfb_free_video_memory(struct atmel_lcdfb_info *sinfo)
261/** 261/**
262 * atmel_lcdfb_alloc_video_memory - Allocate framebuffer memory 262 * atmel_lcdfb_alloc_video_memory - Allocate framebuffer memory
263 * @sinfo: the frame buffer to allocate memory for 263 * @sinfo: the frame buffer to allocate memory for
264 *
265 * This function is called only from the atmel_lcdfb_probe()
266 * so no locking by fb_info->mm_lock around smem_len setting is needed.
264 */ 267 */
265static int atmel_lcdfb_alloc_video_memory(struct atmel_lcdfb_info *sinfo) 268static int atmel_lcdfb_alloc_video_memory(struct atmel_lcdfb_info *sinfo)
266{ 269{
diff --git a/drivers/video/aty/atyfb.h b/drivers/video/aty/atyfb.h
index 7691e73823d3..1f39a62f899b 100644
--- a/drivers/video/aty/atyfb.h
+++ b/drivers/video/aty/atyfb.h
@@ -187,6 +187,8 @@ struct atyfb_par {
187 int mtrr_reg; 187 int mtrr_reg;
188#endif 188#endif
189 u32 mem_cntl; 189 u32 mem_cntl;
190 struct crtc saved_crtc;
191 union aty_pll saved_pll;
190}; 192};
191 193
192 /* 194 /*
@@ -217,6 +219,7 @@ struct atyfb_par {
217#define M64F_XL_DLL 0x00080000 219#define M64F_XL_DLL 0x00080000
218#define M64F_MFB_FORCE_4 0x00100000 220#define M64F_MFB_FORCE_4 0x00100000
219#define M64F_HW_TRIPLE 0x00200000 221#define M64F_HW_TRIPLE 0x00200000
222#define M64F_XL_MEM 0x00400000
220 /* 223 /*
221 * Register access 224 * Register access
222 */ 225 */
diff --git a/drivers/video/aty/atyfb_base.c b/drivers/video/aty/atyfb_base.c
index 1207c208a30b..63d3739d43a8 100644
--- a/drivers/video/aty/atyfb_base.c
+++ b/drivers/video/aty/atyfb_base.c
@@ -66,6 +66,8 @@
66#include <linux/spinlock.h> 66#include <linux/spinlock.h>
67#include <linux/wait.h> 67#include <linux/wait.h>
68#include <linux/backlight.h> 68#include <linux/backlight.h>
69#include <linux/reboot.h>
70#include <linux/dmi.h>
69 71
70#include <asm/io.h> 72#include <asm/io.h>
71#include <linux/uaccess.h> 73#include <linux/uaccess.h>
@@ -249,8 +251,6 @@ static int aty_init(struct fb_info *info);
249static int store_video_par(char *videopar, unsigned char m64_num); 251static int store_video_par(char *videopar, unsigned char m64_num);
250#endif 252#endif
251 253
252static struct crtc saved_crtc;
253static union aty_pll saved_pll;
254static void aty_get_crtc(const struct atyfb_par *par, struct crtc *crtc); 254static void aty_get_crtc(const struct atyfb_par *par, struct crtc *crtc);
255 255
256static void aty_set_crtc(const struct atyfb_par *par, const struct crtc *crtc); 256static void aty_set_crtc(const struct atyfb_par *par, const struct crtc *crtc);
@@ -261,6 +261,8 @@ static void set_off_pitch(struct atyfb_par *par, const struct fb_info *info);
261static int read_aty_sense(const struct atyfb_par *par); 261static int read_aty_sense(const struct atyfb_par *par);
262#endif 262#endif
263 263
264static DEFINE_MUTEX(reboot_lock);
265static struct fb_info *reboot_info;
264 266
265 /* 267 /*
266 * Interface used by the world 268 * Interface used by the world
@@ -361,8 +363,8 @@ static unsigned long phys_guiregbase[FB_MAX] __devinitdata = { 0, };
361#define ATI_CHIP_264GTPRO (ATI_MODERN_SET | M64F_SDRAM_MAGIC_PLL | M64F_HW_TRIPLE | M64F_FIFO_32 | M64F_RESET_3D) 363#define ATI_CHIP_264GTPRO (ATI_MODERN_SET | M64F_SDRAM_MAGIC_PLL | M64F_HW_TRIPLE | M64F_FIFO_32 | M64F_RESET_3D)
362#define ATI_CHIP_264LTPRO (ATI_MODERN_SET | M64F_HW_TRIPLE | M64F_FIFO_32 | M64F_RESET_3D) 364#define ATI_CHIP_264LTPRO (ATI_MODERN_SET | M64F_HW_TRIPLE | M64F_FIFO_32 | M64F_RESET_3D)
363 365
364#define ATI_CHIP_264XL (ATI_MODERN_SET | M64F_HW_TRIPLE | M64F_FIFO_32 | M64F_RESET_3D | M64F_XL_DLL | M64F_MFB_FORCE_4) 366#define ATI_CHIP_264XL (ATI_MODERN_SET | M64F_HW_TRIPLE | M64F_FIFO_32 | M64F_RESET_3D | M64F_XL_DLL | M64F_MFB_FORCE_4 | M64F_XL_MEM)
365#define ATI_CHIP_MOBILITY (ATI_MODERN_SET | M64F_HW_TRIPLE | M64F_FIFO_32 | M64F_RESET_3D | M64F_XL_DLL | M64F_MFB_FORCE_4 | M64F_MOBIL_BUS) 367#define ATI_CHIP_MOBILITY (ATI_MODERN_SET | M64F_HW_TRIPLE | M64F_FIFO_32 | M64F_RESET_3D | M64F_XL_DLL | M64F_MFB_FORCE_4 | M64F_XL_MEM | M64F_MOBIL_BUS)
366 368
367static struct { 369static struct {
368 u16 pci_id; 370 u16 pci_id;
@@ -539,6 +541,7 @@ static char ram_edo[] __devinitdata = "EDO";
539static char ram_sdram[] __devinitdata = "SDRAM (1:1)"; 541static char ram_sdram[] __devinitdata = "SDRAM (1:1)";
540static char ram_sgram[] __devinitdata = "SGRAM (1:1)"; 542static char ram_sgram[] __devinitdata = "SGRAM (1:1)";
541static char ram_sdram32[] __devinitdata = "SDRAM (2:1) (32-bit)"; 543static char ram_sdram32[] __devinitdata = "SDRAM (2:1) (32-bit)";
544static char ram_wram[] __devinitdata = "WRAM";
542static char ram_off[] __devinitdata = "OFF"; 545static char ram_off[] __devinitdata = "OFF";
543#endif /* CONFIG_FB_ATY_CT */ 546#endif /* CONFIG_FB_ATY_CT */
544 547
@@ -553,6 +556,10 @@ static char *aty_gx_ram[8] __devinitdata = {
553#ifdef CONFIG_FB_ATY_CT 556#ifdef CONFIG_FB_ATY_CT
554static char *aty_ct_ram[8] __devinitdata = { 557static char *aty_ct_ram[8] __devinitdata = {
555 ram_off, ram_dram, ram_edo, ram_edo, 558 ram_off, ram_dram, ram_edo, ram_edo,
559 ram_sdram, ram_sgram, ram_wram, ram_resv
560};
561static char *aty_xl_ram[8] __devinitdata = {
562 ram_off, ram_dram, ram_edo, ram_edo,
556 ram_sdram, ram_sgram, ram_sdram32, ram_resv 563 ram_sdram, ram_sgram, ram_sdram32, ram_resv
557}; 564};
558#endif /* CONFIG_FB_ATY_CT */ 565#endif /* CONFIG_FB_ATY_CT */
@@ -760,6 +767,17 @@ static void aty_set_crtc(const struct atyfb_par *par, const struct crtc *crtc)
760#endif /* CONFIG_FB_ATY_GENERIC_LCD */ 767#endif /* CONFIG_FB_ATY_GENERIC_LCD */
761} 768}
762 769
770static u32 calc_line_length(struct atyfb_par *par, u32 vxres, u32 bpp)
771{
772 u32 line_length = vxres * bpp / 8;
773
774 if (par->ram_type == SGRAM ||
775 (!M64_HAS(XL_MEM) && par->ram_type == WRAM))
776 line_length = (line_length + 63) & ~63;
777
778 return line_length;
779}
780
763static int aty_var_to_crtc(const struct fb_info *info, 781static int aty_var_to_crtc(const struct fb_info *info,
764 const struct fb_var_screeninfo *var, struct crtc *crtc) 782 const struct fb_var_screeninfo *var, struct crtc *crtc)
765{ 783{
@@ -769,13 +787,14 @@ static int aty_var_to_crtc(const struct fb_info *info,
769 u32 h_total, h_disp, h_sync_strt, h_sync_end, h_sync_dly, h_sync_wid, h_sync_pol; 787 u32 h_total, h_disp, h_sync_strt, h_sync_end, h_sync_dly, h_sync_wid, h_sync_pol;
770 u32 v_total, v_disp, v_sync_strt, v_sync_end, v_sync_wid, v_sync_pol, c_sync; 788 u32 v_total, v_disp, v_sync_strt, v_sync_end, v_sync_wid, v_sync_pol, c_sync;
771 u32 pix_width, dp_pix_width, dp_chain_mask; 789 u32 pix_width, dp_pix_width, dp_chain_mask;
790 u32 line_length;
772 791
773 /* input */ 792 /* input */
774 xres = var->xres; 793 xres = (var->xres + 7) & ~7;
775 yres = var->yres; 794 yres = var->yres;
776 vxres = var->xres_virtual; 795 vxres = (var->xres_virtual + 7) & ~7;
777 vyres = var->yres_virtual; 796 vyres = var->yres_virtual;
778 xoffset = var->xoffset; 797 xoffset = (var->xoffset + 7) & ~7;
779 yoffset = var->yoffset; 798 yoffset = var->yoffset;
780 bpp = var->bits_per_pixel; 799 bpp = var->bits_per_pixel;
781 if (bpp == 16) 800 if (bpp == 16)
@@ -827,7 +846,9 @@ static int aty_var_to_crtc(const struct fb_info *info,
827 } else 846 } else
828 FAIL("invalid bpp"); 847 FAIL("invalid bpp");
829 848
830 if (vxres * vyres * bpp / 8 > info->fix.smem_len) 849 line_length = calc_line_length(par, vxres, bpp);
850
851 if (vyres * line_length > info->fix.smem_len)
831 FAIL("not enough video RAM"); 852 FAIL("not enough video RAM");
832 853
833 h_sync_pol = sync & FB_SYNC_HOR_HIGH_ACT ? 0 : 1; 854 h_sync_pol = sync & FB_SYNC_HOR_HIGH_ACT ? 0 : 1;
@@ -969,7 +990,9 @@ static int aty_var_to_crtc(const struct fb_info *info,
969 crtc->xoffset = xoffset; 990 crtc->xoffset = xoffset;
970 crtc->yoffset = yoffset; 991 crtc->yoffset = yoffset;
971 crtc->bpp = bpp; 992 crtc->bpp = bpp;
972 crtc->off_pitch = ((yoffset*vxres+xoffset)*bpp/64) | (vxres<<19); 993 crtc->off_pitch =
994 ((yoffset * line_length + xoffset * bpp / 8) / 8) |
995 ((line_length / bpp) << 22);
973 crtc->vline_crnt_vline = 0; 996 crtc->vline_crnt_vline = 0;
974 997
975 crtc->h_tot_disp = h_total | (h_disp<<16); 998 crtc->h_tot_disp = h_total | (h_disp<<16);
@@ -1394,7 +1417,9 @@ static int atyfb_set_par(struct fb_info *info)
1394 } 1417 }
1395 aty_st_8(DAC_MASK, 0xff, par); 1418 aty_st_8(DAC_MASK, 0xff, par);
1396 1419
1397 info->fix.line_length = var->xres_virtual * var->bits_per_pixel/8; 1420 info->fix.line_length = calc_line_length(par, var->xres_virtual,
1421 var->bits_per_pixel);
1422
1398 info->fix.visual = var->bits_per_pixel <= 8 ? 1423 info->fix.visual = var->bits_per_pixel <= 8 ?
1399 FB_VISUAL_PSEUDOCOLOR : FB_VISUAL_DIRECTCOLOR; 1424 FB_VISUAL_PSEUDOCOLOR : FB_VISUAL_DIRECTCOLOR;
1400 1425
@@ -1505,10 +1530,12 @@ static void set_off_pitch(struct atyfb_par *par, const struct fb_info *info)
1505{ 1530{
1506 u32 xoffset = info->var.xoffset; 1531 u32 xoffset = info->var.xoffset;
1507 u32 yoffset = info->var.yoffset; 1532 u32 yoffset = info->var.yoffset;
1508 u32 vxres = par->crtc.vxres; 1533 u32 line_length = info->fix.line_length;
1509 u32 bpp = info->var.bits_per_pixel; 1534 u32 bpp = info->var.bits_per_pixel;
1510 1535
1511 par->crtc.off_pitch = ((yoffset * vxres + xoffset) * bpp / 64) | (vxres << 19); 1536 par->crtc.off_pitch =
1537 ((yoffset * line_length + xoffset * bpp / 8) / 8) |
1538 ((line_length / bpp) << 22);
1512} 1539}
1513 1540
1514 1541
@@ -2201,7 +2228,7 @@ static void __devinit aty_calc_mem_refresh(struct atyfb_par *par, int xclk)
2201 const int *refresh_tbl; 2228 const int *refresh_tbl;
2202 int i, size; 2229 int i, size;
2203 2230
2204 if (IS_XL(par->pci_id) || IS_MOBILITY(par->pci_id)) { 2231 if (M64_HAS(XL_MEM)) {
2205 refresh_tbl = ragexl_tbl; 2232 refresh_tbl = ragexl_tbl;
2206 size = ARRAY_SIZE(ragexl_tbl); 2233 size = ARRAY_SIZE(ragexl_tbl);
2207 } else { 2234 } else {
@@ -2335,7 +2362,10 @@ static int __devinit aty_init(struct fb_info *info)
2335 par->pll_ops = &aty_pll_ct; 2362 par->pll_ops = &aty_pll_ct;
2336 par->bus_type = PCI; 2363 par->bus_type = PCI;
2337 par->ram_type = (aty_ld_le32(CNFG_STAT0, par) & 0x07); 2364 par->ram_type = (aty_ld_le32(CNFG_STAT0, par) & 0x07);
2338 ramname = aty_ct_ram[par->ram_type]; 2365 if (M64_HAS(XL_MEM))
2366 ramname = aty_xl_ram[par->ram_type];
2367 else
2368 ramname = aty_ct_ram[par->ram_type];
2339 /* for many chips, the mclk is 67 MHz for SDRAM, 63 MHz otherwise */ 2369 /* for many chips, the mclk is 67 MHz for SDRAM, 63 MHz otherwise */
2340 if (par->pll_limits.mclk == 67 && par->ram_type < SDRAM) 2370 if (par->pll_limits.mclk == 67 && par->ram_type < SDRAM)
2341 par->pll_limits.mclk = 63; 2371 par->pll_limits.mclk = 63;
@@ -2390,9 +2420,9 @@ static int __devinit aty_init(struct fb_info *info)
2390#endif /* CONFIG_FB_ATY_CT */ 2420#endif /* CONFIG_FB_ATY_CT */
2391 2421
2392 /* save previous video mode */ 2422 /* save previous video mode */
2393 aty_get_crtc(par, &saved_crtc); 2423 aty_get_crtc(par, &par->saved_crtc);
2394 if(par->pll_ops->get_pll) 2424 if(par->pll_ops->get_pll)
2395 par->pll_ops->get_pll(info, &saved_pll); 2425 par->pll_ops->get_pll(info, &par->saved_pll);
2396 2426
2397 par->mem_cntl = aty_ld_le32(MEM_CNTL, par); 2427 par->mem_cntl = aty_ld_le32(MEM_CNTL, par);
2398 gtb_memsize = M64_HAS(GTB_DSP); 2428 gtb_memsize = M64_HAS(GTB_DSP);
@@ -2667,8 +2697,8 @@ static int __devinit aty_init(struct fb_info *info)
2667 2697
2668aty_init_exit: 2698aty_init_exit:
2669 /* restore video mode */ 2699 /* restore video mode */
2670 aty_set_crtc(par, &saved_crtc); 2700 aty_set_crtc(par, &par->saved_crtc);
2671 par->pll_ops->set_pll(info, &saved_pll); 2701 par->pll_ops->set_pll(info, &par->saved_pll);
2672 2702
2673#ifdef CONFIG_MTRR 2703#ifdef CONFIG_MTRR
2674 if (par->mtrr_reg >= 0) { 2704 if (par->mtrr_reg >= 0) {
@@ -3502,6 +3532,11 @@ static int __devinit atyfb_pci_probe(struct pci_dev *pdev, const struct pci_devi
3502 par->mmap_map[1].prot_flag = _PAGE_E; 3532 par->mmap_map[1].prot_flag = _PAGE_E;
3503#endif /* __sparc__ */ 3533#endif /* __sparc__ */
3504 3534
3535 mutex_lock(&reboot_lock);
3536 if (!reboot_info)
3537 reboot_info = info;
3538 mutex_unlock(&reboot_lock);
3539
3505 return 0; 3540 return 0;
3506 3541
3507err_release_io: 3542err_release_io:
@@ -3614,8 +3649,8 @@ static void __devexit atyfb_remove(struct fb_info *info)
3614 struct atyfb_par *par = (struct atyfb_par *) info->par; 3649 struct atyfb_par *par = (struct atyfb_par *) info->par;
3615 3650
3616 /* restore video mode */ 3651 /* restore video mode */
3617 aty_set_crtc(par, &saved_crtc); 3652 aty_set_crtc(par, &par->saved_crtc);
3618 par->pll_ops->set_pll(info, &saved_pll); 3653 par->pll_ops->set_pll(info, &par->saved_pll);
3619 3654
3620 unregister_framebuffer(info); 3655 unregister_framebuffer(info);
3621 3656
@@ -3661,6 +3696,11 @@ static void __devexit atyfb_pci_remove(struct pci_dev *pdev)
3661{ 3696{
3662 struct fb_info *info = pci_get_drvdata(pdev); 3697 struct fb_info *info = pci_get_drvdata(pdev);
3663 3698
3699 mutex_lock(&reboot_lock);
3700 if (reboot_info == info)
3701 reboot_info = NULL;
3702 mutex_unlock(&reboot_lock);
3703
3664 atyfb_remove(info); 3704 atyfb_remove(info);
3665} 3705}
3666 3706
@@ -3808,6 +3848,56 @@ static int __init atyfb_setup(char *options)
3808} 3848}
3809#endif /* MODULE */ 3849#endif /* MODULE */
3810 3850
3851static int atyfb_reboot_notify(struct notifier_block *nb,
3852 unsigned long code, void *unused)
3853{
3854 struct atyfb_par *par;
3855
3856 if (code != SYS_RESTART)
3857 return NOTIFY_DONE;
3858
3859 mutex_lock(&reboot_lock);
3860
3861 if (!reboot_info)
3862 goto out;
3863
3864 if (!lock_fb_info(reboot_info))
3865 goto out;
3866
3867 par = reboot_info->par;
3868
3869 /*
3870 * HP OmniBook 500's BIOS doesn't like the state of the
3871 * hardware after atyfb has been used. Restore the hardware
3872 * to the original state to allow successful reboots.
3873 */
3874 aty_set_crtc(par, &par->saved_crtc);
3875 par->pll_ops->set_pll(reboot_info, &par->saved_pll);
3876
3877 unlock_fb_info(reboot_info);
3878 out:
3879 mutex_unlock(&reboot_lock);
3880
3881 return NOTIFY_DONE;
3882}
3883
3884static struct notifier_block atyfb_reboot_notifier = {
3885 .notifier_call = atyfb_reboot_notify,
3886};
3887
3888static const struct dmi_system_id atyfb_reboot_ids[] = {
3889 {
3890 .ident = "HP OmniBook 500",
3891 .matches = {
3892 DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
3893 DMI_MATCH(DMI_PRODUCT_NAME, "HP OmniBook PC"),
3894 DMI_MATCH(DMI_PRODUCT_VERSION, "HP OmniBook 500 FA"),
3895 },
3896 },
3897
3898 { }
3899};
3900
3811static int __init atyfb_init(void) 3901static int __init atyfb_init(void)
3812{ 3902{
3813 int err1 = 1, err2 = 1; 3903 int err1 = 1, err2 = 1;
@@ -3826,11 +3916,20 @@ static int __init atyfb_init(void)
3826 err2 = atyfb_atari_probe(); 3916 err2 = atyfb_atari_probe();
3827#endif 3917#endif
3828 3918
3829 return (err1 && err2) ? -ENODEV : 0; 3919 if (err1 && err2)
3920 return -ENODEV;
3921
3922 if (dmi_check_system(atyfb_reboot_ids))
3923 register_reboot_notifier(&atyfb_reboot_notifier);
3924
3925 return 0;
3830} 3926}
3831 3927
3832static void __exit atyfb_exit(void) 3928static void __exit atyfb_exit(void)
3833{ 3929{
3930 if (dmi_check_system(atyfb_reboot_ids))
3931 unregister_reboot_notifier(&atyfb_reboot_notifier);
3932
3834#ifdef CONFIG_PCI 3933#ifdef CONFIG_PCI
3835 pci_unregister_driver(&atyfb_driver); 3934 pci_unregister_driver(&atyfb_driver);
3836#endif 3935#endif
diff --git a/drivers/video/aty/mach64_accel.c b/drivers/video/aty/mach64_accel.c
index 0cc9724e61a2..51fcc0a2c94a 100644
--- a/drivers/video/aty/mach64_accel.c
+++ b/drivers/video/aty/mach64_accel.c
@@ -63,14 +63,17 @@ static void reset_GTC_3D_engine(const struct atyfb_par *par)
63void aty_init_engine(struct atyfb_par *par, struct fb_info *info) 63void aty_init_engine(struct atyfb_par *par, struct fb_info *info)
64{ 64{
65 u32 pitch_value; 65 u32 pitch_value;
66 u32 vxres;
66 67
67 /* determine modal information from global mode structure */ 68 /* determine modal information from global mode structure */
68 pitch_value = info->var.xres_virtual; 69 pitch_value = info->fix.line_length / (info->var.bits_per_pixel / 8);
70 vxres = info->var.xres_virtual;
69 71
70 if (info->var.bits_per_pixel == 24) { 72 if (info->var.bits_per_pixel == 24) {
71 /* In 24 bpp, the engine is in 8 bpp - this requires that all */ 73 /* In 24 bpp, the engine is in 8 bpp - this requires that all */
72 /* horizontal coordinates and widths must be adjusted */ 74 /* horizontal coordinates and widths must be adjusted */
73 pitch_value *= 3; 75 pitch_value *= 3;
76 vxres *= 3;
74 } 77 }
75 78
76 /* On GTC (RagePro), we need to reset the 3D engine before */ 79 /* On GTC (RagePro), we need to reset the 3D engine before */
@@ -133,7 +136,7 @@ void aty_init_engine(struct atyfb_par *par, struct fb_info *info)
133 aty_st_le32(SC_LEFT, 0, par); 136 aty_st_le32(SC_LEFT, 0, par);
134 aty_st_le32(SC_TOP, 0, par); 137 aty_st_le32(SC_TOP, 0, par);
135 aty_st_le32(SC_BOTTOM, par->crtc.vyres - 1, par); 138 aty_st_le32(SC_BOTTOM, par->crtc.vyres - 1, par);
136 aty_st_le32(SC_RIGHT, pitch_value - 1, par); 139 aty_st_le32(SC_RIGHT, vxres - 1, par);
137 140
138 /* set background color to minimum value (usually BLACK) */ 141 /* set background color to minimum value (usually BLACK) */
139 aty_st_le32(DP_BKGD_CLR, 0, par); 142 aty_st_le32(DP_BKGD_CLR, 0, par);
diff --git a/drivers/video/backlight/jornada720_bl.c b/drivers/video/backlight/jornada720_bl.c
index c3ebb6b41ce1..7aed2565c1bd 100644
--- a/drivers/video/backlight/jornada720_bl.c
+++ b/drivers/video/backlight/jornada720_bl.c
@@ -72,7 +72,7 @@ static int jornada_bl_update_status(struct backlight_device *bd)
72 if (jornada_ssp_byte(SETBRIGHTNESS) != TXDUMMY) { 72 if (jornada_ssp_byte(SETBRIGHTNESS) != TXDUMMY) {
73 printk(KERN_INFO "bl : failed to set brightness\n"); 73 printk(KERN_INFO "bl : failed to set brightness\n");
74 ret = -ETIMEDOUT; 74 ret = -ETIMEDOUT;
75 goto out 75 goto out;
76 } 76 }
77 77
78 /* at this point we expect that the mcu has accepted 78 /* at this point we expect that the mcu has accepted
diff --git a/drivers/video/backlight/pwm_bl.c b/drivers/video/backlight/pwm_bl.c
index e641584e212e..887166267443 100644
--- a/drivers/video/backlight/pwm_bl.c
+++ b/drivers/video/backlight/pwm_bl.c
@@ -145,6 +145,8 @@ static int pwm_backlight_suspend(struct platform_device *pdev,
145 struct backlight_device *bl = platform_get_drvdata(pdev); 145 struct backlight_device *bl = platform_get_drvdata(pdev);
146 struct pwm_bl_data *pb = dev_get_drvdata(&bl->dev); 146 struct pwm_bl_data *pb = dev_get_drvdata(&bl->dev);
147 147
148 if (pb->notify)
149 pb->notify(0);
148 pwm_config(pb->pwm, 0, pb->period); 150 pwm_config(pb->pwm, 0, pb->period);
149 pwm_disable(pb->pwm); 151 pwm_disable(pb->pwm);
150 return 0; 152 return 0;
diff --git a/drivers/video/backlight/tdo24m.c b/drivers/video/backlight/tdo24m.c
index 1dae7f8f3c6b..51422fc4f606 100644
--- a/drivers/video/backlight/tdo24m.c
+++ b/drivers/video/backlight/tdo24m.c
@@ -356,7 +356,7 @@ static int __devinit tdo24m_probe(struct spi_device *spi)
356 lcd->power = FB_BLANK_POWERDOWN; 356 lcd->power = FB_BLANK_POWERDOWN;
357 lcd->mode = MODE_VGA; /* default to VGA */ 357 lcd->mode = MODE_VGA; /* default to VGA */
358 358
359 lcd->buf = kmalloc(TDO24M_SPI_BUFF_SIZE, sizeof(GFP_KERNEL)); 359 lcd->buf = kmalloc(TDO24M_SPI_BUFF_SIZE, GFP_KERNEL);
360 if (lcd->buf == NULL) { 360 if (lcd->buf == NULL) {
361 kfree(lcd); 361 kfree(lcd);
362 return -ENOMEM; 362 return -ENOMEM;
diff --git a/drivers/video/cobalt_lcdfb.c b/drivers/video/cobalt_lcdfb.c
index 7bad24ed04ef..108b89e09a80 100644
--- a/drivers/video/cobalt_lcdfb.c
+++ b/drivers/video/cobalt_lcdfb.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * Cobalt server LCD frame buffer driver. 2 * Cobalt server LCD frame buffer driver.
3 * 3 *
4 * Copyright (C) 2008 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> 4 * Copyright (C) 2008 Yoichi Yuasa <yuasa@linux-mips.org>
5 * 5 *
6 * This program is free software; you can redistribute it and/or modify 6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by 7 * it under the terms of the GNU General Public License as published by
diff --git a/drivers/video/console/fbcon.c b/drivers/video/console/fbcon.c
index 471a9a60376a..3a44695b9c09 100644
--- a/drivers/video/console/fbcon.c
+++ b/drivers/video/console/fbcon.c
@@ -1082,7 +1082,6 @@ static void fbcon_init(struct vc_data *vc, int init)
1082 new_rows = FBCON_SWAP(ops->rotate, info->var.yres, info->var.xres); 1082 new_rows = FBCON_SWAP(ops->rotate, info->var.yres, info->var.xres);
1083 new_cols /= vc->vc_font.width; 1083 new_cols /= vc->vc_font.width;
1084 new_rows /= vc->vc_font.height; 1084 new_rows /= vc->vc_font.height;
1085 vc_resize(vc, new_cols, new_rows);
1086 1085
1087 /* 1086 /*
1088 * We must always set the mode. The mode of the previous console 1087 * We must always set the mode. The mode of the previous console
@@ -1111,10 +1110,11 @@ static void fbcon_init(struct vc_data *vc, int init)
1111 * vc_{cols,rows}, but we must not set those if we are only 1110 * vc_{cols,rows}, but we must not set those if we are only
1112 * resizing the console. 1111 * resizing the console.
1113 */ 1112 */
1114 if (!init) { 1113 if (init) {
1115 vc->vc_cols = new_cols; 1114 vc->vc_cols = new_cols;
1116 vc->vc_rows = new_rows; 1115 vc->vc_rows = new_rows;
1117 } 1116 } else
1117 vc_resize(vc, new_cols, new_rows);
1118 1118
1119 if (logo) 1119 if (logo)
1120 fbcon_prepare_logo(vc, info, cols, rows, new_cols, new_rows); 1120 fbcon_prepare_logo(vc, info, cols, rows, new_cols, new_rows);
diff --git a/drivers/video/console/fbcon_rotate.h b/drivers/video/console/fbcon_rotate.h
index 75be5ce53dc5..e233444cda66 100644
--- a/drivers/video/console/fbcon_rotate.h
+++ b/drivers/video/console/fbcon_rotate.h
@@ -45,7 +45,7 @@ static inline void rotate_ud(const char *in, char *out, u32 width, u32 height)
45 width = (width + 7) & ~7; 45 width = (width + 7) & ~7;
46 46
47 for (i = 0; i < height; i++) { 47 for (i = 0; i < height; i++) {
48 for (j = 0; j < width; j++) { 48 for (j = 0; j < width - shift; j++) {
49 if (pattern_test_bit(j, i, width, in)) 49 if (pattern_test_bit(j, i, width, in))
50 pattern_set_bit(width - (1 + j + shift), 50 pattern_set_bit(width - (1 + j + shift),
51 height - (1 + i), 51 height - (1 + i),
diff --git a/drivers/video/console/sticore.c b/drivers/video/console/sticore.c
index ef7870f5ea08..857b3668b3ba 100644
--- a/drivers/video/console/sticore.c
+++ b/drivers/video/console/sticore.c
@@ -957,9 +957,14 @@ static int __devinit sticore_pci_init(struct pci_dev *pd,
957#ifdef CONFIG_PCI 957#ifdef CONFIG_PCI
958 unsigned long fb_base, rom_base; 958 unsigned long fb_base, rom_base;
959 unsigned int fb_len, rom_len; 959 unsigned int fb_len, rom_len;
960 int err;
960 struct sti_struct *sti; 961 struct sti_struct *sti;
961 962
962 pci_enable_device(pd); 963 err = pci_enable_device(pd);
964 if (err < 0) {
965 dev_err(&pd->dev, "Cannot enable PCI device\n");
966 return err;
967 }
963 968
964 fb_base = pci_resource_start(pd, 0); 969 fb_base = pci_resource_start(pd, 0);
965 fb_len = pci_resource_len(pd, 0); 970 fb_len = pci_resource_len(pd, 0);
@@ -1048,7 +1053,7 @@ static void __devinit sti_init_roms(void)
1048 1053
1049 /* Register drivers for native & PCI cards */ 1054 /* Register drivers for native & PCI cards */
1050 register_parisc_driver(&pa_sti_driver); 1055 register_parisc_driver(&pa_sti_driver);
1051 pci_register_driver(&pci_sti_driver); 1056 WARN_ON(pci_register_driver(&pci_sti_driver));
1052 1057
1053 /* if we didn't find the given default sti, take the first one */ 1058 /* if we didn't find the given default sti, take the first one */
1054 if (!default_sti) 1059 if (!default_sti)
diff --git a/drivers/video/fbmem.c b/drivers/video/fbmem.c
index f8a09bf8d0cd..a85c818be945 100644
--- a/drivers/video/fbmem.c
+++ b/drivers/video/fbmem.c
@@ -16,7 +16,6 @@
16#include <linux/compat.h> 16#include <linux/compat.h>
17#include <linux/types.h> 17#include <linux/types.h>
18#include <linux/errno.h> 18#include <linux/errno.h>
19#include <linux/smp_lock.h>
20#include <linux/kernel.h> 19#include <linux/kernel.h>
21#include <linux/major.h> 20#include <linux/major.h>
22#include <linux/slab.h> 21#include <linux/slab.h>
@@ -1310,8 +1309,6 @@ static long fb_compat_ioctl(struct file *file, unsigned int cmd,
1310 1309
1311static int 1310static int
1312fb_mmap(struct file *file, struct vm_area_struct * vma) 1311fb_mmap(struct file *file, struct vm_area_struct * vma)
1313__acquires(&info->lock)
1314__releases(&info->lock)
1315{ 1312{
1316 int fbidx = iminor(file->f_path.dentry->d_inode); 1313 int fbidx = iminor(file->f_path.dentry->d_inode);
1317 struct fb_info *info = registered_fb[fbidx]; 1314 struct fb_info *info = registered_fb[fbidx];
@@ -1325,16 +1322,14 @@ __releases(&info->lock)
1325 off = vma->vm_pgoff << PAGE_SHIFT; 1322 off = vma->vm_pgoff << PAGE_SHIFT;
1326 if (!fb) 1323 if (!fb)
1327 return -ENODEV; 1324 return -ENODEV;
1325 mutex_lock(&info->mm_lock);
1328 if (fb->fb_mmap) { 1326 if (fb->fb_mmap) {
1329 int res; 1327 int res;
1330 mutex_lock(&info->lock);
1331 res = fb->fb_mmap(info, vma); 1328 res = fb->fb_mmap(info, vma);
1332 mutex_unlock(&info->lock); 1329 mutex_unlock(&info->mm_lock);
1333 return res; 1330 return res;
1334 } 1331 }
1335 1332
1336 mutex_lock(&info->lock);
1337
1338 /* frame buffer memory */ 1333 /* frame buffer memory */
1339 start = info->fix.smem_start; 1334 start = info->fix.smem_start;
1340 len = PAGE_ALIGN((start & ~PAGE_MASK) + info->fix.smem_len); 1335 len = PAGE_ALIGN((start & ~PAGE_MASK) + info->fix.smem_len);
@@ -1342,13 +1337,13 @@ __releases(&info->lock)
1342 /* memory mapped io */ 1337 /* memory mapped io */
1343 off -= len; 1338 off -= len;
1344 if (info->var.accel_flags) { 1339 if (info->var.accel_flags) {
1345 mutex_unlock(&info->lock); 1340 mutex_unlock(&info->mm_lock);
1346 return -EINVAL; 1341 return -EINVAL;
1347 } 1342 }
1348 start = info->fix.mmio_start; 1343 start = info->fix.mmio_start;
1349 len = PAGE_ALIGN((start & ~PAGE_MASK) + info->fix.mmio_len); 1344 len = PAGE_ALIGN((start & ~PAGE_MASK) + info->fix.mmio_len);
1350 } 1345 }
1351 mutex_unlock(&info->lock); 1346 mutex_unlock(&info->mm_lock);
1352 start &= PAGE_MASK; 1347 start &= PAGE_MASK;
1353 if ((vma->vm_end - vma->vm_start + off) > len) 1348 if ((vma->vm_end - vma->vm_start + off) > len)
1354 return -EINVAL; 1349 return -EINVAL;
@@ -1518,6 +1513,7 @@ register_framebuffer(struct fb_info *fb_info)
1518 break; 1513 break;
1519 fb_info->node = i; 1514 fb_info->node = i;
1520 mutex_init(&fb_info->lock); 1515 mutex_init(&fb_info->lock);
1516 mutex_init(&fb_info->mm_lock);
1521 1517
1522 fb_info->dev = device_create(fb_class, fb_info->device, 1518 fb_info->dev = device_create(fb_class, fb_info->device,
1523 MKDEV(FB_MAJOR, i), NULL, "fb%d", i); 1519 MKDEV(FB_MAJOR, i), NULL, "fb%d", i);
diff --git a/drivers/video/fbmon.c b/drivers/video/fbmon.c
index 5c1a2c01778f..9ae9cd32bd06 100644
--- a/drivers/video/fbmon.c
+++ b/drivers/video/fbmon.c
@@ -256,8 +256,8 @@ static void fix_edid(unsigned char *edid, int fix)
256 256
257static int edid_checksum(unsigned char *edid) 257static int edid_checksum(unsigned char *edid)
258{ 258{
259 unsigned char i, csum = 0, all_null = 0; 259 unsigned char csum = 0, all_null = 0;
260 int err = 0, fix = check_edid(edid); 260 int i, err = 0, fix = check_edid(edid);
261 261
262 if (fix) 262 if (fix)
263 fix_edid(edid, fix); 263 fix_edid(edid, fix);
diff --git a/drivers/video/fsl-diu-fb.c b/drivers/video/fsl-diu-fb.c
index f153c581cbd7..72d68b3dc478 100644
--- a/drivers/video/fsl-diu-fb.c
+++ b/drivers/video/fsl-diu-fb.c
@@ -750,24 +750,26 @@ static void update_lcdc(struct fb_info *info)
750static int map_video_memory(struct fb_info *info) 750static int map_video_memory(struct fb_info *info)
751{ 751{
752 phys_addr_t phys; 752 phys_addr_t phys;
753 u32 smem_len = info->fix.line_length * info->var.yres_virtual;
753 754
754 pr_debug("info->var.xres_virtual = %d\n", info->var.xres_virtual); 755 pr_debug("info->var.xres_virtual = %d\n", info->var.xres_virtual);
755 pr_debug("info->var.yres_virtual = %d\n", info->var.yres_virtual); 756 pr_debug("info->var.yres_virtual = %d\n", info->var.yres_virtual);
756 pr_debug("info->fix.line_length = %d\n", info->fix.line_length); 757 pr_debug("info->fix.line_length = %d\n", info->fix.line_length);
758 pr_debug("MAP_VIDEO_MEMORY: smem_len = %u\n", smem_len);
757 759
758 info->fix.smem_len = info->fix.line_length * info->var.yres_virtual; 760 info->screen_base = fsl_diu_alloc(smem_len, &phys);
759 pr_debug("MAP_VIDEO_MEMORY: smem_len = %d\n", info->fix.smem_len);
760 info->screen_base = fsl_diu_alloc(info->fix.smem_len, &phys);
761 if (info->screen_base == NULL) { 761 if (info->screen_base == NULL) {
762 printk(KERN_ERR "Unable to allocate fb memory\n"); 762 printk(KERN_ERR "Unable to allocate fb memory\n");
763 return -ENOMEM; 763 return -ENOMEM;
764 } 764 }
765 mutex_lock(&info->mm_lock);
765 info->fix.smem_start = (unsigned long) phys; 766 info->fix.smem_start = (unsigned long) phys;
767 info->fix.smem_len = smem_len;
768 mutex_unlock(&info->mm_lock);
766 info->screen_size = info->fix.smem_len; 769 info->screen_size = info->fix.smem_len;
767 770
768 pr_debug("Allocated fb @ paddr=0x%08lx, size=%d.\n", 771 pr_debug("Allocated fb @ paddr=0x%08lx, size=%d.\n",
769 info->fix.smem_start, 772 info->fix.smem_start, info->fix.smem_len);
770 info->fix.smem_len);
771 pr_debug("screen base %p\n", info->screen_base); 773 pr_debug("screen base %p\n", info->screen_base);
772 774
773 return 0; 775 return 0;
@@ -776,9 +778,11 @@ static int map_video_memory(struct fb_info *info)
776static void unmap_video_memory(struct fb_info *info) 778static void unmap_video_memory(struct fb_info *info)
777{ 779{
778 fsl_diu_free(info->screen_base, info->fix.smem_len); 780 fsl_diu_free(info->screen_base, info->fix.smem_len);
781 mutex_lock(&info->mm_lock);
779 info->screen_base = NULL; 782 info->screen_base = NULL;
780 info->fix.smem_start = 0; 783 info->fix.smem_start = 0;
781 info->fix.smem_len = 0; 784 info->fix.smem_len = 0;
785 mutex_unlock(&info->mm_lock);
782} 786}
783 787
784/* 788/*
@@ -1219,12 +1223,6 @@ static int __devinit install_fb(struct fb_info *info)
1219 return -EINVAL; 1223 return -EINVAL;
1220 } 1224 }
1221 1225
1222 if (fsl_diu_set_par(info)) {
1223 printk(KERN_ERR "fb_set_par failed");
1224 fb_dealloc_cmap(&info->cmap);
1225 return -EINVAL;
1226 }
1227
1228 if (register_framebuffer(info) < 0) { 1226 if (register_framebuffer(info) < 0) {
1229 printk(KERN_ERR "register_framebuffer failed"); 1227 printk(KERN_ERR "register_framebuffer failed");
1230 unmap_video_memory(info); 1228 unmap_video_memory(info);
diff --git a/drivers/video/hitfb.c b/drivers/video/hitfb.c
index 020db7fc9153..e7116a6d82d3 100644
--- a/drivers/video/hitfb.c
+++ b/drivers/video/hitfb.c
@@ -44,9 +44,6 @@ static struct fb_fix_screeninfo hitfb_fix __initdata = {
44 .accel = FB_ACCEL_NONE, 44 .accel = FB_ACCEL_NONE,
45}; 45};
46 46
47static u32 pseudo_palette[16];
48static struct fb_info fb_info;
49
50static inline void hitfb_accel_wait(void) 47static inline void hitfb_accel_wait(void)
51{ 48{
52 while (fb_readw(HD64461_GRCFGR) & HD64461_GRCFGR_ACCSTATUS) ; 49 while (fb_readw(HD64461_GRCFGR) & HD64461_GRCFGR_ACCSTATUS) ;
@@ -331,6 +328,8 @@ static struct fb_ops hitfb_ops = {
331static int __init hitfb_probe(struct platform_device *dev) 328static int __init hitfb_probe(struct platform_device *dev)
332{ 329{
333 unsigned short lcdclor, ldr3, ldvndr; 330 unsigned short lcdclor, ldr3, ldvndr;
331 struct fb_info *info;
332 int ret;
334 333
335 if (fb_get_options("hitfb", NULL)) 334 if (fb_get_options("hitfb", NULL))
336 return -ENODEV; 335 return -ENODEV;
@@ -384,32 +383,53 @@ static int __init hitfb_probe(struct platform_device *dev)
384 break; 383 break;
385 } 384 }
386 385
387 fb_info.fbops = &hitfb_ops; 386 info = framebuffer_alloc(sizeof(u32) * 16, &dev->dev);
388 fb_info.var = hitfb_var; 387 if (unlikely(!info))
389 fb_info.fix = hitfb_fix; 388 return -ENOMEM;
390 fb_info.pseudo_palette = pseudo_palette; 389
391 fb_info.flags = FBINFO_DEFAULT | FBINFO_HWACCEL_YPAN | 390 info->fbops = &hitfb_ops;
391 info->var = hitfb_var;
392 info->fix = hitfb_fix;
393 info->pseudo_palette = info->par;
394 info->flags = FBINFO_DEFAULT | FBINFO_HWACCEL_YPAN |
392 FBINFO_HWACCEL_FILLRECT | FBINFO_HWACCEL_COPYAREA; 395 FBINFO_HWACCEL_FILLRECT | FBINFO_HWACCEL_COPYAREA;
393 396
394 fb_info.screen_base = (void *)hitfb_fix.smem_start; 397 info->screen_base = (void *)hitfb_fix.smem_start;
395 398
396 fb_alloc_cmap(&fb_info.cmap, 256, 0); 399 ret = fb_alloc_cmap(&info->cmap, 256, 0);
400 if (unlikely(ret < 0))
401 goto err_fb;
397 402
398 if (register_framebuffer(&fb_info) < 0) 403 ret = register_framebuffer(info);
399 return -EINVAL; 404 if (unlikely(ret < 0))
405 goto err;
406
407 platform_set_drvdata(dev, info);
400 408
401 printk(KERN_INFO "fb%d: %s frame buffer device\n", 409 printk(KERN_INFO "fb%d: %s frame buffer device\n",
402 fb_info.node, fb_info.fix.id); 410 info->node, info->fix.id);
411
403 return 0; 412 return 0;
413
414err:
415 fb_dealloc_cmap(&info->cmap);
416err_fb:
417 framebuffer_release(info);
418 return ret;
404} 419}
405 420
406static int __exit hitfb_remove(struct platform_device *dev) 421static int __exit hitfb_remove(struct platform_device *dev)
407{ 422{
408 return unregister_framebuffer(&fb_info); 423 struct fb_info *info = platform_get_drvdata(dev);
424
425 unregister_framebuffer(info);
426 fb_dealloc_cmap(&info->cmap);
427 framebuffer_release(info);
428
429 return 0;
409} 430}
410 431
411#ifdef CONFIG_PM 432static int hitfb_suspend(struct device *dev)
412static int hitfb_suspend(struct platform_device *dev, pm_message_t state)
413{ 433{
414 u16 v; 434 u16 v;
415 435
@@ -421,7 +441,7 @@ static int hitfb_suspend(struct platform_device *dev, pm_message_t state)
421 return 0; 441 return 0;
422} 442}
423 443
424static int hitfb_resume(struct platform_device *dev) 444static int hitfb_resume(struct device *dev)
425{ 445{
426 u16 v; 446 u16 v;
427 447
@@ -435,17 +455,19 @@ static int hitfb_resume(struct platform_device *dev)
435 455
436 return 0; 456 return 0;
437} 457}
438#endif 458
459static struct dev_pm_ops hitfb_dev_pm_ops = {
460 .suspend = hitfb_suspend,
461 .resume = hitfb_resume,
462};
439 463
440static struct platform_driver hitfb_driver = { 464static struct platform_driver hitfb_driver = {
441 .probe = hitfb_probe, 465 .probe = hitfb_probe,
442 .remove = __exit_p(hitfb_remove), 466 .remove = __exit_p(hitfb_remove),
443#ifdef CONFIG_PM
444 .suspend = hitfb_suspend,
445 .resume = hitfb_resume,
446#endif
447 .driver = { 467 .driver = {
448 .name = "hitfb", 468 .name = "hitfb",
469 .owner = THIS_MODULE,
470 .pm = &hitfb_dev_pm_ops,
449 }, 471 },
450}; 472};
451 473
diff --git a/drivers/video/i810/i810_main.c b/drivers/video/i810/i810_main.c
index 2e940199fc89..5743ea25e818 100644
--- a/drivers/video/i810/i810_main.c
+++ b/drivers/video/i810/i810_main.c
@@ -1090,8 +1090,10 @@ static int encode_fix(struct fb_fix_screeninfo *fix, struct fb_info *info)
1090 memset(fix, 0, sizeof(struct fb_fix_screeninfo)); 1090 memset(fix, 0, sizeof(struct fb_fix_screeninfo));
1091 1091
1092 strcpy(fix->id, "I810"); 1092 strcpy(fix->id, "I810");
1093 mutex_lock(&info->mm_lock);
1093 fix->smem_start = par->fb.physical; 1094 fix->smem_start = par->fb.physical;
1094 fix->smem_len = par->fb.size; 1095 fix->smem_len = par->fb.size;
1096 mutex_unlock(&info->mm_lock);
1095 fix->type = FB_TYPE_PACKED_PIXELS; 1097 fix->type = FB_TYPE_PACKED_PIXELS;
1096 fix->type_aux = 0; 1098 fix->type_aux = 0;
1097 fix->xpanstep = 8; 1099 fix->xpanstep = 8;
@@ -2058,8 +2060,7 @@ static int __devinit i810fb_init_pci (struct pci_dev *dev,
2058 2060
2059 fb_var_to_videomode(&mode, &info->var); 2061 fb_var_to_videomode(&mode, &info->var);
2060 fb_add_videomode(&mode, &info->modelist); 2062 fb_add_videomode(&mode, &info->modelist);
2061 encode_fix(&info->fix, info); 2063
2062
2063 i810fb_init_ringbuffer(info); 2064 i810fb_init_ringbuffer(info);
2064 err = register_framebuffer(info); 2065 err = register_framebuffer(info);
2065 2066
diff --git a/drivers/video/matrox/matroxfb_DAC1064.c b/drivers/video/matrox/matroxfb_DAC1064.c
index 0ce3b0a89798..a74e5da17aa0 100644
--- a/drivers/video/matrox/matroxfb_DAC1064.c
+++ b/drivers/video/matrox/matroxfb_DAC1064.c
@@ -454,9 +454,9 @@ static void DAC1064_restore_2(WPMINFO2) {
454 dprintk(KERN_DEBUG "DAC1064regs "); 454 dprintk(KERN_DEBUG "DAC1064regs ");
455 for (i = 0; i < sizeof(MGA1064_DAC_regs); i++) { 455 for (i = 0; i < sizeof(MGA1064_DAC_regs); i++) {
456 dprintk("R%02X=%02X ", MGA1064_DAC_regs[i], ACCESS_FBINFO(hw).DACreg[i]); 456 dprintk("R%02X=%02X ", MGA1064_DAC_regs[i], ACCESS_FBINFO(hw).DACreg[i]);
457 if ((i & 0x7) == 0x7) dprintk("\n" KERN_DEBUG "continuing... "); 457 if ((i & 0x7) == 0x7) dprintk(KERN_DEBUG "continuing... ");
458 } 458 }
459 dprintk("\n" KERN_DEBUG "DAC1064clk "); 459 dprintk(KERN_DEBUG "DAC1064clk ");
460 for (i = 0; i < 6; i++) 460 for (i = 0; i < 6; i++)
461 dprintk("C%02X=%02X ", i, ACCESS_FBINFO(hw).DACclk[i]); 461 dprintk("C%02X=%02X ", i, ACCESS_FBINFO(hw).DACclk[i]);
462 dprintk("\n"); 462 dprintk("\n");
diff --git a/drivers/video/matrox/matroxfb_Ti3026.c b/drivers/video/matrox/matroxfb_Ti3026.c
index 13524821e242..4e825112a601 100644
--- a/drivers/video/matrox/matroxfb_Ti3026.c
+++ b/drivers/video/matrox/matroxfb_Ti3026.c
@@ -651,9 +651,9 @@ static void Ti3026_restore(WPMINFO2) {
651 dprintk(KERN_DEBUG "3026DACregs "); 651 dprintk(KERN_DEBUG "3026DACregs ");
652 for (i = 0; i < 21; i++) { 652 for (i = 0; i < 21; i++) {
653 dprintk("R%02X=%02X ", DACseq[i], hw->DACreg[i]); 653 dprintk("R%02X=%02X ", DACseq[i], hw->DACreg[i]);
654 if ((i & 0x7) == 0x7) dprintk("\n" KERN_DEBUG "continuing... "); 654 if ((i & 0x7) == 0x7) dprintk(KERN_DEBUG "continuing... ");
655 } 655 }
656 dprintk("\n" KERN_DEBUG "DACclk "); 656 dprintk(KERN_DEBUG "DACclk ");
657 for (i = 0; i < 6; i++) 657 for (i = 0; i < 6; i++)
658 dprintk("C%02X=%02X ", i, hw->DACclk[i]); 658 dprintk("C%02X=%02X ", i, hw->DACclk[i]);
659 dprintk("\n"); 659 dprintk("\n");
diff --git a/drivers/video/matrox/matroxfb_base.c b/drivers/video/matrox/matroxfb_base.c
index 8e7a275df50c..0c1049b308bf 100644
--- a/drivers/video/matrox/matroxfb_base.c
+++ b/drivers/video/matrox/matroxfb_base.c
@@ -724,8 +724,10 @@ static void matroxfb_update_fix(WPMINFO2)
724 struct fb_fix_screeninfo *fix = &ACCESS_FBINFO(fbcon).fix; 724 struct fb_fix_screeninfo *fix = &ACCESS_FBINFO(fbcon).fix;
725 DBG(__func__) 725 DBG(__func__)
726 726
727 mutex_lock(&ACCESS_FBINFO(fbcon).mm_lock);
727 fix->smem_start = ACCESS_FBINFO(video.base) + ACCESS_FBINFO(curr.ydstorg.bytes); 728 fix->smem_start = ACCESS_FBINFO(video.base) + ACCESS_FBINFO(curr.ydstorg.bytes);
728 fix->smem_len = ACCESS_FBINFO(video.len_usable) - ACCESS_FBINFO(curr.ydstorg.bytes); 729 fix->smem_len = ACCESS_FBINFO(video.len_usable) - ACCESS_FBINFO(curr.ydstorg.bytes);
730 mutex_unlock(&ACCESS_FBINFO(fbcon).mm_lock);
729} 731}
730 732
731static int matroxfb_check_var(struct fb_var_screeninfo *var, struct fb_info *info) 733static int matroxfb_check_var(struct fb_var_screeninfo *var, struct fb_info *info)
@@ -1874,7 +1876,6 @@ static int initMatrox2(WPMINFO struct board* b){
1874 } 1876 }
1875 matroxfb_init_fix(PMINFO2); 1877 matroxfb_init_fix(PMINFO2);
1876 ACCESS_FBINFO(fbcon.screen_base) = vaddr_va(ACCESS_FBINFO(video.vbase)); 1878 ACCESS_FBINFO(fbcon.screen_base) = vaddr_va(ACCESS_FBINFO(video.vbase));
1877 matroxfb_update_fix(PMINFO2);
1878 /* Normalize values (namely yres_virtual) */ 1879 /* Normalize values (namely yres_virtual) */
1879 matroxfb_check_var(&vesafb_defined, &ACCESS_FBINFO(fbcon)); 1880 matroxfb_check_var(&vesafb_defined, &ACCESS_FBINFO(fbcon));
1880 /* And put it into "current" var. Do NOT program hardware yet, or we'll not take over 1881 /* And put it into "current" var. Do NOT program hardware yet, or we'll not take over
@@ -2081,6 +2082,7 @@ static int matroxfb_probe(struct pci_dev* pdev, const struct pci_device_id* dumm
2081 spin_lock_init(&ACCESS_FBINFO(lock.accel)); 2082 spin_lock_init(&ACCESS_FBINFO(lock.accel));
2082 init_rwsem(&ACCESS_FBINFO(crtc2.lock)); 2083 init_rwsem(&ACCESS_FBINFO(crtc2.lock));
2083 init_rwsem(&ACCESS_FBINFO(altout.lock)); 2084 init_rwsem(&ACCESS_FBINFO(altout.lock));
2085 mutex_init(&ACCESS_FBINFO(fbcon).mm_lock);
2084 ACCESS_FBINFO(irq_flags) = 0; 2086 ACCESS_FBINFO(irq_flags) = 0;
2085 init_waitqueue_head(&ACCESS_FBINFO(crtc1.vsync.wait)); 2087 init_waitqueue_head(&ACCESS_FBINFO(crtc1.vsync.wait));
2086 init_waitqueue_head(&ACCESS_FBINFO(crtc2.vsync.wait)); 2088 init_waitqueue_head(&ACCESS_FBINFO(crtc2.vsync.wait));
diff --git a/drivers/video/matrox/matroxfb_crtc2.c b/drivers/video/matrox/matroxfb_crtc2.c
index 7ac4c5f6145d..ebcb5c6b4962 100644
--- a/drivers/video/matrox/matroxfb_crtc2.c
+++ b/drivers/video/matrox/matroxfb_crtc2.c
@@ -289,7 +289,12 @@ static int matroxfb_dh_release(struct fb_info* info, int user) {
289#undef m2info 289#undef m2info
290} 290}
291 291
292static void matroxfb_dh_init_fix(struct matroxfb_dh_fb_info *m2info) { 292/*
293 * This function is called before the register_framebuffer so
294 * no locking is needed.
295 */
296static void matroxfb_dh_init_fix(struct matroxfb_dh_fb_info *m2info)
297{
293 struct fb_fix_screeninfo *fix = &m2info->fbcon.fix; 298 struct fb_fix_screeninfo *fix = &m2info->fbcon.fix;
294 299
295 strcpy(fix->id, "MATROX DH"); 300 strcpy(fix->id, "MATROX DH");
diff --git a/drivers/video/mx3fb.c b/drivers/video/mx3fb.c
index b7af5256e887..054ef29be479 100644
--- a/drivers/video/mx3fb.c
+++ b/drivers/video/mx3fb.c
@@ -669,7 +669,8 @@ static uint32_t bpp_to_pixfmt(int bpp)
669} 669}
670 670
671static int mx3fb_blank(int blank, struct fb_info *fbi); 671static int mx3fb_blank(int blank, struct fb_info *fbi);
672static int mx3fb_map_video_memory(struct fb_info *fbi); 672static int mx3fb_map_video_memory(struct fb_info *fbi, unsigned int mem_len,
673 bool lock);
673static int mx3fb_unmap_video_memory(struct fb_info *fbi); 674static int mx3fb_unmap_video_memory(struct fb_info *fbi);
674 675
675/** 676/**
@@ -711,12 +712,7 @@ static void mx3fb_dma_done(void *arg)
711 complete(&mx3_fbi->flip_cmpl); 712 complete(&mx3_fbi->flip_cmpl);
712} 713}
713 714
714/** 715static int __set_par(struct fb_info *fbi, bool lock)
715 * mx3fb_set_par() - set framebuffer parameters and change the operating mode.
716 * @fbi: framebuffer information pointer.
717 * @return: 0 on success or negative error code on failure.
718 */
719static int mx3fb_set_par(struct fb_info *fbi)
720{ 716{
721 u32 mem_len; 717 u32 mem_len;
722 struct ipu_di_signal_cfg sig_cfg; 718 struct ipu_di_signal_cfg sig_cfg;
@@ -727,10 +723,6 @@ static int mx3fb_set_par(struct fb_info *fbi)
727 struct idmac_video_param *video = &ichan->params.video; 723 struct idmac_video_param *video = &ichan->params.video;
728 struct scatterlist *sg = mx3_fbi->sg; 724 struct scatterlist *sg = mx3_fbi->sg;
729 725
730 dev_dbg(mx3fb->dev, "%s [%c]\n", __func__, list_empty(&ichan->queue) ? '-' : '+');
731
732 mutex_lock(&mx3_fbi->mutex);
733
734 /* Total cleanup */ 726 /* Total cleanup */
735 if (mx3_fbi->txd) 727 if (mx3_fbi->txd)
736 sdc_disable_channel(mx3_fbi); 728 sdc_disable_channel(mx3_fbi);
@@ -742,11 +734,8 @@ static int mx3fb_set_par(struct fb_info *fbi)
742 if (fbi->fix.smem_start) 734 if (fbi->fix.smem_start)
743 mx3fb_unmap_video_memory(fbi); 735 mx3fb_unmap_video_memory(fbi);
744 736
745 fbi->fix.smem_len = mem_len; 737 if (mx3fb_map_video_memory(fbi, mem_len, lock) < 0)
746 if (mx3fb_map_video_memory(fbi) < 0) {
747 mutex_unlock(&mx3_fbi->mutex);
748 return -ENOMEM; 738 return -ENOMEM;
749 }
750 } 739 }
751 740
752 sg_init_table(&sg[0], 1); 741 sg_init_table(&sg[0], 1);
@@ -792,7 +781,6 @@ static int mx3fb_set_par(struct fb_info *fbi)
792 fbi->var.vsync_len, 781 fbi->var.vsync_len,
793 fbi->var.lower_margin + 782 fbi->var.lower_margin +
794 fbi->var.vsync_len, sig_cfg) != 0) { 783 fbi->var.vsync_len, sig_cfg) != 0) {
795 mutex_unlock(&mx3_fbi->mutex);
796 dev_err(fbi->device, 784 dev_err(fbi->device,
797 "mx3fb: Error initializing panel.\n"); 785 "mx3fb: Error initializing panel.\n");
798 return -EINVAL; 786 return -EINVAL;
@@ -811,9 +799,30 @@ static int mx3fb_set_par(struct fb_info *fbi)
811 if (mx3_fbi->blank == FB_BLANK_UNBLANK) 799 if (mx3_fbi->blank == FB_BLANK_UNBLANK)
812 sdc_enable_channel(mx3_fbi); 800 sdc_enable_channel(mx3_fbi);
813 801
802 return 0;
803}
804
805/**
806 * mx3fb_set_par() - set framebuffer parameters and change the operating mode.
807 * @fbi: framebuffer information pointer.
808 * @return: 0 on success or negative error code on failure.
809 */
810static int mx3fb_set_par(struct fb_info *fbi)
811{
812 struct mx3fb_info *mx3_fbi = fbi->par;
813 struct mx3fb_data *mx3fb = mx3_fbi->mx3fb;
814 struct idmac_channel *ichan = mx3_fbi->idmac_channel;
815 int ret;
816
817 dev_dbg(mx3fb->dev, "%s [%c]\n", __func__, list_empty(&ichan->queue) ? '-' : '+');
818
819 mutex_lock(&mx3_fbi->mutex);
820
821 ret = __set_par(fbi, true);
822
814 mutex_unlock(&mx3_fbi->mutex); 823 mutex_unlock(&mx3_fbi->mutex);
815 824
816 return 0; 825 return ret;
817} 826}
818 827
819/** 828/**
@@ -967,21 +976,11 @@ static int mx3fb_setcolreg(unsigned int regno, unsigned int red,
967 return ret; 976 return ret;
968} 977}
969 978
970/** 979static void __blank(int blank, struct fb_info *fbi)
971 * mx3fb_blank() - blank the display.
972 */
973static int mx3fb_blank(int blank, struct fb_info *fbi)
974{ 980{
975 struct mx3fb_info *mx3_fbi = fbi->par; 981 struct mx3fb_info *mx3_fbi = fbi->par;
976 struct mx3fb_data *mx3fb = mx3_fbi->mx3fb; 982 struct mx3fb_data *mx3fb = mx3_fbi->mx3fb;
977 983
978 dev_dbg(fbi->device, "%s, blank = %d, base %p, len %u\n", __func__,
979 blank, fbi->screen_base, fbi->fix.smem_len);
980
981 if (mx3_fbi->blank == blank)
982 return 0;
983
984 mutex_lock(&mx3_fbi->mutex);
985 mx3_fbi->blank = blank; 984 mx3_fbi->blank = blank;
986 985
987 switch (blank) { 986 switch (blank) {
@@ -1000,6 +999,23 @@ static int mx3fb_blank(int blank, struct fb_info *fbi)
1000 sdc_set_brightness(mx3fb, mx3fb->backlight_level); 999 sdc_set_brightness(mx3fb, mx3fb->backlight_level);
1001 break; 1000 break;
1002 } 1001 }
1002}
1003
1004/**
1005 * mx3fb_blank() - blank the display.
1006 */
1007static int mx3fb_blank(int blank, struct fb_info *fbi)
1008{
1009 struct mx3fb_info *mx3_fbi = fbi->par;
1010
1011 dev_dbg(fbi->device, "%s, blank = %d, base %p, len %u\n", __func__,
1012 blank, fbi->screen_base, fbi->fix.smem_len);
1013
1014 if (mx3_fbi->blank == blank)
1015 return 0;
1016
1017 mutex_lock(&mx3_fbi->mutex);
1018 __blank(blank, fbi);
1003 mutex_unlock(&mx3_fbi->mutex); 1019 mutex_unlock(&mx3_fbi->mutex);
1004 1020
1005 return 0; 1021 return 0;
@@ -1198,6 +1214,8 @@ static int mx3fb_resume(struct platform_device *pdev)
1198/** 1214/**
1199 * mx3fb_map_video_memory() - allocates the DRAM memory for the frame buffer. 1215 * mx3fb_map_video_memory() - allocates the DRAM memory for the frame buffer.
1200 * @fbi: framebuffer information pointer 1216 * @fbi: framebuffer information pointer
1217 * @mem_len: length of mapped memory
1218 * @lock: do not lock during initialisation
1201 * @return: Error code indicating success or failure 1219 * @return: Error code indicating success or failure
1202 * 1220 *
1203 * This buffer is remapped into a non-cached, non-buffered, memory region to 1221 * This buffer is remapped into a non-cached, non-buffered, memory region to
@@ -1205,23 +1223,29 @@ static int mx3fb_resume(struct platform_device *pdev)
1205 * area is remapped, all virtual memory access to the video memory should occur 1223 * area is remapped, all virtual memory access to the video memory should occur
1206 * at the new region. 1224 * at the new region.
1207 */ 1225 */
1208static int mx3fb_map_video_memory(struct fb_info *fbi) 1226static int mx3fb_map_video_memory(struct fb_info *fbi, unsigned int mem_len,
1227 bool lock)
1209{ 1228{
1210 int retval = 0; 1229 int retval = 0;
1211 dma_addr_t addr; 1230 dma_addr_t addr;
1212 1231
1213 fbi->screen_base = dma_alloc_writecombine(fbi->device, 1232 fbi->screen_base = dma_alloc_writecombine(fbi->device,
1214 fbi->fix.smem_len, 1233 mem_len,
1215 &addr, GFP_DMA); 1234 &addr, GFP_DMA);
1216 1235
1217 if (!fbi->screen_base) { 1236 if (!fbi->screen_base) {
1218 dev_err(fbi->device, "Cannot allocate %u bytes framebuffer memory\n", 1237 dev_err(fbi->device, "Cannot allocate %u bytes framebuffer memory\n",
1219 fbi->fix.smem_len); 1238 mem_len);
1220 retval = -EBUSY; 1239 retval = -EBUSY;
1221 goto err0; 1240 goto err0;
1222 } 1241 }
1223 1242
1243 if (lock)
1244 mutex_lock(&fbi->mm_lock);
1224 fbi->fix.smem_start = addr; 1245 fbi->fix.smem_start = addr;
1246 fbi->fix.smem_len = mem_len;
1247 if (lock)
1248 mutex_unlock(&fbi->mm_lock);
1225 1249
1226 dev_dbg(fbi->device, "allocated fb @ p=0x%08x, v=0x%p, size=%d.\n", 1250 dev_dbg(fbi->device, "allocated fb @ p=0x%08x, v=0x%p, size=%d.\n",
1227 (uint32_t) fbi->fix.smem_start, fbi->screen_base, fbi->fix.smem_len); 1251 (uint32_t) fbi->fix.smem_start, fbi->screen_base, fbi->fix.smem_len);
@@ -1251,8 +1275,10 @@ static int mx3fb_unmap_video_memory(struct fb_info *fbi)
1251 fbi->screen_base, fbi->fix.smem_start); 1275 fbi->screen_base, fbi->fix.smem_start);
1252 1276
1253 fbi->screen_base = 0; 1277 fbi->screen_base = 0;
1278 mutex_lock(&fbi->mm_lock);
1254 fbi->fix.smem_start = 0; 1279 fbi->fix.smem_start = 0;
1255 fbi->fix.smem_len = 0; 1280 fbi->fix.smem_len = 0;
1281 mutex_unlock(&fbi->mm_lock);
1256 return 0; 1282 return 0;
1257} 1283}
1258 1284
@@ -1360,11 +1386,11 @@ static int init_fb_chan(struct mx3fb_data *mx3fb, struct idmac_channel *ichan)
1360 init_completion(&mx3fbi->flip_cmpl); 1386 init_completion(&mx3fbi->flip_cmpl);
1361 disable_irq(ichan->eof_irq); 1387 disable_irq(ichan->eof_irq);
1362 dev_dbg(mx3fb->dev, "disabling irq %d\n", ichan->eof_irq); 1388 dev_dbg(mx3fb->dev, "disabling irq %d\n", ichan->eof_irq);
1363 ret = mx3fb_set_par(fbi); 1389 ret = __set_par(fbi, false);
1364 if (ret < 0) 1390 if (ret < 0)
1365 goto esetpar; 1391 goto esetpar;
1366 1392
1367 mx3fb_blank(FB_BLANK_UNBLANK, fbi); 1393 __blank(FB_BLANK_UNBLANK, fbi);
1368 1394
1369 dev_info(dev, "registered, using mode %s\n", fb_mode); 1395 dev_info(dev, "registered, using mode %s\n", fb_mode);
1370 1396
diff --git a/drivers/video/omap/omapfb_main.c b/drivers/video/omap/omapfb_main.c
index 060d72fe57cb..8862233d57b6 100644
--- a/drivers/video/omap/omapfb_main.c
+++ b/drivers/video/omap/omapfb_main.c
@@ -393,8 +393,10 @@ static void set_fb_fix(struct fb_info *fbi)
393 393
394 rg = &plane->fbdev->mem_desc.region[plane->idx]; 394 rg = &plane->fbdev->mem_desc.region[plane->idx];
395 fbi->screen_base = rg->vaddr; 395 fbi->screen_base = rg->vaddr;
396 mutex_lock(&fbi->mm_lock);
396 fix->smem_start = rg->paddr; 397 fix->smem_start = rg->paddr;
397 fix->smem_len = rg->size; 398 fix->smem_len = rg->size;
399 mutex_unlock(&fbi->mm_lock);
398 400
399 fix->type = FB_TYPE_PACKED_PIXELS; 401 fix->type = FB_TYPE_PACKED_PIXELS;
400 bpp = var->bits_per_pixel; 402 bpp = var->bits_per_pixel;
@@ -886,8 +888,10 @@ static int omapfb_setup_mem(struct fb_info *fbi, struct omapfb_mem_info *mi)
886 * plane memory is dealloce'd, the other 888 * plane memory is dealloce'd, the other
887 * screen parameters in var / fix are invalid. 889 * screen parameters in var / fix are invalid.
888 */ 890 */
891 mutex_lock(&fbi->mm_lock);
889 fbi->fix.smem_start = 0; 892 fbi->fix.smem_start = 0;
890 fbi->fix.smem_len = 0; 893 fbi->fix.smem_len = 0;
894 mutex_unlock(&fbi->mm_lock);
891 } 895 }
892 } 896 }
893 } 897 }
@@ -1250,7 +1254,7 @@ static struct fb_ops omapfb_ops = {
1250static ssize_t omapfb_show_caps_num(struct device *dev, 1254static ssize_t omapfb_show_caps_num(struct device *dev,
1251 struct device_attribute *attr, char *buf) 1255 struct device_attribute *attr, char *buf)
1252{ 1256{
1253 struct omapfb_device *fbdev = (struct omapfb_device *)dev->driver_data; 1257 struct omapfb_device *fbdev = dev_get_drvdata(dev);
1254 int plane; 1258 int plane;
1255 size_t size; 1259 size_t size;
1256 struct omapfb_caps caps; 1260 struct omapfb_caps caps;
@@ -1270,7 +1274,7 @@ static ssize_t omapfb_show_caps_num(struct device *dev,
1270static ssize_t omapfb_show_caps_text(struct device *dev, 1274static ssize_t omapfb_show_caps_text(struct device *dev,
1271 struct device_attribute *attr, char *buf) 1275 struct device_attribute *attr, char *buf)
1272{ 1276{
1273 struct omapfb_device *fbdev = (struct omapfb_device *)dev->driver_data; 1277 struct omapfb_device *fbdev = dev_get_drvdata(dev);
1274 int i; 1278 int i;
1275 struct omapfb_caps caps; 1279 struct omapfb_caps caps;
1276 int plane; 1280 int plane;
@@ -1317,7 +1321,7 @@ static DEVICE_ATTR(caps_text, 0444, omapfb_show_caps_text, NULL);
1317static ssize_t omapfb_show_panel_name(struct device *dev, 1321static ssize_t omapfb_show_panel_name(struct device *dev,
1318 struct device_attribute *attr, char *buf) 1322 struct device_attribute *attr, char *buf)
1319{ 1323{
1320 struct omapfb_device *fbdev = (struct omapfb_device *)dev->driver_data; 1324 struct omapfb_device *fbdev = dev_get_drvdata(dev);
1321 1325
1322 return snprintf(buf, PAGE_SIZE, "%s\n", fbdev->panel->name); 1326 return snprintf(buf, PAGE_SIZE, "%s\n", fbdev->panel->name);
1323} 1327}
@@ -1326,7 +1330,7 @@ static ssize_t omapfb_show_bklight_level(struct device *dev,
1326 struct device_attribute *attr, 1330 struct device_attribute *attr,
1327 char *buf) 1331 char *buf)
1328{ 1332{
1329 struct omapfb_device *fbdev = (struct omapfb_device *)dev->driver_data; 1333 struct omapfb_device *fbdev = dev_get_drvdata(dev);
1330 int r; 1334 int r;
1331 1335
1332 if (fbdev->panel->get_bklight_level) { 1336 if (fbdev->panel->get_bklight_level) {
@@ -1341,7 +1345,7 @@ static ssize_t omapfb_store_bklight_level(struct device *dev,
1341 struct device_attribute *attr, 1345 struct device_attribute *attr,
1342 const char *buf, size_t size) 1346 const char *buf, size_t size)
1343{ 1347{
1344 struct omapfb_device *fbdev = (struct omapfb_device *)dev->driver_data; 1348 struct omapfb_device *fbdev = dev_get_drvdata(dev);
1345 int r; 1349 int r;
1346 1350
1347 if (fbdev->panel->set_bklight_level) { 1351 if (fbdev->panel->set_bklight_level) {
@@ -1360,7 +1364,7 @@ static ssize_t omapfb_store_bklight_level(struct device *dev,
1360static ssize_t omapfb_show_bklight_max(struct device *dev, 1364static ssize_t omapfb_show_bklight_max(struct device *dev,
1361 struct device_attribute *attr, char *buf) 1365 struct device_attribute *attr, char *buf)
1362{ 1366{
1363 struct omapfb_device *fbdev = (struct omapfb_device *)dev->driver_data; 1367 struct omapfb_device *fbdev = dev_get_drvdata(dev);
1364 int r; 1368 int r;
1365 1369
1366 if (fbdev->panel->get_bklight_level) { 1370 if (fbdev->panel->get_bklight_level) {
@@ -1393,7 +1397,7 @@ static struct attribute_group panel_attr_grp = {
1393static ssize_t omapfb_show_ctrl_name(struct device *dev, 1397static ssize_t omapfb_show_ctrl_name(struct device *dev,
1394 struct device_attribute *attr, char *buf) 1398 struct device_attribute *attr, char *buf)
1395{ 1399{
1396 struct omapfb_device *fbdev = (struct omapfb_device *)dev->driver_data; 1400 struct omapfb_device *fbdev = dev_get_drvdata(dev);
1397 1401
1398 return snprintf(buf, PAGE_SIZE, "%s\n", fbdev->ctrl->name); 1402 return snprintf(buf, PAGE_SIZE, "%s\n", fbdev->ctrl->name);
1399} 1403}
diff --git a/drivers/video/platinumfb.c b/drivers/video/platinumfb.c
index 03b3670130a0..bacfabd9ce16 100644
--- a/drivers/video/platinumfb.c
+++ b/drivers/video/platinumfb.c
@@ -141,7 +141,9 @@ static int platinumfb_set_par (struct fb_info *info)
141 offset = 0x10; 141 offset = 0x10;
142 142
143 info->screen_base = pinfo->frame_buffer + init->fb_offset + offset; 143 info->screen_base = pinfo->frame_buffer + init->fb_offset + offset;
144 mutex_lock(&info->mm_lock);
144 info->fix.smem_start = (pinfo->frame_buffer_phys) + init->fb_offset + offset; 145 info->fix.smem_start = (pinfo->frame_buffer_phys) + init->fb_offset + offset;
146 mutex_unlock(&info->mm_lock);
145 info->fix.visual = (pinfo->cmode == CMODE_8) ? 147 info->fix.visual = (pinfo->cmode == CMODE_8) ?
146 FB_VISUAL_PSEUDOCOLOR : FB_VISUAL_DIRECTCOLOR; 148 FB_VISUAL_PSEUDOCOLOR : FB_VISUAL_DIRECTCOLOR;
147 info->fix.line_length = vmode_attrs[pinfo->vmode-1].hres * (1<<pinfo->cmode) 149 info->fix.line_length = vmode_attrs[pinfo->vmode-1].hres * (1<<pinfo->cmode)
diff --git a/drivers/video/pxafb.c b/drivers/video/pxafb.c
index 0889d50c3288..6506117c134b 100644
--- a/drivers/video/pxafb.c
+++ b/drivers/video/pxafb.c
@@ -815,8 +815,10 @@ static int overlayfb_map_video_memory(struct pxafb_layer *ofb)
815 ofb->video_mem_phys = virt_to_phys(ofb->video_mem); 815 ofb->video_mem_phys = virt_to_phys(ofb->video_mem);
816 ofb->video_mem_size = size; 816 ofb->video_mem_size = size;
817 817
818 mutex_lock(&ofb->fb.mm_lock);
818 ofb->fb.fix.smem_start = ofb->video_mem_phys; 819 ofb->fb.fix.smem_start = ofb->video_mem_phys;
819 ofb->fb.fix.smem_len = ofb->fb.fix.line_length * var->yres_virtual; 820 ofb->fb.fix.smem_len = ofb->fb.fix.line_length * var->yres_virtual;
821 mutex_unlock(&ofb->fb.mm_lock);
820 ofb->fb.screen_base = ofb->video_mem; 822 ofb->fb.screen_base = ofb->video_mem;
821 return 0; 823 return 0;
822} 824}
diff --git a/drivers/video/s3c-fb.c b/drivers/video/s3c-fb.c
index 43680e545427..5a72083dc67c 100644
--- a/drivers/video/s3c-fb.c
+++ b/drivers/video/s3c-fb.c
@@ -211,23 +211,21 @@ static int s3c_fb_check_var(struct fb_var_screeninfo *var,
211 211
212/** 212/**
213 * s3c_fb_calc_pixclk() - calculate the divider to create the pixel clock. 213 * s3c_fb_calc_pixclk() - calculate the divider to create the pixel clock.
214 * @id: window id.
214 * @sfb: The hardware state. 215 * @sfb: The hardware state.
215 * @pixclock: The pixel clock wanted, in picoseconds. 216 * @pixclock: The pixel clock wanted, in picoseconds.
216 * 217 *
217 * Given the specified pixel clock, work out the necessary divider to get 218 * Given the specified pixel clock, work out the necessary divider to get
218 * close to the output frequency. 219 * close to the output frequency.
219 */ 220 */
220static int s3c_fb_calc_pixclk(struct s3c_fb *sfb, unsigned int pixclk) 221static int s3c_fb_calc_pixclk(unsigned char id, struct s3c_fb *sfb, unsigned int pixclk)
221{ 222{
223 struct s3c_fb_pd_win *win = sfb->pdata->win[id];
222 unsigned long clk = clk_get_rate(sfb->bus_clk); 224 unsigned long clk = clk_get_rate(sfb->bus_clk);
223 unsigned long long tmp;
224 unsigned int result; 225 unsigned int result;
225 226
226 tmp = (unsigned long long)clk; 227 pixclk *= win->win_mode.refresh;
227 tmp *= pixclk; 228 result = clk / pixclk;
228
229 do_div(tmp, 1000000000UL);
230 result = (unsigned int)tmp / 1000;
231 229
232 dev_dbg(sfb->dev, "pixclk=%u, clk=%lu, div=%d (%lu)\n", 230 dev_dbg(sfb->dev, "pixclk=%u, clk=%lu, div=%d (%lu)\n",
233 pixclk, clk, result, clk / result); 231 pixclk, clk, result, clk / result);
@@ -267,6 +265,7 @@ static int s3c_fb_set_par(struct fb_info *info)
267 struct s3c_fb *sfb = win->parent; 265 struct s3c_fb *sfb = win->parent;
268 void __iomem *regs = sfb->regs; 266 void __iomem *regs = sfb->regs;
269 int win_no = win->index; 267 int win_no = win->index;
268 u32 osdc_data = 0;
270 u32 data; 269 u32 data;
271 u32 pagewidth; 270 u32 pagewidth;
272 int clkdiv; 271 int clkdiv;
@@ -302,7 +301,7 @@ static int s3c_fb_set_par(struct fb_info *info)
302 /* use window 0 as the basis for the lcd output timings */ 301 /* use window 0 as the basis for the lcd output timings */
303 302
304 if (win_no == 0) { 303 if (win_no == 0) {
305 clkdiv = s3c_fb_calc_pixclk(sfb, var->pixclock); 304 clkdiv = s3c_fb_calc_pixclk(win_no, sfb, var->pixclock);
306 305
307 data = sfb->pdata->vidcon0; 306 data = sfb->pdata->vidcon0;
308 data &= ~(VIDCON0_CLKVAL_F_MASK | VIDCON0_CLKDIR); 307 data &= ~(VIDCON0_CLKVAL_F_MASK | VIDCON0_CLKDIR);
@@ -359,8 +358,6 @@ static int s3c_fb_set_par(struct fb_info *info)
359 358
360 data = var->xres * var->yres; 359 data = var->xres * var->yres;
361 360
362 u32 osdc_data = 0;
363
364 osdc_data = VIDISD14C_ALPHA1_R(0xf) | 361 osdc_data = VIDISD14C_ALPHA1_R(0xf) |
365 VIDISD14C_ALPHA1_G(0xf) | 362 VIDISD14C_ALPHA1_G(0xf) |
366 VIDISD14C_ALPHA1_B(0xf); 363 VIDISD14C_ALPHA1_B(0xf);
@@ -967,7 +964,7 @@ static int __devexit s3c_fb_remove(struct platform_device *pdev)
967 struct s3c_fb *sfb = platform_get_drvdata(pdev); 964 struct s3c_fb *sfb = platform_get_drvdata(pdev);
968 int win; 965 int win;
969 966
970 for (win = 0; win <= S3C_FB_MAX_WIN; win++) 967 for (win = 0; win < S3C_FB_MAX_WIN; win++)
971 if (sfb->windows[win]) 968 if (sfb->windows[win])
972 s3c_fb_release_win(sfb, sfb->windows[win]); 969 s3c_fb_release_win(sfb, sfb->windows[win]);
973 970
@@ -991,7 +988,7 @@ static int s3c_fb_suspend(struct platform_device *pdev, pm_message_t state)
991 struct s3c_fb_win *win; 988 struct s3c_fb_win *win;
992 int win_no; 989 int win_no;
993 990
994 for (win_no = S3C_FB_MAX_WIN; win_no >= 0; win_no--) { 991 for (win_no = S3C_FB_MAX_WIN - 1; win_no >= 0; win_no--) {
995 win = sfb->windows[win_no]; 992 win = sfb->windows[win_no];
996 if (!win) 993 if (!win)
997 continue; 994 continue;
diff --git a/drivers/video/sh7760fb.c b/drivers/video/sh7760fb.c
index 653bdfee3057..9f6d6e61f0cc 100644
--- a/drivers/video/sh7760fb.c
+++ b/drivers/video/sh7760fb.c
@@ -120,18 +120,6 @@ static int sh7760_setcolreg (u_int regno,
120 return 0; 120 return 0;
121} 121}
122 122
123static void encode_fix(struct fb_fix_screeninfo *fix, struct fb_info *info,
124 unsigned long stride)
125{
126 memset(fix, 0, sizeof(struct fb_fix_screeninfo));
127 strcpy(fix->id, "sh7760-lcdc");
128
129 fix->smem_start = (unsigned long)info->screen_base;
130 fix->smem_len = info->screen_size;
131
132 fix->line_length = stride;
133}
134
135static int sh7760fb_get_color_info(struct device *dev, 123static int sh7760fb_get_color_info(struct device *dev,
136 u16 lddfr, int *bpp, int *gray) 124 u16 lddfr, int *bpp, int *gray)
137{ 125{
@@ -334,7 +322,8 @@ static int sh7760fb_set_par(struct fb_info *info)
334 322
335 iowrite32(ldsarl, par->base + LDSARL); /* mem for lower half of DSTN */ 323 iowrite32(ldsarl, par->base + LDSARL); /* mem for lower half of DSTN */
336 324
337 encode_fix(&info->fix, info, stride); 325 info->fix.line_length = stride;
326
338 sh7760fb_check_var(&info->var, info); 327 sh7760fb_check_var(&info->var, info);
339 328
340 sh7760fb_blank(FB_BLANK_UNBLANK, info); /* panel on! */ 329 sh7760fb_blank(FB_BLANK_UNBLANK, info); /* panel on! */
@@ -435,6 +424,8 @@ static int sh7760fb_alloc_mem(struct fb_info *info)
435 424
436 info->screen_base = fbmem; 425 info->screen_base = fbmem;
437 info->screen_size = vram; 426 info->screen_size = vram;
427 info->fix.smem_start = (unsigned long)info->screen_base;
428 info->fix.smem_len = info->screen_size;
438 429
439 return 0; 430 return 0;
440} 431}
@@ -520,6 +511,8 @@ static int __devinit sh7760fb_probe(struct platform_device *pdev)
520 info->var.transp.length = 0; 511 info->var.transp.length = 0;
521 info->var.transp.msb_right = 0; 512 info->var.transp.msb_right = 0;
522 513
514 strcpy(info->fix.id, "sh7760-lcdc");
515
523 /* set the DON2 bit now, before cmap allocation, as it will randomize 516 /* set the DON2 bit now, before cmap allocation, as it will randomize
524 * palette memory. 517 * palette memory.
525 */ 518 */
diff --git a/drivers/video/sh_mobile_lcdcfb.c b/drivers/video/sh_mobile_lcdcfb.c
index f10d2fbeda06..8f24564f77b0 100644
--- a/drivers/video/sh_mobile_lcdcfb.c
+++ b/drivers/video/sh_mobile_lcdcfb.c
@@ -17,6 +17,7 @@
17#include <linux/platform_device.h> 17#include <linux/platform_device.h>
18#include <linux/dma-mapping.h> 18#include <linux/dma-mapping.h>
19#include <linux/interrupt.h> 19#include <linux/interrupt.h>
20#include <linux/vmalloc.h>
20#include <video/sh_mobile_lcdc.h> 21#include <video/sh_mobile_lcdc.h>
21#include <asm/atomic.h> 22#include <asm/atomic.h>
22 23
@@ -30,9 +31,10 @@ struct sh_mobile_lcdc_chan {
30 unsigned long enabled; /* ME and SE in LDCNT2R */ 31 unsigned long enabled; /* ME and SE in LDCNT2R */
31 struct sh_mobile_lcdc_chan_cfg cfg; 32 struct sh_mobile_lcdc_chan_cfg cfg;
32 u32 pseudo_palette[PALETTE_NR]; 33 u32 pseudo_palette[PALETTE_NR];
33 struct fb_info info; 34 struct fb_info *info;
34 dma_addr_t dma_handle; 35 dma_addr_t dma_handle;
35 struct fb_deferred_io defio; 36 struct fb_deferred_io defio;
37 struct scatterlist *sglist;
36 unsigned long frame_end; 38 unsigned long frame_end;
37 wait_queue_head_t frame_end_wait; 39 wait_queue_head_t frame_end_wait;
38}; 40};
@@ -206,16 +208,38 @@ static void sh_mobile_lcdc_clk_on(struct sh_mobile_lcdc_priv *priv) {}
206static void sh_mobile_lcdc_clk_off(struct sh_mobile_lcdc_priv *priv) {} 208static void sh_mobile_lcdc_clk_off(struct sh_mobile_lcdc_priv *priv) {}
207#endif 209#endif
208 210
211static int sh_mobile_lcdc_sginit(struct fb_info *info,
212 struct list_head *pagelist)
213{
214 struct sh_mobile_lcdc_chan *ch = info->par;
215 unsigned int nr_pages_max = info->fix.smem_len >> PAGE_SHIFT;
216 struct page *page;
217 int nr_pages = 0;
218
219 sg_init_table(ch->sglist, nr_pages_max);
220
221 list_for_each_entry(page, pagelist, lru)
222 sg_set_page(&ch->sglist[nr_pages++], page, PAGE_SIZE, 0);
223
224 return nr_pages;
225}
226
209static void sh_mobile_lcdc_deferred_io(struct fb_info *info, 227static void sh_mobile_lcdc_deferred_io(struct fb_info *info,
210 struct list_head *pagelist) 228 struct list_head *pagelist)
211{ 229{
212 struct sh_mobile_lcdc_chan *ch = info->par; 230 struct sh_mobile_lcdc_chan *ch = info->par;
231 unsigned int nr_pages;
213 232
214 /* enable clocks before accessing hardware */ 233 /* enable clocks before accessing hardware */
215 sh_mobile_lcdc_clk_on(ch->lcdc); 234 sh_mobile_lcdc_clk_on(ch->lcdc);
216 235
236 nr_pages = sh_mobile_lcdc_sginit(info, pagelist);
237 dma_map_sg(info->dev, ch->sglist, nr_pages, DMA_TO_DEVICE);
238
217 /* trigger panel update */ 239 /* trigger panel update */
218 lcdc_write_chan(ch, LDSM2R, 1); 240 lcdc_write_chan(ch, LDSM2R, 1);
241
242 dma_unmap_sg(info->dev, ch->sglist, nr_pages, DMA_TO_DEVICE);
219} 243}
220 244
221static void sh_mobile_lcdc_deferred_io_touch(struct fb_info *info) 245static void sh_mobile_lcdc_deferred_io_touch(struct fb_info *info)
@@ -418,22 +442,22 @@ static int sh_mobile_lcdc_start(struct sh_mobile_lcdc_priv *priv)
418 /* set bpp format in PKF[4:0] */ 442 /* set bpp format in PKF[4:0] */
419 tmp = lcdc_read_chan(ch, LDDFR); 443 tmp = lcdc_read_chan(ch, LDDFR);
420 tmp &= ~(0x0001001f); 444 tmp &= ~(0x0001001f);
421 tmp |= (priv->ch[k].info.var.bits_per_pixel == 16) ? 3 : 0; 445 tmp |= (ch->info->var.bits_per_pixel == 16) ? 3 : 0;
422 lcdc_write_chan(ch, LDDFR, tmp); 446 lcdc_write_chan(ch, LDDFR, tmp);
423 447
424 /* point out our frame buffer */ 448 /* point out our frame buffer */
425 lcdc_write_chan(ch, LDSA1R, ch->info.fix.smem_start); 449 lcdc_write_chan(ch, LDSA1R, ch->info->fix.smem_start);
426 450
427 /* set line size */ 451 /* set line size */
428 lcdc_write_chan(ch, LDMLSR, ch->info.fix.line_length); 452 lcdc_write_chan(ch, LDMLSR, ch->info->fix.line_length);
429 453
430 /* setup deferred io if SYS bus */ 454 /* setup deferred io if SYS bus */
431 tmp = ch->cfg.sys_bus_cfg.deferred_io_msec; 455 tmp = ch->cfg.sys_bus_cfg.deferred_io_msec;
432 if (ch->ldmt1r_value & (1 << 12) && tmp) { 456 if (ch->ldmt1r_value & (1 << 12) && tmp) {
433 ch->defio.deferred_io = sh_mobile_lcdc_deferred_io; 457 ch->defio.deferred_io = sh_mobile_lcdc_deferred_io;
434 ch->defio.delay = msecs_to_jiffies(tmp); 458 ch->defio.delay = msecs_to_jiffies(tmp);
435 ch->info.fbdefio = &ch->defio; 459 ch->info->fbdefio = &ch->defio;
436 fb_deferred_io_init(&ch->info); 460 fb_deferred_io_init(ch->info);
437 461
438 /* one-shot mode */ 462 /* one-shot mode */
439 lcdc_write_chan(ch, LDSM1R, 1); 463 lcdc_write_chan(ch, LDSM1R, 1);
@@ -479,12 +503,12 @@ static void sh_mobile_lcdc_stop(struct sh_mobile_lcdc_priv *priv)
479 * flush frame, and wait for frame end interrupt 503 * flush frame, and wait for frame end interrupt
480 * clean up deferred io and enable clock 504 * clean up deferred io and enable clock
481 */ 505 */
482 if (ch->info.fbdefio) { 506 if (ch->info->fbdefio) {
483 ch->frame_end = 0; 507 ch->frame_end = 0;
484 schedule_delayed_work(&ch->info.deferred_work, 0); 508 schedule_delayed_work(&ch->info->deferred_work, 0);
485 wait_event(ch->frame_end_wait, ch->frame_end); 509 wait_event(ch->frame_end_wait, ch->frame_end);
486 fb_deferred_io_cleanup(&ch->info); 510 fb_deferred_io_cleanup(ch->info);
487 ch->info.fbdefio = NULL; 511 ch->info->fbdefio = NULL;
488 sh_mobile_lcdc_clk_on(priv); 512 sh_mobile_lcdc_clk_on(priv);
489 } 513 }
490 514
@@ -793,9 +817,16 @@ static int __init sh_mobile_lcdc_probe(struct platform_device *pdev)
793 priv->base = ioremap_nocache(res->start, (res->end - res->start) + 1); 817 priv->base = ioremap_nocache(res->start, (res->end - res->start) + 1);
794 818
795 for (i = 0; i < j; i++) { 819 for (i = 0; i < j; i++) {
796 info = &priv->ch[i].info;
797 cfg = &priv->ch[i].cfg; 820 cfg = &priv->ch[i].cfg;
798 821
822 priv->ch[i].info = framebuffer_alloc(0, &pdev->dev);
823 if (!priv->ch[i].info) {
824 dev_err(&pdev->dev, "unable to allocate fb_info\n");
825 error = -ENOMEM;
826 break;
827 }
828
829 info = priv->ch[i].info;
799 info->fbops = &sh_mobile_lcdc_ops; 830 info->fbops = &sh_mobile_lcdc_ops;
800 info->var.xres = info->var.xres_virtual = cfg->lcd_cfg.xres; 831 info->var.xres = info->var.xres_virtual = cfg->lcd_cfg.xres;
801 info->var.yres = info->var.yres_virtual = cfg->lcd_cfg.yres; 832 info->var.yres = info->var.yres_virtual = cfg->lcd_cfg.yres;
@@ -846,21 +877,31 @@ static int __init sh_mobile_lcdc_probe(struct platform_device *pdev)
846 } 877 }
847 878
848 for (i = 0; i < j; i++) { 879 for (i = 0; i < j; i++) {
849 error = register_framebuffer(&priv->ch[i].info); 880 struct sh_mobile_lcdc_chan *ch = priv->ch + i;
881
882 info = ch->info;
883
884 if (info->fbdefio) {
885 priv->ch->sglist = vmalloc(sizeof(struct scatterlist) *
886 info->fix.smem_len >> PAGE_SHIFT);
887 if (!priv->ch->sglist) {
888 dev_err(&pdev->dev, "cannot allocate sglist\n");
889 goto err1;
890 }
891 }
892
893 error = register_framebuffer(info);
850 if (error < 0) 894 if (error < 0)
851 goto err1; 895 goto err1;
852 }
853 896
854 for (i = 0; i < j; i++) {
855 info = &priv->ch[i].info;
856 dev_info(info->dev, 897 dev_info(info->dev,
857 "registered %s/%s as %dx%d %dbpp.\n", 898 "registered %s/%s as %dx%d %dbpp.\n",
858 pdev->name, 899 pdev->name,
859 (priv->ch[i].cfg.chan == LCDC_CHAN_MAINLCD) ? 900 (ch->cfg.chan == LCDC_CHAN_MAINLCD) ?
860 "mainlcd" : "sublcd", 901 "mainlcd" : "sublcd",
861 (int) priv->ch[i].cfg.lcd_cfg.xres, 902 (int) ch->cfg.lcd_cfg.xres,
862 (int) priv->ch[i].cfg.lcd_cfg.yres, 903 (int) ch->cfg.lcd_cfg.yres,
863 priv->ch[i].cfg.bpp); 904 ch->cfg.bpp);
864 905
865 /* deferred io mode: disable clock to save power */ 906 /* deferred io mode: disable clock to save power */
866 if (info->fbdefio) 907 if (info->fbdefio)
@@ -881,20 +922,24 @@ static int sh_mobile_lcdc_remove(struct platform_device *pdev)
881 int i; 922 int i;
882 923
883 for (i = 0; i < ARRAY_SIZE(priv->ch); i++) 924 for (i = 0; i < ARRAY_SIZE(priv->ch); i++)
884 if (priv->ch[i].info.dev) 925 if (priv->ch[i].info->dev)
885 unregister_framebuffer(&priv->ch[i].info); 926 unregister_framebuffer(priv->ch[i].info);
886 927
887 sh_mobile_lcdc_stop(priv); 928 sh_mobile_lcdc_stop(priv);
888 929
889 for (i = 0; i < ARRAY_SIZE(priv->ch); i++) { 930 for (i = 0; i < ARRAY_SIZE(priv->ch); i++) {
890 info = &priv->ch[i].info; 931 info = priv->ch[i].info;
891 932
892 if (!info->device) 933 if (!info || !info->device)
893 continue; 934 continue;
894 935
936 if (priv->ch[i].sglist)
937 vfree(priv->ch[i].sglist);
938
895 dma_free_coherent(&pdev->dev, info->fix.smem_len, 939 dma_free_coherent(&pdev->dev, info->fix.smem_len,
896 info->screen_base, priv->ch[i].dma_handle); 940 info->screen_base, priv->ch[i].dma_handle);
897 fb_dealloc_cmap(&info->cmap); 941 fb_dealloc_cmap(&info->cmap);
942 framebuffer_release(info);
898 } 943 }
899 944
900#ifdef CONFIG_HAVE_CLK 945#ifdef CONFIG_HAVE_CLK
diff --git a/drivers/video/sis/sis_main.c b/drivers/video/sis/sis_main.c
index 7072d19080d5..4a067f0d0ceb 100644
--- a/drivers/video/sis/sis_main.c
+++ b/drivers/video/sis/sis_main.c
@@ -1847,8 +1847,10 @@ sisfb_get_fix(struct fb_fix_screeninfo *fix, int con, struct fb_info *info)
1847 1847
1848 strcpy(fix->id, ivideo->myid); 1848 strcpy(fix->id, ivideo->myid);
1849 1849
1850 mutex_lock(&info->mm_lock);
1850 fix->smem_start = ivideo->video_base + ivideo->video_offset; 1851 fix->smem_start = ivideo->video_base + ivideo->video_offset;
1851 fix->smem_len = ivideo->sisfb_mem; 1852 fix->smem_len = ivideo->sisfb_mem;
1853 mutex_unlock(&info->mm_lock);
1852 fix->type = FB_TYPE_PACKED_PIXELS; 1854 fix->type = FB_TYPE_PACKED_PIXELS;
1853 fix->type_aux = 0; 1855 fix->type_aux = 0;
1854 fix->visual = (ivideo->video_bpp == 8) ? FB_VISUAL_PSEUDOCOLOR : FB_VISUAL_TRUECOLOR; 1856 fix->visual = (ivideo->video_bpp == 8) ? FB_VISUAL_PSEUDOCOLOR : FB_VISUAL_TRUECOLOR;
@@ -6365,7 +6367,6 @@ error_3: vfree(ivideo->bios_abase);
6365 sis_fb_info->fix = ivideo->sisfb_fix; 6367 sis_fb_info->fix = ivideo->sisfb_fix;
6366 sis_fb_info->screen_base = ivideo->video_vbase + ivideo->video_offset; 6368 sis_fb_info->screen_base = ivideo->video_vbase + ivideo->video_offset;
6367 sis_fb_info->fbops = &sisfb_ops; 6369 sis_fb_info->fbops = &sisfb_ops;
6368 sisfb_get_fix(&sis_fb_info->fix, -1, sis_fb_info);
6369 sis_fb_info->pseudo_palette = ivideo->pseudo_palette; 6370 sis_fb_info->pseudo_palette = ivideo->pseudo_palette;
6370 6371
6371 fb_alloc_cmap(&sis_fb_info->cmap, 256 , 0); 6372 fb_alloc_cmap(&sis_fb_info->cmap, 256 , 0);
diff --git a/drivers/video/sm501fb.c b/drivers/video/sm501fb.c
index eb5d73a06702..924d79462780 100644
--- a/drivers/video/sm501fb.c
+++ b/drivers/video/sm501fb.c
@@ -145,7 +145,7 @@ static inline void sm501fb_sync_regs(struct sm501fb_info *info)
145#define SM501_MEMF_ACCEL (8) 145#define SM501_MEMF_ACCEL (8)
146 146
147static int sm501_alloc_mem(struct sm501fb_info *inf, struct sm501_mem *mem, 147static int sm501_alloc_mem(struct sm501fb_info *inf, struct sm501_mem *mem,
148 unsigned int why, size_t size) 148 unsigned int why, size_t size, u32 smem_len)
149{ 149{
150 struct sm501fb_par *par; 150 struct sm501fb_par *par;
151 struct fb_info *fbi; 151 struct fb_info *fbi;
@@ -172,7 +172,7 @@ static int sm501_alloc_mem(struct sm501fb_info *inf, struct sm501_mem *mem,
172 if (ptr > 0) 172 if (ptr > 0)
173 ptr &= ~(PAGE_SIZE - 1); 173 ptr &= ~(PAGE_SIZE - 1);
174 174
175 if (fbi && ptr < fbi->fix.smem_len) 175 if (fbi && ptr < smem_len)
176 return -ENOMEM; 176 return -ENOMEM;
177 177
178 break; 178 break;
@@ -197,7 +197,7 @@ static int sm501_alloc_mem(struct sm501fb_info *inf, struct sm501_mem *mem,
197 197
198 case SM501_MEMF_ACCEL: 198 case SM501_MEMF_ACCEL:
199 fbi = inf->fb[HEAD_CRT]; 199 fbi = inf->fb[HEAD_CRT];
200 ptr = fbi ? fbi->fix.smem_len : 0; 200 ptr = fbi ? smem_len : 0;
201 201
202 fbi = inf->fb[HEAD_PANEL]; 202 fbi = inf->fb[HEAD_PANEL];
203 if (fbi) { 203 if (fbi) {
@@ -413,6 +413,7 @@ static int sm501fb_set_par_common(struct fb_info *info,
413 unsigned int mem_type; 413 unsigned int mem_type;
414 unsigned int clock_type; 414 unsigned int clock_type;
415 unsigned int head_addr; 415 unsigned int head_addr;
416 unsigned int smem_len;
416 417
417 dev_dbg(fbi->dev, "%s: %dx%d, bpp = %d, virtual %dx%d\n", 418 dev_dbg(fbi->dev, "%s: %dx%d, bpp = %d, virtual %dx%d\n",
418 __func__, var->xres, var->yres, var->bits_per_pixel, 419 __func__, var->xres, var->yres, var->bits_per_pixel,
@@ -453,18 +454,20 @@ static int sm501fb_set_par_common(struct fb_info *info,
453 454
454 /* allocate fb memory within 501 */ 455 /* allocate fb memory within 501 */
455 info->fix.line_length = (var->xres_virtual * var->bits_per_pixel)/8; 456 info->fix.line_length = (var->xres_virtual * var->bits_per_pixel)/8;
456 info->fix.smem_len = info->fix.line_length * var->yres_virtual; 457 smem_len = info->fix.line_length * var->yres_virtual;
457 458
458 dev_dbg(fbi->dev, "%s: line length = %u\n", __func__, 459 dev_dbg(fbi->dev, "%s: line length = %u\n", __func__,
459 info->fix.line_length); 460 info->fix.line_length);
460 461
461 if (sm501_alloc_mem(fbi, &par->screen, mem_type, 462 if (sm501_alloc_mem(fbi, &par->screen, mem_type, smem_len, smem_len)) {
462 info->fix.smem_len)) {
463 dev_err(fbi->dev, "no memory available\n"); 463 dev_err(fbi->dev, "no memory available\n");
464 return -ENOMEM; 464 return -ENOMEM;
465 } 465 }
466 466
467 mutex_lock(&info->mm_lock);
467 info->fix.smem_start = fbi->fbmem_res->start + par->screen.sm_addr; 468 info->fix.smem_start = fbi->fbmem_res->start + par->screen.sm_addr;
469 info->fix.smem_len = smem_len;
470 mutex_unlock(&info->mm_lock);
468 471
469 info->screen_base = fbi->fbmem + par->screen.sm_addr; 472 info->screen_base = fbi->fbmem + par->screen.sm_addr;
470 info->screen_size = info->fix.smem_len; 473 info->screen_size = info->fix.smem_len;
@@ -637,7 +640,8 @@ static int sm501fb_set_par_crt(struct fb_info *info)
637 if ((control & SM501_DC_CRT_CONTROL_SEL) == 0) { 640 if ((control & SM501_DC_CRT_CONTROL_SEL) == 0) {
638 /* the head is displaying panel data... */ 641 /* the head is displaying panel data... */
639 642
640 sm501_alloc_mem(fbi, &par->screen, SM501_MEMF_CRT, 0); 643 sm501_alloc_mem(fbi, &par->screen, SM501_MEMF_CRT, 0,
644 info->fix.smem_len);
641 goto out_update; 645 goto out_update;
642 } 646 }
643 647
@@ -1289,7 +1293,8 @@ static int sm501_init_cursor(struct fb_info *fbi, unsigned int reg_base)
1289 1293
1290 par->cursor_regs = info->regs + reg_base; 1294 par->cursor_regs = info->regs + reg_base;
1291 1295
1292 ret = sm501_alloc_mem(info, &par->cursor, SM501_MEMF_CURSOR, 1024); 1296 ret = sm501_alloc_mem(info, &par->cursor, SM501_MEMF_CURSOR, 1024,
1297 fbi->fix.smem_len);
1293 if (ret < 0) 1298 if (ret < 0)
1294 return ret; 1299 return ret;
1295 1300
@@ -1535,9 +1540,6 @@ static int sm501fb_init_fb(struct fb_info *fb,
1535 if (ret) 1540 if (ret)
1536 dev_err(info->dev, "check_var() failed on initial setup?\n"); 1541 dev_err(info->dev, "check_var() failed on initial setup?\n");
1537 1542
1538 /* ensure we've activated our new configuration */
1539 (fb->fbops->fb_set_par)(fb);
1540
1541 return 0; 1543 return 0;
1542} 1544}
1543 1545
@@ -1619,6 +1621,8 @@ static int __devinit sm501fb_start_one(struct sm501fb_info *info,
1619 if (!fbi) 1621 if (!fbi)
1620 return 0; 1622 return 0;
1621 1623
1624 mutex_init(&info->fb[head]->mm_lock);
1625
1622 ret = sm501fb_init_fb(info->fb[head], head, drvname); 1626 ret = sm501fb_init_fb(info->fb[head], head, drvname);
1623 if (ret) { 1627 if (ret) {
1624 dev_err(info->dev, "cannot initialise fb %s\n", drvname); 1628 dev_err(info->dev, "cannot initialise fb %s\n", drvname);
diff --git a/drivers/video/stifb.c b/drivers/video/stifb.c
index eec9dcb7f599..6120f0c526fe 100644
--- a/drivers/video/stifb.c
+++ b/drivers/video/stifb.c
@@ -1115,10 +1115,9 @@ static int __init stifb_init_fb(struct sti_struct *sti, int bpp_pref)
1115 if the device name contains the string "DX" and tell the 1115 if the device name contains the string "DX" and tell the
1116 user how to reconfigure the card. */ 1116 user how to reconfigure the card. */
1117 if (strstr(sti->outptr.dev_name, "DX")) { 1117 if (strstr(sti->outptr.dev_name, "DX")) {
1118 printk(KERN_WARNING "WARNING: stifb framebuffer driver does not " 1118 printk(KERN_WARNING
1119 "support '%s' in double-buffer mode.\n" 1119"WARNING: stifb framebuffer driver does not support '%s' in double-buffer mode.\n"
1120 KERN_WARNING "WARNING: Please disable the double-buffer mode " 1120"WARNING: Please disable the double-buffer mode in IPL menu (the PARISC-BIOS).\n",
1121 "in IPL menu (the PARISC-BIOS).\n",
1122 sti->outptr.dev_name); 1121 sti->outptr.dev_name);
1123 goto out_err0; 1122 goto out_err0;
1124 } 1123 }
diff --git a/drivers/video/via/hw.c b/drivers/video/via/hw.c
index fcd53ceb88fa..c8960003f47d 100644
--- a/drivers/video/via/hw.c
+++ b/drivers/video/via/hw.c
@@ -2407,14 +2407,14 @@ int viafb_setmode(int vmode_index, int hor_res, int ver_res, int video_bpp,
2407 viafb_dvi_set_mode(viafb_get_mode_index 2407 viafb_dvi_set_mode(viafb_get_mode_index
2408 (viaparinfo->tmds_setting_info->h_active, 2408 (viaparinfo->tmds_setting_info->h_active,
2409 viaparinfo->tmds_setting_info-> 2409 viaparinfo->tmds_setting_info->
2410 v_active, 1), 2410 v_active),
2411 video_bpp1, viaparinfo-> 2411 video_bpp1, viaparinfo->
2412 tmds_setting_info->iga_path); 2412 tmds_setting_info->iga_path);
2413 } else { 2413 } else {
2414 viafb_dvi_set_mode(viafb_get_mode_index 2414 viafb_dvi_set_mode(viafb_get_mode_index
2415 (viaparinfo->tmds_setting_info->h_active, 2415 (viaparinfo->tmds_setting_info->h_active,
2416 viaparinfo-> 2416 viaparinfo->
2417 tmds_setting_info->v_active, 0), 2417 tmds_setting_info->v_active),
2418 video_bpp, viaparinfo-> 2418 video_bpp, viaparinfo->
2419 tmds_setting_info->iga_path); 2419 tmds_setting_info->iga_path);
2420 } 2420 }
diff --git a/drivers/video/via/lcd.c b/drivers/video/via/lcd.c
index 6c7290a6a447..78c6b3387947 100644
--- a/drivers/video/via/lcd.c
+++ b/drivers/video/via/lcd.c
@@ -580,10 +580,7 @@ static void load_lcd_k400_patch_tbl(int set_hres, int set_vres,
580 int reg_num = 0; 580 int reg_num = 0;
581 struct io_reg *lcd_patch_reg = NULL; 581 struct io_reg *lcd_patch_reg = NULL;
582 582
583 if (viaparinfo->lvds_setting_info->iga_path == IGA2) 583 vmode_index = viafb_get_mode_index(set_hres, set_vres);
584 vmode_index = viafb_get_mode_index(set_hres, set_vres, 1);
585 else
586 vmode_index = viafb_get_mode_index(set_hres, set_vres, 0);
587 switch (panel_id) { 584 switch (panel_id) {
588 /* LCD 800x600 */ 585 /* LCD 800x600 */
589 case LCD_PANEL_ID1_800X600: 586 case LCD_PANEL_ID1_800X600:
@@ -761,10 +758,7 @@ static void load_lcd_p880_patch_tbl(int set_hres, int set_vres,
761 int reg_num = 0; 758 int reg_num = 0;
762 struct io_reg *lcd_patch_reg = NULL; 759 struct io_reg *lcd_patch_reg = NULL;
763 760
764 if (viaparinfo->lvds_setting_info->iga_path == IGA2) 761 vmode_index = viafb_get_mode_index(set_hres, set_vres);
765 vmode_index = viafb_get_mode_index(set_hres, set_vres, 1);
766 else
767 vmode_index = viafb_get_mode_index(set_hres, set_vres, 0);
768 762
769 switch (panel_id) { 763 switch (panel_id) {
770 case LCD_PANEL_ID5_1400X1050: 764 case LCD_PANEL_ID5_1400X1050:
@@ -832,10 +826,7 @@ static void load_lcd_patch_regs(int set_hres, int set_vres,
832{ 826{
833 int vmode_index; 827 int vmode_index;
834 828
835 if (viaparinfo->lvds_setting_info->iga_path == IGA2) 829 vmode_index = viafb_get_mode_index(set_hres, set_vres);
836 vmode_index = viafb_get_mode_index(set_hres, set_vres, 1);
837 else
838 vmode_index = viafb_get_mode_index(set_hres, set_vres, 0);
839 830
840 viafb_unlock_crt(); 831 viafb_unlock_crt();
841 832
diff --git a/drivers/video/via/viafbdev.c b/drivers/video/via/viafbdev.c
index a0fec298216e..72833f3334b5 100644
--- a/drivers/video/via/viafbdev.c
+++ b/drivers/video/via/viafbdev.c
@@ -32,7 +32,6 @@ static u32 pseudo_pal[17];
32/* video mode */ 32/* video mode */
33static char *viafb_mode = "640x480"; 33static char *viafb_mode = "640x480";
34static char *viafb_mode1 = "640x480"; 34static char *viafb_mode1 = "640x480";
35static int viafb_resMode = VIA_RES_640X480;
36 35
37/* Added for specifying active devices.*/ 36/* Added for specifying active devices.*/
38char *viafb_active_dev = ""; 37char *viafb_active_dev = "";
@@ -56,47 +55,47 @@ static void viafb_get_video_device(u32 *video_dev_info);
56 55
57/* Mode information */ 56/* Mode information */
58static const struct viafb_modeinfo viafb_modentry[] = { 57static const struct viafb_modeinfo viafb_modentry[] = {
59 {480, 640, VIA_RES_480X640, "480x640"}, 58 {480, 640, VIA_RES_480X640},
60 {640, 480, VIA_RES_640X480, "640x480"}, 59 {640, 480, VIA_RES_640X480},
61 {800, 480, VIA_RES_800X480, "800x480"}, 60 {800, 480, VIA_RES_800X480},
62 {800, 600, VIA_RES_800X600, "800x600"}, 61 {800, 600, VIA_RES_800X600},
63 {1024, 768, VIA_RES_1024X768, "1024x768"}, 62 {1024, 768, VIA_RES_1024X768},
64 {1152, 864, VIA_RES_1152X864, "1152x864"}, 63 {1152, 864, VIA_RES_1152X864},
65 {1280, 1024, VIA_RES_1280X1024, "1280x1024"}, 64 {1280, 1024, VIA_RES_1280X1024},
66 {1600, 1200, VIA_RES_1600X1200, "1600x1200"}, 65 {1600, 1200, VIA_RES_1600X1200},
67 {1440, 1050, VIA_RES_1440X1050, "1440x1050"}, 66 {1440, 1050, VIA_RES_1440X1050},
68 {1280, 768, VIA_RES_1280X768, "1280x768"}, 67 {1280, 768, VIA_RES_1280X768,},
69 {1280, 800, VIA_RES_1280X800, "1280x800"}, 68 {1280, 800, VIA_RES_1280X800},
70 {1280, 960, VIA_RES_1280X960, "1280x960"}, 69 {1280, 960, VIA_RES_1280X960},
71 {1920, 1440, VIA_RES_1920X1440, "1920x1440"}, 70 {1920, 1440, VIA_RES_1920X1440},
72 {848, 480, VIA_RES_848X480, "848x480"}, 71 {848, 480, VIA_RES_848X480},
73 {1400, 1050, VIA_RES_1400X1050, "1400x1050"}, 72 {1400, 1050, VIA_RES_1400X1050},
74 {720, 480, VIA_RES_720X480, "720x480"}, 73 {720, 480, VIA_RES_720X480},
75 {720, 576, VIA_RES_720X576, "720x576"}, 74 {720, 576, VIA_RES_720X576},
76 {1024, 512, VIA_RES_1024X512, "1024x512"}, 75 {1024, 512, VIA_RES_1024X512},
77 {1024, 576, VIA_RES_1024X576, "1024x576"}, 76 {1024, 576, VIA_RES_1024X576},
78 {1024, 600, VIA_RES_1024X600, "1024x600"}, 77 {1024, 600, VIA_RES_1024X600},
79 {1280, 720, VIA_RES_1280X720, "1280x720"}, 78 {1280, 720, VIA_RES_1280X720},
80 {1920, 1080, VIA_RES_1920X1080, "1920x1080"}, 79 {1920, 1080, VIA_RES_1920X1080},
81 {1366, 768, VIA_RES_1368X768, "1368x768"}, 80 {1366, 768, VIA_RES_1368X768},
82 {1680, 1050, VIA_RES_1680X1050, "1680x1050"}, 81 {1680, 1050, VIA_RES_1680X1050},
83 {960, 600, VIA_RES_960X600, "960x600"}, 82 {960, 600, VIA_RES_960X600},
84 {1000, 600, VIA_RES_1000X600, "1000x600"}, 83 {1000, 600, VIA_RES_1000X600},
85 {1024, 576, VIA_RES_1024X576, "1024x576"}, 84 {1024, 576, VIA_RES_1024X576},
86 {1024, 600, VIA_RES_1024X600, "1024x600"}, 85 {1024, 600, VIA_RES_1024X600},
87 {1088, 612, VIA_RES_1088X612, "1088x612"}, 86 {1088, 612, VIA_RES_1088X612},
88 {1152, 720, VIA_RES_1152X720, "1152x720"}, 87 {1152, 720, VIA_RES_1152X720},
89 {1200, 720, VIA_RES_1200X720, "1200x720"}, 88 {1200, 720, VIA_RES_1200X720},
90 {1280, 600, VIA_RES_1280X600, "1280x600"}, 89 {1280, 600, VIA_RES_1280X600},
91 {1360, 768, VIA_RES_1360X768, "1360x768"}, 90 {1360, 768, VIA_RES_1360X768},
92 {1440, 900, VIA_RES_1440X900, "1440x900"}, 91 {1440, 900, VIA_RES_1440X900},
93 {1600, 900, VIA_RES_1600X900, "1600x900"}, 92 {1600, 900, VIA_RES_1600X900},
94 {1600, 1024, VIA_RES_1600X1024, "1600x1024"}, 93 {1600, 1024, VIA_RES_1600X1024},
95 {1792, 1344, VIA_RES_1792X1344, "1792x1344"}, 94 {1792, 1344, VIA_RES_1792X1344},
96 {1856, 1392, VIA_RES_1856X1392, "1856x1392"}, 95 {1856, 1392, VIA_RES_1856X1392},
97 {1920, 1200, VIA_RES_1920X1200, "1920x1200"}, 96 {1920, 1200, VIA_RES_1920X1200},
98 {2048, 1536, VIA_RES_2048X1536, "2048x1536"}, 97 {2048, 1536, VIA_RES_2048X1536},
99 {0, 0, VIA_RES_INVALID, "640x480"} 98 {0, 0, VIA_RES_INVALID}
100}; 99};
101 100
102static struct fb_ops viafb_ops; 101static struct fb_ops viafb_ops;
@@ -177,7 +176,7 @@ static int viafb_check_var(struct fb_var_screeninfo *var,
177 if (var->vmode & FB_VMODE_INTERLACED || var->vmode & FB_VMODE_DOUBLE) 176 if (var->vmode & FB_VMODE_INTERLACED || var->vmode & FB_VMODE_DOUBLE)
178 return -EINVAL; 177 return -EINVAL;
179 178
180 vmode_index = viafb_get_mode_index(var->xres, var->yres, 0); 179 vmode_index = viafb_get_mode_index(var->xres, var->yres);
181 if (vmode_index == VIA_RES_INVALID) { 180 if (vmode_index == VIA_RES_INVALID) {
182 DEBUG_MSG(KERN_INFO 181 DEBUG_MSG(KERN_INFO
183 "viafb: Mode %dx%dx%d not supported!!\n", 182 "viafb: Mode %dx%dx%d not supported!!\n",
@@ -233,14 +232,14 @@ static int viafb_set_par(struct fb_info *info)
233 viafb_update_device_setting(info->var.xres, info->var.yres, 232 viafb_update_device_setting(info->var.xres, info->var.yres,
234 info->var.bits_per_pixel, viafb_refresh, 0); 233 info->var.bits_per_pixel, viafb_refresh, 0);
235 234
236 vmode_index = viafb_get_mode_index(info->var.xres, info->var.yres, 0); 235 vmode_index = viafb_get_mode_index(info->var.xres, info->var.yres);
237 236
238 if (viafb_SAMM_ON == 1) { 237 if (viafb_SAMM_ON == 1) {
239 DEBUG_MSG(KERN_INFO 238 DEBUG_MSG(KERN_INFO
240 "viafb_second_xres = %d, viafb_second_yres = %d, bpp = %d\n", 239 "viafb_second_xres = %d, viafb_second_yres = %d, bpp = %d\n",
241 viafb_second_xres, viafb_second_yres, viafb_bpp1); 240 viafb_second_xres, viafb_second_yres, viafb_bpp1);
242 vmode_index1 = viafb_get_mode_index(viafb_second_xres, 241 vmode_index1 = viafb_get_mode_index(viafb_second_xres,
243 viafb_second_yres, 1); 242 viafb_second_yres);
244 DEBUG_MSG(KERN_INFO "->viafb_SAMM_ON: index=%d\n", 243 DEBUG_MSG(KERN_INFO "->viafb_SAMM_ON: index=%d\n",
245 vmode_index1); 244 vmode_index1);
246 245
@@ -1262,7 +1261,7 @@ static int viafb_sync(struct fb_info *info)
1262 return 0; 1261 return 0;
1263} 1262}
1264 1263
1265int viafb_get_mode_index(int hres, int vres, int flag) 1264int viafb_get_mode_index(int hres, int vres)
1266{ 1265{
1267 u32 i; 1266 u32 i;
1268 DEBUG_MSG(KERN_INFO "viafb_get_mode_index!\n"); 1267 DEBUG_MSG(KERN_INFO "viafb_get_mode_index!\n");
@@ -1272,13 +1271,7 @@ int viafb_get_mode_index(int hres, int vres, int flag)
1272 viafb_modentry[i].yres == vres) 1271 viafb_modentry[i].yres == vres)
1273 break; 1272 break;
1274 1273
1275 viafb_resMode = viafb_modentry[i].mode_index; 1274 return viafb_modentry[i].mode_index;
1276 if (flag)
1277 viafb_mode1 = viafb_modentry[i].mode_res;
1278 else
1279 viafb_mode = viafb_modentry[i].mode_res;
1280
1281 return viafb_resMode;
1282} 1275}
1283 1276
1284static void check_available_device_to_enable(int device_id) 1277static void check_available_device_to_enable(int device_id)
@@ -2199,7 +2192,7 @@ static int __devinit via_pci_probe(void)
2199 strict_strtoul(tmpc, 0, &default_xres); 2192 strict_strtoul(tmpc, 0, &default_xres);
2200 strict_strtoul(tmpm, 0, &default_yres); 2193 strict_strtoul(tmpm, 0, &default_yres);
2201 2194
2202 vmode_index = viafb_get_mode_index(default_xres, default_yres, 0); 2195 vmode_index = viafb_get_mode_index(default_xres, default_yres);
2203 DEBUG_MSG(KERN_INFO "0->index=%d\n", vmode_index); 2196 DEBUG_MSG(KERN_INFO "0->index=%d\n", vmode_index);
2204 2197
2205 if (viafb_SAMM_ON == 1) { 2198 if (viafb_SAMM_ON == 1) {
diff --git a/drivers/video/via/viafbdev.h b/drivers/video/via/viafbdev.h
index a4158e872878..227b000feb38 100644
--- a/drivers/video/via/viafbdev.h
+++ b/drivers/video/via/viafbdev.h
@@ -81,7 +81,6 @@ struct viafb_modeinfo {
81 u32 xres; 81 u32 xres;
82 u32 yres; 82 u32 yres;
83 int mode_index; 83 int mode_index;
84 char *mode_res;
85}; 84};
86extern unsigned int viafb_second_virtual_yres; 85extern unsigned int viafb_second_virtual_yres;
87extern unsigned int viafb_second_virtual_xres; 86extern unsigned int viafb_second_virtual_xres;
@@ -102,7 +101,7 @@ extern int strict_strtoul(const char *cp, unsigned int base,
102void viafb_memory_pitch_patch(struct fb_info *info); 101void viafb_memory_pitch_patch(struct fb_info *info);
103void viafb_fill_var_timing_info(struct fb_var_screeninfo *var, int refresh, 102void viafb_fill_var_timing_info(struct fb_var_screeninfo *var, int refresh,
104 int mode_index); 103 int mode_index);
105int viafb_get_mode_index(int hres, int vres, int flag); 104int viafb_get_mode_index(int hres, int vres);
106u8 viafb_gpio_i2c_read_lvds(struct lvds_setting_information 105u8 viafb_gpio_i2c_read_lvds(struct lvds_setting_information
107 *plvds_setting_info, struct lvds_chip_information 106 *plvds_setting_info, struct lvds_chip_information
108 *plvds_chip_info, u8 index); 107 *plvds_chip_info, u8 index);
diff --git a/drivers/video/w100fb.c b/drivers/video/w100fb.c
index d0674f1e3f10..2376f688ec8b 100644
--- a/drivers/video/w100fb.c
+++ b/drivers/video/w100fb.c
@@ -523,6 +523,7 @@ static int w100fb_set_par(struct fb_info *info)
523 info->fix.ywrapstep = 0; 523 info->fix.ywrapstep = 0;
524 info->fix.line_length = par->xres * BITS_PER_PIXEL / 8; 524 info->fix.line_length = par->xres * BITS_PER_PIXEL / 8;
525 525
526 mutex_lock(&info->mm_lock);
526 if ((par->xres*par->yres*BITS_PER_PIXEL/8) > (MEM_INT_SIZE+1)) { 527 if ((par->xres*par->yres*BITS_PER_PIXEL/8) > (MEM_INT_SIZE+1)) {
527 par->extmem_active = 1; 528 par->extmem_active = 1;
528 info->fix.smem_len = par->mach->mem->size+1; 529 info->fix.smem_len = par->mach->mem->size+1;
@@ -530,6 +531,7 @@ static int w100fb_set_par(struct fb_info *info)
530 par->extmem_active = 0; 531 par->extmem_active = 0;
531 info->fix.smem_len = MEM_INT_SIZE+1; 532 info->fix.smem_len = MEM_INT_SIZE+1;
532 } 533 }
534 mutex_unlock(&info->mm_lock);
533 535
534 w100fb_activate_var(par); 536 w100fb_activate_var(par);
535 } 537 }
@@ -746,8 +748,6 @@ int __init w100fb_probe(struct platform_device *pdev)
746 goto out; 748 goto out;
747 } 749 }
748 750
749 w100fb_set_par(info);
750
751 if (register_framebuffer(info) < 0) { 751 if (register_framebuffer(info) < 0) {
752 err = -EINVAL; 752 err = -EINVAL;
753 goto out; 753 goto out;
diff --git a/drivers/virtio/virtio_pci.c b/drivers/virtio/virtio_pci.c
index 193c8f0e5cc5..248e00ec4dc1 100644
--- a/drivers/virtio/virtio_pci.c
+++ b/drivers/virtio/virtio_pci.c
@@ -52,8 +52,10 @@ struct virtio_pci_device
52 char (*msix_names)[256]; 52 char (*msix_names)[256];
53 /* Number of available vectors */ 53 /* Number of available vectors */
54 unsigned msix_vectors; 54 unsigned msix_vectors;
55 /* Vectors allocated */ 55 /* Vectors allocated, excluding per-vq vectors if any */
56 unsigned msix_used_vectors; 56 unsigned msix_used_vectors;
57 /* Whether we have vector per vq */
58 bool per_vq_vectors;
57}; 59};
58 60
59/* Constants for MSI-X */ 61/* Constants for MSI-X */
@@ -258,7 +260,6 @@ static void vp_free_vectors(struct virtio_device *vdev)
258 260
259 for (i = 0; i < vp_dev->msix_used_vectors; ++i) 261 for (i = 0; i < vp_dev->msix_used_vectors; ++i)
260 free_irq(vp_dev->msix_entries[i].vector, vp_dev); 262 free_irq(vp_dev->msix_entries[i].vector, vp_dev);
261 vp_dev->msix_used_vectors = 0;
262 263
263 if (vp_dev->msix_enabled) { 264 if (vp_dev->msix_enabled) {
264 /* Disable the vector used for configuration */ 265 /* Disable the vector used for configuration */
@@ -267,80 +268,77 @@ static void vp_free_vectors(struct virtio_device *vdev)
267 /* Flush the write out to device */ 268 /* Flush the write out to device */
268 ioread16(vp_dev->ioaddr + VIRTIO_MSI_CONFIG_VECTOR); 269 ioread16(vp_dev->ioaddr + VIRTIO_MSI_CONFIG_VECTOR);
269 270
270 vp_dev->msix_enabled = 0;
271 pci_disable_msix(vp_dev->pci_dev); 271 pci_disable_msix(vp_dev->pci_dev);
272 vp_dev->msix_enabled = 0;
273 vp_dev->msix_vectors = 0;
272 } 274 }
273}
274 275
275static int vp_enable_msix(struct pci_dev *dev, struct msix_entry *entries, 276 vp_dev->msix_used_vectors = 0;
276 int *options, int noptions) 277 kfree(vp_dev->msix_names);
277{ 278 vp_dev->msix_names = NULL;
278 int i; 279 kfree(vp_dev->msix_entries);
279 for (i = 0; i < noptions; ++i) 280 vp_dev->msix_entries = NULL;
280 if (!pci_enable_msix(dev, entries, options[i]))
281 return options[i];
282 return -EBUSY;
283} 281}
284 282
285static int vp_request_vectors(struct virtio_device *vdev, unsigned max_vqs) 283static int vp_request_vectors(struct virtio_device *vdev, int nvectors,
284 bool per_vq_vectors)
286{ 285{
287 struct virtio_pci_device *vp_dev = to_vp_device(vdev); 286 struct virtio_pci_device *vp_dev = to_vp_device(vdev);
288 const char *name = dev_name(&vp_dev->vdev.dev); 287 const char *name = dev_name(&vp_dev->vdev.dev);
289 unsigned i, v; 288 unsigned i, v;
290 int err = -ENOMEM; 289 int err = -ENOMEM;
291 /* We want at most one vector per queue and one for config changes. 290
292 * Fallback to separate vectors for config and a shared for queues. 291 if (!nvectors) {
293 * Finally fall back to regular interrupts. */ 292 /* Can't allocate MSI-X vectors, use regular interrupt */
294 int options[] = { max_vqs + 1, 2 }; 293 vp_dev->msix_vectors = 0;
295 int nvectors = max(options[0], options[1]); 294 err = request_irq(vp_dev->pci_dev->irq, vp_interrupt,
295 IRQF_SHARED, name, vp_dev);
296 if (err)
297 return err;
298 vp_dev->intx_enabled = 1;
299 return 0;
300 }
296 301
297 vp_dev->msix_entries = kmalloc(nvectors * sizeof *vp_dev->msix_entries, 302 vp_dev->msix_entries = kmalloc(nvectors * sizeof *vp_dev->msix_entries,
298 GFP_KERNEL); 303 GFP_KERNEL);
299 if (!vp_dev->msix_entries) 304 if (!vp_dev->msix_entries)
300 goto error_entries; 305 goto error;
301 vp_dev->msix_names = kmalloc(nvectors * sizeof *vp_dev->msix_names, 306 vp_dev->msix_names = kmalloc(nvectors * sizeof *vp_dev->msix_names,
302 GFP_KERNEL); 307 GFP_KERNEL);
303 if (!vp_dev->msix_names) 308 if (!vp_dev->msix_names)
304 goto error_names; 309 goto error;
305 310
306 for (i = 0; i < nvectors; ++i) 311 for (i = 0; i < nvectors; ++i)
307 vp_dev->msix_entries[i].entry = i; 312 vp_dev->msix_entries[i].entry = i;
308 313
309 err = vp_enable_msix(vp_dev->pci_dev, vp_dev->msix_entries, 314 err = pci_enable_msix(vp_dev->pci_dev, vp_dev->msix_entries, nvectors);
310 options, ARRAY_SIZE(options)); 315 if (err > 0)
311 if (err < 0) { 316 err = -ENOSPC;
312 /* Can't allocate enough MSI-X vectors, use regular interrupt */ 317 if (err)
313 vp_dev->msix_vectors = 0; 318 goto error;
314 err = request_irq(vp_dev->pci_dev->irq, vp_interrupt, 319 vp_dev->msix_vectors = nvectors;
315 IRQF_SHARED, name, vp_dev); 320 vp_dev->msix_enabled = 1;
316 if (err) 321
317 goto error_irq; 322 /* Set the vector used for configuration */
318 vp_dev->intx_enabled = 1; 323 v = vp_dev->msix_used_vectors;
319 } else { 324 snprintf(vp_dev->msix_names[v], sizeof *vp_dev->msix_names,
320 vp_dev->msix_vectors = err; 325 "%s-config", name);
321 vp_dev->msix_enabled = 1; 326 err = request_irq(vp_dev->msix_entries[v].vector,
322 327 vp_config_changed, 0, vp_dev->msix_names[v],
323 /* Set the vector used for configuration */ 328 vp_dev);
324 v = vp_dev->msix_used_vectors; 329 if (err)
325 snprintf(vp_dev->msix_names[v], sizeof *vp_dev->msix_names, 330 goto error;
326 "%s-config", name); 331 ++vp_dev->msix_used_vectors;
327 err = request_irq(vp_dev->msix_entries[v].vector, 332
328 vp_config_changed, 0, vp_dev->msix_names[v], 333 iowrite16(v, vp_dev->ioaddr + VIRTIO_MSI_CONFIG_VECTOR);
329 vp_dev); 334 /* Verify we had enough resources to assign the vector */
330 if (err) 335 v = ioread16(vp_dev->ioaddr + VIRTIO_MSI_CONFIG_VECTOR);
331 goto error_irq; 336 if (v == VIRTIO_MSI_NO_VECTOR) {
332 ++vp_dev->msix_used_vectors; 337 err = -EBUSY;
333 338 goto error;
334 iowrite16(v, vp_dev->ioaddr + VIRTIO_MSI_CONFIG_VECTOR);
335 /* Verify we had enough resources to assign the vector */
336 v = ioread16(vp_dev->ioaddr + VIRTIO_MSI_CONFIG_VECTOR);
337 if (v == VIRTIO_MSI_NO_VECTOR) {
338 err = -EBUSY;
339 goto error_irq;
340 }
341 } 339 }
342 340
343 if (vp_dev->msix_vectors && vp_dev->msix_vectors != max_vqs + 1) { 341 if (!per_vq_vectors) {
344 /* Shared vector for all VQs */ 342 /* Shared vector for all VQs */
345 v = vp_dev->msix_used_vectors; 343 v = vp_dev->msix_used_vectors;
346 snprintf(vp_dev->msix_names[v], sizeof *vp_dev->msix_names, 344 snprintf(vp_dev->msix_names[v], sizeof *vp_dev->msix_names,
@@ -349,28 +347,25 @@ static int vp_request_vectors(struct virtio_device *vdev, unsigned max_vqs)
349 vp_vring_interrupt, 0, vp_dev->msix_names[v], 347 vp_vring_interrupt, 0, vp_dev->msix_names[v],
350 vp_dev); 348 vp_dev);
351 if (err) 349 if (err)
352 goto error_irq; 350 goto error;
353 ++vp_dev->msix_used_vectors; 351 ++vp_dev->msix_used_vectors;
354 } 352 }
355 return 0; 353 return 0;
356error_irq: 354error:
357 vp_free_vectors(vdev); 355 vp_free_vectors(vdev);
358 kfree(vp_dev->msix_names);
359error_names:
360 kfree(vp_dev->msix_entries);
361error_entries:
362 return err; 356 return err;
363} 357}
364 358
365static struct virtqueue *vp_find_vq(struct virtio_device *vdev, unsigned index, 359static struct virtqueue *vp_find_vq(struct virtio_device *vdev, unsigned index,
366 void (*callback)(struct virtqueue *vq), 360 void (*callback)(struct virtqueue *vq),
367 const char *name) 361 const char *name,
362 u16 vector)
368{ 363{
369 struct virtio_pci_device *vp_dev = to_vp_device(vdev); 364 struct virtio_pci_device *vp_dev = to_vp_device(vdev);
370 struct virtio_pci_vq_info *info; 365 struct virtio_pci_vq_info *info;
371 struct virtqueue *vq; 366 struct virtqueue *vq;
372 unsigned long flags, size; 367 unsigned long flags, size;
373 u16 num, vector; 368 u16 num;
374 int err; 369 int err;
375 370
376 /* Select the queue we're interested in */ 371 /* Select the queue we're interested in */
@@ -389,7 +384,7 @@ static struct virtqueue *vp_find_vq(struct virtio_device *vdev, unsigned index,
389 384
390 info->queue_index = index; 385 info->queue_index = index;
391 info->num = num; 386 info->num = num;
392 info->vector = VIRTIO_MSI_NO_VECTOR; 387 info->vector = vector;
393 388
394 size = PAGE_ALIGN(vring_size(num, VIRTIO_PCI_VRING_ALIGN)); 389 size = PAGE_ALIGN(vring_size(num, VIRTIO_PCI_VRING_ALIGN));
395 info->queue = alloc_pages_exact(size, GFP_KERNEL|__GFP_ZERO); 390 info->queue = alloc_pages_exact(size, GFP_KERNEL|__GFP_ZERO);
@@ -413,22 +408,7 @@ static struct virtqueue *vp_find_vq(struct virtio_device *vdev, unsigned index,
413 vq->priv = info; 408 vq->priv = info;
414 info->vq = vq; 409 info->vq = vq;
415 410
416 /* allocate per-vq vector if available and necessary */ 411 if (vector != VIRTIO_MSI_NO_VECTOR) {
417 if (callback && vp_dev->msix_used_vectors < vp_dev->msix_vectors) {
418 vector = vp_dev->msix_used_vectors;
419 snprintf(vp_dev->msix_names[vector], sizeof *vp_dev->msix_names,
420 "%s-%s", dev_name(&vp_dev->vdev.dev), name);
421 err = request_irq(vp_dev->msix_entries[vector].vector,
422 vring_interrupt, 0,
423 vp_dev->msix_names[vector], vq);
424 if (err)
425 goto out_request_irq;
426 info->vector = vector;
427 ++vp_dev->msix_used_vectors;
428 } else
429 vector = VP_MSIX_VQ_VECTOR;
430
431 if (callback && vp_dev->msix_enabled) {
432 iowrite16(vector, vp_dev->ioaddr + VIRTIO_MSI_QUEUE_VECTOR); 412 iowrite16(vector, vp_dev->ioaddr + VIRTIO_MSI_QUEUE_VECTOR);
433 vector = ioread16(vp_dev->ioaddr + VIRTIO_MSI_QUEUE_VECTOR); 413 vector = ioread16(vp_dev->ioaddr + VIRTIO_MSI_QUEUE_VECTOR);
434 if (vector == VIRTIO_MSI_NO_VECTOR) { 414 if (vector == VIRTIO_MSI_NO_VECTOR) {
@@ -444,11 +424,6 @@ static struct virtqueue *vp_find_vq(struct virtio_device *vdev, unsigned index,
444 return vq; 424 return vq;
445 425
446out_assign: 426out_assign:
447 if (info->vector != VIRTIO_MSI_NO_VECTOR) {
448 free_irq(vp_dev->msix_entries[info->vector].vector, vq);
449 --vp_dev->msix_used_vectors;
450 }
451out_request_irq:
452 vring_del_virtqueue(vq); 427 vring_del_virtqueue(vq);
453out_activate_queue: 428out_activate_queue:
454 iowrite32(0, vp_dev->ioaddr + VIRTIO_PCI_QUEUE_PFN); 429 iowrite32(0, vp_dev->ioaddr + VIRTIO_PCI_QUEUE_PFN);
@@ -462,12 +437,13 @@ static void vp_del_vq(struct virtqueue *vq)
462{ 437{
463 struct virtio_pci_device *vp_dev = to_vp_device(vq->vdev); 438 struct virtio_pci_device *vp_dev = to_vp_device(vq->vdev);
464 struct virtio_pci_vq_info *info = vq->priv; 439 struct virtio_pci_vq_info *info = vq->priv;
465 unsigned long size; 440 unsigned long flags, size;
466 441
467 iowrite16(info->queue_index, vp_dev->ioaddr + VIRTIO_PCI_QUEUE_SEL); 442 spin_lock_irqsave(&vp_dev->lock, flags);
443 list_del(&info->node);
444 spin_unlock_irqrestore(&vp_dev->lock, flags);
468 445
469 if (info->vector != VIRTIO_MSI_NO_VECTOR) 446 iowrite16(info->queue_index, vp_dev->ioaddr + VIRTIO_PCI_QUEUE_SEL);
470 free_irq(vp_dev->msix_entries[info->vector].vector, vq);
471 447
472 if (vp_dev->msix_enabled) { 448 if (vp_dev->msix_enabled) {
473 iowrite16(VIRTIO_MSI_NO_VECTOR, 449 iowrite16(VIRTIO_MSI_NO_VECTOR,
@@ -489,36 +465,62 @@ static void vp_del_vq(struct virtqueue *vq)
489/* the config->del_vqs() implementation */ 465/* the config->del_vqs() implementation */
490static void vp_del_vqs(struct virtio_device *vdev) 466static void vp_del_vqs(struct virtio_device *vdev)
491{ 467{
468 struct virtio_pci_device *vp_dev = to_vp_device(vdev);
492 struct virtqueue *vq, *n; 469 struct virtqueue *vq, *n;
470 struct virtio_pci_vq_info *info;
493 471
494 list_for_each_entry_safe(vq, n, &vdev->vqs, list) 472 list_for_each_entry_safe(vq, n, &vdev->vqs, list) {
473 info = vq->priv;
474 if (vp_dev->per_vq_vectors)
475 free_irq(vp_dev->msix_entries[info->vector].vector, vq);
495 vp_del_vq(vq); 476 vp_del_vq(vq);
477 }
478 vp_dev->per_vq_vectors = false;
496 479
497 vp_free_vectors(vdev); 480 vp_free_vectors(vdev);
498} 481}
499 482
500/* the config->find_vqs() implementation */ 483static int vp_try_to_find_vqs(struct virtio_device *vdev, unsigned nvqs,
501static int vp_find_vqs(struct virtio_device *vdev, unsigned nvqs, 484 struct virtqueue *vqs[],
502 struct virtqueue *vqs[], 485 vq_callback_t *callbacks[],
503 vq_callback_t *callbacks[], 486 const char *names[],
504 const char *names[]) 487 int nvectors,
488 bool per_vq_vectors)
505{ 489{
506 int vectors = 0; 490 struct virtio_pci_device *vp_dev = to_vp_device(vdev);
507 int i, err; 491 u16 vector;
508 492 int i, err, allocated_vectors;
509 /* How many vectors would we like? */
510 for (i = 0; i < nvqs; ++i)
511 if (callbacks[i])
512 ++vectors;
513 493
514 err = vp_request_vectors(vdev, vectors); 494 err = vp_request_vectors(vdev, nvectors, per_vq_vectors);
515 if (err) 495 if (err)
516 goto error_request; 496 goto error_request;
517 497
498 vp_dev->per_vq_vectors = per_vq_vectors;
499 allocated_vectors = vp_dev->msix_used_vectors;
518 for (i = 0; i < nvqs; ++i) { 500 for (i = 0; i < nvqs; ++i) {
519 vqs[i] = vp_find_vq(vdev, i, callbacks[i], names[i]); 501 if (!callbacks[i] || !vp_dev->msix_enabled)
520 if (IS_ERR(vqs[i])) 502 vector = VIRTIO_MSI_NO_VECTOR;
503 else if (vp_dev->per_vq_vectors)
504 vector = allocated_vectors++;
505 else
506 vector = VP_MSIX_VQ_VECTOR;
507 vqs[i] = vp_find_vq(vdev, i, callbacks[i], names[i], vector);
508 if (IS_ERR(vqs[i])) {
509 err = PTR_ERR(vqs[i]);
521 goto error_find; 510 goto error_find;
511 }
512 /* allocate per-vq irq if available and necessary */
513 if (vp_dev->per_vq_vectors && vector != VIRTIO_MSI_NO_VECTOR) {
514 snprintf(vp_dev->msix_names[vector], sizeof *vp_dev->msix_names,
515 "%s-%s", dev_name(&vp_dev->vdev.dev), names[i]);
516 err = request_irq(vp_dev->msix_entries[vector].vector,
517 vring_interrupt, 0,
518 vp_dev->msix_names[vector], vqs[i]);
519 if (err) {
520 vp_del_vq(vqs[i]);
521 goto error_find;
522 }
523 }
522 } 524 }
523 return 0; 525 return 0;
524 526
@@ -526,7 +528,37 @@ error_find:
526 vp_del_vqs(vdev); 528 vp_del_vqs(vdev);
527 529
528error_request: 530error_request:
529 return PTR_ERR(vqs[i]); 531 return err;
532}
533
534/* the config->find_vqs() implementation */
535static int vp_find_vqs(struct virtio_device *vdev, unsigned nvqs,
536 struct virtqueue *vqs[],
537 vq_callback_t *callbacks[],
538 const char *names[])
539{
540 int vectors = 0;
541 int i, uninitialized_var(err);
542
543 /* How many vectors would we like? */
544 for (i = 0; i < nvqs; ++i)
545 if (callbacks[i])
546 ++vectors;
547
548 /* We want at most one vector per queue and one for config changes. */
549 err = vp_try_to_find_vqs(vdev, nvqs, vqs, callbacks, names,
550 vectors + 1, true);
551 if (!err)
552 return 0;
553 /* Fallback to separate vectors for config and a shared for queues. */
554 err = vp_try_to_find_vqs(vdev, nvqs, vqs, callbacks, names,
555 2, false);
556 if (!err)
557 return 0;
558 /* Finally fall back to regular interrupts. */
559 err = vp_try_to_find_vqs(vdev, nvqs, vqs, callbacks, names,
560 0, false);
561 return err;
530} 562}
531 563
532static struct virtio_config_ops virtio_pci_config_ops = { 564static struct virtio_config_ops virtio_pci_config_ops = {
@@ -669,7 +701,7 @@ static int __init virtio_pci_init(void)
669 701
670 err = pci_register_driver(&virtio_pci_driver); 702 err = pci_register_driver(&virtio_pci_driver);
671 if (err) 703 if (err)
672 device_unregister(virtio_pci_root); 704 root_device_unregister(virtio_pci_root);
673 705
674 return err; 706 return err;
675} 707}
diff --git a/drivers/vlynq/Kconfig b/drivers/vlynq/Kconfig
index f6542211db48..a9efb1625321 100644
--- a/drivers/vlynq/Kconfig
+++ b/drivers/vlynq/Kconfig
@@ -13,7 +13,7 @@ config VLYNQ
13 13
14config VLYNQ_DEBUG 14config VLYNQ_DEBUG
15 bool "VLYNQ bus debug" 15 bool "VLYNQ bus debug"
16 depends on VLYNQ && KERNEL_DEBUG 16 depends on VLYNQ && DEBUG_KERNEL
17 help 17 help
18 Turn on VLYNQ bus debugging. 18 Turn on VLYNQ bus debugging.
19 19
diff --git a/drivers/vlynq/vlynq.c b/drivers/vlynq/vlynq.c
index 7335433b067b..f05d2a368367 100644
--- a/drivers/vlynq/vlynq.c
+++ b/drivers/vlynq/vlynq.c
@@ -76,7 +76,7 @@ struct vlynq_regs {
76 u32 int_device[8]; 76 u32 int_device[8];
77}; 77};
78 78
79#ifdef VLYNQ_DEBUG 79#ifdef CONFIG_VLYNQ_DEBUG
80static void vlynq_dump_regs(struct vlynq_device *dev) 80static void vlynq_dump_regs(struct vlynq_device *dev)
81{ 81{
82 int i; 82 int i;
diff --git a/drivers/w1/masters/omap_hdq.c b/drivers/w1/masters/omap_hdq.c
index a7e3b706b9d3..0d92969404c3 100644
--- a/drivers/w1/masters/omap_hdq.c
+++ b/drivers/w1/masters/omap_hdq.c
@@ -687,6 +687,7 @@ static int omap_hdq_remove(struct platform_device *pdev)
687 687
688 if (hdq_data->hdq_usecount) { 688 if (hdq_data->hdq_usecount) {
689 dev_dbg(&pdev->dev, "removed when use count is not zero\n"); 689 dev_dbg(&pdev->dev, "removed when use count is not zero\n");
690 mutex_unlock(&hdq_data->hdq_mutex);
690 return -EBUSY; 691 return -EBUSY;
691 } 692 }
692 693
diff --git a/drivers/watchdog/bcm47xx_wdt.c b/drivers/watchdog/bcm47xx_wdt.c
index 5c7011cda6a6..751c003864ad 100644
--- a/drivers/watchdog/bcm47xx_wdt.c
+++ b/drivers/watchdog/bcm47xx_wdt.c
@@ -161,7 +161,7 @@ static long bcm47xx_wdt_ioctl(struct file *file,
161{ 161{
162 void __user *argp = (void __user *)arg; 162 void __user *argp = (void __user *)arg;
163 int __user *p = argp; 163 int __user *p = argp;
164 int new_value, retval = -EINVAL;; 164 int new_value, retval = -EINVAL;
165 165
166 switch (cmd) { 166 switch (cmd) {
167 case WDIOC_GETSUPPORT: 167 case WDIOC_GETSUPPORT:
diff --git a/drivers/watchdog/coh901327_wdt.c b/drivers/watchdog/coh901327_wdt.c
index fecb307d28e9..aec7cefdef21 100644
--- a/drivers/watchdog/coh901327_wdt.c
+++ b/drivers/watchdog/coh901327_wdt.c
@@ -18,6 +18,7 @@
18#include <linux/bitops.h> 18#include <linux/bitops.h>
19#include <linux/uaccess.h> 19#include <linux/uaccess.h>
20#include <linux/clk.h> 20#include <linux/clk.h>
21#include <linux/delay.h>
21 22
22#define DRV_NAME "WDOG COH 901 327" 23#define DRV_NAME "WDOG COH 901 327"
23 24
@@ -92,6 +93,8 @@ static struct clk *clk;
92static void coh901327_enable(u16 timeout) 93static void coh901327_enable(u16 timeout)
93{ 94{
94 u16 val; 95 u16 val;
96 unsigned long freq;
97 unsigned long delay_ns;
95 98
96 clk_enable(clk); 99 clk_enable(clk);
97 /* Restart timer if it is disabled */ 100 /* Restart timer if it is disabled */
@@ -102,6 +105,14 @@ static void coh901327_enable(u16 timeout)
102 /* Acknowledge any pending interrupt so it doesn't just fire off */ 105 /* Acknowledge any pending interrupt so it doesn't just fire off */
103 writew(U300_WDOG_IER_WILL_BARK_IRQ_ACK_ENABLE, 106 writew(U300_WDOG_IER_WILL_BARK_IRQ_ACK_ENABLE,
104 virtbase + U300_WDOG_IER); 107 virtbase + U300_WDOG_IER);
108 /*
109 * The interrupt is cleared in the 32 kHz clock domain.
110 * Wait 3 32 kHz cycles for it to take effect
111 */
112 freq = clk_get_rate(clk);
113 delay_ns = (1000000000 + freq - 1) / freq; /* Freq to ns and round up */
114 delay_ns = 3 * delay_ns; /* Wait 3 cycles */
115 ndelay(delay_ns);
105 /* Enable the watchdog interrupt */ 116 /* Enable the watchdog interrupt */
106 writew(U300_WDOG_IMR_WILL_BARK_IRQ_ENABLE, virtbase + U300_WDOG_IMR); 117 writew(U300_WDOG_IMR_WILL_BARK_IRQ_ENABLE, virtbase + U300_WDOG_IMR);
107 /* Activate the watchdog timer */ 118 /* Activate the watchdog timer */
diff --git a/drivers/watchdog/ep93xx_wdt.c b/drivers/watchdog/ep93xx_wdt.c
index e9f950ff86ea..cdd55e0d09f8 100644
--- a/drivers/watchdog/ep93xx_wdt.c
+++ b/drivers/watchdog/ep93xx_wdt.c
@@ -29,6 +29,7 @@
29#include <linux/watchdog.h> 29#include <linux/watchdog.h>
30#include <linux/timer.h> 30#include <linux/timer.h>
31#include <linux/uaccess.h> 31#include <linux/uaccess.h>
32#include <linux/io.h>
32#include <mach/hardware.h> 33#include <mach/hardware.h>
33 34
34#define WDT_VERSION "0.3" 35#define WDT_VERSION "0.3"
diff --git a/drivers/watchdog/ks8695_wdt.c b/drivers/watchdog/ks8695_wdt.c
index 00b03eb43bf0..e1c82769b08e 100644
--- a/drivers/watchdog/ks8695_wdt.c
+++ b/drivers/watchdog/ks8695_wdt.c
@@ -66,7 +66,7 @@ static inline void ks8695_wdt_stop(void)
66static inline void ks8695_wdt_start(void) 66static inline void ks8695_wdt_start(void)
67{ 67{
68 unsigned long tmcon; 68 unsigned long tmcon;
69 unsigned long tval = wdt_time * CLOCK_TICK_RATE; 69 unsigned long tval = wdt_time * KS8695_CLOCK_RATE;
70 70
71 spin_lock(&ks8695_lock); 71 spin_lock(&ks8695_lock);
72 /* disable timer0 */ 72 /* disable timer0 */
@@ -103,7 +103,7 @@ static inline void ks8695_wdt_reload(void)
103static int ks8695_wdt_settimeout(int new_time) 103static int ks8695_wdt_settimeout(int new_time)
104{ 104{
105 /* 105 /*
106 * All counting occurs at SLOW_CLOCK / 128 = 0.256 Hz 106 * All counting occurs at KS8695_CLOCK_RATE / 128 = 0.256 Hz
107 * 107 *
108 * Since WDV is a 16-bit counter, the maximum period is 108 * Since WDV is a 16-bit counter, the maximum period is
109 * 65536 / 0.256 = 256 seconds. 109 * 65536 / 0.256 = 256 seconds.
diff --git a/drivers/watchdog/sa1100_wdt.c b/drivers/watchdog/sa1100_wdt.c
index ee1caae4d33b..016245419fad 100644
--- a/drivers/watchdog/sa1100_wdt.c
+++ b/drivers/watchdog/sa1100_wdt.c
@@ -38,7 +38,7 @@
38 38
39static unsigned long oscr_freq; 39static unsigned long oscr_freq;
40static unsigned long sa1100wdt_users; 40static unsigned long sa1100wdt_users;
41static int pre_margin; 41static unsigned int pre_margin;
42static int boot_status; 42static int boot_status;
43 43
44/* 44/*
@@ -84,6 +84,7 @@ static const struct watchdog_info ident = {
84 .options = WDIOF_CARDRESET | WDIOF_SETTIMEOUT 84 .options = WDIOF_CARDRESET | WDIOF_SETTIMEOUT
85 | WDIOF_KEEPALIVEPING, 85 | WDIOF_KEEPALIVEPING,
86 .identity = "SA1100/PXA255 Watchdog", 86 .identity = "SA1100/PXA255 Watchdog",
87 .firmware_version = 1,
87}; 88};
88 89
89static long sa1100dog_ioctl(struct file *file, unsigned int cmd, 90static long sa1100dog_ioctl(struct file *file, unsigned int cmd,
@@ -118,7 +119,7 @@ static long sa1100dog_ioctl(struct file *file, unsigned int cmd,
118 if (ret) 119 if (ret)
119 break; 120 break;
120 121
121 if (time <= 0 || time > 255) { 122 if (time <= 0 || (oscr_freq * (long long)time >= 0xffffffff)) {
122 ret = -EINVAL; 123 ret = -EINVAL;
123 break; 124 break;
124 } 125 }
diff --git a/drivers/watchdog/w83627hf_wdt.c b/drivers/watchdog/w83627hf_wdt.c
index 916890abffdd..f201accc4e3d 100644
--- a/drivers/watchdog/w83627hf_wdt.c
+++ b/drivers/watchdog/w83627hf_wdt.c
@@ -89,6 +89,11 @@ static void w83627hf_select_wd_register(void)
89 c = ((inb_p(WDT_EFDR) & 0xf7) | 0x04); /* select WDT0 */ 89 c = ((inb_p(WDT_EFDR) & 0xf7) | 0x04); /* select WDT0 */
90 outb_p(0x2b, WDT_EFER); 90 outb_p(0x2b, WDT_EFER);
91 outb_p(c, WDT_EFDR); /* set GPIO3 to WDT0 */ 91 outb_p(c, WDT_EFDR); /* set GPIO3 to WDT0 */
92 } else if (c == 0x88) { /* W83627EHF */
93 outb_p(0x2d, WDT_EFER); /* select GPIO5 */
94 c = inb_p(WDT_EFDR) & ~0x01; /* PIN77 -> WDT0# */
95 outb_p(0x2d, WDT_EFER);
96 outb_p(c, WDT_EFDR); /* set GPIO5 to WDT0 */
92 } 97 }
93 98
94 outb_p(0x07, WDT_EFER); /* point to logical device number reg */ 99 outb_p(0x07, WDT_EFER); /* point to logical device number reg */
diff --git a/drivers/watchdog/w83697ug_wdt.c b/drivers/watchdog/w83697ug_wdt.c
index 883b5f79673a..a6c12dec91a1 100644
--- a/drivers/watchdog/w83697ug_wdt.c
+++ b/drivers/watchdog/w83697ug_wdt.c
@@ -149,8 +149,10 @@ static void wdt_ctrl(int timeout)
149{ 149{
150 spin_lock(&io_lock); 150 spin_lock(&io_lock);
151 151
152 if (w83697ug_select_wd_register() < 0) 152 if (w83697ug_select_wd_register() < 0) {
153 spin_unlock(&io_lock);
153 return; 154 return;
155 }
154 156
155 outb_p(0xF4, WDT_EFER); /* Select CRF4 */ 157 outb_p(0xF4, WDT_EFER); /* Select CRF4 */
156 outb_p(timeout, WDT_EFDR); /* Write Timeout counter to CRF4 */ 158 outb_p(timeout, WDT_EFDR); /* Write Timeout counter to CRF4 */
diff --git a/drivers/watchdog/wdrtas.c b/drivers/watchdog/wdrtas.c
index a4fe7a38d9b0..3bde56bce63a 100644
--- a/drivers/watchdog/wdrtas.c
+++ b/drivers/watchdog/wdrtas.c
@@ -218,16 +218,14 @@ static void wdrtas_timer_keepalive(void)
218 */ 218 */
219static int wdrtas_get_temperature(void) 219static int wdrtas_get_temperature(void)
220{ 220{
221 long result; 221 int result;
222 int temperature = 0; 222 int temperature = 0;
223 223
224 result = rtas_call(wdrtas_token_get_sensor_state, 2, 2, 224 result = rtas_get_sensor(WDRTAS_THERMAL_SENSOR, 0, &temperature);
225 (void *)__pa(&temperature),
226 WDRTAS_THERMAL_SENSOR, 0);
227 225
228 if (result < 0) 226 if (result < 0)
229 printk(KERN_WARNING "wdrtas: reading the thermal sensor " 227 printk(KERN_WARNING "wdrtas: reading the thermal sensor "
230 "faild: %li\n", result); 228 "failed: %i\n", result);
231 else 229 else
232 temperature = ((temperature * 9) / 5) + 32; /* fahrenheit */ 230 temperature = ((temperature * 9) / 5) + 32; /* fahrenheit */
233 231
diff --git a/drivers/xen/events.c b/drivers/xen/events.c
index 891d2e90753a..abad71b1632b 100644
--- a/drivers/xen/events.c
+++ b/drivers/xen/events.c
@@ -927,9 +927,9 @@ static struct irq_chip xen_dynamic_chip __read_mostly = {
927void __init xen_init_IRQ(void) 927void __init xen_init_IRQ(void)
928{ 928{
929 int i; 929 int i;
930 size_t size = nr_cpu_ids * sizeof(struct cpu_evtchn_s);
931 930
932 cpu_evtchn_mask_p = alloc_bootmem(size); 931 cpu_evtchn_mask_p = kcalloc(nr_cpu_ids, sizeof(struct cpu_evtchn_s),
932 GFP_KERNEL);
933 BUG_ON(cpu_evtchn_mask_p == NULL); 933 BUG_ON(cpu_evtchn_mask_p == NULL);
934 934
935 init_evtchn_cpu_bindings(); 935 init_evtchn_cpu_bindings();
diff --git a/fs/9p/vfs_addr.c b/fs/9p/vfs_addr.c
index 6fcb1e7095cf..92828281a30b 100644
--- a/fs/9p/vfs_addr.c
+++ b/fs/9p/vfs_addr.c
@@ -57,7 +57,7 @@ static int v9fs_vfs_readpage(struct file *filp, struct page *page)
57 buffer = kmap(page); 57 buffer = kmap(page);
58 offset = page_offset(page); 58 offset = page_offset(page);
59 59
60 retval = v9fs_file_readn(filp, buffer, NULL, offset, PAGE_CACHE_SIZE); 60 retval = v9fs_file_readn(filp, buffer, NULL, PAGE_CACHE_SIZE, offset);
61 if (retval < 0) 61 if (retval < 0)
62 goto done; 62 goto done;
63 63
diff --git a/fs/Kconfig b/fs/Kconfig
index a97263be6a91..0e7da7bb5d93 100644
--- a/fs/Kconfig
+++ b/fs/Kconfig
@@ -186,32 +186,7 @@ source "fs/romfs/Kconfig"
186source "fs/sysv/Kconfig" 186source "fs/sysv/Kconfig"
187source "fs/ufs/Kconfig" 187source "fs/ufs/Kconfig"
188source "fs/exofs/Kconfig" 188source "fs/exofs/Kconfig"
189 189source "fs/nilfs2/Kconfig"
190config NILFS2_FS
191 tristate "NILFS2 file system support (EXPERIMENTAL)"
192 depends on BLOCK && EXPERIMENTAL
193 select CRC32
194 help
195 NILFS2 is a log-structured file system (LFS) supporting continuous
196 snapshotting. In addition to versioning capability of the entire
197 file system, users can even restore files mistakenly overwritten or
198 destroyed just a few seconds ago. Since this file system can keep
199 consistency like conventional LFS, it achieves quick recovery after
200 system crashes.
201
202 NILFS2 creates a number of checkpoints every few seconds or per
203 synchronous write basis (unless there is no change). Users can
204 select significant versions among continuously created checkpoints,
205 and can change them into snapshots which will be preserved for long
206 periods until they are changed back to checkpoints. Each
207 snapshot is mountable as a read-only file system concurrently with
208 its writable mount, and this feature is convenient for online backup.
209
210 Some features including atime, extended attributes, and POSIX ACLs,
211 are not supported yet.
212
213 To compile this file system support as a module, choose M here: the
214 module will be called nilfs2. If unsure, say N.
215 190
216endif # MISC_FILESYSTEMS 191endif # MISC_FILESYSTEMS
217 192
diff --git a/fs/adfs/super.c b/fs/adfs/super.c
index aad92f0a1048..6910a98bd73c 100644
--- a/fs/adfs/super.c
+++ b/fs/adfs/super.c
@@ -13,6 +13,7 @@
13#include <linux/parser.h> 13#include <linux/parser.h>
14#include <linux/mount.h> 14#include <linux/mount.h>
15#include <linux/seq_file.h> 15#include <linux/seq_file.h>
16#include <linux/smp_lock.h>
16#include <linux/statfs.h> 17#include <linux/statfs.h>
17#include "adfs.h" 18#include "adfs.h"
18#include "dir_f.h" 19#include "dir_f.h"
diff --git a/fs/afs/dir.c b/fs/afs/dir.c
index 9bd757774c9e..88067f36e5e7 100644
--- a/fs/afs/dir.c
+++ b/fs/afs/dir.c
@@ -564,7 +564,7 @@ static struct dentry *afs_lookup(struct inode *dir, struct dentry *dentry,
564static int afs_d_revalidate(struct dentry *dentry, struct nameidata *nd) 564static int afs_d_revalidate(struct dentry *dentry, struct nameidata *nd)
565{ 565{
566 struct afs_vnode *vnode, *dir; 566 struct afs_vnode *vnode, *dir;
567 struct afs_fid fid; 567 struct afs_fid uninitialized_var(fid);
568 struct dentry *parent; 568 struct dentry *parent;
569 struct key *key; 569 struct key *key;
570 void *dir_version; 570 void *dir_version;
diff --git a/fs/afs/flock.c b/fs/afs/flock.c
index 210acafe4a9b..3ff8bdd18fb3 100644
--- a/fs/afs/flock.c
+++ b/fs/afs/flock.c
@@ -432,7 +432,6 @@ vfs_rejected_lock:
432 list_del_init(&fl->fl_u.afs.link); 432 list_del_init(&fl->fl_u.afs.link);
433 if (list_empty(&vnode->granted_locks)) 433 if (list_empty(&vnode->granted_locks))
434 afs_defer_unlock(vnode, key); 434 afs_defer_unlock(vnode, key);
435 spin_unlock(&vnode->lock);
436 goto abort_attempt; 435 goto abort_attempt;
437} 436}
438 437
diff --git a/fs/afs/mntpt.c b/fs/afs/mntpt.c
index c52be53f6946..5ffb570cd3a8 100644
--- a/fs/afs/mntpt.c
+++ b/fs/afs/mntpt.c
@@ -17,7 +17,6 @@
17#include <linux/pagemap.h> 17#include <linux/pagemap.h>
18#include <linux/mount.h> 18#include <linux/mount.h>
19#include <linux/namei.h> 19#include <linux/namei.h>
20#include <linux/mnt_namespace.h>
21#include "internal.h" 20#include "internal.h"
22 21
23 22
diff --git a/fs/afs/super.c b/fs/afs/super.c
index ad0514d0115f..e1ea1c240b6a 100644
--- a/fs/afs/super.c
+++ b/fs/afs/super.c
@@ -18,6 +18,7 @@
18#include <linux/module.h> 18#include <linux/module.h>
19#include <linux/init.h> 19#include <linux/init.h>
20#include <linux/slab.h> 20#include <linux/slab.h>
21#include <linux/smp_lock.h>
21#include <linux/fs.h> 22#include <linux/fs.h>
22#include <linux/pagemap.h> 23#include <linux/pagemap.h>
23#include <linux/parser.h> 24#include <linux/parser.h>
diff --git a/fs/aio.c b/fs/aio.c
index 76da12537956..d065b2c3273e 100644
--- a/fs/aio.c
+++ b/fs/aio.c
@@ -485,6 +485,8 @@ static inline void really_put_req(struct kioctx *ctx, struct kiocb *req)
485{ 485{
486 assert_spin_locked(&ctx->ctx_lock); 486 assert_spin_locked(&ctx->ctx_lock);
487 487
488 if (req->ki_eventfd != NULL)
489 eventfd_ctx_put(req->ki_eventfd);
488 if (req->ki_dtor) 490 if (req->ki_dtor)
489 req->ki_dtor(req); 491 req->ki_dtor(req);
490 if (req->ki_iovec != &req->ki_inline_vec) 492 if (req->ki_iovec != &req->ki_inline_vec)
@@ -509,8 +511,6 @@ static void aio_fput_routine(struct work_struct *data)
509 /* Complete the fput(s) */ 511 /* Complete the fput(s) */
510 if (req->ki_filp != NULL) 512 if (req->ki_filp != NULL)
511 __fput(req->ki_filp); 513 __fput(req->ki_filp);
512 if (req->ki_eventfd != NULL)
513 __fput(req->ki_eventfd);
514 514
515 /* Link the iocb into the context's free list */ 515 /* Link the iocb into the context's free list */
516 spin_lock_irq(&ctx->ctx_lock); 516 spin_lock_irq(&ctx->ctx_lock);
@@ -528,8 +528,6 @@ static void aio_fput_routine(struct work_struct *data)
528 */ 528 */
529static int __aio_put_req(struct kioctx *ctx, struct kiocb *req) 529static int __aio_put_req(struct kioctx *ctx, struct kiocb *req)
530{ 530{
531 int schedule_putreq = 0;
532
533 dprintk(KERN_DEBUG "aio_put(%p): f_count=%ld\n", 531 dprintk(KERN_DEBUG "aio_put(%p): f_count=%ld\n",
534 req, atomic_long_read(&req->ki_filp->f_count)); 532 req, atomic_long_read(&req->ki_filp->f_count));
535 533
@@ -549,24 +547,16 @@ static int __aio_put_req(struct kioctx *ctx, struct kiocb *req)
549 * we would not be holding the last reference to the file*, so 547 * we would not be holding the last reference to the file*, so
550 * this function will be executed w/out any aio kthread wakeup. 548 * this function will be executed w/out any aio kthread wakeup.
551 */ 549 */
552 if (unlikely(atomic_long_dec_and_test(&req->ki_filp->f_count))) 550 if (unlikely(atomic_long_dec_and_test(&req->ki_filp->f_count))) {
553 schedule_putreq++;
554 else
555 req->ki_filp = NULL;
556 if (req->ki_eventfd != NULL) {
557 if (unlikely(atomic_long_dec_and_test(&req->ki_eventfd->f_count)))
558 schedule_putreq++;
559 else
560 req->ki_eventfd = NULL;
561 }
562 if (unlikely(schedule_putreq)) {
563 get_ioctx(ctx); 551 get_ioctx(ctx);
564 spin_lock(&fput_lock); 552 spin_lock(&fput_lock);
565 list_add(&req->ki_list, &fput_head); 553 list_add(&req->ki_list, &fput_head);
566 spin_unlock(&fput_lock); 554 spin_unlock(&fput_lock);
567 queue_work(aio_wq, &fput_work); 555 queue_work(aio_wq, &fput_work);
568 } else 556 } else {
557 req->ki_filp = NULL;
569 really_put_req(ctx, req); 558 really_put_req(ctx, req);
559 }
570 return 1; 560 return 1;
571} 561}
572 562
@@ -1622,7 +1612,7 @@ static int io_submit_one(struct kioctx *ctx, struct iocb __user *user_iocb,
1622 * an eventfd() fd, and will be signaled for each completed 1612 * an eventfd() fd, and will be signaled for each completed
1623 * event using the eventfd_signal() function. 1613 * event using the eventfd_signal() function.
1624 */ 1614 */
1625 req->ki_eventfd = eventfd_fget((int) iocb->aio_resfd); 1615 req->ki_eventfd = eventfd_ctx_fdget((int) iocb->aio_resfd);
1626 if (IS_ERR(req->ki_eventfd)) { 1616 if (IS_ERR(req->ki_eventfd)) {
1627 ret = PTR_ERR(req->ki_eventfd); 1617 ret = PTR_ERR(req->ki_eventfd);
1628 req->ki_eventfd = NULL; 1618 req->ki_eventfd = NULL;
diff --git a/fs/autofs4/dev-ioctl.c b/fs/autofs4/dev-ioctl.c
index f3da2eb51f56..00bf8fcb245f 100644
--- a/fs/autofs4/dev-ioctl.c
+++ b/fs/autofs4/dev-ioctl.c
@@ -19,7 +19,6 @@
19#include <linux/sched.h> 19#include <linux/sched.h>
20#include <linux/compat.h> 20#include <linux/compat.h>
21#include <linux/syscalls.h> 21#include <linux/syscalls.h>
22#include <linux/smp_lock.h>
23#include <linux/magic.h> 22#include <linux/magic.h>
24#include <linux/dcache.h> 23#include <linux/dcache.h>
25#include <linux/uaccess.h> 24#include <linux/uaccess.h>
diff --git a/fs/bfs/dir.c b/fs/bfs/dir.c
index 54bd07d44e68..1e41aadb1068 100644
--- a/fs/bfs/dir.c
+++ b/fs/bfs/dir.c
@@ -8,7 +8,6 @@
8#include <linux/time.h> 8#include <linux/time.h>
9#include <linux/string.h> 9#include <linux/string.h>
10#include <linux/fs.h> 10#include <linux/fs.h>
11#include <linux/smp_lock.h>
12#include <linux/buffer_head.h> 11#include <linux/buffer_head.h>
13#include <linux/sched.h> 12#include <linux/sched.h>
14#include "bfs.h" 13#include "bfs.h"
diff --git a/fs/bfs/file.c b/fs/bfs/file.c
index 6a021265f018..88b9a3ff44e4 100644
--- a/fs/bfs/file.c
+++ b/fs/bfs/file.c
@@ -11,7 +11,6 @@
11 11
12#include <linux/fs.h> 12#include <linux/fs.h>
13#include <linux/buffer_head.h> 13#include <linux/buffer_head.h>
14#include <linux/smp_lock.h>
15#include "bfs.h" 14#include "bfs.h"
16 15
17#undef DEBUG 16#undef DEBUG
diff --git a/fs/binfmt_elf.c b/fs/binfmt_elf.c
index 9fa212b014a5..b7c1603cd4bd 100644
--- a/fs/binfmt_elf.c
+++ b/fs/binfmt_elf.c
@@ -1522,11 +1522,11 @@ static int fill_note_info(struct elfhdr *elf, int phdrs,
1522 info->thread = NULL; 1522 info->thread = NULL;
1523 1523
1524 psinfo = kmalloc(sizeof(*psinfo), GFP_KERNEL); 1524 psinfo = kmalloc(sizeof(*psinfo), GFP_KERNEL);
1525 fill_note(&info->psinfo, "CORE", NT_PRPSINFO, sizeof(*psinfo), psinfo);
1526
1527 if (psinfo == NULL) 1525 if (psinfo == NULL)
1528 return 0; 1526 return 0;
1529 1527
1528 fill_note(&info->psinfo, "CORE", NT_PRPSINFO, sizeof(*psinfo), psinfo);
1529
1530 /* 1530 /*
1531 * Figure out how many notes we're going to need for each thread. 1531 * Figure out how many notes we're going to need for each thread.
1532 */ 1532 */
@@ -1929,7 +1929,10 @@ static int elf_core_dump(long signr, struct pt_regs *regs, struct file *file, un
1929 elf = kmalloc(sizeof(*elf), GFP_KERNEL); 1929 elf = kmalloc(sizeof(*elf), GFP_KERNEL);
1930 if (!elf) 1930 if (!elf)
1931 goto out; 1931 goto out;
1932 1932 /*
1933 * The number of segs are recored into ELF header as 16bit value.
1934 * Please check DEFAULT_MAX_MAP_COUNT definition when you modify here.
1935 */
1933 segs = current->mm->map_count; 1936 segs = current->mm->map_count;
1934#ifdef ELF_CORE_EXTRA_PHDRS 1937#ifdef ELF_CORE_EXTRA_PHDRS
1935 segs += ELF_CORE_EXTRA_PHDRS; 1938 segs += ELF_CORE_EXTRA_PHDRS;
diff --git a/fs/binfmt_flat.c b/fs/binfmt_flat.c
index 697f6b5f1313..e92f229e3c6e 100644
--- a/fs/binfmt_flat.c
+++ b/fs/binfmt_flat.c
@@ -828,15 +828,22 @@ static int load_flat_shared_library(int id, struct lib_info *libs)
828 if (IS_ERR(bprm.file)) 828 if (IS_ERR(bprm.file))
829 return res; 829 return res;
830 830
831 bprm.cred = prepare_exec_creds();
832 res = -ENOMEM;
833 if (!bprm.cred)
834 goto out;
835
831 res = prepare_binprm(&bprm); 836 res = prepare_binprm(&bprm);
832 837
833 if (res <= (unsigned long)-4096) 838 if (res <= (unsigned long)-4096)
834 res = load_flat_file(&bprm, libs, id, NULL); 839 res = load_flat_file(&bprm, libs, id, NULL);
835 if (bprm.file) { 840
836 allow_write_access(bprm.file); 841 abort_creds(bprm.cred);
837 fput(bprm.file); 842
838 bprm.file = NULL; 843out:
839 } 844 allow_write_access(bprm.file);
845 fput(bprm.file);
846
840 return(res); 847 return(res);
841} 848}
842 849
diff --git a/fs/bio-integrity.c b/fs/bio-integrity.c
index 31c46a241bac..49a34e7f7306 100644
--- a/fs/bio-integrity.c
+++ b/fs/bio-integrity.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * bio-integrity.c - bio data integrity extensions 2 * bio-integrity.c - bio data integrity extensions
3 * 3 *
4 * Copyright (C) 2007, 2008 Oracle Corporation 4 * Copyright (C) 2007, 2008, 2009 Oracle Corporation
5 * Written by: Martin K. Petersen <martin.petersen@oracle.com> 5 * Written by: Martin K. Petersen <martin.petersen@oracle.com>
6 * 6 *
7 * This program is free software; you can redistribute it and/or 7 * This program is free software; you can redistribute it and/or
@@ -25,63 +25,121 @@
25#include <linux/bio.h> 25#include <linux/bio.h>
26#include <linux/workqueue.h> 26#include <linux/workqueue.h>
27 27
28static struct kmem_cache *bio_integrity_slab __read_mostly; 28struct integrity_slab {
29static mempool_t *bio_integrity_pool; 29 struct kmem_cache *slab;
30static struct bio_set *integrity_bio_set; 30 unsigned short nr_vecs;
31 char name[8];
32};
33
34#define IS(x) { .nr_vecs = x, .name = "bip-"__stringify(x) }
35struct integrity_slab bip_slab[BIOVEC_NR_POOLS] __read_mostly = {
36 IS(1), IS(4), IS(16), IS(64), IS(128), IS(BIO_MAX_PAGES),
37};
38#undef IS
39
31static struct workqueue_struct *kintegrityd_wq; 40static struct workqueue_struct *kintegrityd_wq;
32 41
42static inline unsigned int vecs_to_idx(unsigned int nr)
43{
44 switch (nr) {
45 case 1:
46 return 0;
47 case 2 ... 4:
48 return 1;
49 case 5 ... 16:
50 return 2;
51 case 17 ... 64:
52 return 3;
53 case 65 ... 128:
54 return 4;
55 case 129 ... BIO_MAX_PAGES:
56 return 5;
57 default:
58 BUG();
59 }
60}
61
62static inline int use_bip_pool(unsigned int idx)
63{
64 if (idx == BIOVEC_NR_POOLS)
65 return 1;
66
67 return 0;
68}
69
33/** 70/**
34 * bio_integrity_alloc - Allocate integrity payload and attach it to bio 71 * bio_integrity_alloc_bioset - Allocate integrity payload and attach it to bio
35 * @bio: bio to attach integrity metadata to 72 * @bio: bio to attach integrity metadata to
36 * @gfp_mask: Memory allocation mask 73 * @gfp_mask: Memory allocation mask
37 * @nr_vecs: Number of integrity metadata scatter-gather elements 74 * @nr_vecs: Number of integrity metadata scatter-gather elements
75 * @bs: bio_set to allocate from
38 * 76 *
39 * Description: This function prepares a bio for attaching integrity 77 * Description: This function prepares a bio for attaching integrity
40 * metadata. nr_vecs specifies the maximum number of pages containing 78 * metadata. nr_vecs specifies the maximum number of pages containing
41 * integrity metadata that can be attached. 79 * integrity metadata that can be attached.
42 */ 80 */
43struct bio_integrity_payload *bio_integrity_alloc(struct bio *bio, 81struct bio_integrity_payload *bio_integrity_alloc_bioset(struct bio *bio,
44 gfp_t gfp_mask, 82 gfp_t gfp_mask,
45 unsigned int nr_vecs) 83 unsigned int nr_vecs,
84 struct bio_set *bs)
46{ 85{
47 struct bio_integrity_payload *bip; 86 struct bio_integrity_payload *bip;
48 struct bio_vec *iv; 87 unsigned int idx = vecs_to_idx(nr_vecs);
49 unsigned long idx;
50 88
51 BUG_ON(bio == NULL); 89 BUG_ON(bio == NULL);
90 bip = NULL;
52 91
53 bip = mempool_alloc(bio_integrity_pool, gfp_mask); 92 /* Lower order allocations come straight from slab */
54 if (unlikely(bip == NULL)) { 93 if (!use_bip_pool(idx))
55 printk(KERN_ERR "%s: could not alloc bip\n", __func__); 94 bip = kmem_cache_alloc(bip_slab[idx].slab, gfp_mask);
56 return NULL;
57 }
58 95
59 memset(bip, 0, sizeof(*bip)); 96 /* Use mempool if lower order alloc failed or max vecs were requested */
97 if (bip == NULL) {
98 bip = mempool_alloc(bs->bio_integrity_pool, gfp_mask);
60 99
61 iv = bvec_alloc_bs(gfp_mask, nr_vecs, &idx, integrity_bio_set); 100 if (unlikely(bip == NULL)) {
62 if (unlikely(iv == NULL)) { 101 printk(KERN_ERR "%s: could not alloc bip\n", __func__);
63 printk(KERN_ERR "%s: could not alloc bip_vec\n", __func__); 102 return NULL;
64 mempool_free(bip, bio_integrity_pool); 103 }
65 return NULL;
66 } 104 }
67 105
68 bip->bip_pool = idx; 106 memset(bip, 0, sizeof(*bip));
69 bip->bip_vec = iv; 107
108 bip->bip_slab = idx;
70 bip->bip_bio = bio; 109 bip->bip_bio = bio;
71 bio->bi_integrity = bip; 110 bio->bi_integrity = bip;
72 111
73 return bip; 112 return bip;
74} 113}
114EXPORT_SYMBOL(bio_integrity_alloc_bioset);
115
116/**
117 * bio_integrity_alloc - Allocate integrity payload and attach it to bio
118 * @bio: bio to attach integrity metadata to
119 * @gfp_mask: Memory allocation mask
120 * @nr_vecs: Number of integrity metadata scatter-gather elements
121 *
122 * Description: This function prepares a bio for attaching integrity
123 * metadata. nr_vecs specifies the maximum number of pages containing
124 * integrity metadata that can be attached.
125 */
126struct bio_integrity_payload *bio_integrity_alloc(struct bio *bio,
127 gfp_t gfp_mask,
128 unsigned int nr_vecs)
129{
130 return bio_integrity_alloc_bioset(bio, gfp_mask, nr_vecs, fs_bio_set);
131}
75EXPORT_SYMBOL(bio_integrity_alloc); 132EXPORT_SYMBOL(bio_integrity_alloc);
76 133
77/** 134/**
78 * bio_integrity_free - Free bio integrity payload 135 * bio_integrity_free - Free bio integrity payload
79 * @bio: bio containing bip to be freed 136 * @bio: bio containing bip to be freed
137 * @bs: bio_set this bio was allocated from
80 * 138 *
81 * Description: Used to free the integrity portion of a bio. Usually 139 * Description: Used to free the integrity portion of a bio. Usually
82 * called from bio_free(). 140 * called from bio_free().
83 */ 141 */
84void bio_integrity_free(struct bio *bio) 142void bio_integrity_free(struct bio *bio, struct bio_set *bs)
85{ 143{
86 struct bio_integrity_payload *bip = bio->bi_integrity; 144 struct bio_integrity_payload *bip = bio->bi_integrity;
87 145
@@ -92,8 +150,10 @@ void bio_integrity_free(struct bio *bio)
92 && bip->bip_buf != NULL) 150 && bip->bip_buf != NULL)
93 kfree(bip->bip_buf); 151 kfree(bip->bip_buf);
94 152
95 bvec_free_bs(integrity_bio_set, bip->bip_vec, bip->bip_pool); 153 if (use_bip_pool(bip->bip_slab))
96 mempool_free(bip, bio_integrity_pool); 154 mempool_free(bip, bs->bio_integrity_pool);
155 else
156 kmem_cache_free(bip_slab[bip->bip_slab].slab, bip);
97 157
98 bio->bi_integrity = NULL; 158 bio->bi_integrity = NULL;
99} 159}
@@ -114,7 +174,7 @@ int bio_integrity_add_page(struct bio *bio, struct page *page,
114 struct bio_integrity_payload *bip = bio->bi_integrity; 174 struct bio_integrity_payload *bip = bio->bi_integrity;
115 struct bio_vec *iv; 175 struct bio_vec *iv;
116 176
117 if (bip->bip_vcnt >= bvec_nr_vecs(bip->bip_pool)) { 177 if (bip->bip_vcnt >= bvec_nr_vecs(bip->bip_slab)) {
118 printk(KERN_ERR "%s: bip_vec full\n", __func__); 178 printk(KERN_ERR "%s: bip_vec full\n", __func__);
119 return 0; 179 return 0;
120 } 180 }
@@ -647,8 +707,8 @@ void bio_integrity_split(struct bio *bio, struct bio_pair *bp, int sectors)
647 bp->iv1 = bip->bip_vec[0]; 707 bp->iv1 = bip->bip_vec[0];
648 bp->iv2 = bip->bip_vec[0]; 708 bp->iv2 = bip->bip_vec[0];
649 709
650 bp->bip1.bip_vec = &bp->iv1; 710 bp->bip1.bip_vec[0] = bp->iv1;
651 bp->bip2.bip_vec = &bp->iv2; 711 bp->bip2.bip_vec[0] = bp->iv2;
652 712
653 bp->iv1.bv_len = sectors * bi->tuple_size; 713 bp->iv1.bv_len = sectors * bi->tuple_size;
654 bp->iv2.bv_offset += sectors * bi->tuple_size; 714 bp->iv2.bv_offset += sectors * bi->tuple_size;
@@ -667,17 +727,19 @@ EXPORT_SYMBOL(bio_integrity_split);
667 * @bio: New bio 727 * @bio: New bio
668 * @bio_src: Original bio 728 * @bio_src: Original bio
669 * @gfp_mask: Memory allocation mask 729 * @gfp_mask: Memory allocation mask
730 * @bs: bio_set to allocate bip from
670 * 731 *
671 * Description: Called to allocate a bip when cloning a bio 732 * Description: Called to allocate a bip when cloning a bio
672 */ 733 */
673int bio_integrity_clone(struct bio *bio, struct bio *bio_src, gfp_t gfp_mask) 734int bio_integrity_clone(struct bio *bio, struct bio *bio_src,
735 gfp_t gfp_mask, struct bio_set *bs)
674{ 736{
675 struct bio_integrity_payload *bip_src = bio_src->bi_integrity; 737 struct bio_integrity_payload *bip_src = bio_src->bi_integrity;
676 struct bio_integrity_payload *bip; 738 struct bio_integrity_payload *bip;
677 739
678 BUG_ON(bip_src == NULL); 740 BUG_ON(bip_src == NULL);
679 741
680 bip = bio_integrity_alloc(bio, gfp_mask, bip_src->bip_vcnt); 742 bip = bio_integrity_alloc_bioset(bio, gfp_mask, bip_src->bip_vcnt, bs);
681 743
682 if (bip == NULL) 744 if (bip == NULL)
683 return -EIO; 745 return -EIO;
@@ -693,25 +755,43 @@ int bio_integrity_clone(struct bio *bio, struct bio *bio_src, gfp_t gfp_mask)
693} 755}
694EXPORT_SYMBOL(bio_integrity_clone); 756EXPORT_SYMBOL(bio_integrity_clone);
695 757
696static int __init bio_integrity_init(void) 758int bioset_integrity_create(struct bio_set *bs, int pool_size)
697{ 759{
698 kintegrityd_wq = create_workqueue("kintegrityd"); 760 unsigned int max_slab = vecs_to_idx(BIO_MAX_PAGES);
761
762 bs->bio_integrity_pool =
763 mempool_create_slab_pool(pool_size, bip_slab[max_slab].slab);
699 764
765 if (!bs->bio_integrity_pool)
766 return -1;
767
768 return 0;
769}
770EXPORT_SYMBOL(bioset_integrity_create);
771
772void bioset_integrity_free(struct bio_set *bs)
773{
774 if (bs->bio_integrity_pool)
775 mempool_destroy(bs->bio_integrity_pool);
776}
777EXPORT_SYMBOL(bioset_integrity_free);
778
779void __init bio_integrity_init(void)
780{
781 unsigned int i;
782
783 kintegrityd_wq = create_workqueue("kintegrityd");
700 if (!kintegrityd_wq) 784 if (!kintegrityd_wq)
701 panic("Failed to create kintegrityd\n"); 785 panic("Failed to create kintegrityd\n");
702 786
703 bio_integrity_slab = KMEM_CACHE(bio_integrity_payload, 787 for (i = 0 ; i < BIOVEC_NR_POOLS ; i++) {
704 SLAB_HWCACHE_ALIGN|SLAB_PANIC); 788 unsigned int size;
705 789
706 bio_integrity_pool = mempool_create_slab_pool(BIO_POOL_SIZE, 790 size = sizeof(struct bio_integrity_payload)
707 bio_integrity_slab); 791 + bip_slab[i].nr_vecs * sizeof(struct bio_vec);
708 if (!bio_integrity_pool)
709 panic("bio_integrity: can't allocate bip pool\n");
710 792
711 integrity_bio_set = bioset_create(BIO_POOL_SIZE, 0); 793 bip_slab[i].slab =
712 if (!integrity_bio_set) 794 kmem_cache_create(bip_slab[i].name, size, 0,
713 panic("bio_integrity: can't allocate bio_set\n"); 795 SLAB_HWCACHE_ALIGN|SLAB_PANIC, NULL);
714 796 }
715 return 0;
716} 797}
717subsys_initcall(bio_integrity_init);
diff --git a/fs/bio.c b/fs/bio.c
index 24c914043532..76738005c8e8 100644
--- a/fs/bio.c
+++ b/fs/bio.c
@@ -238,7 +238,7 @@ void bio_free(struct bio *bio, struct bio_set *bs)
238 bvec_free_bs(bs, bio->bi_io_vec, BIO_POOL_IDX(bio)); 238 bvec_free_bs(bs, bio->bi_io_vec, BIO_POOL_IDX(bio));
239 239
240 if (bio_integrity(bio)) 240 if (bio_integrity(bio))
241 bio_integrity_free(bio); 241 bio_integrity_free(bio, bs);
242 242
243 /* 243 /*
244 * If we have front padding, adjust the bio pointer before freeing 244 * If we have front padding, adjust the bio pointer before freeing
@@ -341,7 +341,7 @@ struct bio *bio_alloc(gfp_t gfp_mask, int nr_iovecs)
341static void bio_kmalloc_destructor(struct bio *bio) 341static void bio_kmalloc_destructor(struct bio *bio)
342{ 342{
343 if (bio_integrity(bio)) 343 if (bio_integrity(bio))
344 bio_integrity_free(bio); 344 bio_integrity_free(bio, fs_bio_set);
345 kfree(bio); 345 kfree(bio);
346} 346}
347 347
@@ -472,7 +472,7 @@ struct bio *bio_clone(struct bio *bio, gfp_t gfp_mask)
472 if (bio_integrity(bio)) { 472 if (bio_integrity(bio)) {
473 int ret; 473 int ret;
474 474
475 ret = bio_integrity_clone(b, bio, gfp_mask); 475 ret = bio_integrity_clone(b, bio, gfp_mask, fs_bio_set);
476 476
477 if (ret < 0) { 477 if (ret < 0) {
478 bio_put(b); 478 bio_put(b);
@@ -705,14 +705,13 @@ static struct bio_map_data *bio_alloc_map_data(int nr_segs, int iov_count,
705} 705}
706 706
707static int __bio_copy_iov(struct bio *bio, struct bio_vec *iovecs, 707static int __bio_copy_iov(struct bio *bio, struct bio_vec *iovecs,
708 struct sg_iovec *iov, int iov_count, int uncopy, 708 struct sg_iovec *iov, int iov_count,
709 int do_free_page) 709 int to_user, int from_user, int do_free_page)
710{ 710{
711 int ret = 0, i; 711 int ret = 0, i;
712 struct bio_vec *bvec; 712 struct bio_vec *bvec;
713 int iov_idx = 0; 713 int iov_idx = 0;
714 unsigned int iov_off = 0; 714 unsigned int iov_off = 0;
715 int read = bio_data_dir(bio) == READ;
716 715
717 __bio_for_each_segment(bvec, bio, i, 0) { 716 __bio_for_each_segment(bvec, bio, i, 0) {
718 char *bv_addr = page_address(bvec->bv_page); 717 char *bv_addr = page_address(bvec->bv_page);
@@ -727,13 +726,14 @@ static int __bio_copy_iov(struct bio *bio, struct bio_vec *iovecs,
727 iov_addr = iov[iov_idx].iov_base + iov_off; 726 iov_addr = iov[iov_idx].iov_base + iov_off;
728 727
729 if (!ret) { 728 if (!ret) {
730 if (!read && !uncopy) 729 if (to_user)
731 ret = copy_from_user(bv_addr, iov_addr,
732 bytes);
733 if (read && uncopy)
734 ret = copy_to_user(iov_addr, bv_addr, 730 ret = copy_to_user(iov_addr, bv_addr,
735 bytes); 731 bytes);
736 732
733 if (from_user)
734 ret = copy_from_user(bv_addr, iov_addr,
735 bytes);
736
737 if (ret) 737 if (ret)
738 ret = -EFAULT; 738 ret = -EFAULT;
739 } 739 }
@@ -770,7 +770,8 @@ int bio_uncopy_user(struct bio *bio)
770 770
771 if (!bio_flagged(bio, BIO_NULL_MAPPED)) 771 if (!bio_flagged(bio, BIO_NULL_MAPPED))
772 ret = __bio_copy_iov(bio, bmd->iovecs, bmd->sgvecs, 772 ret = __bio_copy_iov(bio, bmd->iovecs, bmd->sgvecs,
773 bmd->nr_sgvecs, 1, bmd->is_our_pages); 773 bmd->nr_sgvecs, bio_data_dir(bio) == READ,
774 0, bmd->is_our_pages);
774 bio_free_map_data(bmd); 775 bio_free_map_data(bmd);
775 bio_put(bio); 776 bio_put(bio);
776 return ret; 777 return ret;
@@ -875,8 +876,9 @@ struct bio *bio_copy_user_iov(struct request_queue *q,
875 /* 876 /*
876 * success 877 * success
877 */ 878 */
878 if (!write_to_vm && (!map_data || !map_data->null_mapped)) { 879 if ((!write_to_vm && (!map_data || !map_data->null_mapped)) ||
879 ret = __bio_copy_iov(bio, bio->bi_io_vec, iov, iov_count, 0, 0); 880 (map_data && map_data->from_user)) {
881 ret = __bio_copy_iov(bio, bio->bi_io_vec, iov, iov_count, 0, 1, 0);
880 if (ret) 882 if (ret)
881 goto cleanup; 883 goto cleanup;
882 } 884 }
@@ -1539,6 +1541,7 @@ void bioset_free(struct bio_set *bs)
1539 if (bs->bio_pool) 1541 if (bs->bio_pool)
1540 mempool_destroy(bs->bio_pool); 1542 mempool_destroy(bs->bio_pool);
1541 1543
1544 bioset_integrity_free(bs);
1542 biovec_free_pools(bs); 1545 biovec_free_pools(bs);
1543 bio_put_slab(bs); 1546 bio_put_slab(bs);
1544 1547
@@ -1579,6 +1582,9 @@ struct bio_set *bioset_create(unsigned int pool_size, unsigned int front_pad)
1579 if (!bs->bio_pool) 1582 if (!bs->bio_pool)
1580 goto bad; 1583 goto bad;
1581 1584
1585 if (bioset_integrity_create(bs, pool_size))
1586 goto bad;
1587
1582 if (!biovec_create_pools(bs, pool_size)) 1588 if (!biovec_create_pools(bs, pool_size))
1583 return bs; 1589 return bs;
1584 1590
@@ -1616,6 +1622,7 @@ static int __init init_bio(void)
1616 if (!bio_slabs) 1622 if (!bio_slabs)
1617 panic("bio: can't allocate bios\n"); 1623 panic("bio: can't allocate bios\n");
1618 1624
1625 bio_integrity_init();
1619 biovec_init_slabs(); 1626 biovec_init_slabs();
1620 1627
1621 fs_bio_set = bioset_create(BIO_POOL_SIZE, 0); 1628 fs_bio_set = bioset_create(BIO_POOL_SIZE, 0);
diff --git a/fs/block_dev.c b/fs/block_dev.c
index 3a6d4fb2a329..94dfda24c06e 100644
--- a/fs/block_dev.c
+++ b/fs/block_dev.c
@@ -564,6 +564,16 @@ struct block_device *bdget(dev_t dev)
564 564
565EXPORT_SYMBOL(bdget); 565EXPORT_SYMBOL(bdget);
566 566
567/**
568 * bdgrab -- Grab a reference to an already referenced block device
569 * @bdev: Block device to grab a reference to.
570 */
571struct block_device *bdgrab(struct block_device *bdev)
572{
573 atomic_inc(&bdev->bd_inode->i_count);
574 return bdev;
575}
576
567long nr_blockdev_pages(void) 577long nr_blockdev_pages(void)
568{ 578{
569 struct block_device *bdev; 579 struct block_device *bdev;
diff --git a/fs/btrfs/async-thread.c b/fs/btrfs/async-thread.c
index 7f88628a1a72..019e8af449ab 100644
--- a/fs/btrfs/async-thread.c
+++ b/fs/btrfs/async-thread.c
@@ -299,8 +299,8 @@ int btrfs_start_workers(struct btrfs_workers *workers, int num_workers)
299 "btrfs-%s-%d", workers->name, 299 "btrfs-%s-%d", workers->name,
300 workers->num_workers + i); 300 workers->num_workers + i);
301 if (IS_ERR(worker->task)) { 301 if (IS_ERR(worker->task)) {
302 kfree(worker);
303 ret = PTR_ERR(worker->task); 302 ret = PTR_ERR(worker->task);
303 kfree(worker);
304 goto fail; 304 goto fail;
305 } 305 }
306 306
@@ -424,11 +424,11 @@ int btrfs_requeue_work(struct btrfs_work *work)
424 * list 424 * list
425 */ 425 */
426 if (worker->idle) { 426 if (worker->idle) {
427 spin_lock_irqsave(&worker->workers->lock, flags); 427 spin_lock(&worker->workers->lock);
428 worker->idle = 0; 428 worker->idle = 0;
429 list_move_tail(&worker->worker_list, 429 list_move_tail(&worker->worker_list,
430 &worker->workers->worker_list); 430 &worker->workers->worker_list);
431 spin_unlock_irqrestore(&worker->workers->lock, flags); 431 spin_unlock(&worker->workers->lock);
432 } 432 }
433 if (!worker->working) { 433 if (!worker->working) {
434 wake = 1; 434 wake = 1;
diff --git a/fs/btrfs/compression.c b/fs/btrfs/compression.c
index de1e2fd32080..9d8ba4d54a37 100644
--- a/fs/btrfs/compression.c
+++ b/fs/btrfs/compression.c
@@ -26,7 +26,6 @@
26#include <linux/time.h> 26#include <linux/time.h>
27#include <linux/init.h> 27#include <linux/init.h>
28#include <linux/string.h> 28#include <linux/string.h>
29#include <linux/smp_lock.h>
30#include <linux/backing-dev.h> 29#include <linux/backing-dev.h>
31#include <linux/mpage.h> 30#include <linux/mpage.h>
32#include <linux/swap.h> 31#include <linux/swap.h>
diff --git a/fs/btrfs/ctree.c b/fs/btrfs/ctree.c
index 60a45f3a4e91..3fdcc0512d3a 100644
--- a/fs/btrfs/ctree.c
+++ b/fs/btrfs/ctree.c
@@ -557,19 +557,7 @@ static int comp_keys(struct btrfs_disk_key *disk, struct btrfs_key *k2)
557 557
558 btrfs_disk_key_to_cpu(&k1, disk); 558 btrfs_disk_key_to_cpu(&k1, disk);
559 559
560 if (k1.objectid > k2->objectid) 560 return btrfs_comp_cpu_keys(&k1, k2);
561 return 1;
562 if (k1.objectid < k2->objectid)
563 return -1;
564 if (k1.type > k2->type)
565 return 1;
566 if (k1.type < k2->type)
567 return -1;
568 if (k1.offset > k2->offset)
569 return 1;
570 if (k1.offset < k2->offset)
571 return -1;
572 return 0;
573} 561}
574 562
575/* 563/*
@@ -1052,9 +1040,6 @@ static noinline int balance_level(struct btrfs_trans_handle *trans,
1052 BTRFS_NODEPTRS_PER_BLOCK(root) / 4) 1040 BTRFS_NODEPTRS_PER_BLOCK(root) / 4)
1053 return 0; 1041 return 0;
1054 1042
1055 if (btrfs_header_nritems(mid) > 2)
1056 return 0;
1057
1058 if (btrfs_header_nritems(mid) < 2) 1043 if (btrfs_header_nritems(mid) < 2)
1059 err_on_enospc = 1; 1044 err_on_enospc = 1;
1060 1045
@@ -1701,6 +1686,7 @@ int btrfs_search_slot(struct btrfs_trans_handle *trans, struct btrfs_root
1701 struct extent_buffer *b; 1686 struct extent_buffer *b;
1702 int slot; 1687 int slot;
1703 int ret; 1688 int ret;
1689 int err;
1704 int level; 1690 int level;
1705 int lowest_unlock = 1; 1691 int lowest_unlock = 1;
1706 u8 lowest_level = 0; 1692 u8 lowest_level = 0;
@@ -1737,8 +1723,6 @@ again:
1737 p->locks[level] = 1; 1723 p->locks[level] = 1;
1738 1724
1739 if (cow) { 1725 if (cow) {
1740 int wret;
1741
1742 /* 1726 /*
1743 * if we don't really need to cow this block 1727 * if we don't really need to cow this block
1744 * then we don't want to set the path blocking, 1728 * then we don't want to set the path blocking,
@@ -1749,12 +1733,12 @@ again:
1749 1733
1750 btrfs_set_path_blocking(p); 1734 btrfs_set_path_blocking(p);
1751 1735
1752 wret = btrfs_cow_block(trans, root, b, 1736 err = btrfs_cow_block(trans, root, b,
1753 p->nodes[level + 1], 1737 p->nodes[level + 1],
1754 p->slots[level + 1], &b); 1738 p->slots[level + 1], &b);
1755 if (wret) { 1739 if (err) {
1756 free_extent_buffer(b); 1740 free_extent_buffer(b);
1757 ret = wret; 1741 ret = err;
1758 goto done; 1742 goto done;
1759 } 1743 }
1760 } 1744 }
@@ -1793,41 +1777,45 @@ cow_done:
1793 ret = bin_search(b, key, level, &slot); 1777 ret = bin_search(b, key, level, &slot);
1794 1778
1795 if (level != 0) { 1779 if (level != 0) {
1796 if (ret && slot > 0) 1780 int dec = 0;
1781 if (ret && slot > 0) {
1782 dec = 1;
1797 slot -= 1; 1783 slot -= 1;
1784 }
1798 p->slots[level] = slot; 1785 p->slots[level] = slot;
1799 ret = setup_nodes_for_search(trans, root, p, b, level, 1786 err = setup_nodes_for_search(trans, root, p, b, level,
1800 ins_len); 1787 ins_len);
1801 if (ret == -EAGAIN) 1788 if (err == -EAGAIN)
1802 goto again; 1789 goto again;
1803 else if (ret) 1790 if (err) {
1791 ret = err;
1804 goto done; 1792 goto done;
1793 }
1805 b = p->nodes[level]; 1794 b = p->nodes[level];
1806 slot = p->slots[level]; 1795 slot = p->slots[level];
1807 1796
1808 unlock_up(p, level, lowest_unlock); 1797 unlock_up(p, level, lowest_unlock);
1809 1798
1810 /* this is only true while dropping a snapshot */
1811 if (level == lowest_level) { 1799 if (level == lowest_level) {
1812 ret = 0; 1800 if (dec)
1801 p->slots[level]++;
1813 goto done; 1802 goto done;
1814 } 1803 }
1815 1804
1816 ret = read_block_for_search(trans, root, p, 1805 err = read_block_for_search(trans, root, p,
1817 &b, level, slot, key); 1806 &b, level, slot, key);
1818 if (ret == -EAGAIN) 1807 if (err == -EAGAIN)
1819 goto again; 1808 goto again;
1820 1809 if (err) {
1821 if (ret == -EIO) 1810 ret = err;
1822 goto done; 1811 goto done;
1812 }
1823 1813
1824 if (!p->skip_locking) { 1814 if (!p->skip_locking) {
1825 int lret;
1826
1827 btrfs_clear_path_blocking(p, NULL); 1815 btrfs_clear_path_blocking(p, NULL);
1828 lret = btrfs_try_spin_lock(b); 1816 err = btrfs_try_spin_lock(b);
1829 1817
1830 if (!lret) { 1818 if (!err) {
1831 btrfs_set_path_blocking(p); 1819 btrfs_set_path_blocking(p);
1832 btrfs_tree_lock(b); 1820 btrfs_tree_lock(b);
1833 btrfs_clear_path_blocking(p, b); 1821 btrfs_clear_path_blocking(p, b);
@@ -1837,16 +1825,14 @@ cow_done:
1837 p->slots[level] = slot; 1825 p->slots[level] = slot;
1838 if (ins_len > 0 && 1826 if (ins_len > 0 &&
1839 btrfs_leaf_free_space(root, b) < ins_len) { 1827 btrfs_leaf_free_space(root, b) < ins_len) {
1840 int sret;
1841
1842 btrfs_set_path_blocking(p); 1828 btrfs_set_path_blocking(p);
1843 sret = split_leaf(trans, root, key, 1829 err = split_leaf(trans, root, key,
1844 p, ins_len, ret == 0); 1830 p, ins_len, ret == 0);
1845 btrfs_clear_path_blocking(p, NULL); 1831 btrfs_clear_path_blocking(p, NULL);
1846 1832
1847 BUG_ON(sret > 0); 1833 BUG_ON(err > 0);
1848 if (sret) { 1834 if (err) {
1849 ret = sret; 1835 ret = err;
1850 goto done; 1836 goto done;
1851 } 1837 }
1852 } 1838 }
@@ -3807,7 +3793,7 @@ int btrfs_del_items(struct btrfs_trans_handle *trans, struct btrfs_root *root,
3807 } 3793 }
3808 3794
3809 /* delete the leaf if it is mostly empty */ 3795 /* delete the leaf if it is mostly empty */
3810 if (used < BTRFS_LEAF_DATA_SIZE(root) / 2) { 3796 if (used < BTRFS_LEAF_DATA_SIZE(root) / 3) {
3811 /* push_leaf_left fixes the path. 3797 /* push_leaf_left fixes the path.
3812 * make sure the path still points to our leaf 3798 * make sure the path still points to our leaf
3813 * for possible call to del_ptr below 3799 * for possible call to del_ptr below
@@ -4042,10 +4028,9 @@ out:
4042 * calling this function. 4028 * calling this function.
4043 */ 4029 */
4044int btrfs_find_next_key(struct btrfs_root *root, struct btrfs_path *path, 4030int btrfs_find_next_key(struct btrfs_root *root, struct btrfs_path *path,
4045 struct btrfs_key *key, int lowest_level, 4031 struct btrfs_key *key, int level,
4046 int cache_only, u64 min_trans) 4032 int cache_only, u64 min_trans)
4047{ 4033{
4048 int level = lowest_level;
4049 int slot; 4034 int slot;
4050 struct extent_buffer *c; 4035 struct extent_buffer *c;
4051 4036
@@ -4058,11 +4043,40 @@ int btrfs_find_next_key(struct btrfs_root *root, struct btrfs_path *path,
4058 c = path->nodes[level]; 4043 c = path->nodes[level];
4059next: 4044next:
4060 if (slot >= btrfs_header_nritems(c)) { 4045 if (slot >= btrfs_header_nritems(c)) {
4061 level++; 4046 int ret;
4062 if (level == BTRFS_MAX_LEVEL) 4047 int orig_lowest;
4048 struct btrfs_key cur_key;
4049 if (level + 1 >= BTRFS_MAX_LEVEL ||
4050 !path->nodes[level + 1])
4063 return 1; 4051 return 1;
4064 continue; 4052
4053 if (path->locks[level + 1]) {
4054 level++;
4055 continue;
4056 }
4057
4058 slot = btrfs_header_nritems(c) - 1;
4059 if (level == 0)
4060 btrfs_item_key_to_cpu(c, &cur_key, slot);
4061 else
4062 btrfs_node_key_to_cpu(c, &cur_key, slot);
4063
4064 orig_lowest = path->lowest_level;
4065 btrfs_release_path(root, path);
4066 path->lowest_level = level;
4067 ret = btrfs_search_slot(NULL, root, &cur_key, path,
4068 0, 0);
4069 path->lowest_level = orig_lowest;
4070 if (ret < 0)
4071 return ret;
4072
4073 c = path->nodes[level];
4074 slot = path->slots[level];
4075 if (ret == 0)
4076 slot++;
4077 goto next;
4065 } 4078 }
4079
4066 if (level == 0) 4080 if (level == 0)
4067 btrfs_item_key_to_cpu(c, key, slot); 4081 btrfs_item_key_to_cpu(c, key, slot);
4068 else { 4082 else {
@@ -4146,7 +4160,8 @@ again:
4146 * advance the path if there are now more items available. 4160 * advance the path if there are now more items available.
4147 */ 4161 */
4148 if (nritems > 0 && path->slots[0] < nritems - 1) { 4162 if (nritems > 0 && path->slots[0] < nritems - 1) {
4149 path->slots[0]++; 4163 if (ret == 0)
4164 path->slots[0]++;
4150 ret = 0; 4165 ret = 0;
4151 goto done; 4166 goto done;
4152 } 4167 }
@@ -4278,10 +4293,10 @@ int btrfs_previous_item(struct btrfs_root *root,
4278 path->slots[0]--; 4293 path->slots[0]--;
4279 4294
4280 btrfs_item_key_to_cpu(leaf, &found_key, path->slots[0]); 4295 btrfs_item_key_to_cpu(leaf, &found_key, path->slots[0]);
4281 if (found_key.type == type)
4282 return 0;
4283 if (found_key.objectid < min_objectid) 4296 if (found_key.objectid < min_objectid)
4284 break; 4297 break;
4298 if (found_key.type == type)
4299 return 0;
4285 if (found_key.objectid == min_objectid && 4300 if (found_key.objectid == min_objectid &&
4286 found_key.type < type) 4301 found_key.type < type)
4287 break; 4302 break;
diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h
index 2779c2f5360a..837435ce84ca 100644
--- a/fs/btrfs/ctree.h
+++ b/fs/btrfs/ctree.h
@@ -481,7 +481,7 @@ struct btrfs_shared_data_ref {
481 481
482struct btrfs_extent_inline_ref { 482struct btrfs_extent_inline_ref {
483 u8 type; 483 u8 type;
484 u64 offset; 484 __le64 offset;
485} __attribute__ ((__packed__)); 485} __attribute__ ((__packed__));
486 486
487/* old style backrefs item */ 487/* old style backrefs item */
@@ -689,6 +689,7 @@ struct btrfs_space_info {
689 struct list_head block_groups; 689 struct list_head block_groups;
690 spinlock_t lock; 690 spinlock_t lock;
691 struct rw_semaphore groups_sem; 691 struct rw_semaphore groups_sem;
692 atomic_t caching_threads;
692}; 693};
693 694
694/* 695/*
@@ -707,6 +708,9 @@ struct btrfs_free_cluster {
707 /* first extent starting offset */ 708 /* first extent starting offset */
708 u64 window_start; 709 u64 window_start;
709 710
711 /* if this cluster simply points at a bitmap in the block group */
712 bool points_to_bitmap;
713
710 struct btrfs_block_group_cache *block_group; 714 struct btrfs_block_group_cache *block_group;
711 /* 715 /*
712 * when a cluster is allocated from a block group, we put the 716 * when a cluster is allocated from a block group, we put the
@@ -716,24 +720,37 @@ struct btrfs_free_cluster {
716 struct list_head block_group_list; 720 struct list_head block_group_list;
717}; 721};
718 722
723enum btrfs_caching_type {
724 BTRFS_CACHE_NO = 0,
725 BTRFS_CACHE_STARTED = 1,
726 BTRFS_CACHE_FINISHED = 2,
727};
728
719struct btrfs_block_group_cache { 729struct btrfs_block_group_cache {
720 struct btrfs_key key; 730 struct btrfs_key key;
721 struct btrfs_block_group_item item; 731 struct btrfs_block_group_item item;
732 struct btrfs_fs_info *fs_info;
722 spinlock_t lock; 733 spinlock_t lock;
723 struct mutex cache_mutex;
724 u64 pinned; 734 u64 pinned;
725 u64 reserved; 735 u64 reserved;
726 u64 flags; 736 u64 flags;
727 int cached; 737 u64 sectorsize;
738 int extents_thresh;
739 int free_extents;
740 int total_bitmaps;
728 int ro; 741 int ro;
729 int dirty; 742 int dirty;
730 743
744 /* cache tracking stuff */
745 wait_queue_head_t caching_q;
746 int cached;
747
731 struct btrfs_space_info *space_info; 748 struct btrfs_space_info *space_info;
732 749
733 /* free space cache stuff */ 750 /* free space cache stuff */
734 spinlock_t tree_lock; 751 spinlock_t tree_lock;
735 struct rb_root free_space_bytes;
736 struct rb_root free_space_offset; 752 struct rb_root free_space_offset;
753 u64 free_space;
737 754
738 /* block group cache stuff */ 755 /* block group cache stuff */
739 struct rb_node cache_node; 756 struct rb_node cache_node;
@@ -808,6 +825,7 @@ struct btrfs_fs_info {
808 struct mutex drop_mutex; 825 struct mutex drop_mutex;
809 struct mutex volume_mutex; 826 struct mutex volume_mutex;
810 struct mutex tree_reloc_mutex; 827 struct mutex tree_reloc_mutex;
828 struct rw_semaphore extent_commit_sem;
811 829
812 /* 830 /*
813 * this protects the ordered operations list only while we are 831 * this protects the ordered operations list only while we are
@@ -1988,6 +2006,7 @@ void btrfs_delalloc_reserve_space(struct btrfs_root *root, struct inode *inode,
1988 u64 bytes); 2006 u64 bytes);
1989void btrfs_delalloc_free_space(struct btrfs_root *root, struct inode *inode, 2007void btrfs_delalloc_free_space(struct btrfs_root *root, struct inode *inode,
1990 u64 bytes); 2008 u64 bytes);
2009void btrfs_free_pinned_extents(struct btrfs_fs_info *info);
1991/* ctree.c */ 2010/* ctree.c */
1992int btrfs_bin_search(struct extent_buffer *eb, struct btrfs_key *key, 2011int btrfs_bin_search(struct extent_buffer *eb, struct btrfs_key *key,
1993 int level, int *slot); 2012 int level, int *slot);
@@ -2074,8 +2093,7 @@ static inline int btrfs_insert_empty_item(struct btrfs_trans_handle *trans,
2074int btrfs_next_leaf(struct btrfs_root *root, struct btrfs_path *path); 2093int btrfs_next_leaf(struct btrfs_root *root, struct btrfs_path *path);
2075int btrfs_prev_leaf(struct btrfs_root *root, struct btrfs_path *path); 2094int btrfs_prev_leaf(struct btrfs_root *root, struct btrfs_path *path);
2076int btrfs_leaf_free_space(struct btrfs_root *root, struct extent_buffer *leaf); 2095int btrfs_leaf_free_space(struct btrfs_root *root, struct extent_buffer *leaf);
2077int btrfs_drop_snapshot(struct btrfs_trans_handle *trans, struct btrfs_root 2096int btrfs_drop_snapshot(struct btrfs_root *root, int update_ref);
2078 *root);
2079int btrfs_drop_subtree(struct btrfs_trans_handle *trans, 2097int btrfs_drop_subtree(struct btrfs_trans_handle *trans,
2080 struct btrfs_root *root, 2098 struct btrfs_root *root,
2081 struct extent_buffer *node, 2099 struct extent_buffer *node,
diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
index d28d29c95f7c..e83be2e4602c 100644
--- a/fs/btrfs/disk-io.c
+++ b/fs/btrfs/disk-io.c
@@ -1639,6 +1639,7 @@ struct btrfs_root *open_ctree(struct super_block *sb,
1639 mutex_init(&fs_info->cleaner_mutex); 1639 mutex_init(&fs_info->cleaner_mutex);
1640 mutex_init(&fs_info->volume_mutex); 1640 mutex_init(&fs_info->volume_mutex);
1641 mutex_init(&fs_info->tree_reloc_mutex); 1641 mutex_init(&fs_info->tree_reloc_mutex);
1642 init_rwsem(&fs_info->extent_commit_sem);
1642 1643
1643 btrfs_init_free_cluster(&fs_info->meta_alloc_cluster); 1644 btrfs_init_free_cluster(&fs_info->meta_alloc_cluster);
1644 btrfs_init_free_cluster(&fs_info->data_alloc_cluster); 1645 btrfs_init_free_cluster(&fs_info->data_alloc_cluster);
@@ -1799,6 +1800,11 @@ struct btrfs_root *open_ctree(struct super_block *sb,
1799 btrfs_super_chunk_root(disk_super), 1800 btrfs_super_chunk_root(disk_super),
1800 blocksize, generation); 1801 blocksize, generation);
1801 BUG_ON(!chunk_root->node); 1802 BUG_ON(!chunk_root->node);
1803 if (!test_bit(EXTENT_BUFFER_UPTODATE, &chunk_root->node->bflags)) {
1804 printk(KERN_WARNING "btrfs: failed to read chunk root on %s\n",
1805 sb->s_id);
1806 goto fail_chunk_root;
1807 }
1802 btrfs_set_root_node(&chunk_root->root_item, chunk_root->node); 1808 btrfs_set_root_node(&chunk_root->root_item, chunk_root->node);
1803 chunk_root->commit_root = btrfs_root_node(chunk_root); 1809 chunk_root->commit_root = btrfs_root_node(chunk_root);
1804 1810
@@ -1826,6 +1832,11 @@ struct btrfs_root *open_ctree(struct super_block *sb,
1826 blocksize, generation); 1832 blocksize, generation);
1827 if (!tree_root->node) 1833 if (!tree_root->node)
1828 goto fail_chunk_root; 1834 goto fail_chunk_root;
1835 if (!test_bit(EXTENT_BUFFER_UPTODATE, &tree_root->node->bflags)) {
1836 printk(KERN_WARNING "btrfs: failed to read tree root on %s\n",
1837 sb->s_id);
1838 goto fail_tree_root;
1839 }
1829 btrfs_set_root_node(&tree_root->root_item, tree_root->node); 1840 btrfs_set_root_node(&tree_root->root_item, tree_root->node);
1830 tree_root->commit_root = btrfs_root_node(tree_root); 1841 tree_root->commit_root = btrfs_root_node(tree_root);
1831 1842
@@ -2322,6 +2333,9 @@ int close_ctree(struct btrfs_root *root)
2322 printk(KERN_ERR "btrfs: commit super ret %d\n", ret); 2333 printk(KERN_ERR "btrfs: commit super ret %d\n", ret);
2323 } 2334 }
2324 2335
2336 fs_info->closing = 2;
2337 smp_mb();
2338
2325 if (fs_info->delalloc_bytes) { 2339 if (fs_info->delalloc_bytes) {
2326 printk(KERN_INFO "btrfs: at unmount delalloc count %llu\n", 2340 printk(KERN_INFO "btrfs: at unmount delalloc count %llu\n",
2327 (unsigned long long)fs_info->delalloc_bytes); 2341 (unsigned long long)fs_info->delalloc_bytes);
@@ -2343,6 +2357,7 @@ int close_ctree(struct btrfs_root *root)
2343 free_extent_buffer(root->fs_info->csum_root->commit_root); 2357 free_extent_buffer(root->fs_info->csum_root->commit_root);
2344 2358
2345 btrfs_free_block_groups(root->fs_info); 2359 btrfs_free_block_groups(root->fs_info);
2360 btrfs_free_pinned_extents(root->fs_info);
2346 2361
2347 del_fs_roots(fs_info); 2362 del_fs_roots(fs_info);
2348 2363
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c
index edc7d208c5ce..72a2b9c28e9f 100644
--- a/fs/btrfs/extent-tree.c
+++ b/fs/btrfs/extent-tree.c
@@ -21,6 +21,7 @@
21#include <linux/blkdev.h> 21#include <linux/blkdev.h>
22#include <linux/sort.h> 22#include <linux/sort.h>
23#include <linux/rcupdate.h> 23#include <linux/rcupdate.h>
24#include <linux/kthread.h>
24#include "compat.h" 25#include "compat.h"
25#include "hash.h" 26#include "hash.h"
26#include "ctree.h" 27#include "ctree.h"
@@ -61,6 +62,13 @@ static int do_chunk_alloc(struct btrfs_trans_handle *trans,
61 struct btrfs_root *extent_root, u64 alloc_bytes, 62 struct btrfs_root *extent_root, u64 alloc_bytes,
62 u64 flags, int force); 63 u64 flags, int force);
63 64
65static noinline int
66block_group_cache_done(struct btrfs_block_group_cache *cache)
67{
68 smp_mb();
69 return cache->cached == BTRFS_CACHE_FINISHED;
70}
71
64static int block_group_bits(struct btrfs_block_group_cache *cache, u64 bits) 72static int block_group_bits(struct btrfs_block_group_cache *cache, u64 bits)
65{ 73{
66 return (cache->flags & bits) == bits; 74 return (cache->flags & bits) == bits;
@@ -146,20 +154,70 @@ block_group_cache_tree_search(struct btrfs_fs_info *info, u64 bytenr,
146} 154}
147 155
148/* 156/*
157 * We always set EXTENT_LOCKED for the super mirror extents so we don't
158 * overwrite them, so those bits need to be unset. Also, if we are unmounting
159 * with pinned extents still sitting there because we had a block group caching,
160 * we need to clear those now, since we are done.
161 */
162void btrfs_free_pinned_extents(struct btrfs_fs_info *info)
163{
164 u64 start, end, last = 0;
165 int ret;
166
167 while (1) {
168 ret = find_first_extent_bit(&info->pinned_extents, last,
169 &start, &end,
170 EXTENT_LOCKED|EXTENT_DIRTY);
171 if (ret)
172 break;
173
174 clear_extent_bits(&info->pinned_extents, start, end,
175 EXTENT_LOCKED|EXTENT_DIRTY, GFP_NOFS);
176 last = end+1;
177 }
178}
179
180static int remove_sb_from_cache(struct btrfs_root *root,
181 struct btrfs_block_group_cache *cache)
182{
183 struct btrfs_fs_info *fs_info = root->fs_info;
184 u64 bytenr;
185 u64 *logical;
186 int stripe_len;
187 int i, nr, ret;
188
189 for (i = 0; i < BTRFS_SUPER_MIRROR_MAX; i++) {
190 bytenr = btrfs_sb_offset(i);
191 ret = btrfs_rmap_block(&root->fs_info->mapping_tree,
192 cache->key.objectid, bytenr,
193 0, &logical, &nr, &stripe_len);
194 BUG_ON(ret);
195 while (nr--) {
196 try_lock_extent(&fs_info->pinned_extents,
197 logical[nr],
198 logical[nr] + stripe_len - 1, GFP_NOFS);
199 }
200 kfree(logical);
201 }
202
203 return 0;
204}
205
206/*
149 * this is only called by cache_block_group, since we could have freed extents 207 * this is only called by cache_block_group, since we could have freed extents
150 * we need to check the pinned_extents for any extents that can't be used yet 208 * we need to check the pinned_extents for any extents that can't be used yet
151 * since their free space will be released as soon as the transaction commits. 209 * since their free space will be released as soon as the transaction commits.
152 */ 210 */
153static int add_new_free_space(struct btrfs_block_group_cache *block_group, 211static u64 add_new_free_space(struct btrfs_block_group_cache *block_group,
154 struct btrfs_fs_info *info, u64 start, u64 end) 212 struct btrfs_fs_info *info, u64 start, u64 end)
155{ 213{
156 u64 extent_start, extent_end, size; 214 u64 extent_start, extent_end, size, total_added = 0;
157 int ret; 215 int ret;
158 216
159 while (start < end) { 217 while (start < end) {
160 ret = find_first_extent_bit(&info->pinned_extents, start, 218 ret = find_first_extent_bit(&info->pinned_extents, start,
161 &extent_start, &extent_end, 219 &extent_start, &extent_end,
162 EXTENT_DIRTY); 220 EXTENT_DIRTY|EXTENT_LOCKED);
163 if (ret) 221 if (ret)
164 break; 222 break;
165 223
@@ -167,6 +225,7 @@ static int add_new_free_space(struct btrfs_block_group_cache *block_group,
167 start = extent_end + 1; 225 start = extent_end + 1;
168 } else if (extent_start > start && extent_start < end) { 226 } else if (extent_start > start && extent_start < end) {
169 size = extent_start - start; 227 size = extent_start - start;
228 total_added += size;
170 ret = btrfs_add_free_space(block_group, start, 229 ret = btrfs_add_free_space(block_group, start,
171 size); 230 size);
172 BUG_ON(ret); 231 BUG_ON(ret);
@@ -178,84 +237,93 @@ static int add_new_free_space(struct btrfs_block_group_cache *block_group,
178 237
179 if (start < end) { 238 if (start < end) {
180 size = end - start; 239 size = end - start;
240 total_added += size;
181 ret = btrfs_add_free_space(block_group, start, size); 241 ret = btrfs_add_free_space(block_group, start, size);
182 BUG_ON(ret); 242 BUG_ON(ret);
183 } 243 }
184 244
185 return 0; 245 return total_added;
186} 246}
187 247
188static int remove_sb_from_cache(struct btrfs_root *root, 248static int caching_kthread(void *data)
189 struct btrfs_block_group_cache *cache)
190{
191 u64 bytenr;
192 u64 *logical;
193 int stripe_len;
194 int i, nr, ret;
195
196 for (i = 0; i < BTRFS_SUPER_MIRROR_MAX; i++) {
197 bytenr = btrfs_sb_offset(i);
198 ret = btrfs_rmap_block(&root->fs_info->mapping_tree,
199 cache->key.objectid, bytenr, 0,
200 &logical, &nr, &stripe_len);
201 BUG_ON(ret);
202 while (nr--) {
203 btrfs_remove_free_space(cache, logical[nr],
204 stripe_len);
205 }
206 kfree(logical);
207 }
208 return 0;
209}
210
211static int cache_block_group(struct btrfs_root *root,
212 struct btrfs_block_group_cache *block_group)
213{ 249{
250 struct btrfs_block_group_cache *block_group = data;
251 struct btrfs_fs_info *fs_info = block_group->fs_info;
252 u64 last = 0;
214 struct btrfs_path *path; 253 struct btrfs_path *path;
215 int ret = 0; 254 int ret = 0;
216 struct btrfs_key key; 255 struct btrfs_key key;
217 struct extent_buffer *leaf; 256 struct extent_buffer *leaf;
218 int slot; 257 int slot;
219 u64 last; 258 u64 total_found = 0;
220 259
221 if (!block_group) 260 BUG_ON(!fs_info);
222 return 0;
223
224 root = root->fs_info->extent_root;
225
226 if (block_group->cached)
227 return 0;
228 261
229 path = btrfs_alloc_path(); 262 path = btrfs_alloc_path();
230 if (!path) 263 if (!path)
231 return -ENOMEM; 264 return -ENOMEM;
232 265
233 path->reada = 2; 266 atomic_inc(&block_group->space_info->caching_threads);
267 last = max_t(u64, block_group->key.objectid, BTRFS_SUPER_INFO_OFFSET);
234 /* 268 /*
235 * we get into deadlocks with paths held by callers of this function. 269 * We don't want to deadlock with somebody trying to allocate a new
236 * since the alloc_mutex is protecting things right now, just 270 * extent for the extent root while also trying to search the extent
237 * skip the locking here 271 * root to add free space. So we skip locking and search the commit
272 * root, since its read-only
238 */ 273 */
239 path->skip_locking = 1; 274 path->skip_locking = 1;
240 last = max_t(u64, block_group->key.objectid, BTRFS_SUPER_INFO_OFFSET); 275 path->search_commit_root = 1;
276 path->reada = 2;
277
241 key.objectid = last; 278 key.objectid = last;
242 key.offset = 0; 279 key.offset = 0;
243 btrfs_set_key_type(&key, BTRFS_EXTENT_ITEM_KEY); 280 btrfs_set_key_type(&key, BTRFS_EXTENT_ITEM_KEY);
244 ret = btrfs_search_slot(NULL, root, &key, path, 0, 0); 281again:
282 /* need to make sure the commit_root doesn't disappear */
283 down_read(&fs_info->extent_commit_sem);
284
285 ret = btrfs_search_slot(NULL, fs_info->extent_root, &key, path, 0, 0);
245 if (ret < 0) 286 if (ret < 0)
246 goto err; 287 goto err;
247 288
248 while (1) { 289 while (1) {
290 smp_mb();
291 if (block_group->fs_info->closing > 1) {
292 last = (u64)-1;
293 break;
294 }
295
249 leaf = path->nodes[0]; 296 leaf = path->nodes[0];
250 slot = path->slots[0]; 297 slot = path->slots[0];
251 if (slot >= btrfs_header_nritems(leaf)) { 298 if (slot >= btrfs_header_nritems(leaf)) {
252 ret = btrfs_next_leaf(root, path); 299 ret = btrfs_next_leaf(fs_info->extent_root, path);
253 if (ret < 0) 300 if (ret < 0)
254 goto err; 301 goto err;
255 if (ret == 0) 302 else if (ret)
256 continue;
257 else
258 break; 303 break;
304
305 if (need_resched() ||
306 btrfs_transaction_in_commit(fs_info)) {
307 leaf = path->nodes[0];
308
309 /* this shouldn't happen, but if the
310 * leaf is empty just move on.
311 */
312 if (btrfs_header_nritems(leaf) == 0)
313 break;
314 /*
315 * we need to copy the key out so that
316 * we are sure the next search advances
317 * us forward in the btree.
318 */
319 btrfs_item_key_to_cpu(leaf, &key, 0);
320 btrfs_release_path(fs_info->extent_root, path);
321 up_read(&fs_info->extent_commit_sem);
322 schedule_timeout(1);
323 goto again;
324 }
325
326 continue;
259 } 327 }
260 btrfs_item_key_to_cpu(leaf, &key, slot); 328 btrfs_item_key_to_cpu(leaf, &key, slot);
261 if (key.objectid < block_group->key.objectid) 329 if (key.objectid < block_group->key.objectid)
@@ -266,24 +334,59 @@ static int cache_block_group(struct btrfs_root *root,
266 break; 334 break;
267 335
268 if (btrfs_key_type(&key) == BTRFS_EXTENT_ITEM_KEY) { 336 if (btrfs_key_type(&key) == BTRFS_EXTENT_ITEM_KEY) {
269 add_new_free_space(block_group, root->fs_info, last, 337 total_found += add_new_free_space(block_group,
270 key.objectid); 338 fs_info, last,
271 339 key.objectid);
272 last = key.objectid + key.offset; 340 last = key.objectid + key.offset;
273 } 341 }
342
343 if (total_found > (1024 * 1024 * 2)) {
344 total_found = 0;
345 wake_up(&block_group->caching_q);
346 }
274next: 347next:
275 path->slots[0]++; 348 path->slots[0]++;
276 } 349 }
350 ret = 0;
277 351
278 add_new_free_space(block_group, root->fs_info, last, 352 total_found += add_new_free_space(block_group, fs_info, last,
279 block_group->key.objectid + 353 block_group->key.objectid +
280 block_group->key.offset); 354 block_group->key.offset);
355
356 spin_lock(&block_group->lock);
357 block_group->cached = BTRFS_CACHE_FINISHED;
358 spin_unlock(&block_group->lock);
281 359
282 block_group->cached = 1;
283 remove_sb_from_cache(root, block_group);
284 ret = 0;
285err: 360err:
286 btrfs_free_path(path); 361 btrfs_free_path(path);
362 up_read(&fs_info->extent_commit_sem);
363 atomic_dec(&block_group->space_info->caching_threads);
364 wake_up(&block_group->caching_q);
365
366 return 0;
367}
368
369static int cache_block_group(struct btrfs_block_group_cache *cache)
370{
371 struct task_struct *tsk;
372 int ret = 0;
373
374 spin_lock(&cache->lock);
375 if (cache->cached != BTRFS_CACHE_NO) {
376 spin_unlock(&cache->lock);
377 return ret;
378 }
379 cache->cached = BTRFS_CACHE_STARTED;
380 spin_unlock(&cache->lock);
381
382 tsk = kthread_run(caching_kthread, cache, "btrfs-cache-%llu\n",
383 cache->key.objectid);
384 if (IS_ERR(tsk)) {
385 ret = PTR_ERR(tsk);
386 printk(KERN_ERR "error running thread %d\n", ret);
387 BUG();
388 }
389
287 return ret; 390 return ret;
288} 391}
289 392
@@ -990,15 +1093,13 @@ static inline int extent_ref_type(u64 parent, u64 owner)
990 return type; 1093 return type;
991} 1094}
992 1095
993static int find_next_key(struct btrfs_path *path, struct btrfs_key *key) 1096static int find_next_key(struct btrfs_path *path, int level,
1097 struct btrfs_key *key)
994 1098
995{ 1099{
996 int level; 1100 for (; level < BTRFS_MAX_LEVEL; level++) {
997 BUG_ON(!path->keep_locks);
998 for (level = 0; level < BTRFS_MAX_LEVEL; level++) {
999 if (!path->nodes[level]) 1101 if (!path->nodes[level])
1000 break; 1102 break;
1001 btrfs_assert_tree_locked(path->nodes[level]);
1002 if (path->slots[level] + 1 >= 1103 if (path->slots[level] + 1 >=
1003 btrfs_header_nritems(path->nodes[level])) 1104 btrfs_header_nritems(path->nodes[level]))
1004 continue; 1105 continue;
@@ -1158,7 +1259,8 @@ int lookup_inline_extent_backref(struct btrfs_trans_handle *trans,
1158 * For simplicity, we just do not add new inline back 1259 * For simplicity, we just do not add new inline back
1159 * ref if there is any kind of item for this block 1260 * ref if there is any kind of item for this block
1160 */ 1261 */
1161 if (find_next_key(path, &key) == 0 && key.objectid == bytenr && 1262 if (find_next_key(path, 0, &key) == 0 &&
1263 key.objectid == bytenr &&
1162 key.type < BTRFS_BLOCK_GROUP_ITEM_KEY) { 1264 key.type < BTRFS_BLOCK_GROUP_ITEM_KEY) {
1163 err = -EAGAIN; 1265 err = -EAGAIN;
1164 goto out; 1266 goto out;
@@ -2388,13 +2490,29 @@ fail:
2388 2490
2389} 2491}
2390 2492
2493static struct btrfs_block_group_cache *
2494next_block_group(struct btrfs_root *root,
2495 struct btrfs_block_group_cache *cache)
2496{
2497 struct rb_node *node;
2498 spin_lock(&root->fs_info->block_group_cache_lock);
2499 node = rb_next(&cache->cache_node);
2500 btrfs_put_block_group(cache);
2501 if (node) {
2502 cache = rb_entry(node, struct btrfs_block_group_cache,
2503 cache_node);
2504 atomic_inc(&cache->count);
2505 } else
2506 cache = NULL;
2507 spin_unlock(&root->fs_info->block_group_cache_lock);
2508 return cache;
2509}
2510
2391int btrfs_write_dirty_block_groups(struct btrfs_trans_handle *trans, 2511int btrfs_write_dirty_block_groups(struct btrfs_trans_handle *trans,
2392 struct btrfs_root *root) 2512 struct btrfs_root *root)
2393{ 2513{
2394 struct btrfs_block_group_cache *cache, *entry; 2514 struct btrfs_block_group_cache *cache;
2395 struct rb_node *n;
2396 int err = 0; 2515 int err = 0;
2397 int werr = 0;
2398 struct btrfs_path *path; 2516 struct btrfs_path *path;
2399 u64 last = 0; 2517 u64 last = 0;
2400 2518
@@ -2403,39 +2521,35 @@ int btrfs_write_dirty_block_groups(struct btrfs_trans_handle *trans,
2403 return -ENOMEM; 2521 return -ENOMEM;
2404 2522
2405 while (1) { 2523 while (1) {
2406 cache = NULL; 2524 if (last == 0) {
2407 spin_lock(&root->fs_info->block_group_cache_lock); 2525 err = btrfs_run_delayed_refs(trans, root,
2408 for (n = rb_first(&root->fs_info->block_group_cache_tree); 2526 (unsigned long)-1);
2409 n; n = rb_next(n)) { 2527 BUG_ON(err);
2410 entry = rb_entry(n, struct btrfs_block_group_cache,
2411 cache_node);
2412 if (entry->dirty) {
2413 cache = entry;
2414 break;
2415 }
2416 } 2528 }
2417 spin_unlock(&root->fs_info->block_group_cache_lock);
2418 2529
2419 if (!cache) 2530 cache = btrfs_lookup_first_block_group(root->fs_info, last);
2420 break; 2531 while (cache) {
2532 if (cache->dirty)
2533 break;
2534 cache = next_block_group(root, cache);
2535 }
2536 if (!cache) {
2537 if (last == 0)
2538 break;
2539 last = 0;
2540 continue;
2541 }
2421 2542
2422 cache->dirty = 0; 2543 cache->dirty = 0;
2423 last += cache->key.offset; 2544 last = cache->key.objectid + cache->key.offset;
2424 2545
2425 err = write_one_cache_group(trans, root, 2546 err = write_one_cache_group(trans, root, path, cache);
2426 path, cache); 2547 BUG_ON(err);
2427 /* 2548 btrfs_put_block_group(cache);
2428 * if we fail to write the cache group, we want
2429 * to keep it marked dirty in hopes that a later
2430 * write will work
2431 */
2432 if (err) {
2433 werr = err;
2434 continue;
2435 }
2436 } 2549 }
2550
2437 btrfs_free_path(path); 2551 btrfs_free_path(path);
2438 return werr; 2552 return 0;
2439} 2553}
2440 2554
2441int btrfs_extent_readonly(struct btrfs_root *root, u64 bytenr) 2555int btrfs_extent_readonly(struct btrfs_root *root, u64 bytenr)
@@ -2485,6 +2599,7 @@ static int update_space_info(struct btrfs_fs_info *info, u64 flags,
2485 found->force_alloc = 0; 2599 found->force_alloc = 0;
2486 *space_info = found; 2600 *space_info = found;
2487 list_add_rcu(&found->list, &info->space_info); 2601 list_add_rcu(&found->list, &info->space_info);
2602 atomic_set(&found->caching_threads, 0);
2488 return 0; 2603 return 0;
2489} 2604}
2490 2605
@@ -2697,7 +2812,7 @@ again:
2697 2812
2698 printk(KERN_ERR "no space left, need %llu, %llu delalloc bytes" 2813 printk(KERN_ERR "no space left, need %llu, %llu delalloc bytes"
2699 ", %llu bytes_used, %llu bytes_reserved, " 2814 ", %llu bytes_used, %llu bytes_reserved, "
2700 "%llu bytes_pinned, %llu bytes_readonly, %llu may use" 2815 "%llu bytes_pinned, %llu bytes_readonly, %llu may use "
2701 "%llu total\n", (unsigned long long)bytes, 2816 "%llu total\n", (unsigned long long)bytes,
2702 (unsigned long long)data_sinfo->bytes_delalloc, 2817 (unsigned long long)data_sinfo->bytes_delalloc,
2703 (unsigned long long)data_sinfo->bytes_used, 2818 (unsigned long long)data_sinfo->bytes_used,
@@ -2948,13 +3063,9 @@ int btrfs_update_pinned_extents(struct btrfs_root *root,
2948 struct btrfs_block_group_cache *cache; 3063 struct btrfs_block_group_cache *cache;
2949 struct btrfs_fs_info *fs_info = root->fs_info; 3064 struct btrfs_fs_info *fs_info = root->fs_info;
2950 3065
2951 if (pin) { 3066 if (pin)
2952 set_extent_dirty(&fs_info->pinned_extents, 3067 set_extent_dirty(&fs_info->pinned_extents,
2953 bytenr, bytenr + num - 1, GFP_NOFS); 3068 bytenr, bytenr + num - 1, GFP_NOFS);
2954 } else {
2955 clear_extent_dirty(&fs_info->pinned_extents,
2956 bytenr, bytenr + num - 1, GFP_NOFS);
2957 }
2958 3069
2959 while (num > 0) { 3070 while (num > 0) {
2960 cache = btrfs_lookup_block_group(fs_info, bytenr); 3071 cache = btrfs_lookup_block_group(fs_info, bytenr);
@@ -2970,14 +3081,34 @@ int btrfs_update_pinned_extents(struct btrfs_root *root,
2970 spin_unlock(&cache->space_info->lock); 3081 spin_unlock(&cache->space_info->lock);
2971 fs_info->total_pinned += len; 3082 fs_info->total_pinned += len;
2972 } else { 3083 } else {
3084 int unpin = 0;
3085
3086 /*
3087 * in order to not race with the block group caching, we
3088 * only want to unpin the extent if we are cached. If
3089 * we aren't cached, we want to start async caching this
3090 * block group so we can free the extent the next time
3091 * around.
3092 */
2973 spin_lock(&cache->space_info->lock); 3093 spin_lock(&cache->space_info->lock);
2974 spin_lock(&cache->lock); 3094 spin_lock(&cache->lock);
2975 cache->pinned -= len; 3095 unpin = (cache->cached == BTRFS_CACHE_FINISHED);
2976 cache->space_info->bytes_pinned -= len; 3096 if (likely(unpin)) {
3097 cache->pinned -= len;
3098 cache->space_info->bytes_pinned -= len;
3099 fs_info->total_pinned -= len;
3100 }
2977 spin_unlock(&cache->lock); 3101 spin_unlock(&cache->lock);
2978 spin_unlock(&cache->space_info->lock); 3102 spin_unlock(&cache->space_info->lock);
2979 fs_info->total_pinned -= len; 3103
2980 if (cache->cached) 3104 if (likely(unpin))
3105 clear_extent_dirty(&fs_info->pinned_extents,
3106 bytenr, bytenr + len -1,
3107 GFP_NOFS);
3108 else
3109 cache_block_group(cache);
3110
3111 if (unpin)
2981 btrfs_add_free_space(cache, bytenr, len); 3112 btrfs_add_free_space(cache, bytenr, len);
2982 } 3113 }
2983 btrfs_put_block_group(cache); 3114 btrfs_put_block_group(cache);
@@ -3031,6 +3162,7 @@ int btrfs_copy_pinned(struct btrfs_root *root, struct extent_io_tree *copy)
3031 &start, &end, EXTENT_DIRTY); 3162 &start, &end, EXTENT_DIRTY);
3032 if (ret) 3163 if (ret)
3033 break; 3164 break;
3165
3034 set_extent_dirty(copy, start, end, GFP_NOFS); 3166 set_extent_dirty(copy, start, end, GFP_NOFS);
3035 last = end + 1; 3167 last = end + 1;
3036 } 3168 }
@@ -3059,6 +3191,7 @@ int btrfs_finish_extent_commit(struct btrfs_trans_handle *trans,
3059 3191
3060 cond_resched(); 3192 cond_resched();
3061 } 3193 }
3194
3062 return ret; 3195 return ret;
3063} 3196}
3064 3197
@@ -3437,6 +3570,45 @@ static u64 stripe_align(struct btrfs_root *root, u64 val)
3437} 3570}
3438 3571
3439/* 3572/*
3573 * when we wait for progress in the block group caching, its because
3574 * our allocation attempt failed at least once. So, we must sleep
3575 * and let some progress happen before we try again.
3576 *
3577 * This function will sleep at least once waiting for new free space to
3578 * show up, and then it will check the block group free space numbers
3579 * for our min num_bytes. Another option is to have it go ahead
3580 * and look in the rbtree for a free extent of a given size, but this
3581 * is a good start.
3582 */
3583static noinline int
3584wait_block_group_cache_progress(struct btrfs_block_group_cache *cache,
3585 u64 num_bytes)
3586{
3587 DEFINE_WAIT(wait);
3588
3589 prepare_to_wait(&cache->caching_q, &wait, TASK_UNINTERRUPTIBLE);
3590
3591 if (block_group_cache_done(cache)) {
3592 finish_wait(&cache->caching_q, &wait);
3593 return 0;
3594 }
3595 schedule();
3596 finish_wait(&cache->caching_q, &wait);
3597
3598 wait_event(cache->caching_q, block_group_cache_done(cache) ||
3599 (cache->free_space >= num_bytes));
3600 return 0;
3601}
3602
3603enum btrfs_loop_type {
3604 LOOP_CACHED_ONLY = 0,
3605 LOOP_CACHING_NOWAIT = 1,
3606 LOOP_CACHING_WAIT = 2,
3607 LOOP_ALLOC_CHUNK = 3,
3608 LOOP_NO_EMPTY_SIZE = 4,
3609};
3610
3611/*
3440 * walks the btree of allocated extents and find a hole of a given size. 3612 * walks the btree of allocated extents and find a hole of a given size.
3441 * The key ins is changed to record the hole: 3613 * The key ins is changed to record the hole:
3442 * ins->objectid == block start 3614 * ins->objectid == block start
@@ -3461,6 +3633,7 @@ static noinline int find_free_extent(struct btrfs_trans_handle *trans,
3461 struct btrfs_space_info *space_info; 3633 struct btrfs_space_info *space_info;
3462 int last_ptr_loop = 0; 3634 int last_ptr_loop = 0;
3463 int loop = 0; 3635 int loop = 0;
3636 bool found_uncached_bg = false;
3464 3637
3465 WARN_ON(num_bytes < root->sectorsize); 3638 WARN_ON(num_bytes < root->sectorsize);
3466 btrfs_set_key_type(ins, BTRFS_EXTENT_ITEM_KEY); 3639 btrfs_set_key_type(ins, BTRFS_EXTENT_ITEM_KEY);
@@ -3492,15 +3665,18 @@ static noinline int find_free_extent(struct btrfs_trans_handle *trans,
3492 search_start = max(search_start, first_logical_byte(root, 0)); 3665 search_start = max(search_start, first_logical_byte(root, 0));
3493 search_start = max(search_start, hint_byte); 3666 search_start = max(search_start, hint_byte);
3494 3667
3495 if (!last_ptr) { 3668 if (!last_ptr)
3496 empty_cluster = 0; 3669 empty_cluster = 0;
3497 loop = 1;
3498 }
3499 3670
3500 if (search_start == hint_byte) { 3671 if (search_start == hint_byte) {
3501 block_group = btrfs_lookup_block_group(root->fs_info, 3672 block_group = btrfs_lookup_block_group(root->fs_info,
3502 search_start); 3673 search_start);
3503 if (block_group && block_group_bits(block_group, data)) { 3674 /*
3675 * we don't want to use the block group if it doesn't match our
3676 * allocation bits, or if its not cached.
3677 */
3678 if (block_group && block_group_bits(block_group, data) &&
3679 block_group_cache_done(block_group)) {
3504 down_read(&space_info->groups_sem); 3680 down_read(&space_info->groups_sem);
3505 if (list_empty(&block_group->list) || 3681 if (list_empty(&block_group->list) ||
3506 block_group->ro) { 3682 block_group->ro) {
@@ -3523,21 +3699,35 @@ search:
3523 down_read(&space_info->groups_sem); 3699 down_read(&space_info->groups_sem);
3524 list_for_each_entry(block_group, &space_info->block_groups, list) { 3700 list_for_each_entry(block_group, &space_info->block_groups, list) {
3525 u64 offset; 3701 u64 offset;
3702 int cached;
3526 3703
3527 atomic_inc(&block_group->count); 3704 atomic_inc(&block_group->count);
3528 search_start = block_group->key.objectid; 3705 search_start = block_group->key.objectid;
3529 3706
3530have_block_group: 3707have_block_group:
3531 if (unlikely(!block_group->cached)) { 3708 if (unlikely(block_group->cached == BTRFS_CACHE_NO)) {
3532 mutex_lock(&block_group->cache_mutex); 3709 /*
3533 ret = cache_block_group(root, block_group); 3710 * we want to start caching kthreads, but not too many
3534 mutex_unlock(&block_group->cache_mutex); 3711 * right off the bat so we don't overwhelm the system,
3535 if (ret) { 3712 * so only start them if there are less than 2 and we're
3536 btrfs_put_block_group(block_group); 3713 * in the initial allocation phase.
3537 break; 3714 */
3715 if (loop > LOOP_CACHING_NOWAIT ||
3716 atomic_read(&space_info->caching_threads) < 2) {
3717 ret = cache_block_group(block_group);
3718 BUG_ON(ret);
3538 } 3719 }
3539 } 3720 }
3540 3721
3722 cached = block_group_cache_done(block_group);
3723 if (unlikely(!cached)) {
3724 found_uncached_bg = true;
3725
3726 /* if we only want cached bgs, loop */
3727 if (loop == LOOP_CACHED_ONLY)
3728 goto loop;
3729 }
3730
3541 if (unlikely(block_group->ro)) 3731 if (unlikely(block_group->ro))
3542 goto loop; 3732 goto loop;
3543 3733
@@ -3616,14 +3806,21 @@ refill_cluster:
3616 spin_unlock(&last_ptr->refill_lock); 3806 spin_unlock(&last_ptr->refill_lock);
3617 goto checks; 3807 goto checks;
3618 } 3808 }
3809 } else if (!cached && loop > LOOP_CACHING_NOWAIT) {
3810 spin_unlock(&last_ptr->refill_lock);
3811
3812 wait_block_group_cache_progress(block_group,
3813 num_bytes + empty_cluster + empty_size);
3814 goto have_block_group;
3619 } 3815 }
3816
3620 /* 3817 /*
3621 * at this point we either didn't find a cluster 3818 * at this point we either didn't find a cluster
3622 * or we weren't able to allocate a block from our 3819 * or we weren't able to allocate a block from our
3623 * cluster. Free the cluster we've been trying 3820 * cluster. Free the cluster we've been trying
3624 * to use, and go to the next block group 3821 * to use, and go to the next block group
3625 */ 3822 */
3626 if (loop < 2) { 3823 if (loop < LOOP_NO_EMPTY_SIZE) {
3627 btrfs_return_cluster_to_free_space(NULL, 3824 btrfs_return_cluster_to_free_space(NULL,
3628 last_ptr); 3825 last_ptr);
3629 spin_unlock(&last_ptr->refill_lock); 3826 spin_unlock(&last_ptr->refill_lock);
@@ -3634,11 +3831,17 @@ refill_cluster:
3634 3831
3635 offset = btrfs_find_space_for_alloc(block_group, search_start, 3832 offset = btrfs_find_space_for_alloc(block_group, search_start,
3636 num_bytes, empty_size); 3833 num_bytes, empty_size);
3637 if (!offset) 3834 if (!offset && (cached || (!cached &&
3835 loop == LOOP_CACHING_NOWAIT))) {
3638 goto loop; 3836 goto loop;
3837 } else if (!offset && (!cached &&
3838 loop > LOOP_CACHING_NOWAIT)) {
3839 wait_block_group_cache_progress(block_group,
3840 num_bytes + empty_size);
3841 goto have_block_group;
3842 }
3639checks: 3843checks:
3640 search_start = stripe_align(root, offset); 3844 search_start = stripe_align(root, offset);
3641
3642 /* move on to the next group */ 3845 /* move on to the next group */
3643 if (search_start + num_bytes >= search_end) { 3846 if (search_start + num_bytes >= search_end) {
3644 btrfs_add_free_space(block_group, offset, num_bytes); 3847 btrfs_add_free_space(block_group, offset, num_bytes);
@@ -3684,13 +3887,26 @@ loop:
3684 } 3887 }
3685 up_read(&space_info->groups_sem); 3888 up_read(&space_info->groups_sem);
3686 3889
3687 /* loop == 0, try to find a clustered alloc in every block group 3890 /* LOOP_CACHED_ONLY, only search fully cached block groups
3688 * loop == 1, try again after forcing a chunk allocation 3891 * LOOP_CACHING_NOWAIT, search partially cached block groups, but
3689 * loop == 2, set empty_size and empty_cluster to 0 and try again 3892 * dont wait foR them to finish caching
3893 * LOOP_CACHING_WAIT, search everything, and wait if our bg is caching
3894 * LOOP_ALLOC_CHUNK, force a chunk allocation and try again
3895 * LOOP_NO_EMPTY_SIZE, set empty_size and empty_cluster to 0 and try
3896 * again
3690 */ 3897 */
3691 if (!ins->objectid && loop < 3 && 3898 if (!ins->objectid && loop < LOOP_NO_EMPTY_SIZE &&
3692 (empty_size || empty_cluster || allowed_chunk_alloc)) { 3899 (found_uncached_bg || empty_size || empty_cluster ||
3693 if (loop >= 2) { 3900 allowed_chunk_alloc)) {
3901 if (found_uncached_bg) {
3902 found_uncached_bg = false;
3903 if (loop < LOOP_CACHING_WAIT) {
3904 loop++;
3905 goto search;
3906 }
3907 }
3908
3909 if (loop == LOOP_ALLOC_CHUNK) {
3694 empty_size = 0; 3910 empty_size = 0;
3695 empty_cluster = 0; 3911 empty_cluster = 0;
3696 } 3912 }
@@ -3703,7 +3919,7 @@ loop:
3703 space_info->force_alloc = 1; 3919 space_info->force_alloc = 1;
3704 } 3920 }
3705 3921
3706 if (loop < 3) { 3922 if (loop < LOOP_NO_EMPTY_SIZE) {
3707 loop++; 3923 loop++;
3708 goto search; 3924 goto search;
3709 } 3925 }
@@ -3799,7 +4015,7 @@ again:
3799 num_bytes, data, 1); 4015 num_bytes, data, 1);
3800 goto again; 4016 goto again;
3801 } 4017 }
3802 if (ret) { 4018 if (ret == -ENOSPC) {
3803 struct btrfs_space_info *sinfo; 4019 struct btrfs_space_info *sinfo;
3804 4020
3805 sinfo = __find_space_info(root->fs_info, data); 4021 sinfo = __find_space_info(root->fs_info, data);
@@ -3807,7 +4023,6 @@ again:
3807 "wanted %llu\n", (unsigned long long)data, 4023 "wanted %llu\n", (unsigned long long)data,
3808 (unsigned long long)num_bytes); 4024 (unsigned long long)num_bytes);
3809 dump_space_info(sinfo, num_bytes); 4025 dump_space_info(sinfo, num_bytes);
3810 BUG();
3811 } 4026 }
3812 4027
3813 return ret; 4028 return ret;
@@ -3845,7 +4060,9 @@ int btrfs_reserve_extent(struct btrfs_trans_handle *trans,
3845 ret = __btrfs_reserve_extent(trans, root, num_bytes, min_alloc_size, 4060 ret = __btrfs_reserve_extent(trans, root, num_bytes, min_alloc_size,
3846 empty_size, hint_byte, search_end, ins, 4061 empty_size, hint_byte, search_end, ins,
3847 data); 4062 data);
3848 update_reserved_extents(root, ins->objectid, ins->offset, 1); 4063 if (!ret)
4064 update_reserved_extents(root, ins->objectid, ins->offset, 1);
4065
3849 return ret; 4066 return ret;
3850} 4067}
3851 4068
@@ -4007,9 +4224,9 @@ int btrfs_alloc_logged_file_extent(struct btrfs_trans_handle *trans,
4007 struct btrfs_block_group_cache *block_group; 4224 struct btrfs_block_group_cache *block_group;
4008 4225
4009 block_group = btrfs_lookup_block_group(root->fs_info, ins->objectid); 4226 block_group = btrfs_lookup_block_group(root->fs_info, ins->objectid);
4010 mutex_lock(&block_group->cache_mutex); 4227 cache_block_group(block_group);
4011 cache_block_group(root, block_group); 4228 wait_event(block_group->caching_q,
4012 mutex_unlock(&block_group->cache_mutex); 4229 block_group_cache_done(block_group));
4013 4230
4014 ret = btrfs_remove_free_space(block_group, ins->objectid, 4231 ret = btrfs_remove_free_space(block_group, ins->objectid,
4015 ins->offset); 4232 ins->offset);
@@ -4040,7 +4257,8 @@ static int alloc_tree_block(struct btrfs_trans_handle *trans,
4040 ret = __btrfs_reserve_extent(trans, root, num_bytes, num_bytes, 4257 ret = __btrfs_reserve_extent(trans, root, num_bytes, num_bytes,
4041 empty_size, hint_byte, search_end, 4258 empty_size, hint_byte, search_end,
4042 ins, 0); 4259 ins, 0);
4043 BUG_ON(ret); 4260 if (ret)
4261 return ret;
4044 4262
4045 if (root_objectid == BTRFS_TREE_RELOC_OBJECTID) { 4263 if (root_objectid == BTRFS_TREE_RELOC_OBJECTID) {
4046 if (parent == 0) 4264 if (parent == 0)
@@ -4128,6 +4346,7 @@ struct extent_buffer *btrfs_alloc_free_block(struct btrfs_trans_handle *trans,
4128 return buf; 4346 return buf;
4129} 4347}
4130 4348
4349#if 0
4131int btrfs_drop_leaf_ref(struct btrfs_trans_handle *trans, 4350int btrfs_drop_leaf_ref(struct btrfs_trans_handle *trans,
4132 struct btrfs_root *root, struct extent_buffer *leaf) 4351 struct btrfs_root *root, struct extent_buffer *leaf)
4133{ 4352{
@@ -4171,8 +4390,6 @@ int btrfs_drop_leaf_ref(struct btrfs_trans_handle *trans,
4171 return 0; 4390 return 0;
4172} 4391}
4173 4392
4174#if 0
4175
4176static noinline int cache_drop_leaf_ref(struct btrfs_trans_handle *trans, 4393static noinline int cache_drop_leaf_ref(struct btrfs_trans_handle *trans,
4177 struct btrfs_root *root, 4394 struct btrfs_root *root,
4178 struct btrfs_leaf_ref *ref) 4395 struct btrfs_leaf_ref *ref)
@@ -4553,262 +4770,471 @@ out:
4553} 4770}
4554#endif 4771#endif
4555 4772
4773struct walk_control {
4774 u64 refs[BTRFS_MAX_LEVEL];
4775 u64 flags[BTRFS_MAX_LEVEL];
4776 struct btrfs_key update_progress;
4777 int stage;
4778 int level;
4779 int shared_level;
4780 int update_ref;
4781 int keep_locks;
4782};
4783
4784#define DROP_REFERENCE 1
4785#define UPDATE_BACKREF 2
4786
4556/* 4787/*
4557 * helper function for drop_subtree, this function is similar to 4788 * hepler to process tree block while walking down the tree.
4558 * walk_down_tree. The main difference is that it checks reference 4789 *
4559 * counts while tree blocks are locked. 4790 * when wc->stage == DROP_REFERENCE, this function checks
4791 * reference count of the block. if the block is shared and
4792 * we need update back refs for the subtree rooted at the
4793 * block, this function changes wc->stage to UPDATE_BACKREF
4794 *
4795 * when wc->stage == UPDATE_BACKREF, this function updates
4796 * back refs for pointers in the block.
4797 *
4798 * NOTE: return value 1 means we should stop walking down.
4560 */ 4799 */
4561static noinline int walk_down_tree(struct btrfs_trans_handle *trans, 4800static noinline int walk_down_proc(struct btrfs_trans_handle *trans,
4562 struct btrfs_root *root, 4801 struct btrfs_root *root,
4563 struct btrfs_path *path, int *level) 4802 struct btrfs_path *path,
4803 struct walk_control *wc)
4564{ 4804{
4565 struct extent_buffer *next; 4805 int level = wc->level;
4566 struct extent_buffer *cur; 4806 struct extent_buffer *eb = path->nodes[level];
4567 struct extent_buffer *parent; 4807 struct btrfs_key key;
4568 u64 bytenr; 4808 u64 flag = BTRFS_BLOCK_FLAG_FULL_BACKREF;
4569 u64 ptr_gen;
4570 u64 refs;
4571 u64 flags;
4572 u32 blocksize;
4573 int ret; 4809 int ret;
4574 4810
4575 cur = path->nodes[*level]; 4811 if (wc->stage == UPDATE_BACKREF &&
4576 ret = btrfs_lookup_extent_info(trans, root, cur->start, cur->len, 4812 btrfs_header_owner(eb) != root->root_key.objectid)
4577 &refs, &flags); 4813 return 1;
4578 BUG_ON(ret);
4579 if (refs > 1)
4580 goto out;
4581 4814
4582 BUG_ON(!(flags & BTRFS_BLOCK_FLAG_FULL_BACKREF)); 4815 /*
4816 * when reference count of tree block is 1, it won't increase
4817 * again. once full backref flag is set, we never clear it.
4818 */
4819 if ((wc->stage == DROP_REFERENCE && wc->refs[level] != 1) ||
4820 (wc->stage == UPDATE_BACKREF && !(wc->flags[level] & flag))) {
4821 BUG_ON(!path->locks[level]);
4822 ret = btrfs_lookup_extent_info(trans, root,
4823 eb->start, eb->len,
4824 &wc->refs[level],
4825 &wc->flags[level]);
4826 BUG_ON(ret);
4827 BUG_ON(wc->refs[level] == 0);
4828 }
4583 4829
4584 while (*level >= 0) { 4830 if (wc->stage == DROP_REFERENCE &&
4585 cur = path->nodes[*level]; 4831 wc->update_ref && wc->refs[level] > 1) {
4586 if (*level == 0) { 4832 BUG_ON(eb == root->node);
4587 ret = btrfs_drop_leaf_ref(trans, root, cur); 4833 BUG_ON(path->slots[level] > 0);
4588 BUG_ON(ret); 4834 if (level == 0)
4589 clean_tree_block(trans, root, cur); 4835 btrfs_item_key_to_cpu(eb, &key, path->slots[level]);
4590 break; 4836 else
4591 } 4837 btrfs_node_key_to_cpu(eb, &key, path->slots[level]);
4592 if (path->slots[*level] >= btrfs_header_nritems(cur)) { 4838 if (btrfs_header_owner(eb) == root->root_key.objectid &&
4593 clean_tree_block(trans, root, cur); 4839 btrfs_comp_cpu_keys(&key, &wc->update_progress) >= 0) {
4594 break; 4840 wc->stage = UPDATE_BACKREF;
4841 wc->shared_level = level;
4595 } 4842 }
4843 }
4596 4844
4597 bytenr = btrfs_node_blockptr(cur, path->slots[*level]); 4845 if (wc->stage == DROP_REFERENCE) {
4598 blocksize = btrfs_level_size(root, *level - 1); 4846 if (wc->refs[level] > 1)
4599 ptr_gen = btrfs_node_ptr_generation(cur, path->slots[*level]); 4847 return 1;
4600 4848
4601 next = read_tree_block(root, bytenr, blocksize, ptr_gen); 4849 if (path->locks[level] && !wc->keep_locks) {
4602 btrfs_tree_lock(next); 4850 btrfs_tree_unlock(eb);
4603 btrfs_set_lock_blocking(next); 4851 path->locks[level] = 0;
4852 }
4853 return 0;
4854 }
4604 4855
4605 ret = btrfs_lookup_extent_info(trans, root, bytenr, blocksize, 4856 /* wc->stage == UPDATE_BACKREF */
4606 &refs, &flags); 4857 if (!(wc->flags[level] & flag)) {
4858 BUG_ON(!path->locks[level]);
4859 ret = btrfs_inc_ref(trans, root, eb, 1);
4607 BUG_ON(ret); 4860 BUG_ON(ret);
4608 if (refs > 1) { 4861 ret = btrfs_dec_ref(trans, root, eb, 0);
4609 parent = path->nodes[*level]; 4862 BUG_ON(ret);
4610 ret = btrfs_free_extent(trans, root, bytenr, 4863 ret = btrfs_set_disk_extent_flags(trans, root, eb->start,
4611 blocksize, parent->start, 4864 eb->len, flag, 0);
4612 btrfs_header_owner(parent), 4865 BUG_ON(ret);
4613 *level - 1, 0); 4866 wc->flags[level] |= flag;
4867 }
4868
4869 /*
4870 * the block is shared by multiple trees, so it's not good to
4871 * keep the tree lock
4872 */
4873 if (path->locks[level] && level > 0) {
4874 btrfs_tree_unlock(eb);
4875 path->locks[level] = 0;
4876 }
4877 return 0;
4878}
4879
4880/*
4881 * hepler to process tree block while walking up the tree.
4882 *
4883 * when wc->stage == DROP_REFERENCE, this function drops
4884 * reference count on the block.
4885 *
4886 * when wc->stage == UPDATE_BACKREF, this function changes
4887 * wc->stage back to DROP_REFERENCE if we changed wc->stage
4888 * to UPDATE_BACKREF previously while processing the block.
4889 *
4890 * NOTE: return value 1 means we should stop walking up.
4891 */
4892static noinline int walk_up_proc(struct btrfs_trans_handle *trans,
4893 struct btrfs_root *root,
4894 struct btrfs_path *path,
4895 struct walk_control *wc)
4896{
4897 int ret = 0;
4898 int level = wc->level;
4899 struct extent_buffer *eb = path->nodes[level];
4900 u64 parent = 0;
4901
4902 if (wc->stage == UPDATE_BACKREF) {
4903 BUG_ON(wc->shared_level < level);
4904 if (level < wc->shared_level)
4905 goto out;
4906
4907 BUG_ON(wc->refs[level] <= 1);
4908 ret = find_next_key(path, level + 1, &wc->update_progress);
4909 if (ret > 0)
4910 wc->update_ref = 0;
4911
4912 wc->stage = DROP_REFERENCE;
4913 wc->shared_level = -1;
4914 path->slots[level] = 0;
4915
4916 /*
4917 * check reference count again if the block isn't locked.
4918 * we should start walking down the tree again if reference
4919 * count is one.
4920 */
4921 if (!path->locks[level]) {
4922 BUG_ON(level == 0);
4923 btrfs_tree_lock(eb);
4924 btrfs_set_lock_blocking(eb);
4925 path->locks[level] = 1;
4926
4927 ret = btrfs_lookup_extent_info(trans, root,
4928 eb->start, eb->len,
4929 &wc->refs[level],
4930 &wc->flags[level]);
4614 BUG_ON(ret); 4931 BUG_ON(ret);
4615 path->slots[*level]++; 4932 BUG_ON(wc->refs[level] == 0);
4616 btrfs_tree_unlock(next); 4933 if (wc->refs[level] == 1) {
4617 free_extent_buffer(next); 4934 btrfs_tree_unlock(eb);
4618 continue; 4935 path->locks[level] = 0;
4936 return 1;
4937 }
4938 } else {
4939 BUG_ON(level != 0);
4619 } 4940 }
4941 }
4620 4942
4621 BUG_ON(!(flags & BTRFS_BLOCK_FLAG_FULL_BACKREF)); 4943 /* wc->stage == DROP_REFERENCE */
4944 BUG_ON(wc->refs[level] > 1 && !path->locks[level]);
4622 4945
4623 *level = btrfs_header_level(next); 4946 if (wc->refs[level] == 1) {
4624 path->nodes[*level] = next; 4947 if (level == 0) {
4625 path->slots[*level] = 0; 4948 if (wc->flags[level] & BTRFS_BLOCK_FLAG_FULL_BACKREF)
4626 path->locks[*level] = 1; 4949 ret = btrfs_dec_ref(trans, root, eb, 1);
4627 cond_resched(); 4950 else
4951 ret = btrfs_dec_ref(trans, root, eb, 0);
4952 BUG_ON(ret);
4953 }
4954 /* make block locked assertion in clean_tree_block happy */
4955 if (!path->locks[level] &&
4956 btrfs_header_generation(eb) == trans->transid) {
4957 btrfs_tree_lock(eb);
4958 btrfs_set_lock_blocking(eb);
4959 path->locks[level] = 1;
4960 }
4961 clean_tree_block(trans, root, eb);
4628 } 4962 }
4629out:
4630 if (path->nodes[*level] == root->node)
4631 parent = path->nodes[*level];
4632 else
4633 parent = path->nodes[*level + 1];
4634 bytenr = path->nodes[*level]->start;
4635 blocksize = path->nodes[*level]->len;
4636 4963
4637 ret = btrfs_free_extent(trans, root, bytenr, blocksize, parent->start, 4964 if (eb == root->node) {
4638 btrfs_header_owner(parent), *level, 0); 4965 if (wc->flags[level] & BTRFS_BLOCK_FLAG_FULL_BACKREF)
4966 parent = eb->start;
4967 else
4968 BUG_ON(root->root_key.objectid !=
4969 btrfs_header_owner(eb));
4970 } else {
4971 if (wc->flags[level + 1] & BTRFS_BLOCK_FLAG_FULL_BACKREF)
4972 parent = path->nodes[level + 1]->start;
4973 else
4974 BUG_ON(root->root_key.objectid !=
4975 btrfs_header_owner(path->nodes[level + 1]));
4976 }
4977
4978 ret = btrfs_free_extent(trans, root, eb->start, eb->len, parent,
4979 root->root_key.objectid, level, 0);
4639 BUG_ON(ret); 4980 BUG_ON(ret);
4981out:
4982 wc->refs[level] = 0;
4983 wc->flags[level] = 0;
4984 return ret;
4985}
4986
4987static noinline int walk_down_tree(struct btrfs_trans_handle *trans,
4988 struct btrfs_root *root,
4989 struct btrfs_path *path,
4990 struct walk_control *wc)
4991{
4992 struct extent_buffer *next;
4993 struct extent_buffer *cur;
4994 u64 bytenr;
4995 u64 ptr_gen;
4996 u32 blocksize;
4997 int level = wc->level;
4998 int ret;
4999
5000 while (level >= 0) {
5001 cur = path->nodes[level];
5002 BUG_ON(path->slots[level] >= btrfs_header_nritems(cur));
5003
5004 ret = walk_down_proc(trans, root, path, wc);
5005 if (ret > 0)
5006 break;
5007
5008 if (level == 0)
5009 break;
5010
5011 bytenr = btrfs_node_blockptr(cur, path->slots[level]);
5012 blocksize = btrfs_level_size(root, level - 1);
5013 ptr_gen = btrfs_node_ptr_generation(cur, path->slots[level]);
5014
5015 next = read_tree_block(root, bytenr, blocksize, ptr_gen);
5016 btrfs_tree_lock(next);
5017 btrfs_set_lock_blocking(next);
4640 5018
4641 if (path->locks[*level]) { 5019 level--;
4642 btrfs_tree_unlock(path->nodes[*level]); 5020 BUG_ON(level != btrfs_header_level(next));
4643 path->locks[*level] = 0; 5021 path->nodes[level] = next;
5022 path->slots[level] = 0;
5023 path->locks[level] = 1;
5024 wc->level = level;
4644 } 5025 }
4645 free_extent_buffer(path->nodes[*level]);
4646 path->nodes[*level] = NULL;
4647 *level += 1;
4648 cond_resched();
4649 return 0; 5026 return 0;
4650} 5027}
4651 5028
4652/*
4653 * helper for dropping snapshots. This walks back up the tree in the path
4654 * to find the first node higher up where we haven't yet gone through
4655 * all the slots
4656 */
4657static noinline int walk_up_tree(struct btrfs_trans_handle *trans, 5029static noinline int walk_up_tree(struct btrfs_trans_handle *trans,
4658 struct btrfs_root *root, 5030 struct btrfs_root *root,
4659 struct btrfs_path *path, 5031 struct btrfs_path *path,
4660 int *level, int max_level) 5032 struct walk_control *wc, int max_level)
4661{ 5033{
4662 struct btrfs_root_item *root_item = &root->root_item; 5034 int level = wc->level;
4663 int i;
4664 int slot;
4665 int ret; 5035 int ret;
4666 5036
4667 for (i = *level; i < max_level && path->nodes[i]; i++) { 5037 path->slots[level] = btrfs_header_nritems(path->nodes[level]);
4668 slot = path->slots[i]; 5038 while (level < max_level && path->nodes[level]) {
4669 if (slot + 1 < btrfs_header_nritems(path->nodes[i])) { 5039 wc->level = level;
4670 /* 5040 if (path->slots[level] + 1 <
4671 * there is more work to do in this level. 5041 btrfs_header_nritems(path->nodes[level])) {
4672 * Update the drop_progress marker to reflect 5042 path->slots[level]++;
4673 * the work we've done so far, and then bump
4674 * the slot number
4675 */
4676 path->slots[i]++;
4677 WARN_ON(*level == 0);
4678 if (max_level == BTRFS_MAX_LEVEL) {
4679 btrfs_node_key(path->nodes[i],
4680 &root_item->drop_progress,
4681 path->slots[i]);
4682 root_item->drop_level = i;
4683 }
4684 *level = i;
4685 return 0; 5043 return 0;
4686 } else { 5044 } else {
4687 struct extent_buffer *parent; 5045 ret = walk_up_proc(trans, root, path, wc);
4688 5046 if (ret > 0)
4689 /* 5047 return 0;
4690 * this whole node is done, free our reference
4691 * on it and go up one level
4692 */
4693 if (path->nodes[*level] == root->node)
4694 parent = path->nodes[*level];
4695 else
4696 parent = path->nodes[*level + 1];
4697 5048
4698 clean_tree_block(trans, root, path->nodes[i]); 5049 if (path->locks[level]) {
4699 ret = btrfs_free_extent(trans, root, 5050 btrfs_tree_unlock(path->nodes[level]);
4700 path->nodes[i]->start, 5051 path->locks[level] = 0;
4701 path->nodes[i]->len,
4702 parent->start,
4703 btrfs_header_owner(parent),
4704 *level, 0);
4705 BUG_ON(ret);
4706 if (path->locks[*level]) {
4707 btrfs_tree_unlock(path->nodes[i]);
4708 path->locks[i] = 0;
4709 } 5052 }
4710 free_extent_buffer(path->nodes[i]); 5053 free_extent_buffer(path->nodes[level]);
4711 path->nodes[i] = NULL; 5054 path->nodes[level] = NULL;
4712 *level = i + 1; 5055 level++;
4713 } 5056 }
4714 } 5057 }
4715 return 1; 5058 return 1;
4716} 5059}
4717 5060
4718/* 5061/*
4719 * drop the reference count on the tree rooted at 'snap'. This traverses 5062 * drop a subvolume tree.
4720 * the tree freeing any blocks that have a ref count of zero after being 5063 *
4721 * decremented. 5064 * this function traverses the tree freeing any blocks that only
5065 * referenced by the tree.
5066 *
5067 * when a shared tree block is found. this function decreases its
5068 * reference count by one. if update_ref is true, this function
5069 * also make sure backrefs for the shared block and all lower level
5070 * blocks are properly updated.
4722 */ 5071 */
4723int btrfs_drop_snapshot(struct btrfs_trans_handle *trans, struct btrfs_root 5072int btrfs_drop_snapshot(struct btrfs_root *root, int update_ref)
4724 *root)
4725{ 5073{
4726 int ret = 0;
4727 int wret;
4728 int level;
4729 struct btrfs_path *path; 5074 struct btrfs_path *path;
4730 int update_count; 5075 struct btrfs_trans_handle *trans;
5076 struct btrfs_root *tree_root = root->fs_info->tree_root;
4731 struct btrfs_root_item *root_item = &root->root_item; 5077 struct btrfs_root_item *root_item = &root->root_item;
5078 struct walk_control *wc;
5079 struct btrfs_key key;
5080 int err = 0;
5081 int ret;
5082 int level;
4732 5083
4733 path = btrfs_alloc_path(); 5084 path = btrfs_alloc_path();
4734 BUG_ON(!path); 5085 BUG_ON(!path);
4735 5086
4736 level = btrfs_header_level(root->node); 5087 wc = kzalloc(sizeof(*wc), GFP_NOFS);
5088 BUG_ON(!wc);
5089
5090 trans = btrfs_start_transaction(tree_root, 1);
5091
4737 if (btrfs_disk_key_objectid(&root_item->drop_progress) == 0) { 5092 if (btrfs_disk_key_objectid(&root_item->drop_progress) == 0) {
5093 level = btrfs_header_level(root->node);
4738 path->nodes[level] = btrfs_lock_root_node(root); 5094 path->nodes[level] = btrfs_lock_root_node(root);
4739 btrfs_set_lock_blocking(path->nodes[level]); 5095 btrfs_set_lock_blocking(path->nodes[level]);
4740 path->slots[level] = 0; 5096 path->slots[level] = 0;
4741 path->locks[level] = 1; 5097 path->locks[level] = 1;
5098 memset(&wc->update_progress, 0,
5099 sizeof(wc->update_progress));
4742 } else { 5100 } else {
4743 struct btrfs_key key;
4744 struct btrfs_disk_key found_key;
4745 struct extent_buffer *node;
4746
4747 btrfs_disk_key_to_cpu(&key, &root_item->drop_progress); 5101 btrfs_disk_key_to_cpu(&key, &root_item->drop_progress);
5102 memcpy(&wc->update_progress, &key,
5103 sizeof(wc->update_progress));
5104
4748 level = root_item->drop_level; 5105 level = root_item->drop_level;
5106 BUG_ON(level == 0);
4749 path->lowest_level = level; 5107 path->lowest_level = level;
4750 wret = btrfs_search_slot(NULL, root, &key, path, 0, 0); 5108 ret = btrfs_search_slot(NULL, root, &key, path, 0, 0);
4751 if (wret < 0) { 5109 path->lowest_level = 0;
4752 ret = wret; 5110 if (ret < 0) {
5111 err = ret;
4753 goto out; 5112 goto out;
4754 } 5113 }
4755 node = path->nodes[level]; 5114 btrfs_node_key_to_cpu(path->nodes[level], &key,
4756 btrfs_node_key(node, &found_key, path->slots[level]); 5115 path->slots[level]);
4757 WARN_ON(memcmp(&found_key, &root_item->drop_progress, 5116 WARN_ON(memcmp(&key, &wc->update_progress, sizeof(key)));
4758 sizeof(found_key))); 5117
4759 /* 5118 /*
4760 * unlock our path, this is safe because only this 5119 * unlock our path, this is safe because only this
4761 * function is allowed to delete this snapshot 5120 * function is allowed to delete this snapshot
4762 */ 5121 */
4763 btrfs_unlock_up_safe(path, 0); 5122 btrfs_unlock_up_safe(path, 0);
5123
5124 level = btrfs_header_level(root->node);
5125 while (1) {
5126 btrfs_tree_lock(path->nodes[level]);
5127 btrfs_set_lock_blocking(path->nodes[level]);
5128
5129 ret = btrfs_lookup_extent_info(trans, root,
5130 path->nodes[level]->start,
5131 path->nodes[level]->len,
5132 &wc->refs[level],
5133 &wc->flags[level]);
5134 BUG_ON(ret);
5135 BUG_ON(wc->refs[level] == 0);
5136
5137 if (level == root_item->drop_level)
5138 break;
5139
5140 btrfs_tree_unlock(path->nodes[level]);
5141 WARN_ON(wc->refs[level] != 1);
5142 level--;
5143 }
4764 } 5144 }
5145
5146 wc->level = level;
5147 wc->shared_level = -1;
5148 wc->stage = DROP_REFERENCE;
5149 wc->update_ref = update_ref;
5150 wc->keep_locks = 0;
5151
4765 while (1) { 5152 while (1) {
4766 unsigned long update; 5153 ret = walk_down_tree(trans, root, path, wc);
4767 wret = walk_down_tree(trans, root, path, &level); 5154 if (ret < 0) {
4768 if (wret > 0) 5155 err = ret;
4769 break; 5156 break;
4770 if (wret < 0) 5157 }
4771 ret = wret;
4772 5158
4773 wret = walk_up_tree(trans, root, path, &level, 5159 ret = walk_up_tree(trans, root, path, wc, BTRFS_MAX_LEVEL);
4774 BTRFS_MAX_LEVEL); 5160 if (ret < 0) {
4775 if (wret > 0) 5161 err = ret;
4776 break; 5162 break;
4777 if (wret < 0) 5163 }
4778 ret = wret; 5164
4779 if (trans->transaction->in_commit || 5165 if (ret > 0) {
4780 trans->transaction->delayed_refs.flushing) { 5166 BUG_ON(wc->stage != DROP_REFERENCE);
4781 ret = -EAGAIN;
4782 break; 5167 break;
4783 } 5168 }
4784 for (update_count = 0; update_count < 16; update_count++) { 5169
5170 if (wc->stage == DROP_REFERENCE) {
5171 level = wc->level;
5172 btrfs_node_key(path->nodes[level],
5173 &root_item->drop_progress,
5174 path->slots[level]);
5175 root_item->drop_level = level;
5176 }
5177
5178 BUG_ON(wc->level == 0);
5179 if (trans->transaction->in_commit ||
5180 trans->transaction->delayed_refs.flushing) {
5181 ret = btrfs_update_root(trans, tree_root,
5182 &root->root_key,
5183 root_item);
5184 BUG_ON(ret);
5185
5186 btrfs_end_transaction(trans, tree_root);
5187 trans = btrfs_start_transaction(tree_root, 1);
5188 } else {
5189 unsigned long update;
4785 update = trans->delayed_ref_updates; 5190 update = trans->delayed_ref_updates;
4786 trans->delayed_ref_updates = 0; 5191 trans->delayed_ref_updates = 0;
4787 if (update) 5192 if (update)
4788 btrfs_run_delayed_refs(trans, root, update); 5193 btrfs_run_delayed_refs(trans, tree_root,
4789 else 5194 update);
4790 break;
4791 } 5195 }
4792 } 5196 }
5197 btrfs_release_path(root, path);
5198 BUG_ON(err);
5199
5200 ret = btrfs_del_root(trans, tree_root, &root->root_key);
5201 BUG_ON(ret);
5202
5203 free_extent_buffer(root->node);
5204 free_extent_buffer(root->commit_root);
5205 kfree(root);
4793out: 5206out:
5207 btrfs_end_transaction(trans, tree_root);
5208 kfree(wc);
4794 btrfs_free_path(path); 5209 btrfs_free_path(path);
4795 return ret; 5210 return err;
4796} 5211}
4797 5212
5213/*
5214 * drop subtree rooted at tree block 'node'.
5215 *
5216 * NOTE: this function will unlock and release tree block 'node'
5217 */
4798int btrfs_drop_subtree(struct btrfs_trans_handle *trans, 5218int btrfs_drop_subtree(struct btrfs_trans_handle *trans,
4799 struct btrfs_root *root, 5219 struct btrfs_root *root,
4800 struct extent_buffer *node, 5220 struct extent_buffer *node,
4801 struct extent_buffer *parent) 5221 struct extent_buffer *parent)
4802{ 5222{
4803 struct btrfs_path *path; 5223 struct btrfs_path *path;
5224 struct walk_control *wc;
4804 int level; 5225 int level;
4805 int parent_level; 5226 int parent_level;
4806 int ret = 0; 5227 int ret = 0;
4807 int wret; 5228 int wret;
4808 5229
5230 BUG_ON(root->root_key.objectid != BTRFS_TREE_RELOC_OBJECTID);
5231
4809 path = btrfs_alloc_path(); 5232 path = btrfs_alloc_path();
4810 BUG_ON(!path); 5233 BUG_ON(!path);
4811 5234
5235 wc = kzalloc(sizeof(*wc), GFP_NOFS);
5236 BUG_ON(!wc);
5237
4812 btrfs_assert_tree_locked(parent); 5238 btrfs_assert_tree_locked(parent);
4813 parent_level = btrfs_header_level(parent); 5239 parent_level = btrfs_header_level(parent);
4814 extent_buffer_get(parent); 5240 extent_buffer_get(parent);
@@ -4817,24 +5243,33 @@ int btrfs_drop_subtree(struct btrfs_trans_handle *trans,
4817 5243
4818 btrfs_assert_tree_locked(node); 5244 btrfs_assert_tree_locked(node);
4819 level = btrfs_header_level(node); 5245 level = btrfs_header_level(node);
4820 extent_buffer_get(node);
4821 path->nodes[level] = node; 5246 path->nodes[level] = node;
4822 path->slots[level] = 0; 5247 path->slots[level] = 0;
5248 path->locks[level] = 1;
5249
5250 wc->refs[parent_level] = 1;
5251 wc->flags[parent_level] = BTRFS_BLOCK_FLAG_FULL_BACKREF;
5252 wc->level = level;
5253 wc->shared_level = -1;
5254 wc->stage = DROP_REFERENCE;
5255 wc->update_ref = 0;
5256 wc->keep_locks = 1;
4823 5257
4824 while (1) { 5258 while (1) {
4825 wret = walk_down_tree(trans, root, path, &level); 5259 wret = walk_down_tree(trans, root, path, wc);
4826 if (wret < 0) 5260 if (wret < 0) {
4827 ret = wret; 5261 ret = wret;
4828 if (wret != 0)
4829 break; 5262 break;
5263 }
4830 5264
4831 wret = walk_up_tree(trans, root, path, &level, parent_level); 5265 wret = walk_up_tree(trans, root, path, wc, parent_level);
4832 if (wret < 0) 5266 if (wret < 0)
4833 ret = wret; 5267 ret = wret;
4834 if (wret != 0) 5268 if (wret != 0)
4835 break; 5269 break;
4836 } 5270 }
4837 5271
5272 kfree(wc);
4838 btrfs_free_path(path); 5273 btrfs_free_path(path);
4839 return ret; 5274 return ret;
4840} 5275}
@@ -6739,11 +7174,16 @@ int btrfs_free_block_groups(struct btrfs_fs_info *info)
6739 &info->block_group_cache_tree); 7174 &info->block_group_cache_tree);
6740 spin_unlock(&info->block_group_cache_lock); 7175 spin_unlock(&info->block_group_cache_lock);
6741 7176
6742 btrfs_remove_free_space_cache(block_group);
6743 down_write(&block_group->space_info->groups_sem); 7177 down_write(&block_group->space_info->groups_sem);
6744 list_del(&block_group->list); 7178 list_del(&block_group->list);
6745 up_write(&block_group->space_info->groups_sem); 7179 up_write(&block_group->space_info->groups_sem);
6746 7180
7181 if (block_group->cached == BTRFS_CACHE_STARTED)
7182 wait_event(block_group->caching_q,
7183 block_group_cache_done(block_group));
7184
7185 btrfs_remove_free_space_cache(block_group);
7186
6747 WARN_ON(atomic_read(&block_group->count) != 1); 7187 WARN_ON(atomic_read(&block_group->count) != 1);
6748 kfree(block_group); 7188 kfree(block_group);
6749 7189
@@ -6809,9 +7249,19 @@ int btrfs_read_block_groups(struct btrfs_root *root)
6809 atomic_set(&cache->count, 1); 7249 atomic_set(&cache->count, 1);
6810 spin_lock_init(&cache->lock); 7250 spin_lock_init(&cache->lock);
6811 spin_lock_init(&cache->tree_lock); 7251 spin_lock_init(&cache->tree_lock);
6812 mutex_init(&cache->cache_mutex); 7252 cache->fs_info = info;
7253 init_waitqueue_head(&cache->caching_q);
6813 INIT_LIST_HEAD(&cache->list); 7254 INIT_LIST_HEAD(&cache->list);
6814 INIT_LIST_HEAD(&cache->cluster_list); 7255 INIT_LIST_HEAD(&cache->cluster_list);
7256
7257 /*
7258 * we only want to have 32k of ram per block group for keeping
7259 * track of free space, and if we pass 1/2 of that we want to
7260 * start converting things over to using bitmaps
7261 */
7262 cache->extents_thresh = ((1024 * 32) / 2) /
7263 sizeof(struct btrfs_free_space);
7264
6815 read_extent_buffer(leaf, &cache->item, 7265 read_extent_buffer(leaf, &cache->item,
6816 btrfs_item_ptr_offset(leaf, path->slots[0]), 7266 btrfs_item_ptr_offset(leaf, path->slots[0]),
6817 sizeof(cache->item)); 7267 sizeof(cache->item));
@@ -6820,6 +7270,26 @@ int btrfs_read_block_groups(struct btrfs_root *root)
6820 key.objectid = found_key.objectid + found_key.offset; 7270 key.objectid = found_key.objectid + found_key.offset;
6821 btrfs_release_path(root, path); 7271 btrfs_release_path(root, path);
6822 cache->flags = btrfs_block_group_flags(&cache->item); 7272 cache->flags = btrfs_block_group_flags(&cache->item);
7273 cache->sectorsize = root->sectorsize;
7274
7275 remove_sb_from_cache(root, cache);
7276
7277 /*
7278 * check for two cases, either we are full, and therefore
7279 * don't need to bother with the caching work since we won't
7280 * find any space, or we are empty, and we can just add all
7281 * the space in and be done with it. This saves us _alot_ of
7282 * time, particularly in the full case.
7283 */
7284 if (found_key.offset == btrfs_block_group_used(&cache->item)) {
7285 cache->cached = BTRFS_CACHE_FINISHED;
7286 } else if (btrfs_block_group_used(&cache->item) == 0) {
7287 cache->cached = BTRFS_CACHE_FINISHED;
7288 add_new_free_space(cache, root->fs_info,
7289 found_key.objectid,
7290 found_key.objectid +
7291 found_key.offset);
7292 }
6823 7293
6824 ret = update_space_info(info, cache->flags, found_key.offset, 7294 ret = update_space_info(info, cache->flags, found_key.offset,
6825 btrfs_block_group_used(&cache->item), 7295 btrfs_block_group_used(&cache->item),
@@ -6863,10 +7333,19 @@ int btrfs_make_block_group(struct btrfs_trans_handle *trans,
6863 cache->key.objectid = chunk_offset; 7333 cache->key.objectid = chunk_offset;
6864 cache->key.offset = size; 7334 cache->key.offset = size;
6865 cache->key.type = BTRFS_BLOCK_GROUP_ITEM_KEY; 7335 cache->key.type = BTRFS_BLOCK_GROUP_ITEM_KEY;
7336 cache->sectorsize = root->sectorsize;
7337
7338 /*
7339 * we only want to have 32k of ram per block group for keeping track
7340 * of free space, and if we pass 1/2 of that we want to start
7341 * converting things over to using bitmaps
7342 */
7343 cache->extents_thresh = ((1024 * 32) / 2) /
7344 sizeof(struct btrfs_free_space);
6866 atomic_set(&cache->count, 1); 7345 atomic_set(&cache->count, 1);
6867 spin_lock_init(&cache->lock); 7346 spin_lock_init(&cache->lock);
6868 spin_lock_init(&cache->tree_lock); 7347 spin_lock_init(&cache->tree_lock);
6869 mutex_init(&cache->cache_mutex); 7348 init_waitqueue_head(&cache->caching_q);
6870 INIT_LIST_HEAD(&cache->list); 7349 INIT_LIST_HEAD(&cache->list);
6871 INIT_LIST_HEAD(&cache->cluster_list); 7350 INIT_LIST_HEAD(&cache->cluster_list);
6872 7351
@@ -6875,6 +7354,12 @@ int btrfs_make_block_group(struct btrfs_trans_handle *trans,
6875 cache->flags = type; 7354 cache->flags = type;
6876 btrfs_set_block_group_flags(&cache->item, type); 7355 btrfs_set_block_group_flags(&cache->item, type);
6877 7356
7357 cache->cached = BTRFS_CACHE_FINISHED;
7358 remove_sb_from_cache(root, cache);
7359
7360 add_new_free_space(cache, root->fs_info, chunk_offset,
7361 chunk_offset + size);
7362
6878 ret = update_space_info(root->fs_info, cache->flags, size, bytes_used, 7363 ret = update_space_info(root->fs_info, cache->flags, size, bytes_used,
6879 &cache->space_info); 7364 &cache->space_info);
6880 BUG_ON(ret); 7365 BUG_ON(ret);
@@ -6933,7 +7418,7 @@ int btrfs_remove_block_group(struct btrfs_trans_handle *trans,
6933 rb_erase(&block_group->cache_node, 7418 rb_erase(&block_group->cache_node,
6934 &root->fs_info->block_group_cache_tree); 7419 &root->fs_info->block_group_cache_tree);
6935 spin_unlock(&root->fs_info->block_group_cache_lock); 7420 spin_unlock(&root->fs_info->block_group_cache_lock);
6936 btrfs_remove_free_space_cache(block_group); 7421
6937 down_write(&block_group->space_info->groups_sem); 7422 down_write(&block_group->space_info->groups_sem);
6938 /* 7423 /*
6939 * we must use list_del_init so people can check to see if they 7424 * we must use list_del_init so people can check to see if they
@@ -6942,11 +7427,18 @@ int btrfs_remove_block_group(struct btrfs_trans_handle *trans,
6942 list_del_init(&block_group->list); 7427 list_del_init(&block_group->list);
6943 up_write(&block_group->space_info->groups_sem); 7428 up_write(&block_group->space_info->groups_sem);
6944 7429
7430 if (block_group->cached == BTRFS_CACHE_STARTED)
7431 wait_event(block_group->caching_q,
7432 block_group_cache_done(block_group));
7433
7434 btrfs_remove_free_space_cache(block_group);
7435
6945 spin_lock(&block_group->space_info->lock); 7436 spin_lock(&block_group->space_info->lock);
6946 block_group->space_info->total_bytes -= block_group->key.offset; 7437 block_group->space_info->total_bytes -= block_group->key.offset;
6947 block_group->space_info->bytes_readonly -= block_group->key.offset; 7438 block_group->space_info->bytes_readonly -= block_group->key.offset;
6948 spin_unlock(&block_group->space_info->lock); 7439 spin_unlock(&block_group->space_info->lock);
6949 block_group->space_info->full = 0; 7440
7441 btrfs_clear_space_info_full(root->fs_info);
6950 7442
6951 btrfs_put_block_group(block_group); 7443 btrfs_put_block_group(block_group);
6952 btrfs_put_block_group(block_group); 7444 btrfs_put_block_group(block_group);
diff --git a/fs/btrfs/file.c b/fs/btrfs/file.c
index 126477eaecf5..4b833972273a 100644
--- a/fs/btrfs/file.c
+++ b/fs/btrfs/file.c
@@ -22,7 +22,6 @@
22#include <linux/time.h> 22#include <linux/time.h>
23#include <linux/init.h> 23#include <linux/init.h>
24#include <linux/string.h> 24#include <linux/string.h>
25#include <linux/smp_lock.h>
26#include <linux/backing-dev.h> 25#include <linux/backing-dev.h>
27#include <linux/mpage.h> 26#include <linux/mpage.h>
28#include <linux/swap.h> 27#include <linux/swap.h>
@@ -151,7 +150,10 @@ static noinline int dirty_and_release_pages(struct btrfs_trans_handle *trans,
151 } 150 }
152 if (end_pos > isize) { 151 if (end_pos > isize) {
153 i_size_write(inode, end_pos); 152 i_size_write(inode, end_pos);
154 btrfs_update_inode(trans, root, inode); 153 /* we've only changed i_size in ram, and we haven't updated
154 * the disk i_size. There is no need to log the inode
155 * at this time.
156 */
155 } 157 }
156 err = btrfs_end_transaction(trans, root); 158 err = btrfs_end_transaction(trans, root);
157out_unlock: 159out_unlock:
diff --git a/fs/btrfs/free-space-cache.c b/fs/btrfs/free-space-cache.c
index 4538e48581a5..5edcee3a617f 100644
--- a/fs/btrfs/free-space-cache.c
+++ b/fs/btrfs/free-space-cache.c
@@ -16,45 +16,46 @@
16 * Boston, MA 021110-1307, USA. 16 * Boston, MA 021110-1307, USA.
17 */ 17 */
18 18
19#include <linux/pagemap.h>
19#include <linux/sched.h> 20#include <linux/sched.h>
21#include <linux/math64.h>
20#include "ctree.h" 22#include "ctree.h"
21#include "free-space-cache.h" 23#include "free-space-cache.h"
22#include "transaction.h" 24#include "transaction.h"
23 25
24struct btrfs_free_space { 26#define BITS_PER_BITMAP (PAGE_CACHE_SIZE * 8)
25 struct rb_node bytes_index; 27#define MAX_CACHE_BYTES_PER_GIG (32 * 1024)
26 struct rb_node offset_index;
27 u64 offset;
28 u64 bytes;
29};
30 28
31static int tree_insert_offset(struct rb_root *root, u64 offset, 29static inline unsigned long offset_to_bit(u64 bitmap_start, u64 sectorsize,
32 struct rb_node *node) 30 u64 offset)
33{ 31{
34 struct rb_node **p = &root->rb_node; 32 BUG_ON(offset < bitmap_start);
35 struct rb_node *parent = NULL; 33 offset -= bitmap_start;
36 struct btrfs_free_space *info; 34 return (unsigned long)(div64_u64(offset, sectorsize));
35}
37 36
38 while (*p) { 37static inline unsigned long bytes_to_bits(u64 bytes, u64 sectorsize)
39 parent = *p; 38{
40 info = rb_entry(parent, struct btrfs_free_space, offset_index); 39 return (unsigned long)(div64_u64(bytes, sectorsize));
40}
41 41
42 if (offset < info->offset) 42static inline u64 offset_to_bitmap(struct btrfs_block_group_cache *block_group,
43 p = &(*p)->rb_left; 43 u64 offset)
44 else if (offset > info->offset) 44{
45 p = &(*p)->rb_right; 45 u64 bitmap_start;
46 else 46 u64 bytes_per_bitmap;
47 return -EEXIST;
48 }
49 47
50 rb_link_node(node, parent, p); 48 bytes_per_bitmap = BITS_PER_BITMAP * block_group->sectorsize;
51 rb_insert_color(node, root); 49 bitmap_start = offset - block_group->key.objectid;
50 bitmap_start = div64_u64(bitmap_start, bytes_per_bitmap);
51 bitmap_start *= bytes_per_bitmap;
52 bitmap_start += block_group->key.objectid;
52 53
53 return 0; 54 return bitmap_start;
54} 55}
55 56
56static int tree_insert_bytes(struct rb_root *root, u64 bytes, 57static int tree_insert_offset(struct rb_root *root, u64 offset,
57 struct rb_node *node) 58 struct rb_node *node, int bitmap)
58{ 59{
59 struct rb_node **p = &root->rb_node; 60 struct rb_node **p = &root->rb_node;
60 struct rb_node *parent = NULL; 61 struct rb_node *parent = NULL;
@@ -62,12 +63,34 @@ static int tree_insert_bytes(struct rb_root *root, u64 bytes,
62 63
63 while (*p) { 64 while (*p) {
64 parent = *p; 65 parent = *p;
65 info = rb_entry(parent, struct btrfs_free_space, bytes_index); 66 info = rb_entry(parent, struct btrfs_free_space, offset_index);
66 67
67 if (bytes < info->bytes) 68 if (offset < info->offset) {
68 p = &(*p)->rb_left; 69 p = &(*p)->rb_left;
69 else 70 } else if (offset > info->offset) {
70 p = &(*p)->rb_right; 71 p = &(*p)->rb_right;
72 } else {
73 /*
74 * we could have a bitmap entry and an extent entry
75 * share the same offset. If this is the case, we want
76 * the extent entry to always be found first if we do a
77 * linear search through the tree, since we want to have
78 * the quickest allocation time, and allocating from an
79 * extent is faster than allocating from a bitmap. So
80 * if we're inserting a bitmap and we find an entry at
81 * this offset, we want to go right, or after this entry
82 * logically. If we are inserting an extent and we've
83 * found a bitmap, we want to go left, or before
84 * logically.
85 */
86 if (bitmap) {
87 WARN_ON(info->bitmap);
88 p = &(*p)->rb_right;
89 } else {
90 WARN_ON(!info->bitmap);
91 p = &(*p)->rb_left;
92 }
93 }
71 } 94 }
72 95
73 rb_link_node(node, parent, p); 96 rb_link_node(node, parent, p);
@@ -79,110 +102,143 @@ static int tree_insert_bytes(struct rb_root *root, u64 bytes,
79/* 102/*
80 * searches the tree for the given offset. 103 * searches the tree for the given offset.
81 * 104 *
82 * fuzzy == 1: this is used for allocations where we are given a hint of where 105 * fuzzy - If this is set, then we are trying to make an allocation, and we just
83 * to look for free space. Because the hint may not be completely on an offset 106 * want a section that has at least bytes size and comes at or after the given
84 * mark, or the hint may no longer point to free space we need to fudge our 107 * offset.
85 * results a bit. So we look for free space starting at or after offset with at
86 * least bytes size. We prefer to find as close to the given offset as we can.
87 * Also if the offset is within a free space range, then we will return the free
88 * space that contains the given offset, which means we can return a free space
89 * chunk with an offset before the provided offset.
90 *
91 * fuzzy == 0: this is just a normal tree search. Give us the free space that
92 * starts at the given offset which is at least bytes size, and if its not there
93 * return NULL.
94 */ 108 */
95static struct btrfs_free_space *tree_search_offset(struct rb_root *root, 109static struct btrfs_free_space *
96 u64 offset, u64 bytes, 110tree_search_offset(struct btrfs_block_group_cache *block_group,
97 int fuzzy) 111 u64 offset, int bitmap_only, int fuzzy)
98{ 112{
99 struct rb_node *n = root->rb_node; 113 struct rb_node *n = block_group->free_space_offset.rb_node;
100 struct btrfs_free_space *entry, *ret = NULL; 114 struct btrfs_free_space *entry, *prev = NULL;
115
116 /* find entry that is closest to the 'offset' */
117 while (1) {
118 if (!n) {
119 entry = NULL;
120 break;
121 }
101 122
102 while (n) {
103 entry = rb_entry(n, struct btrfs_free_space, offset_index); 123 entry = rb_entry(n, struct btrfs_free_space, offset_index);
124 prev = entry;
104 125
105 if (offset < entry->offset) { 126 if (offset < entry->offset)
106 if (fuzzy &&
107 (!ret || entry->offset < ret->offset) &&
108 (bytes <= entry->bytes))
109 ret = entry;
110 n = n->rb_left; 127 n = n->rb_left;
111 } else if (offset > entry->offset) { 128 else if (offset > entry->offset)
112 if (fuzzy &&
113 (entry->offset + entry->bytes - 1) >= offset &&
114 bytes <= entry->bytes) {
115 ret = entry;
116 break;
117 }
118 n = n->rb_right; 129 n = n->rb_right;
119 } else { 130 else
120 if (bytes > entry->bytes) {
121 n = n->rb_right;
122 continue;
123 }
124 ret = entry;
125 break; 131 break;
126 }
127 } 132 }
128 133
129 return ret; 134 if (bitmap_only) {
130} 135 if (!entry)
136 return NULL;
137 if (entry->bitmap)
138 return entry;
131 139
132/* 140 /*
133 * return a chunk at least bytes size, as close to offset that we can get. 141 * bitmap entry and extent entry may share same offset,
134 */ 142 * in that case, bitmap entry comes after extent entry.
135static struct btrfs_free_space *tree_search_bytes(struct rb_root *root, 143 */
136 u64 offset, u64 bytes) 144 n = rb_next(n);
137{ 145 if (!n)
138 struct rb_node *n = root->rb_node; 146 return NULL;
139 struct btrfs_free_space *entry, *ret = NULL; 147 entry = rb_entry(n, struct btrfs_free_space, offset_index);
140 148 if (entry->offset != offset)
141 while (n) { 149 return NULL;
142 entry = rb_entry(n, struct btrfs_free_space, bytes_index);
143 150
144 if (bytes < entry->bytes) { 151 WARN_ON(!entry->bitmap);
152 return entry;
153 } else if (entry) {
154 if (entry->bitmap) {
145 /* 155 /*
146 * We prefer to get a hole size as close to the size we 156 * if previous extent entry covers the offset,
147 * are asking for so we don't take small slivers out of 157 * we should return it instead of the bitmap entry
148 * huge holes, but we also want to get as close to the
149 * offset as possible so we don't have a whole lot of
150 * fragmentation.
151 */ 158 */
152 if (offset <= entry->offset) { 159 n = &entry->offset_index;
153 if (!ret) 160 while (1) {
154 ret = entry; 161 n = rb_prev(n);
155 else if (entry->bytes < ret->bytes) 162 if (!n)
156 ret = entry; 163 break;
157 else if (entry->offset < ret->offset) 164 prev = rb_entry(n, struct btrfs_free_space,
158 ret = entry; 165 offset_index);
166 if (!prev->bitmap) {
167 if (prev->offset + prev->bytes > offset)
168 entry = prev;
169 break;
170 }
159 } 171 }
160 n = n->rb_left; 172 }
161 } else if (bytes > entry->bytes) { 173 return entry;
162 n = n->rb_right; 174 }
175
176 if (!prev)
177 return NULL;
178
179 /* find last entry before the 'offset' */
180 entry = prev;
181 if (entry->offset > offset) {
182 n = rb_prev(&entry->offset_index);
183 if (n) {
184 entry = rb_entry(n, struct btrfs_free_space,
185 offset_index);
186 BUG_ON(entry->offset > offset);
163 } else { 187 } else {
164 /* 188 if (fuzzy)
165 * Ok we may have multiple chunks of the wanted size, 189 return entry;
166 * so we don't want to take the first one we find, we 190 else
167 * want to take the one closest to our given offset, so 191 return NULL;
168 * keep searching just in case theres a better match.
169 */
170 n = n->rb_right;
171 if (offset > entry->offset)
172 continue;
173 else if (!ret || entry->offset < ret->offset)
174 ret = entry;
175 } 192 }
176 } 193 }
177 194
178 return ret; 195 if (entry->bitmap) {
196 n = &entry->offset_index;
197 while (1) {
198 n = rb_prev(n);
199 if (!n)
200 break;
201 prev = rb_entry(n, struct btrfs_free_space,
202 offset_index);
203 if (!prev->bitmap) {
204 if (prev->offset + prev->bytes > offset)
205 return prev;
206 break;
207 }
208 }
209 if (entry->offset + BITS_PER_BITMAP *
210 block_group->sectorsize > offset)
211 return entry;
212 } else if (entry->offset + entry->bytes > offset)
213 return entry;
214
215 if (!fuzzy)
216 return NULL;
217
218 while (1) {
219 if (entry->bitmap) {
220 if (entry->offset + BITS_PER_BITMAP *
221 block_group->sectorsize > offset)
222 break;
223 } else {
224 if (entry->offset + entry->bytes > offset)
225 break;
226 }
227
228 n = rb_next(&entry->offset_index);
229 if (!n)
230 return NULL;
231 entry = rb_entry(n, struct btrfs_free_space, offset_index);
232 }
233 return entry;
179} 234}
180 235
181static void unlink_free_space(struct btrfs_block_group_cache *block_group, 236static void unlink_free_space(struct btrfs_block_group_cache *block_group,
182 struct btrfs_free_space *info) 237 struct btrfs_free_space *info)
183{ 238{
184 rb_erase(&info->offset_index, &block_group->free_space_offset); 239 rb_erase(&info->offset_index, &block_group->free_space_offset);
185 rb_erase(&info->bytes_index, &block_group->free_space_bytes); 240 block_group->free_extents--;
241 block_group->free_space -= info->bytes;
186} 242}
187 243
188static int link_free_space(struct btrfs_block_group_cache *block_group, 244static int link_free_space(struct btrfs_block_group_cache *block_group,
@@ -190,17 +246,353 @@ static int link_free_space(struct btrfs_block_group_cache *block_group,
190{ 246{
191 int ret = 0; 247 int ret = 0;
192 248
193 249 BUG_ON(!info->bitmap && !info->bytes);
194 BUG_ON(!info->bytes);
195 ret = tree_insert_offset(&block_group->free_space_offset, info->offset, 250 ret = tree_insert_offset(&block_group->free_space_offset, info->offset,
196 &info->offset_index); 251 &info->offset_index, (info->bitmap != NULL));
197 if (ret) 252 if (ret)
198 return ret; 253 return ret;
199 254
200 ret = tree_insert_bytes(&block_group->free_space_bytes, info->bytes, 255 block_group->free_space += info->bytes;
201 &info->bytes_index); 256 block_group->free_extents++;
202 if (ret) 257 return ret;
203 return ret; 258}
259
260static void recalculate_thresholds(struct btrfs_block_group_cache *block_group)
261{
262 u64 max_bytes, possible_bytes;
263
264 /*
265 * The goal is to keep the total amount of memory used per 1gb of space
266 * at or below 32k, so we need to adjust how much memory we allow to be
267 * used by extent based free space tracking
268 */
269 max_bytes = MAX_CACHE_BYTES_PER_GIG *
270 (div64_u64(block_group->key.offset, 1024 * 1024 * 1024));
271
272 possible_bytes = (block_group->total_bitmaps * PAGE_CACHE_SIZE) +
273 (sizeof(struct btrfs_free_space) *
274 block_group->extents_thresh);
275
276 if (possible_bytes > max_bytes) {
277 int extent_bytes = max_bytes -
278 (block_group->total_bitmaps * PAGE_CACHE_SIZE);
279
280 if (extent_bytes <= 0) {
281 block_group->extents_thresh = 0;
282 return;
283 }
284
285 block_group->extents_thresh = extent_bytes /
286 (sizeof(struct btrfs_free_space));
287 }
288}
289
290static void bitmap_clear_bits(struct btrfs_block_group_cache *block_group,
291 struct btrfs_free_space *info, u64 offset,
292 u64 bytes)
293{
294 unsigned long start, end;
295 unsigned long i;
296
297 start = offset_to_bit(info->offset, block_group->sectorsize, offset);
298 end = start + bytes_to_bits(bytes, block_group->sectorsize);
299 BUG_ON(end > BITS_PER_BITMAP);
300
301 for (i = start; i < end; i++)
302 clear_bit(i, info->bitmap);
303
304 info->bytes -= bytes;
305 block_group->free_space -= bytes;
306}
307
308static void bitmap_set_bits(struct btrfs_block_group_cache *block_group,
309 struct btrfs_free_space *info, u64 offset,
310 u64 bytes)
311{
312 unsigned long start, end;
313 unsigned long i;
314
315 start = offset_to_bit(info->offset, block_group->sectorsize, offset);
316 end = start + bytes_to_bits(bytes, block_group->sectorsize);
317 BUG_ON(end > BITS_PER_BITMAP);
318
319 for (i = start; i < end; i++)
320 set_bit(i, info->bitmap);
321
322 info->bytes += bytes;
323 block_group->free_space += bytes;
324}
325
326static int search_bitmap(struct btrfs_block_group_cache *block_group,
327 struct btrfs_free_space *bitmap_info, u64 *offset,
328 u64 *bytes)
329{
330 unsigned long found_bits = 0;
331 unsigned long bits, i;
332 unsigned long next_zero;
333
334 i = offset_to_bit(bitmap_info->offset, block_group->sectorsize,
335 max_t(u64, *offset, bitmap_info->offset));
336 bits = bytes_to_bits(*bytes, block_group->sectorsize);
337
338 for (i = find_next_bit(bitmap_info->bitmap, BITS_PER_BITMAP, i);
339 i < BITS_PER_BITMAP;
340 i = find_next_bit(bitmap_info->bitmap, BITS_PER_BITMAP, i + 1)) {
341 next_zero = find_next_zero_bit(bitmap_info->bitmap,
342 BITS_PER_BITMAP, i);
343 if ((next_zero - i) >= bits) {
344 found_bits = next_zero - i;
345 break;
346 }
347 i = next_zero;
348 }
349
350 if (found_bits) {
351 *offset = (u64)(i * block_group->sectorsize) +
352 bitmap_info->offset;
353 *bytes = (u64)(found_bits) * block_group->sectorsize;
354 return 0;
355 }
356
357 return -1;
358}
359
360static struct btrfs_free_space *find_free_space(struct btrfs_block_group_cache
361 *block_group, u64 *offset,
362 u64 *bytes, int debug)
363{
364 struct btrfs_free_space *entry;
365 struct rb_node *node;
366 int ret;
367
368 if (!block_group->free_space_offset.rb_node)
369 return NULL;
370
371 entry = tree_search_offset(block_group,
372 offset_to_bitmap(block_group, *offset),
373 0, 1);
374 if (!entry)
375 return NULL;
376
377 for (node = &entry->offset_index; node; node = rb_next(node)) {
378 entry = rb_entry(node, struct btrfs_free_space, offset_index);
379 if (entry->bytes < *bytes)
380 continue;
381
382 if (entry->bitmap) {
383 ret = search_bitmap(block_group, entry, offset, bytes);
384 if (!ret)
385 return entry;
386 continue;
387 }
388
389 *offset = entry->offset;
390 *bytes = entry->bytes;
391 return entry;
392 }
393
394 return NULL;
395}
396
397static void add_new_bitmap(struct btrfs_block_group_cache *block_group,
398 struct btrfs_free_space *info, u64 offset)
399{
400 u64 bytes_per_bg = BITS_PER_BITMAP * block_group->sectorsize;
401 int max_bitmaps = (int)div64_u64(block_group->key.offset +
402 bytes_per_bg - 1, bytes_per_bg);
403 BUG_ON(block_group->total_bitmaps >= max_bitmaps);
404
405 info->offset = offset_to_bitmap(block_group, offset);
406 link_free_space(block_group, info);
407 block_group->total_bitmaps++;
408
409 recalculate_thresholds(block_group);
410}
411
412static noinline int remove_from_bitmap(struct btrfs_block_group_cache *block_group,
413 struct btrfs_free_space *bitmap_info,
414 u64 *offset, u64 *bytes)
415{
416 u64 end;
417 u64 search_start, search_bytes;
418 int ret;
419
420again:
421 end = bitmap_info->offset +
422 (u64)(BITS_PER_BITMAP * block_group->sectorsize) - 1;
423
424 /*
425 * XXX - this can go away after a few releases.
426 *
427 * since the only user of btrfs_remove_free_space is the tree logging
428 * stuff, and the only way to test that is under crash conditions, we
429 * want to have this debug stuff here just in case somethings not
430 * working. Search the bitmap for the space we are trying to use to
431 * make sure its actually there. If its not there then we need to stop
432 * because something has gone wrong.
433 */
434 search_start = *offset;
435 search_bytes = *bytes;
436 ret = search_bitmap(block_group, bitmap_info, &search_start,
437 &search_bytes);
438 BUG_ON(ret < 0 || search_start != *offset);
439
440 if (*offset > bitmap_info->offset && *offset + *bytes > end) {
441 bitmap_clear_bits(block_group, bitmap_info, *offset,
442 end - *offset + 1);
443 *bytes -= end - *offset + 1;
444 *offset = end + 1;
445 } else if (*offset >= bitmap_info->offset && *offset + *bytes <= end) {
446 bitmap_clear_bits(block_group, bitmap_info, *offset, *bytes);
447 *bytes = 0;
448 }
449
450 if (*bytes) {
451 struct rb_node *next = rb_next(&bitmap_info->offset_index);
452 if (!bitmap_info->bytes) {
453 unlink_free_space(block_group, bitmap_info);
454 kfree(bitmap_info->bitmap);
455 kfree(bitmap_info);
456 block_group->total_bitmaps--;
457 recalculate_thresholds(block_group);
458 }
459
460 /*
461 * no entry after this bitmap, but we still have bytes to
462 * remove, so something has gone wrong.
463 */
464 if (!next)
465 return -EINVAL;
466
467 bitmap_info = rb_entry(next, struct btrfs_free_space,
468 offset_index);
469
470 /*
471 * if the next entry isn't a bitmap we need to return to let the
472 * extent stuff do its work.
473 */
474 if (!bitmap_info->bitmap)
475 return -EAGAIN;
476
477 /*
478 * Ok the next item is a bitmap, but it may not actually hold
479 * the information for the rest of this free space stuff, so
480 * look for it, and if we don't find it return so we can try
481 * everything over again.
482 */
483 search_start = *offset;
484 search_bytes = *bytes;
485 ret = search_bitmap(block_group, bitmap_info, &search_start,
486 &search_bytes);
487 if (ret < 0 || search_start != *offset)
488 return -EAGAIN;
489
490 goto again;
491 } else if (!bitmap_info->bytes) {
492 unlink_free_space(block_group, bitmap_info);
493 kfree(bitmap_info->bitmap);
494 kfree(bitmap_info);
495 block_group->total_bitmaps--;
496 recalculate_thresholds(block_group);
497 }
498
499 return 0;
500}
501
502static int insert_into_bitmap(struct btrfs_block_group_cache *block_group,
503 struct btrfs_free_space *info)
504{
505 struct btrfs_free_space *bitmap_info;
506 int added = 0;
507 u64 bytes, offset, end;
508 int ret;
509
510 /*
511 * If we are below the extents threshold then we can add this as an
512 * extent, and don't have to deal with the bitmap
513 */
514 if (block_group->free_extents < block_group->extents_thresh &&
515 info->bytes > block_group->sectorsize * 4)
516 return 0;
517
518 /*
519 * some block groups are so tiny they can't be enveloped by a bitmap, so
520 * don't even bother to create a bitmap for this
521 */
522 if (BITS_PER_BITMAP * block_group->sectorsize >
523 block_group->key.offset)
524 return 0;
525
526 bytes = info->bytes;
527 offset = info->offset;
528
529again:
530 bitmap_info = tree_search_offset(block_group,
531 offset_to_bitmap(block_group, offset),
532 1, 0);
533 if (!bitmap_info) {
534 BUG_ON(added);
535 goto new_bitmap;
536 }
537
538 end = bitmap_info->offset +
539 (u64)(BITS_PER_BITMAP * block_group->sectorsize);
540
541 if (offset >= bitmap_info->offset && offset + bytes > end) {
542 bitmap_set_bits(block_group, bitmap_info, offset,
543 end - offset);
544 bytes -= end - offset;
545 offset = end;
546 added = 0;
547 } else if (offset >= bitmap_info->offset && offset + bytes <= end) {
548 bitmap_set_bits(block_group, bitmap_info, offset, bytes);
549 bytes = 0;
550 } else {
551 BUG();
552 }
553
554 if (!bytes) {
555 ret = 1;
556 goto out;
557 } else
558 goto again;
559
560new_bitmap:
561 if (info && info->bitmap) {
562 add_new_bitmap(block_group, info, offset);
563 added = 1;
564 info = NULL;
565 goto again;
566 } else {
567 spin_unlock(&block_group->tree_lock);
568
569 /* no pre-allocated info, allocate a new one */
570 if (!info) {
571 info = kzalloc(sizeof(struct btrfs_free_space),
572 GFP_NOFS);
573 if (!info) {
574 spin_lock(&block_group->tree_lock);
575 ret = -ENOMEM;
576 goto out;
577 }
578 }
579
580 /* allocate the bitmap */
581 info->bitmap = kzalloc(PAGE_CACHE_SIZE, GFP_NOFS);
582 spin_lock(&block_group->tree_lock);
583 if (!info->bitmap) {
584 ret = -ENOMEM;
585 goto out;
586 }
587 goto again;
588 }
589
590out:
591 if (info) {
592 if (info->bitmap)
593 kfree(info->bitmap);
594 kfree(info);
595 }
204 596
205 return ret; 597 return ret;
206} 598}
@@ -208,8 +600,8 @@ static int link_free_space(struct btrfs_block_group_cache *block_group,
208int btrfs_add_free_space(struct btrfs_block_group_cache *block_group, 600int btrfs_add_free_space(struct btrfs_block_group_cache *block_group,
209 u64 offset, u64 bytes) 601 u64 offset, u64 bytes)
210{ 602{
211 struct btrfs_free_space *right_info; 603 struct btrfs_free_space *right_info = NULL;
212 struct btrfs_free_space *left_info; 604 struct btrfs_free_space *left_info = NULL;
213 struct btrfs_free_space *info = NULL; 605 struct btrfs_free_space *info = NULL;
214 int ret = 0; 606 int ret = 0;
215 607
@@ -227,18 +619,38 @@ int btrfs_add_free_space(struct btrfs_block_group_cache *block_group,
227 * are adding, if there is remove that struct and add a new one to 619 * are adding, if there is remove that struct and add a new one to
228 * cover the entire range 620 * cover the entire range
229 */ 621 */
230 right_info = tree_search_offset(&block_group->free_space_offset, 622 right_info = tree_search_offset(block_group, offset + bytes, 0, 0);
231 offset+bytes, 0, 0); 623 if (right_info && rb_prev(&right_info->offset_index))
232 left_info = tree_search_offset(&block_group->free_space_offset, 624 left_info = rb_entry(rb_prev(&right_info->offset_index),
233 offset-1, 0, 1); 625 struct btrfs_free_space, offset_index);
626 else
627 left_info = tree_search_offset(block_group, offset - 1, 0, 0);
628
629 /*
630 * If there was no extent directly to the left or right of this new
631 * extent then we know we're going to have to allocate a new extent, so
632 * before we do that see if we need to drop this into a bitmap
633 */
634 if ((!left_info || left_info->bitmap) &&
635 (!right_info || right_info->bitmap)) {
636 ret = insert_into_bitmap(block_group, info);
637
638 if (ret < 0) {
639 goto out;
640 } else if (ret) {
641 ret = 0;
642 goto out;
643 }
644 }
234 645
235 if (right_info) { 646 if (right_info && !right_info->bitmap) {
236 unlink_free_space(block_group, right_info); 647 unlink_free_space(block_group, right_info);
237 info->bytes += right_info->bytes; 648 info->bytes += right_info->bytes;
238 kfree(right_info); 649 kfree(right_info);
239 } 650 }
240 651
241 if (left_info && left_info->offset + left_info->bytes == offset) { 652 if (left_info && !left_info->bitmap &&
653 left_info->offset + left_info->bytes == offset) {
242 unlink_free_space(block_group, left_info); 654 unlink_free_space(block_group, left_info);
243 info->offset = left_info->offset; 655 info->offset = left_info->offset;
244 info->bytes += left_info->bytes; 656 info->bytes += left_info->bytes;
@@ -248,11 +660,11 @@ int btrfs_add_free_space(struct btrfs_block_group_cache *block_group,
248 ret = link_free_space(block_group, info); 660 ret = link_free_space(block_group, info);
249 if (ret) 661 if (ret)
250 kfree(info); 662 kfree(info);
251 663out:
252 spin_unlock(&block_group->tree_lock); 664 spin_unlock(&block_group->tree_lock);
253 665
254 if (ret) { 666 if (ret) {
255 printk(KERN_ERR "btrfs: unable to add free space :%d\n", ret); 667 printk(KERN_CRIT "btrfs: unable to add free space :%d\n", ret);
256 BUG_ON(ret == -EEXIST); 668 BUG_ON(ret == -EEXIST);
257 } 669 }
258 670
@@ -263,40 +675,74 @@ int btrfs_remove_free_space(struct btrfs_block_group_cache *block_group,
263 u64 offset, u64 bytes) 675 u64 offset, u64 bytes)
264{ 676{
265 struct btrfs_free_space *info; 677 struct btrfs_free_space *info;
678 struct btrfs_free_space *next_info = NULL;
266 int ret = 0; 679 int ret = 0;
267 680
268 spin_lock(&block_group->tree_lock); 681 spin_lock(&block_group->tree_lock);
269 682
270 info = tree_search_offset(&block_group->free_space_offset, offset, 0, 683again:
271 1); 684 info = tree_search_offset(block_group, offset, 0, 0);
272 if (info && info->offset == offset) { 685 if (!info) {
273 if (info->bytes < bytes) { 686 /*
274 printk(KERN_ERR "Found free space at %llu, size %llu," 687 * oops didn't find an extent that matched the space we wanted
275 "trying to use %llu\n", 688 * to remove, look for a bitmap instead
276 (unsigned long long)info->offset, 689 */
277 (unsigned long long)info->bytes, 690 info = tree_search_offset(block_group,
278 (unsigned long long)bytes); 691 offset_to_bitmap(block_group, offset),
692 1, 0);
693 if (!info) {
694 WARN_ON(1);
695 goto out_lock;
696 }
697 }
698
699 if (info->bytes < bytes && rb_next(&info->offset_index)) {
700 u64 end;
701 next_info = rb_entry(rb_next(&info->offset_index),
702 struct btrfs_free_space,
703 offset_index);
704
705 if (next_info->bitmap)
706 end = next_info->offset + BITS_PER_BITMAP *
707 block_group->sectorsize - 1;
708 else
709 end = next_info->offset + next_info->bytes;
710
711 if (next_info->bytes < bytes ||
712 next_info->offset > offset || offset > end) {
713 printk(KERN_CRIT "Found free space at %llu, size %llu,"
714 " trying to use %llu\n",
715 (unsigned long long)info->offset,
716 (unsigned long long)info->bytes,
717 (unsigned long long)bytes);
279 WARN_ON(1); 718 WARN_ON(1);
280 ret = -EINVAL; 719 ret = -EINVAL;
281 spin_unlock(&block_group->tree_lock); 720 goto out_lock;
282 goto out;
283 } 721 }
284 unlink_free_space(block_group, info);
285 722
286 if (info->bytes == bytes) { 723 info = next_info;
287 kfree(info); 724 }
288 spin_unlock(&block_group->tree_lock); 725
289 goto out; 726 if (info->bytes == bytes) {
727 unlink_free_space(block_group, info);
728 if (info->bitmap) {
729 kfree(info->bitmap);
730 block_group->total_bitmaps--;
290 } 731 }
732 kfree(info);
733 goto out_lock;
734 }
291 735
736 if (!info->bitmap && info->offset == offset) {
737 unlink_free_space(block_group, info);
292 info->offset += bytes; 738 info->offset += bytes;
293 info->bytes -= bytes; 739 info->bytes -= bytes;
740 link_free_space(block_group, info);
741 goto out_lock;
742 }
294 743
295 ret = link_free_space(block_group, info); 744 if (!info->bitmap && info->offset <= offset &&
296 spin_unlock(&block_group->tree_lock); 745 info->offset + info->bytes >= offset + bytes) {
297 BUG_ON(ret);
298 } else if (info && info->offset < offset &&
299 info->offset + info->bytes >= offset + bytes) {
300 u64 old_start = info->offset; 746 u64 old_start = info->offset;
301 /* 747 /*
302 * we're freeing space in the middle of the info, 748 * we're freeing space in the middle of the info,
@@ -312,7 +758,9 @@ int btrfs_remove_free_space(struct btrfs_block_group_cache *block_group,
312 info->offset = offset + bytes; 758 info->offset = offset + bytes;
313 info->bytes = old_end - info->offset; 759 info->bytes = old_end - info->offset;
314 ret = link_free_space(block_group, info); 760 ret = link_free_space(block_group, info);
315 BUG_ON(ret); 761 WARN_ON(ret);
762 if (ret)
763 goto out_lock;
316 } else { 764 } else {
317 /* the hole we're creating ends at the end 765 /* the hole we're creating ends at the end
318 * of the info struct, just free the info 766 * of the info struct, just free the info
@@ -320,32 +768,22 @@ int btrfs_remove_free_space(struct btrfs_block_group_cache *block_group,
320 kfree(info); 768 kfree(info);
321 } 769 }
322 spin_unlock(&block_group->tree_lock); 770 spin_unlock(&block_group->tree_lock);
323 /* step two, insert a new info struct to cover anything 771
324 * before the hole 772 /* step two, insert a new info struct to cover
773 * anything before the hole
325 */ 774 */
326 ret = btrfs_add_free_space(block_group, old_start, 775 ret = btrfs_add_free_space(block_group, old_start,
327 offset - old_start); 776 offset - old_start);
328 BUG_ON(ret); 777 WARN_ON(ret);
329 } else { 778 goto out;
330 spin_unlock(&block_group->tree_lock);
331 if (!info) {
332 printk(KERN_ERR "couldn't find space %llu to free\n",
333 (unsigned long long)offset);
334 printk(KERN_ERR "cached is %d, offset %llu bytes %llu\n",
335 block_group->cached,
336 (unsigned long long)block_group->key.objectid,
337 (unsigned long long)block_group->key.offset);
338 btrfs_dump_free_space(block_group, bytes);
339 } else if (info) {
340 printk(KERN_ERR "hmm, found offset=%llu bytes=%llu, "
341 "but wanted offset=%llu bytes=%llu\n",
342 (unsigned long long)info->offset,
343 (unsigned long long)info->bytes,
344 (unsigned long long)offset,
345 (unsigned long long)bytes);
346 }
347 WARN_ON(1);
348 } 779 }
780
781 ret = remove_from_bitmap(block_group, info, &offset, &bytes);
782 if (ret == -EAGAIN)
783 goto again;
784 BUG_ON(ret);
785out_lock:
786 spin_unlock(&block_group->tree_lock);
349out: 787out:
350 return ret; 788 return ret;
351} 789}
@@ -361,10 +799,13 @@ void btrfs_dump_free_space(struct btrfs_block_group_cache *block_group,
361 info = rb_entry(n, struct btrfs_free_space, offset_index); 799 info = rb_entry(n, struct btrfs_free_space, offset_index);
362 if (info->bytes >= bytes) 800 if (info->bytes >= bytes)
363 count++; 801 count++;
364 printk(KERN_ERR "entry offset %llu, bytes %llu\n", 802 printk(KERN_CRIT "entry offset %llu, bytes %llu, bitmap %s\n",
365 (unsigned long long)info->offset, 803 (unsigned long long)info->offset,
366 (unsigned long long)info->bytes); 804 (unsigned long long)info->bytes,
805 (info->bitmap) ? "yes" : "no");
367 } 806 }
807 printk(KERN_INFO "block group has cluster?: %s\n",
808 list_empty(&block_group->cluster_list) ? "no" : "yes");
368 printk(KERN_INFO "%d blocks of free space at or bigger than bytes is" 809 printk(KERN_INFO "%d blocks of free space at or bigger than bytes is"
369 "\n", count); 810 "\n", count);
370} 811}
@@ -397,26 +838,35 @@ __btrfs_return_cluster_to_free_space(
397{ 838{
398 struct btrfs_free_space *entry; 839 struct btrfs_free_space *entry;
399 struct rb_node *node; 840 struct rb_node *node;
841 bool bitmap;
400 842
401 spin_lock(&cluster->lock); 843 spin_lock(&cluster->lock);
402 if (cluster->block_group != block_group) 844 if (cluster->block_group != block_group)
403 goto out; 845 goto out;
404 846
847 bitmap = cluster->points_to_bitmap;
848 cluster->block_group = NULL;
405 cluster->window_start = 0; 849 cluster->window_start = 0;
850 list_del_init(&cluster->block_group_list);
851 cluster->points_to_bitmap = false;
852
853 if (bitmap)
854 goto out;
855
406 node = rb_first(&cluster->root); 856 node = rb_first(&cluster->root);
407 while(node) { 857 while (node) {
408 entry = rb_entry(node, struct btrfs_free_space, offset_index); 858 entry = rb_entry(node, struct btrfs_free_space, offset_index);
409 node = rb_next(&entry->offset_index); 859 node = rb_next(&entry->offset_index);
410 rb_erase(&entry->offset_index, &cluster->root); 860 rb_erase(&entry->offset_index, &cluster->root);
411 link_free_space(block_group, entry); 861 BUG_ON(entry->bitmap);
862 tree_insert_offset(&block_group->free_space_offset,
863 entry->offset, &entry->offset_index, 0);
412 } 864 }
413 list_del_init(&cluster->block_group_list);
414
415 btrfs_put_block_group(cluster->block_group);
416 cluster->block_group = NULL;
417 cluster->root.rb_node = NULL; 865 cluster->root.rb_node = NULL;
866
418out: 867out:
419 spin_unlock(&cluster->lock); 868 spin_unlock(&cluster->lock);
869 btrfs_put_block_group(block_group);
420 return 0; 870 return 0;
421} 871}
422 872
@@ -425,20 +875,28 @@ void btrfs_remove_free_space_cache(struct btrfs_block_group_cache *block_group)
425 struct btrfs_free_space *info; 875 struct btrfs_free_space *info;
426 struct rb_node *node; 876 struct rb_node *node;
427 struct btrfs_free_cluster *cluster; 877 struct btrfs_free_cluster *cluster;
428 struct btrfs_free_cluster *safe; 878 struct list_head *head;
429 879
430 spin_lock(&block_group->tree_lock); 880 spin_lock(&block_group->tree_lock);
431 881 while ((head = block_group->cluster_list.next) !=
432 list_for_each_entry_safe(cluster, safe, &block_group->cluster_list, 882 &block_group->cluster_list) {
433 block_group_list) { 883 cluster = list_entry(head, struct btrfs_free_cluster,
884 block_group_list);
434 885
435 WARN_ON(cluster->block_group != block_group); 886 WARN_ON(cluster->block_group != block_group);
436 __btrfs_return_cluster_to_free_space(block_group, cluster); 887 __btrfs_return_cluster_to_free_space(block_group, cluster);
888 if (need_resched()) {
889 spin_unlock(&block_group->tree_lock);
890 cond_resched();
891 spin_lock(&block_group->tree_lock);
892 }
437 } 893 }
438 894
439 while ((node = rb_last(&block_group->free_space_bytes)) != NULL) { 895 while ((node = rb_last(&block_group->free_space_offset)) != NULL) {
440 info = rb_entry(node, struct btrfs_free_space, bytes_index); 896 info = rb_entry(node, struct btrfs_free_space, offset_index);
441 unlink_free_space(block_group, info); 897 unlink_free_space(block_group, info);
898 if (info->bitmap)
899 kfree(info->bitmap);
442 kfree(info); 900 kfree(info);
443 if (need_resched()) { 901 if (need_resched()) {
444 spin_unlock(&block_group->tree_lock); 902 spin_unlock(&block_group->tree_lock);
@@ -446,6 +904,7 @@ void btrfs_remove_free_space_cache(struct btrfs_block_group_cache *block_group)
446 spin_lock(&block_group->tree_lock); 904 spin_lock(&block_group->tree_lock);
447 } 905 }
448 } 906 }
907
449 spin_unlock(&block_group->tree_lock); 908 spin_unlock(&block_group->tree_lock);
450} 909}
451 910
@@ -453,25 +912,35 @@ u64 btrfs_find_space_for_alloc(struct btrfs_block_group_cache *block_group,
453 u64 offset, u64 bytes, u64 empty_size) 912 u64 offset, u64 bytes, u64 empty_size)
454{ 913{
455 struct btrfs_free_space *entry = NULL; 914 struct btrfs_free_space *entry = NULL;
915 u64 bytes_search = bytes + empty_size;
456 u64 ret = 0; 916 u64 ret = 0;
457 917
458 spin_lock(&block_group->tree_lock); 918 spin_lock(&block_group->tree_lock);
459 entry = tree_search_offset(&block_group->free_space_offset, offset, 919 entry = find_free_space(block_group, &offset, &bytes_search, 0);
460 bytes + empty_size, 1);
461 if (!entry) 920 if (!entry)
462 entry = tree_search_bytes(&block_group->free_space_bytes, 921 goto out;
463 offset, bytes + empty_size); 922
464 if (entry) { 923 ret = offset;
924 if (entry->bitmap) {
925 bitmap_clear_bits(block_group, entry, offset, bytes);
926 if (!entry->bytes) {
927 unlink_free_space(block_group, entry);
928 kfree(entry->bitmap);
929 kfree(entry);
930 block_group->total_bitmaps--;
931 recalculate_thresholds(block_group);
932 }
933 } else {
465 unlink_free_space(block_group, entry); 934 unlink_free_space(block_group, entry);
466 ret = entry->offset;
467 entry->offset += bytes; 935 entry->offset += bytes;
468 entry->bytes -= bytes; 936 entry->bytes -= bytes;
469
470 if (!entry->bytes) 937 if (!entry->bytes)
471 kfree(entry); 938 kfree(entry);
472 else 939 else
473 link_free_space(block_group, entry); 940 link_free_space(block_group, entry);
474 } 941 }
942
943out:
475 spin_unlock(&block_group->tree_lock); 944 spin_unlock(&block_group->tree_lock);
476 945
477 return ret; 946 return ret;
@@ -517,6 +986,54 @@ int btrfs_return_cluster_to_free_space(
517 return ret; 986 return ret;
518} 987}
519 988
989static u64 btrfs_alloc_from_bitmap(struct btrfs_block_group_cache *block_group,
990 struct btrfs_free_cluster *cluster,
991 u64 bytes, u64 min_start)
992{
993 struct btrfs_free_space *entry;
994 int err;
995 u64 search_start = cluster->window_start;
996 u64 search_bytes = bytes;
997 u64 ret = 0;
998
999 spin_lock(&block_group->tree_lock);
1000 spin_lock(&cluster->lock);
1001
1002 if (!cluster->points_to_bitmap)
1003 goto out;
1004
1005 if (cluster->block_group != block_group)
1006 goto out;
1007
1008 /*
1009 * search_start is the beginning of the bitmap, but at some point it may
1010 * be a good idea to point to the actual start of the free area in the
1011 * bitmap, so do the offset_to_bitmap trick anyway, and set bitmap_only
1012 * to 1 to make sure we get the bitmap entry
1013 */
1014 entry = tree_search_offset(block_group,
1015 offset_to_bitmap(block_group, search_start),
1016 1, 0);
1017 if (!entry || !entry->bitmap)
1018 goto out;
1019
1020 search_start = min_start;
1021 search_bytes = bytes;
1022
1023 err = search_bitmap(block_group, entry, &search_start,
1024 &search_bytes);
1025 if (err)
1026 goto out;
1027
1028 ret = search_start;
1029 bitmap_clear_bits(block_group, entry, ret, bytes);
1030out:
1031 spin_unlock(&cluster->lock);
1032 spin_unlock(&block_group->tree_lock);
1033
1034 return ret;
1035}
1036
520/* 1037/*
521 * given a cluster, try to allocate 'bytes' from it, returns 0 1038 * given a cluster, try to allocate 'bytes' from it, returns 0
522 * if it couldn't find anything suitably large, or a logical disk offset 1039 * if it couldn't find anything suitably large, or a logical disk offset
@@ -530,6 +1047,10 @@ u64 btrfs_alloc_from_cluster(struct btrfs_block_group_cache *block_group,
530 struct rb_node *node; 1047 struct rb_node *node;
531 u64 ret = 0; 1048 u64 ret = 0;
532 1049
1050 if (cluster->points_to_bitmap)
1051 return btrfs_alloc_from_bitmap(block_group, cluster, bytes,
1052 min_start);
1053
533 spin_lock(&cluster->lock); 1054 spin_lock(&cluster->lock);
534 if (bytes > cluster->max_size) 1055 if (bytes > cluster->max_size)
535 goto out; 1056 goto out;
@@ -567,9 +1088,73 @@ u64 btrfs_alloc_from_cluster(struct btrfs_block_group_cache *block_group,
567 } 1088 }
568out: 1089out:
569 spin_unlock(&cluster->lock); 1090 spin_unlock(&cluster->lock);
1091
570 return ret; 1092 return ret;
571} 1093}
572 1094
1095static int btrfs_bitmap_cluster(struct btrfs_block_group_cache *block_group,
1096 struct btrfs_free_space *entry,
1097 struct btrfs_free_cluster *cluster,
1098 u64 offset, u64 bytes, u64 min_bytes)
1099{
1100 unsigned long next_zero;
1101 unsigned long i;
1102 unsigned long search_bits;
1103 unsigned long total_bits;
1104 unsigned long found_bits;
1105 unsigned long start = 0;
1106 unsigned long total_found = 0;
1107 bool found = false;
1108
1109 i = offset_to_bit(entry->offset, block_group->sectorsize,
1110 max_t(u64, offset, entry->offset));
1111 search_bits = bytes_to_bits(min_bytes, block_group->sectorsize);
1112 total_bits = bytes_to_bits(bytes, block_group->sectorsize);
1113
1114again:
1115 found_bits = 0;
1116 for (i = find_next_bit(entry->bitmap, BITS_PER_BITMAP, i);
1117 i < BITS_PER_BITMAP;
1118 i = find_next_bit(entry->bitmap, BITS_PER_BITMAP, i + 1)) {
1119 next_zero = find_next_zero_bit(entry->bitmap,
1120 BITS_PER_BITMAP, i);
1121 if (next_zero - i >= search_bits) {
1122 found_bits = next_zero - i;
1123 break;
1124 }
1125 i = next_zero;
1126 }
1127
1128 if (!found_bits)
1129 return -1;
1130
1131 if (!found) {
1132 start = i;
1133 found = true;
1134 }
1135
1136 total_found += found_bits;
1137
1138 if (cluster->max_size < found_bits * block_group->sectorsize)
1139 cluster->max_size = found_bits * block_group->sectorsize;
1140
1141 if (total_found < total_bits) {
1142 i = find_next_bit(entry->bitmap, BITS_PER_BITMAP, next_zero);
1143 if (i - start > total_bits * 2) {
1144 total_found = 0;
1145 cluster->max_size = 0;
1146 found = false;
1147 }
1148 goto again;
1149 }
1150
1151 cluster->window_start = start * block_group->sectorsize +
1152 entry->offset;
1153 cluster->points_to_bitmap = true;
1154
1155 return 0;
1156}
1157
573/* 1158/*
574 * here we try to find a cluster of blocks in a block group. The goal 1159 * here we try to find a cluster of blocks in a block group. The goal
575 * is to find at least bytes free and up to empty_size + bytes free. 1160 * is to find at least bytes free and up to empty_size + bytes free.
@@ -587,12 +1172,12 @@ int btrfs_find_space_cluster(struct btrfs_trans_handle *trans,
587 struct btrfs_free_space *entry = NULL; 1172 struct btrfs_free_space *entry = NULL;
588 struct rb_node *node; 1173 struct rb_node *node;
589 struct btrfs_free_space *next; 1174 struct btrfs_free_space *next;
590 struct btrfs_free_space *last; 1175 struct btrfs_free_space *last = NULL;
591 u64 min_bytes; 1176 u64 min_bytes;
592 u64 window_start; 1177 u64 window_start;
593 u64 window_free; 1178 u64 window_free;
594 u64 max_extent = 0; 1179 u64 max_extent = 0;
595 int total_retries = 0; 1180 bool found_bitmap = false;
596 int ret; 1181 int ret;
597 1182
598 /* for metadata, allow allocates with more holes */ 1183 /* for metadata, allow allocates with more holes */
@@ -620,31 +1205,80 @@ int btrfs_find_space_cluster(struct btrfs_trans_handle *trans,
620 goto out; 1205 goto out;
621 } 1206 }
622again: 1207again:
623 min_bytes = min(min_bytes, bytes + empty_size); 1208 entry = tree_search_offset(block_group, offset, found_bitmap, 1);
624 entry = tree_search_bytes(&block_group->free_space_bytes,
625 offset, min_bytes);
626 if (!entry) { 1209 if (!entry) {
627 ret = -ENOSPC; 1210 ret = -ENOSPC;
628 goto out; 1211 goto out;
629 } 1212 }
1213
1214 /*
1215 * If found_bitmap is true, we exhausted our search for extent entries,
1216 * and we just want to search all of the bitmaps that we can find, and
1217 * ignore any extent entries we find.
1218 */
1219 while (entry->bitmap || found_bitmap ||
1220 (!entry->bitmap && entry->bytes < min_bytes)) {
1221 struct rb_node *node = rb_next(&entry->offset_index);
1222
1223 if (entry->bitmap && entry->bytes > bytes + empty_size) {
1224 ret = btrfs_bitmap_cluster(block_group, entry, cluster,
1225 offset, bytes + empty_size,
1226 min_bytes);
1227 if (!ret)
1228 goto got_it;
1229 }
1230
1231 if (!node) {
1232 ret = -ENOSPC;
1233 goto out;
1234 }
1235 entry = rb_entry(node, struct btrfs_free_space, offset_index);
1236 }
1237
1238 /*
1239 * We already searched all the extent entries from the passed in offset
1240 * to the end and didn't find enough space for the cluster, and we also
1241 * didn't find any bitmaps that met our criteria, just go ahead and exit
1242 */
1243 if (found_bitmap) {
1244 ret = -ENOSPC;
1245 goto out;
1246 }
1247
1248 cluster->points_to_bitmap = false;
630 window_start = entry->offset; 1249 window_start = entry->offset;
631 window_free = entry->bytes; 1250 window_free = entry->bytes;
632 last = entry; 1251 last = entry;
633 max_extent = entry->bytes; 1252 max_extent = entry->bytes;
634 1253
635 while(1) { 1254 while (1) {
636 /* out window is just right, lets fill it */ 1255 /* out window is just right, lets fill it */
637 if (window_free >= bytes + empty_size) 1256 if (window_free >= bytes + empty_size)
638 break; 1257 break;
639 1258
640 node = rb_next(&last->offset_index); 1259 node = rb_next(&last->offset_index);
641 if (!node) { 1260 if (!node) {
1261 if (found_bitmap)
1262 goto again;
642 ret = -ENOSPC; 1263 ret = -ENOSPC;
643 goto out; 1264 goto out;
644 } 1265 }
645 next = rb_entry(node, struct btrfs_free_space, offset_index); 1266 next = rb_entry(node, struct btrfs_free_space, offset_index);
646 1267
647 /* 1268 /*
1269 * we found a bitmap, so if this search doesn't result in a
1270 * cluster, we know to go and search again for the bitmaps and
1271 * start looking for space there
1272 */
1273 if (next->bitmap) {
1274 if (!found_bitmap)
1275 offset = next->offset;
1276 found_bitmap = true;
1277 last = next;
1278 continue;
1279 }
1280
1281 /*
648 * we haven't filled the empty size and the window is 1282 * we haven't filled the empty size and the window is
649 * very large. reset and try again 1283 * very large. reset and try again
650 */ 1284 */
@@ -655,19 +1289,6 @@ again:
655 window_free = entry->bytes; 1289 window_free = entry->bytes;
656 last = entry; 1290 last = entry;
657 max_extent = 0; 1291 max_extent = 0;
658 total_retries++;
659 if (total_retries % 64 == 0) {
660 if (min_bytes >= (bytes + empty_size)) {
661 ret = -ENOSPC;
662 goto out;
663 }
664 /*
665 * grow our allocation a bit, we're not having
666 * much luck
667 */
668 min_bytes *= 2;
669 goto again;
670 }
671 } else { 1292 } else {
672 last = next; 1293 last = next;
673 window_free += next->bytes; 1294 window_free += next->bytes;
@@ -685,11 +1306,19 @@ again:
685 * The cluster includes an rbtree, but only uses the offset index 1306 * The cluster includes an rbtree, but only uses the offset index
686 * of each free space cache entry. 1307 * of each free space cache entry.
687 */ 1308 */
688 while(1) { 1309 while (1) {
689 node = rb_next(&entry->offset_index); 1310 node = rb_next(&entry->offset_index);
690 unlink_free_space(block_group, entry); 1311 if (entry->bitmap && node) {
1312 entry = rb_entry(node, struct btrfs_free_space,
1313 offset_index);
1314 continue;
1315 } else if (entry->bitmap && !node) {
1316 break;
1317 }
1318
1319 rb_erase(&entry->offset_index, &block_group->free_space_offset);
691 ret = tree_insert_offset(&cluster->root, entry->offset, 1320 ret = tree_insert_offset(&cluster->root, entry->offset,
692 &entry->offset_index); 1321 &entry->offset_index, 0);
693 BUG_ON(ret); 1322 BUG_ON(ret);
694 1323
695 if (!node || entry == last) 1324 if (!node || entry == last)
@@ -697,8 +1326,10 @@ again:
697 1326
698 entry = rb_entry(node, struct btrfs_free_space, offset_index); 1327 entry = rb_entry(node, struct btrfs_free_space, offset_index);
699 } 1328 }
700 ret = 0; 1329
701 cluster->max_size = max_extent; 1330 cluster->max_size = max_extent;
1331got_it:
1332 ret = 0;
702 atomic_inc(&block_group->count); 1333 atomic_inc(&block_group->count);
703 list_add_tail(&cluster->block_group_list, &block_group->cluster_list); 1334 list_add_tail(&cluster->block_group_list, &block_group->cluster_list);
704 cluster->block_group = block_group; 1335 cluster->block_group = block_group;
@@ -718,6 +1349,7 @@ void btrfs_init_free_cluster(struct btrfs_free_cluster *cluster)
718 spin_lock_init(&cluster->refill_lock); 1349 spin_lock_init(&cluster->refill_lock);
719 cluster->root.rb_node = NULL; 1350 cluster->root.rb_node = NULL;
720 cluster->max_size = 0; 1351 cluster->max_size = 0;
1352 cluster->points_to_bitmap = false;
721 INIT_LIST_HEAD(&cluster->block_group_list); 1353 INIT_LIST_HEAD(&cluster->block_group_list);
722 cluster->block_group = NULL; 1354 cluster->block_group = NULL;
723} 1355}
diff --git a/fs/btrfs/free-space-cache.h b/fs/btrfs/free-space-cache.h
index 266fb8764054..890a8e79011b 100644
--- a/fs/btrfs/free-space-cache.h
+++ b/fs/btrfs/free-space-cache.h
@@ -19,6 +19,14 @@
19#ifndef __BTRFS_FREE_SPACE_CACHE 19#ifndef __BTRFS_FREE_SPACE_CACHE
20#define __BTRFS_FREE_SPACE_CACHE 20#define __BTRFS_FREE_SPACE_CACHE
21 21
22struct btrfs_free_space {
23 struct rb_node offset_index;
24 u64 offset;
25 u64 bytes;
26 unsigned long *bitmap;
27 struct list_head list;
28};
29
22int btrfs_add_free_space(struct btrfs_block_group_cache *block_group, 30int btrfs_add_free_space(struct btrfs_block_group_cache *block_group,
23 u64 bytenr, u64 size); 31 u64 bytenr, u64 size);
24int btrfs_remove_free_space(struct btrfs_block_group_cache *block_group, 32int btrfs_remove_free_space(struct btrfs_block_group_cache *block_group,
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index dbe1aabf96cd..272b9b2bea86 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -26,7 +26,6 @@
26#include <linux/time.h> 26#include <linux/time.h>
27#include <linux/init.h> 27#include <linux/init.h>
28#include <linux/string.h> 28#include <linux/string.h>
29#include <linux/smp_lock.h>
30#include <linux/backing-dev.h> 29#include <linux/backing-dev.h>
31#include <linux/mpage.h> 30#include <linux/mpage.h>
32#include <linux/swap.h> 31#include <linux/swap.h>
@@ -2604,8 +2603,8 @@ noinline int btrfs_truncate_inode_items(struct btrfs_trans_handle *trans,
2604 if (root->ref_cows) 2603 if (root->ref_cows)
2605 btrfs_drop_extent_cache(inode, new_size & (~mask), (u64)-1, 0); 2604 btrfs_drop_extent_cache(inode, new_size & (~mask), (u64)-1, 0);
2606 path = btrfs_alloc_path(); 2605 path = btrfs_alloc_path();
2607 path->reada = -1;
2608 BUG_ON(!path); 2606 BUG_ON(!path);
2607 path->reada = -1;
2609 2608
2610 /* FIXME, add redo link to tree so we don't leak on crash */ 2609 /* FIXME, add redo link to tree so we don't leak on crash */
2611 key.objectid = inode->i_ino; 2610 key.objectid = inode->i_ino;
@@ -3580,12 +3579,6 @@ static struct inode *btrfs_new_inode(struct btrfs_trans_handle *trans,
3580 owner = 1; 3579 owner = 1;
3581 BTRFS_I(inode)->block_group = 3580 BTRFS_I(inode)->block_group =
3582 btrfs_find_block_group(root, 0, alloc_hint, owner); 3581 btrfs_find_block_group(root, 0, alloc_hint, owner);
3583 if ((mode & S_IFREG)) {
3584 if (btrfs_test_opt(root, NODATASUM))
3585 BTRFS_I(inode)->flags |= BTRFS_INODE_NODATASUM;
3586 if (btrfs_test_opt(root, NODATACOW))
3587 BTRFS_I(inode)->flags |= BTRFS_INODE_NODATACOW;
3588 }
3589 3582
3590 key[0].objectid = objectid; 3583 key[0].objectid = objectid;
3591 btrfs_set_key_type(&key[0], BTRFS_INODE_ITEM_KEY); 3584 btrfs_set_key_type(&key[0], BTRFS_INODE_ITEM_KEY);
@@ -3640,6 +3633,13 @@ static struct inode *btrfs_new_inode(struct btrfs_trans_handle *trans,
3640 3633
3641 btrfs_inherit_iflags(inode, dir); 3634 btrfs_inherit_iflags(inode, dir);
3642 3635
3636 if ((mode & S_IFREG)) {
3637 if (btrfs_test_opt(root, NODATASUM))
3638 BTRFS_I(inode)->flags |= BTRFS_INODE_NODATASUM;
3639 if (btrfs_test_opt(root, NODATACOW))
3640 BTRFS_I(inode)->flags |= BTRFS_INODE_NODATACOW;
3641 }
3642
3643 insert_inode_hash(inode); 3643 insert_inode_hash(inode);
3644 inode_tree_add(inode); 3644 inode_tree_add(inode);
3645 return inode; 3645 return inode;
@@ -4785,8 +4785,7 @@ static int btrfs_rename(struct inode *old_dir, struct dentry *old_dentry,
4785 * and the replacement file is large. Start IO on it now so 4785 * and the replacement file is large. Start IO on it now so
4786 * we don't add too much work to the end of the transaction 4786 * we don't add too much work to the end of the transaction
4787 */ 4787 */
4788 if (new_inode && old_inode && S_ISREG(old_inode->i_mode) && 4788 if (new_inode && S_ISREG(old_inode->i_mode) && new_inode->i_size &&
4789 new_inode->i_size &&
4790 old_inode->i_size > BTRFS_ORDERED_OPERATIONS_FLUSH_LIMIT) 4789 old_inode->i_size > BTRFS_ORDERED_OPERATIONS_FLUSH_LIMIT)
4791 filemap_flush(old_inode->i_mapping); 4790 filemap_flush(old_inode->i_mapping);
4792 4791
@@ -5082,6 +5081,7 @@ static long btrfs_fallocate(struct inode *inode, int mode,
5082 u64 mask = BTRFS_I(inode)->root->sectorsize - 1; 5081 u64 mask = BTRFS_I(inode)->root->sectorsize - 1;
5083 struct extent_map *em; 5082 struct extent_map *em;
5084 struct btrfs_trans_handle *trans; 5083 struct btrfs_trans_handle *trans;
5084 struct btrfs_root *root;
5085 int ret; 5085 int ret;
5086 5086
5087 alloc_start = offset & ~mask; 5087 alloc_start = offset & ~mask;
@@ -5100,6 +5100,13 @@ static long btrfs_fallocate(struct inode *inode, int mode,
5100 goto out; 5100 goto out;
5101 } 5101 }
5102 5102
5103 root = BTRFS_I(inode)->root;
5104
5105 ret = btrfs_check_data_free_space(root, inode,
5106 alloc_end - alloc_start);
5107 if (ret)
5108 goto out;
5109
5103 locked_end = alloc_end - 1; 5110 locked_end = alloc_end - 1;
5104 while (1) { 5111 while (1) {
5105 struct btrfs_ordered_extent *ordered; 5112 struct btrfs_ordered_extent *ordered;
@@ -5107,7 +5114,7 @@ static long btrfs_fallocate(struct inode *inode, int mode,
5107 trans = btrfs_start_transaction(BTRFS_I(inode)->root, 1); 5114 trans = btrfs_start_transaction(BTRFS_I(inode)->root, 1);
5108 if (!trans) { 5115 if (!trans) {
5109 ret = -EIO; 5116 ret = -EIO;
5110 goto out; 5117 goto out_free;
5111 } 5118 }
5112 5119
5113 /* the extent lock is ordered inside the running 5120 /* the extent lock is ordered inside the running
@@ -5168,6 +5175,8 @@ static long btrfs_fallocate(struct inode *inode, int mode,
5168 GFP_NOFS); 5175 GFP_NOFS);
5169 5176
5170 btrfs_end_transaction(trans, BTRFS_I(inode)->root); 5177 btrfs_end_transaction(trans, BTRFS_I(inode)->root);
5178out_free:
5179 btrfs_free_reserved_data_space(root, inode, alloc_end - alloc_start);
5171out: 5180out:
5172 mutex_unlock(&inode->i_mutex); 5181 mutex_unlock(&inode->i_mutex);
5173 return ret; 5182 return ret;
diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c
index eff18f5b5362..bd88f25889f7 100644
--- a/fs/btrfs/ioctl.c
+++ b/fs/btrfs/ioctl.c
@@ -27,7 +27,6 @@
27#include <linux/time.h> 27#include <linux/time.h>
28#include <linux/init.h> 28#include <linux/init.h>
29#include <linux/string.h> 29#include <linux/string.h>
30#include <linux/smp_lock.h>
31#include <linux/backing-dev.h> 30#include <linux/backing-dev.h>
32#include <linux/mount.h> 31#include <linux/mount.h>
33#include <linux/mpage.h> 32#include <linux/mpage.h>
@@ -1028,7 +1027,8 @@ static long btrfs_ioctl_clone(struct file *file, unsigned long srcfd,
1028 struct btrfs_file_extent_item); 1027 struct btrfs_file_extent_item);
1029 comp = btrfs_file_extent_compression(leaf, extent); 1028 comp = btrfs_file_extent_compression(leaf, extent);
1030 type = btrfs_file_extent_type(leaf, extent); 1029 type = btrfs_file_extent_type(leaf, extent);
1031 if (type == BTRFS_FILE_EXTENT_REG) { 1030 if (type == BTRFS_FILE_EXTENT_REG ||
1031 type == BTRFS_FILE_EXTENT_PREALLOC) {
1032 disko = btrfs_file_extent_disk_bytenr(leaf, 1032 disko = btrfs_file_extent_disk_bytenr(leaf,
1033 extent); 1033 extent);
1034 diskl = btrfs_file_extent_disk_num_bytes(leaf, 1034 diskl = btrfs_file_extent_disk_num_bytes(leaf,
@@ -1051,7 +1051,8 @@ static long btrfs_ioctl_clone(struct file *file, unsigned long srcfd,
1051 new_key.objectid = inode->i_ino; 1051 new_key.objectid = inode->i_ino;
1052 new_key.offset = key.offset + destoff - off; 1052 new_key.offset = key.offset + destoff - off;
1053 1053
1054 if (type == BTRFS_FILE_EXTENT_REG) { 1054 if (type == BTRFS_FILE_EXTENT_REG ||
1055 type == BTRFS_FILE_EXTENT_PREALLOC) {
1055 ret = btrfs_insert_empty_item(trans, root, path, 1056 ret = btrfs_insert_empty_item(trans, root, path,
1056 &new_key, size); 1057 &new_key, size);
1057 if (ret) 1058 if (ret)
diff --git a/fs/btrfs/print-tree.c b/fs/btrfs/print-tree.c
index 6d6523da0a30..0d126be22b63 100644
--- a/fs/btrfs/print-tree.c
+++ b/fs/btrfs/print-tree.c
@@ -309,7 +309,7 @@ void btrfs_print_tree(struct btrfs_root *root, struct extent_buffer *c)
309 } 309 }
310 printk(KERN_INFO "node %llu level %d total ptrs %d free spc %u\n", 310 printk(KERN_INFO "node %llu level %d total ptrs %d free spc %u\n",
311 (unsigned long long)btrfs_header_bytenr(c), 311 (unsigned long long)btrfs_header_bytenr(c),
312 btrfs_header_level(c), nr, 312 level, nr,
313 (u32)BTRFS_NODEPTRS_PER_BLOCK(root) - nr); 313 (u32)BTRFS_NODEPTRS_PER_BLOCK(root) - nr);
314 for (i = 0; i < nr; i++) { 314 for (i = 0; i < nr; i++) {
315 btrfs_node_key_to_cpu(c, &key, i); 315 btrfs_node_key_to_cpu(c, &key, i);
@@ -326,10 +326,10 @@ void btrfs_print_tree(struct btrfs_root *root, struct extent_buffer *c)
326 btrfs_level_size(root, level - 1), 326 btrfs_level_size(root, level - 1),
327 btrfs_node_ptr_generation(c, i)); 327 btrfs_node_ptr_generation(c, i));
328 if (btrfs_is_leaf(next) && 328 if (btrfs_is_leaf(next) &&
329 btrfs_header_level(c) != 1) 329 level != 1)
330 BUG(); 330 BUG();
331 if (btrfs_header_level(next) != 331 if (btrfs_header_level(next) !=
332 btrfs_header_level(c) - 1) 332 level - 1)
333 BUG(); 333 BUG();
334 btrfs_print_tree(root, next); 334 btrfs_print_tree(root, next);
335 free_extent_buffer(next); 335 free_extent_buffer(next);
diff --git a/fs/btrfs/relocation.c b/fs/btrfs/relocation.c
index b23dc209ae10..c04f7f212602 100644
--- a/fs/btrfs/relocation.c
+++ b/fs/btrfs/relocation.c
@@ -670,6 +670,8 @@ again:
670 err = ret; 670 err = ret;
671 goto out; 671 goto out;
672 } 672 }
673 if (ret > 0 && path2->slots[level] > 0)
674 path2->slots[level]--;
673 675
674 eb = path2->nodes[level]; 676 eb = path2->nodes[level];
675 WARN_ON(btrfs_node_blockptr(eb, path2->slots[level]) != 677 WARN_ON(btrfs_node_blockptr(eb, path2->slots[level]) !=
@@ -1609,6 +1611,7 @@ static noinline_for_stack int merge_reloc_root(struct reloc_control *rc,
1609 BUG_ON(level == 0); 1611 BUG_ON(level == 0);
1610 path->lowest_level = level; 1612 path->lowest_level = level;
1611 ret = btrfs_search_slot(NULL, reloc_root, &key, path, 0, 0); 1613 ret = btrfs_search_slot(NULL, reloc_root, &key, path, 0, 0);
1614 path->lowest_level = 0;
1612 if (ret < 0) { 1615 if (ret < 0) {
1613 btrfs_free_path(path); 1616 btrfs_free_path(path);
1614 return ret; 1617 return ret;
@@ -1788,7 +1791,7 @@ static void merge_func(struct btrfs_work *work)
1788 btrfs_end_transaction(trans, root); 1791 btrfs_end_transaction(trans, root);
1789 } 1792 }
1790 1793
1791 btrfs_drop_dead_root(reloc_root); 1794 btrfs_drop_snapshot(reloc_root, 0);
1792 1795
1793 if (atomic_dec_and_test(async->num_pending)) 1796 if (atomic_dec_and_test(async->num_pending))
1794 complete(async->done); 1797 complete(async->done);
@@ -2075,9 +2078,6 @@ static int do_relocation(struct btrfs_trans_handle *trans,
2075 2078
2076 ret = btrfs_drop_subtree(trans, root, eb, upper->eb); 2079 ret = btrfs_drop_subtree(trans, root, eb, upper->eb);
2077 BUG_ON(ret); 2080 BUG_ON(ret);
2078
2079 btrfs_tree_unlock(eb);
2080 free_extent_buffer(eb);
2081 } 2081 }
2082 if (!lowest) { 2082 if (!lowest) {
2083 btrfs_tree_unlock(upper->eb); 2083 btrfs_tree_unlock(upper->eb);
@@ -2553,8 +2553,13 @@ int relocate_inode_pages(struct inode *inode, u64 start, u64 len)
2553 last_index = (start + len - 1) >> PAGE_CACHE_SHIFT; 2553 last_index = (start + len - 1) >> PAGE_CACHE_SHIFT;
2554 2554
2555 /* make sure the dirty trick played by the caller work */ 2555 /* make sure the dirty trick played by the caller work */
2556 ret = invalidate_inode_pages2_range(inode->i_mapping, 2556 while (1) {
2557 first_index, last_index); 2557 ret = invalidate_inode_pages2_range(inode->i_mapping,
2558 first_index, last_index);
2559 if (ret != -EBUSY)
2560 break;
2561 schedule_timeout(HZ/10);
2562 }
2558 if (ret) 2563 if (ret)
2559 goto out_unlock; 2564 goto out_unlock;
2560 2565
diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c
index 9f179d4832d5..6d6d06cb6dfc 100644
--- a/fs/btrfs/super.c
+++ b/fs/btrfs/super.c
@@ -26,7 +26,6 @@
26#include <linux/init.h> 26#include <linux/init.h>
27#include <linux/seq_file.h> 27#include <linux/seq_file.h>
28#include <linux/string.h> 28#include <linux/string.h>
29#include <linux/smp_lock.h>
30#include <linux/backing-dev.h> 29#include <linux/backing-dev.h>
31#include <linux/mount.h> 30#include <linux/mount.h>
32#include <linux/mpage.h> 31#include <linux/mpage.h>
diff --git a/fs/btrfs/transaction.c b/fs/btrfs/transaction.c
index 4e83457ea253..cdbb5022da52 100644
--- a/fs/btrfs/transaction.c
+++ b/fs/btrfs/transaction.c
@@ -40,6 +40,12 @@ static noinline void put_transaction(struct btrfs_transaction *transaction)
40 } 40 }
41} 41}
42 42
43static noinline void switch_commit_root(struct btrfs_root *root)
44{
45 free_extent_buffer(root->commit_root);
46 root->commit_root = btrfs_root_node(root);
47}
48
43/* 49/*
44 * either allocate a new transaction or hop into the existing one 50 * either allocate a new transaction or hop into the existing one
45 */ 51 */
@@ -444,9 +450,6 @@ static int update_cowonly_root(struct btrfs_trans_handle *trans,
444 450
445 btrfs_write_dirty_block_groups(trans, root); 451 btrfs_write_dirty_block_groups(trans, root);
446 452
447 ret = btrfs_run_delayed_refs(trans, root, (unsigned long)-1);
448 BUG_ON(ret);
449
450 while (1) { 453 while (1) {
451 old_root_bytenr = btrfs_root_bytenr(&root->root_item); 454 old_root_bytenr = btrfs_root_bytenr(&root->root_item);
452 if (old_root_bytenr == root->node->start) 455 if (old_root_bytenr == root->node->start)
@@ -457,13 +460,14 @@ static int update_cowonly_root(struct btrfs_trans_handle *trans,
457 &root->root_key, 460 &root->root_key,
458 &root->root_item); 461 &root->root_item);
459 BUG_ON(ret); 462 BUG_ON(ret);
460 btrfs_write_dirty_block_groups(trans, root);
461 463
462 ret = btrfs_run_delayed_refs(trans, root, (unsigned long)-1); 464 ret = btrfs_write_dirty_block_groups(trans, root);
463 BUG_ON(ret); 465 BUG_ON(ret);
464 } 466 }
465 free_extent_buffer(root->commit_root); 467
466 root->commit_root = btrfs_root_node(root); 468 if (root != root->fs_info->extent_root)
469 switch_commit_root(root);
470
467 return 0; 471 return 0;
468} 472}
469 473
@@ -495,10 +499,12 @@ static noinline int commit_cowonly_roots(struct btrfs_trans_handle *trans,
495 root = list_entry(next, struct btrfs_root, dirty_list); 499 root = list_entry(next, struct btrfs_root, dirty_list);
496 500
497 update_cowonly_root(trans, root); 501 update_cowonly_root(trans, root);
498
499 ret = btrfs_run_delayed_refs(trans, root, (unsigned long)-1);
500 BUG_ON(ret);
501 } 502 }
503
504 down_write(&fs_info->extent_commit_sem);
505 switch_commit_root(fs_info->extent_root);
506 up_write(&fs_info->extent_commit_sem);
507
502 return 0; 508 return 0;
503} 509}
504 510
@@ -544,8 +550,7 @@ static noinline int commit_fs_roots(struct btrfs_trans_handle *trans,
544 btrfs_update_reloc_root(trans, root); 550 btrfs_update_reloc_root(trans, root);
545 551
546 if (root->commit_root != root->node) { 552 if (root->commit_root != root->node) {
547 free_extent_buffer(root->commit_root); 553 switch_commit_root(root);
548 root->commit_root = btrfs_root_node(root);
549 btrfs_set_root_node(&root->root_item, 554 btrfs_set_root_node(&root->root_item,
550 root->node); 555 root->node);
551 } 556 }
@@ -593,6 +598,7 @@ int btrfs_defrag_root(struct btrfs_root *root, int cacheonly)
593 return 0; 598 return 0;
594} 599}
595 600
601#if 0
596/* 602/*
597 * when dropping snapshots, we generate a ton of delayed refs, and it makes 603 * when dropping snapshots, we generate a ton of delayed refs, and it makes
598 * sense not to join the transaction while it is trying to flush the current 604 * sense not to join the transaction while it is trying to flush the current
@@ -681,6 +687,7 @@ int btrfs_drop_dead_root(struct btrfs_root *root)
681 btrfs_btree_balance_dirty(tree_root, nr); 687 btrfs_btree_balance_dirty(tree_root, nr);
682 return ret; 688 return ret;
683} 689}
690#endif
684 691
685/* 692/*
686 * new snapshots need to be created at a very specific time in the 693 * new snapshots need to be created at a very specific time in the
@@ -850,6 +857,16 @@ static void update_super_roots(struct btrfs_root *root)
850 super->root_level = root_item->level; 857 super->root_level = root_item->level;
851} 858}
852 859
860int btrfs_transaction_in_commit(struct btrfs_fs_info *info)
861{
862 int ret = 0;
863 spin_lock(&info->new_trans_lock);
864 if (info->running_transaction)
865 ret = info->running_transaction->in_commit;
866 spin_unlock(&info->new_trans_lock);
867 return ret;
868}
869
853int btrfs_commit_transaction(struct btrfs_trans_handle *trans, 870int btrfs_commit_transaction(struct btrfs_trans_handle *trans,
854 struct btrfs_root *root) 871 struct btrfs_root *root)
855{ 872{
@@ -941,9 +958,11 @@ int btrfs_commit_transaction(struct btrfs_trans_handle *trans,
941 958
942 mutex_unlock(&root->fs_info->trans_mutex); 959 mutex_unlock(&root->fs_info->trans_mutex);
943 960
944 if (flush_on_commit || snap_pending) { 961 if (flush_on_commit) {
945 if (flush_on_commit) 962 btrfs_start_delalloc_inodes(root);
946 btrfs_start_delalloc_inodes(root); 963 ret = btrfs_wait_ordered_extents(root, 0);
964 BUG_ON(ret);
965 } else if (snap_pending) {
947 ret = btrfs_wait_ordered_extents(root, 1); 966 ret = btrfs_wait_ordered_extents(root, 1);
948 BUG_ON(ret); 967 BUG_ON(ret);
949 } 968 }
@@ -1007,15 +1026,11 @@ int btrfs_commit_transaction(struct btrfs_trans_handle *trans,
1007 1026
1008 btrfs_set_root_node(&root->fs_info->tree_root->root_item, 1027 btrfs_set_root_node(&root->fs_info->tree_root->root_item,
1009 root->fs_info->tree_root->node); 1028 root->fs_info->tree_root->node);
1010 free_extent_buffer(root->fs_info->tree_root->commit_root); 1029 switch_commit_root(root->fs_info->tree_root);
1011 root->fs_info->tree_root->commit_root =
1012 btrfs_root_node(root->fs_info->tree_root);
1013 1030
1014 btrfs_set_root_node(&root->fs_info->chunk_root->root_item, 1031 btrfs_set_root_node(&root->fs_info->chunk_root->root_item,
1015 root->fs_info->chunk_root->node); 1032 root->fs_info->chunk_root->node);
1016 free_extent_buffer(root->fs_info->chunk_root->commit_root); 1033 switch_commit_root(root->fs_info->chunk_root);
1017 root->fs_info->chunk_root->commit_root =
1018 btrfs_root_node(root->fs_info->chunk_root);
1019 1034
1020 update_super_roots(root); 1035 update_super_roots(root);
1021 1036
@@ -1055,6 +1070,7 @@ int btrfs_commit_transaction(struct btrfs_trans_handle *trans,
1055 cur_trans->commit_done = 1; 1070 cur_trans->commit_done = 1;
1056 1071
1057 root->fs_info->last_trans_committed = cur_trans->transid; 1072 root->fs_info->last_trans_committed = cur_trans->transid;
1073
1058 wake_up(&cur_trans->commit_wait); 1074 wake_up(&cur_trans->commit_wait);
1059 1075
1060 put_transaction(cur_trans); 1076 put_transaction(cur_trans);
@@ -1081,7 +1097,7 @@ int btrfs_clean_old_snapshots(struct btrfs_root *root)
1081 while (!list_empty(&list)) { 1097 while (!list_empty(&list)) {
1082 root = list_entry(list.next, struct btrfs_root, root_list); 1098 root = list_entry(list.next, struct btrfs_root, root_list);
1083 list_del_init(&root->root_list); 1099 list_del_init(&root->root_list);
1084 btrfs_drop_dead_root(root); 1100 btrfs_drop_snapshot(root, 0);
1085 } 1101 }
1086 return 0; 1102 return 0;
1087} 1103}
diff --git a/fs/btrfs/transaction.h b/fs/btrfs/transaction.h
index 961c3ee5a2e1..663c67404918 100644
--- a/fs/btrfs/transaction.h
+++ b/fs/btrfs/transaction.h
@@ -107,4 +107,5 @@ int btrfs_record_root_in_trans(struct btrfs_trans_handle *trans,
107 struct btrfs_root *root); 107 struct btrfs_root *root);
108int btrfs_write_and_wait_marked_extents(struct btrfs_root *root, 108int btrfs_write_and_wait_marked_extents(struct btrfs_root *root,
109 struct extent_io_tree *dirty_pages); 109 struct extent_io_tree *dirty_pages);
110int btrfs_transaction_in_commit(struct btrfs_fs_info *info);
110#endif 111#endif
diff --git a/fs/btrfs/tree-log.c b/fs/btrfs/tree-log.c
index c13922206d1b..d91b0de7c502 100644
--- a/fs/btrfs/tree-log.c
+++ b/fs/btrfs/tree-log.c
@@ -797,7 +797,7 @@ static noinline int add_inode_ref(struct btrfs_trans_handle *trans,
797 return -ENOENT; 797 return -ENOENT;
798 798
799 inode = read_one_inode(root, key->objectid); 799 inode = read_one_inode(root, key->objectid);
800 BUG_ON(!dir); 800 BUG_ON(!inode);
801 801
802 ref_ptr = btrfs_item_ptr_offset(eb, slot); 802 ref_ptr = btrfs_item_ptr_offset(eb, slot);
803 ref_end = ref_ptr + btrfs_item_size_nr(eb, slot); 803 ref_end = ref_ptr + btrfs_item_size_nr(eb, slot);
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
index 3ab80e9cd767..5dbefd11b4af 100644
--- a/fs/btrfs/volumes.c
+++ b/fs/btrfs/volumes.c
@@ -721,7 +721,8 @@ error:
721 */ 721 */
722static noinline int find_free_dev_extent(struct btrfs_trans_handle *trans, 722static noinline int find_free_dev_extent(struct btrfs_trans_handle *trans,
723 struct btrfs_device *device, 723 struct btrfs_device *device,
724 u64 num_bytes, u64 *start) 724 u64 num_bytes, u64 *start,
725 u64 *max_avail)
725{ 726{
726 struct btrfs_key key; 727 struct btrfs_key key;
727 struct btrfs_root *root = device->dev_root; 728 struct btrfs_root *root = device->dev_root;
@@ -758,9 +759,13 @@ static noinline int find_free_dev_extent(struct btrfs_trans_handle *trans,
758 ret = btrfs_search_slot(trans, root, &key, path, 0, 0); 759 ret = btrfs_search_slot(trans, root, &key, path, 0, 0);
759 if (ret < 0) 760 if (ret < 0)
760 goto error; 761 goto error;
761 ret = btrfs_previous_item(root, path, 0, key.type); 762 if (ret > 0) {
762 if (ret < 0) 763 ret = btrfs_previous_item(root, path, key.objectid, key.type);
763 goto error; 764 if (ret < 0)
765 goto error;
766 if (ret > 0)
767 start_found = 1;
768 }
764 l = path->nodes[0]; 769 l = path->nodes[0];
765 btrfs_item_key_to_cpu(l, &key, path->slots[0]); 770 btrfs_item_key_to_cpu(l, &key, path->slots[0]);
766 while (1) { 771 while (1) {
@@ -803,6 +808,10 @@ no_more_items:
803 if (last_byte < search_start) 808 if (last_byte < search_start)
804 last_byte = search_start; 809 last_byte = search_start;
805 hole_size = key.offset - last_byte; 810 hole_size = key.offset - last_byte;
811
812 if (hole_size > *max_avail)
813 *max_avail = hole_size;
814
806 if (key.offset > last_byte && 815 if (key.offset > last_byte &&
807 hole_size >= num_bytes) { 816 hole_size >= num_bytes) {
808 *start = last_byte; 817 *start = last_byte;
@@ -1621,6 +1630,7 @@ static int __btrfs_grow_device(struct btrfs_trans_handle *trans,
1621 device->fs_devices->total_rw_bytes += diff; 1630 device->fs_devices->total_rw_bytes += diff;
1622 1631
1623 device->total_bytes = new_size; 1632 device->total_bytes = new_size;
1633 device->disk_total_bytes = new_size;
1624 btrfs_clear_space_info_full(device->dev_root->fs_info); 1634 btrfs_clear_space_info_full(device->dev_root->fs_info);
1625 1635
1626 return btrfs_update_device(trans, device); 1636 return btrfs_update_device(trans, device);
@@ -2007,7 +2017,7 @@ int btrfs_shrink_device(struct btrfs_device *device, u64 new_size)
2007 goto done; 2017 goto done;
2008 if (ret) { 2018 if (ret) {
2009 ret = 0; 2019 ret = 0;
2010 goto done; 2020 break;
2011 } 2021 }
2012 2022
2013 l = path->nodes[0]; 2023 l = path->nodes[0];
@@ -2015,7 +2025,7 @@ int btrfs_shrink_device(struct btrfs_device *device, u64 new_size)
2015 btrfs_item_key_to_cpu(l, &key, path->slots[0]); 2025 btrfs_item_key_to_cpu(l, &key, path->slots[0]);
2016 2026
2017 if (key.objectid != device->devid) 2027 if (key.objectid != device->devid)
2018 goto done; 2028 break;
2019 2029
2020 dev_extent = btrfs_item_ptr(l, slot, struct btrfs_dev_extent); 2030 dev_extent = btrfs_item_ptr(l, slot, struct btrfs_dev_extent);
2021 length = btrfs_dev_extent_length(l, dev_extent); 2031 length = btrfs_dev_extent_length(l, dev_extent);
@@ -2171,6 +2181,7 @@ static int __btrfs_alloc_chunk(struct btrfs_trans_handle *trans,
2171 max_chunk_size); 2181 max_chunk_size);
2172 2182
2173again: 2183again:
2184 max_avail = 0;
2174 if (!map || map->num_stripes != num_stripes) { 2185 if (!map || map->num_stripes != num_stripes) {
2175 kfree(map); 2186 kfree(map);
2176 map = kmalloc(map_lookup_size(num_stripes), GFP_NOFS); 2187 map = kmalloc(map_lookup_size(num_stripes), GFP_NOFS);
@@ -2219,7 +2230,8 @@ again:
2219 2230
2220 if (device->in_fs_metadata && avail >= min_free) { 2231 if (device->in_fs_metadata && avail >= min_free) {
2221 ret = find_free_dev_extent(trans, device, 2232 ret = find_free_dev_extent(trans, device,
2222 min_free, &dev_offset); 2233 min_free, &dev_offset,
2234 &max_avail);
2223 if (ret == 0) { 2235 if (ret == 0) {
2224 list_move_tail(&device->dev_alloc_list, 2236 list_move_tail(&device->dev_alloc_list,
2225 &private_devs); 2237 &private_devs);
@@ -2795,26 +2807,6 @@ int btrfs_rmap_block(struct btrfs_mapping_tree *map_tree,
2795 } 2807 }
2796 } 2808 }
2797 2809
2798 for (i = 0; i > nr; i++) {
2799 struct btrfs_multi_bio *multi;
2800 struct btrfs_bio_stripe *stripe;
2801 int ret;
2802
2803 length = 1;
2804 ret = btrfs_map_block(map_tree, WRITE, buf[i],
2805 &length, &multi, 0);
2806 BUG_ON(ret);
2807
2808 stripe = multi->stripes;
2809 for (j = 0; j < multi->num_stripes; j++) {
2810 if (stripe->physical >= physical &&
2811 physical < stripe->physical + length)
2812 break;
2813 }
2814 BUG_ON(j >= multi->num_stripes);
2815 kfree(multi);
2816 }
2817
2818 *logical = buf; 2810 *logical = buf;
2819 *naddrs = nr; 2811 *naddrs = nr;
2820 *stripe_len = map->stripe_len; 2812 *stripe_len = map->stripe_len;
diff --git a/fs/btrfs/zlib.c b/fs/btrfs/zlib.c
index ecfbce836d32..3e2b90eaa239 100644
--- a/fs/btrfs/zlib.c
+++ b/fs/btrfs/zlib.c
@@ -208,7 +208,7 @@ int btrfs_zlib_compress_pages(struct address_space *mapping,
208 *total_in = 0; 208 *total_in = 0;
209 209
210 workspace = find_zlib_workspace(); 210 workspace = find_zlib_workspace();
211 if (!workspace) 211 if (IS_ERR(workspace))
212 return -1; 212 return -1;
213 213
214 if (Z_OK != zlib_deflateInit(&workspace->def_strm, 3)) { 214 if (Z_OK != zlib_deflateInit(&workspace->def_strm, 3)) {
@@ -366,7 +366,7 @@ int btrfs_zlib_decompress_biovec(struct page **pages_in,
366 char *kaddr; 366 char *kaddr;
367 367
368 workspace = find_zlib_workspace(); 368 workspace = find_zlib_workspace();
369 if (!workspace) 369 if (IS_ERR(workspace))
370 return -ENOMEM; 370 return -ENOMEM;
371 371
372 data_in = kmap(pages_in[page_in_index]); 372 data_in = kmap(pages_in[page_in_index]);
@@ -547,7 +547,7 @@ int btrfs_zlib_decompress(unsigned char *data_in,
547 return -ENOMEM; 547 return -ENOMEM;
548 548
549 workspace = find_zlib_workspace(); 549 workspace = find_zlib_workspace();
550 if (!workspace) 550 if (IS_ERR(workspace))
551 return -ENOMEM; 551 return -ENOMEM;
552 552
553 workspace->inf_strm.next_in = data_in; 553 workspace->inf_strm.next_in = data_in;
diff --git a/fs/char_dev.c b/fs/char_dev.c
index b7c9d5187a75..a173551e19d7 100644
--- a/fs/char_dev.c
+++ b/fs/char_dev.c
@@ -13,7 +13,6 @@
13#include <linux/major.h> 13#include <linux/major.h>
14#include <linux/errno.h> 14#include <linux/errno.h>
15#include <linux/module.h> 15#include <linux/module.h>
16#include <linux/smp_lock.h>
17#include <linux/seq_file.h> 16#include <linux/seq_file.h>
18 17
19#include <linux/kobject.h> 18#include <linux/kobject.h>
diff --git a/fs/cifs/CHANGES b/fs/cifs/CHANGES
index b48689839428..e85b1e4389e0 100644
--- a/fs/cifs/CHANGES
+++ b/fs/cifs/CHANGES
@@ -1,3 +1,10 @@
1Version 1.60
2-------------
3Fix memory leak in reconnect. Fix oops in DFS mount error path.
4Set s_maxbytes to smaller (the max that vfs can handle) so that
5sendfile will now work over cifs mounts again. Add noforcegid
6and noforceuid mount parameters.
7
1Version 1.59 8Version 1.59
2------------ 9------------
3Client uses server inode numbers (which are persistent) rather than 10Client uses server inode numbers (which are persistent) rather than
@@ -5,7 +12,11 @@ client generated ones by default (mount option "serverino" turned
5on by default if server supports it). Add forceuid and forcegid 12on by default if server supports it). Add forceuid and forcegid
6mount options (so that when negotiating unix extensions specifying 13mount options (so that when negotiating unix extensions specifying
7which uid mounted does not immediately force the server's reported 14which uid mounted does not immediately force the server's reported
8uids to be overridden). 15uids to be overridden). Add support for scope mount parm. Improve
16hard link detection to use same inode for both. Do not set
17read-only dos attribute on directories (for chmod) since Windows
18explorer special cases this attribute bit for directories for
19a different purpose.
9 20
10Version 1.58 21Version 1.58
11------------ 22------------
diff --git a/fs/cifs/README b/fs/cifs/README
index ad92921dbde4..79c1a93400be 100644
--- a/fs/cifs/README
+++ b/fs/cifs/README
@@ -262,11 +262,11 @@ A partial list of the supported mount options follows:
262 mount. 262 mount.
263 domain Set the SMB/CIFS workgroup name prepended to the 263 domain Set the SMB/CIFS workgroup name prepended to the
264 username during CIFS session establishment 264 username during CIFS session establishment
265 forceuid Set the default uid for inodes based on the uid 265 forceuid Set the default uid for inodes to the uid
266 passed in. For mounts to servers 266 passed in on mount. For mounts to servers
267 which do support the CIFS Unix extensions, such as a 267 which do support the CIFS Unix extensions, such as a
268 properly configured Samba server, the server provides 268 properly configured Samba server, the server provides
269 the uid, gid and mode so this parameter should not be 269 the uid, gid and mode so this parameter should not be
270 specified unless the server and clients uid and gid 270 specified unless the server and clients uid and gid
271 numbering differ. If the server and client are in the 271 numbering differ. If the server and client are in the
272 same domain (e.g. running winbind or nss_ldap) and 272 same domain (e.g. running winbind or nss_ldap) and
@@ -278,11 +278,7 @@ A partial list of the supported mount options follows:
278 of existing files will be the uid (gid) of the person 278 of existing files will be the uid (gid) of the person
279 who executed the mount (root, except when mount.cifs 279 who executed the mount (root, except when mount.cifs
280 is configured setuid for user mounts) unless the "uid=" 280 is configured setuid for user mounts) unless the "uid="
281 (gid) mount option is specified. For the uid (gid) of newly 281 (gid) mount option is specified. Also note that permission
282 created files and directories, ie files created since
283 the last mount of the server share, the expected uid
284 (gid) is cached as long as the inode remains in
285 memory on the client. Also note that permission
286 checks (authorization checks) on accesses to a file occur 282 checks (authorization checks) on accesses to a file occur
287 at the server, but there are cases in which an administrator 283 at the server, but there are cases in which an administrator
288 may want to restrict at the client as well. For those 284 may want to restrict at the client as well. For those
@@ -290,12 +286,15 @@ A partial list of the supported mount options follows:
290 (such as Windows), permissions can also be checked at the 286 (such as Windows), permissions can also be checked at the
291 client, and a crude form of client side permission checking 287 client, and a crude form of client side permission checking
292 can be enabled by specifying file_mode and dir_mode on 288 can be enabled by specifying file_mode and dir_mode on
293 the client. Note that the mount.cifs helper must be 289 the client. (default)
294 at version 1.10 or higher to support specifying the uid 290 forcegid (similar to above but for the groupid instead of uid) (default)
295 (or gid) in non-numeric form. 291 noforceuid Fill in file owner information (uid) by requesting it from
296 forcegid (similar to above but for the groupid instead of uid) 292 the server if possible. With this option, the value given in
293 the uid= option (on mount) will only be used if the server
294 can not support returning uids on inodes.
295 noforcegid (similar to above but for the group owner, gid, instead of uid)
297 uid Set the default uid for inodes, and indicate to the 296 uid Set the default uid for inodes, and indicate to the
298 cifs kernel driver which local user mounted . If the server 297 cifs kernel driver which local user mounted. If the server
299 supports the unix extensions the default uid is 298 supports the unix extensions the default uid is
300 not used to fill in the owner fields of inodes (files) 299 not used to fill in the owner fields of inodes (files)
301 unless the "forceuid" parameter is specified. 300 unless the "forceuid" parameter is specified.
diff --git a/fs/cifs/asn1.c b/fs/cifs/asn1.c
index 1b09f1670061..20692fbfdb24 100644
--- a/fs/cifs/asn1.c
+++ b/fs/cifs/asn1.c
@@ -49,6 +49,7 @@
49#define ASN1_OJI 6 /* Object Identifier */ 49#define ASN1_OJI 6 /* Object Identifier */
50#define ASN1_OJD 7 /* Object Description */ 50#define ASN1_OJD 7 /* Object Description */
51#define ASN1_EXT 8 /* External */ 51#define ASN1_EXT 8 /* External */
52#define ASN1_ENUM 10 /* Enumerated */
52#define ASN1_SEQ 16 /* Sequence */ 53#define ASN1_SEQ 16 /* Sequence */
53#define ASN1_SET 17 /* Set */ 54#define ASN1_SET 17 /* Set */
54#define ASN1_NUMSTR 18 /* Numerical String */ 55#define ASN1_NUMSTR 18 /* Numerical String */
@@ -78,10 +79,12 @@
78#define SPNEGO_OID_LEN 7 79#define SPNEGO_OID_LEN 7
79#define NTLMSSP_OID_LEN 10 80#define NTLMSSP_OID_LEN 10
80#define KRB5_OID_LEN 7 81#define KRB5_OID_LEN 7
82#define KRB5U2U_OID_LEN 8
81#define MSKRB5_OID_LEN 7 83#define MSKRB5_OID_LEN 7
82static unsigned long SPNEGO_OID[7] = { 1, 3, 6, 1, 5, 5, 2 }; 84static unsigned long SPNEGO_OID[7] = { 1, 3, 6, 1, 5, 5, 2 };
83static unsigned long NTLMSSP_OID[10] = { 1, 3, 6, 1, 4, 1, 311, 2, 2, 10 }; 85static unsigned long NTLMSSP_OID[10] = { 1, 3, 6, 1, 4, 1, 311, 2, 2, 10 };
84static unsigned long KRB5_OID[7] = { 1, 2, 840, 113554, 1, 2, 2 }; 86static unsigned long KRB5_OID[7] = { 1, 2, 840, 113554, 1, 2, 2 };
87static unsigned long KRB5U2U_OID[8] = { 1, 2, 840, 113554, 1, 2, 2, 3 };
85static unsigned long MSKRB5_OID[7] = { 1, 2, 840, 48018, 1, 2, 2 }; 88static unsigned long MSKRB5_OID[7] = { 1, 2, 840, 48018, 1, 2, 2 };
86 89
87/* 90/*
@@ -122,6 +125,28 @@ asn1_octet_decode(struct asn1_ctx *ctx, unsigned char *ch)
122 return 1; 125 return 1;
123} 126}
124 127
128#if 0 /* will be needed later by spnego decoding/encoding of ntlmssp */
129static unsigned char
130asn1_enum_decode(struct asn1_ctx *ctx, __le32 *val)
131{
132 unsigned char ch;
133
134 if (ctx->pointer >= ctx->end) {
135 ctx->error = ASN1_ERR_DEC_EMPTY;
136 return 0;
137 }
138
139 ch = *(ctx->pointer)++; /* ch has 0xa, ptr points to lenght octet */
140 if ((ch) == ASN1_ENUM) /* if ch value is ENUM, 0xa */
141 *val = *(++(ctx->pointer)); /* value has enum value */
142 else
143 return 0;
144
145 ctx->pointer++;
146 return 1;
147}
148#endif
149
125static unsigned char 150static unsigned char
126asn1_tag_decode(struct asn1_ctx *ctx, unsigned int *tag) 151asn1_tag_decode(struct asn1_ctx *ctx, unsigned int *tag)
127{ 152{
@@ -476,10 +501,9 @@ decode_negTokenInit(unsigned char *security_blob, int length,
476 unsigned int cls, con, tag, oidlen, rc; 501 unsigned int cls, con, tag, oidlen, rc;
477 bool use_ntlmssp = false; 502 bool use_ntlmssp = false;
478 bool use_kerberos = false; 503 bool use_kerberos = false;
504 bool use_kerberosu2u = false;
479 bool use_mskerberos = false; 505 bool use_mskerberos = false;
480 506
481 *secType = NTLM; /* BB eventually make Kerberos or NLTMSSP the default*/
482
483 /* cifs_dump_mem(" Received SecBlob ", security_blob, length); */ 507 /* cifs_dump_mem(" Received SecBlob ", security_blob, length); */
484 508
485 asn1_open(&ctx, security_blob, length); 509 asn1_open(&ctx, security_blob, length);
@@ -515,6 +539,7 @@ decode_negTokenInit(unsigned char *security_blob, int length,
515 return 0; 539 return 0;
516 } 540 }
517 541
542 /* SPNEGO */
518 if (asn1_header_decode(&ctx, &end, &cls, &con, &tag) == 0) { 543 if (asn1_header_decode(&ctx, &end, &cls, &con, &tag) == 0) {
519 cFYI(1, ("Error decoding negTokenInit")); 544 cFYI(1, ("Error decoding negTokenInit"));
520 return 0; 545 return 0;
@@ -526,6 +551,7 @@ decode_negTokenInit(unsigned char *security_blob, int length,
526 return 0; 551 return 0;
527 } 552 }
528 553
554 /* negTokenInit */
529 if (asn1_header_decode(&ctx, &end, &cls, &con, &tag) == 0) { 555 if (asn1_header_decode(&ctx, &end, &cls, &con, &tag) == 0) {
530 cFYI(1, ("Error decoding negTokenInit")); 556 cFYI(1, ("Error decoding negTokenInit"));
531 return 0; 557 return 0;
@@ -537,6 +563,7 @@ decode_negTokenInit(unsigned char *security_blob, int length,
537 return 0; 563 return 0;
538 } 564 }
539 565
566 /* sequence */
540 if (asn1_header_decode(&ctx, &end, &cls, &con, &tag) == 0) { 567 if (asn1_header_decode(&ctx, &end, &cls, &con, &tag) == 0) {
541 cFYI(1, ("Error decoding 2nd part of negTokenInit")); 568 cFYI(1, ("Error decoding 2nd part of negTokenInit"));
542 return 0; 569 return 0;
@@ -548,6 +575,7 @@ decode_negTokenInit(unsigned char *security_blob, int length,
548 return 0; 575 return 0;
549 } 576 }
550 577
578 /* sequence of */
551 if (asn1_header_decode 579 if (asn1_header_decode
552 (&ctx, &sequence_end, &cls, &con, &tag) == 0) { 580 (&ctx, &sequence_end, &cls, &con, &tag) == 0) {
553 cFYI(1, ("Error decoding 2nd part of negTokenInit")); 581 cFYI(1, ("Error decoding 2nd part of negTokenInit"));
@@ -560,6 +588,7 @@ decode_negTokenInit(unsigned char *security_blob, int length,
560 return 0; 588 return 0;
561 } 589 }
562 590
591 /* list of security mechanisms */
563 while (!asn1_eoc_decode(&ctx, sequence_end)) { 592 while (!asn1_eoc_decode(&ctx, sequence_end)) {
564 rc = asn1_header_decode(&ctx, &end, &cls, &con, &tag); 593 rc = asn1_header_decode(&ctx, &end, &cls, &con, &tag);
565 if (!rc) { 594 if (!rc) {
@@ -576,11 +605,15 @@ decode_negTokenInit(unsigned char *security_blob, int length,
576 605
577 if (compare_oid(oid, oidlen, MSKRB5_OID, 606 if (compare_oid(oid, oidlen, MSKRB5_OID,
578 MSKRB5_OID_LEN) && 607 MSKRB5_OID_LEN) &&
579 !use_kerberos) 608 !use_mskerberos)
580 use_mskerberos = true; 609 use_mskerberos = true;
610 else if (compare_oid(oid, oidlen, KRB5U2U_OID,
611 KRB5U2U_OID_LEN) &&
612 !use_kerberosu2u)
613 use_kerberosu2u = true;
581 else if (compare_oid(oid, oidlen, KRB5_OID, 614 else if (compare_oid(oid, oidlen, KRB5_OID,
582 KRB5_OID_LEN) && 615 KRB5_OID_LEN) &&
583 !use_mskerberos) 616 !use_kerberos)
584 use_kerberos = true; 617 use_kerberos = true;
585 else if (compare_oid(oid, oidlen, NTLMSSP_OID, 618 else if (compare_oid(oid, oidlen, NTLMSSP_OID,
586 NTLMSSP_OID_LEN)) 619 NTLMSSP_OID_LEN))
@@ -593,7 +626,12 @@ decode_negTokenInit(unsigned char *security_blob, int length,
593 } 626 }
594 } 627 }
595 628
629 /* mechlistMIC */
596 if (asn1_header_decode(&ctx, &end, &cls, &con, &tag) == 0) { 630 if (asn1_header_decode(&ctx, &end, &cls, &con, &tag) == 0) {
631 /* Check if we have reached the end of the blob, but with
632 no mechListMic (e.g. NTLMSSP instead of KRB5) */
633 if (ctx.error == ASN1_ERR_DEC_EMPTY)
634 goto decode_negtoken_exit;
597 cFYI(1, ("Error decoding last part negTokenInit exit3")); 635 cFYI(1, ("Error decoding last part negTokenInit exit3"));
598 return 0; 636 return 0;
599 } else if ((cls != ASN1_CTX) || (con != ASN1_CON)) { 637 } else if ((cls != ASN1_CTX) || (con != ASN1_CON)) {
@@ -602,6 +640,8 @@ decode_negTokenInit(unsigned char *security_blob, int length,
602 cls, con, tag, end, *end)); 640 cls, con, tag, end, *end));
603 return 0; 641 return 0;
604 } 642 }
643
644 /* sequence */
605 if (asn1_header_decode(&ctx, &end, &cls, &con, &tag) == 0) { 645 if (asn1_header_decode(&ctx, &end, &cls, &con, &tag) == 0) {
606 cFYI(1, ("Error decoding last part negTokenInit exit5")); 646 cFYI(1, ("Error decoding last part negTokenInit exit5"));
607 return 0; 647 return 0;
@@ -611,6 +651,7 @@ decode_negTokenInit(unsigned char *security_blob, int length,
611 cls, con, tag, end, *end)); 651 cls, con, tag, end, *end));
612 } 652 }
613 653
654 /* sequence of */
614 if (asn1_header_decode(&ctx, &end, &cls, &con, &tag) == 0) { 655 if (asn1_header_decode(&ctx, &end, &cls, &con, &tag) == 0) {
615 cFYI(1, ("Error decoding last part negTokenInit exit 7")); 656 cFYI(1, ("Error decoding last part negTokenInit exit 7"));
616 return 0; 657 return 0;
@@ -619,6 +660,8 @@ decode_negTokenInit(unsigned char *security_blob, int length,
619 cls, con, tag, end, *end)); 660 cls, con, tag, end, *end));
620 return 0; 661 return 0;
621 } 662 }
663
664 /* general string */
622 if (asn1_header_decode(&ctx, &end, &cls, &con, &tag) == 0) { 665 if (asn1_header_decode(&ctx, &end, &cls, &con, &tag) == 0) {
623 cFYI(1, ("Error decoding last part negTokenInit exit9")); 666 cFYI(1, ("Error decoding last part negTokenInit exit9"));
624 return 0; 667 return 0;
@@ -630,13 +673,13 @@ decode_negTokenInit(unsigned char *security_blob, int length,
630 } 673 }
631 cFYI(1, ("Need to call asn1_octets_decode() function for %s", 674 cFYI(1, ("Need to call asn1_octets_decode() function for %s",
632 ctx.pointer)); /* is this UTF-8 or ASCII? */ 675 ctx.pointer)); /* is this UTF-8 or ASCII? */
633 676decode_negtoken_exit:
634 if (use_kerberos) 677 if (use_kerberos)
635 *secType = Kerberos; 678 *secType = Kerberos;
636 else if (use_mskerberos) 679 else if (use_mskerberos)
637 *secType = MSKerberos; 680 *secType = MSKerberos;
638 else if (use_ntlmssp) 681 else if (use_ntlmssp)
639 *secType = NTLMSSP; 682 *secType = RawNTLMSSP;
640 683
641 return 1; 684 return 1;
642} 685}
diff --git a/fs/cifs/cifs_debug.c b/fs/cifs/cifs_debug.c
index 7f19fefd3d45..42cec2a7c0cf 100644
--- a/fs/cifs/cifs_debug.c
+++ b/fs/cifs/cifs_debug.c
@@ -261,6 +261,8 @@ static ssize_t cifs_stats_proc_write(struct file *file,
261 atomic_set(&tcon->num_reads, 0); 261 atomic_set(&tcon->num_reads, 0);
262 atomic_set(&tcon->num_oplock_brks, 0); 262 atomic_set(&tcon->num_oplock_brks, 0);
263 atomic_set(&tcon->num_opens, 0); 263 atomic_set(&tcon->num_opens, 0);
264 atomic_set(&tcon->num_posixopens, 0);
265 atomic_set(&tcon->num_posixmkdirs, 0);
264 atomic_set(&tcon->num_closes, 0); 266 atomic_set(&tcon->num_closes, 0);
265 atomic_set(&tcon->num_deletes, 0); 267 atomic_set(&tcon->num_deletes, 0);
266 atomic_set(&tcon->num_mkdirs, 0); 268 atomic_set(&tcon->num_mkdirs, 0);
@@ -347,11 +349,15 @@ static int cifs_stats_proc_show(struct seq_file *m, void *v)
347 atomic_read(&tcon->num_locks), 349 atomic_read(&tcon->num_locks),
348 atomic_read(&tcon->num_hardlinks), 350 atomic_read(&tcon->num_hardlinks),
349 atomic_read(&tcon->num_symlinks)); 351 atomic_read(&tcon->num_symlinks));
350 seq_printf(m, "\nOpens: %d Closes: %d" 352 seq_printf(m, "\nOpens: %d Closes: %d "
351 "Deletes: %d", 353 "Deletes: %d",
352 atomic_read(&tcon->num_opens), 354 atomic_read(&tcon->num_opens),
353 atomic_read(&tcon->num_closes), 355 atomic_read(&tcon->num_closes),
354 atomic_read(&tcon->num_deletes)); 356 atomic_read(&tcon->num_deletes));
357 seq_printf(m, "\nPosix Opens: %d "
358 "Posix Mkdirs: %d",
359 atomic_read(&tcon->num_posixopens),
360 atomic_read(&tcon->num_posixmkdirs));
355 seq_printf(m, "\nMkdirs: %d Rmdirs: %d", 361 seq_printf(m, "\nMkdirs: %d Rmdirs: %d",
356 atomic_read(&tcon->num_mkdirs), 362 atomic_read(&tcon->num_mkdirs),
357 atomic_read(&tcon->num_rmdirs)); 363 atomic_read(&tcon->num_rmdirs));
diff --git a/fs/cifs/cifs_dfs_ref.c b/fs/cifs/cifs_dfs_ref.c
index 3bb11be8b6a8..606912d8f2a8 100644
--- a/fs/cifs/cifs_dfs_ref.c
+++ b/fs/cifs/cifs_dfs_ref.c
@@ -55,7 +55,7 @@ void cifs_dfs_release_automount_timer(void)
55 * i.e. strips from UNC trailing path that is not part of share 55 * i.e. strips from UNC trailing path that is not part of share
56 * name and fixup missing '\' in the begining of DFS node refferal 56 * name and fixup missing '\' in the begining of DFS node refferal
57 * if neccessary. 57 * if neccessary.
58 * Returns pointer to share name on success or NULL on error. 58 * Returns pointer to share name on success or ERR_PTR on error.
59 * Caller is responsible for freeing returned string. 59 * Caller is responsible for freeing returned string.
60 */ 60 */
61static char *cifs_get_share_name(const char *node_name) 61static char *cifs_get_share_name(const char *node_name)
@@ -68,7 +68,7 @@ static char *cifs_get_share_name(const char *node_name)
68 UNC = kmalloc(len+2 /*for term null and additional \ if it's missed */, 68 UNC = kmalloc(len+2 /*for term null and additional \ if it's missed */,
69 GFP_KERNEL); 69 GFP_KERNEL);
70 if (!UNC) 70 if (!UNC)
71 return NULL; 71 return ERR_PTR(-ENOMEM);
72 72
73 /* get share name and server name */ 73 /* get share name and server name */
74 if (node_name[1] != '\\') { 74 if (node_name[1] != '\\') {
@@ -87,7 +87,7 @@ static char *cifs_get_share_name(const char *node_name)
87 cERROR(1, ("%s: no server name end in node name: %s", 87 cERROR(1, ("%s: no server name end in node name: %s",
88 __func__, node_name)); 88 __func__, node_name));
89 kfree(UNC); 89 kfree(UNC);
90 return NULL; 90 return ERR_PTR(-EINVAL);
91 } 91 }
92 92
93 /* find sharename end */ 93 /* find sharename end */
@@ -133,6 +133,12 @@ char *cifs_compose_mount_options(const char *sb_mountdata,
133 return ERR_PTR(-EINVAL); 133 return ERR_PTR(-EINVAL);
134 134
135 *devname = cifs_get_share_name(ref->node_name); 135 *devname = cifs_get_share_name(ref->node_name);
136 if (IS_ERR(*devname)) {
137 rc = PTR_ERR(*devname);
138 *devname = NULL;
139 goto compose_mount_options_err;
140 }
141
136 rc = dns_resolve_server_name_to_ip(*devname, &srvIP); 142 rc = dns_resolve_server_name_to_ip(*devname, &srvIP);
137 if (rc != 0) { 143 if (rc != 0) {
138 cERROR(1, ("%s: Failed to resolve server part of %s to IP: %d", 144 cERROR(1, ("%s: Failed to resolve server part of %s to IP: %d",
diff --git a/fs/cifs/cifs_spnego.c b/fs/cifs/cifs_spnego.c
index 4a4581cb2b5e..051caecf7d67 100644
--- a/fs/cifs/cifs_spnego.c
+++ b/fs/cifs/cifs_spnego.c
@@ -86,6 +86,9 @@ struct key_type cifs_spnego_key_type = {
86/* strlen of ";user=" */ 86/* strlen of ";user=" */
87#define USER_KEY_LEN 6 87#define USER_KEY_LEN 6
88 88
89/* strlen of ";pid=0x" */
90#define PID_KEY_LEN 7
91
89/* get a key struct with a SPNEGO security blob, suitable for session setup */ 92/* get a key struct with a SPNEGO security blob, suitable for session setup */
90struct key * 93struct key *
91cifs_get_spnego_key(struct cifsSesInfo *sesInfo) 94cifs_get_spnego_key(struct cifsSesInfo *sesInfo)
@@ -103,7 +106,8 @@ cifs_get_spnego_key(struct cifsSesInfo *sesInfo)
103 IP_KEY_LEN + INET6_ADDRSTRLEN + 106 IP_KEY_LEN + INET6_ADDRSTRLEN +
104 MAX_MECH_STR_LEN + 107 MAX_MECH_STR_LEN +
105 UID_KEY_LEN + (sizeof(uid_t) * 2) + 108 UID_KEY_LEN + (sizeof(uid_t) * 2) +
106 USER_KEY_LEN + strlen(sesInfo->userName) + 1; 109 USER_KEY_LEN + strlen(sesInfo->userName) +
110 PID_KEY_LEN + (sizeof(pid_t) * 2) + 1;
107 111
108 spnego_key = ERR_PTR(-ENOMEM); 112 spnego_key = ERR_PTR(-ENOMEM);
109 description = kzalloc(desc_len, GFP_KERNEL); 113 description = kzalloc(desc_len, GFP_KERNEL);
@@ -141,6 +145,9 @@ cifs_get_spnego_key(struct cifsSesInfo *sesInfo)
141 dp = description + strlen(description); 145 dp = description + strlen(description);
142 sprintf(dp, ";user=%s", sesInfo->userName); 146 sprintf(dp, ";user=%s", sesInfo->userName);
143 147
148 dp = description + strlen(description);
149 sprintf(dp, ";pid=0x%x", current->pid);
150
144 cFYI(1, ("key description = %s", description)); 151 cFYI(1, ("key description = %s", description));
145 spnego_key = request_key(&cifs_spnego_key_type, description, ""); 152 spnego_key = request_key(&cifs_spnego_key_type, description, "");
146 153
diff --git a/fs/cifs/cifs_unicode.c b/fs/cifs/cifs_unicode.c
index 60e3c4253de0..714a542cbafc 100644
--- a/fs/cifs/cifs_unicode.c
+++ b/fs/cifs/cifs_unicode.c
@@ -44,7 +44,7 @@ cifs_ucs2_bytes(const __le16 *from, int maxbytes,
44 int maxwords = maxbytes / 2; 44 int maxwords = maxbytes / 2;
45 char tmp[NLS_MAX_CHARSET_SIZE]; 45 char tmp[NLS_MAX_CHARSET_SIZE];
46 46
47 for (i = 0; from[i] && i < maxwords; i++) { 47 for (i = 0; i < maxwords && from[i]; i++) {
48 charlen = codepage->uni2char(le16_to_cpu(from[i]), tmp, 48 charlen = codepage->uni2char(le16_to_cpu(from[i]), tmp,
49 NLS_MAX_CHARSET_SIZE); 49 NLS_MAX_CHARSET_SIZE);
50 if (charlen > 0) 50 if (charlen > 0)
diff --git a/fs/cifs/cifsacl.c b/fs/cifs/cifsacl.c
index 1403b5d86a73..6941c22398a6 100644
--- a/fs/cifs/cifsacl.c
+++ b/fs/cifs/cifsacl.c
@@ -327,7 +327,7 @@ static void dump_ace(struct cifs_ace *pace, char *end_of_acl)
327 327
328static void parse_dacl(struct cifs_acl *pdacl, char *end_of_acl, 328static void parse_dacl(struct cifs_acl *pdacl, char *end_of_acl,
329 struct cifs_sid *pownersid, struct cifs_sid *pgrpsid, 329 struct cifs_sid *pownersid, struct cifs_sid *pgrpsid,
330 struct inode *inode) 330 struct cifs_fattr *fattr)
331{ 331{
332 int i; 332 int i;
333 int num_aces = 0; 333 int num_aces = 0;
@@ -340,7 +340,7 @@ static void parse_dacl(struct cifs_acl *pdacl, char *end_of_acl,
340 if (!pdacl) { 340 if (!pdacl) {
341 /* no DACL in the security descriptor, set 341 /* no DACL in the security descriptor, set
342 all the permissions for user/group/other */ 342 all the permissions for user/group/other */
343 inode->i_mode |= S_IRWXUGO; 343 fattr->cf_mode |= S_IRWXUGO;
344 return; 344 return;
345 } 345 }
346 346
@@ -357,7 +357,7 @@ static void parse_dacl(struct cifs_acl *pdacl, char *end_of_acl,
357 /* reset rwx permissions for user/group/other. 357 /* reset rwx permissions for user/group/other.
358 Also, if num_aces is 0 i.e. DACL has no ACEs, 358 Also, if num_aces is 0 i.e. DACL has no ACEs,
359 user/group/other have no permissions */ 359 user/group/other have no permissions */
360 inode->i_mode &= ~(S_IRWXUGO); 360 fattr->cf_mode &= ~(S_IRWXUGO);
361 361
362 acl_base = (char *)pdacl; 362 acl_base = (char *)pdacl;
363 acl_size = sizeof(struct cifs_acl); 363 acl_size = sizeof(struct cifs_acl);
@@ -379,17 +379,17 @@ static void parse_dacl(struct cifs_acl *pdacl, char *end_of_acl,
379 if (compare_sids(&(ppace[i]->sid), pownersid)) 379 if (compare_sids(&(ppace[i]->sid), pownersid))
380 access_flags_to_mode(ppace[i]->access_req, 380 access_flags_to_mode(ppace[i]->access_req,
381 ppace[i]->type, 381 ppace[i]->type,
382 &(inode->i_mode), 382 &fattr->cf_mode,
383 &user_mask); 383 &user_mask);
384 if (compare_sids(&(ppace[i]->sid), pgrpsid)) 384 if (compare_sids(&(ppace[i]->sid), pgrpsid))
385 access_flags_to_mode(ppace[i]->access_req, 385 access_flags_to_mode(ppace[i]->access_req,
386 ppace[i]->type, 386 ppace[i]->type,
387 &(inode->i_mode), 387 &fattr->cf_mode,
388 &group_mask); 388 &group_mask);
389 if (compare_sids(&(ppace[i]->sid), &sid_everyone)) 389 if (compare_sids(&(ppace[i]->sid), &sid_everyone))
390 access_flags_to_mode(ppace[i]->access_req, 390 access_flags_to_mode(ppace[i]->access_req,
391 ppace[i]->type, 391 ppace[i]->type,
392 &(inode->i_mode), 392 &fattr->cf_mode,
393 &other_mask); 393 &other_mask);
394 394
395/* memcpy((void *)(&(cifscred->aces[i])), 395/* memcpy((void *)(&(cifscred->aces[i])),
@@ -464,7 +464,7 @@ static int parse_sid(struct cifs_sid *psid, char *end_of_acl)
464 464
465/* Convert CIFS ACL to POSIX form */ 465/* Convert CIFS ACL to POSIX form */
466static int parse_sec_desc(struct cifs_ntsd *pntsd, int acl_len, 466static int parse_sec_desc(struct cifs_ntsd *pntsd, int acl_len,
467 struct inode *inode) 467 struct cifs_fattr *fattr)
468{ 468{
469 int rc; 469 int rc;
470 struct cifs_sid *owner_sid_ptr, *group_sid_ptr; 470 struct cifs_sid *owner_sid_ptr, *group_sid_ptr;
@@ -472,7 +472,7 @@ static int parse_sec_desc(struct cifs_ntsd *pntsd, int acl_len,
472 char *end_of_acl = ((char *)pntsd) + acl_len; 472 char *end_of_acl = ((char *)pntsd) + acl_len;
473 __u32 dacloffset; 473 __u32 dacloffset;
474 474
475 if ((inode == NULL) || (pntsd == NULL)) 475 if (pntsd == NULL)
476 return -EIO; 476 return -EIO;
477 477
478 owner_sid_ptr = (struct cifs_sid *)((char *)pntsd + 478 owner_sid_ptr = (struct cifs_sid *)((char *)pntsd +
@@ -497,7 +497,7 @@ static int parse_sec_desc(struct cifs_ntsd *pntsd, int acl_len,
497 497
498 if (dacloffset) 498 if (dacloffset)
499 parse_dacl(dacl_ptr, end_of_acl, owner_sid_ptr, 499 parse_dacl(dacl_ptr, end_of_acl, owner_sid_ptr,
500 group_sid_ptr, inode); 500 group_sid_ptr, fattr);
501 else 501 else
502 cFYI(1, ("no ACL")); /* BB grant all or default perms? */ 502 cFYI(1, ("no ACL")); /* BB grant all or default perms? */
503 503
@@ -508,7 +508,6 @@ static int parse_sec_desc(struct cifs_ntsd *pntsd, int acl_len,
508 memcpy((void *)(&(cifscred->gsid)), (void *)group_sid_ptr, 508 memcpy((void *)(&(cifscred->gsid)), (void *)group_sid_ptr,
509 sizeof(struct cifs_sid)); */ 509 sizeof(struct cifs_sid)); */
510 510
511
512 return 0; 511 return 0;
513} 512}
514 513
@@ -671,8 +670,9 @@ static int set_cifs_acl(struct cifs_ntsd *pnntsd, __u32 acllen,
671} 670}
672 671
673/* Translate the CIFS ACL (simlar to NTFS ACL) for a file into mode bits */ 672/* Translate the CIFS ACL (simlar to NTFS ACL) for a file into mode bits */
674void acl_to_uid_mode(struct cifs_sb_info *cifs_sb, struct inode *inode, 673void
675 const char *path, const __u16 *pfid) 674cifs_acl_to_fattr(struct cifs_sb_info *cifs_sb, struct cifs_fattr *fattr,
675 struct inode *inode, const char *path, const __u16 *pfid)
676{ 676{
677 struct cifs_ntsd *pntsd = NULL; 677 struct cifs_ntsd *pntsd = NULL;
678 u32 acllen = 0; 678 u32 acllen = 0;
@@ -687,7 +687,7 @@ void acl_to_uid_mode(struct cifs_sb_info *cifs_sb, struct inode *inode,
687 687
688 /* if we can retrieve the ACL, now parse Access Control Entries, ACEs */ 688 /* if we can retrieve the ACL, now parse Access Control Entries, ACEs */
689 if (pntsd) 689 if (pntsd)
690 rc = parse_sec_desc(pntsd, acllen, inode); 690 rc = parse_sec_desc(pntsd, acllen, fattr);
691 if (rc) 691 if (rc)
692 cFYI(1, ("parse sec desc failed rc = %d", rc)); 692 cFYI(1, ("parse sec desc failed rc = %d", rc));
693 693
diff --git a/fs/cifs/cifsfs.c b/fs/cifs/cifsfs.c
index 0d92114195ab..84b75253b05a 100644
--- a/fs/cifs/cifsfs.c
+++ b/fs/cifs/cifsfs.c
@@ -308,7 +308,6 @@ cifs_alloc_inode(struct super_block *sb)
308 if (!cifs_inode) 308 if (!cifs_inode)
309 return NULL; 309 return NULL;
310 cifs_inode->cifsAttrs = 0x20; /* default */ 310 cifs_inode->cifsAttrs = 0x20; /* default */
311 atomic_set(&cifs_inode->inUse, 0);
312 cifs_inode->time = 0; 311 cifs_inode->time = 0;
313 cifs_inode->write_behind_rc = 0; 312 cifs_inode->write_behind_rc = 0;
314 /* Until the file is open and we have gotten oplock 313 /* Until the file is open and we have gotten oplock
@@ -333,6 +332,27 @@ cifs_destroy_inode(struct inode *inode)
333 kmem_cache_free(cifs_inode_cachep, CIFS_I(inode)); 332 kmem_cache_free(cifs_inode_cachep, CIFS_I(inode));
334} 333}
335 334
335static void
336cifs_show_address(struct seq_file *s, struct TCP_Server_Info *server)
337{
338 seq_printf(s, ",addr=");
339
340 switch (server->addr.sockAddr.sin_family) {
341 case AF_INET:
342 seq_printf(s, "%pI4", &server->addr.sockAddr.sin_addr.s_addr);
343 break;
344 case AF_INET6:
345 seq_printf(s, "%pI6",
346 &server->addr.sockAddr6.sin6_addr.s6_addr);
347 if (server->addr.sockAddr6.sin6_scope_id)
348 seq_printf(s, "%%%u",
349 server->addr.sockAddr6.sin6_scope_id);
350 break;
351 default:
352 seq_printf(s, "(unknown)");
353 }
354}
355
336/* 356/*
337 * cifs_show_options() is for displaying mount options in /proc/mounts. 357 * cifs_show_options() is for displaying mount options in /proc/mounts.
338 * Not all settable options are displayed but most of the important 358 * Not all settable options are displayed but most of the important
@@ -343,83 +363,68 @@ cifs_show_options(struct seq_file *s, struct vfsmount *m)
343{ 363{
344 struct cifs_sb_info *cifs_sb; 364 struct cifs_sb_info *cifs_sb;
345 struct cifsTconInfo *tcon; 365 struct cifsTconInfo *tcon;
346 struct TCP_Server_Info *server;
347 366
348 cifs_sb = CIFS_SB(m->mnt_sb); 367 cifs_sb = CIFS_SB(m->mnt_sb);
368 tcon = cifs_sb->tcon;
349 369
350 if (cifs_sb) { 370 seq_printf(s, ",unc=%s", cifs_sb->tcon->treeName);
351 tcon = cifs_sb->tcon; 371 if (tcon->ses->userName)
352 if (tcon) { 372 seq_printf(s, ",username=%s", tcon->ses->userName);
353 seq_printf(s, ",unc=%s", cifs_sb->tcon->treeName); 373 if (tcon->ses->domainName)
354 if (tcon->ses) { 374 seq_printf(s, ",domain=%s", tcon->ses->domainName);
355 if (tcon->ses->userName) 375
356 seq_printf(s, ",username=%s", 376 seq_printf(s, ",uid=%d", cifs_sb->mnt_uid);
357 tcon->ses->userName); 377 if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_OVERR_UID)
358 if (tcon->ses->domainName) 378 seq_printf(s, ",forceuid");
359 seq_printf(s, ",domain=%s", 379 else
360 tcon->ses->domainName); 380 seq_printf(s, ",noforceuid");
361 server = tcon->ses->server; 381
362 if (server) { 382 seq_printf(s, ",gid=%d", cifs_sb->mnt_gid);
363 seq_printf(s, ",addr="); 383 if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_OVERR_GID)
364 switch (server->addr.sockAddr6. 384 seq_printf(s, ",forcegid");
365 sin6_family) { 385 else
366 case AF_INET6: 386 seq_printf(s, ",noforcegid");
367 seq_printf(s, "%pI6", 387
368 &server->addr.sockAddr6.sin6_addr); 388 cifs_show_address(s, tcon->ses->server);
369 break; 389
370 case AF_INET: 390 if (!tcon->unix_ext)
371 seq_printf(s, "%pI4", 391 seq_printf(s, ",file_mode=0%o,dir_mode=0%o",
372 &server->addr.sockAddr.sin_addr.s_addr);
373 break;
374 }
375 }
376 }
377 if ((cifs_sb->mnt_cifs_flags & CIFS_MOUNT_OVERR_UID) ||
378 !(tcon->unix_ext))
379 seq_printf(s, ",uid=%d", cifs_sb->mnt_uid);
380 if ((cifs_sb->mnt_cifs_flags & CIFS_MOUNT_OVERR_GID) ||
381 !(tcon->unix_ext))
382 seq_printf(s, ",gid=%d", cifs_sb->mnt_gid);
383 if (!tcon->unix_ext) {
384 seq_printf(s, ",file_mode=0%o,dir_mode=0%o",
385 cifs_sb->mnt_file_mode, 392 cifs_sb->mnt_file_mode,
386 cifs_sb->mnt_dir_mode); 393 cifs_sb->mnt_dir_mode);
387 } 394 if (tcon->seal)
388 if (tcon->seal) 395 seq_printf(s, ",seal");
389 seq_printf(s, ",seal"); 396 if (tcon->nocase)
390 if (tcon->nocase) 397 seq_printf(s, ",nocase");
391 seq_printf(s, ",nocase"); 398 if (tcon->retry)
392 if (tcon->retry) 399 seq_printf(s, ",hard");
393 seq_printf(s, ",hard"); 400 if (cifs_sb->prepath)
394 } 401 seq_printf(s, ",prepath=%s", cifs_sb->prepath);
395 if (cifs_sb->prepath) 402 if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_POSIX_PATHS)
396 seq_printf(s, ",prepath=%s", cifs_sb->prepath); 403 seq_printf(s, ",posixpaths");
397 if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_POSIX_PATHS) 404 if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_SET_UID)
398 seq_printf(s, ",posixpaths"); 405 seq_printf(s, ",setuids");
399 if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_SET_UID) 406 if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_SERVER_INUM)
400 seq_printf(s, ",setuids"); 407 seq_printf(s, ",serverino");
401 if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_SERVER_INUM) 408 if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_DIRECT_IO)
402 seq_printf(s, ",serverino"); 409 seq_printf(s, ",directio");
403 if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_DIRECT_IO) 410 if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_NO_XATTR)
404 seq_printf(s, ",directio"); 411 seq_printf(s, ",nouser_xattr");
405 if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_NO_XATTR) 412 if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MAP_SPECIAL_CHR)
406 seq_printf(s, ",nouser_xattr"); 413 seq_printf(s, ",mapchars");
407 if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MAP_SPECIAL_CHR) 414 if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_UNX_EMUL)
408 seq_printf(s, ",mapchars"); 415 seq_printf(s, ",sfu");
409 if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_UNX_EMUL) 416 if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_NO_BRL)
410 seq_printf(s, ",sfu"); 417 seq_printf(s, ",nobrl");
411 if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_NO_BRL) 418 if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_CIFS_ACL)
412 seq_printf(s, ",nobrl"); 419 seq_printf(s, ",cifsacl");
413 if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_CIFS_ACL) 420 if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_DYNPERM)
414 seq_printf(s, ",cifsacl"); 421 seq_printf(s, ",dynperm");
415 if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_DYNPERM) 422 if (m->mnt_sb->s_flags & MS_POSIXACL)
416 seq_printf(s, ",dynperm"); 423 seq_printf(s, ",acl");
417 if (m->mnt_sb->s_flags & MS_POSIXACL) 424
418 seq_printf(s, ",acl"); 425 seq_printf(s, ",rsize=%d", cifs_sb->rsize);
419 426 seq_printf(s, ",wsize=%d", cifs_sb->wsize);
420 seq_printf(s, ",rsize=%d", cifs_sb->rsize); 427
421 seq_printf(s, ",wsize=%d", cifs_sb->wsize);
422 }
423 return 0; 428 return 0;
424} 429}
425 430
@@ -535,9 +540,14 @@ static void cifs_umount_begin(struct super_block *sb)
535 if (tcon == NULL) 540 if (tcon == NULL)
536 return; 541 return;
537 542
538 lock_kernel();
539 read_lock(&cifs_tcp_ses_lock); 543 read_lock(&cifs_tcp_ses_lock);
540 if (tcon->tc_count == 1) 544 if ((tcon->tc_count > 1) || (tcon->tidStatus == CifsExiting)) {
545 /* we have other mounts to same share or we have
546 already tried to force umount this and woken up
547 all waiting network requests, nothing to do */
548 read_unlock(&cifs_tcp_ses_lock);
549 return;
550 } else if (tcon->tc_count == 1)
541 tcon->tidStatus = CifsExiting; 551 tcon->tidStatus = CifsExiting;
542 read_unlock(&cifs_tcp_ses_lock); 552 read_unlock(&cifs_tcp_ses_lock);
543 553
@@ -552,9 +562,7 @@ static void cifs_umount_begin(struct super_block *sb)
552 wake_up_all(&tcon->ses->server->response_q); 562 wake_up_all(&tcon->ses->server->response_q);
553 msleep(1); 563 msleep(1);
554 } 564 }
555/* BB FIXME - finish add checks for tidStatus BB */
556 565
557 unlock_kernel();
558 return; 566 return;
559} 567}
560 568
diff --git a/fs/cifs/cifsfs.h b/fs/cifs/cifsfs.h
index 9570a0e8023f..6c170948300d 100644
--- a/fs/cifs/cifsfs.h
+++ b/fs/cifs/cifsfs.h
@@ -24,6 +24,19 @@
24 24
25#define ROOT_I 2 25#define ROOT_I 2
26 26
27/*
28 * ino_t is 32-bits on 32-bit arch. We have to squash the 64-bit value down
29 * so that it will fit.
30 */
31static inline ino_t
32cifs_uniqueid_to_ino_t(u64 fileid)
33{
34 ino_t ino = (ino_t) fileid;
35 if (sizeof(ino_t) < sizeof(u64))
36 ino ^= fileid >> (sizeof(u64)-sizeof(ino_t)) * 8;
37 return ino;
38}
39
27extern struct file_system_type cifs_fs_type; 40extern struct file_system_type cifs_fs_type;
28extern const struct address_space_operations cifs_addr_ops; 41extern const struct address_space_operations cifs_addr_ops;
29extern const struct address_space_operations cifs_addr_ops_smallbuf; 42extern const struct address_space_operations cifs_addr_ops_smallbuf;
@@ -100,5 +113,5 @@ extern long cifs_ioctl(struct file *filep, unsigned int cmd, unsigned long arg);
100extern const struct export_operations cifs_export_ops; 113extern const struct export_operations cifs_export_ops;
101#endif /* EXPERIMENTAL */ 114#endif /* EXPERIMENTAL */
102 115
103#define CIFS_VERSION "1.59" 116#define CIFS_VERSION "1.60"
104#endif /* _CIFSFS_H */ 117#endif /* _CIFSFS_H */
diff --git a/fs/cifs/cifsglob.h b/fs/cifs/cifsglob.h
index a61ab772c6f6..6084d6379c03 100644
--- a/fs/cifs/cifsglob.h
+++ b/fs/cifs/cifsglob.h
@@ -83,7 +83,7 @@ enum securityEnum {
83 NTLM, /* Legacy NTLM012 auth with NTLM hash */ 83 NTLM, /* Legacy NTLM012 auth with NTLM hash */
84 NTLMv2, /* Legacy NTLM auth with NTLMv2 hash */ 84 NTLMv2, /* Legacy NTLM auth with NTLMv2 hash */
85 RawNTLMSSP, /* NTLMSSP without SPNEGO, NTLMv2 hash */ 85 RawNTLMSSP, /* NTLMSSP without SPNEGO, NTLMv2 hash */
86 NTLMSSP, /* NTLMSSP via SPNEGO, NTLMv2 hash */ 86/* NTLMSSP, */ /* can use rawNTLMSSP instead of NTLMSSP via SPNEGO */
87 Kerberos, /* Kerberos via SPNEGO */ 87 Kerberos, /* Kerberos via SPNEGO */
88 MSKerberos, /* MS Kerberos via SPNEGO */ 88 MSKerberos, /* MS Kerberos via SPNEGO */
89}; 89};
@@ -260,6 +260,8 @@ struct cifsTconInfo {
260 atomic_t num_closes; 260 atomic_t num_closes;
261 atomic_t num_deletes; 261 atomic_t num_deletes;
262 atomic_t num_mkdirs; 262 atomic_t num_mkdirs;
263 atomic_t num_posixopens;
264 atomic_t num_posixmkdirs;
263 atomic_t num_rmdirs; 265 atomic_t num_rmdirs;
264 atomic_t num_renames; 266 atomic_t num_renames;
265 atomic_t num_t2renames; 267 atomic_t num_t2renames;
@@ -364,13 +366,13 @@ struct cifsInodeInfo {
364 struct list_head openFileList; 366 struct list_head openFileList;
365 int write_behind_rc; 367 int write_behind_rc;
366 __u32 cifsAttrs; /* e.g. DOS archive bit, sparse, compressed, system */ 368 __u32 cifsAttrs; /* e.g. DOS archive bit, sparse, compressed, system */
367 atomic_t inUse; /* num concurrent users (local openers cifs) of file*/
368 unsigned long time; /* jiffies of last update/check of inode */ 369 unsigned long time; /* jiffies of last update/check of inode */
369 bool clientCanCacheRead:1; /* read oplock */ 370 bool clientCanCacheRead:1; /* read oplock */
370 bool clientCanCacheAll:1; /* read and writebehind oplock */ 371 bool clientCanCacheAll:1; /* read and writebehind oplock */
371 bool oplockPending:1; 372 bool oplockPending:1;
372 bool delete_pending:1; /* DELETE_ON_CLOSE is set */ 373 bool delete_pending:1; /* DELETE_ON_CLOSE is set */
373 u64 server_eof; /* current file size on server */ 374 u64 server_eof; /* current file size on server */
375 u64 uniqueid; /* server inode number */
374 struct inode vfs_inode; 376 struct inode vfs_inode;
375}; 377};
376 378
@@ -472,6 +474,32 @@ struct dfs_info3_param {
472 char *node_name; 474 char *node_name;
473}; 475};
474 476
477/*
478 * common struct for holding inode info when searching for or updating an
479 * inode with new info
480 */
481
482#define CIFS_FATTR_DFS_REFERRAL 0x1
483#define CIFS_FATTR_DELETE_PENDING 0x2
484#define CIFS_FATTR_NEED_REVAL 0x4
485
486struct cifs_fattr {
487 u32 cf_flags;
488 u32 cf_cifsattrs;
489 u64 cf_uniqueid;
490 u64 cf_eof;
491 u64 cf_bytes;
492 uid_t cf_uid;
493 gid_t cf_gid;
494 umode_t cf_mode;
495 dev_t cf_rdev;
496 unsigned int cf_nlink;
497 unsigned int cf_dtype;
498 struct timespec cf_atime;
499 struct timespec cf_mtime;
500 struct timespec cf_ctime;
501};
502
475static inline void free_dfs_info_param(struct dfs_info3_param *param) 503static inline void free_dfs_info_param(struct dfs_info3_param *param)
476{ 504{
477 if (param) { 505 if (param) {
diff --git a/fs/cifs/cifspdu.h b/fs/cifs/cifspdu.h
index a785f69dbc9f..2d07f890a842 100644
--- a/fs/cifs/cifspdu.h
+++ b/fs/cifs/cifspdu.h
@@ -2328,19 +2328,7 @@ struct file_attrib_tag {
2328typedef struct { 2328typedef struct {
2329 __le32 NextEntryOffset; 2329 __le32 NextEntryOffset;
2330 __u32 ResumeKey; /* as with FileIndex - no need to convert */ 2330 __u32 ResumeKey; /* as with FileIndex - no need to convert */
2331 __le64 EndOfFile; 2331 FILE_UNIX_BASIC_INFO basic;
2332 __le64 NumOfBytes;
2333 __le64 LastStatusChange; /*SNIA specs DCE time for the 3 time fields */
2334 __le64 LastAccessTime;
2335 __le64 LastModificationTime;
2336 __le64 Uid;
2337 __le64 Gid;
2338 __le32 Type;
2339 __le64 DevMajor;
2340 __le64 DevMinor;
2341 __le64 UniqueId;
2342 __le64 Permissions;
2343 __le64 Nlinks;
2344 char FileName[1]; 2332 char FileName[1];
2345} __attribute__((packed)) FILE_UNIX_INFO; /* level 0x202 */ 2333} __attribute__((packed)) FILE_UNIX_INFO; /* level 0x202 */
2346 2334
diff --git a/fs/cifs/cifsproto.h b/fs/cifs/cifsproto.h
index f9452329bcce..da8fbf565991 100644
--- a/fs/cifs/cifsproto.h
+++ b/fs/cifs/cifsproto.h
@@ -74,7 +74,7 @@ extern unsigned int smbCalcSize(struct smb_hdr *ptr);
74extern unsigned int smbCalcSize_LE(struct smb_hdr *ptr); 74extern unsigned int smbCalcSize_LE(struct smb_hdr *ptr);
75extern int decode_negTokenInit(unsigned char *security_blob, int length, 75extern int decode_negTokenInit(unsigned char *security_blob, int length,
76 enum securityEnum *secType); 76 enum securityEnum *secType);
77extern int cifs_inet_pton(const int, const char *source, void *dst); 77extern int cifs_convert_address(char *src, void *dst);
78extern int map_smb_to_linux_error(struct smb_hdr *smb, int logErr); 78extern int map_smb_to_linux_error(struct smb_hdr *smb, int logErr);
79extern void header_assemble(struct smb_hdr *, char /* command */ , 79extern void header_assemble(struct smb_hdr *, char /* command */ ,
80 const struct cifsTconInfo *, int /* length of 80 const struct cifsTconInfo *, int /* length of
@@ -98,9 +98,13 @@ extern struct timespec cnvrtDosUnixTm(__le16 le_date, __le16 le_time,
98extern int cifs_posix_open(char *full_path, struct inode **pinode, 98extern int cifs_posix_open(char *full_path, struct inode **pinode,
99 struct super_block *sb, int mode, int oflags, 99 struct super_block *sb, int mode, int oflags,
100 int *poplock, __u16 *pnetfid, int xid); 100 int *poplock, __u16 *pnetfid, int xid);
101extern void posix_fill_in_inode(struct inode *tmp_inode, 101extern void cifs_unix_basic_to_fattr(struct cifs_fattr *fattr,
102 FILE_UNIX_BASIC_INFO *pData, int isNewInode); 102 FILE_UNIX_BASIC_INFO *info,
103extern struct inode *cifs_new_inode(struct super_block *sb, __u64 *inum); 103 struct cifs_sb_info *cifs_sb);
104extern void cifs_fattr_to_inode(struct inode *inode, struct cifs_fattr *fattr);
105extern struct inode *cifs_iget(struct super_block *sb,
106 struct cifs_fattr *fattr);
107
104extern int cifs_get_inode_info(struct inode **pinode, 108extern int cifs_get_inode_info(struct inode **pinode,
105 const unsigned char *search_path, 109 const unsigned char *search_path,
106 FILE_ALL_INFO *pfile_info, 110 FILE_ALL_INFO *pfile_info,
@@ -108,8 +112,9 @@ extern int cifs_get_inode_info(struct inode **pinode,
108extern int cifs_get_inode_info_unix(struct inode **pinode, 112extern int cifs_get_inode_info_unix(struct inode **pinode,
109 const unsigned char *search_path, 113 const unsigned char *search_path,
110 struct super_block *sb, int xid); 114 struct super_block *sb, int xid);
111extern void acl_to_uid_mode(struct cifs_sb_info *cifs_sb, struct inode *inode, 115extern void cifs_acl_to_fattr(struct cifs_sb_info *cifs_sb,
112 const char *path, const __u16 *pfid); 116 struct cifs_fattr *fattr, struct inode *inode,
117 const char *path, const __u16 *pfid);
113extern int mode_to_acl(struct inode *inode, const char *path, __u64); 118extern int mode_to_acl(struct inode *inode, const char *path, __u64);
114 119
115extern int cifs_mount(struct super_block *, struct cifs_sb_info *, char *, 120extern int cifs_mount(struct super_block *, struct cifs_sb_info *, char *,
@@ -215,7 +220,11 @@ struct cifs_unix_set_info_args {
215 dev_t device; 220 dev_t device;
216}; 221};
217 222
218extern int CIFSSMBUnixSetInfo(const int xid, struct cifsTconInfo *pTcon, 223extern int CIFSSMBUnixSetFileInfo(const int xid, struct cifsTconInfo *tcon,
224 const struct cifs_unix_set_info_args *args,
225 u16 fid, u32 pid_of_opener);
226
227extern int CIFSSMBUnixSetPathInfo(const int xid, struct cifsTconInfo *pTcon,
219 char *fileName, 228 char *fileName,
220 const struct cifs_unix_set_info_args *args, 229 const struct cifs_unix_set_info_args *args,
221 const struct nls_table *nls_codepage, 230 const struct nls_table *nls_codepage,
diff --git a/fs/cifs/cifssmb.c b/fs/cifs/cifssmb.c
index b84c61d5bca4..1866bc2927d4 100644
--- a/fs/cifs/cifssmb.c
+++ b/fs/cifs/cifssmb.c
@@ -594,7 +594,7 @@ CIFSSMBNegotiate(unsigned int xid, struct cifsSesInfo *ses)
594 else if (secFlags & CIFSSEC_MAY_KRB5) 594 else if (secFlags & CIFSSEC_MAY_KRB5)
595 server->secType = Kerberos; 595 server->secType = Kerberos;
596 else if (secFlags & CIFSSEC_MAY_NTLMSSP) 596 else if (secFlags & CIFSSEC_MAY_NTLMSSP)
597 server->secType = NTLMSSP; 597 server->secType = RawNTLMSSP;
598 else if (secFlags & CIFSSEC_MAY_LANMAN) 598 else if (secFlags & CIFSSEC_MAY_LANMAN)
599 server->secType = LANMAN; 599 server->secType = LANMAN;
600/* #ifdef CONFIG_CIFS_EXPERIMENTAL 600/* #ifdef CONFIG_CIFS_EXPERIMENTAL
@@ -729,7 +729,7 @@ CIFSSMBTDis(const int xid, struct cifsTconInfo *tcon)
729 * the tcon is no longer on the list, so no need to take lock before 729 * the tcon is no longer on the list, so no need to take lock before
730 * checking this. 730 * checking this.
731 */ 731 */
732 if (tcon->need_reconnect) 732 if ((tcon->need_reconnect) || (tcon->ses->need_reconnect))
733 return 0; 733 return 0;
734 734
735 rc = small_smb_init(SMB_COM_TREE_DISCONNECT, 0, tcon, 735 rc = small_smb_init(SMB_COM_TREE_DISCONNECT, 0, tcon,
@@ -1113,7 +1113,10 @@ PsxCreat:
1113psx_create_err: 1113psx_create_err:
1114 cifs_buf_release(pSMB); 1114 cifs_buf_release(pSMB);
1115 1115
1116 cifs_stats_inc(&tcon->num_mkdirs); 1116 if (posix_flags & SMB_O_DIRECTORY)
1117 cifs_stats_inc(&tcon->num_posixmkdirs);
1118 else
1119 cifs_stats_inc(&tcon->num_posixopens);
1117 1120
1118 if (rc == -EAGAIN) 1121 if (rc == -EAGAIN)
1119 goto PsxCreat; 1122 goto PsxCreat;
@@ -5074,10 +5077,114 @@ SetAttrLgcyRetry:
5074} 5077}
5075#endif /* temporarily unneeded SetAttr legacy function */ 5078#endif /* temporarily unneeded SetAttr legacy function */
5076 5079
5080static void
5081cifs_fill_unix_set_info(FILE_UNIX_BASIC_INFO *data_offset,
5082 const struct cifs_unix_set_info_args *args)
5083{
5084 u64 mode = args->mode;
5085
5086 /*
5087 * Samba server ignores set of file size to zero due to bugs in some
5088 * older clients, but we should be precise - we use SetFileSize to
5089 * set file size and do not want to truncate file size to zero
5090 * accidently as happened on one Samba server beta by putting
5091 * zero instead of -1 here
5092 */
5093 data_offset->EndOfFile = cpu_to_le64(NO_CHANGE_64);
5094 data_offset->NumOfBytes = cpu_to_le64(NO_CHANGE_64);
5095 data_offset->LastStatusChange = cpu_to_le64(args->ctime);
5096 data_offset->LastAccessTime = cpu_to_le64(args->atime);
5097 data_offset->LastModificationTime = cpu_to_le64(args->mtime);
5098 data_offset->Uid = cpu_to_le64(args->uid);
5099 data_offset->Gid = cpu_to_le64(args->gid);
5100 /* better to leave device as zero when it is */
5101 data_offset->DevMajor = cpu_to_le64(MAJOR(args->device));
5102 data_offset->DevMinor = cpu_to_le64(MINOR(args->device));
5103 data_offset->Permissions = cpu_to_le64(mode);
5104
5105 if (S_ISREG(mode))
5106 data_offset->Type = cpu_to_le32(UNIX_FILE);
5107 else if (S_ISDIR(mode))
5108 data_offset->Type = cpu_to_le32(UNIX_DIR);
5109 else if (S_ISLNK(mode))
5110 data_offset->Type = cpu_to_le32(UNIX_SYMLINK);
5111 else if (S_ISCHR(mode))
5112 data_offset->Type = cpu_to_le32(UNIX_CHARDEV);
5113 else if (S_ISBLK(mode))
5114 data_offset->Type = cpu_to_le32(UNIX_BLOCKDEV);
5115 else if (S_ISFIFO(mode))
5116 data_offset->Type = cpu_to_le32(UNIX_FIFO);
5117 else if (S_ISSOCK(mode))
5118 data_offset->Type = cpu_to_le32(UNIX_SOCKET);
5119}
5120
5077int 5121int
5078CIFSSMBUnixSetInfo(const int xid, struct cifsTconInfo *tcon, char *fileName, 5122CIFSSMBUnixSetFileInfo(const int xid, struct cifsTconInfo *tcon,
5079 const struct cifs_unix_set_info_args *args, 5123 const struct cifs_unix_set_info_args *args,
5080 const struct nls_table *nls_codepage, int remap) 5124 u16 fid, u32 pid_of_opener)
5125{
5126 struct smb_com_transaction2_sfi_req *pSMB = NULL;
5127 FILE_UNIX_BASIC_INFO *data_offset;
5128 int rc = 0;
5129 u16 params, param_offset, offset, byte_count, count;
5130
5131 cFYI(1, ("Set Unix Info (via SetFileInfo)"));
5132 rc = small_smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB);
5133
5134 if (rc)
5135 return rc;
5136
5137 pSMB->hdr.Pid = cpu_to_le16((__u16)pid_of_opener);
5138 pSMB->hdr.PidHigh = cpu_to_le16((__u16)(pid_of_opener >> 16));
5139
5140 params = 6;
5141 pSMB->MaxSetupCount = 0;
5142 pSMB->Reserved = 0;
5143 pSMB->Flags = 0;
5144 pSMB->Timeout = 0;
5145 pSMB->Reserved2 = 0;
5146 param_offset = offsetof(struct smb_com_transaction2_sfi_req, Fid) - 4;
5147 offset = param_offset + params;
5148
5149 data_offset = (FILE_UNIX_BASIC_INFO *)
5150 ((char *)(&pSMB->hdr.Protocol) + offset);
5151 count = sizeof(FILE_UNIX_BASIC_INFO);
5152
5153 pSMB->MaxParameterCount = cpu_to_le16(2);
5154 /* BB find max SMB PDU from sess */
5155 pSMB->MaxDataCount = cpu_to_le16(1000);
5156 pSMB->SetupCount = 1;
5157 pSMB->Reserved3 = 0;
5158 pSMB->SubCommand = cpu_to_le16(TRANS2_SET_FILE_INFORMATION);
5159 byte_count = 3 /* pad */ + params + count;
5160 pSMB->DataCount = cpu_to_le16(count);
5161 pSMB->ParameterCount = cpu_to_le16(params);
5162 pSMB->TotalDataCount = pSMB->DataCount;
5163 pSMB->TotalParameterCount = pSMB->ParameterCount;
5164 pSMB->ParameterOffset = cpu_to_le16(param_offset);
5165 pSMB->DataOffset = cpu_to_le16(offset);
5166 pSMB->Fid = fid;
5167 pSMB->InformationLevel = cpu_to_le16(SMB_SET_FILE_UNIX_BASIC);
5168 pSMB->Reserved4 = 0;
5169 pSMB->hdr.smb_buf_length += byte_count;
5170 pSMB->ByteCount = cpu_to_le16(byte_count);
5171
5172 cifs_fill_unix_set_info(data_offset, args);
5173
5174 rc = SendReceiveNoRsp(xid, tcon->ses, (struct smb_hdr *) pSMB, 0);
5175 if (rc)
5176 cFYI(1, ("Send error in Set Time (SetFileInfo) = %d", rc));
5177
5178 /* Note: On -EAGAIN error only caller can retry on handle based calls
5179 since file handle passed in no longer valid */
5180
5181 return rc;
5182}
5183
5184int
5185CIFSSMBUnixSetPathInfo(const int xid, struct cifsTconInfo *tcon, char *fileName,
5186 const struct cifs_unix_set_info_args *args,
5187 const struct nls_table *nls_codepage, int remap)
5081{ 5188{
5082 TRANSACTION2_SPI_REQ *pSMB = NULL; 5189 TRANSACTION2_SPI_REQ *pSMB = NULL;
5083 TRANSACTION2_SPI_RSP *pSMBr = NULL; 5190 TRANSACTION2_SPI_RSP *pSMBr = NULL;
@@ -5086,7 +5193,6 @@ CIFSSMBUnixSetInfo(const int xid, struct cifsTconInfo *tcon, char *fileName,
5086 int bytes_returned = 0; 5193 int bytes_returned = 0;
5087 FILE_UNIX_BASIC_INFO *data_offset; 5194 FILE_UNIX_BASIC_INFO *data_offset;
5088 __u16 params, param_offset, offset, count, byte_count; 5195 __u16 params, param_offset, offset, count, byte_count;
5089 __u64 mode = args->mode;
5090 5196
5091 cFYI(1, ("In SetUID/GID/Mode")); 5197 cFYI(1, ("In SetUID/GID/Mode"));
5092setPermsRetry: 5198setPermsRetry:
@@ -5137,38 +5243,8 @@ setPermsRetry:
5137 pSMB->InformationLevel = cpu_to_le16(SMB_SET_FILE_UNIX_BASIC); 5243 pSMB->InformationLevel = cpu_to_le16(SMB_SET_FILE_UNIX_BASIC);
5138 pSMB->Reserved4 = 0; 5244 pSMB->Reserved4 = 0;
5139 pSMB->hdr.smb_buf_length += byte_count; 5245 pSMB->hdr.smb_buf_length += byte_count;
5140 /* Samba server ignores set of file size to zero due to bugs in some
5141 older clients, but we should be precise - we use SetFileSize to
5142 set file size and do not want to truncate file size to zero
5143 accidently as happened on one Samba server beta by putting
5144 zero instead of -1 here */
5145 data_offset->EndOfFile = cpu_to_le64(NO_CHANGE_64);
5146 data_offset->NumOfBytes = cpu_to_le64(NO_CHANGE_64);
5147 data_offset->LastStatusChange = cpu_to_le64(args->ctime);
5148 data_offset->LastAccessTime = cpu_to_le64(args->atime);
5149 data_offset->LastModificationTime = cpu_to_le64(args->mtime);
5150 data_offset->Uid = cpu_to_le64(args->uid);
5151 data_offset->Gid = cpu_to_le64(args->gid);
5152 /* better to leave device as zero when it is */
5153 data_offset->DevMajor = cpu_to_le64(MAJOR(args->device));
5154 data_offset->DevMinor = cpu_to_le64(MINOR(args->device));
5155 data_offset->Permissions = cpu_to_le64(mode);
5156
5157 if (S_ISREG(mode))
5158 data_offset->Type = cpu_to_le32(UNIX_FILE);
5159 else if (S_ISDIR(mode))
5160 data_offset->Type = cpu_to_le32(UNIX_DIR);
5161 else if (S_ISLNK(mode))
5162 data_offset->Type = cpu_to_le32(UNIX_SYMLINK);
5163 else if (S_ISCHR(mode))
5164 data_offset->Type = cpu_to_le32(UNIX_CHARDEV);
5165 else if (S_ISBLK(mode))
5166 data_offset->Type = cpu_to_le32(UNIX_BLOCKDEV);
5167 else if (S_ISFIFO(mode))
5168 data_offset->Type = cpu_to_le32(UNIX_FIFO);
5169 else if (S_ISSOCK(mode))
5170 data_offset->Type = cpu_to_le32(UNIX_SOCKET);
5171 5246
5247 cifs_fill_unix_set_info(data_offset, args);
5172 5248
5173 pSMB->ByteCount = cpu_to_le16(byte_count); 5249 pSMB->ByteCount = cpu_to_le16(byte_count);
5174 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, 5250 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB,
diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c
index 97f4311b9a8e..1f3345d7fa79 100644
--- a/fs/cifs/connect.c
+++ b/fs/cifs/connect.c
@@ -70,7 +70,6 @@ struct smb_vol {
70 mode_t file_mode; 70 mode_t file_mode;
71 mode_t dir_mode; 71 mode_t dir_mode;
72 unsigned secFlg; 72 unsigned secFlg;
73 bool rw:1;
74 bool retry:1; 73 bool retry:1;
75 bool intr:1; 74 bool intr:1;
76 bool setuids:1; 75 bool setuids:1;
@@ -804,6 +803,10 @@ cifs_parse_mount_options(char *options, const char *devname,
804 char *data; 803 char *data;
805 unsigned int temp_len, i, j; 804 unsigned int temp_len, i, j;
806 char separator[2]; 805 char separator[2];
806 short int override_uid = -1;
807 short int override_gid = -1;
808 bool uid_specified = false;
809 bool gid_specified = false;
807 810
808 separator[0] = ','; 811 separator[0] = ',';
809 separator[1] = 0; 812 separator[1] = 0;
@@ -832,7 +835,6 @@ cifs_parse_mount_options(char *options, const char *devname,
832 vol->dir_mode = vol->file_mode = S_IRUGO | S_IXUGO | S_IWUSR; 835 vol->dir_mode = vol->file_mode = S_IRUGO | S_IXUGO | S_IWUSR;
833 836
834 /* vol->retry default is 0 (i.e. "soft" limited retry not hard retry) */ 837 /* vol->retry default is 0 (i.e. "soft" limited retry not hard retry) */
835 vol->rw = true;
836 /* default is always to request posix paths. */ 838 /* default is always to request posix paths. */
837 vol->posix_paths = 1; 839 vol->posix_paths = 1;
838 /* default to using server inode numbers where available */ 840 /* default to using server inode numbers where available */
@@ -1095,18 +1097,20 @@ cifs_parse_mount_options(char *options, const char *devname,
1095 "too long.\n"); 1097 "too long.\n");
1096 return 1; 1098 return 1;
1097 } 1099 }
1098 } else if (strnicmp(data, "uid", 3) == 0) { 1100 } else if (!strnicmp(data, "uid", 3) && value && *value) {
1099 if (value && *value) 1101 vol->linux_uid = simple_strtoul(value, &value, 0);
1100 vol->linux_uid = 1102 uid_specified = true;
1101 simple_strtoul(value, &value, 0); 1103 } else if (!strnicmp(data, "forceuid", 8)) {
1102 } else if (strnicmp(data, "forceuid", 8) == 0) { 1104 override_uid = 1;
1103 vol->override_uid = 1; 1105 } else if (!strnicmp(data, "noforceuid", 10)) {
1104 } else if (strnicmp(data, "gid", 3) == 0) { 1106 override_uid = 0;
1105 if (value && *value) 1107 } else if (!strnicmp(data, "gid", 3) && value && *value) {
1106 vol->linux_gid = 1108 vol->linux_gid = simple_strtoul(value, &value, 0);
1107 simple_strtoul(value, &value, 0); 1109 gid_specified = true;
1108 } else if (strnicmp(data, "forcegid", 8) == 0) { 1110 } else if (!strnicmp(data, "forcegid", 8)) {
1109 vol->override_gid = 1; 1111 override_gid = 1;
1112 } else if (!strnicmp(data, "noforcegid", 10)) {
1113 override_gid = 0;
1110 } else if (strnicmp(data, "file_mode", 4) == 0) { 1114 } else if (strnicmp(data, "file_mode", 4) == 0) {
1111 if (value && *value) { 1115 if (value && *value) {
1112 vol->file_mode = 1116 vol->file_mode =
@@ -1199,7 +1203,9 @@ cifs_parse_mount_options(char *options, const char *devname,
1199 } else if (strnicmp(data, "guest", 5) == 0) { 1203 } else if (strnicmp(data, "guest", 5) == 0) {
1200 /* ignore */ 1204 /* ignore */
1201 } else if (strnicmp(data, "rw", 2) == 0) { 1205 } else if (strnicmp(data, "rw", 2) == 0) {
1202 vol->rw = true; 1206 /* ignore */
1207 } else if (strnicmp(data, "ro", 2) == 0) {
1208 /* ignore */
1203 } else if (strnicmp(data, "noblocksend", 11) == 0) { 1209 } else if (strnicmp(data, "noblocksend", 11) == 0) {
1204 vol->noblocksnd = 1; 1210 vol->noblocksnd = 1;
1205 } else if (strnicmp(data, "noautotune", 10) == 0) { 1211 } else if (strnicmp(data, "noautotune", 10) == 0) {
@@ -1218,8 +1224,6 @@ cifs_parse_mount_options(char *options, const char *devname,
1218 parse these options again and set anything and it 1224 parse these options again and set anything and it
1219 is ok to just ignore them */ 1225 is ok to just ignore them */
1220 continue; 1226 continue;
1221 } else if (strnicmp(data, "ro", 2) == 0) {
1222 vol->rw = false;
1223 } else if (strnicmp(data, "hard", 4) == 0) { 1227 } else if (strnicmp(data, "hard", 4) == 0) {
1224 vol->retry = 1; 1228 vol->retry = 1;
1225 } else if (strnicmp(data, "soft", 4) == 0) { 1229 } else if (strnicmp(data, "soft", 4) == 0) {
@@ -1357,6 +1361,18 @@ cifs_parse_mount_options(char *options, const char *devname,
1357 if (vol->UNCip == NULL) 1361 if (vol->UNCip == NULL)
1358 vol->UNCip = &vol->UNC[2]; 1362 vol->UNCip = &vol->UNC[2];
1359 1363
1364 if (uid_specified)
1365 vol->override_uid = override_uid;
1366 else if (override_uid == 1)
1367 printk(KERN_NOTICE "CIFS: ignoring forceuid mount option "
1368 "specified with no uid= option.\n");
1369
1370 if (gid_specified)
1371 vol->override_gid = override_gid;
1372 else if (override_gid == 1)
1373 printk(KERN_NOTICE "CIFS: ignoring forcegid mount option "
1374 "specified with no gid= option.\n");
1375
1360 return 0; 1376 return 0;
1361} 1377}
1362 1378
@@ -1386,8 +1402,10 @@ cifs_find_tcp_session(struct sockaddr_storage *addr)
1386 server->addr.sockAddr.sin_addr.s_addr)) 1402 server->addr.sockAddr.sin_addr.s_addr))
1387 continue; 1403 continue;
1388 else if (addr->ss_family == AF_INET6 && 1404 else if (addr->ss_family == AF_INET6 &&
1389 !ipv6_addr_equal(&server->addr.sockAddr6.sin6_addr, 1405 (!ipv6_addr_equal(&server->addr.sockAddr6.sin6_addr,
1390 &addr6->sin6_addr)) 1406 &addr6->sin6_addr) ||
1407 server->addr.sockAddr6.sin6_scope_id !=
1408 addr6->sin6_scope_id))
1391 continue; 1409 continue;
1392 1410
1393 ++server->srv_count; 1411 ++server->srv_count;
@@ -1433,28 +1451,15 @@ cifs_get_tcp_session(struct smb_vol *volume_info)
1433 1451
1434 memset(&addr, 0, sizeof(struct sockaddr_storage)); 1452 memset(&addr, 0, sizeof(struct sockaddr_storage));
1435 1453
1436 if (volume_info->UNCip && volume_info->UNC) { 1454 cFYI(1, ("UNC: %s ip: %s", volume_info->UNC, volume_info->UNCip));
1437 rc = cifs_inet_pton(AF_INET, volume_info->UNCip,
1438 &sin_server->sin_addr.s_addr);
1439
1440 if (rc <= 0) {
1441 /* not ipv4 address, try ipv6 */
1442 rc = cifs_inet_pton(AF_INET6, volume_info->UNCip,
1443 &sin_server6->sin6_addr.in6_u);
1444 if (rc > 0)
1445 addr.ss_family = AF_INET6;
1446 } else {
1447 addr.ss_family = AF_INET;
1448 }
1449 1455
1450 if (rc <= 0) { 1456 if (volume_info->UNCip && volume_info->UNC) {
1457 rc = cifs_convert_address(volume_info->UNCip, &addr);
1458 if (!rc) {
1451 /* we failed translating address */ 1459 /* we failed translating address */
1452 rc = -EINVAL; 1460 rc = -EINVAL;
1453 goto out_err; 1461 goto out_err;
1454 } 1462 }
1455
1456 cFYI(1, ("UNC: %s ip: %s", volume_info->UNC,
1457 volume_info->UNCip));
1458 } else if (volume_info->UNCip) { 1463 } else if (volume_info->UNCip) {
1459 /* BB using ip addr as tcp_ses name to connect to the 1464 /* BB using ip addr as tcp_ses name to connect to the
1460 DFS root below */ 1465 DFS root below */
@@ -1513,14 +1518,14 @@ cifs_get_tcp_session(struct smb_vol *volume_info)
1513 cFYI(1, ("attempting ipv6 connect")); 1518 cFYI(1, ("attempting ipv6 connect"));
1514 /* BB should we allow ipv6 on port 139? */ 1519 /* BB should we allow ipv6 on port 139? */
1515 /* other OS never observed in Wild doing 139 with v6 */ 1520 /* other OS never observed in Wild doing 139 with v6 */
1521 sin_server6->sin6_port = htons(volume_info->port);
1516 memcpy(&tcp_ses->addr.sockAddr6, sin_server6, 1522 memcpy(&tcp_ses->addr.sockAddr6, sin_server6,
1517 sizeof(struct sockaddr_in6)); 1523 sizeof(struct sockaddr_in6));
1518 sin_server6->sin6_port = htons(volume_info->port);
1519 rc = ipv6_connect(tcp_ses); 1524 rc = ipv6_connect(tcp_ses);
1520 } else { 1525 } else {
1526 sin_server->sin_port = htons(volume_info->port);
1521 memcpy(&tcp_ses->addr.sockAddr, sin_server, 1527 memcpy(&tcp_ses->addr.sockAddr, sin_server,
1522 sizeof(struct sockaddr_in)); 1528 sizeof(struct sockaddr_in));
1523 sin_server->sin_port = htons(volume_info->port);
1524 rc = ipv4_connect(tcp_ses); 1529 rc = ipv4_connect(tcp_ses);
1525 } 1530 }
1526 if (rc < 0) { 1531 if (rc < 0) {
@@ -2465,10 +2470,10 @@ try_mount_again:
2465 tcon->local_lease = volume_info->local_lease; 2470 tcon->local_lease = volume_info->local_lease;
2466 } 2471 }
2467 if (pSesInfo) { 2472 if (pSesInfo) {
2468 if (pSesInfo->capabilities & CAP_LARGE_FILES) { 2473 if (pSesInfo->capabilities & CAP_LARGE_FILES)
2469 sb->s_maxbytes = (u64) 1 << 63; 2474 sb->s_maxbytes = MAX_LFS_FILESIZE;
2470 } else 2475 else
2471 sb->s_maxbytes = (u64) 1 << 31; /* 2 GB */ 2476 sb->s_maxbytes = MAX_NON_LFS;
2472 } 2477 }
2473 2478
2474 /* BB FIXME fix time_gran to be larger for LANMAN sessions */ 2479 /* BB FIXME fix time_gran to be larger for LANMAN sessions */
@@ -2557,11 +2562,20 @@ remote_path_check:
2557 2562
2558 if (mount_data != mount_data_global) 2563 if (mount_data != mount_data_global)
2559 kfree(mount_data); 2564 kfree(mount_data);
2565
2560 mount_data = cifs_compose_mount_options( 2566 mount_data = cifs_compose_mount_options(
2561 cifs_sb->mountdata, full_path + 1, 2567 cifs_sb->mountdata, full_path + 1,
2562 referrals, &fake_devname); 2568 referrals, &fake_devname);
2563 kfree(fake_devname); 2569
2564 free_dfs_info_array(referrals, num_referrals); 2570 free_dfs_info_array(referrals, num_referrals);
2571 kfree(fake_devname);
2572 kfree(full_path);
2573
2574 if (IS_ERR(mount_data)) {
2575 rc = PTR_ERR(mount_data);
2576 mount_data = NULL;
2577 goto mount_fail_check;
2578 }
2565 2579
2566 if (tcon) 2580 if (tcon)
2567 cifs_put_tcon(tcon); 2581 cifs_put_tcon(tcon);
@@ -2569,8 +2583,6 @@ remote_path_check:
2569 cifs_put_smb_ses(pSesInfo); 2583 cifs_put_smb_ses(pSesInfo);
2570 2584
2571 cleanup_volume_info(&volume_info); 2585 cleanup_volume_info(&volume_info);
2572 FreeXid(xid);
2573 kfree(full_path);
2574 referral_walks_count++; 2586 referral_walks_count++;
2575 goto try_mount_again; 2587 goto try_mount_again;
2576 } 2588 }
@@ -2739,6 +2751,7 @@ CIFSTCon(unsigned int xid, struct cifsSesInfo *ses,
2739 strncpy(tcon->treeName, tree, MAX_TREE_SIZE); 2751 strncpy(tcon->treeName, tree, MAX_TREE_SIZE);
2740 2752
2741 /* mostly informational -- no need to fail on error here */ 2753 /* mostly informational -- no need to fail on error here */
2754 kfree(tcon->nativeFileSystem);
2742 tcon->nativeFileSystem = cifs_strndup_from_ucs(bcc_ptr, 2755 tcon->nativeFileSystem = cifs_strndup_from_ucs(bcc_ptr,
2743 bytes_left, is_unicode, 2756 bytes_left, is_unicode,
2744 nls_codepage); 2757 nls_codepage);
diff --git a/fs/cifs/dir.c b/fs/cifs/dir.c
index 3758965d73d5..4326ffd90fa9 100644
--- a/fs/cifs/dir.c
+++ b/fs/cifs/dir.c
@@ -188,6 +188,7 @@ int cifs_posix_open(char *full_path, struct inode **pinode,
188 FILE_UNIX_BASIC_INFO *presp_data; 188 FILE_UNIX_BASIC_INFO *presp_data;
189 __u32 posix_flags = 0; 189 __u32 posix_flags = 0;
190 struct cifs_sb_info *cifs_sb = CIFS_SB(sb); 190 struct cifs_sb_info *cifs_sb = CIFS_SB(sb);
191 struct cifs_fattr fattr;
191 192
192 cFYI(1, ("posix open %s", full_path)); 193 cFYI(1, ("posix open %s", full_path));
193 194
@@ -236,22 +237,21 @@ int cifs_posix_open(char *full_path, struct inode **pinode,
236 if (presp_data->Type == cpu_to_le32(-1)) 237 if (presp_data->Type == cpu_to_le32(-1))
237 goto posix_open_ret; /* open ok, caller does qpathinfo */ 238 goto posix_open_ret; /* open ok, caller does qpathinfo */
238 239
239 /* get new inode and set it up */
240 if (!pinode) 240 if (!pinode)
241 goto posix_open_ret; /* caller does not need info */ 241 goto posix_open_ret; /* caller does not need info */
242 242
243 cifs_unix_basic_to_fattr(&fattr, presp_data, cifs_sb);
244
245 /* get new inode and set it up */
243 if (*pinode == NULL) { 246 if (*pinode == NULL) {
244 __u64 unique_id = le64_to_cpu(presp_data->UniqueId); 247 *pinode = cifs_iget(sb, &fattr);
245 *pinode = cifs_new_inode(sb, &unique_id); 248 if (!*pinode) {
249 rc = -ENOMEM;
250 goto posix_open_ret;
251 }
252 } else {
253 cifs_fattr_to_inode(*pinode, &fattr);
246 } 254 }
247 /* else an inode was passed in. Update its info, don't create one */
248
249 /* We do not need to close the file if new_inode fails since
250 the caller will retry qpathinfo as long as inode is null */
251 if (*pinode == NULL)
252 goto posix_open_ret;
253
254 posix_fill_in_inode(*pinode, presp_data, 1);
255 255
256 cifs_fill_fileinfo(*pinode, *pnetfid, cifs_sb->tcon, write_only); 256 cifs_fill_fileinfo(*pinode, *pnetfid, cifs_sb->tcon, write_only);
257 257
@@ -307,8 +307,9 @@ cifs_create(struct inode *inode, struct dentry *direntry, int mode,
307 307
308 full_path = build_path_from_dentry(direntry); 308 full_path = build_path_from_dentry(direntry);
309 if (full_path == NULL) { 309 if (full_path == NULL) {
310 rc = -ENOMEM;
310 FreeXid(xid); 311 FreeXid(xid);
311 return -ENOMEM; 312 return rc;
312 } 313 }
313 314
314 if (oplockEnabled) 315 if (oplockEnabled)
@@ -424,9 +425,10 @@ cifs_create(struct inode *inode, struct dentry *direntry, int mode,
424 args.uid = NO_CHANGE_64; 425 args.uid = NO_CHANGE_64;
425 args.gid = NO_CHANGE_64; 426 args.gid = NO_CHANGE_64;
426 } 427 }
427 CIFSSMBUnixSetInfo(xid, tcon, full_path, &args, 428 CIFSSMBUnixSetPathInfo(xid, tcon, full_path, &args,
428 cifs_sb->local_nls, 429 cifs_sb->local_nls,
429 cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MAP_SPECIAL_CHR); 430 cifs_sb->mnt_cifs_flags &
431 CIFS_MOUNT_MAP_SPECIAL_CHR);
430 } else { 432 } else {
431 /* BB implement mode setting via Windows security 433 /* BB implement mode setting via Windows security
432 descriptors e.g. */ 434 descriptors e.g. */
@@ -514,10 +516,10 @@ int cifs_mknod(struct inode *inode, struct dentry *direntry, int mode,
514 args.uid = NO_CHANGE_64; 516 args.uid = NO_CHANGE_64;
515 args.gid = NO_CHANGE_64; 517 args.gid = NO_CHANGE_64;
516 } 518 }
517 rc = CIFSSMBUnixSetInfo(xid, pTcon, full_path, 519 rc = CIFSSMBUnixSetPathInfo(xid, pTcon, full_path, &args,
518 &args, cifs_sb->local_nls, 520 cifs_sb->local_nls,
519 cifs_sb->mnt_cifs_flags & 521 cifs_sb->mnt_cifs_flags &
520 CIFS_MOUNT_MAP_SPECIAL_CHR); 522 CIFS_MOUNT_MAP_SPECIAL_CHR);
521 523
522 if (!rc) { 524 if (!rc) {
523 rc = cifs_get_inode_info_unix(&newinode, full_path, 525 rc = cifs_get_inode_info_unix(&newinode, full_path,
@@ -540,8 +542,9 @@ int cifs_mknod(struct inode *inode, struct dentry *direntry, int mode,
540 buf = kmalloc(sizeof(FILE_ALL_INFO), GFP_KERNEL); 542 buf = kmalloc(sizeof(FILE_ALL_INFO), GFP_KERNEL);
541 if (buf == NULL) { 543 if (buf == NULL) {
542 kfree(full_path); 544 kfree(full_path);
545 rc = -ENOMEM;
543 FreeXid(xid); 546 FreeXid(xid);
544 return -ENOMEM; 547 return rc;
545 } 548 }
546 549
547 rc = CIFSSMBOpen(xid, pTcon, full_path, 550 rc = CIFSSMBOpen(xid, pTcon, full_path,
@@ -641,6 +644,15 @@ cifs_lookup(struct inode *parent_dir_inode, struct dentry *direntry,
641 } 644 }
642 } 645 }
643 646
647 /*
648 * O_EXCL: optimize away the lookup, but don't hash the dentry. Let
649 * the VFS handle the create.
650 */
651 if (nd->flags & LOOKUP_EXCL) {
652 d_instantiate(direntry, NULL);
653 return 0;
654 }
655
644 /* can not grab the rename sem here since it would 656 /* can not grab the rename sem here since it would
645 deadlock in the cases (beginning of sys_rename itself) 657 deadlock in the cases (beginning of sys_rename itself)
646 in which we already have the sb rename sem */ 658 in which we already have the sb rename sem */
diff --git a/fs/cifs/dns_resolve.c b/fs/cifs/dns_resolve.c
index df4a306f697e..87948147d7ec 100644
--- a/fs/cifs/dns_resolve.c
+++ b/fs/cifs/dns_resolve.c
@@ -35,26 +35,11 @@
35 * 0 - name is not IP 35 * 0 - name is not IP
36 */ 36 */
37static int 37static int
38is_ip(const char *name) 38is_ip(char *name)
39{ 39{
40 int rc; 40 struct sockaddr_storage ss;
41 struct sockaddr_in sin_server; 41
42 struct sockaddr_in6 sin_server6; 42 return cifs_convert_address(name, &ss);
43
44 rc = cifs_inet_pton(AF_INET, name,
45 &sin_server.sin_addr.s_addr);
46
47 if (rc <= 0) {
48 /* not ipv4 address, try ipv6 */
49 rc = cifs_inet_pton(AF_INET6, name,
50 &sin_server6.sin6_addr.in6_u);
51 if (rc > 0)
52 return 1;
53 } else {
54 return 1;
55 }
56 /* we failed translating address */
57 return 0;
58} 43}
59 44
60static int 45static int
@@ -72,7 +57,7 @@ dns_resolver_instantiate(struct key *key, const void *data,
72 ip[datalen] = '\0'; 57 ip[datalen] = '\0';
73 58
74 /* make sure this looks like an address */ 59 /* make sure this looks like an address */
75 if (!is_ip((const char *) ip)) { 60 if (!is_ip(ip)) {
76 kfree(ip); 61 kfree(ip);
77 return -EINVAL; 62 return -EINVAL;
78 } 63 }
diff --git a/fs/cifs/file.c b/fs/cifs/file.c
index 06866841b97f..c34b7f8a217b 100644
--- a/fs/cifs/file.c
+++ b/fs/cifs/file.c
@@ -300,14 +300,16 @@ int cifs_open(struct inode *inode, struct file *file)
300 pCifsInode = CIFS_I(file->f_path.dentry->d_inode); 300 pCifsInode = CIFS_I(file->f_path.dentry->d_inode);
301 pCifsFile = cifs_fill_filedata(file); 301 pCifsFile = cifs_fill_filedata(file);
302 if (pCifsFile) { 302 if (pCifsFile) {
303 rc = 0;
303 FreeXid(xid); 304 FreeXid(xid);
304 return 0; 305 return rc;
305 } 306 }
306 307
307 full_path = build_path_from_dentry(file->f_path.dentry); 308 full_path = build_path_from_dentry(file->f_path.dentry);
308 if (full_path == NULL) { 309 if (full_path == NULL) {
310 rc = -ENOMEM;
309 FreeXid(xid); 311 FreeXid(xid);
310 return -ENOMEM; 312 return rc;
311 } 313 }
312 314
313 cFYI(1, ("inode = 0x%p file flags are 0x%x for %s", 315 cFYI(1, ("inode = 0x%p file flags are 0x%x for %s",
@@ -446,9 +448,9 @@ int cifs_open(struct inode *inode, struct file *file)
446 .mtime = NO_CHANGE_64, 448 .mtime = NO_CHANGE_64,
447 .device = 0, 449 .device = 0,
448 }; 450 };
449 CIFSSMBUnixSetInfo(xid, tcon, full_path, &args, 451 CIFSSMBUnixSetPathInfo(xid, tcon, full_path, &args,
450 cifs_sb->local_nls, 452 cifs_sb->local_nls,
451 cifs_sb->mnt_cifs_flags & 453 cifs_sb->mnt_cifs_flags &
452 CIFS_MOUNT_MAP_SPECIAL_CHR); 454 CIFS_MOUNT_MAP_SPECIAL_CHR);
453 } 455 }
454 } 456 }
@@ -491,11 +493,12 @@ static int cifs_reopen_file(struct file *file, bool can_flush)
491 return -EBADF; 493 return -EBADF;
492 494
493 xid = GetXid(); 495 xid = GetXid();
494 mutex_unlock(&pCifsFile->fh_mutex); 496 mutex_lock(&pCifsFile->fh_mutex);
495 if (!pCifsFile->invalidHandle) { 497 if (!pCifsFile->invalidHandle) {
496 mutex_lock(&pCifsFile->fh_mutex); 498 mutex_unlock(&pCifsFile->fh_mutex);
499 rc = 0;
497 FreeXid(xid); 500 FreeXid(xid);
498 return 0; 501 return rc;
499 } 502 }
500 503
501 if (file->f_path.dentry == NULL) { 504 if (file->f_path.dentry == NULL) {
@@ -524,7 +527,7 @@ static int cifs_reopen_file(struct file *file, bool can_flush)
524 if (full_path == NULL) { 527 if (full_path == NULL) {
525 rc = -ENOMEM; 528 rc = -ENOMEM;
526reopen_error_exit: 529reopen_error_exit:
527 mutex_lock(&pCifsFile->fh_mutex); 530 mutex_unlock(&pCifsFile->fh_mutex);
528 FreeXid(xid); 531 FreeXid(xid);
529 return rc; 532 return rc;
530 } 533 }
@@ -566,14 +569,14 @@ reopen_error_exit:
566 cifs_sb->local_nls, cifs_sb->mnt_cifs_flags & 569 cifs_sb->local_nls, cifs_sb->mnt_cifs_flags &
567 CIFS_MOUNT_MAP_SPECIAL_CHR); 570 CIFS_MOUNT_MAP_SPECIAL_CHR);
568 if (rc) { 571 if (rc) {
569 mutex_lock(&pCifsFile->fh_mutex); 572 mutex_unlock(&pCifsFile->fh_mutex);
570 cFYI(1, ("cifs_open returned 0x%x", rc)); 573 cFYI(1, ("cifs_open returned 0x%x", rc));
571 cFYI(1, ("oplock: %d", oplock)); 574 cFYI(1, ("oplock: %d", oplock));
572 } else { 575 } else {
573reopen_success: 576reopen_success:
574 pCifsFile->netfid = netfid; 577 pCifsFile->netfid = netfid;
575 pCifsFile->invalidHandle = false; 578 pCifsFile->invalidHandle = false;
576 mutex_lock(&pCifsFile->fh_mutex); 579 mutex_unlock(&pCifsFile->fh_mutex);
577 pCifsInode = CIFS_I(inode); 580 pCifsInode = CIFS_I(inode);
578 if (pCifsInode) { 581 if (pCifsInode) {
579 if (can_flush) { 582 if (can_flush) {
@@ -845,8 +848,9 @@ int cifs_lock(struct file *file, int cmd, struct file_lock *pfLock)
845 tcon = cifs_sb->tcon; 848 tcon = cifs_sb->tcon;
846 849
847 if (file->private_data == NULL) { 850 if (file->private_data == NULL) {
851 rc = -EBADF;
848 FreeXid(xid); 852 FreeXid(xid);
849 return -EBADF; 853 return rc;
850 } 854 }
851 netfid = ((struct cifsFileInfo *)file->private_data)->netfid; 855 netfid = ((struct cifsFileInfo *)file->private_data)->netfid;
852 856
@@ -1805,8 +1809,9 @@ ssize_t cifs_user_read(struct file *file, char __user *read_data,
1805 pTcon = cifs_sb->tcon; 1809 pTcon = cifs_sb->tcon;
1806 1810
1807 if (file->private_data == NULL) { 1811 if (file->private_data == NULL) {
1812 rc = -EBADF;
1808 FreeXid(xid); 1813 FreeXid(xid);
1809 return -EBADF; 1814 return rc;
1810 } 1815 }
1811 open_file = (struct cifsFileInfo *)file->private_data; 1816 open_file = (struct cifsFileInfo *)file->private_data;
1812 1817
@@ -1885,8 +1890,9 @@ static ssize_t cifs_read(struct file *file, char *read_data, size_t read_size,
1885 pTcon = cifs_sb->tcon; 1890 pTcon = cifs_sb->tcon;
1886 1891
1887 if (file->private_data == NULL) { 1892 if (file->private_data == NULL) {
1893 rc = -EBADF;
1888 FreeXid(xid); 1894 FreeXid(xid);
1889 return -EBADF; 1895 return rc;
1890 } 1896 }
1891 open_file = (struct cifsFileInfo *)file->private_data; 1897 open_file = (struct cifsFileInfo *)file->private_data;
1892 1898
@@ -2019,8 +2025,9 @@ static int cifs_readpages(struct file *file, struct address_space *mapping,
2019 2025
2020 xid = GetXid(); 2026 xid = GetXid();
2021 if (file->private_data == NULL) { 2027 if (file->private_data == NULL) {
2028 rc = -EBADF;
2022 FreeXid(xid); 2029 FreeXid(xid);
2023 return -EBADF; 2030 return rc;
2024 } 2031 }
2025 open_file = (struct cifsFileInfo *)file->private_data; 2032 open_file = (struct cifsFileInfo *)file->private_data;
2026 cifs_sb = CIFS_SB(file->f_path.dentry->d_sb); 2033 cifs_sb = CIFS_SB(file->f_path.dentry->d_sb);
@@ -2185,8 +2192,9 @@ static int cifs_readpage(struct file *file, struct page *page)
2185 xid = GetXid(); 2192 xid = GetXid();
2186 2193
2187 if (file->private_data == NULL) { 2194 if (file->private_data == NULL) {
2195 rc = -EBADF;
2188 FreeXid(xid); 2196 FreeXid(xid);
2189 return -EBADF; 2197 return rc;
2190 } 2198 }
2191 2199
2192 cFYI(1, ("readpage %p at offset %d 0x%x\n", 2200 cFYI(1, ("readpage %p at offset %d 0x%x\n",
diff --git a/fs/cifs/inode.c b/fs/cifs/inode.c
index fad882b075ba..82d83839655e 100644
--- a/fs/cifs/inode.c
+++ b/fs/cifs/inode.c
@@ -77,239 +77,202 @@ static void cifs_set_ops(struct inode *inode, const bool is_dfs_referral)
77 } 77 }
78} 78}
79 79
80static void cifs_unix_info_to_inode(struct inode *inode, 80/* populate an inode with info from a cifs_fattr struct */
81 FILE_UNIX_BASIC_INFO *info, int force_uid_gid) 81void
82cifs_fattr_to_inode(struct inode *inode, struct cifs_fattr *fattr)
82{ 83{
84 struct cifsInodeInfo *cifs_i = CIFS_I(inode);
83 struct cifs_sb_info *cifs_sb = CIFS_SB(inode->i_sb); 85 struct cifs_sb_info *cifs_sb = CIFS_SB(inode->i_sb);
84 struct cifsInodeInfo *cifsInfo = CIFS_I(inode); 86 unsigned long oldtime = cifs_i->time;
85 __u64 num_of_bytes = le64_to_cpu(info->NumOfBytes); 87
86 __u64 end_of_file = le64_to_cpu(info->EndOfFile); 88 inode->i_atime = fattr->cf_atime;
89 inode->i_mtime = fattr->cf_mtime;
90 inode->i_ctime = fattr->cf_ctime;
91 inode->i_rdev = fattr->cf_rdev;
92 inode->i_nlink = fattr->cf_nlink;
93 inode->i_uid = fattr->cf_uid;
94 inode->i_gid = fattr->cf_gid;
95
96 /* if dynperm is set, don't clobber existing mode */
97 if (inode->i_state & I_NEW ||
98 !(cifs_sb->mnt_cifs_flags & CIFS_MOUNT_DYNPERM))
99 inode->i_mode = fattr->cf_mode;
100
101 cifs_i->cifsAttrs = fattr->cf_cifsattrs;
102 cifs_i->uniqueid = fattr->cf_uniqueid;
103
104 if (fattr->cf_flags & CIFS_FATTR_NEED_REVAL)
105 cifs_i->time = 0;
106 else
107 cifs_i->time = jiffies;
108
109 cFYI(1, ("inode 0x%p old_time=%ld new_time=%ld", inode,
110 oldtime, cifs_i->time));
87 111
88 inode->i_atime = cifs_NTtimeToUnix(info->LastAccessTime); 112 cifs_i->delete_pending = fattr->cf_flags & CIFS_FATTR_DELETE_PENDING;
89 inode->i_mtime = 113
90 cifs_NTtimeToUnix(info->LastModificationTime); 114 /*
91 inode->i_ctime = cifs_NTtimeToUnix(info->LastStatusChange); 115 * Can't safely change the file size here if the client is writing to
92 inode->i_mode = le64_to_cpu(info->Permissions); 116 * it due to potential races.
117 */
118 spin_lock(&inode->i_lock);
119 if (is_size_safe_to_change(cifs_i, fattr->cf_eof)) {
120 i_size_write(inode, fattr->cf_eof);
121
122 /*
123 * i_blocks is not related to (i_size / i_blksize),
124 * but instead 512 byte (2**9) size is required for
125 * calculating num blocks.
126 */
127 inode->i_blocks = (512 - 1 + fattr->cf_bytes) >> 9;
128 }
129 spin_unlock(&inode->i_lock);
130
131 cifs_set_ops(inode, fattr->cf_flags & CIFS_FATTR_DFS_REFERRAL);
132}
133
134/* Fill a cifs_fattr struct with info from FILE_UNIX_BASIC_INFO. */
135void
136cifs_unix_basic_to_fattr(struct cifs_fattr *fattr, FILE_UNIX_BASIC_INFO *info,
137 struct cifs_sb_info *cifs_sb)
138{
139 memset(fattr, 0, sizeof(*fattr));
140 fattr->cf_uniqueid = le64_to_cpu(info->UniqueId);
141 fattr->cf_bytes = le64_to_cpu(info->NumOfBytes);
142 fattr->cf_eof = le64_to_cpu(info->EndOfFile);
143
144 fattr->cf_atime = cifs_NTtimeToUnix(info->LastAccessTime);
145 fattr->cf_mtime = cifs_NTtimeToUnix(info->LastModificationTime);
146 fattr->cf_ctime = cifs_NTtimeToUnix(info->LastStatusChange);
147 fattr->cf_mode = le64_to_cpu(info->Permissions);
93 148
94 /* 149 /*
95 * Since we set the inode type below we need to mask off 150 * Since we set the inode type below we need to mask off
96 * to avoid strange results if bits set above. 151 * to avoid strange results if bits set above.
97 */ 152 */
98 inode->i_mode &= ~S_IFMT; 153 fattr->cf_mode &= ~S_IFMT;
99 switch (le32_to_cpu(info->Type)) { 154 switch (le32_to_cpu(info->Type)) {
100 case UNIX_FILE: 155 case UNIX_FILE:
101 inode->i_mode |= S_IFREG; 156 fattr->cf_mode |= S_IFREG;
157 fattr->cf_dtype = DT_REG;
102 break; 158 break;
103 case UNIX_SYMLINK: 159 case UNIX_SYMLINK:
104 inode->i_mode |= S_IFLNK; 160 fattr->cf_mode |= S_IFLNK;
161 fattr->cf_dtype = DT_LNK;
105 break; 162 break;
106 case UNIX_DIR: 163 case UNIX_DIR:
107 inode->i_mode |= S_IFDIR; 164 fattr->cf_mode |= S_IFDIR;
165 fattr->cf_dtype = DT_DIR;
108 break; 166 break;
109 case UNIX_CHARDEV: 167 case UNIX_CHARDEV:
110 inode->i_mode |= S_IFCHR; 168 fattr->cf_mode |= S_IFCHR;
111 inode->i_rdev = MKDEV(le64_to_cpu(info->DevMajor), 169 fattr->cf_dtype = DT_CHR;
112 le64_to_cpu(info->DevMinor) & MINORMASK); 170 fattr->cf_rdev = MKDEV(le64_to_cpu(info->DevMajor),
171 le64_to_cpu(info->DevMinor) & MINORMASK);
113 break; 172 break;
114 case UNIX_BLOCKDEV: 173 case UNIX_BLOCKDEV:
115 inode->i_mode |= S_IFBLK; 174 fattr->cf_mode |= S_IFBLK;
116 inode->i_rdev = MKDEV(le64_to_cpu(info->DevMajor), 175 fattr->cf_dtype = DT_BLK;
117 le64_to_cpu(info->DevMinor) & MINORMASK); 176 fattr->cf_rdev = MKDEV(le64_to_cpu(info->DevMajor),
177 le64_to_cpu(info->DevMinor) & MINORMASK);
118 break; 178 break;
119 case UNIX_FIFO: 179 case UNIX_FIFO:
120 inode->i_mode |= S_IFIFO; 180 fattr->cf_mode |= S_IFIFO;
181 fattr->cf_dtype = DT_FIFO;
121 break; 182 break;
122 case UNIX_SOCKET: 183 case UNIX_SOCKET:
123 inode->i_mode |= S_IFSOCK; 184 fattr->cf_mode |= S_IFSOCK;
185 fattr->cf_dtype = DT_SOCK;
124 break; 186 break;
125 default: 187 default:
126 /* safest to call it a file if we do not know */ 188 /* safest to call it a file if we do not know */
127 inode->i_mode |= S_IFREG; 189 fattr->cf_mode |= S_IFREG;
190 fattr->cf_dtype = DT_REG;
128 cFYI(1, ("unknown type %d", le32_to_cpu(info->Type))); 191 cFYI(1, ("unknown type %d", le32_to_cpu(info->Type)));
129 break; 192 break;
130 } 193 }
131 194
132 if ((cifs_sb->mnt_cifs_flags & CIFS_MOUNT_OVERR_UID) && 195 if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_OVERR_UID)
133 !force_uid_gid) 196 fattr->cf_uid = cifs_sb->mnt_uid;
134 inode->i_uid = cifs_sb->mnt_uid;
135 else 197 else
136 inode->i_uid = le64_to_cpu(info->Uid); 198 fattr->cf_uid = le64_to_cpu(info->Uid);
137 199
138 if ((cifs_sb->mnt_cifs_flags & CIFS_MOUNT_OVERR_GID) && 200 if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_OVERR_GID)
139 !force_uid_gid) 201 fattr->cf_gid = cifs_sb->mnt_gid;
140 inode->i_gid = cifs_sb->mnt_gid;
141 else 202 else
142 inode->i_gid = le64_to_cpu(info->Gid); 203 fattr->cf_gid = le64_to_cpu(info->Gid);
143
144 inode->i_nlink = le64_to_cpu(info->Nlinks);
145
146 cifsInfo->server_eof = end_of_file;
147 spin_lock(&inode->i_lock);
148 if (is_size_safe_to_change(cifsInfo, end_of_file)) {
149 /*
150 * We can not safely change the file size here if the client
151 * is writing to it due to potential races.
152 */
153 i_size_write(inode, end_of_file);
154 204
155 /* 205 fattr->cf_nlink = le64_to_cpu(info->Nlinks);
156 * i_blocks is not related to (i_size / i_blksize),
157 * but instead 512 byte (2**9) size is required for
158 * calculating num blocks.
159 */
160 inode->i_blocks = (512 - 1 + num_of_bytes) >> 9;
161 }
162 spin_unlock(&inode->i_lock);
163} 206}
164 207
165
166/* 208/*
167 * Needed to setup inode data for the directory which is the 209 * Fill a cifs_fattr struct with fake inode info.
168 * junction to the new submount (ie to setup the fake directory
169 * which represents a DFS referral)
170 */
171static void fill_fake_finddataunix(FILE_UNIX_BASIC_INFO *pfnd_dat,
172 struct super_block *sb)
173{
174 struct inode *pinode = NULL;
175
176 memset(pfnd_dat, 0, sizeof(FILE_UNIX_BASIC_INFO));
177
178/* __le64 pfnd_dat->EndOfFile = cpu_to_le64(0);
179 __le64 pfnd_dat->NumOfBytes = cpu_to_le64(0);
180 __u64 UniqueId = 0; */
181 pfnd_dat->LastStatusChange =
182 cpu_to_le64(cifs_UnixTimeToNT(CURRENT_TIME));
183 pfnd_dat->LastAccessTime =
184 cpu_to_le64(cifs_UnixTimeToNT(CURRENT_TIME));
185 pfnd_dat->LastModificationTime =
186 cpu_to_le64(cifs_UnixTimeToNT(CURRENT_TIME));
187 pfnd_dat->Type = cpu_to_le32(UNIX_DIR);
188 pfnd_dat->Permissions = cpu_to_le64(S_IXUGO | S_IRWXU);
189 pfnd_dat->Nlinks = cpu_to_le64(2);
190 if (sb->s_root)
191 pinode = sb->s_root->d_inode;
192 if (pinode == NULL)
193 return;
194
195 /* fill in default values for the remaining based on root
196 inode since we can not query the server for this inode info */
197 pfnd_dat->DevMajor = cpu_to_le64(MAJOR(pinode->i_rdev));
198 pfnd_dat->DevMinor = cpu_to_le64(MINOR(pinode->i_rdev));
199 pfnd_dat->Uid = cpu_to_le64(pinode->i_uid);
200 pfnd_dat->Gid = cpu_to_le64(pinode->i_gid);
201}
202
203/**
204 * cifs_new inode - create new inode, initialize, and hash it
205 * @sb - pointer to superblock
206 * @inum - if valid pointer and serverino is enabled, replace i_ino with val
207 *
208 * Create a new inode, initialize it for CIFS and hash it. Returns the new
209 * inode or NULL if one couldn't be allocated.
210 * 210 *
211 * If the share isn't mounted with "serverino" or inum is a NULL pointer then 211 * Needed to setup cifs_fattr data for the directory which is the
212 * we'll just use the inode number assigned by new_inode(). Note that this can 212 * junction to the new submount (ie to setup the fake directory
213 * mean i_ino collisions since the i_ino assigned by new_inode is not 213 * which represents a DFS referral).
214 * guaranteed to be unique.
215 */ 214 */
216struct inode * 215static void
217cifs_new_inode(struct super_block *sb, __u64 *inum) 216cifs_create_dfs_fattr(struct cifs_fattr *fattr, struct super_block *sb)
218{ 217{
219 struct inode *inode; 218 struct cifs_sb_info *cifs_sb = CIFS_SB(sb);
220
221 inode = new_inode(sb);
222 if (inode == NULL)
223 return NULL;
224
225 /*
226 * BB: Is i_ino == 0 legal? Here, we assume that it is. If it isn't we
227 * stop passing inum as ptr. Are there sanity checks we can use to
228 * ensure that the server is really filling in that field? Also,
229 * if serverino is disabled, perhaps we should be using iunique()?
230 */
231 if (inum && (CIFS_SB(sb)->mnt_cifs_flags & CIFS_MOUNT_SERVER_INUM))
232 inode->i_ino = (unsigned long) *inum;
233
234 /*
235 * must set this here instead of cifs_alloc_inode since VFS will
236 * clobber i_flags
237 */
238 if (sb->s_flags & MS_NOATIME)
239 inode->i_flags |= S_NOATIME | S_NOCMTIME;
240
241 insert_inode_hash(inode);
242 219
243 return inode; 220 cFYI(1, ("creating fake fattr for DFS referral"));
221
222 memset(fattr, 0, sizeof(*fattr));
223 fattr->cf_mode = S_IFDIR | S_IXUGO | S_IRWXU;
224 fattr->cf_uid = cifs_sb->mnt_uid;
225 fattr->cf_gid = cifs_sb->mnt_gid;
226 fattr->cf_atime = CURRENT_TIME;
227 fattr->cf_ctime = CURRENT_TIME;
228 fattr->cf_mtime = CURRENT_TIME;
229 fattr->cf_nlink = 2;
230 fattr->cf_flags |= CIFS_FATTR_DFS_REFERRAL;
244} 231}
245 232
246int cifs_get_inode_info_unix(struct inode **pinode, 233int cifs_get_inode_info_unix(struct inode **pinode,
247 const unsigned char *full_path, struct super_block *sb, int xid) 234 const unsigned char *full_path,
235 struct super_block *sb, int xid)
248{ 236{
249 int rc = 0; 237 int rc;
250 FILE_UNIX_BASIC_INFO find_data; 238 FILE_UNIX_BASIC_INFO find_data;
251 struct cifsTconInfo *pTcon; 239 struct cifs_fattr fattr;
252 struct inode *inode; 240 struct cifsTconInfo *tcon;
253 struct cifs_sb_info *cifs_sb = CIFS_SB(sb); 241 struct cifs_sb_info *cifs_sb = CIFS_SB(sb);
254 bool is_dfs_referral = false;
255 struct cifsInodeInfo *cifsInfo;
256 __u64 num_of_bytes;
257 __u64 end_of_file;
258 242
259 pTcon = cifs_sb->tcon; 243 tcon = cifs_sb->tcon;
260 cFYI(1, ("Getting info on %s", full_path)); 244 cFYI(1, ("Getting info on %s", full_path));
261 245
262 /* could have done a find first instead but this returns more info */ 246 /* could have done a find first instead but this returns more info */
263 rc = CIFSSMBUnixQPathInfo(xid, pTcon, full_path, &find_data, 247 rc = CIFSSMBUnixQPathInfo(xid, tcon, full_path, &find_data,
264 cifs_sb->local_nls, cifs_sb->mnt_cifs_flags & 248 cifs_sb->local_nls, cifs_sb->mnt_cifs_flags &
265 CIFS_MOUNT_MAP_SPECIAL_CHR); 249 CIFS_MOUNT_MAP_SPECIAL_CHR);
266 if (rc == -EREMOTE && !is_dfs_referral) {
267 is_dfs_referral = true;
268 cFYI(DBG2, ("DFS ref"));
269 /* for DFS, server does not give us real inode data */
270 fill_fake_finddataunix(&find_data, sb);
271 rc = 0;
272 } else if (rc)
273 goto cgiiu_exit;
274 250
275 num_of_bytes = le64_to_cpu(find_data.NumOfBytes); 251 if (!rc) {
276 end_of_file = le64_to_cpu(find_data.EndOfFile); 252 cifs_unix_basic_to_fattr(&fattr, &find_data, cifs_sb);
253 } else if (rc == -EREMOTE) {
254 cifs_create_dfs_fattr(&fattr, sb);
255 rc = 0;
256 } else {
257 return rc;
258 }
277 259
278 /* get new inode */
279 if (*pinode == NULL) { 260 if (*pinode == NULL) {
280 __u64 unique_id = le64_to_cpu(find_data.UniqueId); 261 /* get new inode */
281 *pinode = cifs_new_inode(sb, &unique_id); 262 *pinode = cifs_iget(sb, &fattr);
282 if (*pinode == NULL) { 263 if (!*pinode)
283 rc = -ENOMEM; 264 rc = -ENOMEM;
284 goto cgiiu_exit; 265 } else {
285 } 266 /* we already have inode, update it */
267 cifs_fattr_to_inode(*pinode, &fattr);
286 } 268 }
287 269
288 inode = *pinode;
289 cifsInfo = CIFS_I(inode);
290
291 cFYI(1, ("Old time %ld", cifsInfo->time));
292 cifsInfo->time = jiffies;
293 cFYI(1, ("New time %ld", cifsInfo->time));
294 /* this is ok to set on every inode revalidate */
295 atomic_set(&cifsInfo->inUse, 1);
296
297 cifs_unix_info_to_inode(inode, &find_data, 0);
298
299 if (num_of_bytes < end_of_file)
300 cFYI(1, ("allocation size less than end of file"));
301 cFYI(1, ("Size %ld and blocks %llu",
302 (unsigned long) inode->i_size,
303 (unsigned long long)inode->i_blocks));
304
305 cifs_set_ops(inode, is_dfs_referral);
306cgiiu_exit:
307 return rc; 270 return rc;
308} 271}
309 272
310static int decode_sfu_inode(struct inode *inode, __u64 size, 273static int
311 const unsigned char *path, 274cifs_sfu_type(struct cifs_fattr *fattr, const unsigned char *path,
312 struct cifs_sb_info *cifs_sb, int xid) 275 struct cifs_sb_info *cifs_sb, int xid)
313{ 276{
314 int rc; 277 int rc;
315 int oplock = 0; 278 int oplock = 0;
@@ -321,10 +284,15 @@ static int decode_sfu_inode(struct inode *inode, __u64 size,
321 284
322 pbuf = buf; 285 pbuf = buf;
323 286
324 if (size == 0) { 287 fattr->cf_mode &= ~S_IFMT;
325 inode->i_mode |= S_IFIFO; 288
289 if (fattr->cf_eof == 0) {
290 fattr->cf_mode |= S_IFIFO;
291 fattr->cf_dtype = DT_FIFO;
326 return 0; 292 return 0;
327 } else if (size < 8) { 293 } else if (fattr->cf_eof < 8) {
294 fattr->cf_mode |= S_IFREG;
295 fattr->cf_dtype = DT_REG;
328 return -EINVAL; /* EOPNOTSUPP? */ 296 return -EINVAL; /* EOPNOTSUPP? */
329 } 297 }
330 298
@@ -336,42 +304,46 @@ static int decode_sfu_inode(struct inode *inode, __u64 size,
336 if (rc == 0) { 304 if (rc == 0) {
337 int buf_type = CIFS_NO_BUFFER; 305 int buf_type = CIFS_NO_BUFFER;
338 /* Read header */ 306 /* Read header */
339 rc = CIFSSMBRead(xid, pTcon, 307 rc = CIFSSMBRead(xid, pTcon, netfid,
340 netfid,
341 24 /* length */, 0 /* offset */, 308 24 /* length */, 0 /* offset */,
342 &bytes_read, &pbuf, &buf_type); 309 &bytes_read, &pbuf, &buf_type);
343 if ((rc == 0) && (bytes_read >= 8)) { 310 if ((rc == 0) && (bytes_read >= 8)) {
344 if (memcmp("IntxBLK", pbuf, 8) == 0) { 311 if (memcmp("IntxBLK", pbuf, 8) == 0) {
345 cFYI(1, ("Block device")); 312 cFYI(1, ("Block device"));
346 inode->i_mode |= S_IFBLK; 313 fattr->cf_mode |= S_IFBLK;
314 fattr->cf_dtype = DT_BLK;
347 if (bytes_read == 24) { 315 if (bytes_read == 24) {
348 /* we have enough to decode dev num */ 316 /* we have enough to decode dev num */
349 __u64 mjr; /* major */ 317 __u64 mjr; /* major */
350 __u64 mnr; /* minor */ 318 __u64 mnr; /* minor */
351 mjr = le64_to_cpu(*(__le64 *)(pbuf+8)); 319 mjr = le64_to_cpu(*(__le64 *)(pbuf+8));
352 mnr = le64_to_cpu(*(__le64 *)(pbuf+16)); 320 mnr = le64_to_cpu(*(__le64 *)(pbuf+16));
353 inode->i_rdev = MKDEV(mjr, mnr); 321 fattr->cf_rdev = MKDEV(mjr, mnr);
354 } 322 }
355 } else if (memcmp("IntxCHR", pbuf, 8) == 0) { 323 } else if (memcmp("IntxCHR", pbuf, 8) == 0) {
356 cFYI(1, ("Char device")); 324 cFYI(1, ("Char device"));
357 inode->i_mode |= S_IFCHR; 325 fattr->cf_mode |= S_IFCHR;
326 fattr->cf_dtype = DT_CHR;
358 if (bytes_read == 24) { 327 if (bytes_read == 24) {
359 /* we have enough to decode dev num */ 328 /* we have enough to decode dev num */
360 __u64 mjr; /* major */ 329 __u64 mjr; /* major */
361 __u64 mnr; /* minor */ 330 __u64 mnr; /* minor */
362 mjr = le64_to_cpu(*(__le64 *)(pbuf+8)); 331 mjr = le64_to_cpu(*(__le64 *)(pbuf+8));
363 mnr = le64_to_cpu(*(__le64 *)(pbuf+16)); 332 mnr = le64_to_cpu(*(__le64 *)(pbuf+16));
364 inode->i_rdev = MKDEV(mjr, mnr); 333 fattr->cf_rdev = MKDEV(mjr, mnr);
365 } 334 }
366 } else if (memcmp("IntxLNK", pbuf, 7) == 0) { 335 } else if (memcmp("IntxLNK", pbuf, 7) == 0) {
367 cFYI(1, ("Symlink")); 336 cFYI(1, ("Symlink"));
368 inode->i_mode |= S_IFLNK; 337 fattr->cf_mode |= S_IFLNK;
338 fattr->cf_dtype = DT_LNK;
369 } else { 339 } else {
370 inode->i_mode |= S_IFREG; /* file? */ 340 fattr->cf_mode |= S_IFREG; /* file? */
341 fattr->cf_dtype = DT_REG;
371 rc = -EOPNOTSUPP; 342 rc = -EOPNOTSUPP;
372 } 343 }
373 } else { 344 } else {
374 inode->i_mode |= S_IFREG; /* then it is a file */ 345 fattr->cf_mode |= S_IFREG; /* then it is a file */
346 fattr->cf_dtype = DT_REG;
375 rc = -EOPNOTSUPP; /* or some unknown SFU type */ 347 rc = -EOPNOTSUPP; /* or some unknown SFU type */
376 } 348 }
377 CIFSSMBClose(xid, pTcon, netfid); 349 CIFSSMBClose(xid, pTcon, netfid);
@@ -381,9 +353,13 @@ static int decode_sfu_inode(struct inode *inode, __u64 size,
381 353
382#define SFBITS_MASK (S_ISVTX | S_ISGID | S_ISUID) /* SETFILEBITS valid bits */ 354#define SFBITS_MASK (S_ISVTX | S_ISGID | S_ISUID) /* SETFILEBITS valid bits */
383 355
384static int get_sfu_mode(struct inode *inode, 356/*
385 const unsigned char *path, 357 * Fetch mode bits as provided by SFU.
386 struct cifs_sb_info *cifs_sb, int xid) 358 *
359 * FIXME: Doesn't this clobber the type bit we got from cifs_sfu_type ?
360 */
361static int cifs_sfu_mode(struct cifs_fattr *fattr, const unsigned char *path,
362 struct cifs_sb_info *cifs_sb, int xid)
387{ 363{
388#ifdef CONFIG_CIFS_XATTR 364#ifdef CONFIG_CIFS_XATTR
389 ssize_t rc; 365 ssize_t rc;
@@ -391,68 +367,80 @@ static int get_sfu_mode(struct inode *inode,
391 __u32 mode; 367 __u32 mode;
392 368
393 rc = CIFSSMBQueryEA(xid, cifs_sb->tcon, path, "SETFILEBITS", 369 rc = CIFSSMBQueryEA(xid, cifs_sb->tcon, path, "SETFILEBITS",
394 ea_value, 4 /* size of buf */, cifs_sb->local_nls, 370 ea_value, 4 /* size of buf */, cifs_sb->local_nls,
395 cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MAP_SPECIAL_CHR); 371 cifs_sb->mnt_cifs_flags &
372 CIFS_MOUNT_MAP_SPECIAL_CHR);
396 if (rc < 0) 373 if (rc < 0)
397 return (int)rc; 374 return (int)rc;
398 else if (rc > 3) { 375 else if (rc > 3) {
399 mode = le32_to_cpu(*((__le32 *)ea_value)); 376 mode = le32_to_cpu(*((__le32 *)ea_value));
400 inode->i_mode &= ~SFBITS_MASK; 377 fattr->cf_mode &= ~SFBITS_MASK;
401 cFYI(1, ("special bits 0%o org mode 0%o", mode, inode->i_mode)); 378 cFYI(1, ("special bits 0%o org mode 0%o", mode,
402 inode->i_mode = (mode & SFBITS_MASK) | inode->i_mode; 379 fattr->cf_mode));
380 fattr->cf_mode = (mode & SFBITS_MASK) | fattr->cf_mode;
403 cFYI(1, ("special mode bits 0%o", mode)); 381 cFYI(1, ("special mode bits 0%o", mode));
404 return 0;
405 } else {
406 return 0;
407 } 382 }
383
384 return 0;
408#else 385#else
409 return -EOPNOTSUPP; 386 return -EOPNOTSUPP;
410#endif 387#endif
411} 388}
412 389
413/* 390/* Fill a cifs_fattr struct with info from FILE_ALL_INFO */
414 * Needed to setup inode data for the directory which is the 391static void
415 * junction to the new submount (ie to setup the fake directory 392cifs_all_info_to_fattr(struct cifs_fattr *fattr, FILE_ALL_INFO *info,
416 * which represents a DFS referral) 393 struct cifs_sb_info *cifs_sb, bool adjust_tz)
417 */
418static void fill_fake_finddata(FILE_ALL_INFO *pfnd_dat,
419 struct super_block *sb)
420{ 394{
421 memset(pfnd_dat, 0, sizeof(FILE_ALL_INFO)); 395 memset(fattr, 0, sizeof(*fattr));
422 396 fattr->cf_cifsattrs = le32_to_cpu(info->Attributes);
423/* __le64 pfnd_dat->AllocationSize = cpu_to_le64(0); 397 if (info->DeletePending)
424 __le64 pfnd_dat->EndOfFile = cpu_to_le64(0); 398 fattr->cf_flags |= CIFS_FATTR_DELETE_PENDING;
425 __u8 pfnd_dat->DeletePending = 0; 399
426 __u8 pfnd_data->Directory = 0; 400 if (info->LastAccessTime)
427 __le32 pfnd_dat->EASize = 0; 401 fattr->cf_atime = cifs_NTtimeToUnix(info->LastAccessTime);
428 __u64 pfnd_dat->IndexNumber = 0; 402 else
429 __u64 pfnd_dat->IndexNumber1 = 0; */ 403 fattr->cf_atime = CURRENT_TIME;
430 pfnd_dat->CreationTime = 404
431 cpu_to_le64(cifs_UnixTimeToNT(CURRENT_TIME)); 405 fattr->cf_ctime = cifs_NTtimeToUnix(info->ChangeTime);
432 pfnd_dat->LastAccessTime = 406 fattr->cf_mtime = cifs_NTtimeToUnix(info->LastWriteTime);
433 cpu_to_le64(cifs_UnixTimeToNT(CURRENT_TIME)); 407
434 pfnd_dat->LastWriteTime = 408 if (adjust_tz) {
435 cpu_to_le64(cifs_UnixTimeToNT(CURRENT_TIME)); 409 fattr->cf_ctime.tv_sec += cifs_sb->tcon->ses->server->timeAdj;
436 pfnd_dat->ChangeTime = 410 fattr->cf_mtime.tv_sec += cifs_sb->tcon->ses->server->timeAdj;
437 cpu_to_le64(cifs_UnixTimeToNT(CURRENT_TIME)); 411 }
438 pfnd_dat->Attributes = cpu_to_le32(ATTR_DIRECTORY); 412
439 pfnd_dat->NumberOfLinks = cpu_to_le32(2); 413 fattr->cf_eof = le64_to_cpu(info->EndOfFile);
414 fattr->cf_bytes = le64_to_cpu(info->AllocationSize);
415
416 if (fattr->cf_cifsattrs & ATTR_DIRECTORY) {
417 fattr->cf_mode = S_IFDIR | cifs_sb->mnt_dir_mode;
418 fattr->cf_dtype = DT_DIR;
419 } else {
420 fattr->cf_mode = S_IFREG | cifs_sb->mnt_file_mode;
421 fattr->cf_dtype = DT_REG;
422
423 /* clear write bits if ATTR_READONLY is set */
424 if (fattr->cf_cifsattrs & ATTR_READONLY)
425 fattr->cf_mode &= ~(S_IWUGO);
426 }
427
428 fattr->cf_nlink = le32_to_cpu(info->NumberOfLinks);
429
430 fattr->cf_uid = cifs_sb->mnt_uid;
431 fattr->cf_gid = cifs_sb->mnt_gid;
440} 432}
441 433
442int cifs_get_inode_info(struct inode **pinode, 434int cifs_get_inode_info(struct inode **pinode,
443 const unsigned char *full_path, FILE_ALL_INFO *pfindData, 435 const unsigned char *full_path, FILE_ALL_INFO *pfindData,
444 struct super_block *sb, int xid, const __u16 *pfid) 436 struct super_block *sb, int xid, const __u16 *pfid)
445{ 437{
446 int rc = 0; 438 int rc = 0, tmprc;
447 __u32 attr;
448 struct cifsInodeInfo *cifsInfo;
449 struct cifsTconInfo *pTcon; 439 struct cifsTconInfo *pTcon;
450 struct inode *inode;
451 struct cifs_sb_info *cifs_sb = CIFS_SB(sb); 440 struct cifs_sb_info *cifs_sb = CIFS_SB(sb);
452 char *buf = NULL; 441 char *buf = NULL;
453 bool adjustTZ = false; 442 bool adjustTZ = false;
454 bool is_dfs_referral = false; 443 struct cifs_fattr fattr;
455 umode_t default_mode;
456 444
457 pTcon = cifs_sb->tcon; 445 pTcon = cifs_sb->tcon;
458 cFYI(1, ("Getting info on %s", full_path)); 446 cFYI(1, ("Getting info on %s", full_path));
@@ -487,163 +475,85 @@ int cifs_get_inode_info(struct inode **pinode,
487 adjustTZ = true; 475 adjustTZ = true;
488 } 476 }
489 } 477 }
490 /* dump_mem("\nQPathInfo return data",&findData, sizeof(findData)); */ 478
491 if (rc == -EREMOTE) { 479 if (!rc) {
492 is_dfs_referral = true; 480 cifs_all_info_to_fattr(&fattr, (FILE_ALL_INFO *) pfindData,
493 fill_fake_finddata(pfindData, sb); 481 cifs_sb, adjustTZ);
482 } else if (rc == -EREMOTE) {
483 cifs_create_dfs_fattr(&fattr, sb);
494 rc = 0; 484 rc = 0;
495 } else if (rc) 485 } else {
496 goto cgii_exit; 486 goto cgii_exit;
487 }
497 488
498 attr = le32_to_cpu(pfindData->Attributes); 489 /*
499 490 * If an inode wasn't passed in, then get the inode number
500 /* get new inode */ 491 *
492 * Is an i_ino of zero legal? Can we use that to check if the server
493 * supports returning inode numbers? Are there other sanity checks we
494 * can use to ensure that the server is really filling in that field?
495 *
496 * We can not use the IndexNumber field by default from Windows or
497 * Samba (in ALL_INFO buf) but we can request it explicitly. The SNIA
498 * CIFS spec claims that this value is unique within the scope of a
499 * share, and the windows docs hint that it's actually unique
500 * per-machine.
501 *
502 * There may be higher info levels that work but are there Windows
503 * server or network appliances for which IndexNumber field is not
504 * guaranteed unique?
505 */
501 if (*pinode == NULL) { 506 if (*pinode == NULL) {
502 __u64 inode_num;
503 __u64 *pinum = &inode_num;
504
505 /* Is an i_ino of zero legal? Can we use that to check
506 if the server supports returning inode numbers? Are
507 there other sanity checks we can use to ensure that
508 the server is really filling in that field? */
509
510 /* We can not use the IndexNumber field by default from
511 Windows or Samba (in ALL_INFO buf) but we can request
512 it explicitly. It may not be unique presumably if
513 the server has multiple devices mounted under one share */
514
515 /* There may be higher info levels that work but are
516 there Windows server or network appliances for which
517 IndexNumber field is not guaranteed unique? */
518
519 if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_SERVER_INUM) { 507 if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_SERVER_INUM) {
520 int rc1 = 0; 508 int rc1 = 0;
521 509
522 rc1 = CIFSGetSrvInodeNumber(xid, pTcon, 510 rc1 = CIFSGetSrvInodeNumber(xid, pTcon,
523 full_path, pinum, 511 full_path, &fattr.cf_uniqueid,
524 cifs_sb->local_nls, 512 cifs_sb->local_nls,
525 cifs_sb->mnt_cifs_flags & 513 cifs_sb->mnt_cifs_flags &
526 CIFS_MOUNT_MAP_SPECIAL_CHR); 514 CIFS_MOUNT_MAP_SPECIAL_CHR);
527 if (rc1) { 515 if (rc1) {
528 cFYI(1, ("GetSrvInodeNum rc %d", rc1)); 516 cFYI(1, ("GetSrvInodeNum rc %d", rc1));
529 pinum = NULL; 517 fattr.cf_uniqueid = iunique(sb, ROOT_I);
530 /* BB EOPNOSUPP disable SERVER_INUM? */ 518 /* disable serverino if call not supported */
519 if (rc1 == -EINVAL)
520 cifs_sb->mnt_cifs_flags &=
521 ~CIFS_MOUNT_SERVER_INUM;
531 } 522 }
532 } else { 523 } else {
533 pinum = NULL; 524 fattr.cf_uniqueid = iunique(sb, ROOT_I);
534 }
535
536 *pinode = cifs_new_inode(sb, pinum);
537 if (*pinode == NULL) {
538 rc = -ENOMEM;
539 goto cgii_exit;
540 } 525 }
541 }
542 inode = *pinode;
543 cifsInfo = CIFS_I(inode);
544 cifsInfo->cifsAttrs = attr;
545 cifsInfo->delete_pending = pfindData->DeletePending ? true : false;
546 cFYI(1, ("Old time %ld", cifsInfo->time));
547 cifsInfo->time = jiffies;
548 cFYI(1, ("New time %ld", cifsInfo->time));
549
550 /* blksize needs to be multiple of two. So safer to default to
551 blksize and blkbits set in superblock so 2**blkbits and blksize
552 will match rather than setting to:
553 (pTcon->ses->server->maxBuf - MAX_CIFS_HDR_SIZE) & 0xFFFFFE00;*/
554
555 /* Linux can not store file creation time so ignore it */
556 if (pfindData->LastAccessTime)
557 inode->i_atime = cifs_NTtimeToUnix(pfindData->LastAccessTime);
558 else /* do not need to use current_fs_time - time not stored */
559 inode->i_atime = CURRENT_TIME;
560 inode->i_mtime = cifs_NTtimeToUnix(pfindData->LastWriteTime);
561 inode->i_ctime = cifs_NTtimeToUnix(pfindData->ChangeTime);
562 cFYI(DBG2, ("Attributes came in as 0x%x", attr));
563 if (adjustTZ && (pTcon->ses) && (pTcon->ses->server)) {
564 inode->i_ctime.tv_sec += pTcon->ses->server->timeAdj;
565 inode->i_mtime.tv_sec += pTcon->ses->server->timeAdj;
566 }
567
568 /* get default inode mode */
569 if (attr & ATTR_DIRECTORY)
570 default_mode = cifs_sb->mnt_dir_mode;
571 else
572 default_mode = cifs_sb->mnt_file_mode;
573
574 /* set permission bits */
575 if (atomic_read(&cifsInfo->inUse) == 0 ||
576 (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_DYNPERM) == 0)
577 inode->i_mode = default_mode;
578 else {
579 /* just reenable write bits if !ATTR_READONLY */
580 if ((inode->i_mode & S_IWUGO) == 0 &&
581 (attr & ATTR_READONLY) == 0)
582 inode->i_mode |= (S_IWUGO & default_mode);
583
584 inode->i_mode &= ~S_IFMT;
585 }
586 /* clear write bits if ATTR_READONLY is set */
587 if (attr & ATTR_READONLY)
588 inode->i_mode &= ~S_IWUGO;
589
590 /* set inode type */
591 if ((attr & ATTR_SYSTEM) &&
592 (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_UNX_EMUL)) {
593 /* no need to fix endianness on 0 */
594 if (pfindData->EndOfFile == 0)
595 inode->i_mode |= S_IFIFO;
596 else if (decode_sfu_inode(inode,
597 le64_to_cpu(pfindData->EndOfFile),
598 full_path, cifs_sb, xid))
599 cFYI(1, ("unknown SFU file type\n"));
600 } else { 526 } else {
601 if (attr & ATTR_DIRECTORY) 527 fattr.cf_uniqueid = CIFS_I(*pinode)->uniqueid;
602 inode->i_mode |= S_IFDIR;
603 else
604 inode->i_mode |= S_IFREG;
605 } 528 }
606 529
607 cifsInfo->server_eof = le64_to_cpu(pfindData->EndOfFile); 530 /* query for SFU type info if supported and needed */
608 spin_lock(&inode->i_lock); 531 if (fattr.cf_cifsattrs & ATTR_SYSTEM &&
609 if (is_size_safe_to_change(cifsInfo, cifsInfo->server_eof)) { 532 cifs_sb->mnt_cifs_flags & CIFS_MOUNT_UNX_EMUL) {
610 /* can not safely shrink the file size here if the 533 tmprc = cifs_sfu_type(&fattr, full_path, cifs_sb, xid);
611 client is writing to it due to potential races */ 534 if (tmprc)
612 i_size_write(inode, cifsInfo->server_eof); 535 cFYI(1, ("cifs_sfu_type failed: %d", tmprc));
613
614 /* 512 bytes (2**9) is the fake blocksize that must be
615 used for this calculation */
616 inode->i_blocks = (512 - 1 + le64_to_cpu(
617 pfindData->AllocationSize)) >> 9;
618 } 536 }
619 spin_unlock(&inode->i_lock);
620 537
621 inode->i_nlink = le32_to_cpu(pfindData->NumberOfLinks);
622
623 /* BB fill in uid and gid here? with help from winbind?
624 or retrieve from NTFS stream extended attribute */
625#ifdef CONFIG_CIFS_EXPERIMENTAL 538#ifdef CONFIG_CIFS_EXPERIMENTAL
626 /* fill in 0777 bits from ACL */ 539 /* fill in 0777 bits from ACL */
627 if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_CIFS_ACL) { 540 if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_CIFS_ACL) {
628 cFYI(1, ("Getting mode bits from ACL")); 541 cFYI(1, ("Getting mode bits from ACL"));
629 acl_to_uid_mode(cifs_sb, inode, full_path, pfid); 542 cifs_acl_to_fattr(cifs_sb, &fattr, *pinode, full_path, pfid);
630 } 543 }
631#endif 544#endif
632 if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_UNX_EMUL) {
633 /* fill in remaining high mode bits e.g. SUID, VTX */
634 get_sfu_mode(inode, full_path, cifs_sb, xid);
635 } else if (atomic_read(&cifsInfo->inUse) == 0) {
636 inode->i_uid = cifs_sb->mnt_uid;
637 inode->i_gid = cifs_sb->mnt_gid;
638 /* set so we do not keep refreshing these fields with
639 bad data after user has changed them in memory */
640 atomic_set(&cifsInfo->inUse, 1);
641 }
642
643 cifs_set_ops(inode, is_dfs_referral);
644
645 545
546 /* fill in remaining high mode bits e.g. SUID, VTX */
547 if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_UNX_EMUL)
548 cifs_sfu_mode(&fattr, full_path, cifs_sb, xid);
646 549
550 if (!*pinode) {
551 *pinode = cifs_iget(sb, &fattr);
552 if (!*pinode)
553 rc = -ENOMEM;
554 } else {
555 cifs_fattr_to_inode(*pinode, &fattr);
556 }
647 557
648cgii_exit: 558cgii_exit:
649 kfree(buf); 559 kfree(buf);
@@ -695,33 +605,78 @@ char *cifs_build_path_to_root(struct cifs_sb_info *cifs_sb)
695 return full_path; 605 return full_path;
696} 606}
697 607
608static int
609cifs_find_inode(struct inode *inode, void *opaque)
610{
611 struct cifs_fattr *fattr = (struct cifs_fattr *) opaque;
612
613 if (CIFS_I(inode)->uniqueid != fattr->cf_uniqueid)
614 return 0;
615
616 return 1;
617}
618
619static int
620cifs_init_inode(struct inode *inode, void *opaque)
621{
622 struct cifs_fattr *fattr = (struct cifs_fattr *) opaque;
623
624 CIFS_I(inode)->uniqueid = fattr->cf_uniqueid;
625 return 0;
626}
627
628/* Given fattrs, get a corresponding inode */
629struct inode *
630cifs_iget(struct super_block *sb, struct cifs_fattr *fattr)
631{
632 unsigned long hash;
633 struct inode *inode;
634
635 cFYI(1, ("looking for uniqueid=%llu", fattr->cf_uniqueid));
636
637 /* hash down to 32-bits on 32-bit arch */
638 hash = cifs_uniqueid_to_ino_t(fattr->cf_uniqueid);
639
640 inode = iget5_locked(sb, hash, cifs_find_inode, cifs_init_inode, fattr);
641
642 /* we have fattrs in hand, update the inode */
643 if (inode) {
644 cifs_fattr_to_inode(inode, fattr);
645 if (sb->s_flags & MS_NOATIME)
646 inode->i_flags |= S_NOATIME | S_NOCMTIME;
647 if (inode->i_state & I_NEW) {
648 inode->i_ino = hash;
649 unlock_new_inode(inode);
650 }
651 }
652
653 return inode;
654}
655
698/* gets root inode */ 656/* gets root inode */
699struct inode *cifs_root_iget(struct super_block *sb, unsigned long ino) 657struct inode *cifs_root_iget(struct super_block *sb, unsigned long ino)
700{ 658{
701 int xid; 659 int xid;
702 struct cifs_sb_info *cifs_sb; 660 struct cifs_sb_info *cifs_sb;
703 struct inode *inode; 661 struct inode *inode = NULL;
704 long rc; 662 long rc;
705 char *full_path; 663 char *full_path;
706 664
707 inode = iget_locked(sb, ino); 665 cifs_sb = CIFS_SB(sb);
708 if (!inode)
709 return ERR_PTR(-ENOMEM);
710 if (!(inode->i_state & I_NEW))
711 return inode;
712
713 cifs_sb = CIFS_SB(inode->i_sb);
714 full_path = cifs_build_path_to_root(cifs_sb); 666 full_path = cifs_build_path_to_root(cifs_sb);
715 if (full_path == NULL) 667 if (full_path == NULL)
716 return ERR_PTR(-ENOMEM); 668 return ERR_PTR(-ENOMEM);
717 669
718 xid = GetXid(); 670 xid = GetXid();
719 if (cifs_sb->tcon->unix_ext) 671 if (cifs_sb->tcon->unix_ext)
720 rc = cifs_get_inode_info_unix(&inode, full_path, inode->i_sb, 672 rc = cifs_get_inode_info_unix(&inode, full_path, sb, xid);
721 xid);
722 else 673 else
723 rc = cifs_get_inode_info(&inode, full_path, NULL, inode->i_sb, 674 rc = cifs_get_inode_info(&inode, full_path, NULL, sb,
724 xid, NULL); 675 xid, NULL);
676
677 if (!inode)
678 return ERR_PTR(-ENOMEM);
679
725 if (rc && cifs_sb->tcon->ipc) { 680 if (rc && cifs_sb->tcon->ipc) {
726 cFYI(1, ("ipc connection - fake read inode")); 681 cFYI(1, ("ipc connection - fake read inode"));
727 inode->i_mode |= S_IFDIR; 682 inode->i_mode |= S_IFDIR;
@@ -737,7 +692,6 @@ struct inode *cifs_root_iget(struct super_block *sb, unsigned long ino)
737 return ERR_PTR(rc); 692 return ERR_PTR(rc);
738 } 693 }
739 694
740 unlock_new_inode(inode);
741 695
742 kfree(full_path); 696 kfree(full_path);
743 /* can not call macro FreeXid here since in a void func 697 /* can not call macro FreeXid here since in a void func
@@ -988,8 +942,9 @@ int cifs_unlink(struct inode *dir, struct dentry *dentry)
988 * sb->s_vfs_rename_mutex here */ 942 * sb->s_vfs_rename_mutex here */
989 full_path = build_path_from_dentry(dentry); 943 full_path = build_path_from_dentry(dentry);
990 if (full_path == NULL) { 944 if (full_path == NULL) {
945 rc = -ENOMEM;
991 FreeXid(xid); 946 FreeXid(xid);
992 return -ENOMEM; 947 return rc;
993 } 948 }
994 949
995 if ((tcon->ses->capabilities & CAP_UNIX) && 950 if ((tcon->ses->capabilities & CAP_UNIX) &&
@@ -1062,44 +1017,6 @@ out_reval:
1062 return rc; 1017 return rc;
1063} 1018}
1064 1019
1065void posix_fill_in_inode(struct inode *tmp_inode,
1066 FILE_UNIX_BASIC_INFO *pData, int isNewInode)
1067{
1068 struct cifsInodeInfo *cifsInfo = CIFS_I(tmp_inode);
1069 loff_t local_size;
1070 struct timespec local_mtime;
1071
1072 cifsInfo->time = jiffies;
1073 atomic_inc(&cifsInfo->inUse);
1074
1075 /* save mtime and size */
1076 local_mtime = tmp_inode->i_mtime;
1077 local_size = tmp_inode->i_size;
1078
1079 cifs_unix_info_to_inode(tmp_inode, pData, 1);
1080 cifs_set_ops(tmp_inode, false);
1081
1082 if (!S_ISREG(tmp_inode->i_mode))
1083 return;
1084
1085 /*
1086 * No sense invalidating pages for new inode
1087 * since we we have not started caching
1088 * readahead file data yet.
1089 */
1090 if (isNewInode)
1091 return;
1092
1093 if (timespec_equal(&tmp_inode->i_mtime, &local_mtime) &&
1094 (local_size == tmp_inode->i_size)) {
1095 cFYI(1, ("inode exists but unchanged"));
1096 } else {
1097 /* file may have changed on server */
1098 cFYI(1, ("invalidate inode, readdir detected change"));
1099 invalidate_remote_inode(tmp_inode);
1100 }
1101}
1102
1103int cifs_mkdir(struct inode *inode, struct dentry *direntry, int mode) 1020int cifs_mkdir(struct inode *inode, struct dentry *direntry, int mode)
1104{ 1021{
1105 int rc = 0, tmprc; 1022 int rc = 0, tmprc;
@@ -1108,6 +1025,7 @@ int cifs_mkdir(struct inode *inode, struct dentry *direntry, int mode)
1108 struct cifsTconInfo *pTcon; 1025 struct cifsTconInfo *pTcon;
1109 char *full_path = NULL; 1026 char *full_path = NULL;
1110 struct inode *newinode = NULL; 1027 struct inode *newinode = NULL;
1028 struct cifs_fattr fattr;
1111 1029
1112 cFYI(1, ("In cifs_mkdir, mode = 0x%x inode = 0x%p", mode, inode)); 1030 cFYI(1, ("In cifs_mkdir, mode = 0x%x inode = 0x%p", mode, inode));
1113 1031
@@ -1118,8 +1036,9 @@ int cifs_mkdir(struct inode *inode, struct dentry *direntry, int mode)
1118 1036
1119 full_path = build_path_from_dentry(direntry); 1037 full_path = build_path_from_dentry(direntry);
1120 if (full_path == NULL) { 1038 if (full_path == NULL) {
1039 rc = -ENOMEM;
1121 FreeXid(xid); 1040 FreeXid(xid);
1122 return -ENOMEM; 1041 return rc;
1123 } 1042 }
1124 1043
1125 if ((pTcon->ses->capabilities & CAP_UNIX) && 1044 if ((pTcon->ses->capabilities & CAP_UNIX) &&
@@ -1146,7 +1065,6 @@ int cifs_mkdir(struct inode *inode, struct dentry *direntry, int mode)
1146 cFYI(1, ("posix mkdir returned 0x%x", rc)); 1065 cFYI(1, ("posix mkdir returned 0x%x", rc));
1147 d_drop(direntry); 1066 d_drop(direntry);
1148 } else { 1067 } else {
1149 __u64 unique_id;
1150 if (pInfo->Type == cpu_to_le32(-1)) { 1068 if (pInfo->Type == cpu_to_le32(-1)) {
1151 /* no return info, go query for it */ 1069 /* no return info, go query for it */
1152 kfree(pInfo); 1070 kfree(pInfo);
@@ -1160,20 +1078,15 @@ int cifs_mkdir(struct inode *inode, struct dentry *direntry, int mode)
1160 else 1078 else
1161 direntry->d_op = &cifs_dentry_ops; 1079 direntry->d_op = &cifs_dentry_ops;
1162 1080
1163 unique_id = le64_to_cpu(pInfo->UniqueId); 1081 cifs_unix_basic_to_fattr(&fattr, pInfo, cifs_sb);
1164 newinode = cifs_new_inode(inode->i_sb, &unique_id); 1082 newinode = cifs_iget(inode->i_sb, &fattr);
1165 if (newinode == NULL) { 1083 if (!newinode) {
1166 kfree(pInfo); 1084 kfree(pInfo);
1167 goto mkdir_get_info; 1085 goto mkdir_get_info;
1168 } 1086 }
1169 1087
1170 newinode->i_nlink = 2;
1171 d_instantiate(direntry, newinode); 1088 d_instantiate(direntry, newinode);
1172 1089
1173 /* we already checked in POSIXCreate whether
1174 frame was long enough */
1175 posix_fill_in_inode(direntry->d_inode,
1176 pInfo, 1 /* NewInode */);
1177#ifdef CONFIG_CIFS_DEBUG2 1090#ifdef CONFIG_CIFS_DEBUG2
1178 cFYI(1, ("instantiated dentry %p %s to inode %p", 1091 cFYI(1, ("instantiated dentry %p %s to inode %p",
1179 direntry, direntry->d_name.name, newinode)); 1092 direntry, direntry->d_name.name, newinode));
@@ -1236,10 +1149,10 @@ mkdir_get_info:
1236 args.uid = NO_CHANGE_64; 1149 args.uid = NO_CHANGE_64;
1237 args.gid = NO_CHANGE_64; 1150 args.gid = NO_CHANGE_64;
1238 } 1151 }
1239 CIFSSMBUnixSetInfo(xid, pTcon, full_path, &args, 1152 CIFSSMBUnixSetPathInfo(xid, pTcon, full_path, &args,
1240 cifs_sb->local_nls, 1153 cifs_sb->local_nls,
1241 cifs_sb->mnt_cifs_flags & 1154 cifs_sb->mnt_cifs_flags &
1242 CIFS_MOUNT_MAP_SPECIAL_CHR); 1155 CIFS_MOUNT_MAP_SPECIAL_CHR);
1243 } else { 1156 } else {
1244 if (!(cifs_sb->mnt_cifs_flags & CIFS_MOUNT_CIFS_ACL) && 1157 if (!(cifs_sb->mnt_cifs_flags & CIFS_MOUNT_CIFS_ACL) &&
1245 (mode & S_IWUGO) == 0) { 1158 (mode & S_IWUGO) == 0) {
@@ -1303,8 +1216,9 @@ int cifs_rmdir(struct inode *inode, struct dentry *direntry)
1303 1216
1304 full_path = build_path_from_dentry(direntry); 1217 full_path = build_path_from_dentry(direntry);
1305 if (full_path == NULL) { 1218 if (full_path == NULL) {
1219 rc = -ENOMEM;
1306 FreeXid(xid); 1220 FreeXid(xid);
1307 return -ENOMEM; 1221 return rc;
1308 } 1222 }
1309 1223
1310 rc = CIFSSMBRmDir(xid, pTcon, full_path, cifs_sb->local_nls, 1224 rc = CIFSSMBRmDir(xid, pTcon, full_path, cifs_sb->local_nls,
@@ -1508,8 +1422,9 @@ int cifs_revalidate(struct dentry *direntry)
1508 since that would deadlock */ 1422 since that would deadlock */
1509 full_path = build_path_from_dentry(direntry); 1423 full_path = build_path_from_dentry(direntry);
1510 if (full_path == NULL) { 1424 if (full_path == NULL) {
1425 rc = -ENOMEM;
1511 FreeXid(xid); 1426 FreeXid(xid);
1512 return -ENOMEM; 1427 return rc;
1513 } 1428 }
1514 cFYI(1, ("Revalidate: %s inode 0x%p count %d dentry: 0x%p d_time %ld " 1429 cFYI(1, ("Revalidate: %s inode 0x%p count %d dentry: 0x%p d_time %ld "
1515 "jiffies %ld", full_path, direntry->d_inode, 1430 "jiffies %ld", full_path, direntry->d_inode,
@@ -1618,6 +1533,7 @@ int cifs_getattr(struct vfsmount *mnt, struct dentry *dentry,
1618 if (!err) { 1533 if (!err) {
1619 generic_fillattr(dentry->d_inode, stat); 1534 generic_fillattr(dentry->d_inode, stat);
1620 stat->blksize = CIFS_MAX_MSGSIZE; 1535 stat->blksize = CIFS_MAX_MSGSIZE;
1536 stat->ino = CIFS_I(dentry->d_inode)->uniqueid;
1621 } 1537 }
1622 return err; 1538 return err;
1623} 1539}
@@ -1782,6 +1698,7 @@ cifs_setattr_unix(struct dentry *direntry, struct iattr *attrs)
1782 struct cifs_sb_info *cifs_sb = CIFS_SB(inode->i_sb); 1698 struct cifs_sb_info *cifs_sb = CIFS_SB(inode->i_sb);
1783 struct cifsTconInfo *pTcon = cifs_sb->tcon; 1699 struct cifsTconInfo *pTcon = cifs_sb->tcon;
1784 struct cifs_unix_set_info_args *args = NULL; 1700 struct cifs_unix_set_info_args *args = NULL;
1701 struct cifsFileInfo *open_file;
1785 1702
1786 cFYI(1, ("setattr_unix on file %s attrs->ia_valid=0x%x", 1703 cFYI(1, ("setattr_unix on file %s attrs->ia_valid=0x%x",
1787 direntry->d_name.name, attrs->ia_valid)); 1704 direntry->d_name.name, attrs->ia_valid));
@@ -1868,10 +1785,18 @@ cifs_setattr_unix(struct dentry *direntry, struct iattr *attrs)
1868 args->ctime = NO_CHANGE_64; 1785 args->ctime = NO_CHANGE_64;
1869 1786
1870 args->device = 0; 1787 args->device = 0;
1871 rc = CIFSSMBUnixSetInfo(xid, pTcon, full_path, args, 1788 open_file = find_writable_file(cifsInode);
1872 cifs_sb->local_nls, 1789 if (open_file) {
1873 cifs_sb->mnt_cifs_flags & 1790 u16 nfid = open_file->netfid;
1874 CIFS_MOUNT_MAP_SPECIAL_CHR); 1791 u32 npid = open_file->pid;
1792 rc = CIFSSMBUnixSetFileInfo(xid, pTcon, args, nfid, npid);
1793 atomic_dec(&open_file->wrtPending);
1794 } else {
1795 rc = CIFSSMBUnixSetPathInfo(xid, pTcon, full_path, args,
1796 cifs_sb->local_nls,
1797 cifs_sb->mnt_cifs_flags &
1798 CIFS_MOUNT_MAP_SPECIAL_CHR);
1799 }
1875 1800
1876 if (!rc) 1801 if (!rc)
1877 rc = inode_setattr(inode, attrs); 1802 rc = inode_setattr(inode, attrs);
@@ -1911,8 +1836,9 @@ cifs_setattr_nounix(struct dentry *direntry, struct iattr *attrs)
1911 1836
1912 full_path = build_path_from_dentry(direntry); 1837 full_path = build_path_from_dentry(direntry);
1913 if (full_path == NULL) { 1838 if (full_path == NULL) {
1839 rc = -ENOMEM;
1914 FreeXid(xid); 1840 FreeXid(xid);
1915 return -ENOMEM; 1841 return rc;
1916 } 1842 }
1917 1843
1918 /* 1844 /*
diff --git a/fs/cifs/link.c b/fs/cifs/link.c
index cd83c53fcbb5..fc1e0487eaee 100644
--- a/fs/cifs/link.c
+++ b/fs/cifs/link.c
@@ -172,8 +172,9 @@ cifs_symlink(struct inode *inode, struct dentry *direntry, const char *symname)
172 full_path = build_path_from_dentry(direntry); 172 full_path = build_path_from_dentry(direntry);
173 173
174 if (full_path == NULL) { 174 if (full_path == NULL) {
175 rc = -ENOMEM;
175 FreeXid(xid); 176 FreeXid(xid);
176 return -ENOMEM; 177 return rc;
177 } 178 }
178 179
179 cFYI(1, ("Full path: %s", full_path)); 180 cFYI(1, ("Full path: %s", full_path));
diff --git a/fs/cifs/netmisc.c b/fs/cifs/netmisc.c
index 32d6baa0a54f..bd6d6895730d 100644
--- a/fs/cifs/netmisc.c
+++ b/fs/cifs/netmisc.c
@@ -133,10 +133,12 @@ static const struct smb_to_posix_error mapping_table_ERRHRD[] = {
133 {0, 0} 133 {0, 0}
134}; 134};
135 135
136/* Convert string containing dotted ip address to binary form */ 136/*
137/* returns 0 if invalid address */ 137 * Convert a string containing text IPv4 or IPv6 address to binary form.
138 138 *
139int 139 * Returns 0 on failure.
140 */
141static int
140cifs_inet_pton(const int address_family, const char *cp, void *dst) 142cifs_inet_pton(const int address_family, const char *cp, void *dst)
141{ 143{
142 int ret = 0; 144 int ret = 0;
@@ -153,6 +155,52 @@ cifs_inet_pton(const int address_family, const char *cp, void *dst)
153 return ret; 155 return ret;
154} 156}
155 157
158/*
159 * Try to convert a string to an IPv4 address and then attempt to convert
160 * it to an IPv6 address if that fails. Set the family field if either
161 * succeeds. If it's an IPv6 address and it has a '%' sign in it, try to
162 * treat the part following it as a numeric sin6_scope_id.
163 *
164 * Returns 0 on failure.
165 */
166int
167cifs_convert_address(char *src, void *dst)
168{
169 int rc;
170 char *pct, *endp;
171 struct sockaddr_in *s4 = (struct sockaddr_in *) dst;
172 struct sockaddr_in6 *s6 = (struct sockaddr_in6 *) dst;
173
174 /* IPv4 address */
175 if (cifs_inet_pton(AF_INET, src, &s4->sin_addr.s_addr)) {
176 s4->sin_family = AF_INET;
177 return 1;
178 }
179
180 /* temporarily terminate string */
181 pct = strchr(src, '%');
182 if (pct)
183 *pct = '\0';
184
185 rc = cifs_inet_pton(AF_INET6, src, &s6->sin6_addr.s6_addr);
186
187 /* repair temp termination (if any) and make pct point to scopeid */
188 if (pct)
189 *pct++ = '%';
190
191 if (!rc)
192 return rc;
193
194 s6->sin6_family = AF_INET6;
195 if (pct) {
196 s6->sin6_scope_id = (u32) simple_strtoul(pct, &endp, 0);
197 if (!*pct || *endp)
198 return 0;
199 }
200
201 return rc;
202}
203
156/***************************************************************************** 204/*****************************************************************************
157convert a NT status code to a dos class/code 205convert a NT status code to a dos class/code
158 *****************************************************************************/ 206 *****************************************************************************/
diff --git a/fs/cifs/readdir.c b/fs/cifs/readdir.c
index 86d0055dc529..f823a4a208a7 100644
--- a/fs/cifs/readdir.c
+++ b/fs/cifs/readdir.c
@@ -63,374 +63,123 @@ static inline void dump_cifs_file_struct(struct file *file, char *label)
63} 63}
64#endif /* DEBUG2 */ 64#endif /* DEBUG2 */
65 65
66/* Returns 1 if new inode created, 2 if both dentry and inode were */ 66/*
67/* Might check in the future if inode number changed so we can rehash inode */ 67 * Find the dentry that matches "name". If there isn't one, create one. If it's
68static int 68 * a negative dentry or the uniqueid changed, then drop it and recreate it.
69construct_dentry(struct qstr *qstring, struct file *file, 69 */
70 struct inode **ptmp_inode, struct dentry **pnew_dentry, 70static struct dentry *
71 __u64 *inum) 71cifs_readdir_lookup(struct dentry *parent, struct qstr *name,
72 struct cifs_fattr *fattr)
72{ 73{
73 struct dentry *tmp_dentry = NULL; 74 struct dentry *dentry, *alias;
74 struct super_block *sb = file->f_path.dentry->d_sb; 75 struct inode *inode;
75 int rc = 0; 76 struct super_block *sb = parent->d_inode->i_sb;
77
78 cFYI(1, ("For %s", name->name));
79
80 dentry = d_lookup(parent, name);
81 if (dentry) {
82 /* FIXME: check for inode number changes? */
83 if (dentry->d_inode != NULL)
84 return dentry;
85 d_drop(dentry);
86 dput(dentry);
87 }
76 88
77 cFYI(1, ("For %s", qstring->name)); 89 dentry = d_alloc(parent, name);
78 90 if (dentry == NULL)
79 qstring->hash = full_name_hash(qstring->name, qstring->len); 91 return NULL;
80 tmp_dentry = d_lookup(file->f_path.dentry, qstring);
81 if (tmp_dentry) {
82 /* BB: overwrite old name? i.e. tmp_dentry->d_name and
83 * tmp_dentry->d_name.len??
84 */
85 cFYI(0, ("existing dentry with inode 0x%p",
86 tmp_dentry->d_inode));
87 *ptmp_inode = tmp_dentry->d_inode;
88 if (*ptmp_inode == NULL) {
89 *ptmp_inode = cifs_new_inode(sb, inum);
90 if (*ptmp_inode == NULL)
91 return rc;
92 rc = 1;
93 }
94 } else {
95 tmp_dentry = d_alloc(file->f_path.dentry, qstring);
96 if (tmp_dentry == NULL) {
97 cERROR(1, ("Failed allocating dentry"));
98 *ptmp_inode = NULL;
99 return rc;
100 }
101 92
102 if (CIFS_SB(sb)->tcon->nocase) 93 inode = cifs_iget(sb, fattr);
103 tmp_dentry->d_op = &cifs_ci_dentry_ops; 94 if (!inode) {
104 else 95 dput(dentry);
105 tmp_dentry->d_op = &cifs_dentry_ops; 96 return NULL;
97 }
106 98
107 *ptmp_inode = cifs_new_inode(sb, inum); 99 if (CIFS_SB(sb)->tcon->nocase)
108 if (*ptmp_inode == NULL) 100 dentry->d_op = &cifs_ci_dentry_ops;
109 return rc; 101 else
110 rc = 2; 102 dentry->d_op = &cifs_dentry_ops;
103
104 alias = d_materialise_unique(dentry, inode);
105 if (alias != NULL) {
106 dput(dentry);
107 if (IS_ERR(alias))
108 return NULL;
109 dentry = alias;
111 } 110 }
112 111
113 tmp_dentry->d_time = jiffies; 112 return dentry;
114 *pnew_dentry = tmp_dentry;
115 return rc;
116} 113}
117 114
118static void fill_in_inode(struct inode *tmp_inode, int new_buf_type, 115static void
119 char *buf, unsigned int *pobject_type, int isNewInode) 116cifs_fill_common_info(struct cifs_fattr *fattr, struct cifs_sb_info *cifs_sb)
120{ 117{
121 loff_t local_size; 118 fattr->cf_uid = cifs_sb->mnt_uid;
122 struct timespec local_mtime; 119 fattr->cf_gid = cifs_sb->mnt_gid;
123
124 struct cifsInodeInfo *cifsInfo = CIFS_I(tmp_inode);
125 struct cifs_sb_info *cifs_sb = CIFS_SB(tmp_inode->i_sb);
126 __u32 attr;
127 __u64 allocation_size;
128 __u64 end_of_file;
129 umode_t default_mode;
130
131 /* save mtime and size */
132 local_mtime = tmp_inode->i_mtime;
133 local_size = tmp_inode->i_size;
134
135 if (new_buf_type) {
136 FILE_DIRECTORY_INFO *pfindData = (FILE_DIRECTORY_INFO *)buf;
137
138 attr = le32_to_cpu(pfindData->ExtFileAttributes);
139 allocation_size = le64_to_cpu(pfindData->AllocationSize);
140 end_of_file = le64_to_cpu(pfindData->EndOfFile);
141 tmp_inode->i_atime =
142 cifs_NTtimeToUnix(pfindData->LastAccessTime);
143 tmp_inode->i_mtime =
144 cifs_NTtimeToUnix(pfindData->LastWriteTime);
145 tmp_inode->i_ctime =
146 cifs_NTtimeToUnix(pfindData->ChangeTime);
147 } else { /* legacy, OS2 and DOS style */
148 int offset = cifs_sb->tcon->ses->server->timeAdj;
149 FIND_FILE_STANDARD_INFO *pfindData =
150 (FIND_FILE_STANDARD_INFO *)buf;
151
152 tmp_inode->i_mtime = cnvrtDosUnixTm(pfindData->LastWriteDate,
153 pfindData->LastWriteTime,
154 offset);
155 tmp_inode->i_atime = cnvrtDosUnixTm(pfindData->LastAccessDate,
156 pfindData->LastAccessTime,
157 offset);
158 tmp_inode->i_ctime = cnvrtDosUnixTm(pfindData->LastWriteDate,
159 pfindData->LastWriteTime,
160 offset);
161 attr = le16_to_cpu(pfindData->Attributes);
162 allocation_size = le32_to_cpu(pfindData->AllocationSize);
163 end_of_file = le32_to_cpu(pfindData->DataSize);
164 }
165 120
166 /* Linux can not store file creation time unfortunately so ignore it */ 121 if (fattr->cf_cifsattrs & ATTR_DIRECTORY) {
167 122 fattr->cf_mode = S_IFDIR | cifs_sb->mnt_dir_mode;
168 cifsInfo->cifsAttrs = attr; 123 fattr->cf_dtype = DT_DIR;
169#ifdef CONFIG_CIFS_EXPERIMENTAL 124 } else {
170 if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_CIFS_ACL) { 125 fattr->cf_mode = S_IFREG | cifs_sb->mnt_file_mode;
171 /* get more accurate mode via ACL - so force inode refresh */ 126 fattr->cf_dtype = DT_REG;
172 cifsInfo->time = 0;
173 } else
174#endif /* CONFIG_CIFS_EXPERIMENTAL */
175 cifsInfo->time = jiffies;
176
177 /* treat dos attribute of read-only as read-only mode bit e.g. 555? */
178 /* 2767 perms - indicate mandatory locking */
179 /* BB fill in uid and gid here? with help from winbind?
180 or retrieve from NTFS stream extended attribute */
181 if (atomic_read(&cifsInfo->inUse) == 0) {
182 tmp_inode->i_uid = cifs_sb->mnt_uid;
183 tmp_inode->i_gid = cifs_sb->mnt_gid;
184 }
185
186 if (attr & ATTR_DIRECTORY)
187 default_mode = cifs_sb->mnt_dir_mode;
188 else
189 default_mode = cifs_sb->mnt_file_mode;
190
191 /* set initial permissions */
192 if ((atomic_read(&cifsInfo->inUse) == 0) ||
193 (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_DYNPERM) == 0)
194 tmp_inode->i_mode = default_mode;
195 else {
196 /* just reenable write bits if !ATTR_READONLY */
197 if ((tmp_inode->i_mode & S_IWUGO) == 0 &&
198 (attr & ATTR_READONLY) == 0)
199 tmp_inode->i_mode |= (S_IWUGO & default_mode);
200
201 tmp_inode->i_mode &= ~S_IFMT;
202 } 127 }
203 128
204 /* clear write bits if ATTR_READONLY is set */ 129 if (fattr->cf_cifsattrs & ATTR_READONLY)
205 if (attr & ATTR_READONLY) 130 fattr->cf_mode &= ~S_IWUGO;
206 tmp_inode->i_mode &= ~S_IWUGO;
207 131
208 /* set inode type */ 132 if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_UNX_EMUL &&
209 if ((attr & ATTR_SYSTEM) && 133 fattr->cf_cifsattrs & ATTR_SYSTEM) {
210 (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_UNX_EMUL)) { 134 if (fattr->cf_eof == 0) {
211 if (end_of_file == 0) { 135 fattr->cf_mode &= ~S_IFMT;
212 tmp_inode->i_mode |= S_IFIFO; 136 fattr->cf_mode |= S_IFIFO;
213 *pobject_type = DT_FIFO; 137 fattr->cf_dtype = DT_FIFO;
214 } else { 138 } else {
215 /* 139 /*
216 * trying to get the type can be slow, so just call 140 * trying to get the type and mode via SFU can be slow,
217 * this a regular file for now, and mark for reval 141 * so just call those regular files for now, and mark
142 * for reval
218 */ 143 */
219 tmp_inode->i_mode |= S_IFREG; 144 fattr->cf_flags |= CIFS_FATTR_NEED_REVAL;
220 *pobject_type = DT_REG;
221 cifsInfo->time = 0;
222 }
223 } else {
224 if (attr & ATTR_DIRECTORY) {
225 tmp_inode->i_mode |= S_IFDIR;
226 *pobject_type = DT_DIR;
227 } else {
228 tmp_inode->i_mode |= S_IFREG;
229 *pobject_type = DT_REG;
230 } 145 }
231 } 146 }
147}
232 148
233 /* can not fill in nlink here as in qpathinfo version and Unx search */ 149void
234 if (atomic_read(&cifsInfo->inUse) == 0) 150cifs_dir_info_to_fattr(struct cifs_fattr *fattr, FILE_DIRECTORY_INFO *info,
235 atomic_set(&cifsInfo->inUse, 1); 151 struct cifs_sb_info *cifs_sb)
236 152{
237 cifsInfo->server_eof = end_of_file; 153 memset(fattr, 0, sizeof(*fattr));
238 spin_lock(&tmp_inode->i_lock); 154 fattr->cf_cifsattrs = le32_to_cpu(info->ExtFileAttributes);
239 if (is_size_safe_to_change(cifsInfo, end_of_file)) { 155 fattr->cf_eof = le64_to_cpu(info->EndOfFile);
240 /* can not safely change the file size here if the 156 fattr->cf_bytes = le64_to_cpu(info->AllocationSize);
241 client is writing to it due to potential races */ 157 fattr->cf_atime = cifs_NTtimeToUnix(info->LastAccessTime);
242 i_size_write(tmp_inode, end_of_file); 158 fattr->cf_ctime = cifs_NTtimeToUnix(info->ChangeTime);
243 159 fattr->cf_mtime = cifs_NTtimeToUnix(info->LastWriteTime);
244 /* 512 bytes (2**9) is the fake blocksize that must be used */ 160
245 /* for this calculation, even though the reported blocksize is larger */ 161 cifs_fill_common_info(fattr, cifs_sb);
246 tmp_inode->i_blocks = (512 - 1 + allocation_size) >> 9;
247 }
248 spin_unlock(&tmp_inode->i_lock);
249
250 if (allocation_size < end_of_file)
251 cFYI(1, ("May be sparse file, allocation less than file size"));
252 cFYI(1, ("File Size %ld and blocks %llu",
253 (unsigned long)tmp_inode->i_size,
254 (unsigned long long)tmp_inode->i_blocks));
255 if (S_ISREG(tmp_inode->i_mode)) {
256 cFYI(1, ("File inode"));
257 tmp_inode->i_op = &cifs_file_inode_ops;
258 if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_DIRECT_IO) {
259 if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_NO_BRL)
260 tmp_inode->i_fop = &cifs_file_direct_nobrl_ops;
261 else
262 tmp_inode->i_fop = &cifs_file_direct_ops;
263 } else if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_NO_BRL)
264 tmp_inode->i_fop = &cifs_file_nobrl_ops;
265 else
266 tmp_inode->i_fop = &cifs_file_ops;
267
268 if ((cifs_sb->tcon) && (cifs_sb->tcon->ses) &&
269 (cifs_sb->tcon->ses->server->maxBuf <
270 PAGE_CACHE_SIZE + MAX_CIFS_HDR_SIZE))
271 tmp_inode->i_data.a_ops = &cifs_addr_ops_smallbuf;
272 else
273 tmp_inode->i_data.a_ops = &cifs_addr_ops;
274
275 if (isNewInode)
276 return; /* No sense invalidating pages for new inode
277 since have not started caching readahead file
278 data yet */
279
280 if (timespec_equal(&tmp_inode->i_mtime, &local_mtime) &&
281 (local_size == tmp_inode->i_size)) {
282 cFYI(1, ("inode exists but unchanged"));
283 } else {
284 /* file may have changed on server */
285 cFYI(1, ("invalidate inode, readdir detected change"));
286 invalidate_remote_inode(tmp_inode);
287 }
288 } else if (S_ISDIR(tmp_inode->i_mode)) {
289 cFYI(1, ("Directory inode"));
290 tmp_inode->i_op = &cifs_dir_inode_ops;
291 tmp_inode->i_fop = &cifs_dir_ops;
292 } else if (S_ISLNK(tmp_inode->i_mode)) {
293 cFYI(1, ("Symbolic Link inode"));
294 tmp_inode->i_op = &cifs_symlink_inode_ops;
295 } else {
296 cFYI(1, ("Init special inode"));
297 init_special_inode(tmp_inode, tmp_inode->i_mode,
298 tmp_inode->i_rdev);
299 }
300} 162}
301 163
302static void unix_fill_in_inode(struct inode *tmp_inode, 164void
303 FILE_UNIX_INFO *pfindData, unsigned int *pobject_type, int isNewInode) 165cifs_std_info_to_fattr(struct cifs_fattr *fattr, FIND_FILE_STANDARD_INFO *info,
166 struct cifs_sb_info *cifs_sb)
304{ 167{
305 loff_t local_size; 168 int offset = cifs_sb->tcon->ses->server->timeAdj;
306 struct timespec local_mtime;
307
308 struct cifsInodeInfo *cifsInfo = CIFS_I(tmp_inode);
309 struct cifs_sb_info *cifs_sb = CIFS_SB(tmp_inode->i_sb);
310
311 __u32 type = le32_to_cpu(pfindData->Type);
312 __u64 num_of_bytes = le64_to_cpu(pfindData->NumOfBytes);
313 __u64 end_of_file = le64_to_cpu(pfindData->EndOfFile);
314 cifsInfo->time = jiffies;
315 atomic_inc(&cifsInfo->inUse);
316
317 /* save mtime and size */
318 local_mtime = tmp_inode->i_mtime;
319 local_size = tmp_inode->i_size;
320
321 tmp_inode->i_atime =
322 cifs_NTtimeToUnix(pfindData->LastAccessTime);
323 tmp_inode->i_mtime =
324 cifs_NTtimeToUnix(pfindData->LastModificationTime);
325 tmp_inode->i_ctime =
326 cifs_NTtimeToUnix(pfindData->LastStatusChange);
327
328 tmp_inode->i_mode = le64_to_cpu(pfindData->Permissions);
329 /* since we set the inode type below we need to mask off type
330 to avoid strange results if bits above were corrupt */
331 tmp_inode->i_mode &= ~S_IFMT;
332 if (type == UNIX_FILE) {
333 *pobject_type = DT_REG;
334 tmp_inode->i_mode |= S_IFREG;
335 } else if (type == UNIX_SYMLINK) {
336 *pobject_type = DT_LNK;
337 tmp_inode->i_mode |= S_IFLNK;
338 } else if (type == UNIX_DIR) {
339 *pobject_type = DT_DIR;
340 tmp_inode->i_mode |= S_IFDIR;
341 } else if (type == UNIX_CHARDEV) {
342 *pobject_type = DT_CHR;
343 tmp_inode->i_mode |= S_IFCHR;
344 tmp_inode->i_rdev = MKDEV(le64_to_cpu(pfindData->DevMajor),
345 le64_to_cpu(pfindData->DevMinor) & MINORMASK);
346 } else if (type == UNIX_BLOCKDEV) {
347 *pobject_type = DT_BLK;
348 tmp_inode->i_mode |= S_IFBLK;
349 tmp_inode->i_rdev = MKDEV(le64_to_cpu(pfindData->DevMajor),
350 le64_to_cpu(pfindData->DevMinor) & MINORMASK);
351 } else if (type == UNIX_FIFO) {
352 *pobject_type = DT_FIFO;
353 tmp_inode->i_mode |= S_IFIFO;
354 } else if (type == UNIX_SOCKET) {
355 *pobject_type = DT_SOCK;
356 tmp_inode->i_mode |= S_IFSOCK;
357 } else {
358 /* safest to just call it a file */
359 *pobject_type = DT_REG;
360 tmp_inode->i_mode |= S_IFREG;
361 cFYI(1, ("unknown inode type %d", type));
362 }
363 169
364 if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_OVERR_UID) 170 memset(fattr, 0, sizeof(*fattr));
365 tmp_inode->i_uid = cifs_sb->mnt_uid; 171 fattr->cf_atime = cnvrtDosUnixTm(info->LastAccessDate,
366 else 172 info->LastAccessTime, offset);
367 tmp_inode->i_uid = le64_to_cpu(pfindData->Uid); 173 fattr->cf_ctime = cnvrtDosUnixTm(info->LastWriteDate,
368 if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_OVERR_GID) 174 info->LastWriteTime, offset);
369 tmp_inode->i_gid = cifs_sb->mnt_gid; 175 fattr->cf_mtime = cnvrtDosUnixTm(info->LastWriteDate,
370 else 176 info->LastWriteTime, offset);
371 tmp_inode->i_gid = le64_to_cpu(pfindData->Gid);
372 tmp_inode->i_nlink = le64_to_cpu(pfindData->Nlinks);
373
374 cifsInfo->server_eof = end_of_file;
375 spin_lock(&tmp_inode->i_lock);
376 if (is_size_safe_to_change(cifsInfo, end_of_file)) {
377 /* can not safely change the file size here if the
378 client is writing to it due to potential races */
379 i_size_write(tmp_inode, end_of_file);
380
381 /* 512 bytes (2**9) is the fake blocksize that must be used */
382 /* for this calculation, not the real blocksize */
383 tmp_inode->i_blocks = (512 - 1 + num_of_bytes) >> 9;
384 }
385 spin_unlock(&tmp_inode->i_lock);
386 177
387 if (S_ISREG(tmp_inode->i_mode)) { 178 fattr->cf_cifsattrs = le16_to_cpu(info->Attributes);
388 cFYI(1, ("File inode")); 179 fattr->cf_bytes = le32_to_cpu(info->AllocationSize);
389 tmp_inode->i_op = &cifs_file_inode_ops; 180 fattr->cf_eof = le32_to_cpu(info->DataSize);
390 181
391 if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_DIRECT_IO) { 182 cifs_fill_common_info(fattr, cifs_sb);
392 if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_NO_BRL)
393 tmp_inode->i_fop = &cifs_file_direct_nobrl_ops;
394 else
395 tmp_inode->i_fop = &cifs_file_direct_ops;
396 } else if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_NO_BRL)
397 tmp_inode->i_fop = &cifs_file_nobrl_ops;
398 else
399 tmp_inode->i_fop = &cifs_file_ops;
400
401 if ((cifs_sb->tcon) && (cifs_sb->tcon->ses) &&
402 (cifs_sb->tcon->ses->server->maxBuf <
403 PAGE_CACHE_SIZE + MAX_CIFS_HDR_SIZE))
404 tmp_inode->i_data.a_ops = &cifs_addr_ops_smallbuf;
405 else
406 tmp_inode->i_data.a_ops = &cifs_addr_ops;
407
408 if (isNewInode)
409 return; /* No sense invalidating pages for new inode
410 since we have not started caching readahead
411 file data for it yet */
412
413 if (timespec_equal(&tmp_inode->i_mtime, &local_mtime) &&
414 (local_size == tmp_inode->i_size)) {
415 cFYI(1, ("inode exists but unchanged"));
416 } else {
417 /* file may have changed on server */
418 cFYI(1, ("invalidate inode, readdir detected change"));
419 invalidate_remote_inode(tmp_inode);
420 }
421 } else if (S_ISDIR(tmp_inode->i_mode)) {
422 cFYI(1, ("Directory inode"));
423 tmp_inode->i_op = &cifs_dir_inode_ops;
424 tmp_inode->i_fop = &cifs_dir_ops;
425 } else if (S_ISLNK(tmp_inode->i_mode)) {
426 cFYI(1, ("Symbolic Link inode"));
427 tmp_inode->i_op = &cifs_symlink_inode_ops;
428/* tmp_inode->i_fop = *//* do not need to set to anything */
429 } else {
430 cFYI(1, ("Special inode"));
431 init_special_inode(tmp_inode, tmp_inode->i_mode,
432 tmp_inode->i_rdev);
433 }
434} 183}
435 184
436/* BB eventually need to add the following helper function to 185/* BB eventually need to add the following helper function to
@@ -872,7 +621,7 @@ static int cifs_get_name_from_search_buf(struct qstr *pqst,
872 len = strnlen(filename, PATH_MAX); 621 len = strnlen(filename, PATH_MAX);
873 } 622 }
874 623
875 *pinum = le64_to_cpu(pFindData->UniqueId); 624 *pinum = le64_to_cpu(pFindData->basic.UniqueId);
876 } else if (level == SMB_FIND_FILE_DIRECTORY_INFO) { 625 } else if (level == SMB_FIND_FILE_DIRECTORY_INFO) {
877 FILE_DIRECTORY_INFO *pFindData = 626 FILE_DIRECTORY_INFO *pFindData =
878 (FILE_DIRECTORY_INFO *)current_entry; 627 (FILE_DIRECTORY_INFO *)current_entry;
@@ -932,11 +681,12 @@ static int cifs_filldir(char *pfindEntry, struct file *file, filldir_t filldir,
932 int rc = 0; 681 int rc = 0;
933 struct qstr qstring; 682 struct qstr qstring;
934 struct cifsFileInfo *pCifsF; 683 struct cifsFileInfo *pCifsF;
935 unsigned int obj_type; 684 u64 inum;
936 __u64 inum; 685 ino_t ino;
686 struct super_block *sb;
937 struct cifs_sb_info *cifs_sb; 687 struct cifs_sb_info *cifs_sb;
938 struct inode *tmp_inode;
939 struct dentry *tmp_dentry; 688 struct dentry *tmp_dentry;
689 struct cifs_fattr fattr;
940 690
941 /* get filename and len into qstring */ 691 /* get filename and len into qstring */
942 /* get dentry */ 692 /* get dentry */
@@ -954,60 +704,53 @@ static int cifs_filldir(char *pfindEntry, struct file *file, filldir_t filldir,
954 if (rc != 0) 704 if (rc != 0)
955 return 0; 705 return 0;
956 706
957 cifs_sb = CIFS_SB(file->f_path.dentry->d_sb); 707 sb = file->f_path.dentry->d_sb;
708 cifs_sb = CIFS_SB(sb);
958 709
959 qstring.name = scratch_buf; 710 qstring.name = scratch_buf;
960 rc = cifs_get_name_from_search_buf(&qstring, pfindEntry, 711 rc = cifs_get_name_from_search_buf(&qstring, pfindEntry,
961 pCifsF->srch_inf.info_level, 712 pCifsF->srch_inf.info_level,
962 pCifsF->srch_inf.unicode, cifs_sb, 713 pCifsF->srch_inf.unicode, cifs_sb,
963 max_len, 714 max_len, &inum /* returned */);
964 &inum /* returned */);
965 715
966 if (rc) 716 if (rc)
967 return rc; 717 return rc;
968 718
969 /* only these two infolevels return valid inode numbers */
970 if (pCifsF->srch_inf.info_level == SMB_FIND_FILE_UNIX ||
971 pCifsF->srch_inf.info_level == SMB_FIND_FILE_ID_FULL_DIR_INFO)
972 rc = construct_dentry(&qstring, file, &tmp_inode, &tmp_dentry,
973 &inum);
974 else
975 rc = construct_dentry(&qstring, file, &tmp_inode, &tmp_dentry,
976 NULL);
977
978 if ((tmp_inode == NULL) || (tmp_dentry == NULL))
979 return -ENOMEM;
980
981 /* we pass in rc below, indicating whether it is a new inode,
982 so we can figure out whether to invalidate the inode cached
983 data if the file has changed */
984 if (pCifsF->srch_inf.info_level == SMB_FIND_FILE_UNIX) 719 if (pCifsF->srch_inf.info_level == SMB_FIND_FILE_UNIX)
985 unix_fill_in_inode(tmp_inode, 720 cifs_unix_basic_to_fattr(&fattr,
986 (FILE_UNIX_INFO *)pfindEntry, 721 &((FILE_UNIX_INFO *) pfindEntry)->basic,
987 &obj_type, rc); 722 cifs_sb);
988 else if (pCifsF->srch_inf.info_level == SMB_FIND_FILE_INFO_STANDARD) 723 else if (pCifsF->srch_inf.info_level == SMB_FIND_FILE_INFO_STANDARD)
989 fill_in_inode(tmp_inode, 0 /* old level 1 buffer type */, 724 cifs_std_info_to_fattr(&fattr, (FIND_FILE_STANDARD_INFO *)
990 pfindEntry, &obj_type, rc); 725 pfindEntry, cifs_sb);
991 else 726 else
992 fill_in_inode(tmp_inode, 1 /* NT */, pfindEntry, &obj_type, rc); 727 cifs_dir_info_to_fattr(&fattr, (FILE_DIRECTORY_INFO *)
728 pfindEntry, cifs_sb);
993 729
994 if (rc) /* new inode - needs to be tied to dentry */ { 730 /* FIXME: make _to_fattr functions fill this out */
995 d_instantiate(tmp_dentry, tmp_inode); 731 if (pCifsF->srch_inf.info_level == SMB_FIND_FILE_ID_FULL_DIR_INFO)
996 if (rc == 2) 732 fattr.cf_uniqueid = inum;
997 d_rehash(tmp_dentry); 733 else
998 } 734 fattr.cf_uniqueid = iunique(sb, ROOT_I);
999 735
736 ino = cifs_uniqueid_to_ino_t(fattr.cf_uniqueid);
737 tmp_dentry = cifs_readdir_lookup(file->f_dentry, &qstring, &fattr);
1000 738
1001 rc = filldir(direntry, qstring.name, qstring.len, file->f_pos, 739 rc = filldir(direntry, qstring.name, qstring.len, file->f_pos,
1002 tmp_inode->i_ino, obj_type); 740 ino, fattr.cf_dtype);
741
742 /*
743 * we can not return filldir errors to the caller since they are
744 * "normal" when the stat blocksize is too small - we return remapped
745 * error instead
746 *
747 * FIXME: This looks bogus. filldir returns -EOVERFLOW in the above
748 * case already. Why should we be clobbering other errors from it?
749 */
1003 if (rc) { 750 if (rc) {
1004 cFYI(1, ("filldir rc = %d", rc)); 751 cFYI(1, ("filldir rc = %d", rc));
1005 /* we can not return filldir errors to the caller
1006 since they are "normal" when the stat blocksize
1007 is too small - we return remapped error instead */
1008 rc = -EOVERFLOW; 752 rc = -EOVERFLOW;
1009 } 753 }
1010
1011 dput(tmp_dentry); 754 dput(tmp_dentry);
1012 return rc; 755 return rc;
1013} 756}
diff --git a/fs/cifs/sess.c b/fs/cifs/sess.c
index 897a052270f9..7085a6275c4c 100644
--- a/fs/cifs/sess.c
+++ b/fs/cifs/sess.c
@@ -802,7 +802,7 @@ ssetup_ntlmssp_authenticate:
802#endif /* CONFIG_CIFS_UPCALL */ 802#endif /* CONFIG_CIFS_UPCALL */
803 } else { 803 } else {
804#ifdef CONFIG_CIFS_EXPERIMENTAL 804#ifdef CONFIG_CIFS_EXPERIMENTAL
805 if ((experimEnabled > 1) && (type == RawNTLMSSP)) { 805 if (type == RawNTLMSSP) {
806 if ((pSMB->req.hdr.Flags2 & SMBFLG2_UNICODE) == 0) { 806 if ((pSMB->req.hdr.Flags2 & SMBFLG2_UNICODE) == 0) {
807 cERROR(1, ("NTLMSSP requires Unicode support")); 807 cERROR(1, ("NTLMSSP requires Unicode support"));
808 rc = -ENOSYS; 808 rc = -ENOSYS;
diff --git a/fs/cifs/xattr.c b/fs/cifs/xattr.c
index e9527eedc639..a75afa3dd9e1 100644
--- a/fs/cifs/xattr.c
+++ b/fs/cifs/xattr.c
@@ -64,8 +64,9 @@ int cifs_removexattr(struct dentry *direntry, const char *ea_name)
64 64
65 full_path = build_path_from_dentry(direntry); 65 full_path = build_path_from_dentry(direntry);
66 if (full_path == NULL) { 66 if (full_path == NULL) {
67 rc = -ENOMEM;
67 FreeXid(xid); 68 FreeXid(xid);
68 return -ENOMEM; 69 return rc;
69 } 70 }
70 if (ea_name == NULL) { 71 if (ea_name == NULL) {
71 cFYI(1, ("Null xattr names not supported")); 72 cFYI(1, ("Null xattr names not supported"));
@@ -118,8 +119,9 @@ int cifs_setxattr(struct dentry *direntry, const char *ea_name,
118 119
119 full_path = build_path_from_dentry(direntry); 120 full_path = build_path_from_dentry(direntry);
120 if (full_path == NULL) { 121 if (full_path == NULL) {
122 rc = -ENOMEM;
121 FreeXid(xid); 123 FreeXid(xid);
122 return -ENOMEM; 124 return rc;
123 } 125 }
124 /* return dos attributes as pseudo xattr */ 126 /* return dos attributes as pseudo xattr */
125 /* return alt name if available as pseudo attr */ 127 /* return alt name if available as pseudo attr */
@@ -225,8 +227,9 @@ ssize_t cifs_getxattr(struct dentry *direntry, const char *ea_name,
225 227
226 full_path = build_path_from_dentry(direntry); 228 full_path = build_path_from_dentry(direntry);
227 if (full_path == NULL) { 229 if (full_path == NULL) {
230 rc = -ENOMEM;
228 FreeXid(xid); 231 FreeXid(xid);
229 return -ENOMEM; 232 return rc;
230 } 233 }
231 /* return dos attributes as pseudo xattr */ 234 /* return dos attributes as pseudo xattr */
232 /* return alt name if available as pseudo attr */ 235 /* return alt name if available as pseudo attr */
@@ -351,8 +354,9 @@ ssize_t cifs_listxattr(struct dentry *direntry, char *data, size_t buf_size)
351 354
352 full_path = build_path_from_dentry(direntry); 355 full_path = build_path_from_dentry(direntry);
353 if (full_path == NULL) { 356 if (full_path == NULL) {
357 rc = -ENOMEM;
354 FreeXid(xid); 358 FreeXid(xid);
355 return -ENOMEM; 359 return rc;
356 } 360 }
357 /* return dos attributes as pseudo xattr */ 361 /* return dos attributes as pseudo xattr */
358 /* return alt name if available as pseudo attr */ 362 /* return alt name if available as pseudo attr */
diff --git a/fs/compat.c b/fs/compat.c
index cdd51a3a7c53..94502dab972a 100644
--- a/fs/compat.c
+++ b/fs/compat.c
@@ -32,7 +32,6 @@
32#include <linux/smb_mount.h> 32#include <linux/smb_mount.h>
33#include <linux/ncp_mount.h> 33#include <linux/ncp_mount.h>
34#include <linux/nfs4_mount.h> 34#include <linux/nfs4_mount.h>
35#include <linux/smp_lock.h>
36#include <linux/syscalls.h> 35#include <linux/syscalls.h>
37#include <linux/ctype.h> 36#include <linux/ctype.h>
38#include <linux/module.h> 37#include <linux/module.h>
@@ -1486,8 +1485,8 @@ int compat_do_execve(char * filename,
1486 if (!bprm) 1485 if (!bprm)
1487 goto out_files; 1486 goto out_files;
1488 1487
1489 retval = mutex_lock_interruptible(&current->cred_guard_mutex); 1488 retval = -ERESTARTNOINTR;
1490 if (retval < 0) 1489 if (mutex_lock_interruptible(&current->cred_guard_mutex))
1491 goto out_free; 1490 goto out_free;
1492 current->in_execve = 1; 1491 current->in_execve = 1;
1493 1492
diff --git a/fs/compat_ioctl.c b/fs/compat_ioctl.c
index 626c7483b4de..f91fd51b32e3 100644
--- a/fs/compat_ioctl.c
+++ b/fs/compat_ioctl.c
@@ -19,6 +19,7 @@
19#include <linux/compiler.h> 19#include <linux/compiler.h>
20#include <linux/sched.h> 20#include <linux/sched.h>
21#include <linux/smp.h> 21#include <linux/smp.h>
22#include <linux/smp_lock.h>
22#include <linux/ioctl.h> 23#include <linux/ioctl.h>
23#include <linux/if.h> 24#include <linux/if.h>
24#include <linux/if_bridge.h> 25#include <linux/if_bridge.h>
@@ -1904,6 +1905,7 @@ COMPATIBLE_IOCTL(FIONCLEX)
1904COMPATIBLE_IOCTL(FIOASYNC) 1905COMPATIBLE_IOCTL(FIOASYNC)
1905COMPATIBLE_IOCTL(FIONBIO) 1906COMPATIBLE_IOCTL(FIONBIO)
1906COMPATIBLE_IOCTL(FIONREAD) /* This is also TIOCINQ */ 1907COMPATIBLE_IOCTL(FIONREAD) /* This is also TIOCINQ */
1908COMPATIBLE_IOCTL(FS_IOC_FIEMAP)
1907/* 0x00 */ 1909/* 0x00 */
1908COMPATIBLE_IOCTL(FIBMAP) 1910COMPATIBLE_IOCTL(FIBMAP)
1909COMPATIBLE_IOCTL(FIGETBSZ) 1911COMPATIBLE_IOCTL(FIGETBSZ)
diff --git a/fs/dlm/lock.c b/fs/dlm/lock.c
index 205ec95b347e..eb507c453c5f 100644
--- a/fs/dlm/lock.c
+++ b/fs/dlm/lock.c
@@ -435,7 +435,7 @@ static int search_rsb(struct dlm_ls *ls, char *name, int len, int b,
435static int find_rsb(struct dlm_ls *ls, char *name, int namelen, 435static int find_rsb(struct dlm_ls *ls, char *name, int namelen,
436 unsigned int flags, struct dlm_rsb **r_ret) 436 unsigned int flags, struct dlm_rsb **r_ret)
437{ 437{
438 struct dlm_rsb *r, *tmp; 438 struct dlm_rsb *r = NULL, *tmp;
439 uint32_t hash, bucket; 439 uint32_t hash, bucket;
440 int error = -EINVAL; 440 int error = -EINVAL;
441 441
diff --git a/fs/dlm/lowcomms.c b/fs/dlm/lowcomms.c
index cdb580a9c7a2..618a60f03886 100644
--- a/fs/dlm/lowcomms.c
+++ b/fs/dlm/lowcomms.c
@@ -902,7 +902,7 @@ static void tcp_connect_to_sock(struct connection *con)
902 int result = -EHOSTUNREACH; 902 int result = -EHOSTUNREACH;
903 struct sockaddr_storage saddr, src_addr; 903 struct sockaddr_storage saddr, src_addr;
904 int addr_len; 904 int addr_len;
905 struct socket *sock; 905 struct socket *sock = NULL;
906 906
907 if (con->nodeid == 0) { 907 if (con->nodeid == 0) {
908 log_print("attempt to connect sock 0 foiled"); 908 log_print("attempt to connect sock 0 foiled");
@@ -962,6 +962,8 @@ out_err:
962 if (con->sock) { 962 if (con->sock) {
963 sock_release(con->sock); 963 sock_release(con->sock);
964 con->sock = NULL; 964 con->sock = NULL;
965 } else if (sock) {
966 sock_release(sock);
965 } 967 }
966 /* 968 /*
967 * Some errors are fatal and this list might need adjusting. For other 969 * Some errors are fatal and this list might need adjusting. For other
diff --git a/fs/dlm/plock.c b/fs/dlm/plock.c
index 894a32d438d5..16f682e26c07 100644
--- a/fs/dlm/plock.c
+++ b/fs/dlm/plock.c
@@ -353,7 +353,7 @@ static ssize_t dev_write(struct file *file, const char __user *u, size_t count,
353{ 353{
354 struct dlm_plock_info info; 354 struct dlm_plock_info info;
355 struct plock_op *op; 355 struct plock_op *op;
356 int found = 0; 356 int found = 0, do_callback = 0;
357 357
358 if (count != sizeof(info)) 358 if (count != sizeof(info))
359 return -EINVAL; 359 return -EINVAL;
@@ -366,21 +366,24 @@ static ssize_t dev_write(struct file *file, const char __user *u, size_t count,
366 366
367 spin_lock(&ops_lock); 367 spin_lock(&ops_lock);
368 list_for_each_entry(op, &recv_list, list) { 368 list_for_each_entry(op, &recv_list, list) {
369 if (op->info.fsid == info.fsid && op->info.number == info.number && 369 if (op->info.fsid == info.fsid &&
370 op->info.number == info.number &&
370 op->info.owner == info.owner) { 371 op->info.owner == info.owner) {
372 struct plock_xop *xop = (struct plock_xop *)op;
371 list_del_init(&op->list); 373 list_del_init(&op->list);
372 found = 1;
373 op->done = 1;
374 memcpy(&op->info, &info, sizeof(info)); 374 memcpy(&op->info, &info, sizeof(info));
375 if (xop->callback)
376 do_callback = 1;
377 else
378 op->done = 1;
379 found = 1;
375 break; 380 break;
376 } 381 }
377 } 382 }
378 spin_unlock(&ops_lock); 383 spin_unlock(&ops_lock);
379 384
380 if (found) { 385 if (found) {
381 struct plock_xop *xop; 386 if (do_callback)
382 xop = (struct plock_xop *)op;
383 if (xop->callback)
384 dlm_plock_callback(op); 387 dlm_plock_callback(op);
385 else 388 else
386 wake_up(&recv_wq); 389 wake_up(&recv_wq);
diff --git a/fs/ecryptfs/keystore.c b/fs/ecryptfs/keystore.c
index af737bb56cb7..259525c9abb8 100644
--- a/fs/ecryptfs/keystore.c
+++ b/fs/ecryptfs/keystore.c
@@ -1303,6 +1303,13 @@ parse_tag_3_packet(struct ecryptfs_crypt_stat *crypt_stat,
1303 } 1303 }
1304 (*new_auth_tok)->session_key.encrypted_key_size = 1304 (*new_auth_tok)->session_key.encrypted_key_size =
1305 (body_size - (ECRYPTFS_SALT_SIZE + 5)); 1305 (body_size - (ECRYPTFS_SALT_SIZE + 5));
1306 if ((*new_auth_tok)->session_key.encrypted_key_size
1307 > ECRYPTFS_MAX_ENCRYPTED_KEY_BYTES) {
1308 printk(KERN_WARNING "Tag 3 packet contains key larger "
1309 "than ECRYPTFS_MAX_ENCRYPTED_KEY_BYTES\n");
1310 rc = -EINVAL;
1311 goto out_free;
1312 }
1306 if (unlikely(data[(*packet_size)++] != 0x04)) { 1313 if (unlikely(data[(*packet_size)++] != 0x04)) {
1307 printk(KERN_WARNING "Unknown version number [%d]\n", 1314 printk(KERN_WARNING "Unknown version number [%d]\n",
1308 data[(*packet_size) - 1]); 1315 data[(*packet_size) - 1]);
@@ -1449,6 +1456,12 @@ parse_tag_11_packet(unsigned char *data, unsigned char *contents,
1449 rc = -EINVAL; 1456 rc = -EINVAL;
1450 goto out; 1457 goto out;
1451 } 1458 }
1459 if (unlikely((*tag_11_contents_size) > max_contents_bytes)) {
1460 printk(KERN_ERR "Literal data section in tag 11 packet exceeds "
1461 "expected size\n");
1462 rc = -EINVAL;
1463 goto out;
1464 }
1452 if (data[(*packet_size)++] != 0x62) { 1465 if (data[(*packet_size)++] != 0x62) {
1453 printk(KERN_WARNING "Unrecognizable packet\n"); 1466 printk(KERN_WARNING "Unrecognizable packet\n");
1454 rc = -EINVAL; 1467 rc = -EINVAL;
diff --git a/fs/eventfd.c b/fs/eventfd.c
index 3f0e1974abdc..31d12de83a2a 100644
--- a/fs/eventfd.c
+++ b/fs/eventfd.c
@@ -14,35 +14,44 @@
14#include <linux/list.h> 14#include <linux/list.h>
15#include <linux/spinlock.h> 15#include <linux/spinlock.h>
16#include <linux/anon_inodes.h> 16#include <linux/anon_inodes.h>
17#include <linux/eventfd.h>
18#include <linux/syscalls.h> 17#include <linux/syscalls.h>
19#include <linux/module.h> 18#include <linux/module.h>
19#include <linux/kref.h>
20#include <linux/eventfd.h>
20 21
21struct eventfd_ctx { 22struct eventfd_ctx {
23 struct kref kref;
22 wait_queue_head_t wqh; 24 wait_queue_head_t wqh;
23 /* 25 /*
24 * Every time that a write(2) is performed on an eventfd, the 26 * Every time that a write(2) is performed on an eventfd, the
25 * value of the __u64 being written is added to "count" and a 27 * value of the __u64 being written is added to "count" and a
26 * wakeup is performed on "wqh". A read(2) will return the "count" 28 * wakeup is performed on "wqh". A read(2) will return the "count"
27 * value to userspace, and will reset "count" to zero. The kernel 29 * value to userspace, and will reset "count" to zero. The kernel
28 * size eventfd_signal() also, adds to the "count" counter and 30 * side eventfd_signal() also, adds to the "count" counter and
29 * issue a wakeup. 31 * issue a wakeup.
30 */ 32 */
31 __u64 count; 33 __u64 count;
32 unsigned int flags; 34 unsigned int flags;
33}; 35};
34 36
35/* 37/**
36 * Adds "n" to the eventfd counter "count". Returns "n" in case of 38 * eventfd_signal - Adds @n to the eventfd counter.
37 * success, or a value lower then "n" in case of coutner overflow. 39 * @ctx: [in] Pointer to the eventfd context.
38 * This function is supposed to be called by the kernel in paths 40 * @n: [in] Value of the counter to be added to the eventfd internal counter.
39 * that do not allow sleeping. In this function we allow the counter 41 * The value cannot be negative.
40 * to reach the ULLONG_MAX value, and we signal this as overflow 42 *
41 * condition by returining a POLLERR to poll(2). 43 * This function is supposed to be called by the kernel in paths that do not
44 * allow sleeping. In this function we allow the counter to reach the ULLONG_MAX
45 * value, and we signal this as overflow condition by returining a POLLERR
46 * to poll(2).
47 *
48 * Returns @n in case of success, a non-negative number lower than @n in case
49 * of overflow, or the following error codes:
50 *
51 * -EINVAL : The value of @n is negative.
42 */ 52 */
43int eventfd_signal(struct file *file, int n) 53int eventfd_signal(struct eventfd_ctx *ctx, int n)
44{ 54{
45 struct eventfd_ctx *ctx = file->private_data;
46 unsigned long flags; 55 unsigned long flags;
47 56
48 if (n < 0) 57 if (n < 0)
@@ -59,9 +68,45 @@ int eventfd_signal(struct file *file, int n)
59} 68}
60EXPORT_SYMBOL_GPL(eventfd_signal); 69EXPORT_SYMBOL_GPL(eventfd_signal);
61 70
71static void eventfd_free(struct kref *kref)
72{
73 struct eventfd_ctx *ctx = container_of(kref, struct eventfd_ctx, kref);
74
75 kfree(ctx);
76}
77
78/**
79 * eventfd_ctx_get - Acquires a reference to the internal eventfd context.
80 * @ctx: [in] Pointer to the eventfd context.
81 *
82 * Returns: In case of success, returns a pointer to the eventfd context.
83 */
84struct eventfd_ctx *eventfd_ctx_get(struct eventfd_ctx *ctx)
85{
86 kref_get(&ctx->kref);
87 return ctx;
88}
89EXPORT_SYMBOL_GPL(eventfd_ctx_get);
90
91/**
92 * eventfd_ctx_put - Releases a reference to the internal eventfd context.
93 * @ctx: [in] Pointer to eventfd context.
94 *
95 * The eventfd context reference must have been previously acquired either
96 * with eventfd_ctx_get() or eventfd_ctx_fdget()).
97 */
98void eventfd_ctx_put(struct eventfd_ctx *ctx)
99{
100 kref_put(&ctx->kref, eventfd_free);
101}
102EXPORT_SYMBOL_GPL(eventfd_ctx_put);
103
62static int eventfd_release(struct inode *inode, struct file *file) 104static int eventfd_release(struct inode *inode, struct file *file)
63{ 105{
64 kfree(file->private_data); 106 struct eventfd_ctx *ctx = file->private_data;
107
108 wake_up_poll(&ctx->wqh, POLLHUP);
109 eventfd_ctx_put(ctx);
65 return 0; 110 return 0;
66} 111}
67 112
@@ -185,6 +230,16 @@ static const struct file_operations eventfd_fops = {
185 .write = eventfd_write, 230 .write = eventfd_write,
186}; 231};
187 232
233/**
234 * eventfd_fget - Acquire a reference of an eventfd file descriptor.
235 * @fd: [in] Eventfd file descriptor.
236 *
237 * Returns a pointer to the eventfd file structure in case of success, or the
238 * following error pointer:
239 *
240 * -EBADF : Invalid @fd file descriptor.
241 * -EINVAL : The @fd file descriptor is not an eventfd file.
242 */
188struct file *eventfd_fget(int fd) 243struct file *eventfd_fget(int fd)
189{ 244{
190 struct file *file; 245 struct file *file;
@@ -201,6 +256,48 @@ struct file *eventfd_fget(int fd)
201} 256}
202EXPORT_SYMBOL_GPL(eventfd_fget); 257EXPORT_SYMBOL_GPL(eventfd_fget);
203 258
259/**
260 * eventfd_ctx_fdget - Acquires a reference to the internal eventfd context.
261 * @fd: [in] Eventfd file descriptor.
262 *
263 * Returns a pointer to the internal eventfd context, otherwise the error
264 * pointers returned by the following functions:
265 *
266 * eventfd_fget
267 */
268struct eventfd_ctx *eventfd_ctx_fdget(int fd)
269{
270 struct file *file;
271 struct eventfd_ctx *ctx;
272
273 file = eventfd_fget(fd);
274 if (IS_ERR(file))
275 return (struct eventfd_ctx *) file;
276 ctx = eventfd_ctx_get(file->private_data);
277 fput(file);
278
279 return ctx;
280}
281EXPORT_SYMBOL_GPL(eventfd_ctx_fdget);
282
283/**
284 * eventfd_ctx_fileget - Acquires a reference to the internal eventfd context.
285 * @file: [in] Eventfd file pointer.
286 *
287 * Returns a pointer to the internal eventfd context, otherwise the error
288 * pointer:
289 *
290 * -EINVAL : The @fd file descriptor is not an eventfd file.
291 */
292struct eventfd_ctx *eventfd_ctx_fileget(struct file *file)
293{
294 if (file->f_op != &eventfd_fops)
295 return ERR_PTR(-EINVAL);
296
297 return eventfd_ctx_get(file->private_data);
298}
299EXPORT_SYMBOL_GPL(eventfd_ctx_fileget);
300
204SYSCALL_DEFINE2(eventfd2, unsigned int, count, int, flags) 301SYSCALL_DEFINE2(eventfd2, unsigned int, count, int, flags)
205{ 302{
206 int fd; 303 int fd;
@@ -217,6 +314,7 @@ SYSCALL_DEFINE2(eventfd2, unsigned int, count, int, flags)
217 if (!ctx) 314 if (!ctx)
218 return -ENOMEM; 315 return -ENOMEM;
219 316
317 kref_init(&ctx->kref);
220 init_waitqueue_head(&ctx->wqh); 318 init_waitqueue_head(&ctx->wqh);
221 ctx->count = count; 319 ctx->count = count;
222 ctx->flags = flags; 320 ctx->flags = flags;
diff --git a/fs/exec.c b/fs/exec.c
index e639957d7a57..4a8849e45b21 100644
--- a/fs/exec.c
+++ b/fs/exec.c
@@ -1277,8 +1277,8 @@ int do_execve(char * filename,
1277 if (!bprm) 1277 if (!bprm)
1278 goto out_files; 1278 goto out_files;
1279 1279
1280 retval = mutex_lock_interruptible(&current->cred_guard_mutex); 1280 retval = -ERESTARTNOINTR;
1281 if (retval < 0) 1281 if (mutex_lock_interruptible(&current->cred_guard_mutex))
1282 goto out_free; 1282 goto out_free;
1283 current->in_execve = 1; 1283 current->in_execve = 1;
1284 1284
diff --git a/fs/exofs/common.h b/fs/exofs/common.h
index 24667eedc023..c6718e4817fe 100644
--- a/fs/exofs/common.h
+++ b/fs/exofs/common.h
@@ -2,9 +2,7 @@
2 * common.h - Common definitions for both Kernel and user-mode utilities 2 * common.h - Common definitions for both Kernel and user-mode utilities
3 * 3 *
4 * Copyright (C) 2005, 2006 4 * Copyright (C) 2005, 2006
5 * Avishay Traeger (avishay@gmail.com) (avishay@il.ibm.com) 5 * Avishay Traeger (avishay@gmail.com)
6 * Copyright (C) 2005, 2006
7 * International Business Machines
8 * Copyright (C) 2008, 2009 6 * Copyright (C) 2008, 2009
9 * Boaz Harrosh <bharrosh@panasas.com> 7 * Boaz Harrosh <bharrosh@panasas.com>
10 * 8 *
diff --git a/fs/exofs/dir.c b/fs/exofs/dir.c
index 65b0c8c776a1..4cfab1cc75c0 100644
--- a/fs/exofs/dir.c
+++ b/fs/exofs/dir.c
@@ -1,8 +1,6 @@
1/* 1/*
2 * Copyright (C) 2005, 2006 2 * Copyright (C) 2005, 2006
3 * Avishay Traeger (avishay@gmail.com) (avishay@il.ibm.com) 3 * Avishay Traeger (avishay@gmail.com)
4 * Copyright (C) 2005, 2006
5 * International Business Machines
6 * Copyright (C) 2008, 2009 4 * Copyright (C) 2008, 2009
7 * Boaz Harrosh <bharrosh@panasas.com> 5 * Boaz Harrosh <bharrosh@panasas.com>
8 * 6 *
diff --git a/fs/exofs/exofs.h b/fs/exofs/exofs.h
index 0fd4c7859679..5ec72e020b22 100644
--- a/fs/exofs/exofs.h
+++ b/fs/exofs/exofs.h
@@ -1,8 +1,6 @@
1/* 1/*
2 * Copyright (C) 2005, 2006 2 * Copyright (C) 2005, 2006
3 * Avishay Traeger (avishay@gmail.com) (avishay@il.ibm.com) 3 * Avishay Traeger (avishay@gmail.com)
4 * Copyright (C) 2005, 2006
5 * International Business Machines
6 * Copyright (C) 2008, 2009 4 * Copyright (C) 2008, 2009
7 * Boaz Harrosh <bharrosh@panasas.com> 5 * Boaz Harrosh <bharrosh@panasas.com>
8 * 6 *
@@ -156,6 +154,9 @@ ino_t exofs_parent_ino(struct dentry *child);
156int exofs_set_link(struct inode *, struct exofs_dir_entry *, struct page *, 154int exofs_set_link(struct inode *, struct exofs_dir_entry *, struct page *,
157 struct inode *); 155 struct inode *);
158 156
157/* super.c */
158int exofs_sync_fs(struct super_block *sb, int wait);
159
159/********************* 160/*********************
160 * operation vectors * 161 * operation vectors *
161 *********************/ 162 *********************/
diff --git a/fs/exofs/file.c b/fs/exofs/file.c
index 6ed7fe484752..839b9dc1e70f 100644
--- a/fs/exofs/file.c
+++ b/fs/exofs/file.c
@@ -1,8 +1,6 @@
1/* 1/*
2 * Copyright (C) 2005, 2006 2 * Copyright (C) 2005, 2006
3 * Avishay Traeger (avishay@gmail.com) (avishay@il.ibm.com) 3 * Avishay Traeger (avishay@gmail.com)
4 * Copyright (C) 2005, 2006
5 * International Business Machines
6 * Copyright (C) 2008, 2009 4 * Copyright (C) 2008, 2009
7 * Boaz Harrosh <bharrosh@panasas.com> 5 * Boaz Harrosh <bharrosh@panasas.com>
8 * 6 *
@@ -47,16 +45,23 @@ static int exofs_file_fsync(struct file *filp, struct dentry *dentry,
47{ 45{
48 int ret; 46 int ret;
49 struct address_space *mapping = filp->f_mapping; 47 struct address_space *mapping = filp->f_mapping;
48 struct inode *inode = dentry->d_inode;
49 struct super_block *sb;
50 50
51 ret = filemap_write_and_wait(mapping); 51 ret = filemap_write_and_wait(mapping);
52 if (ret) 52 if (ret)
53 return ret; 53 return ret;
54 54
55 /*Note: file_fsync below also calles sync_blockdev, which is a no-op 55 /* sync the inode attributes */
56 * for exofs, but other then that it does sync_inode and 56 ret = write_inode_now(inode, 1);
57 * sync_superblock which is what we need here. 57
58 */ 58 /* This is a good place to write the sb */
59 return file_fsync(filp, dentry, datasync); 59 /* TODO: Sechedule an sb-sync on create */
60 sb = inode->i_sb;
61 if (sb->s_dirt)
62 exofs_sync_fs(sb, 1);
63
64 return ret;
60} 65}
61 66
62static int exofs_flush(struct file *file, fl_owner_t id) 67static int exofs_flush(struct file *file, fl_owner_t id)
diff --git a/fs/exofs/inode.c b/fs/exofs/inode.c
index 77d0a295eb1c..6c10f7476699 100644
--- a/fs/exofs/inode.c
+++ b/fs/exofs/inode.c
@@ -1,8 +1,6 @@
1/* 1/*
2 * Copyright (C) 2005, 2006 2 * Copyright (C) 2005, 2006
3 * Avishay Traeger (avishay@gmail.com) (avishay@il.ibm.com) 3 * Avishay Traeger (avishay@gmail.com)
4 * Copyright (C) 2005, 2006
5 * International Business Machines
6 * Copyright (C) 2008, 2009 4 * Copyright (C) 2008, 2009
7 * Boaz Harrosh <bharrosh@panasas.com> 5 * Boaz Harrosh <bharrosh@panasas.com>
8 * 6 *
@@ -295,6 +293,9 @@ static int read_exec(struct page_collect *pcol, bool is_sync)
295err: 293err:
296 if (!is_sync) 294 if (!is_sync)
297 _unlock_pcol_pages(pcol, ret, READ); 295 _unlock_pcol_pages(pcol, ret, READ);
296 else /* Pages unlocked by caller in sync mode only free bio */
297 pcol_free(pcol);
298
298 kfree(pcol_copy); 299 kfree(pcol_copy);
299 if (or) 300 if (or)
300 osd_end_request(or); 301 osd_end_request(or);
diff --git a/fs/exofs/namei.c b/fs/exofs/namei.c
index 77fdd765e76d..b7dd0c236863 100644
--- a/fs/exofs/namei.c
+++ b/fs/exofs/namei.c
@@ -1,8 +1,6 @@
1/* 1/*
2 * Copyright (C) 2005, 2006 2 * Copyright (C) 2005, 2006
3 * Avishay Traeger (avishay@gmail.com) (avishay@il.ibm.com) 3 * Avishay Traeger (avishay@gmail.com)
4 * Copyright (C) 2005, 2006
5 * International Business Machines
6 * Copyright (C) 2008, 2009 4 * Copyright (C) 2008, 2009
7 * Boaz Harrosh <bharrosh@panasas.com> 5 * Boaz Harrosh <bharrosh@panasas.com>
8 * 6 *
diff --git a/fs/exofs/osd.c b/fs/exofs/osd.c
index b3d2ccb87aaa..4372542df284 100644
--- a/fs/exofs/osd.c
+++ b/fs/exofs/osd.c
@@ -1,8 +1,6 @@
1/* 1/*
2 * Copyright (C) 2005, 2006 2 * Copyright (C) 2005, 2006
3 * Avishay Traeger (avishay@gmail.com) (avishay@il.ibm.com) 3 * Avishay Traeger (avishay@gmail.com)
4 * Copyright (C) 2005, 2006
5 * International Business Machines
6 * Copyright (C) 2008, 2009 4 * Copyright (C) 2008, 2009
7 * Boaz Harrosh <bharrosh@panasas.com> 5 * Boaz Harrosh <bharrosh@panasas.com>
8 * 6 *
diff --git a/fs/exofs/super.c b/fs/exofs/super.c
index 8216c5b77b53..5ab10c3bbebe 100644
--- a/fs/exofs/super.c
+++ b/fs/exofs/super.c
@@ -1,8 +1,6 @@
1/* 1/*
2 * Copyright (C) 2005, 2006 2 * Copyright (C) 2005, 2006
3 * Avishay Traeger (avishay@gmail.com) (avishay@il.ibm.com) 3 * Avishay Traeger (avishay@gmail.com)
4 * Copyright (C) 2005, 2006
5 * International Business Machines
6 * Copyright (C) 2008, 2009 4 * Copyright (C) 2008, 2009
7 * Boaz Harrosh <bharrosh@panasas.com> 5 * Boaz Harrosh <bharrosh@panasas.com>
8 * 6 *
@@ -33,6 +31,7 @@
33 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 31 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
34 */ 32 */
35 33
34#include <linux/smp_lock.h>
36#include <linux/string.h> 35#include <linux/string.h>
37#include <linux/parser.h> 36#include <linux/parser.h>
38#include <linux/vfs.h> 37#include <linux/vfs.h>
@@ -200,7 +199,7 @@ static const struct export_operations exofs_export_ops;
200/* 199/*
201 * Write the superblock to the OSD 200 * Write the superblock to the OSD
202 */ 201 */
203static int exofs_sync_fs(struct super_block *sb, int wait) 202int exofs_sync_fs(struct super_block *sb, int wait)
204{ 203{
205 struct exofs_sb_info *sbi; 204 struct exofs_sb_info *sbi;
206 struct exofs_fscb *fscb; 205 struct exofs_fscb *fscb;
diff --git a/fs/exofs/symlink.c b/fs/exofs/symlink.c
index 36e2d7bc7f7b..4dd687c3e747 100644
--- a/fs/exofs/symlink.c
+++ b/fs/exofs/symlink.c
@@ -1,8 +1,6 @@
1/* 1/*
2 * Copyright (C) 2005, 2006 2 * Copyright (C) 2005, 2006
3 * Avishay Traeger (avishay@gmail.com) (avishay@il.ibm.com) 3 * Avishay Traeger (avishay@gmail.com)
4 * Copyright (C) 2005, 2006
5 * International Business Machines
6 * Copyright (C) 2008, 2009 4 * Copyright (C) 2008, 2009
7 * Boaz Harrosh <bharrosh@panasas.com> 5 * Boaz Harrosh <bharrosh@panasas.com>
8 * 6 *
diff --git a/fs/ext2/ioctl.c b/fs/ext2/ioctl.c
index 7cb4badef927..e7431309bdca 100644
--- a/fs/ext2/ioctl.c
+++ b/fs/ext2/ioctl.c
@@ -13,7 +13,6 @@
13#include <linux/sched.h> 13#include <linux/sched.h>
14#include <linux/compat.h> 14#include <linux/compat.h>
15#include <linux/mount.h> 15#include <linux/mount.h>
16#include <linux/smp_lock.h>
17#include <asm/current.h> 16#include <asm/current.h>
18#include <asm/uaccess.h> 17#include <asm/uaccess.h>
19 18
diff --git a/fs/ext2/namei.c b/fs/ext2/namei.c
index 6524ecaebb7a..e1dedb0f7873 100644
--- a/fs/ext2/namei.c
+++ b/fs/ext2/namei.c
@@ -66,8 +66,16 @@ static struct dentry *ext2_lookup(struct inode * dir, struct dentry *dentry, str
66 inode = NULL; 66 inode = NULL;
67 if (ino) { 67 if (ino) {
68 inode = ext2_iget(dir->i_sb, ino); 68 inode = ext2_iget(dir->i_sb, ino);
69 if (IS_ERR(inode)) 69 if (unlikely(IS_ERR(inode))) {
70 return ERR_CAST(inode); 70 if (PTR_ERR(inode) == -ESTALE) {
71 ext2_error(dir->i_sb, __func__,
72 "deleted inode referenced: %lu",
73 ino);
74 return ERR_PTR(-EIO);
75 } else {
76 return ERR_CAST(inode);
77 }
78 }
71 } 79 }
72 return d_splice_alias(inode, dentry); 80 return d_splice_alias(inode, dentry);
73} 81}
diff --git a/fs/ext3/dir.c b/fs/ext3/dir.c
index 3d724a95882f..373fa90c796a 100644
--- a/fs/ext3/dir.c
+++ b/fs/ext3/dir.c
@@ -130,8 +130,7 @@ static int ext3_readdir(struct file * filp,
130 struct buffer_head *bh = NULL; 130 struct buffer_head *bh = NULL;
131 131
132 map_bh.b_state = 0; 132 map_bh.b_state = 0;
133 err = ext3_get_blocks_handle(NULL, inode, blk, 1, 133 err = ext3_get_blocks_handle(NULL, inode, blk, 1, &map_bh, 0);
134 &map_bh, 0, 0);
135 if (err > 0) { 134 if (err > 0) {
136 pgoff_t index = map_bh.b_blocknr >> 135 pgoff_t index = map_bh.b_blocknr >>
137 (PAGE_CACHE_SHIFT - inode->i_blkbits); 136 (PAGE_CACHE_SHIFT - inode->i_blkbits);
diff --git a/fs/ext3/inode.c b/fs/ext3/inode.c
index 5f51fed5c750..b49908a167ae 100644
--- a/fs/ext3/inode.c
+++ b/fs/ext3/inode.c
@@ -788,7 +788,7 @@ err_out:
788int ext3_get_blocks_handle(handle_t *handle, struct inode *inode, 788int ext3_get_blocks_handle(handle_t *handle, struct inode *inode,
789 sector_t iblock, unsigned long maxblocks, 789 sector_t iblock, unsigned long maxblocks,
790 struct buffer_head *bh_result, 790 struct buffer_head *bh_result,
791 int create, int extend_disksize) 791 int create)
792{ 792{
793 int err = -EIO; 793 int err = -EIO;
794 int offsets[4]; 794 int offsets[4];
@@ -911,13 +911,6 @@ int ext3_get_blocks_handle(handle_t *handle, struct inode *inode,
911 if (!err) 911 if (!err)
912 err = ext3_splice_branch(handle, inode, iblock, 912 err = ext3_splice_branch(handle, inode, iblock,
913 partial, indirect_blks, count); 913 partial, indirect_blks, count);
914 /*
915 * i_disksize growing is protected by truncate_mutex. Don't forget to
916 * protect it if you're about to implement concurrent
917 * ext3_get_block() -bzzz
918 */
919 if (!err && extend_disksize && inode->i_size > ei->i_disksize)
920 ei->i_disksize = inode->i_size;
921 mutex_unlock(&ei->truncate_mutex); 914 mutex_unlock(&ei->truncate_mutex);
922 if (err) 915 if (err)
923 goto cleanup; 916 goto cleanup;
@@ -972,7 +965,7 @@ static int ext3_get_block(struct inode *inode, sector_t iblock,
972 } 965 }
973 966
974 ret = ext3_get_blocks_handle(handle, inode, iblock, 967 ret = ext3_get_blocks_handle(handle, inode, iblock,
975 max_blocks, bh_result, create, 0); 968 max_blocks, bh_result, create);
976 if (ret > 0) { 969 if (ret > 0) {
977 bh_result->b_size = (ret << inode->i_blkbits); 970 bh_result->b_size = (ret << inode->i_blkbits);
978 ret = 0; 971 ret = 0;
@@ -1005,7 +998,7 @@ struct buffer_head *ext3_getblk(handle_t *handle, struct inode *inode,
1005 dummy.b_blocknr = -1000; 998 dummy.b_blocknr = -1000;
1006 buffer_trace_init(&dummy.b_history); 999 buffer_trace_init(&dummy.b_history);
1007 err = ext3_get_blocks_handle(handle, inode, block, 1, 1000 err = ext3_get_blocks_handle(handle, inode, block, 1,
1008 &dummy, create, 1); 1001 &dummy, create);
1009 /* 1002 /*
1010 * ext3_get_blocks_handle() returns number of blocks 1003 * ext3_get_blocks_handle() returns number of blocks
1011 * mapped. 0 in case of a HOLE. 1004 * mapped. 0 in case of a HOLE.
@@ -1193,15 +1186,16 @@ write_begin_failed:
1193 * i_size_read because we hold i_mutex. 1186 * i_size_read because we hold i_mutex.
1194 * 1187 *
1195 * Add inode to orphan list in case we crash before truncate 1188 * Add inode to orphan list in case we crash before truncate
1196 * finishes. 1189 * finishes. Do this only if ext3_can_truncate() agrees so
1190 * that orphan processing code is happy.
1197 */ 1191 */
1198 if (pos + len > inode->i_size) 1192 if (pos + len > inode->i_size && ext3_can_truncate(inode))
1199 ext3_orphan_add(handle, inode); 1193 ext3_orphan_add(handle, inode);
1200 ext3_journal_stop(handle); 1194 ext3_journal_stop(handle);
1201 unlock_page(page); 1195 unlock_page(page);
1202 page_cache_release(page); 1196 page_cache_release(page);
1203 if (pos + len > inode->i_size) 1197 if (pos + len > inode->i_size)
1204 vmtruncate(inode, inode->i_size); 1198 ext3_truncate(inode);
1205 } 1199 }
1206 if (ret == -ENOSPC && ext3_should_retry_alloc(inode->i_sb, &retries)) 1200 if (ret == -ENOSPC && ext3_should_retry_alloc(inode->i_sb, &retries))
1207 goto retry; 1201 goto retry;
@@ -1287,7 +1281,7 @@ static int ext3_ordered_write_end(struct file *file,
1287 * There may be allocated blocks outside of i_size because 1281 * There may be allocated blocks outside of i_size because
1288 * we failed to copy some data. Prepare for truncate. 1282 * we failed to copy some data. Prepare for truncate.
1289 */ 1283 */
1290 if (pos + len > inode->i_size) 1284 if (pos + len > inode->i_size && ext3_can_truncate(inode))
1291 ext3_orphan_add(handle, inode); 1285 ext3_orphan_add(handle, inode);
1292 ret2 = ext3_journal_stop(handle); 1286 ret2 = ext3_journal_stop(handle);
1293 if (!ret) 1287 if (!ret)
@@ -1296,7 +1290,7 @@ static int ext3_ordered_write_end(struct file *file,
1296 page_cache_release(page); 1290 page_cache_release(page);
1297 1291
1298 if (pos + len > inode->i_size) 1292 if (pos + len > inode->i_size)
1299 vmtruncate(inode, inode->i_size); 1293 ext3_truncate(inode);
1300 return ret ? ret : copied; 1294 return ret ? ret : copied;
1301} 1295}
1302 1296
@@ -1315,14 +1309,14 @@ static int ext3_writeback_write_end(struct file *file,
1315 * There may be allocated blocks outside of i_size because 1309 * There may be allocated blocks outside of i_size because
1316 * we failed to copy some data. Prepare for truncate. 1310 * we failed to copy some data. Prepare for truncate.
1317 */ 1311 */
1318 if (pos + len > inode->i_size) 1312 if (pos + len > inode->i_size && ext3_can_truncate(inode))
1319 ext3_orphan_add(handle, inode); 1313 ext3_orphan_add(handle, inode);
1320 ret = ext3_journal_stop(handle); 1314 ret = ext3_journal_stop(handle);
1321 unlock_page(page); 1315 unlock_page(page);
1322 page_cache_release(page); 1316 page_cache_release(page);
1323 1317
1324 if (pos + len > inode->i_size) 1318 if (pos + len > inode->i_size)
1325 vmtruncate(inode, inode->i_size); 1319 ext3_truncate(inode);
1326 return ret ? ret : copied; 1320 return ret ? ret : copied;
1327} 1321}
1328 1322
@@ -1358,7 +1352,7 @@ static int ext3_journalled_write_end(struct file *file,
1358 * There may be allocated blocks outside of i_size because 1352 * There may be allocated blocks outside of i_size because
1359 * we failed to copy some data. Prepare for truncate. 1353 * we failed to copy some data. Prepare for truncate.
1360 */ 1354 */
1361 if (pos + len > inode->i_size) 1355 if (pos + len > inode->i_size && ext3_can_truncate(inode))
1362 ext3_orphan_add(handle, inode); 1356 ext3_orphan_add(handle, inode);
1363 EXT3_I(inode)->i_state |= EXT3_STATE_JDATA; 1357 EXT3_I(inode)->i_state |= EXT3_STATE_JDATA;
1364 if (inode->i_size > EXT3_I(inode)->i_disksize) { 1358 if (inode->i_size > EXT3_I(inode)->i_disksize) {
@@ -1375,7 +1369,7 @@ static int ext3_journalled_write_end(struct file *file,
1375 page_cache_release(page); 1369 page_cache_release(page);
1376 1370
1377 if (pos + len > inode->i_size) 1371 if (pos + len > inode->i_size)
1378 vmtruncate(inode, inode->i_size); 1372 ext3_truncate(inode);
1379 return ret ? ret : copied; 1373 return ret ? ret : copied;
1380} 1374}
1381 1375
diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h
index 0ddf7e55abe1..9714db393efe 100644
--- a/fs/ext4/ext4.h
+++ b/fs/ext4/ext4.h
@@ -93,20 +93,20 @@ typedef unsigned int ext4_group_t;
93struct ext4_allocation_request { 93struct ext4_allocation_request {
94 /* target inode for block we're allocating */ 94 /* target inode for block we're allocating */
95 struct inode *inode; 95 struct inode *inode;
96 /* how many blocks we want to allocate */
97 unsigned int len;
96 /* logical block in target inode */ 98 /* logical block in target inode */
97 ext4_lblk_t logical; 99 ext4_lblk_t logical;
98 /* phys. target (a hint) */
99 ext4_fsblk_t goal;
100 /* the closest logical allocated block to the left */ 100 /* the closest logical allocated block to the left */
101 ext4_lblk_t lleft; 101 ext4_lblk_t lleft;
102 /* phys. block for ^^^ */
103 ext4_fsblk_t pleft;
104 /* the closest logical allocated block to the right */ 102 /* the closest logical allocated block to the right */
105 ext4_lblk_t lright; 103 ext4_lblk_t lright;
106 /* phys. block for ^^^ */ 104 /* phys. target (a hint) */
105 ext4_fsblk_t goal;
106 /* phys. block for the closest logical allocated block to the left */
107 ext4_fsblk_t pleft;
108 /* phys. block for the closest logical allocated block to the right */
107 ext4_fsblk_t pright; 109 ext4_fsblk_t pright;
108 /* how many blocks we want to allocate */
109 unsigned int len;
110 /* flags. see above EXT4_MB_HINT_* */ 110 /* flags. see above EXT4_MB_HINT_* */
111 unsigned int flags; 111 unsigned int flags;
112}; 112};
diff --git a/fs/ext4/ext4_jbd2.c b/fs/ext4/ext4_jbd2.c
index ad13a84644e1..eb27fd0f2ee8 100644
--- a/fs/ext4/ext4_jbd2.c
+++ b/fs/ext4/ext4_jbd2.c
@@ -43,6 +43,8 @@ int __ext4_journal_forget(const char *where, handle_t *handle,
43 ext4_journal_abort_handle(where, __func__, bh, 43 ext4_journal_abort_handle(where, __func__, bh,
44 handle, err); 44 handle, err);
45 } 45 }
46 else
47 brelse(bh);
46 return err; 48 return err;
47} 49}
48 50
@@ -57,6 +59,8 @@ int __ext4_journal_revoke(const char *where, handle_t *handle,
57 ext4_journal_abort_handle(where, __func__, bh, 59 ext4_journal_abort_handle(where, __func__, bh,
58 handle, err); 60 handle, err);
59 } 61 }
62 else
63 brelse(bh);
60 return err; 64 return err;
61} 65}
62 66
diff --git a/fs/ext4/ext4_jbd2.h b/fs/ext4/ext4_jbd2.h
index be2f426f6805..139fb8cb87e4 100644
--- a/fs/ext4/ext4_jbd2.h
+++ b/fs/ext4/ext4_jbd2.h
@@ -131,9 +131,11 @@ int __ext4_journal_get_undo_access(const char *where, handle_t *handle,
131int __ext4_journal_get_write_access(const char *where, handle_t *handle, 131int __ext4_journal_get_write_access(const char *where, handle_t *handle,
132 struct buffer_head *bh); 132 struct buffer_head *bh);
133 133
134/* When called with an invalid handle, this will still do a put on the BH */
134int __ext4_journal_forget(const char *where, handle_t *handle, 135int __ext4_journal_forget(const char *where, handle_t *handle,
135 struct buffer_head *bh); 136 struct buffer_head *bh);
136 137
138/* When called with an invalid handle, this will still do a put on the BH */
137int __ext4_journal_revoke(const char *where, handle_t *handle, 139int __ext4_journal_revoke(const char *where, handle_t *handle,
138 ext4_fsblk_t blocknr, struct buffer_head *bh); 140 ext4_fsblk_t blocknr, struct buffer_head *bh);
139 141
@@ -281,10 +283,10 @@ static inline int ext4_should_order_data(struct inode *inode)
281 283
282static inline int ext4_should_writeback_data(struct inode *inode) 284static inline int ext4_should_writeback_data(struct inode *inode)
283{ 285{
284 if (EXT4_JOURNAL(inode) == NULL)
285 return 0;
286 if (!S_ISREG(inode->i_mode)) 286 if (!S_ISREG(inode->i_mode))
287 return 0; 287 return 0;
288 if (EXT4_JOURNAL(inode) == NULL)
289 return 1;
288 if (EXT4_I(inode)->i_flags & EXT4_JOURNAL_DATA_FL) 290 if (EXT4_I(inode)->i_flags & EXT4_JOURNAL_DATA_FL)
289 return 0; 291 return 0;
290 if (test_opt(inode->i_sb, DATA_FLAGS) == EXT4_MOUNT_WRITEBACK_DATA) 292 if (test_opt(inode->i_sb, DATA_FLAGS) == EXT4_MOUNT_WRITEBACK_DATA)
diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c
index 50322a09bd01..73ebfb44ad75 100644
--- a/fs/ext4/extents.c
+++ b/fs/ext4/extents.c
@@ -1977,6 +1977,7 @@ int ext4_ext_calc_credits_for_single_extent(struct inode *inode, int nrblocks,
1977 */ 1977 */
1978 /* 1 bitmap, 1 block group descriptor */ 1978 /* 1 bitmap, 1 block group descriptor */
1979 ret = 2 + EXT4_META_TRANS_BLOCKS(inode->i_sb); 1979 ret = 2 + EXT4_META_TRANS_BLOCKS(inode->i_sb);
1980 return ret;
1980 } 1981 }
1981 } 1982 }
1982 1983
diff --git a/fs/ext4/ialloc.c b/fs/ext4/ialloc.c
index 2f645732e3b7..29e6dc7299b8 100644
--- a/fs/ext4/ialloc.c
+++ b/fs/ext4/ialloc.c
@@ -833,7 +833,7 @@ struct inode *ext4_new_inode(handle_t *handle, struct inode *dir, int mode,
833 if (!goal) 833 if (!goal)
834 goal = sbi->s_inode_goal; 834 goal = sbi->s_inode_goal;
835 835
836 if (goal && goal < le32_to_cpu(sbi->s_es->s_inodes_count)) { 836 if (goal && goal <= le32_to_cpu(sbi->s_es->s_inodes_count)) {
837 group = (goal - 1) / EXT4_INODES_PER_GROUP(sb); 837 group = (goal - 1) / EXT4_INODES_PER_GROUP(sb);
838 ino = (goal - 1) % EXT4_INODES_PER_GROUP(sb); 838 ino = (goal - 1) % EXT4_INODES_PER_GROUP(sb);
839 ret2 = 0; 839 ret2 = 0;
diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
index 60a26f3a6f8b..f9c642b22efa 100644
--- a/fs/ext4/inode.c
+++ b/fs/ext4/inode.c
@@ -78,16 +78,14 @@ static int ext4_inode_is_fast_symlink(struct inode *inode)
78 * but there may still be a record of it in the journal, and that record 78 * but there may still be a record of it in the journal, and that record
79 * still needs to be revoked. 79 * still needs to be revoked.
80 * 80 *
81 * If the handle isn't valid we're not journaling so there's nothing to do. 81 * If the handle isn't valid we're not journaling, but we still need to
82 * call into ext4_journal_revoke() to put the buffer head.
82 */ 83 */
83int ext4_forget(handle_t *handle, int is_metadata, struct inode *inode, 84int ext4_forget(handle_t *handle, int is_metadata, struct inode *inode,
84 struct buffer_head *bh, ext4_fsblk_t blocknr) 85 struct buffer_head *bh, ext4_fsblk_t blocknr)
85{ 86{
86 int err; 87 int err;
87 88
88 if (!ext4_handle_valid(handle))
89 return 0;
90
91 might_sleep(); 89 might_sleep();
92 90
93 BUFFER_TRACE(bh, "enter"); 91 BUFFER_TRACE(bh, "enter");
@@ -1513,14 +1511,14 @@ retry:
1513 * Add inode to orphan list in case we crash before 1511 * Add inode to orphan list in case we crash before
1514 * truncate finishes 1512 * truncate finishes
1515 */ 1513 */
1516 if (pos + len > inode->i_size) 1514 if (pos + len > inode->i_size && ext4_can_truncate(inode))
1517 ext4_orphan_add(handle, inode); 1515 ext4_orphan_add(handle, inode);
1518 1516
1519 ext4_journal_stop(handle); 1517 ext4_journal_stop(handle);
1520 if (pos + len > inode->i_size) { 1518 if (pos + len > inode->i_size) {
1521 vmtruncate(inode, inode->i_size); 1519 ext4_truncate(inode);
1522 /* 1520 /*
1523 * If vmtruncate failed early the inode might 1521 * If truncate failed early the inode might
1524 * still be on the orphan list; we need to 1522 * still be on the orphan list; we need to
1525 * make sure the inode is removed from the 1523 * make sure the inode is removed from the
1526 * orphan list in that case. 1524 * orphan list in that case.
@@ -1614,7 +1612,7 @@ static int ext4_ordered_write_end(struct file *file,
1614 ret2 = ext4_generic_write_end(file, mapping, pos, len, copied, 1612 ret2 = ext4_generic_write_end(file, mapping, pos, len, copied,
1615 page, fsdata); 1613 page, fsdata);
1616 copied = ret2; 1614 copied = ret2;
1617 if (pos + len > inode->i_size) 1615 if (pos + len > inode->i_size && ext4_can_truncate(inode))
1618 /* if we have allocated more blocks and copied 1616 /* if we have allocated more blocks and copied
1619 * less. We will have blocks allocated outside 1617 * less. We will have blocks allocated outside
1620 * inode->i_size. So truncate them 1618 * inode->i_size. So truncate them
@@ -1628,9 +1626,9 @@ static int ext4_ordered_write_end(struct file *file,
1628 ret = ret2; 1626 ret = ret2;
1629 1627
1630 if (pos + len > inode->i_size) { 1628 if (pos + len > inode->i_size) {
1631 vmtruncate(inode, inode->i_size); 1629 ext4_truncate(inode);
1632 /* 1630 /*
1633 * If vmtruncate failed early the inode might still be 1631 * If truncate failed early the inode might still be
1634 * on the orphan list; we need to make sure the inode 1632 * on the orphan list; we need to make sure the inode
1635 * is removed from the orphan list in that case. 1633 * is removed from the orphan list in that case.
1636 */ 1634 */
@@ -1655,7 +1653,7 @@ static int ext4_writeback_write_end(struct file *file,
1655 ret2 = ext4_generic_write_end(file, mapping, pos, len, copied, 1653 ret2 = ext4_generic_write_end(file, mapping, pos, len, copied,
1656 page, fsdata); 1654 page, fsdata);
1657 copied = ret2; 1655 copied = ret2;
1658 if (pos + len > inode->i_size) 1656 if (pos + len > inode->i_size && ext4_can_truncate(inode))
1659 /* if we have allocated more blocks and copied 1657 /* if we have allocated more blocks and copied
1660 * less. We will have blocks allocated outside 1658 * less. We will have blocks allocated outside
1661 * inode->i_size. So truncate them 1659 * inode->i_size. So truncate them
@@ -1670,9 +1668,9 @@ static int ext4_writeback_write_end(struct file *file,
1670 ret = ret2; 1668 ret = ret2;
1671 1669
1672 if (pos + len > inode->i_size) { 1670 if (pos + len > inode->i_size) {
1673 vmtruncate(inode, inode->i_size); 1671 ext4_truncate(inode);
1674 /* 1672 /*
1675 * If vmtruncate failed early the inode might still be 1673 * If truncate failed early the inode might still be
1676 * on the orphan list; we need to make sure the inode 1674 * on the orphan list; we need to make sure the inode
1677 * is removed from the orphan list in that case. 1675 * is removed from the orphan list in that case.
1678 */ 1676 */
@@ -1722,7 +1720,7 @@ static int ext4_journalled_write_end(struct file *file,
1722 1720
1723 unlock_page(page); 1721 unlock_page(page);
1724 page_cache_release(page); 1722 page_cache_release(page);
1725 if (pos + len > inode->i_size) 1723 if (pos + len > inode->i_size && ext4_can_truncate(inode))
1726 /* if we have allocated more blocks and copied 1724 /* if we have allocated more blocks and copied
1727 * less. We will have blocks allocated outside 1725 * less. We will have blocks allocated outside
1728 * inode->i_size. So truncate them 1726 * inode->i_size. So truncate them
@@ -1733,9 +1731,9 @@ static int ext4_journalled_write_end(struct file *file,
1733 if (!ret) 1731 if (!ret)
1734 ret = ret2; 1732 ret = ret2;
1735 if (pos + len > inode->i_size) { 1733 if (pos + len > inode->i_size) {
1736 vmtruncate(inode, inode->i_size); 1734 ext4_truncate(inode);
1737 /* 1735 /*
1738 * If vmtruncate failed early the inode might still be 1736 * If truncate failed early the inode might still be
1739 * on the orphan list; we need to make sure the inode 1737 * on the orphan list; we need to make sure the inode
1740 * is removed from the orphan list in that case. 1738 * is removed from the orphan list in that case.
1741 */ 1739 */
@@ -2305,15 +2303,9 @@ flush_it:
2305 return; 2303 return;
2306} 2304}
2307 2305
2308static int ext4_bh_unmapped_or_delay(handle_t *handle, struct buffer_head *bh) 2306static int ext4_bh_delay_or_unwritten(handle_t *handle, struct buffer_head *bh)
2309{ 2307{
2310 /* 2308 return (buffer_delay(bh) || buffer_unwritten(bh)) && buffer_dirty(bh);
2311 * unmapped buffer is possible for holes.
2312 * delay buffer is possible with delayed allocation.
2313 * We also need to consider unwritten buffer as unmapped.
2314 */
2315 return (!buffer_mapped(bh) || buffer_delay(bh) ||
2316 buffer_unwritten(bh)) && buffer_dirty(bh);
2317} 2309}
2318 2310
2319/* 2311/*
@@ -2398,9 +2390,9 @@ static int __mpage_da_writepage(struct page *page,
2398 * We need to try to allocate 2390 * We need to try to allocate
2399 * unmapped blocks in the same page. 2391 * unmapped blocks in the same page.
2400 * Otherwise we won't make progress 2392 * Otherwise we won't make progress
2401 * with the page in ext4_da_writepage 2393 * with the page in ext4_writepage
2402 */ 2394 */
2403 if (ext4_bh_unmapped_or_delay(NULL, bh)) { 2395 if (ext4_bh_delay_or_unwritten(NULL, bh)) {
2404 mpage_add_bh_to_extent(mpd, logical, 2396 mpage_add_bh_to_extent(mpd, logical,
2405 bh->b_size, 2397 bh->b_size,
2406 bh->b_state); 2398 bh->b_state);
@@ -2517,7 +2509,6 @@ static int noalloc_get_block_write(struct inode *inode, sector_t iblock,
2517 * so call get_block_wrap with create = 0 2509 * so call get_block_wrap with create = 0
2518 */ 2510 */
2519 ret = ext4_get_blocks(NULL, inode, iblock, max_blocks, bh_result, 0); 2511 ret = ext4_get_blocks(NULL, inode, iblock, max_blocks, bh_result, 0);
2520 BUG_ON(create && ret == 0);
2521 if (ret > 0) { 2512 if (ret > 0) {
2522 bh_result->b_size = (ret << inode->i_blkbits); 2513 bh_result->b_size = (ret << inode->i_blkbits);
2523 ret = 0; 2514 ret = 0;
@@ -2525,15 +2516,102 @@ static int noalloc_get_block_write(struct inode *inode, sector_t iblock,
2525 return ret; 2516 return ret;
2526} 2517}
2527 2518
2519static int bget_one(handle_t *handle, struct buffer_head *bh)
2520{
2521 get_bh(bh);
2522 return 0;
2523}
2524
2525static int bput_one(handle_t *handle, struct buffer_head *bh)
2526{
2527 put_bh(bh);
2528 return 0;
2529}
2530
2531static int __ext4_journalled_writepage(struct page *page,
2532 struct writeback_control *wbc,
2533 unsigned int len)
2534{
2535 struct address_space *mapping = page->mapping;
2536 struct inode *inode = mapping->host;
2537 struct buffer_head *page_bufs;
2538 handle_t *handle = NULL;
2539 int ret = 0;
2540 int err;
2541
2542 page_bufs = page_buffers(page);
2543 BUG_ON(!page_bufs);
2544 walk_page_buffers(handle, page_bufs, 0, len, NULL, bget_one);
2545 /* As soon as we unlock the page, it can go away, but we have
2546 * references to buffers so we are safe */
2547 unlock_page(page);
2548
2549 handle = ext4_journal_start(inode, ext4_writepage_trans_blocks(inode));
2550 if (IS_ERR(handle)) {
2551 ret = PTR_ERR(handle);
2552 goto out;
2553 }
2554
2555 ret = walk_page_buffers(handle, page_bufs, 0, len, NULL,
2556 do_journal_get_write_access);
2557
2558 err = walk_page_buffers(handle, page_bufs, 0, len, NULL,
2559 write_end_fn);
2560 if (ret == 0)
2561 ret = err;
2562 err = ext4_journal_stop(handle);
2563 if (!ret)
2564 ret = err;
2565
2566 walk_page_buffers(handle, page_bufs, 0, len, NULL, bput_one);
2567 EXT4_I(inode)->i_state |= EXT4_STATE_JDATA;
2568out:
2569 return ret;
2570}
2571
2528/* 2572/*
2573 * Note that we don't need to start a transaction unless we're journaling data
2574 * because we should have holes filled from ext4_page_mkwrite(). We even don't
2575 * need to file the inode to the transaction's list in ordered mode because if
2576 * we are writing back data added by write(), the inode is already there and if
2577 * we are writing back data modified via mmap(), noone guarantees in which
2578 * transaction the data will hit the disk. In case we are journaling data, we
2579 * cannot start transaction directly because transaction start ranks above page
2580 * lock so we have to do some magic.
2581 *
2529 * This function can get called via... 2582 * This function can get called via...
2530 * - ext4_da_writepages after taking page lock (have journal handle) 2583 * - ext4_da_writepages after taking page lock (have journal handle)
2531 * - journal_submit_inode_data_buffers (no journal handle) 2584 * - journal_submit_inode_data_buffers (no journal handle)
2532 * - shrink_page_list via pdflush (no journal handle) 2585 * - shrink_page_list via pdflush (no journal handle)
2533 * - grab_page_cache when doing write_begin (have journal handle) 2586 * - grab_page_cache when doing write_begin (have journal handle)
2587 *
2588 * We don't do any block allocation in this function. If we have page with
2589 * multiple blocks we need to write those buffer_heads that are mapped. This
2590 * is important for mmaped based write. So if we do with blocksize 1K
2591 * truncate(f, 1024);
2592 * a = mmap(f, 0, 4096);
2593 * a[0] = 'a';
2594 * truncate(f, 4096);
2595 * we have in the page first buffer_head mapped via page_mkwrite call back
2596 * but other bufer_heads would be unmapped but dirty(dirty done via the
2597 * do_wp_page). So writepage should write the first block. If we modify
2598 * the mmap area beyond 1024 we will again get a page_fault and the
2599 * page_mkwrite callback will do the block allocation and mark the
2600 * buffer_heads mapped.
2601 *
2602 * We redirty the page if we have any buffer_heads that is either delay or
2603 * unwritten in the page.
2604 *
2605 * We can get recursively called as show below.
2606 *
2607 * ext4_writepage() -> kmalloc() -> __alloc_pages() -> page_launder() ->
2608 * ext4_writepage()
2609 *
2610 * But since we don't do any block allocation we should not deadlock.
2611 * Page also have the dirty flag cleared so we don't get recurive page_lock.
2534 */ 2612 */
2535static int ext4_da_writepage(struct page *page, 2613static int ext4_writepage(struct page *page,
2536 struct writeback_control *wbc) 2614 struct writeback_control *wbc)
2537{ 2615{
2538 int ret = 0; 2616 int ret = 0;
2539 loff_t size; 2617 loff_t size;
@@ -2541,7 +2619,7 @@ static int ext4_da_writepage(struct page *page,
2541 struct buffer_head *page_bufs; 2619 struct buffer_head *page_bufs;
2542 struct inode *inode = page->mapping->host; 2620 struct inode *inode = page->mapping->host;
2543 2621
2544 trace_ext4_da_writepage(inode, page); 2622 trace_ext4_writepage(inode, page);
2545 size = i_size_read(inode); 2623 size = i_size_read(inode);
2546 if (page->index == size >> PAGE_CACHE_SHIFT) 2624 if (page->index == size >> PAGE_CACHE_SHIFT)
2547 len = size & ~PAGE_CACHE_MASK; 2625 len = size & ~PAGE_CACHE_MASK;
@@ -2551,7 +2629,7 @@ static int ext4_da_writepage(struct page *page,
2551 if (page_has_buffers(page)) { 2629 if (page_has_buffers(page)) {
2552 page_bufs = page_buffers(page); 2630 page_bufs = page_buffers(page);
2553 if (walk_page_buffers(NULL, page_bufs, 0, len, NULL, 2631 if (walk_page_buffers(NULL, page_bufs, 0, len, NULL,
2554 ext4_bh_unmapped_or_delay)) { 2632 ext4_bh_delay_or_unwritten)) {
2555 /* 2633 /*
2556 * We don't want to do block allocation 2634 * We don't want to do block allocation
2557 * So redirty the page and return 2635 * So redirty the page and return
@@ -2578,13 +2656,13 @@ static int ext4_da_writepage(struct page *page,
2578 * all are mapped and non delay. We don't want to 2656 * all are mapped and non delay. We don't want to
2579 * do block allocation here. 2657 * do block allocation here.
2580 */ 2658 */
2581 ret = block_prepare_write(page, 0, PAGE_CACHE_SIZE, 2659 ret = block_prepare_write(page, 0, len,
2582 noalloc_get_block_write); 2660 noalloc_get_block_write);
2583 if (!ret) { 2661 if (!ret) {
2584 page_bufs = page_buffers(page); 2662 page_bufs = page_buffers(page);
2585 /* check whether all are mapped and non delay */ 2663 /* check whether all are mapped and non delay */
2586 if (walk_page_buffers(NULL, page_bufs, 0, len, NULL, 2664 if (walk_page_buffers(NULL, page_bufs, 0, len, NULL,
2587 ext4_bh_unmapped_or_delay)) { 2665 ext4_bh_delay_or_unwritten)) {
2588 redirty_page_for_writepage(wbc, page); 2666 redirty_page_for_writepage(wbc, page);
2589 unlock_page(page); 2667 unlock_page(page);
2590 return 0; 2668 return 0;
@@ -2600,7 +2678,16 @@ static int ext4_da_writepage(struct page *page,
2600 return 0; 2678 return 0;
2601 } 2679 }
2602 /* now mark the buffer_heads as dirty and uptodate */ 2680 /* now mark the buffer_heads as dirty and uptodate */
2603 block_commit_write(page, 0, PAGE_CACHE_SIZE); 2681 block_commit_write(page, 0, len);
2682 }
2683
2684 if (PageChecked(page) && ext4_should_journal_data(inode)) {
2685 /*
2686 * It's mmapped pagecache. Add buffers and journal it. There
2687 * doesn't seem much point in redirtying the page here.
2688 */
2689 ClearPageChecked(page);
2690 return __ext4_journalled_writepage(page, wbc, len);
2604 } 2691 }
2605 2692
2606 if (test_opt(inode->i_sb, NOBH) && ext4_should_writeback_data(inode)) 2693 if (test_opt(inode->i_sb, NOBH) && ext4_should_writeback_data(inode))
@@ -2907,7 +2994,7 @@ retry:
2907 * i_size_read because we hold i_mutex. 2994 * i_size_read because we hold i_mutex.
2908 */ 2995 */
2909 if (pos + len > inode->i_size) 2996 if (pos + len > inode->i_size)
2910 vmtruncate(inode, inode->i_size); 2997 ext4_truncate(inode);
2911 } 2998 }
2912 2999
2913 if (ret == -ENOSPC && ext4_should_retry_alloc(inode->i_sb, &retries)) 3000 if (ret == -ENOSPC && ext4_should_retry_alloc(inode->i_sb, &retries))
@@ -3130,222 +3217,6 @@ static sector_t ext4_bmap(struct address_space *mapping, sector_t block)
3130 return generic_block_bmap(mapping, block, ext4_get_block); 3217 return generic_block_bmap(mapping, block, ext4_get_block);
3131} 3218}
3132 3219
3133static int bget_one(handle_t *handle, struct buffer_head *bh)
3134{
3135 get_bh(bh);
3136 return 0;
3137}
3138
3139static int bput_one(handle_t *handle, struct buffer_head *bh)
3140{
3141 put_bh(bh);
3142 return 0;
3143}
3144
3145/*
3146 * Note that we don't need to start a transaction unless we're journaling data
3147 * because we should have holes filled from ext4_page_mkwrite(). We even don't
3148 * need to file the inode to the transaction's list in ordered mode because if
3149 * we are writing back data added by write(), the inode is already there and if
3150 * we are writing back data modified via mmap(), noone guarantees in which
3151 * transaction the data will hit the disk. In case we are journaling data, we
3152 * cannot start transaction directly because transaction start ranks above page
3153 * lock so we have to do some magic.
3154 *
3155 * In all journaling modes block_write_full_page() will start the I/O.
3156 *
3157 * Problem:
3158 *
3159 * ext4_writepage() -> kmalloc() -> __alloc_pages() -> page_launder() ->
3160 * ext4_writepage()
3161 *
3162 * Similar for:
3163 *
3164 * ext4_file_write() -> generic_file_write() -> __alloc_pages() -> ...
3165 *
3166 * Same applies to ext4_get_block(). We will deadlock on various things like
3167 * lock_journal and i_data_sem
3168 *
3169 * Setting PF_MEMALLOC here doesn't work - too many internal memory
3170 * allocations fail.
3171 *
3172 * 16May01: If we're reentered then journal_current_handle() will be
3173 * non-zero. We simply *return*.
3174 *
3175 * 1 July 2001: @@@ FIXME:
3176 * In journalled data mode, a data buffer may be metadata against the
3177 * current transaction. But the same file is part of a shared mapping
3178 * and someone does a writepage() on it.
3179 *
3180 * We will move the buffer onto the async_data list, but *after* it has
3181 * been dirtied. So there's a small window where we have dirty data on
3182 * BJ_Metadata.
3183 *
3184 * Note that this only applies to the last partial page in the file. The
3185 * bit which block_write_full_page() uses prepare/commit for. (That's
3186 * broken code anyway: it's wrong for msync()).
3187 *
3188 * It's a rare case: affects the final partial page, for journalled data
3189 * where the file is subject to bith write() and writepage() in the same
3190 * transction. To fix it we'll need a custom block_write_full_page().
3191 * We'll probably need that anyway for journalling writepage() output.
3192 *
3193 * We don't honour synchronous mounts for writepage(). That would be
3194 * disastrous. Any write() or metadata operation will sync the fs for
3195 * us.
3196 *
3197 */
3198static int __ext4_normal_writepage(struct page *page,
3199 struct writeback_control *wbc)
3200{
3201 struct inode *inode = page->mapping->host;
3202
3203 if (test_opt(inode->i_sb, NOBH))
3204 return nobh_writepage(page, noalloc_get_block_write, wbc);
3205 else
3206 return block_write_full_page(page, noalloc_get_block_write,
3207 wbc);
3208}
3209
3210static int ext4_normal_writepage(struct page *page,
3211 struct writeback_control *wbc)
3212{
3213 struct inode *inode = page->mapping->host;
3214 loff_t size = i_size_read(inode);
3215 loff_t len;
3216
3217 trace_ext4_normal_writepage(inode, page);
3218 J_ASSERT(PageLocked(page));
3219 if (page->index == size >> PAGE_CACHE_SHIFT)
3220 len = size & ~PAGE_CACHE_MASK;
3221 else
3222 len = PAGE_CACHE_SIZE;
3223
3224 if (page_has_buffers(page)) {
3225 /* if page has buffers it should all be mapped
3226 * and allocated. If there are not buffers attached
3227 * to the page we know the page is dirty but it lost
3228 * buffers. That means that at some moment in time
3229 * after write_begin() / write_end() has been called
3230 * all buffers have been clean and thus they must have been
3231 * written at least once. So they are all mapped and we can
3232 * happily proceed with mapping them and writing the page.
3233 */
3234 BUG_ON(walk_page_buffers(NULL, page_buffers(page), 0, len, NULL,
3235 ext4_bh_unmapped_or_delay));
3236 }
3237
3238 if (!ext4_journal_current_handle())
3239 return __ext4_normal_writepage(page, wbc);
3240
3241 redirty_page_for_writepage(wbc, page);
3242 unlock_page(page);
3243 return 0;
3244}
3245
3246static int __ext4_journalled_writepage(struct page *page,
3247 struct writeback_control *wbc)
3248{
3249 struct address_space *mapping = page->mapping;
3250 struct inode *inode = mapping->host;
3251 struct buffer_head *page_bufs;
3252 handle_t *handle = NULL;
3253 int ret = 0;
3254 int err;
3255
3256 ret = block_prepare_write(page, 0, PAGE_CACHE_SIZE,
3257 noalloc_get_block_write);
3258 if (ret != 0)
3259 goto out_unlock;
3260
3261 page_bufs = page_buffers(page);
3262 walk_page_buffers(handle, page_bufs, 0, PAGE_CACHE_SIZE, NULL,
3263 bget_one);
3264 /* As soon as we unlock the page, it can go away, but we have
3265 * references to buffers so we are safe */
3266 unlock_page(page);
3267
3268 handle = ext4_journal_start(inode, ext4_writepage_trans_blocks(inode));
3269 if (IS_ERR(handle)) {
3270 ret = PTR_ERR(handle);
3271 goto out;
3272 }
3273
3274 ret = walk_page_buffers(handle, page_bufs, 0,
3275 PAGE_CACHE_SIZE, NULL, do_journal_get_write_access);
3276
3277 err = walk_page_buffers(handle, page_bufs, 0,
3278 PAGE_CACHE_SIZE, NULL, write_end_fn);
3279 if (ret == 0)
3280 ret = err;
3281 err = ext4_journal_stop(handle);
3282 if (!ret)
3283 ret = err;
3284
3285 walk_page_buffers(handle, page_bufs, 0,
3286 PAGE_CACHE_SIZE, NULL, bput_one);
3287 EXT4_I(inode)->i_state |= EXT4_STATE_JDATA;
3288 goto out;
3289
3290out_unlock:
3291 unlock_page(page);
3292out:
3293 return ret;
3294}
3295
3296static int ext4_journalled_writepage(struct page *page,
3297 struct writeback_control *wbc)
3298{
3299 struct inode *inode = page->mapping->host;
3300 loff_t size = i_size_read(inode);
3301 loff_t len;
3302
3303 trace_ext4_journalled_writepage(inode, page);
3304 J_ASSERT(PageLocked(page));
3305 if (page->index == size >> PAGE_CACHE_SHIFT)
3306 len = size & ~PAGE_CACHE_MASK;
3307 else
3308 len = PAGE_CACHE_SIZE;
3309
3310 if (page_has_buffers(page)) {
3311 /* if page has buffers it should all be mapped
3312 * and allocated. If there are not buffers attached
3313 * to the page we know the page is dirty but it lost
3314 * buffers. That means that at some moment in time
3315 * after write_begin() / write_end() has been called
3316 * all buffers have been clean and thus they must have been
3317 * written at least once. So they are all mapped and we can
3318 * happily proceed with mapping them and writing the page.
3319 */
3320 BUG_ON(walk_page_buffers(NULL, page_buffers(page), 0, len, NULL,
3321 ext4_bh_unmapped_or_delay));
3322 }
3323
3324 if (ext4_journal_current_handle())
3325 goto no_write;
3326
3327 if (PageChecked(page)) {
3328 /*
3329 * It's mmapped pagecache. Add buffers and journal it. There
3330 * doesn't seem much point in redirtying the page here.
3331 */
3332 ClearPageChecked(page);
3333 return __ext4_journalled_writepage(page, wbc);
3334 } else {
3335 /*
3336 * It may be a page full of checkpoint-mode buffers. We don't
3337 * really know unless we go poke around in the buffer_heads.
3338 * But block_write_full_page will do the right thing.
3339 */
3340 return block_write_full_page(page, noalloc_get_block_write,
3341 wbc);
3342 }
3343no_write:
3344 redirty_page_for_writepage(wbc, page);
3345 unlock_page(page);
3346 return 0;
3347}
3348
3349static int ext4_readpage(struct file *file, struct page *page) 3220static int ext4_readpage(struct file *file, struct page *page)
3350{ 3221{
3351 return mpage_readpage(page, ext4_get_block); 3222 return mpage_readpage(page, ext4_get_block);
@@ -3492,7 +3363,7 @@ static int ext4_journalled_set_page_dirty(struct page *page)
3492static const struct address_space_operations ext4_ordered_aops = { 3363static const struct address_space_operations ext4_ordered_aops = {
3493 .readpage = ext4_readpage, 3364 .readpage = ext4_readpage,
3494 .readpages = ext4_readpages, 3365 .readpages = ext4_readpages,
3495 .writepage = ext4_normal_writepage, 3366 .writepage = ext4_writepage,
3496 .sync_page = block_sync_page, 3367 .sync_page = block_sync_page,
3497 .write_begin = ext4_write_begin, 3368 .write_begin = ext4_write_begin,
3498 .write_end = ext4_ordered_write_end, 3369 .write_end = ext4_ordered_write_end,
@@ -3507,7 +3378,7 @@ static const struct address_space_operations ext4_ordered_aops = {
3507static const struct address_space_operations ext4_writeback_aops = { 3378static const struct address_space_operations ext4_writeback_aops = {
3508 .readpage = ext4_readpage, 3379 .readpage = ext4_readpage,
3509 .readpages = ext4_readpages, 3380 .readpages = ext4_readpages,
3510 .writepage = ext4_normal_writepage, 3381 .writepage = ext4_writepage,
3511 .sync_page = block_sync_page, 3382 .sync_page = block_sync_page,
3512 .write_begin = ext4_write_begin, 3383 .write_begin = ext4_write_begin,
3513 .write_end = ext4_writeback_write_end, 3384 .write_end = ext4_writeback_write_end,
@@ -3522,7 +3393,7 @@ static const struct address_space_operations ext4_writeback_aops = {
3522static const struct address_space_operations ext4_journalled_aops = { 3393static const struct address_space_operations ext4_journalled_aops = {
3523 .readpage = ext4_readpage, 3394 .readpage = ext4_readpage,
3524 .readpages = ext4_readpages, 3395 .readpages = ext4_readpages,
3525 .writepage = ext4_journalled_writepage, 3396 .writepage = ext4_writepage,
3526 .sync_page = block_sync_page, 3397 .sync_page = block_sync_page,
3527 .write_begin = ext4_write_begin, 3398 .write_begin = ext4_write_begin,
3528 .write_end = ext4_journalled_write_end, 3399 .write_end = ext4_journalled_write_end,
@@ -3536,7 +3407,7 @@ static const struct address_space_operations ext4_journalled_aops = {
3536static const struct address_space_operations ext4_da_aops = { 3407static const struct address_space_operations ext4_da_aops = {
3537 .readpage = ext4_readpage, 3408 .readpage = ext4_readpage,
3538 .readpages = ext4_readpages, 3409 .readpages = ext4_readpages,
3539 .writepage = ext4_da_writepage, 3410 .writepage = ext4_writepage,
3540 .writepages = ext4_da_writepages, 3411 .writepages = ext4_da_writepages,
3541 .sync_page = block_sync_page, 3412 .sync_page = block_sync_page,
3542 .write_begin = ext4_da_write_begin, 3413 .write_begin = ext4_da_write_begin,
@@ -3583,7 +3454,8 @@ int ext4_block_truncate_page(handle_t *handle,
3583 struct page *page; 3454 struct page *page;
3584 int err = 0; 3455 int err = 0;
3585 3456
3586 page = grab_cache_page(mapping, from >> PAGE_CACHE_SHIFT); 3457 page = find_or_create_page(mapping, from >> PAGE_CACHE_SHIFT,
3458 mapping_gfp_mask(mapping) & ~__GFP_FS);
3587 if (!page) 3459 if (!page)
3588 return -EINVAL; 3460 return -EINVAL;
3589 3461
diff --git a/fs/ext4/ioctl.c b/fs/ext4/ioctl.c
index bb415408fdb6..7050a9cd04a4 100644
--- a/fs/ext4/ioctl.c
+++ b/fs/ext4/ioctl.c
@@ -12,7 +12,6 @@
12#include <linux/capability.h> 12#include <linux/capability.h>
13#include <linux/time.h> 13#include <linux/time.h>
14#include <linux/compat.h> 14#include <linux/compat.h>
15#include <linux/smp_lock.h>
16#include <linux/mount.h> 15#include <linux/mount.h>
17#include <linux/file.h> 16#include <linux/file.h>
18#include <asm/uaccess.h> 17#include <asm/uaccess.h>
@@ -192,7 +191,7 @@ setversion_out:
192 case EXT4_IOC_GROUP_EXTEND: { 191 case EXT4_IOC_GROUP_EXTEND: {
193 ext4_fsblk_t n_blocks_count; 192 ext4_fsblk_t n_blocks_count;
194 struct super_block *sb = inode->i_sb; 193 struct super_block *sb = inode->i_sb;
195 int err, err2; 194 int err, err2=0;
196 195
197 if (!capable(CAP_SYS_RESOURCE)) 196 if (!capable(CAP_SYS_RESOURCE))
198 return -EPERM; 197 return -EPERM;
@@ -205,9 +204,11 @@ setversion_out:
205 return err; 204 return err;
206 205
207 err = ext4_group_extend(sb, EXT4_SB(sb)->s_es, n_blocks_count); 206 err = ext4_group_extend(sb, EXT4_SB(sb)->s_es, n_blocks_count);
208 jbd2_journal_lock_updates(EXT4_SB(sb)->s_journal); 207 if (EXT4_SB(sb)->s_journal) {
209 err2 = jbd2_journal_flush(EXT4_SB(sb)->s_journal); 208 jbd2_journal_lock_updates(EXT4_SB(sb)->s_journal);
210 jbd2_journal_unlock_updates(EXT4_SB(sb)->s_journal); 209 err2 = jbd2_journal_flush(EXT4_SB(sb)->s_journal);
210 jbd2_journal_unlock_updates(EXT4_SB(sb)->s_journal);
211 }
211 if (err == 0) 212 if (err == 0)
212 err = err2; 213 err = err2;
213 mnt_drop_write(filp->f_path.mnt); 214 mnt_drop_write(filp->f_path.mnt);
@@ -252,7 +253,7 @@ setversion_out:
252 case EXT4_IOC_GROUP_ADD: { 253 case EXT4_IOC_GROUP_ADD: {
253 struct ext4_new_group_data input; 254 struct ext4_new_group_data input;
254 struct super_block *sb = inode->i_sb; 255 struct super_block *sb = inode->i_sb;
255 int err, err2; 256 int err, err2=0;
256 257
257 if (!capable(CAP_SYS_RESOURCE)) 258 if (!capable(CAP_SYS_RESOURCE))
258 return -EPERM; 259 return -EPERM;
@@ -266,9 +267,11 @@ setversion_out:
266 return err; 267 return err;
267 268
268 err = ext4_group_add(sb, &input); 269 err = ext4_group_add(sb, &input);
269 jbd2_journal_lock_updates(EXT4_SB(sb)->s_journal); 270 if (EXT4_SB(sb)->s_journal) {
270 err2 = jbd2_journal_flush(EXT4_SB(sb)->s_journal); 271 jbd2_journal_lock_updates(EXT4_SB(sb)->s_journal);
271 jbd2_journal_unlock_updates(EXT4_SB(sb)->s_journal); 272 err2 = jbd2_journal_flush(EXT4_SB(sb)->s_journal);
273 jbd2_journal_unlock_updates(EXT4_SB(sb)->s_journal);
274 }
272 if (err == 0) 275 if (err == 0)
273 err = err2; 276 err = err2;
274 mnt_drop_write(filp->f_path.mnt); 277 mnt_drop_write(filp->f_path.mnt);
diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c
index 519a0a686d94..cd258463e2a9 100644
--- a/fs/ext4/mballoc.c
+++ b/fs/ext4/mballoc.c
@@ -657,7 +657,8 @@ static void ext4_mb_mark_free_simple(struct super_block *sb,
657 } 657 }
658} 658}
659 659
660static void ext4_mb_generate_buddy(struct super_block *sb, 660static noinline_for_stack
661void ext4_mb_generate_buddy(struct super_block *sb,
661 void *buddy, void *bitmap, ext4_group_t group) 662 void *buddy, void *bitmap, ext4_group_t group)
662{ 663{
663 struct ext4_group_info *grp = ext4_get_group_info(sb, group); 664 struct ext4_group_info *grp = ext4_get_group_info(sb, group);
@@ -1480,7 +1481,8 @@ static void ext4_mb_measure_extent(struct ext4_allocation_context *ac,
1480 ext4_mb_check_limits(ac, e4b, 0); 1481 ext4_mb_check_limits(ac, e4b, 0);
1481} 1482}
1482 1483
1483static int ext4_mb_try_best_found(struct ext4_allocation_context *ac, 1484static noinline_for_stack
1485int ext4_mb_try_best_found(struct ext4_allocation_context *ac,
1484 struct ext4_buddy *e4b) 1486 struct ext4_buddy *e4b)
1485{ 1487{
1486 struct ext4_free_extent ex = ac->ac_b_ex; 1488 struct ext4_free_extent ex = ac->ac_b_ex;
@@ -1507,7 +1509,8 @@ static int ext4_mb_try_best_found(struct ext4_allocation_context *ac,
1507 return 0; 1509 return 0;
1508} 1510}
1509 1511
1510static int ext4_mb_find_by_goal(struct ext4_allocation_context *ac, 1512static noinline_for_stack
1513int ext4_mb_find_by_goal(struct ext4_allocation_context *ac,
1511 struct ext4_buddy *e4b) 1514 struct ext4_buddy *e4b)
1512{ 1515{
1513 ext4_group_t group = ac->ac_g_ex.fe_group; 1516 ext4_group_t group = ac->ac_g_ex.fe_group;
@@ -1566,7 +1569,8 @@ static int ext4_mb_find_by_goal(struct ext4_allocation_context *ac,
1566 * The routine scans buddy structures (not bitmap!) from given order 1569 * The routine scans buddy structures (not bitmap!) from given order
1567 * to max order and tries to find big enough chunk to satisfy the req 1570 * to max order and tries to find big enough chunk to satisfy the req
1568 */ 1571 */
1569static void ext4_mb_simple_scan_group(struct ext4_allocation_context *ac, 1572static noinline_for_stack
1573void ext4_mb_simple_scan_group(struct ext4_allocation_context *ac,
1570 struct ext4_buddy *e4b) 1574 struct ext4_buddy *e4b)
1571{ 1575{
1572 struct super_block *sb = ac->ac_sb; 1576 struct super_block *sb = ac->ac_sb;
@@ -1609,7 +1613,8 @@ static void ext4_mb_simple_scan_group(struct ext4_allocation_context *ac,
1609 * In order to optimize scanning, caller must pass number of 1613 * In order to optimize scanning, caller must pass number of
1610 * free blocks in the group, so the routine can know upper limit. 1614 * free blocks in the group, so the routine can know upper limit.
1611 */ 1615 */
1612static void ext4_mb_complex_scan_group(struct ext4_allocation_context *ac, 1616static noinline_for_stack
1617void ext4_mb_complex_scan_group(struct ext4_allocation_context *ac,
1613 struct ext4_buddy *e4b) 1618 struct ext4_buddy *e4b)
1614{ 1619{
1615 struct super_block *sb = ac->ac_sb; 1620 struct super_block *sb = ac->ac_sb;
@@ -1668,7 +1673,8 @@ static void ext4_mb_complex_scan_group(struct ext4_allocation_context *ac,
1668 * we try to find stripe-aligned chunks for stripe-size requests 1673 * we try to find stripe-aligned chunks for stripe-size requests
1669 * XXX should do so at least for multiples of stripe size as well 1674 * XXX should do so at least for multiples of stripe size as well
1670 */ 1675 */
1671static void ext4_mb_scan_aligned(struct ext4_allocation_context *ac, 1676static noinline_for_stack
1677void ext4_mb_scan_aligned(struct ext4_allocation_context *ac,
1672 struct ext4_buddy *e4b) 1678 struct ext4_buddy *e4b)
1673{ 1679{
1674 struct super_block *sb = ac->ac_sb; 1680 struct super_block *sb = ac->ac_sb;
@@ -1831,7 +1837,8 @@ void ext4_mb_put_buddy_cache_lock(struct super_block *sb,
1831 1837
1832} 1838}
1833 1839
1834static int ext4_mb_init_group(struct super_block *sb, ext4_group_t group) 1840static noinline_for_stack
1841int ext4_mb_init_group(struct super_block *sb, ext4_group_t group)
1835{ 1842{
1836 1843
1837 int ret; 1844 int ret;
@@ -2902,7 +2909,11 @@ int __init init_ext4_mballoc(void)
2902 2909
2903void exit_ext4_mballoc(void) 2910void exit_ext4_mballoc(void)
2904{ 2911{
2905 /* XXX: synchronize_rcu(); */ 2912 /*
2913 * Wait for completion of call_rcu()'s on ext4_pspace_cachep
2914 * before destroying the slab cache.
2915 */
2916 rcu_barrier();
2906 kmem_cache_destroy(ext4_pspace_cachep); 2917 kmem_cache_destroy(ext4_pspace_cachep);
2907 kmem_cache_destroy(ext4_ac_cachep); 2918 kmem_cache_destroy(ext4_ac_cachep);
2908 kmem_cache_destroy(ext4_free_ext_cachep); 2919 kmem_cache_destroy(ext4_free_ext_cachep);
@@ -3457,7 +3468,8 @@ static void ext4_mb_generate_from_freelist(struct super_block *sb, void *bitmap,
3457 * used in in-core bitmap. buddy must be generated from this bitmap 3468 * used in in-core bitmap. buddy must be generated from this bitmap
3458 * Need to be called with ext4 group lock held 3469 * Need to be called with ext4 group lock held
3459 */ 3470 */
3460static void ext4_mb_generate_from_pa(struct super_block *sb, void *bitmap, 3471static noinline_for_stack
3472void ext4_mb_generate_from_pa(struct super_block *sb, void *bitmap,
3461 ext4_group_t group) 3473 ext4_group_t group)
3462{ 3474{
3463 struct ext4_group_info *grp = ext4_get_group_info(sb, group); 3475 struct ext4_group_info *grp = ext4_get_group_info(sb, group);
@@ -4215,14 +4227,9 @@ ext4_mb_initialize_context(struct ext4_allocation_context *ac,
4215 ext4_get_group_no_and_offset(sb, goal, &group, &block); 4227 ext4_get_group_no_and_offset(sb, goal, &group, &block);
4216 4228
4217 /* set up allocation goals */ 4229 /* set up allocation goals */
4230 memset(ac, 0, sizeof(struct ext4_allocation_context));
4218 ac->ac_b_ex.fe_logical = ar->logical; 4231 ac->ac_b_ex.fe_logical = ar->logical;
4219 ac->ac_b_ex.fe_group = 0;
4220 ac->ac_b_ex.fe_start = 0;
4221 ac->ac_b_ex.fe_len = 0;
4222 ac->ac_status = AC_STATUS_CONTINUE; 4232 ac->ac_status = AC_STATUS_CONTINUE;
4223 ac->ac_groups_scanned = 0;
4224 ac->ac_ex_scanned = 0;
4225 ac->ac_found = 0;
4226 ac->ac_sb = sb; 4233 ac->ac_sb = sb;
4227 ac->ac_inode = ar->inode; 4234 ac->ac_inode = ar->inode;
4228 ac->ac_o_ex.fe_logical = ar->logical; 4235 ac->ac_o_ex.fe_logical = ar->logical;
@@ -4233,15 +4240,7 @@ ext4_mb_initialize_context(struct ext4_allocation_context *ac,
4233 ac->ac_g_ex.fe_group = group; 4240 ac->ac_g_ex.fe_group = group;
4234 ac->ac_g_ex.fe_start = block; 4241 ac->ac_g_ex.fe_start = block;
4235 ac->ac_g_ex.fe_len = len; 4242 ac->ac_g_ex.fe_len = len;
4236 ac->ac_f_ex.fe_len = 0;
4237 ac->ac_flags = ar->flags; 4243 ac->ac_flags = ar->flags;
4238 ac->ac_2order = 0;
4239 ac->ac_criteria = 0;
4240 ac->ac_pa = NULL;
4241 ac->ac_bitmap_page = NULL;
4242 ac->ac_buddy_page = NULL;
4243 ac->alloc_semp = NULL;
4244 ac->ac_lg = NULL;
4245 4244
4246 /* we have to define context: we'll we work with a file or 4245 /* we have to define context: we'll we work with a file or
4247 * locality group. this is a policy, actually */ 4246 * locality group. this is a policy, actually */
@@ -4509,10 +4508,7 @@ ext4_fsblk_t ext4_mb_new_blocks(handle_t *handle,
4509 } 4508 }
4510 4509
4511 ac = kmem_cache_alloc(ext4_ac_cachep, GFP_NOFS); 4510 ac = kmem_cache_alloc(ext4_ac_cachep, GFP_NOFS);
4512 if (ac) { 4511 if (!ac) {
4513 ac->ac_sb = sb;
4514 ac->ac_inode = ar->inode;
4515 } else {
4516 ar->len = 0; 4512 ar->len = 0;
4517 *errp = -ENOMEM; 4513 *errp = -ENOMEM;
4518 goto out1; 4514 goto out1;
diff --git a/fs/fat/dir.c b/fs/fat/dir.c
index 38ff75a0fe22..530b4ca01510 100644
--- a/fs/fat/dir.c
+++ b/fs/fat/dir.c
@@ -16,7 +16,6 @@
16#include <linux/module.h> 16#include <linux/module.h>
17#include <linux/slab.h> 17#include <linux/slab.h>
18#include <linux/time.h> 18#include <linux/time.h>
19#include <linux/smp_lock.h>
20#include <linux/buffer_head.h> 19#include <linux/buffer_head.h>
21#include <linux/compat.h> 20#include <linux/compat.h>
22#include <asm/uaccess.h> 21#include <asm/uaccess.h>
diff --git a/fs/fat/file.c b/fs/fat/file.c
index b28ea646ff60..f042b965c95c 100644
--- a/fs/fat/file.c
+++ b/fs/fat/file.c
@@ -134,7 +134,7 @@ static int fat_file_release(struct inode *inode, struct file *filp)
134 if ((filp->f_mode & FMODE_WRITE) && 134 if ((filp->f_mode & FMODE_WRITE) &&
135 MSDOS_SB(inode->i_sb)->options.flush) { 135 MSDOS_SB(inode->i_sb)->options.flush) {
136 fat_flush_inodes(inode->i_sb, inode, NULL); 136 fat_flush_inodes(inode->i_sb, inode, NULL);
137 congestion_wait(WRITE, HZ/10); 137 congestion_wait(BLK_RW_ASYNC, HZ/10);
138 } 138 }
139 return 0; 139 return 0;
140} 140}
diff --git a/fs/fat/namei_msdos.c b/fs/fat/namei_msdos.c
index 82f88733b681..bbc94ae4fd77 100644
--- a/fs/fat/namei_msdos.c
+++ b/fs/fat/namei_msdos.c
@@ -9,7 +9,6 @@
9#include <linux/module.h> 9#include <linux/module.h>
10#include <linux/time.h> 10#include <linux/time.h>
11#include <linux/buffer_head.h> 11#include <linux/buffer_head.h>
12#include <linux/smp_lock.h>
13#include "fat.h" 12#include "fat.h"
14 13
15/* Characters that are undesirable in an MS-DOS file name */ 14/* Characters that are undesirable in an MS-DOS file name */
diff --git a/fs/fat/namei_vfat.c b/fs/fat/namei_vfat.c
index 73471b7ecc8c..cb6e83557112 100644
--- a/fs/fat/namei_vfat.c
+++ b/fs/fat/namei_vfat.c
@@ -19,7 +19,6 @@
19#include <linux/jiffies.h> 19#include <linux/jiffies.h>
20#include <linux/ctype.h> 20#include <linux/ctype.h>
21#include <linux/slab.h> 21#include <linux/slab.h>
22#include <linux/smp_lock.h>
23#include <linux/buffer_head.h> 22#include <linux/buffer_head.h>
24#include <linux/namei.h> 23#include <linux/namei.h>
25#include "fat.h" 24#include "fat.h"
diff --git a/fs/fcntl.c b/fs/fcntl.c
index a040b764f8e3..ae413086db97 100644
--- a/fs/fcntl.c
+++ b/fs/fcntl.c
@@ -19,7 +19,6 @@
19#include <linux/signal.h> 19#include <linux/signal.h>
20#include <linux/rcupdate.h> 20#include <linux/rcupdate.h>
21#include <linux/pid_namespace.h> 21#include <linux/pid_namespace.h>
22#include <linux/smp_lock.h>
23 22
24#include <asm/poll.h> 23#include <asm/poll.h>
25#include <asm/siginfo.h> 24#include <asm/siginfo.h>
diff --git a/fs/freevxfs/vxfs_super.c b/fs/freevxfs/vxfs_super.c
index cdbd1654e4cd..1e8af939b3e4 100644
--- a/fs/freevxfs/vxfs_super.c
+++ b/fs/freevxfs/vxfs_super.c
@@ -38,6 +38,7 @@
38#include <linux/buffer_head.h> 38#include <linux/buffer_head.h>
39#include <linux/kernel.h> 39#include <linux/kernel.h>
40#include <linux/slab.h> 40#include <linux/slab.h>
41#include <linux/smp_lock.h>
41#include <linux/stat.h> 42#include <linux/stat.h>
42#include <linux/vfs.h> 43#include <linux/vfs.h>
43#include <linux/mount.h> 44#include <linux/mount.h>
diff --git a/fs/fuse/dev.c b/fs/fuse/dev.c
index 8fed2ed12f38..6484eb75acd6 100644
--- a/fs/fuse/dev.c
+++ b/fs/fuse/dev.c
@@ -286,8 +286,8 @@ __releases(&fc->lock)
286 } 286 }
287 if (fc->num_background == FUSE_CONGESTION_THRESHOLD && 287 if (fc->num_background == FUSE_CONGESTION_THRESHOLD &&
288 fc->connected && fc->bdi_initialized) { 288 fc->connected && fc->bdi_initialized) {
289 clear_bdi_congested(&fc->bdi, READ); 289 clear_bdi_congested(&fc->bdi, BLK_RW_SYNC);
290 clear_bdi_congested(&fc->bdi, WRITE); 290 clear_bdi_congested(&fc->bdi, BLK_RW_ASYNC);
291 } 291 }
292 fc->num_background--; 292 fc->num_background--;
293 fc->active_background--; 293 fc->active_background--;
@@ -414,8 +414,8 @@ static void fuse_request_send_nowait_locked(struct fuse_conn *fc,
414 fc->blocked = 1; 414 fc->blocked = 1;
415 if (fc->num_background == FUSE_CONGESTION_THRESHOLD && 415 if (fc->num_background == FUSE_CONGESTION_THRESHOLD &&
416 fc->bdi_initialized) { 416 fc->bdi_initialized) {
417 set_bdi_congested(&fc->bdi, READ); 417 set_bdi_congested(&fc->bdi, BLK_RW_SYNC);
418 set_bdi_congested(&fc->bdi, WRITE); 418 set_bdi_congested(&fc->bdi, BLK_RW_ASYNC);
419 } 419 }
420 list_add_tail(&req->list, &fc->bg_queue); 420 list_add_tail(&req->list, &fc->bg_queue);
421 flush_bg_queue(fc); 421 flush_bg_queue(fc);
@@ -849,6 +849,81 @@ err:
849 return err; 849 return err;
850} 850}
851 851
852static int fuse_notify_inval_inode(struct fuse_conn *fc, unsigned int size,
853 struct fuse_copy_state *cs)
854{
855 struct fuse_notify_inval_inode_out outarg;
856 int err = -EINVAL;
857
858 if (size != sizeof(outarg))
859 goto err;
860
861 err = fuse_copy_one(cs, &outarg, sizeof(outarg));
862 if (err)
863 goto err;
864 fuse_copy_finish(cs);
865
866 down_read(&fc->killsb);
867 err = -ENOENT;
868 if (!fc->sb)
869 goto err_unlock;
870
871 err = fuse_reverse_inval_inode(fc->sb, outarg.ino,
872 outarg.off, outarg.len);
873
874err_unlock:
875 up_read(&fc->killsb);
876 return err;
877
878err:
879 fuse_copy_finish(cs);
880 return err;
881}
882
883static int fuse_notify_inval_entry(struct fuse_conn *fc, unsigned int size,
884 struct fuse_copy_state *cs)
885{
886 struct fuse_notify_inval_entry_out outarg;
887 int err = -EINVAL;
888 char buf[FUSE_NAME_MAX+1];
889 struct qstr name;
890
891 if (size < sizeof(outarg))
892 goto err;
893
894 err = fuse_copy_one(cs, &outarg, sizeof(outarg));
895 if (err)
896 goto err;
897
898 err = -ENAMETOOLONG;
899 if (outarg.namelen > FUSE_NAME_MAX)
900 goto err;
901
902 name.name = buf;
903 name.len = outarg.namelen;
904 err = fuse_copy_one(cs, buf, outarg.namelen + 1);
905 if (err)
906 goto err;
907 fuse_copy_finish(cs);
908 buf[outarg.namelen] = 0;
909 name.hash = full_name_hash(name.name, name.len);
910
911 down_read(&fc->killsb);
912 err = -ENOENT;
913 if (!fc->sb)
914 goto err_unlock;
915
916 err = fuse_reverse_inval_entry(fc->sb, outarg.parent, &name);
917
918err_unlock:
919 up_read(&fc->killsb);
920 return err;
921
922err:
923 fuse_copy_finish(cs);
924 return err;
925}
926
852static int fuse_notify(struct fuse_conn *fc, enum fuse_notify_code code, 927static int fuse_notify(struct fuse_conn *fc, enum fuse_notify_code code,
853 unsigned int size, struct fuse_copy_state *cs) 928 unsigned int size, struct fuse_copy_state *cs)
854{ 929{
@@ -856,6 +931,12 @@ static int fuse_notify(struct fuse_conn *fc, enum fuse_notify_code code,
856 case FUSE_NOTIFY_POLL: 931 case FUSE_NOTIFY_POLL:
857 return fuse_notify_poll(fc, size, cs); 932 return fuse_notify_poll(fc, size, cs);
858 933
934 case FUSE_NOTIFY_INVAL_INODE:
935 return fuse_notify_inval_inode(fc, size, cs);
936
937 case FUSE_NOTIFY_INVAL_ENTRY:
938 return fuse_notify_inval_entry(fc, size, cs);
939
859 default: 940 default:
860 fuse_copy_finish(cs); 941 fuse_copy_finish(cs);
861 return -EINVAL; 942 return -EINVAL;
@@ -910,7 +991,7 @@ static ssize_t fuse_dev_write(struct kiocb *iocb, const struct iovec *iov,
910 unsigned long nr_segs, loff_t pos) 991 unsigned long nr_segs, loff_t pos)
911{ 992{
912 int err; 993 int err;
913 unsigned nbytes = iov_length(iov, nr_segs); 994 size_t nbytes = iov_length(iov, nr_segs);
914 struct fuse_req *req; 995 struct fuse_req *req;
915 struct fuse_out_header oh; 996 struct fuse_out_header oh;
916 struct fuse_copy_state cs; 997 struct fuse_copy_state cs;
diff --git a/fs/fuse/dir.c b/fs/fuse/dir.c
index b3089a083d30..e703654e7f40 100644
--- a/fs/fuse/dir.c
+++ b/fs/fuse/dir.c
@@ -375,7 +375,7 @@ static int fuse_create_open(struct inode *dir, struct dentry *entry, int mode,
375 struct fuse_conn *fc = get_fuse_conn(dir); 375 struct fuse_conn *fc = get_fuse_conn(dir);
376 struct fuse_req *req; 376 struct fuse_req *req;
377 struct fuse_req *forget_req; 377 struct fuse_req *forget_req;
378 struct fuse_open_in inarg; 378 struct fuse_create_in inarg;
379 struct fuse_open_out outopen; 379 struct fuse_open_out outopen;
380 struct fuse_entry_out outentry; 380 struct fuse_entry_out outentry;
381 struct fuse_file *ff; 381 struct fuse_file *ff;
@@ -399,15 +399,20 @@ static int fuse_create_open(struct inode *dir, struct dentry *entry, int mode,
399 if (!ff) 399 if (!ff)
400 goto out_put_request; 400 goto out_put_request;
401 401
402 if (!fc->dont_mask)
403 mode &= ~current_umask();
404
402 flags &= ~O_NOCTTY; 405 flags &= ~O_NOCTTY;
403 memset(&inarg, 0, sizeof(inarg)); 406 memset(&inarg, 0, sizeof(inarg));
404 memset(&outentry, 0, sizeof(outentry)); 407 memset(&outentry, 0, sizeof(outentry));
405 inarg.flags = flags; 408 inarg.flags = flags;
406 inarg.mode = mode; 409 inarg.mode = mode;
410 inarg.umask = current_umask();
407 req->in.h.opcode = FUSE_CREATE; 411 req->in.h.opcode = FUSE_CREATE;
408 req->in.h.nodeid = get_node_id(dir); 412 req->in.h.nodeid = get_node_id(dir);
409 req->in.numargs = 2; 413 req->in.numargs = 2;
410 req->in.args[0].size = sizeof(inarg); 414 req->in.args[0].size = fc->minor < 12 ? sizeof(struct fuse_open_in) :
415 sizeof(inarg);
411 req->in.args[0].value = &inarg; 416 req->in.args[0].value = &inarg;
412 req->in.args[1].size = entry->d_name.len + 1; 417 req->in.args[1].size = entry->d_name.len + 1;
413 req->in.args[1].value = entry->d_name.name; 418 req->in.args[1].value = entry->d_name.name;
@@ -546,12 +551,17 @@ static int fuse_mknod(struct inode *dir, struct dentry *entry, int mode,
546 if (IS_ERR(req)) 551 if (IS_ERR(req))
547 return PTR_ERR(req); 552 return PTR_ERR(req);
548 553
554 if (!fc->dont_mask)
555 mode &= ~current_umask();
556
549 memset(&inarg, 0, sizeof(inarg)); 557 memset(&inarg, 0, sizeof(inarg));
550 inarg.mode = mode; 558 inarg.mode = mode;
551 inarg.rdev = new_encode_dev(rdev); 559 inarg.rdev = new_encode_dev(rdev);
560 inarg.umask = current_umask();
552 req->in.h.opcode = FUSE_MKNOD; 561 req->in.h.opcode = FUSE_MKNOD;
553 req->in.numargs = 2; 562 req->in.numargs = 2;
554 req->in.args[0].size = sizeof(inarg); 563 req->in.args[0].size = fc->minor < 12 ? FUSE_COMPAT_MKNOD_IN_SIZE :
564 sizeof(inarg);
555 req->in.args[0].value = &inarg; 565 req->in.args[0].value = &inarg;
556 req->in.args[1].size = entry->d_name.len + 1; 566 req->in.args[1].size = entry->d_name.len + 1;
557 req->in.args[1].value = entry->d_name.name; 567 req->in.args[1].value = entry->d_name.name;
@@ -578,8 +588,12 @@ static int fuse_mkdir(struct inode *dir, struct dentry *entry, int mode)
578 if (IS_ERR(req)) 588 if (IS_ERR(req))
579 return PTR_ERR(req); 589 return PTR_ERR(req);
580 590
591 if (!fc->dont_mask)
592 mode &= ~current_umask();
593
581 memset(&inarg, 0, sizeof(inarg)); 594 memset(&inarg, 0, sizeof(inarg));
582 inarg.mode = mode; 595 inarg.mode = mode;
596 inarg.umask = current_umask();
583 req->in.h.opcode = FUSE_MKDIR; 597 req->in.h.opcode = FUSE_MKDIR;
584 req->in.numargs = 2; 598 req->in.numargs = 2;
585 req->in.args[0].size = sizeof(inarg); 599 req->in.args[0].size = sizeof(inarg);
@@ -845,6 +859,43 @@ int fuse_update_attributes(struct inode *inode, struct kstat *stat,
845 return err; 859 return err;
846} 860}
847 861
862int fuse_reverse_inval_entry(struct super_block *sb, u64 parent_nodeid,
863 struct qstr *name)
864{
865 int err = -ENOTDIR;
866 struct inode *parent;
867 struct dentry *dir;
868 struct dentry *entry;
869
870 parent = ilookup5(sb, parent_nodeid, fuse_inode_eq, &parent_nodeid);
871 if (!parent)
872 return -ENOENT;
873
874 mutex_lock(&parent->i_mutex);
875 if (!S_ISDIR(parent->i_mode))
876 goto unlock;
877
878 err = -ENOENT;
879 dir = d_find_alias(parent);
880 if (!dir)
881 goto unlock;
882
883 entry = d_lookup(dir, name);
884 dput(dir);
885 if (!entry)
886 goto unlock;
887
888 fuse_invalidate_attr(parent);
889 fuse_invalidate_entry(entry);
890 dput(entry);
891 err = 0;
892
893 unlock:
894 mutex_unlock(&parent->i_mutex);
895 iput(parent);
896 return err;
897}
898
848/* 899/*
849 * Calling into a user-controlled filesystem gives the filesystem 900 * Calling into a user-controlled filesystem gives the filesystem
850 * daemon ptrace-like capabilities over the requester process. This 901 * daemon ptrace-like capabilities over the requester process. This
diff --git a/fs/fuse/file.c b/fs/fuse/file.c
index fce6ce694fde..cbc464043b6f 100644
--- a/fs/fuse/file.c
+++ b/fs/fuse/file.c
@@ -1922,7 +1922,7 @@ unsigned fuse_file_poll(struct file *file, poll_table *wait)
1922 1922
1923 req = fuse_get_req(fc); 1923 req = fuse_get_req(fc);
1924 if (IS_ERR(req)) 1924 if (IS_ERR(req))
1925 return PTR_ERR(req); 1925 return POLLERR;
1926 1926
1927 req->in.h.opcode = FUSE_POLL; 1927 req->in.h.opcode = FUSE_POLL;
1928 req->in.h.nodeid = ff->nodeid; 1928 req->in.h.nodeid = ff->nodeid;
diff --git a/fs/fuse/fuse_i.h b/fs/fuse/fuse_i.h
index aaf2f9ff970e..52b641fc0faf 100644
--- a/fs/fuse/fuse_i.h
+++ b/fs/fuse/fuse_i.h
@@ -446,6 +446,9 @@ struct fuse_conn {
446 /** Do multi-page cached writes */ 446 /** Do multi-page cached writes */
447 unsigned big_writes:1; 447 unsigned big_writes:1;
448 448
449 /** Don't apply umask to creation modes */
450 unsigned dont_mask:1;
451
449 /** The number of requests waiting for completion */ 452 /** The number of requests waiting for completion */
450 atomic_t num_waiting; 453 atomic_t num_waiting;
451 454
@@ -481,6 +484,12 @@ struct fuse_conn {
481 484
482 /** Called on final put */ 485 /** Called on final put */
483 void (*release)(struct fuse_conn *); 486 void (*release)(struct fuse_conn *);
487
488 /** Super block for this connection. */
489 struct super_block *sb;
490
491 /** Read/write semaphore to hold when accessing sb. */
492 struct rw_semaphore killsb;
484}; 493};
485 494
486static inline struct fuse_conn *get_fuse_conn_super(struct super_block *sb) 495static inline struct fuse_conn *get_fuse_conn_super(struct super_block *sb)
@@ -509,6 +518,11 @@ extern const struct file_operations fuse_dev_operations;
509extern const struct dentry_operations fuse_dentry_operations; 518extern const struct dentry_operations fuse_dentry_operations;
510 519
511/** 520/**
521 * Inode to nodeid comparison.
522 */
523int fuse_inode_eq(struct inode *inode, void *_nodeidp);
524
525/**
512 * Get a filled in inode 526 * Get a filled in inode
513 */ 527 */
514struct inode *fuse_iget(struct super_block *sb, u64 nodeid, 528struct inode *fuse_iget(struct super_block *sb, u64 nodeid,
@@ -708,6 +722,19 @@ void fuse_release_nowrite(struct inode *inode);
708 722
709u64 fuse_get_attr_version(struct fuse_conn *fc); 723u64 fuse_get_attr_version(struct fuse_conn *fc);
710 724
725/**
726 * File-system tells the kernel to invalidate cache for the given node id.
727 */
728int fuse_reverse_inval_inode(struct super_block *sb, u64 nodeid,
729 loff_t offset, loff_t len);
730
731/**
732 * File-system tells the kernel to invalidate parent attributes and
733 * the dentry matching parent/name.
734 */
735int fuse_reverse_inval_entry(struct super_block *sb, u64 parent_nodeid,
736 struct qstr *name);
737
711int fuse_do_open(struct fuse_conn *fc, u64 nodeid, struct file *file, 738int fuse_do_open(struct fuse_conn *fc, u64 nodeid, struct file *file,
712 bool isdir); 739 bool isdir);
713ssize_t fuse_direct_io(struct file *file, const char __user *buf, 740ssize_t fuse_direct_io(struct file *file, const char __user *buf,
diff --git a/fs/fuse/inode.c b/fs/fuse/inode.c
index d8673ccf90b7..f91ccc4a189d 100644
--- a/fs/fuse/inode.c
+++ b/fs/fuse/inode.c
@@ -206,7 +206,7 @@ static void fuse_init_inode(struct inode *inode, struct fuse_attr *attr)
206 BUG(); 206 BUG();
207} 207}
208 208
209static int fuse_inode_eq(struct inode *inode, void *_nodeidp) 209int fuse_inode_eq(struct inode *inode, void *_nodeidp)
210{ 210{
211 u64 nodeid = *(u64 *) _nodeidp; 211 u64 nodeid = *(u64 *) _nodeidp;
212 if (get_node_id(inode) == nodeid) 212 if (get_node_id(inode) == nodeid)
@@ -257,6 +257,31 @@ struct inode *fuse_iget(struct super_block *sb, u64 nodeid,
257 return inode; 257 return inode;
258} 258}
259 259
260int fuse_reverse_inval_inode(struct super_block *sb, u64 nodeid,
261 loff_t offset, loff_t len)
262{
263 struct inode *inode;
264 pgoff_t pg_start;
265 pgoff_t pg_end;
266
267 inode = ilookup5(sb, nodeid, fuse_inode_eq, &nodeid);
268 if (!inode)
269 return -ENOENT;
270
271 fuse_invalidate_attr(inode);
272 if (offset >= 0) {
273 pg_start = offset >> PAGE_CACHE_SHIFT;
274 if (len <= 0)
275 pg_end = -1;
276 else
277 pg_end = (offset + len - 1) >> PAGE_CACHE_SHIFT;
278 invalidate_inode_pages2_range(inode->i_mapping,
279 pg_start, pg_end);
280 }
281 iput(inode);
282 return 0;
283}
284
260static void fuse_umount_begin(struct super_block *sb) 285static void fuse_umount_begin(struct super_block *sb)
261{ 286{
262 fuse_abort_conn(get_fuse_conn_super(sb)); 287 fuse_abort_conn(get_fuse_conn_super(sb));
@@ -480,6 +505,7 @@ void fuse_conn_init(struct fuse_conn *fc)
480 memset(fc, 0, sizeof(*fc)); 505 memset(fc, 0, sizeof(*fc));
481 spin_lock_init(&fc->lock); 506 spin_lock_init(&fc->lock);
482 mutex_init(&fc->inst_mutex); 507 mutex_init(&fc->inst_mutex);
508 init_rwsem(&fc->killsb);
483 atomic_set(&fc->count, 1); 509 atomic_set(&fc->count, 1);
484 init_waitqueue_head(&fc->waitq); 510 init_waitqueue_head(&fc->waitq);
485 init_waitqueue_head(&fc->blocked_waitq); 511 init_waitqueue_head(&fc->blocked_waitq);
@@ -725,6 +751,8 @@ static void process_init_reply(struct fuse_conn *fc, struct fuse_req *req)
725 } 751 }
726 if (arg->flags & FUSE_BIG_WRITES) 752 if (arg->flags & FUSE_BIG_WRITES)
727 fc->big_writes = 1; 753 fc->big_writes = 1;
754 if (arg->flags & FUSE_DONT_MASK)
755 fc->dont_mask = 1;
728 } else { 756 } else {
729 ra_pages = fc->max_read / PAGE_CACHE_SIZE; 757 ra_pages = fc->max_read / PAGE_CACHE_SIZE;
730 fc->no_lock = 1; 758 fc->no_lock = 1;
@@ -748,7 +776,7 @@ static void fuse_send_init(struct fuse_conn *fc, struct fuse_req *req)
748 arg->minor = FUSE_KERNEL_MINOR_VERSION; 776 arg->minor = FUSE_KERNEL_MINOR_VERSION;
749 arg->max_readahead = fc->bdi.ra_pages * PAGE_CACHE_SIZE; 777 arg->max_readahead = fc->bdi.ra_pages * PAGE_CACHE_SIZE;
750 arg->flags |= FUSE_ASYNC_READ | FUSE_POSIX_LOCKS | FUSE_ATOMIC_O_TRUNC | 778 arg->flags |= FUSE_ASYNC_READ | FUSE_POSIX_LOCKS | FUSE_ATOMIC_O_TRUNC |
751 FUSE_EXPORT_SUPPORT | FUSE_BIG_WRITES; 779 FUSE_EXPORT_SUPPORT | FUSE_BIG_WRITES | FUSE_DONT_MASK;
752 req->in.h.opcode = FUSE_INIT; 780 req->in.h.opcode = FUSE_INIT;
753 req->in.numargs = 1; 781 req->in.numargs = 1;
754 req->in.args[0].size = sizeof(*arg); 782 req->in.args[0].size = sizeof(*arg);
@@ -860,10 +888,16 @@ static int fuse_fill_super(struct super_block *sb, void *data, int silent)
860 fuse_conn_init(fc); 888 fuse_conn_init(fc);
861 889
862 fc->dev = sb->s_dev; 890 fc->dev = sb->s_dev;
891 fc->sb = sb;
863 err = fuse_bdi_init(fc, sb); 892 err = fuse_bdi_init(fc, sb);
864 if (err) 893 if (err)
865 goto err_put_conn; 894 goto err_put_conn;
866 895
896 /* Handle umasking inside the fuse code */
897 if (sb->s_flags & MS_POSIXACL)
898 fc->dont_mask = 1;
899 sb->s_flags |= MS_POSIXACL;
900
867 fc->release = fuse_free_conn; 901 fc->release = fuse_free_conn;
868 fc->flags = d.flags; 902 fc->flags = d.flags;
869 fc->user_id = d.user_id; 903 fc->user_id = d.user_id;
@@ -941,12 +975,25 @@ static int fuse_get_sb(struct file_system_type *fs_type,
941 return get_sb_nodev(fs_type, flags, raw_data, fuse_fill_super, mnt); 975 return get_sb_nodev(fs_type, flags, raw_data, fuse_fill_super, mnt);
942} 976}
943 977
978static void fuse_kill_sb_anon(struct super_block *sb)
979{
980 struct fuse_conn *fc = get_fuse_conn_super(sb);
981
982 if (fc) {
983 down_write(&fc->killsb);
984 fc->sb = NULL;
985 up_write(&fc->killsb);
986 }
987
988 kill_anon_super(sb);
989}
990
944static struct file_system_type fuse_fs_type = { 991static struct file_system_type fuse_fs_type = {
945 .owner = THIS_MODULE, 992 .owner = THIS_MODULE,
946 .name = "fuse", 993 .name = "fuse",
947 .fs_flags = FS_HAS_SUBTYPE, 994 .fs_flags = FS_HAS_SUBTYPE,
948 .get_sb = fuse_get_sb, 995 .get_sb = fuse_get_sb,
949 .kill_sb = kill_anon_super, 996 .kill_sb = fuse_kill_sb_anon,
950}; 997};
951 998
952#ifdef CONFIG_BLOCK 999#ifdef CONFIG_BLOCK
@@ -958,11 +1005,24 @@ static int fuse_get_sb_blk(struct file_system_type *fs_type,
958 mnt); 1005 mnt);
959} 1006}
960 1007
1008static void fuse_kill_sb_blk(struct super_block *sb)
1009{
1010 struct fuse_conn *fc = get_fuse_conn_super(sb);
1011
1012 if (fc) {
1013 down_write(&fc->killsb);
1014 fc->sb = NULL;
1015 up_write(&fc->killsb);
1016 }
1017
1018 kill_block_super(sb);
1019}
1020
961static struct file_system_type fuseblk_fs_type = { 1021static struct file_system_type fuseblk_fs_type = {
962 .owner = THIS_MODULE, 1022 .owner = THIS_MODULE,
963 .name = "fuseblk", 1023 .name = "fuseblk",
964 .get_sb = fuse_get_sb_blk, 1024 .get_sb = fuse_get_sb_blk,
965 .kill_sb = kill_block_super, 1025 .kill_sb = fuse_kill_sb_blk,
966 .fs_flags = FS_REQUIRES_DEV | FS_HAS_SUBTYPE, 1026 .fs_flags = FS_REQUIRES_DEV | FS_HAS_SUBTYPE,
967}; 1027};
968 1028
diff --git a/fs/gfs2/aops.c b/fs/gfs2/aops.c
index 03ebb439ace0..7ebae9a4ecc0 100644
--- a/fs/gfs2/aops.c
+++ b/fs/gfs2/aops.c
@@ -624,6 +624,7 @@ static int gfs2_write_begin(struct file *file, struct address_space *mapping,
624{ 624{
625 struct gfs2_inode *ip = GFS2_I(mapping->host); 625 struct gfs2_inode *ip = GFS2_I(mapping->host);
626 struct gfs2_sbd *sdp = GFS2_SB(mapping->host); 626 struct gfs2_sbd *sdp = GFS2_SB(mapping->host);
627 struct gfs2_inode *m_ip = GFS2_I(sdp->sd_statfs_inode);
627 unsigned int data_blocks = 0, ind_blocks = 0, rblocks; 628 unsigned int data_blocks = 0, ind_blocks = 0, rblocks;
628 int alloc_required; 629 int alloc_required;
629 int error = 0; 630 int error = 0;
@@ -637,6 +638,14 @@ static int gfs2_write_begin(struct file *file, struct address_space *mapping,
637 error = gfs2_glock_nq(&ip->i_gh); 638 error = gfs2_glock_nq(&ip->i_gh);
638 if (unlikely(error)) 639 if (unlikely(error))
639 goto out_uninit; 640 goto out_uninit;
641 if (&ip->i_inode == sdp->sd_rindex) {
642 error = gfs2_glock_nq_init(m_ip->i_gl, LM_ST_EXCLUSIVE,
643 GL_NOCACHE, &m_ip->i_gh);
644 if (unlikely(error)) {
645 gfs2_glock_dq(&ip->i_gh);
646 goto out_uninit;
647 }
648 }
640 649
641 error = gfs2_write_alloc_required(ip, pos, len, &alloc_required); 650 error = gfs2_write_alloc_required(ip, pos, len, &alloc_required);
642 if (error) 651 if (error)
@@ -667,6 +676,8 @@ static int gfs2_write_begin(struct file *file, struct address_space *mapping,
667 rblocks += data_blocks ? data_blocks : 1; 676 rblocks += data_blocks ? data_blocks : 1;
668 if (ind_blocks || data_blocks) 677 if (ind_blocks || data_blocks)
669 rblocks += RES_STATFS + RES_QUOTA; 678 rblocks += RES_STATFS + RES_QUOTA;
679 if (&ip->i_inode == sdp->sd_rindex)
680 rblocks += 2 * RES_STATFS;
670 681
671 error = gfs2_trans_begin(sdp, rblocks, 682 error = gfs2_trans_begin(sdp, rblocks,
672 PAGE_CACHE_SIZE/sdp->sd_sb.sb_bsize); 683 PAGE_CACHE_SIZE/sdp->sd_sb.sb_bsize);
@@ -712,6 +723,10 @@ out_alloc_put:
712 gfs2_alloc_put(ip); 723 gfs2_alloc_put(ip);
713 } 724 }
714out_unlock: 725out_unlock:
726 if (&ip->i_inode == sdp->sd_rindex) {
727 gfs2_glock_dq(&m_ip->i_gh);
728 gfs2_holder_uninit(&m_ip->i_gh);
729 }
715 gfs2_glock_dq(&ip->i_gh); 730 gfs2_glock_dq(&ip->i_gh);
716out_uninit: 731out_uninit:
717 gfs2_holder_uninit(&ip->i_gh); 732 gfs2_holder_uninit(&ip->i_gh);
@@ -725,14 +740,21 @@ out_uninit:
725static void adjust_fs_space(struct inode *inode) 740static void adjust_fs_space(struct inode *inode)
726{ 741{
727 struct gfs2_sbd *sdp = inode->i_sb->s_fs_info; 742 struct gfs2_sbd *sdp = inode->i_sb->s_fs_info;
743 struct gfs2_inode *m_ip = GFS2_I(sdp->sd_statfs_inode);
744 struct gfs2_inode *l_ip = GFS2_I(sdp->sd_sc_inode);
728 struct gfs2_statfs_change_host *m_sc = &sdp->sd_statfs_master; 745 struct gfs2_statfs_change_host *m_sc = &sdp->sd_statfs_master;
729 struct gfs2_statfs_change_host *l_sc = &sdp->sd_statfs_local; 746 struct gfs2_statfs_change_host *l_sc = &sdp->sd_statfs_local;
747 struct buffer_head *m_bh, *l_bh;
730 u64 fs_total, new_free; 748 u64 fs_total, new_free;
731 749
732 /* Total up the file system space, according to the latest rindex. */ 750 /* Total up the file system space, according to the latest rindex. */
733 fs_total = gfs2_ri_total(sdp); 751 fs_total = gfs2_ri_total(sdp);
752 if (gfs2_meta_inode_buffer(m_ip, &m_bh) != 0)
753 return;
734 754
735 spin_lock(&sdp->sd_statfs_spin); 755 spin_lock(&sdp->sd_statfs_spin);
756 gfs2_statfs_change_in(m_sc, m_bh->b_data +
757 sizeof(struct gfs2_dinode));
736 if (fs_total > (m_sc->sc_total + l_sc->sc_total)) 758 if (fs_total > (m_sc->sc_total + l_sc->sc_total))
737 new_free = fs_total - (m_sc->sc_total + l_sc->sc_total); 759 new_free = fs_total - (m_sc->sc_total + l_sc->sc_total);
738 else 760 else
@@ -741,6 +763,13 @@ static void adjust_fs_space(struct inode *inode)
741 fs_warn(sdp, "File system extended by %llu blocks.\n", 763 fs_warn(sdp, "File system extended by %llu blocks.\n",
742 (unsigned long long)new_free); 764 (unsigned long long)new_free);
743 gfs2_statfs_change(sdp, new_free, new_free, 0); 765 gfs2_statfs_change(sdp, new_free, new_free, 0);
766
767 if (gfs2_meta_inode_buffer(l_ip, &l_bh) != 0)
768 goto out;
769 update_statfs(sdp, m_bh, l_bh);
770 brelse(l_bh);
771out:
772 brelse(m_bh);
744} 773}
745 774
746/** 775/**
@@ -763,6 +792,7 @@ static int gfs2_stuffed_write_end(struct inode *inode, struct buffer_head *dibh,
763{ 792{
764 struct gfs2_inode *ip = GFS2_I(inode); 793 struct gfs2_inode *ip = GFS2_I(inode);
765 struct gfs2_sbd *sdp = GFS2_SB(inode); 794 struct gfs2_sbd *sdp = GFS2_SB(inode);
795 struct gfs2_inode *m_ip = GFS2_I(sdp->sd_statfs_inode);
766 u64 to = pos + copied; 796 u64 to = pos + copied;
767 void *kaddr; 797 void *kaddr;
768 unsigned char *buf = dibh->b_data + sizeof(struct gfs2_dinode); 798 unsigned char *buf = dibh->b_data + sizeof(struct gfs2_dinode);
@@ -794,6 +824,10 @@ static int gfs2_stuffed_write_end(struct inode *inode, struct buffer_head *dibh,
794 824
795 brelse(dibh); 825 brelse(dibh);
796 gfs2_trans_end(sdp); 826 gfs2_trans_end(sdp);
827 if (inode == sdp->sd_rindex) {
828 gfs2_glock_dq(&m_ip->i_gh);
829 gfs2_holder_uninit(&m_ip->i_gh);
830 }
797 gfs2_glock_dq(&ip->i_gh); 831 gfs2_glock_dq(&ip->i_gh);
798 gfs2_holder_uninit(&ip->i_gh); 832 gfs2_holder_uninit(&ip->i_gh);
799 return copied; 833 return copied;
@@ -823,6 +857,7 @@ static int gfs2_write_end(struct file *file, struct address_space *mapping,
823 struct inode *inode = page->mapping->host; 857 struct inode *inode = page->mapping->host;
824 struct gfs2_inode *ip = GFS2_I(inode); 858 struct gfs2_inode *ip = GFS2_I(inode);
825 struct gfs2_sbd *sdp = GFS2_SB(inode); 859 struct gfs2_sbd *sdp = GFS2_SB(inode);
860 struct gfs2_inode *m_ip = GFS2_I(sdp->sd_statfs_inode);
826 struct buffer_head *dibh; 861 struct buffer_head *dibh;
827 struct gfs2_alloc *al = ip->i_alloc; 862 struct gfs2_alloc *al = ip->i_alloc;
828 unsigned int from = pos & (PAGE_CACHE_SIZE - 1); 863 unsigned int from = pos & (PAGE_CACHE_SIZE - 1);
@@ -865,6 +900,10 @@ failed:
865 gfs2_quota_unlock(ip); 900 gfs2_quota_unlock(ip);
866 gfs2_alloc_put(ip); 901 gfs2_alloc_put(ip);
867 } 902 }
903 if (inode == sdp->sd_rindex) {
904 gfs2_glock_dq(&m_ip->i_gh);
905 gfs2_holder_uninit(&m_ip->i_gh);
906 }
868 gfs2_glock_dq(&ip->i_gh); 907 gfs2_glock_dq(&ip->i_gh);
869 gfs2_holder_uninit(&ip->i_gh); 908 gfs2_holder_uninit(&ip->i_gh);
870 return ret; 909 return ret;
diff --git a/fs/gfs2/glock.c b/fs/gfs2/glock.c
index 297421c0427a..8b674b1f3a55 100644
--- a/fs/gfs2/glock.c
+++ b/fs/gfs2/glock.c
@@ -63,6 +63,7 @@ static void do_xmote(struct gfs2_glock *gl, struct gfs2_holder *gh, unsigned int
63static DECLARE_RWSEM(gfs2_umount_flush_sem); 63static DECLARE_RWSEM(gfs2_umount_flush_sem);
64static struct dentry *gfs2_root; 64static struct dentry *gfs2_root;
65static struct workqueue_struct *glock_workqueue; 65static struct workqueue_struct *glock_workqueue;
66struct workqueue_struct *gfs2_delete_workqueue;
66static LIST_HEAD(lru_list); 67static LIST_HEAD(lru_list);
67static atomic_t lru_count = ATOMIC_INIT(0); 68static atomic_t lru_count = ATOMIC_INIT(0);
68static DEFINE_SPINLOCK(lru_lock); 69static DEFINE_SPINLOCK(lru_lock);
@@ -167,13 +168,33 @@ static void glock_free(struct gfs2_glock *gl)
167 * 168 *
168 */ 169 */
169 170
170static void gfs2_glock_hold(struct gfs2_glock *gl) 171void gfs2_glock_hold(struct gfs2_glock *gl)
171{ 172{
172 GLOCK_BUG_ON(gl, atomic_read(&gl->gl_ref) == 0); 173 GLOCK_BUG_ON(gl, atomic_read(&gl->gl_ref) == 0);
173 atomic_inc(&gl->gl_ref); 174 atomic_inc(&gl->gl_ref);
174} 175}
175 176
176/** 177/**
178 * demote_ok - Check to see if it's ok to unlock a glock
179 * @gl: the glock
180 *
181 * Returns: 1 if it's ok
182 */
183
184static int demote_ok(const struct gfs2_glock *gl)
185{
186 const struct gfs2_glock_operations *glops = gl->gl_ops;
187
188 if (gl->gl_state == LM_ST_UNLOCKED)
189 return 0;
190 if (!list_empty(&gl->gl_holders))
191 return 0;
192 if (glops->go_demote_ok)
193 return glops->go_demote_ok(gl);
194 return 1;
195}
196
197/**
177 * gfs2_glock_schedule_for_reclaim - Add a glock to the reclaim list 198 * gfs2_glock_schedule_for_reclaim - Add a glock to the reclaim list
178 * @gl: the glock 199 * @gl: the glock
179 * 200 *
@@ -181,8 +202,13 @@ static void gfs2_glock_hold(struct gfs2_glock *gl)
181 202
182static void gfs2_glock_schedule_for_reclaim(struct gfs2_glock *gl) 203static void gfs2_glock_schedule_for_reclaim(struct gfs2_glock *gl)
183{ 204{
205 int may_reclaim;
206 may_reclaim = (demote_ok(gl) &&
207 (atomic_read(&gl->gl_ref) == 1 ||
208 (gl->gl_name.ln_type == LM_TYPE_INODE &&
209 atomic_read(&gl->gl_ref) <= 2)));
184 spin_lock(&lru_lock); 210 spin_lock(&lru_lock);
185 if (list_empty(&gl->gl_lru) && gl->gl_state != LM_ST_UNLOCKED) { 211 if (list_empty(&gl->gl_lru) && may_reclaim) {
186 list_add_tail(&gl->gl_lru, &lru_list); 212 list_add_tail(&gl->gl_lru, &lru_list);
187 atomic_inc(&lru_count); 213 atomic_inc(&lru_count);
188 } 214 }
@@ -190,6 +216,21 @@ static void gfs2_glock_schedule_for_reclaim(struct gfs2_glock *gl)
190} 216}
191 217
192/** 218/**
219 * gfs2_glock_put_nolock() - Decrement reference count on glock
220 * @gl: The glock to put
221 *
222 * This function should only be used if the caller has its own reference
223 * to the glock, in addition to the one it is dropping.
224 */
225
226void gfs2_glock_put_nolock(struct gfs2_glock *gl)
227{
228 if (atomic_dec_and_test(&gl->gl_ref))
229 GLOCK_BUG_ON(gl, 1);
230 gfs2_glock_schedule_for_reclaim(gl);
231}
232
233/**
193 * gfs2_glock_put() - Decrement reference count on glock 234 * gfs2_glock_put() - Decrement reference count on glock
194 * @gl: The glock to put 235 * @gl: The glock to put
195 * 236 *
@@ -214,9 +255,9 @@ int gfs2_glock_put(struct gfs2_glock *gl)
214 rv = 1; 255 rv = 1;
215 goto out; 256 goto out;
216 } 257 }
217 /* 1 for being hashed, 1 for having state != LM_ST_UNLOCKED */ 258 spin_lock(&gl->gl_spin);
218 if (atomic_read(&gl->gl_ref) == 2) 259 gfs2_glock_schedule_for_reclaim(gl);
219 gfs2_glock_schedule_for_reclaim(gl); 260 spin_unlock(&gl->gl_spin);
220 write_unlock(gl_lock_addr(gl->gl_hash)); 261 write_unlock(gl_lock_addr(gl->gl_hash));
221out: 262out:
222 return rv; 263 return rv;
@@ -398,7 +439,7 @@ static void state_change(struct gfs2_glock *gl, unsigned int new_state)
398 if (held2) 439 if (held2)
399 gfs2_glock_hold(gl); 440 gfs2_glock_hold(gl);
400 else 441 else
401 gfs2_glock_put(gl); 442 gfs2_glock_put_nolock(gl);
402 } 443 }
403 444
404 gl->gl_state = new_state; 445 gl->gl_state = new_state;
@@ -633,12 +674,35 @@ out:
633out_sched: 674out_sched:
634 gfs2_glock_hold(gl); 675 gfs2_glock_hold(gl);
635 if (queue_delayed_work(glock_workqueue, &gl->gl_work, 0) == 0) 676 if (queue_delayed_work(glock_workqueue, &gl->gl_work, 0) == 0)
636 gfs2_glock_put(gl); 677 gfs2_glock_put_nolock(gl);
637out_unlock: 678out_unlock:
638 clear_bit(GLF_LOCK, &gl->gl_flags); 679 clear_bit(GLF_LOCK, &gl->gl_flags);
639 goto out; 680 goto out;
640} 681}
641 682
683static void delete_work_func(struct work_struct *work)
684{
685 struct gfs2_glock *gl = container_of(work, struct gfs2_glock, gl_delete);
686 struct gfs2_sbd *sdp = gl->gl_sbd;
687 struct gfs2_inode *ip = NULL;
688 struct inode *inode;
689 u64 no_addr = 0;
690
691 spin_lock(&gl->gl_spin);
692 ip = (struct gfs2_inode *)gl->gl_object;
693 if (ip)
694 no_addr = ip->i_no_addr;
695 spin_unlock(&gl->gl_spin);
696 if (ip) {
697 inode = gfs2_ilookup(sdp->sd_vfs, no_addr);
698 if (inode) {
699 d_prune_aliases(inode);
700 iput(inode);
701 }
702 }
703 gfs2_glock_put(gl);
704}
705
642static void glock_work_func(struct work_struct *work) 706static void glock_work_func(struct work_struct *work)
643{ 707{
644 unsigned long delay = 0; 708 unsigned long delay = 0;
@@ -717,6 +781,7 @@ int gfs2_glock_get(struct gfs2_sbd *sdp, u64 number,
717 gl->gl_sbd = sdp; 781 gl->gl_sbd = sdp;
718 gl->gl_aspace = NULL; 782 gl->gl_aspace = NULL;
719 INIT_DELAYED_WORK(&gl->gl_work, glock_work_func); 783 INIT_DELAYED_WORK(&gl->gl_work, glock_work_func);
784 INIT_WORK(&gl->gl_delete, delete_work_func);
720 785
721 /* If this glock protects actual on-disk data or metadata blocks, 786 /* If this glock protects actual on-disk data or metadata blocks,
722 create a VFS inode to manage the pages/buffers holding them. */ 787 create a VFS inode to manage the pages/buffers holding them. */
@@ -858,6 +923,8 @@ static void handle_callback(struct gfs2_glock *gl, unsigned int state,
858 gl->gl_demote_state != state) { 923 gl->gl_demote_state != state) {
859 gl->gl_demote_state = LM_ST_UNLOCKED; 924 gl->gl_demote_state = LM_ST_UNLOCKED;
860 } 925 }
926 if (gl->gl_ops->go_callback)
927 gl->gl_ops->go_callback(gl);
861 trace_gfs2_demote_rq(gl); 928 trace_gfs2_demote_rq(gl);
862} 929}
863 930
@@ -1274,33 +1341,12 @@ void gfs2_glock_complete(struct gfs2_glock *gl, int ret)
1274 gfs2_glock_put(gl); 1341 gfs2_glock_put(gl);
1275} 1342}
1276 1343
1277/**
1278 * demote_ok - Check to see if it's ok to unlock a glock
1279 * @gl: the glock
1280 *
1281 * Returns: 1 if it's ok
1282 */
1283
1284static int demote_ok(const struct gfs2_glock *gl)
1285{
1286 const struct gfs2_glock_operations *glops = gl->gl_ops;
1287
1288 if (gl->gl_state == LM_ST_UNLOCKED)
1289 return 0;
1290 if (!list_empty(&gl->gl_holders))
1291 return 0;
1292 if (glops->go_demote_ok)
1293 return glops->go_demote_ok(gl);
1294 return 1;
1295}
1296
1297 1344
1298static int gfs2_shrink_glock_memory(int nr, gfp_t gfp_mask) 1345static int gfs2_shrink_glock_memory(int nr, gfp_t gfp_mask)
1299{ 1346{
1300 struct gfs2_glock *gl; 1347 struct gfs2_glock *gl;
1301 int may_demote; 1348 int may_demote;
1302 int nr_skipped = 0; 1349 int nr_skipped = 0;
1303 int got_ref = 0;
1304 LIST_HEAD(skipped); 1350 LIST_HEAD(skipped);
1305 1351
1306 if (nr == 0) 1352 if (nr == 0)
@@ -1315,37 +1361,29 @@ static int gfs2_shrink_glock_memory(int nr, gfp_t gfp_mask)
1315 list_del_init(&gl->gl_lru); 1361 list_del_init(&gl->gl_lru);
1316 atomic_dec(&lru_count); 1362 atomic_dec(&lru_count);
1317 1363
1364 /* Check if glock is about to be freed */
1365 if (atomic_read(&gl->gl_ref) == 0)
1366 continue;
1367
1318 /* Test for being demotable */ 1368 /* Test for being demotable */
1319 if (!test_and_set_bit(GLF_LOCK, &gl->gl_flags)) { 1369 if (!test_and_set_bit(GLF_LOCK, &gl->gl_flags)) {
1320 gfs2_glock_hold(gl); 1370 gfs2_glock_hold(gl);
1321 got_ref = 1;
1322 spin_unlock(&lru_lock); 1371 spin_unlock(&lru_lock);
1323 spin_lock(&gl->gl_spin); 1372 spin_lock(&gl->gl_spin);
1324 may_demote = demote_ok(gl); 1373 may_demote = demote_ok(gl);
1325 spin_unlock(&gl->gl_spin);
1326 clear_bit(GLF_LOCK, &gl->gl_flags);
1327 if (may_demote) { 1374 if (may_demote) {
1328 handle_callback(gl, LM_ST_UNLOCKED, 0); 1375 handle_callback(gl, LM_ST_UNLOCKED, 0);
1329 nr--; 1376 nr--;
1330 if (queue_delayed_work(glock_workqueue, &gl->gl_work, 0) == 0)
1331 gfs2_glock_put(gl);
1332 got_ref = 0;
1333 } 1377 }
1378 if (queue_delayed_work(glock_workqueue, &gl->gl_work, 0) == 0)
1379 gfs2_glock_put_nolock(gl);
1380 spin_unlock(&gl->gl_spin);
1381 clear_bit(GLF_LOCK, &gl->gl_flags);
1334 spin_lock(&lru_lock); 1382 spin_lock(&lru_lock);
1335 if (may_demote) 1383 continue;
1336 continue;
1337 }
1338 if (list_empty(&gl->gl_lru) &&
1339 (atomic_read(&gl->gl_ref) <= (2 + got_ref))) {
1340 nr_skipped++;
1341 list_add(&gl->gl_lru, &skipped);
1342 }
1343 if (got_ref) {
1344 spin_unlock(&lru_lock);
1345 gfs2_glock_put(gl);
1346 spin_lock(&lru_lock);
1347 got_ref = 0;
1348 } 1384 }
1385 nr_skipped++;
1386 list_add(&gl->gl_lru, &skipped);
1349 } 1387 }
1350 list_splice(&skipped, &lru_list); 1388 list_splice(&skipped, &lru_list);
1351 atomic_add(nr_skipped, &lru_count); 1389 atomic_add(nr_skipped, &lru_count);
@@ -1727,6 +1765,11 @@ int __init gfs2_glock_init(void)
1727 glock_workqueue = create_workqueue("glock_workqueue"); 1765 glock_workqueue = create_workqueue("glock_workqueue");
1728 if (IS_ERR(glock_workqueue)) 1766 if (IS_ERR(glock_workqueue))
1729 return PTR_ERR(glock_workqueue); 1767 return PTR_ERR(glock_workqueue);
1768 gfs2_delete_workqueue = create_workqueue("delete_workqueue");
1769 if (IS_ERR(gfs2_delete_workqueue)) {
1770 destroy_workqueue(glock_workqueue);
1771 return PTR_ERR(gfs2_delete_workqueue);
1772 }
1730 1773
1731 register_shrinker(&glock_shrinker); 1774 register_shrinker(&glock_shrinker);
1732 1775
@@ -1737,6 +1780,7 @@ void gfs2_glock_exit(void)
1737{ 1780{
1738 unregister_shrinker(&glock_shrinker); 1781 unregister_shrinker(&glock_shrinker);
1739 destroy_workqueue(glock_workqueue); 1782 destroy_workqueue(glock_workqueue);
1783 destroy_workqueue(gfs2_delete_workqueue);
1740} 1784}
1741 1785
1742static int gfs2_glock_iter_next(struct gfs2_glock_iter *gi) 1786static int gfs2_glock_iter_next(struct gfs2_glock_iter *gi)
diff --git a/fs/gfs2/glock.h b/fs/gfs2/glock.h
index a602a28f6f08..c609894ec0d0 100644
--- a/fs/gfs2/glock.h
+++ b/fs/gfs2/glock.h
@@ -143,6 +143,7 @@ struct lm_lockops {
143 143
144#define GLR_TRYFAILED 13 144#define GLR_TRYFAILED 13
145 145
146extern struct workqueue_struct *gfs2_delete_workqueue;
146static inline struct gfs2_holder *gfs2_glock_is_locked_by_me(struct gfs2_glock *gl) 147static inline struct gfs2_holder *gfs2_glock_is_locked_by_me(struct gfs2_glock *gl)
147{ 148{
148 struct gfs2_holder *gh; 149 struct gfs2_holder *gh;
@@ -191,6 +192,8 @@ static inline int gfs2_glock_is_blocking(struct gfs2_glock *gl)
191int gfs2_glock_get(struct gfs2_sbd *sdp, 192int gfs2_glock_get(struct gfs2_sbd *sdp,
192 u64 number, const struct gfs2_glock_operations *glops, 193 u64 number, const struct gfs2_glock_operations *glops,
193 int create, struct gfs2_glock **glp); 194 int create, struct gfs2_glock **glp);
195void gfs2_glock_hold(struct gfs2_glock *gl);
196void gfs2_glock_put_nolock(struct gfs2_glock *gl);
194int gfs2_glock_put(struct gfs2_glock *gl); 197int gfs2_glock_put(struct gfs2_glock *gl);
195void gfs2_holder_init(struct gfs2_glock *gl, unsigned int state, unsigned flags, 198void gfs2_holder_init(struct gfs2_glock *gl, unsigned int state, unsigned flags,
196 struct gfs2_holder *gh); 199 struct gfs2_holder *gh);
diff --git a/fs/gfs2/glops.c b/fs/gfs2/glops.c
index d5e4ab155ca0..6985eef06c39 100644
--- a/fs/gfs2/glops.c
+++ b/fs/gfs2/glops.c
@@ -323,6 +323,7 @@ static void trans_go_sync(struct gfs2_glock *gl)
323 323
324 if (gl->gl_state != LM_ST_UNLOCKED && 324 if (gl->gl_state != LM_ST_UNLOCKED &&
325 test_bit(SDF_JOURNAL_LIVE, &sdp->sd_flags)) { 325 test_bit(SDF_JOURNAL_LIVE, &sdp->sd_flags)) {
326 flush_workqueue(gfs2_delete_workqueue);
326 gfs2_meta_syncfs(sdp); 327 gfs2_meta_syncfs(sdp);
327 gfs2_log_shutdown(sdp); 328 gfs2_log_shutdown(sdp);
328 } 329 }
@@ -372,6 +373,25 @@ static int trans_go_demote_ok(const struct gfs2_glock *gl)
372 return 0; 373 return 0;
373} 374}
374 375
376/**
377 * iopen_go_callback - schedule the dcache entry for the inode to be deleted
378 * @gl: the glock
379 *
380 * gl_spin lock is held while calling this
381 */
382static void iopen_go_callback(struct gfs2_glock *gl)
383{
384 struct gfs2_inode *ip = (struct gfs2_inode *)gl->gl_object;
385
386 if (gl->gl_demote_state == LM_ST_UNLOCKED &&
387 gl->gl_state == LM_ST_SHARED &&
388 ip && test_bit(GIF_USER, &ip->i_flags)) {
389 gfs2_glock_hold(gl);
390 if (queue_work(gfs2_delete_workqueue, &gl->gl_delete) == 0)
391 gfs2_glock_put_nolock(gl);
392 }
393}
394
375const struct gfs2_glock_operations gfs2_meta_glops = { 395const struct gfs2_glock_operations gfs2_meta_glops = {
376 .go_type = LM_TYPE_META, 396 .go_type = LM_TYPE_META,
377}; 397};
@@ -406,6 +426,7 @@ const struct gfs2_glock_operations gfs2_trans_glops = {
406 426
407const struct gfs2_glock_operations gfs2_iopen_glops = { 427const struct gfs2_glock_operations gfs2_iopen_glops = {
408 .go_type = LM_TYPE_IOPEN, 428 .go_type = LM_TYPE_IOPEN,
429 .go_callback = iopen_go_callback,
409}; 430};
410 431
411const struct gfs2_glock_operations gfs2_flock_glops = { 432const struct gfs2_glock_operations gfs2_flock_glops = {
diff --git a/fs/gfs2/incore.h b/fs/gfs2/incore.h
index 225347fbff3c..61801ada36f0 100644
--- a/fs/gfs2/incore.h
+++ b/fs/gfs2/incore.h
@@ -159,6 +159,7 @@ struct gfs2_glock_operations {
159 int (*go_lock) (struct gfs2_holder *gh); 159 int (*go_lock) (struct gfs2_holder *gh);
160 void (*go_unlock) (struct gfs2_holder *gh); 160 void (*go_unlock) (struct gfs2_holder *gh);
161 int (*go_dump)(struct seq_file *seq, const struct gfs2_glock *gl); 161 int (*go_dump)(struct seq_file *seq, const struct gfs2_glock *gl);
162 void (*go_callback) (struct gfs2_glock *gl);
162 const int go_type; 163 const int go_type;
163 const unsigned long go_min_hold_time; 164 const unsigned long go_min_hold_time;
164}; 165};
@@ -228,6 +229,7 @@ struct gfs2_glock {
228 struct list_head gl_ail_list; 229 struct list_head gl_ail_list;
229 atomic_t gl_ail_count; 230 atomic_t gl_ail_count;
230 struct delayed_work gl_work; 231 struct delayed_work gl_work;
232 struct work_struct gl_delete;
231}; 233};
232 234
233#define GFS2_MIN_LVB_SIZE 32 /* Min size of LVB that gfs2 supports */ 235#define GFS2_MIN_LVB_SIZE 32 /* Min size of LVB that gfs2 supports */
diff --git a/fs/gfs2/rgrp.c b/fs/gfs2/rgrp.c
index daa4ae341a29..fba795798d3a 100644
--- a/fs/gfs2/rgrp.c
+++ b/fs/gfs2/rgrp.c
@@ -285,27 +285,19 @@ void gfs2_rgrp_verify(struct gfs2_rgrpd *rgd)
285 } 285 }
286 286
287 tmp = rgd->rd_data - rgd->rd_free - rgd->rd_dinodes; 287 tmp = rgd->rd_data - rgd->rd_free - rgd->rd_dinodes;
288 if (count[1] + count[2] != tmp) { 288 if (count[1] != tmp) {
289 if (gfs2_consist_rgrpd(rgd)) 289 if (gfs2_consist_rgrpd(rgd))
290 fs_err(sdp, "used data mismatch: %u != %u\n", 290 fs_err(sdp, "used data mismatch: %u != %u\n",
291 count[1], tmp); 291 count[1], tmp);
292 return; 292 return;
293 } 293 }
294 294
295 if (count[3] != rgd->rd_dinodes) { 295 if (count[2] + count[3] != rgd->rd_dinodes) {
296 if (gfs2_consist_rgrpd(rgd)) 296 if (gfs2_consist_rgrpd(rgd))
297 fs_err(sdp, "used metadata mismatch: %u != %u\n", 297 fs_err(sdp, "used metadata mismatch: %u != %u\n",
298 count[3], rgd->rd_dinodes); 298 count[2] + count[3], rgd->rd_dinodes);
299 return; 299 return;
300 } 300 }
301
302 if (count[2] > count[3]) {
303 if (gfs2_consist_rgrpd(rgd))
304 fs_err(sdp, "unlinked inodes > inodes: %u\n",
305 count[2]);
306 return;
307 }
308
309} 301}
310 302
311static inline int rgrp_contains_block(struct gfs2_rgrpd *rgd, u64 block) 303static inline int rgrp_contains_block(struct gfs2_rgrpd *rgd, u64 block)
@@ -961,7 +953,8 @@ static int try_rgrp_fit(struct gfs2_rgrpd *rgd, struct gfs2_alloc *al)
961 * Returns: The inode, if one has been found 953 * Returns: The inode, if one has been found
962 */ 954 */
963 955
964static struct inode *try_rgrp_unlink(struct gfs2_rgrpd *rgd, u64 *last_unlinked) 956static struct inode *try_rgrp_unlink(struct gfs2_rgrpd *rgd, u64 *last_unlinked,
957 u64 skip)
965{ 958{
966 struct inode *inode; 959 struct inode *inode;
967 u32 goal = 0, block; 960 u32 goal = 0, block;
@@ -985,6 +978,8 @@ static struct inode *try_rgrp_unlink(struct gfs2_rgrpd *rgd, u64 *last_unlinked)
985 goal++; 978 goal++;
986 if (*last_unlinked != NO_BLOCK && no_addr <= *last_unlinked) 979 if (*last_unlinked != NO_BLOCK && no_addr <= *last_unlinked)
987 continue; 980 continue;
981 if (no_addr == skip)
982 continue;
988 *last_unlinked = no_addr; 983 *last_unlinked = no_addr;
989 inode = gfs2_inode_lookup(rgd->rd_sbd->sd_vfs, DT_UNKNOWN, 984 inode = gfs2_inode_lookup(rgd->rd_sbd->sd_vfs, DT_UNKNOWN,
990 no_addr, -1, 1); 985 no_addr, -1, 1);
@@ -1104,7 +1099,7 @@ static struct inode *get_local_rgrp(struct gfs2_inode *ip, u64 *last_unlinked)
1104 if (try_rgrp_fit(rgd, al)) 1099 if (try_rgrp_fit(rgd, al))
1105 goto out; 1100 goto out;
1106 if (rgd->rd_flags & GFS2_RDF_CHECK) 1101 if (rgd->rd_flags & GFS2_RDF_CHECK)
1107 inode = try_rgrp_unlink(rgd, last_unlinked); 1102 inode = try_rgrp_unlink(rgd, last_unlinked, ip->i_no_addr);
1108 if (!rg_locked) 1103 if (!rg_locked)
1109 gfs2_glock_dq_uninit(&al->al_rgd_gh); 1104 gfs2_glock_dq_uninit(&al->al_rgd_gh);
1110 if (inode) 1105 if (inode)
@@ -1138,7 +1133,7 @@ static struct inode *get_local_rgrp(struct gfs2_inode *ip, u64 *last_unlinked)
1138 if (try_rgrp_fit(rgd, al)) 1133 if (try_rgrp_fit(rgd, al))
1139 goto out; 1134 goto out;
1140 if (rgd->rd_flags & GFS2_RDF_CHECK) 1135 if (rgd->rd_flags & GFS2_RDF_CHECK)
1141 inode = try_rgrp_unlink(rgd, last_unlinked); 1136 inode = try_rgrp_unlink(rgd, last_unlinked, ip->i_no_addr);
1142 if (!rg_locked) 1137 if (!rg_locked)
1143 gfs2_glock_dq_uninit(&al->al_rgd_gh); 1138 gfs2_glock_dq_uninit(&al->al_rgd_gh);
1144 if (inode) 1139 if (inode)
diff --git a/fs/gfs2/super.c b/fs/gfs2/super.c
index 0a6801336470..f522bb017973 100644
--- a/fs/gfs2/super.c
+++ b/fs/gfs2/super.c
@@ -353,7 +353,7 @@ fail:
353 return error; 353 return error;
354} 354}
355 355
356static void gfs2_statfs_change_in(struct gfs2_statfs_change_host *sc, const void *buf) 356void gfs2_statfs_change_in(struct gfs2_statfs_change_host *sc, const void *buf)
357{ 357{
358 const struct gfs2_statfs_change *str = buf; 358 const struct gfs2_statfs_change *str = buf;
359 359
@@ -441,6 +441,29 @@ void gfs2_statfs_change(struct gfs2_sbd *sdp, s64 total, s64 free,
441 brelse(l_bh); 441 brelse(l_bh);
442} 442}
443 443
444void update_statfs(struct gfs2_sbd *sdp, struct buffer_head *m_bh,
445 struct buffer_head *l_bh)
446{
447 struct gfs2_inode *m_ip = GFS2_I(sdp->sd_statfs_inode);
448 struct gfs2_inode *l_ip = GFS2_I(sdp->sd_sc_inode);
449 struct gfs2_statfs_change_host *m_sc = &sdp->sd_statfs_master;
450 struct gfs2_statfs_change_host *l_sc = &sdp->sd_statfs_local;
451
452 gfs2_trans_add_bh(l_ip->i_gl, l_bh, 1);
453
454 spin_lock(&sdp->sd_statfs_spin);
455 m_sc->sc_total += l_sc->sc_total;
456 m_sc->sc_free += l_sc->sc_free;
457 m_sc->sc_dinodes += l_sc->sc_dinodes;
458 memset(l_sc, 0, sizeof(struct gfs2_statfs_change));
459 memset(l_bh->b_data + sizeof(struct gfs2_dinode),
460 0, sizeof(struct gfs2_statfs_change));
461 spin_unlock(&sdp->sd_statfs_spin);
462
463 gfs2_trans_add_bh(m_ip->i_gl, m_bh, 1);
464 gfs2_statfs_change_out(m_sc, m_bh->b_data + sizeof(struct gfs2_dinode));
465}
466
444int gfs2_statfs_sync(struct gfs2_sbd *sdp) 467int gfs2_statfs_sync(struct gfs2_sbd *sdp)
445{ 468{
446 struct gfs2_inode *m_ip = GFS2_I(sdp->sd_statfs_inode); 469 struct gfs2_inode *m_ip = GFS2_I(sdp->sd_statfs_inode);
@@ -477,19 +500,7 @@ int gfs2_statfs_sync(struct gfs2_sbd *sdp)
477 if (error) 500 if (error)
478 goto out_bh2; 501 goto out_bh2;
479 502
480 gfs2_trans_add_bh(l_ip->i_gl, l_bh, 1); 503 update_statfs(sdp, m_bh, l_bh);
481
482 spin_lock(&sdp->sd_statfs_spin);
483 m_sc->sc_total += l_sc->sc_total;
484 m_sc->sc_free += l_sc->sc_free;
485 m_sc->sc_dinodes += l_sc->sc_dinodes;
486 memset(l_sc, 0, sizeof(struct gfs2_statfs_change));
487 memset(l_bh->b_data + sizeof(struct gfs2_dinode),
488 0, sizeof(struct gfs2_statfs_change));
489 spin_unlock(&sdp->sd_statfs_spin);
490
491 gfs2_trans_add_bh(m_ip->i_gl, m_bh, 1);
492 gfs2_statfs_change_out(m_sc, m_bh->b_data + sizeof(struct gfs2_dinode));
493 504
494 gfs2_trans_end(sdp); 505 gfs2_trans_end(sdp);
495 506
@@ -680,6 +691,7 @@ static int gfs2_make_fs_ro(struct gfs2_sbd *sdp)
680 struct gfs2_holder t_gh; 691 struct gfs2_holder t_gh;
681 int error; 692 int error;
682 693
694 flush_workqueue(gfs2_delete_workqueue);
683 gfs2_quota_sync(sdp); 695 gfs2_quota_sync(sdp);
684 gfs2_statfs_sync(sdp); 696 gfs2_statfs_sync(sdp);
685 697
diff --git a/fs/gfs2/super.h b/fs/gfs2/super.h
index b56413e3e40d..22e0417ed996 100644
--- a/fs/gfs2/super.h
+++ b/fs/gfs2/super.h
@@ -40,6 +40,10 @@ extern int gfs2_make_fs_rw(struct gfs2_sbd *sdp);
40extern int gfs2_statfs_init(struct gfs2_sbd *sdp); 40extern int gfs2_statfs_init(struct gfs2_sbd *sdp);
41extern void gfs2_statfs_change(struct gfs2_sbd *sdp, s64 total, s64 free, 41extern void gfs2_statfs_change(struct gfs2_sbd *sdp, s64 total, s64 free,
42 s64 dinodes); 42 s64 dinodes);
43extern void gfs2_statfs_change_in(struct gfs2_statfs_change_host *sc,
44 const void *buf);
45extern void update_statfs(struct gfs2_sbd *sdp, struct buffer_head *m_bh,
46 struct buffer_head *l_bh);
43extern int gfs2_statfs_sync(struct gfs2_sbd *sdp); 47extern int gfs2_statfs_sync(struct gfs2_sbd *sdp);
44 48
45extern int gfs2_freeze_fs(struct gfs2_sbd *sdp); 49extern int gfs2_freeze_fs(struct gfs2_sbd *sdp);
diff --git a/fs/gfs2/trace_gfs2.h b/fs/gfs2/trace_gfs2.h
index 98d6ef1c1dc0..148d55c14171 100644
--- a/fs/gfs2/trace_gfs2.h
+++ b/fs/gfs2/trace_gfs2.h
@@ -1,12 +1,11 @@
1#undef TRACE_SYSTEM
2#define TRACE_SYSTEM gfs2
3
1#if !defined(_TRACE_GFS2_H) || defined(TRACE_HEADER_MULTI_READ) 4#if !defined(_TRACE_GFS2_H) || defined(TRACE_HEADER_MULTI_READ)
2#define _TRACE_GFS2_H 5#define _TRACE_GFS2_H
3 6
4#include <linux/tracepoint.h> 7#include <linux/tracepoint.h>
5 8
6#undef TRACE_SYSTEM
7#define TRACE_SYSTEM gfs2
8#define TRACE_INCLUDE_FILE trace_gfs2
9
10#include <linux/fs.h> 9#include <linux/fs.h>
11#include <linux/buffer_head.h> 10#include <linux/buffer_head.h>
12#include <linux/dlmconstants.h> 11#include <linux/dlmconstants.h>
@@ -403,5 +402,6 @@ TRACE_EVENT(gfs2_block_alloc,
403/* This part must be outside protection */ 402/* This part must be outside protection */
404#undef TRACE_INCLUDE_PATH 403#undef TRACE_INCLUDE_PATH
405#define TRACE_INCLUDE_PATH . 404#define TRACE_INCLUDE_PATH .
405#define TRACE_INCLUDE_FILE trace_gfs2
406#include <trace/define_trace.h> 406#include <trace/define_trace.h>
407 407
diff --git a/fs/hfs/super.c b/fs/hfs/super.c
index 6f833dc8e910..f7fcbe49da72 100644
--- a/fs/hfs/super.c
+++ b/fs/hfs/super.c
@@ -19,6 +19,7 @@
19#include <linux/nls.h> 19#include <linux/nls.h>
20#include <linux/parser.h> 20#include <linux/parser.h>
21#include <linux/seq_file.h> 21#include <linux/seq_file.h>
22#include <linux/smp_lock.h>
22#include <linux/vfs.h> 23#include <linux/vfs.h>
23 24
24#include "hfs_fs.h" 25#include "hfs_fs.h"
diff --git a/fs/hfsplus/super.c b/fs/hfsplus/super.c
index 9fc3af0c0dab..c0759fe0855b 100644
--- a/fs/hfsplus/super.c
+++ b/fs/hfsplus/super.c
@@ -12,6 +12,7 @@
12#include <linux/pagemap.h> 12#include <linux/pagemap.h>
13#include <linux/fs.h> 13#include <linux/fs.h>
14#include <linux/slab.h> 14#include <linux/slab.h>
15#include <linux/smp_lock.h>
15#include <linux/vfs.h> 16#include <linux/vfs.h>
16#include <linux/nls.h> 17#include <linux/nls.h>
17 18
diff --git a/fs/hostfs/hostfs_kern.c b/fs/hostfs/hostfs_kern.c
index fe02ad4740e7..032604e5ef2c 100644
--- a/fs/hostfs/hostfs_kern.c
+++ b/fs/hostfs/hostfs_kern.c
@@ -972,6 +972,7 @@ static int hostfs_fill_sb_common(struct super_block *sb, void *d, int silent)
972 sb->s_blocksize_bits = 10; 972 sb->s_blocksize_bits = 10;
973 sb->s_magic = HOSTFS_SUPER_MAGIC; 973 sb->s_magic = HOSTFS_SUPER_MAGIC;
974 sb->s_op = &hostfs_sbops; 974 sb->s_op = &hostfs_sbops;
975 sb->s_maxbytes = MAX_LFS_FILESIZE;
975 976
976 /* NULL is printed as <NULL> by sprintf: avoid that. */ 977 /* NULL is printed as <NULL> by sprintf: avoid that. */
977 if (req_root == NULL) 978 if (req_root == NULL)
diff --git a/fs/hpfs/dir.c b/fs/hpfs/dir.c
index 6916c41d7017..8865c94f55f6 100644
--- a/fs/hpfs/dir.c
+++ b/fs/hpfs/dir.c
@@ -6,6 +6,7 @@
6 * directory VFS functions 6 * directory VFS functions
7 */ 7 */
8 8
9#include <linux/smp_lock.h>
9#include "hpfs_fn.h" 10#include "hpfs_fn.h"
10 11
11static int hpfs_dir_release(struct inode *inode, struct file *filp) 12static int hpfs_dir_release(struct inode *inode, struct file *filp)
diff --git a/fs/hpfs/file.c b/fs/hpfs/file.c
index 64ab52259204..3efabff00367 100644
--- a/fs/hpfs/file.c
+++ b/fs/hpfs/file.c
@@ -6,6 +6,7 @@
6 * file VFS functions 6 * file VFS functions
7 */ 7 */
8 8
9#include <linux/smp_lock.h>
9#include "hpfs_fn.h" 10#include "hpfs_fn.h"
10 11
11#define BLOCKS(size) (((size) + 511) >> 9) 12#define BLOCKS(size) (((size) + 511) >> 9)
diff --git a/fs/hpfs/hpfs_fn.h b/fs/hpfs/hpfs_fn.h
index c2ea31bae313..701ca54c0867 100644
--- a/fs/hpfs/hpfs_fn.h
+++ b/fs/hpfs/hpfs_fn.h
@@ -13,7 +13,6 @@
13#include <linux/pagemap.h> 13#include <linux/pagemap.h>
14#include <linux/buffer_head.h> 14#include <linux/buffer_head.h>
15#include <linux/slab.h> 15#include <linux/slab.h>
16#include <linux/smp_lock.h>
17 16
18#include "hpfs.h" 17#include "hpfs.h"
19 18
diff --git a/fs/hpfs/inode.c b/fs/hpfs/inode.c
index 39a1bfbea312..fe703ae46bc7 100644
--- a/fs/hpfs/inode.c
+++ b/fs/hpfs/inode.c
@@ -6,6 +6,7 @@
6 * inode VFS functions 6 * inode VFS functions
7 */ 7 */
8 8
9#include <linux/smp_lock.h>
9#include "hpfs_fn.h" 10#include "hpfs_fn.h"
10 11
11void hpfs_init_inode(struct inode *i) 12void hpfs_init_inode(struct inode *i)
diff --git a/fs/hpfs/namei.c b/fs/hpfs/namei.c
index b649232dde97..82b9c4ba9ed0 100644
--- a/fs/hpfs/namei.c
+++ b/fs/hpfs/namei.c
@@ -6,6 +6,7 @@
6 * adding & removing files & directories 6 * adding & removing files & directories
7 */ 7 */
8#include <linux/sched.h> 8#include <linux/sched.h>
9#include <linux/smp_lock.h>
9#include "hpfs_fn.h" 10#include "hpfs_fn.h"
10 11
11static int hpfs_mkdir(struct inode *dir, struct dentry *dentry, int mode) 12static int hpfs_mkdir(struct inode *dir, struct dentry *dentry, int mode)
diff --git a/fs/inode.c b/fs/inode.c
index 901bad1e5f12..ae7b67e48661 100644
--- a/fs/inode.c
+++ b/fs/inode.c
@@ -120,12 +120,11 @@ static void wake_up_inode(struct inode *inode)
120 * These are initializations that need to be done on every inode 120 * These are initializations that need to be done on every inode
121 * allocation as the fields are not initialised by slab allocation. 121 * allocation as the fields are not initialised by slab allocation.
122 */ 122 */
123struct inode *inode_init_always(struct super_block *sb, struct inode *inode) 123int inode_init_always(struct super_block *sb, struct inode *inode)
124{ 124{
125 static const struct address_space_operations empty_aops; 125 static const struct address_space_operations empty_aops;
126 static struct inode_operations empty_iops; 126 static struct inode_operations empty_iops;
127 static const struct file_operations empty_fops; 127 static const struct file_operations empty_fops;
128
129 struct address_space *const mapping = &inode->i_data; 128 struct address_space *const mapping = &inode->i_data;
130 129
131 inode->i_sb = sb; 130 inode->i_sb = sb;
@@ -152,7 +151,7 @@ struct inode *inode_init_always(struct super_block *sb, struct inode *inode)
152 inode->dirtied_when = 0; 151 inode->dirtied_when = 0;
153 152
154 if (security_inode_alloc(inode)) 153 if (security_inode_alloc(inode))
155 goto out_free_inode; 154 goto out;
156 155
157 /* allocate and initialize an i_integrity */ 156 /* allocate and initialize an i_integrity */
158 if (ima_inode_alloc(inode)) 157 if (ima_inode_alloc(inode))
@@ -198,16 +197,12 @@ struct inode *inode_init_always(struct super_block *sb, struct inode *inode)
198 inode->i_fsnotify_mask = 0; 197 inode->i_fsnotify_mask = 0;
199#endif 198#endif
200 199
201 return inode; 200 return 0;
202 201
203out_free_security: 202out_free_security:
204 security_inode_free(inode); 203 security_inode_free(inode);
205out_free_inode: 204out:
206 if (inode->i_sb->s_op->destroy_inode) 205 return -ENOMEM;
207 inode->i_sb->s_op->destroy_inode(inode);
208 else
209 kmem_cache_free(inode_cachep, (inode));
210 return NULL;
211} 206}
212EXPORT_SYMBOL(inode_init_always); 207EXPORT_SYMBOL(inode_init_always);
213 208
@@ -220,12 +215,21 @@ static struct inode *alloc_inode(struct super_block *sb)
220 else 215 else
221 inode = kmem_cache_alloc(inode_cachep, GFP_KERNEL); 216 inode = kmem_cache_alloc(inode_cachep, GFP_KERNEL);
222 217
223 if (inode) 218 if (!inode)
224 return inode_init_always(sb, inode); 219 return NULL;
225 return NULL; 220
221 if (unlikely(inode_init_always(sb, inode))) {
222 if (inode->i_sb->s_op->destroy_inode)
223 inode->i_sb->s_op->destroy_inode(inode);
224 else
225 kmem_cache_free(inode_cachep, inode);
226 return NULL;
227 }
228
229 return inode;
226} 230}
227 231
228void destroy_inode(struct inode *inode) 232void __destroy_inode(struct inode *inode)
229{ 233{
230 BUG_ON(inode_has_buffers(inode)); 234 BUG_ON(inode_has_buffers(inode));
231 ima_inode_free(inode); 235 ima_inode_free(inode);
@@ -237,13 +241,17 @@ void destroy_inode(struct inode *inode)
237 if (inode->i_default_acl && inode->i_default_acl != ACL_NOT_CACHED) 241 if (inode->i_default_acl && inode->i_default_acl != ACL_NOT_CACHED)
238 posix_acl_release(inode->i_default_acl); 242 posix_acl_release(inode->i_default_acl);
239#endif 243#endif
244}
245EXPORT_SYMBOL(__destroy_inode);
246
247void destroy_inode(struct inode *inode)
248{
249 __destroy_inode(inode);
240 if (inode->i_sb->s_op->destroy_inode) 250 if (inode->i_sb->s_op->destroy_inode)
241 inode->i_sb->s_op->destroy_inode(inode); 251 inode->i_sb->s_op->destroy_inode(inode);
242 else 252 else
243 kmem_cache_free(inode_cachep, (inode)); 253 kmem_cache_free(inode_cachep, (inode));
244} 254}
245EXPORT_SYMBOL(destroy_inode);
246
247 255
248/* 256/*
249 * These are initializations that only need to be done 257 * These are initializations that only need to be done
diff --git a/fs/isofs/inode.c b/fs/isofs/inode.c
index 58a7963e168a..85f96bc651c7 100644
--- a/fs/isofs/inode.c
+++ b/fs/isofs/inode.c
@@ -142,6 +142,7 @@ static const struct dentry_operations isofs_dentry_ops[] = {
142 142
143struct iso9660_options{ 143struct iso9660_options{
144 unsigned int rock:1; 144 unsigned int rock:1;
145 unsigned int joliet:1;
145 unsigned int cruft:1; 146 unsigned int cruft:1;
146 unsigned int hide:1; 147 unsigned int hide:1;
147 unsigned int showassoc:1; 148 unsigned int showassoc:1;
@@ -151,7 +152,6 @@ struct iso9660_options{
151 unsigned int gid_set:1; 152 unsigned int gid_set:1;
152 unsigned int utf8:1; 153 unsigned int utf8:1;
153 unsigned char map; 154 unsigned char map;
154 char joliet;
155 unsigned char check; 155 unsigned char check;
156 unsigned int blocksize; 156 unsigned int blocksize;
157 mode_t fmode; 157 mode_t fmode;
@@ -632,7 +632,7 @@ static int isofs_fill_super(struct super_block *s, void *data, int silent)
632 else if (isonum_711(vdp->type) == ISO_VD_SUPPLEMENTARY) { 632 else if (isonum_711(vdp->type) == ISO_VD_SUPPLEMENTARY) {
633 sec = (struct iso_supplementary_descriptor *)vdp; 633 sec = (struct iso_supplementary_descriptor *)vdp;
634 if (sec->escape[0] == 0x25 && sec->escape[1] == 0x2f) { 634 if (sec->escape[0] == 0x25 && sec->escape[1] == 0x2f) {
635 if (opt.joliet == 'y') { 635 if (opt.joliet) {
636 if (sec->escape[2] == 0x40) 636 if (sec->escape[2] == 0x40)
637 joliet_level = 1; 637 joliet_level = 1;
638 else if (sec->escape[2] == 0x43) 638 else if (sec->escape[2] == 0x43)
diff --git a/fs/jbd/journal.c b/fs/jbd/journal.c
index 737f7246a4b5..f96f85092d1c 100644
--- a/fs/jbd/journal.c
+++ b/fs/jbd/journal.c
@@ -287,6 +287,7 @@ int journal_write_metadata_buffer(transaction_t *transaction,
287 struct page *new_page; 287 struct page *new_page;
288 unsigned int new_offset; 288 unsigned int new_offset;
289 struct buffer_head *bh_in = jh2bh(jh_in); 289 struct buffer_head *bh_in = jh2bh(jh_in);
290 journal_t *journal = transaction->t_journal;
290 291
291 /* 292 /*
292 * The buffer really shouldn't be locked: only the current committing 293 * The buffer really shouldn't be locked: only the current committing
@@ -300,6 +301,11 @@ int journal_write_metadata_buffer(transaction_t *transaction,
300 J_ASSERT_BH(bh_in, buffer_jbddirty(bh_in)); 301 J_ASSERT_BH(bh_in, buffer_jbddirty(bh_in));
301 302
302 new_bh = alloc_buffer_head(GFP_NOFS|__GFP_NOFAIL); 303 new_bh = alloc_buffer_head(GFP_NOFS|__GFP_NOFAIL);
304 /* keep subsequent assertions sane */
305 new_bh->b_state = 0;
306 init_buffer(new_bh, NULL, NULL);
307 atomic_set(&new_bh->b_count, 1);
308 new_jh = journal_add_journal_head(new_bh); /* This sleeps */
303 309
304 /* 310 /*
305 * If a new transaction has already done a buffer copy-out, then 311 * If a new transaction has already done a buffer copy-out, then
@@ -361,14 +367,6 @@ repeat:
361 kunmap_atomic(mapped_data, KM_USER0); 367 kunmap_atomic(mapped_data, KM_USER0);
362 } 368 }
363 369
364 /* keep subsequent assertions sane */
365 new_bh->b_state = 0;
366 init_buffer(new_bh, NULL, NULL);
367 atomic_set(&new_bh->b_count, 1);
368 jbd_unlock_bh_state(bh_in);
369
370 new_jh = journal_add_journal_head(new_bh); /* This sleeps */
371
372 set_bh_page(new_bh, new_page, new_offset); 370 set_bh_page(new_bh, new_page, new_offset);
373 new_jh->b_transaction = NULL; 371 new_jh->b_transaction = NULL;
374 new_bh->b_size = jh2bh(jh_in)->b_size; 372 new_bh->b_size = jh2bh(jh_in)->b_size;
@@ -385,7 +383,11 @@ repeat:
385 * copying is moved to the transaction's shadow queue. 383 * copying is moved to the transaction's shadow queue.
386 */ 384 */
387 JBUFFER_TRACE(jh_in, "file as BJ_Shadow"); 385 JBUFFER_TRACE(jh_in, "file as BJ_Shadow");
388 journal_file_buffer(jh_in, transaction, BJ_Shadow); 386 spin_lock(&journal->j_list_lock);
387 __journal_file_buffer(jh_in, transaction, BJ_Shadow);
388 spin_unlock(&journal->j_list_lock);
389 jbd_unlock_bh_state(bh_in);
390
389 JBUFFER_TRACE(new_jh, "file as BJ_IO"); 391 JBUFFER_TRACE(new_jh, "file as BJ_IO");
390 journal_file_buffer(new_jh, transaction, BJ_IO); 392 journal_file_buffer(new_jh, transaction, BJ_IO);
391 393
@@ -848,6 +850,12 @@ static int journal_reset(journal_t *journal)
848 850
849 first = be32_to_cpu(sb->s_first); 851 first = be32_to_cpu(sb->s_first);
850 last = be32_to_cpu(sb->s_maxlen); 852 last = be32_to_cpu(sb->s_maxlen);
853 if (first + JFS_MIN_JOURNAL_BLOCKS > last + 1) {
854 printk(KERN_ERR "JBD: Journal too short (blocks %lu-%lu).\n",
855 first, last);
856 journal_fail_superblock(journal);
857 return -EINVAL;
858 }
851 859
852 journal->j_first = first; 860 journal->j_first = first;
853 journal->j_last = last; 861 journal->j_last = last;
diff --git a/fs/jbd/transaction.c b/fs/jbd/transaction.c
index 73242ba7c7b1..c03ac11f74be 100644
--- a/fs/jbd/transaction.c
+++ b/fs/jbd/transaction.c
@@ -489,34 +489,15 @@ void journal_unlock_updates (journal_t *journal)
489 wake_up(&journal->j_wait_transaction_locked); 489 wake_up(&journal->j_wait_transaction_locked);
490} 490}
491 491
492/* 492static void warn_dirty_buffer(struct buffer_head *bh)
493 * Report any unexpected dirty buffers which turn up. Normally those
494 * indicate an error, but they can occur if the user is running (say)
495 * tune2fs to modify the live filesystem, so we need the option of
496 * continuing as gracefully as possible. #
497 *
498 * The caller should already hold the journal lock and
499 * j_list_lock spinlock: most callers will need those anyway
500 * in order to probe the buffer's journaling state safely.
501 */
502static void jbd_unexpected_dirty_buffer(struct journal_head *jh)
503{ 493{
504 int jlist; 494 char b[BDEVNAME_SIZE];
505
506 /* If this buffer is one which might reasonably be dirty
507 * --- ie. data, or not part of this journal --- then
508 * we're OK to leave it alone, but otherwise we need to
509 * move the dirty bit to the journal's own internal
510 * JBDDirty bit. */
511 jlist = jh->b_jlist;
512 495
513 if (jlist == BJ_Metadata || jlist == BJ_Reserved || 496 printk(KERN_WARNING
514 jlist == BJ_Shadow || jlist == BJ_Forget) { 497 "JBD: Spotted dirty metadata buffer (dev = %s, blocknr = %llu). "
515 struct buffer_head *bh = jh2bh(jh); 498 "There's a risk of filesystem corruption in case of system "
516 499 "crash.\n",
517 if (test_clear_buffer_dirty(bh)) 500 bdevname(bh->b_bdev, b), (unsigned long long)bh->b_blocknr);
518 set_buffer_jbddirty(bh);
519 }
520} 501}
521 502
522/* 503/*
@@ -583,14 +564,16 @@ repeat:
583 if (jh->b_next_transaction) 564 if (jh->b_next_transaction)
584 J_ASSERT_JH(jh, jh->b_next_transaction == 565 J_ASSERT_JH(jh, jh->b_next_transaction ==
585 transaction); 566 transaction);
567 warn_dirty_buffer(bh);
586 } 568 }
587 /* 569 /*
588 * In any case we need to clean the dirty flag and we must 570 * In any case we need to clean the dirty flag and we must
589 * do it under the buffer lock to be sure we don't race 571 * do it under the buffer lock to be sure we don't race
590 * with running write-out. 572 * with running write-out.
591 */ 573 */
592 JBUFFER_TRACE(jh, "Unexpected dirty buffer"); 574 JBUFFER_TRACE(jh, "Journalling dirty buffer");
593 jbd_unexpected_dirty_buffer(jh); 575 clear_buffer_dirty(bh);
576 set_buffer_jbddirty(bh);
594 } 577 }
595 578
596 unlock_buffer(bh); 579 unlock_buffer(bh);
@@ -826,6 +809,15 @@ int journal_get_create_access(handle_t *handle, struct buffer_head *bh)
826 J_ASSERT_JH(jh, buffer_locked(jh2bh(jh))); 809 J_ASSERT_JH(jh, buffer_locked(jh2bh(jh)));
827 810
828 if (jh->b_transaction == NULL) { 811 if (jh->b_transaction == NULL) {
812 /*
813 * Previous journal_forget() could have left the buffer
814 * with jbddirty bit set because it was being committed. When
815 * the commit finished, we've filed the buffer for
816 * checkpointing and marked it dirty. Now we are reallocating
817 * the buffer so the transaction freeing it must have
818 * committed and so it's safe to clear the dirty bit.
819 */
820 clear_buffer_dirty(jh2bh(jh));
829 jh->b_transaction = transaction; 821 jh->b_transaction = transaction;
830 822
831 /* first access by this transaction */ 823 /* first access by this transaction */
@@ -1782,8 +1774,13 @@ static int __dispose_buffer(struct journal_head *jh, transaction_t *transaction)
1782 1774
1783 if (jh->b_cp_transaction) { 1775 if (jh->b_cp_transaction) {
1784 JBUFFER_TRACE(jh, "on running+cp transaction"); 1776 JBUFFER_TRACE(jh, "on running+cp transaction");
1777 /*
1778 * We don't want to write the buffer anymore, clear the
1779 * bit so that we don't confuse checks in
1780 * __journal_file_buffer
1781 */
1782 clear_buffer_dirty(bh);
1785 __journal_file_buffer(jh, transaction, BJ_Forget); 1783 __journal_file_buffer(jh, transaction, BJ_Forget);
1786 clear_buffer_jbddirty(bh);
1787 may_free = 0; 1784 may_free = 0;
1788 } else { 1785 } else {
1789 JBUFFER_TRACE(jh, "on running transaction"); 1786 JBUFFER_TRACE(jh, "on running transaction");
@@ -2041,12 +2038,17 @@ void __journal_file_buffer(struct journal_head *jh,
2041 if (jh->b_transaction && jh->b_jlist == jlist) 2038 if (jh->b_transaction && jh->b_jlist == jlist)
2042 return; 2039 return;
2043 2040
2044 /* The following list of buffer states needs to be consistent
2045 * with __jbd_unexpected_dirty_buffer()'s handling of dirty
2046 * state. */
2047
2048 if (jlist == BJ_Metadata || jlist == BJ_Reserved || 2041 if (jlist == BJ_Metadata || jlist == BJ_Reserved ||
2049 jlist == BJ_Shadow || jlist == BJ_Forget) { 2042 jlist == BJ_Shadow || jlist == BJ_Forget) {
2043 /*
2044 * For metadata buffers, we track dirty bit in buffer_jbddirty
2045 * instead of buffer_dirty. We should not see a dirty bit set
2046 * here because we clear it in do_get_write_access but e.g.
2047 * tune2fs can modify the sb and set the dirty bit at any time
2048 * so we try to gracefully handle that.
2049 */
2050 if (buffer_dirty(bh))
2051 warn_dirty_buffer(bh);
2050 if (test_clear_buffer_dirty(bh) || 2052 if (test_clear_buffer_dirty(bh) ||
2051 test_clear_buffer_jbddirty(bh)) 2053 test_clear_buffer_jbddirty(bh))
2052 was_dirty = 1; 2054 was_dirty = 1;
diff --git a/fs/jbd2/journal.c b/fs/jbd2/journal.c
index 18bfd5dab642..e378cb383979 100644
--- a/fs/jbd2/journal.c
+++ b/fs/jbd2/journal.c
@@ -297,6 +297,7 @@ int jbd2_journal_write_metadata_buffer(transaction_t *transaction,
297 unsigned int new_offset; 297 unsigned int new_offset;
298 struct buffer_head *bh_in = jh2bh(jh_in); 298 struct buffer_head *bh_in = jh2bh(jh_in);
299 struct jbd2_buffer_trigger_type *triggers; 299 struct jbd2_buffer_trigger_type *triggers;
300 journal_t *journal = transaction->t_journal;
300 301
301 /* 302 /*
302 * The buffer really shouldn't be locked: only the current committing 303 * The buffer really shouldn't be locked: only the current committing
@@ -310,6 +311,11 @@ int jbd2_journal_write_metadata_buffer(transaction_t *transaction,
310 J_ASSERT_BH(bh_in, buffer_jbddirty(bh_in)); 311 J_ASSERT_BH(bh_in, buffer_jbddirty(bh_in));
311 312
312 new_bh = alloc_buffer_head(GFP_NOFS|__GFP_NOFAIL); 313 new_bh = alloc_buffer_head(GFP_NOFS|__GFP_NOFAIL);
314 /* keep subsequent assertions sane */
315 new_bh->b_state = 0;
316 init_buffer(new_bh, NULL, NULL);
317 atomic_set(&new_bh->b_count, 1);
318 new_jh = jbd2_journal_add_journal_head(new_bh); /* This sleeps */
313 319
314 /* 320 /*
315 * If a new transaction has already done a buffer copy-out, then 321 * If a new transaction has already done a buffer copy-out, then
@@ -388,14 +394,6 @@ repeat:
388 kunmap_atomic(mapped_data, KM_USER0); 394 kunmap_atomic(mapped_data, KM_USER0);
389 } 395 }
390 396
391 /* keep subsequent assertions sane */
392 new_bh->b_state = 0;
393 init_buffer(new_bh, NULL, NULL);
394 atomic_set(&new_bh->b_count, 1);
395 jbd_unlock_bh_state(bh_in);
396
397 new_jh = jbd2_journal_add_journal_head(new_bh); /* This sleeps */
398
399 set_bh_page(new_bh, new_page, new_offset); 397 set_bh_page(new_bh, new_page, new_offset);
400 new_jh->b_transaction = NULL; 398 new_jh->b_transaction = NULL;
401 new_bh->b_size = jh2bh(jh_in)->b_size; 399 new_bh->b_size = jh2bh(jh_in)->b_size;
@@ -412,7 +410,11 @@ repeat:
412 * copying is moved to the transaction's shadow queue. 410 * copying is moved to the transaction's shadow queue.
413 */ 411 */
414 JBUFFER_TRACE(jh_in, "file as BJ_Shadow"); 412 JBUFFER_TRACE(jh_in, "file as BJ_Shadow");
415 jbd2_journal_file_buffer(jh_in, transaction, BJ_Shadow); 413 spin_lock(&journal->j_list_lock);
414 __jbd2_journal_file_buffer(jh_in, transaction, BJ_Shadow);
415 spin_unlock(&journal->j_list_lock);
416 jbd_unlock_bh_state(bh_in);
417
416 JBUFFER_TRACE(new_jh, "file as BJ_IO"); 418 JBUFFER_TRACE(new_jh, "file as BJ_IO");
417 jbd2_journal_file_buffer(new_jh, transaction, BJ_IO); 419 jbd2_journal_file_buffer(new_jh, transaction, BJ_IO);
418 420
@@ -2410,6 +2412,7 @@ const char *jbd2_dev_to_name(dev_t device)
2410 int i = hash_32(device, CACHE_SIZE_BITS); 2412 int i = hash_32(device, CACHE_SIZE_BITS);
2411 char *ret; 2413 char *ret;
2412 struct block_device *bd; 2414 struct block_device *bd;
2415 static struct devname_cache *new_dev;
2413 2416
2414 rcu_read_lock(); 2417 rcu_read_lock();
2415 if (devcache[i] && devcache[i]->device == device) { 2418 if (devcache[i] && devcache[i]->device == device) {
@@ -2419,20 +2422,20 @@ const char *jbd2_dev_to_name(dev_t device)
2419 } 2422 }
2420 rcu_read_unlock(); 2423 rcu_read_unlock();
2421 2424
2425 new_dev = kmalloc(sizeof(struct devname_cache), GFP_KERNEL);
2426 if (!new_dev)
2427 return "NODEV-ALLOCFAILURE"; /* Something non-NULL */
2422 spin_lock(&devname_cache_lock); 2428 spin_lock(&devname_cache_lock);
2423 if (devcache[i]) { 2429 if (devcache[i]) {
2424 if (devcache[i]->device == device) { 2430 if (devcache[i]->device == device) {
2431 kfree(new_dev);
2425 ret = devcache[i]->devname; 2432 ret = devcache[i]->devname;
2426 spin_unlock(&devname_cache_lock); 2433 spin_unlock(&devname_cache_lock);
2427 return ret; 2434 return ret;
2428 } 2435 }
2429 call_rcu(&devcache[i]->rcu, free_devcache); 2436 call_rcu(&devcache[i]->rcu, free_devcache);
2430 } 2437 }
2431 devcache[i] = kmalloc(sizeof(struct devname_cache), GFP_KERNEL); 2438 devcache[i] = new_dev;
2432 if (!devcache[i]) {
2433 spin_unlock(&devname_cache_lock);
2434 return "NODEV-ALLOCFAILURE"; /* Something non-NULL */
2435 }
2436 devcache[i]->device = device; 2439 devcache[i]->device = device;
2437 bd = bdget(device); 2440 bd = bdget(device);
2438 if (bd) { 2441 if (bd) {
diff --git a/fs/jbd2/transaction.c b/fs/jbd2/transaction.c
index 494501edba6b..6213ac728f30 100644
--- a/fs/jbd2/transaction.c
+++ b/fs/jbd2/transaction.c
@@ -499,34 +499,15 @@ void jbd2_journal_unlock_updates (journal_t *journal)
499 wake_up(&journal->j_wait_transaction_locked); 499 wake_up(&journal->j_wait_transaction_locked);
500} 500}
501 501
502/* 502static void warn_dirty_buffer(struct buffer_head *bh)
503 * Report any unexpected dirty buffers which turn up. Normally those
504 * indicate an error, but they can occur if the user is running (say)
505 * tune2fs to modify the live filesystem, so we need the option of
506 * continuing as gracefully as possible. #
507 *
508 * The caller should already hold the journal lock and
509 * j_list_lock spinlock: most callers will need those anyway
510 * in order to probe the buffer's journaling state safely.
511 */
512static void jbd_unexpected_dirty_buffer(struct journal_head *jh)
513{ 503{
514 int jlist; 504 char b[BDEVNAME_SIZE];
515
516 /* If this buffer is one which might reasonably be dirty
517 * --- ie. data, or not part of this journal --- then
518 * we're OK to leave it alone, but otherwise we need to
519 * move the dirty bit to the journal's own internal
520 * JBDDirty bit. */
521 jlist = jh->b_jlist;
522 505
523 if (jlist == BJ_Metadata || jlist == BJ_Reserved || 506 printk(KERN_WARNING
524 jlist == BJ_Shadow || jlist == BJ_Forget) { 507 "JBD: Spotted dirty metadata buffer (dev = %s, blocknr = %llu). "
525 struct buffer_head *bh = jh2bh(jh); 508 "There's a risk of filesystem corruption in case of system "
526 509 "crash.\n",
527 if (test_clear_buffer_dirty(bh)) 510 bdevname(bh->b_bdev, b), (unsigned long long)bh->b_blocknr);
528 set_buffer_jbddirty(bh);
529 }
530} 511}
531 512
532/* 513/*
@@ -593,14 +574,16 @@ repeat:
593 if (jh->b_next_transaction) 574 if (jh->b_next_transaction)
594 J_ASSERT_JH(jh, jh->b_next_transaction == 575 J_ASSERT_JH(jh, jh->b_next_transaction ==
595 transaction); 576 transaction);
577 warn_dirty_buffer(bh);
596 } 578 }
597 /* 579 /*
598 * In any case we need to clean the dirty flag and we must 580 * In any case we need to clean the dirty flag and we must
599 * do it under the buffer lock to be sure we don't race 581 * do it under the buffer lock to be sure we don't race
600 * with running write-out. 582 * with running write-out.
601 */ 583 */
602 JBUFFER_TRACE(jh, "Unexpected dirty buffer"); 584 JBUFFER_TRACE(jh, "Journalling dirty buffer");
603 jbd_unexpected_dirty_buffer(jh); 585 clear_buffer_dirty(bh);
586 set_buffer_jbddirty(bh);
604 } 587 }
605 588
606 unlock_buffer(bh); 589 unlock_buffer(bh);
@@ -843,6 +826,15 @@ int jbd2_journal_get_create_access(handle_t *handle, struct buffer_head *bh)
843 J_ASSERT_JH(jh, buffer_locked(jh2bh(jh))); 826 J_ASSERT_JH(jh, buffer_locked(jh2bh(jh)));
844 827
845 if (jh->b_transaction == NULL) { 828 if (jh->b_transaction == NULL) {
829 /*
830 * Previous jbd2_journal_forget() could have left the buffer
831 * with jbddirty bit set because it was being committed. When
832 * the commit finished, we've filed the buffer for
833 * checkpointing and marked it dirty. Now we are reallocating
834 * the buffer so the transaction freeing it must have
835 * committed and so it's safe to clear the dirty bit.
836 */
837 clear_buffer_dirty(jh2bh(jh));
846 jh->b_transaction = transaction; 838 jh->b_transaction = transaction;
847 839
848 /* first access by this transaction */ 840 /* first access by this transaction */
@@ -1644,8 +1636,13 @@ static int __dispose_buffer(struct journal_head *jh, transaction_t *transaction)
1644 1636
1645 if (jh->b_cp_transaction) { 1637 if (jh->b_cp_transaction) {
1646 JBUFFER_TRACE(jh, "on running+cp transaction"); 1638 JBUFFER_TRACE(jh, "on running+cp transaction");
1639 /*
1640 * We don't want to write the buffer anymore, clear the
1641 * bit so that we don't confuse checks in
1642 * __journal_file_buffer
1643 */
1644 clear_buffer_dirty(bh);
1647 __jbd2_journal_file_buffer(jh, transaction, BJ_Forget); 1645 __jbd2_journal_file_buffer(jh, transaction, BJ_Forget);
1648 clear_buffer_jbddirty(bh);
1649 may_free = 0; 1646 may_free = 0;
1650 } else { 1647 } else {
1651 JBUFFER_TRACE(jh, "on running transaction"); 1648 JBUFFER_TRACE(jh, "on running transaction");
@@ -1896,12 +1893,17 @@ void __jbd2_journal_file_buffer(struct journal_head *jh,
1896 if (jh->b_transaction && jh->b_jlist == jlist) 1893 if (jh->b_transaction && jh->b_jlist == jlist)
1897 return; 1894 return;
1898 1895
1899 /* The following list of buffer states needs to be consistent
1900 * with __jbd_unexpected_dirty_buffer()'s handling of dirty
1901 * state. */
1902
1903 if (jlist == BJ_Metadata || jlist == BJ_Reserved || 1896 if (jlist == BJ_Metadata || jlist == BJ_Reserved ||
1904 jlist == BJ_Shadow || jlist == BJ_Forget) { 1897 jlist == BJ_Shadow || jlist == BJ_Forget) {
1898 /*
1899 * For metadata buffers, we track dirty bit in buffer_jbddirty
1900 * instead of buffer_dirty. We should not see a dirty bit set
1901 * here because we clear it in do_get_write_access but e.g.
1902 * tune2fs can modify the sb and set the dirty bit at any time
1903 * so we try to gracefully handle that.
1904 */
1905 if (buffer_dirty(bh))
1906 warn_dirty_buffer(bh);
1905 if (test_clear_buffer_dirty(bh) || 1907 if (test_clear_buffer_dirty(bh) ||
1906 test_clear_buffer_jbddirty(bh)) 1908 test_clear_buffer_jbddirty(bh))
1907 was_dirty = 1; 1909 was_dirty = 1;
diff --git a/fs/jffs2/erase.c b/fs/jffs2/erase.c
index a0244740b75a..b47679be118a 100644
--- a/fs/jffs2/erase.c
+++ b/fs/jffs2/erase.c
@@ -270,19 +270,21 @@ static inline void jffs2_remove_node_refs_from_ino_list(struct jffs2_sb_info *c,
270 D2({ 270 D2({
271 int i=0; 271 int i=0;
272 struct jffs2_raw_node_ref *this; 272 struct jffs2_raw_node_ref *this;
273 printk(KERN_DEBUG "After remove_node_refs_from_ino_list: \n" KERN_DEBUG); 273 printk(KERN_DEBUG "After remove_node_refs_from_ino_list: \n");
274 274
275 this = ic->nodes; 275 this = ic->nodes;
276 276
277 printk(KERN_DEBUG);
277 while(this) { 278 while(this) {
278 printk( "0x%08x(%d)->", ref_offset(this), ref_flags(this)); 279 printk(KERN_CONT "0x%08x(%d)->",
280 ref_offset(this), ref_flags(this));
279 if (++i == 5) { 281 if (++i == 5) {
280 printk("\n" KERN_DEBUG); 282 printk(KERN_DEBUG);
281 i=0; 283 i=0;
282 } 284 }
283 this = this->next_in_ino; 285 this = this->next_in_ino;
284 } 286 }
285 printk("\n"); 287 printk(KERN_CONT "\n");
286 }); 288 });
287 289
288 switch (ic->class) { 290 switch (ic->class) {
diff --git a/fs/jffs2/file.c b/fs/jffs2/file.c
index 5edc2bf20581..23c947539864 100644
--- a/fs/jffs2/file.c
+++ b/fs/jffs2/file.c
@@ -99,7 +99,7 @@ static int jffs2_do_readpage_nolock (struct inode *inode, struct page *pg)
99 kunmap(pg); 99 kunmap(pg);
100 100
101 D2(printk(KERN_DEBUG "readpage finished\n")); 101 D2(printk(KERN_DEBUG "readpage finished\n"));
102 return 0; 102 return ret;
103} 103}
104 104
105int jffs2_do_readpage_unlock(struct inode *inode, struct page *pg) 105int jffs2_do_readpage_unlock(struct inode *inode, struct page *pg)
diff --git a/fs/jffs2/scan.c b/fs/jffs2/scan.c
index 7515e73e2bfb..696686cc206e 100644
--- a/fs/jffs2/scan.c
+++ b/fs/jffs2/scan.c
@@ -130,9 +130,9 @@ int jffs2_scan_medium(struct jffs2_sb_info *c)
130 if (jffs2_sum_active()) { 130 if (jffs2_sum_active()) {
131 s = kzalloc(sizeof(struct jffs2_summary), GFP_KERNEL); 131 s = kzalloc(sizeof(struct jffs2_summary), GFP_KERNEL);
132 if (!s) { 132 if (!s) {
133 kfree(flashbuf);
134 JFFS2_WARNING("Can't allocate memory for summary\n"); 133 JFFS2_WARNING("Can't allocate memory for summary\n");
135 return -ENOMEM; 134 ret = -ENOMEM;
135 goto out;
136 } 136 }
137 } 137 }
138 138
diff --git a/fs/jffs2/super.c b/fs/jffs2/super.c
index 07a22caf2687..0035c021395a 100644
--- a/fs/jffs2/super.c
+++ b/fs/jffs2/super.c
@@ -12,6 +12,7 @@
12#include <linux/kernel.h> 12#include <linux/kernel.h>
13#include <linux/module.h> 13#include <linux/module.h>
14#include <linux/slab.h> 14#include <linux/slab.h>
15#include <linux/smp_lock.h>
15#include <linux/init.h> 16#include <linux/init.h>
16#include <linux/list.h> 17#include <linux/list.h>
17#include <linux/fs.h> 18#include <linux/fs.h>
diff --git a/fs/jfs/acl.c b/fs/jfs/acl.c
index 91fa3ad6e8c2..a29c7c3e3fb8 100644
--- a/fs/jfs/acl.c
+++ b/fs/jfs/acl.c
@@ -67,10 +67,8 @@ static struct posix_acl *jfs_get_acl(struct inode *inode, int type)
67 acl = posix_acl_from_xattr(value, size); 67 acl = posix_acl_from_xattr(value, size);
68 } 68 }
69 kfree(value); 69 kfree(value);
70 if (!IS_ERR(acl)) { 70 if (!IS_ERR(acl))
71 set_cached_acl(inode, type, acl); 71 set_cached_acl(inode, type, acl);
72 posix_acl_release(acl);
73 }
74 return acl; 72 return acl;
75} 73}
76 74
diff --git a/fs/lockd/clntproc.c b/fs/lockd/clntproc.c
index f2fdcbce143e..4336adba952a 100644
--- a/fs/lockd/clntproc.c
+++ b/fs/lockd/clntproc.c
@@ -7,6 +7,7 @@
7 */ 7 */
8 8
9#include <linux/module.h> 9#include <linux/module.h>
10#include <linux/smp_lock.h>
10#include <linux/types.h> 11#include <linux/types.h>
11#include <linux/errno.h> 12#include <linux/errno.h>
12#include <linux/fs.h> 13#include <linux/fs.h>
diff --git a/fs/lockd/svc4proc.c b/fs/lockd/svc4proc.c
index 1725037374c5..bd173a6ca3b1 100644
--- a/fs/lockd/svc4proc.c
+++ b/fs/lockd/svc4proc.c
@@ -10,6 +10,7 @@
10#include <linux/types.h> 10#include <linux/types.h>
11#include <linux/time.h> 11#include <linux/time.h>
12#include <linux/slab.h> 12#include <linux/slab.h>
13#include <linux/smp_lock.h>
13#include <linux/in.h> 14#include <linux/in.h>
14#include <linux/sunrpc/svc.h> 15#include <linux/sunrpc/svc.h>
15#include <linux/sunrpc/clnt.h> 16#include <linux/sunrpc/clnt.h>
diff --git a/fs/lockd/svcproc.c b/fs/lockd/svcproc.c
index 3688e55901fc..e1d28ddd2169 100644
--- a/fs/lockd/svcproc.c
+++ b/fs/lockd/svcproc.c
@@ -10,6 +10,7 @@
10#include <linux/types.h> 10#include <linux/types.h>
11#include <linux/time.h> 11#include <linux/time.h>
12#include <linux/slab.h> 12#include <linux/slab.h>
13#include <linux/smp_lock.h>
13#include <linux/in.h> 14#include <linux/in.h>
14#include <linux/sunrpc/svc.h> 15#include <linux/sunrpc/svc.h>
15#include <linux/sunrpc/clnt.h> 16#include <linux/sunrpc/clnt.h>
diff --git a/fs/namei.c b/fs/namei.c
index 5b961eb71cbf..f3c5b278895a 100644
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -1761,6 +1761,10 @@ do_last:
1761 goto exit; 1761 goto exit;
1762 } 1762 }
1763 filp = nameidata_to_filp(&nd, open_flag); 1763 filp = nameidata_to_filp(&nd, open_flag);
1764 if (IS_ERR(filp))
1765 ima_counts_put(&nd.path,
1766 acc_mode & (MAY_READ | MAY_WRITE |
1767 MAY_EXEC));
1764 mnt_drop_write(nd.path.mnt); 1768 mnt_drop_write(nd.path.mnt);
1765 if (nd.root.mnt) 1769 if (nd.root.mnt)
1766 path_put(&nd.root); 1770 path_put(&nd.root);
@@ -1817,6 +1821,9 @@ ok:
1817 goto exit; 1821 goto exit;
1818 } 1822 }
1819 filp = nameidata_to_filp(&nd, open_flag); 1823 filp = nameidata_to_filp(&nd, open_flag);
1824 if (IS_ERR(filp))
1825 ima_counts_put(&nd.path,
1826 acc_mode & (MAY_READ | MAY_WRITE | MAY_EXEC));
1820 /* 1827 /*
1821 * It is now safe to drop the mnt write 1828 * It is now safe to drop the mnt write
1822 * because the filp has had a write taken 1829 * because the filp has had a write taken
diff --git a/fs/namespace.c b/fs/namespace.c
index 3dc283fd4716..7230787d18b0 100644
--- a/fs/namespace.c
+++ b/fs/namespace.c
@@ -22,6 +22,7 @@
22#include <linux/seq_file.h> 22#include <linux/seq_file.h>
23#include <linux/mnt_namespace.h> 23#include <linux/mnt_namespace.h>
24#include <linux/namei.h> 24#include <linux/namei.h>
25#include <linux/nsproxy.h>
25#include <linux/security.h> 26#include <linux/security.h>
26#include <linux/mount.h> 27#include <linux/mount.h>
27#include <linux/ramfs.h> 28#include <linux/ramfs.h>
@@ -315,7 +316,8 @@ EXPORT_SYMBOL_GPL(mnt_clone_write);
315 */ 316 */
316int mnt_want_write_file(struct file *file) 317int mnt_want_write_file(struct file *file)
317{ 318{
318 if (!(file->f_mode & FMODE_WRITE)) 319 struct inode *inode = file->f_dentry->d_inode;
320 if (!(file->f_mode & FMODE_WRITE) || special_file(inode->i_mode))
319 return mnt_want_write(file->f_path.mnt); 321 return mnt_want_write(file->f_path.mnt);
320 else 322 else
321 return mnt_clone_write(file->f_path.mnt); 323 return mnt_clone_write(file->f_path.mnt);
diff --git a/fs/nfs/client.c b/fs/nfs/client.c
index c2d061675d80..8d25ccb2d51d 100644
--- a/fs/nfs/client.c
+++ b/fs/nfs/client.c
@@ -1242,20 +1242,6 @@ error:
1242 return error; 1242 return error;
1243} 1243}
1244 1244
1245/*
1246 * Initialize a session.
1247 * Note: save the mount rsize and wsize for create_server negotiation.
1248 */
1249static void nfs4_init_session(struct nfs_client *clp,
1250 unsigned int wsize, unsigned int rsize)
1251{
1252#if defined(CONFIG_NFS_V4_1)
1253 if (nfs4_has_session(clp)) {
1254 clp->cl_session->fc_attrs.max_rqst_sz = wsize;
1255 clp->cl_session->fc_attrs.max_resp_sz = rsize;
1256 }
1257#endif /* CONFIG_NFS_V4_1 */
1258}
1259 1245
1260/* 1246/*
1261 * Session has been established, and the client marked ready. 1247 * Session has been established, and the client marked ready.
@@ -1350,7 +1336,9 @@ struct nfs_server *nfs4_create_server(const struct nfs_parsed_mount_data *data,
1350 BUG_ON(!server->nfs_client->rpc_ops); 1336 BUG_ON(!server->nfs_client->rpc_ops);
1351 BUG_ON(!server->nfs_client->rpc_ops->file_inode_ops); 1337 BUG_ON(!server->nfs_client->rpc_ops->file_inode_ops);
1352 1338
1353 nfs4_init_session(server->nfs_client, server->wsize, server->rsize); 1339 error = nfs4_init_session(server);
1340 if (error < 0)
1341 goto error;
1354 1342
1355 /* Probe the root fh to retrieve its FSID */ 1343 /* Probe the root fh to retrieve its FSID */
1356 error = nfs4_path_walk(server, mntfh, data->nfs_server.export_path); 1344 error = nfs4_path_walk(server, mntfh, data->nfs_server.export_path);
diff --git a/fs/nfs/delegation.c b/fs/nfs/delegation.c
index af05b918cb5b..6dd48a4405b4 100644
--- a/fs/nfs/delegation.c
+++ b/fs/nfs/delegation.c
@@ -10,6 +10,7 @@
10#include <linux/kthread.h> 10#include <linux/kthread.h>
11#include <linux/module.h> 11#include <linux/module.h>
12#include <linux/sched.h> 12#include <linux/sched.h>
13#include <linux/smp_lock.h>
13#include <linux/spinlock.h> 14#include <linux/spinlock.h>
14 15
15#include <linux/nfs4.h> 16#include <linux/nfs4.h>
diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c
index 89f98e9a024b..32062c33c859 100644
--- a/fs/nfs/dir.c
+++ b/fs/nfs/dir.c
@@ -29,7 +29,6 @@
29#include <linux/nfs_fs.h> 29#include <linux/nfs_fs.h>
30#include <linux/nfs_mount.h> 30#include <linux/nfs_mount.h>
31#include <linux/pagemap.h> 31#include <linux/pagemap.h>
32#include <linux/smp_lock.h>
33#include <linux/pagevec.h> 32#include <linux/pagevec.h>
34#include <linux/namei.h> 33#include <linux/namei.h>
35#include <linux/mount.h> 34#include <linux/mount.h>
@@ -1026,12 +1025,12 @@ static struct dentry *nfs_atomic_lookup(struct inode *dir, struct dentry *dentry
1026 res = NULL; 1025 res = NULL;
1027 goto out; 1026 goto out;
1028 /* This turned out not to be a regular file */ 1027 /* This turned out not to be a regular file */
1029 case -EISDIR:
1030 case -ENOTDIR: 1028 case -ENOTDIR:
1031 goto no_open; 1029 goto no_open;
1032 case -ELOOP: 1030 case -ELOOP:
1033 if (!(nd->intent.open.flags & O_NOFOLLOW)) 1031 if (!(nd->intent.open.flags & O_NOFOLLOW))
1034 goto no_open; 1032 goto no_open;
1033 /* case -EISDIR: */
1035 /* case -EINVAL: */ 1034 /* case -EINVAL: */
1036 default: 1035 default:
1037 goto out; 1036 goto out;
diff --git a/fs/nfs/file.c b/fs/nfs/file.c
index 0055b813ec2c..05062329b678 100644
--- a/fs/nfs/file.c
+++ b/fs/nfs/file.c
@@ -26,7 +26,6 @@
26#include <linux/mm.h> 26#include <linux/mm.h>
27#include <linux/slab.h> 27#include <linux/slab.h>
28#include <linux/pagemap.h> 28#include <linux/pagemap.h>
29#include <linux/smp_lock.h>
30#include <linux/aio.h> 29#include <linux/aio.h>
31 30
32#include <asm/uaccess.h> 31#include <asm/uaccess.h>
diff --git a/fs/nfs/getroot.c b/fs/nfs/getroot.c
index 46177cb87064..b35d2a616066 100644
--- a/fs/nfs/getroot.c
+++ b/fs/nfs/getroot.c
@@ -30,7 +30,6 @@
30#include <linux/nfs_idmap.h> 30#include <linux/nfs_idmap.h>
31#include <linux/vfs.h> 31#include <linux/vfs.h>
32#include <linux/namei.h> 32#include <linux/namei.h>
33#include <linux/mnt_namespace.h>
34#include <linux/security.h> 33#include <linux/security.h>
35 34
36#include <asm/system.h> 35#include <asm/system.h>
diff --git a/fs/nfs/inode.c b/fs/nfs/inode.c
index 64f87194d390..bd7938eda6a8 100644
--- a/fs/nfs/inode.c
+++ b/fs/nfs/inode.c
@@ -30,7 +30,6 @@
30#include <linux/nfs_mount.h> 30#include <linux/nfs_mount.h>
31#include <linux/nfs4_mount.h> 31#include <linux/nfs4_mount.h>
32#include <linux/lockd/bind.h> 32#include <linux/lockd/bind.h>
33#include <linux/smp_lock.h>
34#include <linux/seq_file.h> 33#include <linux/seq_file.h>
35#include <linux/mount.h> 34#include <linux/mount.h>
36#include <linux/nfs_idmap.h> 35#include <linux/nfs_idmap.h>
diff --git a/fs/nfs/nfs4_fs.h b/fs/nfs/nfs4_fs.h
index 61bc3a32e1e2..6ea07a3c75d4 100644
--- a/fs/nfs/nfs4_fs.h
+++ b/fs/nfs/nfs4_fs.h
@@ -220,6 +220,7 @@ extern void nfs4_destroy_session(struct nfs4_session *session);
220extern struct nfs4_session *nfs4_alloc_session(struct nfs_client *clp); 220extern struct nfs4_session *nfs4_alloc_session(struct nfs_client *clp);
221extern int nfs4_proc_create_session(struct nfs_client *, int reset); 221extern int nfs4_proc_create_session(struct nfs_client *, int reset);
222extern int nfs4_proc_destroy_session(struct nfs4_session *); 222extern int nfs4_proc_destroy_session(struct nfs4_session *);
223extern int nfs4_init_session(struct nfs_server *server);
223#else /* CONFIG_NFS_v4_1 */ 224#else /* CONFIG_NFS_v4_1 */
224static inline int nfs4_setup_sequence(struct nfs_client *clp, 225static inline int nfs4_setup_sequence(struct nfs_client *clp,
225 struct nfs4_sequence_args *args, struct nfs4_sequence_res *res, 226 struct nfs4_sequence_args *args, struct nfs4_sequence_res *res,
@@ -227,6 +228,11 @@ static inline int nfs4_setup_sequence(struct nfs_client *clp,
227{ 228{
228 return 0; 229 return 0;
229} 230}
231
232static inline int nfs4_init_session(struct nfs_server *server)
233{
234 return 0;
235}
230#endif /* CONFIG_NFS_V4_1 */ 236#endif /* CONFIG_NFS_V4_1 */
231 237
232extern struct nfs4_state_maintenance_ops *nfs4_state_renewal_ops[]; 238extern struct nfs4_state_maintenance_ops *nfs4_state_renewal_ops[];
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index 92ce43517814..6917311f201c 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -45,7 +45,6 @@
45#include <linux/nfs4.h> 45#include <linux/nfs4.h>
46#include <linux/nfs_fs.h> 46#include <linux/nfs_fs.h>
47#include <linux/nfs_page.h> 47#include <linux/nfs_page.h>
48#include <linux/smp_lock.h>
49#include <linux/namei.h> 48#include <linux/namei.h>
50#include <linux/mount.h> 49#include <linux/mount.h>
51#include <linux/module.h> 50#include <linux/module.h>
@@ -2041,15 +2040,9 @@ static int _nfs4_lookup_root(struct nfs_server *server, struct nfs_fh *fhandle,
2041 .rpc_argp = &args, 2040 .rpc_argp = &args,
2042 .rpc_resp = &res, 2041 .rpc_resp = &res,
2043 }; 2042 };
2044 int status;
2045 2043
2046 nfs_fattr_init(info->fattr); 2044 nfs_fattr_init(info->fattr);
2047 status = nfs4_recover_expired_lease(server); 2045 return nfs4_call_sync(server, &msg, &args, &res, 0);
2048 if (!status)
2049 status = nfs4_check_client_ready(server->nfs_client);
2050 if (!status)
2051 status = nfs4_call_sync(server, &msg, &args, &res, 0);
2052 return status;
2053} 2046}
2054 2047
2055static int nfs4_lookup_root(struct nfs_server *server, struct nfs_fh *fhandle, 2048static int nfs4_lookup_root(struct nfs_server *server, struct nfs_fh *fhandle,
@@ -4100,15 +4093,23 @@ nfs4_proc_lock(struct file *filp, int cmd, struct file_lock *request)
4100 if (request->fl_start < 0 || request->fl_end < 0) 4093 if (request->fl_start < 0 || request->fl_end < 0)
4101 return -EINVAL; 4094 return -EINVAL;
4102 4095
4103 if (IS_GETLK(cmd)) 4096 if (IS_GETLK(cmd)) {
4104 return nfs4_proc_getlk(state, F_GETLK, request); 4097 if (state != NULL)
4098 return nfs4_proc_getlk(state, F_GETLK, request);
4099 return 0;
4100 }
4105 4101
4106 if (!(IS_SETLK(cmd) || IS_SETLKW(cmd))) 4102 if (!(IS_SETLK(cmd) || IS_SETLKW(cmd)))
4107 return -EINVAL; 4103 return -EINVAL;
4108 4104
4109 if (request->fl_type == F_UNLCK) 4105 if (request->fl_type == F_UNLCK) {
4110 return nfs4_proc_unlck(state, cmd, request); 4106 if (state != NULL)
4107 return nfs4_proc_unlck(state, cmd, request);
4108 return 0;
4109 }
4111 4110
4111 if (state == NULL)
4112 return -ENOLCK;
4112 do { 4113 do {
4113 status = nfs4_proc_setlk(state, cmd, request); 4114 status = nfs4_proc_setlk(state, cmd, request);
4114 if ((status != -EAGAIN) || IS_SETLK(cmd)) 4115 if ((status != -EAGAIN) || IS_SETLK(cmd))
@@ -4794,6 +4795,22 @@ int nfs4_proc_destroy_session(struct nfs4_session *session)
4794 return status; 4795 return status;
4795} 4796}
4796 4797
4798int nfs4_init_session(struct nfs_server *server)
4799{
4800 struct nfs_client *clp = server->nfs_client;
4801 int ret;
4802
4803 if (!nfs4_has_session(clp))
4804 return 0;
4805
4806 clp->cl_session->fc_attrs.max_rqst_sz = server->wsize;
4807 clp->cl_session->fc_attrs.max_resp_sz = server->rsize;
4808 ret = nfs4_recover_expired_lease(server);
4809 if (!ret)
4810 ret = nfs4_check_client_ready(clp);
4811 return ret;
4812}
4813
4797/* 4814/*
4798 * Renew the cl_session lease. 4815 * Renew the cl_session lease.
4799 */ 4816 */
diff --git a/fs/nfs/nfs4state.c b/fs/nfs/nfs4state.c
index b73c5a728655..65ca8c18476f 100644
--- a/fs/nfs/nfs4state.c
+++ b/fs/nfs/nfs4state.c
@@ -553,6 +553,7 @@ static struct nfs4_lock_state *nfs4_alloc_lock_state(struct nfs4_state *state, f
553 INIT_LIST_HEAD(&lsp->ls_sequence.list); 553 INIT_LIST_HEAD(&lsp->ls_sequence.list);
554 lsp->ls_seqid.sequence = &lsp->ls_sequence; 554 lsp->ls_seqid.sequence = &lsp->ls_sequence;
555 atomic_set(&lsp->ls_count, 1); 555 atomic_set(&lsp->ls_count, 1);
556 lsp->ls_state = state;
556 lsp->ls_owner = fl_owner; 557 lsp->ls_owner = fl_owner;
557 spin_lock(&clp->cl_lock); 558 spin_lock(&clp->cl_lock);
558 nfs_alloc_unique_id(&clp->cl_lockowner_id, &lsp->ls_id, 1, 64); 559 nfs_alloc_unique_id(&clp->cl_lockowner_id, &lsp->ls_id, 1, 64);
@@ -587,7 +588,6 @@ static struct nfs4_lock_state *nfs4_get_lock_state(struct nfs4_state *state, fl_
587 if (lsp != NULL) 588 if (lsp != NULL)
588 break; 589 break;
589 if (new != NULL) { 590 if (new != NULL) {
590 new->ls_state = state;
591 list_add(&new->ls_locks, &state->lock_states); 591 list_add(&new->ls_locks, &state->lock_states);
592 set_bit(LK_STATE_IN_USE, &state->flags); 592 set_bit(LK_STATE_IN_USE, &state->flags);
593 lsp = new; 593 lsp = new;
diff --git a/fs/nfs/read.c b/fs/nfs/read.c
index 96c4ebfa46f4..73ea5e8d66ce 100644
--- a/fs/nfs/read.c
+++ b/fs/nfs/read.c
@@ -18,7 +18,6 @@
18#include <linux/sunrpc/clnt.h> 18#include <linux/sunrpc/clnt.h>
19#include <linux/nfs_fs.h> 19#include <linux/nfs_fs.h>
20#include <linux/nfs_page.h> 20#include <linux/nfs_page.h>
21#include <linux/smp_lock.h>
22 21
23#include <asm/system.h> 22#include <asm/system.h>
24 23
diff --git a/fs/nfs/write.c b/fs/nfs/write.c
index ce728829f79a..0a0a2ff767c3 100644
--- a/fs/nfs/write.c
+++ b/fs/nfs/write.c
@@ -202,8 +202,10 @@ static int nfs_set_page_writeback(struct page *page)
202 struct nfs_server *nfss = NFS_SERVER(inode); 202 struct nfs_server *nfss = NFS_SERVER(inode);
203 203
204 if (atomic_long_inc_return(&nfss->writeback) > 204 if (atomic_long_inc_return(&nfss->writeback) >
205 NFS_CONGESTION_ON_THRESH) 205 NFS_CONGESTION_ON_THRESH) {
206 set_bdi_congested(&nfss->backing_dev_info, WRITE); 206 set_bdi_congested(&nfss->backing_dev_info,
207 BLK_RW_ASYNC);
208 }
207 } 209 }
208 return ret; 210 return ret;
209} 211}
@@ -215,7 +217,7 @@ static void nfs_end_page_writeback(struct page *page)
215 217
216 end_page_writeback(page); 218 end_page_writeback(page);
217 if (atomic_long_dec_return(&nfss->writeback) < NFS_CONGESTION_OFF_THRESH) 219 if (atomic_long_dec_return(&nfss->writeback) < NFS_CONGESTION_OFF_THRESH)
218 clear_bdi_congested(&nfss->backing_dev_info, WRITE); 220 clear_bdi_congested(&nfss->backing_dev_info, BLK_RW_ASYNC);
219} 221}
220 222
221/* 223/*
diff --git a/fs/nfsd/nfsctl.c b/fs/nfsd/nfsctl.c
index 1250fb978ac1..6d0847562d87 100644
--- a/fs/nfsd/nfsctl.c
+++ b/fs/nfsd/nfsctl.c
@@ -25,7 +25,6 @@
25#include <linux/init.h> 25#include <linux/init.h>
26#include <linux/inet.h> 26#include <linux/inet.h>
27#include <linux/string.h> 27#include <linux/string.h>
28#include <linux/smp_lock.h>
29#include <linux/ctype.h> 28#include <linux/ctype.h>
30 29
31#include <linux/nfs.h> 30#include <linux/nfs.h>
diff --git a/fs/nfsd/nfssvc.c b/fs/nfsd/nfssvc.c
index d4c9884cd54b..492c79b7800b 100644
--- a/fs/nfsd/nfssvc.c
+++ b/fs/nfsd/nfssvc.c
@@ -18,7 +18,6 @@
18#include <linux/unistd.h> 18#include <linux/unistd.h>
19#include <linux/slab.h> 19#include <linux/slab.h>
20#include <linux/smp.h> 20#include <linux/smp.h>
21#include <linux/smp_lock.h>
22#include <linux/freezer.h> 21#include <linux/freezer.h>
23#include <linux/fs_struct.h> 22#include <linux/fs_struct.h>
24#include <linux/kthread.h> 23#include <linux/kthread.h>
diff --git a/fs/nfsd/vfs.c b/fs/nfsd/vfs.c
index 4145083dcf88..23341c1063bc 100644
--- a/fs/nfsd/vfs.c
+++ b/fs/nfsd/vfs.c
@@ -678,7 +678,6 @@ __be32
678nfsd_open(struct svc_rqst *rqstp, struct svc_fh *fhp, int type, 678nfsd_open(struct svc_rqst *rqstp, struct svc_fh *fhp, int type,
679 int access, struct file **filp) 679 int access, struct file **filp)
680{ 680{
681 const struct cred *cred = current_cred();
682 struct dentry *dentry; 681 struct dentry *dentry;
683 struct inode *inode; 682 struct inode *inode;
684 int flags = O_RDONLY|O_LARGEFILE; 683 int flags = O_RDONLY|O_LARGEFILE;
@@ -733,7 +732,7 @@ nfsd_open(struct svc_rqst *rqstp, struct svc_fh *fhp, int type,
733 vfs_dq_init(inode); 732 vfs_dq_init(inode);
734 } 733 }
735 *filp = dentry_open(dget(dentry), mntget(fhp->fh_export->ex_path.mnt), 734 *filp = dentry_open(dget(dentry), mntget(fhp->fh_export->ex_path.mnt),
736 flags, cred); 735 flags, current_cred());
737 if (IS_ERR(*filp)) 736 if (IS_ERR(*filp))
738 host_err = PTR_ERR(*filp); 737 host_err = PTR_ERR(*filp);
739 else 738 else
diff --git a/fs/nilfs2/Kconfig b/fs/nilfs2/Kconfig
new file mode 100644
index 000000000000..72da095d4009
--- /dev/null
+++ b/fs/nilfs2/Kconfig
@@ -0,0 +1,25 @@
1config NILFS2_FS
2 tristate "NILFS2 file system support (EXPERIMENTAL)"
3 depends on BLOCK && EXPERIMENTAL
4 select CRC32
5 help
6 NILFS2 is a log-structured file system (LFS) supporting continuous
7 snapshotting. In addition to versioning capability of the entire
8 file system, users can even restore files mistakenly overwritten or
9 destroyed just a few seconds ago. Since this file system can keep
10 consistency like conventional LFS, it achieves quick recovery after
11 system crashes.
12
13 NILFS2 creates a number of checkpoints every few seconds or per
14 synchronous write basis (unless there is no change). Users can
15 select significant versions among continuously created checkpoints,
16 and can change them into snapshots which will be preserved for long
17 periods until they are changed back to checkpoints. Each
18 snapshot is mountable as a read-only file system concurrently with
19 its writable mount, and this feature is convenient for online backup.
20
21 Some features including atime, extended attributes, and POSIX ACLs,
22 are not supported yet.
23
24 To compile this file system support as a module, choose M here: the
25 module will be called nilfs2. If unsure, say N.
diff --git a/fs/nilfs2/bmap.c b/fs/nilfs2/bmap.c
index 36df60b6d8a4..99d58a028b94 100644
--- a/fs/nilfs2/bmap.c
+++ b/fs/nilfs2/bmap.c
@@ -568,6 +568,7 @@ void nilfs_bmap_abort_update_v(struct nilfs_bmap *bmap,
568} 568}
569 569
570static struct lock_class_key nilfs_bmap_dat_lock_key; 570static struct lock_class_key nilfs_bmap_dat_lock_key;
571static struct lock_class_key nilfs_bmap_mdt_lock_key;
571 572
572/** 573/**
573 * nilfs_bmap_read - read a bmap from an inode 574 * nilfs_bmap_read - read a bmap from an inode
@@ -603,7 +604,11 @@ int nilfs_bmap_read(struct nilfs_bmap *bmap, struct nilfs_inode *raw_inode)
603 bmap->b_ptr_type = NILFS_BMAP_PTR_VS; 604 bmap->b_ptr_type = NILFS_BMAP_PTR_VS;
604 bmap->b_last_allocated_key = 0; 605 bmap->b_last_allocated_key = 0;
605 bmap->b_last_allocated_ptr = NILFS_BMAP_INVALID_PTR; 606 bmap->b_last_allocated_ptr = NILFS_BMAP_INVALID_PTR;
607 lockdep_set_class(&bmap->b_sem, &nilfs_bmap_mdt_lock_key);
606 break; 608 break;
609 case NILFS_IFILE_INO:
610 lockdep_set_class(&bmap->b_sem, &nilfs_bmap_mdt_lock_key);
611 /* Fall through */
607 default: 612 default:
608 bmap->b_ptr_type = NILFS_BMAP_PTR_VM; 613 bmap->b_ptr_type = NILFS_BMAP_PTR_VM;
609 bmap->b_last_allocated_key = 0; 614 bmap->b_last_allocated_key = 0;
diff --git a/fs/nilfs2/cpfile.c b/fs/nilfs2/cpfile.c
index 7d49813f66d6..aec942cf79e3 100644
--- a/fs/nilfs2/cpfile.c
+++ b/fs/nilfs2/cpfile.c
@@ -307,7 +307,7 @@ int nilfs_cpfile_delete_checkpoints(struct inode *cpfile,
307 ret = nilfs_cpfile_get_checkpoint_block(cpfile, cno, 0, &cp_bh); 307 ret = nilfs_cpfile_get_checkpoint_block(cpfile, cno, 0, &cp_bh);
308 if (ret < 0) { 308 if (ret < 0) {
309 if (ret != -ENOENT) 309 if (ret != -ENOENT)
310 goto out_header; 310 break;
311 /* skip hole */ 311 /* skip hole */
312 ret = 0; 312 ret = 0;
313 continue; 313 continue;
@@ -340,7 +340,7 @@ int nilfs_cpfile_delete_checkpoints(struct inode *cpfile,
340 continue; 340 continue;
341 printk(KERN_ERR "%s: cannot delete block\n", 341 printk(KERN_ERR "%s: cannot delete block\n",
342 __func__); 342 __func__);
343 goto out_header; 343 break;
344 } 344 }
345 } 345 }
346 346
@@ -358,7 +358,6 @@ int nilfs_cpfile_delete_checkpoints(struct inode *cpfile,
358 kunmap_atomic(kaddr, KM_USER0); 358 kunmap_atomic(kaddr, KM_USER0);
359 } 359 }
360 360
361 out_header:
362 brelse(header_bh); 361 brelse(header_bh);
363 362
364 out_sem: 363 out_sem:
diff --git a/fs/nilfs2/dat.c b/fs/nilfs2/dat.c
index 0b2710e2d565..8927ca27e6f7 100644
--- a/fs/nilfs2/dat.c
+++ b/fs/nilfs2/dat.c
@@ -134,15 +134,6 @@ void nilfs_dat_commit_start(struct inode *dat, struct nilfs_palloc_req *req,
134 entry = nilfs_palloc_block_get_entry(dat, req->pr_entry_nr, 134 entry = nilfs_palloc_block_get_entry(dat, req->pr_entry_nr,
135 req->pr_entry_bh, kaddr); 135 req->pr_entry_bh, kaddr);
136 entry->de_start = cpu_to_le64(nilfs_mdt_cno(dat)); 136 entry->de_start = cpu_to_le64(nilfs_mdt_cno(dat));
137 if (entry->de_blocknr != cpu_to_le64(0) ||
138 entry->de_end != cpu_to_le64(NILFS_CNO_MAX)) {
139 printk(KERN_CRIT
140 "%s: vbn = %llu, start = %llu, end = %llu, pbn = %llu\n",
141 __func__, (unsigned long long)req->pr_entry_nr,
142 (unsigned long long)le64_to_cpu(entry->de_start),
143 (unsigned long long)le64_to_cpu(entry->de_end),
144 (unsigned long long)le64_to_cpu(entry->de_blocknr));
145 }
146 entry->de_blocknr = cpu_to_le64(blocknr); 137 entry->de_blocknr = cpu_to_le64(blocknr);
147 kunmap_atomic(kaddr, KM_USER0); 138 kunmap_atomic(kaddr, KM_USER0);
148 139
diff --git a/fs/nilfs2/dir.c b/fs/nilfs2/dir.c
index 54100acc1102..1a4fa04cf071 100644
--- a/fs/nilfs2/dir.c
+++ b/fs/nilfs2/dir.c
@@ -43,7 +43,6 @@
43 */ 43 */
44 44
45#include <linux/pagemap.h> 45#include <linux/pagemap.h>
46#include <linux/smp_lock.h>
47#include "nilfs.h" 46#include "nilfs.h"
48#include "page.h" 47#include "page.h"
49 48
diff --git a/fs/nilfs2/mdt.c b/fs/nilfs2/mdt.c
index 3d3ddb3f5177..2dfd47714ae5 100644
--- a/fs/nilfs2/mdt.c
+++ b/fs/nilfs2/mdt.c
@@ -412,8 +412,10 @@ nilfs_mdt_write_page(struct page *page, struct writeback_control *wbc)
412 return 0; /* Do not request flush for shadow page cache */ 412 return 0; /* Do not request flush for shadow page cache */
413 if (!sb) { 413 if (!sb) {
414 writer = nilfs_get_writer(NILFS_MDT(inode)->mi_nilfs); 414 writer = nilfs_get_writer(NILFS_MDT(inode)->mi_nilfs);
415 if (!writer) 415 if (!writer) {
416 nilfs_put_writer(NILFS_MDT(inode)->mi_nilfs);
416 return -EROFS; 417 return -EROFS;
418 }
417 sb = writer->s_super; 419 sb = writer->s_super;
418 } 420 }
419 421
diff --git a/fs/nilfs2/segment.c b/fs/nilfs2/segment.c
index aa977549919e..51ff3d0a4ee2 100644
--- a/fs/nilfs2/segment.c
+++ b/fs/nilfs2/segment.c
@@ -1829,26 +1829,13 @@ static int nilfs_segctor_write(struct nilfs_sc_info *sci,
1829 err = nilfs_segbuf_write(segbuf, &wi); 1829 err = nilfs_segbuf_write(segbuf, &wi);
1830 1830
1831 res = nilfs_segbuf_wait(segbuf, &wi); 1831 res = nilfs_segbuf_wait(segbuf, &wi);
1832 err = unlikely(err) ? : res; 1832 err = err ? : res;
1833 if (unlikely(err)) 1833 if (err)
1834 return err; 1834 return err;
1835 } 1835 }
1836 return 0; 1836 return 0;
1837} 1837}
1838 1838
1839static int nilfs_page_has_uncleared_buffer(struct page *page)
1840{
1841 struct buffer_head *head, *bh;
1842
1843 head = bh = page_buffers(page);
1844 do {
1845 if (buffer_dirty(bh) && !list_empty(&bh->b_assoc_buffers))
1846 return 1;
1847 bh = bh->b_this_page;
1848 } while (bh != head);
1849 return 0;
1850}
1851
1852static void __nilfs_end_page_io(struct page *page, int err) 1839static void __nilfs_end_page_io(struct page *page, int err)
1853{ 1840{
1854 if (!err) { 1841 if (!err) {
@@ -1872,13 +1859,26 @@ static void nilfs_end_page_io(struct page *page, int err)
1872 if (!page) 1859 if (!page)
1873 return; 1860 return;
1874 1861
1875 if (buffer_nilfs_node(page_buffers(page)) && 1862 if (buffer_nilfs_node(page_buffers(page)) && !PageWriteback(page)) {
1876 nilfs_page_has_uncleared_buffer(page)) 1863 /*
1877 /* For b-tree node pages, this function may be called twice 1864 * For b-tree node pages, this function may be called twice
1878 or more because they might be split in a segment. 1865 * or more because they might be split in a segment.
1879 This check assures that cleanup has been done for all 1866 */
1880 buffers in a split btnode page. */ 1867 if (PageDirty(page)) {
1868 /*
1869 * For pages holding split b-tree node buffers, dirty
1870 * flag on the buffers may be cleared discretely.
1871 * In that case, the page is once redirtied for
1872 * remaining buffers, and it must be cancelled if
1873 * all the buffers get cleaned later.
1874 */
1875 lock_page(page);
1876 if (nilfs_page_buffers_clean(page))
1877 __nilfs_clear_page_dirty(page);
1878 unlock_page(page);
1879 }
1881 return; 1880 return;
1881 }
1882 1882
1883 __nilfs_end_page_io(page, err); 1883 __nilfs_end_page_io(page, err);
1884} 1884}
@@ -1940,7 +1940,7 @@ static void nilfs_segctor_abort_write(struct nilfs_sc_info *sci,
1940 } 1940 }
1941 if (bh->b_page != fs_page) { 1941 if (bh->b_page != fs_page) {
1942 nilfs_end_page_io(fs_page, err); 1942 nilfs_end_page_io(fs_page, err);
1943 if (unlikely(fs_page == failed_page)) 1943 if (fs_page && fs_page == failed_page)
1944 goto done; 1944 goto done;
1945 fs_page = bh->b_page; 1945 fs_page = bh->b_page;
1946 } 1946 }
diff --git a/fs/notify/Kconfig b/fs/notify/Kconfig
index 31dac7e3b0f1..dffbb0911d02 100644
--- a/fs/notify/Kconfig
+++ b/fs/notify/Kconfig
@@ -1,15 +1,5 @@
1config FSNOTIFY 1config FSNOTIFY
2 bool "Filesystem notification backend" 2 def_bool n
3 default y
4 ---help---
5 fsnotify is a backend for filesystem notification. fsnotify does
6 not provide any userspace interface but does provide the basis
7 needed for other notification schemes such as dnotify, inotify,
8 and fanotify.
9
10 Say Y here to enable fsnotify suport.
11
12 If unsure, say Y.
13 3
14source "fs/notify/dnotify/Kconfig" 4source "fs/notify/dnotify/Kconfig"
15source "fs/notify/inotify/Kconfig" 5source "fs/notify/inotify/Kconfig"
diff --git a/fs/notify/dnotify/Kconfig b/fs/notify/dnotify/Kconfig
index 904ff8d5405a..f9c1ca139d8f 100644
--- a/fs/notify/dnotify/Kconfig
+++ b/fs/notify/dnotify/Kconfig
@@ -1,6 +1,6 @@
1config DNOTIFY 1config DNOTIFY
2 bool "Dnotify support" 2 bool "Dnotify support"
3 depends on FSNOTIFY 3 select FSNOTIFY
4 default y 4 default y
5 help 5 help
6 Dnotify is a directory-based per-fd file change notification system 6 Dnotify is a directory-based per-fd file change notification system
diff --git a/fs/notify/fsnotify.c b/fs/notify/fsnotify.c
index ec2f7bd76818..037e878e03fc 100644
--- a/fs/notify/fsnotify.c
+++ b/fs/notify/fsnotify.c
@@ -159,7 +159,9 @@ void fsnotify(struct inode *to_tell, __u32 mask, void *data, int data_is, const
159 if (!group->ops->should_send_event(group, to_tell, mask)) 159 if (!group->ops->should_send_event(group, to_tell, mask))
160 continue; 160 continue;
161 if (!event) { 161 if (!event) {
162 event = fsnotify_create_event(to_tell, mask, data, data_is, file_name, cookie); 162 event = fsnotify_create_event(to_tell, mask, data,
163 data_is, file_name, cookie,
164 GFP_KERNEL);
163 /* shit, we OOM'd and now we can't tell, maybe 165 /* shit, we OOM'd and now we can't tell, maybe
164 * someday someone else will want to do something 166 * someday someone else will want to do something
165 * here */ 167 * here */
diff --git a/fs/notify/inotify/Kconfig b/fs/notify/inotify/Kconfig
index 5356884289a1..3e56dbffe729 100644
--- a/fs/notify/inotify/Kconfig
+++ b/fs/notify/inotify/Kconfig
@@ -15,7 +15,7 @@ config INOTIFY
15 15
16config INOTIFY_USER 16config INOTIFY_USER
17 bool "Inotify support for userspace" 17 bool "Inotify support for userspace"
18 depends on FSNOTIFY 18 select FSNOTIFY
19 default y 19 default y
20 ---help--- 20 ---help---
21 Say Y here to enable inotify support for userspace, including the 21 Say Y here to enable inotify support for userspace, including the
diff --git a/fs/notify/inotify/inotify_user.c b/fs/notify/inotify/inotify_user.c
index ff231ad23895..f30d9bbc2e1b 100644
--- a/fs/notify/inotify/inotify_user.c
+++ b/fs/notify/inotify/inotify_user.c
@@ -57,7 +57,6 @@ int inotify_max_user_watches __read_mostly;
57 57
58static struct kmem_cache *inotify_inode_mark_cachep __read_mostly; 58static struct kmem_cache *inotify_inode_mark_cachep __read_mostly;
59struct kmem_cache *event_priv_cachep __read_mostly; 59struct kmem_cache *event_priv_cachep __read_mostly;
60static struct fsnotify_event *inotify_ignored_event;
61 60
62/* 61/*
63 * When inotify registers a new group it increments this and uses that 62 * When inotify registers a new group it increments this and uses that
@@ -296,12 +295,15 @@ static int inotify_fasync(int fd, struct file *file, int on)
296static int inotify_release(struct inode *ignored, struct file *file) 295static int inotify_release(struct inode *ignored, struct file *file)
297{ 296{
298 struct fsnotify_group *group = file->private_data; 297 struct fsnotify_group *group = file->private_data;
298 struct user_struct *user = group->inotify_data.user;
299 299
300 fsnotify_clear_marks_by_group(group); 300 fsnotify_clear_marks_by_group(group);
301 301
302 /* free this group, matching get was inotify_init->fsnotify_obtain_group */ 302 /* free this group, matching get was inotify_init->fsnotify_obtain_group */
303 fsnotify_put_group(group); 303 fsnotify_put_group(group);
304 304
305 atomic_dec(&user->inotify_devs);
306
305 return 0; 307 return 0;
306} 308}
307 309
@@ -362,6 +364,17 @@ static int inotify_find_inode(const char __user *dirname, struct path *path, uns
362 return error; 364 return error;
363} 365}
364 366
367static void inotify_remove_from_idr(struct fsnotify_group *group,
368 struct inotify_inode_mark_entry *ientry)
369{
370 struct idr *idr;
371
372 spin_lock(&group->inotify_data.idr_lock);
373 idr = &group->inotify_data.idr;
374 idr_remove(idr, ientry->wd);
375 spin_unlock(&group->inotify_data.idr_lock);
376 ientry->wd = -1;
377}
365/* 378/*
366 * Send IN_IGNORED for this wd, remove this wd from the idr, and drop the 379 * Send IN_IGNORED for this wd, remove this wd from the idr, and drop the
367 * internal reference help on the mark because it is in the idr. 380 * internal reference help on the mark because it is in the idr.
@@ -370,13 +383,19 @@ void inotify_ignored_and_remove_idr(struct fsnotify_mark_entry *entry,
370 struct fsnotify_group *group) 383 struct fsnotify_group *group)
371{ 384{
372 struct inotify_inode_mark_entry *ientry; 385 struct inotify_inode_mark_entry *ientry;
386 struct fsnotify_event *ignored_event;
373 struct inotify_event_private_data *event_priv; 387 struct inotify_event_private_data *event_priv;
374 struct fsnotify_event_private_data *fsn_event_priv; 388 struct fsnotify_event_private_data *fsn_event_priv;
375 struct idr *idr; 389
390 ignored_event = fsnotify_create_event(NULL, FS_IN_IGNORED, NULL,
391 FSNOTIFY_EVENT_NONE, NULL, 0,
392 GFP_NOFS);
393 if (!ignored_event)
394 return;
376 395
377 ientry = container_of(entry, struct inotify_inode_mark_entry, fsn_entry); 396 ientry = container_of(entry, struct inotify_inode_mark_entry, fsn_entry);
378 397
379 event_priv = kmem_cache_alloc(event_priv_cachep, GFP_KERNEL); 398 event_priv = kmem_cache_alloc(event_priv_cachep, GFP_NOFS);
380 if (unlikely(!event_priv)) 399 if (unlikely(!event_priv))
381 goto skip_send_ignore; 400 goto skip_send_ignore;
382 401
@@ -385,7 +404,7 @@ void inotify_ignored_and_remove_idr(struct fsnotify_mark_entry *entry,
385 fsn_event_priv->group = group; 404 fsn_event_priv->group = group;
386 event_priv->wd = ientry->wd; 405 event_priv->wd = ientry->wd;
387 406
388 fsnotify_add_notify_event(group, inotify_ignored_event, fsn_event_priv); 407 fsnotify_add_notify_event(group, ignored_event, fsn_event_priv);
389 408
390 /* did the private data get added? */ 409 /* did the private data get added? */
391 if (list_empty(&fsn_event_priv->event_list)) 410 if (list_empty(&fsn_event_priv->event_list))
@@ -393,14 +412,16 @@ void inotify_ignored_and_remove_idr(struct fsnotify_mark_entry *entry,
393 412
394skip_send_ignore: 413skip_send_ignore:
395 414
415 /* matches the reference taken when the event was created */
416 fsnotify_put_event(ignored_event);
417
396 /* remove this entry from the idr */ 418 /* remove this entry from the idr */
397 spin_lock(&group->inotify_data.idr_lock); 419 inotify_remove_from_idr(group, ientry);
398 idr = &group->inotify_data.idr;
399 idr_remove(idr, ientry->wd);
400 spin_unlock(&group->inotify_data.idr_lock);
401 420
402 /* removed from idr, drop that reference */ 421 /* removed from idr, drop that reference */
403 fsnotify_put_mark(entry); 422 fsnotify_put_mark(entry);
423
424 atomic_dec(&group->inotify_data.user->inotify_watches);
404} 425}
405 426
406/* ding dong the mark is dead */ 427/* ding dong the mark is dead */
@@ -415,6 +436,7 @@ static int inotify_update_watch(struct fsnotify_group *group, struct inode *inod
415{ 436{
416 struct fsnotify_mark_entry *entry = NULL; 437 struct fsnotify_mark_entry *entry = NULL;
417 struct inotify_inode_mark_entry *ientry; 438 struct inotify_inode_mark_entry *ientry;
439 struct inotify_inode_mark_entry *tmp_ientry;
418 int ret = 0; 440 int ret = 0;
419 int add = (arg & IN_MASK_ADD); 441 int add = (arg & IN_MASK_ADD);
420 __u32 mask; 442 __u32 mask;
@@ -425,54 +447,66 @@ static int inotify_update_watch(struct fsnotify_group *group, struct inode *inod
425 if (unlikely(!mask)) 447 if (unlikely(!mask))
426 return -EINVAL; 448 return -EINVAL;
427 449
428 ientry = kmem_cache_alloc(inotify_inode_mark_cachep, GFP_KERNEL); 450 tmp_ientry = kmem_cache_alloc(inotify_inode_mark_cachep, GFP_KERNEL);
429 if (unlikely(!ientry)) 451 if (unlikely(!tmp_ientry))
430 return -ENOMEM; 452 return -ENOMEM;
431 /* we set the mask at the end after attaching it */ 453 /* we set the mask at the end after attaching it */
432 fsnotify_init_mark(&ientry->fsn_entry, inotify_free_mark); 454 fsnotify_init_mark(&tmp_ientry->fsn_entry, inotify_free_mark);
433 ientry->wd = 0; 455 tmp_ientry->wd = -1;
434 456
435find_entry: 457find_entry:
436 spin_lock(&inode->i_lock); 458 spin_lock(&inode->i_lock);
437 entry = fsnotify_find_mark_entry(group, inode); 459 entry = fsnotify_find_mark_entry(group, inode);
438 spin_unlock(&inode->i_lock); 460 spin_unlock(&inode->i_lock);
439 if (entry) { 461 if (entry) {
440 kmem_cache_free(inotify_inode_mark_cachep, ientry);
441 ientry = container_of(entry, struct inotify_inode_mark_entry, fsn_entry); 462 ientry = container_of(entry, struct inotify_inode_mark_entry, fsn_entry);
442 } else { 463 } else {
443 if (atomic_read(&group->inotify_data.user->inotify_watches) >= inotify_max_user_watches) { 464 ret = -ENOSPC;
444 ret = -ENOSPC; 465 if (atomic_read(&group->inotify_data.user->inotify_watches) >= inotify_max_user_watches)
445 goto out_err; 466 goto out_err;
446 }
447
448 ret = fsnotify_add_mark(&ientry->fsn_entry, group, inode);
449 if (ret == -EEXIST)
450 goto find_entry;
451 else if (ret)
452 goto out_err;
453
454 entry = &ientry->fsn_entry;
455retry: 467retry:
456 ret = -ENOMEM; 468 ret = -ENOMEM;
457 if (unlikely(!idr_pre_get(&group->inotify_data.idr, GFP_KERNEL))) 469 if (unlikely(!idr_pre_get(&group->inotify_data.idr, GFP_KERNEL)))
458 goto out_err; 470 goto out_err;
459 471
460 spin_lock(&group->inotify_data.idr_lock); 472 spin_lock(&group->inotify_data.idr_lock);
461 /* if entry is added to the idr we keep the reference obtained 473 ret = idr_get_new_above(&group->inotify_data.idr, &tmp_ientry->fsn_entry,
462 * through fsnotify_mark_add. remember to drop this reference 474 group->inotify_data.last_wd,
463 * when entry is removed from idr */ 475 &tmp_ientry->wd);
464 ret = idr_get_new_above(&group->inotify_data.idr, entry,
465 ++group->inotify_data.last_wd,
466 &ientry->wd);
467 spin_unlock(&group->inotify_data.idr_lock); 476 spin_unlock(&group->inotify_data.idr_lock);
468 if (ret) { 477 if (ret) {
469 if (ret == -EAGAIN) 478 if (ret == -EAGAIN)
470 goto retry; 479 goto retry;
471 goto out_err; 480 goto out_err;
472 } 481 }
482
483 ret = fsnotify_add_mark(&tmp_ientry->fsn_entry, group, inode);
484 if (ret) {
485 inotify_remove_from_idr(group, tmp_ientry);
486 if (ret == -EEXIST)
487 goto find_entry;
488 goto out_err;
489 }
490
491 /* tmp_ientry has been added to the inode, so we are all set up.
492 * now we just need to make sure tmp_ientry doesn't get freed and
493 * we need to set up entry and ientry so the generic code can
494 * do its thing. */
495 ientry = tmp_ientry;
496 entry = &ientry->fsn_entry;
497 tmp_ientry = NULL;
498
473 atomic_inc(&group->inotify_data.user->inotify_watches); 499 atomic_inc(&group->inotify_data.user->inotify_watches);
500
501 /* update the idr hint */
502 group->inotify_data.last_wd = ientry->wd;
503
504 /* we put the mark on the idr, take a reference */
505 fsnotify_get_mark(entry);
474 } 506 }
475 507
508 ret = ientry->wd;
509
476 spin_lock(&entry->lock); 510 spin_lock(&entry->lock);
477 511
478 old_mask = entry->mask; 512 old_mask = entry->mask;
@@ -503,14 +537,19 @@ retry:
503 fsnotify_recalc_group_mask(group); 537 fsnotify_recalc_group_mask(group);
504 } 538 }
505 539
506 return ientry->wd; 540 /* this either matches fsnotify_find_mark_entry, or init_mark_entry
541 * depending on which path we took... */
542 fsnotify_put_mark(entry);
507 543
508out_err: 544out_err:
509 /* see this isn't supposed to happen, just kill the watch */ 545 /* could be an error, could be that we found an existing mark */
510 if (entry) { 546 if (tmp_ientry) {
511 fsnotify_destroy_mark_by_entry(entry); 547 /* on the idr but didn't make it on the inode */
512 fsnotify_put_mark(entry); 548 if (tmp_ientry->wd != -1)
549 inotify_remove_from_idr(group, tmp_ientry);
550 kmem_cache_free(inotify_inode_mark_cachep, tmp_ientry);
513 } 551 }
552
514 return ret; 553 return ret;
515} 554}
516 555
@@ -718,9 +757,6 @@ static int __init inotify_user_setup(void)
718 757
719 inotify_inode_mark_cachep = KMEM_CACHE(inotify_inode_mark_entry, SLAB_PANIC); 758 inotify_inode_mark_cachep = KMEM_CACHE(inotify_inode_mark_entry, SLAB_PANIC);
720 event_priv_cachep = KMEM_CACHE(inotify_event_private_data, SLAB_PANIC); 759 event_priv_cachep = KMEM_CACHE(inotify_event_private_data, SLAB_PANIC);
721 inotify_ignored_event = fsnotify_create_event(NULL, FS_IN_IGNORED, NULL, FSNOTIFY_EVENT_NONE, NULL, 0);
722 if (!inotify_ignored_event)
723 panic("unable to allocate the inotify ignored event\n");
724 760
725 inotify_max_queued_events = 16384; 761 inotify_max_queued_events = 16384;
726 inotify_max_user_instances = 128; 762 inotify_max_user_instances = 128;
diff --git a/fs/notify/notification.c b/fs/notify/notification.c
index 959b73e756fd..521368574e97 100644
--- a/fs/notify/notification.c
+++ b/fs/notify/notification.c
@@ -136,18 +136,24 @@ static bool event_compare(struct fsnotify_event *old, struct fsnotify_event *new
136{ 136{
137 if ((old->mask == new->mask) && 137 if ((old->mask == new->mask) &&
138 (old->to_tell == new->to_tell) && 138 (old->to_tell == new->to_tell) &&
139 (old->data_type == new->data_type)) { 139 (old->data_type == new->data_type) &&
140 (old->name_len == new->name_len)) {
140 switch (old->data_type) { 141 switch (old->data_type) {
141 case (FSNOTIFY_EVENT_INODE): 142 case (FSNOTIFY_EVENT_INODE):
142 if (old->inode == new->inode) 143 /* remember, after old was put on the wait_q we aren't
144 * allowed to look at the inode any more, only thing
145 * left to check was if the file_name is the same */
146 if (old->name_len &&
147 !strcmp(old->file_name, new->file_name))
143 return true; 148 return true;
144 break; 149 break;
145 case (FSNOTIFY_EVENT_PATH): 150 case (FSNOTIFY_EVENT_PATH):
146 if ((old->path.mnt == new->path.mnt) && 151 if ((old->path.mnt == new->path.mnt) &&
147 (old->path.dentry == new->path.dentry)) 152 (old->path.dentry == new->path.dentry))
148 return true; 153 return true;
154 break;
149 case (FSNOTIFY_EVENT_NONE): 155 case (FSNOTIFY_EVENT_NONE):
150 return true; 156 return false;
151 }; 157 };
152 } 158 }
153 return false; 159 return false;
@@ -339,18 +345,19 @@ static void initialize_event(struct fsnotify_event *event)
339 * @name the filename, if available 345 * @name the filename, if available
340 */ 346 */
341struct fsnotify_event *fsnotify_create_event(struct inode *to_tell, __u32 mask, void *data, 347struct fsnotify_event *fsnotify_create_event(struct inode *to_tell, __u32 mask, void *data,
342 int data_type, const char *name, u32 cookie) 348 int data_type, const char *name, u32 cookie,
349 gfp_t gfp)
343{ 350{
344 struct fsnotify_event *event; 351 struct fsnotify_event *event;
345 352
346 event = kmem_cache_alloc(fsnotify_event_cachep, GFP_KERNEL); 353 event = kmem_cache_alloc(fsnotify_event_cachep, gfp);
347 if (!event) 354 if (!event)
348 return NULL; 355 return NULL;
349 356
350 initialize_event(event); 357 initialize_event(event);
351 358
352 if (name) { 359 if (name) {
353 event->file_name = kstrdup(name, GFP_KERNEL); 360 event->file_name = kstrdup(name, gfp);
354 if (!event->file_name) { 361 if (!event->file_name) {
355 kmem_cache_free(fsnotify_event_cachep, event); 362 kmem_cache_free(fsnotify_event_cachep, event);
356 return NULL; 363 return NULL;
diff --git a/fs/ocfs2/ioctl.c b/fs/ocfs2/ioctl.c
index 9fcd36dcc9a0..467b413bec21 100644
--- a/fs/ocfs2/ioctl.c
+++ b/fs/ocfs2/ioctl.c
@@ -7,7 +7,6 @@
7 7
8#include <linux/fs.h> 8#include <linux/fs.h>
9#include <linux/mount.h> 9#include <linux/mount.h>
10#include <linux/smp_lock.h>
11 10
12#define MLOG_MASK_PREFIX ML_INODE 11#define MLOG_MASK_PREFIX ML_INODE
13#include <cluster/masklog.h> 12#include <cluster/masklog.h>
diff --git a/fs/partitions/check.c b/fs/partitions/check.c
index 1a9c7878f864..ea4e6cb29e13 100644
--- a/fs/partitions/check.c
+++ b/fs/partitions/check.c
@@ -436,7 +436,7 @@ struct hd_struct *add_partition(struct gendisk *disk, int partno,
436 rcu_assign_pointer(ptbl->part[partno], p); 436 rcu_assign_pointer(ptbl->part[partno], p);
437 437
438 /* suppress uevent if the disk supresses it */ 438 /* suppress uevent if the disk supresses it */
439 if (!dev_get_uevent_suppress(pdev)) 439 if (!dev_get_uevent_suppress(ddev))
440 kobject_uevent(&pdev->kobj, KOBJ_ADD); 440 kobject_uevent(&pdev->kobj, KOBJ_ADD);
441 441
442 return p; 442 return p;
diff --git a/fs/pipe.c b/fs/pipe.c
index f7dd21ad85a6..52c415114838 100644
--- a/fs/pipe.c
+++ b/fs/pipe.c
@@ -68,8 +68,8 @@ void pipe_double_lock(struct pipe_inode_info *pipe1,
68 pipe_lock_nested(pipe1, I_MUTEX_PARENT); 68 pipe_lock_nested(pipe1, I_MUTEX_PARENT);
69 pipe_lock_nested(pipe2, I_MUTEX_CHILD); 69 pipe_lock_nested(pipe2, I_MUTEX_CHILD);
70 } else { 70 } else {
71 pipe_lock_nested(pipe2, I_MUTEX_CHILD); 71 pipe_lock_nested(pipe2, I_MUTEX_PARENT);
72 pipe_lock_nested(pipe1, I_MUTEX_PARENT); 72 pipe_lock_nested(pipe1, I_MUTEX_CHILD);
73 } 73 }
74} 74}
75 75
diff --git a/fs/quota/dquot.c b/fs/quota/dquot.c
index 607c579e5eca..38f7bd559f35 100644
--- a/fs/quota/dquot.c
+++ b/fs/quota/dquot.c
@@ -2042,7 +2042,6 @@ static int vfs_load_quota_inode(struct inode *inode, int type, int format_id,
2042 * changes */ 2042 * changes */
2043 invalidate_bdev(sb->s_bdev); 2043 invalidate_bdev(sb->s_bdev);
2044 } 2044 }
2045 mutex_lock(&inode->i_mutex);
2046 mutex_lock(&dqopt->dqonoff_mutex); 2045 mutex_lock(&dqopt->dqonoff_mutex);
2047 if (sb_has_quota_loaded(sb, type)) { 2046 if (sb_has_quota_loaded(sb, type)) {
2048 error = -EBUSY; 2047 error = -EBUSY;
@@ -2054,9 +2053,11 @@ static int vfs_load_quota_inode(struct inode *inode, int type, int format_id,
2054 * possible) Also nobody should write to the file - we use 2053 * possible) Also nobody should write to the file - we use
2055 * special IO operations which ignore the immutable bit. */ 2054 * special IO operations which ignore the immutable bit. */
2056 down_write(&dqopt->dqptr_sem); 2055 down_write(&dqopt->dqptr_sem);
2056 mutex_lock_nested(&inode->i_mutex, I_MUTEX_QUOTA);
2057 oldflags = inode->i_flags & (S_NOATIME | S_IMMUTABLE | 2057 oldflags = inode->i_flags & (S_NOATIME | S_IMMUTABLE |
2058 S_NOQUOTA); 2058 S_NOQUOTA);
2059 inode->i_flags |= S_NOQUOTA | S_NOATIME | S_IMMUTABLE; 2059 inode->i_flags |= S_NOQUOTA | S_NOATIME | S_IMMUTABLE;
2060 mutex_unlock(&inode->i_mutex);
2060 up_write(&dqopt->dqptr_sem); 2061 up_write(&dqopt->dqptr_sem);
2061 sb->dq_op->drop(inode); 2062 sb->dq_op->drop(inode);
2062 } 2063 }
@@ -2080,7 +2081,6 @@ static int vfs_load_quota_inode(struct inode *inode, int type, int format_id,
2080 goto out_file_init; 2081 goto out_file_init;
2081 } 2082 }
2082 mutex_unlock(&dqopt->dqio_mutex); 2083 mutex_unlock(&dqopt->dqio_mutex);
2083 mutex_unlock(&inode->i_mutex);
2084 spin_lock(&dq_state_lock); 2084 spin_lock(&dq_state_lock);
2085 dqopt->flags |= dquot_state_flag(flags, type); 2085 dqopt->flags |= dquot_state_flag(flags, type);
2086 spin_unlock(&dq_state_lock); 2086 spin_unlock(&dq_state_lock);
@@ -2094,16 +2094,17 @@ out_file_init:
2094 dqopt->files[type] = NULL; 2094 dqopt->files[type] = NULL;
2095 iput(inode); 2095 iput(inode);
2096out_lock: 2096out_lock:
2097 mutex_unlock(&dqopt->dqonoff_mutex);
2098 if (oldflags != -1) { 2097 if (oldflags != -1) {
2099 down_write(&dqopt->dqptr_sem); 2098 down_write(&dqopt->dqptr_sem);
2099 mutex_lock_nested(&inode->i_mutex, I_MUTEX_QUOTA);
2100 /* Set the flags back (in the case of accidental quotaon() 2100 /* Set the flags back (in the case of accidental quotaon()
2101 * on a wrong file we don't want to mess up the flags) */ 2101 * on a wrong file we don't want to mess up the flags) */
2102 inode->i_flags &= ~(S_NOATIME | S_NOQUOTA | S_IMMUTABLE); 2102 inode->i_flags &= ~(S_NOATIME | S_NOQUOTA | S_IMMUTABLE);
2103 inode->i_flags |= oldflags; 2103 inode->i_flags |= oldflags;
2104 mutex_unlock(&inode->i_mutex);
2104 up_write(&dqopt->dqptr_sem); 2105 up_write(&dqopt->dqptr_sem);
2105 } 2106 }
2106 mutex_unlock(&inode->i_mutex); 2107 mutex_unlock(&dqopt->dqonoff_mutex);
2107out_fmt: 2108out_fmt:
2108 put_quota_format(fmt); 2109 put_quota_format(fmt);
2109 2110
diff --git a/fs/ramfs/file-nommu.c b/fs/ramfs/file-nommu.c
index ebb2c417912c..11f0c06316de 100644
--- a/fs/ramfs/file-nommu.c
+++ b/fs/ramfs/file-nommu.c
@@ -20,6 +20,7 @@
20#include <linux/ramfs.h> 20#include <linux/ramfs.h>
21#include <linux/pagevec.h> 21#include <linux/pagevec.h>
22#include <linux/mman.h> 22#include <linux/mman.h>
23#include <linux/sched.h>
23 24
24#include <asm/uaccess.h> 25#include <asm/uaccess.h>
25#include "internal.h" 26#include "internal.h"
diff --git a/fs/reiserfs/journal.c b/fs/reiserfs/journal.c
index 77f5bb746bf0..90622200b39c 100644
--- a/fs/reiserfs/journal.c
+++ b/fs/reiserfs/journal.c
@@ -997,7 +997,7 @@ static int reiserfs_async_progress_wait(struct super_block *s)
997 DEFINE_WAIT(wait); 997 DEFINE_WAIT(wait);
998 struct reiserfs_journal *j = SB_JOURNAL(s); 998 struct reiserfs_journal *j = SB_JOURNAL(s);
999 if (atomic_read(&j->j_async_throttle)) 999 if (atomic_read(&j->j_async_throttle))
1000 congestion_wait(WRITE, HZ / 10); 1000 congestion_wait(BLK_RW_ASYNC, HZ / 10);
1001 return 0; 1001 return 0;
1002} 1002}
1003 1003
diff --git a/fs/reiserfs/super.c b/fs/reiserfs/super.c
index d3aeb061612b..7adea74d6a8a 100644
--- a/fs/reiserfs/super.c
+++ b/fs/reiserfs/super.c
@@ -24,7 +24,6 @@
24#include <linux/exportfs.h> 24#include <linux/exportfs.h>
25#include <linux/quotaops.h> 25#include <linux/quotaops.h>
26#include <linux/vfs.h> 26#include <linux/vfs.h>
27#include <linux/mnt_namespace.h>
28#include <linux/mount.h> 27#include <linux/mount.h>
29#include <linux/namei.h> 28#include <linux/namei.h>
30#include <linux/crc32.h> 29#include <linux/crc32.h>
diff --git a/fs/reiserfs/xattr.c b/fs/reiserfs/xattr.c
index f3d47d856848..6925b835a43b 100644
--- a/fs/reiserfs/xattr.c
+++ b/fs/reiserfs/xattr.c
@@ -46,7 +46,6 @@
46#include <linux/reiserfs_acl.h> 46#include <linux/reiserfs_acl.h>
47#include <asm/uaccess.h> 47#include <asm/uaccess.h>
48#include <net/checksum.h> 48#include <net/checksum.h>
49#include <linux/smp_lock.h>
50#include <linux/stat.h> 49#include <linux/stat.h>
51#include <linux/quotaops.h> 50#include <linux/quotaops.h>
52 51
diff --git a/fs/squashfs/super.c b/fs/squashfs/super.c
index 3b52770f46ff..cb5fc57e370b 100644
--- a/fs/squashfs/super.c
+++ b/fs/squashfs/super.c
@@ -30,6 +30,7 @@
30#include <linux/fs.h> 30#include <linux/fs.h>
31#include <linux/vfs.h> 31#include <linux/vfs.h>
32#include <linux/slab.h> 32#include <linux/slab.h>
33#include <linux/smp_lock.h>
33#include <linux/mutex.h> 34#include <linux/mutex.h>
34#include <linux/pagemap.h> 35#include <linux/pagemap.h>
35#include <linux/init.h> 36#include <linux/init.h>
diff --git a/fs/sync.c b/fs/sync.c
index dd200025af85..3422ba61d86d 100644
--- a/fs/sync.c
+++ b/fs/sync.c
@@ -112,8 +112,13 @@ restart:
112 mutex_unlock(&mutex); 112 mutex_unlock(&mutex);
113} 113}
114 114
115/*
116 * sync everything. Start out by waking pdflush, because that writes back
117 * all queues in parallel.
118 */
115SYSCALL_DEFINE0(sync) 119SYSCALL_DEFINE0(sync)
116{ 120{
121 wakeup_pdflush(0);
117 sync_filesystems(0); 122 sync_filesystems(0);
118 sync_filesystems(1); 123 sync_filesystems(1);
119 if (unlikely(laptop_mode)) 124 if (unlikely(laptop_mode))
diff --git a/fs/sysfs/bin.c b/fs/sysfs/bin.c
index 9345806c8853..2524714bece1 100644
--- a/fs/sysfs/bin.c
+++ b/fs/sysfs/bin.c
@@ -171,6 +171,7 @@ static ssize_t write(struct file *file, const char __user *userbuf,
171 if (count > 0) 171 if (count > 0)
172 *off = offs + count; 172 *off = offs + count;
173 173
174 kfree(temp);
174 return count; 175 return count;
175} 176}
176 177
diff --git a/fs/sysfs/dir.c b/fs/sysfs/dir.c
index d88d0fac9fa5..14f2d71ea3ce 100644
--- a/fs/sysfs/dir.c
+++ b/fs/sysfs/dir.c
@@ -939,8 +939,10 @@ again:
939 /* Remove from old parent's list and insert into new parent's list. */ 939 /* Remove from old parent's list and insert into new parent's list. */
940 sysfs_unlink_sibling(sd); 940 sysfs_unlink_sibling(sd);
941 sysfs_get(new_parent_sd); 941 sysfs_get(new_parent_sd);
942 drop_nlink(old_parent->d_inode);
942 sysfs_put(sd->s_parent); 943 sysfs_put(sd->s_parent);
943 sd->s_parent = new_parent_sd; 944 sd->s_parent = new_parent_sd;
945 inc_nlink(new_parent->d_inode);
944 sysfs_link_sibling(sd); 946 sysfs_link_sibling(sd);
945 947
946 out_unlock: 948 out_unlock:
diff --git a/fs/ubifs/io.c b/fs/ubifs/io.c
index bc5857199ec2..762a7d6cec73 100644
--- a/fs/ubifs/io.c
+++ b/fs/ubifs/io.c
@@ -297,6 +297,7 @@ static enum hrtimer_restart wbuf_timer_callback_nolock(struct hrtimer *timer)
297{ 297{
298 struct ubifs_wbuf *wbuf = container_of(timer, struct ubifs_wbuf, timer); 298 struct ubifs_wbuf *wbuf = container_of(timer, struct ubifs_wbuf, timer);
299 299
300 dbg_io("jhead %d", wbuf->jhead);
300 wbuf->need_sync = 1; 301 wbuf->need_sync = 1;
301 wbuf->c->need_wbuf_sync = 1; 302 wbuf->c->need_wbuf_sync = 1;
302 ubifs_wake_up_bgt(wbuf->c); 303 ubifs_wake_up_bgt(wbuf->c);
@@ -311,8 +312,12 @@ static void new_wbuf_timer_nolock(struct ubifs_wbuf *wbuf)
311{ 312{
312 ubifs_assert(!hrtimer_active(&wbuf->timer)); 313 ubifs_assert(!hrtimer_active(&wbuf->timer));
313 314
314 if (!ktime_to_ns(wbuf->softlimit)) 315 if (wbuf->no_timer)
315 return; 316 return;
317 dbg_io("set timer for jhead %d, %llu-%llu millisecs", wbuf->jhead,
318 div_u64(ktime_to_ns(wbuf->softlimit), USEC_PER_SEC),
319 div_u64(ktime_to_ns(wbuf->softlimit) + wbuf->delta,
320 USEC_PER_SEC));
316 hrtimer_start_range_ns(&wbuf->timer, wbuf->softlimit, wbuf->delta, 321 hrtimer_start_range_ns(&wbuf->timer, wbuf->softlimit, wbuf->delta,
317 HRTIMER_MODE_REL); 322 HRTIMER_MODE_REL);
318} 323}
@@ -323,11 +328,8 @@ static void new_wbuf_timer_nolock(struct ubifs_wbuf *wbuf)
323 */ 328 */
324static void cancel_wbuf_timer_nolock(struct ubifs_wbuf *wbuf) 329static void cancel_wbuf_timer_nolock(struct ubifs_wbuf *wbuf)
325{ 330{
326 /* 331 if (wbuf->no_timer)
327 * If the syncer is waiting for the lock (from the background thread's 332 return;
328 * context) and another task is changing write-buffer then the syncing
329 * should be canceled.
330 */
331 wbuf->need_sync = 0; 333 wbuf->need_sync = 0;
332 hrtimer_cancel(&wbuf->timer); 334 hrtimer_cancel(&wbuf->timer);
333} 335}
@@ -349,8 +351,8 @@ int ubifs_wbuf_sync_nolock(struct ubifs_wbuf *wbuf)
349 /* Write-buffer is empty or not seeked */ 351 /* Write-buffer is empty or not seeked */
350 return 0; 352 return 0;
351 353
352 dbg_io("LEB %d:%d, %d bytes", 354 dbg_io("LEB %d:%d, %d bytes, jhead %d",
353 wbuf->lnum, wbuf->offs, wbuf->used); 355 wbuf->lnum, wbuf->offs, wbuf->used, wbuf->jhead);
354 ubifs_assert(!(c->vfs_sb->s_flags & MS_RDONLY)); 356 ubifs_assert(!(c->vfs_sb->s_flags & MS_RDONLY));
355 ubifs_assert(!(wbuf->avail & 7)); 357 ubifs_assert(!(wbuf->avail & 7));
356 ubifs_assert(wbuf->offs + c->min_io_size <= c->leb_size); 358 ubifs_assert(wbuf->offs + c->min_io_size <= c->leb_size);
@@ -390,7 +392,7 @@ int ubifs_wbuf_sync_nolock(struct ubifs_wbuf *wbuf)
390 * @offs: logical eraseblock offset to seek to 392 * @offs: logical eraseblock offset to seek to
391 * @dtype: data type 393 * @dtype: data type
392 * 394 *
393 * This function targets the write buffer to logical eraseblock @lnum:@offs. 395 * This function targets the write-buffer to logical eraseblock @lnum:@offs.
394 * The write-buffer is synchronized if it is not empty. Returns zero in case of 396 * The write-buffer is synchronized if it is not empty. Returns zero in case of
395 * success and a negative error code in case of failure. 397 * success and a negative error code in case of failure.
396 */ 398 */
@@ -399,7 +401,7 @@ int ubifs_wbuf_seek_nolock(struct ubifs_wbuf *wbuf, int lnum, int offs,
399{ 401{
400 const struct ubifs_info *c = wbuf->c; 402 const struct ubifs_info *c = wbuf->c;
401 403
402 dbg_io("LEB %d:%d", lnum, offs); 404 dbg_io("LEB %d:%d, jhead %d", lnum, offs, wbuf->jhead);
403 ubifs_assert(lnum >= 0 && lnum < c->leb_cnt); 405 ubifs_assert(lnum >= 0 && lnum < c->leb_cnt);
404 ubifs_assert(offs >= 0 && offs <= c->leb_size); 406 ubifs_assert(offs >= 0 && offs <= c->leb_size);
405 ubifs_assert(offs % c->min_io_size == 0 && !(offs & 7)); 407 ubifs_assert(offs % c->min_io_size == 0 && !(offs & 7));
@@ -506,9 +508,9 @@ int ubifs_wbuf_write_nolock(struct ubifs_wbuf *wbuf, void *buf, int len)
506 struct ubifs_info *c = wbuf->c; 508 struct ubifs_info *c = wbuf->c;
507 int err, written, n, aligned_len = ALIGN(len, 8), offs; 509 int err, written, n, aligned_len = ALIGN(len, 8), offs;
508 510
509 dbg_io("%d bytes (%s) to wbuf at LEB %d:%d", len, 511 dbg_io("%d bytes (%s) to jhead %d wbuf at LEB %d:%d", len,
510 dbg_ntype(((struct ubifs_ch *)buf)->node_type), wbuf->lnum, 512 dbg_ntype(((struct ubifs_ch *)buf)->node_type), wbuf->jhead,
511 wbuf->offs + wbuf->used); 513 wbuf->lnum, wbuf->offs + wbuf->used);
512 ubifs_assert(len > 0 && wbuf->lnum >= 0 && wbuf->lnum < c->leb_cnt); 514 ubifs_assert(len > 0 && wbuf->lnum >= 0 && wbuf->lnum < c->leb_cnt);
513 ubifs_assert(wbuf->offs >= 0 && wbuf->offs % c->min_io_size == 0); 515 ubifs_assert(wbuf->offs >= 0 && wbuf->offs % c->min_io_size == 0);
514 ubifs_assert(!(wbuf->offs & 7) && wbuf->offs <= c->leb_size); 516 ubifs_assert(!(wbuf->offs & 7) && wbuf->offs <= c->leb_size);
@@ -533,8 +535,8 @@ int ubifs_wbuf_write_nolock(struct ubifs_wbuf *wbuf, void *buf, int len)
533 memcpy(wbuf->buf + wbuf->used, buf, len); 535 memcpy(wbuf->buf + wbuf->used, buf, len);
534 536
535 if (aligned_len == wbuf->avail) { 537 if (aligned_len == wbuf->avail) {
536 dbg_io("flush wbuf to LEB %d:%d", wbuf->lnum, 538 dbg_io("flush jhead %d wbuf to LEB %d:%d",
537 wbuf->offs); 539 wbuf->jhead, wbuf->lnum, wbuf->offs);
538 err = ubi_leb_write(c->ubi, wbuf->lnum, wbuf->buf, 540 err = ubi_leb_write(c->ubi, wbuf->lnum, wbuf->buf,
539 wbuf->offs, c->min_io_size, 541 wbuf->offs, c->min_io_size,
540 wbuf->dtype); 542 wbuf->dtype);
@@ -562,7 +564,8 @@ int ubifs_wbuf_write_nolock(struct ubifs_wbuf *wbuf, void *buf, int len)
562 * minimal I/O unit. We have to fill and flush write-buffer and switch 564 * minimal I/O unit. We have to fill and flush write-buffer and switch
563 * to the next min. I/O unit. 565 * to the next min. I/O unit.
564 */ 566 */
565 dbg_io("flush wbuf to LEB %d:%d", wbuf->lnum, wbuf->offs); 567 dbg_io("flush jhead %d wbuf to LEB %d:%d",
568 wbuf->jhead, wbuf->lnum, wbuf->offs);
566 memcpy(wbuf->buf + wbuf->used, buf, wbuf->avail); 569 memcpy(wbuf->buf + wbuf->used, buf, wbuf->avail);
567 err = ubi_leb_write(c->ubi, wbuf->lnum, wbuf->buf, wbuf->offs, 570 err = ubi_leb_write(c->ubi, wbuf->lnum, wbuf->buf, wbuf->offs,
568 c->min_io_size, wbuf->dtype); 571 c->min_io_size, wbuf->dtype);
@@ -695,7 +698,8 @@ int ubifs_read_node_wbuf(struct ubifs_wbuf *wbuf, void *buf, int type, int len,
695 int err, rlen, overlap; 698 int err, rlen, overlap;
696 struct ubifs_ch *ch = buf; 699 struct ubifs_ch *ch = buf;
697 700
698 dbg_io("LEB %d:%d, %s, length %d", lnum, offs, dbg_ntype(type), len); 701 dbg_io("LEB %d:%d, %s, length %d, jhead %d", lnum, offs,
702 dbg_ntype(type), len, wbuf->jhead);
699 ubifs_assert(wbuf && lnum >= 0 && lnum < c->leb_cnt && offs >= 0); 703 ubifs_assert(wbuf && lnum >= 0 && lnum < c->leb_cnt && offs >= 0);
700 ubifs_assert(!(offs & 7) && offs < c->leb_size); 704 ubifs_assert(!(offs & 7) && offs < c->leb_size);
701 ubifs_assert(type >= 0 && type < UBIFS_NODE_TYPES_CNT); 705 ubifs_assert(type >= 0 && type < UBIFS_NODE_TYPES_CNT);
@@ -819,13 +823,12 @@ out:
819 * @c: UBIFS file-system description object 823 * @c: UBIFS file-system description object
820 * @wbuf: write-buffer to initialize 824 * @wbuf: write-buffer to initialize
821 * 825 *
822 * This function initializes write buffer. Returns zero in case of success 826 * This function initializes write-buffer. Returns zero in case of success
823 * %-ENOMEM in case of failure. 827 * %-ENOMEM in case of failure.
824 */ 828 */
825int ubifs_wbuf_init(struct ubifs_info *c, struct ubifs_wbuf *wbuf) 829int ubifs_wbuf_init(struct ubifs_info *c, struct ubifs_wbuf *wbuf)
826{ 830{
827 size_t size; 831 size_t size;
828 ktime_t hardlimit;
829 832
830 wbuf->buf = kmalloc(c->min_io_size, GFP_KERNEL); 833 wbuf->buf = kmalloc(c->min_io_size, GFP_KERNEL);
831 if (!wbuf->buf) 834 if (!wbuf->buf)
@@ -851,22 +854,16 @@ int ubifs_wbuf_init(struct ubifs_info *c, struct ubifs_wbuf *wbuf)
851 854
852 hrtimer_init(&wbuf->timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL); 855 hrtimer_init(&wbuf->timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
853 wbuf->timer.function = wbuf_timer_callback_nolock; 856 wbuf->timer.function = wbuf_timer_callback_nolock;
854 /* 857 wbuf->softlimit = ktime_set(WBUF_TIMEOUT_SOFTLIMIT, 0);
855 * Make write-buffer soft limit to be 20% of the hard limit. The 858 wbuf->delta = WBUF_TIMEOUT_HARDLIMIT - WBUF_TIMEOUT_SOFTLIMIT;
856 * write-buffer timer is allowed to expire any time between the soft 859 wbuf->delta *= 1000000000ULL;
857 * and hard limits. 860 ubifs_assert(wbuf->delta <= ULONG_MAX);
858 */
859 hardlimit = ktime_set(DEFAULT_WBUF_TIMEOUT_SECS, 0);
860 wbuf->delta = (DEFAULT_WBUF_TIMEOUT_SECS * NSEC_PER_SEC) * 2 / 10;
861 wbuf->softlimit = ktime_sub_ns(hardlimit, wbuf->delta);
862 hrtimer_set_expires_range_ns(&wbuf->timer, wbuf->softlimit,
863 wbuf->delta);
864 return 0; 861 return 0;
865} 862}
866 863
867/** 864/**
868 * ubifs_wbuf_add_ino_nolock - add an inode number into the wbuf inode array. 865 * ubifs_wbuf_add_ino_nolock - add an inode number into the wbuf inode array.
869 * @wbuf: the write-buffer whereto add 866 * @wbuf: the write-buffer where to add
870 * @inum: the inode number 867 * @inum: the inode number
871 * 868 *
872 * This function adds an inode number to the inode array of the write-buffer. 869 * This function adds an inode number to the inode array of the write-buffer.
diff --git a/fs/ubifs/ioctl.c b/fs/ubifs/ioctl.c
index 6db7a6be6c97..8aacd64957a2 100644
--- a/fs/ubifs/ioctl.c
+++ b/fs/ubifs/ioctl.c
@@ -25,7 +25,6 @@
25/* This file implements EXT2-compatible extended attribute ioctl() calls */ 25/* This file implements EXT2-compatible extended attribute ioctl() calls */
26 26
27#include <linux/compat.h> 27#include <linux/compat.h>
28#include <linux/smp_lock.h>
29#include <linux/mount.h> 28#include <linux/mount.h>
30#include "ubifs.h" 29#include "ubifs.h"
31 30
diff --git a/fs/ubifs/recovery.c b/fs/ubifs/recovery.c
index 805605250f12..e5f6cf8a1155 100644
--- a/fs/ubifs/recovery.c
+++ b/fs/ubifs/recovery.c
@@ -53,6 +53,25 @@ static int is_empty(void *buf, int len)
53} 53}
54 54
55/** 55/**
56 * first_non_ff - find offset of the first non-0xff byte.
57 * @buf: buffer to search in
58 * @len: length of buffer
59 *
60 * This function returns offset of the first non-0xff byte in @buf or %-1 if
61 * the buffer contains only 0xff bytes.
62 */
63static int first_non_ff(void *buf, int len)
64{
65 uint8_t *p = buf;
66 int i;
67
68 for (i = 0; i < len; i++)
69 if (*p++ != 0xff)
70 return i;
71 return -1;
72}
73
74/**
56 * get_master_node - get the last valid master node allowing for corruption. 75 * get_master_node - get the last valid master node allowing for corruption.
57 * @c: UBIFS file-system description object 76 * @c: UBIFS file-system description object
58 * @lnum: LEB number 77 * @lnum: LEB number
@@ -357,11 +376,7 @@ static int is_last_write(const struct ubifs_info *c, void *buf, int offs)
357 empty_offs = ALIGN(offs + 1, c->min_io_size); 376 empty_offs = ALIGN(offs + 1, c->min_io_size);
358 check_len = c->leb_size - empty_offs; 377 check_len = c->leb_size - empty_offs;
359 p = buf + empty_offs - offs; 378 p = buf + empty_offs - offs;
360 379 return is_empty(p, check_len);
361 for (; check_len > 0; check_len--)
362 if (*p++ != 0xff)
363 return 0;
364 return 1;
365} 380}
366 381
367/** 382/**
@@ -543,8 +558,8 @@ static int drop_incomplete_group(struct ubifs_scan_leb *sleb, int *offs)
543 * 558 *
544 * This function does a scan of a LEB, but caters for errors that might have 559 * This function does a scan of a LEB, but caters for errors that might have
545 * been caused by the unclean unmount from which we are attempting to recover. 560 * been caused by the unclean unmount from which we are attempting to recover.
546 * 561 * Returns %0 in case of success, %-EUCLEAN if an unrecoverable corruption is
547 * This function returns %0 on success and a negative error code on failure. 562 * found, and a negative error code in case of failure.
548 */ 563 */
549struct ubifs_scan_leb *ubifs_recover_leb(struct ubifs_info *c, int lnum, 564struct ubifs_scan_leb *ubifs_recover_leb(struct ubifs_info *c, int lnum,
550 int offs, void *sbuf, int grouped) 565 int offs, void *sbuf, int grouped)
@@ -643,7 +658,8 @@ struct ubifs_scan_leb *ubifs_recover_leb(struct ubifs_info *c, int lnum,
643 goto corrupted; 658 goto corrupted;
644 default: 659 default:
645 dbg_err("unknown"); 660 dbg_err("unknown");
646 goto corrupted; 661 err = -EINVAL;
662 goto error;
647 } 663 }
648 } 664 }
649 665
@@ -652,8 +668,13 @@ struct ubifs_scan_leb *ubifs_recover_leb(struct ubifs_info *c, int lnum,
652 clean_buf(c, &buf, lnum, &offs, &len); 668 clean_buf(c, &buf, lnum, &offs, &len);
653 need_clean = 1; 669 need_clean = 1;
654 } else { 670 } else {
655 ubifs_err("corrupt empty space at LEB %d:%d", 671 int corruption = first_non_ff(buf, len);
656 lnum, offs); 672
673 ubifs_err("corrupt empty space LEB %d:%d, corruption "
674 "starts at %d", lnum, offs, corruption);
675 /* Make sure we dump interesting non-0xFF data */
676 offs = corruption;
677 buf += corruption;
657 goto corrupted; 678 goto corrupted;
658 } 679 }
659 } 680 }
@@ -813,7 +834,7 @@ struct ubifs_scan_leb *ubifs_recover_log_leb(struct ubifs_info *c, int lnum,
813static int recover_head(const struct ubifs_info *c, int lnum, int offs, 834static int recover_head(const struct ubifs_info *c, int lnum, int offs,
814 void *sbuf) 835 void *sbuf)
815{ 836{
816 int len, err, need_clean = 0; 837 int len, err;
817 838
818 if (c->min_io_size > 1) 839 if (c->min_io_size > 1)
819 len = c->min_io_size; 840 len = c->min_io_size;
@@ -827,19 +848,7 @@ static int recover_head(const struct ubifs_info *c, int lnum, int offs,
827 848
828 /* Read at the head location and check it is empty flash */ 849 /* Read at the head location and check it is empty flash */
829 err = ubi_read(c->ubi, lnum, sbuf, offs, len); 850 err = ubi_read(c->ubi, lnum, sbuf, offs, len);
830 if (err) 851 if (err || !is_empty(sbuf, len)) {
831 need_clean = 1;
832 else {
833 uint8_t *p = sbuf;
834
835 while (len--)
836 if (*p++ != 0xff) {
837 need_clean = 1;
838 break;
839 }
840 }
841
842 if (need_clean) {
843 dbg_rcvry("cleaning head at %d:%d", lnum, offs); 852 dbg_rcvry("cleaning head at %d:%d", lnum, offs);
844 if (offs == 0) 853 if (offs == 0)
845 return ubifs_leb_unmap(c, lnum); 854 return ubifs_leb_unmap(c, lnum);
diff --git a/fs/ubifs/replay.c b/fs/ubifs/replay.c
index 11cc80125a49..2970500f32df 100644
--- a/fs/ubifs/replay.c
+++ b/fs/ubifs/replay.c
@@ -837,9 +837,10 @@ static int replay_log_leb(struct ubifs_info *c, int lnum, int offs, void *sbuf)
837 837
838 dbg_mnt("replay log LEB %d:%d", lnum, offs); 838 dbg_mnt("replay log LEB %d:%d", lnum, offs);
839 sleb = ubifs_scan(c, lnum, offs, sbuf); 839 sleb = ubifs_scan(c, lnum, offs, sbuf);
840 if (IS_ERR(sleb)) { 840 if (IS_ERR(sleb) ) {
841 if (c->need_recovery) 841 if (PTR_ERR(sleb) != -EUCLEAN || !c->need_recovery)
842 sleb = ubifs_recover_log_leb(c, lnum, offs, sbuf); 842 return PTR_ERR(sleb);
843 sleb = ubifs_recover_log_leb(c, lnum, offs, sbuf);
843 if (IS_ERR(sleb)) 844 if (IS_ERR(sleb))
844 return PTR_ERR(sleb); 845 return PTR_ERR(sleb);
845 } 846 }
@@ -957,7 +958,7 @@ out:
957 return err; 958 return err;
958 959
959out_dump: 960out_dump:
960 ubifs_err("log error detected while replying the log at LEB %d:%d", 961 ubifs_err("log error detected while replaying the log at LEB %d:%d",
961 lnum, offs + snod->offs); 962 lnum, offs + snod->offs);
962 dbg_dump_node(c, snod->node); 963 dbg_dump_node(c, snod->node);
963 ubifs_scan_destroy(sleb); 964 ubifs_scan_destroy(sleb);
diff --git a/fs/ubifs/scan.c b/fs/ubifs/scan.c
index 0ed82479b44b..892ebfee4fe5 100644
--- a/fs/ubifs/scan.c
+++ b/fs/ubifs/scan.c
@@ -238,12 +238,12 @@ void ubifs_scanned_corruption(const struct ubifs_info *c, int lnum, int offs,
238{ 238{
239 int len; 239 int len;
240 240
241 ubifs_err("corrupted data at LEB %d:%d", lnum, offs); 241 ubifs_err("corruption at LEB %d:%d", lnum, offs);
242 if (dbg_failure_mode) 242 if (dbg_failure_mode)
243 return; 243 return;
244 len = c->leb_size - offs; 244 len = c->leb_size - offs;
245 if (len > 4096) 245 if (len > 8192)
246 len = 4096; 246 len = 8192;
247 dbg_err("first %d bytes from LEB %d:%d", len, lnum, offs); 247 dbg_err("first %d bytes from LEB %d:%d", len, lnum, offs);
248 print_hex_dump(KERN_DEBUG, "", DUMP_PREFIX_OFFSET, 32, 4, buf, len, 1); 248 print_hex_dump(KERN_DEBUG, "", DUMP_PREFIX_OFFSET, 32, 4, buf, len, 1);
249} 249}
@@ -256,7 +256,9 @@ void ubifs_scanned_corruption(const struct ubifs_info *c, int lnum, int offs,
256 * @sbuf: scan buffer (must be c->leb_size) 256 * @sbuf: scan buffer (must be c->leb_size)
257 * 257 *
258 * This function scans LEB number @lnum and returns complete information about 258 * This function scans LEB number @lnum and returns complete information about
259 * its contents. Returns an error code in case of failure. 259 * its contents. Returns the scaned information in case of success and,
260 * %-EUCLEAN if the LEB neads recovery, and other negative error codes in case
261 * of failure.
260 */ 262 */
261struct ubifs_scan_leb *ubifs_scan(const struct ubifs_info *c, int lnum, 263struct ubifs_scan_leb *ubifs_scan(const struct ubifs_info *c, int lnum,
262 int offs, void *sbuf) 264 int offs, void *sbuf)
@@ -279,7 +281,6 @@ struct ubifs_scan_leb *ubifs_scan(const struct ubifs_info *c, int lnum,
279 cond_resched(); 281 cond_resched();
280 282
281 ret = ubifs_scan_a_node(c, buf, len, lnum, offs, 0); 283 ret = ubifs_scan_a_node(c, buf, len, lnum, offs, 0);
282
283 if (ret > 0) { 284 if (ret > 0) {
284 /* Padding bytes or a valid padding node */ 285 /* Padding bytes or a valid padding node */
285 offs += ret; 286 offs += ret;
@@ -304,7 +305,8 @@ struct ubifs_scan_leb *ubifs_scan(const struct ubifs_info *c, int lnum,
304 goto corrupted; 305 goto corrupted;
305 default: 306 default:
306 dbg_err("unknown"); 307 dbg_err("unknown");
307 goto corrupted; 308 err = -EINVAL;
309 goto error;
308 } 310 }
309 311
310 err = ubifs_add_snod(c, sleb, buf, offs); 312 err = ubifs_add_snod(c, sleb, buf, offs);
@@ -317,8 +319,10 @@ struct ubifs_scan_leb *ubifs_scan(const struct ubifs_info *c, int lnum,
317 len -= node_len; 319 len -= node_len;
318 } 320 }
319 321
320 if (offs % c->min_io_size) 322 if (offs % c->min_io_size) {
321 goto corrupted; 323 ubifs_err("empty space starts at non-aligned offset %d", offs);
324 goto corrupted;;
325 }
322 326
323 ubifs_end_scan(c, sleb, lnum, offs); 327 ubifs_end_scan(c, sleb, lnum, offs);
324 328
diff --git a/fs/ubifs/super.c b/fs/ubifs/super.c
index 79fad43f3c57..26d2e0d80465 100644
--- a/fs/ubifs/super.c
+++ b/fs/ubifs/super.c
@@ -797,7 +797,7 @@ static int alloc_wbufs(struct ubifs_info *c)
797 * does not need to be synchronized by timer. 797 * does not need to be synchronized by timer.
798 */ 798 */
799 c->jheads[GCHD].wbuf.dtype = UBI_LONGTERM; 799 c->jheads[GCHD].wbuf.dtype = UBI_LONGTERM;
800 c->jheads[GCHD].wbuf.softlimit = ktime_set(0, 0); 800 c->jheads[GCHD].wbuf.no_timer = 1;
801 801
802 return 0; 802 return 0;
803} 803}
@@ -986,7 +986,7 @@ static int ubifs_parse_options(struct ubifs_info *c, char *options,
986 switch (token) { 986 switch (token) {
987 /* 987 /*
988 * %Opt_fast_unmount and %Opt_norm_unmount options are ignored. 988 * %Opt_fast_unmount and %Opt_norm_unmount options are ignored.
989 * We accepte them in order to be backware-compatible. But this 989 * We accept them in order to be backward-compatible. But this
990 * should be removed at some point. 990 * should be removed at some point.
991 */ 991 */
992 case Opt_fast_unmount: 992 case Opt_fast_unmount:
@@ -1287,6 +1287,9 @@ static int mount_ubifs(struct ubifs_info *c)
1287 if (err) 1287 if (err)
1288 goto out_journal; 1288 goto out_journal;
1289 1289
1290 /* Calculate 'min_idx_lebs' after journal replay */
1291 c->min_idx_lebs = ubifs_calc_min_idx_lebs(c);
1292
1290 err = ubifs_mount_orphans(c, c->need_recovery, mounted_read_only); 1293 err = ubifs_mount_orphans(c, c->need_recovery, mounted_read_only);
1291 if (err) 1294 if (err)
1292 goto out_orphans; 1295 goto out_orphans;
@@ -1754,10 +1757,8 @@ static void ubifs_put_super(struct super_block *sb)
1754 1757
1755 /* Synchronize write-buffers */ 1758 /* Synchronize write-buffers */
1756 if (c->jheads) 1759 if (c->jheads)
1757 for (i = 0; i < c->jhead_cnt; i++) { 1760 for (i = 0; i < c->jhead_cnt; i++)
1758 ubifs_wbuf_sync(&c->jheads[i].wbuf); 1761 ubifs_wbuf_sync(&c->jheads[i].wbuf);
1759 hrtimer_cancel(&c->jheads[i].wbuf.timer);
1760 }
1761 1762
1762 /* 1763 /*
1763 * On fatal errors c->ro_media is set to 1, in which case we do 1764 * On fatal errors c->ro_media is set to 1, in which case we do
@@ -1975,7 +1976,8 @@ static int ubifs_fill_super(struct super_block *sb, void *data, int silent)
1975 err = bdi_init(&c->bdi); 1976 err = bdi_init(&c->bdi);
1976 if (err) 1977 if (err)
1977 goto out_close; 1978 goto out_close;
1978 err = bdi_register(&c->bdi, NULL, "ubifs"); 1979 err = bdi_register(&c->bdi, NULL, "ubifs_%d_%d",
1980 c->vi.ubi_num, c->vi.vol_id);
1979 if (err) 1981 if (err)
1980 goto out_bdi; 1982 goto out_bdi;
1981 1983
diff --git a/fs/ubifs/ubifs.h b/fs/ubifs/ubifs.h
index 1bf01d820066..a29349094422 100644
--- a/fs/ubifs/ubifs.h
+++ b/fs/ubifs/ubifs.h
@@ -95,8 +95,9 @@
95 */ 95 */
96#define BGT_NAME_PATTERN "ubifs_bgt%d_%d" 96#define BGT_NAME_PATTERN "ubifs_bgt%d_%d"
97 97
98/* Default write-buffer synchronization timeout in seconds */ 98/* Write-buffer synchronization timeout interval in seconds */
99#define DEFAULT_WBUF_TIMEOUT_SECS 5 99#define WBUF_TIMEOUT_SOFTLIMIT 3
100#define WBUF_TIMEOUT_HARDLIMIT 5
100 101
101/* Maximum possible inode number (only 32-bit inodes are supported now) */ 102/* Maximum possible inode number (only 32-bit inodes are supported now) */
102#define MAX_INUM 0xFFFFFFFF 103#define MAX_INUM 0xFFFFFFFF
@@ -654,7 +655,8 @@ typedef int (*ubifs_lpt_scan_callback)(struct ubifs_info *c,
654 * @delta: hard and soft timeouts delta (the timer expire inteval is @softlimit 655 * @delta: hard and soft timeouts delta (the timer expire inteval is @softlimit
655 * and @softlimit + @delta) 656 * and @softlimit + @delta)
656 * @timer: write-buffer timer 657 * @timer: write-buffer timer
657 * @need_sync: it is set if its timer expired and needs sync 658 * @no_timer: non-zero if this write-buffer does not have a timer
659 * @need_sync: non-zero if the timer expired and the wbuf needs sync'ing
658 * @next_ino: points to the next position of the following inode number 660 * @next_ino: points to the next position of the following inode number
659 * @inodes: stores the inode numbers of the nodes which are in wbuf 661 * @inodes: stores the inode numbers of the nodes which are in wbuf
660 * 662 *
@@ -683,7 +685,8 @@ struct ubifs_wbuf {
683 ktime_t softlimit; 685 ktime_t softlimit;
684 unsigned long long delta; 686 unsigned long long delta;
685 struct hrtimer timer; 687 struct hrtimer timer;
686 int need_sync; 688 unsigned int no_timer:1;
689 unsigned int need_sync:1;
687 int next_ino; 690 int next_ino;
688 ino_t *inodes; 691 ino_t *inodes;
689}; 692};
diff --git a/fs/udf/super.c b/fs/udf/super.c
index 6832135159b6..9d1b8c2e6c45 100644
--- a/fs/udf/super.c
+++ b/fs/udf/super.c
@@ -1087,11 +1087,23 @@ static int udf_load_vat(struct super_block *sb, int p_index, int type1_index)
1087 struct udf_inode_info *vati; 1087 struct udf_inode_info *vati;
1088 uint32_t pos; 1088 uint32_t pos;
1089 struct virtualAllocationTable20 *vat20; 1089 struct virtualAllocationTable20 *vat20;
1090 sector_t blocks = sb->s_bdev->bd_inode->i_size >> sb->s_blocksize_bits;
1090 1091
1091 /* VAT file entry is in the last recorded block */ 1092 /* VAT file entry is in the last recorded block */
1092 ino.partitionReferenceNum = type1_index; 1093 ino.partitionReferenceNum = type1_index;
1093 ino.logicalBlockNum = sbi->s_last_block - map->s_partition_root; 1094 ino.logicalBlockNum = sbi->s_last_block - map->s_partition_root;
1094 sbi->s_vat_inode = udf_iget(sb, &ino); 1095 sbi->s_vat_inode = udf_iget(sb, &ino);
1096 if (!sbi->s_vat_inode &&
1097 sbi->s_last_block != blocks - 1) {
1098 printk(KERN_NOTICE "UDF-fs: Failed to read VAT inode from the"
1099 " last recorded block (%lu), retrying with the last "
1100 "block of the device (%lu).\n",
1101 (unsigned long)sbi->s_last_block,
1102 (unsigned long)blocks - 1);
1103 ino.partitionReferenceNum = type1_index;
1104 ino.logicalBlockNum = blocks - 1 - map->s_partition_root;
1105 sbi->s_vat_inode = udf_iget(sb, &ino);
1106 }
1095 if (!sbi->s_vat_inode) 1107 if (!sbi->s_vat_inode)
1096 return 1; 1108 return 1;
1097 1109
diff --git a/fs/xfs/linux-2.6/kmem.c b/fs/xfs/linux-2.6/kmem.c
index 1cd3b55ee3d2..2d3f90afe5f1 100644
--- a/fs/xfs/linux-2.6/kmem.c
+++ b/fs/xfs/linux-2.6/kmem.c
@@ -53,7 +53,7 @@ kmem_alloc(size_t size, unsigned int __nocast flags)
53 printk(KERN_ERR "XFS: possible memory allocation " 53 printk(KERN_ERR "XFS: possible memory allocation "
54 "deadlock in %s (mode:0x%x)\n", 54 "deadlock in %s (mode:0x%x)\n",
55 __func__, lflags); 55 __func__, lflags);
56 congestion_wait(WRITE, HZ/50); 56 congestion_wait(BLK_RW_ASYNC, HZ/50);
57 } while (1); 57 } while (1);
58} 58}
59 59
@@ -130,7 +130,7 @@ kmem_zone_alloc(kmem_zone_t *zone, unsigned int __nocast flags)
130 printk(KERN_ERR "XFS: possible memory allocation " 130 printk(KERN_ERR "XFS: possible memory allocation "
131 "deadlock in %s (mode:0x%x)\n", 131 "deadlock in %s (mode:0x%x)\n",
132 __func__, lflags); 132 __func__, lflags);
133 congestion_wait(WRITE, HZ/50); 133 congestion_wait(BLK_RW_ASYNC, HZ/50);
134 } while (1); 134 } while (1);
135} 135}
136 136
diff --git a/fs/xfs/linux-2.6/xfs_aops.c b/fs/xfs/linux-2.6/xfs_aops.c
index 7ec89fc05b2b..aecf2519db76 100644
--- a/fs/xfs/linux-2.6/xfs_aops.c
+++ b/fs/xfs/linux-2.6/xfs_aops.c
@@ -1268,6 +1268,14 @@ xfs_vm_writepage(
1268 if (!page_has_buffers(page)) 1268 if (!page_has_buffers(page))
1269 create_empty_buffers(page, 1 << inode->i_blkbits, 0); 1269 create_empty_buffers(page, 1 << inode->i_blkbits, 0);
1270 1270
1271
1272 /*
1273 * VM calculation for nr_to_write seems off. Bump it way
1274 * up, this gets simple streaming writes zippy again.
1275 * To be reviewed again after Jens' writeback changes.
1276 */
1277 wbc->nr_to_write *= 4;
1278
1271 /* 1279 /*
1272 * Convert delayed allocate, unwritten or unmapped space 1280 * Convert delayed allocate, unwritten or unmapped space
1273 * to real space and flush out to disk. 1281 * to real space and flush out to disk.
diff --git a/fs/xfs/linux-2.6/xfs_buf.c b/fs/xfs/linux-2.6/xfs_buf.c
index 1418b916fc27..0c93c7ef3d18 100644
--- a/fs/xfs/linux-2.6/xfs_buf.c
+++ b/fs/xfs/linux-2.6/xfs_buf.c
@@ -412,7 +412,7 @@ _xfs_buf_lookup_pages(
412 412
413 XFS_STATS_INC(xb_page_retries); 413 XFS_STATS_INC(xb_page_retries);
414 xfsbufd_wakeup(0, gfp_mask); 414 xfsbufd_wakeup(0, gfp_mask);
415 congestion_wait(WRITE, HZ/50); 415 congestion_wait(BLK_RW_ASYNC, HZ/50);
416 goto retry; 416 goto retry;
417 } 417 }
418 418
diff --git a/fs/xfs/linux-2.6/xfs_file.c b/fs/xfs/linux-2.6/xfs_file.c
index f4e255441574..0542fd507649 100644
--- a/fs/xfs/linux-2.6/xfs_file.c
+++ b/fs/xfs/linux-2.6/xfs_file.c
@@ -41,7 +41,6 @@
41#include "xfs_ioctl.h" 41#include "xfs_ioctl.h"
42 42
43#include <linux/dcache.h> 43#include <linux/dcache.h>
44#include <linux/smp_lock.h>
45 44
46static struct vm_operations_struct xfs_file_vm_ops; 45static struct vm_operations_struct xfs_file_vm_ops;
47 46
diff --git a/fs/xfs/linux-2.6/xfs_iops.c b/fs/xfs/linux-2.6/xfs_iops.c
index 58973bb46038..8070b34cc287 100644
--- a/fs/xfs/linux-2.6/xfs_iops.c
+++ b/fs/xfs/linux-2.6/xfs_iops.c
@@ -680,8 +680,8 @@ xfs_vn_fiemap(
680 else 680 else
681 bm.bmv_length = BTOBB(length); 681 bm.bmv_length = BTOBB(length);
682 682
683 /* our formatter will tell xfs_getbmap when to stop. */ 683 /* We add one because in getbmap world count includes the header */
684 bm.bmv_count = MAXEXTNUM; 684 bm.bmv_count = fieinfo->fi_extents_max + 1;
685 bm.bmv_iflags = BMV_IF_PREALLOC; 685 bm.bmv_iflags = BMV_IF_PREALLOC;
686 if (fieinfo->fi_flags & FIEMAP_FLAG_XATTR) 686 if (fieinfo->fi_flags & FIEMAP_FLAG_XATTR)
687 bm.bmv_iflags |= BMV_IF_ATTRFORK; 687 bm.bmv_iflags |= BMV_IF_ATTRFORK;
diff --git a/fs/xfs/xfs_iget.c b/fs/xfs/xfs_iget.c
index 5fcec6f020a7..34ec86923f7e 100644
--- a/fs/xfs/xfs_iget.c
+++ b/fs/xfs/xfs_iget.c
@@ -64,6 +64,10 @@ xfs_inode_alloc(
64 ip = kmem_zone_alloc(xfs_inode_zone, KM_SLEEP); 64 ip = kmem_zone_alloc(xfs_inode_zone, KM_SLEEP);
65 if (!ip) 65 if (!ip)
66 return NULL; 66 return NULL;
67 if (inode_init_always(mp->m_super, VFS_I(ip))) {
68 kmem_zone_free(xfs_inode_zone, ip);
69 return NULL;
70 }
67 71
68 ASSERT(atomic_read(&ip->i_iocount) == 0); 72 ASSERT(atomic_read(&ip->i_iocount) == 0);
69 ASSERT(atomic_read(&ip->i_pincount) == 0); 73 ASSERT(atomic_read(&ip->i_pincount) == 0);
@@ -105,17 +109,6 @@ xfs_inode_alloc(
105#ifdef XFS_DIR2_TRACE 109#ifdef XFS_DIR2_TRACE
106 ip->i_dir_trace = ktrace_alloc(XFS_DIR2_KTRACE_SIZE, KM_NOFS); 110 ip->i_dir_trace = ktrace_alloc(XFS_DIR2_KTRACE_SIZE, KM_NOFS);
107#endif 111#endif
108 /*
109 * Now initialise the VFS inode. We do this after the xfs_inode
110 * initialisation as internal failures will result in ->destroy_inode
111 * being called and that will pass down through the reclaim path and
112 * free the XFS inode. This path requires the XFS inode to already be
113 * initialised. Hence if this call fails, the xfs_inode has already
114 * been freed and we should not reference it at all in the error
115 * handling.
116 */
117 if (!inode_init_always(mp->m_super, VFS_I(ip)))
118 return NULL;
119 112
120 /* prevent anyone from using this yet */ 113 /* prevent anyone from using this yet */
121 VFS_I(ip)->i_state = I_NEW|I_LOCK; 114 VFS_I(ip)->i_state = I_NEW|I_LOCK;
@@ -123,6 +116,71 @@ xfs_inode_alloc(
123 return ip; 116 return ip;
124} 117}
125 118
119STATIC void
120xfs_inode_free(
121 struct xfs_inode *ip)
122{
123 switch (ip->i_d.di_mode & S_IFMT) {
124 case S_IFREG:
125 case S_IFDIR:
126 case S_IFLNK:
127 xfs_idestroy_fork(ip, XFS_DATA_FORK);
128 break;
129 }
130
131 if (ip->i_afp)
132 xfs_idestroy_fork(ip, XFS_ATTR_FORK);
133
134#ifdef XFS_INODE_TRACE
135 ktrace_free(ip->i_trace);
136#endif
137#ifdef XFS_BMAP_TRACE
138 ktrace_free(ip->i_xtrace);
139#endif
140#ifdef XFS_BTREE_TRACE
141 ktrace_free(ip->i_btrace);
142#endif
143#ifdef XFS_RW_TRACE
144 ktrace_free(ip->i_rwtrace);
145#endif
146#ifdef XFS_ILOCK_TRACE
147 ktrace_free(ip->i_lock_trace);
148#endif
149#ifdef XFS_DIR2_TRACE
150 ktrace_free(ip->i_dir_trace);
151#endif
152
153 if (ip->i_itemp) {
154 /*
155 * Only if we are shutting down the fs will we see an
156 * inode still in the AIL. If it is there, we should remove
157 * it to prevent a use-after-free from occurring.
158 */
159 xfs_log_item_t *lip = &ip->i_itemp->ili_item;
160 struct xfs_ail *ailp = lip->li_ailp;
161
162 ASSERT(((lip->li_flags & XFS_LI_IN_AIL) == 0) ||
163 XFS_FORCED_SHUTDOWN(ip->i_mount));
164 if (lip->li_flags & XFS_LI_IN_AIL) {
165 spin_lock(&ailp->xa_lock);
166 if (lip->li_flags & XFS_LI_IN_AIL)
167 xfs_trans_ail_delete(ailp, lip);
168 else
169 spin_unlock(&ailp->xa_lock);
170 }
171 xfs_inode_item_destroy(ip);
172 ip->i_itemp = NULL;
173 }
174
175 /* asserts to verify all state is correct here */
176 ASSERT(atomic_read(&ip->i_iocount) == 0);
177 ASSERT(atomic_read(&ip->i_pincount) == 0);
178 ASSERT(!spin_is_locked(&ip->i_flags_lock));
179 ASSERT(completion_done(&ip->i_flush));
180
181 kmem_zone_free(xfs_inode_zone, ip);
182}
183
126/* 184/*
127 * Check the validity of the inode we just found it the cache 185 * Check the validity of the inode we just found it the cache
128 */ 186 */
@@ -167,7 +225,7 @@ xfs_iget_cache_hit(
167 * errors cleanly, then tag it so it can be set up correctly 225 * errors cleanly, then tag it so it can be set up correctly
168 * later. 226 * later.
169 */ 227 */
170 if (!inode_init_always(mp->m_super, VFS_I(ip))) { 228 if (inode_init_always(mp->m_super, VFS_I(ip))) {
171 error = ENOMEM; 229 error = ENOMEM;
172 goto out_error; 230 goto out_error;
173 } 231 }
@@ -299,7 +357,8 @@ out_preload_end:
299 if (lock_flags) 357 if (lock_flags)
300 xfs_iunlock(ip, lock_flags); 358 xfs_iunlock(ip, lock_flags);
301out_destroy: 359out_destroy:
302 xfs_destroy_inode(ip); 360 __destroy_inode(VFS_I(ip));
361 xfs_inode_free(ip);
303 return error; 362 return error;
304} 363}
305 364
@@ -504,62 +563,7 @@ xfs_ireclaim(
504 xfs_qm_dqdetach(ip); 563 xfs_qm_dqdetach(ip);
505 xfs_iunlock(ip, XFS_ILOCK_EXCL | XFS_IOLOCK_EXCL); 564 xfs_iunlock(ip, XFS_ILOCK_EXCL | XFS_IOLOCK_EXCL);
506 565
507 switch (ip->i_d.di_mode & S_IFMT) { 566 xfs_inode_free(ip);
508 case S_IFREG:
509 case S_IFDIR:
510 case S_IFLNK:
511 xfs_idestroy_fork(ip, XFS_DATA_FORK);
512 break;
513 }
514
515 if (ip->i_afp)
516 xfs_idestroy_fork(ip, XFS_ATTR_FORK);
517
518#ifdef XFS_INODE_TRACE
519 ktrace_free(ip->i_trace);
520#endif
521#ifdef XFS_BMAP_TRACE
522 ktrace_free(ip->i_xtrace);
523#endif
524#ifdef XFS_BTREE_TRACE
525 ktrace_free(ip->i_btrace);
526#endif
527#ifdef XFS_RW_TRACE
528 ktrace_free(ip->i_rwtrace);
529#endif
530#ifdef XFS_ILOCK_TRACE
531 ktrace_free(ip->i_lock_trace);
532#endif
533#ifdef XFS_DIR2_TRACE
534 ktrace_free(ip->i_dir_trace);
535#endif
536 if (ip->i_itemp) {
537 /*
538 * Only if we are shutting down the fs will we see an
539 * inode still in the AIL. If it is there, we should remove
540 * it to prevent a use-after-free from occurring.
541 */
542 xfs_log_item_t *lip = &ip->i_itemp->ili_item;
543 struct xfs_ail *ailp = lip->li_ailp;
544
545 ASSERT(((lip->li_flags & XFS_LI_IN_AIL) == 0) ||
546 XFS_FORCED_SHUTDOWN(ip->i_mount));
547 if (lip->li_flags & XFS_LI_IN_AIL) {
548 spin_lock(&ailp->xa_lock);
549 if (lip->li_flags & XFS_LI_IN_AIL)
550 xfs_trans_ail_delete(ailp, lip);
551 else
552 spin_unlock(&ailp->xa_lock);
553 }
554 xfs_inode_item_destroy(ip);
555 ip->i_itemp = NULL;
556 }
557 /* asserts to verify all state is correct here */
558 ASSERT(atomic_read(&ip->i_iocount) == 0);
559 ASSERT(atomic_read(&ip->i_pincount) == 0);
560 ASSERT(!spin_is_locked(&ip->i_flags_lock));
561 ASSERT(completion_done(&ip->i_flush));
562 kmem_zone_free(xfs_inode_zone, ip);
563} 567}
564 568
565/* 569/*
diff --git a/fs/xfs/xfs_inode.h b/fs/xfs/xfs_inode.h
index 1804f866a71d..65f24a3cc992 100644
--- a/fs/xfs/xfs_inode.h
+++ b/fs/xfs/xfs_inode.h
@@ -310,23 +310,6 @@ static inline struct inode *VFS_I(struct xfs_inode *ip)
310} 310}
311 311
312/* 312/*
313 * Get rid of a partially initialized inode.
314 *
315 * We have to go through destroy_inode to make sure allocations
316 * from init_inode_always like the security data are undone.
317 *
318 * We mark the inode bad so that it takes the short cut in
319 * the reclaim path instead of going through the flush path
320 * which doesn't make sense for an inode that has never seen the
321 * light of day.
322 */
323static inline void xfs_destroy_inode(struct xfs_inode *ip)
324{
325 make_bad_inode(VFS_I(ip));
326 return destroy_inode(VFS_I(ip));
327}
328
329/*
330 * i_flags helper functions 313 * i_flags helper functions
331 */ 314 */
332static inline void 315static inline void
diff --git a/include/acpi/acpiosxf.h b/include/acpi/acpiosxf.h
index 3e798593b17b..ab0b85cf21f3 100644
--- a/include/acpi/acpiosxf.h
+++ b/include/acpi/acpiosxf.h
@@ -242,6 +242,10 @@ acpi_os_derive_pci_id(acpi_handle rhandle,
242acpi_status acpi_os_validate_interface(char *interface); 242acpi_status acpi_os_validate_interface(char *interface);
243acpi_status acpi_osi_invalidate(char* interface); 243acpi_status acpi_osi_invalidate(char* interface);
244 244
245acpi_status
246acpi_os_validate_address(u8 space_id, acpi_physical_address address,
247 acpi_size length, char *name);
248
245u64 acpi_os_get_timer(void); 249u64 acpi_os_get_timer(void);
246 250
247acpi_status acpi_os_signal(u32 function, void *info); 251acpi_status acpi_os_signal(u32 function, void *info);
diff --git a/include/asm-generic/4level-fixup.h b/include/asm-generic/4level-fixup.h
index 9d40e879f99e..77ff547730af 100644
--- a/include/asm-generic/4level-fixup.h
+++ b/include/asm-generic/4level-fixup.h
@@ -27,9 +27,9 @@
27#define pud_page_vaddr(pud) pgd_page_vaddr(pud) 27#define pud_page_vaddr(pud) pgd_page_vaddr(pud)
28 28
29#undef pud_free_tlb 29#undef pud_free_tlb
30#define pud_free_tlb(tlb, x) do { } while (0) 30#define pud_free_tlb(tlb, x, addr) do { } while (0)
31#define pud_free(mm, x) do { } while (0) 31#define pud_free(mm, x) do { } while (0)
32#define __pud_free_tlb(tlb, x) do { } while (0) 32#define __pud_free_tlb(tlb, x, addr) do { } while (0)
33 33
34#undef pud_addr_end 34#undef pud_addr_end
35#define pud_addr_end(addr, end) (end) 35#define pud_addr_end(addr, end) (end)
diff --git a/include/asm-generic/percpu.h b/include/asm-generic/percpu.h
index d7d50d7ee51e..aa00800adacc 100644
--- a/include/asm-generic/percpu.h
+++ b/include/asm-generic/percpu.h
@@ -97,4 +97,8 @@ extern void setup_per_cpu_areas(void);
97#define PER_CPU_ATTRIBUTES 97#define PER_CPU_ATTRIBUTES
98#endif 98#endif
99 99
100#ifndef PER_CPU_DEF_ATTRIBUTES
101#define PER_CPU_DEF_ATTRIBUTES
102#endif
103
100#endif /* _ASM_GENERIC_PERCPU_H_ */ 104#endif /* _ASM_GENERIC_PERCPU_H_ */
diff --git a/include/asm-generic/pgtable-nopmd.h b/include/asm-generic/pgtable-nopmd.h
index a7cdc48e8b78..725612b793ce 100644
--- a/include/asm-generic/pgtable-nopmd.h
+++ b/include/asm-generic/pgtable-nopmd.h
@@ -59,7 +59,7 @@ static inline pmd_t * pmd_offset(pud_t * pud, unsigned long address)
59static inline void pmd_free(struct mm_struct *mm, pmd_t *pmd) 59static inline void pmd_free(struct mm_struct *mm, pmd_t *pmd)
60{ 60{
61} 61}
62#define __pmd_free_tlb(tlb, x) do { } while (0) 62#define __pmd_free_tlb(tlb, x, a) do { } while (0)
63 63
64#undef pmd_addr_end 64#undef pmd_addr_end
65#define pmd_addr_end(addr, end) (end) 65#define pmd_addr_end(addr, end) (end)
diff --git a/include/asm-generic/pgtable-nopud.h b/include/asm-generic/pgtable-nopud.h
index 87cf449a6df3..810431d8351b 100644
--- a/include/asm-generic/pgtable-nopud.h
+++ b/include/asm-generic/pgtable-nopud.h
@@ -52,7 +52,7 @@ static inline pud_t * pud_offset(pgd_t * pgd, unsigned long address)
52 */ 52 */
53#define pud_alloc_one(mm, address) NULL 53#define pud_alloc_one(mm, address) NULL
54#define pud_free(mm, x) do { } while (0) 54#define pud_free(mm, x) do { } while (0)
55#define __pud_free_tlb(tlb, x) do { } while (0) 55#define __pud_free_tlb(tlb, x, a) do { } while (0)
56 56
57#undef pud_addr_end 57#undef pud_addr_end
58#define pud_addr_end(addr, end) (end) 58#define pud_addr_end(addr, end) (end)
diff --git a/include/asm-generic/tlb.h b/include/asm-generic/tlb.h
index f490e43a90b9..e43f9766259f 100644
--- a/include/asm-generic/tlb.h
+++ b/include/asm-generic/tlb.h
@@ -123,24 +123,24 @@ static inline void tlb_remove_page(struct mmu_gather *tlb, struct page *page)
123 __tlb_remove_tlb_entry(tlb, ptep, address); \ 123 __tlb_remove_tlb_entry(tlb, ptep, address); \
124 } while (0) 124 } while (0)
125 125
126#define pte_free_tlb(tlb, ptep) \ 126#define pte_free_tlb(tlb, ptep, address) \
127 do { \ 127 do { \
128 tlb->need_flush = 1; \ 128 tlb->need_flush = 1; \
129 __pte_free_tlb(tlb, ptep); \ 129 __pte_free_tlb(tlb, ptep, address); \
130 } while (0) 130 } while (0)
131 131
132#ifndef __ARCH_HAS_4LEVEL_HACK 132#ifndef __ARCH_HAS_4LEVEL_HACK
133#define pud_free_tlb(tlb, pudp) \ 133#define pud_free_tlb(tlb, pudp, address) \
134 do { \ 134 do { \
135 tlb->need_flush = 1; \ 135 tlb->need_flush = 1; \
136 __pud_free_tlb(tlb, pudp); \ 136 __pud_free_tlb(tlb, pudp, address); \
137 } while (0) 137 } while (0)
138#endif 138#endif
139 139
140#define pmd_free_tlb(tlb, pmdp) \ 140#define pmd_free_tlb(tlb, pmdp, address) \
141 do { \ 141 do { \
142 tlb->need_flush = 1; \ 142 tlb->need_flush = 1; \
143 __pmd_free_tlb(tlb, pmdp); \ 143 __pmd_free_tlb(tlb, pmdp, address); \
144 } while (0) 144 } while (0)
145 145
146#define tlb_migrate_finish(mm) do {} while (0) 146#define tlb_migrate_finish(mm) do {} while (0)
diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h
index 92b73b6140ff..6ad76bf5fb40 100644
--- a/include/asm-generic/vmlinux.lds.h
+++ b/include/asm-generic/vmlinux.lds.h
@@ -30,9 +30,7 @@
30 * EXCEPTION_TABLE(...) 30 * EXCEPTION_TABLE(...)
31 * NOTES 31 * NOTES
32 * 32 *
33 * __bss_start = .; 33 * BSS_SECTION(0, 0, 0)
34 * BSS_SECTION(0, 0)
35 * __bss_stop = .;
36 * _end = .; 34 * _end = .;
37 * 35 *
38 * /DISCARD/ : { 36 * /DISCARD/ : {
@@ -191,7 +189,7 @@
191 . = ALIGN(align); \ 189 . = ALIGN(align); \
192 *(.data.cacheline_aligned) 190 *(.data.cacheline_aligned)
193 191
194#define INIT_TASK(align) \ 192#define INIT_TASK_DATA(align) \
195 . = ALIGN(align); \ 193 . = ALIGN(align); \
196 *(.data.init_task) 194 *(.data.init_task)
197 195
@@ -434,14 +432,15 @@
434/* 432/*
435 * Init task 433 * Init task
436 */ 434 */
437#define INIT_TASK_DATA(align) \ 435#define INIT_TASK_DATA_SECTION(align) \
438 . = ALIGN(align); \ 436 . = ALIGN(align); \
439 .data.init_task : { \ 437 .data.init_task : { \
440 INIT_TASK \ 438 INIT_TASK_DATA(align) \
441 } 439 }
442 440
443#ifdef CONFIG_CONSTRUCTORS 441#ifdef CONFIG_CONSTRUCTORS
444#define KERNEL_CTORS() VMLINUX_SYMBOL(__ctors_start) = .; \ 442#define KERNEL_CTORS() . = ALIGN(8); \
443 VMLINUX_SYMBOL(__ctors_start) = .; \
445 *(.ctors) \ 444 *(.ctors) \
446 VMLINUX_SYMBOL(__ctors_end) = .; 445 VMLINUX_SYMBOL(__ctors_end) = .;
447#else 446#else
@@ -488,7 +487,8 @@
488 * bss (Block Started by Symbol) - uninitialized data 487 * bss (Block Started by Symbol) - uninitialized data
489 * zeroed during startup 488 * zeroed during startup
490 */ 489 */
491#define SBSS \ 490#define SBSS(sbss_align) \
491 . = ALIGN(sbss_align); \
492 .sbss : AT(ADDR(.sbss) - LOAD_OFFSET) { \ 492 .sbss : AT(ADDR(.sbss) - LOAD_OFFSET) { \
493 *(.sbss) \ 493 *(.sbss) \
494 *(.scommon) \ 494 *(.scommon) \
@@ -497,12 +497,10 @@
497#define BSS(bss_align) \ 497#define BSS(bss_align) \
498 . = ALIGN(bss_align); \ 498 . = ALIGN(bss_align); \
499 .bss : AT(ADDR(.bss) - LOAD_OFFSET) { \ 499 .bss : AT(ADDR(.bss) - LOAD_OFFSET) { \
500 VMLINUX_SYMBOL(__bss_start) = .; \
501 *(.bss.page_aligned) \ 500 *(.bss.page_aligned) \
502 *(.dynbss) \ 501 *(.dynbss) \
503 *(.bss) \ 502 *(.bss) \
504 *(COMMON) \ 503 *(COMMON) \
505 VMLINUX_SYMBOL(__bss_stop) = .; \
506 } 504 }
507 505
508/* 506/*
@@ -704,15 +702,15 @@
704 * matches the requirment of PAGE_ALIGNED_DATA. 702 * matches the requirment of PAGE_ALIGNED_DATA.
705 * 703 *
706 * use 0 as page_align if page_aligned data is not used */ 704 * use 0 as page_align if page_aligned data is not used */
707#define RW_DATA_SECTION(cacheline, nosave, pagealigned, inittask) \ 705#define RW_DATA_SECTION(cacheline, pagealigned, inittask) \
708 . = ALIGN(PAGE_SIZE); \ 706 . = ALIGN(PAGE_SIZE); \
709 .data : AT(ADDR(.data) - LOAD_OFFSET) { \ 707 .data : AT(ADDR(.data) - LOAD_OFFSET) { \
710 INIT_TASK(inittask) \ 708 INIT_TASK_DATA(inittask) \
711 CACHELINE_ALIGNED_DATA(cacheline) \ 709 CACHELINE_ALIGNED_DATA(cacheline) \
712 READ_MOSTLY_DATA(cacheline) \ 710 READ_MOSTLY_DATA(cacheline) \
713 DATA_DATA \ 711 DATA_DATA \
714 CONSTRUCTORS \ 712 CONSTRUCTORS \
715 NOSAVE_DATA(nosave) \ 713 NOSAVE_DATA \
716 PAGE_ALIGNED_DATA(pagealigned) \ 714 PAGE_ALIGNED_DATA(pagealigned) \
717 } 715 }
718 716
@@ -734,8 +732,10 @@
734 INIT_RAM_FS \ 732 INIT_RAM_FS \
735 } 733 }
736 734
737#define BSS_SECTION(sbss_align, bss_align) \ 735#define BSS_SECTION(sbss_align, bss_align, stop_align) \
738 SBSS \ 736 . = ALIGN(sbss_align); \
737 VMLINUX_SYMBOL(__bss_start) = .; \
738 SBSS(sbss_align) \
739 BSS(bss_align) \ 739 BSS(bss_align) \
740 . = ALIGN(4); 740 . = ALIGN(stop_align); \
741 741 VMLINUX_SYMBOL(__bss_stop) = .;
diff --git a/include/drm/drm_edid.h b/include/drm/drm_edid.h
index c263e4d71754..7d6c9a2dfcbb 100644
--- a/include/drm/drm_edid.h
+++ b/include/drm/drm_edid.h
@@ -35,11 +35,11 @@ struct est_timings {
35} __attribute__((packed)); 35} __attribute__((packed));
36 36
37/* 00=16:10, 01=4:3, 10=5:4, 11=16:9 */ 37/* 00=16:10, 01=4:3, 10=5:4, 11=16:9 */
38#define EDID_TIMING_ASPECT_SHIFT 0 38#define EDID_TIMING_ASPECT_SHIFT 6
39#define EDID_TIMING_ASPECT_MASK (0x3 << EDID_TIMING_ASPECT_SHIFT) 39#define EDID_TIMING_ASPECT_MASK (0x3 << EDID_TIMING_ASPECT_SHIFT)
40 40
41/* need to add 60 */ 41/* need to add 60 */
42#define EDID_TIMING_VFREQ_SHIFT 2 42#define EDID_TIMING_VFREQ_SHIFT 0
43#define EDID_TIMING_VFREQ_MASK (0x3f << EDID_TIMING_VFREQ_SHIFT) 43#define EDID_TIMING_VFREQ_MASK (0x3f << EDID_TIMING_VFREQ_SHIFT)
44 44
45struct std_timing { 45struct std_timing {
@@ -47,11 +47,11 @@ struct std_timing {
47 u8 vfreq_aspect; 47 u8 vfreq_aspect;
48} __attribute__((packed)); 48} __attribute__((packed));
49 49
50#define DRM_EDID_PT_HSYNC_POSITIVE (1 << 6) 50#define DRM_EDID_PT_HSYNC_POSITIVE (1 << 1)
51#define DRM_EDID_PT_VSYNC_POSITIVE (1 << 5) 51#define DRM_EDID_PT_VSYNC_POSITIVE (1 << 2)
52#define DRM_EDID_PT_SEPARATE_SYNC (3 << 3) 52#define DRM_EDID_PT_SEPARATE_SYNC (3 << 3)
53#define DRM_EDID_PT_STEREO (1 << 2) 53#define DRM_EDID_PT_STEREO (1 << 5)
54#define DRM_EDID_PT_INTERLACED (1 << 1) 54#define DRM_EDID_PT_INTERLACED (1 << 7)
55 55
56/* If detailed data is pixel timing */ 56/* If detailed data is pixel timing */
57struct detailed_pixel_timing { 57struct detailed_pixel_timing {
@@ -93,7 +93,7 @@ struct detailed_data_monitor_range {
93} __attribute__((packed)); 93} __attribute__((packed));
94 94
95struct detailed_data_wpindex { 95struct detailed_data_wpindex {
96 u8 white_xy_lo; /* Upper 2 bits each */ 96 u8 white_yx_lo; /* Lower 2 bits each */
97 u8 white_x_hi; 97 u8 white_x_hi;
98 u8 white_y_hi; 98 u8 white_y_hi;
99 u8 gamma; /* need to divide by 100 then add 1 */ 99 u8 gamma; /* need to divide by 100 then add 1 */
@@ -135,21 +135,21 @@ struct detailed_timing {
135 } data; 135 } data;
136} __attribute__((packed)); 136} __attribute__((packed));
137 137
138#define DRM_EDID_INPUT_SERRATION_VSYNC (1 << 7) 138#define DRM_EDID_INPUT_SERRATION_VSYNC (1 << 0)
139#define DRM_EDID_INPUT_SYNC_ON_GREEN (1 << 5) 139#define DRM_EDID_INPUT_SYNC_ON_GREEN (1 << 1)
140#define DRM_EDID_INPUT_COMPOSITE_SYNC (1 << 4) 140#define DRM_EDID_INPUT_COMPOSITE_SYNC (1 << 2)
141#define DRM_EDID_INPUT_SEPARATE_SYNCS (1 << 3) 141#define DRM_EDID_INPUT_SEPARATE_SYNCS (1 << 3)
142#define DRM_EDID_INPUT_BLANK_TO_BLACK (1 << 2) 142#define DRM_EDID_INPUT_BLANK_TO_BLACK (1 << 4)
143#define DRM_EDID_INPUT_VIDEO_LEVEL (3 << 1) 143#define DRM_EDID_INPUT_VIDEO_LEVEL (3 << 5)
144#define DRM_EDID_INPUT_DIGITAL (1 << 0) /* bits above must be zero if set */ 144#define DRM_EDID_INPUT_DIGITAL (1 << 7) /* bits below must be zero if set */
145 145
146#define DRM_EDID_FEATURE_DEFAULT_GTF (1 << 7) 146#define DRM_EDID_FEATURE_DEFAULT_GTF (1 << 0)
147#define DRM_EDID_FEATURE_PREFERRED_TIMING (1 << 6) 147#define DRM_EDID_FEATURE_PREFERRED_TIMING (1 << 1)
148#define DRM_EDID_FEATURE_STANDARD_COLOR (1 << 5) 148#define DRM_EDID_FEATURE_STANDARD_COLOR (1 << 2)
149#define DRM_EDID_FEATURE_DISPLAY_TYPE (3 << 3) /* 00=mono, 01=rgb, 10=non-rgb, 11=unknown */ 149#define DRM_EDID_FEATURE_DISPLAY_TYPE (3 << 3) /* 00=mono, 01=rgb, 10=non-rgb, 11=unknown */
150#define DRM_EDID_FEATURE_PM_ACTIVE_OFF (1 << 2) 150#define DRM_EDID_FEATURE_PM_ACTIVE_OFF (1 << 5)
151#define DRM_EDID_FEATURE_PM_SUSPEND (1 << 1) 151#define DRM_EDID_FEATURE_PM_SUSPEND (1 << 6)
152#define DRM_EDID_FEATURE_PM_STANDBY (1 << 0) 152#define DRM_EDID_FEATURE_PM_STANDBY (1 << 7)
153 153
154struct edid { 154struct edid {
155 u8 header[8]; 155 u8 header[8];
diff --git a/include/drm/drm_pciids.h b/include/drm/drm_pciids.h
index 45c18672b093..853508499d20 100644
--- a/include/drm/drm_pciids.h
+++ b/include/drm/drm_pciids.h
@@ -43,6 +43,7 @@
43 {0x1002, 0x4A4F, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_R420|RADEON_NEW_MEMMAP}, \ 43 {0x1002, 0x4A4F, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_R420|RADEON_NEW_MEMMAP}, \
44 {0x1002, 0x4A50, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_R420|RADEON_NEW_MEMMAP}, \ 44 {0x1002, 0x4A50, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_R420|RADEON_NEW_MEMMAP}, \
45 {0x1002, 0x4A54, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_R420|RADEON_NEW_MEMMAP}, \ 45 {0x1002, 0x4A54, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_R420|RADEON_NEW_MEMMAP}, \
46 {0x1002, 0x4B48, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_R420|RADEON_NEW_MEMMAP}, \
46 {0x1002, 0x4B49, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_R420|RADEON_NEW_MEMMAP}, \ 47 {0x1002, 0x4B49, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_R420|RADEON_NEW_MEMMAP}, \
47 {0x1002, 0x4B4A, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_R420|RADEON_NEW_MEMMAP}, \ 48 {0x1002, 0x4B4A, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_R420|RADEON_NEW_MEMMAP}, \
48 {0x1002, 0x4B4B, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_R420|RADEON_NEW_MEMMAP}, \ 49 {0x1002, 0x4B4B, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_R420|RADEON_NEW_MEMMAP}, \
@@ -256,12 +257,16 @@
256 {0x1002, 0x940F, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_R600|RADEON_NEW_MEMMAP}, \ 257 {0x1002, 0x940F, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_R600|RADEON_NEW_MEMMAP}, \
257 {0x1002, 0x94A0, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV740|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ 258 {0x1002, 0x94A0, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV740|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \
258 {0x1002, 0x94A1, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV740|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ 259 {0x1002, 0x94A1, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV740|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \
260 {0x1002, 0x94A3, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV740|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \
259 {0x1002, 0x94B1, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV740|RADEON_NEW_MEMMAP}, \ 261 {0x1002, 0x94B1, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV740|RADEON_NEW_MEMMAP}, \
260 {0x1002, 0x94B3, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV740|RADEON_NEW_MEMMAP}, \ 262 {0x1002, 0x94B3, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV740|RADEON_NEW_MEMMAP}, \
263 {0x1002, 0x94B4, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV740|RADEON_NEW_MEMMAP}, \
261 {0x1002, 0x94B5, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV740|RADEON_NEW_MEMMAP}, \ 264 {0x1002, 0x94B5, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV740|RADEON_NEW_MEMMAP}, \
265 {0x1002, 0x94B9, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV740|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \
262 {0x1002, 0x9440, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV770|RADEON_NEW_MEMMAP}, \ 266 {0x1002, 0x9440, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV770|RADEON_NEW_MEMMAP}, \
263 {0x1002, 0x9441, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV770|RADEON_NEW_MEMMAP}, \ 267 {0x1002, 0x9441, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV770|RADEON_NEW_MEMMAP}, \
264 {0x1002, 0x9442, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV770|RADEON_NEW_MEMMAP}, \ 268 {0x1002, 0x9442, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV770|RADEON_NEW_MEMMAP}, \
269 {0x1002, 0x9443, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV770|RADEON_NEW_MEMMAP}, \
265 {0x1002, 0x9444, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV770|RADEON_NEW_MEMMAP}, \ 270 {0x1002, 0x9444, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV770|RADEON_NEW_MEMMAP}, \
266 {0x1002, 0x9446, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV770|RADEON_NEW_MEMMAP}, \ 271 {0x1002, 0x9446, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV770|RADEON_NEW_MEMMAP}, \
267 {0x1002, 0x944A, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV770|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ 272 {0x1002, 0x944A, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV770|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \
@@ -286,6 +291,7 @@
286 {0x1002, 0x948F, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV730|RADEON_NEW_MEMMAP}, \ 291 {0x1002, 0x948F, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV730|RADEON_NEW_MEMMAP}, \
287 {0x1002, 0x9490, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV730|RADEON_NEW_MEMMAP}, \ 292 {0x1002, 0x9490, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV730|RADEON_NEW_MEMMAP}, \
288 {0x1002, 0x9491, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV730|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ 293 {0x1002, 0x9491, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV730|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \
294 {0x1002, 0x9495, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV730|RADEON_NEW_MEMMAP}, \
289 {0x1002, 0x9498, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV730|RADEON_NEW_MEMMAP}, \ 295 {0x1002, 0x9498, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV730|RADEON_NEW_MEMMAP}, \
290 {0x1002, 0x949C, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV730|RADEON_NEW_MEMMAP}, \ 296 {0x1002, 0x949C, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV730|RADEON_NEW_MEMMAP}, \
291 {0x1002, 0x949E, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV730|RADEON_NEW_MEMMAP}, \ 297 {0x1002, 0x949E, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV730|RADEON_NEW_MEMMAP}, \
@@ -323,6 +329,7 @@
323 {0x1002, 0x9552, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV710|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ 329 {0x1002, 0x9552, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV710|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \
324 {0x1002, 0x9553, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV710|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ 330 {0x1002, 0x9553, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV710|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \
325 {0x1002, 0x9555, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV710|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ 331 {0x1002, 0x9555, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV710|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \
332 {0x1002, 0x9557, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV710|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \
326 {0x1002, 0x9580, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV630|RADEON_NEW_MEMMAP}, \ 333 {0x1002, 0x9580, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV630|RADEON_NEW_MEMMAP}, \
327 {0x1002, 0x9581, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV630|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ 334 {0x1002, 0x9581, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV630|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \
328 {0x1002, 0x9583, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV630|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ 335 {0x1002, 0x9583, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV630|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \
@@ -346,12 +353,12 @@
346 {0x1002, 0x9599, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV635|RADEON_NEW_MEMMAP}, \ 353 {0x1002, 0x9599, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV635|RADEON_NEW_MEMMAP}, \
347 {0x1002, 0x959B, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV635|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ 354 {0x1002, 0x959B, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV635|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \
348 {0x1002, 0x95C0, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV620|RADEON_NEW_MEMMAP}, \ 355 {0x1002, 0x95C0, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV620|RADEON_NEW_MEMMAP}, \
356 {0x1002, 0x95C2, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV620|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \
357 {0x1002, 0x95C4, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV620|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \
349 {0x1002, 0x95C5, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV620|RADEON_NEW_MEMMAP}, \ 358 {0x1002, 0x95C5, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV620|RADEON_NEW_MEMMAP}, \
350 {0x1002, 0x95C6, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV620|RADEON_NEW_MEMMAP}, \ 359 {0x1002, 0x95C6, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV620|RADEON_NEW_MEMMAP}, \
351 {0x1002, 0x95C7, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV620|RADEON_NEW_MEMMAP}, \ 360 {0x1002, 0x95C7, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV620|RADEON_NEW_MEMMAP}, \
352 {0x1002, 0x95C9, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV620|RADEON_NEW_MEMMAP}, \ 361 {0x1002, 0x95C9, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV620|RADEON_NEW_MEMMAP}, \
353 {0x1002, 0x95C2, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV620|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \
354 {0x1002, 0x95C4, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV620|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \
355 {0x1002, 0x95CC, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV620|RADEON_NEW_MEMMAP}, \ 362 {0x1002, 0x95CC, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV620|RADEON_NEW_MEMMAP}, \
356 {0x1002, 0x95CD, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV620|RADEON_NEW_MEMMAP}, \ 363 {0x1002, 0x95CD, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV620|RADEON_NEW_MEMMAP}, \
357 {0x1002, 0x95CE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV620|RADEON_NEW_MEMMAP}, \ 364 {0x1002, 0x95CE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV620|RADEON_NEW_MEMMAP}, \
@@ -363,6 +370,11 @@
363 {0x1002, 0x9614, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS780|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \ 370 {0x1002, 0x9614, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS780|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
364 {0x1002, 0x9615, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS780|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \ 371 {0x1002, 0x9615, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS780|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
365 {0x1002, 0x9616, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS780|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \ 372 {0x1002, 0x9616, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS780|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
373 {0x1002, 0x9710, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS880|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
374 {0x1002, 0x9711, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS880|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
375 {0x1002, 0x9712, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS880|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
376 {0x1002, 0x9713, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS880|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
377 {0x1002, 0x9714, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS880|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
366 {0, 0, 0} 378 {0, 0, 0}
367 379
368#define r128_PCI_IDS \ 380#define r128_PCI_IDS \
diff --git a/include/drm/radeon_drm.h b/include/drm/radeon_drm.h
index 41862e9a4c20..af4b4826997e 100644
--- a/include/drm/radeon_drm.h
+++ b/include/drm/radeon_drm.h
@@ -506,6 +506,8 @@ typedef struct {
506#define DRM_RADEON_GEM_WAIT_IDLE 0x24 506#define DRM_RADEON_GEM_WAIT_IDLE 0x24
507#define DRM_RADEON_CS 0x26 507#define DRM_RADEON_CS 0x26
508#define DRM_RADEON_INFO 0x27 508#define DRM_RADEON_INFO 0x27
509#define DRM_RADEON_GEM_SET_TILING 0x28
510#define DRM_RADEON_GEM_GET_TILING 0x29
509 511
510#define DRM_IOCTL_RADEON_CP_INIT DRM_IOW( DRM_COMMAND_BASE + DRM_RADEON_CP_INIT, drm_radeon_init_t) 512#define DRM_IOCTL_RADEON_CP_INIT DRM_IOW( DRM_COMMAND_BASE + DRM_RADEON_CP_INIT, drm_radeon_init_t)
511#define DRM_IOCTL_RADEON_CP_START DRM_IO( DRM_COMMAND_BASE + DRM_RADEON_CP_START) 513#define DRM_IOCTL_RADEON_CP_START DRM_IO( DRM_COMMAND_BASE + DRM_RADEON_CP_START)
@@ -544,7 +546,8 @@ typedef struct {
544#define DRM_IOCTL_RADEON_GEM_WAIT_IDLE DRM_IOW(DRM_COMMAND_BASE + DRM_RADEON_GEM_WAIT_IDLE, struct drm_radeon_gem_wait_idle) 546#define DRM_IOCTL_RADEON_GEM_WAIT_IDLE DRM_IOW(DRM_COMMAND_BASE + DRM_RADEON_GEM_WAIT_IDLE, struct drm_radeon_gem_wait_idle)
545#define DRM_IOCTL_RADEON_CS DRM_IOWR(DRM_COMMAND_BASE + DRM_RADEON_CS, struct drm_radeon_cs) 547#define DRM_IOCTL_RADEON_CS DRM_IOWR(DRM_COMMAND_BASE + DRM_RADEON_CS, struct drm_radeon_cs)
546#define DRM_IOCTL_RADEON_INFO DRM_IOWR(DRM_COMMAND_BASE + DRM_RADEON_INFO, struct drm_radeon_info) 548#define DRM_IOCTL_RADEON_INFO DRM_IOWR(DRM_COMMAND_BASE + DRM_RADEON_INFO, struct drm_radeon_info)
547 549#define DRM_IOCTL_RADEON_SET_TILING DRM_IOWR(DRM_COMMAND_BASE + DRM_RADEON_GEM_SET_TILING, struct drm_radeon_gem_set_tiling)
550#define DRM_IOCTL_RADEON_GET_TILING DRM_IOWR(DRM_COMMAND_BASE + DRM_RADEON_GEM_GET_TILING, struct drm_radeon_gem_get_tiling)
548 551
549typedef struct drm_radeon_init { 552typedef struct drm_radeon_init {
550 enum { 553 enum {
@@ -796,6 +799,24 @@ struct drm_radeon_gem_create {
796 uint32_t flags; 799 uint32_t flags;
797}; 800};
798 801
802#define RADEON_TILING_MACRO 0x1
803#define RADEON_TILING_MICRO 0x2
804#define RADEON_TILING_SWAP 0x4
805#define RADEON_TILING_SURFACE 0x8 /* this object requires a surface
806 * when mapped - i.e. front buffer */
807
808struct drm_radeon_gem_set_tiling {
809 uint32_t handle;
810 uint32_t tiling_flags;
811 uint32_t pitch;
812};
813
814struct drm_radeon_gem_get_tiling {
815 uint32_t handle;
816 uint32_t tiling_flags;
817 uint32_t pitch;
818};
819
799struct drm_radeon_gem_mmap { 820struct drm_radeon_gem_mmap {
800 uint32_t handle; 821 uint32_t handle;
801 uint32_t pad; 822 uint32_t pad;
diff --git a/include/drm/ttm/ttm_bo_driver.h b/include/drm/ttm/ttm_bo_driver.h
index 62ed733c52a2..a68829db381a 100644
--- a/include/drm/ttm/ttm_bo_driver.h
+++ b/include/drm/ttm/ttm_bo_driver.h
@@ -121,6 +121,7 @@ struct ttm_backend {
121#define TTM_PAGE_FLAG_SWAPPED (1 << 4) 121#define TTM_PAGE_FLAG_SWAPPED (1 << 4)
122#define TTM_PAGE_FLAG_PERSISTANT_SWAP (1 << 5) 122#define TTM_PAGE_FLAG_PERSISTANT_SWAP (1 << 5)
123#define TTM_PAGE_FLAG_ZERO_ALLOC (1 << 6) 123#define TTM_PAGE_FLAG_ZERO_ALLOC (1 << 6)
124#define TTM_PAGE_FLAG_DMA32 (1 << 7)
124 125
125enum ttm_caching_state { 126enum ttm_caching_state {
126 tt_uncached, 127 tt_uncached,
@@ -353,6 +354,14 @@ struct ttm_bo_driver {
353 int (*sync_obj_flush) (void *sync_obj, void *sync_arg); 354 int (*sync_obj_flush) (void *sync_obj, void *sync_arg);
354 void (*sync_obj_unref) (void **sync_obj); 355 void (*sync_obj_unref) (void **sync_obj);
355 void *(*sync_obj_ref) (void *sync_obj); 356 void *(*sync_obj_ref) (void *sync_obj);
357
358 /* hook to notify driver about a driver move so it
359 * can do tiling things */
360 void (*move_notify)(struct ttm_buffer_object *bo,
361 struct ttm_mem_reg *new_mem);
362 /* notify the driver we are taking a fault on this BO
363 * and have reserved it */
364 void (*fault_reserve_notify)(struct ttm_buffer_object *bo);
356}; 365};
357 366
358#define TTM_NUM_MEM_TYPES 8 367#define TTM_NUM_MEM_TYPES 8
@@ -429,6 +438,8 @@ struct ttm_bo_device {
429 */ 438 */
430 439
431 struct delayed_work wq; 440 struct delayed_work wq;
441
442 bool need_dma32;
432}; 443};
433 444
434/** 445/**
@@ -648,7 +659,14 @@ extern int ttm_bo_device_release(struct ttm_bo_device *bdev);
648extern int ttm_bo_device_init(struct ttm_bo_device *bdev, 659extern int ttm_bo_device_init(struct ttm_bo_device *bdev,
649 struct ttm_mem_global *mem_glob, 660 struct ttm_mem_global *mem_glob,
650 struct ttm_bo_driver *driver, 661 struct ttm_bo_driver *driver,
651 uint64_t file_page_offset); 662 uint64_t file_page_offset, bool need_dma32);
663
664/**
665 * ttm_bo_unmap_virtual
666 *
667 * @bo: tear down the virtual mappings for this BO
668 */
669extern void ttm_bo_unmap_virtual(struct ttm_buffer_object *bo);
652 670
653/** 671/**
654 * ttm_bo_reserve: 672 * ttm_bo_reserve:
diff --git a/include/drm/ttm/ttm_module.h b/include/drm/ttm/ttm_module.h
index 889a4c7958ae..d1d433834e4f 100644
--- a/include/drm/ttm/ttm_module.h
+++ b/include/drm/ttm/ttm_module.h
@@ -33,7 +33,7 @@
33 33
34#include <linux/kernel.h> 34#include <linux/kernel.h>
35 35
36#define TTM_PFX "[TTM]" 36#define TTM_PFX "[TTM] "
37 37
38enum ttm_global_types { 38enum ttm_global_types {
39 TTM_GLOBAL_TTM_MEM = 0, 39 TTM_GLOBAL_TTM_MEM = 0,
diff --git a/include/linux/aio.h b/include/linux/aio.h
index b16a957030f8..47f7d932a01d 100644
--- a/include/linux/aio.h
+++ b/include/linux/aio.h
@@ -121,9 +121,9 @@ struct kiocb {
121 121
122 /* 122 /*
123 * If the aio_resfd field of the userspace iocb is not zero, 123 * If the aio_resfd field of the userspace iocb is not zero,
124 * this is the underlying file* to deliver event to. 124 * this is the underlying eventfd context to deliver events to.
125 */ 125 */
126 struct file *ki_eventfd; 126 struct eventfd_ctx *ki_eventfd;
127}; 127};
128 128
129#define is_sync_kiocb(iocb) ((iocb)->ki_key == KIOCB_SYNC_KEY) 129#define is_sync_kiocb(iocb) ((iocb)->ki_key == KIOCB_SYNC_KEY)
diff --git a/include/linux/backing-dev.h b/include/linux/backing-dev.h
index 0ec2c594868e..1d52425a6118 100644
--- a/include/linux/backing-dev.h
+++ b/include/linux/backing-dev.h
@@ -229,9 +229,14 @@ static inline int bdi_rw_congested(struct backing_dev_info *bdi)
229 (1 << BDI_async_congested)); 229 (1 << BDI_async_congested));
230} 230}
231 231
232void clear_bdi_congested(struct backing_dev_info *bdi, int rw); 232enum {
233void set_bdi_congested(struct backing_dev_info *bdi, int rw); 233 BLK_RW_ASYNC = 0,
234long congestion_wait(int rw, long timeout); 234 BLK_RW_SYNC = 1,
235};
236
237void clear_bdi_congested(struct backing_dev_info *bdi, int sync);
238void set_bdi_congested(struct backing_dev_info *bdi, int sync);
239long congestion_wait(int sync, long timeout);
235 240
236 241
237static inline bool bdi_cap_writeback_dirty(struct backing_dev_info *bdi) 242static inline bool bdi_cap_writeback_dirty(struct backing_dev_info *bdi)
diff --git a/include/linux/bio.h b/include/linux/bio.h
index 2a04eb54c0dd..2892b710771c 100644
--- a/include/linux/bio.h
+++ b/include/linux/bio.h
@@ -319,7 +319,6 @@ static inline int bio_has_allocated_vec(struct bio *bio)
319 */ 319 */
320struct bio_integrity_payload { 320struct bio_integrity_payload {
321 struct bio *bip_bio; /* parent bio */ 321 struct bio *bip_bio; /* parent bio */
322 struct bio_vec *bip_vec; /* integrity data vector */
323 322
324 sector_t bip_sector; /* virtual start sector */ 323 sector_t bip_sector; /* virtual start sector */
325 324
@@ -328,11 +327,12 @@ struct bio_integrity_payload {
328 327
329 unsigned int bip_size; 328 unsigned int bip_size;
330 329
331 unsigned short bip_pool; /* pool the ivec came from */ 330 unsigned short bip_slab; /* slab the bip came from */
332 unsigned short bip_vcnt; /* # of integrity bio_vecs */ 331 unsigned short bip_vcnt; /* # of integrity bio_vecs */
333 unsigned short bip_idx; /* current bip_vec index */ 332 unsigned short bip_idx; /* current bip_vec index */
334 333
335 struct work_struct bip_work; /* I/O completion */ 334 struct work_struct bip_work; /* I/O completion */
335 struct bio_vec bip_vec[0]; /* embedded bvec array */
336}; 336};
337#endif /* CONFIG_BLK_DEV_INTEGRITY */ 337#endif /* CONFIG_BLK_DEV_INTEGRITY */
338 338
@@ -430,6 +430,9 @@ struct bio_set {
430 unsigned int front_pad; 430 unsigned int front_pad;
431 431
432 mempool_t *bio_pool; 432 mempool_t *bio_pool;
433#if defined(CONFIG_BLK_DEV_INTEGRITY)
434 mempool_t *bio_integrity_pool;
435#endif
433 mempool_t *bvec_pool; 436 mempool_t *bvec_pool;
434}; 437};
435 438
@@ -634,8 +637,9 @@ static inline struct bio *bio_list_get(struct bio_list *bl)
634 637
635#define bio_integrity(bio) (bio->bi_integrity != NULL) 638#define bio_integrity(bio) (bio->bi_integrity != NULL)
636 639
640extern struct bio_integrity_payload *bio_integrity_alloc_bioset(struct bio *, gfp_t, unsigned int, struct bio_set *);
637extern struct bio_integrity_payload *bio_integrity_alloc(struct bio *, gfp_t, unsigned int); 641extern struct bio_integrity_payload *bio_integrity_alloc(struct bio *, gfp_t, unsigned int);
638extern void bio_integrity_free(struct bio *); 642extern void bio_integrity_free(struct bio *, struct bio_set *);
639extern int bio_integrity_add_page(struct bio *, struct page *, unsigned int, unsigned int); 643extern int bio_integrity_add_page(struct bio *, struct page *, unsigned int, unsigned int);
640extern int bio_integrity_enabled(struct bio *bio); 644extern int bio_integrity_enabled(struct bio *bio);
641extern int bio_integrity_set_tag(struct bio *, void *, unsigned int); 645extern int bio_integrity_set_tag(struct bio *, void *, unsigned int);
@@ -645,21 +649,27 @@ extern void bio_integrity_endio(struct bio *, int);
645extern void bio_integrity_advance(struct bio *, unsigned int); 649extern void bio_integrity_advance(struct bio *, unsigned int);
646extern void bio_integrity_trim(struct bio *, unsigned int, unsigned int); 650extern void bio_integrity_trim(struct bio *, unsigned int, unsigned int);
647extern void bio_integrity_split(struct bio *, struct bio_pair *, int); 651extern void bio_integrity_split(struct bio *, struct bio_pair *, int);
648extern int bio_integrity_clone(struct bio *, struct bio *, gfp_t); 652extern int bio_integrity_clone(struct bio *, struct bio *, gfp_t, struct bio_set *);
653extern int bioset_integrity_create(struct bio_set *, int);
654extern void bioset_integrity_free(struct bio_set *);
655extern void bio_integrity_init(void);
649 656
650#else /* CONFIG_BLK_DEV_INTEGRITY */ 657#else /* CONFIG_BLK_DEV_INTEGRITY */
651 658
652#define bio_integrity(a) (0) 659#define bio_integrity(a) (0)
660#define bioset_integrity_create(a, b) (0)
653#define bio_integrity_prep(a) (0) 661#define bio_integrity_prep(a) (0)
654#define bio_integrity_enabled(a) (0) 662#define bio_integrity_enabled(a) (0)
655#define bio_integrity_clone(a, b, c) (0) 663#define bio_integrity_clone(a, b, c, d) (0)
656#define bio_integrity_free(a) do { } while (0) 664#define bioset_integrity_free(a) do { } while (0)
665#define bio_integrity_free(a, b) do { } while (0)
657#define bio_integrity_endio(a, b) do { } while (0) 666#define bio_integrity_endio(a, b) do { } while (0)
658#define bio_integrity_advance(a, b) do { } while (0) 667#define bio_integrity_advance(a, b) do { } while (0)
659#define bio_integrity_trim(a, b, c) do { } while (0) 668#define bio_integrity_trim(a, b, c) do { } while (0)
660#define bio_integrity_split(a, b, c) do { } while (0) 669#define bio_integrity_split(a, b, c) do { } while (0)
661#define bio_integrity_set_tag(a, b, c) do { } while (0) 670#define bio_integrity_set_tag(a, b, c) do { } while (0)
662#define bio_integrity_get_tag(a, b, c) do { } while (0) 671#define bio_integrity_get_tag(a, b, c) do { } while (0)
672#define bio_integrity_init(a) do { } while (0)
663 673
664#endif /* CONFIG_BLK_DEV_INTEGRITY */ 674#endif /* CONFIG_BLK_DEV_INTEGRITY */
665 675
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index 8963d9149b5f..69103e053c92 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -70,11 +70,6 @@ enum rq_cmd_type_bits {
70 REQ_TYPE_ATA_PC, 70 REQ_TYPE_ATA_PC,
71}; 71};
72 72
73enum {
74 BLK_RW_ASYNC = 0,
75 BLK_RW_SYNC = 1,
76};
77
78/* 73/*
79 * For request of type REQ_TYPE_LINUX_BLOCK, rq->cmd[0] is the opcode being 74 * For request of type REQ_TYPE_LINUX_BLOCK, rq->cmd[0] is the opcode being
80 * sent down (similar to how REQ_TYPE_BLOCK_PC means that ->cmd[] holds a 75 * sent down (similar to how REQ_TYPE_BLOCK_PC means that ->cmd[] holds a
@@ -301,12 +296,6 @@ struct blk_queue_tag {
301#define BLK_SCSI_MAX_CMDS (256) 296#define BLK_SCSI_MAX_CMDS (256)
302#define BLK_SCSI_CMD_PER_LONG (BLK_SCSI_MAX_CMDS / (sizeof(long) * 8)) 297#define BLK_SCSI_CMD_PER_LONG (BLK_SCSI_MAX_CMDS / (sizeof(long) * 8))
303 298
304struct blk_cmd_filter {
305 unsigned long read_ok[BLK_SCSI_CMD_PER_LONG];
306 unsigned long write_ok[BLK_SCSI_CMD_PER_LONG];
307 struct kobject kobj;
308};
309
310struct queue_limits { 299struct queue_limits {
311 unsigned long bounce_pfn; 300 unsigned long bounce_pfn;
312 unsigned long seg_boundary_mask; 301 unsigned long seg_boundary_mask;
@@ -445,7 +434,6 @@ struct request_queue
445#if defined(CONFIG_BLK_DEV_BSG) 434#if defined(CONFIG_BLK_DEV_BSG)
446 struct bsg_class_device bsg_dev; 435 struct bsg_class_device bsg_dev;
447#endif 436#endif
448 struct blk_cmd_filter cmd_filter;
449}; 437};
450 438
451#define QUEUE_FLAG_CLUSTER 0 /* cluster several segments into 1 */ 439#define QUEUE_FLAG_CLUSTER 0 /* cluster several segments into 1 */
@@ -730,6 +718,7 @@ struct rq_map_data {
730 int nr_entries; 718 int nr_entries;
731 unsigned long offset; 719 unsigned long offset;
732 int null_mapped; 720 int null_mapped;
721 int from_user;
733}; 722};
734 723
735struct req_iterator { 724struct req_iterator {
@@ -786,18 +775,18 @@ extern int sg_scsi_ioctl(struct request_queue *, struct gendisk *, fmode_t,
786 * congested queues, and wake up anyone who was waiting for requests to be 775 * congested queues, and wake up anyone who was waiting for requests to be
787 * put back. 776 * put back.
788 */ 777 */
789static inline void blk_clear_queue_congested(struct request_queue *q, int rw) 778static inline void blk_clear_queue_congested(struct request_queue *q, int sync)
790{ 779{
791 clear_bdi_congested(&q->backing_dev_info, rw); 780 clear_bdi_congested(&q->backing_dev_info, sync);
792} 781}
793 782
794/* 783/*
795 * A queue has just entered congestion. Flag that in the queue's VM-visible 784 * A queue has just entered congestion. Flag that in the queue's VM-visible
796 * state flags and increment the global gounter of congested queues. 785 * state flags and increment the global gounter of congested queues.
797 */ 786 */
798static inline void blk_set_queue_congested(struct request_queue *q, int rw) 787static inline void blk_set_queue_congested(struct request_queue *q, int sync)
799{ 788{
800 set_bdi_congested(&q->backing_dev_info, rw); 789 set_bdi_congested(&q->backing_dev_info, sync);
801} 790}
802 791
803extern void blk_start_queue(struct request_queue *q); 792extern void blk_start_queue(struct request_queue *q);
@@ -924,6 +913,7 @@ extern void blk_queue_logical_block_size(struct request_queue *, unsigned short)
924extern void blk_queue_physical_block_size(struct request_queue *, unsigned short); 913extern void blk_queue_physical_block_size(struct request_queue *, unsigned short);
925extern void blk_queue_alignment_offset(struct request_queue *q, 914extern void blk_queue_alignment_offset(struct request_queue *q,
926 unsigned int alignment); 915 unsigned int alignment);
916extern void blk_limits_io_min(struct queue_limits *limits, unsigned int min);
927extern void blk_queue_io_min(struct request_queue *q, unsigned int min); 917extern void blk_queue_io_min(struct request_queue *q, unsigned int min);
928extern void blk_queue_io_opt(struct request_queue *q, unsigned int opt); 918extern void blk_queue_io_opt(struct request_queue *q, unsigned int opt);
929extern void blk_set_default_limits(struct queue_limits *lim); 919extern void blk_set_default_limits(struct queue_limits *lim);
@@ -998,13 +988,7 @@ static inline int sb_issue_discard(struct super_block *sb,
998 return blkdev_issue_discard(sb->s_bdev, block, nr_blocks, GFP_KERNEL); 988 return blkdev_issue_discard(sb->s_bdev, block, nr_blocks, GFP_KERNEL);
999} 989}
1000 990
1001/* 991extern int blk_verify_command(unsigned char *cmd, fmode_t has_write_perm);
1002* command filter functions
1003*/
1004extern int blk_verify_command(struct blk_cmd_filter *filter,
1005 unsigned char *cmd, fmode_t has_write_perm);
1006extern void blk_unregister_filter(struct gendisk *disk);
1007extern void blk_set_cmd_filter_defaults(struct blk_cmd_filter *filter);
1008 992
1009#define MAX_PHYS_SEGMENTS 128 993#define MAX_PHYS_SEGMENTS 128
1010#define MAX_HW_SEGMENTS 128 994#define MAX_HW_SEGMENTS 128
diff --git a/include/linux/cb710.h b/include/linux/cb710.h
index 63bc9a4d2926..8cc10411bab2 100644
--- a/include/linux/cb710.h
+++ b/include/linux/cb710.h
@@ -140,29 +140,6 @@ void cb710_dump_regs(struct cb710_chip *chip, unsigned dump);
140#include <linux/highmem.h> 140#include <linux/highmem.h>
141#include <linux/scatterlist.h> 141#include <linux/scatterlist.h>
142 142
143/**
144 * cb710_sg_miter_stop_writing - stop mapping iteration after writing
145 * @miter: sg mapping iter to be stopped
146 *
147 * Description:
148 * Stops mapping iterator @miter. @miter should have been started
149 * started using sg_miter_start(). A stopped iteration can be
150 * resumed by calling sg_miter_next() on it. This is useful when
151 * resources (kmap) need to be released during iteration.
152 *
153 * This is a convenience wrapper that will be optimized out for arches
154 * that don't need flush_kernel_dcache_page().
155 *
156 * Context:
157 * IRQ disabled if the SG_MITER_ATOMIC is set. Don't care otherwise.
158 */
159static inline void cb710_sg_miter_stop_writing(struct sg_mapping_iter *miter)
160{
161 if (miter->page)
162 flush_kernel_dcache_page(miter->page);
163 sg_miter_stop(miter);
164}
165
166/* 143/*
167 * 32-bit PIO mapping sg iterator 144 * 32-bit PIO mapping sg iterator
168 * 145 *
@@ -171,12 +148,12 @@ static inline void cb710_sg_miter_stop_writing(struct sg_mapping_iter *miter)
171 * without DMA support). 148 * without DMA support).
172 * 149 *
173 * Best-case reading (transfer from device): 150 * Best-case reading (transfer from device):
174 * sg_miter_start(); 151 * sg_miter_start(, SG_MITER_TO_SG);
175 * cb710_sg_dwiter_write_from_io(); 152 * cb710_sg_dwiter_write_from_io();
176 * cb710_sg_miter_stop_writing(); 153 * sg_miter_stop();
177 * 154 *
178 * Best-case writing (transfer to device): 155 * Best-case writing (transfer to device):
179 * sg_miter_start(); 156 * sg_miter_start(, SG_MITER_FROM_SG);
180 * cb710_sg_dwiter_read_to_io(); 157 * cb710_sg_dwiter_read_to_io();
181 * sg_miter_stop(); 158 * sg_miter_stop();
182 */ 159 */
diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h
index 665fa70e4094..90bba9e62286 100644
--- a/include/linux/cgroup.h
+++ b/include/linux/cgroup.h
@@ -179,14 +179,11 @@ struct cgroup {
179 */ 179 */
180 struct list_head release_list; 180 struct list_head release_list;
181 181
182 /* pids_mutex protects the fields below */ 182 /* pids_mutex protects pids_list and cached pid arrays. */
183 struct rw_semaphore pids_mutex; 183 struct rw_semaphore pids_mutex;
184 /* Array of process ids in the cgroup */ 184
185 pid_t *tasks_pids; 185 /* Linked list of struct cgroup_pids */
186 /* How many files are using the current tasks_pids array */ 186 struct list_head pids_list;
187 int pids_use_count;
188 /* Length of the current tasks_pids array */
189 int pids_length;
190 187
191 /* For RCU-protected deletion */ 188 /* For RCU-protected deletion */
192 struct rcu_head rcu_head; 189 struct rcu_head rcu_head;
@@ -366,6 +363,23 @@ int cgroup_task_count(const struct cgroup *cgrp);
366int cgroup_is_descendant(const struct cgroup *cgrp, struct task_struct *task); 363int cgroup_is_descendant(const struct cgroup *cgrp, struct task_struct *task);
367 364
368/* 365/*
366 * When the subsys has to access css and may add permanent refcnt to css,
367 * it should take care of racy conditions with rmdir(). Following set of
368 * functions, is for stop/restart rmdir if necessary.
369 * Because these will call css_get/put, "css" should be alive css.
370 *
371 * cgroup_exclude_rmdir();
372 * ...do some jobs which may access arbitrary empty cgroup
373 * cgroup_release_and_wakeup_rmdir();
374 *
375 * When someone removes a cgroup while cgroup_exclude_rmdir() holds it,
376 * it sleeps and cgroup_release_and_wakeup_rmdir() will wake him up.
377 */
378
379void cgroup_exclude_rmdir(struct cgroup_subsys_state *css);
380void cgroup_release_and_wakeup_rmdir(struct cgroup_subsys_state *css);
381
382/*
369 * Control Group subsystem type. 383 * Control Group subsystem type.
370 * See Documentation/cgroups/cgroups.txt for details 384 * See Documentation/cgroups/cgroups.txt for details
371 */ 385 */
diff --git a/include/linux/clockchips.h b/include/linux/clockchips.h
index 20a100fe2b4f..3a1dbba4d3ae 100644
--- a/include/linux/clockchips.h
+++ b/include/linux/clockchips.h
@@ -143,12 +143,3 @@ extern void clockevents_notify(unsigned long reason, void *arg);
143#endif 143#endif
144 144
145#endif 145#endif
146
147#ifdef CONFIG_GENERIC_CLOCKEVENTS
148extern ktime_t clockevents_get_next_event(int cpu);
149#else
150static inline ktime_t clockevents_get_next_event(int cpu)
151{
152 return (ktime_t) { .tv64 = KTIME_MAX };
153}
154#endif
diff --git a/include/linux/clocksource.h b/include/linux/clocksource.h
index c56457c8334e..1219be4fb42e 100644
--- a/include/linux/clocksource.h
+++ b/include/linux/clocksource.h
@@ -293,7 +293,12 @@ static inline int clocksource_enable(struct clocksource *cs)
293 if (cs->enable) 293 if (cs->enable)
294 ret = cs->enable(cs); 294 ret = cs->enable(cs);
295 295
296 /* save mult_orig on enable */ 296 /*
297 * The frequency may have changed while the clocksource
298 * was disabled. If so the code in ->enable() must update
299 * the mult value to reflect the new frequency. Make sure
300 * mult_orig follows this change.
301 */
297 cs->mult_orig = cs->mult; 302 cs->mult_orig = cs->mult;
298 303
299 return ret; 304 return ret;
@@ -309,6 +314,13 @@ static inline int clocksource_enable(struct clocksource *cs)
309 */ 314 */
310static inline void clocksource_disable(struct clocksource *cs) 315static inline void clocksource_disable(struct clocksource *cs)
311{ 316{
317 /*
318 * Save mult_orig in mult so clocksource_enable() can
319 * restore the value regardless if ->enable() updates
320 * the value of mult or not.
321 */
322 cs->mult = cs->mult_orig;
323
312 if (cs->disable) 324 if (cs->disable)
313 cs->disable(cs); 325 cs->disable(cs);
314} 326}
diff --git a/include/linux/console_struct.h b/include/linux/console_struct.h
index d71f7c0f931b..38fe59dc89ae 100644
--- a/include/linux/console_struct.h
+++ b/include/linux/console_struct.h
@@ -89,7 +89,6 @@ struct vc_data {
89 unsigned int vc_need_wrap : 1; 89 unsigned int vc_need_wrap : 1;
90 unsigned int vc_can_do_color : 1; 90 unsigned int vc_can_do_color : 1;
91 unsigned int vc_report_mouse : 2; 91 unsigned int vc_report_mouse : 2;
92 unsigned int vc_kmalloced : 1;
93 unsigned char vc_utf : 1; /* Unicode UTF-8 encoding */ 92 unsigned char vc_utf : 1; /* Unicode UTF-8 encoding */
94 unsigned char vc_utf_count; 93 unsigned char vc_utf_count;
95 int vc_utf_char; 94 int vc_utf_char;
diff --git a/include/linux/crash_dump.h b/include/linux/crash_dump.h
index 2dac064d8359..0026f267da20 100644
--- a/include/linux/crash_dump.h
+++ b/include/linux/crash_dump.h
@@ -3,7 +3,6 @@
3 3
4#ifdef CONFIG_CRASH_DUMP 4#ifdef CONFIG_CRASH_DUMP
5#include <linux/kexec.h> 5#include <linux/kexec.h>
6#include <linux/smp_lock.h>
7#include <linux/device.h> 6#include <linux/device.h>
8#include <linux/proc_fs.h> 7#include <linux/proc_fs.h>
9 8
diff --git a/include/linux/decompress/generic.h b/include/linux/decompress/generic.h
index 6dfb856327bb..0c7111a55a1a 100644
--- a/include/linux/decompress/generic.h
+++ b/include/linux/decompress/generic.h
@@ -1,31 +1,37 @@
1#ifndef DECOMPRESS_GENERIC_H 1#ifndef DECOMPRESS_GENERIC_H
2#define DECOMPRESS_GENERIC_H 2#define DECOMPRESS_GENERIC_H
3 3
4/* Minimal chunksize to be read.
5 *Bzip2 prefers at least 4096
6 *Lzma prefers 0x10000 */
7#define COMPR_IOBUF_SIZE 4096
8
9typedef int (*decompress_fn) (unsigned char *inbuf, int len, 4typedef int (*decompress_fn) (unsigned char *inbuf, int len,
10 int(*fill)(void*, unsigned int), 5 int(*fill)(void*, unsigned int),
11 int(*writebb)(void*, unsigned int), 6 int(*flush)(void*, unsigned int),
12 unsigned char *output, 7 unsigned char *outbuf,
13 int *posp, 8 int *posp,
14 void(*error)(char *x)); 9 void(*error)(char *x));
15 10
16/* inbuf - input buffer 11/* inbuf - input buffer
17 *len - len of pre-read data in inbuf 12 *len - len of pre-read data in inbuf
18 *fill - function to fill inbuf if empty 13 *fill - function to fill inbuf when empty
19 *writebb - function to write out outbug 14 *flush - function to write out outbuf
15 *outbuf - output buffer
20 *posp - if non-null, input position (number of bytes read) will be 16 *posp - if non-null, input position (number of bytes read) will be
21 * returned here 17 * returned here
22 * 18 *
23 *If len != 0, the inbuf is initialized (with as much data), and fill 19 *If len != 0, inbuf should contain all the necessary input data, and fill
24 *should not be called 20 *should be NULL
25 *If len = 0, the inbuf is allocated, but empty. Its size is IOBUF_SIZE 21 *If len = 0, inbuf can be NULL, in which case the decompressor will allocate
26 *fill should be called (repeatedly...) to read data, at most IOBUF_SIZE 22 *the input buffer. If inbuf != NULL it must be at least XXX_IOBUF_SIZE bytes.
23 *fill will be called (repeatedly...) to read data, at most XXX_IOBUF_SIZE
24 *bytes should be read per call. Replace XXX with the appropriate decompressor
25 *name, i.e. LZMA_IOBUF_SIZE.
26 *
27 *If flush = NULL, outbuf must be large enough to buffer all the expected
28 *output. If flush != NULL, the output buffer will be allocated by the
29 *decompressor (outbuf = NULL), and the flush function will be called to
30 *flush the output buffer at the appropriate time (decompressor and stream
31 *dependent).
27 */ 32 */
28 33
34
29/* Utility routine to detect the decompression method */ 35/* Utility routine to detect the decompression method */
30decompress_fn decompress_method(const unsigned char *inbuf, int len, 36decompress_fn decompress_method(const unsigned char *inbuf, int len,
31 const char **name); 37 const char **name);
diff --git a/include/linux/device-mapper.h b/include/linux/device-mapper.h
index 0d6310657f32..655e7721580a 100644
--- a/include/linux/device-mapper.h
+++ b/include/linux/device-mapper.h
@@ -84,7 +84,7 @@ typedef int (*dm_merge_fn) (struct dm_target *ti, struct bvec_merge_data *bvm,
84 84
85typedef int (*iterate_devices_callout_fn) (struct dm_target *ti, 85typedef int (*iterate_devices_callout_fn) (struct dm_target *ti,
86 struct dm_dev *dev, 86 struct dm_dev *dev,
87 sector_t physical_start, 87 sector_t start, sector_t len,
88 void *data); 88 void *data);
89 89
90typedef int (*dm_iterate_devices_fn) (struct dm_target *ti, 90typedef int (*dm_iterate_devices_fn) (struct dm_target *ti,
@@ -104,7 +104,7 @@ void dm_error(const char *message);
104 * Combine device limits. 104 * Combine device limits.
105 */ 105 */
106int dm_set_device_limits(struct dm_target *ti, struct dm_dev *dev, 106int dm_set_device_limits(struct dm_target *ti, struct dm_dev *dev,
107 sector_t start, void *data); 107 sector_t start, sector_t len, void *data);
108 108
109struct dm_dev { 109struct dm_dev {
110 struct block_device *bdev; 110 struct block_device *bdev;
diff --git a/include/linux/device.h b/include/linux/device.h
index ed4e39f2c423..aebb81036db2 100644
--- a/include/linux/device.h
+++ b/include/linux/device.h
@@ -25,8 +25,6 @@
25#include <asm/atomic.h> 25#include <asm/atomic.h>
26#include <asm/device.h> 26#include <asm/device.h>
27 27
28#define BUS_ID_SIZE 20
29
30struct device; 28struct device;
31struct device_private; 29struct device_private;
32struct device_driver; 30struct device_driver;
diff --git a/include/linux/elfcore.h b/include/linux/elfcore.h
index 7605c5e9589f..00d6a68d0421 100644
--- a/include/linux/elfcore.h
+++ b/include/linux/elfcore.h
@@ -122,9 +122,10 @@ static inline void elf_core_copy_kernel_regs(elf_gregset_t *elfregs, struct pt_r
122 122
123static inline int elf_core_copy_task_regs(struct task_struct *t, elf_gregset_t* elfregs) 123static inline int elf_core_copy_task_regs(struct task_struct *t, elf_gregset_t* elfregs)
124{ 124{
125#ifdef ELF_CORE_COPY_TASK_REGS 125#if defined (ELF_CORE_COPY_TASK_REGS)
126
127 return ELF_CORE_COPY_TASK_REGS(t, elfregs); 126 return ELF_CORE_COPY_TASK_REGS(t, elfregs);
127#elif defined (task_pt_regs)
128 elf_core_copy_regs(elfregs, task_pt_regs(t));
128#endif 129#endif
129 return 0; 130 return 0;
130} 131}
diff --git a/include/linux/eventfd.h b/include/linux/eventfd.h
index f45a8ae5f828..3b85ba6479f4 100644
--- a/include/linux/eventfd.h
+++ b/include/linux/eventfd.h
@@ -8,10 +8,8 @@
8#ifndef _LINUX_EVENTFD_H 8#ifndef _LINUX_EVENTFD_H
9#define _LINUX_EVENTFD_H 9#define _LINUX_EVENTFD_H
10 10
11#ifdef CONFIG_EVENTFD
12
13/* For O_CLOEXEC and O_NONBLOCK */
14#include <linux/fcntl.h> 11#include <linux/fcntl.h>
12#include <linux/file.h>
15 13
16/* 14/*
17 * CAREFUL: Check include/asm-generic/fcntl.h when defining 15 * CAREFUL: Check include/asm-generic/fcntl.h when defining
@@ -27,16 +25,37 @@
27#define EFD_SHARED_FCNTL_FLAGS (O_CLOEXEC | O_NONBLOCK) 25#define EFD_SHARED_FCNTL_FLAGS (O_CLOEXEC | O_NONBLOCK)
28#define EFD_FLAGS_SET (EFD_SHARED_FCNTL_FLAGS | EFD_SEMAPHORE) 26#define EFD_FLAGS_SET (EFD_SHARED_FCNTL_FLAGS | EFD_SEMAPHORE)
29 27
28#ifdef CONFIG_EVENTFD
29
30struct eventfd_ctx *eventfd_ctx_get(struct eventfd_ctx *ctx);
31void eventfd_ctx_put(struct eventfd_ctx *ctx);
30struct file *eventfd_fget(int fd); 32struct file *eventfd_fget(int fd);
31int eventfd_signal(struct file *file, int n); 33struct eventfd_ctx *eventfd_ctx_fdget(int fd);
34struct eventfd_ctx *eventfd_ctx_fileget(struct file *file);
35int eventfd_signal(struct eventfd_ctx *ctx, int n);
32 36
33#else /* CONFIG_EVENTFD */ 37#else /* CONFIG_EVENTFD */
34 38
35#define eventfd_fget(fd) ERR_PTR(-ENOSYS) 39/*
36static inline int eventfd_signal(struct file *file, int n) 40 * Ugly ugly ugly error layer to support modules that uses eventfd but
37{ return 0; } 41 * pretend to work in !CONFIG_EVENTFD configurations. Namely, AIO.
42 */
43static inline struct eventfd_ctx *eventfd_ctx_fdget(int fd)
44{
45 return ERR_PTR(-ENOSYS);
46}
47
48static inline int eventfd_signal(struct eventfd_ctx *ctx, int n)
49{
50 return -ENOSYS;
51}
52
53static inline void eventfd_ctx_put(struct eventfd_ctx *ctx)
54{
55
56}
38 57
39#endif /* CONFIG_EVENTFD */ 58#endif
40 59
41#endif /* _LINUX_EVENTFD_H */ 60#endif /* _LINUX_EVENTFD_H */
42 61
diff --git a/include/linux/ext3_fs.h b/include/linux/ext3_fs.h
index 634a5e5aba3e..7499b3667798 100644
--- a/include/linux/ext3_fs.h
+++ b/include/linux/ext3_fs.h
@@ -874,7 +874,7 @@ struct buffer_head * ext3_getblk (handle_t *, struct inode *, long, int, int *);
874struct buffer_head * ext3_bread (handle_t *, struct inode *, int, int, int *); 874struct buffer_head * ext3_bread (handle_t *, struct inode *, int, int, int *);
875int ext3_get_blocks_handle(handle_t *handle, struct inode *inode, 875int ext3_get_blocks_handle(handle_t *handle, struct inode *inode,
876 sector_t iblock, unsigned long maxblocks, struct buffer_head *bh_result, 876 sector_t iblock, unsigned long maxblocks, struct buffer_head *bh_result,
877 int create, int extend_disksize); 877 int create);
878 878
879extern struct inode *ext3_iget(struct super_block *, unsigned long); 879extern struct inode *ext3_iget(struct super_block *, unsigned long);
880extern int ext3_write_inode (struct inode *, int); 880extern int ext3_write_inode (struct inode *, int);
diff --git a/include/linux/fb.h b/include/linux/fb.h
index dd68358996b7..f847df9e99b6 100644
--- a/include/linux/fb.h
+++ b/include/linux/fb.h
@@ -819,6 +819,7 @@ struct fb_info {
819 int node; 819 int node;
820 int flags; 820 int flags;
821 struct mutex lock; /* Lock for open/release/ioctl funcs */ 821 struct mutex lock; /* Lock for open/release/ioctl funcs */
822 struct mutex mm_lock; /* Lock for fb_mmap and smem_* fields */
822 struct fb_var_screeninfo var; /* Current var */ 823 struct fb_var_screeninfo var; /* Current var */
823 struct fb_fix_screeninfo fix; /* Current fix */ 824 struct fb_fix_screeninfo fix; /* Current fix */
824 struct fb_monspecs monspecs; /* Current Monitor specs */ 825 struct fb_monspecs monspecs; /* Current Monitor specs */
diff --git a/include/linux/firewire.h b/include/linux/firewire.h
index 9823946adbc5..192d1e43c43c 100644
--- a/include/linux/firewire.h
+++ b/include/linux/firewire.h
@@ -127,6 +127,7 @@ struct fw_card {
127 struct delayed_work work; 127 struct delayed_work work;
128 int bm_retries; 128 int bm_retries;
129 int bm_generation; 129 int bm_generation;
130 __be32 bm_transaction_data[2];
130 131
131 bool broadcast_channel_allocated; 132 bool broadcast_channel_allocated;
132 u32 broadcast_channel; 133 u32 broadcast_channel;
diff --git a/include/linux/flex_array.h b/include/linux/flex_array.h
new file mode 100644
index 000000000000..23c1ec79a31b
--- /dev/null
+++ b/include/linux/flex_array.h
@@ -0,0 +1,47 @@
1#ifndef _FLEX_ARRAY_H
2#define _FLEX_ARRAY_H
3
4#include <linux/types.h>
5#include <asm/page.h>
6
7#define FLEX_ARRAY_PART_SIZE PAGE_SIZE
8#define FLEX_ARRAY_BASE_SIZE PAGE_SIZE
9
10struct flex_array_part;
11
12/*
13 * This is meant to replace cases where an array-like
14 * structure has gotten too big to fit into kmalloc()
15 * and the developer is getting tempted to use
16 * vmalloc().
17 */
18
19struct flex_array {
20 union {
21 struct {
22 int element_size;
23 int total_nr_elements;
24 struct flex_array_part *parts[0];
25 };
26 /*
27 * This little trick makes sure that
28 * sizeof(flex_array) == PAGE_SIZE
29 */
30 char padding[FLEX_ARRAY_BASE_SIZE];
31 };
32};
33
34#define FLEX_ARRAY_INIT(size, total) { { {\
35 .element_size = (size), \
36 .total_nr_elements = (total), \
37} } }
38
39struct flex_array *flex_array_alloc(int element_size, int total, gfp_t flags);
40int flex_array_prealloc(struct flex_array *fa, int start, int end, gfp_t flags);
41void flex_array_free(struct flex_array *fa);
42void flex_array_free_parts(struct flex_array *fa);
43int flex_array_put(struct flex_array *fa, int element_nr, void *src,
44 gfp_t flags);
45void *flex_array_get(struct flex_array *fa, int element_nr);
46
47#endif /* _FLEX_ARRAY_H */
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 0872372184fe..67888a9e0655 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -1946,6 +1946,7 @@ extern void putname(const char *name);
1946extern int register_blkdev(unsigned int, const char *); 1946extern int register_blkdev(unsigned int, const char *);
1947extern void unregister_blkdev(unsigned int, const char *); 1947extern void unregister_blkdev(unsigned int, const char *);
1948extern struct block_device *bdget(dev_t); 1948extern struct block_device *bdget(dev_t);
1949extern struct block_device *bdgrab(struct block_device *bdev);
1949extern void bd_set_size(struct block_device *, loff_t size); 1950extern void bd_set_size(struct block_device *, loff_t size);
1950extern void bd_forget(struct inode *inode); 1951extern void bd_forget(struct inode *inode);
1951extern void bdput(struct block_device *); 1952extern void bdput(struct block_device *);
@@ -2136,7 +2137,7 @@ extern loff_t default_llseek(struct file *file, loff_t offset, int origin);
2136 2137
2137extern loff_t vfs_llseek(struct file *file, loff_t offset, int origin); 2138extern loff_t vfs_llseek(struct file *file, loff_t offset, int origin);
2138 2139
2139extern struct inode * inode_init_always(struct super_block *, struct inode *); 2140extern int inode_init_always(struct super_block *, struct inode *);
2140extern void inode_init_once(struct inode *); 2141extern void inode_init_once(struct inode *);
2141extern void inode_add_to_lists(struct super_block *, struct inode *); 2142extern void inode_add_to_lists(struct super_block *, struct inode *);
2142extern void iput(struct inode *); 2143extern void iput(struct inode *);
@@ -2163,6 +2164,7 @@ extern void __iget(struct inode * inode);
2163extern void iget_failed(struct inode *); 2164extern void iget_failed(struct inode *);
2164extern void clear_inode(struct inode *); 2165extern void clear_inode(struct inode *);
2165extern void destroy_inode(struct inode *); 2166extern void destroy_inode(struct inode *);
2167extern void __destroy_inode(struct inode *);
2166extern struct inode *new_inode(struct super_block *); 2168extern struct inode *new_inode(struct super_block *);
2167extern int should_remove_suid(struct dentry *); 2169extern int should_remove_suid(struct dentry *);
2168extern int file_remove_suid(struct file *); 2170extern int file_remove_suid(struct file *);
diff --git a/include/linux/fsnotify_backend.h b/include/linux/fsnotify_backend.h
index 44848aa830dc..4d6f47b51189 100644
--- a/include/linux/fsnotify_backend.h
+++ b/include/linux/fsnotify_backend.h
@@ -280,7 +280,7 @@ static inline void __fsnotify_update_dcache_flags(struct dentry *dentry)
280 assert_spin_locked(&dentry->d_lock); 280 assert_spin_locked(&dentry->d_lock);
281 281
282 parent = dentry->d_parent; 282 parent = dentry->d_parent;
283 if (fsnotify_inode_watches_children(parent->d_inode)) 283 if (parent->d_inode && fsnotify_inode_watches_children(parent->d_inode))
284 dentry->d_flags |= DCACHE_FSNOTIFY_PARENT_WATCHED; 284 dentry->d_flags |= DCACHE_FSNOTIFY_PARENT_WATCHED;
285 else 285 else
286 dentry->d_flags &= ~DCACHE_FSNOTIFY_PARENT_WATCHED; 286 dentry->d_flags &= ~DCACHE_FSNOTIFY_PARENT_WATCHED;
@@ -352,7 +352,7 @@ extern void fsnotify_unmount_inodes(struct list_head *list);
352/* put here because inotify does some weird stuff when destroying watches */ 352/* put here because inotify does some weird stuff when destroying watches */
353extern struct fsnotify_event *fsnotify_create_event(struct inode *to_tell, __u32 mask, 353extern struct fsnotify_event *fsnotify_create_event(struct inode *to_tell, __u32 mask,
354 void *data, int data_is, const char *name, 354 void *data, int data_is, const char *name,
355 u32 cookie); 355 u32 cookie, gfp_t gfp);
356 356
357#else 357#else
358 358
diff --git a/include/linux/ftrace_event.h b/include/linux/ftrace_event.h
index 5c093ffc655b..a81170de7f6b 100644
--- a/include/linux/ftrace_event.h
+++ b/include/linux/ftrace_event.h
@@ -89,7 +89,9 @@ enum print_line_t {
89 TRACE_TYPE_NO_CONSUME = 3 /* Handled but ask to not consume */ 89 TRACE_TYPE_NO_CONSUME = 3 /* Handled but ask to not consume */
90}; 90};
91 91
92 92void tracing_generic_entry_update(struct trace_entry *entry,
93 unsigned long flags,
94 int pc);
93struct ring_buffer_event * 95struct ring_buffer_event *
94trace_current_buffer_lock_reserve(int type, unsigned long len, 96trace_current_buffer_lock_reserve(int type, unsigned long len,
95 unsigned long flags, int pc); 97 unsigned long flags, int pc);
@@ -119,11 +121,9 @@ struct ftrace_event_call {
119 void *filter; 121 void *filter;
120 void *mod; 122 void *mod;
121 123
122#ifdef CONFIG_EVENT_PROFILE 124 atomic_t profile_count;
123 atomic_t profile_count; 125 int (*profile_enable)(struct ftrace_event_call *);
124 int (*profile_enable)(struct ftrace_event_call *); 126 void (*profile_disable)(struct ftrace_event_call *);
125 void (*profile_disable)(struct ftrace_event_call *);
126#endif
127}; 127};
128 128
129#define MAX_FILTER_PRED 32 129#define MAX_FILTER_PRED 32
diff --git a/include/linux/fuse.h b/include/linux/fuse.h
index d41ed593f79f..cf593bf9fd32 100644
--- a/include/linux/fuse.h
+++ b/include/linux/fuse.h
@@ -25,6 +25,11 @@
25 * - add IOCTL message 25 * - add IOCTL message
26 * - add unsolicited notification support 26 * - add unsolicited notification support
27 * - add POLL message and NOTIFY_POLL notification 27 * - add POLL message and NOTIFY_POLL notification
28 *
29 * 7.12
30 * - add umask flag to input argument of open, mknod and mkdir
31 * - add notification messages for invalidation of inodes and
32 * directory entries
28 */ 33 */
29 34
30#ifndef _LINUX_FUSE_H 35#ifndef _LINUX_FUSE_H
@@ -36,7 +41,7 @@
36#define FUSE_KERNEL_VERSION 7 41#define FUSE_KERNEL_VERSION 7
37 42
38/** Minor version number of this interface */ 43/** Minor version number of this interface */
39#define FUSE_KERNEL_MINOR_VERSION 11 44#define FUSE_KERNEL_MINOR_VERSION 12
40 45
41/** The node ID of the root inode */ 46/** The node ID of the root inode */
42#define FUSE_ROOT_ID 1 47#define FUSE_ROOT_ID 1
@@ -112,6 +117,7 @@ struct fuse_file_lock {
112 * INIT request/reply flags 117 * INIT request/reply flags
113 * 118 *
114 * FUSE_EXPORT_SUPPORT: filesystem handles lookups of "." and ".." 119 * FUSE_EXPORT_SUPPORT: filesystem handles lookups of "." and ".."
120 * FUSE_DONT_MASK: don't apply umask to file mode on create operations
115 */ 121 */
116#define FUSE_ASYNC_READ (1 << 0) 122#define FUSE_ASYNC_READ (1 << 0)
117#define FUSE_POSIX_LOCKS (1 << 1) 123#define FUSE_POSIX_LOCKS (1 << 1)
@@ -119,6 +125,7 @@ struct fuse_file_lock {
119#define FUSE_ATOMIC_O_TRUNC (1 << 3) 125#define FUSE_ATOMIC_O_TRUNC (1 << 3)
120#define FUSE_EXPORT_SUPPORT (1 << 4) 126#define FUSE_EXPORT_SUPPORT (1 << 4)
121#define FUSE_BIG_WRITES (1 << 5) 127#define FUSE_BIG_WRITES (1 << 5)
128#define FUSE_DONT_MASK (1 << 6)
122 129
123/** 130/**
124 * CUSE INIT request/reply flags 131 * CUSE INIT request/reply flags
@@ -224,6 +231,8 @@ enum fuse_opcode {
224 231
225enum fuse_notify_code { 232enum fuse_notify_code {
226 FUSE_NOTIFY_POLL = 1, 233 FUSE_NOTIFY_POLL = 1,
234 FUSE_NOTIFY_INVAL_INODE = 2,
235 FUSE_NOTIFY_INVAL_ENTRY = 3,
227 FUSE_NOTIFY_CODE_MAX, 236 FUSE_NOTIFY_CODE_MAX,
228}; 237};
229 238
@@ -262,14 +271,18 @@ struct fuse_attr_out {
262 struct fuse_attr attr; 271 struct fuse_attr attr;
263}; 272};
264 273
274#define FUSE_COMPAT_MKNOD_IN_SIZE 8
275
265struct fuse_mknod_in { 276struct fuse_mknod_in {
266 __u32 mode; 277 __u32 mode;
267 __u32 rdev; 278 __u32 rdev;
279 __u32 umask;
280 __u32 padding;
268}; 281};
269 282
270struct fuse_mkdir_in { 283struct fuse_mkdir_in {
271 __u32 mode; 284 __u32 mode;
272 __u32 padding; 285 __u32 umask;
273}; 286};
274 287
275struct fuse_rename_in { 288struct fuse_rename_in {
@@ -301,7 +314,14 @@ struct fuse_setattr_in {
301 314
302struct fuse_open_in { 315struct fuse_open_in {
303 __u32 flags; 316 __u32 flags;
317 __u32 unused;
318};
319
320struct fuse_create_in {
321 __u32 flags;
304 __u32 mode; 322 __u32 mode;
323 __u32 umask;
324 __u32 padding;
305}; 325};
306 326
307struct fuse_open_out { 327struct fuse_open_out {
@@ -508,4 +528,16 @@ struct fuse_dirent {
508#define FUSE_DIRENT_SIZE(d) \ 528#define FUSE_DIRENT_SIZE(d) \
509 FUSE_DIRENT_ALIGN(FUSE_NAME_OFFSET + (d)->namelen) 529 FUSE_DIRENT_ALIGN(FUSE_NAME_OFFSET + (d)->namelen)
510 530
531struct fuse_notify_inval_inode_out {
532 __u64 ino;
533 __s64 off;
534 __s64 len;
535};
536
537struct fuse_notify_inval_entry_out {
538 __u64 parent;
539 __u32 namelen;
540 __u32 padding;
541};
542
511#endif /* _LINUX_FUSE_H */ 543#endif /* _LINUX_FUSE_H */
diff --git a/include/linux/hardirq.h b/include/linux/hardirq.h
index 45257475623c..8246c697863d 100644
--- a/include/linux/hardirq.h
+++ b/include/linux/hardirq.h
@@ -2,7 +2,9 @@
2#define LINUX_HARDIRQ_H 2#define LINUX_HARDIRQ_H
3 3
4#include <linux/preempt.h> 4#include <linux/preempt.h>
5#ifdef CONFIG_PREEMPT
5#include <linux/smp_lock.h> 6#include <linux/smp_lock.h>
7#endif
6#include <linux/lockdep.h> 8#include <linux/lockdep.h>
7#include <linux/ftrace_irq.h> 9#include <linux/ftrace_irq.h>
8#include <asm/hardirq.h> 10#include <asm/hardirq.h>
diff --git a/include/linux/hrtimer.h b/include/linux/hrtimer.h
index 7400900de94a..4759917adc71 100644
--- a/include/linux/hrtimer.h
+++ b/include/linux/hrtimer.h
@@ -21,6 +21,7 @@
21#include <linux/list.h> 21#include <linux/list.h>
22#include <linux/wait.h> 22#include <linux/wait.h>
23#include <linux/percpu.h> 23#include <linux/percpu.h>
24#include <linux/timer.h>
24 25
25 26
26struct hrtimer_clock_base; 27struct hrtimer_clock_base;
@@ -447,6 +448,8 @@ extern void timer_stats_update_stats(void *timer, pid_t pid, void *startf,
447 448
448static inline void timer_stats_account_hrtimer(struct hrtimer *timer) 449static inline void timer_stats_account_hrtimer(struct hrtimer *timer)
449{ 450{
451 if (likely(!timer->start_site))
452 return;
450 timer_stats_update_stats(timer, timer->start_pid, timer->start_site, 453 timer_stats_update_stats(timer, timer->start_pid, timer->start_site,
451 timer->function, timer->start_comm, 0); 454 timer->function, timer->start_comm, 0);
452} 455}
@@ -456,6 +459,8 @@ extern void __timer_stats_hrtimer_set_start_info(struct hrtimer *timer,
456 459
457static inline void timer_stats_hrtimer_set_start_info(struct hrtimer *timer) 460static inline void timer_stats_hrtimer_set_start_info(struct hrtimer *timer)
458{ 461{
462 if (likely(!timer_stats_active))
463 return;
459 __timer_stats_hrtimer_set_start_info(timer, __builtin_return_address(0)); 464 __timer_stats_hrtimer_set_start_info(timer, __builtin_return_address(0));
460} 465}
461 466
diff --git a/include/linux/ide.h b/include/linux/ide.h
index 95c6e00a72e8..edc93a6d931d 100644
--- a/include/linux/ide.h
+++ b/include/linux/ide.h
@@ -1062,7 +1062,6 @@ int generic_ide_ioctl(ide_drive_t *, struct block_device *, unsigned, unsigned l
1062extern int ide_vlb_clk; 1062extern int ide_vlb_clk;
1063extern int ide_pci_clk; 1063extern int ide_pci_clk;
1064 1064
1065unsigned int ide_rq_bytes(struct request *);
1066int ide_end_rq(ide_drive_t *, struct request *, int, unsigned int); 1065int ide_end_rq(ide_drive_t *, struct request *, int, unsigned int);
1067void ide_kill_rq(ide_drive_t *, struct request *); 1066void ide_kill_rq(ide_drive_t *, struct request *);
1068 1067
@@ -1361,7 +1360,6 @@ int ide_in_drive_list(u16 *, const struct drive_list_entry *);
1361#ifdef CONFIG_BLK_DEV_IDEDMA 1360#ifdef CONFIG_BLK_DEV_IDEDMA
1362int ide_dma_good_drive(ide_drive_t *); 1361int ide_dma_good_drive(ide_drive_t *);
1363int __ide_dma_bad_drive(ide_drive_t *); 1362int __ide_dma_bad_drive(ide_drive_t *);
1364int ide_id_dma_bug(ide_drive_t *);
1365 1363
1366u8 ide_find_dma_mode(ide_drive_t *, u8); 1364u8 ide_find_dma_mode(ide_drive_t *, u8);
1367 1365
@@ -1402,7 +1400,6 @@ void ide_dma_lost_irq(ide_drive_t *);
1402ide_startstop_t ide_dma_timeout_retry(ide_drive_t *, int); 1400ide_startstop_t ide_dma_timeout_retry(ide_drive_t *, int);
1403 1401
1404#else 1402#else
1405static inline int ide_id_dma_bug(ide_drive_t *drive) { return 0; }
1406static inline u8 ide_find_dma_mode(ide_drive_t *drive, u8 speed) { return 0; } 1403static inline u8 ide_find_dma_mode(ide_drive_t *drive, u8 speed) { return 0; }
1407static inline u8 ide_max_dma_mode(ide_drive_t *drive) { return 0; } 1404static inline u8 ide_max_dma_mode(ide_drive_t *drive) { return 0; }
1408static inline void ide_dma_off_quietly(ide_drive_t *drive) { ; } 1405static inline void ide_dma_off_quietly(ide_drive_t *drive) { ; }
@@ -1422,6 +1419,7 @@ static inline void ide_dma_unmap_sg(ide_drive_t *drive,
1422 1419
1423#ifdef CONFIG_BLK_DEV_IDEACPI 1420#ifdef CONFIG_BLK_DEV_IDEACPI
1424int ide_acpi_init(void); 1421int ide_acpi_init(void);
1422bool ide_port_acpi(ide_hwif_t *hwif);
1425extern int ide_acpi_exec_tfs(ide_drive_t *drive); 1423extern int ide_acpi_exec_tfs(ide_drive_t *drive);
1426extern void ide_acpi_get_timing(ide_hwif_t *hwif); 1424extern void ide_acpi_get_timing(ide_hwif_t *hwif);
1427extern void ide_acpi_push_timing(ide_hwif_t *hwif); 1425extern void ide_acpi_push_timing(ide_hwif_t *hwif);
@@ -1430,6 +1428,7 @@ void ide_acpi_port_init_devices(ide_hwif_t *);
1430extern void ide_acpi_set_state(ide_hwif_t *hwif, int on); 1428extern void ide_acpi_set_state(ide_hwif_t *hwif, int on);
1431#else 1429#else
1432static inline int ide_acpi_init(void) { return 0; } 1430static inline int ide_acpi_init(void) { return 0; }
1431static inline bool ide_port_acpi(ide_hwif_t *hwif) { return 0; }
1433static inline int ide_acpi_exec_tfs(ide_drive_t *drive) { return 0; } 1432static inline int ide_acpi_exec_tfs(ide_drive_t *drive) { return 0; }
1434static inline void ide_acpi_get_timing(ide_hwif_t *hwif) { ; } 1433static inline void ide_acpi_get_timing(ide_hwif_t *hwif) { ; }
1435static inline void ide_acpi_push_timing(ide_hwif_t *hwif) { ; } 1434static inline void ide_acpi_push_timing(ide_hwif_t *hwif) { ; }
diff --git a/include/linux/ima.h b/include/linux/ima.h
index b1b827d091a9..0e3f2a4c25f6 100644
--- a/include/linux/ima.h
+++ b/include/linux/ima.h
@@ -24,6 +24,7 @@ extern int ima_path_check(struct path *path, int mask, int update_counts);
24extern void ima_file_free(struct file *file); 24extern void ima_file_free(struct file *file);
25extern int ima_file_mmap(struct file *file, unsigned long prot); 25extern int ima_file_mmap(struct file *file, unsigned long prot);
26extern void ima_counts_get(struct file *file); 26extern void ima_counts_get(struct file *file);
27extern void ima_counts_put(struct path *path, int mask);
27 28
28#else 29#else
29static inline int ima_bprm_check(struct linux_binprm *bprm) 30static inline int ima_bprm_check(struct linux_binprm *bprm)
@@ -60,5 +61,10 @@ static inline void ima_counts_get(struct file *file)
60{ 61{
61 return; 62 return;
62} 63}
64
65static inline void ima_counts_put(struct path *path, int mask)
66{
67 return;
68}
63#endif /* CONFIG_IMA_H */ 69#endif /* CONFIG_IMA_H */
64#endif /* _LINUX_IMA_H */ 70#endif /* _LINUX_IMA_H */
diff --git a/include/linux/init_task.h b/include/linux/init_task.h
index 5368fbdc7801..7fc01b13be43 100644
--- a/include/linux/init_task.h
+++ b/include/linux/init_task.h
@@ -183,5 +183,8 @@ extern struct cred init_cred;
183 LIST_HEAD_INIT(cpu_timers[2]), \ 183 LIST_HEAD_INIT(cpu_timers[2]), \
184} 184}
185 185
186/* Attach to the init_task data structure for proper alignment */
187#define __init_task_data __attribute__((__section__(".data.init_task")))
188
186 189
187#endif 190#endif
diff --git a/include/linux/input/matrix_keypad.h b/include/linux/input/matrix_keypad.h
new file mode 100644
index 000000000000..15d5903af2dd
--- /dev/null
+++ b/include/linux/input/matrix_keypad.h
@@ -0,0 +1,66 @@
1#ifndef _MATRIX_KEYPAD_H
2#define _MATRIX_KEYPAD_H
3
4#include <linux/types.h>
5#include <linux/input.h>
6
7#define MATRIX_MAX_ROWS 16
8#define MATRIX_MAX_COLS 16
9
10#define KEY(row, col, val) ((((row) & (MATRIX_MAX_ROWS - 1)) << 24) |\
11 (((col) & (MATRIX_MAX_COLS - 1)) << 16) |\
12 (val & 0xffff))
13
14#define KEY_ROW(k) (((k) >> 24) & 0xff)
15#define KEY_COL(k) (((k) >> 16) & 0xff)
16#define KEY_VAL(k) ((k) & 0xffff)
17
18#define MATRIX_SCAN_CODE(row, col, row_shift) (((row) << (row_shift)) + (col))
19
20/**
21 * struct matrix_keymap_data - keymap for matrix keyboards
22 * @keymap: pointer to array of uint32 values encoded with KEY() macro
23 * representing keymap
24 * @keymap_size: number of entries (initialized) in this keymap
25 *
26 * This structure is supposed to be used by platform code to supply
27 * keymaps to drivers that implement matrix-like keypads/keyboards.
28 */
29struct matrix_keymap_data {
30 const uint32_t *keymap;
31 unsigned int keymap_size;
32};
33
34/**
35 * struct matrix_keypad_platform_data - platform-dependent keypad data
36 * @keymap_data: pointer to &matrix_keymap_data
37 * @row_gpios: pointer to array of gpio numbers representing rows
38 * @col_gpios: pointer to array of gpio numbers reporesenting colums
39 * @num_row_gpios: actual number of row gpios used by device
40 * @num_col_gpios: actual number of col gpios used by device
41 * @col_scan_delay_us: delay, measured in microseconds, that is
42 * needed before we can keypad after activating column gpio
43 * @debounce_ms: debounce interval in milliseconds
44 *
45 * This structure represents platform-specific data that use used by
46 * matrix_keypad driver to perform proper initialization.
47 */
48struct matrix_keypad_platform_data {
49 const struct matrix_keymap_data *keymap_data;
50
51 const unsigned int *row_gpios;
52 const unsigned int *col_gpios;
53
54 unsigned int num_row_gpios;
55 unsigned int num_col_gpios;
56
57 unsigned int col_scan_delay_us;
58
59 /* key debounce interval in milli-second */
60 unsigned int debounce_ms;
61
62 bool active_low;
63 bool wakeup;
64};
65
66#endif /* _MATRIX_KEYPAD_H */
diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h
index 2721f07e9354..35e7df1e9f30 100644
--- a/include/linux/interrupt.h
+++ b/include/linux/interrupt.h
@@ -14,6 +14,7 @@
14#include <linux/irqflags.h> 14#include <linux/irqflags.h>
15#include <linux/smp.h> 15#include <linux/smp.h>
16#include <linux/percpu.h> 16#include <linux/percpu.h>
17#include <linux/hrtimer.h>
17 18
18#include <asm/atomic.h> 19#include <asm/atomic.h>
19#include <asm/ptrace.h> 20#include <asm/ptrace.h>
@@ -64,11 +65,13 @@
64 * IRQTF_RUNTHREAD - signals that the interrupt handler thread should run 65 * IRQTF_RUNTHREAD - signals that the interrupt handler thread should run
65 * IRQTF_DIED - handler thread died 66 * IRQTF_DIED - handler thread died
66 * IRQTF_WARNED - warning "IRQ_WAKE_THREAD w/o thread_fn" has been printed 67 * IRQTF_WARNED - warning "IRQ_WAKE_THREAD w/o thread_fn" has been printed
68 * IRQTF_AFFINITY - irq thread is requested to adjust affinity
67 */ 69 */
68enum { 70enum {
69 IRQTF_RUNTHREAD, 71 IRQTF_RUNTHREAD,
70 IRQTF_DIED, 72 IRQTF_DIED,
71 IRQTF_WARNED, 73 IRQTF_WARNED,
74 IRQTF_AFFINITY,
72}; 75};
73 76
74typedef irqreturn_t (*irq_handler_t)(int, void *); 77typedef irqreturn_t (*irq_handler_t)(int, void *);
@@ -517,6 +520,31 @@ extern void tasklet_kill_immediate(struct tasklet_struct *t, unsigned int cpu);
517extern void tasklet_init(struct tasklet_struct *t, 520extern void tasklet_init(struct tasklet_struct *t,
518 void (*func)(unsigned long), unsigned long data); 521 void (*func)(unsigned long), unsigned long data);
519 522
523struct tasklet_hrtimer {
524 struct hrtimer timer;
525 struct tasklet_struct tasklet;
526 enum hrtimer_restart (*function)(struct hrtimer *);
527};
528
529extern void
530tasklet_hrtimer_init(struct tasklet_hrtimer *ttimer,
531 enum hrtimer_restart (*function)(struct hrtimer *),
532 clockid_t which_clock, enum hrtimer_mode mode);
533
534static inline
535int tasklet_hrtimer_start(struct tasklet_hrtimer *ttimer, ktime_t time,
536 const enum hrtimer_mode mode)
537{
538 return hrtimer_start(&ttimer->timer, time, mode);
539}
540
541static inline
542void tasklet_hrtimer_cancel(struct tasklet_hrtimer *ttimer)
543{
544 hrtimer_cancel(&ttimer->timer);
545 tasklet_kill(&ttimer->tasklet);
546}
547
520/* 548/*
521 * Autoprobing for irqs: 549 * Autoprobing for irqs:
522 * 550 *
diff --git a/include/linux/iocontext.h b/include/linux/iocontext.h
index dd05434fa45f..4da4a75c3f1e 100644
--- a/include/linux/iocontext.h
+++ b/include/linux/iocontext.h
@@ -92,7 +92,7 @@ static inline struct io_context *ioc_task_link(struct io_context *ioc)
92 * a race). 92 * a race).
93 */ 93 */
94 if (ioc && atomic_long_inc_not_zero(&ioc->refcount)) { 94 if (ioc && atomic_long_inc_not_zero(&ioc->refcount)) {
95 atomic_long_inc(&ioc->refcount); 95 atomic_inc(&ioc->nr_tasks);
96 return ioc; 96 return ioc;
97 } 97 }
98 98
diff --git a/include/linux/kernel.h b/include/linux/kernel.h
index fac104e7186a..d6320a3e8def 100644
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -303,6 +303,7 @@ extern int oops_in_progress; /* If set, an oops, panic(), BUG() or die() is in
303extern int panic_timeout; 303extern int panic_timeout;
304extern int panic_on_oops; 304extern int panic_on_oops;
305extern int panic_on_unrecovered_nmi; 305extern int panic_on_unrecovered_nmi;
306extern int panic_on_io_nmi;
306extern const char *print_tainted(void); 307extern const char *print_tainted(void);
307extern void add_taint(unsigned flag); 308extern void add_taint(unsigned flag);
308extern int test_taint(unsigned flag); 309extern int test_taint(unsigned flag);
diff --git a/include/linux/kmemleak.h b/include/linux/kmemleak.h
index 7796aed6cdd5..6a63807f714e 100644
--- a/include/linux/kmemleak.h
+++ b/include/linux/kmemleak.h
@@ -27,6 +27,7 @@ extern void kmemleak_init(void);
27extern void kmemleak_alloc(const void *ptr, size_t size, int min_count, 27extern void kmemleak_alloc(const void *ptr, size_t size, int min_count,
28 gfp_t gfp); 28 gfp_t gfp);
29extern void kmemleak_free(const void *ptr); 29extern void kmemleak_free(const void *ptr);
30extern void kmemleak_free_part(const void *ptr, size_t size);
30extern void kmemleak_padding(const void *ptr, unsigned long offset, 31extern void kmemleak_padding(const void *ptr, unsigned long offset,
31 size_t size); 32 size_t size);
32extern void kmemleak_not_leak(const void *ptr); 33extern void kmemleak_not_leak(const void *ptr);
@@ -71,6 +72,9 @@ static inline void kmemleak_alloc_recursive(const void *ptr, size_t size,
71static inline void kmemleak_free(const void *ptr) 72static inline void kmemleak_free(const void *ptr)
72{ 73{
73} 74}
75static inline void kmemleak_free_part(const void *ptr, size_t size)
76{
77}
74static inline void kmemleak_free_recursive(const void *ptr, unsigned long flags) 78static inline void kmemleak_free_recursive(const void *ptr, unsigned long flags)
75{ 79{
76} 80}
diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h
index aacc5449f586..3060bdc35ffe 100644
--- a/include/linux/kvm_host.h
+++ b/include/linux/kvm_host.h
@@ -110,6 +110,7 @@ struct kvm_memory_slot {
110 110
111struct kvm_kernel_irq_routing_entry { 111struct kvm_kernel_irq_routing_entry {
112 u32 gsi; 112 u32 gsi;
113 u32 type;
113 int (*set)(struct kvm_kernel_irq_routing_entry *e, 114 int (*set)(struct kvm_kernel_irq_routing_entry *e,
114 struct kvm *kvm, int level); 115 struct kvm *kvm, int level);
115 union { 116 union {
@@ -125,6 +126,7 @@ struct kvm_kernel_irq_routing_entry {
125struct kvm { 126struct kvm {
126 struct mutex lock; /* protects the vcpus array and APIC accesses */ 127 struct mutex lock; /* protects the vcpus array and APIC accesses */
127 spinlock_t mmu_lock; 128 spinlock_t mmu_lock;
129 spinlock_t requests_lock;
128 struct rw_semaphore slots_lock; 130 struct rw_semaphore slots_lock;
129 struct mm_struct *mm; /* userspace tied to this vm */ 131 struct mm_struct *mm; /* userspace tied to this vm */
130 int nmemslots; 132 int nmemslots;
diff --git a/include/linux/leds-lp3944.h b/include/linux/leds-lp3944.h
new file mode 100644
index 000000000000..afc9f9fd70f5
--- /dev/null
+++ b/include/linux/leds-lp3944.h
@@ -0,0 +1,53 @@
1/*
2 * leds-lp3944.h - platform data structure for lp3944 led controller
3 *
4 * Copyright (C) 2009 Antonio Ospite <ospite@studenti.unina.it>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 *
10 */
11
12#ifndef __LINUX_LEDS_LP3944_H
13#define __LINUX_LEDS_LP3944_H
14
15#include <linux/leds.h>
16#include <linux/workqueue.h>
17
18#define LP3944_LED0 0
19#define LP3944_LED1 1
20#define LP3944_LED2 2
21#define LP3944_LED3 3
22#define LP3944_LED4 4
23#define LP3944_LED5 5
24#define LP3944_LED6 6
25#define LP3944_LED7 7
26#define LP3944_LEDS_MAX 8
27
28#define LP3944_LED_STATUS_MASK 0x03
29enum lp3944_status {
30 LP3944_LED_STATUS_OFF = 0x0,
31 LP3944_LED_STATUS_ON = 0x1,
32 LP3944_LED_STATUS_DIM0 = 0x2,
33 LP3944_LED_STATUS_DIM1 = 0x3
34};
35
36enum lp3944_type {
37 LP3944_LED_TYPE_NONE,
38 LP3944_LED_TYPE_LED,
39 LP3944_LED_TYPE_LED_INVERTED,
40};
41
42struct lp3944_led {
43 char *name;
44 enum lp3944_type type;
45 enum lp3944_status status;
46};
47
48struct lp3944_platform_data {
49 struct lp3944_led leds[LP3944_LEDS_MAX];
50 u8 leds_size;
51};
52
53#endif /* __LINUX_LEDS_LP3944_H */
diff --git a/include/linux/leds.h b/include/linux/leds.h
index 376fe07732ea..d8bf9665e70c 100644
--- a/include/linux/leds.h
+++ b/include/linux/leds.h
@@ -45,7 +45,10 @@ struct led_classdev {
45 /* Get LED brightness level */ 45 /* Get LED brightness level */
46 enum led_brightness (*brightness_get)(struct led_classdev *led_cdev); 46 enum led_brightness (*brightness_get)(struct led_classdev *led_cdev);
47 47
48 /* Activate hardware accelerated blink */ 48 /* Activate hardware accelerated blink, delays are in
49 * miliseconds and if none is provided then a sensible default
50 * should be chosen. The call can adjust the timings if it can't
51 * match the values specified exactly. */
49 int (*blink_set)(struct led_classdev *led_cdev, 52 int (*blink_set)(struct led_classdev *led_cdev,
50 unsigned long *delay_on, 53 unsigned long *delay_on,
51 unsigned long *delay_off); 54 unsigned long *delay_off);
@@ -141,9 +144,14 @@ struct gpio_led {
141 const char *name; 144 const char *name;
142 const char *default_trigger; 145 const char *default_trigger;
143 unsigned gpio; 146 unsigned gpio;
144 u8 active_low : 1; 147 unsigned active_low : 1;
145 u8 retain_state_suspended : 1; 148 unsigned retain_state_suspended : 1;
149 unsigned default_state : 2;
150 /* default_state should be one of LEDS_GPIO_DEFSTATE_(ON|OFF|KEEP) */
146}; 151};
152#define LEDS_GPIO_DEFSTATE_OFF 0
153#define LEDS_GPIO_DEFSTATE_ON 1
154#define LEDS_GPIO_DEFSTATE_KEEP 2
147 155
148struct gpio_led_platform_data { 156struct gpio_led_platform_data {
149 int num_leds; 157 int num_leds;
diff --git a/include/linux/lguest.h b/include/linux/lguest.h
index 7bc1440fc473..2fb1dcbcb5aa 100644
--- a/include/linux/lguest.h
+++ b/include/linux/lguest.h
@@ -1,5 +1,7 @@
1/* Things the lguest guest needs to know. Note: like all lguest interfaces, 1/*
2 * this is subject to wild and random change between versions. */ 2 * Things the lguest guest needs to know. Note: like all lguest interfaces,
3 * this is subject to wild and random change between versions.
4 */
3#ifndef _LINUX_LGUEST_H 5#ifndef _LINUX_LGUEST_H
4#define _LINUX_LGUEST_H 6#define _LINUX_LGUEST_H
5 7
@@ -11,32 +13,41 @@
11#define LG_CLOCK_MIN_DELTA 100UL 13#define LG_CLOCK_MIN_DELTA 100UL
12#define LG_CLOCK_MAX_DELTA ULONG_MAX 14#define LG_CLOCK_MAX_DELTA ULONG_MAX
13 15
14/*G:032 The second method of communicating with the Host is to via "struct 16/*G:031
17 * The second method of communicating with the Host is to via "struct
15 * lguest_data". Once the Guest's initialization hypercall tells the Host where 18 * lguest_data". Once the Guest's initialization hypercall tells the Host where
16 * this is, the Guest and Host both publish information in it. :*/ 19 * this is, the Guest and Host both publish information in it.
17struct lguest_data 20:*/
18{ 21struct lguest_data {
19 /* 512 == enabled (same as eflags in normal hardware). The Guest 22 /*
20 * changes interrupts so often that a hypercall is too slow. */ 23 * 512 == enabled (same as eflags in normal hardware). The Guest
24 * changes interrupts so often that a hypercall is too slow.
25 */
21 unsigned int irq_enabled; 26 unsigned int irq_enabled;
22 /* Fine-grained interrupt disabling by the Guest */ 27 /* Fine-grained interrupt disabling by the Guest */
23 DECLARE_BITMAP(blocked_interrupts, LGUEST_IRQS); 28 DECLARE_BITMAP(blocked_interrupts, LGUEST_IRQS);
24 29
25 /* The Host writes the virtual address of the last page fault here, 30 /*
31 * The Host writes the virtual address of the last page fault here,
26 * which saves the Guest a hypercall. CR2 is the native register where 32 * which saves the Guest a hypercall. CR2 is the native register where
27 * this address would normally be found. */ 33 * this address would normally be found.
34 */
28 unsigned long cr2; 35 unsigned long cr2;
29 36
30 /* Wallclock time set by the Host. */ 37 /* Wallclock time set by the Host. */
31 struct timespec time; 38 struct timespec time;
32 39
33 /* Interrupt pending set by the Host. The Guest should do a hypercall 40 /*
34 * if it re-enables interrupts and sees this set (to X86_EFLAGS_IF). */ 41 * Interrupt pending set by the Host. The Guest should do a hypercall
42 * if it re-enables interrupts and sees this set (to X86_EFLAGS_IF).
43 */
35 int irq_pending; 44 int irq_pending;
36 45
37 /* Async hypercall ring. Instead of directly making hypercalls, we can 46 /*
47 * Async hypercall ring. Instead of directly making hypercalls, we can
38 * place them in here for processing the next time the Host wants. 48 * place them in here for processing the next time the Host wants.
39 * This batching can be quite efficient. */ 49 * This batching can be quite efficient.
50 */
40 51
41 /* 0xFF == done (set by Host), 0 == pending (set by Guest). */ 52 /* 0xFF == done (set by Host), 0 == pending (set by Guest). */
42 u8 hcall_status[LHCALL_RING_SIZE]; 53 u8 hcall_status[LHCALL_RING_SIZE];
diff --git a/include/linux/lguest_launcher.h b/include/linux/lguest_launcher.h
index bfefbdf7498a..495203ff221c 100644
--- a/include/linux/lguest_launcher.h
+++ b/include/linux/lguest_launcher.h
@@ -29,8 +29,10 @@ struct lguest_device_desc {
29 __u8 type; 29 __u8 type;
30 /* The number of virtqueues (first in config array) */ 30 /* The number of virtqueues (first in config array) */
31 __u8 num_vq; 31 __u8 num_vq;
32 /* The number of bytes of feature bits. Multiply by 2: one for host 32 /*
33 * features and one for Guest acknowledgements. */ 33 * The number of bytes of feature bits. Multiply by 2: one for host
34 * features and one for Guest acknowledgements.
35 */
34 __u8 feature_len; 36 __u8 feature_len;
35 /* The number of bytes of the config array after virtqueues. */ 37 /* The number of bytes of the config array after virtqueues. */
36 __u8 config_len; 38 __u8 config_len;
@@ -39,8 +41,10 @@ struct lguest_device_desc {
39 __u8 config[0]; 41 __u8 config[0];
40}; 42};
41 43
42/*D:135 This is how we expect the device configuration field for a virtqueue 44/*D:135
43 * to be laid out in config space. */ 45 * This is how we expect the device configuration field for a virtqueue
46 * to be laid out in config space.
47 */
44struct lguest_vqconfig { 48struct lguest_vqconfig {
45 /* The number of entries in the virtio_ring */ 49 /* The number of entries in the virtio_ring */
46 __u16 num; 50 __u16 num;
@@ -61,7 +65,9 @@ enum lguest_req
61 LHREQ_EVENTFD, /* + address, fd. */ 65 LHREQ_EVENTFD, /* + address, fd. */
62}; 66};
63 67
64/* The alignment to use between consumer and producer parts of vring. 68/*
65 * x86 pagesize for historical reasons. */ 69 * The alignment to use between consumer and producer parts of vring.
70 * x86 pagesize for historical reasons.
71 */
66#define LGUEST_VRING_ALIGN 4096 72#define LGUEST_VRING_ALIGN 4096
67#endif /* _LINUX_LGUEST_LAUNCHER */ 73#endif /* _LINUX_LGUEST_LAUNCHER */
diff --git a/include/linux/libata.h b/include/linux/libata.h
index 3d501db36a26..e5b6e33c6571 100644
--- a/include/linux/libata.h
+++ b/include/linux/libata.h
@@ -385,6 +385,7 @@ enum {
385 not multiple of 16 bytes */ 385 not multiple of 16 bytes */
386 ATA_HORKAGE_FIRMWARE_WARN = (1 << 12), /* firmware update warning */ 386 ATA_HORKAGE_FIRMWARE_WARN = (1 << 12), /* firmware update warning */
387 ATA_HORKAGE_1_5_GBPS = (1 << 13), /* force 1.5 Gbps */ 387 ATA_HORKAGE_1_5_GBPS = (1 << 13), /* force 1.5 Gbps */
388 ATA_HORKAGE_NOSETXFER = (1 << 14), /* skip SETXFER, SATA only */
388 389
389 /* DMA mask for user DMA control: User visible values; DO NOT 390 /* DMA mask for user DMA control: User visible values; DO NOT
390 renumber */ 391 renumber */
@@ -588,6 +589,7 @@ struct ata_device {
588#endif 589#endif
589 /* n_sector is CLEAR_BEGIN, read comment above CLEAR_BEGIN */ 590 /* n_sector is CLEAR_BEGIN, read comment above CLEAR_BEGIN */
590 u64 n_sectors; /* size of device, if ATA */ 591 u64 n_sectors; /* size of device, if ATA */
592 u64 n_native_sectors; /* native size, if ATA */
591 unsigned int class; /* ATA_DEV_xxx */ 593 unsigned int class; /* ATA_DEV_xxx */
592 unsigned long unpark_deadline; 594 unsigned long unpark_deadline;
593 595
diff --git a/include/linux/linkage.h b/include/linux/linkage.h
index fee9e59649c1..691f59171c6c 100644
--- a/include/linux/linkage.h
+++ b/include/linux/linkage.h
@@ -22,6 +22,15 @@
22#define __page_aligned_bss __section(.bss.page_aligned) __aligned(PAGE_SIZE) 22#define __page_aligned_bss __section(.bss.page_aligned) __aligned(PAGE_SIZE)
23 23
24/* 24/*
25 * For assembly routines.
26 *
27 * Note when using these that you must specify the appropriate
28 * alignment directives yourself
29 */
30#define __PAGE_ALIGNED_DATA .section ".data.page_aligned", "aw"
31#define __PAGE_ALIGNED_BSS .section ".bss.page_aligned", "aw"
32
33/*
25 * This is used by architectures to keep arguments on the stack 34 * This is used by architectures to keep arguments on the stack
26 * untouched by the compiler by keeping them live until the end. 35 * untouched by the compiler by keeping them live until the end.
27 * The argument stack may be owned by the assembly-language 36 * The argument stack may be owned by the assembly-language
diff --git a/include/linux/mm.h b/include/linux/mm.h
index d006e93d5c93..ba3a7cb1eaa0 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -826,7 +826,7 @@ extern int make_pages_present(unsigned long addr, unsigned long end);
826extern int access_process_vm(struct task_struct *tsk, unsigned long addr, void *buf, int len, int write); 826extern int access_process_vm(struct task_struct *tsk, unsigned long addr, void *buf, int len, int write);
827 827
828int get_user_pages(struct task_struct *tsk, struct mm_struct *mm, 828int get_user_pages(struct task_struct *tsk, struct mm_struct *mm,
829 unsigned long start, int len, int write, int force, 829 unsigned long start, int nr_pages, int write, int force,
830 struct page **pages, struct vm_area_struct **vmas); 830 struct page **pages, struct vm_area_struct **vmas);
831int get_user_pages_fast(unsigned long start, int nr_pages, int write, 831int get_user_pages_fast(unsigned long start, int nr_pages, int write,
832 struct page **pages); 832 struct page **pages);
diff --git a/include/linux/mnt_namespace.h b/include/linux/mnt_namespace.h
index 3beb2592b03f..d74785c2393a 100644
--- a/include/linux/mnt_namespace.h
+++ b/include/linux/mnt_namespace.h
@@ -2,10 +2,9 @@
2#define _NAMESPACE_H_ 2#define _NAMESPACE_H_
3#ifdef __KERNEL__ 3#ifdef __KERNEL__
4 4
5#include <linux/mount.h> 5#include <linux/path.h>
6#include <linux/sched.h>
7#include <linux/nsproxy.h>
8#include <linux/seq_file.h> 6#include <linux/seq_file.h>
7#include <linux/wait.h>
9 8
10struct mnt_namespace { 9struct mnt_namespace {
11 atomic_t count; 10 atomic_t count;
@@ -28,14 +27,6 @@ extern struct mnt_namespace *create_mnt_ns(struct vfsmount *mnt);
28extern struct mnt_namespace *copy_mnt_ns(unsigned long, struct mnt_namespace *, 27extern struct mnt_namespace *copy_mnt_ns(unsigned long, struct mnt_namespace *,
29 struct fs_struct *); 28 struct fs_struct *);
30extern void put_mnt_ns(struct mnt_namespace *ns); 29extern void put_mnt_ns(struct mnt_namespace *ns);
31
32static inline void exit_mnt_ns(struct task_struct *p)
33{
34 struct mnt_namespace *ns = p->nsproxy->mnt_ns;
35 if (ns)
36 put_mnt_ns(ns);
37}
38
39static inline void get_mnt_ns(struct mnt_namespace *ns) 30static inline void get_mnt_ns(struct mnt_namespace *ns)
40{ 31{
41 atomic_inc(&ns->count); 32 atomic_inc(&ns->count);
diff --git a/include/linux/mtd/mtd.h b/include/linux/mtd/mtd.h
index 5675b63a0631..0f32a9b6ff55 100644
--- a/include/linux/mtd/mtd.h
+++ b/include/linux/mtd/mtd.h
@@ -251,7 +251,7 @@ struct mtd_info {
251 251
252static inline struct mtd_info *dev_to_mtd(struct device *dev) 252static inline struct mtd_info *dev_to_mtd(struct device *dev)
253{ 253{
254 return dev ? container_of(dev, struct mtd_info, dev) : NULL; 254 return dev ? dev_get_drvdata(dev) : NULL;
255} 255}
256 256
257static inline uint32_t mtd_div_by_eb(uint64_t sz, struct mtd_info *mtd) 257static inline uint32_t mtd_div_by_eb(uint64_t sz, struct mtd_info *mtd)
diff --git a/include/linux/mtd/partitions.h b/include/linux/mtd/partitions.h
index af6dcb992bc3..b70313d33ff8 100644
--- a/include/linux/mtd/partitions.h
+++ b/include/linux/mtd/partitions.h
@@ -47,6 +47,8 @@ struct mtd_partition {
47#define MTDPART_SIZ_FULL (0) 47#define MTDPART_SIZ_FULL (0)
48 48
49 49
50struct mtd_info;
51
50int add_mtd_partitions(struct mtd_info *, const struct mtd_partition *, int); 52int add_mtd_partitions(struct mtd_info *, const struct mtd_partition *, int);
51int del_mtd_partitions(struct mtd_info *); 53int del_mtd_partitions(struct mtd_info *);
52 54
diff --git a/include/linux/nodemask.h b/include/linux/nodemask.h
index 829b94b156f2..b359c4a9ec9e 100644
--- a/include/linux/nodemask.h
+++ b/include/linux/nodemask.h
@@ -82,6 +82,12 @@
82 * to generate slightly worse code. So use a simple one-line #define 82 * to generate slightly worse code. So use a simple one-line #define
83 * for node_isset(), instead of wrapping an inline inside a macro, the 83 * for node_isset(), instead of wrapping an inline inside a macro, the
84 * way we do the other calls. 84 * way we do the other calls.
85 *
86 * NODEMASK_SCRATCH
87 * When doing above logical AND, OR, XOR, Remap operations the callers tend to
88 * need temporary nodemask_t's on the stack. But if NODES_SHIFT is large,
89 * nodemask_t's consume too much stack space. NODEMASK_SCRATCH is a helper
90 * for such situations. See below and CPUMASK_ALLOC also.
85 */ 91 */
86 92
87#include <linux/kernel.h> 93#include <linux/kernel.h>
@@ -473,4 +479,26 @@ static inline int num_node_state(enum node_states state)
473#define for_each_node(node) for_each_node_state(node, N_POSSIBLE) 479#define for_each_node(node) for_each_node_state(node, N_POSSIBLE)
474#define for_each_online_node(node) for_each_node_state(node, N_ONLINE) 480#define for_each_online_node(node) for_each_node_state(node, N_ONLINE)
475 481
482/*
483 * For nodemask scrach area.(See CPUMASK_ALLOC() in cpumask.h)
484 */
485
486#if NODES_SHIFT > 8 /* nodemask_t > 64 bytes */
487#define NODEMASK_ALLOC(x, m) struct x *m = kmalloc(sizeof(*m), GFP_KERNEL)
488#define NODEMASK_FREE(m) kfree(m)
489#else
490#define NODEMASK_ALLOC(x, m) struct x _m, *m = &_m
491#define NODEMASK_FREE(m)
492#endif
493
494/* A example struture for using NODEMASK_ALLOC, used in mempolicy. */
495struct nodemask_scratch {
496 nodemask_t mask1;
497 nodemask_t mask2;
498};
499
500#define NODEMASK_SCRATCH(x) NODEMASK_ALLOC(nodemask_scratch, x)
501#define NODEMASK_SCRATCH_FREE(x) NODEMASK_FREE(x)
502
503
476#endif /* __LINUX_NODEMASK_H */ 504#endif /* __LINUX_NODEMASK_H */
diff --git a/include/linux/pci.h b/include/linux/pci.h
index d304ddf412d0..115fb7ba5089 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -1145,7 +1145,7 @@ static inline void pci_set_drvdata(struct pci_dev *pdev, void *data)
1145/* If you want to know what to call your pci_dev, ask this function. 1145/* If you want to know what to call your pci_dev, ask this function.
1146 * Again, it's a wrapper around the generic device. 1146 * Again, it's a wrapper around the generic device.
1147 */ 1147 */
1148static inline const char *pci_name(struct pci_dev *pdev) 1148static inline const char *pci_name(const struct pci_dev *pdev)
1149{ 1149{
1150 return dev_name(&pdev->dev); 1150 return dev_name(&pdev->dev);
1151} 1151}
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h
index a3b000365795..73b46b6b904f 100644
--- a/include/linux/pci_ids.h
+++ b/include/linux/pci_ids.h
@@ -2645,6 +2645,7 @@
2645#define PCI_DEVICE_ID_NETMOS_9835 0x9835 2645#define PCI_DEVICE_ID_NETMOS_9835 0x9835
2646#define PCI_DEVICE_ID_NETMOS_9845 0x9845 2646#define PCI_DEVICE_ID_NETMOS_9845 0x9845
2647#define PCI_DEVICE_ID_NETMOS_9855 0x9855 2647#define PCI_DEVICE_ID_NETMOS_9855 0x9855
2648#define PCI_DEVICE_ID_NETMOS_9901 0x9901
2648 2649
2649#define PCI_VENDOR_ID_3COM_2 0xa727 2650#define PCI_VENDOR_ID_3COM_2 0xa727
2650 2651
diff --git a/include/linux/percpu-defs.h b/include/linux/percpu-defs.h
index 8f921d74f49f..68438e18fff4 100644
--- a/include/linux/percpu-defs.h
+++ b/include/linux/percpu-defs.h
@@ -24,7 +24,8 @@
24 24
25#define DEFINE_PER_CPU_SECTION(type, name, section) \ 25#define DEFINE_PER_CPU_SECTION(type, name, section) \
26 __attribute__((__section__(PER_CPU_BASE_SECTION section))) \ 26 __attribute__((__section__(PER_CPU_BASE_SECTION section))) \
27 PER_CPU_ATTRIBUTES __typeof__(type) per_cpu__##name 27 PER_CPU_ATTRIBUTES PER_CPU_DEF_ATTRIBUTES \
28 __typeof__(type) per_cpu__##name
28 29
29/* 30/*
30 * Variant on the per-CPU variable declaration/definition theme used for 31 * Variant on the per-CPU variable declaration/definition theme used for
diff --git a/include/linux/perf_counter.h b/include/linux/perf_counter.h
index 89698d8aba5c..a67dd5c5b6d3 100644
--- a/include/linux/perf_counter.h
+++ b/include/linux/perf_counter.h
@@ -120,8 +120,10 @@ enum perf_counter_sample_format {
120 PERF_SAMPLE_ID = 1U << 6, 120 PERF_SAMPLE_ID = 1U << 6,
121 PERF_SAMPLE_CPU = 1U << 7, 121 PERF_SAMPLE_CPU = 1U << 7,
122 PERF_SAMPLE_PERIOD = 1U << 8, 122 PERF_SAMPLE_PERIOD = 1U << 8,
123 PERF_SAMPLE_STREAM_ID = 1U << 9,
124 PERF_SAMPLE_TP_RECORD = 1U << 10,
123 125
124 PERF_SAMPLE_MAX = 1U << 9, /* non-ABI */ 126 PERF_SAMPLE_MAX = 1U << 11, /* non-ABI */
125}; 127};
126 128
127/* 129/*
@@ -178,8 +180,11 @@ struct perf_counter_attr {
178 mmap : 1, /* include mmap data */ 180 mmap : 1, /* include mmap data */
179 comm : 1, /* include comm data */ 181 comm : 1, /* include comm data */
180 freq : 1, /* use freq, not period */ 182 freq : 1, /* use freq, not period */
183 inherit_stat : 1, /* per task counts */
184 enable_on_exec : 1, /* next exec enables */
185 task : 1, /* trace fork/exit */
181 186
182 __reserved_1 : 53; 187 __reserved_1 : 50;
183 188
184 __u32 wakeup_events; /* wakeup every n events */ 189 __u32 wakeup_events; /* wakeup every n events */
185 __u32 __reserved_2; 190 __u32 __reserved_2;
@@ -232,6 +237,14 @@ struct perf_counter_mmap_page {
232 __u32 lock; /* seqlock for synchronization */ 237 __u32 lock; /* seqlock for synchronization */
233 __u32 index; /* hardware counter identifier */ 238 __u32 index; /* hardware counter identifier */
234 __s64 offset; /* add to hardware counter value */ 239 __s64 offset; /* add to hardware counter value */
240 __u64 time_enabled; /* time counter active */
241 __u64 time_running; /* time counter on cpu */
242
243 /*
244 * Hole for extension of the self monitor capabilities
245 */
246
247 __u64 __reserved[123]; /* align to 1k */
235 248
236 /* 249 /*
237 * Control data for the mmap() data buffer. 250 * Control data for the mmap() data buffer.
@@ -253,7 +266,6 @@ struct perf_counter_mmap_page {
253#define PERF_EVENT_MISC_KERNEL (1 << 0) 266#define PERF_EVENT_MISC_KERNEL (1 << 0)
254#define PERF_EVENT_MISC_USER (2 << 0) 267#define PERF_EVENT_MISC_USER (2 << 0)
255#define PERF_EVENT_MISC_HYPERVISOR (3 << 0) 268#define PERF_EVENT_MISC_HYPERVISOR (3 << 0)
256#define PERF_EVENT_MISC_OVERFLOW (1 << 2)
257 269
258struct perf_event_header { 270struct perf_event_header {
259 __u32 type; 271 __u32 type;
@@ -301,18 +313,18 @@ enum perf_event_type {
301 /* 313 /*
302 * struct { 314 * struct {
303 * struct perf_event_header header; 315 * struct perf_event_header header;
304 * u64 time; 316 * u32 pid, ppid;
305 * u64 id; 317 * u32 tid, ptid;
306 * u64 sample_period;
307 * }; 318 * };
308 */ 319 */
309 PERF_EVENT_PERIOD = 4, 320 PERF_EVENT_EXIT = 4,
310 321
311 /* 322 /*
312 * struct { 323 * struct {
313 * struct perf_event_header header; 324 * struct perf_event_header header;
314 * u64 time; 325 * u64 time;
315 * u64 id; 326 * u64 id;
327 * u64 stream_id;
316 * }; 328 * };
317 */ 329 */
318 PERF_EVENT_THROTTLE = 5, 330 PERF_EVENT_THROTTLE = 5,
@@ -322,14 +334,24 @@ enum perf_event_type {
322 * struct { 334 * struct {
323 * struct perf_event_header header; 335 * struct perf_event_header header;
324 * u32 pid, ppid; 336 * u32 pid, ppid;
337 * u32 tid, ptid;
325 * }; 338 * };
326 */ 339 */
327 PERF_EVENT_FORK = 7, 340 PERF_EVENT_FORK = 7,
328 341
329 /* 342 /*
330 * When header.misc & PERF_EVENT_MISC_OVERFLOW the event_type field 343 * struct {
331 * will be PERF_SAMPLE_* 344 * struct perf_event_header header;
332 * 345 * u32 pid, tid;
346 * u64 value;
347 * { u64 time_enabled; } && PERF_FORMAT_ENABLED
348 * { u64 time_running; } && PERF_FORMAT_RUNNING
349 * { u64 parent_id; } && PERF_FORMAT_ID
350 * };
351 */
352 PERF_EVENT_READ = 8,
353
354 /*
333 * struct { 355 * struct {
334 * struct perf_event_header header; 356 * struct perf_event_header header;
335 * 357 *
@@ -337,8 +359,10 @@ enum perf_event_type {
337 * { u32 pid, tid; } && PERF_SAMPLE_TID 359 * { u32 pid, tid; } && PERF_SAMPLE_TID
338 * { u64 time; } && PERF_SAMPLE_TIME 360 * { u64 time; } && PERF_SAMPLE_TIME
339 * { u64 addr; } && PERF_SAMPLE_ADDR 361 * { u64 addr; } && PERF_SAMPLE_ADDR
340 * { u64 config; } && PERF_SAMPLE_CONFIG 362 * { u64 id; } && PERF_SAMPLE_ID
363 * { u64 stream_id;} && PERF_SAMPLE_STREAM_ID
341 * { u32 cpu, res; } && PERF_SAMPLE_CPU 364 * { u32 cpu, res; } && PERF_SAMPLE_CPU
365 * { u64 period; } && PERF_SAMPLE_PERIOD
342 * 366 *
343 * { u64 nr; 367 * { u64 nr;
344 * { u64 id, val; } cnt[nr]; } && PERF_SAMPLE_GROUP 368 * { u64 id, val; } cnt[nr]; } && PERF_SAMPLE_GROUP
@@ -347,6 +371,9 @@ enum perf_event_type {
347 * u64 ips[nr]; } && PERF_SAMPLE_CALLCHAIN 371 * u64 ips[nr]; } && PERF_SAMPLE_CALLCHAIN
348 * }; 372 * };
349 */ 373 */
374 PERF_EVENT_SAMPLE = 9,
375
376 PERF_EVENT_MAX, /* non-ABI */
350}; 377};
351 378
352enum perf_callchain_context { 379enum perf_callchain_context {
@@ -387,6 +414,11 @@ struct perf_callchain_entry {
387 __u64 ip[PERF_MAX_STACK_DEPTH]; 414 __u64 ip[PERF_MAX_STACK_DEPTH];
388}; 415};
389 416
417struct perf_tracepoint_record {
418 int size;
419 char *record;
420};
421
390struct task_struct; 422struct task_struct;
391 423
392/** 424/**
@@ -582,6 +614,7 @@ struct perf_counter_context {
582 int nr_counters; 614 int nr_counters;
583 int nr_active; 615 int nr_active;
584 int is_active; 616 int is_active;
617 int nr_stat;
585 atomic_t refcount; 618 atomic_t refcount;
586 struct task_struct *task; 619 struct task_struct *task;
587 620
@@ -654,6 +687,7 @@ struct perf_sample_data {
654 struct pt_regs *regs; 687 struct pt_regs *regs;
655 u64 addr; 688 u64 addr;
656 u64 period; 689 u64 period;
690 void *private;
657}; 691};
658 692
659extern int perf_counter_overflow(struct perf_counter *counter, int nmi, 693extern int perf_counter_overflow(struct perf_counter *counter, int nmi,
@@ -669,7 +703,16 @@ static inline int is_software_counter(struct perf_counter *counter)
669 (counter->attr.type != PERF_TYPE_HW_CACHE); 703 (counter->attr.type != PERF_TYPE_HW_CACHE);
670} 704}
671 705
672extern void perf_swcounter_event(u32, u64, int, struct pt_regs *, u64); 706extern atomic_t perf_swcounter_enabled[PERF_COUNT_SW_MAX];
707
708extern void __perf_swcounter_event(u32, u64, int, struct pt_regs *, u64);
709
710static inline void
711perf_swcounter_event(u32 event, u64 nr, int nmi, struct pt_regs *regs, u64 addr)
712{
713 if (atomic_read(&perf_swcounter_enabled[event]))
714 __perf_swcounter_event(event, nr, nmi, regs, addr);
715}
673 716
674extern void __perf_counter_mmap(struct vm_area_struct *vma); 717extern void __perf_counter_mmap(struct vm_area_struct *vma);
675 718
diff --git a/include/linux/personality.h b/include/linux/personality.h
index a84e9ff9b27e..126120819a0d 100644
--- a/include/linux/personality.h
+++ b/include/linux/personality.h
@@ -40,7 +40,10 @@ enum {
40 * Security-relevant compatibility flags that must be 40 * Security-relevant compatibility flags that must be
41 * cleared upon setuid or setgid exec: 41 * cleared upon setuid or setgid exec:
42 */ 42 */
43#define PER_CLEAR_ON_SETID (READ_IMPLIES_EXEC|ADDR_NO_RANDOMIZE) 43#define PER_CLEAR_ON_SETID (READ_IMPLIES_EXEC | \
44 ADDR_NO_RANDOMIZE | \
45 ADDR_COMPAT_LAYOUT | \
46 MMAP_PAGE_ZERO)
44 47
45/* 48/*
46 * Personality types. 49 * Personality types.
diff --git a/include/linux/pps.h b/include/linux/pps.h
index cfe5c7214ec6..0194ab06177b 100644
--- a/include/linux/pps.h
+++ b/include/linux/pps.h
@@ -22,6 +22,8 @@
22#ifndef _PPS_H_ 22#ifndef _PPS_H_
23#define _PPS_H_ 23#define _PPS_H_
24 24
25#include <linux/types.h>
26
25#define PPS_VERSION "5.3.6" 27#define PPS_VERSION "5.3.6"
26#define PPS_MAX_SOURCES 16 /* should be enough... */ 28#define PPS_MAX_SOURCES 16 /* should be enough... */
27 29
diff --git a/include/linux/quotaops.h b/include/linux/quotaops.h
index 7bc457593684..26361c4c037a 100644
--- a/include/linux/quotaops.h
+++ b/include/linux/quotaops.h
@@ -7,7 +7,6 @@
7#ifndef _LINUX_QUOTAOPS_ 7#ifndef _LINUX_QUOTAOPS_
8#define _LINUX_QUOTAOPS_ 8#define _LINUX_QUOTAOPS_
9 9
10#include <linux/smp_lock.h>
11#include <linux/fs.h> 10#include <linux/fs.h>
12 11
13static inline struct quota_info *sb_dqopt(struct super_block *sb) 12static inline struct quota_info *sb_dqopt(struct super_block *sb)
diff --git a/include/linux/scatterlist.h b/include/linux/scatterlist.h
index e5996984ddd0..9aaf5bfdad1a 100644
--- a/include/linux/scatterlist.h
+++ b/include/linux/scatterlist.h
@@ -242,6 +242,8 @@ size_t sg_copy_to_buffer(struct scatterlist *sgl, unsigned int nents,
242 */ 242 */
243 243
244#define SG_MITER_ATOMIC (1 << 0) /* use kmap_atomic */ 244#define SG_MITER_ATOMIC (1 << 0) /* use kmap_atomic */
245#define SG_MITER_TO_SG (1 << 1) /* flush back to phys on unmap */
246#define SG_MITER_FROM_SG (1 << 2) /* nop */
245 247
246struct sg_mapping_iter { 248struct sg_mapping_iter {
247 /* the following three fields can be accessed directly */ 249 /* the following three fields can be accessed directly */
diff --git a/include/linux/sched.h b/include/linux/sched.h
index 4d0754269884..3ab08e4bb6b8 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -209,7 +209,7 @@ extern unsigned long long time_sync_thresh;
209 ((task->state & (__TASK_STOPPED | __TASK_TRACED)) != 0) 209 ((task->state & (__TASK_STOPPED | __TASK_TRACED)) != 0)
210#define task_contributes_to_load(task) \ 210#define task_contributes_to_load(task) \
211 ((task->state & TASK_UNINTERRUPTIBLE) != 0 && \ 211 ((task->state & TASK_UNINTERRUPTIBLE) != 0 && \
212 (task->flags & PF_FROZEN) == 0) 212 (task->flags & PF_FREEZING) == 0)
213 213
214#define __set_task_state(tsk, state_value) \ 214#define __set_task_state(tsk, state_value) \
215 do { (tsk)->state = (state_value); } while (0) 215 do { (tsk)->state = (state_value); } while (0)
@@ -349,8 +349,20 @@ extern int mutex_spin_on_owner(struct mutex *lock, struct thread_info *owner);
349struct nsproxy; 349struct nsproxy;
350struct user_namespace; 350struct user_namespace;
351 351
352/* Maximum number of active map areas.. This is a random (large) number */ 352/*
353#define DEFAULT_MAX_MAP_COUNT 65536 353 * Default maximum number of active map areas, this limits the number of vmas
354 * per mm struct. Users can overwrite this number by sysctl but there is a
355 * problem.
356 *
357 * When a program's coredump is generated as ELF format, a section is created
358 * per a vma. In ELF, the number of sections is represented in unsigned short.
359 * This means the number of sections should be smaller than 65535 at coredump.
360 * Because the kernel adds some informative sections to a image of program at
361 * generating coredump, we need some margin. The number of extra sections is
362 * 1-3 now and depends on arch. We use "5" as safe margin, here.
363 */
364#define MAPCOUNT_ELF_CORE_MARGIN (5)
365#define DEFAULT_MAX_MAP_COUNT (USHORT_MAX - MAPCOUNT_ELF_CORE_MARGIN)
354 366
355extern int sysctl_max_map_count; 367extern int sysctl_max_map_count;
356 368
@@ -486,6 +498,15 @@ struct task_cputime {
486 .sum_exec_runtime = 0, \ 498 .sum_exec_runtime = 0, \
487 } 499 }
488 500
501/*
502 * Disable preemption until the scheduler is running.
503 * Reset by start_kernel()->sched_init()->init_idle().
504 *
505 * We include PREEMPT_ACTIVE to avoid cond_resched() from working
506 * before the scheduler is active -- see should_resched().
507 */
508#define INIT_PREEMPT_COUNT (1 + PREEMPT_ACTIVE)
509
489/** 510/**
490 * struct thread_group_cputimer - thread group interval timer counts 511 * struct thread_group_cputimer - thread group interval timer counts
491 * @cputime: thread group interval timers. 512 * @cputime: thread group interval timers.
@@ -1659,6 +1680,7 @@ extern cputime_t task_gtime(struct task_struct *p);
1659#define PF_MEMALLOC 0x00000800 /* Allocating memory */ 1680#define PF_MEMALLOC 0x00000800 /* Allocating memory */
1660#define PF_FLUSHER 0x00001000 /* responsible for disk writeback */ 1681#define PF_FLUSHER 0x00001000 /* responsible for disk writeback */
1661#define PF_USED_MATH 0x00002000 /* if unset the fpu must be initialized before use */ 1682#define PF_USED_MATH 0x00002000 /* if unset the fpu must be initialized before use */
1683#define PF_FREEZING 0x00004000 /* freeze in progress. do not account to load */
1662#define PF_NOFREEZE 0x00008000 /* this thread should not be frozen */ 1684#define PF_NOFREEZE 0x00008000 /* this thread should not be frozen */
1663#define PF_FROZEN 0x00010000 /* frozen for system suspend */ 1685#define PF_FROZEN 0x00010000 /* frozen for system suspend */
1664#define PF_FSTRANS 0x00020000 /* inside a filesystem transaction */ 1686#define PF_FSTRANS 0x00020000 /* inside a filesystem transaction */
diff --git a/include/linux/slub_def.h b/include/linux/slub_def.h
index 4dcbc2c71491..c1c862b1d01a 100644
--- a/include/linux/slub_def.h
+++ b/include/linux/slub_def.h
@@ -11,6 +11,7 @@
11#include <linux/workqueue.h> 11#include <linux/workqueue.h>
12#include <linux/kobject.h> 12#include <linux/kobject.h>
13#include <linux/kmemtrace.h> 13#include <linux/kmemtrace.h>
14#include <linux/kmemleak.h>
14 15
15enum stat_item { 16enum stat_item {
16 ALLOC_FASTPATH, /* Allocation from cpu slab */ 17 ALLOC_FASTPATH, /* Allocation from cpu slab */
@@ -233,6 +234,7 @@ static __always_inline void *kmalloc_large(size_t size, gfp_t flags)
233 unsigned int order = get_order(size); 234 unsigned int order = get_order(size);
234 void *ret = (void *) __get_free_pages(flags | __GFP_COMP, order); 235 void *ret = (void *) __get_free_pages(flags | __GFP_COMP, order);
235 236
237 kmemleak_alloc(ret, size, 1, flags);
236 trace_kmalloc(_THIS_IP_, ret, size, PAGE_SIZE << order, flags); 238 trace_kmalloc(_THIS_IP_, ret, size, PAGE_SIZE << order, flags);
237 239
238 return ret; 240 return ret;
diff --git a/include/linux/spi/spi.h b/include/linux/spi/spi.h
index 9c4cd27f4685..c47c4b4da97e 100644
--- a/include/linux/spi/spi.h
+++ b/include/linux/spi/spi.h
@@ -80,6 +80,8 @@ struct spi_device {
80#define SPI_LSB_FIRST 0x08 /* per-word bits-on-wire */ 80#define SPI_LSB_FIRST 0x08 /* per-word bits-on-wire */
81#define SPI_3WIRE 0x10 /* SI/SO signals shared */ 81#define SPI_3WIRE 0x10 /* SI/SO signals shared */
82#define SPI_LOOP 0x20 /* loopback mode */ 82#define SPI_LOOP 0x20 /* loopback mode */
83#define SPI_NO_CS 0x40 /* 1 dev/bus, no chipselect */
84#define SPI_READY 0x80 /* slave pulls low to pause */
83 u8 bits_per_word; 85 u8 bits_per_word;
84 int irq; 86 int irq;
85 void *controller_state; 87 void *controller_state;
@@ -248,6 +250,10 @@ struct spi_master {
248 /* spi_device.mode flags understood by this controller driver */ 250 /* spi_device.mode flags understood by this controller driver */
249 u16 mode_bits; 251 u16 mode_bits;
250 252
253 /* other constraints relevant to this driver */
254 u16 flags;
255#define SPI_MASTER_HALF_DUPLEX BIT(0) /* can't do full duplex */
256
251 /* Setup mode and clock, etc (spi driver may call many times). 257 /* Setup mode and clock, etc (spi driver may call many times).
252 * 258 *
253 * IMPORTANT: this may be called when transfers to another 259 * IMPORTANT: this may be called when transfers to another
diff --git a/include/linux/spi/spidev.h b/include/linux/spi/spidev.h
index 95251ccd5a07..bf0570a84f7a 100644
--- a/include/linux/spi/spidev.h
+++ b/include/linux/spi/spidev.h
@@ -40,6 +40,8 @@
40#define SPI_LSB_FIRST 0x08 40#define SPI_LSB_FIRST 0x08
41#define SPI_3WIRE 0x10 41#define SPI_3WIRE 0x10
42#define SPI_LOOP 0x20 42#define SPI_LOOP 0x20
43#define SPI_NO_CS 0x40
44#define SPI_READY 0x80
43 45
44/*---------------------------------------------------------------------------*/ 46/*---------------------------------------------------------------------------*/
45 47
diff --git a/include/linux/sunrpc/xdr.h b/include/linux/sunrpc/xdr.h
index d8910b68e1bd..b99c625fddfe 100644
--- a/include/linux/sunrpc/xdr.h
+++ b/include/linux/sunrpc/xdr.h
@@ -12,7 +12,6 @@
12#include <linux/uio.h> 12#include <linux/uio.h>
13#include <asm/byteorder.h> 13#include <asm/byteorder.h>
14#include <linux/scatterlist.h> 14#include <linux/scatterlist.h>
15#include <linux/smp_lock.h>
16 15
17/* 16/*
18 * Buffer adjustment 17 * Buffer adjustment
diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h
index fa4242cdade8..80de7003d8c2 100644
--- a/include/linux/syscalls.h
+++ b/include/linux/syscalls.h
@@ -321,6 +321,8 @@ asmlinkage long sys_rt_sigtimedwait(const sigset_t __user *uthese,
321 siginfo_t __user *uinfo, 321 siginfo_t __user *uinfo,
322 const struct timespec __user *uts, 322 const struct timespec __user *uts,
323 size_t sigsetsize); 323 size_t sigsetsize);
324asmlinkage long sys_rt_tgsigqueueinfo(pid_t tgid, pid_t pid, int sig,
325 siginfo_t __user *uinfo);
324asmlinkage long sys_kill(int pid, int sig); 326asmlinkage long sys_kill(int pid, int sig);
325asmlinkage long sys_tgkill(int tgid, int pid, int sig); 327asmlinkage long sys_tgkill(int tgid, int pid, int sig);
326asmlinkage long sys_tkill(int pid, int sig); 328asmlinkage long sys_tkill(int pid, int sig);
diff --git a/include/linux/sysrq.h b/include/linux/sysrq.h
index 98a1d8cfb73d..99adcdc0d3ca 100644
--- a/include/linux/sysrq.h
+++ b/include/linux/sysrq.h
@@ -14,6 +14,8 @@
14#ifndef _LINUX_SYSRQ_H 14#ifndef _LINUX_SYSRQ_H
15#define _LINUX_SYSRQ_H 15#define _LINUX_SYSRQ_H
16 16
17#include <linux/errno.h>
18
17struct pt_regs; 19struct pt_regs;
18struct tty_struct; 20struct tty_struct;
19 21
diff --git a/include/linux/timer.h b/include/linux/timer.h
index ccf882eed8f8..be62ec2ebea5 100644
--- a/include/linux/timer.h
+++ b/include/linux/timer.h
@@ -190,6 +190,8 @@ extern unsigned long get_next_timer_interrupt(unsigned long now);
190 */ 190 */
191#ifdef CONFIG_TIMER_STATS 191#ifdef CONFIG_TIMER_STATS
192 192
193extern int timer_stats_active;
194
193#define TIMER_STATS_FLAG_DEFERRABLE 0x1 195#define TIMER_STATS_FLAG_DEFERRABLE 0x1
194 196
195extern void init_timer_stats(void); 197extern void init_timer_stats(void);
@@ -203,6 +205,8 @@ extern void __timer_stats_timer_set_start_info(struct timer_list *timer,
203 205
204static inline void timer_stats_timer_set_start_info(struct timer_list *timer) 206static inline void timer_stats_timer_set_start_info(struct timer_list *timer)
205{ 207{
208 if (likely(!timer_stats_active))
209 return;
206 __timer_stats_timer_set_start_info(timer, __builtin_return_address(0)); 210 __timer_stats_timer_set_start_info(timer, __builtin_return_address(0));
207} 211}
208 212
diff --git a/include/linux/tty.h b/include/linux/tty.h
index 1488d8c81aac..e8c6c9136c97 100644
--- a/include/linux/tty.h
+++ b/include/linux/tty.h
@@ -394,6 +394,7 @@ extern void __do_SAK(struct tty_struct *tty);
394extern void disassociate_ctty(int priv); 394extern void disassociate_ctty(int priv);
395extern void no_tty(void); 395extern void no_tty(void);
396extern void tty_flip_buffer_push(struct tty_struct *tty); 396extern void tty_flip_buffer_push(struct tty_struct *tty);
397extern void tty_flush_to_ldisc(struct tty_struct *tty);
397extern void tty_buffer_free_all(struct tty_struct *tty); 398extern void tty_buffer_free_all(struct tty_struct *tty);
398extern void tty_buffer_flush(struct tty_struct *tty); 399extern void tty_buffer_flush(struct tty_struct *tty);
399extern void tty_buffer_init(struct tty_struct *tty); 400extern void tty_buffer_init(struct tty_struct *tty);
diff --git a/include/linux/tty_ldisc.h b/include/linux/tty_ldisc.h
index 40f38d896777..0c4ee9b88f85 100644
--- a/include/linux/tty_ldisc.h
+++ b/include/linux/tty_ldisc.h
@@ -144,7 +144,7 @@ struct tty_ldisc_ops {
144 144
145struct tty_ldisc { 145struct tty_ldisc {
146 struct tty_ldisc_ops *ops; 146 struct tty_ldisc_ops *ops;
147 int refcount; 147 atomic_t users;
148}; 148};
149 149
150#define TTY_LDISC_MAGIC 0x5403 150#define TTY_LDISC_MAGIC 0x5403
diff --git a/include/linux/uio.h b/include/linux/uio.h
index b7fe13883bdb..98c114323a8b 100644
--- a/include/linux/uio.h
+++ b/include/linux/uio.h
@@ -19,15 +19,6 @@ struct iovec
19 __kernel_size_t iov_len; /* Must be size_t (1003.1g) */ 19 __kernel_size_t iov_len; /* Must be size_t (1003.1g) */
20}; 20};
21 21
22#ifdef __KERNEL__
23
24struct kvec {
25 void *iov_base; /* and that should *never* hold a userland pointer */
26 size_t iov_len;
27};
28
29#endif
30
31/* 22/*
32 * UIO_MAXIOV shall be at least 16 1003.1g (5.4.1.1) 23 * UIO_MAXIOV shall be at least 16 1003.1g (5.4.1.1)
33 */ 24 */
@@ -35,6 +26,13 @@ struct kvec {
35#define UIO_FASTIOV 8 26#define UIO_FASTIOV 8
36#define UIO_MAXIOV 1024 27#define UIO_MAXIOV 1024
37 28
29#ifdef __KERNEL__
30
31struct kvec {
32 void *iov_base; /* and that should *never* hold a userland pointer */
33 size_t iov_len;
34};
35
38/* 36/*
39 * Total number of bytes covered by an iovec. 37 * Total number of bytes covered by an iovec.
40 * 38 *
@@ -53,5 +51,6 @@ static inline size_t iov_length(const struct iovec *iov, unsigned long nr_segs)
53} 51}
54 52
55unsigned long iov_shorten(struct iovec *iov, unsigned long nr_segs, size_t to); 53unsigned long iov_shorten(struct iovec *iov, unsigned long nr_segs, size_t to);
54#endif
56 55
57#endif 56#endif
diff --git a/include/linux/usb.h b/include/linux/usb.h
index 84929e914034..b1e3c2fbfe11 100644
--- a/include/linux/usb.h
+++ b/include/linux/usb.h
@@ -888,8 +888,6 @@ struct usb_driver {
888 * struct usb_device_driver - identifies USB device driver to usbcore 888 * struct usb_device_driver - identifies USB device driver to usbcore
889 * @name: The driver name should be unique among USB drivers, 889 * @name: The driver name should be unique among USB drivers,
890 * and should normally be the same as the module name. 890 * and should normally be the same as the module name.
891 * @nodename: Callback to provide a naming hint for a possible
892 * device node to create.
893 * @probe: Called to see if the driver is willing to manage a particular 891 * @probe: Called to see if the driver is willing to manage a particular
894 * device. If it is, probe returns zero and uses dev_set_drvdata() 892 * device. If it is, probe returns zero and uses dev_set_drvdata()
895 * to associate driver-specific data with the device. If unwilling 893 * to associate driver-specific data with the device. If unwilling
@@ -924,6 +922,8 @@ extern struct bus_type usb_bus_type;
924/** 922/**
925 * struct usb_class_driver - identifies a USB driver that wants to use the USB major number 923 * struct usb_class_driver - identifies a USB driver that wants to use the USB major number
926 * @name: the usb class device name for this driver. Will show up in sysfs. 924 * @name: the usb class device name for this driver. Will show up in sysfs.
925 * @nodename: Callback to provide a naming hint for a possible
926 * device node to create.
927 * @fops: pointer to the struct file_operations of this driver. 927 * @fops: pointer to the struct file_operations of this driver.
928 * @minor_base: the start of the minor range for this driver. 928 * @minor_base: the start of the minor range for this driver.
929 * 929 *
@@ -1046,6 +1046,8 @@ typedef void (*usb_complete_t)(struct urb *);
1046 * the device driver is saying that it provided this DMA address, 1046 * the device driver is saying that it provided this DMA address,
1047 * which the host controller driver should use in preference to the 1047 * which the host controller driver should use in preference to the
1048 * transfer_buffer. 1048 * transfer_buffer.
1049 * @sg: scatter gather buffer list
1050 * @num_sgs: number of entries in the sg list
1049 * @transfer_buffer_length: How big is transfer_buffer. The transfer may 1051 * @transfer_buffer_length: How big is transfer_buffer. The transfer may
1050 * be broken up into chunks according to the current maximum packet 1052 * be broken up into chunks according to the current maximum packet
1051 * size for the endpoint, which is a function of the configuration 1053 * size for the endpoint, which is a function of the configuration
diff --git a/include/linux/usb/langwell_otg.h b/include/linux/usb/langwell_otg.h
deleted file mode 100644
index e115ae6df1da..000000000000
--- a/include/linux/usb/langwell_otg.h
+++ /dev/null
@@ -1,177 +0,0 @@
1/*
2 * Intel Langwell USB OTG transceiver driver
3 * Copyright (C) 2008, Intel Corporation.
4 *
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms and conditions of the GNU General Public License,
7 * version 2, as 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 for
12 * more details.
13 *
14 * You should have received a copy of the GNU General Public License along with
15 * this program; if not, write to the Free Software Foundation, Inc.,
16 * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
17 *
18 */
19
20#ifndef __LANGWELL_OTG_H__
21#define __LANGWELL_OTG_H__
22
23/* notify transceiver driver about OTG events */
24extern void langwell_update_transceiver(void);
25/* HCD register bus driver */
26extern int langwell_register_host(struct pci_driver *host_driver);
27/* HCD unregister bus driver */
28extern void langwell_unregister_host(struct pci_driver *host_driver);
29/* DCD register bus driver */
30extern int langwell_register_peripheral(struct pci_driver *client_driver);
31/* DCD unregister bus driver */
32extern void langwell_unregister_peripheral(struct pci_driver *client_driver);
33/* No silent failure, output warning message */
34extern void langwell_otg_nsf_msg(unsigned long message);
35
36#define CI_USBCMD 0x30
37# define USBCMD_RST BIT(1)
38# define USBCMD_RS BIT(0)
39#define CI_USBSTS 0x34
40# define USBSTS_SLI BIT(8)
41# define USBSTS_URI BIT(6)
42# define USBSTS_PCI BIT(2)
43#define CI_PORTSC1 0x74
44# define PORTSC_PP BIT(12)
45# define PORTSC_LS (BIT(11) | BIT(10))
46# define PORTSC_SUSP BIT(7)
47# define PORTSC_CCS BIT(0)
48#define CI_HOSTPC1 0xb4
49# define HOSTPC1_PHCD BIT(22)
50#define CI_OTGSC 0xf4
51# define OTGSC_DPIE BIT(30)
52# define OTGSC_1MSE BIT(29)
53# define OTGSC_BSEIE BIT(28)
54# define OTGSC_BSVIE BIT(27)
55# define OTGSC_ASVIE BIT(26)
56# define OTGSC_AVVIE BIT(25)
57# define OTGSC_IDIE BIT(24)
58# define OTGSC_DPIS BIT(22)
59# define OTGSC_1MSS BIT(21)
60# define OTGSC_BSEIS BIT(20)
61# define OTGSC_BSVIS BIT(19)
62# define OTGSC_ASVIS BIT(18)
63# define OTGSC_AVVIS BIT(17)
64# define OTGSC_IDIS BIT(16)
65# define OTGSC_DPS BIT(14)
66# define OTGSC_1MST BIT(13)
67# define OTGSC_BSE BIT(12)
68# define OTGSC_BSV BIT(11)
69# define OTGSC_ASV BIT(10)
70# define OTGSC_AVV BIT(9)
71# define OTGSC_ID BIT(8)
72# define OTGSC_HABA BIT(7)
73# define OTGSC_HADP BIT(6)
74# define OTGSC_IDPU BIT(5)
75# define OTGSC_DP BIT(4)
76# define OTGSC_OT BIT(3)
77# define OTGSC_HAAR BIT(2)
78# define OTGSC_VC BIT(1)
79# define OTGSC_VD BIT(0)
80# define OTGSC_INTEN_MASK (0x7f << 24)
81# define OTGSC_INTSTS_MASK (0x7f << 16)
82#define CI_USBMODE 0xf8
83# define USBMODE_CM (BIT(1) | BIT(0))
84# define USBMODE_IDLE 0
85# define USBMODE_DEVICE 0x2
86# define USBMODE_HOST 0x3
87
88#define INTR_DUMMY_MASK (USBSTS_SLI | USBSTS_URI | USBSTS_PCI)
89
90struct otg_hsm {
91 /* Input */
92 int a_bus_resume;
93 int a_bus_suspend;
94 int a_conn;
95 int a_sess_vld;
96 int a_srp_det;
97 int a_vbus_vld;
98 int b_bus_resume;
99 int b_bus_suspend;
100 int b_conn;
101 int b_se0_srp;
102 int b_sess_end;
103 int b_sess_vld;
104 int id;
105
106 /* Internal variables */
107 int a_set_b_hnp_en;
108 int b_srp_done;
109 int b_hnp_enable;
110
111 /* Timeout indicator for timers */
112 int a_wait_vrise_tmout;
113 int a_wait_bcon_tmout;
114 int a_aidl_bdis_tmout;
115 int b_ase0_brst_tmout;
116 int b_bus_suspend_tmout;
117 int b_srp_res_tmout;
118
119 /* Informative variables */
120 int a_bus_drop;
121 int a_bus_req;
122 int a_clr_err;
123 int a_suspend_req;
124 int b_bus_req;
125
126 /* Output */
127 int drv_vbus;
128 int loc_conn;
129 int loc_sof;
130
131 /* Others */
132 int b_bus_suspend_vld;
133};
134
135#define TA_WAIT_VRISE 100
136#define TA_WAIT_BCON 30000
137#define TA_AIDL_BDIS 15000
138#define TB_ASE0_BRST 5000
139#define TB_SE0_SRP 2
140#define TB_SRP_RES 100
141#define TB_BUS_SUSPEND 500
142
143struct langwell_otg_timer {
144 unsigned long expires; /* Number of count increase to timeout */
145 unsigned long count; /* Tick counter */
146 void (*function)(unsigned long); /* Timeout function */
147 unsigned long data; /* Data passed to function */
148 struct list_head list;
149};
150
151struct langwell_otg {
152 struct otg_transceiver otg;
153 struct otg_hsm hsm;
154 void __iomem *regs;
155 unsigned region;
156 struct pci_driver *host_ops;
157 struct pci_driver *client_ops;
158 struct pci_dev *pdev;
159 struct work_struct work;
160 struct workqueue_struct *qwork;
161 spinlock_t lock;
162 spinlock_t wq_lock;
163};
164
165static inline struct langwell_otg *otg_to_langwell(struct otg_transceiver *otg)
166{
167 return container_of(otg, struct langwell_otg, otg);
168}
169
170#ifdef DEBUG
171#define otg_dbg(fmt, args...) \
172 printk(KERN_DEBUG fmt , ## args)
173#else
174#define otg_dbg(fmt, args...) \
175 do { } while (0)
176#endif /* DEBUG */
177#endif /* __LANGWELL_OTG_H__ */
diff --git a/include/linux/usb/serial.h b/include/linux/usb/serial.h
index 44801d26a37a..0ec50ba62139 100644
--- a/include/linux/usb/serial.h
+++ b/include/linux/usb/serial.h
@@ -317,7 +317,8 @@ extern int usb_serial_generic_register(int debug);
317extern void usb_serial_generic_deregister(void); 317extern void usb_serial_generic_deregister(void);
318extern void usb_serial_generic_resubmit_read_urb(struct usb_serial_port *port, 318extern void usb_serial_generic_resubmit_read_urb(struct usb_serial_port *port,
319 gfp_t mem_flags); 319 gfp_t mem_flags);
320extern int usb_serial_handle_sysrq_char(struct usb_serial_port *port, 320extern int usb_serial_handle_sysrq_char(struct tty_struct *tty,
321 struct usb_serial_port *port,
321 unsigned int ch); 322 unsigned int ch);
322extern int usb_serial_handle_break(struct usb_serial_port *port); 323extern int usb_serial_handle_break(struct usb_serial_port *port);
323 324
diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h
index 8a025d510904..74f16876f38d 100644
--- a/include/linux/videodev2.h
+++ b/include/linux/videodev2.h
@@ -318,6 +318,8 @@ struct v4l2_pix_format {
318/* see http://www.siliconimaging.com/RGB%20Bayer.htm */ 318/* see http://www.siliconimaging.com/RGB%20Bayer.htm */
319#define V4L2_PIX_FMT_SBGGR8 v4l2_fourcc('B', 'A', '8', '1') /* 8 BGBG.. GRGR.. */ 319#define V4L2_PIX_FMT_SBGGR8 v4l2_fourcc('B', 'A', '8', '1') /* 8 BGBG.. GRGR.. */
320#define V4L2_PIX_FMT_SGBRG8 v4l2_fourcc('G', 'B', 'R', 'G') /* 8 GBGB.. RGRG.. */ 320#define V4L2_PIX_FMT_SGBRG8 v4l2_fourcc('G', 'B', 'R', 'G') /* 8 GBGB.. RGRG.. */
321#define V4L2_PIX_FMT_SGRBG8 v4l2_fourcc('G', 'R', 'B', 'G') /* 8 GRGR.. BGBG.. */
322
321/* 323/*
322 * 10bit raw bayer, expanded to 16 bits 324 * 10bit raw bayer, expanded to 16 bits
323 * xxxxrrrrrrrrrrxxxxgggggggggg xxxxggggggggggxxxxbbbbbbbbbb... 325 * xxxxrrrrrrrrrrxxxxgggggggggg xxxxggggggggggxxxxbbbbbbbbbb...
@@ -336,6 +338,7 @@ struct v4l2_pix_format {
336/* Vendor-specific formats */ 338/* Vendor-specific formats */
337#define V4L2_PIX_FMT_WNVA v4l2_fourcc('W', 'N', 'V', 'A') /* Winnov hw compress */ 339#define V4L2_PIX_FMT_WNVA v4l2_fourcc('W', 'N', 'V', 'A') /* Winnov hw compress */
338#define V4L2_PIX_FMT_SN9C10X v4l2_fourcc('S', '9', '1', '0') /* SN9C10x compression */ 340#define V4L2_PIX_FMT_SN9C10X v4l2_fourcc('S', '9', '1', '0') /* SN9C10x compression */
341#define V4L2_PIX_FMT_SN9C20X_I420 v4l2_fourcc('S', '9', '2', '0') /* SN9C20x YUV 4:2:0 */
339#define V4L2_PIX_FMT_PWC1 v4l2_fourcc('P', 'W', 'C', '1') /* pwc older webcam */ 342#define V4L2_PIX_FMT_PWC1 v4l2_fourcc('P', 'W', 'C', '1') /* pwc older webcam */
340#define V4L2_PIX_FMT_PWC2 v4l2_fourcc('P', 'W', 'C', '2') /* pwc newer webcam */ 343#define V4L2_PIX_FMT_PWC2 v4l2_fourcc('P', 'W', 'C', '2') /* pwc newer webcam */
341#define V4L2_PIX_FMT_ET61X251 v4l2_fourcc('E', '6', '2', '5') /* ET61X251 compression */ 344#define V4L2_PIX_FMT_ET61X251 v4l2_fourcc('E', '6', '2', '5') /* ET61X251 compression */
diff --git a/include/linux/virtio_blk.h b/include/linux/virtio_blk.h
index be7d255fc7cf..8dab9f2b8832 100644
--- a/include/linux/virtio_blk.h
+++ b/include/linux/virtio_blk.h
@@ -20,8 +20,7 @@
20 20
21#define VIRTIO_BLK_ID_BYTES (sizeof(__u16[256])) /* IDENTIFY DATA */ 21#define VIRTIO_BLK_ID_BYTES (sizeof(__u16[256])) /* IDENTIFY DATA */
22 22
23struct virtio_blk_config 23struct virtio_blk_config {
24{
25 /* The capacity (in 512-byte sectors). */ 24 /* The capacity (in 512-byte sectors). */
26 __u64 capacity; 25 __u64 capacity;
27 /* The maximum segment size (if VIRTIO_BLK_F_SIZE_MAX) */ 26 /* The maximum segment size (if VIRTIO_BLK_F_SIZE_MAX) */
@@ -50,8 +49,7 @@ struct virtio_blk_config
50#define VIRTIO_BLK_T_BARRIER 0x80000000 49#define VIRTIO_BLK_T_BARRIER 0x80000000
51 50
52/* This is the first element of the read scatter-gather list. */ 51/* This is the first element of the read scatter-gather list. */
53struct virtio_blk_outhdr 52struct virtio_blk_outhdr {
54{
55 /* VIRTIO_BLK_T* */ 53 /* VIRTIO_BLK_T* */
56 __u32 type; 54 __u32 type;
57 /* io priority. */ 55 /* io priority. */
diff --git a/include/linux/virtio_config.h b/include/linux/virtio_config.h
index 99f514575f6a..e547e3c8ee9a 100644
--- a/include/linux/virtio_config.h
+++ b/include/linux/virtio_config.h
@@ -79,8 +79,7 @@
79 * the dev->feature bits if it wants. 79 * the dev->feature bits if it wants.
80 */ 80 */
81typedef void vq_callback_t(struct virtqueue *); 81typedef void vq_callback_t(struct virtqueue *);
82struct virtio_config_ops 82struct virtio_config_ops {
83{
84 void (*get)(struct virtio_device *vdev, unsigned offset, 83 void (*get)(struct virtio_device *vdev, unsigned offset,
85 void *buf, unsigned len); 84 void *buf, unsigned len);
86 void (*set)(struct virtio_device *vdev, unsigned offset, 85 void (*set)(struct virtio_device *vdev, unsigned offset,
diff --git a/include/linux/virtio_net.h b/include/linux/virtio_net.h
index cec79adbe3ea..d8dd539c9f48 100644
--- a/include/linux/virtio_net.h
+++ b/include/linux/virtio_net.h
@@ -27,11 +27,11 @@
27#define VIRTIO_NET_F_CTRL_VQ 17 /* Control channel available */ 27#define VIRTIO_NET_F_CTRL_VQ 17 /* Control channel available */
28#define VIRTIO_NET_F_CTRL_RX 18 /* Control channel RX mode support */ 28#define VIRTIO_NET_F_CTRL_RX 18 /* Control channel RX mode support */
29#define VIRTIO_NET_F_CTRL_VLAN 19 /* Control channel VLAN filtering */ 29#define VIRTIO_NET_F_CTRL_VLAN 19 /* Control channel VLAN filtering */
30#define VIRTIO_NET_F_CTRL_RX_EXTRA 20 /* Extra RX mode control support */
30 31
31#define VIRTIO_NET_S_LINK_UP 1 /* Link is up */ 32#define VIRTIO_NET_S_LINK_UP 1 /* Link is up */
32 33
33struct virtio_net_config 34struct virtio_net_config {
34{
35 /* The config defining mac address (if VIRTIO_NET_F_MAC) */ 35 /* The config defining mac address (if VIRTIO_NET_F_MAC) */
36 __u8 mac[6]; 36 __u8 mac[6];
37 /* See VIRTIO_NET_F_STATUS and VIRTIO_NET_S_* above */ 37 /* See VIRTIO_NET_F_STATUS and VIRTIO_NET_S_* above */
@@ -40,8 +40,7 @@ struct virtio_net_config
40 40
41/* This is the first element of the scatter-gather list. If you don't 41/* This is the first element of the scatter-gather list. If you don't
42 * specify GSO or CSUM features, you can simply ignore the header. */ 42 * specify GSO or CSUM features, you can simply ignore the header. */
43struct virtio_net_hdr 43struct virtio_net_hdr {
44{
45#define VIRTIO_NET_HDR_F_NEEDS_CSUM 1 // Use csum_start, csum_offset 44#define VIRTIO_NET_HDR_F_NEEDS_CSUM 1 // Use csum_start, csum_offset
46 __u8 flags; 45 __u8 flags;
47#define VIRTIO_NET_HDR_GSO_NONE 0 // Not a GSO frame 46#define VIRTIO_NET_HDR_GSO_NONE 0 // Not a GSO frame
@@ -81,14 +80,19 @@ typedef __u8 virtio_net_ctrl_ack;
81#define VIRTIO_NET_ERR 1 80#define VIRTIO_NET_ERR 1
82 81
83/* 82/*
84 * Control the RX mode, ie. promisucous and allmulti. PROMISC and 83 * Control the RX mode, ie. promisucous, allmulti, etc...
85 * ALLMULTI commands require an "out" sg entry containing a 1 byte 84 * All commands require an "out" sg entry containing a 1 byte
86 * state value, zero = disable, non-zero = enable. These commands 85 * state value, zero = disable, non-zero = enable. Commands
87 * are supported with the VIRTIO_NET_F_CTRL_RX feature. 86 * 0 and 1 are supported with the VIRTIO_NET_F_CTRL_RX feature.
87 * Commands 2-5 are added with VIRTIO_NET_F_CTRL_RX_EXTRA.
88 */ 88 */
89#define VIRTIO_NET_CTRL_RX 0 89#define VIRTIO_NET_CTRL_RX 0
90 #define VIRTIO_NET_CTRL_RX_PROMISC 0 90 #define VIRTIO_NET_CTRL_RX_PROMISC 0
91 #define VIRTIO_NET_CTRL_RX_ALLMULTI 1 91 #define VIRTIO_NET_CTRL_RX_ALLMULTI 1
92 #define VIRTIO_NET_CTRL_RX_ALLUNI 2
93 #define VIRTIO_NET_CTRL_RX_NOMULTI 3
94 #define VIRTIO_NET_CTRL_RX_NOUNI 4
95 #define VIRTIO_NET_CTRL_RX_NOBCAST 5
92 96
93/* 97/*
94 * Control the MAC filter table. 98 * Control the MAC filter table.
diff --git a/include/linux/virtio_ring.h b/include/linux/virtio_ring.h
index 693e0ec5afa6..e4d144b132b5 100644
--- a/include/linux/virtio_ring.h
+++ b/include/linux/virtio_ring.h
@@ -30,8 +30,7 @@
30#define VIRTIO_RING_F_INDIRECT_DESC 28 30#define VIRTIO_RING_F_INDIRECT_DESC 28
31 31
32/* Virtio ring descriptors: 16 bytes. These can chain together via "next". */ 32/* Virtio ring descriptors: 16 bytes. These can chain together via "next". */
33struct vring_desc 33struct vring_desc {
34{
35 /* Address (guest-physical). */ 34 /* Address (guest-physical). */
36 __u64 addr; 35 __u64 addr;
37 /* Length. */ 36 /* Length. */
@@ -42,24 +41,21 @@ struct vring_desc
42 __u16 next; 41 __u16 next;
43}; 42};
44 43
45struct vring_avail 44struct vring_avail {
46{
47 __u16 flags; 45 __u16 flags;
48 __u16 idx; 46 __u16 idx;
49 __u16 ring[]; 47 __u16 ring[];
50}; 48};
51 49
52/* u32 is used here for ids for padding reasons. */ 50/* u32 is used here for ids for padding reasons. */
53struct vring_used_elem 51struct vring_used_elem {
54{
55 /* Index of start of used descriptor chain. */ 52 /* Index of start of used descriptor chain. */
56 __u32 id; 53 __u32 id;
57 /* Total length of the descriptor chain which was used (written to) */ 54 /* Total length of the descriptor chain which was used (written to) */
58 __u32 len; 55 __u32 len;
59}; 56};
60 57
61struct vring_used 58struct vring_used {
62{
63 __u16 flags; 59 __u16 flags;
64 __u16 idx; 60 __u16 idx;
65 struct vring_used_elem ring[]; 61 struct vring_used_elem ring[];
diff --git a/include/media/v4l2-chip-ident.h b/include/media/v4l2-chip-ident.h
index 4d7e2272c42f..94e908c0d7a0 100644
--- a/include/media/v4l2-chip-ident.h
+++ b/include/media/v4l2-chip-ident.h
@@ -60,6 +60,10 @@ enum {
60 V4L2_IDENT_OV7670 = 250, 60 V4L2_IDENT_OV7670 = 250,
61 V4L2_IDENT_OV7720 = 251, 61 V4L2_IDENT_OV7720 = 251,
62 V4L2_IDENT_OV7725 = 252, 62 V4L2_IDENT_OV7725 = 252,
63 V4L2_IDENT_OV7660 = 253,
64 V4L2_IDENT_OV9650 = 254,
65 V4L2_IDENT_OV9655 = 255,
66 V4L2_IDENT_SOI968 = 256,
63 67
64 /* module saa7146: reserved range 300-309 */ 68 /* module saa7146: reserved range 300-309 */
65 V4L2_IDENT_SAA7146 = 300, 69 V4L2_IDENT_SAA7146 = 300,
@@ -155,9 +159,15 @@ enum {
155 /* module cafe_ccic, just ident 8801 */ 159 /* module cafe_ccic, just ident 8801 */
156 V4L2_IDENT_CAFE = 8801, 160 V4L2_IDENT_CAFE = 8801,
157 161
162 /* module mt9v011, just ident 8243 */
163 V4L2_IDENT_MT9V011 = 8243,
164
158 /* module tw9910: just ident 9910 */ 165 /* module tw9910: just ident 9910 */
159 V4L2_IDENT_TW9910 = 9910, 166 V4L2_IDENT_TW9910 = 9910,
160 167
168 /* module sn9c20x: just ident 10000 */
169 V4L2_IDENT_SN9C20X = 10000,
170
161 /* module msp3400: reserved range 34000-34999 and 44000-44999 */ 171 /* module msp3400: reserved range 34000-34999 and 44000-44999 */
162 V4L2_IDENT_MSPX4XX = 34000, /* generic MSPX4XX identifier, only 172 V4L2_IDENT_MSPX4XX = 34000, /* generic MSPX4XX identifier, only
163 use internally (tveeprom.c). */ 173 use internally (tveeprom.c). */
@@ -234,6 +244,11 @@ enum {
234 V4L2_IDENT_MT9V022IX7ATC = 45010, /* No way to detect "normal" I77ATx */ 244 V4L2_IDENT_MT9V022IX7ATC = 45010, /* No way to detect "normal" I77ATx */
235 V4L2_IDENT_MT9V022IX7ATM = 45015, /* and "lead free" IA7ATx chips */ 245 V4L2_IDENT_MT9V022IX7ATM = 45015, /* and "lead free" IA7ATx chips */
236 V4L2_IDENT_MT9T031 = 45020, 246 V4L2_IDENT_MT9T031 = 45020,
247 V4L2_IDENT_MT9V111 = 45031,
248 V4L2_IDENT_MT9V112 = 45032,
249
250 /* HV7131R CMOS sensor: just ident 46000 */
251 V4L2_IDENT_HV7131R = 46000,
237 252
238 /* module cs53132a: just ident 53132 */ 253 /* module cs53132a: just ident 53132 */
239 V4L2_IDENT_CS53l32A = 53132, 254 V4L2_IDENT_CS53l32A = 53132,
diff --git a/include/trace/events/block.h b/include/trace/events/block.h
index d6b05f42dd44..9a74b468a229 100644
--- a/include/trace/events/block.h
+++ b/include/trace/events/block.h
@@ -1,3 +1,6 @@
1#undef TRACE_SYSTEM
2#define TRACE_SYSTEM block
3
1#if !defined(_TRACE_BLOCK_H) || defined(TRACE_HEADER_MULTI_READ) 4#if !defined(_TRACE_BLOCK_H) || defined(TRACE_HEADER_MULTI_READ)
2#define _TRACE_BLOCK_H 5#define _TRACE_BLOCK_H
3 6
@@ -5,9 +8,6 @@
5#include <linux/blkdev.h> 8#include <linux/blkdev.h>
6#include <linux/tracepoint.h> 9#include <linux/tracepoint.h>
7 10
8#undef TRACE_SYSTEM
9#define TRACE_SYSTEM block
10
11TRACE_EVENT(block_rq_abort, 11TRACE_EVENT(block_rq_abort,
12 12
13 TP_PROTO(struct request_queue *q, struct request *rq), 13 TP_PROTO(struct request_queue *q, struct request *rq),
diff --git a/include/trace/events/ext4.h b/include/trace/events/ext4.h
index acf4cc9cd36d..7d8b5bc74185 100644
--- a/include/trace/events/ext4.h
+++ b/include/trace/events/ext4.h
@@ -1,9 +1,9 @@
1#if !defined(_TRACE_EXT4_H) || defined(TRACE_HEADER_MULTI_READ)
2#define _TRACE_EXT4_H
3
4#undef TRACE_SYSTEM 1#undef TRACE_SYSTEM
5#define TRACE_SYSTEM ext4 2#define TRACE_SYSTEM ext4
6 3
4#if !defined(_TRACE_EXT4_H) || defined(TRACE_HEADER_MULTI_READ)
5#define _TRACE_EXT4_H
6
7#include <linux/writeback.h> 7#include <linux/writeback.h>
8#include "../../../fs/ext4/ext4.h" 8#include "../../../fs/ext4/ext4.h"
9#include "../../../fs/ext4/mballoc.h" 9#include "../../../fs/ext4/mballoc.h"
@@ -34,7 +34,8 @@ TRACE_EVENT(ext4_free_inode,
34 34
35 TP_printk("dev %s ino %lu mode %d uid %u gid %u blocks %llu", 35 TP_printk("dev %s ino %lu mode %d uid %u gid %u blocks %llu",
36 jbd2_dev_to_name(__entry->dev), __entry->ino, __entry->mode, 36 jbd2_dev_to_name(__entry->dev), __entry->ino, __entry->mode,
37 __entry->uid, __entry->gid, __entry->blocks) 37 __entry->uid, __entry->gid,
38 (unsigned long long) __entry->blocks)
38); 39);
39 40
40TRACE_EVENT(ext4_request_inode, 41TRACE_EVENT(ext4_request_inode,
@@ -189,7 +190,7 @@ TRACE_EVENT(ext4_journalled_write_end,
189 __entry->copied) 190 __entry->copied)
190); 191);
191 192
192TRACE_EVENT(ext4_da_writepage, 193TRACE_EVENT(ext4_writepage,
193 TP_PROTO(struct inode *inode, struct page *page), 194 TP_PROTO(struct inode *inode, struct page *page),
194 195
195 TP_ARGS(inode, page), 196 TP_ARGS(inode, page),
@@ -341,49 +342,6 @@ TRACE_EVENT(ext4_da_write_end,
341 __entry->copied) 342 __entry->copied)
342); 343);
343 344
344TRACE_EVENT(ext4_normal_writepage,
345 TP_PROTO(struct inode *inode, struct page *page),
346
347 TP_ARGS(inode, page),
348
349 TP_STRUCT__entry(
350 __field( dev_t, dev )
351 __field( ino_t, ino )
352 __field( pgoff_t, index )
353 ),
354
355 TP_fast_assign(
356 __entry->dev = inode->i_sb->s_dev;
357 __entry->ino = inode->i_ino;
358 __entry->index = page->index;
359 ),
360
361 TP_printk("dev %s ino %lu page_index %lu",
362 jbd2_dev_to_name(__entry->dev), __entry->ino, __entry->index)
363);
364
365TRACE_EVENT(ext4_journalled_writepage,
366 TP_PROTO(struct inode *inode, struct page *page),
367
368 TP_ARGS(inode, page),
369
370 TP_STRUCT__entry(
371 __field( dev_t, dev )
372 __field( ino_t, ino )
373 __field( pgoff_t, index )
374
375 ),
376
377 TP_fast_assign(
378 __entry->dev = inode->i_sb->s_dev;
379 __entry->ino = inode->i_ino;
380 __entry->index = page->index;
381 ),
382
383 TP_printk("dev %s ino %lu page_index %lu",
384 jbd2_dev_to_name(__entry->dev), __entry->ino, __entry->index)
385);
386
387TRACE_EVENT(ext4_discard_blocks, 345TRACE_EVENT(ext4_discard_blocks,
388 TP_PROTO(struct super_block *sb, unsigned long long blk, 346 TP_PROTO(struct super_block *sb, unsigned long long blk,
389 unsigned long long count), 347 unsigned long long count),
diff --git a/include/trace/events/irq.h b/include/trace/events/irq.h
index b0c7ede55eb1..1cb0c3aa11e6 100644
--- a/include/trace/events/irq.h
+++ b/include/trace/events/irq.h
@@ -1,12 +1,12 @@
1#undef TRACE_SYSTEM
2#define TRACE_SYSTEM irq
3
1#if !defined(_TRACE_IRQ_H) || defined(TRACE_HEADER_MULTI_READ) 4#if !defined(_TRACE_IRQ_H) || defined(TRACE_HEADER_MULTI_READ)
2#define _TRACE_IRQ_H 5#define _TRACE_IRQ_H
3 6
4#include <linux/tracepoint.h> 7#include <linux/tracepoint.h>
5#include <linux/interrupt.h> 8#include <linux/interrupt.h>
6 9
7#undef TRACE_SYSTEM
8#define TRACE_SYSTEM irq
9
10#define softirq_name(sirq) { sirq##_SOFTIRQ, #sirq } 10#define softirq_name(sirq) { sirq##_SOFTIRQ, #sirq }
11#define show_softirq_name(val) \ 11#define show_softirq_name(val) \
12 __print_symbolic(val, \ 12 __print_symbolic(val, \
diff --git a/include/trace/events/jbd2.h b/include/trace/events/jbd2.h
index 845b0b4b48fd..10813fa0c8d0 100644
--- a/include/trace/events/jbd2.h
+++ b/include/trace/events/jbd2.h
@@ -1,12 +1,12 @@
1#undef TRACE_SYSTEM
2#define TRACE_SYSTEM jbd2
3
1#if !defined(_TRACE_JBD2_H) || defined(TRACE_HEADER_MULTI_READ) 4#if !defined(_TRACE_JBD2_H) || defined(TRACE_HEADER_MULTI_READ)
2#define _TRACE_JBD2_H 5#define _TRACE_JBD2_H
3 6
4#include <linux/jbd2.h> 7#include <linux/jbd2.h>
5#include <linux/tracepoint.h> 8#include <linux/tracepoint.h>
6 9
7#undef TRACE_SYSTEM
8#define TRACE_SYSTEM jbd2
9
10TRACE_EVENT(jbd2_checkpoint, 10TRACE_EVENT(jbd2_checkpoint,
11 11
12 TP_PROTO(journal_t *journal, int result), 12 TP_PROTO(journal_t *journal, int result),
diff --git a/include/trace/events/kmem.h b/include/trace/events/kmem.h
index 9baba50d6512..1493c541f9c4 100644
--- a/include/trace/events/kmem.h
+++ b/include/trace/events/kmem.h
@@ -1,12 +1,12 @@
1#undef TRACE_SYSTEM
2#define TRACE_SYSTEM kmem
3
1#if !defined(_TRACE_KMEM_H) || defined(TRACE_HEADER_MULTI_READ) 4#if !defined(_TRACE_KMEM_H) || defined(TRACE_HEADER_MULTI_READ)
2#define _TRACE_KMEM_H 5#define _TRACE_KMEM_H
3 6
4#include <linux/types.h> 7#include <linux/types.h>
5#include <linux/tracepoint.h> 8#include <linux/tracepoint.h>
6 9
7#undef TRACE_SYSTEM
8#define TRACE_SYSTEM kmem
9
10/* 10/*
11 * The order of these masks is important. Matching masks will be seen 11 * The order of these masks is important. Matching masks will be seen
12 * first and the left over flags will end up showing by themselves. 12 * first and the left over flags will end up showing by themselves.
diff --git a/include/trace/events/lockdep.h b/include/trace/events/lockdep.h
index 0e956c9dfd7e..bcf1d209a00d 100644
--- a/include/trace/events/lockdep.h
+++ b/include/trace/events/lockdep.h
@@ -1,12 +1,12 @@
1#undef TRACE_SYSTEM
2#define TRACE_SYSTEM lockdep
3
1#if !defined(_TRACE_LOCKDEP_H) || defined(TRACE_HEADER_MULTI_READ) 4#if !defined(_TRACE_LOCKDEP_H) || defined(TRACE_HEADER_MULTI_READ)
2#define _TRACE_LOCKDEP_H 5#define _TRACE_LOCKDEP_H
3 6
4#include <linux/lockdep.h> 7#include <linux/lockdep.h>
5#include <linux/tracepoint.h> 8#include <linux/tracepoint.h>
6 9
7#undef TRACE_SYSTEM
8#define TRACE_SYSTEM lockdep
9
10#ifdef CONFIG_LOCKDEP 10#ifdef CONFIG_LOCKDEP
11 11
12TRACE_EVENT(lock_acquire, 12TRACE_EVENT(lock_acquire,
diff --git a/include/trace/events/sched.h b/include/trace/events/sched.h
index 24ab5bcff7b2..8949bb7eb082 100644
--- a/include/trace/events/sched.h
+++ b/include/trace/events/sched.h
@@ -1,12 +1,12 @@
1#undef TRACE_SYSTEM
2#define TRACE_SYSTEM sched
3
1#if !defined(_TRACE_SCHED_H) || defined(TRACE_HEADER_MULTI_READ) 4#if !defined(_TRACE_SCHED_H) || defined(TRACE_HEADER_MULTI_READ)
2#define _TRACE_SCHED_H 5#define _TRACE_SCHED_H
3 6
4#include <linux/sched.h> 7#include <linux/sched.h>
5#include <linux/tracepoint.h> 8#include <linux/tracepoint.h>
6 9
7#undef TRACE_SYSTEM
8#define TRACE_SYSTEM sched
9
10/* 10/*
11 * Tracepoint for calling kthread_stop, performed to end a kthread: 11 * Tracepoint for calling kthread_stop, performed to end a kthread:
12 */ 12 */
diff --git a/include/trace/events/skb.h b/include/trace/events/skb.h
index 1e8fabb57c06..e499863b9669 100644
--- a/include/trace/events/skb.h
+++ b/include/trace/events/skb.h
@@ -1,12 +1,12 @@
1#undef TRACE_SYSTEM
2#define TRACE_SYSTEM skb
3
1#if !defined(_TRACE_SKB_H) || defined(TRACE_HEADER_MULTI_READ) 4#if !defined(_TRACE_SKB_H) || defined(TRACE_HEADER_MULTI_READ)
2#define _TRACE_SKB_H 5#define _TRACE_SKB_H
3 6
4#include <linux/skbuff.h> 7#include <linux/skbuff.h>
5#include <linux/tracepoint.h> 8#include <linux/tracepoint.h>
6 9
7#undef TRACE_SYSTEM
8#define TRACE_SYSTEM skb
9
10/* 10/*
11 * Tracepoint for free an sk_buff: 11 * Tracepoint for free an sk_buff:
12 */ 12 */
diff --git a/include/trace/events/workqueue.h b/include/trace/events/workqueue.h
index 035f1bff288e..fcfd9a1e4b96 100644
--- a/include/trace/events/workqueue.h
+++ b/include/trace/events/workqueue.h
@@ -1,3 +1,6 @@
1#undef TRACE_SYSTEM
2#define TRACE_SYSTEM workqueue
3
1#if !defined(_TRACE_WORKQUEUE_H) || defined(TRACE_HEADER_MULTI_READ) 4#if !defined(_TRACE_WORKQUEUE_H) || defined(TRACE_HEADER_MULTI_READ)
2#define _TRACE_WORKQUEUE_H 5#define _TRACE_WORKQUEUE_H
3 6
@@ -5,9 +8,6 @@
5#include <linux/sched.h> 8#include <linux/sched.h>
6#include <linux/tracepoint.h> 9#include <linux/tracepoint.h>
7 10
8#undef TRACE_SYSTEM
9#define TRACE_SYSTEM workqueue
10
11TRACE_EVENT(workqueue_insertion, 11TRACE_EVENT(workqueue_insertion,
12 12
13 TP_PROTO(struct task_struct *wq_thread, struct work_struct *work), 13 TP_PROTO(struct task_struct *wq_thread, struct work_struct *work),
diff --git a/include/trace/ftrace.h b/include/trace/ftrace.h
index 1867553c61e5..7fb16d90e7b1 100644
--- a/include/trace/ftrace.h
+++ b/include/trace/ftrace.h
@@ -144,6 +144,9 @@
144#undef TP_fast_assign 144#undef TP_fast_assign
145#define TP_fast_assign(args...) args 145#define TP_fast_assign(args...) args
146 146
147#undef TP_perf_assign
148#define TP_perf_assign(args...)
149
147#undef TRACE_EVENT 150#undef TRACE_EVENT
148#define TRACE_EVENT(call, proto, args, tstruct, func, print) \ 151#define TRACE_EVENT(call, proto, args, tstruct, func, print) \
149static int \ 152static int \
@@ -345,6 +348,56 @@ static inline int ftrace_get_offsets_##call( \
345 348
346#include TRACE_INCLUDE(TRACE_INCLUDE_FILE) 349#include TRACE_INCLUDE(TRACE_INCLUDE_FILE)
347 350
351#ifdef CONFIG_EVENT_PROFILE
352
353/*
354 * Generate the functions needed for tracepoint perf_counter support.
355 *
356 * NOTE: The insertion profile callback (ftrace_profile_<call>) is defined later
357 *
358 * static int ftrace_profile_enable_<call>(struct ftrace_event_call *event_call)
359 * {
360 * int ret = 0;
361 *
362 * if (!atomic_inc_return(&event_call->profile_count))
363 * ret = register_trace_<call>(ftrace_profile_<call>);
364 *
365 * return ret;
366 * }
367 *
368 * static void ftrace_profile_disable_<call>(struct ftrace_event_call *event_call)
369 * {
370 * if (atomic_add_negative(-1, &event->call->profile_count))
371 * unregister_trace_<call>(ftrace_profile_<call>);
372 * }
373 *
374 */
375
376#undef TRACE_EVENT
377#define TRACE_EVENT(call, proto, args, tstruct, assign, print) \
378 \
379static void ftrace_profile_##call(proto); \
380 \
381static int ftrace_profile_enable_##call(struct ftrace_event_call *event_call) \
382{ \
383 int ret = 0; \
384 \
385 if (!atomic_inc_return(&event_call->profile_count)) \
386 ret = register_trace_##call(ftrace_profile_##call); \
387 \
388 return ret; \
389} \
390 \
391static void ftrace_profile_disable_##call(struct ftrace_event_call *event_call)\
392{ \
393 if (atomic_add_negative(-1, &event_call->profile_count)) \
394 unregister_trace_##call(ftrace_profile_##call); \
395}
396
397#include TRACE_INCLUDE(TRACE_INCLUDE_FILE)
398
399#endif
400
348/* 401/*
349 * Stage 4 of the trace events. 402 * Stage 4 of the trace events.
350 * 403 *
@@ -447,28 +500,6 @@ static inline int ftrace_get_offsets_##call( \
447#define TP_FMT(fmt, args...) fmt "\n", ##args 500#define TP_FMT(fmt, args...) fmt "\n", ##args
448 501
449#ifdef CONFIG_EVENT_PROFILE 502#ifdef CONFIG_EVENT_PROFILE
450#define _TRACE_PROFILE(call, proto, args) \
451static void ftrace_profile_##call(proto) \
452{ \
453 extern void perf_tpcounter_event(int); \
454 perf_tpcounter_event(event_##call.id); \
455} \
456 \
457static int ftrace_profile_enable_##call(struct ftrace_event_call *event_call) \
458{ \
459 int ret = 0; \
460 \
461 if (!atomic_inc_return(&event_call->profile_count)) \
462 ret = register_trace_##call(ftrace_profile_##call); \
463 \
464 return ret; \
465} \
466 \
467static void ftrace_profile_disable_##call(struct ftrace_event_call *event_call)\
468{ \
469 if (atomic_add_negative(-1, &event_call->profile_count)) \
470 unregister_trace_##call(ftrace_profile_##call); \
471}
472 503
473#define _TRACE_PROFILE_INIT(call) \ 504#define _TRACE_PROFILE_INIT(call) \
474 .profile_count = ATOMIC_INIT(-1), \ 505 .profile_count = ATOMIC_INIT(-1), \
@@ -476,7 +507,6 @@ static void ftrace_profile_disable_##call(struct ftrace_event_call *event_call)\
476 .profile_disable = ftrace_profile_disable_##call, 507 .profile_disable = ftrace_profile_disable_##call,
477 508
478#else 509#else
479#define _TRACE_PROFILE(call, proto, args)
480#define _TRACE_PROFILE_INIT(call) 510#define _TRACE_PROFILE_INIT(call)
481#endif 511#endif
482 512
@@ -502,7 +532,6 @@ static void ftrace_profile_disable_##call(struct ftrace_event_call *event_call)\
502 532
503#undef TRACE_EVENT 533#undef TRACE_EVENT
504#define TRACE_EVENT(call, proto, args, tstruct, assign, print) \ 534#define TRACE_EVENT(call, proto, args, tstruct, assign, print) \
505_TRACE_PROFILE(call, PARAMS(proto), PARAMS(args)) \
506 \ 535 \
507static struct ftrace_event_call event_##call; \ 536static struct ftrace_event_call event_##call; \
508 \ 537 \
@@ -586,6 +615,99 @@ __attribute__((section("_ftrace_events"))) event_##call = { \
586 615
587#include TRACE_INCLUDE(TRACE_INCLUDE_FILE) 616#include TRACE_INCLUDE(TRACE_INCLUDE_FILE)
588 617
589#undef _TRACE_PROFILE 618/*
619 * Define the insertion callback to profile events
620 *
621 * The job is very similar to ftrace_raw_event_<call> except that we don't
622 * insert in the ring buffer but in a perf counter.
623 *
624 * static void ftrace_profile_<call>(proto)
625 * {
626 * struct ftrace_data_offsets_<call> __maybe_unused __data_offsets;
627 * struct ftrace_event_call *event_call = &event_<call>;
628 * extern void perf_tpcounter_event(int, u64, u64, void *, int);
629 * struct ftrace_raw_##call *entry;
630 * u64 __addr = 0, __count = 1;
631 * unsigned long irq_flags;
632 * int __entry_size;
633 * int __data_size;
634 * int pc;
635 *
636 * local_save_flags(irq_flags);
637 * pc = preempt_count();
638 *
639 * __data_size = ftrace_get_offsets_<call>(&__data_offsets, args);
640 * __entry_size = __data_size + sizeof(*entry);
641 *
642 * do {
643 * char raw_data[__entry_size]; <- allocate our sample in the stack
644 * struct trace_entry *ent;
645 *
646 * entry = (struct ftrace_raw_<call> *)raw_data;
647 * ent = &entry->ent;
648 * tracing_generic_entry_update(ent, irq_flags, pc);
649 * ent->type = event_call->id;
650 *
651 * <tstruct> <- do some jobs with dynamic arrays
652 *
653 * <assign> <- affect our values
654 *
655 * perf_tpcounter_event(event_call->id, __addr, __count, entry,
656 * __entry_size); <- submit them to perf counter
657 * } while (0);
658 *
659 * }
660 */
661
662#ifdef CONFIG_EVENT_PROFILE
663
664#undef __perf_addr
665#define __perf_addr(a) __addr = (a)
666
667#undef __perf_count
668#define __perf_count(c) __count = (c)
669
670#undef TRACE_EVENT
671#define TRACE_EVENT(call, proto, args, tstruct, assign, print) \
672static void ftrace_profile_##call(proto) \
673{ \
674 struct ftrace_data_offsets_##call __maybe_unused __data_offsets;\
675 struct ftrace_event_call *event_call = &event_##call; \
676 extern void perf_tpcounter_event(int, u64, u64, void *, int); \
677 struct ftrace_raw_##call *entry; \
678 u64 __addr = 0, __count = 1; \
679 unsigned long irq_flags; \
680 int __entry_size; \
681 int __data_size; \
682 int pc; \
683 \
684 local_save_flags(irq_flags); \
685 pc = preempt_count(); \
686 \
687 __data_size = ftrace_get_offsets_##call(&__data_offsets, args); \
688 __entry_size = ALIGN(__data_size + sizeof(*entry), sizeof(u64));\
689 \
690 do { \
691 char raw_data[__entry_size]; \
692 struct trace_entry *ent; \
693 \
694 entry = (struct ftrace_raw_##call *)raw_data; \
695 ent = &entry->ent; \
696 tracing_generic_entry_update(ent, irq_flags, pc); \
697 ent->type = event_call->id; \
698 \
699 tstruct \
700 \
701 { assign; } \
702 \
703 perf_tpcounter_event(event_call->id, __addr, __count, entry,\
704 __entry_size); \
705 } while (0); \
706 \
707}
708
709#include TRACE_INCLUDE(TRACE_INCLUDE_FILE)
710#endif /* CONFIG_EVENT_PROFILE */
711
590#undef _TRACE_PROFILE_INIT 712#undef _TRACE_PROFILE_INIT
591 713
diff --git a/init/Kconfig b/init/Kconfig
index 1ce05a4cb5f6..3f7e60995c80 100644
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -940,6 +940,7 @@ menu "Performance Counters"
940 940
941config PERF_COUNTERS 941config PERF_COUNTERS
942 bool "Kernel Performance Counters" 942 bool "Kernel Performance Counters"
943 default y if PROFILING
943 depends on HAVE_PERF_COUNTERS 944 depends on HAVE_PERF_COUNTERS
944 select ANON_INODES 945 select ANON_INODES
945 help 946 help
@@ -961,9 +962,17 @@ config PERF_COUNTERS
961 Say Y if unsure. 962 Say Y if unsure.
962 963
963config EVENT_PROFILE 964config EVENT_PROFILE
964 bool "Tracepoint profile sources" 965 bool "Tracepoint profiling sources"
965 depends on PERF_COUNTERS && EVENT_TRACER 966 depends on PERF_COUNTERS && EVENT_TRACING
966 default y 967 default y
968 help
969 Allow the use of tracepoints as software performance counters.
970
971 When this is enabled, you can create perf counters based on
972 tracepoints using PERF_TYPE_TRACEPOINT and the tracepoint ID
973 found in debugfs://tracing/events/*/*/id. (The -e/--events
974 option to the perf tool can parse and interpret symbolic
975 tracepoints, in the subsystem:tracepoint_name format.)
967 976
968endmenu 977endmenu
969 978
diff --git a/ipc/mqueue.c b/ipc/mqueue.c
index e35ba2c3a8d7..c5e68adc6732 100644
--- a/ipc/mqueue.c
+++ b/ipc/mqueue.c
@@ -32,6 +32,7 @@
32#include <linux/nsproxy.h> 32#include <linux/nsproxy.h>
33#include <linux/pid.h> 33#include <linux/pid.h>
34#include <linux/ipc_namespace.h> 34#include <linux/ipc_namespace.h>
35#include <linux/ima.h>
35 36
36#include <net/sock.h> 37#include <net/sock.h>
37#include "util.h" 38#include "util.h"
@@ -733,6 +734,7 @@ SYSCALL_DEFINE4(mq_open, const char __user *, u_name, int, oflag, mode_t, mode,
733 error = PTR_ERR(filp); 734 error = PTR_ERR(filp);
734 goto out_putfd; 735 goto out_putfd;
735 } 736 }
737 ima_counts_get(filp);
736 738
737 fd_install(fd, filp); 739 fd_install(fd, filp);
738 goto out_upsem; 740 goto out_upsem;
diff --git a/kernel/Makefile b/kernel/Makefile
index 780c8dcf4516..2093a691f1c2 100644
--- a/kernel/Makefile
+++ b/kernel/Makefile
@@ -96,6 +96,7 @@ obj-$(CONFIG_HAVE_GENERIC_DMA_COHERENT) += dma-coherent.o
96obj-$(CONFIG_FUNCTION_TRACER) += trace/ 96obj-$(CONFIG_FUNCTION_TRACER) += trace/
97obj-$(CONFIG_TRACING) += trace/ 97obj-$(CONFIG_TRACING) += trace/
98obj-$(CONFIG_X86_DS) += trace/ 98obj-$(CONFIG_X86_DS) += trace/
99obj-$(CONFIG_RING_BUFFER) += trace/
99obj-$(CONFIG_SMP) += sched_cpupri.o 100obj-$(CONFIG_SMP) += sched_cpupri.o
100obj-$(CONFIG_SLOW_WORK) += slow-work.o 101obj-$(CONFIG_SLOW_WORK) += slow-work.o
101obj-$(CONFIG_PERF_COUNTERS) += perf_counter.o 102obj-$(CONFIG_PERF_COUNTERS) += perf_counter.o
diff --git a/kernel/acct.c b/kernel/acct.c
index 7afa31564162..9f3391090b3e 100644
--- a/kernel/acct.c
+++ b/kernel/acct.c
@@ -215,6 +215,7 @@ static void acct_file_reopen(struct bsd_acct_struct *acct, struct file *file,
215static int acct_on(char *name) 215static int acct_on(char *name)
216{ 216{
217 struct file *file; 217 struct file *file;
218 struct vfsmount *mnt;
218 int error; 219 int error;
219 struct pid_namespace *ns; 220 struct pid_namespace *ns;
220 struct bsd_acct_struct *acct = NULL; 221 struct bsd_acct_struct *acct = NULL;
@@ -256,11 +257,12 @@ static int acct_on(char *name)
256 acct = NULL; 257 acct = NULL;
257 } 258 }
258 259
259 mnt_pin(file->f_path.mnt); 260 mnt = file->f_path.mnt;
261 mnt_pin(mnt);
260 acct_file_reopen(ns->bacct, file, ns); 262 acct_file_reopen(ns->bacct, file, ns);
261 spin_unlock(&acct_lock); 263 spin_unlock(&acct_lock);
262 264
263 mntput(file->f_path.mnt); /* it's pinned, now give up active reference */ 265 mntput(mnt); /* it's pinned, now give up active reference */
264 kfree(acct); 266 kfree(acct);
265 267
266 return 0; 268 return 0;
diff --git a/kernel/cgroup.c b/kernel/cgroup.c
index 3737a682cdf5..b6eadfe30e7b 100644
--- a/kernel/cgroup.c
+++ b/kernel/cgroup.c
@@ -47,6 +47,7 @@
47#include <linux/hash.h> 47#include <linux/hash.h>
48#include <linux/namei.h> 48#include <linux/namei.h>
49#include <linux/smp_lock.h> 49#include <linux/smp_lock.h>
50#include <linux/pid_namespace.h>
50 51
51#include <asm/atomic.h> 52#include <asm/atomic.h>
52 53
@@ -734,16 +735,28 @@ static void cgroup_d_remove_dir(struct dentry *dentry)
734 * reference to css->refcnt. In general, this refcnt is expected to goes down 735 * reference to css->refcnt. In general, this refcnt is expected to goes down
735 * to zero, soon. 736 * to zero, soon.
736 * 737 *
737 * CGRP_WAIT_ON_RMDIR flag is modified under cgroup's inode->i_mutex; 738 * CGRP_WAIT_ON_RMDIR flag is set under cgroup's inode->i_mutex;
738 */ 739 */
739DECLARE_WAIT_QUEUE_HEAD(cgroup_rmdir_waitq); 740DECLARE_WAIT_QUEUE_HEAD(cgroup_rmdir_waitq);
740 741
741static void cgroup_wakeup_rmdir_waiters(const struct cgroup *cgrp) 742static void cgroup_wakeup_rmdir_waiter(struct cgroup *cgrp)
742{ 743{
743 if (unlikely(test_bit(CGRP_WAIT_ON_RMDIR, &cgrp->flags))) 744 if (unlikely(test_and_clear_bit(CGRP_WAIT_ON_RMDIR, &cgrp->flags)))
744 wake_up_all(&cgroup_rmdir_waitq); 745 wake_up_all(&cgroup_rmdir_waitq);
745} 746}
746 747
748void cgroup_exclude_rmdir(struct cgroup_subsys_state *css)
749{
750 css_get(css);
751}
752
753void cgroup_release_and_wakeup_rmdir(struct cgroup_subsys_state *css)
754{
755 cgroup_wakeup_rmdir_waiter(css->cgroup);
756 css_put(css);
757}
758
759
747static int rebind_subsystems(struct cgroupfs_root *root, 760static int rebind_subsystems(struct cgroupfs_root *root,
748 unsigned long final_bits) 761 unsigned long final_bits)
749{ 762{
@@ -960,6 +973,7 @@ static void init_cgroup_housekeeping(struct cgroup *cgrp)
960 INIT_LIST_HEAD(&cgrp->children); 973 INIT_LIST_HEAD(&cgrp->children);
961 INIT_LIST_HEAD(&cgrp->css_sets); 974 INIT_LIST_HEAD(&cgrp->css_sets);
962 INIT_LIST_HEAD(&cgrp->release_list); 975 INIT_LIST_HEAD(&cgrp->release_list);
976 INIT_LIST_HEAD(&cgrp->pids_list);
963 init_rwsem(&cgrp->pids_mutex); 977 init_rwsem(&cgrp->pids_mutex);
964} 978}
965static void init_cgroup_root(struct cgroupfs_root *root) 979static void init_cgroup_root(struct cgroupfs_root *root)
@@ -1357,7 +1371,7 @@ int cgroup_attach_task(struct cgroup *cgrp, struct task_struct *tsk)
1357 * wake up rmdir() waiter. the rmdir should fail since the cgroup 1371 * wake up rmdir() waiter. the rmdir should fail since the cgroup
1358 * is no longer empty. 1372 * is no longer empty.
1359 */ 1373 */
1360 cgroup_wakeup_rmdir_waiters(cgrp); 1374 cgroup_wakeup_rmdir_waiter(cgrp);
1361 return 0; 1375 return 0;
1362} 1376}
1363 1377
@@ -2201,12 +2215,30 @@ err:
2201 return ret; 2215 return ret;
2202} 2216}
2203 2217
2218/*
2219 * Cache pids for all threads in the same pid namespace that are
2220 * opening the same "tasks" file.
2221 */
2222struct cgroup_pids {
2223 /* The node in cgrp->pids_list */
2224 struct list_head list;
2225 /* The cgroup those pids belong to */
2226 struct cgroup *cgrp;
2227 /* The namepsace those pids belong to */
2228 struct pid_namespace *ns;
2229 /* Array of process ids in the cgroup */
2230 pid_t *tasks_pids;
2231 /* How many files are using the this tasks_pids array */
2232 int use_count;
2233 /* Length of the current tasks_pids array */
2234 int length;
2235};
2236
2204static int cmppid(const void *a, const void *b) 2237static int cmppid(const void *a, const void *b)
2205{ 2238{
2206 return *(pid_t *)a - *(pid_t *)b; 2239 return *(pid_t *)a - *(pid_t *)b;
2207} 2240}
2208 2241
2209
2210/* 2242/*
2211 * seq_file methods for the "tasks" file. The seq_file position is the 2243 * seq_file methods for the "tasks" file. The seq_file position is the
2212 * next pid to display; the seq_file iterator is a pointer to the pid 2244 * next pid to display; the seq_file iterator is a pointer to the pid
@@ -2221,45 +2253,47 @@ static void *cgroup_tasks_start(struct seq_file *s, loff_t *pos)
2221 * after a seek to the start). Use a binary-search to find the 2253 * after a seek to the start). Use a binary-search to find the
2222 * next pid to display, if any 2254 * next pid to display, if any
2223 */ 2255 */
2224 struct cgroup *cgrp = s->private; 2256 struct cgroup_pids *cp = s->private;
2257 struct cgroup *cgrp = cp->cgrp;
2225 int index = 0, pid = *pos; 2258 int index = 0, pid = *pos;
2226 int *iter; 2259 int *iter;
2227 2260
2228 down_read(&cgrp->pids_mutex); 2261 down_read(&cgrp->pids_mutex);
2229 if (pid) { 2262 if (pid) {
2230 int end = cgrp->pids_length; 2263 int end = cp->length;
2231 2264
2232 while (index < end) { 2265 while (index < end) {
2233 int mid = (index + end) / 2; 2266 int mid = (index + end) / 2;
2234 if (cgrp->tasks_pids[mid] == pid) { 2267 if (cp->tasks_pids[mid] == pid) {
2235 index = mid; 2268 index = mid;
2236 break; 2269 break;
2237 } else if (cgrp->tasks_pids[mid] <= pid) 2270 } else if (cp->tasks_pids[mid] <= pid)
2238 index = mid + 1; 2271 index = mid + 1;
2239 else 2272 else
2240 end = mid; 2273 end = mid;
2241 } 2274 }
2242 } 2275 }
2243 /* If we're off the end of the array, we're done */ 2276 /* If we're off the end of the array, we're done */
2244 if (index >= cgrp->pids_length) 2277 if (index >= cp->length)
2245 return NULL; 2278 return NULL;
2246 /* Update the abstract position to be the actual pid that we found */ 2279 /* Update the abstract position to be the actual pid that we found */
2247 iter = cgrp->tasks_pids + index; 2280 iter = cp->tasks_pids + index;
2248 *pos = *iter; 2281 *pos = *iter;
2249 return iter; 2282 return iter;
2250} 2283}
2251 2284
2252static void cgroup_tasks_stop(struct seq_file *s, void *v) 2285static void cgroup_tasks_stop(struct seq_file *s, void *v)
2253{ 2286{
2254 struct cgroup *cgrp = s->private; 2287 struct cgroup_pids *cp = s->private;
2288 struct cgroup *cgrp = cp->cgrp;
2255 up_read(&cgrp->pids_mutex); 2289 up_read(&cgrp->pids_mutex);
2256} 2290}
2257 2291
2258static void *cgroup_tasks_next(struct seq_file *s, void *v, loff_t *pos) 2292static void *cgroup_tasks_next(struct seq_file *s, void *v, loff_t *pos)
2259{ 2293{
2260 struct cgroup *cgrp = s->private; 2294 struct cgroup_pids *cp = s->private;
2261 int *p = v; 2295 int *p = v;
2262 int *end = cgrp->tasks_pids + cgrp->pids_length; 2296 int *end = cp->tasks_pids + cp->length;
2263 2297
2264 /* 2298 /*
2265 * Advance to the next pid in the array. If this goes off the 2299 * Advance to the next pid in the array. If this goes off the
@@ -2286,26 +2320,33 @@ static struct seq_operations cgroup_tasks_seq_operations = {
2286 .show = cgroup_tasks_show, 2320 .show = cgroup_tasks_show,
2287}; 2321};
2288 2322
2289static void release_cgroup_pid_array(struct cgroup *cgrp) 2323static void release_cgroup_pid_array(struct cgroup_pids *cp)
2290{ 2324{
2325 struct cgroup *cgrp = cp->cgrp;
2326
2291 down_write(&cgrp->pids_mutex); 2327 down_write(&cgrp->pids_mutex);
2292 BUG_ON(!cgrp->pids_use_count); 2328 BUG_ON(!cp->use_count);
2293 if (!--cgrp->pids_use_count) { 2329 if (!--cp->use_count) {
2294 kfree(cgrp->tasks_pids); 2330 list_del(&cp->list);
2295 cgrp->tasks_pids = NULL; 2331 put_pid_ns(cp->ns);
2296 cgrp->pids_length = 0; 2332 kfree(cp->tasks_pids);
2333 kfree(cp);
2297 } 2334 }
2298 up_write(&cgrp->pids_mutex); 2335 up_write(&cgrp->pids_mutex);
2299} 2336}
2300 2337
2301static int cgroup_tasks_release(struct inode *inode, struct file *file) 2338static int cgroup_tasks_release(struct inode *inode, struct file *file)
2302{ 2339{
2303 struct cgroup *cgrp = __d_cgrp(file->f_dentry->d_parent); 2340 struct seq_file *seq;
2341 struct cgroup_pids *cp;
2304 2342
2305 if (!(file->f_mode & FMODE_READ)) 2343 if (!(file->f_mode & FMODE_READ))
2306 return 0; 2344 return 0;
2307 2345
2308 release_cgroup_pid_array(cgrp); 2346 seq = file->private_data;
2347 cp = seq->private;
2348
2349 release_cgroup_pid_array(cp);
2309 return seq_release(inode, file); 2350 return seq_release(inode, file);
2310} 2351}
2311 2352
@@ -2324,6 +2365,8 @@ static struct file_operations cgroup_tasks_operations = {
2324static int cgroup_tasks_open(struct inode *unused, struct file *file) 2365static int cgroup_tasks_open(struct inode *unused, struct file *file)
2325{ 2366{
2326 struct cgroup *cgrp = __d_cgrp(file->f_dentry->d_parent); 2367 struct cgroup *cgrp = __d_cgrp(file->f_dentry->d_parent);
2368 struct pid_namespace *ns = current->nsproxy->pid_ns;
2369 struct cgroup_pids *cp;
2327 pid_t *pidarray; 2370 pid_t *pidarray;
2328 int npids; 2371 int npids;
2329 int retval; 2372 int retval;
@@ -2350,20 +2393,37 @@ static int cgroup_tasks_open(struct inode *unused, struct file *file)
2350 * array if necessary 2393 * array if necessary
2351 */ 2394 */
2352 down_write(&cgrp->pids_mutex); 2395 down_write(&cgrp->pids_mutex);
2353 kfree(cgrp->tasks_pids); 2396
2354 cgrp->tasks_pids = pidarray; 2397 list_for_each_entry(cp, &cgrp->pids_list, list) {
2355 cgrp->pids_length = npids; 2398 if (ns == cp->ns)
2356 cgrp->pids_use_count++; 2399 goto found;
2400 }
2401
2402 cp = kzalloc(sizeof(*cp), GFP_KERNEL);
2403 if (!cp) {
2404 up_write(&cgrp->pids_mutex);
2405 kfree(pidarray);
2406 return -ENOMEM;
2407 }
2408 cp->cgrp = cgrp;
2409 cp->ns = ns;
2410 get_pid_ns(ns);
2411 list_add(&cp->list, &cgrp->pids_list);
2412found:
2413 kfree(cp->tasks_pids);
2414 cp->tasks_pids = pidarray;
2415 cp->length = npids;
2416 cp->use_count++;
2357 up_write(&cgrp->pids_mutex); 2417 up_write(&cgrp->pids_mutex);
2358 2418
2359 file->f_op = &cgroup_tasks_operations; 2419 file->f_op = &cgroup_tasks_operations;
2360 2420
2361 retval = seq_open(file, &cgroup_tasks_seq_operations); 2421 retval = seq_open(file, &cgroup_tasks_seq_operations);
2362 if (retval) { 2422 if (retval) {
2363 release_cgroup_pid_array(cgrp); 2423 release_cgroup_pid_array(cp);
2364 return retval; 2424 return retval;
2365 } 2425 }
2366 ((struct seq_file *)file->private_data)->private = cgrp; 2426 ((struct seq_file *)file->private_data)->private = cp;
2367 return 0; 2427 return 0;
2368} 2428}
2369 2429
@@ -2696,33 +2756,42 @@ again:
2696 mutex_unlock(&cgroup_mutex); 2756 mutex_unlock(&cgroup_mutex);
2697 2757
2698 /* 2758 /*
2759 * In general, subsystem has no css->refcnt after pre_destroy(). But
2760 * in racy cases, subsystem may have to get css->refcnt after
2761 * pre_destroy() and it makes rmdir return with -EBUSY. This sometimes
2762 * make rmdir return -EBUSY too often. To avoid that, we use waitqueue
2763 * for cgroup's rmdir. CGRP_WAIT_ON_RMDIR is for synchronizing rmdir
2764 * and subsystem's reference count handling. Please see css_get/put
2765 * and css_tryget() and cgroup_wakeup_rmdir_waiter() implementation.
2766 */
2767 set_bit(CGRP_WAIT_ON_RMDIR, &cgrp->flags);
2768
2769 /*
2699 * Call pre_destroy handlers of subsys. Notify subsystems 2770 * Call pre_destroy handlers of subsys. Notify subsystems
2700 * that rmdir() request comes. 2771 * that rmdir() request comes.
2701 */ 2772 */
2702 ret = cgroup_call_pre_destroy(cgrp); 2773 ret = cgroup_call_pre_destroy(cgrp);
2703 if (ret) 2774 if (ret) {
2775 clear_bit(CGRP_WAIT_ON_RMDIR, &cgrp->flags);
2704 return ret; 2776 return ret;
2777 }
2705 2778
2706 mutex_lock(&cgroup_mutex); 2779 mutex_lock(&cgroup_mutex);
2707 parent = cgrp->parent; 2780 parent = cgrp->parent;
2708 if (atomic_read(&cgrp->count) || !list_empty(&cgrp->children)) { 2781 if (atomic_read(&cgrp->count) || !list_empty(&cgrp->children)) {
2782 clear_bit(CGRP_WAIT_ON_RMDIR, &cgrp->flags);
2709 mutex_unlock(&cgroup_mutex); 2783 mutex_unlock(&cgroup_mutex);
2710 return -EBUSY; 2784 return -EBUSY;
2711 } 2785 }
2712 /*
2713 * css_put/get is provided for subsys to grab refcnt to css. In typical
2714 * case, subsystem has no reference after pre_destroy(). But, under
2715 * hierarchy management, some *temporal* refcnt can be hold.
2716 * To avoid returning -EBUSY to a user, waitqueue is used. If subsys
2717 * is really busy, it should return -EBUSY at pre_destroy(). wake_up
2718 * is called when css_put() is called and refcnt goes down to 0.
2719 */
2720 set_bit(CGRP_WAIT_ON_RMDIR, &cgrp->flags);
2721 prepare_to_wait(&cgroup_rmdir_waitq, &wait, TASK_INTERRUPTIBLE); 2786 prepare_to_wait(&cgroup_rmdir_waitq, &wait, TASK_INTERRUPTIBLE);
2722
2723 if (!cgroup_clear_css_refs(cgrp)) { 2787 if (!cgroup_clear_css_refs(cgrp)) {
2724 mutex_unlock(&cgroup_mutex); 2788 mutex_unlock(&cgroup_mutex);
2725 schedule(); 2789 /*
2790 * Because someone may call cgroup_wakeup_rmdir_waiter() before
2791 * prepare_to_wait(), we need to check this flag.
2792 */
2793 if (test_bit(CGRP_WAIT_ON_RMDIR, &cgrp->flags))
2794 schedule();
2726 finish_wait(&cgroup_rmdir_waitq, &wait); 2795 finish_wait(&cgroup_rmdir_waitq, &wait);
2727 clear_bit(CGRP_WAIT_ON_RMDIR, &cgrp->flags); 2796 clear_bit(CGRP_WAIT_ON_RMDIR, &cgrp->flags);
2728 if (signal_pending(current)) 2797 if (signal_pending(current))
@@ -3294,7 +3363,7 @@ void __css_put(struct cgroup_subsys_state *css)
3294 set_bit(CGRP_RELEASABLE, &cgrp->flags); 3363 set_bit(CGRP_RELEASABLE, &cgrp->flags);
3295 check_for_release(cgrp); 3364 check_for_release(cgrp);
3296 } 3365 }
3297 cgroup_wakeup_rmdir_waiters(cgrp); 3366 cgroup_wakeup_rmdir_waiter(cgrp);
3298 } 3367 }
3299 rcu_read_unlock(); 3368 rcu_read_unlock();
3300} 3369}
diff --git a/kernel/exit.c b/kernel/exit.c
index 628d41f0dd54..869dc221733e 100644
--- a/kernel/exit.c
+++ b/kernel/exit.c
@@ -12,7 +12,6 @@
12#include <linux/completion.h> 12#include <linux/completion.h>
13#include <linux/personality.h> 13#include <linux/personality.h>
14#include <linux/tty.h> 14#include <linux/tty.h>
15#include <linux/mnt_namespace.h>
16#include <linux/iocontext.h> 15#include <linux/iocontext.h>
17#include <linux/key.h> 16#include <linux/key.h>
18#include <linux/security.h> 17#include <linux/security.h>
diff --git a/kernel/fork.c b/kernel/fork.c
index 467746b3f0aa..021e1138556e 100644
--- a/kernel/fork.c
+++ b/kernel/fork.c
@@ -17,7 +17,6 @@
17#include <linux/module.h> 17#include <linux/module.h>
18#include <linux/vmalloc.h> 18#include <linux/vmalloc.h>
19#include <linux/completion.h> 19#include <linux/completion.h>
20#include <linux/mnt_namespace.h>
21#include <linux/personality.h> 20#include <linux/personality.h>
22#include <linux/mempolicy.h> 21#include <linux/mempolicy.h>
23#include <linux/sem.h> 22#include <linux/sem.h>
@@ -427,6 +426,7 @@ static struct mm_struct * mm_init(struct mm_struct * mm, struct task_struct *p)
427 init_rwsem(&mm->mmap_sem); 426 init_rwsem(&mm->mmap_sem);
428 INIT_LIST_HEAD(&mm->mmlist); 427 INIT_LIST_HEAD(&mm->mmlist);
429 mm->flags = (current->mm) ? current->mm->flags : default_dump_filter; 428 mm->flags = (current->mm) ? current->mm->flags : default_dump_filter;
429 mm->oom_adj = (current->mm) ? current->mm->oom_adj : 0;
430 mm->core_state = NULL; 430 mm->core_state = NULL;
431 mm->nr_ptes = 0; 431 mm->nr_ptes = 0;
432 set_mm_counter(mm, file_rss, 0); 432 set_mm_counter(mm, file_rss, 0);
@@ -568,18 +568,18 @@ void mm_release(struct task_struct *tsk, struct mm_struct *mm)
568 * the value intact in a core dump, and to save the unnecessary 568 * the value intact in a core dump, and to save the unnecessary
569 * trouble otherwise. Userland only wants this done for a sys_exit. 569 * trouble otherwise. Userland only wants this done for a sys_exit.
570 */ 570 */
571 if (tsk->clear_child_tid 571 if (tsk->clear_child_tid) {
572 && !(tsk->flags & PF_SIGNALED) 572 if (!(tsk->flags & PF_SIGNALED) &&
573 && atomic_read(&mm->mm_users) > 1) { 573 atomic_read(&mm->mm_users) > 1) {
574 u32 __user * tidptr = tsk->clear_child_tid; 574 /*
575 * We don't check the error code - if userspace has
576 * not set up a proper pointer then tough luck.
577 */
578 put_user(0, tsk->clear_child_tid);
579 sys_futex(tsk->clear_child_tid, FUTEX_WAKE,
580 1, NULL, NULL, 0);
581 }
575 tsk->clear_child_tid = NULL; 582 tsk->clear_child_tid = NULL;
576
577 /*
578 * We don't check the error code - if userspace has
579 * not set up a proper pointer then tough luck.
580 */
581 put_user(0, tidptr);
582 sys_futex(tidptr, FUTEX_WAKE, 1, NULL, NULL, 0);
583 } 583 }
584} 584}
585 585
@@ -1269,6 +1269,7 @@ static struct task_struct *copy_process(unsigned long clone_flags,
1269 write_unlock_irq(&tasklist_lock); 1269 write_unlock_irq(&tasklist_lock);
1270 proc_fork_connector(p); 1270 proc_fork_connector(p);
1271 cgroup_post_fork(p); 1271 cgroup_post_fork(p);
1272 perf_counter_fork(p);
1272 return p; 1273 return p;
1273 1274
1274bad_fork_free_pid: 1275bad_fork_free_pid:
@@ -1408,12 +1409,6 @@ long do_fork(unsigned long clone_flags,
1408 if (clone_flags & CLONE_VFORK) { 1409 if (clone_flags & CLONE_VFORK) {
1409 p->vfork_done = &vfork; 1410 p->vfork_done = &vfork;
1410 init_completion(&vfork); 1411 init_completion(&vfork);
1411 } else if (!(clone_flags & CLONE_VM)) {
1412 /*
1413 * vfork will do an exec which will call
1414 * set_task_comm()
1415 */
1416 perf_counter_fork(p);
1417 } 1412 }
1418 1413
1419 audit_finish_fork(p); 1414 audit_finish_fork(p);
diff --git a/kernel/freezer.c b/kernel/freezer.c
index 2f4936cf7083..bd1d42b17cb2 100644
--- a/kernel/freezer.c
+++ b/kernel/freezer.c
@@ -44,12 +44,19 @@ void refrigerator(void)
44 recalc_sigpending(); /* We sent fake signal, clean it up */ 44 recalc_sigpending(); /* We sent fake signal, clean it up */
45 spin_unlock_irq(&current->sighand->siglock); 45 spin_unlock_irq(&current->sighand->siglock);
46 46
47 /* prevent accounting of that task to load */
48 current->flags |= PF_FREEZING;
49
47 for (;;) { 50 for (;;) {
48 set_current_state(TASK_UNINTERRUPTIBLE); 51 set_current_state(TASK_UNINTERRUPTIBLE);
49 if (!frozen(current)) 52 if (!frozen(current))
50 break; 53 break;
51 schedule(); 54 schedule();
52 } 55 }
56
57 /* Remove the accounting blocker */
58 current->flags &= ~PF_FREEZING;
59
53 pr_debug("%s left refrigerator\n", current->comm); 60 pr_debug("%s left refrigerator\n", current->comm);
54 __set_current_state(save); 61 __set_current_state(save);
55} 62}
diff --git a/kernel/futex.c b/kernel/futex.c
index 1c337112335c..0672ff88f159 100644
--- a/kernel/futex.c
+++ b/kernel/futex.c
@@ -247,6 +247,7 @@ again:
247 if (err < 0) 247 if (err < 0)
248 return err; 248 return err;
249 249
250 page = compound_head(page);
250 lock_page(page); 251 lock_page(page);
251 if (!page->mapping) { 252 if (!page->mapping) {
252 unlock_page(page); 253 unlock_page(page);
@@ -299,7 +300,7 @@ void put_futex_key(int fshared, union futex_key *key)
299static int fault_in_user_writeable(u32 __user *uaddr) 300static int fault_in_user_writeable(u32 __user *uaddr)
300{ 301{
301 int ret = get_user_pages(current, current->mm, (unsigned long)uaddr, 302 int ret = get_user_pages(current, current->mm, (unsigned long)uaddr,
302 sizeof(*uaddr), 1, 0, NULL, NULL); 303 1, 1, 0, NULL, NULL);
303 return ret < 0 ? ret : 0; 304 return ret < 0 ? ret : 0;
304} 305}
305 306
diff --git a/kernel/hrtimer.c b/kernel/hrtimer.c
index 9002958a96e7..49da79ab8486 100644
--- a/kernel/hrtimer.c
+++ b/kernel/hrtimer.c
@@ -191,6 +191,46 @@ struct hrtimer_clock_base *lock_hrtimer_base(const struct hrtimer *timer,
191 } 191 }
192} 192}
193 193
194
195/*
196 * Get the preferred target CPU for NOHZ
197 */
198static int hrtimer_get_target(int this_cpu, int pinned)
199{
200#ifdef CONFIG_NO_HZ
201 if (!pinned && get_sysctl_timer_migration() && idle_cpu(this_cpu)) {
202 int preferred_cpu = get_nohz_load_balancer();
203
204 if (preferred_cpu >= 0)
205 return preferred_cpu;
206 }
207#endif
208 return this_cpu;
209}
210
211/*
212 * With HIGHRES=y we do not migrate the timer when it is expiring
213 * before the next event on the target cpu because we cannot reprogram
214 * the target cpu hardware and we would cause it to fire late.
215 *
216 * Called with cpu_base->lock of target cpu held.
217 */
218static int
219hrtimer_check_target(struct hrtimer *timer, struct hrtimer_clock_base *new_base)
220{
221#ifdef CONFIG_HIGH_RES_TIMERS
222 ktime_t expires;
223
224 if (!new_base->cpu_base->hres_active)
225 return 0;
226
227 expires = ktime_sub(hrtimer_get_expires(timer), new_base->offset);
228 return expires.tv64 <= new_base->cpu_base->expires_next.tv64;
229#else
230 return 0;
231#endif
232}
233
194/* 234/*
195 * Switch the timer base to the current CPU when possible. 235 * Switch the timer base to the current CPU when possible.
196 */ 236 */
@@ -200,16 +240,8 @@ switch_hrtimer_base(struct hrtimer *timer, struct hrtimer_clock_base *base,
200{ 240{
201 struct hrtimer_clock_base *new_base; 241 struct hrtimer_clock_base *new_base;
202 struct hrtimer_cpu_base *new_cpu_base; 242 struct hrtimer_cpu_base *new_cpu_base;
203 int cpu, preferred_cpu = -1; 243 int this_cpu = smp_processor_id();
204 244 int cpu = hrtimer_get_target(this_cpu, pinned);
205 cpu = smp_processor_id();
206#if defined(CONFIG_NO_HZ) && defined(CONFIG_SMP)
207 if (!pinned && get_sysctl_timer_migration() && idle_cpu(cpu)) {
208 preferred_cpu = get_nohz_load_balancer();
209 if (preferred_cpu >= 0)
210 cpu = preferred_cpu;
211 }
212#endif
213 245
214again: 246again:
215 new_cpu_base = &per_cpu(hrtimer_bases, cpu); 247 new_cpu_base = &per_cpu(hrtimer_bases, cpu);
@@ -217,7 +249,7 @@ again:
217 249
218 if (base != new_base) { 250 if (base != new_base) {
219 /* 251 /*
220 * We are trying to schedule the timer on the local CPU. 252 * We are trying to move timer to new_base.
221 * However we can't change timer's base while it is running, 253 * However we can't change timer's base while it is running,
222 * so we keep it on the same CPU. No hassle vs. reprogramming 254 * so we keep it on the same CPU. No hassle vs. reprogramming
223 * the event source in the high resolution case. The softirq 255 * the event source in the high resolution case. The softirq
@@ -233,38 +265,12 @@ again:
233 spin_unlock(&base->cpu_base->lock); 265 spin_unlock(&base->cpu_base->lock);
234 spin_lock(&new_base->cpu_base->lock); 266 spin_lock(&new_base->cpu_base->lock);
235 267
236 /* Optimized away for NOHZ=n SMP=n */ 268 if (cpu != this_cpu && hrtimer_check_target(timer, new_base)) {
237 if (cpu == preferred_cpu) { 269 cpu = this_cpu;
238 /* Calculate clock monotonic expiry time */ 270 spin_unlock(&new_base->cpu_base->lock);
239#ifdef CONFIG_HIGH_RES_TIMERS 271 spin_lock(&base->cpu_base->lock);
240 ktime_t expires = ktime_sub(hrtimer_get_expires(timer), 272 timer->base = base;
241 new_base->offset); 273 goto again;
242#else
243 ktime_t expires = hrtimer_get_expires(timer);
244#endif
245
246 /*
247 * Get the next event on target cpu from the
248 * clock events layer.
249 * This covers the highres=off nohz=on case as well.
250 */
251 ktime_t next = clockevents_get_next_event(cpu);
252
253 ktime_t delta = ktime_sub(expires, next);
254
255 /*
256 * We do not migrate the timer when it is expiring
257 * before the next event on the target cpu because
258 * we cannot reprogram the target cpu hardware and
259 * we would cause it to fire late.
260 */
261 if (delta.tv64 < 0) {
262 cpu = smp_processor_id();
263 spin_unlock(&new_base->cpu_base->lock);
264 spin_lock(&base->cpu_base->lock);
265 timer->base = base;
266 goto again;
267 }
268 } 274 }
269 timer->base = new_base; 275 timer->base = new_base;
270 } 276 }
@@ -1276,14 +1282,22 @@ void hrtimer_interrupt(struct clock_event_device *dev)
1276 1282
1277 expires_next.tv64 = KTIME_MAX; 1283 expires_next.tv64 = KTIME_MAX;
1278 1284
1285 spin_lock(&cpu_base->lock);
1286 /*
1287 * We set expires_next to KTIME_MAX here with cpu_base->lock
1288 * held to prevent that a timer is enqueued in our queue via
1289 * the migration code. This does not affect enqueueing of
1290 * timers which run their callback and need to be requeued on
1291 * this CPU.
1292 */
1293 cpu_base->expires_next.tv64 = KTIME_MAX;
1294
1279 base = cpu_base->clock_base; 1295 base = cpu_base->clock_base;
1280 1296
1281 for (i = 0; i < HRTIMER_MAX_CLOCK_BASES; i++) { 1297 for (i = 0; i < HRTIMER_MAX_CLOCK_BASES; i++) {
1282 ktime_t basenow; 1298 ktime_t basenow;
1283 struct rb_node *node; 1299 struct rb_node *node;
1284 1300
1285 spin_lock(&cpu_base->lock);
1286
1287 basenow = ktime_add(now, base->offset); 1301 basenow = ktime_add(now, base->offset);
1288 1302
1289 while ((node = base->first)) { 1303 while ((node = base->first)) {
@@ -1316,11 +1330,15 @@ void hrtimer_interrupt(struct clock_event_device *dev)
1316 1330
1317 __run_hrtimer(timer); 1331 __run_hrtimer(timer);
1318 } 1332 }
1319 spin_unlock(&cpu_base->lock);
1320 base++; 1333 base++;
1321 } 1334 }
1322 1335
1336 /*
1337 * Store the new expiry value so the migration code can verify
1338 * against it.
1339 */
1323 cpu_base->expires_next = expires_next; 1340 cpu_base->expires_next = expires_next;
1341 spin_unlock(&cpu_base->lock);
1324 1342
1325 /* Reprogramming necessary ? */ 1343 /* Reprogramming necessary ? */
1326 if (expires_next.tv64 != KTIME_MAX) { 1344 if (expires_next.tv64 != KTIME_MAX) {
diff --git a/kernel/irq/internals.h b/kernel/irq/internals.h
index 73468253143b..e70ed5592eb9 100644
--- a/kernel/irq/internals.h
+++ b/kernel/irq/internals.h
@@ -42,8 +42,7 @@ static inline void unregister_handler_proc(unsigned int irq,
42 42
43extern int irq_select_affinity_usr(unsigned int irq); 43extern int irq_select_affinity_usr(unsigned int irq);
44 44
45extern void 45extern void irq_set_thread_affinity(struct irq_desc *desc);
46irq_set_thread_affinity(struct irq_desc *desc, const struct cpumask *cpumask);
47 46
48/* 47/*
49 * Debugging printout: 48 * Debugging printout:
diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c
index 50da67672901..61c679db4687 100644
--- a/kernel/irq/manage.c
+++ b/kernel/irq/manage.c
@@ -80,14 +80,22 @@ int irq_can_set_affinity(unsigned int irq)
80 return 1; 80 return 1;
81} 81}
82 82
83void 83/**
84irq_set_thread_affinity(struct irq_desc *desc, const struct cpumask *cpumask) 84 * irq_set_thread_affinity - Notify irq threads to adjust affinity
85 * @desc: irq descriptor which has affitnity changed
86 *
87 * We just set IRQTF_AFFINITY and delegate the affinity setting
88 * to the interrupt thread itself. We can not call
89 * set_cpus_allowed_ptr() here as we hold desc->lock and this
90 * code can be called from hard interrupt context.
91 */
92void irq_set_thread_affinity(struct irq_desc *desc)
85{ 93{
86 struct irqaction *action = desc->action; 94 struct irqaction *action = desc->action;
87 95
88 while (action) { 96 while (action) {
89 if (action->thread) 97 if (action->thread)
90 set_cpus_allowed_ptr(action->thread, cpumask); 98 set_bit(IRQTF_AFFINITY, &action->thread_flags);
91 action = action->next; 99 action = action->next;
92 } 100 }
93} 101}
@@ -112,7 +120,7 @@ int irq_set_affinity(unsigned int irq, const struct cpumask *cpumask)
112 if (desc->status & IRQ_MOVE_PCNTXT) { 120 if (desc->status & IRQ_MOVE_PCNTXT) {
113 if (!desc->chip->set_affinity(irq, cpumask)) { 121 if (!desc->chip->set_affinity(irq, cpumask)) {
114 cpumask_copy(desc->affinity, cpumask); 122 cpumask_copy(desc->affinity, cpumask);
115 irq_set_thread_affinity(desc, cpumask); 123 irq_set_thread_affinity(desc);
116 } 124 }
117 } 125 }
118 else { 126 else {
@@ -122,7 +130,7 @@ int irq_set_affinity(unsigned int irq, const struct cpumask *cpumask)
122#else 130#else
123 if (!desc->chip->set_affinity(irq, cpumask)) { 131 if (!desc->chip->set_affinity(irq, cpumask)) {
124 cpumask_copy(desc->affinity, cpumask); 132 cpumask_copy(desc->affinity, cpumask);
125 irq_set_thread_affinity(desc, cpumask); 133 irq_set_thread_affinity(desc);
126 } 134 }
127#endif 135#endif
128 desc->status |= IRQ_AFFINITY_SET; 136 desc->status |= IRQ_AFFINITY_SET;
@@ -176,7 +184,7 @@ int irq_select_affinity_usr(unsigned int irq)
176 spin_lock_irqsave(&desc->lock, flags); 184 spin_lock_irqsave(&desc->lock, flags);
177 ret = setup_affinity(irq, desc); 185 ret = setup_affinity(irq, desc);
178 if (!ret) 186 if (!ret)
179 irq_set_thread_affinity(desc, desc->affinity); 187 irq_set_thread_affinity(desc);
180 spin_unlock_irqrestore(&desc->lock, flags); 188 spin_unlock_irqrestore(&desc->lock, flags);
181 189
182 return ret; 190 return ret;
@@ -443,6 +451,39 @@ static int irq_wait_for_interrupt(struct irqaction *action)
443 return -1; 451 return -1;
444} 452}
445 453
454#ifdef CONFIG_SMP
455/*
456 * Check whether we need to change the affinity of the interrupt thread.
457 */
458static void
459irq_thread_check_affinity(struct irq_desc *desc, struct irqaction *action)
460{
461 cpumask_var_t mask;
462
463 if (!test_and_clear_bit(IRQTF_AFFINITY, &action->thread_flags))
464 return;
465
466 /*
467 * In case we are out of memory we set IRQTF_AFFINITY again and
468 * try again next time
469 */
470 if (!alloc_cpumask_var(&mask, GFP_KERNEL)) {
471 set_bit(IRQTF_AFFINITY, &action->thread_flags);
472 return;
473 }
474
475 spin_lock_irq(&desc->lock);
476 cpumask_copy(mask, desc->affinity);
477 spin_unlock_irq(&desc->lock);
478
479 set_cpus_allowed_ptr(current, mask);
480 free_cpumask_var(mask);
481}
482#else
483static inline void
484irq_thread_check_affinity(struct irq_desc *desc, struct irqaction *action) { }
485#endif
486
446/* 487/*
447 * Interrupt handler thread 488 * Interrupt handler thread
448 */ 489 */
@@ -458,6 +499,8 @@ static int irq_thread(void *data)
458 499
459 while (!irq_wait_for_interrupt(action)) { 500 while (!irq_wait_for_interrupt(action)) {
460 501
502 irq_thread_check_affinity(desc, action);
503
461 atomic_inc(&desc->threads_active); 504 atomic_inc(&desc->threads_active);
462 505
463 spin_lock_irq(&desc->lock); 506 spin_lock_irq(&desc->lock);
diff --git a/kernel/irq/migration.c b/kernel/irq/migration.c
index cfe767ca1545..fcb6c96f2627 100644
--- a/kernel/irq/migration.c
+++ b/kernel/irq/migration.c
@@ -45,7 +45,7 @@ void move_masked_irq(int irq)
45 < nr_cpu_ids)) 45 < nr_cpu_ids))
46 if (!desc->chip->set_affinity(irq, desc->pending_mask)) { 46 if (!desc->chip->set_affinity(irq, desc->pending_mask)) {
47 cpumask_copy(desc->affinity, desc->pending_mask); 47 cpumask_copy(desc->affinity, desc->pending_mask);
48 irq_set_thread_affinity(desc, desc->pending_mask); 48 irq_set_thread_affinity(desc);
49 } 49 }
50 50
51 cpumask_clear(desc->pending_mask); 51 cpumask_clear(desc->pending_mask);
diff --git a/kernel/kexec.c b/kernel/kexec.c
index ae1c35201cc8..f336e2107f98 100644
--- a/kernel/kexec.c
+++ b/kernel/kexec.c
@@ -1228,7 +1228,7 @@ static int __init parse_crashkernel_mem(char *cmdline,
1228 } while (*cur++ == ','); 1228 } while (*cur++ == ',');
1229 1229
1230 if (*crash_size > 0) { 1230 if (*crash_size > 0) {
1231 while (*cur != ' ' && *cur != '@') 1231 while (*cur && *cur != ' ' && *cur != '@')
1232 cur++; 1232 cur++;
1233 if (*cur == '@') { 1233 if (*cur == '@') {
1234 cur++; 1234 cur++;
diff --git a/kernel/kmod.c b/kernel/kmod.c
index 7e95bedb2bfc..385c31a1bdbf 100644
--- a/kernel/kmod.c
+++ b/kernel/kmod.c
@@ -24,7 +24,6 @@
24#include <linux/unistd.h> 24#include <linux/unistd.h>
25#include <linux/kmod.h> 25#include <linux/kmod.h>
26#include <linux/slab.h> 26#include <linux/slab.h>
27#include <linux/mnt_namespace.h>
28#include <linux/completion.h> 27#include <linux/completion.h>
29#include <linux/file.h> 28#include <linux/file.h>
30#include <linux/fdtable.h> 29#include <linux/fdtable.h>
diff --git a/kernel/kprobes.c b/kernel/kprobes.c
index c0fa54b276d9..0540948e29ab 100644
--- a/kernel/kprobes.c
+++ b/kernel/kprobes.c
@@ -237,13 +237,9 @@ static int __kprobes collect_garbage_slots(void)
237{ 237{
238 struct kprobe_insn_page *kip; 238 struct kprobe_insn_page *kip;
239 struct hlist_node *pos, *next; 239 struct hlist_node *pos, *next;
240 int safety;
241 240
242 /* Ensure no-one is preepmted on the garbages */ 241 /* Ensure no-one is preepmted on the garbages */
243 mutex_unlock(&kprobe_insn_mutex); 242 if (check_safety())
244 safety = check_safety();
245 mutex_lock(&kprobe_insn_mutex);
246 if (safety != 0)
247 return -EAGAIN; 243 return -EAGAIN;
248 244
249 hlist_for_each_entry_safe(kip, pos, next, &kprobe_insn_pages, hlist) { 245 hlist_for_each_entry_safe(kip, pos, next, &kprobe_insn_pages, hlist) {
@@ -698,7 +694,7 @@ int __kprobes register_kprobe(struct kprobe *p)
698 p->addr = addr; 694 p->addr = addr;
699 695
700 preempt_disable(); 696 preempt_disable();
701 if (!__kernel_text_address((unsigned long) p->addr) || 697 if (!kernel_text_address((unsigned long) p->addr) ||
702 in_kprobes_functions((unsigned long) p->addr)) { 698 in_kprobes_functions((unsigned long) p->addr)) {
703 preempt_enable(); 699 preempt_enable();
704 return -EINVAL; 700 return -EINVAL;
diff --git a/kernel/kthread.c b/kernel/kthread.c
index 9b1a7de26979..eb8751aa0418 100644
--- a/kernel/kthread.c
+++ b/kernel/kthread.c
@@ -180,10 +180,12 @@ EXPORT_SYMBOL(kthread_bind);
180 * @k: thread created by kthread_create(). 180 * @k: thread created by kthread_create().
181 * 181 *
182 * Sets kthread_should_stop() for @k to return true, wakes it, and 182 * Sets kthread_should_stop() for @k to return true, wakes it, and
183 * waits for it to exit. Your threadfn() must not call do_exit() 183 * waits for it to exit. This can also be called after kthread_create()
184 * itself if you use this function! This can also be called after 184 * instead of calling wake_up_process(): the thread will exit without
185 * kthread_create() instead of calling wake_up_process(): the thread 185 * calling threadfn().
186 * will exit without calling threadfn(). 186 *
187 * If threadfn() may call do_exit() itself, the caller must ensure
188 * task_struct can't go away.
187 * 189 *
188 * Returns the result of threadfn(), or %-EINTR if wake_up_process() 190 * Returns the result of threadfn(), or %-EINTR if wake_up_process()
189 * was never called. 191 * was never called.
diff --git a/kernel/lockdep_proc.c b/kernel/lockdep_proc.c
index d7135aa2d2c4..e94caa666dba 100644
--- a/kernel/lockdep_proc.c
+++ b/kernel/lockdep_proc.c
@@ -758,7 +758,8 @@ static int __init lockdep_proc_init(void)
758 &proc_lockdep_stats_operations); 758 &proc_lockdep_stats_operations);
759 759
760#ifdef CONFIG_LOCK_STAT 760#ifdef CONFIG_LOCK_STAT
761 proc_create("lock_stat", S_IRUSR, NULL, &proc_lock_stat_operations); 761 proc_create("lock_stat", S_IRUSR | S_IWUSR, NULL,
762 &proc_lock_stat_operations);
762#endif 763#endif
763 764
764 return 0; 765 return 0;
diff --git a/kernel/module.c b/kernel/module.c
index 38928fcaff2b..fd1411403558 100644
--- a/kernel/module.c
+++ b/kernel/module.c
@@ -1068,7 +1068,8 @@ static inline int check_modstruct_version(Elf_Shdr *sechdrs,
1068{ 1068{
1069 const unsigned long *crc; 1069 const unsigned long *crc;
1070 1070
1071 if (!find_symbol("module_layout", NULL, &crc, true, false)) 1071 if (!find_symbol(MODULE_SYMBOL_PREFIX "module_layout", NULL,
1072 &crc, true, false))
1072 BUG(); 1073 BUG();
1073 return check_version(sechdrs, versindex, "module_layout", mod, crc); 1074 return check_version(sechdrs, versindex, "module_layout", mod, crc);
1074} 1075}
@@ -2451,9 +2452,9 @@ SYSCALL_DEFINE3(init_module, void __user *, umod,
2451 return ret; 2452 return ret;
2452 } 2453 }
2453 if (ret > 0) { 2454 if (ret > 0) {
2454 printk(KERN_WARNING "%s: '%s'->init suspiciously returned %d, " 2455 printk(KERN_WARNING
2455 "it should follow 0/-E convention\n" 2456"%s: '%s'->init suspiciously returned %d, it should follow 0/-E convention\n"
2456 KERN_WARNING "%s: loading module anyway...\n", 2457"%s: loading module anyway...\n",
2457 __func__, mod->name, ret, 2458 __func__, mod->name, ret,
2458 __func__); 2459 __func__);
2459 dump_stack(); 2460 dump_stack();
diff --git a/kernel/panic.c b/kernel/panic.c
index 984b3ecbd72c..512ab73b0ca3 100644
--- a/kernel/panic.c
+++ b/kernel/panic.c
@@ -301,6 +301,7 @@ int oops_may_print(void)
301 */ 301 */
302void oops_enter(void) 302void oops_enter(void)
303{ 303{
304 tracing_off();
304 /* can't trust the integrity of the kernel anymore: */ 305 /* can't trust the integrity of the kernel anymore: */
305 debug_locks_off(); 306 debug_locks_off();
306 do_oops_enter_exit(); 307 do_oops_enter_exit();
diff --git a/kernel/perf_counter.c b/kernel/perf_counter.c
index 1a933a221ea4..868102172aa4 100644
--- a/kernel/perf_counter.c
+++ b/kernel/perf_counter.c
@@ -42,6 +42,7 @@ static int perf_overcommit __read_mostly = 1;
42static atomic_t nr_counters __read_mostly; 42static atomic_t nr_counters __read_mostly;
43static atomic_t nr_mmap_counters __read_mostly; 43static atomic_t nr_mmap_counters __read_mostly;
44static atomic_t nr_comm_counters __read_mostly; 44static atomic_t nr_comm_counters __read_mostly;
45static atomic_t nr_task_counters __read_mostly;
45 46
46/* 47/*
47 * perf counter paranoia level: 48 * perf counter paranoia level:
@@ -146,6 +147,28 @@ static void put_ctx(struct perf_counter_context *ctx)
146 } 147 }
147} 148}
148 149
150static void unclone_ctx(struct perf_counter_context *ctx)
151{
152 if (ctx->parent_ctx) {
153 put_ctx(ctx->parent_ctx);
154 ctx->parent_ctx = NULL;
155 }
156}
157
158/*
159 * If we inherit counters we want to return the parent counter id
160 * to userspace.
161 */
162static u64 primary_counter_id(struct perf_counter *counter)
163{
164 u64 id = counter->id;
165
166 if (counter->parent)
167 id = counter->parent->id;
168
169 return id;
170}
171
149/* 172/*
150 * Get the perf_counter_context for a task and lock it. 173 * Get the perf_counter_context for a task and lock it.
151 * This has to cope with with the fact that until it is locked, 174 * This has to cope with with the fact that until it is locked,
@@ -236,6 +259,8 @@ list_add_counter(struct perf_counter *counter, struct perf_counter_context *ctx)
236 259
237 list_add_rcu(&counter->event_entry, &ctx->event_list); 260 list_add_rcu(&counter->event_entry, &ctx->event_list);
238 ctx->nr_counters++; 261 ctx->nr_counters++;
262 if (counter->attr.inherit_stat)
263 ctx->nr_stat++;
239} 264}
240 265
241/* 266/*
@@ -250,6 +275,8 @@ list_del_counter(struct perf_counter *counter, struct perf_counter_context *ctx)
250 if (list_empty(&counter->list_entry)) 275 if (list_empty(&counter->list_entry))
251 return; 276 return;
252 ctx->nr_counters--; 277 ctx->nr_counters--;
278 if (counter->attr.inherit_stat)
279 ctx->nr_stat--;
253 280
254 list_del_init(&counter->list_entry); 281 list_del_init(&counter->list_entry);
255 list_del_rcu(&counter->event_entry); 282 list_del_rcu(&counter->event_entry);
@@ -1006,6 +1033,81 @@ static int context_equiv(struct perf_counter_context *ctx1,
1006 && !ctx1->pin_count && !ctx2->pin_count; 1033 && !ctx1->pin_count && !ctx2->pin_count;
1007} 1034}
1008 1035
1036static void __perf_counter_read(void *counter);
1037
1038static void __perf_counter_sync_stat(struct perf_counter *counter,
1039 struct perf_counter *next_counter)
1040{
1041 u64 value;
1042
1043 if (!counter->attr.inherit_stat)
1044 return;
1045
1046 /*
1047 * Update the counter value, we cannot use perf_counter_read()
1048 * because we're in the middle of a context switch and have IRQs
1049 * disabled, which upsets smp_call_function_single(), however
1050 * we know the counter must be on the current CPU, therefore we
1051 * don't need to use it.
1052 */
1053 switch (counter->state) {
1054 case PERF_COUNTER_STATE_ACTIVE:
1055 __perf_counter_read(counter);
1056 break;
1057
1058 case PERF_COUNTER_STATE_INACTIVE:
1059 update_counter_times(counter);
1060 break;
1061
1062 default:
1063 break;
1064 }
1065
1066 /*
1067 * In order to keep per-task stats reliable we need to flip the counter
1068 * values when we flip the contexts.
1069 */
1070 value = atomic64_read(&next_counter->count);
1071 value = atomic64_xchg(&counter->count, value);
1072 atomic64_set(&next_counter->count, value);
1073
1074 swap(counter->total_time_enabled, next_counter->total_time_enabled);
1075 swap(counter->total_time_running, next_counter->total_time_running);
1076
1077 /*
1078 * Since we swizzled the values, update the user visible data too.
1079 */
1080 perf_counter_update_userpage(counter);
1081 perf_counter_update_userpage(next_counter);
1082}
1083
1084#define list_next_entry(pos, member) \
1085 list_entry(pos->member.next, typeof(*pos), member)
1086
1087static void perf_counter_sync_stat(struct perf_counter_context *ctx,
1088 struct perf_counter_context *next_ctx)
1089{
1090 struct perf_counter *counter, *next_counter;
1091
1092 if (!ctx->nr_stat)
1093 return;
1094
1095 counter = list_first_entry(&ctx->event_list,
1096 struct perf_counter, event_entry);
1097
1098 next_counter = list_first_entry(&next_ctx->event_list,
1099 struct perf_counter, event_entry);
1100
1101 while (&counter->event_entry != &ctx->event_list &&
1102 &next_counter->event_entry != &next_ctx->event_list) {
1103
1104 __perf_counter_sync_stat(counter, next_counter);
1105
1106 counter = list_next_entry(counter, event_entry);
1107 next_counter = list_next_entry(next_counter, event_entry);
1108 }
1109}
1110
1009/* 1111/*
1010 * Called from scheduler to remove the counters of the current task, 1112 * Called from scheduler to remove the counters of the current task,
1011 * with interrupts disabled. 1113 * with interrupts disabled.
@@ -1061,6 +1163,8 @@ void perf_counter_task_sched_out(struct task_struct *task,
1061 ctx->task = next; 1163 ctx->task = next;
1062 next_ctx->task = task; 1164 next_ctx->task = task;
1063 do_switch = 0; 1165 do_switch = 0;
1166
1167 perf_counter_sync_stat(ctx, next_ctx);
1064 } 1168 }
1065 spin_unlock(&next_ctx->lock); 1169 spin_unlock(&next_ctx->lock);
1066 spin_unlock(&ctx->lock); 1170 spin_unlock(&ctx->lock);
@@ -1207,7 +1311,6 @@ static void perf_counter_cpu_sched_in(struct perf_cpu_context *cpuctx, int cpu)
1207#define MAX_INTERRUPTS (~0ULL) 1311#define MAX_INTERRUPTS (~0ULL)
1208 1312
1209static void perf_log_throttle(struct perf_counter *counter, int enable); 1313static void perf_log_throttle(struct perf_counter *counter, int enable);
1210static void perf_log_period(struct perf_counter *counter, u64 period);
1211 1314
1212static void perf_adjust_period(struct perf_counter *counter, u64 events) 1315static void perf_adjust_period(struct perf_counter *counter, u64 events)
1213{ 1316{
@@ -1226,8 +1329,6 @@ static void perf_adjust_period(struct perf_counter *counter, u64 events)
1226 if (!sample_period) 1329 if (!sample_period)
1227 sample_period = 1; 1330 sample_period = 1;
1228 1331
1229 perf_log_period(counter, sample_period);
1230
1231 hwc->sample_period = sample_period; 1332 hwc->sample_period = sample_period;
1232} 1333}
1233 1334
@@ -1348,9 +1449,54 @@ void perf_counter_task_tick(struct task_struct *curr, int cpu)
1348} 1449}
1349 1450
1350/* 1451/*
1452 * Enable all of a task's counters that have been marked enable-on-exec.
1453 * This expects task == current.
1454 */
1455static void perf_counter_enable_on_exec(struct task_struct *task)
1456{
1457 struct perf_counter_context *ctx;
1458 struct perf_counter *counter;
1459 unsigned long flags;
1460 int enabled = 0;
1461
1462 local_irq_save(flags);
1463 ctx = task->perf_counter_ctxp;
1464 if (!ctx || !ctx->nr_counters)
1465 goto out;
1466
1467 __perf_counter_task_sched_out(ctx);
1468
1469 spin_lock(&ctx->lock);
1470
1471 list_for_each_entry(counter, &ctx->counter_list, list_entry) {
1472 if (!counter->attr.enable_on_exec)
1473 continue;
1474 counter->attr.enable_on_exec = 0;
1475 if (counter->state >= PERF_COUNTER_STATE_INACTIVE)
1476 continue;
1477 counter->state = PERF_COUNTER_STATE_INACTIVE;
1478 counter->tstamp_enabled =
1479 ctx->time - counter->total_time_enabled;
1480 enabled = 1;
1481 }
1482
1483 /*
1484 * Unclone this context if we enabled any counter.
1485 */
1486 if (enabled)
1487 unclone_ctx(ctx);
1488
1489 spin_unlock(&ctx->lock);
1490
1491 perf_counter_task_sched_in(task, smp_processor_id());
1492 out:
1493 local_irq_restore(flags);
1494}
1495
1496/*
1351 * Cross CPU call to read the hardware counter 1497 * Cross CPU call to read the hardware counter
1352 */ 1498 */
1353static void __read(void *info) 1499static void __perf_counter_read(void *info)
1354{ 1500{
1355 struct perf_counter *counter = info; 1501 struct perf_counter *counter = info;
1356 struct perf_counter_context *ctx = counter->ctx; 1502 struct perf_counter_context *ctx = counter->ctx;
@@ -1372,7 +1518,7 @@ static u64 perf_counter_read(struct perf_counter *counter)
1372 */ 1518 */
1373 if (counter->state == PERF_COUNTER_STATE_ACTIVE) { 1519 if (counter->state == PERF_COUNTER_STATE_ACTIVE) {
1374 smp_call_function_single(counter->oncpu, 1520 smp_call_function_single(counter->oncpu,
1375 __read, counter, 1); 1521 __perf_counter_read, counter, 1);
1376 } else if (counter->state == PERF_COUNTER_STATE_INACTIVE) { 1522 } else if (counter->state == PERF_COUNTER_STATE_INACTIVE) {
1377 update_counter_times(counter); 1523 update_counter_times(counter);
1378 } 1524 }
@@ -1398,7 +1544,6 @@ __perf_counter_init_context(struct perf_counter_context *ctx,
1398 1544
1399static struct perf_counter_context *find_get_context(pid_t pid, int cpu) 1545static struct perf_counter_context *find_get_context(pid_t pid, int cpu)
1400{ 1546{
1401 struct perf_counter_context *parent_ctx;
1402 struct perf_counter_context *ctx; 1547 struct perf_counter_context *ctx;
1403 struct perf_cpu_context *cpuctx; 1548 struct perf_cpu_context *cpuctx;
1404 struct task_struct *task; 1549 struct task_struct *task;
@@ -1458,11 +1603,7 @@ static struct perf_counter_context *find_get_context(pid_t pid, int cpu)
1458 retry: 1603 retry:
1459 ctx = perf_lock_task_context(task, &flags); 1604 ctx = perf_lock_task_context(task, &flags);
1460 if (ctx) { 1605 if (ctx) {
1461 parent_ctx = ctx->parent_ctx; 1606 unclone_ctx(ctx);
1462 if (parent_ctx) {
1463 put_ctx(parent_ctx);
1464 ctx->parent_ctx = NULL; /* no longer a clone */
1465 }
1466 spin_unlock_irqrestore(&ctx->lock, flags); 1607 spin_unlock_irqrestore(&ctx->lock, flags);
1467 } 1608 }
1468 1609
@@ -1508,11 +1649,15 @@ static void free_counter(struct perf_counter *counter)
1508{ 1649{
1509 perf_pending_sync(counter); 1650 perf_pending_sync(counter);
1510 1651
1511 atomic_dec(&nr_counters); 1652 if (!counter->parent) {
1512 if (counter->attr.mmap) 1653 atomic_dec(&nr_counters);
1513 atomic_dec(&nr_mmap_counters); 1654 if (counter->attr.mmap)
1514 if (counter->attr.comm) 1655 atomic_dec(&nr_mmap_counters);
1515 atomic_dec(&nr_comm_counters); 1656 if (counter->attr.comm)
1657 atomic_dec(&nr_comm_counters);
1658 if (counter->attr.task)
1659 atomic_dec(&nr_task_counters);
1660 }
1516 1661
1517 if (counter->destroy) 1662 if (counter->destroy)
1518 counter->destroy(counter); 1663 counter->destroy(counter);
@@ -1546,6 +1691,18 @@ static int perf_release(struct inode *inode, struct file *file)
1546 return 0; 1691 return 0;
1547} 1692}
1548 1693
1694static u64 perf_counter_read_tree(struct perf_counter *counter)
1695{
1696 struct perf_counter *child;
1697 u64 total = 0;
1698
1699 total += perf_counter_read(counter);
1700 list_for_each_entry(child, &counter->child_list, child_list)
1701 total += perf_counter_read(child);
1702
1703 return total;
1704}
1705
1549/* 1706/*
1550 * Read the performance counter - simple non blocking version for now 1707 * Read the performance counter - simple non blocking version for now
1551 */ 1708 */
@@ -1565,7 +1722,7 @@ perf_read_hw(struct perf_counter *counter, char __user *buf, size_t count)
1565 1722
1566 WARN_ON_ONCE(counter->ctx->parent_ctx); 1723 WARN_ON_ONCE(counter->ctx->parent_ctx);
1567 mutex_lock(&counter->child_mutex); 1724 mutex_lock(&counter->child_mutex);
1568 values[0] = perf_counter_read(counter); 1725 values[0] = perf_counter_read_tree(counter);
1569 n = 1; 1726 n = 1;
1570 if (counter->attr.read_format & PERF_FORMAT_TOTAL_TIME_ENABLED) 1727 if (counter->attr.read_format & PERF_FORMAT_TOTAL_TIME_ENABLED)
1571 values[n++] = counter->total_time_enabled + 1728 values[n++] = counter->total_time_enabled +
@@ -1574,7 +1731,7 @@ perf_read_hw(struct perf_counter *counter, char __user *buf, size_t count)
1574 values[n++] = counter->total_time_running + 1731 values[n++] = counter->total_time_running +
1575 atomic64_read(&counter->child_total_time_running); 1732 atomic64_read(&counter->child_total_time_running);
1576 if (counter->attr.read_format & PERF_FORMAT_ID) 1733 if (counter->attr.read_format & PERF_FORMAT_ID)
1577 values[n++] = counter->id; 1734 values[n++] = primary_counter_id(counter);
1578 mutex_unlock(&counter->child_mutex); 1735 mutex_unlock(&counter->child_mutex);
1579 1736
1580 if (count < n * sizeof(u64)) 1737 if (count < n * sizeof(u64))
@@ -1681,8 +1838,6 @@ static int perf_counter_period(struct perf_counter *counter, u64 __user *arg)
1681 1838
1682 counter->attr.sample_freq = value; 1839 counter->attr.sample_freq = value;
1683 } else { 1840 } else {
1684 perf_log_period(counter, value);
1685
1686 counter->attr.sample_period = value; 1841 counter->attr.sample_period = value;
1687 counter->hw.sample_period = value; 1842 counter->hw.sample_period = value;
1688 } 1843 }
@@ -1751,6 +1906,14 @@ int perf_counter_task_disable(void)
1751 return 0; 1906 return 0;
1752} 1907}
1753 1908
1909static int perf_counter_index(struct perf_counter *counter)
1910{
1911 if (counter->state != PERF_COUNTER_STATE_ACTIVE)
1912 return 0;
1913
1914 return counter->hw.idx + 1 - PERF_COUNTER_INDEX_OFFSET;
1915}
1916
1754/* 1917/*
1755 * Callers need to ensure there can be no nesting of this function, otherwise 1918 * Callers need to ensure there can be no nesting of this function, otherwise
1756 * the seqlock logic goes bad. We can not serialize this because the arch 1919 * the seqlock logic goes bad. We can not serialize this because the arch
@@ -1775,11 +1938,17 @@ void perf_counter_update_userpage(struct perf_counter *counter)
1775 preempt_disable(); 1938 preempt_disable();
1776 ++userpg->lock; 1939 ++userpg->lock;
1777 barrier(); 1940 barrier();
1778 userpg->index = counter->hw.idx; 1941 userpg->index = perf_counter_index(counter);
1779 userpg->offset = atomic64_read(&counter->count); 1942 userpg->offset = atomic64_read(&counter->count);
1780 if (counter->state == PERF_COUNTER_STATE_ACTIVE) 1943 if (counter->state == PERF_COUNTER_STATE_ACTIVE)
1781 userpg->offset -= atomic64_read(&counter->hw.prev_count); 1944 userpg->offset -= atomic64_read(&counter->hw.prev_count);
1782 1945
1946 userpg->time_enabled = counter->total_time_enabled +
1947 atomic64_read(&counter->child_total_time_enabled);
1948
1949 userpg->time_running = counter->total_time_running +
1950 atomic64_read(&counter->child_total_time_running);
1951
1783 barrier(); 1952 barrier();
1784 ++userpg->lock; 1953 ++userpg->lock;
1785 preempt_enable(); 1954 preempt_enable();
@@ -1876,7 +2045,7 @@ fail:
1876 2045
1877static void perf_mmap_free_page(unsigned long addr) 2046static void perf_mmap_free_page(unsigned long addr)
1878{ 2047{
1879 struct page *page = virt_to_page(addr); 2048 struct page *page = virt_to_page((void *)addr);
1880 2049
1881 page->mapping = NULL; 2050 page->mapping = NULL;
1882 __free_page(page); 2051 __free_page(page);
@@ -2477,21 +2646,21 @@ static void perf_counter_output(struct perf_counter *counter, int nmi,
2477 u64 counter; 2646 u64 counter;
2478 } group_entry; 2647 } group_entry;
2479 struct perf_callchain_entry *callchain = NULL; 2648 struct perf_callchain_entry *callchain = NULL;
2649 struct perf_tracepoint_record *tp;
2480 int callchain_size = 0; 2650 int callchain_size = 0;
2481 u64 time; 2651 u64 time;
2482 struct { 2652 struct {
2483 u32 cpu, reserved; 2653 u32 cpu, reserved;
2484 } cpu_entry; 2654 } cpu_entry;
2485 2655
2486 header.type = 0; 2656 header.type = PERF_EVENT_SAMPLE;
2487 header.size = sizeof(header); 2657 header.size = sizeof(header);
2488 2658
2489 header.misc = PERF_EVENT_MISC_OVERFLOW; 2659 header.misc = 0;
2490 header.misc |= perf_misc_flags(data->regs); 2660 header.misc |= perf_misc_flags(data->regs);
2491 2661
2492 if (sample_type & PERF_SAMPLE_IP) { 2662 if (sample_type & PERF_SAMPLE_IP) {
2493 ip = perf_instruction_pointer(data->regs); 2663 ip = perf_instruction_pointer(data->regs);
2494 header.type |= PERF_SAMPLE_IP;
2495 header.size += sizeof(ip); 2664 header.size += sizeof(ip);
2496 } 2665 }
2497 2666
@@ -2500,7 +2669,6 @@ static void perf_counter_output(struct perf_counter *counter, int nmi,
2500 tid_entry.pid = perf_counter_pid(counter, current); 2669 tid_entry.pid = perf_counter_pid(counter, current);
2501 tid_entry.tid = perf_counter_tid(counter, current); 2670 tid_entry.tid = perf_counter_tid(counter, current);
2502 2671
2503 header.type |= PERF_SAMPLE_TID;
2504 header.size += sizeof(tid_entry); 2672 header.size += sizeof(tid_entry);
2505 } 2673 }
2506 2674
@@ -2510,34 +2678,29 @@ static void perf_counter_output(struct perf_counter *counter, int nmi,
2510 */ 2678 */
2511 time = sched_clock(); 2679 time = sched_clock();
2512 2680
2513 header.type |= PERF_SAMPLE_TIME;
2514 header.size += sizeof(u64); 2681 header.size += sizeof(u64);
2515 } 2682 }
2516 2683
2517 if (sample_type & PERF_SAMPLE_ADDR) { 2684 if (sample_type & PERF_SAMPLE_ADDR)
2518 header.type |= PERF_SAMPLE_ADDR;
2519 header.size += sizeof(u64); 2685 header.size += sizeof(u64);
2520 }
2521 2686
2522 if (sample_type & PERF_SAMPLE_ID) { 2687 if (sample_type & PERF_SAMPLE_ID)
2523 header.type |= PERF_SAMPLE_ID; 2688 header.size += sizeof(u64);
2689
2690 if (sample_type & PERF_SAMPLE_STREAM_ID)
2524 header.size += sizeof(u64); 2691 header.size += sizeof(u64);
2525 }
2526 2692
2527 if (sample_type & PERF_SAMPLE_CPU) { 2693 if (sample_type & PERF_SAMPLE_CPU) {
2528 header.type |= PERF_SAMPLE_CPU;
2529 header.size += sizeof(cpu_entry); 2694 header.size += sizeof(cpu_entry);
2530 2695
2531 cpu_entry.cpu = raw_smp_processor_id(); 2696 cpu_entry.cpu = raw_smp_processor_id();
2697 cpu_entry.reserved = 0;
2532 } 2698 }
2533 2699
2534 if (sample_type & PERF_SAMPLE_PERIOD) { 2700 if (sample_type & PERF_SAMPLE_PERIOD)
2535 header.type |= PERF_SAMPLE_PERIOD;
2536 header.size += sizeof(u64); 2701 header.size += sizeof(u64);
2537 }
2538 2702
2539 if (sample_type & PERF_SAMPLE_GROUP) { 2703 if (sample_type & PERF_SAMPLE_GROUP) {
2540 header.type |= PERF_SAMPLE_GROUP;
2541 header.size += sizeof(u64) + 2704 header.size += sizeof(u64) +
2542 counter->nr_siblings * sizeof(group_entry); 2705 counter->nr_siblings * sizeof(group_entry);
2543 } 2706 }
@@ -2547,10 +2710,14 @@ static void perf_counter_output(struct perf_counter *counter, int nmi,
2547 2710
2548 if (callchain) { 2711 if (callchain) {
2549 callchain_size = (1 + callchain->nr) * sizeof(u64); 2712 callchain_size = (1 + callchain->nr) * sizeof(u64);
2550
2551 header.type |= PERF_SAMPLE_CALLCHAIN;
2552 header.size += callchain_size; 2713 header.size += callchain_size;
2553 } 2714 } else
2715 header.size += sizeof(u64);
2716 }
2717
2718 if (sample_type & PERF_SAMPLE_TP_RECORD) {
2719 tp = data->private;
2720 header.size += tp->size;
2554 } 2721 }
2555 2722
2556 ret = perf_output_begin(&handle, counter, header.size, nmi, 1); 2723 ret = perf_output_begin(&handle, counter, header.size, nmi, 1);
@@ -2571,7 +2738,13 @@ static void perf_counter_output(struct perf_counter *counter, int nmi,
2571 if (sample_type & PERF_SAMPLE_ADDR) 2738 if (sample_type & PERF_SAMPLE_ADDR)
2572 perf_output_put(&handle, data->addr); 2739 perf_output_put(&handle, data->addr);
2573 2740
2574 if (sample_type & PERF_SAMPLE_ID) 2741 if (sample_type & PERF_SAMPLE_ID) {
2742 u64 id = primary_counter_id(counter);
2743
2744 perf_output_put(&handle, id);
2745 }
2746
2747 if (sample_type & PERF_SAMPLE_STREAM_ID)
2575 perf_output_put(&handle, counter->id); 2748 perf_output_put(&handle, counter->id);
2576 2749
2577 if (sample_type & PERF_SAMPLE_CPU) 2750 if (sample_type & PERF_SAMPLE_CPU)
@@ -2594,24 +2767,88 @@ static void perf_counter_output(struct perf_counter *counter, int nmi,
2594 if (sub != counter) 2767 if (sub != counter)
2595 sub->pmu->read(sub); 2768 sub->pmu->read(sub);
2596 2769
2597 group_entry.id = sub->id; 2770 group_entry.id = primary_counter_id(sub);
2598 group_entry.counter = atomic64_read(&sub->count); 2771 group_entry.counter = atomic64_read(&sub->count);
2599 2772
2600 perf_output_put(&handle, group_entry); 2773 perf_output_put(&handle, group_entry);
2601 } 2774 }
2602 } 2775 }
2603 2776
2604 if (callchain) 2777 if (sample_type & PERF_SAMPLE_CALLCHAIN) {
2605 perf_output_copy(&handle, callchain, callchain_size); 2778 if (callchain)
2779 perf_output_copy(&handle, callchain, callchain_size);
2780 else {
2781 u64 nr = 0;
2782 perf_output_put(&handle, nr);
2783 }
2784 }
2785
2786 if (sample_type & PERF_SAMPLE_TP_RECORD)
2787 perf_output_copy(&handle, tp->record, tp->size);
2788
2789 perf_output_end(&handle);
2790}
2791
2792/*
2793 * read event
2794 */
2795
2796struct perf_read_event {
2797 struct perf_event_header header;
2798
2799 u32 pid;
2800 u32 tid;
2801 u64 value;
2802 u64 format[3];
2803};
2804
2805static void
2806perf_counter_read_event(struct perf_counter *counter,
2807 struct task_struct *task)
2808{
2809 struct perf_output_handle handle;
2810 struct perf_read_event event = {
2811 .header = {
2812 .type = PERF_EVENT_READ,
2813 .misc = 0,
2814 .size = sizeof(event) - sizeof(event.format),
2815 },
2816 .pid = perf_counter_pid(counter, task),
2817 .tid = perf_counter_tid(counter, task),
2818 .value = atomic64_read(&counter->count),
2819 };
2820 int ret, i = 0;
2821
2822 if (counter->attr.read_format & PERF_FORMAT_TOTAL_TIME_ENABLED) {
2823 event.header.size += sizeof(u64);
2824 event.format[i++] = counter->total_time_enabled;
2825 }
2826
2827 if (counter->attr.read_format & PERF_FORMAT_TOTAL_TIME_RUNNING) {
2828 event.header.size += sizeof(u64);
2829 event.format[i++] = counter->total_time_running;
2830 }
2831
2832 if (counter->attr.read_format & PERF_FORMAT_ID) {
2833 event.header.size += sizeof(u64);
2834 event.format[i++] = primary_counter_id(counter);
2835 }
2606 2836
2837 ret = perf_output_begin(&handle, counter, event.header.size, 0, 0);
2838 if (ret)
2839 return;
2840
2841 perf_output_copy(&handle, &event, event.header.size);
2607 perf_output_end(&handle); 2842 perf_output_end(&handle);
2608} 2843}
2609 2844
2610/* 2845/*
2611 * fork tracking 2846 * task tracking -- fork/exit
2847 *
2848 * enabled by: attr.comm | attr.mmap | attr.task
2612 */ 2849 */
2613 2850
2614struct perf_fork_event { 2851struct perf_task_event {
2615 struct task_struct *task; 2852 struct task_struct *task;
2616 2853
2617 struct { 2854 struct {
@@ -2619,37 +2856,42 @@ struct perf_fork_event {
2619 2856
2620 u32 pid; 2857 u32 pid;
2621 u32 ppid; 2858 u32 ppid;
2859 u32 tid;
2860 u32 ptid;
2622 } event; 2861 } event;
2623}; 2862};
2624 2863
2625static void perf_counter_fork_output(struct perf_counter *counter, 2864static void perf_counter_task_output(struct perf_counter *counter,
2626 struct perf_fork_event *fork_event) 2865 struct perf_task_event *task_event)
2627{ 2866{
2628 struct perf_output_handle handle; 2867 struct perf_output_handle handle;
2629 int size = fork_event->event.header.size; 2868 int size = task_event->event.header.size;
2630 struct task_struct *task = fork_event->task; 2869 struct task_struct *task = task_event->task;
2631 int ret = perf_output_begin(&handle, counter, size, 0, 0); 2870 int ret = perf_output_begin(&handle, counter, size, 0, 0);
2632 2871
2633 if (ret) 2872 if (ret)
2634 return; 2873 return;
2635 2874
2636 fork_event->event.pid = perf_counter_pid(counter, task); 2875 task_event->event.pid = perf_counter_pid(counter, task);
2637 fork_event->event.ppid = perf_counter_pid(counter, task->real_parent); 2876 task_event->event.ppid = perf_counter_pid(counter, task->real_parent);
2877
2878 task_event->event.tid = perf_counter_tid(counter, task);
2879 task_event->event.ptid = perf_counter_tid(counter, task->real_parent);
2638 2880
2639 perf_output_put(&handle, fork_event->event); 2881 perf_output_put(&handle, task_event->event);
2640 perf_output_end(&handle); 2882 perf_output_end(&handle);
2641} 2883}
2642 2884
2643static int perf_counter_fork_match(struct perf_counter *counter) 2885static int perf_counter_task_match(struct perf_counter *counter)
2644{ 2886{
2645 if (counter->attr.comm || counter->attr.mmap) 2887 if (counter->attr.comm || counter->attr.mmap || counter->attr.task)
2646 return 1; 2888 return 1;
2647 2889
2648 return 0; 2890 return 0;
2649} 2891}
2650 2892
2651static void perf_counter_fork_ctx(struct perf_counter_context *ctx, 2893static void perf_counter_task_ctx(struct perf_counter_context *ctx,
2652 struct perf_fork_event *fork_event) 2894 struct perf_task_event *task_event)
2653{ 2895{
2654 struct perf_counter *counter; 2896 struct perf_counter *counter;
2655 2897
@@ -2658,19 +2900,19 @@ static void perf_counter_fork_ctx(struct perf_counter_context *ctx,
2658 2900
2659 rcu_read_lock(); 2901 rcu_read_lock();
2660 list_for_each_entry_rcu(counter, &ctx->event_list, event_entry) { 2902 list_for_each_entry_rcu(counter, &ctx->event_list, event_entry) {
2661 if (perf_counter_fork_match(counter)) 2903 if (perf_counter_task_match(counter))
2662 perf_counter_fork_output(counter, fork_event); 2904 perf_counter_task_output(counter, task_event);
2663 } 2905 }
2664 rcu_read_unlock(); 2906 rcu_read_unlock();
2665} 2907}
2666 2908
2667static void perf_counter_fork_event(struct perf_fork_event *fork_event) 2909static void perf_counter_task_event(struct perf_task_event *task_event)
2668{ 2910{
2669 struct perf_cpu_context *cpuctx; 2911 struct perf_cpu_context *cpuctx;
2670 struct perf_counter_context *ctx; 2912 struct perf_counter_context *ctx;
2671 2913
2672 cpuctx = &get_cpu_var(perf_cpu_context); 2914 cpuctx = &get_cpu_var(perf_cpu_context);
2673 perf_counter_fork_ctx(&cpuctx->ctx, fork_event); 2915 perf_counter_task_ctx(&cpuctx->ctx, task_event);
2674 put_cpu_var(perf_cpu_context); 2916 put_cpu_var(perf_cpu_context);
2675 2917
2676 rcu_read_lock(); 2918 rcu_read_lock();
@@ -2680,29 +2922,40 @@ static void perf_counter_fork_event(struct perf_fork_event *fork_event)
2680 */ 2922 */
2681 ctx = rcu_dereference(current->perf_counter_ctxp); 2923 ctx = rcu_dereference(current->perf_counter_ctxp);
2682 if (ctx) 2924 if (ctx)
2683 perf_counter_fork_ctx(ctx, fork_event); 2925 perf_counter_task_ctx(ctx, task_event);
2684 rcu_read_unlock(); 2926 rcu_read_unlock();
2685} 2927}
2686 2928
2687void perf_counter_fork(struct task_struct *task) 2929static void perf_counter_task(struct task_struct *task, int new)
2688{ 2930{
2689 struct perf_fork_event fork_event; 2931 struct perf_task_event task_event;
2690 2932
2691 if (!atomic_read(&nr_comm_counters) && 2933 if (!atomic_read(&nr_comm_counters) &&
2692 !atomic_read(&nr_mmap_counters)) 2934 !atomic_read(&nr_mmap_counters) &&
2935 !atomic_read(&nr_task_counters))
2693 return; 2936 return;
2694 2937
2695 fork_event = (struct perf_fork_event){ 2938 task_event = (struct perf_task_event){
2696 .task = task, 2939 .task = task,
2697 .event = { 2940 .event = {
2698 .header = { 2941 .header = {
2699 .type = PERF_EVENT_FORK, 2942 .type = new ? PERF_EVENT_FORK : PERF_EVENT_EXIT,
2700 .size = sizeof(fork_event.event), 2943 .misc = 0,
2944 .size = sizeof(task_event.event),
2701 }, 2945 },
2946 /* .pid */
2947 /* .ppid */
2948 /* .tid */
2949 /* .ptid */
2702 }, 2950 },
2703 }; 2951 };
2704 2952
2705 perf_counter_fork_event(&fork_event); 2953 perf_counter_task_event(&task_event);
2954}
2955
2956void perf_counter_fork(struct task_struct *task)
2957{
2958 perf_counter_task(task, 1);
2706} 2959}
2707 2960
2708/* 2961/*
@@ -2770,8 +3023,10 @@ static void perf_counter_comm_event(struct perf_comm_event *comm_event)
2770 struct perf_cpu_context *cpuctx; 3023 struct perf_cpu_context *cpuctx;
2771 struct perf_counter_context *ctx; 3024 struct perf_counter_context *ctx;
2772 unsigned int size; 3025 unsigned int size;
2773 char *comm = comm_event->task->comm; 3026 char comm[TASK_COMM_LEN];
2774 3027
3028 memset(comm, 0, sizeof(comm));
3029 strncpy(comm, comm_event->task->comm, sizeof(comm));
2775 size = ALIGN(strlen(comm)+1, sizeof(u64)); 3030 size = ALIGN(strlen(comm)+1, sizeof(u64));
2776 3031
2777 comm_event->comm = comm; 3032 comm_event->comm = comm;
@@ -2798,13 +3053,24 @@ void perf_counter_comm(struct task_struct *task)
2798{ 3053{
2799 struct perf_comm_event comm_event; 3054 struct perf_comm_event comm_event;
2800 3055
3056 if (task->perf_counter_ctxp)
3057 perf_counter_enable_on_exec(task);
3058
2801 if (!atomic_read(&nr_comm_counters)) 3059 if (!atomic_read(&nr_comm_counters))
2802 return; 3060 return;
2803 3061
2804 comm_event = (struct perf_comm_event){ 3062 comm_event = (struct perf_comm_event){
2805 .task = task, 3063 .task = task,
3064 /* .comm */
3065 /* .comm_size */
2806 .event = { 3066 .event = {
2807 .header = { .type = PERF_EVENT_COMM, }, 3067 .header = {
3068 .type = PERF_EVENT_COMM,
3069 .misc = 0,
3070 /* .size */
3071 },
3072 /* .pid */
3073 /* .tid */
2808 }, 3074 },
2809 }; 3075 };
2810 3076
@@ -2887,8 +3153,15 @@ static void perf_counter_mmap_event(struct perf_mmap_event *mmap_event)
2887 char *buf = NULL; 3153 char *buf = NULL;
2888 const char *name; 3154 const char *name;
2889 3155
3156 memset(tmp, 0, sizeof(tmp));
3157
2890 if (file) { 3158 if (file) {
2891 buf = kzalloc(PATH_MAX, GFP_KERNEL); 3159 /*
3160 * d_path works from the end of the buffer backwards, so we
3161 * need to add enough zero bytes after the string to handle
3162 * the 64bit alignment we do later.
3163 */
3164 buf = kzalloc(PATH_MAX + sizeof(u64), GFP_KERNEL);
2892 if (!buf) { 3165 if (!buf) {
2893 name = strncpy(tmp, "//enomem", sizeof(tmp)); 3166 name = strncpy(tmp, "//enomem", sizeof(tmp));
2894 goto got_name; 3167 goto got_name;
@@ -2899,9 +3172,11 @@ static void perf_counter_mmap_event(struct perf_mmap_event *mmap_event)
2899 goto got_name; 3172 goto got_name;
2900 } 3173 }
2901 } else { 3174 } else {
2902 name = arch_vma_name(mmap_event->vma); 3175 if (arch_vma_name(mmap_event->vma)) {
2903 if (name) 3176 name = strncpy(tmp, arch_vma_name(mmap_event->vma),
3177 sizeof(tmp));
2904 goto got_name; 3178 goto got_name;
3179 }
2905 3180
2906 if (!vma->vm_mm) { 3181 if (!vma->vm_mm) {
2907 name = strncpy(tmp, "[vdso]", sizeof(tmp)); 3182 name = strncpy(tmp, "[vdso]", sizeof(tmp));
@@ -2946,8 +3221,16 @@ void __perf_counter_mmap(struct vm_area_struct *vma)
2946 3221
2947 mmap_event = (struct perf_mmap_event){ 3222 mmap_event = (struct perf_mmap_event){
2948 .vma = vma, 3223 .vma = vma,
3224 /* .file_name */
3225 /* .file_size */
2949 .event = { 3226 .event = {
2950 .header = { .type = PERF_EVENT_MMAP, }, 3227 .header = {
3228 .type = PERF_EVENT_MMAP,
3229 .misc = 0,
3230 /* .size */
3231 },
3232 /* .pid */
3233 /* .tid */
2951 .start = vma->vm_start, 3234 .start = vma->vm_start,
2952 .len = vma->vm_end - vma->vm_start, 3235 .len = vma->vm_end - vma->vm_start,
2953 .pgoff = vma->vm_pgoff, 3236 .pgoff = vma->vm_pgoff,
@@ -2958,49 +3241,6 @@ void __perf_counter_mmap(struct vm_area_struct *vma)
2958} 3241}
2959 3242
2960/* 3243/*
2961 * Log sample_period changes so that analyzing tools can re-normalize the
2962 * event flow.
2963 */
2964
2965struct freq_event {
2966 struct perf_event_header header;
2967 u64 time;
2968 u64 id;
2969 u64 period;
2970};
2971
2972static void perf_log_period(struct perf_counter *counter, u64 period)
2973{
2974 struct perf_output_handle handle;
2975 struct freq_event event;
2976 int ret;
2977
2978 if (counter->hw.sample_period == period)
2979 return;
2980
2981 if (counter->attr.sample_type & PERF_SAMPLE_PERIOD)
2982 return;
2983
2984 event = (struct freq_event) {
2985 .header = {
2986 .type = PERF_EVENT_PERIOD,
2987 .misc = 0,
2988 .size = sizeof(event),
2989 },
2990 .time = sched_clock(),
2991 .id = counter->id,
2992 .period = period,
2993 };
2994
2995 ret = perf_output_begin(&handle, counter, sizeof(event), 1, 0);
2996 if (ret)
2997 return;
2998
2999 perf_output_put(&handle, event);
3000 perf_output_end(&handle);
3001}
3002
3003/*
3004 * IRQ throttle logging 3244 * IRQ throttle logging
3005 */ 3245 */
3006 3246
@@ -3013,16 +3253,21 @@ static void perf_log_throttle(struct perf_counter *counter, int enable)
3013 struct perf_event_header header; 3253 struct perf_event_header header;
3014 u64 time; 3254 u64 time;
3015 u64 id; 3255 u64 id;
3256 u64 stream_id;
3016 } throttle_event = { 3257 } throttle_event = {
3017 .header = { 3258 .header = {
3018 .type = PERF_EVENT_THROTTLE + 1, 3259 .type = PERF_EVENT_THROTTLE,
3019 .misc = 0, 3260 .misc = 0,
3020 .size = sizeof(throttle_event), 3261 .size = sizeof(throttle_event),
3021 }, 3262 },
3022 .time = sched_clock(), 3263 .time = sched_clock(),
3023 .id = counter->id, 3264 .id = primary_counter_id(counter),
3265 .stream_id = counter->id,
3024 }; 3266 };
3025 3267
3268 if (enable)
3269 throttle_event.header.type = PERF_EVENT_UNTHROTTLE;
3270
3026 ret = perf_output_begin(&handle, counter, sizeof(throttle_event), 1, 0); 3271 ret = perf_output_begin(&handle, counter, sizeof(throttle_event), 1, 0);
3027 if (ret) 3272 if (ret)
3028 return; 3273 return;
@@ -3317,8 +3562,8 @@ out:
3317 put_cpu_var(perf_cpu_context); 3562 put_cpu_var(perf_cpu_context);
3318} 3563}
3319 3564
3320void 3565void __perf_swcounter_event(u32 event, u64 nr, int nmi,
3321perf_swcounter_event(u32 event, u64 nr, int nmi, struct pt_regs *regs, u64 addr) 3566 struct pt_regs *regs, u64 addr)
3322{ 3567{
3323 struct perf_sample_data data = { 3568 struct perf_sample_data data = {
3324 .regs = regs, 3569 .regs = regs,
@@ -3467,17 +3712,24 @@ static const struct pmu perf_ops_task_clock = {
3467}; 3712};
3468 3713
3469#ifdef CONFIG_EVENT_PROFILE 3714#ifdef CONFIG_EVENT_PROFILE
3470void perf_tpcounter_event(int event_id) 3715void perf_tpcounter_event(int event_id, u64 addr, u64 count, void *record,
3716 int entry_size)
3471{ 3717{
3718 struct perf_tracepoint_record tp = {
3719 .size = entry_size,
3720 .record = record,
3721 };
3722
3472 struct perf_sample_data data = { 3723 struct perf_sample_data data = {
3473 .regs = get_irq_regs(); 3724 .regs = get_irq_regs(),
3474 .addr = 0, 3725 .addr = addr,
3726 .private = &tp,
3475 }; 3727 };
3476 3728
3477 if (!data.regs) 3729 if (!data.regs)
3478 data.regs = task_pt_regs(current); 3730 data.regs = task_pt_regs(current);
3479 3731
3480 do_perf_swcounter_event(PERF_TYPE_TRACEPOINT, event_id, 1, 1, &data); 3732 do_perf_swcounter_event(PERF_TYPE_TRACEPOINT, event_id, count, 1, &data);
3481} 3733}
3482EXPORT_SYMBOL_GPL(perf_tpcounter_event); 3734EXPORT_SYMBOL_GPL(perf_tpcounter_event);
3483 3735
@@ -3486,16 +3738,12 @@ extern void ftrace_profile_disable(int);
3486 3738
3487static void tp_perf_counter_destroy(struct perf_counter *counter) 3739static void tp_perf_counter_destroy(struct perf_counter *counter)
3488{ 3740{
3489 ftrace_profile_disable(perf_event_id(&counter->attr)); 3741 ftrace_profile_disable(counter->attr.config);
3490} 3742}
3491 3743
3492static const struct pmu *tp_perf_counter_init(struct perf_counter *counter) 3744static const struct pmu *tp_perf_counter_init(struct perf_counter *counter)
3493{ 3745{
3494 int event_id = perf_event_id(&counter->attr); 3746 if (ftrace_profile_enable(counter->attr.config))
3495 int ret;
3496
3497 ret = ftrace_profile_enable(event_id);
3498 if (ret)
3499 return NULL; 3747 return NULL;
3500 3748
3501 counter->destroy = tp_perf_counter_destroy; 3749 counter->destroy = tp_perf_counter_destroy;
@@ -3509,9 +3757,21 @@ static const struct pmu *tp_perf_counter_init(struct perf_counter *counter)
3509} 3757}
3510#endif 3758#endif
3511 3759
3760atomic_t perf_swcounter_enabled[PERF_COUNT_SW_MAX];
3761
3762static void sw_perf_counter_destroy(struct perf_counter *counter)
3763{
3764 u64 event = counter->attr.config;
3765
3766 WARN_ON(counter->parent);
3767
3768 atomic_dec(&perf_swcounter_enabled[event]);
3769}
3770
3512static const struct pmu *sw_perf_counter_init(struct perf_counter *counter) 3771static const struct pmu *sw_perf_counter_init(struct perf_counter *counter)
3513{ 3772{
3514 const struct pmu *pmu = NULL; 3773 const struct pmu *pmu = NULL;
3774 u64 event = counter->attr.config;
3515 3775
3516 /* 3776 /*
3517 * Software counters (currently) can't in general distinguish 3777 * Software counters (currently) can't in general distinguish
@@ -3520,7 +3780,7 @@ static const struct pmu *sw_perf_counter_init(struct perf_counter *counter)
3520 * to be kernel events, and page faults are never hypervisor 3780 * to be kernel events, and page faults are never hypervisor
3521 * events. 3781 * events.
3522 */ 3782 */
3523 switch (counter->attr.config) { 3783 switch (event) {
3524 case PERF_COUNT_SW_CPU_CLOCK: 3784 case PERF_COUNT_SW_CPU_CLOCK:
3525 pmu = &perf_ops_cpu_clock; 3785 pmu = &perf_ops_cpu_clock;
3526 3786
@@ -3541,6 +3801,10 @@ static const struct pmu *sw_perf_counter_init(struct perf_counter *counter)
3541 case PERF_COUNT_SW_PAGE_FAULTS_MAJ: 3801 case PERF_COUNT_SW_PAGE_FAULTS_MAJ:
3542 case PERF_COUNT_SW_CONTEXT_SWITCHES: 3802 case PERF_COUNT_SW_CONTEXT_SWITCHES:
3543 case PERF_COUNT_SW_CPU_MIGRATIONS: 3803 case PERF_COUNT_SW_CPU_MIGRATIONS:
3804 if (!counter->parent) {
3805 atomic_inc(&perf_swcounter_enabled[event]);
3806 counter->destroy = sw_perf_counter_destroy;
3807 }
3544 pmu = &perf_ops_generic; 3808 pmu = &perf_ops_generic;
3545 break; 3809 break;
3546 } 3810 }
@@ -3556,6 +3820,7 @@ perf_counter_alloc(struct perf_counter_attr *attr,
3556 int cpu, 3820 int cpu,
3557 struct perf_counter_context *ctx, 3821 struct perf_counter_context *ctx,
3558 struct perf_counter *group_leader, 3822 struct perf_counter *group_leader,
3823 struct perf_counter *parent_counter,
3559 gfp_t gfpflags) 3824 gfp_t gfpflags)
3560{ 3825{
3561 const struct pmu *pmu; 3826 const struct pmu *pmu;
@@ -3591,6 +3856,8 @@ perf_counter_alloc(struct perf_counter_attr *attr,
3591 counter->ctx = ctx; 3856 counter->ctx = ctx;
3592 counter->oncpu = -1; 3857 counter->oncpu = -1;
3593 3858
3859 counter->parent = parent_counter;
3860
3594 counter->ns = get_pid_ns(current->nsproxy->pid_ns); 3861 counter->ns = get_pid_ns(current->nsproxy->pid_ns);
3595 counter->id = atomic64_inc_return(&perf_counter_id); 3862 counter->id = atomic64_inc_return(&perf_counter_id);
3596 3863
@@ -3648,11 +3915,15 @@ done:
3648 3915
3649 counter->pmu = pmu; 3916 counter->pmu = pmu;
3650 3917
3651 atomic_inc(&nr_counters); 3918 if (!counter->parent) {
3652 if (counter->attr.mmap) 3919 atomic_inc(&nr_counters);
3653 atomic_inc(&nr_mmap_counters); 3920 if (counter->attr.mmap)
3654 if (counter->attr.comm) 3921 atomic_inc(&nr_mmap_counters);
3655 atomic_inc(&nr_comm_counters); 3922 if (counter->attr.comm)
3923 atomic_inc(&nr_comm_counters);
3924 if (counter->attr.task)
3925 atomic_inc(&nr_task_counters);
3926 }
3656 3927
3657 return counter; 3928 return counter;
3658} 3929}
@@ -3815,7 +4086,7 @@ SYSCALL_DEFINE5(perf_counter_open,
3815 } 4086 }
3816 4087
3817 counter = perf_counter_alloc(&attr, cpu, ctx, group_leader, 4088 counter = perf_counter_alloc(&attr, cpu, ctx, group_leader,
3818 GFP_KERNEL); 4089 NULL, GFP_KERNEL);
3819 ret = PTR_ERR(counter); 4090 ret = PTR_ERR(counter);
3820 if (IS_ERR(counter)) 4091 if (IS_ERR(counter))
3821 goto err_put_context; 4092 goto err_put_context;
@@ -3881,7 +4152,8 @@ inherit_counter(struct perf_counter *parent_counter,
3881 4152
3882 child_counter = perf_counter_alloc(&parent_counter->attr, 4153 child_counter = perf_counter_alloc(&parent_counter->attr,
3883 parent_counter->cpu, child_ctx, 4154 parent_counter->cpu, child_ctx,
3884 group_leader, GFP_KERNEL); 4155 group_leader, parent_counter,
4156 GFP_KERNEL);
3885 if (IS_ERR(child_counter)) 4157 if (IS_ERR(child_counter))
3886 return child_counter; 4158 return child_counter;
3887 get_ctx(child_ctx); 4159 get_ctx(child_ctx);
@@ -3904,12 +4176,6 @@ inherit_counter(struct perf_counter *parent_counter,
3904 */ 4176 */
3905 add_counter_to_ctx(child_counter, child_ctx); 4177 add_counter_to_ctx(child_counter, child_ctx);
3906 4178
3907 child_counter->parent = parent_counter;
3908 /*
3909 * inherit into child's child as well:
3910 */
3911 child_counter->attr.inherit = 1;
3912
3913 /* 4179 /*
3914 * Get a reference to the parent filp - we will fput it 4180 * Get a reference to the parent filp - we will fput it
3915 * when the child counter exits. This is safe to do because 4181 * when the child counter exits. This is safe to do because
@@ -3953,10 +4219,14 @@ static int inherit_group(struct perf_counter *parent_counter,
3953} 4219}
3954 4220
3955static void sync_child_counter(struct perf_counter *child_counter, 4221static void sync_child_counter(struct perf_counter *child_counter,
3956 struct perf_counter *parent_counter) 4222 struct task_struct *child)
3957{ 4223{
4224 struct perf_counter *parent_counter = child_counter->parent;
3958 u64 child_val; 4225 u64 child_val;
3959 4226
4227 if (child_counter->attr.inherit_stat)
4228 perf_counter_read_event(child_counter, child);
4229
3960 child_val = atomic64_read(&child_counter->count); 4230 child_val = atomic64_read(&child_counter->count);
3961 4231
3962 /* 4232 /*
@@ -3985,7 +4255,8 @@ static void sync_child_counter(struct perf_counter *child_counter,
3985 4255
3986static void 4256static void
3987__perf_counter_exit_task(struct perf_counter *child_counter, 4257__perf_counter_exit_task(struct perf_counter *child_counter,
3988 struct perf_counter_context *child_ctx) 4258 struct perf_counter_context *child_ctx,
4259 struct task_struct *child)
3989{ 4260{
3990 struct perf_counter *parent_counter; 4261 struct perf_counter *parent_counter;
3991 4262
@@ -3999,7 +4270,7 @@ __perf_counter_exit_task(struct perf_counter *child_counter,
3999 * counters need to be zapped - but otherwise linger. 4270 * counters need to be zapped - but otherwise linger.
4000 */ 4271 */
4001 if (parent_counter) { 4272 if (parent_counter) {
4002 sync_child_counter(child_counter, parent_counter); 4273 sync_child_counter(child_counter, child);
4003 free_counter(child_counter); 4274 free_counter(child_counter);
4004 } 4275 }
4005} 4276}
@@ -4013,8 +4284,10 @@ void perf_counter_exit_task(struct task_struct *child)
4013 struct perf_counter_context *child_ctx; 4284 struct perf_counter_context *child_ctx;
4014 unsigned long flags; 4285 unsigned long flags;
4015 4286
4016 if (likely(!child->perf_counter_ctxp)) 4287 if (likely(!child->perf_counter_ctxp)) {
4288 perf_counter_task(child, 0);
4017 return; 4289 return;
4290 }
4018 4291
4019 local_irq_save(flags); 4292 local_irq_save(flags);
4020 /* 4293 /*
@@ -4032,18 +4305,22 @@ void perf_counter_exit_task(struct task_struct *child)
4032 * incremented the context's refcount before we do put_ctx below. 4305 * incremented the context's refcount before we do put_ctx below.
4033 */ 4306 */
4034 spin_lock(&child_ctx->lock); 4307 spin_lock(&child_ctx->lock);
4308 /*
4309 * If this context is a clone; unclone it so it can't get
4310 * swapped to another process while we're removing all
4311 * the counters from it.
4312 */
4313 unclone_ctx(child_ctx);
4314 spin_unlock_irqrestore(&child_ctx->lock, flags);
4315
4316 /*
4317 * Report the task dead after unscheduling the counters so that we
4318 * won't get any samples after PERF_EVENT_EXIT. We can however still
4319 * get a few PERF_EVENT_READ events.
4320 */
4321 perf_counter_task(child, 0);
4322
4035 child->perf_counter_ctxp = NULL; 4323 child->perf_counter_ctxp = NULL;
4036 if (child_ctx->parent_ctx) {
4037 /*
4038 * This context is a clone; unclone it so it can't get
4039 * swapped to another process while we're removing all
4040 * the counters from it.
4041 */
4042 put_ctx(child_ctx->parent_ctx);
4043 child_ctx->parent_ctx = NULL;
4044 }
4045 spin_unlock(&child_ctx->lock);
4046 local_irq_restore(flags);
4047 4324
4048 /* 4325 /*
4049 * We can recurse on the same lock type through: 4326 * We can recurse on the same lock type through:
@@ -4061,7 +4338,7 @@ void perf_counter_exit_task(struct task_struct *child)
4061again: 4338again:
4062 list_for_each_entry_safe(child_counter, tmp, &child_ctx->counter_list, 4339 list_for_each_entry_safe(child_counter, tmp, &child_ctx->counter_list,
4063 list_entry) 4340 list_entry)
4064 __perf_counter_exit_task(child_counter, child_ctx); 4341 __perf_counter_exit_task(child_counter, child_ctx, child);
4065 4342
4066 /* 4343 /*
4067 * If the last counter was a group counter, it will have appended all 4344 * If the last counter was a group counter, it will have appended all
diff --git a/kernel/posix-cpu-timers.c b/kernel/posix-cpu-timers.c
index bece7c0b67b2..e33a21cb9407 100644
--- a/kernel/posix-cpu-timers.c
+++ b/kernel/posix-cpu-timers.c
@@ -521,11 +521,12 @@ void posix_cpu_timers_exit(struct task_struct *tsk)
521} 521}
522void posix_cpu_timers_exit_group(struct task_struct *tsk) 522void posix_cpu_timers_exit_group(struct task_struct *tsk)
523{ 523{
524 struct task_cputime cputime; 524 struct signal_struct *const sig = tsk->signal;
525 525
526 thread_group_cputimer(tsk, &cputime);
527 cleanup_timers(tsk->signal->cpu_timers, 526 cleanup_timers(tsk->signal->cpu_timers,
528 cputime.utime, cputime.stime, cputime.sum_exec_runtime); 527 cputime_add(tsk->utime, sig->utime),
528 cputime_add(tsk->stime, sig->stime),
529 tsk->se.sum_exec_runtime + sig->sum_sched_runtime);
529} 530}
530 531
531static void clear_dead_task(struct k_itimer *timer, union cpu_time_count now) 532static void clear_dead_task(struct k_itimer *timer, union cpu_time_count now)
diff --git a/kernel/posix-timers.c b/kernel/posix-timers.c
index 052ec4d195c7..d089d052c4a9 100644
--- a/kernel/posix-timers.c
+++ b/kernel/posix-timers.c
@@ -202,6 +202,12 @@ static int no_timer_create(struct k_itimer *new_timer)
202 return -EOPNOTSUPP; 202 return -EOPNOTSUPP;
203} 203}
204 204
205static int no_nsleep(const clockid_t which_clock, int flags,
206 struct timespec *tsave, struct timespec __user *rmtp)
207{
208 return -EOPNOTSUPP;
209}
210
205/* 211/*
206 * Return nonzero if we know a priori this clockid_t value is bogus. 212 * Return nonzero if we know a priori this clockid_t value is bogus.
207 */ 213 */
@@ -254,6 +260,7 @@ static __init int init_posix_timers(void)
254 .clock_get = posix_get_monotonic_raw, 260 .clock_get = posix_get_monotonic_raw,
255 .clock_set = do_posix_clock_nosettime, 261 .clock_set = do_posix_clock_nosettime,
256 .timer_create = no_timer_create, 262 .timer_create = no_timer_create,
263 .nsleep = no_nsleep,
257 }; 264 };
258 265
259 register_posix_clock(CLOCK_REALTIME, &clock_realtime); 266 register_posix_clock(CLOCK_REALTIME, &clock_realtime);
diff --git a/kernel/power/user.c b/kernel/power/user.c
index ed97375daae9..bf0014d6a5f0 100644
--- a/kernel/power/user.c
+++ b/kernel/power/user.c
@@ -23,7 +23,6 @@
23#include <linux/console.h> 23#include <linux/console.h>
24#include <linux/cpu.h> 24#include <linux/cpu.h>
25#include <linux/freezer.h> 25#include <linux/freezer.h>
26#include <linux/smp_lock.h>
27#include <scsi/scsi_scan.h> 26#include <scsi/scsi_scan.h>
28 27
29#include <asm/uaccess.h> 28#include <asm/uaccess.h>
diff --git a/kernel/profile.c b/kernel/profile.c
index 69911b5745eb..419250ebec4d 100644
--- a/kernel/profile.c
+++ b/kernel/profile.c
@@ -117,11 +117,12 @@ int __ref profile_init(void)
117 117
118 cpumask_copy(prof_cpu_mask, cpu_possible_mask); 118 cpumask_copy(prof_cpu_mask, cpu_possible_mask);
119 119
120 prof_buffer = kzalloc(buffer_bytes, GFP_KERNEL); 120 prof_buffer = kzalloc(buffer_bytes, GFP_KERNEL|__GFP_NOWARN);
121 if (prof_buffer) 121 if (prof_buffer)
122 return 0; 122 return 0;
123 123
124 prof_buffer = alloc_pages_exact(buffer_bytes, GFP_KERNEL|__GFP_ZERO); 124 prof_buffer = alloc_pages_exact(buffer_bytes,
125 GFP_KERNEL|__GFP_ZERO|__GFP_NOWARN);
125 if (prof_buffer) 126 if (prof_buffer)
126 return 0; 127 return 0;
127 128
diff --git a/kernel/ptrace.c b/kernel/ptrace.c
index 61c78b2c07ba..082c320e4dbf 100644
--- a/kernel/ptrace.c
+++ b/kernel/ptrace.c
@@ -181,8 +181,8 @@ int ptrace_attach(struct task_struct *task)
181 * interference; SUID, SGID and LSM creds get determined differently 181 * interference; SUID, SGID and LSM creds get determined differently
182 * under ptrace. 182 * under ptrace.
183 */ 183 */
184 retval = mutex_lock_interruptible(&task->cred_guard_mutex); 184 retval = -ERESTARTNOINTR;
185 if (retval < 0) 185 if (mutex_lock_interruptible(&task->cred_guard_mutex))
186 goto out; 186 goto out;
187 187
188 task_lock(task); 188 task_lock(task);
diff --git a/kernel/rcutree.c b/kernel/rcutree.c
index 0dccfbba6d26..7717b95c2027 100644
--- a/kernel/rcutree.c
+++ b/kernel/rcutree.c
@@ -1533,7 +1533,7 @@ void __init __rcu_init(void)
1533 int j; 1533 int j;
1534 struct rcu_node *rnp; 1534 struct rcu_node *rnp;
1535 1535
1536 printk(KERN_WARNING "Experimental hierarchical RCU implementation.\n"); 1536 printk(KERN_INFO "Hierarchical RCU implementation.\n");
1537#ifdef CONFIG_RCU_CPU_STALL_DETECTOR 1537#ifdef CONFIG_RCU_CPU_STALL_DETECTOR
1538 printk(KERN_INFO "RCU-based detection of stalled CPUs is enabled.\n"); 1538 printk(KERN_INFO "RCU-based detection of stalled CPUs is enabled.\n");
1539#endif /* #ifdef CONFIG_RCU_CPU_STALL_DETECTOR */ 1539#endif /* #ifdef CONFIG_RCU_CPU_STALL_DETECTOR */
@@ -1546,7 +1546,6 @@ void __init __rcu_init(void)
1546 rcu_cpu_notify(&rcu_nb, CPU_UP_PREPARE, (void *)(long)i); 1546 rcu_cpu_notify(&rcu_nb, CPU_UP_PREPARE, (void *)(long)i);
1547 /* Register notifier for non-boot CPUs */ 1547 /* Register notifier for non-boot CPUs */
1548 register_cpu_notifier(&rcu_nb); 1548 register_cpu_notifier(&rcu_nb);
1549 printk(KERN_WARNING "Experimental hierarchical RCU init done.\n");
1550} 1549}
1551 1550
1552module_param(blimit, int, 0); 1551module_param(blimit, int, 0);
diff --git a/kernel/resource.c b/kernel/resource.c
index ac5f3a36923f..78b087221c15 100644
--- a/kernel/resource.c
+++ b/kernel/resource.c
@@ -787,7 +787,7 @@ static int __init reserve_setup(char *str)
787 static struct resource reserve[MAXRESERVE]; 787 static struct resource reserve[MAXRESERVE];
788 788
789 for (;;) { 789 for (;;) {
790 int io_start, io_num; 790 unsigned int io_start, io_num;
791 int x = reserved; 791 int x = reserved;
792 792
793 if (get_option (&str, &io_start) != 2) 793 if (get_option (&str, &io_start) != 2)
diff --git a/kernel/rtmutex.c b/kernel/rtmutex.c
index fcd107a78c5a..29bd4baf9e75 100644
--- a/kernel/rtmutex.c
+++ b/kernel/rtmutex.c
@@ -1039,16 +1039,14 @@ int rt_mutex_start_proxy_lock(struct rt_mutex *lock,
1039 if (!rt_mutex_owner(lock) || try_to_steal_lock(lock, task)) { 1039 if (!rt_mutex_owner(lock) || try_to_steal_lock(lock, task)) {
1040 /* We got the lock for task. */ 1040 /* We got the lock for task. */
1041 debug_rt_mutex_lock(lock); 1041 debug_rt_mutex_lock(lock);
1042
1043 rt_mutex_set_owner(lock, task, 0); 1042 rt_mutex_set_owner(lock, task, 0);
1044 1043 spin_unlock(&lock->wait_lock);
1045 rt_mutex_deadlock_account_lock(lock, task); 1044 rt_mutex_deadlock_account_lock(lock, task);
1046 return 1; 1045 return 1;
1047 } 1046 }
1048 1047
1049 ret = task_blocks_on_rt_mutex(lock, waiter, task, detect_deadlock); 1048 ret = task_blocks_on_rt_mutex(lock, waiter, task, detect_deadlock);
1050 1049
1051
1052 if (ret && !waiter->task) { 1050 if (ret && !waiter->task) {
1053 /* 1051 /*
1054 * Reset the return value. We might have 1052 * Reset the return value. We might have
diff --git a/kernel/sched.c b/kernel/sched.c
index 7c9098d186e6..1b59e265273b 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -493,6 +493,7 @@ struct rt_rq {
493#endif 493#endif
494#ifdef CONFIG_SMP 494#ifdef CONFIG_SMP
495 unsigned long rt_nr_migratory; 495 unsigned long rt_nr_migratory;
496 unsigned long rt_nr_total;
496 int overloaded; 497 int overloaded;
497 struct plist_head pushable_tasks; 498 struct plist_head pushable_tasks;
498#endif 499#endif
@@ -2571,15 +2572,37 @@ static void __sched_fork(struct task_struct *p)
2571 p->se.avg_wakeup = sysctl_sched_wakeup_granularity; 2572 p->se.avg_wakeup = sysctl_sched_wakeup_granularity;
2572 2573
2573#ifdef CONFIG_SCHEDSTATS 2574#ifdef CONFIG_SCHEDSTATS
2574 p->se.wait_start = 0; 2575 p->se.wait_start = 0;
2575 p->se.sum_sleep_runtime = 0; 2576 p->se.wait_max = 0;
2576 p->se.sleep_start = 0; 2577 p->se.wait_count = 0;
2577 p->se.block_start = 0; 2578 p->se.wait_sum = 0;
2578 p->se.sleep_max = 0; 2579
2579 p->se.block_max = 0; 2580 p->se.sleep_start = 0;
2580 p->se.exec_max = 0; 2581 p->se.sleep_max = 0;
2581 p->se.slice_max = 0; 2582 p->se.sum_sleep_runtime = 0;
2582 p->se.wait_max = 0; 2583
2584 p->se.block_start = 0;
2585 p->se.block_max = 0;
2586 p->se.exec_max = 0;
2587 p->se.slice_max = 0;
2588
2589 p->se.nr_migrations_cold = 0;
2590 p->se.nr_failed_migrations_affine = 0;
2591 p->se.nr_failed_migrations_running = 0;
2592 p->se.nr_failed_migrations_hot = 0;
2593 p->se.nr_forced_migrations = 0;
2594 p->se.nr_forced2_migrations = 0;
2595
2596 p->se.nr_wakeups = 0;
2597 p->se.nr_wakeups_sync = 0;
2598 p->se.nr_wakeups_migrate = 0;
2599 p->se.nr_wakeups_local = 0;
2600 p->se.nr_wakeups_remote = 0;
2601 p->se.nr_wakeups_affine = 0;
2602 p->se.nr_wakeups_affine_attempts = 0;
2603 p->se.nr_wakeups_passive = 0;
2604 p->se.nr_wakeups_idle = 0;
2605
2583#endif 2606#endif
2584 2607
2585 INIT_LIST_HEAD(&p->rt.run_list); 2608 INIT_LIST_HEAD(&p->rt.run_list);
@@ -6541,6 +6564,11 @@ SYSCALL_DEFINE0(sched_yield)
6541 return 0; 6564 return 0;
6542} 6565}
6543 6566
6567static inline int should_resched(void)
6568{
6569 return need_resched() && !(preempt_count() & PREEMPT_ACTIVE);
6570}
6571
6544static void __cond_resched(void) 6572static void __cond_resched(void)
6545{ 6573{
6546#ifdef CONFIG_DEBUG_SPINLOCK_SLEEP 6574#ifdef CONFIG_DEBUG_SPINLOCK_SLEEP
@@ -6560,8 +6588,7 @@ static void __cond_resched(void)
6560 6588
6561int __sched _cond_resched(void) 6589int __sched _cond_resched(void)
6562{ 6590{
6563 if (need_resched() && !(preempt_count() & PREEMPT_ACTIVE) && 6591 if (should_resched()) {
6564 system_state == SYSTEM_RUNNING) {
6565 __cond_resched(); 6592 __cond_resched();
6566 return 1; 6593 return 1;
6567 } 6594 }
@@ -6579,12 +6606,12 @@ EXPORT_SYMBOL(_cond_resched);
6579 */ 6606 */
6580int cond_resched_lock(spinlock_t *lock) 6607int cond_resched_lock(spinlock_t *lock)
6581{ 6608{
6582 int resched = need_resched() && system_state == SYSTEM_RUNNING; 6609 int resched = should_resched();
6583 int ret = 0; 6610 int ret = 0;
6584 6611
6585 if (spin_needbreak(lock) || resched) { 6612 if (spin_needbreak(lock) || resched) {
6586 spin_unlock(lock); 6613 spin_unlock(lock);
6587 if (resched && need_resched()) 6614 if (resched)
6588 __cond_resched(); 6615 __cond_resched();
6589 else 6616 else
6590 cpu_relax(); 6617 cpu_relax();
@@ -6599,7 +6626,7 @@ int __sched cond_resched_softirq(void)
6599{ 6626{
6600 BUG_ON(!in_softirq()); 6627 BUG_ON(!in_softirq());
6601 6628
6602 if (need_resched() && system_state == SYSTEM_RUNNING) { 6629 if (should_resched()) {
6603 local_bh_enable(); 6630 local_bh_enable();
6604 __cond_resched(); 6631 __cond_resched();
6605 local_bh_disable(); 6632 local_bh_disable();
@@ -7262,6 +7289,7 @@ static void migrate_dead_tasks(unsigned int dead_cpu)
7262static void calc_global_load_remove(struct rq *rq) 7289static void calc_global_load_remove(struct rq *rq)
7263{ 7290{
7264 atomic_long_sub(rq->calc_load_active, &calc_load_tasks); 7291 atomic_long_sub(rq->calc_load_active, &calc_load_tasks);
7292 rq->calc_load_active = 0;
7265} 7293}
7266#endif /* CONFIG_HOTPLUG_CPU */ 7294#endif /* CONFIG_HOTPLUG_CPU */
7267 7295
@@ -7488,6 +7516,7 @@ migration_call(struct notifier_block *nfb, unsigned long action, void *hcpu)
7488 task_rq_unlock(rq, &flags); 7516 task_rq_unlock(rq, &flags);
7489 get_task_struct(p); 7517 get_task_struct(p);
7490 cpu_rq(cpu)->migration_thread = p; 7518 cpu_rq(cpu)->migration_thread = p;
7519 rq->calc_load_update = calc_load_update;
7491 break; 7520 break;
7492 7521
7493 case CPU_ONLINE: 7522 case CPU_ONLINE:
@@ -7498,8 +7527,6 @@ migration_call(struct notifier_block *nfb, unsigned long action, void *hcpu)
7498 /* Update our root-domain */ 7527 /* Update our root-domain */
7499 rq = cpu_rq(cpu); 7528 rq = cpu_rq(cpu);
7500 spin_lock_irqsave(&rq->lock, flags); 7529 spin_lock_irqsave(&rq->lock, flags);
7501 rq->calc_load_update = calc_load_update;
7502 rq->calc_load_active = 0;
7503 if (rq->rd) { 7530 if (rq->rd) {
7504 BUG_ON(!cpumask_test_cpu(cpu, rq->rd->span)); 7531 BUG_ON(!cpumask_test_cpu(cpu, rq->rd->span));
7505 7532
@@ -9070,7 +9097,7 @@ static void init_rt_rq(struct rt_rq *rt_rq, struct rq *rq)
9070#ifdef CONFIG_SMP 9097#ifdef CONFIG_SMP
9071 rt_rq->rt_nr_migratory = 0; 9098 rt_rq->rt_nr_migratory = 0;
9072 rt_rq->overloaded = 0; 9099 rt_rq->overloaded = 0;
9073 plist_head_init(&rq->rt.pushable_tasks, &rq->lock); 9100 plist_head_init(&rt_rq->pushable_tasks, &rq->lock);
9074#endif 9101#endif
9075 9102
9076 rt_rq->rt_time = 0; 9103 rt_rq->rt_time = 0;
diff --git a/kernel/sched_cpupri.c b/kernel/sched_cpupri.c
index e6c251790dde..d014efbf947a 100644
--- a/kernel/sched_cpupri.c
+++ b/kernel/sched_cpupri.c
@@ -81,8 +81,21 @@ int cpupri_find(struct cpupri *cp, struct task_struct *p,
81 if (cpumask_any_and(&p->cpus_allowed, vec->mask) >= nr_cpu_ids) 81 if (cpumask_any_and(&p->cpus_allowed, vec->mask) >= nr_cpu_ids)
82 continue; 82 continue;
83 83
84 if (lowest_mask) 84 if (lowest_mask) {
85 cpumask_and(lowest_mask, &p->cpus_allowed, vec->mask); 85 cpumask_and(lowest_mask, &p->cpus_allowed, vec->mask);
86
87 /*
88 * We have to ensure that we have at least one bit
89 * still set in the array, since the map could have
90 * been concurrently emptied between the first and
91 * second reads of vec->mask. If we hit this
92 * condition, simply act as though we never hit this
93 * priority level and continue on.
94 */
95 if (cpumask_any(lowest_mask) >= nr_cpu_ids)
96 continue;
97 }
98
86 return 1; 99 return 1;
87 } 100 }
88 101
diff --git a/kernel/sched_fair.c b/kernel/sched_fair.c
index ba7fd6e9556f..652e8bdef9aa 100644
--- a/kernel/sched_fair.c
+++ b/kernel/sched_fair.c
@@ -266,6 +266,12 @@ static inline u64 min_vruntime(u64 min_vruntime, u64 vruntime)
266 return min_vruntime; 266 return min_vruntime;
267} 267}
268 268
269static inline int entity_before(struct sched_entity *a,
270 struct sched_entity *b)
271{
272 return (s64)(a->vruntime - b->vruntime) < 0;
273}
274
269static inline s64 entity_key(struct cfs_rq *cfs_rq, struct sched_entity *se) 275static inline s64 entity_key(struct cfs_rq *cfs_rq, struct sched_entity *se)
270{ 276{
271 return se->vruntime - cfs_rq->min_vruntime; 277 return se->vruntime - cfs_rq->min_vruntime;
@@ -605,9 +611,13 @@ account_entity_dequeue(struct cfs_rq *cfs_rq, struct sched_entity *se)
605static void enqueue_sleeper(struct cfs_rq *cfs_rq, struct sched_entity *se) 611static void enqueue_sleeper(struct cfs_rq *cfs_rq, struct sched_entity *se)
606{ 612{
607#ifdef CONFIG_SCHEDSTATS 613#ifdef CONFIG_SCHEDSTATS
614 struct task_struct *tsk = NULL;
615
616 if (entity_is_task(se))
617 tsk = task_of(se);
618
608 if (se->sleep_start) { 619 if (se->sleep_start) {
609 u64 delta = rq_of(cfs_rq)->clock - se->sleep_start; 620 u64 delta = rq_of(cfs_rq)->clock - se->sleep_start;
610 struct task_struct *tsk = task_of(se);
611 621
612 if ((s64)delta < 0) 622 if ((s64)delta < 0)
613 delta = 0; 623 delta = 0;
@@ -618,11 +628,11 @@ static void enqueue_sleeper(struct cfs_rq *cfs_rq, struct sched_entity *se)
618 se->sleep_start = 0; 628 se->sleep_start = 0;
619 se->sum_sleep_runtime += delta; 629 se->sum_sleep_runtime += delta;
620 630
621 account_scheduler_latency(tsk, delta >> 10, 1); 631 if (tsk)
632 account_scheduler_latency(tsk, delta >> 10, 1);
622 } 633 }
623 if (se->block_start) { 634 if (se->block_start) {
624 u64 delta = rq_of(cfs_rq)->clock - se->block_start; 635 u64 delta = rq_of(cfs_rq)->clock - se->block_start;
625 struct task_struct *tsk = task_of(se);
626 636
627 if ((s64)delta < 0) 637 if ((s64)delta < 0)
628 delta = 0; 638 delta = 0;
@@ -633,17 +643,19 @@ static void enqueue_sleeper(struct cfs_rq *cfs_rq, struct sched_entity *se)
633 se->block_start = 0; 643 se->block_start = 0;
634 se->sum_sleep_runtime += delta; 644 se->sum_sleep_runtime += delta;
635 645
636 /* 646 if (tsk) {
637 * Blocking time is in units of nanosecs, so shift by 20 to 647 /*
638 * get a milliseconds-range estimation of the amount of 648 * Blocking time is in units of nanosecs, so shift by
639 * time that the task spent sleeping: 649 * 20 to get a milliseconds-range estimation of the
640 */ 650 * amount of time that the task spent sleeping:
641 if (unlikely(prof_on == SLEEP_PROFILING)) { 651 */
642 652 if (unlikely(prof_on == SLEEP_PROFILING)) {
643 profile_hits(SLEEP_PROFILING, (void *)get_wchan(tsk), 653 profile_hits(SLEEP_PROFILING,
644 delta >> 20); 654 (void *)get_wchan(tsk),
655 delta >> 20);
656 }
657 account_scheduler_latency(tsk, delta >> 10, 0);
645 } 658 }
646 account_scheduler_latency(tsk, delta >> 10, 0);
647 } 659 }
648#endif 660#endif
649} 661}
@@ -687,7 +699,8 @@ place_entity(struct cfs_rq *cfs_rq, struct sched_entity *se, int initial)
687 * all of which have the same weight. 699 * all of which have the same weight.
688 */ 700 */
689 if (sched_feat(NORMALIZED_SLEEPER) && 701 if (sched_feat(NORMALIZED_SLEEPER) &&
690 task_of(se)->policy != SCHED_IDLE) 702 (!entity_is_task(se) ||
703 task_of(se)->policy != SCHED_IDLE))
691 thresh = calc_delta_fair(thresh, se); 704 thresh = calc_delta_fair(thresh, se);
692 705
693 vruntime -= thresh; 706 vruntime -= thresh;
@@ -1016,7 +1029,7 @@ static void yield_task_fair(struct rq *rq)
1016 /* 1029 /*
1017 * Already in the rightmost position? 1030 * Already in the rightmost position?
1018 */ 1031 */
1019 if (unlikely(!rightmost || rightmost->vruntime < se->vruntime)) 1032 if (unlikely(!rightmost || entity_before(rightmost, se)))
1020 return; 1033 return;
1021 1034
1022 /* 1035 /*
@@ -1712,7 +1725,7 @@ static void task_new_fair(struct rq *rq, struct task_struct *p)
1712 1725
1713 /* 'curr' will be NULL if the child belongs to a different group */ 1726 /* 'curr' will be NULL if the child belongs to a different group */
1714 if (sysctl_sched_child_runs_first && this_cpu == task_cpu(p) && 1727 if (sysctl_sched_child_runs_first && this_cpu == task_cpu(p) &&
1715 curr && curr->vruntime < se->vruntime) { 1728 curr && entity_before(curr, se)) {
1716 /* 1729 /*
1717 * Upon rescheduling, sched_class::put_prev_task() will place 1730 * Upon rescheduling, sched_class::put_prev_task() will place
1718 * 'current' within the tree based on its new key value. 1731 * 'current' within the tree based on its new key value.
diff --git a/kernel/sched_rt.c b/kernel/sched_rt.c
index 9bf0d2a73045..3918e01994e0 100644
--- a/kernel/sched_rt.c
+++ b/kernel/sched_rt.c
@@ -10,6 +10,8 @@ static inline struct task_struct *rt_task_of(struct sched_rt_entity *rt_se)
10 10
11#ifdef CONFIG_RT_GROUP_SCHED 11#ifdef CONFIG_RT_GROUP_SCHED
12 12
13#define rt_entity_is_task(rt_se) (!(rt_se)->my_q)
14
13static inline struct rq *rq_of_rt_rq(struct rt_rq *rt_rq) 15static inline struct rq *rq_of_rt_rq(struct rt_rq *rt_rq)
14{ 16{
15 return rt_rq->rq; 17 return rt_rq->rq;
@@ -22,6 +24,8 @@ static inline struct rt_rq *rt_rq_of_se(struct sched_rt_entity *rt_se)
22 24
23#else /* CONFIG_RT_GROUP_SCHED */ 25#else /* CONFIG_RT_GROUP_SCHED */
24 26
27#define rt_entity_is_task(rt_se) (1)
28
25static inline struct rq *rq_of_rt_rq(struct rt_rq *rt_rq) 29static inline struct rq *rq_of_rt_rq(struct rt_rq *rt_rq)
26{ 30{
27 return container_of(rt_rq, struct rq, rt); 31 return container_of(rt_rq, struct rq, rt);
@@ -73,7 +77,7 @@ static inline void rt_clear_overload(struct rq *rq)
73 77
74static void update_rt_migration(struct rt_rq *rt_rq) 78static void update_rt_migration(struct rt_rq *rt_rq)
75{ 79{
76 if (rt_rq->rt_nr_migratory && (rt_rq->rt_nr_running > 1)) { 80 if (rt_rq->rt_nr_migratory && rt_rq->rt_nr_total > 1) {
77 if (!rt_rq->overloaded) { 81 if (!rt_rq->overloaded) {
78 rt_set_overload(rq_of_rt_rq(rt_rq)); 82 rt_set_overload(rq_of_rt_rq(rt_rq));
79 rt_rq->overloaded = 1; 83 rt_rq->overloaded = 1;
@@ -86,6 +90,12 @@ static void update_rt_migration(struct rt_rq *rt_rq)
86 90
87static void inc_rt_migration(struct sched_rt_entity *rt_se, struct rt_rq *rt_rq) 91static void inc_rt_migration(struct sched_rt_entity *rt_se, struct rt_rq *rt_rq)
88{ 92{
93 if (!rt_entity_is_task(rt_se))
94 return;
95
96 rt_rq = &rq_of_rt_rq(rt_rq)->rt;
97
98 rt_rq->rt_nr_total++;
89 if (rt_se->nr_cpus_allowed > 1) 99 if (rt_se->nr_cpus_allowed > 1)
90 rt_rq->rt_nr_migratory++; 100 rt_rq->rt_nr_migratory++;
91 101
@@ -94,6 +104,12 @@ static void inc_rt_migration(struct sched_rt_entity *rt_se, struct rt_rq *rt_rq)
94 104
95static void dec_rt_migration(struct sched_rt_entity *rt_se, struct rt_rq *rt_rq) 105static void dec_rt_migration(struct sched_rt_entity *rt_se, struct rt_rq *rt_rq)
96{ 106{
107 if (!rt_entity_is_task(rt_se))
108 return;
109
110 rt_rq = &rq_of_rt_rq(rt_rq)->rt;
111
112 rt_rq->rt_nr_total--;
97 if (rt_se->nr_cpus_allowed > 1) 113 if (rt_se->nr_cpus_allowed > 1)
98 rt_rq->rt_nr_migratory--; 114 rt_rq->rt_nr_migratory--;
99 115
diff --git a/kernel/signal.c b/kernel/signal.c
index ccf1ceedaebe..64c5deeaca5d 100644
--- a/kernel/signal.c
+++ b/kernel/signal.c
@@ -2454,11 +2454,9 @@ do_sigaltstack (const stack_t __user *uss, stack_t __user *uoss, unsigned long s
2454 stack_t oss; 2454 stack_t oss;
2455 int error; 2455 int error;
2456 2456
2457 if (uoss) { 2457 oss.ss_sp = (void __user *) current->sas_ss_sp;
2458 oss.ss_sp = (void __user *) current->sas_ss_sp; 2458 oss.ss_size = current->sas_ss_size;
2459 oss.ss_size = current->sas_ss_size; 2459 oss.ss_flags = sas_ss_flags(sp);
2460 oss.ss_flags = sas_ss_flags(sp);
2461 }
2462 2460
2463 if (uss) { 2461 if (uss) {
2464 void __user *ss_sp; 2462 void __user *ss_sp;
@@ -2466,10 +2464,12 @@ do_sigaltstack (const stack_t __user *uss, stack_t __user *uoss, unsigned long s
2466 int ss_flags; 2464 int ss_flags;
2467 2465
2468 error = -EFAULT; 2466 error = -EFAULT;
2469 if (!access_ok(VERIFY_READ, uss, sizeof(*uss)) 2467 if (!access_ok(VERIFY_READ, uss, sizeof(*uss)))
2470 || __get_user(ss_sp, &uss->ss_sp) 2468 goto out;
2471 || __get_user(ss_flags, &uss->ss_flags) 2469 error = __get_user(ss_sp, &uss->ss_sp) |
2472 || __get_user(ss_size, &uss->ss_size)) 2470 __get_user(ss_flags, &uss->ss_flags) |
2471 __get_user(ss_size, &uss->ss_size);
2472 if (error)
2473 goto out; 2473 goto out;
2474 2474
2475 error = -EPERM; 2475 error = -EPERM;
@@ -2501,13 +2501,16 @@ do_sigaltstack (const stack_t __user *uss, stack_t __user *uoss, unsigned long s
2501 current->sas_ss_size = ss_size; 2501 current->sas_ss_size = ss_size;
2502 } 2502 }
2503 2503
2504 error = 0;
2504 if (uoss) { 2505 if (uoss) {
2505 error = -EFAULT; 2506 error = -EFAULT;
2506 if (copy_to_user(uoss, &oss, sizeof(oss))) 2507 if (!access_ok(VERIFY_WRITE, uoss, sizeof(*uoss)))
2507 goto out; 2508 goto out;
2509 error = __put_user(oss.ss_sp, &uoss->ss_sp) |
2510 __put_user(oss.ss_size, &uoss->ss_size) |
2511 __put_user(oss.ss_flags, &uoss->ss_flags);
2508 } 2512 }
2509 2513
2510 error = 0;
2511out: 2514out:
2512 return error; 2515 return error;
2513} 2516}
diff --git a/kernel/smp.c b/kernel/smp.c
index ad63d8501207..94188b8ecc33 100644
--- a/kernel/smp.c
+++ b/kernel/smp.c
@@ -57,7 +57,7 @@ hotplug_cfd(struct notifier_block *nfb, unsigned long action, void *hcpu)
57 return NOTIFY_BAD; 57 return NOTIFY_BAD;
58 break; 58 break;
59 59
60#ifdef CONFIG_CPU_HOTPLUG 60#ifdef CONFIG_HOTPLUG_CPU
61 case CPU_UP_CANCELED: 61 case CPU_UP_CANCELED:
62 case CPU_UP_CANCELED_FROZEN: 62 case CPU_UP_CANCELED_FROZEN:
63 63
diff --git a/kernel/softirq.c b/kernel/softirq.c
index 3a94905fa5d2..eb5e131a0485 100644
--- a/kernel/softirq.c
+++ b/kernel/softirq.c
@@ -345,7 +345,9 @@ void open_softirq(int nr, void (*action)(struct softirq_action *))
345 softirq_vec[nr].action = action; 345 softirq_vec[nr].action = action;
346} 346}
347 347
348/* Tasklets */ 348/*
349 * Tasklets
350 */
349struct tasklet_head 351struct tasklet_head
350{ 352{
351 struct tasklet_struct *head; 353 struct tasklet_struct *head;
@@ -493,6 +495,66 @@ void tasklet_kill(struct tasklet_struct *t)
493 495
494EXPORT_SYMBOL(tasklet_kill); 496EXPORT_SYMBOL(tasklet_kill);
495 497
498/*
499 * tasklet_hrtimer
500 */
501
502/*
503 * The trampoline is called when the hrtimer expires. If this is
504 * called from the hrtimer interrupt then we schedule the tasklet as
505 * the timer callback function expects to run in softirq context. If
506 * it's called in softirq context anyway (i.e. high resolution timers
507 * disabled) then the hrtimer callback is called right away.
508 */
509static enum hrtimer_restart __hrtimer_tasklet_trampoline(struct hrtimer *timer)
510{
511 struct tasklet_hrtimer *ttimer =
512 container_of(timer, struct tasklet_hrtimer, timer);
513
514 if (hrtimer_is_hres_active(timer)) {
515 tasklet_hi_schedule(&ttimer->tasklet);
516 return HRTIMER_NORESTART;
517 }
518 return ttimer->function(timer);
519}
520
521/*
522 * Helper function which calls the hrtimer callback from
523 * tasklet/softirq context
524 */
525static void __tasklet_hrtimer_trampoline(unsigned long data)
526{
527 struct tasklet_hrtimer *ttimer = (void *)data;
528 enum hrtimer_restart restart;
529
530 restart = ttimer->function(&ttimer->timer);
531 if (restart != HRTIMER_NORESTART)
532 hrtimer_restart(&ttimer->timer);
533}
534
535/**
536 * tasklet_hrtimer_init - Init a tasklet/hrtimer combo for softirq callbacks
537 * @ttimer: tasklet_hrtimer which is initialized
538 * @function: hrtimer callback funtion which gets called from softirq context
539 * @which_clock: clock id (CLOCK_MONOTONIC/CLOCK_REALTIME)
540 * @mode: hrtimer mode (HRTIMER_MODE_ABS/HRTIMER_MODE_REL)
541 */
542void tasklet_hrtimer_init(struct tasklet_hrtimer *ttimer,
543 enum hrtimer_restart (*function)(struct hrtimer *),
544 clockid_t which_clock, enum hrtimer_mode mode)
545{
546 hrtimer_init(&ttimer->timer, which_clock, mode);
547 ttimer->timer.function = __hrtimer_tasklet_trampoline;
548 tasklet_init(&ttimer->tasklet, __tasklet_hrtimer_trampoline,
549 (unsigned long)ttimer);
550 ttimer->function = function;
551}
552EXPORT_SYMBOL_GPL(tasklet_hrtimer_init);
553
554/*
555 * Remote softirq bits
556 */
557
496DEFINE_PER_CPU(struct list_head [NR_SOFTIRQS], softirq_work_list); 558DEFINE_PER_CPU(struct list_head [NR_SOFTIRQS], softirq_work_list);
497EXPORT_PER_CPU_SYMBOL(softirq_work_list); 559EXPORT_PER_CPU_SYMBOL(softirq_work_list);
498 560
diff --git a/kernel/sysctl.c b/kernel/sysctl.c
index 62e4ff9968b5..98e02328c67d 100644
--- a/kernel/sysctl.c
+++ b/kernel/sysctl.c
@@ -335,7 +335,10 @@ static struct ctl_table kern_table[] = {
335 .data = &sysctl_timer_migration, 335 .data = &sysctl_timer_migration,
336 .maxlen = sizeof(unsigned int), 336 .maxlen = sizeof(unsigned int),
337 .mode = 0644, 337 .mode = 0644,
338 .proc_handler = &proc_dointvec, 338 .proc_handler = &proc_dointvec_minmax,
339 .strategy = &sysctl_intvec,
340 .extra1 = &zero,
341 .extra2 = &one,
339 }, 342 },
340#endif 343#endif
341 { 344 {
@@ -744,6 +747,14 @@ static struct ctl_table kern_table[] = {
744 .proc_handler = &proc_dointvec, 747 .proc_handler = &proc_dointvec,
745 }, 748 },
746 { 749 {
750 .ctl_name = CTL_UNNUMBERED,
751 .procname = "panic_on_io_nmi",
752 .data = &panic_on_io_nmi,
753 .maxlen = sizeof(int),
754 .mode = 0644,
755 .proc_handler = &proc_dointvec,
756 },
757 {
747 .ctl_name = KERN_BOOTLOADER_TYPE, 758 .ctl_name = KERN_BOOTLOADER_TYPE,
748 .procname = "bootloader_type", 759 .procname = "bootloader_type",
749 .data = &bootloader_type, 760 .data = &bootloader_type,
diff --git a/kernel/time/clockevents.c b/kernel/time/clockevents.c
index 1ad6dd461119..a6dcd67b041d 100644
--- a/kernel/time/clockevents.c
+++ b/kernel/time/clockevents.c
@@ -254,15 +254,4 @@ void clockevents_notify(unsigned long reason, void *arg)
254 spin_unlock(&clockevents_lock); 254 spin_unlock(&clockevents_lock);
255} 255}
256EXPORT_SYMBOL_GPL(clockevents_notify); 256EXPORT_SYMBOL_GPL(clockevents_notify);
257
258ktime_t clockevents_get_next_event(int cpu)
259{
260 struct tick_device *td;
261 struct clock_event_device *dev;
262
263 td = &per_cpu(tick_cpu_device, cpu);
264 dev = td->evtdev;
265
266 return dev->next_event;
267}
268#endif 257#endif
diff --git a/kernel/time/clocksource.c b/kernel/time/clocksource.c
index 592bf584d1d2..7466cb811251 100644
--- a/kernel/time/clocksource.c
+++ b/kernel/time/clocksource.c
@@ -513,7 +513,7 @@ static ssize_t sysfs_override_clocksource(struct sys_device *dev,
513 * Check to make sure we don't switch to a non-highres capable 513 * Check to make sure we don't switch to a non-highres capable
514 * clocksource if the tick code is in oneshot mode (highres or nohz) 514 * clocksource if the tick code is in oneshot mode (highres or nohz)
515 */ 515 */
516 if (tick_oneshot_mode_active() && 516 if (tick_oneshot_mode_active() && ovr &&
517 !(ovr->flags & CLOCK_SOURCE_VALID_FOR_HRES)) { 517 !(ovr->flags & CLOCK_SOURCE_VALID_FOR_HRES)) {
518 printk(KERN_WARNING "%s clocksource is not HRT compatible. " 518 printk(KERN_WARNING "%s clocksource is not HRT compatible. "
519 "Cannot switch while in HRT/NOHZ mode\n", ovr->name); 519 "Cannot switch while in HRT/NOHZ mode\n", ovr->name);
diff --git a/kernel/time/timer_stats.c b/kernel/time/timer_stats.c
index c994530d166d..4cde8b9c716f 100644
--- a/kernel/time/timer_stats.c
+++ b/kernel/time/timer_stats.c
@@ -96,7 +96,7 @@ static DEFINE_MUTEX(show_mutex);
96/* 96/*
97 * Collection status, active/inactive: 97 * Collection status, active/inactive:
98 */ 98 */
99static int __read_mostly active; 99int __read_mostly timer_stats_active;
100 100
101/* 101/*
102 * Beginning/end timestamps of measurement: 102 * Beginning/end timestamps of measurement:
@@ -242,7 +242,7 @@ void timer_stats_update_stats(void *timer, pid_t pid, void *startf,
242 struct entry *entry, input; 242 struct entry *entry, input;
243 unsigned long flags; 243 unsigned long flags;
244 244
245 if (likely(!active)) 245 if (likely(!timer_stats_active))
246 return; 246 return;
247 247
248 lock = &per_cpu(lookup_lock, raw_smp_processor_id()); 248 lock = &per_cpu(lookup_lock, raw_smp_processor_id());
@@ -254,7 +254,7 @@ void timer_stats_update_stats(void *timer, pid_t pid, void *startf,
254 input.timer_flag = timer_flag; 254 input.timer_flag = timer_flag;
255 255
256 spin_lock_irqsave(lock, flags); 256 spin_lock_irqsave(lock, flags);
257 if (!active) 257 if (!timer_stats_active)
258 goto out_unlock; 258 goto out_unlock;
259 259
260 entry = tstat_lookup(&input, comm); 260 entry = tstat_lookup(&input, comm);
@@ -290,7 +290,7 @@ static int tstats_show(struct seq_file *m, void *v)
290 /* 290 /*
291 * If still active then calculate up to now: 291 * If still active then calculate up to now:
292 */ 292 */
293 if (active) 293 if (timer_stats_active)
294 time_stop = ktime_get(); 294 time_stop = ktime_get();
295 295
296 time = ktime_sub(time_stop, time_start); 296 time = ktime_sub(time_stop, time_start);
@@ -368,18 +368,18 @@ static ssize_t tstats_write(struct file *file, const char __user *buf,
368 mutex_lock(&show_mutex); 368 mutex_lock(&show_mutex);
369 switch (ctl[0]) { 369 switch (ctl[0]) {
370 case '0': 370 case '0':
371 if (active) { 371 if (timer_stats_active) {
372 active = 0; 372 timer_stats_active = 0;
373 time_stop = ktime_get(); 373 time_stop = ktime_get();
374 sync_access(); 374 sync_access();
375 } 375 }
376 break; 376 break;
377 case '1': 377 case '1':
378 if (!active) { 378 if (!timer_stats_active) {
379 reset_entries(); 379 reset_entries();
380 time_start = ktime_get(); 380 time_start = ktime_get();
381 smp_mb(); 381 smp_mb();
382 active = 1; 382 timer_stats_active = 1;
383 } 383 }
384 break; 384 break;
385 default: 385 default:
diff --git a/kernel/timer.c b/kernel/timer.c
index 54d3912f8cad..a7f07d5a6241 100644
--- a/kernel/timer.c
+++ b/kernel/timer.c
@@ -380,6 +380,8 @@ static void timer_stats_account_timer(struct timer_list *timer)
380{ 380{
381 unsigned int flag = 0; 381 unsigned int flag = 0;
382 382
383 if (likely(!timer->start_site))
384 return;
383 if (unlikely(tbase_get_deferrable(timer->base))) 385 if (unlikely(tbase_get_deferrable(timer->base)))
384 flag |= TIMER_STATS_FLAG_DEFERRABLE; 386 flag |= TIMER_STATS_FLAG_DEFERRABLE;
385 387
@@ -712,7 +714,7 @@ int mod_timer(struct timer_list *timer, unsigned long expires)
712 * networking code - if the timer is re-modified 714 * networking code - if the timer is re-modified
713 * to be the same thing then just return: 715 * to be the same thing then just return:
714 */ 716 */
715 if (timer->expires == expires && timer_pending(timer)) 717 if (timer_pending(timer) && timer->expires == expires)
716 return 1; 718 return 1;
717 719
718 return __mod_timer(timer, expires, false, TIMER_NOT_PINNED); 720 return __mod_timer(timer, expires, false, TIMER_NOT_PINNED);
diff --git a/kernel/trace/Kconfig b/kernel/trace/Kconfig
index 1551f47e7669..019f380fd764 100644
--- a/kernel/trace/Kconfig
+++ b/kernel/trace/Kconfig
@@ -226,13 +226,13 @@ config BOOT_TRACER
226 the timings of the initcalls and traces key events and the identity 226 the timings of the initcalls and traces key events and the identity
227 of tasks that can cause boot delays, such as context-switches. 227 of tasks that can cause boot delays, such as context-switches.
228 228
229 Its aim is to be parsed by the /scripts/bootgraph.pl tool to 229 Its aim is to be parsed by the scripts/bootgraph.pl tool to
230 produce pretty graphics about boot inefficiencies, giving a visual 230 produce pretty graphics about boot inefficiencies, giving a visual
231 representation of the delays during initcalls - but the raw 231 representation of the delays during initcalls - but the raw
232 /debug/tracing/trace text output is readable too. 232 /debug/tracing/trace text output is readable too.
233 233
234 You must pass in ftrace=initcall to the kernel command line 234 You must pass in initcall_debug and ftrace=initcall to the kernel
235 to enable this on bootup. 235 command line to enable this on bootup.
236 236
237config TRACE_BRANCH_PROFILING 237config TRACE_BRANCH_PROFILING
238 bool 238 bool
diff --git a/kernel/trace/blktrace.c b/kernel/trace/blktrace.c
index 39af8af6fc30..1090b0aed9ba 100644
--- a/kernel/trace/blktrace.c
+++ b/kernel/trace/blktrace.c
@@ -22,6 +22,7 @@
22#include <linux/init.h> 22#include <linux/init.h>
23#include <linux/mutex.h> 23#include <linux/mutex.h>
24#include <linux/debugfs.h> 24#include <linux/debugfs.h>
25#include <linux/smp_lock.h>
25#include <linux/time.h> 26#include <linux/time.h>
26#include <linux/uaccess.h> 27#include <linux/uaccess.h>
27 28
diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
index 3718d55fb4c3..1e1d23c26308 100644
--- a/kernel/trace/ftrace.c
+++ b/kernel/trace/ftrace.c
@@ -291,7 +291,9 @@ function_stat_next(void *v, int idx)
291 pg = (struct ftrace_profile_page *)((unsigned long)rec & PAGE_MASK); 291 pg = (struct ftrace_profile_page *)((unsigned long)rec & PAGE_MASK);
292 292
293 again: 293 again:
294 rec++; 294 if (idx != 0)
295 rec++;
296
295 if ((void *)rec >= (void *)&pg->records[pg->index]) { 297 if ((void *)rec >= (void *)&pg->records[pg->index]) {
296 pg = pg->next; 298 pg = pg->next;
297 if (!pg) 299 if (!pg)
@@ -766,7 +768,7 @@ static struct tracer_stat function_stats __initdata = {
766 .stat_show = function_stat_show 768 .stat_show = function_stat_show
767}; 769};
768 770
769static void ftrace_profile_debugfs(struct dentry *d_tracer) 771static __init void ftrace_profile_debugfs(struct dentry *d_tracer)
770{ 772{
771 struct ftrace_profile_stat *stat; 773 struct ftrace_profile_stat *stat;
772 struct dentry *entry; 774 struct dentry *entry;
@@ -784,7 +786,6 @@ static void ftrace_profile_debugfs(struct dentry *d_tracer)
784 * The files created are permanent, if something happens 786 * The files created are permanent, if something happens
785 * we still do not free memory. 787 * we still do not free memory.
786 */ 788 */
787 kfree(stat);
788 WARN(1, 789 WARN(1,
789 "Could not allocate stat file for cpu %d\n", 790 "Could not allocate stat file for cpu %d\n",
790 cpu); 791 cpu);
@@ -811,7 +812,7 @@ static void ftrace_profile_debugfs(struct dentry *d_tracer)
811} 812}
812 813
813#else /* CONFIG_FUNCTION_PROFILER */ 814#else /* CONFIG_FUNCTION_PROFILER */
814static void ftrace_profile_debugfs(struct dentry *d_tracer) 815static __init void ftrace_profile_debugfs(struct dentry *d_tracer)
815{ 816{
816} 817}
817#endif /* CONFIG_FUNCTION_PROFILER */ 818#endif /* CONFIG_FUNCTION_PROFILER */
@@ -1417,10 +1418,20 @@ static void *t_hash_start(struct seq_file *m, loff_t *pos)
1417{ 1418{
1418 struct ftrace_iterator *iter = m->private; 1419 struct ftrace_iterator *iter = m->private;
1419 void *p = NULL; 1420 void *p = NULL;
1421 loff_t l;
1422
1423 if (!(iter->flags & FTRACE_ITER_HASH))
1424 *pos = 0;
1420 1425
1421 iter->flags |= FTRACE_ITER_HASH; 1426 iter->flags |= FTRACE_ITER_HASH;
1422 1427
1423 return t_hash_next(m, p, pos); 1428 iter->hidx = 0;
1429 for (l = 0; l <= *pos; ) {
1430 p = t_hash_next(m, p, &l);
1431 if (!p)
1432 break;
1433 }
1434 return p;
1424} 1435}
1425 1436
1426static int t_hash_show(struct seq_file *m, void *v) 1437static int t_hash_show(struct seq_file *m, void *v)
@@ -1467,8 +1478,6 @@ t_next(struct seq_file *m, void *v, loff_t *pos)
1467 iter->pg = iter->pg->next; 1478 iter->pg = iter->pg->next;
1468 iter->idx = 0; 1479 iter->idx = 0;
1469 goto retry; 1480 goto retry;
1470 } else {
1471 iter->idx = -1;
1472 } 1481 }
1473 } else { 1482 } else {
1474 rec = &iter->pg->records[iter->idx++]; 1483 rec = &iter->pg->records[iter->idx++];
@@ -1497,6 +1506,7 @@ static void *t_start(struct seq_file *m, loff_t *pos)
1497{ 1506{
1498 struct ftrace_iterator *iter = m->private; 1507 struct ftrace_iterator *iter = m->private;
1499 void *p = NULL; 1508 void *p = NULL;
1509 loff_t l;
1500 1510
1501 mutex_lock(&ftrace_lock); 1511 mutex_lock(&ftrace_lock);
1502 /* 1512 /*
@@ -1508,23 +1518,21 @@ static void *t_start(struct seq_file *m, loff_t *pos)
1508 if (*pos > 0) 1518 if (*pos > 0)
1509 return t_hash_start(m, pos); 1519 return t_hash_start(m, pos);
1510 iter->flags |= FTRACE_ITER_PRINTALL; 1520 iter->flags |= FTRACE_ITER_PRINTALL;
1511 (*pos)++;
1512 return iter; 1521 return iter;
1513 } 1522 }
1514 1523
1515 if (iter->flags & FTRACE_ITER_HASH) 1524 if (iter->flags & FTRACE_ITER_HASH)
1516 return t_hash_start(m, pos); 1525 return t_hash_start(m, pos);
1517 1526
1518 if (*pos > 0) { 1527 iter->pg = ftrace_pages_start;
1519 if (iter->idx < 0) 1528 iter->idx = 0;
1520 return p; 1529 for (l = 0; l <= *pos; ) {
1521 (*pos)--; 1530 p = t_next(m, p, &l);
1522 iter->idx--; 1531 if (!p)
1532 break;
1523 } 1533 }
1524 1534
1525 p = t_next(m, p, pos); 1535 if (!p && iter->flags & FTRACE_ITER_FILTER)
1526
1527 if (!p)
1528 return t_hash_start(m, pos); 1536 return t_hash_start(m, pos);
1529 1537
1530 return p; 1538 return p;
@@ -1654,7 +1662,7 @@ ftrace_regex_open(struct inode *inode, struct file *file, int enable)
1654 1662
1655 mutex_lock(&ftrace_regex_lock); 1663 mutex_lock(&ftrace_regex_lock);
1656 if ((file->f_mode & FMODE_WRITE) && 1664 if ((file->f_mode & FMODE_WRITE) &&
1657 !(file->f_flags & O_APPEND)) 1665 (file->f_flags & O_TRUNC))
1658 ftrace_filter_reset(enable); 1666 ftrace_filter_reset(enable);
1659 1667
1660 if (file->f_mode & FMODE_READ) { 1668 if (file->f_mode & FMODE_READ) {
@@ -2500,32 +2508,31 @@ int ftrace_graph_count;
2500unsigned long ftrace_graph_funcs[FTRACE_GRAPH_MAX_FUNCS] __read_mostly; 2508unsigned long ftrace_graph_funcs[FTRACE_GRAPH_MAX_FUNCS] __read_mostly;
2501 2509
2502static void * 2510static void *
2503g_next(struct seq_file *m, void *v, loff_t *pos) 2511__g_next(struct seq_file *m, loff_t *pos)
2504{ 2512{
2505 unsigned long *array = m->private; 2513 unsigned long *array = m->private;
2506 int index = *pos;
2507
2508 (*pos)++;
2509 2514
2510 if (index >= ftrace_graph_count) 2515 if (*pos >= ftrace_graph_count)
2511 return NULL; 2516 return NULL;
2517 return &array[*pos];
2518}
2512 2519
2513 return &array[index]; 2520static void *
2521g_next(struct seq_file *m, void *v, loff_t *pos)
2522{
2523 (*pos)++;
2524 return __g_next(m, pos);
2514} 2525}
2515 2526
2516static void *g_start(struct seq_file *m, loff_t *pos) 2527static void *g_start(struct seq_file *m, loff_t *pos)
2517{ 2528{
2518 void *p = NULL;
2519
2520 mutex_lock(&graph_lock); 2529 mutex_lock(&graph_lock);
2521 2530
2522 /* Nothing, tell g_show to print all functions are enabled */ 2531 /* Nothing, tell g_show to print all functions are enabled */
2523 if (!ftrace_graph_count && !*pos) 2532 if (!ftrace_graph_count && !*pos)
2524 return (void *)1; 2533 return (void *)1;
2525 2534
2526 p = g_next(m, p, pos); 2535 return __g_next(m, pos);
2527
2528 return p;
2529} 2536}
2530 2537
2531static void g_stop(struct seq_file *m, void *p) 2538static void g_stop(struct seq_file *m, void *p)
@@ -2570,7 +2577,7 @@ ftrace_graph_open(struct inode *inode, struct file *file)
2570 2577
2571 mutex_lock(&graph_lock); 2578 mutex_lock(&graph_lock);
2572 if ((file->f_mode & FMODE_WRITE) && 2579 if ((file->f_mode & FMODE_WRITE) &&
2573 !(file->f_flags & O_APPEND)) { 2580 (file->f_flags & O_TRUNC)) {
2574 ftrace_graph_count = 0; 2581 ftrace_graph_count = 0;
2575 memset(ftrace_graph_funcs, 0, sizeof(ftrace_graph_funcs)); 2582 memset(ftrace_graph_funcs, 0, sizeof(ftrace_graph_funcs));
2576 } 2583 }
@@ -2589,6 +2596,14 @@ ftrace_graph_open(struct inode *inode, struct file *file)
2589} 2596}
2590 2597
2591static int 2598static int
2599ftrace_graph_release(struct inode *inode, struct file *file)
2600{
2601 if (file->f_mode & FMODE_READ)
2602 seq_release(inode, file);
2603 return 0;
2604}
2605
2606static int
2592ftrace_set_func(unsigned long *array, int *idx, char *buffer) 2607ftrace_set_func(unsigned long *array, int *idx, char *buffer)
2593{ 2608{
2594 struct dyn_ftrace *rec; 2609 struct dyn_ftrace *rec;
@@ -2717,9 +2732,10 @@ ftrace_graph_write(struct file *file, const char __user *ubuf,
2717} 2732}
2718 2733
2719static const struct file_operations ftrace_graph_fops = { 2734static const struct file_operations ftrace_graph_fops = {
2720 .open = ftrace_graph_open, 2735 .open = ftrace_graph_open,
2721 .read = seq_read, 2736 .read = seq_read,
2722 .write = ftrace_graph_write, 2737 .write = ftrace_graph_write,
2738 .release = ftrace_graph_release,
2723}; 2739};
2724#endif /* CONFIG_FUNCTION_GRAPH_TRACER */ 2740#endif /* CONFIG_FUNCTION_GRAPH_TRACER */
2725 2741
@@ -3152,10 +3168,10 @@ ftrace_enable_sysctl(struct ctl_table *table, int write,
3152 3168
3153 ret = proc_dointvec(table, write, file, buffer, lenp, ppos); 3169 ret = proc_dointvec(table, write, file, buffer, lenp, ppos);
3154 3170
3155 if (ret || !write || (last_ftrace_enabled == ftrace_enabled)) 3171 if (ret || !write || (last_ftrace_enabled == !!ftrace_enabled))
3156 goto out; 3172 goto out;
3157 3173
3158 last_ftrace_enabled = ftrace_enabled; 3174 last_ftrace_enabled = !!ftrace_enabled;
3159 3175
3160 if (ftrace_enabled) { 3176 if (ftrace_enabled) {
3161 3177
diff --git a/kernel/trace/ring_buffer.c b/kernel/trace/ring_buffer.c
index 04dac2638258..a330513d96ce 100644
--- a/kernel/trace/ring_buffer.c
+++ b/kernel/trace/ring_buffer.c
@@ -735,6 +735,7 @@ ring_buffer_free(struct ring_buffer *buffer)
735 735
736 put_online_cpus(); 736 put_online_cpus();
737 737
738 kfree(buffer->buffers);
738 free_cpumask_var(buffer->cpumask); 739 free_cpumask_var(buffer->cpumask);
739 740
740 kfree(buffer); 741 kfree(buffer);
@@ -1563,6 +1564,8 @@ rb_reserve_next_event(struct ring_buffer_per_cpu *cpu_buffer,
1563 return NULL; 1564 return NULL;
1564} 1565}
1565 1566
1567#ifdef CONFIG_TRACING
1568
1566#define TRACE_RECURSIVE_DEPTH 16 1569#define TRACE_RECURSIVE_DEPTH 16
1567 1570
1568static int trace_recursive_lock(void) 1571static int trace_recursive_lock(void)
@@ -1593,6 +1596,13 @@ static void trace_recursive_unlock(void)
1593 current->trace_recursion--; 1596 current->trace_recursion--;
1594} 1597}
1595 1598
1599#else
1600
1601#define trace_recursive_lock() (0)
1602#define trace_recursive_unlock() do { } while (0)
1603
1604#endif
1605
1596static DEFINE_PER_CPU(int, rb_need_resched); 1606static DEFINE_PER_CPU(int, rb_need_resched);
1597 1607
1598/** 1608/**
@@ -1776,7 +1786,7 @@ void ring_buffer_discard_commit(struct ring_buffer *buffer,
1776 */ 1786 */
1777 RB_WARN_ON(buffer, !local_read(&cpu_buffer->committing)); 1787 RB_WARN_ON(buffer, !local_read(&cpu_buffer->committing));
1778 1788
1779 if (!rb_try_to_discard(cpu_buffer, event)) 1789 if (rb_try_to_discard(cpu_buffer, event))
1780 goto out; 1790 goto out;
1781 1791
1782 /* 1792 /*
@@ -2374,7 +2384,6 @@ rb_buffer_peek(struct ring_buffer *buffer, int cpu, u64 *ts)
2374 * the box. Return the padding, and we will release 2384 * the box. Return the padding, and we will release
2375 * the current locks, and try again. 2385 * the current locks, and try again.
2376 */ 2386 */
2377 rb_advance_reader(cpu_buffer);
2378 return event; 2387 return event;
2379 2388
2380 case RINGBUF_TYPE_TIME_EXTEND: 2389 case RINGBUF_TYPE_TIME_EXTEND:
@@ -2477,7 +2486,7 @@ static inline int rb_ok_to_lock(void)
2477 * buffer too. A one time deal is all you get from reading 2486 * buffer too. A one time deal is all you get from reading
2478 * the ring buffer from an NMI. 2487 * the ring buffer from an NMI.
2479 */ 2488 */
2480 if (likely(!in_nmi() && !oops_in_progress)) 2489 if (likely(!in_nmi()))
2481 return 1; 2490 return 1;
2482 2491
2483 tracing_off_permanent(); 2492 tracing_off_permanent();
@@ -2510,6 +2519,8 @@ ring_buffer_peek(struct ring_buffer *buffer, int cpu, u64 *ts)
2510 if (dolock) 2519 if (dolock)
2511 spin_lock(&cpu_buffer->reader_lock); 2520 spin_lock(&cpu_buffer->reader_lock);
2512 event = rb_buffer_peek(buffer, cpu, ts); 2521 event = rb_buffer_peek(buffer, cpu, ts);
2522 if (event && event->type_len == RINGBUF_TYPE_PADDING)
2523 rb_advance_reader(cpu_buffer);
2513 if (dolock) 2524 if (dolock)
2514 spin_unlock(&cpu_buffer->reader_lock); 2525 spin_unlock(&cpu_buffer->reader_lock);
2515 local_irq_restore(flags); 2526 local_irq_restore(flags);
@@ -2581,12 +2592,9 @@ ring_buffer_consume(struct ring_buffer *buffer, int cpu, u64 *ts)
2581 spin_lock(&cpu_buffer->reader_lock); 2592 spin_lock(&cpu_buffer->reader_lock);
2582 2593
2583 event = rb_buffer_peek(buffer, cpu, ts); 2594 event = rb_buffer_peek(buffer, cpu, ts);
2584 if (!event) 2595 if (event)
2585 goto out_unlock; 2596 rb_advance_reader(cpu_buffer);
2586
2587 rb_advance_reader(cpu_buffer);
2588 2597
2589 out_unlock:
2590 if (dolock) 2598 if (dolock)
2591 spin_unlock(&cpu_buffer->reader_lock); 2599 spin_unlock(&cpu_buffer->reader_lock);
2592 local_irq_restore(flags); 2600 local_irq_restore(flags);
@@ -3104,6 +3112,7 @@ int ring_buffer_read_page(struct ring_buffer *buffer,
3104} 3112}
3105EXPORT_SYMBOL_GPL(ring_buffer_read_page); 3113EXPORT_SYMBOL_GPL(ring_buffer_read_page);
3106 3114
3115#ifdef CONFIG_TRACING
3107static ssize_t 3116static ssize_t
3108rb_simple_read(struct file *filp, char __user *ubuf, 3117rb_simple_read(struct file *filp, char __user *ubuf,
3109 size_t cnt, loff_t *ppos) 3118 size_t cnt, loff_t *ppos)
@@ -3171,6 +3180,7 @@ static __init int rb_init_debugfs(void)
3171} 3180}
3172 3181
3173fs_initcall(rb_init_debugfs); 3182fs_initcall(rb_init_debugfs);
3183#endif
3174 3184
3175#ifdef CONFIG_HOTPLUG_CPU 3185#ifdef CONFIG_HOTPLUG_CPU
3176static int rb_cpu_notify(struct notifier_block *self, 3186static int rb_cpu_notify(struct notifier_block *self,
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
index 076fa6f0ee48..c22b40f8f576 100644
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -17,6 +17,7 @@
17#include <linux/writeback.h> 17#include <linux/writeback.h>
18#include <linux/kallsyms.h> 18#include <linux/kallsyms.h>
19#include <linux/seq_file.h> 19#include <linux/seq_file.h>
20#include <linux/smp_lock.h>
20#include <linux/notifier.h> 21#include <linux/notifier.h>
21#include <linux/irqflags.h> 22#include <linux/irqflags.h>
22#include <linux/debugfs.h> 23#include <linux/debugfs.h>
@@ -284,13 +285,12 @@ void trace_wake_up(void)
284static int __init set_buf_size(char *str) 285static int __init set_buf_size(char *str)
285{ 286{
286 unsigned long buf_size; 287 unsigned long buf_size;
287 int ret;
288 288
289 if (!str) 289 if (!str)
290 return 0; 290 return 0;
291 ret = strict_strtoul(str, 0, &buf_size); 291 buf_size = memparse(str, &str);
292 /* nr_entries can not be zero */ 292 /* nr_entries can not be zero */
293 if (ret < 0 || buf_size == 0) 293 if (buf_size == 0)
294 return 0; 294 return 0;
295 trace_buf_size = buf_size; 295 trace_buf_size = buf_size;
296 return 1; 296 return 1;
@@ -848,6 +848,7 @@ tracing_generic_entry_update(struct trace_entry *entry, unsigned long flags,
848 ((pc & SOFTIRQ_MASK) ? TRACE_FLAG_SOFTIRQ : 0) | 848 ((pc & SOFTIRQ_MASK) ? TRACE_FLAG_SOFTIRQ : 0) |
849 (need_resched() ? TRACE_FLAG_NEED_RESCHED : 0); 849 (need_resched() ? TRACE_FLAG_NEED_RESCHED : 0);
850} 850}
851EXPORT_SYMBOL_GPL(tracing_generic_entry_update);
851 852
852struct ring_buffer_event *trace_buffer_lock_reserve(struct trace_array *tr, 853struct ring_buffer_event *trace_buffer_lock_reserve(struct trace_array *tr,
853 int type, 854 int type,
@@ -2031,7 +2032,7 @@ static int tracing_open(struct inode *inode, struct file *file)
2031 2032
2032 /* If this file was open for write, then erase contents */ 2033 /* If this file was open for write, then erase contents */
2033 if ((file->f_mode & FMODE_WRITE) && 2034 if ((file->f_mode & FMODE_WRITE) &&
2034 !(file->f_flags & O_APPEND)) { 2035 (file->f_flags & O_TRUNC)) {
2035 long cpu = (long) inode->i_private; 2036 long cpu = (long) inode->i_private;
2036 2037
2037 if (cpu == TRACE_PIPE_ALL_CPU) 2038 if (cpu == TRACE_PIPE_ALL_CPU)
@@ -2053,25 +2054,23 @@ static int tracing_open(struct inode *inode, struct file *file)
2053static void * 2054static void *
2054t_next(struct seq_file *m, void *v, loff_t *pos) 2055t_next(struct seq_file *m, void *v, loff_t *pos)
2055{ 2056{
2056 struct tracer *t = m->private; 2057 struct tracer *t = v;
2057 2058
2058 (*pos)++; 2059 (*pos)++;
2059 2060
2060 if (t) 2061 if (t)
2061 t = t->next; 2062 t = t->next;
2062 2063
2063 m->private = t;
2064
2065 return t; 2064 return t;
2066} 2065}
2067 2066
2068static void *t_start(struct seq_file *m, loff_t *pos) 2067static void *t_start(struct seq_file *m, loff_t *pos)
2069{ 2068{
2070 struct tracer *t = m->private; 2069 struct tracer *t;
2071 loff_t l = 0; 2070 loff_t l = 0;
2072 2071
2073 mutex_lock(&trace_types_lock); 2072 mutex_lock(&trace_types_lock);
2074 for (; t && l < *pos; t = t_next(m, t, &l)) 2073 for (t = trace_types; t && l < *pos; t = t_next(m, t, &l))
2075 ; 2074 ;
2076 2075
2077 return t; 2076 return t;
@@ -2107,18 +2106,10 @@ static struct seq_operations show_traces_seq_ops = {
2107 2106
2108static int show_traces_open(struct inode *inode, struct file *file) 2107static int show_traces_open(struct inode *inode, struct file *file)
2109{ 2108{
2110 int ret;
2111
2112 if (tracing_disabled) 2109 if (tracing_disabled)
2113 return -ENODEV; 2110 return -ENODEV;
2114 2111
2115 ret = seq_open(file, &show_traces_seq_ops); 2112 return seq_open(file, &show_traces_seq_ops);
2116 if (!ret) {
2117 struct seq_file *m = file->private_data;
2118 m->private = trace_types;
2119 }
2120
2121 return ret;
2122} 2113}
2123 2114
2124static ssize_t 2115static ssize_t
@@ -3095,7 +3086,8 @@ tracing_fill_pipe_page(size_t rem, struct trace_iterator *iter)
3095 break; 3086 break;
3096 } 3087 }
3097 3088
3098 trace_consume(iter); 3089 if (ret != TRACE_TYPE_NO_CONSUME)
3090 trace_consume(iter);
3099 rem -= count; 3091 rem -= count;
3100 if (!find_next_entry_inc(iter)) { 3092 if (!find_next_entry_inc(iter)) {
3101 rem = 0; 3093 rem = 0;
@@ -4243,8 +4235,11 @@ static void __ftrace_dump(bool disable_tracing)
4243 iter.pos = -1; 4235 iter.pos = -1;
4244 4236
4245 if (find_next_entry_inc(&iter) != NULL) { 4237 if (find_next_entry_inc(&iter) != NULL) {
4246 print_trace_line(&iter); 4238 int ret;
4247 trace_consume(&iter); 4239
4240 ret = print_trace_line(&iter);
4241 if (ret != TRACE_TYPE_NO_CONSUME)
4242 trace_consume(&iter);
4248 } 4243 }
4249 4244
4250 trace_printk_seq(&iter.seq); 4245 trace_printk_seq(&iter.seq);
diff --git a/kernel/trace/trace.h b/kernel/trace/trace.h
index 6e735d4771f8..8b9f4f6e9559 100644
--- a/kernel/trace/trace.h
+++ b/kernel/trace/trace.h
@@ -438,10 +438,6 @@ struct trace_entry *tracing_get_trace_entry(struct trace_array *tr,
438struct trace_entry *trace_find_next_entry(struct trace_iterator *iter, 438struct trace_entry *trace_find_next_entry(struct trace_iterator *iter,
439 int *ent_cpu, u64 *ent_ts); 439 int *ent_cpu, u64 *ent_ts);
440 440
441void tracing_generic_entry_update(struct trace_entry *entry,
442 unsigned long flags,
443 int pc);
444
445void default_wait_pipe(struct trace_iterator *iter); 441void default_wait_pipe(struct trace_iterator *iter);
446void poll_wait_pipe(struct trace_iterator *iter); 442void poll_wait_pipe(struct trace_iterator *iter);
447 443
@@ -597,6 +593,7 @@ print_graph_function(struct trace_iterator *iter)
597 593
598extern struct pid *ftrace_pid_trace; 594extern struct pid *ftrace_pid_trace;
599 595
596#ifdef CONFIG_FUNCTION_TRACER
600static inline int ftrace_trace_task(struct task_struct *task) 597static inline int ftrace_trace_task(struct task_struct *task)
601{ 598{
602 if (!ftrace_pid_trace) 599 if (!ftrace_pid_trace)
@@ -604,6 +601,12 @@ static inline int ftrace_trace_task(struct task_struct *task)
604 601
605 return test_tsk_trace_trace(task); 602 return test_tsk_trace_trace(task);
606} 603}
604#else
605static inline int ftrace_trace_task(struct task_struct *task)
606{
607 return 1;
608}
609#endif
607 610
608/* 611/*
609 * trace_iterator_flags is an enumeration that defines bit 612 * trace_iterator_flags is an enumeration that defines bit
diff --git a/kernel/trace/trace_event_profile.c b/kernel/trace/trace_event_profile.c
index 5b5895afecfe..11ba5bb4ed0a 100644
--- a/kernel/trace/trace_event_profile.c
+++ b/kernel/trace/trace_event_profile.c
@@ -14,7 +14,7 @@ int ftrace_profile_enable(int event_id)
14 14
15 mutex_lock(&event_mutex); 15 mutex_lock(&event_mutex);
16 list_for_each_entry(event, &ftrace_events, list) { 16 list_for_each_entry(event, &ftrace_events, list) {
17 if (event->id == event_id) { 17 if (event->id == event_id && event->profile_enable) {
18 ret = event->profile_enable(event); 18 ret = event->profile_enable(event);
19 break; 19 break;
20 } 20 }
diff --git a/kernel/trace/trace_event_types.h b/kernel/trace/trace_event_types.h
index 5e32e375134d..6db005e12487 100644
--- a/kernel/trace/trace_event_types.h
+++ b/kernel/trace/trace_event_types.h
@@ -26,6 +26,9 @@ TRACE_EVENT_FORMAT(funcgraph_exit, TRACE_GRAPH_RET,
26 ftrace_graph_ret_entry, ignore, 26 ftrace_graph_ret_entry, ignore,
27 TRACE_STRUCT( 27 TRACE_STRUCT(
28 TRACE_FIELD(unsigned long, ret.func, func) 28 TRACE_FIELD(unsigned long, ret.func, func)
29 TRACE_FIELD(unsigned long long, ret.calltime, calltime)
30 TRACE_FIELD(unsigned long long, ret.rettime, rettime)
31 TRACE_FIELD(unsigned long, ret.overrun, overrun)
29 TRACE_FIELD(int, ret.depth, depth) 32 TRACE_FIELD(int, ret.depth, depth)
30 ), 33 ),
31 TP_RAW_FMT("<-- %lx (%d)") 34 TP_RAW_FMT("<-- %lx (%d)")
diff --git a/kernel/trace/trace_events.c b/kernel/trace/trace_events.c
index aa08be69a1b6..e75276a49cf5 100644
--- a/kernel/trace/trace_events.c
+++ b/kernel/trace/trace_events.c
@@ -300,10 +300,18 @@ t_next(struct seq_file *m, void *v, loff_t *pos)
300 300
301static void *t_start(struct seq_file *m, loff_t *pos) 301static void *t_start(struct seq_file *m, loff_t *pos)
302{ 302{
303 struct ftrace_event_call *call = NULL;
304 loff_t l;
305
303 mutex_lock(&event_mutex); 306 mutex_lock(&event_mutex);
304 if (*pos == 0) 307
305 m->private = ftrace_events.next; 308 m->private = ftrace_events.next;
306 return t_next(m, NULL, pos); 309 for (l = 0; l <= *pos; ) {
310 call = t_next(m, NULL, &l);
311 if (!call)
312 break;
313 }
314 return call;
307} 315}
308 316
309static void * 317static void *
@@ -332,10 +340,18 @@ s_next(struct seq_file *m, void *v, loff_t *pos)
332 340
333static void *s_start(struct seq_file *m, loff_t *pos) 341static void *s_start(struct seq_file *m, loff_t *pos)
334{ 342{
343 struct ftrace_event_call *call = NULL;
344 loff_t l;
345
335 mutex_lock(&event_mutex); 346 mutex_lock(&event_mutex);
336 if (*pos == 0) 347
337 m->private = ftrace_events.next; 348 m->private = ftrace_events.next;
338 return s_next(m, NULL, pos); 349 for (l = 0; l <= *pos; ) {
350 call = s_next(m, NULL, &l);
351 if (!call)
352 break;
353 }
354 return call;
339} 355}
340 356
341static int t_show(struct seq_file *m, void *v) 357static int t_show(struct seq_file *m, void *v)
@@ -360,7 +376,7 @@ ftrace_event_seq_open(struct inode *inode, struct file *file)
360 const struct seq_operations *seq_ops; 376 const struct seq_operations *seq_ops;
361 377
362 if ((file->f_mode & FMODE_WRITE) && 378 if ((file->f_mode & FMODE_WRITE) &&
363 !(file->f_flags & O_APPEND)) 379 (file->f_flags & O_TRUNC))
364 ftrace_clear_events(); 380 ftrace_clear_events();
365 381
366 seq_ops = inode->i_private; 382 seq_ops = inode->i_private;
@@ -924,7 +940,7 @@ event_create_dir(struct ftrace_event_call *call, struct dentry *d_events,
924 entry = trace_create_file("enable", 0644, call->dir, call, 940 entry = trace_create_file("enable", 0644, call->dir, call,
925 enable); 941 enable);
926 942
927 if (call->id) 943 if (call->id && call->profile_enable)
928 entry = trace_create_file("id", 0444, call->dir, call, 944 entry = trace_create_file("id", 0444, call->dir, call,
929 id); 945 id);
930 946
diff --git a/kernel/trace/trace_events_filter.c b/kernel/trace/trace_events_filter.c
index 936c621bbf46..f32dc9d1ea7b 100644
--- a/kernel/trace/trace_events_filter.c
+++ b/kernel/trace/trace_events_filter.c
@@ -624,9 +624,6 @@ static int filter_add_subsystem_pred(struct filter_parse_state *ps,
624 return -ENOSPC; 624 return -ENOSPC;
625 } 625 }
626 626
627 filter->preds[filter->n_preds] = pred;
628 filter->n_preds++;
629
630 list_for_each_entry(call, &ftrace_events, list) { 627 list_for_each_entry(call, &ftrace_events, list) {
631 628
632 if (!call->define_fields) 629 if (!call->define_fields)
@@ -643,6 +640,9 @@ static int filter_add_subsystem_pred(struct filter_parse_state *ps,
643 } 640 }
644 replace_filter_string(call->filter, filter_string); 641 replace_filter_string(call->filter, filter_string);
645 } 642 }
643
644 filter->preds[filter->n_preds] = pred;
645 filter->n_preds++;
646out: 646out:
647 return err; 647 return err;
648} 648}
@@ -1029,12 +1029,17 @@ static int replace_preds(struct event_subsystem *system,
1029 1029
1030 if (elt->op == OP_AND || elt->op == OP_OR) { 1030 if (elt->op == OP_AND || elt->op == OP_OR) {
1031 pred = create_logical_pred(elt->op); 1031 pred = create_logical_pred(elt->op);
1032 if (!pred)
1033 return -ENOMEM;
1032 if (call) { 1034 if (call) {
1033 err = filter_add_pred(ps, call, pred); 1035 err = filter_add_pred(ps, call, pred);
1034 filter_free_pred(pred); 1036 filter_free_pred(pred);
1035 } else 1037 } else {
1036 err = filter_add_subsystem_pred(ps, system, 1038 err = filter_add_subsystem_pred(ps, system,
1037 pred, filter_string); 1039 pred, filter_string);
1040 if (err)
1041 filter_free_pred(pred);
1042 }
1038 if (err) 1043 if (err)
1039 return err; 1044 return err;
1040 1045
@@ -1048,12 +1053,17 @@ static int replace_preds(struct event_subsystem *system,
1048 } 1053 }
1049 1054
1050 pred = create_pred(elt->op, operand1, operand2); 1055 pred = create_pred(elt->op, operand1, operand2);
1056 if (!pred)
1057 return -ENOMEM;
1051 if (call) { 1058 if (call) {
1052 err = filter_add_pred(ps, call, pred); 1059 err = filter_add_pred(ps, call, pred);
1053 filter_free_pred(pred); 1060 filter_free_pred(pred);
1054 } else 1061 } else {
1055 err = filter_add_subsystem_pred(ps, system, pred, 1062 err = filter_add_subsystem_pred(ps, system, pred,
1056 filter_string); 1063 filter_string);
1064 if (err)
1065 filter_free_pred(pred);
1066 }
1057 if (err) 1067 if (err)
1058 return err; 1068 return err;
1059 1069
diff --git a/kernel/trace/trace_functions.c b/kernel/trace/trace_functions.c
index 90f134764837..75ef000613c3 100644
--- a/kernel/trace/trace_functions.c
+++ b/kernel/trace/trace_functions.c
@@ -302,8 +302,7 @@ ftrace_trace_onoff_print(struct seq_file *m, unsigned long ip,
302 if (count == -1) 302 if (count == -1)
303 seq_printf(m, ":unlimited\n"); 303 seq_printf(m, ":unlimited\n");
304 else 304 else
305 seq_printf(m, ":count=%ld", count); 305 seq_printf(m, ":count=%ld\n", count);
306 seq_putc(m, '\n');
307 306
308 return 0; 307 return 0;
309} 308}
@@ -364,7 +363,7 @@ ftrace_trace_onoff_callback(char *glob, char *cmd, char *param, int enable)
364 out_reg: 363 out_reg:
365 ret = register_ftrace_function_probe(glob, ops, count); 364 ret = register_ftrace_function_probe(glob, ops, count);
366 365
367 return ret; 366 return ret < 0 ? ret : 0;
368} 367}
369 368
370static struct ftrace_func_command ftrace_traceon_cmd = { 369static struct ftrace_func_command ftrace_traceon_cmd = {
diff --git a/kernel/trace/trace_functions_graph.c b/kernel/trace/trace_functions_graph.c
index d2249abafb53..420ec3487579 100644
--- a/kernel/trace/trace_functions_graph.c
+++ b/kernel/trace/trace_functions_graph.c
@@ -843,9 +843,16 @@ print_graph_function(struct trace_iterator *iter)
843 843
844 switch (entry->type) { 844 switch (entry->type) {
845 case TRACE_GRAPH_ENT: { 845 case TRACE_GRAPH_ENT: {
846 struct ftrace_graph_ent_entry *field; 846 /*
847 * print_graph_entry() may consume the current event,
848 * thus @field may become invalid, so we need to save it.
849 * sizeof(struct ftrace_graph_ent_entry) is very small,
850 * it can be safely saved at the stack.
851 */
852 struct ftrace_graph_ent_entry *field, saved;
847 trace_assign_type(field, entry); 853 trace_assign_type(field, entry);
848 return print_graph_entry(field, s, iter); 854 saved = *field;
855 return print_graph_entry(&saved, s, iter);
849 } 856 }
850 case TRACE_GRAPH_RET: { 857 case TRACE_GRAPH_RET: {
851 struct ftrace_graph_ret_entry *field; 858 struct ftrace_graph_ret_entry *field;
diff --git a/kernel/trace/trace_output.c b/kernel/trace/trace_output.c
index 7938f3ae93e3..e0c2545622e8 100644
--- a/kernel/trace/trace_output.c
+++ b/kernel/trace/trace_output.c
@@ -27,8 +27,7 @@ void trace_print_seq(struct seq_file *m, struct trace_seq *s)
27{ 27{
28 int len = s->len >= PAGE_SIZE ? PAGE_SIZE - 1 : s->len; 28 int len = s->len >= PAGE_SIZE ? PAGE_SIZE - 1 : s->len;
29 29
30 s->buffer[len] = 0; 30 seq_write(m, s->buffer, len);
31 seq_puts(m, s->buffer);
32 31
33 trace_seq_init(s); 32 trace_seq_init(s);
34} 33}
diff --git a/kernel/trace/trace_printk.c b/kernel/trace/trace_printk.c
index 9bece9687b62..687699d365ae 100644
--- a/kernel/trace/trace_printk.c
+++ b/kernel/trace/trace_printk.c
@@ -155,25 +155,19 @@ int __ftrace_vprintk(unsigned long ip, const char *fmt, va_list ap)
155EXPORT_SYMBOL_GPL(__ftrace_vprintk); 155EXPORT_SYMBOL_GPL(__ftrace_vprintk);
156 156
157static void * 157static void *
158t_next(struct seq_file *m, void *v, loff_t *pos) 158t_start(struct seq_file *m, loff_t *pos)
159{ 159{
160 const char **fmt = m->private; 160 const char **fmt = __start___trace_bprintk_fmt + *pos;
161 const char **next = fmt;
162
163 (*pos)++;
164 161
165 if ((unsigned long)fmt >= (unsigned long)__stop___trace_bprintk_fmt) 162 if ((unsigned long)fmt >= (unsigned long)__stop___trace_bprintk_fmt)
166 return NULL; 163 return NULL;
167
168 next = fmt;
169 m->private = ++next;
170
171 return fmt; 164 return fmt;
172} 165}
173 166
174static void *t_start(struct seq_file *m, loff_t *pos) 167static void *t_next(struct seq_file *m, void * v, loff_t *pos)
175{ 168{
176 return t_next(m, NULL, pos); 169 (*pos)++;
170 return t_start(m, pos);
177} 171}
178 172
179static int t_show(struct seq_file *m, void *v) 173static int t_show(struct seq_file *m, void *v)
@@ -182,7 +176,7 @@ static int t_show(struct seq_file *m, void *v)
182 const char *str = *fmt; 176 const char *str = *fmt;
183 int i; 177 int i;
184 178
185 seq_printf(m, "0x%lx : \"", (unsigned long)fmt); 179 seq_printf(m, "0x%lx : \"", *(unsigned long *)fmt);
186 180
187 /* 181 /*
188 * Tabs and new lines need to be converted. 182 * Tabs and new lines need to be converted.
@@ -224,15 +218,7 @@ static const struct seq_operations show_format_seq_ops = {
224static int 218static int
225ftrace_formats_open(struct inode *inode, struct file *file) 219ftrace_formats_open(struct inode *inode, struct file *file)
226{ 220{
227 int ret; 221 return seq_open(file, &show_format_seq_ops);
228
229 ret = seq_open(file, &show_format_seq_ops);
230 if (!ret) {
231 struct seq_file *m = file->private_data;
232
233 m->private = __start___trace_bprintk_fmt;
234 }
235 return ret;
236} 222}
237 223
238static const struct file_operations ftrace_formats_fops = { 224static const struct file_operations ftrace_formats_fops = {
diff --git a/kernel/trace/trace_stack.c b/kernel/trace/trace_stack.c
index 2d7aebd71dbd..6a2a9d484cd6 100644
--- a/kernel/trace/trace_stack.c
+++ b/kernel/trace/trace_stack.c
@@ -301,17 +301,14 @@ static const struct seq_operations stack_trace_seq_ops = {
301 301
302static int stack_trace_open(struct inode *inode, struct file *file) 302static int stack_trace_open(struct inode *inode, struct file *file)
303{ 303{
304 int ret; 304 return seq_open(file, &stack_trace_seq_ops);
305
306 ret = seq_open(file, &stack_trace_seq_ops);
307
308 return ret;
309} 305}
310 306
311static const struct file_operations stack_trace_fops = { 307static const struct file_operations stack_trace_fops = {
312 .open = stack_trace_open, 308 .open = stack_trace_open,
313 .read = seq_read, 309 .read = seq_read,
314 .llseek = seq_lseek, 310 .llseek = seq_lseek,
311 .release = seq_release,
315}; 312};
316 313
317int 314int
@@ -326,10 +323,10 @@ stack_trace_sysctl(struct ctl_table *table, int write,
326 ret = proc_dointvec(table, write, file, buffer, lenp, ppos); 323 ret = proc_dointvec(table, write, file, buffer, lenp, ppos);
327 324
328 if (ret || !write || 325 if (ret || !write ||
329 (last_stack_tracer_enabled == stack_tracer_enabled)) 326 (last_stack_tracer_enabled == !!stack_tracer_enabled))
330 goto out; 327 goto out;
331 328
332 last_stack_tracer_enabled = stack_tracer_enabled; 329 last_stack_tracer_enabled = !!stack_tracer_enabled;
333 330
334 if (stack_tracer_enabled) 331 if (stack_tracer_enabled)
335 register_ftrace_function(&trace_ops); 332 register_ftrace_function(&trace_ops);
diff --git a/kernel/trace/trace_stat.c b/kernel/trace/trace_stat.c
index c00643733f4c..aea321c82fa0 100644
--- a/kernel/trace/trace_stat.c
+++ b/kernel/trace/trace_stat.c
@@ -73,7 +73,7 @@ static struct rb_node *release_next(struct rb_node *node)
73 } 73 }
74} 74}
75 75
76static void reset_stat_session(struct stat_session *session) 76static void __reset_stat_session(struct stat_session *session)
77{ 77{
78 struct rb_node *node = session->stat_root.rb_node; 78 struct rb_node *node = session->stat_root.rb_node;
79 79
@@ -83,10 +83,17 @@ static void reset_stat_session(struct stat_session *session)
83 session->stat_root = RB_ROOT; 83 session->stat_root = RB_ROOT;
84} 84}
85 85
86static void reset_stat_session(struct stat_session *session)
87{
88 mutex_lock(&session->stat_mutex);
89 __reset_stat_session(session);
90 mutex_unlock(&session->stat_mutex);
91}
92
86static void destroy_session(struct stat_session *session) 93static void destroy_session(struct stat_session *session)
87{ 94{
88 debugfs_remove(session->file); 95 debugfs_remove(session->file);
89 reset_stat_session(session); 96 __reset_stat_session(session);
90 mutex_destroy(&session->stat_mutex); 97 mutex_destroy(&session->stat_mutex);
91 kfree(session); 98 kfree(session);
92} 99}
@@ -150,7 +157,7 @@ static int stat_seq_init(struct stat_session *session)
150 int i; 157 int i;
151 158
152 mutex_lock(&session->stat_mutex); 159 mutex_lock(&session->stat_mutex);
153 reset_stat_session(session); 160 __reset_stat_session(session);
154 161
155 if (!ts->stat_cmp) 162 if (!ts->stat_cmp)
156 ts->stat_cmp = dummy_cmp; 163 ts->stat_cmp = dummy_cmp;
@@ -183,7 +190,7 @@ exit:
183 return ret; 190 return ret;
184 191
185exit_free_rbtree: 192exit_free_rbtree:
186 reset_stat_session(session); 193 __reset_stat_session(session);
187 mutex_unlock(&session->stat_mutex); 194 mutex_unlock(&session->stat_mutex);
188 return ret; 195 return ret;
189} 196}
@@ -199,17 +206,13 @@ static void *stat_seq_start(struct seq_file *s, loff_t *pos)
199 mutex_lock(&session->stat_mutex); 206 mutex_lock(&session->stat_mutex);
200 207
201 /* If we are in the beginning of the file, print the headers */ 208 /* If we are in the beginning of the file, print the headers */
202 if (!*pos && session->ts->stat_headers) { 209 if (!*pos && session->ts->stat_headers)
203 (*pos)++;
204 return SEQ_START_TOKEN; 210 return SEQ_START_TOKEN;
205 }
206 211
207 node = rb_first(&session->stat_root); 212 node = rb_first(&session->stat_root);
208 for (i = 0; node && i < *pos; i++) 213 for (i = 0; node && i < *pos; i++)
209 node = rb_next(node); 214 node = rb_next(node);
210 215
211 (*pos)++;
212
213 return node; 216 return node;
214} 217}
215 218
@@ -254,16 +257,21 @@ static const struct seq_operations trace_stat_seq_ops = {
254static int tracing_stat_open(struct inode *inode, struct file *file) 257static int tracing_stat_open(struct inode *inode, struct file *file)
255{ 258{
256 int ret; 259 int ret;
257 260 struct seq_file *m;
258 struct stat_session *session = inode->i_private; 261 struct stat_session *session = inode->i_private;
259 262
263 ret = stat_seq_init(session);
264 if (ret)
265 return ret;
266
260 ret = seq_open(file, &trace_stat_seq_ops); 267 ret = seq_open(file, &trace_stat_seq_ops);
261 if (!ret) { 268 if (ret) {
262 struct seq_file *m = file->private_data; 269 reset_stat_session(session);
263 m->private = session; 270 return ret;
264 ret = stat_seq_init(session);
265 } 271 }
266 272
273 m = file->private_data;
274 m->private = session;
267 return ret; 275 return ret;
268} 276}
269 277
@@ -274,11 +282,9 @@ static int tracing_stat_release(struct inode *i, struct file *f)
274{ 282{
275 struct stat_session *session = i->i_private; 283 struct stat_session *session = i->i_private;
276 284
277 mutex_lock(&session->stat_mutex);
278 reset_stat_session(session); 285 reset_stat_session(session);
279 mutex_unlock(&session->stat_mutex);
280 286
281 return 0; 287 return seq_release(i, f);
282} 288}
283 289
284static const struct file_operations tracing_stat_fops = { 290static const struct file_operations tracing_stat_fops = {
diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug
index 4c32b1a1a06e..12327b2bb785 100644
--- a/lib/Kconfig.debug
+++ b/lib/Kconfig.debug
@@ -359,6 +359,18 @@ config DEBUG_KMEMLEAK
359 In order to access the kmemleak file, debugfs needs to be 359 In order to access the kmemleak file, debugfs needs to be
360 mounted (usually at /sys/kernel/debug). 360 mounted (usually at /sys/kernel/debug).
361 361
362config DEBUG_KMEMLEAK_EARLY_LOG_SIZE
363 int "Maximum kmemleak early log entries"
364 depends on DEBUG_KMEMLEAK
365 range 200 2000
366 default 400
367 help
368 Kmemleak must track all the memory allocations to avoid
369 reporting false positives. Since memory may be allocated or
370 freed before kmemleak is initialised, an early log buffer is
371 used to store these actions. If kmemleak reports "early log
372 buffer exceeded", please increase this value.
373
362config DEBUG_KMEMLEAK_TEST 374config DEBUG_KMEMLEAK_TEST
363 tristate "Simple test for the kernel memory leak detector" 375 tristate "Simple test for the kernel memory leak detector"
364 depends on DEBUG_KMEMLEAK 376 depends on DEBUG_KMEMLEAK
diff --git a/lib/Makefile b/lib/Makefile
index b6d1857bbf08..2e78277eff9d 100644
--- a/lib/Makefile
+++ b/lib/Makefile
@@ -12,7 +12,7 @@ lib-y := ctype.o string.o vsprintf.o cmdline.o \
12 idr.o int_sqrt.o extable.o prio_tree.o \ 12 idr.o int_sqrt.o extable.o prio_tree.o \
13 sha1.o irq_regs.o reciprocal_div.o argv_split.o \ 13 sha1.o irq_regs.o reciprocal_div.o argv_split.o \
14 proportions.o prio_heap.o ratelimit.o show_mem.o \ 14 proportions.o prio_heap.o ratelimit.o show_mem.o \
15 is_single_threaded.o plist.o decompress.o 15 is_single_threaded.o plist.o decompress.o flex_array.o
16 16
17lib-$(CONFIG_MMU) += ioremap.o 17lib-$(CONFIG_MMU) += ioremap.o
18lib-$(CONFIG_SMP) += cpumask.o 18lib-$(CONFIG_SMP) += cpumask.o
diff --git a/lib/atomic64.c b/lib/atomic64.c
index c5e725562416..8bee16ec7524 100644
--- a/lib/atomic64.c
+++ b/lib/atomic64.c
@@ -13,6 +13,7 @@
13#include <linux/cache.h> 13#include <linux/cache.h>
14#include <linux/spinlock.h> 14#include <linux/spinlock.h>
15#include <linux/init.h> 15#include <linux/init.h>
16#include <linux/module.h>
16#include <asm/atomic.h> 17#include <asm/atomic.h>
17 18
18/* 19/*
@@ -52,6 +53,7 @@ long long atomic64_read(const atomic64_t *v)
52 spin_unlock_irqrestore(lock, flags); 53 spin_unlock_irqrestore(lock, flags);
53 return val; 54 return val;
54} 55}
56EXPORT_SYMBOL(atomic64_read);
55 57
56void atomic64_set(atomic64_t *v, long long i) 58void atomic64_set(atomic64_t *v, long long i)
57{ 59{
@@ -62,6 +64,7 @@ void atomic64_set(atomic64_t *v, long long i)
62 v->counter = i; 64 v->counter = i;
63 spin_unlock_irqrestore(lock, flags); 65 spin_unlock_irqrestore(lock, flags);
64} 66}
67EXPORT_SYMBOL(atomic64_set);
65 68
66void atomic64_add(long long a, atomic64_t *v) 69void atomic64_add(long long a, atomic64_t *v)
67{ 70{
@@ -72,6 +75,7 @@ void atomic64_add(long long a, atomic64_t *v)
72 v->counter += a; 75 v->counter += a;
73 spin_unlock_irqrestore(lock, flags); 76 spin_unlock_irqrestore(lock, flags);
74} 77}
78EXPORT_SYMBOL(atomic64_add);
75 79
76long long atomic64_add_return(long long a, atomic64_t *v) 80long long atomic64_add_return(long long a, atomic64_t *v)
77{ 81{
@@ -84,6 +88,7 @@ long long atomic64_add_return(long long a, atomic64_t *v)
84 spin_unlock_irqrestore(lock, flags); 88 spin_unlock_irqrestore(lock, flags);
85 return val; 89 return val;
86} 90}
91EXPORT_SYMBOL(atomic64_add_return);
87 92
88void atomic64_sub(long long a, atomic64_t *v) 93void atomic64_sub(long long a, atomic64_t *v)
89{ 94{
@@ -94,6 +99,7 @@ void atomic64_sub(long long a, atomic64_t *v)
94 v->counter -= a; 99 v->counter -= a;
95 spin_unlock_irqrestore(lock, flags); 100 spin_unlock_irqrestore(lock, flags);
96} 101}
102EXPORT_SYMBOL(atomic64_sub);
97 103
98long long atomic64_sub_return(long long a, atomic64_t *v) 104long long atomic64_sub_return(long long a, atomic64_t *v)
99{ 105{
@@ -106,6 +112,7 @@ long long atomic64_sub_return(long long a, atomic64_t *v)
106 spin_unlock_irqrestore(lock, flags); 112 spin_unlock_irqrestore(lock, flags);
107 return val; 113 return val;
108} 114}
115EXPORT_SYMBOL(atomic64_sub_return);
109 116
110long long atomic64_dec_if_positive(atomic64_t *v) 117long long atomic64_dec_if_positive(atomic64_t *v)
111{ 118{
@@ -120,6 +127,7 @@ long long atomic64_dec_if_positive(atomic64_t *v)
120 spin_unlock_irqrestore(lock, flags); 127 spin_unlock_irqrestore(lock, flags);
121 return val; 128 return val;
122} 129}
130EXPORT_SYMBOL(atomic64_dec_if_positive);
123 131
124long long atomic64_cmpxchg(atomic64_t *v, long long o, long long n) 132long long atomic64_cmpxchg(atomic64_t *v, long long o, long long n)
125{ 133{
@@ -134,6 +142,7 @@ long long atomic64_cmpxchg(atomic64_t *v, long long o, long long n)
134 spin_unlock_irqrestore(lock, flags); 142 spin_unlock_irqrestore(lock, flags);
135 return val; 143 return val;
136} 144}
145EXPORT_SYMBOL(atomic64_cmpxchg);
137 146
138long long atomic64_xchg(atomic64_t *v, long long new) 147long long atomic64_xchg(atomic64_t *v, long long new)
139{ 148{
@@ -147,6 +156,7 @@ long long atomic64_xchg(atomic64_t *v, long long new)
147 spin_unlock_irqrestore(lock, flags); 156 spin_unlock_irqrestore(lock, flags);
148 return val; 157 return val;
149} 158}
159EXPORT_SYMBOL(atomic64_xchg);
150 160
151int atomic64_add_unless(atomic64_t *v, long long a, long long u) 161int atomic64_add_unless(atomic64_t *v, long long a, long long u)
152{ 162{
@@ -162,6 +172,7 @@ int atomic64_add_unless(atomic64_t *v, long long a, long long u)
162 spin_unlock_irqrestore(lock, flags); 172 spin_unlock_irqrestore(lock, flags);
163 return ret; 173 return ret;
164} 174}
175EXPORT_SYMBOL(atomic64_add_unless);
165 176
166static int init_atomic64_lock(void) 177static int init_atomic64_lock(void)
167{ 178{
diff --git a/lib/decompress_bunzip2.c b/lib/decompress_bunzip2.c
index 708e2a86d87b..600f473a5610 100644
--- a/lib/decompress_bunzip2.c
+++ b/lib/decompress_bunzip2.c
@@ -45,12 +45,14 @@
45*/ 45*/
46 46
47 47
48#ifndef STATIC 48#ifdef STATIC
49#define PREBOOT
50#else
49#include <linux/decompress/bunzip2.h> 51#include <linux/decompress/bunzip2.h>
50#endif /* !STATIC */ 52#include <linux/slab.h>
53#endif /* STATIC */
51 54
52#include <linux/decompress/mm.h> 55#include <linux/decompress/mm.h>
53#include <linux/slab.h>
54 56
55#ifndef INT_MAX 57#ifndef INT_MAX
56#define INT_MAX 0x7fffffff 58#define INT_MAX 0x7fffffff
@@ -681,9 +683,7 @@ STATIC int INIT bunzip2(unsigned char *buf, int len,
681 set_error_fn(error_fn); 683 set_error_fn(error_fn);
682 if (flush) 684 if (flush)
683 outbuf = malloc(BZIP2_IOBUF_SIZE); 685 outbuf = malloc(BZIP2_IOBUF_SIZE);
684 else 686
685 len -= 4; /* Uncompressed size hack active in pre-boot
686 environment */
687 if (!outbuf) { 687 if (!outbuf) {
688 error("Could not allocate output bufer"); 688 error("Could not allocate output bufer");
689 return -1; 689 return -1;
@@ -733,4 +733,14 @@ exit_0:
733 return i; 733 return i;
734} 734}
735 735
736#define decompress bunzip2 736#ifdef PREBOOT
737STATIC int INIT decompress(unsigned char *buf, int len,
738 int(*fill)(void*, unsigned int),
739 int(*flush)(void*, unsigned int),
740 unsigned char *outbuf,
741 int *pos,
742 void(*error_fn)(char *x))
743{
744 return bunzip2(buf, len - 4, fill, flush, outbuf, pos, error_fn);
745}
746#endif
diff --git a/lib/decompress_inflate.c b/lib/decompress_inflate.c
index e36b296fc9f8..68dfce59c1b8 100644
--- a/lib/decompress_inflate.c
+++ b/lib/decompress_inflate.c
@@ -19,13 +19,13 @@
19#include "zlib_inflate/inflate.h" 19#include "zlib_inflate/inflate.h"
20 20
21#include "zlib_inflate/infutil.h" 21#include "zlib_inflate/infutil.h"
22#include <linux/slab.h>
22 23
23#endif /* STATIC */ 24#endif /* STATIC */
24 25
25#include <linux/decompress/mm.h> 26#include <linux/decompress/mm.h>
26#include <linux/slab.h>
27 27
28#define INBUF_LEN (16*1024) 28#define GZIP_IOBUF_SIZE (16*1024)
29 29
30/* Included from initramfs et al code */ 30/* Included from initramfs et al code */
31STATIC int INIT gunzip(unsigned char *buf, int len, 31STATIC int INIT gunzip(unsigned char *buf, int len,
@@ -55,7 +55,7 @@ STATIC int INIT gunzip(unsigned char *buf, int len,
55 if (buf) 55 if (buf)
56 zbuf = buf; 56 zbuf = buf;
57 else { 57 else {
58 zbuf = malloc(INBUF_LEN); 58 zbuf = malloc(GZIP_IOBUF_SIZE);
59 len = 0; 59 len = 0;
60 } 60 }
61 if (!zbuf) { 61 if (!zbuf) {
@@ -77,7 +77,7 @@ STATIC int INIT gunzip(unsigned char *buf, int len,
77 } 77 }
78 78
79 if (len == 0) 79 if (len == 0)
80 len = fill(zbuf, INBUF_LEN); 80 len = fill(zbuf, GZIP_IOBUF_SIZE);
81 81
82 /* verify the gzip header */ 82 /* verify the gzip header */
83 if (len < 10 || 83 if (len < 10 ||
@@ -113,7 +113,7 @@ STATIC int INIT gunzip(unsigned char *buf, int len,
113 while (rc == Z_OK) { 113 while (rc == Z_OK) {
114 if (strm->avail_in == 0) { 114 if (strm->avail_in == 0) {
115 /* TODO: handle case where both pos and fill are set */ 115 /* TODO: handle case where both pos and fill are set */
116 len = fill(zbuf, INBUF_LEN); 116 len = fill(zbuf, GZIP_IOBUF_SIZE);
117 if (len < 0) { 117 if (len < 0) {
118 rc = -1; 118 rc = -1;
119 error("read error"); 119 error("read error");
diff --git a/lib/decompress_unlzma.c b/lib/decompress_unlzma.c
index 32123a1340e6..0b954e04bd30 100644
--- a/lib/decompress_unlzma.c
+++ b/lib/decompress_unlzma.c
@@ -29,12 +29,14 @@
29 *Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 29 *Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
30 */ 30 */
31 31
32#ifndef STATIC 32#ifdef STATIC
33#define PREBOOT
34#else
33#include <linux/decompress/unlzma.h> 35#include <linux/decompress/unlzma.h>
36#include <linux/slab.h>
34#endif /* STATIC */ 37#endif /* STATIC */
35 38
36#include <linux/decompress/mm.h> 39#include <linux/decompress/mm.h>
37#include <linux/slab.h>
38 40
39#define MIN(a, b) (((a) < (b)) ? (a) : (b)) 41#define MIN(a, b) (((a) < (b)) ? (a) : (b))
40 42
@@ -543,9 +545,7 @@ STATIC inline int INIT unlzma(unsigned char *buf, int in_len,
543 int ret = -1; 545 int ret = -1;
544 546
545 set_error_fn(error_fn); 547 set_error_fn(error_fn);
546 if (!flush) 548
547 in_len -= 4; /* Uncompressed size hack active in pre-boot
548 environment */
549 if (buf) 549 if (buf)
550 inbuf = buf; 550 inbuf = buf;
551 else 551 else
@@ -645,4 +645,15 @@ exit_0:
645 return ret; 645 return ret;
646} 646}
647 647
648#define decompress unlzma 648#ifdef PREBOOT
649STATIC int INIT decompress(unsigned char *buf, int in_len,
650 int(*fill)(void*, unsigned int),
651 int(*flush)(void*, unsigned int),
652 unsigned char *output,
653 int *posp,
654 void(*error_fn)(char *x)
655 )
656{
657 return unlzma(buf, in_len - 4, fill, flush, output, posp, error_fn);
658}
659#endif
diff --git a/lib/dma-debug.c b/lib/dma-debug.c
index 3b93129a968c..65b0d99b6d0a 100644
--- a/lib/dma-debug.c
+++ b/lib/dma-debug.c
@@ -716,7 +716,7 @@ void dma_debug_init(u32 num_entries)
716 716
717 for (i = 0; i < HASH_SIZE; ++i) { 717 for (i = 0; i < HASH_SIZE; ++i) {
718 INIT_LIST_HEAD(&dma_entry_hash[i].list); 718 INIT_LIST_HEAD(&dma_entry_hash[i].list);
719 dma_entry_hash[i].lock = SPIN_LOCK_UNLOCKED; 719 spin_lock_init(&dma_entry_hash[i].lock);
720 } 720 }
721 721
722 if (dma_debug_fs_init() != 0) { 722 if (dma_debug_fs_init() != 0) {
@@ -856,22 +856,21 @@ static void check_for_stack(struct device *dev, void *addr)
856 "stack [addr=%p]\n", addr); 856 "stack [addr=%p]\n", addr);
857} 857}
858 858
859static inline bool overlap(void *addr, u64 size, void *start, void *end) 859static inline bool overlap(void *addr, unsigned long len, void *start, void *end)
860{ 860{
861 void *addr2 = (char *)addr + size; 861 unsigned long a1 = (unsigned long)addr;
862 unsigned long b1 = a1 + len;
863 unsigned long a2 = (unsigned long)start;
864 unsigned long b2 = (unsigned long)end;
862 865
863 return ((addr >= start && addr < end) || 866 return !(b1 <= a2 || a1 >= b2);
864 (addr2 >= start && addr2 < end) ||
865 ((addr < start) && (addr2 >= end)));
866} 867}
867 868
868static void check_for_illegal_area(struct device *dev, void *addr, u64 size) 869static void check_for_illegal_area(struct device *dev, void *addr, unsigned long len)
869{ 870{
870 if (overlap(addr, size, _text, _etext) || 871 if (overlap(addr, len, _text, _etext) ||
871 overlap(addr, size, __start_rodata, __end_rodata)) 872 overlap(addr, len, __start_rodata, __end_rodata))
872 err_printk(dev, NULL, "DMA-API: device driver maps " 873 err_printk(dev, NULL, "DMA-API: device driver maps memory from kernel text or rodata [addr=%p] [len=%lu]\n", addr, len);
873 "memory from kernel text or rodata "
874 "[addr=%p] [size=%llu]\n", addr, size);
875} 874}
876 875
877static void check_sync(struct device *dev, 876static void check_sync(struct device *dev,
@@ -969,7 +968,8 @@ void debug_dma_map_page(struct device *dev, struct page *page, size_t offset,
969 entry->type = dma_debug_single; 968 entry->type = dma_debug_single;
970 969
971 if (!PageHighMem(page)) { 970 if (!PageHighMem(page)) {
972 void *addr = ((char *)page_address(page)) + offset; 971 void *addr = page_address(page) + offset;
972
973 check_for_stack(dev, addr); 973 check_for_stack(dev, addr);
974 check_for_illegal_area(dev, addr, size); 974 check_for_illegal_area(dev, addr, size);
975 } 975 }
diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c
index 833139ce1e22..e22c148e4b7f 100644
--- a/lib/dynamic_debug.c
+++ b/lib/dynamic_debug.c
@@ -164,7 +164,7 @@ static void ddebug_change(const struct ddebug_query *query,
164 164
165 if (!newflags) 165 if (!newflags)
166 dt->num_enabled--; 166 dt->num_enabled--;
167 else if (!dp-flags) 167 else if (!dp->flags)
168 dt->num_enabled++; 168 dt->num_enabled++;
169 dp->flags = newflags; 169 dp->flags = newflags;
170 if (newflags) { 170 if (newflags) {
diff --git a/lib/flex_array.c b/lib/flex_array.c
new file mode 100644
index 000000000000..08f1636d296a
--- /dev/null
+++ b/lib/flex_array.c
@@ -0,0 +1,267 @@
1/*
2 * Flexible array managed in PAGE_SIZE parts
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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 *
18 * Copyright IBM Corporation, 2009
19 *
20 * Author: Dave Hansen <dave@linux.vnet.ibm.com>
21 */
22
23#include <linux/flex_array.h>
24#include <linux/slab.h>
25#include <linux/stddef.h>
26
27struct flex_array_part {
28 char elements[FLEX_ARRAY_PART_SIZE];
29};
30
31static inline int __elements_per_part(int element_size)
32{
33 return FLEX_ARRAY_PART_SIZE / element_size;
34}
35
36static inline int bytes_left_in_base(void)
37{
38 int element_offset = offsetof(struct flex_array, parts);
39 int bytes_left = FLEX_ARRAY_BASE_SIZE - element_offset;
40 return bytes_left;
41}
42
43static inline int nr_base_part_ptrs(void)
44{
45 return bytes_left_in_base() / sizeof(struct flex_array_part *);
46}
47
48/*
49 * If a user requests an allocation which is small
50 * enough, we may simply use the space in the
51 * flex_array->parts[] array to store the user
52 * data.
53 */
54static inline int elements_fit_in_base(struct flex_array *fa)
55{
56 int data_size = fa->element_size * fa->total_nr_elements;
57 if (data_size <= bytes_left_in_base())
58 return 1;
59 return 0;
60}
61
62/**
63 * flex_array_alloc - allocate a new flexible array
64 * @element_size: the size of individual elements in the array
65 * @total: total number of elements that this should hold
66 *
67 * Note: all locking must be provided by the caller.
68 *
69 * @total is used to size internal structures. If the user ever
70 * accesses any array indexes >=@total, it will produce errors.
71 *
72 * The maximum number of elements is defined as: the number of
73 * elements that can be stored in a page times the number of
74 * page pointers that we can fit in the base structure or (using
75 * integer math):
76 *
77 * (PAGE_SIZE/element_size) * (PAGE_SIZE-8)/sizeof(void *)
78 *
79 * Here's a table showing example capacities. Note that the maximum
80 * index that the get/put() functions is just nr_objects-1. This
81 * basically means that you get 4MB of storage on 32-bit and 2MB on
82 * 64-bit.
83 *
84 *
85 * Element size | Objects | Objects |
86 * PAGE_SIZE=4k | 32-bit | 64-bit |
87 * ---------------------------------|
88 * 1 bytes | 4186112 | 2093056 |
89 * 2 bytes | 2093056 | 1046528 |
90 * 3 bytes | 1395030 | 697515 |
91 * 4 bytes | 1046528 | 523264 |
92 * 32 bytes | 130816 | 65408 |
93 * 33 bytes | 126728 | 63364 |
94 * 2048 bytes | 2044 | 1022 |
95 * 2049 bytes | 1022 | 511 |
96 * void * | 1046528 | 261632 |
97 *
98 * Since 64-bit pointers are twice the size, we lose half the
99 * capacity in the base structure. Also note that no effort is made
100 * to efficiently pack objects across page boundaries.
101 */
102struct flex_array *flex_array_alloc(int element_size, int total, gfp_t flags)
103{
104 struct flex_array *ret;
105 int max_size = nr_base_part_ptrs() * __elements_per_part(element_size);
106
107 /* max_size will end up 0 if element_size > PAGE_SIZE */
108 if (total > max_size)
109 return NULL;
110 ret = kzalloc(sizeof(struct flex_array), flags);
111 if (!ret)
112 return NULL;
113 ret->element_size = element_size;
114 ret->total_nr_elements = total;
115 return ret;
116}
117
118static int fa_element_to_part_nr(struct flex_array *fa, int element_nr)
119{
120 return element_nr / __elements_per_part(fa->element_size);
121}
122
123/**
124 * flex_array_free_parts - just free the second-level pages
125 * @src: address of data to copy into the array
126 * @element_nr: index of the position in which to insert
127 * the new element.
128 *
129 * This is to be used in cases where the base 'struct flex_array'
130 * has been statically allocated and should not be free.
131 */
132void flex_array_free_parts(struct flex_array *fa)
133{
134 int part_nr;
135 int max_part = nr_base_part_ptrs();
136
137 if (elements_fit_in_base(fa))
138 return;
139 for (part_nr = 0; part_nr < max_part; part_nr++)
140 kfree(fa->parts[part_nr]);
141}
142
143void flex_array_free(struct flex_array *fa)
144{
145 flex_array_free_parts(fa);
146 kfree(fa);
147}
148
149static int fa_index_inside_part(struct flex_array *fa, int element_nr)
150{
151 return element_nr % __elements_per_part(fa->element_size);
152}
153
154static int index_inside_part(struct flex_array *fa, int element_nr)
155{
156 int part_offset = fa_index_inside_part(fa, element_nr);
157 return part_offset * fa->element_size;
158}
159
160static struct flex_array_part *
161__fa_get_part(struct flex_array *fa, int part_nr, gfp_t flags)
162{
163 struct flex_array_part *part = fa->parts[part_nr];
164 if (!part) {
165 /*
166 * This leaves the part pages uninitialized
167 * and with potentially random data, just
168 * as if the user had kmalloc()'d the whole.
169 * __GFP_ZERO can be used to zero it.
170 */
171 part = kmalloc(FLEX_ARRAY_PART_SIZE, flags);
172 if (!part)
173 return NULL;
174 fa->parts[part_nr] = part;
175 }
176 return part;
177}
178
179/**
180 * flex_array_put - copy data into the array at @element_nr
181 * @src: address of data to copy into the array
182 * @element_nr: index of the position in which to insert
183 * the new element.
184 *
185 * Note that this *copies* the contents of @src into
186 * the array. If you are trying to store an array of
187 * pointers, make sure to pass in &ptr instead of ptr.
188 *
189 * Locking must be provided by the caller.
190 */
191int flex_array_put(struct flex_array *fa, int element_nr, void *src, gfp_t flags)
192{
193 int part_nr = fa_element_to_part_nr(fa, element_nr);
194 struct flex_array_part *part;
195 void *dst;
196
197 if (element_nr >= fa->total_nr_elements)
198 return -ENOSPC;
199 if (elements_fit_in_base(fa))
200 part = (struct flex_array_part *)&fa->parts[0];
201 else
202 part = __fa_get_part(fa, part_nr, flags);
203 if (!part)
204 return -ENOMEM;
205 dst = &part->elements[index_inside_part(fa, element_nr)];
206 memcpy(dst, src, fa->element_size);
207 return 0;
208}
209
210/**
211 * flex_array_prealloc - guarantee that array space exists
212 * @start: index of first array element for which space is allocated
213 * @end: index of last (inclusive) element for which space is allocated
214 *
215 * This will guarantee that no future calls to flex_array_put()
216 * will allocate memory. It can be used if you are expecting to
217 * be holding a lock or in some atomic context while writing
218 * data into the array.
219 *
220 * Locking must be provided by the caller.
221 */
222int flex_array_prealloc(struct flex_array *fa, int start, int end, gfp_t flags)
223{
224 int start_part;
225 int end_part;
226 int part_nr;
227 struct flex_array_part *part;
228
229 if (start >= fa->total_nr_elements || end >= fa->total_nr_elements)
230 return -ENOSPC;
231 if (elements_fit_in_base(fa))
232 return 0;
233 start_part = fa_element_to_part_nr(fa, start);
234 end_part = fa_element_to_part_nr(fa, end);
235 for (part_nr = start_part; part_nr <= end_part; part_nr++) {
236 part = __fa_get_part(fa, part_nr, flags);
237 if (!part)
238 return -ENOMEM;
239 }
240 return 0;
241}
242
243/**
244 * flex_array_get - pull data back out of the array
245 * @element_nr: index of the element to fetch from the array
246 *
247 * Returns a pointer to the data at index @element_nr. Note
248 * that this is a copy of the data that was passed in. If you
249 * are using this to store pointers, you'll get back &ptr.
250 *
251 * Locking must be provided by the caller.
252 */
253void *flex_array_get(struct flex_array *fa, int element_nr)
254{
255 int part_nr = fa_element_to_part_nr(fa, element_nr);
256 struct flex_array_part *part;
257
258 if (element_nr >= fa->total_nr_elements)
259 return NULL;
260 if (!fa->parts[part_nr])
261 return NULL;
262 if (elements_fit_in_base(fa))
263 part = (struct flex_array_part *)&fa->parts[0];
264 else
265 part = fa->parts[part_nr];
266 return &part->elements[index_inside_part(fa, element_nr)];
267}
diff --git a/lib/scatterlist.c b/lib/scatterlist.c
index a295e404e908..0d475d8167bf 100644
--- a/lib/scatterlist.c
+++ b/lib/scatterlist.c
@@ -314,6 +314,7 @@ void sg_miter_start(struct sg_mapping_iter *miter, struct scatterlist *sgl,
314 miter->__sg = sgl; 314 miter->__sg = sgl;
315 miter->__nents = nents; 315 miter->__nents = nents;
316 miter->__offset = 0; 316 miter->__offset = 0;
317 WARN_ON(!(flags & (SG_MITER_TO_SG | SG_MITER_FROM_SG)));
317 miter->__flags = flags; 318 miter->__flags = flags;
318} 319}
319EXPORT_SYMBOL(sg_miter_start); 320EXPORT_SYMBOL(sg_miter_start);
@@ -394,6 +395,9 @@ void sg_miter_stop(struct sg_mapping_iter *miter)
394 if (miter->addr) { 395 if (miter->addr) {
395 miter->__offset += miter->consumed; 396 miter->__offset += miter->consumed;
396 397
398 if (miter->__flags & SG_MITER_TO_SG)
399 flush_kernel_dcache_page(miter->page);
400
397 if (miter->__flags & SG_MITER_ATOMIC) { 401 if (miter->__flags & SG_MITER_ATOMIC) {
398 WARN_ON(!irqs_disabled()); 402 WARN_ON(!irqs_disabled());
399 kunmap_atomic(miter->addr, KM_BIO_SRC_IRQ); 403 kunmap_atomic(miter->addr, KM_BIO_SRC_IRQ);
@@ -426,8 +430,14 @@ static size_t sg_copy_buffer(struct scatterlist *sgl, unsigned int nents,
426 unsigned int offset = 0; 430 unsigned int offset = 0;
427 struct sg_mapping_iter miter; 431 struct sg_mapping_iter miter;
428 unsigned long flags; 432 unsigned long flags;
433 unsigned int sg_flags = SG_MITER_ATOMIC;
434
435 if (to_buffer)
436 sg_flags |= SG_MITER_FROM_SG;
437 else
438 sg_flags |= SG_MITER_TO_SG;
429 439
430 sg_miter_start(&miter, sgl, nents, SG_MITER_ATOMIC); 440 sg_miter_start(&miter, sgl, nents, sg_flags);
431 441
432 local_irq_save(flags); 442 local_irq_save(flags);
433 443
@@ -438,10 +448,8 @@ static size_t sg_copy_buffer(struct scatterlist *sgl, unsigned int nents,
438 448
439 if (to_buffer) 449 if (to_buffer)
440 memcpy(buf + offset, miter.addr, len); 450 memcpy(buf + offset, miter.addr, len);
441 else { 451 else
442 memcpy(miter.addr, buf + offset, len); 452 memcpy(miter.addr, buf + offset, len);
443 flush_kernel_dcache_page(miter.page);
444 }
445 453
446 offset += len; 454 offset += len;
447 } 455 }
diff --git a/mm/backing-dev.c b/mm/backing-dev.c
index 493b468a5035..c86edd244294 100644
--- a/mm/backing-dev.c
+++ b/mm/backing-dev.c
@@ -283,7 +283,6 @@ static wait_queue_head_t congestion_wqh[2] = {
283 __WAIT_QUEUE_HEAD_INITIALIZER(congestion_wqh[1]) 283 __WAIT_QUEUE_HEAD_INITIALIZER(congestion_wqh[1])
284 }; 284 };
285 285
286
287void clear_bdi_congested(struct backing_dev_info *bdi, int sync) 286void clear_bdi_congested(struct backing_dev_info *bdi, int sync)
288{ 287{
289 enum bdi_state bit; 288 enum bdi_state bit;
@@ -308,18 +307,18 @@ EXPORT_SYMBOL(set_bdi_congested);
308 307
309/** 308/**
310 * congestion_wait - wait for a backing_dev to become uncongested 309 * congestion_wait - wait for a backing_dev to become uncongested
311 * @rw: READ or WRITE 310 * @sync: SYNC or ASYNC IO
312 * @timeout: timeout in jiffies 311 * @timeout: timeout in jiffies
313 * 312 *
314 * Waits for up to @timeout jiffies for a backing_dev (any backing_dev) to exit 313 * Waits for up to @timeout jiffies for a backing_dev (any backing_dev) to exit
315 * write congestion. If no backing_devs are congested then just wait for the 314 * write congestion. If no backing_devs are congested then just wait for the
316 * next write to be completed. 315 * next write to be completed.
317 */ 316 */
318long congestion_wait(int rw, long timeout) 317long congestion_wait(int sync, long timeout)
319{ 318{
320 long ret; 319 long ret;
321 DEFINE_WAIT(wait); 320 DEFINE_WAIT(wait);
322 wait_queue_head_t *wqh = &congestion_wqh[rw]; 321 wait_queue_head_t *wqh = &congestion_wqh[sync];
323 322
324 prepare_to_wait(wqh, &wait, TASK_UNINTERRUPTIBLE); 323 prepare_to_wait(wqh, &wait, TASK_UNINTERRUPTIBLE);
325 ret = io_schedule_timeout(timeout); 324 ret = io_schedule_timeout(timeout);
diff --git a/mm/bootmem.c b/mm/bootmem.c
index d2a9ce952768..701740c9e81b 100644
--- a/mm/bootmem.c
+++ b/mm/bootmem.c
@@ -12,6 +12,7 @@
12#include <linux/pfn.h> 12#include <linux/pfn.h>
13#include <linux/bootmem.h> 13#include <linux/bootmem.h>
14#include <linux/module.h> 14#include <linux/module.h>
15#include <linux/kmemleak.h>
15 16
16#include <asm/bug.h> 17#include <asm/bug.h>
17#include <asm/io.h> 18#include <asm/io.h>
@@ -335,6 +336,8 @@ void __init free_bootmem_node(pg_data_t *pgdat, unsigned long physaddr,
335{ 336{
336 unsigned long start, end; 337 unsigned long start, end;
337 338
339 kmemleak_free_part(__va(physaddr), size);
340
338 start = PFN_UP(physaddr); 341 start = PFN_UP(physaddr);
339 end = PFN_DOWN(physaddr + size); 342 end = PFN_DOWN(physaddr + size);
340 343
@@ -354,6 +357,8 @@ void __init free_bootmem(unsigned long addr, unsigned long size)
354{ 357{
355 unsigned long start, end; 358 unsigned long start, end;
356 359
360 kmemleak_free_part(__va(addr), size);
361
357 start = PFN_UP(addr); 362 start = PFN_UP(addr);
358 end = PFN_DOWN(addr + size); 363 end = PFN_DOWN(addr + size);
359 364
@@ -516,6 +521,7 @@ find_block:
516 region = phys_to_virt(PFN_PHYS(bdata->node_min_pfn) + 521 region = phys_to_virt(PFN_PHYS(bdata->node_min_pfn) +
517 start_off); 522 start_off);
518 memset(region, 0, size); 523 memset(region, 0, size);
524 kmemleak_alloc(region, size, 1, 0);
519 return region; 525 return region;
520 } 526 }
521 527
diff --git a/mm/dmapool.c b/mm/dmapool.c
index b1f0885dda22..3df063706f53 100644
--- a/mm/dmapool.c
+++ b/mm/dmapool.c
@@ -86,10 +86,12 @@ show_pools(struct device *dev, struct device_attribute *attr, char *buf)
86 unsigned pages = 0; 86 unsigned pages = 0;
87 unsigned blocks = 0; 87 unsigned blocks = 0;
88 88
89 spin_lock_irq(&pool->lock);
89 list_for_each_entry(page, &pool->page_list, page_list) { 90 list_for_each_entry(page, &pool->page_list, page_list) {
90 pages++; 91 pages++;
91 blocks += page->in_use; 92 blocks += page->in_use;
92 } 93 }
94 spin_unlock_irq(&pool->lock);
93 95
94 /* per-pool info, no real statistics yet */ 96 /* per-pool info, no real statistics yet */
95 temp = scnprintf(next, size, "%-16s %4u %4Zu %4Zu %2u\n", 97 temp = scnprintf(next, size, "%-16s %4u %4Zu %4Zu %2u\n",
diff --git a/mm/filemap.c b/mm/filemap.c
index 22396713feb9..ccea3b665c12 100644
--- a/mm/filemap.c
+++ b/mm/filemap.c
@@ -2272,6 +2272,7 @@ again:
2272 pagefault_enable(); 2272 pagefault_enable();
2273 flush_dcache_page(page); 2273 flush_dcache_page(page);
2274 2274
2275 mark_page_accessed(page);
2275 status = a_ops->write_end(file, mapping, pos, bytes, copied, 2276 status = a_ops->write_end(file, mapping, pos, bytes, copied,
2276 page, fsdata); 2277 page, fsdata);
2277 if (unlikely(status < 0)) 2278 if (unlikely(status < 0))
diff --git a/mm/hugetlb.c b/mm/hugetlb.c
index d0351e31f474..cafdcee154e8 100644
--- a/mm/hugetlb.c
+++ b/mm/hugetlb.c
@@ -2370,7 +2370,7 @@ void hugetlb_unreserve_pages(struct inode *inode, long offset, long freed)
2370 long chg = region_truncate(&inode->i_mapping->private_list, offset); 2370 long chg = region_truncate(&inode->i_mapping->private_list, offset);
2371 2371
2372 spin_lock(&inode->i_lock); 2372 spin_lock(&inode->i_lock);
2373 inode->i_blocks -= blocks_per_huge_page(h); 2373 inode->i_blocks -= (blocks_per_huge_page(h) * freed);
2374 spin_unlock(&inode->i_lock); 2374 spin_unlock(&inode->i_lock);
2375 2375
2376 hugetlb_put_quota(inode->i_mapping, (chg - freed)); 2376 hugetlb_put_quota(inode->i_mapping, (chg - freed));
diff --git a/mm/kmemleak.c b/mm/kmemleak.c
index c96f2c8700aa..487267310a84 100644
--- a/mm/kmemleak.c
+++ b/mm/kmemleak.c
@@ -48,10 +48,10 @@
48 * scanned. This list is only modified during a scanning episode when the 48 * scanned. This list is only modified during a scanning episode when the
49 * scan_mutex is held. At the end of a scan, the gray_list is always empty. 49 * scan_mutex is held. At the end of a scan, the gray_list is always empty.
50 * Note that the kmemleak_object.use_count is incremented when an object is 50 * Note that the kmemleak_object.use_count is incremented when an object is
51 * added to the gray_list and therefore cannot be freed 51 * added to the gray_list and therefore cannot be freed. This mutex also
52 * - kmemleak_mutex (mutex): prevents multiple users of the "kmemleak" debugfs 52 * prevents multiple users of the "kmemleak" debugfs file together with
53 * file together with modifications to the memory scanning parameters 53 * modifications to the memory scanning parameters including the scan_thread
54 * including the scan_thread pointer 54 * pointer
55 * 55 *
56 * The kmemleak_object structures have a use_count incremented or decremented 56 * The kmemleak_object structures have a use_count incremented or decremented
57 * using the get_object()/put_object() functions. When the use_count becomes 57 * using the get_object()/put_object() functions. When the use_count becomes
@@ -103,11 +103,10 @@
103 * Kmemleak configuration and common defines. 103 * Kmemleak configuration and common defines.
104 */ 104 */
105#define MAX_TRACE 16 /* stack trace length */ 105#define MAX_TRACE 16 /* stack trace length */
106#define REPORTS_NR 50 /* maximum number of reported leaks */
107#define MSECS_MIN_AGE 5000 /* minimum object age for reporting */ 106#define MSECS_MIN_AGE 5000 /* minimum object age for reporting */
108#define MSECS_SCAN_YIELD 10 /* CPU yielding period */
109#define SECS_FIRST_SCAN 60 /* delay before the first scan */ 107#define SECS_FIRST_SCAN 60 /* delay before the first scan */
110#define SECS_SCAN_WAIT 600 /* subsequent auto scanning delay */ 108#define SECS_SCAN_WAIT 600 /* subsequent auto scanning delay */
109#define GRAY_LIST_PASSES 25 /* maximum number of gray list scans */
111 110
112#define BYTES_PER_POINTER sizeof(void *) 111#define BYTES_PER_POINTER sizeof(void *)
113 112
@@ -159,6 +158,8 @@ struct kmemleak_object {
159#define OBJECT_REPORTED (1 << 1) 158#define OBJECT_REPORTED (1 << 1)
160/* flag set to not scan the object */ 159/* flag set to not scan the object */
161#define OBJECT_NO_SCAN (1 << 2) 160#define OBJECT_NO_SCAN (1 << 2)
161/* flag set on newly allocated objects */
162#define OBJECT_NEW (1 << 3)
162 163
163/* the list of all allocated objects */ 164/* the list of all allocated objects */
164static LIST_HEAD(object_list); 165static LIST_HEAD(object_list);
@@ -186,22 +187,16 @@ static atomic_t kmemleak_error = ATOMIC_INIT(0);
186static unsigned long min_addr = ULONG_MAX; 187static unsigned long min_addr = ULONG_MAX;
187static unsigned long max_addr; 188static unsigned long max_addr;
188 189
189/* used for yielding the CPU to other tasks during scanning */
190static unsigned long next_scan_yield;
191static struct task_struct *scan_thread; 190static struct task_struct *scan_thread;
192static unsigned long jiffies_scan_yield; 191/* used to avoid reporting of recently allocated objects */
193static unsigned long jiffies_min_age; 192static unsigned long jiffies_min_age;
193static unsigned long jiffies_last_scan;
194/* delay between automatic memory scannings */ 194/* delay between automatic memory scannings */
195static signed long jiffies_scan_wait; 195static signed long jiffies_scan_wait;
196/* enables or disables the task stacks scanning */ 196/* enables or disables the task stacks scanning */
197static int kmemleak_stack_scan; 197static int kmemleak_stack_scan = 1;
198/* mutex protecting the memory scanning */ 198/* protects the memory scanning, parameters and debug/kmemleak file access */
199static DEFINE_MUTEX(scan_mutex); 199static DEFINE_MUTEX(scan_mutex);
200/* mutex protecting the access to the /sys/kernel/debug/kmemleak file */
201static DEFINE_MUTEX(kmemleak_mutex);
202
203/* number of leaks reported (for limitation purposes) */
204static int reported_leaks;
205 200
206/* 201/*
207 * Early object allocation/freeing logging. Kmemleak is initialized after the 202 * Early object allocation/freeing logging. Kmemleak is initialized after the
@@ -215,6 +210,7 @@ static int reported_leaks;
215enum { 210enum {
216 KMEMLEAK_ALLOC, 211 KMEMLEAK_ALLOC,
217 KMEMLEAK_FREE, 212 KMEMLEAK_FREE,
213 KMEMLEAK_FREE_PART,
218 KMEMLEAK_NOT_LEAK, 214 KMEMLEAK_NOT_LEAK,
219 KMEMLEAK_IGNORE, 215 KMEMLEAK_IGNORE,
220 KMEMLEAK_SCAN_AREA, 216 KMEMLEAK_SCAN_AREA,
@@ -235,7 +231,7 @@ struct early_log {
235}; 231};
236 232
237/* early logging buffer and current position */ 233/* early logging buffer and current position */
238static struct early_log early_log[200]; 234static struct early_log early_log[CONFIG_DEBUG_KMEMLEAK_EARLY_LOG_SIZE];
239static int crt_early_log; 235static int crt_early_log;
240 236
241static void kmemleak_disable(void); 237static void kmemleak_disable(void);
@@ -278,13 +274,9 @@ static int color_gray(const struct kmemleak_object *object)
278 return object->min_count != -1 && object->count >= object->min_count; 274 return object->min_count != -1 && object->count >= object->min_count;
279} 275}
280 276
281/* 277static int color_black(const struct kmemleak_object *object)
282 * Objects are considered referenced if their color is gray and they have not
283 * been deleted.
284 */
285static int referenced_object(struct kmemleak_object *object)
286{ 278{
287 return (object->flags & OBJECT_ALLOCATED) && color_gray(object); 279 return object->min_count == -1;
288} 280}
289 281
290/* 282/*
@@ -295,42 +287,28 @@ static int referenced_object(struct kmemleak_object *object)
295static int unreferenced_object(struct kmemleak_object *object) 287static int unreferenced_object(struct kmemleak_object *object)
296{ 288{
297 return (object->flags & OBJECT_ALLOCATED) && color_white(object) && 289 return (object->flags & OBJECT_ALLOCATED) && color_white(object) &&
298 time_is_before_eq_jiffies(object->jiffies + jiffies_min_age); 290 time_before_eq(object->jiffies + jiffies_min_age,
291 jiffies_last_scan);
299} 292}
300 293
301/* 294/*
302 * Printing of the (un)referenced objects information, either to the seq file 295 * Printing of the unreferenced objects information to the seq file. The
303 * or to the kernel log. The print_referenced/print_unreferenced functions 296 * print_unreferenced function must be called with the object->lock held.
304 * must be called with the object->lock held.
305 */ 297 */
306#define print_helper(seq, x...) do { \
307 struct seq_file *s = (seq); \
308 if (s) \
309 seq_printf(s, x); \
310 else \
311 pr_info(x); \
312} while (0)
313
314static void print_referenced(struct kmemleak_object *object)
315{
316 pr_info("referenced object 0x%08lx (size %zu)\n",
317 object->pointer, object->size);
318}
319
320static void print_unreferenced(struct seq_file *seq, 298static void print_unreferenced(struct seq_file *seq,
321 struct kmemleak_object *object) 299 struct kmemleak_object *object)
322{ 300{
323 int i; 301 int i;
324 302
325 print_helper(seq, "unreferenced object 0x%08lx (size %zu):\n", 303 seq_printf(seq, "unreferenced object 0x%08lx (size %zu):\n",
326 object->pointer, object->size); 304 object->pointer, object->size);
327 print_helper(seq, " comm \"%s\", pid %d, jiffies %lu\n", 305 seq_printf(seq, " comm \"%s\", pid %d, jiffies %lu\n",
328 object->comm, object->pid, object->jiffies); 306 object->comm, object->pid, object->jiffies);
329 print_helper(seq, " backtrace:\n"); 307 seq_printf(seq, " backtrace:\n");
330 308
331 for (i = 0; i < object->trace_len; i++) { 309 for (i = 0; i < object->trace_len; i++) {
332 void *ptr = (void *)object->trace[i]; 310 void *ptr = (void *)object->trace[i];
333 print_helper(seq, " [<%p>] %pS\n", ptr, ptr); 311 seq_printf(seq, " [<%p>] %pS\n", ptr, ptr);
334 } 312 }
335} 313}
336 314
@@ -478,7 +456,7 @@ static void create_object(unsigned long ptr, size_t size, int min_count,
478 INIT_HLIST_HEAD(&object->area_list); 456 INIT_HLIST_HEAD(&object->area_list);
479 spin_lock_init(&object->lock); 457 spin_lock_init(&object->lock);
480 atomic_set(&object->use_count, 1); 458 atomic_set(&object->use_count, 1);
481 object->flags = OBJECT_ALLOCATED; 459 object->flags = OBJECT_ALLOCATED | OBJECT_NEW;
482 object->pointer = ptr; 460 object->pointer = ptr;
483 object->size = size; 461 object->size = size;
484 object->min_count = min_count; 462 object->min_count = min_count;
@@ -546,39 +524,87 @@ out:
546 * Remove the metadata (struct kmemleak_object) for a memory block from the 524 * Remove the metadata (struct kmemleak_object) for a memory block from the
547 * object_list and object_tree_root and decrement its use_count. 525 * object_list and object_tree_root and decrement its use_count.
548 */ 526 */
549static void delete_object(unsigned long ptr) 527static void __delete_object(struct kmemleak_object *object)
550{ 528{
551 unsigned long flags; 529 unsigned long flags;
552 struct kmemleak_object *object;
553 530
554 write_lock_irqsave(&kmemleak_lock, flags); 531 write_lock_irqsave(&kmemleak_lock, flags);
555 object = lookup_object(ptr, 0);
556 if (!object) {
557 kmemleak_warn("Freeing unknown object at 0x%08lx\n",
558 ptr);
559 write_unlock_irqrestore(&kmemleak_lock, flags);
560 return;
561 }
562 prio_tree_remove(&object_tree_root, &object->tree_node); 532 prio_tree_remove(&object_tree_root, &object->tree_node);
563 list_del_rcu(&object->object_list); 533 list_del_rcu(&object->object_list);
564 write_unlock_irqrestore(&kmemleak_lock, flags); 534 write_unlock_irqrestore(&kmemleak_lock, flags);
565 535
566 WARN_ON(!(object->flags & OBJECT_ALLOCATED)); 536 WARN_ON(!(object->flags & OBJECT_ALLOCATED));
567 WARN_ON(atomic_read(&object->use_count) < 1); 537 WARN_ON(atomic_read(&object->use_count) < 2);
568 538
569 /* 539 /*
570 * Locking here also ensures that the corresponding memory block 540 * Locking here also ensures that the corresponding memory block
571 * cannot be freed when it is being scanned. 541 * cannot be freed when it is being scanned.
572 */ 542 */
573 spin_lock_irqsave(&object->lock, flags); 543 spin_lock_irqsave(&object->lock, flags);
574 if (object->flags & OBJECT_REPORTED)
575 print_referenced(object);
576 object->flags &= ~OBJECT_ALLOCATED; 544 object->flags &= ~OBJECT_ALLOCATED;
577 spin_unlock_irqrestore(&object->lock, flags); 545 spin_unlock_irqrestore(&object->lock, flags);
578 put_object(object); 546 put_object(object);
579} 547}
580 548
581/* 549/*
550 * Look up the metadata (struct kmemleak_object) corresponding to ptr and
551 * delete it.
552 */
553static void delete_object_full(unsigned long ptr)
554{
555 struct kmemleak_object *object;
556
557 object = find_and_get_object(ptr, 0);
558 if (!object) {
559#ifdef DEBUG
560 kmemleak_warn("Freeing unknown object at 0x%08lx\n",
561 ptr);
562#endif
563 return;
564 }
565 __delete_object(object);
566 put_object(object);
567}
568
569/*
570 * Look up the metadata (struct kmemleak_object) corresponding to ptr and
571 * delete it. If the memory block is partially freed, the function may create
572 * additional metadata for the remaining parts of the block.
573 */
574static void delete_object_part(unsigned long ptr, size_t size)
575{
576 struct kmemleak_object *object;
577 unsigned long start, end;
578
579 object = find_and_get_object(ptr, 1);
580 if (!object) {
581#ifdef DEBUG
582 kmemleak_warn("Partially freeing unknown object at 0x%08lx "
583 "(size %zu)\n", ptr, size);
584#endif
585 return;
586 }
587 __delete_object(object);
588
589 /*
590 * Create one or two objects that may result from the memory block
591 * split. Note that partial freeing is only done by free_bootmem() and
592 * this happens before kmemleak_init() is called. The path below is
593 * only executed during early log recording in kmemleak_init(), so
594 * GFP_KERNEL is enough.
595 */
596 start = object->pointer;
597 end = object->pointer + object->size;
598 if (ptr > start)
599 create_object(start, ptr - start, object->min_count,
600 GFP_KERNEL);
601 if (ptr + size < end)
602 create_object(ptr + size, end - ptr - size, object->min_count,
603 GFP_KERNEL);
604
605 put_object(object);
606}
607/*
582 * Make a object permanently as gray-colored so that it can no longer be 608 * Make a object permanently as gray-colored so that it can no longer be
583 * reported as a leak. This is used in general to mark a false positive. 609 * reported as a leak. This is used in general to mark a false positive.
584 */ 610 */
@@ -696,7 +722,8 @@ static void log_early(int op_type, const void *ptr, size_t size,
696 struct early_log *log; 722 struct early_log *log;
697 723
698 if (crt_early_log >= ARRAY_SIZE(early_log)) { 724 if (crt_early_log >= ARRAY_SIZE(early_log)) {
699 kmemleak_stop("Early log buffer exceeded\n"); 725 pr_warning("Early log buffer exceeded\n");
726 kmemleak_disable();
700 return; 727 return;
701 } 728 }
702 729
@@ -741,13 +768,28 @@ void kmemleak_free(const void *ptr)
741 pr_debug("%s(0x%p)\n", __func__, ptr); 768 pr_debug("%s(0x%p)\n", __func__, ptr);
742 769
743 if (atomic_read(&kmemleak_enabled) && ptr && !IS_ERR(ptr)) 770 if (atomic_read(&kmemleak_enabled) && ptr && !IS_ERR(ptr))
744 delete_object((unsigned long)ptr); 771 delete_object_full((unsigned long)ptr);
745 else if (atomic_read(&kmemleak_early_log)) 772 else if (atomic_read(&kmemleak_early_log))
746 log_early(KMEMLEAK_FREE, ptr, 0, 0, 0, 0); 773 log_early(KMEMLEAK_FREE, ptr, 0, 0, 0, 0);
747} 774}
748EXPORT_SYMBOL_GPL(kmemleak_free); 775EXPORT_SYMBOL_GPL(kmemleak_free);
749 776
750/* 777/*
778 * Partial memory freeing function callback. This function is usually called
779 * from bootmem allocator when (part of) a memory block is freed.
780 */
781void kmemleak_free_part(const void *ptr, size_t size)
782{
783 pr_debug("%s(0x%p)\n", __func__, ptr);
784
785 if (atomic_read(&kmemleak_enabled) && ptr && !IS_ERR(ptr))
786 delete_object_part((unsigned long)ptr, size);
787 else if (atomic_read(&kmemleak_early_log))
788 log_early(KMEMLEAK_FREE_PART, ptr, size, 0, 0, 0);
789}
790EXPORT_SYMBOL_GPL(kmemleak_free_part);
791
792/*
751 * Mark an already allocated memory block as a false positive. This will cause 793 * Mark an already allocated memory block as a false positive. This will cause
752 * the block to no longer be reported as leak and always be scanned. 794 * the block to no longer be reported as leak and always be scanned.
753 */ 795 */
@@ -808,21 +850,6 @@ void kmemleak_no_scan(const void *ptr)
808EXPORT_SYMBOL(kmemleak_no_scan); 850EXPORT_SYMBOL(kmemleak_no_scan);
809 851
810/* 852/*
811 * Yield the CPU so that other tasks get a chance to run. The yielding is
812 * rate-limited to avoid excessive number of calls to the schedule() function
813 * during memory scanning.
814 */
815static void scan_yield(void)
816{
817 might_sleep();
818
819 if (time_is_before_eq_jiffies(next_scan_yield)) {
820 schedule();
821 next_scan_yield = jiffies + jiffies_scan_yield;
822 }
823}
824
825/*
826 * Memory scanning is a long process and it needs to be interruptable. This 853 * Memory scanning is a long process and it needs to be interruptable. This
827 * function checks whether such interrupt condition occured. 854 * function checks whether such interrupt condition occured.
828 */ 855 */
@@ -848,7 +875,7 @@ static int scan_should_stop(void)
848 * found to the gray list. 875 * found to the gray list.
849 */ 876 */
850static void scan_block(void *_start, void *_end, 877static void scan_block(void *_start, void *_end,
851 struct kmemleak_object *scanned) 878 struct kmemleak_object *scanned, int allow_resched)
852{ 879{
853 unsigned long *ptr; 880 unsigned long *ptr;
854 unsigned long *start = PTR_ALIGN(_start, BYTES_PER_POINTER); 881 unsigned long *start = PTR_ALIGN(_start, BYTES_PER_POINTER);
@@ -859,18 +886,11 @@ static void scan_block(void *_start, void *_end,
859 unsigned long pointer = *ptr; 886 unsigned long pointer = *ptr;
860 struct kmemleak_object *object; 887 struct kmemleak_object *object;
861 888
889 if (allow_resched)
890 cond_resched();
862 if (scan_should_stop()) 891 if (scan_should_stop())
863 break; 892 break;
864 893
865 /*
866 * When scanning a memory block with a corresponding
867 * kmemleak_object, the CPU yielding is handled in the calling
868 * code since it holds the object->lock to avoid the block
869 * freeing.
870 */
871 if (!scanned)
872 scan_yield();
873
874 object = find_and_get_object(pointer, 1); 894 object = find_and_get_object(pointer, 1);
875 if (!object) 895 if (!object)
876 continue; 896 continue;
@@ -931,12 +951,12 @@ static void scan_object(struct kmemleak_object *object)
931 goto out; 951 goto out;
932 if (hlist_empty(&object->area_list)) 952 if (hlist_empty(&object->area_list))
933 scan_block((void *)object->pointer, 953 scan_block((void *)object->pointer,
934 (void *)(object->pointer + object->size), object); 954 (void *)(object->pointer + object->size), object, 0);
935 else 955 else
936 hlist_for_each_entry(area, elem, &object->area_list, node) 956 hlist_for_each_entry(area, elem, &object->area_list, node)
937 scan_block((void *)(object->pointer + area->offset), 957 scan_block((void *)(object->pointer + area->offset),
938 (void *)(object->pointer + area->offset 958 (void *)(object->pointer + area->offset
939 + area->length), object); 959 + area->length), object, 0);
940out: 960out:
941 spin_unlock_irqrestore(&object->lock, flags); 961 spin_unlock_irqrestore(&object->lock, flags);
942} 962}
@@ -952,6 +972,10 @@ static void kmemleak_scan(void)
952 struct kmemleak_object *object, *tmp; 972 struct kmemleak_object *object, *tmp;
953 struct task_struct *task; 973 struct task_struct *task;
954 int i; 974 int i;
975 int new_leaks = 0;
976 int gray_list_pass = 0;
977
978 jiffies_last_scan = jiffies;
955 979
956 /* prepare the kmemleak_object's */ 980 /* prepare the kmemleak_object's */
957 rcu_read_lock(); 981 rcu_read_lock();
@@ -970,6 +994,7 @@ static void kmemleak_scan(void)
970#endif 994#endif
971 /* reset the reference count (whiten the object) */ 995 /* reset the reference count (whiten the object) */
972 object->count = 0; 996 object->count = 0;
997 object->flags &= ~OBJECT_NEW;
973 if (color_gray(object) && get_object(object)) 998 if (color_gray(object) && get_object(object))
974 list_add_tail(&object->gray_list, &gray_list); 999 list_add_tail(&object->gray_list, &gray_list);
975 1000
@@ -978,14 +1003,14 @@ static void kmemleak_scan(void)
978 rcu_read_unlock(); 1003 rcu_read_unlock();
979 1004
980 /* data/bss scanning */ 1005 /* data/bss scanning */
981 scan_block(_sdata, _edata, NULL); 1006 scan_block(_sdata, _edata, NULL, 1);
982 scan_block(__bss_start, __bss_stop, NULL); 1007 scan_block(__bss_start, __bss_stop, NULL, 1);
983 1008
984#ifdef CONFIG_SMP 1009#ifdef CONFIG_SMP
985 /* per-cpu sections scanning */ 1010 /* per-cpu sections scanning */
986 for_each_possible_cpu(i) 1011 for_each_possible_cpu(i)
987 scan_block(__per_cpu_start + per_cpu_offset(i), 1012 scan_block(__per_cpu_start + per_cpu_offset(i),
988 __per_cpu_end + per_cpu_offset(i), NULL); 1013 __per_cpu_end + per_cpu_offset(i), NULL, 1);
989#endif 1014#endif
990 1015
991 /* 1016 /*
@@ -1007,7 +1032,7 @@ static void kmemleak_scan(void)
1007 /* only scan if page is in use */ 1032 /* only scan if page is in use */
1008 if (page_count(page) == 0) 1033 if (page_count(page) == 0)
1009 continue; 1034 continue;
1010 scan_block(page, page + 1, NULL); 1035 scan_block(page, page + 1, NULL, 1);
1011 } 1036 }
1012 } 1037 }
1013 1038
@@ -1019,7 +1044,8 @@ static void kmemleak_scan(void)
1019 read_lock(&tasklist_lock); 1044 read_lock(&tasklist_lock);
1020 for_each_process(task) 1045 for_each_process(task)
1021 scan_block(task_stack_page(task), 1046 scan_block(task_stack_page(task),
1022 task_stack_page(task) + THREAD_SIZE, NULL); 1047 task_stack_page(task) + THREAD_SIZE,
1048 NULL, 0);
1023 read_unlock(&tasklist_lock); 1049 read_unlock(&tasklist_lock);
1024 } 1050 }
1025 1051
@@ -1031,9 +1057,10 @@ static void kmemleak_scan(void)
1031 * kmemleak objects cannot be freed from outside the loop because their 1057 * kmemleak objects cannot be freed from outside the loop because their
1032 * use_count was increased. 1058 * use_count was increased.
1033 */ 1059 */
1060repeat:
1034 object = list_entry(gray_list.next, typeof(*object), gray_list); 1061 object = list_entry(gray_list.next, typeof(*object), gray_list);
1035 while (&object->gray_list != &gray_list) { 1062 while (&object->gray_list != &gray_list) {
1036 scan_yield(); 1063 cond_resched();
1037 1064
1038 /* may add new objects to the list */ 1065 /* may add new objects to the list */
1039 if (!scan_should_stop()) 1066 if (!scan_should_stop())
@@ -1048,7 +1075,59 @@ static void kmemleak_scan(void)
1048 1075
1049 object = tmp; 1076 object = tmp;
1050 } 1077 }
1078
1079 if (scan_should_stop() || ++gray_list_pass >= GRAY_LIST_PASSES)
1080 goto scan_end;
1081
1082 /*
1083 * Check for new objects allocated during this scanning and add them
1084 * to the gray list.
1085 */
1086 rcu_read_lock();
1087 list_for_each_entry_rcu(object, &object_list, object_list) {
1088 spin_lock_irqsave(&object->lock, flags);
1089 if ((object->flags & OBJECT_NEW) && !color_black(object) &&
1090 get_object(object)) {
1091 object->flags &= ~OBJECT_NEW;
1092 list_add_tail(&object->gray_list, &gray_list);
1093 }
1094 spin_unlock_irqrestore(&object->lock, flags);
1095 }
1096 rcu_read_unlock();
1097
1098 if (!list_empty(&gray_list))
1099 goto repeat;
1100
1101scan_end:
1051 WARN_ON(!list_empty(&gray_list)); 1102 WARN_ON(!list_empty(&gray_list));
1103
1104 /*
1105 * If scanning was stopped or new objects were being allocated at a
1106 * higher rate than gray list scanning, do not report any new
1107 * unreferenced objects.
1108 */
1109 if (scan_should_stop() || gray_list_pass >= GRAY_LIST_PASSES)
1110 return;
1111
1112 /*
1113 * Scanning result reporting.
1114 */
1115 rcu_read_lock();
1116 list_for_each_entry_rcu(object, &object_list, object_list) {
1117 spin_lock_irqsave(&object->lock, flags);
1118 if (unreferenced_object(object) &&
1119 !(object->flags & OBJECT_REPORTED)) {
1120 object->flags |= OBJECT_REPORTED;
1121 new_leaks++;
1122 }
1123 spin_unlock_irqrestore(&object->lock, flags);
1124 }
1125 rcu_read_unlock();
1126
1127 if (new_leaks)
1128 pr_info("%d new suspected memory leaks (see "
1129 "/sys/kernel/debug/kmemleak)\n", new_leaks);
1130
1052} 1131}
1053 1132
1054/* 1133/*
@@ -1060,6 +1139,7 @@ static int kmemleak_scan_thread(void *arg)
1060 static int first_run = 1; 1139 static int first_run = 1;
1061 1140
1062 pr_info("Automatic memory scanning thread started\n"); 1141 pr_info("Automatic memory scanning thread started\n");
1142 set_user_nice(current, 10);
1063 1143
1064 /* 1144 /*
1065 * Wait before the first scan to allow the system to fully initialize. 1145 * Wait before the first scan to allow the system to fully initialize.
@@ -1070,36 +1150,12 @@ static int kmemleak_scan_thread(void *arg)
1070 } 1150 }
1071 1151
1072 while (!kthread_should_stop()) { 1152 while (!kthread_should_stop()) {
1073 struct kmemleak_object *object;
1074 signed long timeout = jiffies_scan_wait; 1153 signed long timeout = jiffies_scan_wait;
1075 1154
1076 mutex_lock(&scan_mutex); 1155 mutex_lock(&scan_mutex);
1077
1078 kmemleak_scan(); 1156 kmemleak_scan();
1079 reported_leaks = 0;
1080
1081 rcu_read_lock();
1082 list_for_each_entry_rcu(object, &object_list, object_list) {
1083 unsigned long flags;
1084
1085 if (reported_leaks >= REPORTS_NR)
1086 break;
1087 spin_lock_irqsave(&object->lock, flags);
1088 if (!(object->flags & OBJECT_REPORTED) &&
1089 unreferenced_object(object)) {
1090 print_unreferenced(NULL, object);
1091 object->flags |= OBJECT_REPORTED;
1092 reported_leaks++;
1093 } else if ((object->flags & OBJECT_REPORTED) &&
1094 referenced_object(object)) {
1095 print_referenced(object);
1096 object->flags &= ~OBJECT_REPORTED;
1097 }
1098 spin_unlock_irqrestore(&object->lock, flags);
1099 }
1100 rcu_read_unlock();
1101
1102 mutex_unlock(&scan_mutex); 1157 mutex_unlock(&scan_mutex);
1158
1103 /* wait before the next scan */ 1159 /* wait before the next scan */
1104 while (timeout && !kthread_should_stop()) 1160 while (timeout && !kthread_should_stop())
1105 timeout = schedule_timeout_interruptible(timeout); 1161 timeout = schedule_timeout_interruptible(timeout);
@@ -1112,7 +1168,7 @@ static int kmemleak_scan_thread(void *arg)
1112 1168
1113/* 1169/*
1114 * Start the automatic memory scanning thread. This function must be called 1170 * Start the automatic memory scanning thread. This function must be called
1115 * with the kmemleak_mutex held. 1171 * with the scan_mutex held.
1116 */ 1172 */
1117void start_scan_thread(void) 1173void start_scan_thread(void)
1118{ 1174{
@@ -1127,7 +1183,7 @@ void start_scan_thread(void)
1127 1183
1128/* 1184/*
1129 * Stop the automatic memory scanning thread. This function must be called 1185 * Stop the automatic memory scanning thread. This function must be called
1130 * with the kmemleak_mutex held. 1186 * with the scan_mutex held.
1131 */ 1187 */
1132void stop_scan_thread(void) 1188void stop_scan_thread(void)
1133{ 1189{
@@ -1146,13 +1202,11 @@ static void *kmemleak_seq_start(struct seq_file *seq, loff_t *pos)
1146{ 1202{
1147 struct kmemleak_object *object; 1203 struct kmemleak_object *object;
1148 loff_t n = *pos; 1204 loff_t n = *pos;
1205 int err;
1149 1206
1150 if (!n) { 1207 err = mutex_lock_interruptible(&scan_mutex);
1151 kmemleak_scan(); 1208 if (err < 0)
1152 reported_leaks = 0; 1209 return ERR_PTR(err);
1153 }
1154 if (reported_leaks >= REPORTS_NR)
1155 return NULL;
1156 1210
1157 rcu_read_lock(); 1211 rcu_read_lock();
1158 list_for_each_entry_rcu(object, &object_list, object_list) { 1212 list_for_each_entry_rcu(object, &object_list, object_list) {
@@ -1163,7 +1217,6 @@ static void *kmemleak_seq_start(struct seq_file *seq, loff_t *pos)
1163 } 1217 }
1164 object = NULL; 1218 object = NULL;
1165out: 1219out:
1166 rcu_read_unlock();
1167 return object; 1220 return object;
1168} 1221}
1169 1222
@@ -1178,17 +1231,13 @@ static void *kmemleak_seq_next(struct seq_file *seq, void *v, loff_t *pos)
1178 struct list_head *n = &prev_obj->object_list; 1231 struct list_head *n = &prev_obj->object_list;
1179 1232
1180 ++(*pos); 1233 ++(*pos);
1181 if (reported_leaks >= REPORTS_NR)
1182 goto out;
1183 1234
1184 rcu_read_lock();
1185 list_for_each_continue_rcu(n, &object_list) { 1235 list_for_each_continue_rcu(n, &object_list) {
1186 next_obj = list_entry(n, struct kmemleak_object, object_list); 1236 next_obj = list_entry(n, struct kmemleak_object, object_list);
1187 if (get_object(next_obj)) 1237 if (get_object(next_obj))
1188 break; 1238 break;
1189 } 1239 }
1190 rcu_read_unlock(); 1240
1191out:
1192 put_object(prev_obj); 1241 put_object(prev_obj);
1193 return next_obj; 1242 return next_obj;
1194} 1243}
@@ -1198,8 +1247,16 @@ out:
1198 */ 1247 */
1199static void kmemleak_seq_stop(struct seq_file *seq, void *v) 1248static void kmemleak_seq_stop(struct seq_file *seq, void *v)
1200{ 1249{
1201 if (v) 1250 if (!IS_ERR(v)) {
1202 put_object(v); 1251 /*
1252 * kmemleak_seq_start may return ERR_PTR if the scan_mutex
1253 * waiting was interrupted, so only release it if !IS_ERR.
1254 */
1255 rcu_read_unlock();
1256 mutex_unlock(&scan_mutex);
1257 if (v)
1258 put_object(v);
1259 }
1203} 1260}
1204 1261
1205/* 1262/*
@@ -1211,11 +1268,8 @@ static int kmemleak_seq_show(struct seq_file *seq, void *v)
1211 unsigned long flags; 1268 unsigned long flags;
1212 1269
1213 spin_lock_irqsave(&object->lock, flags); 1270 spin_lock_irqsave(&object->lock, flags);
1214 if (!unreferenced_object(object)) 1271 if ((object->flags & OBJECT_REPORTED) && unreferenced_object(object))
1215 goto out; 1272 print_unreferenced(seq, object);
1216 print_unreferenced(seq, object);
1217 reported_leaks++;
1218out:
1219 spin_unlock_irqrestore(&object->lock, flags); 1273 spin_unlock_irqrestore(&object->lock, flags);
1220 return 0; 1274 return 0;
1221} 1275}
@@ -1229,43 +1283,15 @@ static const struct seq_operations kmemleak_seq_ops = {
1229 1283
1230static int kmemleak_open(struct inode *inode, struct file *file) 1284static int kmemleak_open(struct inode *inode, struct file *file)
1231{ 1285{
1232 int ret = 0;
1233
1234 if (!atomic_read(&kmemleak_enabled)) 1286 if (!atomic_read(&kmemleak_enabled))
1235 return -EBUSY; 1287 return -EBUSY;
1236 1288
1237 ret = mutex_lock_interruptible(&kmemleak_mutex); 1289 return seq_open(file, &kmemleak_seq_ops);
1238 if (ret < 0)
1239 goto out;
1240 if (file->f_mode & FMODE_READ) {
1241 ret = mutex_lock_interruptible(&scan_mutex);
1242 if (ret < 0)
1243 goto kmemleak_unlock;
1244 ret = seq_open(file, &kmemleak_seq_ops);
1245 if (ret < 0)
1246 goto scan_unlock;
1247 }
1248 return ret;
1249
1250scan_unlock:
1251 mutex_unlock(&scan_mutex);
1252kmemleak_unlock:
1253 mutex_unlock(&kmemleak_mutex);
1254out:
1255 return ret;
1256} 1290}
1257 1291
1258static int kmemleak_release(struct inode *inode, struct file *file) 1292static int kmemleak_release(struct inode *inode, struct file *file)
1259{ 1293{
1260 int ret = 0; 1294 return seq_release(inode, file);
1261
1262 if (file->f_mode & FMODE_READ) {
1263 seq_release(inode, file);
1264 mutex_unlock(&scan_mutex);
1265 }
1266 mutex_unlock(&kmemleak_mutex);
1267
1268 return ret;
1269} 1295}
1270 1296
1271/* 1297/*
@@ -1278,21 +1304,24 @@ static int kmemleak_release(struct inode *inode, struct file *file)
1278 * scan=off - stop the automatic memory scanning thread 1304 * scan=off - stop the automatic memory scanning thread
1279 * scan=... - set the automatic memory scanning period in seconds (0 to 1305 * scan=... - set the automatic memory scanning period in seconds (0 to
1280 * disable it) 1306 * disable it)
1307 * scan - trigger a memory scan
1281 */ 1308 */
1282static ssize_t kmemleak_write(struct file *file, const char __user *user_buf, 1309static ssize_t kmemleak_write(struct file *file, const char __user *user_buf,
1283 size_t size, loff_t *ppos) 1310 size_t size, loff_t *ppos)
1284{ 1311{
1285 char buf[64]; 1312 char buf[64];
1286 int buf_size; 1313 int buf_size;
1287 1314 int ret;
1288 if (!atomic_read(&kmemleak_enabled))
1289 return -EBUSY;
1290 1315
1291 buf_size = min(size, (sizeof(buf) - 1)); 1316 buf_size = min(size, (sizeof(buf) - 1));
1292 if (strncpy_from_user(buf, user_buf, buf_size) < 0) 1317 if (strncpy_from_user(buf, user_buf, buf_size) < 0)
1293 return -EFAULT; 1318 return -EFAULT;
1294 buf[buf_size] = 0; 1319 buf[buf_size] = 0;
1295 1320
1321 ret = mutex_lock_interruptible(&scan_mutex);
1322 if (ret < 0)
1323 return ret;
1324
1296 if (strncmp(buf, "off", 3) == 0) 1325 if (strncmp(buf, "off", 3) == 0)
1297 kmemleak_disable(); 1326 kmemleak_disable();
1298 else if (strncmp(buf, "stack=on", 8) == 0) 1327 else if (strncmp(buf, "stack=on", 8) == 0)
@@ -1305,18 +1334,24 @@ static ssize_t kmemleak_write(struct file *file, const char __user *user_buf,
1305 stop_scan_thread(); 1334 stop_scan_thread();
1306 else if (strncmp(buf, "scan=", 5) == 0) { 1335 else if (strncmp(buf, "scan=", 5) == 0) {
1307 unsigned long secs; 1336 unsigned long secs;
1308 int err;
1309 1337
1310 err = strict_strtoul(buf + 5, 0, &secs); 1338 ret = strict_strtoul(buf + 5, 0, &secs);
1311 if (err < 0) 1339 if (ret < 0)
1312 return err; 1340 goto out;
1313 stop_scan_thread(); 1341 stop_scan_thread();
1314 if (secs) { 1342 if (secs) {
1315 jiffies_scan_wait = msecs_to_jiffies(secs * 1000); 1343 jiffies_scan_wait = msecs_to_jiffies(secs * 1000);
1316 start_scan_thread(); 1344 start_scan_thread();
1317 } 1345 }
1318 } else 1346 } else if (strncmp(buf, "scan", 4) == 0)
1319 return -EINVAL; 1347 kmemleak_scan();
1348 else
1349 ret = -EINVAL;
1350
1351out:
1352 mutex_unlock(&scan_mutex);
1353 if (ret < 0)
1354 return ret;
1320 1355
1321 /* ignore the rest of the buffer, only one command at a time */ 1356 /* ignore the rest of the buffer, only one command at a time */
1322 *ppos += size; 1357 *ppos += size;
@@ -1340,14 +1375,12 @@ static int kmemleak_cleanup_thread(void *arg)
1340{ 1375{
1341 struct kmemleak_object *object; 1376 struct kmemleak_object *object;
1342 1377
1343 mutex_lock(&kmemleak_mutex); 1378 mutex_lock(&scan_mutex);
1344 stop_scan_thread(); 1379 stop_scan_thread();
1345 mutex_unlock(&kmemleak_mutex);
1346 1380
1347 mutex_lock(&scan_mutex);
1348 rcu_read_lock(); 1381 rcu_read_lock();
1349 list_for_each_entry_rcu(object, &object_list, object_list) 1382 list_for_each_entry_rcu(object, &object_list, object_list)
1350 delete_object(object->pointer); 1383 delete_object_full(object->pointer);
1351 rcu_read_unlock(); 1384 rcu_read_unlock();
1352 mutex_unlock(&scan_mutex); 1385 mutex_unlock(&scan_mutex);
1353 1386
@@ -1411,7 +1444,6 @@ void __init kmemleak_init(void)
1411 int i; 1444 int i;
1412 unsigned long flags; 1445 unsigned long flags;
1413 1446
1414 jiffies_scan_yield = msecs_to_jiffies(MSECS_SCAN_YIELD);
1415 jiffies_min_age = msecs_to_jiffies(MSECS_MIN_AGE); 1447 jiffies_min_age = msecs_to_jiffies(MSECS_MIN_AGE);
1416 jiffies_scan_wait = msecs_to_jiffies(SECS_SCAN_WAIT * 1000); 1448 jiffies_scan_wait = msecs_to_jiffies(SECS_SCAN_WAIT * 1000);
1417 1449
@@ -1443,6 +1475,9 @@ void __init kmemleak_init(void)
1443 case KMEMLEAK_FREE: 1475 case KMEMLEAK_FREE:
1444 kmemleak_free(log->ptr); 1476 kmemleak_free(log->ptr);
1445 break; 1477 break;
1478 case KMEMLEAK_FREE_PART:
1479 kmemleak_free_part(log->ptr, log->size);
1480 break;
1446 case KMEMLEAK_NOT_LEAK: 1481 case KMEMLEAK_NOT_LEAK:
1447 kmemleak_not_leak(log->ptr); 1482 kmemleak_not_leak(log->ptr);
1448 break; 1483 break;
@@ -1486,9 +1521,9 @@ static int __init kmemleak_late_init(void)
1486 &kmemleak_fops); 1521 &kmemleak_fops);
1487 if (!dentry) 1522 if (!dentry)
1488 pr_warning("Failed to create the debugfs kmemleak file\n"); 1523 pr_warning("Failed to create the debugfs kmemleak file\n");
1489 mutex_lock(&kmemleak_mutex); 1524 mutex_lock(&scan_mutex);
1490 start_scan_thread(); 1525 start_scan_thread();
1491 mutex_unlock(&kmemleak_mutex); 1526 mutex_unlock(&scan_mutex);
1492 1527
1493 pr_info("Kernel memory leak detector initialized\n"); 1528 pr_info("Kernel memory leak detector initialized\n");
1494 1529
diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index e2fa20dadf40..fd4529d86de5 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -1207,6 +1207,12 @@ static int mem_cgroup_move_account(struct page_cgroup *pc,
1207 ret = 0; 1207 ret = 0;
1208out: 1208out:
1209 unlock_page_cgroup(pc); 1209 unlock_page_cgroup(pc);
1210 /*
1211 * We charges against "to" which may not have any tasks. Then, "to"
1212 * can be under rmdir(). But in current implementation, caller of
1213 * this function is just force_empty() and it's garanteed that
1214 * "to" is never removed. So, we don't check rmdir status here.
1215 */
1210 return ret; 1216 return ret;
1211} 1217}
1212 1218
@@ -1428,6 +1434,7 @@ __mem_cgroup_commit_charge_swapin(struct page *page, struct mem_cgroup *ptr,
1428 return; 1434 return;
1429 if (!ptr) 1435 if (!ptr)
1430 return; 1436 return;
1437 cgroup_exclude_rmdir(&ptr->css);
1431 pc = lookup_page_cgroup(page); 1438 pc = lookup_page_cgroup(page);
1432 mem_cgroup_lru_del_before_commit_swapcache(page); 1439 mem_cgroup_lru_del_before_commit_swapcache(page);
1433 __mem_cgroup_commit_charge(ptr, pc, ctype); 1440 __mem_cgroup_commit_charge(ptr, pc, ctype);
@@ -1457,8 +1464,12 @@ __mem_cgroup_commit_charge_swapin(struct page *page, struct mem_cgroup *ptr,
1457 } 1464 }
1458 rcu_read_unlock(); 1465 rcu_read_unlock();
1459 } 1466 }
1460 /* add this page(page_cgroup) to the LRU we want. */ 1467 /*
1461 1468 * At swapin, we may charge account against cgroup which has no tasks.
1469 * So, rmdir()->pre_destroy() can be called while we do this charge.
1470 * In that case, we need to call pre_destroy() again. check it here.
1471 */
1472 cgroup_release_and_wakeup_rmdir(&ptr->css);
1462} 1473}
1463 1474
1464void mem_cgroup_commit_charge_swapin(struct page *page, struct mem_cgroup *ptr) 1475void mem_cgroup_commit_charge_swapin(struct page *page, struct mem_cgroup *ptr)
@@ -1664,7 +1675,7 @@ void mem_cgroup_end_migration(struct mem_cgroup *mem,
1664 1675
1665 if (!mem) 1676 if (!mem)
1666 return; 1677 return;
1667 1678 cgroup_exclude_rmdir(&mem->css);
1668 /* at migration success, oldpage->mapping is NULL. */ 1679 /* at migration success, oldpage->mapping is NULL. */
1669 if (oldpage->mapping) { 1680 if (oldpage->mapping) {
1670 target = oldpage; 1681 target = oldpage;
@@ -1704,6 +1715,12 @@ void mem_cgroup_end_migration(struct mem_cgroup *mem,
1704 */ 1715 */
1705 if (ctype == MEM_CGROUP_CHARGE_TYPE_MAPPED) 1716 if (ctype == MEM_CGROUP_CHARGE_TYPE_MAPPED)
1706 mem_cgroup_uncharge_page(target); 1717 mem_cgroup_uncharge_page(target);
1718 /*
1719 * At migration, we may charge account against cgroup which has no tasks
1720 * So, rmdir()->pre_destroy() can be called while we do this charge.
1721 * In that case, we need to call pre_destroy() again. check it here.
1722 */
1723 cgroup_release_and_wakeup_rmdir(&mem->css);
1707} 1724}
1708 1725
1709/* 1726/*
@@ -1973,7 +1990,7 @@ try_to_free:
1973 if (!progress) { 1990 if (!progress) {
1974 nr_retries--; 1991 nr_retries--;
1975 /* maybe some writeback is necessary */ 1992 /* maybe some writeback is necessary */
1976 congestion_wait(WRITE, HZ/10); 1993 congestion_wait(BLK_RW_ASYNC, HZ/10);
1977 } 1994 }
1978 1995
1979 } 1996 }
diff --git a/mm/memory.c b/mm/memory.c
index f46ac18ba231..aede2ce3aba4 100644
--- a/mm/memory.c
+++ b/mm/memory.c
@@ -135,11 +135,12 @@ void pmd_clear_bad(pmd_t *pmd)
135 * Note: this doesn't free the actual pages themselves. That 135 * Note: this doesn't free the actual pages themselves. That
136 * has been handled earlier when unmapping all the memory regions. 136 * has been handled earlier when unmapping all the memory regions.
137 */ 137 */
138static void free_pte_range(struct mmu_gather *tlb, pmd_t *pmd) 138static void free_pte_range(struct mmu_gather *tlb, pmd_t *pmd,
139 unsigned long addr)
139{ 140{
140 pgtable_t token = pmd_pgtable(*pmd); 141 pgtable_t token = pmd_pgtable(*pmd);
141 pmd_clear(pmd); 142 pmd_clear(pmd);
142 pte_free_tlb(tlb, token); 143 pte_free_tlb(tlb, token, addr);
143 tlb->mm->nr_ptes--; 144 tlb->mm->nr_ptes--;
144} 145}
145 146
@@ -157,7 +158,7 @@ static inline void free_pmd_range(struct mmu_gather *tlb, pud_t *pud,
157 next = pmd_addr_end(addr, end); 158 next = pmd_addr_end(addr, end);
158 if (pmd_none_or_clear_bad(pmd)) 159 if (pmd_none_or_clear_bad(pmd))
159 continue; 160 continue;
160 free_pte_range(tlb, pmd); 161 free_pte_range(tlb, pmd, addr);
161 } while (pmd++, addr = next, addr != end); 162 } while (pmd++, addr = next, addr != end);
162 163
163 start &= PUD_MASK; 164 start &= PUD_MASK;
@@ -173,7 +174,7 @@ static inline void free_pmd_range(struct mmu_gather *tlb, pud_t *pud,
173 174
174 pmd = pmd_offset(pud, start); 175 pmd = pmd_offset(pud, start);
175 pud_clear(pud); 176 pud_clear(pud);
176 pmd_free_tlb(tlb, pmd); 177 pmd_free_tlb(tlb, pmd, start);
177} 178}
178 179
179static inline void free_pud_range(struct mmu_gather *tlb, pgd_t *pgd, 180static inline void free_pud_range(struct mmu_gather *tlb, pgd_t *pgd,
@@ -206,7 +207,7 @@ static inline void free_pud_range(struct mmu_gather *tlb, pgd_t *pgd,
206 207
207 pud = pud_offset(pgd, start); 208 pud = pud_offset(pgd, start);
208 pgd_clear(pgd); 209 pgd_clear(pgd);
209 pud_free_tlb(tlb, pud); 210 pud_free_tlb(tlb, pud, start);
210} 211}
211 212
212/* 213/*
@@ -1207,8 +1208,8 @@ static inline int use_zero_page(struct vm_area_struct *vma)
1207 1208
1208 1209
1209int __get_user_pages(struct task_struct *tsk, struct mm_struct *mm, 1210int __get_user_pages(struct task_struct *tsk, struct mm_struct *mm,
1210 unsigned long start, int len, int flags, 1211 unsigned long start, int nr_pages, int flags,
1211 struct page **pages, struct vm_area_struct **vmas) 1212 struct page **pages, struct vm_area_struct **vmas)
1212{ 1213{
1213 int i; 1214 int i;
1214 unsigned int vm_flags = 0; 1215 unsigned int vm_flags = 0;
@@ -1217,7 +1218,7 @@ int __get_user_pages(struct task_struct *tsk, struct mm_struct *mm,
1217 int ignore = !!(flags & GUP_FLAGS_IGNORE_VMA_PERMISSIONS); 1218 int ignore = !!(flags & GUP_FLAGS_IGNORE_VMA_PERMISSIONS);
1218 int ignore_sigkill = !!(flags & GUP_FLAGS_IGNORE_SIGKILL); 1219 int ignore_sigkill = !!(flags & GUP_FLAGS_IGNORE_SIGKILL);
1219 1220
1220 if (len <= 0) 1221 if (nr_pages <= 0)
1221 return 0; 1222 return 0;
1222 /* 1223 /*
1223 * Require read or write permissions. 1224 * Require read or write permissions.
@@ -1269,7 +1270,7 @@ int __get_user_pages(struct task_struct *tsk, struct mm_struct *mm,
1269 vmas[i] = gate_vma; 1270 vmas[i] = gate_vma;
1270 i++; 1271 i++;
1271 start += PAGE_SIZE; 1272 start += PAGE_SIZE;
1272 len--; 1273 nr_pages--;
1273 continue; 1274 continue;
1274 } 1275 }
1275 1276
@@ -1280,7 +1281,7 @@ int __get_user_pages(struct task_struct *tsk, struct mm_struct *mm,
1280 1281
1281 if (is_vm_hugetlb_page(vma)) { 1282 if (is_vm_hugetlb_page(vma)) {
1282 i = follow_hugetlb_page(mm, vma, pages, vmas, 1283 i = follow_hugetlb_page(mm, vma, pages, vmas,
1283 &start, &len, i, write); 1284 &start, &nr_pages, i, write);
1284 continue; 1285 continue;
1285 } 1286 }
1286 1287
@@ -1357,9 +1358,9 @@ int __get_user_pages(struct task_struct *tsk, struct mm_struct *mm,
1357 vmas[i] = vma; 1358 vmas[i] = vma;
1358 i++; 1359 i++;
1359 start += PAGE_SIZE; 1360 start += PAGE_SIZE;
1360 len--; 1361 nr_pages--;
1361 } while (len && start < vma->vm_end); 1362 } while (nr_pages && start < vma->vm_end);
1362 } while (len); 1363 } while (nr_pages);
1363 return i; 1364 return i;
1364} 1365}
1365 1366
@@ -1368,7 +1369,7 @@ int __get_user_pages(struct task_struct *tsk, struct mm_struct *mm,
1368 * @tsk: task_struct of target task 1369 * @tsk: task_struct of target task
1369 * @mm: mm_struct of target mm 1370 * @mm: mm_struct of target mm
1370 * @start: starting user address 1371 * @start: starting user address
1371 * @len: number of pages from start to pin 1372 * @nr_pages: number of pages from start to pin
1372 * @write: whether pages will be written to by the caller 1373 * @write: whether pages will be written to by the caller
1373 * @force: whether to force write access even if user mapping is 1374 * @force: whether to force write access even if user mapping is
1374 * readonly. This will result in the page being COWed even 1375 * readonly. This will result in the page being COWed even
@@ -1380,7 +1381,7 @@ int __get_user_pages(struct task_struct *tsk, struct mm_struct *mm,
1380 * Or NULL if the caller does not require them. 1381 * Or NULL if the caller does not require them.
1381 * 1382 *
1382 * Returns number of pages pinned. This may be fewer than the number 1383 * Returns number of pages pinned. This may be fewer than the number
1383 * requested. If len is 0 or negative, returns 0. If no pages 1384 * requested. If nr_pages is 0 or negative, returns 0. If no pages
1384 * were pinned, returns -errno. Each page returned must be released 1385 * were pinned, returns -errno. Each page returned must be released
1385 * with a put_page() call when it is finished with. vmas will only 1386 * with a put_page() call when it is finished with. vmas will only
1386 * remain valid while mmap_sem is held. 1387 * remain valid while mmap_sem is held.
@@ -1414,7 +1415,7 @@ int __get_user_pages(struct task_struct *tsk, struct mm_struct *mm,
1414 * See also get_user_pages_fast, for performance critical applications. 1415 * See also get_user_pages_fast, for performance critical applications.
1415 */ 1416 */
1416int get_user_pages(struct task_struct *tsk, struct mm_struct *mm, 1417int get_user_pages(struct task_struct *tsk, struct mm_struct *mm,
1417 unsigned long start, int len, int write, int force, 1418 unsigned long start, int nr_pages, int write, int force,
1418 struct page **pages, struct vm_area_struct **vmas) 1419 struct page **pages, struct vm_area_struct **vmas)
1419{ 1420{
1420 int flags = 0; 1421 int flags = 0;
@@ -1424,9 +1425,7 @@ int get_user_pages(struct task_struct *tsk, struct mm_struct *mm,
1424 if (force) 1425 if (force)
1425 flags |= GUP_FLAGS_FORCE; 1426 flags |= GUP_FLAGS_FORCE;
1426 1427
1427 return __get_user_pages(tsk, mm, 1428 return __get_user_pages(tsk, mm, start, nr_pages, flags, pages, vmas);
1428 start, len, flags,
1429 pages, vmas);
1430} 1429}
1431 1430
1432EXPORT_SYMBOL(get_user_pages); 1431EXPORT_SYMBOL(get_user_pages);
diff --git a/mm/mempolicy.c b/mm/mempolicy.c
index e08e2c4da63a..7dd9d9f80694 100644
--- a/mm/mempolicy.c
+++ b/mm/mempolicy.c
@@ -191,25 +191,27 @@ static int mpol_new_bind(struct mempolicy *pol, const nodemask_t *nodes)
191 * Must be called holding task's alloc_lock to protect task's mems_allowed 191 * Must be called holding task's alloc_lock to protect task's mems_allowed
192 * and mempolicy. May also be called holding the mmap_semaphore for write. 192 * and mempolicy. May also be called holding the mmap_semaphore for write.
193 */ 193 */
194static int mpol_set_nodemask(struct mempolicy *pol, const nodemask_t *nodes) 194static int mpol_set_nodemask(struct mempolicy *pol,
195 const nodemask_t *nodes, struct nodemask_scratch *nsc)
195{ 196{
196 nodemask_t cpuset_context_nmask;
197 int ret; 197 int ret;
198 198
199 /* if mode is MPOL_DEFAULT, pol is NULL. This is right. */ 199 /* if mode is MPOL_DEFAULT, pol is NULL. This is right. */
200 if (pol == NULL) 200 if (pol == NULL)
201 return 0; 201 return 0;
202 /* Check N_HIGH_MEMORY */
203 nodes_and(nsc->mask1,
204 cpuset_current_mems_allowed, node_states[N_HIGH_MEMORY]);
202 205
203 VM_BUG_ON(!nodes); 206 VM_BUG_ON(!nodes);
204 if (pol->mode == MPOL_PREFERRED && nodes_empty(*nodes)) 207 if (pol->mode == MPOL_PREFERRED && nodes_empty(*nodes))
205 nodes = NULL; /* explicit local allocation */ 208 nodes = NULL; /* explicit local allocation */
206 else { 209 else {
207 if (pol->flags & MPOL_F_RELATIVE_NODES) 210 if (pol->flags & MPOL_F_RELATIVE_NODES)
208 mpol_relative_nodemask(&cpuset_context_nmask, nodes, 211 mpol_relative_nodemask(&nsc->mask2, nodes,&nsc->mask1);
209 &cpuset_current_mems_allowed);
210 else 212 else
211 nodes_and(cpuset_context_nmask, *nodes, 213 nodes_and(nsc->mask2, *nodes, nsc->mask1);
212 cpuset_current_mems_allowed); 214
213 if (mpol_store_user_nodemask(pol)) 215 if (mpol_store_user_nodemask(pol))
214 pol->w.user_nodemask = *nodes; 216 pol->w.user_nodemask = *nodes;
215 else 217 else
@@ -217,8 +219,10 @@ static int mpol_set_nodemask(struct mempolicy *pol, const nodemask_t *nodes)
217 cpuset_current_mems_allowed; 219 cpuset_current_mems_allowed;
218 } 220 }
219 221
220 ret = mpol_ops[pol->mode].create(pol, 222 if (nodes)
221 nodes ? &cpuset_context_nmask : NULL); 223 ret = mpol_ops[pol->mode].create(pol, &nsc->mask2);
224 else
225 ret = mpol_ops[pol->mode].create(pol, NULL);
222 return ret; 226 return ret;
223} 227}
224 228
@@ -620,12 +624,17 @@ static long do_set_mempolicy(unsigned short mode, unsigned short flags,
620{ 624{
621 struct mempolicy *new, *old; 625 struct mempolicy *new, *old;
622 struct mm_struct *mm = current->mm; 626 struct mm_struct *mm = current->mm;
627 NODEMASK_SCRATCH(scratch);
623 int ret; 628 int ret;
624 629
625 new = mpol_new(mode, flags, nodes); 630 if (!scratch)
626 if (IS_ERR(new)) 631 return -ENOMEM;
627 return PTR_ERR(new);
628 632
633 new = mpol_new(mode, flags, nodes);
634 if (IS_ERR(new)) {
635 ret = PTR_ERR(new);
636 goto out;
637 }
629 /* 638 /*
630 * prevent changing our mempolicy while show_numa_maps() 639 * prevent changing our mempolicy while show_numa_maps()
631 * is using it. 640 * is using it.
@@ -635,13 +644,13 @@ static long do_set_mempolicy(unsigned short mode, unsigned short flags,
635 if (mm) 644 if (mm)
636 down_write(&mm->mmap_sem); 645 down_write(&mm->mmap_sem);
637 task_lock(current); 646 task_lock(current);
638 ret = mpol_set_nodemask(new, nodes); 647 ret = mpol_set_nodemask(new, nodes, scratch);
639 if (ret) { 648 if (ret) {
640 task_unlock(current); 649 task_unlock(current);
641 if (mm) 650 if (mm)
642 up_write(&mm->mmap_sem); 651 up_write(&mm->mmap_sem);
643 mpol_put(new); 652 mpol_put(new);
644 return ret; 653 goto out;
645 } 654 }
646 old = current->mempolicy; 655 old = current->mempolicy;
647 current->mempolicy = new; 656 current->mempolicy = new;
@@ -654,7 +663,10 @@ static long do_set_mempolicy(unsigned short mode, unsigned short flags,
654 up_write(&mm->mmap_sem); 663 up_write(&mm->mmap_sem);
655 664
656 mpol_put(old); 665 mpol_put(old);
657 return 0; 666 ret = 0;
667out:
668 NODEMASK_SCRATCH_FREE(scratch);
669 return ret;
658} 670}
659 671
660/* 672/*
@@ -1014,12 +1026,20 @@ static long do_mbind(unsigned long start, unsigned long len,
1014 if (err) 1026 if (err)
1015 return err; 1027 return err;
1016 } 1028 }
1017 down_write(&mm->mmap_sem); 1029 {
1018 task_lock(current); 1030 NODEMASK_SCRATCH(scratch);
1019 err = mpol_set_nodemask(new, nmask); 1031 if (scratch) {
1020 task_unlock(current); 1032 down_write(&mm->mmap_sem);
1033 task_lock(current);
1034 err = mpol_set_nodemask(new, nmask, scratch);
1035 task_unlock(current);
1036 if (err)
1037 up_write(&mm->mmap_sem);
1038 } else
1039 err = -ENOMEM;
1040 NODEMASK_SCRATCH_FREE(scratch);
1041 }
1021 if (err) { 1042 if (err) {
1022 up_write(&mm->mmap_sem);
1023 mpol_put(new); 1043 mpol_put(new);
1024 return err; 1044 return err;
1025 } 1045 }
@@ -1891,6 +1911,7 @@ restart:
1891 * Install non-NULL @mpol in inode's shared policy rb-tree. 1911 * Install non-NULL @mpol in inode's shared policy rb-tree.
1892 * On entry, the current task has a reference on a non-NULL @mpol. 1912 * On entry, the current task has a reference on a non-NULL @mpol.
1893 * This must be released on exit. 1913 * This must be released on exit.
1914 * This is called at get_inode() calls and we can use GFP_KERNEL.
1894 */ 1915 */
1895void mpol_shared_policy_init(struct shared_policy *sp, struct mempolicy *mpol) 1916void mpol_shared_policy_init(struct shared_policy *sp, struct mempolicy *mpol)
1896{ 1917{
@@ -1902,19 +1923,24 @@ void mpol_shared_policy_init(struct shared_policy *sp, struct mempolicy *mpol)
1902 if (mpol) { 1923 if (mpol) {
1903 struct vm_area_struct pvma; 1924 struct vm_area_struct pvma;
1904 struct mempolicy *new; 1925 struct mempolicy *new;
1926 NODEMASK_SCRATCH(scratch);
1905 1927
1928 if (!scratch)
1929 return;
1906 /* contextualize the tmpfs mount point mempolicy */ 1930 /* contextualize the tmpfs mount point mempolicy */
1907 new = mpol_new(mpol->mode, mpol->flags, &mpol->w.user_nodemask); 1931 new = mpol_new(mpol->mode, mpol->flags, &mpol->w.user_nodemask);
1908 if (IS_ERR(new)) { 1932 if (IS_ERR(new)) {
1909 mpol_put(mpol); /* drop our ref on sb mpol */ 1933 mpol_put(mpol); /* drop our ref on sb mpol */
1934 NODEMASK_SCRATCH_FREE(scratch);
1910 return; /* no valid nodemask intersection */ 1935 return; /* no valid nodemask intersection */
1911 } 1936 }
1912 1937
1913 task_lock(current); 1938 task_lock(current);
1914 ret = mpol_set_nodemask(new, &mpol->w.user_nodemask); 1939 ret = mpol_set_nodemask(new, &mpol->w.user_nodemask, scratch);
1915 task_unlock(current); 1940 task_unlock(current);
1916 mpol_put(mpol); /* drop our ref on sb mpol */ 1941 mpol_put(mpol); /* drop our ref on sb mpol */
1917 if (ret) { 1942 if (ret) {
1943 NODEMASK_SCRATCH_FREE(scratch);
1918 mpol_put(new); 1944 mpol_put(new);
1919 return; 1945 return;
1920 } 1946 }
@@ -1924,6 +1950,7 @@ void mpol_shared_policy_init(struct shared_policy *sp, struct mempolicy *mpol)
1924 pvma.vm_end = TASK_SIZE; /* policy covers entire file */ 1950 pvma.vm_end = TASK_SIZE; /* policy covers entire file */
1925 mpol_set_shared_policy(sp, &pvma, new); /* adds ref */ 1951 mpol_set_shared_policy(sp, &pvma, new); /* adds ref */
1926 mpol_put(new); /* drop initial ref */ 1952 mpol_put(new); /* drop initial ref */
1953 NODEMASK_SCRATCH_FREE(scratch);
1927 } 1954 }
1928} 1955}
1929 1956
@@ -2140,13 +2167,18 @@ int mpol_parse_str(char *str, struct mempolicy **mpol, int no_context)
2140 err = 1; 2167 err = 1;
2141 else { 2168 else {
2142 int ret; 2169 int ret;
2143 2170 NODEMASK_SCRATCH(scratch);
2144 task_lock(current); 2171 if (scratch) {
2145 ret = mpol_set_nodemask(new, &nodes); 2172 task_lock(current);
2146 task_unlock(current); 2173 ret = mpol_set_nodemask(new, &nodes, scratch);
2147 if (ret) 2174 task_unlock(current);
2175 } else
2176 ret = -ENOMEM;
2177 NODEMASK_SCRATCH_FREE(scratch);
2178 if (ret) {
2148 err = 1; 2179 err = 1;
2149 else if (no_context) { 2180 mpol_put(new);
2181 } else if (no_context) {
2150 /* save for contextualization */ 2182 /* save for contextualization */
2151 new->w.user_nodemask = nodes; 2183 new->w.user_nodemask = nodes;
2152 } 2184 }
diff --git a/mm/nommu.c b/mm/nommu.c
index 2fd2ad5da98e..53cab10fece4 100644
--- a/mm/nommu.c
+++ b/mm/nommu.c
@@ -173,8 +173,8 @@ unsigned int kobjsize(const void *objp)
173} 173}
174 174
175int __get_user_pages(struct task_struct *tsk, struct mm_struct *mm, 175int __get_user_pages(struct task_struct *tsk, struct mm_struct *mm,
176 unsigned long start, int len, int flags, 176 unsigned long start, int nr_pages, int flags,
177 struct page **pages, struct vm_area_struct **vmas) 177 struct page **pages, struct vm_area_struct **vmas)
178{ 178{
179 struct vm_area_struct *vma; 179 struct vm_area_struct *vma;
180 unsigned long vm_flags; 180 unsigned long vm_flags;
@@ -189,7 +189,7 @@ int __get_user_pages(struct task_struct *tsk, struct mm_struct *mm,
189 vm_flags = write ? (VM_WRITE | VM_MAYWRITE) : (VM_READ | VM_MAYREAD); 189 vm_flags = write ? (VM_WRITE | VM_MAYWRITE) : (VM_READ | VM_MAYREAD);
190 vm_flags &= force ? (VM_MAYREAD | VM_MAYWRITE) : (VM_READ | VM_WRITE); 190 vm_flags &= force ? (VM_MAYREAD | VM_MAYWRITE) : (VM_READ | VM_WRITE);
191 191
192 for (i = 0; i < len; i++) { 192 for (i = 0; i < nr_pages; i++) {
193 vma = find_vma(mm, start); 193 vma = find_vma(mm, start);
194 if (!vma) 194 if (!vma)
195 goto finish_or_fault; 195 goto finish_or_fault;
@@ -224,7 +224,7 @@ finish_or_fault:
224 * - don't permit access to VMAs that don't support it, such as I/O mappings 224 * - don't permit access to VMAs that don't support it, such as I/O mappings
225 */ 225 */
226int get_user_pages(struct task_struct *tsk, struct mm_struct *mm, 226int get_user_pages(struct task_struct *tsk, struct mm_struct *mm,
227 unsigned long start, int len, int write, int force, 227 unsigned long start, int nr_pages, int write, int force,
228 struct page **pages, struct vm_area_struct **vmas) 228 struct page **pages, struct vm_area_struct **vmas)
229{ 229{
230 int flags = 0; 230 int flags = 0;
@@ -234,12 +234,31 @@ int get_user_pages(struct task_struct *tsk, struct mm_struct *mm,
234 if (force) 234 if (force)
235 flags |= GUP_FLAGS_FORCE; 235 flags |= GUP_FLAGS_FORCE;
236 236
237 return __get_user_pages(tsk, mm, 237 return __get_user_pages(tsk, mm, start, nr_pages, flags, pages, vmas);
238 start, len, flags,
239 pages, vmas);
240} 238}
241EXPORT_SYMBOL(get_user_pages); 239EXPORT_SYMBOL(get_user_pages);
242 240
241/**
242 * follow_pfn - look up PFN at a user virtual address
243 * @vma: memory mapping
244 * @address: user virtual address
245 * @pfn: location to store found PFN
246 *
247 * Only IO mappings and raw PFN mappings are allowed.
248 *
249 * Returns zero and the pfn at @pfn on success, -ve otherwise.
250 */
251int follow_pfn(struct vm_area_struct *vma, unsigned long address,
252 unsigned long *pfn)
253{
254 if (!(vma->vm_flags & (VM_IO | VM_PFNMAP)))
255 return -EINVAL;
256
257 *pfn = address >> PAGE_SHIFT;
258 return 0;
259}
260EXPORT_SYMBOL(follow_pfn);
261
243DEFINE_RWLOCK(vmlist_lock); 262DEFINE_RWLOCK(vmlist_lock);
244struct vm_struct *vmlist; 263struct vm_struct *vmlist;
245 264
diff --git a/mm/page-writeback.c b/mm/page-writeback.c
index 7b0dcea4935b..81627ebcd313 100644
--- a/mm/page-writeback.c
+++ b/mm/page-writeback.c
@@ -541,8 +541,11 @@ static void balance_dirty_pages(struct address_space *mapping)
541 * filesystems (i.e. NFS) in which data may have been 541 * filesystems (i.e. NFS) in which data may have been
542 * written to the server's write cache, but has not yet 542 * written to the server's write cache, but has not yet
543 * been flushed to permanent storage. 543 * been flushed to permanent storage.
544 * Only move pages to writeback if this bdi is over its
545 * threshold otherwise wait until the disk writes catch
546 * up.
544 */ 547 */
545 if (bdi_nr_reclaimable) { 548 if (bdi_nr_reclaimable > bdi_thresh) {
546 writeback_inodes(&wbc); 549 writeback_inodes(&wbc);
547 pages_written += write_chunk - wbc.nr_to_write; 550 pages_written += write_chunk - wbc.nr_to_write;
548 get_dirty_limits(&background_thresh, &dirty_thresh, 551 get_dirty_limits(&background_thresh, &dirty_thresh,
@@ -572,7 +575,7 @@ static void balance_dirty_pages(struct address_space *mapping)
572 if (pages_written >= write_chunk) 575 if (pages_written >= write_chunk)
573 break; /* We've done our duty */ 576 break; /* We've done our duty */
574 577
575 congestion_wait(WRITE, HZ/10); 578 congestion_wait(BLK_RW_ASYNC, HZ/10);
576 } 579 }
577 580
578 if (bdi_nr_reclaimable + bdi_nr_writeback < bdi_thresh && 581 if (bdi_nr_reclaimable + bdi_nr_writeback < bdi_thresh &&
@@ -666,7 +669,7 @@ void throttle_vm_writeout(gfp_t gfp_mask)
666 if (global_page_state(NR_UNSTABLE_NFS) + 669 if (global_page_state(NR_UNSTABLE_NFS) +
667 global_page_state(NR_WRITEBACK) <= dirty_thresh) 670 global_page_state(NR_WRITEBACK) <= dirty_thresh)
668 break; 671 break;
669 congestion_wait(WRITE, HZ/10); 672 congestion_wait(BLK_RW_ASYNC, HZ/10);
670 673
671 /* 674 /*
672 * The caller might hold locks which can prevent IO completion 675 * The caller might hold locks which can prevent IO completion
@@ -712,7 +715,7 @@ static void background_writeout(unsigned long _min_pages)
712 if (wbc.nr_to_write > 0 || wbc.pages_skipped > 0) { 715 if (wbc.nr_to_write > 0 || wbc.pages_skipped > 0) {
713 /* Wrote less than expected */ 716 /* Wrote less than expected */
714 if (wbc.encountered_congestion || wbc.more_io) 717 if (wbc.encountered_congestion || wbc.more_io)
715 congestion_wait(WRITE, HZ/10); 718 congestion_wait(BLK_RW_ASYNC, HZ/10);
716 else 719 else
717 break; 720 break;
718 } 721 }
@@ -784,7 +787,7 @@ static void wb_kupdate(unsigned long arg)
784 writeback_inodes(&wbc); 787 writeback_inodes(&wbc);
785 if (wbc.nr_to_write > 0) { 788 if (wbc.nr_to_write > 0) {
786 if (wbc.encountered_congestion || wbc.more_io) 789 if (wbc.encountered_congestion || wbc.more_io)
787 congestion_wait(WRITE, HZ/10); 790 congestion_wait(BLK_RW_ASYNC, HZ/10);
788 else 791 else
789 break; /* All the old data is written */ 792 break; /* All the old data is written */
790 } 793 }
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index 5d714f8fb303..d052abbe3063 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -882,7 +882,7 @@ retry_reserve:
882 */ 882 */
883static int rmqueue_bulk(struct zone *zone, unsigned int order, 883static int rmqueue_bulk(struct zone *zone, unsigned int order,
884 unsigned long count, struct list_head *list, 884 unsigned long count, struct list_head *list,
885 int migratetype) 885 int migratetype, int cold)
886{ 886{
887 int i; 887 int i;
888 888
@@ -901,7 +901,10 @@ static int rmqueue_bulk(struct zone *zone, unsigned int order,
901 * merge IO requests if the physical pages are ordered 901 * merge IO requests if the physical pages are ordered
902 * properly. 902 * properly.
903 */ 903 */
904 list_add(&page->lru, list); 904 if (likely(cold == 0))
905 list_add(&page->lru, list);
906 else
907 list_add_tail(&page->lru, list);
905 set_page_private(page, migratetype); 908 set_page_private(page, migratetype);
906 list = &page->lru; 909 list = &page->lru;
907 } 910 }
@@ -1119,7 +1122,8 @@ again:
1119 local_irq_save(flags); 1122 local_irq_save(flags);
1120 if (!pcp->count) { 1123 if (!pcp->count) {
1121 pcp->count = rmqueue_bulk(zone, 0, 1124 pcp->count = rmqueue_bulk(zone, 0,
1122 pcp->batch, &pcp->list, migratetype); 1125 pcp->batch, &pcp->list,
1126 migratetype, cold);
1123 if (unlikely(!pcp->count)) 1127 if (unlikely(!pcp->count))
1124 goto failed; 1128 goto failed;
1125 } 1129 }
@@ -1138,7 +1142,8 @@ again:
1138 /* Allocate more to the pcp list if necessary */ 1142 /* Allocate more to the pcp list if necessary */
1139 if (unlikely(&page->lru == &pcp->list)) { 1143 if (unlikely(&page->lru == &pcp->list)) {
1140 pcp->count += rmqueue_bulk(zone, 0, 1144 pcp->count += rmqueue_bulk(zone, 0,
1141 pcp->batch, &pcp->list, migratetype); 1145 pcp->batch, &pcp->list,
1146 migratetype, cold);
1142 page = list_entry(pcp->list.next, struct page, lru); 1147 page = list_entry(pcp->list.next, struct page, lru);
1143 } 1148 }
1144 1149
@@ -1666,7 +1671,7 @@ __alloc_pages_high_priority(gfp_t gfp_mask, unsigned int order,
1666 preferred_zone, migratetype); 1671 preferred_zone, migratetype);
1667 1672
1668 if (!page && gfp_mask & __GFP_NOFAIL) 1673 if (!page && gfp_mask & __GFP_NOFAIL)
1669 congestion_wait(WRITE, HZ/50); 1674 congestion_wait(BLK_RW_ASYNC, HZ/50);
1670 } while (!page && (gfp_mask & __GFP_NOFAIL)); 1675 } while (!page && (gfp_mask & __GFP_NOFAIL));
1671 1676
1672 return page; 1677 return page;
@@ -1740,8 +1745,10 @@ __alloc_pages_slowpath(gfp_t gfp_mask, unsigned int order,
1740 * be using allocators in order of preference for an area that is 1745 * be using allocators in order of preference for an area that is
1741 * too large. 1746 * too large.
1742 */ 1747 */
1743 if (WARN_ON_ONCE(order >= MAX_ORDER)) 1748 if (order >= MAX_ORDER) {
1749 WARN_ON_ONCE(!(gfp_mask & __GFP_NOWARN));
1744 return NULL; 1750 return NULL;
1751 }
1745 1752
1746 /* 1753 /*
1747 * GFP_THISNODE (meaning __GFP_THISNODE, __GFP_NORETRY and 1754 * GFP_THISNODE (meaning __GFP_THISNODE, __GFP_NORETRY and
@@ -1789,6 +1796,10 @@ rebalance:
1789 if (p->flags & PF_MEMALLOC) 1796 if (p->flags & PF_MEMALLOC)
1790 goto nopage; 1797 goto nopage;
1791 1798
1799 /* Avoid allocations with no watermarks from looping endlessly */
1800 if (test_thread_flag(TIF_MEMDIE) && !(gfp_mask & __GFP_NOFAIL))
1801 goto nopage;
1802
1792 /* Try direct reclaim and then allocating */ 1803 /* Try direct reclaim and then allocating */
1793 page = __alloc_pages_direct_reclaim(gfp_mask, order, 1804 page = __alloc_pages_direct_reclaim(gfp_mask, order,
1794 zonelist, high_zoneidx, 1805 zonelist, high_zoneidx,
@@ -1831,7 +1842,7 @@ rebalance:
1831 pages_reclaimed += did_some_progress; 1842 pages_reclaimed += did_some_progress;
1832 if (should_alloc_retry(gfp_mask, order, pages_reclaimed)) { 1843 if (should_alloc_retry(gfp_mask, order, pages_reclaimed)) {
1833 /* Wait for some write requests to complete then retry */ 1844 /* Wait for some write requests to complete then retry */
1834 congestion_wait(WRITE, HZ/50); 1845 congestion_wait(BLK_RW_ASYNC, HZ/50);
1835 goto rebalance; 1846 goto rebalance;
1836 } 1847 }
1837 1848
@@ -1983,7 +1994,7 @@ void *alloc_pages_exact(size_t size, gfp_t gfp_mask)
1983 unsigned long alloc_end = addr + (PAGE_SIZE << order); 1994 unsigned long alloc_end = addr + (PAGE_SIZE << order);
1984 unsigned long used = addr + PAGE_ALIGN(size); 1995 unsigned long used = addr + PAGE_ALIGN(size);
1985 1996
1986 split_page(virt_to_page(addr), order); 1997 split_page(virt_to_page((void *)addr), order);
1987 while (used < alloc_end) { 1998 while (used < alloc_end) {
1988 free_page(used); 1999 free_page(used);
1989 used += PAGE_SIZE; 2000 used += PAGE_SIZE;
@@ -4032,6 +4043,8 @@ static void __init find_zone_movable_pfns_for_nodes(unsigned long *movable_pfn)
4032 int i, nid; 4043 int i, nid;
4033 unsigned long usable_startpfn; 4044 unsigned long usable_startpfn;
4034 unsigned long kernelcore_node, kernelcore_remaining; 4045 unsigned long kernelcore_node, kernelcore_remaining;
4046 /* save the state before borrow the nodemask */
4047 nodemask_t saved_node_state = node_states[N_HIGH_MEMORY];
4035 unsigned long totalpages = early_calculate_totalpages(); 4048 unsigned long totalpages = early_calculate_totalpages();
4036 int usable_nodes = nodes_weight(node_states[N_HIGH_MEMORY]); 4049 int usable_nodes = nodes_weight(node_states[N_HIGH_MEMORY]);
4037 4050
@@ -4059,7 +4072,7 @@ static void __init find_zone_movable_pfns_for_nodes(unsigned long *movable_pfn)
4059 4072
4060 /* If kernelcore was not specified, there is no ZONE_MOVABLE */ 4073 /* If kernelcore was not specified, there is no ZONE_MOVABLE */
4061 if (!required_kernelcore) 4074 if (!required_kernelcore)
4062 return; 4075 goto out;
4063 4076
4064 /* usable_startpfn is the lowest possible pfn ZONE_MOVABLE can be at */ 4077 /* usable_startpfn is the lowest possible pfn ZONE_MOVABLE can be at */
4065 find_usable_zone_for_movable(); 4078 find_usable_zone_for_movable();
@@ -4158,6 +4171,10 @@ restart:
4158 for (nid = 0; nid < MAX_NUMNODES; nid++) 4171 for (nid = 0; nid < MAX_NUMNODES; nid++)
4159 zone_movable_pfn[nid] = 4172 zone_movable_pfn[nid] =
4160 roundup(zone_movable_pfn[nid], MAX_ORDER_NR_PAGES); 4173 roundup(zone_movable_pfn[nid], MAX_ORDER_NR_PAGES);
4174
4175out:
4176 /* restore the node_state */
4177 node_states[N_HIGH_MEMORY] = saved_node_state;
4161} 4178}
4162 4179
4163/* Any regular memory on that node ? */ 4180/* Any regular memory on that node ? */
@@ -4242,11 +4259,6 @@ void __init free_area_init_nodes(unsigned long *max_zone_pfn)
4242 early_node_map[i].start_pfn, 4259 early_node_map[i].start_pfn,
4243 early_node_map[i].end_pfn); 4260 early_node_map[i].end_pfn);
4244 4261
4245 /*
4246 * find_zone_movable_pfns_for_nodes/early_calculate_totalpages init
4247 * that node_mask, clear it at first
4248 */
4249 nodes_clear(node_states[N_HIGH_MEMORY]);
4250 /* Initialise every node */ 4262 /* Initialise every node */
4251 mminit_verify_pageflags_layout(); 4263 mminit_verify_pageflags_layout();
4252 setup_nr_node_ids(); 4264 setup_nr_node_ids();
@@ -4744,8 +4756,10 @@ void *__init alloc_large_system_hash(const char *tablename,
4744 * some pages at the end of hash table which 4756 * some pages at the end of hash table which
4745 * alloc_pages_exact() automatically does 4757 * alloc_pages_exact() automatically does
4746 */ 4758 */
4747 if (get_order(size) < MAX_ORDER) 4759 if (get_order(size) < MAX_ORDER) {
4748 table = alloc_pages_exact(size, GFP_ATOMIC); 4760 table = alloc_pages_exact(size, GFP_ATOMIC);
4761 kmemleak_alloc(table, size, 1, GFP_ATOMIC);
4762 }
4749 } 4763 }
4750 } while (!table && size > PAGE_SIZE && --log2qty); 4764 } while (!table && size > PAGE_SIZE && --log2qty);
4751 4765
@@ -4763,16 +4777,6 @@ void *__init alloc_large_system_hash(const char *tablename,
4763 if (_hash_mask) 4777 if (_hash_mask)
4764 *_hash_mask = (1 << log2qty) - 1; 4778 *_hash_mask = (1 << log2qty) - 1;
4765 4779
4766 /*
4767 * If hashdist is set, the table allocation is done with __vmalloc()
4768 * which invokes the kmemleak_alloc() callback. This function may also
4769 * be called before the slab and kmemleak are initialised when
4770 * kmemleak simply buffers the request to be executed later
4771 * (GFP_ATOMIC flag ignored in this case).
4772 */
4773 if (!hashdist)
4774 kmemleak_alloc(table, size, 1, GFP_ATOMIC);
4775
4776 return table; 4780 return table;
4777} 4781}
4778 4782
diff --git a/mm/percpu.c b/mm/percpu.c
index c0b2c1a76e81..b70f2acd8853 100644
--- a/mm/percpu.c
+++ b/mm/percpu.c
@@ -549,14 +549,14 @@ static void pcpu_free_area(struct pcpu_chunk *chunk, int freeme)
549 * @chunk: chunk of interest 549 * @chunk: chunk of interest
550 * @page_start: page index of the first page to unmap 550 * @page_start: page index of the first page to unmap
551 * @page_end: page index of the last page to unmap + 1 551 * @page_end: page index of the last page to unmap + 1
552 * @flush: whether to flush cache and tlb or not 552 * @flush_tlb: whether to flush tlb or not
553 * 553 *
554 * For each cpu, unmap pages [@page_start,@page_end) out of @chunk. 554 * For each cpu, unmap pages [@page_start,@page_end) out of @chunk.
555 * If @flush is true, vcache is flushed before unmapping and tlb 555 * If @flush is true, vcache is flushed before unmapping and tlb
556 * after. 556 * after.
557 */ 557 */
558static void pcpu_unmap(struct pcpu_chunk *chunk, int page_start, int page_end, 558static void pcpu_unmap(struct pcpu_chunk *chunk, int page_start, int page_end,
559 bool flush) 559 bool flush_tlb)
560{ 560{
561 unsigned int last = num_possible_cpus() - 1; 561 unsigned int last = num_possible_cpus() - 1;
562 unsigned int cpu; 562 unsigned int cpu;
@@ -569,9 +569,8 @@ static void pcpu_unmap(struct pcpu_chunk *chunk, int page_start, int page_end,
569 * the whole region at once rather than doing it for each cpu. 569 * the whole region at once rather than doing it for each cpu.
570 * This could be an overkill but is more scalable. 570 * This could be an overkill but is more scalable.
571 */ 571 */
572 if (flush) 572 flush_cache_vunmap(pcpu_chunk_addr(chunk, 0, page_start),
573 flush_cache_vunmap(pcpu_chunk_addr(chunk, 0, page_start), 573 pcpu_chunk_addr(chunk, last, page_end));
574 pcpu_chunk_addr(chunk, last, page_end));
575 574
576 for_each_possible_cpu(cpu) 575 for_each_possible_cpu(cpu)
577 unmap_kernel_range_noflush( 576 unmap_kernel_range_noflush(
@@ -579,7 +578,7 @@ static void pcpu_unmap(struct pcpu_chunk *chunk, int page_start, int page_end,
579 (page_end - page_start) << PAGE_SHIFT); 578 (page_end - page_start) << PAGE_SHIFT);
580 579
581 /* ditto as flush_cache_vunmap() */ 580 /* ditto as flush_cache_vunmap() */
582 if (flush) 581 if (flush_tlb)
583 flush_tlb_kernel_range(pcpu_chunk_addr(chunk, 0, page_start), 582 flush_tlb_kernel_range(pcpu_chunk_addr(chunk, 0, page_start),
584 pcpu_chunk_addr(chunk, last, page_end)); 583 pcpu_chunk_addr(chunk, last, page_end));
585} 584}
@@ -1234,6 +1233,7 @@ static struct page * __init pcpue_get_page(unsigned int cpu, int pageno)
1234ssize_t __init pcpu_embed_first_chunk(size_t static_size, size_t reserved_size, 1233ssize_t __init pcpu_embed_first_chunk(size_t static_size, size_t reserved_size,
1235 ssize_t dyn_size, ssize_t unit_size) 1234 ssize_t dyn_size, ssize_t unit_size)
1236{ 1235{
1236 size_t chunk_size;
1237 unsigned int cpu; 1237 unsigned int cpu;
1238 1238
1239 /* determine parameters and allocate */ 1239 /* determine parameters and allocate */
@@ -1248,11 +1248,15 @@ ssize_t __init pcpu_embed_first_chunk(size_t static_size, size_t reserved_size,
1248 } else 1248 } else
1249 pcpue_unit_size = max_t(size_t, pcpue_size, PCPU_MIN_UNIT_SIZE); 1249 pcpue_unit_size = max_t(size_t, pcpue_size, PCPU_MIN_UNIT_SIZE);
1250 1250
1251 pcpue_ptr = __alloc_bootmem_nopanic( 1251 chunk_size = pcpue_unit_size * num_possible_cpus();
1252 num_possible_cpus() * pcpue_unit_size, 1252
1253 PAGE_SIZE, __pa(MAX_DMA_ADDRESS)); 1253 pcpue_ptr = __alloc_bootmem_nopanic(chunk_size, PAGE_SIZE,
1254 if (!pcpue_ptr) 1254 __pa(MAX_DMA_ADDRESS));
1255 if (!pcpue_ptr) {
1256 pr_warning("PERCPU: failed to allocate %zu bytes for "
1257 "embedding\n", chunk_size);
1255 return -ENOMEM; 1258 return -ENOMEM;
1259 }
1256 1260
1257 /* return the leftover and copy */ 1261 /* return the leftover and copy */
1258 for_each_possible_cpu(cpu) { 1262 for_each_possible_cpu(cpu) {
diff --git a/mm/slab.c b/mm/slab.c
index e74a16e4ced6..7b5d4deacfcd 100644
--- a/mm/slab.c
+++ b/mm/slab.c
@@ -1544,9 +1544,6 @@ void __init kmem_cache_init(void)
1544 } 1544 }
1545 1545
1546 g_cpucache_up = EARLY; 1546 g_cpucache_up = EARLY;
1547
1548 /* Annotate slab for lockdep -- annotate the malloc caches */
1549 init_lock_keys();
1550} 1547}
1551 1548
1552void __init kmem_cache_init_late(void) 1549void __init kmem_cache_init_late(void)
@@ -1563,6 +1560,9 @@ void __init kmem_cache_init_late(void)
1563 /* Done! */ 1560 /* Done! */
1564 g_cpucache_up = FULL; 1561 g_cpucache_up = FULL;
1565 1562
1563 /* Annotate slab for lockdep -- annotate the malloc caches */
1564 init_lock_keys();
1565
1566 /* 1566 /*
1567 * Register a cpu startup notifier callback that initializes 1567 * Register a cpu startup notifier callback that initializes
1568 * cpu_cache_get for all new cpus 1568 * cpu_cache_get for all new cpus
@@ -2547,7 +2547,7 @@ void kmem_cache_destroy(struct kmem_cache *cachep)
2547 } 2547 }
2548 2548
2549 if (unlikely(cachep->flags & SLAB_DESTROY_BY_RCU)) 2549 if (unlikely(cachep->flags & SLAB_DESTROY_BY_RCU))
2550 synchronize_rcu(); 2550 rcu_barrier();
2551 2551
2552 __kmem_cache_destroy(cachep); 2552 __kmem_cache_destroy(cachep);
2553 mutex_unlock(&cache_chain_mutex); 2553 mutex_unlock(&cache_chain_mutex);
diff --git a/mm/slob.c b/mm/slob.c
index c78742defdc6..9641da3d5e58 100644
--- a/mm/slob.c
+++ b/mm/slob.c
@@ -595,6 +595,8 @@ EXPORT_SYMBOL(kmem_cache_create);
595void kmem_cache_destroy(struct kmem_cache *c) 595void kmem_cache_destroy(struct kmem_cache *c)
596{ 596{
597 kmemleak_free(c); 597 kmemleak_free(c);
598 if (c->flags & SLAB_DESTROY_BY_RCU)
599 rcu_barrier();
598 slob_free(c, sizeof(struct kmem_cache)); 600 slob_free(c, sizeof(struct kmem_cache));
599} 601}
600EXPORT_SYMBOL(kmem_cache_destroy); 602EXPORT_SYMBOL(kmem_cache_destroy);
diff --git a/mm/slub.c b/mm/slub.c
index 819f056b39c6..b9f1491a58a1 100644
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -21,7 +21,6 @@
21#include <linux/kmemcheck.h> 21#include <linux/kmemcheck.h>
22#include <linux/cpu.h> 22#include <linux/cpu.h>
23#include <linux/cpuset.h> 23#include <linux/cpuset.h>
24#include <linux/kmemleak.h>
25#include <linux/mempolicy.h> 24#include <linux/mempolicy.h>
26#include <linux/ctype.h> 25#include <linux/ctype.h>
27#include <linux/debugobjects.h> 26#include <linux/debugobjects.h>
@@ -2595,6 +2594,8 @@ static inline int kmem_cache_close(struct kmem_cache *s)
2595 */ 2594 */
2596void kmem_cache_destroy(struct kmem_cache *s) 2595void kmem_cache_destroy(struct kmem_cache *s)
2597{ 2596{
2597 if (s->flags & SLAB_DESTROY_BY_RCU)
2598 rcu_barrier();
2598 down_write(&slub_lock); 2599 down_write(&slub_lock);
2599 s->refcount--; 2600 s->refcount--;
2600 if (!s->refcount) { 2601 if (!s->refcount) {
@@ -2833,13 +2834,15 @@ EXPORT_SYMBOL(__kmalloc);
2833static void *kmalloc_large_node(size_t size, gfp_t flags, int node) 2834static void *kmalloc_large_node(size_t size, gfp_t flags, int node)
2834{ 2835{
2835 struct page *page; 2836 struct page *page;
2837 void *ptr = NULL;
2836 2838
2837 flags |= __GFP_COMP | __GFP_NOTRACK; 2839 flags |= __GFP_COMP | __GFP_NOTRACK;
2838 page = alloc_pages_node(node, flags, get_order(size)); 2840 page = alloc_pages_node(node, flags, get_order(size));
2839 if (page) 2841 if (page)
2840 return page_address(page); 2842 ptr = page_address(page);
2841 else 2843
2842 return NULL; 2844 kmemleak_alloc(ptr, size, 1, flags);
2845 return ptr;
2843} 2846}
2844 2847
2845#ifdef CONFIG_NUMA 2848#ifdef CONFIG_NUMA
@@ -2924,6 +2927,7 @@ void kfree(const void *x)
2924 page = virt_to_head_page(x); 2927 page = virt_to_head_page(x);
2925 if (unlikely(!PageSlab(page))) { 2928 if (unlikely(!PageSlab(page))) {
2926 BUG_ON(!PageCompound(page)); 2929 BUG_ON(!PageCompound(page));
2930 kmemleak_free(x);
2927 put_page(page); 2931 put_page(page);
2928 return; 2932 return;
2929 } 2933 }
diff --git a/mm/swapfile.c b/mm/swapfile.c
index d1ade1a48ee7..8ffdc0d23c53 100644
--- a/mm/swapfile.c
+++ b/mm/swapfile.c
@@ -753,7 +753,7 @@ int swap_type_of(dev_t device, sector_t offset, struct block_device **bdev_p)
753 753
754 if (!bdev) { 754 if (!bdev) {
755 if (bdev_p) 755 if (bdev_p)
756 *bdev_p = bdget(sis->bdev->bd_dev); 756 *bdev_p = bdgrab(sis->bdev);
757 757
758 spin_unlock(&swap_lock); 758 spin_unlock(&swap_lock);
759 return i; 759 return i;
@@ -765,7 +765,7 @@ int swap_type_of(dev_t device, sector_t offset, struct block_device **bdev_p)
765 struct swap_extent, list); 765 struct swap_extent, list);
766 if (se->start_block == offset) { 766 if (se->start_block == offset) {
767 if (bdev_p) 767 if (bdev_p)
768 *bdev_p = bdget(sis->bdev->bd_dev); 768 *bdev_p = bdgrab(sis->bdev);
769 769
770 spin_unlock(&swap_lock); 770 spin_unlock(&swap_lock);
771 bdput(bdev); 771 bdput(bdev);
diff --git a/mm/vmscan.c b/mm/vmscan.c
index 54155268dfca..dea7abd31098 100644
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -1104,7 +1104,7 @@ static unsigned long shrink_inactive_list(unsigned long max_scan,
1104 */ 1104 */
1105 if (nr_freed < nr_taken && !current_is_kswapd() && 1105 if (nr_freed < nr_taken && !current_is_kswapd() &&
1106 lumpy_reclaim) { 1106 lumpy_reclaim) {
1107 congestion_wait(WRITE, HZ/10); 1107 congestion_wait(BLK_RW_ASYNC, HZ/10);
1108 1108
1109 /* 1109 /*
1110 * The attempt at page out may have made some 1110 * The attempt at page out may have made some
@@ -1721,7 +1721,7 @@ static unsigned long do_try_to_free_pages(struct zonelist *zonelist,
1721 1721
1722 /* Take a nap, wait for some writeback to complete */ 1722 /* Take a nap, wait for some writeback to complete */
1723 if (sc->nr_scanned && priority < DEF_PRIORITY - 2) 1723 if (sc->nr_scanned && priority < DEF_PRIORITY - 2)
1724 congestion_wait(WRITE, HZ/10); 1724 congestion_wait(BLK_RW_ASYNC, HZ/10);
1725 } 1725 }
1726 /* top priority shrink_zones still had more to do? don't OOM, then */ 1726 /* top priority shrink_zones still had more to do? don't OOM, then */
1727 if (!sc->all_unreclaimable && scanning_global_lru(sc)) 1727 if (!sc->all_unreclaimable && scanning_global_lru(sc))
@@ -1960,7 +1960,7 @@ loop_again:
1960 * another pass across the zones. 1960 * another pass across the zones.
1961 */ 1961 */
1962 if (total_scanned && priority < DEF_PRIORITY - 2) 1962 if (total_scanned && priority < DEF_PRIORITY - 2)
1963 congestion_wait(WRITE, HZ/10); 1963 congestion_wait(BLK_RW_ASYNC, HZ/10);
1964 1964
1965 /* 1965 /*
1966 * We do this so kswapd doesn't build up large priorities for 1966 * We do this so kswapd doesn't build up large priorities for
@@ -2233,7 +2233,7 @@ unsigned long shrink_all_memory(unsigned long nr_pages)
2233 goto out; 2233 goto out;
2234 2234
2235 if (sc.nr_scanned && prio < DEF_PRIORITY - 2) 2235 if (sc.nr_scanned && prio < DEF_PRIORITY - 2)
2236 congestion_wait(WRITE, HZ / 10); 2236 congestion_wait(BLK_RW_ASYNC, HZ / 10);
2237 } 2237 }
2238 } 2238 }
2239 2239
diff --git a/net/9p/client.c b/net/9p/client.c
index dd43a8289b0d..787ccddb85ea 100644
--- a/net/9p/client.c
+++ b/net/9p/client.c
@@ -117,9 +117,6 @@ static int parse_opts(char *opts, struct p9_client *clnt)
117 } 117 }
118 } 118 }
119 119
120 if (!clnt->trans_mod)
121 clnt->trans_mod = v9fs_get_default_trans();
122
123 kfree(options); 120 kfree(options);
124 return ret; 121 return ret;
125} 122}
@@ -689,6 +686,9 @@ struct p9_client *p9_client_create(const char *dev_name, char *options)
689 if (err < 0) 686 if (err < 0)
690 goto error; 687 goto error;
691 688
689 if (!clnt->trans_mod)
690 clnt->trans_mod = v9fs_get_default_trans();
691
692 if (clnt->trans_mod == NULL) { 692 if (clnt->trans_mod == NULL) {
693 err = -EPROTONOSUPPORT; 693 err = -EPROTONOSUPPORT;
694 P9_DPRINTK(P9_DEBUG_ERROR, 694 P9_DPRINTK(P9_DEBUG_ERROR,
@@ -1098,7 +1098,6 @@ p9_client_read(struct p9_fid *fid, char *data, char __user *udata, u64 offset,
1098 1098
1099 if (data) { 1099 if (data) {
1100 memmove(data, dataptr, count); 1100 memmove(data, dataptr, count);
1101 data += count;
1102 } 1101 }
1103 1102
1104 if (udata) { 1103 if (udata) {
@@ -1192,9 +1191,9 @@ struct p9_wstat *p9_client_stat(struct p9_fid *fid)
1192 1191
1193 err = p9pdu_readf(req->rc, clnt->dotu, "wS", &ignored, ret); 1192 err = p9pdu_readf(req->rc, clnt->dotu, "wS", &ignored, ret);
1194 if (err) { 1193 if (err) {
1195 ret = ERR_PTR(err);
1196 p9pdu_dump(1, req->rc); 1194 p9pdu_dump(1, req->rc);
1197 goto free_and_error; 1195 p9_free_req(clnt, req);
1196 goto error;
1198 } 1197 }
1199 1198
1200 P9_DPRINTK(P9_DEBUG_9P, 1199 P9_DPRINTK(P9_DEBUG_9P,
@@ -1211,8 +1210,6 @@ struct p9_wstat *p9_client_stat(struct p9_fid *fid)
1211 p9_free_req(clnt, req); 1210 p9_free_req(clnt, req);
1212 return ret; 1211 return ret;
1213 1212
1214free_and_error:
1215 p9_free_req(clnt, req);
1216error: 1213error:
1217 kfree(ret); 1214 kfree(ret);
1218 return ERR_PTR(err); 1215 return ERR_PTR(err);
diff --git a/net/appletalk/ddp.c b/net/appletalk/ddp.c
index 9ef6ff26eb0c..875eda5dbad7 100644
--- a/net/appletalk/ddp.c
+++ b/net/appletalk/ddp.c
@@ -54,6 +54,7 @@
54#include <linux/capability.h> 54#include <linux/capability.h>
55#include <linux/module.h> 55#include <linux/module.h>
56#include <linux/if_arp.h> 56#include <linux/if_arp.h>
57#include <linux/smp_lock.h>
57#include <linux/termios.h> /* For TIOCOUTQ/INQ */ 58#include <linux/termios.h> /* For TIOCOUTQ/INQ */
58#include <net/datalink.h> 59#include <net/datalink.h>
59#include <net/psnap.h> 60#include <net/psnap.h>
diff --git a/net/dccp/proto.c b/net/dccp/proto.c
index 6294f57162bb..1bca9205104e 100644
--- a/net/dccp/proto.c
+++ b/net/dccp/proto.c
@@ -1066,7 +1066,7 @@ static int __init dccp_init(void)
1066 (dccp_hashinfo.ehash_size - 1)) 1066 (dccp_hashinfo.ehash_size - 1))
1067 dccp_hashinfo.ehash_size--; 1067 dccp_hashinfo.ehash_size--;
1068 dccp_hashinfo.ehash = (struct inet_ehash_bucket *) 1068 dccp_hashinfo.ehash = (struct inet_ehash_bucket *)
1069 __get_free_pages(GFP_ATOMIC, ehash_order); 1069 __get_free_pages(GFP_ATOMIC|__GFP_NOWARN, ehash_order);
1070 } while (!dccp_hashinfo.ehash && --ehash_order > 0); 1070 } while (!dccp_hashinfo.ehash && --ehash_order > 0);
1071 1071
1072 if (!dccp_hashinfo.ehash) { 1072 if (!dccp_hashinfo.ehash) {
@@ -1091,7 +1091,7 @@ static int __init dccp_init(void)
1091 bhash_order > 0) 1091 bhash_order > 0)
1092 continue; 1092 continue;
1093 dccp_hashinfo.bhash = (struct inet_bind_hashbucket *) 1093 dccp_hashinfo.bhash = (struct inet_bind_hashbucket *)
1094 __get_free_pages(GFP_ATOMIC, bhash_order); 1094 __get_free_pages(GFP_ATOMIC|__GFP_NOWARN, bhash_order);
1095 } while (!dccp_hashinfo.bhash && --bhash_order >= 0); 1095 } while (!dccp_hashinfo.bhash && --bhash_order >= 0);
1096 1096
1097 if (!dccp_hashinfo.bhash) { 1097 if (!dccp_hashinfo.bhash) {
diff --git a/net/ipx/af_ipx.c b/net/ipx/af_ipx.c
index 417b0e309495..f1118d92a191 100644
--- a/net/ipx/af_ipx.c
+++ b/net/ipx/af_ipx.c
@@ -41,6 +41,7 @@
41#include <linux/netdevice.h> 41#include <linux/netdevice.h>
42#include <linux/uio.h> 42#include <linux/uio.h>
43#include <linux/skbuff.h> 43#include <linux/skbuff.h>
44#include <linux/smp_lock.h>
44#include <linux/socket.h> 45#include <linux/socket.h>
45#include <linux/sockios.h> 46#include <linux/sockios.h>
46#include <linux/string.h> 47#include <linux/string.h>
diff --git a/net/irda/af_irda.c b/net/irda/af_irda.c
index 3ec2b434ea75..50b43c57d5d8 100644
--- a/net/irda/af_irda.c
+++ b/net/irda/af_irda.c
@@ -45,6 +45,7 @@
45#include <linux/capability.h> 45#include <linux/capability.h>
46#include <linux/module.h> 46#include <linux/module.h>
47#include <linux/types.h> 47#include <linux/types.h>
48#include <linux/smp_lock.h>
48#include <linux/socket.h> 49#include <linux/socket.h>
49#include <linux/sockios.h> 50#include <linux/sockios.h>
50#include <linux/init.h> 51#include <linux/init.h>
diff --git a/net/irda/irnet/irnet.h b/net/irda/irnet/irnet.h
index bccf4d0059f0..b001c361ad30 100644
--- a/net/irda/irnet/irnet.h
+++ b/net/irda/irnet/irnet.h
@@ -241,7 +241,6 @@
241#include <linux/module.h> 241#include <linux/module.h>
242 242
243#include <linux/kernel.h> 243#include <linux/kernel.h>
244#include <linux/smp_lock.h>
245#include <linux/skbuff.h> 244#include <linux/skbuff.h>
246#include <linux/tty.h> 245#include <linux/tty.h>
247#include <linux/proc_fs.h> 246#include <linux/proc_fs.h>
diff --git a/net/irda/irnet/irnet_ppp.c b/net/irda/irnet/irnet_ppp.c
index 6d8ae03c14f5..68cbcb19cbd8 100644
--- a/net/irda/irnet/irnet_ppp.c
+++ b/net/irda/irnet/irnet_ppp.c
@@ -13,6 +13,7 @@
13 * 2) as a control channel (write commands, read events) 13 * 2) as a control channel (write commands, read events)
14 */ 14 */
15 15
16#include <linux/smp_lock.h>
16#include "irnet_ppp.h" /* Private header */ 17#include "irnet_ppp.h" /* Private header */
17/* Please put other headers in irnet.h - Thanks */ 18/* Please put other headers in irnet.h - Thanks */
18 19
diff --git a/net/sunrpc/clnt.c b/net/sunrpc/clnt.c
index 5bc2f45bddf0..ebfcf9b89909 100644
--- a/net/sunrpc/clnt.c
+++ b/net/sunrpc/clnt.c
@@ -28,7 +28,6 @@
28#include <linux/kallsyms.h> 28#include <linux/kallsyms.h>
29#include <linux/mm.h> 29#include <linux/mm.h>
30#include <linux/slab.h> 30#include <linux/slab.h>
31#include <linux/smp_lock.h>
32#include <linux/utsname.h> 31#include <linux/utsname.h>
33#include <linux/workqueue.h> 32#include <linux/workqueue.h>
34#include <linux/in6.h> 33#include <linux/in6.h>
diff --git a/net/sunrpc/sched.c b/net/sunrpc/sched.c
index 1102ce1251f7..8f459abe97cf 100644
--- a/net/sunrpc/sched.c
+++ b/net/sunrpc/sched.c
@@ -16,7 +16,6 @@
16#include <linux/slab.h> 16#include <linux/slab.h>
17#include <linux/mempool.h> 17#include <linux/mempool.h>
18#include <linux/smp.h> 18#include <linux/smp.h>
19#include <linux/smp_lock.h>
20#include <linux/spinlock.h> 19#include <linux/spinlock.h>
21#include <linux/mutex.h> 20#include <linux/mutex.h>
22 21
diff --git a/net/sunrpc/svc_xprt.c b/net/sunrpc/svc_xprt.c
index 6f33d33cc064..27d44332f017 100644
--- a/net/sunrpc/svc_xprt.c
+++ b/net/sunrpc/svc_xprt.c
@@ -5,6 +5,7 @@
5 */ 5 */
6 6
7#include <linux/sched.h> 7#include <linux/sched.h>
8#include <linux/smp_lock.h>
8#include <linux/errno.h> 9#include <linux/errno.h>
9#include <linux/freezer.h> 10#include <linux/freezer.h>
10#include <linux/kthread.h> 11#include <linux/kthread.h>
diff --git a/net/wanrouter/wanmain.c b/net/wanrouter/wanmain.c
index 466e2d22d256..258daa80ad92 100644
--- a/net/wanrouter/wanmain.c
+++ b/net/wanrouter/wanmain.c
@@ -48,6 +48,7 @@
48#include <linux/kernel.h> 48#include <linux/kernel.h>
49#include <linux/module.h> /* support for loadable modules */ 49#include <linux/module.h> /* support for loadable modules */
50#include <linux/slab.h> /* kmalloc(), kfree() */ 50#include <linux/slab.h> /* kmalloc(), kfree() */
51#include <linux/smp_lock.h>
51#include <linux/mm.h> 52#include <linux/mm.h>
52#include <linux/string.h> /* inline mem*, str* functions */ 53#include <linux/string.h> /* inline mem*, str* functions */
53 54
diff --git a/net/x25/af_x25.c b/net/x25/af_x25.c
index 21cdc872004e..5e6c072c64d3 100644
--- a/net/x25/af_x25.c
+++ b/net/x25/af_x25.c
@@ -40,6 +40,7 @@
40#include <linux/errno.h> 40#include <linux/errno.h>
41#include <linux/kernel.h> 41#include <linux/kernel.h>
42#include <linux/sched.h> 42#include <linux/sched.h>
43#include <linux/smp_lock.h>
43#include <linux/timer.h> 44#include <linux/timer.h>
44#include <linux/string.h> 45#include <linux/string.h>
45#include <linux/net.h> 46#include <linux/net.h>
diff --git a/samples/trace_events/trace-events-sample.h b/samples/trace_events/trace-events-sample.h
index 9977a756fb32..f24ae370e514 100644
--- a/samples/trace_events/trace-events-sample.h
+++ b/samples/trace_events/trace-events-sample.h
@@ -1,21 +1,4 @@
1/* 1/*
2 * Notice that this file is not protected like a normal header.
3 * We also must allow for rereading of this file. The
4 *
5 * || defined(TRACE_HEADER_MULTI_READ)
6 *
7 * serves this purpose.
8 */
9#if !defined(_TRACE_EVENT_SAMPLE_H) || defined(TRACE_HEADER_MULTI_READ)
10#define _TRACE_EVENT_SAMPLE_H
11
12/*
13 * All trace headers should include tracepoint.h, until we finally
14 * make it into a standard header.
15 */
16#include <linux/tracepoint.h>
17
18/*
19 * If TRACE_SYSTEM is defined, that will be the directory created 2 * If TRACE_SYSTEM is defined, that will be the directory created
20 * in the ftrace directory under /debugfs/tracing/events/<system> 3 * in the ftrace directory under /debugfs/tracing/events/<system>
21 * 4 *
@@ -34,11 +17,31 @@
34 * #define TRACE_INCLUDE_FILE trace-events-sample 17 * #define TRACE_INCLUDE_FILE trace-events-sample
35 * 18 *
36 * As we do an the bottom of this file. 19 * As we do an the bottom of this file.
20 *
21 * Notice that TRACE_SYSTEM should be defined outside of #if
22 * protection, just like TRACE_INCLUDE_FILE.
37 */ 23 */
38#undef TRACE_SYSTEM 24#undef TRACE_SYSTEM
39#define TRACE_SYSTEM sample 25#define TRACE_SYSTEM sample
40 26
41/* 27/*
28 * Notice that this file is not protected like a normal header.
29 * We also must allow for rereading of this file. The
30 *
31 * || defined(TRACE_HEADER_MULTI_READ)
32 *
33 * serves this purpose.
34 */
35#if !defined(_TRACE_EVENT_SAMPLE_H) || defined(TRACE_HEADER_MULTI_READ)
36#define _TRACE_EVENT_SAMPLE_H
37
38/*
39 * All trace headers should include tracepoint.h, until we finally
40 * make it into a standard header.
41 */
42#include <linux/tracepoint.h>
43
44/*
42 * The TRACE_EVENT macro is broken up into 5 parts. 45 * The TRACE_EVENT macro is broken up into 5 parts.
43 * 46 *
44 * name: name of the trace point. This is also how to enable the tracepoint. 47 * name: name of the trace point. This is also how to enable the tracepoint.
diff --git a/scripts/.gitignore b/scripts/.gitignore
index b939fbd01195..52cab46ae35a 100644
--- a/scripts/.gitignore
+++ b/scripts/.gitignore
@@ -7,3 +7,4 @@ pnmtologo
7bin2c 7bin2c
8unifdef 8unifdef
9binoffset 9binoffset
10ihex2fw
diff --git a/scripts/dtc/.gitignore b/scripts/dtc/.gitignore
new file mode 100644
index 000000000000..095acb49a374
--- /dev/null
+++ b/scripts/dtc/.gitignore
@@ -0,0 +1,5 @@
1dtc
2dtc-lexer.lex.c
3dtc-parser.tab.c
4dtc-parser.tab.h
5
diff --git a/scripts/get_maintainer.pl b/scripts/get_maintainer.pl
index 3e733146cd51..278a45bd45a5 100755
--- a/scripts/get_maintainer.pl
+++ b/scripts/get_maintainer.pl
@@ -13,7 +13,7 @@
13use strict; 13use strict;
14 14
15my $P = $0; 15my $P = $0;
16my $V = '0.16'; 16my $V = '0.17';
17 17
18use Getopt::Long qw(:config no_auto_abbrev); 18use Getopt::Long qw(:config no_auto_abbrev);
19 19
@@ -27,6 +27,7 @@ my $email_git = 1;
27my $email_git_penguin_chiefs = 0; 27my $email_git_penguin_chiefs = 0;
28my $email_git_min_signatures = 1; 28my $email_git_min_signatures = 1;
29my $email_git_max_maintainers = 5; 29my $email_git_max_maintainers = 5;
30my $email_git_min_percent = 5;
30my $email_git_since = "1-year-ago"; 31my $email_git_since = "1-year-ago";
31my $output_multiline = 1; 32my $output_multiline = 1;
32my $output_separator = ", "; 33my $output_separator = ", ";
@@ -65,6 +66,7 @@ if (!GetOptions(
65 'git-chief-penguins!' => \$email_git_penguin_chiefs, 66 'git-chief-penguins!' => \$email_git_penguin_chiefs,
66 'git-min-signatures=i' => \$email_git_min_signatures, 67 'git-min-signatures=i' => \$email_git_min_signatures,
67 'git-max-maintainers=i' => \$email_git_max_maintainers, 68 'git-max-maintainers=i' => \$email_git_max_maintainers,
69 'git-min-percent=i' => \$email_git_min_percent,
68 'git-since=s' => \$email_git_since, 70 'git-since=s' => \$email_git_since,
69 'm!' => \$email_maintainer, 71 'm!' => \$email_maintainer,
70 'n!' => \$email_usename, 72 'n!' => \$email_usename,
@@ -132,6 +134,10 @@ while (<MAINT>) {
132 $value =~ s@\.@\\\.@g; ##Convert . to \. 134 $value =~ s@\.@\\\.@g; ##Convert . to \.
133 $value =~ s/\*/\.\*/g; ##Convert * to .* 135 $value =~ s/\*/\.\*/g; ##Convert * to .*
134 $value =~ s/\?/\./g; ##Convert ? to . 136 $value =~ s/\?/\./g; ##Convert ? to .
137 ##if pattern is a directory and it lacks a trailing slash, add one
138 if ((-d $value)) {
139 $value =~ s@([^/])$@$1/@;
140 }
135 } 141 }
136 push(@typevalue, "$type:$value"); 142 push(@typevalue, "$type:$value");
137 } elsif (!/^(\s)*$/) { 143 } elsif (!/^(\s)*$/) {
@@ -146,8 +152,10 @@ close(MAINT);
146my @files = (); 152my @files = ();
147 153
148foreach my $file (@ARGV) { 154foreach my $file (@ARGV) {
149 next if ((-d $file)); 155 ##if $file is a directory and it lacks a trailing slash, add one
150 if (!(-f $file)) { 156 if ((-d $file)) {
157 $file =~ s@([^/])$@$1/@;
158 } elsif (!(-f $file)) {
151 die "$P: file '${file}' not found\n"; 159 die "$P: file '${file}' not found\n";
152 } 160 }
153 if ($from_filename) { 161 if ($from_filename) {
@@ -292,7 +300,7 @@ sub file_match_pattern {
292sub usage { 300sub usage {
293 print <<EOT; 301 print <<EOT;
294usage: $P [options] patchfile 302usage: $P [options] patchfile
295 $P [options] -f file 303 $P [options] -f file|directory
296version: $V 304version: $V
297 305
298MAINTAINER field selection options: 306MAINTAINER field selection options:
@@ -301,6 +309,7 @@ MAINTAINER field selection options:
301 --git-chief-penguins => include ${penguin_chiefs} 309 --git-chief-penguins => include ${penguin_chiefs}
302 --git-min-signatures => number of signatures required (default: 1) 310 --git-min-signatures => number of signatures required (default: 1)
303 --git-max-maintainers => maximum maintainers to add (default: 5) 311 --git-max-maintainers => maximum maintainers to add (default: 5)
312 --git-min-percent => minimum percentage of commits required (default: 5)
304 --git-since => git history to use (default: 1-year-ago) 313 --git-since => git history to use (default: 1-year-ago)
305 --m => include maintainer(s) if any 314 --m => include maintainer(s) if any
306 --n => include name 'Full Name <addr\@domain.tld>' 315 --n => include name 'Full Name <addr\@domain.tld>'
@@ -322,6 +331,15 @@ Other options:
322 --version => show version 331 --version => show version
323 --help => show this help information 332 --help => show this help information
324 333
334Notes:
335 Using "-f directory" may give unexpected results:
336
337 Used with "--git", git signators for _all_ files in and below
338 directory are examined as git recurses directories.
339 Any specified X: (exclude) pattern matches are _not_ ignored.
340 Used with "--nogit", directory is used as a pattern match,
341 no individual file within the directory or subdirectory
342 is matched.
325EOT 343EOT
326} 344}
327 345
@@ -482,6 +500,7 @@ sub recent_git_signoffs {
482 my $output = ""; 500 my $output = "";
483 my $count = 0; 501 my $count = 0;
484 my @lines = (); 502 my @lines = ();
503 my $total_sign_offs;
485 504
486 if (which("git") eq "") { 505 if (which("git") eq "") {
487 warn("$P: git not found. Add --nogit to options?\n"); 506 warn("$P: git not found. Add --nogit to options?\n");
@@ -505,17 +524,26 @@ sub recent_git_signoffs {
505 $output =~ s/^\s*//gm; 524 $output =~ s/^\s*//gm;
506 525
507 @lines = split("\n", $output); 526 @lines = split("\n", $output);
527
528 $total_sign_offs = 0;
529 foreach my $line (@lines) {
530 if ($line =~ m/([0-9]+)\s+(.*)/) {
531 $total_sign_offs += $1;
532 } else {
533 die("$P: Unexpected git output: ${line}\n");
534 }
535 }
536
508 foreach my $line (@lines) { 537 foreach my $line (@lines) {
509 if ($line =~ m/([0-9]+)\s+(.*)/) { 538 if ($line =~ m/([0-9]+)\s+(.*)/) {
510 my $sign_offs = $1; 539 my $sign_offs = $1;
511 $line = $2; 540 $line = $2;
512 $count++; 541 $count++;
513 if ($sign_offs < $email_git_min_signatures || 542 if ($sign_offs < $email_git_min_signatures ||
514 $count > $email_git_max_maintainers) { 543 $count > $email_git_max_maintainers ||
544 $sign_offs * 100 / $total_sign_offs < $email_git_min_percent) {
515 last; 545 last;
516 } 546 }
517 } else {
518 die("$P: Unexpected git output: ${line}\n");
519 } 547 }
520 if ($line =~ m/(.+)<(.+)>/) { 548 if ($line =~ m/(.+)<(.+)>/) {
521 my $git_name = $1; 549 my $git_name = $1;
diff --git a/scripts/kconfig/lxdialog/util.c b/scripts/kconfig/lxdialog/util.c
index 86d95cca46a7..f2375ad7ebc9 100644
--- a/scripts/kconfig/lxdialog/util.c
+++ b/scripts/kconfig/lxdialog/util.c
@@ -19,6 +19,8 @@
19 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 19 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 */ 20 */
21 21
22#include <stdarg.h>
23
22#include "dialog.h" 24#include "dialog.h"
23 25
24struct dialog_info dlg; 26struct dialog_info dlg;
diff --git a/scripts/kconfig/mconf.c b/scripts/kconfig/mconf.c
index 3bcacb4bfd3a..25b60bc117f7 100644
--- a/scripts/kconfig/mconf.c
+++ b/scripts/kconfig/mconf.c
@@ -888,6 +888,8 @@ int main(int ac, char **av)
888 single_menu_mode = 1; 888 single_menu_mode = 1;
889 } 889 }
890 890
891 initscr();
892
891 getyx(stdscr, saved_y, saved_x); 893 getyx(stdscr, saved_y, saved_x);
892 if (init_dialog(NULL)) { 894 if (init_dialog(NULL)) {
893 fprintf(stderr, N_("Your display is too small to run Menuconfig!\n")); 895 fprintf(stderr, N_("Your display is too small to run Menuconfig!\n"));
diff --git a/scripts/kernel-doc b/scripts/kernel-doc
index ed591e9b7d1d..b52d340d759d 100755
--- a/scripts/kernel-doc
+++ b/scripts/kernel-doc
@@ -1426,6 +1426,8 @@ sub dump_struct($$) {
1426 # strip comments: 1426 # strip comments:
1427 $members =~ s/\/\*.*?\*\///gos; 1427 $members =~ s/\/\*.*?\*\///gos;
1428 $nested =~ s/\/\*.*?\*\///gos; 1428 $nested =~ s/\/\*.*?\*\///gos;
1429 # strip kmemcheck_bitfield_{begin,end}.*;
1430 $members =~ s/kmemcheck_bitfield_.*?;//gos;
1429 1431
1430 create_parameterlist($members, ';', $file); 1432 create_parameterlist($members, ';', $file);
1431 check_sections($file, $declaration_name, "struct", $sectcheck, $struct_actual, $nested); 1433 check_sections($file, $declaration_name, "struct", $sectcheck, $struct_actual, $nested);
@@ -1468,8 +1470,6 @@ sub dump_enum($$) {
1468 } 1470 }
1469 1471
1470 } 1472 }
1471 # strip kmemcheck_bitfield_{begin,end}.*;
1472 $members =~ s/kmemcheck_bitfield_.*?;//gos;
1473 1473
1474 output_declaration($declaration_name, 1474 output_declaration($declaration_name,
1475 'enum', 1475 'enum',
diff --git a/scripts/markup_oops.pl b/scripts/markup_oops.pl
index 528492bcba5b..89774011965d 100644
--- a/scripts/markup_oops.pl
+++ b/scripts/markup_oops.pl
@@ -1,6 +1,7 @@
1#!/usr/bin/perl 1#!/usr/bin/perl
2 2
3use File::Basename; 3use File::Basename;
4use Math::BigInt;
4 5
5# Copyright 2008, Intel Corporation 6# Copyright 2008, Intel Corporation
6# 7#
@@ -172,8 +173,8 @@ while (<STDIN>) {
172 parse_x86_regs($line); 173 parse_x86_regs($line);
173} 174}
174 175
175my $decodestart = hex($target) - hex($func_offset); 176my $decodestart = Math::BigInt->from_hex("0x$target") - Math::BigInt->from_hex("0x$func_offset");
176my $decodestop = hex($target) + 8192; 177my $decodestop = Math::BigInt->from_hex("0x$target") + 8192;
177if ($target eq "0") { 178if ($target eq "0") {
178 print "No oops found!\n"; 179 print "No oops found!\n";
179 print "Usage: \n"; 180 print "Usage: \n";
diff --git a/scripts/package/builddeb b/scripts/package/builddeb
index 01c2d13dd020..8b357b0bd250 100644
--- a/scripts/package/builddeb
+++ b/scripts/package/builddeb
@@ -16,6 +16,8 @@ create_package() {
16 local pname="$1" pdir="$2" 16 local pname="$1" pdir="$2"
17 17
18 cp debian/copyright "$pdir/usr/share/doc/$pname/" 18 cp debian/copyright "$pdir/usr/share/doc/$pname/"
19 cp debian/changelog "$pdir/usr/share/doc/$pname/changelog.Debian"
20 gzip -9 "$pdir/usr/share/doc/$pname/changelog.Debian"
19 21
20 # Fix ownership and permissions 22 # Fix ownership and permissions
21 chown -R root:root "$pdir" 23 chown -R root:root "$pdir"
@@ -87,7 +89,7 @@ for script in postinst postrm preinst prerm ; do
87set -e 89set -e
88 90
89# Pass maintainer script parameters to hook scripts 91# Pass maintainer script parameters to hook scripts
90export DEB_MAINT_PARAMS="\$@" 92export DEB_MAINT_PARAMS="\$*"
91 93
92test -d $debhookdir/$script.d && run-parts --arg="$version" $debhookdir/$script.d 94test -d $debhookdir/$script.d && run-parts --arg="$version" $debhookdir/$script.d
93exit 0 95exit 0
diff --git a/scripts/pnmtologo.c b/scripts/pnmtologo.c
index 64f5ddb09ea6..5c113123ed9f 100644
--- a/scripts/pnmtologo.c
+++ b/scripts/pnmtologo.c
@@ -237,7 +237,7 @@ static void write_header(void)
237 fprintf(out, " * Linux logo %s\n", logoname); 237 fprintf(out, " * Linux logo %s\n", logoname);
238 fputs(" */\n\n", out); 238 fputs(" */\n\n", out);
239 fputs("#include <linux/linux_logo.h>\n\n", out); 239 fputs("#include <linux/linux_logo.h>\n\n", out);
240 fprintf(out, "static const unsigned char %s_data[] __initconst = {\n", 240 fprintf(out, "static unsigned char %s_data[] __initdata = {\n",
241 logoname); 241 logoname);
242} 242}
243 243
@@ -374,7 +374,7 @@ static void write_logo_clut224(void)
374 fputs("\n};\n\n", out); 374 fputs("\n};\n\n", out);
375 375
376 /* write logo clut */ 376 /* write logo clut */
377 fprintf(out, "static const unsigned char %s_clut[] __initconst = {\n", 377 fprintf(out, "static unsigned char %s_clut[] __initdata = {\n",
378 logoname); 378 logoname);
379 write_hex_cnt = 0; 379 write_hex_cnt = 0;
380 for (i = 0; i < logo_clutsize; i++) { 380 for (i = 0; i < logo_clutsize; i++) {
diff --git a/scripts/recordmcount.pl b/scripts/recordmcount.pl
index 7109e2b5bc0a..911ba7ffab84 100755
--- a/scripts/recordmcount.pl
+++ b/scripts/recordmcount.pl
@@ -393,7 +393,7 @@ while (<IN>) {
393 $read_function = 0; 393 $read_function = 0;
394 } 394 }
395 # print out any recorded offsets 395 # print out any recorded offsets
396 update_funcs() if ($text_found); 396 update_funcs() if (defined($ref_func));
397 397
398 # reset all markers and arrays 398 # reset all markers and arrays
399 $text_found = 0; 399 $text_found = 0;
@@ -403,7 +403,6 @@ while (<IN>) {
403 # section found, now is this a start of a function? 403 # section found, now is this a start of a function?
404 } elsif ($read_function && /$function_regex/) { 404 } elsif ($read_function && /$function_regex/) {
405 $text_found = 1; 405 $text_found = 1;
406 $offset = hex $1;
407 $text = $2; 406 $text = $2;
408 407
409 # if this is either a local function or a weak function 408 # if this is either a local function or a weak function
@@ -412,10 +411,15 @@ while (<IN>) {
412 if (!defined($locals{$text}) && !defined($weak{$text})) { 411 if (!defined($locals{$text}) && !defined($weak{$text})) {
413 $ref_func = $text; 412 $ref_func = $text;
414 $read_function = 0; 413 $read_function = 0;
414 $offset = hex $1;
415 } else { 415 } else {
416 # if we already have a function, and this is weak, skip it 416 # if we already have a function, and this is weak, skip it
417 if (!defined($ref_func) || !defined($weak{$text})) { 417 if (!defined($ref_func) && !defined($weak{$text}) &&
418 # PPC64 can have symbols that start with .L and
419 # gcc considers these special. Don't use them!
420 $text !~ /^\.L/) {
418 $ref_func = $text; 421 $ref_func = $text;
422 $offset = hex $1;
419 } 423 }
420 } 424 }
421 } elsif ($read_headers && /$mcount_section/) { 425 } elsif ($read_headers && /$mcount_section/) {
@@ -440,7 +444,7 @@ while (<IN>) {
440} 444}
441 445
442# dump out anymore offsets that may have been found 446# dump out anymore offsets that may have been found
443update_funcs() if ($text_found); 447update_funcs() if (defined($ref_func));
444 448
445# If we did not find any mcount callers, we are done (do nothing). 449# If we did not find any mcount callers, we are done (do nothing).
446if (!$opened) { 450if (!$opened) {
diff --git a/security/integrity/ima/ima_main.c b/security/integrity/ima/ima_main.c
index 6f611874d10e..101c512564ec 100644
--- a/security/integrity/ima/ima_main.c
+++ b/security/integrity/ima/ima_main.c
@@ -238,7 +238,34 @@ out:
238} 238}
239 239
240/* 240/*
241 * ima_opens_get - increment file counts 241 * ima_counts_put - decrement file counts
242 *
243 * File counts are incremented in ima_path_check. On file open
244 * error, such as ETXTBSY, decrement the counts to prevent
245 * unnecessary imbalance messages.
246 */
247void ima_counts_put(struct path *path, int mask)
248{
249 struct inode *inode = path->dentry->d_inode;
250 struct ima_iint_cache *iint;
251
252 if (!ima_initialized || !S_ISREG(inode->i_mode))
253 return;
254 iint = ima_iint_find_insert_get(inode);
255 if (!iint)
256 return;
257
258 mutex_lock(&iint->mutex);
259 iint->opencount--;
260 if ((mask & MAY_WRITE) || (mask == 0))
261 iint->writecount--;
262 else if (mask & (MAY_READ | MAY_EXEC))
263 iint->readcount--;
264 mutex_unlock(&iint->mutex);
265}
266
267/*
268 * ima_counts_get - increment file counts
242 * 269 *
243 * - for IPC shm and shmat file. 270 * - for IPC shm and shmat file.
244 * - for nfsd exported files. 271 * - for nfsd exported files.
diff --git a/security/integrity/ima/ima_queue.c b/security/integrity/ima/ima_queue.c
index 7ec94314ac0c..a0880e9c8e05 100644
--- a/security/integrity/ima/ima_queue.c
+++ b/security/integrity/ima/ima_queue.c
@@ -134,7 +134,8 @@ int ima_add_template_entry(struct ima_template_entry *entry, int violation,
134 } 134 }
135out: 135out:
136 mutex_unlock(&ima_extend_list_mutex); 136 mutex_unlock(&ima_extend_list_mutex);
137 integrity_audit_msg(AUDIT_INTEGRITY_PCR, inode, entry->template_name, 137 integrity_audit_msg(AUDIT_INTEGRITY_PCR, inode,
138 entry->template.file_name,
138 op, audit_cause, result, audit_info); 139 op, audit_cause, result, audit_info);
139 return result; 140 return result;
140} 141}
diff --git a/sound/aoa/core/gpio-pmf.c b/sound/aoa/core/gpio-pmf.c
index 5ca2220eac7d..1dd0c28d1fb7 100644
--- a/sound/aoa/core/gpio-pmf.c
+++ b/sound/aoa/core/gpio-pmf.c
@@ -182,6 +182,10 @@ static int pmf_set_notify(struct gpio_runtime *rt,
182 if (!old && notify) { 182 if (!old && notify) {
183 irq_client = kzalloc(sizeof(struct pmf_irq_client), 183 irq_client = kzalloc(sizeof(struct pmf_irq_client),
184 GFP_KERNEL); 184 GFP_KERNEL);
185 if (!irq_client) {
186 err = -ENOMEM;
187 goto out_unlock;
188 }
185 irq_client->data = notif; 189 irq_client->data = notif;
186 irq_client->handler = pmf_handle_notify_irq; 190 irq_client->handler = pmf_handle_notify_irq;
187 irq_client->owner = THIS_MODULE; 191 irq_client->owner = THIS_MODULE;
diff --git a/sound/arm/pxa2xx-pcm-lib.c b/sound/arm/pxa2xx-pcm-lib.c
index 108b643229ba..6205f37d547c 100644
--- a/sound/arm/pxa2xx-pcm-lib.c
+++ b/sound/arm/pxa2xx-pcm-lib.c
@@ -75,7 +75,7 @@ int __pxa2xx_pcm_hw_free(struct snd_pcm_substream *substream)
75{ 75{
76 struct pxa2xx_runtime_data *rtd = substream->runtime->private_data; 76 struct pxa2xx_runtime_data *rtd = substream->runtime->private_data;
77 77
78 if (rtd && rtd->params) 78 if (rtd && rtd->params && rtd->params->drcmr)
79 *rtd->params->drcmr = 0; 79 *rtd->params->drcmr = 0;
80 80
81 snd_pcm_set_runtime_buffer(substream, NULL); 81 snd_pcm_set_runtime_buffer(substream, NULL);
diff --git a/sound/core/pcm_lib.c b/sound/core/pcm_lib.c
index 333e4dd29450..72cfd47af6b8 100644
--- a/sound/core/pcm_lib.c
+++ b/sound/core/pcm_lib.c
@@ -233,6 +233,18 @@ static int snd_pcm_update_hw_ptr_interrupt(struct snd_pcm_substream *substream)
233 xrun(substream); 233 xrun(substream);
234 return -EPIPE; 234 return -EPIPE;
235 } 235 }
236 if (xrun_debug(substream, 8)) {
237 char name[16];
238 pcm_debug_name(substream, name, sizeof(name));
239 snd_printd("period_update: %s: pos=0x%x/0x%x/0x%x, "
240 "hwptr=0x%lx, hw_base=0x%lx, hw_intr=0x%lx\n",
241 name, (unsigned int)pos,
242 (unsigned int)runtime->period_size,
243 (unsigned int)runtime->buffer_size,
244 (unsigned long)old_hw_ptr,
245 (unsigned long)runtime->hw_ptr_base,
246 (unsigned long)runtime->hw_ptr_interrupt);
247 }
236 hw_base = runtime->hw_ptr_base; 248 hw_base = runtime->hw_ptr_base;
237 new_hw_ptr = hw_base + pos; 249 new_hw_ptr = hw_base + pos;
238 hw_ptr_interrupt = runtime->hw_ptr_interrupt + runtime->period_size; 250 hw_ptr_interrupt = runtime->hw_ptr_interrupt + runtime->period_size;
@@ -244,18 +256,27 @@ static int snd_pcm_update_hw_ptr_interrupt(struct snd_pcm_substream *substream)
244 delta = new_hw_ptr - hw_ptr_interrupt; 256 delta = new_hw_ptr - hw_ptr_interrupt;
245 } 257 }
246 if (delta < 0) { 258 if (delta < 0) {
247 delta += runtime->buffer_size; 259 if (runtime->periods == 1 || new_hw_ptr < old_hw_ptr)
260 delta += runtime->buffer_size;
248 if (delta < 0) { 261 if (delta < 0) {
249 hw_ptr_error(substream, 262 hw_ptr_error(substream,
250 "Unexpected hw_pointer value " 263 "Unexpected hw_pointer value "
251 "(stream=%i, pos=%ld, intr_ptr=%ld)\n", 264 "(stream=%i, pos=%ld, intr_ptr=%ld)\n",
252 substream->stream, (long)pos, 265 substream->stream, (long)pos,
253 (long)hw_ptr_interrupt); 266 (long)hw_ptr_interrupt);
267#if 1
268 /* simply skipping the hwptr update seems more
269 * robust in some cases, e.g. on VMware with
270 * inaccurate timer source
271 */
272 return 0; /* skip this update */
273#else
254 /* rebase to interrupt position */ 274 /* rebase to interrupt position */
255 hw_base = new_hw_ptr = hw_ptr_interrupt; 275 hw_base = new_hw_ptr = hw_ptr_interrupt;
256 /* align hw_base to buffer_size */ 276 /* align hw_base to buffer_size */
257 hw_base -= hw_base % runtime->buffer_size; 277 hw_base -= hw_base % runtime->buffer_size;
258 delta = 0; 278 delta = 0;
279#endif
259 } else { 280 } else {
260 hw_base += runtime->buffer_size; 281 hw_base += runtime->buffer_size;
261 if (hw_base >= runtime->boundary) 282 if (hw_base >= runtime->boundary)
@@ -344,6 +365,19 @@ int snd_pcm_update_hw_ptr(struct snd_pcm_substream *substream)
344 xrun(substream); 365 xrun(substream);
345 return -EPIPE; 366 return -EPIPE;
346 } 367 }
368 if (xrun_debug(substream, 16)) {
369 char name[16];
370 pcm_debug_name(substream, name, sizeof(name));
371 snd_printd("hw_update: %s: pos=0x%x/0x%x/0x%x, "
372 "hwptr=0x%lx, hw_base=0x%lx, hw_intr=0x%lx\n",
373 name, (unsigned int)pos,
374 (unsigned int)runtime->period_size,
375 (unsigned int)runtime->buffer_size,
376 (unsigned long)old_hw_ptr,
377 (unsigned long)runtime->hw_ptr_base,
378 (unsigned long)runtime->hw_ptr_interrupt);
379 }
380
347 hw_base = runtime->hw_ptr_base; 381 hw_base = runtime->hw_ptr_base;
348 new_hw_ptr = hw_base + pos; 382 new_hw_ptr = hw_base + pos;
349 383
diff --git a/sound/core/seq/Makefile b/sound/core/seq/Makefile
index 1bcb360330e5..941f64a853eb 100644
--- a/sound/core/seq/Makefile
+++ b/sound/core/seq/Makefile
@@ -3,10 +3,6 @@
3# Copyright (c) 1999 by Jaroslav Kysela <perex@perex.cz> 3# Copyright (c) 1999 by Jaroslav Kysela <perex@perex.cz>
4# 4#
5 5
6ifeq ($(CONFIG_SND_SEQUENCER_OSS),y)
7 obj-$(CONFIG_SND_SEQUENCER) += oss/
8endif
9
10snd-seq-device-objs := seq_device.o 6snd-seq-device-objs := seq_device.o
11snd-seq-objs := seq.o seq_lock.o seq_clientmgr.o seq_memory.o seq_queue.o \ 7snd-seq-objs := seq.o seq_lock.o seq_clientmgr.o seq_memory.o seq_queue.o \
12 seq_fifo.o seq_prioq.o seq_timer.o \ 8 seq_fifo.o seq_prioq.o seq_timer.o \
@@ -19,7 +15,8 @@ snd-seq-virmidi-objs := seq_virmidi.o
19 15
20obj-$(CONFIG_SND_SEQUENCER) += snd-seq.o snd-seq-device.o 16obj-$(CONFIG_SND_SEQUENCER) += snd-seq.o snd-seq-device.o
21ifeq ($(CONFIG_SND_SEQUENCER_OSS),y) 17ifeq ($(CONFIG_SND_SEQUENCER_OSS),y)
22obj-$(CONFIG_SND_SEQUENCER) += snd-seq-midi-event.o 18 obj-$(CONFIG_SND_SEQUENCER) += snd-seq-midi-event.o
19 obj-$(CONFIG_SND_SEQUENCER) += oss/
23endif 20endif
24obj-$(CONFIG_SND_SEQ_DUMMY) += snd-seq-dummy.o 21obj-$(CONFIG_SND_SEQ_DUMMY) += snd-seq-dummy.o
25 22
diff --git a/sound/isa/cmi8330.c b/sound/isa/cmi8330.c
index de83608719ea..3ee0269e5bd0 100644
--- a/sound/isa/cmi8330.c
+++ b/sound/isa/cmi8330.c
@@ -338,7 +338,7 @@ static int __devinit snd_cmi8330_pnp(int dev, struct snd_cmi8330 *acard,
338 return -EBUSY; 338 return -EBUSY;
339 339
340 acard->mpu = pnp_request_card_device(card, id->devs[2].id, NULL); 340 acard->mpu = pnp_request_card_device(card, id->devs[2].id, NULL);
341 if (acard->play == NULL) 341 if (acard->mpu == NULL)
342 return -EBUSY; 342 return -EBUSY;
343 343
344 pdev = acard->cap; 344 pdev = acard->cap;
diff --git a/sound/isa/gus/gus_pcm.c b/sound/isa/gus/gus_pcm.c
index edb11eefdfe3..2dcf45bf7293 100644
--- a/sound/isa/gus/gus_pcm.c
+++ b/sound/isa/gus/gus_pcm.c
@@ -795,13 +795,13 @@ static int snd_gf1_pcm_volume_put(struct snd_kcontrol *kcontrol, struct snd_ctl_
795 if (!(pcmp->flags & SNDRV_GF1_PCM_PFLG_ACTIVE)) 795 if (!(pcmp->flags & SNDRV_GF1_PCM_PFLG_ACTIVE))
796 continue; 796 continue;
797 /* load real volume - better precision */ 797 /* load real volume - better precision */
798 spin_lock_irqsave(&gus->reg_lock, flags); 798 spin_lock(&gus->reg_lock);
799 snd_gf1_select_voice(gus, pvoice->number); 799 snd_gf1_select_voice(gus, pvoice->number);
800 snd_gf1_ctrl_stop(gus, SNDRV_GF1_VB_VOLUME_CONTROL); 800 snd_gf1_ctrl_stop(gus, SNDRV_GF1_VB_VOLUME_CONTROL);
801 vol = pvoice == pcmp->pvoices[0] ? gus->gf1.pcm_volume_level_left : gus->gf1.pcm_volume_level_right; 801 vol = pvoice == pcmp->pvoices[0] ? gus->gf1.pcm_volume_level_left : gus->gf1.pcm_volume_level_right;
802 snd_gf1_write16(gus, SNDRV_GF1_VW_VOLUME, vol); 802 snd_gf1_write16(gus, SNDRV_GF1_VW_VOLUME, vol);
803 pcmp->final_volume = 1; 803 pcmp->final_volume = 1;
804 spin_unlock_irqrestore(&gus->reg_lock, flags); 804 spin_unlock(&gus->reg_lock);
805 } 805 }
806 spin_unlock_irqrestore(&gus->voice_alloc, flags); 806 spin_unlock_irqrestore(&gus->voice_alloc, flags);
807 return change; 807 return change;
diff --git a/sound/oss/aedsp16.c b/sound/oss/aedsp16.c
index 3ee9900ffd7b..35b5912cf3f8 100644
--- a/sound/oss/aedsp16.c
+++ b/sound/oss/aedsp16.c
@@ -325,8 +325,9 @@
325/* 325/*
326 * Size of character arrays that store name and version of sound card 326 * Size of character arrays that store name and version of sound card
327 */ 327 */
328#define CARDNAMELEN 15 /* Size of the card's name in chars */ 328#define CARDNAMELEN 15 /* Size of the card's name in chars */
329#define CARDVERLEN 2 /* Size of the card's version in chars */ 329#define CARDVERLEN 10 /* Size of the card's version in chars */
330#define CARDVERDIGITS 2 /* Number of digits in the version */
330 331
331#if defined(CONFIG_SC6600) 332#if defined(CONFIG_SC6600)
332/* 333/*
@@ -410,7 +411,7 @@
410 411
411static int soft_cfg __initdata = 0; /* bitmapped config */ 412static int soft_cfg __initdata = 0; /* bitmapped config */
412static int soft_cfg_mss __initdata = 0; /* bitmapped mss config */ 413static int soft_cfg_mss __initdata = 0; /* bitmapped mss config */
413static int ver[CARDVERLEN] __initdata = {0, 0}; /* DSP Ver: 414static int ver[CARDVERDIGITS] __initdata = {0, 0}; /* DSP Ver:
414 hi->ver[0] lo->ver[1] */ 415 hi->ver[0] lo->ver[1] */
415 416
416#if defined(CONFIG_SC6600) 417#if defined(CONFIG_SC6600)
@@ -957,7 +958,7 @@ static int __init aedsp16_dsp_version(int port)
957 * string is finished. 958 * string is finished.
958 */ 959 */
959 ver[len++] = ret; 960 ver[len++] = ret;
960 } while (len < CARDVERLEN); 961 } while (len < CARDVERDIGITS);
961 sprintf(DSPVersion, "%d.%d", ver[0], ver[1]); 962 sprintf(DSPVersion, "%d.%d", ver[0], ver[1]);
962 963
963 DBG(("success.\n")); 964 DBG(("success.\n"));
diff --git a/sound/oss/kahlua.c b/sound/oss/kahlua.c
index c180598f1710..89466b056be7 100644
--- a/sound/oss/kahlua.c
+++ b/sound/oss/kahlua.c
@@ -199,7 +199,7 @@ MODULE_LICENSE("GPL");
199 */ 199 */
200 200
201static struct pci_device_id id_tbl[] = { 201static struct pci_device_id id_tbl[] = {
202 { PCI_VENDOR_ID_CYRIX, PCI_DEVICE_ID_CYRIX_5530_AUDIO, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, 202 { PCI_VDEVICE(CYRIX, PCI_DEVICE_ID_CYRIX_5530_AUDIO), 0 },
203 { } 203 { }
204}; 204};
205 205
diff --git a/sound/oss/mpu401.c b/sound/oss/mpu401.c
index 6c0a770ed054..734b8f9e2f78 100644
--- a/sound/oss/mpu401.c
+++ b/sound/oss/mpu401.c
@@ -926,31 +926,21 @@ static struct midi_operations mpu401_midi_operations[MAX_MIDI_DEV];
926static void mpu401_chk_version(int n, struct mpu_config *devc) 926static void mpu401_chk_version(int n, struct mpu_config *devc)
927{ 927{
928 int tmp; 928 int tmp;
929 unsigned long flags;
930 929
931 devc->version = devc->revision = 0; 930 devc->version = devc->revision = 0;
932 931
933 spin_lock_irqsave(&devc->lock,flags); 932 tmp = mpu_cmd(n, 0xAC, 0);
934 if ((tmp = mpu_cmd(n, 0xAC, 0)) < 0) 933 if (tmp < 0)
935 {
936 spin_unlock_irqrestore(&devc->lock,flags);
937 return; 934 return;
938 }
939 if ((tmp & 0xf0) > 0x20) /* Why it's larger than 2.x ??? */ 935 if ((tmp & 0xf0) > 0x20) /* Why it's larger than 2.x ??? */
940 {
941 spin_unlock_irqrestore(&devc->lock,flags);
942 return; 936 return;
943 }
944 devc->version = tmp; 937 devc->version = tmp;
945 938
946 if ((tmp = mpu_cmd(n, 0xAD, 0)) < 0) 939 if ((tmp = mpu_cmd(n, 0xAD, 0)) < 0) {
947 {
948 devc->version = 0; 940 devc->version = 0;
949 spin_unlock_irqrestore(&devc->lock,flags);
950 return; 941 return;
951 } 942 }
952 devc->revision = tmp; 943 devc->revision = tmp;
953 spin_unlock_irqrestore(&devc->lock,flags);
954} 944}
955 945
956int attach_mpu401(struct address_info *hw_config, struct module *owner) 946int attach_mpu401(struct address_info *hw_config, struct module *owner)
@@ -1084,7 +1074,7 @@ int attach_mpu401(struct address_info *hw_config, struct module *owner)
1084 sprintf(mpu_synth_info[m].name, "%s (MPU401)", hw_config->name); 1074 sprintf(mpu_synth_info[m].name, "%s (MPU401)", hw_config->name);
1085 else 1075 else
1086 sprintf(mpu_synth_info[m].name, 1076 sprintf(mpu_synth_info[m].name,
1087 "MPU-401 %d.%d%c Midi interface #%d", 1077 "MPU-401 %d.%d%c MIDI #%d",
1088 (int) (devc->version & 0xf0) >> 4, 1078 (int) (devc->version & 0xf0) >> 4,
1089 devc->version & 0x0f, 1079 devc->version & 0x0f,
1090 revision_char, 1080 revision_char,
diff --git a/sound/pci/atiixp.c b/sound/pci/atiixp.c
index 71515ddb4593..d6752dff2a44 100644
--- a/sound/pci/atiixp.c
+++ b/sound/pci/atiixp.c
@@ -287,10 +287,10 @@ struct atiixp {
287/* 287/*
288 */ 288 */
289static struct pci_device_id snd_atiixp_ids[] = { 289static struct pci_device_id snd_atiixp_ids[] = {
290 { 0x1002, 0x4341, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, /* SB200 */ 290 { PCI_VDEVICE(ATI, 0x4341), 0 }, /* SB200 */
291 { 0x1002, 0x4361, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, /* SB300 */ 291 { PCI_VDEVICE(ATI, 0x4361), 0 }, /* SB300 */
292 { 0x1002, 0x4370, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, /* SB400 */ 292 { PCI_VDEVICE(ATI, 0x4370), 0 }, /* SB400 */
293 { 0x1002, 0x4382, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, /* SB600 */ 293 { PCI_VDEVICE(ATI, 0x4382), 0 }, /* SB600 */
294 { 0, } 294 { 0, }
295}; 295};
296 296
diff --git a/sound/pci/atiixp_modem.c b/sound/pci/atiixp_modem.c
index c3136cccc559..e7e147bf8eb2 100644
--- a/sound/pci/atiixp_modem.c
+++ b/sound/pci/atiixp_modem.c
@@ -262,8 +262,8 @@ struct atiixp_modem {
262/* 262/*
263 */ 263 */
264static struct pci_device_id snd_atiixp_ids[] = { 264static struct pci_device_id snd_atiixp_ids[] = {
265 { 0x1002, 0x434d, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, /* SB200 */ 265 { PCI_VDEVICE(ATI, 0x434d), 0 }, /* SB200 */
266 { 0x1002, 0x4378, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, /* SB400 */ 266 { PCI_VDEVICE(ATI, 0x4378), 0 }, /* SB400 */
267 { 0, } 267 { 0, }
268}; 268};
269 269
diff --git a/sound/pci/au88x0/au8810.c b/sound/pci/au88x0/au8810.c
index fce22c7af0ea..c0e8c6b295cb 100644
--- a/sound/pci/au88x0/au8810.c
+++ b/sound/pci/au88x0/au8810.c
@@ -1,8 +1,7 @@
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[] = {
4 {PCI_VENDOR_ID_AUREAL, PCI_DEVICE_ID_AUREAL_ADVANTAGE, 4 {PCI_VDEVICE(AUREAL, PCI_DEVICE_ID_AUREAL_ADVANTAGE), 1,},
5 PCI_ANY_ID, PCI_ANY_ID, 0, 0, 1,},
6 {0,} 5 {0,}
7}; 6};
8 7
diff --git a/sound/pci/au88x0/au8820.c b/sound/pci/au88x0/au8820.c
index d1fbcce07257..a6527330df58 100644
--- a/sound/pci/au88x0/au8820.c
+++ b/sound/pci/au88x0/au8820.c
@@ -1,8 +1,7 @@
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[] = {
4 {PCI_VENDOR_ID_AUREAL, PCI_DEVICE_ID_AUREAL_VORTEX_1, 4 {PCI_VDEVICE(AUREAL, PCI_DEVICE_ID_AUREAL_VORTEX_1), 0,},
5 PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0,},
6 {0,} 5 {0,}
7}; 6};
8 7
diff --git a/sound/pci/au88x0/au8830.c b/sound/pci/au88x0/au8830.c
index d4f2717c14fb..6c702ad4352a 100644
--- a/sound/pci/au88x0/au8830.c
+++ b/sound/pci/au88x0/au8830.c
@@ -1,8 +1,7 @@
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[] = {
4 {PCI_VENDOR_ID_AUREAL, PCI_DEVICE_ID_AUREAL_VORTEX_2, 4 {PCI_VDEVICE(AUREAL, PCI_DEVICE_ID_AUREAL_VORTEX_2), 0,},
5 PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0,},
6 {0,} 5 {0,}
7}; 6};
8 7
diff --git a/sound/pci/ca0106/ca0106_main.c b/sound/pci/ca0106/ca0106_main.c
index 57b992a5c057..15e4138bce17 100644
--- a/sound/pci/ca0106/ca0106_main.c
+++ b/sound/pci/ca0106/ca0106_main.c
@@ -325,9 +325,9 @@ static struct snd_pcm_hardware snd_ca0106_capture_hw = {
325 .rate_max = 192000, 325 .rate_max = 192000,
326 .channels_min = 2, 326 .channels_min = 2,
327 .channels_max = 2, 327 .channels_max = 2,
328 .buffer_bytes_max = ((65536 - 64) * 8), 328 .buffer_bytes_max = 65536 - 128,
329 .period_bytes_min = 64, 329 .period_bytes_min = 64,
330 .period_bytes_max = (65536 - 64), 330 .period_bytes_max = 32768 - 64,
331 .periods_min = 2, 331 .periods_min = 2,
332 .periods_max = 2, 332 .periods_max = 2,
333 .fifo_size = 0, 333 .fifo_size = 0,
@@ -1876,7 +1876,7 @@ static int snd_ca0106_resume(struct pci_dev *pci)
1876 1876
1877// PCI IDs 1877// PCI IDs
1878static struct pci_device_id snd_ca0106_ids[] = { 1878static struct pci_device_id snd_ca0106_ids[] = {
1879 { 0x1102, 0x0007, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, /* Audigy LS or Live 24bit */ 1879 { PCI_VDEVICE(CREATIVE, 0x0007), 0 }, /* Audigy LS or Live 24bit */
1880 { 0, } 1880 { 0, }
1881}; 1881};
1882MODULE_DEVICE_TABLE(pci, snd_ca0106_ids); 1882MODULE_DEVICE_TABLE(pci, snd_ca0106_ids);
diff --git a/sound/pci/cmipci.c b/sound/pci/cmipci.c
index 449fe02f666e..ddcd4a9fd7e6 100644
--- a/sound/pci/cmipci.c
+++ b/sound/pci/cmipci.c
@@ -2797,11 +2797,11 @@ static inline void snd_cmipci_proc_init(struct cmipci *cm) {}
2797 2797
2798 2798
2799static struct pci_device_id snd_cmipci_ids[] = { 2799static struct pci_device_id snd_cmipci_ids[] = {
2800 {PCI_VENDOR_ID_CMEDIA, PCI_DEVICE_ID_CMEDIA_CM8338A, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, 2800 {PCI_VDEVICE(CMEDIA, PCI_DEVICE_ID_CMEDIA_CM8338A), 0},
2801 {PCI_VENDOR_ID_CMEDIA, PCI_DEVICE_ID_CMEDIA_CM8338B, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, 2801 {PCI_VDEVICE(CMEDIA, PCI_DEVICE_ID_CMEDIA_CM8338B), 0},
2802 {PCI_VENDOR_ID_CMEDIA, PCI_DEVICE_ID_CMEDIA_CM8738, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, 2802 {PCI_VDEVICE(CMEDIA, PCI_DEVICE_ID_CMEDIA_CM8738), 0},
2803 {PCI_VENDOR_ID_CMEDIA, PCI_DEVICE_ID_CMEDIA_CM8738B, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, 2803 {PCI_VDEVICE(CMEDIA, PCI_DEVICE_ID_CMEDIA_CM8738B), 0},
2804 {PCI_VENDOR_ID_AL, PCI_DEVICE_ID_CMEDIA_CM8738, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, 2804 {PCI_VDEVICE(AL, PCI_DEVICE_ID_CMEDIA_CM8738), 0},
2805 {0,}, 2805 {0,},
2806}; 2806};
2807 2807
diff --git a/sound/pci/cs4281.c b/sound/pci/cs4281.c
index f6286f84a221..e2e0359bb056 100644
--- a/sound/pci/cs4281.c
+++ b/sound/pci/cs4281.c
@@ -495,7 +495,7 @@ struct cs4281 {
495static irqreturn_t snd_cs4281_interrupt(int irq, void *dev_id); 495static irqreturn_t snd_cs4281_interrupt(int irq, void *dev_id);
496 496
497static struct pci_device_id snd_cs4281_ids[] = { 497static struct pci_device_id snd_cs4281_ids[] = {
498 { 0x1013, 0x6005, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, }, /* CS4281 */ 498 { PCI_VDEVICE(CIRRUS, 0x6005), 0, }, /* CS4281 */
499 { 0, } 499 { 0, }
500}; 500};
501 501
diff --git a/sound/pci/cs46xx/cs46xx.c b/sound/pci/cs46xx/cs46xx.c
index c9b3e3d48cbc..033aec430117 100644
--- a/sound/pci/cs46xx/cs46xx.c
+++ b/sound/pci/cs46xx/cs46xx.c
@@ -65,9 +65,9 @@ module_param_array(mmap_valid, bool, NULL, 0444);
65MODULE_PARM_DESC(mmap_valid, "Support OSS mmap."); 65MODULE_PARM_DESC(mmap_valid, "Support OSS mmap.");
66 66
67static struct pci_device_id snd_cs46xx_ids[] = { 67static struct pci_device_id snd_cs46xx_ids[] = {
68 { 0x1013, 0x6001, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, }, /* CS4280 */ 68 { PCI_VDEVICE(CIRRUS, 0x6001), 0, }, /* CS4280 */
69 { 0x1013, 0x6003, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, }, /* CS4612 */ 69 { PCI_VDEVICE(CIRRUS, 0x6003), 0, }, /* CS4612 */
70 { 0x1013, 0x6004, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, }, /* CS4615 */ 70 { PCI_VDEVICE(CIRRUS, 0x6004), 0, }, /* CS4615 */
71 { 0, } 71 { 0, }
72}; 72};
73 73
diff --git a/sound/pci/ctxfi/ctamixer.c b/sound/pci/ctxfi/ctamixer.c
index a1db51b3ead8..a7f4a671f7b7 100644
--- a/sound/pci/ctxfi/ctamixer.c
+++ b/sound/pci/ctxfi/ctamixer.c
@@ -242,13 +242,12 @@ static int get_amixer_rsc(struct amixer_mgr *mgr,
242 242
243 /* Allocate mem for amixer resource */ 243 /* Allocate mem for amixer resource */
244 amixer = kzalloc(sizeof(*amixer), GFP_KERNEL); 244 amixer = kzalloc(sizeof(*amixer), GFP_KERNEL);
245 if (NULL == amixer) { 245 if (!amixer)
246 err = -ENOMEM; 246 return -ENOMEM;
247 return err;
248 }
249 247
250 /* Check whether there are sufficient 248 /* Check whether there are sufficient
251 * amixer resources to meet request. */ 249 * amixer resources to meet request. */
250 err = 0;
252 spin_lock_irqsave(&mgr->mgr_lock, flags); 251 spin_lock_irqsave(&mgr->mgr_lock, flags);
253 for (i = 0; i < desc->msr; i++) { 252 for (i = 0; i < desc->msr; i++) {
254 err = mgr_get_resource(&mgr->mgr, 1, &idx); 253 err = mgr_get_resource(&mgr->mgr, 1, &idx);
@@ -397,12 +396,11 @@ static int get_sum_rsc(struct sum_mgr *mgr,
397 396
398 /* Allocate mem for sum resource */ 397 /* Allocate mem for sum resource */
399 sum = kzalloc(sizeof(*sum), GFP_KERNEL); 398 sum = kzalloc(sizeof(*sum), GFP_KERNEL);
400 if (NULL == sum) { 399 if (!sum)
401 err = -ENOMEM; 400 return -ENOMEM;
402 return err;
403 }
404 401
405 /* Check whether there are sufficient sum resources to meet request. */ 402 /* Check whether there are sufficient sum resources to meet request. */
403 err = 0;
406 spin_lock_irqsave(&mgr->mgr_lock, flags); 404 spin_lock_irqsave(&mgr->mgr_lock, flags);
407 for (i = 0; i < desc->msr; i++) { 405 for (i = 0; i < desc->msr; i++) {
408 err = mgr_get_resource(&mgr->mgr, 1, &idx); 406 err = mgr_get_resource(&mgr->mgr, 1, &idx);
diff --git a/sound/pci/ctxfi/ctdaio.c b/sound/pci/ctxfi/ctdaio.c
index 082e35c08c02..deb6cfa73600 100644
--- a/sound/pci/ctxfi/ctdaio.c
+++ b/sound/pci/ctxfi/ctdaio.c
@@ -57,9 +57,9 @@ struct daio_rsc_idx idx_20k1[NUM_DAIOTYP] = {
57 57
58struct daio_rsc_idx idx_20k2[NUM_DAIOTYP] = { 58struct daio_rsc_idx idx_20k2[NUM_DAIOTYP] = {
59 [LINEO1] = {.left = 0x40, .right = 0x41}, 59 [LINEO1] = {.left = 0x40, .right = 0x41},
60 [LINEO2] = {.left = 0x70, .right = 0x71}, 60 [LINEO2] = {.left = 0x60, .right = 0x61},
61 [LINEO3] = {.left = 0x50, .right = 0x51}, 61 [LINEO3] = {.left = 0x50, .right = 0x51},
62 [LINEO4] = {.left = 0x60, .right = 0x61}, 62 [LINEO4] = {.left = 0x70, .right = 0x71},
63 [LINEIM] = {.left = 0x45, .right = 0xc5}, 63 [LINEIM] = {.left = 0x45, .right = 0xc5},
64 [SPDIFOO] = {.left = 0x00, .right = 0x01}, 64 [SPDIFOO] = {.left = 0x00, .right = 0x01},
65 [SPDIFIO] = {.left = 0x05, .right = 0x85}, 65 [SPDIFIO] = {.left = 0x05, .right = 0x85},
diff --git a/sound/pci/ctxfi/ctsrc.c b/sound/pci/ctxfi/ctsrc.c
index e1c145d8b702..df43a5cd3938 100644
--- a/sound/pci/ctxfi/ctsrc.c
+++ b/sound/pci/ctxfi/ctsrc.c
@@ -724,12 +724,11 @@ static int get_srcimp_rsc(struct srcimp_mgr *mgr,
724 724
725 /* Allocate mem for SRCIMP resource */ 725 /* Allocate mem for SRCIMP resource */
726 srcimp = kzalloc(sizeof(*srcimp), GFP_KERNEL); 726 srcimp = kzalloc(sizeof(*srcimp), GFP_KERNEL);
727 if (NULL == srcimp) { 727 if (!srcimp)
728 err = -ENOMEM; 728 return -ENOMEM;
729 return err;
730 }
731 729
732 /* Check whether there are sufficient SRCIMP resources. */ 730 /* Check whether there are sufficient SRCIMP resources. */
731 err = 0;
733 spin_lock_irqsave(&mgr->mgr_lock, flags); 732 spin_lock_irqsave(&mgr->mgr_lock, flags);
734 for (i = 0; i < desc->msr; i++) { 733 for (i = 0; i < desc->msr; i++) {
735 err = mgr_get_resource(&mgr->mgr, 1, &idx); 734 err = mgr_get_resource(&mgr->mgr, 1, &idx);
diff --git a/sound/pci/emu10k1/emu10k1.c b/sound/pci/emu10k1/emu10k1.c
index c7f3b994101c..168af67d938e 100644
--- a/sound/pci/emu10k1/emu10k1.c
+++ b/sound/pci/emu10k1/emu10k1.c
@@ -77,9 +77,9 @@ MODULE_PARM_DESC(subsystem, "Force card subsystem model.");
77 * Class 0401: 1102:0008 (rev 00) Subsystem: 1102:1001 -> Audigy2 Value Model:SB0400 77 * Class 0401: 1102:0008 (rev 00) Subsystem: 1102:1001 -> Audigy2 Value Model:SB0400
78 */ 78 */
79static struct pci_device_id snd_emu10k1_ids[] = { 79static struct pci_device_id snd_emu10k1_ids[] = {
80 { 0x1102, 0x0002, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, /* EMU10K1 */ 80 { PCI_VDEVICE(CREATIVE, 0x0002), 0 }, /* EMU10K1 */
81 { 0x1102, 0x0004, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 1 }, /* Audigy */ 81 { PCI_VDEVICE(CREATIVE, 0x0004), 1 }, /* Audigy */
82 { 0x1102, 0x0008, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 1 }, /* Audigy 2 Value SB0400 */ 82 { PCI_VDEVICE(CREATIVE, 0x0008), 1 }, /* Audigy 2 Value SB0400 */
83 { 0, } 83 { 0, }
84}; 84};
85 85
diff --git a/sound/pci/emu10k1/emu10k1x.c b/sound/pci/emu10k1/emu10k1x.c
index 4d3ad793e98f..36e08bd2b3cc 100644
--- a/sound/pci/emu10k1/emu10k1x.c
+++ b/sound/pci/emu10k1/emu10k1x.c
@@ -1607,7 +1607,7 @@ static void __devexit snd_emu10k1x_remove(struct pci_dev *pci)
1607 1607
1608// PCI IDs 1608// PCI IDs
1609static struct pci_device_id snd_emu10k1x_ids[] = { 1609static struct pci_device_id snd_emu10k1x_ids[] = {
1610 { 0x1102, 0x0006, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, /* Dell OEM version (EMU10K1) */ 1610 { PCI_VDEVICE(CREATIVE, 0x0006), 0 }, /* Dell OEM version (EMU10K1) */
1611 { 0, } 1611 { 0, }
1612}; 1612};
1613MODULE_DEVICE_TABLE(pci, snd_emu10k1x_ids); 1613MODULE_DEVICE_TABLE(pci, snd_emu10k1x_ids);
diff --git a/sound/pci/emu10k1/p16v.c b/sound/pci/emu10k1/p16v.c
index e617acaf10e3..61b8ab39800f 100644
--- a/sound/pci/emu10k1/p16v.c
+++ b/sound/pci/emu10k1/p16v.c
@@ -644,7 +644,7 @@ int __devinit snd_p16v_pcm(struct snd_emu10k1 *emu, int device, struct snd_pcm *
644 int err; 644 int err;
645 int capture=1; 645 int capture=1;
646 646
647 /* snd_printk("KERN_DEBUG snd_p16v_pcm called. device=%d\n", device); */ 647 /* snd_printk(KERN_DEBUG "snd_p16v_pcm called. device=%d\n", device); */
648 emu->p16v_device_offset = device; 648 emu->p16v_device_offset = device;
649 if (rpcm) 649 if (rpcm)
650 *rpcm = NULL; 650 *rpcm = NULL;
diff --git a/sound/pci/ens1370.c b/sound/pci/ens1370.c
index 18f4d1e98c46..2b82c5c723e1 100644
--- a/sound/pci/ens1370.c
+++ b/sound/pci/ens1370.c
@@ -445,12 +445,12 @@ static irqreturn_t snd_audiopci_interrupt(int irq, void *dev_id);
445 445
446static struct pci_device_id snd_audiopci_ids[] = { 446static struct pci_device_id snd_audiopci_ids[] = {
447#ifdef CHIP1370 447#ifdef CHIP1370
448 { 0x1274, 0x5000, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, }, /* ES1370 */ 448 { PCI_VDEVICE(ENSONIQ, 0x5000), 0, }, /* ES1370 */
449#endif 449#endif
450#ifdef CHIP1371 450#ifdef CHIP1371
451 { 0x1274, 0x1371, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, }, /* ES1371 */ 451 { PCI_VDEVICE(ENSONIQ, 0x1371), 0, }, /* ES1371 */
452 { 0x1274, 0x5880, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, }, /* ES1373 - CT5880 */ 452 { PCI_VDEVICE(ENSONIQ, 0x5880), 0, }, /* ES1373 - CT5880 */
453 { 0x1102, 0x8938, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, }, /* Ectiva EV1938 */ 453 { PCI_VDEVICE(ECTIVA, 0x8938), 0, }, /* Ectiva EV1938 */
454#endif 454#endif
455 { 0, } 455 { 0, }
456}; 456};
diff --git a/sound/pci/es1938.c b/sound/pci/es1938.c
index fbd2ac09aa34..820318ee62c1 100644
--- a/sound/pci/es1938.c
+++ b/sound/pci/es1938.c
@@ -244,7 +244,7 @@ struct es1938 {
244static irqreturn_t snd_es1938_interrupt(int irq, void *dev_id); 244static irqreturn_t snd_es1938_interrupt(int irq, void *dev_id);
245 245
246static struct pci_device_id snd_es1938_ids[] = { 246static struct pci_device_id snd_es1938_ids[] = {
247 { 0x125d, 0x1969, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, }, /* Solo-1 */ 247 { PCI_VDEVICE(ESS, 0x1969), 0, }, /* Solo-1 */
248 { 0, } 248 { 0, }
249}; 249};
250 250
diff --git a/sound/pci/hda/hda_beep.c b/sound/pci/hda/hda_beep.c
index 29272f2e95a0..b0275a050870 100644
--- a/sound/pci/hda/hda_beep.c
+++ b/sound/pci/hda/hda_beep.c
@@ -50,19 +50,22 @@ static void snd_hda_generate_beep(struct work_struct *work)
50 * The tone frequency of beep generator on IDT/STAC codecs is 50 * The tone frequency of beep generator on IDT/STAC codecs is
51 * defined from the 8bit tone parameter, in Hz, 51 * defined from the 8bit tone parameter, in Hz,
52 * freq = 48000 * (257 - tone) / 1024 52 * freq = 48000 * (257 - tone) / 1024
53 * that is from 12kHz to 93.75kHz in step of 46.875 hz 53 * that is from 12kHz to 93.75Hz in steps of 46.875 Hz
54 */ 54 */
55static int beep_linear_tone(struct hda_beep *beep, int hz) 55static int beep_linear_tone(struct hda_beep *beep, int hz)
56{ 56{
57 if (hz <= 0)
58 return 0;
57 hz *= 1000; /* fixed point */ 59 hz *= 1000; /* fixed point */
58 hz = hz - DIGBEEP_HZ_MIN; 60 hz = hz - DIGBEEP_HZ_MIN
61 + DIGBEEP_HZ_STEP / 2; /* round to nearest step */
59 if (hz < 0) 62 if (hz < 0)
60 hz = 0; /* turn off PC beep*/ 63 hz = 0; /* turn off PC beep*/
61 else if (hz >= (DIGBEEP_HZ_MAX - DIGBEEP_HZ_MIN)) 64 else if (hz >= (DIGBEEP_HZ_MAX - DIGBEEP_HZ_MIN))
62 hz = 0xff; 65 hz = 1; /* max frequency */
63 else { 66 else {
64 hz /= DIGBEEP_HZ_STEP; 67 hz /= DIGBEEP_HZ_STEP;
65 hz++; 68 hz = 255 - hz;
66 } 69 }
67 return hz; 70 return hz;
68} 71}
diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c
index 462e2cedaa6a..c7df01b72cac 100644
--- a/sound/pci/hda/hda_codec.c
+++ b/sound/pci/hda/hda_codec.c
@@ -174,7 +174,7 @@ static int codec_exec_verb(struct hda_codec *codec, unsigned int cmd,
174 mutex_lock(&bus->cmd_mutex); 174 mutex_lock(&bus->cmd_mutex);
175 err = bus->ops.command(bus, cmd); 175 err = bus->ops.command(bus, cmd);
176 if (!err && res) 176 if (!err && res)
177 *res = bus->ops.get_response(bus); 177 *res = bus->ops.get_response(bus, codec->addr);
178 mutex_unlock(&bus->cmd_mutex); 178 mutex_unlock(&bus->cmd_mutex);
179 snd_hda_power_down(codec); 179 snd_hda_power_down(codec);
180 if (res && *res == -1 && bus->rirb_error) { 180 if (res && *res == -1 && bus->rirb_error) {
@@ -332,6 +332,12 @@ int snd_hda_get_connections(struct hda_codec *codec, hda_nid_t nid,
332 AC_VERB_GET_CONNECT_LIST, i); 332 AC_VERB_GET_CONNECT_LIST, i);
333 range_val = !!(parm & (1 << (shift-1))); /* ranges */ 333 range_val = !!(parm & (1 << (shift-1))); /* ranges */
334 val = parm & mask; 334 val = parm & mask;
335 if (val == 0) {
336 snd_printk(KERN_WARNING "hda_codec: "
337 "invalid CONNECT_LIST verb %x[%i]:%x\n",
338 nid, i, parm);
339 return 0;
340 }
335 parm >>= shift; 341 parm >>= shift;
336 if (range_val) { 342 if (range_val) {
337 /* ranges between the previous and this one */ 343 /* ranges between the previous and this one */
@@ -3470,10 +3476,16 @@ int snd_hda_multi_out_analog_open(struct hda_codec *codec,
3470 } 3476 }
3471 mutex_lock(&codec->spdif_mutex); 3477 mutex_lock(&codec->spdif_mutex);
3472 if (mout->share_spdif) { 3478 if (mout->share_spdif) {
3473 runtime->hw.rates &= mout->spdif_rates; 3479 if ((runtime->hw.rates & mout->spdif_rates) &&
3474 runtime->hw.formats &= mout->spdif_formats; 3480 (runtime->hw.formats & mout->spdif_formats)) {
3475 if (mout->spdif_maxbps < hinfo->maxbps) 3481 runtime->hw.rates &= mout->spdif_rates;
3476 hinfo->maxbps = mout->spdif_maxbps; 3482 runtime->hw.formats &= mout->spdif_formats;
3483 if (mout->spdif_maxbps < hinfo->maxbps)
3484 hinfo->maxbps = mout->spdif_maxbps;
3485 } else {
3486 mout->share_spdif = 0;
3487 /* FIXME: need notify? */
3488 }
3477 } 3489 }
3478 mutex_unlock(&codec->spdif_mutex); 3490 mutex_unlock(&codec->spdif_mutex);
3479 } 3491 }
diff --git a/sound/pci/hda/hda_codec.h b/sound/pci/hda/hda_codec.h
index cad79efaabc9..1b75f28ed092 100644
--- a/sound/pci/hda/hda_codec.h
+++ b/sound/pci/hda/hda_codec.h
@@ -568,7 +568,7 @@ struct hda_bus_ops {
568 /* send a single command */ 568 /* send a single command */
569 int (*command)(struct hda_bus *bus, unsigned int cmd); 569 int (*command)(struct hda_bus *bus, unsigned int cmd);
570 /* get a response from the last command */ 570 /* get a response from the last command */
571 unsigned int (*get_response)(struct hda_bus *bus); 571 unsigned int (*get_response)(struct hda_bus *bus, unsigned int addr);
572 /* free the private data */ 572 /* free the private data */
573 void (*private_free)(struct hda_bus *); 573 void (*private_free)(struct hda_bus *);
574 /* attach a PCM stream */ 574 /* attach a PCM stream */
diff --git a/sound/pci/hda/hda_eld.c b/sound/pci/hda/hda_eld.c
index fcad5ec31773..9446a5abea13 100644
--- a/sound/pci/hda/hda_eld.c
+++ b/sound/pci/hda/hda_eld.c
@@ -508,7 +508,7 @@ static void hdmi_write_eld_info(struct snd_info_entry *entry,
508 char name[64]; 508 char name[64];
509 char *sname; 509 char *sname;
510 long long val; 510 long long val;
511 int n; 511 unsigned int n;
512 512
513 while (!snd_info_get_line(buffer, line, sizeof(line))) { 513 while (!snd_info_get_line(buffer, line, sizeof(line))) {
514 if (sscanf(line, "%s %llx", name, &val) != 2) 514 if (sscanf(line, "%s %llx", name, &val) != 2)
@@ -539,7 +539,7 @@ static void hdmi_write_eld_info(struct snd_info_entry *entry,
539 sname++; 539 sname++;
540 n = 10 * n + name[4] - '0'; 540 n = 10 * n + name[4] - '0';
541 } 541 }
542 if (n < 0 || n > 31) /* double the CEA limit */ 542 if (n >= ELD_MAX_SAD)
543 continue; 543 continue;
544 if (!strcmp(sname, "_coding_type")) 544 if (!strcmp(sname, "_coding_type"))
545 e->sad[n].format = val; 545 e->sad[n].format = val;
diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c
index 4e9ea7080270..175f07a381ba 100644
--- a/sound/pci/hda/hda_intel.c
+++ b/sound/pci/hda/hda_intel.c
@@ -253,7 +253,7 @@ enum { SDI0, SDI1, SDI2, SDI3, SDO0, SDO1, SDO2, SDO3 };
253 253
254/* STATESTS int mask: S3,SD2,SD1,SD0 */ 254/* STATESTS int mask: S3,SD2,SD1,SD0 */
255#define AZX_MAX_CODECS 4 255#define AZX_MAX_CODECS 4
256#define STATESTS_INT_MASK 0x0f 256#define STATESTS_INT_MASK ((1 << AZX_MAX_CODECS) - 1)
257 257
258/* SD_CTL bits */ 258/* SD_CTL bits */
259#define SD_CTL_STREAM_RESET 0x01 /* stream reset bit */ 259#define SD_CTL_STREAM_RESET 0x01 /* stream reset bit */
@@ -361,8 +361,8 @@ struct azx_rb {
361 dma_addr_t addr; /* physical address of CORB/RIRB buffer */ 361 dma_addr_t addr; /* physical address of CORB/RIRB buffer */
362 /* for RIRB */ 362 /* for RIRB */
363 unsigned short rp, wp; /* read/write pointers */ 363 unsigned short rp, wp; /* read/write pointers */
364 int cmds; /* number of pending requests */ 364 int cmds[AZX_MAX_CODECS]; /* number of pending requests */
365 u32 res; /* last read value */ 365 u32 res[AZX_MAX_CODECS]; /* last read value */
366}; 366};
367 367
368struct azx { 368struct azx {
@@ -418,7 +418,7 @@ struct azx {
418 unsigned int probing :1; /* codec probing phase */ 418 unsigned int probing :1; /* codec probing phase */
419 419
420 /* for debugging */ 420 /* for debugging */
421 unsigned int last_cmd; /* last issued command (to sync) */ 421 unsigned int last_cmd[AZX_MAX_CODECS];
422 422
423 /* for pending irqs */ 423 /* for pending irqs */
424 struct work_struct irq_pending_work; 424 struct work_struct irq_pending_work;
@@ -513,6 +513,7 @@ static int azx_alloc_cmd_io(struct azx *chip)
513 513
514static void azx_init_cmd_io(struct azx *chip) 514static void azx_init_cmd_io(struct azx *chip)
515{ 515{
516 spin_lock_irq(&chip->reg_lock);
516 /* CORB set up */ 517 /* CORB set up */
517 chip->corb.addr = chip->rb.addr; 518 chip->corb.addr = chip->rb.addr;
518 chip->corb.buf = (u32 *)chip->rb.area; 519 chip->corb.buf = (u32 *)chip->rb.area;
@@ -531,7 +532,8 @@ static void azx_init_cmd_io(struct azx *chip)
531 /* RIRB set up */ 532 /* RIRB set up */
532 chip->rirb.addr = chip->rb.addr + 2048; 533 chip->rirb.addr = chip->rb.addr + 2048;
533 chip->rirb.buf = (u32 *)(chip->rb.area + 2048); 534 chip->rirb.buf = (u32 *)(chip->rb.area + 2048);
534 chip->rirb.wp = chip->rirb.rp = chip->rirb.cmds = 0; 535 chip->rirb.wp = chip->rirb.rp = 0;
536 memset(chip->rirb.cmds, 0, sizeof(chip->rirb.cmds));
535 azx_writel(chip, RIRBLBASE, (u32)chip->rirb.addr); 537 azx_writel(chip, RIRBLBASE, (u32)chip->rirb.addr);
536 azx_writel(chip, RIRBUBASE, upper_32_bits(chip->rirb.addr)); 538 azx_writel(chip, RIRBUBASE, upper_32_bits(chip->rirb.addr));
537 539
@@ -543,30 +545,60 @@ static void azx_init_cmd_io(struct azx *chip)
543 azx_writew(chip, RINTCNT, 1); 545 azx_writew(chip, RINTCNT, 1);
544 /* enable rirb dma and response irq */ 546 /* enable rirb dma and response irq */
545 azx_writeb(chip, RIRBCTL, ICH6_RBCTL_DMA_EN | ICH6_RBCTL_IRQ_EN); 547 azx_writeb(chip, RIRBCTL, ICH6_RBCTL_DMA_EN | ICH6_RBCTL_IRQ_EN);
548 spin_unlock_irq(&chip->reg_lock);
546} 549}
547 550
548static void azx_free_cmd_io(struct azx *chip) 551static void azx_free_cmd_io(struct azx *chip)
549{ 552{
553 spin_lock_irq(&chip->reg_lock);
550 /* disable ringbuffer DMAs */ 554 /* disable ringbuffer DMAs */
551 azx_writeb(chip, RIRBCTL, 0); 555 azx_writeb(chip, RIRBCTL, 0);
552 azx_writeb(chip, CORBCTL, 0); 556 azx_writeb(chip, CORBCTL, 0);
557 spin_unlock_irq(&chip->reg_lock);
558}
559
560static unsigned int azx_command_addr(u32 cmd)
561{
562 unsigned int addr = cmd >> 28;
563
564 if (addr >= AZX_MAX_CODECS) {
565 snd_BUG();
566 addr = 0;
567 }
568
569 return addr;
570}
571
572static unsigned int azx_response_addr(u32 res)
573{
574 unsigned int addr = res & 0xf;
575
576 if (addr >= AZX_MAX_CODECS) {
577 snd_BUG();
578 addr = 0;
579 }
580
581 return addr;
553} 582}
554 583
555/* send a command */ 584/* send a command */
556static int azx_corb_send_cmd(struct hda_bus *bus, u32 val) 585static int azx_corb_send_cmd(struct hda_bus *bus, u32 val)
557{ 586{
558 struct azx *chip = bus->private_data; 587 struct azx *chip = bus->private_data;
588 unsigned int addr = azx_command_addr(val);
559 unsigned int wp; 589 unsigned int wp;
560 590
591 spin_lock_irq(&chip->reg_lock);
592
561 /* add command to corb */ 593 /* add command to corb */
562 wp = azx_readb(chip, CORBWP); 594 wp = azx_readb(chip, CORBWP);
563 wp++; 595 wp++;
564 wp %= ICH6_MAX_CORB_ENTRIES; 596 wp %= ICH6_MAX_CORB_ENTRIES;
565 597
566 spin_lock_irq(&chip->reg_lock); 598 chip->rirb.cmds[addr]++;
567 chip->rirb.cmds++;
568 chip->corb.buf[wp] = cpu_to_le32(val); 599 chip->corb.buf[wp] = cpu_to_le32(val);
569 azx_writel(chip, CORBWP, wp); 600 azx_writel(chip, CORBWP, wp);
601
570 spin_unlock_irq(&chip->reg_lock); 602 spin_unlock_irq(&chip->reg_lock);
571 603
572 return 0; 604 return 0;
@@ -578,13 +610,14 @@ static int azx_corb_send_cmd(struct hda_bus *bus, u32 val)
578static void azx_update_rirb(struct azx *chip) 610static void azx_update_rirb(struct azx *chip)
579{ 611{
580 unsigned int rp, wp; 612 unsigned int rp, wp;
613 unsigned int addr;
581 u32 res, res_ex; 614 u32 res, res_ex;
582 615
583 wp = azx_readb(chip, RIRBWP); 616 wp = azx_readb(chip, RIRBWP);
584 if (wp == chip->rirb.wp) 617 if (wp == chip->rirb.wp)
585 return; 618 return;
586 chip->rirb.wp = wp; 619 chip->rirb.wp = wp;
587 620
588 while (chip->rirb.rp != wp) { 621 while (chip->rirb.rp != wp) {
589 chip->rirb.rp++; 622 chip->rirb.rp++;
590 chip->rirb.rp %= ICH6_MAX_RIRB_ENTRIES; 623 chip->rirb.rp %= ICH6_MAX_RIRB_ENTRIES;
@@ -592,18 +625,24 @@ static void azx_update_rirb(struct azx *chip)
592 rp = chip->rirb.rp << 1; /* an RIRB entry is 8-bytes */ 625 rp = chip->rirb.rp << 1; /* an RIRB entry is 8-bytes */
593 res_ex = le32_to_cpu(chip->rirb.buf[rp + 1]); 626 res_ex = le32_to_cpu(chip->rirb.buf[rp + 1]);
594 res = le32_to_cpu(chip->rirb.buf[rp]); 627 res = le32_to_cpu(chip->rirb.buf[rp]);
628 addr = azx_response_addr(res_ex);
595 if (res_ex & ICH6_RIRB_EX_UNSOL_EV) 629 if (res_ex & ICH6_RIRB_EX_UNSOL_EV)
596 snd_hda_queue_unsol_event(chip->bus, res, res_ex); 630 snd_hda_queue_unsol_event(chip->bus, res, res_ex);
597 else if (chip->rirb.cmds) { 631 else if (chip->rirb.cmds[addr]) {
598 chip->rirb.res = res; 632 chip->rirb.res[addr] = res;
599 smp_wmb(); 633 smp_wmb();
600 chip->rirb.cmds--; 634 chip->rirb.cmds[addr]--;
601 } 635 } else
636 snd_printk(KERN_ERR SFX "spurious response %#x:%#x, "
637 "last cmd=%#08x\n",
638 res, res_ex,
639 chip->last_cmd[addr]);
602 } 640 }
603} 641}
604 642
605/* receive a response */ 643/* receive a response */
606static unsigned int azx_rirb_get_response(struct hda_bus *bus) 644static unsigned int azx_rirb_get_response(struct hda_bus *bus,
645 unsigned int addr)
607{ 646{
608 struct azx *chip = bus->private_data; 647 struct azx *chip = bus->private_data;
609 unsigned long timeout; 648 unsigned long timeout;
@@ -616,10 +655,10 @@ static unsigned int azx_rirb_get_response(struct hda_bus *bus)
616 azx_update_rirb(chip); 655 azx_update_rirb(chip);
617 spin_unlock_irq(&chip->reg_lock); 656 spin_unlock_irq(&chip->reg_lock);
618 } 657 }
619 if (!chip->rirb.cmds) { 658 if (!chip->rirb.cmds[addr]) {
620 smp_rmb(); 659 smp_rmb();
621 bus->rirb_error = 0; 660 bus->rirb_error = 0;
622 return chip->rirb.res; /* the last value */ 661 return chip->rirb.res[addr]; /* the last value */
623 } 662 }
624 if (time_after(jiffies, timeout)) 663 if (time_after(jiffies, timeout))
625 break; 664 break;
@@ -633,7 +672,8 @@ static unsigned int azx_rirb_get_response(struct hda_bus *bus)
633 672
634 if (chip->msi) { 673 if (chip->msi) {
635 snd_printk(KERN_WARNING SFX "No response from codec, " 674 snd_printk(KERN_WARNING SFX "No response from codec, "
636 "disabling MSI: last cmd=0x%08x\n", chip->last_cmd); 675 "disabling MSI: last cmd=0x%08x\n",
676 chip->last_cmd[addr]);
637 free_irq(chip->irq, chip); 677 free_irq(chip->irq, chip);
638 chip->irq = -1; 678 chip->irq = -1;
639 pci_disable_msi(chip->pci); 679 pci_disable_msi(chip->pci);
@@ -648,7 +688,7 @@ static unsigned int azx_rirb_get_response(struct hda_bus *bus)
648 if (!chip->polling_mode) { 688 if (!chip->polling_mode) {
649 snd_printk(KERN_WARNING SFX "azx_get_response timeout, " 689 snd_printk(KERN_WARNING SFX "azx_get_response timeout, "
650 "switching to polling mode: last cmd=0x%08x\n", 690 "switching to polling mode: last cmd=0x%08x\n",
651 chip->last_cmd); 691 chip->last_cmd[addr]);
652 chip->polling_mode = 1; 692 chip->polling_mode = 1;
653 goto again; 693 goto again;
654 } 694 }
@@ -672,7 +712,7 @@ static unsigned int azx_rirb_get_response(struct hda_bus *bus)
672 712
673 snd_printk(KERN_ERR "hda_intel: azx_get_response timeout, " 713 snd_printk(KERN_ERR "hda_intel: azx_get_response timeout, "
674 "switching to single_cmd mode: last cmd=0x%08x\n", 714 "switching to single_cmd mode: last cmd=0x%08x\n",
675 chip->last_cmd); 715 chip->last_cmd[addr]);
676 chip->single_cmd = 1; 716 chip->single_cmd = 1;
677 bus->response_reset = 0; 717 bus->response_reset = 0;
678 /* re-initialize CORB/RIRB */ 718 /* re-initialize CORB/RIRB */
@@ -692,7 +732,7 @@ static unsigned int azx_rirb_get_response(struct hda_bus *bus)
692 */ 732 */
693 733
694/* receive a response */ 734/* receive a response */
695static int azx_single_wait_for_response(struct azx *chip) 735static int azx_single_wait_for_response(struct azx *chip, unsigned int addr)
696{ 736{
697 int timeout = 50; 737 int timeout = 50;
698 738
@@ -700,7 +740,7 @@ static int azx_single_wait_for_response(struct azx *chip)
700 /* check IRV busy bit */ 740 /* check IRV busy bit */
701 if (azx_readw(chip, IRS) & ICH6_IRS_VALID) { 741 if (azx_readw(chip, IRS) & ICH6_IRS_VALID) {
702 /* reuse rirb.res as the response return value */ 742 /* reuse rirb.res as the response return value */
703 chip->rirb.res = azx_readl(chip, IR); 743 chip->rirb.res[addr] = azx_readl(chip, IR);
704 return 0; 744 return 0;
705 } 745 }
706 udelay(1); 746 udelay(1);
@@ -708,7 +748,7 @@ static int azx_single_wait_for_response(struct azx *chip)
708 if (printk_ratelimit()) 748 if (printk_ratelimit())
709 snd_printd(SFX "get_response timeout: IRS=0x%x\n", 749 snd_printd(SFX "get_response timeout: IRS=0x%x\n",
710 azx_readw(chip, IRS)); 750 azx_readw(chip, IRS));
711 chip->rirb.res = -1; 751 chip->rirb.res[addr] = -1;
712 return -EIO; 752 return -EIO;
713} 753}
714 754
@@ -716,6 +756,7 @@ static int azx_single_wait_for_response(struct azx *chip)
716static int azx_single_send_cmd(struct hda_bus *bus, u32 val) 756static int azx_single_send_cmd(struct hda_bus *bus, u32 val)
717{ 757{
718 struct azx *chip = bus->private_data; 758 struct azx *chip = bus->private_data;
759 unsigned int addr = azx_command_addr(val);
719 int timeout = 50; 760 int timeout = 50;
720 761
721 bus->rirb_error = 0; 762 bus->rirb_error = 0;
@@ -728,7 +769,7 @@ static int azx_single_send_cmd(struct hda_bus *bus, u32 val)
728 azx_writel(chip, IC, val); 769 azx_writel(chip, IC, val);
729 azx_writew(chip, IRS, azx_readw(chip, IRS) | 770 azx_writew(chip, IRS, azx_readw(chip, IRS) |
730 ICH6_IRS_BUSY); 771 ICH6_IRS_BUSY);
731 return azx_single_wait_for_response(chip); 772 return azx_single_wait_for_response(chip, addr);
732 } 773 }
733 udelay(1); 774 udelay(1);
734 } 775 }
@@ -739,10 +780,11 @@ static int azx_single_send_cmd(struct hda_bus *bus, u32 val)
739} 780}
740 781
741/* receive a response */ 782/* receive a response */
742static unsigned int azx_single_get_response(struct hda_bus *bus) 783static unsigned int azx_single_get_response(struct hda_bus *bus,
784 unsigned int addr)
743{ 785{
744 struct azx *chip = bus->private_data; 786 struct azx *chip = bus->private_data;
745 return chip->rirb.res; 787 return chip->rirb.res[addr];
746} 788}
747 789
748/* 790/*
@@ -757,7 +799,7 @@ static int azx_send_cmd(struct hda_bus *bus, unsigned int val)
757{ 799{
758 struct azx *chip = bus->private_data; 800 struct azx *chip = bus->private_data;
759 801
760 chip->last_cmd = val; 802 chip->last_cmd[azx_command_addr(val)] = val;
761 if (chip->single_cmd) 803 if (chip->single_cmd)
762 return azx_single_send_cmd(bus, val); 804 return azx_single_send_cmd(bus, val);
763 else 805 else
@@ -765,13 +807,14 @@ static int azx_send_cmd(struct hda_bus *bus, unsigned int val)
765} 807}
766 808
767/* get a response */ 809/* get a response */
768static unsigned int azx_get_response(struct hda_bus *bus) 810static unsigned int azx_get_response(struct hda_bus *bus,
811 unsigned int addr)
769{ 812{
770 struct azx *chip = bus->private_data; 813 struct azx *chip = bus->private_data;
771 if (chip->single_cmd) 814 if (chip->single_cmd)
772 return azx_single_get_response(bus); 815 return azx_single_get_response(bus, addr);
773 else 816 else
774 return azx_rirb_get_response(bus); 817 return azx_rirb_get_response(bus, addr);
775} 818}
776 819
777#ifdef CONFIG_SND_HDA_POWER_SAVE 820#ifdef CONFIG_SND_HDA_POWER_SAVE
@@ -1243,10 +1286,12 @@ static int probe_codec(struct azx *chip, int addr)
1243 (AC_VERB_PARAMETERS << 8) | AC_PAR_VENDOR_ID; 1286 (AC_VERB_PARAMETERS << 8) | AC_PAR_VENDOR_ID;
1244 unsigned int res; 1287 unsigned int res;
1245 1288
1289 mutex_lock(&chip->bus->cmd_mutex);
1246 chip->probing = 1; 1290 chip->probing = 1;
1247 azx_send_cmd(chip->bus, cmd); 1291 azx_send_cmd(chip->bus, cmd);
1248 res = azx_get_response(chip->bus); 1292 res = azx_get_response(chip->bus, addr);
1249 chip->probing = 0; 1293 chip->probing = 0;
1294 mutex_unlock(&chip->bus->cmd_mutex);
1250 if (res == -1) 1295 if (res == -1)
1251 return -EIO; 1296 return -EIO;
1252 snd_printdd(SFX "codec #%d probed OK\n", addr); 1297 snd_printdd(SFX "codec #%d probed OK\n", addr);
@@ -1454,6 +1499,18 @@ static int azx_pcm_open(struct snd_pcm_substream *substream)
1454 mutex_unlock(&chip->open_mutex); 1499 mutex_unlock(&chip->open_mutex);
1455 return err; 1500 return err;
1456 } 1501 }
1502 snd_pcm_limit_hw_rates(runtime);
1503 /* sanity check */
1504 if (snd_BUG_ON(!runtime->hw.channels_min) ||
1505 snd_BUG_ON(!runtime->hw.channels_max) ||
1506 snd_BUG_ON(!runtime->hw.formats) ||
1507 snd_BUG_ON(!runtime->hw.rates)) {
1508 azx_release_device(azx_dev);
1509 hinfo->ops.close(hinfo, apcm->codec, substream);
1510 snd_hda_power_down(apcm->codec);
1511 mutex_unlock(&chip->open_mutex);
1512 return -EINVAL;
1513 }
1457 spin_lock_irqsave(&chip->reg_lock, flags); 1514 spin_lock_irqsave(&chip->reg_lock, flags);
1458 azx_dev->substream = substream; 1515 azx_dev->substream = substream;
1459 azx_dev->running = 0; 1516 azx_dev->running = 0;
@@ -1462,7 +1519,6 @@ static int azx_pcm_open(struct snd_pcm_substream *substream)
1462 runtime->private_data = azx_dev; 1519 runtime->private_data = azx_dev;
1463 snd_pcm_set_sync(substream); 1520 snd_pcm_set_sync(substream);
1464 mutex_unlock(&chip->open_mutex); 1521 mutex_unlock(&chip->open_mutex);
1465
1466 return 0; 1522 return 0;
1467} 1523}
1468 1524
@@ -2322,9 +2378,19 @@ static int __devinit azx_create(struct snd_card *card, struct pci_dev *pci,
2322 gcap = azx_readw(chip, GCAP); 2378 gcap = azx_readw(chip, GCAP);
2323 snd_printdd(SFX "chipset global capabilities = 0x%x\n", gcap); 2379 snd_printdd(SFX "chipset global capabilities = 0x%x\n", gcap);
2324 2380
2325 /* ATI chips seems buggy about 64bit DMA addresses */ 2381 /* disable SB600 64bit support for safety */
2326 if (chip->driver_type == AZX_DRIVER_ATI) 2382 if ((chip->driver_type == AZX_DRIVER_ATI) ||
2327 gcap &= ~ICH6_GCAP_64OK; 2383 (chip->driver_type == AZX_DRIVER_ATIHDMI)) {
2384 struct pci_dev *p_smbus;
2385 p_smbus = pci_get_device(PCI_VENDOR_ID_ATI,
2386 PCI_DEVICE_ID_ATI_SBX00_SMBUS,
2387 NULL);
2388 if (p_smbus) {
2389 if (p_smbus->revision < 0x30)
2390 gcap &= ~ICH6_GCAP_64OK;
2391 pci_dev_put(p_smbus);
2392 }
2393 }
2328 2394
2329 /* allow 64bit DMA address if supported by H/W */ 2395 /* allow 64bit DMA address if supported by H/W */
2330 if ((gcap & ICH6_GCAP_64OK) && !pci_set_dma_mask(pci, DMA_BIT_MASK(64))) 2396 if ((gcap & ICH6_GCAP_64OK) && !pci_set_dma_mask(pci, DMA_BIT_MASK(64)))
diff --git a/sound/pci/hda/patch_analog.c b/sound/pci/hda/patch_analog.c
index 84cc49ca9148..3da85caf8af1 100644
--- a/sound/pci/hda/patch_analog.c
+++ b/sound/pci/hda/patch_analog.c
@@ -72,6 +72,7 @@ struct ad198x_spec {
72 hda_nid_t private_dac_nids[AUTO_CFG_MAX_OUTS]; 72 hda_nid_t private_dac_nids[AUTO_CFG_MAX_OUTS];
73 73
74 unsigned int jack_present :1; 74 unsigned int jack_present :1;
75 unsigned int inv_jack_detect:1;
75 76
76#ifdef CONFIG_SND_HDA_POWER_SAVE 77#ifdef CONFIG_SND_HDA_POWER_SAVE
77 struct hda_loopback_check loopback; 78 struct hda_loopback_check loopback;
@@ -669,39 +670,13 @@ static struct hda_input_mux ad1986a_automic_capture_source = {
669 }, 670 },
670}; 671};
671 672
672static struct snd_kcontrol_new ad1986a_laptop_eapd_mixers[] = { 673static struct snd_kcontrol_new ad1986a_laptop_master_mixers[] = {
673 HDA_BIND_VOL("Master Playback Volume", &ad1986a_laptop_master_vol), 674 HDA_BIND_VOL("Master Playback Volume", &ad1986a_laptop_master_vol),
674 HDA_BIND_SW("Master Playback Switch", &ad1986a_laptop_master_sw), 675 HDA_BIND_SW("Master Playback Switch", &ad1986a_laptop_master_sw),
675 HDA_CODEC_VOLUME("PCM Playback Volume", 0x03, 0x0, HDA_OUTPUT),
676 HDA_CODEC_MUTE("PCM Playback Switch", 0x03, 0x0, HDA_OUTPUT),
677 HDA_CODEC_VOLUME("Internal Mic Playback Volume", 0x17, 0, HDA_OUTPUT),
678 HDA_CODEC_MUTE("Internal Mic Playback Switch", 0x17, 0, HDA_OUTPUT),
679 HDA_CODEC_VOLUME("Mic Playback Volume", 0x13, 0x0, HDA_OUTPUT),
680 HDA_CODEC_MUTE("Mic Playback Switch", 0x13, 0x0, HDA_OUTPUT),
681 HDA_CODEC_VOLUME("Mic Boost", 0x0f, 0x0, HDA_OUTPUT),
682 HDA_CODEC_VOLUME("Capture Volume", 0x12, 0x0, HDA_OUTPUT),
683 HDA_CODEC_MUTE("Capture Switch", 0x12, 0x0, HDA_OUTPUT),
684 {
685 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
686 .name = "Capture Source",
687 .info = ad198x_mux_enum_info,
688 .get = ad198x_mux_enum_get,
689 .put = ad198x_mux_enum_put,
690 },
691 {
692 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
693 .name = "External Amplifier",
694 .info = ad198x_eapd_info,
695 .get = ad198x_eapd_get,
696 .put = ad198x_eapd_put,
697 .private_value = 0x1b | (1 << 8), /* port-D, inversed */
698 },
699 { } /* end */ 676 { } /* end */
700}; 677};
701 678
702static struct snd_kcontrol_new ad1986a_samsung_mixers[] = { 679static struct snd_kcontrol_new ad1986a_laptop_eapd_mixers[] = {
703 HDA_BIND_VOL("Master Playback Volume", &ad1986a_laptop_master_vol),
704 HDA_BIND_SW("Master Playback Switch", &ad1986a_laptop_master_sw),
705 HDA_CODEC_VOLUME("PCM Playback Volume", 0x03, 0x0, HDA_OUTPUT), 680 HDA_CODEC_VOLUME("PCM Playback Volume", 0x03, 0x0, HDA_OUTPUT),
706 HDA_CODEC_MUTE("PCM Playback Switch", 0x03, 0x0, HDA_OUTPUT), 681 HDA_CODEC_MUTE("PCM Playback Switch", 0x03, 0x0, HDA_OUTPUT),
707 HDA_CODEC_VOLUME("Mic Playback Volume", 0x13, 0x0, HDA_OUTPUT), 682 HDA_CODEC_VOLUME("Mic Playback Volume", 0x13, 0x0, HDA_OUTPUT),
@@ -727,6 +702,12 @@ static struct snd_kcontrol_new ad1986a_samsung_mixers[] = {
727 { } /* end */ 702 { } /* end */
728}; 703};
729 704
705static struct snd_kcontrol_new ad1986a_laptop_intmic_mixers[] = {
706 HDA_CODEC_VOLUME("Internal Mic Playback Volume", 0x17, 0, HDA_OUTPUT),
707 HDA_CODEC_MUTE("Internal Mic Playback Switch", 0x17, 0, HDA_OUTPUT),
708 { } /* end */
709};
710
730/* re-connect the mic boost input according to the jack sensing */ 711/* re-connect the mic boost input according to the jack sensing */
731static void ad1986a_automic(struct hda_codec *codec) 712static void ad1986a_automic(struct hda_codec *codec)
732{ 713{
@@ -776,8 +757,9 @@ static void ad1986a_hp_automute(struct hda_codec *codec)
776 unsigned int present; 757 unsigned int present;
777 758
778 present = snd_hda_codec_read(codec, 0x1a, 0, AC_VERB_GET_PIN_SENSE, 0); 759 present = snd_hda_codec_read(codec, 0x1a, 0, AC_VERB_GET_PIN_SENSE, 0);
779 /* Lenovo N100 seems to report the reversed bit for HP jack-sensing */ 760 spec->jack_present = !!(present & 0x80000000);
780 spec->jack_present = !(present & 0x80000000); 761 if (spec->inv_jack_detect)
762 spec->jack_present = !spec->jack_present;
781 ad1986a_update_hp(codec); 763 ad1986a_update_hp(codec);
782} 764}
783 765
@@ -816,7 +798,7 @@ static int ad1986a_hp_master_sw_put(struct snd_kcontrol *kcontrol,
816 return change; 798 return change;
817} 799}
818 800
819static struct snd_kcontrol_new ad1986a_laptop_automute_mixers[] = { 801static struct snd_kcontrol_new ad1986a_automute_master_mixers[] = {
820 HDA_BIND_VOL("Master Playback Volume", &ad1986a_laptop_master_vol), 802 HDA_BIND_VOL("Master Playback Volume", &ad1986a_laptop_master_vol),
821 { 803 {
822 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 804 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
@@ -826,33 +808,10 @@ static struct snd_kcontrol_new ad1986a_laptop_automute_mixers[] = {
826 .put = ad1986a_hp_master_sw_put, 808 .put = ad1986a_hp_master_sw_put,
827 .private_value = HDA_COMPOSE_AMP_VAL(0x1a, 3, 0, HDA_OUTPUT), 809 .private_value = HDA_COMPOSE_AMP_VAL(0x1a, 3, 0, HDA_OUTPUT),
828 }, 810 },
829 HDA_CODEC_VOLUME("PCM Playback Volume", 0x03, 0x0, HDA_OUTPUT),
830 HDA_CODEC_MUTE("PCM Playback Switch", 0x03, 0x0, HDA_OUTPUT),
831 HDA_CODEC_VOLUME("Internal Mic Playback Volume", 0x17, 0x0, HDA_OUTPUT),
832 HDA_CODEC_MUTE("Internal Mic Playback Switch", 0x17, 0x0, HDA_OUTPUT),
833 HDA_CODEC_VOLUME("Mic Playback Volume", 0x13, 0x0, HDA_OUTPUT),
834 HDA_CODEC_MUTE("Mic Playback Switch", 0x13, 0x0, HDA_OUTPUT),
835 HDA_CODEC_VOLUME("Mic Boost", 0x0f, 0x0, HDA_OUTPUT),
836 HDA_CODEC_VOLUME("Capture Volume", 0x12, 0x0, HDA_OUTPUT),
837 HDA_CODEC_MUTE("Capture Switch", 0x12, 0x0, HDA_OUTPUT),
838 {
839 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
840 .name = "Capture Source",
841 .info = ad198x_mux_enum_info,
842 .get = ad198x_mux_enum_get,
843 .put = ad198x_mux_enum_put,
844 },
845 {
846 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
847 .name = "External Amplifier",
848 .info = ad198x_eapd_info,
849 .get = ad198x_eapd_get,
850 .put = ad198x_eapd_put,
851 .private_value = 0x1b | (1 << 8), /* port-D, inversed */
852 },
853 { } /* end */ 811 { } /* end */
854}; 812};
855 813
814
856/* 815/*
857 * initialization verbs 816 * initialization verbs
858 */ 817 */
@@ -981,6 +940,27 @@ static struct hda_verb ad1986a_hp_init_verbs[] = {
981 {} 940 {}
982}; 941};
983 942
943static void ad1986a_samsung_p50_unsol_event(struct hda_codec *codec,
944 unsigned int res)
945{
946 switch (res >> 26) {
947 case AD1986A_HP_EVENT:
948 ad1986a_hp_automute(codec);
949 break;
950 case AD1986A_MIC_EVENT:
951 ad1986a_automic(codec);
952 break;
953 }
954}
955
956static int ad1986a_samsung_p50_init(struct hda_codec *codec)
957{
958 ad198x_init(codec);
959 ad1986a_hp_automute(codec);
960 ad1986a_automic(codec);
961 return 0;
962}
963
984 964
985/* models */ 965/* models */
986enum { 966enum {
@@ -991,6 +971,7 @@ enum {
991 AD1986A_LAPTOP_AUTOMUTE, 971 AD1986A_LAPTOP_AUTOMUTE,
992 AD1986A_ULTRA, 972 AD1986A_ULTRA,
993 AD1986A_SAMSUNG, 973 AD1986A_SAMSUNG,
974 AD1986A_SAMSUNG_P50,
994 AD1986A_MODELS 975 AD1986A_MODELS
995}; 976};
996 977
@@ -1002,6 +983,7 @@ static const char *ad1986a_models[AD1986A_MODELS] = {
1002 [AD1986A_LAPTOP_AUTOMUTE] = "laptop-automute", 983 [AD1986A_LAPTOP_AUTOMUTE] = "laptop-automute",
1003 [AD1986A_ULTRA] = "ultra", 984 [AD1986A_ULTRA] = "ultra",
1004 [AD1986A_SAMSUNG] = "samsung", 985 [AD1986A_SAMSUNG] = "samsung",
986 [AD1986A_SAMSUNG_P50] = "samsung-p50",
1005}; 987};
1006 988
1007static struct snd_pci_quirk ad1986a_cfg_tbl[] = { 989static struct snd_pci_quirk ad1986a_cfg_tbl[] = {
@@ -1024,6 +1006,7 @@ static struct snd_pci_quirk ad1986a_cfg_tbl[] = {
1024 SND_PCI_QUIRK(0x1179, 0xff40, "Toshiba", AD1986A_LAPTOP_EAPD), 1006 SND_PCI_QUIRK(0x1179, 0xff40, "Toshiba", AD1986A_LAPTOP_EAPD),
1025 SND_PCI_QUIRK(0x144d, 0xb03c, "Samsung R55", AD1986A_3STACK), 1007 SND_PCI_QUIRK(0x144d, 0xb03c, "Samsung R55", AD1986A_3STACK),
1026 SND_PCI_QUIRK(0x144d, 0xc01e, "FSC V2060", AD1986A_LAPTOP), 1008 SND_PCI_QUIRK(0x144d, 0xc01e, "FSC V2060", AD1986A_LAPTOP),
1009 SND_PCI_QUIRK(0x144d, 0xc024, "Samsung P50", AD1986A_SAMSUNG_P50),
1027 SND_PCI_QUIRK(0x144d, 0xc027, "Samsung Q1", AD1986A_ULTRA), 1010 SND_PCI_QUIRK(0x144d, 0xc027, "Samsung Q1", AD1986A_ULTRA),
1028 SND_PCI_QUIRK_MASK(0x144d, 0xff00, 0xc000, "Samsung", AD1986A_SAMSUNG), 1011 SND_PCI_QUIRK_MASK(0x144d, 0xff00, 0xc000, "Samsung", AD1986A_SAMSUNG),
1029 SND_PCI_QUIRK(0x144d, 0xc504, "Samsung Q35", AD1986A_3STACK), 1012 SND_PCI_QUIRK(0x144d, 0xc504, "Samsung Q35", AD1986A_3STACK),
@@ -1111,7 +1094,10 @@ static int patch_ad1986a(struct hda_codec *codec)
1111 spec->multiout.dac_nids = ad1986a_laptop_dac_nids; 1094 spec->multiout.dac_nids = ad1986a_laptop_dac_nids;
1112 break; 1095 break;
1113 case AD1986A_LAPTOP_EAPD: 1096 case AD1986A_LAPTOP_EAPD:
1114 spec->mixers[0] = ad1986a_laptop_eapd_mixers; 1097 spec->num_mixers = 3;
1098 spec->mixers[0] = ad1986a_laptop_master_mixers;
1099 spec->mixers[1] = ad1986a_laptop_eapd_mixers;
1100 spec->mixers[2] = ad1986a_laptop_intmic_mixers;
1115 spec->num_init_verbs = 2; 1101 spec->num_init_verbs = 2;
1116 spec->init_verbs[1] = ad1986a_eapd_init_verbs; 1102 spec->init_verbs[1] = ad1986a_eapd_init_verbs;
1117 spec->multiout.max_channels = 2; 1103 spec->multiout.max_channels = 2;
@@ -1122,7 +1108,9 @@ static int patch_ad1986a(struct hda_codec *codec)
1122 spec->input_mux = &ad1986a_laptop_eapd_capture_source; 1108 spec->input_mux = &ad1986a_laptop_eapd_capture_source;
1123 break; 1109 break;
1124 case AD1986A_SAMSUNG: 1110 case AD1986A_SAMSUNG:
1125 spec->mixers[0] = ad1986a_samsung_mixers; 1111 spec->num_mixers = 2;
1112 spec->mixers[0] = ad1986a_laptop_master_mixers;
1113 spec->mixers[1] = ad1986a_laptop_eapd_mixers;
1126 spec->num_init_verbs = 3; 1114 spec->num_init_verbs = 3;
1127 spec->init_verbs[1] = ad1986a_eapd_init_verbs; 1115 spec->init_verbs[1] = ad1986a_eapd_init_verbs;
1128 spec->init_verbs[2] = ad1986a_automic_verbs; 1116 spec->init_verbs[2] = ad1986a_automic_verbs;
@@ -1135,8 +1123,28 @@ static int patch_ad1986a(struct hda_codec *codec)
1135 codec->patch_ops.unsol_event = ad1986a_automic_unsol_event; 1123 codec->patch_ops.unsol_event = ad1986a_automic_unsol_event;
1136 codec->patch_ops.init = ad1986a_automic_init; 1124 codec->patch_ops.init = ad1986a_automic_init;
1137 break; 1125 break;
1126 case AD1986A_SAMSUNG_P50:
1127 spec->num_mixers = 2;
1128 spec->mixers[0] = ad1986a_automute_master_mixers;
1129 spec->mixers[1] = ad1986a_laptop_eapd_mixers;
1130 spec->num_init_verbs = 4;
1131 spec->init_verbs[1] = ad1986a_eapd_init_verbs;
1132 spec->init_verbs[2] = ad1986a_automic_verbs;
1133 spec->init_verbs[3] = ad1986a_hp_init_verbs;
1134 spec->multiout.max_channels = 2;
1135 spec->multiout.num_dacs = 1;
1136 spec->multiout.dac_nids = ad1986a_laptop_dac_nids;
1137 if (!is_jack_available(codec, 0x25))
1138 spec->multiout.dig_out_nid = 0;
1139 spec->input_mux = &ad1986a_automic_capture_source;
1140 codec->patch_ops.unsol_event = ad1986a_samsung_p50_unsol_event;
1141 codec->patch_ops.init = ad1986a_samsung_p50_init;
1142 break;
1138 case AD1986A_LAPTOP_AUTOMUTE: 1143 case AD1986A_LAPTOP_AUTOMUTE:
1139 spec->mixers[0] = ad1986a_laptop_automute_mixers; 1144 spec->num_mixers = 3;
1145 spec->mixers[0] = ad1986a_automute_master_mixers;
1146 spec->mixers[1] = ad1986a_laptop_eapd_mixers;
1147 spec->mixers[2] = ad1986a_laptop_intmic_mixers;
1140 spec->num_init_verbs = 3; 1148 spec->num_init_verbs = 3;
1141 spec->init_verbs[1] = ad1986a_eapd_init_verbs; 1149 spec->init_verbs[1] = ad1986a_eapd_init_verbs;
1142 spec->init_verbs[2] = ad1986a_hp_init_verbs; 1150 spec->init_verbs[2] = ad1986a_hp_init_verbs;
@@ -1148,6 +1156,10 @@ static int patch_ad1986a(struct hda_codec *codec)
1148 spec->input_mux = &ad1986a_laptop_eapd_capture_source; 1156 spec->input_mux = &ad1986a_laptop_eapd_capture_source;
1149 codec->patch_ops.unsol_event = ad1986a_hp_unsol_event; 1157 codec->patch_ops.unsol_event = ad1986a_hp_unsol_event;
1150 codec->patch_ops.init = ad1986a_hp_init; 1158 codec->patch_ops.init = ad1986a_hp_init;
1159 /* Lenovo N100 seems to report the reversed bit
1160 * for HP jack-sensing
1161 */
1162 spec->inv_jack_detect = 1;
1151 break; 1163 break;
1152 case AD1986A_ULTRA: 1164 case AD1986A_ULTRA:
1153 spec->mixers[0] = ad1986a_laptop_eapd_mixers; 1165 spec->mixers[0] = ad1986a_laptop_eapd_mixers;
@@ -3734,9 +3746,30 @@ static struct snd_kcontrol_new ad1884a_laptop_mixers[] = {
3734 { } /* end */ 3746 { } /* end */
3735}; 3747};
3736 3748
3749static int ad1884a_mobile_master_sw_put(struct snd_kcontrol *kcontrol,
3750 struct snd_ctl_elem_value *ucontrol)
3751{
3752 struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
3753 int ret = snd_hda_mixer_amp_switch_put(kcontrol, ucontrol);
3754 int mute = (!ucontrol->value.integer.value[0] &&
3755 !ucontrol->value.integer.value[1]);
3756 /* toggle GPIO1 according to the mute state */
3757 snd_hda_codec_write_cache(codec, 0x01, 0, AC_VERB_SET_GPIO_DATA,
3758 mute ? 0x02 : 0x0);
3759 return ret;
3760}
3761
3737static struct snd_kcontrol_new ad1884a_mobile_mixers[] = { 3762static struct snd_kcontrol_new ad1884a_mobile_mixers[] = {
3738 HDA_CODEC_VOLUME("Master Playback Volume", 0x21, 0x0, HDA_OUTPUT), 3763 HDA_CODEC_VOLUME("Master Playback Volume", 0x21, 0x0, HDA_OUTPUT),
3739 HDA_CODEC_MUTE("Master Playback Switch", 0x21, 0x0, HDA_OUTPUT), 3764 /*HDA_CODEC_MUTE("Master Playback Switch", 0x21, 0x0, HDA_OUTPUT),*/
3765 {
3766 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
3767 .name = "Master Playback Switch",
3768 .info = snd_hda_mixer_amp_switch_info,
3769 .get = snd_hda_mixer_amp_switch_get,
3770 .put = ad1884a_mobile_master_sw_put,
3771 .private_value = HDA_COMPOSE_AMP_VAL(0x21, 3, 0, HDA_OUTPUT),
3772 },
3740 HDA_CODEC_VOLUME("PCM Playback Volume", 0x20, 0x5, HDA_INPUT), 3773 HDA_CODEC_VOLUME("PCM Playback Volume", 0x20, 0x5, HDA_INPUT),
3741 HDA_CODEC_MUTE("PCM Playback Switch", 0x20, 0x5, HDA_INPUT), 3774 HDA_CODEC_MUTE("PCM Playback Switch", 0x20, 0x5, HDA_INPUT),
3742 HDA_CODEC_VOLUME("Mic Capture Volume", 0x14, 0x0, HDA_INPUT), 3775 HDA_CODEC_VOLUME("Mic Capture Volume", 0x14, 0x0, HDA_INPUT),
@@ -3857,6 +3890,10 @@ static struct hda_verb ad1884a_mobile_verbs[] = {
3857 /* unsolicited event for pin-sense */ 3890 /* unsolicited event for pin-sense */
3858 {0x11, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | AD1884A_HP_EVENT}, 3891 {0x11, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | AD1884A_HP_EVENT},
3859 {0x14, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | AD1884A_MIC_EVENT}, 3892 {0x14, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | AD1884A_MIC_EVENT},
3893 /* allow to touch GPIO1 (for mute control) */
3894 {0x01, AC_VERB_SET_GPIO_MASK, 0x02},
3895 {0x01, AC_VERB_SET_GPIO_DIRECTION, 0x02},
3896 {0x01, AC_VERB_SET_GPIO_DATA, 0x02}, /* first muted */
3860 { } /* end */ 3897 { } /* end */
3861}; 3898};
3862 3899
@@ -3966,6 +4003,7 @@ static struct snd_pci_quirk ad1884a_cfg_tbl[] = {
3966 SND_PCI_QUIRK(0x103c, 0x3037, "HP 2230s", AD1884A_LAPTOP), 4003 SND_PCI_QUIRK(0x103c, 0x3037, "HP 2230s", AD1884A_LAPTOP),
3967 SND_PCI_QUIRK(0x103c, 0x3056, "HP", AD1884A_MOBILE), 4004 SND_PCI_QUIRK(0x103c, 0x3056, "HP", AD1884A_MOBILE),
3968 SND_PCI_QUIRK_MASK(0x103c, 0xfff0, 0x3070, "HP", AD1884A_MOBILE), 4005 SND_PCI_QUIRK_MASK(0x103c, 0xfff0, 0x3070, "HP", AD1884A_MOBILE),
4006 SND_PCI_QUIRK_MASK(0x103c, 0xfff0, 0x30d0, "HP laptop", AD1884A_LAPTOP),
3969 SND_PCI_QUIRK_MASK(0x103c, 0xfff0, 0x30e0, "HP laptop", AD1884A_LAPTOP), 4007 SND_PCI_QUIRK_MASK(0x103c, 0xfff0, 0x30e0, "HP laptop", AD1884A_LAPTOP),
3970 SND_PCI_QUIRK_MASK(0x103c, 0xff00, 0x3600, "HP laptop", AD1884A_LAPTOP), 4008 SND_PCI_QUIRK_MASK(0x103c, 0xff00, 0x3600, "HP laptop", AD1884A_LAPTOP),
3971 SND_PCI_QUIRK(0x17aa, 0x20ac, "Thinkpad X300", AD1884A_THINKPAD), 4009 SND_PCI_QUIRK(0x17aa, 0x20ac, "Thinkpad X300", AD1884A_THINKPAD),
diff --git a/sound/pci/hda/patch_ca0110.c b/sound/pci/hda/patch_ca0110.c
index 392d108c3558..019ca7cb56d7 100644
--- a/sound/pci/hda/patch_ca0110.c
+++ b/sound/pci/hda/patch_ca0110.c
@@ -510,7 +510,7 @@ static int ca0110_parse_auto_config(struct hda_codec *codec)
510} 510}
511 511
512 512
513int patch_ca0110(struct hda_codec *codec) 513static int patch_ca0110(struct hda_codec *codec)
514{ 514{
515 struct ca0110_spec *spec; 515 struct ca0110_spec *spec;
516 int err; 516 int err;
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index 334533197425..51c44fdbc0f0 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -275,13 +275,13 @@ struct alc_spec {
275 */ 275 */
276 unsigned int num_init_verbs; 276 unsigned int num_init_verbs;
277 277
278 char stream_name_analog[16]; /* analog PCM stream */ 278 char stream_name_analog[32]; /* analog PCM stream */
279 struct hda_pcm_stream *stream_analog_playback; 279 struct hda_pcm_stream *stream_analog_playback;
280 struct hda_pcm_stream *stream_analog_capture; 280 struct hda_pcm_stream *stream_analog_capture;
281 struct hda_pcm_stream *stream_analog_alt_playback; 281 struct hda_pcm_stream *stream_analog_alt_playback;
282 struct hda_pcm_stream *stream_analog_alt_capture; 282 struct hda_pcm_stream *stream_analog_alt_capture;
283 283
284 char stream_name_digital[16]; /* digital PCM stream */ 284 char stream_name_digital[32]; /* digital PCM stream */
285 struct hda_pcm_stream *stream_digital_playback; 285 struct hda_pcm_stream *stream_digital_playback;
286 struct hda_pcm_stream *stream_digital_capture; 286 struct hda_pcm_stream *stream_digital_capture;
287 287
@@ -559,7 +559,7 @@ static int alc_pin_mode_get(struct snd_kcontrol *kcontrol,
559 559
560 /* Find enumerated value for current pinctl setting */ 560 /* Find enumerated value for current pinctl setting */
561 i = alc_pin_mode_min(dir); 561 i = alc_pin_mode_min(dir);
562 while (alc_pin_mode_values[i] != pinctl && i <= alc_pin_mode_max(dir)) 562 while (i <= alc_pin_mode_max(dir) && alc_pin_mode_values[i] != pinctl)
563 i++; 563 i++;
564 *valp = i <= alc_pin_mode_max(dir) ? i: alc_pin_mode_min(dir); 564 *valp = i <= alc_pin_mode_max(dir) ? i: alc_pin_mode_min(dir);
565 return 0; 565 return 0;
@@ -945,12 +945,13 @@ static void alc_fix_pll_init(struct hda_codec *codec, hda_nid_t nid,
945static void alc_automute_pin(struct hda_codec *codec) 945static void alc_automute_pin(struct hda_codec *codec)
946{ 946{
947 struct alc_spec *spec = codec->spec; 947 struct alc_spec *spec = codec->spec;
948 unsigned int present; 948 unsigned int present, pincap;
949 unsigned int nid = spec->autocfg.hp_pins[0]; 949 unsigned int nid = spec->autocfg.hp_pins[0];
950 int i; 950 int i;
951 951
952 /* need to execute and sync at first */ 952 pincap = snd_hda_query_pin_caps(codec, nid);
953 snd_hda_codec_read(codec, nid, 0, AC_VERB_SET_PIN_SENSE, 0); 953 if (pincap & AC_PINCAP_TRIG_REQ) /* need trigger? */
954 snd_hda_codec_read(codec, nid, 0, AC_VERB_SET_PIN_SENSE, 0);
954 present = snd_hda_codec_read(codec, nid, 0, 955 present = snd_hda_codec_read(codec, nid, 0,
955 AC_VERB_GET_PIN_SENSE, 0); 956 AC_VERB_GET_PIN_SENSE, 0);
956 spec->jack_present = (present & AC_PINSENSE_PRESENCE) != 0; 957 spec->jack_present = (present & AC_PINSENSE_PRESENCE) != 0;
@@ -1392,7 +1393,7 @@ static struct hda_verb alc888_fujitsu_xa3530_verbs[] = {
1392static void alc_automute_amp(struct hda_codec *codec) 1393static void alc_automute_amp(struct hda_codec *codec)
1393{ 1394{
1394 struct alc_spec *spec = codec->spec; 1395 struct alc_spec *spec = codec->spec;
1395 unsigned int val, mute; 1396 unsigned int val, mute, pincap;
1396 hda_nid_t nid; 1397 hda_nid_t nid;
1397 int i; 1398 int i;
1398 1399
@@ -1401,6 +1402,10 @@ static void alc_automute_amp(struct hda_codec *codec)
1401 nid = spec->autocfg.hp_pins[i]; 1402 nid = spec->autocfg.hp_pins[i];
1402 if (!nid) 1403 if (!nid)
1403 break; 1404 break;
1405 pincap = snd_hda_query_pin_caps(codec, nid);
1406 if (pincap & AC_PINCAP_TRIG_REQ) /* need trigger? */
1407 snd_hda_codec_read(codec, nid, 0,
1408 AC_VERB_SET_PIN_SENSE, 0);
1404 val = snd_hda_codec_read(codec, nid, 0, 1409 val = snd_hda_codec_read(codec, nid, 0,
1405 AC_VERB_GET_PIN_SENSE, 0); 1410 AC_VERB_GET_PIN_SENSE, 0);
1406 if (val & AC_PINSENSE_PRESENCE) { 1411 if (val & AC_PINSENSE_PRESENCE) {
@@ -1471,6 +1476,10 @@ static struct hda_verb alc888_acer_aspire_4930g_verbs[] = {
1471static struct hda_verb alc888_acer_aspire_6530g_verbs[] = { 1476static struct hda_verb alc888_acer_aspire_6530g_verbs[] = {
1472/* Bias voltage on for external mic port */ 1477/* Bias voltage on for external mic port */
1473 {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN | PIN_VREF80}, 1478 {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN | PIN_VREF80},
1479/* Front Mic: set to PIN_IN (empty by default) */
1480 {0x12, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
1481/* Unselect Front Mic by default in input mixer 3 */
1482 {0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0xb)},
1474/* Enable unsolicited event for HP jack */ 1483/* Enable unsolicited event for HP jack */
1475 {0x15, AC_VERB_SET_UNSOLICITED_ENABLE, ALC880_HP_EVENT | AC_USRSP_EN}, 1484 {0x15, AC_VERB_SET_UNSOLICITED_ENABLE, ALC880_HP_EVENT | AC_USRSP_EN},
1476/* Enable speaker output */ 1485/* Enable speaker output */
@@ -1560,18 +1569,22 @@ static struct hda_input_mux alc888_2_capture_sources[2] = {
1560static struct hda_input_mux alc888_acer_aspire_6530_sources[2] = { 1569static struct hda_input_mux alc888_acer_aspire_6530_sources[2] = {
1561 /* Interal mic only available on one ADC */ 1570 /* Interal mic only available on one ADC */
1562 { 1571 {
1563 .num_items = 3, 1572 .num_items = 5,
1564 .items = { 1573 .items = {
1565 { "Ext Mic", 0x0 }, 1574 { "Ext Mic", 0x0 },
1575 { "Line In", 0x2 },
1566 { "CD", 0x4 }, 1576 { "CD", 0x4 },
1577 { "Input Mix", 0xa },
1567 { "Int Mic", 0xb }, 1578 { "Int Mic", 0xb },
1568 }, 1579 },
1569 }, 1580 },
1570 { 1581 {
1571 .num_items = 2, 1582 .num_items = 4,
1572 .items = { 1583 .items = {
1573 { "Ext Mic", 0x0 }, 1584 { "Ext Mic", 0x0 },
1585 { "Line In", 0x2 },
1574 { "CD", 0x4 }, 1586 { "CD", 0x4 },
1587 { "Input Mix", 0xa },
1575 }, 1588 },
1576 } 1589 }
1577}; 1590};
@@ -1639,6 +1652,17 @@ static void alc888_acer_aspire_4930g_init_hook(struct hda_codec *codec)
1639 alc_automute_amp(codec); 1652 alc_automute_amp(codec);
1640} 1653}
1641 1654
1655static void alc888_acer_aspire_6530g_init_hook(struct hda_codec *codec)
1656{
1657 struct alc_spec *spec = codec->spec;
1658
1659 spec->autocfg.hp_pins[0] = 0x15;
1660 spec->autocfg.speaker_pins[0] = 0x14;
1661 spec->autocfg.speaker_pins[1] = 0x16;
1662 spec->autocfg.speaker_pins[2] = 0x17;
1663 alc_automute_amp(codec);
1664}
1665
1642static void alc889_acer_aspire_8930g_init_hook(struct hda_codec *codec) 1666static void alc889_acer_aspire_8930g_init_hook(struct hda_codec *codec)
1643{ 1667{
1644 struct alc_spec *spec = codec->spec; 1668 struct alc_spec *spec = codec->spec;
@@ -4481,6 +4505,12 @@ static int alc880_parse_auto_config(struct hda_codec *codec)
4481 &dig_nid, 1); 4505 &dig_nid, 1);
4482 if (err < 0) 4506 if (err < 0)
4483 continue; 4507 continue;
4508 if (dig_nid > 0x7f) {
4509 printk(KERN_ERR "alc880_auto: invalid dig_nid "
4510 "connection 0x%x for NID 0x%x\n", dig_nid,
4511 spec->autocfg.dig_out_pins[i]);
4512 continue;
4513 }
4484 if (!i) 4514 if (!i)
4485 spec->multiout.dig_out_nid = dig_nid; 4515 spec->multiout.dig_out_nid = dig_nid;
4486 else { 4516 else {
@@ -6895,9 +6925,6 @@ static struct hda_verb alc882_targa_verbs[] = {
6895 {0x1b, AC_VERB_SET_CONNECT_SEL, 0x00}, /* HP */ 6925 {0x1b, AC_VERB_SET_CONNECT_SEL, 0x00}, /* HP */
6896 6926
6897 {0x14, AC_VERB_SET_UNSOLICITED_ENABLE, ALC880_HP_EVENT | AC_USRSP_EN}, 6927 {0x14, AC_VERB_SET_UNSOLICITED_ENABLE, ALC880_HP_EVENT | AC_USRSP_EN},
6898 {0x01, AC_VERB_SET_GPIO_MASK, 0x03},
6899 {0x01, AC_VERB_SET_GPIO_DIRECTION, 0x03},
6900 {0x01, AC_VERB_SET_GPIO_DATA, 0x03},
6901 { } /* end */ 6928 { } /* end */
6902}; 6929};
6903 6930
@@ -7217,7 +7244,8 @@ static struct alc_config_preset alc882_presets[] = {
7217 }, 7244 },
7218 [ALC882_TARGA] = { 7245 [ALC882_TARGA] = {
7219 .mixers = { alc882_targa_mixer, alc882_chmode_mixer }, 7246 .mixers = { alc882_targa_mixer, alc882_chmode_mixer },
7220 .init_verbs = { alc882_init_verbs, alc882_targa_verbs}, 7247 .init_verbs = { alc882_init_verbs, alc880_gpio3_init_verbs,
7248 alc882_targa_verbs},
7221 .num_dacs = ARRAY_SIZE(alc882_dac_nids), 7249 .num_dacs = ARRAY_SIZE(alc882_dac_nids),
7222 .dac_nids = alc882_dac_nids, 7250 .dac_nids = alc882_dac_nids,
7223 .dig_out_nid = ALC882_DIGOUT_NID, 7251 .dig_out_nid = ALC882_DIGOUT_NID,
@@ -8189,6 +8217,8 @@ static struct snd_kcontrol_new alc888_acer_aspire_6530_mixer[] = {
8189 HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT), 8217 HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT),
8190 HDA_CODEC_VOLUME("LFE Playback Volume", 0x0f, 0x0, HDA_OUTPUT), 8218 HDA_CODEC_VOLUME("LFE Playback Volume", 0x0f, 0x0, HDA_OUTPUT),
8191 HDA_BIND_MUTE("LFE Playback Switch", 0x0f, 2, HDA_INPUT), 8219 HDA_BIND_MUTE("LFE Playback Switch", 0x0f, 2, HDA_INPUT),
8220 HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT),
8221 HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT),
8192 HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT), 8222 HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT),
8193 HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT), 8223 HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT),
8194 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT), 8224 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT),
@@ -9064,7 +9094,7 @@ static struct snd_pci_quirk alc883_cfg_tbl[] = {
9064 SND_PCI_QUIRK(0x1025, 0x0157, "Acer X3200", ALC883_AUTO), 9094 SND_PCI_QUIRK(0x1025, 0x0157, "Acer X3200", ALC883_AUTO),
9065 SND_PCI_QUIRK(0x1025, 0x0158, "Acer AX1700-U3700A", ALC883_AUTO), 9095 SND_PCI_QUIRK(0x1025, 0x0158, "Acer AX1700-U3700A", ALC883_AUTO),
9066 SND_PCI_QUIRK(0x1025, 0x015e, "Acer Aspire 6930G", 9096 SND_PCI_QUIRK(0x1025, 0x015e, "Acer Aspire 6930G",
9067 ALC888_ACER_ASPIRE_4930G), 9097 ALC888_ACER_ASPIRE_6530G),
9068 SND_PCI_QUIRK(0x1025, 0x0166, "Acer Aspire 6530G", 9098 SND_PCI_QUIRK(0x1025, 0x0166, "Acer Aspire 6530G",
9069 ALC888_ACER_ASPIRE_6530G), 9099 ALC888_ACER_ASPIRE_6530G),
9070 /* default Acer -- disabled as it causes more problems. 9100 /* default Acer -- disabled as it causes more problems.
@@ -9212,7 +9242,8 @@ static struct alc_config_preset alc883_presets[] = {
9212 }, 9242 },
9213 [ALC883_TARGA_DIG] = { 9243 [ALC883_TARGA_DIG] = {
9214 .mixers = { alc883_targa_mixer, alc883_chmode_mixer }, 9244 .mixers = { alc883_targa_mixer, alc883_chmode_mixer },
9215 .init_verbs = { alc883_init_verbs, alc883_targa_verbs}, 9245 .init_verbs = { alc883_init_verbs, alc880_gpio3_init_verbs,
9246 alc883_targa_verbs},
9216 .num_dacs = ARRAY_SIZE(alc883_dac_nids), 9247 .num_dacs = ARRAY_SIZE(alc883_dac_nids),
9217 .dac_nids = alc883_dac_nids, 9248 .dac_nids = alc883_dac_nids,
9218 .dig_out_nid = ALC883_DIGOUT_NID, 9249 .dig_out_nid = ALC883_DIGOUT_NID,
@@ -9225,7 +9256,8 @@ static struct alc_config_preset alc883_presets[] = {
9225 }, 9256 },
9226 [ALC883_TARGA_2ch_DIG] = { 9257 [ALC883_TARGA_2ch_DIG] = {
9227 .mixers = { alc883_targa_2ch_mixer}, 9258 .mixers = { alc883_targa_2ch_mixer},
9228 .init_verbs = { alc883_init_verbs, alc883_targa_verbs}, 9259 .init_verbs = { alc883_init_verbs, alc880_gpio3_init_verbs,
9260 alc883_targa_verbs},
9229 .num_dacs = ARRAY_SIZE(alc883_dac_nids), 9261 .num_dacs = ARRAY_SIZE(alc883_dac_nids),
9230 .dac_nids = alc883_dac_nids, 9262 .dac_nids = alc883_dac_nids,
9231 .adc_nids = alc883_adc_nids_alt, 9263 .adc_nids = alc883_adc_nids_alt,
@@ -9317,7 +9349,7 @@ static struct alc_config_preset alc883_presets[] = {
9317 ARRAY_SIZE(alc888_2_capture_sources), 9349 ARRAY_SIZE(alc888_2_capture_sources),
9318 .input_mux = alc888_acer_aspire_6530_sources, 9350 .input_mux = alc888_acer_aspire_6530_sources,
9319 .unsol_event = alc_automute_amp_unsol_event, 9351 .unsol_event = alc_automute_amp_unsol_event,
9320 .init_hook = alc888_acer_aspire_4930g_init_hook, 9352 .init_hook = alc888_acer_aspire_6530g_init_hook,
9321 }, 9353 },
9322 [ALC888_ACER_ASPIRE_8930G] = { 9354 [ALC888_ACER_ASPIRE_8930G] = {
9323 .mixers = { alc888_base_mixer, 9355 .mixers = { alc888_base_mixer,
@@ -10599,6 +10631,18 @@ static void alc262_lenovo_3000_unsol_event(struct hda_codec *codec,
10599 alc262_lenovo_3000_automute(codec, 1); 10631 alc262_lenovo_3000_automute(codec, 1);
10600} 10632}
10601 10633
10634static int amp_stereo_mute_update(struct hda_codec *codec, hda_nid_t nid,
10635 int dir, int idx, long *valp)
10636{
10637 int i, change = 0;
10638
10639 for (i = 0; i < 2; i++, valp++)
10640 change |= snd_hda_codec_amp_update(codec, nid, i, dir, idx,
10641 HDA_AMP_MUTE,
10642 *valp ? 0 : HDA_AMP_MUTE);
10643 return change;
10644}
10645
10602/* bind hp and internal speaker mute (with plug check) */ 10646/* bind hp and internal speaker mute (with plug check) */
10603static int alc262_fujitsu_master_sw_put(struct snd_kcontrol *kcontrol, 10647static int alc262_fujitsu_master_sw_put(struct snd_kcontrol *kcontrol,
10604 struct snd_ctl_elem_value *ucontrol) 10648 struct snd_ctl_elem_value *ucontrol)
@@ -10607,13 +10651,8 @@ static int alc262_fujitsu_master_sw_put(struct snd_kcontrol *kcontrol,
10607 long *valp = ucontrol->value.integer.value; 10651 long *valp = ucontrol->value.integer.value;
10608 int change; 10652 int change;
10609 10653
10610 change = snd_hda_codec_amp_stereo(codec, 0x14, HDA_OUTPUT, 0, 10654 change = amp_stereo_mute_update(codec, 0x14, HDA_OUTPUT, 0, valp);
10611 HDA_AMP_MUTE, 10655 change |= amp_stereo_mute_update(codec, 0x1b, HDA_OUTPUT, 0, valp);
10612 valp ? 0 : HDA_AMP_MUTE);
10613 change |= snd_hda_codec_amp_stereo(codec, 0x1b, HDA_OUTPUT, 0,
10614 HDA_AMP_MUTE,
10615 valp ? 0 : HDA_AMP_MUTE);
10616
10617 if (change) 10656 if (change)
10618 alc262_fujitsu_automute(codec, 0); 10657 alc262_fujitsu_automute(codec, 0);
10619 return change; 10658 return change;
@@ -10648,10 +10687,7 @@ static int alc262_lenovo_3000_master_sw_put(struct snd_kcontrol *kcontrol,
10648 long *valp = ucontrol->value.integer.value; 10687 long *valp = ucontrol->value.integer.value;
10649 int change; 10688 int change;
10650 10689
10651 change = snd_hda_codec_amp_stereo(codec, 0x1b, HDA_OUTPUT, 0, 10690 change = amp_stereo_mute_update(codec, 0x1b, HDA_OUTPUT, 0, valp);
10652 HDA_AMP_MUTE,
10653 valp ? 0 : HDA_AMP_MUTE);
10654
10655 if (change) 10691 if (change)
10656 alc262_lenovo_3000_automute(codec, 0); 10692 alc262_lenovo_3000_automute(codec, 0);
10657 return change; 10693 return change;
@@ -11822,12 +11858,7 @@ static int alc268_acer_master_sw_put(struct snd_kcontrol *kcontrol,
11822 long *valp = ucontrol->value.integer.value; 11858 long *valp = ucontrol->value.integer.value;
11823 int change; 11859 int change;
11824 11860
11825 change = snd_hda_codec_amp_update(codec, 0x14, 0, HDA_OUTPUT, 0, 11861 change = amp_stereo_mute_update(codec, 0x14, HDA_OUTPUT, 0, valp);
11826 HDA_AMP_MUTE,
11827 valp[0] ? 0 : HDA_AMP_MUTE);
11828 change |= snd_hda_codec_amp_update(codec, 0x14, 1, HDA_OUTPUT, 0,
11829 HDA_AMP_MUTE,
11830 valp[1] ? 0 : HDA_AMP_MUTE);
11831 if (change) 11862 if (change)
11832 alc268_acer_automute(codec, 0); 11863 alc268_acer_automute(codec, 0);
11833 return change; 11864 return change;
@@ -12437,6 +12468,8 @@ static int alc268_parse_auto_config(struct hda_codec *codec)
12437 if (err < 0) 12468 if (err < 0)
12438 return err; 12469 return err;
12439 12470
12471 alc_ssid_check(codec, 0x15, 0x1b, 0x14);
12472
12440 return 1; 12473 return 1;
12441} 12474}
12442 12475
@@ -12848,20 +12881,11 @@ static struct snd_kcontrol_new alc269_lifebook_mixer[] = {
12848 { } 12881 { }
12849}; 12882};
12850 12883
12851/* bind volumes of both NID 0x0c and 0x0d */
12852static struct hda_bind_ctls alc269_epc_bind_vol = {
12853 .ops = &snd_hda_bind_vol,
12854 .values = {
12855 HDA_COMPOSE_AMP_VAL(0x02, 3, 0, HDA_OUTPUT),
12856 HDA_COMPOSE_AMP_VAL(0x03, 3, 0, HDA_OUTPUT),
12857 0
12858 },
12859};
12860
12861static struct snd_kcontrol_new alc269_eeepc_mixer[] = { 12884static struct snd_kcontrol_new alc269_eeepc_mixer[] = {
12862 HDA_CODEC_MUTE("iSpeaker Playback Switch", 0x14, 0x0, HDA_OUTPUT), 12885 HDA_CODEC_MUTE("Speaker Playback Switch", 0x14, 0x0, HDA_OUTPUT),
12863 HDA_BIND_VOL("LineOut Playback Volume", &alc269_epc_bind_vol), 12886 HDA_CODEC_VOLUME("Speaker Playback Volume", 0x02, 0x0, HDA_OUTPUT),
12864 HDA_CODEC_MUTE("LineOut Playback Switch", 0x15, 0x0, HDA_OUTPUT), 12887 HDA_CODEC_MUTE("Headphone Playback Switch", 0x15, 0x0, HDA_OUTPUT),
12888 HDA_CODEC_VOLUME("Headphone Playback Volume", 0x03, 0x0, HDA_OUTPUT),
12865 { } /* end */ 12889 { } /* end */
12866}; 12890};
12867 12891
@@ -12874,12 +12898,7 @@ static struct snd_kcontrol_new alc269_epc_capture_mixer[] = {
12874}; 12898};
12875 12899
12876/* FSC amilo */ 12900/* FSC amilo */
12877static struct snd_kcontrol_new alc269_fujitsu_mixer[] = { 12901#define alc269_fujitsu_mixer alc269_eeepc_mixer
12878 HDA_CODEC_MUTE("Speaker Playback Switch", 0x14, 0x0, HDA_OUTPUT),
12879 HDA_CODEC_MUTE("Headphone Playback Switch", 0x15, 0x0, HDA_OUTPUT),
12880 HDA_BIND_VOL("PCM Playback Volume", &alc269_epc_bind_vol),
12881 { } /* end */
12882};
12883 12902
12884static struct hda_verb alc269_quanta_fl1_verbs[] = { 12903static struct hda_verb alc269_quanta_fl1_verbs[] = {
12885 {0x15, AC_VERB_SET_CONNECT_SEL, 0x01}, 12904 {0x15, AC_VERB_SET_CONNECT_SEL, 0x01},
@@ -13345,6 +13364,8 @@ static int alc269_parse_auto_config(struct hda_codec *codec)
13345 if (!spec->cap_mixer && !spec->no_analog) 13364 if (!spec->cap_mixer && !spec->no_analog)
13346 set_capture_mixer(spec); 13365 set_capture_mixer(spec);
13347 13366
13367 alc_ssid_check(codec, 0x15, 0x1b, 0x14);
13368
13348 return 1; 13369 return 1;
13349} 13370}
13350 13371
@@ -15136,7 +15157,7 @@ static struct snd_pci_quirk alc861vd_cfg_tbl[] = {
15136 SND_PCI_QUIRK(0x10de, 0x03f0, "Realtek ALC660 demo", ALC660VD_3ST), 15157 SND_PCI_QUIRK(0x10de, 0x03f0, "Realtek ALC660 demo", ALC660VD_3ST),
15137 SND_PCI_QUIRK(0x1179, 0xff00, "Toshiba A135", ALC861VD_LENOVO), 15158 SND_PCI_QUIRK(0x1179, 0xff00, "Toshiba A135", ALC861VD_LENOVO),
15138 /*SND_PCI_QUIRK(0x1179, 0xff00, "DALLAS", ALC861VD_DALLAS),*/ /*lenovo*/ 15159 /*SND_PCI_QUIRK(0x1179, 0xff00, "DALLAS", ALC861VD_DALLAS),*/ /*lenovo*/
15139 SND_PCI_QUIRK(0x1179, 0xff01, "DALLAS", ALC861VD_DALLAS), 15160 SND_PCI_QUIRK(0x1179, 0xff01, "Toshiba A135", ALC861VD_LENOVO),
15140 SND_PCI_QUIRK(0x1179, 0xff03, "Toshiba P205", ALC861VD_LENOVO), 15161 SND_PCI_QUIRK(0x1179, 0xff03, "Toshiba P205", ALC861VD_LENOVO),
15141 SND_PCI_QUIRK(0x1179, 0xff31, "Toshiba L30-149", ALC861VD_DALLAS), 15162 SND_PCI_QUIRK(0x1179, 0xff31, "Toshiba L30-149", ALC861VD_DALLAS),
15142 SND_PCI_QUIRK(0x1565, 0x820d, "Biostar NF61S SE", ALC861VD_6ST_DIG), 15163 SND_PCI_QUIRK(0x1565, 0x820d, "Biostar NF61S SE", ALC861VD_6ST_DIG),
diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c
index 14f3c3e0f62d..456ef6ac12e4 100644
--- a/sound/pci/hda/patch_sigmatel.c
+++ b/sound/pci/hda/patch_sigmatel.c
@@ -1590,8 +1590,6 @@ static struct snd_pci_quirk stac9200_cfg_tbl[] = {
1590 /* SigmaTel reference board */ 1590 /* SigmaTel reference board */
1591 SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2668, 1591 SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2668,
1592 "DFI LanParty", STAC_REF), 1592 "DFI LanParty", STAC_REF),
1593 SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0xfb30,
1594 "SigmaTel",STAC_9205_REF),
1595 SND_PCI_QUIRK(PCI_VENDOR_ID_DFI, 0x3101, 1593 SND_PCI_QUIRK(PCI_VENDOR_ID_DFI, 0x3101,
1596 "DFI LanParty", STAC_REF), 1594 "DFI LanParty", STAC_REF),
1597 /* Dell laptops have BIOS problem */ 1595 /* Dell laptops have BIOS problem */
@@ -1811,6 +1809,8 @@ static struct snd_pci_quirk stac92hd73xx_cfg_tbl[] = {
1811 "Dell Studio 1537", STAC_DELL_M6_DMIC), 1809 "Dell Studio 1537", STAC_DELL_M6_DMIC),
1812 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x02a0, 1810 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x02a0,
1813 "Dell Studio 17", STAC_DELL_M6_DMIC), 1811 "Dell Studio 17", STAC_DELL_M6_DMIC),
1812 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x02be,
1813 "Dell Studio 1555", STAC_DELL_M6_DMIC),
1814 {} /* terminator */ 1814 {} /* terminator */
1815}; 1815};
1816 1816
@@ -2266,7 +2266,7 @@ static struct snd_pci_quirk stac927x_cfg_tbl[] = {
2266 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01f3, "Dell Inspiron 1420", STAC_DELL_BIOS), 2266 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01f3, "Dell Inspiron 1420", STAC_DELL_BIOS),
2267 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0227, "Dell Vostro 1400 ", STAC_DELL_BIOS), 2267 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0227, "Dell Vostro 1400 ", STAC_DELL_BIOS),
2268 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x022e, "Dell ", STAC_DELL_BIOS), 2268 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x022e, "Dell ", STAC_DELL_BIOS),
2269 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x022f, "Dell Inspiron 1525", STAC_DELL_3ST), 2269 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x022f, "Dell Inspiron 1525", STAC_DELL_BIOS),
2270 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0242, "Dell ", STAC_DELL_BIOS), 2270 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0242, "Dell ", STAC_DELL_BIOS),
2271 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0243, "Dell ", STAC_DELL_BIOS), 2271 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0243, "Dell ", STAC_DELL_BIOS),
2272 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x02ff, "Dell ", STAC_DELL_BIOS), 2272 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x02ff, "Dell ", STAC_DELL_BIOS),
@@ -2344,6 +2344,8 @@ static struct snd_pci_quirk stac9205_cfg_tbl[] = {
2344 /* SigmaTel reference board */ 2344 /* SigmaTel reference board */
2345 SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2668, 2345 SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2668,
2346 "DFI LanParty", STAC_9205_REF), 2346 "DFI LanParty", STAC_9205_REF),
2347 SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0xfb30,
2348 "SigmaTel", STAC_9205_REF),
2347 SND_PCI_QUIRK(PCI_VENDOR_ID_DFI, 0x3101, 2349 SND_PCI_QUIRK(PCI_VENDOR_ID_DFI, 0x3101,
2348 "DFI LanParty", STAC_9205_REF), 2350 "DFI LanParty", STAC_9205_REF),
2349 /* Dell */ 2351 /* Dell */
@@ -2378,6 +2380,7 @@ static struct snd_pci_quirk stac9205_cfg_tbl[] = {
2378 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0228, 2380 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0228,
2379 "Dell Vostro 1500", STAC_9205_DELL_M42), 2381 "Dell Vostro 1500", STAC_9205_DELL_M42),
2380 /* Gateway */ 2382 /* Gateway */
2383 SND_PCI_QUIRK(0x107b, 0x0560, "Gateway T6834c", STAC_9205_EAPD),
2381 SND_PCI_QUIRK(0x107b, 0x0565, "Gateway T1616", STAC_9205_EAPD), 2384 SND_PCI_QUIRK(0x107b, 0x0565, "Gateway T1616", STAC_9205_EAPD),
2382 {} /* terminator */ 2385 {} /* terminator */
2383}; 2386};
@@ -4065,7 +4068,7 @@ static int stac92xx_add_jack(struct hda_codec *codec,
4065 jack->nid = nid; 4068 jack->nid = nid;
4066 jack->type = type; 4069 jack->type = type;
4067 4070
4068 sprintf(name, "%s at %s %s Jack", 4071 snprintf(name, sizeof(name), "%s at %s %s Jack",
4069 snd_hda_get_jack_type(def_conf), 4072 snd_hda_get_jack_type(def_conf),
4070 snd_hda_get_jack_connectivity(def_conf), 4073 snd_hda_get_jack_connectivity(def_conf),
4071 snd_hda_get_jack_location(def_conf)); 4074 snd_hda_get_jack_location(def_conf));
@@ -5642,6 +5645,13 @@ static int patch_stac927x(struct hda_codec *codec)
5642 /* GPIO2 High = Enable EAPD */ 5645 /* GPIO2 High = Enable EAPD */
5643 spec->eapd_mask = spec->gpio_mask = spec->gpio_dir = 0x04; 5646 spec->eapd_mask = spec->gpio_mask = spec->gpio_dir = 0x04;
5644 spec->gpio_data = 0x04; 5647 spec->gpio_data = 0x04;
5648 switch (codec->subsystem_id) {
5649 case 0x1028022f:
5650 /* correct EAPD to be GPIO0 */
5651 spec->eapd_mask = spec->gpio_mask = 0x01;
5652 spec->gpio_dir = spec->gpio_data = 0x01;
5653 break;
5654 };
5645 spec->dmic_nids = stac927x_dmic_nids; 5655 spec->dmic_nids = stac927x_dmic_nids;
5646 spec->num_dmics = STAC927X_NUM_DMICS; 5656 spec->num_dmics = STAC927X_NUM_DMICS;
5647 5657
@@ -5854,6 +5864,8 @@ static unsigned int *stac9872_brd_tbl[STAC_9872_MODELS] = {
5854}; 5864};
5855 5865
5856static struct snd_pci_quirk stac9872_cfg_tbl[] = { 5866static struct snd_pci_quirk stac9872_cfg_tbl[] = {
5867 SND_PCI_QUIRK_MASK(0x104d, 0xfff0, 0x81e0,
5868 "Sony VAIO F/S", STAC_9872_VAIO),
5857 {} /* terminator */ 5869 {} /* terminator */
5858}; 5870};
5859 5871
@@ -5866,6 +5878,8 @@ static int patch_stac9872(struct hda_codec *codec)
5866 if (spec == NULL) 5878 if (spec == NULL)
5867 return -ENOMEM; 5879 return -ENOMEM;
5868 codec->spec = spec; 5880 codec->spec = spec;
5881 spec->num_pins = ARRAY_SIZE(stac9872_pin_nids);
5882 spec->pin_nids = stac9872_pin_nids;
5869 5883
5870 spec->board_config = snd_hda_check_board_config(codec, STAC_9872_MODELS, 5884 spec->board_config = snd_hda_check_board_config(codec, STAC_9872_MODELS,
5871 stac9872_models, 5885 stac9872_models,
@@ -5877,8 +5891,6 @@ static int patch_stac9872(struct hda_codec *codec)
5877 stac92xx_set_config_regs(codec, 5891 stac92xx_set_config_regs(codec,
5878 stac9872_brd_tbl[spec->board_config]); 5892 stac9872_brd_tbl[spec->board_config]);
5879 5893
5880 spec->num_pins = ARRAY_SIZE(stac9872_pin_nids);
5881 spec->pin_nids = stac9872_pin_nids;
5882 spec->multiout.dac_nids = spec->dac_nids; 5894 spec->multiout.dac_nids = spec->dac_nids;
5883 spec->num_adcs = ARRAY_SIZE(stac9872_adc_nids); 5895 spec->num_adcs = ARRAY_SIZE(stac9872_adc_nids);
5884 spec->adc_nids = stac9872_adc_nids; 5896 spec->adc_nids = stac9872_adc_nids;
diff --git a/sound/pci/hda/patch_via.c b/sound/pci/hda/patch_via.c
index 8e004fb6961a..9008b4b013aa 100644
--- a/sound/pci/hda/patch_via.c
+++ b/sound/pci/hda/patch_via.c
@@ -210,7 +210,9 @@ struct via_spec {
210 /* capture */ 210 /* capture */
211 unsigned int num_adc_nids; 211 unsigned int num_adc_nids;
212 hda_nid_t *adc_nids; 212 hda_nid_t *adc_nids;
213 hda_nid_t mux_nids[3];
213 hda_nid_t dig_in_nid; 214 hda_nid_t dig_in_nid;
215 hda_nid_t dig_in_pin;
214 216
215 /* capture source */ 217 /* capture source */
216 const struct hda_input_mux *input_mux; 218 const struct hda_input_mux *input_mux;
@@ -319,6 +321,9 @@ static void via_auto_set_output_and_unmute(struct hda_codec *codec,
319 pin_type); 321 pin_type);
320 snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_AMP_GAIN_MUTE, 322 snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_AMP_GAIN_MUTE,
321 AMP_OUT_UNMUTE); 323 AMP_OUT_UNMUTE);
324 if (snd_hda_query_pin_caps(codec, nid) & AC_PINCAP_EAPD)
325 snd_hda_codec_write(codec, nid, 0,
326 AC_VERB_SET_EAPD_BTLENABLE, 0x02);
322} 327}
323 328
324 329
@@ -387,27 +392,12 @@ static int via_mux_enum_put(struct snd_kcontrol *kcontrol,
387 struct hda_codec *codec = snd_kcontrol_chip(kcontrol); 392 struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
388 struct via_spec *spec = codec->spec; 393 struct via_spec *spec = codec->spec;
389 unsigned int adc_idx = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id); 394 unsigned int adc_idx = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id);
390 unsigned int vendor_id = codec->vendor_id; 395
391 396 if (!spec->mux_nids[adc_idx])
392 /* AIW0 lydia 060801 add for correct sw0 input select */ 397 return -EINVAL;
393 if (IS_VT1708_VENDORID(vendor_id) && (adc_idx == 0)) 398 return snd_hda_input_mux_put(codec, spec->input_mux, ucontrol,
394 return snd_hda_input_mux_put(codec, spec->input_mux, ucontrol, 399 spec->mux_nids[adc_idx],
395 0x18, &spec->cur_mux[adc_idx]); 400 &spec->cur_mux[adc_idx]);
396 else if ((IS_VT1709_10CH_VENDORID(vendor_id) ||
397 IS_VT1709_6CH_VENDORID(vendor_id)) && (adc_idx == 0))
398 return snd_hda_input_mux_put(codec, spec->input_mux, ucontrol,
399 0x19, &spec->cur_mux[adc_idx]);
400 else if ((IS_VT1708B_8CH_VENDORID(vendor_id) ||
401 IS_VT1708B_4CH_VENDORID(vendor_id)) && (adc_idx == 0))
402 return snd_hda_input_mux_put(codec, spec->input_mux, ucontrol,
403 0x17, &spec->cur_mux[adc_idx]);
404 else if (IS_VT1702_VENDORID(vendor_id) && (adc_idx == 0))
405 return snd_hda_input_mux_put(codec, spec->input_mux, ucontrol,
406 0x13, &spec->cur_mux[adc_idx]);
407 else
408 return snd_hda_input_mux_put(codec, spec->input_mux, ucontrol,
409 spec->adc_nids[adc_idx],
410 &spec->cur_mux[adc_idx]);
411} 401}
412 402
413static int via_independent_hp_info(struct snd_kcontrol *kcontrol, 403static int via_independent_hp_info(struct snd_kcontrol *kcontrol,
@@ -998,25 +988,11 @@ static int via_init(struct hda_codec *codec)
998 988
999 /* Lydia Add for EAPD enable */ 989 /* Lydia Add for EAPD enable */
1000 if (!spec->dig_in_nid) { /* No Digital In connection */ 990 if (!spec->dig_in_nid) { /* No Digital In connection */
1001 if (IS_VT1708_VENDORID(codec->vendor_id)) { 991 if (spec->dig_in_pin) {
1002 snd_hda_codec_write(codec, VT1708_DIGIN_PIN, 0, 992 snd_hda_codec_write(codec, spec->dig_in_pin, 0,
1003 AC_VERB_SET_PIN_WIDGET_CONTROL,
1004 PIN_OUT);
1005 snd_hda_codec_write(codec, VT1708_DIGIN_PIN, 0,
1006 AC_VERB_SET_EAPD_BTLENABLE, 0x02);
1007 } else if (IS_VT1709_10CH_VENDORID(codec->vendor_id) ||
1008 IS_VT1709_6CH_VENDORID(codec->vendor_id)) {
1009 snd_hda_codec_write(codec, VT1709_DIGIN_PIN, 0,
1010 AC_VERB_SET_PIN_WIDGET_CONTROL, 993 AC_VERB_SET_PIN_WIDGET_CONTROL,
1011 PIN_OUT); 994 PIN_OUT);
1012 snd_hda_codec_write(codec, VT1709_DIGIN_PIN, 0, 995 snd_hda_codec_write(codec, spec->dig_in_pin, 0,
1013 AC_VERB_SET_EAPD_BTLENABLE, 0x02);
1014 } else if (IS_VT1708B_8CH_VENDORID(codec->vendor_id) ||
1015 IS_VT1708B_4CH_VENDORID(codec->vendor_id)) {
1016 snd_hda_codec_write(codec, VT1708B_DIGIN_PIN, 0,
1017 AC_VERB_SET_PIN_WIDGET_CONTROL,
1018 PIN_OUT);
1019 snd_hda_codec_write(codec, VT1708B_DIGIN_PIN, 0,
1020 AC_VERB_SET_EAPD_BTLENABLE, 0x02); 996 AC_VERB_SET_EAPD_BTLENABLE, 0x02);
1021 } 997 }
1022 } else /* enable SPDIF-input pin */ 998 } else /* enable SPDIF-input pin */
@@ -1326,6 +1302,7 @@ static int vt1708_parse_auto_config(struct hda_codec *codec)
1326 1302
1327 if (spec->autocfg.dig_outs) 1303 if (spec->autocfg.dig_outs)
1328 spec->multiout.dig_out_nid = VT1708_DIGOUT_NID; 1304 spec->multiout.dig_out_nid = VT1708_DIGOUT_NID;
1305 spec->dig_in_pin = VT1708_DIGIN_PIN;
1329 if (spec->autocfg.dig_in_pin) 1306 if (spec->autocfg.dig_in_pin)
1330 spec->dig_in_nid = VT1708_DIGIN_NID; 1307 spec->dig_in_nid = VT1708_DIGIN_NID;
1331 1308
@@ -1352,6 +1329,34 @@ static int via_auto_init(struct hda_codec *codec)
1352 return 0; 1329 return 0;
1353} 1330}
1354 1331
1332static int get_mux_nids(struct hda_codec *codec)
1333{
1334 struct via_spec *spec = codec->spec;
1335 hda_nid_t nid, conn[8];
1336 unsigned int type;
1337 int i, n;
1338
1339 for (i = 0; i < spec->num_adc_nids; i++) {
1340 nid = spec->adc_nids[i];
1341 while (nid) {
1342 type = (get_wcaps(codec, nid) & AC_WCAP_TYPE)
1343 >> AC_WCAP_TYPE_SHIFT;
1344 if (type == AC_WID_PIN)
1345 break;
1346 n = snd_hda_get_connections(codec, nid, conn,
1347 ARRAY_SIZE(conn));
1348 if (n <= 0)
1349 break;
1350 if (n > 1) {
1351 spec->mux_nids[i] = nid;
1352 break;
1353 }
1354 nid = conn[0];
1355 }
1356 }
1357 return 0;
1358}
1359
1355static int patch_vt1708(struct hda_codec *codec) 1360static int patch_vt1708(struct hda_codec *codec)
1356{ 1361{
1357 struct via_spec *spec; 1362 struct via_spec *spec;
@@ -1799,6 +1804,7 @@ static int vt1709_parse_auto_config(struct hda_codec *codec)
1799 1804
1800 if (spec->autocfg.dig_outs) 1805 if (spec->autocfg.dig_outs)
1801 spec->multiout.dig_out_nid = VT1709_DIGOUT_NID; 1806 spec->multiout.dig_out_nid = VT1709_DIGOUT_NID;
1807 spec->dig_in_pin = VT1709_DIGIN_PIN;
1802 if (spec->autocfg.dig_in_pin) 1808 if (spec->autocfg.dig_in_pin)
1803 spec->dig_in_nid = VT1709_DIGIN_NID; 1809 spec->dig_in_nid = VT1709_DIGIN_NID;
1804 1810
@@ -1859,6 +1865,7 @@ static int patch_vt1709_10ch(struct hda_codec *codec)
1859 if (!spec->adc_nids && spec->input_mux) { 1865 if (!spec->adc_nids && spec->input_mux) {
1860 spec->adc_nids = vt1709_adc_nids; 1866 spec->adc_nids = vt1709_adc_nids;
1861 spec->num_adc_nids = ARRAY_SIZE(vt1709_adc_nids); 1867 spec->num_adc_nids = ARRAY_SIZE(vt1709_adc_nids);
1868 get_mux_nids(codec);
1862 spec->mixers[spec->num_mixers] = vt1709_capture_mixer; 1869 spec->mixers[spec->num_mixers] = vt1709_capture_mixer;
1863 spec->num_mixers++; 1870 spec->num_mixers++;
1864 } 1871 }
@@ -1952,6 +1959,7 @@ static int patch_vt1709_6ch(struct hda_codec *codec)
1952 if (!spec->adc_nids && spec->input_mux) { 1959 if (!spec->adc_nids && spec->input_mux) {
1953 spec->adc_nids = vt1709_adc_nids; 1960 spec->adc_nids = vt1709_adc_nids;
1954 spec->num_adc_nids = ARRAY_SIZE(vt1709_adc_nids); 1961 spec->num_adc_nids = ARRAY_SIZE(vt1709_adc_nids);
1962 get_mux_nids(codec);
1955 spec->mixers[spec->num_mixers] = vt1709_capture_mixer; 1963 spec->mixers[spec->num_mixers] = vt1709_capture_mixer;
1956 spec->num_mixers++; 1964 spec->num_mixers++;
1957 } 1965 }
@@ -2344,6 +2352,7 @@ static int vt1708B_parse_auto_config(struct hda_codec *codec)
2344 2352
2345 if (spec->autocfg.dig_outs) 2353 if (spec->autocfg.dig_outs)
2346 spec->multiout.dig_out_nid = VT1708B_DIGOUT_NID; 2354 spec->multiout.dig_out_nid = VT1708B_DIGOUT_NID;
2355 spec->dig_in_pin = VT1708B_DIGIN_PIN;
2347 if (spec->autocfg.dig_in_pin) 2356 if (spec->autocfg.dig_in_pin)
2348 spec->dig_in_nid = VT1708B_DIGIN_NID; 2357 spec->dig_in_nid = VT1708B_DIGIN_NID;
2349 2358
@@ -2404,6 +2413,7 @@ static int patch_vt1708B_8ch(struct hda_codec *codec)
2404 if (!spec->adc_nids && spec->input_mux) { 2413 if (!spec->adc_nids && spec->input_mux) {
2405 spec->adc_nids = vt1708B_adc_nids; 2414 spec->adc_nids = vt1708B_adc_nids;
2406 spec->num_adc_nids = ARRAY_SIZE(vt1708B_adc_nids); 2415 spec->num_adc_nids = ARRAY_SIZE(vt1708B_adc_nids);
2416 get_mux_nids(codec);
2407 spec->mixers[spec->num_mixers] = vt1708B_capture_mixer; 2417 spec->mixers[spec->num_mixers] = vt1708B_capture_mixer;
2408 spec->num_mixers++; 2418 spec->num_mixers++;
2409 } 2419 }
@@ -2455,6 +2465,7 @@ static int patch_vt1708B_4ch(struct hda_codec *codec)
2455 if (!spec->adc_nids && spec->input_mux) { 2465 if (!spec->adc_nids && spec->input_mux) {
2456 spec->adc_nids = vt1708B_adc_nids; 2466 spec->adc_nids = vt1708B_adc_nids;
2457 spec->num_adc_nids = ARRAY_SIZE(vt1708B_adc_nids); 2467 spec->num_adc_nids = ARRAY_SIZE(vt1708B_adc_nids);
2468 get_mux_nids(codec);
2458 spec->mixers[spec->num_mixers] = vt1708B_capture_mixer; 2469 spec->mixers[spec->num_mixers] = vt1708B_capture_mixer;
2459 spec->num_mixers++; 2470 spec->num_mixers++;
2460 } 2471 }
@@ -2889,6 +2900,7 @@ static int patch_vt1708S(struct hda_codec *codec)
2889 if (!spec->adc_nids && spec->input_mux) { 2900 if (!spec->adc_nids && spec->input_mux) {
2890 spec->adc_nids = vt1708S_adc_nids; 2901 spec->adc_nids = vt1708S_adc_nids;
2891 spec->num_adc_nids = ARRAY_SIZE(vt1708S_adc_nids); 2902 spec->num_adc_nids = ARRAY_SIZE(vt1708S_adc_nids);
2903 get_mux_nids(codec);
2892 spec->mixers[spec->num_mixers] = vt1708S_capture_mixer; 2904 spec->mixers[spec->num_mixers] = vt1708S_capture_mixer;
2893 spec->num_mixers++; 2905 spec->num_mixers++;
2894 } 2906 }
@@ -3206,6 +3218,7 @@ static int patch_vt1702(struct hda_codec *codec)
3206 if (!spec->adc_nids && spec->input_mux) { 3218 if (!spec->adc_nids && spec->input_mux) {
3207 spec->adc_nids = vt1702_adc_nids; 3219 spec->adc_nids = vt1702_adc_nids;
3208 spec->num_adc_nids = ARRAY_SIZE(vt1702_adc_nids); 3220 spec->num_adc_nids = ARRAY_SIZE(vt1702_adc_nids);
3221 get_mux_nids(codec);
3209 spec->mixers[spec->num_mixers] = vt1702_capture_mixer; 3222 spec->mixers[spec->num_mixers] = vt1702_capture_mixer;
3210 spec->num_mixers++; 3223 spec->num_mixers++;
3211 } 3224 }
diff --git a/sound/pci/ice1712/ice1712.c b/sound/pci/ice1712/ice1712.c
index 0d0cdbdb4486..cecf1ffeeaaa 100644
--- a/sound/pci/ice1712/ice1712.c
+++ b/sound/pci/ice1712/ice1712.c
@@ -107,7 +107,7 @@ MODULE_PARM_DESC(dxr_enable, "Enable DXR support for Terratec DMX6FIRE.");
107 107
108 108
109static const struct pci_device_id snd_ice1712_ids[] = { 109static const struct pci_device_id snd_ice1712_ids[] = {
110 { PCI_VENDOR_ID_ICE, PCI_DEVICE_ID_ICE_1712, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, /* ICE1712 */ 110 { PCI_VDEVICE(ICE, PCI_DEVICE_ID_ICE_1712), 0 }, /* ICE1712 */
111 { 0, } 111 { 0, }
112}; 112};
113 113
diff --git a/sound/pci/ice1712/ice1724.c b/sound/pci/ice1712/ice1724.c
index 36ade77cf371..cc84a831eb21 100644
--- a/sound/pci/ice1712/ice1724.c
+++ b/sound/pci/ice1712/ice1724.c
@@ -93,7 +93,7 @@ MODULE_PARM_DESC(model, "Use the given board model.");
93 93
94/* Both VT1720 and VT1724 have the same PCI IDs */ 94/* Both VT1720 and VT1724 have the same PCI IDs */
95static const struct pci_device_id snd_vt1724_ids[] = { 95static const struct pci_device_id snd_vt1724_ids[] = {
96 { PCI_VENDOR_ID_ICE, PCI_DEVICE_ID_VT1724, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, 96 { PCI_VDEVICE(ICE, PCI_DEVICE_ID_VT1724), 0 },
97 { 0, } 97 { 0, }
98}; 98};
99 99
diff --git a/sound/pci/intel8x0.c b/sound/pci/intel8x0.c
index 8aa5687f392a..171ada535209 100644
--- a/sound/pci/intel8x0.c
+++ b/sound/pci/intel8x0.c
@@ -421,29 +421,29 @@ struct intel8x0 {
421}; 421};
422 422
423static struct pci_device_id snd_intel8x0_ids[] = { 423static struct pci_device_id snd_intel8x0_ids[] = {
424 { 0x8086, 0x2415, PCI_ANY_ID, PCI_ANY_ID, 0, 0, DEVICE_INTEL }, /* 82801AA */ 424 { PCI_VDEVICE(INTEL, 0x2415), DEVICE_INTEL }, /* 82801AA */
425 { 0x8086, 0x2425, PCI_ANY_ID, PCI_ANY_ID, 0, 0, DEVICE_INTEL }, /* 82901AB */ 425 { PCI_VDEVICE(INTEL, 0x2425), DEVICE_INTEL }, /* 82901AB */
426 { 0x8086, 0x2445, PCI_ANY_ID, PCI_ANY_ID, 0, 0, DEVICE_INTEL }, /* 82801BA */ 426 { PCI_VDEVICE(INTEL, 0x2445), DEVICE_INTEL }, /* 82801BA */
427 { 0x8086, 0x2485, PCI_ANY_ID, PCI_ANY_ID, 0, 0, DEVICE_INTEL }, /* ICH3 */ 427 { PCI_VDEVICE(INTEL, 0x2485), DEVICE_INTEL }, /* ICH3 */
428 { 0x8086, 0x24c5, PCI_ANY_ID, PCI_ANY_ID, 0, 0, DEVICE_INTEL_ICH4 }, /* ICH4 */ 428 { PCI_VDEVICE(INTEL, 0x24c5), DEVICE_INTEL_ICH4 }, /* ICH4 */
429 { 0x8086, 0x24d5, PCI_ANY_ID, PCI_ANY_ID, 0, 0, DEVICE_INTEL_ICH4 }, /* ICH5 */ 429 { PCI_VDEVICE(INTEL, 0x24d5), DEVICE_INTEL_ICH4 }, /* ICH5 */
430 { 0x8086, 0x25a6, PCI_ANY_ID, PCI_ANY_ID, 0, 0, DEVICE_INTEL_ICH4 }, /* ESB */ 430 { PCI_VDEVICE(INTEL, 0x25a6), DEVICE_INTEL_ICH4 }, /* ESB */
431 { 0x8086, 0x266e, PCI_ANY_ID, PCI_ANY_ID, 0, 0, DEVICE_INTEL_ICH4 }, /* ICH6 */ 431 { PCI_VDEVICE(INTEL, 0x266e), DEVICE_INTEL_ICH4 }, /* ICH6 */
432 { 0x8086, 0x27de, PCI_ANY_ID, PCI_ANY_ID, 0, 0, DEVICE_INTEL_ICH4 }, /* ICH7 */ 432 { PCI_VDEVICE(INTEL, 0x27de), DEVICE_INTEL_ICH4 }, /* ICH7 */
433 { 0x8086, 0x2698, PCI_ANY_ID, PCI_ANY_ID, 0, 0, DEVICE_INTEL_ICH4 }, /* ESB2 */ 433 { PCI_VDEVICE(INTEL, 0x2698), DEVICE_INTEL_ICH4 }, /* ESB2 */
434 { 0x8086, 0x7195, PCI_ANY_ID, PCI_ANY_ID, 0, 0, DEVICE_INTEL }, /* 440MX */ 434 { PCI_VDEVICE(INTEL, 0x7195), DEVICE_INTEL }, /* 440MX */
435 { 0x1039, 0x7012, PCI_ANY_ID, PCI_ANY_ID, 0, 0, DEVICE_SIS }, /* SI7012 */ 435 { PCI_VDEVICE(SI, 0x7012), DEVICE_SIS }, /* SI7012 */
436 { 0x10de, 0x01b1, PCI_ANY_ID, PCI_ANY_ID, 0, 0, DEVICE_NFORCE }, /* NFORCE */ 436 { PCI_VDEVICE(NVIDIA, 0x01b1), DEVICE_NFORCE }, /* NFORCE */
437 { 0x10de, 0x003a, PCI_ANY_ID, PCI_ANY_ID, 0, 0, DEVICE_NFORCE }, /* MCP04 */ 437 { PCI_VDEVICE(NVIDIA, 0x003a), DEVICE_NFORCE }, /* MCP04 */
438 { 0x10de, 0x006a, PCI_ANY_ID, PCI_ANY_ID, 0, 0, DEVICE_NFORCE }, /* NFORCE2 */ 438 { PCI_VDEVICE(NVIDIA, 0x006a), DEVICE_NFORCE }, /* NFORCE2 */
439 { 0x10de, 0x0059, PCI_ANY_ID, PCI_ANY_ID, 0, 0, DEVICE_NFORCE }, /* CK804 */ 439 { PCI_VDEVICE(NVIDIA, 0x0059), DEVICE_NFORCE }, /* CK804 */
440 { 0x10de, 0x008a, PCI_ANY_ID, PCI_ANY_ID, 0, 0, DEVICE_NFORCE }, /* CK8 */ 440 { PCI_VDEVICE(NVIDIA, 0x008a), DEVICE_NFORCE }, /* CK8 */
441 { 0x10de, 0x00da, PCI_ANY_ID, PCI_ANY_ID, 0, 0, DEVICE_NFORCE }, /* NFORCE3 */ 441 { PCI_VDEVICE(NVIDIA, 0x00da), DEVICE_NFORCE }, /* NFORCE3 */
442 { 0x10de, 0x00ea, PCI_ANY_ID, PCI_ANY_ID, 0, 0, DEVICE_NFORCE }, /* CK8S */ 442 { PCI_VDEVICE(NVIDIA, 0x00ea), DEVICE_NFORCE }, /* CK8S */
443 { 0x10de, 0x026b, PCI_ANY_ID, PCI_ANY_ID, 0, 0, DEVICE_NFORCE }, /* MCP51 */ 443 { PCI_VDEVICE(NVIDIA, 0x026b), DEVICE_NFORCE }, /* MCP51 */
444 { 0x1022, 0x746d, PCI_ANY_ID, PCI_ANY_ID, 0, 0, DEVICE_INTEL }, /* AMD8111 */ 444 { PCI_VDEVICE(AMD, 0x746d), DEVICE_INTEL }, /* AMD8111 */
445 { 0x1022, 0x7445, PCI_ANY_ID, PCI_ANY_ID, 0, 0, DEVICE_INTEL }, /* AMD768 */ 445 { PCI_VDEVICE(AMD, 0x7445), DEVICE_INTEL }, /* AMD768 */
446 { 0x10b9, 0x5455, PCI_ANY_ID, PCI_ANY_ID, 0, 0, DEVICE_ALI }, /* Ali5455 */ 446 { PCI_VDEVICE(AL, 0x5455), DEVICE_ALI }, /* Ali5455 */
447 { 0, } 447 { 0, }
448}; 448};
449 449
diff --git a/sound/pci/intel8x0m.c b/sound/pci/intel8x0m.c
index 6ec0fc50d6be..9e7d12e7673f 100644
--- a/sound/pci/intel8x0m.c
+++ b/sound/pci/intel8x0m.c
@@ -220,24 +220,24 @@ struct intel8x0m {
220}; 220};
221 221
222static struct pci_device_id snd_intel8x0m_ids[] = { 222static struct pci_device_id snd_intel8x0m_ids[] = {
223 { 0x8086, 0x2416, PCI_ANY_ID, PCI_ANY_ID, 0, 0, DEVICE_INTEL }, /* 82801AA */ 223 { PCI_VDEVICE(INTEL, 0x2416), DEVICE_INTEL }, /* 82801AA */
224 { 0x8086, 0x2426, PCI_ANY_ID, PCI_ANY_ID, 0, 0, DEVICE_INTEL }, /* 82901AB */ 224 { PCI_VDEVICE(INTEL, 0x2426), DEVICE_INTEL }, /* 82901AB */
225 { 0x8086, 0x2446, PCI_ANY_ID, PCI_ANY_ID, 0, 0, DEVICE_INTEL }, /* 82801BA */ 225 { PCI_VDEVICE(INTEL, 0x2446), DEVICE_INTEL }, /* 82801BA */
226 { 0x8086, 0x2486, PCI_ANY_ID, PCI_ANY_ID, 0, 0, DEVICE_INTEL }, /* ICH3 */ 226 { PCI_VDEVICE(INTEL, 0x2486), DEVICE_INTEL }, /* ICH3 */
227 { 0x8086, 0x24c6, PCI_ANY_ID, PCI_ANY_ID, 0, 0, DEVICE_INTEL }, /* ICH4 */ 227 { PCI_VDEVICE(INTEL, 0x24c6), DEVICE_INTEL }, /* ICH4 */
228 { 0x8086, 0x24d6, PCI_ANY_ID, PCI_ANY_ID, 0, 0, DEVICE_INTEL }, /* ICH5 */ 228 { PCI_VDEVICE(INTEL, 0x24d6), DEVICE_INTEL }, /* ICH5 */
229 { 0x8086, 0x266d, PCI_ANY_ID, PCI_ANY_ID, 0, 0, DEVICE_INTEL }, /* ICH6 */ 229 { PCI_VDEVICE(INTEL, 0x266d), DEVICE_INTEL }, /* ICH6 */
230 { 0x8086, 0x27dd, PCI_ANY_ID, PCI_ANY_ID, 0, 0, DEVICE_INTEL }, /* ICH7 */ 230 { PCI_VDEVICE(INTEL, 0x27dd), DEVICE_INTEL }, /* ICH7 */
231 { 0x8086, 0x7196, PCI_ANY_ID, PCI_ANY_ID, 0, 0, DEVICE_INTEL }, /* 440MX */ 231 { PCI_VDEVICE(INTEL, 0x7196), DEVICE_INTEL }, /* 440MX */
232 { 0x1022, 0x7446, PCI_ANY_ID, PCI_ANY_ID, 0, 0, DEVICE_INTEL }, /* AMD768 */ 232 { PCI_VDEVICE(AMD, 0x7446), DEVICE_INTEL }, /* AMD768 */
233 { 0x1039, 0x7013, PCI_ANY_ID, PCI_ANY_ID, 0, 0, DEVICE_SIS }, /* SI7013 */ 233 { PCI_VDEVICE(SI, 0x7013), DEVICE_SIS }, /* SI7013 */
234 { 0x10de, 0x01c1, PCI_ANY_ID, PCI_ANY_ID, 0, 0, DEVICE_NFORCE }, /* NFORCE */ 234 { PCI_VDEVICE(NVIDIA, 0x01c1), DEVICE_NFORCE }, /* NFORCE */
235 { 0x10de, 0x0069, PCI_ANY_ID, PCI_ANY_ID, 0, 0, DEVICE_NFORCE }, /* NFORCE2 */ 235 { PCI_VDEVICE(NVIDIA, 0x0069), DEVICE_NFORCE }, /* NFORCE2 */
236 { 0x10de, 0x0089, PCI_ANY_ID, PCI_ANY_ID, 0, 0, DEVICE_NFORCE }, /* NFORCE2s */ 236 { PCI_VDEVICE(NVIDIA, 0x0089), DEVICE_NFORCE }, /* NFORCE2s */
237 { 0x10de, 0x00d9, PCI_ANY_ID, PCI_ANY_ID, 0, 0, DEVICE_NFORCE }, /* NFORCE3 */ 237 { PCI_VDEVICE(NVIDIA, 0x00d9), DEVICE_NFORCE }, /* NFORCE3 */
238#if 0 238#if 0
239 { 0x1022, 0x746d, PCI_ANY_ID, PCI_ANY_ID, 0, 0, DEVICE_INTEL }, /* AMD8111 */ 239 { PCI_VDEVICE(AMD, 0x746d), DEVICE_INTEL }, /* AMD8111 */
240 { 0x10b9, 0x5455, PCI_ANY_ID, PCI_ANY_ID, 0, 0, DEVICE_ALI }, /* Ali5455 */ 240 { PCI_VDEVICE(AL, 0x5455), DEVICE_ALI }, /* Ali5455 */
241#endif 241#endif
242 { 0, } 242 { 0, }
243}; 243};
diff --git a/sound/pci/lx6464es/lx6464es.c b/sound/pci/lx6464es/lx6464es.c
index 18da2ef04d09..11b8c6514b3d 100644
--- a/sound/pci/lx6464es/lx6464es.c
+++ b/sound/pci/lx6464es/lx6464es.c
@@ -654,13 +654,12 @@ static int __devinit lx_init_ethersound_config(struct lx6464es *chip)
654 int i; 654 int i;
655 u32 orig_conf_es = lx_dsp_reg_read(chip, eReg_CONFES); 655 u32 orig_conf_es = lx_dsp_reg_read(chip, eReg_CONFES);
656 656
657 u32 default_conf_es = (64 << IOCR_OUTPUTS_OFFSET) | 657 /* configure 64 io channels */
658 u32 conf_es = (orig_conf_es & CONFES_READ_PART_MASK) |
658 (64 << IOCR_INPUTS_OFFSET) | 659 (64 << IOCR_INPUTS_OFFSET) |
660 (64 << IOCR_OUTPUTS_OFFSET) |
659 (FREQ_RATIO_SINGLE_MODE << FREQ_RATIO_OFFSET); 661 (FREQ_RATIO_SINGLE_MODE << FREQ_RATIO_OFFSET);
660 662
661 u32 conf_es = (orig_conf_es & CONFES_READ_PART_MASK)
662 | (default_conf_es & CONFES_WRITE_PART_MASK);
663
664 snd_printdd("->lx_init_ethersound\n"); 663 snd_printdd("->lx_init_ethersound\n");
665 664
666 chip->freq_ratio = FREQ_RATIO_SINGLE_MODE; 665 chip->freq_ratio = FREQ_RATIO_SINGLE_MODE;
diff --git a/sound/pci/mixart/mixart.c b/sound/pci/mixart/mixart.c
index 82bc5b9e7629..a83d1968a845 100644
--- a/sound/pci/mixart/mixart.c
+++ b/sound/pci/mixart/mixart.c
@@ -61,7 +61,7 @@ MODULE_PARM_DESC(enable, "Enable Digigram " CARD_NAME " soundcard.");
61 */ 61 */
62 62
63static struct pci_device_id snd_mixart_ids[] = { 63static struct pci_device_id snd_mixart_ids[] = {
64 { 0x1057, 0x0003, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, }, /* MC8240 */ 64 { PCI_VDEVICE(MOTOROLA, 0x0003), 0, }, /* MC8240 */
65 { 0, } 65 { 0, }
66}; 66};
67 67
diff --git a/sound/pci/nm256/nm256.c b/sound/pci/nm256/nm256.c
index 522a040855d4..97a0731331a1 100644
--- a/sound/pci/nm256/nm256.c
+++ b/sound/pci/nm256/nm256.c
@@ -263,9 +263,9 @@ struct nm256 {
263 * PCI ids 263 * PCI ids
264 */ 264 */
265static struct pci_device_id snd_nm256_ids[] = { 265static struct pci_device_id snd_nm256_ids[] = {
266 {PCI_VENDOR_ID_NEOMAGIC, PCI_DEVICE_ID_NEOMAGIC_NM256AV_AUDIO, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, 266 {PCI_VDEVICE(NEOMAGIC, PCI_DEVICE_ID_NEOMAGIC_NM256AV_AUDIO), 0},
267 {PCI_VENDOR_ID_NEOMAGIC, PCI_DEVICE_ID_NEOMAGIC_NM256ZX_AUDIO, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, 267 {PCI_VDEVICE(NEOMAGIC, PCI_DEVICE_ID_NEOMAGIC_NM256ZX_AUDIO), 0},
268 {PCI_VENDOR_ID_NEOMAGIC, PCI_DEVICE_ID_NEOMAGIC_NM256XL_PLUS_AUDIO, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, 268 {PCI_VDEVICE(NEOMAGIC, PCI_DEVICE_ID_NEOMAGIC_NM256XL_PLUS_AUDIO), 0},
269 {0,}, 269 {0,},
270}; 270};
271 271
diff --git a/sound/pci/oxygen/oxygen_mixer.c b/sound/pci/oxygen/oxygen_mixer.c
index 304da169bfdc..5401c547c4e3 100644
--- a/sound/pci/oxygen/oxygen_mixer.c
+++ b/sound/pci/oxygen/oxygen_mixer.c
@@ -575,8 +575,10 @@ static int ac97_switch_put(struct snd_kcontrol *ctl,
575static int ac97_volume_info(struct snd_kcontrol *ctl, 575static int ac97_volume_info(struct snd_kcontrol *ctl,
576 struct snd_ctl_elem_info *info) 576 struct snd_ctl_elem_info *info)
577{ 577{
578 int stereo = (ctl->private_value >> 16) & 1;
579
578 info->type = SNDRV_CTL_ELEM_TYPE_INTEGER; 580 info->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
579 info->count = 2; 581 info->count = stereo ? 2 : 1;
580 info->value.integer.min = 0; 582 info->value.integer.min = 0;
581 info->value.integer.max = 0x1f; 583 info->value.integer.max = 0x1f;
582 return 0; 584 return 0;
@@ -587,6 +589,7 @@ static int ac97_volume_get(struct snd_kcontrol *ctl,
587{ 589{
588 struct oxygen *chip = ctl->private_data; 590 struct oxygen *chip = ctl->private_data;
589 unsigned int codec = (ctl->private_value >> 24) & 1; 591 unsigned int codec = (ctl->private_value >> 24) & 1;
592 int stereo = (ctl->private_value >> 16) & 1;
590 unsigned int index = ctl->private_value & 0xff; 593 unsigned int index = ctl->private_value & 0xff;
591 u16 reg; 594 u16 reg;
592 595
@@ -594,7 +597,8 @@ static int ac97_volume_get(struct snd_kcontrol *ctl,
594 reg = oxygen_read_ac97(chip, codec, index); 597 reg = oxygen_read_ac97(chip, codec, index);
595 mutex_unlock(&chip->mutex); 598 mutex_unlock(&chip->mutex);
596 value->value.integer.value[0] = 31 - (reg & 0x1f); 599 value->value.integer.value[0] = 31 - (reg & 0x1f);
597 value->value.integer.value[1] = 31 - ((reg >> 8) & 0x1f); 600 if (stereo)
601 value->value.integer.value[1] = 31 - ((reg >> 8) & 0x1f);
598 return 0; 602 return 0;
599} 603}
600 604
@@ -603,6 +607,7 @@ static int ac97_volume_put(struct snd_kcontrol *ctl,
603{ 607{
604 struct oxygen *chip = ctl->private_data; 608 struct oxygen *chip = ctl->private_data;
605 unsigned int codec = (ctl->private_value >> 24) & 1; 609 unsigned int codec = (ctl->private_value >> 24) & 1;
610 int stereo = (ctl->private_value >> 16) & 1;
606 unsigned int index = ctl->private_value & 0xff; 611 unsigned int index = ctl->private_value & 0xff;
607 u16 oldreg, newreg; 612 u16 oldreg, newreg;
608 int change; 613 int change;
@@ -612,8 +617,11 @@ static int ac97_volume_put(struct snd_kcontrol *ctl,
612 newreg = oldreg; 617 newreg = oldreg;
613 newreg = (newreg & ~0x1f) | 618 newreg = (newreg & ~0x1f) |
614 (31 - (value->value.integer.value[0] & 0x1f)); 619 (31 - (value->value.integer.value[0] & 0x1f));
615 newreg = (newreg & ~0x1f00) | 620 if (stereo)
616 ((31 - (value->value.integer.value[0] & 0x1f)) << 8); 621 newreg = (newreg & ~0x1f00) |
622 ((31 - (value->value.integer.value[1] & 0x1f)) << 8);
623 else
624 newreg = (newreg & ~0x1f00) | ((newreg & 0x1f) << 8);
617 change = newreg != oldreg; 625 change = newreg != oldreg;
618 if (change) 626 if (change)
619 oxygen_write_ac97(chip, codec, index, newreg); 627 oxygen_write_ac97(chip, codec, index, newreg);
@@ -673,7 +681,7 @@ static int ac97_fp_rec_volume_put(struct snd_kcontrol *ctl,
673 .private_value = ((codec) << 24) | ((invert) << 16) | \ 681 .private_value = ((codec) << 24) | ((invert) << 16) | \
674 ((bitnr) << 8) | (index), \ 682 ((bitnr) << 8) | (index), \
675 } 683 }
676#define AC97_VOLUME(xname, codec, index) { \ 684#define AC97_VOLUME(xname, codec, index, stereo) { \
677 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, \ 685 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, \
678 .name = xname, \ 686 .name = xname, \
679 .access = SNDRV_CTL_ELEM_ACCESS_READWRITE | \ 687 .access = SNDRV_CTL_ELEM_ACCESS_READWRITE | \
@@ -682,7 +690,7 @@ static int ac97_fp_rec_volume_put(struct snd_kcontrol *ctl,
682 .get = ac97_volume_get, \ 690 .get = ac97_volume_get, \
683 .put = ac97_volume_put, \ 691 .put = ac97_volume_put, \
684 .tlv = { .p = ac97_db_scale, }, \ 692 .tlv = { .p = ac97_db_scale, }, \
685 .private_value = ((codec) << 24) | (index), \ 693 .private_value = ((codec) << 24) | ((stereo) << 16) | (index), \
686 } 694 }
687 695
688static DECLARE_TLV_DB_SCALE(monitor_db_scale, -1000, 1000, 0); 696static DECLARE_TLV_DB_SCALE(monitor_db_scale, -1000, 1000, 0);
@@ -882,18 +890,18 @@ static const struct {
882}; 890};
883 891
884static const struct snd_kcontrol_new ac97_controls[] = { 892static const struct snd_kcontrol_new ac97_controls[] = {
885 AC97_VOLUME("Mic Capture Volume", 0, AC97_MIC), 893 AC97_VOLUME("Mic Capture Volume", 0, AC97_MIC, 0),
886 AC97_SWITCH("Mic Capture Switch", 0, AC97_MIC, 15, 1), 894 AC97_SWITCH("Mic Capture Switch", 0, AC97_MIC, 15, 1),
887 AC97_SWITCH("Mic Boost (+20dB)", 0, AC97_MIC, 6, 0), 895 AC97_SWITCH("Mic Boost (+20dB)", 0, AC97_MIC, 6, 0),
888 AC97_SWITCH("Line Capture Switch", 0, AC97_LINE, 15, 1), 896 AC97_SWITCH("Line Capture Switch", 0, AC97_LINE, 15, 1),
889 AC97_VOLUME("CD Capture Volume", 0, AC97_CD), 897 AC97_VOLUME("CD Capture Volume", 0, AC97_CD, 1),
890 AC97_SWITCH("CD Capture Switch", 0, AC97_CD, 15, 1), 898 AC97_SWITCH("CD Capture Switch", 0, AC97_CD, 15, 1),
891 AC97_VOLUME("Aux Capture Volume", 0, AC97_AUX), 899 AC97_VOLUME("Aux Capture Volume", 0, AC97_AUX, 1),
892 AC97_SWITCH("Aux Capture Switch", 0, AC97_AUX, 15, 1), 900 AC97_SWITCH("Aux Capture Switch", 0, AC97_AUX, 15, 1),
893}; 901};
894 902
895static const struct snd_kcontrol_new ac97_fp_controls[] = { 903static const struct snd_kcontrol_new ac97_fp_controls[] = {
896 AC97_VOLUME("Front Panel Playback Volume", 1, AC97_HEADPHONE), 904 AC97_VOLUME("Front Panel Playback Volume", 1, AC97_HEADPHONE, 1),
897 AC97_SWITCH("Front Panel Playback Switch", 1, AC97_HEADPHONE, 15, 1), 905 AC97_SWITCH("Front Panel Playback Switch", 1, AC97_HEADPHONE, 15, 1),
898 { 906 {
899 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 907 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
diff --git a/sound/pci/oxygen/virtuoso.c b/sound/pci/oxygen/virtuoso.c
index bf971f7cfdc6..6ebcb6bdd712 100644
--- a/sound/pci/oxygen/virtuoso.c
+++ b/sound/pci/oxygen/virtuoso.c
@@ -635,6 +635,8 @@ static void xonar_d2_resume(struct oxygen *chip)
635 635
636static void xonar_d1_resume(struct oxygen *chip) 636static void xonar_d1_resume(struct oxygen *chip)
637{ 637{
638 oxygen_set_bits8(chip, OXYGEN_FUNCTION, OXYGEN_FUNCTION_RESET_CODEC);
639 msleep(1);
638 cs43xx_init(chip); 640 cs43xx_init(chip);
639 xonar_enable_output(chip); 641 xonar_enable_output(chip);
640} 642}
diff --git a/sound/pci/riptide/riptide.c b/sound/pci/riptide/riptide.c
index 235a71e5ac8d..b5ca02e2038c 100644
--- a/sound/pci/riptide/riptide.c
+++ b/sound/pci/riptide/riptide.c
@@ -2197,9 +2197,12 @@ static int __init alsa_card_riptide_init(void)
2197 if (err < 0) 2197 if (err < 0)
2198 return err; 2198 return err;
2199#if defined(SUPPORT_JOYSTICK) 2199#if defined(SUPPORT_JOYSTICK)
2200 pci_register_driver(&joystick_driver); 2200 err = pci_register_driver(&joystick_driver);
2201 /* On failure unregister formerly registered audio driver */
2202 if (err < 0)
2203 pci_unregister_driver(&driver);
2201#endif 2204#endif
2202 return 0; 2205 return err;
2203} 2206}
2204 2207
2205static void __exit alsa_card_riptide_exit(void) 2208static void __exit alsa_card_riptide_exit(void)
diff --git a/sound/pci/rme32.c b/sound/pci/rme32.c
index d7b966e7c4cf..f977dba7cbd0 100644
--- a/sound/pci/rme32.c
+++ b/sound/pci/rme32.c
@@ -227,12 +227,9 @@ struct rme32 {
227}; 227};
228 228
229static struct pci_device_id snd_rme32_ids[] = { 229static struct pci_device_id snd_rme32_ids[] = {
230 {PCI_VENDOR_ID_XILINX_RME, PCI_DEVICE_ID_RME_DIGI32, 230 {PCI_VDEVICE(XILINX_RME, PCI_DEVICE_ID_RME_DIGI32), 0,},
231 PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0,}, 231 {PCI_VDEVICE(XILINX_RME, PCI_DEVICE_ID_RME_DIGI32_8), 0,},
232 {PCI_VENDOR_ID_XILINX_RME, PCI_DEVICE_ID_RME_DIGI32_8, 232 {PCI_VDEVICE(XILINX_RME, PCI_DEVICE_ID_RME_DIGI32_PRO), 0,},
233 PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0,},
234 {PCI_VENDOR_ID_XILINX_RME, PCI_DEVICE_ID_RME_DIGI32_PRO,
235 PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0,},
236 {0,} 233 {0,}
237}; 234};
238 235
diff --git a/sound/pci/rme96.c b/sound/pci/rme96.c
index 55fb1c131f58..2ba5c0fd55db 100644
--- a/sound/pci/rme96.c
+++ b/sound/pci/rme96.c
@@ -232,14 +232,10 @@ struct rme96 {
232}; 232};
233 233
234static struct pci_device_id snd_rme96_ids[] = { 234static struct pci_device_id snd_rme96_ids[] = {
235 { PCI_VENDOR_ID_XILINX, PCI_DEVICE_ID_RME_DIGI96, 235 { PCI_VDEVICE(XILINX, PCI_DEVICE_ID_RME_DIGI96), 0, },
236 PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, }, 236 { PCI_VDEVICE(XILINX, PCI_DEVICE_ID_RME_DIGI96_8), 0, },
237 { PCI_VENDOR_ID_XILINX, PCI_DEVICE_ID_RME_DIGI96_8, 237 { PCI_VDEVICE(XILINX, PCI_DEVICE_ID_RME_DIGI96_8_PRO), 0, },
238 PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, }, 238 { PCI_VDEVICE(XILINX, PCI_DEVICE_ID_RME_DIGI96_8_PAD_OR_PST), 0, },
239 { PCI_VENDOR_ID_XILINX, PCI_DEVICE_ID_RME_DIGI96_8_PRO,
240 PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, },
241 { PCI_VENDOR_ID_XILINX, PCI_DEVICE_ID_RME_DIGI96_8_PAD_OR_PST,
242 PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, },
243 { 0, } 239 { 0, }
244}; 240};
245 241
diff --git a/sound/pci/sonicvibes.c b/sound/pci/sonicvibes.c
index 7dc60ad4772e..1f6406c4534d 100644
--- a/sound/pci/sonicvibes.c
+++ b/sound/pci/sonicvibes.c
@@ -243,7 +243,7 @@ struct sonicvibes {
243}; 243};
244 244
245static struct pci_device_id snd_sonic_ids[] = { 245static struct pci_device_id snd_sonic_ids[] = {
246 { 0x5333, 0xca00, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, }, 246 { PCI_VDEVICE(S3, 0xca00), 0, },
247 { 0, } 247 { 0, }
248}; 248};
249 249
diff --git a/sound/pci/via82xx.c b/sound/pci/via82xx.c
index 949fcaf6b70e..acfa4760da49 100644
--- a/sound/pci/via82xx.c
+++ b/sound/pci/via82xx.c
@@ -402,9 +402,9 @@ struct via82xx {
402 402
403static struct pci_device_id snd_via82xx_ids[] = { 403static struct pci_device_id snd_via82xx_ids[] = {
404 /* 0x1106, 0x3058 */ 404 /* 0x1106, 0x3058 */
405 { PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C686_5, PCI_ANY_ID, PCI_ANY_ID, 0, 0, TYPE_CARD_VIA686, }, /* 686A */ 405 { PCI_VDEVICE(VIA, PCI_DEVICE_ID_VIA_82C686_5), TYPE_CARD_VIA686, }, /* 686A */
406 /* 0x1106, 0x3059 */ 406 /* 0x1106, 0x3059 */
407 { PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_8233_5, PCI_ANY_ID, PCI_ANY_ID, 0, 0, TYPE_CARD_VIA8233, }, /* VT8233 */ 407 { PCI_VDEVICE(VIA, PCI_DEVICE_ID_VIA_8233_5), TYPE_CARD_VIA8233, }, /* VT8233 */
408 { 0, } 408 { 0, }
409}; 409};
410 410
diff --git a/sound/pci/via82xx_modem.c b/sound/pci/via82xx_modem.c
index 0d54e3503c1e..47eb61561dfc 100644
--- a/sound/pci/via82xx_modem.c
+++ b/sound/pci/via82xx_modem.c
@@ -261,7 +261,7 @@ struct via82xx_modem {
261}; 261};
262 262
263static struct pci_device_id snd_via82xx_modem_ids[] = { 263static struct pci_device_id snd_via82xx_modem_ids[] = {
264 { 0x1106, 0x3068, PCI_ANY_ID, PCI_ANY_ID, 0, 0, TYPE_CARD_VIA82XX_MODEM, }, 264 { PCI_VDEVICE(VIA, 0x3068), TYPE_CARD_VIA82XX_MODEM, },
265 { 0, } 265 { 0, }
266}; 266};
267 267
diff --git a/sound/pci/ymfpci/ymfpci.c b/sound/pci/ymfpci/ymfpci.c
index 4af66661f9b0..e6b18b90d451 100644
--- a/sound/pci/ymfpci/ymfpci.c
+++ b/sound/pci/ymfpci/ymfpci.c
@@ -67,12 +67,12 @@ module_param_array(rear_switch, bool, NULL, 0444);
67MODULE_PARM_DESC(rear_switch, "Enable shared rear/line-in switch"); 67MODULE_PARM_DESC(rear_switch, "Enable shared rear/line-in switch");
68 68
69static struct pci_device_id snd_ymfpci_ids[] = { 69static struct pci_device_id snd_ymfpci_ids[] = {
70 { 0x1073, 0x0004, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, }, /* YMF724 */ 70 { PCI_VDEVICE(YAMAHA, 0x0004), 0, }, /* YMF724 */
71 { 0x1073, 0x000d, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, }, /* YMF724F */ 71 { PCI_VDEVICE(YAMAHA, 0x000d), 0, }, /* YMF724F */
72 { 0x1073, 0x000a, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, }, /* YMF740 */ 72 { PCI_VDEVICE(YAMAHA, 0x000a), 0, }, /* YMF740 */
73 { 0x1073, 0x000c, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, }, /* YMF740C */ 73 { PCI_VDEVICE(YAMAHA, 0x000c), 0, }, /* YMF740C */
74 { 0x1073, 0x0010, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, }, /* YMF744 */ 74 { PCI_VDEVICE(YAMAHA, 0x0010), 0, }, /* YMF744 */
75 { 0x1073, 0x0012, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, }, /* YMF754 */ 75 { PCI_VDEVICE(YAMAHA, 0x0012), 0, }, /* YMF754 */
76 { 0, } 76 { 0, }
77}; 77};
78 78
diff --git a/sound/soc/codecs/tlv320aic3x.c b/sound/soc/codecs/tlv320aic3x.c
index ab099f482487..cb0d1bf34b57 100644
--- a/sound/soc/codecs/tlv320aic3x.c
+++ b/sound/soc/codecs/tlv320aic3x.c
@@ -767,6 +767,7 @@ static int aic3x_hw_params(struct snd_pcm_substream *substream,
767 int codec_clk = 0, bypass_pll = 0, fsref, last_clk = 0; 767 int codec_clk = 0, bypass_pll = 0, fsref, last_clk = 0;
768 u8 data, r, p, pll_q, pll_p = 1, pll_r = 1, pll_j = 1; 768 u8 data, r, p, pll_q, pll_p = 1, pll_r = 1, pll_j = 1;
769 u16 pll_d = 1; 769 u16 pll_d = 1;
770 u8 reg;
770 771
771 /* select data word length */ 772 /* select data word length */
772 data = 773 data =
@@ -801,8 +802,16 @@ static int aic3x_hw_params(struct snd_pcm_substream *substream,
801 pll_q &= 0xf; 802 pll_q &= 0xf;
802 aic3x_write(codec, AIC3X_PLL_PROGA_REG, pll_q << PLLQ_SHIFT); 803 aic3x_write(codec, AIC3X_PLL_PROGA_REG, pll_q << PLLQ_SHIFT);
803 aic3x_write(codec, AIC3X_GPIOB_REG, CODEC_CLKIN_CLKDIV); 804 aic3x_write(codec, AIC3X_GPIOB_REG, CODEC_CLKIN_CLKDIV);
804 } else 805 /* disable PLL if it is bypassed */
806 reg = aic3x_read_reg_cache(codec, AIC3X_PLL_PROGA_REG);
807 aic3x_write(codec, AIC3X_PLL_PROGA_REG, reg & ~PLL_ENABLE);
808
809 } else {
805 aic3x_write(codec, AIC3X_GPIOB_REG, CODEC_CLKIN_PLLDIV); 810 aic3x_write(codec, AIC3X_GPIOB_REG, CODEC_CLKIN_PLLDIV);
811 /* enable PLL when it is used */
812 reg = aic3x_read_reg_cache(codec, AIC3X_PLL_PROGA_REG);
813 aic3x_write(codec, AIC3X_PLL_PROGA_REG, reg | PLL_ENABLE);
814 }
806 815
807 /* Route Left DAC to left channel input and 816 /* Route Left DAC to left channel input and
808 * right DAC to right channel input */ 817 * right DAC to right channel input */
diff --git a/sound/soc/codecs/wm8753.c b/sound/soc/codecs/wm8753.c
index d28eeaceb857..49c4b2898aff 100644
--- a/sound/soc/codecs/wm8753.c
+++ b/sound/soc/codecs/wm8753.c
@@ -79,7 +79,7 @@ static const u16 wm8753_reg[] = {
79 0x0097, 0x0097, 0x0000, 0x0004, 79 0x0097, 0x0097, 0x0000, 0x0004,
80 0x0000, 0x0083, 0x0024, 0x01ba, 80 0x0000, 0x0083, 0x0024, 0x01ba,
81 0x0000, 0x0083, 0x0024, 0x01ba, 81 0x0000, 0x0083, 0x0024, 0x01ba,
82 0x0000, 0x0000 82 0x0000, 0x0000, 0x0000
83}; 83};
84 84
85/* codec private data */ 85/* codec private data */
@@ -1660,11 +1660,11 @@ static int wm8753_register(struct wm8753_priv *wm8753)
1660 codec->set_bias_level = wm8753_set_bias_level; 1660 codec->set_bias_level = wm8753_set_bias_level;
1661 codec->dai = wm8753_dai; 1661 codec->dai = wm8753_dai;
1662 codec->num_dai = 2; 1662 codec->num_dai = 2;
1663 codec->reg_cache_size = ARRAY_SIZE(wm8753->reg_cache); 1663 codec->reg_cache_size = ARRAY_SIZE(wm8753->reg_cache) + 1;
1664 codec->reg_cache = &wm8753->reg_cache; 1664 codec->reg_cache = &wm8753->reg_cache;
1665 codec->private_data = wm8753; 1665 codec->private_data = wm8753;
1666 1666
1667 memcpy(codec->reg_cache, wm8753_reg, sizeof(codec->reg_cache)); 1667 memcpy(codec->reg_cache, wm8753_reg, sizeof(wm8753->reg_cache));
1668 INIT_DELAYED_WORK(&codec->delayed_work, wm8753_work); 1668 INIT_DELAYED_WORK(&codec->delayed_work, wm8753_work);
1669 1669
1670 ret = wm8753_reset(codec); 1670 ret = wm8753_reset(codec);
diff --git a/sound/soc/codecs/wm8988.c b/sound/soc/codecs/wm8988.c
index c05f71803aa8..8c0fdf84aac3 100644
--- a/sound/soc/codecs/wm8988.c
+++ b/sound/soc/codecs/wm8988.c
@@ -1037,14 +1037,14 @@ static int __devinit wm8988_spi_probe(struct spi_device *spi)
1037 codec->control_data = spi; 1037 codec->control_data = spi;
1038 codec->dev = &spi->dev; 1038 codec->dev = &spi->dev;
1039 1039
1040 spi->dev.driver_data = wm8988; 1040 dev_set_drvdata(&spi->dev, wm8988);
1041 1041
1042 return wm8988_register(wm8988); 1042 return wm8988_register(wm8988);
1043} 1043}
1044 1044
1045static int __devexit wm8988_spi_remove(struct spi_device *spi) 1045static int __devexit wm8988_spi_remove(struct spi_device *spi)
1046{ 1046{
1047 struct wm8988_priv *wm8988 = spi->dev.driver_data; 1047 struct wm8988_priv *wm8988 = dev_get_drvdata(&spi->dev);
1048 1048
1049 wm8988_unregister(wm8988); 1049 wm8988_unregister(wm8988);
1050 1050
diff --git a/sound/soc/fsl/Kconfig b/sound/soc/fsl/Kconfig
index 5dbebf82249c..8cb65ccad35f 100644
--- a/sound/soc/fsl/Kconfig
+++ b/sound/soc/fsl/Kconfig
@@ -33,7 +33,7 @@ config SND_SOC_MPC5200_I2S
33config SND_SOC_MPC5200_AC97 33config SND_SOC_MPC5200_AC97
34 tristate "Freescale MPC5200 PSC in AC97 mode driver" 34 tristate "Freescale MPC5200 PSC in AC97 mode driver"
35 depends on PPC_MPC52xx && PPC_BESTCOMM 35 depends on PPC_MPC52xx && PPC_BESTCOMM
36 select AC97_BUS 36 select SND_SOC_AC97_BUS
37 select SND_MPC52xx_DMA 37 select SND_MPC52xx_DMA
38 select PPC_BESTCOMM_GEN_BD 38 select PPC_BESTCOMM_GEN_BD
39 help 39 help
@@ -41,7 +41,7 @@ config SND_SOC_MPC5200_AC97
41 41
42config SND_MPC52xx_SOC_PCM030 42config SND_MPC52xx_SOC_PCM030
43 tristate "SoC AC97 Audio support for Phytec pcm030 and WM9712" 43 tristate "SoC AC97 Audio support for Phytec pcm030 and WM9712"
44 depends on PPC_MPC5200_SIMPLE && BROKEN 44 depends on PPC_MPC5200_SIMPLE
45 select SND_SOC_MPC5200_AC97 45 select SND_SOC_MPC5200_AC97
46 select SND_SOC_WM9712 46 select SND_SOC_WM9712
47 help 47 help
@@ -50,7 +50,7 @@ config SND_MPC52xx_SOC_PCM030
50 50
51config SND_MPC52xx_SOC_EFIKA 51config SND_MPC52xx_SOC_EFIKA
52 tristate "SoC AC97 Audio support for bbplan Efika and STAC9766" 52 tristate "SoC AC97 Audio support for bbplan Efika and STAC9766"
53 depends on PPC_EFIKA && BROKEN 53 depends on PPC_EFIKA
54 select SND_SOC_MPC5200_AC97 54 select SND_SOC_MPC5200_AC97
55 select SND_SOC_STAC9766 55 select SND_SOC_STAC9766
56 help 56 help
diff --git a/sound/soc/fsl/mpc5200_dma.c b/sound/soc/fsl/mpc5200_dma.c
index efec33a1c5bd..f0a2d4071998 100644
--- a/sound/soc/fsl/mpc5200_dma.c
+++ b/sound/soc/fsl/mpc5200_dma.c
@@ -456,6 +456,7 @@ int mpc5200_audio_dma_create(struct of_device *op)
456 return -ENODEV; 456 return -ENODEV;
457 457
458 spin_lock_init(&psc_dma->lock); 458 spin_lock_init(&psc_dma->lock);
459 mutex_init(&psc_dma->mutex);
459 psc_dma->id = be32_to_cpu(*prop); 460 psc_dma->id = be32_to_cpu(*prop);
460 psc_dma->irq = irq; 461 psc_dma->irq = irq;
461 psc_dma->psc_regs = regs; 462 psc_dma->psc_regs = regs;
diff --git a/sound/soc/fsl/mpc5200_dma.h b/sound/soc/fsl/mpc5200_dma.h
index 2000803f06a7..8d396bb9d9fe 100644
--- a/sound/soc/fsl/mpc5200_dma.h
+++ b/sound/soc/fsl/mpc5200_dma.h
@@ -55,6 +55,7 @@ struct psc_dma {
55 unsigned int irq; 55 unsigned int irq;
56 struct device *dev; 56 struct device *dev;
57 spinlock_t lock; 57 spinlock_t lock;
58 struct mutex mutex;
58 u32 sicr; 59 u32 sicr;
59 uint sysclk; 60 uint sysclk;
60 int imr; 61 int imr;
diff --git a/sound/soc/fsl/mpc5200_psc_ac97.c b/sound/soc/fsl/mpc5200_psc_ac97.c
index 794a247b3eb5..7eb549985d49 100644
--- a/sound/soc/fsl/mpc5200_psc_ac97.c
+++ b/sound/soc/fsl/mpc5200_psc_ac97.c
@@ -34,13 +34,20 @@ static unsigned short psc_ac97_read(struct snd_ac97 *ac97, unsigned short reg)
34 int status; 34 int status;
35 unsigned int val; 35 unsigned int val;
36 36
37 mutex_lock(&psc_dma->mutex);
38
37 /* Wait for command send status zero = ready */ 39 /* Wait for command send status zero = ready */
38 status = spin_event_timeout(!(in_be16(&psc_dma->psc_regs->sr_csr.status) & 40 status = spin_event_timeout(!(in_be16(&psc_dma->psc_regs->sr_csr.status) &
39 MPC52xx_PSC_SR_CMDSEND), 100, 0); 41 MPC52xx_PSC_SR_CMDSEND), 100, 0);
40 if (status == 0) { 42 if (status == 0) {
41 pr_err("timeout on ac97 bus (rdy)\n"); 43 pr_err("timeout on ac97 bus (rdy)\n");
44 mutex_unlock(&psc_dma->mutex);
42 return -ENODEV; 45 return -ENODEV;
43 } 46 }
47
48 /* Force clear the data valid bit */
49 in_be32(&psc_dma->psc_regs->ac97_data);
50
44 /* Send the read */ 51 /* Send the read */
45 out_be32(&psc_dma->psc_regs->ac97_cmd, (1<<31) | ((reg & 0x7f) << 24)); 52 out_be32(&psc_dma->psc_regs->ac97_cmd, (1<<31) | ((reg & 0x7f) << 24));
46 53
@@ -50,16 +57,19 @@ static unsigned short psc_ac97_read(struct snd_ac97 *ac97, unsigned short reg)
50 if (status == 0) { 57 if (status == 0) {
51 pr_err("timeout on ac97 read (val) %x\n", 58 pr_err("timeout on ac97 read (val) %x\n",
52 in_be16(&psc_dma->psc_regs->sr_csr.status)); 59 in_be16(&psc_dma->psc_regs->sr_csr.status));
60 mutex_unlock(&psc_dma->mutex);
53 return -ENODEV; 61 return -ENODEV;
54 } 62 }
55 /* Get the data */ 63 /* Get the data */
56 val = in_be32(&psc_dma->psc_regs->ac97_data); 64 val = in_be32(&psc_dma->psc_regs->ac97_data);
57 if (((val >> 24) & 0x7f) != reg) { 65 if (((val >> 24) & 0x7f) != reg) {
58 pr_err("reg echo error on ac97 read\n"); 66 pr_err("reg echo error on ac97 read\n");
67 mutex_unlock(&psc_dma->mutex);
59 return -ENODEV; 68 return -ENODEV;
60 } 69 }
61 val = (val >> 8) & 0xffff; 70 val = (val >> 8) & 0xffff;
62 71
72 mutex_unlock(&psc_dma->mutex);
63 return (unsigned short) val; 73 return (unsigned short) val;
64} 74}
65 75
@@ -68,16 +78,21 @@ static void psc_ac97_write(struct snd_ac97 *ac97,
68{ 78{
69 int status; 79 int status;
70 80
81 mutex_lock(&psc_dma->mutex);
82
71 /* Wait for command status zero = ready */ 83 /* Wait for command status zero = ready */
72 status = spin_event_timeout(!(in_be16(&psc_dma->psc_regs->sr_csr.status) & 84 status = spin_event_timeout(!(in_be16(&psc_dma->psc_regs->sr_csr.status) &
73 MPC52xx_PSC_SR_CMDSEND), 100, 0); 85 MPC52xx_PSC_SR_CMDSEND), 100, 0);
74 if (status == 0) { 86 if (status == 0) {
75 pr_err("timeout on ac97 bus (write)\n"); 87 pr_err("timeout on ac97 bus (write)\n");
76 return; 88 goto out;
77 } 89 }
78 /* Write data */ 90 /* Write data */
79 out_be32(&psc_dma->psc_regs->ac97_cmd, 91 out_be32(&psc_dma->psc_regs->ac97_cmd,
80 ((reg & 0x7f) << 24) | (val << 8)); 92 ((reg & 0x7f) << 24) | (val << 8));
93
94 out:
95 mutex_unlock(&psc_dma->mutex);
81} 96}
82 97
83static void psc_ac97_warm_reset(struct snd_ac97 *ac97) 98static void psc_ac97_warm_reset(struct snd_ac97 *ac97)
diff --git a/sound/soc/omap/omap-pcm.c b/sound/soc/omap/omap-pcm.c
index 6454e15f7d28..84a1950880eb 100644
--- a/sound/soc/omap/omap-pcm.c
+++ b/sound/soc/omap/omap-pcm.c
@@ -216,12 +216,15 @@ static snd_pcm_uframes_t omap_pcm_pointer(struct snd_pcm_substream *substream)
216 dma_addr_t ptr; 216 dma_addr_t ptr;
217 snd_pcm_uframes_t offset; 217 snd_pcm_uframes_t offset;
218 218
219 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) 219 if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) {
220 ptr = omap_get_dma_src_pos(prtd->dma_ch);
221 else
222 ptr = omap_get_dma_dst_pos(prtd->dma_ch); 220 ptr = omap_get_dma_dst_pos(prtd->dma_ch);
221 offset = bytes_to_frames(runtime, ptr - runtime->dma_addr);
222 } else if (!(cpu_is_omap1510())) {
223 ptr = omap_get_dma_src_pos(prtd->dma_ch);
224 offset = bytes_to_frames(runtime, ptr - runtime->dma_addr);
225 } else
226 offset = prtd->period_index * runtime->period_size;
223 227
224 offset = bytes_to_frames(runtime, ptr - runtime->dma_addr);
225 if (offset >= runtime->buffer_size) 228 if (offset >= runtime->buffer_size)
226 offset = 0; 229 offset = 0;
227 230
diff --git a/sound/soc/pxa/pxa2xx-i2s.c b/sound/soc/pxa/pxa2xx-i2s.c
index 4743e262895d..6b8f655d1ad8 100644
--- a/sound/soc/pxa/pxa2xx-i2s.c
+++ b/sound/soc/pxa/pxa2xx-i2s.c
@@ -167,6 +167,7 @@ static int pxa2xx_i2s_hw_params(struct snd_pcm_substream *substream,
167 167
168 BUG_ON(IS_ERR(clk_i2s)); 168 BUG_ON(IS_ERR(clk_i2s));
169 clk_enable(clk_i2s); 169 clk_enable(clk_i2s);
170 dai->private_data = dai;
170 pxa_i2s_wait(); 171 pxa_i2s_wait();
171 172
172 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) 173 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
@@ -255,7 +256,10 @@ static void pxa2xx_i2s_shutdown(struct snd_pcm_substream *substream,
255 if ((SACR1 & (SACR1_DREC | SACR1_DRPL)) == (SACR1_DREC | SACR1_DRPL)) { 256 if ((SACR1 & (SACR1_DREC | SACR1_DRPL)) == (SACR1_DREC | SACR1_DRPL)) {
256 SACR0 &= ~SACR0_ENB; 257 SACR0 &= ~SACR0_ENB;
257 pxa_i2s_wait(); 258 pxa_i2s_wait();
258 clk_disable(clk_i2s); 259 if (dai->private_data != NULL) {
260 clk_disable(clk_i2s);
261 dai->private_data = NULL;
262 }
259 } 263 }
260} 264}
261 265
@@ -336,6 +340,7 @@ static int pxa2xx_i2s_probe(struct platform_device *dev)
336 return PTR_ERR(clk_i2s); 340 return PTR_ERR(clk_i2s);
337 341
338 pxa_i2s_dai.dev = &dev->dev; 342 pxa_i2s_dai.dev = &dev->dev;
343 pxa_i2s_dai.private_data = NULL;
339 ret = snd_soc_register_dai(&pxa_i2s_dai); 344 ret = snd_soc_register_dai(&pxa_i2s_dai);
340 if (ret != 0) 345 if (ret != 0)
341 clk_put(clk_i2s); 346 clk_put(clk_i2s);
diff --git a/sound/sound_core.c b/sound/sound_core.c
index 12522e6913d9..a41f8b127f49 100644
--- a/sound/sound_core.c
+++ b/sound/sound_core.c
@@ -10,6 +10,8 @@
10#include <linux/module.h> 10#include <linux/module.h>
11#include <linux/device.h> 11#include <linux/device.h>
12#include <linux/err.h> 12#include <linux/err.h>
13#include <linux/kdev_t.h>
14#include <linux/major.h>
13#include <sound/core.h> 15#include <sound/core.h>
14 16
15#ifdef CONFIG_SOUND_OSS_CORE 17#ifdef CONFIG_SOUND_OSS_CORE
@@ -29,6 +31,8 @@ MODULE_LICENSE("GPL");
29 31
30static char *sound_nodename(struct device *dev) 32static char *sound_nodename(struct device *dev)
31{ 33{
34 if (MAJOR(dev->devt) == SOUND_MAJOR)
35 return NULL;
32 return kasprintf(GFP_KERNEL, "snd/%s", dev_name(dev)); 36 return kasprintf(GFP_KERNEL, "snd/%s", dev_name(dev));
33} 37}
34 38
@@ -104,7 +108,6 @@ module_exit(cleanup_soundcore);
104#include <linux/types.h> 108#include <linux/types.h>
105#include <linux/kernel.h> 109#include <linux/kernel.h>
106#include <linux/sound.h> 110#include <linux/sound.h>
107#include <linux/major.h>
108#include <linux/kmod.h> 111#include <linux/kmod.h>
109 112
110#define SOUND_STEP 16 113#define SOUND_STEP 16
diff --git a/sound/usb/Kconfig b/sound/usb/Kconfig
index 523aec188ccf..73525c048e7f 100644
--- a/sound/usb/Kconfig
+++ b/sound/usb/Kconfig
@@ -48,6 +48,7 @@ config SND_USB_CAIAQ
48 * Native Instruments Kore Controller 48 * Native Instruments Kore Controller
49 * Native Instruments Kore Controller 2 49 * Native Instruments Kore Controller 2
50 * Native Instruments Audio Kontrol 1 50 * Native Instruments Audio Kontrol 1
51 * Native Instruments Audio 2 DJ
51 * Native Instruments Audio 4 DJ 52 * Native Instruments Audio 4 DJ
52 * Native Instruments Audio 8 DJ 53 * Native Instruments Audio 8 DJ
53 * Native Instruments Guitar Rig Session I/O 54 * Native Instruments Guitar Rig Session I/O
diff --git a/sound/usb/caiaq/audio.c b/sound/usb/caiaq/audio.c
index 8f9b60c5d74c..121af0644fd9 100644
--- a/sound/usb/caiaq/audio.c
+++ b/sound/usb/caiaq/audio.c
@@ -646,6 +646,7 @@ int snd_usb_caiaq_audio_init(struct snd_usb_caiaqdev *dev)
646 case USB_ID(USB_VID_NATIVEINSTRUMENTS, USB_PID_GUITARRIGMOBILE): 646 case USB_ID(USB_VID_NATIVEINSTRUMENTS, USB_PID_GUITARRIGMOBILE):
647 dev->samplerates |= SNDRV_PCM_RATE_192000; 647 dev->samplerates |= SNDRV_PCM_RATE_192000;
648 /* fall thru */ 648 /* fall thru */
649 case USB_ID(USB_VID_NATIVEINSTRUMENTS, USB_PID_AUDIO2DJ):
649 case USB_ID(USB_VID_NATIVEINSTRUMENTS, USB_PID_AUDIO4DJ): 650 case USB_ID(USB_VID_NATIVEINSTRUMENTS, USB_PID_AUDIO4DJ):
650 case USB_ID(USB_VID_NATIVEINSTRUMENTS, USB_PID_AUDIO8DJ): 651 case USB_ID(USB_VID_NATIVEINSTRUMENTS, USB_PID_AUDIO8DJ):
651 dev->samplerates |= SNDRV_PCM_RATE_88200; 652 dev->samplerates |= SNDRV_PCM_RATE_88200;
diff --git a/sound/usb/caiaq/device.c b/sound/usb/caiaq/device.c
index 0e5db719de24..83e6c1312d47 100644
--- a/sound/usb/caiaq/device.c
+++ b/sound/usb/caiaq/device.c
@@ -35,13 +35,14 @@
35#include "input.h" 35#include "input.h"
36 36
37MODULE_AUTHOR("Daniel Mack <daniel@caiaq.de>"); 37MODULE_AUTHOR("Daniel Mack <daniel@caiaq.de>");
38MODULE_DESCRIPTION("caiaq USB audio, version 1.3.17"); 38MODULE_DESCRIPTION("caiaq USB audio, version 1.3.19");
39MODULE_LICENSE("GPL"); 39MODULE_LICENSE("GPL");
40MODULE_SUPPORTED_DEVICE("{{Native Instruments, RigKontrol2}," 40MODULE_SUPPORTED_DEVICE("{{Native Instruments, RigKontrol2},"
41 "{Native Instruments, RigKontrol3}," 41 "{Native Instruments, RigKontrol3},"
42 "{Native Instruments, Kore Controller}," 42 "{Native Instruments, Kore Controller},"
43 "{Native Instruments, Kore Controller 2}," 43 "{Native Instruments, Kore Controller 2},"
44 "{Native Instruments, Audio Kontrol 1}," 44 "{Native Instruments, Audio Kontrol 1},"
45 "{Native Instruments, Audio 2 DJ},"
45 "{Native Instruments, Audio 4 DJ}," 46 "{Native Instruments, Audio 4 DJ},"
46 "{Native Instruments, Audio 8 DJ}," 47 "{Native Instruments, Audio 8 DJ},"
47 "{Native Instruments, Session I/O}," 48 "{Native Instruments, Session I/O},"
@@ -121,6 +122,11 @@ static struct usb_device_id snd_usb_id_table[] = {
121 .idVendor = USB_VID_NATIVEINSTRUMENTS, 122 .idVendor = USB_VID_NATIVEINSTRUMENTS,
122 .idProduct = USB_PID_AUDIO4DJ 123 .idProduct = USB_PID_AUDIO4DJ
123 }, 124 },
125 {
126 .match_flags = USB_DEVICE_ID_MATCH_DEVICE,
127 .idVendor = USB_VID_NATIVEINSTRUMENTS,
128 .idProduct = USB_PID_AUDIO2DJ
129 },
124 { /* terminator */ } 130 { /* terminator */ }
125}; 131};
126 132
@@ -349,7 +355,9 @@ static void __devinit setup_card(struct snd_usb_caiaqdev *dev)
349 log("Unable to set up control system (ret=%d)\n", ret); 355 log("Unable to set up control system (ret=%d)\n", ret);
350} 356}
351 357
352static int create_card(struct usb_device* usb_dev, struct snd_card **cardp) 358static int create_card(struct usb_device *usb_dev,
359 struct usb_interface *intf,
360 struct snd_card **cardp)
353{ 361{
354 int devnum; 362 int devnum;
355 int err; 363 int err;
@@ -374,7 +382,7 @@ static int create_card(struct usb_device* usb_dev, struct snd_card **cardp)
374 dev->chip.usb_id = USB_ID(le16_to_cpu(usb_dev->descriptor.idVendor), 382 dev->chip.usb_id = USB_ID(le16_to_cpu(usb_dev->descriptor.idVendor),
375 le16_to_cpu(usb_dev->descriptor.idProduct)); 383 le16_to_cpu(usb_dev->descriptor.idProduct));
376 spin_lock_init(&dev->spinlock); 384 spin_lock_init(&dev->spinlock);
377 snd_card_set_dev(card, &usb_dev->dev); 385 snd_card_set_dev(card, &intf->dev);
378 386
379 *cardp = card; 387 *cardp = card;
380 return 0; 388 return 0;
@@ -461,7 +469,7 @@ static int __devinit snd_probe(struct usb_interface *intf,
461 struct snd_card *card; 469 struct snd_card *card;
462 struct usb_device *device = interface_to_usbdev(intf); 470 struct usb_device *device = interface_to_usbdev(intf);
463 471
464 ret = create_card(device, &card); 472 ret = create_card(device, intf, &card);
465 473
466 if (ret < 0) 474 if (ret < 0)
467 return ret; 475 return ret;
diff --git a/sound/usb/caiaq/device.h b/sound/usb/caiaq/device.h
index ece73514854e..44e3edf88bef 100644
--- a/sound/usb/caiaq/device.h
+++ b/sound/usb/caiaq/device.h
@@ -10,6 +10,7 @@
10#define USB_PID_KORECONTROLLER 0x4711 10#define USB_PID_KORECONTROLLER 0x4711
11#define USB_PID_KORECONTROLLER2 0x4712 11#define USB_PID_KORECONTROLLER2 0x4712
12#define USB_PID_AK1 0x0815 12#define USB_PID_AK1 0x0815
13#define USB_PID_AUDIO2DJ 0x041c
13#define USB_PID_AUDIO4DJ 0x0839 14#define USB_PID_AUDIO4DJ 0x0839
14#define USB_PID_AUDIO8DJ 0x1978 15#define USB_PID_AUDIO8DJ 0x1978
15#define USB_PID_SESSIONIO 0x1915 16#define USB_PID_SESSIONIO 0x1915
diff --git a/sound/usb/usbaudio.c b/sound/usb/usbaudio.c
index c7b902358b7b..44b9cdc8a83b 100644
--- a/sound/usb/usbaudio.c
+++ b/sound/usb/usbaudio.c
@@ -2661,7 +2661,7 @@ static int parse_audio_endpoints(struct snd_usb_audio *chip, int iface_no)
2661 struct usb_interface_descriptor *altsd; 2661 struct usb_interface_descriptor *altsd;
2662 int i, altno, err, stream; 2662 int i, altno, err, stream;
2663 int format; 2663 int format;
2664 struct audioformat *fp; 2664 struct audioformat *fp = NULL;
2665 unsigned char *fmt, *csep; 2665 unsigned char *fmt, *csep;
2666 int num; 2666 int num;
2667 2667
@@ -2734,6 +2734,18 @@ static int parse_audio_endpoints(struct snd_usb_audio *chip, int iface_no)
2734 continue; 2734 continue;
2735 } 2735 }
2736 2736
2737 /*
2738 * Blue Microphones workaround: The last altsetting is identical
2739 * with the previous one, except for a larger packet size, but
2740 * is actually a mislabeled two-channel setting; ignore it.
2741 */
2742 if (fmt[4] == 1 && fmt[5] == 2 && altno == 2 && num == 3 &&
2743 fp && fp->altsetting == 1 && fp->channels == 1 &&
2744 fp->format == SNDRV_PCM_FORMAT_S16_LE &&
2745 le16_to_cpu(get_endpoint(alts, 0)->wMaxPacketSize) ==
2746 fp->maxpacksize * 2)
2747 continue;
2748
2737 csep = snd_usb_find_desc(alts->endpoint[0].extra, alts->endpoint[0].extralen, NULL, USB_DT_CS_ENDPOINT); 2749 csep = snd_usb_find_desc(alts->endpoint[0].extra, alts->endpoint[0].extralen, NULL, USB_DT_CS_ENDPOINT);
2738 /* Creamware Noah has this descriptor after the 2nd endpoint */ 2750 /* Creamware Noah has this descriptor after the 2nd endpoint */
2739 if (!csep && altsd->bNumEndpoints >= 2) 2751 if (!csep && altsd->bNumEndpoints >= 2)
diff --git a/sound/usb/usbmixer.c b/sound/usb/usbmixer.c
index 4bd3a7a0edc1..ec9cdf986928 100644
--- a/sound/usb/usbmixer.c
+++ b/sound/usb/usbmixer.c
@@ -990,20 +990,35 @@ static void build_feature_ctl(struct mixer_build *state, unsigned char *desc,
990 break; 990 break;
991 } 991 }
992 992
993 /* quirk for UDA1321/N101 */ 993 /* volume control quirks */
994 /* note that detection between firmware 2.1.1.7 (N101) and later 2.1.1.21 */
995 /* is not very clear from datasheets */
996 /* I hope that the min value is -15360 for newer firmware --jk */
997 switch (state->chip->usb_id) { 994 switch (state->chip->usb_id) {
998 case USB_ID(0x0471, 0x0101): 995 case USB_ID(0x0471, 0x0101):
999 case USB_ID(0x0471, 0x0104): 996 case USB_ID(0x0471, 0x0104):
1000 case USB_ID(0x0471, 0x0105): 997 case USB_ID(0x0471, 0x0105):
1001 case USB_ID(0x0672, 0x1041): 998 case USB_ID(0x0672, 0x1041):
999 /* quirk for UDA1321/N101.
1000 * note that detection between firmware 2.1.1.7 (N101)
1001 * and later 2.1.1.21 is not very clear from datasheets.
1002 * I hope that the min value is -15360 for newer firmware --jk
1003 */
1002 if (!strcmp(kctl->id.name, "PCM Playback Volume") && 1004 if (!strcmp(kctl->id.name, "PCM Playback Volume") &&
1003 cval->min == -15616) { 1005 cval->min == -15616) {
1004 snd_printk(KERN_INFO "using volume control quirk for the UDA1321/N101 chip\n"); 1006 snd_printk(KERN_INFO
1007 "set volume quirk for UDA1321/N101 chip\n");
1005 cval->max = -256; 1008 cval->max = -256;
1006 } 1009 }
1010 break;
1011
1012 case USB_ID(0x046d, 0x09a4):
1013 if (!strcmp(kctl->id.name, "Mic Capture Volume")) {
1014 snd_printk(KERN_INFO
1015 "set volume quirk for QuickCam E3500\n");
1016 cval->min = 6080;
1017 cval->max = 8768;
1018 cval->res = 192;
1019 }
1020 break;
1021
1007 } 1022 }
1008 1023
1009 snd_printdd(KERN_INFO "[%d] FU [%s] ch = %d, val = %d/%d/%d\n", 1024 snd_printdd(KERN_INFO "[%d] FU [%s] ch = %d, val = %d/%d/%d\n",
diff --git a/sound/usb/usx2y/us122l.c b/sound/usb/usx2y/us122l.c
index a5aae9d67f31..fd44946ce4b3 100644
--- a/sound/usb/usx2y/us122l.c
+++ b/sound/usb/usx2y/us122l.c
@@ -514,7 +514,6 @@ static int usx2y_create_card(struct usb_device *device, struct snd_card **cardp)
514 US122L(card)->chip.dev->bus->busnum, 514 US122L(card)->chip.dev->bus->busnum,
515 US122L(card)->chip.dev->devnum 515 US122L(card)->chip.dev->devnum
516 ); 516 );
517 snd_card_set_dev(card, &device->dev);
518 *cardp = card; 517 *cardp = card;
519 return 0; 518 return 0;
520} 519}
@@ -531,6 +530,7 @@ static int us122l_usb_probe(struct usb_interface *intf,
531 if (err < 0) 530 if (err < 0)
532 return err; 531 return err;
533 532
533 snd_card_set_dev(card, &intf->dev);
534 if (!us122l_create_card(card)) { 534 if (!us122l_create_card(card)) {
535 snd_card_free(card); 535 snd_card_free(card);
536 return -EINVAL; 536 return -EINVAL;
diff --git a/sound/usb/usx2y/usbusx2y.c b/sound/usb/usx2y/usbusx2y.c
index 5ce0da23ee96..cb4bb8373ca2 100644
--- a/sound/usb/usx2y/usbusx2y.c
+++ b/sound/usb/usx2y/usbusx2y.c
@@ -364,7 +364,6 @@ static int usX2Y_create_card(struct usb_device *device, struct snd_card **cardp)
364 0,//us428(card)->usbmidi.ifnum, 364 0,//us428(card)->usbmidi.ifnum,
365 usX2Y(card)->chip.dev->bus->busnum, usX2Y(card)->chip.dev->devnum 365 usX2Y(card)->chip.dev->bus->busnum, usX2Y(card)->chip.dev->devnum
366 ); 366 );
367 snd_card_set_dev(card, &device->dev);
368 *cardp = card; 367 *cardp = card;
369 return 0; 368 return 0;
370} 369}
@@ -388,6 +387,7 @@ static int usX2Y_usb_probe(struct usb_device *device,
388 err = usX2Y_create_card(device, &card); 387 err = usX2Y_create_card(device, &card);
389 if (err < 0) 388 if (err < 0)
390 return err; 389 return err;
390 snd_card_set_dev(card, &intf->dev);
391 if ((err = usX2Y_hwdep_new(card, device)) < 0 || 391 if ((err = usX2Y_hwdep_new(card, device)) < 0 ||
392 (err = snd_card_register(card)) < 0) { 392 (err = snd_card_register(card)) < 0) {
393 snd_card_free(card); 393 snd_card_free(card);
diff --git a/sound/usb/usx2y/usbusx2yaudio.c b/sound/usb/usx2y/usbusx2yaudio.c
index dd1ab6177840..9efd27f6b52f 100644
--- a/sound/usb/usx2y/usbusx2yaudio.c
+++ b/sound/usb/usx2y/usbusx2yaudio.c
@@ -296,9 +296,10 @@ static void usX2Y_error_urb_status(struct usX2Ydev *usX2Y,
296static void usX2Y_error_sequence(struct usX2Ydev *usX2Y, 296static void usX2Y_error_sequence(struct usX2Ydev *usX2Y,
297 struct snd_usX2Y_substream *subs, struct urb *urb) 297 struct snd_usX2Y_substream *subs, struct urb *urb)
298{ 298{
299 snd_printk(KERN_ERR "Sequence Error!(hcd_frame=%i ep=%i%s;wait=%i,frame=%i).\n" 299 snd_printk(KERN_ERR
300 KERN_ERR "Most propably some urb of usb-frame %i is still missing.\n" 300"Sequence Error!(hcd_frame=%i ep=%i%s;wait=%i,frame=%i).\n"
301 KERN_ERR "Cause could be too long delays in usb-hcd interrupt handling.\n", 301"Most propably some urb of usb-frame %i is still missing.\n"
302"Cause could be too long delays in usb-hcd interrupt handling.\n",
302 usb_get_current_frame_number(usX2Y->chip.dev), 303 usb_get_current_frame_number(usX2Y->chip.dev),
303 subs->endpoint, usb_pipein(urb->pipe) ? "in" : "out", 304 subs->endpoint, usb_pipein(urb->pipe) ? "in" : "out",
304 usX2Y->wait_iso_frame, urb->start_frame, usX2Y->wait_iso_frame); 305 usX2Y->wait_iso_frame, urb->start_frame, usX2Y->wait_iso_frame);
diff --git a/tools/perf/CREDITS b/tools/perf/CREDITS
new file mode 100644
index 000000000000..c2ddcb3acbd0
--- /dev/null
+++ b/tools/perf/CREDITS
@@ -0,0 +1,30 @@
1Most of the infrastructure that 'perf' uses here has been reused
2from the Git project, as of version:
3
4 66996ec: Sync with 1.6.2.4
5
6Here is an (incomplete!) list of main contributors to those files
7in util/* and elsewhere:
8
9 Alex Riesen
10 Christian Couder
11 Dmitry Potapov
12 Jeff King
13 Johannes Schindelin
14 Johannes Sixt
15 Junio C Hamano
16 Linus Torvalds
17 Matthias Kestenholz
18 Michal Ostrowski
19 Miklos Vajna
20 Petr Baudis
21 Pierre Habouzit
22 René Scharfe
23 Samuel Tardieu
24 Shawn O. Pearce
25 Steffen Prohaska
26 Steve Haslam
27
28Thanks guys!
29
30The full history of the files can be found in the upstream Git commits.
diff --git a/tools/perf/Documentation/perf-record.txt b/tools/perf/Documentation/perf-record.txt
index 1dbc1eeb4c01..6be696b0a2bb 100644
--- a/tools/perf/Documentation/perf-record.txt
+++ b/tools/perf/Documentation/perf-record.txt
@@ -29,13 +29,67 @@ OPTIONS
29 Select the PMU event. Selection can be a symbolic event name 29 Select the PMU event. Selection can be a symbolic event name
30 (use 'perf list' to list all events) or a raw PMU 30 (use 'perf list' to list all events) or a raw PMU
31 event (eventsel+umask) in the form of rNNN where NNN is a 31 event (eventsel+umask) in the form of rNNN where NNN is a
32 hexadecimal event descriptor. 32 hexadecimal event descriptor.
33 33
34-a:: 34-a::
35 system-wide collection 35 System-wide collection.
36 36
37-l:: 37-l::
38 scale counter values 38 Scale counter values.
39
40-p::
41--pid=::
42 Record events on existing pid.
43
44-r::
45--realtime=::
46 Collect data with this RT SCHED_FIFO priority.
47-A::
48--append::
49 Append to the output file to do incremental profiling.
50
51-f::
52--force::
53 Overwrite existing data file.
54
55-c::
56--count=::
57 Event period to sample.
58
59-o::
60--output=::
61 Output file name.
62
63-i::
64--inherit::
65 Child tasks inherit counters.
66-F::
67--freq=::
68 Profile at this frequency.
69
70-m::
71--mmap-pages=::
72 Number of mmap data pages.
73
74-g::
75--call-graph::
76 Do call-graph (stack chain/backtrace) recording.
77
78-v::
79--verbose::
80 Be more verbose (show counter open errors, etc).
81
82-s::
83--stat::
84 Per thread counts.
85
86-d::
87--data::
88 Sample addresses.
89
90-n::
91--no-samples::
92 Don't sample.
39 93
40SEE ALSO 94SEE ALSO
41-------- 95--------
diff --git a/tools/perf/Documentation/perf-report.txt b/tools/perf/Documentation/perf-report.txt
index 52d3fc6846a9..e72e93110782 100644
--- a/tools/perf/Documentation/perf-report.txt
+++ b/tools/perf/Documentation/perf-report.txt
@@ -13,13 +13,40 @@ SYNOPSIS
13DESCRIPTION 13DESCRIPTION
14----------- 14-----------
15This command displays the performance counter profile information recorded 15This command displays the performance counter profile information recorded
16via perf report. 16via perf record.
17 17
18OPTIONS 18OPTIONS
19------- 19-------
20-i:: 20-i::
21--input=:: 21--input=::
22 Input file name. (default: perf.data) 22 Input file name. (default: perf.data)
23-d::
24--dsos=::
25 Only consider symbols in these dsos. CSV that understands
26 file://filename entries.
27-n
28--show-nr-samples
29 Show the number of samples for each symbol
30-C::
31--comms=::
32 Only consider symbols in these comms. CSV that understands
33 file://filename entries.
34-S::
35--symbols=::
36 Only consider these symbols. CSV that understands
37 file://filename entries.
38
39-w::
40--field-width=::
41 Force each column width to the provided list, for large terminal
42 readability.
43
44-t::
45--field-separator=::
46
47 Use a special separator character and don't pad with spaces, replacing
48 all occurances of this separator in symbol names (and other output)
49 with a '.' character, that thus it's the only non valid separator.
23 50
24SEE ALSO 51SEE ALSO
25-------- 52--------
diff --git a/tools/perf/Documentation/perf-stat.txt b/tools/perf/Documentation/perf-stat.txt
index c368a72721d7..0d74346d21ab 100644
--- a/tools/perf/Documentation/perf-stat.txt
+++ b/tools/perf/Documentation/perf-stat.txt
@@ -8,8 +8,8 @@ perf-stat - Run a command and gather performance counter statistics
8SYNOPSIS 8SYNOPSIS
9-------- 9--------
10[verse] 10[verse]
11'perf stat' [-e <EVENT> | --event=EVENT] [-l] [-a] <command> 11'perf stat' [-e <EVENT> | --event=EVENT] [-S] [-a] <command>
12'perf stat' [-e <EVENT> | --event=EVENT] [-l] [-a] -- <command> [<options>] 12'perf stat' [-e <EVENT> | --event=EVENT] [-S] [-a] -- <command> [<options>]
13 13
14DESCRIPTION 14DESCRIPTION
15----------- 15-----------
@@ -40,7 +40,7 @@ OPTIONS
40-a:: 40-a::
41 system-wide collection 41 system-wide collection
42 42
43-l:: 43-S::
44 scale counter values 44 scale counter values
45 45
46EXAMPLES 46EXAMPLES
diff --git a/tools/perf/Makefile b/tools/perf/Makefile
index 36d7eef49913..1916e44b9bb0 100644
--- a/tools/perf/Makefile
+++ b/tools/perf/Makefile
@@ -158,13 +158,15 @@ uname_P := $(shell sh -c 'uname -p 2>/dev/null || echo not')
158uname_V := $(shell sh -c 'uname -v 2>/dev/null || echo not') 158uname_V := $(shell sh -c 'uname -v 2>/dev/null || echo not')
159 159
160# If we're on a 64-bit kernel, use -m64 160# If we're on a 64-bit kernel, use -m64
161ifneq ($(patsubst %64,%,$(uname_M)),$(uname_M)) 161ifndef NO_64BIT
162 M64 := -m64 162 ifneq ($(patsubst %64,%,$(uname_M)),$(uname_M))
163 M64 := -m64
164 endif
163endif 165endif
164 166
165# CFLAGS and LDFLAGS are for the users to override from the command line. 167# CFLAGS and LDFLAGS are for the users to override from the command line.
166 168
167CFLAGS = $(M64) -ggdb3 -Wall -Wstrict-prototypes -Wmissing-declarations -Wmissing-prototypes -std=gnu99 -Wdeclaration-after-statement -Werror -O6 169CFLAGS = $(M64) -ggdb3 -Wall -Wextra -Wstrict-prototypes -Wmissing-declarations -Wmissing-prototypes -std=gnu99 -Wdeclaration-after-statement -Werror -O6
168LDFLAGS = -lpthread -lrt -lelf -lm 170LDFLAGS = -lpthread -lrt -lelf -lm
169ALL_CFLAGS = $(CFLAGS) 171ALL_CFLAGS = $(CFLAGS)
170ALL_LDFLAGS = $(LDFLAGS) 172ALL_LDFLAGS = $(LDFLAGS)
@@ -223,7 +225,7 @@ SPARSE_FLAGS = -D__BIG_ENDIAN__ -D__powerpc__
223# Those must not be GNU-specific; they are shared with perl/ which may 225# Those must not be GNU-specific; they are shared with perl/ which may
224# be built by a different compiler. (Note that this is an artifact now 226# be built by a different compiler. (Note that this is an artifact now
225# but it still might be nice to keep that distinction.) 227# but it still might be nice to keep that distinction.)
226BASIC_CFLAGS = 228BASIC_CFLAGS = -Iutil/include
227BASIC_LDFLAGS = 229BASIC_LDFLAGS =
228 230
229# Guard against environment variables 231# Guard against environment variables
@@ -289,10 +291,11 @@ export PERL_PATH
289LIB_FILE=libperf.a 291LIB_FILE=libperf.a
290 292
291LIB_H += ../../include/linux/perf_counter.h 293LIB_H += ../../include/linux/perf_counter.h
294LIB_H += ../../include/linux/rbtree.h
295LIB_H += ../../include/linux/list.h
296LIB_H += util/include/linux/list.h
292LIB_H += perf.h 297LIB_H += perf.h
293LIB_H += types.h 298LIB_H += util/types.h
294LIB_H += util/list.h
295LIB_H += util/rbtree.h
296LIB_H += util/levenshtein.h 299LIB_H += util/levenshtein.h
297LIB_H += util/parse-options.h 300LIB_H += util/parse-options.h
298LIB_H += util/parse-events.h 301LIB_H += util/parse-events.h
@@ -301,9 +304,11 @@ LIB_H += util/util.h
301LIB_H += util/help.h 304LIB_H += util/help.h
302LIB_H += util/strbuf.h 305LIB_H += util/strbuf.h
303LIB_H += util/string.h 306LIB_H += util/string.h
307LIB_H += util/strlist.h
304LIB_H += util/run-command.h 308LIB_H += util/run-command.h
305LIB_H += util/sigchain.h 309LIB_H += util/sigchain.h
306LIB_H += util/symbol.h 310LIB_H += util/symbol.h
311LIB_H += util/module.h
307LIB_H += util/color.h 312LIB_H += util/color.h
308 313
309LIB_OBJS += util/abspath.o 314LIB_OBJS += util/abspath.o
@@ -322,12 +327,16 @@ LIB_OBJS += util/run-command.o
322LIB_OBJS += util/quote.o 327LIB_OBJS += util/quote.o
323LIB_OBJS += util/strbuf.o 328LIB_OBJS += util/strbuf.o
324LIB_OBJS += util/string.o 329LIB_OBJS += util/string.o
330LIB_OBJS += util/strlist.o
325LIB_OBJS += util/usage.o 331LIB_OBJS += util/usage.o
326LIB_OBJS += util/wrapper.o 332LIB_OBJS += util/wrapper.o
327LIB_OBJS += util/sigchain.o 333LIB_OBJS += util/sigchain.o
328LIB_OBJS += util/symbol.o 334LIB_OBJS += util/symbol.o
335LIB_OBJS += util/module.o
329LIB_OBJS += util/color.o 336LIB_OBJS += util/color.o
330LIB_OBJS += util/pager.o 337LIB_OBJS += util/pager.o
338LIB_OBJS += util/header.o
339LIB_OBJS += util/callchain.o
331 340
332BUILTIN_OBJS += builtin-annotate.o 341BUILTIN_OBJS += builtin-annotate.o
333BUILTIN_OBJS += builtin-help.o 342BUILTIN_OBJS += builtin-help.o
@@ -338,7 +347,6 @@ BUILTIN_OBJS += builtin-stat.o
338BUILTIN_OBJS += builtin-top.o 347BUILTIN_OBJS += builtin-top.o
339 348
340PERFLIBS = $(LIB_FILE) 349PERFLIBS = $(LIB_FILE)
341EXTLIBS =
342 350
343# 351#
344# Platform specific tweaks 352# Platform specific tweaks
@@ -367,6 +375,28 @@ ifeq ($(uname_S),Darwin)
367 PTHREAD_LIBS = 375 PTHREAD_LIBS =
368endif 376endif
369 377
378ifneq ($(shell sh -c "(echo '\#include <libelf.h>'; echo 'int main(void) { Elf * elf = elf_begin(0, ELF_C_READ_MMAP, 0); return (long)elf; }') | $(CC) -x c - $(ALL_CFLAGS) -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -o /dev/null $(ALL_LDFLAGS) > /dev/null 2>&1 && echo y"), y)
379 msg := $(error No libelf.h/libelf found, please install libelf-dev/elfutils-libelf-devel);
380endif
381
382ifdef NO_DEMANGLE
383 BASIC_CFLAGS += -DNO_DEMANGLE
384else
385
386 has_bfd := $(shell sh -c "(echo '\#include <bfd.h>'; echo 'int main(void) { bfd_demangle(0, 0, 0); return 0; }') | $(CC) -x c - $(ALL_CFLAGS) -o /dev/null $(ALL_LDFLAGS) -lbfd > /dev/null 2>&1 && echo y")
387
388 has_bfd_iberty := $(shell sh -c "(echo '\#include <bfd.h>'; echo 'int main(void) { bfd_demangle(0, 0, 0); return 0; }') | $(CC) -x c - $(ALL_CFLAGS) -o /dev/null $(ALL_LDFLAGS) -lbfd -liberty > /dev/null 2>&1 && echo y")
389
390 ifeq ($(has_bfd),y)
391 EXTLIBS += -lbfd
392 else ifeq ($(has_bfd_iberty),y)
393 EXTLIBS += -lbfd -liberty
394 else
395 msg := $(warning No bfd.h/libbfd found, install binutils-dev[el] to gain symbol demangling)
396 BASIC_CFLAGS += -DNO_DEMANGLE
397 endif
398endif
399
370ifndef CC_LD_DYNPATH 400ifndef CC_LD_DYNPATH
371 ifdef NO_R_TO_GCC_LINKER 401 ifdef NO_R_TO_GCC_LINKER
372 # Some gcc does not accept and pass -R to the linker to specify 402 # Some gcc does not accept and pass -R to the linker to specify
@@ -377,12 +407,6 @@ ifndef CC_LD_DYNPATH
377 endif 407 endif
378endif 408endif
379 409
380ifdef ZLIB_PATH
381 BASIC_CFLAGS += -I$(ZLIB_PATH)/include
382 EXTLIBS += -L$(ZLIB_PATH)/$(lib) $(CC_LD_DYNPATH)$(ZLIB_PATH)/$(lib)
383endif
384EXTLIBS += -lz
385
386ifdef NEEDS_SOCKET 410ifdef NEEDS_SOCKET
387 EXTLIBS += -lsocket 411 EXTLIBS += -lsocket
388endif 412endif
@@ -693,6 +717,9 @@ builtin-init-db.o: builtin-init-db.c PERF-CFLAGS
693util/config.o: util/config.c PERF-CFLAGS 717util/config.o: util/config.c PERF-CFLAGS
694 $(QUIET_CC)$(CC) -o $*.o -c $(ALL_CFLAGS) -DETC_PERFCONFIG='"$(ETC_PERFCONFIG_SQ)"' $< 718 $(QUIET_CC)$(CC) -o $*.o -c $(ALL_CFLAGS) -DETC_PERFCONFIG='"$(ETC_PERFCONFIG_SQ)"' $<
695 719
720util/rbtree.o: ../../lib/rbtree.c PERF-CFLAGS
721 $(QUIET_CC)$(CC) -o util/rbtree.o -c $(ALL_CFLAGS) -DETC_PERFCONFIG='"$(ETC_PERFCONFIG_SQ)"' $<
722
696perf-%$X: %.o $(PERFLIBS) 723perf-%$X: %.o $(PERFLIBS)
697 $(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) $(LIBS) 724 $(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) $(LIBS)
698 725
diff --git a/tools/perf/builtin-annotate.c b/tools/perf/builtin-annotate.c
index 7e58e3ad1508..1dba568e1941 100644
--- a/tools/perf/builtin-annotate.c
+++ b/tools/perf/builtin-annotate.c
@@ -10,9 +10,9 @@
10#include "util/util.h" 10#include "util/util.h"
11 11
12#include "util/color.h" 12#include "util/color.h"
13#include "util/list.h" 13#include <linux/list.h>
14#include "util/cache.h" 14#include "util/cache.h"
15#include "util/rbtree.h" 15#include <linux/rbtree.h>
16#include "util/symbol.h" 16#include "util/symbol.h"
17#include "util/string.h" 17#include "util/string.h"
18 18
@@ -25,10 +25,6 @@
25#define SHOW_USER 2 25#define SHOW_USER 2
26#define SHOW_HV 4 26#define SHOW_HV 4
27 27
28#define MIN_GREEN 0.5
29#define MIN_RED 5.0
30
31
32static char const *input_name = "perf.data"; 28static char const *input_name = "perf.data";
33static char *vmlinux = "vmlinux"; 29static char *vmlinux = "vmlinux";
34 30
@@ -43,6 +39,10 @@ static int dump_trace = 0;
43 39
44static int verbose; 40static int verbose;
45 41
42static int modules;
43
44static int full_paths;
45
46static int print_line; 46static int print_line;
47 47
48static unsigned long page_size; 48static unsigned long page_size;
@@ -74,20 +74,12 @@ struct fork_event {
74 u32 pid, ppid; 74 u32 pid, ppid;
75}; 75};
76 76
77struct period_event {
78 struct perf_event_header header;
79 u64 time;
80 u64 id;
81 u64 sample_period;
82};
83
84typedef union event_union { 77typedef union event_union {
85 struct perf_event_header header; 78 struct perf_event_header header;
86 struct ip_event ip; 79 struct ip_event ip;
87 struct mmap_event mmap; 80 struct mmap_event mmap;
88 struct comm_event comm; 81 struct comm_event comm;
89 struct fork_event fork; 82 struct fork_event fork;
90 struct period_event period;
91} event_t; 83} event_t;
92 84
93 85
@@ -160,7 +152,7 @@ static void dsos__fprintf(FILE *fp)
160 152
161static struct symbol *vdso__find_symbol(struct dso *dso, u64 ip) 153static struct symbol *vdso__find_symbol(struct dso *dso, u64 ip)
162{ 154{
163 return dso__find_symbol(kernel_dso, ip); 155 return dso__find_symbol(dso, ip);
164} 156}
165 157
166static int load_kernel(void) 158static int load_kernel(void)
@@ -171,8 +163,8 @@ static int load_kernel(void)
171 if (!kernel_dso) 163 if (!kernel_dso)
172 return -1; 164 return -1;
173 165
174 err = dso__load_kernel(kernel_dso, vmlinux, NULL, verbose); 166 err = dso__load_kernel(kernel_dso, vmlinux, NULL, verbose, modules);
175 if (err) { 167 if (err <= 0) {
176 dso__delete(kernel_dso); 168 dso__delete(kernel_dso);
177 kernel_dso = NULL; 169 kernel_dso = NULL;
178 } else 170 } else
@@ -203,7 +195,7 @@ static u64 map__map_ip(struct map *map, u64 ip)
203 return ip - map->start + map->pgoff; 195 return ip - map->start + map->pgoff;
204} 196}
205 197
206static u64 vdso__map_ip(struct map *map, u64 ip) 198static u64 vdso__map_ip(struct map *map __used, u64 ip)
207{ 199{
208 return ip; 200 return ip;
209} 201}
@@ -600,7 +592,7 @@ static LIST_HEAD(hist_entry__sort_list);
600 592
601static int sort_dimension__add(char *tok) 593static int sort_dimension__add(char *tok)
602{ 594{
603 int i; 595 unsigned int i;
604 596
605 for (i = 0; i < ARRAY_SIZE(sort_dimensions); i++) { 597 for (i = 0; i < ARRAY_SIZE(sort_dimensions); i++) {
606 struct sort_dimension *sd = &sort_dimensions[i]; 598 struct sort_dimension *sd = &sort_dimensions[i];
@@ -855,7 +847,7 @@ static unsigned long total = 0,
855 total_unknown = 0; 847 total_unknown = 0;
856 848
857static int 849static int
858process_overflow_event(event_t *event, unsigned long offset, unsigned long head) 850process_sample_event(event_t *event, unsigned long offset, unsigned long head)
859{ 851{
860 char level; 852 char level;
861 int show = 0; 853 int show = 0;
@@ -998,25 +990,12 @@ process_fork_event(event_t *event, unsigned long offset, unsigned long head)
998} 990}
999 991
1000static int 992static int
1001process_period_event(event_t *event, unsigned long offset, unsigned long head)
1002{
1003 dprintf("%p [%p]: PERF_EVENT_PERIOD: time:%Ld, id:%Ld: period:%Ld\n",
1004 (void *)(offset + head),
1005 (void *)(long)(event->header.size),
1006 event->period.time,
1007 event->period.id,
1008 event->period.sample_period);
1009
1010 return 0;
1011}
1012
1013static int
1014process_event(event_t *event, unsigned long offset, unsigned long head) 993process_event(event_t *event, unsigned long offset, unsigned long head)
1015{ 994{
1016 if (event->header.misc & PERF_EVENT_MISC_OVERFLOW)
1017 return process_overflow_event(event, offset, head);
1018
1019 switch (event->header.type) { 995 switch (event->header.type) {
996 case PERF_EVENT_SAMPLE:
997 return process_sample_event(event, offset, head);
998
1020 case PERF_EVENT_MMAP: 999 case PERF_EVENT_MMAP:
1021 return process_mmap_event(event, offset, head); 1000 return process_mmap_event(event, offset, head);
1022 1001
@@ -1025,9 +1004,6 @@ process_event(event_t *event, unsigned long offset, unsigned long head)
1025 1004
1026 case PERF_EVENT_FORK: 1005 case PERF_EVENT_FORK:
1027 return process_fork_event(event, offset, head); 1006 return process_fork_event(event, offset, head);
1028
1029 case PERF_EVENT_PERIOD:
1030 return process_period_event(event, offset, head);
1031 /* 1007 /*
1032 * We dont process them right now but they are fine: 1008 * We dont process them right now but they are fine:
1033 */ 1009 */
@@ -1043,24 +1019,6 @@ process_event(event_t *event, unsigned long offset, unsigned long head)
1043 return 0; 1019 return 0;
1044} 1020}
1045 1021
1046static char *get_color(double percent)
1047{
1048 char *color = PERF_COLOR_NORMAL;
1049
1050 /*
1051 * We color high-overhead entries in red, mid-overhead
1052 * entries in green - and keep the low overhead places
1053 * normal:
1054 */
1055 if (percent >= MIN_RED)
1056 color = PERF_COLOR_RED;
1057 else {
1058 if (percent > MIN_GREEN)
1059 color = PERF_COLOR_GREEN;
1060 }
1061 return color;
1062}
1063
1064static int 1022static int
1065parse_line(FILE *file, struct symbol *sym, u64 start, u64 len) 1023parse_line(FILE *file, struct symbol *sym, u64 start, u64 len)
1066{ 1024{
@@ -1069,7 +1027,7 @@ parse_line(FILE *file, struct symbol *sym, u64 start, u64 len)
1069 static const char *prev_color; 1027 static const char *prev_color;
1070 unsigned int offset; 1028 unsigned int offset;
1071 size_t line_len; 1029 size_t line_len;
1072 u64 line_ip; 1030 s64 line_ip;
1073 int ret; 1031 int ret;
1074 char *c; 1032 char *c;
1075 1033
@@ -1122,7 +1080,7 @@ parse_line(FILE *file, struct symbol *sym, u64 start, u64 len)
1122 } else if (sym->hist_sum) 1080 } else if (sym->hist_sum)
1123 percent = 100.0 * hits / sym->hist_sum; 1081 percent = 100.0 * hits / sym->hist_sum;
1124 1082
1125 color = get_color(percent); 1083 color = get_percent_color(percent);
1126 1084
1127 /* 1085 /*
1128 * Also color the filename and line if needed, with 1086 * Also color the filename and line if needed, with
@@ -1258,7 +1216,7 @@ static void print_summary(char *filename)
1258 1216
1259 sym_ext = rb_entry(node, struct sym_ext, node); 1217 sym_ext = rb_entry(node, struct sym_ext, node);
1260 percent = sym_ext->percent; 1218 percent = sym_ext->percent;
1261 color = get_color(percent); 1219 color = get_percent_color(percent);
1262 path = sym_ext->path; 1220 path = sym_ext->path;
1263 1221
1264 color_fprintf(stdout, color, " %7.2f %s", percent, path); 1222 color_fprintf(stdout, color, " %7.2f %s", percent, path);
@@ -1268,19 +1226,25 @@ static void print_summary(char *filename)
1268 1226
1269static void annotate_sym(struct dso *dso, struct symbol *sym) 1227static void annotate_sym(struct dso *dso, struct symbol *sym)
1270{ 1228{
1271 char *filename = dso->name; 1229 char *filename = dso->name, *d_filename;
1272 u64 start, end, len; 1230 u64 start, end, len;
1273 char command[PATH_MAX*2]; 1231 char command[PATH_MAX*2];
1274 FILE *file; 1232 FILE *file;
1275 1233
1276 if (!filename) 1234 if (!filename)
1277 return; 1235 return;
1278 if (dso == kernel_dso) 1236 if (sym->module)
1237 filename = sym->module->path;
1238 else if (dso == kernel_dso)
1279 filename = vmlinux; 1239 filename = vmlinux;
1280 1240
1281 start = sym->obj_start; 1241 start = sym->obj_start;
1282 if (!start) 1242 if (!start)
1283 start = sym->start; 1243 start = sym->start;
1244 if (full_paths)
1245 d_filename = filename;
1246 else
1247 d_filename = basename(filename);
1284 1248
1285 end = start + sym->end - sym->start + 1; 1249 end = start + sym->end - sym->start + 1;
1286 len = sym->end - sym->start; 1250 len = sym->end - sym->start;
@@ -1291,13 +1255,14 @@ static void annotate_sym(struct dso *dso, struct symbol *sym)
1291 } 1255 }
1292 1256
1293 printf("\n\n------------------------------------------------\n"); 1257 printf("\n\n------------------------------------------------\n");
1294 printf(" Percent | Source code & Disassembly of %s\n", filename); 1258 printf(" Percent | Source code & Disassembly of %s\n", d_filename);
1295 printf("------------------------------------------------\n"); 1259 printf("------------------------------------------------\n");
1296 1260
1297 if (verbose >= 2) 1261 if (verbose >= 2)
1298 printf("annotating [%p] %30s : [%p] %30s\n", dso, dso->name, sym, sym->name); 1262 printf("annotating [%p] %30s : [%p] %30s\n", dso, dso->name, sym, sym->name);
1299 1263
1300 sprintf(command, "objdump --start-address=0x%016Lx --stop-address=0x%016Lx -dS %s", (u64)start, (u64)end, filename); 1264 sprintf(command, "objdump --start-address=0x%016Lx --stop-address=0x%016Lx -dS %s|grep -v %s",
1265 (u64)start, (u64)end, filename, filename);
1301 1266
1302 if (verbose >= 3) 1267 if (verbose >= 3)
1303 printf("doing: %s\n", command); 1268 printf("doing: %s\n", command);
@@ -1428,7 +1393,7 @@ more:
1428 1393
1429 head += size; 1394 head += size;
1430 1395
1431 if (offset + head < stat.st_size) 1396 if (offset + head < (unsigned long)stat.st_size)
1432 goto more; 1397 goto more;
1433 1398
1434 rc = EXIT_SUCCESS; 1399 rc = EXIT_SUCCESS;
@@ -1472,8 +1437,12 @@ static const struct option options[] = {
1472 OPT_BOOLEAN('D', "dump-raw-trace", &dump_trace, 1437 OPT_BOOLEAN('D', "dump-raw-trace", &dump_trace,
1473 "dump raw trace in ASCII"), 1438 "dump raw trace in ASCII"),
1474 OPT_STRING('k', "vmlinux", &vmlinux, "file", "vmlinux pathname"), 1439 OPT_STRING('k', "vmlinux", &vmlinux, "file", "vmlinux pathname"),
1440 OPT_BOOLEAN('m', "modules", &modules,
1441 "load module symbols - WARNING: use only with -k and LIVE kernel"),
1475 OPT_BOOLEAN('l', "print-line", &print_line, 1442 OPT_BOOLEAN('l', "print-line", &print_line,
1476 "print matching source lines (may be slow)"), 1443 "print matching source lines (may be slow)"),
1444 OPT_BOOLEAN('P', "full-paths", &full_paths,
1445 "Don't shorten the displayed pathnames"),
1477 OPT_END() 1446 OPT_END()
1478}; 1447};
1479 1448
@@ -1492,7 +1461,7 @@ static void setup_sorting(void)
1492 free(str); 1461 free(str);
1493} 1462}
1494 1463
1495int cmd_annotate(int argc, const char **argv, const char *prefix) 1464int cmd_annotate(int argc, const char **argv, const char *prefix __used)
1496{ 1465{
1497 symbol__init(); 1466 symbol__init();
1498 1467
diff --git a/tools/perf/builtin-help.c b/tools/perf/builtin-help.c
index 0f32dc3f3c4c..2599d86a733b 100644
--- a/tools/perf/builtin-help.c
+++ b/tools/perf/builtin-help.c
@@ -3,6 +3,7 @@
3 * 3 *
4 * Builtin help command 4 * Builtin help command
5 */ 5 */
6#include "perf.h"
6#include "util/cache.h" 7#include "util/cache.h"
7#include "builtin.h" 8#include "builtin.h"
8#include "util/exec_cmd.h" 9#include "util/exec_cmd.h"
@@ -277,7 +278,7 @@ static struct cmdnames main_cmds, other_cmds;
277 278
278void list_common_cmds_help(void) 279void list_common_cmds_help(void)
279{ 280{
280 int i, longest = 0; 281 unsigned int i, longest = 0;
281 282
282 for (i = 0; i < ARRAY_SIZE(common_cmds); i++) { 283 for (i = 0; i < ARRAY_SIZE(common_cmds); i++) {
283 if (longest < strlen(common_cmds[i].name)) 284 if (longest < strlen(common_cmds[i].name))
@@ -415,9 +416,10 @@ static void show_html_page(const char *perf_cmd)
415 open_html(page_path.buf); 416 open_html(page_path.buf);
416} 417}
417 418
418int cmd_help(int argc, const char **argv, const char *prefix) 419int cmd_help(int argc, const char **argv, const char *prefix __used)
419{ 420{
420 const char *alias; 421 const char *alias;
422
421 load_command_list("perf-", &main_cmds, &other_cmds); 423 load_command_list("perf-", &main_cmds, &other_cmds);
422 424
423 perf_config(perf_help_config, NULL); 425 perf_config(perf_help_config, NULL);
diff --git a/tools/perf/builtin-list.c b/tools/perf/builtin-list.c
index fe60e37c96ef..f990fa8a35c9 100644
--- a/tools/perf/builtin-list.c
+++ b/tools/perf/builtin-list.c
@@ -13,7 +13,7 @@
13#include "util/parse-options.h" 13#include "util/parse-options.h"
14#include "util/parse-events.h" 14#include "util/parse-events.h"
15 15
16int cmd_list(int argc, const char **argv, const char *prefix) 16int cmd_list(int argc __used, const char **argv __used, const char *prefix __used)
17{ 17{
18 print_events(); 18 print_events();
19 return 0; 19 return 0;
diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c
index d7ebbd757543..90c98082af10 100644
--- a/tools/perf/builtin-record.c
+++ b/tools/perf/builtin-record.c
@@ -14,6 +14,8 @@
14#include "util/parse-events.h" 14#include "util/parse-events.h"
15#include "util/string.h" 15#include "util/string.h"
16 16
17#include "util/header.h"
18
17#include <unistd.h> 19#include <unistd.h>
18#include <sched.h> 20#include <sched.h>
19 21
@@ -39,6 +41,9 @@ static int force = 0;
39static int append_file = 0; 41static int append_file = 0;
40static int call_graph = 0; 42static int call_graph = 0;
41static int verbose = 0; 43static int verbose = 0;
44static int inherit_stat = 0;
45static int no_samples = 0;
46static int sample_address = 0;
42 47
43static long samples; 48static long samples;
44static struct timeval last_read; 49static struct timeval last_read;
@@ -52,7 +57,8 @@ static int nr_poll;
52static int nr_cpu; 57static int nr_cpu;
53 58
54static int file_new = 1; 59static int file_new = 1;
55static struct perf_file_header file_header; 60
61struct perf_header *header;
56 62
57struct mmap_event { 63struct mmap_event {
58 struct perf_event_header header; 64 struct perf_event_header header;
@@ -289,7 +295,7 @@ static void pid_synthesize_mmap_samples(pid_t pid)
289 while (1) { 295 while (1) {
290 char bf[BUFSIZ], *pbf = bf; 296 char bf[BUFSIZ], *pbf = bf;
291 struct mmap_event mmap_ev = { 297 struct mmap_event mmap_ev = {
292 .header.type = PERF_EVENT_MMAP, 298 .header = { .type = PERF_EVENT_MMAP },
293 }; 299 };
294 int n; 300 int n;
295 size_t size; 301 size_t size;
@@ -306,12 +312,15 @@ static void pid_synthesize_mmap_samples(pid_t pid)
306 continue; 312 continue;
307 pbf += n + 3; 313 pbf += n + 3;
308 if (*pbf == 'x') { /* vm_exec */ 314 if (*pbf == 'x') { /* vm_exec */
309 char *execname = strrchr(bf, ' '); 315 char *execname = strchr(bf, '/');
316
317 /* Catch VDSO */
318 if (execname == NULL)
319 execname = strstr(bf, "[vdso]");
310 320
311 if (execname == NULL || execname[1] != '/') 321 if (execname == NULL)
312 continue; 322 continue;
313 323
314 execname += 1;
315 size = strlen(execname); 324 size = strlen(execname);
316 execname[size - 1] = '\0'; /* Remove \n */ 325 execname[size - 1] = '\0'; /* Remove \n */
317 memcpy(mmap_ev.filename, execname, size); 326 memcpy(mmap_ev.filename, execname, size);
@@ -329,7 +338,7 @@ static void pid_synthesize_mmap_samples(pid_t pid)
329 fclose(fp); 338 fclose(fp);
330} 339}
331 340
332static void synthesize_samples(void) 341static void synthesize_all(void)
333{ 342{
334 DIR *proc; 343 DIR *proc;
335 struct dirent dirent, *next; 344 struct dirent dirent, *next;
@@ -353,10 +362,35 @@ static void synthesize_samples(void)
353 362
354static int group_fd; 363static int group_fd;
355 364
365static struct perf_header_attr *get_header_attr(struct perf_counter_attr *a, int nr)
366{
367 struct perf_header_attr *h_attr;
368
369 if (nr < header->attrs) {
370 h_attr = header->attr[nr];
371 } else {
372 h_attr = perf_header_attr__new(a);
373 perf_header__add_attr(header, h_attr);
374 }
375
376 return h_attr;
377}
378
356static void create_counter(int counter, int cpu, pid_t pid) 379static void create_counter(int counter, int cpu, pid_t pid)
357{ 380{
358 struct perf_counter_attr *attr = attrs + counter; 381 struct perf_counter_attr *attr = attrs + counter;
359 int track = 1; 382 struct perf_header_attr *h_attr;
383 int track = !counter; /* only the first counter needs these */
384 struct {
385 u64 count;
386 u64 time_enabled;
387 u64 time_running;
388 u64 id;
389 } read_data;
390
391 attr->read_format = PERF_FORMAT_TOTAL_TIME_ENABLED |
392 PERF_FORMAT_TOTAL_TIME_RUNNING |
393 PERF_FORMAT_ID;
360 394
361 attr->sample_type = PERF_SAMPLE_IP | PERF_SAMPLE_TID; 395 attr->sample_type = PERF_SAMPLE_IP | PERF_SAMPLE_TID;
362 396
@@ -366,25 +400,24 @@ static void create_counter(int counter, int cpu, pid_t pid)
366 attr->sample_freq = freq; 400 attr->sample_freq = freq;
367 } 401 }
368 402
403 if (no_samples)
404 attr->sample_freq = 0;
405
406 if (inherit_stat)
407 attr->inherit_stat = 1;
408
409 if (sample_address)
410 attr->sample_type |= PERF_SAMPLE_ADDR;
411
369 if (call_graph) 412 if (call_graph)
370 attr->sample_type |= PERF_SAMPLE_CALLCHAIN; 413 attr->sample_type |= PERF_SAMPLE_CALLCHAIN;
371 414
372 if (file_new) {
373 file_header.sample_type = attr->sample_type;
374 } else {
375 if (file_header.sample_type != attr->sample_type) {
376 fprintf(stderr, "incompatible append\n");
377 exit(-1);
378 }
379 }
380 415
381 attr->mmap = track; 416 attr->mmap = track;
382 attr->comm = track; 417 attr->comm = track;
383 attr->inherit = (cpu < 0) && inherit; 418 attr->inherit = (cpu < 0) && inherit;
384 attr->disabled = 1; 419 attr->disabled = 1;
385 420
386 track = 0; /* only the first counter needs these */
387
388try_again: 421try_again:
389 fd[nr_cpu][counter] = sys_perf_counter_open(attr, pid, cpu, group_fd, 0); 422 fd[nr_cpu][counter] = sys_perf_counter_open(attr, pid, cpu, group_fd, 0);
390 423
@@ -415,6 +448,22 @@ try_again:
415 exit(-1); 448 exit(-1);
416 } 449 }
417 450
451 h_attr = get_header_attr(attr, counter);
452
453 if (!file_new) {
454 if (memcmp(&h_attr->attr, attr, sizeof(*attr))) {
455 fprintf(stderr, "incompatible append\n");
456 exit(-1);
457 }
458 }
459
460 if (read(fd[nr_cpu][counter], &read_data, sizeof(read_data)) == -1) {
461 perror("Unable to read perf file descriptor\n");
462 exit(-1);
463 }
464
465 perf_header_attr__add_id(h_attr, read_data.id);
466
418 assert(fd[nr_cpu][counter] >= 0); 467 assert(fd[nr_cpu][counter] >= 0);
419 fcntl(fd[nr_cpu][counter], F_SETFL, O_NONBLOCK); 468 fcntl(fd[nr_cpu][counter], F_SETFL, O_NONBLOCK);
420 469
@@ -445,11 +494,6 @@ static void open_counters(int cpu, pid_t pid)
445{ 494{
446 int counter; 495 int counter;
447 496
448 if (pid > 0) {
449 pid_synthesize_comm_event(pid, 0);
450 pid_synthesize_mmap_samples(pid);
451 }
452
453 group_fd = -1; 497 group_fd = -1;
454 for (counter = 0; counter < nr_counters; counter++) 498 for (counter = 0; counter < nr_counters; counter++)
455 create_counter(counter, cpu, pid); 499 create_counter(counter, cpu, pid);
@@ -459,17 +503,16 @@ static void open_counters(int cpu, pid_t pid)
459 503
460static void atexit_header(void) 504static void atexit_header(void)
461{ 505{
462 file_header.data_size += bytes_written; 506 header->data_size += bytes_written;
463 507
464 if (pwrite(output, &file_header, sizeof(file_header), 0) == -1) 508 perf_header__write(header, output);
465 perror("failed to write on file headers");
466} 509}
467 510
468static int __cmd_record(int argc, const char **argv) 511static int __cmd_record(int argc, const char **argv)
469{ 512{
470 int i, counter; 513 int i, counter;
471 struct stat st; 514 struct stat st;
472 pid_t pid; 515 pid_t pid = 0;
473 int flags; 516 int flags;
474 int ret; 517 int ret;
475 518
@@ -500,22 +543,31 @@ static int __cmd_record(int argc, const char **argv)
500 exit(-1); 543 exit(-1);
501 } 544 }
502 545
503 if (!file_new) { 546 if (!file_new)
504 if (read(output, &file_header, sizeof(file_header)) == -1) { 547 header = perf_header__read(output);
505 perror("failed to read file headers"); 548 else
506 exit(-1); 549 header = perf_header__new();
507 }
508
509 lseek(output, file_header.data_size, SEEK_CUR);
510 }
511 550
512 atexit(atexit_header); 551 atexit(atexit_header);
513 552
514 if (!system_wide) { 553 if (!system_wide) {
515 open_counters(-1, target_pid != -1 ? target_pid : getpid()); 554 pid = target_pid;
555 if (pid == -1)
556 pid = getpid();
557
558 open_counters(-1, pid);
516 } else for (i = 0; i < nr_cpus; i++) 559 } else for (i = 0; i < nr_cpus; i++)
517 open_counters(i, target_pid); 560 open_counters(i, target_pid);
518 561
562 if (file_new)
563 perf_header__write(header, output);
564
565 if (!system_wide) {
566 pid_synthesize_comm_event(pid, 0);
567 pid_synthesize_mmap_samples(pid);
568 } else
569 synthesize_all();
570
519 if (target_pid == -1 && argc) { 571 if (target_pid == -1 && argc) {
520 pid = fork(); 572 pid = fork();
521 if (pid < 0) 573 if (pid < 0)
@@ -539,10 +591,7 @@ static int __cmd_record(int argc, const char **argv)
539 } 591 }
540 } 592 }
541 593
542 if (system_wide) 594 for (;;) {
543 synthesize_samples();
544
545 while (!done) {
546 int hits = samples; 595 int hits = samples;
547 596
548 for (i = 0; i < nr_cpu; i++) { 597 for (i = 0; i < nr_cpu; i++) {
@@ -550,8 +599,11 @@ static int __cmd_record(int argc, const char **argv)
550 mmap_read(&mmap_array[i][counter]); 599 mmap_read(&mmap_array[i][counter]);
551 } 600 }
552 601
553 if (hits == samples) 602 if (hits == samples) {
603 if (done)
604 break;
554 ret = poll(event_array, nr_poll, 100); 605 ret = poll(event_array, nr_poll, 100);
606 }
555 } 607 }
556 608
557 /* 609 /*
@@ -600,14 +652,21 @@ static const struct option options[] = {
600 "do call-graph (stack chain/backtrace) recording"), 652 "do call-graph (stack chain/backtrace) recording"),
601 OPT_BOOLEAN('v', "verbose", &verbose, 653 OPT_BOOLEAN('v', "verbose", &verbose,
602 "be more verbose (show counter open errors, etc)"), 654 "be more verbose (show counter open errors, etc)"),
655 OPT_BOOLEAN('s', "stat", &inherit_stat,
656 "per thread counts"),
657 OPT_BOOLEAN('d', "data", &sample_address,
658 "Sample addresses"),
659 OPT_BOOLEAN('n', "no-samples", &no_samples,
660 "don't sample"),
603 OPT_END() 661 OPT_END()
604}; 662};
605 663
606int cmd_record(int argc, const char **argv, const char *prefix) 664int cmd_record(int argc, const char **argv, const char *prefix __used)
607{ 665{
608 int counter; 666 int counter;
609 667
610 argc = parse_options(argc, argv, options, record_usage, 0); 668 argc = parse_options(argc, argv, options, record_usage,
669 PARSE_OPT_STOP_AT_NON_OPTION);
611 if (!argc && target_pid == -1 && !system_wide) 670 if (!argc && target_pid == -1 && !system_wide)
612 usage_with_options(record_usage, options); 671 usage_with_options(record_usage, options);
613 672
diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c
index 5eb5566f0c95..8cb58d68a006 100644
--- a/tools/perf/builtin-report.c
+++ b/tools/perf/builtin-report.c
@@ -10,13 +10,16 @@
10#include "util/util.h" 10#include "util/util.h"
11 11
12#include "util/color.h" 12#include "util/color.h"
13#include "util/list.h" 13#include <linux/list.h>
14#include "util/cache.h" 14#include "util/cache.h"
15#include "util/rbtree.h" 15#include <linux/rbtree.h>
16#include "util/symbol.h" 16#include "util/symbol.h"
17#include "util/string.h" 17#include "util/string.h"
18#include "util/callchain.h"
19#include "util/strlist.h"
18 20
19#include "perf.h" 21#include "perf.h"
22#include "util/header.h"
20 23
21#include "util/parse-options.h" 24#include "util/parse-options.h"
22#include "util/parse-events.h" 25#include "util/parse-events.h"
@@ -28,8 +31,12 @@
28static char const *input_name = "perf.data"; 31static char const *input_name = "perf.data";
29static char *vmlinux = NULL; 32static char *vmlinux = NULL;
30 33
31static char default_sort_order[] = "comm,dso"; 34static char default_sort_order[] = "comm,dso,symbol";
32static char *sort_order = default_sort_order; 35static char *sort_order = default_sort_order;
36static char *dso_list_str, *comm_list_str, *sym_list_str,
37 *col_width_list_str;
38static struct strlist *dso_list, *comm_list, *sym_list;
39static char *field_sep;
33 40
34static int input; 41static int input;
35static int show_mask = SHOW_KERNEL | SHOW_USER | SHOW_HV; 42static int show_mask = SHOW_KERNEL | SHOW_USER | SHOW_HV;
@@ -41,7 +48,10 @@ static int dump_trace = 0;
41static int verbose; 48static int verbose;
42#define eprintf(x...) do { if (verbose) fprintf(stderr, x); } while (0) 49#define eprintf(x...) do { if (verbose) fprintf(stderr, x); } while (0)
43 50
51static int modules;
52
44static int full_paths; 53static int full_paths;
54static int show_nr_samples;
45 55
46static unsigned long page_size; 56static unsigned long page_size;
47static unsigned long mmap_window = 32; 57static unsigned long mmap_window = 32;
@@ -52,6 +62,18 @@ static regex_t parent_regex;
52 62
53static int exclude_other = 1; 63static int exclude_other = 1;
54 64
65static char callchain_default_opt[] = "fractal,0.5";
66
67static int callchain;
68
69static
70struct callchain_param callchain_param = {
71 .mode = CHAIN_GRAPH_ABS,
72 .min_percent = 0.5
73};
74
75static u64 sample_type;
76
55struct ip_event { 77struct ip_event {
56 struct perf_event_header header; 78 struct perf_event_header header;
57 u64 ip; 79 u64 ip;
@@ -59,11 +81,6 @@ struct ip_event {
59 unsigned char __more_data[]; 81 unsigned char __more_data[];
60}; 82};
61 83
62struct ip_callchain {
63 u64 nr;
64 u64 ips[0];
65};
66
67struct mmap_event { 84struct mmap_event {
68 struct perf_event_header header; 85 struct perf_event_header header;
69 u32 pid, tid; 86 u32 pid, tid;
@@ -82,19 +99,20 @@ struct comm_event {
82struct fork_event { 99struct fork_event {
83 struct perf_event_header header; 100 struct perf_event_header header;
84 u32 pid, ppid; 101 u32 pid, ppid;
102 u32 tid, ptid;
85}; 103};
86 104
87struct period_event { 105struct lost_event {
88 struct perf_event_header header; 106 struct perf_event_header header;
89 u64 time;
90 u64 id; 107 u64 id;
91 u64 sample_period; 108 u64 lost;
92}; 109};
93 110
94struct lost_event { 111struct read_event {
95 struct perf_event_header header; 112 struct perf_event_header header;
96 u64 id; 113 u32 pid,tid;
97 u64 lost; 114 u64 value;
115 u64 format[3];
98}; 116};
99 117
100typedef union event_union { 118typedef union event_union {
@@ -103,13 +121,41 @@ typedef union event_union {
103 struct mmap_event mmap; 121 struct mmap_event mmap;
104 struct comm_event comm; 122 struct comm_event comm;
105 struct fork_event fork; 123 struct fork_event fork;
106 struct period_event period;
107 struct lost_event lost; 124 struct lost_event lost;
125 struct read_event read;
108} event_t; 126} event_t;
109 127
128static int repsep_fprintf(FILE *fp, const char *fmt, ...)
129{
130 int n;
131 va_list ap;
132
133 va_start(ap, fmt);
134 if (!field_sep)
135 n = vfprintf(fp, fmt, ap);
136 else {
137 char *bf = NULL;
138 n = vasprintf(&bf, fmt, ap);
139 if (n > 0) {
140 char *sep = bf;
141 while (1) {
142 sep = strchr(sep, *field_sep);
143 if (sep == NULL)
144 break;
145 *sep = '.';
146 }
147 }
148 fputs(bf, fp);
149 free(bf);
150 }
151 va_end(ap);
152 return n;
153}
154
110static LIST_HEAD(dsos); 155static LIST_HEAD(dsos);
111static struct dso *kernel_dso; 156static struct dso *kernel_dso;
112static struct dso *vdso; 157static struct dso *vdso;
158static struct dso *hypervisor_dso;
113 159
114static void dsos__add(struct dso *dso) 160static void dsos__add(struct dso *dso)
115{ 161{
@@ -165,7 +211,7 @@ static void dsos__fprintf(FILE *fp)
165 211
166static struct symbol *vdso__find_symbol(struct dso *dso, u64 ip) 212static struct symbol *vdso__find_symbol(struct dso *dso, u64 ip)
167{ 213{
168 return dso__find_symbol(kernel_dso, ip); 214 return dso__find_symbol(dso, ip);
169} 215}
170 216
171static int load_kernel(void) 217static int load_kernel(void)
@@ -176,8 +222,8 @@ static int load_kernel(void)
176 if (!kernel_dso) 222 if (!kernel_dso)
177 return -1; 223 return -1;
178 224
179 err = dso__load_kernel(kernel_dso, vmlinux, NULL, verbose); 225 err = dso__load_kernel(kernel_dso, vmlinux, NULL, verbose, modules);
180 if (err) { 226 if (err <= 0) {
181 dso__delete(kernel_dso); 227 dso__delete(kernel_dso);
182 kernel_dso = NULL; 228 kernel_dso = NULL;
183 } else 229 } else
@@ -191,6 +237,11 @@ static int load_kernel(void)
191 237
192 dsos__add(vdso); 238 dsos__add(vdso);
193 239
240 hypervisor_dso = dso__new("[hypervisor]", 0);
241 if (!hypervisor_dso)
242 return -1;
243 dsos__add(hypervisor_dso);
244
194 return err; 245 return err;
195} 246}
196 247
@@ -202,7 +253,7 @@ static int strcommon(const char *pathname)
202{ 253{
203 int n = 0; 254 int n = 0;
204 255
205 while (pathname[n] == cwd[n] && n < cwdlen) 256 while (n < cwdlen && pathname[n] == cwd[n])
206 ++n; 257 ++n;
207 258
208 return n; 259 return n;
@@ -222,14 +273,14 @@ static u64 map__map_ip(struct map *map, u64 ip)
222 return ip - map->start + map->pgoff; 273 return ip - map->start + map->pgoff;
223} 274}
224 275
225static u64 vdso__map_ip(struct map *map, u64 ip) 276static u64 vdso__map_ip(struct map *map __used, u64 ip)
226{ 277{
227 return ip; 278 return ip;
228} 279}
229 280
230static inline int is_anon_memory(const char *filename) 281static inline int is_anon_memory(const char *filename)
231{ 282{
232 return strcmp(filename, "//anon") == 0; 283 return strcmp(filename, "//anon") == 0;
233} 284}
234 285
235static struct map *map__new(struct mmap_event *event) 286static struct map *map__new(struct mmap_event *event)
@@ -332,12 +383,28 @@ static struct thread *thread__new(pid_t pid)
332 return self; 383 return self;
333} 384}
334 385
386static unsigned int dsos__col_width,
387 comms__col_width,
388 threads__col_width;
389
335static int thread__set_comm(struct thread *self, const char *comm) 390static int thread__set_comm(struct thread *self, const char *comm)
336{ 391{
337 if (self->comm) 392 if (self->comm)
338 free(self->comm); 393 free(self->comm);
339 self->comm = strdup(comm); 394 self->comm = strdup(comm);
340 return self->comm ? 0 : -ENOMEM; 395 if (!self->comm)
396 return -ENOMEM;
397
398 if (!col_width_list_str && !field_sep &&
399 (!comm_list || strlist__has_entry(comm_list, comm))) {
400 unsigned int slen = strlen(comm);
401 if (slen > comms__col_width) {
402 comms__col_width = slen;
403 threads__col_width = slen + 6;
404 }
405 }
406
407 return 0;
341} 408}
342 409
343static size_t thread__fprintf(struct thread *self, FILE *fp) 410static size_t thread__fprintf(struct thread *self, FILE *fp)
@@ -400,9 +467,27 @@ static void thread__insert_map(struct thread *self, struct map *map)
400 467
401 list_for_each_entry_safe(pos, tmp, &self->maps, node) { 468 list_for_each_entry_safe(pos, tmp, &self->maps, node) {
402 if (map__overlap(pos, map)) { 469 if (map__overlap(pos, map)) {
403 list_del_init(&pos->node); 470 if (verbose >= 2) {
404 /* XXX leaks dsos */ 471 printf("overlapping maps:\n");
405 free(pos); 472 map__fprintf(map, stdout);
473 map__fprintf(pos, stdout);
474 }
475
476 if (map->start <= pos->start && map->end > pos->start)
477 pos->start = map->end;
478
479 if (map->end >= pos->end && map->start < pos->end)
480 pos->end = map->start;
481
482 if (verbose >= 2) {
483 printf("after collision:\n");
484 map__fprintf(pos, stdout);
485 }
486
487 if (pos->start >= pos->end) {
488 list_del_init(&pos->node);
489 free(pos);
490 }
406 } 491 }
407 } 492 }
408 493
@@ -464,17 +549,19 @@ static size_t threads__fprintf(FILE *fp)
464static struct rb_root hist; 549static struct rb_root hist;
465 550
466struct hist_entry { 551struct hist_entry {
467 struct rb_node rb_node; 552 struct rb_node rb_node;
468 553
469 struct thread *thread; 554 struct thread *thread;
470 struct map *map; 555 struct map *map;
471 struct dso *dso; 556 struct dso *dso;
472 struct symbol *sym; 557 struct symbol *sym;
473 struct symbol *parent; 558 struct symbol *parent;
474 u64 ip; 559 u64 ip;
475 char level; 560 char level;
476 561 struct callchain_node callchain;
477 u64 count; 562 struct rb_root sorted_chain;
563
564 u64 count;
478}; 565};
479 566
480/* 567/*
@@ -488,7 +575,9 @@ struct sort_entry {
488 575
489 int64_t (*cmp)(struct hist_entry *, struct hist_entry *); 576 int64_t (*cmp)(struct hist_entry *, struct hist_entry *);
490 int64_t (*collapse)(struct hist_entry *, struct hist_entry *); 577 int64_t (*collapse)(struct hist_entry *, struct hist_entry *);
491 size_t (*print)(FILE *fp, struct hist_entry *); 578 size_t (*print)(FILE *fp, struct hist_entry *, unsigned int width);
579 unsigned int *width;
580 bool elide;
492}; 581};
493 582
494static int64_t cmp_null(void *l, void *r) 583static int64_t cmp_null(void *l, void *r)
@@ -510,15 +599,17 @@ sort__thread_cmp(struct hist_entry *left, struct hist_entry *right)
510} 599}
511 600
512static size_t 601static size_t
513sort__thread_print(FILE *fp, struct hist_entry *self) 602sort__thread_print(FILE *fp, struct hist_entry *self, unsigned int width)
514{ 603{
515 return fprintf(fp, "%16s:%5d", self->thread->comm ?: "", self->thread->pid); 604 return repsep_fprintf(fp, "%*s:%5d", width - 6,
605 self->thread->comm ?: "", self->thread->pid);
516} 606}
517 607
518static struct sort_entry sort_thread = { 608static struct sort_entry sort_thread = {
519 .header = " Command: Pid", 609 .header = "Command: Pid",
520 .cmp = sort__thread_cmp, 610 .cmp = sort__thread_cmp,
521 .print = sort__thread_print, 611 .print = sort__thread_print,
612 .width = &threads__col_width,
522}; 613};
523 614
524/* --sort comm */ 615/* --sort comm */
@@ -542,16 +633,17 @@ sort__comm_collapse(struct hist_entry *left, struct hist_entry *right)
542} 633}
543 634
544static size_t 635static size_t
545sort__comm_print(FILE *fp, struct hist_entry *self) 636sort__comm_print(FILE *fp, struct hist_entry *self, unsigned int width)
546{ 637{
547 return fprintf(fp, "%16s", self->thread->comm); 638 return repsep_fprintf(fp, "%*s", width, self->thread->comm);
548} 639}
549 640
550static struct sort_entry sort_comm = { 641static struct sort_entry sort_comm = {
551 .header = " Command", 642 .header = "Command",
552 .cmp = sort__comm_cmp, 643 .cmp = sort__comm_cmp,
553 .collapse = sort__comm_collapse, 644 .collapse = sort__comm_collapse,
554 .print = sort__comm_print, 645 .print = sort__comm_print,
646 .width = &comms__col_width,
555}; 647};
556 648
557/* --sort dso */ 649/* --sort dso */
@@ -569,18 +661,19 @@ sort__dso_cmp(struct hist_entry *left, struct hist_entry *right)
569} 661}
570 662
571static size_t 663static size_t
572sort__dso_print(FILE *fp, struct hist_entry *self) 664sort__dso_print(FILE *fp, struct hist_entry *self, unsigned int width)
573{ 665{
574 if (self->dso) 666 if (self->dso)
575 return fprintf(fp, "%-25s", self->dso->name); 667 return repsep_fprintf(fp, "%-*s", width, self->dso->name);
576 668
577 return fprintf(fp, "%016llx ", (u64)self->ip); 669 return repsep_fprintf(fp, "%*llx", width, (u64)self->ip);
578} 670}
579 671
580static struct sort_entry sort_dso = { 672static struct sort_entry sort_dso = {
581 .header = "Shared Object ", 673 .header = "Shared Object",
582 .cmp = sort__dso_cmp, 674 .cmp = sort__dso_cmp,
583 .print = sort__dso_print, 675 .print = sort__dso_print,
676 .width = &dsos__col_width,
584}; 677};
585 678
586/* --sort symbol */ 679/* --sort symbol */
@@ -600,18 +693,22 @@ sort__sym_cmp(struct hist_entry *left, struct hist_entry *right)
600} 693}
601 694
602static size_t 695static size_t
603sort__sym_print(FILE *fp, struct hist_entry *self) 696sort__sym_print(FILE *fp, struct hist_entry *self, unsigned int width __used)
604{ 697{
605 size_t ret = 0; 698 size_t ret = 0;
606 699
607 if (verbose) 700 if (verbose)
608 ret += fprintf(fp, "%#018llx ", (u64)self->ip); 701 ret += repsep_fprintf(fp, "%#018llx ", (u64)self->ip);
609 702
703 ret += repsep_fprintf(fp, "[%c] ", self->level);
610 if (self->sym) { 704 if (self->sym) {
611 ret += fprintf(fp, "[%c] %s", 705 ret += repsep_fprintf(fp, "%s", self->sym->name);
612 self->dso == kernel_dso ? 'k' : '.', self->sym->name); 706
707 if (self->sym->module)
708 ret += repsep_fprintf(fp, "\t[%s]",
709 self->sym->module->name);
613 } else { 710 } else {
614 ret += fprintf(fp, "%#016llx", (u64)self->ip); 711 ret += repsep_fprintf(fp, "%#016llx", (u64)self->ip);
615 } 712 }
616 713
617 return ret; 714 return ret;
@@ -638,19 +735,19 @@ sort__parent_cmp(struct hist_entry *left, struct hist_entry *right)
638} 735}
639 736
640static size_t 737static size_t
641sort__parent_print(FILE *fp, struct hist_entry *self) 738sort__parent_print(FILE *fp, struct hist_entry *self, unsigned int width)
642{ 739{
643 size_t ret = 0; 740 return repsep_fprintf(fp, "%-*s", width,
644 741 self->parent ? self->parent->name : "[other]");
645 ret += fprintf(fp, "%-20s", self->parent ? self->parent->name : "[other]");
646
647 return ret;
648} 742}
649 743
744static unsigned int parent_symbol__col_width;
745
650static struct sort_entry sort_parent = { 746static struct sort_entry sort_parent = {
651 .header = "Parent symbol ", 747 .header = "Parent symbol",
652 .cmp = sort__parent_cmp, 748 .cmp = sort__parent_cmp,
653 .print = sort__parent_print, 749 .print = sort__parent_print,
750 .width = &parent_symbol__col_width,
654}; 751};
655 752
656static int sort__need_collapse = 0; 753static int sort__need_collapse = 0;
@@ -674,7 +771,7 @@ static LIST_HEAD(hist_entry__sort_list);
674 771
675static int sort_dimension__add(char *tok) 772static int sort_dimension__add(char *tok)
676{ 773{
677 int i; 774 unsigned int i;
678 775
679 for (i = 0; i < ARRAY_SIZE(sort_dimensions); i++) { 776 for (i = 0; i < ARRAY_SIZE(sort_dimensions); i++) {
680 struct sort_dimension *sd = &sort_dimensions[i]; 777 struct sort_dimension *sd = &sort_dimensions[i];
@@ -744,6 +841,167 @@ hist_entry__collapse(struct hist_entry *left, struct hist_entry *right)
744 return cmp; 841 return cmp;
745} 842}
746 843
844static size_t ipchain__fprintf_graph_line(FILE *fp, int depth, int depth_mask)
845{
846 int i;
847 size_t ret = 0;
848
849 ret += fprintf(fp, "%s", " ");
850
851 for (i = 0; i < depth; i++)
852 if (depth_mask & (1 << i))
853 ret += fprintf(fp, "| ");
854 else
855 ret += fprintf(fp, " ");
856
857 ret += fprintf(fp, "\n");
858
859 return ret;
860}
861static size_t
862ipchain__fprintf_graph(FILE *fp, struct callchain_list *chain, int depth,
863 int depth_mask, int count, u64 total_samples,
864 int hits)
865{
866 int i;
867 size_t ret = 0;
868
869 ret += fprintf(fp, "%s", " ");
870 for (i = 0; i < depth; i++) {
871 if (depth_mask & (1 << i))
872 ret += fprintf(fp, "|");
873 else
874 ret += fprintf(fp, " ");
875 if (!count && i == depth - 1) {
876 double percent;
877
878 percent = hits * 100.0 / total_samples;
879 ret += percent_color_fprintf(fp, "--%2.2f%%-- ", percent);
880 } else
881 ret += fprintf(fp, "%s", " ");
882 }
883 if (chain->sym)
884 ret += fprintf(fp, "%s\n", chain->sym->name);
885 else
886 ret += fprintf(fp, "%p\n", (void *)(long)chain->ip);
887
888 return ret;
889}
890
891static size_t
892callchain__fprintf_graph(FILE *fp, struct callchain_node *self,
893 u64 total_samples, int depth, int depth_mask)
894{
895 struct rb_node *node, *next;
896 struct callchain_node *child;
897 struct callchain_list *chain;
898 int new_depth_mask = depth_mask;
899 u64 new_total;
900 size_t ret = 0;
901 int i;
902
903 if (callchain_param.mode == CHAIN_GRAPH_REL)
904 new_total = self->cumul_hit;
905 else
906 new_total = total_samples;
907
908 node = rb_first(&self->rb_root);
909 while (node) {
910 child = rb_entry(node, struct callchain_node, rb_node);
911
912 /*
913 * The depth mask manages the output of pipes that show
914 * the depth. We don't want to keep the pipes of the current
915 * level for the last child of this depth
916 */
917 next = rb_next(node);
918 if (!next)
919 new_depth_mask &= ~(1 << (depth - 1));
920
921 /*
922 * But we keep the older depth mask for the line seperator
923 * to keep the level link until we reach the last child
924 */
925 ret += ipchain__fprintf_graph_line(fp, depth, depth_mask);
926 i = 0;
927 list_for_each_entry(chain, &child->val, list) {
928 if (chain->ip >= PERF_CONTEXT_MAX)
929 continue;
930 ret += ipchain__fprintf_graph(fp, chain, depth,
931 new_depth_mask, i++,
932 new_total,
933 child->cumul_hit);
934 }
935 ret += callchain__fprintf_graph(fp, child, new_total,
936 depth + 1,
937 new_depth_mask | (1 << depth));
938 node = next;
939 }
940
941 return ret;
942}
943
944static size_t
945callchain__fprintf_flat(FILE *fp, struct callchain_node *self,
946 u64 total_samples)
947{
948 struct callchain_list *chain;
949 size_t ret = 0;
950
951 if (!self)
952 return 0;
953
954 ret += callchain__fprintf_flat(fp, self->parent, total_samples);
955
956
957 list_for_each_entry(chain, &self->val, list) {
958 if (chain->ip >= PERF_CONTEXT_MAX)
959 continue;
960 if (chain->sym)
961 ret += fprintf(fp, " %s\n", chain->sym->name);
962 else
963 ret += fprintf(fp, " %p\n",
964 (void *)(long)chain->ip);
965 }
966
967 return ret;
968}
969
970static size_t
971hist_entry_callchain__fprintf(FILE *fp, struct hist_entry *self,
972 u64 total_samples)
973{
974 struct rb_node *rb_node;
975 struct callchain_node *chain;
976 size_t ret = 0;
977
978 rb_node = rb_first(&self->sorted_chain);
979 while (rb_node) {
980 double percent;
981
982 chain = rb_entry(rb_node, struct callchain_node, rb_node);
983 percent = chain->hit * 100.0 / total_samples;
984 switch (callchain_param.mode) {
985 case CHAIN_FLAT:
986 ret += percent_color_fprintf(fp, " %6.2f%%\n",
987 percent);
988 ret += callchain__fprintf_flat(fp, chain, total_samples);
989 break;
990 case CHAIN_GRAPH_ABS: /* Falldown */
991 case CHAIN_GRAPH_REL:
992 ret += callchain__fprintf_graph(fp, chain,
993 total_samples, 1, 1);
994 default:
995 break;
996 }
997 ret += fprintf(fp, "\n");
998 rb_node = rb_next(rb_node);
999 }
1000
1001 return ret;
1002}
1003
1004
747static size_t 1005static size_t
748hist_entry__fprintf(FILE *fp, struct hist_entry *self, u64 total_samples) 1006hist_entry__fprintf(FILE *fp, struct hist_entry *self, u64 total_samples)
749{ 1007{
@@ -753,37 +1011,33 @@ hist_entry__fprintf(FILE *fp, struct hist_entry *self, u64 total_samples)
753 if (exclude_other && !self->parent) 1011 if (exclude_other && !self->parent)
754 return 0; 1012 return 0;
755 1013
756 if (total_samples) { 1014 if (total_samples)
757 double percent = self->count * 100.0 / total_samples; 1015 ret = percent_color_fprintf(fp,
758 char *color = PERF_COLOR_NORMAL; 1016 field_sep ? "%.2f" : " %6.2f%%",
759 1017 (self->count * 100.0) / total_samples);
760 /* 1018 else
761 * We color high-overhead entries in red, mid-overhead 1019 ret = fprintf(fp, field_sep ? "%lld" : "%12lld ", self->count);
762 * entries in green - and keep the low overhead places
763 * normal:
764 */
765 if (percent >= 5.0) {
766 color = PERF_COLOR_RED;
767 } else {
768 if (percent >= 0.5)
769 color = PERF_COLOR_GREEN;
770 }
771 1020
772 ret = color_fprintf(fp, color, " %6.2f%%", 1021 if (show_nr_samples) {
773 (self->count * 100.0) / total_samples); 1022 if (field_sep)
774 } else 1023 fprintf(fp, "%c%lld", *field_sep, self->count);
775 ret = fprintf(fp, "%12Ld ", self->count); 1024 else
1025 fprintf(fp, "%11lld", self->count);
1026 }
776 1027
777 list_for_each_entry(se, &hist_entry__sort_list, list) { 1028 list_for_each_entry(se, &hist_entry__sort_list, list) {
778 if (exclude_other && (se == &sort_parent)) 1029 if (se->elide)
779 continue; 1030 continue;
780 1031
781 fprintf(fp, " "); 1032 fprintf(fp, "%s", field_sep ?: " ");
782 ret += se->print(fp, self); 1033 ret += se->print(fp, self, se->width ? *se->width : 0);
783 } 1034 }
784 1035
785 ret += fprintf(fp, "\n"); 1036 ret += fprintf(fp, "\n");
786 1037
1038 if (callchain)
1039 hist_entry_callchain__fprintf(fp, self, total_samples);
1040
787 return ret; 1041 return ret;
788} 1042}
789 1043
@@ -791,13 +1045,25 @@ hist_entry__fprintf(FILE *fp, struct hist_entry *self, u64 total_samples)
791 * 1045 *
792 */ 1046 */
793 1047
1048static void dso__calc_col_width(struct dso *self)
1049{
1050 if (!col_width_list_str && !field_sep &&
1051 (!dso_list || strlist__has_entry(dso_list, self->name))) {
1052 unsigned int slen = strlen(self->name);
1053 if (slen > dsos__col_width)
1054 dsos__col_width = slen;
1055 }
1056
1057 self->slen_calculated = 1;
1058}
1059
794static struct symbol * 1060static struct symbol *
795resolve_symbol(struct thread *thread, struct map **mapp, 1061resolve_symbol(struct thread *thread, struct map **mapp,
796 struct dso **dsop, u64 *ipp) 1062 struct dso **dsop, u64 *ipp)
797{ 1063{
798 struct dso *dso = dsop ? *dsop : NULL; 1064 struct dso *dso = dsop ? *dsop : NULL;
799 struct map *map = mapp ? *mapp : NULL; 1065 struct map *map = mapp ? *mapp : NULL;
800 uint64_t ip = *ipp; 1066 u64 ip = *ipp;
801 1067
802 if (!thread) 1068 if (!thread)
803 return NULL; 1069 return NULL;
@@ -810,11 +1076,18 @@ resolve_symbol(struct thread *thread, struct map **mapp,
810 1076
811 map = thread__find_map(thread, ip); 1077 map = thread__find_map(thread, ip);
812 if (map != NULL) { 1078 if (map != NULL) {
1079 /*
1080 * We have to do this here as we may have a dso
1081 * with no symbol hit that has a name longer than
1082 * the ones with symbols sampled.
1083 */
1084 if (!sort_dso.elide && !map->dso->slen_calculated)
1085 dso__calc_col_width(map->dso);
1086
813 if (mapp) 1087 if (mapp)
814 *mapp = map; 1088 *mapp = map;
815got_map: 1089got_map:
816 ip = map->map_ip(map, ip); 1090 ip = map->map_ip(map, ip);
817 *ipp = ip;
818 1091
819 dso = map->dso; 1092 dso = map->dso;
820 } else { 1093 } else {
@@ -828,6 +1101,8 @@ got_map:
828 dso = kernel_dso; 1101 dso = kernel_dso;
829 } 1102 }
830 dprintf(" ...... dso: %s\n", dso ? dso->name : "<not found>"); 1103 dprintf(" ...... dso: %s\n", dso ? dso->name : "<not found>");
1104 dprintf(" ...... map: %Lx -> %Lx\n", *ipp, ip);
1105 *ipp = ip;
831 1106
832 if (dsop) 1107 if (dsop)
833 *dsop = dso; 1108 *dsop = dso;
@@ -846,6 +1121,58 @@ static int call__match(struct symbol *sym)
846 return 0; 1121 return 0;
847} 1122}
848 1123
1124static struct symbol **
1125resolve_callchain(struct thread *thread, struct map *map __used,
1126 struct ip_callchain *chain, struct hist_entry *entry)
1127{
1128 u64 context = PERF_CONTEXT_MAX;
1129 struct symbol **syms = NULL;
1130 unsigned int i;
1131
1132 if (callchain) {
1133 syms = calloc(chain->nr, sizeof(*syms));
1134 if (!syms) {
1135 fprintf(stderr, "Can't allocate memory for symbols\n");
1136 exit(-1);
1137 }
1138 }
1139
1140 for (i = 0; i < chain->nr; i++) {
1141 u64 ip = chain->ips[i];
1142 struct dso *dso = NULL;
1143 struct symbol *sym;
1144
1145 if (ip >= PERF_CONTEXT_MAX) {
1146 context = ip;
1147 continue;
1148 }
1149
1150 switch (context) {
1151 case PERF_CONTEXT_HV:
1152 dso = hypervisor_dso;
1153 break;
1154 case PERF_CONTEXT_KERNEL:
1155 dso = kernel_dso;
1156 break;
1157 default:
1158 break;
1159 }
1160
1161 sym = resolve_symbol(thread, NULL, &dso, &ip);
1162
1163 if (sym) {
1164 if (sort__has_parent && call__match(sym) &&
1165 !entry->parent)
1166 entry->parent = sym;
1167 if (!callchain)
1168 break;
1169 syms[i] = sym;
1170 }
1171 }
1172
1173 return syms;
1174}
1175
849/* 1176/*
850 * collect histogram counts 1177 * collect histogram counts
851 */ 1178 */
@@ -858,6 +1185,7 @@ hist_entry__add(struct thread *thread, struct map *map, struct dso *dso,
858 struct rb_node **p = &hist.rb_node; 1185 struct rb_node **p = &hist.rb_node;
859 struct rb_node *parent = NULL; 1186 struct rb_node *parent = NULL;
860 struct hist_entry *he; 1187 struct hist_entry *he;
1188 struct symbol **syms = NULL;
861 struct hist_entry entry = { 1189 struct hist_entry entry = {
862 .thread = thread, 1190 .thread = thread,
863 .map = map, 1191 .map = map,
@@ -867,39 +1195,12 @@ hist_entry__add(struct thread *thread, struct map *map, struct dso *dso,
867 .level = level, 1195 .level = level,
868 .count = count, 1196 .count = count,
869 .parent = NULL, 1197 .parent = NULL,
1198 .sorted_chain = RB_ROOT
870 }; 1199 };
871 int cmp; 1200 int cmp;
872 1201
873 if (sort__has_parent && chain) { 1202 if ((sort__has_parent || callchain) && chain)
874 u64 context = PERF_CONTEXT_MAX; 1203 syms = resolve_callchain(thread, map, chain, &entry);
875 int i;
876
877 for (i = 0; i < chain->nr; i++) {
878 u64 ip = chain->ips[i];
879 struct dso *dso = NULL;
880 struct symbol *sym;
881
882 if (ip >= PERF_CONTEXT_MAX) {
883 context = ip;
884 continue;
885 }
886
887 switch (context) {
888 case PERF_CONTEXT_KERNEL:
889 dso = kernel_dso;
890 break;
891 default:
892 break;
893 }
894
895 sym = resolve_symbol(thread, NULL, &dso, &ip);
896
897 if (sym && call__match(sym)) {
898 entry.parent = sym;
899 break;
900 }
901 }
902 }
903 1204
904 while (*p != NULL) { 1205 while (*p != NULL) {
905 parent = *p; 1206 parent = *p;
@@ -909,6 +1210,10 @@ hist_entry__add(struct thread *thread, struct map *map, struct dso *dso,
909 1210
910 if (!cmp) { 1211 if (!cmp) {
911 he->count += count; 1212 he->count += count;
1213 if (callchain) {
1214 append_chain(&he->callchain, chain, syms);
1215 free(syms);
1216 }
912 return 0; 1217 return 0;
913 } 1218 }
914 1219
@@ -922,6 +1227,11 @@ hist_entry__add(struct thread *thread, struct map *map, struct dso *dso,
922 if (!he) 1227 if (!he)
923 return -ENOMEM; 1228 return -ENOMEM;
924 *he = entry; 1229 *he = entry;
1230 if (callchain) {
1231 callchain_init(&he->callchain);
1232 append_chain(&he->callchain, chain, syms);
1233 free(syms);
1234 }
925 rb_link_node(&he->rb_node, parent, p); 1235 rb_link_node(&he->rb_node, parent, p);
926 rb_insert_color(&he->rb_node, &hist); 1236 rb_insert_color(&he->rb_node, &hist);
927 1237
@@ -992,12 +1302,16 @@ static void collapse__resort(void)
992 1302
993static struct rb_root output_hists; 1303static struct rb_root output_hists;
994 1304
995static void output__insert_entry(struct hist_entry *he) 1305static void output__insert_entry(struct hist_entry *he, u64 min_callchain_hits)
996{ 1306{
997 struct rb_node **p = &output_hists.rb_node; 1307 struct rb_node **p = &output_hists.rb_node;
998 struct rb_node *parent = NULL; 1308 struct rb_node *parent = NULL;
999 struct hist_entry *iter; 1309 struct hist_entry *iter;
1000 1310
1311 if (callchain)
1312 callchain_param.sort(&he->sorted_chain, &he->callchain,
1313 min_callchain_hits, &callchain_param);
1314
1001 while (*p != NULL) { 1315 while (*p != NULL) {
1002 parent = *p; 1316 parent = *p;
1003 iter = rb_entry(parent, struct hist_entry, rb_node); 1317 iter = rb_entry(parent, struct hist_entry, rb_node);
@@ -1012,11 +1326,14 @@ static void output__insert_entry(struct hist_entry *he)
1012 rb_insert_color(&he->rb_node, &output_hists); 1326 rb_insert_color(&he->rb_node, &output_hists);
1013} 1327}
1014 1328
1015static void output__resort(void) 1329static void output__resort(u64 total_samples)
1016{ 1330{
1017 struct rb_node *next; 1331 struct rb_node *next;
1018 struct hist_entry *n; 1332 struct hist_entry *n;
1019 struct rb_root *tree = &hist; 1333 struct rb_root *tree = &hist;
1334 u64 min_callchain_hits;
1335
1336 min_callchain_hits = total_samples * (callchain_param.min_percent / 100);
1020 1337
1021 if (sort__need_collapse) 1338 if (sort__need_collapse)
1022 tree = &collapse_hists; 1339 tree = &collapse_hists;
@@ -1028,7 +1345,7 @@ static void output__resort(void)
1028 next = rb_next(&n->rb_node); 1345 next = rb_next(&n->rb_node);
1029 1346
1030 rb_erase(&n->rb_node, tree); 1347 rb_erase(&n->rb_node, tree);
1031 output__insert_entry(n); 1348 output__insert_entry(n, min_callchain_hits);
1032 } 1349 }
1033} 1350}
1034 1351
@@ -1038,35 +1355,67 @@ static size_t output__fprintf(FILE *fp, u64 total_samples)
1038 struct sort_entry *se; 1355 struct sort_entry *se;
1039 struct rb_node *nd; 1356 struct rb_node *nd;
1040 size_t ret = 0; 1357 size_t ret = 0;
1358 unsigned int width;
1359 char *col_width = col_width_list_str;
1041 1360
1042 fprintf(fp, "\n"); 1361 fprintf(fp, "# Samples: %Ld\n", (u64)total_samples);
1043 fprintf(fp, "#\n");
1044 fprintf(fp, "# (%Ld samples)\n", (u64)total_samples);
1045 fprintf(fp, "#\n"); 1362 fprintf(fp, "#\n");
1046 1363
1047 fprintf(fp, "# Overhead"); 1364 fprintf(fp, "# Overhead");
1365 if (show_nr_samples) {
1366 if (field_sep)
1367 fprintf(fp, "%cSamples", *field_sep);
1368 else
1369 fputs(" Samples ", fp);
1370 }
1048 list_for_each_entry(se, &hist_entry__sort_list, list) { 1371 list_for_each_entry(se, &hist_entry__sort_list, list) {
1049 if (exclude_other && (se == &sort_parent)) 1372 if (se->elide)
1373 continue;
1374 if (field_sep) {
1375 fprintf(fp, "%c%s", *field_sep, se->header);
1050 continue; 1376 continue;
1051 fprintf(fp, " %s", se->header); 1377 }
1378 width = strlen(se->header);
1379 if (se->width) {
1380 if (col_width_list_str) {
1381 if (col_width) {
1382 *se->width = atoi(col_width);
1383 col_width = strchr(col_width, ',');
1384 if (col_width)
1385 ++col_width;
1386 }
1387 }
1388 width = *se->width = max(*se->width, width);
1389 }
1390 fprintf(fp, " %*s", width, se->header);
1052 } 1391 }
1053 fprintf(fp, "\n"); 1392 fprintf(fp, "\n");
1054 1393
1394 if (field_sep)
1395 goto print_entries;
1396
1055 fprintf(fp, "# ........"); 1397 fprintf(fp, "# ........");
1398 if (show_nr_samples)
1399 fprintf(fp, " ..........");
1056 list_for_each_entry(se, &hist_entry__sort_list, list) { 1400 list_for_each_entry(se, &hist_entry__sort_list, list) {
1057 int i; 1401 unsigned int i;
1058 1402
1059 if (exclude_other && (se == &sort_parent)) 1403 if (se->elide)
1060 continue; 1404 continue;
1061 1405
1062 fprintf(fp, " "); 1406 fprintf(fp, " ");
1063 for (i = 0; i < strlen(se->header); i++) 1407 if (se->width)
1408 width = *se->width;
1409 else
1410 width = strlen(se->header);
1411 for (i = 0; i < width; i++)
1064 fprintf(fp, "."); 1412 fprintf(fp, ".");
1065 } 1413 }
1066 fprintf(fp, "\n"); 1414 fprintf(fp, "\n");
1067 1415
1068 fprintf(fp, "#\n"); 1416 fprintf(fp, "#\n");
1069 1417
1418print_entries:
1070 for (nd = rb_first(&output_hists); nd; nd = rb_next(nd)) { 1419 for (nd = rb_first(&output_hists); nd; nd = rb_next(nd)) {
1071 pos = rb_entry(nd, struct hist_entry, rb_node); 1420 pos = rb_entry(nd, struct hist_entry, rb_node);
1072 ret += hist_entry__fprintf(fp, pos, total_samples); 1421 ret += hist_entry__fprintf(fp, pos, total_samples);
@@ -1075,7 +1424,7 @@ static size_t output__fprintf(FILE *fp, u64 total_samples)
1075 if (sort_order == default_sort_order && 1424 if (sort_order == default_sort_order &&
1076 parent_pattern == default_parent_pattern) { 1425 parent_pattern == default_parent_pattern) {
1077 fprintf(fp, "#\n"); 1426 fprintf(fp, "#\n");
1078 fprintf(fp, "# (For more details, try: perf report --sort comm,dso,symbol)\n"); 1427 fprintf(fp, "# (For a higher level overview, try: perf report --sort comm,dso)\n");
1079 fprintf(fp, "#\n"); 1428 fprintf(fp, "#\n");
1080 } 1429 }
1081 fprintf(fp, "\n"); 1430 fprintf(fp, "\n");
@@ -1115,7 +1464,7 @@ static int validate_chain(struct ip_callchain *chain, event_t *event)
1115} 1464}
1116 1465
1117static int 1466static int
1118process_overflow_event(event_t *event, unsigned long offset, unsigned long head) 1467process_sample_event(event_t *event, unsigned long offset, unsigned long head)
1119{ 1468{
1120 char level; 1469 char level;
1121 int show = 0; 1470 int show = 0;
@@ -1126,13 +1475,14 @@ process_overflow_event(event_t *event, unsigned long offset, unsigned long head)
1126 struct map *map = NULL; 1475 struct map *map = NULL;
1127 void *more_data = event->ip.__more_data; 1476 void *more_data = event->ip.__more_data;
1128 struct ip_callchain *chain = NULL; 1477 struct ip_callchain *chain = NULL;
1478 int cpumode;
1129 1479
1130 if (event->header.type & PERF_SAMPLE_PERIOD) { 1480 if (sample_type & PERF_SAMPLE_PERIOD) {
1131 period = *(u64 *)more_data; 1481 period = *(u64 *)more_data;
1132 more_data += sizeof(u64); 1482 more_data += sizeof(u64);
1133 } 1483 }
1134 1484
1135 dprintf("%p [%p]: PERF_EVENT (IP, %d): %d: %p period: %Ld\n", 1485 dprintf("%p [%p]: PERF_EVENT_SAMPLE (IP, %d): %d: %p period: %Ld\n",
1136 (void *)(offset + head), 1486 (void *)(offset + head),
1137 (void *)(long)(event->header.size), 1487 (void *)(long)(event->header.size),
1138 event->header.misc, 1488 event->header.misc,
@@ -1140,8 +1490,8 @@ process_overflow_event(event_t *event, unsigned long offset, unsigned long head)
1140 (void *)(long)ip, 1490 (void *)(long)ip,
1141 (long long)period); 1491 (long long)period);
1142 1492
1143 if (event->header.type & PERF_SAMPLE_CALLCHAIN) { 1493 if (sample_type & PERF_SAMPLE_CALLCHAIN) {
1144 int i; 1494 unsigned int i;
1145 1495
1146 chain = (void *)more_data; 1496 chain = (void *)more_data;
1147 1497
@@ -1166,7 +1516,12 @@ process_overflow_event(event_t *event, unsigned long offset, unsigned long head)
1166 return -1; 1516 return -1;
1167 } 1517 }
1168 1518
1169 if (event->header.misc & PERF_EVENT_MISC_KERNEL) { 1519 if (comm_list && !strlist__has_entry(comm_list, thread->comm))
1520 return 0;
1521
1522 cpumode = event->header.misc & PERF_EVENT_MISC_CPUMODE_MASK;
1523
1524 if (cpumode == PERF_EVENT_MISC_KERNEL) {
1170 show = SHOW_KERNEL; 1525 show = SHOW_KERNEL;
1171 level = 'k'; 1526 level = 'k';
1172 1527
@@ -1174,7 +1529,7 @@ process_overflow_event(event_t *event, unsigned long offset, unsigned long head)
1174 1529
1175 dprintf(" ...... dso: %s\n", dso->name); 1530 dprintf(" ...... dso: %s\n", dso->name);
1176 1531
1177 } else if (event->header.misc & PERF_EVENT_MISC_USER) { 1532 } else if (cpumode == PERF_EVENT_MISC_USER) {
1178 1533
1179 show = SHOW_USER; 1534 show = SHOW_USER;
1180 level = '.'; 1535 level = '.';
@@ -1182,12 +1537,21 @@ process_overflow_event(event_t *event, unsigned long offset, unsigned long head)
1182 } else { 1537 } else {
1183 show = SHOW_HV; 1538 show = SHOW_HV;
1184 level = 'H'; 1539 level = 'H';
1540
1541 dso = hypervisor_dso;
1542
1185 dprintf(" ...... dso: [hypervisor]\n"); 1543 dprintf(" ...... dso: [hypervisor]\n");
1186 } 1544 }
1187 1545
1188 if (show & show_mask) { 1546 if (show & show_mask) {
1189 struct symbol *sym = resolve_symbol(thread, &map, &dso, &ip); 1547 struct symbol *sym = resolve_symbol(thread, &map, &dso, &ip);
1190 1548
1549 if (dso_list && dso && dso->name && !strlist__has_entry(dso_list, dso->name))
1550 return 0;
1551
1552 if (sym_list && sym && !strlist__has_entry(sym_list, sym->name))
1553 return 0;
1554
1191 if (hist_entry__add(thread, map, dso, sym, ip, chain, level, period)) { 1555 if (hist_entry__add(thread, map, dso, sym, ip, chain, level, period)) {
1192 eprintf("problem incrementing symbol count, skipping event\n"); 1556 eprintf("problem incrementing symbol count, skipping event\n");
1193 return -1; 1557 return -1;
@@ -1245,15 +1609,27 @@ process_comm_event(event_t *event, unsigned long offset, unsigned long head)
1245} 1609}
1246 1610
1247static int 1611static int
1248process_fork_event(event_t *event, unsigned long offset, unsigned long head) 1612process_task_event(event_t *event, unsigned long offset, unsigned long head)
1249{ 1613{
1250 struct thread *thread = threads__findnew(event->fork.pid); 1614 struct thread *thread = threads__findnew(event->fork.pid);
1251 struct thread *parent = threads__findnew(event->fork.ppid); 1615 struct thread *parent = threads__findnew(event->fork.ppid);
1252 1616
1253 dprintf("%p [%p]: PERF_EVENT_FORK: %d:%d\n", 1617 dprintf("%p [%p]: PERF_EVENT_%s: (%d:%d):(%d:%d)\n",
1254 (void *)(offset + head), 1618 (void *)(offset + head),
1255 (void *)(long)(event->header.size), 1619 (void *)(long)(event->header.size),
1256 event->fork.pid, event->fork.ppid); 1620 event->header.type == PERF_EVENT_FORK ? "FORK" : "EXIT",
1621 event->fork.pid, event->fork.tid,
1622 event->fork.ppid, event->fork.ptid);
1623
1624 /*
1625 * A thread clone will have the same PID for both
1626 * parent and child.
1627 */
1628 if (thread == parent)
1629 return 0;
1630
1631 if (event->header.type == PERF_EVENT_EXIT)
1632 return 0;
1257 1633
1258 if (!thread || !parent || thread__fork(thread, parent)) { 1634 if (!thread || !parent || thread__fork(thread, parent)) {
1259 dprintf("problem processing PERF_EVENT_FORK, skipping event.\n"); 1635 dprintf("problem processing PERF_EVENT_FORK, skipping event.\n");
@@ -1265,19 +1641,6 @@ process_fork_event(event_t *event, unsigned long offset, unsigned long head)
1265} 1641}
1266 1642
1267static int 1643static int
1268process_period_event(event_t *event, unsigned long offset, unsigned long head)
1269{
1270 dprintf("%p [%p]: PERF_EVENT_PERIOD: time:%Ld, id:%Ld: period:%Ld\n",
1271 (void *)(offset + head),
1272 (void *)(long)(event->header.size),
1273 event->period.time,
1274 event->period.id,
1275 event->period.sample_period);
1276
1277 return 0;
1278}
1279
1280static int
1281process_lost_event(event_t *event, unsigned long offset, unsigned long head) 1644process_lost_event(event_t *event, unsigned long offset, unsigned long head)
1282{ 1645{
1283 dprintf("%p [%p]: PERF_EVENT_LOST: id:%Ld: lost:%Ld\n", 1646 dprintf("%p [%p]: PERF_EVENT_LOST: id:%Ld: lost:%Ld\n",
@@ -1328,14 +1691,27 @@ static void trace_event(event_t *event)
1328} 1691}
1329 1692
1330static int 1693static int
1694process_read_event(event_t *event, unsigned long offset, unsigned long head)
1695{
1696 dprintf("%p [%p]: PERF_EVENT_READ: %d %d %Lu\n",
1697 (void *)(offset + head),
1698 (void *)(long)(event->header.size),
1699 event->read.pid,
1700 event->read.tid,
1701 event->read.value);
1702
1703 return 0;
1704}
1705
1706static int
1331process_event(event_t *event, unsigned long offset, unsigned long head) 1707process_event(event_t *event, unsigned long offset, unsigned long head)
1332{ 1708{
1333 trace_event(event); 1709 trace_event(event);
1334 1710
1335 if (event->header.misc & PERF_EVENT_MISC_OVERFLOW)
1336 return process_overflow_event(event, offset, head);
1337
1338 switch (event->header.type) { 1711 switch (event->header.type) {
1712 case PERF_EVENT_SAMPLE:
1713 return process_sample_event(event, offset, head);
1714
1339 case PERF_EVENT_MMAP: 1715 case PERF_EVENT_MMAP:
1340 return process_mmap_event(event, offset, head); 1716 return process_mmap_event(event, offset, head);
1341 1717
@@ -1343,14 +1719,15 @@ process_event(event_t *event, unsigned long offset, unsigned long head)
1343 return process_comm_event(event, offset, head); 1719 return process_comm_event(event, offset, head);
1344 1720
1345 case PERF_EVENT_FORK: 1721 case PERF_EVENT_FORK:
1346 return process_fork_event(event, offset, head); 1722 case PERF_EVENT_EXIT:
1347 1723 return process_task_event(event, offset, head);
1348 case PERF_EVENT_PERIOD:
1349 return process_period_event(event, offset, head);
1350 1724
1351 case PERF_EVENT_LOST: 1725 case PERF_EVENT_LOST:
1352 return process_lost_event(event, offset, head); 1726 return process_lost_event(event, offset, head);
1353 1727
1728 case PERF_EVENT_READ:
1729 return process_read_event(event, offset, head);
1730
1354 /* 1731 /*
1355 * We dont process them right now but they are fine: 1732 * We dont process them right now but they are fine:
1356 */ 1733 */
@@ -1366,13 +1743,30 @@ process_event(event_t *event, unsigned long offset, unsigned long head)
1366 return 0; 1743 return 0;
1367} 1744}
1368 1745
1369static struct perf_file_header file_header; 1746static struct perf_header *header;
1747
1748static u64 perf_header__sample_type(void)
1749{
1750 u64 sample_type = 0;
1751 int i;
1752
1753 for (i = 0; i < header->attrs; i++) {
1754 struct perf_header_attr *attr = header->attr[i];
1755
1756 if (!sample_type)
1757 sample_type = attr->attr.sample_type;
1758 else if (sample_type != attr->attr.sample_type)
1759 die("non matching sample_type");
1760 }
1761
1762 return sample_type;
1763}
1370 1764
1371static int __cmd_report(void) 1765static int __cmd_report(void)
1372{ 1766{
1373 int ret, rc = EXIT_FAILURE; 1767 int ret, rc = EXIT_FAILURE;
1374 unsigned long offset = 0; 1768 unsigned long offset = 0;
1375 unsigned long head = sizeof(file_header); 1769 unsigned long head, shift;
1376 struct stat stat; 1770 struct stat stat;
1377 event_t *event; 1771 event_t *event;
1378 uint32_t size; 1772 uint32_t size;
@@ -1400,15 +1794,24 @@ static int __cmd_report(void)
1400 exit(0); 1794 exit(0);
1401 } 1795 }
1402 1796
1403 if (read(input, &file_header, sizeof(file_header)) == -1) { 1797 header = perf_header__read(input);
1404 perror("failed to read file headers"); 1798 head = header->data_offset;
1405 exit(-1);
1406 }
1407 1799
1408 if (sort__has_parent && 1800 sample_type = perf_header__sample_type();
1409 !(file_header.sample_type & PERF_SAMPLE_CALLCHAIN)) { 1801
1410 fprintf(stderr, "selected --sort parent, but no callchain data\n"); 1802 if (!(sample_type & PERF_SAMPLE_CALLCHAIN)) {
1411 exit(-1); 1803 if (sort__has_parent) {
1804 fprintf(stderr, "selected --sort parent, but no"
1805 " callchain data. Did you call"
1806 " perf record without -g?\n");
1807 exit(-1);
1808 }
1809 if (callchain) {
1810 fprintf(stderr, "selected -c but no callchain data."
1811 " Did you call perf record without"
1812 " -g?\n");
1813 exit(-1);
1814 }
1412 } 1815 }
1413 1816
1414 if (load_kernel() < 0) { 1817 if (load_kernel() < 0) {
@@ -1426,6 +1829,11 @@ static int __cmd_report(void)
1426 cwd = NULL; 1829 cwd = NULL;
1427 cwdlen = 0; 1830 cwdlen = 0;
1428 } 1831 }
1832
1833 shift = page_size * (head / page_size);
1834 offset += shift;
1835 head -= shift;
1836
1429remap: 1837remap:
1430 buf = (char *)mmap(NULL, page_size * mmap_window, PROT_READ, 1838 buf = (char *)mmap(NULL, page_size * mmap_window, PROT_READ,
1431 MAP_SHARED, input, offset); 1839 MAP_SHARED, input, offset);
@@ -1442,9 +1850,10 @@ more:
1442 size = 8; 1850 size = 8;
1443 1851
1444 if (head + event->header.size >= page_size * mmap_window) { 1852 if (head + event->header.size >= page_size * mmap_window) {
1445 unsigned long shift = page_size * (head / page_size);
1446 int ret; 1853 int ret;
1447 1854
1855 shift = page_size * (head / page_size);
1856
1448 ret = munmap(buf, page_size * mmap_window); 1857 ret = munmap(buf, page_size * mmap_window);
1449 assert(ret == 0); 1858 assert(ret == 0);
1450 1859
@@ -1482,10 +1891,10 @@ more:
1482 1891
1483 head += size; 1892 head += size;
1484 1893
1485 if (offset + head >= sizeof(file_header) + file_header.data_size) 1894 if (offset + head >= header->data_offset + header->data_size)
1486 goto done; 1895 goto done;
1487 1896
1488 if (offset + head < stat.st_size) 1897 if (offset + head < (unsigned long)stat.st_size)
1489 goto more; 1898 goto more;
1490 1899
1491done: 1900done:
@@ -1509,12 +1918,58 @@ done:
1509 dsos__fprintf(stdout); 1918 dsos__fprintf(stdout);
1510 1919
1511 collapse__resort(); 1920 collapse__resort();
1512 output__resort(); 1921 output__resort(total);
1513 output__fprintf(stdout, total); 1922 output__fprintf(stdout, total);
1514 1923
1515 return rc; 1924 return rc;
1516} 1925}
1517 1926
1927static int
1928parse_callchain_opt(const struct option *opt __used, const char *arg,
1929 int unset __used)
1930{
1931 char *tok;
1932 char *endptr;
1933
1934 callchain = 1;
1935
1936 if (!arg)
1937 return 0;
1938
1939 tok = strtok((char *)arg, ",");
1940 if (!tok)
1941 return -1;
1942
1943 /* get the output mode */
1944 if (!strncmp(tok, "graph", strlen(arg)))
1945 callchain_param.mode = CHAIN_GRAPH_ABS;
1946
1947 else if (!strncmp(tok, "flat", strlen(arg)))
1948 callchain_param.mode = CHAIN_FLAT;
1949
1950 else if (!strncmp(tok, "fractal", strlen(arg)))
1951 callchain_param.mode = CHAIN_GRAPH_REL;
1952
1953 else
1954 return -1;
1955
1956 /* get the min percentage */
1957 tok = strtok(NULL, ",");
1958 if (!tok)
1959 goto setup;
1960
1961 callchain_param.min_percent = strtod(tok, &endptr);
1962 if (tok == endptr)
1963 return -1;
1964
1965setup:
1966 if (register_callchain_param(&callchain_param) < 0) {
1967 fprintf(stderr, "Can't register callchain params\n");
1968 return -1;
1969 }
1970 return 0;
1971}
1972
1518static const char * const report_usage[] = { 1973static const char * const report_usage[] = {
1519 "perf report [<options>] <command>", 1974 "perf report [<options>] <command>",
1520 NULL 1975 NULL
@@ -1528,6 +1983,10 @@ static const struct option options[] = {
1528 OPT_BOOLEAN('D', "dump-raw-trace", &dump_trace, 1983 OPT_BOOLEAN('D', "dump-raw-trace", &dump_trace,
1529 "dump raw trace in ASCII"), 1984 "dump raw trace in ASCII"),
1530 OPT_STRING('k', "vmlinux", &vmlinux, "file", "vmlinux pathname"), 1985 OPT_STRING('k', "vmlinux", &vmlinux, "file", "vmlinux pathname"),
1986 OPT_BOOLEAN('m', "modules", &modules,
1987 "load module symbols - WARNING: use only with -k and LIVE kernel"),
1988 OPT_BOOLEAN('n', "show-nr-samples", &show_nr_samples,
1989 "Show a column with the number of samples"),
1531 OPT_STRING('s', "sort", &sort_order, "key[,key2...]", 1990 OPT_STRING('s', "sort", &sort_order, "key[,key2...]",
1532 "sort by key(s): pid, comm, dso, symbol, parent"), 1991 "sort by key(s): pid, comm, dso, symbol, parent"),
1533 OPT_BOOLEAN('P', "full-paths", &full_paths, 1992 OPT_BOOLEAN('P', "full-paths", &full_paths,
@@ -1536,6 +1995,21 @@ static const struct option options[] = {
1536 "regex filter to identify parent, see: '--sort parent'"), 1995 "regex filter to identify parent, see: '--sort parent'"),
1537 OPT_BOOLEAN('x', "exclude-other", &exclude_other, 1996 OPT_BOOLEAN('x', "exclude-other", &exclude_other,
1538 "Only display entries with parent-match"), 1997 "Only display entries with parent-match"),
1998 OPT_CALLBACK_DEFAULT('g', "call-graph", NULL, "output_type,min_percent",
1999 "Display callchains using output_type and min percent threshold. "
2000 "Default: fractal,0.5", &parse_callchain_opt, callchain_default_opt),
2001 OPT_STRING('d', "dsos", &dso_list_str, "dso[,dso...]",
2002 "only consider symbols in these dsos"),
2003 OPT_STRING('C', "comms", &comm_list_str, "comm[,comm...]",
2004 "only consider symbols in these comms"),
2005 OPT_STRING('S', "symbols", &sym_list_str, "symbol[,symbol...]",
2006 "only consider these symbols"),
2007 OPT_STRING('w', "column-widths", &col_width_list_str,
2008 "width[,width...]",
2009 "don't try to adjust column width, use these fixed values"),
2010 OPT_STRING('t', "field-separator", &field_sep, "separator",
2011 "separator for columns, no spaces will be added between "
2012 "columns '.' is reserved."),
1539 OPT_END() 2013 OPT_END()
1540}; 2014};
1541 2015
@@ -1554,7 +2028,26 @@ static void setup_sorting(void)
1554 free(str); 2028 free(str);
1555} 2029}
1556 2030
1557int cmd_report(int argc, const char **argv, const char *prefix) 2031static void setup_list(struct strlist **list, const char *list_str,
2032 struct sort_entry *se, const char *list_name,
2033 FILE *fp)
2034{
2035 if (list_str) {
2036 *list = strlist__new(true, list_str);
2037 if (!*list) {
2038 fprintf(stderr, "problems parsing %s list\n",
2039 list_name);
2040 exit(129);
2041 }
2042 if (strlist__nr_entries(*list) == 1) {
2043 fprintf(fp, "# %s: %s\n", list_name,
2044 strlist__entry(*list, 0)->s);
2045 se->elide = true;
2046 }
2047 }
2048}
2049
2050int cmd_report(int argc, const char **argv, const char *prefix __used)
1558{ 2051{
1559 symbol__init(); 2052 symbol__init();
1560 2053
@@ -1564,9 +2057,10 @@ int cmd_report(int argc, const char **argv, const char *prefix)
1564 2057
1565 setup_sorting(); 2058 setup_sorting();
1566 2059
1567 if (parent_pattern != default_parent_pattern) 2060 if (parent_pattern != default_parent_pattern) {
1568 sort_dimension__add("parent"); 2061 sort_dimension__add("parent");
1569 else 2062 sort_parent.elide = 1;
2063 } else
1570 exclude_other = 0; 2064 exclude_other = 0;
1571 2065
1572 /* 2066 /*
@@ -1577,5 +2071,15 @@ int cmd_report(int argc, const char **argv, const char *prefix)
1577 2071
1578 setup_pager(); 2072 setup_pager();
1579 2073
2074 setup_list(&dso_list, dso_list_str, &sort_dso, "dso", stdout);
2075 setup_list(&comm_list, comm_list_str, &sort_comm, "comm", stdout);
2076 setup_list(&sym_list, sym_list_str, &sort_sym, "symbol", stdout);
2077
2078 if (field_sep && *field_sep == '.') {
2079 fputs("'.' is the only non valid --field-separator argument\n",
2080 stderr);
2081 exit(129);
2082 }
2083
1580 return __cmd_report(); 2084 return __cmd_report();
1581} 2085}
diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c
index 6d3eeac1ea25..f9510eeeb6c7 100644
--- a/tools/perf/builtin-stat.c
+++ b/tools/perf/builtin-stat.c
@@ -32,6 +32,7 @@
32 * Wu Fengguang <fengguang.wu@intel.com> 32 * Wu Fengguang <fengguang.wu@intel.com>
33 * Mike Galbraith <efault@gmx.de> 33 * Mike Galbraith <efault@gmx.de>
34 * Paul Mackerras <paulus@samba.org> 34 * Paul Mackerras <paulus@samba.org>
35 * Jaswinder Singh Rajput <jaswinder@kernel.org>
35 * 36 *
36 * Released under the GPL v2. (and only v2, not any later version) 37 * Released under the GPL v2. (and only v2, not any later version)
37 */ 38 */
@@ -45,7 +46,7 @@
45#include <sys/prctl.h> 46#include <sys/prctl.h>
46#include <math.h> 47#include <math.h>
47 48
48static struct perf_counter_attr default_attrs[MAX_COUNTERS] = { 49static struct perf_counter_attr default_attrs[] = {
49 50
50 { .type = PERF_TYPE_SOFTWARE, .config = PERF_COUNT_SW_TASK_CLOCK }, 51 { .type = PERF_TYPE_SOFTWARE, .config = PERF_COUNT_SW_TASK_CLOCK },
51 { .type = PERF_TYPE_SOFTWARE, .config = PERF_COUNT_SW_CONTEXT_SWITCHES}, 52 { .type = PERF_TYPE_SOFTWARE, .config = PERF_COUNT_SW_CONTEXT_SWITCHES},
@@ -59,42 +60,28 @@ static struct perf_counter_attr default_attrs[MAX_COUNTERS] = {
59 60
60}; 61};
61 62
63#define MAX_RUN 100
64
62static int system_wide = 0; 65static int system_wide = 0;
63static int inherit = 1;
64static int verbose = 0; 66static int verbose = 0;
67static unsigned int nr_cpus = 0;
68static int run_idx = 0;
65 69
66static int fd[MAX_NR_CPUS][MAX_COUNTERS]; 70static int run_count = 1;
67 71static int inherit = 1;
68static int target_pid = -1;
69static int nr_cpus = 0;
70static unsigned int page_size;
71
72static int scale = 1; 72static int scale = 1;
73static int target_pid = -1;
74static int null_run = 0;
73 75
74static const unsigned int default_count[] = { 76static int fd[MAX_NR_CPUS][MAX_COUNTERS];
75 1000000,
76 1000000,
77 10000,
78 10000,
79 1000000,
80 10000,
81};
82
83#define MAX_RUN 100
84
85static int run_count = 1;
86static int run_idx = 0;
87
88static u64 event_res[MAX_RUN][MAX_COUNTERS][3];
89static u64 event_scaled[MAX_RUN][MAX_COUNTERS];
90
91//static u64 event_hist[MAX_RUN][MAX_COUNTERS][3];
92
93 77
94static u64 runtime_nsecs[MAX_RUN]; 78static u64 runtime_nsecs[MAX_RUN];
95static u64 walltime_nsecs[MAX_RUN]; 79static u64 walltime_nsecs[MAX_RUN];
96static u64 runtime_cycles[MAX_RUN]; 80static u64 runtime_cycles[MAX_RUN];
97 81
82static u64 event_res[MAX_RUN][MAX_COUNTERS][3];
83static u64 event_scaled[MAX_RUN][MAX_COUNTERS];
84
98static u64 event_res_avg[MAX_COUNTERS][3]; 85static u64 event_res_avg[MAX_COUNTERS][3];
99static u64 event_res_noise[MAX_COUNTERS][3]; 86static u64 event_res_noise[MAX_COUNTERS][3];
100 87
@@ -109,7 +96,14 @@ static u64 walltime_nsecs_noise;
109static u64 runtime_cycles_avg; 96static u64 runtime_cycles_avg;
110static u64 runtime_cycles_noise; 97static u64 runtime_cycles_noise;
111 98
112static void create_perf_stat_counter(int counter) 99#define MATCH_EVENT(t, c, counter) \
100 (attrs[counter].type == PERF_TYPE_##t && \
101 attrs[counter].config == PERF_COUNT_##c)
102
103#define ERR_PERF_OPEN \
104"Error: counter %d, sys_perf_counter_open() syscall returned with %d (%s)\n"
105
106static void create_perf_stat_counter(int counter, int pid)
113{ 107{
114 struct perf_counter_attr *attr = attrs + counter; 108 struct perf_counter_attr *attr = attrs + counter;
115 109
@@ -118,21 +112,23 @@ static void create_perf_stat_counter(int counter)
118 PERF_FORMAT_TOTAL_TIME_RUNNING; 112 PERF_FORMAT_TOTAL_TIME_RUNNING;
119 113
120 if (system_wide) { 114 if (system_wide) {
121 int cpu; 115 unsigned int cpu;
122 for (cpu = 0; cpu < nr_cpus; cpu ++) { 116
117 for (cpu = 0; cpu < nr_cpus; cpu++) {
123 fd[cpu][counter] = sys_perf_counter_open(attr, -1, cpu, -1, 0); 118 fd[cpu][counter] = sys_perf_counter_open(attr, -1, cpu, -1, 0);
124 if (fd[cpu][counter] < 0 && verbose) { 119 if (fd[cpu][counter] < 0 && verbose)
125 printf("Error: counter %d, sys_perf_counter_open() syscall returned with %d (%s)\n", counter, fd[cpu][counter], strerror(errno)); 120 fprintf(stderr, ERR_PERF_OPEN, counter,
126 } 121 fd[cpu][counter], strerror(errno));
127 } 122 }
128 } else { 123 } else {
129 attr->inherit = inherit; 124 attr->inherit = inherit;
130 attr->disabled = 1; 125 attr->disabled = 1;
131 126 attr->enable_on_exec = 1;
132 fd[0][counter] = sys_perf_counter_open(attr, 0, -1, -1, 0); 127
133 if (fd[0][counter] < 0 && verbose) { 128 fd[0][counter] = sys_perf_counter_open(attr, pid, -1, -1, 0);
134 printf("Error: counter %d, sys_perf_counter_open() syscall returned with %d (%s)\n", counter, fd[0][counter], strerror(errno)); 129 if (fd[0][counter] < 0 && verbose)
135 } 130 fprintf(stderr, ERR_PERF_OPEN, counter,
131 fd[0][counter], strerror(errno));
136 } 132 }
137} 133}
138 134
@@ -141,13 +137,8 @@ static void create_perf_stat_counter(int counter)
141 */ 137 */
142static inline int nsec_counter(int counter) 138static inline int nsec_counter(int counter)
143{ 139{
144 if (attrs[counter].type != PERF_TYPE_SOFTWARE) 140 if (MATCH_EVENT(SOFTWARE, SW_CPU_CLOCK, counter) ||
145 return 0; 141 MATCH_EVENT(SOFTWARE, SW_TASK_CLOCK, counter))
146
147 if (attrs[counter].config == PERF_COUNT_SW_CPU_CLOCK)
148 return 1;
149
150 if (attrs[counter].config == PERF_COUNT_SW_TASK_CLOCK)
151 return 1; 142 return 1;
152 143
153 return 0; 144 return 0;
@@ -159,8 +150,8 @@ static inline int nsec_counter(int counter)
159static void read_counter(int counter) 150static void read_counter(int counter)
160{ 151{
161 u64 *count, single_count[3]; 152 u64 *count, single_count[3];
162 ssize_t res; 153 unsigned int cpu;
163 int cpu, nv; 154 size_t res, nv;
164 int scaled; 155 int scaled;
165 156
166 count = event_res[run_idx][counter]; 157 count = event_res[run_idx][counter];
@@ -168,12 +159,13 @@ static void read_counter(int counter)
168 count[0] = count[1] = count[2] = 0; 159 count[0] = count[1] = count[2] = 0;
169 160
170 nv = scale ? 3 : 1; 161 nv = scale ? 3 : 1;
171 for (cpu = 0; cpu < nr_cpus; cpu ++) { 162 for (cpu = 0; cpu < nr_cpus; cpu++) {
172 if (fd[cpu][counter] < 0) 163 if (fd[cpu][counter] < 0)
173 continue; 164 continue;
174 165
175 res = read(fd[cpu][counter], single_count, nv * sizeof(u64)); 166 res = read(fd[cpu][counter], single_count, nv * sizeof(u64));
176 assert(res == nv * sizeof(u64)); 167 assert(res == nv * sizeof(u64));
168
177 close(fd[cpu][counter]); 169 close(fd[cpu][counter]);
178 fd[cpu][counter] = -1; 170 fd[cpu][counter] = -1;
179 171
@@ -201,46 +193,81 @@ static void read_counter(int counter)
201 /* 193 /*
202 * Save the full runtime - to allow normalization during printout: 194 * Save the full runtime - to allow normalization during printout:
203 */ 195 */
204 if (attrs[counter].type == PERF_TYPE_SOFTWARE && 196 if (MATCH_EVENT(SOFTWARE, SW_TASK_CLOCK, counter))
205 attrs[counter].config == PERF_COUNT_SW_TASK_CLOCK)
206 runtime_nsecs[run_idx] = count[0]; 197 runtime_nsecs[run_idx] = count[0];
207 if (attrs[counter].type == PERF_TYPE_HARDWARE && 198 if (MATCH_EVENT(HARDWARE, HW_CPU_CYCLES, counter))
208 attrs[counter].config == PERF_COUNT_HW_CPU_CYCLES)
209 runtime_cycles[run_idx] = count[0]; 199 runtime_cycles[run_idx] = count[0];
210} 200}
211 201
212static int run_perf_stat(int argc, const char **argv) 202static int run_perf_stat(int argc __used, const char **argv)
213{ 203{
214 unsigned long long t0, t1; 204 unsigned long long t0, t1;
215 int status = 0; 205 int status = 0;
216 int counter; 206 int counter;
217 int pid; 207 int pid;
208 int child_ready_pipe[2], go_pipe[2];
209 char buf;
218 210
219 if (!system_wide) 211 if (!system_wide)
220 nr_cpus = 1; 212 nr_cpus = 1;
221 213
222 for (counter = 0; counter < nr_counters; counter++) 214 if (pipe(child_ready_pipe) < 0 || pipe(go_pipe) < 0) {
223 create_perf_stat_counter(counter); 215 perror("failed to create pipes");
224 216 exit(1);
225 /* 217 }
226 * Enable counters and exec the command:
227 */
228 t0 = rdclock();
229 prctl(PR_TASK_PERF_COUNTERS_ENABLE);
230 218
231 if ((pid = fork()) < 0) 219 if ((pid = fork()) < 0)
232 perror("failed to fork"); 220 perror("failed to fork");
233 221
234 if (!pid) { 222 if (!pid) {
235 if (execvp(argv[0], (char **)argv)) { 223 close(child_ready_pipe[0]);
236 perror(argv[0]); 224 close(go_pipe[1]);
237 exit(-1); 225 fcntl(go_pipe[0], F_SETFD, FD_CLOEXEC);
238 } 226
227 /*
228 * Do a dummy execvp to get the PLT entry resolved,
229 * so we avoid the resolver overhead on the real
230 * execvp call.
231 */
232 execvp("", (char **)argv);
233
234 /*
235 * Tell the parent we're ready to go
236 */
237 close(child_ready_pipe[1]);
238
239 /*
240 * Wait until the parent tells us to go.
241 */
242 if (read(go_pipe[0], &buf, 1) == -1)
243 perror("unable to read pipe");
244
245 execvp(argv[0], (char **)argv);
246
247 perror(argv[0]);
248 exit(-1);
239 } 249 }
240 250
251 /*
252 * Wait for the child to be ready to exec.
253 */
254 close(child_ready_pipe[1]);
255 close(go_pipe[0]);
256 if (read(child_ready_pipe[0], &buf, 1) == -1)
257 perror("unable to read pipe");
258 close(child_ready_pipe[0]);
259
260 for (counter = 0; counter < nr_counters; counter++)
261 create_perf_stat_counter(counter, pid);
262
263 /*
264 * Enable counters and exec the command:
265 */
266 t0 = rdclock();
267
268 close(go_pipe[1]);
241 wait(&status); 269 wait(&status);
242 270
243 prctl(PR_TASK_PERF_COUNTERS_DISABLE);
244 t1 = rdclock(); 271 t1 = rdclock();
245 272
246 walltime_nsecs[run_idx] = t1 - t0; 273 walltime_nsecs[run_idx] = t1 - t0;
@@ -262,11 +289,9 @@ static void nsec_printout(int counter, u64 *count, u64 *noise)
262{ 289{
263 double msecs = (double)count[0] / 1000000; 290 double msecs = (double)count[0] / 1000000;
264 291
265 fprintf(stderr, " %14.6f %-20s", msecs, event_name(counter)); 292 fprintf(stderr, " %14.6f %-24s", msecs, event_name(counter));
266
267 if (attrs[counter].type == PERF_TYPE_SOFTWARE &&
268 attrs[counter].config == PERF_COUNT_SW_TASK_CLOCK) {
269 293
294 if (MATCH_EVENT(SOFTWARE, SW_TASK_CLOCK, counter)) {
270 if (walltime_nsecs_avg) 295 if (walltime_nsecs_avg)
271 fprintf(stderr, " # %10.3f CPUs ", 296 fprintf(stderr, " # %10.3f CPUs ",
272 (double)count[0] / (double)walltime_nsecs_avg); 297 (double)count[0] / (double)walltime_nsecs_avg);
@@ -276,12 +301,10 @@ static void nsec_printout(int counter, u64 *count, u64 *noise)
276 301
277static void abs_printout(int counter, u64 *count, u64 *noise) 302static void abs_printout(int counter, u64 *count, u64 *noise)
278{ 303{
279 fprintf(stderr, " %14Ld %-20s", count[0], event_name(counter)); 304 fprintf(stderr, " %14Ld %-24s", count[0], event_name(counter));
280 305
281 if (runtime_cycles_avg && 306 if (runtime_cycles_avg &&
282 attrs[counter].type == PERF_TYPE_HARDWARE && 307 MATCH_EVENT(HARDWARE, HW_INSTRUCTIONS, counter)) {
283 attrs[counter].config == PERF_COUNT_HW_INSTRUCTIONS) {
284
285 fprintf(stderr, " # %10.3f IPC ", 308 fprintf(stderr, " # %10.3f IPC ",
286 (double)count[0] / (double)runtime_cycles_avg); 309 (double)count[0] / (double)runtime_cycles_avg);
287 } else { 310 } else {
@@ -306,7 +329,7 @@ static void print_counter(int counter)
306 scaled = event_scaled_avg[counter]; 329 scaled = event_scaled_avg[counter];
307 330
308 if (scaled == -1) { 331 if (scaled == -1) {
309 fprintf(stderr, " %14s %-20s\n", 332 fprintf(stderr, " %14s %-24s\n",
310 "<not counted>", event_name(counter)); 333 "<not counted>", event_name(counter));
311 return; 334 return;
312 } 335 }
@@ -364,8 +387,11 @@ static void calc_avg(void)
364 event_res_avg[j]+1, event_res[i][j]+1); 387 event_res_avg[j]+1, event_res[i][j]+1);
365 update_avg("counter/2", j, 388 update_avg("counter/2", j,
366 event_res_avg[j]+2, event_res[i][j]+2); 389 event_res_avg[j]+2, event_res[i][j]+2);
367 update_avg("scaled", j, 390 if (event_scaled[i][j] != (u64)-1)
368 event_scaled_avg + j, event_scaled[i]+j); 391 update_avg("scaled", j,
392 event_scaled_avg + j, event_scaled[i]+j);
393 else
394 event_scaled_avg[j] = -1;
369 } 395 }
370 } 396 }
371 runtime_nsecs_avg /= run_count; 397 runtime_nsecs_avg /= run_count;
@@ -429,11 +455,14 @@ static void print_stat(int argc, const char **argv)
429 for (counter = 0; counter < nr_counters; counter++) 455 for (counter = 0; counter < nr_counters; counter++)
430 print_counter(counter); 456 print_counter(counter);
431 457
432
433 fprintf(stderr, "\n"); 458 fprintf(stderr, "\n");
434 fprintf(stderr, " %14.9f seconds time elapsed.\n", 459 fprintf(stderr, " %14.9f seconds time elapsed",
435 (double)walltime_nsecs_avg/1e9); 460 (double)walltime_nsecs_avg/1e9);
436 fprintf(stderr, "\n"); 461 if (run_count > 1) {
462 fprintf(stderr, " ( +- %7.3f%% )",
463 100.0*(double)walltime_nsecs_noise/(double)walltime_nsecs_avg);
464 }
465 fprintf(stderr, "\n\n");
437} 466}
438 467
439static volatile int signr = -1; 468static volatile int signr = -1;
@@ -466,36 +495,38 @@ static const struct option options[] = {
466 OPT_INTEGER('p', "pid", &target_pid, 495 OPT_INTEGER('p', "pid", &target_pid,
467 "stat events on existing pid"), 496 "stat events on existing pid"),
468 OPT_BOOLEAN('a', "all-cpus", &system_wide, 497 OPT_BOOLEAN('a', "all-cpus", &system_wide,
469 "system-wide collection from all CPUs"), 498 "system-wide collection from all CPUs"),
470 OPT_BOOLEAN('S', "scale", &scale, 499 OPT_BOOLEAN('S', "scale", &scale,
471 "scale/normalize counters"), 500 "scale/normalize counters"),
472 OPT_BOOLEAN('v', "verbose", &verbose, 501 OPT_BOOLEAN('v', "verbose", &verbose,
473 "be more verbose (show counter open errors, etc)"), 502 "be more verbose (show counter open errors, etc)"),
474 OPT_INTEGER('r', "repeat", &run_count, 503 OPT_INTEGER('r', "repeat", &run_count,
475 "repeat command and print average + stddev (max: 100)"), 504 "repeat command and print average + stddev (max: 100)"),
505 OPT_BOOLEAN('n', "null", &null_run,
506 "null run - dont start any counters"),
476 OPT_END() 507 OPT_END()
477}; 508};
478 509
479int cmd_stat(int argc, const char **argv, const char *prefix) 510int cmd_stat(int argc, const char **argv, const char *prefix __used)
480{ 511{
481 int status; 512 int status;
482 513
483 page_size = sysconf(_SC_PAGE_SIZE); 514 argc = parse_options(argc, argv, options, stat_usage,
484 515 PARSE_OPT_STOP_AT_NON_OPTION);
485 memcpy(attrs, default_attrs, sizeof(attrs));
486
487 argc = parse_options(argc, argv, options, stat_usage, 0);
488 if (!argc) 516 if (!argc)
489 usage_with_options(stat_usage, options); 517 usage_with_options(stat_usage, options);
490 if (run_count <= 0 || run_count > MAX_RUN) 518 if (run_count <= 0 || run_count > MAX_RUN)
491 usage_with_options(stat_usage, options); 519 usage_with_options(stat_usage, options);
492 520
493 if (!nr_counters) 521 /* Set attrs and nr_counters if no event is selected and !null_run */
494 nr_counters = 8; 522 if (!null_run && !nr_counters) {
523 memcpy(attrs, default_attrs, sizeof(default_attrs));
524 nr_counters = ARRAY_SIZE(default_attrs);
525 }
495 526
496 nr_cpus = sysconf(_SC_NPROCESSORS_ONLN); 527 nr_cpus = sysconf(_SC_NPROCESSORS_ONLN);
497 assert(nr_cpus <= MAX_NR_CPUS); 528 assert(nr_cpus <= MAX_NR_CPUS);
498 assert(nr_cpus >= 0); 529 assert((int)nr_cpus >= 0);
499 530
500 /* 531 /*
501 * We dont want to block the signals - that would cause 532 * We dont want to block the signals - that would cause
@@ -511,7 +542,7 @@ int cmd_stat(int argc, const char **argv, const char *prefix)
511 status = 0; 542 status = 0;
512 for (run_idx = 0; run_idx < run_count; run_idx++) { 543 for (run_idx = 0; run_idx < run_count; run_idx++) {
513 if (run_count != 1 && verbose) 544 if (run_count != 1 && verbose)
514 fprintf(stderr, "[ perf stat: executing run #%d ... ]\n", run_idx+1); 545 fprintf(stderr, "[ perf stat: executing run #%d ... ]\n", run_idx + 1);
515 status = run_perf_stat(argc, argv); 546 status = run_perf_stat(argc, argv);
516 } 547 }
517 548
diff --git a/tools/perf/builtin-top.c b/tools/perf/builtin-top.c
index 5352b5e352ed..f139f1ab9333 100644
--- a/tools/perf/builtin-top.c
+++ b/tools/perf/builtin-top.c
@@ -23,7 +23,7 @@
23#include "util/symbol.h" 23#include "util/symbol.h"
24#include "util/color.h" 24#include "util/color.h"
25#include "util/util.h" 25#include "util/util.h"
26#include "util/rbtree.h" 26#include <linux/rbtree.h>
27#include "util/parse-options.h" 27#include "util/parse-options.h"
28#include "util/parse-events.h" 28#include "util/parse-events.h"
29 29
@@ -58,6 +58,7 @@ static u64 count_filter = 5;
58static int print_entries = 15; 58static int print_entries = 15;
59 59
60static int target_pid = -1; 60static int target_pid = -1;
61static int inherit = 0;
61static int profile_cpu = -1; 62static int profile_cpu = -1;
62static int nr_cpus = 0; 63static int nr_cpus = 0;
63static unsigned int realtime_prio = 0; 64static unsigned int realtime_prio = 0;
@@ -66,6 +67,7 @@ static unsigned int page_size;
66static unsigned int mmap_pages = 16; 67static unsigned int mmap_pages = 16;
67static int freq = 0; 68static int freq = 0;
68static int verbose = 0; 69static int verbose = 0;
70static char *vmlinux = NULL;
69 71
70static char *sym_filter; 72static char *sym_filter;
71static unsigned long filter_start; 73static unsigned long filter_start;
@@ -238,7 +240,6 @@ static void print_sym_table(void)
238 for (nd = rb_first(&tmp); nd; nd = rb_next(nd)) { 240 for (nd = rb_first(&tmp); nd; nd = rb_next(nd)) {
239 struct sym_entry *syme = rb_entry(nd, struct sym_entry, rb_node); 241 struct sym_entry *syme = rb_entry(nd, struct sym_entry, rb_node);
240 struct symbol *sym = (struct symbol *)(syme + 1); 242 struct symbol *sym = (struct symbol *)(syme + 1);
241 char *color = PERF_COLOR_NORMAL;
242 double pcnt; 243 double pcnt;
243 244
244 if (++printed > print_entries || syme->snap_count < count_filter) 245 if (++printed > print_entries || syme->snap_count < count_filter)
@@ -247,29 +248,20 @@ static void print_sym_table(void)
247 pcnt = 100.0 - (100.0 * ((sum_ksamples - syme->snap_count) / 248 pcnt = 100.0 - (100.0 * ((sum_ksamples - syme->snap_count) /
248 sum_ksamples)); 249 sum_ksamples));
249 250
250 /*
251 * We color high-overhead entries in red, mid-overhead
252 * entries in green - and keep the low overhead places
253 * normal:
254 */
255 if (pcnt >= 5.0) {
256 color = PERF_COLOR_RED;
257 } else {
258 if (pcnt >= 0.5)
259 color = PERF_COLOR_GREEN;
260 }
261
262 if (nr_counters == 1) 251 if (nr_counters == 1)
263 printf("%20.2f - ", syme->weight); 252 printf("%20.2f - ", syme->weight);
264 else 253 else
265 printf("%9.1f %10ld - ", syme->weight, syme->snap_count); 254 printf("%9.1f %10ld - ", syme->weight, syme->snap_count);
266 255
267 color_fprintf(stdout, color, "%4.1f%%", pcnt); 256 percent_color_fprintf(stdout, "%4.1f%%", pcnt);
268 printf(" - %016llx : %s\n", sym->start, sym->name); 257 printf(" - %016llx : %s", sym->start, sym->name);
258 if (sym->module)
259 printf("\t[%s]", sym->module->name);
260 printf("\n");
269 } 261 }
270} 262}
271 263
272static void *display_thread(void *arg) 264static void *display_thread(void *arg __used)
273{ 265{
274 struct pollfd stdin_poll = { .fd = 0, .events = POLLIN }; 266 struct pollfd stdin_poll = { .fd = 0, .events = POLLIN };
275 int delay_msecs = delay_secs * 1000; 267 int delay_msecs = delay_secs * 1000;
@@ -286,11 +278,32 @@ static void *display_thread(void *arg)
286 return NULL; 278 return NULL;
287} 279}
288 280
281/* Tag samples to be skipped. */
282static const char *skip_symbols[] = {
283 "default_idle",
284 "cpu_idle",
285 "enter_idle",
286 "exit_idle",
287 "mwait_idle",
288 "mwait_idle_with_hints",
289 "ppc64_runlatch_off",
290 "pseries_dedicated_idle_sleep",
291 NULL
292};
293
289static int symbol_filter(struct dso *self, struct symbol *sym) 294static int symbol_filter(struct dso *self, struct symbol *sym)
290{ 295{
291 static int filter_match; 296 static int filter_match;
292 struct sym_entry *syme; 297 struct sym_entry *syme;
293 const char *name = sym->name; 298 const char *name = sym->name;
299 int i;
300
301 /*
302 * ppc64 uses function descriptors and appends a '.' to the
303 * start of every instruction address. Remove it.
304 */
305 if (name[0] == '.')
306 name++;
294 307
295 if (!strcmp(name, "_text") || 308 if (!strcmp(name, "_text") ||
296 !strcmp(name, "_etext") || 309 !strcmp(name, "_etext") ||
@@ -302,13 +315,12 @@ static int symbol_filter(struct dso *self, struct symbol *sym)
302 return 1; 315 return 1;
303 316
304 syme = dso__sym_priv(self, sym); 317 syme = dso__sym_priv(self, sym);
305 /* Tag samples to be skipped. */ 318 for (i = 0; skip_symbols[i]; i++) {
306 if (!strcmp("default_idle", name) || 319 if (!strcmp(skip_symbols[i], name)) {
307 !strcmp("cpu_idle", name) || 320 syme->skip = 1;
308 !strcmp("enter_idle", name) || 321 break;
309 !strcmp("exit_idle", name) || 322 }
310 !strcmp("mwait_idle", name)) 323 }
311 syme->skip = 1;
312 324
313 if (filter_match == 1) { 325 if (filter_match == 1) {
314 filter_end = sym->start; 326 filter_end = sym->start;
@@ -340,12 +352,13 @@ static int parse_symbols(void)
340{ 352{
341 struct rb_node *node; 353 struct rb_node *node;
342 struct symbol *sym; 354 struct symbol *sym;
355 int modules = vmlinux ? 1 : 0;
343 356
344 kernel_dso = dso__new("[kernel]", sizeof(struct sym_entry)); 357 kernel_dso = dso__new("[kernel]", sizeof(struct sym_entry));
345 if (kernel_dso == NULL) 358 if (kernel_dso == NULL)
346 return -1; 359 return -1;
347 360
348 if (dso__load_kernel(kernel_dso, NULL, symbol_filter, 1) != 0) 361 if (dso__load_kernel(kernel_dso, vmlinux, symbol_filter, verbose, modules) <= 0)
349 goto out_delete_dso; 362 goto out_delete_dso;
350 363
351 node = rb_first(&kernel_dso->syms); 364 node = rb_first(&kernel_dso->syms);
@@ -392,11 +405,11 @@ static void record_ip(u64 ip, int counter)
392 samples--; 405 samples--;
393} 406}
394 407
395static void process_event(u64 ip, int counter) 408static void process_event(u64 ip, int counter, int user)
396{ 409{
397 samples++; 410 samples++;
398 411
399 if (ip < min_ip || ip > max_ip) { 412 if (user) {
400 userspace_samples++; 413 userspace_samples++;
401 return; 414 return;
402 } 415 }
@@ -407,7 +420,7 @@ static void process_event(u64 ip, int counter)
407struct mmap_data { 420struct mmap_data {
408 int counter; 421 int counter;
409 void *base; 422 void *base;
410 unsigned int mask; 423 int mask;
411 unsigned int prev; 424 unsigned int prev;
412}; 425};
413 426
@@ -509,9 +522,10 @@ static void mmap_read_counter(struct mmap_data *md)
509 522
510 old += size; 523 old += size;
511 524
512 if (event->header.misc & PERF_EVENT_MISC_OVERFLOW) { 525 if (event->header.type == PERF_EVENT_SAMPLE) {
513 if (event->header.type & PERF_SAMPLE_IP) 526 int user =
514 process_event(event->ip.ip, md->counter); 527 (event->header.misc & PERF_EVENT_MISC_CPUMODE_MASK) == PERF_EVENT_MISC_USER;
528 process_event(event->ip.ip, md->counter, user);
515 } 529 }
516 } 530 }
517 531
@@ -537,7 +551,7 @@ int group_fd;
537static void start_counter(int i, int counter) 551static void start_counter(int i, int counter)
538{ 552{
539 struct perf_counter_attr *attr; 553 struct perf_counter_attr *attr;
540 unsigned int cpu; 554 int cpu;
541 555
542 cpu = profile_cpu; 556 cpu = profile_cpu;
543 if (target_pid == -1 && profile_cpu == -1) 557 if (target_pid == -1 && profile_cpu == -1)
@@ -547,6 +561,7 @@ static void start_counter(int i, int counter)
547 561
548 attr->sample_type = PERF_SAMPLE_IP | PERF_SAMPLE_TID; 562 attr->sample_type = PERF_SAMPLE_IP | PERF_SAMPLE_TID;
549 attr->freq = freq; 563 attr->freq = freq;
564 attr->inherit = (cpu < 0) && inherit;
550 565
551try_again: 566try_again:
552 fd[i][counter] = sys_perf_counter_open(attr, target_pid, cpu, group_fd, 0); 567 fd[i][counter] = sys_perf_counter_open(attr, target_pid, cpu, group_fd, 0);
@@ -660,6 +675,7 @@ static const struct option options[] = {
660 "system-wide collection from all CPUs"), 675 "system-wide collection from all CPUs"),
661 OPT_INTEGER('C', "CPU", &profile_cpu, 676 OPT_INTEGER('C', "CPU", &profile_cpu,
662 "CPU to profile on"), 677 "CPU to profile on"),
678 OPT_STRING('k', "vmlinux", &vmlinux, "file", "vmlinux pathname"),
663 OPT_INTEGER('m', "mmap-pages", &mmap_pages, 679 OPT_INTEGER('m', "mmap-pages", &mmap_pages,
664 "number of mmap data pages"), 680 "number of mmap data pages"),
665 OPT_INTEGER('r', "realtime", &realtime_prio, 681 OPT_INTEGER('r', "realtime", &realtime_prio,
@@ -672,9 +688,11 @@ static const struct option options[] = {
672 "only display functions with more events than this"), 688 "only display functions with more events than this"),
673 OPT_BOOLEAN('g', "group", &group, 689 OPT_BOOLEAN('g', "group", &group,
674 "put the counters into a counter group"), 690 "put the counters into a counter group"),
691 OPT_BOOLEAN('i', "inherit", &inherit,
692 "child tasks inherit counters"),
675 OPT_STRING('s', "sym-filter", &sym_filter, "pattern", 693 OPT_STRING('s', "sym-filter", &sym_filter, "pattern",
676 "only display symbols matchig this pattern"), 694 "only display symbols matchig this pattern"),
677 OPT_BOOLEAN('z', "zero", &group, 695 OPT_BOOLEAN('z', "zero", &zero,
678 "zero history across updates"), 696 "zero history across updates"),
679 OPT_INTEGER('F', "freq", &freq, 697 OPT_INTEGER('F', "freq", &freq,
680 "profile at this frequency"), 698 "profile at this frequency"),
@@ -685,10 +703,12 @@ static const struct option options[] = {
685 OPT_END() 703 OPT_END()
686}; 704};
687 705
688int cmd_top(int argc, const char **argv, const char *prefix) 706int cmd_top(int argc, const char **argv, const char *prefix __used)
689{ 707{
690 int counter; 708 int counter;
691 709
710 symbol__init();
711
692 page_size = sysconf(_SC_PAGE_SIZE); 712 page_size = sysconf(_SC_PAGE_SIZE);
693 713
694 argc = parse_options(argc, argv, options, top_usage, 0); 714 argc = parse_options(argc, argv, options, top_usage, 0);
diff --git a/tools/perf/perf.c b/tools/perf/perf.c
index 4eb725933703..31982ad064b4 100644
--- a/tools/perf/perf.c
+++ b/tools/perf/perf.c
@@ -12,6 +12,8 @@
12#include "util/cache.h" 12#include "util/cache.h"
13#include "util/quote.h" 13#include "util/quote.h"
14#include "util/run-command.h" 14#include "util/run-command.h"
15#include "util/parse-events.h"
16#include "util/string.h"
15 17
16const char perf_usage_string[] = 18const char perf_usage_string[] =
17 "perf [--version] [--help] COMMAND [ARGS]"; 19 "perf [--version] [--help] COMMAND [ARGS]";
@@ -25,6 +27,8 @@ struct pager_config {
25 int val; 27 int val;
26}; 28};
27 29
30static char debugfs_mntpt[MAXPATHLEN];
31
28static int pager_command_config(const char *var, const char *value, void *data) 32static int pager_command_config(const char *var, const char *value, void *data)
29{ 33{
30 struct pager_config *c = data; 34 struct pager_config *c = data;
@@ -56,6 +60,15 @@ static void commit_pager_choice(void) {
56 } 60 }
57} 61}
58 62
63static void set_debugfs_path(void)
64{
65 char *path;
66
67 path = getenv(PERF_DEBUGFS_ENVIRONMENT);
68 snprintf(debugfs_path, MAXPATHLEN, "%s/%s", path ?: debugfs_mntpt,
69 "tracing/events");
70}
71
59static int handle_options(const char*** argv, int* argc, int* envchanged) 72static int handle_options(const char*** argv, int* argc, int* envchanged)
60{ 73{
61 int handled = 0; 74 int handled = 0;
@@ -122,6 +135,22 @@ static int handle_options(const char*** argv, int* argc, int* envchanged)
122 setenv(PERF_WORK_TREE_ENVIRONMENT, cmd + 12, 1); 135 setenv(PERF_WORK_TREE_ENVIRONMENT, cmd + 12, 1);
123 if (envchanged) 136 if (envchanged)
124 *envchanged = 1; 137 *envchanged = 1;
138 } else if (!strcmp(cmd, "--debugfs-dir")) {
139 if (*argc < 2) {
140 fprintf(stderr, "No directory given for --debugfs-dir.\n");
141 usage(perf_usage_string);
142 }
143 strncpy(debugfs_mntpt, (*argv)[1], MAXPATHLEN);
144 debugfs_mntpt[MAXPATHLEN - 1] = '\0';
145 if (envchanged)
146 *envchanged = 1;
147 (*argv)++;
148 (*argc)--;
149 } else if (!prefixcmp(cmd, "--debugfs-dir=")) {
150 strncpy(debugfs_mntpt, cmd + 14, MAXPATHLEN);
151 debugfs_mntpt[MAXPATHLEN - 1] = '\0';
152 if (envchanged)
153 *envchanged = 1;
125 } else { 154 } else {
126 fprintf(stderr, "Unknown option: %s\n", cmd); 155 fprintf(stderr, "Unknown option: %s\n", cmd);
127 usage(perf_usage_string); 156 usage(perf_usage_string);
@@ -228,9 +257,7 @@ static int run_builtin(struct cmd_struct *p, int argc, const char **argv)
228 if (use_pager == -1 && p->option & USE_PAGER) 257 if (use_pager == -1 && p->option & USE_PAGER)
229 use_pager = 1; 258 use_pager = 1;
230 commit_pager_choice(); 259 commit_pager_choice();
231 260 set_debugfs_path();
232 if (p->option & NEED_WORK_TREE)
233 /* setup_work_tree() */;
234 261
235 status = p->fn(argc, argv, prefix); 262 status = p->fn(argc, argv, prefix);
236 if (status) 263 if (status)
@@ -266,7 +293,7 @@ static void handle_internal_command(int argc, const char **argv)
266 { "annotate", cmd_annotate, 0 }, 293 { "annotate", cmd_annotate, 0 },
267 { "version", cmd_version, 0 }, 294 { "version", cmd_version, 0 },
268 }; 295 };
269 int i; 296 unsigned int i;
270 static const char ext[] = STRIP_EXTENSION; 297 static const char ext[] = STRIP_EXTENSION;
271 298
272 if (sizeof(ext) > 1) { 299 if (sizeof(ext) > 1) {
@@ -349,6 +376,49 @@ static int run_argv(int *argcp, const char ***argv)
349 return done_alias; 376 return done_alias;
350} 377}
351 378
379/* mini /proc/mounts parser: searching for "^blah /mount/point debugfs" */
380static void get_debugfs_mntpt(void)
381{
382 FILE *file;
383 char fs_type[100];
384 char debugfs[MAXPATHLEN];
385
386 /*
387 * try the standard location
388 */
389 if (valid_debugfs_mount("/sys/kernel/debug/") == 0) {
390 strcpy(debugfs_mntpt, "/sys/kernel/debug/");
391 return;
392 }
393
394 /*
395 * try the sane location
396 */
397 if (valid_debugfs_mount("/debug/") == 0) {
398 strcpy(debugfs_mntpt, "/debug/");
399 return;
400 }
401
402 /*
403 * give up and parse /proc/mounts
404 */
405 file = fopen("/proc/mounts", "r");
406 if (file == NULL)
407 return;
408
409 while (fscanf(file, "%*s %"
410 STR(MAXPATHLEN)
411 "s %99s %*s %*d %*d\n",
412 debugfs, fs_type) == 2) {
413 if (strcmp(fs_type, "debugfs") == 0)
414 break;
415 }
416 fclose(file);
417 if (strcmp(fs_type, "debugfs") == 0) {
418 strncpy(debugfs_mntpt, debugfs, MAXPATHLEN);
419 debugfs_mntpt[MAXPATHLEN - 1] = '\0';
420 }
421}
352 422
353int main(int argc, const char **argv) 423int main(int argc, const char **argv)
354{ 424{
@@ -357,7 +427,8 @@ int main(int argc, const char **argv)
357 cmd = perf_extract_argv0_path(argv[0]); 427 cmd = perf_extract_argv0_path(argv[0]);
358 if (!cmd) 428 if (!cmd)
359 cmd = "perf-help"; 429 cmd = "perf-help";
360 430 /* get debugfs mount point from /proc/mounts */
431 get_debugfs_mntpt();
361 /* 432 /*
362 * "perf-xxxx" is the same as "perf xxxx", but we obviously: 433 * "perf-xxxx" is the same as "perf xxxx", but we obviously:
363 * 434 *
@@ -380,6 +451,7 @@ int main(int argc, const char **argv)
380 argc--; 451 argc--;
381 handle_options(&argv, &argc, NULL); 452 handle_options(&argv, &argc, NULL);
382 commit_pager_choice(); 453 commit_pager_choice();
454 set_debugfs_path();
383 if (argc > 0) { 455 if (argc > 0) {
384 if (!prefixcmp(argv[0], "--")) 456 if (!prefixcmp(argv[0], "--"))
385 argv[0] += 2; 457 argv[0] += 2;
diff --git a/tools/perf/perf.h b/tools/perf/perf.h
index ceb68aa51f7f..e5148e2b6134 100644
--- a/tools/perf/perf.h
+++ b/tools/perf/perf.h
@@ -1,7 +1,13 @@
1#ifndef _PERF_PERF_H 1#ifndef _PERF_PERF_H
2#define _PERF_PERF_H 2#define _PERF_PERF_H
3 3
4#if defined(__x86_64__) || defined(__i386__) 4#if defined(__i386__)
5#include "../../arch/x86/include/asm/unistd.h"
6#define rmb() asm volatile("lock; addl $0,0(%%esp)" ::: "memory")
7#define cpu_relax() asm volatile("rep; nop" ::: "memory");
8#endif
9
10#if defined(__x86_64__)
5#include "../../arch/x86/include/asm/unistd.h" 11#include "../../arch/x86/include/asm/unistd.h"
6#define rmb() asm volatile("lfence" ::: "memory") 12#define rmb() asm volatile("lfence" ::: "memory")
7#define cpu_relax() asm volatile("rep; nop" ::: "memory"); 13#define cpu_relax() asm volatile("rep; nop" ::: "memory");
@@ -19,13 +25,29 @@
19#define cpu_relax() asm volatile("" ::: "memory"); 25#define cpu_relax() asm volatile("" ::: "memory");
20#endif 26#endif
21 27
28#ifdef __sh__
29#include "../../arch/sh/include/asm/unistd.h"
30#if defined(__SH4A__) || defined(__SH5__)
31# define rmb() asm volatile("synco" ::: "memory")
32#else
33# define rmb() asm volatile("" ::: "memory")
34#endif
35#define cpu_relax() asm volatile("" ::: "memory")
36#endif
37
38#ifdef __hppa__
39#include "../../arch/parisc/include/asm/unistd.h"
40#define rmb() asm volatile("" ::: "memory")
41#define cpu_relax() asm volatile("" ::: "memory");
42#endif
43
22#include <time.h> 44#include <time.h>
23#include <unistd.h> 45#include <unistd.h>
24#include <sys/types.h> 46#include <sys/types.h>
25#include <sys/syscall.h> 47#include <sys/syscall.h>
26 48
27#include "../../include/linux/perf_counter.h" 49#include "../../include/linux/perf_counter.h"
28#include "types.h" 50#include "util/types.h"
29 51
30/* 52/*
31 * prctl(PR_TASK_PERF_COUNTERS_DISABLE) will (cheaply) disable all 53 * prctl(PR_TASK_PERF_COUNTERS_DISABLE) will (cheaply) disable all
@@ -52,6 +74,8 @@ static inline unsigned long long rdclock(void)
52#define __user 74#define __user
53#define asmlinkage 75#define asmlinkage
54 76
77#define __used __attribute__((__unused__))
78
55#define unlikely(x) __builtin_expect(!!(x), 0) 79#define unlikely(x) __builtin_expect(!!(x), 0)
56#define min(x, y) ({ \ 80#define min(x, y) ({ \
57 typeof(x) _min1 = (x); \ 81 typeof(x) _min1 = (x); \
@@ -72,10 +96,9 @@ sys_perf_counter_open(struct perf_counter_attr *attr,
72#define MAX_COUNTERS 256 96#define MAX_COUNTERS 256
73#define MAX_NR_CPUS 256 97#define MAX_NR_CPUS 256
74 98
75struct perf_file_header { 99struct ip_callchain {
76 u64 version; 100 u64 nr;
77 u64 sample_type; 101 u64 ips[0];
78 u64 data_size;
79}; 102};
80 103
81#endif 104#endif
diff --git a/tools/perf/util/alias.c b/tools/perf/util/alias.c
index 9b3dd2b428df..b8144e80bb1e 100644
--- a/tools/perf/util/alias.c
+++ b/tools/perf/util/alias.c
@@ -3,7 +3,7 @@
3static const char *alias_key; 3static const char *alias_key;
4static char *alias_val; 4static char *alias_val;
5 5
6static int alias_lookup_cb(const char *k, const char *v, void *cb) 6static int alias_lookup_cb(const char *k, const char *v, void *cb __used)
7{ 7{
8 if (!prefixcmp(k, "alias.") && !strcmp(k+6, alias_key)) { 8 if (!prefixcmp(k, "alias.") && !strcmp(k+6, alias_key)) {
9 if (!v) 9 if (!v)
diff --git a/tools/perf/util/cache.h b/tools/perf/util/cache.h
index 393d6146d13b..4b50c412b9c5 100644
--- a/tools/perf/util/cache.h
+++ b/tools/perf/util/cache.h
@@ -3,6 +3,7 @@
3 3
4#include "util.h" 4#include "util.h"
5#include "strbuf.h" 5#include "strbuf.h"
6#include "../perf.h"
6 7
7#define PERF_DIR_ENVIRONMENT "PERF_DIR" 8#define PERF_DIR_ENVIRONMENT "PERF_DIR"
8#define PERF_WORK_TREE_ENVIRONMENT "PERF_WORK_TREE" 9#define PERF_WORK_TREE_ENVIRONMENT "PERF_WORK_TREE"
@@ -17,6 +18,7 @@
17#define PERFATTRIBUTES_FILE ".perfattributes" 18#define PERFATTRIBUTES_FILE ".perfattributes"
18#define INFOATTRIBUTES_FILE "info/attributes" 19#define INFOATTRIBUTES_FILE "info/attributes"
19#define ATTRIBUTE_MACRO_PREFIX "[attr]" 20#define ATTRIBUTE_MACRO_PREFIX "[attr]"
21#define PERF_DEBUGFS_ENVIRONMENT "PERF_DEBUGFS_DIR"
20 22
21typedef int (*config_fn_t)(const char *, const char *, void *); 23typedef int (*config_fn_t)(const char *, const char *, void *);
22extern int perf_default_config(const char *, const char *, void *); 24extern int perf_default_config(const char *, const char *, void *);
diff --git a/tools/perf/util/callchain.c b/tools/perf/util/callchain.c
new file mode 100644
index 000000000000..9d3c8141b8c1
--- /dev/null
+++ b/tools/perf/util/callchain.c
@@ -0,0 +1,335 @@
1/*
2 * Copyright (C) 2009, Frederic Weisbecker <fweisbec@gmail.com>
3 *
4 * Handle the callchains from the stream in an ad-hoc radix tree and then
5 * sort them in an rbtree.
6 *
7 * Using a radix for code path provides a fast retrieval and factorizes
8 * memory use. Also that lets us use the paths in a hierarchical graph view.
9 *
10 */
11
12#include <stdlib.h>
13#include <stdio.h>
14#include <stdbool.h>
15#include <errno.h>
16
17#include "callchain.h"
18
19#define chain_for_each_child(child, parent) \
20 list_for_each_entry(child, &parent->children, brothers)
21
22static void
23rb_insert_callchain(struct rb_root *root, struct callchain_node *chain,
24 enum chain_mode mode)
25{
26 struct rb_node **p = &root->rb_node;
27 struct rb_node *parent = NULL;
28 struct callchain_node *rnode;
29
30 while (*p) {
31 parent = *p;
32 rnode = rb_entry(parent, struct callchain_node, rb_node);
33
34 switch (mode) {
35 case CHAIN_FLAT:
36 if (rnode->hit < chain->hit)
37 p = &(*p)->rb_left;
38 else
39 p = &(*p)->rb_right;
40 break;
41 case CHAIN_GRAPH_ABS: /* Falldown */
42 case CHAIN_GRAPH_REL:
43 if (rnode->cumul_hit < chain->cumul_hit)
44 p = &(*p)->rb_left;
45 else
46 p = &(*p)->rb_right;
47 break;
48 default:
49 break;
50 }
51 }
52
53 rb_link_node(&chain->rb_node, parent, p);
54 rb_insert_color(&chain->rb_node, root);
55}
56
57static void
58__sort_chain_flat(struct rb_root *rb_root, struct callchain_node *node,
59 u64 min_hit)
60{
61 struct callchain_node *child;
62
63 chain_for_each_child(child, node)
64 __sort_chain_flat(rb_root, child, min_hit);
65
66 if (node->hit && node->hit >= min_hit)
67 rb_insert_callchain(rb_root, node, CHAIN_FLAT);
68}
69
70/*
71 * Once we get every callchains from the stream, we can now
72 * sort them by hit
73 */
74static void
75sort_chain_flat(struct rb_root *rb_root, struct callchain_node *node,
76 u64 min_hit, struct callchain_param *param __used)
77{
78 __sort_chain_flat(rb_root, node, min_hit);
79}
80
81static void __sort_chain_graph_abs(struct callchain_node *node,
82 u64 min_hit)
83{
84 struct callchain_node *child;
85
86 node->rb_root = RB_ROOT;
87
88 chain_for_each_child(child, node) {
89 __sort_chain_graph_abs(child, min_hit);
90 if (child->cumul_hit >= min_hit)
91 rb_insert_callchain(&node->rb_root, child,
92 CHAIN_GRAPH_ABS);
93 }
94}
95
96static void
97sort_chain_graph_abs(struct rb_root *rb_root, struct callchain_node *chain_root,
98 u64 min_hit, struct callchain_param *param __used)
99{
100 __sort_chain_graph_abs(chain_root, min_hit);
101 rb_root->rb_node = chain_root->rb_root.rb_node;
102}
103
104static void __sort_chain_graph_rel(struct callchain_node *node,
105 double min_percent)
106{
107 struct callchain_node *child;
108 u64 min_hit;
109
110 node->rb_root = RB_ROOT;
111 min_hit = node->cumul_hit * min_percent / 100.0;
112
113 chain_for_each_child(child, node) {
114 __sort_chain_graph_rel(child, min_percent);
115 if (child->cumul_hit >= min_hit)
116 rb_insert_callchain(&node->rb_root, child,
117 CHAIN_GRAPH_REL);
118 }
119}
120
121static void
122sort_chain_graph_rel(struct rb_root *rb_root, struct callchain_node *chain_root,
123 u64 min_hit __used, struct callchain_param *param)
124{
125 __sort_chain_graph_rel(chain_root, param->min_percent);
126 rb_root->rb_node = chain_root->rb_root.rb_node;
127}
128
129int register_callchain_param(struct callchain_param *param)
130{
131 switch (param->mode) {
132 case CHAIN_GRAPH_ABS:
133 param->sort = sort_chain_graph_abs;
134 break;
135 case CHAIN_GRAPH_REL:
136 param->sort = sort_chain_graph_rel;
137 break;
138 case CHAIN_FLAT:
139 param->sort = sort_chain_flat;
140 break;
141 default:
142 return -1;
143 }
144 return 0;
145}
146
147/*
148 * Create a child for a parent. If inherit_children, then the new child
149 * will become the new parent of it's parent children
150 */
151static struct callchain_node *
152create_child(struct callchain_node *parent, bool inherit_children)
153{
154 struct callchain_node *new;
155
156 new = malloc(sizeof(*new));
157 if (!new) {
158 perror("not enough memory to create child for code path tree");
159 return NULL;
160 }
161 new->parent = parent;
162 INIT_LIST_HEAD(&new->children);
163 INIT_LIST_HEAD(&new->val);
164
165 if (inherit_children) {
166 struct callchain_node *next;
167
168 list_splice(&parent->children, &new->children);
169 INIT_LIST_HEAD(&parent->children);
170
171 chain_for_each_child(next, new)
172 next->parent = new;
173 }
174 list_add_tail(&new->brothers, &parent->children);
175
176 return new;
177}
178
179/*
180 * Fill the node with callchain values
181 */
182static void
183fill_node(struct callchain_node *node, struct ip_callchain *chain,
184 int start, struct symbol **syms)
185{
186 unsigned int i;
187
188 for (i = start; i < chain->nr; i++) {
189 struct callchain_list *call;
190
191 call = malloc(sizeof(*call));
192 if (!call) {
193 perror("not enough memory for the code path tree");
194 return;
195 }
196 call->ip = chain->ips[i];
197 call->sym = syms[i];
198 list_add_tail(&call->list, &node->val);
199 }
200 node->val_nr = chain->nr - start;
201 if (!node->val_nr)
202 printf("Warning: empty node in callchain tree\n");
203}
204
205static void
206add_child(struct callchain_node *parent, struct ip_callchain *chain,
207 int start, struct symbol **syms)
208{
209 struct callchain_node *new;
210
211 new = create_child(parent, false);
212 fill_node(new, chain, start, syms);
213
214 new->cumul_hit = new->hit = 1;
215}
216
217/*
218 * Split the parent in two parts (a new child is created) and
219 * give a part of its callchain to the created child.
220 * Then create another child to host the given callchain of new branch
221 */
222static void
223split_add_child(struct callchain_node *parent, struct ip_callchain *chain,
224 struct callchain_list *to_split, int idx_parents, int idx_local,
225 struct symbol **syms)
226{
227 struct callchain_node *new;
228 struct list_head *old_tail;
229 unsigned int idx_total = idx_parents + idx_local;
230
231 /* split */
232 new = create_child(parent, true);
233
234 /* split the callchain and move a part to the new child */
235 old_tail = parent->val.prev;
236 list_del_range(&to_split->list, old_tail);
237 new->val.next = &to_split->list;
238 new->val.prev = old_tail;
239 to_split->list.prev = &new->val;
240 old_tail->next = &new->val;
241
242 /* split the hits */
243 new->hit = parent->hit;
244 new->cumul_hit = parent->cumul_hit;
245 new->val_nr = parent->val_nr - idx_local;
246 parent->val_nr = idx_local;
247
248 /* create a new child for the new branch if any */
249 if (idx_total < chain->nr) {
250 parent->hit = 0;
251 add_child(parent, chain, idx_total, syms);
252 } else {
253 parent->hit = 1;
254 }
255}
256
257static int
258__append_chain(struct callchain_node *root, struct ip_callchain *chain,
259 unsigned int start, struct symbol **syms);
260
261static void
262__append_chain_children(struct callchain_node *root, struct ip_callchain *chain,
263 struct symbol **syms, unsigned int start)
264{
265 struct callchain_node *rnode;
266
267 /* lookup in childrens */
268 chain_for_each_child(rnode, root) {
269 unsigned int ret = __append_chain(rnode, chain, start, syms);
270
271 if (!ret)
272 goto cumul;
273 }
274 /* nothing in children, add to the current node */
275 add_child(root, chain, start, syms);
276
277cumul:
278 root->cumul_hit++;
279}
280
281static int
282__append_chain(struct callchain_node *root, struct ip_callchain *chain,
283 unsigned int start, struct symbol **syms)
284{
285 struct callchain_list *cnode;
286 unsigned int i = start;
287 bool found = false;
288
289 /*
290 * Lookup in the current node
291 * If we have a symbol, then compare the start to match
292 * anywhere inside a function.
293 */
294 list_for_each_entry(cnode, &root->val, list) {
295 if (i == chain->nr)
296 break;
297 if (cnode->sym && syms[i]) {
298 if (cnode->sym->start != syms[i]->start)
299 break;
300 } else if (cnode->ip != chain->ips[i])
301 break;
302 if (!found)
303 found = true;
304 i++;
305 }
306
307 /* matches not, relay on the parent */
308 if (!found)
309 return -1;
310
311 /* we match only a part of the node. Split it and add the new chain */
312 if (i - start < root->val_nr) {
313 split_add_child(root, chain, cnode, start, i - start, syms);
314 return 0;
315 }
316
317 /* we match 100% of the path, increment the hit */
318 if (i - start == root->val_nr && i == chain->nr) {
319 root->hit++;
320 root->cumul_hit++;
321
322 return 0;
323 }
324
325 /* We match the node and still have a part remaining */
326 __append_chain_children(root, chain, syms, i);
327
328 return 0;
329}
330
331void append_chain(struct callchain_node *root, struct ip_callchain *chain,
332 struct symbol **syms)
333{
334 __append_chain_children(root, chain, syms, 0);
335}
diff --git a/tools/perf/util/callchain.h b/tools/perf/util/callchain.h
new file mode 100644
index 000000000000..7812122bea1d
--- /dev/null
+++ b/tools/perf/util/callchain.h
@@ -0,0 +1,54 @@
1#ifndef __PERF_CALLCHAIN_H
2#define __PERF_CALLCHAIN_H
3
4#include "../perf.h"
5#include <linux/list.h>
6#include <linux/rbtree.h>
7#include "symbol.h"
8
9enum chain_mode {
10 CHAIN_FLAT,
11 CHAIN_GRAPH_ABS,
12 CHAIN_GRAPH_REL
13};
14
15struct callchain_node {
16 struct callchain_node *parent;
17 struct list_head brothers;
18 struct list_head children;
19 struct list_head val;
20 struct rb_node rb_node; /* to sort nodes in an rbtree */
21 struct rb_root rb_root; /* sorted tree of children */
22 unsigned int val_nr;
23 u64 hit;
24 u64 cumul_hit; /* hit + hits of children */
25};
26
27struct callchain_param;
28
29typedef void (*sort_chain_func_t)(struct rb_root *, struct callchain_node *,
30 u64, struct callchain_param *);
31
32struct callchain_param {
33 enum chain_mode mode;
34 double min_percent;
35 sort_chain_func_t sort;
36};
37
38struct callchain_list {
39 u64 ip;
40 struct symbol *sym;
41 struct list_head list;
42};
43
44static inline void callchain_init(struct callchain_node *node)
45{
46 INIT_LIST_HEAD(&node->brothers);
47 INIT_LIST_HEAD(&node->children);
48 INIT_LIST_HEAD(&node->val);
49}
50
51int register_callchain_param(struct callchain_param *param);
52void append_chain(struct callchain_node *root, struct ip_callchain *chain,
53 struct symbol **syms);
54#endif
diff --git a/tools/perf/util/color.c b/tools/perf/util/color.c
index 9a8c20ccc53e..90a044d1fe7d 100644
--- a/tools/perf/util/color.c
+++ b/tools/perf/util/color.c
@@ -11,7 +11,8 @@ static int parse_color(const char *name, int len)
11 }; 11 };
12 char *end; 12 char *end;
13 int i; 13 int i;
14 for (i = 0; i < ARRAY_SIZE(color_names); i++) { 14
15 for (i = 0; i < (int)ARRAY_SIZE(color_names); i++) {
15 const char *str = color_names[i]; 16 const char *str = color_names[i];
16 if (!strncasecmp(name, str, len) && !str[len]) 17 if (!strncasecmp(name, str, len) && !str[len])
17 return i - 1; 18 return i - 1;
@@ -28,7 +29,8 @@ static int parse_attr(const char *name, int len)
28 static const char * const attr_names[] = { 29 static const char * const attr_names[] = {
29 "bold", "dim", "ul", "blink", "reverse" 30 "bold", "dim", "ul", "blink", "reverse"
30 }; 31 };
31 int i; 32 unsigned int i;
33
32 for (i = 0; i < ARRAY_SIZE(attr_names); i++) { 34 for (i = 0; i < ARRAY_SIZE(attr_names); i++) {
33 const char *str = attr_names[i]; 35 const char *str = attr_names[i];
34 if (!strncasecmp(name, str, len) && !str[len]) 36 if (!strncasecmp(name, str, len) && !str[len])
@@ -222,10 +224,12 @@ int color_fwrite_lines(FILE *fp, const char *color,
222{ 224{
223 if (!*color) 225 if (!*color)
224 return fwrite(buf, count, 1, fp) != 1; 226 return fwrite(buf, count, 1, fp) != 1;
227
225 while (count) { 228 while (count) {
226 char *p = memchr(buf, '\n', count); 229 char *p = memchr(buf, '\n', count);
230
227 if (p != buf && (fputs(color, fp) < 0 || 231 if (p != buf && (fputs(color, fp) < 0 ||
228 fwrite(buf, p ? p - buf : count, 1, fp) != 1 || 232 fwrite(buf, p ? (size_t)(p - buf) : count, 1, fp) != 1 ||
229 fputs(PERF_COLOR_RESET, fp) < 0)) 233 fputs(PERF_COLOR_RESET, fp) < 0))
230 return -1; 234 return -1;
231 if (!p) 235 if (!p)
@@ -238,4 +242,31 @@ int color_fwrite_lines(FILE *fp, const char *color,
238 return 0; 242 return 0;
239} 243}
240 244
245char *get_percent_color(double percent)
246{
247 char *color = PERF_COLOR_NORMAL;
241 248
249 /*
250 * We color high-overhead entries in red, mid-overhead
251 * entries in green - and keep the low overhead places
252 * normal:
253 */
254 if (percent >= MIN_RED)
255 color = PERF_COLOR_RED;
256 else {
257 if (percent > MIN_GREEN)
258 color = PERF_COLOR_GREEN;
259 }
260 return color;
261}
262
263int percent_color_fprintf(FILE *fp, const char *fmt, double percent)
264{
265 int r;
266 char *color;
267
268 color = get_percent_color(percent);
269 r = color_fprintf(fp, color, fmt, percent);
270
271 return r;
272}
diff --git a/tools/perf/util/color.h b/tools/perf/util/color.h
index 5abfd379582b..706cec50bd25 100644
--- a/tools/perf/util/color.h
+++ b/tools/perf/util/color.h
@@ -15,6 +15,9 @@
15#define PERF_COLOR_CYAN "\033[36m" 15#define PERF_COLOR_CYAN "\033[36m"
16#define PERF_COLOR_BG_RED "\033[41m" 16#define PERF_COLOR_BG_RED "\033[41m"
17 17
18#define MIN_GREEN 0.5
19#define MIN_RED 5.0
20
18/* 21/*
19 * This variable stores the value of color.ui 22 * This variable stores the value of color.ui
20 */ 23 */
@@ -32,5 +35,7 @@ void color_parse_mem(const char *value, int len, const char *var, char *dst);
32int color_fprintf(FILE *fp, const char *color, const char *fmt, ...); 35int color_fprintf(FILE *fp, const char *color, const char *fmt, ...);
33int color_fprintf_ln(FILE *fp, const char *color, const char *fmt, ...); 36int color_fprintf_ln(FILE *fp, const char *color, const char *fmt, ...);
34int color_fwrite_lines(FILE *fp, const char *color, size_t count, const char *buf); 37int color_fwrite_lines(FILE *fp, const char *color, size_t count, const char *buf);
38int percent_color_fprintf(FILE *fp, const char *fmt, double percent);
39char *get_percent_color(double percent);
35 40
36#endif /* COLOR_H */ 41#endif /* COLOR_H */
diff --git a/tools/perf/util/config.c b/tools/perf/util/config.c
index 3dd13faa6a27..780df541006d 100644
--- a/tools/perf/util/config.c
+++ b/tools/perf/util/config.c
@@ -47,10 +47,12 @@ static int get_next_char(void)
47static char *parse_value(void) 47static char *parse_value(void)
48{ 48{
49 static char value[1024]; 49 static char value[1024];
50 int quote = 0, comment = 0, len = 0, space = 0; 50 int quote = 0, comment = 0, space = 0;
51 size_t len = 0;
51 52
52 for (;;) { 53 for (;;) {
53 int c = get_next_char(); 54 int c = get_next_char();
55
54 if (len >= sizeof(value) - 1) 56 if (len >= sizeof(value) - 1)
55 return NULL; 57 return NULL;
56 if (c == '\n') { 58 if (c == '\n') {
@@ -353,13 +355,13 @@ int perf_config_string(const char **dest, const char *var, const char *value)
353 return 0; 355 return 0;
354} 356}
355 357
356static int perf_default_core_config(const char *var, const char *value) 358static int perf_default_core_config(const char *var __used, const char *value __used)
357{ 359{
358 /* Add other config variables here and to Documentation/config.txt. */ 360 /* Add other config variables here and to Documentation/config.txt. */
359 return 0; 361 return 0;
360} 362}
361 363
362int perf_default_config(const char *var, const char *value, void *dummy) 364int perf_default_config(const char *var, const char *value, void *dummy __used)
363{ 365{
364 if (!prefixcmp(var, "core.")) 366 if (!prefixcmp(var, "core."))
365 return perf_default_core_config(var, value); 367 return perf_default_core_config(var, value);
@@ -471,10 +473,10 @@ static int matches(const char* key, const char* value)
471 !regexec(store.value_regex, value, 0, NULL, 0))); 473 !regexec(store.value_regex, value, 0, NULL, 0)));
472} 474}
473 475
474static int store_aux(const char* key, const char* value, void *cb) 476static int store_aux(const char* key, const char* value, void *cb __used)
475{ 477{
478 int section_len;
476 const char *ep; 479 const char *ep;
477 size_t section_len;
478 480
479 switch (store.state) { 481 switch (store.state) {
480 case KEY_SEEN: 482 case KEY_SEEN:
@@ -551,7 +553,7 @@ static int store_write_section(int fd, const char* key)
551 strbuf_addf(&sb, "[%.*s]\n", store.baselen, key); 553 strbuf_addf(&sb, "[%.*s]\n", store.baselen, key);
552 } 554 }
553 555
554 success = write_in_full(fd, sb.buf, sb.len) == sb.len; 556 success = (write_in_full(fd, sb.buf, sb.len) == (ssize_t)sb.len);
555 strbuf_release(&sb); 557 strbuf_release(&sb);
556 558
557 return success; 559 return success;
@@ -599,7 +601,7 @@ static int store_write_pair(int fd, const char* key, const char* value)
599 } 601 }
600 strbuf_addf(&sb, "%s\n", quote); 602 strbuf_addf(&sb, "%s\n", quote);
601 603
602 success = write_in_full(fd, sb.buf, sb.len) == sb.len; 604 success = (write_in_full(fd, sb.buf, sb.len) == (ssize_t)sb.len);
603 strbuf_release(&sb); 605 strbuf_release(&sb);
604 606
605 return success; 607 return success;
@@ -741,7 +743,7 @@ int perf_config_set_multivar(const char* key, const char* value,
741 } else { 743 } else {
742 struct stat st; 744 struct stat st;
743 char* contents; 745 char* contents;
744 size_t contents_sz, copy_begin, copy_end; 746 ssize_t contents_sz, copy_begin, copy_end;
745 int i, new_line = 0; 747 int i, new_line = 0;
746 748
747 if (value_regex == NULL) 749 if (value_regex == NULL)
diff --git a/tools/perf/util/exec_cmd.c b/tools/perf/util/exec_cmd.c
index d39292263153..34a352867382 100644
--- a/tools/perf/util/exec_cmd.c
+++ b/tools/perf/util/exec_cmd.c
@@ -1,6 +1,9 @@
1#include "cache.h" 1#include "cache.h"
2#include "exec_cmd.h" 2#include "exec_cmd.h"
3#include "quote.h" 3#include "quote.h"
4
5#include <string.h>
6
4#define MAX_ARGS 32 7#define MAX_ARGS 32
5 8
6extern char **environ; 9extern char **environ;
@@ -51,7 +54,7 @@ const char *perf_extract_argv0_path(const char *argv0)
51 slash--; 54 slash--;
52 55
53 if (slash >= argv0) { 56 if (slash >= argv0) {
54 argv0_path = strndup(argv0, slash - argv0); 57 argv0_path = xstrndup(argv0, slash - argv0);
55 return slash + 1; 58 return slash + 1;
56 } 59 }
57 60
diff --git a/tools/perf/util/header.c b/tools/perf/util/header.c
new file mode 100644
index 000000000000..450384b3bbe5
--- /dev/null
+++ b/tools/perf/util/header.c
@@ -0,0 +1,242 @@
1#include <sys/types.h>
2#include <unistd.h>
3#include <stdio.h>
4#include <stdlib.h>
5
6#include "util.h"
7#include "header.h"
8
9/*
10 *
11 */
12
13struct perf_header_attr *perf_header_attr__new(struct perf_counter_attr *attr)
14{
15 struct perf_header_attr *self = malloc(sizeof(*self));
16
17 if (!self)
18 die("nomem");
19
20 self->attr = *attr;
21 self->ids = 0;
22 self->size = 1;
23 self->id = malloc(sizeof(u64));
24
25 if (!self->id)
26 die("nomem");
27
28 return self;
29}
30
31void perf_header_attr__add_id(struct perf_header_attr *self, u64 id)
32{
33 int pos = self->ids;
34
35 self->ids++;
36 if (self->ids > self->size) {
37 self->size *= 2;
38 self->id = realloc(self->id, self->size * sizeof(u64));
39 if (!self->id)
40 die("nomem");
41 }
42 self->id[pos] = id;
43}
44
45/*
46 *
47 */
48
49struct perf_header *perf_header__new(void)
50{
51 struct perf_header *self = malloc(sizeof(*self));
52
53 if (!self)
54 die("nomem");
55
56 self->frozen = 0;
57
58 self->attrs = 0;
59 self->size = 1;
60 self->attr = malloc(sizeof(void *));
61
62 if (!self->attr)
63 die("nomem");
64
65 self->data_offset = 0;
66 self->data_size = 0;
67
68 return self;
69}
70
71void perf_header__add_attr(struct perf_header *self,
72 struct perf_header_attr *attr)
73{
74 int pos = self->attrs;
75
76 if (self->frozen)
77 die("frozen");
78
79 self->attrs++;
80 if (self->attrs > self->size) {
81 self->size *= 2;
82 self->attr = realloc(self->attr, self->size * sizeof(void *));
83 if (!self->attr)
84 die("nomem");
85 }
86 self->attr[pos] = attr;
87}
88
89static const char *__perf_magic = "PERFFILE";
90
91#define PERF_MAGIC (*(u64 *)__perf_magic)
92
93struct perf_file_section {
94 u64 offset;
95 u64 size;
96};
97
98struct perf_file_attr {
99 struct perf_counter_attr attr;
100 struct perf_file_section ids;
101};
102
103struct perf_file_header {
104 u64 magic;
105 u64 size;
106 u64 attr_size;
107 struct perf_file_section attrs;
108 struct perf_file_section data;
109};
110
111static void do_write(int fd, void *buf, size_t size)
112{
113 while (size) {
114 int ret = write(fd, buf, size);
115
116 if (ret < 0)
117 die("failed to write");
118
119 size -= ret;
120 buf += ret;
121 }
122}
123
124void perf_header__write(struct perf_header *self, int fd)
125{
126 struct perf_file_header f_header;
127 struct perf_file_attr f_attr;
128 struct perf_header_attr *attr;
129 int i;
130
131 lseek(fd, sizeof(f_header), SEEK_SET);
132
133
134 for (i = 0; i < self->attrs; i++) {
135 attr = self->attr[i];
136
137 attr->id_offset = lseek(fd, 0, SEEK_CUR);
138 do_write(fd, attr->id, attr->ids * sizeof(u64));
139 }
140
141
142 self->attr_offset = lseek(fd, 0, SEEK_CUR);
143
144 for (i = 0; i < self->attrs; i++) {
145 attr = self->attr[i];
146
147 f_attr = (struct perf_file_attr){
148 .attr = attr->attr,
149 .ids = {
150 .offset = attr->id_offset,
151 .size = attr->ids * sizeof(u64),
152 }
153 };
154 do_write(fd, &f_attr, sizeof(f_attr));
155 }
156
157
158 self->data_offset = lseek(fd, 0, SEEK_CUR);
159
160 f_header = (struct perf_file_header){
161 .magic = PERF_MAGIC,
162 .size = sizeof(f_header),
163 .attr_size = sizeof(f_attr),
164 .attrs = {
165 .offset = self->attr_offset,
166 .size = self->attrs * sizeof(f_attr),
167 },
168 .data = {
169 .offset = self->data_offset,
170 .size = self->data_size,
171 },
172 };
173
174 lseek(fd, 0, SEEK_SET);
175 do_write(fd, &f_header, sizeof(f_header));
176 lseek(fd, self->data_offset + self->data_size, SEEK_SET);
177
178 self->frozen = 1;
179}
180
181static void do_read(int fd, void *buf, size_t size)
182{
183 while (size) {
184 int ret = read(fd, buf, size);
185
186 if (ret < 0)
187 die("failed to read");
188
189 size -= ret;
190 buf += ret;
191 }
192}
193
194struct perf_header *perf_header__read(int fd)
195{
196 struct perf_header *self = perf_header__new();
197 struct perf_file_header f_header;
198 struct perf_file_attr f_attr;
199 u64 f_id;
200
201 int nr_attrs, nr_ids, i, j;
202
203 lseek(fd, 0, SEEK_SET);
204 do_read(fd, &f_header, sizeof(f_header));
205
206 if (f_header.magic != PERF_MAGIC ||
207 f_header.size != sizeof(f_header) ||
208 f_header.attr_size != sizeof(f_attr))
209 die("incompatible file format");
210
211 nr_attrs = f_header.attrs.size / sizeof(f_attr);
212 lseek(fd, f_header.attrs.offset, SEEK_SET);
213
214 for (i = 0; i < nr_attrs; i++) {
215 struct perf_header_attr *attr;
216 off_t tmp = lseek(fd, 0, SEEK_CUR);
217
218 do_read(fd, &f_attr, sizeof(f_attr));
219
220 attr = perf_header_attr__new(&f_attr.attr);
221
222 nr_ids = f_attr.ids.size / sizeof(u64);
223 lseek(fd, f_attr.ids.offset, SEEK_SET);
224
225 for (j = 0; j < nr_ids; j++) {
226 do_read(fd, &f_id, sizeof(f_id));
227
228 perf_header_attr__add_id(attr, f_id);
229 }
230 perf_header__add_attr(self, attr);
231 lseek(fd, tmp, SEEK_SET);
232 }
233
234 self->data_offset = f_header.data.offset;
235 self->data_size = f_header.data.size;
236
237 lseek(fd, self->data_offset + self->data_size, SEEK_SET);
238
239 self->frozen = 1;
240
241 return self;
242}
diff --git a/tools/perf/util/header.h b/tools/perf/util/header.h
new file mode 100644
index 000000000000..bf280449fcfd
--- /dev/null
+++ b/tools/perf/util/header.h
@@ -0,0 +1,37 @@
1#ifndef _PERF_HEADER_H
2#define _PERF_HEADER_H
3
4#include "../../../include/linux/perf_counter.h"
5#include <sys/types.h>
6#include "types.h"
7
8struct perf_header_attr {
9 struct perf_counter_attr attr;
10 int ids, size;
11 u64 *id;
12 off_t id_offset;
13};
14
15struct perf_header {
16 int frozen;
17 int attrs, size;
18 struct perf_header_attr **attr;
19 s64 attr_offset;
20 u64 data_offset;
21 u64 data_size;
22};
23
24struct perf_header *perf_header__read(int fd);
25void perf_header__write(struct perf_header *self, int fd);
26
27void perf_header__add_attr(struct perf_header *self,
28 struct perf_header_attr *attr);
29
30struct perf_header_attr *
31perf_header_attr__new(struct perf_counter_attr *attr);
32void perf_header_attr__add_id(struct perf_header_attr *self, u64 id);
33
34
35struct perf_header *perf_header__new(void);
36
37#endif /* _PERF_HEADER_H */
diff --git a/tools/perf/util/help.c b/tools/perf/util/help.c
index 6653f7dd1d78..fbb00978b2e2 100644
--- a/tools/perf/util/help.c
+++ b/tools/perf/util/help.c
@@ -26,7 +26,7 @@ static int term_columns(void)
26 return 80; 26 return 80;
27} 27}
28 28
29void add_cmdname(struct cmdnames *cmds, const char *name, int len) 29void add_cmdname(struct cmdnames *cmds, const char *name, size_t len)
30{ 30{
31 struct cmdname *ent = malloc(sizeof(*ent) + len + 1); 31 struct cmdname *ent = malloc(sizeof(*ent) + len + 1);
32 32
@@ -40,7 +40,8 @@ void add_cmdname(struct cmdnames *cmds, const char *name, int len)
40 40
41static void clean_cmdnames(struct cmdnames *cmds) 41static void clean_cmdnames(struct cmdnames *cmds)
42{ 42{
43 int i; 43 unsigned int i;
44
44 for (i = 0; i < cmds->cnt; ++i) 45 for (i = 0; i < cmds->cnt; ++i)
45 free(cmds->names[i]); 46 free(cmds->names[i]);
46 free(cmds->names); 47 free(cmds->names);
@@ -57,7 +58,7 @@ static int cmdname_compare(const void *a_, const void *b_)
57 58
58static void uniq(struct cmdnames *cmds) 59static void uniq(struct cmdnames *cmds)
59{ 60{
60 int i, j; 61 unsigned int i, j;
61 62
62 if (!cmds->cnt) 63 if (!cmds->cnt)
63 return; 64 return;
@@ -71,7 +72,7 @@ static void uniq(struct cmdnames *cmds)
71 72
72void exclude_cmds(struct cmdnames *cmds, struct cmdnames *excludes) 73void exclude_cmds(struct cmdnames *cmds, struct cmdnames *excludes)
73{ 74{
74 int ci, cj, ei; 75 size_t ci, cj, ei;
75 int cmp; 76 int cmp;
76 77
77 ci = cj = ei = 0; 78 ci = cj = ei = 0;
@@ -106,8 +107,9 @@ static void pretty_print_string_list(struct cmdnames *cmds, int longest)
106 printf(" "); 107 printf(" ");
107 108
108 for (j = 0; j < cols; j++) { 109 for (j = 0; j < cols; j++) {
109 int n = j * rows + i; 110 unsigned int n = j * rows + i;
110 int size = space; 111 unsigned int size = space;
112
111 if (n >= cmds->cnt) 113 if (n >= cmds->cnt)
112 break; 114 break;
113 if (j == cols-1 || n + rows >= cmds->cnt) 115 if (j == cols-1 || n + rows >= cmds->cnt)
@@ -126,21 +128,6 @@ static int is_executable(const char *name)
126 !S_ISREG(st.st_mode)) 128 !S_ISREG(st.st_mode))
127 return 0; 129 return 0;
128 130
129#ifdef __MINGW32__
130 /* cannot trust the executable bit, peek into the file instead */
131 char buf[3] = { 0 };
132 int n;
133 int fd = open(name, O_RDONLY);
134 st.st_mode &= ~S_IXUSR;
135 if (fd >= 0) {
136 n = read(fd, buf, 2);
137 if (n == 2)
138 /* DOS executables start with "MZ" */
139 if (!strcmp(buf, "#!") || !strcmp(buf, "MZ"))
140 st.st_mode |= S_IXUSR;
141 close(fd);
142 }
143#endif
144 return st.st_mode & S_IXUSR; 131 return st.st_mode & S_IXUSR;
145} 132}
146 133
@@ -223,7 +210,7 @@ void load_command_list(const char *prefix,
223void list_commands(const char *title, struct cmdnames *main_cmds, 210void list_commands(const char *title, struct cmdnames *main_cmds,
224 struct cmdnames *other_cmds) 211 struct cmdnames *other_cmds)
225{ 212{
226 int i, longest = 0; 213 unsigned int i, longest = 0;
227 214
228 for (i = 0; i < main_cmds->cnt; i++) 215 for (i = 0; i < main_cmds->cnt; i++)
229 if (longest < main_cmds->names[i]->len) 216 if (longest < main_cmds->names[i]->len)
@@ -254,7 +241,8 @@ void list_commands(const char *title, struct cmdnames *main_cmds,
254 241
255int is_in_cmdlist(struct cmdnames *c, const char *s) 242int is_in_cmdlist(struct cmdnames *c, const char *s)
256{ 243{
257 int i; 244 unsigned int i;
245
258 for (i = 0; i < c->cnt; i++) 246 for (i = 0; i < c->cnt; i++)
259 if (!strcmp(s, c->names[i]->name)) 247 if (!strcmp(s, c->names[i]->name))
260 return 1; 248 return 1;
@@ -286,7 +274,8 @@ static int levenshtein_compare(const void *p1, const void *p2)
286 274
287static void add_cmd_list(struct cmdnames *cmds, struct cmdnames *old) 275static void add_cmd_list(struct cmdnames *cmds, struct cmdnames *old)
288{ 276{
289 int i; 277 unsigned int i;
278
290 ALLOC_GROW(cmds->names, cmds->cnt + old->cnt, cmds->alloc); 279 ALLOC_GROW(cmds->names, cmds->cnt + old->cnt, cmds->alloc);
291 280
292 for (i = 0; i < old->cnt; i++) 281 for (i = 0; i < old->cnt; i++)
@@ -298,7 +287,7 @@ static void add_cmd_list(struct cmdnames *cmds, struct cmdnames *old)
298 287
299const char *help_unknown_cmd(const char *cmd) 288const char *help_unknown_cmd(const char *cmd)
300{ 289{
301 int i, n = 0, best_similarity = 0; 290 unsigned int i, n = 0, best_similarity = 0;
302 struct cmdnames main_cmds, other_cmds; 291 struct cmdnames main_cmds, other_cmds;
303 292
304 memset(&main_cmds, 0, sizeof(main_cmds)); 293 memset(&main_cmds, 0, sizeof(main_cmds));
@@ -360,7 +349,7 @@ const char *help_unknown_cmd(const char *cmd)
360 exit(1); 349 exit(1);
361} 350}
362 351
363int cmd_version(int argc, const char **argv, const char *prefix) 352int cmd_version(int argc __used, const char **argv __used, const char *prefix __used)
364{ 353{
365 printf("perf version %s\n", perf_version_string); 354 printf("perf version %s\n", perf_version_string);
366 return 0; 355 return 0;
diff --git a/tools/perf/util/help.h b/tools/perf/util/help.h
index 56bc15406ffc..7128783637b4 100644
--- a/tools/perf/util/help.h
+++ b/tools/perf/util/help.h
@@ -2,8 +2,8 @@
2#define HELP_H 2#define HELP_H
3 3
4struct cmdnames { 4struct cmdnames {
5 int alloc; 5 size_t alloc;
6 int cnt; 6 size_t cnt;
7 struct cmdname { 7 struct cmdname {
8 size_t len; /* also used for similarity index in help.c */ 8 size_t len; /* also used for similarity index in help.c */
9 char name[FLEX_ARRAY]; 9 char name[FLEX_ARRAY];
@@ -19,7 +19,7 @@ static inline void mput_char(char c, unsigned int num)
19void load_command_list(const char *prefix, 19void load_command_list(const char *prefix,
20 struct cmdnames *main_cmds, 20 struct cmdnames *main_cmds,
21 struct cmdnames *other_cmds); 21 struct cmdnames *other_cmds);
22void add_cmdname(struct cmdnames *cmds, const char *name, int len); 22void add_cmdname(struct cmdnames *cmds, const char *name, size_t len);
23/* Here we require that excludes is a sorted list. */ 23/* Here we require that excludes is a sorted list. */
24void exclude_cmds(struct cmdnames *cmds, struct cmdnames *excludes); 24void exclude_cmds(struct cmdnames *cmds, struct cmdnames *excludes);
25int is_in_cmdlist(struct cmdnames *c, const char *s); 25int is_in_cmdlist(struct cmdnames *c, const char *s);
diff --git a/tools/perf/util/include/asm/system.h b/tools/perf/util/include/asm/system.h
new file mode 100644
index 000000000000..710cecca972d
--- /dev/null
+++ b/tools/perf/util/include/asm/system.h
@@ -0,0 +1 @@
/* Empty */
diff --git a/tools/perf/util/include/linux/kernel.h b/tools/perf/util/include/linux/kernel.h
new file mode 100644
index 000000000000..a6b87390cb52
--- /dev/null
+++ b/tools/perf/util/include/linux/kernel.h
@@ -0,0 +1,29 @@
1#ifndef PERF_LINUX_KERNEL_H_
2#define PERF_LINUX_KERNEL_H_
3
4#ifndef offsetof
5#define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)
6#endif
7
8#ifndef container_of
9/**
10 * container_of - cast a member of a structure out to the containing structure
11 * @ptr: the pointer to the member.
12 * @type: the type of the container struct this is embedded in.
13 * @member: the name of the member within the struct.
14 *
15 */
16#define container_of(ptr, type, member) ({ \
17 const typeof(((type *)0)->member) * __mptr = (ptr); \
18 (type *)((char *)__mptr - offsetof(type, member)); })
19#endif
20
21#ifndef max
22#define max(x, y) ({ \
23 typeof(x) _max1 = (x); \
24 typeof(y) _max2 = (y); \
25 (void) (&_max1 == &_max2); \
26 _max1 > _max2 ? _max1 : _max2; })
27#endif
28
29#endif
diff --git a/tools/perf/util/include/linux/list.h b/tools/perf/util/include/linux/list.h
new file mode 100644
index 000000000000..dbe4b814382a
--- /dev/null
+++ b/tools/perf/util/include/linux/list.h
@@ -0,0 +1,18 @@
1#include "../../../../include/linux/list.h"
2
3#ifndef PERF_LIST_H
4#define PERF_LIST_H
5/**
6 * list_del_range - deletes range of entries from list.
7 * @begin: first element in the range to delete from the list.
8 * @end: last element in the range to delete from the list.
9 * Note: list_empty on the range of entries does not return true after this,
10 * the entries is in an undefined state.
11 */
12static inline void list_del_range(struct list_head *begin,
13 struct list_head *end)
14{
15 begin->prev->next = end->next;
16 end->next->prev = begin->prev;
17}
18#endif
diff --git a/tools/perf/util/include/linux/module.h b/tools/perf/util/include/linux/module.h
new file mode 100644
index 000000000000..b43e2dc21e04
--- /dev/null
+++ b/tools/perf/util/include/linux/module.h
@@ -0,0 +1,6 @@
1#ifndef PERF_LINUX_MODULE_H
2#define PERF_LINUX_MODULE_H
3
4#define EXPORT_SYMBOL(name)
5
6#endif
diff --git a/tools/perf/util/include/linux/poison.h b/tools/perf/util/include/linux/poison.h
new file mode 100644
index 000000000000..fef6dbc9ce13
--- /dev/null
+++ b/tools/perf/util/include/linux/poison.h
@@ -0,0 +1 @@
#include "../../../../include/linux/poison.h"
diff --git a/tools/perf/util/include/linux/prefetch.h b/tools/perf/util/include/linux/prefetch.h
new file mode 100644
index 000000000000..7841e485d8c3
--- /dev/null
+++ b/tools/perf/util/include/linux/prefetch.h
@@ -0,0 +1,6 @@
1#ifndef PERF_LINUX_PREFETCH_H
2#define PERF_LINUX_PREFETCH_H
3
4static inline void prefetch(void *a __attribute__((unused))) { }
5
6#endif
diff --git a/tools/perf/util/include/linux/rbtree.h b/tools/perf/util/include/linux/rbtree.h
new file mode 100644
index 000000000000..7a243a143037
--- /dev/null
+++ b/tools/perf/util/include/linux/rbtree.h
@@ -0,0 +1 @@
#include "../../../../include/linux/rbtree.h"
diff --git a/tools/perf/util/list.h b/tools/perf/util/list.h
deleted file mode 100644
index e2548e8072cf..000000000000
--- a/tools/perf/util/list.h
+++ /dev/null
@@ -1,603 +0,0 @@
1#ifndef _LINUX_LIST_H
2#define _LINUX_LIST_H
3/*
4 Copyright (C) Cast of dozens, comes from the Linux kernel
5
6 This program is free software; you can redistribute it and/or modify it
7 under the terms of version 2 of the GNU General Public License as
8 published by the Free Software Foundation.
9*/
10
11#include <stddef.h>
12
13/*
14 * These are non-NULL pointers that will result in page faults
15 * under normal circumstances, used to verify that nobody uses
16 * non-initialized list entries.
17 */
18#define LIST_POISON1 ((void *)0x00100100)
19#define LIST_POISON2 ((void *)0x00200200)
20
21/**
22 * container_of - cast a member of a structure out to the containing structure
23 * @ptr: the pointer to the member.
24 * @type: the type of the container struct this is embedded in.
25 * @member: the name of the member within the struct.
26 *
27 */
28#define container_of(ptr, type, member) ({ \
29 const typeof( ((type *)0)->member ) *__mptr = (ptr); \
30 (type *)( (char *)__mptr - offsetof(type,member) );})
31
32/*
33 * Simple doubly linked list implementation.
34 *
35 * Some of the internal functions ("__xxx") are useful when
36 * manipulating whole lists rather than single entries, as
37 * sometimes we already know the next/prev entries and we can
38 * generate better code by using them directly rather than
39 * using the generic single-entry routines.
40 */
41
42struct list_head {
43 struct list_head *next, *prev;
44};
45
46#define LIST_HEAD_INIT(name) { &(name), &(name) }
47
48#define LIST_HEAD(name) \
49 struct list_head name = LIST_HEAD_INIT(name)
50
51static inline void INIT_LIST_HEAD(struct list_head *list)
52{
53 list->next = list;
54 list->prev = list;
55}
56
57/*
58 * Insert a new entry between two known consecutive entries.
59 *
60 * This is only for internal list manipulation where we know
61 * the prev/next entries already!
62 */
63static inline void __list_add(struct list_head *new,
64 struct list_head *prev,
65 struct list_head *next)
66{
67 next->prev = new;
68 new->next = next;
69 new->prev = prev;
70 prev->next = new;
71}
72
73/**
74 * list_add - add a new entry
75 * @new: new entry to be added
76 * @head: list head to add it after
77 *
78 * Insert a new entry after the specified head.
79 * This is good for implementing stacks.
80 */
81static inline void list_add(struct list_head *new, struct list_head *head)
82{
83 __list_add(new, head, head->next);
84}
85
86/**
87 * list_add_tail - add a new entry
88 * @new: new entry to be added
89 * @head: list head to add it before
90 *
91 * Insert a new entry before the specified head.
92 * This is useful for implementing queues.
93 */
94static inline void list_add_tail(struct list_head *new, struct list_head *head)
95{
96 __list_add(new, head->prev, head);
97}
98
99/*
100 * Delete a list entry by making the prev/next entries
101 * point to each other.
102 *
103 * This is only for internal list manipulation where we know
104 * the prev/next entries already!
105 */
106static inline void __list_del(struct list_head * prev, struct list_head * next)
107{
108 next->prev = prev;
109 prev->next = next;
110}
111
112/**
113 * list_del - deletes entry from list.
114 * @entry: the element to delete from the list.
115 * Note: list_empty on entry does not return true after this, the entry is
116 * in an undefined state.
117 */
118static inline void list_del(struct list_head *entry)
119{
120 __list_del(entry->prev, entry->next);
121 entry->next = LIST_POISON1;
122 entry->prev = LIST_POISON2;
123}
124
125/**
126 * list_del_range - deletes range of entries from list.
127 * @beging: first element in the range to delete from the list.
128 * @beging: first element in the range to delete from the list.
129 * Note: list_empty on the range of entries does not return true after this,
130 * the entries is in an undefined state.
131 */
132static inline void list_del_range(struct list_head *begin,
133 struct list_head *end)
134{
135 begin->prev->next = end->next;
136 end->next->prev = begin->prev;
137}
138
139/**
140 * list_replace - replace old entry by new one
141 * @old : the element to be replaced
142 * @new : the new element to insert
143 * Note: if 'old' was empty, it will be overwritten.
144 */
145static inline void list_replace(struct list_head *old,
146 struct list_head *new)
147{
148 new->next = old->next;
149 new->next->prev = new;
150 new->prev = old->prev;
151 new->prev->next = new;
152}
153
154static inline void list_replace_init(struct list_head *old,
155 struct list_head *new)
156{
157 list_replace(old, new);
158 INIT_LIST_HEAD(old);
159}
160
161/**
162 * list_del_init - deletes entry from list and reinitialize it.
163 * @entry: the element to delete from the list.
164 */
165static inline void list_del_init(struct list_head *entry)
166{
167 __list_del(entry->prev, entry->next);
168 INIT_LIST_HEAD(entry);
169}
170
171/**
172 * list_move - delete from one list and add as another's head
173 * @list: the entry to move
174 * @head: the head that will precede our entry
175 */
176static inline void list_move(struct list_head *list, struct list_head *head)
177{
178 __list_del(list->prev, list->next);
179 list_add(list, head);
180}
181
182/**
183 * list_move_tail - delete from one list and add as another's tail
184 * @list: the entry to move
185 * @head: the head that will follow our entry
186 */
187static inline void list_move_tail(struct list_head *list,
188 struct list_head *head)
189{
190 __list_del(list->prev, list->next);
191 list_add_tail(list, head);
192}
193
194/**
195 * list_is_last - tests whether @list is the last entry in list @head
196 * @list: the entry to test
197 * @head: the head of the list
198 */
199static inline int list_is_last(const struct list_head *list,
200 const struct list_head *head)
201{
202 return list->next == head;
203}
204
205/**
206 * list_empty - tests whether a list is empty
207 * @head: the list to test.
208 */
209static inline int list_empty(const struct list_head *head)
210{
211 return head->next == head;
212}
213
214/**
215 * list_empty_careful - tests whether a list is empty and not being modified
216 * @head: the list to test
217 *
218 * Description:
219 * tests whether a list is empty _and_ checks that no other CPU might be
220 * in the process of modifying either member (next or prev)
221 *
222 * NOTE: using list_empty_careful() without synchronization
223 * can only be safe if the only activity that can happen
224 * to the list entry is list_del_init(). Eg. it cannot be used
225 * if another CPU could re-list_add() it.
226 */
227static inline int list_empty_careful(const struct list_head *head)
228{
229 struct list_head *next = head->next;
230 return (next == head) && (next == head->prev);
231}
232
233static inline void __list_splice(struct list_head *list,
234 struct list_head *head)
235{
236 struct list_head *first = list->next;
237 struct list_head *last = list->prev;
238 struct list_head *at = head->next;
239
240 first->prev = head;
241 head->next = first;
242
243 last->next = at;
244 at->prev = last;
245}
246
247/**
248 * list_splice - join two lists
249 * @list: the new list to add.
250 * @head: the place to add it in the first list.
251 */
252static inline void list_splice(struct list_head *list, struct list_head *head)
253{
254 if (!list_empty(list))
255 __list_splice(list, head);
256}
257
258/**
259 * list_splice_init - join two lists and reinitialise the emptied list.
260 * @list: the new list to add.
261 * @head: the place to add it in the first list.
262 *
263 * The list at @list is reinitialised
264 */
265static inline void list_splice_init(struct list_head *list,
266 struct list_head *head)
267{
268 if (!list_empty(list)) {
269 __list_splice(list, head);
270 INIT_LIST_HEAD(list);
271 }
272}
273
274/**
275 * list_entry - get the struct for this entry
276 * @ptr: the &struct list_head pointer.
277 * @type: the type of the struct this is embedded in.
278 * @member: the name of the list_struct within the struct.
279 */
280#define list_entry(ptr, type, member) \
281 container_of(ptr, type, member)
282
283/**
284 * list_first_entry - get the first element from a list
285 * @ptr: the list head to take the element from.
286 * @type: the type of the struct this is embedded in.
287 * @member: the name of the list_struct within the struct.
288 *
289 * Note, that list is expected to be not empty.
290 */
291#define list_first_entry(ptr, type, member) \
292 list_entry((ptr)->next, type, member)
293
294/**
295 * list_for_each - iterate over a list
296 * @pos: the &struct list_head to use as a loop cursor.
297 * @head: the head for your list.
298 */
299#define list_for_each(pos, head) \
300 for (pos = (head)->next; pos != (head); \
301 pos = pos->next)
302
303/**
304 * __list_for_each - iterate over a list
305 * @pos: the &struct list_head to use as a loop cursor.
306 * @head: the head for your list.
307 *
308 * This variant differs from list_for_each() in that it's the
309 * simplest possible list iteration code, no prefetching is done.
310 * Use this for code that knows the list to be very short (empty
311 * or 1 entry) most of the time.
312 */
313#define __list_for_each(pos, head) \
314 for (pos = (head)->next; pos != (head); pos = pos->next)
315
316/**
317 * list_for_each_prev - iterate over a list backwards
318 * @pos: the &struct list_head to use as a loop cursor.
319 * @head: the head for your list.
320 */
321#define list_for_each_prev(pos, head) \
322 for (pos = (head)->prev; pos != (head); \
323 pos = pos->prev)
324
325/**
326 * list_for_each_safe - iterate over a list safe against removal of list entry
327 * @pos: the &struct list_head to use as a loop cursor.
328 * @n: another &struct list_head to use as temporary storage
329 * @head: the head for your list.
330 */
331#define list_for_each_safe(pos, n, head) \
332 for (pos = (head)->next, n = pos->next; pos != (head); \
333 pos = n, n = pos->next)
334
335/**
336 * list_for_each_entry - iterate over list of given type
337 * @pos: the type * to use as a loop cursor.
338 * @head: the head for your list.
339 * @member: the name of the list_struct within the struct.
340 */
341#define list_for_each_entry(pos, head, member) \
342 for (pos = list_entry((head)->next, typeof(*pos), member); \
343 &pos->member != (head); \
344 pos = list_entry(pos->member.next, typeof(*pos), member))
345
346/**
347 * list_for_each_entry_reverse - iterate backwards over list of given type.
348 * @pos: the type * to use as a loop cursor.
349 * @head: the head for your list.
350 * @member: the name of the list_struct within the struct.
351 */
352#define list_for_each_entry_reverse(pos, head, member) \
353 for (pos = list_entry((head)->prev, typeof(*pos), member); \
354 &pos->member != (head); \
355 pos = list_entry(pos->member.prev, typeof(*pos), member))
356
357/**
358 * list_prepare_entry - prepare a pos entry for use in list_for_each_entry_continue
359 * @pos: the type * to use as a start point
360 * @head: the head of the list
361 * @member: the name of the list_struct within the struct.
362 *
363 * Prepares a pos entry for use as a start point in list_for_each_entry_continue.
364 */
365#define list_prepare_entry(pos, head, member) \
366 ((pos) ? : list_entry(head, typeof(*pos), member))
367
368/**
369 * list_for_each_entry_continue - continue iteration over list of given type
370 * @pos: the type * to use as a loop cursor.
371 * @head: the head for your list.
372 * @member: the name of the list_struct within the struct.
373 *
374 * Continue to iterate over list of given type, continuing after
375 * the current position.
376 */
377#define list_for_each_entry_continue(pos, head, member) \
378 for (pos = list_entry(pos->member.next, typeof(*pos), member); \
379 &pos->member != (head); \
380 pos = list_entry(pos->member.next, typeof(*pos), member))
381
382/**
383 * list_for_each_entry_from - iterate over list of given type from the current point
384 * @pos: the type * to use as a loop cursor.
385 * @head: the head for your list.
386 * @member: the name of the list_struct within the struct.
387 *
388 * Iterate over list of given type, continuing from current position.
389 */
390#define list_for_each_entry_from(pos, head, member) \
391 for (; &pos->member != (head); \
392 pos = list_entry(pos->member.next, typeof(*pos), member))
393
394/**
395 * list_for_each_entry_safe - iterate over list of given type safe against removal of list entry
396 * @pos: the type * to use as a loop cursor.
397 * @n: another type * to use as temporary storage
398 * @head: the head for your list.
399 * @member: the name of the list_struct within the struct.
400 */
401#define list_for_each_entry_safe(pos, n, head, member) \
402 for (pos = list_entry((head)->next, typeof(*pos), member), \
403 n = list_entry(pos->member.next, typeof(*pos), member); \
404 &pos->member != (head); \
405 pos = n, n = list_entry(n->member.next, typeof(*n), member))
406
407/**
408 * list_for_each_entry_safe_continue
409 * @pos: the type * to use as a loop cursor.
410 * @n: another type * to use as temporary storage
411 * @head: the head for your list.
412 * @member: the name of the list_struct within the struct.
413 *
414 * Iterate over list of given type, continuing after current point,
415 * safe against removal of list entry.
416 */
417#define list_for_each_entry_safe_continue(pos, n, head, member) \
418 for (pos = list_entry(pos->member.next, typeof(*pos), member), \
419 n = list_entry(pos->member.next, typeof(*pos), member); \
420 &pos->member != (head); \
421 pos = n, n = list_entry(n->member.next, typeof(*n), member))
422
423/**
424 * list_for_each_entry_safe_from
425 * @pos: the type * to use as a loop cursor.
426 * @n: another type * to use as temporary storage
427 * @head: the head for your list.
428 * @member: the name of the list_struct within the struct.
429 *
430 * Iterate over list of given type from current point, safe against
431 * removal of list entry.
432 */
433#define list_for_each_entry_safe_from(pos, n, head, member) \
434 for (n = list_entry(pos->member.next, typeof(*pos), member); \
435 &pos->member != (head); \
436 pos = n, n = list_entry(n->member.next, typeof(*n), member))
437
438/**
439 * list_for_each_entry_safe_reverse
440 * @pos: the type * to use as a loop cursor.
441 * @n: another type * to use as temporary storage
442 * @head: the head for your list.
443 * @member: the name of the list_struct within the struct.
444 *
445 * Iterate backwards over list of given type, safe against removal
446 * of list entry.
447 */
448#define list_for_each_entry_safe_reverse(pos, n, head, member) \
449 for (pos = list_entry((head)->prev, typeof(*pos), member), \
450 n = list_entry(pos->member.prev, typeof(*pos), member); \
451 &pos->member != (head); \
452 pos = n, n = list_entry(n->member.prev, typeof(*n), member))
453
454/*
455 * Double linked lists with a single pointer list head.
456 * Mostly useful for hash tables where the two pointer list head is
457 * too wasteful.
458 * You lose the ability to access the tail in O(1).
459 */
460
461struct hlist_head {
462 struct hlist_node *first;
463};
464
465struct hlist_node {
466 struct hlist_node *next, **pprev;
467};
468
469#define HLIST_HEAD_INIT { .first = NULL }
470#define HLIST_HEAD(name) struct hlist_head name = { .first = NULL }
471#define INIT_HLIST_HEAD(ptr) ((ptr)->first = NULL)
472static inline void INIT_HLIST_NODE(struct hlist_node *h)
473{
474 h->next = NULL;
475 h->pprev = NULL;
476}
477
478static inline int hlist_unhashed(const struct hlist_node *h)
479{
480 return !h->pprev;
481}
482
483static inline int hlist_empty(const struct hlist_head *h)
484{
485 return !h->first;
486}
487
488static inline void __hlist_del(struct hlist_node *n)
489{
490 struct hlist_node *next = n->next;
491 struct hlist_node **pprev = n->pprev;
492 *pprev = next;
493 if (next)
494 next->pprev = pprev;
495}
496
497static inline void hlist_del(struct hlist_node *n)
498{
499 __hlist_del(n);
500 n->next = LIST_POISON1;
501 n->pprev = LIST_POISON2;
502}
503
504static inline void hlist_del_init(struct hlist_node *n)
505{
506 if (!hlist_unhashed(n)) {
507 __hlist_del(n);
508 INIT_HLIST_NODE(n);
509 }
510}
511
512static inline void hlist_add_head(struct hlist_node *n, struct hlist_head *h)
513{
514 struct hlist_node *first = h->first;
515 n->next = first;
516 if (first)
517 first->pprev = &n->next;
518 h->first = n;
519 n->pprev = &h->first;
520}
521
522/* next must be != NULL */
523static inline void hlist_add_before(struct hlist_node *n,
524 struct hlist_node *next)
525{
526 n->pprev = next->pprev;
527 n->next = next;
528 next->pprev = &n->next;
529 *(n->pprev) = n;
530}
531
532static inline void hlist_add_after(struct hlist_node *n,
533 struct hlist_node *next)
534{
535 next->next = n->next;
536 n->next = next;
537 next->pprev = &n->next;
538
539 if(next->next)
540 next->next->pprev = &next->next;
541}
542
543#define hlist_entry(ptr, type, member) container_of(ptr,type,member)
544
545#define hlist_for_each(pos, head) \
546 for (pos = (head)->first; pos; \
547 pos = pos->next)
548
549#define hlist_for_each_safe(pos, n, head) \
550 for (pos = (head)->first; pos && ({ n = pos->next; 1; }); \
551 pos = n)
552
553/**
554 * hlist_for_each_entry - iterate over list of given type
555 * @tpos: the type * to use as a loop cursor.
556 * @pos: the &struct hlist_node to use as a loop cursor.
557 * @head: the head for your list.
558 * @member: the name of the hlist_node within the struct.
559 */
560#define hlist_for_each_entry(tpos, pos, head, member) \
561 for (pos = (head)->first; \
562 pos && \
563 ({ tpos = hlist_entry(pos, typeof(*tpos), member); 1;}); \
564 pos = pos->next)
565
566/**
567 * hlist_for_each_entry_continue - iterate over a hlist continuing after current point
568 * @tpos: the type * to use as a loop cursor.
569 * @pos: the &struct hlist_node to use as a loop cursor.
570 * @member: the name of the hlist_node within the struct.
571 */
572#define hlist_for_each_entry_continue(tpos, pos, member) \
573 for (pos = (pos)->next; \
574 pos && \
575 ({ tpos = hlist_entry(pos, typeof(*tpos), member); 1;}); \
576 pos = pos->next)
577
578/**
579 * hlist_for_each_entry_from - iterate over a hlist continuing from current point
580 * @tpos: the type * to use as a loop cursor.
581 * @pos: the &struct hlist_node to use as a loop cursor.
582 * @member: the name of the hlist_node within the struct.
583 */
584#define hlist_for_each_entry_from(tpos, pos, member) \
585 for (; pos && \
586 ({ tpos = hlist_entry(pos, typeof(*tpos), member); 1;}); \
587 pos = pos->next)
588
589/**
590 * hlist_for_each_entry_safe - iterate over list of given type safe against removal of list entry
591 * @tpos: the type * to use as a loop cursor.
592 * @pos: the &struct hlist_node to use as a loop cursor.
593 * @n: another &struct hlist_node to use as temporary storage
594 * @head: the head for your list.
595 * @member: the name of the hlist_node within the struct.
596 */
597#define hlist_for_each_entry_safe(tpos, pos, n, head, member) \
598 for (pos = (head)->first; \
599 pos && ({ n = pos->next; 1; }) && \
600 ({ tpos = hlist_entry(pos, typeof(*tpos), member); 1;}); \
601 pos = n)
602
603#endif
diff --git a/tools/perf/util/module.c b/tools/perf/util/module.c
new file mode 100644
index 000000000000..ddabe925d65d
--- /dev/null
+++ b/tools/perf/util/module.c
@@ -0,0 +1,509 @@
1#include "util.h"
2#include "../perf.h"
3#include "string.h"
4#include "module.h"
5
6#include <libelf.h>
7#include <gelf.h>
8#include <elf.h>
9#include <dirent.h>
10#include <sys/utsname.h>
11
12static unsigned int crc32(const char *p, unsigned int len)
13{
14 int i;
15 unsigned int crc = 0;
16
17 while (len--) {
18 crc ^= *p++;
19 for (i = 0; i < 8; i++)
20 crc = (crc >> 1) ^ ((crc & 1) ? 0xedb88320 : 0);
21 }
22 return crc;
23}
24
25/* module section methods */
26
27struct sec_dso *sec_dso__new_dso(const char *name)
28{
29 struct sec_dso *self = malloc(sizeof(*self) + strlen(name) + 1);
30
31 if (self != NULL) {
32 strcpy(self->name, name);
33 self->secs = RB_ROOT;
34 self->find_section = sec_dso__find_section;
35 }
36
37 return self;
38}
39
40static void sec_dso__delete_section(struct section *self)
41{
42 free(((void *)self));
43}
44
45void sec_dso__delete_sections(struct sec_dso *self)
46{
47 struct section *pos;
48 struct rb_node *next = rb_first(&self->secs);
49
50 while (next) {
51 pos = rb_entry(next, struct section, rb_node);
52 next = rb_next(&pos->rb_node);
53 rb_erase(&pos->rb_node, &self->secs);
54 sec_dso__delete_section(pos);
55 }
56}
57
58void sec_dso__delete_self(struct sec_dso *self)
59{
60 sec_dso__delete_sections(self);
61 free(self);
62}
63
64static void sec_dso__insert_section(struct sec_dso *self, struct section *sec)
65{
66 struct rb_node **p = &self->secs.rb_node;
67 struct rb_node *parent = NULL;
68 const u64 hash = sec->hash;
69 struct section *s;
70
71 while (*p != NULL) {
72 parent = *p;
73 s = rb_entry(parent, struct section, rb_node);
74 if (hash < s->hash)
75 p = &(*p)->rb_left;
76 else
77 p = &(*p)->rb_right;
78 }
79 rb_link_node(&sec->rb_node, parent, p);
80 rb_insert_color(&sec->rb_node, &self->secs);
81}
82
83struct section *sec_dso__find_section(struct sec_dso *self, const char *name)
84{
85 struct rb_node *n;
86 u64 hash;
87 int len;
88
89 if (self == NULL)
90 return NULL;
91
92 len = strlen(name);
93 hash = crc32(name, len);
94
95 n = self->secs.rb_node;
96
97 while (n) {
98 struct section *s = rb_entry(n, struct section, rb_node);
99
100 if (hash < s->hash)
101 n = n->rb_left;
102 else if (hash > s->hash)
103 n = n->rb_right;
104 else {
105 if (!strcmp(name, s->name))
106 return s;
107 else
108 n = rb_next(&s->rb_node);
109 }
110 }
111
112 return NULL;
113}
114
115static size_t sec_dso__fprintf_section(struct section *self, FILE *fp)
116{
117 return fprintf(fp, "name:%s vma:%llx path:%s\n",
118 self->name, self->vma, self->path);
119}
120
121size_t sec_dso__fprintf(struct sec_dso *self, FILE *fp)
122{
123 size_t ret = fprintf(fp, "dso: %s\n", self->name);
124
125 struct rb_node *nd;
126 for (nd = rb_first(&self->secs); nd; nd = rb_next(nd)) {
127 struct section *pos = rb_entry(nd, struct section, rb_node);
128 ret += sec_dso__fprintf_section(pos, fp);
129 }
130
131 return ret;
132}
133
134static struct section *section__new(const char *name, const char *path)
135{
136 struct section *self = calloc(1, sizeof(*self));
137
138 if (!self)
139 goto out_failure;
140
141 self->name = calloc(1, strlen(name) + 1);
142 if (!self->name)
143 goto out_failure;
144
145 self->path = calloc(1, strlen(path) + 1);
146 if (!self->path)
147 goto out_failure;
148
149 strcpy(self->name, name);
150 strcpy(self->path, path);
151 self->hash = crc32(self->name, strlen(name));
152
153 return self;
154
155out_failure:
156 if (self) {
157 if (self->name)
158 free(self->name);
159 if (self->path)
160 free(self->path);
161 free(self);
162 }
163
164 return NULL;
165}
166
167/* module methods */
168
169struct mod_dso *mod_dso__new_dso(const char *name)
170{
171 struct mod_dso *self = malloc(sizeof(*self) + strlen(name) + 1);
172
173 if (self != NULL) {
174 strcpy(self->name, name);
175 self->mods = RB_ROOT;
176 self->find_module = mod_dso__find_module;
177 }
178
179 return self;
180}
181
182static void mod_dso__delete_module(struct module *self)
183{
184 free(((void *)self));
185}
186
187void mod_dso__delete_modules(struct mod_dso *self)
188{
189 struct module *pos;
190 struct rb_node *next = rb_first(&self->mods);
191
192 while (next) {
193 pos = rb_entry(next, struct module, rb_node);
194 next = rb_next(&pos->rb_node);
195 rb_erase(&pos->rb_node, &self->mods);
196 mod_dso__delete_module(pos);
197 }
198}
199
200void mod_dso__delete_self(struct mod_dso *self)
201{
202 mod_dso__delete_modules(self);
203 free(self);
204}
205
206static void mod_dso__insert_module(struct mod_dso *self, struct module *mod)
207{
208 struct rb_node **p = &self->mods.rb_node;
209 struct rb_node *parent = NULL;
210 const u64 hash = mod->hash;
211 struct module *m;
212
213 while (*p != NULL) {
214 parent = *p;
215 m = rb_entry(parent, struct module, rb_node);
216 if (hash < m->hash)
217 p = &(*p)->rb_left;
218 else
219 p = &(*p)->rb_right;
220 }
221 rb_link_node(&mod->rb_node, parent, p);
222 rb_insert_color(&mod->rb_node, &self->mods);
223}
224
225struct module *mod_dso__find_module(struct mod_dso *self, const char *name)
226{
227 struct rb_node *n;
228 u64 hash;
229 int len;
230
231 if (self == NULL)
232 return NULL;
233
234 len = strlen(name);
235 hash = crc32(name, len);
236
237 n = self->mods.rb_node;
238
239 while (n) {
240 struct module *m = rb_entry(n, struct module, rb_node);
241
242 if (hash < m->hash)
243 n = n->rb_left;
244 else if (hash > m->hash)
245 n = n->rb_right;
246 else {
247 if (!strcmp(name, m->name))
248 return m;
249 else
250 n = rb_next(&m->rb_node);
251 }
252 }
253
254 return NULL;
255}
256
257static size_t mod_dso__fprintf_module(struct module *self, FILE *fp)
258{
259 return fprintf(fp, "name:%s path:%s\n", self->name, self->path);
260}
261
262size_t mod_dso__fprintf(struct mod_dso *self, FILE *fp)
263{
264 struct rb_node *nd;
265 size_t ret;
266
267 ret = fprintf(fp, "dso: %s\n", self->name);
268
269 for (nd = rb_first(&self->mods); nd; nd = rb_next(nd)) {
270 struct module *pos = rb_entry(nd, struct module, rb_node);
271
272 ret += mod_dso__fprintf_module(pos, fp);
273 }
274
275 return ret;
276}
277
278static struct module *module__new(const char *name, const char *path)
279{
280 struct module *self = calloc(1, sizeof(*self));
281
282 if (!self)
283 goto out_failure;
284
285 self->name = calloc(1, strlen(name) + 1);
286 if (!self->name)
287 goto out_failure;
288
289 self->path = calloc(1, strlen(path) + 1);
290 if (!self->path)
291 goto out_failure;
292
293 strcpy(self->name, name);
294 strcpy(self->path, path);
295 self->hash = crc32(self->name, strlen(name));
296
297 return self;
298
299out_failure:
300 if (self) {
301 if (self->name)
302 free(self->name);
303 if (self->path)
304 free(self->path);
305 free(self);
306 }
307
308 return NULL;
309}
310
311static int mod_dso__load_sections(struct module *mod)
312{
313 int count = 0, path_len;
314 struct dirent *entry;
315 char *line = NULL;
316 char *dir_path;
317 DIR *dir;
318 size_t n;
319
320 path_len = strlen("/sys/module/");
321 path_len += strlen(mod->name);
322 path_len += strlen("/sections/");
323
324 dir_path = calloc(1, path_len + 1);
325 if (dir_path == NULL)
326 goto out_failure;
327
328 strcat(dir_path, "/sys/module/");
329 strcat(dir_path, mod->name);
330 strcat(dir_path, "/sections/");
331
332 dir = opendir(dir_path);
333 if (dir == NULL)
334 goto out_free;
335
336 while ((entry = readdir(dir))) {
337 struct section *section;
338 char *path, *vma;
339 int line_len;
340 FILE *file;
341
342 if (!strcmp(".", entry->d_name) || !strcmp("..", entry->d_name))
343 continue;
344
345 path = calloc(1, path_len + strlen(entry->d_name) + 1);
346 if (path == NULL)
347 break;
348 strcat(path, dir_path);
349 strcat(path, entry->d_name);
350
351 file = fopen(path, "r");
352 if (file == NULL) {
353 free(path);
354 break;
355 }
356
357 line_len = getline(&line, &n, file);
358 if (line_len < 0) {
359 free(path);
360 fclose(file);
361 break;
362 }
363
364 if (!line) {
365 free(path);
366 fclose(file);
367 break;
368 }
369
370 line[--line_len] = '\0'; /* \n */
371
372 vma = strstr(line, "0x");
373 if (!vma) {
374 free(path);
375 fclose(file);
376 break;
377 }
378 vma += 2;
379
380 section = section__new(entry->d_name, path);
381 if (!section) {
382 fprintf(stderr, "load_sections: allocation error\n");
383 free(path);
384 fclose(file);
385 break;
386 }
387
388 hex2u64(vma, &section->vma);
389 sec_dso__insert_section(mod->sections, section);
390
391 free(path);
392 fclose(file);
393 count++;
394 }
395
396 closedir(dir);
397 free(line);
398 free(dir_path);
399
400 return count;
401
402out_free:
403 free(dir_path);
404
405out_failure:
406 return count;
407}
408
409static int mod_dso__load_module_paths(struct mod_dso *self)
410{
411 struct utsname uts;
412 int count = 0, len;
413 char *line = NULL;
414 FILE *file;
415 char *path;
416 size_t n;
417
418 if (uname(&uts) < 0)
419 goto out_failure;
420
421 len = strlen("/lib/modules/");
422 len += strlen(uts.release);
423 len += strlen("/modules.dep");
424
425 path = calloc(1, len);
426 if (path == NULL)
427 goto out_failure;
428
429 strcat(path, "/lib/modules/");
430 strcat(path, uts.release);
431 strcat(path, "/modules.dep");
432
433 file = fopen(path, "r");
434 free(path);
435 if (file == NULL)
436 goto out_failure;
437
438 while (!feof(file)) {
439 char *path, *name, *tmp;
440 struct module *module;
441 int line_len, len;
442
443 line_len = getline(&line, &n, file);
444 if (line_len < 0)
445 break;
446
447 if (!line)
448 goto out_failure;
449
450 line[--line_len] = '\0'; /* \n */
451
452 path = strtok(line, ":");
453 if (!path)
454 goto out_failure;
455
456 name = strdup(path);
457 name = strtok(name, "/");
458
459 tmp = name;
460
461 while (tmp) {
462 tmp = strtok(NULL, "/");
463 if (tmp)
464 name = tmp;
465 }
466 name = strsep(&name, ".");
467
468 /* Quirk: replace '-' with '_' in sound modules */
469 for (len = strlen(name); len; len--) {
470 if (*(name+len) == '-')
471 *(name+len) = '_';
472 }
473
474 module = module__new(name, path);
475 if (!module) {
476 fprintf(stderr, "load_module_paths: allocation error\n");
477 goto out_failure;
478 }
479 mod_dso__insert_module(self, module);
480
481 module->sections = sec_dso__new_dso("sections");
482 if (!module->sections) {
483 fprintf(stderr, "load_module_paths: allocation error\n");
484 goto out_failure;
485 }
486
487 module->active = mod_dso__load_sections(module);
488
489 if (module->active > 0)
490 count++;
491 }
492
493 free(line);
494 fclose(file);
495
496 return count;
497
498out_failure:
499 return -1;
500}
501
502int mod_dso__load_modules(struct mod_dso *dso)
503{
504 int err;
505
506 err = mod_dso__load_module_paths(dso);
507
508 return err;
509}
diff --git a/tools/perf/util/module.h b/tools/perf/util/module.h
new file mode 100644
index 000000000000..8a592ef641ca
--- /dev/null
+++ b/tools/perf/util/module.h
@@ -0,0 +1,53 @@
1#ifndef _PERF_MODULE_
2#define _PERF_MODULE_ 1
3
4#include <linux/types.h>
5#include "../types.h"
6#include <linux/list.h>
7#include <linux/rbtree.h>
8
9struct section {
10 struct rb_node rb_node;
11 u64 hash;
12 u64 vma;
13 char *name;
14 char *path;
15};
16
17struct sec_dso {
18 struct list_head node;
19 struct rb_root secs;
20 struct section *(*find_section)(struct sec_dso *, const char *name);
21 char name[0];
22};
23
24struct module {
25 struct rb_node rb_node;
26 u64 hash;
27 char *name;
28 char *path;
29 struct sec_dso *sections;
30 int active;
31};
32
33struct mod_dso {
34 struct list_head node;
35 struct rb_root mods;
36 struct module *(*find_module)(struct mod_dso *, const char *name);
37 char name[0];
38};
39
40struct sec_dso *sec_dso__new_dso(const char *name);
41void sec_dso__delete_sections(struct sec_dso *self);
42void sec_dso__delete_self(struct sec_dso *self);
43size_t sec_dso__fprintf(struct sec_dso *self, FILE *fp);
44struct section *sec_dso__find_section(struct sec_dso *self, const char *name);
45
46struct mod_dso *mod_dso__new_dso(const char *name);
47void mod_dso__delete_modules(struct mod_dso *self);
48void mod_dso__delete_self(struct mod_dso *self);
49size_t mod_dso__fprintf(struct mod_dso *self, FILE *fp);
50struct module *mod_dso__find_module(struct mod_dso *self, const char *name);
51int mod_dso__load_modules(struct mod_dso *dso);
52
53#endif /* _PERF_MODULE_ */
diff --git a/tools/perf/util/pager.c b/tools/perf/util/pager.c
index a28bccae5458..1915de20dcac 100644
--- a/tools/perf/util/pager.c
+++ b/tools/perf/util/pager.c
@@ -9,7 +9,6 @@
9 9
10static int spawned_pager; 10static int spawned_pager;
11 11
12#ifndef __MINGW32__
13static void pager_preexec(void) 12static void pager_preexec(void)
14{ 13{
15 /* 14 /*
@@ -24,7 +23,6 @@ static void pager_preexec(void)
24 23
25 setenv("LESS", "FRSX", 0); 24 setenv("LESS", "FRSX", 0);
26} 25}
27#endif
28 26
29static const char *pager_argv[] = { "sh", "-c", NULL, NULL }; 27static const char *pager_argv[] = { "sh", "-c", NULL, NULL };
30static struct child_process pager_process; 28static struct child_process pager_process;
@@ -70,9 +68,8 @@ void setup_pager(void)
70 pager_argv[2] = pager; 68 pager_argv[2] = pager;
71 pager_process.argv = pager_argv; 69 pager_process.argv = pager_argv;
72 pager_process.in = -1; 70 pager_process.in = -1;
73#ifndef __MINGW32__
74 pager_process.preexec_cb = pager_preexec; 71 pager_process.preexec_cb = pager_preexec;
75#endif 72
76 if (start_command(&pager_process)) 73 if (start_command(&pager_process))
77 return; 74 return;
78 75
diff --git a/tools/perf/util/parse-events.c b/tools/perf/util/parse-events.c
index 35d04da38d6a..7bdad8df22a6 100644
--- a/tools/perf/util/parse-events.c
+++ b/tools/perf/util/parse-events.c
@@ -5,6 +5,7 @@
5#include "parse-events.h" 5#include "parse-events.h"
6#include "exec_cmd.h" 6#include "exec_cmd.h"
7#include "string.h" 7#include "string.h"
8#include "cache.h"
8 9
9extern char *strcasestr(const char *haystack, const char *needle); 10extern char *strcasestr(const char *haystack, const char *needle);
10 11
@@ -16,32 +17,30 @@ struct event_symbol {
16 u8 type; 17 u8 type;
17 u64 config; 18 u64 config;
18 char *symbol; 19 char *symbol;
20 char *alias;
19}; 21};
20 22
21#define C(x, y) .type = PERF_TYPE_##x, .config = PERF_COUNT_##y 23char debugfs_path[MAXPATHLEN];
22#define CR(x, y) .type = PERF_TYPE_##x, .config = y 24
25#define CHW(x) .type = PERF_TYPE_HARDWARE, .config = PERF_COUNT_HW_##x
26#define CSW(x) .type = PERF_TYPE_SOFTWARE, .config = PERF_COUNT_SW_##x
23 27
24static struct event_symbol event_symbols[] = { 28static struct event_symbol event_symbols[] = {
25 { C(HARDWARE, HW_CPU_CYCLES), "cpu-cycles", }, 29 { CHW(CPU_CYCLES), "cpu-cycles", "cycles" },
26 { C(HARDWARE, HW_CPU_CYCLES), "cycles", }, 30 { CHW(INSTRUCTIONS), "instructions", "" },
27 { C(HARDWARE, HW_INSTRUCTIONS), "instructions", }, 31 { CHW(CACHE_REFERENCES), "cache-references", "" },
28 { C(HARDWARE, HW_CACHE_REFERENCES), "cache-references", }, 32 { CHW(CACHE_MISSES), "cache-misses", "" },
29 { C(HARDWARE, HW_CACHE_MISSES), "cache-misses", }, 33 { CHW(BRANCH_INSTRUCTIONS), "branch-instructions", "branches" },
30 { C(HARDWARE, HW_BRANCH_INSTRUCTIONS),"branch-instructions", }, 34 { CHW(BRANCH_MISSES), "branch-misses", "" },
31 { C(HARDWARE, HW_BRANCH_INSTRUCTIONS),"branches", }, 35 { CHW(BUS_CYCLES), "bus-cycles", "" },
32 { C(HARDWARE, HW_BRANCH_MISSES), "branch-misses", }, 36
33 { C(HARDWARE, HW_BUS_CYCLES), "bus-cycles", }, 37 { CSW(CPU_CLOCK), "cpu-clock", "" },
34 38 { CSW(TASK_CLOCK), "task-clock", "" },
35 { C(SOFTWARE, SW_CPU_CLOCK), "cpu-clock", }, 39 { CSW(PAGE_FAULTS), "page-faults", "faults" },
36 { C(SOFTWARE, SW_TASK_CLOCK), "task-clock", }, 40 { CSW(PAGE_FAULTS_MIN), "minor-faults", "" },
37 { C(SOFTWARE, SW_PAGE_FAULTS), "page-faults", }, 41 { CSW(PAGE_FAULTS_MAJ), "major-faults", "" },
38 { C(SOFTWARE, SW_PAGE_FAULTS), "faults", }, 42 { CSW(CONTEXT_SWITCHES), "context-switches", "cs" },
39 { C(SOFTWARE, SW_PAGE_FAULTS_MIN), "minor-faults", }, 43 { CSW(CPU_MIGRATIONS), "cpu-migrations", "migrations" },
40 { C(SOFTWARE, SW_PAGE_FAULTS_MAJ), "major-faults", },
41 { C(SOFTWARE, SW_CONTEXT_SWITCHES), "context-switches", },
42 { C(SOFTWARE, SW_CONTEXT_SWITCHES), "cs", },
43 { C(SOFTWARE, SW_CPU_MIGRATIONS), "cpu-migrations", },
44 { C(SOFTWARE, SW_CPU_MIGRATIONS), "migrations", },
45}; 44};
46 45
47#define __PERF_COUNTER_FIELD(config, name) \ 46#define __PERF_COUNTER_FIELD(config, name) \
@@ -74,26 +73,152 @@ static char *sw_event_names[] = {
74 73
75#define MAX_ALIASES 8 74#define MAX_ALIASES 8
76 75
77static char *hw_cache [][MAX_ALIASES] = { 76static char *hw_cache[][MAX_ALIASES] = {
78 { "L1-data" , "l1-d", "l1d" }, 77 { "L1-dcache", "l1-d", "l1d", "L1-data", },
79 { "L1-instruction" , "l1-i", "l1i" }, 78 { "L1-icache", "l1-i", "l1i", "L1-instruction", },
80 { "L2" , "l2" }, 79 { "LLC", "L2" },
81 { "Data-TLB" , "dtlb", "d-tlb" }, 80 { "dTLB", "d-tlb", "Data-TLB", },
82 { "Instruction-TLB" , "itlb", "i-tlb" }, 81 { "iTLB", "i-tlb", "Instruction-TLB", },
83 { "Branch" , "bpu" , "btb", "bpc" }, 82 { "branch", "branches", "bpu", "btb", "bpc", },
83};
84
85static char *hw_cache_op[][MAX_ALIASES] = {
86 { "load", "loads", "read", },
87 { "store", "stores", "write", },
88 { "prefetch", "prefetches", "speculative-read", "speculative-load", },
84}; 89};
85 90
86static char *hw_cache_op [][MAX_ALIASES] = { 91static char *hw_cache_result[][MAX_ALIASES] = {
87 { "Load" , "read" }, 92 { "refs", "Reference", "ops", "access", },
88 { "Store" , "write" }, 93 { "misses", "miss", },
89 { "Prefetch" , "speculative-read", "speculative-load" },
90}; 94};
91 95
92static char *hw_cache_result [][MAX_ALIASES] = { 96#define C(x) PERF_COUNT_HW_CACHE_##x
93 { "Reference" , "ops", "access" }, 97#define CACHE_READ (1 << C(OP_READ))
94 { "Miss" }, 98#define CACHE_WRITE (1 << C(OP_WRITE))
99#define CACHE_PREFETCH (1 << C(OP_PREFETCH))
100#define COP(x) (1 << x)
101
102/*
103 * cache operartion stat
104 * L1I : Read and prefetch only
105 * ITLB and BPU : Read-only
106 */
107static unsigned long hw_cache_stat[C(MAX)] = {
108 [C(L1D)] = (CACHE_READ | CACHE_WRITE | CACHE_PREFETCH),
109 [C(L1I)] = (CACHE_READ | CACHE_PREFETCH),
110 [C(LL)] = (CACHE_READ | CACHE_WRITE | CACHE_PREFETCH),
111 [C(DTLB)] = (CACHE_READ | CACHE_WRITE | CACHE_PREFETCH),
112 [C(ITLB)] = (CACHE_READ),
113 [C(BPU)] = (CACHE_READ),
95}; 114};
96 115
116#define for_each_subsystem(sys_dir, sys_dirent, sys_next, file, st) \
117 while (!readdir_r(sys_dir, &sys_dirent, &sys_next) && sys_next) \
118 if (snprintf(file, MAXPATHLEN, "%s/%s", debugfs_path, \
119 sys_dirent.d_name) && \
120 (!stat(file, &st)) && (S_ISDIR(st.st_mode)) && \
121 (strcmp(sys_dirent.d_name, ".")) && \
122 (strcmp(sys_dirent.d_name, "..")))
123
124#define for_each_event(sys_dirent, evt_dir, evt_dirent, evt_next, file, st) \
125 while (!readdir_r(evt_dir, &evt_dirent, &evt_next) && evt_next) \
126 if (snprintf(file, MAXPATHLEN, "%s/%s/%s", debugfs_path, \
127 sys_dirent.d_name, evt_dirent.d_name) && \
128 (!stat(file, &st)) && (S_ISDIR(st.st_mode)) && \
129 (strcmp(evt_dirent.d_name, ".")) && \
130 (strcmp(evt_dirent.d_name, "..")))
131
132#define MAX_EVENT_LENGTH 30
133
134int valid_debugfs_mount(const char *debugfs)
135{
136 struct statfs st_fs;
137
138 if (statfs(debugfs, &st_fs) < 0)
139 return -ENOENT;
140 else if (st_fs.f_type != (long) DEBUGFS_MAGIC)
141 return -ENOENT;
142 return 0;
143}
144
145static char *tracepoint_id_to_name(u64 config)
146{
147 static char tracepoint_name[2 * MAX_EVENT_LENGTH];
148 DIR *sys_dir, *evt_dir;
149 struct dirent *sys_next, *evt_next, sys_dirent, evt_dirent;
150 struct stat st;
151 char id_buf[4];
152 int fd;
153 u64 id;
154 char evt_path[MAXPATHLEN];
155
156 if (valid_debugfs_mount(debugfs_path))
157 return "unkown";
158
159 sys_dir = opendir(debugfs_path);
160 if (!sys_dir)
161 goto cleanup;
162
163 for_each_subsystem(sys_dir, sys_dirent, sys_next, evt_path, st) {
164 evt_dir = opendir(evt_path);
165 if (!evt_dir)
166 goto cleanup;
167 for_each_event(sys_dirent, evt_dir, evt_dirent, evt_next,
168 evt_path, st) {
169 snprintf(evt_path, MAXPATHLEN, "%s/%s/%s/id",
170 debugfs_path, sys_dirent.d_name,
171 evt_dirent.d_name);
172 fd = open(evt_path, O_RDONLY);
173 if (fd < 0)
174 continue;
175 if (read(fd, id_buf, sizeof(id_buf)) < 0) {
176 close(fd);
177 continue;
178 }
179 close(fd);
180 id = atoll(id_buf);
181 if (id == config) {
182 closedir(evt_dir);
183 closedir(sys_dir);
184 snprintf(tracepoint_name, 2 * MAX_EVENT_LENGTH,
185 "%s:%s", sys_dirent.d_name,
186 evt_dirent.d_name);
187 return tracepoint_name;
188 }
189 }
190 closedir(evt_dir);
191 }
192
193cleanup:
194 closedir(sys_dir);
195 return "unkown";
196}
197
198static int is_cache_op_valid(u8 cache_type, u8 cache_op)
199{
200 if (hw_cache_stat[cache_type] & COP(cache_op))
201 return 1; /* valid */
202 else
203 return 0; /* invalid */
204}
205
206static char *event_cache_name(u8 cache_type, u8 cache_op, u8 cache_result)
207{
208 static char name[50];
209
210 if (cache_result) {
211 sprintf(name, "%s-%s-%s", hw_cache[cache_type][0],
212 hw_cache_op[cache_op][0],
213 hw_cache_result[cache_result][0]);
214 } else {
215 sprintf(name, "%s-%s", hw_cache[cache_type][0],
216 hw_cache_op[cache_op][1]);
217 }
218
219 return name;
220}
221
97char *event_name(int counter) 222char *event_name(int counter)
98{ 223{
99 u64 config = attrs[counter].config; 224 u64 config = attrs[counter].config;
@@ -113,7 +238,6 @@ char *event_name(int counter)
113 238
114 case PERF_TYPE_HW_CACHE: { 239 case PERF_TYPE_HW_CACHE: {
115 u8 cache_type, cache_op, cache_result; 240 u8 cache_type, cache_op, cache_result;
116 static char name[100];
117 241
118 cache_type = (config >> 0) & 0xff; 242 cache_type = (config >> 0) & 0xff;
119 if (cache_type > PERF_COUNT_HW_CACHE_MAX) 243 if (cache_type > PERF_COUNT_HW_CACHE_MAX)
@@ -127,12 +251,10 @@ char *event_name(int counter)
127 if (cache_result > PERF_COUNT_HW_CACHE_RESULT_MAX) 251 if (cache_result > PERF_COUNT_HW_CACHE_RESULT_MAX)
128 return "unknown-ext-hardware-cache-result"; 252 return "unknown-ext-hardware-cache-result";
129 253
130 sprintf(name, "%s-Cache-%s-%ses", 254 if (!is_cache_op_valid(cache_type, cache_op))
131 hw_cache[cache_type][0], 255 return "invalid-cache";
132 hw_cache_op[cache_op][0],
133 hw_cache_result[cache_result][0]);
134 256
135 return name; 257 return event_cache_name(cache_type, cache_op, cache_result);
136 } 258 }
137 259
138 case PERF_TYPE_SOFTWARE: 260 case PERF_TYPE_SOFTWARE:
@@ -140,6 +262,9 @@ char *event_name(int counter)
140 return sw_event_names[config]; 262 return sw_event_names[config];
141 return "unknown-software"; 263 return "unknown-software";
142 264
265 case PERF_TYPE_TRACEPOINT:
266 return tracepoint_id_to_name(config);
267
143 default: 268 default:
144 break; 269 break;
145 } 270 }
@@ -147,43 +272,74 @@ char *event_name(int counter)
147 return "unknown"; 272 return "unknown";
148} 273}
149 274
150static int parse_aliases(const char *str, char *names[][MAX_ALIASES], int size) 275static int parse_aliases(const char **str, char *names[][MAX_ALIASES], int size)
151{ 276{
152 int i, j; 277 int i, j;
278 int n, longest = -1;
153 279
154 for (i = 0; i < size; i++) { 280 for (i = 0; i < size; i++) {
155 for (j = 0; j < MAX_ALIASES; j++) { 281 for (j = 0; j < MAX_ALIASES && names[i][j]; j++) {
156 if (!names[i][j]) 282 n = strlen(names[i][j]);
157 break; 283 if (n > longest && !strncasecmp(*str, names[i][j], n))
158 if (strcasestr(str, names[i][j])) 284 longest = n;
159 return i; 285 }
286 if (longest > 0) {
287 *str += longest;
288 return i;
160 } 289 }
161 } 290 }
162 291
163 return -1; 292 return -1;
164} 293}
165 294
166static int parse_generic_hw_symbols(const char *str, struct perf_counter_attr *attr) 295static int
296parse_generic_hw_event(const char **str, struct perf_counter_attr *attr)
167{ 297{
168 int cache_type = -1, cache_op = 0, cache_result = 0; 298 const char *s = *str;
299 int cache_type = -1, cache_op = -1, cache_result = -1;
169 300
170 cache_type = parse_aliases(str, hw_cache, PERF_COUNT_HW_CACHE_MAX); 301 cache_type = parse_aliases(&s, hw_cache, PERF_COUNT_HW_CACHE_MAX);
171 /* 302 /*
172 * No fallback - if we cannot get a clear cache type 303 * No fallback - if we cannot get a clear cache type
173 * then bail out: 304 * then bail out:
174 */ 305 */
175 if (cache_type == -1) 306 if (cache_type == -1)
176 return -EINVAL; 307 return 0;
308
309 while ((cache_op == -1 || cache_result == -1) && *s == '-') {
310 ++s;
311
312 if (cache_op == -1) {
313 cache_op = parse_aliases(&s, hw_cache_op,
314 PERF_COUNT_HW_CACHE_OP_MAX);
315 if (cache_op >= 0) {
316 if (!is_cache_op_valid(cache_type, cache_op))
317 return 0;
318 continue;
319 }
320 }
321
322 if (cache_result == -1) {
323 cache_result = parse_aliases(&s, hw_cache_result,
324 PERF_COUNT_HW_CACHE_RESULT_MAX);
325 if (cache_result >= 0)
326 continue;
327 }
328
329 /*
330 * Can't parse this as a cache op or result, so back up
331 * to the '-'.
332 */
333 --s;
334 break;
335 }
177 336
178 cache_op = parse_aliases(str, hw_cache_op, PERF_COUNT_HW_CACHE_OP_MAX);
179 /* 337 /*
180 * Fall back to reads: 338 * Fall back to reads:
181 */ 339 */
182 if (cache_op == -1) 340 if (cache_op == -1)
183 cache_op = PERF_COUNT_HW_CACHE_OP_READ; 341 cache_op = PERF_COUNT_HW_CACHE_OP_READ;
184 342
185 cache_result = parse_aliases(str, hw_cache_result,
186 PERF_COUNT_HW_CACHE_RESULT_MAX);
187 /* 343 /*
188 * Fall back to accesses: 344 * Fall back to accesses:
189 */ 345 */
@@ -193,82 +349,202 @@ static int parse_generic_hw_symbols(const char *str, struct perf_counter_attr *a
193 attr->config = cache_type | (cache_op << 8) | (cache_result << 16); 349 attr->config = cache_type | (cache_op << 8) | (cache_result << 16);
194 attr->type = PERF_TYPE_HW_CACHE; 350 attr->type = PERF_TYPE_HW_CACHE;
195 351
196 return 0; 352 *str = s;
353 return 1;
197} 354}
198 355
199/* 356static int parse_tracepoint_event(const char **strp,
200 * Each event can have multiple symbolic names. 357 struct perf_counter_attr *attr)
201 * Symbolic names are (almost) exactly matched.
202 */
203static int parse_event_symbols(const char *str, struct perf_counter_attr *attr)
204{ 358{
205 u64 config, id; 359 const char *evt_name;
206 int type; 360 char sys_name[MAX_EVENT_LENGTH];
207 unsigned int i; 361 char id_buf[4];
208 const char *sep, *pstr; 362 int fd;
363 unsigned int sys_length, evt_length;
364 u64 id;
365 char evt_path[MAXPATHLEN];
366
367 if (valid_debugfs_mount(debugfs_path))
368 return 0;
209 369
210 if (str[0] == 'r' && hex2u64(str + 1, &config) > 0) { 370 evt_name = strchr(*strp, ':');
211 attr->type = PERF_TYPE_RAW; 371 if (!evt_name)
212 attr->config = config; 372 return 0;
213 373
374 sys_length = evt_name - *strp;
375 if (sys_length >= MAX_EVENT_LENGTH)
214 return 0; 376 return 0;
215 }
216 377
217 pstr = str; 378 strncpy(sys_name, *strp, sys_length);
218 sep = strchr(pstr, ':'); 379 sys_name[sys_length] = '\0';
219 if (sep) { 380 evt_name = evt_name + 1;
220 type = atoi(pstr); 381 evt_length = strlen(evt_name);
221 pstr = sep + 1; 382 if (evt_length >= MAX_EVENT_LENGTH)
222 id = atoi(pstr); 383 return 0;
223 sep = strchr(pstr, ':');
224 if (sep) {
225 pstr = sep + 1;
226 if (strchr(pstr, 'k'))
227 attr->exclude_user = 1;
228 if (strchr(pstr, 'u'))
229 attr->exclude_kernel = 1;
230 }
231 attr->type = type;
232 attr->config = id;
233 384
385 snprintf(evt_path, MAXPATHLEN, "%s/%s/%s/id", debugfs_path,
386 sys_name, evt_name);
387 fd = open(evt_path, O_RDONLY);
388 if (fd < 0)
389 return 0;
390
391 if (read(fd, id_buf, sizeof(id_buf)) < 0) {
392 close(fd);
234 return 0; 393 return 0;
235 } 394 }
395 close(fd);
396 id = atoll(id_buf);
397 attr->config = id;
398 attr->type = PERF_TYPE_TRACEPOINT;
399 *strp = evt_name + evt_length;
400 return 1;
401}
236 402
237 for (i = 0; i < ARRAY_SIZE(event_symbols); i++) { 403static int check_events(const char *str, unsigned int i)
238 if (!strncmp(str, event_symbols[i].symbol, 404{
239 strlen(event_symbols[i].symbol))) { 405 int n;
406
407 n = strlen(event_symbols[i].symbol);
408 if (!strncmp(str, event_symbols[i].symbol, n))
409 return n;
410
411 n = strlen(event_symbols[i].alias);
412 if (n)
413 if (!strncmp(str, event_symbols[i].alias, n))
414 return n;
415 return 0;
416}
417
418static int
419parse_symbolic_event(const char **strp, struct perf_counter_attr *attr)
420{
421 const char *str = *strp;
422 unsigned int i;
423 int n;
240 424
425 for (i = 0; i < ARRAY_SIZE(event_symbols); i++) {
426 n = check_events(str, i);
427 if (n > 0) {
241 attr->type = event_symbols[i].type; 428 attr->type = event_symbols[i].type;
242 attr->config = event_symbols[i].config; 429 attr->config = event_symbols[i].config;
430 *strp = str + n;
431 return 1;
432 }
433 }
434 return 0;
435}
436
437static int parse_raw_event(const char **strp, struct perf_counter_attr *attr)
438{
439 const char *str = *strp;
440 u64 config;
441 int n;
442
443 if (*str != 'r')
444 return 0;
445 n = hex2u64(str + 1, &config);
446 if (n > 0) {
447 *strp = str + n + 1;
448 attr->type = PERF_TYPE_RAW;
449 attr->config = config;
450 return 1;
451 }
452 return 0;
453}
243 454
244 return 0; 455static int
456parse_numeric_event(const char **strp, struct perf_counter_attr *attr)
457{
458 const char *str = *strp;
459 char *endp;
460 unsigned long type;
461 u64 config;
462
463 type = strtoul(str, &endp, 0);
464 if (endp > str && type < PERF_TYPE_MAX && *endp == ':') {
465 str = endp + 1;
466 config = strtoul(str, &endp, 0);
467 if (endp > str) {
468 attr->type = type;
469 attr->config = config;
470 *strp = endp;
471 return 1;
245 } 472 }
246 } 473 }
474 return 0;
475}
476
477static int
478parse_event_modifier(const char **strp, struct perf_counter_attr *attr)
479{
480 const char *str = *strp;
481 int eu = 1, ek = 1, eh = 1;
482
483 if (*str++ != ':')
484 return 0;
485 while (*str) {
486 if (*str == 'u')
487 eu = 0;
488 else if (*str == 'k')
489 ek = 0;
490 else if (*str == 'h')
491 eh = 0;
492 else
493 break;
494 ++str;
495 }
496 if (str >= *strp + 2) {
497 *strp = str;
498 attr->exclude_user = eu;
499 attr->exclude_kernel = ek;
500 attr->exclude_hv = eh;
501 return 1;
502 }
503 return 0;
504}
505
506/*
507 * Each event can have multiple symbolic names.
508 * Symbolic names are (almost) exactly matched.
509 */
510static int parse_event_symbols(const char **str, struct perf_counter_attr *attr)
511{
512 if (!(parse_tracepoint_event(str, attr) ||
513 parse_raw_event(str, attr) ||
514 parse_numeric_event(str, attr) ||
515 parse_symbolic_event(str, attr) ||
516 parse_generic_hw_event(str, attr)))
517 return 0;
518
519 parse_event_modifier(str, attr);
247 520
248 return parse_generic_hw_symbols(str, attr); 521 return 1;
249} 522}
250 523
251int parse_events(const struct option *opt, const char *str, int unset) 524int parse_events(const struct option *opt __used, const char *str, int unset __used)
252{ 525{
253 struct perf_counter_attr attr; 526 struct perf_counter_attr attr;
254 int ret;
255 527
256 memset(&attr, 0, sizeof(attr)); 528 for (;;) {
257again: 529 if (nr_counters == MAX_COUNTERS)
258 if (nr_counters == MAX_COUNTERS) 530 return -1;
259 return -1; 531
532 memset(&attr, 0, sizeof(attr));
533 if (!parse_event_symbols(&str, &attr))
534 return -1;
260 535
261 ret = parse_event_symbols(str, &attr); 536 if (!(*str == 0 || *str == ',' || isspace(*str)))
262 if (ret < 0) 537 return -1;
263 return ret;
264 538
265 attrs[nr_counters] = attr; 539 attrs[nr_counters] = attr;
266 nr_counters++; 540 nr_counters++;
267 541
268 str = strstr(str, ","); 542 if (*str == 0)
269 if (str) { 543 break;
270 str++; 544 if (*str == ',')
271 goto again; 545 ++str;
546 while (isspace(*str))
547 ++str;
272 } 548 }
273 549
274 return 0; 550 return 0;
@@ -283,34 +559,92 @@ static const char * const event_type_descriptors[] = {
283}; 559};
284 560
285/* 561/*
562 * Print the events from <debugfs_mount_point>/tracing/events
563 */
564
565static void print_tracepoint_events(void)
566{
567 DIR *sys_dir, *evt_dir;
568 struct dirent *sys_next, *evt_next, sys_dirent, evt_dirent;
569 struct stat st;
570 char evt_path[MAXPATHLEN];
571
572 if (valid_debugfs_mount(debugfs_path))
573 return;
574
575 sys_dir = opendir(debugfs_path);
576 if (!sys_dir)
577 goto cleanup;
578
579 for_each_subsystem(sys_dir, sys_dirent, sys_next, evt_path, st) {
580 evt_dir = opendir(evt_path);
581 if (!evt_dir)
582 goto cleanup;
583 for_each_event(sys_dirent, evt_dir, evt_dirent, evt_next,
584 evt_path, st) {
585 snprintf(evt_path, MAXPATHLEN, "%s:%s",
586 sys_dirent.d_name, evt_dirent.d_name);
587 fprintf(stderr, " %-40s [%s]\n", evt_path,
588 event_type_descriptors[PERF_TYPE_TRACEPOINT+1]);
589 }
590 closedir(evt_dir);
591 }
592
593cleanup:
594 closedir(sys_dir);
595}
596
597/*
286 * Print the help text for the event symbols: 598 * Print the help text for the event symbols:
287 */ 599 */
288void print_events(void) 600void print_events(void)
289{ 601{
290 struct event_symbol *syms = event_symbols; 602 struct event_symbol *syms = event_symbols;
291 unsigned int i, type, prev_type = -1; 603 unsigned int i, type, op, prev_type = -1;
604 char name[40];
292 605
293 fprintf(stderr, "\n"); 606 fprintf(stderr, "\n");
294 fprintf(stderr, "List of pre-defined events (to be used in -e):\n"); 607 fprintf(stderr, "List of pre-defined events (to be used in -e):\n");
295 608
296 for (i = 0; i < ARRAY_SIZE(event_symbols); i++, syms++) { 609 for (i = 0; i < ARRAY_SIZE(event_symbols); i++, syms++) {
297 type = syms->type + 1; 610 type = syms->type + 1;
298 if (type > ARRAY_SIZE(event_type_descriptors)) 611 if (type >= ARRAY_SIZE(event_type_descriptors))
299 type = 0; 612 type = 0;
300 613
301 if (type != prev_type) 614 if (type != prev_type)
302 fprintf(stderr, "\n"); 615 fprintf(stderr, "\n");
303 616
304 fprintf(stderr, " %-30s [%s]\n", syms->symbol, 617 if (strlen(syms->alias))
618 sprintf(name, "%s OR %s", syms->symbol, syms->alias);
619 else
620 strcpy(name, syms->symbol);
621 fprintf(stderr, " %-40s [%s]\n", name,
305 event_type_descriptors[type]); 622 event_type_descriptors[type]);
306 623
307 prev_type = type; 624 prev_type = type;
308 } 625 }
309 626
310 fprintf(stderr, "\n"); 627 fprintf(stderr, "\n");
311 fprintf(stderr, " %-30s [raw hardware event descriptor]\n", 628 for (type = 0; type < PERF_COUNT_HW_CACHE_MAX; type++) {
629 for (op = 0; op < PERF_COUNT_HW_CACHE_OP_MAX; op++) {
630 /* skip invalid cache type */
631 if (!is_cache_op_valid(type, op))
632 continue;
633
634 for (i = 0; i < PERF_COUNT_HW_CACHE_RESULT_MAX; i++) {
635 fprintf(stderr, " %-40s [%s]\n",
636 event_cache_name(type, op, i),
637 event_type_descriptors[4]);
638 }
639 }
640 }
641
642 fprintf(stderr, "\n");
643 fprintf(stderr, " %-40s [raw hardware event descriptor]\n",
312 "rNNN"); 644 "rNNN");
313 fprintf(stderr, "\n"); 645 fprintf(stderr, "\n");
314 646
647 print_tracepoint_events();
648
315 exit(129); 649 exit(129);
316} 650}
diff --git a/tools/perf/util/parse-events.h b/tools/perf/util/parse-events.h
index e3d552908e60..1ea5d09b6eb1 100644
--- a/tools/perf/util/parse-events.h
+++ b/tools/perf/util/parse-events.h
@@ -3,6 +3,8 @@
3 * Parse symbolic events/counts passed in as options: 3 * Parse symbolic events/counts passed in as options:
4 */ 4 */
5 5
6struct option;
7
6extern int nr_counters; 8extern int nr_counters;
7 9
8extern struct perf_counter_attr attrs[MAX_COUNTERS]; 10extern struct perf_counter_attr attrs[MAX_COUNTERS];
@@ -15,3 +17,6 @@ extern int parse_events(const struct option *opt, const char *str, int unset);
15 17
16extern void print_events(void); 18extern void print_events(void);
17 19
20extern char debugfs_path[];
21extern int valid_debugfs_mount(const char *debugfs);
22
diff --git a/tools/perf/util/parse-options.c b/tools/perf/util/parse-options.c
index b3affb1658d2..1bf67190c820 100644
--- a/tools/perf/util/parse-options.c
+++ b/tools/perf/util/parse-options.c
@@ -20,7 +20,8 @@ static int get_arg(struct parse_opt_ctx_t *p, const struct option *opt,
20 if (p->opt) { 20 if (p->opt) {
21 *arg = p->opt; 21 *arg = p->opt;
22 p->opt = NULL; 22 p->opt = NULL;
23 } else if (p->argc == 1 && (opt->flags & PARSE_OPT_LASTARG_DEFAULT)) { 23 } else if ((opt->flags & PARSE_OPT_LASTARG_DEFAULT) && (p->argc == 1 ||
24 **(p->argv + 1) == '-')) {
24 *arg = (const char *)opt->defval; 25 *arg = (const char *)opt->defval;
25 } else if (p->argc > 1) { 26 } else if (p->argc > 1) {
26 p->argc--; 27 p->argc--;
@@ -485,7 +486,7 @@ int parse_options_usage(const char * const *usagestr,
485} 486}
486 487
487 488
488int parse_opt_verbosity_cb(const struct option *opt, const char *arg, 489int parse_opt_verbosity_cb(const struct option *opt, const char *arg __used,
489 int unset) 490 int unset)
490{ 491{
491 int *target = opt->value; 492 int *target = opt->value;
diff --git a/tools/perf/util/parse-options.h b/tools/perf/util/parse-options.h
index a1039a6ce0eb..8aa3464c7090 100644
--- a/tools/perf/util/parse-options.h
+++ b/tools/perf/util/parse-options.h
@@ -90,21 +90,22 @@ struct option {
90 intptr_t defval; 90 intptr_t defval;
91}; 91};
92 92
93#define OPT_END() { OPTION_END } 93#define OPT_END() { .type = OPTION_END }
94#define OPT_ARGUMENT(l, h) { OPTION_ARGUMENT, 0, (l), NULL, NULL, (h) } 94#define OPT_ARGUMENT(l, h) { .type = OPTION_ARGUMENT, .long_name = (l), .help = (h) }
95#define OPT_GROUP(h) { OPTION_GROUP, 0, NULL, NULL, NULL, (h) } 95#define OPT_GROUP(h) { .type = OPTION_GROUP, .help = (h) }
96#define OPT_BIT(s, l, v, h, b) { OPTION_BIT, (s), (l), (v), NULL, (h), 0, NULL, (b) } 96#define OPT_BIT(s, l, v, h, b) { .type = OPTION_BIT, .short_name = (s), .long_name = (l), .value = (v), .help = (h), .defval = (b) }
97#define OPT_BOOLEAN(s, l, v, h) { OPTION_BOOLEAN, (s), (l), (v), NULL, (h) } 97#define OPT_BOOLEAN(s, l, v, h) { .type = OPTION_BOOLEAN, .short_name = (s), .long_name = (l), .value = (v), .help = (h) }
98#define OPT_SET_INT(s, l, v, h, i) { OPTION_SET_INT, (s), (l), (v), NULL, (h), 0, NULL, (i) } 98#define OPT_SET_INT(s, l, v, h, i) { .type = OPTION_SET_INT, .short_name = (s), .long_name = (l), .value = (v), .help = (h), .defval = (i) }
99#define OPT_SET_PTR(s, l, v, h, p) { OPTION_SET_PTR, (s), (l), (v), NULL, (h), 0, NULL, (p) } 99#define OPT_SET_PTR(s, l, v, h, p) { .type = OPTION_SET_PTR, .short_name = (s), .long_name = (l), .value = (v), .help = (h), .defval = (p) }
100#define OPT_INTEGER(s, l, v, h) { OPTION_INTEGER, (s), (l), (v), NULL, (h) } 100#define OPT_INTEGER(s, l, v, h) { .type = OPTION_INTEGER, .short_name = (s), .long_name = (l), .value = (v), .help = (h) }
101#define OPT_LONG(s, l, v, h) { OPTION_LONG, (s), (l), (v), NULL, (h) } 101#define OPT_LONG(s, l, v, h) { .type = OPTION_LONG, .short_name = (s), .long_name = (l), .value = (v), .help = (h) }
102#define OPT_STRING(s, l, v, a, h) { OPTION_STRING, (s), (l), (v), (a), (h) } 102#define OPT_STRING(s, l, v, a, h) { .type = OPTION_STRING, .short_name = (s), .long_name = (l), .value = (v), (a), .help = (h) }
103#define OPT_DATE(s, l, v, h) \ 103#define OPT_DATE(s, l, v, h) \
104 { OPTION_CALLBACK, (s), (l), (v), "time",(h), 0, \ 104 { .type = OPTION_CALLBACK, .short_name = (s), .long_name = (l), .value = (v), .argh = "time", .help = (h), .callback = parse_opt_approxidate_cb }
105 parse_opt_approxidate_cb }
106#define OPT_CALLBACK(s, l, v, a, h, f) \ 105#define OPT_CALLBACK(s, l, v, a, h, f) \
107 { OPTION_CALLBACK, (s), (l), (v), (a), (h), 0, (f) } 106 { .type = OPTION_CALLBACK, .short_name = (s), .long_name = (l), .value = (v), (a), .help = (h), .callback = (f) }
107#define OPT_CALLBACK_DEFAULT(s, l, v, a, h, f, d) \
108 { .type = OPTION_CALLBACK, .short_name = (s), .long_name = (l), .value = (v), (a), .help = (h), .callback = (f), .defval = (intptr_t)d, .flags = PARSE_OPT_LASTARG_DEFAULT }
108 109
109/* parse_options() will filter out the processed options and leave the 110/* parse_options() will filter out the processed options and leave the
110 * non-option argments in argv[]. 111 * non-option argments in argv[].
diff --git a/tools/perf/util/quote.c b/tools/perf/util/quote.c
index f18c5212bc92..2726fe40eb5d 100644
--- a/tools/perf/util/quote.c
+++ b/tools/perf/util/quote.c
@@ -162,12 +162,16 @@ static inline int sq_must_quote(char c)
162 return sq_lookup[(unsigned char)c] + quote_path_fully > 0; 162 return sq_lookup[(unsigned char)c] + quote_path_fully > 0;
163} 163}
164 164
165/* returns the longest prefix not needing a quote up to maxlen if positive. 165/*
166 This stops at the first \0 because it's marked as a character needing an 166 * Returns the longest prefix not needing a quote up to maxlen if
167 escape */ 167 * positive.
168static size_t next_quote_pos(const char *s, ssize_t maxlen) 168 * This stops at the first \0 because it's marked as a character
169 * needing an escape.
170 */
171static ssize_t next_quote_pos(const char *s, ssize_t maxlen)
169{ 172{
170 size_t len; 173 ssize_t len;
174
171 if (maxlen < 0) { 175 if (maxlen < 0) {
172 for (len = 0; !sq_must_quote(s[len]); len++); 176 for (len = 0; !sq_must_quote(s[len]); len++);
173 } else { 177 } else {
@@ -192,22 +196,22 @@ static size_t next_quote_pos(const char *s, ssize_t maxlen)
192static size_t quote_c_style_counted(const char *name, ssize_t maxlen, 196static size_t quote_c_style_counted(const char *name, ssize_t maxlen,
193 struct strbuf *sb, FILE *fp, int no_dq) 197 struct strbuf *sb, FILE *fp, int no_dq)
194{ 198{
195#undef EMIT 199#define EMIT(c) \
196#define EMIT(c) \ 200 do { \
197 do { \ 201 if (sb) strbuf_addch(sb, (c)); \
198 if (sb) strbuf_addch(sb, (c)); \ 202 if (fp) fputc((c), fp); \
199 if (fp) fputc((c), fp); \ 203 count++; \
200 count++; \
201 } while (0) 204 } while (0)
202#define EMITBUF(s, l) \ 205
203 do { \ 206#define EMITBUF(s, l) \
204 int __ret; \ 207 do { \
205 if (sb) strbuf_add(sb, (s), (l)); \ 208 int __ret; \
206 if (fp) __ret = fwrite((s), (l), 1, fp); \ 209 if (sb) strbuf_add(sb, (s), (l)); \
207 count += (l); \ 210 if (fp) __ret = fwrite((s), (l), 1, fp); \
211 count += (l); \
208 } while (0) 212 } while (0)
209 213
210 size_t len, count = 0; 214 ssize_t len, count = 0;
211 const char *p = name; 215 const char *p = name;
212 216
213 for (;;) { 217 for (;;) {
@@ -273,8 +277,8 @@ void write_name_quoted(const char *name, FILE *fp, int terminator)
273 fputc(terminator, fp); 277 fputc(terminator, fp);
274} 278}
275 279
276extern void write_name_quotedpfx(const char *pfx, size_t pfxlen, 280void write_name_quotedpfx(const char *pfx, ssize_t pfxlen,
277 const char *name, FILE *fp, int terminator) 281 const char *name, FILE *fp, int terminator)
278{ 282{
279 int needquote = 0; 283 int needquote = 0;
280 284
@@ -306,7 +310,7 @@ char *quote_path_relative(const char *in, int len,
306 len = strlen(in); 310 len = strlen(in);
307 311
308 /* "../" prefix itself does not need quoting, but "in" might. */ 312 /* "../" prefix itself does not need quoting, but "in" might. */
309 needquote = next_quote_pos(in, len) < len; 313 needquote = (next_quote_pos(in, len) < len);
310 strbuf_setlen(out, 0); 314 strbuf_setlen(out, 0);
311 strbuf_grow(out, len); 315 strbuf_grow(out, len);
312 316
@@ -314,7 +318,7 @@ char *quote_path_relative(const char *in, int len,
314 strbuf_addch(out, '"'); 318 strbuf_addch(out, '"');
315 if (prefix) { 319 if (prefix) {
316 int off = 0; 320 int off = 0;
317 while (prefix[off] && off < len && prefix[off] == in[off]) 321 while (off < len && prefix[off] && prefix[off] == in[off])
318 if (prefix[off] == '/') { 322 if (prefix[off] == '/') {
319 prefix += off + 1; 323 prefix += off + 1;
320 in += off + 1; 324 in += off + 1;
diff --git a/tools/perf/util/quote.h b/tools/perf/util/quote.h
index 5dfad89816db..a5454a1d1c13 100644
--- a/tools/perf/util/quote.h
+++ b/tools/perf/util/quote.h
@@ -53,7 +53,7 @@ extern size_t quote_c_style(const char *name, struct strbuf *, FILE *, int no_dq
53extern void quote_two_c_style(struct strbuf *, const char *, const char *, int); 53extern void quote_two_c_style(struct strbuf *, const char *, const char *, int);
54 54
55extern void write_name_quoted(const char *name, FILE *, int terminator); 55extern void write_name_quoted(const char *name, FILE *, int terminator);
56extern void write_name_quotedpfx(const char *pfx, size_t pfxlen, 56extern void write_name_quotedpfx(const char *pfx, ssize_t pfxlen,
57 const char *name, FILE *, int terminator); 57 const char *name, FILE *, int terminator);
58 58
59/* quote path as relative to the given prefix */ 59/* quote path as relative to the given prefix */
diff --git a/tools/perf/util/rbtree.c b/tools/perf/util/rbtree.c
deleted file mode 100644
index b15ba9c7cb3f..000000000000
--- a/tools/perf/util/rbtree.c
+++ /dev/null
@@ -1,383 +0,0 @@
1/*
2 Red Black Trees
3 (C) 1999 Andrea Arcangeli <andrea@suse.de>
4 (C) 2002 David Woodhouse <dwmw2@infradead.org>
5
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
10
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19
20 linux/lib/rbtree.c
21*/
22
23#include "rbtree.h"
24
25static void __rb_rotate_left(struct rb_node *node, struct rb_root *root)
26{
27 struct rb_node *right = node->rb_right;
28 struct rb_node *parent = rb_parent(node);
29
30 if ((node->rb_right = right->rb_left))
31 rb_set_parent(right->rb_left, node);
32 right->rb_left = node;
33
34 rb_set_parent(right, parent);
35
36 if (parent)
37 {
38 if (node == parent->rb_left)
39 parent->rb_left = right;
40 else
41 parent->rb_right = right;
42 }
43 else
44 root->rb_node = right;
45 rb_set_parent(node, right);
46}
47
48static void __rb_rotate_right(struct rb_node *node, struct rb_root *root)
49{
50 struct rb_node *left = node->rb_left;
51 struct rb_node *parent = rb_parent(node);
52
53 if ((node->rb_left = left->rb_right))
54 rb_set_parent(left->rb_right, node);
55 left->rb_right = node;
56
57 rb_set_parent(left, parent);
58
59 if (parent)
60 {
61 if (node == parent->rb_right)
62 parent->rb_right = left;
63 else
64 parent->rb_left = left;
65 }
66 else
67 root->rb_node = left;
68 rb_set_parent(node, left);
69}
70
71void rb_insert_color(struct rb_node *node, struct rb_root *root)
72{
73 struct rb_node *parent, *gparent;
74
75 while ((parent = rb_parent(node)) && rb_is_red(parent))
76 {
77 gparent = rb_parent(parent);
78
79 if (parent == gparent->rb_left)
80 {
81 {
82 register struct rb_node *uncle = gparent->rb_right;
83 if (uncle && rb_is_red(uncle))
84 {
85 rb_set_black(uncle);
86 rb_set_black(parent);
87 rb_set_red(gparent);
88 node = gparent;
89 continue;
90 }
91 }
92
93 if (parent->rb_right == node)
94 {
95 register struct rb_node *tmp;
96 __rb_rotate_left(parent, root);
97 tmp = parent;
98 parent = node;
99 node = tmp;
100 }
101
102 rb_set_black(parent);
103 rb_set_red(gparent);
104 __rb_rotate_right(gparent, root);
105 } else {
106 {
107 register struct rb_node *uncle = gparent->rb_left;
108 if (uncle && rb_is_red(uncle))
109 {
110 rb_set_black(uncle);
111 rb_set_black(parent);
112 rb_set_red(gparent);
113 node = gparent;
114 continue;
115 }
116 }
117
118 if (parent->rb_left == node)
119 {
120 register struct rb_node *tmp;
121 __rb_rotate_right(parent, root);
122 tmp = parent;
123 parent = node;
124 node = tmp;
125 }
126
127 rb_set_black(parent);
128 rb_set_red(gparent);
129 __rb_rotate_left(gparent, root);
130 }
131 }
132
133 rb_set_black(root->rb_node);
134}
135
136static void __rb_erase_color(struct rb_node *node, struct rb_node *parent,
137 struct rb_root *root)
138{
139 struct rb_node *other;
140
141 while ((!node || rb_is_black(node)) && node != root->rb_node)
142 {
143 if (parent->rb_left == node)
144 {
145 other = parent->rb_right;
146 if (rb_is_red(other))
147 {
148 rb_set_black(other);
149 rb_set_red(parent);
150 __rb_rotate_left(parent, root);
151 other = parent->rb_right;
152 }
153 if ((!other->rb_left || rb_is_black(other->rb_left)) &&
154 (!other->rb_right || rb_is_black(other->rb_right)))
155 {
156 rb_set_red(other);
157 node = parent;
158 parent = rb_parent(node);
159 }
160 else
161 {
162 if (!other->rb_right || rb_is_black(other->rb_right))
163 {
164 rb_set_black(other->rb_left);
165 rb_set_red(other);
166 __rb_rotate_right(other, root);
167 other = parent->rb_right;
168 }
169 rb_set_color(other, rb_color(parent));
170 rb_set_black(parent);
171 rb_set_black(other->rb_right);
172 __rb_rotate_left(parent, root);
173 node = root->rb_node;
174 break;
175 }
176 }
177 else
178 {
179 other = parent->rb_left;
180 if (rb_is_red(other))
181 {
182 rb_set_black(other);
183 rb_set_red(parent);
184 __rb_rotate_right(parent, root);
185 other = parent->rb_left;
186 }
187 if ((!other->rb_left || rb_is_black(other->rb_left)) &&
188 (!other->rb_right || rb_is_black(other->rb_right)))
189 {
190 rb_set_red(other);
191 node = parent;
192 parent = rb_parent(node);
193 }
194 else
195 {
196 if (!other->rb_left || rb_is_black(other->rb_left))
197 {
198 rb_set_black(other->rb_right);
199 rb_set_red(other);
200 __rb_rotate_left(other, root);
201 other = parent->rb_left;
202 }
203 rb_set_color(other, rb_color(parent));
204 rb_set_black(parent);
205 rb_set_black(other->rb_left);
206 __rb_rotate_right(parent, root);
207 node = root->rb_node;
208 break;
209 }
210 }
211 }
212 if (node)
213 rb_set_black(node);
214}
215
216void rb_erase(struct rb_node *node, struct rb_root *root)
217{
218 struct rb_node *child, *parent;
219 int color;
220
221 if (!node->rb_left)
222 child = node->rb_right;
223 else if (!node->rb_right)
224 child = node->rb_left;
225 else
226 {
227 struct rb_node *old = node, *left;
228
229 node = node->rb_right;
230 while ((left = node->rb_left) != NULL)
231 node = left;
232 child = node->rb_right;
233 parent = rb_parent(node);
234 color = rb_color(node);
235
236 if (child)
237 rb_set_parent(child, parent);
238 if (parent == old) {
239 parent->rb_right = child;
240 parent = node;
241 } else
242 parent->rb_left = child;
243
244 node->rb_parent_color = old->rb_parent_color;
245 node->rb_right = old->rb_right;
246 node->rb_left = old->rb_left;
247
248 if (rb_parent(old))
249 {
250 if (rb_parent(old)->rb_left == old)
251 rb_parent(old)->rb_left = node;
252 else
253 rb_parent(old)->rb_right = node;
254 } else
255 root->rb_node = node;
256
257 rb_set_parent(old->rb_left, node);
258 if (old->rb_right)
259 rb_set_parent(old->rb_right, node);
260 goto color;
261 }
262
263 parent = rb_parent(node);
264 color = rb_color(node);
265
266 if (child)
267 rb_set_parent(child, parent);
268 if (parent)
269 {
270 if (parent->rb_left == node)
271 parent->rb_left = child;
272 else
273 parent->rb_right = child;
274 }
275 else
276 root->rb_node = child;
277
278 color:
279 if (color == RB_BLACK)
280 __rb_erase_color(child, parent, root);
281}
282
283/*
284 * This function returns the first node (in sort order) of the tree.
285 */
286struct rb_node *rb_first(const struct rb_root *root)
287{
288 struct rb_node *n;
289
290 n = root->rb_node;
291 if (!n)
292 return NULL;
293 while (n->rb_left)
294 n = n->rb_left;
295 return n;
296}
297
298struct rb_node *rb_last(const struct rb_root *root)
299{
300 struct rb_node *n;
301
302 n = root->rb_node;
303 if (!n)
304 return NULL;
305 while (n->rb_right)
306 n = n->rb_right;
307 return n;
308}
309
310struct rb_node *rb_next(const struct rb_node *node)
311{
312 struct rb_node *parent;
313
314 if (rb_parent(node) == node)
315 return NULL;
316
317 /* If we have a right-hand child, go down and then left as far
318 as we can. */
319 if (node->rb_right) {
320 node = node->rb_right;
321 while (node->rb_left)
322 node=node->rb_left;
323 return (struct rb_node *)node;
324 }
325
326 /* No right-hand children. Everything down and left is
327 smaller than us, so any 'next' node must be in the general
328 direction of our parent. Go up the tree; any time the
329 ancestor is a right-hand child of its parent, keep going
330 up. First time it's a left-hand child of its parent, said
331 parent is our 'next' node. */
332 while ((parent = rb_parent(node)) && node == parent->rb_right)
333 node = parent;
334
335 return parent;
336}
337
338struct rb_node *rb_prev(const struct rb_node *node)
339{
340 struct rb_node *parent;
341
342 if (rb_parent(node) == node)
343 return NULL;
344
345 /* If we have a left-hand child, go down and then right as far
346 as we can. */
347 if (node->rb_left) {
348 node = node->rb_left;
349 while (node->rb_right)
350 node=node->rb_right;
351 return (struct rb_node *)node;
352 }
353
354 /* No left-hand children. Go up till we find an ancestor which
355 is a right-hand child of its parent */
356 while ((parent = rb_parent(node)) && node == parent->rb_left)
357 node = parent;
358
359 return parent;
360}
361
362void rb_replace_node(struct rb_node *victim, struct rb_node *new,
363 struct rb_root *root)
364{
365 struct rb_node *parent = rb_parent(victim);
366
367 /* Set the surrounding nodes to point to the replacement */
368 if (parent) {
369 if (victim == parent->rb_left)
370 parent->rb_left = new;
371 else
372 parent->rb_right = new;
373 } else {
374 root->rb_node = new;
375 }
376 if (victim->rb_left)
377 rb_set_parent(victim->rb_left, new);
378 if (victim->rb_right)
379 rb_set_parent(victim->rb_right, new);
380
381 /* Copy the pointers/colour from the victim to the replacement */
382 *new = *victim;
383}
diff --git a/tools/perf/util/rbtree.h b/tools/perf/util/rbtree.h
deleted file mode 100644
index 6bdc488a47fb..000000000000
--- a/tools/perf/util/rbtree.h
+++ /dev/null
@@ -1,171 +0,0 @@
1/*
2 Red Black Trees
3 (C) 1999 Andrea Arcangeli <andrea@suse.de>
4
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version.
9
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18
19 linux/include/linux/rbtree.h
20
21 To use rbtrees you'll have to implement your own insert and search cores.
22 This will avoid us to use callbacks and to drop drammatically performances.
23 I know it's not the cleaner way, but in C (not in C++) to get
24 performances and genericity...
25
26 Some example of insert and search follows here. The search is a plain
27 normal search over an ordered tree. The insert instead must be implemented
28 int two steps: as first thing the code must insert the element in
29 order as a red leaf in the tree, then the support library function
30 rb_insert_color() must be called. Such function will do the
31 not trivial work to rebalance the rbtree if necessary.
32
33-----------------------------------------------------------------------
34static inline struct page * rb_search_page_cache(struct inode * inode,
35 unsigned long offset)
36{
37 struct rb_node * n = inode->i_rb_page_cache.rb_node;
38 struct page * page;
39
40 while (n)
41 {
42 page = rb_entry(n, struct page, rb_page_cache);
43
44 if (offset < page->offset)
45 n = n->rb_left;
46 else if (offset > page->offset)
47 n = n->rb_right;
48 else
49 return page;
50 }
51 return NULL;
52}
53
54static inline struct page * __rb_insert_page_cache(struct inode * inode,
55 unsigned long offset,
56 struct rb_node * node)
57{
58 struct rb_node ** p = &inode->i_rb_page_cache.rb_node;
59 struct rb_node * parent = NULL;
60 struct page * page;
61
62 while (*p)
63 {
64 parent = *p;
65 page = rb_entry(parent, struct page, rb_page_cache);
66
67 if (offset < page->offset)
68 p = &(*p)->rb_left;
69 else if (offset > page->offset)
70 p = &(*p)->rb_right;
71 else
72 return page;
73 }
74
75 rb_link_node(node, parent, p);
76
77 return NULL;
78}
79
80static inline struct page * rb_insert_page_cache(struct inode * inode,
81 unsigned long offset,
82 struct rb_node * node)
83{
84 struct page * ret;
85 if ((ret = __rb_insert_page_cache(inode, offset, node)))
86 goto out;
87 rb_insert_color(node, &inode->i_rb_page_cache);
88 out:
89 return ret;
90}
91-----------------------------------------------------------------------
92*/
93
94#ifndef _LINUX_RBTREE_H
95#define _LINUX_RBTREE_H
96
97#include <stddef.h>
98
99/**
100 * container_of - cast a member of a structure out to the containing structure
101 * @ptr: the pointer to the member.
102 * @type: the type of the container struct this is embedded in.
103 * @member: the name of the member within the struct.
104 *
105 */
106#define container_of(ptr, type, member) ({ \
107 const typeof( ((type *)0)->member ) *__mptr = (ptr); \
108 (type *)( (char *)__mptr - offsetof(type,member) );})
109
110struct rb_node
111{
112 unsigned long rb_parent_color;
113#define RB_RED 0
114#define RB_BLACK 1
115 struct rb_node *rb_right;
116 struct rb_node *rb_left;
117} __attribute__((aligned(sizeof(long))));
118 /* The alignment might seem pointless, but allegedly CRIS needs it */
119
120struct rb_root
121{
122 struct rb_node *rb_node;
123};
124
125
126#define rb_parent(r) ((struct rb_node *)((r)->rb_parent_color & ~3))
127#define rb_color(r) ((r)->rb_parent_color & 1)
128#define rb_is_red(r) (!rb_color(r))
129#define rb_is_black(r) rb_color(r)
130#define rb_set_red(r) do { (r)->rb_parent_color &= ~1; } while (0)
131#define rb_set_black(r) do { (r)->rb_parent_color |= 1; } while (0)
132
133static inline void rb_set_parent(struct rb_node *rb, struct rb_node *p)
134{
135 rb->rb_parent_color = (rb->rb_parent_color & 3) | (unsigned long)p;
136}
137static inline void rb_set_color(struct rb_node *rb, int color)
138{
139 rb->rb_parent_color = (rb->rb_parent_color & ~1) | color;
140}
141
142#define RB_ROOT (struct rb_root) { NULL, }
143#define rb_entry(ptr, type, member) container_of(ptr, type, member)
144
145#define RB_EMPTY_ROOT(root) ((root)->rb_node == NULL)
146#define RB_EMPTY_NODE(node) (rb_parent(node) == node)
147#define RB_CLEAR_NODE(node) (rb_set_parent(node, node))
148
149extern void rb_insert_color(struct rb_node *, struct rb_root *);
150extern void rb_erase(struct rb_node *, struct rb_root *);
151
152/* Find logical next and previous nodes in a tree */
153extern struct rb_node *rb_next(const struct rb_node *);
154extern struct rb_node *rb_prev(const struct rb_node *);
155extern struct rb_node *rb_first(const struct rb_root *);
156extern struct rb_node *rb_last(const struct rb_root *);
157
158/* Fast replacement of a single node without remove/rebalance/add/rebalance */
159extern void rb_replace_node(struct rb_node *victim, struct rb_node *new,
160 struct rb_root *root);
161
162static inline void rb_link_node(struct rb_node * node, struct rb_node * parent,
163 struct rb_node ** rb_link)
164{
165 node->rb_parent_color = (unsigned long )parent;
166 node->rb_left = node->rb_right = NULL;
167
168 *rb_link = node;
169}
170
171#endif /* _LINUX_RBTREE_H */
diff --git a/tools/perf/util/run-command.c b/tools/perf/util/run-command.c
index b2f5e854f40a..a3935343091a 100644
--- a/tools/perf/util/run-command.c
+++ b/tools/perf/util/run-command.c
@@ -65,7 +65,6 @@ int start_command(struct child_process *cmd)
65 cmd->err = fderr[0]; 65 cmd->err = fderr[0];
66 } 66 }
67 67
68#ifndef __MINGW32__
69 fflush(NULL); 68 fflush(NULL);
70 cmd->pid = fork(); 69 cmd->pid = fork();
71 if (!cmd->pid) { 70 if (!cmd->pid) {
@@ -118,71 +117,6 @@ int start_command(struct child_process *cmd)
118 } 117 }
119 exit(127); 118 exit(127);
120 } 119 }
121#else
122 int s0 = -1, s1 = -1, s2 = -1; /* backups of stdin, stdout, stderr */
123 const char **sargv = cmd->argv;
124 char **env = environ;
125
126 if (cmd->no_stdin) {
127 s0 = dup(0);
128 dup_devnull(0);
129 } else if (need_in) {
130 s0 = dup(0);
131 dup2(fdin[0], 0);
132 } else if (cmd->in) {
133 s0 = dup(0);
134 dup2(cmd->in, 0);
135 }
136
137 if (cmd->no_stderr) {
138 s2 = dup(2);
139 dup_devnull(2);
140 } else if (need_err) {
141 s2 = dup(2);
142 dup2(fderr[1], 2);
143 }
144
145 if (cmd->no_stdout) {
146 s1 = dup(1);
147 dup_devnull(1);
148 } else if (cmd->stdout_to_stderr) {
149 s1 = dup(1);
150 dup2(2, 1);
151 } else if (need_out) {
152 s1 = dup(1);
153 dup2(fdout[1], 1);
154 } else if (cmd->out > 1) {
155 s1 = dup(1);
156 dup2(cmd->out, 1);
157 }
158
159 if (cmd->dir)
160 die("chdir in start_command() not implemented");
161 if (cmd->env) {
162 env = copy_environ();
163 for (; *cmd->env; cmd->env++)
164 env = env_setenv(env, *cmd->env);
165 }
166
167 if (cmd->perf_cmd) {
168 cmd->argv = prepare_perf_cmd(cmd->argv);
169 }
170
171 cmd->pid = mingw_spawnvpe(cmd->argv[0], cmd->argv, env);
172
173 if (cmd->env)
174 free_environ(env);
175 if (cmd->perf_cmd)
176 free(cmd->argv);
177
178 cmd->argv = sargv;
179 if (s0 >= 0)
180 dup2(s0, 0), close(s0);
181 if (s1 >= 0)
182 dup2(s1, 1), close(s1);
183 if (s2 >= 0)
184 dup2(s2, 2), close(s2);
185#endif
186 120
187 if (cmd->pid < 0) { 121 if (cmd->pid < 0) {
188 int err = errno; 122 int err = errno;
@@ -288,14 +222,6 @@ int run_command_v_opt_cd_env(const char **argv, int opt, const char *dir, const
288 return run_command(&cmd); 222 return run_command(&cmd);
289} 223}
290 224
291#ifdef __MINGW32__
292static __stdcall unsigned run_thread(void *data)
293{
294 struct async *async = data;
295 return async->proc(async->fd_for_proc, async->data);
296}
297#endif
298
299int start_async(struct async *async) 225int start_async(struct async *async)
300{ 226{
301 int pipe_out[2]; 227 int pipe_out[2];
@@ -304,7 +230,6 @@ int start_async(struct async *async)
304 return error("cannot create pipe: %s", strerror(errno)); 230 return error("cannot create pipe: %s", strerror(errno));
305 async->out = pipe_out[0]; 231 async->out = pipe_out[0];
306 232
307#ifndef __MINGW32__
308 /* Flush stdio before fork() to avoid cloning buffers */ 233 /* Flush stdio before fork() to avoid cloning buffers */
309 fflush(NULL); 234 fflush(NULL);
310 235
@@ -319,33 +244,17 @@ int start_async(struct async *async)
319 exit(!!async->proc(pipe_out[1], async->data)); 244 exit(!!async->proc(pipe_out[1], async->data));
320 } 245 }
321 close(pipe_out[1]); 246 close(pipe_out[1]);
322#else 247
323 async->fd_for_proc = pipe_out[1];
324 async->tid = (HANDLE) _beginthreadex(NULL, 0, run_thread, async, 0, NULL);
325 if (!async->tid) {
326 error("cannot create thread: %s", strerror(errno));
327 close_pair(pipe_out);
328 return -1;
329 }
330#endif
331 return 0; 248 return 0;
332} 249}
333 250
334int finish_async(struct async *async) 251int finish_async(struct async *async)
335{ 252{
336#ifndef __MINGW32__
337 int ret = 0; 253 int ret = 0;
338 254
339 if (wait_or_whine(async->pid)) 255 if (wait_or_whine(async->pid))
340 ret = error("waitpid (async) failed"); 256 ret = error("waitpid (async) failed");
341#else 257
342 DWORD ret = 0;
343 if (WaitForSingleObject(async->tid, INFINITE) != WAIT_OBJECT_0)
344 ret = error("waiting for thread failed: %lu", GetLastError());
345 else if (!GetExitCodeThread(async->tid, &ret))
346 ret = error("cannot get thread exit code: %lu", GetLastError());
347 CloseHandle(async->tid);
348#endif
349 return ret; 258 return ret;
350} 259}
351 260
diff --git a/tools/perf/util/run-command.h b/tools/perf/util/run-command.h
index 328289f23669..cc1837deba88 100644
--- a/tools/perf/util/run-command.h
+++ b/tools/perf/util/run-command.h
@@ -79,12 +79,7 @@ struct async {
79 int (*proc)(int fd, void *data); 79 int (*proc)(int fd, void *data);
80 void *data; 80 void *data;
81 int out; /* caller reads from here and closes it */ 81 int out; /* caller reads from here and closes it */
82#ifndef __MINGW32__
83 pid_t pid; 82 pid_t pid;
84#else
85 HANDLE tid;
86 int fd_for_proc;
87#endif
88}; 83};
89 84
90int start_async(struct async *async); 85int start_async(struct async *async);
diff --git a/tools/perf/util/strbuf.c b/tools/perf/util/strbuf.c
index eaba09306802..5249d5a1b0c2 100644
--- a/tools/perf/util/strbuf.c
+++ b/tools/perf/util/strbuf.c
@@ -16,7 +16,7 @@ int prefixcmp(const char *str, const char *prefix)
16 */ 16 */
17char strbuf_slopbuf[1]; 17char strbuf_slopbuf[1];
18 18
19void strbuf_init(struct strbuf *sb, size_t hint) 19void strbuf_init(struct strbuf *sb, ssize_t hint)
20{ 20{
21 sb->alloc = sb->len = 0; 21 sb->alloc = sb->len = 0;
22 sb->buf = strbuf_slopbuf; 22 sb->buf = strbuf_slopbuf;
@@ -92,7 +92,8 @@ void strbuf_ltrim(struct strbuf *sb)
92 92
93void strbuf_tolower(struct strbuf *sb) 93void strbuf_tolower(struct strbuf *sb)
94{ 94{
95 int i; 95 unsigned int i;
96
96 for (i = 0; i < sb->len; i++) 97 for (i = 0; i < sb->len; i++)
97 sb->buf[i] = tolower(sb->buf[i]); 98 sb->buf[i] = tolower(sb->buf[i]);
98} 99}
@@ -259,12 +260,12 @@ size_t strbuf_fread(struct strbuf *sb, size_t size, FILE *f)
259 res = fread(sb->buf + sb->len, 1, size, f); 260 res = fread(sb->buf + sb->len, 1, size, f);
260 if (res > 0) 261 if (res > 0)
261 strbuf_setlen(sb, sb->len + res); 262 strbuf_setlen(sb, sb->len + res);
262 else if (res < 0 && oldalloc == 0) 263 else if (oldalloc == 0)
263 strbuf_release(sb); 264 strbuf_release(sb);
264 return res; 265 return res;
265} 266}
266 267
267ssize_t strbuf_read(struct strbuf *sb, int fd, size_t hint) 268ssize_t strbuf_read(struct strbuf *sb, int fd, ssize_t hint)
268{ 269{
269 size_t oldlen = sb->len; 270 size_t oldlen = sb->len;
270 size_t oldalloc = sb->alloc; 271 size_t oldalloc = sb->alloc;
@@ -293,7 +294,7 @@ ssize_t strbuf_read(struct strbuf *sb, int fd, size_t hint)
293 294
294#define STRBUF_MAXLINK (2*PATH_MAX) 295#define STRBUF_MAXLINK (2*PATH_MAX)
295 296
296int strbuf_readlink(struct strbuf *sb, const char *path, size_t hint) 297int strbuf_readlink(struct strbuf *sb, const char *path, ssize_t hint)
297{ 298{
298 size_t oldalloc = sb->alloc; 299 size_t oldalloc = sb->alloc;
299 300
@@ -301,7 +302,7 @@ int strbuf_readlink(struct strbuf *sb, const char *path, size_t hint)
301 hint = 32; 302 hint = 32;
302 303
303 while (hint < STRBUF_MAXLINK) { 304 while (hint < STRBUF_MAXLINK) {
304 int len; 305 ssize_t len;
305 306
306 strbuf_grow(sb, hint); 307 strbuf_grow(sb, hint);
307 len = readlink(path, sb->buf, hint); 308 len = readlink(path, sb->buf, hint);
@@ -343,7 +344,7 @@ int strbuf_getline(struct strbuf *sb, FILE *fp, int term)
343 return 0; 344 return 0;
344} 345}
345 346
346int strbuf_read_file(struct strbuf *sb, const char *path, size_t hint) 347int strbuf_read_file(struct strbuf *sb, const char *path, ssize_t hint)
347{ 348{
348 int fd, len; 349 int fd, len;
349 350
diff --git a/tools/perf/util/strbuf.h b/tools/perf/util/strbuf.h
index 9ee908a3ec5d..d2aa86c014c1 100644
--- a/tools/perf/util/strbuf.h
+++ b/tools/perf/util/strbuf.h
@@ -50,7 +50,7 @@ struct strbuf {
50#define STRBUF_INIT { 0, 0, strbuf_slopbuf } 50#define STRBUF_INIT { 0, 0, strbuf_slopbuf }
51 51
52/*----- strbuf life cycle -----*/ 52/*----- strbuf life cycle -----*/
53extern void strbuf_init(struct strbuf *, size_t); 53extern void strbuf_init(struct strbuf *buf, ssize_t hint);
54extern void strbuf_release(struct strbuf *); 54extern void strbuf_release(struct strbuf *);
55extern char *strbuf_detach(struct strbuf *, size_t *); 55extern char *strbuf_detach(struct strbuf *, size_t *);
56extern void strbuf_attach(struct strbuf *, void *, size_t, size_t); 56extern void strbuf_attach(struct strbuf *, void *, size_t, size_t);
@@ -61,7 +61,7 @@ static inline void strbuf_swap(struct strbuf *a, struct strbuf *b) {
61} 61}
62 62
63/*----- strbuf size related -----*/ 63/*----- strbuf size related -----*/
64static inline size_t strbuf_avail(const struct strbuf *sb) { 64static inline ssize_t strbuf_avail(const struct strbuf *sb) {
65 return sb->alloc ? sb->alloc - sb->len - 1 : 0; 65 return sb->alloc ? sb->alloc - sb->len - 1 : 0;
66} 66}
67 67
@@ -122,9 +122,9 @@ extern void strbuf_addf(struct strbuf *sb, const char *fmt, ...);
122 122
123extern size_t strbuf_fread(struct strbuf *, size_t, FILE *); 123extern size_t strbuf_fread(struct strbuf *, size_t, FILE *);
124/* XXX: if read fails, any partial read is undone */ 124/* XXX: if read fails, any partial read is undone */
125extern ssize_t strbuf_read(struct strbuf *, int fd, size_t hint); 125extern ssize_t strbuf_read(struct strbuf *, int fd, ssize_t hint);
126extern int strbuf_read_file(struct strbuf *sb, const char *path, size_t hint); 126extern int strbuf_read_file(struct strbuf *sb, const char *path, ssize_t hint);
127extern int strbuf_readlink(struct strbuf *sb, const char *path, size_t hint); 127extern int strbuf_readlink(struct strbuf *sb, const char *path, ssize_t hint);
128 128
129extern int strbuf_getline(struct strbuf *, FILE *, int); 129extern int strbuf_getline(struct strbuf *, FILE *, int);
130 130
diff --git a/tools/perf/util/string.h b/tools/perf/util/string.h
index 37b03255b425..bf39dfadfd24 100644
--- a/tools/perf/util/string.h
+++ b/tools/perf/util/string.h
@@ -1,8 +1,11 @@
1#ifndef _PERF_STRING_H_ 1#ifndef _PERF_STRING_H_
2#define _PERF_STRING_H_ 2#define _PERF_STRING_H_
3 3
4#include "../types.h" 4#include "types.h"
5 5
6int hex2u64(const char *ptr, u64 *val); 6int hex2u64(const char *ptr, u64 *val);
7 7
8#define _STR(x) #x
9#define STR(x) _STR(x)
10
8#endif 11#endif
diff --git a/tools/perf/util/strlist.c b/tools/perf/util/strlist.c
new file mode 100644
index 000000000000..7ad38171dc2b
--- /dev/null
+++ b/tools/perf/util/strlist.c
@@ -0,0 +1,200 @@
1/*
2 * (c) 2009 Arnaldo Carvalho de Melo <acme@redhat.com>
3 *
4 * Licensed under the GPLv2.
5 */
6
7#include "strlist.h"
8#include <errno.h>
9#include <stdio.h>
10#include <stdlib.h>
11#include <string.h>
12
13static struct str_node *str_node__new(const char *s, bool dupstr)
14{
15 struct str_node *self = malloc(sizeof(*self));
16
17 if (self != NULL) {
18 if (dupstr) {
19 s = strdup(s);
20 if (s == NULL)
21 goto out_delete;
22 }
23 self->s = s;
24 }
25
26 return self;
27
28out_delete:
29 free(self);
30 return NULL;
31}
32
33static void str_node__delete(struct str_node *self, bool dupstr)
34{
35 if (dupstr)
36 free((void *)self->s);
37 free(self);
38}
39
40int strlist__add(struct strlist *self, const char *new_entry)
41{
42 struct rb_node **p = &self->entries.rb_node;
43 struct rb_node *parent = NULL;
44 struct str_node *sn;
45
46 while (*p != NULL) {
47 int rc;
48
49 parent = *p;
50 sn = rb_entry(parent, struct str_node, rb_node);
51 rc = strcmp(sn->s, new_entry);
52
53 if (rc > 0)
54 p = &(*p)->rb_left;
55 else if (rc < 0)
56 p = &(*p)->rb_right;
57 else
58 return -EEXIST;
59 }
60
61 sn = str_node__new(new_entry, self->dupstr);
62 if (sn == NULL)
63 return -ENOMEM;
64
65 rb_link_node(&sn->rb_node, parent, p);
66 rb_insert_color(&sn->rb_node, &self->entries);
67 ++self->nr_entries;
68
69 return 0;
70}
71
72int strlist__load(struct strlist *self, const char *filename)
73{
74 char entry[1024];
75 int err;
76 FILE *fp = fopen(filename, "r");
77
78 if (fp == NULL)
79 return errno;
80
81 while (fgets(entry, sizeof(entry), fp) != NULL) {
82 const size_t len = strlen(entry);
83
84 if (len == 0)
85 continue;
86 entry[len - 1] = '\0';
87
88 err = strlist__add(self, entry);
89 if (err != 0)
90 goto out;
91 }
92
93 err = 0;
94out:
95 fclose(fp);
96 return err;
97}
98
99void strlist__remove(struct strlist *self, struct str_node *sn)
100{
101 rb_erase(&sn->rb_node, &self->entries);
102 str_node__delete(sn, self->dupstr);
103}
104
105bool strlist__has_entry(struct strlist *self, const char *entry)
106{
107 struct rb_node **p = &self->entries.rb_node;
108 struct rb_node *parent = NULL;
109
110 while (*p != NULL) {
111 struct str_node *sn;
112 int rc;
113
114 parent = *p;
115 sn = rb_entry(parent, struct str_node, rb_node);
116 rc = strcmp(sn->s, entry);
117
118 if (rc > 0)
119 p = &(*p)->rb_left;
120 else if (rc < 0)
121 p = &(*p)->rb_right;
122 else
123 return true;
124 }
125
126 return false;
127}
128
129static int strlist__parse_list_entry(struct strlist *self, const char *s)
130{
131 if (strncmp(s, "file://", 7) == 0)
132 return strlist__load(self, s + 7);
133
134 return strlist__add(self, s);
135}
136
137int strlist__parse_list(struct strlist *self, const char *s)
138{
139 char *sep;
140 int err;
141
142 while ((sep = strchr(s, ',')) != NULL) {
143 *sep = '\0';
144 err = strlist__parse_list_entry(self, s);
145 *sep = ',';
146 if (err != 0)
147 return err;
148 s = sep + 1;
149 }
150
151 return *s ? strlist__parse_list_entry(self, s) : 0;
152}
153
154struct strlist *strlist__new(bool dupstr, const char *slist)
155{
156 struct strlist *self = malloc(sizeof(*self));
157
158 if (self != NULL) {
159 self->entries = RB_ROOT;
160 self->dupstr = dupstr;
161 self->nr_entries = 0;
162 if (slist && strlist__parse_list(self, slist) != 0)
163 goto out_error;
164 }
165
166 return self;
167out_error:
168 free(self);
169 return NULL;
170}
171
172void strlist__delete(struct strlist *self)
173{
174 if (self != NULL) {
175 struct str_node *pos;
176 struct rb_node *next = rb_first(&self->entries);
177
178 while (next) {
179 pos = rb_entry(next, struct str_node, rb_node);
180 next = rb_next(&pos->rb_node);
181 strlist__remove(self, pos);
182 }
183 self->entries = RB_ROOT;
184 free(self);
185 }
186}
187
188struct str_node *strlist__entry(const struct strlist *self, unsigned int idx)
189{
190 struct rb_node *nd;
191
192 for (nd = rb_first(&self->entries); nd; nd = rb_next(nd)) {
193 struct str_node *pos = rb_entry(nd, struct str_node, rb_node);
194
195 if (!idx--)
196 return pos;
197 }
198
199 return NULL;
200}
diff --git a/tools/perf/util/strlist.h b/tools/perf/util/strlist.h
new file mode 100644
index 000000000000..921818e44a54
--- /dev/null
+++ b/tools/perf/util/strlist.h
@@ -0,0 +1,39 @@
1#ifndef STRLIST_H_
2#define STRLIST_H_
3
4#include <linux/rbtree.h>
5#include <stdbool.h>
6
7struct str_node {
8 struct rb_node rb_node;
9 const char *s;
10};
11
12struct strlist {
13 struct rb_root entries;
14 unsigned int nr_entries;
15 bool dupstr;
16};
17
18struct strlist *strlist__new(bool dupstr, const char *slist);
19void strlist__delete(struct strlist *self);
20
21void strlist__remove(struct strlist *self, struct str_node *sn);
22int strlist__load(struct strlist *self, const char *filename);
23int strlist__add(struct strlist *self, const char *str);
24
25struct str_node *strlist__entry(const struct strlist *self, unsigned int idx);
26bool strlist__has_entry(struct strlist *self, const char *entry);
27
28static inline bool strlist__empty(const struct strlist *self)
29{
30 return self->nr_entries == 0;
31}
32
33static inline unsigned int strlist__nr_entries(const struct strlist *self)
34{
35 return self->nr_entries;
36}
37
38int strlist__parse_list(struct strlist *self, const char *s);
39#endif /* STRLIST_H_ */
diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c
index 86e14375e74e..16ddca202948 100644
--- a/tools/perf/util/symbol.c
+++ b/tools/perf/util/symbol.c
@@ -7,8 +7,23 @@
7#include <gelf.h> 7#include <gelf.h>
8#include <elf.h> 8#include <elf.h>
9 9
10#ifndef NO_DEMANGLE
11#include <bfd.h>
12#else
13static inline
14char *bfd_demangle(void __used *v, const char __used *c, int __used i)
15{
16 return NULL;
17}
18#endif
19
10const char *sym_hist_filter; 20const char *sym_hist_filter;
11 21
22#ifndef DMGL_PARAMS
23#define DMGL_PARAMS (1 << 0) /* Include function args */
24#define DMGL_ANSI (1 << 1) /* Include const, volatile, etc */
25#endif
26
12static struct symbol *symbol__new(u64 start, u64 len, 27static struct symbol *symbol__new(u64 start, u64 len,
13 const char *name, unsigned int priv_size, 28 const char *name, unsigned int priv_size,
14 u64 obj_start, int verbose) 29 u64 obj_start, int verbose)
@@ -35,7 +50,7 @@ static struct symbol *symbol__new(u64 start, u64 len,
35 self = ((void *)self) + priv_size; 50 self = ((void *)self) + priv_size;
36 } 51 }
37 self->start = start; 52 self->start = start;
38 self->end = start + len - 1; 53 self->end = len ? start + len - 1 : start;
39 memcpy(self->name, name, namelen); 54 memcpy(self->name, name, namelen);
40 55
41 return self; 56 return self;
@@ -48,8 +63,12 @@ static void symbol__delete(struct symbol *self, unsigned int priv_size)
48 63
49static size_t symbol__fprintf(struct symbol *self, FILE *fp) 64static size_t symbol__fprintf(struct symbol *self, FILE *fp)
50{ 65{
51 return fprintf(fp, " %llx-%llx %s\n", 66 if (!self->module)
67 return fprintf(fp, " %llx-%llx %s\n",
52 self->start, self->end, self->name); 68 self->start, self->end, self->name);
69 else
70 return fprintf(fp, " %llx-%llx %s \t[%s]\n",
71 self->start, self->end, self->name, self->module->name);
53} 72}
54 73
55struct dso *dso__new(const char *name, unsigned int sym_priv_size) 74struct dso *dso__new(const char *name, unsigned int sym_priv_size)
@@ -61,6 +80,7 @@ struct dso *dso__new(const char *name, unsigned int sym_priv_size)
61 self->syms = RB_ROOT; 80 self->syms = RB_ROOT;
62 self->sym_priv_size = sym_priv_size; 81 self->sym_priv_size = sym_priv_size;
63 self->find_symbol = dso__find_symbol; 82 self->find_symbol = dso__find_symbol;
83 self->slen_calculated = 0;
64 } 84 }
65 85
66 return self; 86 return self;
@@ -146,6 +166,7 @@ static int dso__load_kallsyms(struct dso *self, symbol_filter_t filter, int verb
146 char *line = NULL; 166 char *line = NULL;
147 size_t n; 167 size_t n;
148 FILE *file = fopen("/proc/kallsyms", "r"); 168 FILE *file = fopen("/proc/kallsyms", "r");
169 int count = 0;
149 170
150 if (file == NULL) 171 if (file == NULL)
151 goto out_failure; 172 goto out_failure;
@@ -188,8 +209,10 @@ static int dso__load_kallsyms(struct dso *self, symbol_filter_t filter, int verb
188 209
189 if (filter && filter(self, sym)) 210 if (filter && filter(self, sym))
190 symbol__delete(sym, self->sym_priv_size); 211 symbol__delete(sym, self->sym_priv_size);
191 else 212 else {
192 dso__insert_symbol(self, sym); 213 dso__insert_symbol(self, sym);
214 count++;
215 }
193 } 216 }
194 217
195 /* 218 /*
@@ -212,7 +235,7 @@ static int dso__load_kallsyms(struct dso *self, symbol_filter_t filter, int verb
212 free(line); 235 free(line);
213 fclose(file); 236 fclose(file);
214 237
215 return 0; 238 return count;
216 239
217out_delete_line: 240out_delete_line:
218 free(line); 241 free(line);
@@ -307,6 +330,26 @@ static inline int elf_sym__is_function(const GElf_Sym *sym)
307 sym->st_size != 0; 330 sym->st_size != 0;
308} 331}
309 332
333static inline int elf_sym__is_label(const GElf_Sym *sym)
334{
335 return elf_sym__type(sym) == STT_NOTYPE &&
336 sym->st_name != 0 &&
337 sym->st_shndx != SHN_UNDEF &&
338 sym->st_shndx != SHN_ABS;
339}
340
341static inline const char *elf_sec__name(const GElf_Shdr *shdr,
342 const Elf_Data *secstrs)
343{
344 return secstrs->d_buf + shdr->sh_name;
345}
346
347static inline int elf_sec__is_text(const GElf_Shdr *shdr,
348 const Elf_Data *secstrs)
349{
350 return strstr(elf_sec__name(shdr, secstrs), "text") != NULL;
351}
352
310static inline const char *elf_sym__name(const GElf_Sym *sym, 353static inline const char *elf_sym__name(const GElf_Sym *sym,
311 const Elf_Data *symstrs) 354 const Elf_Data *symstrs)
312{ 355{
@@ -346,36 +389,61 @@ static Elf_Scn *elf_section_by_name(Elf *elf, GElf_Ehdr *ep,
346 idx < nr_entries; \ 389 idx < nr_entries; \
347 ++idx, pos = gelf_getrela(reldata, idx, &pos_mem)) 390 ++idx, pos = gelf_getrela(reldata, idx, &pos_mem))
348 391
349static int dso__synthesize_plt_symbols(struct dso *self, Elf *elf, 392/*
350 GElf_Ehdr *ehdr, Elf_Scn *scn_dynsym, 393 * We need to check if we have a .dynsym, so that we can handle the
351 GElf_Shdr *shdr_dynsym, 394 * .plt, synthesizing its symbols, that aren't on the symtabs (be it
352 size_t dynsym_idx, int verbose) 395 * .dynsym or .symtab).
396 * And always look at the original dso, not at debuginfo packages, that
397 * have the PLT data stripped out (shdr_rel_plt.sh_type == SHT_NOBITS).
398 */
399static int dso__synthesize_plt_symbols(struct dso *self, int verbose)
353{ 400{
354 uint32_t nr_rel_entries, idx; 401 uint32_t nr_rel_entries, idx;
355 GElf_Sym sym; 402 GElf_Sym sym;
356 u64 plt_offset; 403 u64 plt_offset;
357 GElf_Shdr shdr_plt; 404 GElf_Shdr shdr_plt;
358 struct symbol *f; 405 struct symbol *f;
359 GElf_Shdr shdr_rel_plt; 406 GElf_Shdr shdr_rel_plt, shdr_dynsym;
360 Elf_Data *reldata, *syms, *symstrs; 407 Elf_Data *reldata, *syms, *symstrs;
361 Elf_Scn *scn_plt_rel, *scn_symstrs; 408 Elf_Scn *scn_plt_rel, *scn_symstrs, *scn_dynsym;
409 size_t dynsym_idx;
410 GElf_Ehdr ehdr;
362 char sympltname[1024]; 411 char sympltname[1024];
363 int nr = 0, symidx; 412 Elf *elf;
413 int nr = 0, symidx, fd, err = 0;
414
415 fd = open(self->name, O_RDONLY);
416 if (fd < 0)
417 goto out;
418
419 elf = elf_begin(fd, ELF_C_READ_MMAP, NULL);
420 if (elf == NULL)
421 goto out_close;
422
423 if (gelf_getehdr(elf, &ehdr) == NULL)
424 goto out_elf_end;
425
426 scn_dynsym = elf_section_by_name(elf, &ehdr, &shdr_dynsym,
427 ".dynsym", &dynsym_idx);
428 if (scn_dynsym == NULL)
429 goto out_elf_end;
364 430
365 scn_plt_rel = elf_section_by_name(elf, ehdr, &shdr_rel_plt, 431 scn_plt_rel = elf_section_by_name(elf, &ehdr, &shdr_rel_plt,
366 ".rela.plt", NULL); 432 ".rela.plt", NULL);
367 if (scn_plt_rel == NULL) { 433 if (scn_plt_rel == NULL) {
368 scn_plt_rel = elf_section_by_name(elf, ehdr, &shdr_rel_plt, 434 scn_plt_rel = elf_section_by_name(elf, &ehdr, &shdr_rel_plt,
369 ".rel.plt", NULL); 435 ".rel.plt", NULL);
370 if (scn_plt_rel == NULL) 436 if (scn_plt_rel == NULL)
371 return 0; 437 goto out_elf_end;
372 } 438 }
373 439
440 err = -1;
441
374 if (shdr_rel_plt.sh_link != dynsym_idx) 442 if (shdr_rel_plt.sh_link != dynsym_idx)
375 return 0; 443 goto out_elf_end;
376 444
377 if (elf_section_by_name(elf, ehdr, &shdr_plt, ".plt", NULL) == NULL) 445 if (elf_section_by_name(elf, &ehdr, &shdr_plt, ".plt", NULL) == NULL)
378 return 0; 446 goto out_elf_end;
379 447
380 /* 448 /*
381 * Fetch the relocation section to find the indexes to the GOT 449 * Fetch the relocation section to find the indexes to the GOT
@@ -383,19 +451,19 @@ static int dso__synthesize_plt_symbols(struct dso *self, Elf *elf,
383 */ 451 */
384 reldata = elf_getdata(scn_plt_rel, NULL); 452 reldata = elf_getdata(scn_plt_rel, NULL);
385 if (reldata == NULL) 453 if (reldata == NULL)
386 return -1; 454 goto out_elf_end;
387 455
388 syms = elf_getdata(scn_dynsym, NULL); 456 syms = elf_getdata(scn_dynsym, NULL);
389 if (syms == NULL) 457 if (syms == NULL)
390 return -1; 458 goto out_elf_end;
391 459
392 scn_symstrs = elf_getscn(elf, shdr_dynsym->sh_link); 460 scn_symstrs = elf_getscn(elf, shdr_dynsym.sh_link);
393 if (scn_symstrs == NULL) 461 if (scn_symstrs == NULL)
394 return -1; 462 goto out_elf_end;
395 463
396 symstrs = elf_getdata(scn_symstrs, NULL); 464 symstrs = elf_getdata(scn_symstrs, NULL);
397 if (symstrs == NULL) 465 if (symstrs == NULL)
398 return -1; 466 goto out_elf_end;
399 467
400 nr_rel_entries = shdr_rel_plt.sh_size / shdr_rel_plt.sh_entsize; 468 nr_rel_entries = shdr_rel_plt.sh_size / shdr_rel_plt.sh_entsize;
401 plt_offset = shdr_plt.sh_offset; 469 plt_offset = shdr_plt.sh_offset;
@@ -414,7 +482,7 @@ static int dso__synthesize_plt_symbols(struct dso *self, Elf *elf,
414 f = symbol__new(plt_offset, shdr_plt.sh_entsize, 482 f = symbol__new(plt_offset, shdr_plt.sh_entsize,
415 sympltname, self->sym_priv_size, 0, verbose); 483 sympltname, self->sym_priv_size, 0, verbose);
416 if (!f) 484 if (!f)
417 return -1; 485 goto out_elf_end;
418 486
419 dso__insert_symbol(self, f); 487 dso__insert_symbol(self, f);
420 ++nr; 488 ++nr;
@@ -432,25 +500,31 @@ static int dso__synthesize_plt_symbols(struct dso *self, Elf *elf,
432 f = symbol__new(plt_offset, shdr_plt.sh_entsize, 500 f = symbol__new(plt_offset, shdr_plt.sh_entsize,
433 sympltname, self->sym_priv_size, 0, verbose); 501 sympltname, self->sym_priv_size, 0, verbose);
434 if (!f) 502 if (!f)
435 return -1; 503 goto out_elf_end;
436 504
437 dso__insert_symbol(self, f); 505 dso__insert_symbol(self, f);
438 ++nr; 506 ++nr;
439 } 507 }
440 } else {
441 /*
442 * TODO: There are still one more shdr_rel_plt.sh_type
443 * I have to investigate, but probably should be ignored.
444 */
445 } 508 }
446 509
447 return nr; 510 err = 0;
511out_elf_end:
512 elf_end(elf);
513out_close:
514 close(fd);
515
516 if (err == 0)
517 return nr;
518out:
519 fprintf(stderr, "%s: problems reading %s PLT info.\n",
520 __func__, self->name);
521 return 0;
448} 522}
449 523
450static int dso__load_sym(struct dso *self, int fd, const char *name, 524static int dso__load_sym(struct dso *self, int fd, const char *name,
451 symbol_filter_t filter, int verbose) 525 symbol_filter_t filter, int verbose, struct module *mod)
452{ 526{
453 Elf_Data *symstrs; 527 Elf_Data *symstrs, *secstrs;
454 uint32_t nr_syms; 528 uint32_t nr_syms;
455 int err = -1; 529 int err = -1;
456 uint32_t index; 530 uint32_t index;
@@ -458,10 +532,9 @@ static int dso__load_sym(struct dso *self, int fd, const char *name,
458 GElf_Shdr shdr; 532 GElf_Shdr shdr;
459 Elf_Data *syms; 533 Elf_Data *syms;
460 GElf_Sym sym; 534 GElf_Sym sym;
461 Elf_Scn *sec, *sec_dynsym; 535 Elf_Scn *sec, *sec_strndx;
462 Elf *elf; 536 Elf *elf;
463 size_t dynsym_idx; 537 int nr = 0, kernel = !strcmp("[kernel]", self->name);
464 int nr = 0;
465 538
466 elf = elf_begin(fd, ELF_C_READ_MMAP, NULL); 539 elf = elf_begin(fd, ELF_C_READ_MMAP, NULL);
467 if (elf == NULL) { 540 if (elf == NULL) {
@@ -477,32 +550,11 @@ static int dso__load_sym(struct dso *self, int fd, const char *name,
477 goto out_elf_end; 550 goto out_elf_end;
478 } 551 }
479 552
480 /*
481 * We need to check if we have a .dynsym, so that we can handle the
482 * .plt, synthesizing its symbols, that aren't on the symtabs (be it
483 * .dynsym or .symtab)
484 */
485 sec_dynsym = elf_section_by_name(elf, &ehdr, &shdr,
486 ".dynsym", &dynsym_idx);
487 if (sec_dynsym != NULL) {
488 nr = dso__synthesize_plt_symbols(self, elf, &ehdr,
489 sec_dynsym, &shdr,
490 dynsym_idx, verbose);
491 if (nr < 0)
492 goto out_elf_end;
493 }
494
495 /*
496 * But if we have a full .symtab (that is a superset of .dynsym) we
497 * should add the symbols not in the .dynsyn
498 */
499 sec = elf_section_by_name(elf, &ehdr, &shdr, ".symtab", NULL); 553 sec = elf_section_by_name(elf, &ehdr, &shdr, ".symtab", NULL);
500 if (sec == NULL) { 554 if (sec == NULL) {
501 if (sec_dynsym == NULL) 555 sec = elf_section_by_name(elf, &ehdr, &shdr, ".dynsym", NULL);
556 if (sec == NULL)
502 goto out_elf_end; 557 goto out_elf_end;
503
504 sec = sec_dynsym;
505 gelf_getshdr(sec, &shdr);
506 } 558 }
507 559
508 syms = elf_getdata(sec, NULL); 560 syms = elf_getdata(sec, NULL);
@@ -517,15 +569,34 @@ static int dso__load_sym(struct dso *self, int fd, const char *name,
517 if (symstrs == NULL) 569 if (symstrs == NULL)
518 goto out_elf_end; 570 goto out_elf_end;
519 571
572 sec_strndx = elf_getscn(elf, ehdr.e_shstrndx);
573 if (sec_strndx == NULL)
574 goto out_elf_end;
575
576 secstrs = elf_getdata(sec_strndx, NULL);
577 if (secstrs == NULL)
578 goto out_elf_end;
579
520 nr_syms = shdr.sh_size / shdr.sh_entsize; 580 nr_syms = shdr.sh_size / shdr.sh_entsize;
521 581
522 memset(&sym, 0, sizeof(sym)); 582 memset(&sym, 0, sizeof(sym));
583 if (!kernel) {
584 self->adjust_symbols = (ehdr.e_type == ET_EXEC ||
585 elf_section_by_name(elf, &ehdr, &shdr,
586 ".gnu.prelink_undo",
587 NULL) != NULL);
588 } else self->adjust_symbols = 0;
523 589
524 elf_symtab__for_each_symbol(syms, nr_syms, index, sym) { 590 elf_symtab__for_each_symbol(syms, nr_syms, index, sym) {
525 struct symbol *f; 591 struct symbol *f;
592 const char *name;
593 char *demangled;
526 u64 obj_start; 594 u64 obj_start;
595 struct section *section = NULL;
596 int is_label = elf_sym__is_label(&sym);
597 const char *section_name;
527 598
528 if (!elf_sym__is_function(&sym)) 599 if (!is_label && !elf_sym__is_function(&sym))
529 continue; 600 continue;
530 601
531 sec = elf_getscn(elf, sym.st_shndx); 602 sec = elf_getscn(elf, sym.st_shndx);
@@ -533,19 +604,51 @@ static int dso__load_sym(struct dso *self, int fd, const char *name,
533 goto out_elf_end; 604 goto out_elf_end;
534 605
535 gelf_getshdr(sec, &shdr); 606 gelf_getshdr(sec, &shdr);
607
608 if (is_label && !elf_sec__is_text(&shdr, secstrs))
609 continue;
610
611 section_name = elf_sec__name(&shdr, secstrs);
536 obj_start = sym.st_value; 612 obj_start = sym.st_value;
537 613
538 sym.st_value -= shdr.sh_addr - shdr.sh_offset; 614 if (self->adjust_symbols) {
615 if (verbose >= 2)
616 printf("adjusting symbol: st_value: %Lx sh_addr: %Lx sh_offset: %Lx\n",
617 (u64)sym.st_value, (u64)shdr.sh_addr, (u64)shdr.sh_offset);
618
619 sym.st_value -= shdr.sh_addr - shdr.sh_offset;
620 }
539 621
540 f = symbol__new(sym.st_value, sym.st_size, 622 if (mod) {
541 elf_sym__name(&sym, symstrs), 623 section = mod->sections->find_section(mod->sections, section_name);
624 if (section)
625 sym.st_value += section->vma;
626 else {
627 fprintf(stderr, "dso__load_sym() module %s lookup of %s failed\n",
628 mod->name, section_name);
629 goto out_elf_end;
630 }
631 }
632 /*
633 * We need to figure out if the object was created from C++ sources
634 * DWARF DW_compile_unit has this, but we don't always have access
635 * to it...
636 */
637 name = elf_sym__name(&sym, symstrs);
638 demangled = bfd_demangle(NULL, name, DMGL_PARAMS | DMGL_ANSI);
639 if (demangled != NULL)
640 name = demangled;
641
642 f = symbol__new(sym.st_value, sym.st_size, name,
542 self->sym_priv_size, obj_start, verbose); 643 self->sym_priv_size, obj_start, verbose);
644 free(demangled);
543 if (!f) 645 if (!f)
544 goto out_elf_end; 646 goto out_elf_end;
545 647
546 if (filter && filter(self, f)) 648 if (filter && filter(self, f))
547 symbol__delete(f, self->sym_priv_size); 649 symbol__delete(f, self->sym_priv_size);
548 else { 650 else {
651 f->module = mod;
549 dso__insert_symbol(self, f); 652 dso__insert_symbol(self, f);
550 nr++; 653 nr++;
551 } 654 }
@@ -558,10 +661,69 @@ out_close:
558 return err; 661 return err;
559} 662}
560 663
664#define BUILD_ID_SIZE 128
665
666static char *dso__read_build_id(struct dso *self, int verbose)
667{
668 int i;
669 GElf_Ehdr ehdr;
670 GElf_Shdr shdr;
671 Elf_Data *build_id_data;
672 Elf_Scn *sec;
673 char *build_id = NULL, *bid;
674 unsigned char *raw;
675 Elf *elf;
676 int fd = open(self->name, O_RDONLY);
677
678 if (fd < 0)
679 goto out;
680
681 elf = elf_begin(fd, ELF_C_READ_MMAP, NULL);
682 if (elf == NULL) {
683 if (verbose)
684 fprintf(stderr, "%s: cannot read %s ELF file.\n",
685 __func__, self->name);
686 goto out_close;
687 }
688
689 if (gelf_getehdr(elf, &ehdr) == NULL) {
690 if (verbose)
691 fprintf(stderr, "%s: cannot get elf header.\n", __func__);
692 goto out_elf_end;
693 }
694
695 sec = elf_section_by_name(elf, &ehdr, &shdr, ".note.gnu.build-id", NULL);
696 if (sec == NULL)
697 goto out_elf_end;
698
699 build_id_data = elf_getdata(sec, NULL);
700 if (build_id_data == NULL)
701 goto out_elf_end;
702 build_id = malloc(BUILD_ID_SIZE);
703 if (build_id == NULL)
704 goto out_elf_end;
705 raw = build_id_data->d_buf + 16;
706 bid = build_id;
707
708 for (i = 0; i < 20; ++i) {
709 sprintf(bid, "%02x", *raw);
710 ++raw;
711 bid += 2;
712 }
713 if (verbose)
714 printf("%s(%s): %s\n", __func__, self->name, build_id);
715out_elf_end:
716 elf_end(elf);
717out_close:
718 close(fd);
719out:
720 return build_id;
721}
722
561int dso__load(struct dso *self, symbol_filter_t filter, int verbose) 723int dso__load(struct dso *self, symbol_filter_t filter, int verbose)
562{ 724{
563 int size = strlen(self->name) + sizeof("/usr/lib/debug%s.debug"); 725 int size = PATH_MAX;
564 char *name = malloc(size); 726 char *name = malloc(size), *build_id = NULL;
565 int variant = 0; 727 int variant = 0;
566 int ret = -1; 728 int ret = -1;
567 int fd; 729 int fd;
@@ -569,6 +731,8 @@ int dso__load(struct dso *self, symbol_filter_t filter, int verbose)
569 if (!name) 731 if (!name)
570 return -1; 732 return -1;
571 733
734 self->adjust_symbols = 0;
735
572 if (strncmp(self->name, "/tmp/perf-", 10) == 0) 736 if (strncmp(self->name, "/tmp/perf-", 10) == 0)
573 return dso__load_perf_map(self, filter, verbose); 737 return dso__load_perf_map(self, filter, verbose);
574 738
@@ -581,7 +745,18 @@ more:
581 case 1: /* Ubuntu */ 745 case 1: /* Ubuntu */
582 snprintf(name, size, "/usr/lib/debug%s", self->name); 746 snprintf(name, size, "/usr/lib/debug%s", self->name);
583 break; 747 break;
584 case 2: /* Sane people */ 748 case 2:
749 build_id = dso__read_build_id(self, verbose);
750 if (build_id != NULL) {
751 snprintf(name, size,
752 "/usr/lib/debug/.build-id/%.2s/%s.debug",
753 build_id, build_id + 2);
754 free(build_id);
755 break;
756 }
757 variant++;
758 /* Fall thru */
759 case 3: /* Sane people */
585 snprintf(name, size, "%s", self->name); 760 snprintf(name, size, "%s", self->name);
586 break; 761 break;
587 762
@@ -593,7 +768,7 @@ more:
593 fd = open(name, O_RDONLY); 768 fd = open(name, O_RDONLY);
594 } while (fd < 0); 769 } while (fd < 0);
595 770
596 ret = dso__load_sym(self, fd, name, filter, verbose); 771 ret = dso__load_sym(self, fd, name, filter, verbose, NULL);
597 close(fd); 772 close(fd);
598 773
599 /* 774 /*
@@ -602,11 +777,96 @@ more:
602 if (!ret) 777 if (!ret)
603 goto more; 778 goto more;
604 779
780 if (ret > 0) {
781 int nr_plt = dso__synthesize_plt_symbols(self, verbose);
782 if (nr_plt > 0)
783 ret += nr_plt;
784 }
605out: 785out:
606 free(name); 786 free(name);
607 return ret; 787 return ret;
608} 788}
609 789
790static int dso__load_module(struct dso *self, struct mod_dso *mods, const char *name,
791 symbol_filter_t filter, int verbose)
792{
793 struct module *mod = mod_dso__find_module(mods, name);
794 int err = 0, fd;
795
796 if (mod == NULL || !mod->active)
797 return err;
798
799 fd = open(mod->path, O_RDONLY);
800
801 if (fd < 0)
802 return err;
803
804 err = dso__load_sym(self, fd, name, filter, verbose, mod);
805 close(fd);
806
807 return err;
808}
809
810int dso__load_modules(struct dso *self, symbol_filter_t filter, int verbose)
811{
812 struct mod_dso *mods = mod_dso__new_dso("modules");
813 struct module *pos;
814 struct rb_node *next;
815 int err;
816
817 err = mod_dso__load_modules(mods);
818
819 if (err <= 0)
820 return err;
821
822 /*
823 * Iterate over modules, and load active symbols.
824 */
825 next = rb_first(&mods->mods);
826 while (next) {
827 pos = rb_entry(next, struct module, rb_node);
828 err = dso__load_module(self, mods, pos->name, filter, verbose);
829
830 if (err < 0)
831 break;
832
833 next = rb_next(&pos->rb_node);
834 }
835
836 if (err < 0) {
837 mod_dso__delete_modules(mods);
838 mod_dso__delete_self(mods);
839 }
840
841 return err;
842}
843
844static inline void dso__fill_symbol_holes(struct dso *self)
845{
846 struct symbol *prev = NULL;
847 struct rb_node *nd;
848
849 for (nd = rb_last(&self->syms); nd; nd = rb_prev(nd)) {
850 struct symbol *pos = rb_entry(nd, struct symbol, rb_node);
851
852 if (prev) {
853 u64 hole = 0;
854 int alias = pos->start == prev->start;
855
856 if (!alias)
857 hole = prev->start - pos->end - 1;
858
859 if (hole || alias) {
860 if (alias)
861 pos->end = prev->end;
862 else if (hole)
863 pos->end = prev->start - 1;
864 }
865 }
866 prev = pos;
867 }
868}
869
610static int dso__load_vmlinux(struct dso *self, const char *vmlinux, 870static int dso__load_vmlinux(struct dso *self, const char *vmlinux,
611 symbol_filter_t filter, int verbose) 871 symbol_filter_t filter, int verbose)
612{ 872{
@@ -615,21 +875,28 @@ static int dso__load_vmlinux(struct dso *self, const char *vmlinux,
615 if (fd < 0) 875 if (fd < 0)
616 return -1; 876 return -1;
617 877
618 err = dso__load_sym(self, fd, vmlinux, filter, verbose); 878 err = dso__load_sym(self, fd, vmlinux, filter, verbose, NULL);
879
880 if (err > 0)
881 dso__fill_symbol_holes(self);
882
619 close(fd); 883 close(fd);
620 884
621 return err; 885 return err;
622} 886}
623 887
624int dso__load_kernel(struct dso *self, const char *vmlinux, 888int dso__load_kernel(struct dso *self, const char *vmlinux,
625 symbol_filter_t filter, int verbose) 889 symbol_filter_t filter, int verbose, int modules)
626{ 890{
627 int err = -1; 891 int err = -1;
628 892
629 if (vmlinux) 893 if (vmlinux) {
630 err = dso__load_vmlinux(self, vmlinux, filter, verbose); 894 err = dso__load_vmlinux(self, vmlinux, filter, verbose);
895 if (err > 0 && modules)
896 err = dso__load_modules(self, filter, verbose);
897 }
631 898
632 if (err) 899 if (err <= 0)
633 err = dso__load_kallsyms(self, filter, verbose); 900 err = dso__load_kallsyms(self, filter, verbose);
634 901
635 return err; 902 return err;
diff --git a/tools/perf/util/symbol.h b/tools/perf/util/symbol.h
index ea332e56e458..2f92b21c712d 100644
--- a/tools/perf/util/symbol.h
+++ b/tools/perf/util/symbol.h
@@ -2,9 +2,10 @@
2#define _PERF_SYMBOL_ 1 2#define _PERF_SYMBOL_ 1
3 3
4#include <linux/types.h> 4#include <linux/types.h>
5#include "../types.h" 5#include "types.h"
6#include "list.h" 6#include <linux/list.h>
7#include "rbtree.h" 7#include <linux/rbtree.h>
8#include "module.h"
8 9
9struct symbol { 10struct symbol {
10 struct rb_node rb_node; 11 struct rb_node rb_node;
@@ -13,6 +14,7 @@ struct symbol {
13 u64 obj_start; 14 u64 obj_start;
14 u64 hist_sum; 15 u64 hist_sum;
15 u64 *hist; 16 u64 *hist;
17 struct module *module;
16 void *priv; 18 void *priv;
17 char name[0]; 19 char name[0];
18}; 20};
@@ -20,8 +22,10 @@ struct symbol {
20struct dso { 22struct dso {
21 struct list_head node; 23 struct list_head node;
22 struct rb_root syms; 24 struct rb_root syms;
23 unsigned int sym_priv_size;
24 struct symbol *(*find_symbol)(struct dso *, u64 ip); 25 struct symbol *(*find_symbol)(struct dso *, u64 ip);
26 unsigned int sym_priv_size;
27 unsigned char adjust_symbols;
28 unsigned char slen_calculated;
25 char name[0]; 29 char name[0];
26}; 30};
27 31
@@ -40,7 +44,8 @@ static inline void *dso__sym_priv(struct dso *self, struct symbol *sym)
40struct symbol *dso__find_symbol(struct dso *self, u64 ip); 44struct symbol *dso__find_symbol(struct dso *self, u64 ip);
41 45
42int dso__load_kernel(struct dso *self, const char *vmlinux, 46int dso__load_kernel(struct dso *self, const char *vmlinux,
43 symbol_filter_t filter, int verbose); 47 symbol_filter_t filter, int verbose, int modules);
48int dso__load_modules(struct dso *self, symbol_filter_t filter, int verbose);
44int dso__load(struct dso *self, symbol_filter_t filter, int verbose); 49int dso__load(struct dso *self, symbol_filter_t filter, int verbose);
45 50
46size_t dso__fprintf(struct dso *self, FILE *fp); 51size_t dso__fprintf(struct dso *self, FILE *fp);
diff --git a/tools/perf/types.h b/tools/perf/util/types.h
index 5e75f9005940..5e75f9005940 100644
--- a/tools/perf/types.h
+++ b/tools/perf/util/types.h
diff --git a/tools/perf/util/util.h b/tools/perf/util/util.h
index b8cfed776d81..68fe157d72fb 100644
--- a/tools/perf/util/util.h
+++ b/tools/perf/util/util.h
@@ -50,6 +50,7 @@
50#include <unistd.h> 50#include <unistd.h>
51#include <stdio.h> 51#include <stdio.h>
52#include <sys/stat.h> 52#include <sys/stat.h>
53#include <sys/statfs.h>
53#include <fcntl.h> 54#include <fcntl.h>
54#include <stddef.h> 55#include <stddef.h>
55#include <stdlib.h> 56#include <stdlib.h>
@@ -67,7 +68,6 @@
67#include <assert.h> 68#include <assert.h>
68#include <regex.h> 69#include <regex.h>
69#include <utime.h> 70#include <utime.h>
70#ifndef __MINGW32__
71#include <sys/wait.h> 71#include <sys/wait.h>
72#include <sys/poll.h> 72#include <sys/poll.h>
73#include <sys/socket.h> 73#include <sys/socket.h>
@@ -81,20 +81,7 @@
81#include <netdb.h> 81#include <netdb.h>
82#include <pwd.h> 82#include <pwd.h>
83#include <inttypes.h> 83#include <inttypes.h>
84#if defined(__CYGWIN__) 84#include "../../../include/linux/magic.h"
85#undef _XOPEN_SOURCE
86#include <grp.h>
87#define _XOPEN_SOURCE 600
88#include "compat/cygwin.h"
89#else
90#undef _ALL_SOURCE /* AIX 5.3L defines a struct list with _ALL_SOURCE. */
91#include <grp.h>
92#define _ALL_SOURCE 1
93#endif
94#else /* __MINGW32__ */
95/* pull in Windows compatibility stuff */
96#include "compat/mingw.h"
97#endif /* __MINGW32__ */
98 85
99#ifndef NO_ICONV 86#ifndef NO_ICONV
100#include <iconv.h> 87#include <iconv.h>
diff --git a/tools/perf/util/wrapper.c b/tools/perf/util/wrapper.c
index 6350d65f6d9e..4574ac28396f 100644
--- a/tools/perf/util/wrapper.c
+++ b/tools/perf/util/wrapper.c
@@ -7,7 +7,7 @@
7 * There's no pack memory to release - but stay close to the Git 7 * There's no pack memory to release - but stay close to the Git
8 * version so wrap this away: 8 * version so wrap this away:
9 */ 9 */
10static inline void release_pack_memory(size_t size, int flag) 10static inline void release_pack_memory(size_t size __used, int flag __used)
11{ 11{
12} 12}
13 13
@@ -59,7 +59,8 @@ void *xmemdupz(const void *data, size_t len)
59char *xstrndup(const char *str, size_t len) 59char *xstrndup(const char *str, size_t len)
60{ 60{
61 char *p = memchr(str, '\0', len); 61 char *p = memchr(str, '\0', len);
62 return xmemdupz(str, p ? p - str : len); 62
63 return xmemdupz(str, p ? (size_t)(p - str) : len);
63} 64}
64 65
65void *xrealloc(void *ptr, size_t size) 66void *xrealloc(void *ptr, size_t size)
diff --git a/virt/kvm/ioapic.c b/virt/kvm/ioapic.c
index 1eddae94bab3..1150c6d5c7b8 100644
--- a/virt/kvm/ioapic.c
+++ b/virt/kvm/ioapic.c
@@ -95,8 +95,6 @@ static int ioapic_service(struct kvm_ioapic *ioapic, unsigned int idx)
95 if (injected && pent->fields.trig_mode == IOAPIC_LEVEL_TRIG) 95 if (injected && pent->fields.trig_mode == IOAPIC_LEVEL_TRIG)
96 pent->fields.remote_irr = 1; 96 pent->fields.remote_irr = 1;
97 } 97 }
98 if (!pent->fields.trig_mode)
99 ioapic->irr &= ~(1 << idx);
100 98
101 return injected; 99 return injected;
102} 100}
@@ -136,7 +134,8 @@ static void ioapic_write_indirect(struct kvm_ioapic *ioapic, u32 val)
136 mask_after = ioapic->redirtbl[index].fields.mask; 134 mask_after = ioapic->redirtbl[index].fields.mask;
137 if (mask_before != mask_after) 135 if (mask_before != mask_after)
138 kvm_fire_mask_notifiers(ioapic->kvm, index, mask_after); 136 kvm_fire_mask_notifiers(ioapic->kvm, index, mask_after);
139 if (ioapic->irr & (1 << index)) 137 if (ioapic->redirtbl[index].fields.trig_mode == IOAPIC_LEVEL_TRIG
138 && ioapic->irr & (1 << index))
140 ioapic_service(ioapic, index); 139 ioapic_service(ioapic, index);
141 break; 140 break;
142 } 141 }
@@ -184,9 +183,10 @@ int kvm_ioapic_set_irq(struct kvm_ioapic *ioapic, int irq, int level)
184 if (!level) 183 if (!level)
185 ioapic->irr &= ~mask; 184 ioapic->irr &= ~mask;
186 else { 185 else {
186 int edge = (entry.fields.trig_mode == IOAPIC_EDGE_TRIG);
187 ioapic->irr |= mask; 187 ioapic->irr |= mask;
188 if ((!entry.fields.trig_mode && old_irr != ioapic->irr) 188 if ((edge && old_irr != ioapic->irr) ||
189 || !entry.fields.remote_irr) 189 (!edge && !entry.fields.remote_irr))
190 ret = ioapic_service(ioapic, irq); 190 ret = ioapic_service(ioapic, irq);
191 } 191 }
192 } 192 }
diff --git a/virt/kvm/irq_comm.c b/virt/kvm/irq_comm.c
index a8bd466d00cc..ddc17f0e2f35 100644
--- a/virt/kvm/irq_comm.c
+++ b/virt/kvm/irq_comm.c
@@ -160,7 +160,8 @@ void kvm_notify_acked_irq(struct kvm *kvm, unsigned irqchip, unsigned pin)
160 unsigned gsi = pin; 160 unsigned gsi = pin;
161 161
162 list_for_each_entry(e, &kvm->irq_routing, link) 162 list_for_each_entry(e, &kvm->irq_routing, link)
163 if (e->irqchip.irqchip == irqchip && 163 if (e->type == KVM_IRQ_ROUTING_IRQCHIP &&
164 e->irqchip.irqchip == irqchip &&
164 e->irqchip.pin == pin) { 165 e->irqchip.pin == pin) {
165 gsi = e->gsi; 166 gsi = e->gsi;
166 break; 167 break;
@@ -259,6 +260,7 @@ static int setup_routing_entry(struct kvm_kernel_irq_routing_entry *e,
259 int delta; 260 int delta;
260 261
261 e->gsi = ue->gsi; 262 e->gsi = ue->gsi;
263 e->type = ue->type;
262 switch (ue->type) { 264 switch (ue->type) {
263 case KVM_IRQ_ROUTING_IRQCHIP: 265 case KVM_IRQ_ROUTING_IRQCHIP:
264 delta = 0; 266 delta = 0;
diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
index 764554350ed8..2884baf1d5f9 100644
--- a/virt/kvm/kvm_main.c
+++ b/virt/kvm/kvm_main.c
@@ -746,6 +746,7 @@ static bool make_all_cpus_request(struct kvm *kvm, unsigned int req)
746 cpumask_clear(cpus); 746 cpumask_clear(cpus);
747 747
748 me = get_cpu(); 748 me = get_cpu();
749 spin_lock(&kvm->requests_lock);
749 for (i = 0; i < KVM_MAX_VCPUS; ++i) { 750 for (i = 0; i < KVM_MAX_VCPUS; ++i) {
750 vcpu = kvm->vcpus[i]; 751 vcpu = kvm->vcpus[i];
751 if (!vcpu) 752 if (!vcpu)
@@ -762,6 +763,7 @@ static bool make_all_cpus_request(struct kvm *kvm, unsigned int req)
762 smp_call_function_many(cpus, ack_flush, NULL, 1); 763 smp_call_function_many(cpus, ack_flush, NULL, 1);
763 else 764 else
764 called = false; 765 called = false;
766 spin_unlock(&kvm->requests_lock);
765 put_cpu(); 767 put_cpu();
766 free_cpumask_var(cpus); 768 free_cpumask_var(cpus);
767 return called; 769 return called;
@@ -982,6 +984,7 @@ static struct kvm *kvm_create_vm(void)
982 kvm->mm = current->mm; 984 kvm->mm = current->mm;
983 atomic_inc(&kvm->mm->mm_count); 985 atomic_inc(&kvm->mm->mm_count);
984 spin_lock_init(&kvm->mmu_lock); 986 spin_lock_init(&kvm->mmu_lock);
987 spin_lock_init(&kvm->requests_lock);
985 kvm_io_bus_init(&kvm->pio_bus); 988 kvm_io_bus_init(&kvm->pio_bus);
986 mutex_init(&kvm->lock); 989 mutex_init(&kvm->lock);
987 kvm_io_bus_init(&kvm->mmio_bus); 990 kvm_io_bus_init(&kvm->mmio_bus);
@@ -1194,6 +1197,8 @@ int __kvm_set_memory_region(struct kvm *kvm,
1194 if (!new.dirty_bitmap) 1197 if (!new.dirty_bitmap)
1195 goto out_free; 1198 goto out_free;
1196 memset(new.dirty_bitmap, 0, dirty_bytes); 1199 memset(new.dirty_bitmap, 0, dirty_bytes);
1200 if (old.npages)
1201 kvm_arch_flush_shadow(kvm);
1197 } 1202 }
1198#endif /* not defined CONFIG_S390 */ 1203#endif /* not defined CONFIG_S390 */
1199 1204